From baaed4700053ddc98612a5f8e5a6240891f4add3 Mon Sep 17 00:00:00 2001 From: ersonp Date: Wed, 21 Apr 2021 15:25:31 +0530 Subject: [PATCH 1/6] replaced go:generate with go:embed --- cmd/apps/skychat/chat.go | 24 +++- cmd/apps/skychat/static.go | 262 ------------------------------------- 2 files changed, 21 insertions(+), 265 deletions(-) delete mode 100644 cmd/apps/skychat/static.go diff --git a/cmd/apps/skychat/chat.go b/cmd/apps/skychat/chat.go index 2f1e1cd3e8..360fe5e4b0 100644 --- a/cmd/apps/skychat/chat.go +++ b/cmd/apps/skychat/chat.go @@ -1,14 +1,14 @@ -//go:generate esc -o static.go -prefix static static - /* skychat app for skywire visor */ package main import ( + "embed" "encoding/json" "flag" "fmt" + "io/fs" "net" "net/http" "os" @@ -39,6 +39,9 @@ var ( connsMu sync.Mutex ) +//go:embed static +var embededFiles embed.FS + func main() { appC = app.NewClient(nil) defer appC.Close() @@ -56,7 +59,7 @@ func main() { conns = make(map[cipher.PubKey]net.Conn) go listenLoop() - http.Handle("/", http.FileServer(FS(false))) + http.Handle("/", http.FileServer(getFileSystem(false))) http.HandleFunc("/message", messageHandler) http.HandleFunc("/sse", sseHandler) @@ -200,3 +203,18 @@ func sseHandler(w http.ResponseWriter, req *http.Request) { } } } + +func getFileSystem(useOS bool) http.FileSystem { + if useOS { + fmt.Print("using live mode") + return http.FS(os.DirFS("static")) + } + + fmt.Print("using embed mode") + fsys, err := fs.Sub(embededFiles, "static") + if err != nil { + panic(err) + } + + return http.FS(fsys) +} diff --git a/cmd/apps/skychat/static.go b/cmd/apps/skychat/static.go deleted file mode 100644 index 429f2111d9..0000000000 --- a/cmd/apps/skychat/static.go +++ /dev/null @@ -1,262 +0,0 @@ -// Code generated by "esc -o static.go -prefix static static"; DO NOT EDIT. - -package main - -import ( - "bytes" - "compress/gzip" - "encoding/base64" - "fmt" - "io" - "io/ioutil" - "net/http" - "os" - "path" - "sync" - "time" -) - -type _escLocalFS struct{} - -var _escLocal _escLocalFS - -type _escStaticFS struct{} - -var _escStatic _escStaticFS - -type _escDirectory struct { - fs http.FileSystem - name string -} - -type _escFile struct { - compressed string - size int64 - modtime int64 - local string - isDir bool - - once sync.Once - data []byte - name string -} - -func (_escLocalFS) Open(name string) (http.File, error) { - f, present := _escData[path.Clean(name)] - if !present { - return nil, os.ErrNotExist - } - return os.Open(f.local) -} - -func (_escStaticFS) prepare(name string) (*_escFile, error) { - f, present := _escData[path.Clean(name)] - if !present { - return nil, os.ErrNotExist - } - var err error - f.once.Do(func() { - f.name = path.Base(name) - if f.size == 0 { - return - } - var gr *gzip.Reader - b64 := base64.NewDecoder(base64.StdEncoding, bytes.NewBufferString(f.compressed)) - gr, err = gzip.NewReader(b64) - if err != nil { - return - } - f.data, err = ioutil.ReadAll(gr) - }) - if err != nil { - return nil, err - } - return f, nil -} - -func (fs _escStaticFS) Open(name string) (http.File, error) { - f, err := fs.prepare(name) - if err != nil { - return nil, err - } - return f.File() -} - -func (dir _escDirectory) Open(name string) (http.File, error) { - return dir.fs.Open(dir.name + name) -} - -func (f *_escFile) File() (http.File, error) { - type httpFile struct { - *bytes.Reader - *_escFile - } - return &httpFile{ - Reader: bytes.NewReader(f.data), - _escFile: f, - }, nil -} - -func (f *_escFile) Close() error { - return nil -} - -func (f *_escFile) Readdir(count int) ([]os.FileInfo, error) { - if !f.isDir { - return nil, fmt.Errorf(" escFile.Readdir: '%s' is not directory", f.name) - } - - fis, ok := _escDirs[f.local] - if !ok { - return nil, fmt.Errorf(" escFile.Readdir: '%s' is directory, but we have no info about content of this dir, local=%s", f.name, f.local) - } - limit := count - if count <= 0 || limit > len(fis) { - limit = len(fis) - } - - if len(fis) == 0 && count > 0 { - return nil, io.EOF - } - - return fis[0:limit], nil -} - -func (f *_escFile) Stat() (os.FileInfo, error) { - return f, nil -} - -func (f *_escFile) Name() string { - return f.name -} - -func (f *_escFile) Size() int64 { - return f.size -} - -func (f *_escFile) Mode() os.FileMode { - return 0 -} - -func (f *_escFile) ModTime() time.Time { - return time.Unix(f.modtime, 0) -} - -func (f *_escFile) IsDir() bool { - return f.isDir -} - -func (f *_escFile) Sys() interface{} { - return f -} - -// FS returns a http.Filesystem for the embedded assets. If useLocal is true, -// the filesystem's contents are instead used. -func FS(useLocal bool) http.FileSystem { - if useLocal { - return _escLocal - } - return _escStatic -} - -// Dir returns a http.Filesystem for the embedded assets on a given prefix dir. -// If useLocal is true, the filesystem's contents are instead used. -func Dir(useLocal bool, name string) http.FileSystem { - if useLocal { - return _escDirectory{fs: _escLocal, name: name} - } - return _escDirectory{fs: _escStatic, name: name} -} - -// FSByte returns the named file from the embedded assets. If useLocal is -// true, the filesystem's contents are instead used. -func FSByte(useLocal bool, name string) ([]byte, error) { - if useLocal { - f, err := _escLocal.Open(name) - if err != nil { - return nil, err - } - b, err := ioutil.ReadAll(f) - _ = f.Close() - return b, err - } - f, err := _escStatic.prepare(name) - if err != nil { - return nil, err - } - return f.data, nil -} - -// FSMustByte is the same as FSByte, but panics if name is not present. -func FSMustByte(useLocal bool, name string) []byte { - b, err := FSByte(useLocal, name) - if err != nil { - panic(err) - } - return b -} - -// FSString is the string version of FSByte. -func FSString(useLocal bool, name string) (string, error) { - b, err := FSByte(useLocal, name) - return string(b), err -} - -// FSMustString is the string version of FSMustByte. -func FSMustString(useLocal bool, name string) string { - return string(FSMustByte(useLocal, name)) -} - -var _escData = map[string]*_escFile{ - - "/index.html": { - name: "index.html", - local: "static/index.html", - size: 5825, - modtime: 1594811593, - compressed: ` -H4sIAAAAAAAC/7xYbW/juBH+nl8xqyxONi6WnWyS3smSi2u7xbW4vSuaA/phEVxoaWwRS5EqSSVxDf/3 -gtS7LDm+LlDngyW+DJ955uHMOMG7WER6lyEkOmWri4vAfAMjfBs6yJ3VBUCQIInNA0CQoiYQJUQq1KGT -683sO2d1Ucxpqhmu/pwQDT9kWTAv3stJpXfmxTzbo2BfPJvPRnA925CUsp0PinA1UyjpZtlboeh/0Ifr -D9lrayYSTEgfLu/v78vRQ3EirEW8a58SU5UxsvNhw7BtIaV8liDdJtqH68XiOWnPEbml3IdFa2xNoi9b -KXIe+3B5e3d3fX/bO5m0j9X4qmcxRkISTQX3gQuOxw5QnqCkumcp7/DEqNIzS+SRlYzEMeXbLtI++sqq -p2iMayLPYce8zmIqMSrQR4LlKW8teKGxTny4uVl04lIDusZ0IFzff09u1n3ePIkRzShyPTOudiTC8NWH -6yPnZlpk7TPGTDHatlbuXQutRdqHKJ5Rbph48SGhcYwdXxOqcaYyEtkIvEiSLXuRbnYjYzRTVL2BjHgk -0vQZYV+RY09ZNhuihOi1eD1Nx/8cv1ok3ocODW2ZF4hac0LGKGeSxDRXPtzUka8xp6gU2eJRHEdk0fVn -2IoJYc/N45VUYwox0dg+tJTo3d1g5ojjeOxcaw3TAVvXH26H5b6AhXf3/9BTkxarhCBTwt7wxFPIY5SN -1i6v76PonhgmhzdIjJA+d7ZsNrff3d6Pka8ywk9LteRqxnCj+0IolVVM3WSvoASjMVxu7s3fmHcbIdNz -klkTpRNiv0Qc0LrNMy1Ax6qhPMv1Z1NLQxO5x7NI8I/kUuYmWRakAXZ8uB7CcdbFbIFU+TqlXZhdUHAz -zlEnHl8Hzd6RXDPKu2VtIGHaOP8uFxbeH1q1wXYi87oVCeZFZ2MeTbdQ9jjElEeIGFEqdMpS6ZStCwQW -QznZReaA4AWi0CFZ5kUSicZ/VmsmOqFqugSJOpccNoQpXNZ2AQLrGFjHHKMgBzJGIkwEi1GGzkeuUUKW -rxmN4AvuHJiPbC5AOPBMWI6h820Dfm5w1m85Axq3vFDOsWMm9TqrYJ6zkp25padq61JCebWprFNO3355 -Sxvr7bRe2R6it329++SaRPapmP9aYv8lqUbYiVxCeeLZ1D4gjwfZDeaGmbr5jSTNdLnOOge2Td63qxFX -WuaRFnIybU/YSpBQ1VwDBSF8flyeWgIh8JyxoTVVNCCE/eGkEeVthPxIomQiIVwVk7+ROG4ULafTIQu/ -KYUP+dp4vcZJe0l1p82nb+oNp70sV8lETk/59Fk+DnETiyhPkWtvi/ojQ/P4p93f4onbWHenHuUc5Y+/ -fvoJvg27+83nKWB0FRBIJG5C57LW8vu9hDAM+/z/EdyirXPBB9c9GPlGjEZfKvUyjPRbqeH9Xh6COVkF -c0ZXTydorC5CqrZHNFphFWh/JilCCKnaehspUovbTdE1aIvGwKKtSr67HLJk5ff0fm+saGUo/VHkUk2m -nhYPWlK+nUy9jMQPmkg9ubkCd+FOD357wyfKc41vbXlaXnTPpxuY1NjfVdi/+Qbe9aVCecTyGFW9fHpE -SyPWjgzrDT3fDxdnSqqS4lmC6ic600A5q8D0r6v3e60Owdw+B5g2eqtDeTAKqQAf/GCO6Sow7Vc5bFLd -IZjbkUJCIwrqXtdhASmRy8ioh+MLfHxGrh/syMSdK4Vun69iuSd46RqEUKgzXA1FojgjJppACH9/+OVn -LyNSWUF7ZrRvvtnT2N+DVr6F9xei8QoMK761WXa9V7ajLoeqfYflCV3U96r4no6trfNP67THImGNbD2M -3OZ+z4BsJB7tVI/s8+LRsyVpeU4Ord6Hk3c3LQ+tbQPuZ7IBwEelCZnV5liW/neOcvdg7Qr5A2MTt/qN -7E7rkmR/a4QrMN+evRI/UaU9ial4xkmVfI/qE7LWYhLHzcrl11zwEFz3ZGHqcvBYu5Gqbae2tjP5OOVN -6zOqD2v4hDI2qKOk9sa9gj2kqBMR++D+45eHX92r4j9ofnEdlU3TdLOb7Bvp+b3QXlW30bfHH6ZwmB7f -GE8nyCfSdCCDuaBK9RKVJ75Mx5acnwJMmajuvsW1HLf4e67+eZE+lQW6yqxDNSSnWgiATOEpUgxvxllT -Xg3T5tlQTRhKPXn6K6EMY9DC6qiJ2Pu9rRdP0zGQh+PhwfBGxCgLmyOxIqen6I6wXyiPxYtHsqysMaZB -nkyrn2x1Ax3Mi19qwbz4h/V/AwAA//9G17pUwRYAAA== -`, - }, - - "/": { - name: "/", - local: `static`, - isDir: true, - }, -} - -var _escDirs = map[string][]os.FileInfo{ - - "static": { - _escData["/index.html"], - }, -} From 19f5dd75ea5a956e02787646994d08376ac6815e Mon Sep 17 00:00:00 2001 From: ersonp Date: Wed, 21 Apr 2021 15:44:31 +0530 Subject: [PATCH 2/6] make format and check --- cmd/apps/skychat/chat.go | 5 +- cmd/skywire-visor/commands/root.go | 5 +- go.mod | 46 +- go.sum | 359 +- internal/vpn/server.go | 4 +- pkg/app/appserver/mock_proc_manager.go | 10 +- pkg/app/appserver/mock_rpc_ingress_client.go | 12 +- pkg/visor/api.go | 3 +- pkg/visor/hypervisorconfig/config.go | 3 +- .../AudriusButkevicius/pfilter/filter.go | 39 +- vendor/github.com/StackExchange/wmi/wmi.go | 150 +- .../VictoriaMetrics/metrics/README.md | 8 +- .../VictoriaMetrics/metrics/histogram.go | 198 +- .../VictoriaMetrics/metrics/metrics.go | 47 +- .../metrics/process_metrics_linux.go | 188 +- .../metrics/process_metrics_other.go | 4 + .../github.com/andybalholm/brotli/encode.go | 3 +- vendor/github.com/andybalholm/brotli/go.mod | 2 - vendor/github.com/andybalholm/brotli/go.sum | 2 - vendor/github.com/andybalholm/brotli/http.go | 192 + .../github.com/andybalholm/brotli/writer.go | 42 +- vendor/github.com/go-ole/go-ole/com.go | 52 +- vendor/github.com/go-ole/go-ole/go.mod | 2 + vendor/github.com/go-ole/go-ole/go.sum | 2 + .../go-ole/go-ole/safearray_windows.go | 58 +- vendor/github.com/go-ole/go-ole/variables.go | 13 +- vendor/github.com/golang/gddo/LICENSE | 27 - .../github.com/golang/gddo/httputil/buster.go | 95 - .../golang/gddo/httputil/header/header.go | 298 - .../golang/gddo/httputil/httputil.go | 25 - .../golang/gddo/httputil/negotiate.go | 79 - .../golang/gddo/httputil/respbuf.go | 58 - .../github.com/golang/gddo/httputil/static.go | 265 - .../golang/gddo/httputil/transport.go | 87 - .../google/go-querystring/query/encode.go | 97 +- vendor/github.com/google/uuid/README.md | 2 +- vendor/github.com/google/uuid/hash.go | 4 +- vendor/github.com/google/uuid/marshal.go | 7 +- vendor/github.com/google/uuid/sql.go | 2 +- vendor/github.com/google/uuid/uuid.go | 10 +- vendor/github.com/google/uuid/version1.go | 12 +- vendor/github.com/google/uuid/version4.go | 15 +- .../klauspost/compress/flate/deflate.go | 57 +- .../klauspost/compress/flate/fast_encoder.go | 7 +- .../klauspost/compress/flate/gen_inflate.go | 274 + .../compress/flate/huffman_bit_writer.go | 13 + .../klauspost/compress/flate/huffman_code.go | 4 +- .../klauspost/compress/flate/inflate.go | 130 +- .../klauspost/compress/flate/inflate_gen.go | 922 + .../klauspost/compress/flate/level1.go | 22 +- .../klauspost/compress/flate/level2.go | 28 +- .../klauspost/compress/flate/level3.go | 54 +- .../klauspost/compress/flate/level4.go | 32 +- .../klauspost/compress/flate/level5.go | 46 +- .../klauspost/compress/flate/level6.go | 36 +- .../klauspost/compress/flate/token.go | 4 +- .../klauspost/compress/fse/bitreader.go | 27 +- .../klauspost/compress/fse/bytereader.go | 13 +- .../github.com/klauspost/compress/fse/fse.go | 37 +- .../klauspost/compress/gzip/gunzip.go | 344 + .../klauspost/compress/gzip/gzip.go | 269 + .../klauspost/compress/huff0/README.md | 6 +- .../klauspost/compress/huff0/bitreader.go | 256 +- .../klauspost/compress/huff0/decompress.go | 904 +- .../klauspost/compress/huff0/huff0.go | 13 +- .../klauspost/compress/zstd/README.md | 214 +- .../klauspost/compress/zstd/bitreader.go | 25 +- .../klauspost/compress/zstd/blockdec.go | 73 +- .../klauspost/compress/zstd/blockenc.go | 12 +- .../klauspost/compress/zstd/bytebuf.go | 4 +- .../klauspost/compress/zstd/bytereader.go | 18 +- .../klauspost/compress/zstd/decoder.go | 55 +- .../compress/zstd/decoder_options.go | 16 + .../klauspost/compress/zstd/dict.go | 104 + .../klauspost/compress/zstd/enc_better.go | 518 + .../klauspost/compress/zstd/enc_dfast.go | 112 +- .../klauspost/compress/zstd/enc_fast.go | 227 +- .../klauspost/compress/zstd/enc_params.go | 3 + .../klauspost/compress/zstd/encoder.go | 91 +- .../compress/zstd/encoder_options.go | 76 +- .../klauspost/compress/zstd/framedec.go | 55 +- .../klauspost/compress/zstd/fse_decoder.go | 23 +- .../klauspost/compress/zstd/fse_encoder.go | 8 +- .../klauspost/compress/zstd/history.go | 18 +- .../zstd/internal/xxhash/xxhash_amd64.s | 8 +- .../klauspost/compress/zstd/seqdec.go | 143 +- .../klauspost/compress/zstd/snappy.go | 2 +- .../klauspost/compress/zstd/zstd.go | 42 +- vendor/github.com/klauspost/cpuid/.travis.yml | 23 - vendor/github.com/klauspost/cpuid/README.md | 157 - vendor/github.com/klauspost/cpuid/cpuid.go | 1308 - .../klauspost/cpuid/detect_intel.go | 17 - .../github.com/klauspost/cpuid/detect_ref.go | 23 - vendor/github.com/klauspost/cpuid/generate.go | 4 - .../klauspost/cpuid/{ => v2}/.gitignore | 0 .../github.com/klauspost/cpuid/v2/.travis.yml | 63 + .../klauspost/cpuid/{ => v2}/CONTRIBUTING.txt | 0 .../klauspost/cpuid/{ => v2}/LICENSE | 0 .../github.com/klauspost/cpuid/v2/README.md | 136 + vendor/github.com/klauspost/cpuid/v2/cpuid.go | 1002 + .../klauspost/cpuid/{ => v2}/cpuid_386.s | 2 +- .../klauspost/cpuid/{ => v2}/cpuid_amd64.s | 2 +- .../klauspost/cpuid/v2/cpuid_arm64.s | 26 + .../klauspost/cpuid/v2/detect_arm64.go | 246 + .../klauspost/cpuid/v2/detect_ref.go | 14 + .../klauspost/cpuid/v2/detect_x86.go | 33 + .../klauspost/cpuid/v2/featureid_string.go | 173 + vendor/github.com/klauspost/cpuid/v2/go.mod | 3 + .../klauspost/cpuid/v2/os_darwin_arm64.go | 15 + .../klauspost/cpuid/v2/os_linux_arm64.go | 161 + .../klauspost/cpuid/v2/os_other_arm64.go | 11 + vendor/github.com/klauspost/pgzip/LICENSE | 3 +- vendor/github.com/klauspost/pgzip/README.md | 17 +- vendor/github.com/klauspost/pgzip/gzip.go | 80 +- .../klauspost/reedsolomon/.travis.yml | 10 +- .../klauspost/reedsolomon/README.md | 20 +- .../klauspost/reedsolomon/galois.go | 10 +- .../klauspost/reedsolomon/galois_gen_amd64.s | 6543 +-- .../github.com/klauspost/reedsolomon/gen.go | 249 - .../github.com/klauspost/reedsolomon/go.mod | 4 +- .../github.com/klauspost/reedsolomon/go.sum | 4 +- .../klauspost/reedsolomon/inversion_tree.go | 30 +- .../klauspost/reedsolomon/matrix.go | 5 +- .../klauspost/reedsolomon/options.go | 27 +- .../klauspost/reedsolomon/reedsolomon.go | 47 +- .../github.com/mholt/archiver/v3/.gitignore | 7 +- .../mholt/archiver/v3/.goreleaser.yml | 41 + .../github.com/mholt/archiver/v3/.prettierrc | 4 + vendor/github.com/mholt/archiver/v3/README.md | 101 +- .../github.com/mholt/archiver/v3/archiver.go | 5 + .../mholt/archiver/v3/azure-pipelines.yml | 51 +- vendor/github.com/mholt/archiver/v3/error.go | 27 + vendor/github.com/mholt/archiver/v3/go.mod | 15 +- vendor/github.com/mholt/archiver/v3/go.sum | 26 +- vendor/github.com/mholt/archiver/v3/gz.go | 4 +- vendor/github.com/mholt/archiver/v3/lz4.go | 11 +- vendor/github.com/mholt/archiver/v3/rar.go | 41 +- vendor/github.com/mholt/archiver/v3/sz.go | 2 +- vendor/github.com/mholt/archiver/v3/tar.go | 64 +- vendor/github.com/mholt/archiver/v3/targz.go | 4 +- vendor/github.com/mholt/archiver/v3/tarlz4.go | 11 +- vendor/github.com/mholt/archiver/v3/tarsz.go | 2 +- vendor/github.com/mholt/archiver/v3/zip.go | 125 +- vendor/github.com/mholt/archiver/v3/zstd.go | 6 +- .../github.com/mmcloughlin/avo/attr/attr.go | 102 - .../github.com/mmcloughlin/avo/build/attr.go | 18 - .../github.com/mmcloughlin/avo/build/cli.go | 171 - .../mmcloughlin/avo/build/context.go | 223 - .../github.com/mmcloughlin/avo/build/doc.go | 2 - .../github.com/mmcloughlin/avo/build/error.go | 88 - .../mmcloughlin/avo/build/global.go | 151 - .../mmcloughlin/avo/build/pseudo.go | 70 - .../mmcloughlin/avo/build/zinstructions.go | 26315 ------------ .../github.com/mmcloughlin/avo/build/zmov.go | 72 - .../mmcloughlin/avo/buildtags/buildtags.go | 312 - .../mmcloughlin/avo/gotypes/components.go | 253 - .../github.com/mmcloughlin/avo/gotypes/doc.go | 2 - .../mmcloughlin/avo/gotypes/signature.go | 177 - .../mmcloughlin/avo/internal/prnt/printer.go | 60 - .../mmcloughlin/avo/internal/stack/stack.go | 73 - vendor/github.com/mmcloughlin/avo/ir/doc.go | 2 - vendor/github.com/mmcloughlin/avo/ir/ir.go | 355 - .../mmcloughlin/avo/operand/checks.go | 247 - .../mmcloughlin/avo/operand/const.go | 36 - .../github.com/mmcloughlin/avo/operand/doc.go | 2 - .../mmcloughlin/avo/operand/types.go | 151 - .../mmcloughlin/avo/operand/zconst.go | 75 - .../github.com/mmcloughlin/avo/pass/alloc.go | 190 - vendor/github.com/mmcloughlin/avo/pass/cfg.go | 81 - .../mmcloughlin/avo/pass/cleanup.go | 123 - vendor/github.com/mmcloughlin/avo/pass/isa.go | 31 - .../github.com/mmcloughlin/avo/pass/pass.go | 100 - vendor/github.com/mmcloughlin/avo/pass/reg.go | 139 - .../mmcloughlin/avo/pass/textflag.go | 42 - .../github.com/mmcloughlin/avo/pass/verify.go | 32 - .../mmcloughlin/avo/printer/goasm.go | 186 - .../mmcloughlin/avo/printer/printer.go | 98 - .../mmcloughlin/avo/printer/stubs.go | 45 - .../mmcloughlin/avo/reg/collection.go | 54 - vendor/github.com/mmcloughlin/avo/reg/doc.go | 2 - vendor/github.com/mmcloughlin/avo/reg/set.go | 112 - .../github.com/mmcloughlin/avo/reg/types.go | 304 - vendor/github.com/mmcloughlin/avo/reg/x86.go | 331 - vendor/github.com/mmcloughlin/avo/src/src.go | 62 - vendor/github.com/mmcloughlin/avo/x86/doc.go | 2 - vendor/github.com/mmcloughlin/avo/x86/gen.go | 4 - .../github.com/mmcloughlin/avo/x86/zctors.go | 34629 ---------------- .../github.com/nwaples/rardecode/archive.go | 15 +- .../github.com/nwaples/rardecode/huffman.go | 2 +- vendor/github.com/nwaples/rardecode/reader.go | 7 + vendor/github.com/pierrec/lz4/.travis.yml | 18 - vendor/github.com/pierrec/lz4/README.md | 24 - vendor/github.com/pierrec/lz4/block.go | 397 - vendor/github.com/pierrec/lz4/debug.go | 23 - vendor/github.com/pierrec/lz4/debug_stub.go | 7 - .../pierrec/lz4/internal/xxh32/xxh32zero.go | 222 - vendor/github.com/pierrec/lz4/lz4.go | 68 - vendor/github.com/pierrec/lz4/lz4_go1.10.go | 29 - .../github.com/pierrec/lz4/lz4_notgo1.10.go | 29 - vendor/github.com/pierrec/lz4/reader.go | 295 - .../pierrec/lz4/{ => v4}/.gitignore | 3 +- vendor/github.com/pierrec/lz4/v4/.travis.yml | 19 + .../github.com/pierrec/lz4/{ => v4}/LICENSE | 0 vendor/github.com/pierrec/lz4/v4/README.md | 90 + vendor/github.com/pierrec/lz4/v4/go.mod | 3 + vendor/github.com/pierrec/lz4/v4/go.sum | 0 .../pierrec/lz4/v4/internal/lz4block/block.go | 469 + .../lz4/v4/internal/lz4block/blocks.go | 87 + .../lz4/v4/internal/lz4block/decode_amd64.s | 369 + .../lz4/v4/internal/lz4block/decode_arm.s | 201 + .../lz4/v4/internal/lz4block/decode_asm.go | 9 + .../lz4/v4/internal/lz4block/decode_other.go | 100 + .../lz4/v4/internal/lz4errors/errors.go | 19 + .../lz4/v4/internal/lz4stream/frame.go | 377 + .../lz4/v4/internal/lz4stream/frame_gen.go | 103 + .../lz4/v4/internal/xxh32/xxh32zero.go | 212 + .../lz4/v4/internal/xxh32/xxh32zero_arm.go | 11 + .../lz4/v4/internal/xxh32/xxh32zero_arm.s | 259 + .../lz4/v4/internal/xxh32/xxh32zero_other.go | 10 + vendor/github.com/pierrec/lz4/v4/lz4.go | 147 + vendor/github.com/pierrec/lz4/v4/options.go | 187 + .../github.com/pierrec/lz4/v4/options_gen.go | 92 + vendor/github.com/pierrec/lz4/v4/reader.go | 192 + vendor/github.com/pierrec/lz4/v4/state.go | 75 + vendor/github.com/pierrec/lz4/v4/state_gen.go | 28 + vendor/github.com/pierrec/lz4/v4/writer.go | 232 + vendor/github.com/pierrec/lz4/writer.go | 267 - vendor/github.com/pkg/errors/.travis.yml | 11 +- vendor/github.com/pkg/errors/Makefile | 44 + vendor/github.com/pkg/errors/README.md | 11 +- vendor/github.com/pkg/errors/errors.go | 8 +- vendor/github.com/pkg/errors/go113.go | 38 + vendor/github.com/pkg/errors/stack.go | 58 +- vendor/github.com/shirou/gopsutil/cpu/cpu.go | 4 +- .../shirou/gopsutil/cpu/cpu_darwin.go | 13 +- .../shirou/gopsutil/cpu/cpu_darwin_cgo.go | 1 + .../shirou/gopsutil/cpu/cpu_dragonfly.go | 154 + .../gopsutil/cpu/cpu_dragonfly_amd64.go | 9 + .../shirou/gopsutil/cpu/cpu_fallback.go | 2 +- .../shirou/gopsutil/cpu/cpu_freebsd.go | 13 +- .../shirou/gopsutil/cpu/cpu_linux.go | 38 +- .../shirou/gopsutil/cpu/cpu_openbsd.go | 39 +- .../shirou/gopsutil/cpu/cpu_solaris.go | 13 +- .../shirou/gopsutil/internal/common/common.go | 12 +- .../gopsutil/internal/common/common_darwin.go | 4 +- .../gopsutil/internal/common/common_linux.go | 42 +- .../internal/common/common_windows.go | 77 +- .../shirou/gopsutil/internal/common/sleep.go | 18 + vendor/github.com/shirou/gopsutil/mem/mem.go | 4 + .../shirou/gopsutil/mem/mem_linux.go | 154 +- .../shirou/gopsutil/mem/mem_openbsd.go | 31 +- .../shirou/gopsutil/mem/mem_openbsd_386.go | 37 + .../shirou/gopsutil/mem/mem_openbsd_amd64.go | 90 - .../shirou/gopsutil/mem/mem_windows.go | 1 + .../shirou/gopsutil/net/net_darwin.go | 4 +- .../shirou/gopsutil/net/net_freebsd.go | 7 +- .../shirou/gopsutil/net/net_linux.go | 2 +- .../shirou/gopsutil/net/net_openbsd.go | 5 +- .../shirou/gopsutil/net/net_unix.go | 2 +- .../shirou/gopsutil/net/net_windows.go | 7 +- .../shirou/gopsutil/process/process.go | 253 +- .../shirou/gopsutil/process/process_bsd.go | 80 + .../shirou/gopsutil/process/process_darwin.go | 315 +- .../gopsutil/process/process_darwin_arm64.go | 205 + .../gopsutil/process/process_fallback.go | 155 +- .../gopsutil/process/process_freebsd.go | 211 +- .../shirou/gopsutil/process/process_linux.go | 245 +- .../gopsutil/process/process_openbsd.go | 223 +- .../gopsutil/process/process_openbsd_386.go | 201 + .../shirou/gopsutil/process/process_posix.go | 69 +- .../gopsutil/process/process_windows.go | 293 +- vendor/github.com/sirupsen/logrus/.travis.yml | 14 +- .../github.com/sirupsen/logrus/CHANGELOG.md | 36 + vendor/github.com/sirupsen/logrus/README.md | 2 +- vendor/github.com/sirupsen/logrus/entry.go | 73 +- vendor/github.com/sirupsen/logrus/go.sum | 2 - .../sirupsen/logrus/json_formatter.go | 5 +- vendor/github.com/sirupsen/logrus/logger.go | 2 +- .../sirupsen/logrus/terminal_check_unix.go | 2 +- .../sirupsen/logrus/text_formatter.go | 7 +- vendor/github.com/skycoin/dmsg/go.mod | 5 +- vendor/github.com/skycoin/dmsg/go.sum | 14 +- .../skycoin/dmsg/httputil/httputil.go | 3 + .../github.com/skycoin/dmsg/httputil/log.go | 56 + .../victoria_metrics_int_gauge_wrapper.go | 5 + .../victoria_metrics_uint_gauge_wrapper.go | 5 + .../skycoin/dmsg/noise/read_writer.go | 1 + vendor/github.com/skycoin/dmsg/server.go | 10 +- .../skycoin/dmsg/servermetrics/empty.go | 14 +- .../skycoin/dmsg/servermetrics/metrics.go | 10 + .../dmsg/servermetrics/victoria_metrics.go | 27 +- vendor/github.com/spf13/cobra/.golangci.yml | 48 + vendor/github.com/spf13/cobra/.travis.yml | 9 +- vendor/github.com/spf13/cobra/CHANGELOG.md | 51 + vendor/github.com/spf13/cobra/CONDUCT.md | 37 + vendor/github.com/spf13/cobra/CONTRIBUTING.md | 50 + vendor/github.com/spf13/cobra/Makefile | 18 +- vendor/github.com/spf13/cobra/README.md | 132 +- .../spf13/cobra/bash_completions.go | 188 +- .../spf13/cobra/bash_completions.md | 306 +- vendor/github.com/spf13/cobra/cobra.go | 15 + vendor/github.com/spf13/cobra/command.go | 162 +- .../spf13/cobra/custom_completions.go | 305 +- .../spf13/cobra/fish_completions.go | 71 +- .../spf13/cobra/fish_completions.md | 7 +- vendor/github.com/spf13/cobra/go.mod | 6 +- vendor/github.com/spf13/cobra/go.sum | 202 +- .../spf13/cobra/powershell_completions.go | 323 +- .../spf13/cobra/powershell_completions.md | 13 +- .../spf13/cobra/projects_using_cobra.md | 38 + .../spf13/cobra/shell_completions.go | 53 +- .../spf13/cobra/shell_completions.md | 483 + .../github.com/spf13/cobra/zsh_completions.go | 524 +- .../github.com/spf13/cobra/zsh_completions.md | 87 +- vendor/github.com/spf13/pflag/.travis.yml | 7 +- vendor/github.com/spf13/pflag/README.md | 4 +- vendor/github.com/spf13/pflag/bool_slice.go | 38 + vendor/github.com/spf13/pflag/count.go | 4 +- .../github.com/spf13/pflag/duration_slice.go | 38 + vendor/github.com/spf13/pflag/flag.go | 16 +- .../github.com/spf13/pflag/float32_slice.go | 174 + .../github.com/spf13/pflag/float64_slice.go | 166 + vendor/github.com/spf13/pflag/go.mod | 3 + vendor/github.com/spf13/pflag/go.sum | 0 vendor/github.com/spf13/pflag/int32_slice.go | 174 + vendor/github.com/spf13/pflag/int64_slice.go | 166 + vendor/github.com/spf13/pflag/int_slice.go | 30 + vendor/github.com/spf13/pflag/ip_slice.go | 40 +- vendor/github.com/spf13/pflag/string_array.go | 26 + vendor/github.com/spf13/pflag/string_slice.go | 22 +- .../github.com/spf13/pflag/string_to_int64.go | 149 + vendor/github.com/spf13/pflag/uint_slice.go | 42 + .../testify/assert/assertion_compare.go | 172 +- .../testify/assert/assertion_format.go | 97 + .../testify/assert/assertion_forward.go | 194 + .../testify/assert/assertion_order.go | 81 + .../stretchr/testify/assert/assertions.go | 83 +- .../github.com/stretchr/testify/mock/mock.go | 45 +- .../stretchr/testify/require/require.go | 248 + .../testify/require/require_forward.go | 194 + vendor/github.com/tjfoc/gmsm/sm4/sm4.go | 317 +- vendor/github.com/tjfoc/gmsm/sm4/sm4_gcm.go | 332 + vendor/github.com/tjfoc/gmsm/sm4/utils.go | 86 + .../tklauser/go-sysconf/.cirrus.yml | 12 + .../github.com/tklauser/go-sysconf/.gitignore | 1 + .../avo => tklauser/go-sysconf}/LICENSE | 2 +- .../github.com/tklauser/go-sysconf/README.md | 47 + vendor/github.com/tklauser/go-sysconf/go.mod | 8 + vendor/github.com/tklauser/go-sysconf/go.sum | 4 + .../github.com/tklauser/go-sysconf/sysconf.go | 21 + .../tklauser/go-sysconf/sysconf_bsd.go | 38 + .../tklauser/go-sysconf/sysconf_darwin.go | 267 + .../tklauser/go-sysconf/sysconf_dragonfly.go | 220 + .../tklauser/go-sysconf/sysconf_freebsd.go | 226 + .../tklauser/go-sysconf/sysconf_generic.go | 46 + .../tklauser/go-sysconf/sysconf_linux.go | 357 + .../tklauser/go-sysconf/sysconf_netbsd.go | 154 + .../tklauser/go-sysconf/sysconf_openbsd.go | 271 + .../tklauser/go-sysconf/sysconf_posix.go | 83 + .../tklauser/go-sysconf/sysconf_solaris.go | 14 + .../go-sysconf/sysconf_unsupported.go | 17 + .../go-sysconf/zsysconf_defs_darwin.go | 251 + .../go-sysconf/zsysconf_defs_dragonfly.go | 225 + .../go-sysconf/zsysconf_defs_freebsd.go | 226 + .../go-sysconf/zsysconf_defs_linux.go | 144 + .../go-sysconf/zsysconf_defs_netbsd.go | 94 + .../go-sysconf/zsysconf_defs_openbsd.go | 260 + .../go-sysconf/zsysconf_defs_solaris.go | 136 + .../go-sysconf/zsysconf_values_freebsd_386.go | 9 + .../zsysconf_values_freebsd_amd64.go | 9 + .../go-sysconf/zsysconf_values_freebsd_arm.go | 9 + .../zsysconf_values_freebsd_arm64.go | 9 + .../go-sysconf/zsysconf_values_linux_386.go | 111 + .../go-sysconf/zsysconf_values_linux_amd64.go | 111 + .../go-sysconf/zsysconf_values_linux_arm.go | 111 + .../go-sysconf/zsysconf_values_linux_arm64.go | 111 + .../go-sysconf/zsysconf_values_linux_mips.go | 111 + .../zsysconf_values_linux_mips64.go | 111 + .../zsysconf_values_linux_mips64le.go | 111 + .../zsysconf_values_linux_mipsle.go | 111 + .../go-sysconf/zsysconf_values_linux_ppc64.go | 111 + .../zsysconf_values_linux_ppc64le.go | 111 + .../zsysconf_values_linux_riscv64.go | 111 + .../go-sysconf/zsysconf_values_linux_s390x.go | 111 + .../github.com/tklauser/numcpus/.cirrus.yml | 12 + vendor/github.com/tklauser/numcpus/LICENSE | 202 + vendor/github.com/tklauser/numcpus/README.md | 49 + vendor/github.com/tklauser/numcpus/go.mod | 5 + vendor/github.com/tklauser/numcpus/go.sum | 2 + vendor/github.com/tklauser/numcpus/numcpus.go | 61 + .../tklauser/numcpus/numcpus_bsd.go | 57 + .../tklauser/numcpus/numcpus_linux.go | 84 + .../tklauser/numcpus/numcpus_solaris.go | 51 + .../tklauser/numcpus/numcpus_unsupported.go | 38 + vendor/github.com/ulikunitz/xz/LICENSE | 2 +- vendor/github.com/ulikunitz/xz/TODO.md | 9 + vendor/github.com/ulikunitz/xz/bits.go | 2 +- vendor/github.com/ulikunitz/xz/crc.go | 2 +- vendor/github.com/ulikunitz/xz/format.go | 10 +- .../github.com/ulikunitz/xz/fox-check-none.xz | Bin 0 -> 96 bytes vendor/github.com/ulikunitz/xz/go.mod | 2 + .../ulikunitz/xz/internal/hash/cyclic_poly.go | 2 +- .../ulikunitz/xz/internal/hash/doc.go | 2 +- .../ulikunitz/xz/internal/hash/rabin_karp.go | 2 +- .../ulikunitz/xz/internal/hash/roller.go | 2 +- .../ulikunitz/xz/internal/xlog/xlog.go | 2 +- .../github.com/ulikunitz/xz/lzma/bintree.go | 2 +- vendor/github.com/ulikunitz/xz/lzma/bitops.go | 2 +- .../github.com/ulikunitz/xz/lzma/breader.go | 2 +- vendor/github.com/ulikunitz/xz/lzma/buffer.go | 2 +- .../ulikunitz/xz/lzma/bytewriter.go | 2 +- .../github.com/ulikunitz/xz/lzma/decoder.go | 2 +- .../ulikunitz/xz/lzma/decoderdict.go | 2 +- .../ulikunitz/xz/lzma/directcodec.go | 2 +- .../github.com/ulikunitz/xz/lzma/distcodec.go | 2 +- .../github.com/ulikunitz/xz/lzma/encoder.go | 2 +- .../ulikunitz/xz/lzma/encoderdict.go | 2 +- .../github.com/ulikunitz/xz/lzma/hashtable.go | 2 +- vendor/github.com/ulikunitz/xz/lzma/header.go | 2 +- .../github.com/ulikunitz/xz/lzma/header2.go | 2 +- .../ulikunitz/xz/lzma/lengthcodec.go | 2 +- .../ulikunitz/xz/lzma/literalcodec.go | 2 +- .../ulikunitz/xz/lzma/matchalgorithm.go | 2 +- .../github.com/ulikunitz/xz/lzma/operation.go | 2 +- vendor/github.com/ulikunitz/xz/lzma/prob.go | 2 +- .../ulikunitz/xz/lzma/properties.go | 2 +- .../ulikunitz/xz/lzma/rangecodec.go | 2 +- vendor/github.com/ulikunitz/xz/lzma/reader.go | 2 +- .../github.com/ulikunitz/xz/lzma/reader2.go | 2 +- vendor/github.com/ulikunitz/xz/lzma/state.go | 2 +- .../ulikunitz/xz/lzma/treecodecs.go | 2 +- vendor/github.com/ulikunitz/xz/lzma/writer.go | 2 +- .../github.com/ulikunitz/xz/lzma/writer2.go | 2 +- vendor/github.com/ulikunitz/xz/lzmafilter.go | 2 +- vendor/github.com/ulikunitz/xz/none-check.go | 23 + vendor/github.com/ulikunitz/xz/reader.go | 8 +- vendor/github.com/ulikunitz/xz/writer.go | 15 +- .../x/crypto/blake2b/blake2bAVX2_amd64.go | 1 + .../x/crypto/blake2b/blake2bAVX2_amd64.s | 94 +- .../x/crypto/blake2b/blake2b_amd64.go | 1 + .../x/crypto/blake2b/blake2b_amd64.s | 55 +- .../x/crypto/blake2b/blake2b_ref.go | 1 + .../golang.org/x/crypto/blake2b/register.go | 1 + .../x/crypto/blake2s/blake2s_386.go | 1 + .../golang.org/x/crypto/blake2s/blake2s_386.s | 94 +- .../x/crypto/blake2s/blake2s_amd64.go | 1 + .../x/crypto/blake2s/blake2s_amd64.s | 66 +- .../x/crypto/blake2s/blake2s_ref.go | 1 + .../golang.org/x/crypto/blake2s/register.go | 1 + .../x/crypto/chacha20/chacha_arm64.go | 1 + .../x/crypto/chacha20/chacha_noasm.go | 1 + .../x/crypto/chacha20/chacha_ppc64le.go | 1 + .../x/crypto/chacha20/chacha_s390x.go | 1 + .../chacha20poly1305_amd64.go | 1 + .../chacha20poly1305_noasm.go | 1 + .../x/crypto/curve25519/curve25519_amd64.go | 1 + .../x/crypto/curve25519/curve25519_noasm.go | 1 + .../x/crypto/internal/subtle/aliasing.go | 1 + .../crypto/internal/subtle/aliasing_purego.go | 1 + .../x/crypto/poly1305/bits_compat.go | 1 + .../x/crypto/poly1305/bits_go1.13.go | 1 + .../golang.org/x/crypto/poly1305/mac_noasm.go | 1 + .../golang.org/x/crypto/poly1305/sum_amd64.go | 1 + .../x/crypto/poly1305/sum_ppc64le.go | 1 + .../golang.org/x/crypto/poly1305/sum_s390x.go | 1 + .../x/crypto/salsa20/salsa/salsa20_amd64.go | 1 + .../x/crypto/salsa20/salsa/salsa20_amd64.s | 235 +- .../x/crypto/salsa20/salsa/salsa20_noasm.go | 1 + vendor/golang.org/x/net/context/go17.go | 1 + vendor/golang.org/x/net/context/go19.go | 1 + vendor/golang.org/x/net/context/pre_go17.go | 1 + vendor/golang.org/x/net/context/pre_go19.go | 1 + .../x/net/internal/socket/cmsghdr.go | 3 +- .../x/net/internal/socket/cmsghdr_bsd.go | 1 + .../internal/socket/cmsghdr_linux_32bit.go | 1 + .../internal/socket/cmsghdr_linux_64bit.go | 1 + .../internal/socket/cmsghdr_solaris_64bit.go | 4 +- .../x/net/internal/socket/cmsghdr_stub.go | 17 +- .../x/net/internal/socket/cmsghdr_unix.go | 22 + .../net/internal/socket/cmsghdr_zos_s390x.go | 25 + .../x/net/internal/socket/error_unix.go | 3 +- .../x/net/internal/socket/iovec_32bit.go | 1 + .../x/net/internal/socket/iovec_64bit.go | 3 +- .../internal/socket/iovec_solaris_64bit.go | 4 +- .../x/net/internal/socket/iovec_stub.go | 3 +- .../x/net/internal/socket/mmsghdr_stub.go | 1 + .../x/net/internal/socket/mmsghdr_unix.go | 1 + .../x/net/internal/socket/msghdr_bsd.go | 1 + .../x/net/internal/socket/msghdr_bsdvar.go | 1 + .../net/internal/socket/msghdr_linux_32bit.go | 1 + .../net/internal/socket/msghdr_linux_64bit.go | 1 + .../internal/socket/msghdr_solaris_64bit.go | 4 +- .../x/net/internal/socket/msghdr_stub.go | 3 +- .../x/net/internal/socket/msghdr_zos_s390x.go | 36 + .../x/net/internal/socket/norace.go | 1 + .../golang.org/x/net/internal/socket/race.go | 1 + .../x/net/internal/socket/rawconn.go | 33 +- .../x/net/internal/socket/rawconn_mmsg.go | 1 + .../x/net/internal/socket/rawconn_msg.go | 7 +- .../x/net/internal/socket/rawconn_nommsg.go | 1 + .../x/net/internal/socket/rawconn_nomsg.go | 3 +- .../x/net/internal/socket/socket.go | 10 +- .../golang.org/x/net/internal/socket/sys.go | 14 +- .../x/net/internal/socket/sys_bsd.go | 1 + .../x/net/internal/socket/sys_bsdvar.go | 23 - .../x/net/internal/socket/sys_const_unix.go | 1 + .../x/net/internal/socket/sys_const_zos.go | 18 + .../x/net/internal/socket/sys_darwin.go | 7 - .../x/net/internal/socket/sys_dragonfly.go | 32 - .../x/net/internal/socket/sys_linkname.go | 1 + .../x/net/internal/socket/sys_linux.go | 6 +- .../x/net/internal/socket/sys_linux_386.go | 2 - .../net/internal/socket/sys_linux_riscv64.go | 1 + .../x/net/internal/socket/sys_linux_s390x.go | 2 - .../x/net/internal/socket/sys_posix.go | 3 +- .../x/net/internal/socket/sys_solaris.go | 11 - .../x/net/internal/socket/sys_stub.go | 19 +- .../x/net/internal/socket/sys_unix.go | 1 + ...{sys_go1_11_darwin.go => sys_zos_s390x.go} | 19 +- .../x/net/internal/socket/sys_zos_s390x.s | 11 + .../x/net/internal/socket/zsys_aix_ppc64.go | 6 +- .../x/net/internal/socket/zsys_darwin_386.go | 5 +- .../net/internal/socket/zsys_darwin_amd64.go | 5 +- .../x/net/internal/socket/zsys_darwin_arm.go | 5 +- .../net/internal/socket/zsys_darwin_arm64.go | 5 +- .../internal/socket/zsys_dragonfly_amd64.go | 5 +- .../x/net/internal/socket/zsys_freebsd_386.go | 5 +- .../net/internal/socket/zsys_freebsd_amd64.go | 5 +- .../x/net/internal/socket/zsys_freebsd_arm.go | 5 +- .../net/internal/socket/zsys_freebsd_arm64.go | 5 +- .../x/net/internal/socket/zsys_linux_386.go | 5 +- .../x/net/internal/socket/zsys_linux_amd64.go | 5 +- .../x/net/internal/socket/zsys_linux_arm.go | 2 - .../x/net/internal/socket/zsys_linux_arm64.go | 2 - .../x/net/internal/socket/zsys_linux_mips.go | 2 - .../net/internal/socket/zsys_linux_mips64.go | 2 - .../internal/socket/zsys_linux_mips64le.go | 2 - .../net/internal/socket/zsys_linux_mipsle.go | 2 - .../x/net/internal/socket/zsys_linux_ppc64.go | 2 - .../net/internal/socket/zsys_linux_ppc64le.go | 2 - .../net/internal/socket/zsys_linux_riscv64.go | 3 +- .../x/net/internal/socket/zsys_linux_s390x.go | 2 - .../x/net/internal/socket/zsys_netbsd_386.go | 2 - .../net/internal/socket/zsys_netbsd_amd64.go | 2 - .../x/net/internal/socket/zsys_netbsd_arm.go | 2 - .../net/internal/socket/zsys_netbsd_arm64.go | 5 +- .../x/net/internal/socket/zsys_openbsd_386.go | 5 +- .../net/internal/socket/zsys_openbsd_amd64.go | 5 +- .../x/net/internal/socket/zsys_openbsd_arm.go | 5 +- .../net/internal/socket/zsys_openbsd_arm64.go | 5 +- .../internal/socket/zsys_openbsd_mips64.go | 50 + .../net/internal/socket/zsys_solaris_amd64.go | 5 +- .../x/net/internal/socket/zsys_zos_s390x.go | 32 + vendor/golang.org/x/net/ipv4/control_bsd.go | 7 +- .../golang.org/x/net/ipv4/control_pktinfo.go | 5 +- vendor/golang.org/x/net/ipv4/control_stub.go | 3 +- vendor/golang.org/x/net/ipv4/control_unix.go | 5 +- vendor/golang.org/x/net/ipv4/control_zos.go | 88 + vendor/golang.org/x/net/ipv4/header.go | 4 +- vendor/golang.org/x/net/ipv4/icmp_stub.go | 1 + vendor/golang.org/x/net/ipv4/payload_cmsg.go | 3 +- .../golang.org/x/net/ipv4/payload_nocmsg.go | 3 +- vendor/golang.org/x/net/ipv4/sockopt_posix.go | 3 +- vendor/golang.org/x/net/ipv4/sockopt_stub.go | 3 +- vendor/golang.org/x/net/ipv4/sys_aix.go | 34 +- vendor/golang.org/x/net/ipv4/sys_asmreq.go | 1 + .../golang.org/x/net/ipv4/sys_asmreq_stub.go | 1 + vendor/golang.org/x/net/ipv4/sys_asmreqn.go | 1 + .../golang.org/x/net/ipv4/sys_asmreqn_stub.go | 1 + vendor/golang.org/x/net/ipv4/sys_bpf.go | 1 + vendor/golang.org/x/net/ipv4/sys_bpf_stub.go | 1 + vendor/golang.org/x/net/ipv4/sys_bsd.go | 33 +- vendor/golang.org/x/net/ipv4/sys_darwin.go | 46 +- vendor/golang.org/x/net/ipv4/sys_dragonfly.go | 32 +- vendor/golang.org/x/net/ipv4/sys_freebsd.go | 42 +- vendor/golang.org/x/net/ipv4/sys_linux.go | 35 +- vendor/golang.org/x/net/ipv4/sys_solaris.go | 36 +- vendor/golang.org/x/net/ipv4/sys_ssmreq.go | 1 + .../golang.org/x/net/ipv4/sys_ssmreq_stub.go | 1 + vendor/golang.org/x/net/ipv4/sys_stub.go | 3 +- vendor/golang.org/x/net/ipv4/sys_windows.go | 43 +- vendor/golang.org/x/net/ipv4/sys_zos.go | 57 + .../golang.org/x/net/ipv4/zsys_aix_ppc64.go | 18 +- vendor/golang.org/x/net/ipv4/zsys_darwin.go | 33 - .../golang.org/x/net/ipv4/zsys_dragonfly.go | 18 - .../golang.org/x/net/ipv4/zsys_freebsd_386.go | 34 - .../x/net/ipv4/zsys_freebsd_amd64.go | 34 - .../golang.org/x/net/ipv4/zsys_freebsd_arm.go | 34 - .../x/net/ipv4/zsys_freebsd_arm64.go | 34 - .../golang.org/x/net/ipv4/zsys_linux_386.go | 51 - .../golang.org/x/net/ipv4/zsys_linux_amd64.go | 51 - .../golang.org/x/net/ipv4/zsys_linux_arm.go | 51 - .../golang.org/x/net/ipv4/zsys_linux_arm64.go | 51 - .../golang.org/x/net/ipv4/zsys_linux_mips.go | 51 - .../x/net/ipv4/zsys_linux_mips64.go | 51 - .../x/net/ipv4/zsys_linux_mips64le.go | 51 - .../x/net/ipv4/zsys_linux_mipsle.go | 51 - .../golang.org/x/net/ipv4/zsys_linux_ppc.go | 51 - .../golang.org/x/net/ipv4/zsys_linux_ppc64.go | 51 - .../x/net/ipv4/zsys_linux_ppc64le.go | 51 - .../x/net/ipv4/zsys_linux_riscv64.go | 52 +- .../golang.org/x/net/ipv4/zsys_linux_s390x.go | 51 - vendor/golang.org/x/net/ipv4/zsys_netbsd.go | 17 - vendor/golang.org/x/net/ipv4/zsys_openbsd.go | 17 - vendor/golang.org/x/net/ipv4/zsys_solaris.go | 43 - .../golang.org/x/net/ipv4/zsys_zos_s390x.go | 56 + .../x/net/ipv6/control_rfc2292_unix.go | 9 +- .../x/net/ipv6/control_rfc3542_unix.go | 15 +- vendor/golang.org/x/net/ipv6/control_stub.go | 3 +- vendor/golang.org/x/net/ipv6/control_unix.go | 3 +- vendor/golang.org/x/net/ipv6/icmp_bsd.go | 1 + vendor/golang.org/x/net/ipv6/icmp_stub.go | 3 +- vendor/golang.org/x/net/ipv6/icmp_zos.go | 29 + vendor/golang.org/x/net/ipv6/payload_cmsg.go | 3 +- .../golang.org/x/net/ipv6/payload_nocmsg.go | 3 +- vendor/golang.org/x/net/ipv6/sockopt_posix.go | 3 +- vendor/golang.org/x/net/ipv6/sockopt_stub.go | 3 +- vendor/golang.org/x/net/ipv6/sys_aix.go | 41 +- vendor/golang.org/x/net/ipv6/sys_asmreq.go | 1 + .../golang.org/x/net/ipv6/sys_asmreq_stub.go | 1 + vendor/golang.org/x/net/ipv6/sys_bpf.go | 1 + vendor/golang.org/x/net/ipv6/sys_bpf_stub.go | 1 + vendor/golang.org/x/net/ipv6/sys_bsd.go | 41 +- vendor/golang.org/x/net/ipv6/sys_darwin.go | 48 +- vendor/golang.org/x/net/ipv6/sys_freebsd.go | 48 +- vendor/golang.org/x/net/ipv6/sys_linux.go | 45 +- vendor/golang.org/x/net/ipv6/sys_solaris.go | 48 +- vendor/golang.org/x/net/ipv6/sys_ssmreq.go | 3 +- .../golang.org/x/net/ipv6/sys_ssmreq_stub.go | 3 +- vendor/golang.org/x/net/ipv6/sys_stub.go | 3 +- vendor/golang.org/x/net/ipv6/sys_windows.go | 23 +- vendor/golang.org/x/net/ipv6/sys_zos.go | 72 + .../golang.org/x/net/ipv6/zsys_aix_ppc64.go | 36 +- vendor/golang.org/x/net/ipv6/zsys_darwin.go | 67 - .../golang.org/x/net/ipv6/zsys_dragonfly.go | 46 - .../golang.org/x/net/ipv6/zsys_freebsd_386.go | 58 - .../x/net/ipv6/zsys_freebsd_amd64.go | 58 - .../golang.org/x/net/ipv6/zsys_freebsd_arm.go | 58 - .../x/net/ipv6/zsys_freebsd_arm64.go | 58 - .../golang.org/x/net/ipv6/zsys_linux_386.go | 80 - .../golang.org/x/net/ipv6/zsys_linux_amd64.go | 80 - .../golang.org/x/net/ipv6/zsys_linux_arm.go | 80 - .../golang.org/x/net/ipv6/zsys_linux_arm64.go | 80 - .../golang.org/x/net/ipv6/zsys_linux_mips.go | 80 - .../x/net/ipv6/zsys_linux_mips64.go | 80 - .../x/net/ipv6/zsys_linux_mips64le.go | 80 - .../x/net/ipv6/zsys_linux_mipsle.go | 80 - .../golang.org/x/net/ipv6/zsys_linux_ppc.go | 80 - .../golang.org/x/net/ipv6/zsys_linux_ppc64.go | 80 - .../x/net/ipv6/zsys_linux_ppc64le.go | 80 - .../x/net/ipv6/zsys_linux_riscv64.go | 81 +- .../golang.org/x/net/ipv6/zsys_linux_s390x.go | 80 - vendor/golang.org/x/net/ipv6/zsys_netbsd.go | 42 - vendor/golang.org/x/net/ipv6/zsys_openbsd.go | 51 - vendor/golang.org/x/net/ipv6/zsys_solaris.go | 68 - .../golang.org/x/net/ipv6/zsys_zos_s390x.go | 62 + vendor/golang.org/x/net/nettest/nettest.go | 6 +- .../golang.org/x/net/nettest/nettest_stub.go | 3 +- .../golang.org/x/net/nettest/nettest_unix.go | 3 +- vendor/golang.org/x/sys/cpu/cpu_aix.go | 1 + vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go | 1 + vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go | 1 + vendor/golang.org/x/sys/cpu/cpu_gc_x86.go | 1 + .../golang.org/x/sys/cpu/cpu_gccgo_arm64.go | 1 + .../golang.org/x/sys/cpu/cpu_gccgo_s390x.go | 1 + vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go | 1 + vendor/golang.org/x/sys/cpu/cpu_linux.go | 1 + .../golang.org/x/sys/cpu/cpu_linux_mips64x.go | 1 + .../golang.org/x/sys/cpu/cpu_linux_noinit.go | 1 + .../golang.org/x/sys/cpu/cpu_linux_ppc64x.go | 1 + vendor/golang.org/x/sys/cpu/cpu_mips64x.go | 1 + vendor/golang.org/x/sys/cpu/cpu_mipsx.go | 1 + vendor/golang.org/x/sys/cpu/cpu_other_arm.go | 1 + .../golang.org/x/sys/cpu/cpu_other_arm64.go | 4 +- .../golang.org/x/sys/cpu/cpu_other_mips64x.go | 1 + vendor/golang.org/x/sys/cpu/cpu_ppc64x.go | 1 + vendor/golang.org/x/sys/cpu/cpu_riscv64.go | 1 + vendor/golang.org/x/sys/cpu/cpu_wasm.go | 1 + vendor/golang.org/x/sys/cpu/cpu_x86.go | 1 + .../golang.org/x/sys/cpu/syscall_aix_gccgo.go | 4 +- .../x/sys/cpu/syscall_aix_ppc64_gc.go | 4 +- vendor/golang.org/x/sys/unix/aliases.go | 3 +- .../unix/{asm_freebsd_386.s => asm_bsd_386.s} | 10 +- .../{asm_darwin_amd64.s => asm_bsd_amd64.s} | 8 +- .../unix/{asm_freebsd_arm.s => asm_bsd_arm.s} | 8 +- .../{asm_netbsd_amd64.s => asm_bsd_arm64.s} | 8 +- vendor/golang.org/x/sys/unix/asm_darwin_386.s | 29 - vendor/golang.org/x/sys/unix/asm_darwin_arm.s | 30 - .../golang.org/x/sys/unix/asm_darwin_arm64.s | 30 - .../x/sys/unix/asm_dragonfly_amd64.s | 29 - .../golang.org/x/sys/unix/asm_freebsd_amd64.s | 29 - .../golang.org/x/sys/unix/asm_freebsd_arm64.s | 29 - vendor/golang.org/x/sys/unix/asm_netbsd_386.s | 29 - vendor/golang.org/x/sys/unix/asm_netbsd_arm.s | 29 - .../golang.org/x/sys/unix/asm_netbsd_arm64.s | 29 - .../golang.org/x/sys/unix/asm_openbsd_386.s | 29 - .../golang.org/x/sys/unix/asm_openbsd_amd64.s | 29 - .../golang.org/x/sys/unix/asm_openbsd_arm.s | 29 - .../golang.org/x/sys/unix/asm_openbsd_arm64.s | 29 - vendor/golang.org/x/sys/unix/asm_zos_s390x.s | 426 + vendor/golang.org/x/sys/unix/cap_freebsd.go | 1 + vendor/golang.org/x/sys/unix/constants.go | 3 +- vendor/golang.org/x/sys/unix/dev_aix_ppc.go | 4 +- vendor/golang.org/x/sys/unix/dev_aix_ppc64.go | 4 +- vendor/golang.org/x/sys/unix/dev_zos.go | 29 + vendor/golang.org/x/sys/unix/dirent.go | 1 + vendor/golang.org/x/sys/unix/endian_big.go | 1 + vendor/golang.org/x/sys/unix/endian_little.go | 1 + vendor/golang.org/x/sys/unix/env_unix.go | 3 +- vendor/golang.org/x/sys/unix/epoll_zos.go | 221 + vendor/golang.org/x/sys/unix/fcntl.go | 1 + .../x/sys/unix/fcntl_linux_32bit.go | 1 + vendor/golang.org/x/sys/unix/fdset.go | 1 + vendor/golang.org/x/sys/unix/fstatfs_zos.go | 164 + vendor/golang.org/x/sys/unix/gccgo.go | 4 +- .../x/sys/unix/gccgo_linux_amd64.go | 1 + vendor/golang.org/x/sys/unix/ioctl.go | 1 + vendor/golang.org/x/sys/unix/ioctl_linux.go | 196 + vendor/golang.org/x/sys/unix/ioctl_zos.go | 74 + vendor/golang.org/x/sys/unix/mkall.sh | 2 +- vendor/golang.org/x/sys/unix/mkerrors.sh | 32 +- vendor/golang.org/x/sys/unix/pagesize_unix.go | 1 + vendor/golang.org/x/sys/unix/ptrace_darwin.go | 12 + vendor/golang.org/x/sys/unix/ptrace_ios.go | 12 + vendor/golang.org/x/sys/unix/race.go | 1 + vendor/golang.org/x/sys/unix/race0.go | 3 +- .../x/sys/unix/readdirent_getdents.go | 1 + .../x/sys/unix/readdirent_getdirentries.go | 1 + vendor/golang.org/x/sys/unix/sockcmsg_unix.go | 3 +- .../x/sys/unix/sockcmsg_unix_other.go | 7 +- vendor/golang.org/x/sys/unix/str.go | 1 + vendor/golang.org/x/sys/unix/syscall.go | 3 +- vendor/golang.org/x/sys/unix/syscall_aix.go | 13 +- .../golang.org/x/sys/unix/syscall_aix_ppc.go | 4 +- .../x/sys/unix/syscall_aix_ppc64.go | 4 +- vendor/golang.org/x/sys/unix/syscall_bsd.go | 9 +- .../x/sys/unix/syscall_darwin.1_12.go | 1 + .../x/sys/unix/syscall_darwin.1_13.go | 1 + .../golang.org/x/sys/unix/syscall_darwin.go | 24 +- .../x/sys/unix/syscall_darwin_386.go | 3 +- .../x/sys/unix/syscall_darwin_amd64.go | 3 +- .../x/sys/unix/syscall_darwin_arm.go | 2 +- .../x/sys/unix/syscall_darwin_arm64.go | 3 +- .../x/sys/unix/syscall_darwin_libSystem.go | 1 + .../x/sys/unix/syscall_dragonfly.go | 18 +- .../x/sys/unix/syscall_dragonfly_amd64.go | 1 + .../golang.org/x/sys/unix/syscall_freebsd.go | 17 +- .../x/sys/unix/syscall_freebsd_386.go | 1 + .../x/sys/unix/syscall_freebsd_amd64.go | 1 + .../x/sys/unix/syscall_freebsd_arm.go | 1 + .../x/sys/unix/syscall_freebsd_arm64.go | 1 + .../golang.org/x/sys/unix/syscall_illumos.go | 59 +- vendor/golang.org/x/sys/unix/syscall_linux.go | 116 +- .../x/sys/unix/syscall_linux_386.go | 7 +- .../x/sys/unix/syscall_linux_amd64.go | 3 +- .../x/sys/unix/syscall_linux_amd64_gc.go | 4 +- .../x/sys/unix/syscall_linux_arm.go | 11 +- .../x/sys/unix/syscall_linux_arm64.go | 3 +- .../golang.org/x/sys/unix/syscall_linux_gc.go | 1 + .../x/sys/unix/syscall_linux_gc_386.go | 1 + .../x/sys/unix/syscall_linux_gc_arm.go | 1 + .../x/sys/unix/syscall_linux_gccgo_386.go | 1 + .../x/sys/unix/syscall_linux_gccgo_arm.go | 1 + .../x/sys/unix/syscall_linux_mips64x.go | 3 +- .../x/sys/unix/syscall_linux_mipsx.go | 9 +- .../x/sys/unix/syscall_linux_ppc64x.go | 5 +- .../x/sys/unix/syscall_linux_riscv64.go | 3 +- .../x/sys/unix/syscall_linux_s390x.go | 5 +- .../x/sys/unix/syscall_linux_sparc64.go | 5 +- .../golang.org/x/sys/unix/syscall_netbsd.go | 21 +- .../x/sys/unix/syscall_netbsd_386.go | 1 + .../x/sys/unix/syscall_netbsd_amd64.go | 1 + .../x/sys/unix/syscall_netbsd_arm.go | 1 + .../x/sys/unix/syscall_netbsd_arm64.go | 1 + .../golang.org/x/sys/unix/syscall_openbsd.go | 4 +- .../x/sys/unix/syscall_openbsd_386.go | 1 + .../x/sys/unix/syscall_openbsd_amd64.go | 1 + .../x/sys/unix/syscall_openbsd_arm.go | 1 + .../x/sys/unix/syscall_openbsd_arm64.go | 1 + .../golang.org/x/sys/unix/syscall_solaris.go | 23 +- .../x/sys/unix/syscall_solaris_amd64.go | 1 + vendor/golang.org/x/sys/unix/syscall_unix.go | 1 + .../golang.org/x/sys/unix/syscall_unix_gc.go | 5 +- .../x/sys/unix/syscall_unix_gc_ppc64x.go | 1 + .../x/sys/unix/syscall_zos_s390x.go | 1781 + vendor/golang.org/x/sys/unix/timestruct.go | 3 +- vendor/golang.org/x/sys/unix/xattr_bsd.go | 1 + .../golang.org/x/sys/unix/zerrors_aix_ppc.go | 1 + .../x/sys/unix/zerrors_aix_ppc64.go | 1 + .../x/sys/unix/zerrors_darwin_386.go | 1 + .../x/sys/unix/zerrors_darwin_amd64.go | 88 +- .../x/sys/unix/zerrors_darwin_arm.go | 1 + .../x/sys/unix/zerrors_darwin_arm64.go | 88 +- .../x/sys/unix/zerrors_dragonfly_amd64.go | 1 + .../x/sys/unix/zerrors_freebsd_386.go | 7 + .../x/sys/unix/zerrors_freebsd_amd64.go | 7 + .../x/sys/unix/zerrors_freebsd_arm.go | 16 + .../x/sys/unix/zerrors_freebsd_arm64.go | 7 + vendor/golang.org/x/sys/unix/zerrors_linux.go | 147 +- .../x/sys/unix/zerrors_linux_386.go | 13 +- .../x/sys/unix/zerrors_linux_amd64.go | 13 +- .../x/sys/unix/zerrors_linux_arm.go | 13 +- .../x/sys/unix/zerrors_linux_arm64.go | 14 +- .../x/sys/unix/zerrors_linux_mips.go | 13 +- .../x/sys/unix/zerrors_linux_mips64.go | 13 +- .../x/sys/unix/zerrors_linux_mips64le.go | 13 +- .../x/sys/unix/zerrors_linux_mipsle.go | 13 +- .../x/sys/unix/zerrors_linux_ppc64.go | 13 +- .../x/sys/unix/zerrors_linux_ppc64le.go | 13 +- .../x/sys/unix/zerrors_linux_riscv64.go | 13 +- .../x/sys/unix/zerrors_linux_s390x.go | 13 +- .../x/sys/unix/zerrors_linux_sparc64.go | 13 +- .../x/sys/unix/zerrors_netbsd_386.go | 1 + .../x/sys/unix/zerrors_netbsd_amd64.go | 1 + .../x/sys/unix/zerrors_netbsd_arm.go | 1 + .../x/sys/unix/zerrors_netbsd_arm64.go | 1 + .../x/sys/unix/zerrors_openbsd_386.go | 1 + .../x/sys/unix/zerrors_openbsd_amd64.go | 1 + .../x/sys/unix/zerrors_openbsd_arm.go | 1 + .../x/sys/unix/zerrors_openbsd_arm64.go | 1 + .../x/sys/unix/zerrors_openbsd_mips64.go | 1 + .../x/sys/unix/zerrors_solaris_amd64.go | 4 + .../x/sys/unix/zerrors_zos_s390x.go | 838 + .../x/sys/unix/zptrace_armnn_linux.go | 1 + .../x/sys/unix/zptrace_mipsnn_linux.go | 1 + .../x/sys/unix/zptrace_mipsnnle_linux.go | 1 + .../x/sys/unix/zptrace_x86_linux.go | 1 + .../golang.org/x/sys/unix/zsyscall_aix_ppc.go | 1 + .../x/sys/unix/zsyscall_aix_ppc64.go | 1 + .../x/sys/unix/zsyscall_aix_ppc64_gc.go | 4 +- .../x/sys/unix/zsyscall_aix_ppc64_gccgo.go | 4 +- .../x/sys/unix/zsyscall_darwin_386.1_13.go | 1 + .../x/sys/unix/zsyscall_darwin_386.go | 9 +- .../x/sys/unix/zsyscall_darwin_amd64.1_13.go | 1 + .../x/sys/unix/zsyscall_darwin_amd64.go | 9 +- .../x/sys/unix/zsyscall_darwin_arm.1_13.go | 1 + .../x/sys/unix/zsyscall_darwin_arm.go | 7 +- .../x/sys/unix/zsyscall_darwin_arm64.1_13.go | 1 + .../x/sys/unix/zsyscall_darwin_arm64.go | 9 +- .../x/sys/unix/zsyscall_dragonfly_amd64.go | 7 +- .../x/sys/unix/zsyscall_freebsd_386.go | 1 + .../x/sys/unix/zsyscall_freebsd_amd64.go | 1 + .../x/sys/unix/zsyscall_freebsd_arm.go | 1 + .../x/sys/unix/zsyscall_freebsd_arm64.go | 1 + .../x/sys/unix/zsyscall_illumos_amd64.go | 24 +- .../golang.org/x/sys/unix/zsyscall_linux.go | 11 + .../x/sys/unix/zsyscall_linux_386.go | 1 + .../x/sys/unix/zsyscall_linux_amd64.go | 1 + .../x/sys/unix/zsyscall_linux_arm.go | 1 + .../x/sys/unix/zsyscall_linux_arm64.go | 1 + .../x/sys/unix/zsyscall_linux_mips.go | 1 + .../x/sys/unix/zsyscall_linux_mips64.go | 1 + .../x/sys/unix/zsyscall_linux_mips64le.go | 1 + .../x/sys/unix/zsyscall_linux_mipsle.go | 1 + .../x/sys/unix/zsyscall_linux_ppc64.go | 1 + .../x/sys/unix/zsyscall_linux_ppc64le.go | 1 + .../x/sys/unix/zsyscall_linux_riscv64.go | 1 + .../x/sys/unix/zsyscall_linux_s390x.go | 1 + .../x/sys/unix/zsyscall_linux_sparc64.go | 1 + .../x/sys/unix/zsyscall_netbsd_386.go | 11 + .../x/sys/unix/zsyscall_netbsd_amd64.go | 11 + .../x/sys/unix/zsyscall_netbsd_arm.go | 11 + .../x/sys/unix/zsyscall_netbsd_arm64.go | 11 + .../x/sys/unix/zsyscall_openbsd_386.go | 1 + .../x/sys/unix/zsyscall_openbsd_amd64.go | 1 + .../x/sys/unix/zsyscall_openbsd_arm.go | 1 + .../x/sys/unix/zsyscall_openbsd_arm64.go | 1 + .../x/sys/unix/zsyscall_openbsd_mips64.go | 1 + .../x/sys/unix/zsyscall_solaris_amd64.go | 33 +- .../x/sys/unix/zsyscall_zos_s390x.go | 1217 + .../x/sys/unix/zsysctl_openbsd_386.go | 1 + .../x/sys/unix/zsysctl_openbsd_amd64.go | 1 + .../x/sys/unix/zsysctl_openbsd_arm.go | 1 + .../x/sys/unix/zsysctl_openbsd_arm64.go | 1 + .../x/sys/unix/zsysctl_openbsd_mips64.go | 1 + .../x/sys/unix/zsysnum_darwin_386.go | 1 + .../x/sys/unix/zsysnum_darwin_amd64.go | 1 + .../x/sys/unix/zsysnum_darwin_arm.go | 1 + .../x/sys/unix/zsysnum_darwin_arm64.go | 1 + .../x/sys/unix/zsysnum_dragonfly_amd64.go | 1 + .../x/sys/unix/zsysnum_freebsd_386.go | 1 + .../x/sys/unix/zsysnum_freebsd_amd64.go | 1 + .../x/sys/unix/zsysnum_freebsd_arm.go | 1 + .../x/sys/unix/zsysnum_freebsd_arm64.go | 1 + .../x/sys/unix/zsysnum_linux_386.go | 2 + .../x/sys/unix/zsysnum_linux_amd64.go | 2 + .../x/sys/unix/zsysnum_linux_arm.go | 2 + .../x/sys/unix/zsysnum_linux_arm64.go | 2 + .../x/sys/unix/zsysnum_linux_mips.go | 2 + .../x/sys/unix/zsysnum_linux_mips64.go | 2 + .../x/sys/unix/zsysnum_linux_mips64le.go | 2 + .../x/sys/unix/zsysnum_linux_mipsle.go | 2 + .../x/sys/unix/zsysnum_linux_ppc64.go | 2 + .../x/sys/unix/zsysnum_linux_ppc64le.go | 2 + .../x/sys/unix/zsysnum_linux_riscv64.go | 2 + .../x/sys/unix/zsysnum_linux_s390x.go | 2 + .../x/sys/unix/zsysnum_linux_sparc64.go | 2 + .../x/sys/unix/zsysnum_netbsd_386.go | 1 + .../x/sys/unix/zsysnum_netbsd_amd64.go | 1 + .../x/sys/unix/zsysnum_netbsd_arm.go | 1 + .../x/sys/unix/zsysnum_netbsd_arm64.go | 1 + .../x/sys/unix/zsysnum_openbsd_386.go | 1 + .../x/sys/unix/zsysnum_openbsd_amd64.go | 1 + .../x/sys/unix/zsysnum_openbsd_arm.go | 1 + .../x/sys/unix/zsysnum_openbsd_arm64.go | 1 + .../x/sys/unix/zsysnum_openbsd_mips64.go | 1 + .../x/sys/unix/zsysnum_zos_s390x.go | 2670 ++ .../golang.org/x/sys/unix/ztypes_aix_ppc.go | 2 + .../golang.org/x/sys/unix/ztypes_aix_ppc64.go | 2 + .../x/sys/unix/ztypes_darwin_386.go | 1 + .../x/sys/unix/ztypes_darwin_amd64.go | 9 + .../x/sys/unix/ztypes_darwin_arm.go | 1 + .../x/sys/unix/ztypes_darwin_arm64.go | 9 + .../x/sys/unix/ztypes_dragonfly_amd64.go | 2 + .../x/sys/unix/ztypes_freebsd_386.go | 11 + .../x/sys/unix/ztypes_freebsd_amd64.go | 11 + .../x/sys/unix/ztypes_freebsd_arm.go | 11 + .../x/sys/unix/ztypes_freebsd_arm64.go | 11 + .../x/sys/unix/ztypes_illumos_amd64.go | 40 + vendor/golang.org/x/sys/unix/ztypes_linux.go | 519 +- .../golang.org/x/sys/unix/ztypes_linux_386.go | 3 +- .../x/sys/unix/ztypes_linux_amd64.go | 3 +- .../golang.org/x/sys/unix/ztypes_linux_arm.go | 3 +- .../x/sys/unix/ztypes_linux_arm64.go | 3 +- .../x/sys/unix/ztypes_linux_mips.go | 3 +- .../x/sys/unix/ztypes_linux_mips64.go | 3 +- .../x/sys/unix/ztypes_linux_mips64le.go | 3 +- .../x/sys/unix/ztypes_linux_mipsle.go | 3 +- .../x/sys/unix/ztypes_linux_ppc64.go | 3 +- .../x/sys/unix/ztypes_linux_ppc64le.go | 3 +- .../x/sys/unix/ztypes_linux_riscv64.go | 3 +- .../x/sys/unix/ztypes_linux_s390x.go | 3 +- .../x/sys/unix/ztypes_linux_sparc64.go | 3 +- .../x/sys/unix/ztypes_netbsd_386.go | 2 + .../x/sys/unix/ztypes_netbsd_amd64.go | 2 + .../x/sys/unix/ztypes_netbsd_arm.go | 2 + .../x/sys/unix/ztypes_netbsd_arm64.go | 2 + .../x/sys/unix/ztypes_openbsd_386.go | 2 + .../x/sys/unix/ztypes_openbsd_amd64.go | 2 + .../x/sys/unix/ztypes_openbsd_arm.go | 2 + .../x/sys/unix/ztypes_openbsd_arm64.go | 2 + .../x/sys/unix/ztypes_openbsd_mips64.go | 2 + .../x/sys/unix/ztypes_solaris_amd64.go | 2 + .../golang.org/x/sys/unix/ztypes_zos_s390x.go | 402 + .../golang.org/x/sys/windows/exec_windows.go | 35 + vendor/golang.org/x/sys/windows/mkerrors.bash | 7 + .../x/sys/windows/security_windows.go | 29 +- .../x/sys/windows/syscall_windows.go | 224 +- .../golang.org/x/sys/windows/types_windows.go | 974 +- .../x/sys/windows/types_windows_arm64.go | 34 + .../x/sys/windows/zerrors_windows.go | 2619 +- .../x/sys/windows/zsyscall_windows.go | 474 +- vendor/golang.org/x/term/term.go | 4 +- vendor/golang.org/x/term/term_solaris.go | 111 - vendor/golang.org/x/term/term_unix.go | 3 +- vendor/golang.org/x/term/term_unix_bsd.go | 1 + .../doc.go => term/term_unix_solaris.go} | 9 +- vendor/golang.org/x/term/term_unsupported.go | 1 + .../golang.org/x/text/transform/transform.go | 6 +- .../x/text/unicode/norm/tables10.0.0.go | 1 + .../x/text/unicode/norm/tables11.0.0.go | 3 +- .../x/text/unicode/norm/tables12.0.0.go | 7711 ++++ .../x/text/unicode/norm/tables13.0.0.go | 7761 ++++ .../x/text/unicode/norm/tables9.0.0.go | 1 + vendor/golang.org/x/tools/AUTHORS | 3 - vendor/golang.org/x/tools/CONTRIBUTORS | 3 - vendor/golang.org/x/tools/LICENSE | 27 - vendor/golang.org/x/tools/PATENTS | 22 - .../x/tools/go/gcexportdata/gcexportdata.go | 109 - .../x/tools/go/gcexportdata/importer.go | 73 - .../x/tools/go/internal/gcimporter/bexport.go | 852 - .../x/tools/go/internal/gcimporter/bimport.go | 1039 - .../go/internal/gcimporter/exportdata.go | 93 - .../go/internal/gcimporter/gcimporter.go | 1078 - .../x/tools/go/internal/gcimporter/iexport.go | 739 - .../x/tools/go/internal/gcimporter/iimport.go | 630 - .../go/internal/gcimporter/newInterface10.go | 21 - .../go/internal/gcimporter/newInterface11.go | 13 - .../tools/go/internal/packagesdriver/sizes.go | 117 - vendor/golang.org/x/tools/go/packages/doc.go | 221 - .../x/tools/go/packages/external.go | 101 - .../golang.org/x/tools/go/packages/golist.go | 889 - .../x/tools/go/packages/golist_overlay.go | 438 - .../x/tools/go/packages/loadmode_string.go | 57 - .../x/tools/go/packages/packages.go | 1159 - .../golang.org/x/tools/go/packages/visit.go | 55 - .../x/tools/internal/event/core/event.go | 106 - .../x/tools/internal/event/core/export.go | 70 - .../x/tools/internal/event/core/fast.go | 57 - .../x/tools/internal/event/event.go | 69 - .../x/tools/internal/event/keys/keys.go | 542 - .../x/tools/internal/event/keys/standard.go | 14 - .../x/tools/internal/event/label/label.go | 213 - .../x/tools/internal/gocommand/invoke.go | 187 - .../internal/packagesinternal/packages.go | 35 - vendor/golang.org/x/xerrors/LICENSE | 27 - vendor/golang.org/x/xerrors/PATENTS | 22 - vendor/golang.org/x/xerrors/README | 2 - vendor/golang.org/x/xerrors/adaptor.go | 193 - vendor/golang.org/x/xerrors/codereview.cfg | 1 - vendor/golang.org/x/xerrors/doc.go | 22 - vendor/golang.org/x/xerrors/errors.go | 33 - vendor/golang.org/x/xerrors/fmt.go | 187 - vendor/golang.org/x/xerrors/format.go | 34 - vendor/golang.org/x/xerrors/frame.go | 56 - vendor/golang.org/x/xerrors/go.mod | 3 - .../golang.org/x/xerrors/internal/internal.go | 8 - vendor/golang.org/x/xerrors/wrap.go | 106 - vendor/modules.txt | 111 +- vendor/nhooyr.io/websocket/Makefile | 7 - vendor/nhooyr.io/websocket/README.md | 41 +- vendor/nhooyr.io/websocket/accept.go | 99 +- vendor/nhooyr.io/websocket/accept_js.go | 1 + vendor/nhooyr.io/websocket/close_notjs.go | 50 +- vendor/nhooyr.io/websocket/compress.go | 1 + vendor/nhooyr.io/websocket/conn_notjs.go | 27 +- vendor/nhooyr.io/websocket/dial.go | 34 +- vendor/nhooyr.io/websocket/go.mod | 5 +- vendor/nhooyr.io/websocket/go.sum | 52 +- vendor/nhooyr.io/websocket/read.go | 48 +- vendor/nhooyr.io/websocket/write.go | 78 +- vendor/nhooyr.io/websocket/ws_js.go | 4 + 1022 files changed, 58903 insertions(+), 90476 deletions(-) create mode 100644 vendor/github.com/andybalholm/brotli/http.go create mode 100644 vendor/github.com/go-ole/go-ole/go.sum delete mode 100644 vendor/github.com/golang/gddo/LICENSE delete mode 100644 vendor/github.com/golang/gddo/httputil/buster.go delete mode 100644 vendor/github.com/golang/gddo/httputil/header/header.go delete mode 100644 vendor/github.com/golang/gddo/httputil/httputil.go delete mode 100644 vendor/github.com/golang/gddo/httputil/negotiate.go delete mode 100644 vendor/github.com/golang/gddo/httputil/respbuf.go delete mode 100644 vendor/github.com/golang/gddo/httputil/static.go delete mode 100644 vendor/github.com/golang/gddo/httputil/transport.go create mode 100644 vendor/github.com/klauspost/compress/flate/gen_inflate.go create mode 100644 vendor/github.com/klauspost/compress/flate/inflate_gen.go create mode 100644 vendor/github.com/klauspost/compress/gzip/gunzip.go create mode 100644 vendor/github.com/klauspost/compress/gzip/gzip.go create mode 100644 vendor/github.com/klauspost/compress/zstd/dict.go create mode 100644 vendor/github.com/klauspost/compress/zstd/enc_better.go delete mode 100644 vendor/github.com/klauspost/cpuid/.travis.yml delete mode 100644 vendor/github.com/klauspost/cpuid/README.md delete mode 100644 vendor/github.com/klauspost/cpuid/cpuid.go delete mode 100644 vendor/github.com/klauspost/cpuid/detect_intel.go delete mode 100644 vendor/github.com/klauspost/cpuid/detect_ref.go delete mode 100644 vendor/github.com/klauspost/cpuid/generate.go rename vendor/github.com/klauspost/cpuid/{ => v2}/.gitignore (100%) create mode 100644 vendor/github.com/klauspost/cpuid/v2/.travis.yml rename vendor/github.com/klauspost/cpuid/{ => v2}/CONTRIBUTING.txt (100%) rename vendor/github.com/klauspost/cpuid/{ => v2}/LICENSE (100%) create mode 100644 vendor/github.com/klauspost/cpuid/v2/README.md create mode 100644 vendor/github.com/klauspost/cpuid/v2/cpuid.go rename vendor/github.com/klauspost/cpuid/{ => v2}/cpuid_386.s (96%) rename vendor/github.com/klauspost/cpuid/{ => v2}/cpuid_amd64.s (95%) create mode 100644 vendor/github.com/klauspost/cpuid/v2/cpuid_arm64.s create mode 100644 vendor/github.com/klauspost/cpuid/v2/detect_arm64.go create mode 100644 vendor/github.com/klauspost/cpuid/v2/detect_ref.go create mode 100644 vendor/github.com/klauspost/cpuid/v2/detect_x86.go create mode 100644 vendor/github.com/klauspost/cpuid/v2/featureid_string.go create mode 100644 vendor/github.com/klauspost/cpuid/v2/go.mod create mode 100644 vendor/github.com/klauspost/cpuid/v2/os_darwin_arm64.go create mode 100644 vendor/github.com/klauspost/cpuid/v2/os_linux_arm64.go create mode 100644 vendor/github.com/klauspost/cpuid/v2/os_other_arm64.go delete mode 100644 vendor/github.com/klauspost/reedsolomon/gen.go create mode 100644 vendor/github.com/mholt/archiver/v3/.goreleaser.yml create mode 100644 vendor/github.com/mholt/archiver/v3/.prettierrc create mode 100644 vendor/github.com/mholt/archiver/v3/error.go delete mode 100644 vendor/github.com/mmcloughlin/avo/attr/attr.go delete mode 100644 vendor/github.com/mmcloughlin/avo/build/attr.go delete mode 100644 vendor/github.com/mmcloughlin/avo/build/cli.go delete mode 100644 vendor/github.com/mmcloughlin/avo/build/context.go delete mode 100644 vendor/github.com/mmcloughlin/avo/build/doc.go delete mode 100644 vendor/github.com/mmcloughlin/avo/build/error.go delete mode 100644 vendor/github.com/mmcloughlin/avo/build/global.go delete mode 100644 vendor/github.com/mmcloughlin/avo/build/pseudo.go delete mode 100644 vendor/github.com/mmcloughlin/avo/build/zinstructions.go delete mode 100644 vendor/github.com/mmcloughlin/avo/build/zmov.go delete mode 100644 vendor/github.com/mmcloughlin/avo/buildtags/buildtags.go delete mode 100644 vendor/github.com/mmcloughlin/avo/gotypes/components.go delete mode 100644 vendor/github.com/mmcloughlin/avo/gotypes/doc.go delete mode 100644 vendor/github.com/mmcloughlin/avo/gotypes/signature.go delete mode 100644 vendor/github.com/mmcloughlin/avo/internal/prnt/printer.go delete mode 100644 vendor/github.com/mmcloughlin/avo/internal/stack/stack.go delete mode 100644 vendor/github.com/mmcloughlin/avo/ir/doc.go delete mode 100644 vendor/github.com/mmcloughlin/avo/ir/ir.go delete mode 100644 vendor/github.com/mmcloughlin/avo/operand/checks.go delete mode 100644 vendor/github.com/mmcloughlin/avo/operand/const.go delete mode 100644 vendor/github.com/mmcloughlin/avo/operand/doc.go delete mode 100644 vendor/github.com/mmcloughlin/avo/operand/types.go delete mode 100644 vendor/github.com/mmcloughlin/avo/operand/zconst.go delete mode 100644 vendor/github.com/mmcloughlin/avo/pass/alloc.go delete mode 100644 vendor/github.com/mmcloughlin/avo/pass/cfg.go delete mode 100644 vendor/github.com/mmcloughlin/avo/pass/cleanup.go delete mode 100644 vendor/github.com/mmcloughlin/avo/pass/isa.go delete mode 100644 vendor/github.com/mmcloughlin/avo/pass/pass.go delete mode 100644 vendor/github.com/mmcloughlin/avo/pass/reg.go delete mode 100644 vendor/github.com/mmcloughlin/avo/pass/textflag.go delete mode 100644 vendor/github.com/mmcloughlin/avo/pass/verify.go delete mode 100644 vendor/github.com/mmcloughlin/avo/printer/goasm.go delete mode 100644 vendor/github.com/mmcloughlin/avo/printer/printer.go delete mode 100644 vendor/github.com/mmcloughlin/avo/printer/stubs.go delete mode 100644 vendor/github.com/mmcloughlin/avo/reg/collection.go delete mode 100644 vendor/github.com/mmcloughlin/avo/reg/doc.go delete mode 100644 vendor/github.com/mmcloughlin/avo/reg/set.go delete mode 100644 vendor/github.com/mmcloughlin/avo/reg/types.go delete mode 100644 vendor/github.com/mmcloughlin/avo/reg/x86.go delete mode 100644 vendor/github.com/mmcloughlin/avo/src/src.go delete mode 100644 vendor/github.com/mmcloughlin/avo/x86/doc.go delete mode 100644 vendor/github.com/mmcloughlin/avo/x86/gen.go delete mode 100644 vendor/github.com/mmcloughlin/avo/x86/zctors.go delete mode 100644 vendor/github.com/pierrec/lz4/.travis.yml delete mode 100644 vendor/github.com/pierrec/lz4/README.md delete mode 100644 vendor/github.com/pierrec/lz4/block.go delete mode 100644 vendor/github.com/pierrec/lz4/debug.go delete mode 100644 vendor/github.com/pierrec/lz4/debug_stub.go delete mode 100644 vendor/github.com/pierrec/lz4/internal/xxh32/xxh32zero.go delete mode 100644 vendor/github.com/pierrec/lz4/lz4.go delete mode 100644 vendor/github.com/pierrec/lz4/lz4_go1.10.go delete mode 100644 vendor/github.com/pierrec/lz4/lz4_notgo1.10.go delete mode 100644 vendor/github.com/pierrec/lz4/reader.go rename vendor/github.com/pierrec/lz4/{ => v4}/.gitignore (96%) create mode 100644 vendor/github.com/pierrec/lz4/v4/.travis.yml rename vendor/github.com/pierrec/lz4/{ => v4}/LICENSE (100%) create mode 100644 vendor/github.com/pierrec/lz4/v4/README.md create mode 100644 vendor/github.com/pierrec/lz4/v4/go.mod create mode 100644 vendor/github.com/pierrec/lz4/v4/go.sum create mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4block/block.go create mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4block/blocks.go create mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_amd64.s create mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_arm.s create mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_asm.go create mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_other.go create mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4errors/errors.go create mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4stream/frame.go create mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4stream/frame_gen.go create mode 100644 vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero.go create mode 100644 vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.go create mode 100644 vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.s create mode 100644 vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_other.go create mode 100644 vendor/github.com/pierrec/lz4/v4/lz4.go create mode 100644 vendor/github.com/pierrec/lz4/v4/options.go create mode 100644 vendor/github.com/pierrec/lz4/v4/options_gen.go create mode 100644 vendor/github.com/pierrec/lz4/v4/reader.go create mode 100644 vendor/github.com/pierrec/lz4/v4/state.go create mode 100644 vendor/github.com/pierrec/lz4/v4/state_gen.go create mode 100644 vendor/github.com/pierrec/lz4/v4/writer.go delete mode 100644 vendor/github.com/pierrec/lz4/writer.go create mode 100644 vendor/github.com/pkg/errors/Makefile create mode 100644 vendor/github.com/pkg/errors/go113.go create mode 100644 vendor/github.com/shirou/gopsutil/cpu/cpu_dragonfly.go create mode 100644 vendor/github.com/shirou/gopsutil/cpu/cpu_dragonfly_amd64.go create mode 100644 vendor/github.com/shirou/gopsutil/internal/common/sleep.go create mode 100644 vendor/github.com/shirou/gopsutil/mem/mem_openbsd_386.go create mode 100644 vendor/github.com/shirou/gopsutil/process/process_bsd.go create mode 100644 vendor/github.com/shirou/gopsutil/process/process_darwin_arm64.go create mode 100644 vendor/github.com/shirou/gopsutil/process/process_openbsd_386.go create mode 100644 vendor/github.com/skycoin/dmsg/httputil/log.go create mode 100644 vendor/github.com/skycoin/dmsg/servermetrics/metrics.go create mode 100644 vendor/github.com/spf13/cobra/.golangci.yml create mode 100644 vendor/github.com/spf13/cobra/CHANGELOG.md create mode 100644 vendor/github.com/spf13/cobra/CONDUCT.md create mode 100644 vendor/github.com/spf13/cobra/CONTRIBUTING.md create mode 100644 vendor/github.com/spf13/cobra/projects_using_cobra.md create mode 100644 vendor/github.com/spf13/cobra/shell_completions.md create mode 100644 vendor/github.com/spf13/pflag/float32_slice.go create mode 100644 vendor/github.com/spf13/pflag/float64_slice.go create mode 100644 vendor/github.com/spf13/pflag/go.mod create mode 100644 vendor/github.com/spf13/pflag/go.sum create mode 100644 vendor/github.com/spf13/pflag/int32_slice.go create mode 100644 vendor/github.com/spf13/pflag/int64_slice.go create mode 100644 vendor/github.com/spf13/pflag/string_to_int64.go create mode 100644 vendor/github.com/stretchr/testify/assert/assertion_order.go create mode 100644 vendor/github.com/tjfoc/gmsm/sm4/sm4_gcm.go create mode 100644 vendor/github.com/tjfoc/gmsm/sm4/utils.go create mode 100644 vendor/github.com/tklauser/go-sysconf/.cirrus.yml create mode 100644 vendor/github.com/tklauser/go-sysconf/.gitignore rename vendor/github.com/{mmcloughlin/avo => tklauser/go-sysconf}/LICENSE (97%) create mode 100644 vendor/github.com/tklauser/go-sysconf/README.md create mode 100644 vendor/github.com/tklauser/go-sysconf/go.mod create mode 100644 vendor/github.com/tklauser/go-sysconf/go.sum create mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf.go create mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_bsd.go create mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_darwin.go create mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_dragonfly.go create mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_freebsd.go create mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_generic.go create mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_linux.go create mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_netbsd.go create mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_openbsd.go create mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_posix.go create mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_solaris.go create mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_unsupported.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_defs_darwin.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_defs_dragonfly.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_defs_freebsd.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_defs_linux.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_defs_netbsd.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_defs_openbsd.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_defs_solaris.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_386.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_amd64.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm64.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_386.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_amd64.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_arm.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_arm64.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips64.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips64le.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mipsle.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_ppc64.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_ppc64le.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_riscv64.go create mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_s390x.go create mode 100644 vendor/github.com/tklauser/numcpus/.cirrus.yml create mode 100644 vendor/github.com/tklauser/numcpus/LICENSE create mode 100644 vendor/github.com/tklauser/numcpus/README.md create mode 100644 vendor/github.com/tklauser/numcpus/go.mod create mode 100644 vendor/github.com/tklauser/numcpus/go.sum create mode 100644 vendor/github.com/tklauser/numcpus/numcpus.go create mode 100644 vendor/github.com/tklauser/numcpus/numcpus_bsd.go create mode 100644 vendor/github.com/tklauser/numcpus/numcpus_linux.go create mode 100644 vendor/github.com/tklauser/numcpus/numcpus_solaris.go create mode 100644 vendor/github.com/tklauser/numcpus/numcpus_unsupported.go create mode 100644 vendor/github.com/ulikunitz/xz/fox-check-none.xz create mode 100644 vendor/github.com/ulikunitz/xz/none-check.go create mode 100644 vendor/golang.org/x/net/internal/socket/cmsghdr_unix.go create mode 100644 vendor/golang.org/x/net/internal/socket/cmsghdr_zos_s390x.go create mode 100644 vendor/golang.org/x/net/internal/socket/msghdr_zos_s390x.go delete mode 100644 vendor/golang.org/x/net/internal/socket/sys_bsdvar.go create mode 100644 vendor/golang.org/x/net/internal/socket/sys_const_zos.go delete mode 100644 vendor/golang.org/x/net/internal/socket/sys_darwin.go delete mode 100644 vendor/golang.org/x/net/internal/socket/sys_dragonfly.go rename vendor/golang.org/x/net/internal/socket/{sys_go1_11_darwin.go => sys_zos_s390x.go} (52%) create mode 100644 vendor/golang.org/x/net/internal/socket/sys_zos_s390x.s create mode 100644 vendor/golang.org/x/net/internal/socket/zsys_openbsd_mips64.go create mode 100644 vendor/golang.org/x/net/internal/socket/zsys_zos_s390x.go create mode 100644 vendor/golang.org/x/net/ipv4/control_zos.go create mode 100644 vendor/golang.org/x/net/ipv4/sys_zos.go create mode 100644 vendor/golang.org/x/net/ipv4/zsys_zos_s390x.go create mode 100644 vendor/golang.org/x/net/ipv6/icmp_zos.go create mode 100644 vendor/golang.org/x/net/ipv6/sys_zos.go create mode 100644 vendor/golang.org/x/net/ipv6/zsys_zos_s390x.go rename vendor/golang.org/x/sys/unix/{asm_freebsd_386.s => asm_bsd_386.s} (70%) rename vendor/golang.org/x/sys/unix/{asm_darwin_amd64.s => asm_bsd_amd64.s} (72%) rename vendor/golang.org/x/sys/unix/{asm_freebsd_arm.s => asm_bsd_arm.s} (74%) rename vendor/golang.org/x/sys/unix/{asm_netbsd_amd64.s => asm_bsd_arm64.s} (75%) delete mode 100644 vendor/golang.org/x/sys/unix/asm_darwin_386.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_darwin_arm.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_darwin_arm64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_netbsd_386.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_netbsd_arm.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_openbsd_386.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_openbsd_arm.s delete mode 100644 vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s create mode 100644 vendor/golang.org/x/sys/unix/asm_zos_s390x.s create mode 100644 vendor/golang.org/x/sys/unix/dev_zos.go create mode 100644 vendor/golang.org/x/sys/unix/epoll_zos.go create mode 100644 vendor/golang.org/x/sys/unix/fstatfs_zos.go create mode 100644 vendor/golang.org/x/sys/unix/ioctl_linux.go create mode 100644 vendor/golang.org/x/sys/unix/ioctl_zos.go create mode 100644 vendor/golang.org/x/sys/unix/ptrace_darwin.go create mode 100644 vendor/golang.org/x/sys/unix/ptrace_ios.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_zos_s390x.go create mode 100644 vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go create mode 100644 vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go create mode 100644 vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go create mode 100644 vendor/golang.org/x/sys/windows/types_windows_arm64.go delete mode 100644 vendor/golang.org/x/term/term_solaris.go rename vendor/golang.org/x/{tools/internal/event/doc.go => term/term_unix_solaris.go} (53%) create mode 100644 vendor/golang.org/x/text/unicode/norm/tables12.0.0.go create mode 100644 vendor/golang.org/x/text/unicode/norm/tables13.0.0.go delete mode 100644 vendor/golang.org/x/tools/AUTHORS delete mode 100644 vendor/golang.org/x/tools/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/tools/LICENSE delete mode 100644 vendor/golang.org/x/tools/PATENTS delete mode 100644 vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go delete mode 100644 vendor/golang.org/x/tools/go/gcexportdata/importer.go delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/iexport.go delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/newInterface10.go delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/newInterface11.go delete mode 100644 vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go delete mode 100644 vendor/golang.org/x/tools/go/packages/doc.go delete mode 100644 vendor/golang.org/x/tools/go/packages/external.go delete mode 100644 vendor/golang.org/x/tools/go/packages/golist.go delete mode 100644 vendor/golang.org/x/tools/go/packages/golist_overlay.go delete mode 100644 vendor/golang.org/x/tools/go/packages/loadmode_string.go delete mode 100644 vendor/golang.org/x/tools/go/packages/packages.go delete mode 100644 vendor/golang.org/x/tools/go/packages/visit.go delete mode 100644 vendor/golang.org/x/tools/internal/event/core/event.go delete mode 100644 vendor/golang.org/x/tools/internal/event/core/export.go delete mode 100644 vendor/golang.org/x/tools/internal/event/core/fast.go delete mode 100644 vendor/golang.org/x/tools/internal/event/event.go delete mode 100644 vendor/golang.org/x/tools/internal/event/keys/keys.go delete mode 100644 vendor/golang.org/x/tools/internal/event/keys/standard.go delete mode 100644 vendor/golang.org/x/tools/internal/event/label/label.go delete mode 100644 vendor/golang.org/x/tools/internal/gocommand/invoke.go delete mode 100644 vendor/golang.org/x/tools/internal/packagesinternal/packages.go delete mode 100644 vendor/golang.org/x/xerrors/LICENSE delete mode 100644 vendor/golang.org/x/xerrors/PATENTS delete mode 100644 vendor/golang.org/x/xerrors/README delete mode 100644 vendor/golang.org/x/xerrors/adaptor.go delete mode 100644 vendor/golang.org/x/xerrors/codereview.cfg delete mode 100644 vendor/golang.org/x/xerrors/doc.go delete mode 100644 vendor/golang.org/x/xerrors/errors.go delete mode 100644 vendor/golang.org/x/xerrors/fmt.go delete mode 100644 vendor/golang.org/x/xerrors/format.go delete mode 100644 vendor/golang.org/x/xerrors/frame.go delete mode 100644 vendor/golang.org/x/xerrors/go.mod delete mode 100644 vendor/golang.org/x/xerrors/internal/internal.go delete mode 100644 vendor/golang.org/x/xerrors/wrap.go delete mode 100644 vendor/nhooyr.io/websocket/Makefile diff --git a/cmd/apps/skychat/chat.go b/cmd/apps/skychat/chat.go index 360fe5e4b0..6a233c8b3f 100644 --- a/cmd/apps/skychat/chat.go +++ b/cmd/apps/skychat/chat.go @@ -4,17 +4,18 @@ skychat app for skywire visor package main import ( - "embed" "encoding/json" "flag" "fmt" - "io/fs" "net" "net/http" "os" "sync" "time" + "embed" + "io/fs" + "github.com/skycoin/dmsg/buildinfo" "github.com/skycoin/dmsg/cipher" diff --git a/cmd/skywire-visor/commands/root.go b/cmd/skywire-visor/commands/root.go index c15c926996..341c8b8fdf 100644 --- a/cmd/skywire-visor/commands/root.go +++ b/cmd/skywire-visor/commands/root.go @@ -2,10 +2,8 @@ package commands import ( "context" - "embed" "fmt" "io" - "io/fs" "io/ioutil" "net/http" _ "net/http/pprof" // nolint:gosec // https://golang.org/doc/diagnostics.html#profiling @@ -15,6 +13,9 @@ import ( "syscall" "time" + "embed" + "io/fs" + "github.com/pkg/profile" "github.com/skycoin/dmsg/buildinfo" "github.com/skycoin/dmsg/cmdutil" diff --git a/go.mod b/go.mod index c129fc3c53..6971ca9110 100644 --- a/go.mod +++ b/go.mod @@ -3,49 +3,49 @@ module github.com/skycoin/skywire go 1.16 require ( - github.com/AudriusButkevicius/pfilter v0.0.0-20190627213056-c55ef6137fc6 - github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect - github.com/VictoriaMetrics/metrics v1.12.3 + github.com/AudriusButkevicius/pfilter v0.0.0-20210218141631-7468b85d810a + github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 // indirect + github.com/VictoriaMetrics/metrics v1.17.2 github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 github.com/creack/pty v1.1.11 // indirect github.com/go-chi/chi v4.1.2+incompatible - github.com/go-ole/go-ole v1.2.4 // indirect - github.com/golang/protobuf v1.4.2 // indirect + github.com/go-ole/go-ole v1.2.5 // indirect + github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-github v17.0.0+incompatible - github.com/google/go-querystring v1.0.0 // indirect - github.com/google/uuid v1.1.1 + github.com/google/go-querystring v1.1.0 // indirect + github.com/google/uuid v1.2.0 github.com/gorilla/securecookie v1.1.1 - github.com/klauspost/reedsolomon v1.9.9 // indirect + github.com/klauspost/reedsolomon v1.9.12 // indirect github.com/mattn/go-colorable v0.1.8 // indirect github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect - github.com/mholt/archiver/v3 v3.3.0 - github.com/mmcloughlin/avo v0.0.0-20200523190732-4439b6b2c061 // indirect - github.com/pkg/errors v0.8.1 // indirect + github.com/mholt/archiver/v3 v3.5.0 + github.com/pkg/errors v0.9.1 // indirect github.com/pkg/profile v1.5.0 - github.com/prometheus/client_golang v1.7.1 // indirect github.com/schollz/progressbar/v2 v2.15.0 - github.com/shirou/gopsutil v2.20.5+incompatible - github.com/sirupsen/logrus v1.7.0 - github.com/skycoin/dmsg v0.0.0-20201216183836-dae8a7acfc14 + github.com/shirou/gopsutil v3.21.3+incompatible + github.com/sirupsen/logrus v1.8.1 + github.com/skycoin/dmsg v0.0.0-20210329160412-4e25fc9ad26c github.com/skycoin/skycoin v0.27.1 github.com/skycoin/yamux v0.0.0-20200803175205-571ceb89da9f github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 - github.com/spf13/cobra v1.0.0 - github.com/stretchr/testify v1.6.1 + github.com/spf13/cobra v1.1.3 + github.com/stretchr/testify v1.7.0 github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161 // indirect github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b // indirect - github.com/tjfoc/gmsm v1.3.2 // indirect + github.com/tjfoc/gmsm v1.4.0 // indirect + github.com/tklauser/go-sysconf v0.3.5 // indirect github.com/toqueteos/webbrowser v1.2.0 github.com/xtaci/kcp-go v5.4.20+incompatible github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37 // indirect go.etcd.io/bbolt v1.3.5 - golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9 // indirect - golang.org/x/net v0.0.0-20200625001655-4c5254603344 - golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e - golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf // indirect + golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc // indirect + golang.org/x/net v0.0.0-20210420210106-798c2154c571 + golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988 + golang.org/x/term v0.0.0-20210406210042-72f3dc4e9b72 // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect golang.zx2c4.com/wireguard v0.0.20200320 - nhooyr.io/websocket v1.8.2 + nhooyr.io/websocket v1.8.7 ) // Uncomment for tests with alternate branches of 'dmsg' diff --git a/go.sum b/go.sum index f025f1c1b4..6e587a8bf7 100644 --- a/go.sum +++ b/go.sum @@ -1,31 +1,50 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/AudriusButkevicius/pfilter v0.0.0-20190627213056-c55ef6137fc6 h1:Apvc4kyfdrOxG+F5dn8osz+45kwGJa6CySQn0tB38SU= -github.com/AudriusButkevicius/pfilter v0.0.0-20190627213056-c55ef6137fc6/go.mod h1:1N0EEx/irz4B1qV17wW82TFbjQrE7oX316Cki6eDY0Q= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/AudriusButkevicius/pfilter v0.0.0-20210218141631-7468b85d810a h1:dUzIAgRmHLIUU0PT+OJ0X1WI5j1hlLbf+G420gUjIQg= +github.com/AudriusButkevicius/pfilter v0.0.0-20210218141631-7468b85d810a/go.mod h1:1N0EEx/irz4B1qV17wW82TFbjQrE7oX316Cki6eDY0Q= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= -github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/VictoriaMetrics/metrics v1.12.3 h1:Fe6JHC6MSEKa+BtLhPN8WIvS+HKPzMc2evEpNeCGy7I= +github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 h1:5sXbqlSomvdjlRbWyNqkPsJ3Fg+tQZCbgeX1VGljbQY= +github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/VictoriaMetrics/metrics v1.12.3/go.mod h1:Z1tSfPfngDn12bTfZSCqArT3OPY3u88J12hSoOhuiRE= +github.com/VictoriaMetrics/metrics v1.17.2 h1:9zPJ7DPfxdJWshOGLPLpAtPL0ZZ9AeUyQC3fIqG6Lvo= +github.com/VictoriaMetrics/metrics v1.17.2/go.mod h1:Z1tSfPfngDn12bTfZSCqArT3OPY3u88J12hSoOhuiRE= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6 h1:bZ28Hqta7TFAK3Q08CMvv8y3/8ATaEqv2nGoc6yff6c= -github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6/go.mod h1:+lx6/Aqd1kLJ1GQfkvOnaZ1WGmLpMpbprPuIOOZX30U= +github.com/andybalholm/brotli v1.0.0 h1:7UCwP93aiSfvWpapti8g88vVVGp2qqtGyePsSuDafo4= +github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= @@ -41,111 +60,179 @@ github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8 github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q= github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/go-chi/chi v4.1.2+incompatible h1:fGFk2Gmi/YKXk0OmGfBh0WgmN3XB8lVnEyNz34tQRec= github.com/go-chi/chi v4.1.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI= -github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= +github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY= +github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= +github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721 h1:KRMr9A3qfbVM7iV/WcLY/rL5LICqwMHLhwRXKu99fXw= -github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= +github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.10.0 h1:92XGj1AcYzA6UrVdd4qIIBrT8OroryvRvdmg/IfmC7Y= github.com/klauspost/compress v1.10.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.10.10 h1:a/y8CglcM7gLGYmlbP/stPE5sR3hbhFRUjCBfd/0B3I= +github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid v1.2.4 h1:EBfaK0SWSwk+fgk6efYFWdzl8MwRWoOO1gkmiaTXPW4= -github.com/klauspost/cpuid v1.2.4/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/pgzip v1.2.1 h1:oIPZROsWuPHpOdMVWLuJZXwgjhrW8r1yEX8UqMyeNHM= -github.com/klauspost/pgzip v1.2.1/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= -github.com/klauspost/reedsolomon v1.9.9 h1:qCL7LZlv17xMixl55nq2/Oa1Y86nfO8EqDfv2GHND54= -github.com/klauspost/reedsolomon v1.9.9/go.mod h1:O7yFFHiQwDR6b2t63KPUpccPtNdp5ADgh1gg4fd12wo= +github.com/klauspost/cpuid/v2 v2.0.2 h1:pd2FBxFydtPn2ywTLStbFg9CJKrojATnpeJWSP7Ys4k= +github.com/klauspost/cpuid/v2 v2.0.2/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/pgzip v1.2.4 h1:TQ7CNpYKovDOmqzRHKxJh0BeaBI7UdQZYc6p7pMQh1A= +github.com/klauspost/pgzip v1.2.4/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/klauspost/reedsolomon v1.9.12 h1:EyOucRmcrLH+2hqKGdoA5SM8pwPKR6BJsf3r6zpYOA0= +github.com/klauspost/reedsolomon v1.9.12/go.mod h1:nLvuzNvy1ZDNQW30IuMc2ZWCbiqrJgdLoUS2X8HAUVg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kz/discordrus v1.2.0 h1:r5uplKozPR+TIJ1NUZT758Lv7eukf8+fp3L4uRj+6xs= github.com/kz/discordrus v1.2.0/go.mod h1:cJ3TiJUUuY5Gm3DNYHnnaUa3iol8VBRPzztAeZm7exc= +github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= -github.com/mholt/archiver/v3 v3.3.0 h1:vWjhY8SQp5yzM9P6OJ/eZEkmi3UAbRrxCq48MxjAzig= -github.com/mholt/archiver/v3 v3.3.0/go.mod h1:YnQtqsp+94Rwd0D/rk5cnLrxusUBUXg+08Ebtr1Mqao= +github.com/mholt/archiver/v3 v3.5.0 h1:nE8gZIrw66cu4osS/U7UW7YDuGMHssxKutU8IfWxwWE= +github.com/mholt/archiver/v3 v3.5.0/go.mod h1:qqTTPUK/HZPFgFQ/TJ3BzvTpF/dPtFVJXdQbCmeMxwc= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mmcloughlin/avo v0.0.0-20200523190732-4439b6b2c061 h1:UCU8+cLbbvyxi0sQ9fSeoEhZgvrrD9HKMtX6Gmc1vk8= -github.com/mmcloughlin/avo v0.0.0-20200523190732-4439b6b2c061/go.mod h1:wqKykBG2QzQDJEzvRkcS8x6MiSJkF52hXZsXcjaB3ls= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -153,53 +240,54 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nwaples/rardecode v1.0.0 h1:r7vGuS5akxOnR4JQSkko62RJ1ReCMXxQRPtxsiFMBOs= -github.com/nwaples/rardecode v1.0.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= +github.com/nwaples/rardecode v1.1.0 h1:vSxaY8vQhOcVr4mm5e8XllHWTiM4JF507A0Katqw7MQ= +github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4/v4 v4.0.3 h1:vNQKSVZNYUEAvRY9FaUXAF1XPbSOHJtDTiP41kzDz2E= +github.com/pierrec/lz4/v4 v4.0.3/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pires/go-proxyproto v0.3.3/go.mod h1:Odh9VFOZJCf9G8cLW5o435Xf1J95Jw9Gw5rnCjcwzAY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.5.0 h1:042Buzk+NhDI+DeSAA62RwJL8VAuZUMQZUjCsRz1Mug= github.com/pkg/profile v1.5.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/schollz/progressbar/v2 v2.15.0 h1:dVzHQ8fHRmtPjD3K10jT3Qgn/+H+92jhPrhmxIJfDz8= github.com/schollz/progressbar/v2 v2.15.0/go.mod h1:UdPq3prGkfQ7MOzZKlDRpYKcFqEMczbD7YmbPgpzKMI= -github.com/shirou/gopsutil v2.20.5+incompatible h1:tYH07UPoQt0OCQdgWWMgYHy3/a9bcxNpBIysykNIP7I= -github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shirou/gopsutil v3.21.3+incompatible h1:uenXGGa8ESCQq+dbgtl916dmg6PSAz2cXov0uORQ9v8= +github.com/shirou/gopsutil v3.21.3+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/skycoin/dmsg v0.0.0-20201216183836-dae8a7acfc14 h1:ettvdRq5O1+bx1wIZPS9w+BnjzTxhZeNItDgwYI8KHs= -github.com/skycoin/dmsg v0.0.0-20201216183836-dae8a7acfc14/go.mod h1:aP/e1DEQQ16i5AzHy2e+2EFYT3ZN/sIyWRY0js56yY8= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/skycoin/dmsg v0.0.0-20210329160412-4e25fc9ad26c h1:/bAgBF+By+6qexWCFpvnrNVq3hAPkkEtCpqVej4p+CE= +github.com/skycoin/dmsg v0.0.0-20210329160412-4e25fc9ad26c/go.mod h1:tR/47K4BLJ2MT6eyE2BCxcXHLUhfnWiDhgE1OQmtA70= github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6 h1:1Nc5EBY6pjfw1kwW0duwyG+7WliWz5u9kgk1h5MnLuA= github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:UXghlricA7J3aRD/k7p/zBObQfmBawwCxIVPVjz2Q3o= github.com/skycoin/skycoin v0.26.0/go.mod h1:78nHjQzd8KG0jJJVL/j0xMmrihXi70ti63fh8vXScJw= @@ -216,22 +304,23 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= @@ -239,15 +328,24 @@ github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161 h1:89CEmDvlq/F7S github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161/go.mod h1:wM7WEvslTq+iOEAMDLSzhVuOt5BRZ05WirO+b09GHQU= github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b h1:fj5tQ8acgNUr6O8LEplsxDhUIe2573iLkJc+PqnzZTI= github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b/go.mod h1:5XA7W9S6mni3h5uvOC75dA3m9CCCaS83lltmc0ukdi4= -github.com/tjfoc/gmsm v1.3.2 h1:7JVkAn5bvUJ7HtU08iW6UiD+UTmJTIToHCfeFzkcCxM= -github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w= +github.com/tjfoc/gmsm v1.4.0 h1:8nbaiZG+iVdh+fXVw0DZoZZa7a4TGm3Qab+xdrdzj8s= +github.com/tjfoc/gmsm v1.4.0/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE= +github.com/tklauser/go-sysconf v0.3.5 h1:uu3Xl4nkLzQfXNsWn15rPc/HQCJKObbt1dKJeWp3vU4= +github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= +github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= +github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/toqueteos/webbrowser v1.2.0 h1:tVP/gpK69Fx+qMJKsLE7TD8LuGWPnEV71wBN9rrstGQ= github.com/toqueteos/webbrowser v1.2.0/go.mod h1:XWoZq4cyp9WeUeak7w7LXRUQf1F1ATJMir8RTqb4ayM= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ulikunitz/xz v0.5.6 h1:jGHAfXawEGZQ3blwU5wnWKQJvAraT7Ftq9EXjnXYgt8= +github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= +github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +github.com/ulikunitz/xz v0.5.7 h1:YvTNdFzX6+W5m9msiYg/zpkSURPPtOlzbqYjrFn7Yt4= +github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/valyala/fastrand v1.0.0 h1:LUKT9aKer2dVQNUi3waewTbKV+7H17kvWFNKs2ObdkI= github.com/valyala/fastrand v1.0.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ= github.com/valyala/histogram v1.1.2 h1:vOk5VrGjMBIoPR5k6wA8vBaC8toeJ8XO0yfRjFEc1h8= @@ -258,117 +356,202 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xtaci/kcp-go v5.4.20+incompatible h1:TN1uey3Raw0sTz0Fg8GkfM0uH3YwzhnZWQ1bABv5xAg= github.com/xtaci/kcp-go v5.4.20+incompatible/go.mod h1:bN6vIwHQbfHaHtFpEssmWsN45a+AZwO7eyRCmEIbtvE= +github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37 h1:EWU6Pktpas0n8lLQwDsRyZfmkPeRbdgPtW609es+/9E= github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37/go.mod h1:HpMP7DB2CyokmAh4lp0EQnnWhmycP/TvwBGzvuie+H0= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/arch v0.0.0-20190909030613-46d78d1859ac/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9 h1:sYNJzB4J8toYPQTM6pAkcmBRgw9SnQKP9oXCHfgy604= -golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc h1:+q90ECDSAQirdykUN6sPEiBXBsp8Csjcca8Oy7bgLTA= +golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191003171128-d98b1b443823/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210420210106-798c2154c571 h1:Q6Bg8xzKzpFPU4Oi1sBnBTHBwlMsLeEXpu4hYBY8rAg= +golang.org/x/net v0.0.0-20210420210106-798c2154c571/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs= -golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf h1:MZ2shdL+ZM/XzY3ZGOnh4Nlpnxz5GSOhOmtHo3iPU6M= -golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988 h1:EjgCl+fVlIaPJSori0ikSz3uV0DOHKWOJFpv1sAAhBM= +golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210406210042-72f3dc4e9b72 h1:VqE9gduFZ4dbR7XoL77lHFp0/DyDUBKSXK7CMFkVcV0= +golang.org/x/term v0.0.0-20210406210042-72f3dc4e9b72/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200425043458-8463f397d07c h1:iHhCR0b26amDCiiO+kBguKZom9aMF+NrFxh9zeKR/XU= -golang.org/x/tools v0.0.0-20200425043458-8463f397d07c/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.zx2c4.com/wireguard v0.0.20200320 h1:1vE6zVeO7fix9cJX1Z9ZQ+ikPIIx7vIyU0o0tLDD88g= golang.zx2c4.com/wireguard v0.0.20200320/go.mod h1:lDian4Sw4poJ04SgHh35nzMVwGSYlPumkdnHcucAQoY= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -nhooyr.io/websocket v1.8.2 h1:LwdzfyyOZKtVFoXay6A39Acu03KmidSZ3YUUvPa13PA= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= nhooyr.io/websocket v1.8.2/go.mod h1:LiqdCg1Cu7TPWxEvPjPa0TGYxCsy4pHNTN9gGluwBpQ= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= +nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= +nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/internal/vpn/server.go b/internal/vpn/server.go index 11f356826e..1058560607 100644 --- a/internal/vpn/server.go +++ b/internal/vpn/server.go @@ -7,9 +7,9 @@ import ( "net" "sync" - "github.com/skycoin/skywire/pkg/util/netutil" - "github.com/sirupsen/logrus" + + "github.com/skycoin/skywire/pkg/util/netutil" ) // Server is a VPN server. diff --git a/pkg/app/appserver/mock_proc_manager.go b/pkg/app/appserver/mock_proc_manager.go index 18464af453..b4c6cc568d 100644 --- a/pkg/app/appserver/mock_proc_manager.go +++ b/pkg/app/appserver/mock_proc_manager.go @@ -2,9 +2,13 @@ package appserver -import appcommon "github.com/skycoin/skywire/pkg/app/appcommon" -import mock "github.com/stretchr/testify/mock" -import net "net" +import ( + net "net" + + mock "github.com/stretchr/testify/mock" + + appcommon "github.com/skycoin/skywire/pkg/app/appcommon" +) // MockProcManager is an autogenerated mock type for the ProcManager type type MockProcManager struct { diff --git a/pkg/app/appserver/mock_rpc_ingress_client.go b/pkg/app/appserver/mock_rpc_ingress_client.go index 7df2b996d6..4f989a2db6 100644 --- a/pkg/app/appserver/mock_rpc_ingress_client.go +++ b/pkg/app/appserver/mock_rpc_ingress_client.go @@ -2,10 +2,14 @@ package appserver -import appnet "github.com/skycoin/skywire/pkg/app/appnet" -import mock "github.com/stretchr/testify/mock" -import routing "github.com/skycoin/skywire/pkg/routing" -import time "time" +import ( + time "time" + + mock "github.com/stretchr/testify/mock" + + appnet "github.com/skycoin/skywire/pkg/app/appnet" + routing "github.com/skycoin/skywire/pkg/routing" +) // MockRPCIngressClient is an autogenerated mock type for the RPCIngressClient type type MockRPCIngressClient struct { diff --git a/pkg/visor/api.go b/pkg/visor/api.go index 42fdc0e034..cbe28e8cf2 100644 --- a/pkg/visor/api.go +++ b/pkg/visor/api.go @@ -11,8 +11,6 @@ import ( "sync" "time" - "github.com/skycoin/skywire/pkg/util/netutil" - "github.com/google/uuid" "github.com/skycoin/dmsg/buildinfo" "github.com/skycoin/dmsg/cipher" @@ -22,6 +20,7 @@ import ( "github.com/skycoin/skywire/pkg/routing" "github.com/skycoin/skywire/pkg/skyenv" "github.com/skycoin/skywire/pkg/transport" + "github.com/skycoin/skywire/pkg/util/netutil" "github.com/skycoin/skywire/pkg/util/updater" "github.com/skycoin/skywire/pkg/visor/dmsgtracker" ) diff --git a/pkg/visor/hypervisorconfig/config.go b/pkg/visor/hypervisorconfig/config.go index 637e815a89..1b165cc331 100644 --- a/pkg/visor/hypervisorconfig/config.go +++ b/pkg/visor/hypervisorconfig/config.go @@ -3,13 +3,14 @@ package hypervisorconfig import ( "encoding/hex" "encoding/json" - "io/fs" "log" "net/http" "os" "path/filepath" "time" + "io/fs" + "github.com/skycoin/dmsg/cipher" "github.com/skycoin/skywire/pkg/skyenv" diff --git a/vendor/github.com/AudriusButkevicius/pfilter/filter.go b/vendor/github.com/AudriusButkevicius/pfilter/filter.go index a947f67d7a..7ff501f4a1 100644 --- a/vendor/github.com/AudriusButkevicius/pfilter/filter.go +++ b/vendor/github.com/AudriusButkevicius/pfilter/filter.go @@ -93,7 +93,6 @@ func (d *PacketFilter) Start() { func (d *PacketFilter) loop() { var buf []byte -next: for { buf = bufPool.Get().([]byte) n, addr, err := d.conn.ReadFrom(buf) @@ -104,33 +103,39 @@ next: buf: buf[:n], } - d.mut.Lock() - conns := d.conns - d.mut.Unlock() - if err != nil { - for _, conn := range conns { + d.mut.Lock() + for _, conn := range d.conns { select { case conn.recvBuffer <- pkt: default: atomic.AddUint64(&d.overflow, 1) } } + d.mut.Unlock() return } - for _, conn := range conns { - if conn.filter == nil || conn.filter.ClaimIncoming(pkt.buf, pkt.addr) { - select { - case conn.recvBuffer <- pkt: - default: - bufPool.Put(pkt.buf[:maxPacketSize]) - atomic.AddUint64(&d.overflow, 1) - } - goto next - } + d.mut.Lock() + sent := d.sendPacketLocked(pkt) + d.mut.Unlock() + if !sent { + atomic.AddUint64(&d.dropped, 1) } bufPool.Put(pkt.buf[:maxPacketSize]) - atomic.AddUint64(&d.dropped, 1) } } + +func (d *PacketFilter) sendPacketLocked(pkt packet) bool { + for _, conn := range d.conns { + if conn.filter == nil || conn.filter.ClaimIncoming(pkt.buf, pkt.addr) { + select { + case conn.recvBuffer <- pkt: + default: + atomic.AddUint64(&d.overflow, 1) + } + return true + } + } + return false +} diff --git a/vendor/github.com/StackExchange/wmi/wmi.go b/vendor/github.com/StackExchange/wmi/wmi.go index eab18cbfee..652ec74616 100644 --- a/vendor/github.com/StackExchange/wmi/wmi.go +++ b/vendor/github.com/StackExchange/wmi/wmi.go @@ -68,7 +68,8 @@ func QueryNamespace(query string, dst interface{}, namespace string) error { // // By default, the local machine and default namespace are used. These can be // changed using connectServerArgs. See -// http://msdn.microsoft.com/en-us/library/aa393720.aspx for details. +// https://docs.microsoft.com/en-us/windows/desktop/WmiSdk/swbemlocator-connectserver +// for details. // // Query is a wrapper around DefaultClient.Query. func Query(query string, dst interface{}, connectServerArgs ...interface{}) error { @@ -78,6 +79,14 @@ func Query(query string, dst interface{}, connectServerArgs ...interface{}) erro return DefaultClient.SWbemServicesClient.Query(query, dst, connectServerArgs...) } +// CallMethod calls a method named methodName on an instance of the class named +// className, with the given params. +// +// CallMethod is a wrapper around DefaultClient.CallMethod. +func CallMethod(connectServerArgs []interface{}, className, methodName string, params []interface{}) (int32, error) { + return DefaultClient.CallMethod(connectServerArgs, className, methodName, params) +} + // A Client is an WMI query client. // // Its zero value (DefaultClient) is a usable client. @@ -109,9 +118,103 @@ type Client struct { SWbemServicesClient *SWbemServices } -// DefaultClient is the default Client and is used by Query, QueryNamespace +// DefaultClient is the default Client and is used by Query, QueryNamespace, and CallMethod. var DefaultClient = &Client{} +// coinitService coinitializes WMI service. If no error is returned, a cleanup function +// is returned which must be executed (usually deferred) to clean up allocated resources. +func (c *Client) coinitService(connectServerArgs ...interface{}) (*ole.IDispatch, func(), error) { + var unknown *ole.IUnknown + var wmi *ole.IDispatch + var serviceRaw *ole.VARIANT + + // be sure teardown happens in the reverse + // order from that which they were created + deferFn := func() { + if serviceRaw != nil { + serviceRaw.Clear() + } + if wmi != nil { + wmi.Release() + } + if unknown != nil { + unknown.Release() + } + ole.CoUninitialize() + } + + // if we error'ed here, clean up immediately + var err error + defer func() { + if err != nil { + deferFn() + } + }() + + err = ole.CoInitializeEx(0, ole.COINIT_MULTITHREADED) + if err != nil { + oleCode := err.(*ole.OleError).Code() + if oleCode != ole.S_OK && oleCode != S_FALSE { + return nil, nil, err + } + } + + unknown, err = oleutil.CreateObject("WbemScripting.SWbemLocator") + if err != nil { + return nil, nil, err + } else if unknown == nil { + return nil, nil, ErrNilCreateObject + } + + wmi, err = unknown.QueryInterface(ole.IID_IDispatch) + if err != nil { + return nil, nil, err + } + + // service is a SWbemServices + serviceRaw, err = oleutil.CallMethod(wmi, "ConnectServer", connectServerArgs...) + if err != nil { + return nil, nil, err + } + + return serviceRaw.ToIDispatch(), deferFn, nil +} + +// CallMethod calls a WMI method named methodName on an instance +// of the class named className. It passes in the arguments given +// in params. Use connectServerArgs to customize the machine and +// namespace; by default, the local machine and default namespace +// are used. See +// https://docs.microsoft.com/en-us/windows/desktop/WmiSdk/swbemlocator-connectserver +// for details. +func (c *Client) CallMethod(connectServerArgs []interface{}, className, methodName string, params []interface{}) (int32, error) { + service, cleanup, err := c.coinitService(connectServerArgs...) + if err != nil { + return 0, fmt.Errorf("coinit: %v", err) + } + defer cleanup() + + // Get class + classRaw, err := oleutil.CallMethod(service, "Get", className) + if err != nil { + return 0, fmt.Errorf("CallMethod Get class %s: %v", className, err) + } + class := classRaw.ToIDispatch() + defer classRaw.Clear() + + // Run method + resultRaw, err := oleutil.CallMethod(class, methodName, params...) + if err != nil { + return 0, fmt.Errorf("CallMethod %s.%s: %v", className, methodName, err) + } + resultInt, ok := resultRaw.Value().(int32) + if !ok { + return 0, fmt.Errorf("return value was not an int32: %v (%T)", resultRaw, resultRaw) + } + + return resultInt, nil +} + // Query runs the WQL query and appends the values to dst. // // dst must have type *[]S or *[]*S, for some struct type S. Fields selected in @@ -121,7 +224,8 @@ var DefaultClient = &Client{} // // By default, the local machine and default namespace are used. These can be // changed using connectServerArgs. See -// http://msdn.microsoft.com/en-us/library/aa393720.aspx for details. +// https://docs.microsoft.com/en-us/windows/desktop/WmiSdk/swbemlocator-connectserver +// for details. func (c *Client) Query(query string, dst interface{}, connectServerArgs ...interface{}) error { dv := reflect.ValueOf(dst) if dv.Kind() != reflect.Ptr || dv.IsNil() { @@ -138,36 +242,11 @@ func (c *Client) Query(query string, dst interface{}, connectServerArgs ...inter runtime.LockOSThread() defer runtime.UnlockOSThread() - err := ole.CoInitializeEx(0, ole.COINIT_MULTITHREADED) - if err != nil { - oleCode := err.(*ole.OleError).Code() - if oleCode != ole.S_OK && oleCode != S_FALSE { - return err - } - } - defer ole.CoUninitialize() - - unknown, err := oleutil.CreateObject("WbemScripting.SWbemLocator") + service, cleanup, err := c.coinitService(connectServerArgs...) if err != nil { return err - } else if unknown == nil { - return ErrNilCreateObject } - defer unknown.Release() - - wmi, err := unknown.QueryInterface(ole.IID_IDispatch) - if err != nil { - return err - } - defer wmi.Release() - - // service is a SWbemServices - serviceRaw, err := oleutil.CallMethod(wmi, "ConnectServer", connectServerArgs...) - if err != nil { - return err - } - service := serviceRaw.ToIDispatch() - defer serviceRaw.Clear() + defer cleanup() // result is a SWBemObjectSet resultRaw, err := oleutil.CallMethod(service, "ExecQuery", query) @@ -478,7 +557,10 @@ func oleInt64(item *ole.IDispatch, prop string) (int64, error) { // CreateQuery returns a WQL query string that queries all columns of src. where // is an optional string that is appended to the query, to be used with WHERE // clauses. In such a case, the "WHERE" string should appear at the beginning. -func CreateQuery(src interface{}, where string) string { +// The wmi class is obtained by the name of the type. You can pass a optional +// class throught the variadic class parameter which is useful for anonymous +// structs. +func CreateQuery(src interface{}, where string, class ...string) string { var b bytes.Buffer b.WriteString("SELECT ") s := reflect.Indirect(reflect.ValueOf(src)) @@ -495,7 +577,11 @@ func CreateQuery(src interface{}, where string) string { } b.WriteString(strings.Join(fields, ", ")) b.WriteString(" FROM ") - b.WriteString(t.Name()) + if len(class) > 0{ + b.WriteString(class[0]) + } else { + b.WriteString(t.Name()) + } b.WriteString(" " + where) return b.String() } diff --git a/vendor/github.com/VictoriaMetrics/metrics/README.md b/vendor/github.com/VictoriaMetrics/metrics/README.md index 4f1283abb4..5eef96a661 100644 --- a/vendor/github.com/VictoriaMetrics/metrics/README.md +++ b/vendor/github.com/VictoriaMetrics/metrics/README.md @@ -86,19 +86,19 @@ Because the `github.com/prometheus/client_golang` is too complex and is hard to #### Why the `metrics.WritePrometheus` doesn't expose documentation for each metric? Because this documentation is ignored by Prometheus. The documentation is for users. -Just add comments in the source code or in other suitable place explaining each metric -exposed from your application. +Just give meaningful names to the exported metrics or add comments in the source code +or in other suitable place explaining each metric exposed from your application. #### How to implement [CounterVec](https://godoc.org/github.com/prometheus/client_golang/prometheus#CounterVec) in `metrics`? Just use [GetOrCreateCounter](http://godoc.org/github.com/VictoriaMetrics/metrics#GetOrCreateCounter) -instead of `CounterVec.With`. See [this example](https://godoc.org/github.com/VictoriaMetrics/metrics#example-Counter--Vec) for details. +instead of `CounterVec.With`. See [this example](https://pkg.go.dev/github.com/VictoriaMetrics/metrics#example-Counter-Vec) for details. #### Why [Histogram](http://godoc.org/github.com/VictoriaMetrics/metrics#Histogram) buckets contain `vmrange` labels instead of `le` labels like in Prometheus histograms? -Buckets with `vmrange` labels occupy less disk space comparing to Promethes-style buckets with `le` labels, +Buckets with `vmrange` labels occupy less disk space compared to Promethes-style buckets with `le` labels, because `vmrange` buckets don't include counters for the previous ranges. [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics) provides `prometheus_buckets` function, which converts `vmrange` buckets to Prometheus-style buckets with `le` labels. This is useful for building heatmaps in Grafana. Additionally, its' `histogram_quantile` function transparently handles histogram buckets with `vmrange` labels. diff --git a/vendor/github.com/VictoriaMetrics/metrics/histogram.go b/vendor/github.com/VictoriaMetrics/metrics/histogram.go index c1879996a1..b0e8d575fb 100644 --- a/vendor/github.com/VictoriaMetrics/metrics/histogram.go +++ b/vendor/github.com/VictoriaMetrics/metrics/histogram.go @@ -9,14 +9,15 @@ import ( ) const ( - e10Min = -9 - e10Max = 18 - decimalMultiplier = 2 - bucketSize = 9 * decimalMultiplier - bucketsCount = e10Max - e10Min - decimalPrecision = 1e-12 + e10Min = -9 + e10Max = 18 + bucketsPerDecimal = 18 + decimalBucketsCount = e10Max - e10Min + bucketsCount = decimalBucketsCount * bucketsPerDecimal ) +var bucketMultiplier = math.Pow(10, 1.0/bucketsPerDecimal) + // Histogram is a histogram for non-negative values with automatically created buckets. // // See https://medium.com/@valyala/improving-histogram-usability-for-prometheus-and-grafana-bc7e5df0e350 @@ -48,9 +49,8 @@ type Histogram struct { // Mu gurantees synchronous update for all the counters and sum. mu sync.Mutex - buckets [bucketsCount]*histogramBucket + decimalBuckets [decimalBucketsCount]*[bucketsPerDecimal]uint64 - zeros uint64 lower uint64 upper uint64 @@ -60,22 +60,18 @@ type Histogram struct { // Reset resets the given histogram. func (h *Histogram) Reset() { h.mu.Lock() - h.resetLocked() - h.mu.Unlock() -} - -func (h *Histogram) resetLocked() { - for _, hb := range h.buckets[:] { - if hb == nil { + for _, db := range h.decimalBuckets[:] { + if db == nil { continue } - for offset := range hb.counts[:] { - hb.counts[offset] = 0 + for i := range db[:] { + db[i] = 0 } } - h.zeros = 0 h.lower = 0 h.upper = 0 + h.sum = 0 + h.mu.Unlock() } // Update updates h with v. @@ -86,31 +82,31 @@ func (h *Histogram) Update(v float64) { // Skip NaNs and negative values. return } - bucketIdx, offset := getBucketIdxAndOffset(v) + bucketIdx := (math.Log10(v) - e10Min) * bucketsPerDecimal h.mu.Lock() - h.updateLocked(v, bucketIdx, offset) - h.mu.Unlock() -} - -func (h *Histogram) updateLocked(v float64, bucketIdx int, offset uint) { h.sum += v if bucketIdx < 0 { - // Special cases for zero, too small or too big value - if offset == 0 { - h.zeros++ - } else if offset == 1 { - h.lower++ - } else { - h.upper++ + h.lower++ + } else if bucketIdx >= bucketsCount { + h.upper++ + } else { + idx := uint(bucketIdx) + if bucketIdx == float64(idx) && idx > 0 { + // Edge case for 10^n values, which must go to the lower bucket + // according to Prometheus logic for `le`-based histograms. + idx-- } - return - } - hb := h.buckets[bucketIdx] - if hb == nil { - hb = &histogramBucket{} - h.buckets[bucketIdx] = hb + decimalBucketIdx := idx / bucketsPerDecimal + offset := idx % bucketsPerDecimal + db := h.decimalBuckets[decimalBucketIdx] + if db == nil { + var b [bucketsPerDecimal]uint64 + db = &b + h.decimalBuckets[decimalBucketIdx] = db + } + db[offset]++ } - hb.counts[offset]++ + h.mu.Unlock() } // VisitNonZeroBuckets calls f for all buckets with non-zero counters. @@ -121,38 +117,25 @@ func (h *Histogram) updateLocked(v float64, bucketIdx int, offset uint) { // with `le` (less or equal) labels. func (h *Histogram) VisitNonZeroBuckets(f func(vmrange string, count uint64)) { h.mu.Lock() - h.visitNonZeroBucketsLocked(f) - h.mu.Unlock() -} - -func (h *Histogram) visitNonZeroBucketsLocked(f func(vmrange string, count uint64)) { - if h.zeros > 0 { - vmrange := getVMRange(-1, 0) - f(vmrange, h.zeros) - } if h.lower > 0 { - vmrange := getVMRange(-1, 1) - f(vmrange, h.lower) + f(lowerBucketRange, h.lower) } - for bucketIdx, hb := range h.buckets[:] { - if hb == nil { + for decimalBucketIdx, db := range h.decimalBuckets[:] { + if db == nil { continue } - for offset, count := range hb.counts[:] { + for offset, count := range db[:] { if count > 0 { - vmrange := getVMRange(bucketIdx, uint(offset)) + bucketIdx := decimalBucketIdx*bucketsPerDecimal + offset + vmrange := getVMRange(bucketIdx) f(vmrange, count) } } } if h.upper > 0 { - vmrange := getVMRange(-1, 2) - f(vmrange, h.upper) + f(upperBucketRange, h.upper) } -} - -type histogramBucket struct { - counts [bucketSize]uint64 + h.mu.Unlock() } // NewHistogram creates and returns new histogram with the given name. @@ -193,43 +176,27 @@ func (h *Histogram) UpdateDuration(startTime time.Time) { h.Update(d) } -func getVMRange(bucketIdx int, offset uint) string { +func getVMRange(bucketIdx int) string { bucketRangesOnce.Do(initBucketRanges) - if bucketIdx < 0 { - if offset > 2 { - panic(fmt.Errorf("BUG: offset must be in range [0...2] for negative bucketIdx; got %d", offset)) - } - return bucketRanges[offset] - } - idx := 3 + uint(bucketIdx)*bucketSize + offset - return bucketRanges[idx] + return bucketRanges[bucketIdx] } func initBucketRanges() { - bucketRanges[0] = "0...0" - bucketRanges[1] = fmt.Sprintf("0...%.1fe%d", 1.0, e10Min) - bucketRanges[2] = fmt.Sprintf("%.1fe%d...+Inf", 1.0, e10Max) - idx := 3 - start := fmt.Sprintf("%.1fe%d", 1.0, e10Min) - for bucketIdx := 0; bucketIdx < bucketsCount; bucketIdx++ { - for offset := 0; offset < bucketSize; offset++ { - e10 := e10Min + bucketIdx - m := 1 + float64(offset+1)/decimalMultiplier - if math.Abs(m-10) < decimalPrecision { - m = 1 - e10++ - } - end := fmt.Sprintf("%.1fe%d", m, e10) - bucketRanges[idx] = start + "..." + end - idx++ - start = end - } + v := math.Pow10(e10Min) + start := fmt.Sprintf("%.3e", v) + for i := 0; i < bucketsCount; i++ { + v *= bucketMultiplier + end := fmt.Sprintf("%.3e", v) + bucketRanges[i] = start + "..." + end + start = end } } var ( - // 3 additional buckets for zero, lower and upper. - bucketRanges [3 + bucketsCount*bucketSize]string + lowerBucketRange = fmt.Sprintf("0...%.3e", math.Pow10(e10Min)) + upperBucketRange = fmt.Sprintf("%.3e...+Inf", math.Pow10(e10Max)) + + bucketRanges [bucketsCount]string bucketRangesOnce sync.Once ) @@ -238,21 +205,21 @@ func (h *Histogram) marshalTo(prefix string, w io.Writer) { h.VisitNonZeroBuckets(func(vmrange string, count uint64) { tag := fmt.Sprintf("vmrange=%q", vmrange) metricName := addTag(prefix, tag) - name, filters := splitMetricName(metricName) - fmt.Fprintf(w, "%s_bucket%s %d\n", name, filters, count) + name, labels := splitMetricName(metricName) + fmt.Fprintf(w, "%s_bucket%s %d\n", name, labels, count) countTotal += count }) if countTotal == 0 { return } - name, filters := splitMetricName(prefix) + name, labels := splitMetricName(prefix) sum := h.getSum() if float64(int64(sum)) == sum { - fmt.Fprintf(w, "%s_sum%s %d\n", name, filters, int64(sum)) + fmt.Fprintf(w, "%s_sum%s %d\n", name, labels, int64(sum)) } else { - fmt.Fprintf(w, "%s_sum%s %g\n", name, filters, sum) + fmt.Fprintf(w, "%s_sum%s %g\n", name, labels, sum) } - fmt.Fprintf(w, "%s_count%s %d\n", name, filters, countTotal) + fmt.Fprintf(w, "%s_count%s %d\n", name, labels, countTotal) } func (h *Histogram) getSum() float64 { @@ -261,46 +228,3 @@ func (h *Histogram) getSum() float64 { h.mu.Unlock() return sum } - -func getBucketIdxAndOffset(v float64) (int, uint) { - if v < 0 { - panic(fmt.Errorf("BUG: v must be positive; got %g", v)) - } - if v == 0 { - return -1, 0 - } - if math.IsInf(v, 1) { - return -1, 2 - } - e10 := int(math.Floor(math.Log10(v))) - bucketIdx := e10 - e10Min - if bucketIdx < 0 { - return -1, 1 - } - if bucketIdx >= bucketsCount { - if bucketIdx == bucketsCount && math.Abs(math.Pow10(e10)-v) < decimalPrecision { - // Adjust m to be on par with Prometheus 'le' buckets (aka 'less or equal') - return bucketsCount - 1, bucketSize - 1 - } - return -1, 2 - } - m := ((v / math.Pow10(e10)) - 1) * decimalMultiplier - offset := int(m) - if offset < 0 { - offset = 0 - } else if offset >= bucketSize { - offset = bucketSize - 1 - } - if math.Abs(float64(offset)-m) < decimalPrecision { - // Adjust offset to be on par with Prometheus 'le' buckets (aka 'less or equal') - offset-- - if offset < 0 { - bucketIdx-- - offset = bucketSize - 1 - if bucketIdx < 0 { - return -1, 1 - } - } - } - return bucketIdx, uint(offset) -} diff --git a/vendor/github.com/VictoriaMetrics/metrics/metrics.go b/vendor/github.com/VictoriaMetrics/metrics/metrics.go index 962ceef5b2..c28c036132 100644 --- a/vendor/github.com/VictoriaMetrics/metrics/metrics.go +++ b/vendor/github.com/VictoriaMetrics/metrics/metrics.go @@ -47,8 +47,45 @@ func WritePrometheus(w io.Writer, exposeProcessMetrics bool) { // WriteProcessMetrics writes additional process metrics in Prometheus format to w. // -// Various `go_*` and `process_*` metrics are exposed for the currently -// running process. +// The following `go_*` and `process_*` metrics are exposed for the currently +// running process. Below is a short description for the exposed `process_*` metrics: +// +// - process_cpu_seconds_system_total - CPU time spent in syscalls +// - process_cpu_seconds_user_total - CPU time spent in userspace +// - process_cpu_seconds_total - CPU time spent by the process +// - process_major_pagefaults_total - page faults resulted in disk IO +// - process_minor_pagefaults_total - page faults resolved without disk IO +// - process_resident_memory_bytes - recently accessed memory (aka RSS or resident memory) +// - process_resident_memory_peak_bytes - the maximum RSS memory usage +// - process_resident_memory_anon_bytes - RSS for memory-mapped files +// - process_resident_memory_file_bytes - RSS for memory allocated by the process +// - process_resident_memory_shared_bytes - RSS for memory shared between multiple processes +// - process_virtual_memory_bytes - virtual memory usage +// - process_virtual_memory_peak_bytes - the maximum virtual memory usage +// - process_num_threads - the number of threads +// - process_start_time_seconds - process start time as unix timestamp +// +// - process_io_read_bytes_total - the number of bytes read via syscalls +// - process_io_written_bytes_total - the number of bytes written via syscalls +// - process_io_read_syscalls_total - the number of read syscalls +// - process_io_write_syscalls_total - the number of write syscalls +// - process_io_storage_read_bytes_total - the number of bytes actually read from disk +// - process_io_storage_written_bytes_total - the number of bytes actually written to disk +// +// - go_memstats_alloc_bytes - memory usage for Go objects in the heap +// - go_memstats_alloc_bytes_total - the cumulative counter for total size of allocated Go objects +// - go_memstats_frees_total - the cumulative counter for number of freed Go objects +// - go_memstats_gc_cpu_fraction - the fraction of CPU spent in Go garbage collector +// - go_memstats_gc_sys_bytes - the size of Go garbage collector metadata +// - go_memstats_heap_alloc_bytes - the same as go_memstats_alloc_bytes +// - go_memstats_heap_idle_bytes - idle memory ready for new Go object allocations +// - go_memstats_heap_objects - the number of Go objects in the heap +// - go_memstats_heap_sys_bytes - memory requested for Go objects from the OS +// - go_memstats_mallocs_total - the number of allocations for Go objects +// - go_memstats_next_gc_bytes - the target heap size when the next garbage collection should start +// - go_memstats_stack_inuse_bytes - memory used for goroutine stacks +// - go_memstats_stack_sys_bytes - memory requested fromthe OS for goroutine stacks +// - go_memstats_sys_bytes - memory requested by Go runtime from the OS // // The WriteProcessMetrics func is usually called in combination with writing Set metrics // inside "/metrics" handler: @@ -58,11 +95,17 @@ func WritePrometheus(w io.Writer, exposeProcessMetrics bool) { // metrics.WriteProcessMetrics(w) // }) // +// See also WrteFDMetrics. func WriteProcessMetrics(w io.Writer) { writeGoMetrics(w) writeProcessMetrics(w) } +// WriteFDMetrics writes `process_max_fds` and `process_open_fds` metrics to w. +func WriteFDMetrics(w io.Writer) { + writeFDMetrics(w) +} + // UnregisterMetric removes metric with the given name from default set. func UnregisterMetric(name string) bool { return defaultSet.UnregisterMetric(name) diff --git a/vendor/github.com/VictoriaMetrics/metrics/process_metrics_linux.go b/vendor/github.com/VictoriaMetrics/metrics/process_metrics_linux.go index 444299278a..12b5de8e3d 100644 --- a/vendor/github.com/VictoriaMetrics/metrics/process_metrics_linux.go +++ b/vendor/github.com/VictoriaMetrics/metrics/process_metrics_linux.go @@ -6,11 +6,12 @@ import ( "io" "io/ioutil" "log" + "os" + "strconv" + "strings" "time" ) -const statFilepath = "/proc/self/stat" - // See https://github.com/prometheus/procfs/blob/a4ac0826abceb44c40fc71daed2b301db498b93e/proc_stat.go#L40 . const userHZ = 100 @@ -41,6 +42,7 @@ type procStat struct { } func writeProcessMetrics(w io.Writer) { + statFilepath := "/proc/self/stat" data, err := ioutil.ReadFile(statFilepath) if err != nil { log.Printf("ERROR: cannot open %s: %s", statFilepath, err) @@ -65,7 +67,8 @@ func writeProcessMetrics(w io.Writer) { } // It is expensive obtaining `process_open_fds` when big number of file descriptors is opened, - // don't do it here. + // so don't do it here. + // See writeFDMetrics instead. utime := float64(p.Utime) / userHZ stime := float64(p.Stime) / userHZ @@ -78,6 +81,185 @@ func writeProcessMetrics(w io.Writer) { fmt.Fprintf(w, "process_resident_memory_bytes %d\n", p.Rss*4096) fmt.Fprintf(w, "process_start_time_seconds %d\n", startTimeSeconds) fmt.Fprintf(w, "process_virtual_memory_bytes %d\n", p.Vsize) + writeProcessMemMetrics(w) + writeIOMetrics(w) +} + +func writeIOMetrics(w io.Writer) { + ioFilepath := "/proc/self/io" + data, err := ioutil.ReadFile(ioFilepath) + if err != nil { + log.Printf("ERROR: cannot open %q: %s", ioFilepath, err) + } + getInt := func(s string) int64 { + n := strings.IndexByte(s, ' ') + if n < 0 { + log.Printf("ERROR: cannot find whitespace in %q at %q", s, ioFilepath) + return 0 + } + v, err := strconv.ParseInt(s[n+1:], 10, 64) + if err != nil { + log.Printf("ERROR: cannot parse %q at %q: %s", s, ioFilepath, err) + return 0 + } + return v + } + var rchar, wchar, syscr, syscw, readBytes, writeBytes int64 + lines := strings.Split(string(data), "\n") + for _, s := range lines { + s = strings.TrimSpace(s) + switch { + case strings.HasPrefix(s, "rchar: "): + rchar = getInt(s) + case strings.HasPrefix(s, "wchar: "): + wchar = getInt(s) + case strings.HasPrefix(s, "syscr: "): + syscr = getInt(s) + case strings.HasPrefix(s, "syscw: "): + syscw = getInt(s) + case strings.HasPrefix(s, "read_bytes: "): + readBytes = getInt(s) + case strings.HasPrefix(s, "write_bytes: "): + writeBytes = getInt(s) + } + } + fmt.Fprintf(w, "process_io_read_bytes_total %d\n", rchar) + fmt.Fprintf(w, "process_io_written_bytes_total %d\n", wchar) + fmt.Fprintf(w, "process_io_read_syscalls_total %d\n", syscr) + fmt.Fprintf(w, "process_io_write_syscalls_total %d\n", syscw) + fmt.Fprintf(w, "process_io_storage_read_bytes_total %d\n", readBytes) + fmt.Fprintf(w, "process_io_storage_written_bytes_total %d\n", writeBytes) } var startTimeSeconds = time.Now().Unix() + +// writeFDMetrics writes process_max_fds and process_open_fds metrics to w. +func writeFDMetrics(w io.Writer) { + totalOpenFDs, err := getOpenFDsCount("/proc/self/fd") + if err != nil { + log.Printf("ERROR: cannot determine open file descriptors count: %s", err) + return + } + maxOpenFDs, err := getMaxFilesLimit("/proc/self/limits") + if err != nil { + log.Printf("ERROR: cannot determine the limit on open file descritors: %s", err) + return + } + fmt.Fprintf(w, "process_max_fds %d\n", maxOpenFDs) + fmt.Fprintf(w, "process_open_fds %d\n", totalOpenFDs) +} + +func getOpenFDsCount(path string) (uint64, error) { + f, err := os.Open(path) + if err != nil { + return 0, err + } + defer f.Close() + var totalOpenFDs uint64 + for { + names, err := f.Readdirnames(512) + if err == io.EOF { + break + } + if err != nil { + return 0, fmt.Errorf("unexpected error at Readdirnames: %s", err) + } + totalOpenFDs += uint64(len(names)) + } + return totalOpenFDs, nil +} + +func getMaxFilesLimit(path string) (uint64, error) { + data, err := ioutil.ReadFile(path) + if err != nil { + return 0, err + } + lines := strings.Split(string(data), "\n") + const prefix = "Max open files" + for _, s := range lines { + if !strings.HasPrefix(s, prefix) { + continue + } + text := strings.TrimSpace(s[len(prefix):]) + // Extract soft limit. + n := strings.IndexByte(text, ' ') + if n < 0 { + return 0, fmt.Errorf("cannot extract soft limit from %q", s) + } + text = text[:n] + if text == "unlimited" { + return 1<<64 - 1, nil + } + limit, err := strconv.ParseUint(text, 10, 64) + if err != nil { + return 0, fmt.Errorf("cannot parse soft limit from %q: %s", s, err) + } + return limit, nil + } + return 0, fmt.Errorf("cannot find max open files limit") +} + +// https://man7.org/linux/man-pages/man5/procfs.5.html +type memStats struct { + vmPeak uint64 + rssPeak uint64 + rssAnon uint64 + rssFile uint64 + rssShmem uint64 +} + +func writeProcessMemMetrics(w io.Writer) { + ms, err := getMemStats("/proc/self/status") + if err != nil { + log.Printf("ERROR: cannot determine memory status: %s", err) + return + } + fmt.Fprintf(w, "process_virtual_memory_peak_bytes %d\n", ms.vmPeak) + fmt.Fprintf(w, "process_resident_memory_peak_bytes %d\n", ms.rssPeak) + fmt.Fprintf(w, "process_resident_memory_anon_bytes %d\n", ms.rssAnon) + fmt.Fprintf(w, "process_resident_memory_file_bytes %d\n", ms.rssFile) + fmt.Fprintf(w, "process_resident_memory_shared_bytes %d\n", ms.rssShmem) + +} + +func getMemStats(path string) (*memStats, error) { + data, err := ioutil.ReadFile(path) + if err != nil { + return nil, err + } + var ms memStats + lines := strings.Split(string(data), "\n") + for _, s := range lines { + if !strings.HasPrefix(s, "Vm") && !strings.HasPrefix(s, "Rss") { + continue + } + // Extract key value. + line := strings.Fields(s) + if len(line) != 3 { + return nil, fmt.Errorf("unexpected number of fields found in %q; got %d; want %d", s, len(line), 3) + } + memStatName := line[0] + memStatValue := line[1] + value, err := strconv.ParseUint(memStatValue, 10, 64) + if err != nil { + return nil, fmt.Errorf("cannot parse number from %q: %w", s, err) + } + if line[2] != "kB" { + return nil, fmt.Errorf("expecting kB value in %q; got %q", s, line[2]) + } + value *= 1024 + switch memStatName { + case "VmPeak:": + ms.vmPeak = value + case "VmHWM:": + ms.rssPeak = value + case "RssAnon:": + ms.rssAnon = value + case "RssFile:": + ms.rssFile = value + case "RssShmem:": + ms.rssShmem = value + } + } + return &ms, nil +} diff --git a/vendor/github.com/VictoriaMetrics/metrics/process_metrics_other.go b/vendor/github.com/VictoriaMetrics/metrics/process_metrics_other.go index 6874de33ea..5e6ac935dc 100644 --- a/vendor/github.com/VictoriaMetrics/metrics/process_metrics_other.go +++ b/vendor/github.com/VictoriaMetrics/metrics/process_metrics_other.go @@ -9,3 +9,7 @@ import ( func writeProcessMetrics(w io.Writer) { // TODO: implement it } + +func writeFDMetrics(w io.Writer) { + // TODO: implement it. +} diff --git a/vendor/github.com/andybalholm/brotli/encode.go b/vendor/github.com/andybalholm/brotli/encode.go index 0dd3a3e1f4..c01322bf14 100644 --- a/vendor/github.com/andybalholm/brotli/encode.go +++ b/vendor/github.com/andybalholm/brotli/encode.go @@ -72,7 +72,8 @@ const ( ) type Writer struct { - dst io.Writer + dst io.Writer + options WriterOptions params encoderParams hasher_ hasherHandle diff --git a/vendor/github.com/andybalholm/brotli/go.mod b/vendor/github.com/andybalholm/brotli/go.mod index cb505fa05a..8e609842f3 100644 --- a/vendor/github.com/andybalholm/brotli/go.mod +++ b/vendor/github.com/andybalholm/brotli/go.mod @@ -1,5 +1,3 @@ module github.com/andybalholm/brotli go 1.12 - -require github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721 diff --git a/vendor/github.com/andybalholm/brotli/go.sum b/vendor/github.com/andybalholm/brotli/go.sum index 2ed61f3836..e69de29bb2 100644 --- a/vendor/github.com/andybalholm/brotli/go.sum +++ b/vendor/github.com/andybalholm/brotli/go.sum @@ -1,2 +0,0 @@ -github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721 h1:KRMr9A3qfbVM7iV/WcLY/rL5LICqwMHLhwRXKu99fXw= -github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4= diff --git a/vendor/github.com/andybalholm/brotli/http.go b/vendor/github.com/andybalholm/brotli/http.go new file mode 100644 index 0000000000..af58670f2c --- /dev/null +++ b/vendor/github.com/andybalholm/brotli/http.go @@ -0,0 +1,192 @@ +package brotli + +import ( + "compress/gzip" + "io" + "net/http" + "strings" +) + +// HTTPCompressor chooses a compression method (brotli, gzip, or none) based on +// the Accept-Encoding header, sets the Content-Encoding header, and returns a +// WriteCloser that implements that compression. The Close method must be called +// before the current HTTP handler returns. +// +// Due to https://github.com/golang/go/issues/31753, the response will not be +// compressed unless you set a Content-Type header before you call +// HTTPCompressor. +func HTTPCompressor(w http.ResponseWriter, r *http.Request) io.WriteCloser { + if w.Header().Get("Content-Type") == "" { + return nopCloser{w} + } + + if w.Header().Get("Vary") == "" { + w.Header().Set("Vary", "Accept-Encoding") + } + + encoding := negotiateContentEncoding(r, []string{"br", "gzip"}) + switch encoding { + case "br": + w.Header().Set("Content-Encoding", "br") + return NewWriter(w) + case "gzip": + w.Header().Set("Content-Encoding", "gzip") + return gzip.NewWriter(w) + } + return nopCloser{w} +} + +// negotiateContentEncoding returns the best offered content encoding for the +// request's Accept-Encoding header. If two offers match with equal weight and +// then the offer earlier in the list is preferred. If no offers are +// acceptable, then "" is returned. +func negotiateContentEncoding(r *http.Request, offers []string) string { + bestOffer := "identity" + bestQ := -1.0 + specs := parseAccept(r.Header, "Accept-Encoding") + for _, offer := range offers { + for _, spec := range specs { + if spec.Q > bestQ && + (spec.Value == "*" || spec.Value == offer) { + bestQ = spec.Q + bestOffer = offer + } + } + } + if bestQ == 0 { + bestOffer = "" + } + return bestOffer +} + +// acceptSpec describes an Accept* header. +type acceptSpec struct { + Value string + Q float64 +} + +// parseAccept parses Accept* headers. +func parseAccept(header http.Header, key string) (specs []acceptSpec) { +loop: + for _, s := range header[key] { + for { + var spec acceptSpec + spec.Value, s = expectTokenSlash(s) + if spec.Value == "" { + continue loop + } + spec.Q = 1.0 + s = skipSpace(s) + if strings.HasPrefix(s, ";") { + s = skipSpace(s[1:]) + if !strings.HasPrefix(s, "q=") { + continue loop + } + spec.Q, s = expectQuality(s[2:]) + if spec.Q < 0.0 { + continue loop + } + } + specs = append(specs, spec) + s = skipSpace(s) + if !strings.HasPrefix(s, ",") { + continue loop + } + s = skipSpace(s[1:]) + } + } + return +} + +func skipSpace(s string) (rest string) { + i := 0 + for ; i < len(s); i++ { + if octetTypes[s[i]]&isSpace == 0 { + break + } + } + return s[i:] +} + +func expectTokenSlash(s string) (token, rest string) { + i := 0 + for ; i < len(s); i++ { + b := s[i] + if (octetTypes[b]&isToken == 0) && b != '/' { + break + } + } + return s[:i], s[i:] +} + +func expectQuality(s string) (q float64, rest string) { + switch { + case len(s) == 0: + return -1, "" + case s[0] == '0': + q = 0 + case s[0] == '1': + q = 1 + default: + return -1, "" + } + s = s[1:] + if !strings.HasPrefix(s, ".") { + return q, s + } + s = s[1:] + i := 0 + n := 0 + d := 1 + for ; i < len(s); i++ { + b := s[i] + if b < '0' || b > '9' { + break + } + n = n*10 + int(b) - '0' + d *= 10 + } + return q + float64(n)/float64(d), s[i:] +} + +// Octet types from RFC 2616. +var octetTypes [256]octetType + +type octetType byte + +const ( + isToken octetType = 1 << iota + isSpace +) + +func init() { + // OCTET = + // CHAR = + // CTL = + // CR = + // LF = + // SP = + // HT = + // <"> = + // CRLF = CR LF + // LWS = [CRLF] 1*( SP | HT ) + // TEXT = + // separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> + // | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT + // token = 1* + // qdtext = > + + for c := 0; c < 256; c++ { + var t octetType + isCtl := c <= 31 || c == 127 + isChar := 0 <= c && c <= 127 + isSeparator := strings.IndexRune(" \t\"(),/:;<=>?@[]\\{}", rune(c)) >= 0 + if strings.IndexRune(" \t\r\n", rune(c)) >= 0 { + t |= isSpace + } + if isChar && !isCtl && !isSeparator { + t |= isToken + } + octetTypes[c] = t + } +} diff --git a/vendor/github.com/andybalholm/brotli/writer.go b/vendor/github.com/andybalholm/brotli/writer.go index 92c128c4d6..ec333f9cff 100644 --- a/vendor/github.com/andybalholm/brotli/writer.go +++ b/vendor/github.com/andybalholm/brotli/writer.go @@ -1,12 +1,8 @@ package brotli import ( - "compress/gzip" "errors" "io" - "net/http" - - "github.com/golang/gddo/httputil" ) const ( @@ -50,11 +46,8 @@ func NewWriterLevel(dst io.Writer, level int) *Writer { // NewWriterOptions is like NewWriter but specifies WriterOptions func NewWriterOptions(dst io.Writer, options WriterOptions) *Writer { w := new(Writer) + w.options = options w.Reset(dst) - w.params.quality = options.Quality - if options.LGWin > 0 { - w.params.lgwin = uint(options.LGWin) - } return w } @@ -63,6 +56,10 @@ func NewWriterOptions(dst io.Writer, options WriterOptions) *Writer { // instead. This permits reusing a Writer rather than allocating a new one. func (w *Writer) Reset(dst io.Writer) { encoderInitState(w) + w.params.quality = w.options.Quality + if w.options.LGWin > 0 { + w.params.lgwin = uint(w.options.LGWin) + } w.dst = dst } @@ -124,32 +121,3 @@ type nopCloser struct { } func (nopCloser) Close() error { return nil } - -// HTTPCompressor chooses a compression method (brotli, gzip, or none) based on -// the Accept-Encoding header, sets the Content-Encoding header, and returns a -// WriteCloser that implements that compression. The Close method must be called -// before the current HTTP handler returns. -// -// Due to https://github.com/golang/go/issues/31753, the response will not be -// compressed unless you set a Content-Type header before you call -// HTTPCompressor. -func HTTPCompressor(w http.ResponseWriter, r *http.Request) io.WriteCloser { - if w.Header().Get("Content-Type") == "" { - return nopCloser{w} - } - - if w.Header().Get("Vary") == "" { - w.Header().Set("Vary", "Accept-Encoding") - } - - encoding := httputil.NegotiateContentEncoding(r, []string{"br", "gzip"}) - switch encoding { - case "br": - w.Header().Set("Content-Encoding", "br") - return NewWriter(w) - case "gzip": - w.Header().Set("Content-Encoding", "gzip") - return gzip.NewWriter(w) - } - return nopCloser{w} -} diff --git a/vendor/github.com/go-ole/go-ole/com.go b/vendor/github.com/go-ole/go-ole/com.go index 6f986b1894..a9bef150a3 100644 --- a/vendor/github.com/go-ole/go-ole/com.go +++ b/vendor/github.com/go-ole/go-ole/com.go @@ -9,32 +9,32 @@ import ( ) var ( - procCoInitialize, _ = modole32.FindProc("CoInitialize") - procCoInitializeEx, _ = modole32.FindProc("CoInitializeEx") - procCoUninitialize, _ = modole32.FindProc("CoUninitialize") - procCoCreateInstance, _ = modole32.FindProc("CoCreateInstance") - procCoTaskMemFree, _ = modole32.FindProc("CoTaskMemFree") - procCLSIDFromProgID, _ = modole32.FindProc("CLSIDFromProgID") - procCLSIDFromString, _ = modole32.FindProc("CLSIDFromString") - procStringFromCLSID, _ = modole32.FindProc("StringFromCLSID") - procStringFromIID, _ = modole32.FindProc("StringFromIID") - procIIDFromString, _ = modole32.FindProc("IIDFromString") - procCoGetObject, _ = modole32.FindProc("CoGetObject") - procGetUserDefaultLCID, _ = modkernel32.FindProc("GetUserDefaultLCID") - procCopyMemory, _ = modkernel32.FindProc("RtlMoveMemory") - procVariantInit, _ = modoleaut32.FindProc("VariantInit") - procVariantClear, _ = modoleaut32.FindProc("VariantClear") - procVariantTimeToSystemTime, _ = modoleaut32.FindProc("VariantTimeToSystemTime") - procSysAllocString, _ = modoleaut32.FindProc("SysAllocString") - procSysAllocStringLen, _ = modoleaut32.FindProc("SysAllocStringLen") - procSysFreeString, _ = modoleaut32.FindProc("SysFreeString") - procSysStringLen, _ = modoleaut32.FindProc("SysStringLen") - procCreateDispTypeInfo, _ = modoleaut32.FindProc("CreateDispTypeInfo") - procCreateStdDispatch, _ = modoleaut32.FindProc("CreateStdDispatch") - procGetActiveObject, _ = modoleaut32.FindProc("GetActiveObject") - - procGetMessageW, _ = moduser32.FindProc("GetMessageW") - procDispatchMessageW, _ = moduser32.FindProc("DispatchMessageW") + procCoInitialize = modole32.NewProc("CoInitialize") + procCoInitializeEx = modole32.NewProc("CoInitializeEx") + procCoUninitialize = modole32.NewProc("CoUninitialize") + procCoCreateInstance = modole32.NewProc("CoCreateInstance") + procCoTaskMemFree = modole32.NewProc("CoTaskMemFree") + procCLSIDFromProgID = modole32.NewProc("CLSIDFromProgID") + procCLSIDFromString = modole32.NewProc("CLSIDFromString") + procStringFromCLSID = modole32.NewProc("StringFromCLSID") + procStringFromIID = modole32.NewProc("StringFromIID") + procIIDFromString = modole32.NewProc("IIDFromString") + procCoGetObject = modole32.NewProc("CoGetObject") + procGetUserDefaultLCID = modkernel32.NewProc("GetUserDefaultLCID") + procCopyMemory = modkernel32.NewProc("RtlMoveMemory") + procVariantInit = modoleaut32.NewProc("VariantInit") + procVariantClear = modoleaut32.NewProc("VariantClear") + procVariantTimeToSystemTime = modoleaut32.NewProc("VariantTimeToSystemTime") + procSysAllocString = modoleaut32.NewProc("SysAllocString") + procSysAllocStringLen = modoleaut32.NewProc("SysAllocStringLen") + procSysFreeString = modoleaut32.NewProc("SysFreeString") + procSysStringLen = modoleaut32.NewProc("SysStringLen") + procCreateDispTypeInfo = modoleaut32.NewProc("CreateDispTypeInfo") + procCreateStdDispatch = modoleaut32.NewProc("CreateStdDispatch") + procGetActiveObject = modoleaut32.NewProc("GetActiveObject") + + procGetMessageW = moduser32.NewProc("GetMessageW") + procDispatchMessageW = moduser32.NewProc("DispatchMessageW") ) // coInitialize initializes COM library on current thread. diff --git a/vendor/github.com/go-ole/go-ole/go.mod b/vendor/github.com/go-ole/go-ole/go.mod index df98533ea9..3a21f7504d 100644 --- a/vendor/github.com/go-ole/go-ole/go.mod +++ b/vendor/github.com/go-ole/go-ole/go.mod @@ -1,3 +1,5 @@ module github.com/go-ole/go-ole go 1.12 + +require golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 diff --git a/vendor/github.com/go-ole/go-ole/go.sum b/vendor/github.com/go-ole/go-ole/go.sum new file mode 100644 index 0000000000..9814d3163b --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/go.sum @@ -0,0 +1,2 @@ +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/go-ole/go-ole/safearray_windows.go b/vendor/github.com/go-ole/go-ole/safearray_windows.go index b48a2394d1..0c1b3a10ff 100644 --- a/vendor/github.com/go-ole/go-ole/safearray_windows.go +++ b/vendor/github.com/go-ole/go-ole/safearray_windows.go @@ -7,35 +7,35 @@ import ( ) var ( - procSafeArrayAccessData, _ = modoleaut32.FindProc("SafeArrayAccessData") - procSafeArrayAllocData, _ = modoleaut32.FindProc("SafeArrayAllocData") - procSafeArrayAllocDescriptor, _ = modoleaut32.FindProc("SafeArrayAllocDescriptor") - procSafeArrayAllocDescriptorEx, _ = modoleaut32.FindProc("SafeArrayAllocDescriptorEx") - procSafeArrayCopy, _ = modoleaut32.FindProc("SafeArrayCopy") - procSafeArrayCopyData, _ = modoleaut32.FindProc("SafeArrayCopyData") - procSafeArrayCreate, _ = modoleaut32.FindProc("SafeArrayCreate") - procSafeArrayCreateEx, _ = modoleaut32.FindProc("SafeArrayCreateEx") - procSafeArrayCreateVector, _ = modoleaut32.FindProc("SafeArrayCreateVector") - procSafeArrayCreateVectorEx, _ = modoleaut32.FindProc("SafeArrayCreateVectorEx") - procSafeArrayDestroy, _ = modoleaut32.FindProc("SafeArrayDestroy") - procSafeArrayDestroyData, _ = modoleaut32.FindProc("SafeArrayDestroyData") - procSafeArrayDestroyDescriptor, _ = modoleaut32.FindProc("SafeArrayDestroyDescriptor") - procSafeArrayGetDim, _ = modoleaut32.FindProc("SafeArrayGetDim") - procSafeArrayGetElement, _ = modoleaut32.FindProc("SafeArrayGetElement") - procSafeArrayGetElemsize, _ = modoleaut32.FindProc("SafeArrayGetElemsize") - procSafeArrayGetIID, _ = modoleaut32.FindProc("SafeArrayGetIID") - procSafeArrayGetLBound, _ = modoleaut32.FindProc("SafeArrayGetLBound") - procSafeArrayGetUBound, _ = modoleaut32.FindProc("SafeArrayGetUBound") - procSafeArrayGetVartype, _ = modoleaut32.FindProc("SafeArrayGetVartype") - procSafeArrayLock, _ = modoleaut32.FindProc("SafeArrayLock") - procSafeArrayPtrOfIndex, _ = modoleaut32.FindProc("SafeArrayPtrOfIndex") - procSafeArrayUnaccessData, _ = modoleaut32.FindProc("SafeArrayUnaccessData") - procSafeArrayUnlock, _ = modoleaut32.FindProc("SafeArrayUnlock") - procSafeArrayPutElement, _ = modoleaut32.FindProc("SafeArrayPutElement") - //procSafeArrayRedim, _ = modoleaut32.FindProc("SafeArrayRedim") // TODO - //procSafeArraySetIID, _ = modoleaut32.FindProc("SafeArraySetIID") // TODO - procSafeArrayGetRecordInfo, _ = modoleaut32.FindProc("SafeArrayGetRecordInfo") - procSafeArraySetRecordInfo, _ = modoleaut32.FindProc("SafeArraySetRecordInfo") + procSafeArrayAccessData = modoleaut32.NewProc("SafeArrayAccessData") + procSafeArrayAllocData = modoleaut32.NewProc("SafeArrayAllocData") + procSafeArrayAllocDescriptor = modoleaut32.NewProc("SafeArrayAllocDescriptor") + procSafeArrayAllocDescriptorEx = modoleaut32.NewProc("SafeArrayAllocDescriptorEx") + procSafeArrayCopy = modoleaut32.NewProc("SafeArrayCopy") + procSafeArrayCopyData = modoleaut32.NewProc("SafeArrayCopyData") + procSafeArrayCreate = modoleaut32.NewProc("SafeArrayCreate") + procSafeArrayCreateEx = modoleaut32.NewProc("SafeArrayCreateEx") + procSafeArrayCreateVector = modoleaut32.NewProc("SafeArrayCreateVector") + procSafeArrayCreateVectorEx = modoleaut32.NewProc("SafeArrayCreateVectorEx") + procSafeArrayDestroy = modoleaut32.NewProc("SafeArrayDestroy") + procSafeArrayDestroyData = modoleaut32.NewProc("SafeArrayDestroyData") + procSafeArrayDestroyDescriptor = modoleaut32.NewProc("SafeArrayDestroyDescriptor") + procSafeArrayGetDim = modoleaut32.NewProc("SafeArrayGetDim") + procSafeArrayGetElement = modoleaut32.NewProc("SafeArrayGetElement") + procSafeArrayGetElemsize = modoleaut32.NewProc("SafeArrayGetElemsize") + procSafeArrayGetIID = modoleaut32.NewProc("SafeArrayGetIID") + procSafeArrayGetLBound = modoleaut32.NewProc("SafeArrayGetLBound") + procSafeArrayGetUBound = modoleaut32.NewProc("SafeArrayGetUBound") + procSafeArrayGetVartype = modoleaut32.NewProc("SafeArrayGetVartype") + procSafeArrayLock = modoleaut32.NewProc("SafeArrayLock") + procSafeArrayPtrOfIndex = modoleaut32.NewProc("SafeArrayPtrOfIndex") + procSafeArrayUnaccessData = modoleaut32.NewProc("SafeArrayUnaccessData") + procSafeArrayUnlock = modoleaut32.NewProc("SafeArrayUnlock") + procSafeArrayPutElement = modoleaut32.NewProc("SafeArrayPutElement") + //procSafeArrayRedim = modoleaut32.NewProc("SafeArrayRedim") // TODO + //procSafeArraySetIID = modoleaut32.NewProc("SafeArraySetIID") // TODO + procSafeArrayGetRecordInfo = modoleaut32.NewProc("SafeArrayGetRecordInfo") + procSafeArraySetRecordInfo = modoleaut32.NewProc("SafeArraySetRecordInfo") ) // safeArrayAccessData returns raw array pointer. diff --git a/vendor/github.com/go-ole/go-ole/variables.go b/vendor/github.com/go-ole/go-ole/variables.go index ebe00f1cfc..a6add1b006 100644 --- a/vendor/github.com/go-ole/go-ole/variables.go +++ b/vendor/github.com/go-ole/go-ole/variables.go @@ -3,14 +3,13 @@ package ole import ( - "syscall" + "golang.org/x/sys/windows" ) var ( - modcombase = syscall.NewLazyDLL("combase.dll") - modkernel32, _ = syscall.LoadDLL("kernel32.dll") - modole32, _ = syscall.LoadDLL("ole32.dll") - modoleaut32, _ = syscall.LoadDLL("oleaut32.dll") - modmsvcrt, _ = syscall.LoadDLL("msvcrt.dll") - moduser32, _ = syscall.LoadDLL("user32.dll") + modcombase = windows.NewLazySystemDLL("combase.dll") + modkernel32 = windows.NewLazySystemDLL("kernel32.dll") + modole32 = windows.NewLazySystemDLL("ole32.dll") + modoleaut32 = windows.NewLazySystemDLL("oleaut32.dll") + moduser32 = windows.NewLazySystemDLL("user32.dll") ) diff --git a/vendor/github.com/golang/gddo/LICENSE b/vendor/github.com/golang/gddo/LICENSE deleted file mode 100644 index 65d761bc9f..0000000000 --- a/vendor/github.com/golang/gddo/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2013 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/golang/gddo/httputil/buster.go b/vendor/github.com/golang/gddo/httputil/buster.go deleted file mode 100644 index beab151a4b..0000000000 --- a/vendor/github.com/golang/gddo/httputil/buster.go +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd. - -package httputil - -import ( - "io" - "io/ioutil" - "net/http" - "net/url" - "strings" - "sync" -) - -type busterWriter struct { - headerMap http.Header - status int - io.Writer -} - -func (bw *busterWriter) Header() http.Header { - return bw.headerMap -} - -func (bw *busterWriter) WriteHeader(status int) { - bw.status = status -} - -// CacheBusters maintains a cache of cache busting tokens for static resources served by Handler. -type CacheBusters struct { - Handler http.Handler - - mu sync.Mutex - tokens map[string]string -} - -func sanitizeTokenRune(r rune) rune { - if r <= ' ' || r >= 127 { - return -1 - } - // Convert percent encoding reserved characters to '-'. - if strings.ContainsRune("!#$&'()*+,/:;=?@[]", r) { - return '-' - } - return r -} - -// Get returns the cache busting token for path. If the token is not already -// cached, Get issues a HEAD request on handler and uses the response ETag and -// Last-Modified headers to compute a token. -func (cb *CacheBusters) Get(path string) string { - cb.mu.Lock() - if cb.tokens == nil { - cb.tokens = make(map[string]string) - } - token, ok := cb.tokens[path] - cb.mu.Unlock() - if ok { - return token - } - - w := busterWriter{ - Writer: ioutil.Discard, - headerMap: make(http.Header), - } - r := &http.Request{URL: &url.URL{Path: path}, Method: "HEAD"} - cb.Handler.ServeHTTP(&w, r) - - if w.status == 200 { - token = w.headerMap.Get("Etag") - if token == "" { - token = w.headerMap.Get("Last-Modified") - } - token = strings.Trim(token, `" `) - token = strings.Map(sanitizeTokenRune, token) - } - - cb.mu.Lock() - cb.tokens[path] = token - cb.mu.Unlock() - - return token -} - -// AppendQueryParam appends the token as a query parameter to path. -func (cb *CacheBusters) AppendQueryParam(path string, name string) string { - token := cb.Get(path) - if token == "" { - return path - } - return path + "?" + name + "=" + token -} diff --git a/vendor/github.com/golang/gddo/httputil/header/header.go b/vendor/github.com/golang/gddo/httputil/header/header.go deleted file mode 100644 index 0f1572e3f9..0000000000 --- a/vendor/github.com/golang/gddo/httputil/header/header.go +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd. - -// Package header provides functions for parsing HTTP headers. -package header - -import ( - "net/http" - "strings" - "time" -) - -// Octet types from RFC 2616. -var octetTypes [256]octetType - -type octetType byte - -const ( - isToken octetType = 1 << iota - isSpace -) - -func init() { - // OCTET = - // CHAR = - // CTL = - // CR = - // LF = - // SP = - // HT = - // <"> = - // CRLF = CR LF - // LWS = [CRLF] 1*( SP | HT ) - // TEXT = - // separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> - // | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT - // token = 1* - // qdtext = > - - for c := 0; c < 256; c++ { - var t octetType - isCtl := c <= 31 || c == 127 - isChar := 0 <= c && c <= 127 - isSeparator := strings.IndexRune(" \t\"(),/:;<=>?@[]\\{}", rune(c)) >= 0 - if strings.IndexRune(" \t\r\n", rune(c)) >= 0 { - t |= isSpace - } - if isChar && !isCtl && !isSeparator { - t |= isToken - } - octetTypes[c] = t - } -} - -// Copy returns a shallow copy of the header. -func Copy(header http.Header) http.Header { - h := make(http.Header) - for k, vs := range header { - h[k] = vs - } - return h -} - -var timeLayouts = []string{"Mon, 02 Jan 2006 15:04:05 GMT", time.RFC850, time.ANSIC} - -// ParseTime parses the header as time. The zero value is returned if the -// header is not present or there is an error parsing the -// header. -func ParseTime(header http.Header, key string) time.Time { - if s := header.Get(key); s != "" { - for _, layout := range timeLayouts { - if t, err := time.Parse(layout, s); err == nil { - return t.UTC() - } - } - } - return time.Time{} -} - -// ParseList parses a comma separated list of values. Commas are ignored in -// quoted strings. Quoted values are not unescaped or unquoted. Whitespace is -// trimmed. -func ParseList(header http.Header, key string) []string { - var result []string - for _, s := range header[http.CanonicalHeaderKey(key)] { - begin := 0 - end := 0 - escape := false - quote := false - for i := 0; i < len(s); i++ { - b := s[i] - switch { - case escape: - escape = false - end = i + 1 - case quote: - switch b { - case '\\': - escape = true - case '"': - quote = false - } - end = i + 1 - case b == '"': - quote = true - end = i + 1 - case octetTypes[b]&isSpace != 0: - if begin == end { - begin = i + 1 - end = begin - } - case b == ',': - if begin < end { - result = append(result, s[begin:end]) - } - begin = i + 1 - end = begin - default: - end = i + 1 - } - } - if begin < end { - result = append(result, s[begin:end]) - } - } - return result -} - -// ParseValueAndParams parses a comma separated list of values with optional -// semicolon separated name-value pairs. Content-Type and Content-Disposition -// headers are in this format. -func ParseValueAndParams(header http.Header, key string) (value string, params map[string]string) { - params = make(map[string]string) - s := header.Get(key) - value, s = expectTokenSlash(s) - if value == "" { - return - } - value = strings.ToLower(value) - s = skipSpace(s) - for strings.HasPrefix(s, ";") { - var pkey string - pkey, s = expectToken(skipSpace(s[1:])) - if pkey == "" { - return - } - if !strings.HasPrefix(s, "=") { - return - } - var pvalue string - pvalue, s = expectTokenOrQuoted(s[1:]) - if pvalue == "" { - return - } - pkey = strings.ToLower(pkey) - params[pkey] = pvalue - s = skipSpace(s) - } - return -} - -// AcceptSpec describes an Accept* header. -type AcceptSpec struct { - Value string - Q float64 -} - -// ParseAccept parses Accept* headers. -func ParseAccept(header http.Header, key string) (specs []AcceptSpec) { -loop: - for _, s := range header[key] { - for { - var spec AcceptSpec - spec.Value, s = expectTokenSlash(s) - if spec.Value == "" { - continue loop - } - spec.Q = 1.0 - s = skipSpace(s) - if strings.HasPrefix(s, ";") { - s = skipSpace(s[1:]) - if !strings.HasPrefix(s, "q=") { - continue loop - } - spec.Q, s = expectQuality(s[2:]) - if spec.Q < 0.0 { - continue loop - } - } - specs = append(specs, spec) - s = skipSpace(s) - if !strings.HasPrefix(s, ",") { - continue loop - } - s = skipSpace(s[1:]) - } - } - return -} - -func skipSpace(s string) (rest string) { - i := 0 - for ; i < len(s); i++ { - if octetTypes[s[i]]&isSpace == 0 { - break - } - } - return s[i:] -} - -func expectToken(s string) (token, rest string) { - i := 0 - for ; i < len(s); i++ { - if octetTypes[s[i]]&isToken == 0 { - break - } - } - return s[:i], s[i:] -} - -func expectTokenSlash(s string) (token, rest string) { - i := 0 - for ; i < len(s); i++ { - b := s[i] - if (octetTypes[b]&isToken == 0) && b != '/' { - break - } - } - return s[:i], s[i:] -} - -func expectQuality(s string) (q float64, rest string) { - switch { - case len(s) == 0: - return -1, "" - case s[0] == '0': - q = 0 - case s[0] == '1': - q = 1 - default: - return -1, "" - } - s = s[1:] - if !strings.HasPrefix(s, ".") { - return q, s - } - s = s[1:] - i := 0 - n := 0 - d := 1 - for ; i < len(s); i++ { - b := s[i] - if b < '0' || b > '9' { - break - } - n = n*10 + int(b) - '0' - d *= 10 - } - return q + float64(n)/float64(d), s[i:] -} - -func expectTokenOrQuoted(s string) (value string, rest string) { - if !strings.HasPrefix(s, "\"") { - return expectToken(s) - } - s = s[1:] - for i := 0; i < len(s); i++ { - switch s[i] { - case '"': - return s[:i], s[i+1:] - case '\\': - p := make([]byte, len(s)-1) - j := copy(p, s[:i]) - escape := true - for i = i + 1; i < len(s); i++ { - b := s[i] - switch { - case escape: - escape = false - p[j] = b - j++ - case b == '\\': - escape = true - case b == '"': - return string(p[:j]), s[i+1:] - default: - p[j] = b - j++ - } - } - return "", "" - } - } - return "", "" -} diff --git a/vendor/github.com/golang/gddo/httputil/httputil.go b/vendor/github.com/golang/gddo/httputil/httputil.go deleted file mode 100644 index a03717c073..0000000000 --- a/vendor/github.com/golang/gddo/httputil/httputil.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd. - -// Package httputil is a toolkit for the Go net/http package. -package httputil - -import ( - "net" - "net/http" -) - -// StripPort removes the port specification from an address. -func StripPort(s string) string { - if h, _, err := net.SplitHostPort(s); err == nil { - s = h - } - return s -} - -// Error defines a type for a function that accepts a ResponseWriter for -// a Request with the HTTP status code and error. -type Error func(w http.ResponseWriter, r *http.Request, status int, err error) diff --git a/vendor/github.com/golang/gddo/httputil/negotiate.go b/vendor/github.com/golang/gddo/httputil/negotiate.go deleted file mode 100644 index 6af3e4ca61..0000000000 --- a/vendor/github.com/golang/gddo/httputil/negotiate.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd. - -package httputil - -import ( - "github.com/golang/gddo/httputil/header" - "net/http" - "strings" -) - -// NegotiateContentEncoding returns the best offered content encoding for the -// request's Accept-Encoding header. If two offers match with equal weight and -// then the offer earlier in the list is preferred. If no offers are -// acceptable, then "" is returned. -func NegotiateContentEncoding(r *http.Request, offers []string) string { - bestOffer := "identity" - bestQ := -1.0 - specs := header.ParseAccept(r.Header, "Accept-Encoding") - for _, offer := range offers { - for _, spec := range specs { - if spec.Q > bestQ && - (spec.Value == "*" || spec.Value == offer) { - bestQ = spec.Q - bestOffer = offer - } - } - } - if bestQ == 0 { - bestOffer = "" - } - return bestOffer -} - -// NegotiateContentType returns the best offered content type for the request's -// Accept header. If two offers match with equal weight, then the more specific -// offer is preferred. For example, text/* trumps */*. If two offers match -// with equal weight and specificity, then the offer earlier in the list is -// preferred. If no offers match, then defaultOffer is returned. -func NegotiateContentType(r *http.Request, offers []string, defaultOffer string) string { - bestOffer := defaultOffer - bestQ := -1.0 - bestWild := 3 - specs := header.ParseAccept(r.Header, "Accept") - for _, offer := range offers { - for _, spec := range specs { - switch { - case spec.Q == 0.0: - // ignore - case spec.Q < bestQ: - // better match found - case spec.Value == "*/*": - if spec.Q > bestQ || bestWild > 2 { - bestQ = spec.Q - bestWild = 2 - bestOffer = offer - } - case strings.HasSuffix(spec.Value, "/*"): - if strings.HasPrefix(offer, spec.Value[:len(spec.Value)-1]) && - (spec.Q > bestQ || bestWild > 1) { - bestQ = spec.Q - bestWild = 1 - bestOffer = offer - } - default: - if spec.Value == offer && - (spec.Q > bestQ || bestWild > 0) { - bestQ = spec.Q - bestWild = 0 - bestOffer = offer - } - } - } - } - return bestOffer -} diff --git a/vendor/github.com/golang/gddo/httputil/respbuf.go b/vendor/github.com/golang/gddo/httputil/respbuf.go deleted file mode 100644 index 051af2114b..0000000000 --- a/vendor/github.com/golang/gddo/httputil/respbuf.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd. - -package httputil - -import ( - "bytes" - "net/http" - "strconv" -) - -// ResponseBuffer is the current response being composed by its owner. -// It implements http.ResponseWriter and io.WriterTo. -type ResponseBuffer struct { - buf bytes.Buffer - status int - header http.Header -} - -// Write implements the http.ResponseWriter interface. -func (rb *ResponseBuffer) Write(p []byte) (int, error) { - return rb.buf.Write(p) -} - -// WriteHeader implements the http.ResponseWriter interface. -func (rb *ResponseBuffer) WriteHeader(status int) { - rb.status = status -} - -// Header implements the http.ResponseWriter interface. -func (rb *ResponseBuffer) Header() http.Header { - if rb.header == nil { - rb.header = make(http.Header) - } - return rb.header -} - -// WriteTo implements the io.WriterTo interface. -func (rb *ResponseBuffer) WriteTo(w http.ResponseWriter) error { - for k, v := range rb.header { - w.Header()[k] = v - } - if rb.buf.Len() > 0 { - w.Header().Set("Content-Length", strconv.Itoa(rb.buf.Len())) - } - if rb.status != 0 { - w.WriteHeader(rb.status) - } - if rb.buf.Len() > 0 { - if _, err := w.Write(rb.buf.Bytes()); err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/golang/gddo/httputil/static.go b/vendor/github.com/golang/gddo/httputil/static.go deleted file mode 100644 index 6610dde0da..0000000000 --- a/vendor/github.com/golang/gddo/httputil/static.go +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd. - -package httputil - -import ( - "bytes" - "crypto/sha1" - "errors" - "fmt" - "github.com/golang/gddo/httputil/header" - "io" - "io/ioutil" - "mime" - "net/http" - "os" - "path" - "path/filepath" - "strconv" - "strings" - "sync" - "time" -) - -// StaticServer serves static files. -type StaticServer struct { - // Dir specifies the location of the directory containing the files to serve. - Dir string - - // MaxAge specifies the maximum age for the cache control and expiration - // headers. - MaxAge time.Duration - - // Error specifies the function used to generate error responses. If Error - // is nil, then http.Error is used to generate error responses. - Error Error - - // MIMETypes is a map from file extensions to MIME types. - MIMETypes map[string]string - - mu sync.Mutex - etags map[string]string -} - -func (ss *StaticServer) resolve(fname string) string { - if path.IsAbs(fname) { - panic("Absolute path not allowed when creating a StaticServer handler") - } - dir := ss.Dir - if dir == "" { - dir = "." - } - fname = filepath.FromSlash(fname) - return filepath.Join(dir, fname) -} - -func (ss *StaticServer) mimeType(fname string) string { - ext := path.Ext(fname) - var mimeType string - if ss.MIMETypes != nil { - mimeType = ss.MIMETypes[ext] - } - if mimeType == "" { - mimeType = mime.TypeByExtension(ext) - } - if mimeType == "" { - mimeType = "application/octet-stream" - } - return mimeType -} - -func (ss *StaticServer) openFile(fname string) (io.ReadCloser, int64, string, error) { - f, err := os.Open(fname) - if err != nil { - return nil, 0, "", err - } - fi, err := f.Stat() - if err != nil { - f.Close() - return nil, 0, "", err - } - const modeType = os.ModeDir | os.ModeSymlink | os.ModeNamedPipe | os.ModeSocket | os.ModeDevice - if fi.Mode()&modeType != 0 { - f.Close() - return nil, 0, "", errors.New("not a regular file") - } - return f, fi.Size(), ss.mimeType(fname), nil -} - -// FileHandler returns a handler that serves a single file. The file is -// specified by a slash separated path relative to the static server's Dir -// field. -func (ss *StaticServer) FileHandler(fileName string) http.Handler { - id := fileName - fileName = ss.resolve(fileName) - return &staticHandler{ - ss: ss, - id: func(_ string) string { return id }, - open: func(_ string) (io.ReadCloser, int64, string, error) { return ss.openFile(fileName) }, - } -} - -// DirectoryHandler returns a handler that serves files from a directory tree. -// The directory is specified by a slash separated path relative to the static -// server's Dir field. -func (ss *StaticServer) DirectoryHandler(prefix, dirName string) http.Handler { - if !strings.HasSuffix(prefix, "/") { - prefix += "/" - } - idBase := dirName - dirName = ss.resolve(dirName) - return &staticHandler{ - ss: ss, - id: func(p string) string { - if !strings.HasPrefix(p, prefix) { - return "." - } - return path.Join(idBase, p[len(prefix):]) - }, - open: func(p string) (io.ReadCloser, int64, string, error) { - if !strings.HasPrefix(p, prefix) { - return nil, 0, "", errors.New("request url does not match directory prefix") - } - p = p[len(prefix):] - return ss.openFile(filepath.Join(dirName, filepath.FromSlash(p))) - }, - } -} - -// FilesHandler returns a handler that serves the concatentation of the -// specified files. The files are specified by slash separated paths relative -// to the static server's Dir field. -func (ss *StaticServer) FilesHandler(fileNames ...string) http.Handler { - - // todo: cache concatenated files on disk and serve from there. - - mimeType := ss.mimeType(fileNames[0]) - var buf []byte - var openErr error - - for _, fileName := range fileNames { - p, err := ioutil.ReadFile(ss.resolve(fileName)) - if err != nil { - openErr = err - buf = nil - break - } - buf = append(buf, p...) - } - - id := strings.Join(fileNames, " ") - - return &staticHandler{ - ss: ss, - id: func(_ string) string { return id }, - open: func(p string) (io.ReadCloser, int64, string, error) { - return ioutil.NopCloser(bytes.NewReader(buf)), int64(len(buf)), mimeType, openErr - }, - } -} - -type staticHandler struct { - id func(fname string) string - open func(p string) (io.ReadCloser, int64, string, error) - ss *StaticServer -} - -func (h *staticHandler) error(w http.ResponseWriter, r *http.Request, status int, err error) { - http.Error(w, http.StatusText(status), status) -} - -func (h *staticHandler) etag(p string) (string, error) { - id := h.id(p) - - h.ss.mu.Lock() - if h.ss.etags == nil { - h.ss.etags = make(map[string]string) - } - etag := h.ss.etags[id] - h.ss.mu.Unlock() - - if etag != "" { - return etag, nil - } - - // todo: if a concurrent goroutine is calculating the hash, then wait for - // it instead of computing it again here. - - rc, _, _, err := h.open(p) - if err != nil { - return "", err - } - - defer rc.Close() - - w := sha1.New() - _, err = io.Copy(w, rc) - if err != nil { - return "", err - } - - etag = fmt.Sprintf(`"%x"`, w.Sum(nil)) - - h.ss.mu.Lock() - h.ss.etags[id] = etag - h.ss.mu.Unlock() - - return etag, nil -} - -func (h *staticHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - p := path.Clean(r.URL.Path) - if p != r.URL.Path { - http.Redirect(w, r, p, 301) - return - } - - etag, err := h.etag(p) - if err != nil { - h.error(w, r, http.StatusNotFound, err) - return - } - - maxAge := h.ss.MaxAge - if maxAge == 0 { - maxAge = 24 * time.Hour - } - if r.FormValue("v") != "" { - maxAge = 365 * 24 * time.Hour - } - - cacheControl := fmt.Sprintf("public, max-age=%d", maxAge/time.Second) - - for _, e := range header.ParseList(r.Header, "If-None-Match") { - if e == etag { - w.Header().Set("Cache-Control", cacheControl) - w.Header().Set("Etag", etag) - w.WriteHeader(http.StatusNotModified) - return - } - } - - rc, cl, ct, err := h.open(p) - if err != nil { - h.error(w, r, http.StatusNotFound, err) - return - } - defer rc.Close() - - w.Header().Set("Cache-Control", cacheControl) - w.Header().Set("Etag", etag) - if ct != "" { - w.Header().Set("Content-Type", ct) - } - if cl != 0 { - w.Header().Set("Content-Length", strconv.FormatInt(cl, 10)) - } - w.WriteHeader(http.StatusOK) - if r.Method != "HEAD" { - io.Copy(w, rc) - } -} diff --git a/vendor/github.com/golang/gddo/httputil/transport.go b/vendor/github.com/golang/gddo/httputil/transport.go deleted file mode 100644 index fdad3b4780..0000000000 --- a/vendor/github.com/golang/gddo/httputil/transport.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd. - -// This file implements a http.RoundTripper that authenticates -// requests issued against api.github.com endpoint. - -package httputil - -import ( - "net/http" - "net/url" -) - -// AuthTransport is an implementation of http.RoundTripper that authenticates -// with the GitHub API. -// -// When both a token and client credentials are set, the latter is preferred. -type AuthTransport struct { - UserAgent string - GithubToken string - GithubClientID string - GithubClientSecret string - Base http.RoundTripper -} - -// RoundTrip implements the http.RoundTripper interface. -func (t *AuthTransport) RoundTrip(req *http.Request) (*http.Response, error) { - var reqCopy *http.Request - if t.UserAgent != "" { - reqCopy = copyRequest(req) - reqCopy.Header.Set("User-Agent", t.UserAgent) - } - if req.URL.Host == "api.github.com" && req.URL.Scheme == "https" { - switch { - case t.GithubClientID != "" && t.GithubClientSecret != "": - if reqCopy == nil { - reqCopy = copyRequest(req) - } - if reqCopy.URL.RawQuery == "" { - reqCopy.URL.RawQuery = "client_id=" + t.GithubClientID + "&client_secret=" + t.GithubClientSecret - } else { - reqCopy.URL.RawQuery += "&client_id=" + t.GithubClientID + "&client_secret=" + t.GithubClientSecret - } - case t.GithubToken != "": - if reqCopy == nil { - reqCopy = copyRequest(req) - } - reqCopy.Header.Set("Authorization", "token "+t.GithubToken) - } - } - if reqCopy != nil { - return t.base().RoundTrip(reqCopy) - } - return t.base().RoundTrip(req) -} - -// CancelRequest cancels an in-flight request by closing its connection. -func (t *AuthTransport) CancelRequest(req *http.Request) { - type canceler interface { - CancelRequest(req *http.Request) - } - if cr, ok := t.base().(canceler); ok { - cr.CancelRequest(req) - } -} - -func (t *AuthTransport) base() http.RoundTripper { - if t.Base != nil { - return t.Base - } - return http.DefaultTransport -} - -func copyRequest(req *http.Request) *http.Request { - req2 := new(http.Request) - *req2 = *req - req2.URL = new(url.URL) - *req2.URL = *req.URL - req2.Header = make(http.Header, len(req.Header)) - for k, s := range req.Header { - req2.Header[k] = append([]string(nil), s...) - } - return req2 -} diff --git a/vendor/github.com/google/go-querystring/query/encode.go b/vendor/github.com/google/go-querystring/query/encode.go index 37080b19b5..91198f819a 100644 --- a/vendor/github.com/google/go-querystring/query/encode.go +++ b/vendor/github.com/google/go-querystring/query/encode.go @@ -51,8 +51,8 @@ type Encoder interface { // - the field is empty and its tag specifies the "omitempty" option // // The empty values are false, 0, any nil pointer or interface value, any array -// slice, map, or string of length zero, and any time.Time that returns true -// for IsZero(). +// slice, map, or string of length zero, and any type (such as time.Time) that +// returns true for IsZero(). // // The URL parameter name defaults to the struct field name but can be // specified in the struct field's tag value. The "url" key in the struct @@ -82,7 +82,14 @@ type Encoder interface { // // time.Time values default to encoding as RFC3339 timestamps. Including the // "unix" option signals that the field should be encoded as a Unix time (see -// time.Unix()) +// time.Unix()). The "unixmilli" and "unixnano" options will encode the number +// of milliseconds and nanoseconds, respectively, since January 1, 1970 (see +// time.UnixNano()). Including the "layout" struct tag (separate from the +// "url" tag) will use the value of the "layout" tag as a layout passed to +// time.Format. For example: +// +// // Encode a time.Time as YYYY-MM-DD +// Field time.Time `layout:"2006-01-02"` // // Slice and Array values default to encoding as multiple URL values of the // same name. Including the "comma" option signals that the field should be @@ -92,7 +99,13 @@ type Encoder interface { // Including the "brackets" option signals that the multiple URL values should // have "[]" appended to the value name. "numbered" will append a number to // the end of each incidence of the value name, example: -// name0=value0&name1=value1, etc. +// name0=value0&name1=value1, etc. Including the "del" struct tag (separate +// from the "url" tag) will use the value of the "del" tag as the delimiter. +// For example: +// +// // Encode a slice of bools as ints ("1" for true, "0" for false), +// // separated by exclamation points "!". +// Field []bool `url:",int" del:"!"` // // Anonymous struct fields are usually encoded as if their inner exported // fields were fields in the outer struct, subject to the standard Go @@ -151,11 +164,15 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error { continue } name, opts := parseTag(tag) + if name == "" { - if sf.Anonymous && sv.Kind() == reflect.Struct { - // save embedded struct for later processing - embedded = append(embedded, sv) - continue + if sf.Anonymous { + v := reflect.Indirect(sv) + if v.IsValid() && v.Kind() == reflect.Struct { + // save embedded struct for later processing + embedded = append(embedded, v) + continue + } } name = sf.Name @@ -170,7 +187,9 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error { } if sv.Type().Implements(encoderType) { - if !reflect.Indirect(sv).IsValid() { + // if sv is a nil pointer and the custom encoder is defined on a non-pointer + // method receiver, set sv to the zero value of the underlying type + if !reflect.Indirect(sv).IsValid() && sv.Type().Elem().Implements(encoderType) { sv = reflect.New(sv.Type().Elem()) } @@ -181,28 +200,38 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error { continue } + // recursively dereference pointers. break on nil pointers + for sv.Kind() == reflect.Ptr { + if sv.IsNil() { + break + } + sv = sv.Elem() + } + if sv.Kind() == reflect.Slice || sv.Kind() == reflect.Array { - var del byte + var del string if opts.Contains("comma") { - del = ',' + del = "," } else if opts.Contains("space") { - del = ' ' + del = " " } else if opts.Contains("semicolon") { - del = ';' + del = ";" } else if opts.Contains("brackets") { name = name + "[]" + } else { + del = sf.Tag.Get("del") } - if del != 0 { + if del != "" { s := new(bytes.Buffer) first := true for i := 0; i < sv.Len(); i++ { if first { first = false } else { - s.WriteByte(del) + s.WriteString(del) } - s.WriteString(valueString(sv.Index(i), opts)) + s.WriteString(valueString(sv.Index(i), opts, sf)) } values.Add(name, s.String()) } else { @@ -211,30 +240,25 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error { if opts.Contains("numbered") { k = fmt.Sprintf("%s%d", name, i) } - values.Add(k, valueString(sv.Index(i), opts)) + values.Add(k, valueString(sv.Index(i), opts, sf)) } } continue } - for sv.Kind() == reflect.Ptr { - if sv.IsNil() { - break - } - sv = sv.Elem() - } - if sv.Type() == timeType { - values.Add(name, valueString(sv, opts)) + values.Add(name, valueString(sv, opts, sf)) continue } if sv.Kind() == reflect.Struct { - reflectValue(values, sv, name) + if err := reflectValue(values, sv, name); err != nil { + return err + } continue } - values.Add(name, valueString(sv, opts)) + values.Add(name, valueString(sv, opts, sf)) } for _, f := range embedded { @@ -247,7 +271,7 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error { } // valueString returns the string representation of a value. -func valueString(v reflect.Value, opts tagOptions) string { +func valueString(v reflect.Value, opts tagOptions, sf reflect.StructField) string { for v.Kind() == reflect.Ptr { if v.IsNil() { return "" @@ -267,6 +291,15 @@ func valueString(v reflect.Value, opts tagOptions) string { if opts.Contains("unix") { return strconv.FormatInt(t.Unix(), 10) } + if opts.Contains("unixmilli") { + return strconv.FormatInt((t.UnixNano() / 1e6), 10) + } + if opts.Contains("unixnano") { + return strconv.FormatInt(t.UnixNano(), 10) + } + if layout := sf.Tag.Get("layout"); layout != "" { + return t.Format(layout) + } return t.Format(time.RFC3339) } @@ -291,8 +324,12 @@ func isEmptyValue(v reflect.Value) bool { return v.IsNil() } - if v.Type() == timeType { - return v.Interface().(time.Time).IsZero() + type zeroable interface { + IsZero() bool + } + + if z, ok := v.Interface().(zeroable); ok { + return z.IsZero() } return false diff --git a/vendor/github.com/google/uuid/README.md b/vendor/github.com/google/uuid/README.md index 9d92c11f16..f765a46f91 100644 --- a/vendor/github.com/google/uuid/README.md +++ b/vendor/github.com/google/uuid/README.md @@ -16,4 +16,4 @@ change is the ability to represent an invalid UUID (vs a NIL UUID). Full `go doc` style documentation for the package can be viewed online without installing this package by using the GoDoc site here: -http://godoc.org/github.com/google/uuid +http://pkg.go.dev/github.com/google/uuid diff --git a/vendor/github.com/google/uuid/hash.go b/vendor/github.com/google/uuid/hash.go index b174616315..b404f4bec2 100644 --- a/vendor/github.com/google/uuid/hash.go +++ b/vendor/github.com/google/uuid/hash.go @@ -26,8 +26,8 @@ var ( // NewMD5 and NewSHA1. func NewHash(h hash.Hash, space UUID, data []byte, version int) UUID { h.Reset() - h.Write(space[:]) - h.Write(data) + h.Write(space[:]) //nolint:errcheck + h.Write(data) //nolint:errcheck s := h.Sum(nil) var uuid UUID copy(uuid[:], s) diff --git a/vendor/github.com/google/uuid/marshal.go b/vendor/github.com/google/uuid/marshal.go index 7f9e0c6c0e..14bd34072b 100644 --- a/vendor/github.com/google/uuid/marshal.go +++ b/vendor/github.com/google/uuid/marshal.go @@ -16,10 +16,11 @@ func (uuid UUID) MarshalText() ([]byte, error) { // UnmarshalText implements encoding.TextUnmarshaler. func (uuid *UUID) UnmarshalText(data []byte) error { id, err := ParseBytes(data) - if err == nil { - *uuid = id + if err != nil { + return err } - return err + *uuid = id + return nil } // MarshalBinary implements encoding.BinaryMarshaler. diff --git a/vendor/github.com/google/uuid/sql.go b/vendor/github.com/google/uuid/sql.go index f326b54db3..2e02ec06c0 100644 --- a/vendor/github.com/google/uuid/sql.go +++ b/vendor/github.com/google/uuid/sql.go @@ -9,7 +9,7 @@ import ( "fmt" ) -// Scan implements sql.Scanner so UUIDs can be read from databases transparently +// Scan implements sql.Scanner so UUIDs can be read from databases transparently. // Currently, database types that map to string and []byte are supported. Please // consult database-specific driver documentation for matching types. func (uuid *UUID) Scan(src interface{}) error { diff --git a/vendor/github.com/google/uuid/uuid.go b/vendor/github.com/google/uuid/uuid.go index 524404cc52..60d26bb50c 100644 --- a/vendor/github.com/google/uuid/uuid.go +++ b/vendor/github.com/google/uuid/uuid.go @@ -35,6 +35,12 @@ const ( var rander = rand.Reader // random function +type invalidLengthError struct{ len int } + +func (err invalidLengthError) Error() string { + return fmt.Sprintf("invalid UUID length: %d", err.len) +} + // Parse decodes s into a UUID or returns an error. Both the standard UUID // forms of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded as well as the @@ -68,7 +74,7 @@ func Parse(s string) (UUID, error) { } return uuid, nil default: - return uuid, fmt.Errorf("invalid UUID length: %d", len(s)) + return uuid, invalidLengthError{len(s)} } // s is now at least 36 bytes long // it must be of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx @@ -112,7 +118,7 @@ func ParseBytes(b []byte) (UUID, error) { } return uuid, nil default: - return uuid, fmt.Errorf("invalid UUID length: %d", len(b)) + return uuid, invalidLengthError{len(b)} } // s is now at least 36 bytes long // it must be of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx diff --git a/vendor/github.com/google/uuid/version1.go b/vendor/github.com/google/uuid/version1.go index 199a1ac654..463109629e 100644 --- a/vendor/github.com/google/uuid/version1.go +++ b/vendor/github.com/google/uuid/version1.go @@ -17,12 +17,6 @@ import ( // // In most cases, New should be used. func NewUUID() (UUID, error) { - nodeMu.Lock() - if nodeID == zeroID { - setNodeInterface("") - } - nodeMu.Unlock() - var uuid UUID now, seq, err := GetTime() if err != nil { @@ -38,7 +32,13 @@ func NewUUID() (UUID, error) { binary.BigEndian.PutUint16(uuid[4:], timeMid) binary.BigEndian.PutUint16(uuid[6:], timeHi) binary.BigEndian.PutUint16(uuid[8:], seq) + + nodeMu.Lock() + if nodeID == zeroID { + setNodeInterface("") + } copy(uuid[10:], nodeID[:]) + nodeMu.Unlock() return uuid, nil } diff --git a/vendor/github.com/google/uuid/version4.go b/vendor/github.com/google/uuid/version4.go index 84af91c9f5..86160fbd07 100644 --- a/vendor/github.com/google/uuid/version4.go +++ b/vendor/github.com/google/uuid/version4.go @@ -14,6 +14,14 @@ func New() UUID { return Must(NewRandom()) } +// NewString creates a new random UUID and returns it as a string or panics. +// NewString is equivalent to the expression +// +// uuid.New().String() +func NewString() string { + return Must(NewRandom()).String() +} + // NewRandom returns a Random (Version 4) UUID. // // The strength of the UUIDs is based on the strength of the crypto/rand @@ -27,8 +35,13 @@ func New() UUID { // equivalent to the odds of creating a few tens of trillions of UUIDs in a // year and having one duplicate. func NewRandom() (UUID, error) { + return NewRandomFromReader(rander) +} + +// NewRandomFromReader returns a UUID based on bytes read from a given io.Reader. +func NewRandomFromReader(r io.Reader) (UUID, error) { var uuid UUID - _, err := io.ReadFull(rander, uuid[:]) + _, err := io.ReadFull(r, uuid[:]) if err != nil { return Nil, err } diff --git a/vendor/github.com/klauspost/compress/flate/deflate.go b/vendor/github.com/klauspost/compress/flate/deflate.go index d9948ab409..25dbe3e15f 100644 --- a/vendor/github.com/klauspost/compress/flate/deflate.go +++ b/vendor/github.com/klauspost/compress/flate/deflate.go @@ -48,6 +48,8 @@ const ( maxHashOffset = 1 << 24 skipNever = math.MaxInt32 + + debugDeflate = false ) type compressionLevel struct { @@ -59,15 +61,13 @@ type compressionLevel struct { // See https://blog.klauspost.com/rebalancing-deflate-compression-levels/ var levels = []compressionLevel{ {}, // 0 - // Level 1-4 uses specialized algorithm - values not used + // Level 1-6 uses specialized algorithm - values not used {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 2}, {0, 0, 0, 0, 0, 3}, {0, 0, 0, 0, 0, 4}, - // For levels 5-6 we don't bother trying with lazy matches. - // Lazy matching is at least 30% slower, with 1.5% increase. - {6, 0, 12, 8, 12, 5}, - {8, 0, 24, 16, 16, 6}, + {0, 0, 0, 0, 0, 5}, + {0, 0, 0, 0, 0, 6}, // Levels 7-9 use increasingly more lazy matching // and increasingly stringent conditions for "good enough". {8, 8, 24, 16, skipNever, 7}, @@ -80,9 +80,7 @@ type advancedState struct { // deflate state length int offset int - hash uint32 maxInsertIndex int - ii uint16 // position of last match, intended to overflow to reset. // Input hash chains // hashHead[hashValue] contains the largest inputIndex with the specified hash value @@ -97,6 +95,9 @@ type advancedState struct { // input window: unprocessed data is window[index:windowEnd] index int hashMatch [maxMatchLength + minMatchLength]uint32 + + hash uint32 + ii uint16 // position of last match, intended to overflow to reset. } type compressor struct { @@ -107,18 +108,19 @@ type compressor struct { // compression algorithm fill func(*compressor, []byte) int // copy data to window step func(*compressor) // process window - sync bool // requesting flush - window []byte - windowEnd int - blockStart int // window index where current tokens start - byteAvailable bool // if true, still need to process window[index-1]. - err error + window []byte + windowEnd int + blockStart int // window index where current tokens start + err error // queued output tokens tokens tokens fast fastEnc state *advancedState + + sync bool // requesting flush + byteAvailable bool // if true, still need to process window[index-1]. } func (d *compressor) fillDeflate(b []byte) int { @@ -203,9 +205,8 @@ func (d *compressor) writeBlockSkip(tok *tokens, index int, eof bool) error { // This is much faster than doing a full encode. // Should only be used after a start/reset. func (d *compressor) fillWindow(b []byte) { - // Do not fill window if we are in store-only mode, - // use constant or Snappy compression. - if d.level == 0 { + // Do not fill window if we are in store-only or huffman mode. + if d.level <= 0 { return } if d.fast != nil { @@ -368,7 +369,7 @@ func (d *compressor) deflateLazy() { // Sanity enables additional runtime tests. // It's intended to be used during development // to supplement the currently ad-hoc unit tests. - const sanity = false + const sanity = debugDeflate if d.windowEnd-s.index < minMatchLength+maxMatchLength && !d.sync { return @@ -667,6 +668,7 @@ func (d *compressor) init(w io.Writer, level int) (err error) { default: return fmt.Errorf("flate: invalid compression level %d: want value in range [-2, 9]", level) } + d.level = level return nil } @@ -720,6 +722,7 @@ func (d *compressor) close() error { return d.w.err } d.w.flush() + d.w.reset(nil) return d.w.err } @@ -750,8 +753,7 @@ func NewWriter(w io.Writer, level int) (*Writer, error) { // can only be decompressed by a Reader initialized with the // same dictionary. func NewWriterDict(w io.Writer, level int, dict []byte) (*Writer, error) { - dw := &dictWriter{w} - zw, err := NewWriter(dw, level) + zw, err := NewWriter(w, level) if err != nil { return nil, err } @@ -760,14 +762,6 @@ func NewWriterDict(w io.Writer, level int, dict []byte) (*Writer, error) { return zw, err } -type dictWriter struct { - w io.Writer -} - -func (w *dictWriter) Write(b []byte) (n int, err error) { - return w.w.Write(b) -} - // A Writer takes data written to it and writes the compressed // form of that data to an underlying writer (see NewWriter). type Writer struct { @@ -805,11 +799,12 @@ func (w *Writer) Close() error { // the result of NewWriter or NewWriterDict called with dst // and w's level and dictionary. func (w *Writer) Reset(dst io.Writer) { - if dw, ok := w.d.w.writer.(*dictWriter); ok { + if len(w.dict) > 0 { // w was created with NewWriterDict - dw.w = dst - w.d.reset(dw) - w.d.fillWindow(w.dict) + w.d.reset(dst) + if dst != nil { + w.d.fillWindow(w.dict) + } } else { // w was created with NewWriter w.d.reset(dst) diff --git a/vendor/github.com/klauspost/compress/flate/fast_encoder.go b/vendor/github.com/klauspost/compress/flate/fast_encoder.go index 3d2fdcd77a..6d4c1e98bc 100644 --- a/vendor/github.com/klauspost/compress/flate/fast_encoder.go +++ b/vendor/github.com/klauspost/compress/flate/fast_encoder.go @@ -35,16 +35,16 @@ func newFastEnc(level int) fastEnc { } const ( - tableBits = 16 // Bits used in the table + tableBits = 15 // Bits used in the table tableSize = 1 << tableBits // Size of the table tableShift = 32 - tableBits // Right-shift to get the tableBits most significant bits of a uint32. baseMatchOffset = 1 // The smallest match offset baseMatchLength = 3 // The smallest match length per the RFC section 3.2.5 maxMatchOffset = 1 << 15 // The largest match offset - bTableBits = 18 // Bits used in the big tables + bTableBits = 17 // Bits used in the big tables bTableSize = 1 << bTableBits // Size of the table - allocHistory = maxStoreBlockSize * 20 // Size to preallocate for history. + allocHistory = maxStoreBlockSize * 10 // Size to preallocate for history. bufferReset = (1 << 31) - allocHistory - maxStoreBlockSize - 1 // Reset the buffer offset when reaching this. ) @@ -92,7 +92,6 @@ func hash(u uint32) uint32 { } type tableEntry struct { - val uint32 offset int32 } diff --git a/vendor/github.com/klauspost/compress/flate/gen_inflate.go b/vendor/github.com/klauspost/compress/flate/gen_inflate.go new file mode 100644 index 0000000000..c74a95fe7f --- /dev/null +++ b/vendor/github.com/klauspost/compress/flate/gen_inflate.go @@ -0,0 +1,274 @@ +// +build generate + +//go:generate go run $GOFILE && gofmt -w inflate_gen.go + +package main + +import ( + "os" + "strings" +) + +func main() { + f, err := os.Create("inflate_gen.go") + if err != nil { + panic(err) + } + defer f.Close() + types := []string{"*bytes.Buffer", "*bytes.Reader", "*bufio.Reader", "*strings.Reader"} + names := []string{"BytesBuffer", "BytesReader", "BufioReader", "StringsReader"} + imports := []string{"bytes", "bufio", "io", "strings", "math/bits"} + f.WriteString(`// Code generated by go generate gen_inflate.go. DO NOT EDIT. + +package flate + +import ( +`) + + for _, imp := range imports { + f.WriteString("\t\"" + imp + "\"\n") + } + f.WriteString(")\n\n") + + template := ` + +// Decode a single Huffman block from f. +// hl and hd are the Huffman states for the lit/length values +// and the distance values, respectively. If hd == nil, using the +// fixed distance encoding associated with fixed Huffman blocks. +func (f *decompressor) $FUNCNAME$() { + const ( + stateInit = iota // Zero value must be stateInit + stateDict + ) + fr := f.r.($TYPE$) + moreBits := func() error { + c, err := fr.ReadByte() + if err != nil { + return noEOF(err) + } + f.roffset++ + f.b |= uint32(c) << f.nb + f.nb += 8 + return nil + } + + switch f.stepState { + case stateInit: + goto readLiteral + case stateDict: + goto copyHistory + } + +readLiteral: + // Read literal and/or (length, distance) according to RFC section 3.2.3. + { + var v int + { + // Inlined v, err := f.huffSym(f.hl) + // Since a huffmanDecoder can be empty or be composed of a degenerate tree + // with single element, huffSym must error on these two edge cases. In both + // cases, the chunks slice will be 0 for the invalid sequence, leading it + // satisfy the n == 0 check below. + n := uint(f.hl.maxRead) + // Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers, + // but is smart enough to keep local variables in registers, so use nb and b, + // inline call to moreBits and reassign b,nb back to f on return. + nb, b := f.nb, f.b + for { + for nb < n { + c, err := fr.ReadByte() + if err != nil { + f.b = b + f.nb = nb + f.err = noEOF(err) + return + } + f.roffset++ + b |= uint32(c) << (nb & 31) + nb += 8 + } + chunk := f.hl.chunks[b&(huffmanNumChunks-1)] + n = uint(chunk & huffmanCountMask) + if n > huffmanChunkBits { + chunk = f.hl.links[chunk>>huffmanValueShift][(b>>huffmanChunkBits)&f.hl.linkMask] + n = uint(chunk & huffmanCountMask) + } + if n <= nb { + if n == 0 { + f.b = b + f.nb = nb + if debugDecode { + fmt.Println("huffsym: n==0") + } + f.err = CorruptInputError(f.roffset) + return + } + f.b = b >> (n & 31) + f.nb = nb - n + v = int(chunk >> huffmanValueShift) + break + } + } + } + + var n uint // number of bits extra + var length int + var err error + switch { + case v < 256: + f.dict.writeByte(byte(v)) + if f.dict.availWrite() == 0 { + f.toRead = f.dict.readFlush() + f.step = (*decompressor).$FUNCNAME$ + f.stepState = stateInit + return + } + goto readLiteral + case v == 256: + f.finishBlock() + return + // otherwise, reference to older data + case v < 265: + length = v - (257 - 3) + n = 0 + case v < 269: + length = v*2 - (265*2 - 11) + n = 1 + case v < 273: + length = v*4 - (269*4 - 19) + n = 2 + case v < 277: + length = v*8 - (273*8 - 35) + n = 3 + case v < 281: + length = v*16 - (277*16 - 67) + n = 4 + case v < 285: + length = v*32 - (281*32 - 131) + n = 5 + case v < maxNumLit: + length = 258 + n = 0 + default: + if debugDecode { + fmt.Println(v, ">= maxNumLit") + } + f.err = CorruptInputError(f.roffset) + return + } + if n > 0 { + for f.nb < n { + if err = moreBits(); err != nil { + if debugDecode { + fmt.Println("morebits n>0:", err) + } + f.err = err + return + } + } + length += int(f.b & uint32(1<>= n + f.nb -= n + } + + var dist int + if f.hd == nil { + for f.nb < 5 { + if err = moreBits(); err != nil { + if debugDecode { + fmt.Println("morebits f.nb<5:", err) + } + f.err = err + return + } + } + dist = int(bits.Reverse8(uint8(f.b & 0x1F << 3))) + f.b >>= 5 + f.nb -= 5 + } else { + if dist, err = f.huffSym(f.hd); err != nil { + if debugDecode { + fmt.Println("huffsym:", err) + } + f.err = err + return + } + } + + switch { + case dist < 4: + dist++ + case dist < maxNumDist: + nb := uint(dist-2) >> 1 + // have 1 bit in bottom of dist, need nb more. + extra := (dist & 1) << nb + for f.nb < nb { + if err = moreBits(); err != nil { + if debugDecode { + fmt.Println("morebits f.nb>= nb + f.nb -= nb + dist = 1<<(nb+1) + 1 + extra + default: + if debugDecode { + fmt.Println("dist too big:", dist, maxNumDist) + } + f.err = CorruptInputError(f.roffset) + return + } + + // No check on length; encoding can be prescient. + if dist > f.dict.histSize() { + if debugDecode { + fmt.Println("dist > f.dict.histSize():", dist, f.dict.histSize()) + } + f.err = CorruptInputError(f.roffset) + return + } + + f.copyLen, f.copyDist = length, dist + goto copyHistory + } + +copyHistory: + // Perform a backwards copy according to RFC section 3.2.3. + { + cnt := f.dict.tryWriteCopy(f.copyDist, f.copyLen) + if cnt == 0 { + cnt = f.dict.writeCopy(f.copyDist, f.copyLen) + } + f.copyLen -= cnt + + if f.dict.availWrite() == 0 || f.copyLen > 0 { + f.toRead = f.dict.readFlush() + f.step = (*decompressor).$FUNCNAME$ // We need to continue this work + f.stepState = stateDict + return + } + goto readLiteral + } +} + +` + for i, t := range types { + s := strings.Replace(template, "$FUNCNAME$", "huffman"+names[i], -1) + s = strings.Replace(s, "$TYPE$", t, -1) + f.WriteString(s) + } + f.WriteString("func (f *decompressor) huffmanBlockDecoder() func() {\n") + f.WriteString("\tswitch f.r.(type) {\n") + for i, t := range types { + f.WriteString("\t\tcase " + t + ":\n") + f.WriteString("\t\t\treturn f.huffman" + names[i] + "\n") + } + f.WriteString("\t\tdefault:\n") + f.WriteString("\t\t\treturn f.huffmanBlockGeneric") + f.WriteString("\t}\n}\n") +} diff --git a/vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go b/vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go index 56ee6dc8ba..53fe1d06e2 100644 --- a/vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go +++ b/vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go @@ -484,6 +484,9 @@ func (w *huffmanBitWriter) writeDynamicHeader(numLiterals int, numOffsets int, n } } +// writeStoredHeader will write a stored header. +// If the stored block is only used for EOF, +// it is replaced with a fixed huffman block. func (w *huffmanBitWriter) writeStoredHeader(length int, isEof bool) { if w.err != nil { return @@ -493,6 +496,16 @@ func (w *huffmanBitWriter) writeStoredHeader(length int, isEof bool) { w.writeCode(w.literalEncoding.codes[endBlockMarker]) w.lastHeader = 0 } + + // To write EOF, use a fixed encoding block. 10 bits instead of 5 bytes. + if length == 0 && isEof { + w.writeFixedHeader(isEof) + // EOB: 7 bits, value: 0 + w.writeBits(0, 7) + w.flush() + return + } + var flag int32 if isEof { flag = 1 diff --git a/vendor/github.com/klauspost/compress/flate/huffman_code.go b/vendor/github.com/klauspost/compress/flate/huffman_code.go index 9d8e81ad69..4c39a30187 100644 --- a/vendor/github.com/klauspost/compress/flate/huffman_code.go +++ b/vendor/github.com/klauspost/compress/flate/huffman_code.go @@ -109,8 +109,8 @@ func generateFixedOffsetEncoding() *huffmanEncoder { return h } -var fixedLiteralEncoding *huffmanEncoder = generateFixedLiteralEncoding() -var fixedOffsetEncoding *huffmanEncoder = generateFixedOffsetEncoding() +var fixedLiteralEncoding = generateFixedLiteralEncoding() +var fixedOffsetEncoding = generateFixedOffsetEncoding() func (h *huffmanEncoder) bitLength(freq []uint16) int { var total int diff --git a/vendor/github.com/klauspost/compress/flate/inflate.go b/vendor/github.com/klauspost/compress/flate/inflate.go index 6dc5b5d06e..3e4259f157 100644 --- a/vendor/github.com/klauspost/compress/flate/inflate.go +++ b/vendor/github.com/klauspost/compress/flate/inflate.go @@ -106,7 +106,7 @@ const ( ) type huffmanDecoder struct { - min int // the minimum code length + maxRead int // the maximum number of bits we can read and not overread chunks *[huffmanNumChunks]uint16 // chunks as described above links [][]uint16 // overflow links linkMask uint32 // mask the width of the link table @@ -126,12 +126,12 @@ func (h *huffmanDecoder) init(lengths []int) bool { if h.chunks == nil { h.chunks = &[huffmanNumChunks]uint16{} } - if h.min != 0 { + if h.maxRead != 0 { *h = huffmanDecoder{chunks: h.chunks, links: h.links} } // Count number of codes of each length, - // compute min and max length. + // compute maxRead and max length. var count [maxCodeLen]int var min, max int for _, n := range lengths { @@ -178,7 +178,7 @@ func (h *huffmanDecoder) init(lengths []int) bool { return false } - h.min = min + h.maxRead = min chunks := h.chunks[:] for i := range chunks { chunks[i] = 0 @@ -295,10 +295,6 @@ type decompressor struct { r Reader roffset int64 - // Input bits, in top of b. - b uint32 - nb uint - // Huffman decoders for literal/length, distance. h1, h2 huffmanDecoder @@ -309,19 +305,24 @@ type decompressor struct { // Output history, buffer. dict dictDecoder - // Temporary buffer (avoids repeated allocation). - buf [4]byte - // Next step in the decompression, // and decompression state. step func(*decompressor) stepState int - final bool err error toRead []byte hl, hd *huffmanDecoder copyLen int copyDist int + + // Temporary buffer (avoids repeated allocation). + buf [4]byte + + // Input bits, in top of b. + b uint32 + + nb uint + final bool } func (f *decompressor) nextBlock() { @@ -342,7 +343,7 @@ func (f *decompressor) nextBlock() { // compressed, fixed Huffman tables f.hl = &fixedHuffmanDecoder f.hd = nil - f.huffmanBlock() + f.huffmanBlockDecoder()() case 2: // compressed, dynamic Huffman tables if f.err = f.readHuffman(); f.err != nil { @@ -350,7 +351,7 @@ func (f *decompressor) nextBlock() { } f.hl = &f.h1 f.hd = &f.h2 - f.huffmanBlock() + f.huffmanBlockDecoder()() default: // 3 is reserved. if debugDecode { @@ -543,12 +544,18 @@ func (f *decompressor) readHuffman() error { return CorruptInputError(f.roffset) } - // As an optimization, we can initialize the min bits to read at a time + // As an optimization, we can initialize the maxRead bits to read at a time // for the HLIT tree to the length of the EOB marker since we know that // every block must terminate with one. This preserves the property that // we never read any extra bytes after the end of the DEFLATE stream. - if f.h1.min < f.bits[endBlockMarker] { - f.h1.min = f.bits[endBlockMarker] + if f.h1.maxRead < f.bits[endBlockMarker] { + f.h1.maxRead = f.bits[endBlockMarker] + } + if !f.final { + // If not the final block, the smallest block possible is + // a predefined table, BTYPE=01, with a single EOB marker. + // This will take up 3 + 7 bits. + f.h1.maxRead += 10 } return nil @@ -558,7 +565,7 @@ func (f *decompressor) readHuffman() error { // hl and hd are the Huffman states for the lit/length values // and the distance values, respectively. If hd == nil, using the // fixed distance encoding associated with fixed Huffman blocks. -func (f *decompressor) huffmanBlock() { +func (f *decompressor) huffmanBlockGeneric() { const ( stateInit = iota // Zero value must be stateInit stateDict @@ -574,19 +581,64 @@ func (f *decompressor) huffmanBlock() { readLiteral: // Read literal and/or (length, distance) according to RFC section 3.2.3. { - v, err := f.huffSym(f.hl) - if err != nil { - f.err = err - return + var v int + { + // Inlined v, err := f.huffSym(f.hl) + // Since a huffmanDecoder can be empty or be composed of a degenerate tree + // with single element, huffSym must error on these two edge cases. In both + // cases, the chunks slice will be 0 for the invalid sequence, leading it + // satisfy the n == 0 check below. + n := uint(f.hl.maxRead) + // Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers, + // but is smart enough to keep local variables in registers, so use nb and b, + // inline call to moreBits and reassign b,nb back to f on return. + nb, b := f.nb, f.b + for { + for nb < n { + c, err := f.r.ReadByte() + if err != nil { + f.b = b + f.nb = nb + f.err = noEOF(err) + return + } + f.roffset++ + b |= uint32(c) << (nb & 31) + nb += 8 + } + chunk := f.hl.chunks[b&(huffmanNumChunks-1)] + n = uint(chunk & huffmanCountMask) + if n > huffmanChunkBits { + chunk = f.hl.links[chunk>>huffmanValueShift][(b>>huffmanChunkBits)&f.hl.linkMask] + n = uint(chunk & huffmanCountMask) + } + if n <= nb { + if n == 0 { + f.b = b + f.nb = nb + if debugDecode { + fmt.Println("huffsym: n==0") + } + f.err = CorruptInputError(f.roffset) + return + } + f.b = b >> (n & 31) + f.nb = nb - n + v = int(chunk >> huffmanValueShift) + break + } + } } + var n uint // number of bits extra var length int + var err error switch { case v < 256: f.dict.writeByte(byte(v)) if f.dict.availWrite() == 0 { f.toRead = f.dict.readFlush() - f.step = (*decompressor).huffmanBlock + f.step = (*decompressor).huffmanBlockGeneric f.stepState = stateInit return } @@ -714,7 +766,7 @@ copyHistory: if f.dict.availWrite() == 0 || f.copyLen > 0 { f.toRead = f.dict.readFlush() - f.step = (*decompressor).huffmanBlock // We need to continue this work + f.step = (*decompressor).huffmanBlockGeneric // We need to continue this work f.stepState = stateDict return } @@ -726,21 +778,33 @@ copyHistory: func (f *decompressor) dataBlock() { // Uncompressed. // Discard current half-byte. - f.nb = 0 - f.b = 0 + left := (f.nb) & 7 + f.nb -= left + f.b >>= left + + offBytes := f.nb >> 3 + // Unfilled values will be overwritten. + f.buf[0] = uint8(f.b) + f.buf[1] = uint8(f.b >> 8) + f.buf[2] = uint8(f.b >> 16) + f.buf[3] = uint8(f.b >> 24) + + f.roffset += int64(offBytes) + f.nb, f.b = 0, 0 // Length then ones-complement of length. - nr, err := io.ReadFull(f.r, f.buf[0:4]) + nr, err := io.ReadFull(f.r, f.buf[offBytes:4]) f.roffset += int64(nr) if err != nil { f.err = noEOF(err) return } - n := int(f.buf[0]) | int(f.buf[1])<<8 - nn := int(f.buf[2]) | int(f.buf[3])<<8 - if uint16(nn) != uint16(^n) { + n := uint16(f.buf[0]) | uint16(f.buf[1])<<8 + nn := uint16(f.buf[2]) | uint16(f.buf[3])<<8 + if nn != ^n { if debugDecode { - fmt.Println("uint16(nn) != uint16(^n)", nn, ^n) + ncomp := ^n + fmt.Println("uint16(nn) != uint16(^n)", nn, ncomp) } f.err = CorruptInputError(f.roffset) return @@ -752,7 +816,7 @@ func (f *decompressor) dataBlock() { return } - f.copyLen = n + f.copyLen = int(n) f.copyData() } @@ -816,7 +880,7 @@ func (f *decompressor) huffSym(h *huffmanDecoder) (int, error) { // with single element, huffSym must error on these two edge cases. In both // cases, the chunks slice will be 0 for the invalid sequence, leading it // satisfy the n == 0 check below. - n := uint(h.min) + n := uint(h.maxRead) // Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers, // but is smart enough to keep local variables in registers, so use nb and b, // inline call to moreBits and reassign b,nb back to f on return. diff --git a/vendor/github.com/klauspost/compress/flate/inflate_gen.go b/vendor/github.com/klauspost/compress/flate/inflate_gen.go new file mode 100644 index 0000000000..397dc1b1a1 --- /dev/null +++ b/vendor/github.com/klauspost/compress/flate/inflate_gen.go @@ -0,0 +1,922 @@ +// Code generated by go generate gen_inflate.go. DO NOT EDIT. + +package flate + +import ( + "bufio" + "bytes" + "fmt" + "math/bits" + "strings" +) + +// Decode a single Huffman block from f. +// hl and hd are the Huffman states for the lit/length values +// and the distance values, respectively. If hd == nil, using the +// fixed distance encoding associated with fixed Huffman blocks. +func (f *decompressor) huffmanBytesBuffer() { + const ( + stateInit = iota // Zero value must be stateInit + stateDict + ) + fr := f.r.(*bytes.Buffer) + moreBits := func() error { + c, err := fr.ReadByte() + if err != nil { + return noEOF(err) + } + f.roffset++ + f.b |= uint32(c) << f.nb + f.nb += 8 + return nil + } + + switch f.stepState { + case stateInit: + goto readLiteral + case stateDict: + goto copyHistory + } + +readLiteral: + // Read literal and/or (length, distance) according to RFC section 3.2.3. + { + var v int + { + // Inlined v, err := f.huffSym(f.hl) + // Since a huffmanDecoder can be empty or be composed of a degenerate tree + // with single element, huffSym must error on these two edge cases. In both + // cases, the chunks slice will be 0 for the invalid sequence, leading it + // satisfy the n == 0 check below. + n := uint(f.hl.maxRead) + // Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers, + // but is smart enough to keep local variables in registers, so use nb and b, + // inline call to moreBits and reassign b,nb back to f on return. + nb, b := f.nb, f.b + for { + for nb < n { + c, err := fr.ReadByte() + if err != nil { + f.b = b + f.nb = nb + f.err = noEOF(err) + return + } + f.roffset++ + b |= uint32(c) << (nb & 31) + nb += 8 + } + chunk := f.hl.chunks[b&(huffmanNumChunks-1)] + n = uint(chunk & huffmanCountMask) + if n > huffmanChunkBits { + chunk = f.hl.links[chunk>>huffmanValueShift][(b>>huffmanChunkBits)&f.hl.linkMask] + n = uint(chunk & huffmanCountMask) + } + if n <= nb { + if n == 0 { + f.b = b + f.nb = nb + if debugDecode { + fmt.Println("huffsym: n==0") + } + f.err = CorruptInputError(f.roffset) + return + } + f.b = b >> (n & 31) + f.nb = nb - n + v = int(chunk >> huffmanValueShift) + break + } + } + } + + var n uint // number of bits extra + var length int + var err error + switch { + case v < 256: + f.dict.writeByte(byte(v)) + if f.dict.availWrite() == 0 { + f.toRead = f.dict.readFlush() + f.step = (*decompressor).huffmanBytesBuffer + f.stepState = stateInit + return + } + goto readLiteral + case v == 256: + f.finishBlock() + return + // otherwise, reference to older data + case v < 265: + length = v - (257 - 3) + n = 0 + case v < 269: + length = v*2 - (265*2 - 11) + n = 1 + case v < 273: + length = v*4 - (269*4 - 19) + n = 2 + case v < 277: + length = v*8 - (273*8 - 35) + n = 3 + case v < 281: + length = v*16 - (277*16 - 67) + n = 4 + case v < 285: + length = v*32 - (281*32 - 131) + n = 5 + case v < maxNumLit: + length = 258 + n = 0 + default: + if debugDecode { + fmt.Println(v, ">= maxNumLit") + } + f.err = CorruptInputError(f.roffset) + return + } + if n > 0 { + for f.nb < n { + if err = moreBits(); err != nil { + if debugDecode { + fmt.Println("morebits n>0:", err) + } + f.err = err + return + } + } + length += int(f.b & uint32(1<>= n + f.nb -= n + } + + var dist int + if f.hd == nil { + for f.nb < 5 { + if err = moreBits(); err != nil { + if debugDecode { + fmt.Println("morebits f.nb<5:", err) + } + f.err = err + return + } + } + dist = int(bits.Reverse8(uint8(f.b & 0x1F << 3))) + f.b >>= 5 + f.nb -= 5 + } else { + if dist, err = f.huffSym(f.hd); err != nil { + if debugDecode { + fmt.Println("huffsym:", err) + } + f.err = err + return + } + } + + switch { + case dist < 4: + dist++ + case dist < maxNumDist: + nb := uint(dist-2) >> 1 + // have 1 bit in bottom of dist, need nb more. + extra := (dist & 1) << nb + for f.nb < nb { + if err = moreBits(); err != nil { + if debugDecode { + fmt.Println("morebits f.nb>= nb + f.nb -= nb + dist = 1<<(nb+1) + 1 + extra + default: + if debugDecode { + fmt.Println("dist too big:", dist, maxNumDist) + } + f.err = CorruptInputError(f.roffset) + return + } + + // No check on length; encoding can be prescient. + if dist > f.dict.histSize() { + if debugDecode { + fmt.Println("dist > f.dict.histSize():", dist, f.dict.histSize()) + } + f.err = CorruptInputError(f.roffset) + return + } + + f.copyLen, f.copyDist = length, dist + goto copyHistory + } + +copyHistory: + // Perform a backwards copy according to RFC section 3.2.3. + { + cnt := f.dict.tryWriteCopy(f.copyDist, f.copyLen) + if cnt == 0 { + cnt = f.dict.writeCopy(f.copyDist, f.copyLen) + } + f.copyLen -= cnt + + if f.dict.availWrite() == 0 || f.copyLen > 0 { + f.toRead = f.dict.readFlush() + f.step = (*decompressor).huffmanBytesBuffer // We need to continue this work + f.stepState = stateDict + return + } + goto readLiteral + } +} + +// Decode a single Huffman block from f. +// hl and hd are the Huffman states for the lit/length values +// and the distance values, respectively. If hd == nil, using the +// fixed distance encoding associated with fixed Huffman blocks. +func (f *decompressor) huffmanBytesReader() { + const ( + stateInit = iota // Zero value must be stateInit + stateDict + ) + fr := f.r.(*bytes.Reader) + moreBits := func() error { + c, err := fr.ReadByte() + if err != nil { + return noEOF(err) + } + f.roffset++ + f.b |= uint32(c) << f.nb + f.nb += 8 + return nil + } + + switch f.stepState { + case stateInit: + goto readLiteral + case stateDict: + goto copyHistory + } + +readLiteral: + // Read literal and/or (length, distance) according to RFC section 3.2.3. + { + var v int + { + // Inlined v, err := f.huffSym(f.hl) + // Since a huffmanDecoder can be empty or be composed of a degenerate tree + // with single element, huffSym must error on these two edge cases. In both + // cases, the chunks slice will be 0 for the invalid sequence, leading it + // satisfy the n == 0 check below. + n := uint(f.hl.maxRead) + // Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers, + // but is smart enough to keep local variables in registers, so use nb and b, + // inline call to moreBits and reassign b,nb back to f on return. + nb, b := f.nb, f.b + for { + for nb < n { + c, err := fr.ReadByte() + if err != nil { + f.b = b + f.nb = nb + f.err = noEOF(err) + return + } + f.roffset++ + b |= uint32(c) << (nb & 31) + nb += 8 + } + chunk := f.hl.chunks[b&(huffmanNumChunks-1)] + n = uint(chunk & huffmanCountMask) + if n > huffmanChunkBits { + chunk = f.hl.links[chunk>>huffmanValueShift][(b>>huffmanChunkBits)&f.hl.linkMask] + n = uint(chunk & huffmanCountMask) + } + if n <= nb { + if n == 0 { + f.b = b + f.nb = nb + if debugDecode { + fmt.Println("huffsym: n==0") + } + f.err = CorruptInputError(f.roffset) + return + } + f.b = b >> (n & 31) + f.nb = nb - n + v = int(chunk >> huffmanValueShift) + break + } + } + } + + var n uint // number of bits extra + var length int + var err error + switch { + case v < 256: + f.dict.writeByte(byte(v)) + if f.dict.availWrite() == 0 { + f.toRead = f.dict.readFlush() + f.step = (*decompressor).huffmanBytesReader + f.stepState = stateInit + return + } + goto readLiteral + case v == 256: + f.finishBlock() + return + // otherwise, reference to older data + case v < 265: + length = v - (257 - 3) + n = 0 + case v < 269: + length = v*2 - (265*2 - 11) + n = 1 + case v < 273: + length = v*4 - (269*4 - 19) + n = 2 + case v < 277: + length = v*8 - (273*8 - 35) + n = 3 + case v < 281: + length = v*16 - (277*16 - 67) + n = 4 + case v < 285: + length = v*32 - (281*32 - 131) + n = 5 + case v < maxNumLit: + length = 258 + n = 0 + default: + if debugDecode { + fmt.Println(v, ">= maxNumLit") + } + f.err = CorruptInputError(f.roffset) + return + } + if n > 0 { + for f.nb < n { + if err = moreBits(); err != nil { + if debugDecode { + fmt.Println("morebits n>0:", err) + } + f.err = err + return + } + } + length += int(f.b & uint32(1<>= n + f.nb -= n + } + + var dist int + if f.hd == nil { + for f.nb < 5 { + if err = moreBits(); err != nil { + if debugDecode { + fmt.Println("morebits f.nb<5:", err) + } + f.err = err + return + } + } + dist = int(bits.Reverse8(uint8(f.b & 0x1F << 3))) + f.b >>= 5 + f.nb -= 5 + } else { + if dist, err = f.huffSym(f.hd); err != nil { + if debugDecode { + fmt.Println("huffsym:", err) + } + f.err = err + return + } + } + + switch { + case dist < 4: + dist++ + case dist < maxNumDist: + nb := uint(dist-2) >> 1 + // have 1 bit in bottom of dist, need nb more. + extra := (dist & 1) << nb + for f.nb < nb { + if err = moreBits(); err != nil { + if debugDecode { + fmt.Println("morebits f.nb>= nb + f.nb -= nb + dist = 1<<(nb+1) + 1 + extra + default: + if debugDecode { + fmt.Println("dist too big:", dist, maxNumDist) + } + f.err = CorruptInputError(f.roffset) + return + } + + // No check on length; encoding can be prescient. + if dist > f.dict.histSize() { + if debugDecode { + fmt.Println("dist > f.dict.histSize():", dist, f.dict.histSize()) + } + f.err = CorruptInputError(f.roffset) + return + } + + f.copyLen, f.copyDist = length, dist + goto copyHistory + } + +copyHistory: + // Perform a backwards copy according to RFC section 3.2.3. + { + cnt := f.dict.tryWriteCopy(f.copyDist, f.copyLen) + if cnt == 0 { + cnt = f.dict.writeCopy(f.copyDist, f.copyLen) + } + f.copyLen -= cnt + + if f.dict.availWrite() == 0 || f.copyLen > 0 { + f.toRead = f.dict.readFlush() + f.step = (*decompressor).huffmanBytesReader // We need to continue this work + f.stepState = stateDict + return + } + goto readLiteral + } +} + +// Decode a single Huffman block from f. +// hl and hd are the Huffman states for the lit/length values +// and the distance values, respectively. If hd == nil, using the +// fixed distance encoding associated with fixed Huffman blocks. +func (f *decompressor) huffmanBufioReader() { + const ( + stateInit = iota // Zero value must be stateInit + stateDict + ) + fr := f.r.(*bufio.Reader) + moreBits := func() error { + c, err := fr.ReadByte() + if err != nil { + return noEOF(err) + } + f.roffset++ + f.b |= uint32(c) << f.nb + f.nb += 8 + return nil + } + + switch f.stepState { + case stateInit: + goto readLiteral + case stateDict: + goto copyHistory + } + +readLiteral: + // Read literal and/or (length, distance) according to RFC section 3.2.3. + { + var v int + { + // Inlined v, err := f.huffSym(f.hl) + // Since a huffmanDecoder can be empty or be composed of a degenerate tree + // with single element, huffSym must error on these two edge cases. In both + // cases, the chunks slice will be 0 for the invalid sequence, leading it + // satisfy the n == 0 check below. + n := uint(f.hl.maxRead) + // Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers, + // but is smart enough to keep local variables in registers, so use nb and b, + // inline call to moreBits and reassign b,nb back to f on return. + nb, b := f.nb, f.b + for { + for nb < n { + c, err := fr.ReadByte() + if err != nil { + f.b = b + f.nb = nb + f.err = noEOF(err) + return + } + f.roffset++ + b |= uint32(c) << (nb & 31) + nb += 8 + } + chunk := f.hl.chunks[b&(huffmanNumChunks-1)] + n = uint(chunk & huffmanCountMask) + if n > huffmanChunkBits { + chunk = f.hl.links[chunk>>huffmanValueShift][(b>>huffmanChunkBits)&f.hl.linkMask] + n = uint(chunk & huffmanCountMask) + } + if n <= nb { + if n == 0 { + f.b = b + f.nb = nb + if debugDecode { + fmt.Println("huffsym: n==0") + } + f.err = CorruptInputError(f.roffset) + return + } + f.b = b >> (n & 31) + f.nb = nb - n + v = int(chunk >> huffmanValueShift) + break + } + } + } + + var n uint // number of bits extra + var length int + var err error + switch { + case v < 256: + f.dict.writeByte(byte(v)) + if f.dict.availWrite() == 0 { + f.toRead = f.dict.readFlush() + f.step = (*decompressor).huffmanBufioReader + f.stepState = stateInit + return + } + goto readLiteral + case v == 256: + f.finishBlock() + return + // otherwise, reference to older data + case v < 265: + length = v - (257 - 3) + n = 0 + case v < 269: + length = v*2 - (265*2 - 11) + n = 1 + case v < 273: + length = v*4 - (269*4 - 19) + n = 2 + case v < 277: + length = v*8 - (273*8 - 35) + n = 3 + case v < 281: + length = v*16 - (277*16 - 67) + n = 4 + case v < 285: + length = v*32 - (281*32 - 131) + n = 5 + case v < maxNumLit: + length = 258 + n = 0 + default: + if debugDecode { + fmt.Println(v, ">= maxNumLit") + } + f.err = CorruptInputError(f.roffset) + return + } + if n > 0 { + for f.nb < n { + if err = moreBits(); err != nil { + if debugDecode { + fmt.Println("morebits n>0:", err) + } + f.err = err + return + } + } + length += int(f.b & uint32(1<>= n + f.nb -= n + } + + var dist int + if f.hd == nil { + for f.nb < 5 { + if err = moreBits(); err != nil { + if debugDecode { + fmt.Println("morebits f.nb<5:", err) + } + f.err = err + return + } + } + dist = int(bits.Reverse8(uint8(f.b & 0x1F << 3))) + f.b >>= 5 + f.nb -= 5 + } else { + if dist, err = f.huffSym(f.hd); err != nil { + if debugDecode { + fmt.Println("huffsym:", err) + } + f.err = err + return + } + } + + switch { + case dist < 4: + dist++ + case dist < maxNumDist: + nb := uint(dist-2) >> 1 + // have 1 bit in bottom of dist, need nb more. + extra := (dist & 1) << nb + for f.nb < nb { + if err = moreBits(); err != nil { + if debugDecode { + fmt.Println("morebits f.nb>= nb + f.nb -= nb + dist = 1<<(nb+1) + 1 + extra + default: + if debugDecode { + fmt.Println("dist too big:", dist, maxNumDist) + } + f.err = CorruptInputError(f.roffset) + return + } + + // No check on length; encoding can be prescient. + if dist > f.dict.histSize() { + if debugDecode { + fmt.Println("dist > f.dict.histSize():", dist, f.dict.histSize()) + } + f.err = CorruptInputError(f.roffset) + return + } + + f.copyLen, f.copyDist = length, dist + goto copyHistory + } + +copyHistory: + // Perform a backwards copy according to RFC section 3.2.3. + { + cnt := f.dict.tryWriteCopy(f.copyDist, f.copyLen) + if cnt == 0 { + cnt = f.dict.writeCopy(f.copyDist, f.copyLen) + } + f.copyLen -= cnt + + if f.dict.availWrite() == 0 || f.copyLen > 0 { + f.toRead = f.dict.readFlush() + f.step = (*decompressor).huffmanBufioReader // We need to continue this work + f.stepState = stateDict + return + } + goto readLiteral + } +} + +// Decode a single Huffman block from f. +// hl and hd are the Huffman states for the lit/length values +// and the distance values, respectively. If hd == nil, using the +// fixed distance encoding associated with fixed Huffman blocks. +func (f *decompressor) huffmanStringsReader() { + const ( + stateInit = iota // Zero value must be stateInit + stateDict + ) + fr := f.r.(*strings.Reader) + moreBits := func() error { + c, err := fr.ReadByte() + if err != nil { + return noEOF(err) + } + f.roffset++ + f.b |= uint32(c) << f.nb + f.nb += 8 + return nil + } + + switch f.stepState { + case stateInit: + goto readLiteral + case stateDict: + goto copyHistory + } + +readLiteral: + // Read literal and/or (length, distance) according to RFC section 3.2.3. + { + var v int + { + // Inlined v, err := f.huffSym(f.hl) + // Since a huffmanDecoder can be empty or be composed of a degenerate tree + // with single element, huffSym must error on these two edge cases. In both + // cases, the chunks slice will be 0 for the invalid sequence, leading it + // satisfy the n == 0 check below. + n := uint(f.hl.maxRead) + // Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers, + // but is smart enough to keep local variables in registers, so use nb and b, + // inline call to moreBits and reassign b,nb back to f on return. + nb, b := f.nb, f.b + for { + for nb < n { + c, err := fr.ReadByte() + if err != nil { + f.b = b + f.nb = nb + f.err = noEOF(err) + return + } + f.roffset++ + b |= uint32(c) << (nb & 31) + nb += 8 + } + chunk := f.hl.chunks[b&(huffmanNumChunks-1)] + n = uint(chunk & huffmanCountMask) + if n > huffmanChunkBits { + chunk = f.hl.links[chunk>>huffmanValueShift][(b>>huffmanChunkBits)&f.hl.linkMask] + n = uint(chunk & huffmanCountMask) + } + if n <= nb { + if n == 0 { + f.b = b + f.nb = nb + if debugDecode { + fmt.Println("huffsym: n==0") + } + f.err = CorruptInputError(f.roffset) + return + } + f.b = b >> (n & 31) + f.nb = nb - n + v = int(chunk >> huffmanValueShift) + break + } + } + } + + var n uint // number of bits extra + var length int + var err error + switch { + case v < 256: + f.dict.writeByte(byte(v)) + if f.dict.availWrite() == 0 { + f.toRead = f.dict.readFlush() + f.step = (*decompressor).huffmanStringsReader + f.stepState = stateInit + return + } + goto readLiteral + case v == 256: + f.finishBlock() + return + // otherwise, reference to older data + case v < 265: + length = v - (257 - 3) + n = 0 + case v < 269: + length = v*2 - (265*2 - 11) + n = 1 + case v < 273: + length = v*4 - (269*4 - 19) + n = 2 + case v < 277: + length = v*8 - (273*8 - 35) + n = 3 + case v < 281: + length = v*16 - (277*16 - 67) + n = 4 + case v < 285: + length = v*32 - (281*32 - 131) + n = 5 + case v < maxNumLit: + length = 258 + n = 0 + default: + if debugDecode { + fmt.Println(v, ">= maxNumLit") + } + f.err = CorruptInputError(f.roffset) + return + } + if n > 0 { + for f.nb < n { + if err = moreBits(); err != nil { + if debugDecode { + fmt.Println("morebits n>0:", err) + } + f.err = err + return + } + } + length += int(f.b & uint32(1<>= n + f.nb -= n + } + + var dist int + if f.hd == nil { + for f.nb < 5 { + if err = moreBits(); err != nil { + if debugDecode { + fmt.Println("morebits f.nb<5:", err) + } + f.err = err + return + } + } + dist = int(bits.Reverse8(uint8(f.b & 0x1F << 3))) + f.b >>= 5 + f.nb -= 5 + } else { + if dist, err = f.huffSym(f.hd); err != nil { + if debugDecode { + fmt.Println("huffsym:", err) + } + f.err = err + return + } + } + + switch { + case dist < 4: + dist++ + case dist < maxNumDist: + nb := uint(dist-2) >> 1 + // have 1 bit in bottom of dist, need nb more. + extra := (dist & 1) << nb + for f.nb < nb { + if err = moreBits(); err != nil { + if debugDecode { + fmt.Println("morebits f.nb>= nb + f.nb -= nb + dist = 1<<(nb+1) + 1 + extra + default: + if debugDecode { + fmt.Println("dist too big:", dist, maxNumDist) + } + f.err = CorruptInputError(f.roffset) + return + } + + // No check on length; encoding can be prescient. + if dist > f.dict.histSize() { + if debugDecode { + fmt.Println("dist > f.dict.histSize():", dist, f.dict.histSize()) + } + f.err = CorruptInputError(f.roffset) + return + } + + f.copyLen, f.copyDist = length, dist + goto copyHistory + } + +copyHistory: + // Perform a backwards copy according to RFC section 3.2.3. + { + cnt := f.dict.tryWriteCopy(f.copyDist, f.copyLen) + if cnt == 0 { + cnt = f.dict.writeCopy(f.copyDist, f.copyLen) + } + f.copyLen -= cnt + + if f.dict.availWrite() == 0 || f.copyLen > 0 { + f.toRead = f.dict.readFlush() + f.step = (*decompressor).huffmanStringsReader // We need to continue this work + f.stepState = stateDict + return + } + goto readLiteral + } +} + +func (f *decompressor) huffmanBlockDecoder() func() { + switch f.r.(type) { + case *bytes.Buffer: + return f.huffmanBytesBuffer + case *bytes.Reader: + return f.huffmanBytesReader + case *bufio.Reader: + return f.huffmanBufioReader + case *strings.Reader: + return f.huffmanStringsReader + default: + return f.huffmanBlockGeneric + } +} diff --git a/vendor/github.com/klauspost/compress/flate/level1.go b/vendor/github.com/klauspost/compress/flate/level1.go index 102fc74c79..1e5eea3968 100644 --- a/vendor/github.com/klauspost/compress/flate/level1.go +++ b/vendor/github.com/klauspost/compress/flate/level1.go @@ -16,7 +16,7 @@ func (e *fastEncL1) Encode(dst *tokens, src []byte) { inputMargin = 12 - 1 minNonLiteralBlockSize = 1 + 1 + inputMargin ) - if debugDecode && e.cur < 0 { + if debugDeflate && e.cur < 0 { panic(fmt.Sprint("e.cur < 0: ", e.cur)) } @@ -81,12 +81,12 @@ func (e *fastEncL1) Encode(dst *tokens, src []byte) { } now := load6432(src, nextS) - e.table[nextHash] = tableEntry{offset: s + e.cur, val: cv} + e.table[nextHash] = tableEntry{offset: s + e.cur} nextHash = hash(uint32(now)) offset := s - (candidate.offset - e.cur) - if offset < maxMatchOffset && cv == candidate.val { - e.table[nextHash] = tableEntry{offset: nextS + e.cur, val: uint32(now)} + if offset < maxMatchOffset && cv == load3232(src, candidate.offset-e.cur) { + e.table[nextHash] = tableEntry{offset: nextS + e.cur} break } @@ -96,11 +96,11 @@ func (e *fastEncL1) Encode(dst *tokens, src []byte) { nextS++ candidate = e.table[nextHash] now >>= 8 - e.table[nextHash] = tableEntry{offset: s + e.cur, val: cv} + e.table[nextHash] = tableEntry{offset: s + e.cur} offset = s - (candidate.offset - e.cur) - if offset < maxMatchOffset && cv == candidate.val { - e.table[nextHash] = tableEntry{offset: nextS + e.cur, val: uint32(now)} + if offset < maxMatchOffset && cv == load3232(src, candidate.offset-e.cur) { + e.table[nextHash] = tableEntry{offset: nextS + e.cur} break } cv = uint32(now) @@ -139,7 +139,7 @@ func (e *fastEncL1) Encode(dst *tokens, src []byte) { // Index first pair after match end. if int(s+l+4) < len(src) { cv := load3232(src, s) - e.table[hash(cv)] = tableEntry{offset: s + e.cur, val: cv} + e.table[hash(cv)] = tableEntry{offset: s + e.cur} } goto emitRemainder } @@ -153,14 +153,14 @@ func (e *fastEncL1) Encode(dst *tokens, src []byte) { x := load6432(src, s-2) o := e.cur + s - 2 prevHash := hash(uint32(x)) - e.table[prevHash] = tableEntry{offset: o, val: uint32(x)} + e.table[prevHash] = tableEntry{offset: o} x >>= 16 currHash := hash(uint32(x)) candidate = e.table[currHash] - e.table[currHash] = tableEntry{offset: o + 2, val: uint32(x)} + e.table[currHash] = tableEntry{offset: o + 2} offset := s - (candidate.offset - e.cur) - if offset > maxMatchOffset || uint32(x) != candidate.val { + if offset > maxMatchOffset || uint32(x) != load3232(src, candidate.offset-e.cur) { cv = uint32(x >> 8) s++ break diff --git a/vendor/github.com/klauspost/compress/flate/level2.go b/vendor/github.com/klauspost/compress/flate/level2.go index dc6b1d3140..5b986a1944 100644 --- a/vendor/github.com/klauspost/compress/flate/level2.go +++ b/vendor/github.com/klauspost/compress/flate/level2.go @@ -18,7 +18,7 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) { minNonLiteralBlockSize = 1 + 1 + inputMargin ) - if debugDecode && e.cur < 0 { + if debugDeflate && e.cur < 0 { panic(fmt.Sprint("e.cur < 0: ", e.cur)) } @@ -83,12 +83,12 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) { } candidate = e.table[nextHash] now := load6432(src, nextS) - e.table[nextHash] = tableEntry{offset: s + e.cur, val: cv} + e.table[nextHash] = tableEntry{offset: s + e.cur} nextHash = hash4u(uint32(now), bTableBits) offset := s - (candidate.offset - e.cur) - if offset < maxMatchOffset && cv == candidate.val { - e.table[nextHash] = tableEntry{offset: nextS + e.cur, val: uint32(now)} + if offset < maxMatchOffset && cv == load3232(src, candidate.offset-e.cur) { + e.table[nextHash] = tableEntry{offset: nextS + e.cur} break } @@ -98,10 +98,10 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) { nextS++ candidate = e.table[nextHash] now >>= 8 - e.table[nextHash] = tableEntry{offset: s + e.cur, val: cv} + e.table[nextHash] = tableEntry{offset: s + e.cur} offset = s - (candidate.offset - e.cur) - if offset < maxMatchOffset && cv == candidate.val { + if offset < maxMatchOffset && cv == load3232(src, candidate.offset-e.cur) { break } cv = uint32(now) @@ -148,7 +148,7 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) { // Index first pair after match end. if int(s+l+4) < len(src) { cv := load3232(src, s) - e.table[hash4u(cv, bTableBits)] = tableEntry{offset: s + e.cur, val: cv} + e.table[hash4u(cv, bTableBits)] = tableEntry{offset: s + e.cur} } goto emitRemainder } @@ -157,15 +157,15 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) { for i := s - l + 2; i < s-5; i += 7 { x := load6432(src, int32(i)) nextHash := hash4u(uint32(x), bTableBits) - e.table[nextHash] = tableEntry{offset: e.cur + i, val: uint32(x)} + e.table[nextHash] = tableEntry{offset: e.cur + i} // Skip one x >>= 16 nextHash = hash4u(uint32(x), bTableBits) - e.table[nextHash] = tableEntry{offset: e.cur + i + 2, val: uint32(x)} + e.table[nextHash] = tableEntry{offset: e.cur + i + 2} // Skip one x >>= 16 nextHash = hash4u(uint32(x), bTableBits) - e.table[nextHash] = tableEntry{offset: e.cur + i + 4, val: uint32(x)} + e.table[nextHash] = tableEntry{offset: e.cur + i + 4} } // We could immediately start working at s now, but to improve @@ -178,14 +178,14 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) { o := e.cur + s - 2 prevHash := hash4u(uint32(x), bTableBits) prevHash2 := hash4u(uint32(x>>8), bTableBits) - e.table[prevHash] = tableEntry{offset: o, val: uint32(x)} - e.table[prevHash2] = tableEntry{offset: o + 1, val: uint32(x >> 8)} + e.table[prevHash] = tableEntry{offset: o} + e.table[prevHash2] = tableEntry{offset: o + 1} currHash := hash4u(uint32(x>>16), bTableBits) candidate = e.table[currHash] - e.table[currHash] = tableEntry{offset: o + 2, val: uint32(x >> 16)} + e.table[currHash] = tableEntry{offset: o + 2} offset := s - (candidate.offset - e.cur) - if offset > maxMatchOffset || uint32(x>>16) != candidate.val { + if offset > maxMatchOffset || uint32(x>>16) != load3232(src, candidate.offset-e.cur) { cv = uint32(x >> 24) s++ break diff --git a/vendor/github.com/klauspost/compress/flate/level3.go b/vendor/github.com/klauspost/compress/flate/level3.go index 1a3ff9b6b7..c22b4244a5 100644 --- a/vendor/github.com/klauspost/compress/flate/level3.go +++ b/vendor/github.com/klauspost/compress/flate/level3.go @@ -15,7 +15,7 @@ func (e *fastEncL3) Encode(dst *tokens, src []byte) { minNonLiteralBlockSize = 1 + 1 + inputMargin ) - if debugDecode && e.cur < 0 { + if debugDeflate && e.cur < 0 { panic(fmt.Sprint("e.cur < 0: ", e.cur)) } @@ -81,22 +81,26 @@ func (e *fastEncL3) Encode(dst *tokens, src []byte) { } candidates := e.table[nextHash] now := load3232(src, nextS) - e.table[nextHash] = tableEntryPrev{Prev: candidates.Cur, Cur: tableEntry{offset: s + e.cur, val: cv}} + + // Safe offset distance until s + 4... + minOffset := e.cur + s - (maxMatchOffset - 4) + e.table[nextHash] = tableEntryPrev{Prev: candidates.Cur, Cur: tableEntry{offset: s + e.cur}} // Check both candidates candidate = candidates.Cur - offset := s - (candidate.offset - e.cur) - if cv == candidate.val { - if offset > maxMatchOffset { - cv = now - // Previous will also be invalid, we have nothing. - continue - } - o2 := s - (candidates.Prev.offset - e.cur) - if cv != candidates.Prev.val || o2 > maxMatchOffset { + if candidate.offset < minOffset { + cv = now + // Previous will also be invalid, we have nothing. + continue + } + + if cv == load3232(src, candidate.offset-e.cur) { + if candidates.Prev.offset < minOffset || cv != load3232(src, candidates.Prev.offset-e.cur) { break } // Both match and are valid, pick longest. + offset := s - (candidate.offset - e.cur) + o2 := s - (candidates.Prev.offset - e.cur) l1, l2 := matchLen(src[s+4:], src[s-offset+4:]), matchLen(src[s+4:], src[s-o2+4:]) if l2 > l1 { candidate = candidates.Prev @@ -106,11 +110,8 @@ func (e *fastEncL3) Encode(dst *tokens, src []byte) { // We only check if value mismatches. // Offset will always be invalid in other cases. candidate = candidates.Prev - if cv == candidate.val { - offset := s - (candidate.offset - e.cur) - if offset <= maxMatchOffset { - break - } + if candidate.offset > minOffset && cv == load3232(src, candidate.offset-e.cur) { + break } } cv = now @@ -158,7 +159,7 @@ func (e *fastEncL3) Encode(dst *tokens, src []byte) { nextHash := hash(cv) e.table[nextHash] = tableEntryPrev{ Prev: e.table[nextHash].Cur, - Cur: tableEntry{offset: e.cur + t, val: cv}, + Cur: tableEntry{offset: e.cur + t}, } } goto emitRemainder @@ -170,21 +171,21 @@ func (e *fastEncL3) Encode(dst *tokens, src []byte) { prevHash := hash(uint32(x)) e.table[prevHash] = tableEntryPrev{ Prev: e.table[prevHash].Cur, - Cur: tableEntry{offset: e.cur + s - 3, val: uint32(x)}, + Cur: tableEntry{offset: e.cur + s - 3}, } x >>= 8 prevHash = hash(uint32(x)) e.table[prevHash] = tableEntryPrev{ Prev: e.table[prevHash].Cur, - Cur: tableEntry{offset: e.cur + s - 2, val: uint32(x)}, + Cur: tableEntry{offset: e.cur + s - 2}, } x >>= 8 prevHash = hash(uint32(x)) e.table[prevHash] = tableEntryPrev{ Prev: e.table[prevHash].Cur, - Cur: tableEntry{offset: e.cur + s - 1, val: uint32(x)}, + Cur: tableEntry{offset: e.cur + s - 1}, } x >>= 8 currHash := hash(uint32(x)) @@ -192,21 +193,18 @@ func (e *fastEncL3) Encode(dst *tokens, src []byte) { cv = uint32(x) e.table[currHash] = tableEntryPrev{ Prev: candidates.Cur, - Cur: tableEntry{offset: s + e.cur, val: cv}, + Cur: tableEntry{offset: s + e.cur}, } // Check both candidates candidate = candidates.Cur - if cv == candidate.val { - offset := s - (candidate.offset - e.cur) - if offset <= maxMatchOffset { - continue - } - } else { + minOffset := e.cur + s - (maxMatchOffset - 4) + + if candidate.offset > minOffset && cv != load3232(src, candidate.offset-e.cur) { // We only check if value mismatches. // Offset will always be invalid in other cases. candidate = candidates.Prev - if cv == candidate.val { + if candidate.offset > minOffset && cv == load3232(src, candidate.offset-e.cur) { offset := s - (candidate.offset - e.cur) if offset <= maxMatchOffset { continue diff --git a/vendor/github.com/klauspost/compress/flate/level4.go b/vendor/github.com/klauspost/compress/flate/level4.go index f3ecc9c4d5..e62f0c02b1 100644 --- a/vendor/github.com/klauspost/compress/flate/level4.go +++ b/vendor/github.com/klauspost/compress/flate/level4.go @@ -13,7 +13,7 @@ func (e *fastEncL4) Encode(dst *tokens, src []byte) { inputMargin = 12 - 1 minNonLiteralBlockSize = 1 + 1 + inputMargin ) - if debugDecode && e.cur < 0 { + if debugDeflate && e.cur < 0 { panic(fmt.Sprint("e.cur < 0: ", e.cur)) } // Protect against e.cur wraparound. @@ -92,24 +92,24 @@ func (e *fastEncL4) Encode(dst *tokens, src []byte) { sCandidate := e.table[nextHashS] lCandidate := e.bTable[nextHashL] next := load6432(src, nextS) - entry := tableEntry{offset: s + e.cur, val: uint32(cv)} + entry := tableEntry{offset: s + e.cur} e.table[nextHashS] = entry e.bTable[nextHashL] = entry t = lCandidate.offset - e.cur - if s-t < maxMatchOffset && uint32(cv) == lCandidate.val { + if s-t < maxMatchOffset && uint32(cv) == load3232(src, lCandidate.offset-e.cur) { // We got a long match. Use that. break } t = sCandidate.offset - e.cur - if s-t < maxMatchOffset && uint32(cv) == sCandidate.val { + if s-t < maxMatchOffset && uint32(cv) == load3232(src, sCandidate.offset-e.cur) { // Found a 4 match... lCandidate = e.bTable[hash7(next, tableBits)] // If the next long is a candidate, check if we should use that instead... lOff := nextS - (lCandidate.offset - e.cur) - if lOff < maxMatchOffset && lCandidate.val == uint32(next) { + if lOff < maxMatchOffset && load3232(src, lCandidate.offset-e.cur) == uint32(next) { l1, l2 := matchLen(src[s+4:], src[t+4:]), matchLen(src[nextS+4:], src[nextS-lOff+4:]) if l2 > l1 { s = nextS @@ -137,7 +137,7 @@ func (e *fastEncL4) Encode(dst *tokens, src []byte) { if nextEmit < s { emitLiteral(dst, src[nextEmit:s]) } - if false { + if debugDeflate { if t >= s { panic("s-t") } @@ -160,8 +160,8 @@ func (e *fastEncL4) Encode(dst *tokens, src []byte) { // Index first pair after match end. if int(s+8) < len(src) { cv := load6432(src, s) - e.table[hash4x64(cv, tableBits)] = tableEntry{offset: s + e.cur, val: uint32(cv)} - e.bTable[hash7(cv, tableBits)] = tableEntry{offset: s + e.cur, val: uint32(cv)} + e.table[hash4x64(cv, tableBits)] = tableEntry{offset: s + e.cur} + e.bTable[hash7(cv, tableBits)] = tableEntry{offset: s + e.cur} } goto emitRemainder } @@ -171,20 +171,20 @@ func (e *fastEncL4) Encode(dst *tokens, src []byte) { i := nextS if i < s-1 { cv := load6432(src, i) - t := tableEntry{offset: i + e.cur, val: uint32(cv)} - t2 := tableEntry{val: uint32(cv >> 8), offset: t.offset + 1} + t := tableEntry{offset: i + e.cur} + t2 := tableEntry{offset: t.offset + 1} e.bTable[hash7(cv, tableBits)] = t e.bTable[hash7(cv>>8, tableBits)] = t2 - e.table[hash4u(t2.val, tableBits)] = t2 + e.table[hash4u(uint32(cv>>8), tableBits)] = t2 i += 3 for ; i < s-1; i += 3 { cv := load6432(src, i) - t := tableEntry{offset: i + e.cur, val: uint32(cv)} - t2 := tableEntry{val: uint32(cv >> 8), offset: t.offset + 1} + t := tableEntry{offset: i + e.cur} + t2 := tableEntry{offset: t.offset + 1} e.bTable[hash7(cv, tableBits)] = t e.bTable[hash7(cv>>8, tableBits)] = t2 - e.table[hash4u(t2.val, tableBits)] = t2 + e.table[hash4u(uint32(cv>>8), tableBits)] = t2 } } } @@ -195,8 +195,8 @@ func (e *fastEncL4) Encode(dst *tokens, src []byte) { o := e.cur + s - 1 prevHashS := hash4x64(x, tableBits) prevHashL := hash7(x, tableBits) - e.table[prevHashS] = tableEntry{offset: o, val: uint32(x)} - e.bTable[prevHashL] = tableEntry{offset: o, val: uint32(x)} + e.table[prevHashS] = tableEntry{offset: o} + e.bTable[prevHashL] = tableEntry{offset: o} cv = x >> 8 } diff --git a/vendor/github.com/klauspost/compress/flate/level5.go b/vendor/github.com/klauspost/compress/flate/level5.go index 4e39168250..d513f1ffd3 100644 --- a/vendor/github.com/klauspost/compress/flate/level5.go +++ b/vendor/github.com/klauspost/compress/flate/level5.go @@ -13,7 +13,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) { inputMargin = 12 - 1 minNonLiteralBlockSize = 1 + 1 + inputMargin ) - if debugDecode && e.cur < 0 { + if debugDeflate && e.cur < 0 { panic(fmt.Sprint("e.cur < 0: ", e.cur)) } @@ -100,7 +100,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) { sCandidate := e.table[nextHashS] lCandidate := e.bTable[nextHashL] next := load6432(src, nextS) - entry := tableEntry{offset: s + e.cur, val: uint32(cv)} + entry := tableEntry{offset: s + e.cur} e.table[nextHashS] = entry eLong := &e.bTable[nextHashL] eLong.Cur, eLong.Prev = entry, eLong.Cur @@ -110,14 +110,14 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) { t = lCandidate.Cur.offset - e.cur if s-t < maxMatchOffset { - if uint32(cv) == lCandidate.Cur.val { + if uint32(cv) == load3232(src, lCandidate.Cur.offset-e.cur) { // Store the next match - e.table[nextHashS] = tableEntry{offset: nextS + e.cur, val: uint32(next)} + e.table[nextHashS] = tableEntry{offset: nextS + e.cur} eLong := &e.bTable[nextHashL] - eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur, val: uint32(next)}, eLong.Cur + eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur}, eLong.Cur t2 := lCandidate.Prev.offset - e.cur - if s-t2 < maxMatchOffset && uint32(cv) == lCandidate.Prev.val { + if s-t2 < maxMatchOffset && uint32(cv) == load3232(src, lCandidate.Prev.offset-e.cur) { l = e.matchlen(s+4, t+4, src) + 4 ml1 := e.matchlen(s+4, t2+4, src) + 4 if ml1 > l { @@ -129,30 +129,30 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) { break } t = lCandidate.Prev.offset - e.cur - if s-t < maxMatchOffset && uint32(cv) == lCandidate.Prev.val { + if s-t < maxMatchOffset && uint32(cv) == load3232(src, lCandidate.Prev.offset-e.cur) { // Store the next match - e.table[nextHashS] = tableEntry{offset: nextS + e.cur, val: uint32(next)} + e.table[nextHashS] = tableEntry{offset: nextS + e.cur} eLong := &e.bTable[nextHashL] - eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur, val: uint32(next)}, eLong.Cur + eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur}, eLong.Cur break } } t = sCandidate.offset - e.cur - if s-t < maxMatchOffset && uint32(cv) == sCandidate.val { + if s-t < maxMatchOffset && uint32(cv) == load3232(src, sCandidate.offset-e.cur) { // Found a 4 match... l = e.matchlen(s+4, t+4, src) + 4 lCandidate = e.bTable[nextHashL] // Store the next match - e.table[nextHashS] = tableEntry{offset: nextS + e.cur, val: uint32(next)} + e.table[nextHashS] = tableEntry{offset: nextS + e.cur} eLong := &e.bTable[nextHashL] - eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur, val: uint32(next)}, eLong.Cur + eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur}, eLong.Cur // If the next long is a candidate, use that... t2 := lCandidate.Cur.offset - e.cur if nextS-t2 < maxMatchOffset { - if lCandidate.Cur.val == uint32(next) { + if load3232(src, lCandidate.Cur.offset-e.cur) == uint32(next) { ml := e.matchlen(nextS+4, t2+4, src) + 4 if ml > l { t = t2 @@ -163,7 +163,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) { } // If the previous long is a candidate, use that... t2 = lCandidate.Prev.offset - e.cur - if nextS-t2 < maxMatchOffset && lCandidate.Prev.val == uint32(next) { + if nextS-t2 < maxMatchOffset && load3232(src, lCandidate.Prev.offset-e.cur) == uint32(next) { ml := e.matchlen(nextS+4, t2+4, src) + 4 if ml > l { t = t2 @@ -197,7 +197,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) { if nextEmit < s { emitLiteral(dst, src[nextEmit:s]) } - if false { + if debugDeflate { if t >= s { panic(fmt.Sprintln("s-t", s, t)) } @@ -226,31 +226,31 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) { i := s - l + 1 if i < s-1 { cv := load6432(src, i) - t := tableEntry{offset: i + e.cur, val: uint32(cv)} + t := tableEntry{offset: i + e.cur} e.table[hash4x64(cv, tableBits)] = t eLong := &e.bTable[hash7(cv, tableBits)] eLong.Cur, eLong.Prev = t, eLong.Cur // Do an long at i+1 cv >>= 8 - t = tableEntry{offset: t.offset + 1, val: uint32(cv)} + t = tableEntry{offset: t.offset + 1} eLong = &e.bTable[hash7(cv, tableBits)] eLong.Cur, eLong.Prev = t, eLong.Cur // We only have enough bits for a short entry at i+2 cv >>= 8 - t = tableEntry{offset: t.offset + 1, val: uint32(cv)} + t = tableEntry{offset: t.offset + 1} e.table[hash4x64(cv, tableBits)] = t // Skip one - otherwise we risk hitting 's' i += 4 for ; i < s-1; i += hashEvery { cv := load6432(src, i) - t := tableEntry{offset: i + e.cur, val: uint32(cv)} - t2 := tableEntry{offset: t.offset + 1, val: uint32(cv >> 8)} + t := tableEntry{offset: i + e.cur} + t2 := tableEntry{offset: t.offset + 1} eLong := &e.bTable[hash7(cv, tableBits)] eLong.Cur, eLong.Prev = t, eLong.Cur - e.table[hash4u(t2.val, tableBits)] = t2 + e.table[hash4u(uint32(cv>>8), tableBits)] = t2 } } } @@ -261,9 +261,9 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) { o := e.cur + s - 1 prevHashS := hash4x64(x, tableBits) prevHashL := hash7(x, tableBits) - e.table[prevHashS] = tableEntry{offset: o, val: uint32(x)} + e.table[prevHashS] = tableEntry{offset: o} eLong := &e.bTable[prevHashL] - eLong.Cur, eLong.Prev = tableEntry{offset: o, val: uint32(x)}, eLong.Cur + eLong.Cur, eLong.Prev = tableEntry{offset: o}, eLong.Cur cv = x >> 8 } diff --git a/vendor/github.com/klauspost/compress/flate/level6.go b/vendor/github.com/klauspost/compress/flate/level6.go index 00a3119776..a52c80ea45 100644 --- a/vendor/github.com/klauspost/compress/flate/level6.go +++ b/vendor/github.com/klauspost/compress/flate/level6.go @@ -13,7 +13,7 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { inputMargin = 12 - 1 minNonLiteralBlockSize = 1 + 1 + inputMargin ) - if debugDecode && e.cur < 0 { + if debugDeflate && e.cur < 0 { panic(fmt.Sprint("e.cur < 0: ", e.cur)) } @@ -101,7 +101,7 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { sCandidate := e.table[nextHashS] lCandidate := e.bTable[nextHashL] next := load6432(src, nextS) - entry := tableEntry{offset: s + e.cur, val: uint32(cv)} + entry := tableEntry{offset: s + e.cur} e.table[nextHashS] = entry eLong := &e.bTable[nextHashL] eLong.Cur, eLong.Prev = entry, eLong.Cur @@ -112,17 +112,17 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { t = lCandidate.Cur.offset - e.cur if s-t < maxMatchOffset { - if uint32(cv) == lCandidate.Cur.val { + if uint32(cv) == load3232(src, lCandidate.Cur.offset-e.cur) { // Long candidate matches at least 4 bytes. // Store the next match - e.table[nextHashS] = tableEntry{offset: nextS + e.cur, val: uint32(next)} + e.table[nextHashS] = tableEntry{offset: nextS + e.cur} eLong := &e.bTable[nextHashL] - eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur, val: uint32(next)}, eLong.Cur + eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur}, eLong.Cur // Check the previous long candidate as well. t2 := lCandidate.Prev.offset - e.cur - if s-t2 < maxMatchOffset && uint32(cv) == lCandidate.Prev.val { + if s-t2 < maxMatchOffset && uint32(cv) == load3232(src, lCandidate.Prev.offset-e.cur) { l = e.matchlen(s+4, t+4, src) + 4 ml1 := e.matchlen(s+4, t2+4, src) + 4 if ml1 > l { @@ -135,17 +135,17 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { } // Current value did not match, but check if previous long value does. t = lCandidate.Prev.offset - e.cur - if s-t < maxMatchOffset && uint32(cv) == lCandidate.Prev.val { + if s-t < maxMatchOffset && uint32(cv) == load3232(src, lCandidate.Prev.offset-e.cur) { // Store the next match - e.table[nextHashS] = tableEntry{offset: nextS + e.cur, val: uint32(next)} + e.table[nextHashS] = tableEntry{offset: nextS + e.cur} eLong := &e.bTable[nextHashL] - eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur, val: uint32(next)}, eLong.Cur + eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur}, eLong.Cur break } } t = sCandidate.offset - e.cur - if s-t < maxMatchOffset && uint32(cv) == sCandidate.val { + if s-t < maxMatchOffset && uint32(cv) == load3232(src, sCandidate.offset-e.cur) { // Found a 4 match... l = e.matchlen(s+4, t+4, src) + 4 @@ -153,9 +153,9 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { lCandidate = e.bTable[nextHashL] // Store the next match - e.table[nextHashS] = tableEntry{offset: nextS + e.cur, val: uint32(next)} + e.table[nextHashS] = tableEntry{offset: nextS + e.cur} eLong := &e.bTable[nextHashL] - eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur, val: uint32(next)}, eLong.Cur + eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur}, eLong.Cur // Check repeat at s + repOff const repOff = 1 @@ -174,7 +174,7 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { // If the next long is a candidate, use that... t2 = lCandidate.Cur.offset - e.cur if nextS-t2 < maxMatchOffset { - if lCandidate.Cur.val == uint32(next) { + if load3232(src, lCandidate.Cur.offset-e.cur) == uint32(next) { ml := e.matchlen(nextS+4, t2+4, src) + 4 if ml > l { t = t2 @@ -185,7 +185,7 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { } // If the previous long is a candidate, use that... t2 = lCandidate.Prev.offset - e.cur - if nextS-t2 < maxMatchOffset && lCandidate.Prev.val == uint32(next) { + if nextS-t2 < maxMatchOffset && load3232(src, lCandidate.Prev.offset-e.cur) == uint32(next) { ml := e.matchlen(nextS+4, t2+4, src) + 4 if ml > l { t = t2 @@ -244,9 +244,9 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { // Index after match end. for i := nextS + 1; i < int32(len(src))-8; i += 2 { cv := load6432(src, i) - e.table[hash4x64(cv, tableBits)] = tableEntry{offset: i + e.cur, val: uint32(cv)} + e.table[hash4x64(cv, tableBits)] = tableEntry{offset: i + e.cur} eLong := &e.bTable[hash7(cv, tableBits)] - eLong.Cur, eLong.Prev = tableEntry{offset: i + e.cur, val: uint32(cv)}, eLong.Cur + eLong.Cur, eLong.Prev = tableEntry{offset: i + e.cur}, eLong.Cur } goto emitRemainder } @@ -255,8 +255,8 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { if true { for i := nextS + 1; i < s-1; i += 2 { cv := load6432(src, i) - t := tableEntry{offset: i + e.cur, val: uint32(cv)} - t2 := tableEntry{offset: t.offset + 1, val: uint32(cv >> 8)} + t := tableEntry{offset: i + e.cur} + t2 := tableEntry{offset: t.offset + 1} eLong := &e.bTable[hash7(cv, tableBits)] eLong2 := &e.bTable[hash7(cv>>8, tableBits)] e.table[hash4x64(cv, tableBits)] = t diff --git a/vendor/github.com/klauspost/compress/flate/token.go b/vendor/github.com/klauspost/compress/flate/token.go index 099c0ddbc4..f9abf606d6 100644 --- a/vendor/github.com/klauspost/compress/flate/token.go +++ b/vendor/github.com/klauspost/compress/flate/token.go @@ -262,7 +262,7 @@ func (t *tokens) EstimatedBits() int { // AddMatch adds a match to the tokens. // This function is very sensitive to inlining and right on the border. func (t *tokens) AddMatch(xlength uint32, xoffset uint32) { - if debugDecode { + if debugDeflate { if xlength >= maxMatchLength+baseMatchLength { panic(fmt.Errorf("invalid length: %v", xlength)) } @@ -281,7 +281,7 @@ func (t *tokens) AddMatch(xlength uint32, xoffset uint32) { // AddMatchLong adds a match to the tokens, potentially longer than max match length. // Length should NOT have the base subtracted, only offset should. func (t *tokens) AddMatchLong(xlength int32, xoffset uint32) { - if debugDecode { + if debugDeflate { if xoffset >= maxMatchOffset+baseMatchOffset { panic(fmt.Errorf("invalid offset: %v", xoffset)) } diff --git a/vendor/github.com/klauspost/compress/fse/bitreader.go b/vendor/github.com/klauspost/compress/fse/bitreader.go index b9db204f59..f65eb3909c 100644 --- a/vendor/github.com/klauspost/compress/fse/bitreader.go +++ b/vendor/github.com/klauspost/compress/fse/bitreader.go @@ -6,6 +6,7 @@ package fse import ( + "encoding/binary" "errors" "io" ) @@ -34,8 +35,12 @@ func (b *bitReader) init(in []byte) error { } b.bitsRead = 64 b.value = 0 - b.fill() - b.fill() + if len(in) >= 8 { + b.fillFastStart() + } else { + b.fill() + b.fill() + } b.bitsRead += 8 - uint8(highBits(uint32(v))) return nil } @@ -63,8 +68,9 @@ func (b *bitReader) fillFast() { if b.bitsRead < 32 { return } - // Do single re-slice to avoid bounds checks. - v := b.in[b.off-4 : b.off] + // 2 bounds checks. + v := b.in[b.off-4:] + v = v[:4] low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) b.value = (b.value << 32) | uint64(low) b.bitsRead -= 32 @@ -77,7 +83,8 @@ func (b *bitReader) fill() { return } if b.off > 4 { - v := b.in[b.off-4 : b.off] + v := b.in[b.off-4:] + v = v[:4] low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) b.value = (b.value << 32) | uint64(low) b.bitsRead -= 32 @@ -91,9 +98,17 @@ func (b *bitReader) fill() { } } +// fillFastStart() assumes the bitreader is empty and there is at least 8 bytes to read. +func (b *bitReader) fillFastStart() { + // Do single re-slice to avoid bounds checks. + b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) + b.bitsRead = 0 + b.off -= 8 +} + // finished returns true if all bits have been read from the bit stream. func (b *bitReader) finished() bool { - return b.off == 0 && b.bitsRead >= 64 + return b.bitsRead >= 64 && b.off == 0 } // close the bitstream and returns an error if out-of-buffer reads occurred. diff --git a/vendor/github.com/klauspost/compress/fse/bytereader.go b/vendor/github.com/klauspost/compress/fse/bytereader.go index f228a46cdf..abade2d605 100644 --- a/vendor/github.com/klauspost/compress/fse/bytereader.go +++ b/vendor/github.com/klauspost/compress/fse/bytereader.go @@ -25,19 +25,10 @@ func (b *byteReader) advance(n uint) { b.off += int(n) } -// Int32 returns a little endian int32 starting at current offset. -func (b byteReader) Int32() int32 { - b2 := b.b[b.off : b.off+4 : b.off+4] - v3 := int32(b2[3]) - v2 := int32(b2[2]) - v1 := int32(b2[1]) - v0 := int32(b2[0]) - return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24) -} - // Uint32 returns a little endian uint32 starting at current offset. func (b byteReader) Uint32() uint32 { - b2 := b.b[b.off : b.off+4 : b.off+4] + b2 := b.b[b.off:] + b2 = b2[:4] v3 := uint32(b2[3]) v2 := uint32(b2[2]) v1 := uint32(b2[1]) diff --git a/vendor/github.com/klauspost/compress/fse/fse.go b/vendor/github.com/klauspost/compress/fse/fse.go index 075357b5b1..535cbadfde 100644 --- a/vendor/github.com/klauspost/compress/fse/fse.go +++ b/vendor/github.com/klauspost/compress/fse/fse.go @@ -44,18 +44,14 @@ var ( // Scratch provides temporary storage for compression and decompression. type Scratch struct { // Private - count [maxSymbolValue + 1]uint32 - norm [maxSymbolValue + 1]int16 - symbolLen uint16 // Length of active part of the symbol table. - actualTableLog uint8 // Selected tablelog. - br byteReader - bits bitReader - bw bitWriter - ct cTable // Compression tables. - decTable []decSymbol // Decompression table. - zeroBits bool // no bits has prob > 50%. - clearCount bool // clear count - maxCount int // count of the most probable symbol + count [maxSymbolValue + 1]uint32 + norm [maxSymbolValue + 1]int16 + br byteReader + bits bitReader + bw bitWriter + ct cTable // Compression tables. + decTable []decSymbol // Decompression table. + maxCount int // count of the most probable symbol // Per block parameters. // These can be used to override compression parameters of the block. @@ -68,17 +64,22 @@ type Scratch struct { // and allocation will be avoided. Out []byte - // MaxSymbolValue will override the maximum symbol value of the next block. - MaxSymbolValue uint8 - - // TableLog will attempt to override the tablelog for the next block. - TableLog uint8 - // DecompressLimit limits the maximum decoded size acceptable. // If > 0 decompression will stop when approximately this many bytes // has been decoded. // If 0, maximum size will be 2GB. DecompressLimit int + + symbolLen uint16 // Length of active part of the symbol table. + actualTableLog uint8 // Selected tablelog. + zeroBits bool // no bits has prob > 50%. + clearCount bool // clear count + + // MaxSymbolValue will override the maximum symbol value of the next block. + MaxSymbolValue uint8 + + // TableLog will attempt to override the tablelog for the next block. + TableLog uint8 } // Histogram allows to populate the histogram and skip that step in the compression, diff --git a/vendor/github.com/klauspost/compress/gzip/gunzip.go b/vendor/github.com/klauspost/compress/gzip/gunzip.go new file mode 100644 index 0000000000..568b5d4fb8 --- /dev/null +++ b/vendor/github.com/klauspost/compress/gzip/gunzip.go @@ -0,0 +1,344 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package gzip implements reading and writing of gzip format compressed files, +// as specified in RFC 1952. +package gzip + +import ( + "bufio" + "encoding/binary" + "errors" + "hash/crc32" + "io" + "time" + + "github.com/klauspost/compress/flate" +) + +const ( + gzipID1 = 0x1f + gzipID2 = 0x8b + gzipDeflate = 8 + flagText = 1 << 0 + flagHdrCrc = 1 << 1 + flagExtra = 1 << 2 + flagName = 1 << 3 + flagComment = 1 << 4 +) + +var ( + // ErrChecksum is returned when reading GZIP data that has an invalid checksum. + ErrChecksum = errors.New("gzip: invalid checksum") + // ErrHeader is returned when reading GZIP data that has an invalid header. + ErrHeader = errors.New("gzip: invalid header") +) + +var le = binary.LittleEndian + +// noEOF converts io.EOF to io.ErrUnexpectedEOF. +func noEOF(err error) error { + if err == io.EOF { + return io.ErrUnexpectedEOF + } + return err +} + +// The gzip file stores a header giving metadata about the compressed file. +// That header is exposed as the fields of the Writer and Reader structs. +// +// Strings must be UTF-8 encoded and may only contain Unicode code points +// U+0001 through U+00FF, due to limitations of the GZIP file format. +type Header struct { + Comment string // comment + Extra []byte // "extra data" + ModTime time.Time // modification time + Name string // file name + OS byte // operating system type +} + +// A Reader is an io.Reader that can be read to retrieve +// uncompressed data from a gzip-format compressed file. +// +// In general, a gzip file can be a concatenation of gzip files, +// each with its own header. Reads from the Reader +// return the concatenation of the uncompressed data of each. +// Only the first header is recorded in the Reader fields. +// +// Gzip files store a length and checksum of the uncompressed data. +// The Reader will return a ErrChecksum when Read +// reaches the end of the uncompressed data if it does not +// have the expected length or checksum. Clients should treat data +// returned by Read as tentative until they receive the io.EOF +// marking the end of the data. +type Reader struct { + Header // valid after NewReader or Reader.Reset + r flate.Reader + decompressor io.ReadCloser + digest uint32 // CRC-32, IEEE polynomial (section 8) + size uint32 // Uncompressed size (section 2.3.1) + buf [512]byte + err error + multistream bool +} + +// NewReader creates a new Reader reading the given reader. +// If r does not also implement io.ByteReader, +// the decompressor may read more data than necessary from r. +// +// It is the caller's responsibility to call Close on the Reader when done. +// +// The Reader.Header fields will be valid in the Reader returned. +func NewReader(r io.Reader) (*Reader, error) { + z := new(Reader) + if err := z.Reset(r); err != nil { + return nil, err + } + return z, nil +} + +// Reset discards the Reader z's state and makes it equivalent to the +// result of its original state from NewReader, but reading from r instead. +// This permits reusing a Reader rather than allocating a new one. +func (z *Reader) Reset(r io.Reader) error { + *z = Reader{ + decompressor: z.decompressor, + multistream: true, + } + if rr, ok := r.(flate.Reader); ok { + z.r = rr + } else { + z.r = bufio.NewReader(r) + } + z.Header, z.err = z.readHeader() + return z.err +} + +// Multistream controls whether the reader supports multistream files. +// +// If enabled (the default), the Reader expects the input to be a sequence +// of individually gzipped data streams, each with its own header and +// trailer, ending at EOF. The effect is that the concatenation of a sequence +// of gzipped files is treated as equivalent to the gzip of the concatenation +// of the sequence. This is standard behavior for gzip readers. +// +// Calling Multistream(false) disables this behavior; disabling the behavior +// can be useful when reading file formats that distinguish individual gzip +// data streams or mix gzip data streams with other data streams. +// In this mode, when the Reader reaches the end of the data stream, +// Read returns io.EOF. If the underlying reader implements io.ByteReader, +// it will be left positioned just after the gzip stream. +// To start the next stream, call z.Reset(r) followed by z.Multistream(false). +// If there is no next stream, z.Reset(r) will return io.EOF. +func (z *Reader) Multistream(ok bool) { + z.multistream = ok +} + +// readString reads a NUL-terminated string from z.r. +// It treats the bytes read as being encoded as ISO 8859-1 (Latin-1) and +// will output a string encoded using UTF-8. +// This method always updates z.digest with the data read. +func (z *Reader) readString() (string, error) { + var err error + needConv := false + for i := 0; ; i++ { + if i >= len(z.buf) { + return "", ErrHeader + } + z.buf[i], err = z.r.ReadByte() + if err != nil { + return "", err + } + if z.buf[i] > 0x7f { + needConv = true + } + if z.buf[i] == 0 { + // Digest covers the NUL terminator. + z.digest = crc32.Update(z.digest, crc32.IEEETable, z.buf[:i+1]) + + // Strings are ISO 8859-1, Latin-1 (RFC 1952, section 2.3.1). + if needConv { + s := make([]rune, 0, i) + for _, v := range z.buf[:i] { + s = append(s, rune(v)) + } + return string(s), nil + } + return string(z.buf[:i]), nil + } + } +} + +// readHeader reads the GZIP header according to section 2.3.1. +// This method does not set z.err. +func (z *Reader) readHeader() (hdr Header, err error) { + if _, err = io.ReadFull(z.r, z.buf[:10]); err != nil { + // RFC 1952, section 2.2, says the following: + // A gzip file consists of a series of "members" (compressed data sets). + // + // Other than this, the specification does not clarify whether a + // "series" is defined as "one or more" or "zero or more". To err on the + // side of caution, Go interprets this to mean "zero or more". + // Thus, it is okay to return io.EOF here. + return hdr, err + } + if z.buf[0] != gzipID1 || z.buf[1] != gzipID2 || z.buf[2] != gzipDeflate { + return hdr, ErrHeader + } + flg := z.buf[3] + hdr.ModTime = time.Unix(int64(le.Uint32(z.buf[4:8])), 0) + // z.buf[8] is XFL and is currently ignored. + hdr.OS = z.buf[9] + z.digest = crc32.ChecksumIEEE(z.buf[:10]) + + if flg&flagExtra != 0 { + if _, err = io.ReadFull(z.r, z.buf[:2]); err != nil { + return hdr, noEOF(err) + } + z.digest = crc32.Update(z.digest, crc32.IEEETable, z.buf[:2]) + data := make([]byte, le.Uint16(z.buf[:2])) + if _, err = io.ReadFull(z.r, data); err != nil { + return hdr, noEOF(err) + } + z.digest = crc32.Update(z.digest, crc32.IEEETable, data) + hdr.Extra = data + } + + var s string + if flg&flagName != 0 { + if s, err = z.readString(); err != nil { + return hdr, err + } + hdr.Name = s + } + + if flg&flagComment != 0 { + if s, err = z.readString(); err != nil { + return hdr, err + } + hdr.Comment = s + } + + if flg&flagHdrCrc != 0 { + if _, err = io.ReadFull(z.r, z.buf[:2]); err != nil { + return hdr, noEOF(err) + } + digest := le.Uint16(z.buf[:2]) + if digest != uint16(z.digest) { + return hdr, ErrHeader + } + } + + z.digest = 0 + if z.decompressor == nil { + z.decompressor = flate.NewReader(z.r) + } else { + z.decompressor.(flate.Resetter).Reset(z.r, nil) + } + return hdr, nil +} + +// Read implements io.Reader, reading uncompressed bytes from its underlying Reader. +func (z *Reader) Read(p []byte) (n int, err error) { + if z.err != nil { + return 0, z.err + } + + n, z.err = z.decompressor.Read(p) + z.digest = crc32.Update(z.digest, crc32.IEEETable, p[:n]) + z.size += uint32(n) + if z.err != io.EOF { + // In the normal case we return here. + return n, z.err + } + + // Finished file; check checksum and size. + if _, err := io.ReadFull(z.r, z.buf[:8]); err != nil { + z.err = noEOF(err) + return n, z.err + } + digest := le.Uint32(z.buf[:4]) + size := le.Uint32(z.buf[4:8]) + if digest != z.digest || size != z.size { + z.err = ErrChecksum + return n, z.err + } + z.digest, z.size = 0, 0 + + // File is ok; check if there is another. + if !z.multistream { + return n, io.EOF + } + z.err = nil // Remove io.EOF + + if _, z.err = z.readHeader(); z.err != nil { + return n, z.err + } + + // Read from next file, if necessary. + if n > 0 { + return n, nil + } + return z.Read(p) +} + +// 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() + for { + if z.err != nil { + if z.err == io.EOF { + return total, nil + } + return total, z.err + } + + // We write both to output and digest. + mw := io.MultiWriter(w, crcWriter) + n, err := z.decompressor.(io.WriterTo).WriteTo(mw) + total += n + z.size += uint32(n) + if err != nil { + z.err = err + return total, z.err + } + + // Finished file; check checksum + size. + if _, err := io.ReadFull(z.r, z.buf[0:8]); err != nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + z.err = err + return total, err + } + z.digest = crcWriter.Sum32() + digest := le.Uint32(z.buf[:4]) + size := le.Uint32(z.buf[4:8]) + if digest != z.digest || size != z.size { + z.err = ErrChecksum + return total, z.err + } + z.digest, z.size = 0, 0 + + // File is ok; check if there is another. + if !z.multistream { + return total, nil + } + crcWriter.Reset() + z.err = nil // Remove io.EOF + + if _, z.err = z.readHeader(); z.err != nil { + if z.err == io.EOF { + return total, nil + } + return total, z.err + } + } +} + +// Close closes the Reader. It does not close the underlying io.Reader. +// In order for the GZIP checksum to be verified, the reader must be +// fully consumed until the io.EOF. +func (z *Reader) Close() error { return z.decompressor.Close() } diff --git a/vendor/github.com/klauspost/compress/gzip/gzip.go b/vendor/github.com/klauspost/compress/gzip/gzip.go new file mode 100644 index 0000000000..26203851bd --- /dev/null +++ b/vendor/github.com/klauspost/compress/gzip/gzip.go @@ -0,0 +1,269 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gzip + +import ( + "errors" + "fmt" + "hash/crc32" + "io" + + "github.com/klauspost/compress/flate" +) + +// These constants are copied from the flate package, so that code that imports +// "compress/gzip" does not also have to import "compress/flate". +const ( + NoCompression = flate.NoCompression + BestSpeed = flate.BestSpeed + BestCompression = flate.BestCompression + DefaultCompression = flate.DefaultCompression + ConstantCompression = flate.ConstantCompression + HuffmanOnly = flate.HuffmanOnly + + // StatelessCompression will do compression but without maintaining any state + // between Write calls. + // There will be no memory kept between Write calls, + // but compression and speed will be suboptimal. + // Because of this, the size of actual Write calls will affect output size. + StatelessCompression = -3 +) + +// A Writer is an io.WriteCloser. +// Writes to a Writer are compressed and written to w. +type Writer struct { + Header // written at first call to Write, Flush, or Close + w io.Writer + level int + err error + compressor *flate.Writer + digest uint32 // CRC-32, IEEE polynomial (section 8) + size uint32 // Uncompressed size (section 2.3.1) + wroteHeader bool + closed bool + buf [10]byte +} + +// NewWriter returns a new Writer. +// Writes to the returned writer are compressed and written to w. +// +// It is the caller's responsibility to call Close on the WriteCloser when done. +// Writes may be buffered and not flushed until Close. +// +// Callers that wish to set the fields in Writer.Header must do so before +// the first call to Write, Flush, or Close. +func NewWriter(w io.Writer) *Writer { + z, _ := NewWriterLevel(w, DefaultCompression) + return z +} + +// NewWriterLevel is like NewWriter but specifies the compression level instead +// of assuming DefaultCompression. +// +// The compression level can be DefaultCompression, NoCompression, or any +// integer value between BestSpeed and BestCompression inclusive. The error +// returned will be nil if the level is valid. +func NewWriterLevel(w io.Writer, level int) (*Writer, error) { + if level < StatelessCompression || level > BestCompression { + return nil, fmt.Errorf("gzip: invalid compression level: %d", level) + } + z := new(Writer) + z.init(w, level) + return z, nil +} + +func (z *Writer) init(w io.Writer, level int) { + compressor := z.compressor + if level != StatelessCompression { + if compressor != nil { + compressor.Reset(w) + } + } + + *z = Writer{ + Header: Header{ + OS: 255, // unknown + }, + w: w, + level: level, + compressor: compressor, + } +} + +// Reset discards the Writer z's state and makes it equivalent to the +// result of its original state from NewWriter or NewWriterLevel, but +// writing to w instead. This permits reusing a Writer rather than +// allocating a new one. +func (z *Writer) Reset(w io.Writer) { + z.init(w, z.level) +} + +// writeBytes writes a length-prefixed byte slice to z.w. +func (z *Writer) writeBytes(b []byte) error { + if len(b) > 0xffff { + return errors.New("gzip.Write: Extra data is too large") + } + le.PutUint16(z.buf[:2], uint16(len(b))) + _, err := z.w.Write(z.buf[:2]) + if err != nil { + return err + } + _, err = z.w.Write(b) + return err +} + +// writeString writes a UTF-8 string s in GZIP's format to z.w. +// GZIP (RFC 1952) specifies that strings are NUL-terminated ISO 8859-1 (Latin-1). +func (z *Writer) writeString(s string) (err error) { + // GZIP stores Latin-1 strings; error if non-Latin-1; convert if non-ASCII. + needconv := false + for _, v := range s { + if v == 0 || v > 0xff { + return errors.New("gzip.Write: non-Latin-1 header string") + } + if v > 0x7f { + needconv = true + } + } + if needconv { + b := make([]byte, 0, len(s)) + for _, v := range s { + b = append(b, byte(v)) + } + _, err = z.w.Write(b) + } else { + _, err = io.WriteString(z.w, s) + } + if err != nil { + return err + } + // GZIP strings are NUL-terminated. + z.buf[0] = 0 + _, err = z.w.Write(z.buf[:1]) + return err +} + +// Write writes a compressed form of p to the underlying io.Writer. The +// compressed bytes are not necessarily flushed until the Writer is closed. +func (z *Writer) Write(p []byte) (int, error) { + if z.err != nil { + return 0, z.err + } + var n int + // Write the GZIP header lazily. + if !z.wroteHeader { + z.wroteHeader = true + z.buf[0] = gzipID1 + z.buf[1] = gzipID2 + z.buf[2] = gzipDeflate + z.buf[3] = 0 + if z.Extra != nil { + z.buf[3] |= 0x04 + } + if z.Name != "" { + z.buf[3] |= 0x08 + } + if z.Comment != "" { + z.buf[3] |= 0x10 + } + le.PutUint32(z.buf[4:8], uint32(z.ModTime.Unix())) + if z.level == BestCompression { + z.buf[8] = 2 + } else if z.level == BestSpeed { + z.buf[8] = 4 + } else { + z.buf[8] = 0 + } + z.buf[9] = z.OS + n, z.err = z.w.Write(z.buf[:10]) + if z.err != nil { + return n, z.err + } + if z.Extra != nil { + z.err = z.writeBytes(z.Extra) + if z.err != nil { + return n, z.err + } + } + if z.Name != "" { + z.err = z.writeString(z.Name) + if z.err != nil { + return n, z.err + } + } + if z.Comment != "" { + z.err = z.writeString(z.Comment) + if z.err != nil { + return n, z.err + } + } + + if z.compressor == nil && z.level != StatelessCompression { + z.compressor, _ = flate.NewWriter(z.w, z.level) + } + } + z.size += uint32(len(p)) + z.digest = crc32.Update(z.digest, crc32.IEEETable, p) + if z.level == StatelessCompression { + return len(p), flate.StatelessDeflate(z.w, p, false, nil) + } + n, z.err = z.compressor.Write(p) + return n, z.err +} + +// Flush flushes any pending compressed data to the underlying writer. +// +// It is useful mainly in compressed network protocols, to ensure that +// a remote reader has enough data to reconstruct a packet. Flush does +// not return until the data has been written. If the underlying +// writer returns an error, Flush returns that error. +// +// In the terminology of the zlib library, Flush is equivalent to Z_SYNC_FLUSH. +func (z *Writer) Flush() error { + if z.err != nil { + return z.err + } + if z.closed || z.level == StatelessCompression { + return nil + } + if !z.wroteHeader { + z.Write(nil) + if z.err != nil { + return z.err + } + } + z.err = z.compressor.Flush() + return z.err +} + +// Close closes the Writer, flushing any unwritten data to the underlying +// io.Writer, but does not close the underlying io.Writer. +func (z *Writer) Close() error { + if z.err != nil { + return z.err + } + if z.closed { + return nil + } + z.closed = true + if !z.wroteHeader { + z.Write(nil) + if z.err != nil { + return z.err + } + } + if z.level == StatelessCompression { + z.err = flate.StatelessDeflate(z.w, nil, true, nil) + } else { + z.err = z.compressor.Close() + } + if z.err != nil { + return z.err + } + le.PutUint32(z.buf[:4], z.digest) + le.PutUint32(z.buf[4:8], z.size) + _, z.err = z.w.Write(z.buf[:8]) + return z.err +} diff --git a/vendor/github.com/klauspost/compress/huff0/README.md b/vendor/github.com/klauspost/compress/huff0/README.md index 0a8448ce9f..e12da4db2f 100644 --- a/vendor/github.com/klauspost/compress/huff0/README.md +++ b/vendor/github.com/klauspost/compress/huff0/README.md @@ -12,8 +12,6 @@ but it can be used as a secondary step to compressors (like Snappy) that does no * [Godoc documentation](https://godoc.org/github.com/klauspost/compress/huff0) -THIS PACKAGE IS NOT CONSIDERED STABLE AND API OR ENCODING MAY CHANGE IN THE FUTURE. - ## News * Mar 2018: First implementation released. Consider this beta software for now. @@ -75,6 +73,8 @@ which can be given to the decompressor. Decompressing is done by calling the [`Decompress1X`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch.Decompress1X) or [`Decompress4X`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch.Decompress4X) function. +For concurrently decompressing content with a fixed table a stateless [`Decoder`](https://godoc.org/github.com/klauspost/compress/huff0#Decoder) can be requested which will remain correct as long as the scratch is unchanged. The capacity of the provided slice indicates the expected output size. + You must provide the output from the compression stage, at exactly the size you got back. If you receive an error back your input was likely corrupted. @@ -84,4 +84,4 @@ There are no integrity checks, so relying on errors from the decompressor does n # Contributing Contributions are always welcome. Be aware that adding public functions will require good justification and breaking -changes will likely not be accepted. If in doubt open an issue before writing the PR. \ No newline at end of file +changes will likely not be accepted. If in doubt open an issue before writing the PR. diff --git a/vendor/github.com/klauspost/compress/huff0/bitreader.go b/vendor/github.com/klauspost/compress/huff0/bitreader.go index 7d0903c701..a4979e8868 100644 --- a/vendor/github.com/klauspost/compress/huff0/bitreader.go +++ b/vendor/github.com/klauspost/compress/huff0/bitreader.go @@ -6,6 +6,7 @@ package huff0 import ( + "encoding/binary" "errors" "io" ) @@ -34,29 +35,16 @@ func (b *bitReader) init(in []byte) error { } b.bitsRead = 64 b.value = 0 - b.fill() - b.fill() + if len(in) >= 8 { + b.fillFastStart() + } else { + b.fill() + b.fill() + } b.bitsRead += 8 - uint8(highBit32(uint32(v))) return nil } -// getBits will return n bits. n can be 0. -func (b *bitReader) getBits(n uint8) uint16 { - if n == 0 || b.bitsRead >= 64 { - return 0 - } - return b.getBitsFast(n) -} - -// getBitsFast requires that at least one bit is requested every time. -// There are no checks if the buffer is filled. -func (b *bitReader) getBitsFast(n uint8) uint16 { - const regMask = 64 - 1 - v := uint16((b.value << (b.bitsRead & regMask)) >> ((regMask + 1 - n) & regMask)) - b.bitsRead += n - return v -} - // peekBitsFast requires that at least one bit is requested every time. // There are no checks if the buffer is filled. func (b *bitReader) peekBitsFast(n uint8) uint16 { @@ -71,21 +59,36 @@ func (b *bitReader) fillFast() { if b.bitsRead < 32 { return } - // Do single re-slice to avoid bounds checks. + + // 2 bounds checks. v := b.in[b.off-4 : b.off] + v = v[:4] low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) b.value = (b.value << 32) | uint64(low) b.bitsRead -= 32 b.off -= 4 } +func (b *bitReader) advance(n uint8) { + b.bitsRead += n +} + +// fillFastStart() assumes the bitreader is empty and there is at least 8 bytes to read. +func (b *bitReader) fillFastStart() { + // Do single re-slice to avoid bounds checks. + b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) + b.bitsRead = 0 + b.off -= 8 +} + // fill() will make sure at least 32 bits are available. func (b *bitReader) fill() { if b.bitsRead < 32 { return } if b.off > 4 { - v := b.in[b.off-4 : b.off] + v := b.in[b.off-4:] + v = v[:4] low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) b.value = (b.value << 32) | uint64(low) b.bitsRead -= 32 @@ -113,3 +116,214 @@ func (b *bitReader) close() error { } return nil } + +// bitReader reads a bitstream in reverse. +// The last set bit indicates the start of the stream and is used +// for aligning the input. +type bitReaderBytes struct { + in []byte + off uint // next byte to read is at in[off - 1] + value uint64 + bitsRead uint8 +} + +// init initializes and resets the bit reader. +func (b *bitReaderBytes) init(in []byte) error { + if len(in) < 1 { + return errors.New("corrupt stream: too short") + } + b.in = in + b.off = uint(len(in)) + // The highest bit of the last byte indicates where to start + v := in[len(in)-1] + if v == 0 { + return errors.New("corrupt stream, did not find end of stream") + } + b.bitsRead = 64 + b.value = 0 + if len(in) >= 8 { + b.fillFastStart() + } else { + b.fill() + b.fill() + } + b.advance(8 - uint8(highBit32(uint32(v)))) + return nil +} + +// peekBitsFast requires that at least one bit is requested every time. +// There are no checks if the buffer is filled. +func (b *bitReaderBytes) peekByteFast() uint8 { + got := uint8(b.value >> 56) + return got +} + +func (b *bitReaderBytes) advance(n uint8) { + b.bitsRead += n + b.value <<= n & 63 +} + +// fillFast() will make sure at least 32 bits are available. +// There must be at least 4 bytes available. +func (b *bitReaderBytes) fillFast() { + if b.bitsRead < 32 { + return + } + + // 2 bounds checks. + v := b.in[b.off-4 : b.off] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value |= uint64(low) << (b.bitsRead - 32) + b.bitsRead -= 32 + b.off -= 4 +} + +// fillFastStart() assumes the bitReaderBytes is empty and there is at least 8 bytes to read. +func (b *bitReaderBytes) fillFastStart() { + // Do single re-slice to avoid bounds checks. + b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) + b.bitsRead = 0 + b.off -= 8 +} + +// fill() will make sure at least 32 bits are available. +func (b *bitReaderBytes) fill() { + if b.bitsRead < 32 { + return + } + if b.off > 4 { + v := b.in[b.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value |= uint64(low) << (b.bitsRead - 32) + b.bitsRead -= 32 + b.off -= 4 + return + } + for b.off > 0 { + b.value |= uint64(b.in[b.off-1]) << (b.bitsRead - 8) + b.bitsRead -= 8 + b.off-- + } +} + +// finished returns true if all bits have been read from the bit stream. +func (b *bitReaderBytes) finished() bool { + return b.off == 0 && b.bitsRead >= 64 +} + +// close the bitstream and returns an error if out-of-buffer reads occurred. +func (b *bitReaderBytes) close() error { + // Release reference. + b.in = nil + if b.bitsRead > 64 { + return io.ErrUnexpectedEOF + } + return nil +} + +// bitReaderShifted reads a bitstream in reverse. +// The last set bit indicates the start of the stream and is used +// for aligning the input. +type bitReaderShifted struct { + in []byte + off uint // next byte to read is at in[off - 1] + value uint64 + bitsRead uint8 +} + +// init initializes and resets the bit reader. +func (b *bitReaderShifted) init(in []byte) error { + if len(in) < 1 { + return errors.New("corrupt stream: too short") + } + b.in = in + b.off = uint(len(in)) + // The highest bit of the last byte indicates where to start + v := in[len(in)-1] + if v == 0 { + return errors.New("corrupt stream, did not find end of stream") + } + b.bitsRead = 64 + b.value = 0 + if len(in) >= 8 { + b.fillFastStart() + } else { + b.fill() + b.fill() + } + b.advance(8 - uint8(highBit32(uint32(v)))) + return nil +} + +// peekBitsFast requires that at least one bit is requested every time. +// There are no checks if the buffer is filled. +func (b *bitReaderShifted) peekBitsFast(n uint8) uint16 { + return uint16(b.value >> ((64 - n) & 63)) +} + +func (b *bitReaderShifted) advance(n uint8) { + b.bitsRead += n + b.value <<= n & 63 +} + +// fillFast() will make sure at least 32 bits are available. +// There must be at least 4 bytes available. +func (b *bitReaderShifted) fillFast() { + if b.bitsRead < 32 { + return + } + + // 2 bounds checks. + v := b.in[b.off-4 : b.off] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value |= uint64(low) << ((b.bitsRead - 32) & 63) + b.bitsRead -= 32 + b.off -= 4 +} + +// fillFastStart() assumes the bitReaderShifted is empty and there is at least 8 bytes to read. +func (b *bitReaderShifted) fillFastStart() { + // Do single re-slice to avoid bounds checks. + b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) + b.bitsRead = 0 + b.off -= 8 +} + +// fill() will make sure at least 32 bits are available. +func (b *bitReaderShifted) fill() { + if b.bitsRead < 32 { + return + } + if b.off > 4 { + v := b.in[b.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value |= uint64(low) << ((b.bitsRead - 32) & 63) + b.bitsRead -= 32 + b.off -= 4 + return + } + for b.off > 0 { + b.value |= uint64(b.in[b.off-1]) << ((b.bitsRead - 8) & 63) + b.bitsRead -= 8 + b.off-- + } +} + +// finished returns true if all bits have been read from the bit stream. +func (b *bitReaderShifted) finished() bool { + return b.off == 0 && b.bitsRead >= 64 +} + +// close the bitstream and returns an error if out-of-buffer reads occurred. +func (b *bitReaderShifted) close() error { + // Release reference. + b.in = nil + if b.bitsRead > 64 { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/vendor/github.com/klauspost/compress/huff0/decompress.go b/vendor/github.com/klauspost/compress/huff0/decompress.go index 97ae66a4ac..a03b2634af 100644 --- a/vendor/github.com/klauspost/compress/huff0/decompress.go +++ b/vendor/github.com/klauspost/compress/huff0/decompress.go @@ -25,6 +25,9 @@ type dEntryDouble struct { len uint8 } +// Uses special code for all tables that are < 8 bits. +const use8BitTables = true + // ReadTable will read a table from the input. // The size of the input may be larger than the table definition. // Any content remaining after the table definition will be returned. @@ -83,6 +86,7 @@ func ReadTable(in []byte, s *Scratch) (s2 *Scratch, remain []byte, err error) { } v2 := v & 15 rankStats[v2]++ + // (1 << (v2-1)) is slower since the compiler cannot prove that v2 isn't 0. weightTotal += (1 << v2) >> 1 } if weightTotal == 0 { @@ -142,12 +146,14 @@ func ReadTable(in []byte, s *Scratch) (s2 *Scratch, remain []byte, err error) { d := dEntrySingle{ entry: uint16(s.actualTableLog+1-w) | (uint16(n) << 8), } - single := s.dt.single[rankStats[w] : rankStats[w]+length] + rank := &rankStats[w] + single := s.dt.single[*rank : *rank+length] for i := range single { single[i] = d } - rankStats[w] += length + *rank += length } + return s, in, nil } @@ -155,237 +161,905 @@ func ReadTable(in []byte, s *Scratch) (s2 *Scratch, remain []byte, err error) { // The length of the supplied input must match the end of a block exactly. // Before this is called, the table must be initialized with ReadTable unless // the encoder re-used the table. +// deprecated: Use the stateless Decoder() to get a concurrent version. func (s *Scratch) Decompress1X(in []byte) (out []byte, err error) { - if len(s.dt.single) == 0 { - return nil, errors.New("no table loaded") + if cap(s.Out) < s.MaxDecodedSize { + s.Out = make([]byte, s.MaxDecodedSize) } - var br bitReader - err = br.init(in) - if err != nil { - return nil, err + s.Out = s.Out[:0:s.MaxDecodedSize] + s.Out, err = s.Decoder().Decompress1X(s.Out, in) + return s.Out, err +} + +// Decompress4X will decompress a 4X encoded stream. +// Before this is called, the table must be initialized with ReadTable unless +// the encoder re-used the table. +// The length of the supplied input must match the end of a block exactly. +// The destination size of the uncompressed data must be known and provided. +// deprecated: Use the stateless Decoder() to get a concurrent version. +func (s *Scratch) Decompress4X(in []byte, dstSize int) (out []byte, err error) { + if dstSize > s.MaxDecodedSize { + return nil, ErrMaxDecodedSizeExceeded + } + if cap(s.Out) < dstSize { + s.Out = make([]byte, s.MaxDecodedSize) + } + s.Out = s.Out[:0:dstSize] + s.Out, err = s.Decoder().Decompress4X(s.Out, in) + return s.Out, err +} + +// Decoder will return a stateless decoder that can be used by multiple +// decompressors concurrently. +// Before this is called, the table must be initialized with ReadTable. +// The Decoder is still linked to the scratch buffer so that cannot be reused. +// However, it is safe to discard the scratch. +func (s *Scratch) Decoder() *Decoder { + return &Decoder{ + dt: s.dt, + actualTableLog: s.actualTableLog, } - s.Out = s.Out[:0] +} + +// Decoder provides stateless decoding. +type Decoder struct { + dt dTable + actualTableLog uint8 +} - decode := func() byte { - val := br.peekBitsFast(s.actualTableLog) /* note : actualTableLog >= 1 */ - v := s.dt.single[val] - br.bitsRead += uint8(v.entry) - return uint8(v.entry >> 8) +// Decompress1X will decompress a 1X encoded stream. +// The cap of the output buffer will be the maximum decompressed size. +// The length of the supplied input must match the end of a block exactly. +func (d *Decoder) Decompress1X(dst, src []byte) ([]byte, error) { + if len(d.dt.single) == 0 { + return nil, errors.New("no table loaded") + } + if use8BitTables && d.actualTableLog <= 8 { + return d.decompress1X8Bit(dst, src) } - hasDec := func(v dEntrySingle) byte { - br.bitsRead += uint8(v.entry) - return uint8(v.entry >> 8) + var br bitReaderShifted + err := br.init(src) + if err != nil { + return dst, err } + maxDecodedSize := cap(dst) + dst = dst[:0] // Avoid bounds check by always having full sized table. const tlSize = 1 << tableLogMax const tlMask = tlSize - 1 - dt := s.dt.single[:tlSize] + dt := d.dt.single[:tlSize] // Use temp table to avoid bound checks/append penalty. - var tmp = s.huffWeight[:256] + var buf [256]byte var off uint8 for br.off >= 8 { br.fillFast() - tmp[off+0] = hasDec(dt[br.peekBitsFast(s.actualTableLog)&tlMask]) - tmp[off+1] = hasDec(dt[br.peekBitsFast(s.actualTableLog)&tlMask]) + v := dt[br.peekBitsFast(d.actualTableLog)&tlMask] + br.advance(uint8(v.entry)) + buf[off+0] = uint8(v.entry >> 8) + + v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] + br.advance(uint8(v.entry)) + buf[off+1] = uint8(v.entry >> 8) + + // Refill br.fillFast() - tmp[off+2] = hasDec(dt[br.peekBitsFast(s.actualTableLog)&tlMask]) - tmp[off+3] = hasDec(dt[br.peekBitsFast(s.actualTableLog)&tlMask]) + + v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] + br.advance(uint8(v.entry)) + buf[off+2] = uint8(v.entry >> 8) + + v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] + br.advance(uint8(v.entry)) + buf[off+3] = uint8(v.entry >> 8) + off += 4 if off == 0 { - if len(s.Out)+256 > s.MaxDecodedSize { + if len(dst)+256 > maxDecodedSize { br.close() return nil, ErrMaxDecodedSizeExceeded } - s.Out = append(s.Out, tmp...) + dst = append(dst, buf[:]...) } } - if len(s.Out)+int(off) > s.MaxDecodedSize { + if len(dst)+int(off) > maxDecodedSize { br.close() return nil, ErrMaxDecodedSizeExceeded } - s.Out = append(s.Out, tmp[:off]...) + dst = append(dst, buf[:off]...) - for !br.finished() { + // br < 8, so uint8 is fine + bitsLeft := uint8(br.off)*8 + 64 - br.bitsRead + for bitsLeft > 0 { br.fill() - if len(s.Out) >= s.MaxDecodedSize { + if false && br.bitsRead >= 32 { + if br.off >= 4 { + v := br.in[br.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + br.value = (br.value << 32) | uint64(low) + br.bitsRead -= 32 + br.off -= 4 + } else { + for br.off > 0 { + br.value = (br.value << 8) | uint64(br.in[br.off-1]) + br.bitsRead -= 8 + br.off-- + } + } + } + if len(dst) >= maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + v := d.dt.single[br.peekBitsFast(d.actualTableLog)&tlMask] + nBits := uint8(v.entry) + br.advance(nBits) + bitsLeft -= nBits + dst = append(dst, uint8(v.entry>>8)) + } + return dst, br.close() +} + +// decompress1X8Bit will decompress a 1X encoded stream with tablelog <= 8. +// The cap of the output buffer will be the maximum decompressed size. +// The length of the supplied input must match the end of a block exactly. +func (d *Decoder) decompress1X8Bit(dst, src []byte) ([]byte, error) { + if d.actualTableLog == 8 { + return d.decompress1X8BitExactly(dst, src) + } + var br bitReaderBytes + err := br.init(src) + if err != nil { + return dst, err + } + maxDecodedSize := cap(dst) + dst = dst[:0] + + // Avoid bounds check by always having full sized table. + dt := d.dt.single[:256] + + // Use temp table to avoid bound checks/append penalty. + var buf [256]byte + var off uint8 + + shift := (8 - d.actualTableLog) & 7 + + //fmt.Printf("mask: %b, tl:%d\n", mask, d.actualTableLog) + for br.off >= 4 { + br.fillFast() + v := dt[br.peekByteFast()>>shift] + br.advance(uint8(v.entry)) + buf[off+0] = uint8(v.entry >> 8) + + v = dt[br.peekByteFast()>>shift] + br.advance(uint8(v.entry)) + buf[off+1] = uint8(v.entry >> 8) + + v = dt[br.peekByteFast()>>shift] + br.advance(uint8(v.entry)) + buf[off+2] = uint8(v.entry >> 8) + + v = dt[br.peekByteFast()>>shift] + br.advance(uint8(v.entry)) + buf[off+3] = uint8(v.entry >> 8) + + off += 4 + if off == 0 { + if len(dst)+256 > maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:]...) + } + } + + if len(dst)+int(off) > maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:off]...) + + // br < 4, so uint8 is fine + bitsLeft := int8(uint8(br.off)*8 + (64 - br.bitsRead)) + for bitsLeft > 0 { + if br.bitsRead >= 64-8 { + for br.off > 0 { + br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8) + br.bitsRead -= 8 + br.off-- + } + } + if len(dst) >= maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + v := dt[br.peekByteFast()>>shift] + nBits := uint8(v.entry) + br.advance(nBits) + bitsLeft -= int8(nBits) + dst = append(dst, uint8(v.entry>>8)) + } + return dst, br.close() +} + +// decompress1X8Bit will decompress a 1X encoded stream with tablelog <= 8. +// The cap of the output buffer will be the maximum decompressed size. +// The length of the supplied input must match the end of a block exactly. +func (d *Decoder) decompress1X8BitExactly(dst, src []byte) ([]byte, error) { + var br bitReaderBytes + err := br.init(src) + if err != nil { + return dst, err + } + maxDecodedSize := cap(dst) + dst = dst[:0] + + // Avoid bounds check by always having full sized table. + dt := d.dt.single[:256] + + // Use temp table to avoid bound checks/append penalty. + var buf [256]byte + var off uint8 + + const shift = 0 + + //fmt.Printf("mask: %b, tl:%d\n", mask, d.actualTableLog) + for br.off >= 4 { + br.fillFast() + v := dt[br.peekByteFast()>>shift] + br.advance(uint8(v.entry)) + buf[off+0] = uint8(v.entry >> 8) + + v = dt[br.peekByteFast()>>shift] + br.advance(uint8(v.entry)) + buf[off+1] = uint8(v.entry >> 8) + + v = dt[br.peekByteFast()>>shift] + br.advance(uint8(v.entry)) + buf[off+2] = uint8(v.entry >> 8) + + v = dt[br.peekByteFast()>>shift] + br.advance(uint8(v.entry)) + buf[off+3] = uint8(v.entry >> 8) + + off += 4 + if off == 0 { + if len(dst)+256 > maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:]...) + } + } + + if len(dst)+int(off) > maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:off]...) + + // br < 4, so uint8 is fine + bitsLeft := int8(uint8(br.off)*8 + (64 - br.bitsRead)) + for bitsLeft > 0 { + if br.bitsRead >= 64-8 { + for br.off > 0 { + br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8) + br.bitsRead -= 8 + br.off-- + } + } + if len(dst) >= maxDecodedSize { br.close() return nil, ErrMaxDecodedSizeExceeded } - s.Out = append(s.Out, decode()) + v := dt[br.peekByteFast()>>shift] + nBits := uint8(v.entry) + br.advance(nBits) + bitsLeft -= int8(nBits) + dst = append(dst, uint8(v.entry>>8)) } - return s.Out, br.close() + return dst, br.close() } // Decompress4X will decompress a 4X encoded stream. -// Before this is called, the table must be initialized with ReadTable unless -// the encoder re-used the table. // The length of the supplied input must match the end of a block exactly. -// The destination size of the uncompressed data must be known and provided. -func (s *Scratch) Decompress4X(in []byte, dstSize int) (out []byte, err error) { - if len(s.dt.single) == 0 { +// The *capacity* of the dst slice must match the destination size of +// the uncompressed data exactly. +func (d *Decoder) Decompress4X(dst, src []byte) ([]byte, error) { + if len(d.dt.single) == 0 { return nil, errors.New("no table loaded") } - if len(in) < 6+(4*1) { + if len(src) < 6+(4*1) { return nil, errors.New("input too small") } - if dstSize > s.MaxDecodedSize { - return nil, ErrMaxDecodedSizeExceeded + if use8BitTables && d.actualTableLog <= 8 { + return d.decompress4X8bit(dst, src) } - // TODO: We do not detect when we overrun a buffer, except if the last one does. - var br [4]bitReader + var br [4]bitReaderShifted start := 6 for i := 0; i < 3; i++ { - length := int(in[i*2]) | (int(in[i*2+1]) << 8) - if start+length >= len(in) { + length := int(src[i*2]) | (int(src[i*2+1]) << 8) + if start+length >= len(src) { return nil, errors.New("truncated input (or invalid offset)") } - err = br[i].init(in[start : start+length]) + err := br[i].init(src[start : start+length]) if err != nil { return nil, err } start += length } - err = br[3].init(in[start:]) + err := br[3].init(src[start:]) if err != nil { return nil, err } - // Prepare output - if cap(s.Out) < dstSize { - s.Out = make([]byte, 0, dstSize) - } - s.Out = s.Out[:dstSize] // destination, offset to match first output - dstOut := s.Out + dstSize := cap(dst) + dst = dst[:dstSize] + out := dst dstEvery := (dstSize + 3) / 4 const tlSize = 1 << tableLogMax const tlMask = tlSize - 1 - single := s.dt.single[:tlSize] - - decode := func(br *bitReader) byte { - val := br.peekBitsFast(s.actualTableLog) /* note : actualTableLog >= 1 */ - v := single[val&tlMask] - br.bitsRead += uint8(v.entry) - return uint8(v.entry >> 8) - } + single := d.dt.single[:tlSize] // Use temp table to avoid bound checks/append penalty. - var tmp = s.huffWeight[:256] + var buf [256]byte var off uint8 var decoded int // Decode 2 values from each decoder/loop. const bufoff = 256 / 4 -bigloop: for { - for i := range br { - br := &br[i] - if br.off < 4 { - break bigloop - } - br.fillFast() + if br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4 { + break } { const stream = 0 - val := br[stream].peekBitsFast(s.actualTableLog) + const stream2 = 1 + br[stream].fillFast() + br[stream2].fillFast() + + val := br[stream].peekBitsFast(d.actualTableLog) v := single[val&tlMask] - br[stream].bitsRead += uint8(v.entry) + br[stream].advance(uint8(v.entry)) + buf[off+bufoff*stream] = uint8(v.entry >> 8) - val2 := br[stream].peekBitsFast(s.actualTableLog) + val2 := br[stream2].peekBitsFast(d.actualTableLog) v2 := single[val2&tlMask] - tmp[off+bufoff*stream+1] = uint8(v2.entry >> 8) - tmp[off+bufoff*stream] = uint8(v.entry >> 8) - br[stream].bitsRead += uint8(v2.entry) + br[stream2].advance(uint8(v2.entry)) + buf[off+bufoff*stream2] = uint8(v2.entry >> 8) + + val = br[stream].peekBitsFast(d.actualTableLog) + v = single[val&tlMask] + br[stream].advance(uint8(v.entry)) + buf[off+bufoff*stream+1] = uint8(v.entry >> 8) + + val2 = br[stream2].peekBitsFast(d.actualTableLog) + v2 = single[val2&tlMask] + br[stream2].advance(uint8(v2.entry)) + buf[off+bufoff*stream2+1] = uint8(v2.entry >> 8) } { - const stream = 1 - val := br[stream].peekBitsFast(s.actualTableLog) + const stream = 2 + const stream2 = 3 + br[stream].fillFast() + br[stream2].fillFast() + + val := br[stream].peekBitsFast(d.actualTableLog) v := single[val&tlMask] - br[stream].bitsRead += uint8(v.entry) + br[stream].advance(uint8(v.entry)) + buf[off+bufoff*stream] = uint8(v.entry >> 8) - val2 := br[stream].peekBitsFast(s.actualTableLog) + val2 := br[stream2].peekBitsFast(d.actualTableLog) v2 := single[val2&tlMask] - tmp[off+bufoff*stream+1] = uint8(v2.entry >> 8) - tmp[off+bufoff*stream] = uint8(v.entry >> 8) - br[stream].bitsRead += uint8(v2.entry) + br[stream2].advance(uint8(v2.entry)) + buf[off+bufoff*stream2] = uint8(v2.entry >> 8) + + val = br[stream].peekBitsFast(d.actualTableLog) + v = single[val&tlMask] + br[stream].advance(uint8(v.entry)) + buf[off+bufoff*stream+1] = uint8(v.entry >> 8) + + val2 = br[stream2].peekBitsFast(d.actualTableLog) + v2 = single[val2&tlMask] + br[stream2].advance(uint8(v2.entry)) + buf[off+bufoff*stream2+1] = uint8(v2.entry >> 8) + } + + off += 2 + + if off == bufoff { + if bufoff > dstEvery { + return nil, errors.New("corruption detected: stream overrun 1") + } + copy(out, buf[:bufoff]) + copy(out[dstEvery:], buf[bufoff:bufoff*2]) + copy(out[dstEvery*2:], buf[bufoff*2:bufoff*3]) + copy(out[dstEvery*3:], buf[bufoff*3:bufoff*4]) + off = 0 + out = out[bufoff:] + decoded += 256 + // There must at least be 3 buffers left. + if len(out) < dstEvery*3 { + return nil, errors.New("corruption detected: stream overrun 2") + } + } + } + if off > 0 { + ioff := int(off) + if len(out) < dstEvery*3+ioff { + return nil, errors.New("corruption detected: stream overrun 3") + } + copy(out, buf[:off]) + copy(out[dstEvery:dstEvery+ioff], buf[bufoff:bufoff*2]) + copy(out[dstEvery*2:dstEvery*2+ioff], buf[bufoff*2:bufoff*3]) + copy(out[dstEvery*3:dstEvery*3+ioff], buf[bufoff*3:bufoff*4]) + decoded += int(off) * 4 + out = out[off:] + } + + // Decode remaining. + for i := range br { + offset := dstEvery * i + br := &br[i] + bitsLeft := br.off*8 + uint(64-br.bitsRead) + for bitsLeft > 0 { + br.fill() + if false && br.bitsRead >= 32 { + if br.off >= 4 { + v := br.in[br.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + br.value = (br.value << 32) | uint64(low) + br.bitsRead -= 32 + br.off -= 4 + } else { + for br.off > 0 { + br.value = (br.value << 8) | uint64(br.in[br.off-1]) + br.bitsRead -= 8 + br.off-- + } + } + } + // end inline... + if offset >= len(out) { + return nil, errors.New("corruption detected: stream overrun 4") + } + + // Read value and increment offset. + val := br.peekBitsFast(d.actualTableLog) + v := single[val&tlMask].entry + nBits := uint8(v) + br.advance(nBits) + bitsLeft -= uint(nBits) + out[offset] = uint8(v >> 8) + offset++ + } + decoded += offset - dstEvery*i + err = br.close() + if err != nil { + return nil, err + } + } + if dstSize != decoded { + return nil, errors.New("corruption detected: short output block") + } + return dst, nil +} + +// Decompress4X will decompress a 4X encoded stream. +// The length of the supplied input must match the end of a block exactly. +// The *capacity* of the dst slice must match the destination size of +// the uncompressed data exactly. +func (d *Decoder) decompress4X8bit(dst, src []byte) ([]byte, error) { + if d.actualTableLog == 8 { + return d.decompress4X8bitExactly(dst, src) + } + + var br [4]bitReaderBytes + start := 6 + for i := 0; i < 3; i++ { + length := int(src[i*2]) | (int(src[i*2+1]) << 8) + if start+length >= len(src) { + return nil, errors.New("truncated input (or invalid offset)") + } + err := br[i].init(src[start : start+length]) + if err != nil { + return nil, err + } + start += length + } + err := br[3].init(src[start:]) + if err != nil { + return nil, err + } + + // destination, offset to match first output + dstSize := cap(dst) + dst = dst[:dstSize] + out := dst + dstEvery := (dstSize + 3) / 4 + + shift := (8 - d.actualTableLog) & 7 + + const tlSize = 1 << 8 + const tlMask = tlSize - 1 + single := d.dt.single[:tlSize] + + // Use temp table to avoid bound checks/append penalty. + var buf [256]byte + var off uint8 + var decoded int + + // Decode 4 values from each decoder/loop. + const bufoff = 256 / 4 + for { + if br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4 { + break + } + + { + // Interleave 2 decodes. + const stream = 0 + const stream2 = 1 + br[stream].fillFast() + br[stream2].fillFast() + + v := single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 := single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+1] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+1] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+2] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+2] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+3] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+3] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) } { const stream = 2 - val := br[stream].peekBitsFast(s.actualTableLog) - v := single[val&tlMask] - br[stream].bitsRead += uint8(v.entry) + const stream2 = 3 + br[stream].fillFast() + br[stream2].fillFast() - val2 := br[stream].peekBitsFast(s.actualTableLog) - v2 := single[val2&tlMask] - tmp[off+bufoff*stream+1] = uint8(v2.entry >> 8) - tmp[off+bufoff*stream] = uint8(v.entry >> 8) - br[stream].bitsRead += uint8(v2.entry) + v := single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 := single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+1] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+1] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+2] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+2] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+3] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+3] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + } + + off += 4 + + if off == bufoff { + if bufoff > dstEvery { + return nil, errors.New("corruption detected: stream overrun 1") + } + copy(out, buf[:bufoff]) + copy(out[dstEvery:], buf[bufoff:bufoff*2]) + copy(out[dstEvery*2:], buf[bufoff*2:bufoff*3]) + copy(out[dstEvery*3:], buf[bufoff*3:bufoff*4]) + off = 0 + out = out[bufoff:] + decoded += 256 + // There must at least be 3 buffers left. + if len(out) < dstEvery*3 { + return nil, errors.New("corruption detected: stream overrun 2") + } + } + } + if off > 0 { + ioff := int(off) + if len(out) < dstEvery*3+ioff { + return nil, errors.New("corruption detected: stream overrun 3") + } + copy(out, buf[:off]) + copy(out[dstEvery:dstEvery+ioff], buf[bufoff:bufoff*2]) + copy(out[dstEvery*2:dstEvery*2+ioff], buf[bufoff*2:bufoff*3]) + copy(out[dstEvery*3:dstEvery*3+ioff], buf[bufoff*3:bufoff*4]) + decoded += int(off) * 4 + out = out[off:] + } + + // Decode remaining. + for i := range br { + offset := dstEvery * i + br := &br[i] + bitsLeft := int(br.off*8) + int(64-br.bitsRead) + for bitsLeft > 0 { + if br.finished() { + return nil, io.ErrUnexpectedEOF + } + if br.bitsRead >= 56 { + if br.off >= 4 { + v := br.in[br.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + br.value |= uint64(low) << (br.bitsRead - 32) + br.bitsRead -= 32 + br.off -= 4 + } else { + for br.off > 0 { + br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8) + br.bitsRead -= 8 + br.off-- + } + } + } + // end inline... + if offset >= len(out) { + return nil, errors.New("corruption detected: stream overrun 4") + } + + // Read value and increment offset. + v := single[br.peekByteFast()>>shift].entry + nBits := uint8(v) + br.advance(nBits) + bitsLeft -= int(nBits) + out[offset] = uint8(v >> 8) + offset++ + } + decoded += offset - dstEvery*i + err = br.close() + if err != nil { + return nil, err + } + } + if dstSize != decoded { + return nil, errors.New("corruption detected: short output block") + } + return dst, nil +} + +// Decompress4X will decompress a 4X encoded stream. +// The length of the supplied input must match the end of a block exactly. +// The *capacity* of the dst slice must match the destination size of +// the uncompressed data exactly. +func (d *Decoder) decompress4X8bitExactly(dst, src []byte) ([]byte, error) { + var br [4]bitReaderBytes + start := 6 + for i := 0; i < 3; i++ { + length := int(src[i*2]) | (int(src[i*2+1]) << 8) + if start+length >= len(src) { + return nil, errors.New("truncated input (or invalid offset)") + } + err := br[i].init(src[start : start+length]) + if err != nil { + return nil, err + } + start += length + } + err := br[3].init(src[start:]) + if err != nil { + return nil, err + } + + // destination, offset to match first output + dstSize := cap(dst) + dst = dst[:dstSize] + out := dst + dstEvery := (dstSize + 3) / 4 + + const shift = 0 + const tlSize = 1 << 8 + const tlMask = tlSize - 1 + single := d.dt.single[:tlSize] + + // Use temp table to avoid bound checks/append penalty. + var buf [256]byte + var off uint8 + var decoded int + + // Decode 4 values from each decoder/loop. + const bufoff = 256 / 4 + for { + if br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4 { + break } { - const stream = 3 - val := br[stream].peekBitsFast(s.actualTableLog) - v := single[val&tlMask] - br[stream].bitsRead += uint8(v.entry) + // Interleave 2 decodes. + const stream = 0 + const stream2 = 1 + br[stream].fillFast() + br[stream2].fillFast() - val2 := br[stream].peekBitsFast(s.actualTableLog) - v2 := single[val2&tlMask] - tmp[off+bufoff*stream+1] = uint8(v2.entry >> 8) - tmp[off+bufoff*stream] = uint8(v.entry >> 8) - br[stream].bitsRead += uint8(v2.entry) + v := single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 := single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+1] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+1] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+2] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+2] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+3] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+3] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) } - off += 2 + { + const stream = 2 + const stream2 = 3 + br[stream].fillFast() + br[stream2].fillFast() + + v := single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 := single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+1] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+1] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+2] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+2] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+3] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+3] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + } + + off += 4 if off == bufoff { if bufoff > dstEvery { return nil, errors.New("corruption detected: stream overrun 1") } - copy(dstOut, tmp[:bufoff]) - copy(dstOut[dstEvery:], tmp[bufoff:bufoff*2]) - copy(dstOut[dstEvery*2:], tmp[bufoff*2:bufoff*3]) - copy(dstOut[dstEvery*3:], tmp[bufoff*3:bufoff*4]) + copy(out, buf[:bufoff]) + copy(out[dstEvery:], buf[bufoff:bufoff*2]) + copy(out[dstEvery*2:], buf[bufoff*2:bufoff*3]) + copy(out[dstEvery*3:], buf[bufoff*3:bufoff*4]) off = 0 - dstOut = dstOut[bufoff:] + out = out[bufoff:] decoded += 256 // There must at least be 3 buffers left. - if len(dstOut) < dstEvery*3 { + if len(out) < dstEvery*3 { return nil, errors.New("corruption detected: stream overrun 2") } } } if off > 0 { ioff := int(off) - if len(dstOut) < dstEvery*3+ioff { + if len(out) < dstEvery*3+ioff { return nil, errors.New("corruption detected: stream overrun 3") } - copy(dstOut, tmp[:off]) - copy(dstOut[dstEvery:dstEvery+ioff], tmp[bufoff:bufoff*2]) - copy(dstOut[dstEvery*2:dstEvery*2+ioff], tmp[bufoff*2:bufoff*3]) - copy(dstOut[dstEvery*3:dstEvery*3+ioff], tmp[bufoff*3:bufoff*4]) + copy(out, buf[:off]) + copy(out[dstEvery:dstEvery+ioff], buf[bufoff:bufoff*2]) + copy(out[dstEvery*2:dstEvery*2+ioff], buf[bufoff*2:bufoff*3]) + copy(out[dstEvery*3:dstEvery*3+ioff], buf[bufoff*3:bufoff*4]) decoded += int(off) * 4 - dstOut = dstOut[off:] + out = out[off:] } // Decode remaining. for i := range br { offset := dstEvery * i br := &br[i] - for !br.finished() { - br.fill() - if offset >= len(dstOut) { + bitsLeft := int(br.off*8) + int(64-br.bitsRead) + for bitsLeft > 0 { + if br.finished() { + return nil, io.ErrUnexpectedEOF + } + if br.bitsRead >= 56 { + if br.off >= 4 { + v := br.in[br.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + br.value |= uint64(low) << (br.bitsRead - 32) + br.bitsRead -= 32 + br.off -= 4 + } else { + for br.off > 0 { + br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8) + br.bitsRead -= 8 + br.off-- + } + } + } + // end inline... + if offset >= len(out) { return nil, errors.New("corruption detected: stream overrun 4") } - dstOut[offset] = decode(br) + + // Read value and increment offset. + v := single[br.peekByteFast()>>shift].entry + nBits := uint8(v) + br.advance(nBits) + bitsLeft -= int(nBits) + out[offset] = uint8(v >> 8) offset++ } decoded += offset - dstEvery*i @@ -397,7 +1071,7 @@ bigloop: if dstSize != decoded { return nil, errors.New("corruption detected: short output block") } - return s.Out, nil + return dst, nil } // matches will compare a decoding table to a coding table. diff --git a/vendor/github.com/klauspost/compress/huff0/huff0.go b/vendor/github.com/klauspost/compress/huff0/huff0.go index 53249df056..177d6c4ea0 100644 --- a/vendor/github.com/klauspost/compress/huff0/huff0.go +++ b/vendor/github.com/klauspost/compress/huff0/huff0.go @@ -79,6 +79,13 @@ type Scratch struct { // Slice of the returned data. OutData []byte + // MaxDecodedSize will set the maximum allowed output size. + // This value will automatically be set to BlockSizeMax if not set. + // Decoders will return ErrMaxDecodedSizeExceeded is this limit is exceeded. + MaxDecodedSize int + + br byteReader + // MaxSymbolValue will override the maximum symbol value of the next block. MaxSymbolValue uint8 @@ -95,12 +102,6 @@ type Scratch struct { // If WantLogLess == 0 any improvement will do. WantLogLess uint8 - // MaxDecodedSize will set the maximum allowed output size. - // This value will automatically be set to BlockSizeMax if not set. - // Decoders will return ErrMaxDecodedSizeExceeded is this limit is exceeded. - MaxDecodedSize int - - br byteReader symbolLen uint16 // Length of active part of the symbol table. maxCount int // count of the most probable symbol clearCount bool // clear count diff --git a/vendor/github.com/klauspost/compress/zstd/README.md b/vendor/github.com/klauspost/compress/zstd/README.md index bc977a3023..ac3640dc90 100644 --- a/vendor/github.com/klauspost/compress/zstd/README.md +++ b/vendor/github.com/klauspost/compress/zstd/README.md @@ -5,11 +5,9 @@ It offers a very wide range of compression / speed trade-off, while being backed A high performance compression algorithm is implemented. For now focused on speed. This package provides [compression](#Compressor) to and [decompression](#Decompressor) of Zstandard content. -Note that custom dictionaries are not supported yet, so if your code relies on that, -you cannot use the package as-is. +Note that custom dictionaries are only supported for decompression. This package is pure Go and without use of "unsafe". -If a significant speedup can be achieved using "unsafe", it may be added as an option later. The `zstd` package is provided as open source software using a Go standard license. @@ -142,80 +140,96 @@ Using the Encoder for both a stream and individual blocks concurrently is safe. I have collected some speed examples to compare speed and compression against other compressors. * `file` is the input file. -* `out` is the compressor used. `zskp` is this package. `gzstd` is gzip standard library. `zstd` is the Datadog cgo library. +* `out` is the compressor used. `zskp` is this package. `zstd` is the Datadog cgo library. `gzstd/gzkp` is gzip standard and this library. * `level` is the compression level used. For `zskp` level 1 is "fastest", level 2 is "default". * `insize`/`outsize` is the input/output size. * `millis` is the number of milliseconds used for compression. * `mb/s` is megabytes (2^20 bytes) per second. ``` -The test data for the Large Text Compression Benchmark is the first -10^9 bytes of the English Wikipedia dump on Mar. 3, 2006. -http://mattmahoney.net/dc/textdata.html - -file out level insize outsize millis mb/s -enwik9 zskp 1 1000000000 343833033 5840 163.30 -enwik9 zskp 2 1000000000 317822183 8449 112.87 -enwik9 gzstd 1 1000000000 382578136 13627 69.98 -enwik9 gzstd 3 1000000000 349139651 22344 42.68 -enwik9 zstd 1 1000000000 357416379 4838 197.12 -enwik9 zstd 3 1000000000 313734522 7556 126.21 +Silesia Corpus: +http://sun.aei.polsl.pl/~sdeor/corpus/silesia.zip -GOB stream of binary data. Highly compressible. -https://files.klauspost.com/compress/gob-stream.7z +This package: +file out level insize outsize millis mb/s +silesia.tar zskp 1 211947520 73101992 643 313.87 +silesia.tar zskp 2 211947520 67504318 969 208.38 +silesia.tar zskp 3 211947520 65177448 1899 106.44 -file out level insize outsize millis mb/s -gob-stream zskp 1 1911399616 234981983 5100 357.42 -gob-stream zskp 2 1911399616 208674003 6698 272.15 -gob-stream gzstd 1 1911399616 357382641 14727 123.78 -gob-stream gzstd 3 1911399616 327835097 17005 107.19 -gob-stream zstd 1 1911399616 250787165 4075 447.22 -gob-stream zstd 3 1911399616 208191888 5511 330.77 - -Highly compressible JSON file. Similar to logs in a lot of ways. -https://files.klauspost.com/compress/adresser.001.gz - -file out level insize outsize millis mb/s -adresser.001 zskp 1 1073741824 18510122 1477 692.83 -adresser.001 zskp 2 1073741824 19831697 1705 600.59 -adresser.001 gzstd 1 1073741824 47755503 3079 332.47 -adresser.001 gzstd 3 1073741824 40052381 3051 335.63 -adresser.001 zstd 1 1073741824 16135896 994 1030.18 -adresser.001 zstd 3 1073741824 17794465 905 1131.49 +cgo zstd: +silesia.tar zstd 1 211947520 73605392 543 371.56 +silesia.tar zstd 3 211947520 66793289 864 233.68 +silesia.tar zstd 6 211947520 62916450 1913 105.66 -VM Image, Linux mint with a few installed applications: -https://files.klauspost.com/compress/rawstudio-mint14.7z +gzip, stdlib/this package: +silesia.tar gzstd 1 211947520 80007735 1654 122.21 +silesia.tar gzkp 1 211947520 80369488 1168 173.06 -file out level insize outsize millis mb/s -rawstudio-mint14.tar zskp 1 8558382592 3648168838 33398 244.38 -rawstudio-mint14.tar zskp 2 8558382592 3376721436 50962 160.16 -rawstudio-mint14.tar gzstd 1 8558382592 3926257486 84712 96.35 -rawstudio-mint14.tar gzstd 3 8558382592 3740711978 176344 46.28 -rawstudio-mint14.tar zstd 1 8558382592 3607859742 27903 292.51 -rawstudio-mint14.tar zstd 3 8558382592 3341710879 46700 174.77 +GOB stream of binary data. Highly compressible. +https://files.klauspost.com/compress/gob-stream.7z +file out level insize outsize millis mb/s +gob-stream zskp 1 1911399616 235022249 3088 590.30 +gob-stream zskp 2 1911399616 205669791 3786 481.34 +gob-stream zskp 3 1911399616 185792019 9324 195.48 +gob-stream zstd 1 1911399616 249810424 2637 691.26 +gob-stream zstd 3 1911399616 208192146 3490 522.31 +gob-stream zstd 6 1911399616 193632038 6687 272.56 +gob-stream gzstd 1 1911399616 357382641 10251 177.82 +gob-stream gzkp 1 1911399616 362156523 5695 320.08 -The test data is designed to test archivers in realistic backup scenarios. -http://mattmahoney.net/dc/10gb.html +The test data for the Large Text Compression Benchmark is the first +10^9 bytes of the English Wikipedia dump on Mar. 3, 2006. +http://mattmahoney.net/dc/textdata.html -file out level insize outsize millis mb/s -10gb.tar zskp 1 10065157632 4883149814 45715 209.97 -10gb.tar zskp 2 10065157632 4638110010 60970 157.44 -10gb.tar gzstd 1 10065157632 5198296126 97769 98.18 -10gb.tar gzstd 3 10065157632 4932665487 313427 30.63 -10gb.tar zstd 1 10065157632 4940796535 40391 237.65 -10gb.tar zstd 3 10065157632 4638618579 52911 181.42 +file out level insize outsize millis mb/s +enwik9 zskp 1 1000000000 343848582 3609 264.18 +enwik9 zskp 2 1000000000 317276632 5746 165.97 +enwik9 zskp 3 1000000000 294540704 11725 81.34 +enwik9 zstd 1 1000000000 358072021 3110 306.65 +enwik9 zstd 3 1000000000 313734672 4784 199.35 +enwik9 zstd 6 1000000000 295138875 10290 92.68 +enwik9 gzstd 1 1000000000 382578136 9604 99.30 +enwik9 gzkp 1 1000000000 383825945 6544 145.73 + +Highly compressible JSON file. +https://files.klauspost.com/compress/github-june-2days-2019.json.zst + +file out level insize outsize millis mb/s +github-june-2days-2019.json zskp 1 6273951764 699045015 10620 563.40 +github-june-2days-2019.json zskp 2 6273951764 617881763 11687 511.96 +github-june-2days-2019.json zskp 3 6273951764 537511906 29252 204.54 +github-june-2days-2019.json zstd 1 6273951764 766284037 8450 708.00 +github-june-2days-2019.json zstd 3 6273951764 661889476 10927 547.57 +github-june-2days-2019.json zstd 6 6273951764 642756859 22996 260.18 +github-june-2days-2019.json gzstd 1 6273951764 1164400847 29948 199.79 +github-june-2days-2019.json gzkp 1 6273951764 1128755542 19236 311.03 -Silesia Corpus: -http://sun.aei.polsl.pl/~sdeor/corpus/silesia.zip +VM Image, Linux mint with a few installed applications: +https://files.klauspost.com/compress/rawstudio-mint14.7z -file out level insize outsize millis mb/s -silesia.tar zskp 1 211947520 73025800 1108 182.26 -silesia.tar zskp 2 211947520 67674684 1599 126.41 -silesia.tar gzstd 1 211947520 80007735 2515 80.37 -silesia.tar gzstd 3 211947520 73133380 4259 47.45 -silesia.tar zstd 1 211947520 73513991 933 216.64 -silesia.tar zstd 3 211947520 66793301 1377 146.79 +file out level insize outsize millis mb/s +rawstudio-mint14.tar zskp 1 8558382592 3667489370 20210 403.84 +rawstudio-mint14.tar zskp 2 8558382592 3364592300 31873 256.07 +rawstudio-mint14.tar zskp 3 8558382592 3224594213 71751 113.75 +rawstudio-mint14.tar zstd 1 8558382592 3609250104 17136 476.27 +rawstudio-mint14.tar zstd 3 8558382592 3341679997 29262 278.92 +rawstudio-mint14.tar zstd 6 8558382592 3235846406 77904 104.77 +rawstudio-mint14.tar gzstd 1 8558382592 3926257486 57722 141.40 +rawstudio-mint14.tar gzkp 1 8558382592 3970463184 41749 195.49 + +CSV data: +https://files.klauspost.com/compress/nyc-taxi-data-10M.csv.zst + +file out level insize outsize millis mb/s +nyc-taxi-data-10M.csv zskp 1 3325605752 641339945 8925 355.35 +nyc-taxi-data-10M.csv zskp 2 3325605752 591748091 11268 281.44 +nyc-taxi-data-10M.csv zskp 3 3325605752 538490114 19880 159.53 +nyc-taxi-data-10M.csv zstd 1 3325605752 687399637 8233 385.18 +nyc-taxi-data-10M.csv zstd 3 3325605752 598514411 10065 315.07 +nyc-taxi-data-10M.csv zstd 6 3325605752 570522953 20038 158.27 +nyc-taxi-data-10M.csv gzstd 1 3325605752 928656485 23876 132.83 +nyc-taxi-data-10M.csv gzkp 1 3325605752 924718719 16388 193.53 ``` ### Converters @@ -309,6 +323,20 @@ The decoder can be used for *concurrent* decompression of multiple buffers. It will only allow a certain number of concurrent operations to run. To tweak that yourself use the `WithDecoderConcurrency(n)` option when creating the decoder. +### Dictionaries + +Data compressed with [dictionaries](https://github.com/facebook/zstd#the-case-for-small-data-compression) can be decompressed. + +Dictionaries are added individually to Decoders. +Dictionaries are generated by the `zstd --train` command and contains an initial state for the decoder. +To add a dictionary use the `WithDecoderDicts(dicts ...[]byte)` option with the dictionary data. +Several dictionaries can be added at once. + +The dictionary will be used automatically for the data that specifies them. +A re-used Decoder will still contain the dictionaries registered. + +When registering multiple dictionaries with the same ID, the last one will be used. + ### Allocation-less operation The decoder has been designed to operate without allocations after a warmup. @@ -350,36 +378,42 @@ These are some examples of performance compared to [datadog cgo library](https:/ The first two are streaming decodes and the last are smaller inputs. ``` -BenchmarkDecoderSilesia-8 20 642550210 ns/op 329.85 MB/s 3101 B/op 8 allocs/op -BenchmarkDecoderSilesiaCgo-8 100 384930000 ns/op 550.61 MB/s 451878 B/op 9713 allocs/op - -BenchmarkDecoderEnwik9-2 10 3146000080 ns/op 317.86 MB/s 2649 B/op 9 allocs/op -BenchmarkDecoderEnwik9Cgo-2 20 1905900000 ns/op 524.69 MB/s 1125120 B/op 45785 allocs/op - -BenchmarkDecoder_DecodeAll/z000000.zst-8 200 7049994 ns/op 138.26 MB/s 40 B/op 2 allocs/op -BenchmarkDecoder_DecodeAll/z000001.zst-8 100000 19560 ns/op 97.49 MB/s 40 B/op 2 allocs/op -BenchmarkDecoder_DecodeAll/z000002.zst-8 5000 297599 ns/op 236.99 MB/s 40 B/op 2 allocs/op -BenchmarkDecoder_DecodeAll/z000003.zst-8 2000 725502 ns/op 141.17 MB/s 40 B/op 2 allocs/op -BenchmarkDecoder_DecodeAll/z000004.zst-8 200000 9314 ns/op 54.54 MB/s 40 B/op 2 allocs/op -BenchmarkDecoder_DecodeAll/z000005.zst-8 10000 137500 ns/op 104.72 MB/s 40 B/op 2 allocs/op -BenchmarkDecoder_DecodeAll/z000006.zst-8 500 2316009 ns/op 206.06 MB/s 40 B/op 2 allocs/op -BenchmarkDecoder_DecodeAll/z000007.zst-8 20000 64499 ns/op 344.90 MB/s 40 B/op 2 allocs/op -BenchmarkDecoder_DecodeAll/z000008.zst-8 50000 24900 ns/op 219.56 MB/s 40 B/op 2 allocs/op -BenchmarkDecoder_DecodeAll/z000009.zst-8 1000 2348999 ns/op 154.01 MB/s 40 B/op 2 allocs/op - -BenchmarkDecoder_DecodeAllCgo/z000000.zst-8 500 4268005 ns/op 228.38 MB/s 1228849 B/op 3 allocs/op -BenchmarkDecoder_DecodeAllCgo/z000001.zst-8 100000 15250 ns/op 125.05 MB/s 2096 B/op 3 allocs/op -BenchmarkDecoder_DecodeAllCgo/z000002.zst-8 10000 147399 ns/op 478.49 MB/s 73776 B/op 3 allocs/op -BenchmarkDecoder_DecodeAllCgo/z000003.zst-8 5000 320798 ns/op 319.27 MB/s 139312 B/op 3 allocs/op -BenchmarkDecoder_DecodeAllCgo/z000004.zst-8 200000 10004 ns/op 50.77 MB/s 560 B/op 3 allocs/op -BenchmarkDecoder_DecodeAllCgo/z000005.zst-8 20000 73599 ns/op 195.64 MB/s 19120 B/op 3 allocs/op -BenchmarkDecoder_DecodeAllCgo/z000006.zst-8 1000 1119003 ns/op 426.48 MB/s 557104 B/op 3 allocs/op -BenchmarkDecoder_DecodeAllCgo/z000007.zst-8 20000 103450 ns/op 215.04 MB/s 71296 B/op 9 allocs/op -BenchmarkDecoder_DecodeAllCgo/z000008.zst-8 100000 20130 ns/op 271.58 MB/s 6192 B/op 3 allocs/op -BenchmarkDecoder_DecodeAllCgo/z000009.zst-8 2000 1123500 ns/op 322.00 MB/s 368688 B/op 3 allocs/op +BenchmarkDecoderSilesia-8 3 385000067 ns/op 550.51 MB/s 5498 B/op 8 allocs/op +BenchmarkDecoderSilesiaCgo-8 6 197666567 ns/op 1072.25 MB/s 270672 B/op 8 allocs/op + +BenchmarkDecoderEnwik9-8 1 2027001600 ns/op 493.34 MB/s 10496 B/op 18 allocs/op +BenchmarkDecoderEnwik9Cgo-8 2 979499200 ns/op 1020.93 MB/s 270672 B/op 8 allocs/op + +Concurrent performance: + +BenchmarkDecoder_DecodeAllParallel/kppkn.gtb.zst-16 28915 42469 ns/op 4340.07 MB/s 114 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/geo.protodata.zst-16 116505 9965 ns/op 11900.16 MB/s 16 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/plrabn12.txt.zst-16 8952 134272 ns/op 3588.70 MB/s 915 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/lcet10.txt.zst-16 11820 102538 ns/op 4161.90 MB/s 594 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/asyoulik.txt.zst-16 34782 34184 ns/op 3661.88 MB/s 60 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/alice29.txt.zst-16 27712 43447 ns/op 3500.58 MB/s 99 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/html_x_4.zst-16 62826 18750 ns/op 21845.10 MB/s 104 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/paper-100k.pdf.zst-16 631545 1794 ns/op 57078.74 MB/s 2 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/fireworks.jpeg.zst-16 1690140 712 ns/op 172938.13 MB/s 1 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/urls.10K.zst-16 10432 113593 ns/op 6180.73 MB/s 1143 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/html.zst-16 113206 10671 ns/op 9596.27 MB/s 15 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/comp-data.bin.zst-16 1530615 779 ns/op 5229.49 MB/s 0 B/op 0 allocs/op + +BenchmarkDecoder_DecodeAllParallelCgo/kppkn.gtb.zst-16 65217 16192 ns/op 11383.34 MB/s 46 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/geo.protodata.zst-16 292671 4039 ns/op 29363.19 MB/s 6 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/plrabn12.txt.zst-16 26314 46021 ns/op 10470.43 MB/s 293 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/lcet10.txt.zst-16 33897 34900 ns/op 12227.96 MB/s 205 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/asyoulik.txt.zst-16 104348 11433 ns/op 10949.01 MB/s 20 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/alice29.txt.zst-16 75949 15510 ns/op 9805.60 MB/s 32 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/html_x_4.zst-16 173910 6756 ns/op 60624.29 MB/s 37 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/paper-100k.pdf.zst-16 923076 1339 ns/op 76474.87 MB/s 1 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/fireworks.jpeg.zst-16 922920 1351 ns/op 91102.57 MB/s 2 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/urls.10K.zst-16 27649 43618 ns/op 16096.19 MB/s 407 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/html.zst-16 279073 4160 ns/op 24614.18 MB/s 6 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/comp-data.bin.zst-16 749938 1579 ns/op 2581.71 MB/s 0 B/op 0 allocs/op ``` -This reflects the performance around May 2019, but this may be out of date. +This reflects the performance around May 2020, but this may be out of date. # Contributions diff --git a/vendor/github.com/klauspost/compress/zstd/bitreader.go b/vendor/github.com/klauspost/compress/zstd/bitreader.go index 15d79d439f..8544585371 100644 --- a/vendor/github.com/klauspost/compress/zstd/bitreader.go +++ b/vendor/github.com/klauspost/compress/zstd/bitreader.go @@ -5,6 +5,7 @@ package zstd import ( + "encoding/binary" "errors" "io" "math/bits" @@ -34,8 +35,12 @@ func (b *bitReader) init(in []byte) error { } b.bitsRead = 64 b.value = 0 - b.fill() - b.fill() + if len(in) >= 8 { + b.fillFastStart() + } else { + b.fill() + b.fill() + } b.bitsRead += 8 - uint8(highBits(uint32(v))) return nil } @@ -63,21 +68,31 @@ func (b *bitReader) fillFast() { if b.bitsRead < 32 { return } - // Do single re-slice to avoid bounds checks. - v := b.in[b.off-4 : b.off] + // 2 bounds checks. + v := b.in[b.off-4:] + v = v[:4] low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) b.value = (b.value << 32) | uint64(low) b.bitsRead -= 32 b.off -= 4 } +// fillFastStart() assumes the bitreader is empty and there is at least 8 bytes to read. +func (b *bitReader) fillFastStart() { + // Do single re-slice to avoid bounds checks. + b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) + b.bitsRead = 0 + b.off -= 8 +} + // fill() will make sure at least 32 bits are available. func (b *bitReader) fill() { if b.bitsRead < 32 { return } if b.off >= 4 { - v := b.in[b.off-4 : b.off] + v := b.in[b.off-4:] + v = v[:4] low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) b.value = (b.value << 32) | uint64(low) b.bitsRead -= 32 diff --git a/vendor/github.com/klauspost/compress/zstd/blockdec.go b/vendor/github.com/klauspost/compress/zstd/blockdec.go index ed670bcc7a..c8ec6e3312 100644 --- a/vendor/github.com/klauspost/compress/zstd/blockdec.go +++ b/vendor/github.com/klauspost/compress/zstd/blockdec.go @@ -75,21 +75,29 @@ type blockDec struct { // Window size of the block. WindowSize uint64 - Type blockType - RLESize uint32 - // Is this the last block of a frame? - Last bool - - // Use less memory - lowMem bool history chan *history input chan struct{} result chan decodeOutput sequenceBuf []seq - tmp [4]byte err error decWG sync.WaitGroup + + // Frame to use for singlethreaded decoding. + // Should not be used by the decoder itself since parent may be another frame. + localFrame *frameDec + + // Block is RLE, this is the size. + RLESize uint32 + tmp [4]byte + + Type blockType + + // Is this the last block of a frame? + Last bool + + // Use less memory + lowMem bool } func (b *blockDec) String() string { @@ -127,25 +135,37 @@ func (b *blockDec) reset(br byteBuffer, windowSize uint64) error { b.Type = blockType((bh >> 1) & 3) // find size. cSize := int(bh >> 3) + maxSize := maxBlockSize switch b.Type { case blockTypeReserved: return ErrReservedBlockType case blockTypeRLE: b.RLESize = uint32(cSize) + if b.lowMem { + maxSize = cSize + } cSize = 1 case blockTypeCompressed: if debug { println("Data size on stream:", cSize) } b.RLESize = 0 + maxSize = maxCompressedBlockSize + if windowSize < maxCompressedBlockSize && b.lowMem { + maxSize = int(windowSize) + } if cSize > maxCompressedBlockSize || uint64(cSize) > b.WindowSize { if debug { printf("compressed block too big: csize:%d block: %+v\n", uint64(cSize), b) } return ErrCompressedSizeTooBig } - default: + case blockTypeRaw: b.RLESize = 0 + // We do not need a destination for raw blocks. + maxSize = -1 + default: + panic("Invalid block type") } // Read block data. @@ -156,8 +176,8 @@ func (b *blockDec) reset(br byteBuffer, windowSize uint64) error { b.dataStorage = make([]byte, 0, maxBlockSize) } } - if cap(b.dst) <= maxBlockSize { - b.dst = make([]byte, 0, maxBlockSize+1) + if cap(b.dst) <= maxSize { + b.dst = make([]byte, 0, maxSize+1) } var err error b.data, err = br.readBig(cSize, b.dataStorage) @@ -445,26 +465,22 @@ func (b *blockDec) decodeCompressed(hist *history) error { if huff == nil { huff = &huff0.Scratch{} } - huff.Out = b.literalBuf[:0] huff, literals, err = huff0.ReadTable(literals, huff) if err != nil { println("reading huffman table:", err) return err } // Use our out buffer. - huff.Out = b.literalBuf[:0] - huff.MaxDecodedSize = litRegenSize if fourStreams { - literals, err = huff.Decompress4X(literals, litRegenSize) + literals, err = huff.Decoder().Decompress4X(b.literalBuf[:0:litRegenSize], literals) } else { - literals, err = huff.Decompress1X(literals) + literals, err = huff.Decoder().Decompress1X(b.literalBuf[:0:litRegenSize], literals) } if err != nil { println("decoding compressed literals:", err) return err } // Make sure we don't leak our literals buffer - huff.Out = nil if len(literals) != litRegenSize { return fmt.Errorf("literal output size mismatch want %d, got %d", litRegenSize, len(literals)) } @@ -615,15 +631,12 @@ func (b *blockDec) decodeCompressed(hist *history) error { var err error // Use our out buffer. huff = hist.huffTree - huff.Out = b.literalBuf[:0] - huff.MaxDecodedSize = litRegenSize if fourStreams { - literals, err = huff.Decompress4X(literals, litRegenSize) + literals, err = huff.Decoder().Decompress4X(b.literalBuf[:0:litRegenSize], literals) } else { - literals, err = huff.Decompress1X(literals) + literals, err = huff.Decoder().Decompress1X(b.literalBuf[:0:litRegenSize], literals) } // Make sure we don't leak our literals buffer - huff.Out = nil if err != nil { println("decompressing literals:", err) return err @@ -633,12 +646,13 @@ func (b *blockDec) decodeCompressed(hist *history) error { } } else { if hist.huffTree != nil && huff != nil { - huffDecoderPool.Put(hist.huffTree) + if hist.dict == nil || hist.dict.litDec != hist.huffTree { + huffDecoderPool.Put(hist.huffTree) + } hist.huffTree = nil } } if huff != nil { - huff.Out = nil hist.huffTree = huff } if debug { @@ -671,12 +685,21 @@ func (b *blockDec) decodeCompressed(hist *history) error { // If only recent offsets were not transferred, this would be an obvious win. // Also, if first 3 sequences don't reference recent offsets, all sequences can be decoded. + hbytes := hist.b + if len(hbytes) > hist.windowSize { + hbytes = hbytes[len(hbytes)-hist.windowSize:] + // We do not need history any more. + if hist.dict != nil { + hist.dict.content = nil + } + } + if err := seqs.initialize(br, hist, literals, b.dst); err != nil { println("initializing sequences:", err) return err } - err = seqs.decode(nSeqs, br, hist.b) + err = seqs.decode(nSeqs, br, hbytes) if err != nil { return err } diff --git a/vendor/github.com/klauspost/compress/zstd/blockenc.go b/vendor/github.com/klauspost/compress/zstd/blockenc.go index 507757d525..c584f6aabc 100644 --- a/vendor/github.com/klauspost/compress/zstd/blockenc.go +++ b/vendor/github.com/klauspost/compress/zstd/blockenc.go @@ -444,9 +444,9 @@ func fuzzFseEncoder(data []byte) int { } // encode will encode the block and append the output in b.output. -func (b *blockEnc) encode(raw bool) error { +func (b *blockEnc) encode(raw, rawAllLits bool) error { if len(b.sequences) == 0 { - return b.encodeLits(raw) + return b.encodeLits(rawAllLits) } // We want some difference if len(b.literals) > (b.size - (b.size >> 5)) { @@ -806,7 +806,7 @@ func (b *blockEnc) genCodes() { mlH[v]++ if v > mlMax { mlMax = v - if debug && mlMax > maxMatchLengthSymbol { + if debugAsserts && mlMax > maxMatchLengthSymbol { panic(fmt.Errorf("mlMax > maxMatchLengthSymbol (%d), matchlen: %d", mlMax, seq.matchLen)) } } @@ -821,13 +821,13 @@ func (b *blockEnc) genCodes() { } return int(max) } - if mlMax > maxMatchLengthSymbol { + if debugAsserts && mlMax > maxMatchLengthSymbol { panic(fmt.Errorf("mlMax > maxMatchLengthSymbol (%d)", mlMax)) } - if ofMax > maxOffsetBits { + if debugAsserts && ofMax > maxOffsetBits { panic(fmt.Errorf("ofMax > maxOffsetBits (%d)", ofMax)) } - if llMax > maxLiteralLengthSymbol { + if debugAsserts && llMax > maxLiteralLengthSymbol { panic(fmt.Errorf("llMax > maxLiteralLengthSymbol (%d)", llMax)) } diff --git a/vendor/github.com/klauspost/compress/zstd/bytebuf.go b/vendor/github.com/klauspost/compress/zstd/bytebuf.go index 07321acb18..658ef78380 100644 --- a/vendor/github.com/klauspost/compress/zstd/bytebuf.go +++ b/vendor/github.com/klauspost/compress/zstd/bytebuf.go @@ -30,7 +30,7 @@ type byteBuffer interface { type byteBuf []byte func (b *byteBuf) readSmall(n int) []byte { - if debug && n > 8 { + if debugAsserts && n > 8 { panic(fmt.Errorf("small read > 8 (%d). use readBig", n)) } bb := *b @@ -82,7 +82,7 @@ type readerWrapper struct { } func (r *readerWrapper) readSmall(n int) []byte { - if debug && n > 8 { + if debugAsserts && n > 8 { panic(fmt.Errorf("small read > 8 (%d). use readBig", n)) } n2, err := io.ReadFull(r.r, r.tmp[:n]) diff --git a/vendor/github.com/klauspost/compress/zstd/bytereader.go b/vendor/github.com/klauspost/compress/zstd/bytereader.go index dc4378b640..2c4fca17fa 100644 --- a/vendor/github.com/klauspost/compress/zstd/bytereader.go +++ b/vendor/github.com/klauspost/compress/zstd/bytereader.go @@ -31,7 +31,8 @@ func (b *byteReader) overread() bool { // Int32 returns a little endian int32 starting at current offset. func (b byteReader) Int32() int32 { - b2 := b.b[b.off : b.off+4 : b.off+4] + b2 := b.b[b.off:] + b2 = b2[:4] v3 := int32(b2[3]) v2 := int32(b2[2]) v1 := int32(b2[1]) @@ -55,7 +56,20 @@ func (b byteReader) Uint32() uint32 { } return v } - b2 := b.b[b.off : b.off+4 : b.off+4] + b2 := b.b[b.off:] + b2 = b2[:4] + v3 := uint32(b2[3]) + v2 := uint32(b2[2]) + v1 := uint32(b2[1]) + v0 := uint32(b2[0]) + return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24) +} + +// Uint32NC returns a little endian uint32 starting at current offset. +// The caller must be sure if there are at least 4 bytes left. +func (b byteReader) Uint32NC() uint32 { + b2 := b.b[b.off:] + b2 = b2[:4] v3 := uint32(b2[3]) v2 := uint32(b2[2]) v1 := uint32(b2[1]) diff --git a/vendor/github.com/klauspost/compress/zstd/decoder.go b/vendor/github.com/klauspost/compress/zstd/decoder.go index 35a3cda914..66b51bf2d3 100644 --- a/vendor/github.com/klauspost/compress/zstd/decoder.go +++ b/vendor/github.com/klauspost/compress/zstd/decoder.go @@ -23,17 +23,15 @@ type Decoder struct { // Unreferenced decoders, ready for use. decoders chan *blockDec - // Unreferenced decoders, ready for use. - frames chan *frameDec - // Streams ready to be decoded. stream chan decodeStream // Current read position used for Reader functionality. current decoderState - // Custom dictionaries - dicts map[uint32]struct{} + // Custom dictionaries. + // Always uses copies. + dicts map[uint32]dict // streamWg is the waitgroup for all streams streamWg sync.WaitGroup @@ -66,7 +64,7 @@ var ( // A Decoder can be used in two modes: // // 1) As a stream, or -// 2) For stateless decoding using DecodeAll or DecodeBuffer. +// 2) For stateless decoding using DecodeAll. // // Only a single stream can be decoded concurrently, but the same decoder // can run multiple concurrent stateless decodes. It is even possible to @@ -87,12 +85,19 @@ func NewReader(r io.Reader, opts ...DOption) (*Decoder, error) { d.current.output = make(chan decodeOutput, d.o.concurrent) d.current.flushed = true + // Transfer option dicts. + d.dicts = make(map[uint32]dict, len(d.o.dicts)) + for _, dc := range d.o.dicts { + d.dicts[dc.id] = dc + } + d.o.dicts = nil + // Create decoders d.decoders = make(chan *blockDec, d.o.concurrent) - d.frames = make(chan *frameDec, d.o.concurrent) for i := 0; i < d.o.concurrent; i++ { - d.frames <- newFrameDec(d.o) - d.decoders <- newBlockDec(d.o.lowMem) + dec := newBlockDec(d.o.lowMem) + dec.localFrame = newFrameDec(d.o) + d.decoders <- dec } if r == nil { @@ -169,7 +174,12 @@ func (d *Decoder) Reset(r io.Reader) error { println("*bytes.Buffer detected, doing sync decode, len:", bb.Len()) } b := bb.Bytes() - dst, err := d.DecodeAll(b, nil) + var dst []byte + if cap(d.current.b) > 0 { + dst = d.current.b + } + + dst, err := d.DecodeAll(b, dst[:0]) if err == nil { err = io.EOF } @@ -277,23 +287,31 @@ func (d *Decoder) DecodeAll(input, dst []byte) ([]byte, error) { } // Grab a block decoder and frame decoder. - block, frame := <-d.decoders, <-d.frames + block := <-d.decoders + frame := block.localFrame defer func() { if debug { printf("re-adding decoder: %p", block) } - d.decoders <- block frame.rawInput = nil frame.bBuf = nil - d.frames <- frame + d.decoders <- block }() frame.bBuf = input for { + frame.history.reset() err := frame.reset(&frame.bBuf) if err == io.EOF { return dst, nil } + if frame.DictionaryID != nil { + dict, ok := d.dicts[*frame.DictionaryID] + if !ok { + return nil, ErrUnknownDictionary + } + frame.history.setDict(&dict) + } if err != nil { return dst, err } @@ -315,7 +333,7 @@ func (d *Decoder) DecodeAll(input, dst []byte) ([]byte, error) { if size > 1<<20 { size = 1 << 20 } - dst = make([]byte, 0, frame.WindowSize) + dst = make([]byte, 0, size) } dst, err = frame.runDecoder(dst, block) @@ -456,10 +474,19 @@ func (d *Decoder) startStreamDecoder(inStream chan decodeStream) { br := readerWrapper{r: stream.r} decodeStream: for { + frame.history.reset() err := frame.reset(&br) if debug && err != nil { println("Frame decoder returned", err) } + if err == nil && frame.DictionaryID != nil { + dict, ok := d.dicts[*frame.DictionaryID] + if !ok { + err = ErrUnknownDictionary + } else { + frame.history.setDict(&dict) + } + } if err != nil { stream.output <- decodeOutput{ err: err, diff --git a/vendor/github.com/klauspost/compress/zstd/decoder_options.go b/vendor/github.com/klauspost/compress/zstd/decoder_options.go index 2ac9cd2dd3..284d384492 100644 --- a/vendor/github.com/klauspost/compress/zstd/decoder_options.go +++ b/vendor/github.com/klauspost/compress/zstd/decoder_options.go @@ -18,6 +18,7 @@ type decoderOptions struct { lowMem bool concurrent int maxDecodedSize uint64 + dicts []dict } func (o *decoderOptions) setDefault() { @@ -66,3 +67,18 @@ func WithDecoderMaxMemory(n uint64) DOption { return nil } } + +// WithDecoderDicts allows to register one or more dictionaries for the decoder. +// If several dictionaries with the same ID is provided the last one will be used. +func WithDecoderDicts(dicts ...[]byte) DOption { + return func(o *decoderOptions) error { + for _, b := range dicts { + d, err := loadDict(b) + if err != nil { + return err + } + o.dicts = append(o.dicts, *d) + } + return nil + } +} diff --git a/vendor/github.com/klauspost/compress/zstd/dict.go b/vendor/github.com/klauspost/compress/zstd/dict.go new file mode 100644 index 0000000000..8eb6f6ba33 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/dict.go @@ -0,0 +1,104 @@ +package zstd + +import ( + "bytes" + "encoding/binary" + "errors" + "fmt" + "io" + + "github.com/klauspost/compress/huff0" +) + +type dict struct { + id uint32 + + litDec *huff0.Scratch + llDec, ofDec, mlDec sequenceDec + offsets [3]int + content []byte +} + +var dictMagic = [4]byte{0x37, 0xa4, 0x30, 0xec} + +// Load a dictionary as described in +// https://github.com/facebook/zstd/blob/master/doc/zstd_compression_format.md#dictionary-format +func loadDict(b []byte) (*dict, error) { + // Check static field size. + if len(b) <= 8+(3*4) { + return nil, io.ErrUnexpectedEOF + } + d := dict{ + llDec: sequenceDec{fse: &fseDecoder{}}, + ofDec: sequenceDec{fse: &fseDecoder{}}, + mlDec: sequenceDec{fse: &fseDecoder{}}, + } + if !bytes.Equal(b[:4], dictMagic[:]) { + return nil, ErrMagicMismatch + } + d.id = binary.LittleEndian.Uint32(b[4:8]) + if d.id == 0 { + return nil, errors.New("dictionaries cannot have ID 0") + } + + // Read literal table + var err error + d.litDec, b, err = huff0.ReadTable(b[8:], nil) + if err != nil { + return nil, err + } + + br := byteReader{ + b: b, + off: 0, + } + readDec := func(i tableIndex, dec *fseDecoder) error { + if err := dec.readNCount(&br, uint16(maxTableSymbol[i])); err != nil { + return err + } + if br.overread() { + return io.ErrUnexpectedEOF + } + err = dec.transform(symbolTableX[i]) + if err != nil { + println("Transform table error:", err) + return err + } + if debug { + println("Read table ok", "symbolLen:", dec.symbolLen) + } + // Set decoders as predefined so they aren't reused. + dec.preDefined = true + return nil + } + + if err := readDec(tableOffsets, d.ofDec.fse); err != nil { + return nil, err + } + if err := readDec(tableMatchLengths, d.mlDec.fse); err != nil { + return nil, err + } + if err := readDec(tableLiteralLengths, d.llDec.fse); err != nil { + return nil, err + } + if br.remain() < 12 { + return nil, io.ErrUnexpectedEOF + } + + d.offsets[0] = int(br.Uint32()) + br.advance(4) + d.offsets[1] = int(br.Uint32()) + br.advance(4) + d.offsets[2] = int(br.Uint32()) + br.advance(4) + if d.offsets[0] <= 0 || d.offsets[1] <= 0 || d.offsets[2] <= 0 { + return nil, errors.New("invalid offset in dictionary") + } + d.content = make([]byte, br.remain()) + copy(d.content, br.unread()) + if d.offsets[0] > len(d.content) || d.offsets[1] > len(d.content) || d.offsets[2] > len(d.content) { + return nil, fmt.Errorf("initial offset bigger than dictionary content size %d, offsets: %v", len(d.content), d.offsets) + } + + return &d, nil +} diff --git a/vendor/github.com/klauspost/compress/zstd/enc_better.go b/vendor/github.com/klauspost/compress/zstd/enc_better.go new file mode 100644 index 0000000000..c120d90548 --- /dev/null +++ b/vendor/github.com/klauspost/compress/zstd/enc_better.go @@ -0,0 +1,518 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import "fmt" + +const ( + betterLongTableBits = 19 // Bits used in the long match table + betterLongTableSize = 1 << betterLongTableBits // Size of the table + + // Note: Increasing the short table bits or making the hash shorter + // can actually lead to compression degradation since it will 'steal' more from the + // long match table and match offsets are quite big. + // This greatly depends on the type of input. + betterShortTableBits = 13 // Bits used in the short match table + betterShortTableSize = 1 << betterShortTableBits // Size of the table +) + +type prevEntry struct { + offset int32 + prev int32 +} + +// betterFastEncoder uses 2 tables, one for short matches (5 bytes) and one for long matches. +// The long match table contains the previous entry with the same hash, +// effectively making it a "chain" of length 2. +// When we find a long match we choose between the two values and select the longest. +// When we find a short match, after checking the long, we check if we can find a long at n+1 +// and that it is longer (lazy matching). +type betterFastEncoder struct { + fastBase + table [betterShortTableSize]tableEntry + longTable [betterLongTableSize]prevEntry +} + +// Encode improves compression... +func (e *betterFastEncoder) Encode(blk *blockEnc, src []byte) { + const ( + // Input margin is the number of bytes we read (8) + // and the maximum we will read ahead (2) + inputMargin = 8 + 2 + minNonLiteralBlockSize = 16 + ) + + // Protect against e.cur wraparound. + for e.cur >= bufferReset { + if len(e.hist) == 0 { + for i := range e.table[:] { + e.table[i] = tableEntry{} + } + for i := range e.longTable[:] { + e.longTable[i] = prevEntry{} + } + e.cur = e.maxMatchOff + break + } + // Shift down everything in the table that isn't already too far away. + minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff + for i := range e.table[:] { + v := e.table[i].offset + if v < minOff { + v = 0 + } else { + v = v - e.cur + e.maxMatchOff + } + e.table[i].offset = v + } + for i := range e.longTable[:] { + v := e.longTable[i].offset + v2 := e.longTable[i].prev + if v < minOff { + v = 0 + v2 = 0 + } else { + v = v - e.cur + e.maxMatchOff + if v2 < minOff { + v2 = 0 + } else { + v2 = v2 - e.cur + e.maxMatchOff + } + } + e.longTable[i] = prevEntry{ + offset: v, + prev: v2, + } + } + e.cur = e.maxMatchOff + break + } + + s := e.addBlock(src) + blk.size = len(src) + if len(src) < minNonLiteralBlockSize { + blk.extraLits = len(src) + blk.literals = blk.literals[:len(src)] + copy(blk.literals, src) + return + } + + // Override src + src = e.hist + sLimit := int32(len(src)) - inputMargin + // stepSize is the number of bytes to skip on every main loop iteration. + // It should be >= 1. + const stepSize = 1 + + const kSearchStrength = 9 + + // nextEmit is where in src the next emitLiteral should start from. + nextEmit := s + cv := load6432(src, s) + + // Relative offsets + offset1 := int32(blk.recentOffsets[0]) + offset2 := int32(blk.recentOffsets[1]) + + addLiterals := func(s *seq, until int32) { + if until == nextEmit { + return + } + blk.literals = append(blk.literals, src[nextEmit:until]...) + s.litLen = uint32(until - nextEmit) + } + if debug { + println("recent offsets:", blk.recentOffsets) + } + +encodeLoop: + for { + var t int32 + // We allow the encoder to optionally turn off repeat offsets across blocks + canRepeat := len(blk.sequences) > 2 + var matched int32 + + for { + if debugAsserts && canRepeat && offset1 == 0 { + panic("offset0 was 0") + } + + nextHashS := hash5(cv, betterShortTableBits) + nextHashL := hash8(cv, betterLongTableBits) + candidateL := e.longTable[nextHashL] + candidateS := e.table[nextHashS] + + const repOff = 1 + repIndex := s - offset1 + repOff + off := s + e.cur + e.longTable[nextHashL] = prevEntry{offset: off, prev: candidateL.offset} + e.table[nextHashS] = tableEntry{offset: off, val: uint32(cv)} + + if canRepeat { + if repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>(repOff*8)) { + // Consider history as well. + var seq seq + lenght := 4 + e.matchlen(s+4+repOff, repIndex+4, src) + + seq.matchLen = uint32(lenght - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + repOff + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 0 + seq.offset = 1 + if debugSequences { + println("repeat sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Index match start+1 (long) -> s - 1 + index0 := s + repOff + s += lenght + repOff + + nextEmit = s + if s >= sLimit { + if debug { + println("repeat ended", s, lenght) + + } + break encodeLoop + } + // Index skipped... + for index0 < s-1 { + cv0 := load6432(src, index0) + cv1 := cv0 >> 8 + h0 := hash8(cv0, betterLongTableBits) + off := index0 + e.cur + e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} + e.table[hash5(cv1, betterShortTableBits)] = tableEntry{offset: off + 1, val: uint32(cv1)} + index0 += 2 + } + cv = load6432(src, s) + continue + } + const repOff2 = 1 + + // We deviate from the reference encoder and also check offset 2. + // Still slower and not much better, so disabled. + // repIndex = s - offset2 + repOff2 + if false && repIndex >= 0 && load6432(src, repIndex) == load6432(src, s+repOff) { + // Consider history as well. + var seq seq + lenght := 8 + e.matchlen(s+8+repOff2, repIndex+8, src) + + seq.matchLen = uint32(lenght - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + repOff2 + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 2 + seq.offset = 2 + if debugSequences { + println("repeat sequence 2", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + index0 := s + repOff2 + s += lenght + repOff2 + nextEmit = s + if s >= sLimit { + if debug { + println("repeat ended", s, lenght) + + } + break encodeLoop + } + + // Index skipped... + for index0 < s-1 { + cv0 := load6432(src, index0) + cv1 := cv0 >> 8 + h0 := hash8(cv0, betterLongTableBits) + off := index0 + e.cur + e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} + e.table[hash5(cv1, betterShortTableBits)] = tableEntry{offset: off + 1, val: uint32(cv1)} + index0 += 2 + } + cv = load6432(src, s) + // Swap offsets + offset1, offset2 = offset2, offset1 + continue + } + } + // Find the offsets of our two matches. + coffsetL := candidateL.offset - e.cur + coffsetLP := candidateL.prev - e.cur + + // Check if we have a long match. + if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) { + // Found a long match, at least 8 bytes. + matched = e.matchlen(s+8, coffsetL+8, src) + 8 + t = coffsetL + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugMatches { + println("long match") + } + + if s-coffsetLP < e.maxMatchOff && cv == load6432(src, coffsetLP) { + // Found a long match, at least 8 bytes. + prevMatch := e.matchlen(s+8, coffsetLP+8, src) + 8 + if prevMatch > matched { + matched = prevMatch + t = coffsetLP + } + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugMatches { + println("long match") + } + } + break + } + + // Check if we have a long match on prev. + if s-coffsetLP < e.maxMatchOff && cv == load6432(src, coffsetLP) { + // Found a long match, at least 8 bytes. + matched = e.matchlen(s+8, coffsetLP+8, src) + 8 + t = coffsetLP + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugMatches { + println("long match") + } + break + } + + coffsetS := candidateS.offset - e.cur + + // Check if we have a short match. + if s-coffsetS < e.maxMatchOff && uint32(cv) == candidateS.val { + // found a regular match + matched = e.matchlen(s+4, coffsetS+4, src) + 4 + + // See if we can find a long match at s+1 + const checkAt = 1 + cv := load6432(src, s+checkAt) + nextHashL = hash8(cv, betterLongTableBits) + candidateL = e.longTable[nextHashL] + coffsetL = candidateL.offset - e.cur + + // We can store it, since we have at least a 4 byte match. + e.longTable[nextHashL] = prevEntry{offset: s + checkAt + e.cur, prev: candidateL.offset} + if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) { + // Found a long match, at least 8 bytes. + matchedNext := e.matchlen(s+8+checkAt, coffsetL+8, src) + 8 + if matchedNext > matched { + t = coffsetL + s += checkAt + matched = matchedNext + if debugMatches { + println("long match (after short)") + } + break + } + } + + // Check prev long... + coffsetL = candidateL.prev - e.cur + if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) { + // Found a long match, at least 8 bytes. + matchedNext := e.matchlen(s+8+checkAt, coffsetL+8, src) + 8 + if matchedNext > matched { + t = coffsetL + s += checkAt + matched = matchedNext + if debugMatches { + println("prev long match (after short)") + } + break + } + } + t = coffsetS + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugAsserts && t < 0 { + panic("t<0") + } + if debugMatches { + println("short match") + } + break + } + + // No match found, move forward in input. + s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1)) + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + } + + // A 4-byte match has been found. Update recent offsets. + // We'll later see if more than 4 bytes. + offset2 = offset1 + offset1 = s - t + + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + + if debugAsserts && canRepeat && int(offset1) > len(src) { + panic("invalid offset") + } + + // Extend the n-byte match as long as possible. + l := matched + + // Extend backwards + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { + s-- + t-- + l++ + } + + // Write our sequence + var seq seq + seq.litLen = uint32(s - nextEmit) + seq.matchLen = uint32(l - zstdMinMatch) + if seq.litLen > 0 { + blk.literals = append(blk.literals, src[nextEmit:s]...) + } + seq.offset = uint32(s-t) + 3 + s += l + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + nextEmit = s + if s >= sLimit { + break encodeLoop + } + + // Index match start+1 (long) -> s - 1 + index0 := s - l + 1 + for index0 < s-1 { + cv0 := load6432(src, index0) + cv1 := cv0 >> 8 + h0 := hash8(cv0, betterLongTableBits) + off := index0 + e.cur + e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} + e.table[hash5(cv1, betterShortTableBits)] = tableEntry{offset: off + 1, val: uint32(cv1)} + index0 += 2 + } + + cv = load6432(src, s) + if !canRepeat { + continue + } + + // Check offset 2 + for { + o2 := s - offset2 + if load3232(src, o2) != uint32(cv) { + // Do regular search + break + } + + // Store this, since we have it. + nextHashS := hash5(cv, betterShortTableBits) + nextHashL := hash8(cv, betterLongTableBits) + + // We have at least 4 byte match. + // No need to check backwards. We come straight from a match + l := 4 + e.matchlen(s+4, o2+4, src) + + e.longTable[nextHashL] = prevEntry{offset: s + e.cur, prev: e.longTable[nextHashL].offset} + e.table[nextHashS] = tableEntry{offset: s + e.cur, val: uint32(cv)} + seq.matchLen = uint32(l) - zstdMinMatch + seq.litLen = 0 + + // Since litlen is always 0, this is offset 1. + seq.offset = 1 + s += l + nextEmit = s + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Swap offset 1 and 2. + offset1, offset2 = offset2, offset1 + if s >= sLimit { + // Finished + break encodeLoop + } + cv = load6432(src, s) + } + } + + if int(nextEmit) < len(src) { + blk.literals = append(blk.literals, src[nextEmit:]...) + blk.extraLits = len(src) - int(nextEmit) + } + blk.recentOffsets[0] = uint32(offset1) + blk.recentOffsets[1] = uint32(offset2) + if debug { + println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) + } +} + +// EncodeNoHist will encode a block with no history and no following blocks. +// Most notable difference is that src will not be copied for history and +// we do not need to check for max match length. +func (e *betterFastEncoder) EncodeNoHist(blk *blockEnc, src []byte) { + e.Encode(blk, src) +} diff --git a/vendor/github.com/klauspost/compress/zstd/enc_dfast.go b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go index ee3b09b02a..50276bcde7 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_dfast.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go @@ -4,6 +4,8 @@ package zstd +import "fmt" + const ( dFastLongTableBits = 17 // Bits used in the long match table dFastLongTableSize = 1 << dFastLongTableBits // Size of the table @@ -29,7 +31,7 @@ func (e *doubleFastEncoder) Encode(blk *blockEnc, src []byte) { ) // Protect against e.cur wraparound. - for e.cur > (1<<30)+e.maxMatchOff { + for e.cur >= bufferReset { if len(e.hist) == 0 { for i := range e.table[:] { e.table[i] = tableEntry{} @@ -61,6 +63,7 @@ func (e *doubleFastEncoder) Encode(blk *blockEnc, src []byte) { e.longTable[i].offset = v } e.cur = e.maxMatchOff + break } s := e.addBlock(src) @@ -77,10 +80,7 @@ func (e *doubleFastEncoder) Encode(blk *blockEnc, src []byte) { sLimit := int32(len(src)) - inputMargin // stepSize is the number of bytes to skip on every main loop iteration. // It should be >= 1. - stepSize := int32(e.o.targetLength) - if stepSize == 0 { - stepSize++ - } + const stepSize = 1 const kSearchStrength = 8 @@ -110,7 +110,7 @@ encodeLoop: canRepeat := len(blk.sequences) > 2 for { - if debug && canRepeat && offset1 == 0 { + if debugAsserts && canRepeat && offset1 == 0 { panic("offset0 was 0") } @@ -169,55 +169,6 @@ encodeLoop: cv = load6432(src, s) continue } - const repOff2 = 1 - // We deviate from the reference encoder and also check offset 2. - // Slower and not consistently better, so disabled. - // repIndex = s - offset2 + repOff2 - if false && repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>(repOff2*8)) { - // Consider history as well. - var seq seq - lenght := 4 + e.matchlen(s+4+repOff2, repIndex+4, src) - - seq.matchLen = uint32(lenght - zstdMinMatch) - - // We might be able to match backwards. - // Extend as long as we can. - start := s + repOff2 - // We end the search early, so we don't risk 0 literals - // and have to do special offset treatment. - startLimit := nextEmit + 1 - - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } - for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { - repIndex-- - start-- - seq.matchLen++ - } - addLiterals(&seq, start) - - // rep 2 - seq.offset = 2 - if debugSequences { - println("repeat sequence 2", seq, "next s:", s) - } - blk.sequences = append(blk.sequences, seq) - s += lenght + repOff2 - nextEmit = s - if s >= sLimit { - if debug { - println("repeat ended", s, lenght) - - } - break encodeLoop - } - cv = load6432(src, s) - // Swap offsets - offset1, offset2 = offset2, offset1 - continue - } } // Find the offsets of our two matches. coffsetL := s - (candidateL.offset - e.cur) @@ -229,10 +180,10 @@ encodeLoop: // Reference encoder checks all 8 bytes, we only check 4, // but the likelihood of both the first 4 bytes and the hash matching should be enough. t = candidateL.offset - e.cur - if debug && s <= t { - panic("s <= t") + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) } - if debug && s-t > e.maxMatchOff { + if debugAsserts && s-t > e.maxMatchOff { panic("s - t >e.maxMatchOff") } if debugMatches { @@ -266,13 +217,13 @@ encodeLoop: } t = candidateS.offset - e.cur - if debug && s <= t { - panic("s <= t") + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) } - if debug && s-t > e.maxMatchOff { + if debugAsserts && s-t > e.maxMatchOff { panic("s - t >e.maxMatchOff") } - if debug && t < 0 { + if debugAsserts && t < 0 { panic("t<0") } if debugMatches { @@ -294,11 +245,11 @@ encodeLoop: offset2 = offset1 offset1 = s - t - if debug && s <= t { - panic("s <= t") + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) } - if debug && canRepeat && int(offset1) > len(src) { + if debugAsserts && canRepeat && int(offset1) > len(src) { panic("invalid offset") } @@ -369,7 +320,7 @@ encodeLoop: } // Store this, since we have it. - nextHashS := hash5(cv1>>8, dFastShortTableBits) + nextHashS := hash5(cv, dFastShortTableBits) nextHashL := hash8(cv, dFastLongTableBits) // We have at least 4 byte match. @@ -424,7 +375,7 @@ func (e *doubleFastEncoder) EncodeNoHist(blk *blockEnc, src []byte) { ) // Protect against e.cur wraparound. - if e.cur > (1<<30)+e.maxMatchOff { + if e.cur >= bufferReset { for i := range e.table[:] { e.table[i] = tableEntry{} } @@ -447,10 +398,7 @@ func (e *doubleFastEncoder) EncodeNoHist(blk *blockEnc, src []byte) { sLimit := int32(len(src)) - inputMargin // stepSize is the number of bytes to skip on every main loop iteration. // It should be >= 1. - stepSize := int32(e.o.targetLength) - if stepSize == 0 { - stepSize++ - } + const stepSize = 1 const kSearchStrength = 8 @@ -545,10 +493,10 @@ encodeLoop: // Reference encoder checks all 8 bytes, we only check 4, // but the likelihood of both the first 4 bytes and the hash matching should be enough. t = candidateL.offset - e.cur - if debug && s <= t { - panic("s <= t") + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) } - if debug && s-t > e.maxMatchOff { + if debugAsserts && s-t > e.maxMatchOff { panic("s - t >e.maxMatchOff") } if debugMatches { @@ -582,13 +530,13 @@ encodeLoop: } t = candidateS.offset - e.cur - if debug && s <= t { - panic("s <= t") + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) } - if debug && s-t > e.maxMatchOff { + if debugAsserts && s-t > e.maxMatchOff { panic("s - t >e.maxMatchOff") } - if debug && t < 0 { + if debugAsserts && t < 0 { panic("t<0") } if debugMatches { @@ -610,8 +558,8 @@ encodeLoop: offset2 = offset1 offset1 = s - t - if debug && s <= t { - panic("s <= t") + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) } // Extend the 4-byte match as long as possible. @@ -723,4 +671,8 @@ encodeLoop: println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) } + // We do not store history, so we must offset e.cur to avoid false matches for next user. + if e.cur < bufferReset { + e.cur += int32(len(src)) + } } diff --git a/vendor/github.com/klauspost/compress/zstd/enc_fast.go b/vendor/github.com/klauspost/compress/zstd/enc_fast.go index 0bdddac5b4..4104b456ce 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_fast.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_fast.go @@ -5,6 +5,8 @@ package zstd import ( + "fmt" + "math" "math/bits" "github.com/klauspost/compress/zstd/internal/xxhash" @@ -22,26 +24,29 @@ type tableEntry struct { offset int32 } -type fastEncoder struct { - o encParams +type fastBase struct { // cur is the offset at the start of hist cur int32 // maximum offset. Should be at least 2x block size. maxMatchOff int32 hist []byte crc *xxhash.Digest - table [tableSize]tableEntry tmp [8]byte blk *blockEnc } +type fastEncoder struct { + fastBase + table [tableSize]tableEntry +} + // CRC returns the underlying CRC writer. -func (e *fastEncoder) CRC() *xxhash.Digest { +func (e *fastBase) CRC() *xxhash.Digest { return e.crc } // AppendCRC will append the CRC to the destination slice and return it. -func (e *fastEncoder) AppendCRC(dst []byte) []byte { +func (e *fastBase) AppendCRC(dst []byte) []byte { crc := e.crc.Sum(e.tmp[:0]) dst = append(dst, crc[7], crc[6], crc[5], crc[4]) return dst @@ -49,7 +54,7 @@ func (e *fastEncoder) AppendCRC(dst []byte) []byte { // WindowSize returns the window size of the encoder, // or a window size small enough to contain the input size, if > 0. -func (e *fastEncoder) WindowSize(size int) int32 { +func (e *fastBase) WindowSize(size int) int32 { if size > 0 && size < int(e.maxMatchOff) { b := int32(1) << uint(bits.Len(uint(size))) // Keep minimum window. @@ -62,7 +67,7 @@ func (e *fastEncoder) WindowSize(size int) int32 { } // Block returns the current block. -func (e *fastEncoder) Block() *blockEnc { +func (e *fastBase) Block() *blockEnc { return e.blk } @@ -74,7 +79,7 @@ func (e *fastEncoder) Encode(blk *blockEnc, src []byte) { ) // Protect against e.cur wraparound. - for e.cur > (1<<30)+e.maxMatchOff { + for e.cur >= bufferReset { if len(e.hist) == 0 { for i := range e.table[:] { e.table[i] = tableEntry{} @@ -94,6 +99,7 @@ func (e *fastEncoder) Encode(blk *blockEnc, src []byte) { e.table[i].offset = v } e.cur = e.maxMatchOff + break } s := e.addBlock(src) @@ -110,11 +116,7 @@ func (e *fastEncoder) Encode(blk *blockEnc, src []byte) { sLimit := int32(len(src)) - inputMargin // stepSize is the number of bytes to skip on every main loop iteration. // It should be >= 2. - stepSize := int32(e.o.targetLength) - if stepSize == 0 { - stepSize++ - } - stepSize++ + const stepSize = 2 // TEMPLATE const hashLog = tableBits @@ -151,7 +153,7 @@ encodeLoop: canRepeat := len(blk.sequences) > 2 for { - if debug && canRepeat && offset1 == 0 { + if debugAsserts && canRepeat && offset1 == 0 { panic("offset0 was 0") } @@ -167,9 +169,22 @@ encodeLoop: if canRepeat && repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>16) { // Consider history as well. var seq seq - lenght := 4 + e.matchlen(s+6, repIndex+4, src) + var length int32 + // length = 4 + e.matchlen(s+6, repIndex+4, src) + { + a := src[s+6:] + b := src[repIndex+4:] + endI := len(a) & (math.MaxInt32 - 7) + length = int32(endI) + 4 + for i := 0; i < endI; i += 8 { + if diff := load64(a, i) ^ load64(b, i); diff != 0 { + length = int32(i+bits.TrailingZeros64(diff)>>3) + 4 + break + } + } + } - seq.matchLen = uint32(lenght - zstdMinMatch) + seq.matchLen = uint32(length - zstdMinMatch) // We might be able to match backwards. // Extend as long as we can. @@ -195,11 +210,11 @@ encodeLoop: println("repeat sequence", seq, "next s:", s) } blk.sequences = append(blk.sequences, seq) - s += lenght + 2 + s += length + 2 nextEmit = s if s >= sLimit { if debug { - println("repeat ended", s, lenght) + println("repeat ended", s, length) } break encodeLoop @@ -212,10 +227,10 @@ encodeLoop: if coffset0 < e.maxMatchOff && uint32(cv) == candidate.val { // found a regular match t = candidate.offset - e.cur - if debug && s <= t { - panic("s <= t") + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) } - if debug && s-t > e.maxMatchOff { + if debugAsserts && s-t > e.maxMatchOff { panic("s - t >e.maxMatchOff") } break @@ -225,13 +240,13 @@ encodeLoop: // found a regular match t = candidate2.offset - e.cur s++ - if debug && s <= t { - panic("s <= t") + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) } - if debug && s-t > e.maxMatchOff { + if debugAsserts && s-t > e.maxMatchOff { panic("s - t >e.maxMatchOff") } - if debug && t < 0 { + if debugAsserts && t < 0 { panic("t<0") } break @@ -246,16 +261,29 @@ encodeLoop: offset2 = offset1 offset1 = s - t - if debug && s <= t { - panic("s <= t") + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) } - if debug && canRepeat && int(offset1) > len(src) { + if debugAsserts && canRepeat && int(offset1) > len(src) { panic("invalid offset") } // Extend the 4-byte match as long as possible. - l := e.matchlen(s+4, t+4, src) + 4 + //l := e.matchlen(s+4, t+4, src) + 4 + var l int32 + { + a := src[s+4:] + b := src[t+4:] + endI := len(a) & (math.MaxInt32 - 7) + l = int32(endI) + 4 + for i := 0; i < endI; i += 8 { + if diff := load64(a, i) ^ load64(b, i); diff != 0 { + l = int32(i+bits.TrailingZeros64(diff)>>3) + 4 + break + } + } + } // Extend backwards tMin := s - e.maxMatchOff @@ -292,7 +320,20 @@ encodeLoop: if o2 := s - offset2; canRepeat && load3232(src, o2) == uint32(cv) { // We have at least 4 byte match. // No need to check backwards. We come straight from a match - l := 4 + e.matchlen(s+4, o2+4, src) + //l := 4 + e.matchlen(s+4, o2+4, src) + var l int32 + { + a := src[s+4:] + b := src[o2+4:] + endI := len(a) & (math.MaxInt32 - 7) + l = int32(endI) + 4 + for i := 0; i < endI; i += 8 { + if diff := load64(a, i) ^ load64(b, i); diff != 0 { + l = int32(i+bits.TrailingZeros64(diff)>>3) + 4 + break + } + } + } // Store this, since we have it. nextHash := hash6(cv, hashLog) @@ -342,8 +383,9 @@ func (e *fastEncoder) EncodeNoHist(blk *blockEnc, src []byte) { panic("src too big") } } + // Protect against e.cur wraparound. - if e.cur > (1<<30)+e.maxMatchOff { + if e.cur >= bufferReset { for i := range e.table[:] { e.table[i] = tableEntry{} } @@ -410,10 +452,23 @@ encodeLoop: if len(blk.sequences) > 2 && load3232(src, repIndex) == uint32(cv>>16) { // Consider history as well. var seq seq - // lenght := 4 + e.matchlen(s+6, repIndex+4, src) - lenght := 4 + int32(matchLen(src[s+6:], src[repIndex+4:])) + // length := 4 + e.matchlen(s+6, repIndex+4, src) + // length := 4 + int32(matchLen(src[s+6:], src[repIndex+4:])) + var length int32 + { + a := src[s+6:] + b := src[repIndex+4:] + endI := len(a) & (math.MaxInt32 - 7) + length = int32(endI) + 4 + for i := 0; i < endI; i += 8 { + if diff := load64(a, i) ^ load64(b, i); diff != 0 { + length = int32(i+bits.TrailingZeros64(diff)>>3) + 4 + break + } + } + } - seq.matchLen = uint32(lenght - zstdMinMatch) + seq.matchLen = uint32(length - zstdMinMatch) // We might be able to match backwards. // Extend as long as we can. @@ -439,11 +494,11 @@ encodeLoop: println("repeat sequence", seq, "next s:", s) } blk.sequences = append(blk.sequences, seq) - s += lenght + 2 + s += length + 2 nextEmit = s if s >= sLimit { if debug { - println("repeat ended", s, lenght) + println("repeat ended", s, length) } break encodeLoop @@ -456,12 +511,15 @@ encodeLoop: if coffset0 < e.maxMatchOff && uint32(cv) == candidate.val { // found a regular match t = candidate.offset - e.cur - if debug && s <= t { - panic("s <= t") + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) } - if debug && s-t > e.maxMatchOff { + if debugAsserts && s-t > e.maxMatchOff { panic("s - t >e.maxMatchOff") } + if debugAsserts && t < 0 { + panic(fmt.Sprintf("t (%d) < 0, candidate.offset: %d, e.cur: %d, coffset0: %d, e.maxMatchOff: %d", t, candidate.offset, e.cur, coffset0, e.maxMatchOff)) + } break } @@ -469,13 +527,13 @@ encodeLoop: // found a regular match t = candidate2.offset - e.cur s++ - if debug && s <= t { - panic("s <= t") + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) } - if debug && s-t > e.maxMatchOff { + if debugAsserts && s-t > e.maxMatchOff { panic("s - t >e.maxMatchOff") } - if debug && t < 0 { + if debugAsserts && t < 0 { panic("t<0") } break @@ -490,13 +548,29 @@ encodeLoop: offset2 = offset1 offset1 = s - t - if debug && s <= t { - panic("s <= t") + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) } + if debugAsserts && t < 0 { + panic(fmt.Sprintf("t (%d) < 0 ", t)) + } // Extend the 4-byte match as long as possible. //l := e.matchlenNoHist(s+4, t+4, src) + 4 - l := int32(matchLen(src[s+4:], src[t+4:])) + 4 + // l := int32(matchLen(src[s+4:], src[t+4:])) + 4 + var l int32 + { + a := src[s+4:] + b := src[t+4:] + endI := len(a) & (math.MaxInt32 - 7) + l = int32(endI) + 4 + for i := 0; i < endI; i += 8 { + if diff := load64(a, i) ^ load64(b, i); diff != 0 { + l = int32(i+bits.TrailingZeros64(diff)>>3) + 4 + break + } + } + } // Extend backwards tMin := s - e.maxMatchOff @@ -534,7 +608,20 @@ encodeLoop: // We have at least 4 byte match. // No need to check backwards. We come straight from a match //l := 4 + e.matchlenNoHist(s+4, o2+4, src) - l := 4 + int32(matchLen(src[s+4:], src[o2+4:])) + // l := 4 + int32(matchLen(src[s+4:], src[o2+4:])) + var l int32 + { + a := src[s+4:] + b := src[o2+4:] + endI := len(a) & (math.MaxInt32 - 7) + l = int32(endI) + 4 + for i := 0; i < endI; i += 8 { + if diff := load64(a, i) ^ load64(b, i); diff != 0 { + l = int32(i+bits.TrailingZeros64(diff)>>3) + 4 + break + } + } + } // Store this, since we have it. nextHash := hash6(cv, hashLog) @@ -567,9 +654,16 @@ encodeLoop: if debug { println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) } + // We do not store history, so we must offset e.cur to avoid false matches for next user. + if e.cur < bufferReset { + e.cur += int32(len(src)) + } } -func (e *fastEncoder) addBlock(src []byte) int32 { +func (e *fastBase) addBlock(src []byte) int32 { + if debugAsserts && e.cur > bufferReset { + panic(fmt.Sprintf("ecur (%d) > buffer reset (%d)", e.cur, bufferReset)) + } // check if we have space already if len(e.hist)+len(src) > cap(e.hist) { if cap(e.hist) == 0 { @@ -597,39 +691,41 @@ func (e *fastEncoder) addBlock(src []byte) int32 { // useBlock will replace the block with the provided one, // but transfer recent offsets from the previous. -func (e *fastEncoder) UseBlock(enc *blockEnc) { +func (e *fastBase) UseBlock(enc *blockEnc) { enc.reset(e.blk) e.blk = enc } -func (e *fastEncoder) matchlenNoHist(s, t int32, src []byte) int32 { +func (e *fastBase) matchlenNoHist(s, t int32, src []byte) int32 { // Extend the match to be as long as possible. return int32(matchLen(src[s:], src[t:])) } -func (e *fastEncoder) matchlen(s, t int32, src []byte) int32 { - if debug { +func (e *fastBase) matchlen(s, t int32, src []byte) int32 { + if debugAsserts { if s < 0 { - panic("s<0") + err := fmt.Sprintf("s (%d) < 0", s) + panic(err) } if t < 0 { - panic("t<0") + err := fmt.Sprintf("s (%d) < 0", s) + panic(err) } if s-t > e.maxMatchOff { - panic(s - t) + err := fmt.Sprintf("s (%d) - t (%d) > maxMatchOff (%d)", s, t, e.maxMatchOff) + panic(err) + } + if len(src)-int(s) > maxCompressedBlockSize { + panic(fmt.Sprintf("len(src)-s (%d) > maxCompressedBlockSize (%d)", len(src)-int(s), maxCompressedBlockSize)) } - } - s1 := int(s) + maxMatchLength - 4 - if s1 > len(src) { - s1 = len(src) } // Extend the match to be as long as possible. - return int32(matchLen(src[s:s1], src[t:])) + return int32(matchLen(src[s:], src[t:])) } // Reset the encoding table. -func (e *fastEncoder) Reset() { +func (e *fastBase) Reset(singleBlock bool) { if e.blk == nil { e.blk = &blockEnc{} e.blk.init() @@ -642,7 +738,7 @@ func (e *fastEncoder) Reset() { } else { e.crc.Reset() } - if cap(e.hist) < int(e.maxMatchOff*2) { + if !singleBlock && cap(e.hist) < int(e.maxMatchOff*2) { l := e.maxMatchOff * 2 // Make it at least 1MB. if l < 1<<20 { @@ -650,7 +746,10 @@ func (e *fastEncoder) Reset() { } e.hist = make([]byte, 0, l) } - // We offset current position so everything will be out of reach - e.cur += e.maxMatchOff + int32(len(e.hist)) + // We offset current position so everything will be out of reach. + // If above reset line, history will be purged. + if e.cur < bufferReset { + e.cur += e.maxMatchOff + int32(len(e.hist)) + } e.hist = e.hist[:0] } diff --git a/vendor/github.com/klauspost/compress/zstd/enc_params.go b/vendor/github.com/klauspost/compress/zstd/enc_params.go index b6779ecb6d..d874116f71 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_params.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_params.go @@ -4,6 +4,8 @@ package zstd +/* +// encParams are not really used, just here for reference. type encParams struct { // largest match distance : larger == more compression, more memory needed during decompression windowLog uint8 @@ -152,3 +154,4 @@ var defEncParams = [4][]encParams{ {14, 15, 15, 10, 3, 999, strategyBtultra2}, // level 22. }, } +*/ diff --git a/vendor/github.com/klauspost/compress/zstd/encoder.go b/vendor/github.com/klauspost/compress/zstd/encoder.go index 366dd66bde..c56d2241f7 100644 --- a/vendor/github.com/klauspost/compress/zstd/encoder.go +++ b/vendor/github.com/klauspost/compress/zstd/encoder.go @@ -35,21 +35,22 @@ type encoder interface { AppendCRC([]byte) []byte WindowSize(size int) int32 UseBlock(*blockEnc) - Reset() + Reset(singleBlock bool) } type encoderState struct { - w io.Writer - filling []byte - current []byte - previous []byte - encoder encoder - writing *blockEnc - err error - writeErr error - nWritten int64 - headerWritten bool - eofWritten bool + w io.Writer + filling []byte + current []byte + previous []byte + encoder encoder + writing *blockEnc + err error + writeErr error + nWritten int64 + headerWritten bool + eofWritten bool + fullFrameWritten bool // This waitgroup indicates an encode is running. wg sync.WaitGroup @@ -71,27 +72,26 @@ func NewWriter(w io.Writer, opts ...EOption) (*Encoder, error) { } if w != nil { e.Reset(w) - } else { - e.init.Do(func() { - e.initialize() - }) } return &e, nil } func (e *Encoder) initialize() { + if e.o.concurrent == 0 { + e.o.setDefault() + } e.encoders = make(chan encoder, e.o.concurrent) for i := 0; i < e.o.concurrent; i++ { - e.encoders <- e.o.encoder() + enc := e.o.encoder() + // If not single block, history will be allocated on first use. + enc.Reset(true) + e.encoders <- enc } } // Reset will re-initialize the writer and new writes will encode to the supplied writer // as a new, independent stream. func (e *Encoder) Reset(w io.Writer) { - e.init.Do(func() { - e.initialize() - }) s := &e.state s.wg.Wait() s.wWg.Wait() @@ -115,9 +115,10 @@ func (e *Encoder) Reset(w io.Writer) { s.filling = s.filling[:0] s.current = s.current[:0] s.previous = s.previous[:0] - s.encoder.Reset() + s.encoder.Reset(false) s.headerWritten = false s.eofWritten = false + s.fullFrameWritten = false s.w = w s.err = nil s.nWritten = 0 @@ -156,7 +157,7 @@ func (e *Encoder) Write(p []byte) (n int, err error) { if err != nil { return n, err } - if debug && len(s.filling) > 0 { + if debugAsserts && len(s.filling) > 0 { panic(len(s.filling)) } } @@ -176,6 +177,22 @@ func (e *Encoder) nextBlock(final bool) error { return fmt.Errorf("block > maxStoreBlockSize") } if !s.headerWritten { + // If we have a single block encode, do a sync compression. + if final && len(s.filling) > 0 { + s.current = e.EncodeAll(s.filling, s.current[:0]) + var n2 int + n2, s.err = s.w.Write(s.current) + if s.err != nil { + return s.err + } + s.nWritten += int64(n2) + s.current = s.current[:0] + s.filling = s.filling[:0] + s.headerWritten = true + s.fullFrameWritten = true + return nil + } + var tmp [maxHeaderSize]byte fh := frameHeader{ ContentSize: 0, @@ -263,7 +280,7 @@ func (e *Encoder) nextBlock(final bool) error { // If we got the exact same number of literals as input, // assume the literals cannot be compressed. if len(src) != len(blk.literals) || len(src) != e.o.blockSize { - err = blk.encode(e.o.noEntropy) + err = blk.encode(e.o.noEntropy, !e.o.allLitEntropy) } switch err { case errIncompressible: @@ -298,7 +315,9 @@ func (e *Encoder) ReadFrom(r io.Reader) (n int64, err error) { src := e.state.filling for { n2, err := r.Read(src) - _, _ = e.state.encoder.CRC().Write(src[:n2]) + if e.o.crc { + _, _ = e.state.encoder.CRC().Write(src[:n2]) + } // src is now the unfilled part... src = src[n2:] n += int64(n2) @@ -363,6 +382,9 @@ func (e *Encoder) Close() error { if err != nil { return err } + if e.state.fullFrameWritten { + return s.err + } s.wg.Wait() s.wWg.Wait() @@ -422,18 +444,14 @@ func (e *Encoder) EncodeAll(src, dst []byte) []byte { } return dst } - e.init.Do(func() { - e.o.setDefault() - e.initialize() - }) + e.init.Do(e.initialize) enc := <-e.encoders defer func() { // Release encoder reference to last block. - enc.Reset() + // If a non-single block is needed the encoder will reset again. + enc.Reset(true) e.encoders <- enc }() - enc.Reset() - blk := enc.Block() // Use single segments when above minimum window and below 1MB. single := len(src) < 1<<20 && len(src) > MinWindowSize if e.o.single != nil { @@ -456,12 +474,13 @@ func (e *Encoder) EncodeAll(src, dst []byte) []byte { panic(err) } - if len(src) <= e.o.blockSize && len(src) <= maxBlockSize { + // If we can do everything in one block, prefer that. + if len(src) <= maxCompressedBlockSize { // Slightly faster with no history and everything in one block. if e.o.crc { _, _ = enc.CRC().Write(src) } - blk.reset(nil) + blk := enc.Block() blk.last = true enc.EncodeNoHist(blk, src) @@ -472,7 +491,7 @@ func (e *Encoder) EncodeAll(src, dst []byte) []byte { if len(blk.literals) != len(src) || len(src) != e.o.blockSize { // Output directly to dst blk.output = dst - err = blk.encode(e.o.noEntropy) + err = blk.encode(e.o.noEntropy, !e.o.allLitEntropy) } switch err { @@ -488,6 +507,8 @@ func (e *Encoder) EncodeAll(src, dst []byte) []byte { } blk.output = oldout } else { + enc.Reset(false) + blk := enc.Block() for len(src) > 0 { todo := src if len(todo) > e.o.blockSize { @@ -507,7 +528,7 @@ func (e *Encoder) EncodeAll(src, dst []byte) []byte { // If we got the exact same number of literals as input, // assume the literals cannot be compressed. if len(blk.literals) != len(todo) || len(todo) != e.o.blockSize { - err = blk.encode(e.o.noEntropy) + err = blk.encode(e.o.noEntropy, !e.o.allLitEntropy) } switch err { diff --git a/vendor/github.com/klauspost/compress/zstd/encoder_options.go b/vendor/github.com/klauspost/compress/zstd/encoder_options.go index 40eb457331..dfac14ddde 100644 --- a/vendor/github.com/klauspost/compress/zstd/encoder_options.go +++ b/vendor/github.com/klauspost/compress/zstd/encoder_options.go @@ -12,15 +12,18 @@ type EOption func(*encoderOptions) error // options retains accumulated state of multiple options. type encoderOptions struct { - concurrent int - crc bool - single *bool - pad int - blockSize int - windowSize int - level EncoderLevel - fullZero bool - noEntropy bool + concurrent int + level EncoderLevel + single *bool + pad int + blockSize int + windowSize int + crc bool + fullZero bool + noEntropy bool + allLitEntropy bool + customWindow bool + customALEntropy bool } func (o *encoderOptions) setDefault() { @@ -30,7 +33,7 @@ func (o *encoderOptions) setDefault() { crc: true, single: nil, blockSize: 1 << 16, - windowSize: 1 << 22, + windowSize: 8 << 20, level: SpeedDefault, } } @@ -39,9 +42,11 @@ func (o *encoderOptions) setDefault() { func (o encoderOptions) encoder() encoder { switch o.level { case SpeedDefault: - return &doubleFastEncoder{fastEncoder: fastEncoder{maxMatchOff: int32(o.windowSize)}} + return &doubleFastEncoder{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize)}}} + case SpeedBetterCompression: + return &betterFastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize)}} case SpeedFastest: - return &fastEncoder{maxMatchOff: int32(o.windowSize)} + return &fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize)}} } panic("unknown compression level") } @@ -67,7 +72,7 @@ func WithEncoderConcurrency(n int) EOption { } // WithWindowSize will set the maximum allowed back-reference distance. -// The value must be a power of two between WindowSizeMin and WindowSizeMax. +// The value must be a power of two between MinWindowSize and MaxWindowSize. // A larger value will enable better compression but allocate more memory and, // for above-default values, take considerably longer. // The default value is determined by the compression level. @@ -83,6 +88,7 @@ func WithWindowSize(n int) EOption { } o.windowSize = n + o.customWindow = true if o.blockSize > o.windowSize { o.blockSize = o.windowSize } @@ -130,18 +136,18 @@ const ( // This is roughly equivalent to the default Zstandard mode (level 3). SpeedDefault + // SpeedBetterCompression will yield better compression than the default. + // Currently it is about zstd level 7-8 with ~ 2x-3x the default CPU usage. + // By using this, notice that CPU usage may go up in the future. + SpeedBetterCompression + // speedLast should be kept as the last actual compression option. // The is not for external usage, but is used to keep track of the valid options. speedLast - // SpeedBetterCompression will (in the future) yield better compression than the default, - // but at approximately 4x the CPU usage of the default. - // For now this is not implemented. - SpeedBetterCompression = SpeedDefault - // SpeedBestCompression will choose the best available compression option. // For now this is not implemented. - SpeedBestCompression = SpeedDefault + SpeedBestCompression = SpeedBetterCompression ) // EncoderLevelFromString will convert a string representation of an encoding level back @@ -163,8 +169,10 @@ func EncoderLevelFromZstd(level int) EncoderLevel { switch { case level < 3: return SpeedFastest - case level >= 3: + case level >= 3 && level < 6: return SpeedDefault + case level > 5: + return SpeedBetterCompression } return SpeedDefault } @@ -176,6 +184,8 @@ func (e EncoderLevel) String() string { return "fastest" case SpeedDefault: return "default" + case SpeedBetterCompression: + return "better" default: return "invalid" } @@ -189,6 +199,20 @@ func WithEncoderLevel(l EncoderLevel) EOption { return fmt.Errorf("unknown encoder level") } o.level = l + if !o.customWindow { + switch o.level { + case SpeedFastest: + o.windowSize = 4 << 20 + case SpeedDefault: + o.windowSize = 8 << 20 + case SpeedBetterCompression: + o.windowSize = 16 << 20 + } + } + if !o.customALEntropy { + o.allLitEntropy = l > SpeedFastest + } + return nil } } @@ -203,6 +227,18 @@ func WithZeroFrames(b bool) EOption { } } +// WithAllLitEntropyCompression will apply entropy compression if no matches are found. +// Disabling this will skip incompressible data faster, but in cases with no matches but +// skewed character distribution compression is lost. +// Default value depends on the compression level selected. +func WithAllLitEntropyCompression(b bool) EOption { + return func(o *encoderOptions) error { + o.customALEntropy = true + o.allLitEntropy = b + return nil + } +} + // WithNoEntropyCompression will always skip entropy compression of literals. // This can be useful if content has matches, but unlikely to benefit from entropy // compression. Usually the slight speed improvement is not worth enabling this. diff --git a/vendor/github.com/klauspost/compress/zstd/framedec.go b/vendor/github.com/klauspost/compress/zstd/framedec.go index 40790747a3..fc4a566d39 100644 --- a/vendor/github.com/klauspost/compress/zstd/framedec.go +++ b/vendor/github.com/klauspost/compress/zstd/framedec.go @@ -16,16 +16,11 @@ import ( ) type frameDec struct { - o decoderOptions - crc hash.Hash64 - frameDone sync.WaitGroup - offset int64 + o decoderOptions + crc hash.Hash64 + offset int64 - WindowSize uint64 - DictionaryID uint32 - FrameContentSize uint64 - HasCheckSum bool - SingleSegment bool + WindowSize uint64 // maxWindowSize is the maximum windows size to support. // should never be bigger than max-int. @@ -42,15 +37,22 @@ type frameDec struct { // Byte buffer that can be reused for small input blocks. bBuf byteBuf + FrameContentSize uint64 + frameDone sync.WaitGroup + + DictionaryID *uint32 + HasCheckSum bool + SingleSegment bool + // asyncRunning indicates whether the async routine processes input on 'decoding'. - asyncRunning bool asyncRunningMu sync.Mutex + asyncRunning bool } const ( // The minimum Window_Size is 1 KB. MinWindowSize = 1 << 10 - MaxWindowSize = 1 << 30 + MaxWindowSize = 1 << 29 ) var ( @@ -140,7 +142,7 @@ func (d *frameDec) reset(br byteBuffer) error { // Read Dictionary_ID // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary_id - d.DictionaryID = 0 + d.DictionaryID = nil if size := fhd & 3; size != 0 { if size == 3 { size = 4 @@ -152,19 +154,22 @@ func (d *frameDec) reset(br byteBuffer) error { } return io.ErrUnexpectedEOF } + var id uint32 switch size { case 1: - d.DictionaryID = uint32(b[0]) + id = uint32(b[0]) case 2: - d.DictionaryID = uint32(b[0]) | (uint32(b[1]) << 8) + id = uint32(b[0]) | (uint32(b[1]) << 8) case 4: - d.DictionaryID = uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24) + id = uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24) } if debug { - println("Dict size", size, "ID:", d.DictionaryID) + println("Dict size", size, "ID:", id) } - if d.DictionaryID != 0 { - return ErrUnknownDictionary + if id > 0 { + // ID 0 means "sorry, no dictionary anyway". + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary-format + d.DictionaryID = &id } } @@ -231,7 +236,11 @@ func (d *frameDec) reset(br byteBuffer) error { return ErrWindowSizeTooSmall } d.history.windowSize = int(d.WindowSize) - d.history.maxSize = d.history.windowSize + maxBlockSize + if d.o.lowMem && d.history.windowSize < maxBlockSize { + d.history.maxSize = d.history.windowSize * 2 + } else { + d.history.maxSize = d.history.windowSize + maxBlockSize + } // history contains input - maybe we do something d.rawInput = br return nil @@ -318,8 +327,8 @@ func (d *frameDec) checkCRC() error { func (d *frameDec) initAsync() { if !d.o.lowMem && !d.SingleSegment { - // set max extra size history to 20MB. - d.history.maxSize = d.history.windowSize + maxBlockSize*10 + // set max extra size history to 10MB. + d.history.maxSize = d.history.windowSize + maxBlockSize*5 } // re-alloc if more than one extra block size. if d.o.lowMem && cap(d.history.b) > d.history.maxSize+maxBlockSize { @@ -345,8 +354,6 @@ func (d *frameDec) initAsync() { // When the frame has finished decoding the *bufio.Reader // containing the remaining input will be sent on frameDec.frameDone. func (d *frameDec) startDecoder(output chan decodeOutput) { - // TODO: Init to dictionary - d.history.reset() written := int64(0) defer func() { @@ -439,8 +446,6 @@ func (d *frameDec) startDecoder(output chan decodeOutput) { // runDecoder will create a sync decoder that will decode a block of data. func (d *frameDec) runDecoder(dst []byte, dec *blockDec) ([]byte, error) { - // TODO: Init to dictionary - d.history.reset() saved := d.history.b // We use the history for output to avoid copying it. diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder.go b/vendor/github.com/klauspost/compress/zstd/fse_decoder.go index 9efe34feb3..e6d3d49b39 100644 --- a/vendor/github.com/klauspost/compress/zstd/fse_decoder.go +++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder.go @@ -19,7 +19,7 @@ const ( * Increasing memory usage improves compression ratio * Reduced memory usage can improve speed, due to cache effect * Recommended max value is 14, for 16KB, which nicely fits into Intel x86 L1 cache */ - maxMemoryUsage = 11 + maxMemoryUsage = tablelogAbsoluteMax + 2 maxTableLog = maxMemoryUsage - 2 maxTablesize = 1 << maxTableLog @@ -55,7 +55,7 @@ func (s *fseDecoder) readNCount(b *byteReader, maxSymbol uint16) error { if b.remain() < 4 { return errors.New("input too small") } - bitStream := b.Uint32() + bitStream := b.Uint32NC() nbBits := uint((bitStream & 0xF) + minTablelog) // extract tableLog if nbBits > tablelogAbsoluteMax { println("Invalid tablelog:", nbBits) @@ -79,7 +79,8 @@ func (s *fseDecoder) readNCount(b *byteReader, maxSymbol uint16) error { n0 += 24 if r := b.remain(); r > 5 { b.advance(2) - bitStream = b.Uint32() >> bitCount + // The check above should make sure we can read 32 bits + bitStream = b.Uint32NC() >> bitCount } else { // end of bit stream bitStream >>= 16 @@ -104,10 +105,11 @@ func (s *fseDecoder) readNCount(b *byteReader, maxSymbol uint16) error { charnum++ } - if r := b.remain(); r >= 7 || r+int(bitCount>>3) >= 4 { + if r := b.remain(); r >= 7 || r-int(bitCount>>3) >= 4 { b.advance(bitCount >> 3) bitCount &= 7 - bitStream = b.Uint32() >> bitCount + // The check above should make sure we can read 32 bits + bitStream = b.Uint32NC() >> bitCount } else { bitStream >>= 2 } @@ -118,7 +120,7 @@ func (s *fseDecoder) readNCount(b *byteReader, maxSymbol uint16) error { if int32(bitStream)&(threshold-1) < max { count = int32(bitStream) & (threshold - 1) - if debug && nbBits < 1 { + if debugAsserts && nbBits < 1 { panic("nbBits underflow") } bitCount += nbBits - 1 @@ -148,17 +150,16 @@ func (s *fseDecoder) readNCount(b *byteReader, maxSymbol uint16) error { threshold >>= 1 } - //println("b.off:", b.off, "len:", len(b.b), "bc:", bitCount, "remain:", b.remain()) - if r := b.remain(); r >= 7 || r+int(bitCount>>3) >= 4 { + if r := b.remain(); r >= 7 || r-int(bitCount>>3) >= 4 { b.advance(bitCount >> 3) bitCount &= 7 + // The check above should make sure we can read 32 bits + bitStream = b.Uint32NC() >> (bitCount & 31) } else { bitCount -= (uint)(8 * (len(b.b) - 4 - b.off)) b.off = len(b.b) - 4 - //println("b.off:", b.off, "len:", len(b.b), "bc:", bitCount, "iend", iend) + bitStream = b.Uint32() >> (bitCount & 31) } - bitStream = b.Uint32() >> (bitCount & 31) - //printf("bitstream is now: 0b%b", bitStream) } s.symbolLen = charnum if s.symbolLen <= 1 { diff --git a/vendor/github.com/klauspost/compress/zstd/fse_encoder.go b/vendor/github.com/klauspost/compress/zstd/fse_encoder.go index 619836f52f..aa9eba88b8 100644 --- a/vendor/github.com/klauspost/compress/zstd/fse_encoder.go +++ b/vendor/github.com/klauspost/compress/zstd/fse_encoder.go @@ -327,7 +327,7 @@ func (s *fseEncoder) normalizeCount(length int) error { if err != nil { return err } - if debug { + if debugAsserts { err = s.validateNorm() if err != nil { return err @@ -336,7 +336,7 @@ func (s *fseEncoder) normalizeCount(length int) error { return s.buildCTable() } s.norm[largest] += stillToDistribute - if debug { + if debugAsserts { err := s.validateNorm() if err != nil { return err @@ -619,7 +619,7 @@ func (s *fseEncoder) writeCount(out []byte) ([]byte, error) { func (s *fseEncoder) bitCost(symbolValue uint8, accuracyLog uint32) uint32 { minNbBits := s.ct.symbolTT[symbolValue].deltaNbBits >> 16 threshold := (minNbBits + 1) << 16 - if debug { + if debugAsserts { if !(s.actualTableLog < 16) { panic("!s.actualTableLog < 16") } @@ -633,7 +633,7 @@ func (s *fseEncoder) bitCost(symbolValue uint8, accuracyLog uint32) uint32 { // linear interpolation (very approximate) normalizedDeltaFromThreshold := (deltaFromThreshold << accuracyLog) >> s.actualTableLog bitMultiplier := uint32(1) << accuracyLog - if debug { + if debugAsserts { if s.ct.symbolTT[symbolValue].deltaNbBits+tableSize > threshold { panic("s.ct.symbolTT[symbolValue].deltaNbBits+tableSize > threshold") } diff --git a/vendor/github.com/klauspost/compress/zstd/history.go b/vendor/github.com/klauspost/compress/zstd/history.go index e8c419bd53..f418f50fcd 100644 --- a/vendor/github.com/klauspost/compress/zstd/history.go +++ b/vendor/github.com/klauspost/compress/zstd/history.go @@ -17,6 +17,7 @@ type history struct { windowSize int maxSize int error bool + dict *dict } // reset will reset the history to initial state of a frame. @@ -36,12 +37,27 @@ func (h *history) reset() { } h.decoders = sequenceDecs{} if h.huffTree != nil { - huffDecoderPool.Put(h.huffTree) + if h.dict == nil || h.dict.litDec != h.huffTree { + huffDecoderPool.Put(h.huffTree) + } } h.huffTree = nil + h.dict = nil //printf("history created: %+v (l: %d, c: %d)", *h, len(h.b), cap(h.b)) } +func (h *history) setDict(dict *dict) { + if dict == nil { + return + } + h.dict = dict + h.decoders.litLengths = dict.llDec + h.decoders.offsets = dict.ofDec + h.decoders.matchLengths = dict.mlDec + h.recentOffsets = dict.offsets + h.huffTree = dict.litDec +} + // append bytes to history. // This function will make sure there is space for it, // if the buffer has been allocated with enough extra space. diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s index d580e32aed..2c9c5357a1 100644 --- a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s +++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s @@ -179,13 +179,13 @@ TEXT ·writeBlocks(SB), NOSPLIT, $0-40 MOVQ ·prime2v(SB), R14 // Load slice. - MOVQ b_base+8(FP), CX - MOVQ b_len+16(FP), DX + MOVQ arg1_base+8(FP), CX + MOVQ arg1_len+16(FP), DX LEAQ (CX)(DX*1), BX SUBQ $32, BX // Load vN from d. - MOVQ d+0(FP), AX + MOVQ arg+0(FP), AX MOVQ 0(AX), R8 // v1 MOVQ 8(AX), R9 // v2 MOVQ 16(AX), R10 // v3 @@ -209,7 +209,7 @@ blockLoop: MOVQ R11, 24(AX) // The number of bytes written is CX minus the old base pointer. - SUBQ b_base+8(FP), CX + SUBQ arg1_base+8(FP), CX MOVQ CX, ret+32(FP) RET diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec.go b/vendor/github.com/klauspost/compress/zstd/seqdec.go index 15a45f7b50..7ff870400d 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec.go @@ -62,8 +62,10 @@ type sequenceDecs struct { matchLengths sequenceDec prevOffset [3]int hist []byte + dict []byte literals []byte out []byte + windowSize int maxBits uint8 } @@ -82,7 +84,12 @@ func (s *sequenceDecs) initialize(br *bitReader, hist *history, literals, out [] s.hist = hist.b s.prevOffset = hist.recentOffsets s.maxBits = s.litLengths.fse.maxBits + s.offsets.fse.maxBits + s.matchLengths.fse.maxBits + s.windowSize = hist.windowSize s.out = out + s.dict = nil + if hist.dict != nil { + s.dict = hist.dict.content + } return nil } @@ -98,23 +105,78 @@ func (s *sequenceDecs) decode(seqs int, br *bitReader, hist []byte) error { printf("reading sequence %d, exceeded available data\n", seqs-i) return io.ErrUnexpectedEOF } - var litLen, matchOff, matchLen int + var ll, mo, ml int if br.off > 4+((maxOffsetBits+16+16)>>3) { - litLen, matchOff, matchLen = s.nextFast(br, llState, mlState, ofState) + // inlined function: + // ll, mo, ml = s.nextFast(br, llState, mlState, ofState) + + // Final will not read from stream. + var llB, mlB, moB uint8 + ll, llB = llState.final() + ml, mlB = mlState.final() + mo, moB = ofState.final() + + // extra bits are stored in reverse order. + br.fillFast() + mo += br.getBits(moB) + if s.maxBits > 32 { + br.fillFast() + } + ml += br.getBits(mlB) + ll += br.getBits(llB) + + if moB > 1 { + s.prevOffset[2] = s.prevOffset[1] + s.prevOffset[1] = s.prevOffset[0] + s.prevOffset[0] = mo + } else { + // mo = s.adjustOffset(mo, ll, moB) + // Inlined for rather big speedup + if ll == 0 { + // There is an exception though, when current sequence's literals_length = 0. + // In this case, repeated offsets are shifted by one, so an offset_value of 1 means Repeated_Offset2, + // an offset_value of 2 means Repeated_Offset3, and an offset_value of 3 means Repeated_Offset1 - 1_byte. + mo++ + } + + if mo == 0 { + mo = s.prevOffset[0] + } else { + var temp int + if mo == 3 { + temp = s.prevOffset[0] - 1 + } else { + temp = s.prevOffset[mo] + } + + if temp == 0 { + // 0 is not valid; input is corrupted; force offset to 1 + println("temp was 0") + temp = 1 + } + + if mo != 1 { + s.prevOffset[2] = s.prevOffset[1] + } + s.prevOffset[1] = s.prevOffset[0] + s.prevOffset[0] = temp + mo = temp + } + } br.fillFast() } else { - litLen, matchOff, matchLen = s.next(br, llState, mlState, ofState) + ll, mo, ml = s.next(br, llState, mlState, ofState) br.fill() } if debugSequences { - println("Seq", seqs-i-1, "Litlen:", litLen, "matchOff:", matchOff, "(abs) matchLen:", matchLen) + println("Seq", seqs-i-1, "Litlen:", ll, "mo:", mo, "(abs) ml:", ml) } - if litLen > len(s.literals) { - return fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", litLen, len(s.literals)) + if ll > len(s.literals) { + return fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", ll, len(s.literals)) } - size := litLen + matchLen + len(s.out) + size := ll + ml + len(s.out) if size-startSize > maxBlockSize { return fmt.Errorf("output (%d) bigger than max block size", size) } @@ -125,49 +187,70 @@ func (s *sequenceDecs) decode(seqs int, br *bitReader, hist []byte) error { s.out = append(s.out, make([]byte, maxBlockSize)...) s.out = s.out[:len(s.out)-maxBlockSize] } - if matchLen > maxMatchLen { - return fmt.Errorf("match len (%d) bigger than max allowed length", matchLen) - } - if matchOff > len(s.out)+len(hist)+litLen { - return fmt.Errorf("match offset (%d) bigger than current history (%d)", matchOff, len(s.out)+len(hist)+litLen) - } - if matchOff == 0 && matchLen > 0 { - return fmt.Errorf("zero matchoff and matchlen > 0") + if ml > maxMatchLen { + return fmt.Errorf("match len (%d) bigger than max allowed length", ml) } - s.out = append(s.out, s.literals[:litLen]...) - s.literals = s.literals[litLen:] + // Add literals + s.out = append(s.out, s.literals[:ll]...) + s.literals = s.literals[ll:] out := s.out + if mo > len(s.out)+len(hist) || mo > s.windowSize { + if len(s.dict) == 0 { + return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(s.out)+len(hist)) + } + + // we may be in dictionary. + dictO := len(s.dict) - (mo - (len(s.out) + len(hist))) + if dictO < 0 || dictO >= len(s.dict) { + return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(s.out)+len(hist)) + } + end := dictO + ml + if end > len(s.dict) { + out = append(out, s.dict[dictO:]...) + mo -= len(s.dict) - dictO + ml -= len(s.dict) - dictO + } else { + out = append(out, s.dict[dictO:end]...) + mo = 0 + ml = 0 + } + } + + if mo == 0 && ml > 0 { + return fmt.Errorf("zero matchoff and matchlen (%d) > 0", ml) + } + // Copy from history. // TODO: Blocks without history could be made to ignore this completely. - if v := matchOff - len(s.out); v > 0 { + if v := mo - len(s.out); v > 0 { // v is the start position in history from end. start := len(s.hist) - v - if matchLen > v { + if ml > v { // Some goes into current block. // Copy remainder of history out = append(out, s.hist[start:]...) - matchOff -= v - matchLen -= v + mo -= v + ml -= v } else { - out = append(out, s.hist[start:start+matchLen]...) - matchLen = 0 + out = append(out, s.hist[start:start+ml]...) + ml = 0 } } // We must be in current buffer now - if matchLen > 0 { - start := len(s.out) - matchOff - if matchLen <= len(s.out)-start { + if ml > 0 { + start := len(s.out) - mo + if ml <= len(s.out)-start { // No overlap - out = append(out, s.out[start:start+matchLen]...) + out = append(out, s.out[start:start+ml]...) } else { // Overlapping copy // Extend destination slice and copy one byte at the time. - out = out[:len(out)+matchLen] - src := out[start : start+matchLen] + out = out[:len(out)+ml] + src := out[start : start+ml] // Destination is the space we just added. - dst := out[len(out)-matchLen:] + dst := out[len(out)-ml:] dst = dst[:len(src)] for i := range src { dst[i] = src[i] diff --git a/vendor/github.com/klauspost/compress/zstd/snappy.go b/vendor/github.com/klauspost/compress/zstd/snappy.go index 356956ba25..690428cd24 100644 --- a/vendor/github.com/klauspost/compress/zstd/snappy.go +++ b/vendor/github.com/klauspost/compress/zstd/snappy.go @@ -178,7 +178,7 @@ func (r *SnappyConverter) Convert(in io.Reader, w io.Writer) (int64, error) { r.err = ErrSnappyCorrupt return written, r.err } - err = r.block.encode(false) + err = r.block.encode(false, false) switch err { case errIncompressible: r.block.popOffsets() diff --git a/vendor/github.com/klauspost/compress/zstd/zstd.go b/vendor/github.com/klauspost/compress/zstd/zstd.go index 57a8a2f5bb..0807719c8b 100644 --- a/vendor/github.com/klauspost/compress/zstd/zstd.go +++ b/vendor/github.com/klauspost/compress/zstd/zstd.go @@ -6,11 +6,20 @@ package zstd import ( "errors" "log" + "math" "math/bits" ) +// enable debug printing const debug = false + +// Enable extra assertions. +const debugAsserts = debug || false + +// print sequence details const debugSequences = false + +// print detailed matching information const debugMatches = false // force encoder to use predefined tables. @@ -19,6 +28,9 @@ const forcePreDef = false // zstdMinMatch is the minimum zstd match length. const zstdMinMatch = 3 +// Reset the buffer offset when reaching this. +const bufferReset = math.MaxInt32 - MaxWindowSize + var ( // ErrReservedBlockType is returned when a reserved block type is found. // Typically this indicates wrong or corrupted input. @@ -75,6 +87,17 @@ func printf(format string, a ...interface{}) { } } +// matchLenFast does matching, but will not match the last up to 7 bytes. +func matchLenFast(a, b []byte) int { + endI := len(a) & (math.MaxInt32 - 7) + for i := 0; i < endI; i += 8 { + if diff := load64(a, i) ^ load64(b, i); diff != 0 { + return i + bits.TrailingZeros64(diff)>>3 + } + } + return endI +} + // matchLen returns the maximum length. // a must be the shortest of the two. // The function also returns whether all bytes matched. @@ -85,33 +108,18 @@ func matchLen(a, b []byte) int { return i + (bits.TrailingZeros64(diff) >> 3) } } + checked := (len(a) >> 3) << 3 a = a[checked:] b = b[checked:] - // TODO: We could do a 4 check. for i := range a { if a[i] != b[i] { - return int(i) + checked + return i + checked } } return len(a) + checked } -// matchLen returns a match length in src between index s and t -func matchLenIn(src []byte, s, t int32) int32 { - s1 := len(src) - b := src[t:] - a := src[s:s1] - b = b[:len(a)] - // Extend the match to be as long as possible. - for i := range a { - if a[i] != b[i] { - return int32(i) - } - } - return int32(len(a)) -} - func load3232(b []byte, i int32) uint32 { // Help the compiler eliminate bounds checks on the read so it can be done in a single read. b = b[i:] diff --git a/vendor/github.com/klauspost/cpuid/.travis.yml b/vendor/github.com/klauspost/cpuid/.travis.yml deleted file mode 100644 index 4c759adbb4..0000000000 --- a/vendor/github.com/klauspost/cpuid/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: go - -sudo: false - -os: - - linux - - osx -go: - - 1.11.x - - 1.12.x - - 1.13.x - - master - -script: - - go vet ./... - - go test -v ./... - - go test -race ./... - - diff <(gofmt -d .) <("") - -matrix: - allow_failures: - - go: 'master' - fast_finish: true diff --git a/vendor/github.com/klauspost/cpuid/README.md b/vendor/github.com/klauspost/cpuid/README.md deleted file mode 100644 index 58c00f78a1..0000000000 --- a/vendor/github.com/klauspost/cpuid/README.md +++ /dev/null @@ -1,157 +0,0 @@ -# cpuid -Package cpuid provides information about the CPU running the current program. - -CPU features are detected on startup, and kept for fast access through the life of the application. -Currently x86 / x64 (AMD64) is supported, and no external C (cgo) code is used, which should make the library very easy to use. - -You can access the CPU information by accessing the shared CPU variable of the cpuid library. - -Package home: https://github.com/klauspost/cpuid - -[![GoDoc][1]][2] [![Build Status][3]][4] - -[1]: https://godoc.org/github.com/klauspost/cpuid?status.svg -[2]: https://godoc.org/github.com/klauspost/cpuid -[3]: https://travis-ci.org/klauspost/cpuid.svg -[4]: https://travis-ci.org/klauspost/cpuid - -# features -## CPU Instructions -* **CMOV** (i686 CMOV) -* **NX** (NX (No-Execute) bit) -* **AMD3DNOW** (AMD 3DNOW) -* **AMD3DNOWEXT** (AMD 3DNowExt) -* **MMX** (standard MMX) -* **MMXEXT** (SSE integer functions or AMD MMX ext) -* **SSE** (SSE functions) -* **SSE2** (P4 SSE functions) -* **SSE3** (Prescott SSE3 functions) -* **SSSE3** (Conroe SSSE3 functions) -* **SSE4** (Penryn SSE4.1 functions) -* **SSE4A** (AMD Barcelona microarchitecture SSE4a instructions) -* **SSE42** (Nehalem SSE4.2 functions) -* **AVX** (AVX functions) -* **AVX2** (AVX2 functions) -* **FMA3** (Intel FMA 3) -* **FMA4** (Bulldozer FMA4 functions) -* **XOP** (Bulldozer XOP functions) -* **F16C** (Half-precision floating-point conversion) -* **BMI1** (Bit Manipulation Instruction Set 1) -* **BMI2** (Bit Manipulation Instruction Set 2) -* **TBM** (AMD Trailing Bit Manipulation) -* **LZCNT** (LZCNT instruction) -* **POPCNT** (POPCNT instruction) -* **AESNI** (Advanced Encryption Standard New Instructions) -* **CLMUL** (Carry-less Multiplication) -* **HTT** (Hyperthreading (enabled)) -* **HLE** (Hardware Lock Elision) -* **RTM** (Restricted Transactional Memory) -* **RDRAND** (RDRAND instruction is available) -* **RDSEED** (RDSEED instruction is available) -* **ADX** (Intel ADX (Multi-Precision Add-Carry Instruction Extensions)) -* **SHA** (Intel SHA Extensions) -* **AVX512F** (AVX-512 Foundation) -* **AVX512DQ** (AVX-512 Doubleword and Quadword Instructions) -* **AVX512IFMA** (AVX-512 Integer Fused Multiply-Add Instructions) -* **AVX512PF** (AVX-512 Prefetch Instructions) -* **AVX512ER** (AVX-512 Exponential and Reciprocal Instructions) -* **AVX512CD** (AVX-512 Conflict Detection Instructions) -* **AVX512BW** (AVX-512 Byte and Word Instructions) -* **AVX512VL** (AVX-512 Vector Length Extensions) -* **AVX512VBMI** (AVX-512 Vector Bit Manipulation Instructions) -* **AVX512VBMI2** (AVX-512 Vector Bit Manipulation Instructions, Version 2) -* **AVX512VNNI** (AVX-512 Vector Neural Network Instructions) -* **AVX512VPOPCNTDQ** (AVX-512 Vector Population Count Doubleword and Quadword) -* **GFNI** (Galois Field New Instructions) -* **VAES** (Vector AES) -* **AVX512BITALG** (AVX-512 Bit Algorithms) -* **VPCLMULQDQ** (Carry-Less Multiplication Quadword) -* **AVX512BF16** (AVX-512 BFLOAT16 Instructions) -* **AVX512VP2INTERSECT** (AVX-512 Intersect for D/Q) -* **MPX** (Intel MPX (Memory Protection Extensions)) -* **ERMS** (Enhanced REP MOVSB/STOSB) -* **RDTSCP** (RDTSCP Instruction) -* **CX16** (CMPXCHG16B Instruction) -* **SGX** (Software Guard Extensions, with activation details) -* **VMX** (Virtual Machine Extensions) - -## Performance -* **RDTSCP()** Returns current cycle count. Can be used for benchmarking. -* **SSE2SLOW** (SSE2 is supported, but usually not faster) -* **SSE3SLOW** (SSE3 is supported, but usually not faster) -* **ATOM** (Atom processor, some SSSE3 instructions are slower) -* **Cache line** (Probable size of a cache line). -* **L1, L2, L3 Cache size** on newer Intel/AMD CPUs. - -## Cpu Vendor/VM -* **Intel** -* **AMD** -* **VIA** -* **Transmeta** -* **NSC** -* **KVM** (Kernel-based Virtual Machine) -* **MSVM** (Microsoft Hyper-V or Windows Virtual PC) -* **VMware** -* **XenHVM** -* **Bhyve** -* **Hygon** - -# installing - -```go get github.com/klauspost/cpuid``` - -# example - -```Go -package main - -import ( - "fmt" - "github.com/klauspost/cpuid" -) - -func main() { - // Print basic CPU information: - fmt.Println("Name:", cpuid.CPU.BrandName) - fmt.Println("PhysicalCores:", cpuid.CPU.PhysicalCores) - fmt.Println("ThreadsPerCore:", cpuid.CPU.ThreadsPerCore) - fmt.Println("LogicalCores:", cpuid.CPU.LogicalCores) - fmt.Println("Family", cpuid.CPU.Family, "Model:", cpuid.CPU.Model) - fmt.Println("Features:", cpuid.CPU.Features) - fmt.Println("Cacheline bytes:", cpuid.CPU.CacheLine) - fmt.Println("L1 Data Cache:", cpuid.CPU.Cache.L1D, "bytes") - fmt.Println("L1 Instruction Cache:", cpuid.CPU.Cache.L1D, "bytes") - fmt.Println("L2 Cache:", cpuid.CPU.Cache.L2, "bytes") - fmt.Println("L3 Cache:", cpuid.CPU.Cache.L3, "bytes") - - // Test if we have a specific feature: - if cpuid.CPU.SSE() { - fmt.Println("We have Streaming SIMD Extensions") - } -} -``` - -Sample output: -``` ->go run main.go -Name: Intel(R) Core(TM) i5-2540M CPU @ 2.60GHz -PhysicalCores: 2 -ThreadsPerCore: 2 -LogicalCores: 4 -Family 6 Model: 42 -Features: CMOV,MMX,MMXEXT,SSE,SSE2,SSE3,SSSE3,SSE4.1,SSE4.2,AVX,AESNI,CLMUL -Cacheline bytes: 64 -We have Streaming SIMD Extensions -``` - -# private package - -In the "private" folder you can find an autogenerated version of the library you can include in your own packages. - -For this purpose all exports are removed, and functions and constants are lowercased. - -This is not a recommended way of using the library, but provided for convenience, if it is difficult for you to use external packages. - -# license - -This code is published under an MIT license. See LICENSE file for more information. diff --git a/vendor/github.com/klauspost/cpuid/cpuid.go b/vendor/github.com/klauspost/cpuid/cpuid.go deleted file mode 100644 index 4921bcd551..0000000000 --- a/vendor/github.com/klauspost/cpuid/cpuid.go +++ /dev/null @@ -1,1308 +0,0 @@ -// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. - -// Package cpuid provides information about the CPU running the current program. -// -// CPU features are detected on startup, and kept for fast access through the life of the application. -// Currently x86 / x64 (AMD64) is supported. -// -// You can access the CPU information by accessing the shared CPU variable of the cpuid library. -// -// Package home: https://github.com/klauspost/cpuid -package cpuid - -import ( - "math" - "strings" -) - -// AMD refererence: https://www.amd.com/system/files/TechDocs/25481.pdf -// and Processor Programming Reference (PPR) - -// Vendor is a representation of a CPU vendor. -type Vendor int - -const ( - Other Vendor = iota - Intel - AMD - VIA - Transmeta - NSC - KVM // Kernel-based Virtual Machine - MSVM // Microsoft Hyper-V or Windows Virtual PC - VMware - XenHVM - Bhyve - Hygon -) - -const ( - CMOV = 1 << iota // i686 CMOV - NX // NX (No-Execute) bit - AMD3DNOW // AMD 3DNOW - AMD3DNOWEXT // AMD 3DNowExt - MMX // standard MMX - MMXEXT // SSE integer functions or AMD MMX ext - SSE // SSE functions - SSE2 // P4 SSE functions - SSE3 // Prescott SSE3 functions - SSSE3 // Conroe SSSE3 functions - SSE4 // Penryn SSE4.1 functions - SSE4A // AMD Barcelona microarchitecture SSE4a instructions - SSE42 // Nehalem SSE4.2 functions - AVX // AVX functions - AVX2 // AVX2 functions - FMA3 // Intel FMA 3 - FMA4 // Bulldozer FMA4 functions - XOP // Bulldozer XOP functions - F16C // Half-precision floating-point conversion - BMI1 // Bit Manipulation Instruction Set 1 - BMI2 // Bit Manipulation Instruction Set 2 - TBM // AMD Trailing Bit Manipulation - LZCNT // LZCNT instruction - POPCNT // POPCNT instruction - AESNI // Advanced Encryption Standard New Instructions - CLMUL // Carry-less Multiplication - HTT // Hyperthreading (enabled) - HLE // Hardware Lock Elision - RTM // Restricted Transactional Memory - RDRAND // RDRAND instruction is available - RDSEED // RDSEED instruction is available - ADX // Intel ADX (Multi-Precision Add-Carry Instruction Extensions) - SHA // Intel SHA Extensions - AVX512F // AVX-512 Foundation - AVX512DQ // AVX-512 Doubleword and Quadword Instructions - AVX512IFMA // AVX-512 Integer Fused Multiply-Add Instructions - AVX512PF // AVX-512 Prefetch Instructions - AVX512ER // AVX-512 Exponential and Reciprocal Instructions - AVX512CD // AVX-512 Conflict Detection Instructions - AVX512BW // AVX-512 Byte and Word Instructions - AVX512VL // AVX-512 Vector Length Extensions - AVX512VBMI // AVX-512 Vector Bit Manipulation Instructions - AVX512VBMI2 // AVX-512 Vector Bit Manipulation Instructions, Version 2 - AVX512VNNI // AVX-512 Vector Neural Network Instructions - AVX512VPOPCNTDQ // AVX-512 Vector Population Count Doubleword and Quadword - GFNI // Galois Field New Instructions - VAES // Vector AES - AVX512BITALG // AVX-512 Bit Algorithms - VPCLMULQDQ // Carry-Less Multiplication Quadword - AVX512BF16 // AVX-512 BFLOAT16 Instructions - AVX512VP2INTERSECT // AVX-512 Intersect for D/Q - MPX // Intel MPX (Memory Protection Extensions) - ERMS // Enhanced REP MOVSB/STOSB - RDTSCP // RDTSCP Instruction - CX16 // CMPXCHG16B Instruction - SGX // Software Guard Extensions - SGXLC // Software Guard Extensions Launch Control - IBPB // Indirect Branch Restricted Speculation (IBRS) and Indirect Branch Predictor Barrier (IBPB) - STIBP // Single Thread Indirect Branch Predictors - VMX // Virtual Machine Extensions - - // Performance indicators - SSE2SLOW // SSE2 is supported, but usually not faster - SSE3SLOW // SSE3 is supported, but usually not faster - ATOM // Atom processor, some SSSE3 instructions are slower -) - -var flagNames = map[Flags]string{ - CMOV: "CMOV", // i686 CMOV - NX: "NX", // NX (No-Execute) bit - AMD3DNOW: "AMD3DNOW", // AMD 3DNOW - AMD3DNOWEXT: "AMD3DNOWEXT", // AMD 3DNowExt - MMX: "MMX", // Standard MMX - MMXEXT: "MMXEXT", // SSE integer functions or AMD MMX ext - SSE: "SSE", // SSE functions - SSE2: "SSE2", // P4 SSE2 functions - SSE3: "SSE3", // Prescott SSE3 functions - SSSE3: "SSSE3", // Conroe SSSE3 functions - SSE4: "SSE4.1", // Penryn SSE4.1 functions - SSE4A: "SSE4A", // AMD Barcelona microarchitecture SSE4a instructions - SSE42: "SSE4.2", // Nehalem SSE4.2 functions - AVX: "AVX", // AVX functions - AVX2: "AVX2", // AVX functions - FMA3: "FMA3", // Intel FMA 3 - FMA4: "FMA4", // Bulldozer FMA4 functions - XOP: "XOP", // Bulldozer XOP functions - F16C: "F16C", // Half-precision floating-point conversion - BMI1: "BMI1", // Bit Manipulation Instruction Set 1 - BMI2: "BMI2", // Bit Manipulation Instruction Set 2 - TBM: "TBM", // AMD Trailing Bit Manipulation - LZCNT: "LZCNT", // LZCNT instruction - POPCNT: "POPCNT", // POPCNT instruction - AESNI: "AESNI", // Advanced Encryption Standard New Instructions - CLMUL: "CLMUL", // Carry-less Multiplication - HTT: "HTT", // Hyperthreading (enabled) - HLE: "HLE", // Hardware Lock Elision - RTM: "RTM", // Restricted Transactional Memory - RDRAND: "RDRAND", // RDRAND instruction is available - RDSEED: "RDSEED", // RDSEED instruction is available - ADX: "ADX", // Intel ADX (Multi-Precision Add-Carry Instruction Extensions) - SHA: "SHA", // Intel SHA Extensions - AVX512F: "AVX512F", // AVX-512 Foundation - AVX512DQ: "AVX512DQ", // AVX-512 Doubleword and Quadword Instructions - AVX512IFMA: "AVX512IFMA", // AVX-512 Integer Fused Multiply-Add Instructions - AVX512PF: "AVX512PF", // AVX-512 Prefetch Instructions - AVX512ER: "AVX512ER", // AVX-512 Exponential and Reciprocal Instructions - AVX512CD: "AVX512CD", // AVX-512 Conflict Detection Instructions - AVX512BW: "AVX512BW", // AVX-512 Byte and Word Instructions - AVX512VL: "AVX512VL", // AVX-512 Vector Length Extensions - AVX512VBMI: "AVX512VBMI", // AVX-512 Vector Bit Manipulation Instructions - AVX512VBMI2: "AVX512VBMI2", // AVX-512 Vector Bit Manipulation Instructions, Version 2 - AVX512VNNI: "AVX512VNNI", // AVX-512 Vector Neural Network Instructions - AVX512VPOPCNTDQ: "AVX512VPOPCNTDQ", // AVX-512 Vector Population Count Doubleword and Quadword - GFNI: "GFNI", // Galois Field New Instructions - VAES: "VAES", // Vector AES - AVX512BITALG: "AVX512BITALG", // AVX-512 Bit Algorithms - VPCLMULQDQ: "VPCLMULQDQ", // Carry-Less Multiplication Quadword - AVX512BF16: "AVX512BF16", // AVX-512 BFLOAT16 Instruction - AVX512VP2INTERSECT: "AVX512VP2INTERSECT", // AVX-512 Intersect for D/Q - MPX: "MPX", // Intel MPX (Memory Protection Extensions) - ERMS: "ERMS", // Enhanced REP MOVSB/STOSB - RDTSCP: "RDTSCP", // RDTSCP Instruction - CX16: "CX16", // CMPXCHG16B Instruction - SGX: "SGX", // Software Guard Extensions - SGXLC: "SGXLC", // Software Guard Extensions Launch Control - IBPB: "IBPB", // Indirect Branch Restricted Speculation and Indirect Branch Predictor Barrier - STIBP: "STIBP", // Single Thread Indirect Branch Predictors - VMX: "VMX", // Virtual Machine Extensions - - // Performance indicators - SSE2SLOW: "SSE2SLOW", // SSE2 supported, but usually not faster - SSE3SLOW: "SSE3SLOW", // SSE3 supported, but usually not faster - ATOM: "ATOM", // Atom processor, some SSSE3 instructions are slower - -} - -// CPUInfo contains information about the detected system CPU. -type CPUInfo struct { - BrandName string // Brand name reported by the CPU - VendorID Vendor // Comparable CPU vendor ID - Features Flags // Features of the CPU - PhysicalCores int // Number of physical processor cores in your CPU. Will be 0 if undetectable. - ThreadsPerCore int // Number of threads per physical core. Will be 1 if undetectable. - LogicalCores int // Number of physical cores times threads that can run on each core through the use of hyperthreading. Will be 0 if undetectable. - Family int // CPU family number - Model int // CPU model number - CacheLine int // Cache line size in bytes. Will be 0 if undetectable. - Hz int64 // Clock speed, if known - Cache struct { - L1I int // L1 Instruction Cache (per core or shared). Will be -1 if undetected - L1D int // L1 Data Cache (per core or shared). Will be -1 if undetected - L2 int // L2 Cache (per core or shared). Will be -1 if undetected - L3 int // L3 Cache (per core, per ccx or shared). Will be -1 if undetected - } - SGX SGXSupport - maxFunc uint32 - maxExFunc uint32 -} - -var cpuid func(op uint32) (eax, ebx, ecx, edx uint32) -var cpuidex func(op, op2 uint32) (eax, ebx, ecx, edx uint32) -var xgetbv func(index uint32) (eax, edx uint32) -var rdtscpAsm func() (eax, ebx, ecx, edx uint32) - -// CPU contains information about the CPU as detected on startup, -// or when Detect last was called. -// -// Use this as the primary entry point to you data, -// this way queries are -var CPU CPUInfo - -func init() { - initCPU() - Detect() -} - -// Detect will re-detect current CPU info. -// This will replace the content of the exported CPU variable. -// -// Unless you expect the CPU to change while you are running your program -// you should not need to call this function. -// If you call this, you must ensure that no other goroutine is accessing the -// exported CPU variable. -func Detect() { - CPU.maxFunc = maxFunctionID() - CPU.maxExFunc = maxExtendedFunction() - CPU.BrandName = brandName() - CPU.CacheLine = cacheLine() - CPU.Family, CPU.Model = familyModel() - CPU.Features = support() - CPU.SGX = hasSGX(CPU.Features&SGX != 0, CPU.Features&SGXLC != 0) - CPU.ThreadsPerCore = threadsPerCore() - CPU.LogicalCores = logicalCores() - CPU.PhysicalCores = physicalCores() - CPU.VendorID = vendorID() - CPU.Hz = hertz(CPU.BrandName) - CPU.cacheSize() -} - -// Generated here: http://play.golang.org/p/BxFH2Gdc0G - -// Cmov indicates support of CMOV instructions -func (c CPUInfo) Cmov() bool { - return c.Features&CMOV != 0 -} - -// Amd3dnow indicates support of AMD 3DNOW! instructions -func (c CPUInfo) Amd3dnow() bool { - return c.Features&AMD3DNOW != 0 -} - -// Amd3dnowExt indicates support of AMD 3DNOW! Extended instructions -func (c CPUInfo) Amd3dnowExt() bool { - return c.Features&AMD3DNOWEXT != 0 -} - -// VMX indicates support of VMX -func (c CPUInfo) VMX() bool { - return c.Features&VMX != 0 -} - -// MMX indicates support of MMX instructions -func (c CPUInfo) MMX() bool { - return c.Features&MMX != 0 -} - -// MMXExt indicates support of MMXEXT instructions -// (SSE integer functions or AMD MMX ext) -func (c CPUInfo) MMXExt() bool { - return c.Features&MMXEXT != 0 -} - -// SSE indicates support of SSE instructions -func (c CPUInfo) SSE() bool { - return c.Features&SSE != 0 -} - -// SSE2 indicates support of SSE 2 instructions -func (c CPUInfo) SSE2() bool { - return c.Features&SSE2 != 0 -} - -// SSE3 indicates support of SSE 3 instructions -func (c CPUInfo) SSE3() bool { - return c.Features&SSE3 != 0 -} - -// SSSE3 indicates support of SSSE 3 instructions -func (c CPUInfo) SSSE3() bool { - return c.Features&SSSE3 != 0 -} - -// SSE4 indicates support of SSE 4 (also called SSE 4.1) instructions -func (c CPUInfo) SSE4() bool { - return c.Features&SSE4 != 0 -} - -// SSE42 indicates support of SSE4.2 instructions -func (c CPUInfo) SSE42() bool { - return c.Features&SSE42 != 0 -} - -// AVX indicates support of AVX instructions -// and operating system support of AVX instructions -func (c CPUInfo) AVX() bool { - return c.Features&AVX != 0 -} - -// AVX2 indicates support of AVX2 instructions -func (c CPUInfo) AVX2() bool { - return c.Features&AVX2 != 0 -} - -// FMA3 indicates support of FMA3 instructions -func (c CPUInfo) FMA3() bool { - return c.Features&FMA3 != 0 -} - -// FMA4 indicates support of FMA4 instructions -func (c CPUInfo) FMA4() bool { - return c.Features&FMA4 != 0 -} - -// XOP indicates support of XOP instructions -func (c CPUInfo) XOP() bool { - return c.Features&XOP != 0 -} - -// F16C indicates support of F16C instructions -func (c CPUInfo) F16C() bool { - return c.Features&F16C != 0 -} - -// BMI1 indicates support of BMI1 instructions -func (c CPUInfo) BMI1() bool { - return c.Features&BMI1 != 0 -} - -// BMI2 indicates support of BMI2 instructions -func (c CPUInfo) BMI2() bool { - return c.Features&BMI2 != 0 -} - -// TBM indicates support of TBM instructions -// (AMD Trailing Bit Manipulation) -func (c CPUInfo) TBM() bool { - return c.Features&TBM != 0 -} - -// Lzcnt indicates support of LZCNT instruction -func (c CPUInfo) Lzcnt() bool { - return c.Features&LZCNT != 0 -} - -// Popcnt indicates support of POPCNT instruction -func (c CPUInfo) Popcnt() bool { - return c.Features&POPCNT != 0 -} - -// HTT indicates the processor has Hyperthreading enabled -func (c CPUInfo) HTT() bool { - return c.Features&HTT != 0 -} - -// SSE2Slow indicates that SSE2 may be slow on this processor -func (c CPUInfo) SSE2Slow() bool { - return c.Features&SSE2SLOW != 0 -} - -// SSE3Slow indicates that SSE3 may be slow on this processor -func (c CPUInfo) SSE3Slow() bool { - return c.Features&SSE3SLOW != 0 -} - -// AesNi indicates support of AES-NI instructions -// (Advanced Encryption Standard New Instructions) -func (c CPUInfo) AesNi() bool { - return c.Features&AESNI != 0 -} - -// Clmul indicates support of CLMUL instructions -// (Carry-less Multiplication) -func (c CPUInfo) Clmul() bool { - return c.Features&CLMUL != 0 -} - -// NX indicates support of NX (No-Execute) bit -func (c CPUInfo) NX() bool { - return c.Features&NX != 0 -} - -// SSE4A indicates support of AMD Barcelona microarchitecture SSE4a instructions -func (c CPUInfo) SSE4A() bool { - return c.Features&SSE4A != 0 -} - -// HLE indicates support of Hardware Lock Elision -func (c CPUInfo) HLE() bool { - return c.Features&HLE != 0 -} - -// RTM indicates support of Restricted Transactional Memory -func (c CPUInfo) RTM() bool { - return c.Features&RTM != 0 -} - -// Rdrand indicates support of RDRAND instruction is available -func (c CPUInfo) Rdrand() bool { - return c.Features&RDRAND != 0 -} - -// Rdseed indicates support of RDSEED instruction is available -func (c CPUInfo) Rdseed() bool { - return c.Features&RDSEED != 0 -} - -// ADX indicates support of Intel ADX (Multi-Precision Add-Carry Instruction Extensions) -func (c CPUInfo) ADX() bool { - return c.Features&ADX != 0 -} - -// SHA indicates support of Intel SHA Extensions -func (c CPUInfo) SHA() bool { - return c.Features&SHA != 0 -} - -// AVX512F indicates support of AVX-512 Foundation -func (c CPUInfo) AVX512F() bool { - return c.Features&AVX512F != 0 -} - -// AVX512DQ indicates support of AVX-512 Doubleword and Quadword Instructions -func (c CPUInfo) AVX512DQ() bool { - return c.Features&AVX512DQ != 0 -} - -// AVX512IFMA indicates support of AVX-512 Integer Fused Multiply-Add Instructions -func (c CPUInfo) AVX512IFMA() bool { - return c.Features&AVX512IFMA != 0 -} - -// AVX512PF indicates support of AVX-512 Prefetch Instructions -func (c CPUInfo) AVX512PF() bool { - return c.Features&AVX512PF != 0 -} - -// AVX512ER indicates support of AVX-512 Exponential and Reciprocal Instructions -func (c CPUInfo) AVX512ER() bool { - return c.Features&AVX512ER != 0 -} - -// AVX512CD indicates support of AVX-512 Conflict Detection Instructions -func (c CPUInfo) AVX512CD() bool { - return c.Features&AVX512CD != 0 -} - -// AVX512BW indicates support of AVX-512 Byte and Word Instructions -func (c CPUInfo) AVX512BW() bool { - return c.Features&AVX512BW != 0 -} - -// AVX512VL indicates support of AVX-512 Vector Length Extensions -func (c CPUInfo) AVX512VL() bool { - return c.Features&AVX512VL != 0 -} - -// AVX512VBMI indicates support of AVX-512 Vector Bit Manipulation Instructions -func (c CPUInfo) AVX512VBMI() bool { - return c.Features&AVX512VBMI != 0 -} - -// AVX512VBMI2 indicates support of AVX-512 Vector Bit Manipulation Instructions, Version 2 -func (c CPUInfo) AVX512VBMI2() bool { - return c.Features&AVX512VBMI2 != 0 -} - -// AVX512VNNI indicates support of AVX-512 Vector Neural Network Instructions -func (c CPUInfo) AVX512VNNI() bool { - return c.Features&AVX512VNNI != 0 -} - -// AVX512VPOPCNTDQ indicates support of AVX-512 Vector Population Count Doubleword and Quadword -func (c CPUInfo) AVX512VPOPCNTDQ() bool { - return c.Features&AVX512VPOPCNTDQ != 0 -} - -// GFNI indicates support of Galois Field New Instructions -func (c CPUInfo) GFNI() bool { - return c.Features&GFNI != 0 -} - -// VAES indicates support of Vector AES -func (c CPUInfo) VAES() bool { - return c.Features&VAES != 0 -} - -// AVX512BITALG indicates support of AVX-512 Bit Algorithms -func (c CPUInfo) AVX512BITALG() bool { - return c.Features&AVX512BITALG != 0 -} - -// VPCLMULQDQ indicates support of Carry-Less Multiplication Quadword -func (c CPUInfo) VPCLMULQDQ() bool { - return c.Features&VPCLMULQDQ != 0 -} - -// AVX512BF16 indicates support of -func (c CPUInfo) AVX512BF16() bool { - return c.Features&AVX512BF16 != 0 -} - -// AVX512VP2INTERSECT indicates support of -func (c CPUInfo) AVX512VP2INTERSECT() bool { - return c.Features&AVX512VP2INTERSECT != 0 -} - -// MPX indicates support of Intel MPX (Memory Protection Extensions) -func (c CPUInfo) MPX() bool { - return c.Features&MPX != 0 -} - -// ERMS indicates support of Enhanced REP MOVSB/STOSB -func (c CPUInfo) ERMS() bool { - return c.Features&ERMS != 0 -} - -// RDTSCP Instruction is available. -func (c CPUInfo) RDTSCP() bool { - return c.Features&RDTSCP != 0 -} - -// CX16 indicates if CMPXCHG16B instruction is available. -func (c CPUInfo) CX16() bool { - return c.Features&CX16 != 0 -} - -// TSX is split into HLE (Hardware Lock Elision) and RTM (Restricted Transactional Memory) detection. -// So TSX simply checks that. -func (c CPUInfo) TSX() bool { - return c.Features&(HLE|RTM) == HLE|RTM -} - -// Atom indicates an Atom processor -func (c CPUInfo) Atom() bool { - return c.Features&ATOM != 0 -} - -// Intel returns true if vendor is recognized as Intel -func (c CPUInfo) Intel() bool { - return c.VendorID == Intel -} - -// AMD returns true if vendor is recognized as AMD -func (c CPUInfo) AMD() bool { - return c.VendorID == AMD -} - -// Hygon returns true if vendor is recognized as Hygon -func (c CPUInfo) Hygon() bool { - return c.VendorID == Hygon -} - -// Transmeta returns true if vendor is recognized as Transmeta -func (c CPUInfo) Transmeta() bool { - return c.VendorID == Transmeta -} - -// NSC returns true if vendor is recognized as National Semiconductor -func (c CPUInfo) NSC() bool { - return c.VendorID == NSC -} - -// VIA returns true if vendor is recognized as VIA -func (c CPUInfo) VIA() bool { - return c.VendorID == VIA -} - -// RTCounter returns the 64-bit time-stamp counter -// Uses the RDTSCP instruction. The value 0 is returned -// if the CPU does not support the instruction. -func (c CPUInfo) RTCounter() uint64 { - if !c.RDTSCP() { - return 0 - } - a, _, _, d := rdtscpAsm() - return uint64(a) | (uint64(d) << 32) -} - -// Ia32TscAux returns the IA32_TSC_AUX part of the RDTSCP. -// This variable is OS dependent, but on Linux contains information -// about the current cpu/core the code is running on. -// If the RDTSCP instruction isn't supported on the CPU, the value 0 is returned. -func (c CPUInfo) Ia32TscAux() uint32 { - if !c.RDTSCP() { - return 0 - } - _, _, ecx, _ := rdtscpAsm() - return ecx -} - -// LogicalCPU will return the Logical CPU the code is currently executing on. -// This is likely to change when the OS re-schedules the running thread -// to another CPU. -// If the current core cannot be detected, -1 will be returned. -func (c CPUInfo) LogicalCPU() int { - if c.maxFunc < 1 { - return -1 - } - _, ebx, _, _ := cpuid(1) - return int(ebx >> 24) -} - -// hertz tries to compute the clock speed of the CPU. If leaf 15 is -// supported, use it, otherwise parse the brand string. Yes, really. -func hertz(model string) int64 { - mfi := maxFunctionID() - if mfi >= 0x15 { - eax, ebx, ecx, _ := cpuid(0x15) - if eax != 0 && ebx != 0 && ecx != 0 { - return int64((int64(ecx) * int64(ebx)) / int64(eax)) - } - } - // computeHz determines the official rated speed of a CPU from its brand - // string. This insanity is *actually the official documented way to do - // this according to Intel*, prior to leaf 0x15 existing. The official - // documentation only shows this working for exactly `x.xx` or `xxxx` - // cases, e.g., `2.50GHz` or `1300MHz`; this parser will accept other - // sizes. - hz := strings.LastIndex(model, "Hz") - if hz < 3 { - return -1 - } - var multiplier int64 - switch model[hz-1] { - case 'M': - multiplier = 1000 * 1000 - case 'G': - multiplier = 1000 * 1000 * 1000 - case 'T': - multiplier = 1000 * 1000 * 1000 * 1000 - } - if multiplier == 0 { - return -1 - } - freq := int64(0) - divisor := int64(0) - decimalShift := int64(1) - var i int - for i = hz - 2; i >= 0 && model[i] != ' '; i-- { - if model[i] >= '0' && model[i] <= '9' { - freq += int64(model[i]-'0') * decimalShift - decimalShift *= 10 - } else if model[i] == '.' { - if divisor != 0 { - return -1 - } - divisor = decimalShift - } else { - return -1 - } - } - // we didn't find a space - if i < 0 { - return -1 - } - if divisor != 0 { - return (freq * multiplier) / divisor - } - return freq * multiplier -} - -// VM Will return true if the cpu id indicates we are in -// a virtual machine. This is only a hint, and will very likely -// have many false negatives. -func (c CPUInfo) VM() bool { - switch c.VendorID { - case MSVM, KVM, VMware, XenHVM, Bhyve: - return true - } - return false -} - -// Flags contains detected cpu features and caracteristics -type Flags uint64 - -// String returns a string representation of the detected -// CPU features. -func (f Flags) String() string { - return strings.Join(f.Strings(), ",") -} - -// Strings returns and array of the detected features. -func (f Flags) Strings() []string { - s := support() - r := make([]string, 0, 20) - for i := uint(0); i < 64; i++ { - key := Flags(1 << i) - val := flagNames[key] - if s&key != 0 { - r = append(r, val) - } - } - return r -} - -func maxExtendedFunction() uint32 { - eax, _, _, _ := cpuid(0x80000000) - return eax -} - -func maxFunctionID() uint32 { - a, _, _, _ := cpuid(0) - return a -} - -func brandName() string { - if maxExtendedFunction() >= 0x80000004 { - v := make([]uint32, 0, 48) - for i := uint32(0); i < 3; i++ { - a, b, c, d := cpuid(0x80000002 + i) - v = append(v, a, b, c, d) - } - return strings.Trim(string(valAsString(v...)), " ") - } - return "unknown" -} - -func threadsPerCore() int { - mfi := maxFunctionID() - if mfi < 0x4 || (vendorID() != Intel && vendorID() != AMD) { - return 1 - } - - if mfi < 0xb { - if vendorID() != Intel { - return 1 - } - _, b, _, d := cpuid(1) - if (d & (1 << 28)) != 0 { - // v will contain logical core count - v := (b >> 16) & 255 - if v > 1 { - a4, _, _, _ := cpuid(4) - // physical cores - v2 := (a4 >> 26) + 1 - if v2 > 0 { - return int(v) / int(v2) - } - } - } - return 1 - } - _, b, _, _ := cpuidex(0xb, 0) - if b&0xffff == 0 { - return 1 - } - return int(b & 0xffff) -} - -func logicalCores() int { - mfi := maxFunctionID() - switch vendorID() { - case Intel: - // Use this on old Intel processors - if mfi < 0xb { - if mfi < 1 { - return 0 - } - // CPUID.1:EBX[23:16] represents the maximum number of addressable IDs (initial APIC ID) - // that can be assigned to logical processors in a physical package. - // The value may not be the same as the number of logical processors that are present in the hardware of a physical package. - _, ebx, _, _ := cpuid(1) - logical := (ebx >> 16) & 0xff - return int(logical) - } - _, b, _, _ := cpuidex(0xb, 1) - return int(b & 0xffff) - case AMD, Hygon: - _, b, _, _ := cpuid(1) - return int((b >> 16) & 0xff) - default: - return 0 - } -} - -func familyModel() (int, int) { - if maxFunctionID() < 0x1 { - return 0, 0 - } - eax, _, _, _ := cpuid(1) - family := ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff) - model := ((eax >> 4) & 0xf) + ((eax >> 12) & 0xf0) - return int(family), int(model) -} - -func physicalCores() int { - switch vendorID() { - case Intel: - return logicalCores() / threadsPerCore() - case AMD, Hygon: - lc := logicalCores() - tpc := threadsPerCore() - if lc > 0 && tpc > 0 { - return lc / tpc - } - // The following is inaccurate on AMD EPYC 7742 64-Core Processor - - if maxExtendedFunction() >= 0x80000008 { - _, _, c, _ := cpuid(0x80000008) - return int(c&0xff) + 1 - } - } - return 0 -} - -// Except from http://en.wikipedia.org/wiki/CPUID#EAX.3D0:_Get_vendor_ID -var vendorMapping = map[string]Vendor{ - "AMDisbetter!": AMD, - "AuthenticAMD": AMD, - "CentaurHauls": VIA, - "GenuineIntel": Intel, - "TransmetaCPU": Transmeta, - "GenuineTMx86": Transmeta, - "Geode by NSC": NSC, - "VIA VIA VIA ": VIA, - "KVMKVMKVMKVM": KVM, - "Microsoft Hv": MSVM, - "VMwareVMware": VMware, - "XenVMMXenVMM": XenHVM, - "bhyve bhyve ": Bhyve, - "HygonGenuine": Hygon, -} - -func vendorID() Vendor { - _, b, c, d := cpuid(0) - v := valAsString(b, d, c) - vend, ok := vendorMapping[string(v)] - if !ok { - return Other - } - return vend -} - -func cacheLine() int { - if maxFunctionID() < 0x1 { - return 0 - } - - _, ebx, _, _ := cpuid(1) - cache := (ebx & 0xff00) >> 5 // cflush size - if cache == 0 && maxExtendedFunction() >= 0x80000006 { - _, _, ecx, _ := cpuid(0x80000006) - cache = ecx & 0xff // cacheline size - } - // TODO: Read from Cache and TLB Information - return int(cache) -} - -func (c *CPUInfo) cacheSize() { - c.Cache.L1D = -1 - c.Cache.L1I = -1 - c.Cache.L2 = -1 - c.Cache.L3 = -1 - vendor := vendorID() - switch vendor { - case Intel: - if maxFunctionID() < 4 { - return - } - for i := uint32(0); ; i++ { - eax, ebx, ecx, _ := cpuidex(4, i) - cacheType := eax & 15 - if cacheType == 0 { - break - } - cacheLevel := (eax >> 5) & 7 - coherency := int(ebx&0xfff) + 1 - partitions := int((ebx>>12)&0x3ff) + 1 - associativity := int((ebx>>22)&0x3ff) + 1 - sets := int(ecx) + 1 - size := associativity * partitions * coherency * sets - switch cacheLevel { - case 1: - if cacheType == 1 { - // 1 = Data Cache - c.Cache.L1D = size - } else if cacheType == 2 { - // 2 = Instruction Cache - c.Cache.L1I = size - } else { - if c.Cache.L1D < 0 { - c.Cache.L1I = size - } - if c.Cache.L1I < 0 { - c.Cache.L1I = size - } - } - case 2: - c.Cache.L2 = size - case 3: - c.Cache.L3 = size - } - } - case AMD, Hygon: - // Untested. - if maxExtendedFunction() < 0x80000005 { - return - } - _, _, ecx, edx := cpuid(0x80000005) - c.Cache.L1D = int(((ecx >> 24) & 0xFF) * 1024) - c.Cache.L1I = int(((edx >> 24) & 0xFF) * 1024) - - if maxExtendedFunction() < 0x80000006 { - return - } - _, _, ecx, _ = cpuid(0x80000006) - c.Cache.L2 = int(((ecx >> 16) & 0xFFFF) * 1024) - - // CPUID Fn8000_001D_EAX_x[N:0] Cache Properties - if maxExtendedFunction() < 0x8000001D { - return - } - for i := uint32(0); i < math.MaxUint32; i++ { - eax, ebx, ecx, _ := cpuidex(0x8000001D, i) - - level := (eax >> 5) & 7 - cacheNumSets := ecx + 1 - cacheLineSize := 1 + (ebx & 2047) - cachePhysPartitions := 1 + ((ebx >> 12) & 511) - cacheNumWays := 1 + ((ebx >> 22) & 511) - - typ := eax & 15 - size := int(cacheNumSets * cacheLineSize * cachePhysPartitions * cacheNumWays) - if typ == 0 { - return - } - - switch level { - case 1: - switch typ { - case 1: - // Data cache - c.Cache.L1D = size - case 2: - // Inst cache - c.Cache.L1I = size - default: - if c.Cache.L1D < 0 { - c.Cache.L1I = size - } - if c.Cache.L1I < 0 { - c.Cache.L1I = size - } - } - case 2: - c.Cache.L2 = size - case 3: - c.Cache.L3 = size - } - } - } - - return -} - -type SGXEPCSection struct { - BaseAddress uint64 - EPCSize uint64 -} - -type SGXSupport struct { - Available bool - LaunchControl bool - SGX1Supported bool - SGX2Supported bool - MaxEnclaveSizeNot64 int64 - MaxEnclaveSize64 int64 - EPCSections []SGXEPCSection -} - -func hasSGX(available, lc bool) (rval SGXSupport) { - rval.Available = available - - if !available { - return - } - - rval.LaunchControl = lc - - a, _, _, d := cpuidex(0x12, 0) - rval.SGX1Supported = a&0x01 != 0 - rval.SGX2Supported = a&0x02 != 0 - rval.MaxEnclaveSizeNot64 = 1 << (d & 0xFF) // pow 2 - rval.MaxEnclaveSize64 = 1 << ((d >> 8) & 0xFF) // pow 2 - rval.EPCSections = make([]SGXEPCSection, 0) - - for subleaf := uint32(2); subleaf < 2+8; subleaf++ { - eax, ebx, ecx, edx := cpuidex(0x12, subleaf) - leafType := eax & 0xf - - if leafType == 0 { - // Invalid subleaf, stop iterating - break - } else if leafType == 1 { - // EPC Section subleaf - baseAddress := uint64(eax&0xfffff000) + (uint64(ebx&0x000fffff) << 32) - size := uint64(ecx&0xfffff000) + (uint64(edx&0x000fffff) << 32) - - section := SGXEPCSection{BaseAddress: baseAddress, EPCSize: size} - rval.EPCSections = append(rval.EPCSections, section) - } - } - - return -} - -func support() Flags { - mfi := maxFunctionID() - vend := vendorID() - if mfi < 0x1 { - return 0 - } - rval := uint64(0) - _, _, c, d := cpuid(1) - if (d & (1 << 15)) != 0 { - rval |= CMOV - } - if (d & (1 << 23)) != 0 { - rval |= MMX - } - if (d & (1 << 25)) != 0 { - rval |= MMXEXT - } - if (d & (1 << 25)) != 0 { - rval |= SSE - } - if (d & (1 << 26)) != 0 { - rval |= SSE2 - } - if (c & 1) != 0 { - rval |= SSE3 - } - if (c & (1 << 5)) != 0 { - rval |= VMX - } - if (c & 0x00000200) != 0 { - rval |= SSSE3 - } - if (c & 0x00080000) != 0 { - rval |= SSE4 - } - if (c & 0x00100000) != 0 { - rval |= SSE42 - } - if (c & (1 << 25)) != 0 { - rval |= AESNI - } - if (c & (1 << 1)) != 0 { - rval |= CLMUL - } - if c&(1<<23) != 0 { - rval |= POPCNT - } - if c&(1<<30) != 0 { - rval |= RDRAND - } - if c&(1<<29) != 0 { - rval |= F16C - } - if c&(1<<13) != 0 { - rval |= CX16 - } - if vend == Intel && (d&(1<<28)) != 0 && mfi >= 4 { - if threadsPerCore() > 1 { - rval |= HTT - } - } - if vend == AMD && (d&(1<<28)) != 0 && mfi >= 4 { - if threadsPerCore() > 1 { - rval |= HTT - } - } - // Check XGETBV, OXSAVE and AVX bits - if c&(1<<26) != 0 && c&(1<<27) != 0 && c&(1<<28) != 0 { - // Check for OS support - eax, _ := xgetbv(0) - if (eax & 0x6) == 0x6 { - rval |= AVX - if (c & 0x00001000) != 0 { - rval |= FMA3 - } - } - } - - // Check AVX2, AVX2 requires OS support, but BMI1/2 don't. - if mfi >= 7 { - _, ebx, ecx, edx := cpuidex(7, 0) - eax1, _, _, _ := cpuidex(7, 1) - if (rval&AVX) != 0 && (ebx&0x00000020) != 0 { - rval |= AVX2 - } - if (ebx & 0x00000008) != 0 { - rval |= BMI1 - if (ebx & 0x00000100) != 0 { - rval |= BMI2 - } - } - if ebx&(1<<2) != 0 { - rval |= SGX - } - if ebx&(1<<4) != 0 { - rval |= HLE - } - if ebx&(1<<9) != 0 { - rval |= ERMS - } - if ebx&(1<<11) != 0 { - rval |= RTM - } - if ebx&(1<<14) != 0 { - rval |= MPX - } - if ebx&(1<<18) != 0 { - rval |= RDSEED - } - if ebx&(1<<19) != 0 { - rval |= ADX - } - if ebx&(1<<29) != 0 { - rval |= SHA - } - if edx&(1<<26) != 0 { - rval |= IBPB - } - if ecx&(1<<30) != 0 { - rval |= SGXLC - } - if edx&(1<<27) != 0 { - rval |= STIBP - } - - // Only detect AVX-512 features if XGETBV is supported - if c&((1<<26)|(1<<27)) == (1<<26)|(1<<27) { - // Check for OS support - eax, _ := xgetbv(0) - - // Verify that XCR0[7:5] = ‘111b’ (OPMASK state, upper 256-bit of ZMM0-ZMM15 and - // ZMM16-ZMM31 state are enabled by OS) - /// and that XCR0[2:1] = ‘11b’ (XMM state and YMM state are enabled by OS). - if (eax>>5)&7 == 7 && (eax>>1)&3 == 3 { - if ebx&(1<<16) != 0 { - rval |= AVX512F - } - if ebx&(1<<17) != 0 { - rval |= AVX512DQ - } - if ebx&(1<<21) != 0 { - rval |= AVX512IFMA - } - if ebx&(1<<26) != 0 { - rval |= AVX512PF - } - if ebx&(1<<27) != 0 { - rval |= AVX512ER - } - if ebx&(1<<28) != 0 { - rval |= AVX512CD - } - if ebx&(1<<30) != 0 { - rval |= AVX512BW - } - if ebx&(1<<31) != 0 { - rval |= AVX512VL - } - // ecx - if ecx&(1<<1) != 0 { - rval |= AVX512VBMI - } - if ecx&(1<<6) != 0 { - rval |= AVX512VBMI2 - } - if ecx&(1<<8) != 0 { - rval |= GFNI - } - if ecx&(1<<9) != 0 { - rval |= VAES - } - if ecx&(1<<10) != 0 { - rval |= VPCLMULQDQ - } - if ecx&(1<<11) != 0 { - rval |= AVX512VNNI - } - if ecx&(1<<12) != 0 { - rval |= AVX512BITALG - } - if ecx&(1<<14) != 0 { - rval |= AVX512VPOPCNTDQ - } - // edx - if edx&(1<<8) != 0 { - rval |= AVX512VP2INTERSECT - } - // cpuid eax 07h,ecx=1 - if eax1&(1<<5) != 0 { - rval |= AVX512BF16 - } - } - } - } - - if maxExtendedFunction() >= 0x80000001 { - _, _, c, d := cpuid(0x80000001) - if (c & (1 << 5)) != 0 { - rval |= LZCNT - rval |= POPCNT - } - if (d & (1 << 31)) != 0 { - rval |= AMD3DNOW - } - if (d & (1 << 30)) != 0 { - rval |= AMD3DNOWEXT - } - if (d & (1 << 23)) != 0 { - rval |= MMX - } - if (d & (1 << 22)) != 0 { - rval |= MMXEXT - } - if (c & (1 << 6)) != 0 { - rval |= SSE4A - } - if d&(1<<20) != 0 { - rval |= NX - } - if d&(1<<27) != 0 { - rval |= RDTSCP - } - - /* Allow for selectively disabling SSE2 functions on AMD processors - with SSE2 support but not SSE4a. This includes Athlon64, some - Opteron, and some Sempron processors. MMX, SSE, or 3DNow! are faster - than SSE2 often enough to utilize this special-case flag. - AV_CPU_FLAG_SSE2 and AV_CPU_FLAG_SSE2SLOW are both set in this case - so that SSE2 is used unless explicitly disabled by checking - AV_CPU_FLAG_SSE2SLOW. */ - if vendorID() != Intel && - rval&SSE2 != 0 && (c&0x00000040) == 0 { - rval |= SSE2SLOW - } - - /* XOP and FMA4 use the AVX instruction coding scheme, so they can't be - * used unless the OS has AVX support. */ - if (rval & AVX) != 0 { - if (c & 0x00000800) != 0 { - rval |= XOP - } - if (c & 0x00010000) != 0 { - rval |= FMA4 - } - } - - if vendorID() == Intel { - family, model := familyModel() - if family == 6 && (model == 9 || model == 13 || model == 14) { - /* 6/9 (pentium-m "banias"), 6/13 (pentium-m "dothan"), and - * 6/14 (core1 "yonah") theoretically support sse2, but it's - * usually slower than mmx. */ - if (rval & SSE2) != 0 { - rval |= SSE2SLOW - } - if (rval & SSE3) != 0 { - rval |= SSE3SLOW - } - } - /* The Atom processor has SSSE3 support, which is useful in many cases, - * but sometimes the SSSE3 version is slower than the SSE2 equivalent - * on the Atom, but is generally faster on other processors supporting - * SSSE3. This flag allows for selectively disabling certain SSSE3 - * functions on the Atom. */ - if family == 6 && model == 28 { - rval |= ATOM - } - } - } - return Flags(rval) -} - -func valAsString(values ...uint32) []byte { - r := make([]byte, 4*len(values)) - for i, v := range values { - dst := r[i*4:] - dst[0] = byte(v & 0xff) - dst[1] = byte((v >> 8) & 0xff) - dst[2] = byte((v >> 16) & 0xff) - dst[3] = byte((v >> 24) & 0xff) - switch { - case dst[0] == 0: - return r[:i*4] - case dst[1] == 0: - return r[:i*4+1] - case dst[2] == 0: - return r[:i*4+2] - case dst[3] == 0: - return r[:i*4+3] - } - } - return r -} diff --git a/vendor/github.com/klauspost/cpuid/detect_intel.go b/vendor/github.com/klauspost/cpuid/detect_intel.go deleted file mode 100644 index a5f04dd6d0..0000000000 --- a/vendor/github.com/klauspost/cpuid/detect_intel.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. - -// +build 386,!gccgo amd64,!gccgo - -package cpuid - -func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32) -func asmCpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32) -func asmXgetbv(index uint32) (eax, edx uint32) -func asmRdtscpAsm() (eax, ebx, ecx, edx uint32) - -func initCPU() { - cpuid = asmCpuid - cpuidex = asmCpuidex - xgetbv = asmXgetbv - rdtscpAsm = asmRdtscpAsm -} diff --git a/vendor/github.com/klauspost/cpuid/detect_ref.go b/vendor/github.com/klauspost/cpuid/detect_ref.go deleted file mode 100644 index 909c5d9a7a..0000000000 --- a/vendor/github.com/klauspost/cpuid/detect_ref.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. - -// +build !amd64,!386 gccgo - -package cpuid - -func initCPU() { - cpuid = func(op uint32) (eax, ebx, ecx, edx uint32) { - return 0, 0, 0, 0 - } - - cpuidex = func(op, op2 uint32) (eax, ebx, ecx, edx uint32) { - return 0, 0, 0, 0 - } - - xgetbv = func(index uint32) (eax, edx uint32) { - return 0, 0 - } - - rdtscpAsm = func() (eax, ebx, ecx, edx uint32) { - return 0, 0, 0, 0 - } -} diff --git a/vendor/github.com/klauspost/cpuid/generate.go b/vendor/github.com/klauspost/cpuid/generate.go deleted file mode 100644 index 90e7a98d27..0000000000 --- a/vendor/github.com/klauspost/cpuid/generate.go +++ /dev/null @@ -1,4 +0,0 @@ -package cpuid - -//go:generate go run private-gen.go -//go:generate gofmt -w ./private diff --git a/vendor/github.com/klauspost/cpuid/.gitignore b/vendor/github.com/klauspost/cpuid/v2/.gitignore similarity index 100% rename from vendor/github.com/klauspost/cpuid/.gitignore rename to vendor/github.com/klauspost/cpuid/v2/.gitignore diff --git a/vendor/github.com/klauspost/cpuid/v2/.travis.yml b/vendor/github.com/klauspost/cpuid/v2/.travis.yml new file mode 100644 index 0000000000..b8e4d02b1b --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/v2/.travis.yml @@ -0,0 +1,63 @@ +language: go + +os: + - linux + - osx + - windows + +arch: + - amd64 + - arm64 + +go: + - 1.13.x + - 1.14.x + - 1.15.x + - master + +script: + - go vet ./... + - go test -test.v -test.run ^TestCPUID$ + - go test -race ./... + - go test -tags=noasm ./... + +matrix: + allow_failures: + - go: 'master' + fast_finish: true + include: + - stage: gofmt + go: 1.15.x + os: linux + arch: amd64 + script: + - diff <(gofmt -d .) <(printf "") + - diff <(gofmt -d ./private) <(printf "") + - go install github.com/klauspost/asmfmt/cmd/asmfmt + - diff <(asmfmt -d .) <(printf "") + - stage: i386 + go: 1.15.x + os: linux + arch: amd64 + script: + - GOOS=linux GOARCH=386 go test . + - stage: buildotherprev + go: 1.14.x + os: linux + arch: amd64 + script: + - GOOS=darwin GOARCH=arm64 go build . + - GOOS=freebsd GOARCH=arm64 go build . + - GOOS=netbsd GOARCH=arm64 go build . + - GOOS=freebsd GOARCH=amd64 go build . + - GOOS=netbsd GOARCH=amd64 go build . + - stage: buildother + go: 1.15.x + os: linux + arch: amd64 + script: + - GOOS=darwin GOARCH=arm64 go build . + - GOOS=freebsd GOARCH=arm64 go build . + - GOOS=netbsd GOARCH=arm64 go build . + - GOOS=freebsd GOARCH=amd64 go build . + - GOOS=netbsd GOARCH=amd64 go build . diff --git a/vendor/github.com/klauspost/cpuid/CONTRIBUTING.txt b/vendor/github.com/klauspost/cpuid/v2/CONTRIBUTING.txt similarity index 100% rename from vendor/github.com/klauspost/cpuid/CONTRIBUTING.txt rename to vendor/github.com/klauspost/cpuid/v2/CONTRIBUTING.txt diff --git a/vendor/github.com/klauspost/cpuid/LICENSE b/vendor/github.com/klauspost/cpuid/v2/LICENSE similarity index 100% rename from vendor/github.com/klauspost/cpuid/LICENSE rename to vendor/github.com/klauspost/cpuid/v2/LICENSE diff --git a/vendor/github.com/klauspost/cpuid/v2/README.md b/vendor/github.com/klauspost/cpuid/v2/README.md new file mode 100644 index 0000000000..eaf1959719 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/v2/README.md @@ -0,0 +1,136 @@ +# cpuid +Package cpuid provides information about the CPU running the current program. + +CPU features are detected on startup, and kept for fast access through the life of the application. +Currently x86 / x64 (AMD64/i386) and ARM (ARM64) is supported, and no external C (cgo) code is used, which should make the library very easy to use. + +You can access the CPU information by accessing the shared CPU variable of the cpuid library. + +Package home: https://github.com/klauspost/cpuid + +[![PkgGoDev](https://pkg.go.dev/badge/github.com/klauspost/cpuid)](https://pkg.go.dev/github.com/klauspost/cpuid/v2) +[![Build Status][3]][4] + +[3]: https://travis-ci.org/klauspost/cpuid.svg?branch=master +[4]: https://travis-ci.org/klauspost/cpuid + +## installing + +`go get -u github.com/klauspost/cpuid/v2` using modules. + +Drop `v2` for others. + +## example + +```Go +package main + +import ( + "fmt" + "strings" + + . "github.com/klauspost/cpuid/v2" +) + +func main() { + // Print basic CPU information: + fmt.Println("Name:", CPU.BrandName) + fmt.Println("PhysicalCores:", CPU.PhysicalCores) + fmt.Println("ThreadsPerCore:", CPU.ThreadsPerCore) + fmt.Println("LogicalCores:", CPU.LogicalCores) + fmt.Println("Family", CPU.Family, "Model:", CPU.Model, "Vendor ID:", CPU.VendorID) + fmt.Println("Features:", fmt.Sprintf(strings.Join(CPU.FeatureSet(), ","))) + fmt.Println("Cacheline bytes:", CPU.CacheLine) + fmt.Println("L1 Data Cache:", CPU.Cache.L1D, "bytes") + fmt.Println("L1 Instruction Cache:", CPU.Cache.L1D, "bytes") + fmt.Println("L2 Cache:", CPU.Cache.L2, "bytes") + fmt.Println("L3 Cache:", CPU.Cache.L3, "bytes") + fmt.Println("Frequency", CPU.Hz, "hz") + + // Test if we have these specific features: + if CPU.Supports(SSE, SSE2) { + fmt.Println("We have Streaming SIMD 2 Extensions") + } +} +``` + +Sample output: +``` +>go run main.go +Name: AMD Ryzen 9 3950X 16-Core Processor +PhysicalCores: 16 +ThreadsPerCore: 2 +LogicalCores: 32 +Family 23 Model: 113 Vendor ID: AMD +Features: ADX,AESNI,AVX,AVX2,BMI1,BMI2,CLMUL,CMOV,CX16,F16C,FMA3,HTT,HYPERVISOR,LZCNT,MMX,MMXEXT,NX,POPCNT,RDRAND,RDSEED,RDTSCP,SHA,SSE,SSE2,SSE3,SSE4,SSE42,SSE4A,SSSE3 +Cacheline bytes: 64 +L1 Data Cache: 32768 bytes +L1 Instruction Cache: 32768 bytes +L2 Cache: 524288 bytes +L3 Cache: 16777216 bytes +Frequency 0 hz +We have Streaming SIMD 2 Extensions +``` + +# usage + +The `cpuid.CPU` provides access to CPU features. Use `cpuid.CPU.Supports()` to access CPU features. + +Note that for some cpu/os combinations some features will not be detected. +`amd64` has rather good support and should work reliably on all platforms. + +Note that hypervisors may not pass through all CPU features. + +## arm64 feature detection + +Not all operating systems provide ARM features directly +and there is no safe way to do so for the rest. + +Currently `arm64/linux` and `arm64/freebsd` should be quite reliable. +`arm64/darwin` adds features expected from the M1 processor, but a lot remains undetected. + +A `DetectARM()` can be used if you are able to control your deployment, +it will detect CPU features, but may crash if the OS doesn't intercept the calls. +A `-cpu.arm` flag for detecting unsafe ARM features can be added. See below. + +Note that currently only features are detected on ARM, +no additional information is currently available. + +## flags + +It is possible to add flags that affects cpu detection. + +For this the `Flags()` command is provided. + +This must be called *before* `flag.Parse()` AND after the flags have been parsed `Detect()` must be called. + +This means that any detection used in `init()` functions will not contain these flags. + +Example: + +```Go +package main + +import ( + "flag" + "fmt" + "strings" + + "github.com/klauspost/cpuid/v2" +) + +func main() { + cpuid.Flags() + flag.Parse() + cpuid.Detect() + + // Test if we have these specific features: + if cpuid.CPU.Supports(cpuid.SSE, cpuid.SSE2) { + fmt.Println("We have Streaming SIMD 2 Extensions") + } +} +``` + +# license + +This code is published under an MIT license. See LICENSE file for more information. diff --git a/vendor/github.com/klauspost/cpuid/v2/cpuid.go b/vendor/github.com/klauspost/cpuid/v2/cpuid.go new file mode 100644 index 0000000000..c2cdd7f564 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/v2/cpuid.go @@ -0,0 +1,1002 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +// Package cpuid provides information about the CPU running the current program. +// +// CPU features are detected on startup, and kept for fast access through the life of the application. +// Currently x86 / x64 (AMD64) as well as arm64 is supported. +// +// You can access the CPU information by accessing the shared CPU variable of the cpuid library. +// +// Package home: https://github.com/klauspost/cpuid +package cpuid + +import ( + "flag" + "math" + "strings" +) + +// AMD refererence: https://www.amd.com/system/files/TechDocs/25481.pdf +// and Processor Programming Reference (PPR) + +// Vendor is a representation of a CPU vendor. +type Vendor int + +const ( + VendorUnknown Vendor = iota + Intel + AMD + VIA + Transmeta + NSC + KVM // Kernel-based Virtual Machine + MSVM // Microsoft Hyper-V or Windows Virtual PC + VMware + XenHVM + Bhyve + Hygon + SiS + RDC + + Ampere + ARM + Broadcom + Cavium + DEC + Fujitsu + Infineon + Motorola + NVIDIA + AMCC + Qualcomm + Marvell + + lastVendor +) + +//go:generate stringer -type=FeatureID,Vendor + +// FeatureID is the ID of a specific cpu feature. +type FeatureID int + +const ( + // Keep index -1 as unknown + UNKNOWN = -1 + + // Add features + ADX FeatureID = iota // Intel ADX (Multi-Precision Add-Carry Instruction Extensions) + AESNI // Advanced Encryption Standard New Instructions + AMD3DNOW // AMD 3DNOW + AMD3DNOWEXT // AMD 3DNowExt + AMXBF16 // Tile computational operations on BFLOAT16 numbers + AMXINT8 // Tile computational operations on 8-bit integers + AMXTILE // Tile architecture + AVX // AVX functions + AVX2 // AVX2 functions + AVX512BF16 // AVX-512 BFLOAT16 Instructions + AVX512BITALG // AVX-512 Bit Algorithms + AVX512BW // AVX-512 Byte and Word Instructions + AVX512CD // AVX-512 Conflict Detection Instructions + AVX512DQ // AVX-512 Doubleword and Quadword Instructions + AVX512ER // AVX-512 Exponential and Reciprocal Instructions + AVX512F // AVX-512 Foundation + AVX512IFMA // AVX-512 Integer Fused Multiply-Add Instructions + AVX512PF // AVX-512 Prefetch Instructions + AVX512VBMI // AVX-512 Vector Bit Manipulation Instructions + AVX512VBMI2 // AVX-512 Vector Bit Manipulation Instructions, Version 2 + AVX512VL // AVX-512 Vector Length Extensions + AVX512VNNI // AVX-512 Vector Neural Network Instructions + AVX512VP2INTERSECT // AVX-512 Intersect for D/Q + AVX512VPOPCNTDQ // AVX-512 Vector Population Count Doubleword and Quadword + AVXSLOW // Indicates the CPU performs 2 128 bit operations instead of one. + BMI1 // Bit Manipulation Instruction Set 1 + BMI2 // Bit Manipulation Instruction Set 2 + CLDEMOTE // Cache Line Demote + CLMUL // Carry-less Multiplication + CMOV // i686 CMOV + CX16 // CMPXCHG16B Instruction + ENQCMD // Enqueue Command + ERMS // Enhanced REP MOVSB/STOSB + F16C // Half-precision floating-point conversion + FMA3 // Intel FMA 3. Does not imply AVX. + FMA4 // Bulldozer FMA4 functions + GFNI // Galois Field New Instructions + HLE // Hardware Lock Elision + HTT // Hyperthreading (enabled) + HYPERVISOR // This bit has been reserved by Intel & AMD for use by hypervisors + IBPB // Indirect Branch Restricted Speculation (IBRS) and Indirect Branch Predictor Barrier (IBPB) + IBS // Instruction Based Sampling (AMD) + IBSBRNTRGT // Instruction Based Sampling Feature (AMD) + IBSFETCHSAM // Instruction Based Sampling Feature (AMD) + IBSFFV // Instruction Based Sampling Feature (AMD) + IBSOPCNT // Instruction Based Sampling Feature (AMD) + IBSOPCNTEXT // Instruction Based Sampling Feature (AMD) + IBSOPSAM // Instruction Based Sampling Feature (AMD) + IBSRDWROPCNT // Instruction Based Sampling Feature (AMD) + IBSRIPINVALIDCHK // Instruction Based Sampling Feature (AMD) + LZCNT // LZCNT instruction + MMX // standard MMX + MMXEXT // SSE integer functions or AMD MMX ext + MOVDIR64B // Move 64 Bytes as Direct Store + MOVDIRI // Move Doubleword as Direct Store + MPX // Intel MPX (Memory Protection Extensions) + NX // NX (No-Execute) bit + POPCNT // POPCNT instruction + RDRAND // RDRAND instruction is available + RDSEED // RDSEED instruction is available + RDTSCP // RDTSCP Instruction + RTM // Restricted Transactional Memory + SERIALIZE // Serialize Instruction Execution + SGX // Software Guard Extensions + SGXLC // Software Guard Extensions Launch Control + SHA // Intel SHA Extensions + SSE // SSE functions + SSE2 // P4 SSE functions + SSE3 // Prescott SSE3 functions + SSE4 // Penryn SSE4.1 functions + SSE42 // Nehalem SSE4.2 functions + SSE4A // AMD Barcelona microarchitecture SSE4a instructions + SSSE3 // Conroe SSSE3 functions + STIBP // Single Thread Indirect Branch Predictors + TBM // AMD Trailing Bit Manipulation + TSXLDTRK // Intel TSX Suspend Load Address Tracking + VAES // Vector AES + VMX // Virtual Machine Extensions + VPCLMULQDQ // Carry-Less Multiplication Quadword + WAITPKG // TPAUSE, UMONITOR, UMWAIT + WBNOINVD // Write Back and Do Not Invalidate Cache + XOP // Bulldozer XOP functions + + // ARM features: + AESARM // AES instructions + ARMCPUID // Some CPU ID registers readable at user-level + ASIMD // Advanced SIMD + ASIMDDP // SIMD Dot Product + ASIMDHP // Advanced SIMD half-precision floating point + ASIMDRDM // Rounding Double Multiply Accumulate/Subtract (SQRDMLAH/SQRDMLSH) + ATOMICS // Large System Extensions (LSE) + CRC32 // CRC32/CRC32C instructions + DCPOP // Data cache clean to Point of Persistence (DC CVAP) + EVTSTRM // Generic timer + FCMA // Floatin point complex number addition and multiplication + FP // Single-precision and double-precision floating point + FPHP // Half-precision floating point + GPA // Generic Pointer Authentication + JSCVT // Javascript-style double->int convert (FJCVTZS) + LRCPC // Weaker release consistency (LDAPR, etc) + PMULL // Polynomial Multiply instructions (PMULL/PMULL2) + SHA1 // SHA-1 instructions (SHA1C, etc) + SHA2 // SHA-2 instructions (SHA256H, etc) + SHA3 // SHA-3 instructions (EOR3, RAXI, XAR, BCAX) + SHA512 // SHA512 instructions + SM3 // SM3 instructions + SM4 // SM4 instructions + SVE // Scalable Vector Extension + + // Keep it last. It automatically defines the size of []flagSet + lastID + + firstID FeatureID = UNKNOWN + 1 +) + +// CPUInfo contains information about the detected system CPU. +type CPUInfo struct { + BrandName string // Brand name reported by the CPU + VendorID Vendor // Comparable CPU vendor ID + VendorString string // Raw vendor string. + featureSet flagSet // Features of the CPU + PhysicalCores int // Number of physical processor cores in your CPU. Will be 0 if undetectable. + ThreadsPerCore int // Number of threads per physical core. Will be 1 if undetectable. + LogicalCores int // Number of physical cores times threads that can run on each core through the use of hyperthreading. Will be 0 if undetectable. + Family int // CPU family number + Model int // CPU model number + CacheLine int // Cache line size in bytes. Will be 0 if undetectable. + Hz int64 // Clock speed, if known, 0 otherwise + Cache struct { + L1I int // L1 Instruction Cache (per core or shared). Will be -1 if undetected + L1D int // L1 Data Cache (per core or shared). Will be -1 if undetected + L2 int // L2 Cache (per core or shared). Will be -1 if undetected + L3 int // L3 Cache (per core, per ccx or shared). Will be -1 if undetected + } + SGX SGXSupport + maxFunc uint32 + maxExFunc uint32 +} + +var cpuid func(op uint32) (eax, ebx, ecx, edx uint32) +var cpuidex func(op, op2 uint32) (eax, ebx, ecx, edx uint32) +var xgetbv func(index uint32) (eax, edx uint32) +var rdtscpAsm func() (eax, ebx, ecx, edx uint32) + +// CPU contains information about the CPU as detected on startup, +// or when Detect last was called. +// +// Use this as the primary entry point to you data. +var CPU CPUInfo + +func init() { + initCPU() + Detect() +} + +// Detect will re-detect current CPU info. +// This will replace the content of the exported CPU variable. +// +// Unless you expect the CPU to change while you are running your program +// you should not need to call this function. +// If you call this, you must ensure that no other goroutine is accessing the +// exported CPU variable. +func Detect() { + // Set defaults + CPU.ThreadsPerCore = 1 + CPU.Cache.L1I = -1 + CPU.Cache.L1D = -1 + CPU.Cache.L2 = -1 + CPU.Cache.L3 = -1 + safe := true + if detectArmFlag != nil { + safe = !*detectArmFlag + } + addInfo(&CPU, safe) + if disableFlag != nil { + s := strings.Split(*disableFlag, ",") + for _, feat := range s { + feat := ParseFeature(strings.TrimSpace(feat)) + if feat != UNKNOWN { + CPU.featureSet.unset(feat) + } + } + } +} + +// DetectARM will detect ARM64 features. +// This is NOT done automatically since it can potentially crash +// if the OS does not handle the command. +// If in the future this can be done safely this function may not +// do anything. +func DetectARM() { + addInfo(&CPU, false) +} + +var detectArmFlag *bool +var disableFlag *string + +// Flags will enable flags. +// This must be called *before* flag.Parse AND +// Detect must be called after the flags have been parsed. +// Note that this means that any detection used in init() functions +// will not contain these flags. +func Flags() { + disableFlag = flag.String("cpu.disable", "", "disable cpu features; comma separated list") + detectArmFlag = flag.Bool("cpu.arm", false, "allow ARM features to be detected; can potentially crash") +} + +// Supports returns whether the CPU supports all of the requested features. +func (c CPUInfo) Supports(ids ...FeatureID) bool { + for _, id := range ids { + if !c.featureSet.inSet(id) { + return false + } + } + return true +} + +// Disable will disable one or several features. +func (c *CPUInfo) Disable(ids ...FeatureID) bool { + for _, id := range ids { + c.featureSet.unset(id) + } + return true +} + +// Enable will disable one or several features even if they were undetected. +// This is of course not recommended for obvious reasons. +func (c *CPUInfo) Enable(ids ...FeatureID) bool { + for _, id := range ids { + c.featureSet.set(id) + } + return true +} + +// IsVendor returns true if vendor is recognized as Intel +func (c CPUInfo) IsVendor(v Vendor) bool { + return c.VendorID == v +} + +func (c CPUInfo) FeatureSet() []string { + s := make([]string, 0) + for _, f := range c.featureSet.Strings() { + s = append(s, f) + } + return s +} + +// RTCounter returns the 64-bit time-stamp counter +// Uses the RDTSCP instruction. The value 0 is returned +// if the CPU does not support the instruction. +func (c CPUInfo) RTCounter() uint64 { + if !c.Supports(RDTSCP) { + return 0 + } + a, _, _, d := rdtscpAsm() + return uint64(a) | (uint64(d) << 32) +} + +// Ia32TscAux returns the IA32_TSC_AUX part of the RDTSCP. +// This variable is OS dependent, but on Linux contains information +// about the current cpu/core the code is running on. +// If the RDTSCP instruction isn't supported on the CPU, the value 0 is returned. +func (c CPUInfo) Ia32TscAux() uint32 { + if !c.Supports(RDTSCP) { + return 0 + } + _, _, ecx, _ := rdtscpAsm() + return ecx +} + +// LogicalCPU will return the Logical CPU the code is currently executing on. +// This is likely to change when the OS re-schedules the running thread +// to another CPU. +// If the current core cannot be detected, -1 will be returned. +func (c CPUInfo) LogicalCPU() int { + if c.maxFunc < 1 { + return -1 + } + _, ebx, _, _ := cpuid(1) + return int(ebx >> 24) +} + +// hertz tries to compute the clock speed of the CPU. If leaf 15 is +// supported, use it, otherwise parse the brand string. Yes, really. +func hertz(model string) int64 { + mfi := maxFunctionID() + if mfi >= 0x15 { + eax, ebx, ecx, _ := cpuid(0x15) + if eax != 0 && ebx != 0 && ecx != 0 { + return int64((int64(ecx) * int64(ebx)) / int64(eax)) + } + } + // computeHz determines the official rated speed of a CPU from its brand + // string. This insanity is *actually the official documented way to do + // this according to Intel*, prior to leaf 0x15 existing. The official + // documentation only shows this working for exactly `x.xx` or `xxxx` + // cases, e.g., `2.50GHz` or `1300MHz`; this parser will accept other + // sizes. + hz := strings.LastIndex(model, "Hz") + if hz < 3 { + return 0 + } + var multiplier int64 + switch model[hz-1] { + case 'M': + multiplier = 1000 * 1000 + case 'G': + multiplier = 1000 * 1000 * 1000 + case 'T': + multiplier = 1000 * 1000 * 1000 * 1000 + } + if multiplier == 0 { + return 0 + } + freq := int64(0) + divisor := int64(0) + decimalShift := int64(1) + var i int + for i = hz - 2; i >= 0 && model[i] != ' '; i-- { + if model[i] >= '0' && model[i] <= '9' { + freq += int64(model[i]-'0') * decimalShift + decimalShift *= 10 + } else if model[i] == '.' { + if divisor != 0 { + return 0 + } + divisor = decimalShift + } else { + return 0 + } + } + // we didn't find a space + if i < 0 { + return 0 + } + if divisor != 0 { + return (freq * multiplier) / divisor + } + return freq * multiplier +} + +// VM Will return true if the cpu id indicates we are in +// a virtual machine. +func (c CPUInfo) VM() bool { + return CPU.featureSet.inSet(HYPERVISOR) +} + +// flags contains detected cpu features and characteristics +type flags uint64 + +// log2(bits_in_uint64) +const flagBitsLog2 = 6 +const flagBits = 1 << flagBitsLog2 +const flagMask = flagBits - 1 + +// flagSet contains detected cpu features and characteristics in an array of flags +type flagSet [(lastID + flagMask) / flagBits]flags + +func (s flagSet) inSet(feat FeatureID) bool { + return s[feat>>flagBitsLog2]&(1<<(feat&flagMask)) != 0 +} + +func (s *flagSet) set(feat FeatureID) { + s[feat>>flagBitsLog2] |= 1 << (feat & flagMask) +} + +// setIf will set a feature if boolean is true. +func (s *flagSet) setIf(cond bool, features ...FeatureID) { + if cond { + for _, offset := range features { + s[offset>>flagBitsLog2] |= 1 << (offset & flagMask) + } + } +} + +func (s *flagSet) unset(offset FeatureID) { + bit := flags(1 << (offset & flagMask)) + s[offset>>flagBitsLog2] = s[offset>>flagBitsLog2] & ^bit +} + +// or with another flagset. +func (s *flagSet) or(other flagSet) { + for i, v := range other[:] { + s[i] |= v + } +} + +// ParseFeature will parse the string and return the ID of the matching feature. +// Will return UNKNOWN if not found. +func ParseFeature(s string) FeatureID { + s = strings.ToUpper(s) + for i := firstID; i < lastID; i++ { + if i.String() == s { + return i + } + } + return UNKNOWN +} + +// Strings returns an array of the detected features for FlagsSet. +func (s flagSet) Strings() []string { + if len(s) == 0 { + return []string{""} + } + r := make([]string, 0) + for i := firstID; i < lastID; i++ { + if s.inSet(i) { + r = append(r, i.String()) + } + } + return r +} + +func maxExtendedFunction() uint32 { + eax, _, _, _ := cpuid(0x80000000) + return eax +} + +func maxFunctionID() uint32 { + a, _, _, _ := cpuid(0) + return a +} + +func brandName() string { + if maxExtendedFunction() >= 0x80000004 { + v := make([]uint32, 0, 48) + for i := uint32(0); i < 3; i++ { + a, b, c, d := cpuid(0x80000002 + i) + v = append(v, a, b, c, d) + } + return strings.Trim(string(valAsString(v...)), " ") + } + return "unknown" +} + +func threadsPerCore() int { + mfi := maxFunctionID() + vend, _ := vendorID() + + if mfi < 0x4 || (vend != Intel && vend != AMD) { + return 1 + } + + if mfi < 0xb { + if vend != Intel { + return 1 + } + _, b, _, d := cpuid(1) + if (d & (1 << 28)) != 0 { + // v will contain logical core count + v := (b >> 16) & 255 + if v > 1 { + a4, _, _, _ := cpuid(4) + // physical cores + v2 := (a4 >> 26) + 1 + if v2 > 0 { + return int(v) / int(v2) + } + } + } + return 1 + } + _, b, _, _ := cpuidex(0xb, 0) + if b&0xffff == 0 { + if vend == AMD { + // Workaround for AMD returning 0, assume 2 if >= Zen 2 + // It will be more correct than not. + fam, _ := familyModel() + _, _, _, d := cpuid(1) + if (d&(1<<28)) != 0 && fam >= 23 { + return 2 + } + } + return 1 + } + return int(b & 0xffff) +} + +func logicalCores() int { + mfi := maxFunctionID() + v, _ := vendorID() + switch v { + case Intel: + // Use this on old Intel processors + if mfi < 0xb { + if mfi < 1 { + return 0 + } + // CPUID.1:EBX[23:16] represents the maximum number of addressable IDs (initial APIC ID) + // that can be assigned to logical processors in a physical package. + // The value may not be the same as the number of logical processors that are present in the hardware of a physical package. + _, ebx, _, _ := cpuid(1) + logical := (ebx >> 16) & 0xff + return int(logical) + } + _, b, _, _ := cpuidex(0xb, 1) + return int(b & 0xffff) + case AMD, Hygon: + _, b, _, _ := cpuid(1) + return int((b >> 16) & 0xff) + default: + return 0 + } +} + +func familyModel() (int, int) { + if maxFunctionID() < 0x1 { + return 0, 0 + } + eax, _, _, _ := cpuid(1) + family := ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff) + model := ((eax >> 4) & 0xf) + ((eax >> 12) & 0xf0) + return int(family), int(model) +} + +func physicalCores() int { + v, _ := vendorID() + switch v { + case Intel: + return logicalCores() / threadsPerCore() + case AMD, Hygon: + lc := logicalCores() + tpc := threadsPerCore() + if lc > 0 && tpc > 0 { + return lc / tpc + } + + // The following is inaccurate on AMD EPYC 7742 64-Core Processor + if maxExtendedFunction() >= 0x80000008 { + _, _, c, _ := cpuid(0x80000008) + if c&0xff > 0 { + return int(c&0xff) + 1 + } + } + } + return 0 +} + +// Except from http://en.wikipedia.org/wiki/CPUID#EAX.3D0:_Get_vendor_ID +var vendorMapping = map[string]Vendor{ + "AMDisbetter!": AMD, + "AuthenticAMD": AMD, + "CentaurHauls": VIA, + "GenuineIntel": Intel, + "TransmetaCPU": Transmeta, + "GenuineTMx86": Transmeta, + "Geode by NSC": NSC, + "VIA VIA VIA ": VIA, + "KVMKVMKVMKVM": KVM, + "Microsoft Hv": MSVM, + "VMwareVMware": VMware, + "XenVMMXenVMM": XenHVM, + "bhyve bhyve ": Bhyve, + "HygonGenuine": Hygon, + "Vortex86 SoC": SiS, + "SiS SiS SiS ": SiS, + "RiseRiseRise": SiS, + "Genuine RDC": RDC, +} + +func vendorID() (Vendor, string) { + _, b, c, d := cpuid(0) + v := string(valAsString(b, d, c)) + vend, ok := vendorMapping[v] + if !ok { + return VendorUnknown, v + } + return vend, v +} + +func cacheLine() int { + if maxFunctionID() < 0x1 { + return 0 + } + + _, ebx, _, _ := cpuid(1) + cache := (ebx & 0xff00) >> 5 // cflush size + if cache == 0 && maxExtendedFunction() >= 0x80000006 { + _, _, ecx, _ := cpuid(0x80000006) + cache = ecx & 0xff // cacheline size + } + // TODO: Read from Cache and TLB Information + return int(cache) +} + +func (c *CPUInfo) cacheSize() { + c.Cache.L1D = -1 + c.Cache.L1I = -1 + c.Cache.L2 = -1 + c.Cache.L3 = -1 + vendor, _ := vendorID() + switch vendor { + case Intel: + if maxFunctionID() < 4 { + return + } + for i := uint32(0); ; i++ { + eax, ebx, ecx, _ := cpuidex(4, i) + cacheType := eax & 15 + if cacheType == 0 { + break + } + cacheLevel := (eax >> 5) & 7 + coherency := int(ebx&0xfff) + 1 + partitions := int((ebx>>12)&0x3ff) + 1 + associativity := int((ebx>>22)&0x3ff) + 1 + sets := int(ecx) + 1 + size := associativity * partitions * coherency * sets + switch cacheLevel { + case 1: + if cacheType == 1 { + // 1 = Data Cache + c.Cache.L1D = size + } else if cacheType == 2 { + // 2 = Instruction Cache + c.Cache.L1I = size + } else { + if c.Cache.L1D < 0 { + c.Cache.L1I = size + } + if c.Cache.L1I < 0 { + c.Cache.L1I = size + } + } + case 2: + c.Cache.L2 = size + case 3: + c.Cache.L3 = size + } + } + case AMD, Hygon: + // Untested. + if maxExtendedFunction() < 0x80000005 { + return + } + _, _, ecx, edx := cpuid(0x80000005) + c.Cache.L1D = int(((ecx >> 24) & 0xFF) * 1024) + c.Cache.L1I = int(((edx >> 24) & 0xFF) * 1024) + + if maxExtendedFunction() < 0x80000006 { + return + } + _, _, ecx, _ = cpuid(0x80000006) + c.Cache.L2 = int(((ecx >> 16) & 0xFFFF) * 1024) + + // CPUID Fn8000_001D_EAX_x[N:0] Cache Properties + if maxExtendedFunction() < 0x8000001D { + return + } + for i := uint32(0); i < math.MaxUint32; i++ { + eax, ebx, ecx, _ := cpuidex(0x8000001D, i) + + level := (eax >> 5) & 7 + cacheNumSets := ecx + 1 + cacheLineSize := 1 + (ebx & 2047) + cachePhysPartitions := 1 + ((ebx >> 12) & 511) + cacheNumWays := 1 + ((ebx >> 22) & 511) + + typ := eax & 15 + size := int(cacheNumSets * cacheLineSize * cachePhysPartitions * cacheNumWays) + if typ == 0 { + return + } + + switch level { + case 1: + switch typ { + case 1: + // Data cache + c.Cache.L1D = size + case 2: + // Inst cache + c.Cache.L1I = size + default: + if c.Cache.L1D < 0 { + c.Cache.L1I = size + } + if c.Cache.L1I < 0 { + c.Cache.L1I = size + } + } + case 2: + c.Cache.L2 = size + case 3: + c.Cache.L3 = size + } + } + } + + return +} + +type SGXEPCSection struct { + BaseAddress uint64 + EPCSize uint64 +} + +type SGXSupport struct { + Available bool + LaunchControl bool + SGX1Supported bool + SGX2Supported bool + MaxEnclaveSizeNot64 int64 + MaxEnclaveSize64 int64 + EPCSections []SGXEPCSection +} + +func hasSGX(available, lc bool) (rval SGXSupport) { + rval.Available = available + + if !available { + return + } + + rval.LaunchControl = lc + + a, _, _, d := cpuidex(0x12, 0) + rval.SGX1Supported = a&0x01 != 0 + rval.SGX2Supported = a&0x02 != 0 + rval.MaxEnclaveSizeNot64 = 1 << (d & 0xFF) // pow 2 + rval.MaxEnclaveSize64 = 1 << ((d >> 8) & 0xFF) // pow 2 + rval.EPCSections = make([]SGXEPCSection, 0) + + for subleaf := uint32(2); subleaf < 2+8; subleaf++ { + eax, ebx, ecx, edx := cpuidex(0x12, subleaf) + leafType := eax & 0xf + + if leafType == 0 { + // Invalid subleaf, stop iterating + break + } else if leafType == 1 { + // EPC Section subleaf + baseAddress := uint64(eax&0xfffff000) + (uint64(ebx&0x000fffff) << 32) + size := uint64(ecx&0xfffff000) + (uint64(edx&0x000fffff) << 32) + + section := SGXEPCSection{BaseAddress: baseAddress, EPCSize: size} + rval.EPCSections = append(rval.EPCSections, section) + } + } + + return +} + +func support() flagSet { + var fs flagSet + mfi := maxFunctionID() + vend, _ := vendorID() + if mfi < 0x1 { + return fs + } + family, model := familyModel() + + _, _, c, d := cpuid(1) + fs.setIf((d&(1<<15)) != 0, CMOV) + fs.setIf((d&(1<<23)) != 0, MMX) + fs.setIf((d&(1<<25)) != 0, MMXEXT) + fs.setIf((d&(1<<25)) != 0, SSE) + fs.setIf((d&(1<<26)) != 0, SSE2) + fs.setIf((c&1) != 0, SSE3) + fs.setIf((c&(1<<5)) != 0, VMX) + fs.setIf((c&0x00000200) != 0, SSSE3) + fs.setIf((c&0x00080000) != 0, SSE4) + fs.setIf((c&0x00100000) != 0, SSE42) + fs.setIf((c&(1<<25)) != 0, AESNI) + fs.setIf((c&(1<<1)) != 0, CLMUL) + fs.setIf(c&(1<<23) != 0, POPCNT) + fs.setIf(c&(1<<30) != 0, RDRAND) + + // This bit has been reserved by Intel & AMD for use by hypervisors, + // and indicates the presence of a hypervisor. + fs.setIf(c&(1<<31) != 0, HYPERVISOR) + fs.setIf(c&(1<<29) != 0, F16C) + fs.setIf(c&(1<<13) != 0, CX16) + + if vend == Intel && (d&(1<<28)) != 0 && mfi >= 4 { + fs.setIf(threadsPerCore() > 1, HTT) + } + if vend == AMD && (d&(1<<28)) != 0 && mfi >= 4 { + fs.setIf(threadsPerCore() > 1, HTT) + } + // Check XGETBV/XSAVE (26), OXSAVE (27) and AVX (28) bits + const avxCheck = 1<<26 | 1<<27 | 1<<28 + if c&avxCheck == avxCheck { + // Check for OS support + eax, _ := xgetbv(0) + if (eax & 0x6) == 0x6 { + fs.set(AVX) + switch vend { + case Intel: + // Older than Haswell. + fs.setIf(family == 6 && model < 60, AVXSLOW) + case AMD: + // Older than Zen 2 + fs.setIf(family < 23 || (family == 23 && model < 49), AVXSLOW) + } + } + } + // FMA3 can be used with SSE registers, so no OS support is strictly needed. + // fma3 and OSXSAVE needed. + const fma3Check = 1<<12 | 1<<27 + fs.setIf(c&fma3Check == fma3Check, FMA3) + + // Check AVX2, AVX2 requires OS support, but BMI1/2 don't. + if mfi >= 7 { + _, ebx, ecx, edx := cpuidex(7, 0) + eax1, _, _, _ := cpuidex(7, 1) + if fs.inSet(AVX) && (ebx&0x00000020) != 0 { + fs.set(AVX2) + } + // CPUID.(EAX=7, ECX=0).EBX + if (ebx & 0x00000008) != 0 { + fs.set(BMI1) + fs.setIf((ebx&0x00000100) != 0, BMI2) + } + fs.setIf(ebx&(1<<2) != 0, SGX) + fs.setIf(ebx&(1<<4) != 0, HLE) + fs.setIf(ebx&(1<<9) != 0, ERMS) + fs.setIf(ebx&(1<<11) != 0, RTM) + fs.setIf(ebx&(1<<14) != 0, MPX) + fs.setIf(ebx&(1<<18) != 0, RDSEED) + fs.setIf(ebx&(1<<19) != 0, ADX) + fs.setIf(ebx&(1<<29) != 0, SHA) + // CPUID.(EAX=7, ECX=0).ECX + fs.setIf(ecx&(1<<5) != 0, WAITPKG) + fs.setIf(ecx&(1<<25) != 0, CLDEMOTE) + fs.setIf(ecx&(1<<27) != 0, MOVDIRI) + fs.setIf(ecx&(1<<28) != 0, MOVDIR64B) + fs.setIf(ecx&(1<<29) != 0, ENQCMD) + fs.setIf(ecx&(1<<30) != 0, SGXLC) + // CPUID.(EAX=7, ECX=0).EDX + fs.setIf(edx&(1<<14) != 0, SERIALIZE) + fs.setIf(edx&(1<<16) != 0, TSXLDTRK) + fs.setIf(edx&(1<<26) != 0, IBPB) + fs.setIf(edx&(1<<27) != 0, STIBP) + + // Only detect AVX-512 features if XGETBV is supported + if c&((1<<26)|(1<<27)) == (1<<26)|(1<<27) { + // Check for OS support + eax, _ := xgetbv(0) + + // Verify that XCR0[7:5] = ‘111b’ (OPMASK state, upper 256-bit of ZMM0-ZMM15 and + // ZMM16-ZMM31 state are enabled by OS) + /// and that XCR0[2:1] = ‘11b’ (XMM state and YMM state are enabled by OS). + if (eax>>5)&7 == 7 && (eax>>1)&3 == 3 { + fs.setIf(ebx&(1<<16) != 0, AVX512F) + fs.setIf(ebx&(1<<17) != 0, AVX512DQ) + fs.setIf(ebx&(1<<21) != 0, AVX512IFMA) + fs.setIf(ebx&(1<<26) != 0, AVX512PF) + fs.setIf(ebx&(1<<27) != 0, AVX512ER) + fs.setIf(ebx&(1<<28) != 0, AVX512CD) + fs.setIf(ebx&(1<<30) != 0, AVX512BW) + fs.setIf(ebx&(1<<31) != 0, AVX512VL) + // ecx + fs.setIf(ecx&(1<<1) != 0, AVX512VBMI) + fs.setIf(ecx&(1<<6) != 0, AVX512VBMI2) + fs.setIf(ecx&(1<<8) != 0, GFNI) + fs.setIf(ecx&(1<<9) != 0, VAES) + fs.setIf(ecx&(1<<10) != 0, VPCLMULQDQ) + fs.setIf(ecx&(1<<11) != 0, AVX512VNNI) + fs.setIf(ecx&(1<<12) != 0, AVX512BITALG) + fs.setIf(ecx&(1<<14) != 0, AVX512VPOPCNTDQ) + // edx + fs.setIf(edx&(1<<8) != 0, AVX512VP2INTERSECT) + fs.setIf(edx&(1<<22) != 0, AMXBF16) + fs.setIf(edx&(1<<24) != 0, AMXTILE) + fs.setIf(edx&(1<<25) != 0, AMXINT8) + // eax1 = CPUID.(EAX=7, ECX=1).EAX + fs.setIf(eax1&(1<<5) != 0, AVX512BF16) + } + } + } + + if maxExtendedFunction() >= 0x80000001 { + _, _, c, d := cpuid(0x80000001) + if (c & (1 << 5)) != 0 { + fs.set(LZCNT) + fs.set(POPCNT) + } + fs.setIf((c&(1<<10)) != 0, IBS) + fs.setIf((d&(1<<31)) != 0, AMD3DNOW) + fs.setIf((d&(1<<30)) != 0, AMD3DNOWEXT) + fs.setIf((d&(1<<23)) != 0, MMX) + fs.setIf((d&(1<<22)) != 0, MMXEXT) + fs.setIf((c&(1<<6)) != 0, SSE4A) + fs.setIf(d&(1<<20) != 0, NX) + fs.setIf(d&(1<<27) != 0, RDTSCP) + + /* XOP and FMA4 use the AVX instruction coding scheme, so they can't be + * used unless the OS has AVX support. */ + if fs.inSet(AVX) { + fs.setIf((c&0x00000800) != 0, XOP) + fs.setIf((c&0x00010000) != 0, FMA4) + } + + } + if maxExtendedFunction() >= 0x80000008 { + _, b, _, _ := cpuid(0x80000008) + fs.setIf((b&(1<<9)) != 0, WBNOINVD) + } + + if maxExtendedFunction() >= 0x8000001b && fs.inSet(IBS) { + eax, _, _, _ := cpuid(0x8000001b) + fs.setIf((eax>>0)&1 == 1, IBSFFV) + fs.setIf((eax>>1)&1 == 1, IBSFETCHSAM) + fs.setIf((eax>>2)&1 == 1, IBSOPSAM) + fs.setIf((eax>>3)&1 == 1, IBSRDWROPCNT) + fs.setIf((eax>>4)&1 == 1, IBSOPCNT) + fs.setIf((eax>>5)&1 == 1, IBSBRNTRGT) + fs.setIf((eax>>6)&1 == 1, IBSOPCNTEXT) + fs.setIf((eax>>7)&1 == 1, IBSRIPINVALIDCHK) + } + + return fs +} + +func valAsString(values ...uint32) []byte { + r := make([]byte, 4*len(values)) + for i, v := range values { + dst := r[i*4:] + dst[0] = byte(v & 0xff) + dst[1] = byte((v >> 8) & 0xff) + dst[2] = byte((v >> 16) & 0xff) + dst[3] = byte((v >> 24) & 0xff) + switch { + case dst[0] == 0: + return r[:i*4] + case dst[1] == 0: + return r[:i*4+1] + case dst[2] == 0: + return r[:i*4+2] + case dst[3] == 0: + return r[:i*4+3] + } + } + return r +} diff --git a/vendor/github.com/klauspost/cpuid/cpuid_386.s b/vendor/github.com/klauspost/cpuid/v2/cpuid_386.s similarity index 96% rename from vendor/github.com/klauspost/cpuid/cpuid_386.s rename to vendor/github.com/klauspost/cpuid/v2/cpuid_386.s index 4d731711e4..089638f51a 100644 --- a/vendor/github.com/klauspost/cpuid/cpuid_386.s +++ b/vendor/github.com/klauspost/cpuid/v2/cpuid_386.s @@ -1,6 +1,6 @@ // Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. -// +build 386,!gccgo +//+build 386,!gccgo,!noasm,!appengine // func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32) TEXT ·asmCpuid(SB), 7, $0 diff --git a/vendor/github.com/klauspost/cpuid/cpuid_amd64.s b/vendor/github.com/klauspost/cpuid/v2/cpuid_amd64.s similarity index 95% rename from vendor/github.com/klauspost/cpuid/cpuid_amd64.s rename to vendor/github.com/klauspost/cpuid/v2/cpuid_amd64.s index 3c1d60e422..3ba0559e93 100644 --- a/vendor/github.com/klauspost/cpuid/cpuid_amd64.s +++ b/vendor/github.com/klauspost/cpuid/v2/cpuid_amd64.s @@ -1,6 +1,6 @@ // Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. -//+build amd64,!gccgo +//+build amd64,!gccgo,!noasm,!appengine // func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32) TEXT ·asmCpuid(SB), 7, $0 diff --git a/vendor/github.com/klauspost/cpuid/v2/cpuid_arm64.s b/vendor/github.com/klauspost/cpuid/v2/cpuid_arm64.s new file mode 100644 index 0000000000..b31d6aec43 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/v2/cpuid_arm64.s @@ -0,0 +1,26 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +//+build arm64,!gccgo,!noasm,!appengine + +// See https://www.kernel.org/doc/Documentation/arm64/cpu-feature-registers.txt + +// func getMidr +TEXT ·getMidr(SB), 7, $0 + WORD $0xd5380000 // mrs x0, midr_el1 /* Main ID Register */ + MOVD R0, midr+0(FP) + RET + +// func getProcFeatures +TEXT ·getProcFeatures(SB), 7, $0 + WORD $0xd5380400 // mrs x0, id_aa64pfr0_el1 /* Processor Feature Register 0 */ + MOVD R0, procFeatures+0(FP) + RET + +// func getInstAttributes +TEXT ·getInstAttributes(SB), 7, $0 + WORD $0xd5380600 // mrs x0, id_aa64isar0_el1 /* Instruction Set Attribute Register 0 */ + WORD $0xd5380621 // mrs x1, id_aa64isar1_el1 /* Instruction Set Attribute Register 1 */ + MOVD R0, instAttrReg0+0(FP) + MOVD R1, instAttrReg1+8(FP) + RET + diff --git a/vendor/github.com/klauspost/cpuid/v2/detect_arm64.go b/vendor/github.com/klauspost/cpuid/v2/detect_arm64.go new file mode 100644 index 0000000000..9bf9f77f37 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/v2/detect_arm64.go @@ -0,0 +1,246 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +//+build arm64,!gccgo,!noasm,!appengine + +package cpuid + +import "runtime" + +func getMidr() (midr uint64) +func getProcFeatures() (procFeatures uint64) +func getInstAttributes() (instAttrReg0, instAttrReg1 uint64) + +func initCPU() { + cpuid = func(uint32) (a, b, c, d uint32) { return 0, 0, 0, 0 } + cpuidex = func(x, y uint32) (a, b, c, d uint32) { return 0, 0, 0, 0 } + xgetbv = func(uint32) (a, b uint32) { return 0, 0 } + rdtscpAsm = func() (a, b, c, d uint32) { return 0, 0, 0, 0 } +} + +func addInfo(c *CPUInfo, safe bool) { + // Seems to be safe to assume on ARM64 + c.CacheLine = 64 + detectOS(c) + + // ARM64 disabled since it may crash if interrupt is not intercepted by OS. + if safe && !c.Supports(ARMCPUID) && runtime.GOOS != "freebsd" { + return + } + midr := getMidr() + + // MIDR_EL1 - Main ID Register + // https://developer.arm.com/docs/ddi0595/h/aarch64-system-registers/midr_el1 + // x--------------------------------------------------x + // | Name | bits | visible | + // |--------------------------------------------------| + // | Implementer | [31-24] | y | + // |--------------------------------------------------| + // | Variant | [23-20] | y | + // |--------------------------------------------------| + // | Architecture | [19-16] | y | + // |--------------------------------------------------| + // | PartNum | [15-4] | y | + // |--------------------------------------------------| + // | Revision | [3-0] | y | + // x--------------------------------------------------x + + switch (midr >> 24) & 0xff { + case 0xC0: + c.VendorString = "Ampere Computing" + c.VendorID = Ampere + case 0x41: + c.VendorString = "Arm Limited" + c.VendorID = ARM + case 0x42: + c.VendorString = "Broadcom Corporation" + c.VendorID = Broadcom + case 0x43: + c.VendorString = "Cavium Inc" + c.VendorID = Cavium + case 0x44: + c.VendorString = "Digital Equipment Corporation" + c.VendorID = DEC + case 0x46: + c.VendorString = "Fujitsu Ltd" + c.VendorID = Fujitsu + case 0x49: + c.VendorString = "Infineon Technologies AG" + c.VendorID = Infineon + case 0x4D: + c.VendorString = "Motorola or Freescale Semiconductor Inc" + c.VendorID = Motorola + case 0x4E: + c.VendorString = "NVIDIA Corporation" + c.VendorID = NVIDIA + case 0x50: + c.VendorString = "Applied Micro Circuits Corporation" + c.VendorID = AMCC + case 0x51: + c.VendorString = "Qualcomm Inc" + c.VendorID = Qualcomm + case 0x56: + c.VendorString = "Marvell International Ltd" + c.VendorID = Marvell + case 0x69: + c.VendorString = "Intel Corporation" + c.VendorID = Intel + } + + // Lower 4 bits: Architecture + // Architecture Meaning + // 0b0001 Armv4. + // 0b0010 Armv4T. + // 0b0011 Armv5 (obsolete). + // 0b0100 Armv5T. + // 0b0101 Armv5TE. + // 0b0110 Armv5TEJ. + // 0b0111 Armv6. + // 0b1111 Architectural features are individually identified in the ID_* registers, see 'ID registers'. + // Upper 4 bit: Variant + // An IMPLEMENTATION DEFINED variant number. + // Typically, this field is used to distinguish between different product variants, or major revisions of a product. + c.Family = int(midr>>16) & 0xff + + // PartNum, bits [15:4] + // An IMPLEMENTATION DEFINED primary part number for the device. + // On processors implemented by Arm, if the top four bits of the primary + // part number are 0x0 or 0x7, the variant and architecture are encoded differently. + // Revision, bits [3:0] + // An IMPLEMENTATION DEFINED revision number for the device. + c.Model = int(midr) & 0xffff + + procFeatures := getProcFeatures() + + // ID_AA64PFR0_EL1 - Processor Feature Register 0 + // x--------------------------------------------------x + // | Name | bits | visible | + // |--------------------------------------------------| + // | DIT | [51-48] | y | + // |--------------------------------------------------| + // | SVE | [35-32] | y | + // |--------------------------------------------------| + // | GIC | [27-24] | n | + // |--------------------------------------------------| + // | AdvSIMD | [23-20] | y | + // |--------------------------------------------------| + // | FP | [19-16] | y | + // |--------------------------------------------------| + // | EL3 | [15-12] | n | + // |--------------------------------------------------| + // | EL2 | [11-8] | n | + // |--------------------------------------------------| + // | EL1 | [7-4] | n | + // |--------------------------------------------------| + // | EL0 | [3-0] | n | + // x--------------------------------------------------x + + var f flagSet + // if procFeatures&(0xf<<48) != 0 { + // fmt.Println("DIT") + // } + f.setIf(procFeatures&(0xf<<32) != 0, SVE) + if procFeatures&(0xf<<20) != 15<<20 { + f.set(ASIMD) + // https://developer.arm.com/docs/ddi0595/b/aarch64-system-registers/id_aa64pfr0_el1 + // 0b0001 --> As for 0b0000, and also includes support for half-precision floating-point arithmetic. + f.setIf(procFeatures&(0xf<<20) == 1<<20, FPHP, ASIMDHP) + } + f.setIf(procFeatures&(0xf<<16) != 0, FP) + + instAttrReg0, instAttrReg1 := getInstAttributes() + + // https://developer.arm.com/docs/ddi0595/b/aarch64-system-registers/id_aa64isar0_el1 + // + // ID_AA64ISAR0_EL1 - Instruction Set Attribute Register 0 + // x--------------------------------------------------x + // | Name | bits | visible | + // |--------------------------------------------------| + // | TS | [55-52] | y | + // |--------------------------------------------------| + // | FHM | [51-48] | y | + // |--------------------------------------------------| + // | DP | [47-44] | y | + // |--------------------------------------------------| + // | SM4 | [43-40] | y | + // |--------------------------------------------------| + // | SM3 | [39-36] | y | + // |--------------------------------------------------| + // | SHA3 | [35-32] | y | + // |--------------------------------------------------| + // | RDM | [31-28] | y | + // |--------------------------------------------------| + // | ATOMICS | [23-20] | y | + // |--------------------------------------------------| + // | CRC32 | [19-16] | y | + // |--------------------------------------------------| + // | SHA2 | [15-12] | y | + // |--------------------------------------------------| + // | SHA1 | [11-8] | y | + // |--------------------------------------------------| + // | AES | [7-4] | y | + // x--------------------------------------------------x + + // if instAttrReg0&(0xf<<52) != 0 { + // fmt.Println("TS") + // } + // if instAttrReg0&(0xf<<48) != 0 { + // fmt.Println("FHM") + // } + f.setIf(instAttrReg0&(0xf<<44) != 0, ASIMDDP) + f.setIf(instAttrReg0&(0xf<<40) != 0, SM4) + f.setIf(instAttrReg0&(0xf<<36) != 0, SM3) + f.setIf(instAttrReg0&(0xf<<32) != 0, SHA3) + f.setIf(instAttrReg0&(0xf<<28) != 0, ASIMDRDM) + f.setIf(instAttrReg0&(0xf<<20) != 0, ATOMICS) + f.setIf(instAttrReg0&(0xf<<16) != 0, CRC32) + f.setIf(instAttrReg0&(0xf<<12) != 0, SHA2) + // https://developer.arm.com/docs/ddi0595/b/aarch64-system-registers/id_aa64isar0_el1 + // 0b0010 --> As 0b0001, plus SHA512H, SHA512H2, SHA512SU0, and SHA512SU1 instructions implemented. + f.setIf(instAttrReg0&(0xf<<12) == 2<<12, SHA512) + f.setIf(instAttrReg0&(0xf<<8) != 0, SHA1) + f.setIf(instAttrReg0&(0xf<<4) != 0, AESARM) + // https://developer.arm.com/docs/ddi0595/b/aarch64-system-registers/id_aa64isar0_el1 + // 0b0010 --> As for 0b0001, plus PMULL/PMULL2 instructions operating on 64-bit data quantities. + f.setIf(instAttrReg0&(0xf<<4) == 2<<4, PMULL) + + // https://developer.arm.com/docs/ddi0595/b/aarch64-system-registers/id_aa64isar1_el1 + // + // ID_AA64ISAR1_EL1 - Instruction set attribute register 1 + // x--------------------------------------------------x + // | Name | bits | visible | + // |--------------------------------------------------| + // | GPI | [31-28] | y | + // |--------------------------------------------------| + // | GPA | [27-24] | y | + // |--------------------------------------------------| + // | LRCPC | [23-20] | y | + // |--------------------------------------------------| + // | FCMA | [19-16] | y | + // |--------------------------------------------------| + // | JSCVT | [15-12] | y | + // |--------------------------------------------------| + // | API | [11-8] | y | + // |--------------------------------------------------| + // | APA | [7-4] | y | + // |--------------------------------------------------| + // | DPB | [3-0] | y | + // x--------------------------------------------------x + + // if instAttrReg1&(0xf<<28) != 0 { + // fmt.Println("GPI") + // } + f.setIf(instAttrReg1&(0xf<<28) != 24, GPA) + f.setIf(instAttrReg1&(0xf<<20) != 0, LRCPC) + f.setIf(instAttrReg1&(0xf<<16) != 0, FCMA) + f.setIf(instAttrReg1&(0xf<<12) != 0, JSCVT) + // if instAttrReg1&(0xf<<8) != 0 { + // fmt.Println("API") + // } + // if instAttrReg1&(0xf<<4) != 0 { + // fmt.Println("APA") + // } + f.setIf(instAttrReg1&(0xf<<0) != 0, DCPOP) + + // Store + c.featureSet.or(f) +} diff --git a/vendor/github.com/klauspost/cpuid/v2/detect_ref.go b/vendor/github.com/klauspost/cpuid/v2/detect_ref.go new file mode 100644 index 0000000000..e9c8606ab9 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/v2/detect_ref.go @@ -0,0 +1,14 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +//+build !amd64,!386,!arm64 gccgo noasm appengine + +package cpuid + +func initCPU() { + cpuid = func(uint32) (a, b, c, d uint32) { return 0, 0, 0, 0 } + cpuidex = func(x, y uint32) (a, b, c, d uint32) { return 0, 0, 0, 0 } + xgetbv = func(uint32) (a, b uint32) { return 0, 0 } + rdtscpAsm = func() (a, b, c, d uint32) { return 0, 0, 0, 0 } +} + +func addInfo(info *CPUInfo, safe bool) {} diff --git a/vendor/github.com/klauspost/cpuid/v2/detect_x86.go b/vendor/github.com/klauspost/cpuid/v2/detect_x86.go new file mode 100644 index 0000000000..cdb9e7ad73 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/v2/detect_x86.go @@ -0,0 +1,33 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +//+build 386,!gccgo,!noasm amd64,!gccgo,!noasm,!appengine + +package cpuid + +func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32) +func asmCpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32) +func asmXgetbv(index uint32) (eax, edx uint32) +func asmRdtscpAsm() (eax, ebx, ecx, edx uint32) + +func initCPU() { + cpuid = asmCpuid + cpuidex = asmCpuidex + xgetbv = asmXgetbv + rdtscpAsm = asmRdtscpAsm +} + +func addInfo(c *CPUInfo, safe bool) { + c.maxFunc = maxFunctionID() + c.maxExFunc = maxExtendedFunction() + c.BrandName = brandName() + c.CacheLine = cacheLine() + c.Family, c.Model = familyModel() + c.featureSet = support() + c.SGX = hasSGX(c.featureSet.inSet(SGX), c.featureSet.inSet(SGXLC)) + c.ThreadsPerCore = threadsPerCore() + c.LogicalCores = logicalCores() + c.PhysicalCores = physicalCores() + c.VendorID, c.VendorString = vendorID() + c.Hz = hertz(c.BrandName) + c.cacheSize() +} diff --git a/vendor/github.com/klauspost/cpuid/v2/featureid_string.go b/vendor/github.com/klauspost/cpuid/v2/featureid_string.go new file mode 100644 index 0000000000..0e764f9027 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/v2/featureid_string.go @@ -0,0 +1,173 @@ +// Code generated by "stringer -type=FeatureID,Vendor"; DO NOT EDIT. + +package cpuid + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[ADX-1] + _ = x[AESNI-2] + _ = x[AMD3DNOW-3] + _ = x[AMD3DNOWEXT-4] + _ = x[AMXBF16-5] + _ = x[AMXINT8-6] + _ = x[AMXTILE-7] + _ = x[AVX-8] + _ = x[AVX2-9] + _ = x[AVX512BF16-10] + _ = x[AVX512BITALG-11] + _ = x[AVX512BW-12] + _ = x[AVX512CD-13] + _ = x[AVX512DQ-14] + _ = x[AVX512ER-15] + _ = x[AVX512F-16] + _ = x[AVX512IFMA-17] + _ = x[AVX512PF-18] + _ = x[AVX512VBMI-19] + _ = x[AVX512VBMI2-20] + _ = x[AVX512VL-21] + _ = x[AVX512VNNI-22] + _ = x[AVX512VP2INTERSECT-23] + _ = x[AVX512VPOPCNTDQ-24] + _ = x[AVXSLOW-25] + _ = x[BMI1-26] + _ = x[BMI2-27] + _ = x[CLDEMOTE-28] + _ = x[CLMUL-29] + _ = x[CMOV-30] + _ = x[CX16-31] + _ = x[ENQCMD-32] + _ = x[ERMS-33] + _ = x[F16C-34] + _ = x[FMA3-35] + _ = x[FMA4-36] + _ = x[GFNI-37] + _ = x[HLE-38] + _ = x[HTT-39] + _ = x[HYPERVISOR-40] + _ = x[IBPB-41] + _ = x[IBS-42] + _ = x[IBSBRNTRGT-43] + _ = x[IBSFETCHSAM-44] + _ = x[IBSFFV-45] + _ = x[IBSOPCNT-46] + _ = x[IBSOPCNTEXT-47] + _ = x[IBSOPSAM-48] + _ = x[IBSRDWROPCNT-49] + _ = x[IBSRIPINVALIDCHK-50] + _ = x[LZCNT-51] + _ = x[MMX-52] + _ = x[MMXEXT-53] + _ = x[MOVDIR64B-54] + _ = x[MOVDIRI-55] + _ = x[MPX-56] + _ = x[NX-57] + _ = x[POPCNT-58] + _ = x[RDRAND-59] + _ = x[RDSEED-60] + _ = x[RDTSCP-61] + _ = x[RTM-62] + _ = x[SERIALIZE-63] + _ = x[SGX-64] + _ = x[SGXLC-65] + _ = x[SHA-66] + _ = x[SSE-67] + _ = x[SSE2-68] + _ = x[SSE3-69] + _ = x[SSE4-70] + _ = x[SSE42-71] + _ = x[SSE4A-72] + _ = x[SSSE3-73] + _ = x[STIBP-74] + _ = x[TBM-75] + _ = x[TSXLDTRK-76] + _ = x[VAES-77] + _ = x[VMX-78] + _ = x[VPCLMULQDQ-79] + _ = x[WAITPKG-80] + _ = x[WBNOINVD-81] + _ = x[XOP-82] + _ = x[AESARM-83] + _ = x[ARMCPUID-84] + _ = x[ASIMD-85] + _ = x[ASIMDDP-86] + _ = x[ASIMDHP-87] + _ = x[ASIMDRDM-88] + _ = x[ATOMICS-89] + _ = x[CRC32-90] + _ = x[DCPOP-91] + _ = x[EVTSTRM-92] + _ = x[FCMA-93] + _ = x[FP-94] + _ = x[FPHP-95] + _ = x[GPA-96] + _ = x[JSCVT-97] + _ = x[LRCPC-98] + _ = x[PMULL-99] + _ = x[SHA1-100] + _ = x[SHA2-101] + _ = x[SHA3-102] + _ = x[SHA512-103] + _ = x[SM3-104] + _ = x[SM4-105] + _ = x[SVE-106] + _ = x[lastID-107] + _ = x[firstID-0] +} + +const _FeatureID_name = "firstIDADXAESNIAMD3DNOWAMD3DNOWEXTAMXBF16AMXINT8AMXTILEAVXAVX2AVX512BF16AVX512BITALGAVX512BWAVX512CDAVX512DQAVX512ERAVX512FAVX512IFMAAVX512PFAVX512VBMIAVX512VBMI2AVX512VLAVX512VNNIAVX512VP2INTERSECTAVX512VPOPCNTDQAVXSLOWBMI1BMI2CLDEMOTECLMULCMOVCX16ENQCMDERMSF16CFMA3FMA4GFNIHLEHTTHYPERVISORIBPBIBSIBSBRNTRGTIBSFETCHSAMIBSFFVIBSOPCNTIBSOPCNTEXTIBSOPSAMIBSRDWROPCNTIBSRIPINVALIDCHKLZCNTMMXMMXEXTMOVDIR64BMOVDIRIMPXNXPOPCNTRDRANDRDSEEDRDTSCPRTMSERIALIZESGXSGXLCSHASSESSE2SSE3SSE4SSE42SSE4ASSSE3STIBPTBMTSXLDTRKVAESVMXVPCLMULQDQWAITPKGWBNOINVDXOPAESARMARMCPUIDASIMDASIMDDPASIMDHPASIMDRDMATOMICSCRC32DCPOPEVTSTRMFCMAFPFPHPGPAJSCVTLRCPCPMULLSHA1SHA2SHA3SHA512SM3SM4SVElastID" + +var _FeatureID_index = [...]uint16{0, 7, 10, 15, 23, 34, 41, 48, 55, 58, 62, 72, 84, 92, 100, 108, 116, 123, 133, 141, 151, 162, 170, 180, 198, 213, 220, 224, 228, 236, 241, 245, 249, 255, 259, 263, 267, 271, 275, 278, 281, 291, 295, 298, 308, 319, 325, 333, 344, 352, 364, 380, 385, 388, 394, 403, 410, 413, 415, 421, 427, 433, 439, 442, 451, 454, 459, 462, 465, 469, 473, 477, 482, 487, 492, 497, 500, 508, 512, 515, 525, 532, 540, 543, 549, 557, 562, 569, 576, 584, 591, 596, 601, 608, 612, 614, 618, 621, 626, 631, 636, 640, 644, 648, 654, 657, 660, 663, 669} + +func (i FeatureID) String() string { + if i < 0 || i >= FeatureID(len(_FeatureID_index)-1) { + return "FeatureID(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _FeatureID_name[_FeatureID_index[i]:_FeatureID_index[i+1]] +} +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[VendorUnknown-0] + _ = x[Intel-1] + _ = x[AMD-2] + _ = x[VIA-3] + _ = x[Transmeta-4] + _ = x[NSC-5] + _ = x[KVM-6] + _ = x[MSVM-7] + _ = x[VMware-8] + _ = x[XenHVM-9] + _ = x[Bhyve-10] + _ = x[Hygon-11] + _ = x[SiS-12] + _ = x[RDC-13] + _ = x[Ampere-14] + _ = x[ARM-15] + _ = x[Broadcom-16] + _ = x[Cavium-17] + _ = x[DEC-18] + _ = x[Fujitsu-19] + _ = x[Infineon-20] + _ = x[Motorola-21] + _ = x[NVIDIA-22] + _ = x[AMCC-23] + _ = x[Qualcomm-24] + _ = x[Marvell-25] + _ = x[lastVendor-26] +} + +const _Vendor_name = "VendorUnknownIntelAMDVIATransmetaNSCKVMMSVMVMwareXenHVMBhyveHygonSiSRDCAmpereARMBroadcomCaviumDECFujitsuInfineonMotorolaNVIDIAAMCCQualcommMarvelllastVendor" + +var _Vendor_index = [...]uint8{0, 13, 18, 21, 24, 33, 36, 39, 43, 49, 55, 60, 65, 68, 71, 77, 80, 88, 94, 97, 104, 112, 120, 126, 130, 138, 145, 155} + +func (i Vendor) String() string { + if i < 0 || i >= Vendor(len(_Vendor_index)-1) { + return "Vendor(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _Vendor_name[_Vendor_index[i]:_Vendor_index[i+1]] +} diff --git a/vendor/github.com/klauspost/cpuid/v2/go.mod b/vendor/github.com/klauspost/cpuid/v2/go.mod new file mode 100644 index 0000000000..2afac8eb28 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/v2/go.mod @@ -0,0 +1,3 @@ +module github.com/klauspost/cpuid/v2 + +go 1.13 diff --git a/vendor/github.com/klauspost/cpuid/v2/os_darwin_arm64.go b/vendor/github.com/klauspost/cpuid/v2/os_darwin_arm64.go new file mode 100644 index 0000000000..82d272fab3 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/v2/os_darwin_arm64.go @@ -0,0 +1,15 @@ +// Copyright (c) 2020 Klaus Post, released under MIT License. See LICENSE file. + +package cpuid + +import "runtime" + +func detectOS(c *CPUInfo) bool { + // There are no hw.optional sysctl values for the below features on Mac OS 11.0 + // to detect their supported state dynamically. Assume the CPU features that + // Apple Silicon M1 supports to be available as a minimal set of features + // to all Go programs running on darwin/arm64. + // TODO: Add more if we know them. + c.featureSet.setIf(runtime.GOOS != "ios", AESARM, PMULL, SHA1, SHA2) + return true +} diff --git a/vendor/github.com/klauspost/cpuid/v2/os_linux_arm64.go b/vendor/github.com/klauspost/cpuid/v2/os_linux_arm64.go new file mode 100644 index 0000000000..a01afad81c --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/v2/os_linux_arm64.go @@ -0,0 +1,161 @@ +// Copyright (c) 2020 Klaus Post, released under MIT License. See LICENSE file. + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file located +// here https://github.com/golang/sys/blob/master/LICENSE + +package cpuid + +import ( + "encoding/binary" + "io/ioutil" + "runtime" + "unsafe" +) + +// HWCAP bits. +const ( + hwcap_FP = 1 << 0 + hwcap_ASIMD = 1 << 1 + hwcap_EVTSTRM = 1 << 2 + hwcap_AES = 1 << 3 + hwcap_PMULL = 1 << 4 + hwcap_SHA1 = 1 << 5 + hwcap_SHA2 = 1 << 6 + hwcap_CRC32 = 1 << 7 + hwcap_ATOMICS = 1 << 8 + hwcap_FPHP = 1 << 9 + hwcap_ASIMDHP = 1 << 10 + hwcap_CPUID = 1 << 11 + hwcap_ASIMDRDM = 1 << 12 + hwcap_JSCVT = 1 << 13 + hwcap_FCMA = 1 << 14 + hwcap_LRCPC = 1 << 15 + hwcap_DCPOP = 1 << 16 + hwcap_SHA3 = 1 << 17 + hwcap_SM3 = 1 << 18 + hwcap_SM4 = 1 << 19 + hwcap_ASIMDDP = 1 << 20 + hwcap_SHA512 = 1 << 21 + hwcap_SVE = 1 << 22 + hwcap_ASIMDFHM = 1 << 23 +) + +//go:linkname hwcap internal/cpu.HWCap +var hwcap uint + +func detectOS(c *CPUInfo) bool { + // For now assuming no hyperthreading is reasonable. + c.LogicalCores = int(getproccount()) + c.PhysicalCores = c.LogicalCores + c.ThreadsPerCore = 1 + if hwcap == 0 { + // We did not get values from the runtime. + // Try reading /proc/self/auxv + + // From https://github.com/golang/sys + const ( + _AT_HWCAP = 16 + _AT_HWCAP2 = 26 + + uintSize = int(32 << (^uint(0) >> 63)) + ) + + buf, err := ioutil.ReadFile("/proc/self/auxv") + if err != nil { + // e.g. on android /proc/self/auxv is not accessible, so silently + // ignore the error and leave Initialized = false. On some + // architectures (e.g. arm64) doinit() implements a fallback + // readout and will set Initialized = true again. + return false + } + bo := binary.LittleEndian + for len(buf) >= 2*(uintSize/8) { + var tag, val uint + switch uintSize { + case 32: + tag = uint(bo.Uint32(buf[0:])) + val = uint(bo.Uint32(buf[4:])) + buf = buf[8:] + case 64: + tag = uint(bo.Uint64(buf[0:])) + val = uint(bo.Uint64(buf[8:])) + buf = buf[16:] + } + switch tag { + case _AT_HWCAP: + hwcap = val + case _AT_HWCAP2: + // Not used + } + } + if hwcap == 0 { + return false + } + } + + // HWCap was populated by the runtime from the auxiliary vector. + // Use HWCap information since reading aarch64 system registers + // is not supported in user space on older linux kernels. + c.featureSet.setIf(isSet(hwcap, hwcap_AES), AESARM) + c.featureSet.setIf(isSet(hwcap, hwcap_ASIMD), ASIMD) + c.featureSet.setIf(isSet(hwcap, hwcap_ASIMDDP), ASIMDDP) + c.featureSet.setIf(isSet(hwcap, hwcap_ASIMDHP), ASIMDHP) + c.featureSet.setIf(isSet(hwcap, hwcap_ASIMDRDM), ASIMDRDM) + c.featureSet.setIf(isSet(hwcap, hwcap_CPUID), ARMCPUID) + c.featureSet.setIf(isSet(hwcap, hwcap_CRC32), CRC32) + c.featureSet.setIf(isSet(hwcap, hwcap_DCPOP), DCPOP) + c.featureSet.setIf(isSet(hwcap, hwcap_EVTSTRM), EVTSTRM) + c.featureSet.setIf(isSet(hwcap, hwcap_FCMA), FCMA) + c.featureSet.setIf(isSet(hwcap, hwcap_FP), FP) + c.featureSet.setIf(isSet(hwcap, hwcap_FPHP), FPHP) + c.featureSet.setIf(isSet(hwcap, hwcap_JSCVT), JSCVT) + c.featureSet.setIf(isSet(hwcap, hwcap_LRCPC), LRCPC) + c.featureSet.setIf(isSet(hwcap, hwcap_PMULL), PMULL) + c.featureSet.setIf(isSet(hwcap, hwcap_SHA1), SHA1) + c.featureSet.setIf(isSet(hwcap, hwcap_SHA2), SHA2) + c.featureSet.setIf(isSet(hwcap, hwcap_SHA3), SHA3) + c.featureSet.setIf(isSet(hwcap, hwcap_SHA512), SHA512) + c.featureSet.setIf(isSet(hwcap, hwcap_SM3), SM3) + c.featureSet.setIf(isSet(hwcap, hwcap_SM4), SM4) + c.featureSet.setIf(isSet(hwcap, hwcap_SVE), SVE) + + // The Samsung S9+ kernel reports support for atomics, but not all cores + // actually support them, resulting in SIGILL. See issue #28431. + // TODO(elias.naur): Only disable the optimization on bad chipsets on android. + c.featureSet.setIf(isSet(hwcap, hwcap_ATOMICS) && runtime.GOOS != "android", ATOMICS) + + return true +} + +func isSet(hwc uint, value uint) bool { + return hwc&value != 0 +} + +//go:noescape +//go:linkname sched_getaffinity runtime.sched_getaffinity +func sched_getaffinity(pid, len uintptr, buf *byte) int32 + +func getproccount() int32 { + // This buffer is huge (8 kB) but we are on the system stack + // and there should be plenty of space (64 kB). + // Also this is a leaf, so we're not holding up the memory for long. + const maxCPUs = 64 * 1024 + var buf [maxCPUs / 8]byte + r := sched_getaffinity(0, unsafe.Sizeof(buf), &buf[0]) + if r < 0 { + return 0 + } + n := int32(0) + for _, v := range buf[:r] { + for v != 0 { + n += int32(v & 1) + v >>= 1 + } + } + if n == 0 { + n = 1 + } + return n +} diff --git a/vendor/github.com/klauspost/cpuid/v2/os_other_arm64.go b/vendor/github.com/klauspost/cpuid/v2/os_other_arm64.go new file mode 100644 index 0000000000..df0ad06b38 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/v2/os_other_arm64.go @@ -0,0 +1,11 @@ +// Copyright (c) 2020 Klaus Post, released under MIT License. See LICENSE file. + +// +build arm64 +// +build !linux +// +build !darwin + +package cpuid + +func detectOS(c *CPUInfo) bool { + return false +} diff --git a/vendor/github.com/klauspost/pgzip/LICENSE b/vendor/github.com/klauspost/pgzip/LICENSE index 2bdc0d7517..3909da4103 100644 --- a/vendor/github.com/klauspost/pgzip/LICENSE +++ b/vendor/github.com/klauspost/pgzip/LICENSE @@ -1,4 +1,4 @@ -The MIT License (MIT) +MIT License Copyright (c) 2014 Klaus Post @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/vendor/github.com/klauspost/pgzip/README.md b/vendor/github.com/klauspost/pgzip/README.md index 81000996c9..171b978fdc 100644 --- a/vendor/github.com/klauspost/pgzip/README.md +++ b/vendor/github.com/klauspost/pgzip/README.md @@ -39,7 +39,6 @@ You might need to get/update the dependencies: ``` go get -u github.com/klauspost/compress -go get -u github.com/klauspost/crc32 ``` Usage @@ -65,7 +64,7 @@ Changes in [github.com/klauspost/compress](https://github.com/klauspost/compress ## Compression The simplest way to use this is to simply do the same as you would when using [compress/gzip](http://golang.org/pkg/compress/gzip). -To change the block size, use the added (*pgzip.Writer).SetConcurrency(blockSize, blocks int) function. With this you can control the approximate size of your blocks, as well as how many you want to be processing in parallel. Default values for this is SetConcurrency(250000, 16), meaning blocks are split at 250000 bytes and up to 16 blocks can be processing at once before the writer blocks. +To change the block size, use the added (*pgzip.Writer).SetConcurrency(blockSize, blocks int) function. With this you can control the approximate size of your blocks, as well as how many you want to be processing in parallel. Default values for this is SetConcurrency(1MB, runtime.GOMAXPROCS(0)), meaning blocks are split at 1 MB and up to the number of CPU threads blocks can be processing at once before the writer blocks. Example: @@ -99,19 +98,19 @@ See my blog post in [Benchmarks of Golang Gzip](https://blog.klauspost.com/go-gz Compression cost is usually about 0.2% with default settings with a block size of 250k. -Example with GOMAXPROC set to 8 (quad core with 8 hyperthreads) +Example with GOMAXPROC set to 32 (16 core CPU) Content is [Matt Mahoneys 10GB corpus](http://mattmahoney.net/dc/10gb.html). Compression level 6. Compressor | MB/sec | speedup | size | size overhead (lower=better) ------------|----------|---------|------|--------- -[gzip](http://golang.org/pkg/compress/gzip) (golang) | 7.21MB/s | 1.0x | 4786608902 | 0% -[gzip](http://github.com/klauspost/compress/gzip) (klauspost) | 10.98MB/s | 1.52x | 4781331645 | -0.11% -[pgzip](https://github.com/klauspost/pgzip) (klauspost) | 50.76MB/s|7.04x | 4784121440 | -0.052% -[bgzf](https://godoc.org/github.com/biogo/hts/bgzf) (biogo) | 38.65MB/s | 5.36x | 4924899484 | 2.889% -[pargzip](https://godoc.org/github.com/golang/build/pargzip) (builder) | 32.00MB/s | 4.44x | 4791226567 | 0.096% +[gzip](http://golang.org/pkg/compress/gzip) (golang) | 15.44MB/s (1 thread) | 1.0x | 4781329307 | 0% +[gzip](http://github.com/klauspost/compress/gzip) (klauspost) | 135.04MB/s (1 thread) | 8.74x | 4894858258 | +2.37% +[pgzip](https://github.com/klauspost/pgzip) (klauspost) | 1573.23MB/s| 101.9x | 4902285651 | +2.53% +[bgzf](https://godoc.org/github.com/biogo/hts/bgzf) (biogo) | 361.40MB/s | 23.4x | 4869686090 | +1.85% +[pargzip](https://godoc.org/github.com/golang/build/pargzip) (builder) | 306.01MB/s | 19.8x | 4786890417 | +0.12% -pgzip also contains a [linear time compression](https://github.com/klauspost/compress#linear-time-compression) mode, that will allow compression at ~150MB per core per second, independent of the content. +pgzip also contains a [linear time compression](https://github.com/klauspost/compress#linear-time-compression-huffman-only) mode, that will allow compression at ~250MB per core per second, independent of the content. See the [complete sheet](https://docs.google.com/spreadsheets/d/1nuNE2nPfuINCZJRMt6wFWhKpToF95I47XjSsc-1rbPQ/edit?usp=sharing) for different content types and compression settings. diff --git a/vendor/github.com/klauspost/pgzip/gzip.go b/vendor/github.com/klauspost/pgzip/gzip.go index 85d14e9cbc..257c4d299f 100644 --- a/vendor/github.com/klauspost/pgzip/gzip.go +++ b/vendor/github.com/klauspost/pgzip/gzip.go @@ -11,6 +11,7 @@ import ( "hash" "hash/crc32" "io" + "runtime" "sync" "time" @@ -18,9 +19,9 @@ import ( ) const ( - defaultBlockSize = 256 << 10 + defaultBlockSize = 1 << 20 tailSize = 16384 - defaultBlocks = 16 + defaultBlocks = 4 ) // These constants are copied from the flate package, so that code that imports @@ -68,8 +69,8 @@ type result struct { // With this you can control the approximate size of your blocks, // as well as how many you want to be processing in parallel. // -// Default values for this is SetConcurrency(250000, 16), -// meaning blocks are split at 250000 bytes and up to 16 blocks +// Default values for this is SetConcurrency(defaultBlockSize, runtime.GOMAXPROCS(0)), +// meaning blocks are split at 1 MB and up to the number of CPU threads // can be processing at once before the writer blocks. func (z *Writer) SetConcurrency(blockSize, blocks int) error { if blockSize <= tailSize { @@ -84,7 +85,7 @@ func (z *Writer) SetConcurrency(blockSize, blocks int) error { z.blockSize = blockSize z.results = make(chan result, blocks) z.blocks = blocks - z.dstPool = sync.Pool{New: func() interface{} { return make([]byte, 0, blockSize+(blockSize)>>4) }} + z.dstPool.New = func() interface{} { return make([]byte, 0, blockSize+(blockSize)>>4) } return nil } @@ -115,7 +116,7 @@ func NewWriterLevel(w io.Writer, level int) (*Writer, error) { return nil, fmt.Errorf("gzip: invalid compression level: %d", level) } z := new(Writer) - z.SetConcurrency(defaultBlockSize, defaultBlocks) + z.SetConcurrency(defaultBlockSize, runtime.GOMAXPROCS(0)) z.init(w, level) return z, nil } @@ -174,7 +175,7 @@ func (z *Writer) Reset(w io.Writer) { if z.results != nil && !z.closed { close(z.results) } - z.SetConcurrency(defaultBlockSize, defaultBlocks) + z.SetConcurrency(defaultBlockSize, runtime.GOMAXPROCS(0)) z.init(w, z.level) } @@ -239,36 +240,36 @@ func (z *Writer) writeString(s string) (err error) { // compressCurrent will compress the data currently buffered // This should only be called from the main writer/flush/closer func (z *Writer) compressCurrent(flush bool) { + c := z.currentBuffer + if len(c) > z.blockSize { + // This can never happen through the public interface. + panic("len(z.currentBuffer) > z.blockSize (most likely due to concurrent Write race)") + } + r := result{} r.result = make(chan []byte, 1) r.notifyWritten = make(chan struct{}, 0) + // Reserve a result slot select { case z.results <- r: case <-z.pushedErr: return } - // If block given is more than twice the block size, split it. - c := z.currentBuffer - if len(c) > z.blockSize*2 { - c = c[:z.blockSize] - z.wg.Add(1) - go z.compressBlock(c, z.prevTail, r, false) - z.prevTail = c[len(c)-tailSize:] - z.currentBuffer = z.currentBuffer[z.blockSize:] - z.compressCurrent(flush) - // Last one flushes if needed - return - } - z.wg.Add(1) - go z.compressBlock(c, z.prevTail, r, z.closed) + tail := z.prevTail if len(c) > tailSize { - z.prevTail = c[len(c)-tailSize:] + buf := z.dstPool.Get().([]byte) // Put in .compressBlock + // Copy tail from current buffer before handing the buffer over to the + // compressBlock goroutine. + buf = append(buf[:0], c[len(c)-tailSize:]...) + z.prevTail = buf } else { z.prevTail = nil } - z.currentBuffer = z.dstPool.Get().([]byte) + go z.compressBlock(c, tail, r, z.closed) + + z.currentBuffer = z.dstPool.Get().([]byte) // Put in .compressBlock z.currentBuffer = z.currentBuffer[:0] // Wait if flushing @@ -358,29 +359,37 @@ func (z *Writer) Write(p []byte) (int, error) { // Start receiving data from compressors go func() { listen := z.results + var failed bool for { r, ok := <-listen // If closed, we are finished. if !ok { return } + if failed { + close(r.notifyWritten) + continue + } buf := <-r.result n, err := z.w.Write(buf) if err != nil { z.pushError(err) close(r.notifyWritten) - return + failed = true + continue } if n != len(buf) { z.pushError(fmt.Errorf("gzip: short write %d should be %d", n, len(buf))) + failed = true close(r.notifyWritten) - return + continue } z.dstPool.Put(buf) close(r.notifyWritten) } }() - z.currentBuffer = make([]byte, 0, z.blockSize) + z.currentBuffer = z.dstPool.Get().([]byte) + z.currentBuffer = z.currentBuffer[:0] } q := p for len(q) > 0 { @@ -390,10 +399,13 @@ func (z *Writer) Write(p []byte) (int, error) { } z.digest.Write(q[:length]) z.currentBuffer = append(z.currentBuffer, q[:length]...) - if len(z.currentBuffer) >= z.blockSize { + if len(z.currentBuffer) > z.blockSize { + panic("z.currentBuffer too large (most likely due to concurrent Write race)") + } + if len(z.currentBuffer) == z.blockSize { z.compressCurrent(false) if err := z.checkError(); err != nil { - return len(p) - len(q) - length, err + return len(p) - len(q), err } } z.size += length @@ -410,12 +422,13 @@ func (z *Writer) compressBlock(p, prevTail []byte, r result, closed bool) { close(r.result) z.wg.Done() }() - buf := z.dstPool.Get().([]byte) + buf := z.dstPool.Get().([]byte) // Corresponding Put in .Write's result writer dest := bytes.NewBuffer(buf[:0]) - compressor := z.dictFlatePool.Get().(*flate.Writer) + compressor := z.dictFlatePool.Get().(*flate.Writer) // Put below compressor.ResetDict(dest, prevTail) compressor.Write(p) + z.dstPool.Put(p) // Corresponding Get in .Write and .compressCurrent err := compressor.Flush() if err != nil { @@ -429,7 +442,12 @@ func (z *Writer) compressBlock(p, prevTail []byte, r result, closed bool) { return } } - z.dictFlatePool.Put(compressor) + z.dictFlatePool.Put(compressor) // Get above + + if prevTail != nil { + z.dstPool.Put(prevTail) // Get in .compressCurrent + } + // Read back buffer buf = dest.Bytes() r.result <- buf diff --git a/vendor/github.com/klauspost/reedsolomon/.travis.yml b/vendor/github.com/klauspost/reedsolomon/.travis.yml index f77b85c5bb..51e23b1683 100644 --- a/vendor/github.com/klauspost/reedsolomon/.travis.yml +++ b/vendor/github.com/klauspost/reedsolomon/.travis.yml @@ -12,9 +12,9 @@ arch: - s390x go: - - 1.12.x - 1.13.x - 1.14.x + - 1.15.x - master install: @@ -41,7 +41,7 @@ jobs: fast_finish: true include: - stage: gofmt - go: 1.14.x + go: 1.15.x os: linux arch: amd64 script: @@ -50,7 +50,7 @@ jobs: - go install github.com/klauspost/asmfmt/cmd/asmfmt - diff <(asmfmt -d .) <(printf "") - stage: race - go: 1.14.x + go: 1.15.x os: linux arch: amd64 script: @@ -62,7 +62,7 @@ jobs: - go test -no-avx512 -no-avx2 -short -race . - go test -no-avx512 -no-avx2 -no-ssse3 -short -race . - stage: amd64-noasm - go: 1.14.x + go: 1.15.x os: linux arch: amd64 script: @@ -70,7 +70,7 @@ jobs: - go test -no-avx512 -no-avx2 - go test -no-avx512 -no-avx2 -no-ssse3 - stage: i386 - go: 1.14.x + go: 1.15.x os: linux arch: amd64 script: diff --git a/vendor/github.com/klauspost/reedsolomon/README.md b/vendor/github.com/klauspost/reedsolomon/README.md index f9824cbb85..ff50f4329c 100644 --- a/vendor/github.com/klauspost/reedsolomon/README.md +++ b/vendor/github.com/klauspost/reedsolomon/README.md @@ -23,6 +23,8 @@ To get the package use the standard: go get -u github.com/klauspost/reedsolomon ``` +Using Go modules recommended. + # Changes ## May 2020 @@ -300,14 +302,16 @@ Performance depends mainly on the number of parity shards. In rough terms, doubling the number of parity shards will double the encoding time. Here are the throughput numbers with some different selections of data and parity shards. -For reference each shard is 1MB random data, and 2 CPU cores are used for encoding. - -| Data | Parity | Parity | MB/s | SSSE3 MB/s | SSSE3 Speed | Rel. Speed | -|------|--------|--------|--------|-------------|-------------|------------| -| 5 | 2 | 40% | 576,11 | 2599,2 | 451% | 100,00% | -| 10 | 2 | 20% | 587,73 | 3100,28 | 528% | 102,02% | -| 10 | 4 | 40% | 298,38 | 2470,97 | 828% | 51,79% | -| 50 | 20 | 40% | 59,81 | 713,28 | 1193% | 10,38% | +For reference each shard is 1MB random data, and 16 CPU cores are used for encoding. + +| Data | Parity | Go MB/s | SSSE3 MB/s | AVX2 MB/s | +|------|--------|---------|------------|-----------| +| 5 | 2 | 14287 | 66355 | 108755 | +| 8 | 8 | 5569 | 34298 | 70516 | +| 10 | 4 | 6766 | 48237 | 93875 | +| 50 | 20 | 1540 | 12130 | 22090 | + +The throughput numbers here is the size of the encoded data and parity shards. If `runtime.GOMAXPROCS()` is set to a value higher than 1, the encoder will use multiple goroutines to perform the calculations in `Verify`, `Encode` and `Reconstruct`. diff --git a/vendor/github.com/klauspost/reedsolomon/galois.go b/vendor/github.com/klauspost/reedsolomon/galois.go index 76049f9d78..ff93d65860 100644 --- a/vendor/github.com/klauspost/reedsolomon/galois.go +++ b/vendor/github.com/klauspost/reedsolomon/galois.go @@ -917,12 +917,14 @@ func genAvx2Matrix(matrixRows [][]byte, inputs, outputs int, dst []byte) []byte for i, row := range matrixRows[:outputs] { for j, idx := range row[:inputs] { dstIdx := (j*outputs + i) * 64 + dstPart := dst[dstIdx:] + dstPart = dstPart[:64] lo := mulTableLow[idx][:] hi := mulTableHigh[idx][:] - copy(dst[dstIdx:], lo) - copy(dst[dstIdx+16:], lo) - copy(dst[dstIdx+32:], hi) - copy(dst[dstIdx+48:], hi) + copy(dstPart[:16], lo) + copy(dstPart[16:32], lo) + copy(dstPart[32:48], hi) + copy(dstPart[48:64], hi) } } return dst diff --git a/vendor/github.com/klauspost/reedsolomon/galois_gen_amd64.s b/vendor/github.com/klauspost/reedsolomon/galois_gen_amd64.s index c76db3c82d..c7154b7868 100644 --- a/vendor/github.com/klauspost/reedsolomon/galois_gen_amd64.s +++ b/vendor/github.com/klauspost/reedsolomon/galois_gen_amd64.s @@ -9,42 +9,50 @@ // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_1x1(SB), $0-88 // Loading all tables to registers + // Destination kept in GP registers // Full registers estimated 6 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_1x1_end - MOVQ out_base+48(FP), DX - MOVQ (DX), DX - VMOVDQU (CX), Y1 - VMOVDQU 32(CX), Y2 - MOVQ in_base+24(FP), CX - MOVQ (CX), CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_1x1_end + VMOVDQU (CX), Y0 + VMOVDQU 32(CX), Y1 + MOVQ in_base+24(FP), CX + MOVQ (CX), CX + MOVQ out_base+48(FP), DX + MOVQ (DX), DX + MOVQ start+72(FP), BX + + // Add start offset to output + ADDQ BX, DX + + // Add start offset to input + ADDQ BX, CX MOVQ $0x0000000f, BX MOVQ BX, X3 VPBROADCASTB X3, Y3 - MOVQ start+72(FP), BX mulAvxTwo_1x1_loop: // Clear 1 outputs - VPXOR Y0, Y0, Y0 + VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (CX)(BX*1), Y4 + VMOVDQU (CX), Y4 + ADDQ $0x20, CX VPSRLQ $0x04, Y4, Y5 VPAND Y3, Y4, Y4 VPAND Y3, Y5, Y5 - VPSHUFB Y4, Y1, Y4 - VPSHUFB Y5, Y2, Y5 + VPSHUFB Y4, Y0, Y4 + VPSHUFB Y5, Y1, Y5 VPXOR Y4, Y5, Y4 - VPXOR Y4, Y0, Y0 + VPXOR Y4, Y2, Y2 // Store 1 outputs - VMOVDQU Y0, (DX)(BX*1) + VMOVDQU Y2, (DX) + ADDQ $0x20, DX // Prepare for next loop - ADDQ $0x20, BX DECQ AX JNZ mulAvxTwo_1x1_loop VZEROUPPER @@ -56,51 +64,61 @@ mulAvxTwo_1x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_1x2(SB), $0-88 // Loading all tables to registers + // Destination kept in GP registers // Full registers estimated 11 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_1x2_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), DX - VMOVDQU (CX), Y2 - VMOVDQU 32(CX), Y3 - VMOVDQU 64(CX), Y4 - VMOVDQU 96(CX), Y5 - MOVQ in_base+24(FP), CX - MOVQ (CX), CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_1x2_end + VMOVDQU (CX), Y0 + VMOVDQU 32(CX), Y1 + VMOVDQU 64(CX), Y2 + VMOVDQU 96(CX), Y3 + MOVQ in_base+24(FP), CX + MOVQ (CX), CX + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), DX + MOVQ start+72(FP), BP + + // Add start offset to output + ADDQ BP, BX + ADDQ BP, DX + + // Add start offset to input + ADDQ BP, CX MOVQ $0x0000000f, BP MOVQ BP, X6 VPBROADCASTB X6, Y6 - MOVQ start+72(FP), BP mulAvxTwo_1x2_loop: // Clear 2 outputs - VPXOR Y0, Y0, Y0 - VPXOR Y1, Y1, Y1 + VPXOR Y4, Y4, Y4 + VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (CX)(BP*1), Y9 + VMOVDQU (CX), Y9 + ADDQ $0x20, CX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 + VPSHUFB Y9, Y0, Y7 + VPSHUFB Y10, Y1, Y8 + VPXOR Y7, Y8, Y7 + VPXOR Y7, Y4, Y4 VPSHUFB Y9, Y2, Y7 VPSHUFB Y10, Y3, Y8 VPXOR Y7, Y8, Y7 - VPXOR Y7, Y0, Y0 - VPSHUFB Y9, Y4, Y7 - VPSHUFB Y10, Y5, Y8 - VPXOR Y7, Y8, Y7 - VPXOR Y7, Y1, Y1 + VPXOR Y7, Y5, Y5 // Store 2 outputs - VMOVDQU Y0, (BX)(BP*1) - VMOVDQU Y1, (DX)(BP*1) + VMOVDQU Y4, (BX) + ADDQ $0x20, BX + VMOVDQU Y5, (DX) + ADDQ $0x20, DX // Prepare for next loop - ADDQ $0x20, BP DECQ AX JNZ mulAvxTwo_1x2_loop VZEROUPPER @@ -112,60 +130,72 @@ mulAvxTwo_1x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_1x3(SB), $0-88 // Loading all tables to registers + // Destination kept in GP registers // Full registers estimated 14 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_1x3_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), DX - VMOVDQU (CX), Y3 - VMOVDQU 32(CX), Y4 - VMOVDQU 64(CX), Y5 - VMOVDQU 96(CX), Y6 - VMOVDQU 128(CX), Y7 - VMOVDQU 160(CX), Y8 - MOVQ in_base+24(FP), CX - MOVQ (CX), CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_1x3_end + VMOVDQU (CX), Y0 + VMOVDQU 32(CX), Y1 + VMOVDQU 64(CX), Y2 + VMOVDQU 96(CX), Y3 + VMOVDQU 128(CX), Y4 + VMOVDQU 160(CX), Y5 + MOVQ in_base+24(FP), CX + MOVQ (CX), CX + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), DX + MOVQ start+72(FP), SI + + // Add start offset to output + ADDQ SI, BX + ADDQ SI, BP + ADDQ SI, DX + + // Add start offset to input + ADDQ SI, CX MOVQ $0x0000000f, SI MOVQ SI, X9 VPBROADCASTB X9, Y9 - MOVQ start+72(FP), SI mulAvxTwo_1x3_loop: // Clear 3 outputs - VPXOR Y0, Y0, Y0 - VPXOR Y1, Y1, Y1 - VPXOR Y2, Y2, Y2 + VPXOR Y6, Y6, Y6 + VPXOR Y7, Y7, Y7 + VPXOR Y8, Y8, Y8 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (CX)(SI*1), Y12 + VMOVDQU (CX), Y12 + ADDQ $0x20, CX VPSRLQ $0x04, Y12, Y13 VPAND Y9, Y12, Y12 VPAND Y9, Y13, Y13 - VPSHUFB Y12, Y3, Y10 - VPSHUFB Y13, Y4, Y11 + VPSHUFB Y12, Y0, Y10 + VPSHUFB Y13, Y1, Y11 VPXOR Y10, Y11, Y10 - VPXOR Y10, Y0, Y0 - VPSHUFB Y12, Y5, Y10 - VPSHUFB Y13, Y6, Y11 + VPXOR Y10, Y6, Y6 + VPSHUFB Y12, Y2, Y10 + VPSHUFB Y13, Y3, Y11 VPXOR Y10, Y11, Y10 - VPXOR Y10, Y1, Y1 - VPSHUFB Y12, Y7, Y10 - VPSHUFB Y13, Y8, Y11 + VPXOR Y10, Y7, Y7 + VPSHUFB Y12, Y4, Y10 + VPSHUFB Y13, Y5, Y11 VPXOR Y10, Y11, Y10 - VPXOR Y10, Y2, Y2 + VPXOR Y10, Y8, Y8 // Store 3 outputs - VMOVDQU Y0, (BX)(SI*1) - VMOVDQU Y1, (BP)(SI*1) - VMOVDQU Y2, (DX)(SI*1) + VMOVDQU Y6, (BX) + ADDQ $0x20, BX + VMOVDQU Y7, (BP) + ADDQ $0x20, BP + VMOVDQU Y8, (DX) + ADDQ $0x20, DX // Prepare for next loop - ADDQ $0x20, SI DECQ AX JNZ mulAvxTwo_1x3_loop VZEROUPPER @@ -177,23 +207,33 @@ mulAvxTwo_1x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_1x4(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 17 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_1x4_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DX - MOVQ in_base+24(FP), DI - MOVQ (DI), DI + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_1x4_end + MOVQ in_base+24(FP), DX + MOVQ (DX), DX + MOVQ out_base+48(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), BX + MOVQ start+72(FP), R8 + + // Add start offset to output + ADDQ R8, BP + ADDQ R8, SI + ADDQ R8, DI + ADDQ R8, BX + + // Add start offset to input + ADDQ R8, DX MOVQ $0x0000000f, R8 MOVQ R8, X4 VPBROADCASTB X4, Y4 - MOVQ start+72(FP), R8 mulAvxTwo_1x4_loop: // Clear 4 outputs @@ -203,7 +243,8 @@ mulAvxTwo_1x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (DI)(R8*1), Y7 + VMOVDQU (DX), Y7 + ADDQ $0x20, DX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -233,13 +274,16 @@ mulAvxTwo_1x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - VMOVDQU Y0, (BX)(R8*1) - VMOVDQU Y1, (BP)(R8*1) - VMOVDQU Y2, (SI)(R8*1) - VMOVDQU Y3, (DX)(R8*1) + VMOVDQU Y0, (BP) + ADDQ $0x20, BP + VMOVDQU Y1, (SI) + ADDQ $0x20, SI + VMOVDQU Y2, (DI) + ADDQ $0x20, DI + VMOVDQU Y3, (BX) + ADDQ $0x20, BX // Prepare for next loop - ADDQ $0x20, R8 DECQ AX JNZ mulAvxTwo_1x4_loop VZEROUPPER @@ -251,24 +295,35 @@ mulAvxTwo_1x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_1x5(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 20 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_1x5_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), DX - MOVQ in_base+24(FP), R8 - MOVQ (R8), R8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_1x5_end + MOVQ in_base+24(FP), DX + MOVQ (DX), DX + MOVQ out_base+48(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), BX + MOVQ start+72(FP), R9 + + // Add start offset to output + ADDQ R9, BP + ADDQ R9, SI + ADDQ R9, DI + ADDQ R9, R8 + ADDQ R9, BX + + // Add start offset to input + ADDQ R9, DX MOVQ $0x0000000f, R9 MOVQ R9, X5 VPBROADCASTB X5, Y5 - MOVQ start+72(FP), R9 mulAvxTwo_1x5_loop: // Clear 5 outputs @@ -279,7 +334,8 @@ mulAvxTwo_1x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (R8)(R9*1), Y8 + VMOVDQU (DX), Y8 + ADDQ $0x20, DX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -315,14 +371,18 @@ mulAvxTwo_1x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - VMOVDQU Y0, (BX)(R9*1) - VMOVDQU Y1, (BP)(R9*1) - VMOVDQU Y2, (SI)(R9*1) - VMOVDQU Y3, (DI)(R9*1) - VMOVDQU Y4, (DX)(R9*1) + VMOVDQU Y0, (BP) + ADDQ $0x20, BP + VMOVDQU Y1, (SI) + ADDQ $0x20, SI + VMOVDQU Y2, (DI) + ADDQ $0x20, DI + VMOVDQU Y3, (R8) + ADDQ $0x20, R8 + VMOVDQU Y4, (BX) + ADDQ $0x20, BX // Prepare for next loop - ADDQ $0x20, R9 DECQ AX JNZ mulAvxTwo_1x5_loop VZEROUPPER @@ -334,25 +394,37 @@ mulAvxTwo_1x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_1x6(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 23 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_1x6_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), DX - MOVQ in_base+24(FP), R9 - MOVQ (R9), R9 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_1x6_end + MOVQ in_base+24(FP), DX + MOVQ (DX), DX + MOVQ out_base+48(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), BX + MOVQ start+72(FP), R10 + + // Add start offset to output + ADDQ R10, BP + ADDQ R10, SI + ADDQ R10, DI + ADDQ R10, R8 + ADDQ R10, R9 + ADDQ R10, BX + + // Add start offset to input + ADDQ R10, DX MOVQ $0x0000000f, R10 MOVQ R10, X6 VPBROADCASTB X6, Y6 - MOVQ start+72(FP), R10 mulAvxTwo_1x6_loop: // Clear 6 outputs @@ -364,7 +436,8 @@ mulAvxTwo_1x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (R9)(R10*1), Y9 + VMOVDQU (DX), Y9 + ADDQ $0x20, DX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -406,15 +479,20 @@ mulAvxTwo_1x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - VMOVDQU Y0, (BX)(R10*1) - VMOVDQU Y1, (BP)(R10*1) - VMOVDQU Y2, (SI)(R10*1) - VMOVDQU Y3, (DI)(R10*1) - VMOVDQU Y4, (R8)(R10*1) - VMOVDQU Y5, (DX)(R10*1) + VMOVDQU Y0, (BP) + ADDQ $0x20, BP + VMOVDQU Y1, (SI) + ADDQ $0x20, SI + VMOVDQU Y2, (DI) + ADDQ $0x20, DI + VMOVDQU Y3, (R8) + ADDQ $0x20, R8 + VMOVDQU Y4, (R9) + ADDQ $0x20, R9 + VMOVDQU Y5, (BX) + ADDQ $0x20, BX // Prepare for next loop - ADDQ $0x20, R10 DECQ AX JNZ mulAvxTwo_1x6_loop VZEROUPPER @@ -426,26 +504,39 @@ mulAvxTwo_1x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_1x7(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 26 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_1x7_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), DX - MOVQ in_base+24(FP), R10 - MOVQ (R10), R10 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_1x7_end + MOVQ in_base+24(FP), DX + MOVQ (DX), DX + MOVQ out_base+48(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), BX + MOVQ start+72(FP), R11 + + // Add start offset to output + ADDQ R11, BP + ADDQ R11, SI + ADDQ R11, DI + ADDQ R11, R8 + ADDQ R11, R9 + ADDQ R11, R10 + ADDQ R11, BX + + // Add start offset to input + ADDQ R11, DX MOVQ $0x0000000f, R11 MOVQ R11, X7 VPBROADCASTB X7, Y7 - MOVQ start+72(FP), R11 mulAvxTwo_1x7_loop: // Clear 7 outputs @@ -458,7 +549,8 @@ mulAvxTwo_1x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (R10)(R11*1), Y10 + VMOVDQU (DX), Y10 + ADDQ $0x20, DX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -506,16 +598,22 @@ mulAvxTwo_1x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - VMOVDQU Y0, (BX)(R11*1) - VMOVDQU Y1, (BP)(R11*1) - VMOVDQU Y2, (SI)(R11*1) - VMOVDQU Y3, (DI)(R11*1) - VMOVDQU Y4, (R8)(R11*1) - VMOVDQU Y5, (R9)(R11*1) - VMOVDQU Y6, (DX)(R11*1) + VMOVDQU Y0, (BP) + ADDQ $0x20, BP + VMOVDQU Y1, (SI) + ADDQ $0x20, SI + VMOVDQU Y2, (DI) + ADDQ $0x20, DI + VMOVDQU Y3, (R8) + ADDQ $0x20, R8 + VMOVDQU Y4, (R9) + ADDQ $0x20, R9 + VMOVDQU Y5, (R10) + ADDQ $0x20, R10 + VMOVDQU Y6, (BX) + ADDQ $0x20, BX // Prepare for next loop - ADDQ $0x20, R11 DECQ AX JNZ mulAvxTwo_1x7_loop VZEROUPPER @@ -527,27 +625,41 @@ mulAvxTwo_1x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_1x8(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 29 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_1x8_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), DX - MOVQ in_base+24(FP), R11 - MOVQ (R11), R11 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_1x8_end + MOVQ in_base+24(FP), DX + MOVQ (DX), DX + MOVQ out_base+48(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), BX + MOVQ start+72(FP), R12 + + // Add start offset to output + ADDQ R12, BP + ADDQ R12, SI + ADDQ R12, DI + ADDQ R12, R8 + ADDQ R12, R9 + ADDQ R12, R10 + ADDQ R12, R11 + ADDQ R12, BX + + // Add start offset to input + ADDQ R12, DX MOVQ $0x0000000f, R12 MOVQ R12, X8 VPBROADCASTB X8, Y8 - MOVQ start+72(FP), R12 mulAvxTwo_1x8_loop: // Clear 8 outputs @@ -561,7 +673,8 @@ mulAvxTwo_1x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (R11)(R12*1), Y11 + VMOVDQU (DX), Y11 + ADDQ $0x20, DX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -615,17 +728,24 @@ mulAvxTwo_1x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - VMOVDQU Y0, (BX)(R12*1) - VMOVDQU Y1, (BP)(R12*1) - VMOVDQU Y2, (SI)(R12*1) - VMOVDQU Y3, (DI)(R12*1) - VMOVDQU Y4, (R8)(R12*1) - VMOVDQU Y5, (R9)(R12*1) - VMOVDQU Y6, (R10)(R12*1) - VMOVDQU Y7, (DX)(R12*1) + VMOVDQU Y0, (BP) + ADDQ $0x20, BP + VMOVDQU Y1, (SI) + ADDQ $0x20, SI + VMOVDQU Y2, (DI) + ADDQ $0x20, DI + VMOVDQU Y3, (R8) + ADDQ $0x20, R8 + VMOVDQU Y4, (R9) + ADDQ $0x20, R9 + VMOVDQU Y5, (R10) + ADDQ $0x20, R10 + VMOVDQU Y6, (R11) + ADDQ $0x20, R11 + VMOVDQU Y7, (BX) + ADDQ $0x20, BX // Prepare for next loop - ADDQ $0x20, R12 DECQ AX JNZ mulAvxTwo_1x8_loop VZEROUPPER @@ -637,55 +757,65 @@ mulAvxTwo_1x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_2x1(SB), $0-88 // Loading all tables to registers + // Destination kept in GP registers // Full registers estimated 8 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_2x1_end - MOVQ out_base+48(FP), DX - MOVQ (DX), DX - VMOVDQU (CX), Y1 - VMOVDQU 32(CX), Y2 - VMOVDQU 64(CX), Y3 - VMOVDQU 96(CX), Y4 - MOVQ in_base+24(FP), CX - MOVQ (CX), BX - MOVQ 24(CX), CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_2x1_end + VMOVDQU (CX), Y0 + VMOVDQU 32(CX), Y1 + VMOVDQU 64(CX), Y2 + VMOVDQU 96(CX), Y3 + MOVQ in_base+24(FP), CX + MOVQ (CX), DX + MOVQ 24(CX), CX + MOVQ out_base+48(FP), BX + MOVQ (BX), BX + MOVQ start+72(FP), BP + + // Add start offset to output + ADDQ BP, BX + + // Add start offset to input + ADDQ BP, DX + ADDQ BP, CX MOVQ $0x0000000f, BP MOVQ BP, X5 VPBROADCASTB X5, Y5 - MOVQ start+72(FP), BP mulAvxTwo_2x1_loop: // Clear 1 outputs - VPXOR Y0, Y0, Y0 + VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (BX)(BP*1), Y6 + VMOVDQU (DX), Y6 + ADDQ $0x20, DX VPSRLQ $0x04, Y6, Y7 VPAND Y5, Y6, Y6 VPAND Y5, Y7, Y7 - VPSHUFB Y6, Y1, Y6 - VPSHUFB Y7, Y2, Y7 + VPSHUFB Y6, Y0, Y6 + VPSHUFB Y7, Y1, Y7 VPXOR Y6, Y7, Y6 - VPXOR Y6, Y0, Y0 + VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (CX)(BP*1), Y6 + VMOVDQU (CX), Y6 + ADDQ $0x20, CX VPSRLQ $0x04, Y6, Y7 VPAND Y5, Y6, Y6 VPAND Y5, Y7, Y7 - VPSHUFB Y6, Y3, Y6 - VPSHUFB Y7, Y4, Y7 + VPSHUFB Y6, Y2, Y6 + VPSHUFB Y7, Y3, Y7 VPXOR Y6, Y7, Y6 - VPXOR Y6, Y0, Y0 + VPXOR Y6, Y4, Y4 // Store 1 outputs - VMOVDQU Y0, (DX)(BP*1) + VMOVDQU Y4, (BX) + ADDQ $0x20, BX // Prepare for next loop - ADDQ $0x20, BP DECQ AX JNZ mulAvxTwo_2x1_loop VZEROUPPER @@ -697,70 +827,82 @@ mulAvxTwo_2x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_2x2(SB), $0-88 // Loading all tables to registers + // Destination kept in GP registers // Full registers estimated 15 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_2x2_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), DX - VMOVDQU (CX), Y2 - VMOVDQU 32(CX), Y3 - VMOVDQU 64(CX), Y4 - VMOVDQU 96(CX), Y5 - VMOVDQU 128(CX), Y6 - VMOVDQU 160(CX), Y7 - VMOVDQU 192(CX), Y8 - VMOVDQU 224(CX), Y9 - MOVQ in_base+24(FP), CX - MOVQ (CX), BP - MOVQ 24(CX), CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_2x2_end + VMOVDQU (CX), Y0 + VMOVDQU 32(CX), Y1 + VMOVDQU 64(CX), Y2 + VMOVDQU 96(CX), Y3 + VMOVDQU 128(CX), Y4 + VMOVDQU 160(CX), Y5 + VMOVDQU 192(CX), Y6 + VMOVDQU 224(CX), Y7 + MOVQ in_base+24(FP), CX + MOVQ (CX), DX + MOVQ 24(CX), CX + MOVQ out_base+48(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), BX + MOVQ start+72(FP), SI + + // Add start offset to output + ADDQ SI, BP + ADDQ SI, BX + + // Add start offset to input + ADDQ SI, DX + ADDQ SI, CX MOVQ $0x0000000f, SI MOVQ SI, X10 VPBROADCASTB X10, Y10 - MOVQ start+72(FP), SI mulAvxTwo_2x2_loop: // Clear 2 outputs - VPXOR Y0, Y0, Y0 - VPXOR Y1, Y1, Y1 + VPXOR Y8, Y8, Y8 + VPXOR Y9, Y9, Y9 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (BP)(SI*1), Y13 + VMOVDQU (DX), Y13 + ADDQ $0x20, DX VPSRLQ $0x04, Y13, Y14 VPAND Y10, Y13, Y13 VPAND Y10, Y14, Y14 + VPSHUFB Y13, Y0, Y11 + VPSHUFB Y14, Y1, Y12 + VPXOR Y11, Y12, Y11 + VPXOR Y11, Y8, Y8 VPSHUFB Y13, Y2, Y11 VPSHUFB Y14, Y3, Y12 VPXOR Y11, Y12, Y11 - VPXOR Y11, Y0, Y0 - VPSHUFB Y13, Y4, Y11 - VPSHUFB Y14, Y5, Y12 - VPXOR Y11, Y12, Y11 - VPXOR Y11, Y1, Y1 + VPXOR Y11, Y9, Y9 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (CX)(SI*1), Y13 + VMOVDQU (CX), Y13 + ADDQ $0x20, CX VPSRLQ $0x04, Y13, Y14 VPAND Y10, Y13, Y13 VPAND Y10, Y14, Y14 + VPSHUFB Y13, Y4, Y11 + VPSHUFB Y14, Y5, Y12 + VPXOR Y11, Y12, Y11 + VPXOR Y11, Y8, Y8 VPSHUFB Y13, Y6, Y11 VPSHUFB Y14, Y7, Y12 VPXOR Y11, Y12, Y11 - VPXOR Y11, Y0, Y0 - VPSHUFB Y13, Y8, Y11 - VPSHUFB Y14, Y9, Y12 - VPXOR Y11, Y12, Y11 - VPXOR Y11, Y1, Y1 + VPXOR Y11, Y9, Y9 // Store 2 outputs - VMOVDQU Y0, (BX)(SI*1) - VMOVDQU Y1, (DX)(SI*1) + VMOVDQU Y8, (BP) + ADDQ $0x20, BP + VMOVDQU Y9, (BX) + ADDQ $0x20, BX // Prepare for next loop - ADDQ $0x20, SI DECQ AX JNZ mulAvxTwo_2x2_loop VZEROUPPER @@ -772,23 +914,33 @@ mulAvxTwo_2x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_2x3(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 20 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_2x3_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), DX - MOVQ in_base+24(FP), SI - MOVQ (SI), DI - MOVQ 24(SI), SI + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_2x3_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), DX + MOVQ out_base+48(FP), BP + MOVQ (BP), SI + MOVQ 24(BP), DI + MOVQ 48(BP), BP + MOVQ start+72(FP), R8 + + // Add start offset to output + ADDQ R8, SI + ADDQ R8, DI + ADDQ R8, BP + + // Add start offset to input + ADDQ R8, BX + ADDQ R8, DX MOVQ $0x0000000f, R8 MOVQ R8, X3 VPBROADCASTB X3, Y3 - MOVQ start+72(FP), R8 mulAvxTwo_2x3_loop: // Clear 3 outputs @@ -797,7 +949,8 @@ mulAvxTwo_2x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (DI)(R8*1), Y6 + VMOVDQU (BX), Y6 + ADDQ $0x20, BX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -821,7 +974,8 @@ mulAvxTwo_2x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (SI)(R8*1), Y6 + VMOVDQU (DX), Y6 + ADDQ $0x20, DX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -845,12 +999,14 @@ mulAvxTwo_2x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - VMOVDQU Y0, (BX)(R8*1) - VMOVDQU Y1, (BP)(R8*1) - VMOVDQU Y2, (DX)(R8*1) + VMOVDQU Y0, (SI) + ADDQ $0x20, SI + VMOVDQU Y1, (DI) + ADDQ $0x20, DI + VMOVDQU Y2, (BP) + ADDQ $0x20, BP // Prepare for next loop - ADDQ $0x20, R8 DECQ AX JNZ mulAvxTwo_2x3_loop VZEROUPPER @@ -862,24 +1018,35 @@ mulAvxTwo_2x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_2x4(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 25 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_2x4_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DX - MOVQ in_base+24(FP), DI - MOVQ (DI), R8 - MOVQ 24(DI), DI + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_2x4_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), DX + MOVQ out_base+48(FP), BP + MOVQ (BP), SI + MOVQ 24(BP), DI + MOVQ 48(BP), R8 + MOVQ 72(BP), BP + MOVQ start+72(FP), R9 + + // Add start offset to output + ADDQ R9, SI + ADDQ R9, DI + ADDQ R9, R8 + ADDQ R9, BP + + // Add start offset to input + ADDQ R9, BX + ADDQ R9, DX MOVQ $0x0000000f, R9 MOVQ R9, X4 VPBROADCASTB X4, Y4 - MOVQ start+72(FP), R9 mulAvxTwo_2x4_loop: // Clear 4 outputs @@ -889,7 +1056,8 @@ mulAvxTwo_2x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (R8)(R9*1), Y7 + VMOVDQU (BX), Y7 + ADDQ $0x20, BX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -919,7 +1087,8 @@ mulAvxTwo_2x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (DI)(R9*1), Y7 + VMOVDQU (DX), Y7 + ADDQ $0x20, DX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -949,13 +1118,16 @@ mulAvxTwo_2x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - VMOVDQU Y0, (BX)(R9*1) - VMOVDQU Y1, (BP)(R9*1) - VMOVDQU Y2, (SI)(R9*1) - VMOVDQU Y3, (DX)(R9*1) + VMOVDQU Y0, (SI) + ADDQ $0x20, SI + VMOVDQU Y1, (DI) + ADDQ $0x20, DI + VMOVDQU Y2, (R8) + ADDQ $0x20, R8 + VMOVDQU Y3, (BP) + ADDQ $0x20, BP // Prepare for next loop - ADDQ $0x20, R9 DECQ AX JNZ mulAvxTwo_2x4_loop VZEROUPPER @@ -967,25 +1139,37 @@ mulAvxTwo_2x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_2x5(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 30 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_2x5_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), DX - MOVQ in_base+24(FP), R8 - MOVQ (R8), R9 - MOVQ 24(R8), R8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_2x5_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), DX + MOVQ out_base+48(FP), BP + MOVQ (BP), SI + MOVQ 24(BP), DI + MOVQ 48(BP), R8 + MOVQ 72(BP), R9 + MOVQ 96(BP), BP + MOVQ start+72(FP), R10 + + // Add start offset to output + ADDQ R10, SI + ADDQ R10, DI + ADDQ R10, R8 + ADDQ R10, R9 + ADDQ R10, BP + + // Add start offset to input + ADDQ R10, BX + ADDQ R10, DX MOVQ $0x0000000f, R10 MOVQ R10, X5 VPBROADCASTB X5, Y5 - MOVQ start+72(FP), R10 mulAvxTwo_2x5_loop: // Clear 5 outputs @@ -996,7 +1180,8 @@ mulAvxTwo_2x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (R9)(R10*1), Y8 + VMOVDQU (BX), Y8 + ADDQ $0x20, BX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -1032,7 +1217,8 @@ mulAvxTwo_2x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (R8)(R10*1), Y8 + VMOVDQU (DX), Y8 + ADDQ $0x20, DX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -1068,14 +1254,18 @@ mulAvxTwo_2x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - VMOVDQU Y0, (BX)(R10*1) - VMOVDQU Y1, (BP)(R10*1) - VMOVDQU Y2, (SI)(R10*1) - VMOVDQU Y3, (DI)(R10*1) - VMOVDQU Y4, (DX)(R10*1) + VMOVDQU Y0, (SI) + ADDQ $0x20, SI + VMOVDQU Y1, (DI) + ADDQ $0x20, DI + VMOVDQU Y2, (R8) + ADDQ $0x20, R8 + VMOVDQU Y3, (R9) + ADDQ $0x20, R9 + VMOVDQU Y4, (BP) + ADDQ $0x20, BP // Prepare for next loop - ADDQ $0x20, R10 DECQ AX JNZ mulAvxTwo_2x5_loop VZEROUPPER @@ -1087,26 +1277,39 @@ mulAvxTwo_2x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_2x6(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 35 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_2x6_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), DX - MOVQ in_base+24(FP), R9 - MOVQ (R9), R10 - MOVQ 24(R9), R9 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_2x6_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), DX + MOVQ out_base+48(FP), BP + MOVQ (BP), SI + MOVQ 24(BP), DI + MOVQ 48(BP), R8 + MOVQ 72(BP), R9 + MOVQ 96(BP), R10 + MOVQ 120(BP), BP + MOVQ start+72(FP), R11 + + // Add start offset to output + ADDQ R11, SI + ADDQ R11, DI + ADDQ R11, R8 + ADDQ R11, R9 + ADDQ R11, R10 + ADDQ R11, BP + + // Add start offset to input + ADDQ R11, BX + ADDQ R11, DX MOVQ $0x0000000f, R11 MOVQ R11, X6 VPBROADCASTB X6, Y6 - MOVQ start+72(FP), R11 mulAvxTwo_2x6_loop: // Clear 6 outputs @@ -1118,7 +1321,8 @@ mulAvxTwo_2x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (R10)(R11*1), Y9 + VMOVDQU (BX), Y9 + ADDQ $0x20, BX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -1160,7 +1364,8 @@ mulAvxTwo_2x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (R9)(R11*1), Y9 + VMOVDQU (DX), Y9 + ADDQ $0x20, DX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -1202,15 +1407,20 @@ mulAvxTwo_2x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - VMOVDQU Y0, (BX)(R11*1) - VMOVDQU Y1, (BP)(R11*1) - VMOVDQU Y2, (SI)(R11*1) - VMOVDQU Y3, (DI)(R11*1) - VMOVDQU Y4, (R8)(R11*1) - VMOVDQU Y5, (DX)(R11*1) + VMOVDQU Y0, (SI) + ADDQ $0x20, SI + VMOVDQU Y1, (DI) + ADDQ $0x20, DI + VMOVDQU Y2, (R8) + ADDQ $0x20, R8 + VMOVDQU Y3, (R9) + ADDQ $0x20, R9 + VMOVDQU Y4, (R10) + ADDQ $0x20, R10 + VMOVDQU Y5, (BP) + ADDQ $0x20, BP // Prepare for next loop - ADDQ $0x20, R11 DECQ AX JNZ mulAvxTwo_2x6_loop VZEROUPPER @@ -1222,27 +1432,41 @@ mulAvxTwo_2x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_2x7(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 40 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_2x7_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), DX - MOVQ in_base+24(FP), R10 - MOVQ (R10), R11 - MOVQ 24(R10), R10 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_2x7_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), DX + MOVQ out_base+48(FP), BP + MOVQ (BP), SI + MOVQ 24(BP), DI + MOVQ 48(BP), R8 + MOVQ 72(BP), R9 + MOVQ 96(BP), R10 + MOVQ 120(BP), R11 + MOVQ 144(BP), BP + MOVQ start+72(FP), R12 + + // Add start offset to output + ADDQ R12, SI + ADDQ R12, DI + ADDQ R12, R8 + ADDQ R12, R9 + ADDQ R12, R10 + ADDQ R12, R11 + ADDQ R12, BP + + // Add start offset to input + ADDQ R12, BX + ADDQ R12, DX MOVQ $0x0000000f, R12 MOVQ R12, X7 VPBROADCASTB X7, Y7 - MOVQ start+72(FP), R12 mulAvxTwo_2x7_loop: // Clear 7 outputs @@ -1255,7 +1479,8 @@ mulAvxTwo_2x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (R11)(R12*1), Y10 + VMOVDQU (BX), Y10 + ADDQ $0x20, BX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -1303,7 +1528,8 @@ mulAvxTwo_2x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (R10)(R12*1), Y10 + VMOVDQU (DX), Y10 + ADDQ $0x20, DX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -1351,16 +1577,22 @@ mulAvxTwo_2x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - VMOVDQU Y0, (BX)(R12*1) - VMOVDQU Y1, (BP)(R12*1) - VMOVDQU Y2, (SI)(R12*1) - VMOVDQU Y3, (DI)(R12*1) - VMOVDQU Y4, (R8)(R12*1) - VMOVDQU Y5, (R9)(R12*1) - VMOVDQU Y6, (DX)(R12*1) + VMOVDQU Y0, (SI) + ADDQ $0x20, SI + VMOVDQU Y1, (DI) + ADDQ $0x20, DI + VMOVDQU Y2, (R8) + ADDQ $0x20, R8 + VMOVDQU Y3, (R9) + ADDQ $0x20, R9 + VMOVDQU Y4, (R10) + ADDQ $0x20, R10 + VMOVDQU Y5, (R11) + ADDQ $0x20, R11 + VMOVDQU Y6, (BP) + ADDQ $0x20, BP // Prepare for next loop - ADDQ $0x20, R12 DECQ AX JNZ mulAvxTwo_2x7_loop VZEROUPPER @@ -1372,28 +1604,43 @@ mulAvxTwo_2x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_2x8(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 45 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_2x8_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), DX - MOVQ in_base+24(FP), R11 - MOVQ (R11), R12 - MOVQ 24(R11), R11 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_2x8_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), DX + MOVQ out_base+48(FP), BP + MOVQ (BP), SI + MOVQ 24(BP), DI + MOVQ 48(BP), R8 + MOVQ 72(BP), R9 + MOVQ 96(BP), R10 + MOVQ 120(BP), R11 + MOVQ 144(BP), R12 + MOVQ 168(BP), BP + MOVQ start+72(FP), R13 + + // Add start offset to output + ADDQ R13, SI + ADDQ R13, DI + ADDQ R13, R8 + ADDQ R13, R9 + ADDQ R13, R10 + ADDQ R13, R11 + ADDQ R13, R12 + ADDQ R13, BP + + // Add start offset to input + ADDQ R13, BX + ADDQ R13, DX MOVQ $0x0000000f, R13 MOVQ R13, X8 VPBROADCASTB X8, Y8 - MOVQ start+72(FP), R13 mulAvxTwo_2x8_loop: // Clear 8 outputs @@ -1407,7 +1654,8 @@ mulAvxTwo_2x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (R12)(R13*1), Y11 + VMOVDQU (BX), Y11 + ADDQ $0x20, BX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -1461,7 +1709,8 @@ mulAvxTwo_2x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (R11)(R13*1), Y11 + VMOVDQU (DX), Y11 + ADDQ $0x20, DX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -1515,17 +1764,24 @@ mulAvxTwo_2x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - VMOVDQU Y0, (BX)(R13*1) - VMOVDQU Y1, (BP)(R13*1) - VMOVDQU Y2, (SI)(R13*1) - VMOVDQU Y3, (DI)(R13*1) - VMOVDQU Y4, (R8)(R13*1) - VMOVDQU Y5, (R9)(R13*1) - VMOVDQU Y6, (R10)(R13*1) - VMOVDQU Y7, (DX)(R13*1) + VMOVDQU Y0, (SI) + ADDQ $0x20, SI + VMOVDQU Y1, (DI) + ADDQ $0x20, DI + VMOVDQU Y2, (R8) + ADDQ $0x20, R8 + VMOVDQU Y3, (R9) + ADDQ $0x20, R9 + VMOVDQU Y4, (R10) + ADDQ $0x20, R10 + VMOVDQU Y5, (R11) + ADDQ $0x20, R11 + VMOVDQU Y6, (R12) + ADDQ $0x20, R12 + VMOVDQU Y7, (BP) + ADDQ $0x20, BP // Prepare for next loop - ADDQ $0x20, R13 DECQ AX JNZ mulAvxTwo_2x8_loop VZEROUPPER @@ -1537,68 +1793,80 @@ mulAvxTwo_2x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_3x1(SB), $0-88 // Loading all tables to registers + // Destination kept in GP registers // Full registers estimated 10 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_3x1_end - MOVQ out_base+48(FP), DX - MOVQ (DX), DX - VMOVDQU (CX), Y1 - VMOVDQU 32(CX), Y2 - VMOVDQU 64(CX), Y3 - VMOVDQU 96(CX), Y4 - VMOVDQU 128(CX), Y5 - VMOVDQU 160(CX), Y6 - MOVQ in_base+24(FP), CX - MOVQ (CX), BX - MOVQ 24(CX), BP - MOVQ 48(CX), CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_3x1_end + VMOVDQU (CX), Y0 + VMOVDQU 32(CX), Y1 + VMOVDQU 64(CX), Y2 + VMOVDQU 96(CX), Y3 + VMOVDQU 128(CX), Y4 + VMOVDQU 160(CX), Y5 + MOVQ in_base+24(FP), CX + MOVQ (CX), DX + MOVQ 24(CX), BX + MOVQ 48(CX), CX + MOVQ out_base+48(FP), BP + MOVQ (BP), BP + MOVQ start+72(FP), SI + + // Add start offset to output + ADDQ SI, BP + + // Add start offset to input + ADDQ SI, DX + ADDQ SI, BX + ADDQ SI, CX MOVQ $0x0000000f, SI MOVQ SI, X7 VPBROADCASTB X7, Y7 - MOVQ start+72(FP), SI mulAvxTwo_3x1_loop: // Clear 1 outputs - VPXOR Y0, Y0, Y0 + VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (BX)(SI*1), Y8 + VMOVDQU (DX), Y8 + ADDQ $0x20, DX VPSRLQ $0x04, Y8, Y9 VPAND Y7, Y8, Y8 VPAND Y7, Y9, Y9 - VPSHUFB Y8, Y1, Y8 - VPSHUFB Y9, Y2, Y9 + VPSHUFB Y8, Y0, Y8 + VPSHUFB Y9, Y1, Y9 VPXOR Y8, Y9, Y8 - VPXOR Y8, Y0, Y0 + VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (BP)(SI*1), Y8 + VMOVDQU (BX), Y8 + ADDQ $0x20, BX VPSRLQ $0x04, Y8, Y9 VPAND Y7, Y8, Y8 VPAND Y7, Y9, Y9 - VPSHUFB Y8, Y3, Y8 - VPSHUFB Y9, Y4, Y9 + VPSHUFB Y8, Y2, Y8 + VPSHUFB Y9, Y3, Y9 VPXOR Y8, Y9, Y8 - VPXOR Y8, Y0, Y0 + VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 2 to 1 outputs - VMOVDQU (CX)(SI*1), Y8 + VMOVDQU (CX), Y8 + ADDQ $0x20, CX VPSRLQ $0x04, Y8, Y9 VPAND Y7, Y8, Y8 VPAND Y7, Y9, Y9 - VPSHUFB Y8, Y5, Y8 - VPSHUFB Y9, Y6, Y9 + VPSHUFB Y8, Y4, Y8 + VPSHUFB Y9, Y5, Y9 VPXOR Y8, Y9, Y8 - VPXOR Y8, Y0, Y0 + VPXOR Y8, Y6, Y6 // Store 1 outputs - VMOVDQU Y0, (DX)(SI*1) + VMOVDQU Y6, (BP) + ADDQ $0x20, BP // Prepare for next loop - ADDQ $0x20, SI DECQ AX JNZ mulAvxTwo_3x1_loop VZEROUPPER @@ -1610,23 +1878,33 @@ mulAvxTwo_3x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_3x2(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 19 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_3x2_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), DX - MOVQ in_base+24(FP), BP - MOVQ (BP), SI - MOVQ 24(BP), DI - MOVQ 48(BP), BP + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_3x2_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), DX + MOVQ out_base+48(FP), SI + MOVQ (SI), DI + MOVQ 24(SI), SI + MOVQ start+72(FP), R8 + + // Add start offset to output + ADDQ R8, DI + ADDQ R8, SI + + // Add start offset to input + ADDQ R8, BX + ADDQ R8, BP + ADDQ R8, DX MOVQ $0x0000000f, R8 MOVQ R8, X2 VPBROADCASTB X2, Y2 - MOVQ start+72(FP), R8 mulAvxTwo_3x2_loop: // Clear 2 outputs @@ -1634,7 +1912,8 @@ mulAvxTwo_3x2_loop: VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (SI)(R8*1), Y5 + VMOVDQU (BX), Y5 + ADDQ $0x20, BX VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -1652,7 +1931,8 @@ mulAvxTwo_3x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (DI)(R8*1), Y5 + VMOVDQU (BP), Y5 + ADDQ $0x20, BP VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -1670,7 +1950,8 @@ mulAvxTwo_3x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 2 to 2 outputs - VMOVDQU (BP)(R8*1), Y5 + VMOVDQU (DX), Y5 + ADDQ $0x20, DX VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -1688,11 +1969,12 @@ mulAvxTwo_3x2_loop: VPXOR Y3, Y1, Y1 // Store 2 outputs - VMOVDQU Y0, (BX)(R8*1) - VMOVDQU Y1, (DX)(R8*1) + VMOVDQU Y0, (DI) + ADDQ $0x20, DI + VMOVDQU Y1, (SI) + ADDQ $0x20, SI // Prepare for next loop - ADDQ $0x20, R8 DECQ AX JNZ mulAvxTwo_3x2_loop VZEROUPPER @@ -1704,24 +1986,35 @@ mulAvxTwo_3x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_3x3(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 26 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_3x3_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), DX - MOVQ in_base+24(FP), SI - MOVQ (SI), DI - MOVQ 24(SI), R8 - MOVQ 48(SI), SI + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_3x3_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), DX + MOVQ out_base+48(FP), SI + MOVQ (SI), DI + MOVQ 24(SI), R8 + MOVQ 48(SI), SI + MOVQ start+72(FP), R9 + + // Add start offset to output + ADDQ R9, DI + ADDQ R9, R8 + ADDQ R9, SI + + // Add start offset to input + ADDQ R9, BX + ADDQ R9, BP + ADDQ R9, DX MOVQ $0x0000000f, R9 MOVQ R9, X3 VPBROADCASTB X3, Y3 - MOVQ start+72(FP), R9 mulAvxTwo_3x3_loop: // Clear 3 outputs @@ -1730,7 +2023,8 @@ mulAvxTwo_3x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (DI)(R9*1), Y6 + VMOVDQU (BX), Y6 + ADDQ $0x20, BX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -1754,7 +2048,8 @@ mulAvxTwo_3x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (R8)(R9*1), Y6 + VMOVDQU (BP), Y6 + ADDQ $0x20, BP VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -1778,7 +2073,8 @@ mulAvxTwo_3x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 2 to 3 outputs - VMOVDQU (SI)(R9*1), Y6 + VMOVDQU (DX), Y6 + ADDQ $0x20, DX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -1802,12 +2098,14 @@ mulAvxTwo_3x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - VMOVDQU Y0, (BX)(R9*1) - VMOVDQU Y1, (BP)(R9*1) - VMOVDQU Y2, (DX)(R9*1) + VMOVDQU Y0, (DI) + ADDQ $0x20, DI + VMOVDQU Y1, (R8) + ADDQ $0x20, R8 + VMOVDQU Y2, (SI) + ADDQ $0x20, SI // Prepare for next loop - ADDQ $0x20, R9 DECQ AX JNZ mulAvxTwo_3x3_loop VZEROUPPER @@ -1819,25 +2117,37 @@ mulAvxTwo_3x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_3x4(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 33 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_3x4_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DX - MOVQ in_base+24(FP), DI - MOVQ (DI), R8 - MOVQ 24(DI), R9 - MOVQ 48(DI), DI + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_3x4_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), DX + MOVQ out_base+48(FP), SI + MOVQ (SI), DI + MOVQ 24(SI), R8 + MOVQ 48(SI), R9 + MOVQ 72(SI), SI + MOVQ start+72(FP), R10 + + // Add start offset to output + ADDQ R10, DI + ADDQ R10, R8 + ADDQ R10, R9 + ADDQ R10, SI + + // Add start offset to input + ADDQ R10, BX + ADDQ R10, BP + ADDQ R10, DX MOVQ $0x0000000f, R10 MOVQ R10, X4 VPBROADCASTB X4, Y4 - MOVQ start+72(FP), R10 mulAvxTwo_3x4_loop: // Clear 4 outputs @@ -1847,7 +2157,8 @@ mulAvxTwo_3x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (R8)(R10*1), Y7 + VMOVDQU (BX), Y7 + ADDQ $0x20, BX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -1877,7 +2188,8 @@ mulAvxTwo_3x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (R9)(R10*1), Y7 + VMOVDQU (BP), Y7 + ADDQ $0x20, BP VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -1907,7 +2219,8 @@ mulAvxTwo_3x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 2 to 4 outputs - VMOVDQU (DI)(R10*1), Y7 + VMOVDQU (DX), Y7 + ADDQ $0x20, DX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -1937,13 +2250,16 @@ mulAvxTwo_3x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - VMOVDQU Y0, (BX)(R10*1) - VMOVDQU Y1, (BP)(R10*1) - VMOVDQU Y2, (SI)(R10*1) - VMOVDQU Y3, (DX)(R10*1) + VMOVDQU Y0, (DI) + ADDQ $0x20, DI + VMOVDQU Y1, (R8) + ADDQ $0x20, R8 + VMOVDQU Y2, (R9) + ADDQ $0x20, R9 + VMOVDQU Y3, (SI) + ADDQ $0x20, SI // Prepare for next loop - ADDQ $0x20, R10 DECQ AX JNZ mulAvxTwo_3x4_loop VZEROUPPER @@ -1955,26 +2271,39 @@ mulAvxTwo_3x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_3x5(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 40 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_3x5_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), DX - MOVQ in_base+24(FP), R8 - MOVQ (R8), R9 - MOVQ 24(R8), R10 - MOVQ 48(R8), R8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_3x5_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), DX + MOVQ out_base+48(FP), SI + MOVQ (SI), DI + MOVQ 24(SI), R8 + MOVQ 48(SI), R9 + MOVQ 72(SI), R10 + MOVQ 96(SI), SI + MOVQ start+72(FP), R11 + + // Add start offset to output + ADDQ R11, DI + ADDQ R11, R8 + ADDQ R11, R9 + ADDQ R11, R10 + ADDQ R11, SI + + // Add start offset to input + ADDQ R11, BX + ADDQ R11, BP + ADDQ R11, DX MOVQ $0x0000000f, R11 MOVQ R11, X5 VPBROADCASTB X5, Y5 - MOVQ start+72(FP), R11 mulAvxTwo_3x5_loop: // Clear 5 outputs @@ -1985,7 +2314,8 @@ mulAvxTwo_3x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (R9)(R11*1), Y8 + VMOVDQU (BX), Y8 + ADDQ $0x20, BX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -2021,7 +2351,8 @@ mulAvxTwo_3x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (R10)(R11*1), Y8 + VMOVDQU (BP), Y8 + ADDQ $0x20, BP VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -2057,7 +2388,8 @@ mulAvxTwo_3x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 2 to 5 outputs - VMOVDQU (R8)(R11*1), Y8 + VMOVDQU (DX), Y8 + ADDQ $0x20, DX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -2093,14 +2425,18 @@ mulAvxTwo_3x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - VMOVDQU Y0, (BX)(R11*1) - VMOVDQU Y1, (BP)(R11*1) - VMOVDQU Y2, (SI)(R11*1) - VMOVDQU Y3, (DI)(R11*1) - VMOVDQU Y4, (DX)(R11*1) + VMOVDQU Y0, (DI) + ADDQ $0x20, DI + VMOVDQU Y1, (R8) + ADDQ $0x20, R8 + VMOVDQU Y2, (R9) + ADDQ $0x20, R9 + VMOVDQU Y3, (R10) + ADDQ $0x20, R10 + VMOVDQU Y4, (SI) + ADDQ $0x20, SI // Prepare for next loop - ADDQ $0x20, R11 DECQ AX JNZ mulAvxTwo_3x5_loop VZEROUPPER @@ -2112,27 +2448,41 @@ mulAvxTwo_3x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_3x6(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 47 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_3x6_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), DX - MOVQ in_base+24(FP), R9 - MOVQ (R9), R10 - MOVQ 24(R9), R11 - MOVQ 48(R9), R9 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_3x6_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), DX + MOVQ out_base+48(FP), SI + MOVQ (SI), DI + MOVQ 24(SI), R8 + MOVQ 48(SI), R9 + MOVQ 72(SI), R10 + MOVQ 96(SI), R11 + MOVQ 120(SI), SI + MOVQ start+72(FP), R12 + + // Add start offset to output + ADDQ R12, DI + ADDQ R12, R8 + ADDQ R12, R9 + ADDQ R12, R10 + ADDQ R12, R11 + ADDQ R12, SI + + // Add start offset to input + ADDQ R12, BX + ADDQ R12, BP + ADDQ R12, DX MOVQ $0x0000000f, R12 MOVQ R12, X6 VPBROADCASTB X6, Y6 - MOVQ start+72(FP), R12 mulAvxTwo_3x6_loop: // Clear 6 outputs @@ -2144,7 +2494,8 @@ mulAvxTwo_3x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (R10)(R12*1), Y9 + VMOVDQU (BX), Y9 + ADDQ $0x20, BX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -2186,7 +2537,8 @@ mulAvxTwo_3x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (R11)(R12*1), Y9 + VMOVDQU (BP), Y9 + ADDQ $0x20, BP VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -2228,7 +2580,8 @@ mulAvxTwo_3x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 2 to 6 outputs - VMOVDQU (R9)(R12*1), Y9 + VMOVDQU (DX), Y9 + ADDQ $0x20, DX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -2270,15 +2623,20 @@ mulAvxTwo_3x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - VMOVDQU Y0, (BX)(R12*1) - VMOVDQU Y1, (BP)(R12*1) - VMOVDQU Y2, (SI)(R12*1) - VMOVDQU Y3, (DI)(R12*1) - VMOVDQU Y4, (R8)(R12*1) - VMOVDQU Y5, (DX)(R12*1) + VMOVDQU Y0, (DI) + ADDQ $0x20, DI + VMOVDQU Y1, (R8) + ADDQ $0x20, R8 + VMOVDQU Y2, (R9) + ADDQ $0x20, R9 + VMOVDQU Y3, (R10) + ADDQ $0x20, R10 + VMOVDQU Y4, (R11) + ADDQ $0x20, R11 + VMOVDQU Y5, (SI) + ADDQ $0x20, SI // Prepare for next loop - ADDQ $0x20, R12 DECQ AX JNZ mulAvxTwo_3x6_loop VZEROUPPER @@ -2290,28 +2648,43 @@ mulAvxTwo_3x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_3x7(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 54 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_3x7_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), DX - MOVQ in_base+24(FP), R10 - MOVQ (R10), R11 - MOVQ 24(R10), R12 - MOVQ 48(R10), R10 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_3x7_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), DX + MOVQ out_base+48(FP), SI + MOVQ (SI), DI + MOVQ 24(SI), R8 + MOVQ 48(SI), R9 + MOVQ 72(SI), R10 + MOVQ 96(SI), R11 + MOVQ 120(SI), R12 + MOVQ 144(SI), SI + MOVQ start+72(FP), R13 + + // Add start offset to output + ADDQ R13, DI + ADDQ R13, R8 + ADDQ R13, R9 + ADDQ R13, R10 + ADDQ R13, R11 + ADDQ R13, R12 + ADDQ R13, SI + + // Add start offset to input + ADDQ R13, BX + ADDQ R13, BP + ADDQ R13, DX MOVQ $0x0000000f, R13 MOVQ R13, X7 VPBROADCASTB X7, Y7 - MOVQ start+72(FP), R13 mulAvxTwo_3x7_loop: // Clear 7 outputs @@ -2324,7 +2697,8 @@ mulAvxTwo_3x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (R11)(R13*1), Y10 + VMOVDQU (BX), Y10 + ADDQ $0x20, BX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -2372,7 +2746,8 @@ mulAvxTwo_3x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (R12)(R13*1), Y10 + VMOVDQU (BP), Y10 + ADDQ $0x20, BP VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -2420,7 +2795,8 @@ mulAvxTwo_3x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 2 to 7 outputs - VMOVDQU (R10)(R13*1), Y10 + VMOVDQU (DX), Y10 + ADDQ $0x20, DX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -2468,16 +2844,22 @@ mulAvxTwo_3x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - VMOVDQU Y0, (BX)(R13*1) - VMOVDQU Y1, (BP)(R13*1) - VMOVDQU Y2, (SI)(R13*1) - VMOVDQU Y3, (DI)(R13*1) - VMOVDQU Y4, (R8)(R13*1) - VMOVDQU Y5, (R9)(R13*1) - VMOVDQU Y6, (DX)(R13*1) + VMOVDQU Y0, (DI) + ADDQ $0x20, DI + VMOVDQU Y1, (R8) + ADDQ $0x20, R8 + VMOVDQU Y2, (R9) + ADDQ $0x20, R9 + VMOVDQU Y3, (R10) + ADDQ $0x20, R10 + VMOVDQU Y4, (R11) + ADDQ $0x20, R11 + VMOVDQU Y5, (R12) + ADDQ $0x20, R12 + VMOVDQU Y6, (SI) + ADDQ $0x20, SI // Prepare for next loop - ADDQ $0x20, R13 DECQ AX JNZ mulAvxTwo_3x7_loop VZEROUPPER @@ -2489,29 +2871,45 @@ mulAvxTwo_3x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_3x8(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 61 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_3x8_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), DX - MOVQ in_base+24(FP), R11 - MOVQ (R11), R12 - MOVQ 24(R11), R13 - MOVQ 48(R11), R11 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_3x8_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), DX + MOVQ out_base+48(FP), SI + MOVQ (SI), DI + MOVQ 24(SI), R8 + MOVQ 48(SI), R9 + MOVQ 72(SI), R10 + MOVQ 96(SI), R11 + MOVQ 120(SI), R12 + MOVQ 144(SI), R13 + MOVQ 168(SI), SI + MOVQ start+72(FP), R14 + + // Add start offset to output + ADDQ R14, DI + ADDQ R14, R8 + ADDQ R14, R9 + ADDQ R14, R10 + ADDQ R14, R11 + ADDQ R14, R12 + ADDQ R14, R13 + ADDQ R14, SI + + // Add start offset to input + ADDQ R14, BX + ADDQ R14, BP + ADDQ R14, DX MOVQ $0x0000000f, R14 MOVQ R14, X8 VPBROADCASTB X8, Y8 - MOVQ start+72(FP), R14 mulAvxTwo_3x8_loop: // Clear 8 outputs @@ -2525,7 +2923,8 @@ mulAvxTwo_3x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (R12)(R14*1), Y11 + VMOVDQU (BX), Y11 + ADDQ $0x20, BX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -2579,7 +2978,8 @@ mulAvxTwo_3x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (R13)(R14*1), Y11 + VMOVDQU (BP), Y11 + ADDQ $0x20, BP VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -2633,7 +3033,8 @@ mulAvxTwo_3x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 2 to 8 outputs - VMOVDQU (R11)(R14*1), Y11 + VMOVDQU (DX), Y11 + ADDQ $0x20, DX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -2687,17 +3088,24 @@ mulAvxTwo_3x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - VMOVDQU Y0, (BX)(R14*1) - VMOVDQU Y1, (BP)(R14*1) - VMOVDQU Y2, (SI)(R14*1) - VMOVDQU Y3, (DI)(R14*1) - VMOVDQU Y4, (R8)(R14*1) - VMOVDQU Y5, (R9)(R14*1) - VMOVDQU Y6, (R10)(R14*1) - VMOVDQU Y7, (DX)(R14*1) + VMOVDQU Y0, (DI) + ADDQ $0x20, DI + VMOVDQU Y1, (R8) + ADDQ $0x20, R8 + VMOVDQU Y2, (R9) + ADDQ $0x20, R9 + VMOVDQU Y3, (R10) + ADDQ $0x20, R10 + VMOVDQU Y4, (R11) + ADDQ $0x20, R11 + VMOVDQU Y5, (R12) + ADDQ $0x20, R12 + VMOVDQU Y6, (R13) + ADDQ $0x20, R13 + VMOVDQU Y7, (SI) + ADDQ $0x20, SI // Prepare for next loop - ADDQ $0x20, R14 DECQ AX JNZ mulAvxTwo_3x8_loop VZEROUPPER @@ -2709,81 +3117,95 @@ mulAvxTwo_3x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_4x1(SB), $0-88 // Loading all tables to registers + // Destination kept in GP registers // Full registers estimated 12 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_4x1_end - MOVQ out_base+48(FP), DX - MOVQ (DX), DX - VMOVDQU (CX), Y1 - VMOVDQU 32(CX), Y2 - VMOVDQU 64(CX), Y3 - VMOVDQU 96(CX), Y4 - VMOVDQU 128(CX), Y5 - VMOVDQU 160(CX), Y6 - VMOVDQU 192(CX), Y7 - VMOVDQU 224(CX), Y8 - MOVQ in_base+24(FP), CX - MOVQ (CX), BX - MOVQ 24(CX), BP - MOVQ 48(CX), SI - MOVQ 72(CX), CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_4x1_end + VMOVDQU (CX), Y0 + VMOVDQU 32(CX), Y1 + VMOVDQU 64(CX), Y2 + VMOVDQU 96(CX), Y3 + VMOVDQU 128(CX), Y4 + VMOVDQU 160(CX), Y5 + VMOVDQU 192(CX), Y6 + VMOVDQU 224(CX), Y7 + MOVQ in_base+24(FP), CX + MOVQ (CX), DX + MOVQ 24(CX), BX + MOVQ 48(CX), BP + MOVQ 72(CX), CX + MOVQ out_base+48(FP), SI + MOVQ (SI), SI + MOVQ start+72(FP), DI + + // Add start offset to output + ADDQ DI, SI + + // Add start offset to input + ADDQ DI, DX + ADDQ DI, BX + ADDQ DI, BP + ADDQ DI, CX MOVQ $0x0000000f, DI MOVQ DI, X9 VPBROADCASTB X9, Y9 - MOVQ start+72(FP), DI mulAvxTwo_4x1_loop: // Clear 1 outputs - VPXOR Y0, Y0, Y0 + VPXOR Y8, Y8, Y8 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (BX)(DI*1), Y10 + VMOVDQU (DX), Y10 + ADDQ $0x20, DX VPSRLQ $0x04, Y10, Y11 VPAND Y9, Y10, Y10 VPAND Y9, Y11, Y11 - VPSHUFB Y10, Y1, Y10 - VPSHUFB Y11, Y2, Y11 + VPSHUFB Y10, Y0, Y10 + VPSHUFB Y11, Y1, Y11 VPXOR Y10, Y11, Y10 - VPXOR Y10, Y0, Y0 + VPXOR Y10, Y8, Y8 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (BP)(DI*1), Y10 + VMOVDQU (BX), Y10 + ADDQ $0x20, BX VPSRLQ $0x04, Y10, Y11 VPAND Y9, Y10, Y10 VPAND Y9, Y11, Y11 - VPSHUFB Y10, Y3, Y10 - VPSHUFB Y11, Y4, Y11 + VPSHUFB Y10, Y2, Y10 + VPSHUFB Y11, Y3, Y11 VPXOR Y10, Y11, Y10 - VPXOR Y10, Y0, Y0 + VPXOR Y10, Y8, Y8 // Load and process 32 bytes from input 2 to 1 outputs - VMOVDQU (SI)(DI*1), Y10 + VMOVDQU (BP), Y10 + ADDQ $0x20, BP VPSRLQ $0x04, Y10, Y11 VPAND Y9, Y10, Y10 VPAND Y9, Y11, Y11 - VPSHUFB Y10, Y5, Y10 - VPSHUFB Y11, Y6, Y11 + VPSHUFB Y10, Y4, Y10 + VPSHUFB Y11, Y5, Y11 VPXOR Y10, Y11, Y10 - VPXOR Y10, Y0, Y0 + VPXOR Y10, Y8, Y8 // Load and process 32 bytes from input 3 to 1 outputs - VMOVDQU (CX)(DI*1), Y10 + VMOVDQU (CX), Y10 + ADDQ $0x20, CX VPSRLQ $0x04, Y10, Y11 VPAND Y9, Y10, Y10 VPAND Y9, Y11, Y11 - VPSHUFB Y10, Y7, Y10 - VPSHUFB Y11, Y8, Y11 + VPSHUFB Y10, Y6, Y10 + VPSHUFB Y11, Y7, Y11 VPXOR Y10, Y11, Y10 - VPXOR Y10, Y0, Y0 + VPXOR Y10, Y8, Y8 // Store 1 outputs - VMOVDQU Y0, (DX)(DI*1) + VMOVDQU Y8, (SI) + ADDQ $0x20, SI // Prepare for next loop - ADDQ $0x20, DI DECQ AX JNZ mulAvxTwo_4x1_loop VZEROUPPER @@ -2795,24 +3217,35 @@ mulAvxTwo_4x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_4x2(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 23 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_4x2_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), DX - MOVQ in_base+24(FP), BP - MOVQ (BP), SI - MOVQ 24(BP), DI - MOVQ 48(BP), R8 - MOVQ 72(BP), BP + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_4x2_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DX + MOVQ out_base+48(FP), DI + MOVQ (DI), R8 + MOVQ 24(DI), DI + MOVQ start+72(FP), R9 + + // Add start offset to output + ADDQ R9, R8 + ADDQ R9, DI + + // Add start offset to input + ADDQ R9, BX + ADDQ R9, BP + ADDQ R9, SI + ADDQ R9, DX MOVQ $0x0000000f, R9 MOVQ R9, X2 VPBROADCASTB X2, Y2 - MOVQ start+72(FP), R9 mulAvxTwo_4x2_loop: // Clear 2 outputs @@ -2820,7 +3253,8 @@ mulAvxTwo_4x2_loop: VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (SI)(R9*1), Y5 + VMOVDQU (BX), Y5 + ADDQ $0x20, BX VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -2838,7 +3272,8 @@ mulAvxTwo_4x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (DI)(R9*1), Y5 + VMOVDQU (BP), Y5 + ADDQ $0x20, BP VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -2856,7 +3291,8 @@ mulAvxTwo_4x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 2 to 2 outputs - VMOVDQU (R8)(R9*1), Y5 + VMOVDQU (SI), Y5 + ADDQ $0x20, SI VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -2874,7 +3310,8 @@ mulAvxTwo_4x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 3 to 2 outputs - VMOVDQU (BP)(R9*1), Y5 + VMOVDQU (DX), Y5 + ADDQ $0x20, DX VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -2892,11 +3329,12 @@ mulAvxTwo_4x2_loop: VPXOR Y3, Y1, Y1 // Store 2 outputs - VMOVDQU Y0, (BX)(R9*1) - VMOVDQU Y1, (DX)(R9*1) + VMOVDQU Y0, (R8) + ADDQ $0x20, R8 + VMOVDQU Y1, (DI) + ADDQ $0x20, DI // Prepare for next loop - ADDQ $0x20, R9 DECQ AX JNZ mulAvxTwo_4x2_loop VZEROUPPER @@ -2908,25 +3346,37 @@ mulAvxTwo_4x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_4x3(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 32 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_4x3_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), DX - MOVQ in_base+24(FP), SI - MOVQ (SI), DI - MOVQ 24(SI), R8 - MOVQ 48(SI), R9 - MOVQ 72(SI), SI + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_4x3_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DX + MOVQ out_base+48(FP), DI + MOVQ (DI), R8 + MOVQ 24(DI), R9 + MOVQ 48(DI), DI + MOVQ start+72(FP), R10 + + // Add start offset to output + ADDQ R10, R8 + ADDQ R10, R9 + ADDQ R10, DI + + // Add start offset to input + ADDQ R10, BX + ADDQ R10, BP + ADDQ R10, SI + ADDQ R10, DX MOVQ $0x0000000f, R10 MOVQ R10, X3 VPBROADCASTB X3, Y3 - MOVQ start+72(FP), R10 mulAvxTwo_4x3_loop: // Clear 3 outputs @@ -2935,7 +3385,8 @@ mulAvxTwo_4x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (DI)(R10*1), Y6 + VMOVDQU (BX), Y6 + ADDQ $0x20, BX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -2959,7 +3410,8 @@ mulAvxTwo_4x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (R8)(R10*1), Y6 + VMOVDQU (BP), Y6 + ADDQ $0x20, BP VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -2983,7 +3435,8 @@ mulAvxTwo_4x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 2 to 3 outputs - VMOVDQU (R9)(R10*1), Y6 + VMOVDQU (SI), Y6 + ADDQ $0x20, SI VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -3007,7 +3460,8 @@ mulAvxTwo_4x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 3 to 3 outputs - VMOVDQU (SI)(R10*1), Y6 + VMOVDQU (DX), Y6 + ADDQ $0x20, DX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -3031,12 +3485,14 @@ mulAvxTwo_4x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - VMOVDQU Y0, (BX)(R10*1) - VMOVDQU Y1, (BP)(R10*1) - VMOVDQU Y2, (DX)(R10*1) + VMOVDQU Y0, (R8) + ADDQ $0x20, R8 + VMOVDQU Y1, (R9) + ADDQ $0x20, R9 + VMOVDQU Y2, (DI) + ADDQ $0x20, DI // Prepare for next loop - ADDQ $0x20, R10 DECQ AX JNZ mulAvxTwo_4x3_loop VZEROUPPER @@ -3048,26 +3504,39 @@ mulAvxTwo_4x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_4x4(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 41 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_4x4_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DX - MOVQ in_base+24(FP), DI - MOVQ (DI), R8 - MOVQ 24(DI), R9 - MOVQ 48(DI), R10 - MOVQ 72(DI), DI + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_4x4_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DX + MOVQ out_base+48(FP), DI + MOVQ (DI), R8 + MOVQ 24(DI), R9 + MOVQ 48(DI), R10 + MOVQ 72(DI), DI + MOVQ start+72(FP), R11 + + // Add start offset to output + ADDQ R11, R8 + ADDQ R11, R9 + ADDQ R11, R10 + ADDQ R11, DI + + // Add start offset to input + ADDQ R11, BX + ADDQ R11, BP + ADDQ R11, SI + ADDQ R11, DX MOVQ $0x0000000f, R11 MOVQ R11, X4 VPBROADCASTB X4, Y4 - MOVQ start+72(FP), R11 mulAvxTwo_4x4_loop: // Clear 4 outputs @@ -3077,7 +3546,8 @@ mulAvxTwo_4x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (R8)(R11*1), Y7 + VMOVDQU (BX), Y7 + ADDQ $0x20, BX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -3107,7 +3577,8 @@ mulAvxTwo_4x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (R9)(R11*1), Y7 + VMOVDQU (BP), Y7 + ADDQ $0x20, BP VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -3137,7 +3608,8 @@ mulAvxTwo_4x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 2 to 4 outputs - VMOVDQU (R10)(R11*1), Y7 + VMOVDQU (SI), Y7 + ADDQ $0x20, SI VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -3167,7 +3639,8 @@ mulAvxTwo_4x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 3 to 4 outputs - VMOVDQU (DI)(R11*1), Y7 + VMOVDQU (DX), Y7 + ADDQ $0x20, DX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -3197,13 +3670,16 @@ mulAvxTwo_4x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - VMOVDQU Y0, (BX)(R11*1) - VMOVDQU Y1, (BP)(R11*1) - VMOVDQU Y2, (SI)(R11*1) - VMOVDQU Y3, (DX)(R11*1) + VMOVDQU Y0, (R8) + ADDQ $0x20, R8 + VMOVDQU Y1, (R9) + ADDQ $0x20, R9 + VMOVDQU Y2, (R10) + ADDQ $0x20, R10 + VMOVDQU Y3, (DI) + ADDQ $0x20, DI // Prepare for next loop - ADDQ $0x20, R11 DECQ AX JNZ mulAvxTwo_4x4_loop VZEROUPPER @@ -3215,27 +3691,41 @@ mulAvxTwo_4x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_4x5(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 50 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_4x5_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), DX - MOVQ in_base+24(FP), R8 - MOVQ (R8), R9 - MOVQ 24(R8), R10 - MOVQ 48(R8), R11 - MOVQ 72(R8), R8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_4x5_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DX + MOVQ out_base+48(FP), DI + MOVQ (DI), R8 + MOVQ 24(DI), R9 + MOVQ 48(DI), R10 + MOVQ 72(DI), R11 + MOVQ 96(DI), DI + MOVQ start+72(FP), R12 + + // Add start offset to output + ADDQ R12, R8 + ADDQ R12, R9 + ADDQ R12, R10 + ADDQ R12, R11 + ADDQ R12, DI + + // Add start offset to input + ADDQ R12, BX + ADDQ R12, BP + ADDQ R12, SI + ADDQ R12, DX MOVQ $0x0000000f, R12 MOVQ R12, X5 VPBROADCASTB X5, Y5 - MOVQ start+72(FP), R12 mulAvxTwo_4x5_loop: // Clear 5 outputs @@ -3246,7 +3736,8 @@ mulAvxTwo_4x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (R9)(R12*1), Y8 + VMOVDQU (BX), Y8 + ADDQ $0x20, BX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -3282,7 +3773,8 @@ mulAvxTwo_4x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (R10)(R12*1), Y8 + VMOVDQU (BP), Y8 + ADDQ $0x20, BP VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -3318,7 +3810,8 @@ mulAvxTwo_4x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 2 to 5 outputs - VMOVDQU (R11)(R12*1), Y8 + VMOVDQU (SI), Y8 + ADDQ $0x20, SI VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -3354,7 +3847,8 @@ mulAvxTwo_4x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 3 to 5 outputs - VMOVDQU (R8)(R12*1), Y8 + VMOVDQU (DX), Y8 + ADDQ $0x20, DX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -3390,14 +3884,18 @@ mulAvxTwo_4x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - VMOVDQU Y0, (BX)(R12*1) - VMOVDQU Y1, (BP)(R12*1) - VMOVDQU Y2, (SI)(R12*1) - VMOVDQU Y3, (DI)(R12*1) - VMOVDQU Y4, (DX)(R12*1) + VMOVDQU Y0, (R8) + ADDQ $0x20, R8 + VMOVDQU Y1, (R9) + ADDQ $0x20, R9 + VMOVDQU Y2, (R10) + ADDQ $0x20, R10 + VMOVDQU Y3, (R11) + ADDQ $0x20, R11 + VMOVDQU Y4, (DI) + ADDQ $0x20, DI // Prepare for next loop - ADDQ $0x20, R12 DECQ AX JNZ mulAvxTwo_4x5_loop VZEROUPPER @@ -3409,28 +3907,43 @@ mulAvxTwo_4x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_4x6(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 59 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_4x6_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), DX - MOVQ in_base+24(FP), R9 - MOVQ (R9), R10 - MOVQ 24(R9), R11 - MOVQ 48(R9), R12 - MOVQ 72(R9), R9 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_4x6_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DX + MOVQ out_base+48(FP), DI + MOVQ (DI), R8 + MOVQ 24(DI), R9 + MOVQ 48(DI), R10 + MOVQ 72(DI), R11 + MOVQ 96(DI), R12 + MOVQ 120(DI), DI + MOVQ start+72(FP), R13 + + // Add start offset to output + ADDQ R13, R8 + ADDQ R13, R9 + ADDQ R13, R10 + ADDQ R13, R11 + ADDQ R13, R12 + ADDQ R13, DI + + // Add start offset to input + ADDQ R13, BX + ADDQ R13, BP + ADDQ R13, SI + ADDQ R13, DX MOVQ $0x0000000f, R13 MOVQ R13, X6 VPBROADCASTB X6, Y6 - MOVQ start+72(FP), R13 mulAvxTwo_4x6_loop: // Clear 6 outputs @@ -3442,7 +3955,8 @@ mulAvxTwo_4x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (R10)(R13*1), Y9 + VMOVDQU (BX), Y9 + ADDQ $0x20, BX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -3484,7 +3998,8 @@ mulAvxTwo_4x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (R11)(R13*1), Y9 + VMOVDQU (BP), Y9 + ADDQ $0x20, BP VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -3526,7 +4041,8 @@ mulAvxTwo_4x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 2 to 6 outputs - VMOVDQU (R12)(R13*1), Y9 + VMOVDQU (SI), Y9 + ADDQ $0x20, SI VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -3568,7 +4084,8 @@ mulAvxTwo_4x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 3 to 6 outputs - VMOVDQU (R9)(R13*1), Y9 + VMOVDQU (DX), Y9 + ADDQ $0x20, DX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -3610,15 +4127,20 @@ mulAvxTwo_4x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - VMOVDQU Y0, (BX)(R13*1) - VMOVDQU Y1, (BP)(R13*1) - VMOVDQU Y2, (SI)(R13*1) - VMOVDQU Y3, (DI)(R13*1) - VMOVDQU Y4, (R8)(R13*1) - VMOVDQU Y5, (DX)(R13*1) + VMOVDQU Y0, (R8) + ADDQ $0x20, R8 + VMOVDQU Y1, (R9) + ADDQ $0x20, R9 + VMOVDQU Y2, (R10) + ADDQ $0x20, R10 + VMOVDQU Y3, (R11) + ADDQ $0x20, R11 + VMOVDQU Y4, (R12) + ADDQ $0x20, R12 + VMOVDQU Y5, (DI) + ADDQ $0x20, DI // Prepare for next loop - ADDQ $0x20, R13 DECQ AX JNZ mulAvxTwo_4x6_loop VZEROUPPER @@ -3630,29 +4152,45 @@ mulAvxTwo_4x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_4x7(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 68 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_4x7_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), DX - MOVQ in_base+24(FP), R10 - MOVQ (R10), R11 - MOVQ 24(R10), R12 - MOVQ 48(R10), R13 - MOVQ 72(R10), R10 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_4x7_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DX + MOVQ out_base+48(FP), DI + MOVQ (DI), R8 + MOVQ 24(DI), R9 + MOVQ 48(DI), R10 + MOVQ 72(DI), R11 + MOVQ 96(DI), R12 + MOVQ 120(DI), R13 + MOVQ 144(DI), DI + MOVQ start+72(FP), R14 + + // Add start offset to output + ADDQ R14, R8 + ADDQ R14, R9 + ADDQ R14, R10 + ADDQ R14, R11 + ADDQ R14, R12 + ADDQ R14, R13 + ADDQ R14, DI + + // Add start offset to input + ADDQ R14, BX + ADDQ R14, BP + ADDQ R14, SI + ADDQ R14, DX MOVQ $0x0000000f, R14 MOVQ R14, X7 VPBROADCASTB X7, Y7 - MOVQ start+72(FP), R14 mulAvxTwo_4x7_loop: // Clear 7 outputs @@ -3665,7 +4203,8 @@ mulAvxTwo_4x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (R11)(R14*1), Y10 + VMOVDQU (BX), Y10 + ADDQ $0x20, BX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -3713,7 +4252,8 @@ mulAvxTwo_4x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (R12)(R14*1), Y10 + VMOVDQU (BP), Y10 + ADDQ $0x20, BP VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -3761,7 +4301,8 @@ mulAvxTwo_4x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 2 to 7 outputs - VMOVDQU (R13)(R14*1), Y10 + VMOVDQU (SI), Y10 + ADDQ $0x20, SI VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -3809,7 +4350,8 @@ mulAvxTwo_4x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 3 to 7 outputs - VMOVDQU (R10)(R14*1), Y10 + VMOVDQU (DX), Y10 + ADDQ $0x20, DX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -3857,16 +4399,22 @@ mulAvxTwo_4x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - VMOVDQU Y0, (BX)(R14*1) - VMOVDQU Y1, (BP)(R14*1) - VMOVDQU Y2, (SI)(R14*1) - VMOVDQU Y3, (DI)(R14*1) - VMOVDQU Y4, (R8)(R14*1) - VMOVDQU Y5, (R9)(R14*1) - VMOVDQU Y6, (DX)(R14*1) + VMOVDQU Y0, (R8) + ADDQ $0x20, R8 + VMOVDQU Y1, (R9) + ADDQ $0x20, R9 + VMOVDQU Y2, (R10) + ADDQ $0x20, R10 + VMOVDQU Y3, (R11) + ADDQ $0x20, R11 + VMOVDQU Y4, (R12) + ADDQ $0x20, R12 + VMOVDQU Y5, (R13) + ADDQ $0x20, R13 + VMOVDQU Y6, (DI) + ADDQ $0x20, DI // Prepare for next loop - ADDQ $0x20, R14 DECQ AX JNZ mulAvxTwo_4x7_loop VZEROUPPER @@ -3878,30 +4426,47 @@ mulAvxTwo_4x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_4x8(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 77 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_4x8_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), DX - MOVQ in_base+24(FP), R11 - MOVQ (R11), R12 - MOVQ 24(R11), R13 - MOVQ 48(R11), R14 - MOVQ 72(R11), R11 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_4x8_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DX + MOVQ out_base+48(FP), DI + MOVQ (DI), R8 + MOVQ 24(DI), R9 + MOVQ 48(DI), R10 + MOVQ 72(DI), R11 + MOVQ 96(DI), R12 + MOVQ 120(DI), R13 + MOVQ 144(DI), R14 + MOVQ 168(DI), DI + MOVQ start+72(FP), R15 + + // Add start offset to output + ADDQ R15, R8 + ADDQ R15, R9 + ADDQ R15, R10 + ADDQ R15, R11 + ADDQ R15, R12 + ADDQ R15, R13 + ADDQ R15, R14 + ADDQ R15, DI + + // Add start offset to input + ADDQ R15, BX + ADDQ R15, BP + ADDQ R15, SI + ADDQ R15, DX MOVQ $0x0000000f, R15 MOVQ R15, X8 VPBROADCASTB X8, Y8 - MOVQ start+72(FP), R15 mulAvxTwo_4x8_loop: // Clear 8 outputs @@ -3915,7 +4480,8 @@ mulAvxTwo_4x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (R12)(R15*1), Y11 + VMOVDQU (BX), Y11 + ADDQ $0x20, BX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -3969,7 +4535,8 @@ mulAvxTwo_4x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (R13)(R15*1), Y11 + VMOVDQU (BP), Y11 + ADDQ $0x20, BP VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -4023,7 +4590,8 @@ mulAvxTwo_4x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 2 to 8 outputs - VMOVDQU (R14)(R15*1), Y11 + VMOVDQU (SI), Y11 + ADDQ $0x20, SI VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -4077,7 +4645,8 @@ mulAvxTwo_4x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 3 to 8 outputs - VMOVDQU (R11)(R15*1), Y11 + VMOVDQU (DX), Y11 + ADDQ $0x20, DX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -4131,17 +4700,24 @@ mulAvxTwo_4x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - VMOVDQU Y0, (BX)(R15*1) - VMOVDQU Y1, (BP)(R15*1) - VMOVDQU Y2, (SI)(R15*1) - VMOVDQU Y3, (DI)(R15*1) - VMOVDQU Y4, (R8)(R15*1) - VMOVDQU Y5, (R9)(R15*1) - VMOVDQU Y6, (R10)(R15*1) - VMOVDQU Y7, (DX)(R15*1) + VMOVDQU Y0, (R8) + ADDQ $0x20, R8 + VMOVDQU Y1, (R9) + ADDQ $0x20, R9 + VMOVDQU Y2, (R10) + ADDQ $0x20, R10 + VMOVDQU Y3, (R11) + ADDQ $0x20, R11 + VMOVDQU Y4, (R12) + ADDQ $0x20, R12 + VMOVDQU Y5, (R13) + ADDQ $0x20, R13 + VMOVDQU Y6, (R14) + ADDQ $0x20, R14 + VMOVDQU Y7, (DI) + ADDQ $0x20, DI // Prepare for next loop - ADDQ $0x20, R15 DECQ AX JNZ mulAvxTwo_4x8_loop VZEROUPPER @@ -4153,94 +4729,110 @@ mulAvxTwo_4x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_5x1(SB), $0-88 // Loading all tables to registers + // Destination kept in GP registers // Full registers estimated 14 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_5x1_end - MOVQ out_base+48(FP), DX - MOVQ (DX), DX - VMOVDQU (CX), Y1 - VMOVDQU 32(CX), Y2 - VMOVDQU 64(CX), Y3 - VMOVDQU 96(CX), Y4 - VMOVDQU 128(CX), Y5 - VMOVDQU 160(CX), Y6 - VMOVDQU 192(CX), Y7 - VMOVDQU 224(CX), Y8 - VMOVDQU 256(CX), Y9 - VMOVDQU 288(CX), Y10 - MOVQ in_base+24(FP), CX - MOVQ (CX), BX - MOVQ 24(CX), BP - MOVQ 48(CX), SI - MOVQ 72(CX), DI - MOVQ 96(CX), CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_5x1_end + VMOVDQU (CX), Y0 + VMOVDQU 32(CX), Y1 + VMOVDQU 64(CX), Y2 + VMOVDQU 96(CX), Y3 + VMOVDQU 128(CX), Y4 + VMOVDQU 160(CX), Y5 + VMOVDQU 192(CX), Y6 + VMOVDQU 224(CX), Y7 + VMOVDQU 256(CX), Y8 + VMOVDQU 288(CX), Y9 + MOVQ in_base+24(FP), CX + MOVQ (CX), DX + MOVQ 24(CX), BX + MOVQ 48(CX), BP + MOVQ 72(CX), SI + MOVQ 96(CX), CX + MOVQ out_base+48(FP), DI + MOVQ (DI), DI + MOVQ start+72(FP), R8 + + // Add start offset to output + ADDQ R8, DI + + // Add start offset to input + ADDQ R8, DX + ADDQ R8, BX + ADDQ R8, BP + ADDQ R8, SI + ADDQ R8, CX MOVQ $0x0000000f, R8 MOVQ R8, X11 VPBROADCASTB X11, Y11 - MOVQ start+72(FP), R8 mulAvxTwo_5x1_loop: // Clear 1 outputs - VPXOR Y0, Y0, Y0 + VPXOR Y10, Y10, Y10 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (BX)(R8*1), Y12 + VMOVDQU (DX), Y12 + ADDQ $0x20, DX VPSRLQ $0x04, Y12, Y13 VPAND Y11, Y12, Y12 VPAND Y11, Y13, Y13 - VPSHUFB Y12, Y1, Y12 - VPSHUFB Y13, Y2, Y13 + VPSHUFB Y12, Y0, Y12 + VPSHUFB Y13, Y1, Y13 VPXOR Y12, Y13, Y12 - VPXOR Y12, Y0, Y0 + VPXOR Y12, Y10, Y10 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (BP)(R8*1), Y12 + VMOVDQU (BX), Y12 + ADDQ $0x20, BX VPSRLQ $0x04, Y12, Y13 VPAND Y11, Y12, Y12 VPAND Y11, Y13, Y13 - VPSHUFB Y12, Y3, Y12 - VPSHUFB Y13, Y4, Y13 + VPSHUFB Y12, Y2, Y12 + VPSHUFB Y13, Y3, Y13 VPXOR Y12, Y13, Y12 - VPXOR Y12, Y0, Y0 + VPXOR Y12, Y10, Y10 // Load and process 32 bytes from input 2 to 1 outputs - VMOVDQU (SI)(R8*1), Y12 + VMOVDQU (BP), Y12 + ADDQ $0x20, BP VPSRLQ $0x04, Y12, Y13 VPAND Y11, Y12, Y12 VPAND Y11, Y13, Y13 - VPSHUFB Y12, Y5, Y12 - VPSHUFB Y13, Y6, Y13 + VPSHUFB Y12, Y4, Y12 + VPSHUFB Y13, Y5, Y13 VPXOR Y12, Y13, Y12 - VPXOR Y12, Y0, Y0 + VPXOR Y12, Y10, Y10 // Load and process 32 bytes from input 3 to 1 outputs - VMOVDQU (DI)(R8*1), Y12 + VMOVDQU (SI), Y12 + ADDQ $0x20, SI VPSRLQ $0x04, Y12, Y13 VPAND Y11, Y12, Y12 VPAND Y11, Y13, Y13 - VPSHUFB Y12, Y7, Y12 - VPSHUFB Y13, Y8, Y13 + VPSHUFB Y12, Y6, Y12 + VPSHUFB Y13, Y7, Y13 VPXOR Y12, Y13, Y12 - VPXOR Y12, Y0, Y0 + VPXOR Y12, Y10, Y10 // Load and process 32 bytes from input 4 to 1 outputs - VMOVDQU (CX)(R8*1), Y12 + VMOVDQU (CX), Y12 + ADDQ $0x20, CX VPSRLQ $0x04, Y12, Y13 VPAND Y11, Y12, Y12 VPAND Y11, Y13, Y13 - VPSHUFB Y12, Y9, Y12 - VPSHUFB Y13, Y10, Y13 + VPSHUFB Y12, Y8, Y12 + VPSHUFB Y13, Y9, Y13 VPXOR Y12, Y13, Y12 - VPXOR Y12, Y0, Y0 + VPXOR Y12, Y10, Y10 // Store 1 outputs - VMOVDQU Y0, (DX)(R8*1) + VMOVDQU Y10, (DI) + ADDQ $0x20, DI // Prepare for next loop - ADDQ $0x20, R8 DECQ AX JNZ mulAvxTwo_5x1_loop VZEROUPPER @@ -4252,25 +4844,37 @@ mulAvxTwo_5x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_5x2(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 27 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_5x2_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), DX - MOVQ in_base+24(FP), BP - MOVQ (BP), SI - MOVQ 24(BP), DI - MOVQ 48(BP), R8 - MOVQ 72(BP), R9 - MOVQ 96(BP), BP + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_5x2_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), DX + MOVQ out_base+48(FP), R8 + MOVQ (R8), R9 + MOVQ 24(R8), R8 + MOVQ start+72(FP), R10 + + // Add start offset to output + ADDQ R10, R9 + ADDQ R10, R8 + + // Add start offset to input + ADDQ R10, BX + ADDQ R10, BP + ADDQ R10, SI + ADDQ R10, DI + ADDQ R10, DX MOVQ $0x0000000f, R10 MOVQ R10, X2 VPBROADCASTB X2, Y2 - MOVQ start+72(FP), R10 mulAvxTwo_5x2_loop: // Clear 2 outputs @@ -4278,7 +4882,8 @@ mulAvxTwo_5x2_loop: VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (SI)(R10*1), Y5 + VMOVDQU (BX), Y5 + ADDQ $0x20, BX VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -4296,7 +4901,8 @@ mulAvxTwo_5x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (DI)(R10*1), Y5 + VMOVDQU (BP), Y5 + ADDQ $0x20, BP VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -4314,7 +4920,8 @@ mulAvxTwo_5x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 2 to 2 outputs - VMOVDQU (R8)(R10*1), Y5 + VMOVDQU (SI), Y5 + ADDQ $0x20, SI VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -4332,7 +4939,8 @@ mulAvxTwo_5x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 3 to 2 outputs - VMOVDQU (R9)(R10*1), Y5 + VMOVDQU (DI), Y5 + ADDQ $0x20, DI VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -4350,7 +4958,8 @@ mulAvxTwo_5x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 4 to 2 outputs - VMOVDQU (BP)(R10*1), Y5 + VMOVDQU (DX), Y5 + ADDQ $0x20, DX VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -4368,11 +4977,12 @@ mulAvxTwo_5x2_loop: VPXOR Y3, Y1, Y1 // Store 2 outputs - VMOVDQU Y0, (BX)(R10*1) - VMOVDQU Y1, (DX)(R10*1) + VMOVDQU Y0, (R9) + ADDQ $0x20, R9 + VMOVDQU Y1, (R8) + ADDQ $0x20, R8 // Prepare for next loop - ADDQ $0x20, R10 DECQ AX JNZ mulAvxTwo_5x2_loop VZEROUPPER @@ -4384,26 +4994,39 @@ mulAvxTwo_5x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_5x3(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 38 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_5x3_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), DX - MOVQ in_base+24(FP), SI - MOVQ (SI), DI - MOVQ 24(SI), R8 - MOVQ 48(SI), R9 - MOVQ 72(SI), R10 - MOVQ 96(SI), SI + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_5x3_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), DX + MOVQ out_base+48(FP), R8 + MOVQ (R8), R9 + MOVQ 24(R8), R10 + MOVQ 48(R8), R8 + MOVQ start+72(FP), R11 + + // Add start offset to output + ADDQ R11, R9 + ADDQ R11, R10 + ADDQ R11, R8 + + // Add start offset to input + ADDQ R11, BX + ADDQ R11, BP + ADDQ R11, SI + ADDQ R11, DI + ADDQ R11, DX MOVQ $0x0000000f, R11 MOVQ R11, X3 VPBROADCASTB X3, Y3 - MOVQ start+72(FP), R11 mulAvxTwo_5x3_loop: // Clear 3 outputs @@ -4412,7 +5035,8 @@ mulAvxTwo_5x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (DI)(R11*1), Y6 + VMOVDQU (BX), Y6 + ADDQ $0x20, BX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -4436,7 +5060,8 @@ mulAvxTwo_5x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (R8)(R11*1), Y6 + VMOVDQU (BP), Y6 + ADDQ $0x20, BP VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -4460,7 +5085,8 @@ mulAvxTwo_5x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 2 to 3 outputs - VMOVDQU (R9)(R11*1), Y6 + VMOVDQU (SI), Y6 + ADDQ $0x20, SI VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -4484,7 +5110,8 @@ mulAvxTwo_5x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 3 to 3 outputs - VMOVDQU (R10)(R11*1), Y6 + VMOVDQU (DI), Y6 + ADDQ $0x20, DI VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -4508,7 +5135,8 @@ mulAvxTwo_5x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 4 to 3 outputs - VMOVDQU (SI)(R11*1), Y6 + VMOVDQU (DX), Y6 + ADDQ $0x20, DX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -4532,12 +5160,14 @@ mulAvxTwo_5x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - VMOVDQU Y0, (BX)(R11*1) - VMOVDQU Y1, (BP)(R11*1) - VMOVDQU Y2, (DX)(R11*1) + VMOVDQU Y0, (R9) + ADDQ $0x20, R9 + VMOVDQU Y1, (R10) + ADDQ $0x20, R10 + VMOVDQU Y2, (R8) + ADDQ $0x20, R8 // Prepare for next loop - ADDQ $0x20, R11 DECQ AX JNZ mulAvxTwo_5x3_loop VZEROUPPER @@ -4549,27 +5179,41 @@ mulAvxTwo_5x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_5x4(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 49 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_5x4_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DX - MOVQ in_base+24(FP), DI - MOVQ (DI), R8 - MOVQ 24(DI), R9 - MOVQ 48(DI), R10 - MOVQ 72(DI), R11 - MOVQ 96(DI), DI + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_5x4_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), DX + MOVQ out_base+48(FP), R8 + MOVQ (R8), R9 + MOVQ 24(R8), R10 + MOVQ 48(R8), R11 + MOVQ 72(R8), R8 + MOVQ start+72(FP), R12 + + // Add start offset to output + ADDQ R12, R9 + ADDQ R12, R10 + ADDQ R12, R11 + ADDQ R12, R8 + + // Add start offset to input + ADDQ R12, BX + ADDQ R12, BP + ADDQ R12, SI + ADDQ R12, DI + ADDQ R12, DX MOVQ $0x0000000f, R12 MOVQ R12, X4 VPBROADCASTB X4, Y4 - MOVQ start+72(FP), R12 mulAvxTwo_5x4_loop: // Clear 4 outputs @@ -4579,7 +5223,8 @@ mulAvxTwo_5x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (R8)(R12*1), Y7 + VMOVDQU (BX), Y7 + ADDQ $0x20, BX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -4609,7 +5254,8 @@ mulAvxTwo_5x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (R9)(R12*1), Y7 + VMOVDQU (BP), Y7 + ADDQ $0x20, BP VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -4639,7 +5285,8 @@ mulAvxTwo_5x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 2 to 4 outputs - VMOVDQU (R10)(R12*1), Y7 + VMOVDQU (SI), Y7 + ADDQ $0x20, SI VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -4669,7 +5316,8 @@ mulAvxTwo_5x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 3 to 4 outputs - VMOVDQU (R11)(R12*1), Y7 + VMOVDQU (DI), Y7 + ADDQ $0x20, DI VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -4699,7 +5347,8 @@ mulAvxTwo_5x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 4 to 4 outputs - VMOVDQU (DI)(R12*1), Y7 + VMOVDQU (DX), Y7 + ADDQ $0x20, DX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -4729,13 +5378,16 @@ mulAvxTwo_5x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - VMOVDQU Y0, (BX)(R12*1) - VMOVDQU Y1, (BP)(R12*1) - VMOVDQU Y2, (SI)(R12*1) - VMOVDQU Y3, (DX)(R12*1) + VMOVDQU Y0, (R9) + ADDQ $0x20, R9 + VMOVDQU Y1, (R10) + ADDQ $0x20, R10 + VMOVDQU Y2, (R11) + ADDQ $0x20, R11 + VMOVDQU Y3, (R8) + ADDQ $0x20, R8 // Prepare for next loop - ADDQ $0x20, R12 DECQ AX JNZ mulAvxTwo_5x4_loop VZEROUPPER @@ -4747,28 +5399,43 @@ mulAvxTwo_5x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_5x5(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 60 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_5x5_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), DX - MOVQ in_base+24(FP), R8 - MOVQ (R8), R9 - MOVQ 24(R8), R10 - MOVQ 48(R8), R11 - MOVQ 72(R8), R12 - MOVQ 96(R8), R8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_5x5_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), DX + MOVQ out_base+48(FP), R8 + MOVQ (R8), R9 + MOVQ 24(R8), R10 + MOVQ 48(R8), R11 + MOVQ 72(R8), R12 + MOVQ 96(R8), R8 + MOVQ start+72(FP), R13 + + // Add start offset to output + ADDQ R13, R9 + ADDQ R13, R10 + ADDQ R13, R11 + ADDQ R13, R12 + ADDQ R13, R8 + + // Add start offset to input + ADDQ R13, BX + ADDQ R13, BP + ADDQ R13, SI + ADDQ R13, DI + ADDQ R13, DX MOVQ $0x0000000f, R13 MOVQ R13, X5 VPBROADCASTB X5, Y5 - MOVQ start+72(FP), R13 mulAvxTwo_5x5_loop: // Clear 5 outputs @@ -4779,7 +5446,8 @@ mulAvxTwo_5x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (R9)(R13*1), Y8 + VMOVDQU (BX), Y8 + ADDQ $0x20, BX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -4815,7 +5483,8 @@ mulAvxTwo_5x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (R10)(R13*1), Y8 + VMOVDQU (BP), Y8 + ADDQ $0x20, BP VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -4851,7 +5520,8 @@ mulAvxTwo_5x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 2 to 5 outputs - VMOVDQU (R11)(R13*1), Y8 + VMOVDQU (SI), Y8 + ADDQ $0x20, SI VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -4887,7 +5557,8 @@ mulAvxTwo_5x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 3 to 5 outputs - VMOVDQU (R12)(R13*1), Y8 + VMOVDQU (DI), Y8 + ADDQ $0x20, DI VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -4923,7 +5594,8 @@ mulAvxTwo_5x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 4 to 5 outputs - VMOVDQU (R8)(R13*1), Y8 + VMOVDQU (DX), Y8 + ADDQ $0x20, DX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -4959,14 +5631,18 @@ mulAvxTwo_5x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - VMOVDQU Y0, (BX)(R13*1) - VMOVDQU Y1, (BP)(R13*1) - VMOVDQU Y2, (SI)(R13*1) - VMOVDQU Y3, (DI)(R13*1) - VMOVDQU Y4, (DX)(R13*1) + VMOVDQU Y0, (R9) + ADDQ $0x20, R9 + VMOVDQU Y1, (R10) + ADDQ $0x20, R10 + VMOVDQU Y2, (R11) + ADDQ $0x20, R11 + VMOVDQU Y3, (R12) + ADDQ $0x20, R12 + VMOVDQU Y4, (R8) + ADDQ $0x20, R8 // Prepare for next loop - ADDQ $0x20, R13 DECQ AX JNZ mulAvxTwo_5x5_loop VZEROUPPER @@ -4978,29 +5654,45 @@ mulAvxTwo_5x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_5x6(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 71 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_5x6_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), DX - MOVQ in_base+24(FP), R9 - MOVQ (R9), R10 - MOVQ 24(R9), R11 - MOVQ 48(R9), R12 - MOVQ 72(R9), R13 - MOVQ 96(R9), R9 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_5x6_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), DX + MOVQ out_base+48(FP), R8 + MOVQ (R8), R9 + MOVQ 24(R8), R10 + MOVQ 48(R8), R11 + MOVQ 72(R8), R12 + MOVQ 96(R8), R13 + MOVQ 120(R8), R8 + MOVQ start+72(FP), R14 + + // Add start offset to output + ADDQ R14, R9 + ADDQ R14, R10 + ADDQ R14, R11 + ADDQ R14, R12 + ADDQ R14, R13 + ADDQ R14, R8 + + // Add start offset to input + ADDQ R14, BX + ADDQ R14, BP + ADDQ R14, SI + ADDQ R14, DI + ADDQ R14, DX MOVQ $0x0000000f, R14 MOVQ R14, X6 VPBROADCASTB X6, Y6 - MOVQ start+72(FP), R14 mulAvxTwo_5x6_loop: // Clear 6 outputs @@ -5012,7 +5704,8 @@ mulAvxTwo_5x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (R10)(R14*1), Y9 + VMOVDQU (BX), Y9 + ADDQ $0x20, BX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -5054,7 +5747,8 @@ mulAvxTwo_5x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (R11)(R14*1), Y9 + VMOVDQU (BP), Y9 + ADDQ $0x20, BP VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -5096,7 +5790,8 @@ mulAvxTwo_5x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 2 to 6 outputs - VMOVDQU (R12)(R14*1), Y9 + VMOVDQU (SI), Y9 + ADDQ $0x20, SI VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -5138,7 +5833,8 @@ mulAvxTwo_5x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 3 to 6 outputs - VMOVDQU (R13)(R14*1), Y9 + VMOVDQU (DI), Y9 + ADDQ $0x20, DI VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -5180,7 +5876,8 @@ mulAvxTwo_5x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 4 to 6 outputs - VMOVDQU (R9)(R14*1), Y9 + VMOVDQU (DX), Y9 + ADDQ $0x20, DX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -5222,15 +5919,20 @@ mulAvxTwo_5x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - VMOVDQU Y0, (BX)(R14*1) - VMOVDQU Y1, (BP)(R14*1) - VMOVDQU Y2, (SI)(R14*1) - VMOVDQU Y3, (DI)(R14*1) - VMOVDQU Y4, (R8)(R14*1) - VMOVDQU Y5, (DX)(R14*1) + VMOVDQU Y0, (R9) + ADDQ $0x20, R9 + VMOVDQU Y1, (R10) + ADDQ $0x20, R10 + VMOVDQU Y2, (R11) + ADDQ $0x20, R11 + VMOVDQU Y3, (R12) + ADDQ $0x20, R12 + VMOVDQU Y4, (R13) + ADDQ $0x20, R13 + VMOVDQU Y5, (R8) + ADDQ $0x20, R8 // Prepare for next loop - ADDQ $0x20, R14 DECQ AX JNZ mulAvxTwo_5x6_loop VZEROUPPER @@ -5242,30 +5944,47 @@ mulAvxTwo_5x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_5x7(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 82 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_5x7_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), DX - MOVQ in_base+24(FP), R10 - MOVQ (R10), R11 - MOVQ 24(R10), R12 - MOVQ 48(R10), R13 - MOVQ 72(R10), R14 - MOVQ 96(R10), R10 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_5x7_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), DX + MOVQ out_base+48(FP), R8 + MOVQ (R8), R9 + MOVQ 24(R8), R10 + MOVQ 48(R8), R11 + MOVQ 72(R8), R12 + MOVQ 96(R8), R13 + MOVQ 120(R8), R14 + MOVQ 144(R8), R8 + MOVQ start+72(FP), R15 + + // Add start offset to output + ADDQ R15, R9 + ADDQ R15, R10 + ADDQ R15, R11 + ADDQ R15, R12 + ADDQ R15, R13 + ADDQ R15, R14 + ADDQ R15, R8 + + // Add start offset to input + ADDQ R15, BX + ADDQ R15, BP + ADDQ R15, SI + ADDQ R15, DI + ADDQ R15, DX MOVQ $0x0000000f, R15 MOVQ R15, X7 VPBROADCASTB X7, Y7 - MOVQ start+72(FP), R15 mulAvxTwo_5x7_loop: // Clear 7 outputs @@ -5278,7 +5997,8 @@ mulAvxTwo_5x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (R11)(R15*1), Y10 + VMOVDQU (BX), Y10 + ADDQ $0x20, BX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -5326,7 +6046,8 @@ mulAvxTwo_5x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (R12)(R15*1), Y10 + VMOVDQU (BP), Y10 + ADDQ $0x20, BP VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -5374,7 +6095,8 @@ mulAvxTwo_5x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 2 to 7 outputs - VMOVDQU (R13)(R15*1), Y10 + VMOVDQU (SI), Y10 + ADDQ $0x20, SI VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -5422,7 +6144,8 @@ mulAvxTwo_5x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 3 to 7 outputs - VMOVDQU (R14)(R15*1), Y10 + VMOVDQU (DI), Y10 + ADDQ $0x20, DI VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -5470,7 +6193,8 @@ mulAvxTwo_5x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 4 to 7 outputs - VMOVDQU (R10)(R15*1), Y10 + VMOVDQU (DX), Y10 + ADDQ $0x20, DX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -5518,16 +6242,22 @@ mulAvxTwo_5x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - VMOVDQU Y0, (BX)(R15*1) - VMOVDQU Y1, (BP)(R15*1) - VMOVDQU Y2, (SI)(R15*1) - VMOVDQU Y3, (DI)(R15*1) - VMOVDQU Y4, (R8)(R15*1) - VMOVDQU Y5, (R9)(R15*1) - VMOVDQU Y6, (DX)(R15*1) + VMOVDQU Y0, (R9) + ADDQ $0x20, R9 + VMOVDQU Y1, (R10) + ADDQ $0x20, R10 + VMOVDQU Y2, (R11) + ADDQ $0x20, R11 + VMOVDQU Y3, (R12) + ADDQ $0x20, R12 + VMOVDQU Y4, (R13) + ADDQ $0x20, R13 + VMOVDQU Y5, (R14) + ADDQ $0x20, R14 + VMOVDQU Y6, (R8) + ADDQ $0x20, R8 // Prepare for next loop - ADDQ $0x20, R15 DECQ AX JNZ mulAvxTwo_5x7_loop VZEROUPPER @@ -5539,23 +6269,51 @@ mulAvxTwo_5x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_5x8(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 93 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_5x8_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), BX - MOVQ $0x0000000f, R9 - MOVQ R9, X8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_5x8_end + MOVQ in_base+24(FP), AX + MOVQ (AX), DX + MOVQ 24(AX), BX + MOVQ 48(AX), BP + MOVQ 72(AX), SI + MOVQ 96(AX), AX + MOVQ out_base+48(FP), DI + MOVQ (DI), R8 + MOVQ 24(DI), R9 + MOVQ 48(DI), R10 + MOVQ 72(DI), R11 + MOVQ 96(DI), R12 + MOVQ 120(DI), R13 + MOVQ 144(DI), R14 + MOVQ 168(DI), DI + MOVQ start+72(FP), R15 + + // Add start offset to output + ADDQ R15, R8 + ADDQ R15, R9 + ADDQ R15, R10 + ADDQ R15, R11 + ADDQ R15, R12 + ADDQ R15, R13 + ADDQ R15, R14 + ADDQ R15, DI + + // Add start offset to input + ADDQ R15, DX + ADDQ R15, BX + ADDQ R15, BP + ADDQ R15, SI + ADDQ R15, AX + MOVQ $0x0000000f, R15 + MOVQ R15, X8 VPBROADCASTB X8, Y8 - MOVQ start+72(FP), R9 + MOVQ n+80(FP), R15 + SHRQ $0x05, R15 mulAvxTwo_5x8_loop: // Clear 8 outputs @@ -5569,7 +6327,8 @@ mulAvxTwo_5x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (BP)(R9*1), Y11 + VMOVDQU (DX), Y11 + ADDQ $0x20, DX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -5623,7 +6382,8 @@ mulAvxTwo_5x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (SI)(R9*1), Y11 + VMOVDQU (BX), Y11 + ADDQ $0x20, BX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -5677,7 +6437,8 @@ mulAvxTwo_5x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 2 to 8 outputs - VMOVDQU (DI)(R9*1), Y11 + VMOVDQU (BP), Y11 + ADDQ $0x20, BP VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -5731,7 +6492,8 @@ mulAvxTwo_5x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 3 to 8 outputs - VMOVDQU (R8)(R9*1), Y11 + VMOVDQU (SI), Y11 + ADDQ $0x20, SI VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -5785,7 +6547,8 @@ mulAvxTwo_5x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 4 to 8 outputs - VMOVDQU (BX)(R9*1), Y11 + VMOVDQU (AX), Y11 + ADDQ $0x20, AX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -5839,26 +6602,25 @@ mulAvxTwo_5x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - MOVQ (DX), R10 - VMOVDQU Y0, (R10)(R9*1) - MOVQ 24(DX), R10 - VMOVDQU Y1, (R10)(R9*1) - MOVQ 48(DX), R10 - VMOVDQU Y2, (R10)(R9*1) - MOVQ 72(DX), R10 - VMOVDQU Y3, (R10)(R9*1) - MOVQ 96(DX), R10 - VMOVDQU Y4, (R10)(R9*1) - MOVQ 120(DX), R10 - VMOVDQU Y5, (R10)(R9*1) - MOVQ 144(DX), R10 - VMOVDQU Y6, (R10)(R9*1) - MOVQ 168(DX), R10 - VMOVDQU Y7, (R10)(R9*1) + VMOVDQU Y0, (R8) + ADDQ $0x20, R8 + VMOVDQU Y1, (R9) + ADDQ $0x20, R9 + VMOVDQU Y2, (R10) + ADDQ $0x20, R10 + VMOVDQU Y3, (R11) + ADDQ $0x20, R11 + VMOVDQU Y4, (R12) + ADDQ $0x20, R12 + VMOVDQU Y5, (R13) + ADDQ $0x20, R13 + VMOVDQU Y6, (R14) + ADDQ $0x20, R14 + VMOVDQU Y7, (DI) + ADDQ $0x20, DI // Prepare for next loop - ADDQ $0x20, R9 - DECQ AX + DECQ R15 JNZ mulAvxTwo_5x8_loop VZEROUPPER @@ -5869,107 +6631,125 @@ mulAvxTwo_5x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_6x1(SB), $0-88 // Loading all tables to registers + // Destination kept in GP registers // Full registers estimated 16 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_6x1_end - MOVQ out_base+48(FP), DX - MOVQ (DX), DX - VMOVDQU (CX), Y1 - VMOVDQU 32(CX), Y2 - VMOVDQU 64(CX), Y3 - VMOVDQU 96(CX), Y4 - VMOVDQU 128(CX), Y5 - VMOVDQU 160(CX), Y6 - VMOVDQU 192(CX), Y7 - VMOVDQU 224(CX), Y8 - VMOVDQU 256(CX), Y9 - VMOVDQU 288(CX), Y10 - VMOVDQU 320(CX), Y11 - VMOVDQU 352(CX), Y12 - MOVQ in_base+24(FP), CX - MOVQ (CX), BX - MOVQ 24(CX), BP - MOVQ 48(CX), SI - MOVQ 72(CX), DI - MOVQ 96(CX), R8 - MOVQ 120(CX), CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_6x1_end + VMOVDQU (CX), Y0 + VMOVDQU 32(CX), Y1 + VMOVDQU 64(CX), Y2 + VMOVDQU 96(CX), Y3 + VMOVDQU 128(CX), Y4 + VMOVDQU 160(CX), Y5 + VMOVDQU 192(CX), Y6 + VMOVDQU 224(CX), Y7 + VMOVDQU 256(CX), Y8 + VMOVDQU 288(CX), Y9 + VMOVDQU 320(CX), Y10 + VMOVDQU 352(CX), Y11 + MOVQ in_base+24(FP), CX + MOVQ (CX), DX + MOVQ 24(CX), BX + MOVQ 48(CX), BP + MOVQ 72(CX), SI + MOVQ 96(CX), DI + MOVQ 120(CX), CX + MOVQ out_base+48(FP), R8 + MOVQ (R8), R8 + MOVQ start+72(FP), R9 + + // Add start offset to output + ADDQ R9, R8 + + // Add start offset to input + ADDQ R9, DX + ADDQ R9, BX + ADDQ R9, BP + ADDQ R9, SI + ADDQ R9, DI + ADDQ R9, CX MOVQ $0x0000000f, R9 MOVQ R9, X13 VPBROADCASTB X13, Y13 - MOVQ start+72(FP), R9 mulAvxTwo_6x1_loop: // Clear 1 outputs - VPXOR Y0, Y0, Y0 + VPXOR Y12, Y12, Y12 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (BX)(R9*1), Y14 + VMOVDQU (DX), Y14 + ADDQ $0x20, DX VPSRLQ $0x04, Y14, Y15 VPAND Y13, Y14, Y14 VPAND Y13, Y15, Y15 - VPSHUFB Y14, Y1, Y14 - VPSHUFB Y15, Y2, Y15 + VPSHUFB Y14, Y0, Y14 + VPSHUFB Y15, Y1, Y15 VPXOR Y14, Y15, Y14 - VPXOR Y14, Y0, Y0 + VPXOR Y14, Y12, Y12 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (BP)(R9*1), Y14 + VMOVDQU (BX), Y14 + ADDQ $0x20, BX VPSRLQ $0x04, Y14, Y15 VPAND Y13, Y14, Y14 VPAND Y13, Y15, Y15 - VPSHUFB Y14, Y3, Y14 - VPSHUFB Y15, Y4, Y15 + VPSHUFB Y14, Y2, Y14 + VPSHUFB Y15, Y3, Y15 VPXOR Y14, Y15, Y14 - VPXOR Y14, Y0, Y0 + VPXOR Y14, Y12, Y12 // Load and process 32 bytes from input 2 to 1 outputs - VMOVDQU (SI)(R9*1), Y14 + VMOVDQU (BP), Y14 + ADDQ $0x20, BP VPSRLQ $0x04, Y14, Y15 VPAND Y13, Y14, Y14 VPAND Y13, Y15, Y15 - VPSHUFB Y14, Y5, Y14 - VPSHUFB Y15, Y6, Y15 + VPSHUFB Y14, Y4, Y14 + VPSHUFB Y15, Y5, Y15 VPXOR Y14, Y15, Y14 - VPXOR Y14, Y0, Y0 + VPXOR Y14, Y12, Y12 // Load and process 32 bytes from input 3 to 1 outputs - VMOVDQU (DI)(R9*1), Y14 + VMOVDQU (SI), Y14 + ADDQ $0x20, SI VPSRLQ $0x04, Y14, Y15 VPAND Y13, Y14, Y14 VPAND Y13, Y15, Y15 - VPSHUFB Y14, Y7, Y14 - VPSHUFB Y15, Y8, Y15 + VPSHUFB Y14, Y6, Y14 + VPSHUFB Y15, Y7, Y15 VPXOR Y14, Y15, Y14 - VPXOR Y14, Y0, Y0 + VPXOR Y14, Y12, Y12 // Load and process 32 bytes from input 4 to 1 outputs - VMOVDQU (R8)(R9*1), Y14 + VMOVDQU (DI), Y14 + ADDQ $0x20, DI VPSRLQ $0x04, Y14, Y15 VPAND Y13, Y14, Y14 VPAND Y13, Y15, Y15 - VPSHUFB Y14, Y9, Y14 - VPSHUFB Y15, Y10, Y15 + VPSHUFB Y14, Y8, Y14 + VPSHUFB Y15, Y9, Y15 VPXOR Y14, Y15, Y14 - VPXOR Y14, Y0, Y0 + VPXOR Y14, Y12, Y12 // Load and process 32 bytes from input 5 to 1 outputs - VMOVDQU (CX)(R9*1), Y14 + VMOVDQU (CX), Y14 + ADDQ $0x20, CX VPSRLQ $0x04, Y14, Y15 VPAND Y13, Y14, Y14 VPAND Y13, Y15, Y15 - VPSHUFB Y14, Y11, Y14 - VPSHUFB Y15, Y12, Y15 + VPSHUFB Y14, Y10, Y14 + VPSHUFB Y15, Y11, Y15 VPXOR Y14, Y15, Y14 - VPXOR Y14, Y0, Y0 + VPXOR Y14, Y12, Y12 // Store 1 outputs - VMOVDQU Y0, (DX)(R9*1) + VMOVDQU Y12, (R8) + ADDQ $0x20, R8 // Prepare for next loop - ADDQ $0x20, R9 DECQ AX JNZ mulAvxTwo_6x1_loop VZEROUPPER @@ -5981,26 +6761,39 @@ mulAvxTwo_6x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_6x2(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 31 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_6x2_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), DX - MOVQ in_base+24(FP), BP - MOVQ (BP), SI - MOVQ 24(BP), DI - MOVQ 48(BP), R8 - MOVQ 72(BP), R9 - MOVQ 96(BP), R10 - MOVQ 120(BP), BP + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_6x2_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), DX + MOVQ out_base+48(FP), R9 + MOVQ (R9), R10 + MOVQ 24(R9), R9 + MOVQ start+72(FP), R11 + + // Add start offset to output + ADDQ R11, R10 + ADDQ R11, R9 + + // Add start offset to input + ADDQ R11, BX + ADDQ R11, BP + ADDQ R11, SI + ADDQ R11, DI + ADDQ R11, R8 + ADDQ R11, DX MOVQ $0x0000000f, R11 MOVQ R11, X2 VPBROADCASTB X2, Y2 - MOVQ start+72(FP), R11 mulAvxTwo_6x2_loop: // Clear 2 outputs @@ -6008,7 +6801,8 @@ mulAvxTwo_6x2_loop: VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (SI)(R11*1), Y5 + VMOVDQU (BX), Y5 + ADDQ $0x20, BX VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -6026,7 +6820,8 @@ mulAvxTwo_6x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (DI)(R11*1), Y5 + VMOVDQU (BP), Y5 + ADDQ $0x20, BP VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -6044,7 +6839,8 @@ mulAvxTwo_6x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 2 to 2 outputs - VMOVDQU (R8)(R11*1), Y5 + VMOVDQU (SI), Y5 + ADDQ $0x20, SI VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -6062,7 +6858,8 @@ mulAvxTwo_6x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 3 to 2 outputs - VMOVDQU (R9)(R11*1), Y5 + VMOVDQU (DI), Y5 + ADDQ $0x20, DI VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -6080,7 +6877,8 @@ mulAvxTwo_6x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 4 to 2 outputs - VMOVDQU (R10)(R11*1), Y5 + VMOVDQU (R8), Y5 + ADDQ $0x20, R8 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -6098,7 +6896,8 @@ mulAvxTwo_6x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 5 to 2 outputs - VMOVDQU (BP)(R11*1), Y5 + VMOVDQU (DX), Y5 + ADDQ $0x20, DX VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -6116,11 +6915,12 @@ mulAvxTwo_6x2_loop: VPXOR Y3, Y1, Y1 // Store 2 outputs - VMOVDQU Y0, (BX)(R11*1) - VMOVDQU Y1, (DX)(R11*1) + VMOVDQU Y0, (R10) + ADDQ $0x20, R10 + VMOVDQU Y1, (R9) + ADDQ $0x20, R9 // Prepare for next loop - ADDQ $0x20, R11 DECQ AX JNZ mulAvxTwo_6x2_loop VZEROUPPER @@ -6132,27 +6932,41 @@ mulAvxTwo_6x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_6x3(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 44 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_6x3_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), DX - MOVQ in_base+24(FP), SI - MOVQ (SI), DI - MOVQ 24(SI), R8 - MOVQ 48(SI), R9 - MOVQ 72(SI), R10 - MOVQ 96(SI), R11 - MOVQ 120(SI), SI + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_6x3_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), DX + MOVQ out_base+48(FP), R9 + MOVQ (R9), R10 + MOVQ 24(R9), R11 + MOVQ 48(R9), R9 + MOVQ start+72(FP), R12 + + // Add start offset to output + ADDQ R12, R10 + ADDQ R12, R11 + ADDQ R12, R9 + + // Add start offset to input + ADDQ R12, BX + ADDQ R12, BP + ADDQ R12, SI + ADDQ R12, DI + ADDQ R12, R8 + ADDQ R12, DX MOVQ $0x0000000f, R12 MOVQ R12, X3 VPBROADCASTB X3, Y3 - MOVQ start+72(FP), R12 mulAvxTwo_6x3_loop: // Clear 3 outputs @@ -6161,7 +6975,8 @@ mulAvxTwo_6x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (DI)(R12*1), Y6 + VMOVDQU (BX), Y6 + ADDQ $0x20, BX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -6185,7 +7000,8 @@ mulAvxTwo_6x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (R8)(R12*1), Y6 + VMOVDQU (BP), Y6 + ADDQ $0x20, BP VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -6209,7 +7025,8 @@ mulAvxTwo_6x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 2 to 3 outputs - VMOVDQU (R9)(R12*1), Y6 + VMOVDQU (SI), Y6 + ADDQ $0x20, SI VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -6233,7 +7050,8 @@ mulAvxTwo_6x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 3 to 3 outputs - VMOVDQU (R10)(R12*1), Y6 + VMOVDQU (DI), Y6 + ADDQ $0x20, DI VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -6257,7 +7075,8 @@ mulAvxTwo_6x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 4 to 3 outputs - VMOVDQU (R11)(R12*1), Y6 + VMOVDQU (R8), Y6 + ADDQ $0x20, R8 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -6281,7 +7100,8 @@ mulAvxTwo_6x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 5 to 3 outputs - VMOVDQU (SI)(R12*1), Y6 + VMOVDQU (DX), Y6 + ADDQ $0x20, DX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -6305,12 +7125,14 @@ mulAvxTwo_6x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - VMOVDQU Y0, (BX)(R12*1) - VMOVDQU Y1, (BP)(R12*1) - VMOVDQU Y2, (DX)(R12*1) + VMOVDQU Y0, (R10) + ADDQ $0x20, R10 + VMOVDQU Y1, (R11) + ADDQ $0x20, R11 + VMOVDQU Y2, (R9) + ADDQ $0x20, R9 // Prepare for next loop - ADDQ $0x20, R12 DECQ AX JNZ mulAvxTwo_6x3_loop VZEROUPPER @@ -6322,28 +7144,43 @@ mulAvxTwo_6x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_6x4(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 57 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_6x4_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DX - MOVQ in_base+24(FP), DI - MOVQ (DI), R8 - MOVQ 24(DI), R9 - MOVQ 48(DI), R10 - MOVQ 72(DI), R11 - MOVQ 96(DI), R12 - MOVQ 120(DI), DI + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_6x4_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), DX + MOVQ out_base+48(FP), R9 + MOVQ (R9), R10 + MOVQ 24(R9), R11 + MOVQ 48(R9), R12 + MOVQ 72(R9), R9 + MOVQ start+72(FP), R13 + + // Add start offset to output + ADDQ R13, R10 + ADDQ R13, R11 + ADDQ R13, R12 + ADDQ R13, R9 + + // Add start offset to input + ADDQ R13, BX + ADDQ R13, BP + ADDQ R13, SI + ADDQ R13, DI + ADDQ R13, R8 + ADDQ R13, DX MOVQ $0x0000000f, R13 MOVQ R13, X4 VPBROADCASTB X4, Y4 - MOVQ start+72(FP), R13 mulAvxTwo_6x4_loop: // Clear 4 outputs @@ -6353,7 +7190,8 @@ mulAvxTwo_6x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (R8)(R13*1), Y7 + VMOVDQU (BX), Y7 + ADDQ $0x20, BX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -6383,7 +7221,8 @@ mulAvxTwo_6x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (R9)(R13*1), Y7 + VMOVDQU (BP), Y7 + ADDQ $0x20, BP VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -6413,7 +7252,8 @@ mulAvxTwo_6x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 2 to 4 outputs - VMOVDQU (R10)(R13*1), Y7 + VMOVDQU (SI), Y7 + ADDQ $0x20, SI VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -6443,7 +7283,8 @@ mulAvxTwo_6x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 3 to 4 outputs - VMOVDQU (R11)(R13*1), Y7 + VMOVDQU (DI), Y7 + ADDQ $0x20, DI VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -6473,7 +7314,8 @@ mulAvxTwo_6x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 4 to 4 outputs - VMOVDQU (R12)(R13*1), Y7 + VMOVDQU (R8), Y7 + ADDQ $0x20, R8 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -6503,7 +7345,8 @@ mulAvxTwo_6x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 5 to 4 outputs - VMOVDQU (DI)(R13*1), Y7 + VMOVDQU (DX), Y7 + ADDQ $0x20, DX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -6533,13 +7376,16 @@ mulAvxTwo_6x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - VMOVDQU Y0, (BX)(R13*1) - VMOVDQU Y1, (BP)(R13*1) - VMOVDQU Y2, (SI)(R13*1) - VMOVDQU Y3, (DX)(R13*1) + VMOVDQU Y0, (R10) + ADDQ $0x20, R10 + VMOVDQU Y1, (R11) + ADDQ $0x20, R11 + VMOVDQU Y2, (R12) + ADDQ $0x20, R12 + VMOVDQU Y3, (R9) + ADDQ $0x20, R9 // Prepare for next loop - ADDQ $0x20, R13 DECQ AX JNZ mulAvxTwo_6x4_loop VZEROUPPER @@ -6551,29 +7397,45 @@ mulAvxTwo_6x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_6x5(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 70 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_6x5_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), DX - MOVQ in_base+24(FP), R8 - MOVQ (R8), R9 - MOVQ 24(R8), R10 - MOVQ 48(R8), R11 - MOVQ 72(R8), R12 - MOVQ 96(R8), R13 - MOVQ 120(R8), R8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_6x5_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), DX + MOVQ out_base+48(FP), R9 + MOVQ (R9), R10 + MOVQ 24(R9), R11 + MOVQ 48(R9), R12 + MOVQ 72(R9), R13 + MOVQ 96(R9), R9 + MOVQ start+72(FP), R14 + + // Add start offset to output + ADDQ R14, R10 + ADDQ R14, R11 + ADDQ R14, R12 + ADDQ R14, R13 + ADDQ R14, R9 + + // Add start offset to input + ADDQ R14, BX + ADDQ R14, BP + ADDQ R14, SI + ADDQ R14, DI + ADDQ R14, R8 + ADDQ R14, DX MOVQ $0x0000000f, R14 MOVQ R14, X5 VPBROADCASTB X5, Y5 - MOVQ start+72(FP), R14 mulAvxTwo_6x5_loop: // Clear 5 outputs @@ -6584,7 +7446,8 @@ mulAvxTwo_6x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (R9)(R14*1), Y8 + VMOVDQU (BX), Y8 + ADDQ $0x20, BX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -6620,7 +7483,8 @@ mulAvxTwo_6x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (R10)(R14*1), Y8 + VMOVDQU (BP), Y8 + ADDQ $0x20, BP VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -6656,7 +7520,8 @@ mulAvxTwo_6x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 2 to 5 outputs - VMOVDQU (R11)(R14*1), Y8 + VMOVDQU (SI), Y8 + ADDQ $0x20, SI VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -6692,7 +7557,8 @@ mulAvxTwo_6x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 3 to 5 outputs - VMOVDQU (R12)(R14*1), Y8 + VMOVDQU (DI), Y8 + ADDQ $0x20, DI VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -6728,7 +7594,8 @@ mulAvxTwo_6x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 4 to 5 outputs - VMOVDQU (R13)(R14*1), Y8 + VMOVDQU (R8), Y8 + ADDQ $0x20, R8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -6764,7 +7631,8 @@ mulAvxTwo_6x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 5 to 5 outputs - VMOVDQU (R8)(R14*1), Y8 + VMOVDQU (DX), Y8 + ADDQ $0x20, DX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -6800,14 +7668,18 @@ mulAvxTwo_6x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - VMOVDQU Y0, (BX)(R14*1) - VMOVDQU Y1, (BP)(R14*1) - VMOVDQU Y2, (SI)(R14*1) - VMOVDQU Y3, (DI)(R14*1) - VMOVDQU Y4, (DX)(R14*1) + VMOVDQU Y0, (R10) + ADDQ $0x20, R10 + VMOVDQU Y1, (R11) + ADDQ $0x20, R11 + VMOVDQU Y2, (R12) + ADDQ $0x20, R12 + VMOVDQU Y3, (R13) + ADDQ $0x20, R13 + VMOVDQU Y4, (R9) + ADDQ $0x20, R9 // Prepare for next loop - ADDQ $0x20, R14 DECQ AX JNZ mulAvxTwo_6x5_loop VZEROUPPER @@ -6819,30 +7691,47 @@ mulAvxTwo_6x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_6x6(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 83 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_6x6_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), DX - MOVQ in_base+24(FP), R9 - MOVQ (R9), R10 - MOVQ 24(R9), R11 - MOVQ 48(R9), R12 - MOVQ 72(R9), R13 - MOVQ 96(R9), R14 - MOVQ 120(R9), R9 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_6x6_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), DX + MOVQ out_base+48(FP), R9 + MOVQ (R9), R10 + MOVQ 24(R9), R11 + MOVQ 48(R9), R12 + MOVQ 72(R9), R13 + MOVQ 96(R9), R14 + MOVQ 120(R9), R9 + MOVQ start+72(FP), R15 + + // Add start offset to output + ADDQ R15, R10 + ADDQ R15, R11 + ADDQ R15, R12 + ADDQ R15, R13 + ADDQ R15, R14 + ADDQ R15, R9 + + // Add start offset to input + ADDQ R15, BX + ADDQ R15, BP + ADDQ R15, SI + ADDQ R15, DI + ADDQ R15, R8 + ADDQ R15, DX MOVQ $0x0000000f, R15 MOVQ R15, X6 VPBROADCASTB X6, Y6 - MOVQ start+72(FP), R15 mulAvxTwo_6x6_loop: // Clear 6 outputs @@ -6854,7 +7743,8 @@ mulAvxTwo_6x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (R10)(R15*1), Y9 + VMOVDQU (BX), Y9 + ADDQ $0x20, BX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -6896,7 +7786,8 @@ mulAvxTwo_6x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (R11)(R15*1), Y9 + VMOVDQU (BP), Y9 + ADDQ $0x20, BP VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -6938,7 +7829,8 @@ mulAvxTwo_6x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 2 to 6 outputs - VMOVDQU (R12)(R15*1), Y9 + VMOVDQU (SI), Y9 + ADDQ $0x20, SI VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -6980,7 +7872,8 @@ mulAvxTwo_6x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 3 to 6 outputs - VMOVDQU (R13)(R15*1), Y9 + VMOVDQU (DI), Y9 + ADDQ $0x20, DI VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -7022,7 +7915,8 @@ mulAvxTwo_6x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 4 to 6 outputs - VMOVDQU (R14)(R15*1), Y9 + VMOVDQU (R8), Y9 + ADDQ $0x20, R8 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -7064,7 +7958,8 @@ mulAvxTwo_6x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 5 to 6 outputs - VMOVDQU (R9)(R15*1), Y9 + VMOVDQU (DX), Y9 + ADDQ $0x20, DX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -7106,15 +8001,20 @@ mulAvxTwo_6x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - VMOVDQU Y0, (BX)(R15*1) - VMOVDQU Y1, (BP)(R15*1) - VMOVDQU Y2, (SI)(R15*1) - VMOVDQU Y3, (DI)(R15*1) - VMOVDQU Y4, (R8)(R15*1) - VMOVDQU Y5, (DX)(R15*1) + VMOVDQU Y0, (R10) + ADDQ $0x20, R10 + VMOVDQU Y1, (R11) + ADDQ $0x20, R11 + VMOVDQU Y2, (R12) + ADDQ $0x20, R12 + VMOVDQU Y3, (R13) + ADDQ $0x20, R13 + VMOVDQU Y4, (R14) + ADDQ $0x20, R14 + VMOVDQU Y5, (R9) + ADDQ $0x20, R9 // Prepare for next loop - ADDQ $0x20, R15 DECQ AX JNZ mulAvxTwo_6x6_loop VZEROUPPER @@ -7126,24 +8026,51 @@ mulAvxTwo_6x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_6x7(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 96 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_6x7_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), BX - MOVQ $0x0000000f, R10 - MOVQ R10, X7 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_6x7_end + MOVQ in_base+24(FP), AX + MOVQ (AX), DX + MOVQ 24(AX), BX + MOVQ 48(AX), BP + MOVQ 72(AX), SI + MOVQ 96(AX), DI + MOVQ 120(AX), AX + MOVQ out_base+48(FP), R8 + MOVQ (R8), R9 + MOVQ 24(R8), R10 + MOVQ 48(R8), R11 + MOVQ 72(R8), R12 + MOVQ 96(R8), R13 + MOVQ 120(R8), R14 + MOVQ 144(R8), R8 + MOVQ start+72(FP), R15 + + // Add start offset to output + ADDQ R15, R9 + ADDQ R15, R10 + ADDQ R15, R11 + ADDQ R15, R12 + ADDQ R15, R13 + ADDQ R15, R14 + ADDQ R15, R8 + + // Add start offset to input + ADDQ R15, DX + ADDQ R15, BX + ADDQ R15, BP + ADDQ R15, SI + ADDQ R15, DI + ADDQ R15, AX + MOVQ $0x0000000f, R15 + MOVQ R15, X7 VPBROADCASTB X7, Y7 - MOVQ start+72(FP), R10 + MOVQ n+80(FP), R15 + SHRQ $0x05, R15 mulAvxTwo_6x7_loop: // Clear 7 outputs @@ -7156,7 +8083,8 @@ mulAvxTwo_6x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (BP)(R10*1), Y10 + VMOVDQU (DX), Y10 + ADDQ $0x20, DX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -7204,7 +8132,8 @@ mulAvxTwo_6x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (SI)(R10*1), Y10 + VMOVDQU (BX), Y10 + ADDQ $0x20, BX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -7252,7 +8181,8 @@ mulAvxTwo_6x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 2 to 7 outputs - VMOVDQU (DI)(R10*1), Y10 + VMOVDQU (BP), Y10 + ADDQ $0x20, BP VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -7300,7 +8230,8 @@ mulAvxTwo_6x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 3 to 7 outputs - VMOVDQU (R8)(R10*1), Y10 + VMOVDQU (SI), Y10 + ADDQ $0x20, SI VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -7348,7 +8279,8 @@ mulAvxTwo_6x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 4 to 7 outputs - VMOVDQU (R9)(R10*1), Y10 + VMOVDQU (DI), Y10 + ADDQ $0x20, DI VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -7396,7 +8328,8 @@ mulAvxTwo_6x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 5 to 7 outputs - VMOVDQU (BX)(R10*1), Y10 + VMOVDQU (AX), Y10 + ADDQ $0x20, AX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -7444,24 +8377,23 @@ mulAvxTwo_6x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - MOVQ (DX), R11 - VMOVDQU Y0, (R11)(R10*1) - MOVQ 24(DX), R11 - VMOVDQU Y1, (R11)(R10*1) - MOVQ 48(DX), R11 - VMOVDQU Y2, (R11)(R10*1) - MOVQ 72(DX), R11 - VMOVDQU Y3, (R11)(R10*1) - MOVQ 96(DX), R11 - VMOVDQU Y4, (R11)(R10*1) - MOVQ 120(DX), R11 - VMOVDQU Y5, (R11)(R10*1) - MOVQ 144(DX), R11 - VMOVDQU Y6, (R11)(R10*1) + VMOVDQU Y0, (R9) + ADDQ $0x20, R9 + VMOVDQU Y1, (R10) + ADDQ $0x20, R10 + VMOVDQU Y2, (R11) + ADDQ $0x20, R11 + VMOVDQU Y3, (R12) + ADDQ $0x20, R12 + VMOVDQU Y4, (R13) + ADDQ $0x20, R13 + VMOVDQU Y5, (R14) + ADDQ $0x20, R14 + VMOVDQU Y6, (R8) + ADDQ $0x20, R8 // Prepare for next loop - ADDQ $0x20, R10 - DECQ AX + DECQ R15 JNZ mulAvxTwo_6x7_loop VZEROUPPER @@ -7472,24 +8404,33 @@ mulAvxTwo_6x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_6x8(SB), $0-88 // Loading no tables to registers + // Destination kept on stack // Full registers estimated 109 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_6x8_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), BX - MOVQ $0x0000000f, R10 - MOVQ R10, X8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_6x8_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), DX + MOVQ out_base+48(FP), R9 + MOVQ start+72(FP), R10 + + // Add start offset to input + ADDQ R10, BX + ADDQ R10, BP + ADDQ R10, SI + ADDQ R10, DI + ADDQ R10, R8 + ADDQ R10, DX + MOVQ $0x0000000f, R11 + MOVQ R11, X8 VPBROADCASTB X8, Y8 - MOVQ start+72(FP), R10 mulAvxTwo_6x8_loop: // Clear 8 outputs @@ -7503,7 +8444,8 @@ mulAvxTwo_6x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (BP)(R10*1), Y11 + VMOVDQU (BX), Y11 + ADDQ $0x20, BX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -7557,7 +8499,8 @@ mulAvxTwo_6x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (SI)(R10*1), Y11 + VMOVDQU (BP), Y11 + ADDQ $0x20, BP VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -7611,7 +8554,8 @@ mulAvxTwo_6x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 2 to 8 outputs - VMOVDQU (DI)(R10*1), Y11 + VMOVDQU (SI), Y11 + ADDQ $0x20, SI VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -7665,7 +8609,8 @@ mulAvxTwo_6x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 3 to 8 outputs - VMOVDQU (R8)(R10*1), Y11 + VMOVDQU (DI), Y11 + ADDQ $0x20, DI VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -7719,7 +8664,8 @@ mulAvxTwo_6x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 4 to 8 outputs - VMOVDQU (R9)(R10*1), Y11 + VMOVDQU (R8), Y11 + ADDQ $0x20, R8 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -7773,7 +8719,8 @@ mulAvxTwo_6x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 5 to 8 outputs - VMOVDQU (BX)(R10*1), Y11 + VMOVDQU (DX), Y11 + ADDQ $0x20, DX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -7827,21 +8774,21 @@ mulAvxTwo_6x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - MOVQ (DX), R11 + MOVQ (R9), R11 VMOVDQU Y0, (R11)(R10*1) - MOVQ 24(DX), R11 + MOVQ 24(R9), R11 VMOVDQU Y1, (R11)(R10*1) - MOVQ 48(DX), R11 + MOVQ 48(R9), R11 VMOVDQU Y2, (R11)(R10*1) - MOVQ 72(DX), R11 + MOVQ 72(R9), R11 VMOVDQU Y3, (R11)(R10*1) - MOVQ 96(DX), R11 + MOVQ 96(R9), R11 VMOVDQU Y4, (R11)(R10*1) - MOVQ 120(DX), R11 + MOVQ 120(R9), R11 VMOVDQU Y5, (R11)(R10*1) - MOVQ 144(DX), R11 + MOVQ 144(R9), R11 VMOVDQU Y6, (R11)(R10*1) - MOVQ 168(DX), R11 + MOVQ 168(R9), R11 VMOVDQU Y7, (R11)(R10*1) // Prepare for next loop @@ -7857,33 +8804,47 @@ mulAvxTwo_6x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_7x1(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 18 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_7x1_end - MOVQ out_base+48(FP), DX - MOVQ (DX), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), BX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_7x1_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), DX + MOVQ out_base+48(FP), R10 + MOVQ (R10), R10 + MOVQ start+72(FP), R11 + + // Add start offset to output + ADDQ R11, R10 + + // Add start offset to input + ADDQ R11, BX + ADDQ R11, BP + ADDQ R11, SI + ADDQ R11, DI + ADDQ R11, R8 + ADDQ R11, R9 + ADDQ R11, DX MOVQ $0x0000000f, R11 MOVQ R11, X1 VPBROADCASTB X1, Y1 - MOVQ start+72(FP), R11 mulAvxTwo_7x1_loop: // Clear 1 outputs VPXOR Y0, Y0, Y0 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (BP)(R11*1), Y4 + VMOVDQU (BX), Y4 + ADDQ $0x20, BX VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -7895,7 +8856,8 @@ mulAvxTwo_7x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (SI)(R11*1), Y4 + VMOVDQU (BP), Y4 + ADDQ $0x20, BP VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -7907,7 +8869,8 @@ mulAvxTwo_7x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 2 to 1 outputs - VMOVDQU (DI)(R11*1), Y4 + VMOVDQU (SI), Y4 + ADDQ $0x20, SI VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -7919,7 +8882,8 @@ mulAvxTwo_7x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 3 to 1 outputs - VMOVDQU (R8)(R11*1), Y4 + VMOVDQU (DI), Y4 + ADDQ $0x20, DI VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -7931,7 +8895,8 @@ mulAvxTwo_7x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 4 to 1 outputs - VMOVDQU (R9)(R11*1), Y4 + VMOVDQU (R8), Y4 + ADDQ $0x20, R8 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -7943,7 +8908,8 @@ mulAvxTwo_7x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 5 to 1 outputs - VMOVDQU (R10)(R11*1), Y4 + VMOVDQU (R9), Y4 + ADDQ $0x20, R9 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -7955,7 +8921,8 @@ mulAvxTwo_7x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 6 to 1 outputs - VMOVDQU (BX)(R11*1), Y4 + VMOVDQU (DX), Y4 + ADDQ $0x20, DX VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -7967,10 +8934,10 @@ mulAvxTwo_7x1_loop: VPXOR Y2, Y0, Y0 // Store 1 outputs - VMOVDQU Y0, (DX)(R11*1) + VMOVDQU Y0, (R10) + ADDQ $0x20, R10 // Prepare for next loop - ADDQ $0x20, R11 DECQ AX JNZ mulAvxTwo_7x1_loop VZEROUPPER @@ -7982,27 +8949,41 @@ mulAvxTwo_7x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_7x2(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 35 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_7x2_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), DX - MOVQ in_base+24(FP), BP - MOVQ (BP), SI - MOVQ 24(BP), DI - MOVQ 48(BP), R8 - MOVQ 72(BP), R9 - MOVQ 96(BP), R10 - MOVQ 120(BP), R11 - MOVQ 144(BP), BP + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_7x2_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), DX + MOVQ out_base+48(FP), R10 + MOVQ (R10), R11 + MOVQ 24(R10), R10 + MOVQ start+72(FP), R12 + + // Add start offset to output + ADDQ R12, R11 + ADDQ R12, R10 + + // Add start offset to input + ADDQ R12, BX + ADDQ R12, BP + ADDQ R12, SI + ADDQ R12, DI + ADDQ R12, R8 + ADDQ R12, R9 + ADDQ R12, DX MOVQ $0x0000000f, R12 MOVQ R12, X2 VPBROADCASTB X2, Y2 - MOVQ start+72(FP), R12 mulAvxTwo_7x2_loop: // Clear 2 outputs @@ -8010,7 +8991,8 @@ mulAvxTwo_7x2_loop: VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (SI)(R12*1), Y5 + VMOVDQU (BX), Y5 + ADDQ $0x20, BX VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -8028,7 +9010,8 @@ mulAvxTwo_7x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (DI)(R12*1), Y5 + VMOVDQU (BP), Y5 + ADDQ $0x20, BP VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -8046,7 +9029,8 @@ mulAvxTwo_7x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 2 to 2 outputs - VMOVDQU (R8)(R12*1), Y5 + VMOVDQU (SI), Y5 + ADDQ $0x20, SI VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -8064,7 +9048,8 @@ mulAvxTwo_7x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 3 to 2 outputs - VMOVDQU (R9)(R12*1), Y5 + VMOVDQU (DI), Y5 + ADDQ $0x20, DI VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -8082,7 +9067,8 @@ mulAvxTwo_7x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 4 to 2 outputs - VMOVDQU (R10)(R12*1), Y5 + VMOVDQU (R8), Y5 + ADDQ $0x20, R8 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -8100,7 +9086,8 @@ mulAvxTwo_7x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 5 to 2 outputs - VMOVDQU (R11)(R12*1), Y5 + VMOVDQU (R9), Y5 + ADDQ $0x20, R9 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -8118,7 +9105,8 @@ mulAvxTwo_7x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 6 to 2 outputs - VMOVDQU (BP)(R12*1), Y5 + VMOVDQU (DX), Y5 + ADDQ $0x20, DX VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -8136,11 +9124,12 @@ mulAvxTwo_7x2_loop: VPXOR Y3, Y1, Y1 // Store 2 outputs - VMOVDQU Y0, (BX)(R12*1) - VMOVDQU Y1, (DX)(R12*1) + VMOVDQU Y0, (R11) + ADDQ $0x20, R11 + VMOVDQU Y1, (R10) + ADDQ $0x20, R10 // Prepare for next loop - ADDQ $0x20, R12 DECQ AX JNZ mulAvxTwo_7x2_loop VZEROUPPER @@ -8152,28 +9141,43 @@ mulAvxTwo_7x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_7x3(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 50 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_7x3_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), DX - MOVQ in_base+24(FP), SI - MOVQ (SI), DI - MOVQ 24(SI), R8 - MOVQ 48(SI), R9 - MOVQ 72(SI), R10 - MOVQ 96(SI), R11 - MOVQ 120(SI), R12 - MOVQ 144(SI), SI + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_7x3_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), DX + MOVQ out_base+48(FP), R10 + MOVQ (R10), R11 + MOVQ 24(R10), R12 + MOVQ 48(R10), R10 + MOVQ start+72(FP), R13 + + // Add start offset to output + ADDQ R13, R11 + ADDQ R13, R12 + ADDQ R13, R10 + + // Add start offset to input + ADDQ R13, BX + ADDQ R13, BP + ADDQ R13, SI + ADDQ R13, DI + ADDQ R13, R8 + ADDQ R13, R9 + ADDQ R13, DX MOVQ $0x0000000f, R13 MOVQ R13, X3 VPBROADCASTB X3, Y3 - MOVQ start+72(FP), R13 mulAvxTwo_7x3_loop: // Clear 3 outputs @@ -8182,7 +9186,8 @@ mulAvxTwo_7x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (DI)(R13*1), Y6 + VMOVDQU (BX), Y6 + ADDQ $0x20, BX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -8206,7 +9211,8 @@ mulAvxTwo_7x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (R8)(R13*1), Y6 + VMOVDQU (BP), Y6 + ADDQ $0x20, BP VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -8230,7 +9236,8 @@ mulAvxTwo_7x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 2 to 3 outputs - VMOVDQU (R9)(R13*1), Y6 + VMOVDQU (SI), Y6 + ADDQ $0x20, SI VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -8254,7 +9261,8 @@ mulAvxTwo_7x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 3 to 3 outputs - VMOVDQU (R10)(R13*1), Y6 + VMOVDQU (DI), Y6 + ADDQ $0x20, DI VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -8278,7 +9286,8 @@ mulAvxTwo_7x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 4 to 3 outputs - VMOVDQU (R11)(R13*1), Y6 + VMOVDQU (R8), Y6 + ADDQ $0x20, R8 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -8302,7 +9311,8 @@ mulAvxTwo_7x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 5 to 3 outputs - VMOVDQU (R12)(R13*1), Y6 + VMOVDQU (R9), Y6 + ADDQ $0x20, R9 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -8326,7 +9336,8 @@ mulAvxTwo_7x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 6 to 3 outputs - VMOVDQU (SI)(R13*1), Y6 + VMOVDQU (DX), Y6 + ADDQ $0x20, DX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -8350,12 +9361,14 @@ mulAvxTwo_7x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - VMOVDQU Y0, (BX)(R13*1) - VMOVDQU Y1, (BP)(R13*1) - VMOVDQU Y2, (DX)(R13*1) + VMOVDQU Y0, (R11) + ADDQ $0x20, R11 + VMOVDQU Y1, (R12) + ADDQ $0x20, R12 + VMOVDQU Y2, (R10) + ADDQ $0x20, R10 // Prepare for next loop - ADDQ $0x20, R13 DECQ AX JNZ mulAvxTwo_7x3_loop VZEROUPPER @@ -8367,29 +9380,45 @@ mulAvxTwo_7x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_7x4(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 65 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_7x4_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DX - MOVQ in_base+24(FP), DI - MOVQ (DI), R8 - MOVQ 24(DI), R9 - MOVQ 48(DI), R10 - MOVQ 72(DI), R11 - MOVQ 96(DI), R12 - MOVQ 120(DI), R13 - MOVQ 144(DI), DI + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_7x4_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), DX + MOVQ out_base+48(FP), R10 + MOVQ (R10), R11 + MOVQ 24(R10), R12 + MOVQ 48(R10), R13 + MOVQ 72(R10), R10 + MOVQ start+72(FP), R14 + + // Add start offset to output + ADDQ R14, R11 + ADDQ R14, R12 + ADDQ R14, R13 + ADDQ R14, R10 + + // Add start offset to input + ADDQ R14, BX + ADDQ R14, BP + ADDQ R14, SI + ADDQ R14, DI + ADDQ R14, R8 + ADDQ R14, R9 + ADDQ R14, DX MOVQ $0x0000000f, R14 MOVQ R14, X4 VPBROADCASTB X4, Y4 - MOVQ start+72(FP), R14 mulAvxTwo_7x4_loop: // Clear 4 outputs @@ -8399,7 +9428,8 @@ mulAvxTwo_7x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (R8)(R14*1), Y7 + VMOVDQU (BX), Y7 + ADDQ $0x20, BX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -8429,7 +9459,8 @@ mulAvxTwo_7x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (R9)(R14*1), Y7 + VMOVDQU (BP), Y7 + ADDQ $0x20, BP VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -8459,7 +9490,8 @@ mulAvxTwo_7x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 2 to 4 outputs - VMOVDQU (R10)(R14*1), Y7 + VMOVDQU (SI), Y7 + ADDQ $0x20, SI VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -8489,7 +9521,8 @@ mulAvxTwo_7x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 3 to 4 outputs - VMOVDQU (R11)(R14*1), Y7 + VMOVDQU (DI), Y7 + ADDQ $0x20, DI VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -8519,7 +9552,8 @@ mulAvxTwo_7x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 4 to 4 outputs - VMOVDQU (R12)(R14*1), Y7 + VMOVDQU (R8), Y7 + ADDQ $0x20, R8 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -8549,7 +9583,8 @@ mulAvxTwo_7x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 5 to 4 outputs - VMOVDQU (R13)(R14*1), Y7 + VMOVDQU (R9), Y7 + ADDQ $0x20, R9 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -8579,7 +9614,8 @@ mulAvxTwo_7x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 6 to 4 outputs - VMOVDQU (DI)(R14*1), Y7 + VMOVDQU (DX), Y7 + ADDQ $0x20, DX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -8609,13 +9645,16 @@ mulAvxTwo_7x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - VMOVDQU Y0, (BX)(R14*1) - VMOVDQU Y1, (BP)(R14*1) - VMOVDQU Y2, (SI)(R14*1) - VMOVDQU Y3, (DX)(R14*1) + VMOVDQU Y0, (R11) + ADDQ $0x20, R11 + VMOVDQU Y1, (R12) + ADDQ $0x20, R12 + VMOVDQU Y2, (R13) + ADDQ $0x20, R13 + VMOVDQU Y3, (R10) + ADDQ $0x20, R10 // Prepare for next loop - ADDQ $0x20, R14 DECQ AX JNZ mulAvxTwo_7x4_loop VZEROUPPER @@ -8627,30 +9666,47 @@ mulAvxTwo_7x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_7x5(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 80 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_7x5_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), DX - MOVQ in_base+24(FP), R8 - MOVQ (R8), R9 - MOVQ 24(R8), R10 - MOVQ 48(R8), R11 - MOVQ 72(R8), R12 - MOVQ 96(R8), R13 - MOVQ 120(R8), R14 - MOVQ 144(R8), R8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_7x5_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), DX + MOVQ out_base+48(FP), R10 + MOVQ (R10), R11 + MOVQ 24(R10), R12 + MOVQ 48(R10), R13 + MOVQ 72(R10), R14 + MOVQ 96(R10), R10 + MOVQ start+72(FP), R15 + + // Add start offset to output + ADDQ R15, R11 + ADDQ R15, R12 + ADDQ R15, R13 + ADDQ R15, R14 + ADDQ R15, R10 + + // Add start offset to input + ADDQ R15, BX + ADDQ R15, BP + ADDQ R15, SI + ADDQ R15, DI + ADDQ R15, R8 + ADDQ R15, R9 + ADDQ R15, DX MOVQ $0x0000000f, R15 MOVQ R15, X5 VPBROADCASTB X5, Y5 - MOVQ start+72(FP), R15 mulAvxTwo_7x5_loop: // Clear 5 outputs @@ -8661,7 +9717,8 @@ mulAvxTwo_7x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (R9)(R15*1), Y8 + VMOVDQU (BX), Y8 + ADDQ $0x20, BX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -8697,7 +9754,8 @@ mulAvxTwo_7x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (R10)(R15*1), Y8 + VMOVDQU (BP), Y8 + ADDQ $0x20, BP VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -8733,7 +9791,8 @@ mulAvxTwo_7x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 2 to 5 outputs - VMOVDQU (R11)(R15*1), Y8 + VMOVDQU (SI), Y8 + ADDQ $0x20, SI VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -8769,7 +9828,8 @@ mulAvxTwo_7x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 3 to 5 outputs - VMOVDQU (R12)(R15*1), Y8 + VMOVDQU (DI), Y8 + ADDQ $0x20, DI VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -8805,7 +9865,8 @@ mulAvxTwo_7x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 4 to 5 outputs - VMOVDQU (R13)(R15*1), Y8 + VMOVDQU (R8), Y8 + ADDQ $0x20, R8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -8841,7 +9902,8 @@ mulAvxTwo_7x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 5 to 5 outputs - VMOVDQU (R14)(R15*1), Y8 + VMOVDQU (R9), Y8 + ADDQ $0x20, R9 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -8877,7 +9939,8 @@ mulAvxTwo_7x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 6 to 5 outputs - VMOVDQU (R8)(R15*1), Y8 + VMOVDQU (DX), Y8 + ADDQ $0x20, DX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -8913,14 +9976,18 @@ mulAvxTwo_7x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - VMOVDQU Y0, (BX)(R15*1) - VMOVDQU Y1, (BP)(R15*1) - VMOVDQU Y2, (SI)(R15*1) - VMOVDQU Y3, (DI)(R15*1) - VMOVDQU Y4, (DX)(R15*1) + VMOVDQU Y0, (R11) + ADDQ $0x20, R11 + VMOVDQU Y1, (R12) + ADDQ $0x20, R12 + VMOVDQU Y2, (R13) + ADDQ $0x20, R13 + VMOVDQU Y3, (R14) + ADDQ $0x20, R14 + VMOVDQU Y4, (R10) + ADDQ $0x20, R10 // Prepare for next loop - ADDQ $0x20, R15 DECQ AX JNZ mulAvxTwo_7x5_loop VZEROUPPER @@ -8932,25 +9999,51 @@ mulAvxTwo_7x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_7x6(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 95 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_7x6_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), BX - MOVQ $0x0000000f, R11 - MOVQ R11, X6 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_7x6_end + MOVQ in_base+24(FP), AX + MOVQ (AX), DX + MOVQ 24(AX), BX + MOVQ 48(AX), BP + MOVQ 72(AX), SI + MOVQ 96(AX), DI + MOVQ 120(AX), R8 + MOVQ 144(AX), AX + MOVQ out_base+48(FP), R9 + MOVQ (R9), R10 + MOVQ 24(R9), R11 + MOVQ 48(R9), R12 + MOVQ 72(R9), R13 + MOVQ 96(R9), R14 + MOVQ 120(R9), R9 + MOVQ start+72(FP), R15 + + // Add start offset to output + ADDQ R15, R10 + ADDQ R15, R11 + ADDQ R15, R12 + ADDQ R15, R13 + ADDQ R15, R14 + ADDQ R15, R9 + + // Add start offset to input + ADDQ R15, DX + ADDQ R15, BX + ADDQ R15, BP + ADDQ R15, SI + ADDQ R15, DI + ADDQ R15, R8 + ADDQ R15, AX + MOVQ $0x0000000f, R15 + MOVQ R15, X6 VPBROADCASTB X6, Y6 - MOVQ start+72(FP), R11 + MOVQ n+80(FP), R15 + SHRQ $0x05, R15 mulAvxTwo_7x6_loop: // Clear 6 outputs @@ -8962,7 +10055,8 @@ mulAvxTwo_7x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (BP)(R11*1), Y9 + VMOVDQU (DX), Y9 + ADDQ $0x20, DX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -9004,7 +10098,8 @@ mulAvxTwo_7x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (SI)(R11*1), Y9 + VMOVDQU (BX), Y9 + ADDQ $0x20, BX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -9046,7 +10141,8 @@ mulAvxTwo_7x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 2 to 6 outputs - VMOVDQU (DI)(R11*1), Y9 + VMOVDQU (BP), Y9 + ADDQ $0x20, BP VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -9088,7 +10184,8 @@ mulAvxTwo_7x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 3 to 6 outputs - VMOVDQU (R8)(R11*1), Y9 + VMOVDQU (SI), Y9 + ADDQ $0x20, SI VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -9130,7 +10227,8 @@ mulAvxTwo_7x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 4 to 6 outputs - VMOVDQU (R9)(R11*1), Y9 + VMOVDQU (DI), Y9 + ADDQ $0x20, DI VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -9172,7 +10270,8 @@ mulAvxTwo_7x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 5 to 6 outputs - VMOVDQU (R10)(R11*1), Y9 + VMOVDQU (R8), Y9 + ADDQ $0x20, R8 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -9214,7 +10313,8 @@ mulAvxTwo_7x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 6 to 6 outputs - VMOVDQU (BX)(R11*1), Y9 + VMOVDQU (AX), Y9 + ADDQ $0x20, AX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -9256,22 +10356,21 @@ mulAvxTwo_7x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - MOVQ (DX), R12 - VMOVDQU Y0, (R12)(R11*1) - MOVQ 24(DX), R12 - VMOVDQU Y1, (R12)(R11*1) - MOVQ 48(DX), R12 - VMOVDQU Y2, (R12)(R11*1) - MOVQ 72(DX), R12 - VMOVDQU Y3, (R12)(R11*1) - MOVQ 96(DX), R12 - VMOVDQU Y4, (R12)(R11*1) - MOVQ 120(DX), R12 - VMOVDQU Y5, (R12)(R11*1) + VMOVDQU Y0, (R10) + ADDQ $0x20, R10 + VMOVDQU Y1, (R11) + ADDQ $0x20, R11 + VMOVDQU Y2, (R12) + ADDQ $0x20, R12 + VMOVDQU Y3, (R13) + ADDQ $0x20, R13 + VMOVDQU Y4, (R14) + ADDQ $0x20, R14 + VMOVDQU Y5, (R9) + ADDQ $0x20, R9 // Prepare for next loop - ADDQ $0x20, R11 - DECQ AX + DECQ R15 JNZ mulAvxTwo_7x6_loop VZEROUPPER @@ -9282,25 +10381,35 @@ mulAvxTwo_7x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_7x7(SB), $0-88 // Loading no tables to registers + // Destination kept on stack // Full registers estimated 110 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_7x7_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), BX - MOVQ $0x0000000f, R11 - MOVQ R11, X7 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_7x7_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), DX + MOVQ out_base+48(FP), R10 + MOVQ start+72(FP), R11 + + // Add start offset to input + ADDQ R11, BX + ADDQ R11, BP + ADDQ R11, SI + ADDQ R11, DI + ADDQ R11, R8 + ADDQ R11, R9 + ADDQ R11, DX + MOVQ $0x0000000f, R12 + MOVQ R12, X7 VPBROADCASTB X7, Y7 - MOVQ start+72(FP), R11 mulAvxTwo_7x7_loop: // Clear 7 outputs @@ -9313,7 +10422,8 @@ mulAvxTwo_7x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (BP)(R11*1), Y10 + VMOVDQU (BX), Y10 + ADDQ $0x20, BX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -9361,7 +10471,8 @@ mulAvxTwo_7x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (SI)(R11*1), Y10 + VMOVDQU (BP), Y10 + ADDQ $0x20, BP VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -9409,7 +10520,8 @@ mulAvxTwo_7x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 2 to 7 outputs - VMOVDQU (DI)(R11*1), Y10 + VMOVDQU (SI), Y10 + ADDQ $0x20, SI VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -9457,7 +10569,8 @@ mulAvxTwo_7x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 3 to 7 outputs - VMOVDQU (R8)(R11*1), Y10 + VMOVDQU (DI), Y10 + ADDQ $0x20, DI VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -9505,7 +10618,8 @@ mulAvxTwo_7x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 4 to 7 outputs - VMOVDQU (R9)(R11*1), Y10 + VMOVDQU (R8), Y10 + ADDQ $0x20, R8 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -9553,7 +10667,8 @@ mulAvxTwo_7x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 5 to 7 outputs - VMOVDQU (R10)(R11*1), Y10 + VMOVDQU (R9), Y10 + ADDQ $0x20, R9 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -9601,7 +10716,8 @@ mulAvxTwo_7x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 6 to 7 outputs - VMOVDQU (BX)(R11*1), Y10 + VMOVDQU (DX), Y10 + ADDQ $0x20, DX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -9649,19 +10765,19 @@ mulAvxTwo_7x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - MOVQ (DX), R12 + MOVQ (R10), R12 VMOVDQU Y0, (R12)(R11*1) - MOVQ 24(DX), R12 + MOVQ 24(R10), R12 VMOVDQU Y1, (R12)(R11*1) - MOVQ 48(DX), R12 + MOVQ 48(R10), R12 VMOVDQU Y2, (R12)(R11*1) - MOVQ 72(DX), R12 + MOVQ 72(R10), R12 VMOVDQU Y3, (R12)(R11*1) - MOVQ 96(DX), R12 + MOVQ 96(R10), R12 VMOVDQU Y4, (R12)(R11*1) - MOVQ 120(DX), R12 + MOVQ 120(R10), R12 VMOVDQU Y5, (R12)(R11*1) - MOVQ 144(DX), R12 + MOVQ 144(R10), R12 VMOVDQU Y6, (R12)(R11*1) // Prepare for next loop @@ -9677,25 +10793,35 @@ mulAvxTwo_7x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_7x8(SB), $0-88 // Loading no tables to registers + // Destination kept on stack // Full registers estimated 125 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_7x8_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), BX - MOVQ $0x0000000f, R11 - MOVQ R11, X8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_7x8_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), DX + MOVQ out_base+48(FP), R10 + MOVQ start+72(FP), R11 + + // Add start offset to input + ADDQ R11, BX + ADDQ R11, BP + ADDQ R11, SI + ADDQ R11, DI + ADDQ R11, R8 + ADDQ R11, R9 + ADDQ R11, DX + MOVQ $0x0000000f, R12 + MOVQ R12, X8 VPBROADCASTB X8, Y8 - MOVQ start+72(FP), R11 mulAvxTwo_7x8_loop: // Clear 8 outputs @@ -9709,7 +10835,8 @@ mulAvxTwo_7x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (BP)(R11*1), Y11 + VMOVDQU (BX), Y11 + ADDQ $0x20, BX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -9763,7 +10890,8 @@ mulAvxTwo_7x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (SI)(R11*1), Y11 + VMOVDQU (BP), Y11 + ADDQ $0x20, BP VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -9817,7 +10945,8 @@ mulAvxTwo_7x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 2 to 8 outputs - VMOVDQU (DI)(R11*1), Y11 + VMOVDQU (SI), Y11 + ADDQ $0x20, SI VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -9871,7 +11000,8 @@ mulAvxTwo_7x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 3 to 8 outputs - VMOVDQU (R8)(R11*1), Y11 + VMOVDQU (DI), Y11 + ADDQ $0x20, DI VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -9925,7 +11055,8 @@ mulAvxTwo_7x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 4 to 8 outputs - VMOVDQU (R9)(R11*1), Y11 + VMOVDQU (R8), Y11 + ADDQ $0x20, R8 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -9979,7 +11110,8 @@ mulAvxTwo_7x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 5 to 8 outputs - VMOVDQU (R10)(R11*1), Y11 + VMOVDQU (R9), Y11 + ADDQ $0x20, R9 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -10033,7 +11165,8 @@ mulAvxTwo_7x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 6 to 8 outputs - VMOVDQU (BX)(R11*1), Y11 + VMOVDQU (DX), Y11 + ADDQ $0x20, DX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -10087,21 +11220,21 @@ mulAvxTwo_7x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - MOVQ (DX), R12 + MOVQ (R10), R12 VMOVDQU Y0, (R12)(R11*1) - MOVQ 24(DX), R12 + MOVQ 24(R10), R12 VMOVDQU Y1, (R12)(R11*1) - MOVQ 48(DX), R12 + MOVQ 48(R10), R12 VMOVDQU Y2, (R12)(R11*1) - MOVQ 72(DX), R12 + MOVQ 72(R10), R12 VMOVDQU Y3, (R12)(R11*1) - MOVQ 96(DX), R12 + MOVQ 96(R10), R12 VMOVDQU Y4, (R12)(R11*1) - MOVQ 120(DX), R12 + MOVQ 120(R10), R12 VMOVDQU Y5, (R12)(R11*1) - MOVQ 144(DX), R12 + MOVQ 144(R10), R12 VMOVDQU Y6, (R12)(R11*1) - MOVQ 168(DX), R12 + MOVQ 168(R10), R12 VMOVDQU Y7, (R12)(R11*1) // Prepare for next loop @@ -10117,34 +11250,49 @@ mulAvxTwo_7x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_8x1(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 20 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_8x1_end - MOVQ out_base+48(FP), DX - MOVQ (DX), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), BX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_8x1_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), DX + MOVQ out_base+48(FP), R11 + MOVQ (R11), R11 + MOVQ start+72(FP), R12 + + // Add start offset to output + ADDQ R12, R11 + + // Add start offset to input + ADDQ R12, BX + ADDQ R12, BP + ADDQ R12, SI + ADDQ R12, DI + ADDQ R12, R8 + ADDQ R12, R9 + ADDQ R12, R10 + ADDQ R12, DX MOVQ $0x0000000f, R12 MOVQ R12, X1 VPBROADCASTB X1, Y1 - MOVQ start+72(FP), R12 mulAvxTwo_8x1_loop: // Clear 1 outputs VPXOR Y0, Y0, Y0 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (BP)(R12*1), Y4 + VMOVDQU (BX), Y4 + ADDQ $0x20, BX VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -10156,7 +11304,8 @@ mulAvxTwo_8x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (SI)(R12*1), Y4 + VMOVDQU (BP), Y4 + ADDQ $0x20, BP VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -10168,7 +11317,8 @@ mulAvxTwo_8x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 2 to 1 outputs - VMOVDQU (DI)(R12*1), Y4 + VMOVDQU (SI), Y4 + ADDQ $0x20, SI VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -10180,7 +11330,8 @@ mulAvxTwo_8x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 3 to 1 outputs - VMOVDQU (R8)(R12*1), Y4 + VMOVDQU (DI), Y4 + ADDQ $0x20, DI VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -10192,7 +11343,8 @@ mulAvxTwo_8x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 4 to 1 outputs - VMOVDQU (R9)(R12*1), Y4 + VMOVDQU (R8), Y4 + ADDQ $0x20, R8 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -10204,7 +11356,8 @@ mulAvxTwo_8x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 5 to 1 outputs - VMOVDQU (R10)(R12*1), Y4 + VMOVDQU (R9), Y4 + ADDQ $0x20, R9 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -10216,7 +11369,8 @@ mulAvxTwo_8x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 6 to 1 outputs - VMOVDQU (R11)(R12*1), Y4 + VMOVDQU (R10), Y4 + ADDQ $0x20, R10 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -10228,7 +11382,8 @@ mulAvxTwo_8x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 7 to 1 outputs - VMOVDQU (BX)(R12*1), Y4 + VMOVDQU (DX), Y4 + ADDQ $0x20, DX VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -10240,10 +11395,10 @@ mulAvxTwo_8x1_loop: VPXOR Y2, Y0, Y0 // Store 1 outputs - VMOVDQU Y0, (DX)(R12*1) + VMOVDQU Y0, (R11) + ADDQ $0x20, R11 // Prepare for next loop - ADDQ $0x20, R12 DECQ AX JNZ mulAvxTwo_8x1_loop VZEROUPPER @@ -10255,28 +11410,43 @@ mulAvxTwo_8x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_8x2(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 39 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_8x2_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), DX - MOVQ in_base+24(FP), BP - MOVQ (BP), SI - MOVQ 24(BP), DI - MOVQ 48(BP), R8 - MOVQ 72(BP), R9 - MOVQ 96(BP), R10 - MOVQ 120(BP), R11 - MOVQ 144(BP), R12 - MOVQ 168(BP), BP + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_8x2_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), DX + MOVQ out_base+48(FP), R11 + MOVQ (R11), R12 + MOVQ 24(R11), R11 + MOVQ start+72(FP), R13 + + // Add start offset to output + ADDQ R13, R12 + ADDQ R13, R11 + + // Add start offset to input + ADDQ R13, BX + ADDQ R13, BP + ADDQ R13, SI + ADDQ R13, DI + ADDQ R13, R8 + ADDQ R13, R9 + ADDQ R13, R10 + ADDQ R13, DX MOVQ $0x0000000f, R13 MOVQ R13, X2 VPBROADCASTB X2, Y2 - MOVQ start+72(FP), R13 mulAvxTwo_8x2_loop: // Clear 2 outputs @@ -10284,7 +11454,8 @@ mulAvxTwo_8x2_loop: VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (SI)(R13*1), Y5 + VMOVDQU (BX), Y5 + ADDQ $0x20, BX VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -10302,7 +11473,8 @@ mulAvxTwo_8x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (DI)(R13*1), Y5 + VMOVDQU (BP), Y5 + ADDQ $0x20, BP VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -10320,7 +11492,8 @@ mulAvxTwo_8x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 2 to 2 outputs - VMOVDQU (R8)(R13*1), Y5 + VMOVDQU (SI), Y5 + ADDQ $0x20, SI VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -10338,7 +11511,8 @@ mulAvxTwo_8x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 3 to 2 outputs - VMOVDQU (R9)(R13*1), Y5 + VMOVDQU (DI), Y5 + ADDQ $0x20, DI VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -10356,7 +11530,8 @@ mulAvxTwo_8x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 4 to 2 outputs - VMOVDQU (R10)(R13*1), Y5 + VMOVDQU (R8), Y5 + ADDQ $0x20, R8 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -10374,7 +11549,8 @@ mulAvxTwo_8x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 5 to 2 outputs - VMOVDQU (R11)(R13*1), Y5 + VMOVDQU (R9), Y5 + ADDQ $0x20, R9 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -10392,7 +11568,8 @@ mulAvxTwo_8x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 6 to 2 outputs - VMOVDQU (R12)(R13*1), Y5 + VMOVDQU (R10), Y5 + ADDQ $0x20, R10 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -10410,7 +11587,8 @@ mulAvxTwo_8x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 7 to 2 outputs - VMOVDQU (BP)(R13*1), Y5 + VMOVDQU (DX), Y5 + ADDQ $0x20, DX VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -10428,11 +11606,12 @@ mulAvxTwo_8x2_loop: VPXOR Y3, Y1, Y1 // Store 2 outputs - VMOVDQU Y0, (BX)(R13*1) - VMOVDQU Y1, (DX)(R13*1) + VMOVDQU Y0, (R12) + ADDQ $0x20, R12 + VMOVDQU Y1, (R11) + ADDQ $0x20, R11 // Prepare for next loop - ADDQ $0x20, R13 DECQ AX JNZ mulAvxTwo_8x2_loop VZEROUPPER @@ -10444,29 +11623,45 @@ mulAvxTwo_8x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_8x3(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 56 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_8x3_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), DX - MOVQ in_base+24(FP), SI - MOVQ (SI), DI - MOVQ 24(SI), R8 - MOVQ 48(SI), R9 - MOVQ 72(SI), R10 - MOVQ 96(SI), R11 - MOVQ 120(SI), R12 - MOVQ 144(SI), R13 - MOVQ 168(SI), SI + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_8x3_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), DX + MOVQ out_base+48(FP), R11 + MOVQ (R11), R12 + MOVQ 24(R11), R13 + MOVQ 48(R11), R11 + MOVQ start+72(FP), R14 + + // Add start offset to output + ADDQ R14, R12 + ADDQ R14, R13 + ADDQ R14, R11 + + // Add start offset to input + ADDQ R14, BX + ADDQ R14, BP + ADDQ R14, SI + ADDQ R14, DI + ADDQ R14, R8 + ADDQ R14, R9 + ADDQ R14, R10 + ADDQ R14, DX MOVQ $0x0000000f, R14 MOVQ R14, X3 VPBROADCASTB X3, Y3 - MOVQ start+72(FP), R14 mulAvxTwo_8x3_loop: // Clear 3 outputs @@ -10475,7 +11670,8 @@ mulAvxTwo_8x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (DI)(R14*1), Y6 + VMOVDQU (BX), Y6 + ADDQ $0x20, BX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -10499,7 +11695,8 @@ mulAvxTwo_8x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (R8)(R14*1), Y6 + VMOVDQU (BP), Y6 + ADDQ $0x20, BP VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -10523,7 +11720,8 @@ mulAvxTwo_8x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 2 to 3 outputs - VMOVDQU (R9)(R14*1), Y6 + VMOVDQU (SI), Y6 + ADDQ $0x20, SI VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -10547,7 +11745,8 @@ mulAvxTwo_8x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 3 to 3 outputs - VMOVDQU (R10)(R14*1), Y6 + VMOVDQU (DI), Y6 + ADDQ $0x20, DI VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -10571,7 +11770,8 @@ mulAvxTwo_8x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 4 to 3 outputs - VMOVDQU (R11)(R14*1), Y6 + VMOVDQU (R8), Y6 + ADDQ $0x20, R8 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -10595,7 +11795,8 @@ mulAvxTwo_8x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 5 to 3 outputs - VMOVDQU (R12)(R14*1), Y6 + VMOVDQU (R9), Y6 + ADDQ $0x20, R9 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -10619,7 +11820,8 @@ mulAvxTwo_8x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 6 to 3 outputs - VMOVDQU (R13)(R14*1), Y6 + VMOVDQU (R10), Y6 + ADDQ $0x20, R10 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -10643,7 +11845,8 @@ mulAvxTwo_8x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 7 to 3 outputs - VMOVDQU (SI)(R14*1), Y6 + VMOVDQU (DX), Y6 + ADDQ $0x20, DX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -10667,12 +11870,14 @@ mulAvxTwo_8x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - VMOVDQU Y0, (BX)(R14*1) - VMOVDQU Y1, (BP)(R14*1) - VMOVDQU Y2, (DX)(R14*1) + VMOVDQU Y0, (R12) + ADDQ $0x20, R12 + VMOVDQU Y1, (R13) + ADDQ $0x20, R13 + VMOVDQU Y2, (R11) + ADDQ $0x20, R11 // Prepare for next loop - ADDQ $0x20, R14 DECQ AX JNZ mulAvxTwo_8x3_loop VZEROUPPER @@ -10684,30 +11889,47 @@ mulAvxTwo_8x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_8x4(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 73 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_8x4_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DX - MOVQ in_base+24(FP), DI - MOVQ (DI), R8 - MOVQ 24(DI), R9 - MOVQ 48(DI), R10 - MOVQ 72(DI), R11 - MOVQ 96(DI), R12 - MOVQ 120(DI), R13 - MOVQ 144(DI), R14 - MOVQ 168(DI), DI + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_8x4_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), DX + MOVQ out_base+48(FP), R11 + MOVQ (R11), R12 + MOVQ 24(R11), R13 + MOVQ 48(R11), R14 + MOVQ 72(R11), R11 + MOVQ start+72(FP), R15 + + // Add start offset to output + ADDQ R15, R12 + ADDQ R15, R13 + ADDQ R15, R14 + ADDQ R15, R11 + + // Add start offset to input + ADDQ R15, BX + ADDQ R15, BP + ADDQ R15, SI + ADDQ R15, DI + ADDQ R15, R8 + ADDQ R15, R9 + ADDQ R15, R10 + ADDQ R15, DX MOVQ $0x0000000f, R15 MOVQ R15, X4 VPBROADCASTB X4, Y4 - MOVQ start+72(FP), R15 mulAvxTwo_8x4_loop: // Clear 4 outputs @@ -10717,7 +11939,8 @@ mulAvxTwo_8x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (R8)(R15*1), Y7 + VMOVDQU (BX), Y7 + ADDQ $0x20, BX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -10747,7 +11970,8 @@ mulAvxTwo_8x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (R9)(R15*1), Y7 + VMOVDQU (BP), Y7 + ADDQ $0x20, BP VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -10777,7 +12001,8 @@ mulAvxTwo_8x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 2 to 4 outputs - VMOVDQU (R10)(R15*1), Y7 + VMOVDQU (SI), Y7 + ADDQ $0x20, SI VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -10807,7 +12032,8 @@ mulAvxTwo_8x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 3 to 4 outputs - VMOVDQU (R11)(R15*1), Y7 + VMOVDQU (DI), Y7 + ADDQ $0x20, DI VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -10837,7 +12063,8 @@ mulAvxTwo_8x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 4 to 4 outputs - VMOVDQU (R12)(R15*1), Y7 + VMOVDQU (R8), Y7 + ADDQ $0x20, R8 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -10867,7 +12094,8 @@ mulAvxTwo_8x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 5 to 4 outputs - VMOVDQU (R13)(R15*1), Y7 + VMOVDQU (R9), Y7 + ADDQ $0x20, R9 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -10897,7 +12125,8 @@ mulAvxTwo_8x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 6 to 4 outputs - VMOVDQU (R14)(R15*1), Y7 + VMOVDQU (R10), Y7 + ADDQ $0x20, R10 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -10927,7 +12156,8 @@ mulAvxTwo_8x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 7 to 4 outputs - VMOVDQU (DI)(R15*1), Y7 + VMOVDQU (DX), Y7 + ADDQ $0x20, DX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -10957,13 +12187,16 @@ mulAvxTwo_8x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - VMOVDQU Y0, (BX)(R15*1) - VMOVDQU Y1, (BP)(R15*1) - VMOVDQU Y2, (SI)(R15*1) - VMOVDQU Y3, (DX)(R15*1) + VMOVDQU Y0, (R12) + ADDQ $0x20, R12 + VMOVDQU Y1, (R13) + ADDQ $0x20, R13 + VMOVDQU Y2, (R14) + ADDQ $0x20, R14 + VMOVDQU Y3, (R11) + ADDQ $0x20, R11 // Prepare for next loop - ADDQ $0x20, R15 DECQ AX JNZ mulAvxTwo_8x4_loop VZEROUPPER @@ -10975,26 +12208,51 @@ mulAvxTwo_8x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_8x5(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 90 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_8x5_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), BX - MOVQ $0x0000000f, R12 - MOVQ R12, X5 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_8x5_end + MOVQ in_base+24(FP), AX + MOVQ (AX), DX + MOVQ 24(AX), BX + MOVQ 48(AX), BP + MOVQ 72(AX), SI + MOVQ 96(AX), DI + MOVQ 120(AX), R8 + MOVQ 144(AX), R9 + MOVQ 168(AX), AX + MOVQ out_base+48(FP), R10 + MOVQ (R10), R11 + MOVQ 24(R10), R12 + MOVQ 48(R10), R13 + MOVQ 72(R10), R14 + MOVQ 96(R10), R10 + MOVQ start+72(FP), R15 + + // Add start offset to output + ADDQ R15, R11 + ADDQ R15, R12 + ADDQ R15, R13 + ADDQ R15, R14 + ADDQ R15, R10 + + // Add start offset to input + ADDQ R15, DX + ADDQ R15, BX + ADDQ R15, BP + ADDQ R15, SI + ADDQ R15, DI + ADDQ R15, R8 + ADDQ R15, R9 + ADDQ R15, AX + MOVQ $0x0000000f, R15 + MOVQ R15, X5 VPBROADCASTB X5, Y5 - MOVQ start+72(FP), R12 + MOVQ n+80(FP), R15 + SHRQ $0x05, R15 mulAvxTwo_8x5_loop: // Clear 5 outputs @@ -11005,7 +12263,8 @@ mulAvxTwo_8x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (BP)(R12*1), Y8 + VMOVDQU (DX), Y8 + ADDQ $0x20, DX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -11041,7 +12300,8 @@ mulAvxTwo_8x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (SI)(R12*1), Y8 + VMOVDQU (BX), Y8 + ADDQ $0x20, BX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -11077,7 +12337,8 @@ mulAvxTwo_8x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 2 to 5 outputs - VMOVDQU (DI)(R12*1), Y8 + VMOVDQU (BP), Y8 + ADDQ $0x20, BP VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -11113,7 +12374,8 @@ mulAvxTwo_8x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 3 to 5 outputs - VMOVDQU (R8)(R12*1), Y8 + VMOVDQU (SI), Y8 + ADDQ $0x20, SI VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -11149,7 +12411,8 @@ mulAvxTwo_8x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 4 to 5 outputs - VMOVDQU (R9)(R12*1), Y8 + VMOVDQU (DI), Y8 + ADDQ $0x20, DI VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -11185,7 +12448,8 @@ mulAvxTwo_8x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 5 to 5 outputs - VMOVDQU (R10)(R12*1), Y8 + VMOVDQU (R8), Y8 + ADDQ $0x20, R8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -11221,7 +12485,8 @@ mulAvxTwo_8x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 6 to 5 outputs - VMOVDQU (R11)(R12*1), Y8 + VMOVDQU (R9), Y8 + ADDQ $0x20, R9 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -11257,7 +12522,8 @@ mulAvxTwo_8x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 7 to 5 outputs - VMOVDQU (BX)(R12*1), Y8 + VMOVDQU (AX), Y8 + ADDQ $0x20, AX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -11293,20 +12559,19 @@ mulAvxTwo_8x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - MOVQ (DX), R13 - VMOVDQU Y0, (R13)(R12*1) - MOVQ 24(DX), R13 - VMOVDQU Y1, (R13)(R12*1) - MOVQ 48(DX), R13 - VMOVDQU Y2, (R13)(R12*1) - MOVQ 72(DX), R13 - VMOVDQU Y3, (R13)(R12*1) - MOVQ 96(DX), R13 - VMOVDQU Y4, (R13)(R12*1) + VMOVDQU Y0, (R11) + ADDQ $0x20, R11 + VMOVDQU Y1, (R12) + ADDQ $0x20, R12 + VMOVDQU Y2, (R13) + ADDQ $0x20, R13 + VMOVDQU Y3, (R14) + ADDQ $0x20, R14 + VMOVDQU Y4, (R10) + ADDQ $0x20, R10 // Prepare for next loop - ADDQ $0x20, R12 - DECQ AX + DECQ R15 JNZ mulAvxTwo_8x5_loop VZEROUPPER @@ -11317,26 +12582,37 @@ mulAvxTwo_8x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_8x6(SB), $0-88 // Loading no tables to registers + // Destination kept on stack // Full registers estimated 107 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_8x6_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), BX - MOVQ $0x0000000f, R12 - MOVQ R12, X6 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_8x6_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), DX + MOVQ out_base+48(FP), R11 + MOVQ start+72(FP), R12 + + // Add start offset to input + ADDQ R12, BX + ADDQ R12, BP + ADDQ R12, SI + ADDQ R12, DI + ADDQ R12, R8 + ADDQ R12, R9 + ADDQ R12, R10 + ADDQ R12, DX + MOVQ $0x0000000f, R13 + MOVQ R13, X6 VPBROADCASTB X6, Y6 - MOVQ start+72(FP), R12 mulAvxTwo_8x6_loop: // Clear 6 outputs @@ -11348,7 +12624,8 @@ mulAvxTwo_8x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (BP)(R12*1), Y9 + VMOVDQU (BX), Y9 + ADDQ $0x20, BX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -11390,7 +12667,8 @@ mulAvxTwo_8x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (SI)(R12*1), Y9 + VMOVDQU (BP), Y9 + ADDQ $0x20, BP VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -11432,7 +12710,8 @@ mulAvxTwo_8x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 2 to 6 outputs - VMOVDQU (DI)(R12*1), Y9 + VMOVDQU (SI), Y9 + ADDQ $0x20, SI VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -11474,7 +12753,8 @@ mulAvxTwo_8x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 3 to 6 outputs - VMOVDQU (R8)(R12*1), Y9 + VMOVDQU (DI), Y9 + ADDQ $0x20, DI VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -11516,7 +12796,8 @@ mulAvxTwo_8x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 4 to 6 outputs - VMOVDQU (R9)(R12*1), Y9 + VMOVDQU (R8), Y9 + ADDQ $0x20, R8 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -11558,7 +12839,8 @@ mulAvxTwo_8x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 5 to 6 outputs - VMOVDQU (R10)(R12*1), Y9 + VMOVDQU (R9), Y9 + ADDQ $0x20, R9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -11600,7 +12882,8 @@ mulAvxTwo_8x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 6 to 6 outputs - VMOVDQU (R11)(R12*1), Y9 + VMOVDQU (R10), Y9 + ADDQ $0x20, R10 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -11642,7 +12925,8 @@ mulAvxTwo_8x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 7 to 6 outputs - VMOVDQU (BX)(R12*1), Y9 + VMOVDQU (DX), Y9 + ADDQ $0x20, DX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -11684,17 +12968,17 @@ mulAvxTwo_8x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - MOVQ (DX), R13 + MOVQ (R11), R13 VMOVDQU Y0, (R13)(R12*1) - MOVQ 24(DX), R13 + MOVQ 24(R11), R13 VMOVDQU Y1, (R13)(R12*1) - MOVQ 48(DX), R13 + MOVQ 48(R11), R13 VMOVDQU Y2, (R13)(R12*1) - MOVQ 72(DX), R13 + MOVQ 72(R11), R13 VMOVDQU Y3, (R13)(R12*1) - MOVQ 96(DX), R13 + MOVQ 96(R11), R13 VMOVDQU Y4, (R13)(R12*1) - MOVQ 120(DX), R13 + MOVQ 120(R11), R13 VMOVDQU Y5, (R13)(R12*1) // Prepare for next loop @@ -11710,26 +12994,37 @@ mulAvxTwo_8x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_8x7(SB), $0-88 // Loading no tables to registers + // Destination kept on stack // Full registers estimated 124 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_8x7_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), BX - MOVQ $0x0000000f, R12 - MOVQ R12, X7 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_8x7_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), DX + MOVQ out_base+48(FP), R11 + MOVQ start+72(FP), R12 + + // Add start offset to input + ADDQ R12, BX + ADDQ R12, BP + ADDQ R12, SI + ADDQ R12, DI + ADDQ R12, R8 + ADDQ R12, R9 + ADDQ R12, R10 + ADDQ R12, DX + MOVQ $0x0000000f, R13 + MOVQ R13, X7 VPBROADCASTB X7, Y7 - MOVQ start+72(FP), R12 mulAvxTwo_8x7_loop: // Clear 7 outputs @@ -11742,7 +13037,8 @@ mulAvxTwo_8x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (BP)(R12*1), Y10 + VMOVDQU (BX), Y10 + ADDQ $0x20, BX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -11790,7 +13086,8 @@ mulAvxTwo_8x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (SI)(R12*1), Y10 + VMOVDQU (BP), Y10 + ADDQ $0x20, BP VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -11838,7 +13135,8 @@ mulAvxTwo_8x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 2 to 7 outputs - VMOVDQU (DI)(R12*1), Y10 + VMOVDQU (SI), Y10 + ADDQ $0x20, SI VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -11886,7 +13184,8 @@ mulAvxTwo_8x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 3 to 7 outputs - VMOVDQU (R8)(R12*1), Y10 + VMOVDQU (DI), Y10 + ADDQ $0x20, DI VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -11934,7 +13233,8 @@ mulAvxTwo_8x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 4 to 7 outputs - VMOVDQU (R9)(R12*1), Y10 + VMOVDQU (R8), Y10 + ADDQ $0x20, R8 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -11982,7 +13282,8 @@ mulAvxTwo_8x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 5 to 7 outputs - VMOVDQU (R10)(R12*1), Y10 + VMOVDQU (R9), Y10 + ADDQ $0x20, R9 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -12030,7 +13331,8 @@ mulAvxTwo_8x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 6 to 7 outputs - VMOVDQU (R11)(R12*1), Y10 + VMOVDQU (R10), Y10 + ADDQ $0x20, R10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -12078,7 +13380,8 @@ mulAvxTwo_8x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 7 to 7 outputs - VMOVDQU (BX)(R12*1), Y10 + VMOVDQU (DX), Y10 + ADDQ $0x20, DX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -12126,19 +13429,19 @@ mulAvxTwo_8x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - MOVQ (DX), R13 + MOVQ (R11), R13 VMOVDQU Y0, (R13)(R12*1) - MOVQ 24(DX), R13 + MOVQ 24(R11), R13 VMOVDQU Y1, (R13)(R12*1) - MOVQ 48(DX), R13 + MOVQ 48(R11), R13 VMOVDQU Y2, (R13)(R12*1) - MOVQ 72(DX), R13 + MOVQ 72(R11), R13 VMOVDQU Y3, (R13)(R12*1) - MOVQ 96(DX), R13 + MOVQ 96(R11), R13 VMOVDQU Y4, (R13)(R12*1) - MOVQ 120(DX), R13 + MOVQ 120(R11), R13 VMOVDQU Y5, (R13)(R12*1) - MOVQ 144(DX), R13 + MOVQ 144(R11), R13 VMOVDQU Y6, (R13)(R12*1) // Prepare for next loop @@ -12154,26 +13457,37 @@ mulAvxTwo_8x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_8x8(SB), $0-88 // Loading no tables to registers + // Destination kept on stack // Full registers estimated 141 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_8x8_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), BX - MOVQ $0x0000000f, R12 - MOVQ R12, X8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_8x8_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), DX + MOVQ out_base+48(FP), R11 + MOVQ start+72(FP), R12 + + // Add start offset to input + ADDQ R12, BX + ADDQ R12, BP + ADDQ R12, SI + ADDQ R12, DI + ADDQ R12, R8 + ADDQ R12, R9 + ADDQ R12, R10 + ADDQ R12, DX + MOVQ $0x0000000f, R13 + MOVQ R13, X8 VPBROADCASTB X8, Y8 - MOVQ start+72(FP), R12 mulAvxTwo_8x8_loop: // Clear 8 outputs @@ -12187,7 +13501,8 @@ mulAvxTwo_8x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (BP)(R12*1), Y11 + VMOVDQU (BX), Y11 + ADDQ $0x20, BX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -12241,7 +13556,8 @@ mulAvxTwo_8x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (SI)(R12*1), Y11 + VMOVDQU (BP), Y11 + ADDQ $0x20, BP VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -12295,7 +13611,8 @@ mulAvxTwo_8x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 2 to 8 outputs - VMOVDQU (DI)(R12*1), Y11 + VMOVDQU (SI), Y11 + ADDQ $0x20, SI VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -12349,7 +13666,8 @@ mulAvxTwo_8x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 3 to 8 outputs - VMOVDQU (R8)(R12*1), Y11 + VMOVDQU (DI), Y11 + ADDQ $0x20, DI VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -12403,7 +13721,8 @@ mulAvxTwo_8x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 4 to 8 outputs - VMOVDQU (R9)(R12*1), Y11 + VMOVDQU (R8), Y11 + ADDQ $0x20, R8 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -12457,7 +13776,8 @@ mulAvxTwo_8x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 5 to 8 outputs - VMOVDQU (R10)(R12*1), Y11 + VMOVDQU (R9), Y11 + ADDQ $0x20, R9 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -12511,7 +13831,8 @@ mulAvxTwo_8x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 6 to 8 outputs - VMOVDQU (R11)(R12*1), Y11 + VMOVDQU (R10), Y11 + ADDQ $0x20, R10 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -12565,7 +13886,8 @@ mulAvxTwo_8x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 7 to 8 outputs - VMOVDQU (BX)(R12*1), Y11 + VMOVDQU (DX), Y11 + ADDQ $0x20, DX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -12619,21 +13941,21 @@ mulAvxTwo_8x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - MOVQ (DX), R13 + MOVQ (R11), R13 VMOVDQU Y0, (R13)(R12*1) - MOVQ 24(DX), R13 + MOVQ 24(R11), R13 VMOVDQU Y1, (R13)(R12*1) - MOVQ 48(DX), R13 + MOVQ 48(R11), R13 VMOVDQU Y2, (R13)(R12*1) - MOVQ 72(DX), R13 + MOVQ 72(R11), R13 VMOVDQU Y3, (R13)(R12*1) - MOVQ 96(DX), R13 + MOVQ 96(R11), R13 VMOVDQU Y4, (R13)(R12*1) - MOVQ 120(DX), R13 + MOVQ 120(R11), R13 VMOVDQU Y5, (R13)(R12*1) - MOVQ 144(DX), R13 + MOVQ 144(R11), R13 VMOVDQU Y6, (R13)(R12*1) - MOVQ 168(DX), R13 + MOVQ 168(R11), R13 VMOVDQU Y7, (R13)(R12*1) // Prepare for next loop @@ -12649,35 +13971,51 @@ mulAvxTwo_8x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_9x1(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 22 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_9x1_end - MOVQ out_base+48(FP), DX - MOVQ (DX), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), R12 - MOVQ 192(BX), BX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_9x1_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), R11 + MOVQ 192(DX), DX + MOVQ out_base+48(FP), R12 + MOVQ (R12), R12 + MOVQ start+72(FP), R13 + + // Add start offset to output + ADDQ R13, R12 + + // Add start offset to input + ADDQ R13, BX + ADDQ R13, BP + ADDQ R13, SI + ADDQ R13, DI + ADDQ R13, R8 + ADDQ R13, R9 + ADDQ R13, R10 + ADDQ R13, R11 + ADDQ R13, DX MOVQ $0x0000000f, R13 MOVQ R13, X1 VPBROADCASTB X1, Y1 - MOVQ start+72(FP), R13 mulAvxTwo_9x1_loop: // Clear 1 outputs VPXOR Y0, Y0, Y0 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (BP)(R13*1), Y4 + VMOVDQU (BX), Y4 + ADDQ $0x20, BX VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -12689,7 +14027,8 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (SI)(R13*1), Y4 + VMOVDQU (BP), Y4 + ADDQ $0x20, BP VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -12701,7 +14040,8 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 2 to 1 outputs - VMOVDQU (DI)(R13*1), Y4 + VMOVDQU (SI), Y4 + ADDQ $0x20, SI VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -12713,7 +14053,8 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 3 to 1 outputs - VMOVDQU (R8)(R13*1), Y4 + VMOVDQU (DI), Y4 + ADDQ $0x20, DI VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -12725,7 +14066,8 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 4 to 1 outputs - VMOVDQU (R9)(R13*1), Y4 + VMOVDQU (R8), Y4 + ADDQ $0x20, R8 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -12737,7 +14079,8 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 5 to 1 outputs - VMOVDQU (R10)(R13*1), Y4 + VMOVDQU (R9), Y4 + ADDQ $0x20, R9 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -12749,7 +14092,8 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 6 to 1 outputs - VMOVDQU (R11)(R13*1), Y4 + VMOVDQU (R10), Y4 + ADDQ $0x20, R10 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -12761,7 +14105,8 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 7 to 1 outputs - VMOVDQU (R12)(R13*1), Y4 + VMOVDQU (R11), Y4 + ADDQ $0x20, R11 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -12773,7 +14118,8 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 8 to 1 outputs - VMOVDQU (BX)(R13*1), Y4 + VMOVDQU (DX), Y4 + ADDQ $0x20, DX VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -12785,10 +14131,10 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Store 1 outputs - VMOVDQU Y0, (DX)(R13*1) + VMOVDQU Y0, (R12) + ADDQ $0x20, R12 // Prepare for next loop - ADDQ $0x20, R13 DECQ AX JNZ mulAvxTwo_9x1_loop VZEROUPPER @@ -12800,29 +14146,45 @@ mulAvxTwo_9x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_9x2(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 43 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_9x2_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), DX - MOVQ in_base+24(FP), BP - MOVQ (BP), SI - MOVQ 24(BP), DI - MOVQ 48(BP), R8 - MOVQ 72(BP), R9 - MOVQ 96(BP), R10 - MOVQ 120(BP), R11 - MOVQ 144(BP), R12 - MOVQ 168(BP), R13 - MOVQ 192(BP), BP + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_9x2_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), R11 + MOVQ 192(DX), DX + MOVQ out_base+48(FP), R12 + MOVQ (R12), R13 + MOVQ 24(R12), R12 + MOVQ start+72(FP), R14 + + // Add start offset to output + ADDQ R14, R13 + ADDQ R14, R12 + + // Add start offset to input + ADDQ R14, BX + ADDQ R14, BP + ADDQ R14, SI + ADDQ R14, DI + ADDQ R14, R8 + ADDQ R14, R9 + ADDQ R14, R10 + ADDQ R14, R11 + ADDQ R14, DX MOVQ $0x0000000f, R14 MOVQ R14, X2 VPBROADCASTB X2, Y2 - MOVQ start+72(FP), R14 mulAvxTwo_9x2_loop: // Clear 2 outputs @@ -12830,7 +14192,8 @@ mulAvxTwo_9x2_loop: VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (SI)(R14*1), Y5 + VMOVDQU (BX), Y5 + ADDQ $0x20, BX VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -12848,7 +14211,8 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (DI)(R14*1), Y5 + VMOVDQU (BP), Y5 + ADDQ $0x20, BP VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -12866,7 +14230,8 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 2 to 2 outputs - VMOVDQU (R8)(R14*1), Y5 + VMOVDQU (SI), Y5 + ADDQ $0x20, SI VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -12884,7 +14249,8 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 3 to 2 outputs - VMOVDQU (R9)(R14*1), Y5 + VMOVDQU (DI), Y5 + ADDQ $0x20, DI VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -12902,7 +14268,8 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 4 to 2 outputs - VMOVDQU (R10)(R14*1), Y5 + VMOVDQU (R8), Y5 + ADDQ $0x20, R8 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -12920,7 +14287,8 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 5 to 2 outputs - VMOVDQU (R11)(R14*1), Y5 + VMOVDQU (R9), Y5 + ADDQ $0x20, R9 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -12938,7 +14306,8 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 6 to 2 outputs - VMOVDQU (R12)(R14*1), Y5 + VMOVDQU (R10), Y5 + ADDQ $0x20, R10 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -12956,7 +14325,8 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 7 to 2 outputs - VMOVDQU (R13)(R14*1), Y5 + VMOVDQU (R11), Y5 + ADDQ $0x20, R11 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -12974,7 +14344,8 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 8 to 2 outputs - VMOVDQU (BP)(R14*1), Y5 + VMOVDQU (DX), Y5 + ADDQ $0x20, DX VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -12992,11 +14363,12 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Store 2 outputs - VMOVDQU Y0, (BX)(R14*1) - VMOVDQU Y1, (DX)(R14*1) + VMOVDQU Y0, (R13) + ADDQ $0x20, R13 + VMOVDQU Y1, (R12) + ADDQ $0x20, R12 // Prepare for next loop - ADDQ $0x20, R14 DECQ AX JNZ mulAvxTwo_9x2_loop VZEROUPPER @@ -13008,30 +14380,47 @@ mulAvxTwo_9x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_9x3(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 62 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_9x3_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), DX - MOVQ in_base+24(FP), SI - MOVQ (SI), DI - MOVQ 24(SI), R8 - MOVQ 48(SI), R9 - MOVQ 72(SI), R10 - MOVQ 96(SI), R11 - MOVQ 120(SI), R12 - MOVQ 144(SI), R13 - MOVQ 168(SI), R14 - MOVQ 192(SI), SI + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_9x3_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), R11 + MOVQ 192(DX), DX + MOVQ out_base+48(FP), R12 + MOVQ (R12), R13 + MOVQ 24(R12), R14 + MOVQ 48(R12), R12 + MOVQ start+72(FP), R15 + + // Add start offset to output + ADDQ R15, R13 + ADDQ R15, R14 + ADDQ R15, R12 + + // Add start offset to input + ADDQ R15, BX + ADDQ R15, BP + ADDQ R15, SI + ADDQ R15, DI + ADDQ R15, R8 + ADDQ R15, R9 + ADDQ R15, R10 + ADDQ R15, R11 + ADDQ R15, DX MOVQ $0x0000000f, R15 MOVQ R15, X3 VPBROADCASTB X3, Y3 - MOVQ start+72(FP), R15 mulAvxTwo_9x3_loop: // Clear 3 outputs @@ -13040,7 +14429,8 @@ mulAvxTwo_9x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (DI)(R15*1), Y6 + VMOVDQU (BX), Y6 + ADDQ $0x20, BX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -13064,7 +14454,8 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (R8)(R15*1), Y6 + VMOVDQU (BP), Y6 + ADDQ $0x20, BP VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -13088,7 +14479,8 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 2 to 3 outputs - VMOVDQU (R9)(R15*1), Y6 + VMOVDQU (SI), Y6 + ADDQ $0x20, SI VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -13112,7 +14504,8 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 3 to 3 outputs - VMOVDQU (R10)(R15*1), Y6 + VMOVDQU (DI), Y6 + ADDQ $0x20, DI VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -13136,7 +14529,8 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 4 to 3 outputs - VMOVDQU (R11)(R15*1), Y6 + VMOVDQU (R8), Y6 + ADDQ $0x20, R8 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -13160,7 +14554,8 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 5 to 3 outputs - VMOVDQU (R12)(R15*1), Y6 + VMOVDQU (R9), Y6 + ADDQ $0x20, R9 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -13184,7 +14579,8 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 6 to 3 outputs - VMOVDQU (R13)(R15*1), Y6 + VMOVDQU (R10), Y6 + ADDQ $0x20, R10 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -13208,7 +14604,8 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 7 to 3 outputs - VMOVDQU (R14)(R15*1), Y6 + VMOVDQU (R11), Y6 + ADDQ $0x20, R11 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -13232,7 +14629,8 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 8 to 3 outputs - VMOVDQU (SI)(R15*1), Y6 + VMOVDQU (DX), Y6 + ADDQ $0x20, DX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -13256,12 +14654,14 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - VMOVDQU Y0, (BX)(R15*1) - VMOVDQU Y1, (BP)(R15*1) - VMOVDQU Y2, (DX)(R15*1) + VMOVDQU Y0, (R13) + ADDQ $0x20, R13 + VMOVDQU Y1, (R14) + ADDQ $0x20, R14 + VMOVDQU Y2, (R12) + ADDQ $0x20, R12 // Prepare for next loop - ADDQ $0x20, R15 DECQ AX JNZ mulAvxTwo_9x3_loop VZEROUPPER @@ -13273,27 +14673,51 @@ mulAvxTwo_9x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_9x4(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 81 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_9x4_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), R12 - MOVQ 192(BX), BX - MOVQ $0x0000000f, R13 - MOVQ R13, X4 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_9x4_end + MOVQ in_base+24(FP), AX + MOVQ (AX), DX + MOVQ 24(AX), BX + MOVQ 48(AX), BP + MOVQ 72(AX), SI + MOVQ 96(AX), DI + MOVQ 120(AX), R8 + MOVQ 144(AX), R9 + MOVQ 168(AX), R10 + MOVQ 192(AX), AX + MOVQ out_base+48(FP), R11 + MOVQ (R11), R12 + MOVQ 24(R11), R13 + MOVQ 48(R11), R14 + MOVQ 72(R11), R11 + MOVQ start+72(FP), R15 + + // Add start offset to output + ADDQ R15, R12 + ADDQ R15, R13 + ADDQ R15, R14 + ADDQ R15, R11 + + // Add start offset to input + ADDQ R15, DX + ADDQ R15, BX + ADDQ R15, BP + ADDQ R15, SI + ADDQ R15, DI + ADDQ R15, R8 + ADDQ R15, R9 + ADDQ R15, R10 + ADDQ R15, AX + MOVQ $0x0000000f, R15 + MOVQ R15, X4 VPBROADCASTB X4, Y4 - MOVQ start+72(FP), R13 + MOVQ n+80(FP), R15 + SHRQ $0x05, R15 mulAvxTwo_9x4_loop: // Clear 4 outputs @@ -13303,7 +14727,8 @@ mulAvxTwo_9x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (BP)(R13*1), Y7 + VMOVDQU (DX), Y7 + ADDQ $0x20, DX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -13333,7 +14758,8 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (SI)(R13*1), Y7 + VMOVDQU (BX), Y7 + ADDQ $0x20, BX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -13363,7 +14789,8 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 2 to 4 outputs - VMOVDQU (DI)(R13*1), Y7 + VMOVDQU (BP), Y7 + ADDQ $0x20, BP VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -13393,7 +14820,8 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 3 to 4 outputs - VMOVDQU (R8)(R13*1), Y7 + VMOVDQU (SI), Y7 + ADDQ $0x20, SI VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -13423,7 +14851,8 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 4 to 4 outputs - VMOVDQU (R9)(R13*1), Y7 + VMOVDQU (DI), Y7 + ADDQ $0x20, DI VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -13453,7 +14882,8 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 5 to 4 outputs - VMOVDQU (R10)(R13*1), Y7 + VMOVDQU (R8), Y7 + ADDQ $0x20, R8 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -13483,7 +14913,8 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 6 to 4 outputs - VMOVDQU (R11)(R13*1), Y7 + VMOVDQU (R9), Y7 + ADDQ $0x20, R9 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -13513,7 +14944,8 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 7 to 4 outputs - VMOVDQU (R12)(R13*1), Y7 + VMOVDQU (R10), Y7 + ADDQ $0x20, R10 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -13543,7 +14975,8 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 8 to 4 outputs - VMOVDQU (BX)(R13*1), Y7 + VMOVDQU (AX), Y7 + ADDQ $0x20, AX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -13573,18 +15006,17 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - MOVQ (DX), R14 - VMOVDQU Y0, (R14)(R13*1) - MOVQ 24(DX), R14 - VMOVDQU Y1, (R14)(R13*1) - MOVQ 48(DX), R14 - VMOVDQU Y2, (R14)(R13*1) - MOVQ 72(DX), R14 - VMOVDQU Y3, (R14)(R13*1) + VMOVDQU Y0, (R12) + ADDQ $0x20, R12 + VMOVDQU Y1, (R13) + ADDQ $0x20, R13 + VMOVDQU Y2, (R14) + ADDQ $0x20, R14 + VMOVDQU Y3, (R11) + ADDQ $0x20, R11 // Prepare for next loop - ADDQ $0x20, R13 - DECQ AX + DECQ R15 JNZ mulAvxTwo_9x4_loop VZEROUPPER @@ -13595,27 +15027,39 @@ mulAvxTwo_9x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_9x5(SB), $0-88 // Loading no tables to registers + // Destination kept on stack // Full registers estimated 100 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_9x5_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), R12 - MOVQ 192(BX), BX - MOVQ $0x0000000f, R13 - MOVQ R13, X5 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_9x5_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), R11 + MOVQ 192(DX), DX + MOVQ out_base+48(FP), R12 + MOVQ start+72(FP), R13 + + // Add start offset to input + ADDQ R13, BX + ADDQ R13, BP + ADDQ R13, SI + ADDQ R13, DI + ADDQ R13, R8 + ADDQ R13, R9 + ADDQ R13, R10 + ADDQ R13, R11 + ADDQ R13, DX + MOVQ $0x0000000f, R14 + MOVQ R14, X5 VPBROADCASTB X5, Y5 - MOVQ start+72(FP), R13 mulAvxTwo_9x5_loop: // Clear 5 outputs @@ -13626,7 +15070,8 @@ mulAvxTwo_9x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (BP)(R13*1), Y8 + VMOVDQU (BX), Y8 + ADDQ $0x20, BX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -13662,7 +15107,8 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (SI)(R13*1), Y8 + VMOVDQU (BP), Y8 + ADDQ $0x20, BP VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -13698,7 +15144,8 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 2 to 5 outputs - VMOVDQU (DI)(R13*1), Y8 + VMOVDQU (SI), Y8 + ADDQ $0x20, SI VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -13734,7 +15181,8 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 3 to 5 outputs - VMOVDQU (R8)(R13*1), Y8 + VMOVDQU (DI), Y8 + ADDQ $0x20, DI VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -13770,7 +15218,8 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 4 to 5 outputs - VMOVDQU (R9)(R13*1), Y8 + VMOVDQU (R8), Y8 + ADDQ $0x20, R8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -13806,7 +15255,8 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 5 to 5 outputs - VMOVDQU (R10)(R13*1), Y8 + VMOVDQU (R9), Y8 + ADDQ $0x20, R9 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -13842,7 +15292,8 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 6 to 5 outputs - VMOVDQU (R11)(R13*1), Y8 + VMOVDQU (R10), Y8 + ADDQ $0x20, R10 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -13878,7 +15329,8 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 7 to 5 outputs - VMOVDQU (R12)(R13*1), Y8 + VMOVDQU (R11), Y8 + ADDQ $0x20, R11 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -13914,7 +15366,8 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 8 to 5 outputs - VMOVDQU (BX)(R13*1), Y8 + VMOVDQU (DX), Y8 + ADDQ $0x20, DX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -13950,15 +15403,15 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - MOVQ (DX), R14 + MOVQ (R12), R14 VMOVDQU Y0, (R14)(R13*1) - MOVQ 24(DX), R14 + MOVQ 24(R12), R14 VMOVDQU Y1, (R14)(R13*1) - MOVQ 48(DX), R14 + MOVQ 48(R12), R14 VMOVDQU Y2, (R14)(R13*1) - MOVQ 72(DX), R14 + MOVQ 72(R12), R14 VMOVDQU Y3, (R14)(R13*1) - MOVQ 96(DX), R14 + MOVQ 96(R12), R14 VMOVDQU Y4, (R14)(R13*1) // Prepare for next loop @@ -13974,27 +15427,39 @@ mulAvxTwo_9x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_9x6(SB), $0-88 // Loading no tables to registers + // Destination kept on stack // Full registers estimated 119 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_9x6_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), R12 - MOVQ 192(BX), BX - MOVQ $0x0000000f, R13 - MOVQ R13, X6 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_9x6_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), R11 + MOVQ 192(DX), DX + MOVQ out_base+48(FP), R12 + MOVQ start+72(FP), R13 + + // Add start offset to input + ADDQ R13, BX + ADDQ R13, BP + ADDQ R13, SI + ADDQ R13, DI + ADDQ R13, R8 + ADDQ R13, R9 + ADDQ R13, R10 + ADDQ R13, R11 + ADDQ R13, DX + MOVQ $0x0000000f, R14 + MOVQ R14, X6 VPBROADCASTB X6, Y6 - MOVQ start+72(FP), R13 mulAvxTwo_9x6_loop: // Clear 6 outputs @@ -14006,7 +15471,8 @@ mulAvxTwo_9x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (BP)(R13*1), Y9 + VMOVDQU (BX), Y9 + ADDQ $0x20, BX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -14048,7 +15514,8 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (SI)(R13*1), Y9 + VMOVDQU (BP), Y9 + ADDQ $0x20, BP VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -14090,7 +15557,8 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 2 to 6 outputs - VMOVDQU (DI)(R13*1), Y9 + VMOVDQU (SI), Y9 + ADDQ $0x20, SI VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -14132,7 +15600,8 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 3 to 6 outputs - VMOVDQU (R8)(R13*1), Y9 + VMOVDQU (DI), Y9 + ADDQ $0x20, DI VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -14174,7 +15643,8 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 4 to 6 outputs - VMOVDQU (R9)(R13*1), Y9 + VMOVDQU (R8), Y9 + ADDQ $0x20, R8 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -14216,7 +15686,8 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 5 to 6 outputs - VMOVDQU (R10)(R13*1), Y9 + VMOVDQU (R9), Y9 + ADDQ $0x20, R9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -14258,7 +15729,8 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 6 to 6 outputs - VMOVDQU (R11)(R13*1), Y9 + VMOVDQU (R10), Y9 + ADDQ $0x20, R10 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -14300,7 +15772,8 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 7 to 6 outputs - VMOVDQU (R12)(R13*1), Y9 + VMOVDQU (R11), Y9 + ADDQ $0x20, R11 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -14342,7 +15815,8 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 8 to 6 outputs - VMOVDQU (BX)(R13*1), Y9 + VMOVDQU (DX), Y9 + ADDQ $0x20, DX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -14384,17 +15858,17 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - MOVQ (DX), R14 + MOVQ (R12), R14 VMOVDQU Y0, (R14)(R13*1) - MOVQ 24(DX), R14 + MOVQ 24(R12), R14 VMOVDQU Y1, (R14)(R13*1) - MOVQ 48(DX), R14 + MOVQ 48(R12), R14 VMOVDQU Y2, (R14)(R13*1) - MOVQ 72(DX), R14 + MOVQ 72(R12), R14 VMOVDQU Y3, (R14)(R13*1) - MOVQ 96(DX), R14 + MOVQ 96(R12), R14 VMOVDQU Y4, (R14)(R13*1) - MOVQ 120(DX), R14 + MOVQ 120(R12), R14 VMOVDQU Y5, (R14)(R13*1) // Prepare for next loop @@ -14410,27 +15884,39 @@ mulAvxTwo_9x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_9x7(SB), $0-88 // Loading no tables to registers + // Destination kept on stack // Full registers estimated 138 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_9x7_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), R12 - MOVQ 192(BX), BX - MOVQ $0x0000000f, R13 - MOVQ R13, X7 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_9x7_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), R11 + MOVQ 192(DX), DX + MOVQ out_base+48(FP), R12 + MOVQ start+72(FP), R13 + + // Add start offset to input + ADDQ R13, BX + ADDQ R13, BP + ADDQ R13, SI + ADDQ R13, DI + ADDQ R13, R8 + ADDQ R13, R9 + ADDQ R13, R10 + ADDQ R13, R11 + ADDQ R13, DX + MOVQ $0x0000000f, R14 + MOVQ R14, X7 VPBROADCASTB X7, Y7 - MOVQ start+72(FP), R13 mulAvxTwo_9x7_loop: // Clear 7 outputs @@ -14443,7 +15929,8 @@ mulAvxTwo_9x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (BP)(R13*1), Y10 + VMOVDQU (BX), Y10 + ADDQ $0x20, BX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -14491,7 +15978,8 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (SI)(R13*1), Y10 + VMOVDQU (BP), Y10 + ADDQ $0x20, BP VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -14539,7 +16027,8 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 2 to 7 outputs - VMOVDQU (DI)(R13*1), Y10 + VMOVDQU (SI), Y10 + ADDQ $0x20, SI VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -14587,7 +16076,8 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 3 to 7 outputs - VMOVDQU (R8)(R13*1), Y10 + VMOVDQU (DI), Y10 + ADDQ $0x20, DI VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -14635,7 +16125,8 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 4 to 7 outputs - VMOVDQU (R9)(R13*1), Y10 + VMOVDQU (R8), Y10 + ADDQ $0x20, R8 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -14683,7 +16174,8 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 5 to 7 outputs - VMOVDQU (R10)(R13*1), Y10 + VMOVDQU (R9), Y10 + ADDQ $0x20, R9 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -14731,7 +16223,8 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 6 to 7 outputs - VMOVDQU (R11)(R13*1), Y10 + VMOVDQU (R10), Y10 + ADDQ $0x20, R10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -14779,7 +16272,8 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 7 to 7 outputs - VMOVDQU (R12)(R13*1), Y10 + VMOVDQU (R11), Y10 + ADDQ $0x20, R11 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -14827,7 +16321,8 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 8 to 7 outputs - VMOVDQU (BX)(R13*1), Y10 + VMOVDQU (DX), Y10 + ADDQ $0x20, DX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -14875,19 +16370,19 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - MOVQ (DX), R14 + MOVQ (R12), R14 VMOVDQU Y0, (R14)(R13*1) - MOVQ 24(DX), R14 + MOVQ 24(R12), R14 VMOVDQU Y1, (R14)(R13*1) - MOVQ 48(DX), R14 + MOVQ 48(R12), R14 VMOVDQU Y2, (R14)(R13*1) - MOVQ 72(DX), R14 + MOVQ 72(R12), R14 VMOVDQU Y3, (R14)(R13*1) - MOVQ 96(DX), R14 + MOVQ 96(R12), R14 VMOVDQU Y4, (R14)(R13*1) - MOVQ 120(DX), R14 + MOVQ 120(R12), R14 VMOVDQU Y5, (R14)(R13*1) - MOVQ 144(DX), R14 + MOVQ 144(R12), R14 VMOVDQU Y6, (R14)(R13*1) // Prepare for next loop @@ -14903,27 +16398,39 @@ mulAvxTwo_9x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_9x8(SB), $0-88 // Loading no tables to registers + // Destination kept on stack // Full registers estimated 157 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_9x8_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), R12 - MOVQ 192(BX), BX - MOVQ $0x0000000f, R13 - MOVQ R13, X8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_9x8_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), R11 + MOVQ 192(DX), DX + MOVQ out_base+48(FP), R12 + MOVQ start+72(FP), R13 + + // Add start offset to input + ADDQ R13, BX + ADDQ R13, BP + ADDQ R13, SI + ADDQ R13, DI + ADDQ R13, R8 + ADDQ R13, R9 + ADDQ R13, R10 + ADDQ R13, R11 + ADDQ R13, DX + MOVQ $0x0000000f, R14 + MOVQ R14, X8 VPBROADCASTB X8, Y8 - MOVQ start+72(FP), R13 mulAvxTwo_9x8_loop: // Clear 8 outputs @@ -14937,7 +16444,8 @@ mulAvxTwo_9x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (BP)(R13*1), Y11 + VMOVDQU (BX), Y11 + ADDQ $0x20, BX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -14991,7 +16499,8 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (SI)(R13*1), Y11 + VMOVDQU (BP), Y11 + ADDQ $0x20, BP VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -15045,7 +16554,8 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 2 to 8 outputs - VMOVDQU (DI)(R13*1), Y11 + VMOVDQU (SI), Y11 + ADDQ $0x20, SI VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -15099,7 +16609,8 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 3 to 8 outputs - VMOVDQU (R8)(R13*1), Y11 + VMOVDQU (DI), Y11 + ADDQ $0x20, DI VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -15153,7 +16664,8 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 4 to 8 outputs - VMOVDQU (R9)(R13*1), Y11 + VMOVDQU (R8), Y11 + ADDQ $0x20, R8 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -15207,7 +16719,8 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 5 to 8 outputs - VMOVDQU (R10)(R13*1), Y11 + VMOVDQU (R9), Y11 + ADDQ $0x20, R9 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -15261,7 +16774,8 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 6 to 8 outputs - VMOVDQU (R11)(R13*1), Y11 + VMOVDQU (R10), Y11 + ADDQ $0x20, R10 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -15315,7 +16829,8 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 7 to 8 outputs - VMOVDQU (R12)(R13*1), Y11 + VMOVDQU (R11), Y11 + ADDQ $0x20, R11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -15369,7 +16884,8 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 8 to 8 outputs - VMOVDQU (BX)(R13*1), Y11 + VMOVDQU (DX), Y11 + ADDQ $0x20, DX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -15423,21 +16939,21 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - MOVQ (DX), R14 + MOVQ (R12), R14 VMOVDQU Y0, (R14)(R13*1) - MOVQ 24(DX), R14 + MOVQ 24(R12), R14 VMOVDQU Y1, (R14)(R13*1) - MOVQ 48(DX), R14 + MOVQ 48(R12), R14 VMOVDQU Y2, (R14)(R13*1) - MOVQ 72(DX), R14 + MOVQ 72(R12), R14 VMOVDQU Y3, (R14)(R13*1) - MOVQ 96(DX), R14 + MOVQ 96(R12), R14 VMOVDQU Y4, (R14)(R13*1) - MOVQ 120(DX), R14 + MOVQ 120(R12), R14 VMOVDQU Y5, (R14)(R13*1) - MOVQ 144(DX), R14 + MOVQ 144(R12), R14 VMOVDQU Y6, (R14)(R13*1) - MOVQ 168(DX), R14 + MOVQ 168(R12), R14 VMOVDQU Y7, (R14)(R13*1) // Prepare for next loop @@ -15453,36 +16969,53 @@ mulAvxTwo_9x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_10x1(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 24 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_10x1_end - MOVQ out_base+48(FP), DX - MOVQ (DX), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), R12 - MOVQ 192(BX), R13 - MOVQ 216(BX), BX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_10x1_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), R11 + MOVQ 192(DX), R12 + MOVQ 216(DX), DX + MOVQ out_base+48(FP), R13 + MOVQ (R13), R13 + MOVQ start+72(FP), R14 + + // Add start offset to output + ADDQ R14, R13 + + // Add start offset to input + ADDQ R14, BX + ADDQ R14, BP + ADDQ R14, SI + ADDQ R14, DI + ADDQ R14, R8 + ADDQ R14, R9 + ADDQ R14, R10 + ADDQ R14, R11 + ADDQ R14, R12 + ADDQ R14, DX MOVQ $0x0000000f, R14 MOVQ R14, X1 VPBROADCASTB X1, Y1 - MOVQ start+72(FP), R14 mulAvxTwo_10x1_loop: // Clear 1 outputs VPXOR Y0, Y0, Y0 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (BP)(R14*1), Y4 + VMOVDQU (BX), Y4 + ADDQ $0x20, BX VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -15494,7 +17027,8 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (SI)(R14*1), Y4 + VMOVDQU (BP), Y4 + ADDQ $0x20, BP VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -15506,7 +17040,8 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 2 to 1 outputs - VMOVDQU (DI)(R14*1), Y4 + VMOVDQU (SI), Y4 + ADDQ $0x20, SI VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -15518,7 +17053,8 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 3 to 1 outputs - VMOVDQU (R8)(R14*1), Y4 + VMOVDQU (DI), Y4 + ADDQ $0x20, DI VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -15530,7 +17066,8 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 4 to 1 outputs - VMOVDQU (R9)(R14*1), Y4 + VMOVDQU (R8), Y4 + ADDQ $0x20, R8 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -15542,7 +17079,8 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 5 to 1 outputs - VMOVDQU (R10)(R14*1), Y4 + VMOVDQU (R9), Y4 + ADDQ $0x20, R9 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -15554,7 +17092,8 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 6 to 1 outputs - VMOVDQU (R11)(R14*1), Y4 + VMOVDQU (R10), Y4 + ADDQ $0x20, R10 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -15566,7 +17105,8 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 7 to 1 outputs - VMOVDQU (R12)(R14*1), Y4 + VMOVDQU (R11), Y4 + ADDQ $0x20, R11 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -15578,7 +17118,8 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 8 to 1 outputs - VMOVDQU (R13)(R14*1), Y4 + VMOVDQU (R12), Y4 + ADDQ $0x20, R12 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -15590,7 +17131,8 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 9 to 1 outputs - VMOVDQU (BX)(R14*1), Y4 + VMOVDQU (DX), Y4 + ADDQ $0x20, DX VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -15602,10 +17144,10 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Store 1 outputs - VMOVDQU Y0, (DX)(R14*1) + VMOVDQU Y0, (R13) + ADDQ $0x20, R13 // Prepare for next loop - ADDQ $0x20, R14 DECQ AX JNZ mulAvxTwo_10x1_loop VZEROUPPER @@ -15617,30 +17159,47 @@ mulAvxTwo_10x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_10x2(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 47 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_10x2_end - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), DX - MOVQ in_base+24(FP), BP - MOVQ (BP), SI - MOVQ 24(BP), DI - MOVQ 48(BP), R8 - MOVQ 72(BP), R9 - MOVQ 96(BP), R10 - MOVQ 120(BP), R11 - MOVQ 144(BP), R12 - MOVQ 168(BP), R13 - MOVQ 192(BP), R14 - MOVQ 216(BP), BP + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_10x2_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), R11 + MOVQ 192(DX), R12 + MOVQ 216(DX), DX + MOVQ out_base+48(FP), R13 + MOVQ (R13), R14 + MOVQ 24(R13), R13 + MOVQ start+72(FP), R15 + + // Add start offset to output + ADDQ R15, R14 + ADDQ R15, R13 + + // Add start offset to input + ADDQ R15, BX + ADDQ R15, BP + ADDQ R15, SI + ADDQ R15, DI + ADDQ R15, R8 + ADDQ R15, R9 + ADDQ R15, R10 + ADDQ R15, R11 + ADDQ R15, R12 + ADDQ R15, DX MOVQ $0x0000000f, R15 MOVQ R15, X2 VPBROADCASTB X2, Y2 - MOVQ start+72(FP), R15 mulAvxTwo_10x2_loop: // Clear 2 outputs @@ -15648,7 +17207,8 @@ mulAvxTwo_10x2_loop: VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (SI)(R15*1), Y5 + VMOVDQU (BX), Y5 + ADDQ $0x20, BX VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -15666,7 +17226,8 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (DI)(R15*1), Y5 + VMOVDQU (BP), Y5 + ADDQ $0x20, BP VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -15684,7 +17245,8 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 2 to 2 outputs - VMOVDQU (R8)(R15*1), Y5 + VMOVDQU (SI), Y5 + ADDQ $0x20, SI VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -15702,7 +17264,8 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 3 to 2 outputs - VMOVDQU (R9)(R15*1), Y5 + VMOVDQU (DI), Y5 + ADDQ $0x20, DI VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -15720,7 +17283,8 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 4 to 2 outputs - VMOVDQU (R10)(R15*1), Y5 + VMOVDQU (R8), Y5 + ADDQ $0x20, R8 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -15738,7 +17302,8 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 5 to 2 outputs - VMOVDQU (R11)(R15*1), Y5 + VMOVDQU (R9), Y5 + ADDQ $0x20, R9 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -15756,7 +17321,8 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 6 to 2 outputs - VMOVDQU (R12)(R15*1), Y5 + VMOVDQU (R10), Y5 + ADDQ $0x20, R10 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -15774,7 +17340,8 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 7 to 2 outputs - VMOVDQU (R13)(R15*1), Y5 + VMOVDQU (R11), Y5 + ADDQ $0x20, R11 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -15792,7 +17359,8 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 8 to 2 outputs - VMOVDQU (R14)(R15*1), Y5 + VMOVDQU (R12), Y5 + ADDQ $0x20, R12 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -15810,7 +17378,8 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 9 to 2 outputs - VMOVDQU (BP)(R15*1), Y5 + VMOVDQU (DX), Y5 + ADDQ $0x20, DX VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -15828,11 +17397,12 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Store 2 outputs - VMOVDQU Y0, (BX)(R15*1) - VMOVDQU Y1, (DX)(R15*1) + VMOVDQU Y0, (R14) + ADDQ $0x20, R14 + VMOVDQU Y1, (R13) + ADDQ $0x20, R13 // Prepare for next loop - ADDQ $0x20, R15 DECQ AX JNZ mulAvxTwo_10x2_loop VZEROUPPER @@ -15844,28 +17414,51 @@ mulAvxTwo_10x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_10x3(SB), $0-88 // Loading no tables to registers + // Destination kept in GP registers // Full registers estimated 68 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_10x3_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), R12 - MOVQ 192(BX), R13 - MOVQ 216(BX), BX - MOVQ $0x0000000f, R14 - MOVQ R14, X3 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_10x3_end + MOVQ in_base+24(FP), AX + MOVQ (AX), DX + MOVQ 24(AX), BX + MOVQ 48(AX), BP + MOVQ 72(AX), SI + MOVQ 96(AX), DI + MOVQ 120(AX), R8 + MOVQ 144(AX), R9 + MOVQ 168(AX), R10 + MOVQ 192(AX), R11 + MOVQ 216(AX), AX + MOVQ out_base+48(FP), R12 + MOVQ (R12), R13 + MOVQ 24(R12), R14 + MOVQ 48(R12), R12 + MOVQ start+72(FP), R15 + + // Add start offset to output + ADDQ R15, R13 + ADDQ R15, R14 + ADDQ R15, R12 + + // Add start offset to input + ADDQ R15, DX + ADDQ R15, BX + ADDQ R15, BP + ADDQ R15, SI + ADDQ R15, DI + ADDQ R15, R8 + ADDQ R15, R9 + ADDQ R15, R10 + ADDQ R15, R11 + ADDQ R15, AX + MOVQ $0x0000000f, R15 + MOVQ R15, X3 VPBROADCASTB X3, Y3 - MOVQ start+72(FP), R14 + MOVQ n+80(FP), R15 + SHRQ $0x05, R15 mulAvxTwo_10x3_loop: // Clear 3 outputs @@ -15874,7 +17467,8 @@ mulAvxTwo_10x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (BP)(R14*1), Y6 + VMOVDQU (DX), Y6 + ADDQ $0x20, DX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -15898,7 +17492,8 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (SI)(R14*1), Y6 + VMOVDQU (BX), Y6 + ADDQ $0x20, BX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -15922,7 +17517,8 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 2 to 3 outputs - VMOVDQU (DI)(R14*1), Y6 + VMOVDQU (BP), Y6 + ADDQ $0x20, BP VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -15946,7 +17542,8 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 3 to 3 outputs - VMOVDQU (R8)(R14*1), Y6 + VMOVDQU (SI), Y6 + ADDQ $0x20, SI VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -15970,7 +17567,8 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 4 to 3 outputs - VMOVDQU (R9)(R14*1), Y6 + VMOVDQU (DI), Y6 + ADDQ $0x20, DI VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -15994,7 +17592,8 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 5 to 3 outputs - VMOVDQU (R10)(R14*1), Y6 + VMOVDQU (R8), Y6 + ADDQ $0x20, R8 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -16018,7 +17617,8 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 6 to 3 outputs - VMOVDQU (R11)(R14*1), Y6 + VMOVDQU (R9), Y6 + ADDQ $0x20, R9 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -16042,7 +17642,8 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 7 to 3 outputs - VMOVDQU (R12)(R14*1), Y6 + VMOVDQU (R10), Y6 + ADDQ $0x20, R10 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -16066,7 +17667,8 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 8 to 3 outputs - VMOVDQU (R13)(R14*1), Y6 + VMOVDQU (R11), Y6 + ADDQ $0x20, R11 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -16090,7 +17692,8 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 9 to 3 outputs - VMOVDQU (BX)(R14*1), Y6 + VMOVDQU (AX), Y6 + ADDQ $0x20, AX VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -16114,16 +17717,15 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - MOVQ (DX), R15 - VMOVDQU Y0, (R15)(R14*1) - MOVQ 24(DX), R15 - VMOVDQU Y1, (R15)(R14*1) - MOVQ 48(DX), R15 - VMOVDQU Y2, (R15)(R14*1) + VMOVDQU Y0, (R13) + ADDQ $0x20, R13 + VMOVDQU Y1, (R14) + ADDQ $0x20, R14 + VMOVDQU Y2, (R12) + ADDQ $0x20, R12 // Prepare for next loop - ADDQ $0x20, R14 - DECQ AX + DECQ R15 JNZ mulAvxTwo_10x3_loop VZEROUPPER @@ -16134,28 +17736,41 @@ mulAvxTwo_10x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_10x4(SB), $0-88 // Loading no tables to registers + // Destination kept on stack // Full registers estimated 89 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_10x4_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), R12 - MOVQ 192(BX), R13 - MOVQ 216(BX), BX - MOVQ $0x0000000f, R14 - MOVQ R14, X4 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_10x4_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), R11 + MOVQ 192(DX), R12 + MOVQ 216(DX), DX + MOVQ out_base+48(FP), R13 + MOVQ start+72(FP), R14 + + // Add start offset to input + ADDQ R14, BX + ADDQ R14, BP + ADDQ R14, SI + ADDQ R14, DI + ADDQ R14, R8 + ADDQ R14, R9 + ADDQ R14, R10 + ADDQ R14, R11 + ADDQ R14, R12 + ADDQ R14, DX + MOVQ $0x0000000f, R15 + MOVQ R15, X4 VPBROADCASTB X4, Y4 - MOVQ start+72(FP), R14 mulAvxTwo_10x4_loop: // Clear 4 outputs @@ -16165,7 +17780,8 @@ mulAvxTwo_10x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (BP)(R14*1), Y7 + VMOVDQU (BX), Y7 + ADDQ $0x20, BX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -16195,7 +17811,8 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (SI)(R14*1), Y7 + VMOVDQU (BP), Y7 + ADDQ $0x20, BP VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -16225,7 +17842,8 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 2 to 4 outputs - VMOVDQU (DI)(R14*1), Y7 + VMOVDQU (SI), Y7 + ADDQ $0x20, SI VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -16255,7 +17873,8 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 3 to 4 outputs - VMOVDQU (R8)(R14*1), Y7 + VMOVDQU (DI), Y7 + ADDQ $0x20, DI VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -16285,7 +17904,8 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 4 to 4 outputs - VMOVDQU (R9)(R14*1), Y7 + VMOVDQU (R8), Y7 + ADDQ $0x20, R8 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -16315,7 +17935,8 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 5 to 4 outputs - VMOVDQU (R10)(R14*1), Y7 + VMOVDQU (R9), Y7 + ADDQ $0x20, R9 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -16345,7 +17966,8 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 6 to 4 outputs - VMOVDQU (R11)(R14*1), Y7 + VMOVDQU (R10), Y7 + ADDQ $0x20, R10 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -16375,7 +17997,8 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 7 to 4 outputs - VMOVDQU (R12)(R14*1), Y7 + VMOVDQU (R11), Y7 + ADDQ $0x20, R11 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -16405,7 +18028,8 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 8 to 4 outputs - VMOVDQU (R13)(R14*1), Y7 + VMOVDQU (R12), Y7 + ADDQ $0x20, R12 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -16435,7 +18059,8 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 9 to 4 outputs - VMOVDQU (BX)(R14*1), Y7 + VMOVDQU (DX), Y7 + ADDQ $0x20, DX VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -16465,13 +18090,13 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - MOVQ (DX), R15 + MOVQ (R13), R15 VMOVDQU Y0, (R15)(R14*1) - MOVQ 24(DX), R15 + MOVQ 24(R13), R15 VMOVDQU Y1, (R15)(R14*1) - MOVQ 48(DX), R15 + MOVQ 48(R13), R15 VMOVDQU Y2, (R15)(R14*1) - MOVQ 72(DX), R15 + MOVQ 72(R13), R15 VMOVDQU Y3, (R15)(R14*1) // Prepare for next loop @@ -16487,28 +18112,41 @@ mulAvxTwo_10x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_10x5(SB), $0-88 // Loading no tables to registers + // Destination kept on stack // Full registers estimated 110 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_10x5_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), R12 - MOVQ 192(BX), R13 - MOVQ 216(BX), BX - MOVQ $0x0000000f, R14 - MOVQ R14, X5 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_10x5_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), R11 + MOVQ 192(DX), R12 + MOVQ 216(DX), DX + MOVQ out_base+48(FP), R13 + MOVQ start+72(FP), R14 + + // Add start offset to input + ADDQ R14, BX + ADDQ R14, BP + ADDQ R14, SI + ADDQ R14, DI + ADDQ R14, R8 + ADDQ R14, R9 + ADDQ R14, R10 + ADDQ R14, R11 + ADDQ R14, R12 + ADDQ R14, DX + MOVQ $0x0000000f, R15 + MOVQ R15, X5 VPBROADCASTB X5, Y5 - MOVQ start+72(FP), R14 mulAvxTwo_10x5_loop: // Clear 5 outputs @@ -16519,7 +18157,8 @@ mulAvxTwo_10x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (BP)(R14*1), Y8 + VMOVDQU (BX), Y8 + ADDQ $0x20, BX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -16555,7 +18194,8 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (SI)(R14*1), Y8 + VMOVDQU (BP), Y8 + ADDQ $0x20, BP VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -16591,7 +18231,8 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 2 to 5 outputs - VMOVDQU (DI)(R14*1), Y8 + VMOVDQU (SI), Y8 + ADDQ $0x20, SI VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -16627,7 +18268,8 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 3 to 5 outputs - VMOVDQU (R8)(R14*1), Y8 + VMOVDQU (DI), Y8 + ADDQ $0x20, DI VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -16663,7 +18305,8 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 4 to 5 outputs - VMOVDQU (R9)(R14*1), Y8 + VMOVDQU (R8), Y8 + ADDQ $0x20, R8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -16699,7 +18342,8 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 5 to 5 outputs - VMOVDQU (R10)(R14*1), Y8 + VMOVDQU (R9), Y8 + ADDQ $0x20, R9 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -16735,7 +18379,8 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 6 to 5 outputs - VMOVDQU (R11)(R14*1), Y8 + VMOVDQU (R10), Y8 + ADDQ $0x20, R10 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -16771,7 +18416,8 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 7 to 5 outputs - VMOVDQU (R12)(R14*1), Y8 + VMOVDQU (R11), Y8 + ADDQ $0x20, R11 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -16807,7 +18453,8 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 8 to 5 outputs - VMOVDQU (R13)(R14*1), Y8 + VMOVDQU (R12), Y8 + ADDQ $0x20, R12 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -16843,7 +18490,8 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 9 to 5 outputs - VMOVDQU (BX)(R14*1), Y8 + VMOVDQU (DX), Y8 + ADDQ $0x20, DX VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -16879,15 +18527,15 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - MOVQ (DX), R15 + MOVQ (R13), R15 VMOVDQU Y0, (R15)(R14*1) - MOVQ 24(DX), R15 + MOVQ 24(R13), R15 VMOVDQU Y1, (R15)(R14*1) - MOVQ 48(DX), R15 + MOVQ 48(R13), R15 VMOVDQU Y2, (R15)(R14*1) - MOVQ 72(DX), R15 + MOVQ 72(R13), R15 VMOVDQU Y3, (R15)(R14*1) - MOVQ 96(DX), R15 + MOVQ 96(R13), R15 VMOVDQU Y4, (R15)(R14*1) // Prepare for next loop @@ -16903,28 +18551,41 @@ mulAvxTwo_10x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_10x6(SB), $0-88 // Loading no tables to registers + // Destination kept on stack // Full registers estimated 131 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_10x6_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), R12 - MOVQ 192(BX), R13 - MOVQ 216(BX), BX - MOVQ $0x0000000f, R14 - MOVQ R14, X6 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_10x6_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), R11 + MOVQ 192(DX), R12 + MOVQ 216(DX), DX + MOVQ out_base+48(FP), R13 + MOVQ start+72(FP), R14 + + // Add start offset to input + ADDQ R14, BX + ADDQ R14, BP + ADDQ R14, SI + ADDQ R14, DI + ADDQ R14, R8 + ADDQ R14, R9 + ADDQ R14, R10 + ADDQ R14, R11 + ADDQ R14, R12 + ADDQ R14, DX + MOVQ $0x0000000f, R15 + MOVQ R15, X6 VPBROADCASTB X6, Y6 - MOVQ start+72(FP), R14 mulAvxTwo_10x6_loop: // Clear 6 outputs @@ -16936,7 +18597,8 @@ mulAvxTwo_10x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (BP)(R14*1), Y9 + VMOVDQU (BX), Y9 + ADDQ $0x20, BX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -16978,7 +18640,8 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (SI)(R14*1), Y9 + VMOVDQU (BP), Y9 + ADDQ $0x20, BP VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -17020,7 +18683,8 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 2 to 6 outputs - VMOVDQU (DI)(R14*1), Y9 + VMOVDQU (SI), Y9 + ADDQ $0x20, SI VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -17062,7 +18726,8 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 3 to 6 outputs - VMOVDQU (R8)(R14*1), Y9 + VMOVDQU (DI), Y9 + ADDQ $0x20, DI VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -17104,7 +18769,8 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 4 to 6 outputs - VMOVDQU (R9)(R14*1), Y9 + VMOVDQU (R8), Y9 + ADDQ $0x20, R8 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -17146,7 +18812,8 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 5 to 6 outputs - VMOVDQU (R10)(R14*1), Y9 + VMOVDQU (R9), Y9 + ADDQ $0x20, R9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -17188,7 +18855,8 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 6 to 6 outputs - VMOVDQU (R11)(R14*1), Y9 + VMOVDQU (R10), Y9 + ADDQ $0x20, R10 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -17230,7 +18898,8 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 7 to 6 outputs - VMOVDQU (R12)(R14*1), Y9 + VMOVDQU (R11), Y9 + ADDQ $0x20, R11 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -17272,7 +18941,8 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 8 to 6 outputs - VMOVDQU (R13)(R14*1), Y9 + VMOVDQU (R12), Y9 + ADDQ $0x20, R12 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -17314,7 +18984,8 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 9 to 6 outputs - VMOVDQU (BX)(R14*1), Y9 + VMOVDQU (DX), Y9 + ADDQ $0x20, DX VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -17356,17 +19027,17 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - MOVQ (DX), R15 + MOVQ (R13), R15 VMOVDQU Y0, (R15)(R14*1) - MOVQ 24(DX), R15 + MOVQ 24(R13), R15 VMOVDQU Y1, (R15)(R14*1) - MOVQ 48(DX), R15 + MOVQ 48(R13), R15 VMOVDQU Y2, (R15)(R14*1) - MOVQ 72(DX), R15 + MOVQ 72(R13), R15 VMOVDQU Y3, (R15)(R14*1) - MOVQ 96(DX), R15 + MOVQ 96(R13), R15 VMOVDQU Y4, (R15)(R14*1) - MOVQ 120(DX), R15 + MOVQ 120(R13), R15 VMOVDQU Y5, (R15)(R14*1) // Prepare for next loop @@ -17382,28 +19053,41 @@ mulAvxTwo_10x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_10x7(SB), $0-88 // Loading no tables to registers + // Destination kept on stack // Full registers estimated 152 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_10x7_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), R12 - MOVQ 192(BX), R13 - MOVQ 216(BX), BX - MOVQ $0x0000000f, R14 - MOVQ R14, X7 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_10x7_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), R11 + MOVQ 192(DX), R12 + MOVQ 216(DX), DX + MOVQ out_base+48(FP), R13 + MOVQ start+72(FP), R14 + + // Add start offset to input + ADDQ R14, BX + ADDQ R14, BP + ADDQ R14, SI + ADDQ R14, DI + ADDQ R14, R8 + ADDQ R14, R9 + ADDQ R14, R10 + ADDQ R14, R11 + ADDQ R14, R12 + ADDQ R14, DX + MOVQ $0x0000000f, R15 + MOVQ R15, X7 VPBROADCASTB X7, Y7 - MOVQ start+72(FP), R14 mulAvxTwo_10x7_loop: // Clear 7 outputs @@ -17416,7 +19100,8 @@ mulAvxTwo_10x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (BP)(R14*1), Y10 + VMOVDQU (BX), Y10 + ADDQ $0x20, BX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -17464,7 +19149,8 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (SI)(R14*1), Y10 + VMOVDQU (BP), Y10 + ADDQ $0x20, BP VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -17512,7 +19198,8 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 2 to 7 outputs - VMOVDQU (DI)(R14*1), Y10 + VMOVDQU (SI), Y10 + ADDQ $0x20, SI VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -17560,7 +19247,8 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 3 to 7 outputs - VMOVDQU (R8)(R14*1), Y10 + VMOVDQU (DI), Y10 + ADDQ $0x20, DI VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -17608,7 +19296,8 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 4 to 7 outputs - VMOVDQU (R9)(R14*1), Y10 + VMOVDQU (R8), Y10 + ADDQ $0x20, R8 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -17656,7 +19345,8 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 5 to 7 outputs - VMOVDQU (R10)(R14*1), Y10 + VMOVDQU (R9), Y10 + ADDQ $0x20, R9 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -17704,7 +19394,8 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 6 to 7 outputs - VMOVDQU (R11)(R14*1), Y10 + VMOVDQU (R10), Y10 + ADDQ $0x20, R10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -17752,7 +19443,8 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 7 to 7 outputs - VMOVDQU (R12)(R14*1), Y10 + VMOVDQU (R11), Y10 + ADDQ $0x20, R11 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -17800,7 +19492,8 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 8 to 7 outputs - VMOVDQU (R13)(R14*1), Y10 + VMOVDQU (R12), Y10 + ADDQ $0x20, R12 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -17848,7 +19541,8 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 9 to 7 outputs - VMOVDQU (BX)(R14*1), Y10 + VMOVDQU (DX), Y10 + ADDQ $0x20, DX VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -17896,19 +19590,19 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - MOVQ (DX), R15 + MOVQ (R13), R15 VMOVDQU Y0, (R15)(R14*1) - MOVQ 24(DX), R15 + MOVQ 24(R13), R15 VMOVDQU Y1, (R15)(R14*1) - MOVQ 48(DX), R15 + MOVQ 48(R13), R15 VMOVDQU Y2, (R15)(R14*1) - MOVQ 72(DX), R15 + MOVQ 72(R13), R15 VMOVDQU Y3, (R15)(R14*1) - MOVQ 96(DX), R15 + MOVQ 96(R13), R15 VMOVDQU Y4, (R15)(R14*1) - MOVQ 120(DX), R15 + MOVQ 120(R13), R15 VMOVDQU Y5, (R15)(R14*1) - MOVQ 144(DX), R15 + MOVQ 144(R13), R15 VMOVDQU Y6, (R15)(R14*1) // Prepare for next loop @@ -17924,28 +19618,41 @@ mulAvxTwo_10x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_10x8(SB), $0-88 // Loading no tables to registers + // Destination kept on stack // Full registers estimated 173 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_10x8_end - MOVQ out_base+48(FP), DX - MOVQ in_base+24(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), R12 - MOVQ 192(BX), R13 - MOVQ 216(BX), BX - MOVQ $0x0000000f, R14 - MOVQ R14, X8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_10x8_end + MOVQ in_base+24(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), R11 + MOVQ 192(DX), R12 + MOVQ 216(DX), DX + MOVQ out_base+48(FP), R13 + MOVQ start+72(FP), R14 + + // Add start offset to input + ADDQ R14, BX + ADDQ R14, BP + ADDQ R14, SI + ADDQ R14, DI + ADDQ R14, R8 + ADDQ R14, R9 + ADDQ R14, R10 + ADDQ R14, R11 + ADDQ R14, R12 + ADDQ R14, DX + MOVQ $0x0000000f, R15 + MOVQ R15, X8 VPBROADCASTB X8, Y8 - MOVQ start+72(FP), R14 mulAvxTwo_10x8_loop: // Clear 8 outputs @@ -17959,7 +19666,8 @@ mulAvxTwo_10x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (BP)(R14*1), Y11 + VMOVDQU (BX), Y11 + ADDQ $0x20, BX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -18013,7 +19721,8 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (SI)(R14*1), Y11 + VMOVDQU (BP), Y11 + ADDQ $0x20, BP VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -18067,7 +19776,8 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 2 to 8 outputs - VMOVDQU (DI)(R14*1), Y11 + VMOVDQU (SI), Y11 + ADDQ $0x20, SI VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -18121,7 +19831,8 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 3 to 8 outputs - VMOVDQU (R8)(R14*1), Y11 + VMOVDQU (DI), Y11 + ADDQ $0x20, DI VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -18175,7 +19886,8 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 4 to 8 outputs - VMOVDQU (R9)(R14*1), Y11 + VMOVDQU (R8), Y11 + ADDQ $0x20, R8 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -18229,7 +19941,8 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 5 to 8 outputs - VMOVDQU (R10)(R14*1), Y11 + VMOVDQU (R9), Y11 + ADDQ $0x20, R9 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -18283,7 +19996,8 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 6 to 8 outputs - VMOVDQU (R11)(R14*1), Y11 + VMOVDQU (R10), Y11 + ADDQ $0x20, R10 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -18337,7 +20051,8 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 7 to 8 outputs - VMOVDQU (R12)(R14*1), Y11 + VMOVDQU (R11), Y11 + ADDQ $0x20, R11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -18391,7 +20106,8 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 8 to 8 outputs - VMOVDQU (R13)(R14*1), Y11 + VMOVDQU (R12), Y11 + ADDQ $0x20, R12 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -18445,7 +20161,8 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 9 to 8 outputs - VMOVDQU (BX)(R14*1), Y11 + VMOVDQU (DX), Y11 + ADDQ $0x20, DX VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -18499,21 +20216,21 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - MOVQ (DX), R15 + MOVQ (R13), R15 VMOVDQU Y0, (R15)(R14*1) - MOVQ 24(DX), R15 + MOVQ 24(R13), R15 VMOVDQU Y1, (R15)(R14*1) - MOVQ 48(DX), R15 + MOVQ 48(R13), R15 VMOVDQU Y2, (R15)(R14*1) - MOVQ 72(DX), R15 + MOVQ 72(R13), R15 VMOVDQU Y3, (R15)(R14*1) - MOVQ 96(DX), R15 + MOVQ 96(R13), R15 VMOVDQU Y4, (R15)(R14*1) - MOVQ 120(DX), R15 + MOVQ 120(R13), R15 VMOVDQU Y5, (R15)(R14*1) - MOVQ 144(DX), R15 + MOVQ 144(R13), R15 VMOVDQU Y6, (R15)(R14*1) - MOVQ 168(DX), R15 + MOVQ 168(R13), R15 VMOVDQU Y7, (R15)(R14*1) // Prepare for next loop diff --git a/vendor/github.com/klauspost/reedsolomon/gen.go b/vendor/github.com/klauspost/reedsolomon/gen.go deleted file mode 100644 index 6fc545c47b..0000000000 --- a/vendor/github.com/klauspost/reedsolomon/gen.go +++ /dev/null @@ -1,249 +0,0 @@ -//+build generate - -//go:generate go run gen.go -out galois_gen_amd64.s -stubs galois_gen_amd64.go -//go:generate gofmt -w galois_gen_switch_amd64.go - -package main - -import ( - "bufio" - "fmt" - "os" - - . "github.com/mmcloughlin/avo/build" - "github.com/mmcloughlin/avo/buildtags" - . "github.com/mmcloughlin/avo/operand" - "github.com/mmcloughlin/avo/reg" -) - -// Technically we can do slightly bigger, but we stay reasonable. -const inputMax = 10 -const outputMax = 8 - -var switchDefs [inputMax][outputMax]string -var switchDefsX [inputMax][outputMax]string - -const perLoopBits = 5 -const perLoop = 1 << perLoopBits - -func main() { - Constraint(buildtags.Not("appengine").ToConstraint()) - Constraint(buildtags.Not("noasm").ToConstraint()) - Constraint(buildtags.Not("nogen").ToConstraint()) - Constraint(buildtags.Term("gc").ToConstraint()) - - for i := 1; i <= inputMax; i++ { - for j := 1; j <= outputMax; j++ { - //genMulAvx2(fmt.Sprintf("mulAvxTwoXor_%dx%d", i, j), i, j, true) - genMulAvx2(fmt.Sprintf("mulAvxTwo_%dx%d", i, j), i, j, false) - } - } - f, err := os.Create("galois_gen_switch_amd64.go") - if err != nil { - panic(err) - } - defer f.Close() - w := bufio.NewWriter(f) - defer w.Flush() - w.WriteString(`// Code generated by command: go generate ` + os.Getenv("GOFILE") + `. DO NOT EDIT. - -// +build !appengine -// +build !noasm -// +build gc -// +build !nogen - -package reedsolomon - -import "fmt" - -`) - - w.WriteString("const avx2CodeGen = true\n") - w.WriteString(fmt.Sprintf("const maxAvx2Inputs = %d\nconst maxAvx2Outputs = %d\n", inputMax, outputMax)) - w.WriteString(` - -func galMulSlicesAvx2(matrix []byte, in, out [][]byte, start, stop int) int { - n := stop-start -`) - - w.WriteString(fmt.Sprintf("n = (n>>%d)<<%d\n\n", perLoopBits, perLoopBits)) - w.WriteString(`switch len(in) { -`) - for in, defs := range switchDefs[:] { - w.WriteString(fmt.Sprintf(" case %d:\n switch len(out) {\n", in+1)) - for out, def := range defs[:] { - w.WriteString(fmt.Sprintf(" case %d:\n", out+1)) - w.WriteString(def) - } - w.WriteString("}\n") - } - w.WriteString(`} - panic(fmt.Sprintf("unhandled size: %dx%d", len(in), len(out))) -} -`) - Generate() -} - -func genMulAvx2(name string, inputs int, outputs int, xor bool) { - total := inputs * outputs - - doc := []string{ - fmt.Sprintf("%s takes %d inputs and produces %d outputs.", name, inputs, outputs), - } - if !xor { - doc = append(doc, "The output is initialized to 0.") - } - - // Load shuffle masks on every use. - var loadNone bool - // Use registers for destination registers. - var regDst = true - - // lo, hi, 1 in, 1 out, 2 tmp, 1 mask - est := total*2 + outputs + 5 - if outputs == 1 { - // We don't need to keep a copy of the input if only 1 output. - est -= 2 - } - - if est > 16 { - loadNone = true - // We run out of GP registers first, now. - if inputs+outputs > 12 { - regDst = false - } - } - - TEXT(name, 0, fmt.Sprintf("func(matrix []byte, in [][]byte, out [][]byte, start, n int)")) - - // SWITCH DEFINITION: - s := fmt.Sprintf(" mulAvxTwo_%dx%d(matrix, in, out, start, n)\n", inputs, outputs) - s += fmt.Sprintf("\t\t\t\treturn n\n") - switchDefs[inputs-1][outputs-1] = s - - if loadNone { - Comment("Loading no tables to registers") - } else { - // loadNone == false - Comment("Loading all tables to registers") - } - - Doc(doc...) - Pragma("noescape") - Commentf("Full registers estimated %d YMM used", est) - - length := Load(Param("n"), GP64()) - matrixBase := GP64() - MOVQ(Param("matrix").Base().MustAddr(), matrixBase) - SHRQ(U8(perLoopBits), length) - TESTQ(length, length) - JZ(LabelRef(name + "_end")) - - dst := make([]reg.VecVirtual, outputs) - dstPtr := make([]reg.GPVirtual, outputs) - outBase := Param("out").Base().MustAddr() - outSlicePtr := GP64() - MOVQ(outBase, outSlicePtr) - for i := range dst { - dst[i] = YMM() - if !regDst { - continue - } - ptr := GP64() - MOVQ(Mem{Base: outSlicePtr, Disp: i * 24}, ptr) - dstPtr[i] = ptr - } - - inLo := make([]reg.VecVirtual, total) - inHi := make([]reg.VecVirtual, total) - - for i := range inLo { - if loadNone { - break - } - tableLo := YMM() - tableHi := YMM() - VMOVDQU(Mem{Base: matrixBase, Disp: i * 64}, tableLo) - VMOVDQU(Mem{Base: matrixBase, Disp: i*64 + 32}, tableHi) - inLo[i] = tableLo - inHi[i] = tableHi - } - - inPtrs := make([]reg.GPVirtual, inputs) - inSlicePtr := GP64() - MOVQ(Param("in").Base().MustAddr(), inSlicePtr) - for i := range inPtrs { - ptr := GP64() - MOVQ(Mem{Base: inSlicePtr, Disp: i * 24}, ptr) - inPtrs[i] = ptr - } - - tmpMask := GP64() - MOVQ(U32(15), tmpMask) - lowMask := YMM() - MOVQ(tmpMask, lowMask.AsX()) - VPBROADCASTB(lowMask.AsX(), lowMask) - - offset := GP64() - MOVQ(Param("start").MustAddr(), offset) - Label(name + "_loop") - if xor { - Commentf("Load %d outputs", outputs) - } else { - Commentf("Clear %d outputs", outputs) - } - for i := range dst { - if xor { - if regDst { - VMOVDQU(Mem{Base: dstPtr[i], Index: offset, Scale: 1}, dst[i]) - continue - } - ptr := GP64() - MOVQ(outBase, ptr) - VMOVDQU(Mem{Base: ptr, Index: offset, Scale: 1}, dst[i]) - } else { - VPXOR(dst[i], dst[i], dst[i]) - } - } - - lookLow, lookHigh := YMM(), YMM() - inLow, inHigh := YMM(), YMM() - for i := range inPtrs { - Commentf("Load and process 32 bytes from input %d to %d outputs", i, outputs) - VMOVDQU(Mem{Base: inPtrs[i], Index: offset, Scale: 1}, inLow) - VPSRLQ(U8(4), inLow, inHigh) - VPAND(lowMask, inLow, inLow) - VPAND(lowMask, inHigh, inHigh) - for j := range dst { - if loadNone { - VMOVDQU(Mem{Base: matrixBase, Disp: 64 * (i*outputs + j)}, lookLow) - VMOVDQU(Mem{Base: matrixBase, Disp: 32 + 64*(i*outputs+j)}, lookHigh) - VPSHUFB(inLow, lookLow, lookLow) - VPSHUFB(inHigh, lookHigh, lookHigh) - } else { - VPSHUFB(inLow, inLo[i*outputs+j], lookLow) - VPSHUFB(inHigh, inHi[i*outputs+j], lookHigh) - } - VPXOR(lookLow, lookHigh, lookLow) - VPXOR(lookLow, dst[j], dst[j]) - } - } - Commentf("Store %d outputs", outputs) - for i := range dst { - if regDst { - VMOVDQU(dst[i], Mem{Base: dstPtr[i], Index: offset, Scale: 1}) - continue - } - ptr := GP64() - MOVQ(Mem{Base: outSlicePtr, Disp: i * 24}, ptr) - VMOVDQU(dst[i], Mem{Base: ptr, Index: offset, Scale: 1}) - } - Comment("Prepare for next loop") - ADDQ(U8(perLoop), offset) - DECQ(length) - JNZ(LabelRef(name + "_loop")) - VZEROUPPER() - - Label(name + "_end") - RET() -} diff --git a/vendor/github.com/klauspost/reedsolomon/go.mod b/vendor/github.com/klauspost/reedsolomon/go.mod index a059d86706..94e444bffe 100644 --- a/vendor/github.com/klauspost/reedsolomon/go.mod +++ b/vendor/github.com/klauspost/reedsolomon/go.mod @@ -2,6 +2,4 @@ module github.com/klauspost/reedsolomon go 1.14 -require ( - github.com/klauspost/cpuid v1.2.4 -) +require github.com/klauspost/cpuid/v2 v2.0.2 diff --git a/vendor/github.com/klauspost/reedsolomon/go.sum b/vendor/github.com/klauspost/reedsolomon/go.sum index 5a44d819b4..a445e735d4 100644 --- a/vendor/github.com/klauspost/reedsolomon/go.sum +++ b/vendor/github.com/klauspost/reedsolomon/go.sum @@ -1,2 +1,2 @@ -github.com/klauspost/cpuid v1.2.4 h1:EBfaK0SWSwk+fgk6efYFWdzl8MwRWoOO1gkmiaTXPW4= -github.com/klauspost/cpuid v1.2.4/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/cpuid/v2 v2.0.2 h1:pd2FBxFydtPn2ywTLStbFg9CJKrojATnpeJWSP7Ys4k= +github.com/klauspost/cpuid/v2 v2.0.2/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= diff --git a/vendor/github.com/klauspost/reedsolomon/inversion_tree.go b/vendor/github.com/klauspost/reedsolomon/inversion_tree.go index c9d8ab2e7e..3f97f810a7 100644 --- a/vendor/github.com/klauspost/reedsolomon/inversion_tree.go +++ b/vendor/github.com/klauspost/reedsolomon/inversion_tree.go @@ -14,7 +14,7 @@ import ( // The tree uses a Reader-Writer mutex to make it thread-safe // when accessing cached matrices and inserting new ones. type inversionTree struct { - mutex *sync.RWMutex + mutex sync.RWMutex root inversionNode } @@ -26,21 +26,22 @@ type inversionNode struct { // newInversionTree initializes a tree for storing inverted matrices. // Note that the root node is the identity matrix as it implies // there were no errors with the original data. -func newInversionTree(dataShards, parityShards int) inversionTree { +func newInversionTree(dataShards, parityShards int) *inversionTree { identity, _ := identityMatrix(dataShards) - root := inversionNode{ - matrix: identity, - children: make([]*inversionNode, dataShards+parityShards), - } - return inversionTree{ - mutex: &sync.RWMutex{}, - root: root, + return &inversionTree{ + root: inversionNode{ + matrix: identity, + children: make([]*inversionNode, dataShards+parityShards), + }, } } // GetInvertedMatrix returns the cached inverted matrix or nil if it // is not found in the tree keyed on the indices of invalid rows. -func (t inversionTree) GetInvertedMatrix(invalidIndices []int) matrix { +func (t *inversionTree) GetInvertedMatrix(invalidIndices []int) matrix { + if t == nil { + return nil + } // Lock the tree for reading before accessing the tree. t.mutex.RLock() defer t.mutex.RUnlock() @@ -63,7 +64,10 @@ var errAlreadySet = errors.New("the root node identity matrix is already set") // keyed by the indices of invalid rows. The total number of shards // is required for creating the proper length lists of child nodes for // each node. -func (t inversionTree) InsertInvertedMatrix(invalidIndices []int, matrix matrix, shards int) error { +func (t *inversionTree) InsertInvertedMatrix(invalidIndices []int, matrix matrix, shards int) error { + if t == nil { + return nil + } // If no invalid indices were given then we are done because the // root node is already set with the identity matrix. if len(invalidIndices) == 0 { @@ -86,7 +90,7 @@ func (t inversionTree) InsertInvertedMatrix(invalidIndices []int, matrix matrix, return nil } -func (n inversionNode) getInvertedMatrix(invalidIndices []int, parent int) matrix { +func (n *inversionNode) getInvertedMatrix(invalidIndices []int, parent int) matrix { // Get the child node to search next from the list of children. The // list of children starts relative to the parent index passed in // because the indices of invalid rows is sorted (by default). As we @@ -117,7 +121,7 @@ func (n inversionNode) getInvertedMatrix(invalidIndices []int, parent int) matri return node.matrix } -func (n inversionNode) insertInvertedMatrix(invalidIndices []int, matrix matrix, shards, parent int) { +func (n *inversionNode) insertInvertedMatrix(invalidIndices []int, matrix matrix, shards, parent int) { // As above, get the child node to search next from the list of children. // The list of children starts relative to the parent index passed in // because the indices of invalid rows is sorted (by default). As we diff --git a/vendor/github.com/klauspost/reedsolomon/matrix.go b/vendor/github.com/klauspost/reedsolomon/matrix.go index a6b9730c7d..22669c27e5 100644 --- a/vendor/github.com/klauspost/reedsolomon/matrix.go +++ b/vendor/github.com/klauspost/reedsolomon/matrix.go @@ -218,7 +218,10 @@ func (m matrix) gaussianElimination() error { if m[r][r] == 0 { for rowBelow := r + 1; rowBelow < rows; rowBelow++ { if m[rowBelow][r] != 0 { - m.SwapRows(r, rowBelow) + err := m.SwapRows(r, rowBelow) + if err != nil { + return err + } break } } diff --git a/vendor/github.com/klauspost/reedsolomon/options.go b/vendor/github.com/klauspost/reedsolomon/options.go index b4adc2a3b9..26269eb797 100644 --- a/vendor/github.com/klauspost/reedsolomon/options.go +++ b/vendor/github.com/klauspost/reedsolomon/options.go @@ -3,7 +3,7 @@ package reedsolomon import ( "runtime" - "github.com/klauspost/cpuid" + "github.com/klauspost/cpuid/v2" ) // Option allows to override processing parameters. @@ -19,6 +19,7 @@ type options struct { usePAR1Matrix bool useCauchy bool fastOneParity bool + inversionCache bool // stream options concReads bool @@ -27,15 +28,16 @@ type options struct { } var defaultOptions = options{ - maxGoroutines: 384, - minSplitSize: -1, - fastOneParity: false, + maxGoroutines: 384, + minSplitSize: -1, + fastOneParity: false, + inversionCache: true, // Detect CPU capabilities. - useSSSE3: cpuid.CPU.SSSE3(), - useSSE2: cpuid.CPU.SSE2(), - useAVX2: cpuid.CPU.AVX2(), - useAVX512: cpuid.CPU.AVX512F() && cpuid.CPU.AVX512BW(), + useSSSE3: cpuid.CPU.Supports(cpuid.SSSE3), + useSSE2: cpuid.CPU.Supports(cpuid.SSE2), + useAVX2: cpuid.CPU.Supports(cpuid.AVX2), + useAVX512: cpuid.CPU.Supports(cpuid.AVX512F, cpuid.AVX512BW), } func init() { @@ -109,6 +111,15 @@ func WithConcurrentStreamWrites(enabled bool) Option { } } +// WithInversionCache allows to control the inversion cache. +// This will cache reconstruction matrices so they can be reused. +// Enabled by default. +func WithInversionCache(enabled bool) Option { + return func(o *options) { + o.inversionCache = enabled + } +} + // WithStreamBlockSize allows to set a custom block size per round of reads/writes. // If not set, any shard size set with WithAutoGoroutines will be used. // If WithAutoGoroutines is also unset, 4MB will be used. diff --git a/vendor/github.com/klauspost/reedsolomon/reedsolomon.go b/vendor/github.com/klauspost/reedsolomon/reedsolomon.go index 13a35d21c1..57f693956c 100644 --- a/vendor/github.com/klauspost/reedsolomon/reedsolomon.go +++ b/vendor/github.com/klauspost/reedsolomon/reedsolomon.go @@ -18,7 +18,7 @@ import ( "runtime" "sync" - "github.com/klauspost/cpuid" + "github.com/klauspost/cpuid/v2" ) // Encoder is an interface to encode Reed-Salomon parity sets for your data. @@ -110,15 +110,16 @@ type reedSolomon struct { ParityShards int // Number of parity shards, should not be modified. Shards int // Total number of shards. Calculated, and should not be modified. m matrix - tree inversionTree + tree *inversionTree parity [][]byte o options mPool sync.Pool } // ErrInvShardNum will be returned by New, if you attempt to create -// an Encoder where either data or parity shards is zero or less. -var ErrInvShardNum = errors.New("cannot create Encoder with zero or less data/parity shards") +// an Encoder with less than one data shard or less than zero parity +// shards. +var ErrInvShardNum = errors.New("cannot create Encoder with less than one data shard or less than zero parity shards") // ErrMaxShardNum will be returned by New, if you attempt to create an // Encoder where data and parity shards are bigger than the order of @@ -249,7 +250,7 @@ func New(dataShards, parityShards int, opts ...Option) (Encoder, error) { for _, opt := range opts { opt(&r.o) } - if dataShards <= 0 || parityShards <= 0 { + if dataShards <= 0 || parityShards < 0 { return nil, ErrInvShardNum } @@ -257,6 +258,10 @@ func New(dataShards, parityShards int, opts ...Option) (Encoder, error) { return nil, ErrMaxShardNum } + if parityShards == 0 { + return &r, nil + } + var err error switch { case r.o.fastOneParity && parityShards == 1: @@ -333,7 +338,9 @@ func New(dataShards, parityShards int, opts ...Option) (Encoder, error) { // The inversion root node will have the identity matrix as // its inversion matrix because it implies there are no errors // with the original data. - r.tree = newInversionTree(dataShards, parityShards) + if r.o.inversionCache { + r.tree = newInversionTree(dataShards, parityShards) + } r.parity = make([][]byte, parityShards) for i := range r.parity { @@ -421,6 +428,10 @@ func (r *reedSolomon) Update(shards [][]byte, newDatashards [][]byte) error { } func (r *reedSolomon) updateParityShards(matrixRows, oldinputs, newinputs, outputs [][]byte, outputCount, byteCount int) { + if len(outputs) == 0 { + return + } + if r.o.maxGoroutines > 1 && byteCount > r.o.minSplitSize { r.updateParityShardsP(matrixRows, oldinputs, newinputs, outputs, outputCount, byteCount) return @@ -520,7 +531,7 @@ func (r *reedSolomon) codeSomeShards(matrixRows, inputs, outputs [][]byte, outpu if end > len(inputs[0]) { end = len(inputs[0]) } - if avx2CodeGen && r.o.useAVX2 && byteCount >= 32 && len(inputs) > 1 && len(outputs) > 1 && len(inputs) <= maxAvx2Inputs && len(outputs) <= maxAvx2Outputs { + if avx2CodeGen && r.o.useAVX2 && byteCount >= 32 && len(inputs)+len(outputs) >= 4 && len(inputs) <= maxAvx2Inputs && len(outputs) <= maxAvx2Outputs { m := genAvx2Matrix(matrixRows, len(inputs), len(outputs), r.mPool.Get().([]byte)) start += galMulSlicesAvx2(m, inputs, outputs, 0, byteCount) r.mPool.Put(m) @@ -550,18 +561,23 @@ func (r *reedSolomon) codeSomeShards(matrixRows, inputs, outputs [][]byte, outpu // several goroutines. func (r *reedSolomon) codeSomeShardsP(matrixRows, inputs, outputs [][]byte, outputCount, byteCount int) { var wg sync.WaitGroup - do := byteCount / r.o.maxGoroutines + gor := r.o.maxGoroutines + + var avx2Matrix []byte + useAvx2 := avx2CodeGen && r.o.useAVX2 && byteCount >= 32 && len(inputs)+len(outputs) >= 4 && len(inputs) <= maxAvx2Inputs && len(outputs) <= maxAvx2Outputs + if useAvx2 { + avx2Matrix = genAvx2Matrix(matrixRows, len(inputs), len(outputs), r.mPool.Get().([]byte)) + defer r.mPool.Put(avx2Matrix) + } + + do := byteCount / gor if do < r.o.minSplitSize { do = r.o.minSplitSize } + // Make sizes divisible by 64 do = (do + 63) & (^63) start := 0 - var avx2Matrix []byte - if avx2CodeGen && r.o.useAVX2 && byteCount >= 32 && len(inputs) > 1 && len(outputs) > 1 && len(inputs) <= maxAvx2Inputs && len(outputs) <= maxAvx2Outputs { - avx2Matrix = genAvx2Matrix(matrixRows, len(inputs), len(outputs), r.mPool.Get().([]byte)) - defer r.mPool.Put(avx2Matrix) - } for start < byteCount { if start+do > byteCount { do = byteCount - start @@ -569,7 +585,7 @@ func (r *reedSolomon) codeSomeShardsP(matrixRows, inputs, outputs [][]byte, outp wg.Add(1) go func(start, stop int) { - if avx2CodeGen && r.o.useAVX2 && stop-start >= 32 && len(inputs) > 1 && len(outputs) > 1 && len(inputs) <= maxAvx2Inputs && len(outputs) <= maxAvx2Outputs { + if useAvx2 && stop-start >= 32 { start += galMulSlicesAvx2(avx2Matrix, inputs, outputs, start, stop) } @@ -605,6 +621,9 @@ func (r *reedSolomon) codeSomeShardsP(matrixRows, inputs, outputs [][]byte, outp // except this will check values and return // as soon as a difference is found. func (r *reedSolomon) checkSomeShards(matrixRows, inputs, toCheck [][]byte, outputCount, byteCount int) bool { + if len(toCheck) == 0 { + return true + } if r.o.maxGoroutines > 1 && byteCount > r.o.minSplitSize { return r.checkSomeShardsP(matrixRows, inputs, toCheck, outputCount, byteCount) } diff --git a/vendor/github.com/mholt/archiver/v3/.gitignore b/vendor/github.com/mholt/archiver/v3/.gitignore index ac8f8b2516..4a87fc1aaf 100644 --- a/vendor/github.com/mholt/archiver/v3/.gitignore +++ b/vendor/github.com/mholt/archiver/v3/.gitignore @@ -1,5 +1,10 @@ +/arc +/cmd/arc/arc +/dist/ +/vendor/ + .DS_Store _gitignore builds/ *.test -cmd/archiver/archiver +.*.sw* diff --git a/vendor/github.com/mholt/archiver/v3/.goreleaser.yml b/vendor/github.com/mholt/archiver/v3/.goreleaser.yml new file mode 100644 index 0000000000..13cc2a679b --- /dev/null +++ b/vendor/github.com/mholt/archiver/v3/.goreleaser.yml @@ -0,0 +1,41 @@ +# This is an example goreleaser.yaml file with some sane defaults. +# Make sure to check the documentation at http://goreleaser.com +project_name: arc +before: + hooks: + # You may remove this if you don't use go modules. + - go mod download + # you may remove this if you don't need go generate + - go generate ./... +builds: + - + env: + - CGO_ENABLED=0 + main: ./cmd/arc + goos: + - linux + - windows + - darwin + goarch: + - 386 + - amd64 + - arm + - arm64 + goarm: + - 6 + - 7 +archives: + - + format: binary + replacements: + darwin: mac +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' diff --git a/vendor/github.com/mholt/archiver/v3/.prettierrc b/vendor/github.com/mholt/archiver/v3/.prettierrc new file mode 100644 index 0000000000..f9f5139c57 --- /dev/null +++ b/vendor/github.com/mholt/archiver/v3/.prettierrc @@ -0,0 +1,4 @@ +{ + "bracketSpacing": true, + "printWidth": 120, +} diff --git a/vendor/github.com/mholt/archiver/v3/README.md b/vendor/github.com/mholt/archiver/v3/README.md index cbf17d53d4..5f7cd514ff 100644 --- a/vendor/github.com/mholt/archiver/v3/README.md +++ b/vendor/github.com/mholt/archiver/v3/README.md @@ -1,5 +1,4 @@ -archiver [![archiver GoDoc](https://img.shields.io/badge/reference-godoc-blue.svg?style=flat-square)](https://pkg.go.dev/github.com/mholt/archiver?tab=doc) -======== +# archiver [![archiver GoDoc](https://img.shields.io/badge/reference-godoc-blue.svg?style=flat-square)](https://pkg.go.dev/github.com/mholt/archiver?tab=doc) Introducing **Archiver 3.1** - a cross-platform, multi-format archive utility and Go library. A powerful and flexible library meets an elegant CLI in this generic replacement for several platform-specific or format-specific archive utilities. @@ -49,23 +48,76 @@ Files are put into the root of the archive; directories are recursively added, p Tar files can optionally be compressed using any of the above compression formats. +## GoDoc + +See ## Install -To install the runnable binary to your $GOPATH/bin: +### With webi + +[`webi`](https://webinstall.dev/arc) will install `webi` and `arc` to `~/.local/bin/` and update your `PATH`. + +#### Mac, Linux, Raspberry Pi ```bash -$ go install github.com/mholt/archiver/cmd/arc +curl -fsS https://webinstall.dev/arc | bash ``` -Or download binaries from the [releases](https://github.com/mholt/archiver/releases) page. +#### Windows 10 -To use as a dependency in your project: +```pwsh +curl.exe -fsS -A MS https://webinstall.dev/arc | powershell +``` +### With Go + +To install the runnable binary to your \$GOPATH/bin: + +```bash +go get github.com/mholt/archiver/cmd/arc ``` -$ go get github.com/mholt/archiver/v3 + +### Manually + +To install manually + +1. Download the binary for your platform from the [Github Releases](https://github.com/mholt/archiver/releases) page. +2. Move the binary to a location in your path, for example: + - without `sudo`: + ```bash + chmod a+x ~/Downloads/arc_* + mkdir -p ~/.local/bin + mv ~/Downloads/arc_* ~/.local/bin/arc + ``` + - as `root`: + ```bash + chmod a+x ~/Downloads/arc_* + sudo mkdir -p /usr/local/bin + sudo mv ~/Downloads/arc_* /usr/local/bin/arc + ``` +3. If needed, update `~/.bashrc` or `~/.profile` to include add `arc` in your `PATH`, for example: + ``` + echo 'PATH="$HOME:/.local/bin:$PATH"' >> ~/.bashrc + ``` + +## Build from Source + +You can successfully build `arc` with just the go tooling, or with `goreleaser`. + +### With `go` + +```bash +go build cmd/arc/*.go ``` +### Multi-platform with `goreleaser` + +Builds with `goreleaser` will also include version info. + +```bash +goreleaser --snapshot --skip-publish --rm-dist +``` ## Command Use @@ -74,31 +126,32 @@ $ go get github.com/mholt/archiver/v3 ```bash # Syntax: arc archive [archive name] [input files...] -$ arc archive test.tar.gz file1.txt images/file2.jpg folder/subfolder +arc archive test.tar.gz file1.txt images/file2.jpg folder/subfolder ``` (At least one input file is required.) - ### Extract entire archive ```bash # Syntax: arc unarchive [archive name] [destination] -$ arc unarchive test.tar.gz +arc unarchive test.tar.gz ``` (The destination path is optional; default is current directory.) The archive name must end with a supported file extension—this is how it knows what kind of archive to make. Run `arc help` for more help. - ### List archive contents ```bash # Syntax: arc ls [archive name] -$ arc ls caddy_dist.tar.gz +arc ls caddy_dist.tar.gz +``` + +```txt drwxr-xr-x matt staff 0 2018-09-19 15:47:18 -0600 MDT dist/ -rw-r--r-- matt staff 6148 2017-08-07 18:34:22 -0600 MDT dist/.DS_Store -rw-r--r-- matt staff 22481 2018-09-19 15:47:18 -0600 MDT dist/CHANGES.txt @@ -109,23 +162,21 @@ drwxr-xr-x matt staff 0 2018-09-19 15:47:18 -0600 MDT dist/ ... ``` - ### Extract a specific file or folder from an archive ```bash # Syntax: arc extract [archive name] [path in archive] [destination on disk] -$ arc extract test.tar.gz foo/hello.txt extracted/hello.txt +arc extract test.tar.gz foo/hello.txt extracted/hello.txt ``` - ### Compress a single file ```bash # Syntax: arc compress [input file] [output file] -$ arc compress test.txt compressed_test.txt.gz -$ arc compress test.txt gz +arc compress test.txt compressed_test.txt.gz +arc compress test.txt gz ``` For convenience, the output file (second argument) may simply be a compression format (without leading dot), in which case the output filename will be the same as the input filename but with the format extension appended, and the input file will be deleted if successful. @@ -135,23 +186,26 @@ For convenience, the output file (second argument) may simply be a compression f ```bash # Syntax: arc decompress [input file] [output file] -$ arc decompress test.txt.gz original_test.txt -$ arc decompress test.txt.gz +arc decompress test.txt.gz original_test.txt +arc decompress test.txt.gz ``` For convenience, the output file (second argument) may be omitted. In that case, the output filename will have the same name as the input filename, but with the compression extension stripped from the end; and the input file will be deleted if successful. - ### Flags Flags are specified before the subcommand. Use `arc help` or `arc -h` to get usage help and a description of flags with their default values. - - ## Library Use The archiver package allows you to easily create and open archives, walk their contents, extract specific files, compress and decompress files, and even stream archives in and out using pure io.Reader and io.Writer interfaces, without ever needing to touch the disk. +To use as a dependency in your project: + +```bash +go get github.com/mholt/archiver/v3 +``` + ```go import "github.com/mholt/archiver/v3" ``` @@ -209,7 +263,7 @@ for _, fname := range filenames { if err != nil { return err } - + // get file's name for the inside of the archive internalName, err := archiver.NameInArchive(info, fname, fname) if err != nil { @@ -243,7 +297,6 @@ There's a lot more that can be done, too. [See the GoDoc](https://pkg.go.dev/git **Security note: This package does NOT attempt to mitigate zip-slip attacks.** It is [extremely difficult](https://github.com/rubyzip/rubyzip/pull/376) [to do properly](https://github.com/mholt/archiver/pull/65#issuecomment-395988244) and [seemingly impossible to mitigate effectively across platforms](https://github.com/golang/go/issues/20126). [Attempted fixes have broken processing of legitimate files in production](https://github.com/mholt/archiver/pull/70#issuecomment-423267320), rendering the program unusable. Our recommendation instead is to inspect the contents of an untrusted archive before extracting it (this package provides `Walkers`) and decide if you want to proceed with extraction. - ## Project Values This project has a few principle-based goals that guide its development: diff --git a/vendor/github.com/mholt/archiver/v3/archiver.go b/vendor/github.com/mholt/archiver/v3/archiver.go index ecf315e058..b09699d676 100644 --- a/vendor/github.com/mholt/archiver/v3/archiver.go +++ b/vendor/github.com/mholt/archiver/v3/archiver.go @@ -72,6 +72,11 @@ type ExtensionChecker interface { CheckExt(name string) error } +// FilenameChecker validates filenames to prevent path traversal attacks +type FilenameChecker interface { + CheckPath(to, filename string) error +} + // Unarchiver is a type that can extract archive files // into a folder. type Unarchiver interface { diff --git a/vendor/github.com/mholt/archiver/v3/azure-pipelines.yml b/vendor/github.com/mholt/archiver/v3/azure-pipelines.yml index a86a62059f..672dce356c 100644 --- a/vendor/github.com/mholt/archiver/v3/azure-pipelines.yml +++ b/vendor/github.com/mholt/archiver/v3/azure-pipelines.yml @@ -4,10 +4,11 @@ trigger: strategy: matrix: linux: - imageName: ubuntu-16.04 + imageName: ubuntu-18.04 gorootDir: /usr/local mac: - imageName: macos-10.13 + # Mojave + imageName: macos-10.14 gorootDir: /usr/local windows: imageName: windows-2019 @@ -26,6 +27,12 @@ variables: #GO111MODULE: on steps: + +- bash: git config --global core.autocrlf false + displayName: "Disable line ending conversion for git to" + +- checkout: self + - bash: | latestGo=$(curl "https://golang.org/VERSION?m=text") echo "##vso[task.setvariable variable=LATEST_GO]$latestGo" @@ -57,18 +64,16 @@ steps: displayName: Install Go on macOS - powershell: | - Write-Host "Downloading Go... (please be patient, I am very slow)" - (New-Object System.Net.WebClient).DownloadFile("https://dl.google.com/go/$(LATEST_GO).windows-amd64.zip", "$(LATEST_GO).windows-amd64.zip") - Write-Host "Extracting Go... (I'm slow too)" - Expand-Archive "$(LATEST_GO).windows-amd64.zip" -DestinationPath "$(gorootDir)" + echo "Downloading Go..." + # Windows comes with BSD curl, which is MUCH faster than the native Windows HTTP + curl.exe -fsSL -o "$(LATEST_GO).windows-amd64.zip" "https://dl.google.com/go/$(LATEST_GO).windows-amd64.zip" + echo "Extracting Go..." + # Yes, Windows tar (BSD tar) handles zip files. Who knew!? + # (and it's MUCH, MUCH, MUCH faster than the native Windows expander) + tar.exe xf "$(LATEST_GO).windows-amd64.zip" -C "$(gorootDir)" condition: eq( variables['Agent.OS'], 'Windows_NT' ) displayName: Install Go on Windows -# TODO: When this issue is fixed, replace with installer script: -# https://github.com/golangci/golangci-lint/issues/472 -- script: go get -v github.com/golangci/golangci-lint/cmd/golangci-lint - displayName: Install golangci-lint - - bash: | printf "Using go at: $(which go)\n" printf "Go version: $(go version)\n" @@ -79,8 +84,28 @@ steps: displayName: Print Go version and environment - script: | - go get -v -t -d ./... - golangci-lint run -E gofmt -E goimports -E misspell + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.31.0 + ./bin/golangci-lint run -E gofmt -E goimports -E misspell ./... + workingDirectory: '$(modulePath)' + condition: eq( variables['Agent.OS'], 'Linux' ) + displayName: Run Lint + +- bash: | + go mod tidy + if [ ! -z "$(git status --porcelain go.mod)" ]; then + printf "go.mod has modifications\n" + git diff go.mod + exit 1 + fi + if [ ! -z "$(git status --porcelain go.sum)" ]; then + printf "go.sum has modifications\n" + git diff go.sum + exit 1 + fi + workingDirectory: '$(modulePath)' + displayName: Ensure that module definition and checksums are correct + +- script: | go test -race ./... workingDirectory: '$(modulePath)' displayName: Run tests diff --git a/vendor/github.com/mholt/archiver/v3/error.go b/vendor/github.com/mholt/archiver/v3/error.go new file mode 100644 index 0000000000..a46235c652 --- /dev/null +++ b/vendor/github.com/mholt/archiver/v3/error.go @@ -0,0 +1,27 @@ +package archiver + +import ( + "fmt" + "strings" +) + +// IllegalPathError is an error returned when an illegal +// path is detected during the archival process. +// +// By default, only the Filename is showed on error, but you might +// also get the absolute value of the invalid path on the AbsolutePath +// field. +type IllegalPathError struct { + AbsolutePath string + Filename string +} + +func (err *IllegalPathError) Error() string { + return fmt.Sprintf("illegal file path: %s", err.Filename) +} + +// IsIllegalPathError returns true if the provided error is of +// the type IllegalPathError. +func IsIllegalPathError(err error) bool { + return err != nil && strings.Contains(err.Error(), "illegal file path: ") +} diff --git a/vendor/github.com/mholt/archiver/v3/go.mod b/vendor/github.com/mholt/archiver/v3/go.mod index 8586b7a19b..8d8e4e16fa 100644 --- a/vendor/github.com/mholt/archiver/v3/go.mod +++ b/vendor/github.com/mholt/archiver/v3/go.mod @@ -1,16 +1,15 @@ module github.com/mholt/archiver/v3 -go 1.12 +go 1.13 require ( - github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6 + github.com/andybalholm/brotli v1.0.0 github.com/dsnet/compress v0.0.1 github.com/golang/snappy v0.0.1 - github.com/google/go-cmp v0.3.0 // indirect - github.com/klauspost/compress v1.9.2 - github.com/klauspost/pgzip v1.2.1 - github.com/nwaples/rardecode v1.0.0 - github.com/pierrec/lz4 v2.0.5+incompatible - github.com/ulikunitz/xz v0.5.6 + github.com/klauspost/compress v1.10.10 + github.com/klauspost/pgzip v1.2.4 + github.com/nwaples/rardecode v1.1.0 + github.com/pierrec/lz4/v4 v4.0.3 + github.com/ulikunitz/xz v0.5.7 github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 ) diff --git a/vendor/github.com/mholt/archiver/v3/go.sum b/vendor/github.com/mholt/archiver/v3/go.sum index 29c45105fe..adf9ee7dbb 100644 --- a/vendor/github.com/mholt/archiver/v3/go.sum +++ b/vendor/github.com/mholt/archiver/v3/go.sum @@ -1,26 +1,24 @@ -github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6 h1:bZ28Hqta7TFAK3Q08CMvv8y3/8ATaEqv2nGoc6yff6c= -github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6/go.mod h1:+lx6/Aqd1kLJ1GQfkvOnaZ1WGmLpMpbprPuIOOZX30U= +github.com/andybalholm/brotli v1.0.0 h1:7UCwP93aiSfvWpapti8g88vVVGp2qqtGyePsSuDafo4= +github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q= github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= -github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721 h1:KRMr9A3qfbVM7iV/WcLY/rL5LICqwMHLhwRXKu99fXw= -github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.2 h1:LfVyl+ZlLlLDeQ/d2AqfGIIH4qEDu0Ed2S5GyhCWIWY= -github.com/klauspost/compress v1.9.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.10.10 h1:a/y8CglcM7gLGYmlbP/stPE5sR3hbhFRUjCBfd/0B3I= +github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/pgzip v1.2.1 h1:oIPZROsWuPHpOdMVWLuJZXwgjhrW8r1yEX8UqMyeNHM= -github.com/klauspost/pgzip v1.2.1/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= -github.com/nwaples/rardecode v1.0.0 h1:r7vGuS5akxOnR4JQSkko62RJ1ReCMXxQRPtxsiFMBOs= -github.com/nwaples/rardecode v1.0.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= -github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/klauspost/pgzip v1.2.4 h1:TQ7CNpYKovDOmqzRHKxJh0BeaBI7UdQZYc6p7pMQh1A= +github.com/klauspost/pgzip v1.2.4/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/nwaples/rardecode v1.1.0 h1:vSxaY8vQhOcVr4mm5e8XllHWTiM4JF507A0Katqw7MQ= +github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= +github.com/pierrec/lz4/v4 v4.0.3 h1:vNQKSVZNYUEAvRY9FaUXAF1XPbSOHJtDTiP41kzDz2E= +github.com/pierrec/lz4/v4 v4.0.3/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/ulikunitz/xz v0.5.6 h1:jGHAfXawEGZQ3blwU5wnWKQJvAraT7Ftq9EXjnXYgt8= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +github.com/ulikunitz/xz v0.5.7 h1:YvTNdFzX6+W5m9msiYg/zpkSURPPtOlzbqYjrFn7Yt4= +github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= diff --git a/vendor/github.com/mholt/archiver/v3/gz.go b/vendor/github.com/mholt/archiver/v3/gz.go index 3922e7a53b..650718d0f3 100644 --- a/vendor/github.com/mholt/archiver/v3/gz.go +++ b/vendor/github.com/mholt/archiver/v3/gz.go @@ -1,12 +1,12 @@ package archiver import ( - "compress/gzip" "fmt" "io" "path/filepath" - pgzip "github.com/klauspost/pgzip" + "github.com/klauspost/compress/gzip" + "github.com/klauspost/pgzip" ) // Gz facilitates gzip compression. diff --git a/vendor/github.com/mholt/archiver/v3/lz4.go b/vendor/github.com/mholt/archiver/v3/lz4.go index daff631d6d..3d6b0a212d 100644 --- a/vendor/github.com/mholt/archiver/v3/lz4.go +++ b/vendor/github.com/mholt/archiver/v3/lz4.go @@ -5,7 +5,7 @@ import ( "io" "path/filepath" - "github.com/pierrec/lz4" + "github.com/pierrec/lz4/v4" ) // Lz4 facilitates LZ4 compression. @@ -16,7 +16,14 @@ type Lz4 struct { // Compress reads in, compresses it, and writes it to out. func (lz *Lz4) Compress(in io.Reader, out io.Writer) error { w := lz4.NewWriter(out) - w.Header.CompressionLevel = lz.CompressionLevel + // TODO archiver v4: use proper lz4.Fast + // bitshifting for backwards compatibility with lz4/v3 + options := []lz4.Option{ + lz4.CompressionLevelOption(lz4.CompressionLevel(1 << (8 + lz.CompressionLevel))), + } + if err := w.Apply(options...); err != nil { + return err + } defer w.Close() _, err := io.Copy(w, in) return err diff --git a/vendor/github.com/mholt/archiver/v3/rar.go b/vendor/github.com/mholt/archiver/v3/rar.go index 84eabda820..56c2a3e3e8 100644 --- a/vendor/github.com/mholt/archiver/v3/rar.go +++ b/vendor/github.com/mholt/archiver/v3/rar.go @@ -40,6 +40,10 @@ type Rar struct { // especially on extraction. ImplicitTopLevelFolder bool + // Strip number of leading paths. This feature is available + // only during unpacking of the entire archive. + StripComponents int + // If true, errors encountered during reading // or writing a single file will be logged and // the operation will continue on remaining files. @@ -60,6 +64,17 @@ func (*Rar) CheckExt(filename string) error { return nil } +// CheckPath ensures that the filename has not been crafted to perform path traversal attacks +func (*Rar) CheckPath(to, filename string) error { + to, _ = filepath.Abs(to) //explicit the destination folder to prevent that 'string.HasPrefix' check can be 'bypassed' when no destination folder is supplied in input + dest := filepath.Join(to, filename) + //prevent path traversal attacks + if !strings.HasPrefix(dest, to) { + return &IllegalPathError{AbsolutePath: dest, Filename: filename} + } + return nil +} + // Unarchive unpacks the .rar file at source to destination. // Destination will be treated as a folder name. It supports // multi-volume archives. @@ -94,7 +109,7 @@ func (r *Rar) Unarchive(source, destination string) error { break } if err != nil { - if r.ContinueOnError { + if r.ContinueOnError || IsIllegalPathError(err) { log.Printf("[ERROR] Reading file in rar archive: %v", err) continue } @@ -145,10 +160,29 @@ func (r *Rar) unrarNext(to string) error { if err != nil { return err // don't wrap error; calling loop must break on io.EOF } + defer f.Close() + header, ok := f.Header.(*rardecode.FileHeader) if !ok { return fmt.Errorf("expected header to be *rardecode.FileHeader but was %T", f.Header) } + + errPath := r.CheckPath(to, header.Name) + if errPath != nil { + return fmt.Errorf("checking path traversal attempt: %v", errPath) + } + + if r.StripComponents > 0 { + if strings.Count(header.Name, "/") < r.StripComponents { + return nil // skip path with fewer components + } + + for i := 0; i < r.StripComponents; i++ { + slash := strings.Index(header.Name, "/") + header.Name = header.Name[slash+1:] + } + } + return r.unrarFile(f, filepath.Join(to, header.Name)) } @@ -363,7 +397,9 @@ func (*Rar) Match(file io.ReadSeeker) (bool, error) { if err != nil { return false, err } - defer file.Seek(currentPos, io.SeekStart) + defer func() { + _, _ = file.Seek(currentPos, io.SeekStart) + }() buf := make([]byte, 8) if n, err := file.Read(buf); err != nil || n < 8 { @@ -402,6 +438,7 @@ var ( _ = Extractor(new(Rar)) _ = Matcher(new(Rar)) _ = ExtensionChecker(new(Rar)) + _ = FilenameChecker(new(Rar)) _ = os.FileInfo(rarFileInfo{}) ) diff --git a/vendor/github.com/mholt/archiver/v3/sz.go b/vendor/github.com/mholt/archiver/v3/sz.go index 39c5865efe..02009b528f 100644 --- a/vendor/github.com/mholt/archiver/v3/sz.go +++ b/vendor/github.com/mholt/archiver/v3/sz.go @@ -13,7 +13,7 @@ type Snappy struct{} // Compress reads in, compresses it, and writes it to out. func (s *Snappy) Compress(in io.Reader, out io.Writer) error { - w := snappy.NewWriter(out) + w := snappy.NewBufferedWriter(out) defer w.Close() _, err := io.Copy(w, in) return err diff --git a/vendor/github.com/mholt/archiver/v3/tar.go b/vendor/github.com/mholt/archiver/v3/tar.go index e983531533..60c58fd135 100644 --- a/vendor/github.com/mholt/archiver/v3/tar.go +++ b/vendor/github.com/mholt/archiver/v3/tar.go @@ -40,6 +40,10 @@ type Tar struct { // especially on extraction. ImplicitTopLevelFolder bool + // Strip number of leading paths. This feature is available + // only during unpacking of the entire archive. + StripComponents int + // If true, errors encountered during reading // or writing a single file will be logged and // the operation will continue on remaining files. @@ -61,6 +65,17 @@ func (*Tar) CheckExt(filename string) error { return nil } +// CheckPath ensures that the filename has not been crafted to perform path traversal attacks +func (*Tar) CheckPath(to, filename string) error { + to, _ = filepath.Abs(to) //explicit the destination folder to prevent that 'string.HasPrefix' check can be 'bypassed' when no destination folder is supplied in input + dest := filepath.Join(to, filename) + //prevent path traversal attacks + if !strings.HasPrefix(dest, to) { + return &IllegalPathError{AbsolutePath: dest, Filename: filename} + } + return nil +} + // Archive creates a tarball file at destination containing // the files listed in sources. The destination must end with // ".tar". File paths can be those of regular files or @@ -150,7 +165,7 @@ func (t *Tar) Unarchive(source, destination string) error { break } if err != nil { - if t.ContinueOnError { + if t.ContinueOnError || IsIllegalPathError(err) { log.Printf("[ERROR] Reading file in tar archive: %v", err) continue } @@ -206,29 +221,44 @@ func (t *Tar) addTopLevelFolder(sourceArchive, destination string) (string, erro return destination, nil } -func (t *Tar) untarNext(to string) error { +func (t *Tar) untarNext(destination string) error { f, err := t.Read() if err != nil { return err // don't wrap error; calling loop must break on io.EOF } + defer f.Close() + header, ok := f.Header.(*tar.Header) if !ok { return fmt.Errorf("expected header to be *tar.Header but was %T", f.Header) } - return t.untarFile(f, filepath.Join(to, header.Name)) + + errPath := t.CheckPath(destination, header.Name) + if errPath != nil { + return fmt.Errorf("checking path traversal attempt: %v", errPath) + } + + if t.StripComponents > 0 { + if strings.Count(header.Name, "/") < t.StripComponents { + return nil // skip path with fewer components + } + + for i := 0; i < t.StripComponents; i++ { + slash := strings.Index(header.Name, "/") + header.Name = header.Name[slash+1:] + } + } + return t.untarFile(f, destination, header) } -func (t *Tar) untarFile(f File, to string) error { +func (t *Tar) untarFile(f File, destination string, hdr *tar.Header) error { + to := filepath.Join(destination, hdr.Name) + // do not overwrite existing files, if configured if !f.IsDir() && !t.OverwriteExisting && fileExists(to) { return fmt.Errorf("file already exists: %s", to) } - hdr, ok := f.Header.(*tar.Header) - if !ok { - return fmt.Errorf("expected header to be *tar.Header but was %T", f.Header) - } - switch hdr.Typeflag { case tar.TypeDir: return mkdir(to, f.Mode()) @@ -237,7 +267,7 @@ func (t *Tar) untarFile(f File, to string) error { case tar.TypeSymlink: return writeNewSymbolicLink(to, hdr.Linkname) case tar.TypeLink: - return writeNewHardLink(to, filepath.Join(to, hdr.Linkname)) + return writeNewHardLink(to, filepath.Join(destination, hdr.Linkname)) case tar.TypeXGlobalHeader: return nil // ignore the pax global header from git-generated tarballs default: @@ -513,9 +543,14 @@ func (t *Tar) Extract(source, target, destination string) error { if err != nil { return fmt.Errorf("relativizing paths: %v", err) } - joined := filepath.Join(destination, end) + th.Name = end + + // relativize any hardlink names + if th.Typeflag == tar.TypeLink { + th.Linkname = filepath.Join(filepath.Base(filepath.Dir(th.Linkname)), filepath.Base(th.Linkname)) + } - err = t.untarFile(f, joined) + err = t.untarFile(f, destination, th) if err != nil { return fmt.Errorf("extracting file %s: %v", th.Name, err) } @@ -544,7 +579,9 @@ func (*Tar) Match(file io.ReadSeeker) (bool, error) { if err != nil { return false, err } - defer file.Seek(currentPos, io.SeekStart) + defer func() { + _, _ = file.Seek(currentPos, io.SeekStart) + }() buf := make([]byte, tarBlockSize) if _, err = io.ReadFull(file, buf); err != nil { @@ -610,6 +647,7 @@ var ( _ = Extractor(new(Tar)) _ = Matcher(new(Tar)) _ = ExtensionChecker(new(Tar)) + _ = FilenameChecker(new(Tar)) ) // DefaultTar is a default instance that is conveniently ready to use. diff --git a/vendor/github.com/mholt/archiver/v3/targz.go b/vendor/github.com/mholt/archiver/v3/targz.go index 07777d0cfa..283fd01b2b 100644 --- a/vendor/github.com/mholt/archiver/v3/targz.go +++ b/vendor/github.com/mholt/archiver/v3/targz.go @@ -1,12 +1,12 @@ package archiver import ( - "compress/gzip" "fmt" "io" "strings" - pgzip "github.com/klauspost/pgzip" + "github.com/klauspost/compress/gzip" + "github.com/klauspost/pgzip" ) // TarGz facilitates gzip compression diff --git a/vendor/github.com/mholt/archiver/v3/tarlz4.go b/vendor/github.com/mholt/archiver/v3/tarlz4.go index 4a178f691c..42cbc90bbb 100644 --- a/vendor/github.com/mholt/archiver/v3/tarlz4.go +++ b/vendor/github.com/mholt/archiver/v3/tarlz4.go @@ -5,7 +5,7 @@ import ( "io" "strings" - "github.com/pierrec/lz4" + "github.com/pierrec/lz4/v4" ) // TarLz4 facilitates lz4 compression @@ -84,7 +84,14 @@ func (tlz4 *TarLz4) wrapWriter() { var lz4w *lz4.Writer tlz4.Tar.writerWrapFn = func(w io.Writer) (io.Writer, error) { lz4w = lz4.NewWriter(w) - lz4w.Header.CompressionLevel = tlz4.CompressionLevel + // TODO archiver v4: use proper lz4.Fast + // bitshifting for backwards compatibility with lz4/v3 + options := []lz4.Option{ + lz4.CompressionLevelOption(lz4.CompressionLevel(1 << (8 + tlz4.CompressionLevel))), + } + if err := lz4w.Apply(options...); err != nil { + return lz4w, err + } return lz4w, nil } tlz4.Tar.cleanupWrapFn = func() { diff --git a/vendor/github.com/mholt/archiver/v3/tarsz.go b/vendor/github.com/mholt/archiver/v3/tarsz.go index 0569e66473..ee3808e63d 100644 --- a/vendor/github.com/mholt/archiver/v3/tarsz.go +++ b/vendor/github.com/mholt/archiver/v3/tarsz.go @@ -77,7 +77,7 @@ func (tsz *TarSz) Extract(source, target, destination string) error { func (tsz *TarSz) wrapWriter() { var sw *snappy.Writer tsz.Tar.writerWrapFn = func(w io.Writer) (io.Writer, error) { - sw = snappy.NewWriter(w) + sw = snappy.NewBufferedWriter(w) return sw, nil } tsz.Tar.cleanupWrapFn = func() { diff --git a/vendor/github.com/mholt/archiver/v3/zip.go b/vendor/github.com/mholt/archiver/v3/zip.go index 192bf60766..81694bdc45 100644 --- a/vendor/github.com/mholt/archiver/v3/zip.go +++ b/vendor/github.com/mholt/archiver/v3/zip.go @@ -6,11 +6,31 @@ import ( "compress/flate" "fmt" "io" + "io/ioutil" "log" "os" "path" "path/filepath" "strings" + + "github.com/dsnet/compress/bzip2" + "github.com/klauspost/compress/zstd" + "github.com/ulikunitz/xz" +) + +// ZipCompressionMethod Compression type +type ZipCompressionMethod uint16 + +// Compression methods. +// see https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT. +// Note LZMA: Disabled - because 7z isn't able to unpack ZIP+LZMA ZIP+LZMA2 archives made this way - and vice versa. +const ( + Store ZipCompressionMethod = 0 + Deflate ZipCompressionMethod = 8 + BZIP2 ZipCompressionMethod = 12 + LZMA ZipCompressionMethod = 14 + ZSTD ZipCompressionMethod = 93 + XZ ZipCompressionMethod = 95 ) // Zip provides facilities for operating ZIP archives. @@ -50,14 +70,21 @@ type Zip struct { // especially on extraction. ImplicitTopLevelFolder bool + // Strip number of leading paths. This feature is available + // only during unpacking of the entire archive. + StripComponents int + // If true, errors encountered during reading // or writing a single file will be logged and // the operation will continue on remaining files. ContinueOnError bool - zw *zip.Writer - zr *zip.Reader - ridx int + // Compression algorithm + FileMethod ZipCompressionMethod + zw *zip.Writer + zr *zip.Reader + ridx int + //decinitialized bool } // CheckExt ensures the file extension matches the format. @@ -68,6 +95,43 @@ func (*Zip) CheckExt(filename string) error { return nil } +// Registering a global decompressor is not reentrant and may panic +func registerDecompressor(zr *zip.Reader) { + // register zstd decompressor + zr.RegisterDecompressor(uint16(ZSTD), func(r io.Reader) io.ReadCloser { + zr, err := zstd.NewReader(r) + if err != nil { + return nil + } + return zr.IOReadCloser() + }) + zr.RegisterDecompressor(uint16(BZIP2), func(r io.Reader) io.ReadCloser { + bz2r, err := bzip2.NewReader(r, nil) + if err != nil { + return nil + } + return bz2r + }) + zr.RegisterDecompressor(uint16(XZ), func(r io.Reader) io.ReadCloser { + xr, err := xz.NewReader(r) + if err != nil { + return nil + } + return ioutil.NopCloser(xr) + }) +} + +// CheckPath ensures the file extension matches the format. +func (*Zip) CheckPath(to, filename string) error { + to, _ = filepath.Abs(to) //explicit the destination folder to prevent that 'string.HasPrefix' check can be 'bypassed' when no destination folder is supplied in input + dest := filepath.Join(to, filename) + //prevent path traversal attacks + if !strings.HasPrefix(dest, to) { + return &IllegalPathError{AbsolutePath: dest, Filename: filename} + } + return nil +} + // Archive creates a .zip file at destination containing // the files listed in sources. The destination must end // with ".zip". File paths can be those of regular files @@ -165,7 +229,7 @@ func (z *Zip) Unarchive(source, destination string) error { break } if err != nil { - if z.ContinueOnError { + if z.ContinueOnError || IsIllegalPathError(err) { log.Printf("[ERROR] Reading file in zip archive: %v", err) continue } @@ -182,15 +246,31 @@ func (z *Zip) extractNext(to string) error { return err // don't wrap error; calling loop must break on io.EOF } defer f.Close() - return z.extractFile(f, to) -} -func (z *Zip) extractFile(f File, to string) error { header, ok := f.Header.(zip.FileHeader) if !ok { return fmt.Errorf("expected header to be zip.FileHeader but was %T", f.Header) } + errPath := z.CheckPath(to, header.Name) + if errPath != nil { + return fmt.Errorf("checking path traversal attempt: %v", errPath) + } + + if z.StripComponents > 0 { + if strings.Count(header.Name, "/") < z.StripComponents { + return nil // skip path with fewer components + } + + for i := 0; i < z.StripComponents; i++ { + slash := strings.Index(header.Name, "/") + header.Name = header.Name[slash+1:] + } + } + return z.extractFile(f, to, &header) +} + +func (z *Zip) extractFile(f File, to string, header *zip.FileHeader) error { to = filepath.Join(to, header.Name) // if a directory, no content; simply make the directory and return @@ -292,6 +372,20 @@ func (z *Zip) Create(out io.Writer) error { return flate.NewWriter(out, z.CompressionLevel) }) } + switch z.FileMethod { + case BZIP2: + z.zw.RegisterCompressor(uint16(BZIP2), func(out io.Writer) (io.WriteCloser, error) { + return bzip2.NewWriter(out, &bzip2.WriterConfig{Level: z.CompressionLevel}) + }) + case ZSTD: + z.zw.RegisterCompressor(uint16(ZSTD), func(out io.Writer) (io.WriteCloser, error) { + return zstd.NewWriter(out) + }) + case XZ: + z.zw.RegisterCompressor(uint16(XZ), func(out io.Writer) (io.WriteCloser, error) { + return xz.NewWriter(out) + }) + } return nil } @@ -320,7 +414,7 @@ func (z *Zip) Write(f File) error { if _, ok := compressedFormats[ext]; ok && z.SelectiveCompression { header.Method = zip.Store } else { - header.Method = zip.Deflate + header.Method = uint16(z.FileMethod) } } @@ -376,6 +470,7 @@ func (z *Zip) Open(in io.Reader, size int64) error { if err != nil { return fmt.Errorf("creating reader: %v", err) } + registerDecompressor(z.zr) z.ridx = 0 return nil } @@ -432,11 +527,13 @@ func (z *Zip) Walk(archive string, walkFn WalkFunc) error { return fmt.Errorf("opening zip reader: %v", err) } defer zr.Close() - + registerDecompressor(&zr.Reader) for _, zf := range zr.File { zfrc, err := zf.Open() if err != nil { - zfrc.Close() + if zfrc != nil { + zfrc.Close() + } if z.ContinueOnError { log.Printf("[ERROR] Opening %s: %v", zf.Name, err) continue @@ -501,7 +598,7 @@ func (z *Zip) Extract(source, target, destination string) error { } joined := filepath.Join(destination, end) - err = z.extractFile(f, joined) + err = z.extractFile(f, joined, &zfh) if err != nil { return fmt.Errorf("extracting file %s: %v", zfh.Name, err) } @@ -530,7 +627,9 @@ func (*Zip) Match(file io.ReadSeeker) (bool, error) { if err != nil { return false, err } - defer file.Seek(currentPos, io.SeekStart) + defer func() { + _, _ = file.Seek(currentPos, io.SeekStart) + }() buf := make([]byte, 4) if n, err := file.Read(buf); err != nil || n < 4 { @@ -547,6 +646,7 @@ func NewZip() *Zip { CompressionLevel: flate.DefaultCompression, MkdirAll: true, SelectiveCompression: true, + FileMethod: Deflate, } } @@ -560,6 +660,7 @@ var ( _ = Extractor(new(Zip)) _ = Matcher(new(Zip)) _ = ExtensionChecker(new(Zip)) + _ = FilenameChecker(new(Zip)) ) // compressedFormats is a (non-exhaustive) set of lowercased diff --git a/vendor/github.com/mholt/archiver/v3/zstd.go b/vendor/github.com/mholt/archiver/v3/zstd.go index 3955628c7f..60c11efc49 100644 --- a/vendor/github.com/mholt/archiver/v3/zstd.go +++ b/vendor/github.com/mholt/archiver/v3/zstd.go @@ -10,11 +10,13 @@ import ( // Zstd facilitates Zstandard compression. type Zstd struct { + EncoderOptions []zstd.EOption + DecoderOptions []zstd.DOption } // Compress reads in, compresses it, and writes it to out. func (zs *Zstd) Compress(in io.Reader, out io.Writer) error { - w, err := zstd.NewWriter(out) + w, err := zstd.NewWriter(out, zs.EncoderOptions...) if err != nil { return err } @@ -25,7 +27,7 @@ func (zs *Zstd) Compress(in io.Reader, out io.Writer) error { // Decompress reads in, decompresses it, and writes it to out. func (zs *Zstd) Decompress(in io.Reader, out io.Writer) error { - r, err := zstd.NewReader(in) + r, err := zstd.NewReader(in, zs.DecoderOptions...) if err != nil { return err } diff --git a/vendor/github.com/mmcloughlin/avo/attr/attr.go b/vendor/github.com/mmcloughlin/avo/attr/attr.go deleted file mode 100644 index 016e0a4c37..0000000000 --- a/vendor/github.com/mmcloughlin/avo/attr/attr.go +++ /dev/null @@ -1,102 +0,0 @@ -// Package attr provides attributes for text and data sections. -package attr - -import ( - "fmt" - "math/bits" - "strings" -) - -// Attribute represents TEXT or DATA flags. -type Attribute uint16 - -// Reference: https://github.com/golang/go/blob/aafe257390cc9048e8b5df898fabd79a9e0d4c39/src/runtime/textflag.h#L11-L37 -// -// // Don't profile the marked routine. This flag is deprecated. -// #define NOPROF 1 -// // It is ok for the linker to get multiple of these symbols. It will -// // pick one of the duplicates to use. -// #define DUPOK 2 -// // Don't insert stack check preamble. -// #define NOSPLIT 4 -// // Put this data in a read-only section. -// #define RODATA 8 -// // This data contains no pointers. -// #define NOPTR 16 -// // This is a wrapper function and should not count as disabling 'recover'. -// #define WRAPPER 32 -// // This function uses its incoming context register. -// #define NEEDCTXT 64 -// // Allocate a word of thread local storage and store the offset from the -// // thread local base to the thread local storage in this variable. -// #define TLSBSS 256 -// // Do not insert instructions to allocate a stack frame for this function. -// // Only valid on functions that declare a frame size of 0. -// // TODO(mwhudson): only implemented for ppc64x at present. -// #define NOFRAME 512 -// // Function can call reflect.Type.Method or reflect.Type.MethodByName. -// #define REFLECTMETHOD 1024 -// // Function is the top of the call stack. Call stack unwinders should stop -// // at this function. -// #define TOPFRAME 2048 -// -const ( - NOPROF Attribute = 1 << iota - DUPOK - NOSPLIT - RODATA - NOPTR - WRAPPER - NEEDCTXT - _ - TLSBSS - NOFRAME - REFLECTMETHOD - TOPFRAME -) - -// Asm returns a representation of the attributes in assembly syntax. This may use macros from "textflags.h"; see ContainsTextFlags() to determine if this header is required. -func (a Attribute) Asm() string { - parts, rest := a.split() - if len(parts) == 0 || rest != 0 { - parts = append(parts, fmt.Sprintf("%d", rest)) - } - return strings.Join(parts, "|") -} - -// ContainsTextFlags returns whether the Asm() representation requires macros in "textflags.h". -func (a Attribute) ContainsTextFlags() bool { - flags, _ := a.split() - return len(flags) > 0 -} - -// split splits a into known flags and any remaining bits. -func (a Attribute) split() ([]string, Attribute) { - var flags []string - var rest Attribute - for a != 0 { - i := uint(bits.TrailingZeros16(uint16(a))) - bit := Attribute(1) << i - if flag := attrname[bit]; flag != "" { - flags = append(flags, flag) - } else { - rest |= bit - } - a ^= bit - } - return flags, rest -} - -var attrname = map[Attribute]string{ - NOPROF: "NOPROF", - DUPOK: "DUPOK", - NOSPLIT: "NOSPLIT", - RODATA: "RODATA", - NOPTR: "NOPTR", - WRAPPER: "WRAPPER", - NEEDCTXT: "NEEDCTXT", - TLSBSS: "TLSBSS", - NOFRAME: "NOFRAME", - REFLECTMETHOD: "REFLECTMETHOD", - TOPFRAME: "TOPFRAME", -} diff --git a/vendor/github.com/mmcloughlin/avo/build/attr.go b/vendor/github.com/mmcloughlin/avo/build/attr.go deleted file mode 100644 index 1a9870b0fe..0000000000 --- a/vendor/github.com/mmcloughlin/avo/build/attr.go +++ /dev/null @@ -1,18 +0,0 @@ -package build - -import "github.com/mmcloughlin/avo/attr" - -// TEXT and DATA attribute values included for convenience. -const ( - NOPROF = attr.NOPROF - DUPOK = attr.DUPOK - NOSPLIT = attr.NOSPLIT - RODATA = attr.RODATA - NOPTR = attr.NOPTR - WRAPPER = attr.WRAPPER - NEEDCTXT = attr.NEEDCTXT - TLSBSS = attr.TLSBSS - NOFRAME = attr.NOFRAME - REFLECTMETHOD = attr.REFLECTMETHOD - TOPFRAME = attr.TOPFRAME -) diff --git a/vendor/github.com/mmcloughlin/avo/build/cli.go b/vendor/github.com/mmcloughlin/avo/build/cli.go deleted file mode 100644 index 8a4a379ef0..0000000000 --- a/vendor/github.com/mmcloughlin/avo/build/cli.go +++ /dev/null @@ -1,171 +0,0 @@ -package build - -import ( - "flag" - "io" - "log" - "os" - "runtime/pprof" - - "github.com/mmcloughlin/avo/pass" - "github.com/mmcloughlin/avo/printer" -) - -// Config contains options for an avo main function. -type Config struct { - ErrOut io.Writer - MaxErrors int // max errors to report; 0 means unlimited - CPUProfile io.WriteCloser - Passes []pass.Interface -} - -// Main is the standard main function for an avo program. This extracts the -// result from the build Context (logging and exiting on error), and performs -// configured passes. -func Main(cfg *Config, context *Context) int { - diag := log.New(cfg.ErrOut, "", 0) - - if cfg.CPUProfile != nil { - defer cfg.CPUProfile.Close() - if err := pprof.StartCPUProfile(cfg.CPUProfile); err != nil { - diag.Println("could not start CPU profile: ", err) - return 1 - } - defer pprof.StopCPUProfile() - } - - f, err := context.Result() - if err != nil { - LogError(diag, err, cfg.MaxErrors) - return 1 - } - - p := pass.Concat(cfg.Passes...) - if err := p.Execute(f); err != nil { - diag.Println(err) - return 1 - } - - return 0 -} - -// Flags represents CLI flags for an avo program. -type Flags struct { - errout *outputValue - allerrors bool - cpuprof *outputValue - pkg string - printers []*printerValue -} - -// NewFlags initializes avo flags for the given FlagSet. -func NewFlags(fs *flag.FlagSet) *Flags { - f := &Flags{} - - f.errout = newOutputValue(os.Stderr) - fs.Var(f.errout, "log", "diagnostics output") - - fs.BoolVar(&f.allerrors, "e", false, "no limit on number of errors reported") - - f.cpuprof = newOutputValue(nil) - fs.Var(f.cpuprof, "cpuprofile", "write cpu profile to `file`") - - fs.StringVar(&f.pkg, "pkg", "", "package name (defaults to current directory name)") - - goasm := newPrinterValue(printer.NewGoAsm, os.Stdout) - fs.Var(goasm, "out", "assembly output") - f.printers = append(f.printers, goasm) - - stubs := newPrinterValue(printer.NewStubs, nil) - fs.Var(stubs, "stubs", "go stub file") - f.printers = append(f.printers, stubs) - - return f -} - -// Config builds a configuration object based on flag values. -func (f *Flags) Config() *Config { - pc := printer.NewGoRunConfig() - if f.pkg != "" { - pc.Pkg = f.pkg - } - passes := []pass.Interface{pass.Compile} - for _, pv := range f.printers { - p := pv.Build(pc) - if p != nil { - passes = append(passes, p) - } - } - - cfg := &Config{ - ErrOut: f.errout.w, - MaxErrors: 10, - CPUProfile: f.cpuprof.w, - Passes: passes, - } - - if f.allerrors { - cfg.MaxErrors = 0 - } - - return cfg -} - -type outputValue struct { - w io.WriteCloser - filename string -} - -func newOutputValue(dflt io.WriteCloser) *outputValue { - return &outputValue{w: dflt} -} - -func (o *outputValue) String() string { - if o == nil { - return "" - } - return o.filename -} - -func (o *outputValue) Set(s string) error { - o.filename = s - if s == "-" { - o.w = nopwritecloser{os.Stdout} - return nil - } - f, err := os.Create(s) - if err != nil { - return err - } - o.w = f - return nil -} - -type printerValue struct { - *outputValue - Builder printer.Builder -} - -func newPrinterValue(b printer.Builder, dflt io.WriteCloser) *printerValue { - return &printerValue{ - outputValue: newOutputValue(dflt), - Builder: b, - } -} - -func (p *printerValue) Build(cfg printer.Config) pass.Interface { - if p.outputValue.w == nil { - return nil - } - return &pass.Output{ - Writer: p.outputValue.w, - Printer: p.Builder(cfg), - } -} - -// nopwritecloser wraps a Writer and provides a null implementation of Close(). -type nopwritecloser struct { - io.Writer -} - -func (nopwritecloser) Close() error { return nil } diff --git a/vendor/github.com/mmcloughlin/avo/build/context.go b/vendor/github.com/mmcloughlin/avo/build/context.go deleted file mode 100644 index beb4f60fce..0000000000 --- a/vendor/github.com/mmcloughlin/avo/build/context.go +++ /dev/null @@ -1,223 +0,0 @@ -package build - -import ( - "errors" - "fmt" - "go/types" - - "golang.org/x/tools/go/packages" - - "github.com/mmcloughlin/avo/attr" - "github.com/mmcloughlin/avo/buildtags" - "github.com/mmcloughlin/avo/gotypes" - "github.com/mmcloughlin/avo/ir" - "github.com/mmcloughlin/avo/operand" - "github.com/mmcloughlin/avo/reg" -) - -// Context maintains state for incrementally building an avo File. -type Context struct { - pkg *packages.Package - file *ir.File - function *ir.Function - global *ir.Global - errs ErrorList - reg.Collection -} - -// NewContext initializes an empty build Context. -func NewContext() *Context { - return &Context{ - file: ir.NewFile(), - Collection: *reg.NewCollection(), - } -} - -// Package sets the package the generated file will belong to. Required to be able to reference types in the package. -func (c *Context) Package(path string) { - cfg := &packages.Config{ - Mode: packages.NeedTypes | packages.NeedDeps | packages.NeedImports, - } - pkgs, err := packages.Load(cfg, path) - if err != nil { - c.adderror(err) - return - } - pkg := pkgs[0] - if len(pkg.Errors) > 0 { - for _, err := range pkg.Errors { - c.adderror(err) - } - return - } - c.pkg = pkg -} - -// Constraints sets build constraints for the file. -func (c *Context) Constraints(t buildtags.ConstraintsConvertable) { - cs := t.ToConstraints() - if err := cs.Validate(); err != nil { - c.adderror(err) - return - } - c.file.Constraints = cs -} - -// Constraint appends a constraint to the file's build constraints. -func (c *Context) Constraint(t buildtags.ConstraintConvertable) { - c.Constraints(append(c.file.Constraints, t.ToConstraint())) -} - -// ConstraintExpr appends a constraint to the file's build constraints. The -// constraint to add is parsed from the given expression. The expression should -// look the same as the content following "// +build " in regular build -// constraint comments. -func (c *Context) ConstraintExpr(expr string) { - constraint, err := buildtags.ParseConstraint(expr) - if err != nil { - c.adderror(err) - return - } - c.Constraint(constraint) -} - -// Function starts building a new function with the given name. -func (c *Context) Function(name string) { - c.function = ir.NewFunction(name) - c.file.AddSection(c.function) -} - -// Doc sets documentation comment lines for the currently active function. -func (c *Context) Doc(lines ...string) { - c.activefunc().Doc = lines -} - -// Pragma adds a compiler directive to the currently active function. -func (c *Context) Pragma(directive string, args ...string) { - c.activefunc().AddPragma(directive, args...) -} - -// Attributes sets function attributes for the currently active function. -func (c *Context) Attributes(a attr.Attribute) { - c.activefunc().Attributes = a -} - -// Signature sets the signature for the currently active function. -func (c *Context) Signature(s *gotypes.Signature) { - c.activefunc().SetSignature(s) -} - -// SignatureExpr parses the signature expression and sets it as the active function's signature. -func (c *Context) SignatureExpr(expr string) { - s, err := gotypes.ParseSignatureInPackage(c.types(), expr) - if err != nil { - c.adderror(err) - return - } - c.Signature(s) -} - -// Implement starts building a function of the given name, whose type is -// specified by a stub in the containing package. -func (c *Context) Implement(name string) { - pkg := c.types() - if pkg == nil { - c.adderrormessage("no package specified") - return - } - s, err := gotypes.LookupSignature(pkg, name) - if err != nil { - c.adderror(err) - return - } - c.Function(name) - c.Signature(s) -} - -func (c *Context) types() *types.Package { - if c.pkg == nil { - return nil - } - return c.pkg.Types -} - -// AllocLocal allocates size bytes in the stack of the currently active function. -// Returns a reference to the base pointer for the newly allocated region. -func (c *Context) AllocLocal(size int) operand.Mem { - return c.activefunc().AllocLocal(size) -} - -// Instruction adds an instruction to the active function. -func (c *Context) Instruction(i *ir.Instruction) { - c.activefunc().AddInstruction(i) -} - -// Label adds a label to the active function. -func (c *Context) Label(name string) { - c.activefunc().AddLabel(ir.Label(name)) -} - -// Comment adds comment lines to the active function. -func (c *Context) Comment(lines ...string) { - c.activefunc().AddComment(lines...) -} - -// Commentf adds a formtted comment line. -func (c *Context) Commentf(format string, a ...interface{}) { - c.Comment(fmt.Sprintf(format, a...)) -} - -func (c *Context) activefunc() *ir.Function { - if c.function == nil { - c.adderrormessage("no active function") - return ir.NewFunction("") - } - return c.function -} - -//go:generate avogen -output zinstructions.go build - -// StaticGlobal adds a new static data section to the file and returns a pointer to it. -func (c *Context) StaticGlobal(name string) operand.Mem { - c.global = ir.NewStaticGlobal(name) - c.file.AddSection(c.global) - return c.global.Base() -} - -// DataAttributes sets the attributes on the current active global data section. -func (c *Context) DataAttributes(a attr.Attribute) { - c.activeglobal().Attributes = a -} - -// AddDatum adds constant v at offset to the current active global data section. -func (c *Context) AddDatum(offset int, v operand.Constant) { - if err := c.activeglobal().AddDatum(ir.NewDatum(offset, v)); err != nil { - c.adderror(err) - } -} - -// AppendDatum appends a constant to the current active global data section. -func (c *Context) AppendDatum(v operand.Constant) { - c.activeglobal().Append(v) -} - -func (c *Context) activeglobal() *ir.Global { - if c.global == nil { - c.adderrormessage("no active global") - return ir.NewStaticGlobal("") - } - return c.global -} - -func (c *Context) adderror(err error) { - c.errs.addext(err) -} - -func (c *Context) adderrormessage(msg string) { - c.adderror(errors.New(msg)) -} - -// Result returns the built file and any accumulated errors. -func (c *Context) Result() (*ir.File, error) { - return c.file, c.errs.Err() -} diff --git a/vendor/github.com/mmcloughlin/avo/build/doc.go b/vendor/github.com/mmcloughlin/avo/build/doc.go deleted file mode 100644 index 8b9a604709..0000000000 --- a/vendor/github.com/mmcloughlin/avo/build/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package build provides an assembly-like interface for incremental building of avo Files. -package build diff --git a/vendor/github.com/mmcloughlin/avo/build/error.go b/vendor/github.com/mmcloughlin/avo/build/error.go deleted file mode 100644 index 1da00cbfb6..0000000000 --- a/vendor/github.com/mmcloughlin/avo/build/error.go +++ /dev/null @@ -1,88 +0,0 @@ -package build - -import ( - "fmt" - "log" - - "github.com/mmcloughlin/avo/internal/stack" - "github.com/mmcloughlin/avo/src" -) - -// Error represents an error during building, optionally tagged with the position at which it happened. -type Error struct { - Position src.Position - Err error -} - -// exterr constructs an Error with position derived from the first frame in the -// call stack outside this package. -func exterr(err error) Error { - e := Error{Err: err} - if f := stack.ExternalCaller(); f != nil { - e.Position = src.FramePosition(*f).Relwd() - } - return e -} - -func (e Error) Error() string { - msg := e.Err.Error() - if e.Position.IsValid() { - return e.Position.String() + ": " + msg - } - return msg -} - -// ErrorList is a collection of errors for a source file. -type ErrorList []Error - -// Add appends an error to the list. -func (e *ErrorList) Add(err Error) { - *e = append(*e, err) -} - -// AddAt appends an error at position p. -func (e *ErrorList) AddAt(p src.Position, err error) { - e.Add(Error{p, err}) -} - -// addext appends an error to the list, tagged with the -func (e *ErrorList) addext(err error) { - e.Add(exterr(err)) -} - -// Err returns an error equivalent to this error list. -// If the list is empty, Err returns nil. -func (e ErrorList) Err() error { - if len(e) == 0 { - return nil - } - return e -} - -// An ErrorList implements the error interface. -func (e ErrorList) Error() string { - switch len(e) { - case 0: - return "no errors" - case 1: - return e[0].Error() - } - return fmt.Sprintf("%s (and %d more errors)", e[0], len(e)-1) -} - -// LogError logs a list of errors, one error per line, if the err parameter is -// an ErrorList. Otherwise it just logs the err string. Reports at most max -// errors, or unlimited if max is 0. -func LogError(l *log.Logger, err error, max int) { - if list, ok := err.(ErrorList); ok { - for i, e := range list { - if max > 0 && i == max { - l.Print("too many errors") - return - } - l.Printf("%s\n", e) - } - } else if err != nil { - l.Printf("%s\n", err) - } -} diff --git a/vendor/github.com/mmcloughlin/avo/build/global.go b/vendor/github.com/mmcloughlin/avo/build/global.go deleted file mode 100644 index 4095f81b1d..0000000000 --- a/vendor/github.com/mmcloughlin/avo/build/global.go +++ /dev/null @@ -1,151 +0,0 @@ -package build - -import ( - "flag" - "os" - - "github.com/mmcloughlin/avo/attr" - "github.com/mmcloughlin/avo/buildtags" - "github.com/mmcloughlin/avo/gotypes" - "github.com/mmcloughlin/avo/operand" - - "github.com/mmcloughlin/avo/reg" -) - -// ctx provides a global build context. -var ctx = NewContext() - -// TEXT starts building a new function called name, with attributes a, and sets its signature (see SignatureExpr). -func TEXT(name string, a attr.Attribute, signature string) { - ctx.Function(name) - ctx.Attributes(a) - ctx.SignatureExpr(signature) -} - -// GLOBL declares a new static global data section with the given attributes. -func GLOBL(name string, a attr.Attribute) operand.Mem { - // TODO(mbm): should this be static? - g := ctx.StaticGlobal(name) - ctx.DataAttributes(a) - return g -} - -// DATA adds a data value to the active data section. -func DATA(offset int, v operand.Constant) { - ctx.AddDatum(offset, v) -} - -var flags = NewFlags(flag.CommandLine) - -// Generate builds and compiles the avo file built with the global context. This -// should be the final line of any avo program. Configuration is determined from command-line flags. -func Generate() { - if !flag.Parsed() { - flag.Parse() - } - cfg := flags.Config() - - status := Main(cfg, ctx) - - // To record coverage of integration tests we wrap main() functions in a test - // functions. In this case we need the main function to terminate, therefore we - // only exit for failure status codes. - if status != 0 { - os.Exit(status) - } -} - -// Package sets the package the generated file will belong to. Required to be able to reference types in the package. -func Package(path string) { ctx.Package(path) } - -// Constraints sets build constraints for the file. -func Constraints(t buildtags.ConstraintsConvertable) { ctx.Constraints(t) } - -// Constraint appends a constraint to the file's build constraints. -func Constraint(t buildtags.ConstraintConvertable) { ctx.Constraint(t) } - -// ConstraintExpr appends a constraint to the file's build constraints. The -// constraint to add is parsed from the given expression. The expression should -// look the same as the content following "// +build " in regular build -// constraint comments. -func ConstraintExpr(expr string) { ctx.ConstraintExpr(expr) } - -// GP8L allocates and returns a general-purpose 8-bit register (low byte). -func GP8L() reg.GPVirtual { return ctx.GP8L() } - -// GP8H allocates and returns a general-purpose 8-bit register (high byte). -func GP8H() reg.GPVirtual { return ctx.GP8H() } - -// GP8 allocates and returns a general-purpose 8-bit register (low byte). -func GP8() reg.GPVirtual { return ctx.GP8() } - -// GP16 allocates and returns a general-purpose 16-bit register. -func GP16() reg.GPVirtual { return ctx.GP16() } - -// GP32 allocates and returns a general-purpose 32-bit register. -func GP32() reg.GPVirtual { return ctx.GP32() } - -// GP64 allocates and returns a general-purpose 64-bit register. -func GP64() reg.GPVirtual { return ctx.GP64() } - -// XMM allocates and returns a 128-bit vector register. -func XMM() reg.VecVirtual { return ctx.XMM() } - -// YMM allocates and returns a 256-bit vector register. -func YMM() reg.VecVirtual { return ctx.YMM() } - -// ZMM allocates and returns a 512-bit vector register. -func ZMM() reg.VecVirtual { return ctx.ZMM() } - -// Param returns a the named argument of the active function. -func Param(name string) gotypes.Component { return ctx.Param(name) } - -// ParamIndex returns the ith argument of the active function. -func ParamIndex(i int) gotypes.Component { return ctx.ParamIndex(i) } - -// Return returns a the named return value of the active function. -func Return(name string) gotypes.Component { return ctx.Return(name) } - -// ReturnIndex returns the ith argument of the active function. -func ReturnIndex(i int) gotypes.Component { return ctx.ReturnIndex(i) } - -// Load the function argument src into register dst. Returns the destination -// register. This is syntactic sugar: it will attempt to select the right MOV -// instruction based on the types involved. -func Load(src gotypes.Component, dst reg.Register) reg.Register { return ctx.Load(src, dst) } - -// Store register src into return value dst. This is syntactic sugar: it will -// attempt to select the right MOV instruction based on the types involved. -func Store(src reg.Register, dst gotypes.Component) { ctx.Store(src, dst) } - -// Dereference loads a pointer and returns its element type. -func Dereference(ptr gotypes.Component) gotypes.Component { return ctx.Dereference(ptr) } - -// Doc sets documentation comment lines for the currently active function. -func Doc(lines ...string) { ctx.Doc(lines...) } - -// Pragma adds a compiler directive to the currently active function. -func Pragma(directive string, args ...string) { ctx.Pragma(directive, args...) } - -// Attributes sets function attributes for the currently active function. -func Attributes(a attr.Attribute) { ctx.Attributes(a) } - -// Implement starts building a function of the given name, whose type is -// specified by a stub in the containing package. -func Implement(name string) { ctx.Implement(name) } - -// AllocLocal allocates size bytes in the stack of the currently active function. -// Returns a reference to the base pointer for the newly allocated region. -func AllocLocal(size int) operand.Mem { return ctx.AllocLocal(size) } - -// Label adds a label to the active function. -func Label(name string) { ctx.Label(name) } - -// Comment adds comment lines to the active function. -func Comment(lines ...string) { ctx.Comment(lines...) } - -// Commentf adds a formtted comment line. -func Commentf(format string, a ...interface{}) { ctx.Commentf(format, a...) } - -// ConstData builds a static data section containing just the given constant. -func ConstData(name string, v operand.Constant) operand.Mem { return ctx.ConstData(name, v) } diff --git a/vendor/github.com/mmcloughlin/avo/build/pseudo.go b/vendor/github.com/mmcloughlin/avo/build/pseudo.go deleted file mode 100644 index 83a570e440..0000000000 --- a/vendor/github.com/mmcloughlin/avo/build/pseudo.go +++ /dev/null @@ -1,70 +0,0 @@ -package build - -import ( - "github.com/mmcloughlin/avo/attr" - "github.com/mmcloughlin/avo/operand" - "github.com/mmcloughlin/avo/reg" - - "github.com/mmcloughlin/avo/gotypes" -) - -//go:generate avogen -output zmov.go mov - -// Param returns a the named argument of the active function. -func (c *Context) Param(name string) gotypes.Component { - return c.activefunc().Signature.Params().Lookup(name) -} - -// ParamIndex returns the ith argument of the active function. -func (c *Context) ParamIndex(i int) gotypes.Component { - return c.activefunc().Signature.Params().At(i) -} - -// Return returns a the named return value of the active function. -func (c *Context) Return(name string) gotypes.Component { - return c.activefunc().Signature.Results().Lookup(name) -} - -// ReturnIndex returns the ith argument of the active function. -func (c *Context) ReturnIndex(i int) gotypes.Component { - return c.activefunc().Signature.Results().At(i) -} - -// Load the function argument src into register dst. Returns the destination -// register. This is syntactic sugar: it will attempt to select the right MOV -// instruction based on the types involved. -func (c *Context) Load(src gotypes.Component, dst reg.Register) reg.Register { - b, err := src.Resolve() - if err != nil { - c.adderror(err) - return dst - } - c.mov(b.Addr, dst, int(gotypes.Sizes.Sizeof(b.Type)), int(dst.Size()), b.Type) - return dst -} - -// Store register src into return value dst. This is syntactic sugar: it will -// attempt to select the right MOV instruction based on the types involved. -func (c *Context) Store(src reg.Register, dst gotypes.Component) { - b, err := dst.Resolve() - if err != nil { - c.adderror(err) - return - } - c.mov(src, b.Addr, int(src.Size()), int(gotypes.Sizes.Sizeof(b.Type)), b.Type) -} - -// Dereference loads a pointer and returns its element type. -func (c *Context) Dereference(ptr gotypes.Component) gotypes.Component { - r := c.GP64() - c.Load(ptr, r) - return ptr.Dereference(r) -} - -// ConstData builds a static data section containing just the given constant. -func (c *Context) ConstData(name string, v operand.Constant) operand.Mem { - g := c.StaticGlobal(name) - c.DataAttributes(attr.RODATA | attr.NOPTR) - c.AppendDatum(v) - return g -} diff --git a/vendor/github.com/mmcloughlin/avo/build/zinstructions.go b/vendor/github.com/mmcloughlin/avo/build/zinstructions.go deleted file mode 100644 index 33c2085ee9..0000000000 --- a/vendor/github.com/mmcloughlin/avo/build/zinstructions.go +++ /dev/null @@ -1,26315 +0,0 @@ -// Code generated by command: avogen -output zinstructions.go build. DO NOT EDIT. - -package build - -import ( - "github.com/mmcloughlin/avo/operand" - "github.com/mmcloughlin/avo/x86" -) - -// ADCB: Add with Carry. -// -// Forms: -// -// ADCB imm8 al -// ADCB imm8 r8 -// ADCB r8 r8 -// ADCB m8 r8 -// ADCB imm8 m8 -// ADCB r8 m8 -// Construct and append a ADCB instruction to the active function. -func (c *Context) ADCB(imr, amr operand.Op) { - if inst, err := x86.ADCB(imr, amr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADCB: Add with Carry. -// -// Forms: -// -// ADCB imm8 al -// ADCB imm8 r8 -// ADCB r8 r8 -// ADCB m8 r8 -// ADCB imm8 m8 -// ADCB r8 m8 -// Construct and append a ADCB instruction to the active function. -// Operates on the global context. -func ADCB(imr, amr operand.Op) { ctx.ADCB(imr, amr) } - -// ADCL: Add with Carry. -// -// Forms: -// -// ADCL imm32 eax -// ADCL imm8 r32 -// ADCL imm32 r32 -// ADCL r32 r32 -// ADCL m32 r32 -// ADCL imm8 m32 -// ADCL imm32 m32 -// ADCL r32 m32 -// Construct and append a ADCL instruction to the active function. -func (c *Context) ADCL(imr, emr operand.Op) { - if inst, err := x86.ADCL(imr, emr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADCL: Add with Carry. -// -// Forms: -// -// ADCL imm32 eax -// ADCL imm8 r32 -// ADCL imm32 r32 -// ADCL r32 r32 -// ADCL m32 r32 -// ADCL imm8 m32 -// ADCL imm32 m32 -// ADCL r32 m32 -// Construct and append a ADCL instruction to the active function. -// Operates on the global context. -func ADCL(imr, emr operand.Op) { ctx.ADCL(imr, emr) } - -// ADCQ: Add with Carry. -// -// Forms: -// -// ADCQ imm32 rax -// ADCQ imm8 r64 -// ADCQ imm32 r64 -// ADCQ r64 r64 -// ADCQ m64 r64 -// ADCQ imm8 m64 -// ADCQ imm32 m64 -// ADCQ r64 m64 -// Construct and append a ADCQ instruction to the active function. -func (c *Context) ADCQ(imr, mr operand.Op) { - if inst, err := x86.ADCQ(imr, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADCQ: Add with Carry. -// -// Forms: -// -// ADCQ imm32 rax -// ADCQ imm8 r64 -// ADCQ imm32 r64 -// ADCQ r64 r64 -// ADCQ m64 r64 -// ADCQ imm8 m64 -// ADCQ imm32 m64 -// ADCQ r64 m64 -// Construct and append a ADCQ instruction to the active function. -// Operates on the global context. -func ADCQ(imr, mr operand.Op) { ctx.ADCQ(imr, mr) } - -// ADCW: Add with Carry. -// -// Forms: -// -// ADCW imm16 ax -// ADCW imm8 r16 -// ADCW imm16 r16 -// ADCW r16 r16 -// ADCW m16 r16 -// ADCW imm8 m16 -// ADCW imm16 m16 -// ADCW r16 m16 -// Construct and append a ADCW instruction to the active function. -func (c *Context) ADCW(imr, amr operand.Op) { - if inst, err := x86.ADCW(imr, amr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADCW: Add with Carry. -// -// Forms: -// -// ADCW imm16 ax -// ADCW imm8 r16 -// ADCW imm16 r16 -// ADCW r16 r16 -// ADCW m16 r16 -// ADCW imm8 m16 -// ADCW imm16 m16 -// ADCW r16 m16 -// Construct and append a ADCW instruction to the active function. -// Operates on the global context. -func ADCW(imr, amr operand.Op) { ctx.ADCW(imr, amr) } - -// ADCXL: Unsigned Integer Addition of Two Operands with Carry Flag. -// -// Forms: -// -// ADCXL r32 r32 -// ADCXL m32 r32 -// Construct and append a ADCXL instruction to the active function. -func (c *Context) ADCXL(mr, r operand.Op) { - if inst, err := x86.ADCXL(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADCXL: Unsigned Integer Addition of Two Operands with Carry Flag. -// -// Forms: -// -// ADCXL r32 r32 -// ADCXL m32 r32 -// Construct and append a ADCXL instruction to the active function. -// Operates on the global context. -func ADCXL(mr, r operand.Op) { ctx.ADCXL(mr, r) } - -// ADCXQ: Unsigned Integer Addition of Two Operands with Carry Flag. -// -// Forms: -// -// ADCXQ r64 r64 -// ADCXQ m64 r64 -// Construct and append a ADCXQ instruction to the active function. -func (c *Context) ADCXQ(mr, r operand.Op) { - if inst, err := x86.ADCXQ(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADCXQ: Unsigned Integer Addition of Two Operands with Carry Flag. -// -// Forms: -// -// ADCXQ r64 r64 -// ADCXQ m64 r64 -// Construct and append a ADCXQ instruction to the active function. -// Operates on the global context. -func ADCXQ(mr, r operand.Op) { ctx.ADCXQ(mr, r) } - -// ADDB: Add. -// -// Forms: -// -// ADDB imm8 al -// ADDB imm8 r8 -// ADDB r8 r8 -// ADDB m8 r8 -// ADDB imm8 m8 -// ADDB r8 m8 -// Construct and append a ADDB instruction to the active function. -func (c *Context) ADDB(imr, amr operand.Op) { - if inst, err := x86.ADDB(imr, amr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADDB: Add. -// -// Forms: -// -// ADDB imm8 al -// ADDB imm8 r8 -// ADDB r8 r8 -// ADDB m8 r8 -// ADDB imm8 m8 -// ADDB r8 m8 -// Construct and append a ADDB instruction to the active function. -// Operates on the global context. -func ADDB(imr, amr operand.Op) { ctx.ADDB(imr, amr) } - -// ADDL: Add. -// -// Forms: -// -// ADDL imm32 eax -// ADDL imm8 r32 -// ADDL imm32 r32 -// ADDL r32 r32 -// ADDL m32 r32 -// ADDL imm8 m32 -// ADDL imm32 m32 -// ADDL r32 m32 -// Construct and append a ADDL instruction to the active function. -func (c *Context) ADDL(imr, emr operand.Op) { - if inst, err := x86.ADDL(imr, emr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADDL: Add. -// -// Forms: -// -// ADDL imm32 eax -// ADDL imm8 r32 -// ADDL imm32 r32 -// ADDL r32 r32 -// ADDL m32 r32 -// ADDL imm8 m32 -// ADDL imm32 m32 -// ADDL r32 m32 -// Construct and append a ADDL instruction to the active function. -// Operates on the global context. -func ADDL(imr, emr operand.Op) { ctx.ADDL(imr, emr) } - -// ADDPD: Add Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// ADDPD xmm xmm -// ADDPD m128 xmm -// Construct and append a ADDPD instruction to the active function. -func (c *Context) ADDPD(mx, x operand.Op) { - if inst, err := x86.ADDPD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADDPD: Add Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// ADDPD xmm xmm -// ADDPD m128 xmm -// Construct and append a ADDPD instruction to the active function. -// Operates on the global context. -func ADDPD(mx, x operand.Op) { ctx.ADDPD(mx, x) } - -// ADDPS: Add Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// ADDPS xmm xmm -// ADDPS m128 xmm -// Construct and append a ADDPS instruction to the active function. -func (c *Context) ADDPS(mx, x operand.Op) { - if inst, err := x86.ADDPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADDPS: Add Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// ADDPS xmm xmm -// ADDPS m128 xmm -// Construct and append a ADDPS instruction to the active function. -// Operates on the global context. -func ADDPS(mx, x operand.Op) { ctx.ADDPS(mx, x) } - -// ADDQ: Add. -// -// Forms: -// -// ADDQ imm32 rax -// ADDQ imm8 r64 -// ADDQ imm32 r64 -// ADDQ r64 r64 -// ADDQ m64 r64 -// ADDQ imm8 m64 -// ADDQ imm32 m64 -// ADDQ r64 m64 -// Construct and append a ADDQ instruction to the active function. -func (c *Context) ADDQ(imr, mr operand.Op) { - if inst, err := x86.ADDQ(imr, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADDQ: Add. -// -// Forms: -// -// ADDQ imm32 rax -// ADDQ imm8 r64 -// ADDQ imm32 r64 -// ADDQ r64 r64 -// ADDQ m64 r64 -// ADDQ imm8 m64 -// ADDQ imm32 m64 -// ADDQ r64 m64 -// Construct and append a ADDQ instruction to the active function. -// Operates on the global context. -func ADDQ(imr, mr operand.Op) { ctx.ADDQ(imr, mr) } - -// ADDSD: Add Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// ADDSD xmm xmm -// ADDSD m64 xmm -// Construct and append a ADDSD instruction to the active function. -func (c *Context) ADDSD(mx, x operand.Op) { - if inst, err := x86.ADDSD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADDSD: Add Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// ADDSD xmm xmm -// ADDSD m64 xmm -// Construct and append a ADDSD instruction to the active function. -// Operates on the global context. -func ADDSD(mx, x operand.Op) { ctx.ADDSD(mx, x) } - -// ADDSS: Add Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// ADDSS xmm xmm -// ADDSS m32 xmm -// Construct and append a ADDSS instruction to the active function. -func (c *Context) ADDSS(mx, x operand.Op) { - if inst, err := x86.ADDSS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADDSS: Add Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// ADDSS xmm xmm -// ADDSS m32 xmm -// Construct and append a ADDSS instruction to the active function. -// Operates on the global context. -func ADDSS(mx, x operand.Op) { ctx.ADDSS(mx, x) } - -// ADDSUBPD: Packed Double-FP Add/Subtract. -// -// Forms: -// -// ADDSUBPD xmm xmm -// ADDSUBPD m128 xmm -// Construct and append a ADDSUBPD instruction to the active function. -func (c *Context) ADDSUBPD(mx, x operand.Op) { - if inst, err := x86.ADDSUBPD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADDSUBPD: Packed Double-FP Add/Subtract. -// -// Forms: -// -// ADDSUBPD xmm xmm -// ADDSUBPD m128 xmm -// Construct and append a ADDSUBPD instruction to the active function. -// Operates on the global context. -func ADDSUBPD(mx, x operand.Op) { ctx.ADDSUBPD(mx, x) } - -// ADDSUBPS: Packed Single-FP Add/Subtract. -// -// Forms: -// -// ADDSUBPS xmm xmm -// ADDSUBPS m128 xmm -// Construct and append a ADDSUBPS instruction to the active function. -func (c *Context) ADDSUBPS(mx, x operand.Op) { - if inst, err := x86.ADDSUBPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADDSUBPS: Packed Single-FP Add/Subtract. -// -// Forms: -// -// ADDSUBPS xmm xmm -// ADDSUBPS m128 xmm -// Construct and append a ADDSUBPS instruction to the active function. -// Operates on the global context. -func ADDSUBPS(mx, x operand.Op) { ctx.ADDSUBPS(mx, x) } - -// ADDW: Add. -// -// Forms: -// -// ADDW imm16 ax -// ADDW imm8 r16 -// ADDW imm16 r16 -// ADDW r16 r16 -// ADDW m16 r16 -// ADDW imm8 m16 -// ADDW imm16 m16 -// ADDW r16 m16 -// Construct and append a ADDW instruction to the active function. -func (c *Context) ADDW(imr, amr operand.Op) { - if inst, err := x86.ADDW(imr, amr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADDW: Add. -// -// Forms: -// -// ADDW imm16 ax -// ADDW imm8 r16 -// ADDW imm16 r16 -// ADDW r16 r16 -// ADDW m16 r16 -// ADDW imm8 m16 -// ADDW imm16 m16 -// ADDW r16 m16 -// Construct and append a ADDW instruction to the active function. -// Operates on the global context. -func ADDW(imr, amr operand.Op) { ctx.ADDW(imr, amr) } - -// ADOXL: Unsigned Integer Addition of Two Operands with Overflow Flag. -// -// Forms: -// -// ADOXL r32 r32 -// ADOXL m32 r32 -// Construct and append a ADOXL instruction to the active function. -func (c *Context) ADOXL(mr, r operand.Op) { - if inst, err := x86.ADOXL(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADOXL: Unsigned Integer Addition of Two Operands with Overflow Flag. -// -// Forms: -// -// ADOXL r32 r32 -// ADOXL m32 r32 -// Construct and append a ADOXL instruction to the active function. -// Operates on the global context. -func ADOXL(mr, r operand.Op) { ctx.ADOXL(mr, r) } - -// ADOXQ: Unsigned Integer Addition of Two Operands with Overflow Flag. -// -// Forms: -// -// ADOXQ r64 r64 -// ADOXQ m64 r64 -// Construct and append a ADOXQ instruction to the active function. -func (c *Context) ADOXQ(mr, r operand.Op) { - if inst, err := x86.ADOXQ(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ADOXQ: Unsigned Integer Addition of Two Operands with Overflow Flag. -// -// Forms: -// -// ADOXQ r64 r64 -// ADOXQ m64 r64 -// Construct and append a ADOXQ instruction to the active function. -// Operates on the global context. -func ADOXQ(mr, r operand.Op) { ctx.ADOXQ(mr, r) } - -// AESDEC: Perform One Round of an AES Decryption Flow. -// -// Forms: -// -// AESDEC xmm xmm -// AESDEC m128 xmm -// Construct and append a AESDEC instruction to the active function. -func (c *Context) AESDEC(mx, x operand.Op) { - if inst, err := x86.AESDEC(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// AESDEC: Perform One Round of an AES Decryption Flow. -// -// Forms: -// -// AESDEC xmm xmm -// AESDEC m128 xmm -// Construct and append a AESDEC instruction to the active function. -// Operates on the global context. -func AESDEC(mx, x operand.Op) { ctx.AESDEC(mx, x) } - -// AESDECLAST: Perform Last Round of an AES Decryption Flow. -// -// Forms: -// -// AESDECLAST xmm xmm -// AESDECLAST m128 xmm -// Construct and append a AESDECLAST instruction to the active function. -func (c *Context) AESDECLAST(mx, x operand.Op) { - if inst, err := x86.AESDECLAST(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// AESDECLAST: Perform Last Round of an AES Decryption Flow. -// -// Forms: -// -// AESDECLAST xmm xmm -// AESDECLAST m128 xmm -// Construct and append a AESDECLAST instruction to the active function. -// Operates on the global context. -func AESDECLAST(mx, x operand.Op) { ctx.AESDECLAST(mx, x) } - -// AESENC: Perform One Round of an AES Encryption Flow. -// -// Forms: -// -// AESENC xmm xmm -// AESENC m128 xmm -// Construct and append a AESENC instruction to the active function. -func (c *Context) AESENC(mx, x operand.Op) { - if inst, err := x86.AESENC(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// AESENC: Perform One Round of an AES Encryption Flow. -// -// Forms: -// -// AESENC xmm xmm -// AESENC m128 xmm -// Construct and append a AESENC instruction to the active function. -// Operates on the global context. -func AESENC(mx, x operand.Op) { ctx.AESENC(mx, x) } - -// AESENCLAST: Perform Last Round of an AES Encryption Flow. -// -// Forms: -// -// AESENCLAST xmm xmm -// AESENCLAST m128 xmm -// Construct and append a AESENCLAST instruction to the active function. -func (c *Context) AESENCLAST(mx, x operand.Op) { - if inst, err := x86.AESENCLAST(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// AESENCLAST: Perform Last Round of an AES Encryption Flow. -// -// Forms: -// -// AESENCLAST xmm xmm -// AESENCLAST m128 xmm -// Construct and append a AESENCLAST instruction to the active function. -// Operates on the global context. -func AESENCLAST(mx, x operand.Op) { ctx.AESENCLAST(mx, x) } - -// AESIMC: Perform the AES InvMixColumn Transformation. -// -// Forms: -// -// AESIMC xmm xmm -// AESIMC m128 xmm -// Construct and append a AESIMC instruction to the active function. -func (c *Context) AESIMC(mx, x operand.Op) { - if inst, err := x86.AESIMC(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// AESIMC: Perform the AES InvMixColumn Transformation. -// -// Forms: -// -// AESIMC xmm xmm -// AESIMC m128 xmm -// Construct and append a AESIMC instruction to the active function. -// Operates on the global context. -func AESIMC(mx, x operand.Op) { ctx.AESIMC(mx, x) } - -// AESKEYGENASSIST: AES Round Key Generation Assist. -// -// Forms: -// -// AESKEYGENASSIST imm8 xmm xmm -// AESKEYGENASSIST imm8 m128 xmm -// Construct and append a AESKEYGENASSIST instruction to the active function. -func (c *Context) AESKEYGENASSIST(i, mx, x operand.Op) { - if inst, err := x86.AESKEYGENASSIST(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// AESKEYGENASSIST: AES Round Key Generation Assist. -// -// Forms: -// -// AESKEYGENASSIST imm8 xmm xmm -// AESKEYGENASSIST imm8 m128 xmm -// Construct and append a AESKEYGENASSIST instruction to the active function. -// Operates on the global context. -func AESKEYGENASSIST(i, mx, x operand.Op) { ctx.AESKEYGENASSIST(i, mx, x) } - -// ANDB: Logical AND. -// -// Forms: -// -// ANDB imm8 al -// ANDB imm8 r8 -// ANDB r8 r8 -// ANDB m8 r8 -// ANDB imm8 m8 -// ANDB r8 m8 -// Construct and append a ANDB instruction to the active function. -func (c *Context) ANDB(imr, amr operand.Op) { - if inst, err := x86.ANDB(imr, amr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ANDB: Logical AND. -// -// Forms: -// -// ANDB imm8 al -// ANDB imm8 r8 -// ANDB r8 r8 -// ANDB m8 r8 -// ANDB imm8 m8 -// ANDB r8 m8 -// Construct and append a ANDB instruction to the active function. -// Operates on the global context. -func ANDB(imr, amr operand.Op) { ctx.ANDB(imr, amr) } - -// ANDL: Logical AND. -// -// Forms: -// -// ANDL imm32 eax -// ANDL imm8 r32 -// ANDL imm32 r32 -// ANDL r32 r32 -// ANDL m32 r32 -// ANDL imm8 m32 -// ANDL imm32 m32 -// ANDL r32 m32 -// Construct and append a ANDL instruction to the active function. -func (c *Context) ANDL(imr, emr operand.Op) { - if inst, err := x86.ANDL(imr, emr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ANDL: Logical AND. -// -// Forms: -// -// ANDL imm32 eax -// ANDL imm8 r32 -// ANDL imm32 r32 -// ANDL r32 r32 -// ANDL m32 r32 -// ANDL imm8 m32 -// ANDL imm32 m32 -// ANDL r32 m32 -// Construct and append a ANDL instruction to the active function. -// Operates on the global context. -func ANDL(imr, emr operand.Op) { ctx.ANDL(imr, emr) } - -// ANDNL: Logical AND NOT. -// -// Forms: -// -// ANDNL r32 r32 r32 -// ANDNL m32 r32 r32 -// Construct and append a ANDNL instruction to the active function. -func (c *Context) ANDNL(mr, r, r1 operand.Op) { - if inst, err := x86.ANDNL(mr, r, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ANDNL: Logical AND NOT. -// -// Forms: -// -// ANDNL r32 r32 r32 -// ANDNL m32 r32 r32 -// Construct and append a ANDNL instruction to the active function. -// Operates on the global context. -func ANDNL(mr, r, r1 operand.Op) { ctx.ANDNL(mr, r, r1) } - -// ANDNPD: Bitwise Logical AND NOT of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// ANDNPD xmm xmm -// ANDNPD m128 xmm -// Construct and append a ANDNPD instruction to the active function. -func (c *Context) ANDNPD(mx, x operand.Op) { - if inst, err := x86.ANDNPD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ANDNPD: Bitwise Logical AND NOT of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// ANDNPD xmm xmm -// ANDNPD m128 xmm -// Construct and append a ANDNPD instruction to the active function. -// Operates on the global context. -func ANDNPD(mx, x operand.Op) { ctx.ANDNPD(mx, x) } - -// ANDNPS: Bitwise Logical AND NOT of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// ANDNPS xmm xmm -// ANDNPS m128 xmm -// Construct and append a ANDNPS instruction to the active function. -func (c *Context) ANDNPS(mx, x operand.Op) { - if inst, err := x86.ANDNPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ANDNPS: Bitwise Logical AND NOT of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// ANDNPS xmm xmm -// ANDNPS m128 xmm -// Construct and append a ANDNPS instruction to the active function. -// Operates on the global context. -func ANDNPS(mx, x operand.Op) { ctx.ANDNPS(mx, x) } - -// ANDNQ: Logical AND NOT. -// -// Forms: -// -// ANDNQ r64 r64 r64 -// ANDNQ m64 r64 r64 -// Construct and append a ANDNQ instruction to the active function. -func (c *Context) ANDNQ(mr, r, r1 operand.Op) { - if inst, err := x86.ANDNQ(mr, r, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ANDNQ: Logical AND NOT. -// -// Forms: -// -// ANDNQ r64 r64 r64 -// ANDNQ m64 r64 r64 -// Construct and append a ANDNQ instruction to the active function. -// Operates on the global context. -func ANDNQ(mr, r, r1 operand.Op) { ctx.ANDNQ(mr, r, r1) } - -// ANDPD: Bitwise Logical AND of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// ANDPD xmm xmm -// ANDPD m128 xmm -// Construct and append a ANDPD instruction to the active function. -func (c *Context) ANDPD(mx, x operand.Op) { - if inst, err := x86.ANDPD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ANDPD: Bitwise Logical AND of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// ANDPD xmm xmm -// ANDPD m128 xmm -// Construct and append a ANDPD instruction to the active function. -// Operates on the global context. -func ANDPD(mx, x operand.Op) { ctx.ANDPD(mx, x) } - -// ANDPS: Bitwise Logical AND of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// ANDPS xmm xmm -// ANDPS m128 xmm -// Construct and append a ANDPS instruction to the active function. -func (c *Context) ANDPS(mx, x operand.Op) { - if inst, err := x86.ANDPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ANDPS: Bitwise Logical AND of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// ANDPS xmm xmm -// ANDPS m128 xmm -// Construct and append a ANDPS instruction to the active function. -// Operates on the global context. -func ANDPS(mx, x operand.Op) { ctx.ANDPS(mx, x) } - -// ANDQ: Logical AND. -// -// Forms: -// -// ANDQ imm32 rax -// ANDQ imm8 r64 -// ANDQ imm32 r64 -// ANDQ r64 r64 -// ANDQ m64 r64 -// ANDQ imm8 m64 -// ANDQ imm32 m64 -// ANDQ r64 m64 -// Construct and append a ANDQ instruction to the active function. -func (c *Context) ANDQ(imr, mr operand.Op) { - if inst, err := x86.ANDQ(imr, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ANDQ: Logical AND. -// -// Forms: -// -// ANDQ imm32 rax -// ANDQ imm8 r64 -// ANDQ imm32 r64 -// ANDQ r64 r64 -// ANDQ m64 r64 -// ANDQ imm8 m64 -// ANDQ imm32 m64 -// ANDQ r64 m64 -// Construct and append a ANDQ instruction to the active function. -// Operates on the global context. -func ANDQ(imr, mr operand.Op) { ctx.ANDQ(imr, mr) } - -// ANDW: Logical AND. -// -// Forms: -// -// ANDW imm16 ax -// ANDW imm8 r16 -// ANDW imm16 r16 -// ANDW r16 r16 -// ANDW m16 r16 -// ANDW imm8 m16 -// ANDW imm16 m16 -// ANDW r16 m16 -// Construct and append a ANDW instruction to the active function. -func (c *Context) ANDW(imr, amr operand.Op) { - if inst, err := x86.ANDW(imr, amr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ANDW: Logical AND. -// -// Forms: -// -// ANDW imm16 ax -// ANDW imm8 r16 -// ANDW imm16 r16 -// ANDW r16 r16 -// ANDW m16 r16 -// ANDW imm8 m16 -// ANDW imm16 m16 -// ANDW r16 m16 -// Construct and append a ANDW instruction to the active function. -// Operates on the global context. -func ANDW(imr, amr operand.Op) { ctx.ANDW(imr, amr) } - -// BEXTRL: Bit Field Extract. -// -// Forms: -// -// BEXTRL r32 r32 r32 -// BEXTRL r32 m32 r32 -// Construct and append a BEXTRL instruction to the active function. -func (c *Context) BEXTRL(r, mr, r1 operand.Op) { - if inst, err := x86.BEXTRL(r, mr, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BEXTRL: Bit Field Extract. -// -// Forms: -// -// BEXTRL r32 r32 r32 -// BEXTRL r32 m32 r32 -// Construct and append a BEXTRL instruction to the active function. -// Operates on the global context. -func BEXTRL(r, mr, r1 operand.Op) { ctx.BEXTRL(r, mr, r1) } - -// BEXTRQ: Bit Field Extract. -// -// Forms: -// -// BEXTRQ r64 r64 r64 -// BEXTRQ r64 m64 r64 -// Construct and append a BEXTRQ instruction to the active function. -func (c *Context) BEXTRQ(r, mr, r1 operand.Op) { - if inst, err := x86.BEXTRQ(r, mr, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BEXTRQ: Bit Field Extract. -// -// Forms: -// -// BEXTRQ r64 r64 r64 -// BEXTRQ r64 m64 r64 -// Construct and append a BEXTRQ instruction to the active function. -// Operates on the global context. -func BEXTRQ(r, mr, r1 operand.Op) { ctx.BEXTRQ(r, mr, r1) } - -// BLENDPD: Blend Packed Double Precision Floating-Point Values. -// -// Forms: -// -// BLENDPD imm8 xmm xmm -// BLENDPD imm8 m128 xmm -// Construct and append a BLENDPD instruction to the active function. -func (c *Context) BLENDPD(i, mx, x operand.Op) { - if inst, err := x86.BLENDPD(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BLENDPD: Blend Packed Double Precision Floating-Point Values. -// -// Forms: -// -// BLENDPD imm8 xmm xmm -// BLENDPD imm8 m128 xmm -// Construct and append a BLENDPD instruction to the active function. -// Operates on the global context. -func BLENDPD(i, mx, x operand.Op) { ctx.BLENDPD(i, mx, x) } - -// BLENDPS: Blend Packed Single Precision Floating-Point Values. -// -// Forms: -// -// BLENDPS imm8 xmm xmm -// BLENDPS imm8 m128 xmm -// Construct and append a BLENDPS instruction to the active function. -func (c *Context) BLENDPS(i, mx, x operand.Op) { - if inst, err := x86.BLENDPS(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BLENDPS: Blend Packed Single Precision Floating-Point Values. -// -// Forms: -// -// BLENDPS imm8 xmm xmm -// BLENDPS imm8 m128 xmm -// Construct and append a BLENDPS instruction to the active function. -// Operates on the global context. -func BLENDPS(i, mx, x operand.Op) { ctx.BLENDPS(i, mx, x) } - -// BLENDVPD: Variable Blend Packed Double Precision Floating-Point Values. -// -// Forms: -// -// BLENDVPD xmm0 xmm xmm -// BLENDVPD xmm0 m128 xmm -// Construct and append a BLENDVPD instruction to the active function. -func (c *Context) BLENDVPD(x, mx, x1 operand.Op) { - if inst, err := x86.BLENDVPD(x, mx, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BLENDVPD: Variable Blend Packed Double Precision Floating-Point Values. -// -// Forms: -// -// BLENDVPD xmm0 xmm xmm -// BLENDVPD xmm0 m128 xmm -// Construct and append a BLENDVPD instruction to the active function. -// Operates on the global context. -func BLENDVPD(x, mx, x1 operand.Op) { ctx.BLENDVPD(x, mx, x1) } - -// BLENDVPS: Variable Blend Packed Single Precision Floating-Point Values. -// -// Forms: -// -// BLENDVPS xmm0 xmm xmm -// BLENDVPS xmm0 m128 xmm -// Construct and append a BLENDVPS instruction to the active function. -func (c *Context) BLENDVPS(x, mx, x1 operand.Op) { - if inst, err := x86.BLENDVPS(x, mx, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BLENDVPS: Variable Blend Packed Single Precision Floating-Point Values. -// -// Forms: -// -// BLENDVPS xmm0 xmm xmm -// BLENDVPS xmm0 m128 xmm -// Construct and append a BLENDVPS instruction to the active function. -// Operates on the global context. -func BLENDVPS(x, mx, x1 operand.Op) { ctx.BLENDVPS(x, mx, x1) } - -// BLSIL: Isolate Lowest Set Bit. -// -// Forms: -// -// BLSIL r32 r32 -// BLSIL m32 r32 -// Construct and append a BLSIL instruction to the active function. -func (c *Context) BLSIL(mr, r operand.Op) { - if inst, err := x86.BLSIL(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BLSIL: Isolate Lowest Set Bit. -// -// Forms: -// -// BLSIL r32 r32 -// BLSIL m32 r32 -// Construct and append a BLSIL instruction to the active function. -// Operates on the global context. -func BLSIL(mr, r operand.Op) { ctx.BLSIL(mr, r) } - -// BLSIQ: Isolate Lowest Set Bit. -// -// Forms: -// -// BLSIQ r64 r64 -// BLSIQ m64 r64 -// Construct and append a BLSIQ instruction to the active function. -func (c *Context) BLSIQ(mr, r operand.Op) { - if inst, err := x86.BLSIQ(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BLSIQ: Isolate Lowest Set Bit. -// -// Forms: -// -// BLSIQ r64 r64 -// BLSIQ m64 r64 -// Construct and append a BLSIQ instruction to the active function. -// Operates on the global context. -func BLSIQ(mr, r operand.Op) { ctx.BLSIQ(mr, r) } - -// BLSMSKL: Mask From Lowest Set Bit. -// -// Forms: -// -// BLSMSKL r32 r32 -// BLSMSKL m32 r32 -// Construct and append a BLSMSKL instruction to the active function. -func (c *Context) BLSMSKL(mr, r operand.Op) { - if inst, err := x86.BLSMSKL(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BLSMSKL: Mask From Lowest Set Bit. -// -// Forms: -// -// BLSMSKL r32 r32 -// BLSMSKL m32 r32 -// Construct and append a BLSMSKL instruction to the active function. -// Operates on the global context. -func BLSMSKL(mr, r operand.Op) { ctx.BLSMSKL(mr, r) } - -// BLSMSKQ: Mask From Lowest Set Bit. -// -// Forms: -// -// BLSMSKQ r64 r64 -// BLSMSKQ m64 r64 -// Construct and append a BLSMSKQ instruction to the active function. -func (c *Context) BLSMSKQ(mr, r operand.Op) { - if inst, err := x86.BLSMSKQ(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BLSMSKQ: Mask From Lowest Set Bit. -// -// Forms: -// -// BLSMSKQ r64 r64 -// BLSMSKQ m64 r64 -// Construct and append a BLSMSKQ instruction to the active function. -// Operates on the global context. -func BLSMSKQ(mr, r operand.Op) { ctx.BLSMSKQ(mr, r) } - -// BLSRL: Reset Lowest Set Bit. -// -// Forms: -// -// BLSRL r32 r32 -// BLSRL m32 r32 -// Construct and append a BLSRL instruction to the active function. -func (c *Context) BLSRL(mr, r operand.Op) { - if inst, err := x86.BLSRL(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BLSRL: Reset Lowest Set Bit. -// -// Forms: -// -// BLSRL r32 r32 -// BLSRL m32 r32 -// Construct and append a BLSRL instruction to the active function. -// Operates on the global context. -func BLSRL(mr, r operand.Op) { ctx.BLSRL(mr, r) } - -// BLSRQ: Reset Lowest Set Bit. -// -// Forms: -// -// BLSRQ r64 r64 -// BLSRQ m64 r64 -// Construct and append a BLSRQ instruction to the active function. -func (c *Context) BLSRQ(mr, r operand.Op) { - if inst, err := x86.BLSRQ(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BLSRQ: Reset Lowest Set Bit. -// -// Forms: -// -// BLSRQ r64 r64 -// BLSRQ m64 r64 -// Construct and append a BLSRQ instruction to the active function. -// Operates on the global context. -func BLSRQ(mr, r operand.Op) { ctx.BLSRQ(mr, r) } - -// BSFL: Bit Scan Forward. -// -// Forms: -// -// BSFL r32 r32 -// BSFL m32 r32 -// Construct and append a BSFL instruction to the active function. -func (c *Context) BSFL(mr, r operand.Op) { - if inst, err := x86.BSFL(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BSFL: Bit Scan Forward. -// -// Forms: -// -// BSFL r32 r32 -// BSFL m32 r32 -// Construct and append a BSFL instruction to the active function. -// Operates on the global context. -func BSFL(mr, r operand.Op) { ctx.BSFL(mr, r) } - -// BSFQ: Bit Scan Forward. -// -// Forms: -// -// BSFQ r64 r64 -// BSFQ m64 r64 -// Construct and append a BSFQ instruction to the active function. -func (c *Context) BSFQ(mr, r operand.Op) { - if inst, err := x86.BSFQ(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BSFQ: Bit Scan Forward. -// -// Forms: -// -// BSFQ r64 r64 -// BSFQ m64 r64 -// Construct and append a BSFQ instruction to the active function. -// Operates on the global context. -func BSFQ(mr, r operand.Op) { ctx.BSFQ(mr, r) } - -// BSFW: Bit Scan Forward. -// -// Forms: -// -// BSFW r16 r16 -// BSFW m16 r16 -// Construct and append a BSFW instruction to the active function. -func (c *Context) BSFW(mr, r operand.Op) { - if inst, err := x86.BSFW(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BSFW: Bit Scan Forward. -// -// Forms: -// -// BSFW r16 r16 -// BSFW m16 r16 -// Construct and append a BSFW instruction to the active function. -// Operates on the global context. -func BSFW(mr, r operand.Op) { ctx.BSFW(mr, r) } - -// BSRL: Bit Scan Reverse. -// -// Forms: -// -// BSRL r32 r32 -// BSRL m32 r32 -// Construct and append a BSRL instruction to the active function. -func (c *Context) BSRL(mr, r operand.Op) { - if inst, err := x86.BSRL(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BSRL: Bit Scan Reverse. -// -// Forms: -// -// BSRL r32 r32 -// BSRL m32 r32 -// Construct and append a BSRL instruction to the active function. -// Operates on the global context. -func BSRL(mr, r operand.Op) { ctx.BSRL(mr, r) } - -// BSRQ: Bit Scan Reverse. -// -// Forms: -// -// BSRQ r64 r64 -// BSRQ m64 r64 -// Construct and append a BSRQ instruction to the active function. -func (c *Context) BSRQ(mr, r operand.Op) { - if inst, err := x86.BSRQ(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BSRQ: Bit Scan Reverse. -// -// Forms: -// -// BSRQ r64 r64 -// BSRQ m64 r64 -// Construct and append a BSRQ instruction to the active function. -// Operates on the global context. -func BSRQ(mr, r operand.Op) { ctx.BSRQ(mr, r) } - -// BSRW: Bit Scan Reverse. -// -// Forms: -// -// BSRW r16 r16 -// BSRW m16 r16 -// Construct and append a BSRW instruction to the active function. -func (c *Context) BSRW(mr, r operand.Op) { - if inst, err := x86.BSRW(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BSRW: Bit Scan Reverse. -// -// Forms: -// -// BSRW r16 r16 -// BSRW m16 r16 -// Construct and append a BSRW instruction to the active function. -// Operates on the global context. -func BSRW(mr, r operand.Op) { ctx.BSRW(mr, r) } - -// BSWAPL: Byte Swap. -// -// Forms: -// -// BSWAPL r32 -// Construct and append a BSWAPL instruction to the active function. -func (c *Context) BSWAPL(r operand.Op) { - if inst, err := x86.BSWAPL(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BSWAPL: Byte Swap. -// -// Forms: -// -// BSWAPL r32 -// Construct and append a BSWAPL instruction to the active function. -// Operates on the global context. -func BSWAPL(r operand.Op) { ctx.BSWAPL(r) } - -// BSWAPQ: Byte Swap. -// -// Forms: -// -// BSWAPQ r64 -// Construct and append a BSWAPQ instruction to the active function. -func (c *Context) BSWAPQ(r operand.Op) { - if inst, err := x86.BSWAPQ(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BSWAPQ: Byte Swap. -// -// Forms: -// -// BSWAPQ r64 -// Construct and append a BSWAPQ instruction to the active function. -// Operates on the global context. -func BSWAPQ(r operand.Op) { ctx.BSWAPQ(r) } - -// BTCL: Bit Test and Complement. -// -// Forms: -// -// BTCL imm8 r32 -// BTCL r32 r32 -// BTCL imm8 m32 -// BTCL r32 m32 -// Construct and append a BTCL instruction to the active function. -func (c *Context) BTCL(ir, mr operand.Op) { - if inst, err := x86.BTCL(ir, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BTCL: Bit Test and Complement. -// -// Forms: -// -// BTCL imm8 r32 -// BTCL r32 r32 -// BTCL imm8 m32 -// BTCL r32 m32 -// Construct and append a BTCL instruction to the active function. -// Operates on the global context. -func BTCL(ir, mr operand.Op) { ctx.BTCL(ir, mr) } - -// BTCQ: Bit Test and Complement. -// -// Forms: -// -// BTCQ imm8 r64 -// BTCQ r64 r64 -// BTCQ imm8 m64 -// BTCQ r64 m64 -// Construct and append a BTCQ instruction to the active function. -func (c *Context) BTCQ(ir, mr operand.Op) { - if inst, err := x86.BTCQ(ir, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BTCQ: Bit Test and Complement. -// -// Forms: -// -// BTCQ imm8 r64 -// BTCQ r64 r64 -// BTCQ imm8 m64 -// BTCQ r64 m64 -// Construct and append a BTCQ instruction to the active function. -// Operates on the global context. -func BTCQ(ir, mr operand.Op) { ctx.BTCQ(ir, mr) } - -// BTCW: Bit Test and Complement. -// -// Forms: -// -// BTCW imm8 r16 -// BTCW r16 r16 -// BTCW imm8 m16 -// BTCW r16 m16 -// Construct and append a BTCW instruction to the active function. -func (c *Context) BTCW(ir, mr operand.Op) { - if inst, err := x86.BTCW(ir, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BTCW: Bit Test and Complement. -// -// Forms: -// -// BTCW imm8 r16 -// BTCW r16 r16 -// BTCW imm8 m16 -// BTCW r16 m16 -// Construct and append a BTCW instruction to the active function. -// Operates on the global context. -func BTCW(ir, mr operand.Op) { ctx.BTCW(ir, mr) } - -// BTL: Bit Test. -// -// Forms: -// -// BTL imm8 r32 -// BTL r32 r32 -// BTL imm8 m32 -// BTL r32 m32 -// Construct and append a BTL instruction to the active function. -func (c *Context) BTL(ir, mr operand.Op) { - if inst, err := x86.BTL(ir, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BTL: Bit Test. -// -// Forms: -// -// BTL imm8 r32 -// BTL r32 r32 -// BTL imm8 m32 -// BTL r32 m32 -// Construct and append a BTL instruction to the active function. -// Operates on the global context. -func BTL(ir, mr operand.Op) { ctx.BTL(ir, mr) } - -// BTQ: Bit Test. -// -// Forms: -// -// BTQ imm8 r64 -// BTQ r64 r64 -// BTQ imm8 m64 -// BTQ r64 m64 -// Construct and append a BTQ instruction to the active function. -func (c *Context) BTQ(ir, mr operand.Op) { - if inst, err := x86.BTQ(ir, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BTQ: Bit Test. -// -// Forms: -// -// BTQ imm8 r64 -// BTQ r64 r64 -// BTQ imm8 m64 -// BTQ r64 m64 -// Construct and append a BTQ instruction to the active function. -// Operates on the global context. -func BTQ(ir, mr operand.Op) { ctx.BTQ(ir, mr) } - -// BTRL: Bit Test and Reset. -// -// Forms: -// -// BTRL imm8 r32 -// BTRL r32 r32 -// BTRL imm8 m32 -// BTRL r32 m32 -// Construct and append a BTRL instruction to the active function. -func (c *Context) BTRL(ir, mr operand.Op) { - if inst, err := x86.BTRL(ir, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BTRL: Bit Test and Reset. -// -// Forms: -// -// BTRL imm8 r32 -// BTRL r32 r32 -// BTRL imm8 m32 -// BTRL r32 m32 -// Construct and append a BTRL instruction to the active function. -// Operates on the global context. -func BTRL(ir, mr operand.Op) { ctx.BTRL(ir, mr) } - -// BTRQ: Bit Test and Reset. -// -// Forms: -// -// BTRQ imm8 r64 -// BTRQ r64 r64 -// BTRQ imm8 m64 -// BTRQ r64 m64 -// Construct and append a BTRQ instruction to the active function. -func (c *Context) BTRQ(ir, mr operand.Op) { - if inst, err := x86.BTRQ(ir, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BTRQ: Bit Test and Reset. -// -// Forms: -// -// BTRQ imm8 r64 -// BTRQ r64 r64 -// BTRQ imm8 m64 -// BTRQ r64 m64 -// Construct and append a BTRQ instruction to the active function. -// Operates on the global context. -func BTRQ(ir, mr operand.Op) { ctx.BTRQ(ir, mr) } - -// BTRW: Bit Test and Reset. -// -// Forms: -// -// BTRW imm8 r16 -// BTRW r16 r16 -// BTRW imm8 m16 -// BTRW r16 m16 -// Construct and append a BTRW instruction to the active function. -func (c *Context) BTRW(ir, mr operand.Op) { - if inst, err := x86.BTRW(ir, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BTRW: Bit Test and Reset. -// -// Forms: -// -// BTRW imm8 r16 -// BTRW r16 r16 -// BTRW imm8 m16 -// BTRW r16 m16 -// Construct and append a BTRW instruction to the active function. -// Operates on the global context. -func BTRW(ir, mr operand.Op) { ctx.BTRW(ir, mr) } - -// BTSL: Bit Test and Set. -// -// Forms: -// -// BTSL imm8 r32 -// BTSL r32 r32 -// BTSL imm8 m32 -// BTSL r32 m32 -// Construct and append a BTSL instruction to the active function. -func (c *Context) BTSL(ir, mr operand.Op) { - if inst, err := x86.BTSL(ir, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BTSL: Bit Test and Set. -// -// Forms: -// -// BTSL imm8 r32 -// BTSL r32 r32 -// BTSL imm8 m32 -// BTSL r32 m32 -// Construct and append a BTSL instruction to the active function. -// Operates on the global context. -func BTSL(ir, mr operand.Op) { ctx.BTSL(ir, mr) } - -// BTSQ: Bit Test and Set. -// -// Forms: -// -// BTSQ imm8 r64 -// BTSQ r64 r64 -// BTSQ imm8 m64 -// BTSQ r64 m64 -// Construct and append a BTSQ instruction to the active function. -func (c *Context) BTSQ(ir, mr operand.Op) { - if inst, err := x86.BTSQ(ir, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BTSQ: Bit Test and Set. -// -// Forms: -// -// BTSQ imm8 r64 -// BTSQ r64 r64 -// BTSQ imm8 m64 -// BTSQ r64 m64 -// Construct and append a BTSQ instruction to the active function. -// Operates on the global context. -func BTSQ(ir, mr operand.Op) { ctx.BTSQ(ir, mr) } - -// BTSW: Bit Test and Set. -// -// Forms: -// -// BTSW imm8 r16 -// BTSW r16 r16 -// BTSW imm8 m16 -// BTSW r16 m16 -// Construct and append a BTSW instruction to the active function. -func (c *Context) BTSW(ir, mr operand.Op) { - if inst, err := x86.BTSW(ir, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BTSW: Bit Test and Set. -// -// Forms: -// -// BTSW imm8 r16 -// BTSW r16 r16 -// BTSW imm8 m16 -// BTSW r16 m16 -// Construct and append a BTSW instruction to the active function. -// Operates on the global context. -func BTSW(ir, mr operand.Op) { ctx.BTSW(ir, mr) } - -// BTW: Bit Test. -// -// Forms: -// -// BTW imm8 r16 -// BTW r16 r16 -// BTW imm8 m16 -// BTW r16 m16 -// Construct and append a BTW instruction to the active function. -func (c *Context) BTW(ir, mr operand.Op) { - if inst, err := x86.BTW(ir, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BTW: Bit Test. -// -// Forms: -// -// BTW imm8 r16 -// BTW r16 r16 -// BTW imm8 m16 -// BTW r16 m16 -// Construct and append a BTW instruction to the active function. -// Operates on the global context. -func BTW(ir, mr operand.Op) { ctx.BTW(ir, mr) } - -// BZHIL: Zero High Bits Starting with Specified Bit Position. -// -// Forms: -// -// BZHIL r32 r32 r32 -// BZHIL r32 m32 r32 -// Construct and append a BZHIL instruction to the active function. -func (c *Context) BZHIL(r, mr, r1 operand.Op) { - if inst, err := x86.BZHIL(r, mr, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BZHIL: Zero High Bits Starting with Specified Bit Position. -// -// Forms: -// -// BZHIL r32 r32 r32 -// BZHIL r32 m32 r32 -// Construct and append a BZHIL instruction to the active function. -// Operates on the global context. -func BZHIL(r, mr, r1 operand.Op) { ctx.BZHIL(r, mr, r1) } - -// BZHIQ: Zero High Bits Starting with Specified Bit Position. -// -// Forms: -// -// BZHIQ r64 r64 r64 -// BZHIQ r64 m64 r64 -// Construct and append a BZHIQ instruction to the active function. -func (c *Context) BZHIQ(r, mr, r1 operand.Op) { - if inst, err := x86.BZHIQ(r, mr, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// BZHIQ: Zero High Bits Starting with Specified Bit Position. -// -// Forms: -// -// BZHIQ r64 r64 r64 -// BZHIQ r64 m64 r64 -// Construct and append a BZHIQ instruction to the active function. -// Operates on the global context. -func BZHIQ(r, mr, r1 operand.Op) { ctx.BZHIQ(r, mr, r1) } - -// CALL: Call Procedure. -// -// Forms: -// -// CALL rel32 -// Construct and append a CALL instruction to the active function. -func (c *Context) CALL(r operand.Op) { - if inst, err := x86.CALL(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CALL: Call Procedure. -// -// Forms: -// -// CALL rel32 -// Construct and append a CALL instruction to the active function. -// Operates on the global context. -func CALL(r operand.Op) { ctx.CALL(r) } - -// CBW: Convert Byte to Word. -// -// Forms: -// -// CBW -// Construct and append a CBW instruction to the active function. -func (c *Context) CBW() { - if inst, err := x86.CBW(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CBW: Convert Byte to Word. -// -// Forms: -// -// CBW -// Construct and append a CBW instruction to the active function. -// Operates on the global context. -func CBW() { ctx.CBW() } - -// CDQ: Convert Doubleword to Quadword. -// -// Forms: -// -// CDQ -// Construct and append a CDQ instruction to the active function. -func (c *Context) CDQ() { - if inst, err := x86.CDQ(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CDQ: Convert Doubleword to Quadword. -// -// Forms: -// -// CDQ -// Construct and append a CDQ instruction to the active function. -// Operates on the global context. -func CDQ() { ctx.CDQ() } - -// CDQE: Convert Doubleword to Quadword. -// -// Forms: -// -// CDQE -// Construct and append a CDQE instruction to the active function. -func (c *Context) CDQE() { - if inst, err := x86.CDQE(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CDQE: Convert Doubleword to Quadword. -// -// Forms: -// -// CDQE -// Construct and append a CDQE instruction to the active function. -// Operates on the global context. -func CDQE() { ctx.CDQE() } - -// CLC: Clear Carry Flag. -// -// Forms: -// -// CLC -// Construct and append a CLC instruction to the active function. -func (c *Context) CLC() { - if inst, err := x86.CLC(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CLC: Clear Carry Flag. -// -// Forms: -// -// CLC -// Construct and append a CLC instruction to the active function. -// Operates on the global context. -func CLC() { ctx.CLC() } - -// CLD: Clear Direction Flag. -// -// Forms: -// -// CLD -// Construct and append a CLD instruction to the active function. -func (c *Context) CLD() { - if inst, err := x86.CLD(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CLD: Clear Direction Flag. -// -// Forms: -// -// CLD -// Construct and append a CLD instruction to the active function. -// Operates on the global context. -func CLD() { ctx.CLD() } - -// CLFLUSH: Flush Cache Line. -// -// Forms: -// -// CLFLUSH m8 -// Construct and append a CLFLUSH instruction to the active function. -func (c *Context) CLFLUSH(m operand.Op) { - if inst, err := x86.CLFLUSH(m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CLFLUSH: Flush Cache Line. -// -// Forms: -// -// CLFLUSH m8 -// Construct and append a CLFLUSH instruction to the active function. -// Operates on the global context. -func CLFLUSH(m operand.Op) { ctx.CLFLUSH(m) } - -// CLFLUSHOPT: Flush Cache Line Optimized. -// -// Forms: -// -// CLFLUSHOPT m8 -// Construct and append a CLFLUSHOPT instruction to the active function. -func (c *Context) CLFLUSHOPT(m operand.Op) { - if inst, err := x86.CLFLUSHOPT(m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CLFLUSHOPT: Flush Cache Line Optimized. -// -// Forms: -// -// CLFLUSHOPT m8 -// Construct and append a CLFLUSHOPT instruction to the active function. -// Operates on the global context. -func CLFLUSHOPT(m operand.Op) { ctx.CLFLUSHOPT(m) } - -// CMC: Complement Carry Flag. -// -// Forms: -// -// CMC -// Construct and append a CMC instruction to the active function. -func (c *Context) CMC() { - if inst, err := x86.CMC(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMC: Complement Carry Flag. -// -// Forms: -// -// CMC -// Construct and append a CMC instruction to the active function. -// Operates on the global context. -func CMC() { ctx.CMC() } - -// CMOVLCC: Move if above or equal (CF == 0). -// -// Forms: -// -// CMOVLCC r32 r32 -// CMOVLCC m32 r32 -// Construct and append a CMOVLCC instruction to the active function. -func (c *Context) CMOVLCC(mr, r operand.Op) { - if inst, err := x86.CMOVLCC(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVLCC: Move if above or equal (CF == 0). -// -// Forms: -// -// CMOVLCC r32 r32 -// CMOVLCC m32 r32 -// Construct and append a CMOVLCC instruction to the active function. -// Operates on the global context. -func CMOVLCC(mr, r operand.Op) { ctx.CMOVLCC(mr, r) } - -// CMOVLCS: Move if below (CF == 1). -// -// Forms: -// -// CMOVLCS r32 r32 -// CMOVLCS m32 r32 -// Construct and append a CMOVLCS instruction to the active function. -func (c *Context) CMOVLCS(mr, r operand.Op) { - if inst, err := x86.CMOVLCS(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVLCS: Move if below (CF == 1). -// -// Forms: -// -// CMOVLCS r32 r32 -// CMOVLCS m32 r32 -// Construct and append a CMOVLCS instruction to the active function. -// Operates on the global context. -func CMOVLCS(mr, r operand.Op) { ctx.CMOVLCS(mr, r) } - -// CMOVLEQ: Move if equal (ZF == 1). -// -// Forms: -// -// CMOVLEQ r32 r32 -// CMOVLEQ m32 r32 -// Construct and append a CMOVLEQ instruction to the active function. -func (c *Context) CMOVLEQ(mr, r operand.Op) { - if inst, err := x86.CMOVLEQ(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVLEQ: Move if equal (ZF == 1). -// -// Forms: -// -// CMOVLEQ r32 r32 -// CMOVLEQ m32 r32 -// Construct and append a CMOVLEQ instruction to the active function. -// Operates on the global context. -func CMOVLEQ(mr, r operand.Op) { ctx.CMOVLEQ(mr, r) } - -// CMOVLGE: Move if greater or equal (SF == OF). -// -// Forms: -// -// CMOVLGE r32 r32 -// CMOVLGE m32 r32 -// Construct and append a CMOVLGE instruction to the active function. -func (c *Context) CMOVLGE(mr, r operand.Op) { - if inst, err := x86.CMOVLGE(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVLGE: Move if greater or equal (SF == OF). -// -// Forms: -// -// CMOVLGE r32 r32 -// CMOVLGE m32 r32 -// Construct and append a CMOVLGE instruction to the active function. -// Operates on the global context. -func CMOVLGE(mr, r operand.Op) { ctx.CMOVLGE(mr, r) } - -// CMOVLGT: Move if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// CMOVLGT r32 r32 -// CMOVLGT m32 r32 -// Construct and append a CMOVLGT instruction to the active function. -func (c *Context) CMOVLGT(mr, r operand.Op) { - if inst, err := x86.CMOVLGT(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVLGT: Move if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// CMOVLGT r32 r32 -// CMOVLGT m32 r32 -// Construct and append a CMOVLGT instruction to the active function. -// Operates on the global context. -func CMOVLGT(mr, r operand.Op) { ctx.CMOVLGT(mr, r) } - -// CMOVLHI: Move if above (CF == 0 and ZF == 0). -// -// Forms: -// -// CMOVLHI r32 r32 -// CMOVLHI m32 r32 -// Construct and append a CMOVLHI instruction to the active function. -func (c *Context) CMOVLHI(mr, r operand.Op) { - if inst, err := x86.CMOVLHI(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVLHI: Move if above (CF == 0 and ZF == 0). -// -// Forms: -// -// CMOVLHI r32 r32 -// CMOVLHI m32 r32 -// Construct and append a CMOVLHI instruction to the active function. -// Operates on the global context. -func CMOVLHI(mr, r operand.Op) { ctx.CMOVLHI(mr, r) } - -// CMOVLLE: Move if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// CMOVLLE r32 r32 -// CMOVLLE m32 r32 -// Construct and append a CMOVLLE instruction to the active function. -func (c *Context) CMOVLLE(mr, r operand.Op) { - if inst, err := x86.CMOVLLE(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVLLE: Move if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// CMOVLLE r32 r32 -// CMOVLLE m32 r32 -// Construct and append a CMOVLLE instruction to the active function. -// Operates on the global context. -func CMOVLLE(mr, r operand.Op) { ctx.CMOVLLE(mr, r) } - -// CMOVLLS: Move if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// CMOVLLS r32 r32 -// CMOVLLS m32 r32 -// Construct and append a CMOVLLS instruction to the active function. -func (c *Context) CMOVLLS(mr, r operand.Op) { - if inst, err := x86.CMOVLLS(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVLLS: Move if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// CMOVLLS r32 r32 -// CMOVLLS m32 r32 -// Construct and append a CMOVLLS instruction to the active function. -// Operates on the global context. -func CMOVLLS(mr, r operand.Op) { ctx.CMOVLLS(mr, r) } - -// CMOVLLT: Move if less (SF != OF). -// -// Forms: -// -// CMOVLLT r32 r32 -// CMOVLLT m32 r32 -// Construct and append a CMOVLLT instruction to the active function. -func (c *Context) CMOVLLT(mr, r operand.Op) { - if inst, err := x86.CMOVLLT(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVLLT: Move if less (SF != OF). -// -// Forms: -// -// CMOVLLT r32 r32 -// CMOVLLT m32 r32 -// Construct and append a CMOVLLT instruction to the active function. -// Operates on the global context. -func CMOVLLT(mr, r operand.Op) { ctx.CMOVLLT(mr, r) } - -// CMOVLMI: Move if sign (SF == 1). -// -// Forms: -// -// CMOVLMI r32 r32 -// CMOVLMI m32 r32 -// Construct and append a CMOVLMI instruction to the active function. -func (c *Context) CMOVLMI(mr, r operand.Op) { - if inst, err := x86.CMOVLMI(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVLMI: Move if sign (SF == 1). -// -// Forms: -// -// CMOVLMI r32 r32 -// CMOVLMI m32 r32 -// Construct and append a CMOVLMI instruction to the active function. -// Operates on the global context. -func CMOVLMI(mr, r operand.Op) { ctx.CMOVLMI(mr, r) } - -// CMOVLNE: Move if not equal (ZF == 0). -// -// Forms: -// -// CMOVLNE r32 r32 -// CMOVLNE m32 r32 -// Construct and append a CMOVLNE instruction to the active function. -func (c *Context) CMOVLNE(mr, r operand.Op) { - if inst, err := x86.CMOVLNE(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVLNE: Move if not equal (ZF == 0). -// -// Forms: -// -// CMOVLNE r32 r32 -// CMOVLNE m32 r32 -// Construct and append a CMOVLNE instruction to the active function. -// Operates on the global context. -func CMOVLNE(mr, r operand.Op) { ctx.CMOVLNE(mr, r) } - -// CMOVLOC: Move if not overflow (OF == 0). -// -// Forms: -// -// CMOVLOC r32 r32 -// CMOVLOC m32 r32 -// Construct and append a CMOVLOC instruction to the active function. -func (c *Context) CMOVLOC(mr, r operand.Op) { - if inst, err := x86.CMOVLOC(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVLOC: Move if not overflow (OF == 0). -// -// Forms: -// -// CMOVLOC r32 r32 -// CMOVLOC m32 r32 -// Construct and append a CMOVLOC instruction to the active function. -// Operates on the global context. -func CMOVLOC(mr, r operand.Op) { ctx.CMOVLOC(mr, r) } - -// CMOVLOS: Move if overflow (OF == 1). -// -// Forms: -// -// CMOVLOS r32 r32 -// CMOVLOS m32 r32 -// Construct and append a CMOVLOS instruction to the active function. -func (c *Context) CMOVLOS(mr, r operand.Op) { - if inst, err := x86.CMOVLOS(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVLOS: Move if overflow (OF == 1). -// -// Forms: -// -// CMOVLOS r32 r32 -// CMOVLOS m32 r32 -// Construct and append a CMOVLOS instruction to the active function. -// Operates on the global context. -func CMOVLOS(mr, r operand.Op) { ctx.CMOVLOS(mr, r) } - -// CMOVLPC: Move if not parity (PF == 0). -// -// Forms: -// -// CMOVLPC r32 r32 -// CMOVLPC m32 r32 -// Construct and append a CMOVLPC instruction to the active function. -func (c *Context) CMOVLPC(mr, r operand.Op) { - if inst, err := x86.CMOVLPC(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVLPC: Move if not parity (PF == 0). -// -// Forms: -// -// CMOVLPC r32 r32 -// CMOVLPC m32 r32 -// Construct and append a CMOVLPC instruction to the active function. -// Operates on the global context. -func CMOVLPC(mr, r operand.Op) { ctx.CMOVLPC(mr, r) } - -// CMOVLPL: Move if not sign (SF == 0). -// -// Forms: -// -// CMOVLPL r32 r32 -// CMOVLPL m32 r32 -// Construct and append a CMOVLPL instruction to the active function. -func (c *Context) CMOVLPL(mr, r operand.Op) { - if inst, err := x86.CMOVLPL(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVLPL: Move if not sign (SF == 0). -// -// Forms: -// -// CMOVLPL r32 r32 -// CMOVLPL m32 r32 -// Construct and append a CMOVLPL instruction to the active function. -// Operates on the global context. -func CMOVLPL(mr, r operand.Op) { ctx.CMOVLPL(mr, r) } - -// CMOVLPS: Move if parity (PF == 1). -// -// Forms: -// -// CMOVLPS r32 r32 -// CMOVLPS m32 r32 -// Construct and append a CMOVLPS instruction to the active function. -func (c *Context) CMOVLPS(mr, r operand.Op) { - if inst, err := x86.CMOVLPS(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVLPS: Move if parity (PF == 1). -// -// Forms: -// -// CMOVLPS r32 r32 -// CMOVLPS m32 r32 -// Construct and append a CMOVLPS instruction to the active function. -// Operates on the global context. -func CMOVLPS(mr, r operand.Op) { ctx.CMOVLPS(mr, r) } - -// CMOVQCC: Move if above or equal (CF == 0). -// -// Forms: -// -// CMOVQCC r64 r64 -// CMOVQCC m64 r64 -// Construct and append a CMOVQCC instruction to the active function. -func (c *Context) CMOVQCC(mr, r operand.Op) { - if inst, err := x86.CMOVQCC(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVQCC: Move if above or equal (CF == 0). -// -// Forms: -// -// CMOVQCC r64 r64 -// CMOVQCC m64 r64 -// Construct and append a CMOVQCC instruction to the active function. -// Operates on the global context. -func CMOVQCC(mr, r operand.Op) { ctx.CMOVQCC(mr, r) } - -// CMOVQCS: Move if below (CF == 1). -// -// Forms: -// -// CMOVQCS r64 r64 -// CMOVQCS m64 r64 -// Construct and append a CMOVQCS instruction to the active function. -func (c *Context) CMOVQCS(mr, r operand.Op) { - if inst, err := x86.CMOVQCS(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVQCS: Move if below (CF == 1). -// -// Forms: -// -// CMOVQCS r64 r64 -// CMOVQCS m64 r64 -// Construct and append a CMOVQCS instruction to the active function. -// Operates on the global context. -func CMOVQCS(mr, r operand.Op) { ctx.CMOVQCS(mr, r) } - -// CMOVQEQ: Move if equal (ZF == 1). -// -// Forms: -// -// CMOVQEQ r64 r64 -// CMOVQEQ m64 r64 -// Construct and append a CMOVQEQ instruction to the active function. -func (c *Context) CMOVQEQ(mr, r operand.Op) { - if inst, err := x86.CMOVQEQ(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVQEQ: Move if equal (ZF == 1). -// -// Forms: -// -// CMOVQEQ r64 r64 -// CMOVQEQ m64 r64 -// Construct and append a CMOVQEQ instruction to the active function. -// Operates on the global context. -func CMOVQEQ(mr, r operand.Op) { ctx.CMOVQEQ(mr, r) } - -// CMOVQGE: Move if greater or equal (SF == OF). -// -// Forms: -// -// CMOVQGE r64 r64 -// CMOVQGE m64 r64 -// Construct and append a CMOVQGE instruction to the active function. -func (c *Context) CMOVQGE(mr, r operand.Op) { - if inst, err := x86.CMOVQGE(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVQGE: Move if greater or equal (SF == OF). -// -// Forms: -// -// CMOVQGE r64 r64 -// CMOVQGE m64 r64 -// Construct and append a CMOVQGE instruction to the active function. -// Operates on the global context. -func CMOVQGE(mr, r operand.Op) { ctx.CMOVQGE(mr, r) } - -// CMOVQGT: Move if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// CMOVQGT r64 r64 -// CMOVQGT m64 r64 -// Construct and append a CMOVQGT instruction to the active function. -func (c *Context) CMOVQGT(mr, r operand.Op) { - if inst, err := x86.CMOVQGT(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVQGT: Move if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// CMOVQGT r64 r64 -// CMOVQGT m64 r64 -// Construct and append a CMOVQGT instruction to the active function. -// Operates on the global context. -func CMOVQGT(mr, r operand.Op) { ctx.CMOVQGT(mr, r) } - -// CMOVQHI: Move if above (CF == 0 and ZF == 0). -// -// Forms: -// -// CMOVQHI r64 r64 -// CMOVQHI m64 r64 -// Construct and append a CMOVQHI instruction to the active function. -func (c *Context) CMOVQHI(mr, r operand.Op) { - if inst, err := x86.CMOVQHI(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVQHI: Move if above (CF == 0 and ZF == 0). -// -// Forms: -// -// CMOVQHI r64 r64 -// CMOVQHI m64 r64 -// Construct and append a CMOVQHI instruction to the active function. -// Operates on the global context. -func CMOVQHI(mr, r operand.Op) { ctx.CMOVQHI(mr, r) } - -// CMOVQLE: Move if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// CMOVQLE r64 r64 -// CMOVQLE m64 r64 -// Construct and append a CMOVQLE instruction to the active function. -func (c *Context) CMOVQLE(mr, r operand.Op) { - if inst, err := x86.CMOVQLE(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVQLE: Move if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// CMOVQLE r64 r64 -// CMOVQLE m64 r64 -// Construct and append a CMOVQLE instruction to the active function. -// Operates on the global context. -func CMOVQLE(mr, r operand.Op) { ctx.CMOVQLE(mr, r) } - -// CMOVQLS: Move if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// CMOVQLS r64 r64 -// CMOVQLS m64 r64 -// Construct and append a CMOVQLS instruction to the active function. -func (c *Context) CMOVQLS(mr, r operand.Op) { - if inst, err := x86.CMOVQLS(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVQLS: Move if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// CMOVQLS r64 r64 -// CMOVQLS m64 r64 -// Construct and append a CMOVQLS instruction to the active function. -// Operates on the global context. -func CMOVQLS(mr, r operand.Op) { ctx.CMOVQLS(mr, r) } - -// CMOVQLT: Move if less (SF != OF). -// -// Forms: -// -// CMOVQLT r64 r64 -// CMOVQLT m64 r64 -// Construct and append a CMOVQLT instruction to the active function. -func (c *Context) CMOVQLT(mr, r operand.Op) { - if inst, err := x86.CMOVQLT(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVQLT: Move if less (SF != OF). -// -// Forms: -// -// CMOVQLT r64 r64 -// CMOVQLT m64 r64 -// Construct and append a CMOVQLT instruction to the active function. -// Operates on the global context. -func CMOVQLT(mr, r operand.Op) { ctx.CMOVQLT(mr, r) } - -// CMOVQMI: Move if sign (SF == 1). -// -// Forms: -// -// CMOVQMI r64 r64 -// CMOVQMI m64 r64 -// Construct and append a CMOVQMI instruction to the active function. -func (c *Context) CMOVQMI(mr, r operand.Op) { - if inst, err := x86.CMOVQMI(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVQMI: Move if sign (SF == 1). -// -// Forms: -// -// CMOVQMI r64 r64 -// CMOVQMI m64 r64 -// Construct and append a CMOVQMI instruction to the active function. -// Operates on the global context. -func CMOVQMI(mr, r operand.Op) { ctx.CMOVQMI(mr, r) } - -// CMOVQNE: Move if not equal (ZF == 0). -// -// Forms: -// -// CMOVQNE r64 r64 -// CMOVQNE m64 r64 -// Construct and append a CMOVQNE instruction to the active function. -func (c *Context) CMOVQNE(mr, r operand.Op) { - if inst, err := x86.CMOVQNE(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVQNE: Move if not equal (ZF == 0). -// -// Forms: -// -// CMOVQNE r64 r64 -// CMOVQNE m64 r64 -// Construct and append a CMOVQNE instruction to the active function. -// Operates on the global context. -func CMOVQNE(mr, r operand.Op) { ctx.CMOVQNE(mr, r) } - -// CMOVQOC: Move if not overflow (OF == 0). -// -// Forms: -// -// CMOVQOC r64 r64 -// CMOVQOC m64 r64 -// Construct and append a CMOVQOC instruction to the active function. -func (c *Context) CMOVQOC(mr, r operand.Op) { - if inst, err := x86.CMOVQOC(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVQOC: Move if not overflow (OF == 0). -// -// Forms: -// -// CMOVQOC r64 r64 -// CMOVQOC m64 r64 -// Construct and append a CMOVQOC instruction to the active function. -// Operates on the global context. -func CMOVQOC(mr, r operand.Op) { ctx.CMOVQOC(mr, r) } - -// CMOVQOS: Move if overflow (OF == 1). -// -// Forms: -// -// CMOVQOS r64 r64 -// CMOVQOS m64 r64 -// Construct and append a CMOVQOS instruction to the active function. -func (c *Context) CMOVQOS(mr, r operand.Op) { - if inst, err := x86.CMOVQOS(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVQOS: Move if overflow (OF == 1). -// -// Forms: -// -// CMOVQOS r64 r64 -// CMOVQOS m64 r64 -// Construct and append a CMOVQOS instruction to the active function. -// Operates on the global context. -func CMOVQOS(mr, r operand.Op) { ctx.CMOVQOS(mr, r) } - -// CMOVQPC: Move if not parity (PF == 0). -// -// Forms: -// -// CMOVQPC r64 r64 -// CMOVQPC m64 r64 -// Construct and append a CMOVQPC instruction to the active function. -func (c *Context) CMOVQPC(mr, r operand.Op) { - if inst, err := x86.CMOVQPC(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVQPC: Move if not parity (PF == 0). -// -// Forms: -// -// CMOVQPC r64 r64 -// CMOVQPC m64 r64 -// Construct and append a CMOVQPC instruction to the active function. -// Operates on the global context. -func CMOVQPC(mr, r operand.Op) { ctx.CMOVQPC(mr, r) } - -// CMOVQPL: Move if not sign (SF == 0). -// -// Forms: -// -// CMOVQPL r64 r64 -// CMOVQPL m64 r64 -// Construct and append a CMOVQPL instruction to the active function. -func (c *Context) CMOVQPL(mr, r operand.Op) { - if inst, err := x86.CMOVQPL(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVQPL: Move if not sign (SF == 0). -// -// Forms: -// -// CMOVQPL r64 r64 -// CMOVQPL m64 r64 -// Construct and append a CMOVQPL instruction to the active function. -// Operates on the global context. -func CMOVQPL(mr, r operand.Op) { ctx.CMOVQPL(mr, r) } - -// CMOVQPS: Move if parity (PF == 1). -// -// Forms: -// -// CMOVQPS r64 r64 -// CMOVQPS m64 r64 -// Construct and append a CMOVQPS instruction to the active function. -func (c *Context) CMOVQPS(mr, r operand.Op) { - if inst, err := x86.CMOVQPS(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVQPS: Move if parity (PF == 1). -// -// Forms: -// -// CMOVQPS r64 r64 -// CMOVQPS m64 r64 -// Construct and append a CMOVQPS instruction to the active function. -// Operates on the global context. -func CMOVQPS(mr, r operand.Op) { ctx.CMOVQPS(mr, r) } - -// CMOVWCC: Move if above or equal (CF == 0). -// -// Forms: -// -// CMOVWCC r16 r16 -// CMOVWCC m16 r16 -// Construct and append a CMOVWCC instruction to the active function. -func (c *Context) CMOVWCC(mr, r operand.Op) { - if inst, err := x86.CMOVWCC(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVWCC: Move if above or equal (CF == 0). -// -// Forms: -// -// CMOVWCC r16 r16 -// CMOVWCC m16 r16 -// Construct and append a CMOVWCC instruction to the active function. -// Operates on the global context. -func CMOVWCC(mr, r operand.Op) { ctx.CMOVWCC(mr, r) } - -// CMOVWCS: Move if below (CF == 1). -// -// Forms: -// -// CMOVWCS r16 r16 -// CMOVWCS m16 r16 -// Construct and append a CMOVWCS instruction to the active function. -func (c *Context) CMOVWCS(mr, r operand.Op) { - if inst, err := x86.CMOVWCS(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVWCS: Move if below (CF == 1). -// -// Forms: -// -// CMOVWCS r16 r16 -// CMOVWCS m16 r16 -// Construct and append a CMOVWCS instruction to the active function. -// Operates on the global context. -func CMOVWCS(mr, r operand.Op) { ctx.CMOVWCS(mr, r) } - -// CMOVWEQ: Move if equal (ZF == 1). -// -// Forms: -// -// CMOVWEQ r16 r16 -// CMOVWEQ m16 r16 -// Construct and append a CMOVWEQ instruction to the active function. -func (c *Context) CMOVWEQ(mr, r operand.Op) { - if inst, err := x86.CMOVWEQ(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVWEQ: Move if equal (ZF == 1). -// -// Forms: -// -// CMOVWEQ r16 r16 -// CMOVWEQ m16 r16 -// Construct and append a CMOVWEQ instruction to the active function. -// Operates on the global context. -func CMOVWEQ(mr, r operand.Op) { ctx.CMOVWEQ(mr, r) } - -// CMOVWGE: Move if greater or equal (SF == OF). -// -// Forms: -// -// CMOVWGE r16 r16 -// CMOVWGE m16 r16 -// Construct and append a CMOVWGE instruction to the active function. -func (c *Context) CMOVWGE(mr, r operand.Op) { - if inst, err := x86.CMOVWGE(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVWGE: Move if greater or equal (SF == OF). -// -// Forms: -// -// CMOVWGE r16 r16 -// CMOVWGE m16 r16 -// Construct and append a CMOVWGE instruction to the active function. -// Operates on the global context. -func CMOVWGE(mr, r operand.Op) { ctx.CMOVWGE(mr, r) } - -// CMOVWGT: Move if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// CMOVWGT r16 r16 -// CMOVWGT m16 r16 -// Construct and append a CMOVWGT instruction to the active function. -func (c *Context) CMOVWGT(mr, r operand.Op) { - if inst, err := x86.CMOVWGT(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVWGT: Move if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// CMOVWGT r16 r16 -// CMOVWGT m16 r16 -// Construct and append a CMOVWGT instruction to the active function. -// Operates on the global context. -func CMOVWGT(mr, r operand.Op) { ctx.CMOVWGT(mr, r) } - -// CMOVWHI: Move if above (CF == 0 and ZF == 0). -// -// Forms: -// -// CMOVWHI r16 r16 -// CMOVWHI m16 r16 -// Construct and append a CMOVWHI instruction to the active function. -func (c *Context) CMOVWHI(mr, r operand.Op) { - if inst, err := x86.CMOVWHI(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVWHI: Move if above (CF == 0 and ZF == 0). -// -// Forms: -// -// CMOVWHI r16 r16 -// CMOVWHI m16 r16 -// Construct and append a CMOVWHI instruction to the active function. -// Operates on the global context. -func CMOVWHI(mr, r operand.Op) { ctx.CMOVWHI(mr, r) } - -// CMOVWLE: Move if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// CMOVWLE r16 r16 -// CMOVWLE m16 r16 -// Construct and append a CMOVWLE instruction to the active function. -func (c *Context) CMOVWLE(mr, r operand.Op) { - if inst, err := x86.CMOVWLE(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVWLE: Move if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// CMOVWLE r16 r16 -// CMOVWLE m16 r16 -// Construct and append a CMOVWLE instruction to the active function. -// Operates on the global context. -func CMOVWLE(mr, r operand.Op) { ctx.CMOVWLE(mr, r) } - -// CMOVWLS: Move if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// CMOVWLS r16 r16 -// CMOVWLS m16 r16 -// Construct and append a CMOVWLS instruction to the active function. -func (c *Context) CMOVWLS(mr, r operand.Op) { - if inst, err := x86.CMOVWLS(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVWLS: Move if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// CMOVWLS r16 r16 -// CMOVWLS m16 r16 -// Construct and append a CMOVWLS instruction to the active function. -// Operates on the global context. -func CMOVWLS(mr, r operand.Op) { ctx.CMOVWLS(mr, r) } - -// CMOVWLT: Move if less (SF != OF). -// -// Forms: -// -// CMOVWLT r16 r16 -// CMOVWLT m16 r16 -// Construct and append a CMOVWLT instruction to the active function. -func (c *Context) CMOVWLT(mr, r operand.Op) { - if inst, err := x86.CMOVWLT(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVWLT: Move if less (SF != OF). -// -// Forms: -// -// CMOVWLT r16 r16 -// CMOVWLT m16 r16 -// Construct and append a CMOVWLT instruction to the active function. -// Operates on the global context. -func CMOVWLT(mr, r operand.Op) { ctx.CMOVWLT(mr, r) } - -// CMOVWMI: Move if sign (SF == 1). -// -// Forms: -// -// CMOVWMI r16 r16 -// CMOVWMI m16 r16 -// Construct and append a CMOVWMI instruction to the active function. -func (c *Context) CMOVWMI(mr, r operand.Op) { - if inst, err := x86.CMOVWMI(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVWMI: Move if sign (SF == 1). -// -// Forms: -// -// CMOVWMI r16 r16 -// CMOVWMI m16 r16 -// Construct and append a CMOVWMI instruction to the active function. -// Operates on the global context. -func CMOVWMI(mr, r operand.Op) { ctx.CMOVWMI(mr, r) } - -// CMOVWNE: Move if not equal (ZF == 0). -// -// Forms: -// -// CMOVWNE r16 r16 -// CMOVWNE m16 r16 -// Construct and append a CMOVWNE instruction to the active function. -func (c *Context) CMOVWNE(mr, r operand.Op) { - if inst, err := x86.CMOVWNE(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVWNE: Move if not equal (ZF == 0). -// -// Forms: -// -// CMOVWNE r16 r16 -// CMOVWNE m16 r16 -// Construct and append a CMOVWNE instruction to the active function. -// Operates on the global context. -func CMOVWNE(mr, r operand.Op) { ctx.CMOVWNE(mr, r) } - -// CMOVWOC: Move if not overflow (OF == 0). -// -// Forms: -// -// CMOVWOC r16 r16 -// CMOVWOC m16 r16 -// Construct and append a CMOVWOC instruction to the active function. -func (c *Context) CMOVWOC(mr, r operand.Op) { - if inst, err := x86.CMOVWOC(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVWOC: Move if not overflow (OF == 0). -// -// Forms: -// -// CMOVWOC r16 r16 -// CMOVWOC m16 r16 -// Construct and append a CMOVWOC instruction to the active function. -// Operates on the global context. -func CMOVWOC(mr, r operand.Op) { ctx.CMOVWOC(mr, r) } - -// CMOVWOS: Move if overflow (OF == 1). -// -// Forms: -// -// CMOVWOS r16 r16 -// CMOVWOS m16 r16 -// Construct and append a CMOVWOS instruction to the active function. -func (c *Context) CMOVWOS(mr, r operand.Op) { - if inst, err := x86.CMOVWOS(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVWOS: Move if overflow (OF == 1). -// -// Forms: -// -// CMOVWOS r16 r16 -// CMOVWOS m16 r16 -// Construct and append a CMOVWOS instruction to the active function. -// Operates on the global context. -func CMOVWOS(mr, r operand.Op) { ctx.CMOVWOS(mr, r) } - -// CMOVWPC: Move if not parity (PF == 0). -// -// Forms: -// -// CMOVWPC r16 r16 -// CMOVWPC m16 r16 -// Construct and append a CMOVWPC instruction to the active function. -func (c *Context) CMOVWPC(mr, r operand.Op) { - if inst, err := x86.CMOVWPC(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVWPC: Move if not parity (PF == 0). -// -// Forms: -// -// CMOVWPC r16 r16 -// CMOVWPC m16 r16 -// Construct and append a CMOVWPC instruction to the active function. -// Operates on the global context. -func CMOVWPC(mr, r operand.Op) { ctx.CMOVWPC(mr, r) } - -// CMOVWPL: Move if not sign (SF == 0). -// -// Forms: -// -// CMOVWPL r16 r16 -// CMOVWPL m16 r16 -// Construct and append a CMOVWPL instruction to the active function. -func (c *Context) CMOVWPL(mr, r operand.Op) { - if inst, err := x86.CMOVWPL(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVWPL: Move if not sign (SF == 0). -// -// Forms: -// -// CMOVWPL r16 r16 -// CMOVWPL m16 r16 -// Construct and append a CMOVWPL instruction to the active function. -// Operates on the global context. -func CMOVWPL(mr, r operand.Op) { ctx.CMOVWPL(mr, r) } - -// CMOVWPS: Move if parity (PF == 1). -// -// Forms: -// -// CMOVWPS r16 r16 -// CMOVWPS m16 r16 -// Construct and append a CMOVWPS instruction to the active function. -func (c *Context) CMOVWPS(mr, r operand.Op) { - if inst, err := x86.CMOVWPS(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMOVWPS: Move if parity (PF == 1). -// -// Forms: -// -// CMOVWPS r16 r16 -// CMOVWPS m16 r16 -// Construct and append a CMOVWPS instruction to the active function. -// Operates on the global context. -func CMOVWPS(mr, r operand.Op) { ctx.CMOVWPS(mr, r) } - -// CMPB: Compare Two Operands. -// -// Forms: -// -// CMPB al imm8 -// CMPB r8 imm8 -// CMPB r8 r8 -// CMPB r8 m8 -// CMPB m8 imm8 -// CMPB m8 r8 -// Construct and append a CMPB instruction to the active function. -func (c *Context) CMPB(amr, imr operand.Op) { - if inst, err := x86.CMPB(amr, imr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMPB: Compare Two Operands. -// -// Forms: -// -// CMPB al imm8 -// CMPB r8 imm8 -// CMPB r8 r8 -// CMPB r8 m8 -// CMPB m8 imm8 -// CMPB m8 r8 -// Construct and append a CMPB instruction to the active function. -// Operates on the global context. -func CMPB(amr, imr operand.Op) { ctx.CMPB(amr, imr) } - -// CMPL: Compare Two Operands. -// -// Forms: -// -// CMPL eax imm32 -// CMPL r32 imm8 -// CMPL r32 imm32 -// CMPL r32 r32 -// CMPL r32 m32 -// CMPL m32 imm8 -// CMPL m32 imm32 -// CMPL m32 r32 -// Construct and append a CMPL instruction to the active function. -func (c *Context) CMPL(emr, imr operand.Op) { - if inst, err := x86.CMPL(emr, imr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMPL: Compare Two Operands. -// -// Forms: -// -// CMPL eax imm32 -// CMPL r32 imm8 -// CMPL r32 imm32 -// CMPL r32 r32 -// CMPL r32 m32 -// CMPL m32 imm8 -// CMPL m32 imm32 -// CMPL m32 r32 -// Construct and append a CMPL instruction to the active function. -// Operates on the global context. -func CMPL(emr, imr operand.Op) { ctx.CMPL(emr, imr) } - -// CMPPD: Compare Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// CMPPD xmm xmm imm8 -// CMPPD m128 xmm imm8 -// Construct and append a CMPPD instruction to the active function. -func (c *Context) CMPPD(mx, x, i operand.Op) { - if inst, err := x86.CMPPD(mx, x, i); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMPPD: Compare Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// CMPPD xmm xmm imm8 -// CMPPD m128 xmm imm8 -// Construct and append a CMPPD instruction to the active function. -// Operates on the global context. -func CMPPD(mx, x, i operand.Op) { ctx.CMPPD(mx, x, i) } - -// CMPPS: Compare Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// CMPPS xmm xmm imm8 -// CMPPS m128 xmm imm8 -// Construct and append a CMPPS instruction to the active function. -func (c *Context) CMPPS(mx, x, i operand.Op) { - if inst, err := x86.CMPPS(mx, x, i); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMPPS: Compare Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// CMPPS xmm xmm imm8 -// CMPPS m128 xmm imm8 -// Construct and append a CMPPS instruction to the active function. -// Operates on the global context. -func CMPPS(mx, x, i operand.Op) { ctx.CMPPS(mx, x, i) } - -// CMPQ: Compare Two Operands. -// -// Forms: -// -// CMPQ rax imm32 -// CMPQ r64 imm8 -// CMPQ r64 imm32 -// CMPQ r64 r64 -// CMPQ r64 m64 -// CMPQ m64 imm8 -// CMPQ m64 imm32 -// CMPQ m64 r64 -// Construct and append a CMPQ instruction to the active function. -func (c *Context) CMPQ(mr, imr operand.Op) { - if inst, err := x86.CMPQ(mr, imr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMPQ: Compare Two Operands. -// -// Forms: -// -// CMPQ rax imm32 -// CMPQ r64 imm8 -// CMPQ r64 imm32 -// CMPQ r64 r64 -// CMPQ r64 m64 -// CMPQ m64 imm8 -// CMPQ m64 imm32 -// CMPQ m64 r64 -// Construct and append a CMPQ instruction to the active function. -// Operates on the global context. -func CMPQ(mr, imr operand.Op) { ctx.CMPQ(mr, imr) } - -// CMPSD: Compare Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// CMPSD xmm xmm imm8 -// CMPSD m64 xmm imm8 -// Construct and append a CMPSD instruction to the active function. -func (c *Context) CMPSD(mx, x, i operand.Op) { - if inst, err := x86.CMPSD(mx, x, i); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMPSD: Compare Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// CMPSD xmm xmm imm8 -// CMPSD m64 xmm imm8 -// Construct and append a CMPSD instruction to the active function. -// Operates on the global context. -func CMPSD(mx, x, i operand.Op) { ctx.CMPSD(mx, x, i) } - -// CMPSS: Compare Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// CMPSS xmm xmm imm8 -// CMPSS m32 xmm imm8 -// Construct and append a CMPSS instruction to the active function. -func (c *Context) CMPSS(mx, x, i operand.Op) { - if inst, err := x86.CMPSS(mx, x, i); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMPSS: Compare Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// CMPSS xmm xmm imm8 -// CMPSS m32 xmm imm8 -// Construct and append a CMPSS instruction to the active function. -// Operates on the global context. -func CMPSS(mx, x, i operand.Op) { ctx.CMPSS(mx, x, i) } - -// CMPW: Compare Two Operands. -// -// Forms: -// -// CMPW ax imm16 -// CMPW r16 imm8 -// CMPW r16 imm16 -// CMPW r16 r16 -// CMPW r16 m16 -// CMPW m16 imm8 -// CMPW m16 imm16 -// CMPW m16 r16 -// Construct and append a CMPW instruction to the active function. -func (c *Context) CMPW(amr, imr operand.Op) { - if inst, err := x86.CMPW(amr, imr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMPW: Compare Two Operands. -// -// Forms: -// -// CMPW ax imm16 -// CMPW r16 imm8 -// CMPW r16 imm16 -// CMPW r16 r16 -// CMPW r16 m16 -// CMPW m16 imm8 -// CMPW m16 imm16 -// CMPW m16 r16 -// Construct and append a CMPW instruction to the active function. -// Operates on the global context. -func CMPW(amr, imr operand.Op) { ctx.CMPW(amr, imr) } - -// CMPXCHG16B: Compare and Exchange 16 Bytes. -// -// Forms: -// -// CMPXCHG16B m128 -// Construct and append a CMPXCHG16B instruction to the active function. -func (c *Context) CMPXCHG16B(m operand.Op) { - if inst, err := x86.CMPXCHG16B(m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMPXCHG16B: Compare and Exchange 16 Bytes. -// -// Forms: -// -// CMPXCHG16B m128 -// Construct and append a CMPXCHG16B instruction to the active function. -// Operates on the global context. -func CMPXCHG16B(m operand.Op) { ctx.CMPXCHG16B(m) } - -// CMPXCHG8B: Compare and Exchange 8 Bytes. -// -// Forms: -// -// CMPXCHG8B m64 -// Construct and append a CMPXCHG8B instruction to the active function. -func (c *Context) CMPXCHG8B(m operand.Op) { - if inst, err := x86.CMPXCHG8B(m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMPXCHG8B: Compare and Exchange 8 Bytes. -// -// Forms: -// -// CMPXCHG8B m64 -// Construct and append a CMPXCHG8B instruction to the active function. -// Operates on the global context. -func CMPXCHG8B(m operand.Op) { ctx.CMPXCHG8B(m) } - -// CMPXCHGB: Compare and Exchange. -// -// Forms: -// -// CMPXCHGB r8 r8 -// CMPXCHGB r8 m8 -// Construct and append a CMPXCHGB instruction to the active function. -func (c *Context) CMPXCHGB(r, mr operand.Op) { - if inst, err := x86.CMPXCHGB(r, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMPXCHGB: Compare and Exchange. -// -// Forms: -// -// CMPXCHGB r8 r8 -// CMPXCHGB r8 m8 -// Construct and append a CMPXCHGB instruction to the active function. -// Operates on the global context. -func CMPXCHGB(r, mr operand.Op) { ctx.CMPXCHGB(r, mr) } - -// CMPXCHGL: Compare and Exchange. -// -// Forms: -// -// CMPXCHGL r32 r32 -// CMPXCHGL r32 m32 -// Construct and append a CMPXCHGL instruction to the active function. -func (c *Context) CMPXCHGL(r, mr operand.Op) { - if inst, err := x86.CMPXCHGL(r, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMPXCHGL: Compare and Exchange. -// -// Forms: -// -// CMPXCHGL r32 r32 -// CMPXCHGL r32 m32 -// Construct and append a CMPXCHGL instruction to the active function. -// Operates on the global context. -func CMPXCHGL(r, mr operand.Op) { ctx.CMPXCHGL(r, mr) } - -// CMPXCHGQ: Compare and Exchange. -// -// Forms: -// -// CMPXCHGQ r64 r64 -// CMPXCHGQ r64 m64 -// Construct and append a CMPXCHGQ instruction to the active function. -func (c *Context) CMPXCHGQ(r, mr operand.Op) { - if inst, err := x86.CMPXCHGQ(r, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMPXCHGQ: Compare and Exchange. -// -// Forms: -// -// CMPXCHGQ r64 r64 -// CMPXCHGQ r64 m64 -// Construct and append a CMPXCHGQ instruction to the active function. -// Operates on the global context. -func CMPXCHGQ(r, mr operand.Op) { ctx.CMPXCHGQ(r, mr) } - -// CMPXCHGW: Compare and Exchange. -// -// Forms: -// -// CMPXCHGW r16 r16 -// CMPXCHGW r16 m16 -// Construct and append a CMPXCHGW instruction to the active function. -func (c *Context) CMPXCHGW(r, mr operand.Op) { - if inst, err := x86.CMPXCHGW(r, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CMPXCHGW: Compare and Exchange. -// -// Forms: -// -// CMPXCHGW r16 r16 -// CMPXCHGW r16 m16 -// Construct and append a CMPXCHGW instruction to the active function. -// Operates on the global context. -func CMPXCHGW(r, mr operand.Op) { ctx.CMPXCHGW(r, mr) } - -// COMISD: Compare Scalar Ordered Double-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// COMISD xmm xmm -// COMISD m64 xmm -// Construct and append a COMISD instruction to the active function. -func (c *Context) COMISD(mx, x operand.Op) { - if inst, err := x86.COMISD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// COMISD: Compare Scalar Ordered Double-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// COMISD xmm xmm -// COMISD m64 xmm -// Construct and append a COMISD instruction to the active function. -// Operates on the global context. -func COMISD(mx, x operand.Op) { ctx.COMISD(mx, x) } - -// COMISS: Compare Scalar Ordered Single-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// COMISS xmm xmm -// COMISS m32 xmm -// Construct and append a COMISS instruction to the active function. -func (c *Context) COMISS(mx, x operand.Op) { - if inst, err := x86.COMISS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// COMISS: Compare Scalar Ordered Single-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// COMISS xmm xmm -// COMISS m32 xmm -// Construct and append a COMISS instruction to the active function. -// Operates on the global context. -func COMISS(mx, x operand.Op) { ctx.COMISS(mx, x) } - -// CPUID: CPU Identification. -// -// Forms: -// -// CPUID -// Construct and append a CPUID instruction to the active function. -func (c *Context) CPUID() { - if inst, err := x86.CPUID(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CPUID: CPU Identification. -// -// Forms: -// -// CPUID -// Construct and append a CPUID instruction to the active function. -// Operates on the global context. -func CPUID() { ctx.CPUID() } - -// CQO: Convert Quadword to Octaword. -// -// Forms: -// -// CQO -// Construct and append a CQO instruction to the active function. -func (c *Context) CQO() { - if inst, err := x86.CQO(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CQO: Convert Quadword to Octaword. -// -// Forms: -// -// CQO -// Construct and append a CQO instruction to the active function. -// Operates on the global context. -func CQO() { ctx.CQO() } - -// CRC32B: Accumulate CRC32 Value. -// -// Forms: -// -// CRC32B r8 r32 -// CRC32B m8 r32 -// CRC32B r8 r64 -// CRC32B m8 r64 -// Construct and append a CRC32B instruction to the active function. -func (c *Context) CRC32B(mr, r operand.Op) { - if inst, err := x86.CRC32B(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CRC32B: Accumulate CRC32 Value. -// -// Forms: -// -// CRC32B r8 r32 -// CRC32B m8 r32 -// CRC32B r8 r64 -// CRC32B m8 r64 -// Construct and append a CRC32B instruction to the active function. -// Operates on the global context. -func CRC32B(mr, r operand.Op) { ctx.CRC32B(mr, r) } - -// CRC32L: Accumulate CRC32 Value. -// -// Forms: -// -// CRC32L r32 r32 -// CRC32L m32 r32 -// Construct and append a CRC32L instruction to the active function. -func (c *Context) CRC32L(mr, r operand.Op) { - if inst, err := x86.CRC32L(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CRC32L: Accumulate CRC32 Value. -// -// Forms: -// -// CRC32L r32 r32 -// CRC32L m32 r32 -// Construct and append a CRC32L instruction to the active function. -// Operates on the global context. -func CRC32L(mr, r operand.Op) { ctx.CRC32L(mr, r) } - -// CRC32Q: Accumulate CRC32 Value. -// -// Forms: -// -// CRC32Q r64 r64 -// CRC32Q m64 r64 -// Construct and append a CRC32Q instruction to the active function. -func (c *Context) CRC32Q(mr, r operand.Op) { - if inst, err := x86.CRC32Q(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CRC32Q: Accumulate CRC32 Value. -// -// Forms: -// -// CRC32Q r64 r64 -// CRC32Q m64 r64 -// Construct and append a CRC32Q instruction to the active function. -// Operates on the global context. -func CRC32Q(mr, r operand.Op) { ctx.CRC32Q(mr, r) } - -// CRC32W: Accumulate CRC32 Value. -// -// Forms: -// -// CRC32W r16 r32 -// CRC32W m16 r32 -// Construct and append a CRC32W instruction to the active function. -func (c *Context) CRC32W(mr, r operand.Op) { - if inst, err := x86.CRC32W(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CRC32W: Accumulate CRC32 Value. -// -// Forms: -// -// CRC32W r16 r32 -// CRC32W m16 r32 -// Construct and append a CRC32W instruction to the active function. -// Operates on the global context. -func CRC32W(mr, r operand.Op) { ctx.CRC32W(mr, r) } - -// CVTPD2PL: Convert Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// CVTPD2PL xmm xmm -// CVTPD2PL m128 xmm -// Construct and append a CVTPD2PL instruction to the active function. -func (c *Context) CVTPD2PL(mx, x operand.Op) { - if inst, err := x86.CVTPD2PL(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTPD2PL: Convert Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// CVTPD2PL xmm xmm -// CVTPD2PL m128 xmm -// Construct and append a CVTPD2PL instruction to the active function. -// Operates on the global context. -func CVTPD2PL(mx, x operand.Op) { ctx.CVTPD2PL(mx, x) } - -// CVTPD2PS: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. -// -// Forms: -// -// CVTPD2PS xmm xmm -// CVTPD2PS m128 xmm -// Construct and append a CVTPD2PS instruction to the active function. -func (c *Context) CVTPD2PS(mx, x operand.Op) { - if inst, err := x86.CVTPD2PS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTPD2PS: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. -// -// Forms: -// -// CVTPD2PS xmm xmm -// CVTPD2PS m128 xmm -// Construct and append a CVTPD2PS instruction to the active function. -// Operates on the global context. -func CVTPD2PS(mx, x operand.Op) { ctx.CVTPD2PS(mx, x) } - -// CVTPL2PD: Convert Packed Dword Integers to Packed Double-Precision FP Values. -// -// Forms: -// -// CVTPL2PD xmm xmm -// CVTPL2PD m64 xmm -// Construct and append a CVTPL2PD instruction to the active function. -func (c *Context) CVTPL2PD(mx, x operand.Op) { - if inst, err := x86.CVTPL2PD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTPL2PD: Convert Packed Dword Integers to Packed Double-Precision FP Values. -// -// Forms: -// -// CVTPL2PD xmm xmm -// CVTPL2PD m64 xmm -// Construct and append a CVTPL2PD instruction to the active function. -// Operates on the global context. -func CVTPL2PD(mx, x operand.Op) { ctx.CVTPL2PD(mx, x) } - -// CVTPL2PS: Convert Packed Dword Integers to Packed Single-Precision FP Values. -// -// Forms: -// -// CVTPL2PS xmm xmm -// CVTPL2PS m128 xmm -// Construct and append a CVTPL2PS instruction to the active function. -func (c *Context) CVTPL2PS(mx, x operand.Op) { - if inst, err := x86.CVTPL2PS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTPL2PS: Convert Packed Dword Integers to Packed Single-Precision FP Values. -// -// Forms: -// -// CVTPL2PS xmm xmm -// CVTPL2PS m128 xmm -// Construct and append a CVTPL2PS instruction to the active function. -// Operates on the global context. -func CVTPL2PS(mx, x operand.Op) { ctx.CVTPL2PS(mx, x) } - -// CVTPS2PD: Convert Packed Single-Precision FP Values to Packed Double-Precision FP Values. -// -// Forms: -// -// CVTPS2PD xmm xmm -// CVTPS2PD m64 xmm -// Construct and append a CVTPS2PD instruction to the active function. -func (c *Context) CVTPS2PD(mx, x operand.Op) { - if inst, err := x86.CVTPS2PD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTPS2PD: Convert Packed Single-Precision FP Values to Packed Double-Precision FP Values. -// -// Forms: -// -// CVTPS2PD xmm xmm -// CVTPS2PD m64 xmm -// Construct and append a CVTPS2PD instruction to the active function. -// Operates on the global context. -func CVTPS2PD(mx, x operand.Op) { ctx.CVTPS2PD(mx, x) } - -// CVTPS2PL: Convert Packed Single-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// CVTPS2PL xmm xmm -// CVTPS2PL m128 xmm -// Construct and append a CVTPS2PL instruction to the active function. -func (c *Context) CVTPS2PL(mx, x operand.Op) { - if inst, err := x86.CVTPS2PL(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTPS2PL: Convert Packed Single-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// CVTPS2PL xmm xmm -// CVTPS2PL m128 xmm -// Construct and append a CVTPS2PL instruction to the active function. -// Operates on the global context. -func CVTPS2PL(mx, x operand.Op) { ctx.CVTPS2PL(mx, x) } - -// CVTSD2SL: Convert Scalar Double-Precision FP Value to Integer. -// -// Forms: -// -// CVTSD2SL xmm r32 -// CVTSD2SL m64 r32 -// CVTSD2SL xmm r64 -// CVTSD2SL m64 r64 -// Construct and append a CVTSD2SL instruction to the active function. -func (c *Context) CVTSD2SL(mx, r operand.Op) { - if inst, err := x86.CVTSD2SL(mx, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTSD2SL: Convert Scalar Double-Precision FP Value to Integer. -// -// Forms: -// -// CVTSD2SL xmm r32 -// CVTSD2SL m64 r32 -// CVTSD2SL xmm r64 -// CVTSD2SL m64 r64 -// Construct and append a CVTSD2SL instruction to the active function. -// Operates on the global context. -func CVTSD2SL(mx, r operand.Op) { ctx.CVTSD2SL(mx, r) } - -// CVTSD2SS: Convert Scalar Double-Precision FP Value to Scalar Single-Precision FP Value. -// -// Forms: -// -// CVTSD2SS xmm xmm -// CVTSD2SS m64 xmm -// Construct and append a CVTSD2SS instruction to the active function. -func (c *Context) CVTSD2SS(mx, x operand.Op) { - if inst, err := x86.CVTSD2SS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTSD2SS: Convert Scalar Double-Precision FP Value to Scalar Single-Precision FP Value. -// -// Forms: -// -// CVTSD2SS xmm xmm -// CVTSD2SS m64 xmm -// Construct and append a CVTSD2SS instruction to the active function. -// Operates on the global context. -func CVTSD2SS(mx, x operand.Op) { ctx.CVTSD2SS(mx, x) } - -// CVTSL2SD: Convert Dword Integer to Scalar Double-Precision FP Value. -// -// Forms: -// -// CVTSL2SD r32 xmm -// CVTSL2SD m32 xmm -// Construct and append a CVTSL2SD instruction to the active function. -func (c *Context) CVTSL2SD(mr, x operand.Op) { - if inst, err := x86.CVTSL2SD(mr, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTSL2SD: Convert Dword Integer to Scalar Double-Precision FP Value. -// -// Forms: -// -// CVTSL2SD r32 xmm -// CVTSL2SD m32 xmm -// Construct and append a CVTSL2SD instruction to the active function. -// Operates on the global context. -func CVTSL2SD(mr, x operand.Op) { ctx.CVTSL2SD(mr, x) } - -// CVTSL2SS: Convert Dword Integer to Scalar Single-Precision FP Value. -// -// Forms: -// -// CVTSL2SS r32 xmm -// CVTSL2SS m32 xmm -// Construct and append a CVTSL2SS instruction to the active function. -func (c *Context) CVTSL2SS(mr, x operand.Op) { - if inst, err := x86.CVTSL2SS(mr, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTSL2SS: Convert Dword Integer to Scalar Single-Precision FP Value. -// -// Forms: -// -// CVTSL2SS r32 xmm -// CVTSL2SS m32 xmm -// Construct and append a CVTSL2SS instruction to the active function. -// Operates on the global context. -func CVTSL2SS(mr, x operand.Op) { ctx.CVTSL2SS(mr, x) } - -// CVTSQ2SD: Convert Dword Integer to Scalar Double-Precision FP Value. -// -// Forms: -// -// CVTSQ2SD r64 xmm -// CVTSQ2SD m64 xmm -// Construct and append a CVTSQ2SD instruction to the active function. -func (c *Context) CVTSQ2SD(mr, x operand.Op) { - if inst, err := x86.CVTSQ2SD(mr, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTSQ2SD: Convert Dword Integer to Scalar Double-Precision FP Value. -// -// Forms: -// -// CVTSQ2SD r64 xmm -// CVTSQ2SD m64 xmm -// Construct and append a CVTSQ2SD instruction to the active function. -// Operates on the global context. -func CVTSQ2SD(mr, x operand.Op) { ctx.CVTSQ2SD(mr, x) } - -// CVTSQ2SS: Convert Dword Integer to Scalar Single-Precision FP Value. -// -// Forms: -// -// CVTSQ2SS r64 xmm -// CVTSQ2SS m64 xmm -// Construct and append a CVTSQ2SS instruction to the active function. -func (c *Context) CVTSQ2SS(mr, x operand.Op) { - if inst, err := x86.CVTSQ2SS(mr, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTSQ2SS: Convert Dword Integer to Scalar Single-Precision FP Value. -// -// Forms: -// -// CVTSQ2SS r64 xmm -// CVTSQ2SS m64 xmm -// Construct and append a CVTSQ2SS instruction to the active function. -// Operates on the global context. -func CVTSQ2SS(mr, x operand.Op) { ctx.CVTSQ2SS(mr, x) } - -// CVTSS2SD: Convert Scalar Single-Precision FP Value to Scalar Double-Precision FP Value. -// -// Forms: -// -// CVTSS2SD xmm xmm -// CVTSS2SD m32 xmm -// Construct and append a CVTSS2SD instruction to the active function. -func (c *Context) CVTSS2SD(mx, x operand.Op) { - if inst, err := x86.CVTSS2SD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTSS2SD: Convert Scalar Single-Precision FP Value to Scalar Double-Precision FP Value. -// -// Forms: -// -// CVTSS2SD xmm xmm -// CVTSS2SD m32 xmm -// Construct and append a CVTSS2SD instruction to the active function. -// Operates on the global context. -func CVTSS2SD(mx, x operand.Op) { ctx.CVTSS2SD(mx, x) } - -// CVTSS2SL: Convert Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// CVTSS2SL xmm r32 -// CVTSS2SL m32 r32 -// CVTSS2SL xmm r64 -// CVTSS2SL m32 r64 -// Construct and append a CVTSS2SL instruction to the active function. -func (c *Context) CVTSS2SL(mx, r operand.Op) { - if inst, err := x86.CVTSS2SL(mx, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTSS2SL: Convert Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// CVTSS2SL xmm r32 -// CVTSS2SL m32 r32 -// CVTSS2SL xmm r64 -// CVTSS2SL m32 r64 -// Construct and append a CVTSS2SL instruction to the active function. -// Operates on the global context. -func CVTSS2SL(mx, r operand.Op) { ctx.CVTSS2SL(mx, r) } - -// CVTTPD2PL: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// CVTTPD2PL xmm xmm -// CVTTPD2PL m128 xmm -// Construct and append a CVTTPD2PL instruction to the active function. -func (c *Context) CVTTPD2PL(mx, x operand.Op) { - if inst, err := x86.CVTTPD2PL(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTTPD2PL: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// CVTTPD2PL xmm xmm -// CVTTPD2PL m128 xmm -// Construct and append a CVTTPD2PL instruction to the active function. -// Operates on the global context. -func CVTTPD2PL(mx, x operand.Op) { ctx.CVTTPD2PL(mx, x) } - -// CVTTPS2PL: Convert with Truncation Packed Single-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// CVTTPS2PL xmm xmm -// CVTTPS2PL m128 xmm -// Construct and append a CVTTPS2PL instruction to the active function. -func (c *Context) CVTTPS2PL(mx, x operand.Op) { - if inst, err := x86.CVTTPS2PL(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTTPS2PL: Convert with Truncation Packed Single-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// CVTTPS2PL xmm xmm -// CVTTPS2PL m128 xmm -// Construct and append a CVTTPS2PL instruction to the active function. -// Operates on the global context. -func CVTTPS2PL(mx, x operand.Op) { ctx.CVTTPS2PL(mx, x) } - -// CVTTSD2SL: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. -// -// Forms: -// -// CVTTSD2SL xmm r32 -// CVTTSD2SL m64 r32 -// Construct and append a CVTTSD2SL instruction to the active function. -func (c *Context) CVTTSD2SL(mx, r operand.Op) { - if inst, err := x86.CVTTSD2SL(mx, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTTSD2SL: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. -// -// Forms: -// -// CVTTSD2SL xmm r32 -// CVTTSD2SL m64 r32 -// Construct and append a CVTTSD2SL instruction to the active function. -// Operates on the global context. -func CVTTSD2SL(mx, r operand.Op) { ctx.CVTTSD2SL(mx, r) } - -// CVTTSD2SQ: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. -// -// Forms: -// -// CVTTSD2SQ xmm r64 -// CVTTSD2SQ m64 r64 -// Construct and append a CVTTSD2SQ instruction to the active function. -func (c *Context) CVTTSD2SQ(mx, r operand.Op) { - if inst, err := x86.CVTTSD2SQ(mx, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTTSD2SQ: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. -// -// Forms: -// -// CVTTSD2SQ xmm r64 -// CVTTSD2SQ m64 r64 -// Construct and append a CVTTSD2SQ instruction to the active function. -// Operates on the global context. -func CVTTSD2SQ(mx, r operand.Op) { ctx.CVTTSD2SQ(mx, r) } - -// CVTTSS2SL: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// CVTTSS2SL xmm r32 -// CVTTSS2SL m32 r32 -// CVTTSS2SL xmm r64 -// CVTTSS2SL m32 r64 -// Construct and append a CVTTSS2SL instruction to the active function. -func (c *Context) CVTTSS2SL(mx, r operand.Op) { - if inst, err := x86.CVTTSS2SL(mx, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CVTTSS2SL: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// CVTTSS2SL xmm r32 -// CVTTSS2SL m32 r32 -// CVTTSS2SL xmm r64 -// CVTTSS2SL m32 r64 -// Construct and append a CVTTSS2SL instruction to the active function. -// Operates on the global context. -func CVTTSS2SL(mx, r operand.Op) { ctx.CVTTSS2SL(mx, r) } - -// CWD: Convert Word to Doubleword. -// -// Forms: -// -// CWD -// Construct and append a CWD instruction to the active function. -func (c *Context) CWD() { - if inst, err := x86.CWD(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CWD: Convert Word to Doubleword. -// -// Forms: -// -// CWD -// Construct and append a CWD instruction to the active function. -// Operates on the global context. -func CWD() { ctx.CWD() } - -// CWDE: Convert Word to Doubleword. -// -// Forms: -// -// CWDE -// Construct and append a CWDE instruction to the active function. -func (c *Context) CWDE() { - if inst, err := x86.CWDE(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// CWDE: Convert Word to Doubleword. -// -// Forms: -// -// CWDE -// Construct and append a CWDE instruction to the active function. -// Operates on the global context. -func CWDE() { ctx.CWDE() } - -// DECB: Decrement by 1. -// -// Forms: -// -// DECB r8 -// DECB m8 -// Construct and append a DECB instruction to the active function. -func (c *Context) DECB(mr operand.Op) { - if inst, err := x86.DECB(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// DECB: Decrement by 1. -// -// Forms: -// -// DECB r8 -// DECB m8 -// Construct and append a DECB instruction to the active function. -// Operates on the global context. -func DECB(mr operand.Op) { ctx.DECB(mr) } - -// DECL: Decrement by 1. -// -// Forms: -// -// DECL r32 -// DECL m32 -// Construct and append a DECL instruction to the active function. -func (c *Context) DECL(mr operand.Op) { - if inst, err := x86.DECL(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// DECL: Decrement by 1. -// -// Forms: -// -// DECL r32 -// DECL m32 -// Construct and append a DECL instruction to the active function. -// Operates on the global context. -func DECL(mr operand.Op) { ctx.DECL(mr) } - -// DECQ: Decrement by 1. -// -// Forms: -// -// DECQ r64 -// DECQ m64 -// Construct and append a DECQ instruction to the active function. -func (c *Context) DECQ(mr operand.Op) { - if inst, err := x86.DECQ(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// DECQ: Decrement by 1. -// -// Forms: -// -// DECQ r64 -// DECQ m64 -// Construct and append a DECQ instruction to the active function. -// Operates on the global context. -func DECQ(mr operand.Op) { ctx.DECQ(mr) } - -// DECW: Decrement by 1. -// -// Forms: -// -// DECW r16 -// DECW m16 -// Construct and append a DECW instruction to the active function. -func (c *Context) DECW(mr operand.Op) { - if inst, err := x86.DECW(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// DECW: Decrement by 1. -// -// Forms: -// -// DECW r16 -// DECW m16 -// Construct and append a DECW instruction to the active function. -// Operates on the global context. -func DECW(mr operand.Op) { ctx.DECW(mr) } - -// DIVB: Unsigned Divide. -// -// Forms: -// -// DIVB r8 -// DIVB m8 -// Construct and append a DIVB instruction to the active function. -func (c *Context) DIVB(mr operand.Op) { - if inst, err := x86.DIVB(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// DIVB: Unsigned Divide. -// -// Forms: -// -// DIVB r8 -// DIVB m8 -// Construct and append a DIVB instruction to the active function. -// Operates on the global context. -func DIVB(mr operand.Op) { ctx.DIVB(mr) } - -// DIVL: Unsigned Divide. -// -// Forms: -// -// DIVL r32 -// DIVL m32 -// Construct and append a DIVL instruction to the active function. -func (c *Context) DIVL(mr operand.Op) { - if inst, err := x86.DIVL(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// DIVL: Unsigned Divide. -// -// Forms: -// -// DIVL r32 -// DIVL m32 -// Construct and append a DIVL instruction to the active function. -// Operates on the global context. -func DIVL(mr operand.Op) { ctx.DIVL(mr) } - -// DIVPD: Divide Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// DIVPD xmm xmm -// DIVPD m128 xmm -// Construct and append a DIVPD instruction to the active function. -func (c *Context) DIVPD(mx, x operand.Op) { - if inst, err := x86.DIVPD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// DIVPD: Divide Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// DIVPD xmm xmm -// DIVPD m128 xmm -// Construct and append a DIVPD instruction to the active function. -// Operates on the global context. -func DIVPD(mx, x operand.Op) { ctx.DIVPD(mx, x) } - -// DIVPS: Divide Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// DIVPS xmm xmm -// DIVPS m128 xmm -// Construct and append a DIVPS instruction to the active function. -func (c *Context) DIVPS(mx, x operand.Op) { - if inst, err := x86.DIVPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// DIVPS: Divide Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// DIVPS xmm xmm -// DIVPS m128 xmm -// Construct and append a DIVPS instruction to the active function. -// Operates on the global context. -func DIVPS(mx, x operand.Op) { ctx.DIVPS(mx, x) } - -// DIVQ: Unsigned Divide. -// -// Forms: -// -// DIVQ r64 -// DIVQ m64 -// Construct and append a DIVQ instruction to the active function. -func (c *Context) DIVQ(mr operand.Op) { - if inst, err := x86.DIVQ(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// DIVQ: Unsigned Divide. -// -// Forms: -// -// DIVQ r64 -// DIVQ m64 -// Construct and append a DIVQ instruction to the active function. -// Operates on the global context. -func DIVQ(mr operand.Op) { ctx.DIVQ(mr) } - -// DIVSD: Divide Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// DIVSD xmm xmm -// DIVSD m64 xmm -// Construct and append a DIVSD instruction to the active function. -func (c *Context) DIVSD(mx, x operand.Op) { - if inst, err := x86.DIVSD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// DIVSD: Divide Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// DIVSD xmm xmm -// DIVSD m64 xmm -// Construct and append a DIVSD instruction to the active function. -// Operates on the global context. -func DIVSD(mx, x operand.Op) { ctx.DIVSD(mx, x) } - -// DIVSS: Divide Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// DIVSS xmm xmm -// DIVSS m32 xmm -// Construct and append a DIVSS instruction to the active function. -func (c *Context) DIVSS(mx, x operand.Op) { - if inst, err := x86.DIVSS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// DIVSS: Divide Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// DIVSS xmm xmm -// DIVSS m32 xmm -// Construct and append a DIVSS instruction to the active function. -// Operates on the global context. -func DIVSS(mx, x operand.Op) { ctx.DIVSS(mx, x) } - -// DIVW: Unsigned Divide. -// -// Forms: -// -// DIVW r16 -// DIVW m16 -// Construct and append a DIVW instruction to the active function. -func (c *Context) DIVW(mr operand.Op) { - if inst, err := x86.DIVW(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// DIVW: Unsigned Divide. -// -// Forms: -// -// DIVW r16 -// DIVW m16 -// Construct and append a DIVW instruction to the active function. -// Operates on the global context. -func DIVW(mr operand.Op) { ctx.DIVW(mr) } - -// DPPD: Dot Product of Packed Double Precision Floating-Point Values. -// -// Forms: -// -// DPPD imm8 xmm xmm -// DPPD imm8 m128 xmm -// Construct and append a DPPD instruction to the active function. -func (c *Context) DPPD(i, mx, x operand.Op) { - if inst, err := x86.DPPD(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// DPPD: Dot Product of Packed Double Precision Floating-Point Values. -// -// Forms: -// -// DPPD imm8 xmm xmm -// DPPD imm8 m128 xmm -// Construct and append a DPPD instruction to the active function. -// Operates on the global context. -func DPPD(i, mx, x operand.Op) { ctx.DPPD(i, mx, x) } - -// DPPS: Dot Product of Packed Single Precision Floating-Point Values. -// -// Forms: -// -// DPPS imm8 xmm xmm -// DPPS imm8 m128 xmm -// Construct and append a DPPS instruction to the active function. -func (c *Context) DPPS(i, mx, x operand.Op) { - if inst, err := x86.DPPS(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// DPPS: Dot Product of Packed Single Precision Floating-Point Values. -// -// Forms: -// -// DPPS imm8 xmm xmm -// DPPS imm8 m128 xmm -// Construct and append a DPPS instruction to the active function. -// Operates on the global context. -func DPPS(i, mx, x operand.Op) { ctx.DPPS(i, mx, x) } - -// EXTRACTPS: Extract Packed Single Precision Floating-Point Value. -// -// Forms: -// -// EXTRACTPS imm2u xmm r32 -// EXTRACTPS imm2u xmm m32 -// Construct and append a EXTRACTPS instruction to the active function. -func (c *Context) EXTRACTPS(i, x, mr operand.Op) { - if inst, err := x86.EXTRACTPS(i, x, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// EXTRACTPS: Extract Packed Single Precision Floating-Point Value. -// -// Forms: -// -// EXTRACTPS imm2u xmm r32 -// EXTRACTPS imm2u xmm m32 -// Construct and append a EXTRACTPS instruction to the active function. -// Operates on the global context. -func EXTRACTPS(i, x, mr operand.Op) { ctx.EXTRACTPS(i, x, mr) } - -// HADDPD: Packed Double-FP Horizontal Add. -// -// Forms: -// -// HADDPD xmm xmm -// HADDPD m128 xmm -// Construct and append a HADDPD instruction to the active function. -func (c *Context) HADDPD(mx, x operand.Op) { - if inst, err := x86.HADDPD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// HADDPD: Packed Double-FP Horizontal Add. -// -// Forms: -// -// HADDPD xmm xmm -// HADDPD m128 xmm -// Construct and append a HADDPD instruction to the active function. -// Operates on the global context. -func HADDPD(mx, x operand.Op) { ctx.HADDPD(mx, x) } - -// HADDPS: Packed Single-FP Horizontal Add. -// -// Forms: -// -// HADDPS xmm xmm -// HADDPS m128 xmm -// Construct and append a HADDPS instruction to the active function. -func (c *Context) HADDPS(mx, x operand.Op) { - if inst, err := x86.HADDPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// HADDPS: Packed Single-FP Horizontal Add. -// -// Forms: -// -// HADDPS xmm xmm -// HADDPS m128 xmm -// Construct and append a HADDPS instruction to the active function. -// Operates on the global context. -func HADDPS(mx, x operand.Op) { ctx.HADDPS(mx, x) } - -// HSUBPD: Packed Double-FP Horizontal Subtract. -// -// Forms: -// -// HSUBPD xmm xmm -// HSUBPD m128 xmm -// Construct and append a HSUBPD instruction to the active function. -func (c *Context) HSUBPD(mx, x operand.Op) { - if inst, err := x86.HSUBPD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// HSUBPD: Packed Double-FP Horizontal Subtract. -// -// Forms: -// -// HSUBPD xmm xmm -// HSUBPD m128 xmm -// Construct and append a HSUBPD instruction to the active function. -// Operates on the global context. -func HSUBPD(mx, x operand.Op) { ctx.HSUBPD(mx, x) } - -// HSUBPS: Packed Single-FP Horizontal Subtract. -// -// Forms: -// -// HSUBPS xmm xmm -// HSUBPS m128 xmm -// Construct and append a HSUBPS instruction to the active function. -func (c *Context) HSUBPS(mx, x operand.Op) { - if inst, err := x86.HSUBPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// HSUBPS: Packed Single-FP Horizontal Subtract. -// -// Forms: -// -// HSUBPS xmm xmm -// HSUBPS m128 xmm -// Construct and append a HSUBPS instruction to the active function. -// Operates on the global context. -func HSUBPS(mx, x operand.Op) { ctx.HSUBPS(mx, x) } - -// IDIVB: Signed Divide. -// -// Forms: -// -// IDIVB r8 -// IDIVB m8 -// Construct and append a IDIVB instruction to the active function. -func (c *Context) IDIVB(mr operand.Op) { - if inst, err := x86.IDIVB(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// IDIVB: Signed Divide. -// -// Forms: -// -// IDIVB r8 -// IDIVB m8 -// Construct and append a IDIVB instruction to the active function. -// Operates on the global context. -func IDIVB(mr operand.Op) { ctx.IDIVB(mr) } - -// IDIVL: Signed Divide. -// -// Forms: -// -// IDIVL r32 -// IDIVL m32 -// Construct and append a IDIVL instruction to the active function. -func (c *Context) IDIVL(mr operand.Op) { - if inst, err := x86.IDIVL(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// IDIVL: Signed Divide. -// -// Forms: -// -// IDIVL r32 -// IDIVL m32 -// Construct and append a IDIVL instruction to the active function. -// Operates on the global context. -func IDIVL(mr operand.Op) { ctx.IDIVL(mr) } - -// IDIVQ: Signed Divide. -// -// Forms: -// -// IDIVQ r64 -// IDIVQ m64 -// Construct and append a IDIVQ instruction to the active function. -func (c *Context) IDIVQ(mr operand.Op) { - if inst, err := x86.IDIVQ(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// IDIVQ: Signed Divide. -// -// Forms: -// -// IDIVQ r64 -// IDIVQ m64 -// Construct and append a IDIVQ instruction to the active function. -// Operates on the global context. -func IDIVQ(mr operand.Op) { ctx.IDIVQ(mr) } - -// IDIVW: Signed Divide. -// -// Forms: -// -// IDIVW r16 -// IDIVW m16 -// Construct and append a IDIVW instruction to the active function. -func (c *Context) IDIVW(mr operand.Op) { - if inst, err := x86.IDIVW(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// IDIVW: Signed Divide. -// -// Forms: -// -// IDIVW r16 -// IDIVW m16 -// Construct and append a IDIVW instruction to the active function. -// Operates on the global context. -func IDIVW(mr operand.Op) { ctx.IDIVW(mr) } - -// IMUL3L: Signed Multiply. -// -// Forms: -// -// IMUL3L imm8 r32 r32 -// IMUL3L imm32 r32 r32 -// IMUL3L imm8 m32 r32 -// IMUL3L imm32 m32 r32 -// Construct and append a IMUL3L instruction to the active function. -func (c *Context) IMUL3L(i, mr, r operand.Op) { - if inst, err := x86.IMUL3L(i, mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// IMUL3L: Signed Multiply. -// -// Forms: -// -// IMUL3L imm8 r32 r32 -// IMUL3L imm32 r32 r32 -// IMUL3L imm8 m32 r32 -// IMUL3L imm32 m32 r32 -// Construct and append a IMUL3L instruction to the active function. -// Operates on the global context. -func IMUL3L(i, mr, r operand.Op) { ctx.IMUL3L(i, mr, r) } - -// IMUL3Q: Signed Multiply. -// -// Forms: -// -// IMUL3Q imm8 r64 r64 -// IMUL3Q imm32 r64 r64 -// IMUL3Q imm8 m64 r64 -// IMUL3Q imm32 m64 r64 -// Construct and append a IMUL3Q instruction to the active function. -func (c *Context) IMUL3Q(i, mr, r operand.Op) { - if inst, err := x86.IMUL3Q(i, mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// IMUL3Q: Signed Multiply. -// -// Forms: -// -// IMUL3Q imm8 r64 r64 -// IMUL3Q imm32 r64 r64 -// IMUL3Q imm8 m64 r64 -// IMUL3Q imm32 m64 r64 -// Construct and append a IMUL3Q instruction to the active function. -// Operates on the global context. -func IMUL3Q(i, mr, r operand.Op) { ctx.IMUL3Q(i, mr, r) } - -// IMUL3W: Signed Multiply. -// -// Forms: -// -// IMUL3W imm8 r16 r16 -// IMUL3W imm16 r16 r16 -// IMUL3W imm8 m16 r16 -// IMUL3W imm16 m16 r16 -// Construct and append a IMUL3W instruction to the active function. -func (c *Context) IMUL3W(i, mr, r operand.Op) { - if inst, err := x86.IMUL3W(i, mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// IMUL3W: Signed Multiply. -// -// Forms: -// -// IMUL3W imm8 r16 r16 -// IMUL3W imm16 r16 r16 -// IMUL3W imm8 m16 r16 -// IMUL3W imm16 m16 r16 -// Construct and append a IMUL3W instruction to the active function. -// Operates on the global context. -func IMUL3W(i, mr, r operand.Op) { ctx.IMUL3W(i, mr, r) } - -// IMULB: Signed Multiply. -// -// Forms: -// -// IMULB r8 -// IMULB m8 -// Construct and append a IMULB instruction to the active function. -func (c *Context) IMULB(mr operand.Op) { - if inst, err := x86.IMULB(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// IMULB: Signed Multiply. -// -// Forms: -// -// IMULB r8 -// IMULB m8 -// Construct and append a IMULB instruction to the active function. -// Operates on the global context. -func IMULB(mr operand.Op) { ctx.IMULB(mr) } - -// IMULL: Signed Multiply. -// -// Forms: -// -// IMULL r32 -// IMULL m32 -// IMULL r32 r32 -// IMULL m32 r32 -// Construct and append a IMULL instruction to the active function. -func (c *Context) IMULL(ops ...operand.Op) { - if inst, err := x86.IMULL(ops...); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// IMULL: Signed Multiply. -// -// Forms: -// -// IMULL r32 -// IMULL m32 -// IMULL r32 r32 -// IMULL m32 r32 -// Construct and append a IMULL instruction to the active function. -// Operates on the global context. -func IMULL(ops ...operand.Op) { ctx.IMULL(ops...) } - -// IMULQ: Signed Multiply. -// -// Forms: -// -// IMULQ r64 -// IMULQ m64 -// IMULQ r64 r64 -// IMULQ m64 r64 -// Construct and append a IMULQ instruction to the active function. -func (c *Context) IMULQ(ops ...operand.Op) { - if inst, err := x86.IMULQ(ops...); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// IMULQ: Signed Multiply. -// -// Forms: -// -// IMULQ r64 -// IMULQ m64 -// IMULQ r64 r64 -// IMULQ m64 r64 -// Construct and append a IMULQ instruction to the active function. -// Operates on the global context. -func IMULQ(ops ...operand.Op) { ctx.IMULQ(ops...) } - -// IMULW: Signed Multiply. -// -// Forms: -// -// IMULW r16 -// IMULW m16 -// IMULW r16 r16 -// IMULW m16 r16 -// Construct and append a IMULW instruction to the active function. -func (c *Context) IMULW(ops ...operand.Op) { - if inst, err := x86.IMULW(ops...); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// IMULW: Signed Multiply. -// -// Forms: -// -// IMULW r16 -// IMULW m16 -// IMULW r16 r16 -// IMULW m16 r16 -// Construct and append a IMULW instruction to the active function. -// Operates on the global context. -func IMULW(ops ...operand.Op) { ctx.IMULW(ops...) } - -// INCB: Increment by 1. -// -// Forms: -// -// INCB r8 -// INCB m8 -// Construct and append a INCB instruction to the active function. -func (c *Context) INCB(mr operand.Op) { - if inst, err := x86.INCB(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// INCB: Increment by 1. -// -// Forms: -// -// INCB r8 -// INCB m8 -// Construct and append a INCB instruction to the active function. -// Operates on the global context. -func INCB(mr operand.Op) { ctx.INCB(mr) } - -// INCL: Increment by 1. -// -// Forms: -// -// INCL r32 -// INCL m32 -// Construct and append a INCL instruction to the active function. -func (c *Context) INCL(mr operand.Op) { - if inst, err := x86.INCL(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// INCL: Increment by 1. -// -// Forms: -// -// INCL r32 -// INCL m32 -// Construct and append a INCL instruction to the active function. -// Operates on the global context. -func INCL(mr operand.Op) { ctx.INCL(mr) } - -// INCQ: Increment by 1. -// -// Forms: -// -// INCQ r64 -// INCQ m64 -// Construct and append a INCQ instruction to the active function. -func (c *Context) INCQ(mr operand.Op) { - if inst, err := x86.INCQ(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// INCQ: Increment by 1. -// -// Forms: -// -// INCQ r64 -// INCQ m64 -// Construct and append a INCQ instruction to the active function. -// Operates on the global context. -func INCQ(mr operand.Op) { ctx.INCQ(mr) } - -// INCW: Increment by 1. -// -// Forms: -// -// INCW r16 -// INCW m16 -// Construct and append a INCW instruction to the active function. -func (c *Context) INCW(mr operand.Op) { - if inst, err := x86.INCW(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// INCW: Increment by 1. -// -// Forms: -// -// INCW r16 -// INCW m16 -// Construct and append a INCW instruction to the active function. -// Operates on the global context. -func INCW(mr operand.Op) { ctx.INCW(mr) } - -// INSERTPS: Insert Packed Single Precision Floating-Point Value. -// -// Forms: -// -// INSERTPS imm8 xmm xmm -// INSERTPS imm8 m32 xmm -// Construct and append a INSERTPS instruction to the active function. -func (c *Context) INSERTPS(i, mx, x operand.Op) { - if inst, err := x86.INSERTPS(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// INSERTPS: Insert Packed Single Precision Floating-Point Value. -// -// Forms: -// -// INSERTPS imm8 xmm xmm -// INSERTPS imm8 m32 xmm -// Construct and append a INSERTPS instruction to the active function. -// Operates on the global context. -func INSERTPS(i, mx, x operand.Op) { ctx.INSERTPS(i, mx, x) } - -// INT: Call to Interrupt Procedure. -// -// Forms: -// -// INT 3 -// INT imm8 -// Construct and append a INT instruction to the active function. -func (c *Context) INT(i operand.Op) { - if inst, err := x86.INT(i); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// INT: Call to Interrupt Procedure. -// -// Forms: -// -// INT 3 -// INT imm8 -// Construct and append a INT instruction to the active function. -// Operates on the global context. -func INT(i operand.Op) { ctx.INT(i) } - -// JA: Jump if above (CF == 0 and ZF == 0). -// -// Forms: -// -// JA rel8 -// JA rel32 -// Construct and append a JA instruction to the active function. -func (c *Context) JA(r operand.Op) { - if inst, err := x86.JA(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JA: Jump if above (CF == 0 and ZF == 0). -// -// Forms: -// -// JA rel8 -// JA rel32 -// Construct and append a JA instruction to the active function. -// Operates on the global context. -func JA(r operand.Op) { ctx.JA(r) } - -// JAE: Jump if above or equal (CF == 0). -// -// Forms: -// -// JAE rel8 -// JAE rel32 -// Construct and append a JAE instruction to the active function. -func (c *Context) JAE(r operand.Op) { - if inst, err := x86.JAE(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JAE: Jump if above or equal (CF == 0). -// -// Forms: -// -// JAE rel8 -// JAE rel32 -// Construct and append a JAE instruction to the active function. -// Operates on the global context. -func JAE(r operand.Op) { ctx.JAE(r) } - -// JB: Jump if below (CF == 1). -// -// Forms: -// -// JB rel8 -// JB rel32 -// Construct and append a JB instruction to the active function. -func (c *Context) JB(r operand.Op) { - if inst, err := x86.JB(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JB: Jump if below (CF == 1). -// -// Forms: -// -// JB rel8 -// JB rel32 -// Construct and append a JB instruction to the active function. -// Operates on the global context. -func JB(r operand.Op) { ctx.JB(r) } - -// JBE: Jump if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// JBE rel8 -// JBE rel32 -// Construct and append a JBE instruction to the active function. -func (c *Context) JBE(r operand.Op) { - if inst, err := x86.JBE(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JBE: Jump if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// JBE rel8 -// JBE rel32 -// Construct and append a JBE instruction to the active function. -// Operates on the global context. -func JBE(r operand.Op) { ctx.JBE(r) } - -// JC: Jump if below (CF == 1). -// -// Forms: -// -// JC rel8 -// JC rel32 -// Construct and append a JC instruction to the active function. -func (c *Context) JC(r operand.Op) { - if inst, err := x86.JC(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JC: Jump if below (CF == 1). -// -// Forms: -// -// JC rel8 -// JC rel32 -// Construct and append a JC instruction to the active function. -// Operates on the global context. -func JC(r operand.Op) { ctx.JC(r) } - -// JCC: Jump if above or equal (CF == 0). -// -// Forms: -// -// JCC rel8 -// JCC rel32 -// Construct and append a JCC instruction to the active function. -func (c *Context) JCC(r operand.Op) { - if inst, err := x86.JCC(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JCC: Jump if above or equal (CF == 0). -// -// Forms: -// -// JCC rel8 -// JCC rel32 -// Construct and append a JCC instruction to the active function. -// Operates on the global context. -func JCC(r operand.Op) { ctx.JCC(r) } - -// JCS: Jump if below (CF == 1). -// -// Forms: -// -// JCS rel8 -// JCS rel32 -// Construct and append a JCS instruction to the active function. -func (c *Context) JCS(r operand.Op) { - if inst, err := x86.JCS(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JCS: Jump if below (CF == 1). -// -// Forms: -// -// JCS rel8 -// JCS rel32 -// Construct and append a JCS instruction to the active function. -// Operates on the global context. -func JCS(r operand.Op) { ctx.JCS(r) } - -// JCXZL: Jump if ECX register is 0. -// -// Forms: -// -// JCXZL rel8 -// Construct and append a JCXZL instruction to the active function. -func (c *Context) JCXZL(r operand.Op) { - if inst, err := x86.JCXZL(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JCXZL: Jump if ECX register is 0. -// -// Forms: -// -// JCXZL rel8 -// Construct and append a JCXZL instruction to the active function. -// Operates on the global context. -func JCXZL(r operand.Op) { ctx.JCXZL(r) } - -// JCXZQ: Jump if RCX register is 0. -// -// Forms: -// -// JCXZQ rel8 -// Construct and append a JCXZQ instruction to the active function. -func (c *Context) JCXZQ(r operand.Op) { - if inst, err := x86.JCXZQ(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JCXZQ: Jump if RCX register is 0. -// -// Forms: -// -// JCXZQ rel8 -// Construct and append a JCXZQ instruction to the active function. -// Operates on the global context. -func JCXZQ(r operand.Op) { ctx.JCXZQ(r) } - -// JE: Jump if equal (ZF == 1). -// -// Forms: -// -// JE rel8 -// JE rel32 -// Construct and append a JE instruction to the active function. -func (c *Context) JE(r operand.Op) { - if inst, err := x86.JE(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JE: Jump if equal (ZF == 1). -// -// Forms: -// -// JE rel8 -// JE rel32 -// Construct and append a JE instruction to the active function. -// Operates on the global context. -func JE(r operand.Op) { ctx.JE(r) } - -// JEQ: Jump if equal (ZF == 1). -// -// Forms: -// -// JEQ rel8 -// JEQ rel32 -// Construct and append a JEQ instruction to the active function. -func (c *Context) JEQ(r operand.Op) { - if inst, err := x86.JEQ(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JEQ: Jump if equal (ZF == 1). -// -// Forms: -// -// JEQ rel8 -// JEQ rel32 -// Construct and append a JEQ instruction to the active function. -// Operates on the global context. -func JEQ(r operand.Op) { ctx.JEQ(r) } - -// JG: Jump if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// JG rel8 -// JG rel32 -// Construct and append a JG instruction to the active function. -func (c *Context) JG(r operand.Op) { - if inst, err := x86.JG(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JG: Jump if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// JG rel8 -// JG rel32 -// Construct and append a JG instruction to the active function. -// Operates on the global context. -func JG(r operand.Op) { ctx.JG(r) } - -// JGE: Jump if greater or equal (SF == OF). -// -// Forms: -// -// JGE rel8 -// JGE rel32 -// Construct and append a JGE instruction to the active function. -func (c *Context) JGE(r operand.Op) { - if inst, err := x86.JGE(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JGE: Jump if greater or equal (SF == OF). -// -// Forms: -// -// JGE rel8 -// JGE rel32 -// Construct and append a JGE instruction to the active function. -// Operates on the global context. -func JGE(r operand.Op) { ctx.JGE(r) } - -// JGT: Jump if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// JGT rel8 -// JGT rel32 -// Construct and append a JGT instruction to the active function. -func (c *Context) JGT(r operand.Op) { - if inst, err := x86.JGT(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JGT: Jump if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// JGT rel8 -// JGT rel32 -// Construct and append a JGT instruction to the active function. -// Operates on the global context. -func JGT(r operand.Op) { ctx.JGT(r) } - -// JHI: Jump if above (CF == 0 and ZF == 0). -// -// Forms: -// -// JHI rel8 -// JHI rel32 -// Construct and append a JHI instruction to the active function. -func (c *Context) JHI(r operand.Op) { - if inst, err := x86.JHI(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JHI: Jump if above (CF == 0 and ZF == 0). -// -// Forms: -// -// JHI rel8 -// JHI rel32 -// Construct and append a JHI instruction to the active function. -// Operates on the global context. -func JHI(r operand.Op) { ctx.JHI(r) } - -// JHS: Jump if above or equal (CF == 0). -// -// Forms: -// -// JHS rel8 -// JHS rel32 -// Construct and append a JHS instruction to the active function. -func (c *Context) JHS(r operand.Op) { - if inst, err := x86.JHS(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JHS: Jump if above or equal (CF == 0). -// -// Forms: -// -// JHS rel8 -// JHS rel32 -// Construct and append a JHS instruction to the active function. -// Operates on the global context. -func JHS(r operand.Op) { ctx.JHS(r) } - -// JL: Jump if less (SF != OF). -// -// Forms: -// -// JL rel8 -// JL rel32 -// Construct and append a JL instruction to the active function. -func (c *Context) JL(r operand.Op) { - if inst, err := x86.JL(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JL: Jump if less (SF != OF). -// -// Forms: -// -// JL rel8 -// JL rel32 -// Construct and append a JL instruction to the active function. -// Operates on the global context. -func JL(r operand.Op) { ctx.JL(r) } - -// JLE: Jump if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// JLE rel8 -// JLE rel32 -// Construct and append a JLE instruction to the active function. -func (c *Context) JLE(r operand.Op) { - if inst, err := x86.JLE(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JLE: Jump if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// JLE rel8 -// JLE rel32 -// Construct and append a JLE instruction to the active function. -// Operates on the global context. -func JLE(r operand.Op) { ctx.JLE(r) } - -// JLO: Jump if below (CF == 1). -// -// Forms: -// -// JLO rel8 -// JLO rel32 -// Construct and append a JLO instruction to the active function. -func (c *Context) JLO(r operand.Op) { - if inst, err := x86.JLO(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JLO: Jump if below (CF == 1). -// -// Forms: -// -// JLO rel8 -// JLO rel32 -// Construct and append a JLO instruction to the active function. -// Operates on the global context. -func JLO(r operand.Op) { ctx.JLO(r) } - -// JLS: Jump if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// JLS rel8 -// JLS rel32 -// Construct and append a JLS instruction to the active function. -func (c *Context) JLS(r operand.Op) { - if inst, err := x86.JLS(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JLS: Jump if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// JLS rel8 -// JLS rel32 -// Construct and append a JLS instruction to the active function. -// Operates on the global context. -func JLS(r operand.Op) { ctx.JLS(r) } - -// JLT: Jump if less (SF != OF). -// -// Forms: -// -// JLT rel8 -// JLT rel32 -// Construct and append a JLT instruction to the active function. -func (c *Context) JLT(r operand.Op) { - if inst, err := x86.JLT(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JLT: Jump if less (SF != OF). -// -// Forms: -// -// JLT rel8 -// JLT rel32 -// Construct and append a JLT instruction to the active function. -// Operates on the global context. -func JLT(r operand.Op) { ctx.JLT(r) } - -// JMI: Jump if sign (SF == 1). -// -// Forms: -// -// JMI rel8 -// JMI rel32 -// Construct and append a JMI instruction to the active function. -func (c *Context) JMI(r operand.Op) { - if inst, err := x86.JMI(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JMI: Jump if sign (SF == 1). -// -// Forms: -// -// JMI rel8 -// JMI rel32 -// Construct and append a JMI instruction to the active function. -// Operates on the global context. -func JMI(r operand.Op) { ctx.JMI(r) } - -// JMP: Jump Unconditionally. -// -// Forms: -// -// JMP rel8 -// JMP rel32 -// JMP r64 -// JMP m64 -// Construct and append a JMP instruction to the active function. -func (c *Context) JMP(mr operand.Op) { - if inst, err := x86.JMP(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JMP: Jump Unconditionally. -// -// Forms: -// -// JMP rel8 -// JMP rel32 -// JMP r64 -// JMP m64 -// Construct and append a JMP instruction to the active function. -// Operates on the global context. -func JMP(mr operand.Op) { ctx.JMP(mr) } - -// JNA: Jump if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// JNA rel8 -// JNA rel32 -// Construct and append a JNA instruction to the active function. -func (c *Context) JNA(r operand.Op) { - if inst, err := x86.JNA(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JNA: Jump if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// JNA rel8 -// JNA rel32 -// Construct and append a JNA instruction to the active function. -// Operates on the global context. -func JNA(r operand.Op) { ctx.JNA(r) } - -// JNAE: Jump if below (CF == 1). -// -// Forms: -// -// JNAE rel8 -// JNAE rel32 -// Construct and append a JNAE instruction to the active function. -func (c *Context) JNAE(r operand.Op) { - if inst, err := x86.JNAE(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JNAE: Jump if below (CF == 1). -// -// Forms: -// -// JNAE rel8 -// JNAE rel32 -// Construct and append a JNAE instruction to the active function. -// Operates on the global context. -func JNAE(r operand.Op) { ctx.JNAE(r) } - -// JNB: Jump if above or equal (CF == 0). -// -// Forms: -// -// JNB rel8 -// JNB rel32 -// Construct and append a JNB instruction to the active function. -func (c *Context) JNB(r operand.Op) { - if inst, err := x86.JNB(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JNB: Jump if above or equal (CF == 0). -// -// Forms: -// -// JNB rel8 -// JNB rel32 -// Construct and append a JNB instruction to the active function. -// Operates on the global context. -func JNB(r operand.Op) { ctx.JNB(r) } - -// JNBE: Jump if above (CF == 0 and ZF == 0). -// -// Forms: -// -// JNBE rel8 -// JNBE rel32 -// Construct and append a JNBE instruction to the active function. -func (c *Context) JNBE(r operand.Op) { - if inst, err := x86.JNBE(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JNBE: Jump if above (CF == 0 and ZF == 0). -// -// Forms: -// -// JNBE rel8 -// JNBE rel32 -// Construct and append a JNBE instruction to the active function. -// Operates on the global context. -func JNBE(r operand.Op) { ctx.JNBE(r) } - -// JNC: Jump if above or equal (CF == 0). -// -// Forms: -// -// JNC rel8 -// JNC rel32 -// Construct and append a JNC instruction to the active function. -func (c *Context) JNC(r operand.Op) { - if inst, err := x86.JNC(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JNC: Jump if above or equal (CF == 0). -// -// Forms: -// -// JNC rel8 -// JNC rel32 -// Construct and append a JNC instruction to the active function. -// Operates on the global context. -func JNC(r operand.Op) { ctx.JNC(r) } - -// JNE: Jump if not equal (ZF == 0). -// -// Forms: -// -// JNE rel8 -// JNE rel32 -// Construct and append a JNE instruction to the active function. -func (c *Context) JNE(r operand.Op) { - if inst, err := x86.JNE(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JNE: Jump if not equal (ZF == 0). -// -// Forms: -// -// JNE rel8 -// JNE rel32 -// Construct and append a JNE instruction to the active function. -// Operates on the global context. -func JNE(r operand.Op) { ctx.JNE(r) } - -// JNG: Jump if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// JNG rel8 -// JNG rel32 -// Construct and append a JNG instruction to the active function. -func (c *Context) JNG(r operand.Op) { - if inst, err := x86.JNG(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JNG: Jump if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// JNG rel8 -// JNG rel32 -// Construct and append a JNG instruction to the active function. -// Operates on the global context. -func JNG(r operand.Op) { ctx.JNG(r) } - -// JNGE: Jump if less (SF != OF). -// -// Forms: -// -// JNGE rel8 -// JNGE rel32 -// Construct and append a JNGE instruction to the active function. -func (c *Context) JNGE(r operand.Op) { - if inst, err := x86.JNGE(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JNGE: Jump if less (SF != OF). -// -// Forms: -// -// JNGE rel8 -// JNGE rel32 -// Construct and append a JNGE instruction to the active function. -// Operates on the global context. -func JNGE(r operand.Op) { ctx.JNGE(r) } - -// JNL: Jump if greater or equal (SF == OF). -// -// Forms: -// -// JNL rel8 -// JNL rel32 -// Construct and append a JNL instruction to the active function. -func (c *Context) JNL(r operand.Op) { - if inst, err := x86.JNL(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JNL: Jump if greater or equal (SF == OF). -// -// Forms: -// -// JNL rel8 -// JNL rel32 -// Construct and append a JNL instruction to the active function. -// Operates on the global context. -func JNL(r operand.Op) { ctx.JNL(r) } - -// JNLE: Jump if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// JNLE rel8 -// JNLE rel32 -// Construct and append a JNLE instruction to the active function. -func (c *Context) JNLE(r operand.Op) { - if inst, err := x86.JNLE(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JNLE: Jump if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// JNLE rel8 -// JNLE rel32 -// Construct and append a JNLE instruction to the active function. -// Operates on the global context. -func JNLE(r operand.Op) { ctx.JNLE(r) } - -// JNO: Jump if not overflow (OF == 0). -// -// Forms: -// -// JNO rel8 -// JNO rel32 -// Construct and append a JNO instruction to the active function. -func (c *Context) JNO(r operand.Op) { - if inst, err := x86.JNO(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JNO: Jump if not overflow (OF == 0). -// -// Forms: -// -// JNO rel8 -// JNO rel32 -// Construct and append a JNO instruction to the active function. -// Operates on the global context. -func JNO(r operand.Op) { ctx.JNO(r) } - -// JNP: Jump if not parity (PF == 0). -// -// Forms: -// -// JNP rel8 -// JNP rel32 -// Construct and append a JNP instruction to the active function. -func (c *Context) JNP(r operand.Op) { - if inst, err := x86.JNP(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JNP: Jump if not parity (PF == 0). -// -// Forms: -// -// JNP rel8 -// JNP rel32 -// Construct and append a JNP instruction to the active function. -// Operates on the global context. -func JNP(r operand.Op) { ctx.JNP(r) } - -// JNS: Jump if not sign (SF == 0). -// -// Forms: -// -// JNS rel8 -// JNS rel32 -// Construct and append a JNS instruction to the active function. -func (c *Context) JNS(r operand.Op) { - if inst, err := x86.JNS(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JNS: Jump if not sign (SF == 0). -// -// Forms: -// -// JNS rel8 -// JNS rel32 -// Construct and append a JNS instruction to the active function. -// Operates on the global context. -func JNS(r operand.Op) { ctx.JNS(r) } - -// JNZ: Jump if not equal (ZF == 0). -// -// Forms: -// -// JNZ rel8 -// JNZ rel32 -// Construct and append a JNZ instruction to the active function. -func (c *Context) JNZ(r operand.Op) { - if inst, err := x86.JNZ(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JNZ: Jump if not equal (ZF == 0). -// -// Forms: -// -// JNZ rel8 -// JNZ rel32 -// Construct and append a JNZ instruction to the active function. -// Operates on the global context. -func JNZ(r operand.Op) { ctx.JNZ(r) } - -// JO: Jump if overflow (OF == 1). -// -// Forms: -// -// JO rel8 -// JO rel32 -// Construct and append a JO instruction to the active function. -func (c *Context) JO(r operand.Op) { - if inst, err := x86.JO(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JO: Jump if overflow (OF == 1). -// -// Forms: -// -// JO rel8 -// JO rel32 -// Construct and append a JO instruction to the active function. -// Operates on the global context. -func JO(r operand.Op) { ctx.JO(r) } - -// JOC: Jump if not overflow (OF == 0). -// -// Forms: -// -// JOC rel8 -// JOC rel32 -// Construct and append a JOC instruction to the active function. -func (c *Context) JOC(r operand.Op) { - if inst, err := x86.JOC(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JOC: Jump if not overflow (OF == 0). -// -// Forms: -// -// JOC rel8 -// JOC rel32 -// Construct and append a JOC instruction to the active function. -// Operates on the global context. -func JOC(r operand.Op) { ctx.JOC(r) } - -// JOS: Jump if overflow (OF == 1). -// -// Forms: -// -// JOS rel8 -// JOS rel32 -// Construct and append a JOS instruction to the active function. -func (c *Context) JOS(r operand.Op) { - if inst, err := x86.JOS(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JOS: Jump if overflow (OF == 1). -// -// Forms: -// -// JOS rel8 -// JOS rel32 -// Construct and append a JOS instruction to the active function. -// Operates on the global context. -func JOS(r operand.Op) { ctx.JOS(r) } - -// JP: Jump if parity (PF == 1). -// -// Forms: -// -// JP rel8 -// JP rel32 -// Construct and append a JP instruction to the active function. -func (c *Context) JP(r operand.Op) { - if inst, err := x86.JP(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JP: Jump if parity (PF == 1). -// -// Forms: -// -// JP rel8 -// JP rel32 -// Construct and append a JP instruction to the active function. -// Operates on the global context. -func JP(r operand.Op) { ctx.JP(r) } - -// JPC: Jump if not parity (PF == 0). -// -// Forms: -// -// JPC rel8 -// JPC rel32 -// Construct and append a JPC instruction to the active function. -func (c *Context) JPC(r operand.Op) { - if inst, err := x86.JPC(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JPC: Jump if not parity (PF == 0). -// -// Forms: -// -// JPC rel8 -// JPC rel32 -// Construct and append a JPC instruction to the active function. -// Operates on the global context. -func JPC(r operand.Op) { ctx.JPC(r) } - -// JPE: Jump if parity (PF == 1). -// -// Forms: -// -// JPE rel8 -// JPE rel32 -// Construct and append a JPE instruction to the active function. -func (c *Context) JPE(r operand.Op) { - if inst, err := x86.JPE(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JPE: Jump if parity (PF == 1). -// -// Forms: -// -// JPE rel8 -// JPE rel32 -// Construct and append a JPE instruction to the active function. -// Operates on the global context. -func JPE(r operand.Op) { ctx.JPE(r) } - -// JPL: Jump if not sign (SF == 0). -// -// Forms: -// -// JPL rel8 -// JPL rel32 -// Construct and append a JPL instruction to the active function. -func (c *Context) JPL(r operand.Op) { - if inst, err := x86.JPL(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JPL: Jump if not sign (SF == 0). -// -// Forms: -// -// JPL rel8 -// JPL rel32 -// Construct and append a JPL instruction to the active function. -// Operates on the global context. -func JPL(r operand.Op) { ctx.JPL(r) } - -// JPO: Jump if not parity (PF == 0). -// -// Forms: -// -// JPO rel8 -// JPO rel32 -// Construct and append a JPO instruction to the active function. -func (c *Context) JPO(r operand.Op) { - if inst, err := x86.JPO(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JPO: Jump if not parity (PF == 0). -// -// Forms: -// -// JPO rel8 -// JPO rel32 -// Construct and append a JPO instruction to the active function. -// Operates on the global context. -func JPO(r operand.Op) { ctx.JPO(r) } - -// JPS: Jump if parity (PF == 1). -// -// Forms: -// -// JPS rel8 -// JPS rel32 -// Construct and append a JPS instruction to the active function. -func (c *Context) JPS(r operand.Op) { - if inst, err := x86.JPS(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JPS: Jump if parity (PF == 1). -// -// Forms: -// -// JPS rel8 -// JPS rel32 -// Construct and append a JPS instruction to the active function. -// Operates on the global context. -func JPS(r operand.Op) { ctx.JPS(r) } - -// JS: Jump if sign (SF == 1). -// -// Forms: -// -// JS rel8 -// JS rel32 -// Construct and append a JS instruction to the active function. -func (c *Context) JS(r operand.Op) { - if inst, err := x86.JS(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JS: Jump if sign (SF == 1). -// -// Forms: -// -// JS rel8 -// JS rel32 -// Construct and append a JS instruction to the active function. -// Operates on the global context. -func JS(r operand.Op) { ctx.JS(r) } - -// JZ: Jump if equal (ZF == 1). -// -// Forms: -// -// JZ rel8 -// JZ rel32 -// Construct and append a JZ instruction to the active function. -func (c *Context) JZ(r operand.Op) { - if inst, err := x86.JZ(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// JZ: Jump if equal (ZF == 1). -// -// Forms: -// -// JZ rel8 -// JZ rel32 -// Construct and append a JZ instruction to the active function. -// Operates on the global context. -func JZ(r operand.Op) { ctx.JZ(r) } - -// LDDQU: Load Unaligned Integer 128 Bits. -// -// Forms: -// -// LDDQU m128 xmm -// Construct and append a LDDQU instruction to the active function. -func (c *Context) LDDQU(m, x operand.Op) { - if inst, err := x86.LDDQU(m, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// LDDQU: Load Unaligned Integer 128 Bits. -// -// Forms: -// -// LDDQU m128 xmm -// Construct and append a LDDQU instruction to the active function. -// Operates on the global context. -func LDDQU(m, x operand.Op) { ctx.LDDQU(m, x) } - -// LDMXCSR: Load MXCSR Register. -// -// Forms: -// -// LDMXCSR m32 -// Construct and append a LDMXCSR instruction to the active function. -func (c *Context) LDMXCSR(m operand.Op) { - if inst, err := x86.LDMXCSR(m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// LDMXCSR: Load MXCSR Register. -// -// Forms: -// -// LDMXCSR m32 -// Construct and append a LDMXCSR instruction to the active function. -// Operates on the global context. -func LDMXCSR(m operand.Op) { ctx.LDMXCSR(m) } - -// LEAL: Load Effective Address. -// -// Forms: -// -// LEAL m r32 -// Construct and append a LEAL instruction to the active function. -func (c *Context) LEAL(m, r operand.Op) { - if inst, err := x86.LEAL(m, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// LEAL: Load Effective Address. -// -// Forms: -// -// LEAL m r32 -// Construct and append a LEAL instruction to the active function. -// Operates on the global context. -func LEAL(m, r operand.Op) { ctx.LEAL(m, r) } - -// LEAQ: Load Effective Address. -// -// Forms: -// -// LEAQ m r64 -// Construct and append a LEAQ instruction to the active function. -func (c *Context) LEAQ(m, r operand.Op) { - if inst, err := x86.LEAQ(m, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// LEAQ: Load Effective Address. -// -// Forms: -// -// LEAQ m r64 -// Construct and append a LEAQ instruction to the active function. -// Operates on the global context. -func LEAQ(m, r operand.Op) { ctx.LEAQ(m, r) } - -// LEAW: Load Effective Address. -// -// Forms: -// -// LEAW m r16 -// Construct and append a LEAW instruction to the active function. -func (c *Context) LEAW(m, r operand.Op) { - if inst, err := x86.LEAW(m, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// LEAW: Load Effective Address. -// -// Forms: -// -// LEAW m r16 -// Construct and append a LEAW instruction to the active function. -// Operates on the global context. -func LEAW(m, r operand.Op) { ctx.LEAW(m, r) } - -// LFENCE: Load Fence. -// -// Forms: -// -// LFENCE -// Construct and append a LFENCE instruction to the active function. -func (c *Context) LFENCE() { - if inst, err := x86.LFENCE(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// LFENCE: Load Fence. -// -// Forms: -// -// LFENCE -// Construct and append a LFENCE instruction to the active function. -// Operates on the global context. -func LFENCE() { ctx.LFENCE() } - -// LZCNTL: Count the Number of Leading Zero Bits. -// -// Forms: -// -// LZCNTL r32 r32 -// LZCNTL m32 r32 -// Construct and append a LZCNTL instruction to the active function. -func (c *Context) LZCNTL(mr, r operand.Op) { - if inst, err := x86.LZCNTL(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// LZCNTL: Count the Number of Leading Zero Bits. -// -// Forms: -// -// LZCNTL r32 r32 -// LZCNTL m32 r32 -// Construct and append a LZCNTL instruction to the active function. -// Operates on the global context. -func LZCNTL(mr, r operand.Op) { ctx.LZCNTL(mr, r) } - -// LZCNTQ: Count the Number of Leading Zero Bits. -// -// Forms: -// -// LZCNTQ r64 r64 -// LZCNTQ m64 r64 -// Construct and append a LZCNTQ instruction to the active function. -func (c *Context) LZCNTQ(mr, r operand.Op) { - if inst, err := x86.LZCNTQ(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// LZCNTQ: Count the Number of Leading Zero Bits. -// -// Forms: -// -// LZCNTQ r64 r64 -// LZCNTQ m64 r64 -// Construct and append a LZCNTQ instruction to the active function. -// Operates on the global context. -func LZCNTQ(mr, r operand.Op) { ctx.LZCNTQ(mr, r) } - -// LZCNTW: Count the Number of Leading Zero Bits. -// -// Forms: -// -// LZCNTW r16 r16 -// LZCNTW m16 r16 -// Construct and append a LZCNTW instruction to the active function. -func (c *Context) LZCNTW(mr, r operand.Op) { - if inst, err := x86.LZCNTW(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// LZCNTW: Count the Number of Leading Zero Bits. -// -// Forms: -// -// LZCNTW r16 r16 -// LZCNTW m16 r16 -// Construct and append a LZCNTW instruction to the active function. -// Operates on the global context. -func LZCNTW(mr, r operand.Op) { ctx.LZCNTW(mr, r) } - -// MASKMOVDQU: Store Selected Bytes of Double Quadword. -// -// Forms: -// -// MASKMOVDQU xmm xmm -// Construct and append a MASKMOVDQU instruction to the active function. -func (c *Context) MASKMOVDQU(x, x1 operand.Op) { - if inst, err := x86.MASKMOVDQU(x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MASKMOVDQU: Store Selected Bytes of Double Quadword. -// -// Forms: -// -// MASKMOVDQU xmm xmm -// Construct and append a MASKMOVDQU instruction to the active function. -// Operates on the global context. -func MASKMOVDQU(x, x1 operand.Op) { ctx.MASKMOVDQU(x, x1) } - -// MASKMOVOU: Store Selected Bytes of Double Quadword. -// -// Forms: -// -// MASKMOVOU xmm xmm -// Construct and append a MASKMOVOU instruction to the active function. -func (c *Context) MASKMOVOU(x, x1 operand.Op) { - if inst, err := x86.MASKMOVOU(x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MASKMOVOU: Store Selected Bytes of Double Quadword. -// -// Forms: -// -// MASKMOVOU xmm xmm -// Construct and append a MASKMOVOU instruction to the active function. -// Operates on the global context. -func MASKMOVOU(x, x1 operand.Op) { ctx.MASKMOVOU(x, x1) } - -// MAXPD: Return Maximum Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// MAXPD xmm xmm -// MAXPD m128 xmm -// Construct and append a MAXPD instruction to the active function. -func (c *Context) MAXPD(mx, x operand.Op) { - if inst, err := x86.MAXPD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MAXPD: Return Maximum Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// MAXPD xmm xmm -// MAXPD m128 xmm -// Construct and append a MAXPD instruction to the active function. -// Operates on the global context. -func MAXPD(mx, x operand.Op) { ctx.MAXPD(mx, x) } - -// MAXPS: Return Maximum Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MAXPS xmm xmm -// MAXPS m128 xmm -// Construct and append a MAXPS instruction to the active function. -func (c *Context) MAXPS(mx, x operand.Op) { - if inst, err := x86.MAXPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MAXPS: Return Maximum Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MAXPS xmm xmm -// MAXPS m128 xmm -// Construct and append a MAXPS instruction to the active function. -// Operates on the global context. -func MAXPS(mx, x operand.Op) { ctx.MAXPS(mx, x) } - -// MAXSD: Return Maximum Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// MAXSD xmm xmm -// MAXSD m64 xmm -// Construct and append a MAXSD instruction to the active function. -func (c *Context) MAXSD(mx, x operand.Op) { - if inst, err := x86.MAXSD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MAXSD: Return Maximum Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// MAXSD xmm xmm -// MAXSD m64 xmm -// Construct and append a MAXSD instruction to the active function. -// Operates on the global context. -func MAXSD(mx, x operand.Op) { ctx.MAXSD(mx, x) } - -// MAXSS: Return Maximum Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// MAXSS xmm xmm -// MAXSS m32 xmm -// Construct and append a MAXSS instruction to the active function. -func (c *Context) MAXSS(mx, x operand.Op) { - if inst, err := x86.MAXSS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MAXSS: Return Maximum Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// MAXSS xmm xmm -// MAXSS m32 xmm -// Construct and append a MAXSS instruction to the active function. -// Operates on the global context. -func MAXSS(mx, x operand.Op) { ctx.MAXSS(mx, x) } - -// MFENCE: Memory Fence. -// -// Forms: -// -// MFENCE -// Construct and append a MFENCE instruction to the active function. -func (c *Context) MFENCE() { - if inst, err := x86.MFENCE(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MFENCE: Memory Fence. -// -// Forms: -// -// MFENCE -// Construct and append a MFENCE instruction to the active function. -// Operates on the global context. -func MFENCE() { ctx.MFENCE() } - -// MINPD: Return Minimum Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// MINPD xmm xmm -// MINPD m128 xmm -// Construct and append a MINPD instruction to the active function. -func (c *Context) MINPD(mx, x operand.Op) { - if inst, err := x86.MINPD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MINPD: Return Minimum Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// MINPD xmm xmm -// MINPD m128 xmm -// Construct and append a MINPD instruction to the active function. -// Operates on the global context. -func MINPD(mx, x operand.Op) { ctx.MINPD(mx, x) } - -// MINPS: Return Minimum Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MINPS xmm xmm -// MINPS m128 xmm -// Construct and append a MINPS instruction to the active function. -func (c *Context) MINPS(mx, x operand.Op) { - if inst, err := x86.MINPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MINPS: Return Minimum Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MINPS xmm xmm -// MINPS m128 xmm -// Construct and append a MINPS instruction to the active function. -// Operates on the global context. -func MINPS(mx, x operand.Op) { ctx.MINPS(mx, x) } - -// MINSD: Return Minimum Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// MINSD xmm xmm -// MINSD m64 xmm -// Construct and append a MINSD instruction to the active function. -func (c *Context) MINSD(mx, x operand.Op) { - if inst, err := x86.MINSD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MINSD: Return Minimum Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// MINSD xmm xmm -// MINSD m64 xmm -// Construct and append a MINSD instruction to the active function. -// Operates on the global context. -func MINSD(mx, x operand.Op) { ctx.MINSD(mx, x) } - -// MINSS: Return Minimum Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// MINSS xmm xmm -// MINSS m32 xmm -// Construct and append a MINSS instruction to the active function. -func (c *Context) MINSS(mx, x operand.Op) { - if inst, err := x86.MINSS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MINSS: Return Minimum Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// MINSS xmm xmm -// MINSS m32 xmm -// Construct and append a MINSS instruction to the active function. -// Operates on the global context. -func MINSS(mx, x operand.Op) { ctx.MINSS(mx, x) } - -// MONITOR: Monitor a Linear Address Range. -// -// Forms: -// -// MONITOR -// Construct and append a MONITOR instruction to the active function. -func (c *Context) MONITOR() { - if inst, err := x86.MONITOR(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MONITOR: Monitor a Linear Address Range. -// -// Forms: -// -// MONITOR -// Construct and append a MONITOR instruction to the active function. -// Operates on the global context. -func MONITOR() { ctx.MONITOR() } - -// MOVAPD: Move Aligned Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// MOVAPD xmm xmm -// MOVAPD m128 xmm -// MOVAPD xmm m128 -// Construct and append a MOVAPD instruction to the active function. -func (c *Context) MOVAPD(mx, mx1 operand.Op) { - if inst, err := x86.MOVAPD(mx, mx1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVAPD: Move Aligned Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// MOVAPD xmm xmm -// MOVAPD m128 xmm -// MOVAPD xmm m128 -// Construct and append a MOVAPD instruction to the active function. -// Operates on the global context. -func MOVAPD(mx, mx1 operand.Op) { ctx.MOVAPD(mx, mx1) } - -// MOVAPS: Move Aligned Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MOVAPS xmm xmm -// MOVAPS m128 xmm -// MOVAPS xmm m128 -// Construct and append a MOVAPS instruction to the active function. -func (c *Context) MOVAPS(mx, mx1 operand.Op) { - if inst, err := x86.MOVAPS(mx, mx1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVAPS: Move Aligned Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MOVAPS xmm xmm -// MOVAPS m128 xmm -// MOVAPS xmm m128 -// Construct and append a MOVAPS instruction to the active function. -// Operates on the global context. -func MOVAPS(mx, mx1 operand.Op) { ctx.MOVAPS(mx, mx1) } - -// MOVB: Move. -// -// Forms: -// -// MOVB imm8 r8 -// MOVB r8 r8 -// MOVB m8 r8 -// MOVB imm8 m8 -// MOVB r8 m8 -// Construct and append a MOVB instruction to the active function. -func (c *Context) MOVB(imr, mr operand.Op) { - if inst, err := x86.MOVB(imr, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVB: Move. -// -// Forms: -// -// MOVB imm8 r8 -// MOVB r8 r8 -// MOVB m8 r8 -// MOVB imm8 m8 -// MOVB r8 m8 -// Construct and append a MOVB instruction to the active function. -// Operates on the global context. -func MOVB(imr, mr operand.Op) { ctx.MOVB(imr, mr) } - -// MOVBELL: Move Data After Swapping Bytes. -// -// Forms: -// -// MOVBELL m32 r32 -// MOVBELL r32 m32 -// Construct and append a MOVBELL instruction to the active function. -func (c *Context) MOVBELL(mr, mr1 operand.Op) { - if inst, err := x86.MOVBELL(mr, mr1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVBELL: Move Data After Swapping Bytes. -// -// Forms: -// -// MOVBELL m32 r32 -// MOVBELL r32 m32 -// Construct and append a MOVBELL instruction to the active function. -// Operates on the global context. -func MOVBELL(mr, mr1 operand.Op) { ctx.MOVBELL(mr, mr1) } - -// MOVBEQQ: Move Data After Swapping Bytes. -// -// Forms: -// -// MOVBEQQ m64 r64 -// MOVBEQQ r64 m64 -// Construct and append a MOVBEQQ instruction to the active function. -func (c *Context) MOVBEQQ(mr, mr1 operand.Op) { - if inst, err := x86.MOVBEQQ(mr, mr1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVBEQQ: Move Data After Swapping Bytes. -// -// Forms: -// -// MOVBEQQ m64 r64 -// MOVBEQQ r64 m64 -// Construct and append a MOVBEQQ instruction to the active function. -// Operates on the global context. -func MOVBEQQ(mr, mr1 operand.Op) { ctx.MOVBEQQ(mr, mr1) } - -// MOVBEWW: Move Data After Swapping Bytes. -// -// Forms: -// -// MOVBEWW m16 r16 -// MOVBEWW r16 m16 -// Construct and append a MOVBEWW instruction to the active function. -func (c *Context) MOVBEWW(mr, mr1 operand.Op) { - if inst, err := x86.MOVBEWW(mr, mr1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVBEWW: Move Data After Swapping Bytes. -// -// Forms: -// -// MOVBEWW m16 r16 -// MOVBEWW r16 m16 -// Construct and append a MOVBEWW instruction to the active function. -// Operates on the global context. -func MOVBEWW(mr, mr1 operand.Op) { ctx.MOVBEWW(mr, mr1) } - -// MOVBLSX: Move with Sign-Extension. -// -// Forms: -// -// MOVBLSX r8 r32 -// MOVBLSX m8 r32 -// Construct and append a MOVBLSX instruction to the active function. -func (c *Context) MOVBLSX(mr, r operand.Op) { - if inst, err := x86.MOVBLSX(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVBLSX: Move with Sign-Extension. -// -// Forms: -// -// MOVBLSX r8 r32 -// MOVBLSX m8 r32 -// Construct and append a MOVBLSX instruction to the active function. -// Operates on the global context. -func MOVBLSX(mr, r operand.Op) { ctx.MOVBLSX(mr, r) } - -// MOVBLZX: Move with Zero-Extend. -// -// Forms: -// -// MOVBLZX r8 r32 -// MOVBLZX m8 r32 -// Construct and append a MOVBLZX instruction to the active function. -func (c *Context) MOVBLZX(mr, r operand.Op) { - if inst, err := x86.MOVBLZX(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVBLZX: Move with Zero-Extend. -// -// Forms: -// -// MOVBLZX r8 r32 -// MOVBLZX m8 r32 -// Construct and append a MOVBLZX instruction to the active function. -// Operates on the global context. -func MOVBLZX(mr, r operand.Op) { ctx.MOVBLZX(mr, r) } - -// MOVBQSX: Move with Sign-Extension. -// -// Forms: -// -// MOVBQSX r8 r64 -// MOVBQSX m8 r64 -// Construct and append a MOVBQSX instruction to the active function. -func (c *Context) MOVBQSX(mr, r operand.Op) { - if inst, err := x86.MOVBQSX(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVBQSX: Move with Sign-Extension. -// -// Forms: -// -// MOVBQSX r8 r64 -// MOVBQSX m8 r64 -// Construct and append a MOVBQSX instruction to the active function. -// Operates on the global context. -func MOVBQSX(mr, r operand.Op) { ctx.MOVBQSX(mr, r) } - -// MOVBQZX: Move with Zero-Extend. -// -// Forms: -// -// MOVBQZX r8 r64 -// MOVBQZX m8 r64 -// Construct and append a MOVBQZX instruction to the active function. -func (c *Context) MOVBQZX(mr, r operand.Op) { - if inst, err := x86.MOVBQZX(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVBQZX: Move with Zero-Extend. -// -// Forms: -// -// MOVBQZX r8 r64 -// MOVBQZX m8 r64 -// Construct and append a MOVBQZX instruction to the active function. -// Operates on the global context. -func MOVBQZX(mr, r operand.Op) { ctx.MOVBQZX(mr, r) } - -// MOVBWSX: Move with Sign-Extension. -// -// Forms: -// -// MOVBWSX r8 r16 -// MOVBWSX m8 r16 -// Construct and append a MOVBWSX instruction to the active function. -func (c *Context) MOVBWSX(mr, r operand.Op) { - if inst, err := x86.MOVBWSX(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVBWSX: Move with Sign-Extension. -// -// Forms: -// -// MOVBWSX r8 r16 -// MOVBWSX m8 r16 -// Construct and append a MOVBWSX instruction to the active function. -// Operates on the global context. -func MOVBWSX(mr, r operand.Op) { ctx.MOVBWSX(mr, r) } - -// MOVBWZX: Move with Zero-Extend. -// -// Forms: -// -// MOVBWZX r8 r16 -// MOVBWZX m8 r16 -// Construct and append a MOVBWZX instruction to the active function. -func (c *Context) MOVBWZX(mr, r operand.Op) { - if inst, err := x86.MOVBWZX(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVBWZX: Move with Zero-Extend. -// -// Forms: -// -// MOVBWZX r8 r16 -// MOVBWZX m8 r16 -// Construct and append a MOVBWZX instruction to the active function. -// Operates on the global context. -func MOVBWZX(mr, r operand.Op) { ctx.MOVBWZX(mr, r) } - -// MOVD: Move. -// -// Forms: -// -// MOVD imm32 r64 -// MOVD imm64 r64 -// MOVD r64 r64 -// MOVD m64 r64 -// MOVD imm32 m64 -// MOVD r64 m64 -// MOVD xmm r64 -// MOVD r64 xmm -// MOVD xmm xmm -// MOVD m64 xmm -// MOVD xmm m64 -// MOVD xmm r32 -// MOVD r32 xmm -// MOVD m32 xmm -// MOVD xmm m32 -// Construct and append a MOVD instruction to the active function. -func (c *Context) MOVD(imrx, mrx operand.Op) { - if inst, err := x86.MOVD(imrx, mrx); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVD: Move. -// -// Forms: -// -// MOVD imm32 r64 -// MOVD imm64 r64 -// MOVD r64 r64 -// MOVD m64 r64 -// MOVD imm32 m64 -// MOVD r64 m64 -// MOVD xmm r64 -// MOVD r64 xmm -// MOVD xmm xmm -// MOVD m64 xmm -// MOVD xmm m64 -// MOVD xmm r32 -// MOVD r32 xmm -// MOVD m32 xmm -// MOVD xmm m32 -// Construct and append a MOVD instruction to the active function. -// Operates on the global context. -func MOVD(imrx, mrx operand.Op) { ctx.MOVD(imrx, mrx) } - -// MOVDDUP: Move One Double-FP and Duplicate. -// -// Forms: -// -// MOVDDUP xmm xmm -// MOVDDUP m64 xmm -// Construct and append a MOVDDUP instruction to the active function. -func (c *Context) MOVDDUP(mx, x operand.Op) { - if inst, err := x86.MOVDDUP(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVDDUP: Move One Double-FP and Duplicate. -// -// Forms: -// -// MOVDDUP xmm xmm -// MOVDDUP m64 xmm -// Construct and append a MOVDDUP instruction to the active function. -// Operates on the global context. -func MOVDDUP(mx, x operand.Op) { ctx.MOVDDUP(mx, x) } - -// MOVDQ2Q: Move. -// -// Forms: -// -// MOVDQ2Q imm32 r64 -// MOVDQ2Q imm64 r64 -// MOVDQ2Q r64 r64 -// MOVDQ2Q m64 r64 -// MOVDQ2Q imm32 m64 -// MOVDQ2Q r64 m64 -// MOVDQ2Q xmm r64 -// MOVDQ2Q r64 xmm -// MOVDQ2Q xmm xmm -// MOVDQ2Q m64 xmm -// MOVDQ2Q xmm m64 -// MOVDQ2Q xmm r32 -// MOVDQ2Q r32 xmm -// MOVDQ2Q m32 xmm -// MOVDQ2Q xmm m32 -// Construct and append a MOVDQ2Q instruction to the active function. -func (c *Context) MOVDQ2Q(imrx, mrx operand.Op) { - if inst, err := x86.MOVDQ2Q(imrx, mrx); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVDQ2Q: Move. -// -// Forms: -// -// MOVDQ2Q imm32 r64 -// MOVDQ2Q imm64 r64 -// MOVDQ2Q r64 r64 -// MOVDQ2Q m64 r64 -// MOVDQ2Q imm32 m64 -// MOVDQ2Q r64 m64 -// MOVDQ2Q xmm r64 -// MOVDQ2Q r64 xmm -// MOVDQ2Q xmm xmm -// MOVDQ2Q m64 xmm -// MOVDQ2Q xmm m64 -// MOVDQ2Q xmm r32 -// MOVDQ2Q r32 xmm -// MOVDQ2Q m32 xmm -// MOVDQ2Q xmm m32 -// Construct and append a MOVDQ2Q instruction to the active function. -// Operates on the global context. -func MOVDQ2Q(imrx, mrx operand.Op) { ctx.MOVDQ2Q(imrx, mrx) } - -// MOVHLPS: Move Packed Single-Precision Floating-Point Values High to Low. -// -// Forms: -// -// MOVHLPS xmm xmm -// Construct and append a MOVHLPS instruction to the active function. -func (c *Context) MOVHLPS(x, x1 operand.Op) { - if inst, err := x86.MOVHLPS(x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVHLPS: Move Packed Single-Precision Floating-Point Values High to Low. -// -// Forms: -// -// MOVHLPS xmm xmm -// Construct and append a MOVHLPS instruction to the active function. -// Operates on the global context. -func MOVHLPS(x, x1 operand.Op) { ctx.MOVHLPS(x, x1) } - -// MOVHPD: Move High Packed Double-Precision Floating-Point Value. -// -// Forms: -// -// MOVHPD m64 xmm -// MOVHPD xmm m64 -// Construct and append a MOVHPD instruction to the active function. -func (c *Context) MOVHPD(mx, mx1 operand.Op) { - if inst, err := x86.MOVHPD(mx, mx1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVHPD: Move High Packed Double-Precision Floating-Point Value. -// -// Forms: -// -// MOVHPD m64 xmm -// MOVHPD xmm m64 -// Construct and append a MOVHPD instruction to the active function. -// Operates on the global context. -func MOVHPD(mx, mx1 operand.Op) { ctx.MOVHPD(mx, mx1) } - -// MOVHPS: Move High Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MOVHPS m64 xmm -// MOVHPS xmm m64 -// Construct and append a MOVHPS instruction to the active function. -func (c *Context) MOVHPS(mx, mx1 operand.Op) { - if inst, err := x86.MOVHPS(mx, mx1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVHPS: Move High Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MOVHPS m64 xmm -// MOVHPS xmm m64 -// Construct and append a MOVHPS instruction to the active function. -// Operates on the global context. -func MOVHPS(mx, mx1 operand.Op) { ctx.MOVHPS(mx, mx1) } - -// MOVL: Move. -// -// Forms: -// -// MOVL imm32 r32 -// MOVL r32 r32 -// MOVL m32 r32 -// MOVL imm32 m32 -// MOVL r32 m32 -// Construct and append a MOVL instruction to the active function. -func (c *Context) MOVL(imr, mr operand.Op) { - if inst, err := x86.MOVL(imr, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVL: Move. -// -// Forms: -// -// MOVL imm32 r32 -// MOVL r32 r32 -// MOVL m32 r32 -// MOVL imm32 m32 -// MOVL r32 m32 -// Construct and append a MOVL instruction to the active function. -// Operates on the global context. -func MOVL(imr, mr operand.Op) { ctx.MOVL(imr, mr) } - -// MOVLHPS: Move Packed Single-Precision Floating-Point Values Low to High. -// -// Forms: -// -// MOVLHPS xmm xmm -// Construct and append a MOVLHPS instruction to the active function. -func (c *Context) MOVLHPS(x, x1 operand.Op) { - if inst, err := x86.MOVLHPS(x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVLHPS: Move Packed Single-Precision Floating-Point Values Low to High. -// -// Forms: -// -// MOVLHPS xmm xmm -// Construct and append a MOVLHPS instruction to the active function. -// Operates on the global context. -func MOVLHPS(x, x1 operand.Op) { ctx.MOVLHPS(x, x1) } - -// MOVLPD: Move Low Packed Double-Precision Floating-Point Value. -// -// Forms: -// -// MOVLPD m64 xmm -// MOVLPD xmm m64 -// Construct and append a MOVLPD instruction to the active function. -func (c *Context) MOVLPD(mx, mx1 operand.Op) { - if inst, err := x86.MOVLPD(mx, mx1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVLPD: Move Low Packed Double-Precision Floating-Point Value. -// -// Forms: -// -// MOVLPD m64 xmm -// MOVLPD xmm m64 -// Construct and append a MOVLPD instruction to the active function. -// Operates on the global context. -func MOVLPD(mx, mx1 operand.Op) { ctx.MOVLPD(mx, mx1) } - -// MOVLPS: Move Low Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MOVLPS m64 xmm -// MOVLPS xmm m64 -// Construct and append a MOVLPS instruction to the active function. -func (c *Context) MOVLPS(mx, mx1 operand.Op) { - if inst, err := x86.MOVLPS(mx, mx1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVLPS: Move Low Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MOVLPS m64 xmm -// MOVLPS xmm m64 -// Construct and append a MOVLPS instruction to the active function. -// Operates on the global context. -func MOVLPS(mx, mx1 operand.Op) { ctx.MOVLPS(mx, mx1) } - -// MOVLQSX: Move Doubleword to Quadword with Sign-Extension. -// -// Forms: -// -// MOVLQSX r32 r64 -// MOVLQSX m32 r64 -// Construct and append a MOVLQSX instruction to the active function. -func (c *Context) MOVLQSX(mr, r operand.Op) { - if inst, err := x86.MOVLQSX(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVLQSX: Move Doubleword to Quadword with Sign-Extension. -// -// Forms: -// -// MOVLQSX r32 r64 -// MOVLQSX m32 r64 -// Construct and append a MOVLQSX instruction to the active function. -// Operates on the global context. -func MOVLQSX(mr, r operand.Op) { ctx.MOVLQSX(mr, r) } - -// MOVLQZX: Move with Zero-Extend. -// -// Forms: -// -// MOVLQZX m32 r64 -// Construct and append a MOVLQZX instruction to the active function. -func (c *Context) MOVLQZX(m, r operand.Op) { - if inst, err := x86.MOVLQZX(m, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVLQZX: Move with Zero-Extend. -// -// Forms: -// -// MOVLQZX m32 r64 -// Construct and append a MOVLQZX instruction to the active function. -// Operates on the global context. -func MOVLQZX(m, r operand.Op) { ctx.MOVLQZX(m, r) } - -// MOVMSKPD: Extract Packed Double-Precision Floating-Point Sign Mask. -// -// Forms: -// -// MOVMSKPD xmm r32 -// Construct and append a MOVMSKPD instruction to the active function. -func (c *Context) MOVMSKPD(x, r operand.Op) { - if inst, err := x86.MOVMSKPD(x, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVMSKPD: Extract Packed Double-Precision Floating-Point Sign Mask. -// -// Forms: -// -// MOVMSKPD xmm r32 -// Construct and append a MOVMSKPD instruction to the active function. -// Operates on the global context. -func MOVMSKPD(x, r operand.Op) { ctx.MOVMSKPD(x, r) } - -// MOVMSKPS: Extract Packed Single-Precision Floating-Point Sign Mask. -// -// Forms: -// -// MOVMSKPS xmm r32 -// Construct and append a MOVMSKPS instruction to the active function. -func (c *Context) MOVMSKPS(x, r operand.Op) { - if inst, err := x86.MOVMSKPS(x, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVMSKPS: Extract Packed Single-Precision Floating-Point Sign Mask. -// -// Forms: -// -// MOVMSKPS xmm r32 -// Construct and append a MOVMSKPS instruction to the active function. -// Operates on the global context. -func MOVMSKPS(x, r operand.Op) { ctx.MOVMSKPS(x, r) } - -// MOVNTDQ: Store Double Quadword Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTDQ xmm m128 -// Construct and append a MOVNTDQ instruction to the active function. -func (c *Context) MOVNTDQ(x, m operand.Op) { - if inst, err := x86.MOVNTDQ(x, m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVNTDQ: Store Double Quadword Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTDQ xmm m128 -// Construct and append a MOVNTDQ instruction to the active function. -// Operates on the global context. -func MOVNTDQ(x, m operand.Op) { ctx.MOVNTDQ(x, m) } - -// MOVNTDQA: Load Double Quadword Non-Temporal Aligned Hint. -// -// Forms: -// -// MOVNTDQA m128 xmm -// Construct and append a MOVNTDQA instruction to the active function. -func (c *Context) MOVNTDQA(m, x operand.Op) { - if inst, err := x86.MOVNTDQA(m, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVNTDQA: Load Double Quadword Non-Temporal Aligned Hint. -// -// Forms: -// -// MOVNTDQA m128 xmm -// Construct and append a MOVNTDQA instruction to the active function. -// Operates on the global context. -func MOVNTDQA(m, x operand.Op) { ctx.MOVNTDQA(m, x) } - -// MOVNTIL: Store Doubleword Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTIL r32 m32 -// Construct and append a MOVNTIL instruction to the active function. -func (c *Context) MOVNTIL(r, m operand.Op) { - if inst, err := x86.MOVNTIL(r, m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVNTIL: Store Doubleword Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTIL r32 m32 -// Construct and append a MOVNTIL instruction to the active function. -// Operates on the global context. -func MOVNTIL(r, m operand.Op) { ctx.MOVNTIL(r, m) } - -// MOVNTIQ: Store Doubleword Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTIQ r64 m64 -// Construct and append a MOVNTIQ instruction to the active function. -func (c *Context) MOVNTIQ(r, m operand.Op) { - if inst, err := x86.MOVNTIQ(r, m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVNTIQ: Store Doubleword Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTIQ r64 m64 -// Construct and append a MOVNTIQ instruction to the active function. -// Operates on the global context. -func MOVNTIQ(r, m operand.Op) { ctx.MOVNTIQ(r, m) } - -// MOVNTO: Store Double Quadword Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTO xmm m128 -// Construct and append a MOVNTO instruction to the active function. -func (c *Context) MOVNTO(x, m operand.Op) { - if inst, err := x86.MOVNTO(x, m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVNTO: Store Double Quadword Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTO xmm m128 -// Construct and append a MOVNTO instruction to the active function. -// Operates on the global context. -func MOVNTO(x, m operand.Op) { ctx.MOVNTO(x, m) } - -// MOVNTPD: Store Packed Double-Precision Floating-Point Values Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTPD xmm m128 -// Construct and append a MOVNTPD instruction to the active function. -func (c *Context) MOVNTPD(x, m operand.Op) { - if inst, err := x86.MOVNTPD(x, m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVNTPD: Store Packed Double-Precision Floating-Point Values Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTPD xmm m128 -// Construct and append a MOVNTPD instruction to the active function. -// Operates on the global context. -func MOVNTPD(x, m operand.Op) { ctx.MOVNTPD(x, m) } - -// MOVNTPS: Store Packed Single-Precision Floating-Point Values Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTPS xmm m128 -// Construct and append a MOVNTPS instruction to the active function. -func (c *Context) MOVNTPS(x, m operand.Op) { - if inst, err := x86.MOVNTPS(x, m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVNTPS: Store Packed Single-Precision Floating-Point Values Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTPS xmm m128 -// Construct and append a MOVNTPS instruction to the active function. -// Operates on the global context. -func MOVNTPS(x, m operand.Op) { ctx.MOVNTPS(x, m) } - -// MOVO: Move Aligned Double Quadword. -// -// Forms: -// -// MOVO xmm xmm -// MOVO m128 xmm -// MOVO xmm m128 -// Construct and append a MOVO instruction to the active function. -func (c *Context) MOVO(mx, mx1 operand.Op) { - if inst, err := x86.MOVO(mx, mx1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVO: Move Aligned Double Quadword. -// -// Forms: -// -// MOVO xmm xmm -// MOVO m128 xmm -// MOVO xmm m128 -// Construct and append a MOVO instruction to the active function. -// Operates on the global context. -func MOVO(mx, mx1 operand.Op) { ctx.MOVO(mx, mx1) } - -// MOVOA: Move Aligned Double Quadword. -// -// Forms: -// -// MOVOA xmm xmm -// MOVOA m128 xmm -// MOVOA xmm m128 -// Construct and append a MOVOA instruction to the active function. -func (c *Context) MOVOA(mx, mx1 operand.Op) { - if inst, err := x86.MOVOA(mx, mx1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVOA: Move Aligned Double Quadword. -// -// Forms: -// -// MOVOA xmm xmm -// MOVOA m128 xmm -// MOVOA xmm m128 -// Construct and append a MOVOA instruction to the active function. -// Operates on the global context. -func MOVOA(mx, mx1 operand.Op) { ctx.MOVOA(mx, mx1) } - -// MOVOU: Move Unaligned Double Quadword. -// -// Forms: -// -// MOVOU xmm xmm -// MOVOU m128 xmm -// MOVOU xmm m128 -// Construct and append a MOVOU instruction to the active function. -func (c *Context) MOVOU(mx, mx1 operand.Op) { - if inst, err := x86.MOVOU(mx, mx1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVOU: Move Unaligned Double Quadword. -// -// Forms: -// -// MOVOU xmm xmm -// MOVOU m128 xmm -// MOVOU xmm m128 -// Construct and append a MOVOU instruction to the active function. -// Operates on the global context. -func MOVOU(mx, mx1 operand.Op) { ctx.MOVOU(mx, mx1) } - -// MOVQ: Move. -// -// Forms: -// -// MOVQ imm32 r64 -// MOVQ imm64 r64 -// MOVQ r64 r64 -// MOVQ m64 r64 -// MOVQ imm32 m64 -// MOVQ r64 m64 -// MOVQ xmm r64 -// MOVQ r64 xmm -// MOVQ xmm xmm -// MOVQ m64 xmm -// MOVQ xmm m64 -// MOVQ xmm r32 -// MOVQ r32 xmm -// MOVQ m32 xmm -// MOVQ xmm m32 -// Construct and append a MOVQ instruction to the active function. -func (c *Context) MOVQ(imrx, mrx operand.Op) { - if inst, err := x86.MOVQ(imrx, mrx); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVQ: Move. -// -// Forms: -// -// MOVQ imm32 r64 -// MOVQ imm64 r64 -// MOVQ r64 r64 -// MOVQ m64 r64 -// MOVQ imm32 m64 -// MOVQ r64 m64 -// MOVQ xmm r64 -// MOVQ r64 xmm -// MOVQ xmm xmm -// MOVQ m64 xmm -// MOVQ xmm m64 -// MOVQ xmm r32 -// MOVQ r32 xmm -// MOVQ m32 xmm -// MOVQ xmm m32 -// Construct and append a MOVQ instruction to the active function. -// Operates on the global context. -func MOVQ(imrx, mrx operand.Op) { ctx.MOVQ(imrx, mrx) } - -// MOVSD: Move Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// MOVSD xmm xmm -// MOVSD m64 xmm -// MOVSD xmm m64 -// Construct and append a MOVSD instruction to the active function. -func (c *Context) MOVSD(mx, mx1 operand.Op) { - if inst, err := x86.MOVSD(mx, mx1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVSD: Move Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// MOVSD xmm xmm -// MOVSD m64 xmm -// MOVSD xmm m64 -// Construct and append a MOVSD instruction to the active function. -// Operates on the global context. -func MOVSD(mx, mx1 operand.Op) { ctx.MOVSD(mx, mx1) } - -// MOVSHDUP: Move Packed Single-FP High and Duplicate. -// -// Forms: -// -// MOVSHDUP xmm xmm -// MOVSHDUP m128 xmm -// Construct and append a MOVSHDUP instruction to the active function. -func (c *Context) MOVSHDUP(mx, x operand.Op) { - if inst, err := x86.MOVSHDUP(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVSHDUP: Move Packed Single-FP High and Duplicate. -// -// Forms: -// -// MOVSHDUP xmm xmm -// MOVSHDUP m128 xmm -// Construct and append a MOVSHDUP instruction to the active function. -// Operates on the global context. -func MOVSHDUP(mx, x operand.Op) { ctx.MOVSHDUP(mx, x) } - -// MOVSLDUP: Move Packed Single-FP Low and Duplicate. -// -// Forms: -// -// MOVSLDUP xmm xmm -// MOVSLDUP m128 xmm -// Construct and append a MOVSLDUP instruction to the active function. -func (c *Context) MOVSLDUP(mx, x operand.Op) { - if inst, err := x86.MOVSLDUP(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVSLDUP: Move Packed Single-FP Low and Duplicate. -// -// Forms: -// -// MOVSLDUP xmm xmm -// MOVSLDUP m128 xmm -// Construct and append a MOVSLDUP instruction to the active function. -// Operates on the global context. -func MOVSLDUP(mx, x operand.Op) { ctx.MOVSLDUP(mx, x) } - -// MOVSS: Move Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// MOVSS xmm xmm -// MOVSS m32 xmm -// MOVSS xmm m32 -// Construct and append a MOVSS instruction to the active function. -func (c *Context) MOVSS(mx, mx1 operand.Op) { - if inst, err := x86.MOVSS(mx, mx1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVSS: Move Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// MOVSS xmm xmm -// MOVSS m32 xmm -// MOVSS xmm m32 -// Construct and append a MOVSS instruction to the active function. -// Operates on the global context. -func MOVSS(mx, mx1 operand.Op) { ctx.MOVSS(mx, mx1) } - -// MOVUPD: Move Unaligned Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// MOVUPD xmm xmm -// MOVUPD m128 xmm -// MOVUPD xmm m128 -// Construct and append a MOVUPD instruction to the active function. -func (c *Context) MOVUPD(mx, mx1 operand.Op) { - if inst, err := x86.MOVUPD(mx, mx1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVUPD: Move Unaligned Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// MOVUPD xmm xmm -// MOVUPD m128 xmm -// MOVUPD xmm m128 -// Construct and append a MOVUPD instruction to the active function. -// Operates on the global context. -func MOVUPD(mx, mx1 operand.Op) { ctx.MOVUPD(mx, mx1) } - -// MOVUPS: Move Unaligned Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MOVUPS xmm xmm -// MOVUPS m128 xmm -// MOVUPS xmm m128 -// Construct and append a MOVUPS instruction to the active function. -func (c *Context) MOVUPS(mx, mx1 operand.Op) { - if inst, err := x86.MOVUPS(mx, mx1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVUPS: Move Unaligned Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MOVUPS xmm xmm -// MOVUPS m128 xmm -// MOVUPS xmm m128 -// Construct and append a MOVUPS instruction to the active function. -// Operates on the global context. -func MOVUPS(mx, mx1 operand.Op) { ctx.MOVUPS(mx, mx1) } - -// MOVW: Move. -// -// Forms: -// -// MOVW imm16 r16 -// MOVW r16 r16 -// MOVW m16 r16 -// MOVW imm16 m16 -// MOVW r16 m16 -// Construct and append a MOVW instruction to the active function. -func (c *Context) MOVW(imr, mr operand.Op) { - if inst, err := x86.MOVW(imr, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVW: Move. -// -// Forms: -// -// MOVW imm16 r16 -// MOVW r16 r16 -// MOVW m16 r16 -// MOVW imm16 m16 -// MOVW r16 m16 -// Construct and append a MOVW instruction to the active function. -// Operates on the global context. -func MOVW(imr, mr operand.Op) { ctx.MOVW(imr, mr) } - -// MOVWLSX: Move with Sign-Extension. -// -// Forms: -// -// MOVWLSX r16 r32 -// MOVWLSX m16 r32 -// Construct and append a MOVWLSX instruction to the active function. -func (c *Context) MOVWLSX(mr, r operand.Op) { - if inst, err := x86.MOVWLSX(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVWLSX: Move with Sign-Extension. -// -// Forms: -// -// MOVWLSX r16 r32 -// MOVWLSX m16 r32 -// Construct and append a MOVWLSX instruction to the active function. -// Operates on the global context. -func MOVWLSX(mr, r operand.Op) { ctx.MOVWLSX(mr, r) } - -// MOVWLZX: Move with Zero-Extend. -// -// Forms: -// -// MOVWLZX r16 r32 -// MOVWLZX m16 r32 -// Construct and append a MOVWLZX instruction to the active function. -func (c *Context) MOVWLZX(mr, r operand.Op) { - if inst, err := x86.MOVWLZX(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVWLZX: Move with Zero-Extend. -// -// Forms: -// -// MOVWLZX r16 r32 -// MOVWLZX m16 r32 -// Construct and append a MOVWLZX instruction to the active function. -// Operates on the global context. -func MOVWLZX(mr, r operand.Op) { ctx.MOVWLZX(mr, r) } - -// MOVWQSX: Move with Sign-Extension. -// -// Forms: -// -// MOVWQSX r16 r64 -// MOVWQSX m16 r64 -// Construct and append a MOVWQSX instruction to the active function. -func (c *Context) MOVWQSX(mr, r operand.Op) { - if inst, err := x86.MOVWQSX(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVWQSX: Move with Sign-Extension. -// -// Forms: -// -// MOVWQSX r16 r64 -// MOVWQSX m16 r64 -// Construct and append a MOVWQSX instruction to the active function. -// Operates on the global context. -func MOVWQSX(mr, r operand.Op) { ctx.MOVWQSX(mr, r) } - -// MOVWQZX: Move with Zero-Extend. -// -// Forms: -// -// MOVWQZX r16 r64 -// MOVWQZX m16 r64 -// Construct and append a MOVWQZX instruction to the active function. -func (c *Context) MOVWQZX(mr, r operand.Op) { - if inst, err := x86.MOVWQZX(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MOVWQZX: Move with Zero-Extend. -// -// Forms: -// -// MOVWQZX r16 r64 -// MOVWQZX m16 r64 -// Construct and append a MOVWQZX instruction to the active function. -// Operates on the global context. -func MOVWQZX(mr, r operand.Op) { ctx.MOVWQZX(mr, r) } - -// MPSADBW: Compute Multiple Packed Sums of Absolute Difference. -// -// Forms: -// -// MPSADBW imm8 xmm xmm -// MPSADBW imm8 m128 xmm -// Construct and append a MPSADBW instruction to the active function. -func (c *Context) MPSADBW(i, mx, x operand.Op) { - if inst, err := x86.MPSADBW(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MPSADBW: Compute Multiple Packed Sums of Absolute Difference. -// -// Forms: -// -// MPSADBW imm8 xmm xmm -// MPSADBW imm8 m128 xmm -// Construct and append a MPSADBW instruction to the active function. -// Operates on the global context. -func MPSADBW(i, mx, x operand.Op) { ctx.MPSADBW(i, mx, x) } - -// MULB: Unsigned Multiply. -// -// Forms: -// -// MULB r8 -// MULB m8 -// Construct and append a MULB instruction to the active function. -func (c *Context) MULB(mr operand.Op) { - if inst, err := x86.MULB(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MULB: Unsigned Multiply. -// -// Forms: -// -// MULB r8 -// MULB m8 -// Construct and append a MULB instruction to the active function. -// Operates on the global context. -func MULB(mr operand.Op) { ctx.MULB(mr) } - -// MULL: Unsigned Multiply. -// -// Forms: -// -// MULL r32 -// MULL m32 -// Construct and append a MULL instruction to the active function. -func (c *Context) MULL(mr operand.Op) { - if inst, err := x86.MULL(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MULL: Unsigned Multiply. -// -// Forms: -// -// MULL r32 -// MULL m32 -// Construct and append a MULL instruction to the active function. -// Operates on the global context. -func MULL(mr operand.Op) { ctx.MULL(mr) } - -// MULPD: Multiply Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// MULPD xmm xmm -// MULPD m128 xmm -// Construct and append a MULPD instruction to the active function. -func (c *Context) MULPD(mx, x operand.Op) { - if inst, err := x86.MULPD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MULPD: Multiply Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// MULPD xmm xmm -// MULPD m128 xmm -// Construct and append a MULPD instruction to the active function. -// Operates on the global context. -func MULPD(mx, x operand.Op) { ctx.MULPD(mx, x) } - -// MULPS: Multiply Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MULPS xmm xmm -// MULPS m128 xmm -// Construct and append a MULPS instruction to the active function. -func (c *Context) MULPS(mx, x operand.Op) { - if inst, err := x86.MULPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MULPS: Multiply Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MULPS xmm xmm -// MULPS m128 xmm -// Construct and append a MULPS instruction to the active function. -// Operates on the global context. -func MULPS(mx, x operand.Op) { ctx.MULPS(mx, x) } - -// MULQ: Unsigned Multiply. -// -// Forms: -// -// MULQ r64 -// MULQ m64 -// Construct and append a MULQ instruction to the active function. -func (c *Context) MULQ(mr operand.Op) { - if inst, err := x86.MULQ(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MULQ: Unsigned Multiply. -// -// Forms: -// -// MULQ r64 -// MULQ m64 -// Construct and append a MULQ instruction to the active function. -// Operates on the global context. -func MULQ(mr operand.Op) { ctx.MULQ(mr) } - -// MULSD: Multiply Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// MULSD xmm xmm -// MULSD m64 xmm -// Construct and append a MULSD instruction to the active function. -func (c *Context) MULSD(mx, x operand.Op) { - if inst, err := x86.MULSD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MULSD: Multiply Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// MULSD xmm xmm -// MULSD m64 xmm -// Construct and append a MULSD instruction to the active function. -// Operates on the global context. -func MULSD(mx, x operand.Op) { ctx.MULSD(mx, x) } - -// MULSS: Multiply Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// MULSS xmm xmm -// MULSS m32 xmm -// Construct and append a MULSS instruction to the active function. -func (c *Context) MULSS(mx, x operand.Op) { - if inst, err := x86.MULSS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MULSS: Multiply Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// MULSS xmm xmm -// MULSS m32 xmm -// Construct and append a MULSS instruction to the active function. -// Operates on the global context. -func MULSS(mx, x operand.Op) { ctx.MULSS(mx, x) } - -// MULW: Unsigned Multiply. -// -// Forms: -// -// MULW r16 -// MULW m16 -// Construct and append a MULW instruction to the active function. -func (c *Context) MULW(mr operand.Op) { - if inst, err := x86.MULW(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MULW: Unsigned Multiply. -// -// Forms: -// -// MULW r16 -// MULW m16 -// Construct and append a MULW instruction to the active function. -// Operates on the global context. -func MULW(mr operand.Op) { ctx.MULW(mr) } - -// MULXL: Unsigned Multiply Without Affecting Flags. -// -// Forms: -// -// MULXL r32 r32 r32 -// MULXL m32 r32 r32 -// Construct and append a MULXL instruction to the active function. -func (c *Context) MULXL(mr, r, r1 operand.Op) { - if inst, err := x86.MULXL(mr, r, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MULXL: Unsigned Multiply Without Affecting Flags. -// -// Forms: -// -// MULXL r32 r32 r32 -// MULXL m32 r32 r32 -// Construct and append a MULXL instruction to the active function. -// Operates on the global context. -func MULXL(mr, r, r1 operand.Op) { ctx.MULXL(mr, r, r1) } - -// MULXQ: Unsigned Multiply Without Affecting Flags. -// -// Forms: -// -// MULXQ r64 r64 r64 -// MULXQ m64 r64 r64 -// Construct and append a MULXQ instruction to the active function. -func (c *Context) MULXQ(mr, r, r1 operand.Op) { - if inst, err := x86.MULXQ(mr, r, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MULXQ: Unsigned Multiply Without Affecting Flags. -// -// Forms: -// -// MULXQ r64 r64 r64 -// MULXQ m64 r64 r64 -// Construct and append a MULXQ instruction to the active function. -// Operates on the global context. -func MULXQ(mr, r, r1 operand.Op) { ctx.MULXQ(mr, r, r1) } - -// MWAIT: Monitor Wait. -// -// Forms: -// -// MWAIT -// Construct and append a MWAIT instruction to the active function. -func (c *Context) MWAIT() { - if inst, err := x86.MWAIT(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// MWAIT: Monitor Wait. -// -// Forms: -// -// MWAIT -// Construct and append a MWAIT instruction to the active function. -// Operates on the global context. -func MWAIT() { ctx.MWAIT() } - -// NEGB: Two's Complement Negation. -// -// Forms: -// -// NEGB r8 -// NEGB m8 -// Construct and append a NEGB instruction to the active function. -func (c *Context) NEGB(mr operand.Op) { - if inst, err := x86.NEGB(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// NEGB: Two's Complement Negation. -// -// Forms: -// -// NEGB r8 -// NEGB m8 -// Construct and append a NEGB instruction to the active function. -// Operates on the global context. -func NEGB(mr operand.Op) { ctx.NEGB(mr) } - -// NEGL: Two's Complement Negation. -// -// Forms: -// -// NEGL r32 -// NEGL m32 -// Construct and append a NEGL instruction to the active function. -func (c *Context) NEGL(mr operand.Op) { - if inst, err := x86.NEGL(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// NEGL: Two's Complement Negation. -// -// Forms: -// -// NEGL r32 -// NEGL m32 -// Construct and append a NEGL instruction to the active function. -// Operates on the global context. -func NEGL(mr operand.Op) { ctx.NEGL(mr) } - -// NEGQ: Two's Complement Negation. -// -// Forms: -// -// NEGQ r64 -// NEGQ m64 -// Construct and append a NEGQ instruction to the active function. -func (c *Context) NEGQ(mr operand.Op) { - if inst, err := x86.NEGQ(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// NEGQ: Two's Complement Negation. -// -// Forms: -// -// NEGQ r64 -// NEGQ m64 -// Construct and append a NEGQ instruction to the active function. -// Operates on the global context. -func NEGQ(mr operand.Op) { ctx.NEGQ(mr) } - -// NEGW: Two's Complement Negation. -// -// Forms: -// -// NEGW r16 -// NEGW m16 -// Construct and append a NEGW instruction to the active function. -func (c *Context) NEGW(mr operand.Op) { - if inst, err := x86.NEGW(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// NEGW: Two's Complement Negation. -// -// Forms: -// -// NEGW r16 -// NEGW m16 -// Construct and append a NEGW instruction to the active function. -// Operates on the global context. -func NEGW(mr operand.Op) { ctx.NEGW(mr) } - -// NOP: No Operation. -// -// Forms: -// -// NOP -// Construct and append a NOP instruction to the active function. -func (c *Context) NOP() { - if inst, err := x86.NOP(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// NOP: No Operation. -// -// Forms: -// -// NOP -// Construct and append a NOP instruction to the active function. -// Operates on the global context. -func NOP() { ctx.NOP() } - -// NOTB: One's Complement Negation. -// -// Forms: -// -// NOTB r8 -// NOTB m8 -// Construct and append a NOTB instruction to the active function. -func (c *Context) NOTB(mr operand.Op) { - if inst, err := x86.NOTB(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// NOTB: One's Complement Negation. -// -// Forms: -// -// NOTB r8 -// NOTB m8 -// Construct and append a NOTB instruction to the active function. -// Operates on the global context. -func NOTB(mr operand.Op) { ctx.NOTB(mr) } - -// NOTL: One's Complement Negation. -// -// Forms: -// -// NOTL r32 -// NOTL m32 -// Construct and append a NOTL instruction to the active function. -func (c *Context) NOTL(mr operand.Op) { - if inst, err := x86.NOTL(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// NOTL: One's Complement Negation. -// -// Forms: -// -// NOTL r32 -// NOTL m32 -// Construct and append a NOTL instruction to the active function. -// Operates on the global context. -func NOTL(mr operand.Op) { ctx.NOTL(mr) } - -// NOTQ: One's Complement Negation. -// -// Forms: -// -// NOTQ r64 -// NOTQ m64 -// Construct and append a NOTQ instruction to the active function. -func (c *Context) NOTQ(mr operand.Op) { - if inst, err := x86.NOTQ(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// NOTQ: One's Complement Negation. -// -// Forms: -// -// NOTQ r64 -// NOTQ m64 -// Construct and append a NOTQ instruction to the active function. -// Operates on the global context. -func NOTQ(mr operand.Op) { ctx.NOTQ(mr) } - -// NOTW: One's Complement Negation. -// -// Forms: -// -// NOTW r16 -// NOTW m16 -// Construct and append a NOTW instruction to the active function. -func (c *Context) NOTW(mr operand.Op) { - if inst, err := x86.NOTW(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// NOTW: One's Complement Negation. -// -// Forms: -// -// NOTW r16 -// NOTW m16 -// Construct and append a NOTW instruction to the active function. -// Operates on the global context. -func NOTW(mr operand.Op) { ctx.NOTW(mr) } - -// ORB: Logical Inclusive OR. -// -// Forms: -// -// ORB imm8 al -// ORB imm8 r8 -// ORB r8 r8 -// ORB m8 r8 -// ORB imm8 m8 -// ORB r8 m8 -// Construct and append a ORB instruction to the active function. -func (c *Context) ORB(imr, amr operand.Op) { - if inst, err := x86.ORB(imr, amr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ORB: Logical Inclusive OR. -// -// Forms: -// -// ORB imm8 al -// ORB imm8 r8 -// ORB r8 r8 -// ORB m8 r8 -// ORB imm8 m8 -// ORB r8 m8 -// Construct and append a ORB instruction to the active function. -// Operates on the global context. -func ORB(imr, amr operand.Op) { ctx.ORB(imr, amr) } - -// ORL: Logical Inclusive OR. -// -// Forms: -// -// ORL imm32 eax -// ORL imm8 r32 -// ORL imm32 r32 -// ORL r32 r32 -// ORL m32 r32 -// ORL imm8 m32 -// ORL imm32 m32 -// ORL r32 m32 -// Construct and append a ORL instruction to the active function. -func (c *Context) ORL(imr, emr operand.Op) { - if inst, err := x86.ORL(imr, emr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ORL: Logical Inclusive OR. -// -// Forms: -// -// ORL imm32 eax -// ORL imm8 r32 -// ORL imm32 r32 -// ORL r32 r32 -// ORL m32 r32 -// ORL imm8 m32 -// ORL imm32 m32 -// ORL r32 m32 -// Construct and append a ORL instruction to the active function. -// Operates on the global context. -func ORL(imr, emr operand.Op) { ctx.ORL(imr, emr) } - -// ORPD: Bitwise Logical OR of Double-Precision Floating-Point Values. -// -// Forms: -// -// ORPD xmm xmm -// ORPD m128 xmm -// Construct and append a ORPD instruction to the active function. -func (c *Context) ORPD(mx, x operand.Op) { - if inst, err := x86.ORPD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ORPD: Bitwise Logical OR of Double-Precision Floating-Point Values. -// -// Forms: -// -// ORPD xmm xmm -// ORPD m128 xmm -// Construct and append a ORPD instruction to the active function. -// Operates on the global context. -func ORPD(mx, x operand.Op) { ctx.ORPD(mx, x) } - -// ORPS: Bitwise Logical OR of Single-Precision Floating-Point Values. -// -// Forms: -// -// ORPS xmm xmm -// ORPS m128 xmm -// Construct and append a ORPS instruction to the active function. -func (c *Context) ORPS(mx, x operand.Op) { - if inst, err := x86.ORPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ORPS: Bitwise Logical OR of Single-Precision Floating-Point Values. -// -// Forms: -// -// ORPS xmm xmm -// ORPS m128 xmm -// Construct and append a ORPS instruction to the active function. -// Operates on the global context. -func ORPS(mx, x operand.Op) { ctx.ORPS(mx, x) } - -// ORQ: Logical Inclusive OR. -// -// Forms: -// -// ORQ imm32 rax -// ORQ imm8 r64 -// ORQ imm32 r64 -// ORQ r64 r64 -// ORQ m64 r64 -// ORQ imm8 m64 -// ORQ imm32 m64 -// ORQ r64 m64 -// Construct and append a ORQ instruction to the active function. -func (c *Context) ORQ(imr, mr operand.Op) { - if inst, err := x86.ORQ(imr, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ORQ: Logical Inclusive OR. -// -// Forms: -// -// ORQ imm32 rax -// ORQ imm8 r64 -// ORQ imm32 r64 -// ORQ r64 r64 -// ORQ m64 r64 -// ORQ imm8 m64 -// ORQ imm32 m64 -// ORQ r64 m64 -// Construct and append a ORQ instruction to the active function. -// Operates on the global context. -func ORQ(imr, mr operand.Op) { ctx.ORQ(imr, mr) } - -// ORW: Logical Inclusive OR. -// -// Forms: -// -// ORW imm16 ax -// ORW imm8 r16 -// ORW imm16 r16 -// ORW r16 r16 -// ORW m16 r16 -// ORW imm8 m16 -// ORW imm16 m16 -// ORW r16 m16 -// Construct and append a ORW instruction to the active function. -func (c *Context) ORW(imr, amr operand.Op) { - if inst, err := x86.ORW(imr, amr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ORW: Logical Inclusive OR. -// -// Forms: -// -// ORW imm16 ax -// ORW imm8 r16 -// ORW imm16 r16 -// ORW r16 r16 -// ORW m16 r16 -// ORW imm8 m16 -// ORW imm16 m16 -// ORW r16 m16 -// Construct and append a ORW instruction to the active function. -// Operates on the global context. -func ORW(imr, amr operand.Op) { ctx.ORW(imr, amr) } - -// PABSB: Packed Absolute Value of Byte Integers. -// -// Forms: -// -// PABSB xmm xmm -// PABSB m128 xmm -// Construct and append a PABSB instruction to the active function. -func (c *Context) PABSB(mx, x operand.Op) { - if inst, err := x86.PABSB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PABSB: Packed Absolute Value of Byte Integers. -// -// Forms: -// -// PABSB xmm xmm -// PABSB m128 xmm -// Construct and append a PABSB instruction to the active function. -// Operates on the global context. -func PABSB(mx, x operand.Op) { ctx.PABSB(mx, x) } - -// PABSD: Packed Absolute Value of Doubleword Integers. -// -// Forms: -// -// PABSD xmm xmm -// PABSD m128 xmm -// Construct and append a PABSD instruction to the active function. -func (c *Context) PABSD(mx, x operand.Op) { - if inst, err := x86.PABSD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PABSD: Packed Absolute Value of Doubleword Integers. -// -// Forms: -// -// PABSD xmm xmm -// PABSD m128 xmm -// Construct and append a PABSD instruction to the active function. -// Operates on the global context. -func PABSD(mx, x operand.Op) { ctx.PABSD(mx, x) } - -// PABSW: Packed Absolute Value of Word Integers. -// -// Forms: -// -// PABSW xmm xmm -// PABSW m128 xmm -// Construct and append a PABSW instruction to the active function. -func (c *Context) PABSW(mx, x operand.Op) { - if inst, err := x86.PABSW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PABSW: Packed Absolute Value of Word Integers. -// -// Forms: -// -// PABSW xmm xmm -// PABSW m128 xmm -// Construct and append a PABSW instruction to the active function. -// Operates on the global context. -func PABSW(mx, x operand.Op) { ctx.PABSW(mx, x) } - -// PACKSSLW: Pack Doublewords into Words with Signed Saturation. -// -// Forms: -// -// PACKSSLW xmm xmm -// PACKSSLW m128 xmm -// Construct and append a PACKSSLW instruction to the active function. -func (c *Context) PACKSSLW(mx, x operand.Op) { - if inst, err := x86.PACKSSLW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PACKSSLW: Pack Doublewords into Words with Signed Saturation. -// -// Forms: -// -// PACKSSLW xmm xmm -// PACKSSLW m128 xmm -// Construct and append a PACKSSLW instruction to the active function. -// Operates on the global context. -func PACKSSLW(mx, x operand.Op) { ctx.PACKSSLW(mx, x) } - -// PACKSSWB: Pack Words into Bytes with Signed Saturation. -// -// Forms: -// -// PACKSSWB xmm xmm -// PACKSSWB m128 xmm -// Construct and append a PACKSSWB instruction to the active function. -func (c *Context) PACKSSWB(mx, x operand.Op) { - if inst, err := x86.PACKSSWB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PACKSSWB: Pack Words into Bytes with Signed Saturation. -// -// Forms: -// -// PACKSSWB xmm xmm -// PACKSSWB m128 xmm -// Construct and append a PACKSSWB instruction to the active function. -// Operates on the global context. -func PACKSSWB(mx, x operand.Op) { ctx.PACKSSWB(mx, x) } - -// PACKUSDW: Pack Doublewords into Words with Unsigned Saturation. -// -// Forms: -// -// PACKUSDW xmm xmm -// PACKUSDW m128 xmm -// Construct and append a PACKUSDW instruction to the active function. -func (c *Context) PACKUSDW(mx, x operand.Op) { - if inst, err := x86.PACKUSDW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PACKUSDW: Pack Doublewords into Words with Unsigned Saturation. -// -// Forms: -// -// PACKUSDW xmm xmm -// PACKUSDW m128 xmm -// Construct and append a PACKUSDW instruction to the active function. -// Operates on the global context. -func PACKUSDW(mx, x operand.Op) { ctx.PACKUSDW(mx, x) } - -// PACKUSWB: Pack Words into Bytes with Unsigned Saturation. -// -// Forms: -// -// PACKUSWB xmm xmm -// PACKUSWB m128 xmm -// Construct and append a PACKUSWB instruction to the active function. -func (c *Context) PACKUSWB(mx, x operand.Op) { - if inst, err := x86.PACKUSWB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PACKUSWB: Pack Words into Bytes with Unsigned Saturation. -// -// Forms: -// -// PACKUSWB xmm xmm -// PACKUSWB m128 xmm -// Construct and append a PACKUSWB instruction to the active function. -// Operates on the global context. -func PACKUSWB(mx, x operand.Op) { ctx.PACKUSWB(mx, x) } - -// PADDB: Add Packed Byte Integers. -// -// Forms: -// -// PADDB xmm xmm -// PADDB m128 xmm -// Construct and append a PADDB instruction to the active function. -func (c *Context) PADDB(mx, x operand.Op) { - if inst, err := x86.PADDB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PADDB: Add Packed Byte Integers. -// -// Forms: -// -// PADDB xmm xmm -// PADDB m128 xmm -// Construct and append a PADDB instruction to the active function. -// Operates on the global context. -func PADDB(mx, x operand.Op) { ctx.PADDB(mx, x) } - -// PADDD: Add Packed Doubleword Integers. -// -// Forms: -// -// PADDD xmm xmm -// PADDD m128 xmm -// Construct and append a PADDD instruction to the active function. -func (c *Context) PADDD(mx, x operand.Op) { - if inst, err := x86.PADDD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PADDD: Add Packed Doubleword Integers. -// -// Forms: -// -// PADDD xmm xmm -// PADDD m128 xmm -// Construct and append a PADDD instruction to the active function. -// Operates on the global context. -func PADDD(mx, x operand.Op) { ctx.PADDD(mx, x) } - -// PADDL: Add Packed Doubleword Integers. -// -// Forms: -// -// PADDL xmm xmm -// PADDL m128 xmm -// Construct and append a PADDL instruction to the active function. -func (c *Context) PADDL(mx, x operand.Op) { - if inst, err := x86.PADDL(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PADDL: Add Packed Doubleword Integers. -// -// Forms: -// -// PADDL xmm xmm -// PADDL m128 xmm -// Construct and append a PADDL instruction to the active function. -// Operates on the global context. -func PADDL(mx, x operand.Op) { ctx.PADDL(mx, x) } - -// PADDQ: Add Packed Quadword Integers. -// -// Forms: -// -// PADDQ xmm xmm -// PADDQ m128 xmm -// Construct and append a PADDQ instruction to the active function. -func (c *Context) PADDQ(mx, x operand.Op) { - if inst, err := x86.PADDQ(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PADDQ: Add Packed Quadword Integers. -// -// Forms: -// -// PADDQ xmm xmm -// PADDQ m128 xmm -// Construct and append a PADDQ instruction to the active function. -// Operates on the global context. -func PADDQ(mx, x operand.Op) { ctx.PADDQ(mx, x) } - -// PADDSB: Add Packed Signed Byte Integers with Signed Saturation. -// -// Forms: -// -// PADDSB xmm xmm -// PADDSB m128 xmm -// Construct and append a PADDSB instruction to the active function. -func (c *Context) PADDSB(mx, x operand.Op) { - if inst, err := x86.PADDSB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PADDSB: Add Packed Signed Byte Integers with Signed Saturation. -// -// Forms: -// -// PADDSB xmm xmm -// PADDSB m128 xmm -// Construct and append a PADDSB instruction to the active function. -// Operates on the global context. -func PADDSB(mx, x operand.Op) { ctx.PADDSB(mx, x) } - -// PADDSW: Add Packed Signed Word Integers with Signed Saturation. -// -// Forms: -// -// PADDSW xmm xmm -// PADDSW m128 xmm -// Construct and append a PADDSW instruction to the active function. -func (c *Context) PADDSW(mx, x operand.Op) { - if inst, err := x86.PADDSW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PADDSW: Add Packed Signed Word Integers with Signed Saturation. -// -// Forms: -// -// PADDSW xmm xmm -// PADDSW m128 xmm -// Construct and append a PADDSW instruction to the active function. -// Operates on the global context. -func PADDSW(mx, x operand.Op) { ctx.PADDSW(mx, x) } - -// PADDUSB: Add Packed Unsigned Byte Integers with Unsigned Saturation. -// -// Forms: -// -// PADDUSB xmm xmm -// PADDUSB m128 xmm -// Construct and append a PADDUSB instruction to the active function. -func (c *Context) PADDUSB(mx, x operand.Op) { - if inst, err := x86.PADDUSB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PADDUSB: Add Packed Unsigned Byte Integers with Unsigned Saturation. -// -// Forms: -// -// PADDUSB xmm xmm -// PADDUSB m128 xmm -// Construct and append a PADDUSB instruction to the active function. -// Operates on the global context. -func PADDUSB(mx, x operand.Op) { ctx.PADDUSB(mx, x) } - -// PADDUSW: Add Packed Unsigned Word Integers with Unsigned Saturation. -// -// Forms: -// -// PADDUSW xmm xmm -// PADDUSW m128 xmm -// Construct and append a PADDUSW instruction to the active function. -func (c *Context) PADDUSW(mx, x operand.Op) { - if inst, err := x86.PADDUSW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PADDUSW: Add Packed Unsigned Word Integers with Unsigned Saturation. -// -// Forms: -// -// PADDUSW xmm xmm -// PADDUSW m128 xmm -// Construct and append a PADDUSW instruction to the active function. -// Operates on the global context. -func PADDUSW(mx, x operand.Op) { ctx.PADDUSW(mx, x) } - -// PADDW: Add Packed Word Integers. -// -// Forms: -// -// PADDW xmm xmm -// PADDW m128 xmm -// Construct and append a PADDW instruction to the active function. -func (c *Context) PADDW(mx, x operand.Op) { - if inst, err := x86.PADDW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PADDW: Add Packed Word Integers. -// -// Forms: -// -// PADDW xmm xmm -// PADDW m128 xmm -// Construct and append a PADDW instruction to the active function. -// Operates on the global context. -func PADDW(mx, x operand.Op) { ctx.PADDW(mx, x) } - -// PALIGNR: Packed Align Right. -// -// Forms: -// -// PALIGNR imm8 xmm xmm -// PALIGNR imm8 m128 xmm -// Construct and append a PALIGNR instruction to the active function. -func (c *Context) PALIGNR(i, mx, x operand.Op) { - if inst, err := x86.PALIGNR(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PALIGNR: Packed Align Right. -// -// Forms: -// -// PALIGNR imm8 xmm xmm -// PALIGNR imm8 m128 xmm -// Construct and append a PALIGNR instruction to the active function. -// Operates on the global context. -func PALIGNR(i, mx, x operand.Op) { ctx.PALIGNR(i, mx, x) } - -// PAND: Packed Bitwise Logical AND. -// -// Forms: -// -// PAND xmm xmm -// PAND m128 xmm -// Construct and append a PAND instruction to the active function. -func (c *Context) PAND(mx, x operand.Op) { - if inst, err := x86.PAND(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PAND: Packed Bitwise Logical AND. -// -// Forms: -// -// PAND xmm xmm -// PAND m128 xmm -// Construct and append a PAND instruction to the active function. -// Operates on the global context. -func PAND(mx, x operand.Op) { ctx.PAND(mx, x) } - -// PANDN: Packed Bitwise Logical AND NOT. -// -// Forms: -// -// PANDN xmm xmm -// PANDN m128 xmm -// Construct and append a PANDN instruction to the active function. -func (c *Context) PANDN(mx, x operand.Op) { - if inst, err := x86.PANDN(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PANDN: Packed Bitwise Logical AND NOT. -// -// Forms: -// -// PANDN xmm xmm -// PANDN m128 xmm -// Construct and append a PANDN instruction to the active function. -// Operates on the global context. -func PANDN(mx, x operand.Op) { ctx.PANDN(mx, x) } - -// PAUSE: Spin Loop Hint. -// -// Forms: -// -// PAUSE -// Construct and append a PAUSE instruction to the active function. -func (c *Context) PAUSE() { - if inst, err := x86.PAUSE(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PAUSE: Spin Loop Hint. -// -// Forms: -// -// PAUSE -// Construct and append a PAUSE instruction to the active function. -// Operates on the global context. -func PAUSE() { ctx.PAUSE() } - -// PAVGB: Average Packed Byte Integers. -// -// Forms: -// -// PAVGB xmm xmm -// PAVGB m128 xmm -// Construct and append a PAVGB instruction to the active function. -func (c *Context) PAVGB(mx, x operand.Op) { - if inst, err := x86.PAVGB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PAVGB: Average Packed Byte Integers. -// -// Forms: -// -// PAVGB xmm xmm -// PAVGB m128 xmm -// Construct and append a PAVGB instruction to the active function. -// Operates on the global context. -func PAVGB(mx, x operand.Op) { ctx.PAVGB(mx, x) } - -// PAVGW: Average Packed Word Integers. -// -// Forms: -// -// PAVGW xmm xmm -// PAVGW m128 xmm -// Construct and append a PAVGW instruction to the active function. -func (c *Context) PAVGW(mx, x operand.Op) { - if inst, err := x86.PAVGW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PAVGW: Average Packed Word Integers. -// -// Forms: -// -// PAVGW xmm xmm -// PAVGW m128 xmm -// Construct and append a PAVGW instruction to the active function. -// Operates on the global context. -func PAVGW(mx, x operand.Op) { ctx.PAVGW(mx, x) } - -// PBLENDVB: Variable Blend Packed Bytes. -// -// Forms: -// -// PBLENDVB xmm0 xmm xmm -// PBLENDVB xmm0 m128 xmm -// Construct and append a PBLENDVB instruction to the active function. -func (c *Context) PBLENDVB(x, mx, x1 operand.Op) { - if inst, err := x86.PBLENDVB(x, mx, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PBLENDVB: Variable Blend Packed Bytes. -// -// Forms: -// -// PBLENDVB xmm0 xmm xmm -// PBLENDVB xmm0 m128 xmm -// Construct and append a PBLENDVB instruction to the active function. -// Operates on the global context. -func PBLENDVB(x, mx, x1 operand.Op) { ctx.PBLENDVB(x, mx, x1) } - -// PBLENDW: Blend Packed Words. -// -// Forms: -// -// PBLENDW imm8 xmm xmm -// PBLENDW imm8 m128 xmm -// Construct and append a PBLENDW instruction to the active function. -func (c *Context) PBLENDW(i, mx, x operand.Op) { - if inst, err := x86.PBLENDW(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PBLENDW: Blend Packed Words. -// -// Forms: -// -// PBLENDW imm8 xmm xmm -// PBLENDW imm8 m128 xmm -// Construct and append a PBLENDW instruction to the active function. -// Operates on the global context. -func PBLENDW(i, mx, x operand.Op) { ctx.PBLENDW(i, mx, x) } - -// PCLMULQDQ: Carry-Less Quadword Multiplication. -// -// Forms: -// -// PCLMULQDQ imm8 xmm xmm -// PCLMULQDQ imm8 m128 xmm -// Construct and append a PCLMULQDQ instruction to the active function. -func (c *Context) PCLMULQDQ(i, mx, x operand.Op) { - if inst, err := x86.PCLMULQDQ(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PCLMULQDQ: Carry-Less Quadword Multiplication. -// -// Forms: -// -// PCLMULQDQ imm8 xmm xmm -// PCLMULQDQ imm8 m128 xmm -// Construct and append a PCLMULQDQ instruction to the active function. -// Operates on the global context. -func PCLMULQDQ(i, mx, x operand.Op) { ctx.PCLMULQDQ(i, mx, x) } - -// PCMPEQB: Compare Packed Byte Data for Equality. -// -// Forms: -// -// PCMPEQB xmm xmm -// PCMPEQB m128 xmm -// Construct and append a PCMPEQB instruction to the active function. -func (c *Context) PCMPEQB(mx, x operand.Op) { - if inst, err := x86.PCMPEQB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PCMPEQB: Compare Packed Byte Data for Equality. -// -// Forms: -// -// PCMPEQB xmm xmm -// PCMPEQB m128 xmm -// Construct and append a PCMPEQB instruction to the active function. -// Operates on the global context. -func PCMPEQB(mx, x operand.Op) { ctx.PCMPEQB(mx, x) } - -// PCMPEQL: Compare Packed Doubleword Data for Equality. -// -// Forms: -// -// PCMPEQL xmm xmm -// PCMPEQL m128 xmm -// Construct and append a PCMPEQL instruction to the active function. -func (c *Context) PCMPEQL(mx, x operand.Op) { - if inst, err := x86.PCMPEQL(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PCMPEQL: Compare Packed Doubleword Data for Equality. -// -// Forms: -// -// PCMPEQL xmm xmm -// PCMPEQL m128 xmm -// Construct and append a PCMPEQL instruction to the active function. -// Operates on the global context. -func PCMPEQL(mx, x operand.Op) { ctx.PCMPEQL(mx, x) } - -// PCMPEQQ: Compare Packed Quadword Data for Equality. -// -// Forms: -// -// PCMPEQQ xmm xmm -// PCMPEQQ m128 xmm -// Construct and append a PCMPEQQ instruction to the active function. -func (c *Context) PCMPEQQ(mx, x operand.Op) { - if inst, err := x86.PCMPEQQ(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PCMPEQQ: Compare Packed Quadword Data for Equality. -// -// Forms: -// -// PCMPEQQ xmm xmm -// PCMPEQQ m128 xmm -// Construct and append a PCMPEQQ instruction to the active function. -// Operates on the global context. -func PCMPEQQ(mx, x operand.Op) { ctx.PCMPEQQ(mx, x) } - -// PCMPEQW: Compare Packed Word Data for Equality. -// -// Forms: -// -// PCMPEQW xmm xmm -// PCMPEQW m128 xmm -// Construct and append a PCMPEQW instruction to the active function. -func (c *Context) PCMPEQW(mx, x operand.Op) { - if inst, err := x86.PCMPEQW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PCMPEQW: Compare Packed Word Data for Equality. -// -// Forms: -// -// PCMPEQW xmm xmm -// PCMPEQW m128 xmm -// Construct and append a PCMPEQW instruction to the active function. -// Operates on the global context. -func PCMPEQW(mx, x operand.Op) { ctx.PCMPEQW(mx, x) } - -// PCMPESTRI: Packed Compare Explicit Length Strings, Return Index. -// -// Forms: -// -// PCMPESTRI imm8 xmm xmm -// PCMPESTRI imm8 m128 xmm -// Construct and append a PCMPESTRI instruction to the active function. -func (c *Context) PCMPESTRI(i, mx, x operand.Op) { - if inst, err := x86.PCMPESTRI(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PCMPESTRI: Packed Compare Explicit Length Strings, Return Index. -// -// Forms: -// -// PCMPESTRI imm8 xmm xmm -// PCMPESTRI imm8 m128 xmm -// Construct and append a PCMPESTRI instruction to the active function. -// Operates on the global context. -func PCMPESTRI(i, mx, x operand.Op) { ctx.PCMPESTRI(i, mx, x) } - -// PCMPESTRM: Packed Compare Explicit Length Strings, Return Mask. -// -// Forms: -// -// PCMPESTRM imm8 xmm xmm -// PCMPESTRM imm8 m128 xmm -// Construct and append a PCMPESTRM instruction to the active function. -func (c *Context) PCMPESTRM(i, mx, x operand.Op) { - if inst, err := x86.PCMPESTRM(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PCMPESTRM: Packed Compare Explicit Length Strings, Return Mask. -// -// Forms: -// -// PCMPESTRM imm8 xmm xmm -// PCMPESTRM imm8 m128 xmm -// Construct and append a PCMPESTRM instruction to the active function. -// Operates on the global context. -func PCMPESTRM(i, mx, x operand.Op) { ctx.PCMPESTRM(i, mx, x) } - -// PCMPGTB: Compare Packed Signed Byte Integers for Greater Than. -// -// Forms: -// -// PCMPGTB xmm xmm -// PCMPGTB m128 xmm -// Construct and append a PCMPGTB instruction to the active function. -func (c *Context) PCMPGTB(mx, x operand.Op) { - if inst, err := x86.PCMPGTB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PCMPGTB: Compare Packed Signed Byte Integers for Greater Than. -// -// Forms: -// -// PCMPGTB xmm xmm -// PCMPGTB m128 xmm -// Construct and append a PCMPGTB instruction to the active function. -// Operates on the global context. -func PCMPGTB(mx, x operand.Op) { ctx.PCMPGTB(mx, x) } - -// PCMPGTL: Compare Packed Signed Doubleword Integers for Greater Than. -// -// Forms: -// -// PCMPGTL xmm xmm -// PCMPGTL m128 xmm -// Construct and append a PCMPGTL instruction to the active function. -func (c *Context) PCMPGTL(mx, x operand.Op) { - if inst, err := x86.PCMPGTL(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PCMPGTL: Compare Packed Signed Doubleword Integers for Greater Than. -// -// Forms: -// -// PCMPGTL xmm xmm -// PCMPGTL m128 xmm -// Construct and append a PCMPGTL instruction to the active function. -// Operates on the global context. -func PCMPGTL(mx, x operand.Op) { ctx.PCMPGTL(mx, x) } - -// PCMPGTQ: Compare Packed Data for Greater Than. -// -// Forms: -// -// PCMPGTQ xmm xmm -// PCMPGTQ m128 xmm -// Construct and append a PCMPGTQ instruction to the active function. -func (c *Context) PCMPGTQ(mx, x operand.Op) { - if inst, err := x86.PCMPGTQ(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PCMPGTQ: Compare Packed Data for Greater Than. -// -// Forms: -// -// PCMPGTQ xmm xmm -// PCMPGTQ m128 xmm -// Construct and append a PCMPGTQ instruction to the active function. -// Operates on the global context. -func PCMPGTQ(mx, x operand.Op) { ctx.PCMPGTQ(mx, x) } - -// PCMPGTW: Compare Packed Signed Word Integers for Greater Than. -// -// Forms: -// -// PCMPGTW xmm xmm -// PCMPGTW m128 xmm -// Construct and append a PCMPGTW instruction to the active function. -func (c *Context) PCMPGTW(mx, x operand.Op) { - if inst, err := x86.PCMPGTW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PCMPGTW: Compare Packed Signed Word Integers for Greater Than. -// -// Forms: -// -// PCMPGTW xmm xmm -// PCMPGTW m128 xmm -// Construct and append a PCMPGTW instruction to the active function. -// Operates on the global context. -func PCMPGTW(mx, x operand.Op) { ctx.PCMPGTW(mx, x) } - -// PCMPISTRI: Packed Compare Implicit Length Strings, Return Index. -// -// Forms: -// -// PCMPISTRI imm8 xmm xmm -// PCMPISTRI imm8 m128 xmm -// Construct and append a PCMPISTRI instruction to the active function. -func (c *Context) PCMPISTRI(i, mx, x operand.Op) { - if inst, err := x86.PCMPISTRI(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PCMPISTRI: Packed Compare Implicit Length Strings, Return Index. -// -// Forms: -// -// PCMPISTRI imm8 xmm xmm -// PCMPISTRI imm8 m128 xmm -// Construct and append a PCMPISTRI instruction to the active function. -// Operates on the global context. -func PCMPISTRI(i, mx, x operand.Op) { ctx.PCMPISTRI(i, mx, x) } - -// PCMPISTRM: Packed Compare Implicit Length Strings, Return Mask. -// -// Forms: -// -// PCMPISTRM imm8 xmm xmm -// PCMPISTRM imm8 m128 xmm -// Construct and append a PCMPISTRM instruction to the active function. -func (c *Context) PCMPISTRM(i, mx, x operand.Op) { - if inst, err := x86.PCMPISTRM(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PCMPISTRM: Packed Compare Implicit Length Strings, Return Mask. -// -// Forms: -// -// PCMPISTRM imm8 xmm xmm -// PCMPISTRM imm8 m128 xmm -// Construct and append a PCMPISTRM instruction to the active function. -// Operates on the global context. -func PCMPISTRM(i, mx, x operand.Op) { ctx.PCMPISTRM(i, mx, x) } - -// PDEPL: Parallel Bits Deposit. -// -// Forms: -// -// PDEPL r32 r32 r32 -// PDEPL m32 r32 r32 -// Construct and append a PDEPL instruction to the active function. -func (c *Context) PDEPL(mr, r, r1 operand.Op) { - if inst, err := x86.PDEPL(mr, r, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PDEPL: Parallel Bits Deposit. -// -// Forms: -// -// PDEPL r32 r32 r32 -// PDEPL m32 r32 r32 -// Construct and append a PDEPL instruction to the active function. -// Operates on the global context. -func PDEPL(mr, r, r1 operand.Op) { ctx.PDEPL(mr, r, r1) } - -// PDEPQ: Parallel Bits Deposit. -// -// Forms: -// -// PDEPQ r64 r64 r64 -// PDEPQ m64 r64 r64 -// Construct and append a PDEPQ instruction to the active function. -func (c *Context) PDEPQ(mr, r, r1 operand.Op) { - if inst, err := x86.PDEPQ(mr, r, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PDEPQ: Parallel Bits Deposit. -// -// Forms: -// -// PDEPQ r64 r64 r64 -// PDEPQ m64 r64 r64 -// Construct and append a PDEPQ instruction to the active function. -// Operates on the global context. -func PDEPQ(mr, r, r1 operand.Op) { ctx.PDEPQ(mr, r, r1) } - -// PEXTL: Parallel Bits Extract. -// -// Forms: -// -// PEXTL r32 r32 r32 -// PEXTL m32 r32 r32 -// Construct and append a PEXTL instruction to the active function. -func (c *Context) PEXTL(mr, r, r1 operand.Op) { - if inst, err := x86.PEXTL(mr, r, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PEXTL: Parallel Bits Extract. -// -// Forms: -// -// PEXTL r32 r32 r32 -// PEXTL m32 r32 r32 -// Construct and append a PEXTL instruction to the active function. -// Operates on the global context. -func PEXTL(mr, r, r1 operand.Op) { ctx.PEXTL(mr, r, r1) } - -// PEXTQ: Parallel Bits Extract. -// -// Forms: -// -// PEXTQ r64 r64 r64 -// PEXTQ m64 r64 r64 -// Construct and append a PEXTQ instruction to the active function. -func (c *Context) PEXTQ(mr, r, r1 operand.Op) { - if inst, err := x86.PEXTQ(mr, r, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PEXTQ: Parallel Bits Extract. -// -// Forms: -// -// PEXTQ r64 r64 r64 -// PEXTQ m64 r64 r64 -// Construct and append a PEXTQ instruction to the active function. -// Operates on the global context. -func PEXTQ(mr, r, r1 operand.Op) { ctx.PEXTQ(mr, r, r1) } - -// PEXTRB: Extract Byte. -// -// Forms: -// -// PEXTRB imm8 xmm r32 -// PEXTRB imm8 xmm m8 -// Construct and append a PEXTRB instruction to the active function. -func (c *Context) PEXTRB(i, x, mr operand.Op) { - if inst, err := x86.PEXTRB(i, x, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PEXTRB: Extract Byte. -// -// Forms: -// -// PEXTRB imm8 xmm r32 -// PEXTRB imm8 xmm m8 -// Construct and append a PEXTRB instruction to the active function. -// Operates on the global context. -func PEXTRB(i, x, mr operand.Op) { ctx.PEXTRB(i, x, mr) } - -// PEXTRD: Extract Doubleword. -// -// Forms: -// -// PEXTRD imm8 xmm r32 -// PEXTRD imm8 xmm m32 -// Construct and append a PEXTRD instruction to the active function. -func (c *Context) PEXTRD(i, x, mr operand.Op) { - if inst, err := x86.PEXTRD(i, x, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PEXTRD: Extract Doubleword. -// -// Forms: -// -// PEXTRD imm8 xmm r32 -// PEXTRD imm8 xmm m32 -// Construct and append a PEXTRD instruction to the active function. -// Operates on the global context. -func PEXTRD(i, x, mr operand.Op) { ctx.PEXTRD(i, x, mr) } - -// PEXTRQ: Extract Quadword. -// -// Forms: -// -// PEXTRQ imm8 xmm r64 -// PEXTRQ imm8 xmm m64 -// Construct and append a PEXTRQ instruction to the active function. -func (c *Context) PEXTRQ(i, x, mr operand.Op) { - if inst, err := x86.PEXTRQ(i, x, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PEXTRQ: Extract Quadword. -// -// Forms: -// -// PEXTRQ imm8 xmm r64 -// PEXTRQ imm8 xmm m64 -// Construct and append a PEXTRQ instruction to the active function. -// Operates on the global context. -func PEXTRQ(i, x, mr operand.Op) { ctx.PEXTRQ(i, x, mr) } - -// PEXTRW: Extract Word. -// -// Forms: -// -// PEXTRW imm8 xmm r32 -// PEXTRW imm8 xmm m16 -// Construct and append a PEXTRW instruction to the active function. -func (c *Context) PEXTRW(i, x, mr operand.Op) { - if inst, err := x86.PEXTRW(i, x, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PEXTRW: Extract Word. -// -// Forms: -// -// PEXTRW imm8 xmm r32 -// PEXTRW imm8 xmm m16 -// Construct and append a PEXTRW instruction to the active function. -// Operates on the global context. -func PEXTRW(i, x, mr operand.Op) { ctx.PEXTRW(i, x, mr) } - -// PHADDD: Packed Horizontal Add Doubleword Integer. -// -// Forms: -// -// PHADDD xmm xmm -// PHADDD m128 xmm -// Construct and append a PHADDD instruction to the active function. -func (c *Context) PHADDD(mx, x operand.Op) { - if inst, err := x86.PHADDD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PHADDD: Packed Horizontal Add Doubleword Integer. -// -// Forms: -// -// PHADDD xmm xmm -// PHADDD m128 xmm -// Construct and append a PHADDD instruction to the active function. -// Operates on the global context. -func PHADDD(mx, x operand.Op) { ctx.PHADDD(mx, x) } - -// PHADDSW: Packed Horizontal Add Signed Word Integers with Signed Saturation. -// -// Forms: -// -// PHADDSW xmm xmm -// PHADDSW m128 xmm -// Construct and append a PHADDSW instruction to the active function. -func (c *Context) PHADDSW(mx, x operand.Op) { - if inst, err := x86.PHADDSW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PHADDSW: Packed Horizontal Add Signed Word Integers with Signed Saturation. -// -// Forms: -// -// PHADDSW xmm xmm -// PHADDSW m128 xmm -// Construct and append a PHADDSW instruction to the active function. -// Operates on the global context. -func PHADDSW(mx, x operand.Op) { ctx.PHADDSW(mx, x) } - -// PHADDW: Packed Horizontal Add Word Integers. -// -// Forms: -// -// PHADDW xmm xmm -// PHADDW m128 xmm -// Construct and append a PHADDW instruction to the active function. -func (c *Context) PHADDW(mx, x operand.Op) { - if inst, err := x86.PHADDW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PHADDW: Packed Horizontal Add Word Integers. -// -// Forms: -// -// PHADDW xmm xmm -// PHADDW m128 xmm -// Construct and append a PHADDW instruction to the active function. -// Operates on the global context. -func PHADDW(mx, x operand.Op) { ctx.PHADDW(mx, x) } - -// PHMINPOSUW: Packed Horizontal Minimum of Unsigned Word Integers. -// -// Forms: -// -// PHMINPOSUW xmm xmm -// PHMINPOSUW m128 xmm -// Construct and append a PHMINPOSUW instruction to the active function. -func (c *Context) PHMINPOSUW(mx, x operand.Op) { - if inst, err := x86.PHMINPOSUW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PHMINPOSUW: Packed Horizontal Minimum of Unsigned Word Integers. -// -// Forms: -// -// PHMINPOSUW xmm xmm -// PHMINPOSUW m128 xmm -// Construct and append a PHMINPOSUW instruction to the active function. -// Operates on the global context. -func PHMINPOSUW(mx, x operand.Op) { ctx.PHMINPOSUW(mx, x) } - -// PHSUBD: Packed Horizontal Subtract Doubleword Integers. -// -// Forms: -// -// PHSUBD xmm xmm -// PHSUBD m128 xmm -// Construct and append a PHSUBD instruction to the active function. -func (c *Context) PHSUBD(mx, x operand.Op) { - if inst, err := x86.PHSUBD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PHSUBD: Packed Horizontal Subtract Doubleword Integers. -// -// Forms: -// -// PHSUBD xmm xmm -// PHSUBD m128 xmm -// Construct and append a PHSUBD instruction to the active function. -// Operates on the global context. -func PHSUBD(mx, x operand.Op) { ctx.PHSUBD(mx, x) } - -// PHSUBSW: Packed Horizontal Subtract Signed Word Integers with Signed Saturation. -// -// Forms: -// -// PHSUBSW xmm xmm -// PHSUBSW m128 xmm -// Construct and append a PHSUBSW instruction to the active function. -func (c *Context) PHSUBSW(mx, x operand.Op) { - if inst, err := x86.PHSUBSW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PHSUBSW: Packed Horizontal Subtract Signed Word Integers with Signed Saturation. -// -// Forms: -// -// PHSUBSW xmm xmm -// PHSUBSW m128 xmm -// Construct and append a PHSUBSW instruction to the active function. -// Operates on the global context. -func PHSUBSW(mx, x operand.Op) { ctx.PHSUBSW(mx, x) } - -// PHSUBW: Packed Horizontal Subtract Word Integers. -// -// Forms: -// -// PHSUBW xmm xmm -// PHSUBW m128 xmm -// Construct and append a PHSUBW instruction to the active function. -func (c *Context) PHSUBW(mx, x operand.Op) { - if inst, err := x86.PHSUBW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PHSUBW: Packed Horizontal Subtract Word Integers. -// -// Forms: -// -// PHSUBW xmm xmm -// PHSUBW m128 xmm -// Construct and append a PHSUBW instruction to the active function. -// Operates on the global context. -func PHSUBW(mx, x operand.Op) { ctx.PHSUBW(mx, x) } - -// PINSRB: Insert Byte. -// -// Forms: -// -// PINSRB imm8 r32 xmm -// PINSRB imm8 m8 xmm -// Construct and append a PINSRB instruction to the active function. -func (c *Context) PINSRB(i, mr, x operand.Op) { - if inst, err := x86.PINSRB(i, mr, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PINSRB: Insert Byte. -// -// Forms: -// -// PINSRB imm8 r32 xmm -// PINSRB imm8 m8 xmm -// Construct and append a PINSRB instruction to the active function. -// Operates on the global context. -func PINSRB(i, mr, x operand.Op) { ctx.PINSRB(i, mr, x) } - -// PINSRD: Insert Doubleword. -// -// Forms: -// -// PINSRD imm8 r32 xmm -// PINSRD imm8 m32 xmm -// Construct and append a PINSRD instruction to the active function. -func (c *Context) PINSRD(i, mr, x operand.Op) { - if inst, err := x86.PINSRD(i, mr, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PINSRD: Insert Doubleword. -// -// Forms: -// -// PINSRD imm8 r32 xmm -// PINSRD imm8 m32 xmm -// Construct and append a PINSRD instruction to the active function. -// Operates on the global context. -func PINSRD(i, mr, x operand.Op) { ctx.PINSRD(i, mr, x) } - -// PINSRQ: Insert Quadword. -// -// Forms: -// -// PINSRQ imm8 r64 xmm -// PINSRQ imm8 m64 xmm -// Construct and append a PINSRQ instruction to the active function. -func (c *Context) PINSRQ(i, mr, x operand.Op) { - if inst, err := x86.PINSRQ(i, mr, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PINSRQ: Insert Quadword. -// -// Forms: -// -// PINSRQ imm8 r64 xmm -// PINSRQ imm8 m64 xmm -// Construct and append a PINSRQ instruction to the active function. -// Operates on the global context. -func PINSRQ(i, mr, x operand.Op) { ctx.PINSRQ(i, mr, x) } - -// PINSRW: Insert Word. -// -// Forms: -// -// PINSRW imm8 r32 xmm -// PINSRW imm8 m16 xmm -// Construct and append a PINSRW instruction to the active function. -func (c *Context) PINSRW(i, mr, x operand.Op) { - if inst, err := x86.PINSRW(i, mr, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PINSRW: Insert Word. -// -// Forms: -// -// PINSRW imm8 r32 xmm -// PINSRW imm8 m16 xmm -// Construct and append a PINSRW instruction to the active function. -// Operates on the global context. -func PINSRW(i, mr, x operand.Op) { ctx.PINSRW(i, mr, x) } - -// PMADDUBSW: Multiply and Add Packed Signed and Unsigned Byte Integers. -// -// Forms: -// -// PMADDUBSW xmm xmm -// PMADDUBSW m128 xmm -// Construct and append a PMADDUBSW instruction to the active function. -func (c *Context) PMADDUBSW(mx, x operand.Op) { - if inst, err := x86.PMADDUBSW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMADDUBSW: Multiply and Add Packed Signed and Unsigned Byte Integers. -// -// Forms: -// -// PMADDUBSW xmm xmm -// PMADDUBSW m128 xmm -// Construct and append a PMADDUBSW instruction to the active function. -// Operates on the global context. -func PMADDUBSW(mx, x operand.Op) { ctx.PMADDUBSW(mx, x) } - -// PMADDWL: Multiply and Add Packed Signed Word Integers. -// -// Forms: -// -// PMADDWL xmm xmm -// PMADDWL m128 xmm -// Construct and append a PMADDWL instruction to the active function. -func (c *Context) PMADDWL(mx, x operand.Op) { - if inst, err := x86.PMADDWL(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMADDWL: Multiply and Add Packed Signed Word Integers. -// -// Forms: -// -// PMADDWL xmm xmm -// PMADDWL m128 xmm -// Construct and append a PMADDWL instruction to the active function. -// Operates on the global context. -func PMADDWL(mx, x operand.Op) { ctx.PMADDWL(mx, x) } - -// PMAXSB: Maximum of Packed Signed Byte Integers. -// -// Forms: -// -// PMAXSB xmm xmm -// PMAXSB m128 xmm -// Construct and append a PMAXSB instruction to the active function. -func (c *Context) PMAXSB(mx, x operand.Op) { - if inst, err := x86.PMAXSB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMAXSB: Maximum of Packed Signed Byte Integers. -// -// Forms: -// -// PMAXSB xmm xmm -// PMAXSB m128 xmm -// Construct and append a PMAXSB instruction to the active function. -// Operates on the global context. -func PMAXSB(mx, x operand.Op) { ctx.PMAXSB(mx, x) } - -// PMAXSD: Maximum of Packed Signed Doubleword Integers. -// -// Forms: -// -// PMAXSD xmm xmm -// PMAXSD m128 xmm -// Construct and append a PMAXSD instruction to the active function. -func (c *Context) PMAXSD(mx, x operand.Op) { - if inst, err := x86.PMAXSD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMAXSD: Maximum of Packed Signed Doubleword Integers. -// -// Forms: -// -// PMAXSD xmm xmm -// PMAXSD m128 xmm -// Construct and append a PMAXSD instruction to the active function. -// Operates on the global context. -func PMAXSD(mx, x operand.Op) { ctx.PMAXSD(mx, x) } - -// PMAXSW: Maximum of Packed Signed Word Integers. -// -// Forms: -// -// PMAXSW xmm xmm -// PMAXSW m128 xmm -// Construct and append a PMAXSW instruction to the active function. -func (c *Context) PMAXSW(mx, x operand.Op) { - if inst, err := x86.PMAXSW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMAXSW: Maximum of Packed Signed Word Integers. -// -// Forms: -// -// PMAXSW xmm xmm -// PMAXSW m128 xmm -// Construct and append a PMAXSW instruction to the active function. -// Operates on the global context. -func PMAXSW(mx, x operand.Op) { ctx.PMAXSW(mx, x) } - -// PMAXUB: Maximum of Packed Unsigned Byte Integers. -// -// Forms: -// -// PMAXUB xmm xmm -// PMAXUB m128 xmm -// Construct and append a PMAXUB instruction to the active function. -func (c *Context) PMAXUB(mx, x operand.Op) { - if inst, err := x86.PMAXUB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMAXUB: Maximum of Packed Unsigned Byte Integers. -// -// Forms: -// -// PMAXUB xmm xmm -// PMAXUB m128 xmm -// Construct and append a PMAXUB instruction to the active function. -// Operates on the global context. -func PMAXUB(mx, x operand.Op) { ctx.PMAXUB(mx, x) } - -// PMAXUD: Maximum of Packed Unsigned Doubleword Integers. -// -// Forms: -// -// PMAXUD xmm xmm -// PMAXUD m128 xmm -// Construct and append a PMAXUD instruction to the active function. -func (c *Context) PMAXUD(mx, x operand.Op) { - if inst, err := x86.PMAXUD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMAXUD: Maximum of Packed Unsigned Doubleword Integers. -// -// Forms: -// -// PMAXUD xmm xmm -// PMAXUD m128 xmm -// Construct and append a PMAXUD instruction to the active function. -// Operates on the global context. -func PMAXUD(mx, x operand.Op) { ctx.PMAXUD(mx, x) } - -// PMAXUW: Maximum of Packed Unsigned Word Integers. -// -// Forms: -// -// PMAXUW xmm xmm -// PMAXUW m128 xmm -// Construct and append a PMAXUW instruction to the active function. -func (c *Context) PMAXUW(mx, x operand.Op) { - if inst, err := x86.PMAXUW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMAXUW: Maximum of Packed Unsigned Word Integers. -// -// Forms: -// -// PMAXUW xmm xmm -// PMAXUW m128 xmm -// Construct and append a PMAXUW instruction to the active function. -// Operates on the global context. -func PMAXUW(mx, x operand.Op) { ctx.PMAXUW(mx, x) } - -// PMINSB: Minimum of Packed Signed Byte Integers. -// -// Forms: -// -// PMINSB xmm xmm -// PMINSB m128 xmm -// Construct and append a PMINSB instruction to the active function. -func (c *Context) PMINSB(mx, x operand.Op) { - if inst, err := x86.PMINSB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMINSB: Minimum of Packed Signed Byte Integers. -// -// Forms: -// -// PMINSB xmm xmm -// PMINSB m128 xmm -// Construct and append a PMINSB instruction to the active function. -// Operates on the global context. -func PMINSB(mx, x operand.Op) { ctx.PMINSB(mx, x) } - -// PMINSD: Minimum of Packed Signed Doubleword Integers. -// -// Forms: -// -// PMINSD xmm xmm -// PMINSD m128 xmm -// Construct and append a PMINSD instruction to the active function. -func (c *Context) PMINSD(mx, x operand.Op) { - if inst, err := x86.PMINSD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMINSD: Minimum of Packed Signed Doubleword Integers. -// -// Forms: -// -// PMINSD xmm xmm -// PMINSD m128 xmm -// Construct and append a PMINSD instruction to the active function. -// Operates on the global context. -func PMINSD(mx, x operand.Op) { ctx.PMINSD(mx, x) } - -// PMINSW: Minimum of Packed Signed Word Integers. -// -// Forms: -// -// PMINSW xmm xmm -// PMINSW m128 xmm -// Construct and append a PMINSW instruction to the active function. -func (c *Context) PMINSW(mx, x operand.Op) { - if inst, err := x86.PMINSW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMINSW: Minimum of Packed Signed Word Integers. -// -// Forms: -// -// PMINSW xmm xmm -// PMINSW m128 xmm -// Construct and append a PMINSW instruction to the active function. -// Operates on the global context. -func PMINSW(mx, x operand.Op) { ctx.PMINSW(mx, x) } - -// PMINUB: Minimum of Packed Unsigned Byte Integers. -// -// Forms: -// -// PMINUB xmm xmm -// PMINUB m128 xmm -// Construct and append a PMINUB instruction to the active function. -func (c *Context) PMINUB(mx, x operand.Op) { - if inst, err := x86.PMINUB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMINUB: Minimum of Packed Unsigned Byte Integers. -// -// Forms: -// -// PMINUB xmm xmm -// PMINUB m128 xmm -// Construct and append a PMINUB instruction to the active function. -// Operates on the global context. -func PMINUB(mx, x operand.Op) { ctx.PMINUB(mx, x) } - -// PMINUD: Minimum of Packed Unsigned Doubleword Integers. -// -// Forms: -// -// PMINUD xmm xmm -// PMINUD m128 xmm -// Construct and append a PMINUD instruction to the active function. -func (c *Context) PMINUD(mx, x operand.Op) { - if inst, err := x86.PMINUD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMINUD: Minimum of Packed Unsigned Doubleword Integers. -// -// Forms: -// -// PMINUD xmm xmm -// PMINUD m128 xmm -// Construct and append a PMINUD instruction to the active function. -// Operates on the global context. -func PMINUD(mx, x operand.Op) { ctx.PMINUD(mx, x) } - -// PMINUW: Minimum of Packed Unsigned Word Integers. -// -// Forms: -// -// PMINUW xmm xmm -// PMINUW m128 xmm -// Construct and append a PMINUW instruction to the active function. -func (c *Context) PMINUW(mx, x operand.Op) { - if inst, err := x86.PMINUW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMINUW: Minimum of Packed Unsigned Word Integers. -// -// Forms: -// -// PMINUW xmm xmm -// PMINUW m128 xmm -// Construct and append a PMINUW instruction to the active function. -// Operates on the global context. -func PMINUW(mx, x operand.Op) { ctx.PMINUW(mx, x) } - -// PMOVMSKB: Move Byte Mask. -// -// Forms: -// -// PMOVMSKB xmm r32 -// Construct and append a PMOVMSKB instruction to the active function. -func (c *Context) PMOVMSKB(x, r operand.Op) { - if inst, err := x86.PMOVMSKB(x, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMOVMSKB: Move Byte Mask. -// -// Forms: -// -// PMOVMSKB xmm r32 -// Construct and append a PMOVMSKB instruction to the active function. -// Operates on the global context. -func PMOVMSKB(x, r operand.Op) { ctx.PMOVMSKB(x, r) } - -// PMOVSXBD: Move Packed Byte Integers to Doubleword Integers with Sign Extension. -// -// Forms: -// -// PMOVSXBD xmm xmm -// PMOVSXBD m32 xmm -// Construct and append a PMOVSXBD instruction to the active function. -func (c *Context) PMOVSXBD(mx, x operand.Op) { - if inst, err := x86.PMOVSXBD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMOVSXBD: Move Packed Byte Integers to Doubleword Integers with Sign Extension. -// -// Forms: -// -// PMOVSXBD xmm xmm -// PMOVSXBD m32 xmm -// Construct and append a PMOVSXBD instruction to the active function. -// Operates on the global context. -func PMOVSXBD(mx, x operand.Op) { ctx.PMOVSXBD(mx, x) } - -// PMOVSXBQ: Move Packed Byte Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// PMOVSXBQ xmm xmm -// PMOVSXBQ m16 xmm -// Construct and append a PMOVSXBQ instruction to the active function. -func (c *Context) PMOVSXBQ(mx, x operand.Op) { - if inst, err := x86.PMOVSXBQ(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMOVSXBQ: Move Packed Byte Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// PMOVSXBQ xmm xmm -// PMOVSXBQ m16 xmm -// Construct and append a PMOVSXBQ instruction to the active function. -// Operates on the global context. -func PMOVSXBQ(mx, x operand.Op) { ctx.PMOVSXBQ(mx, x) } - -// PMOVSXBW: Move Packed Byte Integers to Word Integers with Sign Extension. -// -// Forms: -// -// PMOVSXBW xmm xmm -// PMOVSXBW m64 xmm -// Construct and append a PMOVSXBW instruction to the active function. -func (c *Context) PMOVSXBW(mx, x operand.Op) { - if inst, err := x86.PMOVSXBW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMOVSXBW: Move Packed Byte Integers to Word Integers with Sign Extension. -// -// Forms: -// -// PMOVSXBW xmm xmm -// PMOVSXBW m64 xmm -// Construct and append a PMOVSXBW instruction to the active function. -// Operates on the global context. -func PMOVSXBW(mx, x operand.Op) { ctx.PMOVSXBW(mx, x) } - -// PMOVSXDQ: Move Packed Doubleword Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// PMOVSXDQ xmm xmm -// PMOVSXDQ m64 xmm -// Construct and append a PMOVSXDQ instruction to the active function. -func (c *Context) PMOVSXDQ(mx, x operand.Op) { - if inst, err := x86.PMOVSXDQ(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMOVSXDQ: Move Packed Doubleword Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// PMOVSXDQ xmm xmm -// PMOVSXDQ m64 xmm -// Construct and append a PMOVSXDQ instruction to the active function. -// Operates on the global context. -func PMOVSXDQ(mx, x operand.Op) { ctx.PMOVSXDQ(mx, x) } - -// PMOVSXWD: Move Packed Word Integers to Doubleword Integers with Sign Extension. -// -// Forms: -// -// PMOVSXWD xmm xmm -// PMOVSXWD m64 xmm -// Construct and append a PMOVSXWD instruction to the active function. -func (c *Context) PMOVSXWD(mx, x operand.Op) { - if inst, err := x86.PMOVSXWD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMOVSXWD: Move Packed Word Integers to Doubleword Integers with Sign Extension. -// -// Forms: -// -// PMOVSXWD xmm xmm -// PMOVSXWD m64 xmm -// Construct and append a PMOVSXWD instruction to the active function. -// Operates on the global context. -func PMOVSXWD(mx, x operand.Op) { ctx.PMOVSXWD(mx, x) } - -// PMOVSXWQ: Move Packed Word Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// PMOVSXWQ xmm xmm -// PMOVSXWQ m32 xmm -// Construct and append a PMOVSXWQ instruction to the active function. -func (c *Context) PMOVSXWQ(mx, x operand.Op) { - if inst, err := x86.PMOVSXWQ(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMOVSXWQ: Move Packed Word Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// PMOVSXWQ xmm xmm -// PMOVSXWQ m32 xmm -// Construct and append a PMOVSXWQ instruction to the active function. -// Operates on the global context. -func PMOVSXWQ(mx, x operand.Op) { ctx.PMOVSXWQ(mx, x) } - -// PMOVZXBD: Move Packed Byte Integers to Doubleword Integers with Zero Extension. -// -// Forms: -// -// PMOVZXBD xmm xmm -// PMOVZXBD m32 xmm -// Construct and append a PMOVZXBD instruction to the active function. -func (c *Context) PMOVZXBD(mx, x operand.Op) { - if inst, err := x86.PMOVZXBD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMOVZXBD: Move Packed Byte Integers to Doubleword Integers with Zero Extension. -// -// Forms: -// -// PMOVZXBD xmm xmm -// PMOVZXBD m32 xmm -// Construct and append a PMOVZXBD instruction to the active function. -// Operates on the global context. -func PMOVZXBD(mx, x operand.Op) { ctx.PMOVZXBD(mx, x) } - -// PMOVZXBQ: Move Packed Byte Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// PMOVZXBQ xmm xmm -// PMOVZXBQ m16 xmm -// Construct and append a PMOVZXBQ instruction to the active function. -func (c *Context) PMOVZXBQ(mx, x operand.Op) { - if inst, err := x86.PMOVZXBQ(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMOVZXBQ: Move Packed Byte Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// PMOVZXBQ xmm xmm -// PMOVZXBQ m16 xmm -// Construct and append a PMOVZXBQ instruction to the active function. -// Operates on the global context. -func PMOVZXBQ(mx, x operand.Op) { ctx.PMOVZXBQ(mx, x) } - -// PMOVZXBW: Move Packed Byte Integers to Word Integers with Zero Extension. -// -// Forms: -// -// PMOVZXBW xmm xmm -// PMOVZXBW m64 xmm -// Construct and append a PMOVZXBW instruction to the active function. -func (c *Context) PMOVZXBW(mx, x operand.Op) { - if inst, err := x86.PMOVZXBW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMOVZXBW: Move Packed Byte Integers to Word Integers with Zero Extension. -// -// Forms: -// -// PMOVZXBW xmm xmm -// PMOVZXBW m64 xmm -// Construct and append a PMOVZXBW instruction to the active function. -// Operates on the global context. -func PMOVZXBW(mx, x operand.Op) { ctx.PMOVZXBW(mx, x) } - -// PMOVZXDQ: Move Packed Doubleword Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// PMOVZXDQ xmm xmm -// PMOVZXDQ m64 xmm -// Construct and append a PMOVZXDQ instruction to the active function. -func (c *Context) PMOVZXDQ(mx, x operand.Op) { - if inst, err := x86.PMOVZXDQ(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMOVZXDQ: Move Packed Doubleword Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// PMOVZXDQ xmm xmm -// PMOVZXDQ m64 xmm -// Construct and append a PMOVZXDQ instruction to the active function. -// Operates on the global context. -func PMOVZXDQ(mx, x operand.Op) { ctx.PMOVZXDQ(mx, x) } - -// PMOVZXWD: Move Packed Word Integers to Doubleword Integers with Zero Extension. -// -// Forms: -// -// PMOVZXWD xmm xmm -// PMOVZXWD m64 xmm -// Construct and append a PMOVZXWD instruction to the active function. -func (c *Context) PMOVZXWD(mx, x operand.Op) { - if inst, err := x86.PMOVZXWD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMOVZXWD: Move Packed Word Integers to Doubleword Integers with Zero Extension. -// -// Forms: -// -// PMOVZXWD xmm xmm -// PMOVZXWD m64 xmm -// Construct and append a PMOVZXWD instruction to the active function. -// Operates on the global context. -func PMOVZXWD(mx, x operand.Op) { ctx.PMOVZXWD(mx, x) } - -// PMOVZXWQ: Move Packed Word Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// PMOVZXWQ xmm xmm -// PMOVZXWQ m32 xmm -// Construct and append a PMOVZXWQ instruction to the active function. -func (c *Context) PMOVZXWQ(mx, x operand.Op) { - if inst, err := x86.PMOVZXWQ(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMOVZXWQ: Move Packed Word Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// PMOVZXWQ xmm xmm -// PMOVZXWQ m32 xmm -// Construct and append a PMOVZXWQ instruction to the active function. -// Operates on the global context. -func PMOVZXWQ(mx, x operand.Op) { ctx.PMOVZXWQ(mx, x) } - -// PMULDQ: Multiply Packed Signed Doubleword Integers and Store Quadword Result. -// -// Forms: -// -// PMULDQ xmm xmm -// PMULDQ m128 xmm -// Construct and append a PMULDQ instruction to the active function. -func (c *Context) PMULDQ(mx, x operand.Op) { - if inst, err := x86.PMULDQ(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMULDQ: Multiply Packed Signed Doubleword Integers and Store Quadword Result. -// -// Forms: -// -// PMULDQ xmm xmm -// PMULDQ m128 xmm -// Construct and append a PMULDQ instruction to the active function. -// Operates on the global context. -func PMULDQ(mx, x operand.Op) { ctx.PMULDQ(mx, x) } - -// PMULHRSW: Packed Multiply Signed Word Integers and Store High Result with Round and Scale. -// -// Forms: -// -// PMULHRSW xmm xmm -// PMULHRSW m128 xmm -// Construct and append a PMULHRSW instruction to the active function. -func (c *Context) PMULHRSW(mx, x operand.Op) { - if inst, err := x86.PMULHRSW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMULHRSW: Packed Multiply Signed Word Integers and Store High Result with Round and Scale. -// -// Forms: -// -// PMULHRSW xmm xmm -// PMULHRSW m128 xmm -// Construct and append a PMULHRSW instruction to the active function. -// Operates on the global context. -func PMULHRSW(mx, x operand.Op) { ctx.PMULHRSW(mx, x) } - -// PMULHUW: Multiply Packed Unsigned Word Integers and Store High Result. -// -// Forms: -// -// PMULHUW xmm xmm -// PMULHUW m128 xmm -// Construct and append a PMULHUW instruction to the active function. -func (c *Context) PMULHUW(mx, x operand.Op) { - if inst, err := x86.PMULHUW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMULHUW: Multiply Packed Unsigned Word Integers and Store High Result. -// -// Forms: -// -// PMULHUW xmm xmm -// PMULHUW m128 xmm -// Construct and append a PMULHUW instruction to the active function. -// Operates on the global context. -func PMULHUW(mx, x operand.Op) { ctx.PMULHUW(mx, x) } - -// PMULHW: Multiply Packed Signed Word Integers and Store High Result. -// -// Forms: -// -// PMULHW xmm xmm -// PMULHW m128 xmm -// Construct and append a PMULHW instruction to the active function. -func (c *Context) PMULHW(mx, x operand.Op) { - if inst, err := x86.PMULHW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMULHW: Multiply Packed Signed Word Integers and Store High Result. -// -// Forms: -// -// PMULHW xmm xmm -// PMULHW m128 xmm -// Construct and append a PMULHW instruction to the active function. -// Operates on the global context. -func PMULHW(mx, x operand.Op) { ctx.PMULHW(mx, x) } - -// PMULLD: Multiply Packed Signed Doubleword Integers and Store Low Result. -// -// Forms: -// -// PMULLD xmm xmm -// PMULLD m128 xmm -// Construct and append a PMULLD instruction to the active function. -func (c *Context) PMULLD(mx, x operand.Op) { - if inst, err := x86.PMULLD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMULLD: Multiply Packed Signed Doubleword Integers and Store Low Result. -// -// Forms: -// -// PMULLD xmm xmm -// PMULLD m128 xmm -// Construct and append a PMULLD instruction to the active function. -// Operates on the global context. -func PMULLD(mx, x operand.Op) { ctx.PMULLD(mx, x) } - -// PMULLW: Multiply Packed Signed Word Integers and Store Low Result. -// -// Forms: -// -// PMULLW xmm xmm -// PMULLW m128 xmm -// Construct and append a PMULLW instruction to the active function. -func (c *Context) PMULLW(mx, x operand.Op) { - if inst, err := x86.PMULLW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMULLW: Multiply Packed Signed Word Integers and Store Low Result. -// -// Forms: -// -// PMULLW xmm xmm -// PMULLW m128 xmm -// Construct and append a PMULLW instruction to the active function. -// Operates on the global context. -func PMULLW(mx, x operand.Op) { ctx.PMULLW(mx, x) } - -// PMULULQ: Multiply Packed Unsigned Doubleword Integers. -// -// Forms: -// -// PMULULQ xmm xmm -// PMULULQ m128 xmm -// Construct and append a PMULULQ instruction to the active function. -func (c *Context) PMULULQ(mx, x operand.Op) { - if inst, err := x86.PMULULQ(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PMULULQ: Multiply Packed Unsigned Doubleword Integers. -// -// Forms: -// -// PMULULQ xmm xmm -// PMULULQ m128 xmm -// Construct and append a PMULULQ instruction to the active function. -// Operates on the global context. -func PMULULQ(mx, x operand.Op) { ctx.PMULULQ(mx, x) } - -// POPCNTL: Count of Number of Bits Set to 1. -// -// Forms: -// -// POPCNTL r32 r32 -// POPCNTL m32 r32 -// Construct and append a POPCNTL instruction to the active function. -func (c *Context) POPCNTL(mr, r operand.Op) { - if inst, err := x86.POPCNTL(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// POPCNTL: Count of Number of Bits Set to 1. -// -// Forms: -// -// POPCNTL r32 r32 -// POPCNTL m32 r32 -// Construct and append a POPCNTL instruction to the active function. -// Operates on the global context. -func POPCNTL(mr, r operand.Op) { ctx.POPCNTL(mr, r) } - -// POPCNTQ: Count of Number of Bits Set to 1. -// -// Forms: -// -// POPCNTQ r64 r64 -// POPCNTQ m64 r64 -// Construct and append a POPCNTQ instruction to the active function. -func (c *Context) POPCNTQ(mr, r operand.Op) { - if inst, err := x86.POPCNTQ(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// POPCNTQ: Count of Number of Bits Set to 1. -// -// Forms: -// -// POPCNTQ r64 r64 -// POPCNTQ m64 r64 -// Construct and append a POPCNTQ instruction to the active function. -// Operates on the global context. -func POPCNTQ(mr, r operand.Op) { ctx.POPCNTQ(mr, r) } - -// POPCNTW: Count of Number of Bits Set to 1. -// -// Forms: -// -// POPCNTW r16 r16 -// POPCNTW m16 r16 -// Construct and append a POPCNTW instruction to the active function. -func (c *Context) POPCNTW(mr, r operand.Op) { - if inst, err := x86.POPCNTW(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// POPCNTW: Count of Number of Bits Set to 1. -// -// Forms: -// -// POPCNTW r16 r16 -// POPCNTW m16 r16 -// Construct and append a POPCNTW instruction to the active function. -// Operates on the global context. -func POPCNTW(mr, r operand.Op) { ctx.POPCNTW(mr, r) } - -// POPQ: Pop a Value from the Stack. -// -// Forms: -// -// POPQ r64 -// POPQ m64 -// Construct and append a POPQ instruction to the active function. -func (c *Context) POPQ(mr operand.Op) { - if inst, err := x86.POPQ(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// POPQ: Pop a Value from the Stack. -// -// Forms: -// -// POPQ r64 -// POPQ m64 -// Construct and append a POPQ instruction to the active function. -// Operates on the global context. -func POPQ(mr operand.Op) { ctx.POPQ(mr) } - -// POPW: Pop a Value from the Stack. -// -// Forms: -// -// POPW r16 -// POPW m16 -// Construct and append a POPW instruction to the active function. -func (c *Context) POPW(mr operand.Op) { - if inst, err := x86.POPW(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// POPW: Pop a Value from the Stack. -// -// Forms: -// -// POPW r16 -// POPW m16 -// Construct and append a POPW instruction to the active function. -// Operates on the global context. -func POPW(mr operand.Op) { ctx.POPW(mr) } - -// POR: Packed Bitwise Logical OR. -// -// Forms: -// -// POR xmm xmm -// POR m128 xmm -// Construct and append a POR instruction to the active function. -func (c *Context) POR(mx, x operand.Op) { - if inst, err := x86.POR(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// POR: Packed Bitwise Logical OR. -// -// Forms: -// -// POR xmm xmm -// POR m128 xmm -// Construct and append a POR instruction to the active function. -// Operates on the global context. -func POR(mx, x operand.Op) { ctx.POR(mx, x) } - -// PREFETCHNTA: Prefetch Data Into Caches using NTA Hint. -// -// Forms: -// -// PREFETCHNTA m8 -// Construct and append a PREFETCHNTA instruction to the active function. -func (c *Context) PREFETCHNTA(m operand.Op) { - if inst, err := x86.PREFETCHNTA(m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PREFETCHNTA: Prefetch Data Into Caches using NTA Hint. -// -// Forms: -// -// PREFETCHNTA m8 -// Construct and append a PREFETCHNTA instruction to the active function. -// Operates on the global context. -func PREFETCHNTA(m operand.Op) { ctx.PREFETCHNTA(m) } - -// PREFETCHT0: Prefetch Data Into Caches using T0 Hint. -// -// Forms: -// -// PREFETCHT0 m8 -// Construct and append a PREFETCHT0 instruction to the active function. -func (c *Context) PREFETCHT0(m operand.Op) { - if inst, err := x86.PREFETCHT0(m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PREFETCHT0: Prefetch Data Into Caches using T0 Hint. -// -// Forms: -// -// PREFETCHT0 m8 -// Construct and append a PREFETCHT0 instruction to the active function. -// Operates on the global context. -func PREFETCHT0(m operand.Op) { ctx.PREFETCHT0(m) } - -// PREFETCHT1: Prefetch Data Into Caches using T1 Hint. -// -// Forms: -// -// PREFETCHT1 m8 -// Construct and append a PREFETCHT1 instruction to the active function. -func (c *Context) PREFETCHT1(m operand.Op) { - if inst, err := x86.PREFETCHT1(m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PREFETCHT1: Prefetch Data Into Caches using T1 Hint. -// -// Forms: -// -// PREFETCHT1 m8 -// Construct and append a PREFETCHT1 instruction to the active function. -// Operates on the global context. -func PREFETCHT1(m operand.Op) { ctx.PREFETCHT1(m) } - -// PREFETCHT2: Prefetch Data Into Caches using T2 Hint. -// -// Forms: -// -// PREFETCHT2 m8 -// Construct and append a PREFETCHT2 instruction to the active function. -func (c *Context) PREFETCHT2(m operand.Op) { - if inst, err := x86.PREFETCHT2(m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PREFETCHT2: Prefetch Data Into Caches using T2 Hint. -// -// Forms: -// -// PREFETCHT2 m8 -// Construct and append a PREFETCHT2 instruction to the active function. -// Operates on the global context. -func PREFETCHT2(m operand.Op) { ctx.PREFETCHT2(m) } - -// PSADBW: Compute Sum of Absolute Differences. -// -// Forms: -// -// PSADBW xmm xmm -// PSADBW m128 xmm -// Construct and append a PSADBW instruction to the active function. -func (c *Context) PSADBW(mx, x operand.Op) { - if inst, err := x86.PSADBW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSADBW: Compute Sum of Absolute Differences. -// -// Forms: -// -// PSADBW xmm xmm -// PSADBW m128 xmm -// Construct and append a PSADBW instruction to the active function. -// Operates on the global context. -func PSADBW(mx, x operand.Op) { ctx.PSADBW(mx, x) } - -// PSHUFB: Packed Shuffle Bytes. -// -// Forms: -// -// PSHUFB xmm xmm -// PSHUFB m128 xmm -// Construct and append a PSHUFB instruction to the active function. -func (c *Context) PSHUFB(mx, x operand.Op) { - if inst, err := x86.PSHUFB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSHUFB: Packed Shuffle Bytes. -// -// Forms: -// -// PSHUFB xmm xmm -// PSHUFB m128 xmm -// Construct and append a PSHUFB instruction to the active function. -// Operates on the global context. -func PSHUFB(mx, x operand.Op) { ctx.PSHUFB(mx, x) } - -// PSHUFD: Shuffle Packed Doublewords. -// -// Forms: -// -// PSHUFD imm8 xmm xmm -// PSHUFD imm8 m128 xmm -// Construct and append a PSHUFD instruction to the active function. -func (c *Context) PSHUFD(i, mx, x operand.Op) { - if inst, err := x86.PSHUFD(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSHUFD: Shuffle Packed Doublewords. -// -// Forms: -// -// PSHUFD imm8 xmm xmm -// PSHUFD imm8 m128 xmm -// Construct and append a PSHUFD instruction to the active function. -// Operates on the global context. -func PSHUFD(i, mx, x operand.Op) { ctx.PSHUFD(i, mx, x) } - -// PSHUFHW: Shuffle Packed High Words. -// -// Forms: -// -// PSHUFHW imm8 xmm xmm -// PSHUFHW imm8 m128 xmm -// Construct and append a PSHUFHW instruction to the active function. -func (c *Context) PSHUFHW(i, mx, x operand.Op) { - if inst, err := x86.PSHUFHW(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSHUFHW: Shuffle Packed High Words. -// -// Forms: -// -// PSHUFHW imm8 xmm xmm -// PSHUFHW imm8 m128 xmm -// Construct and append a PSHUFHW instruction to the active function. -// Operates on the global context. -func PSHUFHW(i, mx, x operand.Op) { ctx.PSHUFHW(i, mx, x) } - -// PSHUFL: Shuffle Packed Doublewords. -// -// Forms: -// -// PSHUFL imm8 xmm xmm -// PSHUFL imm8 m128 xmm -// Construct and append a PSHUFL instruction to the active function. -func (c *Context) PSHUFL(i, mx, x operand.Op) { - if inst, err := x86.PSHUFL(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSHUFL: Shuffle Packed Doublewords. -// -// Forms: -// -// PSHUFL imm8 xmm xmm -// PSHUFL imm8 m128 xmm -// Construct and append a PSHUFL instruction to the active function. -// Operates on the global context. -func PSHUFL(i, mx, x operand.Op) { ctx.PSHUFL(i, mx, x) } - -// PSHUFLW: Shuffle Packed Low Words. -// -// Forms: -// -// PSHUFLW imm8 xmm xmm -// PSHUFLW imm8 m128 xmm -// Construct and append a PSHUFLW instruction to the active function. -func (c *Context) PSHUFLW(i, mx, x operand.Op) { - if inst, err := x86.PSHUFLW(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSHUFLW: Shuffle Packed Low Words. -// -// Forms: -// -// PSHUFLW imm8 xmm xmm -// PSHUFLW imm8 m128 xmm -// Construct and append a PSHUFLW instruction to the active function. -// Operates on the global context. -func PSHUFLW(i, mx, x operand.Op) { ctx.PSHUFLW(i, mx, x) } - -// PSIGNB: Packed Sign of Byte Integers. -// -// Forms: -// -// PSIGNB xmm xmm -// PSIGNB m128 xmm -// Construct and append a PSIGNB instruction to the active function. -func (c *Context) PSIGNB(mx, x operand.Op) { - if inst, err := x86.PSIGNB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSIGNB: Packed Sign of Byte Integers. -// -// Forms: -// -// PSIGNB xmm xmm -// PSIGNB m128 xmm -// Construct and append a PSIGNB instruction to the active function. -// Operates on the global context. -func PSIGNB(mx, x operand.Op) { ctx.PSIGNB(mx, x) } - -// PSIGND: Packed Sign of Doubleword Integers. -// -// Forms: -// -// PSIGND xmm xmm -// PSIGND m128 xmm -// Construct and append a PSIGND instruction to the active function. -func (c *Context) PSIGND(mx, x operand.Op) { - if inst, err := x86.PSIGND(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSIGND: Packed Sign of Doubleword Integers. -// -// Forms: -// -// PSIGND xmm xmm -// PSIGND m128 xmm -// Construct and append a PSIGND instruction to the active function. -// Operates on the global context. -func PSIGND(mx, x operand.Op) { ctx.PSIGND(mx, x) } - -// PSIGNW: Packed Sign of Word Integers. -// -// Forms: -// -// PSIGNW xmm xmm -// PSIGNW m128 xmm -// Construct and append a PSIGNW instruction to the active function. -func (c *Context) PSIGNW(mx, x operand.Op) { - if inst, err := x86.PSIGNW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSIGNW: Packed Sign of Word Integers. -// -// Forms: -// -// PSIGNW xmm xmm -// PSIGNW m128 xmm -// Construct and append a PSIGNW instruction to the active function. -// Operates on the global context. -func PSIGNW(mx, x operand.Op) { ctx.PSIGNW(mx, x) } - -// PSLLDQ: Shift Packed Double Quadword Left Logical. -// -// Forms: -// -// PSLLDQ imm8 xmm -// Construct and append a PSLLDQ instruction to the active function. -func (c *Context) PSLLDQ(i, x operand.Op) { - if inst, err := x86.PSLLDQ(i, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSLLDQ: Shift Packed Double Quadword Left Logical. -// -// Forms: -// -// PSLLDQ imm8 xmm -// Construct and append a PSLLDQ instruction to the active function. -// Operates on the global context. -func PSLLDQ(i, x operand.Op) { ctx.PSLLDQ(i, x) } - -// PSLLL: Shift Packed Doubleword Data Left Logical. -// -// Forms: -// -// PSLLL imm8 xmm -// PSLLL xmm xmm -// PSLLL m128 xmm -// Construct and append a PSLLL instruction to the active function. -func (c *Context) PSLLL(imx, x operand.Op) { - if inst, err := x86.PSLLL(imx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSLLL: Shift Packed Doubleword Data Left Logical. -// -// Forms: -// -// PSLLL imm8 xmm -// PSLLL xmm xmm -// PSLLL m128 xmm -// Construct and append a PSLLL instruction to the active function. -// Operates on the global context. -func PSLLL(imx, x operand.Op) { ctx.PSLLL(imx, x) } - -// PSLLO: Shift Packed Double Quadword Left Logical. -// -// Forms: -// -// PSLLO imm8 xmm -// Construct and append a PSLLO instruction to the active function. -func (c *Context) PSLLO(i, x operand.Op) { - if inst, err := x86.PSLLO(i, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSLLO: Shift Packed Double Quadword Left Logical. -// -// Forms: -// -// PSLLO imm8 xmm -// Construct and append a PSLLO instruction to the active function. -// Operates on the global context. -func PSLLO(i, x operand.Op) { ctx.PSLLO(i, x) } - -// PSLLQ: Shift Packed Quadword Data Left Logical. -// -// Forms: -// -// PSLLQ imm8 xmm -// PSLLQ xmm xmm -// PSLLQ m128 xmm -// Construct and append a PSLLQ instruction to the active function. -func (c *Context) PSLLQ(imx, x operand.Op) { - if inst, err := x86.PSLLQ(imx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSLLQ: Shift Packed Quadword Data Left Logical. -// -// Forms: -// -// PSLLQ imm8 xmm -// PSLLQ xmm xmm -// PSLLQ m128 xmm -// Construct and append a PSLLQ instruction to the active function. -// Operates on the global context. -func PSLLQ(imx, x operand.Op) { ctx.PSLLQ(imx, x) } - -// PSLLW: Shift Packed Word Data Left Logical. -// -// Forms: -// -// PSLLW imm8 xmm -// PSLLW xmm xmm -// PSLLW m128 xmm -// Construct and append a PSLLW instruction to the active function. -func (c *Context) PSLLW(imx, x operand.Op) { - if inst, err := x86.PSLLW(imx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSLLW: Shift Packed Word Data Left Logical. -// -// Forms: -// -// PSLLW imm8 xmm -// PSLLW xmm xmm -// PSLLW m128 xmm -// Construct and append a PSLLW instruction to the active function. -// Operates on the global context. -func PSLLW(imx, x operand.Op) { ctx.PSLLW(imx, x) } - -// PSRAL: Shift Packed Doubleword Data Right Arithmetic. -// -// Forms: -// -// PSRAL imm8 xmm -// PSRAL xmm xmm -// PSRAL m128 xmm -// Construct and append a PSRAL instruction to the active function. -func (c *Context) PSRAL(imx, x operand.Op) { - if inst, err := x86.PSRAL(imx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSRAL: Shift Packed Doubleword Data Right Arithmetic. -// -// Forms: -// -// PSRAL imm8 xmm -// PSRAL xmm xmm -// PSRAL m128 xmm -// Construct and append a PSRAL instruction to the active function. -// Operates on the global context. -func PSRAL(imx, x operand.Op) { ctx.PSRAL(imx, x) } - -// PSRAW: Shift Packed Word Data Right Arithmetic. -// -// Forms: -// -// PSRAW imm8 xmm -// PSRAW xmm xmm -// PSRAW m128 xmm -// Construct and append a PSRAW instruction to the active function. -func (c *Context) PSRAW(imx, x operand.Op) { - if inst, err := x86.PSRAW(imx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSRAW: Shift Packed Word Data Right Arithmetic. -// -// Forms: -// -// PSRAW imm8 xmm -// PSRAW xmm xmm -// PSRAW m128 xmm -// Construct and append a PSRAW instruction to the active function. -// Operates on the global context. -func PSRAW(imx, x operand.Op) { ctx.PSRAW(imx, x) } - -// PSRLDQ: Shift Packed Double Quadword Right Logical. -// -// Forms: -// -// PSRLDQ imm8 xmm -// Construct and append a PSRLDQ instruction to the active function. -func (c *Context) PSRLDQ(i, x operand.Op) { - if inst, err := x86.PSRLDQ(i, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSRLDQ: Shift Packed Double Quadword Right Logical. -// -// Forms: -// -// PSRLDQ imm8 xmm -// Construct and append a PSRLDQ instruction to the active function. -// Operates on the global context. -func PSRLDQ(i, x operand.Op) { ctx.PSRLDQ(i, x) } - -// PSRLL: Shift Packed Doubleword Data Right Logical. -// -// Forms: -// -// PSRLL imm8 xmm -// PSRLL xmm xmm -// PSRLL m128 xmm -// Construct and append a PSRLL instruction to the active function. -func (c *Context) PSRLL(imx, x operand.Op) { - if inst, err := x86.PSRLL(imx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSRLL: Shift Packed Doubleword Data Right Logical. -// -// Forms: -// -// PSRLL imm8 xmm -// PSRLL xmm xmm -// PSRLL m128 xmm -// Construct and append a PSRLL instruction to the active function. -// Operates on the global context. -func PSRLL(imx, x operand.Op) { ctx.PSRLL(imx, x) } - -// PSRLO: Shift Packed Double Quadword Right Logical. -// -// Forms: -// -// PSRLO imm8 xmm -// Construct and append a PSRLO instruction to the active function. -func (c *Context) PSRLO(i, x operand.Op) { - if inst, err := x86.PSRLO(i, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSRLO: Shift Packed Double Quadword Right Logical. -// -// Forms: -// -// PSRLO imm8 xmm -// Construct and append a PSRLO instruction to the active function. -// Operates on the global context. -func PSRLO(i, x operand.Op) { ctx.PSRLO(i, x) } - -// PSRLQ: Shift Packed Quadword Data Right Logical. -// -// Forms: -// -// PSRLQ imm8 xmm -// PSRLQ xmm xmm -// PSRLQ m128 xmm -// Construct and append a PSRLQ instruction to the active function. -func (c *Context) PSRLQ(imx, x operand.Op) { - if inst, err := x86.PSRLQ(imx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSRLQ: Shift Packed Quadword Data Right Logical. -// -// Forms: -// -// PSRLQ imm8 xmm -// PSRLQ xmm xmm -// PSRLQ m128 xmm -// Construct and append a PSRLQ instruction to the active function. -// Operates on the global context. -func PSRLQ(imx, x operand.Op) { ctx.PSRLQ(imx, x) } - -// PSRLW: Shift Packed Word Data Right Logical. -// -// Forms: -// -// PSRLW imm8 xmm -// PSRLW xmm xmm -// PSRLW m128 xmm -// Construct and append a PSRLW instruction to the active function. -func (c *Context) PSRLW(imx, x operand.Op) { - if inst, err := x86.PSRLW(imx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSRLW: Shift Packed Word Data Right Logical. -// -// Forms: -// -// PSRLW imm8 xmm -// PSRLW xmm xmm -// PSRLW m128 xmm -// Construct and append a PSRLW instruction to the active function. -// Operates on the global context. -func PSRLW(imx, x operand.Op) { ctx.PSRLW(imx, x) } - -// PSUBB: Subtract Packed Byte Integers. -// -// Forms: -// -// PSUBB xmm xmm -// PSUBB m128 xmm -// Construct and append a PSUBB instruction to the active function. -func (c *Context) PSUBB(mx, x operand.Op) { - if inst, err := x86.PSUBB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSUBB: Subtract Packed Byte Integers. -// -// Forms: -// -// PSUBB xmm xmm -// PSUBB m128 xmm -// Construct and append a PSUBB instruction to the active function. -// Operates on the global context. -func PSUBB(mx, x operand.Op) { ctx.PSUBB(mx, x) } - -// PSUBL: Subtract Packed Doubleword Integers. -// -// Forms: -// -// PSUBL xmm xmm -// PSUBL m128 xmm -// Construct and append a PSUBL instruction to the active function. -func (c *Context) PSUBL(mx, x operand.Op) { - if inst, err := x86.PSUBL(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSUBL: Subtract Packed Doubleword Integers. -// -// Forms: -// -// PSUBL xmm xmm -// PSUBL m128 xmm -// Construct and append a PSUBL instruction to the active function. -// Operates on the global context. -func PSUBL(mx, x operand.Op) { ctx.PSUBL(mx, x) } - -// PSUBQ: Subtract Packed Quadword Integers. -// -// Forms: -// -// PSUBQ xmm xmm -// PSUBQ m128 xmm -// Construct and append a PSUBQ instruction to the active function. -func (c *Context) PSUBQ(mx, x operand.Op) { - if inst, err := x86.PSUBQ(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSUBQ: Subtract Packed Quadword Integers. -// -// Forms: -// -// PSUBQ xmm xmm -// PSUBQ m128 xmm -// Construct and append a PSUBQ instruction to the active function. -// Operates on the global context. -func PSUBQ(mx, x operand.Op) { ctx.PSUBQ(mx, x) } - -// PSUBSB: Subtract Packed Signed Byte Integers with Signed Saturation. -// -// Forms: -// -// PSUBSB xmm xmm -// PSUBSB m128 xmm -// Construct and append a PSUBSB instruction to the active function. -func (c *Context) PSUBSB(mx, x operand.Op) { - if inst, err := x86.PSUBSB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSUBSB: Subtract Packed Signed Byte Integers with Signed Saturation. -// -// Forms: -// -// PSUBSB xmm xmm -// PSUBSB m128 xmm -// Construct and append a PSUBSB instruction to the active function. -// Operates on the global context. -func PSUBSB(mx, x operand.Op) { ctx.PSUBSB(mx, x) } - -// PSUBSW: Subtract Packed Signed Word Integers with Signed Saturation. -// -// Forms: -// -// PSUBSW xmm xmm -// PSUBSW m128 xmm -// Construct and append a PSUBSW instruction to the active function. -func (c *Context) PSUBSW(mx, x operand.Op) { - if inst, err := x86.PSUBSW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSUBSW: Subtract Packed Signed Word Integers with Signed Saturation. -// -// Forms: -// -// PSUBSW xmm xmm -// PSUBSW m128 xmm -// Construct and append a PSUBSW instruction to the active function. -// Operates on the global context. -func PSUBSW(mx, x operand.Op) { ctx.PSUBSW(mx, x) } - -// PSUBUSB: Subtract Packed Unsigned Byte Integers with Unsigned Saturation. -// -// Forms: -// -// PSUBUSB xmm xmm -// PSUBUSB m128 xmm -// Construct and append a PSUBUSB instruction to the active function. -func (c *Context) PSUBUSB(mx, x operand.Op) { - if inst, err := x86.PSUBUSB(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSUBUSB: Subtract Packed Unsigned Byte Integers with Unsigned Saturation. -// -// Forms: -// -// PSUBUSB xmm xmm -// PSUBUSB m128 xmm -// Construct and append a PSUBUSB instruction to the active function. -// Operates on the global context. -func PSUBUSB(mx, x operand.Op) { ctx.PSUBUSB(mx, x) } - -// PSUBUSW: Subtract Packed Unsigned Word Integers with Unsigned Saturation. -// -// Forms: -// -// PSUBUSW xmm xmm -// PSUBUSW m128 xmm -// Construct and append a PSUBUSW instruction to the active function. -func (c *Context) PSUBUSW(mx, x operand.Op) { - if inst, err := x86.PSUBUSW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSUBUSW: Subtract Packed Unsigned Word Integers with Unsigned Saturation. -// -// Forms: -// -// PSUBUSW xmm xmm -// PSUBUSW m128 xmm -// Construct and append a PSUBUSW instruction to the active function. -// Operates on the global context. -func PSUBUSW(mx, x operand.Op) { ctx.PSUBUSW(mx, x) } - -// PSUBW: Subtract Packed Word Integers. -// -// Forms: -// -// PSUBW xmm xmm -// PSUBW m128 xmm -// Construct and append a PSUBW instruction to the active function. -func (c *Context) PSUBW(mx, x operand.Op) { - if inst, err := x86.PSUBW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PSUBW: Subtract Packed Word Integers. -// -// Forms: -// -// PSUBW xmm xmm -// PSUBW m128 xmm -// Construct and append a PSUBW instruction to the active function. -// Operates on the global context. -func PSUBW(mx, x operand.Op) { ctx.PSUBW(mx, x) } - -// PTEST: Packed Logical Compare. -// -// Forms: -// -// PTEST xmm xmm -// PTEST m128 xmm -// Construct and append a PTEST instruction to the active function. -func (c *Context) PTEST(mx, x operand.Op) { - if inst, err := x86.PTEST(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PTEST: Packed Logical Compare. -// -// Forms: -// -// PTEST xmm xmm -// PTEST m128 xmm -// Construct and append a PTEST instruction to the active function. -// Operates on the global context. -func PTEST(mx, x operand.Op) { ctx.PTEST(mx, x) } - -// PUNPCKHBW: Unpack and Interleave High-Order Bytes into Words. -// -// Forms: -// -// PUNPCKHBW xmm xmm -// PUNPCKHBW m128 xmm -// Construct and append a PUNPCKHBW instruction to the active function. -func (c *Context) PUNPCKHBW(mx, x operand.Op) { - if inst, err := x86.PUNPCKHBW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PUNPCKHBW: Unpack and Interleave High-Order Bytes into Words. -// -// Forms: -// -// PUNPCKHBW xmm xmm -// PUNPCKHBW m128 xmm -// Construct and append a PUNPCKHBW instruction to the active function. -// Operates on the global context. -func PUNPCKHBW(mx, x operand.Op) { ctx.PUNPCKHBW(mx, x) } - -// PUNPCKHLQ: Unpack and Interleave High-Order Doublewords into Quadwords. -// -// Forms: -// -// PUNPCKHLQ xmm xmm -// PUNPCKHLQ m128 xmm -// Construct and append a PUNPCKHLQ instruction to the active function. -func (c *Context) PUNPCKHLQ(mx, x operand.Op) { - if inst, err := x86.PUNPCKHLQ(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PUNPCKHLQ: Unpack and Interleave High-Order Doublewords into Quadwords. -// -// Forms: -// -// PUNPCKHLQ xmm xmm -// PUNPCKHLQ m128 xmm -// Construct and append a PUNPCKHLQ instruction to the active function. -// Operates on the global context. -func PUNPCKHLQ(mx, x operand.Op) { ctx.PUNPCKHLQ(mx, x) } - -// PUNPCKHQDQ: Unpack and Interleave High-Order Quadwords into Double Quadwords. -// -// Forms: -// -// PUNPCKHQDQ xmm xmm -// PUNPCKHQDQ m128 xmm -// Construct and append a PUNPCKHQDQ instruction to the active function. -func (c *Context) PUNPCKHQDQ(mx, x operand.Op) { - if inst, err := x86.PUNPCKHQDQ(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PUNPCKHQDQ: Unpack and Interleave High-Order Quadwords into Double Quadwords. -// -// Forms: -// -// PUNPCKHQDQ xmm xmm -// PUNPCKHQDQ m128 xmm -// Construct and append a PUNPCKHQDQ instruction to the active function. -// Operates on the global context. -func PUNPCKHQDQ(mx, x operand.Op) { ctx.PUNPCKHQDQ(mx, x) } - -// PUNPCKHWL: Unpack and Interleave High-Order Words into Doublewords. -// -// Forms: -// -// PUNPCKHWL xmm xmm -// PUNPCKHWL m128 xmm -// Construct and append a PUNPCKHWL instruction to the active function. -func (c *Context) PUNPCKHWL(mx, x operand.Op) { - if inst, err := x86.PUNPCKHWL(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PUNPCKHWL: Unpack and Interleave High-Order Words into Doublewords. -// -// Forms: -// -// PUNPCKHWL xmm xmm -// PUNPCKHWL m128 xmm -// Construct and append a PUNPCKHWL instruction to the active function. -// Operates on the global context. -func PUNPCKHWL(mx, x operand.Op) { ctx.PUNPCKHWL(mx, x) } - -// PUNPCKLBW: Unpack and Interleave Low-Order Bytes into Words. -// -// Forms: -// -// PUNPCKLBW xmm xmm -// PUNPCKLBW m128 xmm -// Construct and append a PUNPCKLBW instruction to the active function. -func (c *Context) PUNPCKLBW(mx, x operand.Op) { - if inst, err := x86.PUNPCKLBW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PUNPCKLBW: Unpack and Interleave Low-Order Bytes into Words. -// -// Forms: -// -// PUNPCKLBW xmm xmm -// PUNPCKLBW m128 xmm -// Construct and append a PUNPCKLBW instruction to the active function. -// Operates on the global context. -func PUNPCKLBW(mx, x operand.Op) { ctx.PUNPCKLBW(mx, x) } - -// PUNPCKLLQ: Unpack and Interleave Low-Order Doublewords into Quadwords. -// -// Forms: -// -// PUNPCKLLQ xmm xmm -// PUNPCKLLQ m128 xmm -// Construct and append a PUNPCKLLQ instruction to the active function. -func (c *Context) PUNPCKLLQ(mx, x operand.Op) { - if inst, err := x86.PUNPCKLLQ(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PUNPCKLLQ: Unpack and Interleave Low-Order Doublewords into Quadwords. -// -// Forms: -// -// PUNPCKLLQ xmm xmm -// PUNPCKLLQ m128 xmm -// Construct and append a PUNPCKLLQ instruction to the active function. -// Operates on the global context. -func PUNPCKLLQ(mx, x operand.Op) { ctx.PUNPCKLLQ(mx, x) } - -// PUNPCKLQDQ: Unpack and Interleave Low-Order Quadwords into Double Quadwords. -// -// Forms: -// -// PUNPCKLQDQ xmm xmm -// PUNPCKLQDQ m128 xmm -// Construct and append a PUNPCKLQDQ instruction to the active function. -func (c *Context) PUNPCKLQDQ(mx, x operand.Op) { - if inst, err := x86.PUNPCKLQDQ(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PUNPCKLQDQ: Unpack and Interleave Low-Order Quadwords into Double Quadwords. -// -// Forms: -// -// PUNPCKLQDQ xmm xmm -// PUNPCKLQDQ m128 xmm -// Construct and append a PUNPCKLQDQ instruction to the active function. -// Operates on the global context. -func PUNPCKLQDQ(mx, x operand.Op) { ctx.PUNPCKLQDQ(mx, x) } - -// PUNPCKLWL: Unpack and Interleave Low-Order Words into Doublewords. -// -// Forms: -// -// PUNPCKLWL xmm xmm -// PUNPCKLWL m128 xmm -// Construct and append a PUNPCKLWL instruction to the active function. -func (c *Context) PUNPCKLWL(mx, x operand.Op) { - if inst, err := x86.PUNPCKLWL(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PUNPCKLWL: Unpack and Interleave Low-Order Words into Doublewords. -// -// Forms: -// -// PUNPCKLWL xmm xmm -// PUNPCKLWL m128 xmm -// Construct and append a PUNPCKLWL instruction to the active function. -// Operates on the global context. -func PUNPCKLWL(mx, x operand.Op) { ctx.PUNPCKLWL(mx, x) } - -// PUSHQ: Push Value Onto the Stack. -// -// Forms: -// -// PUSHQ imm8 -// PUSHQ imm32 -// PUSHQ r64 -// PUSHQ m64 -// Construct and append a PUSHQ instruction to the active function. -func (c *Context) PUSHQ(imr operand.Op) { - if inst, err := x86.PUSHQ(imr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PUSHQ: Push Value Onto the Stack. -// -// Forms: -// -// PUSHQ imm8 -// PUSHQ imm32 -// PUSHQ r64 -// PUSHQ m64 -// Construct and append a PUSHQ instruction to the active function. -// Operates on the global context. -func PUSHQ(imr operand.Op) { ctx.PUSHQ(imr) } - -// PUSHW: Push Value Onto the Stack. -// -// Forms: -// -// PUSHW r16 -// PUSHW m16 -// Construct and append a PUSHW instruction to the active function. -func (c *Context) PUSHW(mr operand.Op) { - if inst, err := x86.PUSHW(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PUSHW: Push Value Onto the Stack. -// -// Forms: -// -// PUSHW r16 -// PUSHW m16 -// Construct and append a PUSHW instruction to the active function. -// Operates on the global context. -func PUSHW(mr operand.Op) { ctx.PUSHW(mr) } - -// PXOR: Packed Bitwise Logical Exclusive OR. -// -// Forms: -// -// PXOR xmm xmm -// PXOR m128 xmm -// Construct and append a PXOR instruction to the active function. -func (c *Context) PXOR(mx, x operand.Op) { - if inst, err := x86.PXOR(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// PXOR: Packed Bitwise Logical Exclusive OR. -// -// Forms: -// -// PXOR xmm xmm -// PXOR m128 xmm -// Construct and append a PXOR instruction to the active function. -// Operates on the global context. -func PXOR(mx, x operand.Op) { ctx.PXOR(mx, x) } - -// RCLB: Rotate Left through Carry Flag. -// -// Forms: -// -// RCLB 1 r8 -// RCLB imm8 r8 -// RCLB cl r8 -// RCLB 1 m8 -// RCLB imm8 m8 -// RCLB cl m8 -// Construct and append a RCLB instruction to the active function. -func (c *Context) RCLB(ci, mr operand.Op) { - if inst, err := x86.RCLB(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RCLB: Rotate Left through Carry Flag. -// -// Forms: -// -// RCLB 1 r8 -// RCLB imm8 r8 -// RCLB cl r8 -// RCLB 1 m8 -// RCLB imm8 m8 -// RCLB cl m8 -// Construct and append a RCLB instruction to the active function. -// Operates on the global context. -func RCLB(ci, mr operand.Op) { ctx.RCLB(ci, mr) } - -// RCLL: Rotate Left through Carry Flag. -// -// Forms: -// -// RCLL 1 r32 -// RCLL imm8 r32 -// RCLL cl r32 -// RCLL 1 m32 -// RCLL imm8 m32 -// RCLL cl m32 -// Construct and append a RCLL instruction to the active function. -func (c *Context) RCLL(ci, mr operand.Op) { - if inst, err := x86.RCLL(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RCLL: Rotate Left through Carry Flag. -// -// Forms: -// -// RCLL 1 r32 -// RCLL imm8 r32 -// RCLL cl r32 -// RCLL 1 m32 -// RCLL imm8 m32 -// RCLL cl m32 -// Construct and append a RCLL instruction to the active function. -// Operates on the global context. -func RCLL(ci, mr operand.Op) { ctx.RCLL(ci, mr) } - -// RCLQ: Rotate Left through Carry Flag. -// -// Forms: -// -// RCLQ 1 r64 -// RCLQ imm8 r64 -// RCLQ cl r64 -// RCLQ 1 m64 -// RCLQ imm8 m64 -// RCLQ cl m64 -// Construct and append a RCLQ instruction to the active function. -func (c *Context) RCLQ(ci, mr operand.Op) { - if inst, err := x86.RCLQ(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RCLQ: Rotate Left through Carry Flag. -// -// Forms: -// -// RCLQ 1 r64 -// RCLQ imm8 r64 -// RCLQ cl r64 -// RCLQ 1 m64 -// RCLQ imm8 m64 -// RCLQ cl m64 -// Construct and append a RCLQ instruction to the active function. -// Operates on the global context. -func RCLQ(ci, mr operand.Op) { ctx.RCLQ(ci, mr) } - -// RCLW: Rotate Left through Carry Flag. -// -// Forms: -// -// RCLW 1 r16 -// RCLW imm8 r16 -// RCLW cl r16 -// RCLW 1 m16 -// RCLW imm8 m16 -// RCLW cl m16 -// Construct and append a RCLW instruction to the active function. -func (c *Context) RCLW(ci, mr operand.Op) { - if inst, err := x86.RCLW(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RCLW: Rotate Left through Carry Flag. -// -// Forms: -// -// RCLW 1 r16 -// RCLW imm8 r16 -// RCLW cl r16 -// RCLW 1 m16 -// RCLW imm8 m16 -// RCLW cl m16 -// Construct and append a RCLW instruction to the active function. -// Operates on the global context. -func RCLW(ci, mr operand.Op) { ctx.RCLW(ci, mr) } - -// RCPPS: Compute Approximate Reciprocals of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// RCPPS xmm xmm -// RCPPS m128 xmm -// Construct and append a RCPPS instruction to the active function. -func (c *Context) RCPPS(mx, x operand.Op) { - if inst, err := x86.RCPPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RCPPS: Compute Approximate Reciprocals of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// RCPPS xmm xmm -// RCPPS m128 xmm -// Construct and append a RCPPS instruction to the active function. -// Operates on the global context. -func RCPPS(mx, x operand.Op) { ctx.RCPPS(mx, x) } - -// RCPSS: Compute Approximate Reciprocal of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// RCPSS xmm xmm -// RCPSS m32 xmm -// Construct and append a RCPSS instruction to the active function. -func (c *Context) RCPSS(mx, x operand.Op) { - if inst, err := x86.RCPSS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RCPSS: Compute Approximate Reciprocal of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// RCPSS xmm xmm -// RCPSS m32 xmm -// Construct and append a RCPSS instruction to the active function. -// Operates on the global context. -func RCPSS(mx, x operand.Op) { ctx.RCPSS(mx, x) } - -// RCRB: Rotate Right through Carry Flag. -// -// Forms: -// -// RCRB 1 r8 -// RCRB imm8 r8 -// RCRB cl r8 -// RCRB 1 m8 -// RCRB imm8 m8 -// RCRB cl m8 -// Construct and append a RCRB instruction to the active function. -func (c *Context) RCRB(ci, mr operand.Op) { - if inst, err := x86.RCRB(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RCRB: Rotate Right through Carry Flag. -// -// Forms: -// -// RCRB 1 r8 -// RCRB imm8 r8 -// RCRB cl r8 -// RCRB 1 m8 -// RCRB imm8 m8 -// RCRB cl m8 -// Construct and append a RCRB instruction to the active function. -// Operates on the global context. -func RCRB(ci, mr operand.Op) { ctx.RCRB(ci, mr) } - -// RCRL: Rotate Right through Carry Flag. -// -// Forms: -// -// RCRL 1 r32 -// RCRL imm8 r32 -// RCRL cl r32 -// RCRL 1 m32 -// RCRL imm8 m32 -// RCRL cl m32 -// Construct and append a RCRL instruction to the active function. -func (c *Context) RCRL(ci, mr operand.Op) { - if inst, err := x86.RCRL(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RCRL: Rotate Right through Carry Flag. -// -// Forms: -// -// RCRL 1 r32 -// RCRL imm8 r32 -// RCRL cl r32 -// RCRL 1 m32 -// RCRL imm8 m32 -// RCRL cl m32 -// Construct and append a RCRL instruction to the active function. -// Operates on the global context. -func RCRL(ci, mr operand.Op) { ctx.RCRL(ci, mr) } - -// RCRQ: Rotate Right through Carry Flag. -// -// Forms: -// -// RCRQ 1 r64 -// RCRQ imm8 r64 -// RCRQ cl r64 -// RCRQ 1 m64 -// RCRQ imm8 m64 -// RCRQ cl m64 -// Construct and append a RCRQ instruction to the active function. -func (c *Context) RCRQ(ci, mr operand.Op) { - if inst, err := x86.RCRQ(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RCRQ: Rotate Right through Carry Flag. -// -// Forms: -// -// RCRQ 1 r64 -// RCRQ imm8 r64 -// RCRQ cl r64 -// RCRQ 1 m64 -// RCRQ imm8 m64 -// RCRQ cl m64 -// Construct and append a RCRQ instruction to the active function. -// Operates on the global context. -func RCRQ(ci, mr operand.Op) { ctx.RCRQ(ci, mr) } - -// RCRW: Rotate Right through Carry Flag. -// -// Forms: -// -// RCRW 1 r16 -// RCRW imm8 r16 -// RCRW cl r16 -// RCRW 1 m16 -// RCRW imm8 m16 -// RCRW cl m16 -// Construct and append a RCRW instruction to the active function. -func (c *Context) RCRW(ci, mr operand.Op) { - if inst, err := x86.RCRW(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RCRW: Rotate Right through Carry Flag. -// -// Forms: -// -// RCRW 1 r16 -// RCRW imm8 r16 -// RCRW cl r16 -// RCRW 1 m16 -// RCRW imm8 m16 -// RCRW cl m16 -// Construct and append a RCRW instruction to the active function. -// Operates on the global context. -func RCRW(ci, mr operand.Op) { ctx.RCRW(ci, mr) } - -// RDRANDL: Read Random Number. -// -// Forms: -// -// RDRANDL r32 -// Construct and append a RDRANDL instruction to the active function. -func (c *Context) RDRANDL(r operand.Op) { - if inst, err := x86.RDRANDL(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RDRANDL: Read Random Number. -// -// Forms: -// -// RDRANDL r32 -// Construct and append a RDRANDL instruction to the active function. -// Operates on the global context. -func RDRANDL(r operand.Op) { ctx.RDRANDL(r) } - -// RDRANDQ: Read Random Number. -// -// Forms: -// -// RDRANDQ r64 -// Construct and append a RDRANDQ instruction to the active function. -func (c *Context) RDRANDQ(r operand.Op) { - if inst, err := x86.RDRANDQ(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RDRANDQ: Read Random Number. -// -// Forms: -// -// RDRANDQ r64 -// Construct and append a RDRANDQ instruction to the active function. -// Operates on the global context. -func RDRANDQ(r operand.Op) { ctx.RDRANDQ(r) } - -// RDRANDW: Read Random Number. -// -// Forms: -// -// RDRANDW r16 -// Construct and append a RDRANDW instruction to the active function. -func (c *Context) RDRANDW(r operand.Op) { - if inst, err := x86.RDRANDW(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RDRANDW: Read Random Number. -// -// Forms: -// -// RDRANDW r16 -// Construct and append a RDRANDW instruction to the active function. -// Operates on the global context. -func RDRANDW(r operand.Op) { ctx.RDRANDW(r) } - -// RDSEEDL: Read Random SEED. -// -// Forms: -// -// RDSEEDL r32 -// Construct and append a RDSEEDL instruction to the active function. -func (c *Context) RDSEEDL(r operand.Op) { - if inst, err := x86.RDSEEDL(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RDSEEDL: Read Random SEED. -// -// Forms: -// -// RDSEEDL r32 -// Construct and append a RDSEEDL instruction to the active function. -// Operates on the global context. -func RDSEEDL(r operand.Op) { ctx.RDSEEDL(r) } - -// RDSEEDQ: Read Random SEED. -// -// Forms: -// -// RDSEEDQ r64 -// Construct and append a RDSEEDQ instruction to the active function. -func (c *Context) RDSEEDQ(r operand.Op) { - if inst, err := x86.RDSEEDQ(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RDSEEDQ: Read Random SEED. -// -// Forms: -// -// RDSEEDQ r64 -// Construct and append a RDSEEDQ instruction to the active function. -// Operates on the global context. -func RDSEEDQ(r operand.Op) { ctx.RDSEEDQ(r) } - -// RDSEEDW: Read Random SEED. -// -// Forms: -// -// RDSEEDW r16 -// Construct and append a RDSEEDW instruction to the active function. -func (c *Context) RDSEEDW(r operand.Op) { - if inst, err := x86.RDSEEDW(r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RDSEEDW: Read Random SEED. -// -// Forms: -// -// RDSEEDW r16 -// Construct and append a RDSEEDW instruction to the active function. -// Operates on the global context. -func RDSEEDW(r operand.Op) { ctx.RDSEEDW(r) } - -// RDTSC: Read Time-Stamp Counter. -// -// Forms: -// -// RDTSC -// Construct and append a RDTSC instruction to the active function. -func (c *Context) RDTSC() { - if inst, err := x86.RDTSC(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RDTSC: Read Time-Stamp Counter. -// -// Forms: -// -// RDTSC -// Construct and append a RDTSC instruction to the active function. -// Operates on the global context. -func RDTSC() { ctx.RDTSC() } - -// RDTSCP: Read Time-Stamp Counter and Processor ID. -// -// Forms: -// -// RDTSCP -// Construct and append a RDTSCP instruction to the active function. -func (c *Context) RDTSCP() { - if inst, err := x86.RDTSCP(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RDTSCP: Read Time-Stamp Counter and Processor ID. -// -// Forms: -// -// RDTSCP -// Construct and append a RDTSCP instruction to the active function. -// Operates on the global context. -func RDTSCP() { ctx.RDTSCP() } - -// RET: Return from Procedure. -// -// Forms: -// -// RET -// Construct and append a RET instruction to the active function. -func (c *Context) RET() { - if inst, err := x86.RET(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RET: Return from Procedure. -// -// Forms: -// -// RET -// Construct and append a RET instruction to the active function. -// Operates on the global context. -func RET() { ctx.RET() } - -// RETFL: Return from Procedure. -// -// Forms: -// -// RETFL imm16 -// Construct and append a RETFL instruction to the active function. -func (c *Context) RETFL(i operand.Op) { - if inst, err := x86.RETFL(i); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RETFL: Return from Procedure. -// -// Forms: -// -// RETFL imm16 -// Construct and append a RETFL instruction to the active function. -// Operates on the global context. -func RETFL(i operand.Op) { ctx.RETFL(i) } - -// RETFQ: Return from Procedure. -// -// Forms: -// -// RETFQ imm16 -// Construct and append a RETFQ instruction to the active function. -func (c *Context) RETFQ(i operand.Op) { - if inst, err := x86.RETFQ(i); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RETFQ: Return from Procedure. -// -// Forms: -// -// RETFQ imm16 -// Construct and append a RETFQ instruction to the active function. -// Operates on the global context. -func RETFQ(i operand.Op) { ctx.RETFQ(i) } - -// RETFW: Return from Procedure. -// -// Forms: -// -// RETFW imm16 -// Construct and append a RETFW instruction to the active function. -func (c *Context) RETFW(i operand.Op) { - if inst, err := x86.RETFW(i); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RETFW: Return from Procedure. -// -// Forms: -// -// RETFW imm16 -// Construct and append a RETFW instruction to the active function. -// Operates on the global context. -func RETFW(i operand.Op) { ctx.RETFW(i) } - -// ROLB: Rotate Left. -// -// Forms: -// -// ROLB 1 r8 -// ROLB imm8 r8 -// ROLB cl r8 -// ROLB 1 m8 -// ROLB imm8 m8 -// ROLB cl m8 -// Construct and append a ROLB instruction to the active function. -func (c *Context) ROLB(ci, mr operand.Op) { - if inst, err := x86.ROLB(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ROLB: Rotate Left. -// -// Forms: -// -// ROLB 1 r8 -// ROLB imm8 r8 -// ROLB cl r8 -// ROLB 1 m8 -// ROLB imm8 m8 -// ROLB cl m8 -// Construct and append a ROLB instruction to the active function. -// Operates on the global context. -func ROLB(ci, mr operand.Op) { ctx.ROLB(ci, mr) } - -// ROLL: Rotate Left. -// -// Forms: -// -// ROLL 1 r32 -// ROLL imm8 r32 -// ROLL cl r32 -// ROLL 1 m32 -// ROLL imm8 m32 -// ROLL cl m32 -// Construct and append a ROLL instruction to the active function. -func (c *Context) ROLL(ci, mr operand.Op) { - if inst, err := x86.ROLL(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ROLL: Rotate Left. -// -// Forms: -// -// ROLL 1 r32 -// ROLL imm8 r32 -// ROLL cl r32 -// ROLL 1 m32 -// ROLL imm8 m32 -// ROLL cl m32 -// Construct and append a ROLL instruction to the active function. -// Operates on the global context. -func ROLL(ci, mr operand.Op) { ctx.ROLL(ci, mr) } - -// ROLQ: Rotate Left. -// -// Forms: -// -// ROLQ 1 r64 -// ROLQ imm8 r64 -// ROLQ cl r64 -// ROLQ 1 m64 -// ROLQ imm8 m64 -// ROLQ cl m64 -// Construct and append a ROLQ instruction to the active function. -func (c *Context) ROLQ(ci, mr operand.Op) { - if inst, err := x86.ROLQ(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ROLQ: Rotate Left. -// -// Forms: -// -// ROLQ 1 r64 -// ROLQ imm8 r64 -// ROLQ cl r64 -// ROLQ 1 m64 -// ROLQ imm8 m64 -// ROLQ cl m64 -// Construct and append a ROLQ instruction to the active function. -// Operates on the global context. -func ROLQ(ci, mr operand.Op) { ctx.ROLQ(ci, mr) } - -// ROLW: Rotate Left. -// -// Forms: -// -// ROLW 1 r16 -// ROLW imm8 r16 -// ROLW cl r16 -// ROLW 1 m16 -// ROLW imm8 m16 -// ROLW cl m16 -// Construct and append a ROLW instruction to the active function. -func (c *Context) ROLW(ci, mr operand.Op) { - if inst, err := x86.ROLW(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ROLW: Rotate Left. -// -// Forms: -// -// ROLW 1 r16 -// ROLW imm8 r16 -// ROLW cl r16 -// ROLW 1 m16 -// ROLW imm8 m16 -// ROLW cl m16 -// Construct and append a ROLW instruction to the active function. -// Operates on the global context. -func ROLW(ci, mr operand.Op) { ctx.ROLW(ci, mr) } - -// RORB: Rotate Right. -// -// Forms: -// -// RORB 1 r8 -// RORB imm8 r8 -// RORB cl r8 -// RORB 1 m8 -// RORB imm8 m8 -// RORB cl m8 -// Construct and append a RORB instruction to the active function. -func (c *Context) RORB(ci, mr operand.Op) { - if inst, err := x86.RORB(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RORB: Rotate Right. -// -// Forms: -// -// RORB 1 r8 -// RORB imm8 r8 -// RORB cl r8 -// RORB 1 m8 -// RORB imm8 m8 -// RORB cl m8 -// Construct and append a RORB instruction to the active function. -// Operates on the global context. -func RORB(ci, mr operand.Op) { ctx.RORB(ci, mr) } - -// RORL: Rotate Right. -// -// Forms: -// -// RORL 1 r32 -// RORL imm8 r32 -// RORL cl r32 -// RORL 1 m32 -// RORL imm8 m32 -// RORL cl m32 -// Construct and append a RORL instruction to the active function. -func (c *Context) RORL(ci, mr operand.Op) { - if inst, err := x86.RORL(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RORL: Rotate Right. -// -// Forms: -// -// RORL 1 r32 -// RORL imm8 r32 -// RORL cl r32 -// RORL 1 m32 -// RORL imm8 m32 -// RORL cl m32 -// Construct and append a RORL instruction to the active function. -// Operates on the global context. -func RORL(ci, mr operand.Op) { ctx.RORL(ci, mr) } - -// RORQ: Rotate Right. -// -// Forms: -// -// RORQ 1 r64 -// RORQ imm8 r64 -// RORQ cl r64 -// RORQ 1 m64 -// RORQ imm8 m64 -// RORQ cl m64 -// Construct and append a RORQ instruction to the active function. -func (c *Context) RORQ(ci, mr operand.Op) { - if inst, err := x86.RORQ(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RORQ: Rotate Right. -// -// Forms: -// -// RORQ 1 r64 -// RORQ imm8 r64 -// RORQ cl r64 -// RORQ 1 m64 -// RORQ imm8 m64 -// RORQ cl m64 -// Construct and append a RORQ instruction to the active function. -// Operates on the global context. -func RORQ(ci, mr operand.Op) { ctx.RORQ(ci, mr) } - -// RORW: Rotate Right. -// -// Forms: -// -// RORW 1 r16 -// RORW imm8 r16 -// RORW cl r16 -// RORW 1 m16 -// RORW imm8 m16 -// RORW cl m16 -// Construct and append a RORW instruction to the active function. -func (c *Context) RORW(ci, mr operand.Op) { - if inst, err := x86.RORW(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RORW: Rotate Right. -// -// Forms: -// -// RORW 1 r16 -// RORW imm8 r16 -// RORW cl r16 -// RORW 1 m16 -// RORW imm8 m16 -// RORW cl m16 -// Construct and append a RORW instruction to the active function. -// Operates on the global context. -func RORW(ci, mr operand.Op) { ctx.RORW(ci, mr) } - -// RORXL: Rotate Right Logical Without Affecting Flags. -// -// Forms: -// -// RORXL imm8 r32 r32 -// RORXL imm8 m32 r32 -// Construct and append a RORXL instruction to the active function. -func (c *Context) RORXL(i, mr, r operand.Op) { - if inst, err := x86.RORXL(i, mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RORXL: Rotate Right Logical Without Affecting Flags. -// -// Forms: -// -// RORXL imm8 r32 r32 -// RORXL imm8 m32 r32 -// Construct and append a RORXL instruction to the active function. -// Operates on the global context. -func RORXL(i, mr, r operand.Op) { ctx.RORXL(i, mr, r) } - -// RORXQ: Rotate Right Logical Without Affecting Flags. -// -// Forms: -// -// RORXQ imm8 r64 r64 -// RORXQ imm8 m64 r64 -// Construct and append a RORXQ instruction to the active function. -func (c *Context) RORXQ(i, mr, r operand.Op) { - if inst, err := x86.RORXQ(i, mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RORXQ: Rotate Right Logical Without Affecting Flags. -// -// Forms: -// -// RORXQ imm8 r64 r64 -// RORXQ imm8 m64 r64 -// Construct and append a RORXQ instruction to the active function. -// Operates on the global context. -func RORXQ(i, mr, r operand.Op) { ctx.RORXQ(i, mr, r) } - -// ROUNDPD: Round Packed Double Precision Floating-Point Values. -// -// Forms: -// -// ROUNDPD imm8 xmm xmm -// ROUNDPD imm8 m128 xmm -// Construct and append a ROUNDPD instruction to the active function. -func (c *Context) ROUNDPD(i, mx, x operand.Op) { - if inst, err := x86.ROUNDPD(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ROUNDPD: Round Packed Double Precision Floating-Point Values. -// -// Forms: -// -// ROUNDPD imm8 xmm xmm -// ROUNDPD imm8 m128 xmm -// Construct and append a ROUNDPD instruction to the active function. -// Operates on the global context. -func ROUNDPD(i, mx, x operand.Op) { ctx.ROUNDPD(i, mx, x) } - -// ROUNDPS: Round Packed Single Precision Floating-Point Values. -// -// Forms: -// -// ROUNDPS imm8 xmm xmm -// ROUNDPS imm8 m128 xmm -// Construct and append a ROUNDPS instruction to the active function. -func (c *Context) ROUNDPS(i, mx, x operand.Op) { - if inst, err := x86.ROUNDPS(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ROUNDPS: Round Packed Single Precision Floating-Point Values. -// -// Forms: -// -// ROUNDPS imm8 xmm xmm -// ROUNDPS imm8 m128 xmm -// Construct and append a ROUNDPS instruction to the active function. -// Operates on the global context. -func ROUNDPS(i, mx, x operand.Op) { ctx.ROUNDPS(i, mx, x) } - -// ROUNDSD: Round Scalar Double Precision Floating-Point Values. -// -// Forms: -// -// ROUNDSD imm8 xmm xmm -// ROUNDSD imm8 m64 xmm -// Construct and append a ROUNDSD instruction to the active function. -func (c *Context) ROUNDSD(i, mx, x operand.Op) { - if inst, err := x86.ROUNDSD(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ROUNDSD: Round Scalar Double Precision Floating-Point Values. -// -// Forms: -// -// ROUNDSD imm8 xmm xmm -// ROUNDSD imm8 m64 xmm -// Construct and append a ROUNDSD instruction to the active function. -// Operates on the global context. -func ROUNDSD(i, mx, x operand.Op) { ctx.ROUNDSD(i, mx, x) } - -// ROUNDSS: Round Scalar Single Precision Floating-Point Values. -// -// Forms: -// -// ROUNDSS imm8 xmm xmm -// ROUNDSS imm8 m32 xmm -// Construct and append a ROUNDSS instruction to the active function. -func (c *Context) ROUNDSS(i, mx, x operand.Op) { - if inst, err := x86.ROUNDSS(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// ROUNDSS: Round Scalar Single Precision Floating-Point Values. -// -// Forms: -// -// ROUNDSS imm8 xmm xmm -// ROUNDSS imm8 m32 xmm -// Construct and append a ROUNDSS instruction to the active function. -// Operates on the global context. -func ROUNDSS(i, mx, x operand.Op) { ctx.ROUNDSS(i, mx, x) } - -// RSQRTPS: Compute Reciprocals of Square Roots of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// RSQRTPS xmm xmm -// RSQRTPS m128 xmm -// Construct and append a RSQRTPS instruction to the active function. -func (c *Context) RSQRTPS(mx, x operand.Op) { - if inst, err := x86.RSQRTPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RSQRTPS: Compute Reciprocals of Square Roots of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// RSQRTPS xmm xmm -// RSQRTPS m128 xmm -// Construct and append a RSQRTPS instruction to the active function. -// Operates on the global context. -func RSQRTPS(mx, x operand.Op) { ctx.RSQRTPS(mx, x) } - -// RSQRTSS: Compute Reciprocal of Square Root of Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// RSQRTSS xmm xmm -// RSQRTSS m32 xmm -// Construct and append a RSQRTSS instruction to the active function. -func (c *Context) RSQRTSS(mx, x operand.Op) { - if inst, err := x86.RSQRTSS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// RSQRTSS: Compute Reciprocal of Square Root of Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// RSQRTSS xmm xmm -// RSQRTSS m32 xmm -// Construct and append a RSQRTSS instruction to the active function. -// Operates on the global context. -func RSQRTSS(mx, x operand.Op) { ctx.RSQRTSS(mx, x) } - -// SALB: Arithmetic Shift Left. -// -// Forms: -// -// SALB 1 r8 -// SALB imm8 r8 -// SALB cl r8 -// SALB 1 m8 -// SALB imm8 m8 -// SALB cl m8 -// Construct and append a SALB instruction to the active function. -func (c *Context) SALB(ci, mr operand.Op) { - if inst, err := x86.SALB(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SALB: Arithmetic Shift Left. -// -// Forms: -// -// SALB 1 r8 -// SALB imm8 r8 -// SALB cl r8 -// SALB 1 m8 -// SALB imm8 m8 -// SALB cl m8 -// Construct and append a SALB instruction to the active function. -// Operates on the global context. -func SALB(ci, mr operand.Op) { ctx.SALB(ci, mr) } - -// SALL: Arithmetic Shift Left. -// -// Forms: -// -// SALL 1 r32 -// SALL imm8 r32 -// SALL cl r32 -// SALL 1 m32 -// SALL imm8 m32 -// SALL cl m32 -// Construct and append a SALL instruction to the active function. -func (c *Context) SALL(ci, mr operand.Op) { - if inst, err := x86.SALL(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SALL: Arithmetic Shift Left. -// -// Forms: -// -// SALL 1 r32 -// SALL imm8 r32 -// SALL cl r32 -// SALL 1 m32 -// SALL imm8 m32 -// SALL cl m32 -// Construct and append a SALL instruction to the active function. -// Operates on the global context. -func SALL(ci, mr operand.Op) { ctx.SALL(ci, mr) } - -// SALQ: Arithmetic Shift Left. -// -// Forms: -// -// SALQ 1 r64 -// SALQ imm8 r64 -// SALQ cl r64 -// SALQ 1 m64 -// SALQ imm8 m64 -// SALQ cl m64 -// Construct and append a SALQ instruction to the active function. -func (c *Context) SALQ(ci, mr operand.Op) { - if inst, err := x86.SALQ(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SALQ: Arithmetic Shift Left. -// -// Forms: -// -// SALQ 1 r64 -// SALQ imm8 r64 -// SALQ cl r64 -// SALQ 1 m64 -// SALQ imm8 m64 -// SALQ cl m64 -// Construct and append a SALQ instruction to the active function. -// Operates on the global context. -func SALQ(ci, mr operand.Op) { ctx.SALQ(ci, mr) } - -// SALW: Arithmetic Shift Left. -// -// Forms: -// -// SALW 1 r16 -// SALW imm8 r16 -// SALW cl r16 -// SALW 1 m16 -// SALW imm8 m16 -// SALW cl m16 -// Construct and append a SALW instruction to the active function. -func (c *Context) SALW(ci, mr operand.Op) { - if inst, err := x86.SALW(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SALW: Arithmetic Shift Left. -// -// Forms: -// -// SALW 1 r16 -// SALW imm8 r16 -// SALW cl r16 -// SALW 1 m16 -// SALW imm8 m16 -// SALW cl m16 -// Construct and append a SALW instruction to the active function. -// Operates on the global context. -func SALW(ci, mr operand.Op) { ctx.SALW(ci, mr) } - -// SARB: Arithmetic Shift Right. -// -// Forms: -// -// SARB 1 r8 -// SARB imm8 r8 -// SARB cl r8 -// SARB 1 m8 -// SARB imm8 m8 -// SARB cl m8 -// Construct and append a SARB instruction to the active function. -func (c *Context) SARB(ci, mr operand.Op) { - if inst, err := x86.SARB(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SARB: Arithmetic Shift Right. -// -// Forms: -// -// SARB 1 r8 -// SARB imm8 r8 -// SARB cl r8 -// SARB 1 m8 -// SARB imm8 m8 -// SARB cl m8 -// Construct and append a SARB instruction to the active function. -// Operates on the global context. -func SARB(ci, mr operand.Op) { ctx.SARB(ci, mr) } - -// SARL: Arithmetic Shift Right. -// -// Forms: -// -// SARL 1 r32 -// SARL imm8 r32 -// SARL cl r32 -// SARL 1 m32 -// SARL imm8 m32 -// SARL cl m32 -// Construct and append a SARL instruction to the active function. -func (c *Context) SARL(ci, mr operand.Op) { - if inst, err := x86.SARL(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SARL: Arithmetic Shift Right. -// -// Forms: -// -// SARL 1 r32 -// SARL imm8 r32 -// SARL cl r32 -// SARL 1 m32 -// SARL imm8 m32 -// SARL cl m32 -// Construct and append a SARL instruction to the active function. -// Operates on the global context. -func SARL(ci, mr operand.Op) { ctx.SARL(ci, mr) } - -// SARQ: Arithmetic Shift Right. -// -// Forms: -// -// SARQ 1 r64 -// SARQ imm8 r64 -// SARQ cl r64 -// SARQ 1 m64 -// SARQ imm8 m64 -// SARQ cl m64 -// Construct and append a SARQ instruction to the active function. -func (c *Context) SARQ(ci, mr operand.Op) { - if inst, err := x86.SARQ(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SARQ: Arithmetic Shift Right. -// -// Forms: -// -// SARQ 1 r64 -// SARQ imm8 r64 -// SARQ cl r64 -// SARQ 1 m64 -// SARQ imm8 m64 -// SARQ cl m64 -// Construct and append a SARQ instruction to the active function. -// Operates on the global context. -func SARQ(ci, mr operand.Op) { ctx.SARQ(ci, mr) } - -// SARW: Arithmetic Shift Right. -// -// Forms: -// -// SARW 1 r16 -// SARW imm8 r16 -// SARW cl r16 -// SARW 1 m16 -// SARW imm8 m16 -// SARW cl m16 -// Construct and append a SARW instruction to the active function. -func (c *Context) SARW(ci, mr operand.Op) { - if inst, err := x86.SARW(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SARW: Arithmetic Shift Right. -// -// Forms: -// -// SARW 1 r16 -// SARW imm8 r16 -// SARW cl r16 -// SARW 1 m16 -// SARW imm8 m16 -// SARW cl m16 -// Construct and append a SARW instruction to the active function. -// Operates on the global context. -func SARW(ci, mr operand.Op) { ctx.SARW(ci, mr) } - -// SARXL: Arithmetic Shift Right Without Affecting Flags. -// -// Forms: -// -// SARXL r32 r32 r32 -// SARXL r32 m32 r32 -// Construct and append a SARXL instruction to the active function. -func (c *Context) SARXL(r, mr, r1 operand.Op) { - if inst, err := x86.SARXL(r, mr, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SARXL: Arithmetic Shift Right Without Affecting Flags. -// -// Forms: -// -// SARXL r32 r32 r32 -// SARXL r32 m32 r32 -// Construct and append a SARXL instruction to the active function. -// Operates on the global context. -func SARXL(r, mr, r1 operand.Op) { ctx.SARXL(r, mr, r1) } - -// SARXQ: Arithmetic Shift Right Without Affecting Flags. -// -// Forms: -// -// SARXQ r64 r64 r64 -// SARXQ r64 m64 r64 -// Construct and append a SARXQ instruction to the active function. -func (c *Context) SARXQ(r, mr, r1 operand.Op) { - if inst, err := x86.SARXQ(r, mr, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SARXQ: Arithmetic Shift Right Without Affecting Flags. -// -// Forms: -// -// SARXQ r64 r64 r64 -// SARXQ r64 m64 r64 -// Construct and append a SARXQ instruction to the active function. -// Operates on the global context. -func SARXQ(r, mr, r1 operand.Op) { ctx.SARXQ(r, mr, r1) } - -// SBBB: Subtract with Borrow. -// -// Forms: -// -// SBBB imm8 al -// SBBB imm8 r8 -// SBBB r8 r8 -// SBBB m8 r8 -// SBBB imm8 m8 -// SBBB r8 m8 -// Construct and append a SBBB instruction to the active function. -func (c *Context) SBBB(imr, amr operand.Op) { - if inst, err := x86.SBBB(imr, amr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SBBB: Subtract with Borrow. -// -// Forms: -// -// SBBB imm8 al -// SBBB imm8 r8 -// SBBB r8 r8 -// SBBB m8 r8 -// SBBB imm8 m8 -// SBBB r8 m8 -// Construct and append a SBBB instruction to the active function. -// Operates on the global context. -func SBBB(imr, amr operand.Op) { ctx.SBBB(imr, amr) } - -// SBBL: Subtract with Borrow. -// -// Forms: -// -// SBBL imm32 eax -// SBBL imm8 r32 -// SBBL imm32 r32 -// SBBL r32 r32 -// SBBL m32 r32 -// SBBL imm8 m32 -// SBBL imm32 m32 -// SBBL r32 m32 -// Construct and append a SBBL instruction to the active function. -func (c *Context) SBBL(imr, emr operand.Op) { - if inst, err := x86.SBBL(imr, emr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SBBL: Subtract with Borrow. -// -// Forms: -// -// SBBL imm32 eax -// SBBL imm8 r32 -// SBBL imm32 r32 -// SBBL r32 r32 -// SBBL m32 r32 -// SBBL imm8 m32 -// SBBL imm32 m32 -// SBBL r32 m32 -// Construct and append a SBBL instruction to the active function. -// Operates on the global context. -func SBBL(imr, emr operand.Op) { ctx.SBBL(imr, emr) } - -// SBBQ: Subtract with Borrow. -// -// Forms: -// -// SBBQ imm32 rax -// SBBQ imm8 r64 -// SBBQ imm32 r64 -// SBBQ r64 r64 -// SBBQ m64 r64 -// SBBQ imm8 m64 -// SBBQ imm32 m64 -// SBBQ r64 m64 -// Construct and append a SBBQ instruction to the active function. -func (c *Context) SBBQ(imr, mr operand.Op) { - if inst, err := x86.SBBQ(imr, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SBBQ: Subtract with Borrow. -// -// Forms: -// -// SBBQ imm32 rax -// SBBQ imm8 r64 -// SBBQ imm32 r64 -// SBBQ r64 r64 -// SBBQ m64 r64 -// SBBQ imm8 m64 -// SBBQ imm32 m64 -// SBBQ r64 m64 -// Construct and append a SBBQ instruction to the active function. -// Operates on the global context. -func SBBQ(imr, mr operand.Op) { ctx.SBBQ(imr, mr) } - -// SBBW: Subtract with Borrow. -// -// Forms: -// -// SBBW imm16 ax -// SBBW imm8 r16 -// SBBW imm16 r16 -// SBBW r16 r16 -// SBBW m16 r16 -// SBBW imm8 m16 -// SBBW imm16 m16 -// SBBW r16 m16 -// Construct and append a SBBW instruction to the active function. -func (c *Context) SBBW(imr, amr operand.Op) { - if inst, err := x86.SBBW(imr, amr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SBBW: Subtract with Borrow. -// -// Forms: -// -// SBBW imm16 ax -// SBBW imm8 r16 -// SBBW imm16 r16 -// SBBW r16 r16 -// SBBW m16 r16 -// SBBW imm8 m16 -// SBBW imm16 m16 -// SBBW r16 m16 -// Construct and append a SBBW instruction to the active function. -// Operates on the global context. -func SBBW(imr, amr operand.Op) { ctx.SBBW(imr, amr) } - -// SETCC: Set byte if above or equal (CF == 0). -// -// Forms: -// -// SETCC r8 -// SETCC m8 -// Construct and append a SETCC instruction to the active function. -func (c *Context) SETCC(mr operand.Op) { - if inst, err := x86.SETCC(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SETCC: Set byte if above or equal (CF == 0). -// -// Forms: -// -// SETCC r8 -// SETCC m8 -// Construct and append a SETCC instruction to the active function. -// Operates on the global context. -func SETCC(mr operand.Op) { ctx.SETCC(mr) } - -// SETCS: Set byte if below (CF == 1). -// -// Forms: -// -// SETCS r8 -// SETCS m8 -// Construct and append a SETCS instruction to the active function. -func (c *Context) SETCS(mr operand.Op) { - if inst, err := x86.SETCS(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SETCS: Set byte if below (CF == 1). -// -// Forms: -// -// SETCS r8 -// SETCS m8 -// Construct and append a SETCS instruction to the active function. -// Operates on the global context. -func SETCS(mr operand.Op) { ctx.SETCS(mr) } - -// SETEQ: Set byte if equal (ZF == 1). -// -// Forms: -// -// SETEQ r8 -// SETEQ m8 -// Construct and append a SETEQ instruction to the active function. -func (c *Context) SETEQ(mr operand.Op) { - if inst, err := x86.SETEQ(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SETEQ: Set byte if equal (ZF == 1). -// -// Forms: -// -// SETEQ r8 -// SETEQ m8 -// Construct and append a SETEQ instruction to the active function. -// Operates on the global context. -func SETEQ(mr operand.Op) { ctx.SETEQ(mr) } - -// SETGE: Set byte if greater or equal (SF == OF). -// -// Forms: -// -// SETGE r8 -// SETGE m8 -// Construct and append a SETGE instruction to the active function. -func (c *Context) SETGE(mr operand.Op) { - if inst, err := x86.SETGE(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SETGE: Set byte if greater or equal (SF == OF). -// -// Forms: -// -// SETGE r8 -// SETGE m8 -// Construct and append a SETGE instruction to the active function. -// Operates on the global context. -func SETGE(mr operand.Op) { ctx.SETGE(mr) } - -// SETGT: Set byte if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// SETGT r8 -// SETGT m8 -// Construct and append a SETGT instruction to the active function. -func (c *Context) SETGT(mr operand.Op) { - if inst, err := x86.SETGT(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SETGT: Set byte if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// SETGT r8 -// SETGT m8 -// Construct and append a SETGT instruction to the active function. -// Operates on the global context. -func SETGT(mr operand.Op) { ctx.SETGT(mr) } - -// SETHI: Set byte if above (CF == 0 and ZF == 0). -// -// Forms: -// -// SETHI r8 -// SETHI m8 -// Construct and append a SETHI instruction to the active function. -func (c *Context) SETHI(mr operand.Op) { - if inst, err := x86.SETHI(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SETHI: Set byte if above (CF == 0 and ZF == 0). -// -// Forms: -// -// SETHI r8 -// SETHI m8 -// Construct and append a SETHI instruction to the active function. -// Operates on the global context. -func SETHI(mr operand.Op) { ctx.SETHI(mr) } - -// SETLE: Set byte if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// SETLE r8 -// SETLE m8 -// Construct and append a SETLE instruction to the active function. -func (c *Context) SETLE(mr operand.Op) { - if inst, err := x86.SETLE(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SETLE: Set byte if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// SETLE r8 -// SETLE m8 -// Construct and append a SETLE instruction to the active function. -// Operates on the global context. -func SETLE(mr operand.Op) { ctx.SETLE(mr) } - -// SETLS: Set byte if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// SETLS r8 -// SETLS m8 -// Construct and append a SETLS instruction to the active function. -func (c *Context) SETLS(mr operand.Op) { - if inst, err := x86.SETLS(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SETLS: Set byte if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// SETLS r8 -// SETLS m8 -// Construct and append a SETLS instruction to the active function. -// Operates on the global context. -func SETLS(mr operand.Op) { ctx.SETLS(mr) } - -// SETLT: Set byte if less (SF != OF). -// -// Forms: -// -// SETLT r8 -// SETLT m8 -// Construct and append a SETLT instruction to the active function. -func (c *Context) SETLT(mr operand.Op) { - if inst, err := x86.SETLT(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SETLT: Set byte if less (SF != OF). -// -// Forms: -// -// SETLT r8 -// SETLT m8 -// Construct and append a SETLT instruction to the active function. -// Operates on the global context. -func SETLT(mr operand.Op) { ctx.SETLT(mr) } - -// SETMI: Set byte if sign (SF == 1). -// -// Forms: -// -// SETMI r8 -// SETMI m8 -// Construct and append a SETMI instruction to the active function. -func (c *Context) SETMI(mr operand.Op) { - if inst, err := x86.SETMI(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SETMI: Set byte if sign (SF == 1). -// -// Forms: -// -// SETMI r8 -// SETMI m8 -// Construct and append a SETMI instruction to the active function. -// Operates on the global context. -func SETMI(mr operand.Op) { ctx.SETMI(mr) } - -// SETNE: Set byte if not equal (ZF == 0). -// -// Forms: -// -// SETNE r8 -// SETNE m8 -// Construct and append a SETNE instruction to the active function. -func (c *Context) SETNE(mr operand.Op) { - if inst, err := x86.SETNE(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SETNE: Set byte if not equal (ZF == 0). -// -// Forms: -// -// SETNE r8 -// SETNE m8 -// Construct and append a SETNE instruction to the active function. -// Operates on the global context. -func SETNE(mr operand.Op) { ctx.SETNE(mr) } - -// SETOC: Set byte if not overflow (OF == 0). -// -// Forms: -// -// SETOC r8 -// SETOC m8 -// Construct and append a SETOC instruction to the active function. -func (c *Context) SETOC(mr operand.Op) { - if inst, err := x86.SETOC(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SETOC: Set byte if not overflow (OF == 0). -// -// Forms: -// -// SETOC r8 -// SETOC m8 -// Construct and append a SETOC instruction to the active function. -// Operates on the global context. -func SETOC(mr operand.Op) { ctx.SETOC(mr) } - -// SETOS: Set byte if overflow (OF == 1). -// -// Forms: -// -// SETOS r8 -// SETOS m8 -// Construct and append a SETOS instruction to the active function. -func (c *Context) SETOS(mr operand.Op) { - if inst, err := x86.SETOS(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SETOS: Set byte if overflow (OF == 1). -// -// Forms: -// -// SETOS r8 -// SETOS m8 -// Construct and append a SETOS instruction to the active function. -// Operates on the global context. -func SETOS(mr operand.Op) { ctx.SETOS(mr) } - -// SETPC: Set byte if not parity (PF == 0). -// -// Forms: -// -// SETPC r8 -// SETPC m8 -// Construct and append a SETPC instruction to the active function. -func (c *Context) SETPC(mr operand.Op) { - if inst, err := x86.SETPC(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SETPC: Set byte if not parity (PF == 0). -// -// Forms: -// -// SETPC r8 -// SETPC m8 -// Construct and append a SETPC instruction to the active function. -// Operates on the global context. -func SETPC(mr operand.Op) { ctx.SETPC(mr) } - -// SETPL: Set byte if not sign (SF == 0). -// -// Forms: -// -// SETPL r8 -// SETPL m8 -// Construct and append a SETPL instruction to the active function. -func (c *Context) SETPL(mr operand.Op) { - if inst, err := x86.SETPL(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SETPL: Set byte if not sign (SF == 0). -// -// Forms: -// -// SETPL r8 -// SETPL m8 -// Construct and append a SETPL instruction to the active function. -// Operates on the global context. -func SETPL(mr operand.Op) { ctx.SETPL(mr) } - -// SETPS: Set byte if parity (PF == 1). -// -// Forms: -// -// SETPS r8 -// SETPS m8 -// Construct and append a SETPS instruction to the active function. -func (c *Context) SETPS(mr operand.Op) { - if inst, err := x86.SETPS(mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SETPS: Set byte if parity (PF == 1). -// -// Forms: -// -// SETPS r8 -// SETPS m8 -// Construct and append a SETPS instruction to the active function. -// Operates on the global context. -func SETPS(mr operand.Op) { ctx.SETPS(mr) } - -// SFENCE: Store Fence. -// -// Forms: -// -// SFENCE -// Construct and append a SFENCE instruction to the active function. -func (c *Context) SFENCE() { - if inst, err := x86.SFENCE(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SFENCE: Store Fence. -// -// Forms: -// -// SFENCE -// Construct and append a SFENCE instruction to the active function. -// Operates on the global context. -func SFENCE() { ctx.SFENCE() } - -// SHA1MSG1: Perform an Intermediate Calculation for the Next Four SHA1 Message Doublewords. -// -// Forms: -// -// SHA1MSG1 xmm xmm -// SHA1MSG1 m128 xmm -// Construct and append a SHA1MSG1 instruction to the active function. -func (c *Context) SHA1MSG1(mx, x operand.Op) { - if inst, err := x86.SHA1MSG1(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHA1MSG1: Perform an Intermediate Calculation for the Next Four SHA1 Message Doublewords. -// -// Forms: -// -// SHA1MSG1 xmm xmm -// SHA1MSG1 m128 xmm -// Construct and append a SHA1MSG1 instruction to the active function. -// Operates on the global context. -func SHA1MSG1(mx, x operand.Op) { ctx.SHA1MSG1(mx, x) } - -// SHA1MSG2: Perform a Final Calculation for the Next Four SHA1 Message Doublewords. -// -// Forms: -// -// SHA1MSG2 xmm xmm -// SHA1MSG2 m128 xmm -// Construct and append a SHA1MSG2 instruction to the active function. -func (c *Context) SHA1MSG2(mx, x operand.Op) { - if inst, err := x86.SHA1MSG2(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHA1MSG2: Perform a Final Calculation for the Next Four SHA1 Message Doublewords. -// -// Forms: -// -// SHA1MSG2 xmm xmm -// SHA1MSG2 m128 xmm -// Construct and append a SHA1MSG2 instruction to the active function. -// Operates on the global context. -func SHA1MSG2(mx, x operand.Op) { ctx.SHA1MSG2(mx, x) } - -// SHA1NEXTE: Calculate SHA1 State Variable E after Four Rounds. -// -// Forms: -// -// SHA1NEXTE xmm xmm -// SHA1NEXTE m128 xmm -// Construct and append a SHA1NEXTE instruction to the active function. -func (c *Context) SHA1NEXTE(mx, x operand.Op) { - if inst, err := x86.SHA1NEXTE(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHA1NEXTE: Calculate SHA1 State Variable E after Four Rounds. -// -// Forms: -// -// SHA1NEXTE xmm xmm -// SHA1NEXTE m128 xmm -// Construct and append a SHA1NEXTE instruction to the active function. -// Operates on the global context. -func SHA1NEXTE(mx, x operand.Op) { ctx.SHA1NEXTE(mx, x) } - -// SHA1RNDS4: Perform Four Rounds of SHA1 Operation. -// -// Forms: -// -// SHA1RNDS4 imm2u xmm xmm -// SHA1RNDS4 imm2u m128 xmm -// Construct and append a SHA1RNDS4 instruction to the active function. -func (c *Context) SHA1RNDS4(i, mx, x operand.Op) { - if inst, err := x86.SHA1RNDS4(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHA1RNDS4: Perform Four Rounds of SHA1 Operation. -// -// Forms: -// -// SHA1RNDS4 imm2u xmm xmm -// SHA1RNDS4 imm2u m128 xmm -// Construct and append a SHA1RNDS4 instruction to the active function. -// Operates on the global context. -func SHA1RNDS4(i, mx, x operand.Op) { ctx.SHA1RNDS4(i, mx, x) } - -// SHA256MSG1: Perform an Intermediate Calculation for the Next Four SHA256 Message Doublewords. -// -// Forms: -// -// SHA256MSG1 xmm xmm -// SHA256MSG1 m128 xmm -// Construct and append a SHA256MSG1 instruction to the active function. -func (c *Context) SHA256MSG1(mx, x operand.Op) { - if inst, err := x86.SHA256MSG1(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHA256MSG1: Perform an Intermediate Calculation for the Next Four SHA256 Message Doublewords. -// -// Forms: -// -// SHA256MSG1 xmm xmm -// SHA256MSG1 m128 xmm -// Construct and append a SHA256MSG1 instruction to the active function. -// Operates on the global context. -func SHA256MSG1(mx, x operand.Op) { ctx.SHA256MSG1(mx, x) } - -// SHA256MSG2: Perform a Final Calculation for the Next Four SHA256 Message Doublewords. -// -// Forms: -// -// SHA256MSG2 xmm xmm -// SHA256MSG2 m128 xmm -// Construct and append a SHA256MSG2 instruction to the active function. -func (c *Context) SHA256MSG2(mx, x operand.Op) { - if inst, err := x86.SHA256MSG2(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHA256MSG2: Perform a Final Calculation for the Next Four SHA256 Message Doublewords. -// -// Forms: -// -// SHA256MSG2 xmm xmm -// SHA256MSG2 m128 xmm -// Construct and append a SHA256MSG2 instruction to the active function. -// Operates on the global context. -func SHA256MSG2(mx, x operand.Op) { ctx.SHA256MSG2(mx, x) } - -// SHA256RNDS2: Perform Two Rounds of SHA256 Operation. -// -// Forms: -// -// SHA256RNDS2 xmm0 xmm xmm -// SHA256RNDS2 xmm0 m128 xmm -// Construct and append a SHA256RNDS2 instruction to the active function. -func (c *Context) SHA256RNDS2(x, mx, x1 operand.Op) { - if inst, err := x86.SHA256RNDS2(x, mx, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHA256RNDS2: Perform Two Rounds of SHA256 Operation. -// -// Forms: -// -// SHA256RNDS2 xmm0 xmm xmm -// SHA256RNDS2 xmm0 m128 xmm -// Construct and append a SHA256RNDS2 instruction to the active function. -// Operates on the global context. -func SHA256RNDS2(x, mx, x1 operand.Op) { ctx.SHA256RNDS2(x, mx, x1) } - -// SHLB: Logical Shift Left. -// -// Forms: -// -// SHLB 1 r8 -// SHLB imm8 r8 -// SHLB cl r8 -// SHLB 1 m8 -// SHLB imm8 m8 -// SHLB cl m8 -// Construct and append a SHLB instruction to the active function. -func (c *Context) SHLB(ci, mr operand.Op) { - if inst, err := x86.SHLB(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHLB: Logical Shift Left. -// -// Forms: -// -// SHLB 1 r8 -// SHLB imm8 r8 -// SHLB cl r8 -// SHLB 1 m8 -// SHLB imm8 m8 -// SHLB cl m8 -// Construct and append a SHLB instruction to the active function. -// Operates on the global context. -func SHLB(ci, mr operand.Op) { ctx.SHLB(ci, mr) } - -// SHLL: Logical Shift Left. -// -// Forms: -// -// SHLL 1 r32 -// SHLL imm8 r32 -// SHLL cl r32 -// SHLL 1 m32 -// SHLL imm8 m32 -// SHLL cl m32 -// SHLL imm8 r32 r32 -// SHLL cl r32 r32 -// SHLL imm8 r32 m32 -// SHLL cl r32 m32 -// Construct and append a SHLL instruction to the active function. -func (c *Context) SHLL(ops ...operand.Op) { - if inst, err := x86.SHLL(ops...); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHLL: Logical Shift Left. -// -// Forms: -// -// SHLL 1 r32 -// SHLL imm8 r32 -// SHLL cl r32 -// SHLL 1 m32 -// SHLL imm8 m32 -// SHLL cl m32 -// SHLL imm8 r32 r32 -// SHLL cl r32 r32 -// SHLL imm8 r32 m32 -// SHLL cl r32 m32 -// Construct and append a SHLL instruction to the active function. -// Operates on the global context. -func SHLL(ops ...operand.Op) { ctx.SHLL(ops...) } - -// SHLQ: Logical Shift Left. -// -// Forms: -// -// SHLQ 1 r64 -// SHLQ imm8 r64 -// SHLQ cl r64 -// SHLQ 1 m64 -// SHLQ imm8 m64 -// SHLQ cl m64 -// SHLQ imm8 r64 r64 -// SHLQ cl r64 r64 -// SHLQ imm8 r64 m64 -// SHLQ cl r64 m64 -// Construct and append a SHLQ instruction to the active function. -func (c *Context) SHLQ(ops ...operand.Op) { - if inst, err := x86.SHLQ(ops...); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHLQ: Logical Shift Left. -// -// Forms: -// -// SHLQ 1 r64 -// SHLQ imm8 r64 -// SHLQ cl r64 -// SHLQ 1 m64 -// SHLQ imm8 m64 -// SHLQ cl m64 -// SHLQ imm8 r64 r64 -// SHLQ cl r64 r64 -// SHLQ imm8 r64 m64 -// SHLQ cl r64 m64 -// Construct and append a SHLQ instruction to the active function. -// Operates on the global context. -func SHLQ(ops ...operand.Op) { ctx.SHLQ(ops...) } - -// SHLW: Logical Shift Left. -// -// Forms: -// -// SHLW 1 r16 -// SHLW imm8 r16 -// SHLW cl r16 -// SHLW 1 m16 -// SHLW imm8 m16 -// SHLW cl m16 -// SHLW imm8 r16 r16 -// SHLW cl r16 r16 -// SHLW imm8 r16 m16 -// SHLW cl r16 m16 -// Construct and append a SHLW instruction to the active function. -func (c *Context) SHLW(ops ...operand.Op) { - if inst, err := x86.SHLW(ops...); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHLW: Logical Shift Left. -// -// Forms: -// -// SHLW 1 r16 -// SHLW imm8 r16 -// SHLW cl r16 -// SHLW 1 m16 -// SHLW imm8 m16 -// SHLW cl m16 -// SHLW imm8 r16 r16 -// SHLW cl r16 r16 -// SHLW imm8 r16 m16 -// SHLW cl r16 m16 -// Construct and append a SHLW instruction to the active function. -// Operates on the global context. -func SHLW(ops ...operand.Op) { ctx.SHLW(ops...) } - -// SHLXL: Logical Shift Left Without Affecting Flags. -// -// Forms: -// -// SHLXL r32 r32 r32 -// SHLXL r32 m32 r32 -// Construct and append a SHLXL instruction to the active function. -func (c *Context) SHLXL(r, mr, r1 operand.Op) { - if inst, err := x86.SHLXL(r, mr, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHLXL: Logical Shift Left Without Affecting Flags. -// -// Forms: -// -// SHLXL r32 r32 r32 -// SHLXL r32 m32 r32 -// Construct and append a SHLXL instruction to the active function. -// Operates on the global context. -func SHLXL(r, mr, r1 operand.Op) { ctx.SHLXL(r, mr, r1) } - -// SHLXQ: Logical Shift Left Without Affecting Flags. -// -// Forms: -// -// SHLXQ r64 r64 r64 -// SHLXQ r64 m64 r64 -// Construct and append a SHLXQ instruction to the active function. -func (c *Context) SHLXQ(r, mr, r1 operand.Op) { - if inst, err := x86.SHLXQ(r, mr, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHLXQ: Logical Shift Left Without Affecting Flags. -// -// Forms: -// -// SHLXQ r64 r64 r64 -// SHLXQ r64 m64 r64 -// Construct and append a SHLXQ instruction to the active function. -// Operates on the global context. -func SHLXQ(r, mr, r1 operand.Op) { ctx.SHLXQ(r, mr, r1) } - -// SHRB: Logical Shift Right. -// -// Forms: -// -// SHRB 1 r8 -// SHRB imm8 r8 -// SHRB cl r8 -// SHRB 1 m8 -// SHRB imm8 m8 -// SHRB cl m8 -// Construct and append a SHRB instruction to the active function. -func (c *Context) SHRB(ci, mr operand.Op) { - if inst, err := x86.SHRB(ci, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHRB: Logical Shift Right. -// -// Forms: -// -// SHRB 1 r8 -// SHRB imm8 r8 -// SHRB cl r8 -// SHRB 1 m8 -// SHRB imm8 m8 -// SHRB cl m8 -// Construct and append a SHRB instruction to the active function. -// Operates on the global context. -func SHRB(ci, mr operand.Op) { ctx.SHRB(ci, mr) } - -// SHRL: Logical Shift Right. -// -// Forms: -// -// SHRL 1 r32 -// SHRL imm8 r32 -// SHRL cl r32 -// SHRL 1 m32 -// SHRL imm8 m32 -// SHRL cl m32 -// SHRL imm8 r32 r32 -// SHRL cl r32 r32 -// SHRL imm8 r32 m32 -// SHRL cl r32 m32 -// Construct and append a SHRL instruction to the active function. -func (c *Context) SHRL(ops ...operand.Op) { - if inst, err := x86.SHRL(ops...); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHRL: Logical Shift Right. -// -// Forms: -// -// SHRL 1 r32 -// SHRL imm8 r32 -// SHRL cl r32 -// SHRL 1 m32 -// SHRL imm8 m32 -// SHRL cl m32 -// SHRL imm8 r32 r32 -// SHRL cl r32 r32 -// SHRL imm8 r32 m32 -// SHRL cl r32 m32 -// Construct and append a SHRL instruction to the active function. -// Operates on the global context. -func SHRL(ops ...operand.Op) { ctx.SHRL(ops...) } - -// SHRQ: Logical Shift Right. -// -// Forms: -// -// SHRQ 1 r64 -// SHRQ imm8 r64 -// SHRQ cl r64 -// SHRQ 1 m64 -// SHRQ imm8 m64 -// SHRQ cl m64 -// SHRQ imm8 r64 r64 -// SHRQ cl r64 r64 -// SHRQ imm8 r64 m64 -// SHRQ cl r64 m64 -// Construct and append a SHRQ instruction to the active function. -func (c *Context) SHRQ(ops ...operand.Op) { - if inst, err := x86.SHRQ(ops...); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHRQ: Logical Shift Right. -// -// Forms: -// -// SHRQ 1 r64 -// SHRQ imm8 r64 -// SHRQ cl r64 -// SHRQ 1 m64 -// SHRQ imm8 m64 -// SHRQ cl m64 -// SHRQ imm8 r64 r64 -// SHRQ cl r64 r64 -// SHRQ imm8 r64 m64 -// SHRQ cl r64 m64 -// Construct and append a SHRQ instruction to the active function. -// Operates on the global context. -func SHRQ(ops ...operand.Op) { ctx.SHRQ(ops...) } - -// SHRW: Logical Shift Right. -// -// Forms: -// -// SHRW 1 r16 -// SHRW imm8 r16 -// SHRW cl r16 -// SHRW 1 m16 -// SHRW imm8 m16 -// SHRW cl m16 -// SHRW imm8 r16 r16 -// SHRW cl r16 r16 -// SHRW imm8 r16 m16 -// SHRW cl r16 m16 -// Construct and append a SHRW instruction to the active function. -func (c *Context) SHRW(ops ...operand.Op) { - if inst, err := x86.SHRW(ops...); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHRW: Logical Shift Right. -// -// Forms: -// -// SHRW 1 r16 -// SHRW imm8 r16 -// SHRW cl r16 -// SHRW 1 m16 -// SHRW imm8 m16 -// SHRW cl m16 -// SHRW imm8 r16 r16 -// SHRW cl r16 r16 -// SHRW imm8 r16 m16 -// SHRW cl r16 m16 -// Construct and append a SHRW instruction to the active function. -// Operates on the global context. -func SHRW(ops ...operand.Op) { ctx.SHRW(ops...) } - -// SHRXL: Logical Shift Right Without Affecting Flags. -// -// Forms: -// -// SHRXL r32 r32 r32 -// SHRXL r32 m32 r32 -// Construct and append a SHRXL instruction to the active function. -func (c *Context) SHRXL(r, mr, r1 operand.Op) { - if inst, err := x86.SHRXL(r, mr, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHRXL: Logical Shift Right Without Affecting Flags. -// -// Forms: -// -// SHRXL r32 r32 r32 -// SHRXL r32 m32 r32 -// Construct and append a SHRXL instruction to the active function. -// Operates on the global context. -func SHRXL(r, mr, r1 operand.Op) { ctx.SHRXL(r, mr, r1) } - -// SHRXQ: Logical Shift Right Without Affecting Flags. -// -// Forms: -// -// SHRXQ r64 r64 r64 -// SHRXQ r64 m64 r64 -// Construct and append a SHRXQ instruction to the active function. -func (c *Context) SHRXQ(r, mr, r1 operand.Op) { - if inst, err := x86.SHRXQ(r, mr, r1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHRXQ: Logical Shift Right Without Affecting Flags. -// -// Forms: -// -// SHRXQ r64 r64 r64 -// SHRXQ r64 m64 r64 -// Construct and append a SHRXQ instruction to the active function. -// Operates on the global context. -func SHRXQ(r, mr, r1 operand.Op) { ctx.SHRXQ(r, mr, r1) } - -// SHUFPD: Shuffle Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// SHUFPD imm8 xmm xmm -// SHUFPD imm8 m128 xmm -// Construct and append a SHUFPD instruction to the active function. -func (c *Context) SHUFPD(i, mx, x operand.Op) { - if inst, err := x86.SHUFPD(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHUFPD: Shuffle Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// SHUFPD imm8 xmm xmm -// SHUFPD imm8 m128 xmm -// Construct and append a SHUFPD instruction to the active function. -// Operates on the global context. -func SHUFPD(i, mx, x operand.Op) { ctx.SHUFPD(i, mx, x) } - -// SHUFPS: Shuffle Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// SHUFPS imm8 xmm xmm -// SHUFPS imm8 m128 xmm -// Construct and append a SHUFPS instruction to the active function. -func (c *Context) SHUFPS(i, mx, x operand.Op) { - if inst, err := x86.SHUFPS(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SHUFPS: Shuffle Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// SHUFPS imm8 xmm xmm -// SHUFPS imm8 m128 xmm -// Construct and append a SHUFPS instruction to the active function. -// Operates on the global context. -func SHUFPS(i, mx, x operand.Op) { ctx.SHUFPS(i, mx, x) } - -// SQRTPD: Compute Square Roots of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// SQRTPD xmm xmm -// SQRTPD m128 xmm -// Construct and append a SQRTPD instruction to the active function. -func (c *Context) SQRTPD(mx, x operand.Op) { - if inst, err := x86.SQRTPD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SQRTPD: Compute Square Roots of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// SQRTPD xmm xmm -// SQRTPD m128 xmm -// Construct and append a SQRTPD instruction to the active function. -// Operates on the global context. -func SQRTPD(mx, x operand.Op) { ctx.SQRTPD(mx, x) } - -// SQRTPS: Compute Square Roots of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// SQRTPS xmm xmm -// SQRTPS m128 xmm -// Construct and append a SQRTPS instruction to the active function. -func (c *Context) SQRTPS(mx, x operand.Op) { - if inst, err := x86.SQRTPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SQRTPS: Compute Square Roots of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// SQRTPS xmm xmm -// SQRTPS m128 xmm -// Construct and append a SQRTPS instruction to the active function. -// Operates on the global context. -func SQRTPS(mx, x operand.Op) { ctx.SQRTPS(mx, x) } - -// SQRTSD: Compute Square Root of Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// SQRTSD xmm xmm -// SQRTSD m64 xmm -// Construct and append a SQRTSD instruction to the active function. -func (c *Context) SQRTSD(mx, x operand.Op) { - if inst, err := x86.SQRTSD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SQRTSD: Compute Square Root of Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// SQRTSD xmm xmm -// SQRTSD m64 xmm -// Construct and append a SQRTSD instruction to the active function. -// Operates on the global context. -func SQRTSD(mx, x operand.Op) { ctx.SQRTSD(mx, x) } - -// SQRTSS: Compute Square Root of Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// SQRTSS xmm xmm -// SQRTSS m32 xmm -// Construct and append a SQRTSS instruction to the active function. -func (c *Context) SQRTSS(mx, x operand.Op) { - if inst, err := x86.SQRTSS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SQRTSS: Compute Square Root of Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// SQRTSS xmm xmm -// SQRTSS m32 xmm -// Construct and append a SQRTSS instruction to the active function. -// Operates on the global context. -func SQRTSS(mx, x operand.Op) { ctx.SQRTSS(mx, x) } - -// STC: Set Carry Flag. -// -// Forms: -// -// STC -// Construct and append a STC instruction to the active function. -func (c *Context) STC() { - if inst, err := x86.STC(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// STC: Set Carry Flag. -// -// Forms: -// -// STC -// Construct and append a STC instruction to the active function. -// Operates on the global context. -func STC() { ctx.STC() } - -// STD: Set Direction Flag. -// -// Forms: -// -// STD -// Construct and append a STD instruction to the active function. -func (c *Context) STD() { - if inst, err := x86.STD(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// STD: Set Direction Flag. -// -// Forms: -// -// STD -// Construct and append a STD instruction to the active function. -// Operates on the global context. -func STD() { ctx.STD() } - -// STMXCSR: Store MXCSR Register State. -// -// Forms: -// -// STMXCSR m32 -// Construct and append a STMXCSR instruction to the active function. -func (c *Context) STMXCSR(m operand.Op) { - if inst, err := x86.STMXCSR(m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// STMXCSR: Store MXCSR Register State. -// -// Forms: -// -// STMXCSR m32 -// Construct and append a STMXCSR instruction to the active function. -// Operates on the global context. -func STMXCSR(m operand.Op) { ctx.STMXCSR(m) } - -// SUBB: Subtract. -// -// Forms: -// -// SUBB imm8 al -// SUBB imm8 r8 -// SUBB r8 r8 -// SUBB m8 r8 -// SUBB imm8 m8 -// SUBB r8 m8 -// Construct and append a SUBB instruction to the active function. -func (c *Context) SUBB(imr, amr operand.Op) { - if inst, err := x86.SUBB(imr, amr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SUBB: Subtract. -// -// Forms: -// -// SUBB imm8 al -// SUBB imm8 r8 -// SUBB r8 r8 -// SUBB m8 r8 -// SUBB imm8 m8 -// SUBB r8 m8 -// Construct and append a SUBB instruction to the active function. -// Operates on the global context. -func SUBB(imr, amr operand.Op) { ctx.SUBB(imr, amr) } - -// SUBL: Subtract. -// -// Forms: -// -// SUBL imm32 eax -// SUBL imm8 r32 -// SUBL imm32 r32 -// SUBL r32 r32 -// SUBL m32 r32 -// SUBL imm8 m32 -// SUBL imm32 m32 -// SUBL r32 m32 -// Construct and append a SUBL instruction to the active function. -func (c *Context) SUBL(imr, emr operand.Op) { - if inst, err := x86.SUBL(imr, emr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SUBL: Subtract. -// -// Forms: -// -// SUBL imm32 eax -// SUBL imm8 r32 -// SUBL imm32 r32 -// SUBL r32 r32 -// SUBL m32 r32 -// SUBL imm8 m32 -// SUBL imm32 m32 -// SUBL r32 m32 -// Construct and append a SUBL instruction to the active function. -// Operates on the global context. -func SUBL(imr, emr operand.Op) { ctx.SUBL(imr, emr) } - -// SUBPD: Subtract Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// SUBPD xmm xmm -// SUBPD m128 xmm -// Construct and append a SUBPD instruction to the active function. -func (c *Context) SUBPD(mx, x operand.Op) { - if inst, err := x86.SUBPD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SUBPD: Subtract Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// SUBPD xmm xmm -// SUBPD m128 xmm -// Construct and append a SUBPD instruction to the active function. -// Operates on the global context. -func SUBPD(mx, x operand.Op) { ctx.SUBPD(mx, x) } - -// SUBPS: Subtract Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// SUBPS xmm xmm -// SUBPS m128 xmm -// Construct and append a SUBPS instruction to the active function. -func (c *Context) SUBPS(mx, x operand.Op) { - if inst, err := x86.SUBPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SUBPS: Subtract Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// SUBPS xmm xmm -// SUBPS m128 xmm -// Construct and append a SUBPS instruction to the active function. -// Operates on the global context. -func SUBPS(mx, x operand.Op) { ctx.SUBPS(mx, x) } - -// SUBQ: Subtract. -// -// Forms: -// -// SUBQ imm32 rax -// SUBQ imm8 r64 -// SUBQ imm32 r64 -// SUBQ r64 r64 -// SUBQ m64 r64 -// SUBQ imm8 m64 -// SUBQ imm32 m64 -// SUBQ r64 m64 -// Construct and append a SUBQ instruction to the active function. -func (c *Context) SUBQ(imr, mr operand.Op) { - if inst, err := x86.SUBQ(imr, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SUBQ: Subtract. -// -// Forms: -// -// SUBQ imm32 rax -// SUBQ imm8 r64 -// SUBQ imm32 r64 -// SUBQ r64 r64 -// SUBQ m64 r64 -// SUBQ imm8 m64 -// SUBQ imm32 m64 -// SUBQ r64 m64 -// Construct and append a SUBQ instruction to the active function. -// Operates on the global context. -func SUBQ(imr, mr operand.Op) { ctx.SUBQ(imr, mr) } - -// SUBSD: Subtract Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// SUBSD xmm xmm -// SUBSD m64 xmm -// Construct and append a SUBSD instruction to the active function. -func (c *Context) SUBSD(mx, x operand.Op) { - if inst, err := x86.SUBSD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SUBSD: Subtract Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// SUBSD xmm xmm -// SUBSD m64 xmm -// Construct and append a SUBSD instruction to the active function. -// Operates on the global context. -func SUBSD(mx, x operand.Op) { ctx.SUBSD(mx, x) } - -// SUBSS: Subtract Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// SUBSS xmm xmm -// SUBSS m32 xmm -// Construct and append a SUBSS instruction to the active function. -func (c *Context) SUBSS(mx, x operand.Op) { - if inst, err := x86.SUBSS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SUBSS: Subtract Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// SUBSS xmm xmm -// SUBSS m32 xmm -// Construct and append a SUBSS instruction to the active function. -// Operates on the global context. -func SUBSS(mx, x operand.Op) { ctx.SUBSS(mx, x) } - -// SUBW: Subtract. -// -// Forms: -// -// SUBW imm16 ax -// SUBW imm8 r16 -// SUBW imm16 r16 -// SUBW r16 r16 -// SUBW m16 r16 -// SUBW imm8 m16 -// SUBW imm16 m16 -// SUBW r16 m16 -// Construct and append a SUBW instruction to the active function. -func (c *Context) SUBW(imr, amr operand.Op) { - if inst, err := x86.SUBW(imr, amr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SUBW: Subtract. -// -// Forms: -// -// SUBW imm16 ax -// SUBW imm8 r16 -// SUBW imm16 r16 -// SUBW r16 r16 -// SUBW m16 r16 -// SUBW imm8 m16 -// SUBW imm16 m16 -// SUBW r16 m16 -// Construct and append a SUBW instruction to the active function. -// Operates on the global context. -func SUBW(imr, amr operand.Op) { ctx.SUBW(imr, amr) } - -// SYSCALL: Fast System Call. -// -// Forms: -// -// SYSCALL -// Construct and append a SYSCALL instruction to the active function. -func (c *Context) SYSCALL() { - if inst, err := x86.SYSCALL(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// SYSCALL: Fast System Call. -// -// Forms: -// -// SYSCALL -// Construct and append a SYSCALL instruction to the active function. -// Operates on the global context. -func SYSCALL() { ctx.SYSCALL() } - -// TESTB: Logical Compare. -// -// Forms: -// -// TESTB imm8 al -// TESTB imm8 r8 -// TESTB r8 r8 -// TESTB imm8 m8 -// TESTB r8 m8 -// Construct and append a TESTB instruction to the active function. -func (c *Context) TESTB(ir, amr operand.Op) { - if inst, err := x86.TESTB(ir, amr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// TESTB: Logical Compare. -// -// Forms: -// -// TESTB imm8 al -// TESTB imm8 r8 -// TESTB r8 r8 -// TESTB imm8 m8 -// TESTB r8 m8 -// Construct and append a TESTB instruction to the active function. -// Operates on the global context. -func TESTB(ir, amr operand.Op) { ctx.TESTB(ir, amr) } - -// TESTL: Logical Compare. -// -// Forms: -// -// TESTL imm32 eax -// TESTL imm32 r32 -// TESTL r32 r32 -// TESTL imm32 m32 -// TESTL r32 m32 -// Construct and append a TESTL instruction to the active function. -func (c *Context) TESTL(ir, emr operand.Op) { - if inst, err := x86.TESTL(ir, emr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// TESTL: Logical Compare. -// -// Forms: -// -// TESTL imm32 eax -// TESTL imm32 r32 -// TESTL r32 r32 -// TESTL imm32 m32 -// TESTL r32 m32 -// Construct and append a TESTL instruction to the active function. -// Operates on the global context. -func TESTL(ir, emr operand.Op) { ctx.TESTL(ir, emr) } - -// TESTQ: Logical Compare. -// -// Forms: -// -// TESTQ imm32 rax -// TESTQ imm32 r64 -// TESTQ r64 r64 -// TESTQ imm32 m64 -// TESTQ r64 m64 -// Construct and append a TESTQ instruction to the active function. -func (c *Context) TESTQ(ir, mr operand.Op) { - if inst, err := x86.TESTQ(ir, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// TESTQ: Logical Compare. -// -// Forms: -// -// TESTQ imm32 rax -// TESTQ imm32 r64 -// TESTQ r64 r64 -// TESTQ imm32 m64 -// TESTQ r64 m64 -// Construct and append a TESTQ instruction to the active function. -// Operates on the global context. -func TESTQ(ir, mr operand.Op) { ctx.TESTQ(ir, mr) } - -// TESTW: Logical Compare. -// -// Forms: -// -// TESTW imm16 ax -// TESTW imm16 r16 -// TESTW r16 r16 -// TESTW imm16 m16 -// TESTW r16 m16 -// Construct and append a TESTW instruction to the active function. -func (c *Context) TESTW(ir, amr operand.Op) { - if inst, err := x86.TESTW(ir, amr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// TESTW: Logical Compare. -// -// Forms: -// -// TESTW imm16 ax -// TESTW imm16 r16 -// TESTW r16 r16 -// TESTW imm16 m16 -// TESTW r16 m16 -// Construct and append a TESTW instruction to the active function. -// Operates on the global context. -func TESTW(ir, amr operand.Op) { ctx.TESTW(ir, amr) } - -// TZCNTL: Count the Number of Trailing Zero Bits. -// -// Forms: -// -// TZCNTL r32 r32 -// TZCNTL m32 r32 -// Construct and append a TZCNTL instruction to the active function. -func (c *Context) TZCNTL(mr, r operand.Op) { - if inst, err := x86.TZCNTL(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// TZCNTL: Count the Number of Trailing Zero Bits. -// -// Forms: -// -// TZCNTL r32 r32 -// TZCNTL m32 r32 -// Construct and append a TZCNTL instruction to the active function. -// Operates on the global context. -func TZCNTL(mr, r operand.Op) { ctx.TZCNTL(mr, r) } - -// TZCNTQ: Count the Number of Trailing Zero Bits. -// -// Forms: -// -// TZCNTQ r64 r64 -// TZCNTQ m64 r64 -// Construct and append a TZCNTQ instruction to the active function. -func (c *Context) TZCNTQ(mr, r operand.Op) { - if inst, err := x86.TZCNTQ(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// TZCNTQ: Count the Number of Trailing Zero Bits. -// -// Forms: -// -// TZCNTQ r64 r64 -// TZCNTQ m64 r64 -// Construct and append a TZCNTQ instruction to the active function. -// Operates on the global context. -func TZCNTQ(mr, r operand.Op) { ctx.TZCNTQ(mr, r) } - -// TZCNTW: Count the Number of Trailing Zero Bits. -// -// Forms: -// -// TZCNTW r16 r16 -// TZCNTW m16 r16 -// Construct and append a TZCNTW instruction to the active function. -func (c *Context) TZCNTW(mr, r operand.Op) { - if inst, err := x86.TZCNTW(mr, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// TZCNTW: Count the Number of Trailing Zero Bits. -// -// Forms: -// -// TZCNTW r16 r16 -// TZCNTW m16 r16 -// Construct and append a TZCNTW instruction to the active function. -// Operates on the global context. -func TZCNTW(mr, r operand.Op) { ctx.TZCNTW(mr, r) } - -// UCOMISD: Unordered Compare Scalar Double-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// UCOMISD xmm xmm -// UCOMISD m64 xmm -// Construct and append a UCOMISD instruction to the active function. -func (c *Context) UCOMISD(mx, x operand.Op) { - if inst, err := x86.UCOMISD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// UCOMISD: Unordered Compare Scalar Double-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// UCOMISD xmm xmm -// UCOMISD m64 xmm -// Construct and append a UCOMISD instruction to the active function. -// Operates on the global context. -func UCOMISD(mx, x operand.Op) { ctx.UCOMISD(mx, x) } - -// UCOMISS: Unordered Compare Scalar Single-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// UCOMISS xmm xmm -// UCOMISS m32 xmm -// Construct and append a UCOMISS instruction to the active function. -func (c *Context) UCOMISS(mx, x operand.Op) { - if inst, err := x86.UCOMISS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// UCOMISS: Unordered Compare Scalar Single-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// UCOMISS xmm xmm -// UCOMISS m32 xmm -// Construct and append a UCOMISS instruction to the active function. -// Operates on the global context. -func UCOMISS(mx, x operand.Op) { ctx.UCOMISS(mx, x) } - -// UD2: Undefined Instruction. -// -// Forms: -// -// UD2 -// Construct and append a UD2 instruction to the active function. -func (c *Context) UD2() { - if inst, err := x86.UD2(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// UD2: Undefined Instruction. -// -// Forms: -// -// UD2 -// Construct and append a UD2 instruction to the active function. -// Operates on the global context. -func UD2() { ctx.UD2() } - -// UNPCKHPD: Unpack and Interleave High Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// UNPCKHPD xmm xmm -// UNPCKHPD m128 xmm -// Construct and append a UNPCKHPD instruction to the active function. -func (c *Context) UNPCKHPD(mx, x operand.Op) { - if inst, err := x86.UNPCKHPD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// UNPCKHPD: Unpack and Interleave High Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// UNPCKHPD xmm xmm -// UNPCKHPD m128 xmm -// Construct and append a UNPCKHPD instruction to the active function. -// Operates on the global context. -func UNPCKHPD(mx, x operand.Op) { ctx.UNPCKHPD(mx, x) } - -// UNPCKHPS: Unpack and Interleave High Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// UNPCKHPS xmm xmm -// UNPCKHPS m128 xmm -// Construct and append a UNPCKHPS instruction to the active function. -func (c *Context) UNPCKHPS(mx, x operand.Op) { - if inst, err := x86.UNPCKHPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// UNPCKHPS: Unpack and Interleave High Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// UNPCKHPS xmm xmm -// UNPCKHPS m128 xmm -// Construct and append a UNPCKHPS instruction to the active function. -// Operates on the global context. -func UNPCKHPS(mx, x operand.Op) { ctx.UNPCKHPS(mx, x) } - -// UNPCKLPD: Unpack and Interleave Low Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// UNPCKLPD xmm xmm -// UNPCKLPD m128 xmm -// Construct and append a UNPCKLPD instruction to the active function. -func (c *Context) UNPCKLPD(mx, x operand.Op) { - if inst, err := x86.UNPCKLPD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// UNPCKLPD: Unpack and Interleave Low Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// UNPCKLPD xmm xmm -// UNPCKLPD m128 xmm -// Construct and append a UNPCKLPD instruction to the active function. -// Operates on the global context. -func UNPCKLPD(mx, x operand.Op) { ctx.UNPCKLPD(mx, x) } - -// UNPCKLPS: Unpack and Interleave Low Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// UNPCKLPS xmm xmm -// UNPCKLPS m128 xmm -// Construct and append a UNPCKLPS instruction to the active function. -func (c *Context) UNPCKLPS(mx, x operand.Op) { - if inst, err := x86.UNPCKLPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// UNPCKLPS: Unpack and Interleave Low Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// UNPCKLPS xmm xmm -// UNPCKLPS m128 xmm -// Construct and append a UNPCKLPS instruction to the active function. -// Operates on the global context. -func UNPCKLPS(mx, x operand.Op) { ctx.UNPCKLPS(mx, x) } - -// VADDPD: Add Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VADDPD xmm xmm xmm -// VADDPD m128 xmm xmm -// VADDPD ymm ymm ymm -// VADDPD m256 ymm ymm -// Construct and append a VADDPD instruction to the active function. -func (c *Context) VADDPD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VADDPD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VADDPD: Add Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VADDPD xmm xmm xmm -// VADDPD m128 xmm xmm -// VADDPD ymm ymm ymm -// VADDPD m256 ymm ymm -// Construct and append a VADDPD instruction to the active function. -// Operates on the global context. -func VADDPD(mxy, xy, xy1 operand.Op) { ctx.VADDPD(mxy, xy, xy1) } - -// VADDPS: Add Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VADDPS xmm xmm xmm -// VADDPS m128 xmm xmm -// VADDPS ymm ymm ymm -// VADDPS m256 ymm ymm -// Construct and append a VADDPS instruction to the active function. -func (c *Context) VADDPS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VADDPS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VADDPS: Add Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VADDPS xmm xmm xmm -// VADDPS m128 xmm xmm -// VADDPS ymm ymm ymm -// VADDPS m256 ymm ymm -// Construct and append a VADDPS instruction to the active function. -// Operates on the global context. -func VADDPS(mxy, xy, xy1 operand.Op) { ctx.VADDPS(mxy, xy, xy1) } - -// VADDSD: Add Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VADDSD xmm xmm xmm -// VADDSD m64 xmm xmm -// Construct and append a VADDSD instruction to the active function. -func (c *Context) VADDSD(mx, x, x1 operand.Op) { - if inst, err := x86.VADDSD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VADDSD: Add Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VADDSD xmm xmm xmm -// VADDSD m64 xmm xmm -// Construct and append a VADDSD instruction to the active function. -// Operates on the global context. -func VADDSD(mx, x, x1 operand.Op) { ctx.VADDSD(mx, x, x1) } - -// VADDSS: Add Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VADDSS xmm xmm xmm -// VADDSS m32 xmm xmm -// Construct and append a VADDSS instruction to the active function. -func (c *Context) VADDSS(mx, x, x1 operand.Op) { - if inst, err := x86.VADDSS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VADDSS: Add Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VADDSS xmm xmm xmm -// VADDSS m32 xmm xmm -// Construct and append a VADDSS instruction to the active function. -// Operates on the global context. -func VADDSS(mx, x, x1 operand.Op) { ctx.VADDSS(mx, x, x1) } - -// VADDSUBPD: Packed Double-FP Add/Subtract. -// -// Forms: -// -// VADDSUBPD xmm xmm xmm -// VADDSUBPD m128 xmm xmm -// VADDSUBPD ymm ymm ymm -// VADDSUBPD m256 ymm ymm -// Construct and append a VADDSUBPD instruction to the active function. -func (c *Context) VADDSUBPD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VADDSUBPD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VADDSUBPD: Packed Double-FP Add/Subtract. -// -// Forms: -// -// VADDSUBPD xmm xmm xmm -// VADDSUBPD m128 xmm xmm -// VADDSUBPD ymm ymm ymm -// VADDSUBPD m256 ymm ymm -// Construct and append a VADDSUBPD instruction to the active function. -// Operates on the global context. -func VADDSUBPD(mxy, xy, xy1 operand.Op) { ctx.VADDSUBPD(mxy, xy, xy1) } - -// VADDSUBPS: Packed Single-FP Add/Subtract. -// -// Forms: -// -// VADDSUBPS xmm xmm xmm -// VADDSUBPS m128 xmm xmm -// VADDSUBPS ymm ymm ymm -// VADDSUBPS m256 ymm ymm -// Construct and append a VADDSUBPS instruction to the active function. -func (c *Context) VADDSUBPS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VADDSUBPS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VADDSUBPS: Packed Single-FP Add/Subtract. -// -// Forms: -// -// VADDSUBPS xmm xmm xmm -// VADDSUBPS m128 xmm xmm -// VADDSUBPS ymm ymm ymm -// VADDSUBPS m256 ymm ymm -// Construct and append a VADDSUBPS instruction to the active function. -// Operates on the global context. -func VADDSUBPS(mxy, xy, xy1 operand.Op) { ctx.VADDSUBPS(mxy, xy, xy1) } - -// VAESDEC: Perform One Round of an AES Decryption Flow. -// -// Forms: -// -// VAESDEC xmm xmm xmm -// VAESDEC m128 xmm xmm -// Construct and append a VAESDEC instruction to the active function. -func (c *Context) VAESDEC(mx, x, x1 operand.Op) { - if inst, err := x86.VAESDEC(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VAESDEC: Perform One Round of an AES Decryption Flow. -// -// Forms: -// -// VAESDEC xmm xmm xmm -// VAESDEC m128 xmm xmm -// Construct and append a VAESDEC instruction to the active function. -// Operates on the global context. -func VAESDEC(mx, x, x1 operand.Op) { ctx.VAESDEC(mx, x, x1) } - -// VAESDECLAST: Perform Last Round of an AES Decryption Flow. -// -// Forms: -// -// VAESDECLAST xmm xmm xmm -// VAESDECLAST m128 xmm xmm -// Construct and append a VAESDECLAST instruction to the active function. -func (c *Context) VAESDECLAST(mx, x, x1 operand.Op) { - if inst, err := x86.VAESDECLAST(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VAESDECLAST: Perform Last Round of an AES Decryption Flow. -// -// Forms: -// -// VAESDECLAST xmm xmm xmm -// VAESDECLAST m128 xmm xmm -// Construct and append a VAESDECLAST instruction to the active function. -// Operates on the global context. -func VAESDECLAST(mx, x, x1 operand.Op) { ctx.VAESDECLAST(mx, x, x1) } - -// VAESENC: Perform One Round of an AES Encryption Flow. -// -// Forms: -// -// VAESENC xmm xmm xmm -// VAESENC m128 xmm xmm -// Construct and append a VAESENC instruction to the active function. -func (c *Context) VAESENC(mx, x, x1 operand.Op) { - if inst, err := x86.VAESENC(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VAESENC: Perform One Round of an AES Encryption Flow. -// -// Forms: -// -// VAESENC xmm xmm xmm -// VAESENC m128 xmm xmm -// Construct and append a VAESENC instruction to the active function. -// Operates on the global context. -func VAESENC(mx, x, x1 operand.Op) { ctx.VAESENC(mx, x, x1) } - -// VAESENCLAST: Perform Last Round of an AES Encryption Flow. -// -// Forms: -// -// VAESENCLAST xmm xmm xmm -// VAESENCLAST m128 xmm xmm -// Construct and append a VAESENCLAST instruction to the active function. -func (c *Context) VAESENCLAST(mx, x, x1 operand.Op) { - if inst, err := x86.VAESENCLAST(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VAESENCLAST: Perform Last Round of an AES Encryption Flow. -// -// Forms: -// -// VAESENCLAST xmm xmm xmm -// VAESENCLAST m128 xmm xmm -// Construct and append a VAESENCLAST instruction to the active function. -// Operates on the global context. -func VAESENCLAST(mx, x, x1 operand.Op) { ctx.VAESENCLAST(mx, x, x1) } - -// VAESIMC: Perform the AES InvMixColumn Transformation. -// -// Forms: -// -// VAESIMC xmm xmm -// VAESIMC m128 xmm -// Construct and append a VAESIMC instruction to the active function. -func (c *Context) VAESIMC(mx, x operand.Op) { - if inst, err := x86.VAESIMC(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VAESIMC: Perform the AES InvMixColumn Transformation. -// -// Forms: -// -// VAESIMC xmm xmm -// VAESIMC m128 xmm -// Construct and append a VAESIMC instruction to the active function. -// Operates on the global context. -func VAESIMC(mx, x operand.Op) { ctx.VAESIMC(mx, x) } - -// VAESKEYGENASSIST: AES Round Key Generation Assist. -// -// Forms: -// -// VAESKEYGENASSIST imm8 xmm xmm -// VAESKEYGENASSIST imm8 m128 xmm -// Construct and append a VAESKEYGENASSIST instruction to the active function. -func (c *Context) VAESKEYGENASSIST(i, mx, x operand.Op) { - if inst, err := x86.VAESKEYGENASSIST(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VAESKEYGENASSIST: AES Round Key Generation Assist. -// -// Forms: -// -// VAESKEYGENASSIST imm8 xmm xmm -// VAESKEYGENASSIST imm8 m128 xmm -// Construct and append a VAESKEYGENASSIST instruction to the active function. -// Operates on the global context. -func VAESKEYGENASSIST(i, mx, x operand.Op) { ctx.VAESKEYGENASSIST(i, mx, x) } - -// VANDNPD: Bitwise Logical AND NOT of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VANDNPD xmm xmm xmm -// VANDNPD m128 xmm xmm -// VANDNPD ymm ymm ymm -// VANDNPD m256 ymm ymm -// Construct and append a VANDNPD instruction to the active function. -func (c *Context) VANDNPD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VANDNPD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VANDNPD: Bitwise Logical AND NOT of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VANDNPD xmm xmm xmm -// VANDNPD m128 xmm xmm -// VANDNPD ymm ymm ymm -// VANDNPD m256 ymm ymm -// Construct and append a VANDNPD instruction to the active function. -// Operates on the global context. -func VANDNPD(mxy, xy, xy1 operand.Op) { ctx.VANDNPD(mxy, xy, xy1) } - -// VANDNPS: Bitwise Logical AND NOT of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VANDNPS xmm xmm xmm -// VANDNPS m128 xmm xmm -// VANDNPS ymm ymm ymm -// VANDNPS m256 ymm ymm -// Construct and append a VANDNPS instruction to the active function. -func (c *Context) VANDNPS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VANDNPS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VANDNPS: Bitwise Logical AND NOT of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VANDNPS xmm xmm xmm -// VANDNPS m128 xmm xmm -// VANDNPS ymm ymm ymm -// VANDNPS m256 ymm ymm -// Construct and append a VANDNPS instruction to the active function. -// Operates on the global context. -func VANDNPS(mxy, xy, xy1 operand.Op) { ctx.VANDNPS(mxy, xy, xy1) } - -// VANDPD: Bitwise Logical AND of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VANDPD xmm xmm xmm -// VANDPD m128 xmm xmm -// VANDPD ymm ymm ymm -// VANDPD m256 ymm ymm -// Construct and append a VANDPD instruction to the active function. -func (c *Context) VANDPD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VANDPD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VANDPD: Bitwise Logical AND of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VANDPD xmm xmm xmm -// VANDPD m128 xmm xmm -// VANDPD ymm ymm ymm -// VANDPD m256 ymm ymm -// Construct and append a VANDPD instruction to the active function. -// Operates on the global context. -func VANDPD(mxy, xy, xy1 operand.Op) { ctx.VANDPD(mxy, xy, xy1) } - -// VANDPS: Bitwise Logical AND of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VANDPS xmm xmm xmm -// VANDPS m128 xmm xmm -// VANDPS ymm ymm ymm -// VANDPS m256 ymm ymm -// Construct and append a VANDPS instruction to the active function. -func (c *Context) VANDPS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VANDPS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VANDPS: Bitwise Logical AND of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VANDPS xmm xmm xmm -// VANDPS m128 xmm xmm -// VANDPS ymm ymm ymm -// VANDPS m256 ymm ymm -// Construct and append a VANDPS instruction to the active function. -// Operates on the global context. -func VANDPS(mxy, xy, xy1 operand.Op) { ctx.VANDPS(mxy, xy, xy1) } - -// VBLENDPD: Blend Packed Double Precision Floating-Point Values. -// -// Forms: -// -// VBLENDPD imm8 xmm xmm xmm -// VBLENDPD imm8 m128 xmm xmm -// VBLENDPD imm8 ymm ymm ymm -// VBLENDPD imm8 m256 ymm ymm -// Construct and append a VBLENDPD instruction to the active function. -func (c *Context) VBLENDPD(i, mxy, xy, xy1 operand.Op) { - if inst, err := x86.VBLENDPD(i, mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VBLENDPD: Blend Packed Double Precision Floating-Point Values. -// -// Forms: -// -// VBLENDPD imm8 xmm xmm xmm -// VBLENDPD imm8 m128 xmm xmm -// VBLENDPD imm8 ymm ymm ymm -// VBLENDPD imm8 m256 ymm ymm -// Construct and append a VBLENDPD instruction to the active function. -// Operates on the global context. -func VBLENDPD(i, mxy, xy, xy1 operand.Op) { ctx.VBLENDPD(i, mxy, xy, xy1) } - -// VBLENDPS: Blend Packed Single Precision Floating-Point Values. -// -// Forms: -// -// VBLENDPS imm8 xmm xmm xmm -// VBLENDPS imm8 m128 xmm xmm -// VBLENDPS imm8 ymm ymm ymm -// VBLENDPS imm8 m256 ymm ymm -// Construct and append a VBLENDPS instruction to the active function. -func (c *Context) VBLENDPS(i, mxy, xy, xy1 operand.Op) { - if inst, err := x86.VBLENDPS(i, mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VBLENDPS: Blend Packed Single Precision Floating-Point Values. -// -// Forms: -// -// VBLENDPS imm8 xmm xmm xmm -// VBLENDPS imm8 m128 xmm xmm -// VBLENDPS imm8 ymm ymm ymm -// VBLENDPS imm8 m256 ymm ymm -// Construct and append a VBLENDPS instruction to the active function. -// Operates on the global context. -func VBLENDPS(i, mxy, xy, xy1 operand.Op) { ctx.VBLENDPS(i, mxy, xy, xy1) } - -// VBLENDVPD: Variable Blend Packed Double Precision Floating-Point Values. -// -// Forms: -// -// VBLENDVPD xmm xmm xmm xmm -// VBLENDVPD xmm m128 xmm xmm -// VBLENDVPD ymm ymm ymm ymm -// VBLENDVPD ymm m256 ymm ymm -// Construct and append a VBLENDVPD instruction to the active function. -func (c *Context) VBLENDVPD(xy, mxy, xy1, xy2 operand.Op) { - if inst, err := x86.VBLENDVPD(xy, mxy, xy1, xy2); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VBLENDVPD: Variable Blend Packed Double Precision Floating-Point Values. -// -// Forms: -// -// VBLENDVPD xmm xmm xmm xmm -// VBLENDVPD xmm m128 xmm xmm -// VBLENDVPD ymm ymm ymm ymm -// VBLENDVPD ymm m256 ymm ymm -// Construct and append a VBLENDVPD instruction to the active function. -// Operates on the global context. -func VBLENDVPD(xy, mxy, xy1, xy2 operand.Op) { ctx.VBLENDVPD(xy, mxy, xy1, xy2) } - -// VBLENDVPS: Variable Blend Packed Single Precision Floating-Point Values. -// -// Forms: -// -// VBLENDVPS xmm xmm xmm xmm -// VBLENDVPS xmm m128 xmm xmm -// VBLENDVPS ymm ymm ymm ymm -// VBLENDVPS ymm m256 ymm ymm -// Construct and append a VBLENDVPS instruction to the active function. -func (c *Context) VBLENDVPS(xy, mxy, xy1, xy2 operand.Op) { - if inst, err := x86.VBLENDVPS(xy, mxy, xy1, xy2); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VBLENDVPS: Variable Blend Packed Single Precision Floating-Point Values. -// -// Forms: -// -// VBLENDVPS xmm xmm xmm xmm -// VBLENDVPS xmm m128 xmm xmm -// VBLENDVPS ymm ymm ymm ymm -// VBLENDVPS ymm m256 ymm ymm -// Construct and append a VBLENDVPS instruction to the active function. -// Operates on the global context. -func VBLENDVPS(xy, mxy, xy1, xy2 operand.Op) { ctx.VBLENDVPS(xy, mxy, xy1, xy2) } - -// VBROADCASTF128: Broadcast 128 Bit of Floating-Point Data. -// -// Forms: -// -// VBROADCASTF128 m128 ymm -// Construct and append a VBROADCASTF128 instruction to the active function. -func (c *Context) VBROADCASTF128(m, y operand.Op) { - if inst, err := x86.VBROADCASTF128(m, y); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VBROADCASTF128: Broadcast 128 Bit of Floating-Point Data. -// -// Forms: -// -// VBROADCASTF128 m128 ymm -// Construct and append a VBROADCASTF128 instruction to the active function. -// Operates on the global context. -func VBROADCASTF128(m, y operand.Op) { ctx.VBROADCASTF128(m, y) } - -// VBROADCASTI128: Broadcast 128 Bits of Integer Data. -// -// Forms: -// -// VBROADCASTI128 m128 ymm -// Construct and append a VBROADCASTI128 instruction to the active function. -func (c *Context) VBROADCASTI128(m, y operand.Op) { - if inst, err := x86.VBROADCASTI128(m, y); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VBROADCASTI128: Broadcast 128 Bits of Integer Data. -// -// Forms: -// -// VBROADCASTI128 m128 ymm -// Construct and append a VBROADCASTI128 instruction to the active function. -// Operates on the global context. -func VBROADCASTI128(m, y operand.Op) { ctx.VBROADCASTI128(m, y) } - -// VBROADCASTSD: Broadcast Double-Precision Floating-Point Element. -// -// Forms: -// -// VBROADCASTSD xmm ymm -// VBROADCASTSD m64 ymm -// Construct and append a VBROADCASTSD instruction to the active function. -func (c *Context) VBROADCASTSD(mx, y operand.Op) { - if inst, err := x86.VBROADCASTSD(mx, y); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VBROADCASTSD: Broadcast Double-Precision Floating-Point Element. -// -// Forms: -// -// VBROADCASTSD xmm ymm -// VBROADCASTSD m64 ymm -// Construct and append a VBROADCASTSD instruction to the active function. -// Operates on the global context. -func VBROADCASTSD(mx, y operand.Op) { ctx.VBROADCASTSD(mx, y) } - -// VBROADCASTSS: Broadcast Single-Precision Floating-Point Element. -// -// Forms: -// -// VBROADCASTSS xmm xmm -// VBROADCASTSS m32 xmm -// VBROADCASTSS xmm ymm -// VBROADCASTSS m32 ymm -// Construct and append a VBROADCASTSS instruction to the active function. -func (c *Context) VBROADCASTSS(mx, xy operand.Op) { - if inst, err := x86.VBROADCASTSS(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VBROADCASTSS: Broadcast Single-Precision Floating-Point Element. -// -// Forms: -// -// VBROADCASTSS xmm xmm -// VBROADCASTSS m32 xmm -// VBROADCASTSS xmm ymm -// VBROADCASTSS m32 ymm -// Construct and append a VBROADCASTSS instruction to the active function. -// Operates on the global context. -func VBROADCASTSS(mx, xy operand.Op) { ctx.VBROADCASTSS(mx, xy) } - -// VCMPPD: Compare Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VCMPPD imm8 xmm xmm xmm -// VCMPPD imm8 m128 xmm xmm -// VCMPPD imm8 ymm ymm ymm -// VCMPPD imm8 m256 ymm ymm -// Construct and append a VCMPPD instruction to the active function. -func (c *Context) VCMPPD(i, mxy, xy, xy1 operand.Op) { - if inst, err := x86.VCMPPD(i, mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCMPPD: Compare Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VCMPPD imm8 xmm xmm xmm -// VCMPPD imm8 m128 xmm xmm -// VCMPPD imm8 ymm ymm ymm -// VCMPPD imm8 m256 ymm ymm -// Construct and append a VCMPPD instruction to the active function. -// Operates on the global context. -func VCMPPD(i, mxy, xy, xy1 operand.Op) { ctx.VCMPPD(i, mxy, xy, xy1) } - -// VCMPPS: Compare Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VCMPPS imm8 xmm xmm xmm -// VCMPPS imm8 m128 xmm xmm -// VCMPPS imm8 ymm ymm ymm -// VCMPPS imm8 m256 ymm ymm -// Construct and append a VCMPPS instruction to the active function. -func (c *Context) VCMPPS(i, mxy, xy, xy1 operand.Op) { - if inst, err := x86.VCMPPS(i, mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCMPPS: Compare Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VCMPPS imm8 xmm xmm xmm -// VCMPPS imm8 m128 xmm xmm -// VCMPPS imm8 ymm ymm ymm -// VCMPPS imm8 m256 ymm ymm -// Construct and append a VCMPPS instruction to the active function. -// Operates on the global context. -func VCMPPS(i, mxy, xy, xy1 operand.Op) { ctx.VCMPPS(i, mxy, xy, xy1) } - -// VCMPSD: Compare Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VCMPSD imm8 xmm xmm xmm -// VCMPSD imm8 m64 xmm xmm -// Construct and append a VCMPSD instruction to the active function. -func (c *Context) VCMPSD(i, mx, x, x1 operand.Op) { - if inst, err := x86.VCMPSD(i, mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCMPSD: Compare Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VCMPSD imm8 xmm xmm xmm -// VCMPSD imm8 m64 xmm xmm -// Construct and append a VCMPSD instruction to the active function. -// Operates on the global context. -func VCMPSD(i, mx, x, x1 operand.Op) { ctx.VCMPSD(i, mx, x, x1) } - -// VCMPSS: Compare Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VCMPSS imm8 xmm xmm xmm -// VCMPSS imm8 m32 xmm xmm -// Construct and append a VCMPSS instruction to the active function. -func (c *Context) VCMPSS(i, mx, x, x1 operand.Op) { - if inst, err := x86.VCMPSS(i, mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCMPSS: Compare Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VCMPSS imm8 xmm xmm xmm -// VCMPSS imm8 m32 xmm xmm -// Construct and append a VCMPSS instruction to the active function. -// Operates on the global context. -func VCMPSS(i, mx, x, x1 operand.Op) { ctx.VCMPSS(i, mx, x, x1) } - -// VCOMISD: Compare Scalar Ordered Double-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// VCOMISD xmm xmm -// VCOMISD m64 xmm -// Construct and append a VCOMISD instruction to the active function. -func (c *Context) VCOMISD(mx, x operand.Op) { - if inst, err := x86.VCOMISD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCOMISD: Compare Scalar Ordered Double-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// VCOMISD xmm xmm -// VCOMISD m64 xmm -// Construct and append a VCOMISD instruction to the active function. -// Operates on the global context. -func VCOMISD(mx, x operand.Op) { ctx.VCOMISD(mx, x) } - -// VCOMISS: Compare Scalar Ordered Single-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// VCOMISS xmm xmm -// VCOMISS m32 xmm -// Construct and append a VCOMISS instruction to the active function. -func (c *Context) VCOMISS(mx, x operand.Op) { - if inst, err := x86.VCOMISS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCOMISS: Compare Scalar Ordered Single-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// VCOMISS xmm xmm -// VCOMISS m32 xmm -// Construct and append a VCOMISS instruction to the active function. -// Operates on the global context. -func VCOMISS(mx, x operand.Op) { ctx.VCOMISS(mx, x) } - -// VCVTDQ2PD: Convert Packed Dword Integers to Packed Double-Precision FP Values. -// -// Forms: -// -// VCVTDQ2PD xmm xmm -// VCVTDQ2PD m64 xmm -// VCVTDQ2PD xmm ymm -// VCVTDQ2PD m128 ymm -// Construct and append a VCVTDQ2PD instruction to the active function. -func (c *Context) VCVTDQ2PD(mx, xy operand.Op) { - if inst, err := x86.VCVTDQ2PD(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTDQ2PD: Convert Packed Dword Integers to Packed Double-Precision FP Values. -// -// Forms: -// -// VCVTDQ2PD xmm xmm -// VCVTDQ2PD m64 xmm -// VCVTDQ2PD xmm ymm -// VCVTDQ2PD m128 ymm -// Construct and append a VCVTDQ2PD instruction to the active function. -// Operates on the global context. -func VCVTDQ2PD(mx, xy operand.Op) { ctx.VCVTDQ2PD(mx, xy) } - -// VCVTDQ2PS: Convert Packed Dword Integers to Packed Single-Precision FP Values. -// -// Forms: -// -// VCVTDQ2PS xmm xmm -// VCVTDQ2PS m128 xmm -// VCVTDQ2PS ymm ymm -// VCVTDQ2PS m256 ymm -// Construct and append a VCVTDQ2PS instruction to the active function. -func (c *Context) VCVTDQ2PS(mxy, xy operand.Op) { - if inst, err := x86.VCVTDQ2PS(mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTDQ2PS: Convert Packed Dword Integers to Packed Single-Precision FP Values. -// -// Forms: -// -// VCVTDQ2PS xmm xmm -// VCVTDQ2PS m128 xmm -// VCVTDQ2PS ymm ymm -// VCVTDQ2PS m256 ymm -// Construct and append a VCVTDQ2PS instruction to the active function. -// Operates on the global context. -func VCVTDQ2PS(mxy, xy operand.Op) { ctx.VCVTDQ2PS(mxy, xy) } - -// VCVTPD2DQX: Convert Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTPD2DQX xmm xmm -// VCVTPD2DQX m128 xmm -// Construct and append a VCVTPD2DQX instruction to the active function. -func (c *Context) VCVTPD2DQX(mx, x operand.Op) { - if inst, err := x86.VCVTPD2DQX(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTPD2DQX: Convert Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTPD2DQX xmm xmm -// VCVTPD2DQX m128 xmm -// Construct and append a VCVTPD2DQX instruction to the active function. -// Operates on the global context. -func VCVTPD2DQX(mx, x operand.Op) { ctx.VCVTPD2DQX(mx, x) } - -// VCVTPD2DQY: Convert Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTPD2DQY ymm xmm -// VCVTPD2DQY m256 xmm -// Construct and append a VCVTPD2DQY instruction to the active function. -func (c *Context) VCVTPD2DQY(my, x operand.Op) { - if inst, err := x86.VCVTPD2DQY(my, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTPD2DQY: Convert Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTPD2DQY ymm xmm -// VCVTPD2DQY m256 xmm -// Construct and append a VCVTPD2DQY instruction to the active function. -// Operates on the global context. -func VCVTPD2DQY(my, x operand.Op) { ctx.VCVTPD2DQY(my, x) } - -// VCVTPD2PSX: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. -// -// Forms: -// -// VCVTPD2PSX xmm xmm -// VCVTPD2PSX m128 xmm -// Construct and append a VCVTPD2PSX instruction to the active function. -func (c *Context) VCVTPD2PSX(mx, x operand.Op) { - if inst, err := x86.VCVTPD2PSX(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTPD2PSX: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. -// -// Forms: -// -// VCVTPD2PSX xmm xmm -// VCVTPD2PSX m128 xmm -// Construct and append a VCVTPD2PSX instruction to the active function. -// Operates on the global context. -func VCVTPD2PSX(mx, x operand.Op) { ctx.VCVTPD2PSX(mx, x) } - -// VCVTPD2PSY: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. -// -// Forms: -// -// VCVTPD2PSY ymm xmm -// VCVTPD2PSY m256 xmm -// Construct and append a VCVTPD2PSY instruction to the active function. -func (c *Context) VCVTPD2PSY(my, x operand.Op) { - if inst, err := x86.VCVTPD2PSY(my, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTPD2PSY: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. -// -// Forms: -// -// VCVTPD2PSY ymm xmm -// VCVTPD2PSY m256 xmm -// Construct and append a VCVTPD2PSY instruction to the active function. -// Operates on the global context. -func VCVTPD2PSY(my, x operand.Op) { ctx.VCVTPD2PSY(my, x) } - -// VCVTPH2PS: Convert Half-Precision FP Values to Single-Precision FP Values. -// -// Forms: -// -// VCVTPH2PS xmm xmm -// VCVTPH2PS m64 xmm -// VCVTPH2PS xmm ymm -// VCVTPH2PS m128 ymm -// Construct and append a VCVTPH2PS instruction to the active function. -func (c *Context) VCVTPH2PS(mx, xy operand.Op) { - if inst, err := x86.VCVTPH2PS(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTPH2PS: Convert Half-Precision FP Values to Single-Precision FP Values. -// -// Forms: -// -// VCVTPH2PS xmm xmm -// VCVTPH2PS m64 xmm -// VCVTPH2PS xmm ymm -// VCVTPH2PS m128 ymm -// Construct and append a VCVTPH2PS instruction to the active function. -// Operates on the global context. -func VCVTPH2PS(mx, xy operand.Op) { ctx.VCVTPH2PS(mx, xy) } - -// VCVTPS2DQ: Convert Packed Single-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTPS2DQ xmm xmm -// VCVTPS2DQ m128 xmm -// VCVTPS2DQ ymm ymm -// VCVTPS2DQ m256 ymm -// Construct and append a VCVTPS2DQ instruction to the active function. -func (c *Context) VCVTPS2DQ(mxy, xy operand.Op) { - if inst, err := x86.VCVTPS2DQ(mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTPS2DQ: Convert Packed Single-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTPS2DQ xmm xmm -// VCVTPS2DQ m128 xmm -// VCVTPS2DQ ymm ymm -// VCVTPS2DQ m256 ymm -// Construct and append a VCVTPS2DQ instruction to the active function. -// Operates on the global context. -func VCVTPS2DQ(mxy, xy operand.Op) { ctx.VCVTPS2DQ(mxy, xy) } - -// VCVTPS2PD: Convert Packed Single-Precision FP Values to Packed Double-Precision FP Values. -// -// Forms: -// -// VCVTPS2PD xmm xmm -// VCVTPS2PD m64 xmm -// VCVTPS2PD xmm ymm -// VCVTPS2PD m128 ymm -// Construct and append a VCVTPS2PD instruction to the active function. -func (c *Context) VCVTPS2PD(mx, xy operand.Op) { - if inst, err := x86.VCVTPS2PD(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTPS2PD: Convert Packed Single-Precision FP Values to Packed Double-Precision FP Values. -// -// Forms: -// -// VCVTPS2PD xmm xmm -// VCVTPS2PD m64 xmm -// VCVTPS2PD xmm ymm -// VCVTPS2PD m128 ymm -// Construct and append a VCVTPS2PD instruction to the active function. -// Operates on the global context. -func VCVTPS2PD(mx, xy operand.Op) { ctx.VCVTPS2PD(mx, xy) } - -// VCVTPS2PH: Convert Single-Precision FP value to Half-Precision FP value. -// -// Forms: -// -// VCVTPS2PH imm8 xmm xmm -// VCVTPS2PH imm8 ymm xmm -// VCVTPS2PH imm8 xmm m64 -// VCVTPS2PH imm8 ymm m128 -// Construct and append a VCVTPS2PH instruction to the active function. -func (c *Context) VCVTPS2PH(i, xy, mx operand.Op) { - if inst, err := x86.VCVTPS2PH(i, xy, mx); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTPS2PH: Convert Single-Precision FP value to Half-Precision FP value. -// -// Forms: -// -// VCVTPS2PH imm8 xmm xmm -// VCVTPS2PH imm8 ymm xmm -// VCVTPS2PH imm8 xmm m64 -// VCVTPS2PH imm8 ymm m128 -// Construct and append a VCVTPS2PH instruction to the active function. -// Operates on the global context. -func VCVTPS2PH(i, xy, mx operand.Op) { ctx.VCVTPS2PH(i, xy, mx) } - -// VCVTSD2SI: Convert Scalar Double-Precision FP Value to Integer. -// -// Forms: -// -// VCVTSD2SI xmm r32 -// VCVTSD2SI m64 r32 -// Construct and append a VCVTSD2SI instruction to the active function. -func (c *Context) VCVTSD2SI(mx, r operand.Op) { - if inst, err := x86.VCVTSD2SI(mx, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTSD2SI: Convert Scalar Double-Precision FP Value to Integer. -// -// Forms: -// -// VCVTSD2SI xmm r32 -// VCVTSD2SI m64 r32 -// Construct and append a VCVTSD2SI instruction to the active function. -// Operates on the global context. -func VCVTSD2SI(mx, r operand.Op) { ctx.VCVTSD2SI(mx, r) } - -// VCVTSD2SIQ: Convert Scalar Double-Precision FP Value to Integer. -// -// Forms: -// -// VCVTSD2SIQ xmm r64 -// VCVTSD2SIQ m64 r64 -// Construct and append a VCVTSD2SIQ instruction to the active function. -func (c *Context) VCVTSD2SIQ(mx, r operand.Op) { - if inst, err := x86.VCVTSD2SIQ(mx, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTSD2SIQ: Convert Scalar Double-Precision FP Value to Integer. -// -// Forms: -// -// VCVTSD2SIQ xmm r64 -// VCVTSD2SIQ m64 r64 -// Construct and append a VCVTSD2SIQ instruction to the active function. -// Operates on the global context. -func VCVTSD2SIQ(mx, r operand.Op) { ctx.VCVTSD2SIQ(mx, r) } - -// VCVTSD2SS: Convert Scalar Double-Precision FP Value to Scalar Single-Precision FP Value. -// -// Forms: -// -// VCVTSD2SS xmm xmm xmm -// VCVTSD2SS m64 xmm xmm -// Construct and append a VCVTSD2SS instruction to the active function. -func (c *Context) VCVTSD2SS(mx, x, x1 operand.Op) { - if inst, err := x86.VCVTSD2SS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTSD2SS: Convert Scalar Double-Precision FP Value to Scalar Single-Precision FP Value. -// -// Forms: -// -// VCVTSD2SS xmm xmm xmm -// VCVTSD2SS m64 xmm xmm -// Construct and append a VCVTSD2SS instruction to the active function. -// Operates on the global context. -func VCVTSD2SS(mx, x, x1 operand.Op) { ctx.VCVTSD2SS(mx, x, x1) } - -// VCVTSI2SDL: Convert Dword Integer to Scalar Double-Precision FP Value. -// -// Forms: -// -// VCVTSI2SDL r32 xmm xmm -// VCVTSI2SDL m32 xmm xmm -// Construct and append a VCVTSI2SDL instruction to the active function. -func (c *Context) VCVTSI2SDL(mr, x, x1 operand.Op) { - if inst, err := x86.VCVTSI2SDL(mr, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTSI2SDL: Convert Dword Integer to Scalar Double-Precision FP Value. -// -// Forms: -// -// VCVTSI2SDL r32 xmm xmm -// VCVTSI2SDL m32 xmm xmm -// Construct and append a VCVTSI2SDL instruction to the active function. -// Operates on the global context. -func VCVTSI2SDL(mr, x, x1 operand.Op) { ctx.VCVTSI2SDL(mr, x, x1) } - -// VCVTSI2SDQ: Convert Dword Integer to Scalar Double-Precision FP Value. -// -// Forms: -// -// VCVTSI2SDQ r64 xmm xmm -// VCVTSI2SDQ m64 xmm xmm -// Construct and append a VCVTSI2SDQ instruction to the active function. -func (c *Context) VCVTSI2SDQ(mr, x, x1 operand.Op) { - if inst, err := x86.VCVTSI2SDQ(mr, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTSI2SDQ: Convert Dword Integer to Scalar Double-Precision FP Value. -// -// Forms: -// -// VCVTSI2SDQ r64 xmm xmm -// VCVTSI2SDQ m64 xmm xmm -// Construct and append a VCVTSI2SDQ instruction to the active function. -// Operates on the global context. -func VCVTSI2SDQ(mr, x, x1 operand.Op) { ctx.VCVTSI2SDQ(mr, x, x1) } - -// VCVTSI2SSL: Convert Dword Integer to Scalar Single-Precision FP Value. -// -// Forms: -// -// VCVTSI2SSL r32 xmm xmm -// VCVTSI2SSL m32 xmm xmm -// Construct and append a VCVTSI2SSL instruction to the active function. -func (c *Context) VCVTSI2SSL(mr, x, x1 operand.Op) { - if inst, err := x86.VCVTSI2SSL(mr, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTSI2SSL: Convert Dword Integer to Scalar Single-Precision FP Value. -// -// Forms: -// -// VCVTSI2SSL r32 xmm xmm -// VCVTSI2SSL m32 xmm xmm -// Construct and append a VCVTSI2SSL instruction to the active function. -// Operates on the global context. -func VCVTSI2SSL(mr, x, x1 operand.Op) { ctx.VCVTSI2SSL(mr, x, x1) } - -// VCVTSI2SSQ: Convert Dword Integer to Scalar Single-Precision FP Value. -// -// Forms: -// -// VCVTSI2SSQ r64 xmm xmm -// VCVTSI2SSQ m64 xmm xmm -// Construct and append a VCVTSI2SSQ instruction to the active function. -func (c *Context) VCVTSI2SSQ(mr, x, x1 operand.Op) { - if inst, err := x86.VCVTSI2SSQ(mr, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTSI2SSQ: Convert Dword Integer to Scalar Single-Precision FP Value. -// -// Forms: -// -// VCVTSI2SSQ r64 xmm xmm -// VCVTSI2SSQ m64 xmm xmm -// Construct and append a VCVTSI2SSQ instruction to the active function. -// Operates on the global context. -func VCVTSI2SSQ(mr, x, x1 operand.Op) { ctx.VCVTSI2SSQ(mr, x, x1) } - -// VCVTSS2SD: Convert Scalar Single-Precision FP Value to Scalar Double-Precision FP Value. -// -// Forms: -// -// VCVTSS2SD xmm xmm xmm -// VCVTSS2SD m32 xmm xmm -// Construct and append a VCVTSS2SD instruction to the active function. -func (c *Context) VCVTSS2SD(mx, x, x1 operand.Op) { - if inst, err := x86.VCVTSS2SD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTSS2SD: Convert Scalar Single-Precision FP Value to Scalar Double-Precision FP Value. -// -// Forms: -// -// VCVTSS2SD xmm xmm xmm -// VCVTSS2SD m32 xmm xmm -// Construct and append a VCVTSS2SD instruction to the active function. -// Operates on the global context. -func VCVTSS2SD(mx, x, x1 operand.Op) { ctx.VCVTSS2SD(mx, x, x1) } - -// VCVTSS2SI: Convert Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// VCVTSS2SI xmm r32 -// VCVTSS2SI m32 r32 -// Construct and append a VCVTSS2SI instruction to the active function. -func (c *Context) VCVTSS2SI(mx, r operand.Op) { - if inst, err := x86.VCVTSS2SI(mx, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTSS2SI: Convert Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// VCVTSS2SI xmm r32 -// VCVTSS2SI m32 r32 -// Construct and append a VCVTSS2SI instruction to the active function. -// Operates on the global context. -func VCVTSS2SI(mx, r operand.Op) { ctx.VCVTSS2SI(mx, r) } - -// VCVTSS2SIQ: Convert Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// VCVTSS2SIQ xmm r64 -// VCVTSS2SIQ m32 r64 -// Construct and append a VCVTSS2SIQ instruction to the active function. -func (c *Context) VCVTSS2SIQ(mx, r operand.Op) { - if inst, err := x86.VCVTSS2SIQ(mx, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTSS2SIQ: Convert Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// VCVTSS2SIQ xmm r64 -// VCVTSS2SIQ m32 r64 -// Construct and append a VCVTSS2SIQ instruction to the active function. -// Operates on the global context. -func VCVTSS2SIQ(mx, r operand.Op) { ctx.VCVTSS2SIQ(mx, r) } - -// VCVTTPD2DQX: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTTPD2DQX xmm xmm -// VCVTTPD2DQX m128 xmm -// Construct and append a VCVTTPD2DQX instruction to the active function. -func (c *Context) VCVTTPD2DQX(mx, x operand.Op) { - if inst, err := x86.VCVTTPD2DQX(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTTPD2DQX: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTTPD2DQX xmm xmm -// VCVTTPD2DQX m128 xmm -// Construct and append a VCVTTPD2DQX instruction to the active function. -// Operates on the global context. -func VCVTTPD2DQX(mx, x operand.Op) { ctx.VCVTTPD2DQX(mx, x) } - -// VCVTTPD2DQY: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTTPD2DQY ymm xmm -// VCVTTPD2DQY m256 xmm -// Construct and append a VCVTTPD2DQY instruction to the active function. -func (c *Context) VCVTTPD2DQY(my, x operand.Op) { - if inst, err := x86.VCVTTPD2DQY(my, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTTPD2DQY: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTTPD2DQY ymm xmm -// VCVTTPD2DQY m256 xmm -// Construct and append a VCVTTPD2DQY instruction to the active function. -// Operates on the global context. -func VCVTTPD2DQY(my, x operand.Op) { ctx.VCVTTPD2DQY(my, x) } - -// VCVTTPS2DQ: Convert with Truncation Packed Single-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTTPS2DQ xmm xmm -// VCVTTPS2DQ m128 xmm -// VCVTTPS2DQ ymm ymm -// VCVTTPS2DQ m256 ymm -// Construct and append a VCVTTPS2DQ instruction to the active function. -func (c *Context) VCVTTPS2DQ(mxy, xy operand.Op) { - if inst, err := x86.VCVTTPS2DQ(mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTTPS2DQ: Convert with Truncation Packed Single-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTTPS2DQ xmm xmm -// VCVTTPS2DQ m128 xmm -// VCVTTPS2DQ ymm ymm -// VCVTTPS2DQ m256 ymm -// Construct and append a VCVTTPS2DQ instruction to the active function. -// Operates on the global context. -func VCVTTPS2DQ(mxy, xy operand.Op) { ctx.VCVTTPS2DQ(mxy, xy) } - -// VCVTTSD2SI: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. -// -// Forms: -// -// VCVTTSD2SI xmm r32 -// VCVTTSD2SI m64 r32 -// Construct and append a VCVTTSD2SI instruction to the active function. -func (c *Context) VCVTTSD2SI(mx, r operand.Op) { - if inst, err := x86.VCVTTSD2SI(mx, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTTSD2SI: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. -// -// Forms: -// -// VCVTTSD2SI xmm r32 -// VCVTTSD2SI m64 r32 -// Construct and append a VCVTTSD2SI instruction to the active function. -// Operates on the global context. -func VCVTTSD2SI(mx, r operand.Op) { ctx.VCVTTSD2SI(mx, r) } - -// VCVTTSD2SIQ: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. -// -// Forms: -// -// VCVTTSD2SIQ xmm r64 -// VCVTTSD2SIQ m64 r64 -// Construct and append a VCVTTSD2SIQ instruction to the active function. -func (c *Context) VCVTTSD2SIQ(mx, r operand.Op) { - if inst, err := x86.VCVTTSD2SIQ(mx, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTTSD2SIQ: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. -// -// Forms: -// -// VCVTTSD2SIQ xmm r64 -// VCVTTSD2SIQ m64 r64 -// Construct and append a VCVTTSD2SIQ instruction to the active function. -// Operates on the global context. -func VCVTTSD2SIQ(mx, r operand.Op) { ctx.VCVTTSD2SIQ(mx, r) } - -// VCVTTSS2SI: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// VCVTTSS2SI xmm r32 -// VCVTTSS2SI m32 r32 -// Construct and append a VCVTTSS2SI instruction to the active function. -func (c *Context) VCVTTSS2SI(mx, r operand.Op) { - if inst, err := x86.VCVTTSS2SI(mx, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTTSS2SI: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// VCVTTSS2SI xmm r32 -// VCVTTSS2SI m32 r32 -// Construct and append a VCVTTSS2SI instruction to the active function. -// Operates on the global context. -func VCVTTSS2SI(mx, r operand.Op) { ctx.VCVTTSS2SI(mx, r) } - -// VCVTTSS2SIQ: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// VCVTTSS2SIQ xmm r64 -// VCVTTSS2SIQ m32 r64 -// Construct and append a VCVTTSS2SIQ instruction to the active function. -func (c *Context) VCVTTSS2SIQ(mx, r operand.Op) { - if inst, err := x86.VCVTTSS2SIQ(mx, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VCVTTSS2SIQ: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// VCVTTSS2SIQ xmm r64 -// VCVTTSS2SIQ m32 r64 -// Construct and append a VCVTTSS2SIQ instruction to the active function. -// Operates on the global context. -func VCVTTSS2SIQ(mx, r operand.Op) { ctx.VCVTTSS2SIQ(mx, r) } - -// VDIVPD: Divide Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VDIVPD xmm xmm xmm -// VDIVPD m128 xmm xmm -// VDIVPD ymm ymm ymm -// VDIVPD m256 ymm ymm -// Construct and append a VDIVPD instruction to the active function. -func (c *Context) VDIVPD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VDIVPD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VDIVPD: Divide Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VDIVPD xmm xmm xmm -// VDIVPD m128 xmm xmm -// VDIVPD ymm ymm ymm -// VDIVPD m256 ymm ymm -// Construct and append a VDIVPD instruction to the active function. -// Operates on the global context. -func VDIVPD(mxy, xy, xy1 operand.Op) { ctx.VDIVPD(mxy, xy, xy1) } - -// VDIVPS: Divide Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VDIVPS xmm xmm xmm -// VDIVPS m128 xmm xmm -// VDIVPS ymm ymm ymm -// VDIVPS m256 ymm ymm -// Construct and append a VDIVPS instruction to the active function. -func (c *Context) VDIVPS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VDIVPS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VDIVPS: Divide Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VDIVPS xmm xmm xmm -// VDIVPS m128 xmm xmm -// VDIVPS ymm ymm ymm -// VDIVPS m256 ymm ymm -// Construct and append a VDIVPS instruction to the active function. -// Operates on the global context. -func VDIVPS(mxy, xy, xy1 operand.Op) { ctx.VDIVPS(mxy, xy, xy1) } - -// VDIVSD: Divide Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VDIVSD xmm xmm xmm -// VDIVSD m64 xmm xmm -// Construct and append a VDIVSD instruction to the active function. -func (c *Context) VDIVSD(mx, x, x1 operand.Op) { - if inst, err := x86.VDIVSD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VDIVSD: Divide Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VDIVSD xmm xmm xmm -// VDIVSD m64 xmm xmm -// Construct and append a VDIVSD instruction to the active function. -// Operates on the global context. -func VDIVSD(mx, x, x1 operand.Op) { ctx.VDIVSD(mx, x, x1) } - -// VDIVSS: Divide Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VDIVSS xmm xmm xmm -// VDIVSS m32 xmm xmm -// Construct and append a VDIVSS instruction to the active function. -func (c *Context) VDIVSS(mx, x, x1 operand.Op) { - if inst, err := x86.VDIVSS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VDIVSS: Divide Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VDIVSS xmm xmm xmm -// VDIVSS m32 xmm xmm -// Construct and append a VDIVSS instruction to the active function. -// Operates on the global context. -func VDIVSS(mx, x, x1 operand.Op) { ctx.VDIVSS(mx, x, x1) } - -// VDPPD: Dot Product of Packed Double Precision Floating-Point Values. -// -// Forms: -// -// VDPPD imm8 xmm xmm xmm -// VDPPD imm8 m128 xmm xmm -// Construct and append a VDPPD instruction to the active function. -func (c *Context) VDPPD(i, mx, x, x1 operand.Op) { - if inst, err := x86.VDPPD(i, mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VDPPD: Dot Product of Packed Double Precision Floating-Point Values. -// -// Forms: -// -// VDPPD imm8 xmm xmm xmm -// VDPPD imm8 m128 xmm xmm -// Construct and append a VDPPD instruction to the active function. -// Operates on the global context. -func VDPPD(i, mx, x, x1 operand.Op) { ctx.VDPPD(i, mx, x, x1) } - -// VDPPS: Dot Product of Packed Single Precision Floating-Point Values. -// -// Forms: -// -// VDPPS imm8 xmm xmm xmm -// VDPPS imm8 m128 xmm xmm -// VDPPS imm8 ymm ymm ymm -// VDPPS imm8 m256 ymm ymm -// Construct and append a VDPPS instruction to the active function. -func (c *Context) VDPPS(i, mxy, xy, xy1 operand.Op) { - if inst, err := x86.VDPPS(i, mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VDPPS: Dot Product of Packed Single Precision Floating-Point Values. -// -// Forms: -// -// VDPPS imm8 xmm xmm xmm -// VDPPS imm8 m128 xmm xmm -// VDPPS imm8 ymm ymm ymm -// VDPPS imm8 m256 ymm ymm -// Construct and append a VDPPS instruction to the active function. -// Operates on the global context. -func VDPPS(i, mxy, xy, xy1 operand.Op) { ctx.VDPPS(i, mxy, xy, xy1) } - -// VEXTRACTF128: Extract Packed Floating-Point Values. -// -// Forms: -// -// VEXTRACTF128 imm8 ymm xmm -// VEXTRACTF128 imm8 ymm m128 -// Construct and append a VEXTRACTF128 instruction to the active function. -func (c *Context) VEXTRACTF128(i, y, mx operand.Op) { - if inst, err := x86.VEXTRACTF128(i, y, mx); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VEXTRACTF128: Extract Packed Floating-Point Values. -// -// Forms: -// -// VEXTRACTF128 imm8 ymm xmm -// VEXTRACTF128 imm8 ymm m128 -// Construct and append a VEXTRACTF128 instruction to the active function. -// Operates on the global context. -func VEXTRACTF128(i, y, mx operand.Op) { ctx.VEXTRACTF128(i, y, mx) } - -// VEXTRACTI128: Extract Packed Integer Values. -// -// Forms: -// -// VEXTRACTI128 imm8 ymm xmm -// VEXTRACTI128 imm8 ymm m128 -// Construct and append a VEXTRACTI128 instruction to the active function. -func (c *Context) VEXTRACTI128(i, y, mx operand.Op) { - if inst, err := x86.VEXTRACTI128(i, y, mx); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VEXTRACTI128: Extract Packed Integer Values. -// -// Forms: -// -// VEXTRACTI128 imm8 ymm xmm -// VEXTRACTI128 imm8 ymm m128 -// Construct and append a VEXTRACTI128 instruction to the active function. -// Operates on the global context. -func VEXTRACTI128(i, y, mx operand.Op) { ctx.VEXTRACTI128(i, y, mx) } - -// VEXTRACTPS: Extract Packed Single Precision Floating-Point Value. -// -// Forms: -// -// VEXTRACTPS imm8 xmm r32 -// VEXTRACTPS imm8 xmm m32 -// Construct and append a VEXTRACTPS instruction to the active function. -func (c *Context) VEXTRACTPS(i, x, mr operand.Op) { - if inst, err := x86.VEXTRACTPS(i, x, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VEXTRACTPS: Extract Packed Single Precision Floating-Point Value. -// -// Forms: -// -// VEXTRACTPS imm8 xmm r32 -// VEXTRACTPS imm8 xmm m32 -// Construct and append a VEXTRACTPS instruction to the active function. -// Operates on the global context. -func VEXTRACTPS(i, x, mr operand.Op) { ctx.VEXTRACTPS(i, x, mr) } - -// VFMADD132PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD132PD xmm xmm xmm -// VFMADD132PD m128 xmm xmm -// VFMADD132PD ymm ymm ymm -// VFMADD132PD m256 ymm ymm -// Construct and append a VFMADD132PD instruction to the active function. -func (c *Context) VFMADD132PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMADD132PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADD132PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD132PD xmm xmm xmm -// VFMADD132PD m128 xmm xmm -// VFMADD132PD ymm ymm ymm -// VFMADD132PD m256 ymm ymm -// Construct and append a VFMADD132PD instruction to the active function. -// Operates on the global context. -func VFMADD132PD(mxy, xy, xy1 operand.Op) { ctx.VFMADD132PD(mxy, xy, xy1) } - -// VFMADD132PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD132PS xmm xmm xmm -// VFMADD132PS m128 xmm xmm -// VFMADD132PS ymm ymm ymm -// VFMADD132PS m256 ymm ymm -// Construct and append a VFMADD132PS instruction to the active function. -func (c *Context) VFMADD132PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMADD132PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADD132PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD132PS xmm xmm xmm -// VFMADD132PS m128 xmm xmm -// VFMADD132PS ymm ymm ymm -// VFMADD132PS m256 ymm ymm -// Construct and append a VFMADD132PS instruction to the active function. -// Operates on the global context. -func VFMADD132PS(mxy, xy, xy1 operand.Op) { ctx.VFMADD132PS(mxy, xy, xy1) } - -// VFMADD132SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD132SD xmm xmm xmm -// VFMADD132SD m64 xmm xmm -// Construct and append a VFMADD132SD instruction to the active function. -func (c *Context) VFMADD132SD(mx, x, x1 operand.Op) { - if inst, err := x86.VFMADD132SD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADD132SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD132SD xmm xmm xmm -// VFMADD132SD m64 xmm xmm -// Construct and append a VFMADD132SD instruction to the active function. -// Operates on the global context. -func VFMADD132SD(mx, x, x1 operand.Op) { ctx.VFMADD132SD(mx, x, x1) } - -// VFMADD132SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD132SS xmm xmm xmm -// VFMADD132SS m32 xmm xmm -// Construct and append a VFMADD132SS instruction to the active function. -func (c *Context) VFMADD132SS(mx, x, x1 operand.Op) { - if inst, err := x86.VFMADD132SS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADD132SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD132SS xmm xmm xmm -// VFMADD132SS m32 xmm xmm -// Construct and append a VFMADD132SS instruction to the active function. -// Operates on the global context. -func VFMADD132SS(mx, x, x1 operand.Op) { ctx.VFMADD132SS(mx, x, x1) } - -// VFMADD213PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD213PD xmm xmm xmm -// VFMADD213PD m128 xmm xmm -// VFMADD213PD ymm ymm ymm -// VFMADD213PD m256 ymm ymm -// Construct and append a VFMADD213PD instruction to the active function. -func (c *Context) VFMADD213PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMADD213PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADD213PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD213PD xmm xmm xmm -// VFMADD213PD m128 xmm xmm -// VFMADD213PD ymm ymm ymm -// VFMADD213PD m256 ymm ymm -// Construct and append a VFMADD213PD instruction to the active function. -// Operates on the global context. -func VFMADD213PD(mxy, xy, xy1 operand.Op) { ctx.VFMADD213PD(mxy, xy, xy1) } - -// VFMADD213PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD213PS xmm xmm xmm -// VFMADD213PS m128 xmm xmm -// VFMADD213PS ymm ymm ymm -// VFMADD213PS m256 ymm ymm -// Construct and append a VFMADD213PS instruction to the active function. -func (c *Context) VFMADD213PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMADD213PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADD213PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD213PS xmm xmm xmm -// VFMADD213PS m128 xmm xmm -// VFMADD213PS ymm ymm ymm -// VFMADD213PS m256 ymm ymm -// Construct and append a VFMADD213PS instruction to the active function. -// Operates on the global context. -func VFMADD213PS(mxy, xy, xy1 operand.Op) { ctx.VFMADD213PS(mxy, xy, xy1) } - -// VFMADD213SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD213SD xmm xmm xmm -// VFMADD213SD m64 xmm xmm -// Construct and append a VFMADD213SD instruction to the active function. -func (c *Context) VFMADD213SD(mx, x, x1 operand.Op) { - if inst, err := x86.VFMADD213SD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADD213SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD213SD xmm xmm xmm -// VFMADD213SD m64 xmm xmm -// Construct and append a VFMADD213SD instruction to the active function. -// Operates on the global context. -func VFMADD213SD(mx, x, x1 operand.Op) { ctx.VFMADD213SD(mx, x, x1) } - -// VFMADD213SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD213SS xmm xmm xmm -// VFMADD213SS m32 xmm xmm -// Construct and append a VFMADD213SS instruction to the active function. -func (c *Context) VFMADD213SS(mx, x, x1 operand.Op) { - if inst, err := x86.VFMADD213SS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADD213SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD213SS xmm xmm xmm -// VFMADD213SS m32 xmm xmm -// Construct and append a VFMADD213SS instruction to the active function. -// Operates on the global context. -func VFMADD213SS(mx, x, x1 operand.Op) { ctx.VFMADD213SS(mx, x, x1) } - -// VFMADD231PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD231PD xmm xmm xmm -// VFMADD231PD m128 xmm xmm -// VFMADD231PD ymm ymm ymm -// VFMADD231PD m256 ymm ymm -// Construct and append a VFMADD231PD instruction to the active function. -func (c *Context) VFMADD231PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMADD231PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADD231PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD231PD xmm xmm xmm -// VFMADD231PD m128 xmm xmm -// VFMADD231PD ymm ymm ymm -// VFMADD231PD m256 ymm ymm -// Construct and append a VFMADD231PD instruction to the active function. -// Operates on the global context. -func VFMADD231PD(mxy, xy, xy1 operand.Op) { ctx.VFMADD231PD(mxy, xy, xy1) } - -// VFMADD231PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD231PS xmm xmm xmm -// VFMADD231PS m128 xmm xmm -// VFMADD231PS ymm ymm ymm -// VFMADD231PS m256 ymm ymm -// Construct and append a VFMADD231PS instruction to the active function. -func (c *Context) VFMADD231PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMADD231PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADD231PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD231PS xmm xmm xmm -// VFMADD231PS m128 xmm xmm -// VFMADD231PS ymm ymm ymm -// VFMADD231PS m256 ymm ymm -// Construct and append a VFMADD231PS instruction to the active function. -// Operates on the global context. -func VFMADD231PS(mxy, xy, xy1 operand.Op) { ctx.VFMADD231PS(mxy, xy, xy1) } - -// VFMADD231SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD231SD xmm xmm xmm -// VFMADD231SD m64 xmm xmm -// Construct and append a VFMADD231SD instruction to the active function. -func (c *Context) VFMADD231SD(mx, x, x1 operand.Op) { - if inst, err := x86.VFMADD231SD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADD231SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD231SD xmm xmm xmm -// VFMADD231SD m64 xmm xmm -// Construct and append a VFMADD231SD instruction to the active function. -// Operates on the global context. -func VFMADD231SD(mx, x, x1 operand.Op) { ctx.VFMADD231SD(mx, x, x1) } - -// VFMADD231SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD231SS xmm xmm xmm -// VFMADD231SS m32 xmm xmm -// Construct and append a VFMADD231SS instruction to the active function. -func (c *Context) VFMADD231SS(mx, x, x1 operand.Op) { - if inst, err := x86.VFMADD231SS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADD231SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD231SS xmm xmm xmm -// VFMADD231SS m32 xmm xmm -// Construct and append a VFMADD231SS instruction to the active function. -// Operates on the global context. -func VFMADD231SS(mx, x, x1 operand.Op) { ctx.VFMADD231SS(mx, x, x1) } - -// VFMADDSUB132PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB132PD xmm xmm xmm -// VFMADDSUB132PD m128 xmm xmm -// VFMADDSUB132PD ymm ymm ymm -// VFMADDSUB132PD m256 ymm ymm -// Construct and append a VFMADDSUB132PD instruction to the active function. -func (c *Context) VFMADDSUB132PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMADDSUB132PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADDSUB132PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB132PD xmm xmm xmm -// VFMADDSUB132PD m128 xmm xmm -// VFMADDSUB132PD ymm ymm ymm -// VFMADDSUB132PD m256 ymm ymm -// Construct and append a VFMADDSUB132PD instruction to the active function. -// Operates on the global context. -func VFMADDSUB132PD(mxy, xy, xy1 operand.Op) { ctx.VFMADDSUB132PD(mxy, xy, xy1) } - -// VFMADDSUB132PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB132PS xmm xmm xmm -// VFMADDSUB132PS m128 xmm xmm -// VFMADDSUB132PS ymm ymm ymm -// VFMADDSUB132PS m256 ymm ymm -// Construct and append a VFMADDSUB132PS instruction to the active function. -func (c *Context) VFMADDSUB132PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMADDSUB132PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADDSUB132PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB132PS xmm xmm xmm -// VFMADDSUB132PS m128 xmm xmm -// VFMADDSUB132PS ymm ymm ymm -// VFMADDSUB132PS m256 ymm ymm -// Construct and append a VFMADDSUB132PS instruction to the active function. -// Operates on the global context. -func VFMADDSUB132PS(mxy, xy, xy1 operand.Op) { ctx.VFMADDSUB132PS(mxy, xy, xy1) } - -// VFMADDSUB213PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB213PD xmm xmm xmm -// VFMADDSUB213PD m128 xmm xmm -// VFMADDSUB213PD ymm ymm ymm -// VFMADDSUB213PD m256 ymm ymm -// Construct and append a VFMADDSUB213PD instruction to the active function. -func (c *Context) VFMADDSUB213PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMADDSUB213PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADDSUB213PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB213PD xmm xmm xmm -// VFMADDSUB213PD m128 xmm xmm -// VFMADDSUB213PD ymm ymm ymm -// VFMADDSUB213PD m256 ymm ymm -// Construct and append a VFMADDSUB213PD instruction to the active function. -// Operates on the global context. -func VFMADDSUB213PD(mxy, xy, xy1 operand.Op) { ctx.VFMADDSUB213PD(mxy, xy, xy1) } - -// VFMADDSUB213PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB213PS xmm xmm xmm -// VFMADDSUB213PS m128 xmm xmm -// VFMADDSUB213PS ymm ymm ymm -// VFMADDSUB213PS m256 ymm ymm -// Construct and append a VFMADDSUB213PS instruction to the active function. -func (c *Context) VFMADDSUB213PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMADDSUB213PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADDSUB213PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB213PS xmm xmm xmm -// VFMADDSUB213PS m128 xmm xmm -// VFMADDSUB213PS ymm ymm ymm -// VFMADDSUB213PS m256 ymm ymm -// Construct and append a VFMADDSUB213PS instruction to the active function. -// Operates on the global context. -func VFMADDSUB213PS(mxy, xy, xy1 operand.Op) { ctx.VFMADDSUB213PS(mxy, xy, xy1) } - -// VFMADDSUB231PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB231PD xmm xmm xmm -// VFMADDSUB231PD m128 xmm xmm -// VFMADDSUB231PD ymm ymm ymm -// VFMADDSUB231PD m256 ymm ymm -// Construct and append a VFMADDSUB231PD instruction to the active function. -func (c *Context) VFMADDSUB231PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMADDSUB231PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADDSUB231PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB231PD xmm xmm xmm -// VFMADDSUB231PD m128 xmm xmm -// VFMADDSUB231PD ymm ymm ymm -// VFMADDSUB231PD m256 ymm ymm -// Construct and append a VFMADDSUB231PD instruction to the active function. -// Operates on the global context. -func VFMADDSUB231PD(mxy, xy, xy1 operand.Op) { ctx.VFMADDSUB231PD(mxy, xy, xy1) } - -// VFMADDSUB231PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB231PS xmm xmm xmm -// VFMADDSUB231PS m128 xmm xmm -// VFMADDSUB231PS ymm ymm ymm -// VFMADDSUB231PS m256 ymm ymm -// Construct and append a VFMADDSUB231PS instruction to the active function. -func (c *Context) VFMADDSUB231PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMADDSUB231PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMADDSUB231PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB231PS xmm xmm xmm -// VFMADDSUB231PS m128 xmm xmm -// VFMADDSUB231PS ymm ymm ymm -// VFMADDSUB231PS m256 ymm ymm -// Construct and append a VFMADDSUB231PS instruction to the active function. -// Operates on the global context. -func VFMADDSUB231PS(mxy, xy, xy1 operand.Op) { ctx.VFMADDSUB231PS(mxy, xy, xy1) } - -// VFMSUB132PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB132PD xmm xmm xmm -// VFMSUB132PD m128 xmm xmm -// VFMSUB132PD ymm ymm ymm -// VFMSUB132PD m256 ymm ymm -// Construct and append a VFMSUB132PD instruction to the active function. -func (c *Context) VFMSUB132PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMSUB132PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUB132PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB132PD xmm xmm xmm -// VFMSUB132PD m128 xmm xmm -// VFMSUB132PD ymm ymm ymm -// VFMSUB132PD m256 ymm ymm -// Construct and append a VFMSUB132PD instruction to the active function. -// Operates on the global context. -func VFMSUB132PD(mxy, xy, xy1 operand.Op) { ctx.VFMSUB132PD(mxy, xy, xy1) } - -// VFMSUB132PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB132PS xmm xmm xmm -// VFMSUB132PS m128 xmm xmm -// VFMSUB132PS ymm ymm ymm -// VFMSUB132PS m256 ymm ymm -// Construct and append a VFMSUB132PS instruction to the active function. -func (c *Context) VFMSUB132PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMSUB132PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUB132PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB132PS xmm xmm xmm -// VFMSUB132PS m128 xmm xmm -// VFMSUB132PS ymm ymm ymm -// VFMSUB132PS m256 ymm ymm -// Construct and append a VFMSUB132PS instruction to the active function. -// Operates on the global context. -func VFMSUB132PS(mxy, xy, xy1 operand.Op) { ctx.VFMSUB132PS(mxy, xy, xy1) } - -// VFMSUB132SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB132SD xmm xmm xmm -// VFMSUB132SD m64 xmm xmm -// Construct and append a VFMSUB132SD instruction to the active function. -func (c *Context) VFMSUB132SD(mx, x, x1 operand.Op) { - if inst, err := x86.VFMSUB132SD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUB132SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB132SD xmm xmm xmm -// VFMSUB132SD m64 xmm xmm -// Construct and append a VFMSUB132SD instruction to the active function. -// Operates on the global context. -func VFMSUB132SD(mx, x, x1 operand.Op) { ctx.VFMSUB132SD(mx, x, x1) } - -// VFMSUB132SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB132SS xmm xmm xmm -// VFMSUB132SS m32 xmm xmm -// Construct and append a VFMSUB132SS instruction to the active function. -func (c *Context) VFMSUB132SS(mx, x, x1 operand.Op) { - if inst, err := x86.VFMSUB132SS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUB132SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB132SS xmm xmm xmm -// VFMSUB132SS m32 xmm xmm -// Construct and append a VFMSUB132SS instruction to the active function. -// Operates on the global context. -func VFMSUB132SS(mx, x, x1 operand.Op) { ctx.VFMSUB132SS(mx, x, x1) } - -// VFMSUB213PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB213PD xmm xmm xmm -// VFMSUB213PD m128 xmm xmm -// VFMSUB213PD ymm ymm ymm -// VFMSUB213PD m256 ymm ymm -// Construct and append a VFMSUB213PD instruction to the active function. -func (c *Context) VFMSUB213PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMSUB213PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUB213PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB213PD xmm xmm xmm -// VFMSUB213PD m128 xmm xmm -// VFMSUB213PD ymm ymm ymm -// VFMSUB213PD m256 ymm ymm -// Construct and append a VFMSUB213PD instruction to the active function. -// Operates on the global context. -func VFMSUB213PD(mxy, xy, xy1 operand.Op) { ctx.VFMSUB213PD(mxy, xy, xy1) } - -// VFMSUB213PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB213PS xmm xmm xmm -// VFMSUB213PS m128 xmm xmm -// VFMSUB213PS ymm ymm ymm -// VFMSUB213PS m256 ymm ymm -// Construct and append a VFMSUB213PS instruction to the active function. -func (c *Context) VFMSUB213PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMSUB213PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUB213PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB213PS xmm xmm xmm -// VFMSUB213PS m128 xmm xmm -// VFMSUB213PS ymm ymm ymm -// VFMSUB213PS m256 ymm ymm -// Construct and append a VFMSUB213PS instruction to the active function. -// Operates on the global context. -func VFMSUB213PS(mxy, xy, xy1 operand.Op) { ctx.VFMSUB213PS(mxy, xy, xy1) } - -// VFMSUB213SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB213SD xmm xmm xmm -// VFMSUB213SD m64 xmm xmm -// Construct and append a VFMSUB213SD instruction to the active function. -func (c *Context) VFMSUB213SD(mx, x, x1 operand.Op) { - if inst, err := x86.VFMSUB213SD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUB213SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB213SD xmm xmm xmm -// VFMSUB213SD m64 xmm xmm -// Construct and append a VFMSUB213SD instruction to the active function. -// Operates on the global context. -func VFMSUB213SD(mx, x, x1 operand.Op) { ctx.VFMSUB213SD(mx, x, x1) } - -// VFMSUB213SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB213SS xmm xmm xmm -// VFMSUB213SS m32 xmm xmm -// Construct and append a VFMSUB213SS instruction to the active function. -func (c *Context) VFMSUB213SS(mx, x, x1 operand.Op) { - if inst, err := x86.VFMSUB213SS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUB213SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB213SS xmm xmm xmm -// VFMSUB213SS m32 xmm xmm -// Construct and append a VFMSUB213SS instruction to the active function. -// Operates on the global context. -func VFMSUB213SS(mx, x, x1 operand.Op) { ctx.VFMSUB213SS(mx, x, x1) } - -// VFMSUB231PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB231PD xmm xmm xmm -// VFMSUB231PD m128 xmm xmm -// VFMSUB231PD ymm ymm ymm -// VFMSUB231PD m256 ymm ymm -// Construct and append a VFMSUB231PD instruction to the active function. -func (c *Context) VFMSUB231PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMSUB231PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUB231PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB231PD xmm xmm xmm -// VFMSUB231PD m128 xmm xmm -// VFMSUB231PD ymm ymm ymm -// VFMSUB231PD m256 ymm ymm -// Construct and append a VFMSUB231PD instruction to the active function. -// Operates on the global context. -func VFMSUB231PD(mxy, xy, xy1 operand.Op) { ctx.VFMSUB231PD(mxy, xy, xy1) } - -// VFMSUB231PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB231PS xmm xmm xmm -// VFMSUB231PS m128 xmm xmm -// VFMSUB231PS ymm ymm ymm -// VFMSUB231PS m256 ymm ymm -// Construct and append a VFMSUB231PS instruction to the active function. -func (c *Context) VFMSUB231PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMSUB231PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUB231PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB231PS xmm xmm xmm -// VFMSUB231PS m128 xmm xmm -// VFMSUB231PS ymm ymm ymm -// VFMSUB231PS m256 ymm ymm -// Construct and append a VFMSUB231PS instruction to the active function. -// Operates on the global context. -func VFMSUB231PS(mxy, xy, xy1 operand.Op) { ctx.VFMSUB231PS(mxy, xy, xy1) } - -// VFMSUB231SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB231SD xmm xmm xmm -// VFMSUB231SD m64 xmm xmm -// Construct and append a VFMSUB231SD instruction to the active function. -func (c *Context) VFMSUB231SD(mx, x, x1 operand.Op) { - if inst, err := x86.VFMSUB231SD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUB231SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB231SD xmm xmm xmm -// VFMSUB231SD m64 xmm xmm -// Construct and append a VFMSUB231SD instruction to the active function. -// Operates on the global context. -func VFMSUB231SD(mx, x, x1 operand.Op) { ctx.VFMSUB231SD(mx, x, x1) } - -// VFMSUB231SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB231SS xmm xmm xmm -// VFMSUB231SS m32 xmm xmm -// Construct and append a VFMSUB231SS instruction to the active function. -func (c *Context) VFMSUB231SS(mx, x, x1 operand.Op) { - if inst, err := x86.VFMSUB231SS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUB231SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB231SS xmm xmm xmm -// VFMSUB231SS m32 xmm xmm -// Construct and append a VFMSUB231SS instruction to the active function. -// Operates on the global context. -func VFMSUB231SS(mx, x, x1 operand.Op) { ctx.VFMSUB231SS(mx, x, x1) } - -// VFMSUBADD132PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD132PD xmm xmm xmm -// VFMSUBADD132PD m128 xmm xmm -// VFMSUBADD132PD ymm ymm ymm -// VFMSUBADD132PD m256 ymm ymm -// Construct and append a VFMSUBADD132PD instruction to the active function. -func (c *Context) VFMSUBADD132PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMSUBADD132PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUBADD132PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD132PD xmm xmm xmm -// VFMSUBADD132PD m128 xmm xmm -// VFMSUBADD132PD ymm ymm ymm -// VFMSUBADD132PD m256 ymm ymm -// Construct and append a VFMSUBADD132PD instruction to the active function. -// Operates on the global context. -func VFMSUBADD132PD(mxy, xy, xy1 operand.Op) { ctx.VFMSUBADD132PD(mxy, xy, xy1) } - -// VFMSUBADD132PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD132PS xmm xmm xmm -// VFMSUBADD132PS m128 xmm xmm -// VFMSUBADD132PS ymm ymm ymm -// VFMSUBADD132PS m256 ymm ymm -// Construct and append a VFMSUBADD132PS instruction to the active function. -func (c *Context) VFMSUBADD132PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMSUBADD132PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUBADD132PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD132PS xmm xmm xmm -// VFMSUBADD132PS m128 xmm xmm -// VFMSUBADD132PS ymm ymm ymm -// VFMSUBADD132PS m256 ymm ymm -// Construct and append a VFMSUBADD132PS instruction to the active function. -// Operates on the global context. -func VFMSUBADD132PS(mxy, xy, xy1 operand.Op) { ctx.VFMSUBADD132PS(mxy, xy, xy1) } - -// VFMSUBADD213PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD213PD xmm xmm xmm -// VFMSUBADD213PD m128 xmm xmm -// VFMSUBADD213PD ymm ymm ymm -// VFMSUBADD213PD m256 ymm ymm -// Construct and append a VFMSUBADD213PD instruction to the active function. -func (c *Context) VFMSUBADD213PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMSUBADD213PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUBADD213PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD213PD xmm xmm xmm -// VFMSUBADD213PD m128 xmm xmm -// VFMSUBADD213PD ymm ymm ymm -// VFMSUBADD213PD m256 ymm ymm -// Construct and append a VFMSUBADD213PD instruction to the active function. -// Operates on the global context. -func VFMSUBADD213PD(mxy, xy, xy1 operand.Op) { ctx.VFMSUBADD213PD(mxy, xy, xy1) } - -// VFMSUBADD213PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD213PS xmm xmm xmm -// VFMSUBADD213PS m128 xmm xmm -// VFMSUBADD213PS ymm ymm ymm -// VFMSUBADD213PS m256 ymm ymm -// Construct and append a VFMSUBADD213PS instruction to the active function. -func (c *Context) VFMSUBADD213PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMSUBADD213PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUBADD213PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD213PS xmm xmm xmm -// VFMSUBADD213PS m128 xmm xmm -// VFMSUBADD213PS ymm ymm ymm -// VFMSUBADD213PS m256 ymm ymm -// Construct and append a VFMSUBADD213PS instruction to the active function. -// Operates on the global context. -func VFMSUBADD213PS(mxy, xy, xy1 operand.Op) { ctx.VFMSUBADD213PS(mxy, xy, xy1) } - -// VFMSUBADD231PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD231PD xmm xmm xmm -// VFMSUBADD231PD m128 xmm xmm -// VFMSUBADD231PD ymm ymm ymm -// VFMSUBADD231PD m256 ymm ymm -// Construct and append a VFMSUBADD231PD instruction to the active function. -func (c *Context) VFMSUBADD231PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMSUBADD231PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUBADD231PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD231PD xmm xmm xmm -// VFMSUBADD231PD m128 xmm xmm -// VFMSUBADD231PD ymm ymm ymm -// VFMSUBADD231PD m256 ymm ymm -// Construct and append a VFMSUBADD231PD instruction to the active function. -// Operates on the global context. -func VFMSUBADD231PD(mxy, xy, xy1 operand.Op) { ctx.VFMSUBADD231PD(mxy, xy, xy1) } - -// VFMSUBADD231PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD231PS xmm xmm xmm -// VFMSUBADD231PS m128 xmm xmm -// VFMSUBADD231PS ymm ymm ymm -// VFMSUBADD231PS m256 ymm ymm -// Construct and append a VFMSUBADD231PS instruction to the active function. -func (c *Context) VFMSUBADD231PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFMSUBADD231PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFMSUBADD231PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD231PS xmm xmm xmm -// VFMSUBADD231PS m128 xmm xmm -// VFMSUBADD231PS ymm ymm ymm -// VFMSUBADD231PS m256 ymm ymm -// Construct and append a VFMSUBADD231PS instruction to the active function. -// Operates on the global context. -func VFMSUBADD231PS(mxy, xy, xy1 operand.Op) { ctx.VFMSUBADD231PS(mxy, xy, xy1) } - -// VFNMADD132PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD132PD xmm xmm xmm -// VFNMADD132PD m128 xmm xmm -// VFNMADD132PD ymm ymm ymm -// VFNMADD132PD m256 ymm ymm -// Construct and append a VFNMADD132PD instruction to the active function. -func (c *Context) VFNMADD132PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFNMADD132PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMADD132PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD132PD xmm xmm xmm -// VFNMADD132PD m128 xmm xmm -// VFNMADD132PD ymm ymm ymm -// VFNMADD132PD m256 ymm ymm -// Construct and append a VFNMADD132PD instruction to the active function. -// Operates on the global context. -func VFNMADD132PD(mxy, xy, xy1 operand.Op) { ctx.VFNMADD132PD(mxy, xy, xy1) } - -// VFNMADD132PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD132PS xmm xmm xmm -// VFNMADD132PS m128 xmm xmm -// VFNMADD132PS ymm ymm ymm -// VFNMADD132PS m256 ymm ymm -// Construct and append a VFNMADD132PS instruction to the active function. -func (c *Context) VFNMADD132PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFNMADD132PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMADD132PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD132PS xmm xmm xmm -// VFNMADD132PS m128 xmm xmm -// VFNMADD132PS ymm ymm ymm -// VFNMADD132PS m256 ymm ymm -// Construct and append a VFNMADD132PS instruction to the active function. -// Operates on the global context. -func VFNMADD132PS(mxy, xy, xy1 operand.Op) { ctx.VFNMADD132PS(mxy, xy, xy1) } - -// VFNMADD132SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD132SD xmm xmm xmm -// VFNMADD132SD m64 xmm xmm -// Construct and append a VFNMADD132SD instruction to the active function. -func (c *Context) VFNMADD132SD(mx, x, x1 operand.Op) { - if inst, err := x86.VFNMADD132SD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMADD132SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD132SD xmm xmm xmm -// VFNMADD132SD m64 xmm xmm -// Construct and append a VFNMADD132SD instruction to the active function. -// Operates on the global context. -func VFNMADD132SD(mx, x, x1 operand.Op) { ctx.VFNMADD132SD(mx, x, x1) } - -// VFNMADD132SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD132SS xmm xmm xmm -// VFNMADD132SS m32 xmm xmm -// Construct and append a VFNMADD132SS instruction to the active function. -func (c *Context) VFNMADD132SS(mx, x, x1 operand.Op) { - if inst, err := x86.VFNMADD132SS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMADD132SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD132SS xmm xmm xmm -// VFNMADD132SS m32 xmm xmm -// Construct and append a VFNMADD132SS instruction to the active function. -// Operates on the global context. -func VFNMADD132SS(mx, x, x1 operand.Op) { ctx.VFNMADD132SS(mx, x, x1) } - -// VFNMADD213PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD213PD xmm xmm xmm -// VFNMADD213PD m128 xmm xmm -// VFNMADD213PD ymm ymm ymm -// VFNMADD213PD m256 ymm ymm -// Construct and append a VFNMADD213PD instruction to the active function. -func (c *Context) VFNMADD213PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFNMADD213PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMADD213PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD213PD xmm xmm xmm -// VFNMADD213PD m128 xmm xmm -// VFNMADD213PD ymm ymm ymm -// VFNMADD213PD m256 ymm ymm -// Construct and append a VFNMADD213PD instruction to the active function. -// Operates on the global context. -func VFNMADD213PD(mxy, xy, xy1 operand.Op) { ctx.VFNMADD213PD(mxy, xy, xy1) } - -// VFNMADD213PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD213PS xmm xmm xmm -// VFNMADD213PS m128 xmm xmm -// VFNMADD213PS ymm ymm ymm -// VFNMADD213PS m256 ymm ymm -// Construct and append a VFNMADD213PS instruction to the active function. -func (c *Context) VFNMADD213PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFNMADD213PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMADD213PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD213PS xmm xmm xmm -// VFNMADD213PS m128 xmm xmm -// VFNMADD213PS ymm ymm ymm -// VFNMADD213PS m256 ymm ymm -// Construct and append a VFNMADD213PS instruction to the active function. -// Operates on the global context. -func VFNMADD213PS(mxy, xy, xy1 operand.Op) { ctx.VFNMADD213PS(mxy, xy, xy1) } - -// VFNMADD213SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD213SD xmm xmm xmm -// VFNMADD213SD m64 xmm xmm -// Construct and append a VFNMADD213SD instruction to the active function. -func (c *Context) VFNMADD213SD(mx, x, x1 operand.Op) { - if inst, err := x86.VFNMADD213SD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMADD213SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD213SD xmm xmm xmm -// VFNMADD213SD m64 xmm xmm -// Construct and append a VFNMADD213SD instruction to the active function. -// Operates on the global context. -func VFNMADD213SD(mx, x, x1 operand.Op) { ctx.VFNMADD213SD(mx, x, x1) } - -// VFNMADD213SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD213SS xmm xmm xmm -// VFNMADD213SS m32 xmm xmm -// Construct and append a VFNMADD213SS instruction to the active function. -func (c *Context) VFNMADD213SS(mx, x, x1 operand.Op) { - if inst, err := x86.VFNMADD213SS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMADD213SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD213SS xmm xmm xmm -// VFNMADD213SS m32 xmm xmm -// Construct and append a VFNMADD213SS instruction to the active function. -// Operates on the global context. -func VFNMADD213SS(mx, x, x1 operand.Op) { ctx.VFNMADD213SS(mx, x, x1) } - -// VFNMADD231PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD231PD xmm xmm xmm -// VFNMADD231PD m128 xmm xmm -// VFNMADD231PD ymm ymm ymm -// VFNMADD231PD m256 ymm ymm -// Construct and append a VFNMADD231PD instruction to the active function. -func (c *Context) VFNMADD231PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFNMADD231PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMADD231PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD231PD xmm xmm xmm -// VFNMADD231PD m128 xmm xmm -// VFNMADD231PD ymm ymm ymm -// VFNMADD231PD m256 ymm ymm -// Construct and append a VFNMADD231PD instruction to the active function. -// Operates on the global context. -func VFNMADD231PD(mxy, xy, xy1 operand.Op) { ctx.VFNMADD231PD(mxy, xy, xy1) } - -// VFNMADD231PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD231PS xmm xmm xmm -// VFNMADD231PS m128 xmm xmm -// VFNMADD231PS ymm ymm ymm -// VFNMADD231PS m256 ymm ymm -// Construct and append a VFNMADD231PS instruction to the active function. -func (c *Context) VFNMADD231PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFNMADD231PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMADD231PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD231PS xmm xmm xmm -// VFNMADD231PS m128 xmm xmm -// VFNMADD231PS ymm ymm ymm -// VFNMADD231PS m256 ymm ymm -// Construct and append a VFNMADD231PS instruction to the active function. -// Operates on the global context. -func VFNMADD231PS(mxy, xy, xy1 operand.Op) { ctx.VFNMADD231PS(mxy, xy, xy1) } - -// VFNMADD231SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD231SD xmm xmm xmm -// VFNMADD231SD m64 xmm xmm -// Construct and append a VFNMADD231SD instruction to the active function. -func (c *Context) VFNMADD231SD(mx, x, x1 operand.Op) { - if inst, err := x86.VFNMADD231SD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMADD231SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD231SD xmm xmm xmm -// VFNMADD231SD m64 xmm xmm -// Construct and append a VFNMADD231SD instruction to the active function. -// Operates on the global context. -func VFNMADD231SD(mx, x, x1 operand.Op) { ctx.VFNMADD231SD(mx, x, x1) } - -// VFNMADD231SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD231SS xmm xmm xmm -// VFNMADD231SS m32 xmm xmm -// Construct and append a VFNMADD231SS instruction to the active function. -func (c *Context) VFNMADD231SS(mx, x, x1 operand.Op) { - if inst, err := x86.VFNMADD231SS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMADD231SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD231SS xmm xmm xmm -// VFNMADD231SS m32 xmm xmm -// Construct and append a VFNMADD231SS instruction to the active function. -// Operates on the global context. -func VFNMADD231SS(mx, x, x1 operand.Op) { ctx.VFNMADD231SS(mx, x, x1) } - -// VFNMSUB132PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB132PD xmm xmm xmm -// VFNMSUB132PD m128 xmm xmm -// VFNMSUB132PD ymm ymm ymm -// VFNMSUB132PD m256 ymm ymm -// Construct and append a VFNMSUB132PD instruction to the active function. -func (c *Context) VFNMSUB132PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFNMSUB132PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMSUB132PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB132PD xmm xmm xmm -// VFNMSUB132PD m128 xmm xmm -// VFNMSUB132PD ymm ymm ymm -// VFNMSUB132PD m256 ymm ymm -// Construct and append a VFNMSUB132PD instruction to the active function. -// Operates on the global context. -func VFNMSUB132PD(mxy, xy, xy1 operand.Op) { ctx.VFNMSUB132PD(mxy, xy, xy1) } - -// VFNMSUB132PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB132PS xmm xmm xmm -// VFNMSUB132PS m128 xmm xmm -// VFNMSUB132PS ymm ymm ymm -// VFNMSUB132PS m256 ymm ymm -// Construct and append a VFNMSUB132PS instruction to the active function. -func (c *Context) VFNMSUB132PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFNMSUB132PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMSUB132PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB132PS xmm xmm xmm -// VFNMSUB132PS m128 xmm xmm -// VFNMSUB132PS ymm ymm ymm -// VFNMSUB132PS m256 ymm ymm -// Construct and append a VFNMSUB132PS instruction to the active function. -// Operates on the global context. -func VFNMSUB132PS(mxy, xy, xy1 operand.Op) { ctx.VFNMSUB132PS(mxy, xy, xy1) } - -// VFNMSUB132SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB132SD xmm xmm xmm -// VFNMSUB132SD m64 xmm xmm -// Construct and append a VFNMSUB132SD instruction to the active function. -func (c *Context) VFNMSUB132SD(mx, x, x1 operand.Op) { - if inst, err := x86.VFNMSUB132SD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMSUB132SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB132SD xmm xmm xmm -// VFNMSUB132SD m64 xmm xmm -// Construct and append a VFNMSUB132SD instruction to the active function. -// Operates on the global context. -func VFNMSUB132SD(mx, x, x1 operand.Op) { ctx.VFNMSUB132SD(mx, x, x1) } - -// VFNMSUB132SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB132SS xmm xmm xmm -// VFNMSUB132SS m32 xmm xmm -// Construct and append a VFNMSUB132SS instruction to the active function. -func (c *Context) VFNMSUB132SS(mx, x, x1 operand.Op) { - if inst, err := x86.VFNMSUB132SS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMSUB132SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB132SS xmm xmm xmm -// VFNMSUB132SS m32 xmm xmm -// Construct and append a VFNMSUB132SS instruction to the active function. -// Operates on the global context. -func VFNMSUB132SS(mx, x, x1 operand.Op) { ctx.VFNMSUB132SS(mx, x, x1) } - -// VFNMSUB213PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB213PD xmm xmm xmm -// VFNMSUB213PD m128 xmm xmm -// VFNMSUB213PD ymm ymm ymm -// VFNMSUB213PD m256 ymm ymm -// Construct and append a VFNMSUB213PD instruction to the active function. -func (c *Context) VFNMSUB213PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFNMSUB213PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMSUB213PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB213PD xmm xmm xmm -// VFNMSUB213PD m128 xmm xmm -// VFNMSUB213PD ymm ymm ymm -// VFNMSUB213PD m256 ymm ymm -// Construct and append a VFNMSUB213PD instruction to the active function. -// Operates on the global context. -func VFNMSUB213PD(mxy, xy, xy1 operand.Op) { ctx.VFNMSUB213PD(mxy, xy, xy1) } - -// VFNMSUB213PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB213PS xmm xmm xmm -// VFNMSUB213PS m128 xmm xmm -// VFNMSUB213PS ymm ymm ymm -// VFNMSUB213PS m256 ymm ymm -// Construct and append a VFNMSUB213PS instruction to the active function. -func (c *Context) VFNMSUB213PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFNMSUB213PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMSUB213PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB213PS xmm xmm xmm -// VFNMSUB213PS m128 xmm xmm -// VFNMSUB213PS ymm ymm ymm -// VFNMSUB213PS m256 ymm ymm -// Construct and append a VFNMSUB213PS instruction to the active function. -// Operates on the global context. -func VFNMSUB213PS(mxy, xy, xy1 operand.Op) { ctx.VFNMSUB213PS(mxy, xy, xy1) } - -// VFNMSUB213SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB213SD xmm xmm xmm -// VFNMSUB213SD m64 xmm xmm -// Construct and append a VFNMSUB213SD instruction to the active function. -func (c *Context) VFNMSUB213SD(mx, x, x1 operand.Op) { - if inst, err := x86.VFNMSUB213SD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMSUB213SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB213SD xmm xmm xmm -// VFNMSUB213SD m64 xmm xmm -// Construct and append a VFNMSUB213SD instruction to the active function. -// Operates on the global context. -func VFNMSUB213SD(mx, x, x1 operand.Op) { ctx.VFNMSUB213SD(mx, x, x1) } - -// VFNMSUB213SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB213SS xmm xmm xmm -// VFNMSUB213SS m32 xmm xmm -// Construct and append a VFNMSUB213SS instruction to the active function. -func (c *Context) VFNMSUB213SS(mx, x, x1 operand.Op) { - if inst, err := x86.VFNMSUB213SS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMSUB213SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB213SS xmm xmm xmm -// VFNMSUB213SS m32 xmm xmm -// Construct and append a VFNMSUB213SS instruction to the active function. -// Operates on the global context. -func VFNMSUB213SS(mx, x, x1 operand.Op) { ctx.VFNMSUB213SS(mx, x, x1) } - -// VFNMSUB231PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB231PD xmm xmm xmm -// VFNMSUB231PD m128 xmm xmm -// VFNMSUB231PD ymm ymm ymm -// VFNMSUB231PD m256 ymm ymm -// Construct and append a VFNMSUB231PD instruction to the active function. -func (c *Context) VFNMSUB231PD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFNMSUB231PD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMSUB231PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB231PD xmm xmm xmm -// VFNMSUB231PD m128 xmm xmm -// VFNMSUB231PD ymm ymm ymm -// VFNMSUB231PD m256 ymm ymm -// Construct and append a VFNMSUB231PD instruction to the active function. -// Operates on the global context. -func VFNMSUB231PD(mxy, xy, xy1 operand.Op) { ctx.VFNMSUB231PD(mxy, xy, xy1) } - -// VFNMSUB231PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB231PS xmm xmm xmm -// VFNMSUB231PS m128 xmm xmm -// VFNMSUB231PS ymm ymm ymm -// VFNMSUB231PS m256 ymm ymm -// Construct and append a VFNMSUB231PS instruction to the active function. -func (c *Context) VFNMSUB231PS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VFNMSUB231PS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMSUB231PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB231PS xmm xmm xmm -// VFNMSUB231PS m128 xmm xmm -// VFNMSUB231PS ymm ymm ymm -// VFNMSUB231PS m256 ymm ymm -// Construct and append a VFNMSUB231PS instruction to the active function. -// Operates on the global context. -func VFNMSUB231PS(mxy, xy, xy1 operand.Op) { ctx.VFNMSUB231PS(mxy, xy, xy1) } - -// VFNMSUB231SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB231SD xmm xmm xmm -// VFNMSUB231SD m64 xmm xmm -// Construct and append a VFNMSUB231SD instruction to the active function. -func (c *Context) VFNMSUB231SD(mx, x, x1 operand.Op) { - if inst, err := x86.VFNMSUB231SD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMSUB231SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB231SD xmm xmm xmm -// VFNMSUB231SD m64 xmm xmm -// Construct and append a VFNMSUB231SD instruction to the active function. -// Operates on the global context. -func VFNMSUB231SD(mx, x, x1 operand.Op) { ctx.VFNMSUB231SD(mx, x, x1) } - -// VFNMSUB231SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB231SS xmm xmm xmm -// VFNMSUB231SS m32 xmm xmm -// Construct and append a VFNMSUB231SS instruction to the active function. -func (c *Context) VFNMSUB231SS(mx, x, x1 operand.Op) { - if inst, err := x86.VFNMSUB231SS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VFNMSUB231SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB231SS xmm xmm xmm -// VFNMSUB231SS m32 xmm xmm -// Construct and append a VFNMSUB231SS instruction to the active function. -// Operates on the global context. -func VFNMSUB231SS(mx, x, x1 operand.Op) { ctx.VFNMSUB231SS(mx, x, x1) } - -// VGATHERDPD: Gather Packed Double-Precision Floating-Point Values Using Signed Doubleword Indices. -// -// Forms: -// -// VGATHERDPD xmm vm32x xmm -// VGATHERDPD ymm vm32x ymm -// Construct and append a VGATHERDPD instruction to the active function. -func (c *Context) VGATHERDPD(xy, v, xy1 operand.Op) { - if inst, err := x86.VGATHERDPD(xy, v, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VGATHERDPD: Gather Packed Double-Precision Floating-Point Values Using Signed Doubleword Indices. -// -// Forms: -// -// VGATHERDPD xmm vm32x xmm -// VGATHERDPD ymm vm32x ymm -// Construct and append a VGATHERDPD instruction to the active function. -// Operates on the global context. -func VGATHERDPD(xy, v, xy1 operand.Op) { ctx.VGATHERDPD(xy, v, xy1) } - -// VGATHERDPS: Gather Packed Single-Precision Floating-Point Values Using Signed Doubleword Indices. -// -// Forms: -// -// VGATHERDPS xmm vm32x xmm -// VGATHERDPS ymm vm32y ymm -// Construct and append a VGATHERDPS instruction to the active function. -func (c *Context) VGATHERDPS(xy, v, xy1 operand.Op) { - if inst, err := x86.VGATHERDPS(xy, v, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VGATHERDPS: Gather Packed Single-Precision Floating-Point Values Using Signed Doubleword Indices. -// -// Forms: -// -// VGATHERDPS xmm vm32x xmm -// VGATHERDPS ymm vm32y ymm -// Construct and append a VGATHERDPS instruction to the active function. -// Operates on the global context. -func VGATHERDPS(xy, v, xy1 operand.Op) { ctx.VGATHERDPS(xy, v, xy1) } - -// VGATHERQPD: Gather Packed Double-Precision Floating-Point Values Using Signed Quadword Indices. -// -// Forms: -// -// VGATHERQPD xmm vm64x xmm -// VGATHERQPD ymm vm64y ymm -// Construct and append a VGATHERQPD instruction to the active function. -func (c *Context) VGATHERQPD(xy, v, xy1 operand.Op) { - if inst, err := x86.VGATHERQPD(xy, v, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VGATHERQPD: Gather Packed Double-Precision Floating-Point Values Using Signed Quadword Indices. -// -// Forms: -// -// VGATHERQPD xmm vm64x xmm -// VGATHERQPD ymm vm64y ymm -// Construct and append a VGATHERQPD instruction to the active function. -// Operates on the global context. -func VGATHERQPD(xy, v, xy1 operand.Op) { ctx.VGATHERQPD(xy, v, xy1) } - -// VGATHERQPS: Gather Packed Single-Precision Floating-Point Values Using Signed Quadword Indices. -// -// Forms: -// -// VGATHERQPS xmm vm64x xmm -// VGATHERQPS xmm vm64y xmm -// Construct and append a VGATHERQPS instruction to the active function. -func (c *Context) VGATHERQPS(x, v, x1 operand.Op) { - if inst, err := x86.VGATHERQPS(x, v, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VGATHERQPS: Gather Packed Single-Precision Floating-Point Values Using Signed Quadword Indices. -// -// Forms: -// -// VGATHERQPS xmm vm64x xmm -// VGATHERQPS xmm vm64y xmm -// Construct and append a VGATHERQPS instruction to the active function. -// Operates on the global context. -func VGATHERQPS(x, v, x1 operand.Op) { ctx.VGATHERQPS(x, v, x1) } - -// VHADDPD: Packed Double-FP Horizontal Add. -// -// Forms: -// -// VHADDPD xmm xmm xmm -// VHADDPD m128 xmm xmm -// VHADDPD ymm ymm ymm -// VHADDPD m256 ymm ymm -// Construct and append a VHADDPD instruction to the active function. -func (c *Context) VHADDPD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VHADDPD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VHADDPD: Packed Double-FP Horizontal Add. -// -// Forms: -// -// VHADDPD xmm xmm xmm -// VHADDPD m128 xmm xmm -// VHADDPD ymm ymm ymm -// VHADDPD m256 ymm ymm -// Construct and append a VHADDPD instruction to the active function. -// Operates on the global context. -func VHADDPD(mxy, xy, xy1 operand.Op) { ctx.VHADDPD(mxy, xy, xy1) } - -// VHADDPS: Packed Single-FP Horizontal Add. -// -// Forms: -// -// VHADDPS xmm xmm xmm -// VHADDPS m128 xmm xmm -// VHADDPS ymm ymm ymm -// VHADDPS m256 ymm ymm -// Construct and append a VHADDPS instruction to the active function. -func (c *Context) VHADDPS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VHADDPS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VHADDPS: Packed Single-FP Horizontal Add. -// -// Forms: -// -// VHADDPS xmm xmm xmm -// VHADDPS m128 xmm xmm -// VHADDPS ymm ymm ymm -// VHADDPS m256 ymm ymm -// Construct and append a VHADDPS instruction to the active function. -// Operates on the global context. -func VHADDPS(mxy, xy, xy1 operand.Op) { ctx.VHADDPS(mxy, xy, xy1) } - -// VHSUBPD: Packed Double-FP Horizontal Subtract. -// -// Forms: -// -// VHSUBPD xmm xmm xmm -// VHSUBPD m128 xmm xmm -// VHSUBPD ymm ymm ymm -// VHSUBPD m256 ymm ymm -// Construct and append a VHSUBPD instruction to the active function. -func (c *Context) VHSUBPD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VHSUBPD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VHSUBPD: Packed Double-FP Horizontal Subtract. -// -// Forms: -// -// VHSUBPD xmm xmm xmm -// VHSUBPD m128 xmm xmm -// VHSUBPD ymm ymm ymm -// VHSUBPD m256 ymm ymm -// Construct and append a VHSUBPD instruction to the active function. -// Operates on the global context. -func VHSUBPD(mxy, xy, xy1 operand.Op) { ctx.VHSUBPD(mxy, xy, xy1) } - -// VHSUBPS: Packed Single-FP Horizontal Subtract. -// -// Forms: -// -// VHSUBPS xmm xmm xmm -// VHSUBPS m128 xmm xmm -// VHSUBPS ymm ymm ymm -// VHSUBPS m256 ymm ymm -// Construct and append a VHSUBPS instruction to the active function. -func (c *Context) VHSUBPS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VHSUBPS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VHSUBPS: Packed Single-FP Horizontal Subtract. -// -// Forms: -// -// VHSUBPS xmm xmm xmm -// VHSUBPS m128 xmm xmm -// VHSUBPS ymm ymm ymm -// VHSUBPS m256 ymm ymm -// Construct and append a VHSUBPS instruction to the active function. -// Operates on the global context. -func VHSUBPS(mxy, xy, xy1 operand.Op) { ctx.VHSUBPS(mxy, xy, xy1) } - -// VINSERTF128: Insert Packed Floating-Point Values. -// -// Forms: -// -// VINSERTF128 imm8 xmm ymm ymm -// VINSERTF128 imm8 m128 ymm ymm -// Construct and append a VINSERTF128 instruction to the active function. -func (c *Context) VINSERTF128(i, mx, y, y1 operand.Op) { - if inst, err := x86.VINSERTF128(i, mx, y, y1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VINSERTF128: Insert Packed Floating-Point Values. -// -// Forms: -// -// VINSERTF128 imm8 xmm ymm ymm -// VINSERTF128 imm8 m128 ymm ymm -// Construct and append a VINSERTF128 instruction to the active function. -// Operates on the global context. -func VINSERTF128(i, mx, y, y1 operand.Op) { ctx.VINSERTF128(i, mx, y, y1) } - -// VINSERTI128: Insert Packed Integer Values. -// -// Forms: -// -// VINSERTI128 imm8 xmm ymm ymm -// VINSERTI128 imm8 m128 ymm ymm -// Construct and append a VINSERTI128 instruction to the active function. -func (c *Context) VINSERTI128(i, mx, y, y1 operand.Op) { - if inst, err := x86.VINSERTI128(i, mx, y, y1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VINSERTI128: Insert Packed Integer Values. -// -// Forms: -// -// VINSERTI128 imm8 xmm ymm ymm -// VINSERTI128 imm8 m128 ymm ymm -// Construct and append a VINSERTI128 instruction to the active function. -// Operates on the global context. -func VINSERTI128(i, mx, y, y1 operand.Op) { ctx.VINSERTI128(i, mx, y, y1) } - -// VINSERTPS: Insert Packed Single Precision Floating-Point Value. -// -// Forms: -// -// VINSERTPS imm8 xmm xmm xmm -// VINSERTPS imm8 m32 xmm xmm -// Construct and append a VINSERTPS instruction to the active function. -func (c *Context) VINSERTPS(i, mx, x, x1 operand.Op) { - if inst, err := x86.VINSERTPS(i, mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VINSERTPS: Insert Packed Single Precision Floating-Point Value. -// -// Forms: -// -// VINSERTPS imm8 xmm xmm xmm -// VINSERTPS imm8 m32 xmm xmm -// Construct and append a VINSERTPS instruction to the active function. -// Operates on the global context. -func VINSERTPS(i, mx, x, x1 operand.Op) { ctx.VINSERTPS(i, mx, x, x1) } - -// VLDDQU: Load Unaligned Integer 128 Bits. -// -// Forms: -// -// VLDDQU m128 xmm -// VLDDQU m256 ymm -// Construct and append a VLDDQU instruction to the active function. -func (c *Context) VLDDQU(m, xy operand.Op) { - if inst, err := x86.VLDDQU(m, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VLDDQU: Load Unaligned Integer 128 Bits. -// -// Forms: -// -// VLDDQU m128 xmm -// VLDDQU m256 ymm -// Construct and append a VLDDQU instruction to the active function. -// Operates on the global context. -func VLDDQU(m, xy operand.Op) { ctx.VLDDQU(m, xy) } - -// VLDMXCSR: Load MXCSR Register. -// -// Forms: -// -// VLDMXCSR m32 -// Construct and append a VLDMXCSR instruction to the active function. -func (c *Context) VLDMXCSR(m operand.Op) { - if inst, err := x86.VLDMXCSR(m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VLDMXCSR: Load MXCSR Register. -// -// Forms: -// -// VLDMXCSR m32 -// Construct and append a VLDMXCSR instruction to the active function. -// Operates on the global context. -func VLDMXCSR(m operand.Op) { ctx.VLDMXCSR(m) } - -// VMASKMOVDQU: Store Selected Bytes of Double Quadword. -// -// Forms: -// -// VMASKMOVDQU xmm xmm -// Construct and append a VMASKMOVDQU instruction to the active function. -func (c *Context) VMASKMOVDQU(x, x1 operand.Op) { - if inst, err := x86.VMASKMOVDQU(x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMASKMOVDQU: Store Selected Bytes of Double Quadword. -// -// Forms: -// -// VMASKMOVDQU xmm xmm -// Construct and append a VMASKMOVDQU instruction to the active function. -// Operates on the global context. -func VMASKMOVDQU(x, x1 operand.Op) { ctx.VMASKMOVDQU(x, x1) } - -// VMASKMOVPD: Conditional Move Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMASKMOVPD m128 xmm xmm -// VMASKMOVPD m256 ymm ymm -// VMASKMOVPD xmm xmm m128 -// VMASKMOVPD ymm ymm m256 -// Construct and append a VMASKMOVPD instruction to the active function. -func (c *Context) VMASKMOVPD(mxy, xy, mxy1 operand.Op) { - if inst, err := x86.VMASKMOVPD(mxy, xy, mxy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMASKMOVPD: Conditional Move Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMASKMOVPD m128 xmm xmm -// VMASKMOVPD m256 ymm ymm -// VMASKMOVPD xmm xmm m128 -// VMASKMOVPD ymm ymm m256 -// Construct and append a VMASKMOVPD instruction to the active function. -// Operates on the global context. -func VMASKMOVPD(mxy, xy, mxy1 operand.Op) { ctx.VMASKMOVPD(mxy, xy, mxy1) } - -// VMASKMOVPS: Conditional Move Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMASKMOVPS m128 xmm xmm -// VMASKMOVPS m256 ymm ymm -// VMASKMOVPS xmm xmm m128 -// VMASKMOVPS ymm ymm m256 -// Construct and append a VMASKMOVPS instruction to the active function. -func (c *Context) VMASKMOVPS(mxy, xy, mxy1 operand.Op) { - if inst, err := x86.VMASKMOVPS(mxy, xy, mxy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMASKMOVPS: Conditional Move Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMASKMOVPS m128 xmm xmm -// VMASKMOVPS m256 ymm ymm -// VMASKMOVPS xmm xmm m128 -// VMASKMOVPS ymm ymm m256 -// Construct and append a VMASKMOVPS instruction to the active function. -// Operates on the global context. -func VMASKMOVPS(mxy, xy, mxy1 operand.Op) { ctx.VMASKMOVPS(mxy, xy, mxy1) } - -// VMAXPD: Return Maximum Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMAXPD xmm xmm xmm -// VMAXPD m128 xmm xmm -// VMAXPD ymm ymm ymm -// VMAXPD m256 ymm ymm -// Construct and append a VMAXPD instruction to the active function. -func (c *Context) VMAXPD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VMAXPD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMAXPD: Return Maximum Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMAXPD xmm xmm xmm -// VMAXPD m128 xmm xmm -// VMAXPD ymm ymm ymm -// VMAXPD m256 ymm ymm -// Construct and append a VMAXPD instruction to the active function. -// Operates on the global context. -func VMAXPD(mxy, xy, xy1 operand.Op) { ctx.VMAXPD(mxy, xy, xy1) } - -// VMAXPS: Return Maximum Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMAXPS xmm xmm xmm -// VMAXPS m128 xmm xmm -// VMAXPS ymm ymm ymm -// VMAXPS m256 ymm ymm -// Construct and append a VMAXPS instruction to the active function. -func (c *Context) VMAXPS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VMAXPS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMAXPS: Return Maximum Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMAXPS xmm xmm xmm -// VMAXPS m128 xmm xmm -// VMAXPS ymm ymm ymm -// VMAXPS m256 ymm ymm -// Construct and append a VMAXPS instruction to the active function. -// Operates on the global context. -func VMAXPS(mxy, xy, xy1 operand.Op) { ctx.VMAXPS(mxy, xy, xy1) } - -// VMAXSD: Return Maximum Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// VMAXSD xmm xmm xmm -// VMAXSD m64 xmm xmm -// Construct and append a VMAXSD instruction to the active function. -func (c *Context) VMAXSD(mx, x, x1 operand.Op) { - if inst, err := x86.VMAXSD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMAXSD: Return Maximum Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// VMAXSD xmm xmm xmm -// VMAXSD m64 xmm xmm -// Construct and append a VMAXSD instruction to the active function. -// Operates on the global context. -func VMAXSD(mx, x, x1 operand.Op) { ctx.VMAXSD(mx, x, x1) } - -// VMAXSS: Return Maximum Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// VMAXSS xmm xmm xmm -// VMAXSS m32 xmm xmm -// Construct and append a VMAXSS instruction to the active function. -func (c *Context) VMAXSS(mx, x, x1 operand.Op) { - if inst, err := x86.VMAXSS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMAXSS: Return Maximum Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// VMAXSS xmm xmm xmm -// VMAXSS m32 xmm xmm -// Construct and append a VMAXSS instruction to the active function. -// Operates on the global context. -func VMAXSS(mx, x, x1 operand.Op) { ctx.VMAXSS(mx, x, x1) } - -// VMINPD: Return Minimum Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMINPD xmm xmm xmm -// VMINPD m128 xmm xmm -// VMINPD ymm ymm ymm -// VMINPD m256 ymm ymm -// Construct and append a VMINPD instruction to the active function. -func (c *Context) VMINPD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VMINPD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMINPD: Return Minimum Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMINPD xmm xmm xmm -// VMINPD m128 xmm xmm -// VMINPD ymm ymm ymm -// VMINPD m256 ymm ymm -// Construct and append a VMINPD instruction to the active function. -// Operates on the global context. -func VMINPD(mxy, xy, xy1 operand.Op) { ctx.VMINPD(mxy, xy, xy1) } - -// VMINPS: Return Minimum Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMINPS xmm xmm xmm -// VMINPS m128 xmm xmm -// VMINPS ymm ymm ymm -// VMINPS m256 ymm ymm -// Construct and append a VMINPS instruction to the active function. -func (c *Context) VMINPS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VMINPS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMINPS: Return Minimum Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMINPS xmm xmm xmm -// VMINPS m128 xmm xmm -// VMINPS ymm ymm ymm -// VMINPS m256 ymm ymm -// Construct and append a VMINPS instruction to the active function. -// Operates on the global context. -func VMINPS(mxy, xy, xy1 operand.Op) { ctx.VMINPS(mxy, xy, xy1) } - -// VMINSD: Return Minimum Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// VMINSD xmm xmm xmm -// VMINSD m64 xmm xmm -// Construct and append a VMINSD instruction to the active function. -func (c *Context) VMINSD(mx, x, x1 operand.Op) { - if inst, err := x86.VMINSD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMINSD: Return Minimum Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// VMINSD xmm xmm xmm -// VMINSD m64 xmm xmm -// Construct and append a VMINSD instruction to the active function. -// Operates on the global context. -func VMINSD(mx, x, x1 operand.Op) { ctx.VMINSD(mx, x, x1) } - -// VMINSS: Return Minimum Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// VMINSS xmm xmm xmm -// VMINSS m32 xmm xmm -// Construct and append a VMINSS instruction to the active function. -func (c *Context) VMINSS(mx, x, x1 operand.Op) { - if inst, err := x86.VMINSS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMINSS: Return Minimum Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// VMINSS xmm xmm xmm -// VMINSS m32 xmm xmm -// Construct and append a VMINSS instruction to the active function. -// Operates on the global context. -func VMINSS(mx, x, x1 operand.Op) { ctx.VMINSS(mx, x, x1) } - -// VMOVAPD: Move Aligned Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMOVAPD xmm xmm -// VMOVAPD m128 xmm -// VMOVAPD ymm ymm -// VMOVAPD m256 ymm -// VMOVAPD xmm m128 -// VMOVAPD ymm m256 -// Construct and append a VMOVAPD instruction to the active function. -func (c *Context) VMOVAPD(mxy, mxy1 operand.Op) { - if inst, err := x86.VMOVAPD(mxy, mxy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVAPD: Move Aligned Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMOVAPD xmm xmm -// VMOVAPD m128 xmm -// VMOVAPD ymm ymm -// VMOVAPD m256 ymm -// VMOVAPD xmm m128 -// VMOVAPD ymm m256 -// Construct and append a VMOVAPD instruction to the active function. -// Operates on the global context. -func VMOVAPD(mxy, mxy1 operand.Op) { ctx.VMOVAPD(mxy, mxy1) } - -// VMOVAPS: Move Aligned Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMOVAPS xmm xmm -// VMOVAPS m128 xmm -// VMOVAPS ymm ymm -// VMOVAPS m256 ymm -// VMOVAPS xmm m128 -// VMOVAPS ymm m256 -// Construct and append a VMOVAPS instruction to the active function. -func (c *Context) VMOVAPS(mxy, mxy1 operand.Op) { - if inst, err := x86.VMOVAPS(mxy, mxy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVAPS: Move Aligned Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMOVAPS xmm xmm -// VMOVAPS m128 xmm -// VMOVAPS ymm ymm -// VMOVAPS m256 ymm -// VMOVAPS xmm m128 -// VMOVAPS ymm m256 -// Construct and append a VMOVAPS instruction to the active function. -// Operates on the global context. -func VMOVAPS(mxy, mxy1 operand.Op) { ctx.VMOVAPS(mxy, mxy1) } - -// VMOVD: Move Doubleword. -// -// Forms: -// -// VMOVD xmm r32 -// VMOVD r32 xmm -// VMOVD m32 xmm -// VMOVD xmm m32 -// Construct and append a VMOVD instruction to the active function. -func (c *Context) VMOVD(mrx, mrx1 operand.Op) { - if inst, err := x86.VMOVD(mrx, mrx1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVD: Move Doubleword. -// -// Forms: -// -// VMOVD xmm r32 -// VMOVD r32 xmm -// VMOVD m32 xmm -// VMOVD xmm m32 -// Construct and append a VMOVD instruction to the active function. -// Operates on the global context. -func VMOVD(mrx, mrx1 operand.Op) { ctx.VMOVD(mrx, mrx1) } - -// VMOVDDUP: Move One Double-FP and Duplicate. -// -// Forms: -// -// VMOVDDUP xmm xmm -// VMOVDDUP m64 xmm -// VMOVDDUP ymm ymm -// VMOVDDUP m256 ymm -// Construct and append a VMOVDDUP instruction to the active function. -func (c *Context) VMOVDDUP(mxy, xy operand.Op) { - if inst, err := x86.VMOVDDUP(mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVDDUP: Move One Double-FP and Duplicate. -// -// Forms: -// -// VMOVDDUP xmm xmm -// VMOVDDUP m64 xmm -// VMOVDDUP ymm ymm -// VMOVDDUP m256 ymm -// Construct and append a VMOVDDUP instruction to the active function. -// Operates on the global context. -func VMOVDDUP(mxy, xy operand.Op) { ctx.VMOVDDUP(mxy, xy) } - -// VMOVDQA: Move Aligned Double Quadword. -// -// Forms: -// -// VMOVDQA xmm xmm -// VMOVDQA m128 xmm -// VMOVDQA ymm ymm -// VMOVDQA m256 ymm -// VMOVDQA xmm m128 -// VMOVDQA ymm m256 -// Construct and append a VMOVDQA instruction to the active function. -func (c *Context) VMOVDQA(mxy, mxy1 operand.Op) { - if inst, err := x86.VMOVDQA(mxy, mxy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVDQA: Move Aligned Double Quadword. -// -// Forms: -// -// VMOVDQA xmm xmm -// VMOVDQA m128 xmm -// VMOVDQA ymm ymm -// VMOVDQA m256 ymm -// VMOVDQA xmm m128 -// VMOVDQA ymm m256 -// Construct and append a VMOVDQA instruction to the active function. -// Operates on the global context. -func VMOVDQA(mxy, mxy1 operand.Op) { ctx.VMOVDQA(mxy, mxy1) } - -// VMOVDQU: Move Unaligned Double Quadword. -// -// Forms: -// -// VMOVDQU xmm xmm -// VMOVDQU m128 xmm -// VMOVDQU ymm ymm -// VMOVDQU m256 ymm -// VMOVDQU xmm m128 -// VMOVDQU ymm m256 -// Construct and append a VMOVDQU instruction to the active function. -func (c *Context) VMOVDQU(mxy, mxy1 operand.Op) { - if inst, err := x86.VMOVDQU(mxy, mxy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVDQU: Move Unaligned Double Quadword. -// -// Forms: -// -// VMOVDQU xmm xmm -// VMOVDQU m128 xmm -// VMOVDQU ymm ymm -// VMOVDQU m256 ymm -// VMOVDQU xmm m128 -// VMOVDQU ymm m256 -// Construct and append a VMOVDQU instruction to the active function. -// Operates on the global context. -func VMOVDQU(mxy, mxy1 operand.Op) { ctx.VMOVDQU(mxy, mxy1) } - -// VMOVHLPS: Move Packed Single-Precision Floating-Point Values High to Low. -// -// Forms: -// -// VMOVHLPS xmm xmm xmm -// Construct and append a VMOVHLPS instruction to the active function. -func (c *Context) VMOVHLPS(x, x1, x2 operand.Op) { - if inst, err := x86.VMOVHLPS(x, x1, x2); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVHLPS: Move Packed Single-Precision Floating-Point Values High to Low. -// -// Forms: -// -// VMOVHLPS xmm xmm xmm -// Construct and append a VMOVHLPS instruction to the active function. -// Operates on the global context. -func VMOVHLPS(x, x1, x2 operand.Op) { ctx.VMOVHLPS(x, x1, x2) } - -// VMOVHPD: Move High Packed Double-Precision Floating-Point Value. -// -// Forms: -// -// VMOVHPD xmm m64 -// VMOVHPD m64 xmm xmm -// Construct and append a VMOVHPD instruction to the active function. -func (c *Context) VMOVHPD(ops ...operand.Op) { - if inst, err := x86.VMOVHPD(ops...); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVHPD: Move High Packed Double-Precision Floating-Point Value. -// -// Forms: -// -// VMOVHPD xmm m64 -// VMOVHPD m64 xmm xmm -// Construct and append a VMOVHPD instruction to the active function. -// Operates on the global context. -func VMOVHPD(ops ...operand.Op) { ctx.VMOVHPD(ops...) } - -// VMOVHPS: Move High Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMOVHPS xmm m64 -// VMOVHPS m64 xmm xmm -// Construct and append a VMOVHPS instruction to the active function. -func (c *Context) VMOVHPS(ops ...operand.Op) { - if inst, err := x86.VMOVHPS(ops...); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVHPS: Move High Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMOVHPS xmm m64 -// VMOVHPS m64 xmm xmm -// Construct and append a VMOVHPS instruction to the active function. -// Operates on the global context. -func VMOVHPS(ops ...operand.Op) { ctx.VMOVHPS(ops...) } - -// VMOVLHPS: Move Packed Single-Precision Floating-Point Values Low to High. -// -// Forms: -// -// VMOVLHPS xmm xmm xmm -// Construct and append a VMOVLHPS instruction to the active function. -func (c *Context) VMOVLHPS(x, x1, x2 operand.Op) { - if inst, err := x86.VMOVLHPS(x, x1, x2); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVLHPS: Move Packed Single-Precision Floating-Point Values Low to High. -// -// Forms: -// -// VMOVLHPS xmm xmm xmm -// Construct and append a VMOVLHPS instruction to the active function. -// Operates on the global context. -func VMOVLHPS(x, x1, x2 operand.Op) { ctx.VMOVLHPS(x, x1, x2) } - -// VMOVLPD: Move Low Packed Double-Precision Floating-Point Value. -// -// Forms: -// -// VMOVLPD xmm m64 -// VMOVLPD m64 xmm xmm -// Construct and append a VMOVLPD instruction to the active function. -func (c *Context) VMOVLPD(ops ...operand.Op) { - if inst, err := x86.VMOVLPD(ops...); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVLPD: Move Low Packed Double-Precision Floating-Point Value. -// -// Forms: -// -// VMOVLPD xmm m64 -// VMOVLPD m64 xmm xmm -// Construct and append a VMOVLPD instruction to the active function. -// Operates on the global context. -func VMOVLPD(ops ...operand.Op) { ctx.VMOVLPD(ops...) } - -// VMOVLPS: Move Low Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMOVLPS xmm m64 -// VMOVLPS m64 xmm xmm -// Construct and append a VMOVLPS instruction to the active function. -func (c *Context) VMOVLPS(ops ...operand.Op) { - if inst, err := x86.VMOVLPS(ops...); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVLPS: Move Low Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMOVLPS xmm m64 -// VMOVLPS m64 xmm xmm -// Construct and append a VMOVLPS instruction to the active function. -// Operates on the global context. -func VMOVLPS(ops ...operand.Op) { ctx.VMOVLPS(ops...) } - -// VMOVMSKPD: Extract Packed Double-Precision Floating-Point Sign Mask. -// -// Forms: -// -// VMOVMSKPD xmm r32 -// VMOVMSKPD ymm r32 -// Construct and append a VMOVMSKPD instruction to the active function. -func (c *Context) VMOVMSKPD(xy, r operand.Op) { - if inst, err := x86.VMOVMSKPD(xy, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVMSKPD: Extract Packed Double-Precision Floating-Point Sign Mask. -// -// Forms: -// -// VMOVMSKPD xmm r32 -// VMOVMSKPD ymm r32 -// Construct and append a VMOVMSKPD instruction to the active function. -// Operates on the global context. -func VMOVMSKPD(xy, r operand.Op) { ctx.VMOVMSKPD(xy, r) } - -// VMOVMSKPS: Extract Packed Single-Precision Floating-Point Sign Mask. -// -// Forms: -// -// VMOVMSKPS xmm r32 -// VMOVMSKPS ymm r32 -// Construct and append a VMOVMSKPS instruction to the active function. -func (c *Context) VMOVMSKPS(xy, r operand.Op) { - if inst, err := x86.VMOVMSKPS(xy, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVMSKPS: Extract Packed Single-Precision Floating-Point Sign Mask. -// -// Forms: -// -// VMOVMSKPS xmm r32 -// VMOVMSKPS ymm r32 -// Construct and append a VMOVMSKPS instruction to the active function. -// Operates on the global context. -func VMOVMSKPS(xy, r operand.Op) { ctx.VMOVMSKPS(xy, r) } - -// VMOVNTDQ: Store Double Quadword Using Non-Temporal Hint. -// -// Forms: -// -// VMOVNTDQ xmm m128 -// VMOVNTDQ ymm m256 -// Construct and append a VMOVNTDQ instruction to the active function. -func (c *Context) VMOVNTDQ(xy, m operand.Op) { - if inst, err := x86.VMOVNTDQ(xy, m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVNTDQ: Store Double Quadword Using Non-Temporal Hint. -// -// Forms: -// -// VMOVNTDQ xmm m128 -// VMOVNTDQ ymm m256 -// Construct and append a VMOVNTDQ instruction to the active function. -// Operates on the global context. -func VMOVNTDQ(xy, m operand.Op) { ctx.VMOVNTDQ(xy, m) } - -// VMOVNTDQA: Load Double Quadword Non-Temporal Aligned Hint. -// -// Forms: -// -// VMOVNTDQA m128 xmm -// VMOVNTDQA m256 ymm -// Construct and append a VMOVNTDQA instruction to the active function. -func (c *Context) VMOVNTDQA(m, xy operand.Op) { - if inst, err := x86.VMOVNTDQA(m, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVNTDQA: Load Double Quadword Non-Temporal Aligned Hint. -// -// Forms: -// -// VMOVNTDQA m128 xmm -// VMOVNTDQA m256 ymm -// Construct and append a VMOVNTDQA instruction to the active function. -// Operates on the global context. -func VMOVNTDQA(m, xy operand.Op) { ctx.VMOVNTDQA(m, xy) } - -// VMOVNTPD: Store Packed Double-Precision Floating-Point Values Using Non-Temporal Hint. -// -// Forms: -// -// VMOVNTPD xmm m128 -// VMOVNTPD ymm m256 -// Construct and append a VMOVNTPD instruction to the active function. -func (c *Context) VMOVNTPD(xy, m operand.Op) { - if inst, err := x86.VMOVNTPD(xy, m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVNTPD: Store Packed Double-Precision Floating-Point Values Using Non-Temporal Hint. -// -// Forms: -// -// VMOVNTPD xmm m128 -// VMOVNTPD ymm m256 -// Construct and append a VMOVNTPD instruction to the active function. -// Operates on the global context. -func VMOVNTPD(xy, m operand.Op) { ctx.VMOVNTPD(xy, m) } - -// VMOVNTPS: Store Packed Single-Precision Floating-Point Values Using Non-Temporal Hint. -// -// Forms: -// -// VMOVNTPS xmm m128 -// VMOVNTPS ymm m256 -// Construct and append a VMOVNTPS instruction to the active function. -func (c *Context) VMOVNTPS(xy, m operand.Op) { - if inst, err := x86.VMOVNTPS(xy, m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVNTPS: Store Packed Single-Precision Floating-Point Values Using Non-Temporal Hint. -// -// Forms: -// -// VMOVNTPS xmm m128 -// VMOVNTPS ymm m256 -// Construct and append a VMOVNTPS instruction to the active function. -// Operates on the global context. -func VMOVNTPS(xy, m operand.Op) { ctx.VMOVNTPS(xy, m) } - -// VMOVQ: Move Quadword. -// -// Forms: -// -// VMOVQ xmm r64 -// VMOVQ r64 xmm -// VMOVQ xmm xmm -// VMOVQ m64 xmm -// VMOVQ xmm m64 -// Construct and append a VMOVQ instruction to the active function. -func (c *Context) VMOVQ(mrx, mrx1 operand.Op) { - if inst, err := x86.VMOVQ(mrx, mrx1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVQ: Move Quadword. -// -// Forms: -// -// VMOVQ xmm r64 -// VMOVQ r64 xmm -// VMOVQ xmm xmm -// VMOVQ m64 xmm -// VMOVQ xmm m64 -// Construct and append a VMOVQ instruction to the active function. -// Operates on the global context. -func VMOVQ(mrx, mrx1 operand.Op) { ctx.VMOVQ(mrx, mrx1) } - -// VMOVSD: Move Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// VMOVSD m64 xmm -// VMOVSD xmm m64 -// VMOVSD xmm xmm xmm -// Construct and append a VMOVSD instruction to the active function. -func (c *Context) VMOVSD(ops ...operand.Op) { - if inst, err := x86.VMOVSD(ops...); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVSD: Move Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// VMOVSD m64 xmm -// VMOVSD xmm m64 -// VMOVSD xmm xmm xmm -// Construct and append a VMOVSD instruction to the active function. -// Operates on the global context. -func VMOVSD(ops ...operand.Op) { ctx.VMOVSD(ops...) } - -// VMOVSHDUP: Move Packed Single-FP High and Duplicate. -// -// Forms: -// -// VMOVSHDUP xmm xmm -// VMOVSHDUP m128 xmm -// VMOVSHDUP ymm ymm -// VMOVSHDUP m256 ymm -// Construct and append a VMOVSHDUP instruction to the active function. -func (c *Context) VMOVSHDUP(mxy, xy operand.Op) { - if inst, err := x86.VMOVSHDUP(mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVSHDUP: Move Packed Single-FP High and Duplicate. -// -// Forms: -// -// VMOVSHDUP xmm xmm -// VMOVSHDUP m128 xmm -// VMOVSHDUP ymm ymm -// VMOVSHDUP m256 ymm -// Construct and append a VMOVSHDUP instruction to the active function. -// Operates on the global context. -func VMOVSHDUP(mxy, xy operand.Op) { ctx.VMOVSHDUP(mxy, xy) } - -// VMOVSLDUP: Move Packed Single-FP Low and Duplicate. -// -// Forms: -// -// VMOVSLDUP xmm xmm -// VMOVSLDUP m128 xmm -// VMOVSLDUP ymm ymm -// VMOVSLDUP m256 ymm -// Construct and append a VMOVSLDUP instruction to the active function. -func (c *Context) VMOVSLDUP(mxy, xy operand.Op) { - if inst, err := x86.VMOVSLDUP(mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVSLDUP: Move Packed Single-FP Low and Duplicate. -// -// Forms: -// -// VMOVSLDUP xmm xmm -// VMOVSLDUP m128 xmm -// VMOVSLDUP ymm ymm -// VMOVSLDUP m256 ymm -// Construct and append a VMOVSLDUP instruction to the active function. -// Operates on the global context. -func VMOVSLDUP(mxy, xy operand.Op) { ctx.VMOVSLDUP(mxy, xy) } - -// VMOVSS: Move Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VMOVSS m32 xmm -// VMOVSS xmm m32 -// VMOVSS xmm xmm xmm -// Construct and append a VMOVSS instruction to the active function. -func (c *Context) VMOVSS(ops ...operand.Op) { - if inst, err := x86.VMOVSS(ops...); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVSS: Move Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VMOVSS m32 xmm -// VMOVSS xmm m32 -// VMOVSS xmm xmm xmm -// Construct and append a VMOVSS instruction to the active function. -// Operates on the global context. -func VMOVSS(ops ...operand.Op) { ctx.VMOVSS(ops...) } - -// VMOVUPD: Move Unaligned Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMOVUPD xmm xmm -// VMOVUPD m128 xmm -// VMOVUPD ymm ymm -// VMOVUPD m256 ymm -// VMOVUPD xmm m128 -// VMOVUPD ymm m256 -// Construct and append a VMOVUPD instruction to the active function. -func (c *Context) VMOVUPD(mxy, mxy1 operand.Op) { - if inst, err := x86.VMOVUPD(mxy, mxy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVUPD: Move Unaligned Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMOVUPD xmm xmm -// VMOVUPD m128 xmm -// VMOVUPD ymm ymm -// VMOVUPD m256 ymm -// VMOVUPD xmm m128 -// VMOVUPD ymm m256 -// Construct and append a VMOVUPD instruction to the active function. -// Operates on the global context. -func VMOVUPD(mxy, mxy1 operand.Op) { ctx.VMOVUPD(mxy, mxy1) } - -// VMOVUPS: Move Unaligned Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMOVUPS xmm xmm -// VMOVUPS m128 xmm -// VMOVUPS ymm ymm -// VMOVUPS m256 ymm -// VMOVUPS xmm m128 -// VMOVUPS ymm m256 -// Construct and append a VMOVUPS instruction to the active function. -func (c *Context) VMOVUPS(mxy, mxy1 operand.Op) { - if inst, err := x86.VMOVUPS(mxy, mxy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMOVUPS: Move Unaligned Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMOVUPS xmm xmm -// VMOVUPS m128 xmm -// VMOVUPS ymm ymm -// VMOVUPS m256 ymm -// VMOVUPS xmm m128 -// VMOVUPS ymm m256 -// Construct and append a VMOVUPS instruction to the active function. -// Operates on the global context. -func VMOVUPS(mxy, mxy1 operand.Op) { ctx.VMOVUPS(mxy, mxy1) } - -// VMPSADBW: Compute Multiple Packed Sums of Absolute Difference. -// -// Forms: -// -// VMPSADBW imm8 xmm xmm xmm -// VMPSADBW imm8 m128 xmm xmm -// VMPSADBW imm8 ymm ymm ymm -// VMPSADBW imm8 m256 ymm ymm -// Construct and append a VMPSADBW instruction to the active function. -func (c *Context) VMPSADBW(i, mxy, xy, xy1 operand.Op) { - if inst, err := x86.VMPSADBW(i, mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMPSADBW: Compute Multiple Packed Sums of Absolute Difference. -// -// Forms: -// -// VMPSADBW imm8 xmm xmm xmm -// VMPSADBW imm8 m128 xmm xmm -// VMPSADBW imm8 ymm ymm ymm -// VMPSADBW imm8 m256 ymm ymm -// Construct and append a VMPSADBW instruction to the active function. -// Operates on the global context. -func VMPSADBW(i, mxy, xy, xy1 operand.Op) { ctx.VMPSADBW(i, mxy, xy, xy1) } - -// VMULPD: Multiply Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMULPD xmm xmm xmm -// VMULPD m128 xmm xmm -// VMULPD ymm ymm ymm -// VMULPD m256 ymm ymm -// Construct and append a VMULPD instruction to the active function. -func (c *Context) VMULPD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VMULPD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMULPD: Multiply Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMULPD xmm xmm xmm -// VMULPD m128 xmm xmm -// VMULPD ymm ymm ymm -// VMULPD m256 ymm ymm -// Construct and append a VMULPD instruction to the active function. -// Operates on the global context. -func VMULPD(mxy, xy, xy1 operand.Op) { ctx.VMULPD(mxy, xy, xy1) } - -// VMULPS: Multiply Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMULPS xmm xmm xmm -// VMULPS m128 xmm xmm -// VMULPS ymm ymm ymm -// VMULPS m256 ymm ymm -// Construct and append a VMULPS instruction to the active function. -func (c *Context) VMULPS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VMULPS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMULPS: Multiply Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMULPS xmm xmm xmm -// VMULPS m128 xmm xmm -// VMULPS ymm ymm ymm -// VMULPS m256 ymm ymm -// Construct and append a VMULPS instruction to the active function. -// Operates on the global context. -func VMULPS(mxy, xy, xy1 operand.Op) { ctx.VMULPS(mxy, xy, xy1) } - -// VMULSD: Multiply Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VMULSD xmm xmm xmm -// VMULSD m64 xmm xmm -// Construct and append a VMULSD instruction to the active function. -func (c *Context) VMULSD(mx, x, x1 operand.Op) { - if inst, err := x86.VMULSD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMULSD: Multiply Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VMULSD xmm xmm xmm -// VMULSD m64 xmm xmm -// Construct and append a VMULSD instruction to the active function. -// Operates on the global context. -func VMULSD(mx, x, x1 operand.Op) { ctx.VMULSD(mx, x, x1) } - -// VMULSS: Multiply Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VMULSS xmm xmm xmm -// VMULSS m32 xmm xmm -// Construct and append a VMULSS instruction to the active function. -func (c *Context) VMULSS(mx, x, x1 operand.Op) { - if inst, err := x86.VMULSS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VMULSS: Multiply Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VMULSS xmm xmm xmm -// VMULSS m32 xmm xmm -// Construct and append a VMULSS instruction to the active function. -// Operates on the global context. -func VMULSS(mx, x, x1 operand.Op) { ctx.VMULSS(mx, x, x1) } - -// VORPD: Bitwise Logical OR of Double-Precision Floating-Point Values. -// -// Forms: -// -// VORPD xmm xmm xmm -// VORPD m128 xmm xmm -// VORPD ymm ymm ymm -// VORPD m256 ymm ymm -// Construct and append a VORPD instruction to the active function. -func (c *Context) VORPD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VORPD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VORPD: Bitwise Logical OR of Double-Precision Floating-Point Values. -// -// Forms: -// -// VORPD xmm xmm xmm -// VORPD m128 xmm xmm -// VORPD ymm ymm ymm -// VORPD m256 ymm ymm -// Construct and append a VORPD instruction to the active function. -// Operates on the global context. -func VORPD(mxy, xy, xy1 operand.Op) { ctx.VORPD(mxy, xy, xy1) } - -// VORPS: Bitwise Logical OR of Single-Precision Floating-Point Values. -// -// Forms: -// -// VORPS xmm xmm xmm -// VORPS m128 xmm xmm -// VORPS ymm ymm ymm -// VORPS m256 ymm ymm -// Construct and append a VORPS instruction to the active function. -func (c *Context) VORPS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VORPS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VORPS: Bitwise Logical OR of Single-Precision Floating-Point Values. -// -// Forms: -// -// VORPS xmm xmm xmm -// VORPS m128 xmm xmm -// VORPS ymm ymm ymm -// VORPS m256 ymm ymm -// Construct and append a VORPS instruction to the active function. -// Operates on the global context. -func VORPS(mxy, xy, xy1 operand.Op) { ctx.VORPS(mxy, xy, xy1) } - -// VPABSB: Packed Absolute Value of Byte Integers. -// -// Forms: -// -// VPABSB xmm xmm -// VPABSB m128 xmm -// VPABSB ymm ymm -// VPABSB m256 ymm -// Construct and append a VPABSB instruction to the active function. -func (c *Context) VPABSB(mxy, xy operand.Op) { - if inst, err := x86.VPABSB(mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPABSB: Packed Absolute Value of Byte Integers. -// -// Forms: -// -// VPABSB xmm xmm -// VPABSB m128 xmm -// VPABSB ymm ymm -// VPABSB m256 ymm -// Construct and append a VPABSB instruction to the active function. -// Operates on the global context. -func VPABSB(mxy, xy operand.Op) { ctx.VPABSB(mxy, xy) } - -// VPABSD: Packed Absolute Value of Doubleword Integers. -// -// Forms: -// -// VPABSD xmm xmm -// VPABSD m128 xmm -// VPABSD ymm ymm -// VPABSD m256 ymm -// Construct and append a VPABSD instruction to the active function. -func (c *Context) VPABSD(mxy, xy operand.Op) { - if inst, err := x86.VPABSD(mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPABSD: Packed Absolute Value of Doubleword Integers. -// -// Forms: -// -// VPABSD xmm xmm -// VPABSD m128 xmm -// VPABSD ymm ymm -// VPABSD m256 ymm -// Construct and append a VPABSD instruction to the active function. -// Operates on the global context. -func VPABSD(mxy, xy operand.Op) { ctx.VPABSD(mxy, xy) } - -// VPABSW: Packed Absolute Value of Word Integers. -// -// Forms: -// -// VPABSW xmm xmm -// VPABSW m128 xmm -// VPABSW ymm ymm -// VPABSW m256 ymm -// Construct and append a VPABSW instruction to the active function. -func (c *Context) VPABSW(mxy, xy operand.Op) { - if inst, err := x86.VPABSW(mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPABSW: Packed Absolute Value of Word Integers. -// -// Forms: -// -// VPABSW xmm xmm -// VPABSW m128 xmm -// VPABSW ymm ymm -// VPABSW m256 ymm -// Construct and append a VPABSW instruction to the active function. -// Operates on the global context. -func VPABSW(mxy, xy operand.Op) { ctx.VPABSW(mxy, xy) } - -// VPACKSSDW: Pack Doublewords into Words with Signed Saturation. -// -// Forms: -// -// VPACKSSDW xmm xmm xmm -// VPACKSSDW m128 xmm xmm -// VPACKSSDW ymm ymm ymm -// VPACKSSDW m256 ymm ymm -// Construct and append a VPACKSSDW instruction to the active function. -func (c *Context) VPACKSSDW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPACKSSDW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPACKSSDW: Pack Doublewords into Words with Signed Saturation. -// -// Forms: -// -// VPACKSSDW xmm xmm xmm -// VPACKSSDW m128 xmm xmm -// VPACKSSDW ymm ymm ymm -// VPACKSSDW m256 ymm ymm -// Construct and append a VPACKSSDW instruction to the active function. -// Operates on the global context. -func VPACKSSDW(mxy, xy, xy1 operand.Op) { ctx.VPACKSSDW(mxy, xy, xy1) } - -// VPACKSSWB: Pack Words into Bytes with Signed Saturation. -// -// Forms: -// -// VPACKSSWB xmm xmm xmm -// VPACKSSWB m128 xmm xmm -// VPACKSSWB ymm ymm ymm -// VPACKSSWB m256 ymm ymm -// Construct and append a VPACKSSWB instruction to the active function. -func (c *Context) VPACKSSWB(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPACKSSWB(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPACKSSWB: Pack Words into Bytes with Signed Saturation. -// -// Forms: -// -// VPACKSSWB xmm xmm xmm -// VPACKSSWB m128 xmm xmm -// VPACKSSWB ymm ymm ymm -// VPACKSSWB m256 ymm ymm -// Construct and append a VPACKSSWB instruction to the active function. -// Operates on the global context. -func VPACKSSWB(mxy, xy, xy1 operand.Op) { ctx.VPACKSSWB(mxy, xy, xy1) } - -// VPACKUSDW: Pack Doublewords into Words with Unsigned Saturation. -// -// Forms: -// -// VPACKUSDW xmm xmm xmm -// VPACKUSDW m128 xmm xmm -// VPACKUSDW ymm ymm ymm -// VPACKUSDW m256 ymm ymm -// Construct and append a VPACKUSDW instruction to the active function. -func (c *Context) VPACKUSDW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPACKUSDW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPACKUSDW: Pack Doublewords into Words with Unsigned Saturation. -// -// Forms: -// -// VPACKUSDW xmm xmm xmm -// VPACKUSDW m128 xmm xmm -// VPACKUSDW ymm ymm ymm -// VPACKUSDW m256 ymm ymm -// Construct and append a VPACKUSDW instruction to the active function. -// Operates on the global context. -func VPACKUSDW(mxy, xy, xy1 operand.Op) { ctx.VPACKUSDW(mxy, xy, xy1) } - -// VPACKUSWB: Pack Words into Bytes with Unsigned Saturation. -// -// Forms: -// -// VPACKUSWB xmm xmm xmm -// VPACKUSWB m128 xmm xmm -// VPACKUSWB ymm ymm ymm -// VPACKUSWB m256 ymm ymm -// Construct and append a VPACKUSWB instruction to the active function. -func (c *Context) VPACKUSWB(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPACKUSWB(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPACKUSWB: Pack Words into Bytes with Unsigned Saturation. -// -// Forms: -// -// VPACKUSWB xmm xmm xmm -// VPACKUSWB m128 xmm xmm -// VPACKUSWB ymm ymm ymm -// VPACKUSWB m256 ymm ymm -// Construct and append a VPACKUSWB instruction to the active function. -// Operates on the global context. -func VPACKUSWB(mxy, xy, xy1 operand.Op) { ctx.VPACKUSWB(mxy, xy, xy1) } - -// VPADDB: Add Packed Byte Integers. -// -// Forms: -// -// VPADDB xmm xmm xmm -// VPADDB m128 xmm xmm -// VPADDB ymm ymm ymm -// VPADDB m256 ymm ymm -// Construct and append a VPADDB instruction to the active function. -func (c *Context) VPADDB(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPADDB(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPADDB: Add Packed Byte Integers. -// -// Forms: -// -// VPADDB xmm xmm xmm -// VPADDB m128 xmm xmm -// VPADDB ymm ymm ymm -// VPADDB m256 ymm ymm -// Construct and append a VPADDB instruction to the active function. -// Operates on the global context. -func VPADDB(mxy, xy, xy1 operand.Op) { ctx.VPADDB(mxy, xy, xy1) } - -// VPADDD: Add Packed Doubleword Integers. -// -// Forms: -// -// VPADDD xmm xmm xmm -// VPADDD m128 xmm xmm -// VPADDD ymm ymm ymm -// VPADDD m256 ymm ymm -// Construct and append a VPADDD instruction to the active function. -func (c *Context) VPADDD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPADDD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPADDD: Add Packed Doubleword Integers. -// -// Forms: -// -// VPADDD xmm xmm xmm -// VPADDD m128 xmm xmm -// VPADDD ymm ymm ymm -// VPADDD m256 ymm ymm -// Construct and append a VPADDD instruction to the active function. -// Operates on the global context. -func VPADDD(mxy, xy, xy1 operand.Op) { ctx.VPADDD(mxy, xy, xy1) } - -// VPADDQ: Add Packed Quadword Integers. -// -// Forms: -// -// VPADDQ xmm xmm xmm -// VPADDQ m128 xmm xmm -// VPADDQ ymm ymm ymm -// VPADDQ m256 ymm ymm -// Construct and append a VPADDQ instruction to the active function. -func (c *Context) VPADDQ(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPADDQ(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPADDQ: Add Packed Quadword Integers. -// -// Forms: -// -// VPADDQ xmm xmm xmm -// VPADDQ m128 xmm xmm -// VPADDQ ymm ymm ymm -// VPADDQ m256 ymm ymm -// Construct and append a VPADDQ instruction to the active function. -// Operates on the global context. -func VPADDQ(mxy, xy, xy1 operand.Op) { ctx.VPADDQ(mxy, xy, xy1) } - -// VPADDSB: Add Packed Signed Byte Integers with Signed Saturation. -// -// Forms: -// -// VPADDSB xmm xmm xmm -// VPADDSB m128 xmm xmm -// VPADDSB ymm ymm ymm -// VPADDSB m256 ymm ymm -// Construct and append a VPADDSB instruction to the active function. -func (c *Context) VPADDSB(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPADDSB(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPADDSB: Add Packed Signed Byte Integers with Signed Saturation. -// -// Forms: -// -// VPADDSB xmm xmm xmm -// VPADDSB m128 xmm xmm -// VPADDSB ymm ymm ymm -// VPADDSB m256 ymm ymm -// Construct and append a VPADDSB instruction to the active function. -// Operates on the global context. -func VPADDSB(mxy, xy, xy1 operand.Op) { ctx.VPADDSB(mxy, xy, xy1) } - -// VPADDSW: Add Packed Signed Word Integers with Signed Saturation. -// -// Forms: -// -// VPADDSW xmm xmm xmm -// VPADDSW m128 xmm xmm -// VPADDSW ymm ymm ymm -// VPADDSW m256 ymm ymm -// Construct and append a VPADDSW instruction to the active function. -func (c *Context) VPADDSW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPADDSW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPADDSW: Add Packed Signed Word Integers with Signed Saturation. -// -// Forms: -// -// VPADDSW xmm xmm xmm -// VPADDSW m128 xmm xmm -// VPADDSW ymm ymm ymm -// VPADDSW m256 ymm ymm -// Construct and append a VPADDSW instruction to the active function. -// Operates on the global context. -func VPADDSW(mxy, xy, xy1 operand.Op) { ctx.VPADDSW(mxy, xy, xy1) } - -// VPADDUSB: Add Packed Unsigned Byte Integers with Unsigned Saturation. -// -// Forms: -// -// VPADDUSB xmm xmm xmm -// VPADDUSB m128 xmm xmm -// VPADDUSB ymm ymm ymm -// VPADDUSB m256 ymm ymm -// Construct and append a VPADDUSB instruction to the active function. -func (c *Context) VPADDUSB(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPADDUSB(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPADDUSB: Add Packed Unsigned Byte Integers with Unsigned Saturation. -// -// Forms: -// -// VPADDUSB xmm xmm xmm -// VPADDUSB m128 xmm xmm -// VPADDUSB ymm ymm ymm -// VPADDUSB m256 ymm ymm -// Construct and append a VPADDUSB instruction to the active function. -// Operates on the global context. -func VPADDUSB(mxy, xy, xy1 operand.Op) { ctx.VPADDUSB(mxy, xy, xy1) } - -// VPADDUSW: Add Packed Unsigned Word Integers with Unsigned Saturation. -// -// Forms: -// -// VPADDUSW xmm xmm xmm -// VPADDUSW m128 xmm xmm -// VPADDUSW ymm ymm ymm -// VPADDUSW m256 ymm ymm -// Construct and append a VPADDUSW instruction to the active function. -func (c *Context) VPADDUSW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPADDUSW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPADDUSW: Add Packed Unsigned Word Integers with Unsigned Saturation. -// -// Forms: -// -// VPADDUSW xmm xmm xmm -// VPADDUSW m128 xmm xmm -// VPADDUSW ymm ymm ymm -// VPADDUSW m256 ymm ymm -// Construct and append a VPADDUSW instruction to the active function. -// Operates on the global context. -func VPADDUSW(mxy, xy, xy1 operand.Op) { ctx.VPADDUSW(mxy, xy, xy1) } - -// VPADDW: Add Packed Word Integers. -// -// Forms: -// -// VPADDW xmm xmm xmm -// VPADDW m128 xmm xmm -// VPADDW ymm ymm ymm -// VPADDW m256 ymm ymm -// Construct and append a VPADDW instruction to the active function. -func (c *Context) VPADDW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPADDW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPADDW: Add Packed Word Integers. -// -// Forms: -// -// VPADDW xmm xmm xmm -// VPADDW m128 xmm xmm -// VPADDW ymm ymm ymm -// VPADDW m256 ymm ymm -// Construct and append a VPADDW instruction to the active function. -// Operates on the global context. -func VPADDW(mxy, xy, xy1 operand.Op) { ctx.VPADDW(mxy, xy, xy1) } - -// VPALIGNR: Packed Align Right. -// -// Forms: -// -// VPALIGNR imm8 xmm xmm xmm -// VPALIGNR imm8 m128 xmm xmm -// VPALIGNR imm8 ymm ymm ymm -// VPALIGNR imm8 m256 ymm ymm -// Construct and append a VPALIGNR instruction to the active function. -func (c *Context) VPALIGNR(i, mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPALIGNR(i, mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPALIGNR: Packed Align Right. -// -// Forms: -// -// VPALIGNR imm8 xmm xmm xmm -// VPALIGNR imm8 m128 xmm xmm -// VPALIGNR imm8 ymm ymm ymm -// VPALIGNR imm8 m256 ymm ymm -// Construct and append a VPALIGNR instruction to the active function. -// Operates on the global context. -func VPALIGNR(i, mxy, xy, xy1 operand.Op) { ctx.VPALIGNR(i, mxy, xy, xy1) } - -// VPAND: Packed Bitwise Logical AND. -// -// Forms: -// -// VPAND xmm xmm xmm -// VPAND m128 xmm xmm -// VPAND ymm ymm ymm -// VPAND m256 ymm ymm -// Construct and append a VPAND instruction to the active function. -func (c *Context) VPAND(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPAND(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPAND: Packed Bitwise Logical AND. -// -// Forms: -// -// VPAND xmm xmm xmm -// VPAND m128 xmm xmm -// VPAND ymm ymm ymm -// VPAND m256 ymm ymm -// Construct and append a VPAND instruction to the active function. -// Operates on the global context. -func VPAND(mxy, xy, xy1 operand.Op) { ctx.VPAND(mxy, xy, xy1) } - -// VPANDN: Packed Bitwise Logical AND NOT. -// -// Forms: -// -// VPANDN xmm xmm xmm -// VPANDN m128 xmm xmm -// VPANDN ymm ymm ymm -// VPANDN m256 ymm ymm -// Construct and append a VPANDN instruction to the active function. -func (c *Context) VPANDN(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPANDN(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPANDN: Packed Bitwise Logical AND NOT. -// -// Forms: -// -// VPANDN xmm xmm xmm -// VPANDN m128 xmm xmm -// VPANDN ymm ymm ymm -// VPANDN m256 ymm ymm -// Construct and append a VPANDN instruction to the active function. -// Operates on the global context. -func VPANDN(mxy, xy, xy1 operand.Op) { ctx.VPANDN(mxy, xy, xy1) } - -// VPAVGB: Average Packed Byte Integers. -// -// Forms: -// -// VPAVGB xmm xmm xmm -// VPAVGB m128 xmm xmm -// VPAVGB ymm ymm ymm -// VPAVGB m256 ymm ymm -// Construct and append a VPAVGB instruction to the active function. -func (c *Context) VPAVGB(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPAVGB(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPAVGB: Average Packed Byte Integers. -// -// Forms: -// -// VPAVGB xmm xmm xmm -// VPAVGB m128 xmm xmm -// VPAVGB ymm ymm ymm -// VPAVGB m256 ymm ymm -// Construct and append a VPAVGB instruction to the active function. -// Operates on the global context. -func VPAVGB(mxy, xy, xy1 operand.Op) { ctx.VPAVGB(mxy, xy, xy1) } - -// VPAVGW: Average Packed Word Integers. -// -// Forms: -// -// VPAVGW xmm xmm xmm -// VPAVGW m128 xmm xmm -// VPAVGW ymm ymm ymm -// VPAVGW m256 ymm ymm -// Construct and append a VPAVGW instruction to the active function. -func (c *Context) VPAVGW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPAVGW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPAVGW: Average Packed Word Integers. -// -// Forms: -// -// VPAVGW xmm xmm xmm -// VPAVGW m128 xmm xmm -// VPAVGW ymm ymm ymm -// VPAVGW m256 ymm ymm -// Construct and append a VPAVGW instruction to the active function. -// Operates on the global context. -func VPAVGW(mxy, xy, xy1 operand.Op) { ctx.VPAVGW(mxy, xy, xy1) } - -// VPBLENDD: Blend Packed Doublewords. -// -// Forms: -// -// VPBLENDD imm8 xmm xmm xmm -// VPBLENDD imm8 m128 xmm xmm -// VPBLENDD imm8 ymm ymm ymm -// VPBLENDD imm8 m256 ymm ymm -// Construct and append a VPBLENDD instruction to the active function. -func (c *Context) VPBLENDD(i, mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPBLENDD(i, mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPBLENDD: Blend Packed Doublewords. -// -// Forms: -// -// VPBLENDD imm8 xmm xmm xmm -// VPBLENDD imm8 m128 xmm xmm -// VPBLENDD imm8 ymm ymm ymm -// VPBLENDD imm8 m256 ymm ymm -// Construct and append a VPBLENDD instruction to the active function. -// Operates on the global context. -func VPBLENDD(i, mxy, xy, xy1 operand.Op) { ctx.VPBLENDD(i, mxy, xy, xy1) } - -// VPBLENDVB: Variable Blend Packed Bytes. -// -// Forms: -// -// VPBLENDVB xmm xmm xmm xmm -// VPBLENDVB xmm m128 xmm xmm -// VPBLENDVB ymm ymm ymm ymm -// VPBLENDVB ymm m256 ymm ymm -// Construct and append a VPBLENDVB instruction to the active function. -func (c *Context) VPBLENDVB(xy, mxy, xy1, xy2 operand.Op) { - if inst, err := x86.VPBLENDVB(xy, mxy, xy1, xy2); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPBLENDVB: Variable Blend Packed Bytes. -// -// Forms: -// -// VPBLENDVB xmm xmm xmm xmm -// VPBLENDVB xmm m128 xmm xmm -// VPBLENDVB ymm ymm ymm ymm -// VPBLENDVB ymm m256 ymm ymm -// Construct and append a VPBLENDVB instruction to the active function. -// Operates on the global context. -func VPBLENDVB(xy, mxy, xy1, xy2 operand.Op) { ctx.VPBLENDVB(xy, mxy, xy1, xy2) } - -// VPBLENDW: Blend Packed Words. -// -// Forms: -// -// VPBLENDW imm8 xmm xmm xmm -// VPBLENDW imm8 m128 xmm xmm -// VPBLENDW imm8 ymm ymm ymm -// VPBLENDW imm8 m256 ymm ymm -// Construct and append a VPBLENDW instruction to the active function. -func (c *Context) VPBLENDW(i, mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPBLENDW(i, mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPBLENDW: Blend Packed Words. -// -// Forms: -// -// VPBLENDW imm8 xmm xmm xmm -// VPBLENDW imm8 m128 xmm xmm -// VPBLENDW imm8 ymm ymm ymm -// VPBLENDW imm8 m256 ymm ymm -// Construct and append a VPBLENDW instruction to the active function. -// Operates on the global context. -func VPBLENDW(i, mxy, xy, xy1 operand.Op) { ctx.VPBLENDW(i, mxy, xy, xy1) } - -// VPBROADCASTB: Broadcast Byte Integer. -// -// Forms: -// -// VPBROADCASTB xmm xmm -// VPBROADCASTB m8 xmm -// VPBROADCASTB xmm ymm -// VPBROADCASTB m8 ymm -// Construct and append a VPBROADCASTB instruction to the active function. -func (c *Context) VPBROADCASTB(mx, xy operand.Op) { - if inst, err := x86.VPBROADCASTB(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPBROADCASTB: Broadcast Byte Integer. -// -// Forms: -// -// VPBROADCASTB xmm xmm -// VPBROADCASTB m8 xmm -// VPBROADCASTB xmm ymm -// VPBROADCASTB m8 ymm -// Construct and append a VPBROADCASTB instruction to the active function. -// Operates on the global context. -func VPBROADCASTB(mx, xy operand.Op) { ctx.VPBROADCASTB(mx, xy) } - -// VPBROADCASTD: Broadcast Doubleword Integer. -// -// Forms: -// -// VPBROADCASTD xmm xmm -// VPBROADCASTD m32 xmm -// VPBROADCASTD xmm ymm -// VPBROADCASTD m32 ymm -// Construct and append a VPBROADCASTD instruction to the active function. -func (c *Context) VPBROADCASTD(mx, xy operand.Op) { - if inst, err := x86.VPBROADCASTD(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPBROADCASTD: Broadcast Doubleword Integer. -// -// Forms: -// -// VPBROADCASTD xmm xmm -// VPBROADCASTD m32 xmm -// VPBROADCASTD xmm ymm -// VPBROADCASTD m32 ymm -// Construct and append a VPBROADCASTD instruction to the active function. -// Operates on the global context. -func VPBROADCASTD(mx, xy operand.Op) { ctx.VPBROADCASTD(mx, xy) } - -// VPBROADCASTQ: Broadcast Quadword Integer. -// -// Forms: -// -// VPBROADCASTQ xmm xmm -// VPBROADCASTQ m64 xmm -// VPBROADCASTQ xmm ymm -// VPBROADCASTQ m64 ymm -// Construct and append a VPBROADCASTQ instruction to the active function. -func (c *Context) VPBROADCASTQ(mx, xy operand.Op) { - if inst, err := x86.VPBROADCASTQ(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPBROADCASTQ: Broadcast Quadword Integer. -// -// Forms: -// -// VPBROADCASTQ xmm xmm -// VPBROADCASTQ m64 xmm -// VPBROADCASTQ xmm ymm -// VPBROADCASTQ m64 ymm -// Construct and append a VPBROADCASTQ instruction to the active function. -// Operates on the global context. -func VPBROADCASTQ(mx, xy operand.Op) { ctx.VPBROADCASTQ(mx, xy) } - -// VPBROADCASTW: Broadcast Word Integer. -// -// Forms: -// -// VPBROADCASTW xmm xmm -// VPBROADCASTW m16 xmm -// VPBROADCASTW xmm ymm -// VPBROADCASTW m16 ymm -// Construct and append a VPBROADCASTW instruction to the active function. -func (c *Context) VPBROADCASTW(mx, xy operand.Op) { - if inst, err := x86.VPBROADCASTW(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPBROADCASTW: Broadcast Word Integer. -// -// Forms: -// -// VPBROADCASTW xmm xmm -// VPBROADCASTW m16 xmm -// VPBROADCASTW xmm ymm -// VPBROADCASTW m16 ymm -// Construct and append a VPBROADCASTW instruction to the active function. -// Operates on the global context. -func VPBROADCASTW(mx, xy operand.Op) { ctx.VPBROADCASTW(mx, xy) } - -// VPCLMULQDQ: Carry-Less Quadword Multiplication. -// -// Forms: -// -// VPCLMULQDQ imm8 xmm xmm xmm -// VPCLMULQDQ imm8 m128 xmm xmm -// Construct and append a VPCLMULQDQ instruction to the active function. -func (c *Context) VPCLMULQDQ(i, mx, x, x1 operand.Op) { - if inst, err := x86.VPCLMULQDQ(i, mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPCLMULQDQ: Carry-Less Quadword Multiplication. -// -// Forms: -// -// VPCLMULQDQ imm8 xmm xmm xmm -// VPCLMULQDQ imm8 m128 xmm xmm -// Construct and append a VPCLMULQDQ instruction to the active function. -// Operates on the global context. -func VPCLMULQDQ(i, mx, x, x1 operand.Op) { ctx.VPCLMULQDQ(i, mx, x, x1) } - -// VPCMPEQB: Compare Packed Byte Data for Equality. -// -// Forms: -// -// VPCMPEQB xmm xmm xmm -// VPCMPEQB m128 xmm xmm -// VPCMPEQB ymm ymm ymm -// VPCMPEQB m256 ymm ymm -// Construct and append a VPCMPEQB instruction to the active function. -func (c *Context) VPCMPEQB(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPCMPEQB(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPCMPEQB: Compare Packed Byte Data for Equality. -// -// Forms: -// -// VPCMPEQB xmm xmm xmm -// VPCMPEQB m128 xmm xmm -// VPCMPEQB ymm ymm ymm -// VPCMPEQB m256 ymm ymm -// Construct and append a VPCMPEQB instruction to the active function. -// Operates on the global context. -func VPCMPEQB(mxy, xy, xy1 operand.Op) { ctx.VPCMPEQB(mxy, xy, xy1) } - -// VPCMPEQD: Compare Packed Doubleword Data for Equality. -// -// Forms: -// -// VPCMPEQD xmm xmm xmm -// VPCMPEQD m128 xmm xmm -// VPCMPEQD ymm ymm ymm -// VPCMPEQD m256 ymm ymm -// Construct and append a VPCMPEQD instruction to the active function. -func (c *Context) VPCMPEQD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPCMPEQD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPCMPEQD: Compare Packed Doubleword Data for Equality. -// -// Forms: -// -// VPCMPEQD xmm xmm xmm -// VPCMPEQD m128 xmm xmm -// VPCMPEQD ymm ymm ymm -// VPCMPEQD m256 ymm ymm -// Construct and append a VPCMPEQD instruction to the active function. -// Operates on the global context. -func VPCMPEQD(mxy, xy, xy1 operand.Op) { ctx.VPCMPEQD(mxy, xy, xy1) } - -// VPCMPEQQ: Compare Packed Quadword Data for Equality. -// -// Forms: -// -// VPCMPEQQ xmm xmm xmm -// VPCMPEQQ m128 xmm xmm -// VPCMPEQQ ymm ymm ymm -// VPCMPEQQ m256 ymm ymm -// Construct and append a VPCMPEQQ instruction to the active function. -func (c *Context) VPCMPEQQ(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPCMPEQQ(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPCMPEQQ: Compare Packed Quadword Data for Equality. -// -// Forms: -// -// VPCMPEQQ xmm xmm xmm -// VPCMPEQQ m128 xmm xmm -// VPCMPEQQ ymm ymm ymm -// VPCMPEQQ m256 ymm ymm -// Construct and append a VPCMPEQQ instruction to the active function. -// Operates on the global context. -func VPCMPEQQ(mxy, xy, xy1 operand.Op) { ctx.VPCMPEQQ(mxy, xy, xy1) } - -// VPCMPEQW: Compare Packed Word Data for Equality. -// -// Forms: -// -// VPCMPEQW xmm xmm xmm -// VPCMPEQW m128 xmm xmm -// VPCMPEQW ymm ymm ymm -// VPCMPEQW m256 ymm ymm -// Construct and append a VPCMPEQW instruction to the active function. -func (c *Context) VPCMPEQW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPCMPEQW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPCMPEQW: Compare Packed Word Data for Equality. -// -// Forms: -// -// VPCMPEQW xmm xmm xmm -// VPCMPEQW m128 xmm xmm -// VPCMPEQW ymm ymm ymm -// VPCMPEQW m256 ymm ymm -// Construct and append a VPCMPEQW instruction to the active function. -// Operates on the global context. -func VPCMPEQW(mxy, xy, xy1 operand.Op) { ctx.VPCMPEQW(mxy, xy, xy1) } - -// VPCMPESTRI: Packed Compare Explicit Length Strings, Return Index. -// -// Forms: -// -// VPCMPESTRI imm8 xmm xmm -// VPCMPESTRI imm8 m128 xmm -// Construct and append a VPCMPESTRI instruction to the active function. -func (c *Context) VPCMPESTRI(i, mx, x operand.Op) { - if inst, err := x86.VPCMPESTRI(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPCMPESTRI: Packed Compare Explicit Length Strings, Return Index. -// -// Forms: -// -// VPCMPESTRI imm8 xmm xmm -// VPCMPESTRI imm8 m128 xmm -// Construct and append a VPCMPESTRI instruction to the active function. -// Operates on the global context. -func VPCMPESTRI(i, mx, x operand.Op) { ctx.VPCMPESTRI(i, mx, x) } - -// VPCMPESTRM: Packed Compare Explicit Length Strings, Return Mask. -// -// Forms: -// -// VPCMPESTRM imm8 xmm xmm -// VPCMPESTRM imm8 m128 xmm -// Construct and append a VPCMPESTRM instruction to the active function. -func (c *Context) VPCMPESTRM(i, mx, x operand.Op) { - if inst, err := x86.VPCMPESTRM(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPCMPESTRM: Packed Compare Explicit Length Strings, Return Mask. -// -// Forms: -// -// VPCMPESTRM imm8 xmm xmm -// VPCMPESTRM imm8 m128 xmm -// Construct and append a VPCMPESTRM instruction to the active function. -// Operates on the global context. -func VPCMPESTRM(i, mx, x operand.Op) { ctx.VPCMPESTRM(i, mx, x) } - -// VPCMPGTB: Compare Packed Signed Byte Integers for Greater Than. -// -// Forms: -// -// VPCMPGTB xmm xmm xmm -// VPCMPGTB m128 xmm xmm -// VPCMPGTB ymm ymm ymm -// VPCMPGTB m256 ymm ymm -// Construct and append a VPCMPGTB instruction to the active function. -func (c *Context) VPCMPGTB(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPCMPGTB(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPCMPGTB: Compare Packed Signed Byte Integers for Greater Than. -// -// Forms: -// -// VPCMPGTB xmm xmm xmm -// VPCMPGTB m128 xmm xmm -// VPCMPGTB ymm ymm ymm -// VPCMPGTB m256 ymm ymm -// Construct and append a VPCMPGTB instruction to the active function. -// Operates on the global context. -func VPCMPGTB(mxy, xy, xy1 operand.Op) { ctx.VPCMPGTB(mxy, xy, xy1) } - -// VPCMPGTD: Compare Packed Signed Doubleword Integers for Greater Than. -// -// Forms: -// -// VPCMPGTD xmm xmm xmm -// VPCMPGTD m128 xmm xmm -// VPCMPGTD ymm ymm ymm -// VPCMPGTD m256 ymm ymm -// Construct and append a VPCMPGTD instruction to the active function. -func (c *Context) VPCMPGTD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPCMPGTD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPCMPGTD: Compare Packed Signed Doubleword Integers for Greater Than. -// -// Forms: -// -// VPCMPGTD xmm xmm xmm -// VPCMPGTD m128 xmm xmm -// VPCMPGTD ymm ymm ymm -// VPCMPGTD m256 ymm ymm -// Construct and append a VPCMPGTD instruction to the active function. -// Operates on the global context. -func VPCMPGTD(mxy, xy, xy1 operand.Op) { ctx.VPCMPGTD(mxy, xy, xy1) } - -// VPCMPGTQ: Compare Packed Data for Greater Than. -// -// Forms: -// -// VPCMPGTQ xmm xmm xmm -// VPCMPGTQ m128 xmm xmm -// VPCMPGTQ ymm ymm ymm -// VPCMPGTQ m256 ymm ymm -// Construct and append a VPCMPGTQ instruction to the active function. -func (c *Context) VPCMPGTQ(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPCMPGTQ(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPCMPGTQ: Compare Packed Data for Greater Than. -// -// Forms: -// -// VPCMPGTQ xmm xmm xmm -// VPCMPGTQ m128 xmm xmm -// VPCMPGTQ ymm ymm ymm -// VPCMPGTQ m256 ymm ymm -// Construct and append a VPCMPGTQ instruction to the active function. -// Operates on the global context. -func VPCMPGTQ(mxy, xy, xy1 operand.Op) { ctx.VPCMPGTQ(mxy, xy, xy1) } - -// VPCMPGTW: Compare Packed Signed Word Integers for Greater Than. -// -// Forms: -// -// VPCMPGTW xmm xmm xmm -// VPCMPGTW m128 xmm xmm -// VPCMPGTW ymm ymm ymm -// VPCMPGTW m256 ymm ymm -// Construct and append a VPCMPGTW instruction to the active function. -func (c *Context) VPCMPGTW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPCMPGTW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPCMPGTW: Compare Packed Signed Word Integers for Greater Than. -// -// Forms: -// -// VPCMPGTW xmm xmm xmm -// VPCMPGTW m128 xmm xmm -// VPCMPGTW ymm ymm ymm -// VPCMPGTW m256 ymm ymm -// Construct and append a VPCMPGTW instruction to the active function. -// Operates on the global context. -func VPCMPGTW(mxy, xy, xy1 operand.Op) { ctx.VPCMPGTW(mxy, xy, xy1) } - -// VPCMPISTRI: Packed Compare Implicit Length Strings, Return Index. -// -// Forms: -// -// VPCMPISTRI imm8 xmm xmm -// VPCMPISTRI imm8 m128 xmm -// Construct and append a VPCMPISTRI instruction to the active function. -func (c *Context) VPCMPISTRI(i, mx, x operand.Op) { - if inst, err := x86.VPCMPISTRI(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPCMPISTRI: Packed Compare Implicit Length Strings, Return Index. -// -// Forms: -// -// VPCMPISTRI imm8 xmm xmm -// VPCMPISTRI imm8 m128 xmm -// Construct and append a VPCMPISTRI instruction to the active function. -// Operates on the global context. -func VPCMPISTRI(i, mx, x operand.Op) { ctx.VPCMPISTRI(i, mx, x) } - -// VPCMPISTRM: Packed Compare Implicit Length Strings, Return Mask. -// -// Forms: -// -// VPCMPISTRM imm8 xmm xmm -// VPCMPISTRM imm8 m128 xmm -// Construct and append a VPCMPISTRM instruction to the active function. -func (c *Context) VPCMPISTRM(i, mx, x operand.Op) { - if inst, err := x86.VPCMPISTRM(i, mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPCMPISTRM: Packed Compare Implicit Length Strings, Return Mask. -// -// Forms: -// -// VPCMPISTRM imm8 xmm xmm -// VPCMPISTRM imm8 m128 xmm -// Construct and append a VPCMPISTRM instruction to the active function. -// Operates on the global context. -func VPCMPISTRM(i, mx, x operand.Op) { ctx.VPCMPISTRM(i, mx, x) } - -// VPERM2F128: Permute Floating-Point Values. -// -// Forms: -// -// VPERM2F128 imm8 ymm ymm ymm -// VPERM2F128 imm8 m256 ymm ymm -// Construct and append a VPERM2F128 instruction to the active function. -func (c *Context) VPERM2F128(i, my, y, y1 operand.Op) { - if inst, err := x86.VPERM2F128(i, my, y, y1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPERM2F128: Permute Floating-Point Values. -// -// Forms: -// -// VPERM2F128 imm8 ymm ymm ymm -// VPERM2F128 imm8 m256 ymm ymm -// Construct and append a VPERM2F128 instruction to the active function. -// Operates on the global context. -func VPERM2F128(i, my, y, y1 operand.Op) { ctx.VPERM2F128(i, my, y, y1) } - -// VPERM2I128: Permute 128-Bit Integer Values. -// -// Forms: -// -// VPERM2I128 imm8 ymm ymm ymm -// VPERM2I128 imm8 m256 ymm ymm -// Construct and append a VPERM2I128 instruction to the active function. -func (c *Context) VPERM2I128(i, my, y, y1 operand.Op) { - if inst, err := x86.VPERM2I128(i, my, y, y1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPERM2I128: Permute 128-Bit Integer Values. -// -// Forms: -// -// VPERM2I128 imm8 ymm ymm ymm -// VPERM2I128 imm8 m256 ymm ymm -// Construct and append a VPERM2I128 instruction to the active function. -// Operates on the global context. -func VPERM2I128(i, my, y, y1 operand.Op) { ctx.VPERM2I128(i, my, y, y1) } - -// VPERMD: Permute Doubleword Integers. -// -// Forms: -// -// VPERMD ymm ymm ymm -// VPERMD m256 ymm ymm -// Construct and append a VPERMD instruction to the active function. -func (c *Context) VPERMD(my, y, y1 operand.Op) { - if inst, err := x86.VPERMD(my, y, y1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPERMD: Permute Doubleword Integers. -// -// Forms: -// -// VPERMD ymm ymm ymm -// VPERMD m256 ymm ymm -// Construct and append a VPERMD instruction to the active function. -// Operates on the global context. -func VPERMD(my, y, y1 operand.Op) { ctx.VPERMD(my, y, y1) } - -// VPERMILPD: Permute Double-Precision Floating-Point Values. -// -// Forms: -// -// VPERMILPD imm8 xmm xmm -// VPERMILPD xmm xmm xmm -// VPERMILPD m128 xmm xmm -// VPERMILPD imm8 m128 xmm -// VPERMILPD imm8 ymm ymm -// VPERMILPD ymm ymm ymm -// VPERMILPD m256 ymm ymm -// VPERMILPD imm8 m256 ymm -// Construct and append a VPERMILPD instruction to the active function. -func (c *Context) VPERMILPD(imxy, mxy, xy operand.Op) { - if inst, err := x86.VPERMILPD(imxy, mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPERMILPD: Permute Double-Precision Floating-Point Values. -// -// Forms: -// -// VPERMILPD imm8 xmm xmm -// VPERMILPD xmm xmm xmm -// VPERMILPD m128 xmm xmm -// VPERMILPD imm8 m128 xmm -// VPERMILPD imm8 ymm ymm -// VPERMILPD ymm ymm ymm -// VPERMILPD m256 ymm ymm -// VPERMILPD imm8 m256 ymm -// Construct and append a VPERMILPD instruction to the active function. -// Operates on the global context. -func VPERMILPD(imxy, mxy, xy operand.Op) { ctx.VPERMILPD(imxy, mxy, xy) } - -// VPERMILPS: Permute Single-Precision Floating-Point Values. -// -// Forms: -// -// VPERMILPS imm8 xmm xmm -// VPERMILPS xmm xmm xmm -// VPERMILPS m128 xmm xmm -// VPERMILPS imm8 m128 xmm -// VPERMILPS imm8 ymm ymm -// VPERMILPS ymm ymm ymm -// VPERMILPS m256 ymm ymm -// VPERMILPS imm8 m256 ymm -// Construct and append a VPERMILPS instruction to the active function. -func (c *Context) VPERMILPS(imxy, mxy, xy operand.Op) { - if inst, err := x86.VPERMILPS(imxy, mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPERMILPS: Permute Single-Precision Floating-Point Values. -// -// Forms: -// -// VPERMILPS imm8 xmm xmm -// VPERMILPS xmm xmm xmm -// VPERMILPS m128 xmm xmm -// VPERMILPS imm8 m128 xmm -// VPERMILPS imm8 ymm ymm -// VPERMILPS ymm ymm ymm -// VPERMILPS m256 ymm ymm -// VPERMILPS imm8 m256 ymm -// Construct and append a VPERMILPS instruction to the active function. -// Operates on the global context. -func VPERMILPS(imxy, mxy, xy operand.Op) { ctx.VPERMILPS(imxy, mxy, xy) } - -// VPERMPD: Permute Double-Precision Floating-Point Elements. -// -// Forms: -// -// VPERMPD imm8 ymm ymm -// VPERMPD imm8 m256 ymm -// Construct and append a VPERMPD instruction to the active function. -func (c *Context) VPERMPD(i, my, y operand.Op) { - if inst, err := x86.VPERMPD(i, my, y); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPERMPD: Permute Double-Precision Floating-Point Elements. -// -// Forms: -// -// VPERMPD imm8 ymm ymm -// VPERMPD imm8 m256 ymm -// Construct and append a VPERMPD instruction to the active function. -// Operates on the global context. -func VPERMPD(i, my, y operand.Op) { ctx.VPERMPD(i, my, y) } - -// VPERMPS: Permute Single-Precision Floating-Point Elements. -// -// Forms: -// -// VPERMPS ymm ymm ymm -// VPERMPS m256 ymm ymm -// Construct and append a VPERMPS instruction to the active function. -func (c *Context) VPERMPS(my, y, y1 operand.Op) { - if inst, err := x86.VPERMPS(my, y, y1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPERMPS: Permute Single-Precision Floating-Point Elements. -// -// Forms: -// -// VPERMPS ymm ymm ymm -// VPERMPS m256 ymm ymm -// Construct and append a VPERMPS instruction to the active function. -// Operates on the global context. -func VPERMPS(my, y, y1 operand.Op) { ctx.VPERMPS(my, y, y1) } - -// VPERMQ: Permute Quadword Integers. -// -// Forms: -// -// VPERMQ imm8 ymm ymm -// VPERMQ imm8 m256 ymm -// Construct and append a VPERMQ instruction to the active function. -func (c *Context) VPERMQ(i, my, y operand.Op) { - if inst, err := x86.VPERMQ(i, my, y); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPERMQ: Permute Quadword Integers. -// -// Forms: -// -// VPERMQ imm8 ymm ymm -// VPERMQ imm8 m256 ymm -// Construct and append a VPERMQ instruction to the active function. -// Operates on the global context. -func VPERMQ(i, my, y operand.Op) { ctx.VPERMQ(i, my, y) } - -// VPEXTRB: Extract Byte. -// -// Forms: -// -// VPEXTRB imm8 xmm r32 -// VPEXTRB imm8 xmm m8 -// Construct and append a VPEXTRB instruction to the active function. -func (c *Context) VPEXTRB(i, x, mr operand.Op) { - if inst, err := x86.VPEXTRB(i, x, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPEXTRB: Extract Byte. -// -// Forms: -// -// VPEXTRB imm8 xmm r32 -// VPEXTRB imm8 xmm m8 -// Construct and append a VPEXTRB instruction to the active function. -// Operates on the global context. -func VPEXTRB(i, x, mr operand.Op) { ctx.VPEXTRB(i, x, mr) } - -// VPEXTRD: Extract Doubleword. -// -// Forms: -// -// VPEXTRD imm8 xmm r32 -// VPEXTRD imm8 xmm m32 -// Construct and append a VPEXTRD instruction to the active function. -func (c *Context) VPEXTRD(i, x, mr operand.Op) { - if inst, err := x86.VPEXTRD(i, x, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPEXTRD: Extract Doubleword. -// -// Forms: -// -// VPEXTRD imm8 xmm r32 -// VPEXTRD imm8 xmm m32 -// Construct and append a VPEXTRD instruction to the active function. -// Operates on the global context. -func VPEXTRD(i, x, mr operand.Op) { ctx.VPEXTRD(i, x, mr) } - -// VPEXTRQ: Extract Quadword. -// -// Forms: -// -// VPEXTRQ imm8 xmm r64 -// VPEXTRQ imm8 xmm m64 -// Construct and append a VPEXTRQ instruction to the active function. -func (c *Context) VPEXTRQ(i, x, mr operand.Op) { - if inst, err := x86.VPEXTRQ(i, x, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPEXTRQ: Extract Quadword. -// -// Forms: -// -// VPEXTRQ imm8 xmm r64 -// VPEXTRQ imm8 xmm m64 -// Construct and append a VPEXTRQ instruction to the active function. -// Operates on the global context. -func VPEXTRQ(i, x, mr operand.Op) { ctx.VPEXTRQ(i, x, mr) } - -// VPEXTRW: Extract Word. -// -// Forms: -// -// VPEXTRW imm8 xmm r32 -// VPEXTRW imm8 xmm m16 -// Construct and append a VPEXTRW instruction to the active function. -func (c *Context) VPEXTRW(i, x, mr operand.Op) { - if inst, err := x86.VPEXTRW(i, x, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPEXTRW: Extract Word. -// -// Forms: -// -// VPEXTRW imm8 xmm r32 -// VPEXTRW imm8 xmm m16 -// Construct and append a VPEXTRW instruction to the active function. -// Operates on the global context. -func VPEXTRW(i, x, mr operand.Op) { ctx.VPEXTRW(i, x, mr) } - -// VPGATHERDD: Gather Packed Doubleword Values Using Signed Doubleword Indices. -// -// Forms: -// -// VPGATHERDD xmm vm32x xmm -// VPGATHERDD ymm vm32y ymm -// Construct and append a VPGATHERDD instruction to the active function. -func (c *Context) VPGATHERDD(xy, v, xy1 operand.Op) { - if inst, err := x86.VPGATHERDD(xy, v, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPGATHERDD: Gather Packed Doubleword Values Using Signed Doubleword Indices. -// -// Forms: -// -// VPGATHERDD xmm vm32x xmm -// VPGATHERDD ymm vm32y ymm -// Construct and append a VPGATHERDD instruction to the active function. -// Operates on the global context. -func VPGATHERDD(xy, v, xy1 operand.Op) { ctx.VPGATHERDD(xy, v, xy1) } - -// VPGATHERDQ: Gather Packed Quadword Values Using Signed Doubleword Indices. -// -// Forms: -// -// VPGATHERDQ xmm vm32x xmm -// VPGATHERDQ ymm vm32x ymm -// Construct and append a VPGATHERDQ instruction to the active function. -func (c *Context) VPGATHERDQ(xy, v, xy1 operand.Op) { - if inst, err := x86.VPGATHERDQ(xy, v, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPGATHERDQ: Gather Packed Quadword Values Using Signed Doubleword Indices. -// -// Forms: -// -// VPGATHERDQ xmm vm32x xmm -// VPGATHERDQ ymm vm32x ymm -// Construct and append a VPGATHERDQ instruction to the active function. -// Operates on the global context. -func VPGATHERDQ(xy, v, xy1 operand.Op) { ctx.VPGATHERDQ(xy, v, xy1) } - -// VPGATHERQD: Gather Packed Doubleword Values Using Signed Quadword Indices. -// -// Forms: -// -// VPGATHERQD xmm vm64x xmm -// VPGATHERQD xmm vm64y xmm -// Construct and append a VPGATHERQD instruction to the active function. -func (c *Context) VPGATHERQD(x, v, x1 operand.Op) { - if inst, err := x86.VPGATHERQD(x, v, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPGATHERQD: Gather Packed Doubleword Values Using Signed Quadword Indices. -// -// Forms: -// -// VPGATHERQD xmm vm64x xmm -// VPGATHERQD xmm vm64y xmm -// Construct and append a VPGATHERQD instruction to the active function. -// Operates on the global context. -func VPGATHERQD(x, v, x1 operand.Op) { ctx.VPGATHERQD(x, v, x1) } - -// VPGATHERQQ: Gather Packed Quadword Values Using Signed Quadword Indices. -// -// Forms: -// -// VPGATHERQQ xmm vm64x xmm -// VPGATHERQQ ymm vm64y ymm -// Construct and append a VPGATHERQQ instruction to the active function. -func (c *Context) VPGATHERQQ(xy, v, xy1 operand.Op) { - if inst, err := x86.VPGATHERQQ(xy, v, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPGATHERQQ: Gather Packed Quadword Values Using Signed Quadword Indices. -// -// Forms: -// -// VPGATHERQQ xmm vm64x xmm -// VPGATHERQQ ymm vm64y ymm -// Construct and append a VPGATHERQQ instruction to the active function. -// Operates on the global context. -func VPGATHERQQ(xy, v, xy1 operand.Op) { ctx.VPGATHERQQ(xy, v, xy1) } - -// VPHADDD: Packed Horizontal Add Doubleword Integer. -// -// Forms: -// -// VPHADDD xmm xmm xmm -// VPHADDD m128 xmm xmm -// VPHADDD ymm ymm ymm -// VPHADDD m256 ymm ymm -// Construct and append a VPHADDD instruction to the active function. -func (c *Context) VPHADDD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPHADDD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPHADDD: Packed Horizontal Add Doubleword Integer. -// -// Forms: -// -// VPHADDD xmm xmm xmm -// VPHADDD m128 xmm xmm -// VPHADDD ymm ymm ymm -// VPHADDD m256 ymm ymm -// Construct and append a VPHADDD instruction to the active function. -// Operates on the global context. -func VPHADDD(mxy, xy, xy1 operand.Op) { ctx.VPHADDD(mxy, xy, xy1) } - -// VPHADDSW: Packed Horizontal Add Signed Word Integers with Signed Saturation. -// -// Forms: -// -// VPHADDSW xmm xmm xmm -// VPHADDSW m128 xmm xmm -// VPHADDSW ymm ymm ymm -// VPHADDSW m256 ymm ymm -// Construct and append a VPHADDSW instruction to the active function. -func (c *Context) VPHADDSW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPHADDSW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPHADDSW: Packed Horizontal Add Signed Word Integers with Signed Saturation. -// -// Forms: -// -// VPHADDSW xmm xmm xmm -// VPHADDSW m128 xmm xmm -// VPHADDSW ymm ymm ymm -// VPHADDSW m256 ymm ymm -// Construct and append a VPHADDSW instruction to the active function. -// Operates on the global context. -func VPHADDSW(mxy, xy, xy1 operand.Op) { ctx.VPHADDSW(mxy, xy, xy1) } - -// VPHADDW: Packed Horizontal Add Word Integers. -// -// Forms: -// -// VPHADDW xmm xmm xmm -// VPHADDW m128 xmm xmm -// VPHADDW ymm ymm ymm -// VPHADDW m256 ymm ymm -// Construct and append a VPHADDW instruction to the active function. -func (c *Context) VPHADDW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPHADDW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPHADDW: Packed Horizontal Add Word Integers. -// -// Forms: -// -// VPHADDW xmm xmm xmm -// VPHADDW m128 xmm xmm -// VPHADDW ymm ymm ymm -// VPHADDW m256 ymm ymm -// Construct and append a VPHADDW instruction to the active function. -// Operates on the global context. -func VPHADDW(mxy, xy, xy1 operand.Op) { ctx.VPHADDW(mxy, xy, xy1) } - -// VPHMINPOSUW: Packed Horizontal Minimum of Unsigned Word Integers. -// -// Forms: -// -// VPHMINPOSUW xmm xmm -// VPHMINPOSUW m128 xmm -// Construct and append a VPHMINPOSUW instruction to the active function. -func (c *Context) VPHMINPOSUW(mx, x operand.Op) { - if inst, err := x86.VPHMINPOSUW(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPHMINPOSUW: Packed Horizontal Minimum of Unsigned Word Integers. -// -// Forms: -// -// VPHMINPOSUW xmm xmm -// VPHMINPOSUW m128 xmm -// Construct and append a VPHMINPOSUW instruction to the active function. -// Operates on the global context. -func VPHMINPOSUW(mx, x operand.Op) { ctx.VPHMINPOSUW(mx, x) } - -// VPHSUBD: Packed Horizontal Subtract Doubleword Integers. -// -// Forms: -// -// VPHSUBD xmm xmm xmm -// VPHSUBD m128 xmm xmm -// VPHSUBD ymm ymm ymm -// VPHSUBD m256 ymm ymm -// Construct and append a VPHSUBD instruction to the active function. -func (c *Context) VPHSUBD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPHSUBD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPHSUBD: Packed Horizontal Subtract Doubleword Integers. -// -// Forms: -// -// VPHSUBD xmm xmm xmm -// VPHSUBD m128 xmm xmm -// VPHSUBD ymm ymm ymm -// VPHSUBD m256 ymm ymm -// Construct and append a VPHSUBD instruction to the active function. -// Operates on the global context. -func VPHSUBD(mxy, xy, xy1 operand.Op) { ctx.VPHSUBD(mxy, xy, xy1) } - -// VPHSUBSW: Packed Horizontal Subtract Signed Word Integers with Signed Saturation. -// -// Forms: -// -// VPHSUBSW xmm xmm xmm -// VPHSUBSW m128 xmm xmm -// VPHSUBSW ymm ymm ymm -// VPHSUBSW m256 ymm ymm -// Construct and append a VPHSUBSW instruction to the active function. -func (c *Context) VPHSUBSW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPHSUBSW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPHSUBSW: Packed Horizontal Subtract Signed Word Integers with Signed Saturation. -// -// Forms: -// -// VPHSUBSW xmm xmm xmm -// VPHSUBSW m128 xmm xmm -// VPHSUBSW ymm ymm ymm -// VPHSUBSW m256 ymm ymm -// Construct and append a VPHSUBSW instruction to the active function. -// Operates on the global context. -func VPHSUBSW(mxy, xy, xy1 operand.Op) { ctx.VPHSUBSW(mxy, xy, xy1) } - -// VPHSUBW: Packed Horizontal Subtract Word Integers. -// -// Forms: -// -// VPHSUBW xmm xmm xmm -// VPHSUBW m128 xmm xmm -// VPHSUBW ymm ymm ymm -// VPHSUBW m256 ymm ymm -// Construct and append a VPHSUBW instruction to the active function. -func (c *Context) VPHSUBW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPHSUBW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPHSUBW: Packed Horizontal Subtract Word Integers. -// -// Forms: -// -// VPHSUBW xmm xmm xmm -// VPHSUBW m128 xmm xmm -// VPHSUBW ymm ymm ymm -// VPHSUBW m256 ymm ymm -// Construct and append a VPHSUBW instruction to the active function. -// Operates on the global context. -func VPHSUBW(mxy, xy, xy1 operand.Op) { ctx.VPHSUBW(mxy, xy, xy1) } - -// VPINSRB: Insert Byte. -// -// Forms: -// -// VPINSRB imm8 r32 xmm xmm -// VPINSRB imm8 m8 xmm xmm -// Construct and append a VPINSRB instruction to the active function. -func (c *Context) VPINSRB(i, mr, x, x1 operand.Op) { - if inst, err := x86.VPINSRB(i, mr, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPINSRB: Insert Byte. -// -// Forms: -// -// VPINSRB imm8 r32 xmm xmm -// VPINSRB imm8 m8 xmm xmm -// Construct and append a VPINSRB instruction to the active function. -// Operates on the global context. -func VPINSRB(i, mr, x, x1 operand.Op) { ctx.VPINSRB(i, mr, x, x1) } - -// VPINSRD: Insert Doubleword. -// -// Forms: -// -// VPINSRD imm8 r32 xmm xmm -// VPINSRD imm8 m32 xmm xmm -// Construct and append a VPINSRD instruction to the active function. -func (c *Context) VPINSRD(i, mr, x, x1 operand.Op) { - if inst, err := x86.VPINSRD(i, mr, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPINSRD: Insert Doubleword. -// -// Forms: -// -// VPINSRD imm8 r32 xmm xmm -// VPINSRD imm8 m32 xmm xmm -// Construct and append a VPINSRD instruction to the active function. -// Operates on the global context. -func VPINSRD(i, mr, x, x1 operand.Op) { ctx.VPINSRD(i, mr, x, x1) } - -// VPINSRQ: Insert Quadword. -// -// Forms: -// -// VPINSRQ imm8 r64 xmm xmm -// VPINSRQ imm8 m64 xmm xmm -// Construct and append a VPINSRQ instruction to the active function. -func (c *Context) VPINSRQ(i, mr, x, x1 operand.Op) { - if inst, err := x86.VPINSRQ(i, mr, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPINSRQ: Insert Quadword. -// -// Forms: -// -// VPINSRQ imm8 r64 xmm xmm -// VPINSRQ imm8 m64 xmm xmm -// Construct and append a VPINSRQ instruction to the active function. -// Operates on the global context. -func VPINSRQ(i, mr, x, x1 operand.Op) { ctx.VPINSRQ(i, mr, x, x1) } - -// VPINSRW: Insert Word. -// -// Forms: -// -// VPINSRW imm8 r32 xmm xmm -// VPINSRW imm8 m16 xmm xmm -// Construct and append a VPINSRW instruction to the active function. -func (c *Context) VPINSRW(i, mr, x, x1 operand.Op) { - if inst, err := x86.VPINSRW(i, mr, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPINSRW: Insert Word. -// -// Forms: -// -// VPINSRW imm8 r32 xmm xmm -// VPINSRW imm8 m16 xmm xmm -// Construct and append a VPINSRW instruction to the active function. -// Operates on the global context. -func VPINSRW(i, mr, x, x1 operand.Op) { ctx.VPINSRW(i, mr, x, x1) } - -// VPMADDUBSW: Multiply and Add Packed Signed and Unsigned Byte Integers. -// -// Forms: -// -// VPMADDUBSW xmm xmm xmm -// VPMADDUBSW m128 xmm xmm -// VPMADDUBSW ymm ymm ymm -// VPMADDUBSW m256 ymm ymm -// Construct and append a VPMADDUBSW instruction to the active function. -func (c *Context) VPMADDUBSW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMADDUBSW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMADDUBSW: Multiply and Add Packed Signed and Unsigned Byte Integers. -// -// Forms: -// -// VPMADDUBSW xmm xmm xmm -// VPMADDUBSW m128 xmm xmm -// VPMADDUBSW ymm ymm ymm -// VPMADDUBSW m256 ymm ymm -// Construct and append a VPMADDUBSW instruction to the active function. -// Operates on the global context. -func VPMADDUBSW(mxy, xy, xy1 operand.Op) { ctx.VPMADDUBSW(mxy, xy, xy1) } - -// VPMADDWD: Multiply and Add Packed Signed Word Integers. -// -// Forms: -// -// VPMADDWD xmm xmm xmm -// VPMADDWD m128 xmm xmm -// VPMADDWD ymm ymm ymm -// VPMADDWD m256 ymm ymm -// Construct and append a VPMADDWD instruction to the active function. -func (c *Context) VPMADDWD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMADDWD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMADDWD: Multiply and Add Packed Signed Word Integers. -// -// Forms: -// -// VPMADDWD xmm xmm xmm -// VPMADDWD m128 xmm xmm -// VPMADDWD ymm ymm ymm -// VPMADDWD m256 ymm ymm -// Construct and append a VPMADDWD instruction to the active function. -// Operates on the global context. -func VPMADDWD(mxy, xy, xy1 operand.Op) { ctx.VPMADDWD(mxy, xy, xy1) } - -// VPMASKMOVD: Conditional Move Packed Doubleword Integers. -// -// Forms: -// -// VPMASKMOVD m128 xmm xmm -// VPMASKMOVD m256 ymm ymm -// VPMASKMOVD xmm xmm m128 -// VPMASKMOVD ymm ymm m256 -// Construct and append a VPMASKMOVD instruction to the active function. -func (c *Context) VPMASKMOVD(mxy, xy, mxy1 operand.Op) { - if inst, err := x86.VPMASKMOVD(mxy, xy, mxy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMASKMOVD: Conditional Move Packed Doubleword Integers. -// -// Forms: -// -// VPMASKMOVD m128 xmm xmm -// VPMASKMOVD m256 ymm ymm -// VPMASKMOVD xmm xmm m128 -// VPMASKMOVD ymm ymm m256 -// Construct and append a VPMASKMOVD instruction to the active function. -// Operates on the global context. -func VPMASKMOVD(mxy, xy, mxy1 operand.Op) { ctx.VPMASKMOVD(mxy, xy, mxy1) } - -// VPMASKMOVQ: Conditional Move Packed Quadword Integers. -// -// Forms: -// -// VPMASKMOVQ m128 xmm xmm -// VPMASKMOVQ m256 ymm ymm -// VPMASKMOVQ xmm xmm m128 -// VPMASKMOVQ ymm ymm m256 -// Construct and append a VPMASKMOVQ instruction to the active function. -func (c *Context) VPMASKMOVQ(mxy, xy, mxy1 operand.Op) { - if inst, err := x86.VPMASKMOVQ(mxy, xy, mxy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMASKMOVQ: Conditional Move Packed Quadword Integers. -// -// Forms: -// -// VPMASKMOVQ m128 xmm xmm -// VPMASKMOVQ m256 ymm ymm -// VPMASKMOVQ xmm xmm m128 -// VPMASKMOVQ ymm ymm m256 -// Construct and append a VPMASKMOVQ instruction to the active function. -// Operates on the global context. -func VPMASKMOVQ(mxy, xy, mxy1 operand.Op) { ctx.VPMASKMOVQ(mxy, xy, mxy1) } - -// VPMAXSB: Maximum of Packed Signed Byte Integers. -// -// Forms: -// -// VPMAXSB xmm xmm xmm -// VPMAXSB m128 xmm xmm -// VPMAXSB ymm ymm ymm -// VPMAXSB m256 ymm ymm -// Construct and append a VPMAXSB instruction to the active function. -func (c *Context) VPMAXSB(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMAXSB(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMAXSB: Maximum of Packed Signed Byte Integers. -// -// Forms: -// -// VPMAXSB xmm xmm xmm -// VPMAXSB m128 xmm xmm -// VPMAXSB ymm ymm ymm -// VPMAXSB m256 ymm ymm -// Construct and append a VPMAXSB instruction to the active function. -// Operates on the global context. -func VPMAXSB(mxy, xy, xy1 operand.Op) { ctx.VPMAXSB(mxy, xy, xy1) } - -// VPMAXSD: Maximum of Packed Signed Doubleword Integers. -// -// Forms: -// -// VPMAXSD xmm xmm xmm -// VPMAXSD m128 xmm xmm -// VPMAXSD ymm ymm ymm -// VPMAXSD m256 ymm ymm -// Construct and append a VPMAXSD instruction to the active function. -func (c *Context) VPMAXSD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMAXSD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMAXSD: Maximum of Packed Signed Doubleword Integers. -// -// Forms: -// -// VPMAXSD xmm xmm xmm -// VPMAXSD m128 xmm xmm -// VPMAXSD ymm ymm ymm -// VPMAXSD m256 ymm ymm -// Construct and append a VPMAXSD instruction to the active function. -// Operates on the global context. -func VPMAXSD(mxy, xy, xy1 operand.Op) { ctx.VPMAXSD(mxy, xy, xy1) } - -// VPMAXSW: Maximum of Packed Signed Word Integers. -// -// Forms: -// -// VPMAXSW xmm xmm xmm -// VPMAXSW m128 xmm xmm -// VPMAXSW ymm ymm ymm -// VPMAXSW m256 ymm ymm -// Construct and append a VPMAXSW instruction to the active function. -func (c *Context) VPMAXSW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMAXSW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMAXSW: Maximum of Packed Signed Word Integers. -// -// Forms: -// -// VPMAXSW xmm xmm xmm -// VPMAXSW m128 xmm xmm -// VPMAXSW ymm ymm ymm -// VPMAXSW m256 ymm ymm -// Construct and append a VPMAXSW instruction to the active function. -// Operates on the global context. -func VPMAXSW(mxy, xy, xy1 operand.Op) { ctx.VPMAXSW(mxy, xy, xy1) } - -// VPMAXUB: Maximum of Packed Unsigned Byte Integers. -// -// Forms: -// -// VPMAXUB xmm xmm xmm -// VPMAXUB m128 xmm xmm -// VPMAXUB ymm ymm ymm -// VPMAXUB m256 ymm ymm -// Construct and append a VPMAXUB instruction to the active function. -func (c *Context) VPMAXUB(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMAXUB(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMAXUB: Maximum of Packed Unsigned Byte Integers. -// -// Forms: -// -// VPMAXUB xmm xmm xmm -// VPMAXUB m128 xmm xmm -// VPMAXUB ymm ymm ymm -// VPMAXUB m256 ymm ymm -// Construct and append a VPMAXUB instruction to the active function. -// Operates on the global context. -func VPMAXUB(mxy, xy, xy1 operand.Op) { ctx.VPMAXUB(mxy, xy, xy1) } - -// VPMAXUD: Maximum of Packed Unsigned Doubleword Integers. -// -// Forms: -// -// VPMAXUD xmm xmm xmm -// VPMAXUD m128 xmm xmm -// VPMAXUD ymm ymm ymm -// VPMAXUD m256 ymm ymm -// Construct and append a VPMAXUD instruction to the active function. -func (c *Context) VPMAXUD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMAXUD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMAXUD: Maximum of Packed Unsigned Doubleword Integers. -// -// Forms: -// -// VPMAXUD xmm xmm xmm -// VPMAXUD m128 xmm xmm -// VPMAXUD ymm ymm ymm -// VPMAXUD m256 ymm ymm -// Construct and append a VPMAXUD instruction to the active function. -// Operates on the global context. -func VPMAXUD(mxy, xy, xy1 operand.Op) { ctx.VPMAXUD(mxy, xy, xy1) } - -// VPMAXUW: Maximum of Packed Unsigned Word Integers. -// -// Forms: -// -// VPMAXUW xmm xmm xmm -// VPMAXUW m128 xmm xmm -// VPMAXUW ymm ymm ymm -// VPMAXUW m256 ymm ymm -// Construct and append a VPMAXUW instruction to the active function. -func (c *Context) VPMAXUW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMAXUW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMAXUW: Maximum of Packed Unsigned Word Integers. -// -// Forms: -// -// VPMAXUW xmm xmm xmm -// VPMAXUW m128 xmm xmm -// VPMAXUW ymm ymm ymm -// VPMAXUW m256 ymm ymm -// Construct and append a VPMAXUW instruction to the active function. -// Operates on the global context. -func VPMAXUW(mxy, xy, xy1 operand.Op) { ctx.VPMAXUW(mxy, xy, xy1) } - -// VPMINSB: Minimum of Packed Signed Byte Integers. -// -// Forms: -// -// VPMINSB xmm xmm xmm -// VPMINSB m128 xmm xmm -// VPMINSB ymm ymm ymm -// VPMINSB m256 ymm ymm -// Construct and append a VPMINSB instruction to the active function. -func (c *Context) VPMINSB(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMINSB(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMINSB: Minimum of Packed Signed Byte Integers. -// -// Forms: -// -// VPMINSB xmm xmm xmm -// VPMINSB m128 xmm xmm -// VPMINSB ymm ymm ymm -// VPMINSB m256 ymm ymm -// Construct and append a VPMINSB instruction to the active function. -// Operates on the global context. -func VPMINSB(mxy, xy, xy1 operand.Op) { ctx.VPMINSB(mxy, xy, xy1) } - -// VPMINSD: Minimum of Packed Signed Doubleword Integers. -// -// Forms: -// -// VPMINSD xmm xmm xmm -// VPMINSD m128 xmm xmm -// VPMINSD ymm ymm ymm -// VPMINSD m256 ymm ymm -// Construct and append a VPMINSD instruction to the active function. -func (c *Context) VPMINSD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMINSD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMINSD: Minimum of Packed Signed Doubleword Integers. -// -// Forms: -// -// VPMINSD xmm xmm xmm -// VPMINSD m128 xmm xmm -// VPMINSD ymm ymm ymm -// VPMINSD m256 ymm ymm -// Construct and append a VPMINSD instruction to the active function. -// Operates on the global context. -func VPMINSD(mxy, xy, xy1 operand.Op) { ctx.VPMINSD(mxy, xy, xy1) } - -// VPMINSW: Minimum of Packed Signed Word Integers. -// -// Forms: -// -// VPMINSW xmm xmm xmm -// VPMINSW m128 xmm xmm -// VPMINSW ymm ymm ymm -// VPMINSW m256 ymm ymm -// Construct and append a VPMINSW instruction to the active function. -func (c *Context) VPMINSW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMINSW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMINSW: Minimum of Packed Signed Word Integers. -// -// Forms: -// -// VPMINSW xmm xmm xmm -// VPMINSW m128 xmm xmm -// VPMINSW ymm ymm ymm -// VPMINSW m256 ymm ymm -// Construct and append a VPMINSW instruction to the active function. -// Operates on the global context. -func VPMINSW(mxy, xy, xy1 operand.Op) { ctx.VPMINSW(mxy, xy, xy1) } - -// VPMINUB: Minimum of Packed Unsigned Byte Integers. -// -// Forms: -// -// VPMINUB xmm xmm xmm -// VPMINUB m128 xmm xmm -// VPMINUB ymm ymm ymm -// VPMINUB m256 ymm ymm -// Construct and append a VPMINUB instruction to the active function. -func (c *Context) VPMINUB(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMINUB(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMINUB: Minimum of Packed Unsigned Byte Integers. -// -// Forms: -// -// VPMINUB xmm xmm xmm -// VPMINUB m128 xmm xmm -// VPMINUB ymm ymm ymm -// VPMINUB m256 ymm ymm -// Construct and append a VPMINUB instruction to the active function. -// Operates on the global context. -func VPMINUB(mxy, xy, xy1 operand.Op) { ctx.VPMINUB(mxy, xy, xy1) } - -// VPMINUD: Minimum of Packed Unsigned Doubleword Integers. -// -// Forms: -// -// VPMINUD xmm xmm xmm -// VPMINUD m128 xmm xmm -// VPMINUD ymm ymm ymm -// VPMINUD m256 ymm ymm -// Construct and append a VPMINUD instruction to the active function. -func (c *Context) VPMINUD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMINUD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMINUD: Minimum of Packed Unsigned Doubleword Integers. -// -// Forms: -// -// VPMINUD xmm xmm xmm -// VPMINUD m128 xmm xmm -// VPMINUD ymm ymm ymm -// VPMINUD m256 ymm ymm -// Construct and append a VPMINUD instruction to the active function. -// Operates on the global context. -func VPMINUD(mxy, xy, xy1 operand.Op) { ctx.VPMINUD(mxy, xy, xy1) } - -// VPMINUW: Minimum of Packed Unsigned Word Integers. -// -// Forms: -// -// VPMINUW xmm xmm xmm -// VPMINUW m128 xmm xmm -// VPMINUW ymm ymm ymm -// VPMINUW m256 ymm ymm -// Construct and append a VPMINUW instruction to the active function. -func (c *Context) VPMINUW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMINUW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMINUW: Minimum of Packed Unsigned Word Integers. -// -// Forms: -// -// VPMINUW xmm xmm xmm -// VPMINUW m128 xmm xmm -// VPMINUW ymm ymm ymm -// VPMINUW m256 ymm ymm -// Construct and append a VPMINUW instruction to the active function. -// Operates on the global context. -func VPMINUW(mxy, xy, xy1 operand.Op) { ctx.VPMINUW(mxy, xy, xy1) } - -// VPMOVMSKB: Move Byte Mask. -// -// Forms: -// -// VPMOVMSKB xmm r32 -// VPMOVMSKB ymm r32 -// Construct and append a VPMOVMSKB instruction to the active function. -func (c *Context) VPMOVMSKB(xy, r operand.Op) { - if inst, err := x86.VPMOVMSKB(xy, r); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMOVMSKB: Move Byte Mask. -// -// Forms: -// -// VPMOVMSKB xmm r32 -// VPMOVMSKB ymm r32 -// Construct and append a VPMOVMSKB instruction to the active function. -// Operates on the global context. -func VPMOVMSKB(xy, r operand.Op) { ctx.VPMOVMSKB(xy, r) } - -// VPMOVSXBD: Move Packed Byte Integers to Doubleword Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXBD xmm xmm -// VPMOVSXBD m32 xmm -// VPMOVSXBD xmm ymm -// VPMOVSXBD m64 ymm -// Construct and append a VPMOVSXBD instruction to the active function. -func (c *Context) VPMOVSXBD(mx, xy operand.Op) { - if inst, err := x86.VPMOVSXBD(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMOVSXBD: Move Packed Byte Integers to Doubleword Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXBD xmm xmm -// VPMOVSXBD m32 xmm -// VPMOVSXBD xmm ymm -// VPMOVSXBD m64 ymm -// Construct and append a VPMOVSXBD instruction to the active function. -// Operates on the global context. -func VPMOVSXBD(mx, xy operand.Op) { ctx.VPMOVSXBD(mx, xy) } - -// VPMOVSXBQ: Move Packed Byte Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXBQ xmm xmm -// VPMOVSXBQ m16 xmm -// VPMOVSXBQ xmm ymm -// VPMOVSXBQ m32 ymm -// Construct and append a VPMOVSXBQ instruction to the active function. -func (c *Context) VPMOVSXBQ(mx, xy operand.Op) { - if inst, err := x86.VPMOVSXBQ(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMOVSXBQ: Move Packed Byte Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXBQ xmm xmm -// VPMOVSXBQ m16 xmm -// VPMOVSXBQ xmm ymm -// VPMOVSXBQ m32 ymm -// Construct and append a VPMOVSXBQ instruction to the active function. -// Operates on the global context. -func VPMOVSXBQ(mx, xy operand.Op) { ctx.VPMOVSXBQ(mx, xy) } - -// VPMOVSXBW: Move Packed Byte Integers to Word Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXBW xmm xmm -// VPMOVSXBW m64 xmm -// VPMOVSXBW xmm ymm -// VPMOVSXBW m128 ymm -// Construct and append a VPMOVSXBW instruction to the active function. -func (c *Context) VPMOVSXBW(mx, xy operand.Op) { - if inst, err := x86.VPMOVSXBW(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMOVSXBW: Move Packed Byte Integers to Word Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXBW xmm xmm -// VPMOVSXBW m64 xmm -// VPMOVSXBW xmm ymm -// VPMOVSXBW m128 ymm -// Construct and append a VPMOVSXBW instruction to the active function. -// Operates on the global context. -func VPMOVSXBW(mx, xy operand.Op) { ctx.VPMOVSXBW(mx, xy) } - -// VPMOVSXDQ: Move Packed Doubleword Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXDQ xmm xmm -// VPMOVSXDQ m64 xmm -// VPMOVSXDQ xmm ymm -// VPMOVSXDQ m128 ymm -// Construct and append a VPMOVSXDQ instruction to the active function. -func (c *Context) VPMOVSXDQ(mx, xy operand.Op) { - if inst, err := x86.VPMOVSXDQ(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMOVSXDQ: Move Packed Doubleword Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXDQ xmm xmm -// VPMOVSXDQ m64 xmm -// VPMOVSXDQ xmm ymm -// VPMOVSXDQ m128 ymm -// Construct and append a VPMOVSXDQ instruction to the active function. -// Operates on the global context. -func VPMOVSXDQ(mx, xy operand.Op) { ctx.VPMOVSXDQ(mx, xy) } - -// VPMOVSXWD: Move Packed Word Integers to Doubleword Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXWD xmm xmm -// VPMOVSXWD m64 xmm -// VPMOVSXWD xmm ymm -// VPMOVSXWD m128 ymm -// Construct and append a VPMOVSXWD instruction to the active function. -func (c *Context) VPMOVSXWD(mx, xy operand.Op) { - if inst, err := x86.VPMOVSXWD(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMOVSXWD: Move Packed Word Integers to Doubleword Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXWD xmm xmm -// VPMOVSXWD m64 xmm -// VPMOVSXWD xmm ymm -// VPMOVSXWD m128 ymm -// Construct and append a VPMOVSXWD instruction to the active function. -// Operates on the global context. -func VPMOVSXWD(mx, xy operand.Op) { ctx.VPMOVSXWD(mx, xy) } - -// VPMOVSXWQ: Move Packed Word Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXWQ xmm xmm -// VPMOVSXWQ m32 xmm -// VPMOVSXWQ xmm ymm -// VPMOVSXWQ m64 ymm -// Construct and append a VPMOVSXWQ instruction to the active function. -func (c *Context) VPMOVSXWQ(mx, xy operand.Op) { - if inst, err := x86.VPMOVSXWQ(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMOVSXWQ: Move Packed Word Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXWQ xmm xmm -// VPMOVSXWQ m32 xmm -// VPMOVSXWQ xmm ymm -// VPMOVSXWQ m64 ymm -// Construct and append a VPMOVSXWQ instruction to the active function. -// Operates on the global context. -func VPMOVSXWQ(mx, xy operand.Op) { ctx.VPMOVSXWQ(mx, xy) } - -// VPMOVZXBD: Move Packed Byte Integers to Doubleword Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXBD xmm xmm -// VPMOVZXBD m32 xmm -// VPMOVZXBD xmm ymm -// VPMOVZXBD m64 ymm -// Construct and append a VPMOVZXBD instruction to the active function. -func (c *Context) VPMOVZXBD(mx, xy operand.Op) { - if inst, err := x86.VPMOVZXBD(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMOVZXBD: Move Packed Byte Integers to Doubleword Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXBD xmm xmm -// VPMOVZXBD m32 xmm -// VPMOVZXBD xmm ymm -// VPMOVZXBD m64 ymm -// Construct and append a VPMOVZXBD instruction to the active function. -// Operates on the global context. -func VPMOVZXBD(mx, xy operand.Op) { ctx.VPMOVZXBD(mx, xy) } - -// VPMOVZXBQ: Move Packed Byte Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXBQ xmm xmm -// VPMOVZXBQ m16 xmm -// VPMOVZXBQ xmm ymm -// VPMOVZXBQ m32 ymm -// Construct and append a VPMOVZXBQ instruction to the active function. -func (c *Context) VPMOVZXBQ(mx, xy operand.Op) { - if inst, err := x86.VPMOVZXBQ(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMOVZXBQ: Move Packed Byte Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXBQ xmm xmm -// VPMOVZXBQ m16 xmm -// VPMOVZXBQ xmm ymm -// VPMOVZXBQ m32 ymm -// Construct and append a VPMOVZXBQ instruction to the active function. -// Operates on the global context. -func VPMOVZXBQ(mx, xy operand.Op) { ctx.VPMOVZXBQ(mx, xy) } - -// VPMOVZXBW: Move Packed Byte Integers to Word Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXBW xmm xmm -// VPMOVZXBW m64 xmm -// VPMOVZXBW xmm ymm -// VPMOVZXBW m128 ymm -// Construct and append a VPMOVZXBW instruction to the active function. -func (c *Context) VPMOVZXBW(mx, xy operand.Op) { - if inst, err := x86.VPMOVZXBW(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMOVZXBW: Move Packed Byte Integers to Word Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXBW xmm xmm -// VPMOVZXBW m64 xmm -// VPMOVZXBW xmm ymm -// VPMOVZXBW m128 ymm -// Construct and append a VPMOVZXBW instruction to the active function. -// Operates on the global context. -func VPMOVZXBW(mx, xy operand.Op) { ctx.VPMOVZXBW(mx, xy) } - -// VPMOVZXDQ: Move Packed Doubleword Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXDQ xmm xmm -// VPMOVZXDQ m64 xmm -// VPMOVZXDQ xmm ymm -// VPMOVZXDQ m128 ymm -// Construct and append a VPMOVZXDQ instruction to the active function. -func (c *Context) VPMOVZXDQ(mx, xy operand.Op) { - if inst, err := x86.VPMOVZXDQ(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMOVZXDQ: Move Packed Doubleword Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXDQ xmm xmm -// VPMOVZXDQ m64 xmm -// VPMOVZXDQ xmm ymm -// VPMOVZXDQ m128 ymm -// Construct and append a VPMOVZXDQ instruction to the active function. -// Operates on the global context. -func VPMOVZXDQ(mx, xy operand.Op) { ctx.VPMOVZXDQ(mx, xy) } - -// VPMOVZXWD: Move Packed Word Integers to Doubleword Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXWD xmm xmm -// VPMOVZXWD m64 xmm -// VPMOVZXWD xmm ymm -// VPMOVZXWD m128 ymm -// Construct and append a VPMOVZXWD instruction to the active function. -func (c *Context) VPMOVZXWD(mx, xy operand.Op) { - if inst, err := x86.VPMOVZXWD(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMOVZXWD: Move Packed Word Integers to Doubleword Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXWD xmm xmm -// VPMOVZXWD m64 xmm -// VPMOVZXWD xmm ymm -// VPMOVZXWD m128 ymm -// Construct and append a VPMOVZXWD instruction to the active function. -// Operates on the global context. -func VPMOVZXWD(mx, xy operand.Op) { ctx.VPMOVZXWD(mx, xy) } - -// VPMOVZXWQ: Move Packed Word Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXWQ xmm xmm -// VPMOVZXWQ m32 xmm -// VPMOVZXWQ xmm ymm -// VPMOVZXWQ m64 ymm -// Construct and append a VPMOVZXWQ instruction to the active function. -func (c *Context) VPMOVZXWQ(mx, xy operand.Op) { - if inst, err := x86.VPMOVZXWQ(mx, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMOVZXWQ: Move Packed Word Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXWQ xmm xmm -// VPMOVZXWQ m32 xmm -// VPMOVZXWQ xmm ymm -// VPMOVZXWQ m64 ymm -// Construct and append a VPMOVZXWQ instruction to the active function. -// Operates on the global context. -func VPMOVZXWQ(mx, xy operand.Op) { ctx.VPMOVZXWQ(mx, xy) } - -// VPMULDQ: Multiply Packed Signed Doubleword Integers and Store Quadword Result. -// -// Forms: -// -// VPMULDQ xmm xmm xmm -// VPMULDQ m128 xmm xmm -// VPMULDQ ymm ymm ymm -// VPMULDQ m256 ymm ymm -// Construct and append a VPMULDQ instruction to the active function. -func (c *Context) VPMULDQ(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMULDQ(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMULDQ: Multiply Packed Signed Doubleword Integers and Store Quadword Result. -// -// Forms: -// -// VPMULDQ xmm xmm xmm -// VPMULDQ m128 xmm xmm -// VPMULDQ ymm ymm ymm -// VPMULDQ m256 ymm ymm -// Construct and append a VPMULDQ instruction to the active function. -// Operates on the global context. -func VPMULDQ(mxy, xy, xy1 operand.Op) { ctx.VPMULDQ(mxy, xy, xy1) } - -// VPMULHRSW: Packed Multiply Signed Word Integers and Store High Result with Round and Scale. -// -// Forms: -// -// VPMULHRSW xmm xmm xmm -// VPMULHRSW m128 xmm xmm -// VPMULHRSW ymm ymm ymm -// VPMULHRSW m256 ymm ymm -// Construct and append a VPMULHRSW instruction to the active function. -func (c *Context) VPMULHRSW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMULHRSW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMULHRSW: Packed Multiply Signed Word Integers and Store High Result with Round and Scale. -// -// Forms: -// -// VPMULHRSW xmm xmm xmm -// VPMULHRSW m128 xmm xmm -// VPMULHRSW ymm ymm ymm -// VPMULHRSW m256 ymm ymm -// Construct and append a VPMULHRSW instruction to the active function. -// Operates on the global context. -func VPMULHRSW(mxy, xy, xy1 operand.Op) { ctx.VPMULHRSW(mxy, xy, xy1) } - -// VPMULHUW: Multiply Packed Unsigned Word Integers and Store High Result. -// -// Forms: -// -// VPMULHUW xmm xmm xmm -// VPMULHUW m128 xmm xmm -// VPMULHUW ymm ymm ymm -// VPMULHUW m256 ymm ymm -// Construct and append a VPMULHUW instruction to the active function. -func (c *Context) VPMULHUW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMULHUW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMULHUW: Multiply Packed Unsigned Word Integers and Store High Result. -// -// Forms: -// -// VPMULHUW xmm xmm xmm -// VPMULHUW m128 xmm xmm -// VPMULHUW ymm ymm ymm -// VPMULHUW m256 ymm ymm -// Construct and append a VPMULHUW instruction to the active function. -// Operates on the global context. -func VPMULHUW(mxy, xy, xy1 operand.Op) { ctx.VPMULHUW(mxy, xy, xy1) } - -// VPMULHW: Multiply Packed Signed Word Integers and Store High Result. -// -// Forms: -// -// VPMULHW xmm xmm xmm -// VPMULHW m128 xmm xmm -// VPMULHW ymm ymm ymm -// VPMULHW m256 ymm ymm -// Construct and append a VPMULHW instruction to the active function. -func (c *Context) VPMULHW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMULHW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMULHW: Multiply Packed Signed Word Integers and Store High Result. -// -// Forms: -// -// VPMULHW xmm xmm xmm -// VPMULHW m128 xmm xmm -// VPMULHW ymm ymm ymm -// VPMULHW m256 ymm ymm -// Construct and append a VPMULHW instruction to the active function. -// Operates on the global context. -func VPMULHW(mxy, xy, xy1 operand.Op) { ctx.VPMULHW(mxy, xy, xy1) } - -// VPMULLD: Multiply Packed Signed Doubleword Integers and Store Low Result. -// -// Forms: -// -// VPMULLD xmm xmm xmm -// VPMULLD m128 xmm xmm -// VPMULLD ymm ymm ymm -// VPMULLD m256 ymm ymm -// Construct and append a VPMULLD instruction to the active function. -func (c *Context) VPMULLD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMULLD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMULLD: Multiply Packed Signed Doubleword Integers and Store Low Result. -// -// Forms: -// -// VPMULLD xmm xmm xmm -// VPMULLD m128 xmm xmm -// VPMULLD ymm ymm ymm -// VPMULLD m256 ymm ymm -// Construct and append a VPMULLD instruction to the active function. -// Operates on the global context. -func VPMULLD(mxy, xy, xy1 operand.Op) { ctx.VPMULLD(mxy, xy, xy1) } - -// VPMULLW: Multiply Packed Signed Word Integers and Store Low Result. -// -// Forms: -// -// VPMULLW xmm xmm xmm -// VPMULLW m128 xmm xmm -// VPMULLW ymm ymm ymm -// VPMULLW m256 ymm ymm -// Construct and append a VPMULLW instruction to the active function. -func (c *Context) VPMULLW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMULLW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMULLW: Multiply Packed Signed Word Integers and Store Low Result. -// -// Forms: -// -// VPMULLW xmm xmm xmm -// VPMULLW m128 xmm xmm -// VPMULLW ymm ymm ymm -// VPMULLW m256 ymm ymm -// Construct and append a VPMULLW instruction to the active function. -// Operates on the global context. -func VPMULLW(mxy, xy, xy1 operand.Op) { ctx.VPMULLW(mxy, xy, xy1) } - -// VPMULUDQ: Multiply Packed Unsigned Doubleword Integers. -// -// Forms: -// -// VPMULUDQ xmm xmm xmm -// VPMULUDQ m128 xmm xmm -// VPMULUDQ ymm ymm ymm -// VPMULUDQ m256 ymm ymm -// Construct and append a VPMULUDQ instruction to the active function. -func (c *Context) VPMULUDQ(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPMULUDQ(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPMULUDQ: Multiply Packed Unsigned Doubleword Integers. -// -// Forms: -// -// VPMULUDQ xmm xmm xmm -// VPMULUDQ m128 xmm xmm -// VPMULUDQ ymm ymm ymm -// VPMULUDQ m256 ymm ymm -// Construct and append a VPMULUDQ instruction to the active function. -// Operates on the global context. -func VPMULUDQ(mxy, xy, xy1 operand.Op) { ctx.VPMULUDQ(mxy, xy, xy1) } - -// VPOR: Packed Bitwise Logical OR. -// -// Forms: -// -// VPOR xmm xmm xmm -// VPOR m128 xmm xmm -// VPOR ymm ymm ymm -// VPOR m256 ymm ymm -// Construct and append a VPOR instruction to the active function. -func (c *Context) VPOR(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPOR(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPOR: Packed Bitwise Logical OR. -// -// Forms: -// -// VPOR xmm xmm xmm -// VPOR m128 xmm xmm -// VPOR ymm ymm ymm -// VPOR m256 ymm ymm -// Construct and append a VPOR instruction to the active function. -// Operates on the global context. -func VPOR(mxy, xy, xy1 operand.Op) { ctx.VPOR(mxy, xy, xy1) } - -// VPSADBW: Compute Sum of Absolute Differences. -// -// Forms: -// -// VPSADBW xmm xmm xmm -// VPSADBW m128 xmm xmm -// VPSADBW ymm ymm ymm -// VPSADBW m256 ymm ymm -// Construct and append a VPSADBW instruction to the active function. -func (c *Context) VPSADBW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSADBW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSADBW: Compute Sum of Absolute Differences. -// -// Forms: -// -// VPSADBW xmm xmm xmm -// VPSADBW m128 xmm xmm -// VPSADBW ymm ymm ymm -// VPSADBW m256 ymm ymm -// Construct and append a VPSADBW instruction to the active function. -// Operates on the global context. -func VPSADBW(mxy, xy, xy1 operand.Op) { ctx.VPSADBW(mxy, xy, xy1) } - -// VPSHUFB: Packed Shuffle Bytes. -// -// Forms: -// -// VPSHUFB xmm xmm xmm -// VPSHUFB m128 xmm xmm -// VPSHUFB ymm ymm ymm -// VPSHUFB m256 ymm ymm -// Construct and append a VPSHUFB instruction to the active function. -func (c *Context) VPSHUFB(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSHUFB(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSHUFB: Packed Shuffle Bytes. -// -// Forms: -// -// VPSHUFB xmm xmm xmm -// VPSHUFB m128 xmm xmm -// VPSHUFB ymm ymm ymm -// VPSHUFB m256 ymm ymm -// Construct and append a VPSHUFB instruction to the active function. -// Operates on the global context. -func VPSHUFB(mxy, xy, xy1 operand.Op) { ctx.VPSHUFB(mxy, xy, xy1) } - -// VPSHUFD: Shuffle Packed Doublewords. -// -// Forms: -// -// VPSHUFD imm8 xmm xmm -// VPSHUFD imm8 m128 xmm -// VPSHUFD imm8 ymm ymm -// VPSHUFD imm8 m256 ymm -// Construct and append a VPSHUFD instruction to the active function. -func (c *Context) VPSHUFD(i, mxy, xy operand.Op) { - if inst, err := x86.VPSHUFD(i, mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSHUFD: Shuffle Packed Doublewords. -// -// Forms: -// -// VPSHUFD imm8 xmm xmm -// VPSHUFD imm8 m128 xmm -// VPSHUFD imm8 ymm ymm -// VPSHUFD imm8 m256 ymm -// Construct and append a VPSHUFD instruction to the active function. -// Operates on the global context. -func VPSHUFD(i, mxy, xy operand.Op) { ctx.VPSHUFD(i, mxy, xy) } - -// VPSHUFHW: Shuffle Packed High Words. -// -// Forms: -// -// VPSHUFHW imm8 xmm xmm -// VPSHUFHW imm8 m128 xmm -// VPSHUFHW imm8 ymm ymm -// VPSHUFHW imm8 m256 ymm -// Construct and append a VPSHUFHW instruction to the active function. -func (c *Context) VPSHUFHW(i, mxy, xy operand.Op) { - if inst, err := x86.VPSHUFHW(i, mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSHUFHW: Shuffle Packed High Words. -// -// Forms: -// -// VPSHUFHW imm8 xmm xmm -// VPSHUFHW imm8 m128 xmm -// VPSHUFHW imm8 ymm ymm -// VPSHUFHW imm8 m256 ymm -// Construct and append a VPSHUFHW instruction to the active function. -// Operates on the global context. -func VPSHUFHW(i, mxy, xy operand.Op) { ctx.VPSHUFHW(i, mxy, xy) } - -// VPSHUFLW: Shuffle Packed Low Words. -// -// Forms: -// -// VPSHUFLW imm8 xmm xmm -// VPSHUFLW imm8 m128 xmm -// VPSHUFLW imm8 ymm ymm -// VPSHUFLW imm8 m256 ymm -// Construct and append a VPSHUFLW instruction to the active function. -func (c *Context) VPSHUFLW(i, mxy, xy operand.Op) { - if inst, err := x86.VPSHUFLW(i, mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSHUFLW: Shuffle Packed Low Words. -// -// Forms: -// -// VPSHUFLW imm8 xmm xmm -// VPSHUFLW imm8 m128 xmm -// VPSHUFLW imm8 ymm ymm -// VPSHUFLW imm8 m256 ymm -// Construct and append a VPSHUFLW instruction to the active function. -// Operates on the global context. -func VPSHUFLW(i, mxy, xy operand.Op) { ctx.VPSHUFLW(i, mxy, xy) } - -// VPSIGNB: Packed Sign of Byte Integers. -// -// Forms: -// -// VPSIGNB xmm xmm xmm -// VPSIGNB m128 xmm xmm -// VPSIGNB ymm ymm ymm -// VPSIGNB m256 ymm ymm -// Construct and append a VPSIGNB instruction to the active function. -func (c *Context) VPSIGNB(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSIGNB(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSIGNB: Packed Sign of Byte Integers. -// -// Forms: -// -// VPSIGNB xmm xmm xmm -// VPSIGNB m128 xmm xmm -// VPSIGNB ymm ymm ymm -// VPSIGNB m256 ymm ymm -// Construct and append a VPSIGNB instruction to the active function. -// Operates on the global context. -func VPSIGNB(mxy, xy, xy1 operand.Op) { ctx.VPSIGNB(mxy, xy, xy1) } - -// VPSIGND: Packed Sign of Doubleword Integers. -// -// Forms: -// -// VPSIGND xmm xmm xmm -// VPSIGND m128 xmm xmm -// VPSIGND ymm ymm ymm -// VPSIGND m256 ymm ymm -// Construct and append a VPSIGND instruction to the active function. -func (c *Context) VPSIGND(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSIGND(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSIGND: Packed Sign of Doubleword Integers. -// -// Forms: -// -// VPSIGND xmm xmm xmm -// VPSIGND m128 xmm xmm -// VPSIGND ymm ymm ymm -// VPSIGND m256 ymm ymm -// Construct and append a VPSIGND instruction to the active function. -// Operates on the global context. -func VPSIGND(mxy, xy, xy1 operand.Op) { ctx.VPSIGND(mxy, xy, xy1) } - -// VPSIGNW: Packed Sign of Word Integers. -// -// Forms: -// -// VPSIGNW xmm xmm xmm -// VPSIGNW m128 xmm xmm -// VPSIGNW ymm ymm ymm -// VPSIGNW m256 ymm ymm -// Construct and append a VPSIGNW instruction to the active function. -func (c *Context) VPSIGNW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSIGNW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSIGNW: Packed Sign of Word Integers. -// -// Forms: -// -// VPSIGNW xmm xmm xmm -// VPSIGNW m128 xmm xmm -// VPSIGNW ymm ymm ymm -// VPSIGNW m256 ymm ymm -// Construct and append a VPSIGNW instruction to the active function. -// Operates on the global context. -func VPSIGNW(mxy, xy, xy1 operand.Op) { ctx.VPSIGNW(mxy, xy, xy1) } - -// VPSLLD: Shift Packed Doubleword Data Left Logical. -// -// Forms: -// -// VPSLLD imm8 xmm xmm -// VPSLLD xmm xmm xmm -// VPSLLD m128 xmm xmm -// VPSLLD imm8 ymm ymm -// VPSLLD xmm ymm ymm -// VPSLLD m128 ymm ymm -// Construct and append a VPSLLD instruction to the active function. -func (c *Context) VPSLLD(imx, xy, xy1 operand.Op) { - if inst, err := x86.VPSLLD(imx, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSLLD: Shift Packed Doubleword Data Left Logical. -// -// Forms: -// -// VPSLLD imm8 xmm xmm -// VPSLLD xmm xmm xmm -// VPSLLD m128 xmm xmm -// VPSLLD imm8 ymm ymm -// VPSLLD xmm ymm ymm -// VPSLLD m128 ymm ymm -// Construct and append a VPSLLD instruction to the active function. -// Operates on the global context. -func VPSLLD(imx, xy, xy1 operand.Op) { ctx.VPSLLD(imx, xy, xy1) } - -// VPSLLDQ: Shift Packed Double Quadword Left Logical. -// -// Forms: -// -// VPSLLDQ imm8 xmm xmm -// VPSLLDQ imm8 ymm ymm -// Construct and append a VPSLLDQ instruction to the active function. -func (c *Context) VPSLLDQ(i, xy, xy1 operand.Op) { - if inst, err := x86.VPSLLDQ(i, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSLLDQ: Shift Packed Double Quadword Left Logical. -// -// Forms: -// -// VPSLLDQ imm8 xmm xmm -// VPSLLDQ imm8 ymm ymm -// Construct and append a VPSLLDQ instruction to the active function. -// Operates on the global context. -func VPSLLDQ(i, xy, xy1 operand.Op) { ctx.VPSLLDQ(i, xy, xy1) } - -// VPSLLQ: Shift Packed Quadword Data Left Logical. -// -// Forms: -// -// VPSLLQ imm8 xmm xmm -// VPSLLQ xmm xmm xmm -// VPSLLQ m128 xmm xmm -// VPSLLQ imm8 ymm ymm -// VPSLLQ xmm ymm ymm -// VPSLLQ m128 ymm ymm -// Construct and append a VPSLLQ instruction to the active function. -func (c *Context) VPSLLQ(imx, xy, xy1 operand.Op) { - if inst, err := x86.VPSLLQ(imx, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSLLQ: Shift Packed Quadword Data Left Logical. -// -// Forms: -// -// VPSLLQ imm8 xmm xmm -// VPSLLQ xmm xmm xmm -// VPSLLQ m128 xmm xmm -// VPSLLQ imm8 ymm ymm -// VPSLLQ xmm ymm ymm -// VPSLLQ m128 ymm ymm -// Construct and append a VPSLLQ instruction to the active function. -// Operates on the global context. -func VPSLLQ(imx, xy, xy1 operand.Op) { ctx.VPSLLQ(imx, xy, xy1) } - -// VPSLLVD: Variable Shift Packed Doubleword Data Left Logical. -// -// Forms: -// -// VPSLLVD xmm xmm xmm -// VPSLLVD m128 xmm xmm -// VPSLLVD ymm ymm ymm -// VPSLLVD m256 ymm ymm -// Construct and append a VPSLLVD instruction to the active function. -func (c *Context) VPSLLVD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSLLVD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSLLVD: Variable Shift Packed Doubleword Data Left Logical. -// -// Forms: -// -// VPSLLVD xmm xmm xmm -// VPSLLVD m128 xmm xmm -// VPSLLVD ymm ymm ymm -// VPSLLVD m256 ymm ymm -// Construct and append a VPSLLVD instruction to the active function. -// Operates on the global context. -func VPSLLVD(mxy, xy, xy1 operand.Op) { ctx.VPSLLVD(mxy, xy, xy1) } - -// VPSLLVQ: Variable Shift Packed Quadword Data Left Logical. -// -// Forms: -// -// VPSLLVQ xmm xmm xmm -// VPSLLVQ m128 xmm xmm -// VPSLLVQ ymm ymm ymm -// VPSLLVQ m256 ymm ymm -// Construct and append a VPSLLVQ instruction to the active function. -func (c *Context) VPSLLVQ(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSLLVQ(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSLLVQ: Variable Shift Packed Quadword Data Left Logical. -// -// Forms: -// -// VPSLLVQ xmm xmm xmm -// VPSLLVQ m128 xmm xmm -// VPSLLVQ ymm ymm ymm -// VPSLLVQ m256 ymm ymm -// Construct and append a VPSLLVQ instruction to the active function. -// Operates on the global context. -func VPSLLVQ(mxy, xy, xy1 operand.Op) { ctx.VPSLLVQ(mxy, xy, xy1) } - -// VPSLLW: Shift Packed Word Data Left Logical. -// -// Forms: -// -// VPSLLW imm8 xmm xmm -// VPSLLW xmm xmm xmm -// VPSLLW m128 xmm xmm -// VPSLLW imm8 ymm ymm -// VPSLLW xmm ymm ymm -// VPSLLW m128 ymm ymm -// Construct and append a VPSLLW instruction to the active function. -func (c *Context) VPSLLW(imx, xy, xy1 operand.Op) { - if inst, err := x86.VPSLLW(imx, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSLLW: Shift Packed Word Data Left Logical. -// -// Forms: -// -// VPSLLW imm8 xmm xmm -// VPSLLW xmm xmm xmm -// VPSLLW m128 xmm xmm -// VPSLLW imm8 ymm ymm -// VPSLLW xmm ymm ymm -// VPSLLW m128 ymm ymm -// Construct and append a VPSLLW instruction to the active function. -// Operates on the global context. -func VPSLLW(imx, xy, xy1 operand.Op) { ctx.VPSLLW(imx, xy, xy1) } - -// VPSRAD: Shift Packed Doubleword Data Right Arithmetic. -// -// Forms: -// -// VPSRAD imm8 xmm xmm -// VPSRAD xmm xmm xmm -// VPSRAD m128 xmm xmm -// VPSRAD imm8 ymm ymm -// VPSRAD xmm ymm ymm -// VPSRAD m128 ymm ymm -// Construct and append a VPSRAD instruction to the active function. -func (c *Context) VPSRAD(imx, xy, xy1 operand.Op) { - if inst, err := x86.VPSRAD(imx, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSRAD: Shift Packed Doubleword Data Right Arithmetic. -// -// Forms: -// -// VPSRAD imm8 xmm xmm -// VPSRAD xmm xmm xmm -// VPSRAD m128 xmm xmm -// VPSRAD imm8 ymm ymm -// VPSRAD xmm ymm ymm -// VPSRAD m128 ymm ymm -// Construct and append a VPSRAD instruction to the active function. -// Operates on the global context. -func VPSRAD(imx, xy, xy1 operand.Op) { ctx.VPSRAD(imx, xy, xy1) } - -// VPSRAVD: Variable Shift Packed Doubleword Data Right Arithmetic. -// -// Forms: -// -// VPSRAVD xmm xmm xmm -// VPSRAVD m128 xmm xmm -// VPSRAVD ymm ymm ymm -// VPSRAVD m256 ymm ymm -// Construct and append a VPSRAVD instruction to the active function. -func (c *Context) VPSRAVD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSRAVD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSRAVD: Variable Shift Packed Doubleword Data Right Arithmetic. -// -// Forms: -// -// VPSRAVD xmm xmm xmm -// VPSRAVD m128 xmm xmm -// VPSRAVD ymm ymm ymm -// VPSRAVD m256 ymm ymm -// Construct and append a VPSRAVD instruction to the active function. -// Operates on the global context. -func VPSRAVD(mxy, xy, xy1 operand.Op) { ctx.VPSRAVD(mxy, xy, xy1) } - -// VPSRAW: Shift Packed Word Data Right Arithmetic. -// -// Forms: -// -// VPSRAW imm8 xmm xmm -// VPSRAW xmm xmm xmm -// VPSRAW m128 xmm xmm -// VPSRAW imm8 ymm ymm -// VPSRAW xmm ymm ymm -// VPSRAW m128 ymm ymm -// Construct and append a VPSRAW instruction to the active function. -func (c *Context) VPSRAW(imx, xy, xy1 operand.Op) { - if inst, err := x86.VPSRAW(imx, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSRAW: Shift Packed Word Data Right Arithmetic. -// -// Forms: -// -// VPSRAW imm8 xmm xmm -// VPSRAW xmm xmm xmm -// VPSRAW m128 xmm xmm -// VPSRAW imm8 ymm ymm -// VPSRAW xmm ymm ymm -// VPSRAW m128 ymm ymm -// Construct and append a VPSRAW instruction to the active function. -// Operates on the global context. -func VPSRAW(imx, xy, xy1 operand.Op) { ctx.VPSRAW(imx, xy, xy1) } - -// VPSRLD: Shift Packed Doubleword Data Right Logical. -// -// Forms: -// -// VPSRLD imm8 xmm xmm -// VPSRLD xmm xmm xmm -// VPSRLD m128 xmm xmm -// VPSRLD imm8 ymm ymm -// VPSRLD xmm ymm ymm -// VPSRLD m128 ymm ymm -// Construct and append a VPSRLD instruction to the active function. -func (c *Context) VPSRLD(imx, xy, xy1 operand.Op) { - if inst, err := x86.VPSRLD(imx, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSRLD: Shift Packed Doubleword Data Right Logical. -// -// Forms: -// -// VPSRLD imm8 xmm xmm -// VPSRLD xmm xmm xmm -// VPSRLD m128 xmm xmm -// VPSRLD imm8 ymm ymm -// VPSRLD xmm ymm ymm -// VPSRLD m128 ymm ymm -// Construct and append a VPSRLD instruction to the active function. -// Operates on the global context. -func VPSRLD(imx, xy, xy1 operand.Op) { ctx.VPSRLD(imx, xy, xy1) } - -// VPSRLDQ: Shift Packed Double Quadword Right Logical. -// -// Forms: -// -// VPSRLDQ imm8 xmm xmm -// VPSRLDQ imm8 ymm ymm -// Construct and append a VPSRLDQ instruction to the active function. -func (c *Context) VPSRLDQ(i, xy, xy1 operand.Op) { - if inst, err := x86.VPSRLDQ(i, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSRLDQ: Shift Packed Double Quadword Right Logical. -// -// Forms: -// -// VPSRLDQ imm8 xmm xmm -// VPSRLDQ imm8 ymm ymm -// Construct and append a VPSRLDQ instruction to the active function. -// Operates on the global context. -func VPSRLDQ(i, xy, xy1 operand.Op) { ctx.VPSRLDQ(i, xy, xy1) } - -// VPSRLQ: Shift Packed Quadword Data Right Logical. -// -// Forms: -// -// VPSRLQ imm8 xmm xmm -// VPSRLQ xmm xmm xmm -// VPSRLQ m128 xmm xmm -// VPSRLQ imm8 ymm ymm -// VPSRLQ xmm ymm ymm -// VPSRLQ m128 ymm ymm -// Construct and append a VPSRLQ instruction to the active function. -func (c *Context) VPSRLQ(imx, xy, xy1 operand.Op) { - if inst, err := x86.VPSRLQ(imx, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSRLQ: Shift Packed Quadword Data Right Logical. -// -// Forms: -// -// VPSRLQ imm8 xmm xmm -// VPSRLQ xmm xmm xmm -// VPSRLQ m128 xmm xmm -// VPSRLQ imm8 ymm ymm -// VPSRLQ xmm ymm ymm -// VPSRLQ m128 ymm ymm -// Construct and append a VPSRLQ instruction to the active function. -// Operates on the global context. -func VPSRLQ(imx, xy, xy1 operand.Op) { ctx.VPSRLQ(imx, xy, xy1) } - -// VPSRLVD: Variable Shift Packed Doubleword Data Right Logical. -// -// Forms: -// -// VPSRLVD xmm xmm xmm -// VPSRLVD m128 xmm xmm -// VPSRLVD ymm ymm ymm -// VPSRLVD m256 ymm ymm -// Construct and append a VPSRLVD instruction to the active function. -func (c *Context) VPSRLVD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSRLVD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSRLVD: Variable Shift Packed Doubleword Data Right Logical. -// -// Forms: -// -// VPSRLVD xmm xmm xmm -// VPSRLVD m128 xmm xmm -// VPSRLVD ymm ymm ymm -// VPSRLVD m256 ymm ymm -// Construct and append a VPSRLVD instruction to the active function. -// Operates on the global context. -func VPSRLVD(mxy, xy, xy1 operand.Op) { ctx.VPSRLVD(mxy, xy, xy1) } - -// VPSRLVQ: Variable Shift Packed Quadword Data Right Logical. -// -// Forms: -// -// VPSRLVQ xmm xmm xmm -// VPSRLVQ m128 xmm xmm -// VPSRLVQ ymm ymm ymm -// VPSRLVQ m256 ymm ymm -// Construct and append a VPSRLVQ instruction to the active function. -func (c *Context) VPSRLVQ(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSRLVQ(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSRLVQ: Variable Shift Packed Quadword Data Right Logical. -// -// Forms: -// -// VPSRLVQ xmm xmm xmm -// VPSRLVQ m128 xmm xmm -// VPSRLVQ ymm ymm ymm -// VPSRLVQ m256 ymm ymm -// Construct and append a VPSRLVQ instruction to the active function. -// Operates on the global context. -func VPSRLVQ(mxy, xy, xy1 operand.Op) { ctx.VPSRLVQ(mxy, xy, xy1) } - -// VPSRLW: Shift Packed Word Data Right Logical. -// -// Forms: -// -// VPSRLW imm8 xmm xmm -// VPSRLW xmm xmm xmm -// VPSRLW m128 xmm xmm -// VPSRLW imm8 ymm ymm -// VPSRLW xmm ymm ymm -// VPSRLW m128 ymm ymm -// Construct and append a VPSRLW instruction to the active function. -func (c *Context) VPSRLW(imx, xy, xy1 operand.Op) { - if inst, err := x86.VPSRLW(imx, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSRLW: Shift Packed Word Data Right Logical. -// -// Forms: -// -// VPSRLW imm8 xmm xmm -// VPSRLW xmm xmm xmm -// VPSRLW m128 xmm xmm -// VPSRLW imm8 ymm ymm -// VPSRLW xmm ymm ymm -// VPSRLW m128 ymm ymm -// Construct and append a VPSRLW instruction to the active function. -// Operates on the global context. -func VPSRLW(imx, xy, xy1 operand.Op) { ctx.VPSRLW(imx, xy, xy1) } - -// VPSUBB: Subtract Packed Byte Integers. -// -// Forms: -// -// VPSUBB xmm xmm xmm -// VPSUBB m128 xmm xmm -// VPSUBB ymm ymm ymm -// VPSUBB m256 ymm ymm -// Construct and append a VPSUBB instruction to the active function. -func (c *Context) VPSUBB(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSUBB(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSUBB: Subtract Packed Byte Integers. -// -// Forms: -// -// VPSUBB xmm xmm xmm -// VPSUBB m128 xmm xmm -// VPSUBB ymm ymm ymm -// VPSUBB m256 ymm ymm -// Construct and append a VPSUBB instruction to the active function. -// Operates on the global context. -func VPSUBB(mxy, xy, xy1 operand.Op) { ctx.VPSUBB(mxy, xy, xy1) } - -// VPSUBD: Subtract Packed Doubleword Integers. -// -// Forms: -// -// VPSUBD xmm xmm xmm -// VPSUBD m128 xmm xmm -// VPSUBD ymm ymm ymm -// VPSUBD m256 ymm ymm -// Construct and append a VPSUBD instruction to the active function. -func (c *Context) VPSUBD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSUBD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSUBD: Subtract Packed Doubleword Integers. -// -// Forms: -// -// VPSUBD xmm xmm xmm -// VPSUBD m128 xmm xmm -// VPSUBD ymm ymm ymm -// VPSUBD m256 ymm ymm -// Construct and append a VPSUBD instruction to the active function. -// Operates on the global context. -func VPSUBD(mxy, xy, xy1 operand.Op) { ctx.VPSUBD(mxy, xy, xy1) } - -// VPSUBQ: Subtract Packed Quadword Integers. -// -// Forms: -// -// VPSUBQ xmm xmm xmm -// VPSUBQ m128 xmm xmm -// VPSUBQ ymm ymm ymm -// VPSUBQ m256 ymm ymm -// Construct and append a VPSUBQ instruction to the active function. -func (c *Context) VPSUBQ(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSUBQ(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSUBQ: Subtract Packed Quadword Integers. -// -// Forms: -// -// VPSUBQ xmm xmm xmm -// VPSUBQ m128 xmm xmm -// VPSUBQ ymm ymm ymm -// VPSUBQ m256 ymm ymm -// Construct and append a VPSUBQ instruction to the active function. -// Operates on the global context. -func VPSUBQ(mxy, xy, xy1 operand.Op) { ctx.VPSUBQ(mxy, xy, xy1) } - -// VPSUBSB: Subtract Packed Signed Byte Integers with Signed Saturation. -// -// Forms: -// -// VPSUBSB xmm xmm xmm -// VPSUBSB m128 xmm xmm -// VPSUBSB ymm ymm ymm -// VPSUBSB m256 ymm ymm -// Construct and append a VPSUBSB instruction to the active function. -func (c *Context) VPSUBSB(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSUBSB(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSUBSB: Subtract Packed Signed Byte Integers with Signed Saturation. -// -// Forms: -// -// VPSUBSB xmm xmm xmm -// VPSUBSB m128 xmm xmm -// VPSUBSB ymm ymm ymm -// VPSUBSB m256 ymm ymm -// Construct and append a VPSUBSB instruction to the active function. -// Operates on the global context. -func VPSUBSB(mxy, xy, xy1 operand.Op) { ctx.VPSUBSB(mxy, xy, xy1) } - -// VPSUBSW: Subtract Packed Signed Word Integers with Signed Saturation. -// -// Forms: -// -// VPSUBSW xmm xmm xmm -// VPSUBSW m128 xmm xmm -// VPSUBSW ymm ymm ymm -// VPSUBSW m256 ymm ymm -// Construct and append a VPSUBSW instruction to the active function. -func (c *Context) VPSUBSW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSUBSW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSUBSW: Subtract Packed Signed Word Integers with Signed Saturation. -// -// Forms: -// -// VPSUBSW xmm xmm xmm -// VPSUBSW m128 xmm xmm -// VPSUBSW ymm ymm ymm -// VPSUBSW m256 ymm ymm -// Construct and append a VPSUBSW instruction to the active function. -// Operates on the global context. -func VPSUBSW(mxy, xy, xy1 operand.Op) { ctx.VPSUBSW(mxy, xy, xy1) } - -// VPSUBUSB: Subtract Packed Unsigned Byte Integers with Unsigned Saturation. -// -// Forms: -// -// VPSUBUSB xmm xmm xmm -// VPSUBUSB m128 xmm xmm -// VPSUBUSB ymm ymm ymm -// VPSUBUSB m256 ymm ymm -// Construct and append a VPSUBUSB instruction to the active function. -func (c *Context) VPSUBUSB(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSUBUSB(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSUBUSB: Subtract Packed Unsigned Byte Integers with Unsigned Saturation. -// -// Forms: -// -// VPSUBUSB xmm xmm xmm -// VPSUBUSB m128 xmm xmm -// VPSUBUSB ymm ymm ymm -// VPSUBUSB m256 ymm ymm -// Construct and append a VPSUBUSB instruction to the active function. -// Operates on the global context. -func VPSUBUSB(mxy, xy, xy1 operand.Op) { ctx.VPSUBUSB(mxy, xy, xy1) } - -// VPSUBUSW: Subtract Packed Unsigned Word Integers with Unsigned Saturation. -// -// Forms: -// -// VPSUBUSW xmm xmm xmm -// VPSUBUSW m128 xmm xmm -// VPSUBUSW ymm ymm ymm -// VPSUBUSW m256 ymm ymm -// Construct and append a VPSUBUSW instruction to the active function. -func (c *Context) VPSUBUSW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSUBUSW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSUBUSW: Subtract Packed Unsigned Word Integers with Unsigned Saturation. -// -// Forms: -// -// VPSUBUSW xmm xmm xmm -// VPSUBUSW m128 xmm xmm -// VPSUBUSW ymm ymm ymm -// VPSUBUSW m256 ymm ymm -// Construct and append a VPSUBUSW instruction to the active function. -// Operates on the global context. -func VPSUBUSW(mxy, xy, xy1 operand.Op) { ctx.VPSUBUSW(mxy, xy, xy1) } - -// VPSUBW: Subtract Packed Word Integers. -// -// Forms: -// -// VPSUBW xmm xmm xmm -// VPSUBW m128 xmm xmm -// VPSUBW ymm ymm ymm -// VPSUBW m256 ymm ymm -// Construct and append a VPSUBW instruction to the active function. -func (c *Context) VPSUBW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPSUBW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPSUBW: Subtract Packed Word Integers. -// -// Forms: -// -// VPSUBW xmm xmm xmm -// VPSUBW m128 xmm xmm -// VPSUBW ymm ymm ymm -// VPSUBW m256 ymm ymm -// Construct and append a VPSUBW instruction to the active function. -// Operates on the global context. -func VPSUBW(mxy, xy, xy1 operand.Op) { ctx.VPSUBW(mxy, xy, xy1) } - -// VPTEST: Packed Logical Compare. -// -// Forms: -// -// VPTEST xmm xmm -// VPTEST m128 xmm -// VPTEST ymm ymm -// VPTEST m256 ymm -// Construct and append a VPTEST instruction to the active function. -func (c *Context) VPTEST(mxy, xy operand.Op) { - if inst, err := x86.VPTEST(mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPTEST: Packed Logical Compare. -// -// Forms: -// -// VPTEST xmm xmm -// VPTEST m128 xmm -// VPTEST ymm ymm -// VPTEST m256 ymm -// Construct and append a VPTEST instruction to the active function. -// Operates on the global context. -func VPTEST(mxy, xy operand.Op) { ctx.VPTEST(mxy, xy) } - -// VPUNPCKHBW: Unpack and Interleave High-Order Bytes into Words. -// -// Forms: -// -// VPUNPCKHBW xmm xmm xmm -// VPUNPCKHBW m128 xmm xmm -// VPUNPCKHBW ymm ymm ymm -// VPUNPCKHBW m256 ymm ymm -// Construct and append a VPUNPCKHBW instruction to the active function. -func (c *Context) VPUNPCKHBW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPUNPCKHBW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPUNPCKHBW: Unpack and Interleave High-Order Bytes into Words. -// -// Forms: -// -// VPUNPCKHBW xmm xmm xmm -// VPUNPCKHBW m128 xmm xmm -// VPUNPCKHBW ymm ymm ymm -// VPUNPCKHBW m256 ymm ymm -// Construct and append a VPUNPCKHBW instruction to the active function. -// Operates on the global context. -func VPUNPCKHBW(mxy, xy, xy1 operand.Op) { ctx.VPUNPCKHBW(mxy, xy, xy1) } - -// VPUNPCKHDQ: Unpack and Interleave High-Order Doublewords into Quadwords. -// -// Forms: -// -// VPUNPCKHDQ xmm xmm xmm -// VPUNPCKHDQ m128 xmm xmm -// VPUNPCKHDQ ymm ymm ymm -// VPUNPCKHDQ m256 ymm ymm -// Construct and append a VPUNPCKHDQ instruction to the active function. -func (c *Context) VPUNPCKHDQ(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPUNPCKHDQ(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPUNPCKHDQ: Unpack and Interleave High-Order Doublewords into Quadwords. -// -// Forms: -// -// VPUNPCKHDQ xmm xmm xmm -// VPUNPCKHDQ m128 xmm xmm -// VPUNPCKHDQ ymm ymm ymm -// VPUNPCKHDQ m256 ymm ymm -// Construct and append a VPUNPCKHDQ instruction to the active function. -// Operates on the global context. -func VPUNPCKHDQ(mxy, xy, xy1 operand.Op) { ctx.VPUNPCKHDQ(mxy, xy, xy1) } - -// VPUNPCKHQDQ: Unpack and Interleave High-Order Quadwords into Double Quadwords. -// -// Forms: -// -// VPUNPCKHQDQ xmm xmm xmm -// VPUNPCKHQDQ m128 xmm xmm -// VPUNPCKHQDQ ymm ymm ymm -// VPUNPCKHQDQ m256 ymm ymm -// Construct and append a VPUNPCKHQDQ instruction to the active function. -func (c *Context) VPUNPCKHQDQ(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPUNPCKHQDQ(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPUNPCKHQDQ: Unpack and Interleave High-Order Quadwords into Double Quadwords. -// -// Forms: -// -// VPUNPCKHQDQ xmm xmm xmm -// VPUNPCKHQDQ m128 xmm xmm -// VPUNPCKHQDQ ymm ymm ymm -// VPUNPCKHQDQ m256 ymm ymm -// Construct and append a VPUNPCKHQDQ instruction to the active function. -// Operates on the global context. -func VPUNPCKHQDQ(mxy, xy, xy1 operand.Op) { ctx.VPUNPCKHQDQ(mxy, xy, xy1) } - -// VPUNPCKHWD: Unpack and Interleave High-Order Words into Doublewords. -// -// Forms: -// -// VPUNPCKHWD xmm xmm xmm -// VPUNPCKHWD m128 xmm xmm -// VPUNPCKHWD ymm ymm ymm -// VPUNPCKHWD m256 ymm ymm -// Construct and append a VPUNPCKHWD instruction to the active function. -func (c *Context) VPUNPCKHWD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPUNPCKHWD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPUNPCKHWD: Unpack and Interleave High-Order Words into Doublewords. -// -// Forms: -// -// VPUNPCKHWD xmm xmm xmm -// VPUNPCKHWD m128 xmm xmm -// VPUNPCKHWD ymm ymm ymm -// VPUNPCKHWD m256 ymm ymm -// Construct and append a VPUNPCKHWD instruction to the active function. -// Operates on the global context. -func VPUNPCKHWD(mxy, xy, xy1 operand.Op) { ctx.VPUNPCKHWD(mxy, xy, xy1) } - -// VPUNPCKLBW: Unpack and Interleave Low-Order Bytes into Words. -// -// Forms: -// -// VPUNPCKLBW xmm xmm xmm -// VPUNPCKLBW m128 xmm xmm -// VPUNPCKLBW ymm ymm ymm -// VPUNPCKLBW m256 ymm ymm -// Construct and append a VPUNPCKLBW instruction to the active function. -func (c *Context) VPUNPCKLBW(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPUNPCKLBW(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPUNPCKLBW: Unpack and Interleave Low-Order Bytes into Words. -// -// Forms: -// -// VPUNPCKLBW xmm xmm xmm -// VPUNPCKLBW m128 xmm xmm -// VPUNPCKLBW ymm ymm ymm -// VPUNPCKLBW m256 ymm ymm -// Construct and append a VPUNPCKLBW instruction to the active function. -// Operates on the global context. -func VPUNPCKLBW(mxy, xy, xy1 operand.Op) { ctx.VPUNPCKLBW(mxy, xy, xy1) } - -// VPUNPCKLDQ: Unpack and Interleave Low-Order Doublewords into Quadwords. -// -// Forms: -// -// VPUNPCKLDQ xmm xmm xmm -// VPUNPCKLDQ m128 xmm xmm -// VPUNPCKLDQ ymm ymm ymm -// VPUNPCKLDQ m256 ymm ymm -// Construct and append a VPUNPCKLDQ instruction to the active function. -func (c *Context) VPUNPCKLDQ(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPUNPCKLDQ(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPUNPCKLDQ: Unpack and Interleave Low-Order Doublewords into Quadwords. -// -// Forms: -// -// VPUNPCKLDQ xmm xmm xmm -// VPUNPCKLDQ m128 xmm xmm -// VPUNPCKLDQ ymm ymm ymm -// VPUNPCKLDQ m256 ymm ymm -// Construct and append a VPUNPCKLDQ instruction to the active function. -// Operates on the global context. -func VPUNPCKLDQ(mxy, xy, xy1 operand.Op) { ctx.VPUNPCKLDQ(mxy, xy, xy1) } - -// VPUNPCKLQDQ: Unpack and Interleave Low-Order Quadwords into Double Quadwords. -// -// Forms: -// -// VPUNPCKLQDQ xmm xmm xmm -// VPUNPCKLQDQ m128 xmm xmm -// VPUNPCKLQDQ ymm ymm ymm -// VPUNPCKLQDQ m256 ymm ymm -// Construct and append a VPUNPCKLQDQ instruction to the active function. -func (c *Context) VPUNPCKLQDQ(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPUNPCKLQDQ(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPUNPCKLQDQ: Unpack and Interleave Low-Order Quadwords into Double Quadwords. -// -// Forms: -// -// VPUNPCKLQDQ xmm xmm xmm -// VPUNPCKLQDQ m128 xmm xmm -// VPUNPCKLQDQ ymm ymm ymm -// VPUNPCKLQDQ m256 ymm ymm -// Construct and append a VPUNPCKLQDQ instruction to the active function. -// Operates on the global context. -func VPUNPCKLQDQ(mxy, xy, xy1 operand.Op) { ctx.VPUNPCKLQDQ(mxy, xy, xy1) } - -// VPUNPCKLWD: Unpack and Interleave Low-Order Words into Doublewords. -// -// Forms: -// -// VPUNPCKLWD xmm xmm xmm -// VPUNPCKLWD m128 xmm xmm -// VPUNPCKLWD ymm ymm ymm -// VPUNPCKLWD m256 ymm ymm -// Construct and append a VPUNPCKLWD instruction to the active function. -func (c *Context) VPUNPCKLWD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPUNPCKLWD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPUNPCKLWD: Unpack and Interleave Low-Order Words into Doublewords. -// -// Forms: -// -// VPUNPCKLWD xmm xmm xmm -// VPUNPCKLWD m128 xmm xmm -// VPUNPCKLWD ymm ymm ymm -// VPUNPCKLWD m256 ymm ymm -// Construct and append a VPUNPCKLWD instruction to the active function. -// Operates on the global context. -func VPUNPCKLWD(mxy, xy, xy1 operand.Op) { ctx.VPUNPCKLWD(mxy, xy, xy1) } - -// VPXOR: Packed Bitwise Logical Exclusive OR. -// -// Forms: -// -// VPXOR xmm xmm xmm -// VPXOR m128 xmm xmm -// VPXOR ymm ymm ymm -// VPXOR m256 ymm ymm -// Construct and append a VPXOR instruction to the active function. -func (c *Context) VPXOR(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VPXOR(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VPXOR: Packed Bitwise Logical Exclusive OR. -// -// Forms: -// -// VPXOR xmm xmm xmm -// VPXOR m128 xmm xmm -// VPXOR ymm ymm ymm -// VPXOR m256 ymm ymm -// Construct and append a VPXOR instruction to the active function. -// Operates on the global context. -func VPXOR(mxy, xy, xy1 operand.Op) { ctx.VPXOR(mxy, xy, xy1) } - -// VRCPPS: Compute Approximate Reciprocals of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VRCPPS xmm xmm -// VRCPPS m128 xmm -// VRCPPS ymm ymm -// VRCPPS m256 ymm -// Construct and append a VRCPPS instruction to the active function. -func (c *Context) VRCPPS(mxy, xy operand.Op) { - if inst, err := x86.VRCPPS(mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VRCPPS: Compute Approximate Reciprocals of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VRCPPS xmm xmm -// VRCPPS m128 xmm -// VRCPPS ymm ymm -// VRCPPS m256 ymm -// Construct and append a VRCPPS instruction to the active function. -// Operates on the global context. -func VRCPPS(mxy, xy operand.Op) { ctx.VRCPPS(mxy, xy) } - -// VRCPSS: Compute Approximate Reciprocal of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VRCPSS xmm xmm xmm -// VRCPSS m32 xmm xmm -// Construct and append a VRCPSS instruction to the active function. -func (c *Context) VRCPSS(mx, x, x1 operand.Op) { - if inst, err := x86.VRCPSS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VRCPSS: Compute Approximate Reciprocal of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VRCPSS xmm xmm xmm -// VRCPSS m32 xmm xmm -// Construct and append a VRCPSS instruction to the active function. -// Operates on the global context. -func VRCPSS(mx, x, x1 operand.Op) { ctx.VRCPSS(mx, x, x1) } - -// VROUNDPD: Round Packed Double Precision Floating-Point Values. -// -// Forms: -// -// VROUNDPD imm8 xmm xmm -// VROUNDPD imm8 m128 xmm -// VROUNDPD imm8 ymm ymm -// VROUNDPD imm8 m256 ymm -// Construct and append a VROUNDPD instruction to the active function. -func (c *Context) VROUNDPD(i, mxy, xy operand.Op) { - if inst, err := x86.VROUNDPD(i, mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VROUNDPD: Round Packed Double Precision Floating-Point Values. -// -// Forms: -// -// VROUNDPD imm8 xmm xmm -// VROUNDPD imm8 m128 xmm -// VROUNDPD imm8 ymm ymm -// VROUNDPD imm8 m256 ymm -// Construct and append a VROUNDPD instruction to the active function. -// Operates on the global context. -func VROUNDPD(i, mxy, xy operand.Op) { ctx.VROUNDPD(i, mxy, xy) } - -// VROUNDPS: Round Packed Single Precision Floating-Point Values. -// -// Forms: -// -// VROUNDPS imm8 xmm xmm -// VROUNDPS imm8 m128 xmm -// VROUNDPS imm8 ymm ymm -// VROUNDPS imm8 m256 ymm -// Construct and append a VROUNDPS instruction to the active function. -func (c *Context) VROUNDPS(i, mxy, xy operand.Op) { - if inst, err := x86.VROUNDPS(i, mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VROUNDPS: Round Packed Single Precision Floating-Point Values. -// -// Forms: -// -// VROUNDPS imm8 xmm xmm -// VROUNDPS imm8 m128 xmm -// VROUNDPS imm8 ymm ymm -// VROUNDPS imm8 m256 ymm -// Construct and append a VROUNDPS instruction to the active function. -// Operates on the global context. -func VROUNDPS(i, mxy, xy operand.Op) { ctx.VROUNDPS(i, mxy, xy) } - -// VROUNDSD: Round Scalar Double Precision Floating-Point Values. -// -// Forms: -// -// VROUNDSD imm8 xmm xmm xmm -// VROUNDSD imm8 m64 xmm xmm -// Construct and append a VROUNDSD instruction to the active function. -func (c *Context) VROUNDSD(i, mx, x, x1 operand.Op) { - if inst, err := x86.VROUNDSD(i, mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VROUNDSD: Round Scalar Double Precision Floating-Point Values. -// -// Forms: -// -// VROUNDSD imm8 xmm xmm xmm -// VROUNDSD imm8 m64 xmm xmm -// Construct and append a VROUNDSD instruction to the active function. -// Operates on the global context. -func VROUNDSD(i, mx, x, x1 operand.Op) { ctx.VROUNDSD(i, mx, x, x1) } - -// VROUNDSS: Round Scalar Single Precision Floating-Point Values. -// -// Forms: -// -// VROUNDSS imm8 xmm xmm xmm -// VROUNDSS imm8 m32 xmm xmm -// Construct and append a VROUNDSS instruction to the active function. -func (c *Context) VROUNDSS(i, mx, x, x1 operand.Op) { - if inst, err := x86.VROUNDSS(i, mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VROUNDSS: Round Scalar Single Precision Floating-Point Values. -// -// Forms: -// -// VROUNDSS imm8 xmm xmm xmm -// VROUNDSS imm8 m32 xmm xmm -// Construct and append a VROUNDSS instruction to the active function. -// Operates on the global context. -func VROUNDSS(i, mx, x, x1 operand.Op) { ctx.VROUNDSS(i, mx, x, x1) } - -// VRSQRTPS: Compute Reciprocals of Square Roots of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VRSQRTPS xmm xmm -// VRSQRTPS m128 xmm -// VRSQRTPS ymm ymm -// VRSQRTPS m256 ymm -// Construct and append a VRSQRTPS instruction to the active function. -func (c *Context) VRSQRTPS(mxy, xy operand.Op) { - if inst, err := x86.VRSQRTPS(mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VRSQRTPS: Compute Reciprocals of Square Roots of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VRSQRTPS xmm xmm -// VRSQRTPS m128 xmm -// VRSQRTPS ymm ymm -// VRSQRTPS m256 ymm -// Construct and append a VRSQRTPS instruction to the active function. -// Operates on the global context. -func VRSQRTPS(mxy, xy operand.Op) { ctx.VRSQRTPS(mxy, xy) } - -// VRSQRTSS: Compute Reciprocal of Square Root of Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// VRSQRTSS xmm xmm xmm -// VRSQRTSS m32 xmm xmm -// Construct and append a VRSQRTSS instruction to the active function. -func (c *Context) VRSQRTSS(mx, x, x1 operand.Op) { - if inst, err := x86.VRSQRTSS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VRSQRTSS: Compute Reciprocal of Square Root of Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// VRSQRTSS xmm xmm xmm -// VRSQRTSS m32 xmm xmm -// Construct and append a VRSQRTSS instruction to the active function. -// Operates on the global context. -func VRSQRTSS(mx, x, x1 operand.Op) { ctx.VRSQRTSS(mx, x, x1) } - -// VSHUFPD: Shuffle Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VSHUFPD imm8 xmm xmm xmm -// VSHUFPD imm8 m128 xmm xmm -// VSHUFPD imm8 ymm ymm ymm -// VSHUFPD imm8 m256 ymm ymm -// Construct and append a VSHUFPD instruction to the active function. -func (c *Context) VSHUFPD(i, mxy, xy, xy1 operand.Op) { - if inst, err := x86.VSHUFPD(i, mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VSHUFPD: Shuffle Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VSHUFPD imm8 xmm xmm xmm -// VSHUFPD imm8 m128 xmm xmm -// VSHUFPD imm8 ymm ymm ymm -// VSHUFPD imm8 m256 ymm ymm -// Construct and append a VSHUFPD instruction to the active function. -// Operates on the global context. -func VSHUFPD(i, mxy, xy, xy1 operand.Op) { ctx.VSHUFPD(i, mxy, xy, xy1) } - -// VSHUFPS: Shuffle Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VSHUFPS imm8 xmm xmm xmm -// VSHUFPS imm8 m128 xmm xmm -// VSHUFPS imm8 ymm ymm ymm -// VSHUFPS imm8 m256 ymm ymm -// Construct and append a VSHUFPS instruction to the active function. -func (c *Context) VSHUFPS(i, mxy, xy, xy1 operand.Op) { - if inst, err := x86.VSHUFPS(i, mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VSHUFPS: Shuffle Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VSHUFPS imm8 xmm xmm xmm -// VSHUFPS imm8 m128 xmm xmm -// VSHUFPS imm8 ymm ymm ymm -// VSHUFPS imm8 m256 ymm ymm -// Construct and append a VSHUFPS instruction to the active function. -// Operates on the global context. -func VSHUFPS(i, mxy, xy, xy1 operand.Op) { ctx.VSHUFPS(i, mxy, xy, xy1) } - -// VSQRTPD: Compute Square Roots of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VSQRTPD xmm xmm -// VSQRTPD m128 xmm -// VSQRTPD ymm ymm -// VSQRTPD m256 ymm -// Construct and append a VSQRTPD instruction to the active function. -func (c *Context) VSQRTPD(mxy, xy operand.Op) { - if inst, err := x86.VSQRTPD(mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VSQRTPD: Compute Square Roots of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VSQRTPD xmm xmm -// VSQRTPD m128 xmm -// VSQRTPD ymm ymm -// VSQRTPD m256 ymm -// Construct and append a VSQRTPD instruction to the active function. -// Operates on the global context. -func VSQRTPD(mxy, xy operand.Op) { ctx.VSQRTPD(mxy, xy) } - -// VSQRTPS: Compute Square Roots of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VSQRTPS xmm xmm -// VSQRTPS m128 xmm -// VSQRTPS ymm ymm -// VSQRTPS m256 ymm -// Construct and append a VSQRTPS instruction to the active function. -func (c *Context) VSQRTPS(mxy, xy operand.Op) { - if inst, err := x86.VSQRTPS(mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VSQRTPS: Compute Square Roots of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VSQRTPS xmm xmm -// VSQRTPS m128 xmm -// VSQRTPS ymm ymm -// VSQRTPS m256 ymm -// Construct and append a VSQRTPS instruction to the active function. -// Operates on the global context. -func VSQRTPS(mxy, xy operand.Op) { ctx.VSQRTPS(mxy, xy) } - -// VSQRTSD: Compute Square Root of Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// VSQRTSD xmm xmm xmm -// VSQRTSD m64 xmm xmm -// Construct and append a VSQRTSD instruction to the active function. -func (c *Context) VSQRTSD(mx, x, x1 operand.Op) { - if inst, err := x86.VSQRTSD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VSQRTSD: Compute Square Root of Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// VSQRTSD xmm xmm xmm -// VSQRTSD m64 xmm xmm -// Construct and append a VSQRTSD instruction to the active function. -// Operates on the global context. -func VSQRTSD(mx, x, x1 operand.Op) { ctx.VSQRTSD(mx, x, x1) } - -// VSQRTSS: Compute Square Root of Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// VSQRTSS xmm xmm xmm -// VSQRTSS m32 xmm xmm -// Construct and append a VSQRTSS instruction to the active function. -func (c *Context) VSQRTSS(mx, x, x1 operand.Op) { - if inst, err := x86.VSQRTSS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VSQRTSS: Compute Square Root of Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// VSQRTSS xmm xmm xmm -// VSQRTSS m32 xmm xmm -// Construct and append a VSQRTSS instruction to the active function. -// Operates on the global context. -func VSQRTSS(mx, x, x1 operand.Op) { ctx.VSQRTSS(mx, x, x1) } - -// VSTMXCSR: Store MXCSR Register State. -// -// Forms: -// -// VSTMXCSR m32 -// Construct and append a VSTMXCSR instruction to the active function. -func (c *Context) VSTMXCSR(m operand.Op) { - if inst, err := x86.VSTMXCSR(m); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VSTMXCSR: Store MXCSR Register State. -// -// Forms: -// -// VSTMXCSR m32 -// Construct and append a VSTMXCSR instruction to the active function. -// Operates on the global context. -func VSTMXCSR(m operand.Op) { ctx.VSTMXCSR(m) } - -// VSUBPD: Subtract Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VSUBPD xmm xmm xmm -// VSUBPD m128 xmm xmm -// VSUBPD ymm ymm ymm -// VSUBPD m256 ymm ymm -// Construct and append a VSUBPD instruction to the active function. -func (c *Context) VSUBPD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VSUBPD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VSUBPD: Subtract Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VSUBPD xmm xmm xmm -// VSUBPD m128 xmm xmm -// VSUBPD ymm ymm ymm -// VSUBPD m256 ymm ymm -// Construct and append a VSUBPD instruction to the active function. -// Operates on the global context. -func VSUBPD(mxy, xy, xy1 operand.Op) { ctx.VSUBPD(mxy, xy, xy1) } - -// VSUBPS: Subtract Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VSUBPS xmm xmm xmm -// VSUBPS m128 xmm xmm -// VSUBPS ymm ymm ymm -// VSUBPS m256 ymm ymm -// Construct and append a VSUBPS instruction to the active function. -func (c *Context) VSUBPS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VSUBPS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VSUBPS: Subtract Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VSUBPS xmm xmm xmm -// VSUBPS m128 xmm xmm -// VSUBPS ymm ymm ymm -// VSUBPS m256 ymm ymm -// Construct and append a VSUBPS instruction to the active function. -// Operates on the global context. -func VSUBPS(mxy, xy, xy1 operand.Op) { ctx.VSUBPS(mxy, xy, xy1) } - -// VSUBSD: Subtract Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VSUBSD xmm xmm xmm -// VSUBSD m64 xmm xmm -// Construct and append a VSUBSD instruction to the active function. -func (c *Context) VSUBSD(mx, x, x1 operand.Op) { - if inst, err := x86.VSUBSD(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VSUBSD: Subtract Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VSUBSD xmm xmm xmm -// VSUBSD m64 xmm xmm -// Construct and append a VSUBSD instruction to the active function. -// Operates on the global context. -func VSUBSD(mx, x, x1 operand.Op) { ctx.VSUBSD(mx, x, x1) } - -// VSUBSS: Subtract Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VSUBSS xmm xmm xmm -// VSUBSS m32 xmm xmm -// Construct and append a VSUBSS instruction to the active function. -func (c *Context) VSUBSS(mx, x, x1 operand.Op) { - if inst, err := x86.VSUBSS(mx, x, x1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VSUBSS: Subtract Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VSUBSS xmm xmm xmm -// VSUBSS m32 xmm xmm -// Construct and append a VSUBSS instruction to the active function. -// Operates on the global context. -func VSUBSS(mx, x, x1 operand.Op) { ctx.VSUBSS(mx, x, x1) } - -// VTESTPD: Packed Double-Precision Floating-Point Bit Test. -// -// Forms: -// -// VTESTPD xmm xmm -// VTESTPD m128 xmm -// VTESTPD ymm ymm -// VTESTPD m256 ymm -// Construct and append a VTESTPD instruction to the active function. -func (c *Context) VTESTPD(mxy, xy operand.Op) { - if inst, err := x86.VTESTPD(mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VTESTPD: Packed Double-Precision Floating-Point Bit Test. -// -// Forms: -// -// VTESTPD xmm xmm -// VTESTPD m128 xmm -// VTESTPD ymm ymm -// VTESTPD m256 ymm -// Construct and append a VTESTPD instruction to the active function. -// Operates on the global context. -func VTESTPD(mxy, xy operand.Op) { ctx.VTESTPD(mxy, xy) } - -// VTESTPS: Packed Single-Precision Floating-Point Bit Test. -// -// Forms: -// -// VTESTPS xmm xmm -// VTESTPS m128 xmm -// VTESTPS ymm ymm -// VTESTPS m256 ymm -// Construct and append a VTESTPS instruction to the active function. -func (c *Context) VTESTPS(mxy, xy operand.Op) { - if inst, err := x86.VTESTPS(mxy, xy); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VTESTPS: Packed Single-Precision Floating-Point Bit Test. -// -// Forms: -// -// VTESTPS xmm xmm -// VTESTPS m128 xmm -// VTESTPS ymm ymm -// VTESTPS m256 ymm -// Construct and append a VTESTPS instruction to the active function. -// Operates on the global context. -func VTESTPS(mxy, xy operand.Op) { ctx.VTESTPS(mxy, xy) } - -// VUCOMISD: Unordered Compare Scalar Double-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// VUCOMISD xmm xmm -// VUCOMISD m64 xmm -// Construct and append a VUCOMISD instruction to the active function. -func (c *Context) VUCOMISD(mx, x operand.Op) { - if inst, err := x86.VUCOMISD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VUCOMISD: Unordered Compare Scalar Double-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// VUCOMISD xmm xmm -// VUCOMISD m64 xmm -// Construct and append a VUCOMISD instruction to the active function. -// Operates on the global context. -func VUCOMISD(mx, x operand.Op) { ctx.VUCOMISD(mx, x) } - -// VUCOMISS: Unordered Compare Scalar Single-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// VUCOMISS xmm xmm -// VUCOMISS m32 xmm -// Construct and append a VUCOMISS instruction to the active function. -func (c *Context) VUCOMISS(mx, x operand.Op) { - if inst, err := x86.VUCOMISS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VUCOMISS: Unordered Compare Scalar Single-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// VUCOMISS xmm xmm -// VUCOMISS m32 xmm -// Construct and append a VUCOMISS instruction to the active function. -// Operates on the global context. -func VUCOMISS(mx, x operand.Op) { ctx.VUCOMISS(mx, x) } - -// VUNPCKHPD: Unpack and Interleave High Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VUNPCKHPD xmm xmm xmm -// VUNPCKHPD m128 xmm xmm -// VUNPCKHPD ymm ymm ymm -// VUNPCKHPD m256 ymm ymm -// Construct and append a VUNPCKHPD instruction to the active function. -func (c *Context) VUNPCKHPD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VUNPCKHPD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VUNPCKHPD: Unpack and Interleave High Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VUNPCKHPD xmm xmm xmm -// VUNPCKHPD m128 xmm xmm -// VUNPCKHPD ymm ymm ymm -// VUNPCKHPD m256 ymm ymm -// Construct and append a VUNPCKHPD instruction to the active function. -// Operates on the global context. -func VUNPCKHPD(mxy, xy, xy1 operand.Op) { ctx.VUNPCKHPD(mxy, xy, xy1) } - -// VUNPCKHPS: Unpack and Interleave High Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VUNPCKHPS xmm xmm xmm -// VUNPCKHPS m128 xmm xmm -// VUNPCKHPS ymm ymm ymm -// VUNPCKHPS m256 ymm ymm -// Construct and append a VUNPCKHPS instruction to the active function. -func (c *Context) VUNPCKHPS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VUNPCKHPS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VUNPCKHPS: Unpack and Interleave High Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VUNPCKHPS xmm xmm xmm -// VUNPCKHPS m128 xmm xmm -// VUNPCKHPS ymm ymm ymm -// VUNPCKHPS m256 ymm ymm -// Construct and append a VUNPCKHPS instruction to the active function. -// Operates on the global context. -func VUNPCKHPS(mxy, xy, xy1 operand.Op) { ctx.VUNPCKHPS(mxy, xy, xy1) } - -// VUNPCKLPD: Unpack and Interleave Low Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VUNPCKLPD xmm xmm xmm -// VUNPCKLPD m128 xmm xmm -// VUNPCKLPD ymm ymm ymm -// VUNPCKLPD m256 ymm ymm -// Construct and append a VUNPCKLPD instruction to the active function. -func (c *Context) VUNPCKLPD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VUNPCKLPD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VUNPCKLPD: Unpack and Interleave Low Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VUNPCKLPD xmm xmm xmm -// VUNPCKLPD m128 xmm xmm -// VUNPCKLPD ymm ymm ymm -// VUNPCKLPD m256 ymm ymm -// Construct and append a VUNPCKLPD instruction to the active function. -// Operates on the global context. -func VUNPCKLPD(mxy, xy, xy1 operand.Op) { ctx.VUNPCKLPD(mxy, xy, xy1) } - -// VUNPCKLPS: Unpack and Interleave Low Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VUNPCKLPS xmm xmm xmm -// VUNPCKLPS m128 xmm xmm -// VUNPCKLPS ymm ymm ymm -// VUNPCKLPS m256 ymm ymm -// Construct and append a VUNPCKLPS instruction to the active function. -func (c *Context) VUNPCKLPS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VUNPCKLPS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VUNPCKLPS: Unpack and Interleave Low Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VUNPCKLPS xmm xmm xmm -// VUNPCKLPS m128 xmm xmm -// VUNPCKLPS ymm ymm ymm -// VUNPCKLPS m256 ymm ymm -// Construct and append a VUNPCKLPS instruction to the active function. -// Operates on the global context. -func VUNPCKLPS(mxy, xy, xy1 operand.Op) { ctx.VUNPCKLPS(mxy, xy, xy1) } - -// VXORPD: Bitwise Logical XOR for Double-Precision Floating-Point Values. -// -// Forms: -// -// VXORPD xmm xmm xmm -// VXORPD m128 xmm xmm -// VXORPD ymm ymm ymm -// VXORPD m256 ymm ymm -// Construct and append a VXORPD instruction to the active function. -func (c *Context) VXORPD(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VXORPD(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VXORPD: Bitwise Logical XOR for Double-Precision Floating-Point Values. -// -// Forms: -// -// VXORPD xmm xmm xmm -// VXORPD m128 xmm xmm -// VXORPD ymm ymm ymm -// VXORPD m256 ymm ymm -// Construct and append a VXORPD instruction to the active function. -// Operates on the global context. -func VXORPD(mxy, xy, xy1 operand.Op) { ctx.VXORPD(mxy, xy, xy1) } - -// VXORPS: Bitwise Logical XOR for Single-Precision Floating-Point Values. -// -// Forms: -// -// VXORPS xmm xmm xmm -// VXORPS m128 xmm xmm -// VXORPS ymm ymm ymm -// VXORPS m256 ymm ymm -// Construct and append a VXORPS instruction to the active function. -func (c *Context) VXORPS(mxy, xy, xy1 operand.Op) { - if inst, err := x86.VXORPS(mxy, xy, xy1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VXORPS: Bitwise Logical XOR for Single-Precision Floating-Point Values. -// -// Forms: -// -// VXORPS xmm xmm xmm -// VXORPS m128 xmm xmm -// VXORPS ymm ymm ymm -// VXORPS m256 ymm ymm -// Construct and append a VXORPS instruction to the active function. -// Operates on the global context. -func VXORPS(mxy, xy, xy1 operand.Op) { ctx.VXORPS(mxy, xy, xy1) } - -// VZEROALL: Zero All YMM Registers. -// -// Forms: -// -// VZEROALL -// Construct and append a VZEROALL instruction to the active function. -func (c *Context) VZEROALL() { - if inst, err := x86.VZEROALL(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VZEROALL: Zero All YMM Registers. -// -// Forms: -// -// VZEROALL -// Construct and append a VZEROALL instruction to the active function. -// Operates on the global context. -func VZEROALL() { ctx.VZEROALL() } - -// VZEROUPPER: Zero Upper Bits of YMM Registers. -// -// Forms: -// -// VZEROUPPER -// Construct and append a VZEROUPPER instruction to the active function. -func (c *Context) VZEROUPPER() { - if inst, err := x86.VZEROUPPER(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// VZEROUPPER: Zero Upper Bits of YMM Registers. -// -// Forms: -// -// VZEROUPPER -// Construct and append a VZEROUPPER instruction to the active function. -// Operates on the global context. -func VZEROUPPER() { ctx.VZEROUPPER() } - -// XADDB: Exchange and Add. -// -// Forms: -// -// XADDB r8 r8 -// XADDB r8 m8 -// Construct and append a XADDB instruction to the active function. -func (c *Context) XADDB(r, mr operand.Op) { - if inst, err := x86.XADDB(r, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// XADDB: Exchange and Add. -// -// Forms: -// -// XADDB r8 r8 -// XADDB r8 m8 -// Construct and append a XADDB instruction to the active function. -// Operates on the global context. -func XADDB(r, mr operand.Op) { ctx.XADDB(r, mr) } - -// XADDL: Exchange and Add. -// -// Forms: -// -// XADDL r32 r32 -// XADDL r32 m32 -// Construct and append a XADDL instruction to the active function. -func (c *Context) XADDL(r, mr operand.Op) { - if inst, err := x86.XADDL(r, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// XADDL: Exchange and Add. -// -// Forms: -// -// XADDL r32 r32 -// XADDL r32 m32 -// Construct and append a XADDL instruction to the active function. -// Operates on the global context. -func XADDL(r, mr operand.Op) { ctx.XADDL(r, mr) } - -// XADDQ: Exchange and Add. -// -// Forms: -// -// XADDQ r64 r64 -// XADDQ r64 m64 -// Construct and append a XADDQ instruction to the active function. -func (c *Context) XADDQ(r, mr operand.Op) { - if inst, err := x86.XADDQ(r, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// XADDQ: Exchange and Add. -// -// Forms: -// -// XADDQ r64 r64 -// XADDQ r64 m64 -// Construct and append a XADDQ instruction to the active function. -// Operates on the global context. -func XADDQ(r, mr operand.Op) { ctx.XADDQ(r, mr) } - -// XADDW: Exchange and Add. -// -// Forms: -// -// XADDW r16 r16 -// XADDW r16 m16 -// Construct and append a XADDW instruction to the active function. -func (c *Context) XADDW(r, mr operand.Op) { - if inst, err := x86.XADDW(r, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// XADDW: Exchange and Add. -// -// Forms: -// -// XADDW r16 r16 -// XADDW r16 m16 -// Construct and append a XADDW instruction to the active function. -// Operates on the global context. -func XADDW(r, mr operand.Op) { ctx.XADDW(r, mr) } - -// XCHGB: Exchange Register/Memory with Register. -// -// Forms: -// -// XCHGB r8 r8 -// XCHGB m8 r8 -// XCHGB r8 m8 -// Construct and append a XCHGB instruction to the active function. -func (c *Context) XCHGB(mr, mr1 operand.Op) { - if inst, err := x86.XCHGB(mr, mr1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// XCHGB: Exchange Register/Memory with Register. -// -// Forms: -// -// XCHGB r8 r8 -// XCHGB m8 r8 -// XCHGB r8 m8 -// Construct and append a XCHGB instruction to the active function. -// Operates on the global context. -func XCHGB(mr, mr1 operand.Op) { ctx.XCHGB(mr, mr1) } - -// XCHGL: Exchange Register/Memory with Register. -// -// Forms: -// -// XCHGL r32 eax -// XCHGL eax r32 -// XCHGL r32 r32 -// XCHGL m32 r32 -// XCHGL r32 m32 -// Construct and append a XCHGL instruction to the active function. -func (c *Context) XCHGL(emr, emr1 operand.Op) { - if inst, err := x86.XCHGL(emr, emr1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// XCHGL: Exchange Register/Memory with Register. -// -// Forms: -// -// XCHGL r32 eax -// XCHGL eax r32 -// XCHGL r32 r32 -// XCHGL m32 r32 -// XCHGL r32 m32 -// Construct and append a XCHGL instruction to the active function. -// Operates on the global context. -func XCHGL(emr, emr1 operand.Op) { ctx.XCHGL(emr, emr1) } - -// XCHGQ: Exchange Register/Memory with Register. -// -// Forms: -// -// XCHGQ r64 rax -// XCHGQ rax r64 -// XCHGQ r64 r64 -// XCHGQ m64 r64 -// XCHGQ r64 m64 -// Construct and append a XCHGQ instruction to the active function. -func (c *Context) XCHGQ(mr, mr1 operand.Op) { - if inst, err := x86.XCHGQ(mr, mr1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// XCHGQ: Exchange Register/Memory with Register. -// -// Forms: -// -// XCHGQ r64 rax -// XCHGQ rax r64 -// XCHGQ r64 r64 -// XCHGQ m64 r64 -// XCHGQ r64 m64 -// Construct and append a XCHGQ instruction to the active function. -// Operates on the global context. -func XCHGQ(mr, mr1 operand.Op) { ctx.XCHGQ(mr, mr1) } - -// XCHGW: Exchange Register/Memory with Register. -// -// Forms: -// -// XCHGW r16 ax -// XCHGW ax r16 -// XCHGW r16 r16 -// XCHGW m16 r16 -// XCHGW r16 m16 -// Construct and append a XCHGW instruction to the active function. -func (c *Context) XCHGW(amr, amr1 operand.Op) { - if inst, err := x86.XCHGW(amr, amr1); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// XCHGW: Exchange Register/Memory with Register. -// -// Forms: -// -// XCHGW r16 ax -// XCHGW ax r16 -// XCHGW r16 r16 -// XCHGW m16 r16 -// XCHGW r16 m16 -// Construct and append a XCHGW instruction to the active function. -// Operates on the global context. -func XCHGW(amr, amr1 operand.Op) { ctx.XCHGW(amr, amr1) } - -// XGETBV: Get Value of Extended Control Register. -// -// Forms: -// -// XGETBV -// Construct and append a XGETBV instruction to the active function. -func (c *Context) XGETBV() { - if inst, err := x86.XGETBV(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// XGETBV: Get Value of Extended Control Register. -// -// Forms: -// -// XGETBV -// Construct and append a XGETBV instruction to the active function. -// Operates on the global context. -func XGETBV() { ctx.XGETBV() } - -// XLAT: Table Look-up Translation. -// -// Forms: -// -// XLAT -// Construct and append a XLAT instruction to the active function. -func (c *Context) XLAT() { - if inst, err := x86.XLAT(); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// XLAT: Table Look-up Translation. -// -// Forms: -// -// XLAT -// Construct and append a XLAT instruction to the active function. -// Operates on the global context. -func XLAT() { ctx.XLAT() } - -// XORB: Logical Exclusive OR. -// -// Forms: -// -// XORB imm8 al -// XORB imm8 r8 -// XORB r8 r8 -// XORB m8 r8 -// XORB imm8 m8 -// XORB r8 m8 -// Construct and append a XORB instruction to the active function. -func (c *Context) XORB(imr, amr operand.Op) { - if inst, err := x86.XORB(imr, amr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// XORB: Logical Exclusive OR. -// -// Forms: -// -// XORB imm8 al -// XORB imm8 r8 -// XORB r8 r8 -// XORB m8 r8 -// XORB imm8 m8 -// XORB r8 m8 -// Construct and append a XORB instruction to the active function. -// Operates on the global context. -func XORB(imr, amr operand.Op) { ctx.XORB(imr, amr) } - -// XORL: Logical Exclusive OR. -// -// Forms: -// -// XORL imm32 eax -// XORL imm8 r32 -// XORL imm32 r32 -// XORL r32 r32 -// XORL m32 r32 -// XORL imm8 m32 -// XORL imm32 m32 -// XORL r32 m32 -// Construct and append a XORL instruction to the active function. -func (c *Context) XORL(imr, emr operand.Op) { - if inst, err := x86.XORL(imr, emr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// XORL: Logical Exclusive OR. -// -// Forms: -// -// XORL imm32 eax -// XORL imm8 r32 -// XORL imm32 r32 -// XORL r32 r32 -// XORL m32 r32 -// XORL imm8 m32 -// XORL imm32 m32 -// XORL r32 m32 -// Construct and append a XORL instruction to the active function. -// Operates on the global context. -func XORL(imr, emr operand.Op) { ctx.XORL(imr, emr) } - -// XORPD: Bitwise Logical XOR for Double-Precision Floating-Point Values. -// -// Forms: -// -// XORPD xmm xmm -// XORPD m128 xmm -// Construct and append a XORPD instruction to the active function. -func (c *Context) XORPD(mx, x operand.Op) { - if inst, err := x86.XORPD(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// XORPD: Bitwise Logical XOR for Double-Precision Floating-Point Values. -// -// Forms: -// -// XORPD xmm xmm -// XORPD m128 xmm -// Construct and append a XORPD instruction to the active function. -// Operates on the global context. -func XORPD(mx, x operand.Op) { ctx.XORPD(mx, x) } - -// XORPS: Bitwise Logical XOR for Single-Precision Floating-Point Values. -// -// Forms: -// -// XORPS xmm xmm -// XORPS m128 xmm -// Construct and append a XORPS instruction to the active function. -func (c *Context) XORPS(mx, x operand.Op) { - if inst, err := x86.XORPS(mx, x); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// XORPS: Bitwise Logical XOR for Single-Precision Floating-Point Values. -// -// Forms: -// -// XORPS xmm xmm -// XORPS m128 xmm -// Construct and append a XORPS instruction to the active function. -// Operates on the global context. -func XORPS(mx, x operand.Op) { ctx.XORPS(mx, x) } - -// XORQ: Logical Exclusive OR. -// -// Forms: -// -// XORQ imm32 rax -// XORQ imm8 r64 -// XORQ imm32 r64 -// XORQ r64 r64 -// XORQ m64 r64 -// XORQ imm8 m64 -// XORQ imm32 m64 -// XORQ r64 m64 -// Construct and append a XORQ instruction to the active function. -func (c *Context) XORQ(imr, mr operand.Op) { - if inst, err := x86.XORQ(imr, mr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// XORQ: Logical Exclusive OR. -// -// Forms: -// -// XORQ imm32 rax -// XORQ imm8 r64 -// XORQ imm32 r64 -// XORQ r64 r64 -// XORQ m64 r64 -// XORQ imm8 m64 -// XORQ imm32 m64 -// XORQ r64 m64 -// Construct and append a XORQ instruction to the active function. -// Operates on the global context. -func XORQ(imr, mr operand.Op) { ctx.XORQ(imr, mr) } - -// XORW: Logical Exclusive OR. -// -// Forms: -// -// XORW imm16 ax -// XORW imm8 r16 -// XORW imm16 r16 -// XORW r16 r16 -// XORW m16 r16 -// XORW imm8 m16 -// XORW imm16 m16 -// XORW r16 m16 -// Construct and append a XORW instruction to the active function. -func (c *Context) XORW(imr, amr operand.Op) { - if inst, err := x86.XORW(imr, amr); err == nil { - c.Instruction(inst) - } else { - c.adderror(err) - } -} - -// XORW: Logical Exclusive OR. -// -// Forms: -// -// XORW imm16 ax -// XORW imm8 r16 -// XORW imm16 r16 -// XORW r16 r16 -// XORW m16 r16 -// XORW imm8 m16 -// XORW imm16 m16 -// XORW r16 m16 -// Construct and append a XORW instruction to the active function. -// Operates on the global context. -func XORW(imr, amr operand.Op) { ctx.XORW(imr, amr) } diff --git a/vendor/github.com/mmcloughlin/avo/build/zmov.go b/vendor/github.com/mmcloughlin/avo/build/zmov.go deleted file mode 100644 index ca9bb5542c..0000000000 --- a/vendor/github.com/mmcloughlin/avo/build/zmov.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by command: avogen -output zmov.go mov. DO NOT EDIT. - -package build - -import ( - "go/types" - - "github.com/mmcloughlin/avo/operand" -) - -func (c *Context) mov(a, b operand.Op, an, bn int, t *types.Basic) { - switch { - case (t.Info()&types.IsInteger) != 0 && an == 1 && bn == 1: - c.MOVB(a, b) - case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 1 && bn == 4: - c.MOVBLSX(a, b) - case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 1 && bn == 4: - c.MOVBLZX(a, b) - case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 1 && bn == 8: - c.MOVBQSX(a, b) - case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 1 && bn == 8: - c.MOVBQZX(a, b) - case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 1 && bn == 2: - c.MOVBWSX(a, b) - case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 1 && bn == 2: - c.MOVBWZX(a, b) - case (t.Info()&types.IsInteger) != 0 && an == 4 && bn == 4: - c.MOVL(a, b) - case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 4 && bn == 8: - c.MOVLQSX(a, b) - case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 4 && bn == 8: - c.MOVLQZX(a, b) - case (t.Info()&types.IsInteger) != 0 && an == 16 && bn == 16: - c.MOVOU(a, b) - case (t.Info()&types.IsInteger) != 0 && an == 4 && bn == 16: - c.MOVQ(a, b) - case (t.Info()&types.IsInteger) != 0 && an == 8 && bn == 8: - c.MOVQ(a, b) - case (t.Info()&types.IsInteger) != 0 && an == 8 && bn == 16: - c.MOVQ(a, b) - case (t.Info()&types.IsInteger) != 0 && an == 16 && bn == 4: - c.MOVQ(a, b) - case (t.Info()&types.IsInteger) != 0 && an == 16 && bn == 8: - c.MOVQ(a, b) - case (t.Info()&types.IsInteger) != 0 && an == 16 && bn == 16: - c.MOVQ(a, b) - case (t.Info()&types.IsFloat) != 0 && an == 8 && bn == 16: - c.MOVSD(a, b) - case (t.Info()&types.IsFloat) != 0 && an == 16 && bn == 8: - c.MOVSD(a, b) - case (t.Info()&types.IsFloat) != 0 && an == 16 && bn == 16: - c.MOVSD(a, b) - case (t.Info()&types.IsFloat) != 0 && an == 4 && bn == 16: - c.MOVSS(a, b) - case (t.Info()&types.IsFloat) != 0 && an == 16 && bn == 4: - c.MOVSS(a, b) - case (t.Info()&types.IsFloat) != 0 && an == 16 && bn == 16: - c.MOVSS(a, b) - case (t.Info()&types.IsInteger) != 0 && an == 2 && bn == 2: - c.MOVW(a, b) - case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 2 && bn == 4: - c.MOVWLSX(a, b) - case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 2 && bn == 4: - c.MOVWLZX(a, b) - case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 2 && bn == 8: - c.MOVWQSX(a, b) - case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 2 && bn == 8: - c.MOVWQZX(a, b) - default: - c.adderrormessage("could not deduce mov instruction") - } -} diff --git a/vendor/github.com/mmcloughlin/avo/buildtags/buildtags.go b/vendor/github.com/mmcloughlin/avo/buildtags/buildtags.go deleted file mode 100644 index 8fd61e10d3..0000000000 --- a/vendor/github.com/mmcloughlin/avo/buildtags/buildtags.go +++ /dev/null @@ -1,312 +0,0 @@ -// Package buildtags provides types for representing and manipulating build constraints. -// -// In Go, build constraints are represented as comments in source code together with file naming conventions. For example -// -// // +build linux,386 darwin,!cgo -// // +build !purego -// -// Any terms provided in the filename can be thought of as an implicit extra -// constraint comment line. Collectively, these are referred to as -// ``constraints''. Each line is a ``constraint''. Within each constraint the -// space-separated terms are ``options'', and within that the comma-separated -// items are ``terms'' which may be negated with at most one exclaimation mark. -// -// These represent a boolean formulae. The constraints are evaluated as the AND -// of constraint lines; a constraint is evaluated as the OR of its options and -// an option is evaluated as the AND of its terms. Overall build constraints are -// a boolean formula that is an AND of ORs of ANDs. -// -// This level of complexity is rarely used in Go programs. Therefore this -// package aims to provide access to all these layers of nesting if required, -// but make it easy to forget about for basic use cases too. -package buildtags - -import ( - "errors" - "fmt" - "strings" - "unicode" -) - -// Reference: https://github.com/golang/go/blob/204a8f55dc2e0ac8d27a781dab0da609b98560da/src/go/build/doc.go#L73-L92 -// -// // A build constraint is evaluated as the OR of space-separated options; -// // each option evaluates as the AND of its comma-separated terms; -// // and each term is an alphanumeric word or, preceded by !, its negation. -// // That is, the build constraint: -// // -// // // +build linux,386 darwin,!cgo -// // -// // corresponds to the boolean formula: -// // -// // (linux AND 386) OR (darwin AND (NOT cgo)) -// // -// // A file may have multiple build constraints. The overall constraint is the AND -// // of the individual constraints. That is, the build constraints: -// // -// // // +build linux darwin -// // // +build 386 -// // -// // corresponds to the boolean formula: -// // -// // (linux OR darwin) AND 386 -// - -// Interface represents a build constraint. -type Interface interface { - ConstraintsConvertable - fmt.GoStringer - Evaluate(v map[string]bool) bool - Validate() error -} - -// ConstraintsConvertable can be converted to a Constraints object. -type ConstraintsConvertable interface { - ToConstraints() Constraints -} - -// ConstraintConvertable can be converted to a Constraint. -type ConstraintConvertable interface { - ToConstraint() Constraint -} - -// OptionConvertable can be converted to an Option. -type OptionConvertable interface { - ToOption() Option -} - -// Constraints represents the AND of a list of Constraint lines. -type Constraints []Constraint - -// And builds Constraints that will be true if all of its constraints are true. -func And(cs ...ConstraintConvertable) Constraints { - constraints := Constraints{} - for _, c := range cs { - constraints = append(constraints, c.ToConstraint()) - } - return constraints -} - -// ToConstraints returns cs. -func (cs Constraints) ToConstraints() Constraints { return cs } - -// Validate validates the constraints set. -func (cs Constraints) Validate() error { - for _, c := range cs { - if err := c.Validate(); err != nil { - return err - } - } - return nil -} - -// Evaluate the boolean formula represented by cs under the given assignment of -// tag values. This is the AND of the values of the constituent Constraints. -func (cs Constraints) Evaluate(v map[string]bool) bool { - r := true - for _, c := range cs { - r = r && c.Evaluate(v) - } - return r -} - -// GoString represents Constraints as +build comment lines. -func (cs Constraints) GoString() string { - s := "" - for _, c := range cs { - s += c.GoString() - } - return s -} - -// Constraint represents the OR of a list of Options. -type Constraint []Option - -// Any builds a Constraint that will be true if any of its options are true. -func Any(opts ...OptionConvertable) Constraint { - c := Constraint{} - for _, opt := range opts { - c = append(c, opt.ToOption()) - } - return c -} - -// ParseConstraint parses a space-separated list of options. -func ParseConstraint(expr string) (Constraint, error) { - c := Constraint{} - for _, field := range strings.Fields(expr) { - opt, err := ParseOption(field) - if err != nil { - return c, err - } - c = append(c, opt) - } - return c, nil -} - -// ToConstraints returns the list of constraints containing just c. -func (c Constraint) ToConstraints() Constraints { return Constraints{c} } - -// ToConstraint returns c. -func (c Constraint) ToConstraint() Constraint { return c } - -// Validate validates the constraint. -func (c Constraint) Validate() error { - for _, o := range c { - if err := o.Validate(); err != nil { - return err - } - } - return nil -} - -// Evaluate the boolean formula represented by c under the given assignment of -// tag values. This is the OR of the values of the constituent Options. -func (c Constraint) Evaluate(v map[string]bool) bool { - r := false - for _, o := range c { - r = r || o.Evaluate(v) - } - return r -} - -// GoString represents the Constraint as one +build comment line. -func (c Constraint) GoString() string { - s := "// +build" - for _, o := range c { - s += " " + o.GoString() - } - return s + "\n" -} - -// Option represents the AND of a list of Terms. -type Option []Term - -// Opt builds an Option from the list of Terms. -func Opt(terms ...Term) Option { - return Option(terms) -} - -// ParseOption parses a comma-separated list of terms. -func ParseOption(expr string) (Option, error) { - opt := Option{} - for _, t := range strings.Split(expr, ",") { - opt = append(opt, Term(t)) - } - return opt, opt.Validate() -} - -// ToConstraints returns Constraints containing just this option. -func (o Option) ToConstraints() Constraints { return o.ToConstraint().ToConstraints() } - -// ToConstraint returns a Constraint containing just this option. -func (o Option) ToConstraint() Constraint { return Constraint{o} } - -// ToOption returns o. -func (o Option) ToOption() Option { return o } - -// Validate validates o. -func (o Option) Validate() error { - for _, t := range o { - if err := t.Validate(); err != nil { - return fmt.Errorf("invalid term \"%s\": %s", t, err) - } - } - return nil -} - -// Evaluate the boolean formula represented by o under the given assignment of -// tag values. This is the AND of the values of the constituent Terms. -func (o Option) Evaluate(v map[string]bool) bool { - r := true - for _, t := range o { - r = r && t.Evaluate(v) - } - return r -} - -// GoString represents the Option as a comma-separated list of terms. -func (o Option) GoString() string { - var ts []string - for _, t := range o { - ts = append(ts, t.GoString()) - } - return strings.Join(ts, ",") -} - -// Term is an atomic term in a build constraint: an identifier or its negation. -type Term string - -// Not returns a term for the negation of ident. -func Not(ident string) Term { - return Term("!" + ident) -} - -// ToConstraints returns Constraints containing just this term. -func (t Term) ToConstraints() Constraints { return t.ToOption().ToConstraints() } - -// ToConstraint returns a Constraint containing just this term. -func (t Term) ToConstraint() Constraint { return t.ToOption().ToConstraint() } - -// ToOption returns an Option containing just this term. -func (t Term) ToOption() Option { return Option{t} } - -// IsNegated reports whether t is the negation of an identifier. -func (t Term) IsNegated() bool { return strings.HasPrefix(string(t), "!") } - -// Name returns the identifier for this term. -func (t Term) Name() string { - return strings.TrimPrefix(string(t), "!") -} - -// Validate the term. -func (t Term) Validate() error { - // Reference: https://github.com/golang/go/blob/204a8f55dc2e0ac8d27a781dab0da609b98560da/src/cmd/go/internal/imports/build.go#L110-L112 - // - // if strings.HasPrefix(name, "!!") { // bad syntax, reject always - // return false - // } - // - if strings.HasPrefix(string(t), "!!") { - return errors.New("at most one '!' allowed") - } - - if len(t.Name()) == 0 { - return errors.New("empty tag name") - } - - // Reference: https://github.com/golang/go/blob/204a8f55dc2e0ac8d27a781dab0da609b98560da/src/cmd/go/internal/imports/build.go#L121-L127 - // - // // Tags must be letters, digits, underscores or dots. - // // Unlike in Go identifiers, all digits are fine (e.g., "386"). - // for _, c := range name { - // if !unicode.IsLetter(c) && !unicode.IsDigit(c) && c != '_' && c != '.' { - // return false - // } - // } - // - for _, c := range t.Name() { - if !unicode.IsLetter(c) && !unicode.IsDigit(c) && c != '_' && c != '.' { - return fmt.Errorf("character '%c' disallowed in tags", c) - } - } - - return nil -} - -// Evaluate the term under the given set of identifier values. -func (t Term) Evaluate(v map[string]bool) bool { - return (t.Validate() == nil) && (v[t.Name()] == !t.IsNegated()) -} - -// GoString returns t. -func (t Term) GoString() string { return string(t) } - -// SetTags builds a set where the given list of identifiers are true. -func SetTags(idents ...string) map[string]bool { - v := map[string]bool{} - for _, ident := range idents { - v[ident] = true - } - return v -} diff --git a/vendor/github.com/mmcloughlin/avo/gotypes/components.go b/vendor/github.com/mmcloughlin/avo/gotypes/components.go deleted file mode 100644 index 2206afa669..0000000000 --- a/vendor/github.com/mmcloughlin/avo/gotypes/components.go +++ /dev/null @@ -1,253 +0,0 @@ -package gotypes - -import ( - "errors" - "fmt" - "go/token" - "go/types" - "strconv" - - "github.com/mmcloughlin/avo/reg" - - "github.com/mmcloughlin/avo/operand" -) - -// Sizes provides type sizes used by the standard Go compiler on amd64. -var Sizes = types.SizesFor("gc", "amd64") - -// Basic represents a primitive/basic type at a given memory address. -type Basic struct { - Addr operand.Mem - Type *types.Basic -} - -// Component provides access to sub-components of a Go type. -type Component interface { - // When the component has no further sub-components, Resolve will return a - // reference to the components type and memory address. If there was an error - // during any previous calls to Component methods, they will be returned at - // resolution time. - Resolve() (*Basic, error) - - Dereference(r reg.Register) Component // dereference a pointer - Base() Component // base pointer of a string or slice - Len() Component // length of a string or slice - Cap() Component // capacity of a slice - Real() Component // real part of a complex value - Imag() Component // imaginary part of a complex value - Index(int) Component // index into an array - Field(string) Component // access a struct field -} - -// componenterr is an error that also provides a null implementation of the -// Component interface. This enables us to return an error from Component -// methods whilst also allowing method chaining to continue. -type componenterr string - -func errorf(format string, args ...interface{}) Component { - return componenterr(fmt.Sprintf(format, args...)) -} - -func (c componenterr) Error() string { return string(c) } -func (c componenterr) Resolve() (*Basic, error) { return nil, c } -func (c componenterr) Dereference(r reg.Register) Component { return c } -func (c componenterr) Base() Component { return c } -func (c componenterr) Len() Component { return c } -func (c componenterr) Cap() Component { return c } -func (c componenterr) Real() Component { return c } -func (c componenterr) Imag() Component { return c } -func (c componenterr) Index(int) Component { return c } -func (c componenterr) Field(string) Component { return c } - -type component struct { - typ types.Type - addr operand.Mem -} - -// NewComponent builds a component for the named type at the given address. -func NewComponent(t types.Type, addr operand.Mem) Component { - return &component{ - typ: t, - addr: addr, - } -} - -func (c *component) Resolve() (*Basic, error) { - b := toprimitive(c.typ) - if b == nil { - return nil, errors.New("component is not primitive") - } - return &Basic{ - Addr: c.addr, - Type: b, - }, nil -} - -func (c *component) Dereference(r reg.Register) Component { - p, ok := c.typ.Underlying().(*types.Pointer) - if !ok { - return errorf("not pointer type") - } - return NewComponent(p.Elem(), operand.Mem{Base: r}) -} - -// Reference: https://github.com/golang/go/blob/50bd1c4d4eb4fac8ddeb5f063c099daccfb71b26/src/reflect/value.go#L1800-L1804 -// -// type SliceHeader struct { -// Data uintptr -// Len int -// Cap int -// } -// -var slicehdroffsets = Sizes.Offsetsof([]*types.Var{ - types.NewField(token.NoPos, nil, "Data", types.Typ[types.Uintptr], false), - types.NewField(token.NoPos, nil, "Len", types.Typ[types.Int], false), - types.NewField(token.NoPos, nil, "Cap", types.Typ[types.Int], false), -}) - -func (c *component) Base() Component { - if !isslice(c.typ) && !isstring(c.typ) { - return errorf("only slices and strings have base pointers") - } - return c.sub("_base", int(slicehdroffsets[0]), types.Typ[types.Uintptr]) -} - -func (c *component) Len() Component { - if !isslice(c.typ) && !isstring(c.typ) { - return errorf("only slices and strings have length fields") - } - return c.sub("_len", int(slicehdroffsets[1]), types.Typ[types.Int]) -} - -func (c *component) Cap() Component { - if !isslice(c.typ) { - return errorf("only slices have capacity fields") - } - return c.sub("_cap", int(slicehdroffsets[2]), types.Typ[types.Int]) -} - -func (c *component) Real() Component { - if !iscomplex(c.typ) { - return errorf("only complex types have real values") - } - f := complextofloat(c.typ) - return c.sub("_real", 0, f) -} - -func (c *component) Imag() Component { - if !iscomplex(c.typ) { - return errorf("only complex types have imaginary values") - } - f := complextofloat(c.typ) - return c.sub("_imag", int(Sizes.Sizeof(f)), f) -} - -func (c *component) Index(i int) Component { - a, ok := c.typ.Underlying().(*types.Array) - if !ok { - return errorf("not array type") - } - if int64(i) >= a.Len() { - return errorf("array index out of bounds") - } - // Reference: https://github.com/golang/tools/blob/bcd4e47d02889ebbc25c9f4bf3d27e4124b0bf9d/go/analysis/passes/asmdecl/asmdecl.go#L482-L494 - // - // case asmArray: - // tu := t.Underlying().(*types.Array) - // elem := tu.Elem() - // // Calculate offset of each element array. - // fields := []*types.Var{ - // types.NewVar(token.NoPos, nil, "fake0", elem), - // types.NewVar(token.NoPos, nil, "fake1", elem), - // } - // offsets := arch.sizes.Offsetsof(fields) - // elemoff := int(offsets[1]) - // for i := 0; i < int(tu.Len()); i++ { - // cc = appendComponentsRecursive(arch, elem, cc, suffix+"_"+strconv.Itoa(i), i*elemoff) - // } - // - elem := a.Elem() - elemsize := int(Sizes.Sizeof(types.NewArray(elem, 2)) - Sizes.Sizeof(types.NewArray(elem, 1))) - return c.sub("_"+strconv.Itoa(i), i*elemsize, elem) -} - -func (c *component) Field(n string) Component { - s, ok := c.typ.Underlying().(*types.Struct) - if !ok { - return errorf("not struct type") - } - // Reference: https://github.com/golang/tools/blob/13ba8ad772dfbf0f451b5dd0679e9c5605afc05d/go/analysis/passes/asmdecl/asmdecl.go#L471-L480 - // - // case asmStruct: - // tu := t.Underlying().(*types.Struct) - // fields := make([]*types.Var, tu.NumFields()) - // for i := 0; i < tu.NumFields(); i++ { - // fields[i] = tu.Field(i) - // } - // offsets := arch.sizes.Offsetsof(fields) - // for i, f := range fields { - // cc = appendComponentsRecursive(arch, f.Type(), cc, suffix+"_"+f.Name(), off+int(offsets[i])) - // } - // - fields := make([]*types.Var, s.NumFields()) - for i := 0; i < s.NumFields(); i++ { - fields[i] = s.Field(i) - } - offsets := Sizes.Offsetsof(fields) - for i, f := range fields { - if f.Name() == n { - return c.sub("_"+n, int(offsets[i]), f.Type()) - } - } - return errorf("struct does not have field '%s'", n) -} - -func (c *component) sub(suffix string, offset int, t types.Type) *component { - s := *c - if s.addr.Symbol.Name != "" { - s.addr.Symbol.Name += suffix - } - s.addr = s.addr.Offset(offset) - s.typ = t - return &s -} - -func isslice(t types.Type) bool { - _, ok := t.Underlying().(*types.Slice) - return ok -} - -func isstring(t types.Type) bool { - b, ok := t.Underlying().(*types.Basic) - return ok && b.Kind() == types.String -} - -func iscomplex(t types.Type) bool { - b, ok := t.Underlying().(*types.Basic) - return ok && (b.Info()&types.IsComplex) != 0 -} - -func complextofloat(t types.Type) types.Type { - switch Sizes.Sizeof(t) { - case 16: - return types.Typ[types.Float64] - case 8: - return types.Typ[types.Float32] - } - panic("bad") -} - -// toprimitive determines whether t is primitive (cannot be reduced into -// components). If it is, it returns the basic type for t, otherwise returns -// nil. -func toprimitive(t types.Type) *types.Basic { - switch b := t.(type) { - case *types.Basic: - if (b.Info() & (types.IsString | types.IsComplex)) == 0 { - return b - } - case *types.Pointer: - return types.Typ[types.Uintptr] - } - return nil -} diff --git a/vendor/github.com/mmcloughlin/avo/gotypes/doc.go b/vendor/github.com/mmcloughlin/avo/gotypes/doc.go deleted file mode 100644 index fa8f0783d7..0000000000 --- a/vendor/github.com/mmcloughlin/avo/gotypes/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package gotypes provides helpers for interacting with Go types within avo functions. -package gotypes diff --git a/vendor/github.com/mmcloughlin/avo/gotypes/signature.go b/vendor/github.com/mmcloughlin/avo/gotypes/signature.go deleted file mode 100644 index e00002034d..0000000000 --- a/vendor/github.com/mmcloughlin/avo/gotypes/signature.go +++ /dev/null @@ -1,177 +0,0 @@ -package gotypes - -import ( - "bytes" - "errors" - "fmt" - "go/token" - "go/types" - "strconv" - - "github.com/mmcloughlin/avo/operand" -) - -// Signature represents a Go function signature. -type Signature struct { - pkg *types.Package - sig *types.Signature - params *Tuple - results *Tuple -} - -// NewSignature constructs a Signature. -func NewSignature(pkg *types.Package, sig *types.Signature) *Signature { - s := &Signature{ - pkg: pkg, - sig: sig, - } - s.init() - return s -} - -// NewSignatureVoid builds the void signature "func()". -func NewSignatureVoid() *Signature { - return NewSignature(nil, types.NewSignature(nil, nil, nil, false)) -} - -// LookupSignature returns the signature of the named function in the provided package. -func LookupSignature(pkg *types.Package, name string) (*Signature, error) { - scope := pkg.Scope() - obj := scope.Lookup(name) - if obj == nil { - return nil, fmt.Errorf("could not find function \"%s\"", name) - } - s, ok := obj.Type().(*types.Signature) - if !ok { - return nil, fmt.Errorf("object \"%s\" does not have signature type", name) - } - return NewSignature(pkg, s), nil -} - -// ParseSignature builds a Signature by parsing a Go function type expression. -// The function type must reference builtin types only; see -// ParseSignatureInPackage if custom types are required. -func ParseSignature(expr string) (*Signature, error) { - return ParseSignatureInPackage(nil, expr) -} - -// ParseSignatureInPackage builds a Signature by parsing a Go function type -// expression. The expression may reference types in the provided package. -func ParseSignatureInPackage(pkg *types.Package, expr string) (*Signature, error) { - tv, err := types.Eval(token.NewFileSet(), pkg, token.NoPos, expr) - if err != nil { - return nil, err - } - if tv.Value != nil { - return nil, errors.New("signature expression should have nil value") - } - s, ok := tv.Type.(*types.Signature) - if !ok { - return nil, errors.New("provided type is not a function signature") - } - return NewSignature(pkg, s), nil -} - -// Params returns the function signature argument types. -func (s *Signature) Params() *Tuple { return s.params } - -// Results returns the function return types. -func (s *Signature) Results() *Tuple { return s.results } - -// Bytes returns the total size of the function arguments and return values. -func (s *Signature) Bytes() int { return s.Params().Bytes() + s.Results().Bytes() } - -// String writes Signature as a string. This does not include the "func" keyword. -func (s *Signature) String() string { - var buf bytes.Buffer - types.WriteSignature(&buf, s.sig, func(pkg *types.Package) string { - if pkg == s.pkg { - return "" - } - return pkg.Name() - }) - return buf.String() -} - -func (s *Signature) init() { - p := s.sig.Params() - r := s.sig.Results() - - // Compute parameter offsets. - vs := tuplevars(p) - vs = append(vs, types.NewParam(token.NoPos, nil, "sentinel", types.Typ[types.Uint64])) - paramsoffsets := Sizes.Offsetsof(vs) - paramssize := paramsoffsets[p.Len()] - s.params = newTuple(p, paramsoffsets, paramssize, "arg") - - // Result offsets. - vs = tuplevars(r) - resultsoffsets := Sizes.Offsetsof(vs) - var resultssize int64 - if n := len(vs); n > 0 { - resultssize = resultsoffsets[n-1] + Sizes.Sizeof(vs[n-1].Type()) - } - for i := range resultsoffsets { - resultsoffsets[i] += paramssize - } - s.results = newTuple(r, resultsoffsets, resultssize, "ret") -} - -// Tuple represents a tuple of variables, such as function arguments or results. -type Tuple struct { - components []Component - byname map[string]Component - size int -} - -func newTuple(t *types.Tuple, offsets []int64, size int64, defaultprefix string) *Tuple { - tuple := &Tuple{ - byname: map[string]Component{}, - size: int(size), - } - for i := 0; i < t.Len(); i++ { - v := t.At(i) - name := v.Name() - if name == "" { - name = defaultprefix - if i > 0 { - name += strconv.Itoa(i) - } - } - addr := operand.NewParamAddr(name, int(offsets[i])) - c := NewComponent(v.Type(), addr) - tuple.components = append(tuple.components, c) - if v.Name() != "" { - tuple.byname[v.Name()] = c - } - } - return tuple -} - -// Lookup returns the variable with the given name. -func (t *Tuple) Lookup(name string) Component { - e := t.byname[name] - if e == nil { - return errorf("unknown variable \"%s\"", name) - } - return e -} - -// At returns the variable at index i. -func (t *Tuple) At(i int) Component { - if i >= len(t.components) { - return errorf("index out of range") - } - return t.components[i] -} - -// Bytes returns the size of the Tuple. This may include additional padding. -func (t *Tuple) Bytes() int { return t.size } - -func tuplevars(t *types.Tuple) []*types.Var { - vs := make([]*types.Var, t.Len()) - for i := 0; i < t.Len(); i++ { - vs[i] = t.At(i) - } - return vs -} diff --git a/vendor/github.com/mmcloughlin/avo/internal/prnt/printer.go b/vendor/github.com/mmcloughlin/avo/internal/prnt/printer.go deleted file mode 100644 index 410895cb07..0000000000 --- a/vendor/github.com/mmcloughlin/avo/internal/prnt/printer.go +++ /dev/null @@ -1,60 +0,0 @@ -// Package prnt provides common functionality for code generators. -package prnt - -import ( - "bytes" - "fmt" - "io" - "strings" -) - -// Generator provides convenience methods for code generators. In particular it -// provides fmt-like methods which print to an internal buffer. It also allows -// any errors to be stored so they can be checked at the end, rather than having -// error checks obscuring the code generation. -type Generator struct { - buf bytes.Buffer - err error -} - -// Raw provides direct access to the underlying output stream. -func (g *Generator) Raw() io.Writer { - return &g.buf -} - -// Printf prints to the internal buffer. -func (g *Generator) Printf(format string, args ...interface{}) { - if g.err != nil { - return - } - _, err := fmt.Fprintf(&g.buf, format, args...) - g.AddError(err) -} - -// NL prints a new line. -func (g *Generator) NL() { - g.Printf("\n") -} - -// Comment writes comment lines prefixed with "// ". -func (g *Generator) Comment(lines ...string) { - for _, line := range lines { - line = strings.TrimSpace("// " + line) - g.Printf("%s\n", line) - } -} - -// AddError records an error in code generation. The first non-nil error will -// prevent printing operations from writing anything else, and the error will be -// returned from Result(). -func (g *Generator) AddError(err error) { - if err != nil && g.err == nil { - g.err = err - } -} - -// Result returns the printed bytes. If any error was recorded with AddError -// during code generation, the first such error will be returned here. -func (g *Generator) Result() ([]byte, error) { - return g.buf.Bytes(), g.err -} diff --git a/vendor/github.com/mmcloughlin/avo/internal/stack/stack.go b/vendor/github.com/mmcloughlin/avo/internal/stack/stack.go deleted file mode 100644 index 1d327d9da4..0000000000 --- a/vendor/github.com/mmcloughlin/avo/internal/stack/stack.go +++ /dev/null @@ -1,73 +0,0 @@ -// Package stack provides helpers for querying the callstack. -package stack - -import ( - "path" - "runtime" - "strings" -) - -// Frames returns at most max callstack Frames, starting with its caller and -// skipping skip Frames. -func Frames(skip, max int) []runtime.Frame { - pc := make([]uintptr, max) - n := runtime.Callers(skip+2, pc) - if n == 0 { - return nil - } - pc = pc[:n] - frames := runtime.CallersFrames(pc) - var fs []runtime.Frame - for { - f, more := frames.Next() - fs = append(fs, f) - if !more { - break - } - } - return fs -} - -// Match returns the first stack frame for which the predicate function returns -// true. Returns nil if no match is found. Starts matching after skip frames, -// starting with its caller. -func Match(skip int, predicate func(runtime.Frame) bool) *runtime.Frame { - i, n := skip+1, 16 - for { - fs := Frames(i, n) - for j, f := range fs { - if predicate(f) { - return &fs[j] - } - } - if len(fs) < n { - break - } - i += n - } - return nil -} - -// Main returns the main() function Frame. -func Main() *runtime.Frame { - return Match(1, func(f runtime.Frame) bool { - return f.Function == "main.main" - }) -} - -// ExternalCaller returns the first frame outside the callers package. -func ExternalCaller() *runtime.Frame { - var first *runtime.Frame - return Match(1, func(f runtime.Frame) bool { - if first == nil { - first = &f - } - return pkg(first.Function) != pkg(f.Function) - }) -} - -func pkg(ident string) string { - dir, name := path.Split(ident) - parts := strings.Split(name, ".") - return dir + parts[0] -} diff --git a/vendor/github.com/mmcloughlin/avo/ir/doc.go b/vendor/github.com/mmcloughlin/avo/ir/doc.go deleted file mode 100644 index de02f46406..0000000000 --- a/vendor/github.com/mmcloughlin/avo/ir/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package ir provides the intermediate representation of avo programs. -package ir diff --git a/vendor/github.com/mmcloughlin/avo/ir/ir.go b/vendor/github.com/mmcloughlin/avo/ir/ir.go deleted file mode 100644 index 6fb9216997..0000000000 --- a/vendor/github.com/mmcloughlin/avo/ir/ir.go +++ /dev/null @@ -1,355 +0,0 @@ -package ir - -import ( - "errors" - - "github.com/mmcloughlin/avo/attr" - "github.com/mmcloughlin/avo/buildtags" - "github.com/mmcloughlin/avo/gotypes" - "github.com/mmcloughlin/avo/operand" - "github.com/mmcloughlin/avo/reg" -) - -// Node is a part of a Function. -type Node interface { - node() -} - -// Label within a function. -type Label string - -func (l Label) node() {} - -// Comment represents a multi-line comment. -type Comment struct { - Lines []string -} - -func (c *Comment) node() {} - -// NewComment builds a Comment consisting of the provided lines. -func NewComment(lines ...string) *Comment { - return &Comment{ - Lines: lines, - } -} - -// Instruction is a single instruction in a function. -type Instruction struct { - Opcode string - Operands []operand.Op - - Inputs []operand.Op - Outputs []operand.Op - - IsTerminal bool - IsBranch bool - IsConditional bool - CancellingInputs bool - - // ISA is the list of required instruction set extensions. - ISA []string - - // CFG. - Pred []*Instruction - Succ []*Instruction - - // LiveIn/LiveOut are sets of live register IDs pre/post execution. - LiveIn reg.MaskSet - LiveOut reg.MaskSet -} - -func (i *Instruction) node() {} - -// IsUnconditionalBranch reports whether i is an unconditional branch. -func (i Instruction) IsUnconditionalBranch() bool { - return i.IsBranch && !i.IsConditional -} - -// TargetLabel returns the label referenced by this instruction. Returns nil if -// no label is referenced. -func (i Instruction) TargetLabel() *Label { - if !i.IsBranch { - return nil - } - if len(i.Operands) == 0 { - return nil - } - if ref, ok := i.Operands[0].(operand.LabelRef); ok { - lbl := Label(ref) - return &lbl - } - return nil -} - -// Registers returns all registers involved in the instruction. -func (i Instruction) Registers() []reg.Register { - var rs []reg.Register - for _, op := range i.Operands { - rs = append(rs, operand.Registers(op)...) - } - return rs -} - -// InputRegisters returns all registers read by this instruction. -func (i Instruction) InputRegisters() []reg.Register { - var rs []reg.Register - for _, op := range i.Inputs { - rs = append(rs, operand.Registers(op)...) - } - if i.CancellingInputs && rs[0] == rs[1] { - rs = []reg.Register{} - } - for _, op := range i.Outputs { - if operand.IsMem(op) { - rs = append(rs, operand.Registers(op)...) - } - } - return rs -} - -// OutputRegisters returns all registers written by this instruction. -func (i Instruction) OutputRegisters() []reg.Register { - var rs []reg.Register - for _, op := range i.Outputs { - if r, ok := op.(reg.Register); ok { - rs = append(rs, r) - } - } - return rs -} - -// Section is a part of a file. -type Section interface { - section() -} - -// File represents an assembly file. -type File struct { - Constraints buildtags.Constraints - Includes []string - Sections []Section -} - -// NewFile initializes an empty file. -func NewFile() *File { - return &File{} -} - -// AddSection appends a Section to the file. -func (f *File) AddSection(s Section) { - f.Sections = append(f.Sections, s) -} - -// Functions returns all functions in the file. -func (f *File) Functions() []*Function { - var fns []*Function - for _, s := range f.Sections { - if fn, ok := s.(*Function); ok { - fns = append(fns, fn) - } - } - return fns -} - -// Pragma represents a function compiler directive. -type Pragma struct { - Directive string - Arguments []string -} - -// Function represents an assembly function. -type Function struct { - Name string - Attributes attr.Attribute - Pragmas []Pragma - Doc []string - Signature *gotypes.Signature - LocalSize int - - Nodes []Node - - // LabelTarget maps from label name to the following instruction. - LabelTarget map[Label]*Instruction - - // Register allocation. - Allocation reg.Allocation - - // ISA is the list of required instruction set extensions. - ISA []string -} - -func (f *Function) section() {} - -// NewFunction builds an empty function of the given name. -func NewFunction(name string) *Function { - return &Function{ - Name: name, - Signature: gotypes.NewSignatureVoid(), - } -} - -// AddPragma adds a pragma to this function. -func (f *Function) AddPragma(directive string, args ...string) { - f.Pragmas = append(f.Pragmas, Pragma{ - Directive: directive, - Arguments: args, - }) -} - -// SetSignature sets the function signature. -func (f *Function) SetSignature(s *gotypes.Signature) { - f.Signature = s -} - -// AllocLocal allocates size bytes in this function's stack. -// Returns a reference to the base pointer for the newly allocated region. -func (f *Function) AllocLocal(size int) operand.Mem { - ptr := operand.NewStackAddr(f.LocalSize) - f.LocalSize += size - return ptr -} - -// AddInstruction appends an instruction to f. -func (f *Function) AddInstruction(i *Instruction) { - f.AddNode(i) -} - -// AddLabel appends a label to f. -func (f *Function) AddLabel(l Label) { - f.AddNode(l) -} - -// AddComment adds comment lines to f. -func (f *Function) AddComment(lines ...string) { - f.AddNode(NewComment(lines...)) -} - -// AddNode appends a Node to f. -func (f *Function) AddNode(n Node) { - f.Nodes = append(f.Nodes, n) -} - -// Instructions returns just the list of instruction nodes. -func (f *Function) Instructions() []*Instruction { - var is []*Instruction - for _, n := range f.Nodes { - i, ok := n.(*Instruction) - if ok { - is = append(is, i) - } - } - return is -} - -// Labels returns just the list of label nodes. -func (f *Function) Labels() []Label { - var lbls []Label - for _, n := range f.Nodes { - lbl, ok := n.(Label) - if ok { - lbls = append(lbls, lbl) - } - } - return lbls -} - -// Stub returns the Go function declaration. -func (f *Function) Stub() string { - return "func " + f.Name + f.Signature.String() -} - -// FrameBytes returns the size of the stack frame in bytes. -func (f *Function) FrameBytes() int { - return f.LocalSize -} - -// ArgumentBytes returns the size of the arguments in bytes. -func (f *Function) ArgumentBytes() int { - return f.Signature.Bytes() -} - -// Datum represents a data element at a particular offset of a data section. -type Datum struct { - Offset int - Value operand.Constant -} - -// NewDatum builds a Datum from the given constant. -func NewDatum(offset int, v operand.Constant) Datum { - return Datum{ - Offset: offset, - Value: v, - } -} - -// Interval returns the range of bytes this datum will occupy within its section. -func (d Datum) Interval() (int, int) { - return d.Offset, d.Offset + d.Value.Bytes() -} - -// Overlaps returns true -func (d Datum) Overlaps(other Datum) bool { - s, e := d.Interval() - so, eo := other.Interval() - return !(eo <= s || e <= so) -} - -// Global represents a DATA section. -type Global struct { - Symbol operand.Symbol - Attributes attr.Attribute - Data []Datum - Size int -} - -// NewGlobal constructs an empty DATA section. -func NewGlobal(sym operand.Symbol) *Global { - return &Global{ - Symbol: sym, - } -} - -// NewStaticGlobal is a convenience for building a static DATA section. -func NewStaticGlobal(name string) *Global { - return NewGlobal(operand.NewStaticSymbol(name)) -} - -func (g *Global) section() {} - -// Base returns a pointer to the start of the data section. -func (g *Global) Base() operand.Mem { - return operand.NewDataAddr(g.Symbol, 0) -} - -// Grow ensures that the data section has at least the given size. -func (g *Global) Grow(size int) { - if g.Size < size { - g.Size = size - } -} - -// AddDatum adds d to this data section, growing it if necessary. Errors if the datum overlaps with existing data. -func (g *Global) AddDatum(d Datum) error { - for _, other := range g.Data { - if d.Overlaps(other) { - return errors.New("overlaps existing datum") - } - } - g.add(d) - return nil -} - -// Append the constant to the end of the data section. -func (g *Global) Append(v operand.Constant) { - g.add(Datum{ - Offset: g.Size, - Value: v, - }) -} - -func (g *Global) add(d Datum) { - _, end := d.Interval() - g.Grow(end) - g.Data = append(g.Data, d) -} diff --git a/vendor/github.com/mmcloughlin/avo/operand/checks.go b/vendor/github.com/mmcloughlin/avo/operand/checks.go deleted file mode 100644 index 2585479d33..0000000000 --- a/vendor/github.com/mmcloughlin/avo/operand/checks.go +++ /dev/null @@ -1,247 +0,0 @@ -package operand - -import "github.com/mmcloughlin/avo/reg" - -// Pure type assertion checks: - -// IsRegister returns whether op has type reg.Register. -func IsRegister(op Op) bool { _, ok := op.(reg.Register); return ok } - -// IsMem returns whether op has type Mem. -func IsMem(op Op) bool { _, ok := op.(Mem); return ok } - -// IsRel returns whether op has type Rel. -func IsRel(op Op) bool { _, ok := op.(Rel); return ok } - -// Checks corresponding to specific operand types in the Intel Manual: - -// Is1 returns true if op is the immediate constant 1. -func Is1(op Op) bool { - i, ok := op.(U8) - return ok && i == 1 -} - -// Is3 returns true if op is the immediate constant 3. -func Is3(op Op) bool { - i, ok := op.(U8) - return ok && i == 3 -} - -// IsIMM2U returns true if op is a 2-bit unsigned immediate (less than 4). -func IsIMM2U(op Op) bool { - i, ok := op.(U8) - return ok && i < 4 -} - -// IsIMM8 returns true is op is an 8-bit immediate. -func IsIMM8(op Op) bool { - _, ok := op.(U8) - return ok -} - -// IsIMM16 returns true is op is a 16-bit immediate. -func IsIMM16(op Op) bool { - _, ok := op.(U16) - return ok -} - -// IsIMM32 returns true is op is a 32-bit immediate. -func IsIMM32(op Op) bool { - _, ok := op.(U32) - return ok -} - -// IsIMM64 returns true is op is a 64-bit immediate. -func IsIMM64(op Op) bool { - _, ok := op.(U64) - return ok -} - -// IsAL returns true if op is the AL register. -func IsAL(op Op) bool { - return op == reg.AL -} - -// IsCL returns true if op is the CL register. -func IsCL(op Op) bool { - return op == reg.CL -} - -// IsAX returns true if op is the 16-bit AX register. -func IsAX(op Op) bool { - return op == reg.AX -} - -// IsEAX returns true if op is the 32-bit EAX register. -func IsEAX(op Op) bool { - return op == reg.EAX -} - -// IsRAX returns true if op is the 64-bit RAX register. -func IsRAX(op Op) bool { - return op == reg.RAX -} - -// IsR8 returns true if op is an 8-bit general-purpose register. -func IsR8(op Op) bool { - return IsGP(op, 1) -} - -// IsR16 returns true if op is a 16-bit general-purpose register. -func IsR16(op Op) bool { - return IsGP(op, 2) -} - -// IsR32 returns true if op is a 32-bit general-purpose register. -func IsR32(op Op) bool { - return IsGP(op, 4) -} - -// IsR64 returns true if op is a 64-bit general-purpose register. -func IsR64(op Op) bool { - return IsGP(op, 8) -} - -// IsPseudo returns true if op is a pseudo register. -func IsPseudo(op Op) bool { - return IsRegisterKind(op, reg.KindPseudo) -} - -// IsGP returns true if op is a general-purpose register of size n bytes. -func IsGP(op Op, n uint) bool { - return IsRegisterKindSize(op, reg.KindGP, n) -} - -// IsXMM0 returns true if op is the X0 register. -func IsXMM0(op Op) bool { - return op == reg.X0 -} - -// IsXMM returns true if op is a 128-bit XMM register. -func IsXMM(op Op) bool { - return IsRegisterKindSize(op, reg.KindVector, 16) -} - -// IsYMM returns true if op is a 256-bit YMM register. -func IsYMM(op Op) bool { - return IsRegisterKindSize(op, reg.KindVector, 32) -} - -// IsRegisterKindSize returns true if op is a register of the given kind and size in bytes. -func IsRegisterKindSize(op Op, k reg.Kind, n uint) bool { - r, ok := op.(reg.Register) - return ok && r.Kind() == k && r.Size() == n -} - -// IsRegisterKind returns true if op is a register of the given kind. -func IsRegisterKind(op Op, k reg.Kind) bool { - r, ok := op.(reg.Register) - return ok && r.Kind() == k -} - -// IsM returns true if op is a 16-, 32- or 64-bit memory operand. -func IsM(op Op) bool { - // TODO(mbm): confirm "m" check is defined correctly - // Intel manual: "A 16-, 32- or 64-bit operand in memory." - return IsM16(op) || IsM32(op) || IsM64(op) -} - -// IsM8 returns true if op is an 8-bit memory operand. -func IsM8(op Op) bool { - // TODO(mbm): confirm "m8" check is defined correctly - // Intel manual: "A byte operand in memory, usually expressed as a variable or - // array name, but pointed to by the DS:(E)SI or ES:(E)DI registers. In 64-bit - // mode, it is pointed to by the RSI or RDI registers." - return IsMSize(op, 1) -} - -// IsM16 returns true if op is a 16-bit memory operand. -func IsM16(op Op) bool { - return IsMSize(op, 2) -} - -// IsM32 returns true if op is a 16-bit memory operand. -func IsM32(op Op) bool { - return IsMSize(op, 4) -} - -// IsM64 returns true if op is a 64-bit memory operand. -func IsM64(op Op) bool { - return IsMSize(op, 8) -} - -// IsMSize returns true if op is a memory operand using general-purpose address -// registers of the given size in bytes. -func IsMSize(op Op, n uint) bool { - // TODO(mbm): should memory operands have a size attribute as well? - // TODO(mbm): m8,m16,m32,m64 checks do not actually check size - m, ok := op.(Mem) - return ok && IsMReg(m.Base) && (m.Index == nil || IsMReg(m.Index)) -} - -// IsMReg returns true if op is a register that can be used in a memory operand. -func IsMReg(op Op) bool { - return IsPseudo(op) || IsRegisterKind(op, reg.KindGP) -} - -// IsM128 returns true if op is a 128-bit memory operand. -func IsM128(op Op) bool { - // TODO(mbm): should "m128" be the same as "m64"? - return IsM64(op) -} - -// IsM256 returns true if op is a 256-bit memory operand. -func IsM256(op Op) bool { - // TODO(mbm): should "m256" be the same as "m64"? - return IsM64(op) -} - -// IsVM32X returns true if op is a vector memory operand with 32-bit XMM index. -func IsVM32X(op Op) bool { - return IsVmx(op) -} - -// IsVM64X returns true if op is a vector memory operand with 64-bit XMM index. -func IsVM64X(op Op) bool { - return IsVmx(op) -} - -// IsVmx returns true if op is a vector memory operand with XMM index. -func IsVmx(op Op) bool { - return isvm(op, IsXMM) -} - -// IsVM32Y returns true if op is a vector memory operand with 32-bit YMM index. -func IsVM32Y(op Op) bool { - return IsVmy(op) -} - -// IsVM64Y returns true if op is a vector memory operand with 64-bit YMM index. -func IsVM64Y(op Op) bool { - return IsVmy(op) -} - -// IsVmy returns true if op is a vector memory operand with YMM index. -func IsVmy(op Op) bool { - return isvm(op, IsYMM) -} - -func isvm(op Op, idx func(Op) bool) bool { - m, ok := op.(Mem) - return ok && IsR64(m.Base) && idx(m.Index) -} - -// IsREL8 returns true if op is an 8-bit offset relative to instruction pointer. -func IsREL8(op Op) bool { - r, ok := op.(Rel) - return ok && r == Rel(int8(r)) -} - -// IsREL32 returns true if op is an offset relative to instruction pointer, or a -// label reference. -func IsREL32(op Op) bool { - // TODO(mbm): should labels be considered separately? - _, rel := op.(Rel) - _, label := op.(LabelRef) - return rel || label -} diff --git a/vendor/github.com/mmcloughlin/avo/operand/const.go b/vendor/github.com/mmcloughlin/avo/operand/const.go deleted file mode 100644 index b2c6a6f77d..0000000000 --- a/vendor/github.com/mmcloughlin/avo/operand/const.go +++ /dev/null @@ -1,36 +0,0 @@ -package operand - -import "fmt" - -// Constant represents a constant literal. -type Constant interface { - Op - Bytes() int - constant() -} - -//go:generate go run make_const.go -output zconst.go - -// String is a string constant. -type String string - -// Asm returns an assembly syntax representation of the string s. -func (s String) Asm() string { return fmt.Sprintf("$%q", s) } - -// Bytes returns the length of s. -func (s String) Bytes() int { return len(s) } - -func (s String) constant() {} - -// Imm returns an unsigned integer constant with size guessed from x. -func Imm(x uint64) Constant { - switch { - case uint64(uint8(x)) == x: - return U8(x) - case uint64(uint16(x)) == x: - return U16(x) - case uint64(uint32(x)) == x: - return U32(x) - } - return U64(x) -} diff --git a/vendor/github.com/mmcloughlin/avo/operand/doc.go b/vendor/github.com/mmcloughlin/avo/operand/doc.go deleted file mode 100644 index 51c44dfb84..0000000000 --- a/vendor/github.com/mmcloughlin/avo/operand/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package operand provides types for instruction operands. -package operand diff --git a/vendor/github.com/mmcloughlin/avo/operand/types.go b/vendor/github.com/mmcloughlin/avo/operand/types.go deleted file mode 100644 index 878425ec1d..0000000000 --- a/vendor/github.com/mmcloughlin/avo/operand/types.go +++ /dev/null @@ -1,151 +0,0 @@ -package operand - -import ( - "fmt" - - "github.com/mmcloughlin/avo/reg" -) - -// Op is an operand. -type Op interface { - Asm() string -} - -// Symbol represents a symbol name. -type Symbol struct { - Name string - Static bool // only visible in current source file -} - -// NewStaticSymbol builds a static Symbol. Static symbols are only visible in the current source file. -func NewStaticSymbol(name string) Symbol { - return Symbol{Name: name, Static: true} -} - -func (s Symbol) String() string { - n := s.Name - if s.Static { - n += "<>" - } - return n -} - -// Mem represents a memory reference. -type Mem struct { - Symbol Symbol - Disp int - Base reg.Register - Index reg.Register - Scale uint8 -} - -// NewParamAddr is a convenience to build a Mem operand pointing to a function -// parameter, which is a named offset from the frame pointer pseudo register. -func NewParamAddr(name string, offset int) Mem { - return Mem{ - Symbol: Symbol{ - Name: name, - Static: false, - }, - Disp: offset, - Base: reg.FramePointer, - } -} - -// NewStackAddr returns a memory reference relative to the stack pointer. -func NewStackAddr(offset int) Mem { - return Mem{ - Disp: offset, - Base: reg.StackPointer, - } -} - -// NewDataAddr returns a memory reference relative to the named data symbol. -func NewDataAddr(sym Symbol, offset int) Mem { - return Mem{ - Symbol: sym, - Disp: offset, - Base: reg.StaticBase, - } -} - -// Offset returns a reference to m plus idx bytes. -func (m Mem) Offset(idx int) Mem { - a := m - a.Disp += idx - return a -} - -// Idx returns a new memory reference with (Index, Scale) set to (r, s). -func (m Mem) Idx(r reg.Register, s uint8) Mem { - a := m - a.Index = r - a.Scale = s - return a -} - -// Asm returns an assembly syntax representation of m. -func (m Mem) Asm() string { - a := m.Symbol.String() - if a != "" { - a += fmt.Sprintf("%+d", m.Disp) - } else if m.Disp != 0 { - a += fmt.Sprintf("%d", m.Disp) - } - if m.Base != nil { - a += fmt.Sprintf("(%s)", m.Base.Asm()) - } - if m.Index != nil && m.Scale != 0 { - a += fmt.Sprintf("(%s*%d)", m.Index.Asm(), m.Scale) - } - return a -} - -// Rel is an offset relative to the instruction pointer. -type Rel int32 - -// Asm returns an assembly syntax representation of r. -func (r Rel) Asm() string { - return fmt.Sprintf(".%+d", r) -} - -// LabelRef is a reference to a label. -type LabelRef string - -// Asm returns an assembly syntax representation of l. -func (l LabelRef) Asm() string { - return string(l) -} - -// Registers returns the list of all operands involved in the given operand. -func Registers(op Op) []reg.Register { - switch op := op.(type) { - case reg.Register: - return []reg.Register{op} - case Mem: - var r []reg.Register - if op.Base != nil { - r = append(r, op.Base) - } - if op.Index != nil { - r = append(r, op.Index) - } - return r - case Constant, Rel, LabelRef: - return nil - } - panic("unknown operand type") -} - -// ApplyAllocation returns an operand with allocated registers replaced. Registers missing from the allocation are left alone. -func ApplyAllocation(op Op, a reg.Allocation) Op { - switch op := op.(type) { - case reg.Register: - return a.LookupRegisterDefault(op) - case Mem: - op.Base = a.LookupRegisterDefault(op.Base) - op.Index = a.LookupRegisterDefault(op.Index) - return op - } - return op -} diff --git a/vendor/github.com/mmcloughlin/avo/operand/zconst.go b/vendor/github.com/mmcloughlin/avo/operand/zconst.go deleted file mode 100644 index 324b4a96f2..0000000000 --- a/vendor/github.com/mmcloughlin/avo/operand/zconst.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by make_const.go. DO NOT EDIT. - -package operand - -import "fmt" - -// I8 is a 8-bit signed integer constant. -type I8 int8 - -func (i I8) Asm() string { return fmt.Sprintf("$%+d", i) } -func (i I8) Bytes() int { return 1 } -func (i I8) constant() {} - -// U8 is a 8-bit unsigned integer constant. -type U8 uint8 - -func (u U8) Asm() string { return fmt.Sprintf("$%#02x", u) } -func (u U8) Bytes() int { return 1 } -func (u U8) constant() {} - -// I16 is a 16-bit signed integer constant. -type I16 int16 - -func (i I16) Asm() string { return fmt.Sprintf("$%+d", i) } -func (i I16) Bytes() int { return 2 } -func (i I16) constant() {} - -// U16 is a 16-bit unsigned integer constant. -type U16 uint16 - -func (u U16) Asm() string { return fmt.Sprintf("$%#04x", u) } -func (u U16) Bytes() int { return 2 } -func (u U16) constant() {} - -// F32 is a 32-bit floating point constant. -type F32 float32 - -func (f F32) Asm() string { return fmt.Sprintf("$(%#v)", f) } -func (f F32) Bytes() int { return 4 } -func (f F32) constant() {} - -// I32 is a 32-bit signed integer constant. -type I32 int32 - -func (i I32) Asm() string { return fmt.Sprintf("$%+d", i) } -func (i I32) Bytes() int { return 4 } -func (i I32) constant() {} - -// U32 is a 32-bit unsigned integer constant. -type U32 uint32 - -func (u U32) Asm() string { return fmt.Sprintf("$%#08x", u) } -func (u U32) Bytes() int { return 4 } -func (u U32) constant() {} - -// F64 is a 64-bit floating point constant. -type F64 float64 - -func (f F64) Asm() string { return fmt.Sprintf("$(%#v)", f) } -func (f F64) Bytes() int { return 8 } -func (f F64) constant() {} - -// I64 is a 64-bit signed integer constant. -type I64 int64 - -func (i I64) Asm() string { return fmt.Sprintf("$%+d", i) } -func (i I64) Bytes() int { return 8 } -func (i I64) constant() {} - -// U64 is a 64-bit unsigned integer constant. -type U64 uint64 - -func (u U64) Asm() string { return fmt.Sprintf("$%#016x", u) } -func (u U64) Bytes() int { return 8 } -func (u U64) constant() {} diff --git a/vendor/github.com/mmcloughlin/avo/pass/alloc.go b/vendor/github.com/mmcloughlin/avo/pass/alloc.go deleted file mode 100644 index fc7773abc1..0000000000 --- a/vendor/github.com/mmcloughlin/avo/pass/alloc.go +++ /dev/null @@ -1,190 +0,0 @@ -package pass - -import ( - "errors" - "math" - "sort" - - "github.com/mmcloughlin/avo/reg" -) - -// edge is an edge of the interference graph, indicating that registers X and Y -// must be in non-conflicting registers. -type edge struct { - X, Y reg.ID -} - -// Allocator is a graph-coloring register allocator. -type Allocator struct { - registers []reg.ID - allocation reg.Allocation - edges []*edge - possible map[reg.ID][]reg.ID -} - -// NewAllocator builds an allocator for the given physical registers. -func NewAllocator(rs []reg.Physical) (*Allocator, error) { - // Set of IDs, excluding restricted registers. - idset := map[reg.ID]bool{} - for _, r := range rs { - if (r.Info() & reg.Restricted) != 0 { - continue - } - idset[r.ID()] = true - } - - if len(idset) == 0 { - return nil, errors.New("no allocatable registers") - } - - // Produce slice of unique register IDs. - var ids []reg.ID - for id := range idset { - ids = append(ids, id) - } - sort.Slice(ids, func(i, j int) bool { return ids[i] < ids[j] }) - - return &Allocator{ - registers: ids, - allocation: reg.NewEmptyAllocation(), - possible: map[reg.ID][]reg.ID{}, - }, nil -} - -// NewAllocatorForKind builds an allocator for the given kind of registers. -func NewAllocatorForKind(k reg.Kind) (*Allocator, error) { - f := reg.FamilyOfKind(k) - if f == nil { - return nil, errors.New("unknown register family") - } - return NewAllocator(f.Registers()) -} - -// AddInterferenceSet records that r interferes with every register in s. Convenience wrapper around AddInterference. -func (a *Allocator) AddInterferenceSet(r reg.Register, s reg.MaskSet) { - for id, mask := range s { - if (r.Mask() & mask) != 0 { - a.AddInterference(r.ID(), id) - } - } -} - -// AddInterference records that x and y must be assigned to non-conflicting physical registers. -func (a *Allocator) AddInterference(x, y reg.ID) { - a.Add(x) - a.Add(y) - a.edges = append(a.edges, &edge{X: x, Y: y}) -} - -// Add adds a register to be allocated. Does nothing if the register has already been added. -func (a *Allocator) Add(v reg.ID) { - if !v.IsVirtual() { - return - } - if _, found := a.possible[v]; found { - return - } - a.possible[v] = a.possibleregisters(v) -} - -// Allocate allocates physical registers. -func (a *Allocator) Allocate() (reg.Allocation, error) { - for { - if err := a.update(); err != nil { - return nil, err - } - - if a.remaining() == 0 { - break - } - - v := a.mostrestricted() - if err := a.alloc(v); err != nil { - return nil, err - } - } - return a.allocation, nil -} - -// update possible allocations based on edges. -func (a *Allocator) update() error { - var rem []*edge - for _, e := range a.edges { - x := a.allocation.LookupDefault(e.X) - y := a.allocation.LookupDefault(e.Y) - switch { - case x.IsVirtual() && y.IsVirtual(): - rem = append(rem, e) - continue - case x.IsPhysical() && y.IsPhysical(): - if x == y { - return errors.New("impossible register allocation") - } - case x.IsPhysical() && y.IsVirtual(): - a.discardconflicting(y, x) - case x.IsVirtual() && y.IsPhysical(): - a.discardconflicting(x, y) - default: - panic("unreachable") - } - } - a.edges = rem - - return nil -} - -// mostrestricted returns the virtual register with the least possibilities. -func (a *Allocator) mostrestricted() reg.ID { - n := int(math.MaxInt32) - var v reg.ID - for w, p := range a.possible { - // On a tie, choose the smallest ID in numeric order. This avoids - // non-deterministic allocations due to map iteration order. - if len(p) < n || (len(p) == n && w < v) { - n = len(p) - v = w - } - } - return v -} - -// discardconflicting removes registers from vs possible list that conflict with p. -func (a *Allocator) discardconflicting(v, p reg.ID) { - a.possible[v] = filterregisters(a.possible[v], func(r reg.ID) bool { - return r != p - }) -} - -// alloc attempts to allocate a register to v. -func (a *Allocator) alloc(v reg.ID) error { - ps := a.possible[v] - if len(ps) == 0 { - return errors.New("failed to allocate registers") - } - p := ps[0] - a.allocation[v] = p - delete(a.possible, v) - return nil -} - -// remaining returns the number of unallocated registers. -func (a *Allocator) remaining() int { - return len(a.possible) -} - -// possibleregisters returns all allocate-able registers for the given virtual. -func (a *Allocator) possibleregisters(v reg.ID) []reg.ID { - return filterregisters(a.registers, func(r reg.ID) bool { - return v.Kind() == r.Kind() - }) -} - -func filterregisters(in []reg.ID, predicate func(reg.ID) bool) []reg.ID { - var rs []reg.ID - for _, r := range in { - if predicate(r) { - rs = append(rs, r) - } - } - return rs -} diff --git a/vendor/github.com/mmcloughlin/avo/pass/cfg.go b/vendor/github.com/mmcloughlin/avo/pass/cfg.go deleted file mode 100644 index d5f6ea4e6f..0000000000 --- a/vendor/github.com/mmcloughlin/avo/pass/cfg.go +++ /dev/null @@ -1,81 +0,0 @@ -package pass - -import ( - "errors" - "fmt" - - "github.com/mmcloughlin/avo/ir" -) - -// LabelTarget populates the LabelTarget of the given function. This maps from -// label name to the following instruction. -func LabelTarget(fn *ir.Function) error { - target := map[ir.Label]*ir.Instruction{} - var pending []ir.Label - for _, node := range fn.Nodes { - switch n := node.(type) { - case ir.Label: - if _, found := target[n]; found { - return fmt.Errorf("duplicate label \"%s\"", n) - } - pending = append(pending, n) - case *ir.Instruction: - for _, label := range pending { - target[label] = n - } - pending = nil - } - } - if len(pending) != 0 { - return errors.New("function ends with label") - } - fn.LabelTarget = target - return nil -} - -// CFG constructs the call-flow-graph for the function. -func CFG(fn *ir.Function) error { - is := fn.Instructions() - n := len(is) - - // Populate successors. - for i := 0; i < n; i++ { - cur := is[i] - var nxt *ir.Instruction - if i+1 < n { - nxt = is[i+1] - } - - // If it's a branch, locate the target. - if cur.IsBranch { - lbl := cur.TargetLabel() - if lbl == nil { - return errors.New("no label for branch instruction") - } - target, found := fn.LabelTarget[*lbl] - if !found { - return fmt.Errorf("unknown label %q", *lbl) - } - cur.Succ = append(cur.Succ, target) - } - - // Otherwise, could continue to the following instruction. - switch { - case cur.IsTerminal: - case cur.IsUnconditionalBranch(): - default: - cur.Succ = append(cur.Succ, nxt) - } - } - - // Populate predecessors. - for _, i := range is { - for _, s := range i.Succ { - if s != nil { - s.Pred = append(s.Pred, i) - } - } - } - - return nil -} diff --git a/vendor/github.com/mmcloughlin/avo/pass/cleanup.go b/vendor/github.com/mmcloughlin/avo/pass/cleanup.go deleted file mode 100644 index d91250f3b8..0000000000 --- a/vendor/github.com/mmcloughlin/avo/pass/cleanup.go +++ /dev/null @@ -1,123 +0,0 @@ -package pass - -import ( - "github.com/mmcloughlin/avo/ir" - "github.com/mmcloughlin/avo/operand" -) - -// PruneJumpToFollowingLabel removes jump instructions that target an -// immediately following label. -func PruneJumpToFollowingLabel(fn *ir.Function) error { - for i := 0; i+1 < len(fn.Nodes); i++ { - node := fn.Nodes[i] - next := fn.Nodes[i+1] - - // This node is an unconditional jump. - inst, ok := node.(*ir.Instruction) - if !ok || !inst.IsBranch || inst.IsConditional { - continue - } - - target := inst.TargetLabel() - if target == nil { - continue - } - - // And the jump target is the immediately following node. - lbl, ok := next.(ir.Label) - if !ok || lbl != *target { - continue - } - - // Then the jump is unnecessary and can be removed. - fn.Nodes = deletenode(fn.Nodes, i) - i-- - } - - return nil -} - -// PruneDanglingLabels removes labels that are not referenced by any branches. -func PruneDanglingLabels(fn *ir.Function) error { - // Count label references. - count := map[ir.Label]int{} - for _, n := range fn.Nodes { - i, ok := n.(*ir.Instruction) - if !ok || !i.IsBranch { - continue - } - - target := i.TargetLabel() - if target == nil { - continue - } - - count[*target]++ - } - - // Look for labels with no references. - for i := 0; i < len(fn.Nodes); i++ { - node := fn.Nodes[i] - lbl, ok := node.(ir.Label) - if !ok { - continue - } - - if count[lbl] == 0 { - fn.Nodes = deletenode(fn.Nodes, i) - i-- - } - } - - return nil -} - -// PruneSelfMoves removes move instructions from one register to itself. -func PruneSelfMoves(fn *ir.Function) error { - return removeinstructions(fn, func(i *ir.Instruction) bool { - switch i.Opcode { - case "MOVB", "MOVW", "MOVL", "MOVQ": - default: - return false - } - - return operand.IsRegister(i.Operands[0]) && operand.IsRegister(i.Operands[1]) && i.Operands[0] == i.Operands[1] - }) -} - -// removeinstructions deletes instructions from the given function which match predicate. -func removeinstructions(fn *ir.Function, predicate func(*ir.Instruction) bool) error { - // Removal of instructions has the potential to invalidate CFG structures. - // Clear them to prevent accidental use of stale structures after this pass. - invalidatecfg(fn) - - for i := 0; i < len(fn.Nodes); i++ { - n := fn.Nodes[i] - - inst, ok := n.(*ir.Instruction) - if !ok || !predicate(inst) { - continue - } - - fn.Nodes = deletenode(fn.Nodes, i) - } - - return nil -} - -// deletenode deletes node i from nodes and returns the resulting slice. -func deletenode(nodes []ir.Node, i int) []ir.Node { - n := len(nodes) - copy(nodes[i:], nodes[i+1:]) - nodes[n-1] = nil - return nodes[:n-1] -} - -// invalidatecfg clears CFG structures. -func invalidatecfg(fn *ir.Function) { - fn.LabelTarget = nil - for _, i := range fn.Instructions() { - i.Pred = nil - i.Succ = nil - } -} diff --git a/vendor/github.com/mmcloughlin/avo/pass/isa.go b/vendor/github.com/mmcloughlin/avo/pass/isa.go deleted file mode 100644 index 951834d17d..0000000000 --- a/vendor/github.com/mmcloughlin/avo/pass/isa.go +++ /dev/null @@ -1,31 +0,0 @@ -package pass - -import ( - "sort" - - "github.com/mmcloughlin/avo/ir" -) - -// RequiredISAExtensions determines ISA extensions required for the given -// function. Populates the ISA field. -func RequiredISAExtensions(fn *ir.Function) error { - // Collect ISA set. - set := map[string]bool{} - for _, i := range fn.Instructions() { - for _, isa := range i.ISA { - set[isa] = true - } - } - - if len(set) == 0 { - return nil - } - - // Populate the function's ISA field with the unique sorted list. - for isa := range set { - fn.ISA = append(fn.ISA, isa) - } - sort.Strings(fn.ISA) - - return nil -} diff --git a/vendor/github.com/mmcloughlin/avo/pass/pass.go b/vendor/github.com/mmcloughlin/avo/pass/pass.go deleted file mode 100644 index 62f37b1079..0000000000 --- a/vendor/github.com/mmcloughlin/avo/pass/pass.go +++ /dev/null @@ -1,100 +0,0 @@ -// Package pass implements processing passes on avo Files. -package pass - -import ( - "io" - - "github.com/mmcloughlin/avo/ir" - "github.com/mmcloughlin/avo/printer" -) - -// Compile pass compiles an avo file. Upon successful completion the avo file -// may be printed to Go assembly. -var Compile = Concat( - Verify, - FunctionPass(PruneJumpToFollowingLabel), - FunctionPass(PruneDanglingLabels), - FunctionPass(LabelTarget), - FunctionPass(CFG), - InstructionPass(ZeroExtend32BitOutputs), - FunctionPass(Liveness), - FunctionPass(AllocateRegisters), - FunctionPass(BindRegisters), - FunctionPass(VerifyAllocation), - Func(IncludeTextFlagHeader), - FunctionPass(PruneSelfMoves), - FunctionPass(RequiredISAExtensions), -) - -// Interface for a processing pass. -type Interface interface { - Execute(*ir.File) error -} - -// Func adapts a function to the pass Interface. -type Func func(*ir.File) error - -// Execute calls p. -func (p Func) Execute(f *ir.File) error { - return p(f) -} - -// FunctionPass is a convenience for implementing a full file pass with a -// function that operates on each avo Function independently. -type FunctionPass func(*ir.Function) error - -// Execute calls p on every function in the file. Exits on the first error. -func (p FunctionPass) Execute(f *ir.File) error { - for _, fn := range f.Functions() { - if err := p(fn); err != nil { - return err - } - } - return nil -} - -// InstructionPass is a convenience for implementing a full file pass with a -// function that operates on each Instruction independently. -type InstructionPass func(*ir.Instruction) error - -// Execute calls p on every instruction in the file. Exits on the first error. -func (p InstructionPass) Execute(f *ir.File) error { - for _, fn := range f.Functions() { - for _, i := range fn.Instructions() { - if err := p(i); err != nil { - return err - } - } - } - return nil -} - -// Concat returns a pass that executes the given passes in order, stopping on the first error. -func Concat(passes ...Interface) Interface { - return Func(func(f *ir.File) error { - for _, p := range passes { - if err := p.Execute(f); err != nil { - return err - } - } - return nil - }) -} - -// Output pass prints a file. -type Output struct { - Writer io.WriteCloser - Printer printer.Printer -} - -// Execute prints f with the configured Printer and writes output to Writer. -func (o *Output) Execute(f *ir.File) error { - b, err := o.Printer.Print(f) - if err != nil { - return err - } - if _, err = o.Writer.Write(b); err != nil { - return err - } - return o.Writer.Close() -} diff --git a/vendor/github.com/mmcloughlin/avo/pass/reg.go b/vendor/github.com/mmcloughlin/avo/pass/reg.go deleted file mode 100644 index 79147b030d..0000000000 --- a/vendor/github.com/mmcloughlin/avo/pass/reg.go +++ /dev/null @@ -1,139 +0,0 @@ -package pass - -import ( - "errors" - - "github.com/mmcloughlin/avo/ir" - "github.com/mmcloughlin/avo/operand" - "github.com/mmcloughlin/avo/reg" -) - -// ZeroExtend32BitOutputs applies the rule that "32-bit operands generate a -// 32-bit result, zero-extended to a 64-bit result in the destination -// general-purpose register" (Intel Software Developer’s Manual, Volume 1, -// 3.4.1.1). -func ZeroExtend32BitOutputs(i *ir.Instruction) error { - for j, op := range i.Outputs { - if !operand.IsR32(op) { - continue - } - r, ok := op.(reg.GP) - if !ok { - panic("r32 operand should satisfy reg.GP") - } - i.Outputs[j] = r.As64() - } - return nil -} - -// Liveness computes register liveness. -func Liveness(fn *ir.Function) error { - // Note this implementation is initially naive so as to be "obviously correct". - // There are a well-known optimizations we can apply if necessary. - - is := fn.Instructions() - - // Process instructions in reverse: poor approximation to topological sort. - // TODO(mbm): process instructions in topological sort order - for l, r := 0, len(is)-1; l < r; l, r = l+1, r-1 { - is[l], is[r] = is[r], is[l] - } - - // Initialize. - for _, i := range is { - i.LiveIn = reg.NewMaskSetFromRegisters(i.InputRegisters()) - i.LiveOut = reg.NewEmptyMaskSet() - } - - // Iterative dataflow analysis. - for { - changes := false - - for _, i := range is { - // out[n] = UNION[s IN succ[n]] in[s] - for _, s := range i.Succ { - if s == nil { - continue - } - changes = i.LiveOut.Update(s.LiveIn) || changes - } - - // in[n] = use[n] UNION (out[n] - def[n]) - def := reg.NewMaskSetFromRegisters(i.OutputRegisters()) - changes = i.LiveIn.Update(i.LiveOut.Difference(def)) || changes - } - - if !changes { - break - } - } - - return nil -} - -// AllocateRegisters performs register allocation. -func AllocateRegisters(fn *ir.Function) error { - // Populate allocators (one per kind). - as := map[reg.Kind]*Allocator{} - for _, i := range fn.Instructions() { - for _, r := range i.Registers() { - k := r.Kind() - if _, found := as[k]; !found { - a, err := NewAllocatorForKind(k) - if err != nil { - return err - } - as[k] = a - } - as[k].Add(r.ID()) - } - } - - // Record register interferences. - for _, i := range fn.Instructions() { - for _, d := range i.OutputRegisters() { - k := d.Kind() - out := i.LiveOut.OfKind(k) - out.DiscardRegister(d) - as[k].AddInterferenceSet(d, out) - } - } - - // Execute register allocation. - fn.Allocation = reg.NewEmptyAllocation() - for _, a := range as { - al, err := a.Allocate() - if err != nil { - return err - } - if err := fn.Allocation.Merge(al); err != nil { - return err - } - } - - return nil -} - -// BindRegisters applies the result of register allocation, replacing all virtual registers with their assigned physical registers. -func BindRegisters(fn *ir.Function) error { - for _, i := range fn.Instructions() { - for idx := range i.Operands { - i.Operands[idx] = operand.ApplyAllocation(i.Operands[idx], fn.Allocation) - } - } - return nil -} - -// VerifyAllocation performs sanity checks following register allocation. -func VerifyAllocation(fn *ir.Function) error { - // All registers should be physical. - for _, i := range fn.Instructions() { - for _, r := range i.Registers() { - if reg.ToPhysical(r) == nil { - return errors.New("non physical register found") - } - } - } - - return nil -} diff --git a/vendor/github.com/mmcloughlin/avo/pass/textflag.go b/vendor/github.com/mmcloughlin/avo/pass/textflag.go deleted file mode 100644 index 35a848b830..0000000000 --- a/vendor/github.com/mmcloughlin/avo/pass/textflag.go +++ /dev/null @@ -1,42 +0,0 @@ -package pass - -import ( - "github.com/mmcloughlin/avo/attr" - "github.com/mmcloughlin/avo/ir" -) - -// IncludeTextFlagHeader includes textflag.h if necessary. -func IncludeTextFlagHeader(f *ir.File) error { - const textflagheader = "textflag.h" - - // Check if we already have it. - for _, path := range f.Includes { - if path == textflagheader { - return nil - } - } - - // Add it if necessary. - if requirestextflags(f) { - f.Includes = append(f.Includes, textflagheader) - } - - return nil -} - -// requirestextflags returns whether the file uses flags in the textflags.h header. -func requirestextflags(f *ir.File) bool { - for _, s := range f.Sections { - var a attr.Attribute - switch s := s.(type) { - case *ir.Function: - a = s.Attributes - case *ir.Global: - a = s.Attributes - } - if a.ContainsTextFlags() { - return true - } - } - return false -} diff --git a/vendor/github.com/mmcloughlin/avo/pass/verify.go b/vendor/github.com/mmcloughlin/avo/pass/verify.go deleted file mode 100644 index 1e7b3683ab..0000000000 --- a/vendor/github.com/mmcloughlin/avo/pass/verify.go +++ /dev/null @@ -1,32 +0,0 @@ -package pass - -import ( - "errors" - - "github.com/mmcloughlin/avo/ir" - "github.com/mmcloughlin/avo/operand" -) - -// Verify pass validates an avo file. -var Verify = Concat( - InstructionPass(VerifyMemOperands), -) - -// VerifyMemOperands checks the instruction's memory operands. -func VerifyMemOperands(i *ir.Instruction) error { - for _, op := range i.Operands { - m, ok := op.(operand.Mem) - if !ok { - continue - } - - if m.Base == nil { - return errors.New("bad memory operand: missing base register") - } - - if m.Index != nil && m.Scale == 0 { - return errors.New("bad memory operand: index register with scale 0") - } - } - return nil -} diff --git a/vendor/github.com/mmcloughlin/avo/printer/goasm.go b/vendor/github.com/mmcloughlin/avo/printer/goasm.go deleted file mode 100644 index 0d8a12cbe2..0000000000 --- a/vendor/github.com/mmcloughlin/avo/printer/goasm.go +++ /dev/null @@ -1,186 +0,0 @@ -package printer - -import ( - "strconv" - "strings" - - "github.com/mmcloughlin/avo/internal/prnt" - "github.com/mmcloughlin/avo/ir" - "github.com/mmcloughlin/avo/operand" -) - -// dot is the pesky unicode dot used in Go assembly. -const dot = "\u00b7" - -type goasm struct { - cfg Config - prnt.Generator - - instructions []*ir.Instruction - clear bool -} - -// NewGoAsm constructs a printer for writing Go assembly files. -func NewGoAsm(cfg Config) Printer { - return &goasm{cfg: cfg} -} - -func (p *goasm) Print(f *ir.File) ([]byte, error) { - p.header(f) - for _, s := range f.Sections { - switch s := s.(type) { - case *ir.Function: - p.function(s) - case *ir.Global: - p.global(s) - default: - panic("unknown section type") - } - } - return p.Result() -} - -func (p *goasm) header(f *ir.File) { - p.Comment(p.cfg.GeneratedWarning()) - - if len(f.Constraints) > 0 { - p.NL() - p.Printf(f.Constraints.GoString()) - } - - if len(f.Includes) > 0 { - p.NL() - p.includes(f.Includes) - } -} - -func (p *goasm) includes(paths []string) { - for _, path := range paths { - p.Printf("#include \"%s\"\n", path) - } -} - -func (p *goasm) function(f *ir.Function) { - p.NL() - p.Comment(f.Stub()) - - if len(f.ISA) > 0 { - p.Comment("Requires: " + strings.Join(f.ISA, ", ")) - } - - // Reference: https://github.com/golang/go/blob/b115207baf6c2decc3820ada4574ef4e5ad940ec/src/cmd/internal/obj/util.go#L166-L176 - // - // if p.As == ATEXT { - // // If there are attributes, print them. Otherwise, skip the comma. - // // In short, print one of these two: - // // TEXT foo(SB), DUPOK|NOSPLIT, $0 - // // TEXT foo(SB), $0 - // s := p.From.Sym.Attribute.TextAttrString() - // if s != "" { - // fmt.Fprintf(&buf, "%s%s", sep, s) - // sep = ", " - // } - // } - // - p.Printf("TEXT %s%s(SB)", dot, f.Name) - if f.Attributes != 0 { - p.Printf(", %s", f.Attributes.Asm()) - } - p.Printf(", %s\n", textsize(f)) - - p.clear = true - for _, node := range f.Nodes { - switch n := node.(type) { - case *ir.Instruction: - p.instruction(n) - if n.IsTerminal || n.IsUnconditionalBranch() { - p.flush() - } - case ir.Label: - p.flush() - p.ensureclear() - p.Printf("%s:\n", n) - case *ir.Comment: - p.flush() - p.ensureclear() - for _, line := range n.Lines { - p.Printf("\t// %s\n", line) - } - default: - panic("unexpected node type") - } - } - p.flush() -} - -func (p *goasm) instruction(i *ir.Instruction) { - p.instructions = append(p.instructions, i) - p.clear = false -} - -func (p *goasm) flush() { - if len(p.instructions) == 0 { - return - } - - // Determine instruction width. Instructions with no operands are not - // considered in this calculation. - width := 0 - for _, i := range p.instructions { - if len(i.Operands) > 0 && len(i.Opcode) > width { - width = len(i.Opcode) - } - } - - // Output instruction block. - for _, i := range p.instructions { - if len(i.Operands) > 0 { - p.Printf("\t%-*s%s\n", width+1, i.Opcode, joinOperands(i.Operands)) - } else { - p.Printf("\t%s\n", i.Opcode) - } - } - - p.instructions = nil -} - -func (p *goasm) ensureclear() { - if !p.clear { - p.NL() - p.clear = true - } -} - -func (p *goasm) global(g *ir.Global) { - p.NL() - for _, d := range g.Data { - a := operand.NewDataAddr(g.Symbol, d.Offset) - p.Printf("DATA %s/%d, %s\n", a.Asm(), d.Value.Bytes(), d.Value.Asm()) - } - p.Printf("GLOBL %s(SB), %s, $%d\n", g.Symbol, g.Attributes.Asm(), g.Size) -} - -func textsize(f *ir.Function) string { - // Reference: https://github.com/golang/go/blob/b115207baf6c2decc3820ada4574ef4e5ad940ec/src/cmd/internal/obj/util.go#L260-L265 - // - // case TYPE_TEXTSIZE: - // if a.Val.(int32) == objabi.ArgsSizeUnknown { - // str = fmt.Sprintf("$%d", a.Offset) - // } else { - // str = fmt.Sprintf("$%d-%d", a.Offset, a.Val.(int32)) - // } - // - s := "$" + strconv.Itoa(f.FrameBytes()) - if argsize := f.ArgumentBytes(); argsize > 0 { - return s + "-" + strconv.Itoa(argsize) - } - return s -} - -func joinOperands(operands []operand.Op) string { - asm := make([]string, len(operands)) - for i, op := range operands { - asm[i] = op.Asm() - } - return strings.Join(asm, ", ") -} diff --git a/vendor/github.com/mmcloughlin/avo/printer/printer.go b/vendor/github.com/mmcloughlin/avo/printer/printer.go deleted file mode 100644 index b562c74ea8..0000000000 --- a/vendor/github.com/mmcloughlin/avo/printer/printer.go +++ /dev/null @@ -1,98 +0,0 @@ -// Package printer implements printing of avo files in various formats. -package printer - -import ( - "fmt" - "os" - "path/filepath" - "strings" - - "github.com/mmcloughlin/avo/internal/stack" - "github.com/mmcloughlin/avo/ir" -) - -// Printer can produce output for an avo File. -type Printer interface { - Print(*ir.File) ([]byte, error) -} - -// Builder can construct a printer. -type Builder func(Config) Printer - -// Config represents general printing configuration. -type Config struct { - // Command-line arguments passed to the generator. If provided, this will be - // included in a code generation warning. - Argv []string - - // Name of the code generator. - Name string - - // Name of Go package the generated code will belong to. - Pkg string -} - -// NewDefaultConfig produces a config with Name "avo". -// The package name is guessed from the current directory. -func NewDefaultConfig() Config { - return Config{ - Name: "avo", - Pkg: pkg(), - } -} - -// NewArgvConfig constructs a Config from os.Args. -// The package name is guessed from the current directory. -func NewArgvConfig() Config { - return Config{ - Argv: os.Args, - Pkg: pkg(), - } -} - -// NewGoRunConfig produces a Config for a generator that's expected to be -// executed via "go run ...". -func NewGoRunConfig() Config { - path := mainfile() - if path == "" { - return NewDefaultConfig() - } - argv := []string{"go", "run", filepath.Base(path)} - if len(os.Args) > 1 { - argv = append(argv, os.Args[1:]...) - } - return Config{ - Argv: argv, - Pkg: pkg(), - } -} - -// GeneratedBy returns a description of the code generator. -func (c Config) GeneratedBy() string { - if c.Argv == nil { - return c.Name - } - return fmt.Sprintf("command: %s", strings.Join(c.Argv, " ")) -} - -// GeneratedWarning returns text for a code generation warning. Conforms to https://golang.org/s/generatedcode. -func (c Config) GeneratedWarning() string { - return fmt.Sprintf("Code generated by %s. DO NOT EDIT.", c.GeneratedBy()) -} - -// mainfile attempts to determine the file path of the main function by -// inspecting the stack. Returns empty string on failure. -func mainfile() string { - if m := stack.Main(); m != nil { - return m.File - } - return "" -} - -// pkg guesses the name of the package from the working directory. -func pkg() string { - if cwd, err := os.Getwd(); err == nil { - return filepath.Base(cwd) - } - return "" -} diff --git a/vendor/github.com/mmcloughlin/avo/printer/stubs.go b/vendor/github.com/mmcloughlin/avo/printer/stubs.go deleted file mode 100644 index 171bc62991..0000000000 --- a/vendor/github.com/mmcloughlin/avo/printer/stubs.go +++ /dev/null @@ -1,45 +0,0 @@ -package printer - -import ( - "github.com/mmcloughlin/avo/internal/prnt" - "github.com/mmcloughlin/avo/ir" -) - -type stubs struct { - cfg Config - prnt.Generator -} - -// NewStubs constructs a printer for writing stub function declarations. -func NewStubs(cfg Config) Printer { - return &stubs{cfg: cfg} -} - -func (s *stubs) Print(f *ir.File) ([]byte, error) { - s.Comment(s.cfg.GeneratedWarning()) - - if len(f.Constraints) > 0 { - s.NL() - s.Printf(f.Constraints.GoString()) - } - - s.NL() - s.Printf("package %s\n", s.cfg.Pkg) - for _, fn := range f.Functions() { - s.NL() - s.Comment(fn.Doc...) - for _, pragma := range fn.Pragmas { - s.pragma(pragma) - } - s.Printf("%s\n", fn.Stub()) - } - return s.Result() -} - -func (s *stubs) pragma(p ir.Pragma) { - s.Printf("//go:%s", p.Directive) - for _, arg := range p.Arguments { - s.Printf(" %s", arg) - } - s.NL() -} diff --git a/vendor/github.com/mmcloughlin/avo/reg/collection.go b/vendor/github.com/mmcloughlin/avo/reg/collection.go deleted file mode 100644 index d35c3a03ce..0000000000 --- a/vendor/github.com/mmcloughlin/avo/reg/collection.go +++ /dev/null @@ -1,54 +0,0 @@ -package reg - -// Collection represents a collection of virtual registers. This is primarily -// useful for allocating virtual registers with distinct IDs. -type Collection struct { - idx map[Kind]Index -} - -// NewCollection builds an empty register collection. -func NewCollection() *Collection { - return &Collection{ - idx: map[Kind]Index{}, - } -} - -// VirtualRegister allocates and returns a new virtual register of the given kind and width. -func (c *Collection) VirtualRegister(k Kind, s Spec) Virtual { - idx := c.idx[k] - c.idx[k]++ - return NewVirtual(idx, k, s) -} - -// GP8L allocates and returns a general-purpose 8-bit register (low byte). -func (c *Collection) GP8L() GPVirtual { return c.GP(S8L) } - -// GP8H allocates and returns a general-purpose 8-bit register (high byte). -func (c *Collection) GP8H() GPVirtual { return c.GP(S8H) } - -// GP8 allocates and returns a general-purpose 8-bit register (low byte). -func (c *Collection) GP8() GPVirtual { return c.GP8L() } - -// GP16 allocates and returns a general-purpose 16-bit register. -func (c *Collection) GP16() GPVirtual { return c.GP(S16) } - -// GP32 allocates and returns a general-purpose 32-bit register. -func (c *Collection) GP32() GPVirtual { return c.GP(S32) } - -// GP64 allocates and returns a general-purpose 64-bit register. -func (c *Collection) GP64() GPVirtual { return c.GP(S64) } - -// GP allocates and returns a general-purpose register of the given width. -func (c *Collection) GP(s Spec) GPVirtual { return newgpv(c.VirtualRegister(KindGP, s)) } - -// XMM allocates and returns a 128-bit vector register. -func (c *Collection) XMM() VecVirtual { return c.Vec(S128) } - -// YMM allocates and returns a 256-bit vector register. -func (c *Collection) YMM() VecVirtual { return c.Vec(S256) } - -// ZMM allocates and returns a 512-bit vector register. -func (c *Collection) ZMM() VecVirtual { return c.Vec(S512) } - -// Vec allocates and returns a vector register of the given width. -func (c *Collection) Vec(s Spec) VecVirtual { return newvecv(c.VirtualRegister(KindVector, s)) } diff --git a/vendor/github.com/mmcloughlin/avo/reg/doc.go b/vendor/github.com/mmcloughlin/avo/reg/doc.go deleted file mode 100644 index 1c0aee374a..0000000000 --- a/vendor/github.com/mmcloughlin/avo/reg/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package reg provides types for physical and virtual registers, and definitions of x86-64 register families. -package reg diff --git a/vendor/github.com/mmcloughlin/avo/reg/set.go b/vendor/github.com/mmcloughlin/avo/reg/set.go deleted file mode 100644 index 2cf88147c5..0000000000 --- a/vendor/github.com/mmcloughlin/avo/reg/set.go +++ /dev/null @@ -1,112 +0,0 @@ -package reg - -// MaskSet maps register IDs to masks. -type MaskSet map[ID]uint16 - -// NewEmptyMaskSet builds an empty register mask set. -func NewEmptyMaskSet() MaskSet { - return MaskSet{} -} - -// NewMaskSetFromRegisters forms a mask set from the given register list. -func NewMaskSetFromRegisters(rs []Register) MaskSet { - s := NewEmptyMaskSet() - for _, r := range rs { - s.AddRegister(r) - } - return s -} - -// Clone returns a copy of s. -func (s MaskSet) Clone() MaskSet { - c := NewEmptyMaskSet() - for id, mask := range s { - c.Add(id, mask) - } - return c -} - -// Add mask to the given register ID. -// Reports whether this made any change to the set. -func (s MaskSet) Add(id ID, mask uint16) bool { - if (s[id] & mask) == mask { - return false - } - s[id] |= mask - return true -} - -// AddRegister is a convenience for adding the register's (ID, mask) to the set. -// Reports whether this made any change to the set. -func (s MaskSet) AddRegister(r Register) bool { - return s.Add(r.ID(), r.Mask()) -} - -// Discard clears masked bits from register ID. -// Reports whether this made any change to the set. -func (s MaskSet) Discard(id ID, mask uint16) bool { - if curr, found := s[id]; !found || (curr&mask) == 0 { - return false - } - s[id] &^= mask - if s[id] == 0 { - delete(s, id) - } - return true -} - -// DiscardRegister is a convenience for discarding the register's (ID, mask) from the set. -// Reports whether this made any change to the set. -func (s MaskSet) DiscardRegister(r Register) bool { - return s.Discard(r.ID(), r.Mask()) -} - -// Update adds masks in t to s. -// Reports whether this made any change to the set. -func (s MaskSet) Update(t MaskSet) bool { - change := false - for id, mask := range t { - change = s.Add(id, mask) || change - } - return change -} - -// Difference returns the set of registers in s but not t. -func (s MaskSet) Difference(t MaskSet) MaskSet { - d := s.Clone() - d.DifferenceUpdate(t) - return d -} - -// DifferenceUpdate removes every element of t from s. -func (s MaskSet) DifferenceUpdate(t MaskSet) bool { - change := false - for id, mask := range t { - change = s.Discard(id, mask) || change - } - return change -} - -// Equals returns true if s and t contain the same masks. -func (s MaskSet) Equals(t MaskSet) bool { - if len(s) != len(t) { - return false - } - for id, mask := range s { - if _, found := t[id]; !found || mask != t[id] { - return false - } - } - return true -} - -// OfKind returns the set of elements of s with kind k. -func (s MaskSet) OfKind(k Kind) MaskSet { - t := NewEmptyMaskSet() - for id, mask := range s { - if id.Kind() == k { - t.Add(id, mask) - } - } - return t -} diff --git a/vendor/github.com/mmcloughlin/avo/reg/types.go b/vendor/github.com/mmcloughlin/avo/reg/types.go deleted file mode 100644 index 9f69e9168b..0000000000 --- a/vendor/github.com/mmcloughlin/avo/reg/types.go +++ /dev/null @@ -1,304 +0,0 @@ -package reg - -import ( - "errors" - "fmt" -) - -// Kind is a class of registers. -type Kind uint8 - -// Index of a register within a kind. -type Index uint16 - -// Family is a collection of Physical registers of a common kind. -type Family struct { - Kind Kind - registers []Physical -} - -// define builds a register and adds it to the Family. -func (f *Family) define(s Spec, idx Index, name string, flags ...Info) Physical { - r := newregister(f, s, idx, name, flags...) - f.add(r) - return r -} - -// add r to the family. -func (f *Family) add(r Physical) { - if r.Kind() != f.Kind { - panic("bad kind") - } - f.registers = append(f.registers, r) -} - -// Virtual returns a virtual register from this family's kind. -func (f *Family) Virtual(idx Index, s Spec) Virtual { - return NewVirtual(idx, f.Kind, s) -} - -// Registers returns the registers in this family. -func (f *Family) Registers() []Physical { - return append([]Physical(nil), f.registers...) -} - -// Lookup returns the register with given physical index and spec. Returns nil if no such register exists. -func (f *Family) Lookup(idx Index, s Spec) Physical { - for _, r := range f.registers { - if r.PhysicalIndex() == idx && r.Mask() == s.Mask() { - return r - } - } - return nil -} - -// ID is a register identifier. -type ID uint32 - -// newid builds a new register ID from the virtual flag v, kind and index. -func newid(v uint8, kind Kind, idx Index) ID { - return ID(v) | (ID(kind) << 8) | (ID(idx) << 16) -} - -// IsVirtual reports whether this is an ID for a virtual register. -func (id ID) IsVirtual() bool { return (id & 1) == 1 } - -// IsPhysical reports whether this is an ID for a physical register. -func (id ID) IsPhysical() bool { return !id.IsVirtual() } - -// Kind extracts the kind from the register ID. -func (id ID) Kind() Kind { return Kind(id >> 8) } - -// Index extracts the index from the register ID. -func (id ID) Index() Index { return Index(id >> 16) } - -// Register represents a virtual or physical register. -type Register interface { - ID() ID - Kind() Kind - Size() uint - Mask() uint16 - Asm() string - as(Spec) Register - spec() Spec - register() -} - -// Equal reports whether a and b are equal registers. -func Equal(a, b Register) bool { - return (a.ID() == b.ID()) && (a.Mask() == b.Mask()) -} - -// Virtual is a register of a given type and size, not yet allocated to a physical register. -type Virtual interface { - VirtualIndex() Index - Register -} - -// ToVirtual converts r to Virtual if possible, otherwise returns nil. -func ToVirtual(r Register) Virtual { - if v, ok := r.(Virtual); ok { - return v - } - return nil -} - -type virtual struct { - idx Index - kind Kind - Spec -} - -// NewVirtual builds a Virtual register. -func NewVirtual(idx Index, k Kind, s Spec) Virtual { - return virtual{ - idx: idx, - kind: k, - Spec: s, - } -} - -func (v virtual) ID() ID { return newid(1, v.kind, v.idx) } -func (v virtual) VirtualIndex() Index { return v.idx } -func (v virtual) Kind() Kind { return v.kind } - -func (v virtual) Asm() string { - // TODO(mbm): decide on virtual register syntax - return fmt.Sprintf("", v.idx, v.Kind(), v.Size()) -} - -func (v virtual) as(s Spec) Register { - return virtual{ - idx: v.idx, - kind: v.kind, - Spec: s, - } -} - -func (v virtual) spec() Spec { return v.Spec } -func (v virtual) register() {} - -// Info is a bitmask of register properties. -type Info uint8 - -// Defined register Info flags. -const ( - None Info = 0 - Restricted Info = 1 << iota -) - -// Physical is a concrete register. -type Physical interface { - PhysicalIndex() Index - Info() Info - Register -} - -// ToPhysical converts r to Physical if possible, otherwise returns nil. -func ToPhysical(r Register) Physical { - if p, ok := r.(Physical); ok { - return p - } - return nil -} - -// register implements Physical. -type register struct { - family *Family - idx Index - name string - info Info - Spec -} - -func newregister(f *Family, s Spec, idx Index, name string, flags ...Info) register { - r := register{ - family: f, - idx: idx, - name: name, - info: None, - Spec: s, - } - for _, flag := range flags { - r.info |= flag - } - return r -} - -func (r register) ID() ID { return newid(0, r.Kind(), r.idx) } -func (r register) PhysicalIndex() Index { return r.idx } -func (r register) Kind() Kind { return r.family.Kind } -func (r register) Asm() string { return r.name } -func (r register) Info() Info { return r.info } - -func (r register) as(s Spec) Register { - return r.family.Lookup(r.PhysicalIndex(), s) -} - -func (r register) spec() Spec { return r.Spec } -func (r register) register() {} - -// Spec defines the size of a register as well as the bit ranges it occupies in -// an underlying physical register. -type Spec uint16 - -// Spec values required for x86-64. -const ( - S0 Spec = 0x0 // zero value reserved for pseudo registers - S8L Spec = 0x1 - S8H Spec = 0x2 - S8 = S8L - S16 Spec = 0x3 - S32 Spec = 0x7 - S64 Spec = 0xf - S128 Spec = 0x1f - S256 Spec = 0x3f - S512 Spec = 0x7f -) - -// Mask returns a mask representing which bytes of an underlying register are -// used by this register. This is almost always the low bytes, except for the -// case of the high-byte registers. If bit n of the mask is set, this means -// bytes 2^(n-1) to 2^n-1 are used. -func (s Spec) Mask() uint16 { - return uint16(s) -} - -// Size returns the register width in bytes. -func (s Spec) Size() uint { - x := uint(s) - return (x >> 1) + (x & 1) -} - -// LookupPhysical returns the physical register with the given parameters, or nil if not found. -func LookupPhysical(k Kind, idx Index, s Spec) Physical { - f := FamilyOfKind(k) - if f == nil { - return nil - } - return f.Lookup(idx, s) -} - -// LookupID returns the physical register with the given id and spec, or nil if not found. -func LookupID(id ID, s Spec) Physical { - if id.IsVirtual() { - return nil - } - return LookupPhysical(id.Kind(), id.Index(), s) -} - -// Allocation records a register allocation. -type Allocation map[ID]ID - -// NewEmptyAllocation builds an empty register allocation. -func NewEmptyAllocation() Allocation { - return Allocation{} -} - -// Merge allocations from b into a. Errors if there is disagreement on a common -// register. -func (a Allocation) Merge(b Allocation) error { - for id, p := range b { - if alt, found := a[id]; found && alt != p { - return errors.New("disagreement on overlapping register") - } - a[id] = p - } - return nil -} - -// LookupDefault returns the register ID assigned by this allocation, returning -// id if none is found. -func (a Allocation) LookupDefault(id ID) ID { - if _, found := a[id]; found { - return a[id] - } - return id -} - -// LookupRegister the allocation for register r, or return nil if there is none. -func (a Allocation) LookupRegister(r Register) Physical { - // Return immediately if it is already a physical register. - if p := ToPhysical(r); p != nil { - return p - } - - // Lookup an allocation for this virtual ID. - id, found := a[r.ID()] - if !found { - return nil - } - - return LookupID(id, r.spec()) -} - -// LookupRegisterDefault returns the register assigned to r, or r itself if there is none. -func (a Allocation) LookupRegisterDefault(r Register) Register { - if r == nil { - return nil - } - if p := a.LookupRegister(r); p != nil { - return p - } - return r -} diff --git a/vendor/github.com/mmcloughlin/avo/reg/x86.go b/vendor/github.com/mmcloughlin/avo/reg/x86.go deleted file mode 100644 index a1ec94c73f..0000000000 --- a/vendor/github.com/mmcloughlin/avo/reg/x86.go +++ /dev/null @@ -1,331 +0,0 @@ -package reg - -// Register kinds. -const ( - KindPseudo Kind = iota - KindGP - KindVector -) - -// Declare register families. -var ( - Pseudo = &Family{Kind: KindPseudo} - GeneralPurpose = &Family{Kind: KindGP} - Vector = &Family{Kind: KindVector} - - Families = []*Family{ - Pseudo, - GeneralPurpose, - Vector, - } -) - -var familiesByKind = map[Kind]*Family{} - -func init() { - for _, f := range Families { - familiesByKind[f.Kind] = f - } -} - -// FamilyOfKind returns the Family of registers of the given kind, or nil if not found. -func FamilyOfKind(k Kind) *Family { - return familiesByKind[k] -} - -// Pseudo registers. -var ( - FramePointer = Pseudo.define(S0, 0, "FP") - ProgramCounter = Pseudo.define(S0, 0, "PC") - StaticBase = Pseudo.define(S0, 0, "SB") - StackPointer = Pseudo.define(S0, 0, "SP") -) - -// GP provides additional methods for general purpose registers. -type GP interface { - As8() Register - As8L() Register - As8H() Register - As16() Register - As32() Register - As64() Register -} - -// GPPhysical is a general-purpose physical register. -type GPPhysical interface { - Physical - GP -} - -type gpp struct { - Physical -} - -func newgpp(r Physical) GPPhysical { return gpp{Physical: r} } - -func (p gpp) As8() Register { return newgpp(p.as(S8).(Physical)) } -func (p gpp) As8L() Register { return newgpp(p.as(S8L).(Physical)) } -func (p gpp) As8H() Register { return newgpp(p.as(S8H).(Physical)) } -func (p gpp) As16() Register { return newgpp(p.as(S16).(Physical)) } -func (p gpp) As32() Register { return newgpp(p.as(S32).(Physical)) } -func (p gpp) As64() Register { return newgpp(p.as(S64).(Physical)) } - -// GPVirtual is a general-purpose virtual register. -type GPVirtual interface { - Virtual - GP -} - -type gpv struct { - Virtual -} - -func newgpv(v Virtual) GPVirtual { return gpv{Virtual: v} } - -func (v gpv) As8() Register { return newgpv(v.as(S8).(Virtual)) } -func (v gpv) As8L() Register { return newgpv(v.as(S8L).(Virtual)) } -func (v gpv) As8H() Register { return newgpv(v.as(S8H).(Virtual)) } -func (v gpv) As16() Register { return newgpv(v.as(S16).(Virtual)) } -func (v gpv) As32() Register { return newgpv(v.as(S32).(Virtual)) } -func (v gpv) As64() Register { return newgpv(v.as(S64).(Virtual)) } - -func gp(s Spec, id Index, name string, flags ...Info) GPPhysical { - r := newgpp(newregister(GeneralPurpose, s, id, name, flags...)) - GeneralPurpose.add(r) - return r -} - -// General purpose registers. -var ( - // Low byte - AL = gp(S8L, 0, "AL") - CL = gp(S8L, 1, "CL") - DL = gp(S8L, 2, "DL") - BL = gp(S8L, 3, "BL") - - // High byte - AH = gp(S8H, 0, "AH") - CH = gp(S8H, 1, "CH") - DH = gp(S8H, 2, "DH") - BH = gp(S8H, 3, "BH") - - // 8-bit - SPB = gp(S8, 4, "SP", Restricted) - BPB = gp(S8, 5, "BP") - SIB = gp(S8, 6, "SI") - DIB = gp(S8, 7, "DI") - R8B = gp(S8, 8, "R8") - R9B = gp(S8, 9, "R9") - R10B = gp(S8, 10, "R10") - R11B = gp(S8, 11, "R11") - R12B = gp(S8, 12, "R12") - R13B = gp(S8, 13, "R13") - R14B = gp(S8, 14, "R14") - R15B = gp(S8, 15, "R15") - - // 16-bit - AX = gp(S16, 0, "AX") - CX = gp(S16, 1, "CX") - DX = gp(S16, 2, "DX") - BX = gp(S16, 3, "BX") - SP = gp(S16, 4, "SP", Restricted) - BP = gp(S16, 5, "BP") - SI = gp(S16, 6, "SI") - DI = gp(S16, 7, "DI") - R8W = gp(S16, 8, "R8") - R9W = gp(S16, 9, "R9") - R10W = gp(S16, 10, "R10") - R11W = gp(S16, 11, "R11") - R12W = gp(S16, 12, "R12") - R13W = gp(S16, 13, "R13") - R14W = gp(S16, 14, "R14") - R15W = gp(S16, 15, "R15") - - // 32-bit - EAX = gp(S32, 0, "AX") - ECX = gp(S32, 1, "CX") - EDX = gp(S32, 2, "DX") - EBX = gp(S32, 3, "BX") - ESP = gp(S32, 4, "SP", Restricted) - EBP = gp(S32, 5, "BP") - ESI = gp(S32, 6, "SI") - EDI = gp(S32, 7, "DI") - R8L = gp(S32, 8, "R8") - R9L = gp(S32, 9, "R9") - R10L = gp(S32, 10, "R10") - R11L = gp(S32, 11, "R11") - R12L = gp(S32, 12, "R12") - R13L = gp(S32, 13, "R13") - R14L = gp(S32, 14, "R14") - R15L = gp(S32, 15, "R15") - - // 64-bit - RAX = gp(S64, 0, "AX") - RCX = gp(S64, 1, "CX") - RDX = gp(S64, 2, "DX") - RBX = gp(S64, 3, "BX") - RSP = gp(S64, 4, "SP", Restricted) - RBP = gp(S64, 5, "BP") - RSI = gp(S64, 6, "SI") - RDI = gp(S64, 7, "DI") - R8 = gp(S64, 8, "R8") - R9 = gp(S64, 9, "R9") - R10 = gp(S64, 10, "R10") - R11 = gp(S64, 11, "R11") - R12 = gp(S64, 12, "R12") - R13 = gp(S64, 13, "R13") - R14 = gp(S64, 14, "R14") - R15 = gp(S64, 15, "R15") -) - -// Vec provides methods for vector registers. -type Vec interface { - AsX() Register - AsY() Register - AsZ() Register -} - -// VecPhysical is a physical vector register. -type VecPhysical interface { - Physical - Vec -} - -type vecp struct { - Physical - Vec -} - -func newvecp(r Physical) VecPhysical { return vecp{Physical: r} } - -func (p vecp) AsX() Register { return newvecp(p.as(S128).(Physical)) } -func (p vecp) AsY() Register { return newvecp(p.as(S256).(Physical)) } -func (p vecp) AsZ() Register { return newvecp(p.as(S512).(Physical)) } - -// VecVirtual is a virtual vector register. -type VecVirtual interface { - Virtual - Vec -} - -type vecv struct { - Virtual - Vec -} - -func newvecv(v Virtual) VecVirtual { return vecv{Virtual: v} } - -func (v vecv) AsX() Register { return newvecv(v.as(S128).(Virtual)) } -func (v vecv) AsY() Register { return newvecv(v.as(S256).(Virtual)) } -func (v vecv) AsZ() Register { return newvecv(v.as(S512).(Virtual)) } - -func vec(s Spec, id Index, name string, flags ...Info) VecPhysical { - r := newvecp(newregister(Vector, s, id, name, flags...)) - Vector.add(r) - return r -} - -// Vector registers. -var ( - // 128-bit - X0 = vec(S128, 0, "X0") - X1 = vec(S128, 1, "X1") - X2 = vec(S128, 2, "X2") - X3 = vec(S128, 3, "X3") - X4 = vec(S128, 4, "X4") - X5 = vec(S128, 5, "X5") - X6 = vec(S128, 6, "X6") - X7 = vec(S128, 7, "X7") - X8 = vec(S128, 8, "X8") - X9 = vec(S128, 9, "X9") - X10 = vec(S128, 10, "X10") - X11 = vec(S128, 11, "X11") - X12 = vec(S128, 12, "X12") - X13 = vec(S128, 13, "X13") - X14 = vec(S128, 14, "X14") - X15 = vec(S128, 15, "X15") - X16 = vec(S128, 16, "X16") - X17 = vec(S128, 17, "X17") - X18 = vec(S128, 18, "X18") - X19 = vec(S128, 19, "X19") - X20 = vec(S128, 20, "X20") - X21 = vec(S128, 21, "X21") - X22 = vec(S128, 22, "X22") - X23 = vec(S128, 23, "X23") - X24 = vec(S128, 24, "X24") - X25 = vec(S128, 25, "X25") - X26 = vec(S128, 26, "X26") - X27 = vec(S128, 27, "X27") - X28 = vec(S128, 28, "X28") - X29 = vec(S128, 29, "X29") - X30 = vec(S128, 30, "X30") - X31 = vec(S128, 31, "X31") - - // 256-bit - Y0 = vec(S256, 0, "Y0") - Y1 = vec(S256, 1, "Y1") - Y2 = vec(S256, 2, "Y2") - Y3 = vec(S256, 3, "Y3") - Y4 = vec(S256, 4, "Y4") - Y5 = vec(S256, 5, "Y5") - Y6 = vec(S256, 6, "Y6") - Y7 = vec(S256, 7, "Y7") - Y8 = vec(S256, 8, "Y8") - Y9 = vec(S256, 9, "Y9") - Y10 = vec(S256, 10, "Y10") - Y11 = vec(S256, 11, "Y11") - Y12 = vec(S256, 12, "Y12") - Y13 = vec(S256, 13, "Y13") - Y14 = vec(S256, 14, "Y14") - Y15 = vec(S256, 15, "Y15") - Y16 = vec(S256, 16, "Y16") - Y17 = vec(S256, 17, "Y17") - Y18 = vec(S256, 18, "Y18") - Y19 = vec(S256, 19, "Y19") - Y20 = vec(S256, 20, "Y20") - Y21 = vec(S256, 21, "Y21") - Y22 = vec(S256, 22, "Y22") - Y23 = vec(S256, 23, "Y23") - Y24 = vec(S256, 24, "Y24") - Y25 = vec(S256, 25, "Y25") - Y26 = vec(S256, 26, "Y26") - Y27 = vec(S256, 27, "Y27") - Y28 = vec(S256, 28, "Y28") - Y29 = vec(S256, 29, "Y29") - Y30 = vec(S256, 30, "Y30") - Y31 = vec(S256, 31, "Y31") - - // 512-bit - Z0 = vec(S512, 0, "Z0") - Z1 = vec(S512, 1, "Z1") - Z2 = vec(S512, 2, "Z2") - Z3 = vec(S512, 3, "Z3") - Z4 = vec(S512, 4, "Z4") - Z5 = vec(S512, 5, "Z5") - Z6 = vec(S512, 6, "Z6") - Z7 = vec(S512, 7, "Z7") - Z8 = vec(S512, 8, "Z8") - Z9 = vec(S512, 9, "Z9") - Z10 = vec(S512, 10, "Z10") - Z11 = vec(S512, 11, "Z11") - Z12 = vec(S512, 12, "Z12") - Z13 = vec(S512, 13, "Z13") - Z14 = vec(S512, 14, "Z14") - Z15 = vec(S512, 15, "Z15") - Z16 = vec(S512, 16, "Z16") - Z17 = vec(S512, 17, "Z17") - Z18 = vec(S512, 18, "Z18") - Z19 = vec(S512, 19, "Z19") - Z20 = vec(S512, 20, "Z20") - Z21 = vec(S512, 21, "Z21") - Z22 = vec(S512, 22, "Z22") - Z23 = vec(S512, 23, "Z23") - Z24 = vec(S512, 24, "Z24") - Z25 = vec(S512, 25, "Z25") - Z26 = vec(S512, 26, "Z26") - Z27 = vec(S512, 27, "Z27") - Z28 = vec(S512, 28, "Z28") - Z29 = vec(S512, 29, "Z29") - Z30 = vec(S512, 30, "Z30") - Z31 = vec(S512, 31, "Z31") -) diff --git a/vendor/github.com/mmcloughlin/avo/src/src.go b/vendor/github.com/mmcloughlin/avo/src/src.go deleted file mode 100644 index 3a47886e65..0000000000 --- a/vendor/github.com/mmcloughlin/avo/src/src.go +++ /dev/null @@ -1,62 +0,0 @@ -// Package src provides types for working with source files. -package src - -import ( - "os" - "path/filepath" - "runtime" - "strconv" -) - -// Position represents a position in a source file. -type Position struct { - Filename string - Line int // 1-up -} - -// FramePosition returns the Position of the given stack frame. -func FramePosition(f runtime.Frame) Position { - return Position{ - Filename: f.File, - Line: f.Line, - } -} - -// IsValid reports whether the position is valid: Line must be positive, but -// Filename may be empty. -func (p Position) IsValid() bool { - return p.Line > 0 -} - -// String represents Position as a string. -func (p Position) String() string { - if !p.IsValid() { - return "-" - } - var s string - if p.Filename != "" { - s += p.Filename + ":" - } - s += strconv.Itoa(p.Line) - return s -} - -// Rel returns Position relative to basepath. If the given filename cannot be -// expressed relative to basepath the position will be returned unchanged. -func (p Position) Rel(basepath string) Position { - q := p - if rel, err := filepath.Rel(basepath, q.Filename); err == nil { - q.Filename = rel - } - return q -} - -// Relwd returns Position relative to the current working directory. Returns p -// unchanged if the working directory cannot be determined, or the filename -// cannot be expressed relative to the working directory. -func (p Position) Relwd() Position { - if wd, err := os.Getwd(); err == nil { - return p.Rel(wd) - } - return p -} diff --git a/vendor/github.com/mmcloughlin/avo/x86/doc.go b/vendor/github.com/mmcloughlin/avo/x86/doc.go deleted file mode 100644 index 6e4c8ee859..0000000000 --- a/vendor/github.com/mmcloughlin/avo/x86/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package x86 provides constructors for all x86-64 instructions. -package x86 diff --git a/vendor/github.com/mmcloughlin/avo/x86/gen.go b/vendor/github.com/mmcloughlin/avo/x86/gen.go deleted file mode 100644 index 25d15fa638..0000000000 --- a/vendor/github.com/mmcloughlin/avo/x86/gen.go +++ /dev/null @@ -1,4 +0,0 @@ -package x86 - -//go:generate avogen -output zctors.go ctors -//go:generate avogen -output zctors_test.go ctorstest diff --git a/vendor/github.com/mmcloughlin/avo/x86/zctors.go b/vendor/github.com/mmcloughlin/avo/x86/zctors.go deleted file mode 100644 index 447c0a1a59..0000000000 --- a/vendor/github.com/mmcloughlin/avo/x86/zctors.go +++ /dev/null @@ -1,34629 +0,0 @@ -// Code generated by command: avogen -output zctors.go ctors. DO NOT EDIT. - -package x86 - -import ( - "errors" - - intrep "github.com/mmcloughlin/avo/ir" - "github.com/mmcloughlin/avo/operand" - "github.com/mmcloughlin/avo/reg" -) - -// ADCB: Add with Carry. -// -// Forms: -// -// ADCB imm8 al -// ADCB imm8 r8 -// ADCB r8 r8 -// ADCB m8 r8 -// ADCB imm8 m8 -// ADCB r8 m8 -func ADCB(imr, amr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imr) && operand.IsAL(amr): - return &intrep.Instruction{ - Opcode: "ADCB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "ADCB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "ADCB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsM8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "ADCB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM8(amr): - return &intrep.Instruction{ - Opcode: "ADCB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR8(imr) && operand.IsM8(amr): - return &intrep.Instruction{ - Opcode: "ADCB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - } - return nil, errors.New("ADCB: bad operands") -} - -// ADCL: Add with Carry. -// -// Forms: -// -// ADCL imm32 eax -// ADCL imm8 r32 -// ADCL imm32 r32 -// ADCL r32 r32 -// ADCL m32 r32 -// ADCL imm8 m32 -// ADCL imm32 m32 -// ADCL r32 m32 -func ADCL(imr, emr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imr) && operand.IsEAX(emr): - return &intrep.Instruction{ - Opcode: "ADCL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "ADCL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "ADCL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsR32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "ADCL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsM32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "ADCL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "ADCL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM32(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "ADCL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsR32(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "ADCL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - } - return nil, errors.New("ADCL: bad operands") -} - -// ADCQ: Add with Carry. -// -// Forms: -// -// ADCQ imm32 rax -// ADCQ imm8 r64 -// ADCQ imm32 r64 -// ADCQ r64 r64 -// ADCQ m64 r64 -// ADCQ imm8 m64 -// ADCQ imm32 m64 -// ADCQ r64 m64 -func ADCQ(imr, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imr) && operand.IsRAX(mr): - return &intrep.Instruction{ - Opcode: "ADCQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ADCQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM32(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ADCQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ADCQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM64(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ADCQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "ADCQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM32(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "ADCQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "ADCQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("ADCQ: bad operands") -} - -// ADCW: Add with Carry. -// -// Forms: -// -// ADCW imm16 ax -// ADCW imm8 r16 -// ADCW imm16 r16 -// ADCW r16 r16 -// ADCW m16 r16 -// ADCW imm8 m16 -// ADCW imm16 m16 -// ADCW r16 m16 -func ADCW(imr, amr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM16(imr) && operand.IsAX(amr): - return &intrep.Instruction{ - Opcode: "ADCW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "ADCW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "ADCW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "ADCW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsM16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "ADCW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "ADCW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM16(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "ADCW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR16(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "ADCW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - } - return nil, errors.New("ADCW: bad operands") -} - -// ADCXL: Unsigned Integer Addition of Two Operands with Carry Flag. -// -// Forms: -// -// ADCXL r32 r32 -// ADCXL m32 r32 -func ADCXL(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "ADCXL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"ADX"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "ADCXL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"ADX"}, - }, nil - } - return nil, errors.New("ADCXL: bad operands") -} - -// ADCXQ: Unsigned Integer Addition of Two Operands with Carry Flag. -// -// Forms: -// -// ADCXQ r64 r64 -// ADCXQ m64 r64 -func ADCXQ(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "ADCXQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"ADX"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "ADCXQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"ADX"}, - }, nil - } - return nil, errors.New("ADCXQ: bad operands") -} - -// ADDB: Add. -// -// Forms: -// -// ADDB imm8 al -// ADDB imm8 r8 -// ADDB r8 r8 -// ADDB m8 r8 -// ADDB imm8 m8 -// ADDB r8 m8 -func ADDB(imr, amr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imr) && operand.IsAL(amr): - return &intrep.Instruction{ - Opcode: "ADDB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "ADDB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "ADDB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsM8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "ADDB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM8(amr): - return &intrep.Instruction{ - Opcode: "ADDB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR8(imr) && operand.IsM8(amr): - return &intrep.Instruction{ - Opcode: "ADDB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - } - return nil, errors.New("ADDB: bad operands") -} - -// ADDL: Add. -// -// Forms: -// -// ADDL imm32 eax -// ADDL imm8 r32 -// ADDL imm32 r32 -// ADDL r32 r32 -// ADDL m32 r32 -// ADDL imm8 m32 -// ADDL imm32 m32 -// ADDL r32 m32 -func ADDL(imr, emr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imr) && operand.IsEAX(emr): - return &intrep.Instruction{ - Opcode: "ADDL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "ADDL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "ADDL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsR32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "ADDL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsM32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "ADDL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "ADDL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM32(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "ADDL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsR32(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "ADDL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - } - return nil, errors.New("ADDL: bad operands") -} - -// ADDPD: Add Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// ADDPD xmm xmm -// ADDPD m128 xmm -func ADDPD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ADDPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ADDPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("ADDPD: bad operands") -} - -// ADDPS: Add Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// ADDPS xmm xmm -// ADDPS m128 xmm -func ADDPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ADDPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ADDPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("ADDPS: bad operands") -} - -// ADDQ: Add. -// -// Forms: -// -// ADDQ imm32 rax -// ADDQ imm8 r64 -// ADDQ imm32 r64 -// ADDQ r64 r64 -// ADDQ m64 r64 -// ADDQ imm8 m64 -// ADDQ imm32 m64 -// ADDQ r64 m64 -func ADDQ(imr, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imr) && operand.IsRAX(mr): - return &intrep.Instruction{ - Opcode: "ADDQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ADDQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM32(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ADDQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ADDQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM64(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ADDQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "ADDQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM32(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "ADDQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "ADDQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("ADDQ: bad operands") -} - -// ADDSD: Add Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// ADDSD xmm xmm -// ADDSD m64 xmm -func ADDSD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ADDSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ADDSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("ADDSD: bad operands") -} - -// ADDSS: Add Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// ADDSS xmm xmm -// ADDSS m32 xmm -func ADDSS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ADDSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ADDSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("ADDSS: bad operands") -} - -// ADDSUBPD: Packed Double-FP Add/Subtract. -// -// Forms: -// -// ADDSUBPD xmm xmm -// ADDSUBPD m128 xmm -func ADDSUBPD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ADDSUBPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ADDSUBPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - } - return nil, errors.New("ADDSUBPD: bad operands") -} - -// ADDSUBPS: Packed Single-FP Add/Subtract. -// -// Forms: -// -// ADDSUBPS xmm xmm -// ADDSUBPS m128 xmm -func ADDSUBPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ADDSUBPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ADDSUBPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - } - return nil, errors.New("ADDSUBPS: bad operands") -} - -// ADDW: Add. -// -// Forms: -// -// ADDW imm16 ax -// ADDW imm8 r16 -// ADDW imm16 r16 -// ADDW r16 r16 -// ADDW m16 r16 -// ADDW imm8 m16 -// ADDW imm16 m16 -// ADDW r16 m16 -func ADDW(imr, amr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM16(imr) && operand.IsAX(amr): - return &intrep.Instruction{ - Opcode: "ADDW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "ADDW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "ADDW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "ADDW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsM16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "ADDW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "ADDW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM16(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "ADDW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR16(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "ADDW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - } - return nil, errors.New("ADDW: bad operands") -} - -// ADOXL: Unsigned Integer Addition of Two Operands with Overflow Flag. -// -// Forms: -// -// ADOXL r32 r32 -// ADOXL m32 r32 -func ADOXL(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "ADOXL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"ADX"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "ADOXL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"ADX"}, - }, nil - } - return nil, errors.New("ADOXL: bad operands") -} - -// ADOXQ: Unsigned Integer Addition of Two Operands with Overflow Flag. -// -// Forms: -// -// ADOXQ r64 r64 -// ADOXQ m64 r64 -func ADOXQ(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "ADOXQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"ADX"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "ADOXQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"ADX"}, - }, nil - } - return nil, errors.New("ADOXQ: bad operands") -} - -// AESDEC: Perform One Round of an AES Decryption Flow. -// -// Forms: -// -// AESDEC xmm xmm -// AESDEC m128 xmm -func AESDEC(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "AESDEC", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AES"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "AESDEC", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AES"}, - }, nil - } - return nil, errors.New("AESDEC: bad operands") -} - -// AESDECLAST: Perform Last Round of an AES Decryption Flow. -// -// Forms: -// -// AESDECLAST xmm xmm -// AESDECLAST m128 xmm -func AESDECLAST(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "AESDECLAST", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AES"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "AESDECLAST", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AES"}, - }, nil - } - return nil, errors.New("AESDECLAST: bad operands") -} - -// AESENC: Perform One Round of an AES Encryption Flow. -// -// Forms: -// -// AESENC xmm xmm -// AESENC m128 xmm -func AESENC(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "AESENC", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"AES"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "AESENC", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"AES"}, - }, nil - } - return nil, errors.New("AESENC: bad operands") -} - -// AESENCLAST: Perform Last Round of an AES Encryption Flow. -// -// Forms: -// -// AESENCLAST xmm xmm -// AESENCLAST m128 xmm -func AESENCLAST(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "AESENCLAST", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"AES"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "AESENCLAST", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"AES"}, - }, nil - } - return nil, errors.New("AESENCLAST: bad operands") -} - -// AESIMC: Perform the AES InvMixColumn Transformation. -// -// Forms: -// -// AESIMC xmm xmm -// AESIMC m128 xmm -func AESIMC(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "AESIMC", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AES"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "AESIMC", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AES"}, - }, nil - } - return nil, errors.New("AESIMC: bad operands") -} - -// AESKEYGENASSIST: AES Round Key Generation Assist. -// -// Forms: -// -// AESKEYGENASSIST imm8 xmm xmm -// AESKEYGENASSIST imm8 m128 xmm -func AESKEYGENASSIST(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "AESKEYGENASSIST", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AES"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "AESKEYGENASSIST", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AES"}, - }, nil - } - return nil, errors.New("AESKEYGENASSIST: bad operands") -} - -// ANDB: Logical AND. -// -// Forms: -// -// ANDB imm8 al -// ANDB imm8 r8 -// ANDB r8 r8 -// ANDB m8 r8 -// ANDB imm8 m8 -// ANDB r8 m8 -func ANDB(imr, amr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imr) && operand.IsAL(amr): - return &intrep.Instruction{ - Opcode: "ANDB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "ANDB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "ANDB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsM8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "ANDB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM8(amr): - return &intrep.Instruction{ - Opcode: "ANDB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR8(imr) && operand.IsM8(amr): - return &intrep.Instruction{ - Opcode: "ANDB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - } - return nil, errors.New("ANDB: bad operands") -} - -// ANDL: Logical AND. -// -// Forms: -// -// ANDL imm32 eax -// ANDL imm8 r32 -// ANDL imm32 r32 -// ANDL r32 r32 -// ANDL m32 r32 -// ANDL imm8 m32 -// ANDL imm32 m32 -// ANDL r32 m32 -func ANDL(imr, emr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imr) && operand.IsEAX(emr): - return &intrep.Instruction{ - Opcode: "ANDL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "ANDL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "ANDL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsR32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "ANDL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsM32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "ANDL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "ANDL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM32(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "ANDL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsR32(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "ANDL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - } - return nil, errors.New("ANDL: bad operands") -} - -// ANDNL: Logical AND NOT. -// -// Forms: -// -// ANDNL r32 r32 r32 -// ANDNL m32 r32 r32 -func ANDNL(mr, r, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "ANDNL", - Operands: []operand.Op{mr, r, r1}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI"}, - CancellingInputs: true, - }, nil - case operand.IsM32(mr) && operand.IsR32(r) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "ANDNL", - Operands: []operand.Op{mr, r, r1}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI"}, - }, nil - } - return nil, errors.New("ANDNL: bad operands") -} - -// ANDNPD: Bitwise Logical AND NOT of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// ANDNPD xmm xmm -// ANDNPD m128 xmm -func ANDNPD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ANDNPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ANDNPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("ANDNPD: bad operands") -} - -// ANDNPS: Bitwise Logical AND NOT of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// ANDNPS xmm xmm -// ANDNPS m128 xmm -func ANDNPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ANDNPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ANDNPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("ANDNPS: bad operands") -} - -// ANDNQ: Logical AND NOT. -// -// Forms: -// -// ANDNQ r64 r64 r64 -// ANDNQ m64 r64 r64 -func ANDNQ(mr, r, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "ANDNQ", - Operands: []operand.Op{mr, r, r1}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI"}, - CancellingInputs: true, - }, nil - case operand.IsM64(mr) && operand.IsR64(r) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "ANDNQ", - Operands: []operand.Op{mr, r, r1}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI"}, - }, nil - } - return nil, errors.New("ANDNQ: bad operands") -} - -// ANDPD: Bitwise Logical AND of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// ANDPD xmm xmm -// ANDPD m128 xmm -func ANDPD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ANDPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ANDPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("ANDPD: bad operands") -} - -// ANDPS: Bitwise Logical AND of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// ANDPS xmm xmm -// ANDPS m128 xmm -func ANDPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ANDPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ANDPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("ANDPS: bad operands") -} - -// ANDQ: Logical AND. -// -// Forms: -// -// ANDQ imm32 rax -// ANDQ imm8 r64 -// ANDQ imm32 r64 -// ANDQ r64 r64 -// ANDQ m64 r64 -// ANDQ imm8 m64 -// ANDQ imm32 m64 -// ANDQ r64 m64 -func ANDQ(imr, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imr) && operand.IsRAX(mr): - return &intrep.Instruction{ - Opcode: "ANDQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ANDQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM32(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ANDQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ANDQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM64(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ANDQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "ANDQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM32(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "ANDQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "ANDQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("ANDQ: bad operands") -} - -// ANDW: Logical AND. -// -// Forms: -// -// ANDW imm16 ax -// ANDW imm8 r16 -// ANDW imm16 r16 -// ANDW r16 r16 -// ANDW m16 r16 -// ANDW imm8 m16 -// ANDW imm16 m16 -// ANDW r16 m16 -func ANDW(imr, amr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM16(imr) && operand.IsAX(amr): - return &intrep.Instruction{ - Opcode: "ANDW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "ANDW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "ANDW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "ANDW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsM16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "ANDW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "ANDW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM16(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "ANDW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR16(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "ANDW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - } - return nil, errors.New("ANDW: bad operands") -} - -// BEXTRL: Bit Field Extract. -// -// Forms: -// -// BEXTRL r32 r32 r32 -// BEXTRL r32 m32 r32 -func BEXTRL(r, mr, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(r) && operand.IsR32(mr) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "BEXTRL", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI"}, - }, nil - case operand.IsR32(r) && operand.IsM32(mr) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "BEXTRL", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI"}, - }, nil - } - return nil, errors.New("BEXTRL: bad operands") -} - -// BEXTRQ: Bit Field Extract. -// -// Forms: -// -// BEXTRQ r64 r64 r64 -// BEXTRQ r64 m64 r64 -func BEXTRQ(r, mr, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(r) && operand.IsR64(mr) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "BEXTRQ", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI"}, - }, nil - case operand.IsR64(r) && operand.IsM64(mr) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "BEXTRQ", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI"}, - }, nil - } - return nil, errors.New("BEXTRQ: bad operands") -} - -// BLENDPD: Blend Packed Double Precision Floating-Point Values. -// -// Forms: -// -// BLENDPD imm8 xmm xmm -// BLENDPD imm8 m128 xmm -func BLENDPD(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "BLENDPD", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "BLENDPD", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("BLENDPD: bad operands") -} - -// BLENDPS: Blend Packed Single Precision Floating-Point Values. -// -// Forms: -// -// BLENDPS imm8 xmm xmm -// BLENDPS imm8 m128 xmm -func BLENDPS(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "BLENDPS", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "BLENDPS", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("BLENDPS: bad operands") -} - -// BLENDVPD: Variable Blend Packed Double Precision Floating-Point Values. -// -// Forms: -// -// BLENDVPD xmm0 xmm xmm -// BLENDVPD xmm0 m128 xmm -func BLENDVPD(x, mx, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM0(x) && operand.IsXMM(mx) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "BLENDVPD", - Operands: []operand.Op{x, mx, x1}, - Inputs: []operand.Op{x, mx, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsXMM0(x) && operand.IsM128(mx) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "BLENDVPD", - Operands: []operand.Op{x, mx, x1}, - Inputs: []operand.Op{x, mx, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("BLENDVPD: bad operands") -} - -// BLENDVPS: Variable Blend Packed Single Precision Floating-Point Values. -// -// Forms: -// -// BLENDVPS xmm0 xmm xmm -// BLENDVPS xmm0 m128 xmm -func BLENDVPS(x, mx, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM0(x) && operand.IsXMM(mx) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "BLENDVPS", - Operands: []operand.Op{x, mx, x1}, - Inputs: []operand.Op{x, mx, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsXMM0(x) && operand.IsM128(mx) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "BLENDVPS", - Operands: []operand.Op{x, mx, x1}, - Inputs: []operand.Op{x, mx, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("BLENDVPS: bad operands") -} - -// BLSIL: Isolate Lowest Set Bit. -// -// Forms: -// -// BLSIL r32 r32 -// BLSIL m32 r32 -func BLSIL(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "BLSIL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "BLSIL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - } - return nil, errors.New("BLSIL: bad operands") -} - -// BLSIQ: Isolate Lowest Set Bit. -// -// Forms: -// -// BLSIQ r64 r64 -// BLSIQ m64 r64 -func BLSIQ(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "BLSIQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "BLSIQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - } - return nil, errors.New("BLSIQ: bad operands") -} - -// BLSMSKL: Mask From Lowest Set Bit. -// -// Forms: -// -// BLSMSKL r32 r32 -// BLSMSKL m32 r32 -func BLSMSKL(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "BLSMSKL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "BLSMSKL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - } - return nil, errors.New("BLSMSKL: bad operands") -} - -// BLSMSKQ: Mask From Lowest Set Bit. -// -// Forms: -// -// BLSMSKQ r64 r64 -// BLSMSKQ m64 r64 -func BLSMSKQ(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "BLSMSKQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "BLSMSKQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - } - return nil, errors.New("BLSMSKQ: bad operands") -} - -// BLSRL: Reset Lowest Set Bit. -// -// Forms: -// -// BLSRL r32 r32 -// BLSRL m32 r32 -func BLSRL(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "BLSRL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "BLSRL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - } - return nil, errors.New("BLSRL: bad operands") -} - -// BLSRQ: Reset Lowest Set Bit. -// -// Forms: -// -// BLSRQ r64 r64 -// BLSRQ m64 r64 -func BLSRQ(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "BLSRQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "BLSRQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - } - return nil, errors.New("BLSRQ: bad operands") -} - -// BSFL: Bit Scan Forward. -// -// Forms: -// -// BSFL r32 r32 -// BSFL m32 r32 -func BSFL(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "BSFL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "BSFL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("BSFL: bad operands") -} - -// BSFQ: Bit Scan Forward. -// -// Forms: -// -// BSFQ r64 r64 -// BSFQ m64 r64 -func BSFQ(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "BSFQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "BSFQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("BSFQ: bad operands") -} - -// BSFW: Bit Scan Forward. -// -// Forms: -// -// BSFW r16 r16 -// BSFW m16 r16 -func BSFW(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "BSFW", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "BSFW", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("BSFW: bad operands") -} - -// BSRL: Bit Scan Reverse. -// -// Forms: -// -// BSRL r32 r32 -// BSRL m32 r32 -func BSRL(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "BSRL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "BSRL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("BSRL: bad operands") -} - -// BSRQ: Bit Scan Reverse. -// -// Forms: -// -// BSRQ r64 r64 -// BSRQ m64 r64 -func BSRQ(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "BSRQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "BSRQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("BSRQ: bad operands") -} - -// BSRW: Bit Scan Reverse. -// -// Forms: -// -// BSRW r16 r16 -// BSRW m16 r16 -func BSRW(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "BSRW", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "BSRW", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("BSRW: bad operands") -} - -// BSWAPL: Byte Swap. -// -// Forms: -// -// BSWAPL r32 -func BSWAPL(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "BSWAPL", - Operands: []operand.Op{r}, - Inputs: []operand.Op{r}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("BSWAPL: bad operands") -} - -// BSWAPQ: Byte Swap. -// -// Forms: -// -// BSWAPQ r64 -func BSWAPQ(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "BSWAPQ", - Operands: []operand.Op{r}, - Inputs: []operand.Op{r}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("BSWAPQ: bad operands") -} - -// BTCL: Bit Test and Complement. -// -// Forms: -// -// BTCL imm8 r32 -// BTCL r32 r32 -// BTCL imm8 m32 -// BTCL r32 m32 -func BTCL(ir, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(ir) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "BTCL", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR32(ir) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "BTCL", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ir) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "BTCL", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR32(ir) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "BTCL", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("BTCL: bad operands") -} - -// BTCQ: Bit Test and Complement. -// -// Forms: -// -// BTCQ imm8 r64 -// BTCQ r64 r64 -// BTCQ imm8 m64 -// BTCQ r64 m64 -func BTCQ(ir, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(ir) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "BTCQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(ir) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "BTCQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ir) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "BTCQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(ir) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "BTCQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("BTCQ: bad operands") -} - -// BTCW: Bit Test and Complement. -// -// Forms: -// -// BTCW imm8 r16 -// BTCW r16 r16 -// BTCW imm8 m16 -// BTCW r16 m16 -func BTCW(ir, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(ir) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "BTCW", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR16(ir) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "BTCW", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ir) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "BTCW", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR16(ir) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "BTCW", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("BTCW: bad operands") -} - -// BTL: Bit Test. -// -// Forms: -// -// BTL imm8 r32 -// BTL r32 r32 -// BTL imm8 m32 -// BTL r32 m32 -func BTL(ir, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(ir) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "BTL", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR32(ir) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "BTL", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsIMM8(ir) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "BTL", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR32(ir) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "BTL", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("BTL: bad operands") -} - -// BTQ: Bit Test. -// -// Forms: -// -// BTQ imm8 r64 -// BTQ r64 r64 -// BTQ imm8 m64 -// BTQ r64 m64 -func BTQ(ir, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(ir) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "BTQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR64(ir) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "BTQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsIMM8(ir) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "BTQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR64(ir) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "BTQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("BTQ: bad operands") -} - -// BTRL: Bit Test and Reset. -// -// Forms: -// -// BTRL imm8 r32 -// BTRL r32 r32 -// BTRL imm8 m32 -// BTRL r32 m32 -func BTRL(ir, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(ir) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "BTRL", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR32(ir) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "BTRL", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ir) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "BTRL", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR32(ir) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "BTRL", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("BTRL: bad operands") -} - -// BTRQ: Bit Test and Reset. -// -// Forms: -// -// BTRQ imm8 r64 -// BTRQ r64 r64 -// BTRQ imm8 m64 -// BTRQ r64 m64 -func BTRQ(ir, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(ir) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "BTRQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(ir) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "BTRQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ir) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "BTRQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(ir) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "BTRQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("BTRQ: bad operands") -} - -// BTRW: Bit Test and Reset. -// -// Forms: -// -// BTRW imm8 r16 -// BTRW r16 r16 -// BTRW imm8 m16 -// BTRW r16 m16 -func BTRW(ir, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(ir) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "BTRW", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR16(ir) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "BTRW", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ir) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "BTRW", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR16(ir) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "BTRW", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("BTRW: bad operands") -} - -// BTSL: Bit Test and Set. -// -// Forms: -// -// BTSL imm8 r32 -// BTSL r32 r32 -// BTSL imm8 m32 -// BTSL r32 m32 -func BTSL(ir, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(ir) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "BTSL", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR32(ir) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "BTSL", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ir) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "BTSL", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR32(ir) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "BTSL", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("BTSL: bad operands") -} - -// BTSQ: Bit Test and Set. -// -// Forms: -// -// BTSQ imm8 r64 -// BTSQ r64 r64 -// BTSQ imm8 m64 -// BTSQ r64 m64 -func BTSQ(ir, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(ir) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "BTSQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(ir) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "BTSQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ir) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "BTSQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(ir) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "BTSQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("BTSQ: bad operands") -} - -// BTSW: Bit Test and Set. -// -// Forms: -// -// BTSW imm8 r16 -// BTSW r16 r16 -// BTSW imm8 m16 -// BTSW r16 m16 -func BTSW(ir, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(ir) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "BTSW", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR16(ir) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "BTSW", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ir) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "BTSW", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR16(ir) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "BTSW", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("BTSW: bad operands") -} - -// BTW: Bit Test. -// -// Forms: -// -// BTW imm8 r16 -// BTW r16 r16 -// BTW imm8 m16 -// BTW r16 m16 -func BTW(ir, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(ir) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "BTW", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR16(ir) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "BTW", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsIMM8(ir) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "BTW", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR16(ir) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "BTW", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("BTW: bad operands") -} - -// BZHIL: Zero High Bits Starting with Specified Bit Position. -// -// Forms: -// -// BZHIL r32 r32 r32 -// BZHIL r32 m32 r32 -func BZHIL(r, mr, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(r) && operand.IsR32(mr) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "BZHIL", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - case operand.IsR32(r) && operand.IsM32(mr) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "BZHIL", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - } - return nil, errors.New("BZHIL: bad operands") -} - -// BZHIQ: Zero High Bits Starting with Specified Bit Position. -// -// Forms: -// -// BZHIQ r64 r64 r64 -// BZHIQ r64 m64 r64 -func BZHIQ(r, mr, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(r) && operand.IsR64(mr) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "BZHIQ", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - case operand.IsR64(r) && operand.IsM64(mr) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "BZHIQ", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - } - return nil, errors.New("BZHIQ: bad operands") -} - -// CALL: Call Procedure. -// -// Forms: -// -// CALL rel32 -func CALL(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "CALL", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("CALL: bad operands") -} - -// CBW: Convert Byte to Word. -// -// Forms: -// -// CBW -func CBW() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "CBW", - Operands: nil, - Inputs: []operand.Op{reg.AL}, - Outputs: []operand.Op{reg.AX}, - }, nil -} - -// CDQ: Convert Doubleword to Quadword. -// -// Forms: -// -// CDQ -func CDQ() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "CDQ", - Operands: nil, - Inputs: []operand.Op{reg.EAX}, - Outputs: []operand.Op{reg.EDX}, - }, nil -} - -// CDQE: Convert Doubleword to Quadword. -// -// Forms: -// -// CDQE -func CDQE() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "CDQE", - Operands: nil, - Inputs: []operand.Op{reg.EAX}, - Outputs: []operand.Op{reg.RAX}, - }, nil -} - -// CLC: Clear Carry Flag. -// -// Forms: -// -// CLC -func CLC() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "CLC", - Operands: nil, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - }, nil -} - -// CLD: Clear Direction Flag. -// -// Forms: -// -// CLD -func CLD() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "CLD", - Operands: nil, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - }, nil -} - -// CLFLUSH: Flush Cache Line. -// -// Forms: -// -// CLFLUSH m8 -func CLFLUSH(m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM8(m): - return &intrep.Instruction{ - Opcode: "CLFLUSH", - Operands: []operand.Op{m}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{}, - ISA: []string{"CLFLUSH"}, - }, nil - } - return nil, errors.New("CLFLUSH: bad operands") -} - -// CLFLUSHOPT: Flush Cache Line Optimized. -// -// Forms: -// -// CLFLUSHOPT m8 -func CLFLUSHOPT(m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM8(m): - return &intrep.Instruction{ - Opcode: "CLFLUSHOPT", - Operands: []operand.Op{m}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{}, - ISA: []string{"CLFLUSHOPT"}, - }, nil - } - return nil, errors.New("CLFLUSHOPT: bad operands") -} - -// CMC: Complement Carry Flag. -// -// Forms: -// -// CMC -func CMC() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "CMC", - Operands: nil, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - }, nil -} - -// CMOVLCC: Move if above or equal (CF == 0). -// -// Forms: -// -// CMOVLCC r32 r32 -// CMOVLCC m32 r32 -func CMOVLCC(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLCC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLCC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVLCC: bad operands") -} - -// CMOVLCS: Move if below (CF == 1). -// -// Forms: -// -// CMOVLCS r32 r32 -// CMOVLCS m32 r32 -func CMOVLCS(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLCS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLCS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVLCS: bad operands") -} - -// CMOVLEQ: Move if equal (ZF == 1). -// -// Forms: -// -// CMOVLEQ r32 r32 -// CMOVLEQ m32 r32 -func CMOVLEQ(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLEQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLEQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVLEQ: bad operands") -} - -// CMOVLGE: Move if greater or equal (SF == OF). -// -// Forms: -// -// CMOVLGE r32 r32 -// CMOVLGE m32 r32 -func CMOVLGE(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLGE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLGE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVLGE: bad operands") -} - -// CMOVLGT: Move if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// CMOVLGT r32 r32 -// CMOVLGT m32 r32 -func CMOVLGT(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLGT", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLGT", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVLGT: bad operands") -} - -// CMOVLHI: Move if above (CF == 0 and ZF == 0). -// -// Forms: -// -// CMOVLHI r32 r32 -// CMOVLHI m32 r32 -func CMOVLHI(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLHI", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLHI", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVLHI: bad operands") -} - -// CMOVLLE: Move if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// CMOVLLE r32 r32 -// CMOVLLE m32 r32 -func CMOVLLE(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLLE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLLE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVLLE: bad operands") -} - -// CMOVLLS: Move if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// CMOVLLS r32 r32 -// CMOVLLS m32 r32 -func CMOVLLS(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLLS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLLS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVLLS: bad operands") -} - -// CMOVLLT: Move if less (SF != OF). -// -// Forms: -// -// CMOVLLT r32 r32 -// CMOVLLT m32 r32 -func CMOVLLT(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLLT", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLLT", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVLLT: bad operands") -} - -// CMOVLMI: Move if sign (SF == 1). -// -// Forms: -// -// CMOVLMI r32 r32 -// CMOVLMI m32 r32 -func CMOVLMI(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLMI", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLMI", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVLMI: bad operands") -} - -// CMOVLNE: Move if not equal (ZF == 0). -// -// Forms: -// -// CMOVLNE r32 r32 -// CMOVLNE m32 r32 -func CMOVLNE(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLNE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLNE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVLNE: bad operands") -} - -// CMOVLOC: Move if not overflow (OF == 0). -// -// Forms: -// -// CMOVLOC r32 r32 -// CMOVLOC m32 r32 -func CMOVLOC(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLOC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLOC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVLOC: bad operands") -} - -// CMOVLOS: Move if overflow (OF == 1). -// -// Forms: -// -// CMOVLOS r32 r32 -// CMOVLOS m32 r32 -func CMOVLOS(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLOS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLOS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVLOS: bad operands") -} - -// CMOVLPC: Move if not parity (PF == 0). -// -// Forms: -// -// CMOVLPC r32 r32 -// CMOVLPC m32 r32 -func CMOVLPC(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLPC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLPC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVLPC: bad operands") -} - -// CMOVLPL: Move if not sign (SF == 0). -// -// Forms: -// -// CMOVLPL r32 r32 -// CMOVLPL m32 r32 -func CMOVLPL(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLPL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLPL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVLPL: bad operands") -} - -// CMOVLPS: Move if parity (PF == 1). -// -// Forms: -// -// CMOVLPS r32 r32 -// CMOVLPS m32 r32 -func CMOVLPS(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLPS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CMOVLPS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVLPS: bad operands") -} - -// CMOVQCC: Move if above or equal (CF == 0). -// -// Forms: -// -// CMOVQCC r64 r64 -// CMOVQCC m64 r64 -func CMOVQCC(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQCC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQCC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVQCC: bad operands") -} - -// CMOVQCS: Move if below (CF == 1). -// -// Forms: -// -// CMOVQCS r64 r64 -// CMOVQCS m64 r64 -func CMOVQCS(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQCS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQCS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVQCS: bad operands") -} - -// CMOVQEQ: Move if equal (ZF == 1). -// -// Forms: -// -// CMOVQEQ r64 r64 -// CMOVQEQ m64 r64 -func CMOVQEQ(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQEQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQEQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVQEQ: bad operands") -} - -// CMOVQGE: Move if greater or equal (SF == OF). -// -// Forms: -// -// CMOVQGE r64 r64 -// CMOVQGE m64 r64 -func CMOVQGE(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQGE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQGE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVQGE: bad operands") -} - -// CMOVQGT: Move if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// CMOVQGT r64 r64 -// CMOVQGT m64 r64 -func CMOVQGT(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQGT", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQGT", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVQGT: bad operands") -} - -// CMOVQHI: Move if above (CF == 0 and ZF == 0). -// -// Forms: -// -// CMOVQHI r64 r64 -// CMOVQHI m64 r64 -func CMOVQHI(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQHI", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQHI", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVQHI: bad operands") -} - -// CMOVQLE: Move if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// CMOVQLE r64 r64 -// CMOVQLE m64 r64 -func CMOVQLE(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQLE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQLE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVQLE: bad operands") -} - -// CMOVQLS: Move if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// CMOVQLS r64 r64 -// CMOVQLS m64 r64 -func CMOVQLS(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQLS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQLS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVQLS: bad operands") -} - -// CMOVQLT: Move if less (SF != OF). -// -// Forms: -// -// CMOVQLT r64 r64 -// CMOVQLT m64 r64 -func CMOVQLT(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQLT", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQLT", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVQLT: bad operands") -} - -// CMOVQMI: Move if sign (SF == 1). -// -// Forms: -// -// CMOVQMI r64 r64 -// CMOVQMI m64 r64 -func CMOVQMI(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQMI", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQMI", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVQMI: bad operands") -} - -// CMOVQNE: Move if not equal (ZF == 0). -// -// Forms: -// -// CMOVQNE r64 r64 -// CMOVQNE m64 r64 -func CMOVQNE(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQNE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQNE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVQNE: bad operands") -} - -// CMOVQOC: Move if not overflow (OF == 0). -// -// Forms: -// -// CMOVQOC r64 r64 -// CMOVQOC m64 r64 -func CMOVQOC(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQOC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQOC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVQOC: bad operands") -} - -// CMOVQOS: Move if overflow (OF == 1). -// -// Forms: -// -// CMOVQOS r64 r64 -// CMOVQOS m64 r64 -func CMOVQOS(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQOS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQOS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVQOS: bad operands") -} - -// CMOVQPC: Move if not parity (PF == 0). -// -// Forms: -// -// CMOVQPC r64 r64 -// CMOVQPC m64 r64 -func CMOVQPC(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQPC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQPC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVQPC: bad operands") -} - -// CMOVQPL: Move if not sign (SF == 0). -// -// Forms: -// -// CMOVQPL r64 r64 -// CMOVQPL m64 r64 -func CMOVQPL(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQPL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQPL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVQPL: bad operands") -} - -// CMOVQPS: Move if parity (PF == 1). -// -// Forms: -// -// CMOVQPS r64 r64 -// CMOVQPS m64 r64 -func CMOVQPS(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQPS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CMOVQPS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVQPS: bad operands") -} - -// CMOVWCC: Move if above or equal (CF == 0). -// -// Forms: -// -// CMOVWCC r16 r16 -// CMOVWCC m16 r16 -func CMOVWCC(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWCC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWCC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVWCC: bad operands") -} - -// CMOVWCS: Move if below (CF == 1). -// -// Forms: -// -// CMOVWCS r16 r16 -// CMOVWCS m16 r16 -func CMOVWCS(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWCS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWCS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVWCS: bad operands") -} - -// CMOVWEQ: Move if equal (ZF == 1). -// -// Forms: -// -// CMOVWEQ r16 r16 -// CMOVWEQ m16 r16 -func CMOVWEQ(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWEQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWEQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVWEQ: bad operands") -} - -// CMOVWGE: Move if greater or equal (SF == OF). -// -// Forms: -// -// CMOVWGE r16 r16 -// CMOVWGE m16 r16 -func CMOVWGE(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWGE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWGE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVWGE: bad operands") -} - -// CMOVWGT: Move if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// CMOVWGT r16 r16 -// CMOVWGT m16 r16 -func CMOVWGT(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWGT", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWGT", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVWGT: bad operands") -} - -// CMOVWHI: Move if above (CF == 0 and ZF == 0). -// -// Forms: -// -// CMOVWHI r16 r16 -// CMOVWHI m16 r16 -func CMOVWHI(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWHI", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWHI", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVWHI: bad operands") -} - -// CMOVWLE: Move if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// CMOVWLE r16 r16 -// CMOVWLE m16 r16 -func CMOVWLE(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWLE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWLE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVWLE: bad operands") -} - -// CMOVWLS: Move if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// CMOVWLS r16 r16 -// CMOVWLS m16 r16 -func CMOVWLS(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWLS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWLS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVWLS: bad operands") -} - -// CMOVWLT: Move if less (SF != OF). -// -// Forms: -// -// CMOVWLT r16 r16 -// CMOVWLT m16 r16 -func CMOVWLT(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWLT", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWLT", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVWLT: bad operands") -} - -// CMOVWMI: Move if sign (SF == 1). -// -// Forms: -// -// CMOVWMI r16 r16 -// CMOVWMI m16 r16 -func CMOVWMI(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWMI", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWMI", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVWMI: bad operands") -} - -// CMOVWNE: Move if not equal (ZF == 0). -// -// Forms: -// -// CMOVWNE r16 r16 -// CMOVWNE m16 r16 -func CMOVWNE(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWNE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWNE", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVWNE: bad operands") -} - -// CMOVWOC: Move if not overflow (OF == 0). -// -// Forms: -// -// CMOVWOC r16 r16 -// CMOVWOC m16 r16 -func CMOVWOC(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWOC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWOC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVWOC: bad operands") -} - -// CMOVWOS: Move if overflow (OF == 1). -// -// Forms: -// -// CMOVWOS r16 r16 -// CMOVWOS m16 r16 -func CMOVWOS(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWOS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWOS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVWOS: bad operands") -} - -// CMOVWPC: Move if not parity (PF == 0). -// -// Forms: -// -// CMOVWPC r16 r16 -// CMOVWPC m16 r16 -func CMOVWPC(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWPC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWPC", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVWPC: bad operands") -} - -// CMOVWPL: Move if not sign (SF == 0). -// -// Forms: -// -// CMOVWPL r16 r16 -// CMOVWPL m16 r16 -func CMOVWPL(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWPL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWPL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVWPL: bad operands") -} - -// CMOVWPS: Move if parity (PF == 1). -// -// Forms: -// -// CMOVWPS r16 r16 -// CMOVWPS m16 r16 -func CMOVWPS(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWPS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "CMOVWPS", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"CMOV"}, - }, nil - } - return nil, errors.New("CMOVWPS: bad operands") -} - -// CMPB: Compare Two Operands. -// -// Forms: -// -// CMPB al imm8 -// CMPB r8 imm8 -// CMPB r8 r8 -// CMPB r8 m8 -// CMPB m8 imm8 -// CMPB m8 r8 -func CMPB(amr, imr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsAL(amr) && operand.IsIMM8(imr): - return &intrep.Instruction{ - Opcode: "CMPB", - Operands: []operand.Op{amr, imr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR8(amr) && operand.IsIMM8(imr): - return &intrep.Instruction{ - Opcode: "CMPB", - Operands: []operand.Op{amr, imr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR8(amr) && operand.IsR8(imr): - return &intrep.Instruction{ - Opcode: "CMPB", - Operands: []operand.Op{amr, imr}, - Inputs: []operand.Op{amr, imr}, - Outputs: []operand.Op{}, - CancellingInputs: true, - }, nil - case operand.IsR8(amr) && operand.IsM8(imr): - return &intrep.Instruction{ - Opcode: "CMPB", - Operands: []operand.Op{amr, imr}, - Inputs: []operand.Op{amr, imr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsM8(amr) && operand.IsIMM8(imr): - return &intrep.Instruction{ - Opcode: "CMPB", - Operands: []operand.Op{amr, imr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsM8(amr) && operand.IsR8(imr): - return &intrep.Instruction{ - Opcode: "CMPB", - Operands: []operand.Op{amr, imr}, - Inputs: []operand.Op{amr, imr}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("CMPB: bad operands") -} - -// CMPL: Compare Two Operands. -// -// Forms: -// -// CMPL eax imm32 -// CMPL r32 imm8 -// CMPL r32 imm32 -// CMPL r32 r32 -// CMPL r32 m32 -// CMPL m32 imm8 -// CMPL m32 imm32 -// CMPL m32 r32 -func CMPL(emr, imr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsEAX(emr) && operand.IsIMM32(imr): - return &intrep.Instruction{ - Opcode: "CMPL", - Operands: []operand.Op{emr, imr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR32(emr) && operand.IsIMM8(imr): - return &intrep.Instruction{ - Opcode: "CMPL", - Operands: []operand.Op{emr, imr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR32(emr) && operand.IsIMM32(imr): - return &intrep.Instruction{ - Opcode: "CMPL", - Operands: []operand.Op{emr, imr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR32(emr) && operand.IsR32(imr): - return &intrep.Instruction{ - Opcode: "CMPL", - Operands: []operand.Op{emr, imr}, - Inputs: []operand.Op{emr, imr}, - Outputs: []operand.Op{}, - CancellingInputs: true, - }, nil - case operand.IsR32(emr) && operand.IsM32(imr): - return &intrep.Instruction{ - Opcode: "CMPL", - Operands: []operand.Op{emr, imr}, - Inputs: []operand.Op{emr, imr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsM32(emr) && operand.IsIMM8(imr): - return &intrep.Instruction{ - Opcode: "CMPL", - Operands: []operand.Op{emr, imr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsM32(emr) && operand.IsIMM32(imr): - return &intrep.Instruction{ - Opcode: "CMPL", - Operands: []operand.Op{emr, imr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsM32(emr) && operand.IsR32(imr): - return &intrep.Instruction{ - Opcode: "CMPL", - Operands: []operand.Op{emr, imr}, - Inputs: []operand.Op{emr, imr}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("CMPL: bad operands") -} - -// CMPPD: Compare Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// CMPPD xmm xmm imm8 -// CMPPD m128 xmm imm8 -func CMPPD(mx, x, i operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsIMM8(i): - return &intrep.Instruction{ - Opcode: "CMPPD", - Operands: []operand.Op{mx, x, i}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x) && operand.IsIMM8(i): - return &intrep.Instruction{ - Opcode: "CMPPD", - Operands: []operand.Op{mx, x, i}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("CMPPD: bad operands") -} - -// CMPPS: Compare Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// CMPPS xmm xmm imm8 -// CMPPS m128 xmm imm8 -func CMPPS(mx, x, i operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsIMM8(i): - return &intrep.Instruction{ - Opcode: "CMPPS", - Operands: []operand.Op{mx, x, i}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x) && operand.IsIMM8(i): - return &intrep.Instruction{ - Opcode: "CMPPS", - Operands: []operand.Op{mx, x, i}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("CMPPS: bad operands") -} - -// CMPQ: Compare Two Operands. -// -// Forms: -// -// CMPQ rax imm32 -// CMPQ r64 imm8 -// CMPQ r64 imm32 -// CMPQ r64 r64 -// CMPQ r64 m64 -// CMPQ m64 imm8 -// CMPQ m64 imm32 -// CMPQ m64 r64 -func CMPQ(mr, imr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsRAX(mr) && operand.IsIMM32(imr): - return &intrep.Instruction{ - Opcode: "CMPQ", - Operands: []operand.Op{mr, imr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR64(mr) && operand.IsIMM8(imr): - return &intrep.Instruction{ - Opcode: "CMPQ", - Operands: []operand.Op{mr, imr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR64(mr) && operand.IsIMM32(imr): - return &intrep.Instruction{ - Opcode: "CMPQ", - Operands: []operand.Op{mr, imr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR64(mr) && operand.IsR64(imr): - return &intrep.Instruction{ - Opcode: "CMPQ", - Operands: []operand.Op{mr, imr}, - Inputs: []operand.Op{mr, imr}, - Outputs: []operand.Op{}, - CancellingInputs: true, - }, nil - case operand.IsR64(mr) && operand.IsM64(imr): - return &intrep.Instruction{ - Opcode: "CMPQ", - Operands: []operand.Op{mr, imr}, - Inputs: []operand.Op{mr, imr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsM64(mr) && operand.IsIMM8(imr): - return &intrep.Instruction{ - Opcode: "CMPQ", - Operands: []operand.Op{mr, imr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsM64(mr) && operand.IsIMM32(imr): - return &intrep.Instruction{ - Opcode: "CMPQ", - Operands: []operand.Op{mr, imr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsM64(mr) && operand.IsR64(imr): - return &intrep.Instruction{ - Opcode: "CMPQ", - Operands: []operand.Op{mr, imr}, - Inputs: []operand.Op{mr, imr}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("CMPQ: bad operands") -} - -// CMPSD: Compare Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// CMPSD xmm xmm imm8 -// CMPSD m64 xmm imm8 -func CMPSD(mx, x, i operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsIMM8(i): - return &intrep.Instruction{ - Opcode: "CMPSD", - Operands: []operand.Op{mx, x, i}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsIMM8(i): - return &intrep.Instruction{ - Opcode: "CMPSD", - Operands: []operand.Op{mx, x, i}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("CMPSD: bad operands") -} - -// CMPSS: Compare Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// CMPSS xmm xmm imm8 -// CMPSS m32 xmm imm8 -func CMPSS(mx, x, i operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsIMM8(i): - return &intrep.Instruction{ - Opcode: "CMPSS", - Operands: []operand.Op{mx, x, i}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsIMM8(i): - return &intrep.Instruction{ - Opcode: "CMPSS", - Operands: []operand.Op{mx, x, i}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("CMPSS: bad operands") -} - -// CMPW: Compare Two Operands. -// -// Forms: -// -// CMPW ax imm16 -// CMPW r16 imm8 -// CMPW r16 imm16 -// CMPW r16 r16 -// CMPW r16 m16 -// CMPW m16 imm8 -// CMPW m16 imm16 -// CMPW m16 r16 -func CMPW(amr, imr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsAX(amr) && operand.IsIMM16(imr): - return &intrep.Instruction{ - Opcode: "CMPW", - Operands: []operand.Op{amr, imr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR16(amr) && operand.IsIMM8(imr): - return &intrep.Instruction{ - Opcode: "CMPW", - Operands: []operand.Op{amr, imr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR16(amr) && operand.IsIMM16(imr): - return &intrep.Instruction{ - Opcode: "CMPW", - Operands: []operand.Op{amr, imr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR16(amr) && operand.IsR16(imr): - return &intrep.Instruction{ - Opcode: "CMPW", - Operands: []operand.Op{amr, imr}, - Inputs: []operand.Op{amr, imr}, - Outputs: []operand.Op{}, - CancellingInputs: true, - }, nil - case operand.IsR16(amr) && operand.IsM16(imr): - return &intrep.Instruction{ - Opcode: "CMPW", - Operands: []operand.Op{amr, imr}, - Inputs: []operand.Op{amr, imr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsM16(amr) && operand.IsIMM8(imr): - return &intrep.Instruction{ - Opcode: "CMPW", - Operands: []operand.Op{amr, imr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsM16(amr) && operand.IsIMM16(imr): - return &intrep.Instruction{ - Opcode: "CMPW", - Operands: []operand.Op{amr, imr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsM16(amr) && operand.IsR16(imr): - return &intrep.Instruction{ - Opcode: "CMPW", - Operands: []operand.Op{amr, imr}, - Inputs: []operand.Op{amr, imr}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("CMPW: bad operands") -} - -// CMPXCHG16B: Compare and Exchange 16 Bytes. -// -// Forms: -// -// CMPXCHG16B m128 -func CMPXCHG16B(m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM128(m): - return &intrep.Instruction{ - Opcode: "CMPXCHG16B", - Operands: []operand.Op{m}, - Inputs: []operand.Op{m, reg.RAX, reg.RBX, reg.RCX, reg.RDX}, - Outputs: []operand.Op{reg.RAX, reg.RDX}, - }, nil - } - return nil, errors.New("CMPXCHG16B: bad operands") -} - -// CMPXCHG8B: Compare and Exchange 8 Bytes. -// -// Forms: -// -// CMPXCHG8B m64 -func CMPXCHG8B(m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM64(m): - return &intrep.Instruction{ - Opcode: "CMPXCHG8B", - Operands: []operand.Op{m}, - Inputs: []operand.Op{m, reg.EAX, reg.EBX, reg.ECX, reg.EDX}, - Outputs: []operand.Op{reg.EAX, reg.EDX}, - }, nil - } - return nil, errors.New("CMPXCHG8B: bad operands") -} - -// CMPXCHGB: Compare and Exchange. -// -// Forms: -// -// CMPXCHGB r8 r8 -// CMPXCHGB r8 m8 -func CMPXCHGB(r, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(r) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "CMPXCHGB", - Operands: []operand.Op{r, mr}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR8(r) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "CMPXCHGB", - Operands: []operand.Op{r, mr}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("CMPXCHGB: bad operands") -} - -// CMPXCHGL: Compare and Exchange. -// -// Forms: -// -// CMPXCHGL r32 r32 -// CMPXCHGL r32 m32 -func CMPXCHGL(r, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(r) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "CMPXCHGL", - Operands: []operand.Op{r, mr}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR32(r) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "CMPXCHGL", - Operands: []operand.Op{r, mr}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("CMPXCHGL: bad operands") -} - -// CMPXCHGQ: Compare and Exchange. -// -// Forms: -// -// CMPXCHGQ r64 r64 -// CMPXCHGQ r64 m64 -func CMPXCHGQ(r, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(r) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "CMPXCHGQ", - Operands: []operand.Op{r, mr}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(r) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "CMPXCHGQ", - Operands: []operand.Op{r, mr}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("CMPXCHGQ: bad operands") -} - -// CMPXCHGW: Compare and Exchange. -// -// Forms: -// -// CMPXCHGW r16 r16 -// CMPXCHGW r16 m16 -func CMPXCHGW(r, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(r) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "CMPXCHGW", - Operands: []operand.Op{r, mr}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR16(r) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "CMPXCHGW", - Operands: []operand.Op{r, mr}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("CMPXCHGW: bad operands") -} - -// COMISD: Compare Scalar Ordered Double-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// COMISD xmm xmm -// COMISD m64 xmm -func COMISD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "COMISD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "COMISD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("COMISD: bad operands") -} - -// COMISS: Compare Scalar Ordered Single-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// COMISS xmm xmm -// COMISS m32 xmm -func COMISS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "COMISS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "COMISS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("COMISS: bad operands") -} - -// CPUID: CPU Identification. -// -// Forms: -// -// CPUID -func CPUID() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "CPUID", - Operands: nil, - Inputs: []operand.Op{reg.EAX, reg.ECX}, - Outputs: []operand.Op{reg.EAX, reg.EBX, reg.ECX, reg.EDX}, - ISA: []string{"CPUID"}, - }, nil -} - -// CQO: Convert Quadword to Octaword. -// -// Forms: -// -// CQO -func CQO() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "CQO", - Operands: nil, - Inputs: []operand.Op{reg.RAX}, - Outputs: []operand.Op{reg.RDX}, - }, nil -} - -// CRC32B: Accumulate CRC32 Value. -// -// Forms: -// -// CRC32B r8 r32 -// CRC32B m8 r32 -// CRC32B r8 r64 -// CRC32B m8 r64 -func CRC32B(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CRC32B", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE4.2"}, - }, nil - case operand.IsM8(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CRC32B", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE4.2"}, - }, nil - case operand.IsR8(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CRC32B", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE4.2"}, - }, nil - case operand.IsM8(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CRC32B", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE4.2"}, - }, nil - } - return nil, errors.New("CRC32B: bad operands") -} - -// CRC32L: Accumulate CRC32 Value. -// -// Forms: -// -// CRC32L r32 r32 -// CRC32L m32 r32 -func CRC32L(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CRC32L", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE4.2"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CRC32L", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE4.2"}, - }, nil - } - return nil, errors.New("CRC32L: bad operands") -} - -// CRC32Q: Accumulate CRC32 Value. -// -// Forms: -// -// CRC32Q r64 r64 -// CRC32Q m64 r64 -func CRC32Q(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CRC32Q", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE4.2"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CRC32Q", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE4.2"}, - }, nil - } - return nil, errors.New("CRC32Q: bad operands") -} - -// CRC32W: Accumulate CRC32 Value. -// -// Forms: -// -// CRC32W r16 r32 -// CRC32W m16 r32 -func CRC32W(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CRC32W", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE4.2"}, - }, nil - case operand.IsM16(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CRC32W", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE4.2"}, - }, nil - } - return nil, errors.New("CRC32W: bad operands") -} - -// CVTPD2PL: Convert Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// CVTPD2PL xmm xmm -// CVTPD2PL m128 xmm -func CVTPD2PL(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTPD2PL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTPD2PL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("CVTPD2PL: bad operands") -} - -// CVTPD2PS: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. -// -// Forms: -// -// CVTPD2PS xmm xmm -// CVTPD2PS m128 xmm -func CVTPD2PS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTPD2PS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTPD2PS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("CVTPD2PS: bad operands") -} - -// CVTPL2PD: Convert Packed Dword Integers to Packed Double-Precision FP Values. -// -// Forms: -// -// CVTPL2PD xmm xmm -// CVTPL2PD m64 xmm -func CVTPL2PD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTPL2PD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTPL2PD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("CVTPL2PD: bad operands") -} - -// CVTPL2PS: Convert Packed Dword Integers to Packed Single-Precision FP Values. -// -// Forms: -// -// CVTPL2PS xmm xmm -// CVTPL2PS m128 xmm -func CVTPL2PS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTPL2PS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTPL2PS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("CVTPL2PS: bad operands") -} - -// CVTPS2PD: Convert Packed Single-Precision FP Values to Packed Double-Precision FP Values. -// -// Forms: -// -// CVTPS2PD xmm xmm -// CVTPS2PD m64 xmm -func CVTPS2PD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTPS2PD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTPS2PD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("CVTPS2PD: bad operands") -} - -// CVTPS2PL: Convert Packed Single-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// CVTPS2PL xmm xmm -// CVTPS2PL m128 xmm -func CVTPS2PL(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTPS2PL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTPS2PL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("CVTPS2PL: bad operands") -} - -// CVTSD2SL: Convert Scalar Double-Precision FP Value to Integer. -// -// Forms: -// -// CVTSD2SL xmm r32 -// CVTSD2SL m64 r32 -// CVTSD2SL xmm r64 -// CVTSD2SL m64 r64 -func CVTSD2SL(mx, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CVTSD2SL", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CVTSD2SL", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(mx) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CVTSD2SL", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CVTSD2SL", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("CVTSD2SL: bad operands") -} - -// CVTSD2SS: Convert Scalar Double-Precision FP Value to Scalar Single-Precision FP Value. -// -// Forms: -// -// CVTSD2SS xmm xmm -// CVTSD2SS m64 xmm -func CVTSD2SS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTSD2SS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTSD2SS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("CVTSD2SS: bad operands") -} - -// CVTSL2SD: Convert Dword Integer to Scalar Double-Precision FP Value. -// -// Forms: -// -// CVTSL2SD r32 xmm -// CVTSL2SD m32 xmm -func CVTSL2SD(mr, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTSL2SD", - Operands: []operand.Op{mr, x}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM32(mr) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTSL2SD", - Operands: []operand.Op{mr, x}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("CVTSL2SD: bad operands") -} - -// CVTSL2SS: Convert Dword Integer to Scalar Single-Precision FP Value. -// -// Forms: -// -// CVTSL2SS r32 xmm -// CVTSL2SS m32 xmm -func CVTSL2SS(mr, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTSL2SS", - Operands: []operand.Op{mr, x}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mr) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTSL2SS", - Operands: []operand.Op{mr, x}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("CVTSL2SS: bad operands") -} - -// CVTSQ2SD: Convert Dword Integer to Scalar Double-Precision FP Value. -// -// Forms: -// -// CVTSQ2SD r64 xmm -// CVTSQ2SD m64 xmm -func CVTSQ2SD(mr, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTSQ2SD", - Operands: []operand.Op{mr, x}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mr) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTSQ2SD", - Operands: []operand.Op{mr, x}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("CVTSQ2SD: bad operands") -} - -// CVTSQ2SS: Convert Dword Integer to Scalar Single-Precision FP Value. -// -// Forms: -// -// CVTSQ2SS r64 xmm -// CVTSQ2SS m64 xmm -func CVTSQ2SS(mr, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTSQ2SS", - Operands: []operand.Op{mr, x}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM64(mr) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTSQ2SS", - Operands: []operand.Op{mr, x}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("CVTSQ2SS: bad operands") -} - -// CVTSS2SD: Convert Scalar Single-Precision FP Value to Scalar Double-Precision FP Value. -// -// Forms: -// -// CVTSS2SD xmm xmm -// CVTSS2SD m32 xmm -func CVTSS2SD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTSS2SD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTSS2SD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("CVTSS2SD: bad operands") -} - -// CVTSS2SL: Convert Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// CVTSS2SL xmm r32 -// CVTSS2SL m32 r32 -// CVTSS2SL xmm r64 -// CVTSS2SL m32 r64 -func CVTSS2SL(mx, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CVTSS2SL", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mx) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CVTSS2SL", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE"}, - }, nil - case operand.IsXMM(mx) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CVTSS2SL", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mx) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CVTSS2SL", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("CVTSS2SL: bad operands") -} - -// CVTTPD2PL: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// CVTTPD2PL xmm xmm -// CVTTPD2PL m128 xmm -func CVTTPD2PL(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTTPD2PL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTTPD2PL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("CVTTPD2PL: bad operands") -} - -// CVTTPS2PL: Convert with Truncation Packed Single-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// CVTTPS2PL xmm xmm -// CVTTPS2PL m128 xmm -func CVTTPS2PL(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTTPS2PL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "CVTTPS2PL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("CVTTPS2PL: bad operands") -} - -// CVTTSD2SL: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. -// -// Forms: -// -// CVTTSD2SL xmm r32 -// CVTTSD2SL m64 r32 -func CVTTSD2SL(mx, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CVTTSD2SL", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CVTTSD2SL", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("CVTTSD2SL: bad operands") -} - -// CVTTSD2SQ: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. -// -// Forms: -// -// CVTTSD2SQ xmm r64 -// CVTTSD2SQ m64 r64 -func CVTTSD2SQ(mx, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CVTTSD2SQ", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CVTTSD2SQ", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("CVTTSD2SQ: bad operands") -} - -// CVTTSS2SL: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// CVTTSS2SL xmm r32 -// CVTTSS2SL m32 r32 -// CVTTSS2SL xmm r64 -// CVTTSS2SL m32 r64 -func CVTTSS2SL(mx, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CVTTSS2SL", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mx) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "CVTTSS2SL", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE"}, - }, nil - case operand.IsXMM(mx) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CVTTSS2SL", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mx) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "CVTTSS2SL", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("CVTTSS2SL: bad operands") -} - -// CWD: Convert Word to Doubleword. -// -// Forms: -// -// CWD -func CWD() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "CWD", - Operands: nil, - Inputs: []operand.Op{reg.AX}, - Outputs: []operand.Op{reg.DX}, - }, nil -} - -// CWDE: Convert Word to Doubleword. -// -// Forms: -// -// CWDE -func CWDE() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "CWDE", - Operands: nil, - Inputs: []operand.Op{reg.AX}, - Outputs: []operand.Op{reg.EAX}, - }, nil -} - -// DECB: Decrement by 1. -// -// Forms: -// -// DECB r8 -// DECB m8 -func DECB(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "DECB", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "DECB", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("DECB: bad operands") -} - -// DECL: Decrement by 1. -// -// Forms: -// -// DECL r32 -// DECL m32 -func DECL(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "DECL", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "DECL", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("DECL: bad operands") -} - -// DECQ: Decrement by 1. -// -// Forms: -// -// DECQ r64 -// DECQ m64 -func DECQ(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "DECQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "DECQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("DECQ: bad operands") -} - -// DECW: Decrement by 1. -// -// Forms: -// -// DECW r16 -// DECW m16 -func DECW(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "DECW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "DECW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("DECW: bad operands") -} - -// DIVB: Unsigned Divide. -// -// Forms: -// -// DIVB r8 -// DIVB m8 -func DIVB(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "DIVB", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.AX}, - Outputs: []operand.Op{reg.AX}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "DIVB", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.AX}, - Outputs: []operand.Op{reg.AX}, - }, nil - } - return nil, errors.New("DIVB: bad operands") -} - -// DIVL: Unsigned Divide. -// -// Forms: -// -// DIVL r32 -// DIVL m32 -func DIVL(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "DIVL", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.EAX, reg.EDX}, - Outputs: []operand.Op{reg.EAX, reg.EDX}, - }, nil - case operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "DIVL", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.EAX, reg.EDX}, - Outputs: []operand.Op{reg.EAX, reg.EDX}, - }, nil - } - return nil, errors.New("DIVL: bad operands") -} - -// DIVPD: Divide Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// DIVPD xmm xmm -// DIVPD m128 xmm -func DIVPD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "DIVPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "DIVPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("DIVPD: bad operands") -} - -// DIVPS: Divide Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// DIVPS xmm xmm -// DIVPS m128 xmm -func DIVPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "DIVPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "DIVPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("DIVPS: bad operands") -} - -// DIVQ: Unsigned Divide. -// -// Forms: -// -// DIVQ r64 -// DIVQ m64 -func DIVQ(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "DIVQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.RAX, reg.RDX}, - Outputs: []operand.Op{reg.RAX, reg.RDX}, - }, nil - case operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "DIVQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.RAX, reg.RDX}, - Outputs: []operand.Op{reg.RAX, reg.RDX}, - }, nil - } - return nil, errors.New("DIVQ: bad operands") -} - -// DIVSD: Divide Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// DIVSD xmm xmm -// DIVSD m64 xmm -func DIVSD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "DIVSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "DIVSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("DIVSD: bad operands") -} - -// DIVSS: Divide Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// DIVSS xmm xmm -// DIVSS m32 xmm -func DIVSS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "DIVSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "DIVSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("DIVSS: bad operands") -} - -// DIVW: Unsigned Divide. -// -// Forms: -// -// DIVW r16 -// DIVW m16 -func DIVW(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "DIVW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.AX, reg.DX}, - Outputs: []operand.Op{reg.AX, reg.DX}, - }, nil - case operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "DIVW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.AX, reg.DX}, - Outputs: []operand.Op{reg.AX, reg.DX}, - }, nil - } - return nil, errors.New("DIVW: bad operands") -} - -// DPPD: Dot Product of Packed Double Precision Floating-Point Values. -// -// Forms: -// -// DPPD imm8 xmm xmm -// DPPD imm8 m128 xmm -func DPPD(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "DPPD", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "DPPD", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("DPPD: bad operands") -} - -// DPPS: Dot Product of Packed Single Precision Floating-Point Values. -// -// Forms: -// -// DPPS imm8 xmm xmm -// DPPS imm8 m128 xmm -func DPPS(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "DPPS", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "DPPS", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("DPPS: bad operands") -} - -// EXTRACTPS: Extract Packed Single Precision Floating-Point Value. -// -// Forms: -// -// EXTRACTPS imm2u xmm r32 -// EXTRACTPS imm2u xmm m32 -func EXTRACTPS(i, x, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM2U(i) && operand.IsXMM(x) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "EXTRACTPS", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM2U(i) && operand.IsXMM(x) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "EXTRACTPS", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("EXTRACTPS: bad operands") -} - -// HADDPD: Packed Double-FP Horizontal Add. -// -// Forms: -// -// HADDPD xmm xmm -// HADDPD m128 xmm -func HADDPD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "HADDPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "HADDPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - } - return nil, errors.New("HADDPD: bad operands") -} - -// HADDPS: Packed Single-FP Horizontal Add. -// -// Forms: -// -// HADDPS xmm xmm -// HADDPS m128 xmm -func HADDPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "HADDPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "HADDPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - } - return nil, errors.New("HADDPS: bad operands") -} - -// HSUBPD: Packed Double-FP Horizontal Subtract. -// -// Forms: -// -// HSUBPD xmm xmm -// HSUBPD m128 xmm -func HSUBPD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "HSUBPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "HSUBPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - } - return nil, errors.New("HSUBPD: bad operands") -} - -// HSUBPS: Packed Single-FP Horizontal Subtract. -// -// Forms: -// -// HSUBPS xmm xmm -// HSUBPS m128 xmm -func HSUBPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "HSUBPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "HSUBPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - } - return nil, errors.New("HSUBPS: bad operands") -} - -// IDIVB: Signed Divide. -// -// Forms: -// -// IDIVB r8 -// IDIVB m8 -func IDIVB(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "IDIVB", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.AX}, - Outputs: []operand.Op{reg.AX}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "IDIVB", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.AX}, - Outputs: []operand.Op{reg.AX}, - }, nil - } - return nil, errors.New("IDIVB: bad operands") -} - -// IDIVL: Signed Divide. -// -// Forms: -// -// IDIVL r32 -// IDIVL m32 -func IDIVL(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "IDIVL", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.EAX, reg.EDX}, - Outputs: []operand.Op{reg.EAX, reg.EDX}, - }, nil - case operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "IDIVL", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.EAX, reg.EDX}, - Outputs: []operand.Op{reg.EAX, reg.EDX}, - }, nil - } - return nil, errors.New("IDIVL: bad operands") -} - -// IDIVQ: Signed Divide. -// -// Forms: -// -// IDIVQ r64 -// IDIVQ m64 -func IDIVQ(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "IDIVQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.RAX, reg.RDX}, - Outputs: []operand.Op{reg.RAX, reg.RDX}, - }, nil - case operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "IDIVQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.RAX, reg.RDX}, - Outputs: []operand.Op{reg.RAX, reg.RDX}, - }, nil - } - return nil, errors.New("IDIVQ: bad operands") -} - -// IDIVW: Signed Divide. -// -// Forms: -// -// IDIVW r16 -// IDIVW m16 -func IDIVW(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "IDIVW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.AX, reg.DX}, - Outputs: []operand.Op{reg.AX, reg.DX}, - }, nil - case operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "IDIVW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.AX, reg.DX}, - Outputs: []operand.Op{reg.AX, reg.DX}, - }, nil - } - return nil, errors.New("IDIVW: bad operands") -} - -// IMUL3L: Signed Multiply. -// -// Forms: -// -// IMUL3L imm8 r32 r32 -// IMUL3L imm32 r32 r32 -// IMUL3L imm8 m32 r32 -// IMUL3L imm32 m32 r32 -func IMUL3L(i, mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "IMUL3L", - Operands: []operand.Op{i, mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsIMM32(i) && operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "IMUL3L", - Operands: []operand.Op{i, mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsIMM8(i) && operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "IMUL3L", - Operands: []operand.Op{i, mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsIMM32(i) && operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "IMUL3L", - Operands: []operand.Op{i, mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("IMUL3L: bad operands") -} - -// IMUL3Q: Signed Multiply. -// -// Forms: -// -// IMUL3Q imm8 r64 r64 -// IMUL3Q imm32 r64 r64 -// IMUL3Q imm8 m64 r64 -// IMUL3Q imm32 m64 r64 -func IMUL3Q(i, mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "IMUL3Q", - Operands: []operand.Op{i, mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsIMM32(i) && operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "IMUL3Q", - Operands: []operand.Op{i, mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsIMM8(i) && operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "IMUL3Q", - Operands: []operand.Op{i, mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsIMM32(i) && operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "IMUL3Q", - Operands: []operand.Op{i, mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("IMUL3Q: bad operands") -} - -// IMUL3W: Signed Multiply. -// -// Forms: -// -// IMUL3W imm8 r16 r16 -// IMUL3W imm16 r16 r16 -// IMUL3W imm8 m16 r16 -// IMUL3W imm16 m16 r16 -func IMUL3W(i, mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "IMUL3W", - Operands: []operand.Op{i, mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsIMM16(i) && operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "IMUL3W", - Operands: []operand.Op{i, mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsIMM8(i) && operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "IMUL3W", - Operands: []operand.Op{i, mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsIMM16(i) && operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "IMUL3W", - Operands: []operand.Op{i, mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("IMUL3W: bad operands") -} - -// IMULB: Signed Multiply. -// -// Forms: -// -// IMULB r8 -// IMULB m8 -func IMULB(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "IMULB", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.AL}, - Outputs: []operand.Op{reg.AX}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "IMULB", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.AL}, - Outputs: []operand.Op{reg.AX}, - }, nil - } - return nil, errors.New("IMULB: bad operands") -} - -// IMULL: Signed Multiply. -// -// Forms: -// -// IMULL r32 -// IMULL m32 -// IMULL r32 r32 -// IMULL m32 r32 -func IMULL(ops ...operand.Op) (*intrep.Instruction, error) { - switch { - case len(ops) == 1 && operand.IsR32(ops[0]): - return &intrep.Instruction{ - Opcode: "IMULL", - Operands: ops, - Inputs: []operand.Op{ops[0], reg.EAX}, - Outputs: []operand.Op{reg.EAX, reg.EDX}, - }, nil - case len(ops) == 1 && operand.IsM32(ops[0]): - return &intrep.Instruction{ - Opcode: "IMULL", - Operands: ops, - Inputs: []operand.Op{ops[0], reg.EAX}, - Outputs: []operand.Op{reg.EAX, reg.EDX}, - }, nil - case len(ops) == 2 && operand.IsR32(ops[0]) && operand.IsR32(ops[1]): - return &intrep.Instruction{ - Opcode: "IMULL", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsM32(ops[0]) && operand.IsR32(ops[1]): - return &intrep.Instruction{ - Opcode: "IMULL", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - } - return nil, errors.New("IMULL: bad operands") -} - -// IMULQ: Signed Multiply. -// -// Forms: -// -// IMULQ r64 -// IMULQ m64 -// IMULQ r64 r64 -// IMULQ m64 r64 -func IMULQ(ops ...operand.Op) (*intrep.Instruction, error) { - switch { - case len(ops) == 1 && operand.IsR64(ops[0]): - return &intrep.Instruction{ - Opcode: "IMULQ", - Operands: ops, - Inputs: []operand.Op{ops[0], reg.RAX}, - Outputs: []operand.Op{reg.RAX, reg.RDX}, - }, nil - case len(ops) == 1 && operand.IsM64(ops[0]): - return &intrep.Instruction{ - Opcode: "IMULQ", - Operands: ops, - Inputs: []operand.Op{ops[0], reg.RAX}, - Outputs: []operand.Op{reg.RAX, reg.RDX}, - }, nil - case len(ops) == 2 && operand.IsR64(ops[0]) && operand.IsR64(ops[1]): - return &intrep.Instruction{ - Opcode: "IMULQ", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsM64(ops[0]) && operand.IsR64(ops[1]): - return &intrep.Instruction{ - Opcode: "IMULQ", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - } - return nil, errors.New("IMULQ: bad operands") -} - -// IMULW: Signed Multiply. -// -// Forms: -// -// IMULW r16 -// IMULW m16 -// IMULW r16 r16 -// IMULW m16 r16 -func IMULW(ops ...operand.Op) (*intrep.Instruction, error) { - switch { - case len(ops) == 1 && operand.IsR16(ops[0]): - return &intrep.Instruction{ - Opcode: "IMULW", - Operands: ops, - Inputs: []operand.Op{ops[0], reg.AX}, - Outputs: []operand.Op{reg.AX, reg.DX}, - }, nil - case len(ops) == 1 && operand.IsM16(ops[0]): - return &intrep.Instruction{ - Opcode: "IMULW", - Operands: ops, - Inputs: []operand.Op{ops[0], reg.AX}, - Outputs: []operand.Op{reg.AX, reg.DX}, - }, nil - case len(ops) == 2 && operand.IsR16(ops[0]) && operand.IsR16(ops[1]): - return &intrep.Instruction{ - Opcode: "IMULW", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsM16(ops[0]) && operand.IsR16(ops[1]): - return &intrep.Instruction{ - Opcode: "IMULW", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - } - return nil, errors.New("IMULW: bad operands") -} - -// INCB: Increment by 1. -// -// Forms: -// -// INCB r8 -// INCB m8 -func INCB(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "INCB", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "INCB", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("INCB: bad operands") -} - -// INCL: Increment by 1. -// -// Forms: -// -// INCL r32 -// INCL m32 -func INCL(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "INCL", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "INCL", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("INCL: bad operands") -} - -// INCQ: Increment by 1. -// -// Forms: -// -// INCQ r64 -// INCQ m64 -func INCQ(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "INCQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "INCQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("INCQ: bad operands") -} - -// INCW: Increment by 1. -// -// Forms: -// -// INCW r16 -// INCW m16 -func INCW(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "INCW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "INCW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("INCW: bad operands") -} - -// INSERTPS: Insert Packed Single Precision Floating-Point Value. -// -// Forms: -// -// INSERTPS imm8 xmm xmm -// INSERTPS imm8 m32 xmm -func INSERTPS(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "INSERTPS", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "INSERTPS", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("INSERTPS: bad operands") -} - -// INT: Call to Interrupt Procedure. -// -// Forms: -// -// INT 3 -// INT imm8 -func INT(i operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is3(i): - return &intrep.Instruction{ - Opcode: "INT", - Operands: []operand.Op{i}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - }, nil - case operand.IsIMM8(i): - return &intrep.Instruction{ - Opcode: "INT", - Operands: []operand.Op{i}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("INT: bad operands") -} - -// JA: Jump if above (CF == 0 and ZF == 0). -// -// Forms: -// -// JA rel8 -// JA rel32 -func JA(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JA", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JA", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JA: bad operands") -} - -// JAE: Jump if above or equal (CF == 0). -// -// Forms: -// -// JAE rel8 -// JAE rel32 -func JAE(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JAE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JAE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JAE: bad operands") -} - -// JB: Jump if below (CF == 1). -// -// Forms: -// -// JB rel8 -// JB rel32 -func JB(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JB", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JB", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JB: bad operands") -} - -// JBE: Jump if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// JBE rel8 -// JBE rel32 -func JBE(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JBE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JBE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JBE: bad operands") -} - -// JC: Jump if below (CF == 1). -// -// Forms: -// -// JC rel8 -// JC rel32 -func JC(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JC", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JC", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JC: bad operands") -} - -// JCC: Jump if above or equal (CF == 0). -// -// Forms: -// -// JCC rel8 -// JCC rel32 -func JCC(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JCC", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JCC", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JCC: bad operands") -} - -// JCS: Jump if below (CF == 1). -// -// Forms: -// -// JCS rel8 -// JCS rel32 -func JCS(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JCS", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JCS", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JCS: bad operands") -} - -// JCXZL: Jump if ECX register is 0. -// -// Forms: -// -// JCXZL rel8 -func JCXZL(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JCXZL", - Operands: []operand.Op{r}, - Inputs: []operand.Op{reg.ECX}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JCXZL: bad operands") -} - -// JCXZQ: Jump if RCX register is 0. -// -// Forms: -// -// JCXZQ rel8 -func JCXZQ(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JCXZQ", - Operands: []operand.Op{r}, - Inputs: []operand.Op{reg.RCX}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JCXZQ: bad operands") -} - -// JE: Jump if equal (ZF == 1). -// -// Forms: -// -// JE rel8 -// JE rel32 -func JE(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JE: bad operands") -} - -// JEQ: Jump if equal (ZF == 1). -// -// Forms: -// -// JEQ rel8 -// JEQ rel32 -func JEQ(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JEQ", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JEQ", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JEQ: bad operands") -} - -// JG: Jump if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// JG rel8 -// JG rel32 -func JG(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JG", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JG", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JG: bad operands") -} - -// JGE: Jump if greater or equal (SF == OF). -// -// Forms: -// -// JGE rel8 -// JGE rel32 -func JGE(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JGE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JGE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JGE: bad operands") -} - -// JGT: Jump if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// JGT rel8 -// JGT rel32 -func JGT(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JGT", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JGT", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JGT: bad operands") -} - -// JHI: Jump if above (CF == 0 and ZF == 0). -// -// Forms: -// -// JHI rel8 -// JHI rel32 -func JHI(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JHI", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JHI", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JHI: bad operands") -} - -// JHS: Jump if above or equal (CF == 0). -// -// Forms: -// -// JHS rel8 -// JHS rel32 -func JHS(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JHS", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JHS", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JHS: bad operands") -} - -// JL: Jump if less (SF != OF). -// -// Forms: -// -// JL rel8 -// JL rel32 -func JL(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JL", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JL", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JL: bad operands") -} - -// JLE: Jump if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// JLE rel8 -// JLE rel32 -func JLE(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JLE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JLE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JLE: bad operands") -} - -// JLO: Jump if below (CF == 1). -// -// Forms: -// -// JLO rel8 -// JLO rel32 -func JLO(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JLO", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JLO", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JLO: bad operands") -} - -// JLS: Jump if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// JLS rel8 -// JLS rel32 -func JLS(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JLS", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JLS", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JLS: bad operands") -} - -// JLT: Jump if less (SF != OF). -// -// Forms: -// -// JLT rel8 -// JLT rel32 -func JLT(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JLT", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JLT", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JLT: bad operands") -} - -// JMI: Jump if sign (SF == 1). -// -// Forms: -// -// JMI rel8 -// JMI rel32 -func JMI(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JMI", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JMI", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JMI: bad operands") -} - -// JMP: Jump Unconditionally. -// -// Forms: -// -// JMP rel8 -// JMP rel32 -// JMP r64 -// JMP m64 -func JMP(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(mr): - return &intrep.Instruction{ - Opcode: "JMP", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: false, - }, nil - case operand.IsREL32(mr): - return &intrep.Instruction{ - Opcode: "JMP", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: false, - }, nil - case operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "JMP", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: false, - }, nil - case operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "JMP", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: false, - }, nil - } - return nil, errors.New("JMP: bad operands") -} - -// JNA: Jump if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// JNA rel8 -// JNA rel32 -func JNA(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JNA", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JNA", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JNA: bad operands") -} - -// JNAE: Jump if below (CF == 1). -// -// Forms: -// -// JNAE rel8 -// JNAE rel32 -func JNAE(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JNAE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JNAE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JNAE: bad operands") -} - -// JNB: Jump if above or equal (CF == 0). -// -// Forms: -// -// JNB rel8 -// JNB rel32 -func JNB(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JNB", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JNB", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JNB: bad operands") -} - -// JNBE: Jump if above (CF == 0 and ZF == 0). -// -// Forms: -// -// JNBE rel8 -// JNBE rel32 -func JNBE(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JNBE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JNBE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JNBE: bad operands") -} - -// JNC: Jump if above or equal (CF == 0). -// -// Forms: -// -// JNC rel8 -// JNC rel32 -func JNC(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JNC", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JNC", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JNC: bad operands") -} - -// JNE: Jump if not equal (ZF == 0). -// -// Forms: -// -// JNE rel8 -// JNE rel32 -func JNE(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JNE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JNE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JNE: bad operands") -} - -// JNG: Jump if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// JNG rel8 -// JNG rel32 -func JNG(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JNG", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JNG", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JNG: bad operands") -} - -// JNGE: Jump if less (SF != OF). -// -// Forms: -// -// JNGE rel8 -// JNGE rel32 -func JNGE(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JNGE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JNGE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JNGE: bad operands") -} - -// JNL: Jump if greater or equal (SF == OF). -// -// Forms: -// -// JNL rel8 -// JNL rel32 -func JNL(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JNL", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JNL", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JNL: bad operands") -} - -// JNLE: Jump if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// JNLE rel8 -// JNLE rel32 -func JNLE(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JNLE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JNLE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JNLE: bad operands") -} - -// JNO: Jump if not overflow (OF == 0). -// -// Forms: -// -// JNO rel8 -// JNO rel32 -func JNO(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JNO", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JNO", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JNO: bad operands") -} - -// JNP: Jump if not parity (PF == 0). -// -// Forms: -// -// JNP rel8 -// JNP rel32 -func JNP(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JNP", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JNP", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JNP: bad operands") -} - -// JNS: Jump if not sign (SF == 0). -// -// Forms: -// -// JNS rel8 -// JNS rel32 -func JNS(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JNS", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JNS", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JNS: bad operands") -} - -// JNZ: Jump if not equal (ZF == 0). -// -// Forms: -// -// JNZ rel8 -// JNZ rel32 -func JNZ(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JNZ", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JNZ", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JNZ: bad operands") -} - -// JO: Jump if overflow (OF == 1). -// -// Forms: -// -// JO rel8 -// JO rel32 -func JO(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JO", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JO", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JO: bad operands") -} - -// JOC: Jump if not overflow (OF == 0). -// -// Forms: -// -// JOC rel8 -// JOC rel32 -func JOC(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JOC", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JOC", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JOC: bad operands") -} - -// JOS: Jump if overflow (OF == 1). -// -// Forms: -// -// JOS rel8 -// JOS rel32 -func JOS(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JOS", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JOS", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JOS: bad operands") -} - -// JP: Jump if parity (PF == 1). -// -// Forms: -// -// JP rel8 -// JP rel32 -func JP(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JP", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JP", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JP: bad operands") -} - -// JPC: Jump if not parity (PF == 0). -// -// Forms: -// -// JPC rel8 -// JPC rel32 -func JPC(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JPC", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JPC", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JPC: bad operands") -} - -// JPE: Jump if parity (PF == 1). -// -// Forms: -// -// JPE rel8 -// JPE rel32 -func JPE(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JPE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JPE", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JPE: bad operands") -} - -// JPL: Jump if not sign (SF == 0). -// -// Forms: -// -// JPL rel8 -// JPL rel32 -func JPL(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JPL", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JPL", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JPL: bad operands") -} - -// JPO: Jump if not parity (PF == 0). -// -// Forms: -// -// JPO rel8 -// JPO rel32 -func JPO(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JPO", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JPO", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JPO: bad operands") -} - -// JPS: Jump if parity (PF == 1). -// -// Forms: -// -// JPS rel8 -// JPS rel32 -func JPS(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JPS", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JPS", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JPS: bad operands") -} - -// JS: Jump if sign (SF == 1). -// -// Forms: -// -// JS rel8 -// JS rel32 -func JS(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JS", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JS", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JS: bad operands") -} - -// JZ: Jump if equal (ZF == 1). -// -// Forms: -// -// JZ rel8 -// JZ rel32 -func JZ(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsREL8(r): - return &intrep.Instruction{ - Opcode: "JZ", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - case operand.IsREL32(r): - return &intrep.Instruction{ - Opcode: "JZ", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsBranch: true, - IsConditional: true, - }, nil - } - return nil, errors.New("JZ: bad operands") -} - -// LDDQU: Load Unaligned Integer 128 Bits. -// -// Forms: -// -// LDDQU m128 xmm -func LDDQU(m, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM128(m) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "LDDQU", - Operands: []operand.Op{m, x}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - } - return nil, errors.New("LDDQU: bad operands") -} - -// LDMXCSR: Load MXCSR Register. -// -// Forms: -// -// LDMXCSR m32 -func LDMXCSR(m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM32(m): - return &intrep.Instruction{ - Opcode: "LDMXCSR", - Operands: []operand.Op{m}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("LDMXCSR: bad operands") -} - -// LEAL: Load Effective Address. -// -// Forms: -// -// LEAL m r32 -func LEAL(m, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM(m) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "LEAL", - Operands: []operand.Op{m, r}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("LEAL: bad operands") -} - -// LEAQ: Load Effective Address. -// -// Forms: -// -// LEAQ m r64 -func LEAQ(m, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM(m) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "LEAQ", - Operands: []operand.Op{m, r}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("LEAQ: bad operands") -} - -// LEAW: Load Effective Address. -// -// Forms: -// -// LEAW m r16 -func LEAW(m, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM(m) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "LEAW", - Operands: []operand.Op{m, r}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("LEAW: bad operands") -} - -// LFENCE: Load Fence. -// -// Forms: -// -// LFENCE -func LFENCE() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "LFENCE", - Operands: nil, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - ISA: []string{"SSE2"}, - }, nil -} - -// LZCNTL: Count the Number of Leading Zero Bits. -// -// Forms: -// -// LZCNTL r32 r32 -// LZCNTL m32 r32 -func LZCNTL(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "LZCNTL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"LZCNT"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "LZCNTL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"LZCNT"}, - }, nil - } - return nil, errors.New("LZCNTL: bad operands") -} - -// LZCNTQ: Count the Number of Leading Zero Bits. -// -// Forms: -// -// LZCNTQ r64 r64 -// LZCNTQ m64 r64 -func LZCNTQ(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "LZCNTQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"LZCNT"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "LZCNTQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"LZCNT"}, - }, nil - } - return nil, errors.New("LZCNTQ: bad operands") -} - -// LZCNTW: Count the Number of Leading Zero Bits. -// -// Forms: -// -// LZCNTW r16 r16 -// LZCNTW m16 r16 -func LZCNTW(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "LZCNTW", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"LZCNT"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "LZCNTW", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"LZCNT"}, - }, nil - } - return nil, errors.New("LZCNTW: bad operands") -} - -// MASKMOVDQU: Store Selected Bytes of Double Quadword. -// -// Forms: -// -// MASKMOVDQU xmm xmm -func MASKMOVDQU(x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "MASKMOVDQU", - Operands: []operand.Op{x, x1}, - Inputs: []operand.Op{x, x1, reg.RDI}, - Outputs: []operand.Op{}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MASKMOVDQU: bad operands") -} - -// MASKMOVOU: Store Selected Bytes of Double Quadword. -// -// Forms: -// -// MASKMOVOU xmm xmm -func MASKMOVOU(x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "MASKMOVOU", - Operands: []operand.Op{x, x1}, - Inputs: []operand.Op{x, x1, reg.RDI}, - Outputs: []operand.Op{}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MASKMOVOU: bad operands") -} - -// MAXPD: Return Maximum Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// MAXPD xmm xmm -// MAXPD m128 xmm -func MAXPD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MAXPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MAXPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MAXPD: bad operands") -} - -// MAXPS: Return Maximum Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MAXPS xmm xmm -// MAXPS m128 xmm -func MAXPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MAXPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MAXPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("MAXPS: bad operands") -} - -// MAXSD: Return Maximum Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// MAXSD xmm xmm -// MAXSD m64 xmm -func MAXSD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MAXSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MAXSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MAXSD: bad operands") -} - -// MAXSS: Return Maximum Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// MAXSS xmm xmm -// MAXSS m32 xmm -func MAXSS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MAXSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MAXSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("MAXSS: bad operands") -} - -// MFENCE: Memory Fence. -// -// Forms: -// -// MFENCE -func MFENCE() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "MFENCE", - Operands: nil, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - ISA: []string{"SSE2"}, - }, nil -} - -// MINPD: Return Minimum Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// MINPD xmm xmm -// MINPD m128 xmm -func MINPD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MINPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MINPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MINPD: bad operands") -} - -// MINPS: Return Minimum Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MINPS xmm xmm -// MINPS m128 xmm -func MINPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MINPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MINPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("MINPS: bad operands") -} - -// MINSD: Return Minimum Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// MINSD xmm xmm -// MINSD m64 xmm -func MINSD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MINSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MINSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MINSD: bad operands") -} - -// MINSS: Return Minimum Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// MINSS xmm xmm -// MINSS m32 xmm -func MINSS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MINSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MINSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("MINSS: bad operands") -} - -// MONITOR: Monitor a Linear Address Range. -// -// Forms: -// -// MONITOR -func MONITOR() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "MONITOR", - Operands: nil, - Inputs: []operand.Op{reg.RAX, reg.ECX, reg.EDX}, - Outputs: []operand.Op{}, - ISA: []string{"MONITOR"}, - }, nil -} - -// MOVAPD: Move Aligned Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// MOVAPD xmm xmm -// MOVAPD m128 xmm -// MOVAPD xmm m128 -func MOVAPD(mx, mx1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVAPD", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVAPD", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(mx) && operand.IsM128(mx1): - return &intrep.Instruction{ - Opcode: "MOVAPD", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MOVAPD: bad operands") -} - -// MOVAPS: Move Aligned Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MOVAPS xmm xmm -// MOVAPS m128 xmm -// MOVAPS xmm m128 -func MOVAPS(mx, mx1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVAPS", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVAPS", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE"}, - }, nil - case operand.IsXMM(mx) && operand.IsM128(mx1): - return &intrep.Instruction{ - Opcode: "MOVAPS", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("MOVAPS: bad operands") -} - -// MOVB: Move. -// -// Forms: -// -// MOVB imm8 r8 -// MOVB r8 r8 -// MOVB m8 r8 -// MOVB imm8 m8 -// MOVB r8 m8 -func MOVB(imr, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imr) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "MOVB", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR8(imr) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "MOVB", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(imr) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "MOVB", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "MOVB", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR8(imr) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "MOVB", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("MOVB: bad operands") -} - -// MOVBELL: Move Data After Swapping Bytes. -// -// Forms: -// -// MOVBELL m32 r32 -// MOVBELL r32 m32 -func MOVBELL(mr, mr1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM32(mr) && operand.IsR32(mr1): - return &intrep.Instruction{ - Opcode: "MOVBELL", - Operands: []operand.Op{mr, mr1}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr1}, - ISA: []string{"MOVBE"}, - }, nil - case operand.IsR32(mr) && operand.IsM32(mr1): - return &intrep.Instruction{ - Opcode: "MOVBELL", - Operands: []operand.Op{mr, mr1}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr1}, - ISA: []string{"MOVBE"}, - }, nil - } - return nil, errors.New("MOVBELL: bad operands") -} - -// MOVBEQQ: Move Data After Swapping Bytes. -// -// Forms: -// -// MOVBEQQ m64 r64 -// MOVBEQQ r64 m64 -func MOVBEQQ(mr, mr1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM64(mr) && operand.IsR64(mr1): - return &intrep.Instruction{ - Opcode: "MOVBEQQ", - Operands: []operand.Op{mr, mr1}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr1}, - ISA: []string{"MOVBE"}, - }, nil - case operand.IsR64(mr) && operand.IsM64(mr1): - return &intrep.Instruction{ - Opcode: "MOVBEQQ", - Operands: []operand.Op{mr, mr1}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr1}, - ISA: []string{"MOVBE"}, - }, nil - } - return nil, errors.New("MOVBEQQ: bad operands") -} - -// MOVBEWW: Move Data After Swapping Bytes. -// -// Forms: -// -// MOVBEWW m16 r16 -// MOVBEWW r16 m16 -func MOVBEWW(mr, mr1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM16(mr) && operand.IsR16(mr1): - return &intrep.Instruction{ - Opcode: "MOVBEWW", - Operands: []operand.Op{mr, mr1}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr1}, - ISA: []string{"MOVBE"}, - }, nil - case operand.IsR16(mr) && operand.IsM16(mr1): - return &intrep.Instruction{ - Opcode: "MOVBEWW", - Operands: []operand.Op{mr, mr1}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr1}, - ISA: []string{"MOVBE"}, - }, nil - } - return nil, errors.New("MOVBEWW: bad operands") -} - -// MOVBLSX: Move with Sign-Extension. -// -// Forms: -// -// MOVBLSX r8 r32 -// MOVBLSX m8 r32 -func MOVBLSX(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "MOVBLSX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsM8(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "MOVBLSX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("MOVBLSX: bad operands") -} - -// MOVBLZX: Move with Zero-Extend. -// -// Forms: -// -// MOVBLZX r8 r32 -// MOVBLZX m8 r32 -func MOVBLZX(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "MOVBLZX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsM8(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "MOVBLZX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("MOVBLZX: bad operands") -} - -// MOVBQSX: Move with Sign-Extension. -// -// Forms: -// -// MOVBQSX r8 r64 -// MOVBQSX m8 r64 -func MOVBQSX(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "MOVBQSX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsM8(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "MOVBQSX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("MOVBQSX: bad operands") -} - -// MOVBQZX: Move with Zero-Extend. -// -// Forms: -// -// MOVBQZX r8 r64 -// MOVBQZX m8 r64 -func MOVBQZX(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "MOVBQZX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsM8(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "MOVBQZX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("MOVBQZX: bad operands") -} - -// MOVBWSX: Move with Sign-Extension. -// -// Forms: -// -// MOVBWSX r8 r16 -// MOVBWSX m8 r16 -func MOVBWSX(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "MOVBWSX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsM8(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "MOVBWSX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("MOVBWSX: bad operands") -} - -// MOVBWZX: Move with Zero-Extend. -// -// Forms: -// -// MOVBWZX r8 r16 -// MOVBWZX m8 r16 -func MOVBWZX(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "MOVBWZX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsM8(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "MOVBWZX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("MOVBWZX: bad operands") -} - -// MOVD: Move. -// -// Forms: -// -// MOVD imm32 r64 -// MOVD imm64 r64 -// MOVD r64 r64 -// MOVD m64 r64 -// MOVD imm32 m64 -// MOVD r64 m64 -// MOVD xmm r64 -// MOVD r64 xmm -// MOVD xmm xmm -// MOVD m64 xmm -// MOVD xmm m64 -// MOVD xmm r32 -// MOVD r32 xmm -// MOVD m32 xmm -// MOVD xmm m32 -func MOVD(imrx, mrx operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imrx) && operand.IsR64(mrx): - return &intrep.Instruction{ - Opcode: "MOVD", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsIMM64(imrx) && operand.IsR64(mrx): - return &intrep.Instruction{ - Opcode: "MOVD", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsR64(imrx) && operand.IsR64(mrx): - return &intrep.Instruction{ - Opcode: "MOVD", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsM64(imrx) && operand.IsR64(mrx): - return &intrep.Instruction{ - Opcode: "MOVD", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsIMM32(imrx) && operand.IsM64(mrx): - return &intrep.Instruction{ - Opcode: "MOVD", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsR64(imrx) && operand.IsM64(mrx): - return &intrep.Instruction{ - Opcode: "MOVD", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsXMM(imrx) && operand.IsR64(mrx): - return &intrep.Instruction{ - Opcode: "MOVD", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsR64(imrx) && operand.IsXMM(mrx): - return &intrep.Instruction{ - Opcode: "MOVD", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imrx) && operand.IsXMM(mrx): - return &intrep.Instruction{ - Opcode: "MOVD", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(imrx) && operand.IsXMM(mrx): - return &intrep.Instruction{ - Opcode: "MOVD", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imrx) && operand.IsM64(mrx): - return &intrep.Instruction{ - Opcode: "MOVD", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imrx) && operand.IsR32(mrx): - return &intrep.Instruction{ - Opcode: "MOVD", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsR32(imrx) && operand.IsXMM(mrx): - return &intrep.Instruction{ - Opcode: "MOVD", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM32(imrx) && operand.IsXMM(mrx): - return &intrep.Instruction{ - Opcode: "MOVD", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imrx) && operand.IsM32(mrx): - return &intrep.Instruction{ - Opcode: "MOVD", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MOVD: bad operands") -} - -// MOVDDUP: Move One Double-FP and Duplicate. -// -// Forms: -// -// MOVDDUP xmm xmm -// MOVDDUP m64 xmm -func MOVDDUP(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MOVDDUP", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MOVDDUP", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - } - return nil, errors.New("MOVDDUP: bad operands") -} - -// MOVDQ2Q: Move. -// -// Forms: -// -// MOVDQ2Q imm32 r64 -// MOVDQ2Q imm64 r64 -// MOVDQ2Q r64 r64 -// MOVDQ2Q m64 r64 -// MOVDQ2Q imm32 m64 -// MOVDQ2Q r64 m64 -// MOVDQ2Q xmm r64 -// MOVDQ2Q r64 xmm -// MOVDQ2Q xmm xmm -// MOVDQ2Q m64 xmm -// MOVDQ2Q xmm m64 -// MOVDQ2Q xmm r32 -// MOVDQ2Q r32 xmm -// MOVDQ2Q m32 xmm -// MOVDQ2Q xmm m32 -func MOVDQ2Q(imrx, mrx operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imrx) && operand.IsR64(mrx): - return &intrep.Instruction{ - Opcode: "MOVDQ2Q", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsIMM64(imrx) && operand.IsR64(mrx): - return &intrep.Instruction{ - Opcode: "MOVDQ2Q", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsR64(imrx) && operand.IsR64(mrx): - return &intrep.Instruction{ - Opcode: "MOVDQ2Q", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsM64(imrx) && operand.IsR64(mrx): - return &intrep.Instruction{ - Opcode: "MOVDQ2Q", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsIMM32(imrx) && operand.IsM64(mrx): - return &intrep.Instruction{ - Opcode: "MOVDQ2Q", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsR64(imrx) && operand.IsM64(mrx): - return &intrep.Instruction{ - Opcode: "MOVDQ2Q", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsXMM(imrx) && operand.IsR64(mrx): - return &intrep.Instruction{ - Opcode: "MOVDQ2Q", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsR64(imrx) && operand.IsXMM(mrx): - return &intrep.Instruction{ - Opcode: "MOVDQ2Q", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imrx) && operand.IsXMM(mrx): - return &intrep.Instruction{ - Opcode: "MOVDQ2Q", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(imrx) && operand.IsXMM(mrx): - return &intrep.Instruction{ - Opcode: "MOVDQ2Q", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imrx) && operand.IsM64(mrx): - return &intrep.Instruction{ - Opcode: "MOVDQ2Q", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imrx) && operand.IsR32(mrx): - return &intrep.Instruction{ - Opcode: "MOVDQ2Q", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsR32(imrx) && operand.IsXMM(mrx): - return &intrep.Instruction{ - Opcode: "MOVDQ2Q", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM32(imrx) && operand.IsXMM(mrx): - return &intrep.Instruction{ - Opcode: "MOVDQ2Q", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imrx) && operand.IsM32(mrx): - return &intrep.Instruction{ - Opcode: "MOVDQ2Q", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MOVDQ2Q: bad operands") -} - -// MOVHLPS: Move Packed Single-Precision Floating-Point Values High to Low. -// -// Forms: -// -// MOVHLPS xmm xmm -func MOVHLPS(x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "MOVHLPS", - Operands: []operand.Op{x, x1}, - Inputs: []operand.Op{x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("MOVHLPS: bad operands") -} - -// MOVHPD: Move High Packed Double-Precision Floating-Point Value. -// -// Forms: -// -// MOVHPD m64 xmm -// MOVHPD xmm m64 -func MOVHPD(mx, mx1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM64(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVHPD", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx, mx1}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(mx) && operand.IsM64(mx1): - return &intrep.Instruction{ - Opcode: "MOVHPD", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MOVHPD: bad operands") -} - -// MOVHPS: Move High Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MOVHPS m64 xmm -// MOVHPS xmm m64 -func MOVHPS(mx, mx1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM64(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVHPS", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx, mx1}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE"}, - }, nil - case operand.IsXMM(mx) && operand.IsM64(mx1): - return &intrep.Instruction{ - Opcode: "MOVHPS", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("MOVHPS: bad operands") -} - -// MOVL: Move. -// -// Forms: -// -// MOVL imm32 r32 -// MOVL r32 r32 -// MOVL m32 r32 -// MOVL imm32 m32 -// MOVL r32 m32 -func MOVL(imr, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imr) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "MOVL", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR32(imr) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "MOVL", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM32(imr) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "MOVL", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM32(imr) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "MOVL", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR32(imr) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "MOVL", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("MOVL: bad operands") -} - -// MOVLHPS: Move Packed Single-Precision Floating-Point Values Low to High. -// -// Forms: -// -// MOVLHPS xmm xmm -func MOVLHPS(x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "MOVLHPS", - Operands: []operand.Op{x, x1}, - Inputs: []operand.Op{x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("MOVLHPS: bad operands") -} - -// MOVLPD: Move Low Packed Double-Precision Floating-Point Value. -// -// Forms: -// -// MOVLPD m64 xmm -// MOVLPD xmm m64 -func MOVLPD(mx, mx1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM64(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVLPD", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx, mx1}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(mx) && operand.IsM64(mx1): - return &intrep.Instruction{ - Opcode: "MOVLPD", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MOVLPD: bad operands") -} - -// MOVLPS: Move Low Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MOVLPS m64 xmm -// MOVLPS xmm m64 -func MOVLPS(mx, mx1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM64(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVLPS", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx, mx1}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE"}, - }, nil - case operand.IsXMM(mx) && operand.IsM64(mx1): - return &intrep.Instruction{ - Opcode: "MOVLPS", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("MOVLPS: bad operands") -} - -// MOVLQSX: Move Doubleword to Quadword with Sign-Extension. -// -// Forms: -// -// MOVLQSX r32 r64 -// MOVLQSX m32 r64 -func MOVLQSX(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "MOVLQSX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsM32(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "MOVLQSX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("MOVLQSX: bad operands") -} - -// MOVLQZX: Move with Zero-Extend. -// -// Forms: -// -// MOVLQZX m32 r64 -func MOVLQZX(m, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM32(m) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "MOVLQZX", - Operands: []operand.Op{m, r}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("MOVLQZX: bad operands") -} - -// MOVMSKPD: Extract Packed Double-Precision Floating-Point Sign Mask. -// -// Forms: -// -// MOVMSKPD xmm r32 -func MOVMSKPD(x, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(x) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "MOVMSKPD", - Operands: []operand.Op{x, r}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MOVMSKPD: bad operands") -} - -// MOVMSKPS: Extract Packed Single-Precision Floating-Point Sign Mask. -// -// Forms: -// -// MOVMSKPS xmm r32 -func MOVMSKPS(x, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(x) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "MOVMSKPS", - Operands: []operand.Op{x, r}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("MOVMSKPS: bad operands") -} - -// MOVNTDQ: Store Double Quadword Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTDQ xmm m128 -func MOVNTDQ(x, m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(x) && operand.IsM128(m): - return &intrep.Instruction{ - Opcode: "MOVNTDQ", - Operands: []operand.Op{x, m}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{m}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MOVNTDQ: bad operands") -} - -// MOVNTDQA: Load Double Quadword Non-Temporal Aligned Hint. -// -// Forms: -// -// MOVNTDQA m128 xmm -func MOVNTDQA(m, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM128(m) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MOVNTDQA", - Operands: []operand.Op{m, x}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("MOVNTDQA: bad operands") -} - -// MOVNTIL: Store Doubleword Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTIL r32 m32 -func MOVNTIL(r, m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(r) && operand.IsM32(m): - return &intrep.Instruction{ - Opcode: "MOVNTIL", - Operands: []operand.Op{r, m}, - Inputs: []operand.Op{r}, - Outputs: []operand.Op{m}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MOVNTIL: bad operands") -} - -// MOVNTIQ: Store Doubleword Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTIQ r64 m64 -func MOVNTIQ(r, m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(r) && operand.IsM64(m): - return &intrep.Instruction{ - Opcode: "MOVNTIQ", - Operands: []operand.Op{r, m}, - Inputs: []operand.Op{r}, - Outputs: []operand.Op{m}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MOVNTIQ: bad operands") -} - -// MOVNTO: Store Double Quadword Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTO xmm m128 -func MOVNTO(x, m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(x) && operand.IsM128(m): - return &intrep.Instruction{ - Opcode: "MOVNTO", - Operands: []operand.Op{x, m}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{m}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MOVNTO: bad operands") -} - -// MOVNTPD: Store Packed Double-Precision Floating-Point Values Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTPD xmm m128 -func MOVNTPD(x, m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(x) && operand.IsM128(m): - return &intrep.Instruction{ - Opcode: "MOVNTPD", - Operands: []operand.Op{x, m}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{m}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MOVNTPD: bad operands") -} - -// MOVNTPS: Store Packed Single-Precision Floating-Point Values Using Non-Temporal Hint. -// -// Forms: -// -// MOVNTPS xmm m128 -func MOVNTPS(x, m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(x) && operand.IsM128(m): - return &intrep.Instruction{ - Opcode: "MOVNTPS", - Operands: []operand.Op{x, m}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{m}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("MOVNTPS: bad operands") -} - -// MOVO: Move Aligned Double Quadword. -// -// Forms: -// -// MOVO xmm xmm -// MOVO m128 xmm -// MOVO xmm m128 -func MOVO(mx, mx1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVO", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVO", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(mx) && operand.IsM128(mx1): - return &intrep.Instruction{ - Opcode: "MOVO", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MOVO: bad operands") -} - -// MOVOA: Move Aligned Double Quadword. -// -// Forms: -// -// MOVOA xmm xmm -// MOVOA m128 xmm -// MOVOA xmm m128 -func MOVOA(mx, mx1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVOA", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVOA", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(mx) && operand.IsM128(mx1): - return &intrep.Instruction{ - Opcode: "MOVOA", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MOVOA: bad operands") -} - -// MOVOU: Move Unaligned Double Quadword. -// -// Forms: -// -// MOVOU xmm xmm -// MOVOU m128 xmm -// MOVOU xmm m128 -func MOVOU(mx, mx1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVOU", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVOU", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(mx) && operand.IsM128(mx1): - return &intrep.Instruction{ - Opcode: "MOVOU", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MOVOU: bad operands") -} - -// MOVQ: Move. -// -// Forms: -// -// MOVQ imm32 r64 -// MOVQ imm64 r64 -// MOVQ r64 r64 -// MOVQ m64 r64 -// MOVQ imm32 m64 -// MOVQ r64 m64 -// MOVQ xmm r64 -// MOVQ r64 xmm -// MOVQ xmm xmm -// MOVQ m64 xmm -// MOVQ xmm m64 -// MOVQ xmm r32 -// MOVQ r32 xmm -// MOVQ m32 xmm -// MOVQ xmm m32 -func MOVQ(imrx, mrx operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imrx) && operand.IsR64(mrx): - return &intrep.Instruction{ - Opcode: "MOVQ", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsIMM64(imrx) && operand.IsR64(mrx): - return &intrep.Instruction{ - Opcode: "MOVQ", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsR64(imrx) && operand.IsR64(mrx): - return &intrep.Instruction{ - Opcode: "MOVQ", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsM64(imrx) && operand.IsR64(mrx): - return &intrep.Instruction{ - Opcode: "MOVQ", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsIMM32(imrx) && operand.IsM64(mrx): - return &intrep.Instruction{ - Opcode: "MOVQ", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsR64(imrx) && operand.IsM64(mrx): - return &intrep.Instruction{ - Opcode: "MOVQ", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - }, nil - case operand.IsXMM(imrx) && operand.IsR64(mrx): - return &intrep.Instruction{ - Opcode: "MOVQ", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsR64(imrx) && operand.IsXMM(mrx): - return &intrep.Instruction{ - Opcode: "MOVQ", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imrx) && operand.IsXMM(mrx): - return &intrep.Instruction{ - Opcode: "MOVQ", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(imrx) && operand.IsXMM(mrx): - return &intrep.Instruction{ - Opcode: "MOVQ", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imrx) && operand.IsM64(mrx): - return &intrep.Instruction{ - Opcode: "MOVQ", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imrx) && operand.IsR32(mrx): - return &intrep.Instruction{ - Opcode: "MOVQ", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsR32(imrx) && operand.IsXMM(mrx): - return &intrep.Instruction{ - Opcode: "MOVQ", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM32(imrx) && operand.IsXMM(mrx): - return &intrep.Instruction{ - Opcode: "MOVQ", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imrx) && operand.IsM32(mrx): - return &intrep.Instruction{ - Opcode: "MOVQ", - Operands: []operand.Op{imrx, mrx}, - Inputs: []operand.Op{imrx}, - Outputs: []operand.Op{mrx}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MOVQ: bad operands") -} - -// MOVSD: Move Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// MOVSD xmm xmm -// MOVSD m64 xmm -// MOVSD xmm m64 -func MOVSD(mx, mx1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVSD", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx, mx1}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVSD", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(mx) && operand.IsM64(mx1): - return &intrep.Instruction{ - Opcode: "MOVSD", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MOVSD: bad operands") -} - -// MOVSHDUP: Move Packed Single-FP High and Duplicate. -// -// Forms: -// -// MOVSHDUP xmm xmm -// MOVSHDUP m128 xmm -func MOVSHDUP(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MOVSHDUP", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MOVSHDUP", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - } - return nil, errors.New("MOVSHDUP: bad operands") -} - -// MOVSLDUP: Move Packed Single-FP Low and Duplicate. -// -// Forms: -// -// MOVSLDUP xmm xmm -// MOVSLDUP m128 xmm -func MOVSLDUP(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MOVSLDUP", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MOVSLDUP", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE3"}, - }, nil - } - return nil, errors.New("MOVSLDUP: bad operands") -} - -// MOVSS: Move Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// MOVSS xmm xmm -// MOVSS m32 xmm -// MOVSS xmm m32 -func MOVSS(mx, mx1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVSS", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx, mx1}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVSS", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE"}, - }, nil - case operand.IsXMM(mx) && operand.IsM32(mx1): - return &intrep.Instruction{ - Opcode: "MOVSS", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("MOVSS: bad operands") -} - -// MOVUPD: Move Unaligned Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// MOVUPD xmm xmm -// MOVUPD m128 xmm -// MOVUPD xmm m128 -func MOVUPD(mx, mx1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVUPD", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVUPD", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(mx) && operand.IsM128(mx1): - return &intrep.Instruction{ - Opcode: "MOVUPD", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MOVUPD: bad operands") -} - -// MOVUPS: Move Unaligned Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MOVUPS xmm xmm -// MOVUPS m128 xmm -// MOVUPS xmm m128 -func MOVUPS(mx, mx1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVUPS", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(mx1): - return &intrep.Instruction{ - Opcode: "MOVUPS", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE"}, - }, nil - case operand.IsXMM(mx) && operand.IsM128(mx1): - return &intrep.Instruction{ - Opcode: "MOVUPS", - Operands: []operand.Op{mx, mx1}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{mx1}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("MOVUPS: bad operands") -} - -// MOVW: Move. -// -// Forms: -// -// MOVW imm16 r16 -// MOVW r16 r16 -// MOVW m16 r16 -// MOVW imm16 m16 -// MOVW r16 m16 -func MOVW(imr, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM16(imr) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "MOVW", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR16(imr) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "MOVW", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM16(imr) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "MOVW", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM16(imr) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "MOVW", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR16(imr) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "MOVW", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("MOVW: bad operands") -} - -// MOVWLSX: Move with Sign-Extension. -// -// Forms: -// -// MOVWLSX r16 r32 -// MOVWLSX m16 r32 -func MOVWLSX(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "MOVWLSX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsM16(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "MOVWLSX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("MOVWLSX: bad operands") -} - -// MOVWLZX: Move with Zero-Extend. -// -// Forms: -// -// MOVWLZX r16 r32 -// MOVWLZX m16 r32 -func MOVWLZX(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "MOVWLZX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsM16(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "MOVWLZX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("MOVWLZX: bad operands") -} - -// MOVWQSX: Move with Sign-Extension. -// -// Forms: -// -// MOVWQSX r16 r64 -// MOVWQSX m16 r64 -func MOVWQSX(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "MOVWQSX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsM16(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "MOVWQSX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("MOVWQSX: bad operands") -} - -// MOVWQZX: Move with Zero-Extend. -// -// Forms: -// -// MOVWQZX r16 r64 -// MOVWQZX m16 r64 -func MOVWQZX(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "MOVWQZX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - case operand.IsM16(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "MOVWQZX", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - }, nil - } - return nil, errors.New("MOVWQZX: bad operands") -} - -// MPSADBW: Compute Multiple Packed Sums of Absolute Difference. -// -// Forms: -// -// MPSADBW imm8 xmm xmm -// MPSADBW imm8 m128 xmm -func MPSADBW(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MPSADBW", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MPSADBW", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("MPSADBW: bad operands") -} - -// MULB: Unsigned Multiply. -// -// Forms: -// -// MULB r8 -// MULB m8 -func MULB(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "MULB", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.AL}, - Outputs: []operand.Op{reg.AX}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "MULB", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.AL}, - Outputs: []operand.Op{reg.AX}, - }, nil - } - return nil, errors.New("MULB: bad operands") -} - -// MULL: Unsigned Multiply. -// -// Forms: -// -// MULL r32 -// MULL m32 -func MULL(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "MULL", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.EAX}, - Outputs: []operand.Op{reg.EAX, reg.EDX}, - }, nil - case operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "MULL", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.EAX}, - Outputs: []operand.Op{reg.EAX, reg.EDX}, - }, nil - } - return nil, errors.New("MULL: bad operands") -} - -// MULPD: Multiply Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// MULPD xmm xmm -// MULPD m128 xmm -func MULPD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MULPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MULPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MULPD: bad operands") -} - -// MULPS: Multiply Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// MULPS xmm xmm -// MULPS m128 xmm -func MULPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MULPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MULPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("MULPS: bad operands") -} - -// MULQ: Unsigned Multiply. -// -// Forms: -// -// MULQ r64 -// MULQ m64 -func MULQ(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "MULQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.RAX}, - Outputs: []operand.Op{reg.RAX, reg.RDX}, - }, nil - case operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "MULQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.RAX}, - Outputs: []operand.Op{reg.RAX, reg.RDX}, - }, nil - } - return nil, errors.New("MULQ: bad operands") -} - -// MULSD: Multiply Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// MULSD xmm xmm -// MULSD m64 xmm -func MULSD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MULSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MULSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("MULSD: bad operands") -} - -// MULSS: Multiply Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// MULSS xmm xmm -// MULSS m32 xmm -func MULSS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MULSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "MULSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("MULSS: bad operands") -} - -// MULW: Unsigned Multiply. -// -// Forms: -// -// MULW r16 -// MULW m16 -func MULW(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "MULW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.AX}, - Outputs: []operand.Op{reg.AX, reg.DX}, - }, nil - case operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "MULW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr, reg.AX}, - Outputs: []operand.Op{reg.AX, reg.DX}, - }, nil - } - return nil, errors.New("MULW: bad operands") -} - -// MULXL: Unsigned Multiply Without Affecting Flags. -// -// Forms: -// -// MULXL r32 r32 r32 -// MULXL m32 r32 r32 -func MULXL(mr, r, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "MULXL", - Operands: []operand.Op{mr, r, r1}, - Inputs: []operand.Op{mr, reg.EDX}, - Outputs: []operand.Op{r, r1}, - ISA: []string{"BMI2"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "MULXL", - Operands: []operand.Op{mr, r, r1}, - Inputs: []operand.Op{mr, reg.EDX}, - Outputs: []operand.Op{r, r1}, - ISA: []string{"BMI2"}, - }, nil - } - return nil, errors.New("MULXL: bad operands") -} - -// MULXQ: Unsigned Multiply Without Affecting Flags. -// -// Forms: -// -// MULXQ r64 r64 r64 -// MULXQ m64 r64 r64 -func MULXQ(mr, r, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "MULXQ", - Operands: []operand.Op{mr, r, r1}, - Inputs: []operand.Op{mr, reg.RDX}, - Outputs: []operand.Op{r, r1}, - ISA: []string{"BMI2"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "MULXQ", - Operands: []operand.Op{mr, r, r1}, - Inputs: []operand.Op{mr, reg.RDX}, - Outputs: []operand.Op{r, r1}, - ISA: []string{"BMI2"}, - }, nil - } - return nil, errors.New("MULXQ: bad operands") -} - -// MWAIT: Monitor Wait. -// -// Forms: -// -// MWAIT -func MWAIT() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "MWAIT", - Operands: nil, - Inputs: []operand.Op{reg.EAX, reg.ECX}, - Outputs: []operand.Op{}, - ISA: []string{"MONITOR"}, - }, nil -} - -// NEGB: Two's Complement Negation. -// -// Forms: -// -// NEGB r8 -// NEGB m8 -func NEGB(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "NEGB", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "NEGB", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("NEGB: bad operands") -} - -// NEGL: Two's Complement Negation. -// -// Forms: -// -// NEGL r32 -// NEGL m32 -func NEGL(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "NEGL", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "NEGL", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("NEGL: bad operands") -} - -// NEGQ: Two's Complement Negation. -// -// Forms: -// -// NEGQ r64 -// NEGQ m64 -func NEGQ(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "NEGQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "NEGQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("NEGQ: bad operands") -} - -// NEGW: Two's Complement Negation. -// -// Forms: -// -// NEGW r16 -// NEGW m16 -func NEGW(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "NEGW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "NEGW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("NEGW: bad operands") -} - -// NOP: No Operation. -// -// Forms: -// -// NOP -func NOP() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "NOP", - Operands: nil, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - }, nil -} - -// NOTB: One's Complement Negation. -// -// Forms: -// -// NOTB r8 -// NOTB m8 -func NOTB(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "NOTB", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "NOTB", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("NOTB: bad operands") -} - -// NOTL: One's Complement Negation. -// -// Forms: -// -// NOTL r32 -// NOTL m32 -func NOTL(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "NOTL", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "NOTL", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("NOTL: bad operands") -} - -// NOTQ: One's Complement Negation. -// -// Forms: -// -// NOTQ r64 -// NOTQ m64 -func NOTQ(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "NOTQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "NOTQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("NOTQ: bad operands") -} - -// NOTW: One's Complement Negation. -// -// Forms: -// -// NOTW r16 -// NOTW m16 -func NOTW(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "NOTW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "NOTW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("NOTW: bad operands") -} - -// ORB: Logical Inclusive OR. -// -// Forms: -// -// ORB imm8 al -// ORB imm8 r8 -// ORB r8 r8 -// ORB m8 r8 -// ORB imm8 m8 -// ORB r8 m8 -func ORB(imr, amr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imr) && operand.IsAL(amr): - return &intrep.Instruction{ - Opcode: "ORB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "ORB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "ORB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsM8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "ORB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM8(amr): - return &intrep.Instruction{ - Opcode: "ORB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR8(imr) && operand.IsM8(amr): - return &intrep.Instruction{ - Opcode: "ORB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - } - return nil, errors.New("ORB: bad operands") -} - -// ORL: Logical Inclusive OR. -// -// Forms: -// -// ORL imm32 eax -// ORL imm8 r32 -// ORL imm32 r32 -// ORL r32 r32 -// ORL m32 r32 -// ORL imm8 m32 -// ORL imm32 m32 -// ORL r32 m32 -func ORL(imr, emr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imr) && operand.IsEAX(emr): - return &intrep.Instruction{ - Opcode: "ORL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "ORL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "ORL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsR32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "ORL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsM32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "ORL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "ORL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM32(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "ORL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsR32(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "ORL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - } - return nil, errors.New("ORL: bad operands") -} - -// ORPD: Bitwise Logical OR of Double-Precision Floating-Point Values. -// -// Forms: -// -// ORPD xmm xmm -// ORPD m128 xmm -func ORPD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ORPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ORPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("ORPD: bad operands") -} - -// ORPS: Bitwise Logical OR of Single-Precision Floating-Point Values. -// -// Forms: -// -// ORPS xmm xmm -// ORPS m128 xmm -func ORPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ORPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ORPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("ORPS: bad operands") -} - -// ORQ: Logical Inclusive OR. -// -// Forms: -// -// ORQ imm32 rax -// ORQ imm8 r64 -// ORQ imm32 r64 -// ORQ r64 r64 -// ORQ m64 r64 -// ORQ imm8 m64 -// ORQ imm32 m64 -// ORQ r64 m64 -func ORQ(imr, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imr) && operand.IsRAX(mr): - return &intrep.Instruction{ - Opcode: "ORQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ORQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM32(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ORQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ORQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM64(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ORQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "ORQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM32(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "ORQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "ORQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("ORQ: bad operands") -} - -// ORW: Logical Inclusive OR. -// -// Forms: -// -// ORW imm16 ax -// ORW imm8 r16 -// ORW imm16 r16 -// ORW r16 r16 -// ORW m16 r16 -// ORW imm8 m16 -// ORW imm16 m16 -// ORW r16 m16 -func ORW(imr, amr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM16(imr) && operand.IsAX(amr): - return &intrep.Instruction{ - Opcode: "ORW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "ORW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "ORW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "ORW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsM16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "ORW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "ORW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM16(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "ORW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR16(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "ORW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - } - return nil, errors.New("ORW: bad operands") -} - -// PABSB: Packed Absolute Value of Byte Integers. -// -// Forms: -// -// PABSB xmm xmm -// PABSB m128 xmm -func PABSB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PABSB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PABSB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - } - return nil, errors.New("PABSB: bad operands") -} - -// PABSD: Packed Absolute Value of Doubleword Integers. -// -// Forms: -// -// PABSD xmm xmm -// PABSD m128 xmm -func PABSD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PABSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PABSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - } - return nil, errors.New("PABSD: bad operands") -} - -// PABSW: Packed Absolute Value of Word Integers. -// -// Forms: -// -// PABSW xmm xmm -// PABSW m128 xmm -func PABSW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PABSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PABSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - } - return nil, errors.New("PABSW: bad operands") -} - -// PACKSSLW: Pack Doublewords into Words with Signed Saturation. -// -// Forms: -// -// PACKSSLW xmm xmm -// PACKSSLW m128 xmm -func PACKSSLW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PACKSSLW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PACKSSLW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PACKSSLW: bad operands") -} - -// PACKSSWB: Pack Words into Bytes with Signed Saturation. -// -// Forms: -// -// PACKSSWB xmm xmm -// PACKSSWB m128 xmm -func PACKSSWB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PACKSSWB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PACKSSWB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PACKSSWB: bad operands") -} - -// PACKUSDW: Pack Doublewords into Words with Unsigned Saturation. -// -// Forms: -// -// PACKUSDW xmm xmm -// PACKUSDW m128 xmm -func PACKUSDW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PACKUSDW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PACKUSDW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PACKUSDW: bad operands") -} - -// PACKUSWB: Pack Words into Bytes with Unsigned Saturation. -// -// Forms: -// -// PACKUSWB xmm xmm -// PACKUSWB m128 xmm -func PACKUSWB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PACKUSWB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PACKUSWB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PACKUSWB: bad operands") -} - -// PADDB: Add Packed Byte Integers. -// -// Forms: -// -// PADDB xmm xmm -// PADDB m128 xmm -func PADDB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PADDB: bad operands") -} - -// PADDD: Add Packed Doubleword Integers. -// -// Forms: -// -// PADDD xmm xmm -// PADDD m128 xmm -func PADDD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PADDD: bad operands") -} - -// PADDL: Add Packed Doubleword Integers. -// -// Forms: -// -// PADDL xmm xmm -// PADDL m128 xmm -func PADDL(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PADDL: bad operands") -} - -// PADDQ: Add Packed Quadword Integers. -// -// Forms: -// -// PADDQ xmm xmm -// PADDQ m128 xmm -func PADDQ(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PADDQ: bad operands") -} - -// PADDSB: Add Packed Signed Byte Integers with Signed Saturation. -// -// Forms: -// -// PADDSB xmm xmm -// PADDSB m128 xmm -func PADDSB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDSB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDSB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PADDSB: bad operands") -} - -// PADDSW: Add Packed Signed Word Integers with Signed Saturation. -// -// Forms: -// -// PADDSW xmm xmm -// PADDSW m128 xmm -func PADDSW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PADDSW: bad operands") -} - -// PADDUSB: Add Packed Unsigned Byte Integers with Unsigned Saturation. -// -// Forms: -// -// PADDUSB xmm xmm -// PADDUSB m128 xmm -func PADDUSB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDUSB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDUSB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PADDUSB: bad operands") -} - -// PADDUSW: Add Packed Unsigned Word Integers with Unsigned Saturation. -// -// Forms: -// -// PADDUSW xmm xmm -// PADDUSW m128 xmm -func PADDUSW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDUSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDUSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PADDUSW: bad operands") -} - -// PADDW: Add Packed Word Integers. -// -// Forms: -// -// PADDW xmm xmm -// PADDW m128 xmm -func PADDW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PADDW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PADDW: bad operands") -} - -// PALIGNR: Packed Align Right. -// -// Forms: -// -// PALIGNR imm8 xmm xmm -// PALIGNR imm8 m128 xmm -func PALIGNR(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PALIGNR", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PALIGNR", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - } - return nil, errors.New("PALIGNR: bad operands") -} - -// PAND: Packed Bitwise Logical AND. -// -// Forms: -// -// PAND xmm xmm -// PAND m128 xmm -func PAND(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PAND", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PAND", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PAND: bad operands") -} - -// PANDN: Packed Bitwise Logical AND NOT. -// -// Forms: -// -// PANDN xmm xmm -// PANDN m128 xmm -func PANDN(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PANDN", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PANDN", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PANDN: bad operands") -} - -// PAUSE: Spin Loop Hint. -// -// Forms: -// -// PAUSE -func PAUSE() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "PAUSE", - Operands: nil, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - }, nil -} - -// PAVGB: Average Packed Byte Integers. -// -// Forms: -// -// PAVGB xmm xmm -// PAVGB m128 xmm -func PAVGB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PAVGB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PAVGB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PAVGB: bad operands") -} - -// PAVGW: Average Packed Word Integers. -// -// Forms: -// -// PAVGW xmm xmm -// PAVGW m128 xmm -func PAVGW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PAVGW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PAVGW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PAVGW: bad operands") -} - -// PBLENDVB: Variable Blend Packed Bytes. -// -// Forms: -// -// PBLENDVB xmm0 xmm xmm -// PBLENDVB xmm0 m128 xmm -func PBLENDVB(x, mx, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM0(x) && operand.IsXMM(mx) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "PBLENDVB", - Operands: []operand.Op{x, mx, x1}, - Inputs: []operand.Op{x, mx, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsXMM0(x) && operand.IsM128(mx) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "PBLENDVB", - Operands: []operand.Op{x, mx, x1}, - Inputs: []operand.Op{x, mx, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PBLENDVB: bad operands") -} - -// PBLENDW: Blend Packed Words. -// -// Forms: -// -// PBLENDW imm8 xmm xmm -// PBLENDW imm8 m128 xmm -func PBLENDW(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PBLENDW", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PBLENDW", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PBLENDW: bad operands") -} - -// PCLMULQDQ: Carry-Less Quadword Multiplication. -// -// Forms: -// -// PCLMULQDQ imm8 xmm xmm -// PCLMULQDQ imm8 m128 xmm -func PCLMULQDQ(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCLMULQDQ", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"PCLMULQDQ"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCLMULQDQ", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"PCLMULQDQ"}, - }, nil - } - return nil, errors.New("PCLMULQDQ: bad operands") -} - -// PCMPEQB: Compare Packed Byte Data for Equality. -// -// Forms: -// -// PCMPEQB xmm xmm -// PCMPEQB m128 xmm -func PCMPEQB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPEQB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPEQB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PCMPEQB: bad operands") -} - -// PCMPEQL: Compare Packed Doubleword Data for Equality. -// -// Forms: -// -// PCMPEQL xmm xmm -// PCMPEQL m128 xmm -func PCMPEQL(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPEQL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPEQL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PCMPEQL: bad operands") -} - -// PCMPEQQ: Compare Packed Quadword Data for Equality. -// -// Forms: -// -// PCMPEQQ xmm xmm -// PCMPEQQ m128 xmm -func PCMPEQQ(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPEQQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPEQQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PCMPEQQ: bad operands") -} - -// PCMPEQW: Compare Packed Word Data for Equality. -// -// Forms: -// -// PCMPEQW xmm xmm -// PCMPEQW m128 xmm -func PCMPEQW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPEQW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPEQW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PCMPEQW: bad operands") -} - -// PCMPESTRI: Packed Compare Explicit Length Strings, Return Index. -// -// Forms: -// -// PCMPESTRI imm8 xmm xmm -// PCMPESTRI imm8 m128 xmm -func PCMPESTRI(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPESTRI", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x, reg.EAX, reg.EDX}, - Outputs: []operand.Op{reg.ECX}, - ISA: []string{"SSE4.2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPESTRI", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x, reg.EAX, reg.EDX}, - Outputs: []operand.Op{reg.ECX}, - ISA: []string{"SSE4.2"}, - }, nil - } - return nil, errors.New("PCMPESTRI: bad operands") -} - -// PCMPESTRM: Packed Compare Explicit Length Strings, Return Mask. -// -// Forms: -// -// PCMPESTRM imm8 xmm xmm -// PCMPESTRM imm8 m128 xmm -func PCMPESTRM(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPESTRM", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x, reg.EAX, reg.EDX}, - Outputs: []operand.Op{reg.X0}, - ISA: []string{"SSE4.2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPESTRM", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x, reg.EAX, reg.EDX}, - Outputs: []operand.Op{reg.X0}, - ISA: []string{"SSE4.2"}, - }, nil - } - return nil, errors.New("PCMPESTRM: bad operands") -} - -// PCMPGTB: Compare Packed Signed Byte Integers for Greater Than. -// -// Forms: -// -// PCMPGTB xmm xmm -// PCMPGTB m128 xmm -func PCMPGTB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPGTB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPGTB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PCMPGTB: bad operands") -} - -// PCMPGTL: Compare Packed Signed Doubleword Integers for Greater Than. -// -// Forms: -// -// PCMPGTL xmm xmm -// PCMPGTL m128 xmm -func PCMPGTL(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPGTL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPGTL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PCMPGTL: bad operands") -} - -// PCMPGTQ: Compare Packed Data for Greater Than. -// -// Forms: -// -// PCMPGTQ xmm xmm -// PCMPGTQ m128 xmm -func PCMPGTQ(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPGTQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPGTQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.2"}, - }, nil - } - return nil, errors.New("PCMPGTQ: bad operands") -} - -// PCMPGTW: Compare Packed Signed Word Integers for Greater Than. -// -// Forms: -// -// PCMPGTW xmm xmm -// PCMPGTW m128 xmm -func PCMPGTW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPGTW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPGTW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PCMPGTW: bad operands") -} - -// PCMPISTRI: Packed Compare Implicit Length Strings, Return Index. -// -// Forms: -// -// PCMPISTRI imm8 xmm xmm -// PCMPISTRI imm8 m128 xmm -func PCMPISTRI(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPISTRI", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{reg.ECX}, - ISA: []string{"SSE4.2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPISTRI", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{reg.ECX}, - ISA: []string{"SSE4.2"}, - }, nil - } - return nil, errors.New("PCMPISTRI: bad operands") -} - -// PCMPISTRM: Packed Compare Implicit Length Strings, Return Mask. -// -// Forms: -// -// PCMPISTRM imm8 xmm xmm -// PCMPISTRM imm8 m128 xmm -func PCMPISTRM(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPISTRM", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{reg.X0}, - ISA: []string{"SSE4.2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PCMPISTRM", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{reg.X0}, - ISA: []string{"SSE4.2"}, - }, nil - } - return nil, errors.New("PCMPISTRM: bad operands") -} - -// PDEPL: Parallel Bits Deposit. -// -// Forms: -// -// PDEPL r32 r32 r32 -// PDEPL m32 r32 r32 -func PDEPL(mr, r, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "PDEPL", - Operands: []operand.Op{mr, r, r1}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "PDEPL", - Operands: []operand.Op{mr, r, r1}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - } - return nil, errors.New("PDEPL: bad operands") -} - -// PDEPQ: Parallel Bits Deposit. -// -// Forms: -// -// PDEPQ r64 r64 r64 -// PDEPQ m64 r64 r64 -func PDEPQ(mr, r, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "PDEPQ", - Operands: []operand.Op{mr, r, r1}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "PDEPQ", - Operands: []operand.Op{mr, r, r1}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - } - return nil, errors.New("PDEPQ: bad operands") -} - -// PEXTL: Parallel Bits Extract. -// -// Forms: -// -// PEXTL r32 r32 r32 -// PEXTL m32 r32 r32 -func PEXTL(mr, r, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "PEXTL", - Operands: []operand.Op{mr, r, r1}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "PEXTL", - Operands: []operand.Op{mr, r, r1}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - } - return nil, errors.New("PEXTL: bad operands") -} - -// PEXTQ: Parallel Bits Extract. -// -// Forms: -// -// PEXTQ r64 r64 r64 -// PEXTQ m64 r64 r64 -func PEXTQ(mr, r, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "PEXTQ", - Operands: []operand.Op{mr, r, r1}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "PEXTQ", - Operands: []operand.Op{mr, r, r1}, - Inputs: []operand.Op{mr, r}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - } - return nil, errors.New("PEXTQ: bad operands") -} - -// PEXTRB: Extract Byte. -// -// Forms: -// -// PEXTRB imm8 xmm r32 -// PEXTRB imm8 xmm m8 -func PEXTRB(i, x, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "PEXTRB", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "PEXTRB", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PEXTRB: bad operands") -} - -// PEXTRD: Extract Doubleword. -// -// Forms: -// -// PEXTRD imm8 xmm r32 -// PEXTRD imm8 xmm m32 -func PEXTRD(i, x, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "PEXTRD", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "PEXTRD", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PEXTRD: bad operands") -} - -// PEXTRQ: Extract Quadword. -// -// Forms: -// -// PEXTRQ imm8 xmm r64 -// PEXTRQ imm8 xmm m64 -func PEXTRQ(i, x, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "PEXTRQ", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "PEXTRQ", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PEXTRQ: bad operands") -} - -// PEXTRW: Extract Word. -// -// Forms: -// -// PEXTRW imm8 xmm r32 -// PEXTRW imm8 xmm m16 -func PEXTRW(i, x, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "PEXTRW", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "PEXTRW", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PEXTRW: bad operands") -} - -// PHADDD: Packed Horizontal Add Doubleword Integer. -// -// Forms: -// -// PHADDD xmm xmm -// PHADDD m128 xmm -func PHADDD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PHADDD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PHADDD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - } - return nil, errors.New("PHADDD: bad operands") -} - -// PHADDSW: Packed Horizontal Add Signed Word Integers with Signed Saturation. -// -// Forms: -// -// PHADDSW xmm xmm -// PHADDSW m128 xmm -func PHADDSW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PHADDSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PHADDSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - } - return nil, errors.New("PHADDSW: bad operands") -} - -// PHADDW: Packed Horizontal Add Word Integers. -// -// Forms: -// -// PHADDW xmm xmm -// PHADDW m128 xmm -func PHADDW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PHADDW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PHADDW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - } - return nil, errors.New("PHADDW: bad operands") -} - -// PHMINPOSUW: Packed Horizontal Minimum of Unsigned Word Integers. -// -// Forms: -// -// PHMINPOSUW xmm xmm -// PHMINPOSUW m128 xmm -func PHMINPOSUW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PHMINPOSUW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PHMINPOSUW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PHMINPOSUW: bad operands") -} - -// PHSUBD: Packed Horizontal Subtract Doubleword Integers. -// -// Forms: -// -// PHSUBD xmm xmm -// PHSUBD m128 xmm -func PHSUBD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PHSUBD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PHSUBD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - } - return nil, errors.New("PHSUBD: bad operands") -} - -// PHSUBSW: Packed Horizontal Subtract Signed Word Integers with Signed Saturation. -// -// Forms: -// -// PHSUBSW xmm xmm -// PHSUBSW m128 xmm -func PHSUBSW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PHSUBSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PHSUBSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - } - return nil, errors.New("PHSUBSW: bad operands") -} - -// PHSUBW: Packed Horizontal Subtract Word Integers. -// -// Forms: -// -// PHSUBW xmm xmm -// PHSUBW m128 xmm -func PHSUBW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PHSUBW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PHSUBW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - } - return nil, errors.New("PHSUBW: bad operands") -} - -// PINSRB: Insert Byte. -// -// Forms: -// -// PINSRB imm8 r32 xmm -// PINSRB imm8 m8 xmm -func PINSRB(i, mr, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsR32(mr) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PINSRB", - Operands: []operand.Op{i, mr, x}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsM8(mr) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PINSRB", - Operands: []operand.Op{i, mr, x}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PINSRB: bad operands") -} - -// PINSRD: Insert Doubleword. -// -// Forms: -// -// PINSRD imm8 r32 xmm -// PINSRD imm8 m32 xmm -func PINSRD(i, mr, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsR32(mr) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PINSRD", - Operands: []operand.Op{i, mr, x}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsM32(mr) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PINSRD", - Operands: []operand.Op{i, mr, x}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PINSRD: bad operands") -} - -// PINSRQ: Insert Quadword. -// -// Forms: -// -// PINSRQ imm8 r64 xmm -// PINSRQ imm8 m64 xmm -func PINSRQ(i, mr, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsR64(mr) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PINSRQ", - Operands: []operand.Op{i, mr, x}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsM64(mr) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PINSRQ", - Operands: []operand.Op{i, mr, x}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PINSRQ: bad operands") -} - -// PINSRW: Insert Word. -// -// Forms: -// -// PINSRW imm8 r32 xmm -// PINSRW imm8 m16 xmm -func PINSRW(i, mr, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsR32(mr) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PINSRW", - Operands: []operand.Op{i, mr, x}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM16(mr) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PINSRW", - Operands: []operand.Op{i, mr, x}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PINSRW: bad operands") -} - -// PMADDUBSW: Multiply and Add Packed Signed and Unsigned Byte Integers. -// -// Forms: -// -// PMADDUBSW xmm xmm -// PMADDUBSW m128 xmm -func PMADDUBSW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMADDUBSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMADDUBSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - } - return nil, errors.New("PMADDUBSW: bad operands") -} - -// PMADDWL: Multiply and Add Packed Signed Word Integers. -// -// Forms: -// -// PMADDWL xmm xmm -// PMADDWL m128 xmm -func PMADDWL(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMADDWL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMADDWL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PMADDWL: bad operands") -} - -// PMAXSB: Maximum of Packed Signed Byte Integers. -// -// Forms: -// -// PMAXSB xmm xmm -// PMAXSB m128 xmm -func PMAXSB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMAXSB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMAXSB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMAXSB: bad operands") -} - -// PMAXSD: Maximum of Packed Signed Doubleword Integers. -// -// Forms: -// -// PMAXSD xmm xmm -// PMAXSD m128 xmm -func PMAXSD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMAXSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMAXSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMAXSD: bad operands") -} - -// PMAXSW: Maximum of Packed Signed Word Integers. -// -// Forms: -// -// PMAXSW xmm xmm -// PMAXSW m128 xmm -func PMAXSW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMAXSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMAXSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PMAXSW: bad operands") -} - -// PMAXUB: Maximum of Packed Unsigned Byte Integers. -// -// Forms: -// -// PMAXUB xmm xmm -// PMAXUB m128 xmm -func PMAXUB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMAXUB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMAXUB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PMAXUB: bad operands") -} - -// PMAXUD: Maximum of Packed Unsigned Doubleword Integers. -// -// Forms: -// -// PMAXUD xmm xmm -// PMAXUD m128 xmm -func PMAXUD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMAXUD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMAXUD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMAXUD: bad operands") -} - -// PMAXUW: Maximum of Packed Unsigned Word Integers. -// -// Forms: -// -// PMAXUW xmm xmm -// PMAXUW m128 xmm -func PMAXUW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMAXUW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMAXUW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMAXUW: bad operands") -} - -// PMINSB: Minimum of Packed Signed Byte Integers. -// -// Forms: -// -// PMINSB xmm xmm -// PMINSB m128 xmm -func PMINSB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMINSB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMINSB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMINSB: bad operands") -} - -// PMINSD: Minimum of Packed Signed Doubleword Integers. -// -// Forms: -// -// PMINSD xmm xmm -// PMINSD m128 xmm -func PMINSD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMINSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMINSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMINSD: bad operands") -} - -// PMINSW: Minimum of Packed Signed Word Integers. -// -// Forms: -// -// PMINSW xmm xmm -// PMINSW m128 xmm -func PMINSW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMINSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMINSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PMINSW: bad operands") -} - -// PMINUB: Minimum of Packed Unsigned Byte Integers. -// -// Forms: -// -// PMINUB xmm xmm -// PMINUB m128 xmm -func PMINUB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMINUB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMINUB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PMINUB: bad operands") -} - -// PMINUD: Minimum of Packed Unsigned Doubleword Integers. -// -// Forms: -// -// PMINUD xmm xmm -// PMINUD m128 xmm -func PMINUD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMINUD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMINUD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMINUD: bad operands") -} - -// PMINUW: Minimum of Packed Unsigned Word Integers. -// -// Forms: -// -// PMINUW xmm xmm -// PMINUW m128 xmm -func PMINUW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMINUW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMINUW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMINUW: bad operands") -} - -// PMOVMSKB: Move Byte Mask. -// -// Forms: -// -// PMOVMSKB xmm r32 -func PMOVMSKB(x, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(x) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "PMOVMSKB", - Operands: []operand.Op{x, r}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{r}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PMOVMSKB: bad operands") -} - -// PMOVSXBD: Move Packed Byte Integers to Doubleword Integers with Sign Extension. -// -// Forms: -// -// PMOVSXBD xmm xmm -// PMOVSXBD m32 xmm -func PMOVSXBD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVSXBD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVSXBD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMOVSXBD: bad operands") -} - -// PMOVSXBQ: Move Packed Byte Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// PMOVSXBQ xmm xmm -// PMOVSXBQ m16 xmm -func PMOVSXBQ(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVSXBQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM16(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVSXBQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMOVSXBQ: bad operands") -} - -// PMOVSXBW: Move Packed Byte Integers to Word Integers with Sign Extension. -// -// Forms: -// -// PMOVSXBW xmm xmm -// PMOVSXBW m64 xmm -func PMOVSXBW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVSXBW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVSXBW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMOVSXBW: bad operands") -} - -// PMOVSXDQ: Move Packed Doubleword Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// PMOVSXDQ xmm xmm -// PMOVSXDQ m64 xmm -func PMOVSXDQ(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVSXDQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVSXDQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMOVSXDQ: bad operands") -} - -// PMOVSXWD: Move Packed Word Integers to Doubleword Integers with Sign Extension. -// -// Forms: -// -// PMOVSXWD xmm xmm -// PMOVSXWD m64 xmm -func PMOVSXWD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVSXWD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVSXWD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMOVSXWD: bad operands") -} - -// PMOVSXWQ: Move Packed Word Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// PMOVSXWQ xmm xmm -// PMOVSXWQ m32 xmm -func PMOVSXWQ(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVSXWQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVSXWQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMOVSXWQ: bad operands") -} - -// PMOVZXBD: Move Packed Byte Integers to Doubleword Integers with Zero Extension. -// -// Forms: -// -// PMOVZXBD xmm xmm -// PMOVZXBD m32 xmm -func PMOVZXBD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVZXBD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVZXBD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMOVZXBD: bad operands") -} - -// PMOVZXBQ: Move Packed Byte Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// PMOVZXBQ xmm xmm -// PMOVZXBQ m16 xmm -func PMOVZXBQ(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVZXBQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM16(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVZXBQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMOVZXBQ: bad operands") -} - -// PMOVZXBW: Move Packed Byte Integers to Word Integers with Zero Extension. -// -// Forms: -// -// PMOVZXBW xmm xmm -// PMOVZXBW m64 xmm -func PMOVZXBW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVZXBW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVZXBW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMOVZXBW: bad operands") -} - -// PMOVZXDQ: Move Packed Doubleword Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// PMOVZXDQ xmm xmm -// PMOVZXDQ m64 xmm -func PMOVZXDQ(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVZXDQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVZXDQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMOVZXDQ: bad operands") -} - -// PMOVZXWD: Move Packed Word Integers to Doubleword Integers with Zero Extension. -// -// Forms: -// -// PMOVZXWD xmm xmm -// PMOVZXWD m64 xmm -func PMOVZXWD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVZXWD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVZXWD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMOVZXWD: bad operands") -} - -// PMOVZXWQ: Move Packed Word Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// PMOVZXWQ xmm xmm -// PMOVZXWQ m32 xmm -func PMOVZXWQ(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVZXWQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMOVZXWQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMOVZXWQ: bad operands") -} - -// PMULDQ: Multiply Packed Signed Doubleword Integers and Store Quadword Result. -// -// Forms: -// -// PMULDQ xmm xmm -// PMULDQ m128 xmm -func PMULDQ(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMULDQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMULDQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMULDQ: bad operands") -} - -// PMULHRSW: Packed Multiply Signed Word Integers and Store High Result with Round and Scale. -// -// Forms: -// -// PMULHRSW xmm xmm -// PMULHRSW m128 xmm -func PMULHRSW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMULHRSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMULHRSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - } - return nil, errors.New("PMULHRSW: bad operands") -} - -// PMULHUW: Multiply Packed Unsigned Word Integers and Store High Result. -// -// Forms: -// -// PMULHUW xmm xmm -// PMULHUW m128 xmm -func PMULHUW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMULHUW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMULHUW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PMULHUW: bad operands") -} - -// PMULHW: Multiply Packed Signed Word Integers and Store High Result. -// -// Forms: -// -// PMULHW xmm xmm -// PMULHW m128 xmm -func PMULHW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMULHW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMULHW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PMULHW: bad operands") -} - -// PMULLD: Multiply Packed Signed Doubleword Integers and Store Low Result. -// -// Forms: -// -// PMULLD xmm xmm -// PMULLD m128 xmm -func PMULLD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMULLD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMULLD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PMULLD: bad operands") -} - -// PMULLW: Multiply Packed Signed Word Integers and Store Low Result. -// -// Forms: -// -// PMULLW xmm xmm -// PMULLW m128 xmm -func PMULLW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMULLW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMULLW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PMULLW: bad operands") -} - -// PMULULQ: Multiply Packed Unsigned Doubleword Integers. -// -// Forms: -// -// PMULULQ xmm xmm -// PMULULQ m128 xmm -func PMULULQ(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMULULQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PMULULQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PMULULQ: bad operands") -} - -// POPCNTL: Count of Number of Bits Set to 1. -// -// Forms: -// -// POPCNTL r32 r32 -// POPCNTL m32 r32 -func POPCNTL(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "POPCNTL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"POPCNT"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "POPCNTL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"POPCNT"}, - }, nil - } - return nil, errors.New("POPCNTL: bad operands") -} - -// POPCNTQ: Count of Number of Bits Set to 1. -// -// Forms: -// -// POPCNTQ r64 r64 -// POPCNTQ m64 r64 -func POPCNTQ(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "POPCNTQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"POPCNT"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "POPCNTQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"POPCNT"}, - }, nil - } - return nil, errors.New("POPCNTQ: bad operands") -} - -// POPCNTW: Count of Number of Bits Set to 1. -// -// Forms: -// -// POPCNTW r16 r16 -// POPCNTW m16 r16 -func POPCNTW(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "POPCNTW", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"POPCNT"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "POPCNTW", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"POPCNT"}, - }, nil - } - return nil, errors.New("POPCNTW: bad operands") -} - -// POPQ: Pop a Value from the Stack. -// -// Forms: -// -// POPQ r64 -// POPQ m64 -func POPQ(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "POPQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "POPQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("POPQ: bad operands") -} - -// POPW: Pop a Value from the Stack. -// -// Forms: -// -// POPW r16 -// POPW m16 -func POPW(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "POPW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "POPW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("POPW: bad operands") -} - -// POR: Packed Bitwise Logical OR. -// -// Forms: -// -// POR xmm xmm -// POR m128 xmm -func POR(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "POR", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "POR", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("POR: bad operands") -} - -// PREFETCHNTA: Prefetch Data Into Caches using NTA Hint. -// -// Forms: -// -// PREFETCHNTA m8 -func PREFETCHNTA(m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM8(m): - return &intrep.Instruction{ - Opcode: "PREFETCHNTA", - Operands: []operand.Op{m}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{}, - ISA: []string{"MMX+"}, - }, nil - } - return nil, errors.New("PREFETCHNTA: bad operands") -} - -// PREFETCHT0: Prefetch Data Into Caches using T0 Hint. -// -// Forms: -// -// PREFETCHT0 m8 -func PREFETCHT0(m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM8(m): - return &intrep.Instruction{ - Opcode: "PREFETCHT0", - Operands: []operand.Op{m}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{}, - ISA: []string{"MMX+"}, - }, nil - } - return nil, errors.New("PREFETCHT0: bad operands") -} - -// PREFETCHT1: Prefetch Data Into Caches using T1 Hint. -// -// Forms: -// -// PREFETCHT1 m8 -func PREFETCHT1(m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM8(m): - return &intrep.Instruction{ - Opcode: "PREFETCHT1", - Operands: []operand.Op{m}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{}, - ISA: []string{"MMX+"}, - }, nil - } - return nil, errors.New("PREFETCHT1: bad operands") -} - -// PREFETCHT2: Prefetch Data Into Caches using T2 Hint. -// -// Forms: -// -// PREFETCHT2 m8 -func PREFETCHT2(m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM8(m): - return &intrep.Instruction{ - Opcode: "PREFETCHT2", - Operands: []operand.Op{m}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{}, - ISA: []string{"MMX+"}, - }, nil - } - return nil, errors.New("PREFETCHT2: bad operands") -} - -// PSADBW: Compute Sum of Absolute Differences. -// -// Forms: -// -// PSADBW xmm xmm -// PSADBW m128 xmm -func PSADBW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSADBW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSADBW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSADBW: bad operands") -} - -// PSHUFB: Packed Shuffle Bytes. -// -// Forms: -// -// PSHUFB xmm xmm -// PSHUFB m128 xmm -func PSHUFB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSHUFB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSHUFB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - } - return nil, errors.New("PSHUFB: bad operands") -} - -// PSHUFD: Shuffle Packed Doublewords. -// -// Forms: -// -// PSHUFD imm8 xmm xmm -// PSHUFD imm8 m128 xmm -func PSHUFD(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSHUFD", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSHUFD", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSHUFD: bad operands") -} - -// PSHUFHW: Shuffle Packed High Words. -// -// Forms: -// -// PSHUFHW imm8 xmm xmm -// PSHUFHW imm8 m128 xmm -func PSHUFHW(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSHUFHW", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSHUFHW", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSHUFHW: bad operands") -} - -// PSHUFL: Shuffle Packed Doublewords. -// -// Forms: -// -// PSHUFL imm8 xmm xmm -// PSHUFL imm8 m128 xmm -func PSHUFL(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSHUFL", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSHUFL", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSHUFL: bad operands") -} - -// PSHUFLW: Shuffle Packed Low Words. -// -// Forms: -// -// PSHUFLW imm8 xmm xmm -// PSHUFLW imm8 m128 xmm -func PSHUFLW(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSHUFLW", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSHUFLW", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSHUFLW: bad operands") -} - -// PSIGNB: Packed Sign of Byte Integers. -// -// Forms: -// -// PSIGNB xmm xmm -// PSIGNB m128 xmm -func PSIGNB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSIGNB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSIGNB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - } - return nil, errors.New("PSIGNB: bad operands") -} - -// PSIGND: Packed Sign of Doubleword Integers. -// -// Forms: -// -// PSIGND xmm xmm -// PSIGND m128 xmm -func PSIGND(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSIGND", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSIGND", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - } - return nil, errors.New("PSIGND: bad operands") -} - -// PSIGNW: Packed Sign of Word Integers. -// -// Forms: -// -// PSIGNW xmm xmm -// PSIGNW m128 xmm -func PSIGNW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSIGNW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSIGNW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSSE3"}, - }, nil - } - return nil, errors.New("PSIGNW: bad operands") -} - -// PSLLDQ: Shift Packed Double Quadword Left Logical. -// -// Forms: -// -// PSLLDQ imm8 xmm -func PSLLDQ(i, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSLLDQ", - Operands: []operand.Op{i, x}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSLLDQ: bad operands") -} - -// PSLLL: Shift Packed Doubleword Data Left Logical. -// -// Forms: -// -// PSLLL imm8 xmm -// PSLLL xmm xmm -// PSLLL m128 xmm -func PSLLL(imx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSLLL", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSLLL", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{imx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSLLL", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{imx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSLLL: bad operands") -} - -// PSLLO: Shift Packed Double Quadword Left Logical. -// -// Forms: -// -// PSLLO imm8 xmm -func PSLLO(i, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSLLO", - Operands: []operand.Op{i, x}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSLLO: bad operands") -} - -// PSLLQ: Shift Packed Quadword Data Left Logical. -// -// Forms: -// -// PSLLQ imm8 xmm -// PSLLQ xmm xmm -// PSLLQ m128 xmm -func PSLLQ(imx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSLLQ", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSLLQ", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{imx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSLLQ", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{imx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSLLQ: bad operands") -} - -// PSLLW: Shift Packed Word Data Left Logical. -// -// Forms: -// -// PSLLW imm8 xmm -// PSLLW xmm xmm -// PSLLW m128 xmm -func PSLLW(imx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSLLW", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSLLW", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{imx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSLLW", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{imx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSLLW: bad operands") -} - -// PSRAL: Shift Packed Doubleword Data Right Arithmetic. -// -// Forms: -// -// PSRAL imm8 xmm -// PSRAL xmm xmm -// PSRAL m128 xmm -func PSRAL(imx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSRAL", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSRAL", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{imx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSRAL", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{imx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSRAL: bad operands") -} - -// PSRAW: Shift Packed Word Data Right Arithmetic. -// -// Forms: -// -// PSRAW imm8 xmm -// PSRAW xmm xmm -// PSRAW m128 xmm -func PSRAW(imx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSRAW", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSRAW", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{imx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSRAW", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{imx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSRAW: bad operands") -} - -// PSRLDQ: Shift Packed Double Quadword Right Logical. -// -// Forms: -// -// PSRLDQ imm8 xmm -func PSRLDQ(i, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSRLDQ", - Operands: []operand.Op{i, x}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSRLDQ: bad operands") -} - -// PSRLL: Shift Packed Doubleword Data Right Logical. -// -// Forms: -// -// PSRLL imm8 xmm -// PSRLL xmm xmm -// PSRLL m128 xmm -func PSRLL(imx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSRLL", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSRLL", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{imx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSRLL", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{imx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSRLL: bad operands") -} - -// PSRLO: Shift Packed Double Quadword Right Logical. -// -// Forms: -// -// PSRLO imm8 xmm -func PSRLO(i, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSRLO", - Operands: []operand.Op{i, x}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSRLO: bad operands") -} - -// PSRLQ: Shift Packed Quadword Data Right Logical. -// -// Forms: -// -// PSRLQ imm8 xmm -// PSRLQ xmm xmm -// PSRLQ m128 xmm -func PSRLQ(imx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSRLQ", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSRLQ", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{imx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSRLQ", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{imx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSRLQ: bad operands") -} - -// PSRLW: Shift Packed Word Data Right Logical. -// -// Forms: -// -// PSRLW imm8 xmm -// PSRLW xmm xmm -// PSRLW m128 xmm -func PSRLW(imx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSRLW", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsXMM(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSRLW", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{imx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(imx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSRLW", - Operands: []operand.Op{imx, x}, - Inputs: []operand.Op{imx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSRLW: bad operands") -} - -// PSUBB: Subtract Packed Byte Integers. -// -// Forms: -// -// PSUBB xmm xmm -// PSUBB m128 xmm -func PSUBB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSUBB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSUBB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSUBB: bad operands") -} - -// PSUBL: Subtract Packed Doubleword Integers. -// -// Forms: -// -// PSUBL xmm xmm -// PSUBL m128 xmm -func PSUBL(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSUBL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSUBL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSUBL: bad operands") -} - -// PSUBQ: Subtract Packed Quadword Integers. -// -// Forms: -// -// PSUBQ xmm xmm -// PSUBQ m128 xmm -func PSUBQ(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSUBQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSUBQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSUBQ: bad operands") -} - -// PSUBSB: Subtract Packed Signed Byte Integers with Signed Saturation. -// -// Forms: -// -// PSUBSB xmm xmm -// PSUBSB m128 xmm -func PSUBSB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSUBSB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSUBSB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSUBSB: bad operands") -} - -// PSUBSW: Subtract Packed Signed Word Integers with Signed Saturation. -// -// Forms: -// -// PSUBSW xmm xmm -// PSUBSW m128 xmm -func PSUBSW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSUBSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSUBSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSUBSW: bad operands") -} - -// PSUBUSB: Subtract Packed Unsigned Byte Integers with Unsigned Saturation. -// -// Forms: -// -// PSUBUSB xmm xmm -// PSUBUSB m128 xmm -func PSUBUSB(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSUBUSB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSUBUSB", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSUBUSB: bad operands") -} - -// PSUBUSW: Subtract Packed Unsigned Word Integers with Unsigned Saturation. -// -// Forms: -// -// PSUBUSW xmm xmm -// PSUBUSW m128 xmm -func PSUBUSW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSUBUSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSUBUSW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSUBUSW: bad operands") -} - -// PSUBW: Subtract Packed Word Integers. -// -// Forms: -// -// PSUBW xmm xmm -// PSUBW m128 xmm -func PSUBW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSUBW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PSUBW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PSUBW: bad operands") -} - -// PTEST: Packed Logical Compare. -// -// Forms: -// -// PTEST xmm xmm -// PTEST m128 xmm -func PTEST(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PTEST", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PTEST", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("PTEST: bad operands") -} - -// PUNPCKHBW: Unpack and Interleave High-Order Bytes into Words. -// -// Forms: -// -// PUNPCKHBW xmm xmm -// PUNPCKHBW m128 xmm -func PUNPCKHBW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PUNPCKHBW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PUNPCKHBW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PUNPCKHBW: bad operands") -} - -// PUNPCKHLQ: Unpack and Interleave High-Order Doublewords into Quadwords. -// -// Forms: -// -// PUNPCKHLQ xmm xmm -// PUNPCKHLQ m128 xmm -func PUNPCKHLQ(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PUNPCKHLQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PUNPCKHLQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PUNPCKHLQ: bad operands") -} - -// PUNPCKHQDQ: Unpack and Interleave High-Order Quadwords into Double Quadwords. -// -// Forms: -// -// PUNPCKHQDQ xmm xmm -// PUNPCKHQDQ m128 xmm -func PUNPCKHQDQ(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PUNPCKHQDQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PUNPCKHQDQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PUNPCKHQDQ: bad operands") -} - -// PUNPCKHWL: Unpack and Interleave High-Order Words into Doublewords. -// -// Forms: -// -// PUNPCKHWL xmm xmm -// PUNPCKHWL m128 xmm -func PUNPCKHWL(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PUNPCKHWL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PUNPCKHWL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PUNPCKHWL: bad operands") -} - -// PUNPCKLBW: Unpack and Interleave Low-Order Bytes into Words. -// -// Forms: -// -// PUNPCKLBW xmm xmm -// PUNPCKLBW m128 xmm -func PUNPCKLBW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PUNPCKLBW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PUNPCKLBW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PUNPCKLBW: bad operands") -} - -// PUNPCKLLQ: Unpack and Interleave Low-Order Doublewords into Quadwords. -// -// Forms: -// -// PUNPCKLLQ xmm xmm -// PUNPCKLLQ m128 xmm -func PUNPCKLLQ(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PUNPCKLLQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PUNPCKLLQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PUNPCKLLQ: bad operands") -} - -// PUNPCKLQDQ: Unpack and Interleave Low-Order Quadwords into Double Quadwords. -// -// Forms: -// -// PUNPCKLQDQ xmm xmm -// PUNPCKLQDQ m128 xmm -func PUNPCKLQDQ(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PUNPCKLQDQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PUNPCKLQDQ", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PUNPCKLQDQ: bad operands") -} - -// PUNPCKLWL: Unpack and Interleave Low-Order Words into Doublewords. -// -// Forms: -// -// PUNPCKLWL xmm xmm -// PUNPCKLWL m128 xmm -func PUNPCKLWL(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PUNPCKLWL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PUNPCKLWL", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PUNPCKLWL: bad operands") -} - -// PUSHQ: Push Value Onto the Stack. -// -// Forms: -// -// PUSHQ imm8 -// PUSHQ imm32 -// PUSHQ r64 -// PUSHQ m64 -func PUSHQ(imr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imr): - return &intrep.Instruction{ - Opcode: "PUSHQ", - Operands: []operand.Op{imr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - }, nil - case operand.IsIMM32(imr): - return &intrep.Instruction{ - Opcode: "PUSHQ", - Operands: []operand.Op{imr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR64(imr): - return &intrep.Instruction{ - Opcode: "PUSHQ", - Operands: []operand.Op{imr}, - Inputs: []operand.Op{imr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsM64(imr): - return &intrep.Instruction{ - Opcode: "PUSHQ", - Operands: []operand.Op{imr}, - Inputs: []operand.Op{imr}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("PUSHQ: bad operands") -} - -// PUSHW: Push Value Onto the Stack. -// -// Forms: -// -// PUSHW r16 -// PUSHW m16 -func PUSHW(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "PUSHW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "PUSHW", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("PUSHW: bad operands") -} - -// PXOR: Packed Bitwise Logical Exclusive OR. -// -// Forms: -// -// PXOR xmm xmm -// PXOR m128 xmm -func PXOR(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PXOR", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "PXOR", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("PXOR: bad operands") -} - -// RCLB: Rotate Left through Carry Flag. -// -// Forms: -// -// RCLB 1 r8 -// RCLB imm8 r8 -// RCLB cl r8 -// RCLB 1 m8 -// RCLB imm8 m8 -// RCLB cl m8 -func RCLB(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "RCLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "RCLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "RCLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "RCLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "RCLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "RCLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("RCLB: bad operands") -} - -// RCLL: Rotate Left through Carry Flag. -// -// Forms: -// -// RCLL 1 r32 -// RCLL imm8 r32 -// RCLL cl r32 -// RCLL 1 m32 -// RCLL imm8 m32 -// RCLL cl m32 -func RCLL(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "RCLL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "RCLL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "RCLL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "RCLL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "RCLL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "RCLL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("RCLL: bad operands") -} - -// RCLQ: Rotate Left through Carry Flag. -// -// Forms: -// -// RCLQ 1 r64 -// RCLQ imm8 r64 -// RCLQ cl r64 -// RCLQ 1 m64 -// RCLQ imm8 m64 -// RCLQ cl m64 -func RCLQ(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "RCLQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "RCLQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "RCLQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "RCLQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "RCLQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "RCLQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("RCLQ: bad operands") -} - -// RCLW: Rotate Left through Carry Flag. -// -// Forms: -// -// RCLW 1 r16 -// RCLW imm8 r16 -// RCLW cl r16 -// RCLW 1 m16 -// RCLW imm8 m16 -// RCLW cl m16 -func RCLW(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "RCLW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "RCLW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "RCLW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "RCLW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "RCLW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "RCLW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("RCLW: bad operands") -} - -// RCPPS: Compute Approximate Reciprocals of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// RCPPS xmm xmm -// RCPPS m128 xmm -func RCPPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "RCPPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "RCPPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("RCPPS: bad operands") -} - -// RCPSS: Compute Approximate Reciprocal of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// RCPSS xmm xmm -// RCPSS m32 xmm -func RCPSS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "RCPSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "RCPSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("RCPSS: bad operands") -} - -// RCRB: Rotate Right through Carry Flag. -// -// Forms: -// -// RCRB 1 r8 -// RCRB imm8 r8 -// RCRB cl r8 -// RCRB 1 m8 -// RCRB imm8 m8 -// RCRB cl m8 -func RCRB(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "RCRB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "RCRB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "RCRB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "RCRB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "RCRB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "RCRB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("RCRB: bad operands") -} - -// RCRL: Rotate Right through Carry Flag. -// -// Forms: -// -// RCRL 1 r32 -// RCRL imm8 r32 -// RCRL cl r32 -// RCRL 1 m32 -// RCRL imm8 m32 -// RCRL cl m32 -func RCRL(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "RCRL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "RCRL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "RCRL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "RCRL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "RCRL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "RCRL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("RCRL: bad operands") -} - -// RCRQ: Rotate Right through Carry Flag. -// -// Forms: -// -// RCRQ 1 r64 -// RCRQ imm8 r64 -// RCRQ cl r64 -// RCRQ 1 m64 -// RCRQ imm8 m64 -// RCRQ cl m64 -func RCRQ(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "RCRQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "RCRQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "RCRQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "RCRQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "RCRQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "RCRQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("RCRQ: bad operands") -} - -// RCRW: Rotate Right through Carry Flag. -// -// Forms: -// -// RCRW 1 r16 -// RCRW imm8 r16 -// RCRW cl r16 -// RCRW 1 m16 -// RCRW imm8 m16 -// RCRW cl m16 -func RCRW(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "RCRW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "RCRW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "RCRW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "RCRW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "RCRW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "RCRW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("RCRW: bad operands") -} - -// RDRANDL: Read Random Number. -// -// Forms: -// -// RDRANDL r32 -func RDRANDL(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "RDRANDL", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{r}, - ISA: []string{"RDRAND"}, - }, nil - } - return nil, errors.New("RDRANDL: bad operands") -} - -// RDRANDQ: Read Random Number. -// -// Forms: -// -// RDRANDQ r64 -func RDRANDQ(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "RDRANDQ", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{r}, - ISA: []string{"RDRAND"}, - }, nil - } - return nil, errors.New("RDRANDQ: bad operands") -} - -// RDRANDW: Read Random Number. -// -// Forms: -// -// RDRANDW r16 -func RDRANDW(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "RDRANDW", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{r}, - ISA: []string{"RDRAND"}, - }, nil - } - return nil, errors.New("RDRANDW: bad operands") -} - -// RDSEEDL: Read Random SEED. -// -// Forms: -// -// RDSEEDL r32 -func RDSEEDL(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "RDSEEDL", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{r}, - ISA: []string{"RDSEED"}, - }, nil - } - return nil, errors.New("RDSEEDL: bad operands") -} - -// RDSEEDQ: Read Random SEED. -// -// Forms: -// -// RDSEEDQ r64 -func RDSEEDQ(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "RDSEEDQ", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{r}, - ISA: []string{"RDSEED"}, - }, nil - } - return nil, errors.New("RDSEEDQ: bad operands") -} - -// RDSEEDW: Read Random SEED. -// -// Forms: -// -// RDSEEDW r16 -func RDSEEDW(r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "RDSEEDW", - Operands: []operand.Op{r}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{r}, - ISA: []string{"RDSEED"}, - }, nil - } - return nil, errors.New("RDSEEDW: bad operands") -} - -// RDTSC: Read Time-Stamp Counter. -// -// Forms: -// -// RDTSC -func RDTSC() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "RDTSC", - Operands: nil, - Inputs: []operand.Op{}, - Outputs: []operand.Op{reg.EAX, reg.EDX}, - ISA: []string{"RDTSC"}, - }, nil -} - -// RDTSCP: Read Time-Stamp Counter and Processor ID. -// -// Forms: -// -// RDTSCP -func RDTSCP() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "RDTSCP", - Operands: nil, - Inputs: []operand.Op{}, - Outputs: []operand.Op{reg.EAX, reg.ECX, reg.EDX}, - ISA: []string{"RDTSCP"}, - }, nil -} - -// RET: Return from Procedure. -// -// Forms: -// -// RET -func RET() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "RET", - Operands: nil, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - IsTerminal: true, - }, nil -} - -// RETFL: Return from Procedure. -// -// Forms: -// -// RETFL imm16 -func RETFL(i operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM16(i): - return &intrep.Instruction{ - Opcode: "RETFL", - Operands: []operand.Op{i}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("RETFL: bad operands") -} - -// RETFQ: Return from Procedure. -// -// Forms: -// -// RETFQ imm16 -func RETFQ(i operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM16(i): - return &intrep.Instruction{ - Opcode: "RETFQ", - Operands: []operand.Op{i}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("RETFQ: bad operands") -} - -// RETFW: Return from Procedure. -// -// Forms: -// -// RETFW imm16 -func RETFW(i operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM16(i): - return &intrep.Instruction{ - Opcode: "RETFW", - Operands: []operand.Op{i}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("RETFW: bad operands") -} - -// ROLB: Rotate Left. -// -// Forms: -// -// ROLB 1 r8 -// ROLB imm8 r8 -// ROLB cl r8 -// ROLB 1 m8 -// ROLB imm8 m8 -// ROLB cl m8 -func ROLB(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "ROLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "ROLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "ROLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "ROLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "ROLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "ROLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("ROLB: bad operands") -} - -// ROLL: Rotate Left. -// -// Forms: -// -// ROLL 1 r32 -// ROLL imm8 r32 -// ROLL cl r32 -// ROLL 1 m32 -// ROLL imm8 m32 -// ROLL cl m32 -func ROLL(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "ROLL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "ROLL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "ROLL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "ROLL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "ROLL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "ROLL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("ROLL: bad operands") -} - -// ROLQ: Rotate Left. -// -// Forms: -// -// ROLQ 1 r64 -// ROLQ imm8 r64 -// ROLQ cl r64 -// ROLQ 1 m64 -// ROLQ imm8 m64 -// ROLQ cl m64 -func ROLQ(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ROLQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ROLQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "ROLQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "ROLQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "ROLQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "ROLQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("ROLQ: bad operands") -} - -// ROLW: Rotate Left. -// -// Forms: -// -// ROLW 1 r16 -// ROLW imm8 r16 -// ROLW cl r16 -// ROLW 1 m16 -// ROLW imm8 m16 -// ROLW cl m16 -func ROLW(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "ROLW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "ROLW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "ROLW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "ROLW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "ROLW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "ROLW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("ROLW: bad operands") -} - -// RORB: Rotate Right. -// -// Forms: -// -// RORB 1 r8 -// RORB imm8 r8 -// RORB cl r8 -// RORB 1 m8 -// RORB imm8 m8 -// RORB cl m8 -func RORB(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "RORB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "RORB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "RORB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "RORB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "RORB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "RORB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("RORB: bad operands") -} - -// RORL: Rotate Right. -// -// Forms: -// -// RORL 1 r32 -// RORL imm8 r32 -// RORL cl r32 -// RORL 1 m32 -// RORL imm8 m32 -// RORL cl m32 -func RORL(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "RORL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "RORL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "RORL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "RORL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "RORL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "RORL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("RORL: bad operands") -} - -// RORQ: Rotate Right. -// -// Forms: -// -// RORQ 1 r64 -// RORQ imm8 r64 -// RORQ cl r64 -// RORQ 1 m64 -// RORQ imm8 m64 -// RORQ cl m64 -func RORQ(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "RORQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "RORQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "RORQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "RORQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "RORQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "RORQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("RORQ: bad operands") -} - -// RORW: Rotate Right. -// -// Forms: -// -// RORW 1 r16 -// RORW imm8 r16 -// RORW cl r16 -// RORW 1 m16 -// RORW imm8 m16 -// RORW cl m16 -func RORW(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "RORW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "RORW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "RORW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "RORW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "RORW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "RORW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("RORW: bad operands") -} - -// RORXL: Rotate Right Logical Without Affecting Flags. -// -// Forms: -// -// RORXL imm8 r32 r32 -// RORXL imm8 m32 r32 -func RORXL(i, mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "RORXL", - Operands: []operand.Op{i, mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "RORXL", - Operands: []operand.Op{i, mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI2"}, - }, nil - } - return nil, errors.New("RORXL: bad operands") -} - -// RORXQ: Rotate Right Logical Without Affecting Flags. -// -// Forms: -// -// RORXQ imm8 r64 r64 -// RORXQ imm8 m64 r64 -func RORXQ(i, mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "RORXQ", - Operands: []operand.Op{i, mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "RORXQ", - Operands: []operand.Op{i, mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI2"}, - }, nil - } - return nil, errors.New("RORXQ: bad operands") -} - -// ROUNDPD: Round Packed Double Precision Floating-Point Values. -// -// Forms: -// -// ROUNDPD imm8 xmm xmm -// ROUNDPD imm8 m128 xmm -func ROUNDPD(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ROUNDPD", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ROUNDPD", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("ROUNDPD: bad operands") -} - -// ROUNDPS: Round Packed Single Precision Floating-Point Values. -// -// Forms: -// -// ROUNDPS imm8 xmm xmm -// ROUNDPS imm8 m128 xmm -func ROUNDPS(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ROUNDPS", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ROUNDPS", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("ROUNDPS: bad operands") -} - -// ROUNDSD: Round Scalar Double Precision Floating-Point Values. -// -// Forms: -// -// ROUNDSD imm8 xmm xmm -// ROUNDSD imm8 m64 xmm -func ROUNDSD(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ROUNDSD", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ROUNDSD", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("ROUNDSD: bad operands") -} - -// ROUNDSS: Round Scalar Single Precision Floating-Point Values. -// -// Forms: -// -// ROUNDSS imm8 xmm xmm -// ROUNDSS imm8 m32 xmm -func ROUNDSS(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ROUNDSS", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - case operand.IsIMM8(i) && operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "ROUNDSS", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE4.1"}, - }, nil - } - return nil, errors.New("ROUNDSS: bad operands") -} - -// RSQRTPS: Compute Reciprocals of Square Roots of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// RSQRTPS xmm xmm -// RSQRTPS m128 xmm -func RSQRTPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "RSQRTPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "RSQRTPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("RSQRTPS: bad operands") -} - -// RSQRTSS: Compute Reciprocal of Square Root of Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// RSQRTSS xmm xmm -// RSQRTSS m32 xmm -func RSQRTSS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "RSQRTSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "RSQRTSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("RSQRTSS: bad operands") -} - -// SALB: Arithmetic Shift Left. -// -// Forms: -// -// SALB 1 r8 -// SALB imm8 r8 -// SALB cl r8 -// SALB 1 m8 -// SALB imm8 m8 -// SALB cl m8 -func SALB(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SALB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SALB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SALB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SALB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SALB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SALB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SALB: bad operands") -} - -// SALL: Arithmetic Shift Left. -// -// Forms: -// -// SALL 1 r32 -// SALL imm8 r32 -// SALL cl r32 -// SALL 1 m32 -// SALL imm8 m32 -// SALL cl m32 -func SALL(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "SALL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "SALL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "SALL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "SALL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "SALL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "SALL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SALL: bad operands") -} - -// SALQ: Arithmetic Shift Left. -// -// Forms: -// -// SALQ 1 r64 -// SALQ imm8 r64 -// SALQ cl r64 -// SALQ 1 m64 -// SALQ imm8 m64 -// SALQ cl m64 -func SALQ(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "SALQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "SALQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "SALQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "SALQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "SALQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "SALQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SALQ: bad operands") -} - -// SALW: Arithmetic Shift Left. -// -// Forms: -// -// SALW 1 r16 -// SALW imm8 r16 -// SALW cl r16 -// SALW 1 m16 -// SALW imm8 m16 -// SALW cl m16 -func SALW(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "SALW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "SALW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "SALW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "SALW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "SALW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "SALW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SALW: bad operands") -} - -// SARB: Arithmetic Shift Right. -// -// Forms: -// -// SARB 1 r8 -// SARB imm8 r8 -// SARB cl r8 -// SARB 1 m8 -// SARB imm8 m8 -// SARB cl m8 -func SARB(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SARB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SARB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SARB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SARB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SARB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SARB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SARB: bad operands") -} - -// SARL: Arithmetic Shift Right. -// -// Forms: -// -// SARL 1 r32 -// SARL imm8 r32 -// SARL cl r32 -// SARL 1 m32 -// SARL imm8 m32 -// SARL cl m32 -func SARL(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "SARL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "SARL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "SARL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "SARL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "SARL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "SARL", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SARL: bad operands") -} - -// SARQ: Arithmetic Shift Right. -// -// Forms: -// -// SARQ 1 r64 -// SARQ imm8 r64 -// SARQ cl r64 -// SARQ 1 m64 -// SARQ imm8 m64 -// SARQ cl m64 -func SARQ(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "SARQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "SARQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "SARQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "SARQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "SARQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "SARQ", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SARQ: bad operands") -} - -// SARW: Arithmetic Shift Right. -// -// Forms: -// -// SARW 1 r16 -// SARW imm8 r16 -// SARW cl r16 -// SARW 1 m16 -// SARW imm8 m16 -// SARW cl m16 -func SARW(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "SARW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "SARW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "SARW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "SARW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "SARW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "SARW", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SARW: bad operands") -} - -// SARXL: Arithmetic Shift Right Without Affecting Flags. -// -// Forms: -// -// SARXL r32 r32 r32 -// SARXL r32 m32 r32 -func SARXL(r, mr, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(r) && operand.IsR32(mr) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "SARXL", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - case operand.IsR32(r) && operand.IsM32(mr) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "SARXL", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - } - return nil, errors.New("SARXL: bad operands") -} - -// SARXQ: Arithmetic Shift Right Without Affecting Flags. -// -// Forms: -// -// SARXQ r64 r64 r64 -// SARXQ r64 m64 r64 -func SARXQ(r, mr, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(r) && operand.IsR64(mr) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "SARXQ", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - case operand.IsR64(r) && operand.IsM64(mr) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "SARXQ", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - } - return nil, errors.New("SARXQ: bad operands") -} - -// SBBB: Subtract with Borrow. -// -// Forms: -// -// SBBB imm8 al -// SBBB imm8 r8 -// SBBB r8 r8 -// SBBB m8 r8 -// SBBB imm8 m8 -// SBBB r8 m8 -func SBBB(imr, amr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imr) && operand.IsAL(amr): - return &intrep.Instruction{ - Opcode: "SBBB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "SBBB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "SBBB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - CancellingInputs: true, - }, nil - case operand.IsM8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "SBBB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM8(amr): - return &intrep.Instruction{ - Opcode: "SBBB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR8(imr) && operand.IsM8(amr): - return &intrep.Instruction{ - Opcode: "SBBB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - } - return nil, errors.New("SBBB: bad operands") -} - -// SBBL: Subtract with Borrow. -// -// Forms: -// -// SBBL imm32 eax -// SBBL imm8 r32 -// SBBL imm32 r32 -// SBBL r32 r32 -// SBBL m32 r32 -// SBBL imm8 m32 -// SBBL imm32 m32 -// SBBL r32 m32 -func SBBL(imr, emr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imr) && operand.IsEAX(emr): - return &intrep.Instruction{ - Opcode: "SBBL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "SBBL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "SBBL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsR32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "SBBL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - CancellingInputs: true, - }, nil - case operand.IsM32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "SBBL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "SBBL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM32(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "SBBL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsR32(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "SBBL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - } - return nil, errors.New("SBBL: bad operands") -} - -// SBBQ: Subtract with Borrow. -// -// Forms: -// -// SBBQ imm32 rax -// SBBQ imm8 r64 -// SBBQ imm32 r64 -// SBBQ r64 r64 -// SBBQ m64 r64 -// SBBQ imm8 m64 -// SBBQ imm32 m64 -// SBBQ r64 m64 -func SBBQ(imr, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imr) && operand.IsRAX(mr): - return &intrep.Instruction{ - Opcode: "SBBQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "SBBQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM32(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "SBBQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "SBBQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - CancellingInputs: true, - }, nil - case operand.IsM64(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "SBBQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "SBBQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM32(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "SBBQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "SBBQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SBBQ: bad operands") -} - -// SBBW: Subtract with Borrow. -// -// Forms: -// -// SBBW imm16 ax -// SBBW imm8 r16 -// SBBW imm16 r16 -// SBBW r16 r16 -// SBBW m16 r16 -// SBBW imm8 m16 -// SBBW imm16 m16 -// SBBW r16 m16 -func SBBW(imr, amr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM16(imr) && operand.IsAX(amr): - return &intrep.Instruction{ - Opcode: "SBBW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "SBBW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "SBBW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "SBBW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - CancellingInputs: true, - }, nil - case operand.IsM16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "SBBW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "SBBW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM16(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "SBBW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR16(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "SBBW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - } - return nil, errors.New("SBBW: bad operands") -} - -// SETCC: Set byte if above or equal (CF == 0). -// -// Forms: -// -// SETCC r8 -// SETCC m8 -func SETCC(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SETCC", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SETCC", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SETCC: bad operands") -} - -// SETCS: Set byte if below (CF == 1). -// -// Forms: -// -// SETCS r8 -// SETCS m8 -func SETCS(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SETCS", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SETCS", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SETCS: bad operands") -} - -// SETEQ: Set byte if equal (ZF == 1). -// -// Forms: -// -// SETEQ r8 -// SETEQ m8 -func SETEQ(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SETEQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SETEQ", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SETEQ: bad operands") -} - -// SETGE: Set byte if greater or equal (SF == OF). -// -// Forms: -// -// SETGE r8 -// SETGE m8 -func SETGE(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SETGE", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SETGE", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SETGE: bad operands") -} - -// SETGT: Set byte if greater (ZF == 0 and SF == OF). -// -// Forms: -// -// SETGT r8 -// SETGT m8 -func SETGT(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SETGT", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SETGT", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SETGT: bad operands") -} - -// SETHI: Set byte if above (CF == 0 and ZF == 0). -// -// Forms: -// -// SETHI r8 -// SETHI m8 -func SETHI(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SETHI", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SETHI", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SETHI: bad operands") -} - -// SETLE: Set byte if less or equal (ZF == 1 or SF != OF). -// -// Forms: -// -// SETLE r8 -// SETLE m8 -func SETLE(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SETLE", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SETLE", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SETLE: bad operands") -} - -// SETLS: Set byte if below or equal (CF == 1 or ZF == 1). -// -// Forms: -// -// SETLS r8 -// SETLS m8 -func SETLS(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SETLS", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SETLS", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SETLS: bad operands") -} - -// SETLT: Set byte if less (SF != OF). -// -// Forms: -// -// SETLT r8 -// SETLT m8 -func SETLT(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SETLT", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SETLT", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SETLT: bad operands") -} - -// SETMI: Set byte if sign (SF == 1). -// -// Forms: -// -// SETMI r8 -// SETMI m8 -func SETMI(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SETMI", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SETMI", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SETMI: bad operands") -} - -// SETNE: Set byte if not equal (ZF == 0). -// -// Forms: -// -// SETNE r8 -// SETNE m8 -func SETNE(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SETNE", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SETNE", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SETNE: bad operands") -} - -// SETOC: Set byte if not overflow (OF == 0). -// -// Forms: -// -// SETOC r8 -// SETOC m8 -func SETOC(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SETOC", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SETOC", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SETOC: bad operands") -} - -// SETOS: Set byte if overflow (OF == 1). -// -// Forms: -// -// SETOS r8 -// SETOS m8 -func SETOS(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SETOS", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SETOS", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SETOS: bad operands") -} - -// SETPC: Set byte if not parity (PF == 0). -// -// Forms: -// -// SETPC r8 -// SETPC m8 -func SETPC(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SETPC", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SETPC", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SETPC: bad operands") -} - -// SETPL: Set byte if not sign (SF == 0). -// -// Forms: -// -// SETPL r8 -// SETPL m8 -func SETPL(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SETPL", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SETPL", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SETPL: bad operands") -} - -// SETPS: Set byte if parity (PF == 1). -// -// Forms: -// -// SETPS r8 -// SETPS m8 -func SETPS(mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SETPS", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SETPS", - Operands: []operand.Op{mr}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SETPS: bad operands") -} - -// SFENCE: Store Fence. -// -// Forms: -// -// SFENCE -func SFENCE() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "SFENCE", - Operands: nil, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - ISA: []string{"MMX+"}, - }, nil -} - -// SHA1MSG1: Perform an Intermediate Calculation for the Next Four SHA1 Message Doublewords. -// -// Forms: -// -// SHA1MSG1 xmm xmm -// SHA1MSG1 m128 xmm -func SHA1MSG1(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SHA1MSG1", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SHA"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SHA1MSG1", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SHA"}, - }, nil - } - return nil, errors.New("SHA1MSG1: bad operands") -} - -// SHA1MSG2: Perform a Final Calculation for the Next Four SHA1 Message Doublewords. -// -// Forms: -// -// SHA1MSG2 xmm xmm -// SHA1MSG2 m128 xmm -func SHA1MSG2(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SHA1MSG2", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SHA"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SHA1MSG2", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SHA"}, - }, nil - } - return nil, errors.New("SHA1MSG2: bad operands") -} - -// SHA1NEXTE: Calculate SHA1 State Variable E after Four Rounds. -// -// Forms: -// -// SHA1NEXTE xmm xmm -// SHA1NEXTE m128 xmm -func SHA1NEXTE(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SHA1NEXTE", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SHA"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SHA1NEXTE", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SHA"}, - }, nil - } - return nil, errors.New("SHA1NEXTE: bad operands") -} - -// SHA1RNDS4: Perform Four Rounds of SHA1 Operation. -// -// Forms: -// -// SHA1RNDS4 imm2u xmm xmm -// SHA1RNDS4 imm2u m128 xmm -func SHA1RNDS4(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM2U(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SHA1RNDS4", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SHA"}, - }, nil - case operand.IsIMM2U(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SHA1RNDS4", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SHA"}, - }, nil - } - return nil, errors.New("SHA1RNDS4: bad operands") -} - -// SHA256MSG1: Perform an Intermediate Calculation for the Next Four SHA256 Message Doublewords. -// -// Forms: -// -// SHA256MSG1 xmm xmm -// SHA256MSG1 m128 xmm -func SHA256MSG1(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SHA256MSG1", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SHA"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SHA256MSG1", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SHA"}, - }, nil - } - return nil, errors.New("SHA256MSG1: bad operands") -} - -// SHA256MSG2: Perform a Final Calculation for the Next Four SHA256 Message Doublewords. -// -// Forms: -// -// SHA256MSG2 xmm xmm -// SHA256MSG2 m128 xmm -func SHA256MSG2(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SHA256MSG2", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SHA"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SHA256MSG2", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SHA"}, - }, nil - } - return nil, errors.New("SHA256MSG2: bad operands") -} - -// SHA256RNDS2: Perform Two Rounds of SHA256 Operation. -// -// Forms: -// -// SHA256RNDS2 xmm0 xmm xmm -// SHA256RNDS2 xmm0 m128 xmm -func SHA256RNDS2(x, mx, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM0(x) && operand.IsXMM(mx) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "SHA256RNDS2", - Operands: []operand.Op{x, mx, x1}, - Inputs: []operand.Op{x, mx, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"SHA"}, - }, nil - case operand.IsXMM0(x) && operand.IsM128(mx) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "SHA256RNDS2", - Operands: []operand.Op{x, mx, x1}, - Inputs: []operand.Op{x, mx, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"SHA"}, - }, nil - } - return nil, errors.New("SHA256RNDS2: bad operands") -} - -// SHLB: Logical Shift Left. -// -// Forms: -// -// SHLB 1 r8 -// SHLB imm8 r8 -// SHLB cl r8 -// SHLB 1 m8 -// SHLB imm8 m8 -// SHLB cl m8 -func SHLB(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SHLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SHLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SHLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SHLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SHLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SHLB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SHLB: bad operands") -} - -// SHLL: Logical Shift Left. -// -// Forms: -// -// SHLL 1 r32 -// SHLL imm8 r32 -// SHLL cl r32 -// SHLL 1 m32 -// SHLL imm8 m32 -// SHLL cl m32 -// SHLL imm8 r32 r32 -// SHLL cl r32 r32 -// SHLL imm8 r32 m32 -// SHLL cl r32 m32 -func SHLL(ops ...operand.Op) (*intrep.Instruction, error) { - switch { - case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsR32(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLL", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsR32(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLL", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsR32(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLL", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsM32(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLL", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsM32(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLL", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsM32(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLL", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR32(ops[1]) && operand.IsR32(ops[2]): - return &intrep.Instruction{ - Opcode: "SHLL", - Operands: ops, - Inputs: []operand.Op{ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR32(ops[1]) && operand.IsR32(ops[2]): - return &intrep.Instruction{ - Opcode: "SHLL", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR32(ops[1]) && operand.IsM32(ops[2]): - return &intrep.Instruction{ - Opcode: "SHLL", - Operands: ops, - Inputs: []operand.Op{ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR32(ops[1]) && operand.IsM32(ops[2]): - return &intrep.Instruction{ - Opcode: "SHLL", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - } - return nil, errors.New("SHLL: bad operands") -} - -// SHLQ: Logical Shift Left. -// -// Forms: -// -// SHLQ 1 r64 -// SHLQ imm8 r64 -// SHLQ cl r64 -// SHLQ 1 m64 -// SHLQ imm8 m64 -// SHLQ cl m64 -// SHLQ imm8 r64 r64 -// SHLQ cl r64 r64 -// SHLQ imm8 r64 m64 -// SHLQ cl r64 m64 -func SHLQ(ops ...operand.Op) (*intrep.Instruction, error) { - switch { - case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsR64(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLQ", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsR64(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLQ", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsR64(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLQ", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsM64(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLQ", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsM64(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLQ", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsM64(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLQ", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR64(ops[1]) && operand.IsR64(ops[2]): - return &intrep.Instruction{ - Opcode: "SHLQ", - Operands: ops, - Inputs: []operand.Op{ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR64(ops[1]) && operand.IsR64(ops[2]): - return &intrep.Instruction{ - Opcode: "SHLQ", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR64(ops[1]) && operand.IsM64(ops[2]): - return &intrep.Instruction{ - Opcode: "SHLQ", - Operands: ops, - Inputs: []operand.Op{ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR64(ops[1]) && operand.IsM64(ops[2]): - return &intrep.Instruction{ - Opcode: "SHLQ", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - } - return nil, errors.New("SHLQ: bad operands") -} - -// SHLW: Logical Shift Left. -// -// Forms: -// -// SHLW 1 r16 -// SHLW imm8 r16 -// SHLW cl r16 -// SHLW 1 m16 -// SHLW imm8 m16 -// SHLW cl m16 -// SHLW imm8 r16 r16 -// SHLW cl r16 r16 -// SHLW imm8 r16 m16 -// SHLW cl r16 m16 -func SHLW(ops ...operand.Op) (*intrep.Instruction, error) { - switch { - case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsR16(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLW", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsR16(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLW", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsR16(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLW", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsM16(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLW", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsM16(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLW", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsM16(ops[1]): - return &intrep.Instruction{ - Opcode: "SHLW", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR16(ops[1]) && operand.IsR16(ops[2]): - return &intrep.Instruction{ - Opcode: "SHLW", - Operands: ops, - Inputs: []operand.Op{ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR16(ops[1]) && operand.IsR16(ops[2]): - return &intrep.Instruction{ - Opcode: "SHLW", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR16(ops[1]) && operand.IsM16(ops[2]): - return &intrep.Instruction{ - Opcode: "SHLW", - Operands: ops, - Inputs: []operand.Op{ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR16(ops[1]) && operand.IsM16(ops[2]): - return &intrep.Instruction{ - Opcode: "SHLW", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - } - return nil, errors.New("SHLW: bad operands") -} - -// SHLXL: Logical Shift Left Without Affecting Flags. -// -// Forms: -// -// SHLXL r32 r32 r32 -// SHLXL r32 m32 r32 -func SHLXL(r, mr, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(r) && operand.IsR32(mr) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "SHLXL", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - case operand.IsR32(r) && operand.IsM32(mr) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "SHLXL", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - } - return nil, errors.New("SHLXL: bad operands") -} - -// SHLXQ: Logical Shift Left Without Affecting Flags. -// -// Forms: -// -// SHLXQ r64 r64 r64 -// SHLXQ r64 m64 r64 -func SHLXQ(r, mr, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(r) && operand.IsR64(mr) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "SHLXQ", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - case operand.IsR64(r) && operand.IsM64(mr) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "SHLXQ", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - } - return nil, errors.New("SHLXQ: bad operands") -} - -// SHRB: Logical Shift Right. -// -// Forms: -// -// SHRB 1 r8 -// SHRB imm8 r8 -// SHRB cl r8 -// SHRB 1 m8 -// SHRB imm8 m8 -// SHRB cl m8 -func SHRB(ci, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.Is1(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SHRB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SHRB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "SHRB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.Is1(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SHRB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SHRB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsCL(ci) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "SHRB", - Operands: []operand.Op{ci, mr}, - Inputs: []operand.Op{ci, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SHRB: bad operands") -} - -// SHRL: Logical Shift Right. -// -// Forms: -// -// SHRL 1 r32 -// SHRL imm8 r32 -// SHRL cl r32 -// SHRL 1 m32 -// SHRL imm8 m32 -// SHRL cl m32 -// SHRL imm8 r32 r32 -// SHRL cl r32 r32 -// SHRL imm8 r32 m32 -// SHRL cl r32 m32 -func SHRL(ops ...operand.Op) (*intrep.Instruction, error) { - switch { - case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsR32(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRL", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsR32(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRL", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsR32(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRL", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsM32(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRL", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsM32(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRL", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsM32(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRL", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR32(ops[1]) && operand.IsR32(ops[2]): - return &intrep.Instruction{ - Opcode: "SHRL", - Operands: ops, - Inputs: []operand.Op{ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR32(ops[1]) && operand.IsR32(ops[2]): - return &intrep.Instruction{ - Opcode: "SHRL", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR32(ops[1]) && operand.IsM32(ops[2]): - return &intrep.Instruction{ - Opcode: "SHRL", - Operands: ops, - Inputs: []operand.Op{ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR32(ops[1]) && operand.IsM32(ops[2]): - return &intrep.Instruction{ - Opcode: "SHRL", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - } - return nil, errors.New("SHRL: bad operands") -} - -// SHRQ: Logical Shift Right. -// -// Forms: -// -// SHRQ 1 r64 -// SHRQ imm8 r64 -// SHRQ cl r64 -// SHRQ 1 m64 -// SHRQ imm8 m64 -// SHRQ cl m64 -// SHRQ imm8 r64 r64 -// SHRQ cl r64 r64 -// SHRQ imm8 r64 m64 -// SHRQ cl r64 m64 -func SHRQ(ops ...operand.Op) (*intrep.Instruction, error) { - switch { - case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsR64(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRQ", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsR64(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRQ", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsR64(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRQ", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsM64(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRQ", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsM64(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRQ", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsM64(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRQ", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR64(ops[1]) && operand.IsR64(ops[2]): - return &intrep.Instruction{ - Opcode: "SHRQ", - Operands: ops, - Inputs: []operand.Op{ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR64(ops[1]) && operand.IsR64(ops[2]): - return &intrep.Instruction{ - Opcode: "SHRQ", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR64(ops[1]) && operand.IsM64(ops[2]): - return &intrep.Instruction{ - Opcode: "SHRQ", - Operands: ops, - Inputs: []operand.Op{ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR64(ops[1]) && operand.IsM64(ops[2]): - return &intrep.Instruction{ - Opcode: "SHRQ", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - } - return nil, errors.New("SHRQ: bad operands") -} - -// SHRW: Logical Shift Right. -// -// Forms: -// -// SHRW 1 r16 -// SHRW imm8 r16 -// SHRW cl r16 -// SHRW 1 m16 -// SHRW imm8 m16 -// SHRW cl m16 -// SHRW imm8 r16 r16 -// SHRW cl r16 r16 -// SHRW imm8 r16 m16 -// SHRW cl r16 m16 -func SHRW(ops ...operand.Op) (*intrep.Instruction, error) { - switch { - case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsR16(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRW", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsR16(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRW", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsR16(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRW", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsM16(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRW", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsM16(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRW", - Operands: ops, - Inputs: []operand.Op{ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsM16(ops[1]): - return &intrep.Instruction{ - Opcode: "SHRW", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[1]}, - }, nil - case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR16(ops[1]) && operand.IsR16(ops[2]): - return &intrep.Instruction{ - Opcode: "SHRW", - Operands: ops, - Inputs: []operand.Op{ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR16(ops[1]) && operand.IsR16(ops[2]): - return &intrep.Instruction{ - Opcode: "SHRW", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR16(ops[1]) && operand.IsM16(ops[2]): - return &intrep.Instruction{ - Opcode: "SHRW", - Operands: ops, - Inputs: []operand.Op{ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR16(ops[1]) && operand.IsM16(ops[2]): - return &intrep.Instruction{ - Opcode: "SHRW", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1], ops[2]}, - Outputs: []operand.Op{ops[2]}, - }, nil - } - return nil, errors.New("SHRW: bad operands") -} - -// SHRXL: Logical Shift Right Without Affecting Flags. -// -// Forms: -// -// SHRXL r32 r32 r32 -// SHRXL r32 m32 r32 -func SHRXL(r, mr, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(r) && operand.IsR32(mr) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "SHRXL", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - case operand.IsR32(r) && operand.IsM32(mr) && operand.IsR32(r1): - return &intrep.Instruction{ - Opcode: "SHRXL", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - } - return nil, errors.New("SHRXL: bad operands") -} - -// SHRXQ: Logical Shift Right Without Affecting Flags. -// -// Forms: -// -// SHRXQ r64 r64 r64 -// SHRXQ r64 m64 r64 -func SHRXQ(r, mr, r1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(r) && operand.IsR64(mr) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "SHRXQ", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - case operand.IsR64(r) && operand.IsM64(mr) && operand.IsR64(r1): - return &intrep.Instruction{ - Opcode: "SHRXQ", - Operands: []operand.Op{r, mr, r1}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r1}, - ISA: []string{"BMI2"}, - }, nil - } - return nil, errors.New("SHRXQ: bad operands") -} - -// SHUFPD: Shuffle Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// SHUFPD imm8 xmm xmm -// SHUFPD imm8 m128 xmm -func SHUFPD(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SHUFPD", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SHUFPD", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("SHUFPD: bad operands") -} - -// SHUFPS: Shuffle Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// SHUFPS imm8 xmm xmm -// SHUFPS imm8 m128 xmm -func SHUFPS(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SHUFPS", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SHUFPS", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("SHUFPS: bad operands") -} - -// SQRTPD: Compute Square Roots of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// SQRTPD xmm xmm -// SQRTPD m128 xmm -func SQRTPD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SQRTPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SQRTPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("SQRTPD: bad operands") -} - -// SQRTPS: Compute Square Roots of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// SQRTPS xmm xmm -// SQRTPS m128 xmm -func SQRTPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SQRTPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SQRTPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("SQRTPS: bad operands") -} - -// SQRTSD: Compute Square Root of Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// SQRTSD xmm xmm -// SQRTSD m64 xmm -func SQRTSD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SQRTSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SQRTSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("SQRTSD: bad operands") -} - -// SQRTSS: Compute Square Root of Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// SQRTSS xmm xmm -// SQRTSS m32 xmm -func SQRTSS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SQRTSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SQRTSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("SQRTSS: bad operands") -} - -// STC: Set Carry Flag. -// -// Forms: -// -// STC -func STC() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "STC", - Operands: nil, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - }, nil -} - -// STD: Set Direction Flag. -// -// Forms: -// -// STD -func STD() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "STD", - Operands: nil, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - }, nil -} - -// STMXCSR: Store MXCSR Register State. -// -// Forms: -// -// STMXCSR m32 -func STMXCSR(m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM32(m): - return &intrep.Instruction{ - Opcode: "STMXCSR", - Operands: []operand.Op{m}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{m}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("STMXCSR: bad operands") -} - -// SUBB: Subtract. -// -// Forms: -// -// SUBB imm8 al -// SUBB imm8 r8 -// SUBB r8 r8 -// SUBB m8 r8 -// SUBB imm8 m8 -// SUBB r8 m8 -func SUBB(imr, amr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imr) && operand.IsAL(amr): - return &intrep.Instruction{ - Opcode: "SUBB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "SUBB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "SUBB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - CancellingInputs: true, - }, nil - case operand.IsM8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "SUBB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM8(amr): - return &intrep.Instruction{ - Opcode: "SUBB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR8(imr) && operand.IsM8(amr): - return &intrep.Instruction{ - Opcode: "SUBB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - } - return nil, errors.New("SUBB: bad operands") -} - -// SUBL: Subtract. -// -// Forms: -// -// SUBL imm32 eax -// SUBL imm8 r32 -// SUBL imm32 r32 -// SUBL r32 r32 -// SUBL m32 r32 -// SUBL imm8 m32 -// SUBL imm32 m32 -// SUBL r32 m32 -func SUBL(imr, emr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imr) && operand.IsEAX(emr): - return &intrep.Instruction{ - Opcode: "SUBL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "SUBL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "SUBL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsR32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "SUBL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - CancellingInputs: true, - }, nil - case operand.IsM32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "SUBL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "SUBL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM32(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "SUBL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsR32(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "SUBL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - } - return nil, errors.New("SUBL: bad operands") -} - -// SUBPD: Subtract Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// SUBPD xmm xmm -// SUBPD m128 xmm -func SUBPD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SUBPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SUBPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("SUBPD: bad operands") -} - -// SUBPS: Subtract Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// SUBPS xmm xmm -// SUBPS m128 xmm -func SUBPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SUBPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SUBPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("SUBPS: bad operands") -} - -// SUBQ: Subtract. -// -// Forms: -// -// SUBQ imm32 rax -// SUBQ imm8 r64 -// SUBQ imm32 r64 -// SUBQ r64 r64 -// SUBQ m64 r64 -// SUBQ imm8 m64 -// SUBQ imm32 m64 -// SUBQ r64 m64 -func SUBQ(imr, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imr) && operand.IsRAX(mr): - return &intrep.Instruction{ - Opcode: "SUBQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "SUBQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM32(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "SUBQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "SUBQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - CancellingInputs: true, - }, nil - case operand.IsM64(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "SUBQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "SUBQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM32(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "SUBQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "SUBQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("SUBQ: bad operands") -} - -// SUBSD: Subtract Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// SUBSD xmm xmm -// SUBSD m64 xmm -func SUBSD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SUBSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SUBSD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("SUBSD: bad operands") -} - -// SUBSS: Subtract Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// SUBSS xmm xmm -// SUBSS m32 xmm -func SUBSS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SUBSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "SUBSS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("SUBSS: bad operands") -} - -// SUBW: Subtract. -// -// Forms: -// -// SUBW imm16 ax -// SUBW imm8 r16 -// SUBW imm16 r16 -// SUBW r16 r16 -// SUBW m16 r16 -// SUBW imm8 m16 -// SUBW imm16 m16 -// SUBW r16 m16 -func SUBW(imr, amr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM16(imr) && operand.IsAX(amr): - return &intrep.Instruction{ - Opcode: "SUBW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "SUBW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "SUBW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "SUBW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - CancellingInputs: true, - }, nil - case operand.IsM16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "SUBW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "SUBW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM16(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "SUBW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR16(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "SUBW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - } - return nil, errors.New("SUBW: bad operands") -} - -// SYSCALL: Fast System Call. -// -// Forms: -// -// SYSCALL -func SYSCALL() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "SYSCALL", - Operands: nil, - Inputs: []operand.Op{}, - Outputs: []operand.Op{reg.R11, reg.RCX}, - }, nil -} - -// TESTB: Logical Compare. -// -// Forms: -// -// TESTB imm8 al -// TESTB imm8 r8 -// TESTB r8 r8 -// TESTB imm8 m8 -// TESTB r8 m8 -func TESTB(ir, amr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(ir) && operand.IsAL(amr): - return &intrep.Instruction{ - Opcode: "TESTB", - Operands: []operand.Op{ir, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsIMM8(ir) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "TESTB", - Operands: []operand.Op{ir, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR8(ir) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "TESTB", - Operands: []operand.Op{ir, amr}, - Inputs: []operand.Op{ir, amr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsIMM8(ir) && operand.IsM8(amr): - return &intrep.Instruction{ - Opcode: "TESTB", - Operands: []operand.Op{ir, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR8(ir) && operand.IsM8(amr): - return &intrep.Instruction{ - Opcode: "TESTB", - Operands: []operand.Op{ir, amr}, - Inputs: []operand.Op{ir, amr}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("TESTB: bad operands") -} - -// TESTL: Logical Compare. -// -// Forms: -// -// TESTL imm32 eax -// TESTL imm32 r32 -// TESTL r32 r32 -// TESTL imm32 m32 -// TESTL r32 m32 -func TESTL(ir, emr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(ir) && operand.IsEAX(emr): - return &intrep.Instruction{ - Opcode: "TESTL", - Operands: []operand.Op{ir, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsIMM32(ir) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "TESTL", - Operands: []operand.Op{ir, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR32(ir) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "TESTL", - Operands: []operand.Op{ir, emr}, - Inputs: []operand.Op{ir, emr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsIMM32(ir) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "TESTL", - Operands: []operand.Op{ir, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR32(ir) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "TESTL", - Operands: []operand.Op{ir, emr}, - Inputs: []operand.Op{ir, emr}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("TESTL: bad operands") -} - -// TESTQ: Logical Compare. -// -// Forms: -// -// TESTQ imm32 rax -// TESTQ imm32 r64 -// TESTQ r64 r64 -// TESTQ imm32 m64 -// TESTQ r64 m64 -func TESTQ(ir, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(ir) && operand.IsRAX(mr): - return &intrep.Instruction{ - Opcode: "TESTQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsIMM32(ir) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "TESTQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR64(ir) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "TESTQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsIMM32(ir) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "TESTQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR64(ir) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "TESTQ", - Operands: []operand.Op{ir, mr}, - Inputs: []operand.Op{ir, mr}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("TESTQ: bad operands") -} - -// TESTW: Logical Compare. -// -// Forms: -// -// TESTW imm16 ax -// TESTW imm16 r16 -// TESTW r16 r16 -// TESTW imm16 m16 -// TESTW r16 m16 -func TESTW(ir, amr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM16(ir) && operand.IsAX(amr): - return &intrep.Instruction{ - Opcode: "TESTW", - Operands: []operand.Op{ir, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsIMM16(ir) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "TESTW", - Operands: []operand.Op{ir, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR16(ir) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "TESTW", - Operands: []operand.Op{ir, amr}, - Inputs: []operand.Op{ir, amr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsIMM16(ir) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "TESTW", - Operands: []operand.Op{ir, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{}, - }, nil - case operand.IsR16(ir) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "TESTW", - Operands: []operand.Op{ir, amr}, - Inputs: []operand.Op{ir, amr}, - Outputs: []operand.Op{}, - }, nil - } - return nil, errors.New("TESTW: bad operands") -} - -// TZCNTL: Count the Number of Trailing Zero Bits. -// -// Forms: -// -// TZCNTL r32 r32 -// TZCNTL m32 r32 -func TZCNTL(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "TZCNTL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - case operand.IsM32(mr) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "TZCNTL", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - } - return nil, errors.New("TZCNTL: bad operands") -} - -// TZCNTQ: Count the Number of Trailing Zero Bits. -// -// Forms: -// -// TZCNTQ r64 r64 -// TZCNTQ m64 r64 -func TZCNTQ(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "TZCNTQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - case operand.IsM64(mr) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "TZCNTQ", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - } - return nil, errors.New("TZCNTQ: bad operands") -} - -// TZCNTW: Count the Number of Trailing Zero Bits. -// -// Forms: -// -// TZCNTW r16 r16 -// TZCNTW m16 r16 -func TZCNTW(mr, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "TZCNTW", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - case operand.IsM16(mr) && operand.IsR16(r): - return &intrep.Instruction{ - Opcode: "TZCNTW", - Operands: []operand.Op{mr, r}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{r}, - ISA: []string{"BMI"}, - }, nil - } - return nil, errors.New("TZCNTW: bad operands") -} - -// UCOMISD: Unordered Compare Scalar Double-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// UCOMISD xmm xmm -// UCOMISD m64 xmm -func UCOMISD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "UCOMISD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "UCOMISD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("UCOMISD: bad operands") -} - -// UCOMISS: Unordered Compare Scalar Single-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// UCOMISS xmm xmm -// UCOMISS m32 xmm -func UCOMISS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "UCOMISS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "UCOMISS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("UCOMISS: bad operands") -} - -// UD2: Undefined Instruction. -// -// Forms: -// -// UD2 -func UD2() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "UD2", - Operands: nil, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - }, nil -} - -// UNPCKHPD: Unpack and Interleave High Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// UNPCKHPD xmm xmm -// UNPCKHPD m128 xmm -func UNPCKHPD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "UNPCKHPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "UNPCKHPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("UNPCKHPD: bad operands") -} - -// UNPCKHPS: Unpack and Interleave High Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// UNPCKHPS xmm xmm -// UNPCKHPS m128 xmm -func UNPCKHPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "UNPCKHPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "UNPCKHPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("UNPCKHPS: bad operands") -} - -// UNPCKLPD: Unpack and Interleave Low Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// UNPCKLPD xmm xmm -// UNPCKLPD m128 xmm -func UNPCKLPD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "UNPCKLPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "UNPCKLPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("UNPCKLPD: bad operands") -} - -// UNPCKLPS: Unpack and Interleave Low Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// UNPCKLPS xmm xmm -// UNPCKLPS m128 xmm -func UNPCKLPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "UNPCKLPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "UNPCKLPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("UNPCKLPS: bad operands") -} - -// VADDPD: Add Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VADDPD xmm xmm xmm -// VADDPD m128 xmm xmm -// VADDPD ymm ymm ymm -// VADDPD m256 ymm ymm -func VADDPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VADDPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VADDPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VADDPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VADDPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VADDPD: bad operands") -} - -// VADDPS: Add Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VADDPS xmm xmm xmm -// VADDPS m128 xmm xmm -// VADDPS ymm ymm ymm -// VADDPS m256 ymm ymm -func VADDPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VADDPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VADDPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VADDPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VADDPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VADDPS: bad operands") -} - -// VADDSD: Add Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VADDSD xmm xmm xmm -// VADDSD m64 xmm xmm -func VADDSD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VADDSD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VADDSD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VADDSD: bad operands") -} - -// VADDSS: Add Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VADDSS xmm xmm xmm -// VADDSS m32 xmm xmm -func VADDSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VADDSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VADDSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VADDSS: bad operands") -} - -// VADDSUBPD: Packed Double-FP Add/Subtract. -// -// Forms: -// -// VADDSUBPD xmm xmm xmm -// VADDSUBPD m128 xmm xmm -// VADDSUBPD ymm ymm ymm -// VADDSUBPD m256 ymm ymm -func VADDSUBPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VADDSUBPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VADDSUBPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VADDSUBPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VADDSUBPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VADDSUBPD: bad operands") -} - -// VADDSUBPS: Packed Single-FP Add/Subtract. -// -// Forms: -// -// VADDSUBPS xmm xmm xmm -// VADDSUBPS m128 xmm xmm -// VADDSUBPS ymm ymm ymm -// VADDSUBPS m256 ymm ymm -func VADDSUBPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VADDSUBPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VADDSUBPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VADDSUBPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VADDSUBPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VADDSUBPS: bad operands") -} - -// VAESDEC: Perform One Round of an AES Decryption Flow. -// -// Forms: -// -// VAESDEC xmm xmm xmm -// VAESDEC m128 xmm xmm -func VAESDEC(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VAESDEC", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX", "AES"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VAESDEC", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX", "AES"}, - }, nil - } - return nil, errors.New("VAESDEC: bad operands") -} - -// VAESDECLAST: Perform Last Round of an AES Decryption Flow. -// -// Forms: -// -// VAESDECLAST xmm xmm xmm -// VAESDECLAST m128 xmm xmm -func VAESDECLAST(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VAESDECLAST", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX", "AES"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VAESDECLAST", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX", "AES"}, - }, nil - } - return nil, errors.New("VAESDECLAST: bad operands") -} - -// VAESENC: Perform One Round of an AES Encryption Flow. -// -// Forms: -// -// VAESENC xmm xmm xmm -// VAESENC m128 xmm xmm -func VAESENC(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VAESENC", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX", "AES"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VAESENC", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX", "AES"}, - }, nil - } - return nil, errors.New("VAESENC: bad operands") -} - -// VAESENCLAST: Perform Last Round of an AES Encryption Flow. -// -// Forms: -// -// VAESENCLAST xmm xmm xmm -// VAESENCLAST m128 xmm xmm -func VAESENCLAST(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VAESENCLAST", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX", "AES"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VAESENCLAST", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX", "AES"}, - }, nil - } - return nil, errors.New("VAESENCLAST: bad operands") -} - -// VAESIMC: Perform the AES InvMixColumn Transformation. -// -// Forms: -// -// VAESIMC xmm xmm -// VAESIMC m128 xmm -func VAESIMC(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VAESIMC", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX", "AES"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VAESIMC", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX", "AES"}, - }, nil - } - return nil, errors.New("VAESIMC: bad operands") -} - -// VAESKEYGENASSIST: AES Round Key Generation Assist. -// -// Forms: -// -// VAESKEYGENASSIST imm8 xmm xmm -// VAESKEYGENASSIST imm8 m128 xmm -func VAESKEYGENASSIST(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VAESKEYGENASSIST", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX", "AES"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VAESKEYGENASSIST", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX", "AES"}, - }, nil - } - return nil, errors.New("VAESKEYGENASSIST: bad operands") -} - -// VANDNPD: Bitwise Logical AND NOT of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VANDNPD xmm xmm xmm -// VANDNPD m128 xmm xmm -// VANDNPD ymm ymm ymm -// VANDNPD m256 ymm ymm -func VANDNPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VANDNPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VANDNPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VANDNPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VANDNPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VANDNPD: bad operands") -} - -// VANDNPS: Bitwise Logical AND NOT of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VANDNPS xmm xmm xmm -// VANDNPS m128 xmm xmm -// VANDNPS ymm ymm ymm -// VANDNPS m256 ymm ymm -func VANDNPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VANDNPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VANDNPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VANDNPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VANDNPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VANDNPS: bad operands") -} - -// VANDPD: Bitwise Logical AND of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VANDPD xmm xmm xmm -// VANDPD m128 xmm xmm -// VANDPD ymm ymm ymm -// VANDPD m256 ymm ymm -func VANDPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VANDPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VANDPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VANDPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VANDPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VANDPD: bad operands") -} - -// VANDPS: Bitwise Logical AND of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VANDPS xmm xmm xmm -// VANDPS m128 xmm xmm -// VANDPS ymm ymm ymm -// VANDPS m256 ymm ymm -func VANDPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VANDPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VANDPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VANDPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VANDPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VANDPS: bad operands") -} - -// VBLENDPD: Blend Packed Double Precision Floating-Point Values. -// -// Forms: -// -// VBLENDPD imm8 xmm xmm xmm -// VBLENDPD imm8 m128 xmm xmm -// VBLENDPD imm8 ymm ymm ymm -// VBLENDPD imm8 m256 ymm ymm -func VBLENDPD(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VBLENDPD", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VBLENDPD", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VBLENDPD", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VBLENDPD", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VBLENDPD: bad operands") -} - -// VBLENDPS: Blend Packed Single Precision Floating-Point Values. -// -// Forms: -// -// VBLENDPS imm8 xmm xmm xmm -// VBLENDPS imm8 m128 xmm xmm -// VBLENDPS imm8 ymm ymm ymm -// VBLENDPS imm8 m256 ymm ymm -func VBLENDPS(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VBLENDPS", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VBLENDPS", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VBLENDPS", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VBLENDPS", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VBLENDPS: bad operands") -} - -// VBLENDVPD: Variable Blend Packed Double Precision Floating-Point Values. -// -// Forms: -// -// VBLENDVPD xmm xmm xmm xmm -// VBLENDVPD xmm m128 xmm xmm -// VBLENDVPD ymm ymm ymm ymm -// VBLENDVPD ymm m256 ymm ymm -func VBLENDVPD(xy, mxy, xy1, xy2 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(xy) && operand.IsXMM(mxy) && operand.IsXMM(xy1) && operand.IsXMM(xy2): - return &intrep.Instruction{ - Opcode: "VBLENDVPD", - Operands: []operand.Op{xy, mxy, xy1, xy2}, - Inputs: []operand.Op{xy, mxy, xy1}, - Outputs: []operand.Op{xy2}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(xy) && operand.IsM128(mxy) && operand.IsXMM(xy1) && operand.IsXMM(xy2): - return &intrep.Instruction{ - Opcode: "VBLENDVPD", - Operands: []operand.Op{xy, mxy, xy1, xy2}, - Inputs: []operand.Op{xy, mxy, xy1}, - Outputs: []operand.Op{xy2}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(xy) && operand.IsYMM(mxy) && operand.IsYMM(xy1) && operand.IsYMM(xy2): - return &intrep.Instruction{ - Opcode: "VBLENDVPD", - Operands: []operand.Op{xy, mxy, xy1, xy2}, - Inputs: []operand.Op{xy, mxy, xy1}, - Outputs: []operand.Op{xy2}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(xy) && operand.IsM256(mxy) && operand.IsYMM(xy1) && operand.IsYMM(xy2): - return &intrep.Instruction{ - Opcode: "VBLENDVPD", - Operands: []operand.Op{xy, mxy, xy1, xy2}, - Inputs: []operand.Op{xy, mxy, xy1}, - Outputs: []operand.Op{xy2}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VBLENDVPD: bad operands") -} - -// VBLENDVPS: Variable Blend Packed Single Precision Floating-Point Values. -// -// Forms: -// -// VBLENDVPS xmm xmm xmm xmm -// VBLENDVPS xmm m128 xmm xmm -// VBLENDVPS ymm ymm ymm ymm -// VBLENDVPS ymm m256 ymm ymm -func VBLENDVPS(xy, mxy, xy1, xy2 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(xy) && operand.IsXMM(mxy) && operand.IsXMM(xy1) && operand.IsXMM(xy2): - return &intrep.Instruction{ - Opcode: "VBLENDVPS", - Operands: []operand.Op{xy, mxy, xy1, xy2}, - Inputs: []operand.Op{xy, mxy, xy1}, - Outputs: []operand.Op{xy2}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(xy) && operand.IsM128(mxy) && operand.IsXMM(xy1) && operand.IsXMM(xy2): - return &intrep.Instruction{ - Opcode: "VBLENDVPS", - Operands: []operand.Op{xy, mxy, xy1, xy2}, - Inputs: []operand.Op{xy, mxy, xy1}, - Outputs: []operand.Op{xy2}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(xy) && operand.IsYMM(mxy) && operand.IsYMM(xy1) && operand.IsYMM(xy2): - return &intrep.Instruction{ - Opcode: "VBLENDVPS", - Operands: []operand.Op{xy, mxy, xy1, xy2}, - Inputs: []operand.Op{xy, mxy, xy1}, - Outputs: []operand.Op{xy2}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(xy) && operand.IsM256(mxy) && operand.IsYMM(xy1) && operand.IsYMM(xy2): - return &intrep.Instruction{ - Opcode: "VBLENDVPS", - Operands: []operand.Op{xy, mxy, xy1, xy2}, - Inputs: []operand.Op{xy, mxy, xy1}, - Outputs: []operand.Op{xy2}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VBLENDVPS: bad operands") -} - -// VBROADCASTF128: Broadcast 128 Bit of Floating-Point Data. -// -// Forms: -// -// VBROADCASTF128 m128 ymm -func VBROADCASTF128(m, y operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM128(m) && operand.IsYMM(y): - return &intrep.Instruction{ - Opcode: "VBROADCASTF128", - Operands: []operand.Op{m, y}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{y}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VBROADCASTF128: bad operands") -} - -// VBROADCASTI128: Broadcast 128 Bits of Integer Data. -// -// Forms: -// -// VBROADCASTI128 m128 ymm -func VBROADCASTI128(m, y operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM128(m) && operand.IsYMM(y): - return &intrep.Instruction{ - Opcode: "VBROADCASTI128", - Operands: []operand.Op{m, y}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{y}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VBROADCASTI128: bad operands") -} - -// VBROADCASTSD: Broadcast Double-Precision Floating-Point Element. -// -// Forms: -// -// VBROADCASTSD xmm ymm -// VBROADCASTSD m64 ymm -func VBROADCASTSD(mx, y operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsYMM(y): - return &intrep.Instruction{ - Opcode: "VBROADCASTSD", - Operands: []operand.Op{mx, y}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{y}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM64(mx) && operand.IsYMM(y): - return &intrep.Instruction{ - Opcode: "VBROADCASTSD", - Operands: []operand.Op{mx, y}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{y}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VBROADCASTSD: bad operands") -} - -// VBROADCASTSS: Broadcast Single-Precision Floating-Point Element. -// -// Forms: -// -// VBROADCASTSS xmm xmm -// VBROADCASTSS m32 xmm -// VBROADCASTSS xmm ymm -// VBROADCASTSS m32 ymm -func VBROADCASTSS(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VBROADCASTSS", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VBROADCASTSS", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VBROADCASTSS", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM32(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VBROADCASTSS", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VBROADCASTSS: bad operands") -} - -// VCMPPD: Compare Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VCMPPD imm8 xmm xmm xmm -// VCMPPD imm8 m128 xmm xmm -// VCMPPD imm8 ymm ymm ymm -// VCMPPD imm8 m256 ymm ymm -func VCMPPD(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VCMPPD", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VCMPPD", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VCMPPD", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VCMPPD", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCMPPD: bad operands") -} - -// VCMPPS: Compare Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VCMPPS imm8 xmm xmm xmm -// VCMPPS imm8 m128 xmm xmm -// VCMPPS imm8 ymm ymm ymm -// VCMPPS imm8 m256 ymm ymm -func VCMPPS(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VCMPPS", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VCMPPS", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VCMPPS", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VCMPPS", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCMPPS: bad operands") -} - -// VCMPSD: Compare Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VCMPSD imm8 xmm xmm xmm -// VCMPSD imm8 m64 xmm xmm -func VCMPSD(i, mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VCMPSD", - Operands: []operand.Op{i, mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VCMPSD", - Operands: []operand.Op{i, mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCMPSD: bad operands") -} - -// VCMPSS: Compare Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VCMPSS imm8 xmm xmm xmm -// VCMPSS imm8 m32 xmm xmm -func VCMPSS(i, mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VCMPSS", - Operands: []operand.Op{i, mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VCMPSS", - Operands: []operand.Op{i, mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCMPSS: bad operands") -} - -// VCOMISD: Compare Scalar Ordered Double-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// VCOMISD xmm xmm -// VCOMISD m64 xmm -func VCOMISD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VCOMISD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VCOMISD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCOMISD: bad operands") -} - -// VCOMISS: Compare Scalar Ordered Single-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// VCOMISS xmm xmm -// VCOMISS m32 xmm -func VCOMISS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VCOMISS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VCOMISS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCOMISS: bad operands") -} - -// VCVTDQ2PD: Convert Packed Dword Integers to Packed Double-Precision FP Values. -// -// Forms: -// -// VCVTDQ2PD xmm xmm -// VCVTDQ2PD m64 xmm -// VCVTDQ2PD xmm ymm -// VCVTDQ2PD m128 ymm -func VCVTDQ2PD(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTDQ2PD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTDQ2PD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTDQ2PD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTDQ2PD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTDQ2PD: bad operands") -} - -// VCVTDQ2PS: Convert Packed Dword Integers to Packed Single-Precision FP Values. -// -// Forms: -// -// VCVTDQ2PS xmm xmm -// VCVTDQ2PS m128 xmm -// VCVTDQ2PS ymm ymm -// VCVTDQ2PS m256 ymm -func VCVTDQ2PS(mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTDQ2PS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTDQ2PS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTDQ2PS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTDQ2PS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTDQ2PS: bad operands") -} - -// VCVTPD2DQX: Convert Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTPD2DQX xmm xmm -// VCVTPD2DQX m128 xmm -func VCVTPD2DQX(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VCVTPD2DQX", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VCVTPD2DQX", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTPD2DQX: bad operands") -} - -// VCVTPD2DQY: Convert Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTPD2DQY ymm xmm -// VCVTPD2DQY m256 xmm -func VCVTPD2DQY(my, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsYMM(my) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VCVTPD2DQY", - Operands: []operand.Op{my, x}, - Inputs: []operand.Op{my}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(my) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VCVTPD2DQY", - Operands: []operand.Op{my, x}, - Inputs: []operand.Op{my}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTPD2DQY: bad operands") -} - -// VCVTPD2PSX: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. -// -// Forms: -// -// VCVTPD2PSX xmm xmm -// VCVTPD2PSX m128 xmm -func VCVTPD2PSX(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VCVTPD2PSX", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VCVTPD2PSX", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTPD2PSX: bad operands") -} - -// VCVTPD2PSY: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. -// -// Forms: -// -// VCVTPD2PSY ymm xmm -// VCVTPD2PSY m256 xmm -func VCVTPD2PSY(my, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsYMM(my) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VCVTPD2PSY", - Operands: []operand.Op{my, x}, - Inputs: []operand.Op{my}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(my) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VCVTPD2PSY", - Operands: []operand.Op{my, x}, - Inputs: []operand.Op{my}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTPD2PSY: bad operands") -} - -// VCVTPH2PS: Convert Half-Precision FP Values to Single-Precision FP Values. -// -// Forms: -// -// VCVTPH2PS xmm xmm -// VCVTPH2PS m64 xmm -// VCVTPH2PS xmm ymm -// VCVTPH2PS m128 ymm -func VCVTPH2PS(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTPH2PS", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"F16C"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTPH2PS", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"F16C"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTPH2PS", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"F16C"}, - }, nil - case operand.IsM128(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTPH2PS", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"F16C"}, - }, nil - } - return nil, errors.New("VCVTPH2PS: bad operands") -} - -// VCVTPS2DQ: Convert Packed Single-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTPS2DQ xmm xmm -// VCVTPS2DQ m128 xmm -// VCVTPS2DQ ymm ymm -// VCVTPS2DQ m256 ymm -func VCVTPS2DQ(mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTPS2DQ", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTPS2DQ", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTPS2DQ", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTPS2DQ", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTPS2DQ: bad operands") -} - -// VCVTPS2PD: Convert Packed Single-Precision FP Values to Packed Double-Precision FP Values. -// -// Forms: -// -// VCVTPS2PD xmm xmm -// VCVTPS2PD m64 xmm -// VCVTPS2PD xmm ymm -// VCVTPS2PD m128 ymm -func VCVTPS2PD(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTPS2PD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTPS2PD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTPS2PD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTPS2PD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTPS2PD: bad operands") -} - -// VCVTPS2PH: Convert Single-Precision FP value to Half-Precision FP value. -// -// Forms: -// -// VCVTPS2PH imm8 xmm xmm -// VCVTPS2PH imm8 ymm xmm -// VCVTPS2PH imm8 xmm m64 -// VCVTPS2PH imm8 ymm m128 -func VCVTPS2PH(i, xy, mx operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(xy) && operand.IsXMM(mx): - return &intrep.Instruction{ - Opcode: "VCVTPS2PH", - Operands: []operand.Op{i, xy, mx}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{mx}, - ISA: []string{"F16C"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(xy) && operand.IsXMM(mx): - return &intrep.Instruction{ - Opcode: "VCVTPS2PH", - Operands: []operand.Op{i, xy, mx}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{mx}, - ISA: []string{"F16C"}, - }, nil - case operand.IsIMM8(i) && operand.IsXMM(xy) && operand.IsM64(mx): - return &intrep.Instruction{ - Opcode: "VCVTPS2PH", - Operands: []operand.Op{i, xy, mx}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{mx}, - ISA: []string{"F16C"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(xy) && operand.IsM128(mx): - return &intrep.Instruction{ - Opcode: "VCVTPS2PH", - Operands: []operand.Op{i, xy, mx}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{mx}, - ISA: []string{"F16C"}, - }, nil - } - return nil, errors.New("VCVTPS2PH: bad operands") -} - -// VCVTSD2SI: Convert Scalar Double-Precision FP Value to Integer. -// -// Forms: -// -// VCVTSD2SI xmm r32 -// VCVTSD2SI m64 r32 -func VCVTSD2SI(mx, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "VCVTSD2SI", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "VCVTSD2SI", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTSD2SI: bad operands") -} - -// VCVTSD2SIQ: Convert Scalar Double-Precision FP Value to Integer. -// -// Forms: -// -// VCVTSD2SIQ xmm r64 -// VCVTSD2SIQ m64 r64 -func VCVTSD2SIQ(mx, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "VCVTSD2SIQ", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "VCVTSD2SIQ", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTSD2SIQ: bad operands") -} - -// VCVTSD2SS: Convert Scalar Double-Precision FP Value to Scalar Single-Precision FP Value. -// -// Forms: -// -// VCVTSD2SS xmm xmm xmm -// VCVTSD2SS m64 xmm xmm -func VCVTSD2SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VCVTSD2SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VCVTSD2SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTSD2SS: bad operands") -} - -// VCVTSI2SDL: Convert Dword Integer to Scalar Double-Precision FP Value. -// -// Forms: -// -// VCVTSI2SDL r32 xmm xmm -// VCVTSI2SDL m32 xmm xmm -func VCVTSI2SDL(mr, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VCVTSI2SDL", - Operands: []operand.Op{mr, x, x1}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mr) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VCVTSI2SDL", - Operands: []operand.Op{mr, x, x1}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTSI2SDL: bad operands") -} - -// VCVTSI2SDQ: Convert Dword Integer to Scalar Double-Precision FP Value. -// -// Forms: -// -// VCVTSI2SDQ r64 xmm xmm -// VCVTSI2SDQ m64 xmm xmm -func VCVTSI2SDQ(mr, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VCVTSI2SDQ", - Operands: []operand.Op{mr, x, x1}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mr) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VCVTSI2SDQ", - Operands: []operand.Op{mr, x, x1}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTSI2SDQ: bad operands") -} - -// VCVTSI2SSL: Convert Dword Integer to Scalar Single-Precision FP Value. -// -// Forms: -// -// VCVTSI2SSL r32 xmm xmm -// VCVTSI2SSL m32 xmm xmm -func VCVTSI2SSL(mr, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(mr) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VCVTSI2SSL", - Operands: []operand.Op{mr, x, x1}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mr) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VCVTSI2SSL", - Operands: []operand.Op{mr, x, x1}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTSI2SSL: bad operands") -} - -// VCVTSI2SSQ: Convert Dword Integer to Scalar Single-Precision FP Value. -// -// Forms: -// -// VCVTSI2SSQ r64 xmm xmm -// VCVTSI2SSQ m64 xmm xmm -func VCVTSI2SSQ(mr, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VCVTSI2SSQ", - Operands: []operand.Op{mr, x, x1}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mr) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VCVTSI2SSQ", - Operands: []operand.Op{mr, x, x1}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTSI2SSQ: bad operands") -} - -// VCVTSS2SD: Convert Scalar Single-Precision FP Value to Scalar Double-Precision FP Value. -// -// Forms: -// -// VCVTSS2SD xmm xmm xmm -// VCVTSS2SD m32 xmm xmm -func VCVTSS2SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VCVTSS2SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VCVTSS2SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTSS2SD: bad operands") -} - -// VCVTSS2SI: Convert Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// VCVTSS2SI xmm r32 -// VCVTSS2SI m32 r32 -func VCVTSS2SI(mx, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "VCVTSS2SI", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "VCVTSS2SI", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTSS2SI: bad operands") -} - -// VCVTSS2SIQ: Convert Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// VCVTSS2SIQ xmm r64 -// VCVTSS2SIQ m32 r64 -func VCVTSS2SIQ(mx, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "VCVTSS2SIQ", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "VCVTSS2SIQ", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTSS2SIQ: bad operands") -} - -// VCVTTPD2DQX: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTTPD2DQX xmm xmm -// VCVTTPD2DQX m128 xmm -func VCVTTPD2DQX(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VCVTTPD2DQX", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VCVTTPD2DQX", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTTPD2DQX: bad operands") -} - -// VCVTTPD2DQY: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTTPD2DQY ymm xmm -// VCVTTPD2DQY m256 xmm -func VCVTTPD2DQY(my, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsYMM(my) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VCVTTPD2DQY", - Operands: []operand.Op{my, x}, - Inputs: []operand.Op{my}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(my) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VCVTTPD2DQY", - Operands: []operand.Op{my, x}, - Inputs: []operand.Op{my}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTTPD2DQY: bad operands") -} - -// VCVTTPS2DQ: Convert with Truncation Packed Single-Precision FP Values to Packed Dword Integers. -// -// Forms: -// -// VCVTTPS2DQ xmm xmm -// VCVTTPS2DQ m128 xmm -// VCVTTPS2DQ ymm ymm -// VCVTTPS2DQ m256 ymm -func VCVTTPS2DQ(mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTTPS2DQ", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTTPS2DQ", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTTPS2DQ", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VCVTTPS2DQ", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTTPS2DQ: bad operands") -} - -// VCVTTSD2SI: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. -// -// Forms: -// -// VCVTTSD2SI xmm r32 -// VCVTTSD2SI m64 r32 -func VCVTTSD2SI(mx, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "VCVTTSD2SI", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "VCVTTSD2SI", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTTSD2SI: bad operands") -} - -// VCVTTSD2SIQ: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. -// -// Forms: -// -// VCVTTSD2SIQ xmm r64 -// VCVTTSD2SIQ m64 r64 -func VCVTTSD2SIQ(mx, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "VCVTTSD2SIQ", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "VCVTTSD2SIQ", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTTSD2SIQ: bad operands") -} - -// VCVTTSS2SI: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// VCVTTSS2SI xmm r32 -// VCVTTSS2SI m32 r32 -func VCVTTSS2SI(mx, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "VCVTTSS2SI", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "VCVTTSS2SI", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTTSS2SI: bad operands") -} - -// VCVTTSS2SIQ: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. -// -// Forms: -// -// VCVTTSS2SIQ xmm r64 -// VCVTTSS2SIQ m32 r64 -func VCVTTSS2SIQ(mx, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "VCVTTSS2SIQ", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsR64(r): - return &intrep.Instruction{ - Opcode: "VCVTTSS2SIQ", - Operands: []operand.Op{mx, r}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VCVTTSS2SIQ: bad operands") -} - -// VDIVPD: Divide Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VDIVPD xmm xmm xmm -// VDIVPD m128 xmm xmm -// VDIVPD ymm ymm ymm -// VDIVPD m256 ymm ymm -func VDIVPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VDIVPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VDIVPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VDIVPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VDIVPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VDIVPD: bad operands") -} - -// VDIVPS: Divide Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VDIVPS xmm xmm xmm -// VDIVPS m128 xmm xmm -// VDIVPS ymm ymm ymm -// VDIVPS m256 ymm ymm -func VDIVPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VDIVPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VDIVPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VDIVPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VDIVPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VDIVPS: bad operands") -} - -// VDIVSD: Divide Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VDIVSD xmm xmm xmm -// VDIVSD m64 xmm xmm -func VDIVSD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VDIVSD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VDIVSD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VDIVSD: bad operands") -} - -// VDIVSS: Divide Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VDIVSS xmm xmm xmm -// VDIVSS m32 xmm xmm -func VDIVSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VDIVSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VDIVSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VDIVSS: bad operands") -} - -// VDPPD: Dot Product of Packed Double Precision Floating-Point Values. -// -// Forms: -// -// VDPPD imm8 xmm xmm xmm -// VDPPD imm8 m128 xmm xmm -func VDPPD(i, mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VDPPD", - Operands: []operand.Op{i, mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VDPPD", - Operands: []operand.Op{i, mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VDPPD: bad operands") -} - -// VDPPS: Dot Product of Packed Single Precision Floating-Point Values. -// -// Forms: -// -// VDPPS imm8 xmm xmm xmm -// VDPPS imm8 m128 xmm xmm -// VDPPS imm8 ymm ymm ymm -// VDPPS imm8 m256 ymm ymm -func VDPPS(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VDPPS", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VDPPS", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VDPPS", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VDPPS", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VDPPS: bad operands") -} - -// VEXTRACTF128: Extract Packed Floating-Point Values. -// -// Forms: -// -// VEXTRACTF128 imm8 ymm xmm -// VEXTRACTF128 imm8 ymm m128 -func VEXTRACTF128(i, y, mx operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsYMM(y) && operand.IsXMM(mx): - return &intrep.Instruction{ - Opcode: "VEXTRACTF128", - Operands: []operand.Op{i, y, mx}, - Inputs: []operand.Op{y}, - Outputs: []operand.Op{mx}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(y) && operand.IsM128(mx): - return &intrep.Instruction{ - Opcode: "VEXTRACTF128", - Operands: []operand.Op{i, y, mx}, - Inputs: []operand.Op{y}, - Outputs: []operand.Op{mx}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VEXTRACTF128: bad operands") -} - -// VEXTRACTI128: Extract Packed Integer Values. -// -// Forms: -// -// VEXTRACTI128 imm8 ymm xmm -// VEXTRACTI128 imm8 ymm m128 -func VEXTRACTI128(i, y, mx operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsYMM(y) && operand.IsXMM(mx): - return &intrep.Instruction{ - Opcode: "VEXTRACTI128", - Operands: []operand.Op{i, y, mx}, - Inputs: []operand.Op{y}, - Outputs: []operand.Op{mx}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(y) && operand.IsM128(mx): - return &intrep.Instruction{ - Opcode: "VEXTRACTI128", - Operands: []operand.Op{i, y, mx}, - Inputs: []operand.Op{y}, - Outputs: []operand.Op{mx}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VEXTRACTI128: bad operands") -} - -// VEXTRACTPS: Extract Packed Single Precision Floating-Point Value. -// -// Forms: -// -// VEXTRACTPS imm8 xmm r32 -// VEXTRACTPS imm8 xmm m32 -func VEXTRACTPS(i, x, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "VEXTRACTPS", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "VEXTRACTPS", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VEXTRACTPS: bad operands") -} - -// VFMADD132PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD132PD xmm xmm xmm -// VFMADD132PD m128 xmm xmm -// VFMADD132PD ymm ymm ymm -// VFMADD132PD m256 ymm ymm -func VFMADD132PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADD132PD: bad operands") -} - -// VFMADD132PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD132PS xmm xmm xmm -// VFMADD132PS m128 xmm xmm -// VFMADD132PS ymm ymm ymm -// VFMADD132PS m256 ymm ymm -func VFMADD132PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADD132PS: bad operands") -} - -// VFMADD132SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD132SD xmm xmm xmm -// VFMADD132SD m64 xmm xmm -func VFMADD132SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMADD132SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMADD132SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADD132SD: bad operands") -} - -// VFMADD132SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD132SS xmm xmm xmm -// VFMADD132SS m32 xmm xmm -func VFMADD132SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMADD132SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMADD132SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADD132SS: bad operands") -} - -// VFMADD213PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD213PD xmm xmm xmm -// VFMADD213PD m128 xmm xmm -// VFMADD213PD ymm ymm ymm -// VFMADD213PD m256 ymm ymm -func VFMADD213PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADD213PD: bad operands") -} - -// VFMADD213PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD213PS xmm xmm xmm -// VFMADD213PS m128 xmm xmm -// VFMADD213PS ymm ymm ymm -// VFMADD213PS m256 ymm ymm -func VFMADD213PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADD213PS: bad operands") -} - -// VFMADD213SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD213SD xmm xmm xmm -// VFMADD213SD m64 xmm xmm -func VFMADD213SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMADD213SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMADD213SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADD213SD: bad operands") -} - -// VFMADD213SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD213SS xmm xmm xmm -// VFMADD213SS m32 xmm xmm -func VFMADD213SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMADD213SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMADD213SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADD213SS: bad operands") -} - -// VFMADD231PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD231PD xmm xmm xmm -// VFMADD231PD m128 xmm xmm -// VFMADD231PD ymm ymm ymm -// VFMADD231PD m256 ymm ymm -func VFMADD231PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADD231PD: bad operands") -} - -// VFMADD231PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD231PS xmm xmm xmm -// VFMADD231PS m128 xmm xmm -// VFMADD231PS ymm ymm ymm -// VFMADD231PS m256 ymm ymm -func VFMADD231PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADD231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADD231PS: bad operands") -} - -// VFMADD231SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD231SD xmm xmm xmm -// VFMADD231SD m64 xmm xmm -func VFMADD231SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMADD231SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMADD231SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADD231SD: bad operands") -} - -// VFMADD231SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADD231SS xmm xmm xmm -// VFMADD231SS m32 xmm xmm -func VFMADD231SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMADD231SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMADD231SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADD231SS: bad operands") -} - -// VFMADDSUB132PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB132PD xmm xmm xmm -// VFMADDSUB132PD m128 xmm xmm -// VFMADDSUB132PD ymm ymm ymm -// VFMADDSUB132PD m256 ymm ymm -func VFMADDSUB132PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADDSUB132PD: bad operands") -} - -// VFMADDSUB132PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB132PS xmm xmm xmm -// VFMADDSUB132PS m128 xmm xmm -// VFMADDSUB132PS ymm ymm ymm -// VFMADDSUB132PS m256 ymm ymm -func VFMADDSUB132PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADDSUB132PS: bad operands") -} - -// VFMADDSUB213PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB213PD xmm xmm xmm -// VFMADDSUB213PD m128 xmm xmm -// VFMADDSUB213PD ymm ymm ymm -// VFMADDSUB213PD m256 ymm ymm -func VFMADDSUB213PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADDSUB213PD: bad operands") -} - -// VFMADDSUB213PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB213PS xmm xmm xmm -// VFMADDSUB213PS m128 xmm xmm -// VFMADDSUB213PS ymm ymm ymm -// VFMADDSUB213PS m256 ymm ymm -func VFMADDSUB213PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADDSUB213PS: bad operands") -} - -// VFMADDSUB231PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB231PD xmm xmm xmm -// VFMADDSUB231PD m128 xmm xmm -// VFMADDSUB231PD ymm ymm ymm -// VFMADDSUB231PD m256 ymm ymm -func VFMADDSUB231PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADDSUB231PD: bad operands") -} - -// VFMADDSUB231PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMADDSUB231PS xmm xmm xmm -// VFMADDSUB231PS m128 xmm xmm -// VFMADDSUB231PS ymm ymm ymm -// VFMADDSUB231PS m256 ymm ymm -func VFMADDSUB231PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMADDSUB231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMADDSUB231PS: bad operands") -} - -// VFMSUB132PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB132PD xmm xmm xmm -// VFMSUB132PD m128 xmm xmm -// VFMSUB132PD ymm ymm ymm -// VFMSUB132PD m256 ymm ymm -func VFMSUB132PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUB132PD: bad operands") -} - -// VFMSUB132PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB132PS xmm xmm xmm -// VFMSUB132PS m128 xmm xmm -// VFMSUB132PS ymm ymm ymm -// VFMSUB132PS m256 ymm ymm -func VFMSUB132PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUB132PS: bad operands") -} - -// VFMSUB132SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB132SD xmm xmm xmm -// VFMSUB132SD m64 xmm xmm -func VFMSUB132SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMSUB132SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMSUB132SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUB132SD: bad operands") -} - -// VFMSUB132SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB132SS xmm xmm xmm -// VFMSUB132SS m32 xmm xmm -func VFMSUB132SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMSUB132SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMSUB132SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUB132SS: bad operands") -} - -// VFMSUB213PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB213PD xmm xmm xmm -// VFMSUB213PD m128 xmm xmm -// VFMSUB213PD ymm ymm ymm -// VFMSUB213PD m256 ymm ymm -func VFMSUB213PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUB213PD: bad operands") -} - -// VFMSUB213PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB213PS xmm xmm xmm -// VFMSUB213PS m128 xmm xmm -// VFMSUB213PS ymm ymm ymm -// VFMSUB213PS m256 ymm ymm -func VFMSUB213PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUB213PS: bad operands") -} - -// VFMSUB213SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB213SD xmm xmm xmm -// VFMSUB213SD m64 xmm xmm -func VFMSUB213SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMSUB213SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMSUB213SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUB213SD: bad operands") -} - -// VFMSUB213SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB213SS xmm xmm xmm -// VFMSUB213SS m32 xmm xmm -func VFMSUB213SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMSUB213SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMSUB213SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUB213SS: bad operands") -} - -// VFMSUB231PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB231PD xmm xmm xmm -// VFMSUB231PD m128 xmm xmm -// VFMSUB231PD ymm ymm ymm -// VFMSUB231PD m256 ymm ymm -func VFMSUB231PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUB231PD: bad operands") -} - -// VFMSUB231PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB231PS xmm xmm xmm -// VFMSUB231PS m128 xmm xmm -// VFMSUB231PS ymm ymm ymm -// VFMSUB231PS m256 ymm ymm -func VFMSUB231PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUB231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUB231PS: bad operands") -} - -// VFMSUB231SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB231SD xmm xmm xmm -// VFMSUB231SD m64 xmm xmm -func VFMSUB231SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMSUB231SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMSUB231SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUB231SD: bad operands") -} - -// VFMSUB231SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUB231SS xmm xmm xmm -// VFMSUB231SS m32 xmm xmm -func VFMSUB231SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMSUB231SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFMSUB231SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUB231SS: bad operands") -} - -// VFMSUBADD132PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD132PD xmm xmm xmm -// VFMSUBADD132PD m128 xmm xmm -// VFMSUBADD132PD ymm ymm ymm -// VFMSUBADD132PD m256 ymm ymm -func VFMSUBADD132PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUBADD132PD: bad operands") -} - -// VFMSUBADD132PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD132PS xmm xmm xmm -// VFMSUBADD132PS m128 xmm xmm -// VFMSUBADD132PS ymm ymm ymm -// VFMSUBADD132PS m256 ymm ymm -func VFMSUBADD132PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUBADD132PS: bad operands") -} - -// VFMSUBADD213PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD213PD xmm xmm xmm -// VFMSUBADD213PD m128 xmm xmm -// VFMSUBADD213PD ymm ymm ymm -// VFMSUBADD213PD m256 ymm ymm -func VFMSUBADD213PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUBADD213PD: bad operands") -} - -// VFMSUBADD213PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD213PS xmm xmm xmm -// VFMSUBADD213PS m128 xmm xmm -// VFMSUBADD213PS ymm ymm ymm -// VFMSUBADD213PS m256 ymm ymm -func VFMSUBADD213PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUBADD213PS: bad operands") -} - -// VFMSUBADD231PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD231PD xmm xmm xmm -// VFMSUBADD231PD m128 xmm xmm -// VFMSUBADD231PD ymm ymm ymm -// VFMSUBADD231PD m256 ymm ymm -func VFMSUBADD231PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUBADD231PD: bad operands") -} - -// VFMSUBADD231PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFMSUBADD231PS xmm xmm xmm -// VFMSUBADD231PS m128 xmm xmm -// VFMSUBADD231PS ymm ymm ymm -// VFMSUBADD231PS m256 ymm ymm -func VFMSUBADD231PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFMSUBADD231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFMSUBADD231PS: bad operands") -} - -// VFNMADD132PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD132PD xmm xmm xmm -// VFNMADD132PD m128 xmm xmm -// VFNMADD132PD ymm ymm ymm -// VFNMADD132PD m256 ymm ymm -func VFNMADD132PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMADD132PD: bad operands") -} - -// VFNMADD132PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD132PS xmm xmm xmm -// VFNMADD132PS m128 xmm xmm -// VFNMADD132PS ymm ymm ymm -// VFNMADD132PS m256 ymm ymm -func VFNMADD132PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMADD132PS: bad operands") -} - -// VFNMADD132SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD132SD xmm xmm xmm -// VFNMADD132SD m64 xmm xmm -func VFNMADD132SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMADD132SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMADD132SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMADD132SD: bad operands") -} - -// VFNMADD132SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD132SS xmm xmm xmm -// VFNMADD132SS m32 xmm xmm -func VFNMADD132SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMADD132SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMADD132SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMADD132SS: bad operands") -} - -// VFNMADD213PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD213PD xmm xmm xmm -// VFNMADD213PD m128 xmm xmm -// VFNMADD213PD ymm ymm ymm -// VFNMADD213PD m256 ymm ymm -func VFNMADD213PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMADD213PD: bad operands") -} - -// VFNMADD213PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD213PS xmm xmm xmm -// VFNMADD213PS m128 xmm xmm -// VFNMADD213PS ymm ymm ymm -// VFNMADD213PS m256 ymm ymm -func VFNMADD213PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMADD213PS: bad operands") -} - -// VFNMADD213SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD213SD xmm xmm xmm -// VFNMADD213SD m64 xmm xmm -func VFNMADD213SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMADD213SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMADD213SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMADD213SD: bad operands") -} - -// VFNMADD213SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD213SS xmm xmm xmm -// VFNMADD213SS m32 xmm xmm -func VFNMADD213SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMADD213SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMADD213SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMADD213SS: bad operands") -} - -// VFNMADD231PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD231PD xmm xmm xmm -// VFNMADD231PD m128 xmm xmm -// VFNMADD231PD ymm ymm ymm -// VFNMADD231PD m256 ymm ymm -func VFNMADD231PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMADD231PD: bad operands") -} - -// VFNMADD231PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD231PS xmm xmm xmm -// VFNMADD231PS m128 xmm xmm -// VFNMADD231PS ymm ymm ymm -// VFNMADD231PS m256 ymm ymm -func VFNMADD231PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMADD231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMADD231PS: bad operands") -} - -// VFNMADD231SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD231SD xmm xmm xmm -// VFNMADD231SD m64 xmm xmm -func VFNMADD231SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMADD231SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMADD231SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMADD231SD: bad operands") -} - -// VFNMADD231SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMADD231SS xmm xmm xmm -// VFNMADD231SS m32 xmm xmm -func VFNMADD231SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMADD231SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMADD231SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMADD231SS: bad operands") -} - -// VFNMSUB132PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB132PD xmm xmm xmm -// VFNMSUB132PD m128 xmm xmm -// VFNMSUB132PD ymm ymm ymm -// VFNMSUB132PD m256 ymm ymm -func VFNMSUB132PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB132PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMSUB132PD: bad operands") -} - -// VFNMSUB132PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB132PS xmm xmm xmm -// VFNMSUB132PS m128 xmm xmm -// VFNMSUB132PS ymm ymm ymm -// VFNMSUB132PS m256 ymm ymm -func VFNMSUB132PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB132PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMSUB132PS: bad operands") -} - -// VFNMSUB132SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB132SD xmm xmm xmm -// VFNMSUB132SD m64 xmm xmm -func VFNMSUB132SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMSUB132SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMSUB132SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMSUB132SD: bad operands") -} - -// VFNMSUB132SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB132SS xmm xmm xmm -// VFNMSUB132SS m32 xmm xmm -func VFNMSUB132SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMSUB132SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMSUB132SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMSUB132SS: bad operands") -} - -// VFNMSUB213PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB213PD xmm xmm xmm -// VFNMSUB213PD m128 xmm xmm -// VFNMSUB213PD ymm ymm ymm -// VFNMSUB213PD m256 ymm ymm -func VFNMSUB213PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB213PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMSUB213PD: bad operands") -} - -// VFNMSUB213PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB213PS xmm xmm xmm -// VFNMSUB213PS m128 xmm xmm -// VFNMSUB213PS ymm ymm ymm -// VFNMSUB213PS m256 ymm ymm -func VFNMSUB213PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB213PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMSUB213PS: bad operands") -} - -// VFNMSUB213SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB213SD xmm xmm xmm -// VFNMSUB213SD m64 xmm xmm -func VFNMSUB213SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMSUB213SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMSUB213SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMSUB213SD: bad operands") -} - -// VFNMSUB213SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB213SS xmm xmm xmm -// VFNMSUB213SS m32 xmm xmm -func VFNMSUB213SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMSUB213SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMSUB213SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMSUB213SS: bad operands") -} - -// VFNMSUB231PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB231PD xmm xmm xmm -// VFNMSUB231PD m128 xmm xmm -// VFNMSUB231PD ymm ymm ymm -// VFNMSUB231PD m256 ymm ymm -func VFNMSUB231PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB231PD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMSUB231PD: bad operands") -} - -// VFNMSUB231PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB231PS xmm xmm xmm -// VFNMSUB231PS m128 xmm xmm -// VFNMSUB231PS ymm ymm ymm -// VFNMSUB231PS m256 ymm ymm -func VFNMSUB231PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VFNMSUB231PS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy, xy1}, - Outputs: []operand.Op{xy1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMSUB231PS: bad operands") -} - -// VFNMSUB231SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB231SD xmm xmm xmm -// VFNMSUB231SD m64 xmm xmm -func VFNMSUB231SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMSUB231SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMSUB231SD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMSUB231SD: bad operands") -} - -// VFNMSUB231SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VFNMSUB231SS xmm xmm xmm -// VFNMSUB231SS m32 xmm xmm -func VFNMSUB231SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMSUB231SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VFNMSUB231SS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x, x1}, - Outputs: []operand.Op{x1}, - ISA: []string{"FMA3"}, - }, nil - } - return nil, errors.New("VFNMSUB231SS: bad operands") -} - -// VGATHERDPD: Gather Packed Double-Precision Floating-Point Values Using Signed Doubleword Indices. -// -// Forms: -// -// VGATHERDPD xmm vm32x xmm -// VGATHERDPD ymm vm32x ymm -func VGATHERDPD(xy, v, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(xy) && operand.IsVM32X(v) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VGATHERDPD", - Operands: []operand.Op{xy, v, xy1}, - Inputs: []operand.Op{xy, v, xy1}, - Outputs: []operand.Op{xy, xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsYMM(xy) && operand.IsVM32X(v) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VGATHERDPD", - Operands: []operand.Op{xy, v, xy1}, - Inputs: []operand.Op{xy, v, xy1}, - Outputs: []operand.Op{xy, xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VGATHERDPD: bad operands") -} - -// VGATHERDPS: Gather Packed Single-Precision Floating-Point Values Using Signed Doubleword Indices. -// -// Forms: -// -// VGATHERDPS xmm vm32x xmm -// VGATHERDPS ymm vm32y ymm -func VGATHERDPS(xy, v, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(xy) && operand.IsVM32X(v) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VGATHERDPS", - Operands: []operand.Op{xy, v, xy1}, - Inputs: []operand.Op{xy, v, xy1}, - Outputs: []operand.Op{xy, xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsYMM(xy) && operand.IsVM32Y(v) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VGATHERDPS", - Operands: []operand.Op{xy, v, xy1}, - Inputs: []operand.Op{xy, v, xy1}, - Outputs: []operand.Op{xy, xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VGATHERDPS: bad operands") -} - -// VGATHERQPD: Gather Packed Double-Precision Floating-Point Values Using Signed Quadword Indices. -// -// Forms: -// -// VGATHERQPD xmm vm64x xmm -// VGATHERQPD ymm vm64y ymm -func VGATHERQPD(xy, v, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(xy) && operand.IsVM64X(v) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VGATHERQPD", - Operands: []operand.Op{xy, v, xy1}, - Inputs: []operand.Op{xy, v, xy1}, - Outputs: []operand.Op{xy, xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsYMM(xy) && operand.IsVM64Y(v) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VGATHERQPD", - Operands: []operand.Op{xy, v, xy1}, - Inputs: []operand.Op{xy, v, xy1}, - Outputs: []operand.Op{xy, xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VGATHERQPD: bad operands") -} - -// VGATHERQPS: Gather Packed Single-Precision Floating-Point Values Using Signed Quadword Indices. -// -// Forms: -// -// VGATHERQPS xmm vm64x xmm -// VGATHERQPS xmm vm64y xmm -func VGATHERQPS(x, v, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(x) && operand.IsVM64X(v) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VGATHERQPS", - Operands: []operand.Op{x, v, x1}, - Inputs: []operand.Op{x, v, x1}, - Outputs: []operand.Op{x, x1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsXMM(x) && operand.IsVM64Y(v) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VGATHERQPS", - Operands: []operand.Op{x, v, x1}, - Inputs: []operand.Op{x, v, x1}, - Outputs: []operand.Op{x, x1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VGATHERQPS: bad operands") -} - -// VHADDPD: Packed Double-FP Horizontal Add. -// -// Forms: -// -// VHADDPD xmm xmm xmm -// VHADDPD m128 xmm xmm -// VHADDPD ymm ymm ymm -// VHADDPD m256 ymm ymm -func VHADDPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VHADDPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VHADDPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VHADDPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VHADDPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VHADDPD: bad operands") -} - -// VHADDPS: Packed Single-FP Horizontal Add. -// -// Forms: -// -// VHADDPS xmm xmm xmm -// VHADDPS m128 xmm xmm -// VHADDPS ymm ymm ymm -// VHADDPS m256 ymm ymm -func VHADDPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VHADDPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VHADDPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VHADDPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VHADDPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VHADDPS: bad operands") -} - -// VHSUBPD: Packed Double-FP Horizontal Subtract. -// -// Forms: -// -// VHSUBPD xmm xmm xmm -// VHSUBPD m128 xmm xmm -// VHSUBPD ymm ymm ymm -// VHSUBPD m256 ymm ymm -func VHSUBPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VHSUBPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VHSUBPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VHSUBPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VHSUBPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VHSUBPD: bad operands") -} - -// VHSUBPS: Packed Single-FP Horizontal Subtract. -// -// Forms: -// -// VHSUBPS xmm xmm xmm -// VHSUBPS m128 xmm xmm -// VHSUBPS ymm ymm ymm -// VHSUBPS m256 ymm ymm -func VHSUBPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VHSUBPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VHSUBPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VHSUBPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VHSUBPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VHSUBPS: bad operands") -} - -// VINSERTF128: Insert Packed Floating-Point Values. -// -// Forms: -// -// VINSERTF128 imm8 xmm ymm ymm -// VINSERTF128 imm8 m128 ymm ymm -func VINSERTF128(i, mx, y, y1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsYMM(y) && operand.IsYMM(y1): - return &intrep.Instruction{ - Opcode: "VINSERTF128", - Operands: []operand.Op{i, mx, y, y1}, - Inputs: []operand.Op{mx, y}, - Outputs: []operand.Op{y1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsYMM(y) && operand.IsYMM(y1): - return &intrep.Instruction{ - Opcode: "VINSERTF128", - Operands: []operand.Op{i, mx, y, y1}, - Inputs: []operand.Op{mx, y}, - Outputs: []operand.Op{y1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VINSERTF128: bad operands") -} - -// VINSERTI128: Insert Packed Integer Values. -// -// Forms: -// -// VINSERTI128 imm8 xmm ymm ymm -// VINSERTI128 imm8 m128 ymm ymm -func VINSERTI128(i, mx, y, y1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsYMM(y) && operand.IsYMM(y1): - return &intrep.Instruction{ - Opcode: "VINSERTI128", - Operands: []operand.Op{i, mx, y, y1}, - Inputs: []operand.Op{mx, y}, - Outputs: []operand.Op{y1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsYMM(y) && operand.IsYMM(y1): - return &intrep.Instruction{ - Opcode: "VINSERTI128", - Operands: []operand.Op{i, mx, y, y1}, - Inputs: []operand.Op{mx, y}, - Outputs: []operand.Op{y1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VINSERTI128: bad operands") -} - -// VINSERTPS: Insert Packed Single Precision Floating-Point Value. -// -// Forms: -// -// VINSERTPS imm8 xmm xmm xmm -// VINSERTPS imm8 m32 xmm xmm -func VINSERTPS(i, mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VINSERTPS", - Operands: []operand.Op{i, mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VINSERTPS", - Operands: []operand.Op{i, mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VINSERTPS: bad operands") -} - -// VLDDQU: Load Unaligned Integer 128 Bits. -// -// Forms: -// -// VLDDQU m128 xmm -// VLDDQU m256 ymm -func VLDDQU(m, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM128(m) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VLDDQU", - Operands: []operand.Op{m, xy}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(m) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VLDDQU", - Operands: []operand.Op{m, xy}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VLDDQU: bad operands") -} - -// VLDMXCSR: Load MXCSR Register. -// -// Forms: -// -// VLDMXCSR m32 -func VLDMXCSR(m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM32(m): - return &intrep.Instruction{ - Opcode: "VLDMXCSR", - Operands: []operand.Op{m}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VLDMXCSR: bad operands") -} - -// VMASKMOVDQU: Store Selected Bytes of Double Quadword. -// -// Forms: -// -// VMASKMOVDQU xmm xmm -func VMASKMOVDQU(x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VMASKMOVDQU", - Operands: []operand.Op{x, x1}, - Inputs: []operand.Op{x, x1, reg.RDI}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMASKMOVDQU: bad operands") -} - -// VMASKMOVPD: Conditional Move Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMASKMOVPD m128 xmm xmm -// VMASKMOVPD m256 ymm ymm -// VMASKMOVPD xmm xmm m128 -// VMASKMOVPD ymm ymm m256 -func VMASKMOVPD(mxy, xy, mxy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMASKMOVPD", - Operands: []operand.Op{mxy, xy, mxy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMASKMOVPD", - Operands: []operand.Op{mxy, xy, mxy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsM128(mxy1): - return &intrep.Instruction{ - Opcode: "VMASKMOVPD", - Operands: []operand.Op{mxy, xy, mxy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsM256(mxy1): - return &intrep.Instruction{ - Opcode: "VMASKMOVPD", - Operands: []operand.Op{mxy, xy, mxy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMASKMOVPD: bad operands") -} - -// VMASKMOVPS: Conditional Move Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMASKMOVPS m128 xmm xmm -// VMASKMOVPS m256 ymm ymm -// VMASKMOVPS xmm xmm m128 -// VMASKMOVPS ymm ymm m256 -func VMASKMOVPS(mxy, xy, mxy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMASKMOVPS", - Operands: []operand.Op{mxy, xy, mxy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMASKMOVPS", - Operands: []operand.Op{mxy, xy, mxy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsM128(mxy1): - return &intrep.Instruction{ - Opcode: "VMASKMOVPS", - Operands: []operand.Op{mxy, xy, mxy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsM256(mxy1): - return &intrep.Instruction{ - Opcode: "VMASKMOVPS", - Operands: []operand.Op{mxy, xy, mxy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMASKMOVPS: bad operands") -} - -// VMAXPD: Return Maximum Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMAXPD xmm xmm xmm -// VMAXPD m128 xmm xmm -// VMAXPD ymm ymm ymm -// VMAXPD m256 ymm ymm -func VMAXPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VMAXPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VMAXPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VMAXPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VMAXPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMAXPD: bad operands") -} - -// VMAXPS: Return Maximum Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMAXPS xmm xmm xmm -// VMAXPS m128 xmm xmm -// VMAXPS ymm ymm ymm -// VMAXPS m256 ymm ymm -func VMAXPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VMAXPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VMAXPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VMAXPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VMAXPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMAXPS: bad operands") -} - -// VMAXSD: Return Maximum Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// VMAXSD xmm xmm xmm -// VMAXSD m64 xmm xmm -func VMAXSD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VMAXSD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VMAXSD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMAXSD: bad operands") -} - -// VMAXSS: Return Maximum Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// VMAXSS xmm xmm xmm -// VMAXSS m32 xmm xmm -func VMAXSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VMAXSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VMAXSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMAXSS: bad operands") -} - -// VMINPD: Return Minimum Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMINPD xmm xmm xmm -// VMINPD m128 xmm xmm -// VMINPD ymm ymm ymm -// VMINPD m256 ymm ymm -func VMINPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VMINPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VMINPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VMINPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VMINPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMINPD: bad operands") -} - -// VMINPS: Return Minimum Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMINPS xmm xmm xmm -// VMINPS m128 xmm xmm -// VMINPS ymm ymm ymm -// VMINPS m256 ymm ymm -func VMINPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VMINPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VMINPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VMINPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VMINPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMINPS: bad operands") -} - -// VMINSD: Return Minimum Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// VMINSD xmm xmm xmm -// VMINSD m64 xmm xmm -func VMINSD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VMINSD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VMINSD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMINSD: bad operands") -} - -// VMINSS: Return Minimum Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// VMINSS xmm xmm xmm -// VMINSS m32 xmm xmm -func VMINSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VMINSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VMINSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMINSS: bad operands") -} - -// VMOVAPD: Move Aligned Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMOVAPD xmm xmm -// VMOVAPD m128 xmm -// VMOVAPD ymm ymm -// VMOVAPD m256 ymm -// VMOVAPD xmm m128 -// VMOVAPD ymm m256 -func VMOVAPD(mxy, mxy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVAPD", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVAPD", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVAPD", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVAPD", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mxy) && operand.IsM128(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVAPD", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsM256(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVAPD", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVAPD: bad operands") -} - -// VMOVAPS: Move Aligned Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMOVAPS xmm xmm -// VMOVAPS m128 xmm -// VMOVAPS ymm ymm -// VMOVAPS m256 ymm -// VMOVAPS xmm m128 -// VMOVAPS ymm m256 -func VMOVAPS(mxy, mxy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVAPS", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVAPS", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVAPS", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVAPS", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mxy) && operand.IsM128(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVAPS", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsM256(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVAPS", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVAPS: bad operands") -} - -// VMOVD: Move Doubleword. -// -// Forms: -// -// VMOVD xmm r32 -// VMOVD r32 xmm -// VMOVD m32 xmm -// VMOVD xmm m32 -func VMOVD(mrx, mrx1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mrx) && operand.IsR32(mrx1): - return &intrep.Instruction{ - Opcode: "VMOVD", - Operands: []operand.Op{mrx, mrx1}, - Inputs: []operand.Op{mrx}, - Outputs: []operand.Op{mrx1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsR32(mrx) && operand.IsXMM(mrx1): - return &intrep.Instruction{ - Opcode: "VMOVD", - Operands: []operand.Op{mrx, mrx1}, - Inputs: []operand.Op{mrx}, - Outputs: []operand.Op{mrx1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mrx) && operand.IsXMM(mrx1): - return &intrep.Instruction{ - Opcode: "VMOVD", - Operands: []operand.Op{mrx, mrx1}, - Inputs: []operand.Op{mrx}, - Outputs: []operand.Op{mrx1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mrx) && operand.IsM32(mrx1): - return &intrep.Instruction{ - Opcode: "VMOVD", - Operands: []operand.Op{mrx, mrx1}, - Inputs: []operand.Op{mrx}, - Outputs: []operand.Op{mrx1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVD: bad operands") -} - -// VMOVDDUP: Move One Double-FP and Duplicate. -// -// Forms: -// -// VMOVDDUP xmm xmm -// VMOVDDUP m64 xmm -// VMOVDDUP ymm ymm -// VMOVDDUP m256 ymm -func VMOVDDUP(mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VMOVDDUP", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VMOVDDUP", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VMOVDDUP", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VMOVDDUP", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVDDUP: bad operands") -} - -// VMOVDQA: Move Aligned Double Quadword. -// -// Forms: -// -// VMOVDQA xmm xmm -// VMOVDQA m128 xmm -// VMOVDQA ymm ymm -// VMOVDQA m256 ymm -// VMOVDQA xmm m128 -// VMOVDQA ymm m256 -func VMOVDQA(mxy, mxy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVDQA", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVDQA", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVDQA", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVDQA", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mxy) && operand.IsM128(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVDQA", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsM256(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVDQA", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVDQA: bad operands") -} - -// VMOVDQU: Move Unaligned Double Quadword. -// -// Forms: -// -// VMOVDQU xmm xmm -// VMOVDQU m128 xmm -// VMOVDQU ymm ymm -// VMOVDQU m256 ymm -// VMOVDQU xmm m128 -// VMOVDQU ymm m256 -func VMOVDQU(mxy, mxy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVDQU", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVDQU", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVDQU", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVDQU", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mxy) && operand.IsM128(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVDQU", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsM256(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVDQU", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVDQU: bad operands") -} - -// VMOVHLPS: Move Packed Single-Precision Floating-Point Values High to Low. -// -// Forms: -// -// VMOVHLPS xmm xmm xmm -func VMOVHLPS(x, x1, x2 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(x) && operand.IsXMM(x1) && operand.IsXMM(x2): - return &intrep.Instruction{ - Opcode: "VMOVHLPS", - Operands: []operand.Op{x, x1, x2}, - Inputs: []operand.Op{x, x1}, - Outputs: []operand.Op{x2}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVHLPS: bad operands") -} - -// VMOVHPD: Move High Packed Double-Precision Floating-Point Value. -// -// Forms: -// -// VMOVHPD xmm m64 -// VMOVHPD m64 xmm xmm -func VMOVHPD(ops ...operand.Op) (*intrep.Instruction, error) { - switch { - case len(ops) == 2 && operand.IsXMM(ops[0]) && operand.IsM64(ops[1]): - return &intrep.Instruction{ - Opcode: "VMOVHPD", - Operands: ops, - Inputs: []operand.Op{ops[0]}, - Outputs: []operand.Op{ops[1]}, - ISA: []string{"AVX"}, - }, nil - case len(ops) == 3 && operand.IsM64(ops[0]) && operand.IsXMM(ops[1]) && operand.IsXMM(ops[2]): - return &intrep.Instruction{ - Opcode: "VMOVHPD", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[2]}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVHPD: bad operands") -} - -// VMOVHPS: Move High Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMOVHPS xmm m64 -// VMOVHPS m64 xmm xmm -func VMOVHPS(ops ...operand.Op) (*intrep.Instruction, error) { - switch { - case len(ops) == 2 && operand.IsXMM(ops[0]) && operand.IsM64(ops[1]): - return &intrep.Instruction{ - Opcode: "VMOVHPS", - Operands: ops, - Inputs: []operand.Op{ops[0]}, - Outputs: []operand.Op{ops[1]}, - ISA: []string{"AVX"}, - }, nil - case len(ops) == 3 && operand.IsM64(ops[0]) && operand.IsXMM(ops[1]) && operand.IsXMM(ops[2]): - return &intrep.Instruction{ - Opcode: "VMOVHPS", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[2]}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVHPS: bad operands") -} - -// VMOVLHPS: Move Packed Single-Precision Floating-Point Values Low to High. -// -// Forms: -// -// VMOVLHPS xmm xmm xmm -func VMOVLHPS(x, x1, x2 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(x) && operand.IsXMM(x1) && operand.IsXMM(x2): - return &intrep.Instruction{ - Opcode: "VMOVLHPS", - Operands: []operand.Op{x, x1, x2}, - Inputs: []operand.Op{x, x1}, - Outputs: []operand.Op{x2}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVLHPS: bad operands") -} - -// VMOVLPD: Move Low Packed Double-Precision Floating-Point Value. -// -// Forms: -// -// VMOVLPD xmm m64 -// VMOVLPD m64 xmm xmm -func VMOVLPD(ops ...operand.Op) (*intrep.Instruction, error) { - switch { - case len(ops) == 2 && operand.IsXMM(ops[0]) && operand.IsM64(ops[1]): - return &intrep.Instruction{ - Opcode: "VMOVLPD", - Operands: ops, - Inputs: []operand.Op{ops[0]}, - Outputs: []operand.Op{ops[1]}, - ISA: []string{"AVX"}, - }, nil - case len(ops) == 3 && operand.IsM64(ops[0]) && operand.IsXMM(ops[1]) && operand.IsXMM(ops[2]): - return &intrep.Instruction{ - Opcode: "VMOVLPD", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[2]}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVLPD: bad operands") -} - -// VMOVLPS: Move Low Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMOVLPS xmm m64 -// VMOVLPS m64 xmm xmm -func VMOVLPS(ops ...operand.Op) (*intrep.Instruction, error) { - switch { - case len(ops) == 2 && operand.IsXMM(ops[0]) && operand.IsM64(ops[1]): - return &intrep.Instruction{ - Opcode: "VMOVLPS", - Operands: ops, - Inputs: []operand.Op{ops[0]}, - Outputs: []operand.Op{ops[1]}, - ISA: []string{"AVX"}, - }, nil - case len(ops) == 3 && operand.IsM64(ops[0]) && operand.IsXMM(ops[1]) && operand.IsXMM(ops[2]): - return &intrep.Instruction{ - Opcode: "VMOVLPS", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[2]}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVLPS: bad operands") -} - -// VMOVMSKPD: Extract Packed Double-Precision Floating-Point Sign Mask. -// -// Forms: -// -// VMOVMSKPD xmm r32 -// VMOVMSKPD ymm r32 -func VMOVMSKPD(xy, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(xy) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "VMOVMSKPD", - Operands: []operand.Op{xy, r}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(xy) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "VMOVMSKPD", - Operands: []operand.Op{xy, r}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVMSKPD: bad operands") -} - -// VMOVMSKPS: Extract Packed Single-Precision Floating-Point Sign Mask. -// -// Forms: -// -// VMOVMSKPS xmm r32 -// VMOVMSKPS ymm r32 -func VMOVMSKPS(xy, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(xy) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "VMOVMSKPS", - Operands: []operand.Op{xy, r}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(xy) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "VMOVMSKPS", - Operands: []operand.Op{xy, r}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVMSKPS: bad operands") -} - -// VMOVNTDQ: Store Double Quadword Using Non-Temporal Hint. -// -// Forms: -// -// VMOVNTDQ xmm m128 -// VMOVNTDQ ymm m256 -func VMOVNTDQ(xy, m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(xy) && operand.IsM128(m): - return &intrep.Instruction{ - Opcode: "VMOVNTDQ", - Operands: []operand.Op{xy, m}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{m}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(xy) && operand.IsM256(m): - return &intrep.Instruction{ - Opcode: "VMOVNTDQ", - Operands: []operand.Op{xy, m}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{m}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVNTDQ: bad operands") -} - -// VMOVNTDQA: Load Double Quadword Non-Temporal Aligned Hint. -// -// Forms: -// -// VMOVNTDQA m128 xmm -// VMOVNTDQA m256 ymm -func VMOVNTDQA(m, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM128(m) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VMOVNTDQA", - Operands: []operand.Op{m, xy}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(m) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VMOVNTDQA", - Operands: []operand.Op{m, xy}, - Inputs: []operand.Op{m}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VMOVNTDQA: bad operands") -} - -// VMOVNTPD: Store Packed Double-Precision Floating-Point Values Using Non-Temporal Hint. -// -// Forms: -// -// VMOVNTPD xmm m128 -// VMOVNTPD ymm m256 -func VMOVNTPD(xy, m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(xy) && operand.IsM128(m): - return &intrep.Instruction{ - Opcode: "VMOVNTPD", - Operands: []operand.Op{xy, m}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{m}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(xy) && operand.IsM256(m): - return &intrep.Instruction{ - Opcode: "VMOVNTPD", - Operands: []operand.Op{xy, m}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{m}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVNTPD: bad operands") -} - -// VMOVNTPS: Store Packed Single-Precision Floating-Point Values Using Non-Temporal Hint. -// -// Forms: -// -// VMOVNTPS xmm m128 -// VMOVNTPS ymm m256 -func VMOVNTPS(xy, m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(xy) && operand.IsM128(m): - return &intrep.Instruction{ - Opcode: "VMOVNTPS", - Operands: []operand.Op{xy, m}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{m}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(xy) && operand.IsM256(m): - return &intrep.Instruction{ - Opcode: "VMOVNTPS", - Operands: []operand.Op{xy, m}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{m}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVNTPS: bad operands") -} - -// VMOVQ: Move Quadword. -// -// Forms: -// -// VMOVQ xmm r64 -// VMOVQ r64 xmm -// VMOVQ xmm xmm -// VMOVQ m64 xmm -// VMOVQ xmm m64 -func VMOVQ(mrx, mrx1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mrx) && operand.IsR64(mrx1): - return &intrep.Instruction{ - Opcode: "VMOVQ", - Operands: []operand.Op{mrx, mrx1}, - Inputs: []operand.Op{mrx}, - Outputs: []operand.Op{mrx1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsR64(mrx) && operand.IsXMM(mrx1): - return &intrep.Instruction{ - Opcode: "VMOVQ", - Operands: []operand.Op{mrx, mrx1}, - Inputs: []operand.Op{mrx}, - Outputs: []operand.Op{mrx1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mrx) && operand.IsXMM(mrx1): - return &intrep.Instruction{ - Opcode: "VMOVQ", - Operands: []operand.Op{mrx, mrx1}, - Inputs: []operand.Op{mrx}, - Outputs: []operand.Op{mrx1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mrx) && operand.IsXMM(mrx1): - return &intrep.Instruction{ - Opcode: "VMOVQ", - Operands: []operand.Op{mrx, mrx1}, - Inputs: []operand.Op{mrx}, - Outputs: []operand.Op{mrx1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mrx) && operand.IsM64(mrx1): - return &intrep.Instruction{ - Opcode: "VMOVQ", - Operands: []operand.Op{mrx, mrx1}, - Inputs: []operand.Op{mrx}, - Outputs: []operand.Op{mrx1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVQ: bad operands") -} - -// VMOVSD: Move Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// VMOVSD m64 xmm -// VMOVSD xmm m64 -// VMOVSD xmm xmm xmm -func VMOVSD(ops ...operand.Op) (*intrep.Instruction, error) { - switch { - case len(ops) == 2 && operand.IsM64(ops[0]) && operand.IsXMM(ops[1]): - return &intrep.Instruction{ - Opcode: "VMOVSD", - Operands: ops, - Inputs: []operand.Op{ops[0]}, - Outputs: []operand.Op{ops[1]}, - ISA: []string{"AVX"}, - }, nil - case len(ops) == 2 && operand.IsXMM(ops[0]) && operand.IsM64(ops[1]): - return &intrep.Instruction{ - Opcode: "VMOVSD", - Operands: ops, - Inputs: []operand.Op{ops[0]}, - Outputs: []operand.Op{ops[1]}, - ISA: []string{"AVX"}, - }, nil - case len(ops) == 3 && operand.IsXMM(ops[0]) && operand.IsXMM(ops[1]) && operand.IsXMM(ops[2]): - return &intrep.Instruction{ - Opcode: "VMOVSD", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[2]}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVSD: bad operands") -} - -// VMOVSHDUP: Move Packed Single-FP High and Duplicate. -// -// Forms: -// -// VMOVSHDUP xmm xmm -// VMOVSHDUP m128 xmm -// VMOVSHDUP ymm ymm -// VMOVSHDUP m256 ymm -func VMOVSHDUP(mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VMOVSHDUP", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VMOVSHDUP", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VMOVSHDUP", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VMOVSHDUP", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVSHDUP: bad operands") -} - -// VMOVSLDUP: Move Packed Single-FP Low and Duplicate. -// -// Forms: -// -// VMOVSLDUP xmm xmm -// VMOVSLDUP m128 xmm -// VMOVSLDUP ymm ymm -// VMOVSLDUP m256 ymm -func VMOVSLDUP(mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VMOVSLDUP", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VMOVSLDUP", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VMOVSLDUP", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VMOVSLDUP", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVSLDUP: bad operands") -} - -// VMOVSS: Move Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VMOVSS m32 xmm -// VMOVSS xmm m32 -// VMOVSS xmm xmm xmm -func VMOVSS(ops ...operand.Op) (*intrep.Instruction, error) { - switch { - case len(ops) == 2 && operand.IsM32(ops[0]) && operand.IsXMM(ops[1]): - return &intrep.Instruction{ - Opcode: "VMOVSS", - Operands: ops, - Inputs: []operand.Op{ops[0]}, - Outputs: []operand.Op{ops[1]}, - ISA: []string{"AVX"}, - }, nil - case len(ops) == 2 && operand.IsXMM(ops[0]) && operand.IsM32(ops[1]): - return &intrep.Instruction{ - Opcode: "VMOVSS", - Operands: ops, - Inputs: []operand.Op{ops[0]}, - Outputs: []operand.Op{ops[1]}, - ISA: []string{"AVX"}, - }, nil - case len(ops) == 3 && operand.IsXMM(ops[0]) && operand.IsXMM(ops[1]) && operand.IsXMM(ops[2]): - return &intrep.Instruction{ - Opcode: "VMOVSS", - Operands: ops, - Inputs: []operand.Op{ops[0], ops[1]}, - Outputs: []operand.Op{ops[2]}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVSS: bad operands") -} - -// VMOVUPD: Move Unaligned Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMOVUPD xmm xmm -// VMOVUPD m128 xmm -// VMOVUPD ymm ymm -// VMOVUPD m256 ymm -// VMOVUPD xmm m128 -// VMOVUPD ymm m256 -func VMOVUPD(mxy, mxy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVUPD", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVUPD", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVUPD", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVUPD", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mxy) && operand.IsM128(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVUPD", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsM256(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVUPD", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVUPD: bad operands") -} - -// VMOVUPS: Move Unaligned Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMOVUPS xmm xmm -// VMOVUPS m128 xmm -// VMOVUPS ymm ymm -// VMOVUPS m256 ymm -// VMOVUPS xmm m128 -// VMOVUPS ymm m256 -func VMOVUPS(mxy, mxy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVUPS", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVUPS", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVUPS", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVUPS", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mxy) && operand.IsM128(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVUPS", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsM256(mxy1): - return &intrep.Instruction{ - Opcode: "VMOVUPS", - Operands: []operand.Op{mxy, mxy1}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMOVUPS: bad operands") -} - -// VMPSADBW: Compute Multiple Packed Sums of Absolute Difference. -// -// Forms: -// -// VMPSADBW imm8 xmm xmm xmm -// VMPSADBW imm8 m128 xmm xmm -// VMPSADBW imm8 ymm ymm ymm -// VMPSADBW imm8 m256 ymm ymm -func VMPSADBW(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VMPSADBW", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VMPSADBW", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VMPSADBW", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VMPSADBW", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VMPSADBW: bad operands") -} - -// VMULPD: Multiply Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VMULPD xmm xmm xmm -// VMULPD m128 xmm xmm -// VMULPD ymm ymm ymm -// VMULPD m256 ymm ymm -func VMULPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VMULPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VMULPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VMULPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VMULPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMULPD: bad operands") -} - -// VMULPS: Multiply Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VMULPS xmm xmm xmm -// VMULPS m128 xmm xmm -// VMULPS ymm ymm ymm -// VMULPS m256 ymm ymm -func VMULPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VMULPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VMULPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VMULPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VMULPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMULPS: bad operands") -} - -// VMULSD: Multiply Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VMULSD xmm xmm xmm -// VMULSD m64 xmm xmm -func VMULSD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VMULSD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VMULSD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMULSD: bad operands") -} - -// VMULSS: Multiply Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VMULSS xmm xmm xmm -// VMULSS m32 xmm xmm -func VMULSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VMULSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VMULSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VMULSS: bad operands") -} - -// VORPD: Bitwise Logical OR of Double-Precision Floating-Point Values. -// -// Forms: -// -// VORPD xmm xmm xmm -// VORPD m128 xmm xmm -// VORPD ymm ymm ymm -// VORPD m256 ymm ymm -func VORPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VORPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VORPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VORPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VORPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VORPD: bad operands") -} - -// VORPS: Bitwise Logical OR of Single-Precision Floating-Point Values. -// -// Forms: -// -// VORPS xmm xmm xmm -// VORPS m128 xmm xmm -// VORPS ymm ymm ymm -// VORPS m256 ymm ymm -func VORPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VORPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VORPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VORPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VORPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VORPS: bad operands") -} - -// VPABSB: Packed Absolute Value of Byte Integers. -// -// Forms: -// -// VPABSB xmm xmm -// VPABSB m128 xmm -// VPABSB ymm ymm -// VPABSB m256 ymm -func VPABSB(mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPABSB", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPABSB", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPABSB", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPABSB", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPABSB: bad operands") -} - -// VPABSD: Packed Absolute Value of Doubleword Integers. -// -// Forms: -// -// VPABSD xmm xmm -// VPABSD m128 xmm -// VPABSD ymm ymm -// VPABSD m256 ymm -func VPABSD(mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPABSD", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPABSD", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPABSD", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPABSD", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPABSD: bad operands") -} - -// VPABSW: Packed Absolute Value of Word Integers. -// -// Forms: -// -// VPABSW xmm xmm -// VPABSW m128 xmm -// VPABSW ymm ymm -// VPABSW m256 ymm -func VPABSW(mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPABSW", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPABSW", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPABSW", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPABSW", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPABSW: bad operands") -} - -// VPACKSSDW: Pack Doublewords into Words with Signed Saturation. -// -// Forms: -// -// VPACKSSDW xmm xmm xmm -// VPACKSSDW m128 xmm xmm -// VPACKSSDW ymm ymm ymm -// VPACKSSDW m256 ymm ymm -func VPACKSSDW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPACKSSDW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPACKSSDW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPACKSSDW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPACKSSDW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPACKSSDW: bad operands") -} - -// VPACKSSWB: Pack Words into Bytes with Signed Saturation. -// -// Forms: -// -// VPACKSSWB xmm xmm xmm -// VPACKSSWB m128 xmm xmm -// VPACKSSWB ymm ymm ymm -// VPACKSSWB m256 ymm ymm -func VPACKSSWB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPACKSSWB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPACKSSWB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPACKSSWB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPACKSSWB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPACKSSWB: bad operands") -} - -// VPACKUSDW: Pack Doublewords into Words with Unsigned Saturation. -// -// Forms: -// -// VPACKUSDW xmm xmm xmm -// VPACKUSDW m128 xmm xmm -// VPACKUSDW ymm ymm ymm -// VPACKUSDW m256 ymm ymm -func VPACKUSDW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPACKUSDW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPACKUSDW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPACKUSDW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPACKUSDW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPACKUSDW: bad operands") -} - -// VPACKUSWB: Pack Words into Bytes with Unsigned Saturation. -// -// Forms: -// -// VPACKUSWB xmm xmm xmm -// VPACKUSWB m128 xmm xmm -// VPACKUSWB ymm ymm ymm -// VPACKUSWB m256 ymm ymm -func VPACKUSWB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPACKUSWB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPACKUSWB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPACKUSWB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPACKUSWB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPACKUSWB: bad operands") -} - -// VPADDB: Add Packed Byte Integers. -// -// Forms: -// -// VPADDB xmm xmm xmm -// VPADDB m128 xmm xmm -// VPADDB ymm ymm ymm -// VPADDB m256 ymm ymm -func VPADDB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPADDB: bad operands") -} - -// VPADDD: Add Packed Doubleword Integers. -// -// Forms: -// -// VPADDD xmm xmm xmm -// VPADDD m128 xmm xmm -// VPADDD ymm ymm ymm -// VPADDD m256 ymm ymm -func VPADDD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPADDD: bad operands") -} - -// VPADDQ: Add Packed Quadword Integers. -// -// Forms: -// -// VPADDQ xmm xmm xmm -// VPADDQ m128 xmm xmm -// VPADDQ ymm ymm ymm -// VPADDQ m256 ymm ymm -func VPADDQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPADDQ: bad operands") -} - -// VPADDSB: Add Packed Signed Byte Integers with Signed Saturation. -// -// Forms: -// -// VPADDSB xmm xmm xmm -// VPADDSB m128 xmm xmm -// VPADDSB ymm ymm ymm -// VPADDSB m256 ymm ymm -func VPADDSB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPADDSB: bad operands") -} - -// VPADDSW: Add Packed Signed Word Integers with Signed Saturation. -// -// Forms: -// -// VPADDSW xmm xmm xmm -// VPADDSW m128 xmm xmm -// VPADDSW ymm ymm ymm -// VPADDSW m256 ymm ymm -func VPADDSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPADDSW: bad operands") -} - -// VPADDUSB: Add Packed Unsigned Byte Integers with Unsigned Saturation. -// -// Forms: -// -// VPADDUSB xmm xmm xmm -// VPADDUSB m128 xmm xmm -// VPADDUSB ymm ymm ymm -// VPADDUSB m256 ymm ymm -func VPADDUSB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDUSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDUSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDUSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDUSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPADDUSB: bad operands") -} - -// VPADDUSW: Add Packed Unsigned Word Integers with Unsigned Saturation. -// -// Forms: -// -// VPADDUSW xmm xmm xmm -// VPADDUSW m128 xmm xmm -// VPADDUSW ymm ymm ymm -// VPADDUSW m256 ymm ymm -func VPADDUSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDUSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDUSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDUSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDUSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPADDUSW: bad operands") -} - -// VPADDW: Add Packed Word Integers. -// -// Forms: -// -// VPADDW xmm xmm xmm -// VPADDW m128 xmm xmm -// VPADDW ymm ymm ymm -// VPADDW m256 ymm ymm -func VPADDW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPADDW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPADDW: bad operands") -} - -// VPALIGNR: Packed Align Right. -// -// Forms: -// -// VPALIGNR imm8 xmm xmm xmm -// VPALIGNR imm8 m128 xmm xmm -// VPALIGNR imm8 ymm ymm ymm -// VPALIGNR imm8 m256 ymm ymm -func VPALIGNR(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPALIGNR", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPALIGNR", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPALIGNR", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPALIGNR", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPALIGNR: bad operands") -} - -// VPAND: Packed Bitwise Logical AND. -// -// Forms: -// -// VPAND xmm xmm xmm -// VPAND m128 xmm xmm -// VPAND ymm ymm ymm -// VPAND m256 ymm ymm -func VPAND(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPAND", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPAND", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPAND", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPAND", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPAND: bad operands") -} - -// VPANDN: Packed Bitwise Logical AND NOT. -// -// Forms: -// -// VPANDN xmm xmm xmm -// VPANDN m128 xmm xmm -// VPANDN ymm ymm ymm -// VPANDN m256 ymm ymm -func VPANDN(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPANDN", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPANDN", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPANDN", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPANDN", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPANDN: bad operands") -} - -// VPAVGB: Average Packed Byte Integers. -// -// Forms: -// -// VPAVGB xmm xmm xmm -// VPAVGB m128 xmm xmm -// VPAVGB ymm ymm ymm -// VPAVGB m256 ymm ymm -func VPAVGB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPAVGB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPAVGB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPAVGB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPAVGB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPAVGB: bad operands") -} - -// VPAVGW: Average Packed Word Integers. -// -// Forms: -// -// VPAVGW xmm xmm xmm -// VPAVGW m128 xmm xmm -// VPAVGW ymm ymm ymm -// VPAVGW m256 ymm ymm -func VPAVGW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPAVGW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPAVGW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPAVGW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPAVGW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPAVGW: bad operands") -} - -// VPBLENDD: Blend Packed Doublewords. -// -// Forms: -// -// VPBLENDD imm8 xmm xmm xmm -// VPBLENDD imm8 m128 xmm xmm -// VPBLENDD imm8 ymm ymm ymm -// VPBLENDD imm8 m256 ymm ymm -func VPBLENDD(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPBLENDD", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPBLENDD", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPBLENDD", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPBLENDD", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPBLENDD: bad operands") -} - -// VPBLENDVB: Variable Blend Packed Bytes. -// -// Forms: -// -// VPBLENDVB xmm xmm xmm xmm -// VPBLENDVB xmm m128 xmm xmm -// VPBLENDVB ymm ymm ymm ymm -// VPBLENDVB ymm m256 ymm ymm -func VPBLENDVB(xy, mxy, xy1, xy2 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(xy) && operand.IsXMM(mxy) && operand.IsXMM(xy1) && operand.IsXMM(xy2): - return &intrep.Instruction{ - Opcode: "VPBLENDVB", - Operands: []operand.Op{xy, mxy, xy1, xy2}, - Inputs: []operand.Op{xy, mxy, xy1}, - Outputs: []operand.Op{xy2}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(xy) && operand.IsM128(mxy) && operand.IsXMM(xy1) && operand.IsXMM(xy2): - return &intrep.Instruction{ - Opcode: "VPBLENDVB", - Operands: []operand.Op{xy, mxy, xy1, xy2}, - Inputs: []operand.Op{xy, mxy, xy1}, - Outputs: []operand.Op{xy2}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(xy) && operand.IsYMM(mxy) && operand.IsYMM(xy1) && operand.IsYMM(xy2): - return &intrep.Instruction{ - Opcode: "VPBLENDVB", - Operands: []operand.Op{xy, mxy, xy1, xy2}, - Inputs: []operand.Op{xy, mxy, xy1}, - Outputs: []operand.Op{xy2}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsYMM(xy) && operand.IsM256(mxy) && operand.IsYMM(xy1) && operand.IsYMM(xy2): - return &intrep.Instruction{ - Opcode: "VPBLENDVB", - Operands: []operand.Op{xy, mxy, xy1, xy2}, - Inputs: []operand.Op{xy, mxy, xy1}, - Outputs: []operand.Op{xy2}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPBLENDVB: bad operands") -} - -// VPBLENDW: Blend Packed Words. -// -// Forms: -// -// VPBLENDW imm8 xmm xmm xmm -// VPBLENDW imm8 m128 xmm xmm -// VPBLENDW imm8 ymm ymm ymm -// VPBLENDW imm8 m256 ymm ymm -func VPBLENDW(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPBLENDW", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPBLENDW", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPBLENDW", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPBLENDW", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPBLENDW: bad operands") -} - -// VPBROADCASTB: Broadcast Byte Integer. -// -// Forms: -// -// VPBROADCASTB xmm xmm -// VPBROADCASTB m8 xmm -// VPBROADCASTB xmm ymm -// VPBROADCASTB m8 ymm -func VPBROADCASTB(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPBROADCASTB", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM8(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPBROADCASTB", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPBROADCASTB", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM8(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPBROADCASTB", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPBROADCASTB: bad operands") -} - -// VPBROADCASTD: Broadcast Doubleword Integer. -// -// Forms: -// -// VPBROADCASTD xmm xmm -// VPBROADCASTD m32 xmm -// VPBROADCASTD xmm ymm -// VPBROADCASTD m32 ymm -func VPBROADCASTD(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPBROADCASTD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPBROADCASTD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPBROADCASTD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM32(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPBROADCASTD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPBROADCASTD: bad operands") -} - -// VPBROADCASTQ: Broadcast Quadword Integer. -// -// Forms: -// -// VPBROADCASTQ xmm xmm -// VPBROADCASTQ m64 xmm -// VPBROADCASTQ xmm ymm -// VPBROADCASTQ m64 ymm -func VPBROADCASTQ(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPBROADCASTQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPBROADCASTQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPBROADCASTQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM64(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPBROADCASTQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPBROADCASTQ: bad operands") -} - -// VPBROADCASTW: Broadcast Word Integer. -// -// Forms: -// -// VPBROADCASTW xmm xmm -// VPBROADCASTW m16 xmm -// VPBROADCASTW xmm ymm -// VPBROADCASTW m16 ymm -func VPBROADCASTW(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPBROADCASTW", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM16(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPBROADCASTW", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPBROADCASTW", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM16(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPBROADCASTW", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPBROADCASTW: bad operands") -} - -// VPCLMULQDQ: Carry-Less Quadword Multiplication. -// -// Forms: -// -// VPCLMULQDQ imm8 xmm xmm xmm -// VPCLMULQDQ imm8 m128 xmm xmm -func VPCLMULQDQ(i, mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VPCLMULQDQ", - Operands: []operand.Op{i, mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX", "PCLMULQDQ"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VPCLMULQDQ", - Operands: []operand.Op{i, mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX", "PCLMULQDQ"}, - }, nil - } - return nil, errors.New("VPCLMULQDQ: bad operands") -} - -// VPCMPEQB: Compare Packed Byte Data for Equality. -// -// Forms: -// -// VPCMPEQB xmm xmm xmm -// VPCMPEQB m128 xmm xmm -// VPCMPEQB ymm ymm ymm -// VPCMPEQB m256 ymm ymm -func VPCMPEQB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPEQB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPEQB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPEQB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPEQB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPCMPEQB: bad operands") -} - -// VPCMPEQD: Compare Packed Doubleword Data for Equality. -// -// Forms: -// -// VPCMPEQD xmm xmm xmm -// VPCMPEQD m128 xmm xmm -// VPCMPEQD ymm ymm ymm -// VPCMPEQD m256 ymm ymm -func VPCMPEQD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPEQD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPEQD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPEQD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPEQD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPCMPEQD: bad operands") -} - -// VPCMPEQQ: Compare Packed Quadword Data for Equality. -// -// Forms: -// -// VPCMPEQQ xmm xmm xmm -// VPCMPEQQ m128 xmm xmm -// VPCMPEQQ ymm ymm ymm -// VPCMPEQQ m256 ymm ymm -func VPCMPEQQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPEQQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPEQQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPEQQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPEQQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPCMPEQQ: bad operands") -} - -// VPCMPEQW: Compare Packed Word Data for Equality. -// -// Forms: -// -// VPCMPEQW xmm xmm xmm -// VPCMPEQW m128 xmm xmm -// VPCMPEQW ymm ymm ymm -// VPCMPEQW m256 ymm ymm -func VPCMPEQW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPEQW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPEQW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPEQW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPEQW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPCMPEQW: bad operands") -} - -// VPCMPESTRI: Packed Compare Explicit Length Strings, Return Index. -// -// Forms: -// -// VPCMPESTRI imm8 xmm xmm -// VPCMPESTRI imm8 m128 xmm -func VPCMPESTRI(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VPCMPESTRI", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x, reg.EAX, reg.EDX}, - Outputs: []operand.Op{reg.ECX}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VPCMPESTRI", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x, reg.EAX, reg.EDX}, - Outputs: []operand.Op{reg.ECX}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VPCMPESTRI: bad operands") -} - -// VPCMPESTRM: Packed Compare Explicit Length Strings, Return Mask. -// -// Forms: -// -// VPCMPESTRM imm8 xmm xmm -// VPCMPESTRM imm8 m128 xmm -func VPCMPESTRM(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VPCMPESTRM", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x, reg.EAX, reg.EDX}, - Outputs: []operand.Op{reg.X0}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VPCMPESTRM", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x, reg.EAX, reg.EDX}, - Outputs: []operand.Op{reg.X0}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VPCMPESTRM: bad operands") -} - -// VPCMPGTB: Compare Packed Signed Byte Integers for Greater Than. -// -// Forms: -// -// VPCMPGTB xmm xmm xmm -// VPCMPGTB m128 xmm xmm -// VPCMPGTB ymm ymm ymm -// VPCMPGTB m256 ymm ymm -func VPCMPGTB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPGTB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPGTB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPGTB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPGTB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPCMPGTB: bad operands") -} - -// VPCMPGTD: Compare Packed Signed Doubleword Integers for Greater Than. -// -// Forms: -// -// VPCMPGTD xmm xmm xmm -// VPCMPGTD m128 xmm xmm -// VPCMPGTD ymm ymm ymm -// VPCMPGTD m256 ymm ymm -func VPCMPGTD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPGTD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPGTD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPGTD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPGTD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPCMPGTD: bad operands") -} - -// VPCMPGTQ: Compare Packed Data for Greater Than. -// -// Forms: -// -// VPCMPGTQ xmm xmm xmm -// VPCMPGTQ m128 xmm xmm -// VPCMPGTQ ymm ymm ymm -// VPCMPGTQ m256 ymm ymm -func VPCMPGTQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPGTQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPGTQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPGTQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPGTQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPCMPGTQ: bad operands") -} - -// VPCMPGTW: Compare Packed Signed Word Integers for Greater Than. -// -// Forms: -// -// VPCMPGTW xmm xmm xmm -// VPCMPGTW m128 xmm xmm -// VPCMPGTW ymm ymm ymm -// VPCMPGTW m256 ymm ymm -func VPCMPGTW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPGTW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPGTW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPGTW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPCMPGTW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPCMPGTW: bad operands") -} - -// VPCMPISTRI: Packed Compare Implicit Length Strings, Return Index. -// -// Forms: -// -// VPCMPISTRI imm8 xmm xmm -// VPCMPISTRI imm8 m128 xmm -func VPCMPISTRI(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VPCMPISTRI", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{reg.ECX}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VPCMPISTRI", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{reg.ECX}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VPCMPISTRI: bad operands") -} - -// VPCMPISTRM: Packed Compare Implicit Length Strings, Return Mask. -// -// Forms: -// -// VPCMPISTRM imm8 xmm xmm -// VPCMPISTRM imm8 m128 xmm -func VPCMPISTRM(i, mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VPCMPISTRM", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{reg.X0}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VPCMPISTRM", - Operands: []operand.Op{i, mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{reg.X0}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VPCMPISTRM: bad operands") -} - -// VPERM2F128: Permute Floating-Point Values. -// -// Forms: -// -// VPERM2F128 imm8 ymm ymm ymm -// VPERM2F128 imm8 m256 ymm ymm -func VPERM2F128(i, my, y, y1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsYMM(my) && operand.IsYMM(y) && operand.IsYMM(y1): - return &intrep.Instruction{ - Opcode: "VPERM2F128", - Operands: []operand.Op{i, my, y, y1}, - Inputs: []operand.Op{my, y}, - Outputs: []operand.Op{y1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(my) && operand.IsYMM(y) && operand.IsYMM(y1): - return &intrep.Instruction{ - Opcode: "VPERM2F128", - Operands: []operand.Op{i, my, y, y1}, - Inputs: []operand.Op{my, y}, - Outputs: []operand.Op{y1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VPERM2F128: bad operands") -} - -// VPERM2I128: Permute 128-Bit Integer Values. -// -// Forms: -// -// VPERM2I128 imm8 ymm ymm ymm -// VPERM2I128 imm8 m256 ymm ymm -func VPERM2I128(i, my, y, y1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsYMM(my) && operand.IsYMM(y) && operand.IsYMM(y1): - return &intrep.Instruction{ - Opcode: "VPERM2I128", - Operands: []operand.Op{i, my, y, y1}, - Inputs: []operand.Op{my, y}, - Outputs: []operand.Op{y1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(my) && operand.IsYMM(y) && operand.IsYMM(y1): - return &intrep.Instruction{ - Opcode: "VPERM2I128", - Operands: []operand.Op{i, my, y, y1}, - Inputs: []operand.Op{my, y}, - Outputs: []operand.Op{y1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPERM2I128: bad operands") -} - -// VPERMD: Permute Doubleword Integers. -// -// Forms: -// -// VPERMD ymm ymm ymm -// VPERMD m256 ymm ymm -func VPERMD(my, y, y1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsYMM(my) && operand.IsYMM(y) && operand.IsYMM(y1): - return &intrep.Instruction{ - Opcode: "VPERMD", - Operands: []operand.Op{my, y, y1}, - Inputs: []operand.Op{my, y}, - Outputs: []operand.Op{y1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(my) && operand.IsYMM(y) && operand.IsYMM(y1): - return &intrep.Instruction{ - Opcode: "VPERMD", - Operands: []operand.Op{my, y, y1}, - Inputs: []operand.Op{my, y}, - Outputs: []operand.Op{y1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPERMD: bad operands") -} - -// VPERMILPD: Permute Double-Precision Floating-Point Values. -// -// Forms: -// -// VPERMILPD imm8 xmm xmm -// VPERMILPD xmm xmm xmm -// VPERMILPD m128 xmm xmm -// VPERMILPD imm8 m128 xmm -// VPERMILPD imm8 ymm ymm -// VPERMILPD ymm ymm ymm -// VPERMILPD m256 ymm ymm -// VPERMILPD imm8 m256 ymm -func VPERMILPD(imxy, mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imxy) && operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPERMILPD", - Operands: []operand.Op{imxy, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(imxy) && operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPERMILPD", - Operands: []operand.Op{imxy, mxy, xy}, - Inputs: []operand.Op{imxy, mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(imxy) && operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPERMILPD", - Operands: []operand.Op{imxy, mxy, xy}, - Inputs: []operand.Op{imxy, mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(imxy) && operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPERMILPD", - Operands: []operand.Op{imxy, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(imxy) && operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPERMILPD", - Operands: []operand.Op{imxy, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(imxy) && operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPERMILPD", - Operands: []operand.Op{imxy, mxy, xy}, - Inputs: []operand.Op{imxy, mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(imxy) && operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPERMILPD", - Operands: []operand.Op{imxy, mxy, xy}, - Inputs: []operand.Op{imxy, mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(imxy) && operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPERMILPD", - Operands: []operand.Op{imxy, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VPERMILPD: bad operands") -} - -// VPERMILPS: Permute Single-Precision Floating-Point Values. -// -// Forms: -// -// VPERMILPS imm8 xmm xmm -// VPERMILPS xmm xmm xmm -// VPERMILPS m128 xmm xmm -// VPERMILPS imm8 m128 xmm -// VPERMILPS imm8 ymm ymm -// VPERMILPS ymm ymm ymm -// VPERMILPS m256 ymm ymm -// VPERMILPS imm8 m256 ymm -func VPERMILPS(imxy, mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imxy) && operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPERMILPS", - Operands: []operand.Op{imxy, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(imxy) && operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPERMILPS", - Operands: []operand.Op{imxy, mxy, xy}, - Inputs: []operand.Op{imxy, mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(imxy) && operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPERMILPS", - Operands: []operand.Op{imxy, mxy, xy}, - Inputs: []operand.Op{imxy, mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(imxy) && operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPERMILPS", - Operands: []operand.Op{imxy, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(imxy) && operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPERMILPS", - Operands: []operand.Op{imxy, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(imxy) && operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPERMILPS", - Operands: []operand.Op{imxy, mxy, xy}, - Inputs: []operand.Op{imxy, mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(imxy) && operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPERMILPS", - Operands: []operand.Op{imxy, mxy, xy}, - Inputs: []operand.Op{imxy, mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(imxy) && operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPERMILPS", - Operands: []operand.Op{imxy, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VPERMILPS: bad operands") -} - -// VPERMPD: Permute Double-Precision Floating-Point Elements. -// -// Forms: -// -// VPERMPD imm8 ymm ymm -// VPERMPD imm8 m256 ymm -func VPERMPD(i, my, y operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsYMM(my) && operand.IsYMM(y): - return &intrep.Instruction{ - Opcode: "VPERMPD", - Operands: []operand.Op{i, my, y}, - Inputs: []operand.Op{my}, - Outputs: []operand.Op{y}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(my) && operand.IsYMM(y): - return &intrep.Instruction{ - Opcode: "VPERMPD", - Operands: []operand.Op{i, my, y}, - Inputs: []operand.Op{my}, - Outputs: []operand.Op{y}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPERMPD: bad operands") -} - -// VPERMPS: Permute Single-Precision Floating-Point Elements. -// -// Forms: -// -// VPERMPS ymm ymm ymm -// VPERMPS m256 ymm ymm -func VPERMPS(my, y, y1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsYMM(my) && operand.IsYMM(y) && operand.IsYMM(y1): - return &intrep.Instruction{ - Opcode: "VPERMPS", - Operands: []operand.Op{my, y, y1}, - Inputs: []operand.Op{my, y}, - Outputs: []operand.Op{y1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(my) && operand.IsYMM(y) && operand.IsYMM(y1): - return &intrep.Instruction{ - Opcode: "VPERMPS", - Operands: []operand.Op{my, y, y1}, - Inputs: []operand.Op{my, y}, - Outputs: []operand.Op{y1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPERMPS: bad operands") -} - -// VPERMQ: Permute Quadword Integers. -// -// Forms: -// -// VPERMQ imm8 ymm ymm -// VPERMQ imm8 m256 ymm -func VPERMQ(i, my, y operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsYMM(my) && operand.IsYMM(y): - return &intrep.Instruction{ - Opcode: "VPERMQ", - Operands: []operand.Op{i, my, y}, - Inputs: []operand.Op{my}, - Outputs: []operand.Op{y}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(my) && operand.IsYMM(y): - return &intrep.Instruction{ - Opcode: "VPERMQ", - Operands: []operand.Op{i, my, y}, - Inputs: []operand.Op{my}, - Outputs: []operand.Op{y}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPERMQ: bad operands") -} - -// VPEXTRB: Extract Byte. -// -// Forms: -// -// VPEXTRB imm8 xmm r32 -// VPEXTRB imm8 xmm m8 -func VPEXTRB(i, x, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "VPEXTRB", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "VPEXTRB", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VPEXTRB: bad operands") -} - -// VPEXTRD: Extract Doubleword. -// -// Forms: -// -// VPEXTRD imm8 xmm r32 -// VPEXTRD imm8 xmm m32 -func VPEXTRD(i, x, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "VPEXTRD", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "VPEXTRD", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VPEXTRD: bad operands") -} - -// VPEXTRQ: Extract Quadword. -// -// Forms: -// -// VPEXTRQ imm8 xmm r64 -// VPEXTRQ imm8 xmm m64 -func VPEXTRQ(i, x, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "VPEXTRQ", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "VPEXTRQ", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VPEXTRQ: bad operands") -} - -// VPEXTRW: Extract Word. -// -// Forms: -// -// VPEXTRW imm8 xmm r32 -// VPEXTRW imm8 xmm m16 -func VPEXTRW(i, x, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "VPEXTRW", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "VPEXTRW", - Operands: []operand.Op{i, x, mr}, - Inputs: []operand.Op{x}, - Outputs: []operand.Op{mr}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VPEXTRW: bad operands") -} - -// VPGATHERDD: Gather Packed Doubleword Values Using Signed Doubleword Indices. -// -// Forms: -// -// VPGATHERDD xmm vm32x xmm -// VPGATHERDD ymm vm32y ymm -func VPGATHERDD(xy, v, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(xy) && operand.IsVM32X(v) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPGATHERDD", - Operands: []operand.Op{xy, v, xy1}, - Inputs: []operand.Op{xy, v, xy1}, - Outputs: []operand.Op{xy, xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsYMM(xy) && operand.IsVM32Y(v) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPGATHERDD", - Operands: []operand.Op{xy, v, xy1}, - Inputs: []operand.Op{xy, v, xy1}, - Outputs: []operand.Op{xy, xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPGATHERDD: bad operands") -} - -// VPGATHERDQ: Gather Packed Quadword Values Using Signed Doubleword Indices. -// -// Forms: -// -// VPGATHERDQ xmm vm32x xmm -// VPGATHERDQ ymm vm32x ymm -func VPGATHERDQ(xy, v, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(xy) && operand.IsVM32X(v) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPGATHERDQ", - Operands: []operand.Op{xy, v, xy1}, - Inputs: []operand.Op{xy, v, xy1}, - Outputs: []operand.Op{xy, xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsYMM(xy) && operand.IsVM32X(v) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPGATHERDQ", - Operands: []operand.Op{xy, v, xy1}, - Inputs: []operand.Op{xy, v, xy1}, - Outputs: []operand.Op{xy, xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPGATHERDQ: bad operands") -} - -// VPGATHERQD: Gather Packed Doubleword Values Using Signed Quadword Indices. -// -// Forms: -// -// VPGATHERQD xmm vm64x xmm -// VPGATHERQD xmm vm64y xmm -func VPGATHERQD(x, v, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(x) && operand.IsVM64X(v) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VPGATHERQD", - Operands: []operand.Op{x, v, x1}, - Inputs: []operand.Op{x, v, x1}, - Outputs: []operand.Op{x, x1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsXMM(x) && operand.IsVM64Y(v) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VPGATHERQD", - Operands: []operand.Op{x, v, x1}, - Inputs: []operand.Op{x, v, x1}, - Outputs: []operand.Op{x, x1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPGATHERQD: bad operands") -} - -// VPGATHERQQ: Gather Packed Quadword Values Using Signed Quadword Indices. -// -// Forms: -// -// VPGATHERQQ xmm vm64x xmm -// VPGATHERQQ ymm vm64y ymm -func VPGATHERQQ(xy, v, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(xy) && operand.IsVM64X(v) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPGATHERQQ", - Operands: []operand.Op{xy, v, xy1}, - Inputs: []operand.Op{xy, v, xy1}, - Outputs: []operand.Op{xy, xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsYMM(xy) && operand.IsVM64Y(v) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPGATHERQQ", - Operands: []operand.Op{xy, v, xy1}, - Inputs: []operand.Op{xy, v, xy1}, - Outputs: []operand.Op{xy, xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPGATHERQQ: bad operands") -} - -// VPHADDD: Packed Horizontal Add Doubleword Integer. -// -// Forms: -// -// VPHADDD xmm xmm xmm -// VPHADDD m128 xmm xmm -// VPHADDD ymm ymm ymm -// VPHADDD m256 ymm ymm -func VPHADDD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHADDD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHADDD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHADDD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHADDD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPHADDD: bad operands") -} - -// VPHADDSW: Packed Horizontal Add Signed Word Integers with Signed Saturation. -// -// Forms: -// -// VPHADDSW xmm xmm xmm -// VPHADDSW m128 xmm xmm -// VPHADDSW ymm ymm ymm -// VPHADDSW m256 ymm ymm -func VPHADDSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHADDSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHADDSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHADDSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHADDSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPHADDSW: bad operands") -} - -// VPHADDW: Packed Horizontal Add Word Integers. -// -// Forms: -// -// VPHADDW xmm xmm xmm -// VPHADDW m128 xmm xmm -// VPHADDW ymm ymm ymm -// VPHADDW m256 ymm ymm -func VPHADDW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHADDW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHADDW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHADDW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHADDW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPHADDW: bad operands") -} - -// VPHMINPOSUW: Packed Horizontal Minimum of Unsigned Word Integers. -// -// Forms: -// -// VPHMINPOSUW xmm xmm -// VPHMINPOSUW m128 xmm -func VPHMINPOSUW(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VPHMINPOSUW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VPHMINPOSUW", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{x}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VPHMINPOSUW: bad operands") -} - -// VPHSUBD: Packed Horizontal Subtract Doubleword Integers. -// -// Forms: -// -// VPHSUBD xmm xmm xmm -// VPHSUBD m128 xmm xmm -// VPHSUBD ymm ymm ymm -// VPHSUBD m256 ymm ymm -func VPHSUBD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHSUBD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHSUBD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHSUBD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHSUBD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPHSUBD: bad operands") -} - -// VPHSUBSW: Packed Horizontal Subtract Signed Word Integers with Signed Saturation. -// -// Forms: -// -// VPHSUBSW xmm xmm xmm -// VPHSUBSW m128 xmm xmm -// VPHSUBSW ymm ymm ymm -// VPHSUBSW m256 ymm ymm -func VPHSUBSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHSUBSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHSUBSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHSUBSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHSUBSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPHSUBSW: bad operands") -} - -// VPHSUBW: Packed Horizontal Subtract Word Integers. -// -// Forms: -// -// VPHSUBW xmm xmm xmm -// VPHSUBW m128 xmm xmm -// VPHSUBW ymm ymm ymm -// VPHSUBW m256 ymm ymm -func VPHSUBW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHSUBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHSUBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHSUBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPHSUBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPHSUBW: bad operands") -} - -// VPINSRB: Insert Byte. -// -// Forms: -// -// VPINSRB imm8 r32 xmm xmm -// VPINSRB imm8 m8 xmm xmm -func VPINSRB(i, mr, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsR32(mr) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VPINSRB", - Operands: []operand.Op{i, mr, x, x1}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM8(mr) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VPINSRB", - Operands: []operand.Op{i, mr, x, x1}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VPINSRB: bad operands") -} - -// VPINSRD: Insert Doubleword. -// -// Forms: -// -// VPINSRD imm8 r32 xmm xmm -// VPINSRD imm8 m32 xmm xmm -func VPINSRD(i, mr, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsR32(mr) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VPINSRD", - Operands: []operand.Op{i, mr, x, x1}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM32(mr) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VPINSRD", - Operands: []operand.Op{i, mr, x, x1}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VPINSRD: bad operands") -} - -// VPINSRQ: Insert Quadword. -// -// Forms: -// -// VPINSRQ imm8 r64 xmm xmm -// VPINSRQ imm8 m64 xmm xmm -func VPINSRQ(i, mr, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsR64(mr) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VPINSRQ", - Operands: []operand.Op{i, mr, x, x1}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM64(mr) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VPINSRQ", - Operands: []operand.Op{i, mr, x, x1}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VPINSRQ: bad operands") -} - -// VPINSRW: Insert Word. -// -// Forms: -// -// VPINSRW imm8 r32 xmm xmm -// VPINSRW imm8 m16 xmm xmm -func VPINSRW(i, mr, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsR32(mr) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VPINSRW", - Operands: []operand.Op{i, mr, x, x1}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM16(mr) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VPINSRW", - Operands: []operand.Op{i, mr, x, x1}, - Inputs: []operand.Op{mr, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VPINSRW: bad operands") -} - -// VPMADDUBSW: Multiply and Add Packed Signed and Unsigned Byte Integers. -// -// Forms: -// -// VPMADDUBSW xmm xmm xmm -// VPMADDUBSW m128 xmm xmm -// VPMADDUBSW ymm ymm ymm -// VPMADDUBSW m256 ymm ymm -func VPMADDUBSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMADDUBSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMADDUBSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMADDUBSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMADDUBSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMADDUBSW: bad operands") -} - -// VPMADDWD: Multiply and Add Packed Signed Word Integers. -// -// Forms: -// -// VPMADDWD xmm xmm xmm -// VPMADDWD m128 xmm xmm -// VPMADDWD ymm ymm ymm -// VPMADDWD m256 ymm ymm -func VPMADDWD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMADDWD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMADDWD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMADDWD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMADDWD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMADDWD: bad operands") -} - -// VPMASKMOVD: Conditional Move Packed Doubleword Integers. -// -// Forms: -// -// VPMASKMOVD m128 xmm xmm -// VPMASKMOVD m256 ymm ymm -// VPMASKMOVD xmm xmm m128 -// VPMASKMOVD ymm ymm m256 -func VPMASKMOVD(mxy, xy, mxy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(mxy1): - return &intrep.Instruction{ - Opcode: "VPMASKMOVD", - Operands: []operand.Op{mxy, xy, mxy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(mxy1): - return &intrep.Instruction{ - Opcode: "VPMASKMOVD", - Operands: []operand.Op{mxy, xy, mxy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsM128(mxy1): - return &intrep.Instruction{ - Opcode: "VPMASKMOVD", - Operands: []operand.Op{mxy, xy, mxy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsM256(mxy1): - return &intrep.Instruction{ - Opcode: "VPMASKMOVD", - Operands: []operand.Op{mxy, xy, mxy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMASKMOVD: bad operands") -} - -// VPMASKMOVQ: Conditional Move Packed Quadword Integers. -// -// Forms: -// -// VPMASKMOVQ m128 xmm xmm -// VPMASKMOVQ m256 ymm ymm -// VPMASKMOVQ xmm xmm m128 -// VPMASKMOVQ ymm ymm m256 -func VPMASKMOVQ(mxy, xy, mxy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(mxy1): - return &intrep.Instruction{ - Opcode: "VPMASKMOVQ", - Operands: []operand.Op{mxy, xy, mxy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(mxy1): - return &intrep.Instruction{ - Opcode: "VPMASKMOVQ", - Operands: []operand.Op{mxy, xy, mxy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsM128(mxy1): - return &intrep.Instruction{ - Opcode: "VPMASKMOVQ", - Operands: []operand.Op{mxy, xy, mxy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsM256(mxy1): - return &intrep.Instruction{ - Opcode: "VPMASKMOVQ", - Operands: []operand.Op{mxy, xy, mxy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{mxy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMASKMOVQ: bad operands") -} - -// VPMAXSB: Maximum of Packed Signed Byte Integers. -// -// Forms: -// -// VPMAXSB xmm xmm xmm -// VPMAXSB m128 xmm xmm -// VPMAXSB ymm ymm ymm -// VPMAXSB m256 ymm ymm -func VPMAXSB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMAXSB: bad operands") -} - -// VPMAXSD: Maximum of Packed Signed Doubleword Integers. -// -// Forms: -// -// VPMAXSD xmm xmm xmm -// VPMAXSD m128 xmm xmm -// VPMAXSD ymm ymm ymm -// VPMAXSD m256 ymm ymm -func VPMAXSD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXSD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXSD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXSD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXSD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMAXSD: bad operands") -} - -// VPMAXSW: Maximum of Packed Signed Word Integers. -// -// Forms: -// -// VPMAXSW xmm xmm xmm -// VPMAXSW m128 xmm xmm -// VPMAXSW ymm ymm ymm -// VPMAXSW m256 ymm ymm -func VPMAXSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMAXSW: bad operands") -} - -// VPMAXUB: Maximum of Packed Unsigned Byte Integers. -// -// Forms: -// -// VPMAXUB xmm xmm xmm -// VPMAXUB m128 xmm xmm -// VPMAXUB ymm ymm ymm -// VPMAXUB m256 ymm ymm -func VPMAXUB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXUB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXUB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXUB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXUB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMAXUB: bad operands") -} - -// VPMAXUD: Maximum of Packed Unsigned Doubleword Integers. -// -// Forms: -// -// VPMAXUD xmm xmm xmm -// VPMAXUD m128 xmm xmm -// VPMAXUD ymm ymm ymm -// VPMAXUD m256 ymm ymm -func VPMAXUD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXUD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXUD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXUD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXUD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMAXUD: bad operands") -} - -// VPMAXUW: Maximum of Packed Unsigned Word Integers. -// -// Forms: -// -// VPMAXUW xmm xmm xmm -// VPMAXUW m128 xmm xmm -// VPMAXUW ymm ymm ymm -// VPMAXUW m256 ymm ymm -func VPMAXUW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXUW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXUW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXUW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMAXUW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMAXUW: bad operands") -} - -// VPMINSB: Minimum of Packed Signed Byte Integers. -// -// Forms: -// -// VPMINSB xmm xmm xmm -// VPMINSB m128 xmm xmm -// VPMINSB ymm ymm ymm -// VPMINSB m256 ymm ymm -func VPMINSB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMINSB: bad operands") -} - -// VPMINSD: Minimum of Packed Signed Doubleword Integers. -// -// Forms: -// -// VPMINSD xmm xmm xmm -// VPMINSD m128 xmm xmm -// VPMINSD ymm ymm ymm -// VPMINSD m256 ymm ymm -func VPMINSD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINSD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINSD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINSD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINSD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMINSD: bad operands") -} - -// VPMINSW: Minimum of Packed Signed Word Integers. -// -// Forms: -// -// VPMINSW xmm xmm xmm -// VPMINSW m128 xmm xmm -// VPMINSW ymm ymm ymm -// VPMINSW m256 ymm ymm -func VPMINSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMINSW: bad operands") -} - -// VPMINUB: Minimum of Packed Unsigned Byte Integers. -// -// Forms: -// -// VPMINUB xmm xmm xmm -// VPMINUB m128 xmm xmm -// VPMINUB ymm ymm ymm -// VPMINUB m256 ymm ymm -func VPMINUB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINUB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINUB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINUB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINUB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMINUB: bad operands") -} - -// VPMINUD: Minimum of Packed Unsigned Doubleword Integers. -// -// Forms: -// -// VPMINUD xmm xmm xmm -// VPMINUD m128 xmm xmm -// VPMINUD ymm ymm ymm -// VPMINUD m256 ymm ymm -func VPMINUD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINUD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINUD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINUD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINUD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMINUD: bad operands") -} - -// VPMINUW: Minimum of Packed Unsigned Word Integers. -// -// Forms: -// -// VPMINUW xmm xmm xmm -// VPMINUW m128 xmm xmm -// VPMINUW ymm ymm ymm -// VPMINUW m256 ymm ymm -func VPMINUW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINUW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINUW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINUW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMINUW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMINUW: bad operands") -} - -// VPMOVMSKB: Move Byte Mask. -// -// Forms: -// -// VPMOVMSKB xmm r32 -// VPMOVMSKB ymm r32 -func VPMOVMSKB(xy, r operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(xy) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "VPMOVMSKB", - Operands: []operand.Op{xy, r}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(xy) && operand.IsR32(r): - return &intrep.Instruction{ - Opcode: "VPMOVMSKB", - Operands: []operand.Op{xy, r}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{r}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMOVMSKB: bad operands") -} - -// VPMOVSXBD: Move Packed Byte Integers to Doubleword Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXBD xmm xmm -// VPMOVSXBD m32 xmm -// VPMOVSXBD xmm ymm -// VPMOVSXBD m64 ymm -func VPMOVSXBD(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXBD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXBD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXBD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM64(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXBD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMOVSXBD: bad operands") -} - -// VPMOVSXBQ: Move Packed Byte Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXBQ xmm xmm -// VPMOVSXBQ m16 xmm -// VPMOVSXBQ xmm ymm -// VPMOVSXBQ m32 ymm -func VPMOVSXBQ(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXBQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM16(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXBQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXBQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM32(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXBQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMOVSXBQ: bad operands") -} - -// VPMOVSXBW: Move Packed Byte Integers to Word Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXBW xmm xmm -// VPMOVSXBW m64 xmm -// VPMOVSXBW xmm ymm -// VPMOVSXBW m128 ymm -func VPMOVSXBW(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXBW", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXBW", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXBW", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXBW", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMOVSXBW: bad operands") -} - -// VPMOVSXDQ: Move Packed Doubleword Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXDQ xmm xmm -// VPMOVSXDQ m64 xmm -// VPMOVSXDQ xmm ymm -// VPMOVSXDQ m128 ymm -func VPMOVSXDQ(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXDQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXDQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXDQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXDQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMOVSXDQ: bad operands") -} - -// VPMOVSXWD: Move Packed Word Integers to Doubleword Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXWD xmm xmm -// VPMOVSXWD m64 xmm -// VPMOVSXWD xmm ymm -// VPMOVSXWD m128 ymm -func VPMOVSXWD(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXWD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXWD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXWD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXWD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMOVSXWD: bad operands") -} - -// VPMOVSXWQ: Move Packed Word Integers to Quadword Integers with Sign Extension. -// -// Forms: -// -// VPMOVSXWQ xmm xmm -// VPMOVSXWQ m32 xmm -// VPMOVSXWQ xmm ymm -// VPMOVSXWQ m64 ymm -func VPMOVSXWQ(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXWQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXWQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXWQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM64(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVSXWQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMOVSXWQ: bad operands") -} - -// VPMOVZXBD: Move Packed Byte Integers to Doubleword Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXBD xmm xmm -// VPMOVZXBD m32 xmm -// VPMOVZXBD xmm ymm -// VPMOVZXBD m64 ymm -func VPMOVZXBD(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXBD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXBD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXBD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM64(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXBD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMOVZXBD: bad operands") -} - -// VPMOVZXBQ: Move Packed Byte Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXBQ xmm xmm -// VPMOVZXBQ m16 xmm -// VPMOVZXBQ xmm ymm -// VPMOVZXBQ m32 ymm -func VPMOVZXBQ(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXBQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM16(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXBQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXBQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM32(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXBQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMOVZXBQ: bad operands") -} - -// VPMOVZXBW: Move Packed Byte Integers to Word Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXBW xmm xmm -// VPMOVZXBW m64 xmm -// VPMOVZXBW xmm ymm -// VPMOVZXBW m128 ymm -func VPMOVZXBW(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXBW", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXBW", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXBW", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXBW", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMOVZXBW: bad operands") -} - -// VPMOVZXDQ: Move Packed Doubleword Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXDQ xmm xmm -// VPMOVZXDQ m64 xmm -// VPMOVZXDQ xmm ymm -// VPMOVZXDQ m128 ymm -func VPMOVZXDQ(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXDQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXDQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXDQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXDQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMOVZXDQ: bad operands") -} - -// VPMOVZXWD: Move Packed Word Integers to Doubleword Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXWD xmm xmm -// VPMOVZXWD m64 xmm -// VPMOVZXWD xmm ymm -// VPMOVZXWD m128 ymm -func VPMOVZXWD(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXWD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXWD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXWD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXWD", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMOVZXWD: bad operands") -} - -// VPMOVZXWQ: Move Packed Word Integers to Quadword Integers with Zero Extension. -// -// Forms: -// -// VPMOVZXWQ xmm xmm -// VPMOVZXWQ m32 xmm -// VPMOVZXWQ xmm ymm -// VPMOVZXWQ m64 ymm -func VPMOVZXWQ(mx, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXWQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXWQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXWQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM64(mx) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPMOVZXWQ", - Operands: []operand.Op{mx, xy}, - Inputs: []operand.Op{mx}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMOVZXWQ: bad operands") -} - -// VPMULDQ: Multiply Packed Signed Doubleword Integers and Store Quadword Result. -// -// Forms: -// -// VPMULDQ xmm xmm xmm -// VPMULDQ m128 xmm xmm -// VPMULDQ ymm ymm ymm -// VPMULDQ m256 ymm ymm -func VPMULDQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMULDQ: bad operands") -} - -// VPMULHRSW: Packed Multiply Signed Word Integers and Store High Result with Round and Scale. -// -// Forms: -// -// VPMULHRSW xmm xmm xmm -// VPMULHRSW m128 xmm xmm -// VPMULHRSW ymm ymm ymm -// VPMULHRSW m256 ymm ymm -func VPMULHRSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULHRSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULHRSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULHRSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULHRSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMULHRSW: bad operands") -} - -// VPMULHUW: Multiply Packed Unsigned Word Integers and Store High Result. -// -// Forms: -// -// VPMULHUW xmm xmm xmm -// VPMULHUW m128 xmm xmm -// VPMULHUW ymm ymm ymm -// VPMULHUW m256 ymm ymm -func VPMULHUW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULHUW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULHUW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULHUW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULHUW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMULHUW: bad operands") -} - -// VPMULHW: Multiply Packed Signed Word Integers and Store High Result. -// -// Forms: -// -// VPMULHW xmm xmm xmm -// VPMULHW m128 xmm xmm -// VPMULHW ymm ymm ymm -// VPMULHW m256 ymm ymm -func VPMULHW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULHW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULHW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULHW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULHW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMULHW: bad operands") -} - -// VPMULLD: Multiply Packed Signed Doubleword Integers and Store Low Result. -// -// Forms: -// -// VPMULLD xmm xmm xmm -// VPMULLD m128 xmm xmm -// VPMULLD ymm ymm ymm -// VPMULLD m256 ymm ymm -func VPMULLD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULLD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULLD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULLD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULLD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMULLD: bad operands") -} - -// VPMULLW: Multiply Packed Signed Word Integers and Store Low Result. -// -// Forms: -// -// VPMULLW xmm xmm xmm -// VPMULLW m128 xmm xmm -// VPMULLW ymm ymm ymm -// VPMULLW m256 ymm ymm -func VPMULLW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULLW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULLW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULLW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULLW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMULLW: bad operands") -} - -// VPMULUDQ: Multiply Packed Unsigned Doubleword Integers. -// -// Forms: -// -// VPMULUDQ xmm xmm xmm -// VPMULUDQ m128 xmm xmm -// VPMULUDQ ymm ymm ymm -// VPMULUDQ m256 ymm ymm -func VPMULUDQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULUDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULUDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULUDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPMULUDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPMULUDQ: bad operands") -} - -// VPOR: Packed Bitwise Logical OR. -// -// Forms: -// -// VPOR xmm xmm xmm -// VPOR m128 xmm xmm -// VPOR ymm ymm ymm -// VPOR m256 ymm ymm -func VPOR(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPOR", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPOR", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPOR", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPOR", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPOR: bad operands") -} - -// VPSADBW: Compute Sum of Absolute Differences. -// -// Forms: -// -// VPSADBW xmm xmm xmm -// VPSADBW m128 xmm xmm -// VPSADBW ymm ymm ymm -// VPSADBW m256 ymm ymm -func VPSADBW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSADBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSADBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSADBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSADBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSADBW: bad operands") -} - -// VPSHUFB: Packed Shuffle Bytes. -// -// Forms: -// -// VPSHUFB xmm xmm xmm -// VPSHUFB m128 xmm xmm -// VPSHUFB ymm ymm ymm -// VPSHUFB m256 ymm ymm -func VPSHUFB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSHUFB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSHUFB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSHUFB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSHUFB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSHUFB: bad operands") -} - -// VPSHUFD: Shuffle Packed Doublewords. -// -// Forms: -// -// VPSHUFD imm8 xmm xmm -// VPSHUFD imm8 m128 xmm -// VPSHUFD imm8 ymm ymm -// VPSHUFD imm8 m256 ymm -func VPSHUFD(i, mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPSHUFD", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPSHUFD", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPSHUFD", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPSHUFD", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSHUFD: bad operands") -} - -// VPSHUFHW: Shuffle Packed High Words. -// -// Forms: -// -// VPSHUFHW imm8 xmm xmm -// VPSHUFHW imm8 m128 xmm -// VPSHUFHW imm8 ymm ymm -// VPSHUFHW imm8 m256 ymm -func VPSHUFHW(i, mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPSHUFHW", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPSHUFHW", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPSHUFHW", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPSHUFHW", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSHUFHW: bad operands") -} - -// VPSHUFLW: Shuffle Packed Low Words. -// -// Forms: -// -// VPSHUFLW imm8 xmm xmm -// VPSHUFLW imm8 m128 xmm -// VPSHUFLW imm8 ymm ymm -// VPSHUFLW imm8 m256 ymm -func VPSHUFLW(i, mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPSHUFLW", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPSHUFLW", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPSHUFLW", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPSHUFLW", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSHUFLW: bad operands") -} - -// VPSIGNB: Packed Sign of Byte Integers. -// -// Forms: -// -// VPSIGNB xmm xmm xmm -// VPSIGNB m128 xmm xmm -// VPSIGNB ymm ymm ymm -// VPSIGNB m256 ymm ymm -func VPSIGNB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSIGNB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSIGNB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSIGNB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSIGNB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSIGNB: bad operands") -} - -// VPSIGND: Packed Sign of Doubleword Integers. -// -// Forms: -// -// VPSIGND xmm xmm xmm -// VPSIGND m128 xmm xmm -// VPSIGND ymm ymm ymm -// VPSIGND m256 ymm ymm -func VPSIGND(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSIGND", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSIGND", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSIGND", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSIGND", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSIGND: bad operands") -} - -// VPSIGNW: Packed Sign of Word Integers. -// -// Forms: -// -// VPSIGNW xmm xmm xmm -// VPSIGNW m128 xmm xmm -// VPSIGNW ymm ymm ymm -// VPSIGNW m256 ymm ymm -func VPSIGNW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSIGNW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSIGNW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSIGNW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSIGNW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSIGNW: bad operands") -} - -// VPSLLD: Shift Packed Doubleword Data Left Logical. -// -// Forms: -// -// VPSLLD imm8 xmm xmm -// VPSLLD xmm xmm xmm -// VPSLLD m128 xmm xmm -// VPSLLD imm8 ymm ymm -// VPSLLD xmm ymm ymm -// VPSLLD m128 ymm ymm -func VPSLLD(imx, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsXMM(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSLLD: bad operands") -} - -// VPSLLDQ: Shift Packed Double Quadword Left Logical. -// -// Forms: -// -// VPSLLDQ imm8 xmm xmm -// VPSLLDQ imm8 ymm ymm -func VPSLLDQ(i, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLDQ", - Operands: []operand.Op{i, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLDQ", - Operands: []operand.Op{i, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSLLDQ: bad operands") -} - -// VPSLLQ: Shift Packed Quadword Data Left Logical. -// -// Forms: -// -// VPSLLQ imm8 xmm xmm -// VPSLLQ xmm xmm xmm -// VPSLLQ m128 xmm xmm -// VPSLLQ imm8 ymm ymm -// VPSLLQ xmm ymm ymm -// VPSLLQ m128 ymm ymm -func VPSLLQ(imx, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLQ", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLQ", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLQ", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLQ", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsXMM(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLQ", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLQ", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSLLQ: bad operands") -} - -// VPSLLVD: Variable Shift Packed Doubleword Data Left Logical. -// -// Forms: -// -// VPSLLVD xmm xmm xmm -// VPSLLVD m128 xmm xmm -// VPSLLVD ymm ymm ymm -// VPSLLVD m256 ymm ymm -func VPSLLVD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLVD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLVD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLVD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLVD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSLLVD: bad operands") -} - -// VPSLLVQ: Variable Shift Packed Quadword Data Left Logical. -// -// Forms: -// -// VPSLLVQ xmm xmm xmm -// VPSLLVQ m128 xmm xmm -// VPSLLVQ ymm ymm ymm -// VPSLLVQ m256 ymm ymm -func VPSLLVQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLVQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLVQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLVQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLVQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSLLVQ: bad operands") -} - -// VPSLLW: Shift Packed Word Data Left Logical. -// -// Forms: -// -// VPSLLW imm8 xmm xmm -// VPSLLW xmm xmm xmm -// VPSLLW m128 xmm xmm -// VPSLLW imm8 ymm ymm -// VPSLLW xmm ymm ymm -// VPSLLW m128 ymm ymm -func VPSLLW(imx, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsXMM(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSLLW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSLLW: bad operands") -} - -// VPSRAD: Shift Packed Doubleword Data Right Arithmetic. -// -// Forms: -// -// VPSRAD imm8 xmm xmm -// VPSRAD xmm xmm xmm -// VPSRAD m128 xmm xmm -// VPSRAD imm8 ymm ymm -// VPSRAD xmm ymm ymm -// VPSRAD m128 ymm ymm -func VPSRAD(imx, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRAD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRAD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRAD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRAD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsXMM(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRAD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRAD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSRAD: bad operands") -} - -// VPSRAVD: Variable Shift Packed Doubleword Data Right Arithmetic. -// -// Forms: -// -// VPSRAVD xmm xmm xmm -// VPSRAVD m128 xmm xmm -// VPSRAVD ymm ymm ymm -// VPSRAVD m256 ymm ymm -func VPSRAVD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRAVD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRAVD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRAVD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRAVD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSRAVD: bad operands") -} - -// VPSRAW: Shift Packed Word Data Right Arithmetic. -// -// Forms: -// -// VPSRAW imm8 xmm xmm -// VPSRAW xmm xmm xmm -// VPSRAW m128 xmm xmm -// VPSRAW imm8 ymm ymm -// VPSRAW xmm ymm ymm -// VPSRAW m128 ymm ymm -func VPSRAW(imx, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRAW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRAW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRAW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRAW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsXMM(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRAW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRAW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSRAW: bad operands") -} - -// VPSRLD: Shift Packed Doubleword Data Right Logical. -// -// Forms: -// -// VPSRLD imm8 xmm xmm -// VPSRLD xmm xmm xmm -// VPSRLD m128 xmm xmm -// VPSRLD imm8 ymm ymm -// VPSRLD xmm ymm ymm -// VPSRLD m128 ymm ymm -func VPSRLD(imx, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsXMM(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLD", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSRLD: bad operands") -} - -// VPSRLDQ: Shift Packed Double Quadword Right Logical. -// -// Forms: -// -// VPSRLDQ imm8 xmm xmm -// VPSRLDQ imm8 ymm ymm -func VPSRLDQ(i, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLDQ", - Operands: []operand.Op{i, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLDQ", - Operands: []operand.Op{i, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSRLDQ: bad operands") -} - -// VPSRLQ: Shift Packed Quadword Data Right Logical. -// -// Forms: -// -// VPSRLQ imm8 xmm xmm -// VPSRLQ xmm xmm xmm -// VPSRLQ m128 xmm xmm -// VPSRLQ imm8 ymm ymm -// VPSRLQ xmm ymm ymm -// VPSRLQ m128 ymm ymm -func VPSRLQ(imx, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLQ", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLQ", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLQ", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLQ", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsXMM(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLQ", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLQ", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSRLQ: bad operands") -} - -// VPSRLVD: Variable Shift Packed Doubleword Data Right Logical. -// -// Forms: -// -// VPSRLVD xmm xmm xmm -// VPSRLVD m128 xmm xmm -// VPSRLVD ymm ymm ymm -// VPSRLVD m256 ymm ymm -func VPSRLVD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLVD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLVD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLVD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLVD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSRLVD: bad operands") -} - -// VPSRLVQ: Variable Shift Packed Quadword Data Right Logical. -// -// Forms: -// -// VPSRLVQ xmm xmm xmm -// VPSRLVQ m128 xmm xmm -// VPSRLVQ ymm ymm ymm -// VPSRLVQ m256 ymm ymm -func VPSRLVQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLVQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLVQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLVQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLVQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSRLVQ: bad operands") -} - -// VPSRLW: Shift Packed Word Data Right Logical. -// -// Forms: -// -// VPSRLW imm8 xmm xmm -// VPSRLW xmm xmm xmm -// VPSRLW m128 xmm xmm -// VPSRLW imm8 ymm ymm -// VPSRLW xmm ymm ymm -// VPSRLW m128 ymm ymm -func VPSRLW(imx, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsXMM(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsXMM(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM128(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSRLW", - Operands: []operand.Op{imx, xy, xy1}, - Inputs: []operand.Op{imx, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSRLW: bad operands") -} - -// VPSUBB: Subtract Packed Byte Integers. -// -// Forms: -// -// VPSUBB xmm xmm xmm -// VPSUBB m128 xmm xmm -// VPSUBB ymm ymm ymm -// VPSUBB m256 ymm ymm -func VPSUBB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSUBB: bad operands") -} - -// VPSUBD: Subtract Packed Doubleword Integers. -// -// Forms: -// -// VPSUBD xmm xmm xmm -// VPSUBD m128 xmm xmm -// VPSUBD ymm ymm ymm -// VPSUBD m256 ymm ymm -func VPSUBD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSUBD: bad operands") -} - -// VPSUBQ: Subtract Packed Quadword Integers. -// -// Forms: -// -// VPSUBQ xmm xmm xmm -// VPSUBQ m128 xmm xmm -// VPSUBQ ymm ymm ymm -// VPSUBQ m256 ymm ymm -func VPSUBQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSUBQ: bad operands") -} - -// VPSUBSB: Subtract Packed Signed Byte Integers with Signed Saturation. -// -// Forms: -// -// VPSUBSB xmm xmm xmm -// VPSUBSB m128 xmm xmm -// VPSUBSB ymm ymm ymm -// VPSUBSB m256 ymm ymm -func VPSUBSB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSUBSB: bad operands") -} - -// VPSUBSW: Subtract Packed Signed Word Integers with Signed Saturation. -// -// Forms: -// -// VPSUBSW xmm xmm xmm -// VPSUBSW m128 xmm xmm -// VPSUBSW ymm ymm ymm -// VPSUBSW m256 ymm ymm -func VPSUBSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSUBSW: bad operands") -} - -// VPSUBUSB: Subtract Packed Unsigned Byte Integers with Unsigned Saturation. -// -// Forms: -// -// VPSUBUSB xmm xmm xmm -// VPSUBUSB m128 xmm xmm -// VPSUBUSB ymm ymm ymm -// VPSUBUSB m256 ymm ymm -func VPSUBUSB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBUSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBUSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBUSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBUSB", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSUBUSB: bad operands") -} - -// VPSUBUSW: Subtract Packed Unsigned Word Integers with Unsigned Saturation. -// -// Forms: -// -// VPSUBUSW xmm xmm xmm -// VPSUBUSW m128 xmm xmm -// VPSUBUSW ymm ymm ymm -// VPSUBUSW m256 ymm ymm -func VPSUBUSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBUSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBUSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBUSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBUSW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSUBUSW: bad operands") -} - -// VPSUBW: Subtract Packed Word Integers. -// -// Forms: -// -// VPSUBW xmm xmm xmm -// VPSUBW m128 xmm xmm -// VPSUBW ymm ymm ymm -// VPSUBW m256 ymm ymm -func VPSUBW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPSUBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPSUBW: bad operands") -} - -// VPTEST: Packed Logical Compare. -// -// Forms: -// -// VPTEST xmm xmm -// VPTEST m128 xmm -// VPTEST ymm ymm -// VPTEST m256 ymm -func VPTEST(mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPTEST", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VPTEST", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPTEST", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VPTEST", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VPTEST: bad operands") -} - -// VPUNPCKHBW: Unpack and Interleave High-Order Bytes into Words. -// -// Forms: -// -// VPUNPCKHBW xmm xmm xmm -// VPUNPCKHBW m128 xmm xmm -// VPUNPCKHBW ymm ymm ymm -// VPUNPCKHBW m256 ymm ymm -func VPUNPCKHBW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKHBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKHBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKHBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKHBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPUNPCKHBW: bad operands") -} - -// VPUNPCKHDQ: Unpack and Interleave High-Order Doublewords into Quadwords. -// -// Forms: -// -// VPUNPCKHDQ xmm xmm xmm -// VPUNPCKHDQ m128 xmm xmm -// VPUNPCKHDQ ymm ymm ymm -// VPUNPCKHDQ m256 ymm ymm -func VPUNPCKHDQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKHDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKHDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKHDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKHDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPUNPCKHDQ: bad operands") -} - -// VPUNPCKHQDQ: Unpack and Interleave High-Order Quadwords into Double Quadwords. -// -// Forms: -// -// VPUNPCKHQDQ xmm xmm xmm -// VPUNPCKHQDQ m128 xmm xmm -// VPUNPCKHQDQ ymm ymm ymm -// VPUNPCKHQDQ m256 ymm ymm -func VPUNPCKHQDQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKHQDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKHQDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKHQDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKHQDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPUNPCKHQDQ: bad operands") -} - -// VPUNPCKHWD: Unpack and Interleave High-Order Words into Doublewords. -// -// Forms: -// -// VPUNPCKHWD xmm xmm xmm -// VPUNPCKHWD m128 xmm xmm -// VPUNPCKHWD ymm ymm ymm -// VPUNPCKHWD m256 ymm ymm -func VPUNPCKHWD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKHWD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKHWD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKHWD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKHWD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPUNPCKHWD: bad operands") -} - -// VPUNPCKLBW: Unpack and Interleave Low-Order Bytes into Words. -// -// Forms: -// -// VPUNPCKLBW xmm xmm xmm -// VPUNPCKLBW m128 xmm xmm -// VPUNPCKLBW ymm ymm ymm -// VPUNPCKLBW m256 ymm ymm -func VPUNPCKLBW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKLBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKLBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKLBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKLBW", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPUNPCKLBW: bad operands") -} - -// VPUNPCKLDQ: Unpack and Interleave Low-Order Doublewords into Quadwords. -// -// Forms: -// -// VPUNPCKLDQ xmm xmm xmm -// VPUNPCKLDQ m128 xmm xmm -// VPUNPCKLDQ ymm ymm ymm -// VPUNPCKLDQ m256 ymm ymm -func VPUNPCKLDQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKLDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKLDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKLDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKLDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPUNPCKLDQ: bad operands") -} - -// VPUNPCKLQDQ: Unpack and Interleave Low-Order Quadwords into Double Quadwords. -// -// Forms: -// -// VPUNPCKLQDQ xmm xmm xmm -// VPUNPCKLQDQ m128 xmm xmm -// VPUNPCKLQDQ ymm ymm ymm -// VPUNPCKLQDQ m256 ymm ymm -func VPUNPCKLQDQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKLQDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKLQDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKLQDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKLQDQ", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPUNPCKLQDQ: bad operands") -} - -// VPUNPCKLWD: Unpack and Interleave Low-Order Words into Doublewords. -// -// Forms: -// -// VPUNPCKLWD xmm xmm xmm -// VPUNPCKLWD m128 xmm xmm -// VPUNPCKLWD ymm ymm ymm -// VPUNPCKLWD m256 ymm ymm -func VPUNPCKLWD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKLWD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKLWD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKLWD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPUNPCKLWD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPUNPCKLWD: bad operands") -} - -// VPXOR: Packed Bitwise Logical Exclusive OR. -// -// Forms: -// -// VPXOR xmm xmm xmm -// VPXOR m128 xmm xmm -// VPXOR ymm ymm ymm -// VPXOR m256 ymm ymm -func VPXOR(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPXOR", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VPXOR", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPXOR", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VPXOR", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX2"}, - }, nil - } - return nil, errors.New("VPXOR: bad operands") -} - -// VRCPPS: Compute Approximate Reciprocals of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VRCPPS xmm xmm -// VRCPPS m128 xmm -// VRCPPS ymm ymm -// VRCPPS m256 ymm -func VRCPPS(mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VRCPPS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VRCPPS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VRCPPS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VRCPPS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VRCPPS: bad operands") -} - -// VRCPSS: Compute Approximate Reciprocal of Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VRCPSS xmm xmm xmm -// VRCPSS m32 xmm xmm -func VRCPSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VRCPSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VRCPSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VRCPSS: bad operands") -} - -// VROUNDPD: Round Packed Double Precision Floating-Point Values. -// -// Forms: -// -// VROUNDPD imm8 xmm xmm -// VROUNDPD imm8 m128 xmm -// VROUNDPD imm8 ymm ymm -// VROUNDPD imm8 m256 ymm -func VROUNDPD(i, mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VROUNDPD", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VROUNDPD", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VROUNDPD", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VROUNDPD", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VROUNDPD: bad operands") -} - -// VROUNDPS: Round Packed Single Precision Floating-Point Values. -// -// Forms: -// -// VROUNDPS imm8 xmm xmm -// VROUNDPS imm8 m128 xmm -// VROUNDPS imm8 ymm ymm -// VROUNDPS imm8 m256 ymm -func VROUNDPS(i, mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VROUNDPS", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VROUNDPS", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VROUNDPS", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VROUNDPS", - Operands: []operand.Op{i, mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VROUNDPS: bad operands") -} - -// VROUNDSD: Round Scalar Double Precision Floating-Point Values. -// -// Forms: -// -// VROUNDSD imm8 xmm xmm xmm -// VROUNDSD imm8 m64 xmm xmm -func VROUNDSD(i, mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VROUNDSD", - Operands: []operand.Op{i, mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VROUNDSD", - Operands: []operand.Op{i, mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VROUNDSD: bad operands") -} - -// VROUNDSS: Round Scalar Single Precision Floating-Point Values. -// -// Forms: -// -// VROUNDSS imm8 xmm xmm xmm -// VROUNDSS imm8 m32 xmm xmm -func VROUNDSS(i, mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VROUNDSS", - Operands: []operand.Op{i, mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VROUNDSS", - Operands: []operand.Op{i, mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VROUNDSS: bad operands") -} - -// VRSQRTPS: Compute Reciprocals of Square Roots of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VRSQRTPS xmm xmm -// VRSQRTPS m128 xmm -// VRSQRTPS ymm ymm -// VRSQRTPS m256 ymm -func VRSQRTPS(mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VRSQRTPS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VRSQRTPS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VRSQRTPS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VRSQRTPS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VRSQRTPS: bad operands") -} - -// VRSQRTSS: Compute Reciprocal of Square Root of Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// VRSQRTSS xmm xmm xmm -// VRSQRTSS m32 xmm xmm -func VRSQRTSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VRSQRTSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VRSQRTSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VRSQRTSS: bad operands") -} - -// VSHUFPD: Shuffle Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VSHUFPD imm8 xmm xmm xmm -// VSHUFPD imm8 m128 xmm xmm -// VSHUFPD imm8 ymm ymm ymm -// VSHUFPD imm8 m256 ymm ymm -func VSHUFPD(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VSHUFPD", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VSHUFPD", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VSHUFPD", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VSHUFPD", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VSHUFPD: bad operands") -} - -// VSHUFPS: Shuffle Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VSHUFPS imm8 xmm xmm xmm -// VSHUFPS imm8 m128 xmm xmm -// VSHUFPS imm8 ymm ymm ymm -// VSHUFPS imm8 m256 ymm ymm -func VSHUFPS(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VSHUFPS", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VSHUFPS", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VSHUFPS", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VSHUFPS", - Operands: []operand.Op{i, mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VSHUFPS: bad operands") -} - -// VSQRTPD: Compute Square Roots of Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VSQRTPD xmm xmm -// VSQRTPD m128 xmm -// VSQRTPD ymm ymm -// VSQRTPD m256 ymm -func VSQRTPD(mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VSQRTPD", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VSQRTPD", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VSQRTPD", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VSQRTPD", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VSQRTPD: bad operands") -} - -// VSQRTPS: Compute Square Roots of Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VSQRTPS xmm xmm -// VSQRTPS m128 xmm -// VSQRTPS ymm ymm -// VSQRTPS m256 ymm -func VSQRTPS(mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VSQRTPS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VSQRTPS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VSQRTPS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VSQRTPS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy}, - Outputs: []operand.Op{xy}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VSQRTPS: bad operands") -} - -// VSQRTSD: Compute Square Root of Scalar Double-Precision Floating-Point Value. -// -// Forms: -// -// VSQRTSD xmm xmm xmm -// VSQRTSD m64 xmm xmm -func VSQRTSD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VSQRTSD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VSQRTSD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VSQRTSD: bad operands") -} - -// VSQRTSS: Compute Square Root of Scalar Single-Precision Floating-Point Value. -// -// Forms: -// -// VSQRTSS xmm xmm xmm -// VSQRTSS m32 xmm xmm -func VSQRTSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VSQRTSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VSQRTSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VSQRTSS: bad operands") -} - -// VSTMXCSR: Store MXCSR Register State. -// -// Forms: -// -// VSTMXCSR m32 -func VSTMXCSR(m operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsM32(m): - return &intrep.Instruction{ - Opcode: "VSTMXCSR", - Operands: []operand.Op{m}, - Inputs: []operand.Op{}, - Outputs: []operand.Op{m}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VSTMXCSR: bad operands") -} - -// VSUBPD: Subtract Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VSUBPD xmm xmm xmm -// VSUBPD m128 xmm xmm -// VSUBPD ymm ymm ymm -// VSUBPD m256 ymm ymm -func VSUBPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VSUBPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VSUBPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VSUBPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VSUBPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VSUBPD: bad operands") -} - -// VSUBPS: Subtract Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VSUBPS xmm xmm xmm -// VSUBPS m128 xmm xmm -// VSUBPS ymm ymm ymm -// VSUBPS m256 ymm ymm -func VSUBPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VSUBPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VSUBPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VSUBPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VSUBPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VSUBPS: bad operands") -} - -// VSUBSD: Subtract Scalar Double-Precision Floating-Point Values. -// -// Forms: -// -// VSUBSD xmm xmm xmm -// VSUBSD m64 xmm xmm -func VSUBSD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VSUBSD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VSUBSD", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VSUBSD: bad operands") -} - -// VSUBSS: Subtract Scalar Single-Precision Floating-Point Values. -// -// Forms: -// -// VSUBSS xmm xmm xmm -// VSUBSS m32 xmm xmm -func VSUBSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VSUBSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): - return &intrep.Instruction{ - Opcode: "VSUBSS", - Operands: []operand.Op{mx, x, x1}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VSUBSS: bad operands") -} - -// VTESTPD: Packed Double-Precision Floating-Point Bit Test. -// -// Forms: -// -// VTESTPD xmm xmm -// VTESTPD m128 xmm -// VTESTPD ymm ymm -// VTESTPD m256 ymm -func VTESTPD(mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VTESTPD", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VTESTPD", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VTESTPD", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VTESTPD", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VTESTPD: bad operands") -} - -// VTESTPS: Packed Single-Precision Floating-Point Bit Test. -// -// Forms: -// -// VTESTPS xmm xmm -// VTESTPS m128 xmm -// VTESTPS ymm ymm -// VTESTPS m256 ymm -func VTESTPS(mxy, xy operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VTESTPS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy): - return &intrep.Instruction{ - Opcode: "VTESTPS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VTESTPS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy): - return &intrep.Instruction{ - Opcode: "VTESTPS", - Operands: []operand.Op{mxy, xy}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VTESTPS: bad operands") -} - -// VUCOMISD: Unordered Compare Scalar Double-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// VUCOMISD xmm xmm -// VUCOMISD m64 xmm -func VUCOMISD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VUCOMISD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM64(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VUCOMISD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VUCOMISD: bad operands") -} - -// VUCOMISS: Unordered Compare Scalar Single-Precision Floating-Point Values and Set EFLAGS. -// -// Forms: -// -// VUCOMISS xmm xmm -// VUCOMISS m32 xmm -func VUCOMISS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VUCOMISS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM32(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "VUCOMISS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VUCOMISS: bad operands") -} - -// VUNPCKHPD: Unpack and Interleave High Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VUNPCKHPD xmm xmm xmm -// VUNPCKHPD m128 xmm xmm -// VUNPCKHPD ymm ymm ymm -// VUNPCKHPD m256 ymm ymm -func VUNPCKHPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VUNPCKHPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VUNPCKHPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VUNPCKHPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VUNPCKHPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VUNPCKHPD: bad operands") -} - -// VUNPCKHPS: Unpack and Interleave High Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VUNPCKHPS xmm xmm xmm -// VUNPCKHPS m128 xmm xmm -// VUNPCKHPS ymm ymm ymm -// VUNPCKHPS m256 ymm ymm -func VUNPCKHPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VUNPCKHPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VUNPCKHPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VUNPCKHPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VUNPCKHPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VUNPCKHPS: bad operands") -} - -// VUNPCKLPD: Unpack and Interleave Low Packed Double-Precision Floating-Point Values. -// -// Forms: -// -// VUNPCKLPD xmm xmm xmm -// VUNPCKLPD m128 xmm xmm -// VUNPCKLPD ymm ymm ymm -// VUNPCKLPD m256 ymm ymm -func VUNPCKLPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VUNPCKLPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VUNPCKLPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VUNPCKLPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VUNPCKLPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VUNPCKLPD: bad operands") -} - -// VUNPCKLPS: Unpack and Interleave Low Packed Single-Precision Floating-Point Values. -// -// Forms: -// -// VUNPCKLPS xmm xmm xmm -// VUNPCKLPS m128 xmm xmm -// VUNPCKLPS ymm ymm ymm -// VUNPCKLPS m256 ymm ymm -func VUNPCKLPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VUNPCKLPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VUNPCKLPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VUNPCKLPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VUNPCKLPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VUNPCKLPS: bad operands") -} - -// VXORPD: Bitwise Logical XOR for Double-Precision Floating-Point Values. -// -// Forms: -// -// VXORPD xmm xmm xmm -// VXORPD m128 xmm xmm -// VXORPD ymm ymm ymm -// VXORPD m256 ymm ymm -func VXORPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VXORPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VXORPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VXORPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VXORPD", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VXORPD: bad operands") -} - -// VXORPS: Bitwise Logical XOR for Single-Precision Floating-Point Values. -// -// Forms: -// -// VXORPS xmm xmm xmm -// VXORPS m128 xmm xmm -// VXORPS ymm ymm ymm -// VXORPS m256 ymm ymm -func VXORPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VXORPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): - return &intrep.Instruction{ - Opcode: "VXORPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VXORPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - CancellingInputs: true, - }, nil - case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): - return &intrep.Instruction{ - Opcode: "VXORPS", - Operands: []operand.Op{mxy, xy, xy1}, - Inputs: []operand.Op{mxy, xy}, - Outputs: []operand.Op{xy1}, - ISA: []string{"AVX"}, - }, nil - } - return nil, errors.New("VXORPS: bad operands") -} - -// VZEROALL: Zero All YMM Registers. -// -// Forms: -// -// VZEROALL -func VZEROALL() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "VZEROALL", - Operands: nil, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil -} - -// VZEROUPPER: Zero Upper Bits of YMM Registers. -// -// Forms: -// -// VZEROUPPER -func VZEROUPPER() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "VZEROUPPER", - Operands: nil, - Inputs: []operand.Op{}, - Outputs: []operand.Op{}, - ISA: []string{"AVX"}, - }, nil -} - -// XADDB: Exchange and Add. -// -// Forms: -// -// XADDB r8 r8 -// XADDB r8 m8 -func XADDB(r, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(r) && operand.IsR8(mr): - return &intrep.Instruction{ - Opcode: "XADDB", - Operands: []operand.Op{r, mr}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r, mr}, - }, nil - case operand.IsR8(r) && operand.IsM8(mr): - return &intrep.Instruction{ - Opcode: "XADDB", - Operands: []operand.Op{r, mr}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r, mr}, - }, nil - } - return nil, errors.New("XADDB: bad operands") -} - -// XADDL: Exchange and Add. -// -// Forms: -// -// XADDL r32 r32 -// XADDL r32 m32 -func XADDL(r, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(r) && operand.IsR32(mr): - return &intrep.Instruction{ - Opcode: "XADDL", - Operands: []operand.Op{r, mr}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r, mr}, - }, nil - case operand.IsR32(r) && operand.IsM32(mr): - return &intrep.Instruction{ - Opcode: "XADDL", - Operands: []operand.Op{r, mr}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r, mr}, - }, nil - } - return nil, errors.New("XADDL: bad operands") -} - -// XADDQ: Exchange and Add. -// -// Forms: -// -// XADDQ r64 r64 -// XADDQ r64 m64 -func XADDQ(r, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(r) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "XADDQ", - Operands: []operand.Op{r, mr}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r, mr}, - }, nil - case operand.IsR64(r) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "XADDQ", - Operands: []operand.Op{r, mr}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r, mr}, - }, nil - } - return nil, errors.New("XADDQ: bad operands") -} - -// XADDW: Exchange and Add. -// -// Forms: -// -// XADDW r16 r16 -// XADDW r16 m16 -func XADDW(r, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(r) && operand.IsR16(mr): - return &intrep.Instruction{ - Opcode: "XADDW", - Operands: []operand.Op{r, mr}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r, mr}, - }, nil - case operand.IsR16(r) && operand.IsM16(mr): - return &intrep.Instruction{ - Opcode: "XADDW", - Operands: []operand.Op{r, mr}, - Inputs: []operand.Op{r, mr}, - Outputs: []operand.Op{r, mr}, - }, nil - } - return nil, errors.New("XADDW: bad operands") -} - -// XCHGB: Exchange Register/Memory with Register. -// -// Forms: -// -// XCHGB r8 r8 -// XCHGB m8 r8 -// XCHGB r8 m8 -func XCHGB(mr, mr1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR8(mr) && operand.IsR8(mr1): - return &intrep.Instruction{ - Opcode: "XCHGB", - Operands: []operand.Op{mr, mr1}, - Inputs: []operand.Op{mr, mr1}, - Outputs: []operand.Op{mr, mr1}, - }, nil - case operand.IsM8(mr) && operand.IsR8(mr1): - return &intrep.Instruction{ - Opcode: "XCHGB", - Operands: []operand.Op{mr, mr1}, - Inputs: []operand.Op{mr, mr1}, - Outputs: []operand.Op{mr, mr1}, - }, nil - case operand.IsR8(mr) && operand.IsM8(mr1): - return &intrep.Instruction{ - Opcode: "XCHGB", - Operands: []operand.Op{mr, mr1}, - Inputs: []operand.Op{mr, mr1}, - Outputs: []operand.Op{mr, mr1}, - }, nil - } - return nil, errors.New("XCHGB: bad operands") -} - -// XCHGL: Exchange Register/Memory with Register. -// -// Forms: -// -// XCHGL r32 eax -// XCHGL eax r32 -// XCHGL r32 r32 -// XCHGL m32 r32 -// XCHGL r32 m32 -func XCHGL(emr, emr1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR32(emr) && operand.IsEAX(emr1): - return &intrep.Instruction{ - Opcode: "XCHGL", - Operands: []operand.Op{emr, emr1}, - Inputs: []operand.Op{emr, emr1}, - Outputs: []operand.Op{emr, emr1}, - }, nil - case operand.IsEAX(emr) && operand.IsR32(emr1): - return &intrep.Instruction{ - Opcode: "XCHGL", - Operands: []operand.Op{emr, emr1}, - Inputs: []operand.Op{emr, emr1}, - Outputs: []operand.Op{emr, emr1}, - }, nil - case operand.IsR32(emr) && operand.IsR32(emr1): - return &intrep.Instruction{ - Opcode: "XCHGL", - Operands: []operand.Op{emr, emr1}, - Inputs: []operand.Op{emr, emr1}, - Outputs: []operand.Op{emr, emr1}, - }, nil - case operand.IsM32(emr) && operand.IsR32(emr1): - return &intrep.Instruction{ - Opcode: "XCHGL", - Operands: []operand.Op{emr, emr1}, - Inputs: []operand.Op{emr, emr1}, - Outputs: []operand.Op{emr, emr1}, - }, nil - case operand.IsR32(emr) && operand.IsM32(emr1): - return &intrep.Instruction{ - Opcode: "XCHGL", - Operands: []operand.Op{emr, emr1}, - Inputs: []operand.Op{emr, emr1}, - Outputs: []operand.Op{emr, emr1}, - }, nil - } - return nil, errors.New("XCHGL: bad operands") -} - -// XCHGQ: Exchange Register/Memory with Register. -// -// Forms: -// -// XCHGQ r64 rax -// XCHGQ rax r64 -// XCHGQ r64 r64 -// XCHGQ m64 r64 -// XCHGQ r64 m64 -func XCHGQ(mr, mr1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR64(mr) && operand.IsRAX(mr1): - return &intrep.Instruction{ - Opcode: "XCHGQ", - Operands: []operand.Op{mr, mr1}, - Inputs: []operand.Op{mr, mr1}, - Outputs: []operand.Op{mr, mr1}, - }, nil - case operand.IsRAX(mr) && operand.IsR64(mr1): - return &intrep.Instruction{ - Opcode: "XCHGQ", - Operands: []operand.Op{mr, mr1}, - Inputs: []operand.Op{mr, mr1}, - Outputs: []operand.Op{mr, mr1}, - }, nil - case operand.IsR64(mr) && operand.IsR64(mr1): - return &intrep.Instruction{ - Opcode: "XCHGQ", - Operands: []operand.Op{mr, mr1}, - Inputs: []operand.Op{mr, mr1}, - Outputs: []operand.Op{mr, mr1}, - }, nil - case operand.IsM64(mr) && operand.IsR64(mr1): - return &intrep.Instruction{ - Opcode: "XCHGQ", - Operands: []operand.Op{mr, mr1}, - Inputs: []operand.Op{mr, mr1}, - Outputs: []operand.Op{mr, mr1}, - }, nil - case operand.IsR64(mr) && operand.IsM64(mr1): - return &intrep.Instruction{ - Opcode: "XCHGQ", - Operands: []operand.Op{mr, mr1}, - Inputs: []operand.Op{mr, mr1}, - Outputs: []operand.Op{mr, mr1}, - }, nil - } - return nil, errors.New("XCHGQ: bad operands") -} - -// XCHGW: Exchange Register/Memory with Register. -// -// Forms: -// -// XCHGW r16 ax -// XCHGW ax r16 -// XCHGW r16 r16 -// XCHGW m16 r16 -// XCHGW r16 m16 -func XCHGW(amr, amr1 operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsR16(amr) && operand.IsAX(amr1): - return &intrep.Instruction{ - Opcode: "XCHGW", - Operands: []operand.Op{amr, amr1}, - Inputs: []operand.Op{amr, amr1}, - Outputs: []operand.Op{amr, amr1}, - }, nil - case operand.IsAX(amr) && operand.IsR16(amr1): - return &intrep.Instruction{ - Opcode: "XCHGW", - Operands: []operand.Op{amr, amr1}, - Inputs: []operand.Op{amr, amr1}, - Outputs: []operand.Op{amr, amr1}, - }, nil - case operand.IsR16(amr) && operand.IsR16(amr1): - return &intrep.Instruction{ - Opcode: "XCHGW", - Operands: []operand.Op{amr, amr1}, - Inputs: []operand.Op{amr, amr1}, - Outputs: []operand.Op{amr, amr1}, - }, nil - case operand.IsM16(amr) && operand.IsR16(amr1): - return &intrep.Instruction{ - Opcode: "XCHGW", - Operands: []operand.Op{amr, amr1}, - Inputs: []operand.Op{amr, amr1}, - Outputs: []operand.Op{amr, amr1}, - }, nil - case operand.IsR16(amr) && operand.IsM16(amr1): - return &intrep.Instruction{ - Opcode: "XCHGW", - Operands: []operand.Op{amr, amr1}, - Inputs: []operand.Op{amr, amr1}, - Outputs: []operand.Op{amr, amr1}, - }, nil - } - return nil, errors.New("XCHGW: bad operands") -} - -// XGETBV: Get Value of Extended Control Register. -// -// Forms: -// -// XGETBV -func XGETBV() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "XGETBV", - Operands: nil, - Inputs: []operand.Op{reg.ECX}, - Outputs: []operand.Op{reg.EAX, reg.EDX}, - }, nil -} - -// XLAT: Table Look-up Translation. -// -// Forms: -// -// XLAT -func XLAT() (*intrep.Instruction, error) { - return &intrep.Instruction{ - Opcode: "XLAT", - Operands: nil, - Inputs: []operand.Op{reg.AL, reg.EBX}, - Outputs: []operand.Op{reg.AL}, - }, nil -} - -// XORB: Logical Exclusive OR. -// -// Forms: -// -// XORB imm8 al -// XORB imm8 r8 -// XORB r8 r8 -// XORB m8 r8 -// XORB imm8 m8 -// XORB r8 m8 -func XORB(imr, amr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM8(imr) && operand.IsAL(amr): - return &intrep.Instruction{ - Opcode: "XORB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "XORB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "XORB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - CancellingInputs: true, - }, nil - case operand.IsM8(imr) && operand.IsR8(amr): - return &intrep.Instruction{ - Opcode: "XORB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM8(amr): - return &intrep.Instruction{ - Opcode: "XORB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR8(imr) && operand.IsM8(amr): - return &intrep.Instruction{ - Opcode: "XORB", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - } - return nil, errors.New("XORB: bad operands") -} - -// XORL: Logical Exclusive OR. -// -// Forms: -// -// XORL imm32 eax -// XORL imm8 r32 -// XORL imm32 r32 -// XORL r32 r32 -// XORL m32 r32 -// XORL imm8 m32 -// XORL imm32 m32 -// XORL r32 m32 -func XORL(imr, emr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imr) && operand.IsEAX(emr): - return &intrep.Instruction{ - Opcode: "XORL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "XORL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "XORL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsR32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "XORL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - CancellingInputs: true, - }, nil - case operand.IsM32(imr) && operand.IsR32(emr): - return &intrep.Instruction{ - Opcode: "XORL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "XORL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsIMM32(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "XORL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{emr}, - Outputs: []operand.Op{emr}, - }, nil - case operand.IsR32(imr) && operand.IsM32(emr): - return &intrep.Instruction{ - Opcode: "XORL", - Operands: []operand.Op{imr, emr}, - Inputs: []operand.Op{imr, emr}, - Outputs: []operand.Op{emr}, - }, nil - } - return nil, errors.New("XORL: bad operands") -} - -// XORPD: Bitwise Logical XOR for Double-Precision Floating-Point Values. -// -// Forms: -// -// XORPD xmm xmm -// XORPD m128 xmm -func XORPD(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "XORPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "XORPD", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE2"}, - }, nil - } - return nil, errors.New("XORPD: bad operands") -} - -// XORPS: Bitwise Logical XOR for Single-Precision Floating-Point Values. -// -// Forms: -// -// XORPS xmm xmm -// XORPS m128 xmm -func XORPS(mx, x operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsXMM(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "XORPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - CancellingInputs: true, - }, nil - case operand.IsM128(mx) && operand.IsXMM(x): - return &intrep.Instruction{ - Opcode: "XORPS", - Operands: []operand.Op{mx, x}, - Inputs: []operand.Op{mx, x}, - Outputs: []operand.Op{x}, - ISA: []string{"SSE"}, - }, nil - } - return nil, errors.New("XORPS: bad operands") -} - -// XORQ: Logical Exclusive OR. -// -// Forms: -// -// XORQ imm32 rax -// XORQ imm8 r64 -// XORQ imm32 r64 -// XORQ r64 r64 -// XORQ m64 r64 -// XORQ imm8 m64 -// XORQ imm32 m64 -// XORQ r64 m64 -func XORQ(imr, mr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM32(imr) && operand.IsRAX(mr): - return &intrep.Instruction{ - Opcode: "XORQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "XORQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM32(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "XORQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "XORQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - CancellingInputs: true, - }, nil - case operand.IsM64(imr) && operand.IsR64(mr): - return &intrep.Instruction{ - Opcode: "XORQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "XORQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsIMM32(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "XORQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{mr}, - Outputs: []operand.Op{mr}, - }, nil - case operand.IsR64(imr) && operand.IsM64(mr): - return &intrep.Instruction{ - Opcode: "XORQ", - Operands: []operand.Op{imr, mr}, - Inputs: []operand.Op{imr, mr}, - Outputs: []operand.Op{mr}, - }, nil - } - return nil, errors.New("XORQ: bad operands") -} - -// XORW: Logical Exclusive OR. -// -// Forms: -// -// XORW imm16 ax -// XORW imm8 r16 -// XORW imm16 r16 -// XORW r16 r16 -// XORW m16 r16 -// XORW imm8 m16 -// XORW imm16 m16 -// XORW r16 m16 -func XORW(imr, amr operand.Op) (*intrep.Instruction, error) { - switch { - case operand.IsIMM16(imr) && operand.IsAX(amr): - return &intrep.Instruction{ - Opcode: "XORW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "XORW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "XORW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "XORW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - CancellingInputs: true, - }, nil - case operand.IsM16(imr) && operand.IsR16(amr): - return &intrep.Instruction{ - Opcode: "XORW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM8(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "XORW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsIMM16(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "XORW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{amr}, - Outputs: []operand.Op{amr}, - }, nil - case operand.IsR16(imr) && operand.IsM16(amr): - return &intrep.Instruction{ - Opcode: "XORW", - Operands: []operand.Op{imr, amr}, - Inputs: []operand.Op{imr, amr}, - Outputs: []operand.Op{amr}, - }, nil - } - return nil, errors.New("XORW: bad operands") -} diff --git a/vendor/github.com/nwaples/rardecode/archive.go b/vendor/github.com/nwaples/rardecode/archive.go index 8929f12649..f878751149 100644 --- a/vendor/github.com/nwaples/rardecode/archive.go +++ b/vendor/github.com/nwaples/rardecode/archive.go @@ -137,12 +137,13 @@ func findSig(br *bufio.Reader) (int, error) { // files in a multi-volume archive type volume struct { fileBlockReader - f *os.File // current file handle - br *bufio.Reader // buffered reader for current volume file - dir string // volume directory - file string // current volume file - num int // volume number - old bool // uses old naming scheme + f *os.File // current file handle + br *bufio.Reader // buffered reader for current volume file + dir string // volume directory + file string // current volume file (not including directory) + files []string // full path names for current volume files processed + num int // volume number + old bool // uses old naming scheme } // nextVolName updates name to the next filename in the archive. @@ -258,6 +259,7 @@ func (v *volume) next() (*fileBlockHeader, error) { if v.version() != ver { return nil, errVerMismatch } + v.files = append(v.files, v.dir+v.file) v.reset() // reset encryption } } @@ -284,6 +286,7 @@ func openVolume(name, password string) (*volume, error) { v.f.Close() return nil, err } + v.files = append(v.files, name) return v, nil } diff --git a/vendor/github.com/nwaples/rardecode/huffman.go b/vendor/github.com/nwaples/rardecode/huffman.go index eb289b40b4..4acb69d5a9 100644 --- a/vendor/github.com/nwaples/rardecode/huffman.go +++ b/vendor/github.com/nwaples/rardecode/huffman.go @@ -130,7 +130,7 @@ func (h *huffmanDecoder) readSym(r bitReader) (int, error) { dist >>= maxCodeLength - bits pos := h.pos[bits] + dist - if pos > len(h.symbol) { + if pos >= len(h.symbol) { return 0, errHuffDecodeFailed } diff --git a/vendor/github.com/nwaples/rardecode/reader.go b/vendor/github.com/nwaples/rardecode/reader.go index 03e88a87b5..11adc4fea7 100644 --- a/vendor/github.com/nwaples/rardecode/reader.go +++ b/vendor/github.com/nwaples/rardecode/reader.go @@ -356,6 +356,13 @@ func (rc *ReadCloser) Close() error { return rc.v.Close() } +// Volumes returns the volume filenames that have been used in decoding the archive +// up to this point. This will include the current open volume if the archive is still +// being processed. +func (rc *ReadCloser) Volumes() []string { + return rc.v.files +} + // OpenReader opens a RAR archive specified by the name and returns a ReadCloser. func OpenReader(name, password string) (*ReadCloser, error) { v, err := openVolume(name, password) diff --git a/vendor/github.com/pierrec/lz4/.travis.yml b/vendor/github.com/pierrec/lz4/.travis.yml deleted file mode 100644 index b2c806d577..0000000000 --- a/vendor/github.com/pierrec/lz4/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: go - -go: - - 1.8.x - - 1.9.x - - 1.10.x - - master - -matrix: - fast_finish: true - allow_failures: - - go: master - -sudo: false - -script: - - go test -v -cpu=2 - - go test -v -cpu=2 -race diff --git a/vendor/github.com/pierrec/lz4/README.md b/vendor/github.com/pierrec/lz4/README.md deleted file mode 100644 index 50a10ee160..0000000000 --- a/vendor/github.com/pierrec/lz4/README.md +++ /dev/null @@ -1,24 +0,0 @@ -[![godoc](https://godoc.org/github.com/pierrec/lz4?status.png)](https://godoc.org/github.com/pierrec/lz4) - -# lz4 -LZ4 compression and decompression in pure Go. - -## Usage - -```go -import "github.com/pierrec/lz4" -``` - -## Description -Package lz4 implements reading and writing lz4 compressed data (a frame), -as specified in http://fastcompression.blogspot.fr/2013/04/lz4-streaming-format-final.html. - -This package is **compatible with the LZ4 frame format** although the block level compression -and decompression functions are exposed and are fully compatible with the lz4 block format -definition, they are low level and should not be used directly. - -For a complete description of an lz4 compressed block, see: -http://fastcompression.blogspot.fr/2011/05/lz4-explained.html - -See https://github.com/Cyan4973/lz4 for the reference C implementation. - diff --git a/vendor/github.com/pierrec/lz4/block.go b/vendor/github.com/pierrec/lz4/block.go deleted file mode 100644 index ef24f17e57..0000000000 --- a/vendor/github.com/pierrec/lz4/block.go +++ /dev/null @@ -1,397 +0,0 @@ -package lz4 - -import ( - "encoding/binary" - "errors" -) - -var ( - // ErrInvalidSourceShortBuffer is returned by UncompressBlock or CompressBLock when a compressed - // block is corrupted or the destination buffer is not large enough for the uncompressed data. - ErrInvalidSourceShortBuffer = errors.New("lz4: invalid source or destination buffer too short") - // ErrInvalid is returned when reading an invalid LZ4 archive. - ErrInvalid = errors.New("lz4: bad magic number") -) - -// blockHash hashes 4 bytes into a value < winSize. -func blockHash(x uint32) uint32 { - const hasher uint32 = 2654435761 // Knuth multiplicative hash. - return x * hasher >> hashShift -} - -// CompressBlockBound returns the maximum size of a given buffer of size n, when not compressible. -func CompressBlockBound(n int) int { - return n + n/255 + 16 -} - -// UncompressBlock uncompresses the source buffer into the destination one, -// and returns the uncompressed size. -// -// The destination buffer must be sized appropriately. -// -// An error is returned if the source data is invalid or the destination buffer is too small. -func UncompressBlock(src, dst []byte) (si int, err error) { - defer func() { - // It is now faster to let the runtime panic and recover on out of bound slice access - // than checking indices as we go along. - if recover() != nil { - err = ErrInvalidSourceShortBuffer - } - }() - sn := len(src) - if sn == 0 { - return 0, nil - } - var di int - - for { - // Literals and match lengths (token). - b := int(src[si]) - si++ - - // Literals. - if lLen := b >> 4; lLen > 0 { - if lLen == 0xF { - for src[si] == 0xFF { - lLen += 0xFF - si++ - } - lLen += int(src[si]) - si++ - } - i := si - si += lLen - di += copy(dst[di:], src[i:si]) - - if si >= sn { - return di, nil - } - } - - si++ - _ = src[si] // Bound check elimination. - offset := int(src[si-1]) | int(src[si])<<8 - si++ - - // Match. - mLen := b & 0xF - if mLen == 0xF { - for src[si] == 0xFF { - mLen += 0xFF - si++ - } - mLen += int(src[si]) - si++ - } - mLen += minMatch - - // Copy the match. - i := di - offset - if offset > 0 && mLen >= offset { - // Efficiently copy the match dst[di-offset:di] into the dst slice. - bytesToCopy := offset * (mLen / offset) - expanded := dst[i:] - for n := offset; n <= bytesToCopy+offset; n *= 2 { - copy(expanded[n:], expanded[:n]) - } - di += bytesToCopy - mLen -= bytesToCopy - } - di += copy(dst[di:], dst[i:i+mLen]) - } -} - -// CompressBlock compresses the source buffer into the destination one. -// This is the fast version of LZ4 compression and also the default one. -// The size of hashTable must be at least 64Kb. -// -// The size of the compressed data is returned. If it is 0 and no error, then the data is incompressible. -// -// An error is returned if the destination buffer is too small. -func CompressBlock(src, dst []byte, hashTable []int) (di int, err error) { - defer func() { - if recover() != nil { - err = ErrInvalidSourceShortBuffer - } - }() - - sn, dn := len(src)-mfLimit, len(dst) - if sn <= 0 || dn == 0 { - return 0, nil - } - var si int - - // Fast scan strategy: the hash table only stores the last 4 bytes sequences. - // const accInit = 1 << skipStrength - - anchor := si // Position of the current literals. - // acc := accInit // Variable step: improves performance on non-compressible data. - - for si < sn { - // Hash the next 4 bytes (sequence)... - match := binary.LittleEndian.Uint32(src[si:]) - h := blockHash(match) - - ref := hashTable[h] - hashTable[h] = si - if ref >= sn { // Invalid reference (dirty hashtable). - si++ - continue - } - offset := si - ref - if offset <= 0 || offset >= winSize || // Out of window. - match != binary.LittleEndian.Uint32(src[ref:]) { // Hash collision on different matches. - // si += acc >> skipStrength - // acc++ - si++ - continue - } - - // Match found. - // acc = accInit - lLen := si - anchor // Literal length. - - // Encode match length part 1. - si += minMatch - mLen := si // Match length has minMatch already. - // Find the longest match, first looking by batches of 8 bytes. - for si < sn && binary.LittleEndian.Uint64(src[si:]) == binary.LittleEndian.Uint64(src[si-offset:]) { - si += 8 - } - // Then byte by byte. - for si < sn && src[si] == src[si-offset] { - si++ - } - - mLen = si - mLen - if mLen < 0xF { - dst[di] = byte(mLen) - } else { - dst[di] = 0xF - } - - // Encode literals length. - if lLen < 0xF { - dst[di] |= byte(lLen << 4) - } else { - dst[di] |= 0xF0 - di++ - l := lLen - 0xF - for ; l >= 0xFF; l -= 0xFF { - dst[di] = 0xFF - di++ - } - dst[di] = byte(l) - } - di++ - - // Literals. - copy(dst[di:], src[anchor:anchor+lLen]) - di += lLen + 2 - anchor = si - - // Encode offset. - _ = dst[di] // Bound check elimination. - dst[di-2], dst[di-1] = byte(offset), byte(offset>>8) - - // Encode match length part 2. - if mLen >= 0xF { - for mLen -= 0xF; mLen >= 0xFF; mLen -= 0xFF { - dst[di] = 0xFF - di++ - } - dst[di] = byte(mLen) - di++ - } - } - - if anchor == 0 { - // Incompressible. - return 0, nil - } - - // Last literals. - lLen := len(src) - anchor - if lLen < 0xF { - dst[di] = byte(lLen << 4) - } else { - dst[di] = 0xF0 - di++ - for lLen -= 0xF; lLen >= 0xFF; lLen -= 0xFF { - dst[di] = 0xFF - di++ - } - dst[di] = byte(lLen) - } - di++ - - // Write the last literals. - if di >= anchor { - // Incompressible. - return 0, nil - } - di += copy(dst[di:], src[anchor:]) - return di, nil -} - -// CompressBlockHC compresses the source buffer src into the destination dst -// with max search depth (use 0 or negative value for no max). -// -// CompressBlockHC compression ratio is better than CompressBlock but it is also slower. -// -// The size of the compressed data is returned. If it is 0 and no error, then the data is not compressible. -// -// An error is returned if the destination buffer is too small. -func CompressBlockHC(src, dst []byte, depth int) (di int, err error) { - defer func() { - if recover() != nil { - err = ErrInvalidSourceShortBuffer - } - }() - - sn, dn := len(src)-mfLimit, len(dst) - if sn <= 0 || dn == 0 { - return 0, nil - } - var si int - - // hashTable: stores the last position found for a given hash - // chaingTable: stores previous positions for a given hash - var hashTable, chainTable [winSize]int - - if depth <= 0 { - depth = winSize - } - - anchor := si - for si < sn { - // Hash the next 4 bytes (sequence). - match := binary.LittleEndian.Uint32(src[si:]) - h := blockHash(match) - - // Follow the chain until out of window and give the longest match. - mLen := 0 - offset := 0 - for next, try := hashTable[h], depth; try > 0 && next > 0 && si-next < winSize; next = chainTable[next&winMask] { - // The first (mLen==0) or next byte (mLen>=minMatch) at current match length - // must match to improve on the match length. - if src[next+mLen] != src[si+mLen] { - continue - } - ml := 0 - // Compare the current position with a previous with the same hash. - for ml < sn-si && binary.LittleEndian.Uint64(src[next+ml:]) == binary.LittleEndian.Uint64(src[si+ml:]) { - ml += 8 - } - for ml < sn-si && src[next+ml] == src[si+ml] { - ml++ - } - if ml+1 < minMatch || ml <= mLen { - // Match too small ( winStart { - winStart = ws - } - for si, ml := winStart, si+mLen; si < ml; { - match >>= 8 - match |= uint32(src[si+3]) << 24 - h := blockHash(match) - chainTable[si&winMask] = hashTable[h] - hashTable[h] = si - si++ - } - - lLen := si - anchor - si += mLen - mLen -= minMatch // Match length does not include minMatch. - - if mLen < 0xF { - dst[di] = byte(mLen) - } else { - dst[di] = 0xF - } - - // Encode literals length. - if lLen < 0xF { - dst[di] |= byte(lLen << 4) - } else { - dst[di] |= 0xF0 - di++ - l := lLen - 0xF - for ; l >= 0xFF; l -= 0xFF { - dst[di] = 0xFF - di++ - } - dst[di] = byte(l) - } - di++ - - // Literals. - copy(dst[di:], src[anchor:anchor+lLen]) - di += lLen - anchor = si - - // Encode offset. - di += 2 - dst[di-2], dst[di-1] = byte(offset), byte(offset>>8) - - // Encode match length part 2. - if mLen >= 0xF { - for mLen -= 0xF; mLen >= 0xFF; mLen -= 0xFF { - dst[di] = 0xFF - di++ - } - dst[di] = byte(mLen) - di++ - } - } - - if anchor == 0 { - // Incompressible. - return 0, nil - } - - // Last literals. - lLen := len(src) - anchor - if lLen < 0xF { - dst[di] = byte(lLen << 4) - } else { - dst[di] = 0xF0 - di++ - lLen -= 0xF - for ; lLen >= 0xFF; lLen -= 0xFF { - dst[di] = 0xFF - di++ - } - dst[di] = byte(lLen) - } - di++ - - // Write the last literals. - if di >= anchor { - // Incompressible. - return 0, nil - } - di += copy(dst[di:], src[anchor:]) - return di, nil -} diff --git a/vendor/github.com/pierrec/lz4/debug.go b/vendor/github.com/pierrec/lz4/debug.go deleted file mode 100644 index bc5e78d40f..0000000000 --- a/vendor/github.com/pierrec/lz4/debug.go +++ /dev/null @@ -1,23 +0,0 @@ -// +build lz4debug - -package lz4 - -import ( - "fmt" - "os" - "path/filepath" - "runtime" -) - -const debugFlag = true - -func debug(args ...interface{}) { - _, file, line, _ := runtime.Caller(1) - file = filepath.Base(file) - - f := fmt.Sprintf("LZ4: %s:%d %s", file, line, args[0]) - if f[len(f)-1] != '\n' { - f += "\n" - } - fmt.Fprintf(os.Stderr, f, args[1:]...) -} diff --git a/vendor/github.com/pierrec/lz4/debug_stub.go b/vendor/github.com/pierrec/lz4/debug_stub.go deleted file mode 100644 index 44211ad964..0000000000 --- a/vendor/github.com/pierrec/lz4/debug_stub.go +++ /dev/null @@ -1,7 +0,0 @@ -// +build !lz4debug - -package lz4 - -const debugFlag = false - -func debug(args ...interface{}) {} diff --git a/vendor/github.com/pierrec/lz4/internal/xxh32/xxh32zero.go b/vendor/github.com/pierrec/lz4/internal/xxh32/xxh32zero.go deleted file mode 100644 index 850a6fdf61..0000000000 --- a/vendor/github.com/pierrec/lz4/internal/xxh32/xxh32zero.go +++ /dev/null @@ -1,222 +0,0 @@ -// Package xxh32 implements the very fast XXH hashing algorithm (32 bits version). -// (https://github.com/Cyan4973/XXH/) -package xxh32 - -import ( - "encoding/binary" -) - -const ( - prime32_1 uint32 = 2654435761 - prime32_2 uint32 = 2246822519 - prime32_3 uint32 = 3266489917 - prime32_4 uint32 = 668265263 - prime32_5 uint32 = 374761393 - - prime32_1plus2 uint32 = 606290984 - prime32_minus1 uint32 = 1640531535 -) - -// XXHZero represents an xxhash32 object with seed 0. -type XXHZero struct { - v1 uint32 - v2 uint32 - v3 uint32 - v4 uint32 - totalLen uint64 - buf [16]byte - bufused int -} - -// Sum appends the current hash to b and returns the resulting slice. -// It does not change the underlying hash state. -func (xxh XXHZero) Sum(b []byte) []byte { - h32 := xxh.Sum32() - return append(b, byte(h32), byte(h32>>8), byte(h32>>16), byte(h32>>24)) -} - -// Reset resets the Hash to its initial state. -func (xxh *XXHZero) Reset() { - xxh.v1 = prime32_1plus2 - xxh.v2 = prime32_2 - xxh.v3 = 0 - xxh.v4 = prime32_minus1 - xxh.totalLen = 0 - xxh.bufused = 0 -} - -// Size returns the number of bytes returned by Sum(). -func (xxh *XXHZero) Size() int { - return 4 -} - -// BlockSize gives the minimum number of bytes accepted by Write(). -func (xxh *XXHZero) BlockSize() int { - return 1 -} - -// Write adds input bytes to the Hash. -// It never returns an error. -func (xxh *XXHZero) Write(input []byte) (int, error) { - if xxh.totalLen == 0 { - xxh.Reset() - } - n := len(input) - m := xxh.bufused - - xxh.totalLen += uint64(n) - - r := len(xxh.buf) - m - if n < r { - copy(xxh.buf[m:], input) - xxh.bufused += len(input) - return n, nil - } - - p := 0 - // Causes compiler to work directly from registers instead of stack: - v1, v2, v3, v4 := xxh.v1, xxh.v2, xxh.v3, xxh.v4 - if m > 0 { - // some data left from previous update - copy(xxh.buf[xxh.bufused:], input[:r]) - xxh.bufused += len(input) - r - - // fast rotl(13) - buf := xxh.buf[:16] // BCE hint. - v1 = rol13(v1+binary.LittleEndian.Uint32(buf[:])*prime32_2) * prime32_1 - v2 = rol13(v2+binary.LittleEndian.Uint32(buf[4:])*prime32_2) * prime32_1 - v3 = rol13(v3+binary.LittleEndian.Uint32(buf[8:])*prime32_2) * prime32_1 - v4 = rol13(v4+binary.LittleEndian.Uint32(buf[12:])*prime32_2) * prime32_1 - p = r - xxh.bufused = 0 - } - - for n := n - 16; p <= n; p += 16 { - sub := input[p:][:16] //BCE hint for compiler - v1 = rol13(v1+binary.LittleEndian.Uint32(sub[:])*prime32_2) * prime32_1 - v2 = rol13(v2+binary.LittleEndian.Uint32(sub[4:])*prime32_2) * prime32_1 - v3 = rol13(v3+binary.LittleEndian.Uint32(sub[8:])*prime32_2) * prime32_1 - v4 = rol13(v4+binary.LittleEndian.Uint32(sub[12:])*prime32_2) * prime32_1 - } - xxh.v1, xxh.v2, xxh.v3, xxh.v4 = v1, v2, v3, v4 - - copy(xxh.buf[xxh.bufused:], input[p:]) - xxh.bufused += len(input) - p - - return n, nil -} - -// Sum32 returns the 32 bits Hash value. -func (xxh *XXHZero) Sum32() uint32 { - h32 := uint32(xxh.totalLen) - if h32 >= 16 { - h32 += rol1(xxh.v1) + rol7(xxh.v2) + rol12(xxh.v3) + rol18(xxh.v4) - } else { - h32 += prime32_5 - } - - p := 0 - n := xxh.bufused - buf := xxh.buf - for n := n - 4; p <= n; p += 4 { - h32 += binary.LittleEndian.Uint32(buf[p:p+4]) * prime32_3 - h32 = rol17(h32) * prime32_4 - } - for ; p < n; p++ { - h32 += uint32(buf[p]) * prime32_5 - h32 = rol11(h32) * prime32_1 - } - - h32 ^= h32 >> 15 - h32 *= prime32_2 - h32 ^= h32 >> 13 - h32 *= prime32_3 - h32 ^= h32 >> 16 - - return h32 -} - -// ChecksumZero returns the 32bits Hash value. -func ChecksumZero(input []byte) uint32 { - n := len(input) - h32 := uint32(n) - - if n < 16 { - h32 += prime32_5 - } else { - v1 := prime32_1plus2 - v2 := prime32_2 - v3 := uint32(0) - v4 := prime32_minus1 - p := 0 - for n := n - 16; p <= n; p += 16 { - sub := input[p:][:16] //BCE hint for compiler - v1 = rol13(v1+binary.LittleEndian.Uint32(sub[:])*prime32_2) * prime32_1 - v2 = rol13(v2+binary.LittleEndian.Uint32(sub[4:])*prime32_2) * prime32_1 - v3 = rol13(v3+binary.LittleEndian.Uint32(sub[8:])*prime32_2) * prime32_1 - v4 = rol13(v4+binary.LittleEndian.Uint32(sub[12:])*prime32_2) * prime32_1 - } - input = input[p:] - n -= p - h32 += rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4) - } - - p := 0 - for n := n - 4; p <= n; p += 4 { - h32 += binary.LittleEndian.Uint32(input[p:p+4]) * prime32_3 - h32 = rol17(h32) * prime32_4 - } - for p < n { - h32 += uint32(input[p]) * prime32_5 - h32 = rol11(h32) * prime32_1 - p++ - } - - h32 ^= h32 >> 15 - h32 *= prime32_2 - h32 ^= h32 >> 13 - h32 *= prime32_3 - h32 ^= h32 >> 16 - - return h32 -} - -// Uint32Zero hashes x with seed 0. -func Uint32Zero(x uint32) uint32 { - h := prime32_5 + 4 + x*prime32_3 - h = rol17(h) * prime32_4 - h ^= h >> 15 - h *= prime32_2 - h ^= h >> 13 - h *= prime32_3 - h ^= h >> 16 - return h -} - -func rol1(u uint32) uint32 { - return u<<1 | u>>31 -} - -func rol7(u uint32) uint32 { - return u<<7 | u>>25 -} - -func rol11(u uint32) uint32 { - return u<<11 | u>>21 -} - -func rol12(u uint32) uint32 { - return u<<12 | u>>20 -} - -func rol13(u uint32) uint32 { - return u<<13 | u>>19 -} - -func rol17(u uint32) uint32 { - return u<<17 | u>>15 -} - -func rol18(u uint32) uint32 { - return u<<18 | u>>14 -} diff --git a/vendor/github.com/pierrec/lz4/lz4.go b/vendor/github.com/pierrec/lz4/lz4.go deleted file mode 100644 index 35802756c4..0000000000 --- a/vendor/github.com/pierrec/lz4/lz4.go +++ /dev/null @@ -1,68 +0,0 @@ -// Package lz4 implements reading and writing lz4 compressed data (a frame), -// as specified in http://fastcompression.blogspot.fr/2013/04/lz4-streaming-format-final.html. -// -// Although the block level compression and decompression functions are exposed and are fully compatible -// with the lz4 block format definition, they are low level and should not be used directly. -// For a complete description of an lz4 compressed block, see: -// http://fastcompression.blogspot.fr/2011/05/lz4-explained.html -// -// See https://github.com/Cyan4973/lz4 for the reference C implementation. -// -package lz4 - -const ( - // Extension is the LZ4 frame file name extension - Extension = ".lz4" - // Version is the LZ4 frame format version - Version = 1 - - frameMagic uint32 = 0x184D2204 - frameSkipMagic uint32 = 0x184D2A50 - - // The following constants are used to setup the compression algorithm. - minMatch = 4 // the minimum size of the match sequence size (4 bytes) - winSizeLog = 16 // LZ4 64Kb window size limit - winSize = 1 << winSizeLog - winMask = winSize - 1 // 64Kb window of previous data for dependent blocks - compressedBlockFlag = 1 << 31 - compressedBlockMask = compressedBlockFlag - 1 - - // hashLog determines the size of the hash table used to quickly find a previous match position. - // Its value influences the compression speed and memory usage, the lower the faster, - // but at the expense of the compression ratio. - // 16 seems to be the best compromise. - hashLog = 16 - hashTableSize = 1 << hashLog - hashShift = uint((minMatch * 8) - hashLog) - - mfLimit = 8 + minMatch // The last match cannot start within the last 12 bytes. - skipStrength = 6 // variable step for fast scan -) - -// map the block max size id with its value in bytes: 64Kb, 256Kb, 1Mb and 4Mb. -var ( - bsMapID = map[byte]int{4: 64 << 10, 5: 256 << 10, 6: 1 << 20, 7: 4 << 20} - bsMapValue = make(map[int]byte, len(bsMapID)) -) - -// Reversed. -func init() { - for i, v := range bsMapID { - bsMapValue[v] = i - } -} - -// Header describes the various flags that can be set on a Writer or obtained from a Reader. -// The default values match those of the LZ4 frame format definition -// (http://fastcompression.blogspot.com/2013/04/lz4-streaming-format-final.html). -// -// NB. in a Reader, in case of concatenated frames, the Header values may change between Read() calls. -// It is the caller responsibility to check them if necessary. -type Header struct { - BlockChecksum bool // Compressed blocks checksum flag. - NoChecksum bool // Frame checksum flag. - BlockMaxSize int // Size of the uncompressed data block (one of [64KB, 256KB, 1MB, 4MB]). Default=4MB. - Size uint64 // Frame total size. It is _not_ computed by the Writer. - CompressionLevel int // Compression level (higher is better, use 0 for fastest compression). - done bool // Header processed flag (Read or Write and checked). -} diff --git a/vendor/github.com/pierrec/lz4/lz4_go1.10.go b/vendor/github.com/pierrec/lz4/lz4_go1.10.go deleted file mode 100644 index 9a0fb00709..0000000000 --- a/vendor/github.com/pierrec/lz4/lz4_go1.10.go +++ /dev/null @@ -1,29 +0,0 @@ -//+build go1.10 - -package lz4 - -import ( - "fmt" - "strings" -) - -func (h Header) String() string { - var s strings.Builder - - s.WriteString(fmt.Sprintf("%T{", h)) - if h.BlockChecksum { - s.WriteString("BlockChecksum: true ") - } - if h.NoChecksum { - s.WriteString("NoChecksum: true ") - } - if bs := h.BlockMaxSize; bs != 0 && bs != 4<<20 { - s.WriteString(fmt.Sprintf("BlockMaxSize: %d ", bs)) - } - if l := h.CompressionLevel; l != 0 { - s.WriteString(fmt.Sprintf("CompressionLevel: %d ", l)) - } - s.WriteByte('}') - - return s.String() -} diff --git a/vendor/github.com/pierrec/lz4/lz4_notgo1.10.go b/vendor/github.com/pierrec/lz4/lz4_notgo1.10.go deleted file mode 100644 index 12c761a2e7..0000000000 --- a/vendor/github.com/pierrec/lz4/lz4_notgo1.10.go +++ /dev/null @@ -1,29 +0,0 @@ -//+build !go1.10 - -package lz4 - -import ( - "bytes" - "fmt" -) - -func (h Header) String() string { - var s bytes.Buffer - - s.WriteString(fmt.Sprintf("%T{", h)) - if h.BlockChecksum { - s.WriteString("BlockChecksum: true ") - } - if h.NoChecksum { - s.WriteString("NoChecksum: true ") - } - if bs := h.BlockMaxSize; bs != 0 && bs != 4<<20 { - s.WriteString(fmt.Sprintf("BlockMaxSize: %d ", bs)) - } - if l := h.CompressionLevel; l != 0 { - s.WriteString(fmt.Sprintf("CompressionLevel: %d ", l)) - } - s.WriteByte('}') - - return s.String() -} diff --git a/vendor/github.com/pierrec/lz4/reader.go b/vendor/github.com/pierrec/lz4/reader.go deleted file mode 100644 index f08db47df7..0000000000 --- a/vendor/github.com/pierrec/lz4/reader.go +++ /dev/null @@ -1,295 +0,0 @@ -package lz4 - -import ( - "encoding/binary" - "fmt" - "io" - "io/ioutil" - - "github.com/pierrec/lz4/internal/xxh32" -) - -// Reader implements the LZ4 frame decoder. -// The Header is set after the first call to Read(). -// The Header may change between Read() calls in case of concatenated frames. -type Reader struct { - Header - - buf [8]byte // Scrap buffer. - pos int64 // Current position in src. - src io.Reader // Source. - zdata []byte // Compressed data. - data []byte // Uncompressed data. - idx int // Index of unread bytes into data. - checksum xxh32.XXHZero // Frame hash. -} - -// NewReader returns a new LZ4 frame decoder. -// No access to the underlying io.Reader is performed. -func NewReader(src io.Reader) *Reader { - r := &Reader{src: src} - return r -} - -// readHeader checks the frame magic number and parses the frame descriptoz. -// Skippable frames are supported even as a first frame although the LZ4 -// specifications recommends skippable frames not to be used as first frames. -func (z *Reader) readHeader(first bool) error { - defer z.checksum.Reset() - - buf := z.buf[:] - for { - magic, err := z.readUint32() - if err != nil { - z.pos += 4 - if !first && err == io.ErrUnexpectedEOF { - return io.EOF - } - return err - } - if magic == frameMagic { - break - } - if magic>>8 != frameSkipMagic>>8 { - return ErrInvalid - } - skipSize, err := z.readUint32() - if err != nil { - return err - } - z.pos += 4 - m, err := io.CopyN(ioutil.Discard, z.src, int64(skipSize)) - if err != nil { - return err - } - z.pos += m - } - - // Header. - if _, err := io.ReadFull(z.src, buf[:2]); err != nil { - return err - } - z.pos += 8 - - b := buf[0] - if v := b >> 6; v != Version { - return fmt.Errorf("lz4: invalid version: got %d; expected %d", v, Version) - } - if b>>5&1 == 0 { - return fmt.Errorf("lz4: block dependency not supported") - } - z.BlockChecksum = b>>4&1 > 0 - frameSize := b>>3&1 > 0 - z.NoChecksum = b>>2&1 == 0 - - bmsID := buf[1] >> 4 & 0x7 - bSize, ok := bsMapID[bmsID] - if !ok { - return fmt.Errorf("lz4: invalid block max size ID: %d", bmsID) - } - z.BlockMaxSize = bSize - - // Allocate the compressed/uncompressed buffers. - // The compressed buffer cannot exceed the uncompressed one. - if n := 2 * bSize; cap(z.zdata) < n { - z.zdata = make([]byte, n, n) - } - if debugFlag { - debug("header block max size id=%d size=%d", bmsID, bSize) - } - z.zdata = z.zdata[:bSize] - z.data = z.zdata[:cap(z.zdata)][bSize:] - z.idx = len(z.data) - - z.checksum.Write(buf[0:2]) - - if frameSize { - buf := buf[:8] - if _, err := io.ReadFull(z.src, buf); err != nil { - return err - } - z.Size = binary.LittleEndian.Uint64(buf) - z.pos += 8 - z.checksum.Write(buf) - } - - // Header checksum. - if _, err := io.ReadFull(z.src, buf[:1]); err != nil { - return err - } - z.pos++ - if h := byte(z.checksum.Sum32() >> 8 & 0xFF); h != buf[0] { - return fmt.Errorf("lz4: invalid header checksum: got %x; expected %x", buf[0], h) - } - - z.Header.done = true - if debugFlag { - debug("header read: %v", z.Header) - } - - return nil -} - -// Read decompresses data from the underlying source into the supplied buffer. -// -// Since there can be multiple streams concatenated, Header values may -// change between calls to Read(). If that is the case, no data is actually read from -// the underlying io.Reader, to allow for potential input buffer resizing. -func (z *Reader) Read(buf []byte) (int, error) { - if debugFlag { - debug("Read buf len=%d", len(buf)) - } - if !z.Header.done { - if err := z.readHeader(true); err != nil { - return 0, err - } - if debugFlag { - debug("header read OK compressed buffer %d / %d uncompressed buffer %d : %d index=%d", - len(z.zdata), cap(z.zdata), len(z.data), cap(z.data), z.idx) - } - } - - if len(buf) == 0 { - return 0, nil - } - - if z.idx == len(z.data) { - // No data ready for reading, process the next block. - if debugFlag { - debug("reading block from writer") - } - // Block length: 0 = end of frame, highest bit set: uncompressed. - bLen, err := z.readUint32() - if err != nil { - return 0, err - } - z.pos += 4 - - if bLen == 0 { - // End of frame reached. - if !z.NoChecksum { - // Validate the frame checksum. - checksum, err := z.readUint32() - if err != nil { - return 0, err - } - if debugFlag { - debug("frame checksum got=%x / want=%x", z.checksum.Sum32(), checksum) - } - z.pos += 4 - if h := z.checksum.Sum32(); checksum != h { - return 0, fmt.Errorf("lz4: invalid frame checksum: got %x; expected %x", h, checksum) - } - } - - // Get ready for the next concatenated frame and keep the position. - pos := z.pos - z.Reset(z.src) - z.pos = pos - - // Since multiple frames can be concatenated, check for more. - return 0, z.readHeader(false) - } - - if debugFlag { - debug("raw block size %d", bLen) - } - if bLen&compressedBlockFlag > 0 { - // Uncompressed block. - bLen &= compressedBlockMask - if debugFlag { - debug("uncompressed block size %d", bLen) - } - if int(bLen) > cap(z.data) { - return 0, fmt.Errorf("lz4: invalid block size: %d", bLen) - } - z.data = z.data[:bLen] - if _, err := io.ReadFull(z.src, z.data); err != nil { - return 0, err - } - z.pos += int64(bLen) - - if z.BlockChecksum { - checksum, err := z.readUint32() - if err != nil { - return 0, err - } - z.pos += 4 - - if h := xxh32.ChecksumZero(z.data); h != checksum { - return 0, fmt.Errorf("lz4: invalid block checksum: got %x; expected %x", h, checksum) - } - } - - } else { - // Compressed block. - if debugFlag { - debug("compressed block size %d", bLen) - } - if int(bLen) > cap(z.data) { - return 0, fmt.Errorf("lz4: invalid block size: %d", bLen) - } - zdata := z.zdata[:bLen] - if _, err := io.ReadFull(z.src, zdata); err != nil { - return 0, err - } - z.pos += int64(bLen) - - if z.BlockChecksum { - checksum, err := z.readUint32() - if err != nil { - return 0, err - } - z.pos += 4 - - if h := xxh32.ChecksumZero(zdata); h != checksum { - return 0, fmt.Errorf("lz4: invalid block checksum: got %x; expected %x", h, checksum) - } - } - - n, err := UncompressBlock(zdata, z.data) - if err != nil { - return 0, err - } - z.data = z.data[:n] - } - - if !z.NoChecksum { - z.checksum.Write(z.data) - if debugFlag { - debug("current frame checksum %x", z.checksum.Sum32()) - } - } - z.idx = 0 - } - - n := copy(buf, z.data[z.idx:]) - z.idx += n - if debugFlag { - debug("copied %d bytes to input", n) - } - - return n, nil -} - -// Reset discards the Reader's state and makes it equivalent to the -// result of its original state from NewReader, but reading from r instead. -// This permits reusing a Reader rather than allocating a new one. -func (z *Reader) Reset(r io.Reader) { - z.Header = Header{} - z.pos = 0 - z.src = r - z.zdata = z.zdata[:0] - z.data = z.data[:0] - z.idx = 0 - z.checksum.Reset() -} - -// readUint32 reads an uint32 into the supplied buffer. -// The idea is to make use of the already allocated buffers avoiding additional allocations. -func (z *Reader) readUint32() (uint32, error) { - buf := z.buf[:4] - _, err := io.ReadFull(z.src, buf) - x := binary.LittleEndian.Uint32(buf) - return x, err -} diff --git a/vendor/github.com/pierrec/lz4/.gitignore b/vendor/github.com/pierrec/lz4/v4/.gitignore similarity index 96% rename from vendor/github.com/pierrec/lz4/.gitignore rename to vendor/github.com/pierrec/lz4/v4/.gitignore index e48bab32a5..5e98735047 100644 --- a/vendor/github.com/pierrec/lz4/.gitignore +++ b/vendor/github.com/pierrec/lz4/v4/.gitignore @@ -30,4 +30,5 @@ Temporary Items # End of https://www.gitignore.io/api/macos -lz4c/lz4c +cmd/*/*exe +.idea \ No newline at end of file diff --git a/vendor/github.com/pierrec/lz4/v4/.travis.yml b/vendor/github.com/pierrec/lz4/v4/.travis.yml new file mode 100644 index 0000000000..4a9819e03a --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/.travis.yml @@ -0,0 +1,19 @@ +language: go + +env: + - GO111MODULE=off + +go: + - 1.13.x + - 1.14.x + +matrix: + fast_finish: true + +sudo: false + +script: + - go test -v -cpu=2 + - go test -v -cpu=2 -race + - go test -v -cpu=2 -tags noasm + - go test -v -cpu=2 -race -tags noasm diff --git a/vendor/github.com/pierrec/lz4/LICENSE b/vendor/github.com/pierrec/lz4/v4/LICENSE similarity index 100% rename from vendor/github.com/pierrec/lz4/LICENSE rename to vendor/github.com/pierrec/lz4/v4/LICENSE diff --git a/vendor/github.com/pierrec/lz4/v4/README.md b/vendor/github.com/pierrec/lz4/v4/README.md new file mode 100644 index 0000000000..4ee388e81b --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/README.md @@ -0,0 +1,90 @@ +# lz4 : LZ4 compression in pure Go + +[![GoDoc](https://godoc.org/github.com/pierrec/lz4?status.svg)](https://godoc.org/github.com/pierrec/lz4) +[![Build Status](https://travis-ci.org/pierrec/lz4.svg?branch=master)](https://travis-ci.org/pierrec/lz4) +[![Go Report Card](https://goreportcard.com/badge/github.com/pierrec/lz4)](https://goreportcard.com/report/github.com/pierrec/lz4) +[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/pierrec/lz4.svg?style=social)](https://github.com/pierrec/lz4/tags) + +## Overview + +This package provides a streaming interface to [LZ4 data streams](http://fastcompression.blogspot.fr/2013/04/lz4-streaming-format-final.html) as well as low level compress and uncompress functions for LZ4 data blocks. +The implementation is based on the reference C [one](https://github.com/lz4/lz4). + +## Install + +Assuming you have the go toolchain installed: + +``` +go get github.com/pierrec/lz4 +``` + +There is a command line interface tool to compress and decompress LZ4 files. + +``` +go install github.com/pierrec/lz4/cmd/lz4c +``` + +Usage + +``` +Usage of lz4c: + -version + print the program version + +Subcommands: +Compress the given files or from stdin to stdout. +compress [arguments] [ ...] + -bc + enable block checksum + -l int + compression level (0=fastest) + -sc + disable stream checksum + -size string + block max size [64K,256K,1M,4M] (default "4M") + +Uncompress the given files or from stdin to stdout. +uncompress [arguments] [ ...] + +``` + + +## Example + +``` +// Compress and uncompress an input string. +s := "hello world" +r := strings.NewReader(s) + +// The pipe will uncompress the data from the writer. +pr, pw := io.Pipe() +zw := lz4.NewWriter(pw) +zr := lz4.NewReader(pr) + +go func() { + // Compress the input string. + _, _ = io.Copy(zw, r) + _ = zw.Close() // Make sure the writer is closed + _ = pw.Close() // Terminate the pipe +}() + +_, _ = io.Copy(os.Stdout, zr) + +// Output: +// hello world +``` + +## Contributing + +Contributions are very welcome for bug fixing, performance improvements...! + +- Open an issue with a proper description +- Send a pull request with appropriate test case(s) + +## Contributors + +Thanks to all [contributors](https://github.com/pierrec/lz4/graphs/contributors) so far! + +Special thanks to [@Zariel](https://github.com/Zariel) for his asm implementation of the decoder. + +Special thanks to [@klauspost](https://github.com/klauspost) for his work on optimizing the code. diff --git a/vendor/github.com/pierrec/lz4/v4/go.mod b/vendor/github.com/pierrec/lz4/v4/go.mod new file mode 100644 index 0000000000..42229b2967 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/go.mod @@ -0,0 +1,3 @@ +module github.com/pierrec/lz4/v4 + +go 1.14 diff --git a/vendor/github.com/pierrec/lz4/v4/go.sum b/vendor/github.com/pierrec/lz4/v4/go.sum new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/block.go b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/block.go new file mode 100644 index 0000000000..e634c2cb8a --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/block.go @@ -0,0 +1,469 @@ +package lz4block + +import ( + "encoding/binary" + "math/bits" + "sync" + + "github.com/pierrec/lz4/v4/internal/lz4errors" +) + +const ( + // The following constants are used to setup the compression algorithm. + minMatch = 4 // the minimum size of the match sequence size (4 bytes) + winSizeLog = 16 // LZ4 64Kb window size limit + winSize = 1 << winSizeLog + winMask = winSize - 1 // 64Kb window of previous data for dependent blocks + + // hashLog determines the size of the hash table used to quickly find a previous match position. + // Its value influences the compression speed and memory usage, the lower the faster, + // but at the expense of the compression ratio. + // 16 seems to be the best compromise for fast compression. + hashLog = 16 + htSize = 1 << hashLog + + mfLimit = 10 + minMatch // The last match cannot start within the last 14 bytes. +) + +func recoverBlock(e *error) { + if r := recover(); r != nil && *e == nil { + *e = lz4errors.ErrInvalidSourceShortBuffer + } +} + +// blockHash hashes the lower 6 bytes into a value < htSize. +func blockHash(x uint64) uint32 { + const prime6bytes = 227718039650203 + return uint32(((x << (64 - 48)) * prime6bytes) >> (64 - hashLog)) +} + +func CompressBlockBound(n int) int { + return n + n/255 + 16 +} + +func UncompressBlock(src, dst []byte) (int, error) { + if len(src) == 0 { + return 0, nil + } + if di := decodeBlock(dst, src); di >= 0 { + return di, nil + } + return 0, lz4errors.ErrInvalidSourceShortBuffer +} + +type Compressor struct { + // Offsets are at most 64kiB, so we can store only the lower 16 bits of + // match positions: effectively, an offset from some 64kiB block boundary. + // + // When we retrieve such an offset, we interpret it as relative to the last + // block boundary si &^ 0xffff, or the one before, (si &^ 0xffff) - 0x10000, + // depending on which of these is inside the current window. If a table + // entry was generated more than 64kiB back in the input, we find out by + // inspecting the input stream. + table [htSize]uint16 + + needsReset bool +} + +// Get returns the position of a presumptive match for the hash h. +// The match may be a false positive due to a hash collision or an old entry. +// If si < winSize, the return value may be negative. +func (c *Compressor) get(h uint32, si int) int { + h &= htSize - 1 + i := int(c.table[h]) + i += si &^ winMask + if i >= si { + // Try previous 64kiB block (negative when in first block). + i -= winSize + } + return i +} + +func (c *Compressor) put(h uint32, si int) { + h &= htSize - 1 + c.table[h] = uint16(si) +} + +var compressorPool = sync.Pool{New: func() interface{} { return new(Compressor) }} + +func CompressBlock(src, dst []byte) (int, error) { + c := compressorPool.Get().(*Compressor) + n, err := c.CompressBlock(src, dst) + compressorPool.Put(c) + return n, err +} + +func (c *Compressor) CompressBlock(src, dst []byte) (int, error) { + if c.needsReset { + // Zero out reused table to avoid non-deterministic output (issue #65). + c.table = [htSize]uint16{} + } + c.needsReset = true // Only false on first call. + + // Return 0, nil only if the destination buffer size is < CompressBlockBound. + isNotCompressible := len(dst) < CompressBlockBound(len(src)) + + // adaptSkipLog sets how quickly the compressor begins skipping blocks when data is incompressible. + // This significantly speeds up incompressible data and usually has very small impact on compression. + // bytes to skip = 1 + (bytes since last match >> adaptSkipLog) + const adaptSkipLog = 7 + + // si: Current position of the search. + // anchor: Position of the current literals. + var si, di, anchor int + sn := len(src) - mfLimit + if sn <= 0 { + goto lastLiterals + } + + // Fast scan strategy: the hash table only stores the last 4 bytes sequences. + for si < sn { + // Hash the next 6 bytes (sequence)... + match := binary.LittleEndian.Uint64(src[si:]) + h := blockHash(match) + h2 := blockHash(match >> 8) + + // We check a match at s, s+1 and s+2 and pick the first one we get. + // Checking 3 only requires us to load the source one. + ref := c.get(h, si) + ref2 := c.get(h2, si) + c.put(h, si) + c.put(h2, si+1) + + offset := si - ref + + if ref < 0 || uint32(match) != binary.LittleEndian.Uint32(src[ref:]) { + // No match. Start calculating another hash. + // The processor can usually do this out-of-order. + h = blockHash(match >> 16) + ref3 := c.get(h, si+2) + + // Check the second match at si+1 + si += 1 + offset = si - ref2 + + if ref2 < 0 || uint32(match>>8) != binary.LittleEndian.Uint32(src[ref2:]) { + // No match. Check the third match at si+2 + si += 1 + offset = si - ref3 + c.put(h, si) + + if ref3 < 0 || uint32(match>>16) != binary.LittleEndian.Uint32(src[ref3:]) { + // Skip one extra byte (at si+3) before we check 3 matches again. + si += 2 + (si-anchor)>>adaptSkipLog + continue + } + } + } + + // Match found. + lLen := si - anchor // Literal length. + // We already matched 4 bytes. + mLen := 4 + + // Extend backwards if we can, reducing literals. + tOff := si - offset - 1 + for lLen > 0 && tOff >= 0 && src[si-1] == src[tOff] { + si-- + tOff-- + lLen-- + mLen++ + } + + // Add the match length, so we continue search at the end. + // Use mLen to store the offset base. + si, mLen = si+mLen, si+minMatch + + // Find the longest match by looking by batches of 8 bytes. + for si+8 < sn { + x := binary.LittleEndian.Uint64(src[si:]) ^ binary.LittleEndian.Uint64(src[si-offset:]) + if x == 0 { + si += 8 + } else { + // Stop is first non-zero byte. + si += bits.TrailingZeros64(x) >> 3 + break + } + } + + mLen = si - mLen + if mLen < 0xF { + dst[di] = byte(mLen) + } else { + dst[di] = 0xF + } + + // Encode literals length. + if lLen < 0xF { + dst[di] |= byte(lLen << 4) + } else { + dst[di] |= 0xF0 + di++ + l := lLen - 0xF + for ; l >= 0xFF; l -= 0xFF { + dst[di] = 0xFF + di++ + } + dst[di] = byte(l) + } + di++ + + // Literals. + if di+lLen > len(dst) { + return 0, lz4errors.ErrInvalidSourceShortBuffer + } + copy(dst[di:di+lLen], src[anchor:anchor+lLen]) + di += lLen + 2 + anchor = si + + // Encode offset. + if di > len(dst) { + return 0, lz4errors.ErrInvalidSourceShortBuffer + } + dst[di-2], dst[di-1] = byte(offset), byte(offset>>8) + + // Encode match length part 2. + if mLen >= 0xF { + for mLen -= 0xF; mLen >= 0xFF && di < len(dst); mLen -= 0xFF { + dst[di] = 0xFF + di++ + } + if di >= len(dst) { + return 0, lz4errors.ErrInvalidSourceShortBuffer + } + dst[di] = byte(mLen) + di++ + } + // Check if we can load next values. + if si >= sn { + break + } + // Hash match end-2 + h = blockHash(binary.LittleEndian.Uint64(src[si-2:])) + c.put(h, si-2) + } + +lastLiterals: + if isNotCompressible && anchor == 0 { + // Incompressible. + return 0, nil + } + + // Last literals. + if di >= len(dst) { + return 0, lz4errors.ErrInvalidSourceShortBuffer + } + lLen := len(src) - anchor + if lLen < 0xF { + dst[di] = byte(lLen << 4) + } else { + dst[di] = 0xF0 + di++ + for lLen -= 0xF; lLen >= 0xFF && di < len(dst); lLen -= 0xFF { + dst[di] = 0xFF + di++ + } + if di >= len(dst) { + return 0, lz4errors.ErrInvalidSourceShortBuffer + } + dst[di] = byte(lLen) + } + di++ + + // Write the last literals. + if isNotCompressible && di >= anchor { + // Incompressible. + return 0, nil + } + if di+len(src)-anchor > len(dst) { + return 0, lz4errors.ErrInvalidSourceShortBuffer + } + di += copy(dst[di:di+len(src)-anchor], src[anchor:]) + return di, nil +} + +// blockHash hashes 4 bytes into a value < winSize. +func blockHashHC(x uint32) uint32 { + const hasher uint32 = 2654435761 // Knuth multiplicative hash. + return x * hasher >> (32 - winSizeLog) +} + +type CompressorHC struct { + // hashTable: stores the last position found for a given hash + // chainTable: stores previous positions for a given hash + hashTable, chainTable [htSize]int + needsReset bool +} + +var compressorHCPool = sync.Pool{New: func() interface{} { return new(CompressorHC) }} + +func CompressBlockHC(src, dst []byte, depth CompressionLevel) (int, error) { + c := compressorHCPool.Get().(*CompressorHC) + n, err := c.CompressBlock(src, dst, depth) + compressorHCPool.Put(c) + return n, err +} + +func (c *CompressorHC) CompressBlock(src, dst []byte, depth CompressionLevel) (_ int, err error) { + if c.needsReset { + // Zero out reused table to avoid non-deterministic output (issue #65). + c.hashTable = [htSize]int{} + c.chainTable = [htSize]int{} + } + c.needsReset = true // Only false on first call. + + defer recoverBlock(&err) + + // Return 0, nil only if the destination buffer size is < CompressBlockBound. + isNotCompressible := len(dst) < CompressBlockBound(len(src)) + + // adaptSkipLog sets how quickly the compressor begins skipping blocks when data is incompressible. + // This significantly speeds up incompressible data and usually has very small impact on compression. + // bytes to skip = 1 + (bytes since last match >> adaptSkipLog) + const adaptSkipLog = 7 + + var si, di, anchor int + sn := len(src) - mfLimit + if sn <= 0 { + goto lastLiterals + } + + if depth == 0 { + depth = winSize + } + + for si < sn { + // Hash the next 4 bytes (sequence). + match := binary.LittleEndian.Uint32(src[si:]) + h := blockHashHC(match) + + // Follow the chain until out of window and give the longest match. + mLen := 0 + offset := 0 + for next, try := c.hashTable[h], depth; try > 0 && next > 0 && si-next < winSize; next, try = c.chainTable[next&winMask], try-1 { + // The first (mLen==0) or next byte (mLen>=minMatch) at current match length + // must match to improve on the match length. + if src[next+mLen] != src[si+mLen] { + continue + } + ml := 0 + // Compare the current position with a previous with the same hash. + for ml < sn-si { + x := binary.LittleEndian.Uint64(src[next+ml:]) ^ binary.LittleEndian.Uint64(src[si+ml:]) + if x == 0 { + ml += 8 + } else { + // Stop is first non-zero byte. + ml += bits.TrailingZeros64(x) >> 3 + break + } + } + if ml < minMatch || ml <= mLen { + // Match too small (>adaptSkipLog + continue + } + + // Match found. + // Update hash/chain tables with overlapping bytes: + // si already hashed, add everything from si+1 up to the match length. + winStart := si + 1 + if ws := si + mLen - winSize; ws > winStart { + winStart = ws + } + for si, ml := winStart, si+mLen; si < ml; { + match >>= 8 + match |= uint32(src[si+3]) << 24 + h := blockHashHC(match) + c.chainTable[si&winMask] = c.hashTable[h] + c.hashTable[h] = si + si++ + } + + lLen := si - anchor + si += mLen + mLen -= minMatch // Match length does not include minMatch. + + if mLen < 0xF { + dst[di] = byte(mLen) + } else { + dst[di] = 0xF + } + + // Encode literals length. + if lLen < 0xF { + dst[di] |= byte(lLen << 4) + } else { + dst[di] |= 0xF0 + di++ + l := lLen - 0xF + for ; l >= 0xFF; l -= 0xFF { + dst[di] = 0xFF + di++ + } + dst[di] = byte(l) + } + di++ + + // Literals. + copy(dst[di:di+lLen], src[anchor:anchor+lLen]) + di += lLen + anchor = si + + // Encode offset. + di += 2 + dst[di-2], dst[di-1] = byte(offset), byte(offset>>8) + + // Encode match length part 2. + if mLen >= 0xF { + for mLen -= 0xF; mLen >= 0xFF; mLen -= 0xFF { + dst[di] = 0xFF + di++ + } + dst[di] = byte(mLen) + di++ + } + } + + if isNotCompressible && anchor == 0 { + // Incompressible. + return 0, nil + } + + // Last literals. +lastLiterals: + lLen := len(src) - anchor + if lLen < 0xF { + dst[di] = byte(lLen << 4) + } else { + dst[di] = 0xF0 + di++ + lLen -= 0xF + for ; lLen >= 0xFF; lLen -= 0xFF { + dst[di] = 0xFF + di++ + } + dst[di] = byte(lLen) + } + di++ + + // Write the last literals. + if isNotCompressible && di >= anchor { + // Incompressible. + return 0, nil + } + di += copy(dst[di:di+len(src)-anchor], src[anchor:]) + return di, nil +} diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/blocks.go b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/blocks.go new file mode 100644 index 0000000000..098a5cf9b9 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/blocks.go @@ -0,0 +1,87 @@ +// Package lz4block provides LZ4 BlockSize types and pools of buffers. +package lz4block + +import "sync" + +const ( + Block64Kb uint32 = 1 << (16 + iota*2) + Block256Kb + Block1Mb + Block4Mb +) + +var ( + BlockPool64K = sync.Pool{New: func() interface{} { return make([]byte, Block64Kb) }} + BlockPool256K = sync.Pool{New: func() interface{} { return make([]byte, Block256Kb) }} + BlockPool1M = sync.Pool{New: func() interface{} { return make([]byte, Block1Mb) }} + BlockPool4M = sync.Pool{New: func() interface{} { return make([]byte, Block4Mb) }} +) + +func Index(b uint32) BlockSizeIndex { + switch b { + case Block64Kb: + return 4 + case Block256Kb: + return 5 + case Block1Mb: + return 6 + case Block4Mb: + return 7 + } + return 0 +} + +func IsValid(b uint32) bool { + return Index(b) > 0 +} + +type BlockSizeIndex uint8 + +func (b BlockSizeIndex) IsValid() bool { + switch b { + case 4, 5, 6, 7: + return true + } + return false +} + +func (b BlockSizeIndex) Get() []byte { + var buf interface{} + switch b { + case 4: + buf = BlockPool64K.Get() + case 5: + buf = BlockPool256K.Get() + case 6: + buf = BlockPool1M.Get() + case 7: + buf = BlockPool4M.Get() + } + return buf.([]byte) +} + +func (b BlockSizeIndex) Put(buf []byte) { + // Safeguard: do not allow invalid buffers. + switch c := uint32(cap(buf)); b { + case 4: + if c == Block64Kb { + BlockPool64K.Put(buf[:c]) + } + case 5: + if c == Block256Kb { + BlockPool256K.Put(buf[:c]) + } + case 6: + if c == Block1Mb { + BlockPool1M.Put(buf[:c]) + } + case 7: + if c == Block4Mb { + BlockPool4M.Put(buf[:c]) + } + } +} + +type CompressionLevel uint32 + +const Fast CompressionLevel = 0 diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_amd64.s b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_amd64.s new file mode 100644 index 0000000000..be79faa3fe --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_amd64.s @@ -0,0 +1,369 @@ +// +build !appengine +// +build gc +// +build !noasm + +#include "textflag.h" + +// AX scratch +// BX scratch +// CX scratch +// DX token +// +// DI &dst +// SI &src +// R8 &dst + len(dst) +// R9 &src + len(src) +// R11 &dst +// R12 short output end +// R13 short input end +// func decodeBlock(dst, src []byte) int +// using 50 bytes of stack currently +TEXT ·decodeBlock(SB), NOSPLIT, $64-56 + MOVQ dst_base+0(FP), DI + MOVQ DI, R11 + MOVQ dst_len+8(FP), R8 + ADDQ DI, R8 + + MOVQ src_base+24(FP), SI + MOVQ src_len+32(FP), R9 + CMPQ R9, $0 + JE err_corrupt + ADDQ SI, R9 + + // shortcut ends + // short output end + MOVQ R8, R12 + SUBQ $32, R12 + // short input end + MOVQ R9, R13 + SUBQ $16, R13 + +loop: + // for si < len(src) + CMPQ SI, R9 + JGE end + + // token := uint32(src[si]) + MOVBQZX (SI), DX + INCQ SI + + // lit_len = token >> 4 + // if lit_len > 0 + // CX = lit_len + MOVQ DX, CX + SHRQ $4, CX + + // if lit_len != 0xF + CMPQ CX, $0xF + JEQ lit_len_loop_pre + CMPQ DI, R12 + JGE lit_len_loop_pre + CMPQ SI, R13 + JGE lit_len_loop_pre + + // copy shortcut + + // A two-stage shortcut for the most common case: + // 1) If the literal length is 0..14, and there is enough space, + // enter the shortcut and copy 16 bytes on behalf of the literals + // (in the fast mode, only 8 bytes can be safely copied this way). + // 2) Further if the match length is 4..18, copy 18 bytes in a similar + // manner; but we ensure that there's enough space in the output for + // those 18 bytes earlier, upon entering the shortcut (in other words, + // there is a combined check for both stages). + + // copy literal + MOVOU (SI), X0 + MOVOU X0, (DI) + ADDQ CX, DI + ADDQ CX, SI + + MOVQ DX, CX + ANDQ $0xF, CX + + // The second stage: prepare for match copying, decode full info. + // If it doesn't work out, the info won't be wasted. + // offset := uint16(data[:2]) + MOVWQZX (SI), DX + ADDQ $2, SI + + MOVQ DI, AX + SUBQ DX, AX + CMPQ AX, DI + JGT err_short_buf + + // if we can't do the second stage then jump straight to read the + // match length, we already have the offset. + CMPQ CX, $0xF + JEQ match_len_loop_pre + CMPQ DX, $8 + JLT match_len_loop_pre + CMPQ AX, R11 + JLT err_short_buf + + // memcpy(op + 0, match + 0, 8); + MOVQ (AX), BX + MOVQ BX, (DI) + // memcpy(op + 8, match + 8, 8); + MOVQ 8(AX), BX + MOVQ BX, 8(DI) + // memcpy(op +16, match +16, 2); + MOVW 16(AX), BX + MOVW BX, 16(DI) + + LEAQ 4(DI)(CX*1), DI // minmatch + + // shortcut complete, load next token + JMP loop + +lit_len_loop_pre: + // if lit_len > 0 + CMPQ CX, $0 + JEQ offset + CMPQ CX, $0xF + JNE copy_literal + +lit_len_loop: + // for src[si] == 0xFF + CMPB (SI), $0xFF + JNE lit_len_finalise + + // bounds check src[si+1] + LEAQ 1(SI), AX + CMPQ AX, R9 + JGT err_short_buf + + // lit_len += 0xFF + ADDQ $0xFF, CX + INCQ SI + JMP lit_len_loop + +lit_len_finalise: + // lit_len += int(src[si]) + // si++ + MOVBQZX (SI), AX + ADDQ AX, CX + INCQ SI + +copy_literal: + // bounds check src and dst + LEAQ (SI)(CX*1), AX + CMPQ AX, R9 + JGT err_short_buf + + LEAQ (DI)(CX*1), AX + CMPQ AX, R8 + JGT err_short_buf + + // whats a good cut off to call memmove? + CMPQ CX, $16 + JGT memmove_lit + + // if len(dst[di:]) < 16 + MOVQ R8, AX + SUBQ DI, AX + CMPQ AX, $16 + JLT memmove_lit + + // if len(src[si:]) < 16 + MOVQ R9, AX + SUBQ SI, AX + CMPQ AX, $16 + JLT memmove_lit + + MOVOU (SI), X0 + MOVOU X0, (DI) + + JMP finish_lit_copy + +memmove_lit: + // memmove(to, from, len) + MOVQ DI, 0(SP) + MOVQ SI, 8(SP) + MOVQ CX, 16(SP) + // spill + MOVQ DI, 24(SP) + MOVQ SI, 32(SP) + MOVQ CX, 40(SP) // need len to inc SI, DI after + MOVB DX, 48(SP) + CALL runtime·memmove(SB) + + // restore registers + MOVQ 24(SP), DI + MOVQ 32(SP), SI + MOVQ 40(SP), CX + MOVB 48(SP), DX + + // recalc initial values + MOVQ dst_base+0(FP), R8 + MOVQ R8, R11 + ADDQ dst_len+8(FP), R8 + MOVQ src_base+24(FP), R9 + ADDQ src_len+32(FP), R9 + MOVQ R8, R12 + SUBQ $32, R12 + MOVQ R9, R13 + SUBQ $16, R13 + +finish_lit_copy: + ADDQ CX, SI + ADDQ CX, DI + + CMPQ SI, R9 + JGE end + +offset: + // CX := mLen + // free up DX to use for offset + MOVQ DX, CX + + LEAQ 2(SI), AX + CMPQ AX, R9 + JGT err_short_buf + + // offset + // DX := int(src[si]) | int(src[si+1])<<8 + MOVWQZX (SI), DX + ADDQ $2, SI + + // 0 offset is invalid + CMPQ DX, $0 + JEQ err_corrupt + + ANDB $0xF, CX + +match_len_loop_pre: + // if mlen != 0xF + CMPB CX, $0xF + JNE copy_match + +match_len_loop: + // for src[si] == 0xFF + // lit_len += 0xFF + CMPB (SI), $0xFF + JNE match_len_finalise + + // bounds check src[si+1] + LEAQ 1(SI), AX + CMPQ AX, R9 + JGT err_short_buf + + ADDQ $0xFF, CX + INCQ SI + JMP match_len_loop + +match_len_finalise: + // lit_len += int(src[si]) + // si++ + MOVBQZX (SI), AX + ADDQ AX, CX + INCQ SI + +copy_match: + // mLen += minMatch + ADDQ $4, CX + + // check we have match_len bytes left in dst + // di+match_len < len(dst) + LEAQ (DI)(CX*1), AX + CMPQ AX, R8 + JGT err_short_buf + + // DX = offset + // CX = match_len + // BX = &dst + (di - offset) + MOVQ DI, BX + SUBQ DX, BX + + // check BX is within dst + // if BX < &dst + CMPQ BX, R11 + JLT err_short_buf + + // if offset + match_len < di + LEAQ (BX)(CX*1), AX + CMPQ DI, AX + JGT copy_interior_match + + // AX := len(dst[:di]) + // MOVQ DI, AX + // SUBQ R11, AX + + // copy 16 bytes at a time + // if di-offset < 16 copy 16-(di-offset) bytes to di + // then do the remaining + +copy_match_loop: + // for match_len >= 0 + // dst[di] = dst[i] + // di++ + // i++ + MOVB (BX), AX + MOVB AX, (DI) + INCQ DI + INCQ BX + DECQ CX + + CMPQ CX, $0 + JGT copy_match_loop + + JMP loop + +copy_interior_match: + CMPQ CX, $16 + JGT memmove_match + + // if len(dst[di:]) < 16 + MOVQ R8, AX + SUBQ DI, AX + CMPQ AX, $16 + JLT memmove_match + + MOVOU (BX), X0 + MOVOU X0, (DI) + + ADDQ CX, DI + JMP loop + +memmove_match: + // memmove(to, from, len) + MOVQ DI, 0(SP) + MOVQ BX, 8(SP) + MOVQ CX, 16(SP) + // spill + MOVQ DI, 24(SP) + MOVQ SI, 32(SP) + MOVQ CX, 40(SP) // need len to inc SI, DI after + CALL runtime·memmove(SB) + + // restore registers + MOVQ 24(SP), DI + MOVQ 32(SP), SI + MOVQ 40(SP), CX + + // recalc initial values + MOVQ dst_base+0(FP), R8 + MOVQ R8, R11 // TODO: make these sensible numbers + ADDQ dst_len+8(FP), R8 + MOVQ src_base+24(FP), R9 + ADDQ src_len+32(FP), R9 + MOVQ R8, R12 + SUBQ $32, R12 + MOVQ R9, R13 + SUBQ $16, R13 + + ADDQ CX, DI + JMP loop + +err_corrupt: + MOVQ $-1, ret+48(FP) + RET + +err_short_buf: + MOVQ $-2, ret+48(FP) + RET + +end: + SUBQ R11, DI + MOVQ DI, ret+48(FP) + RET diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_arm.s b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_arm.s new file mode 100644 index 0000000000..ec94b7b3c3 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_arm.s @@ -0,0 +1,201 @@ +// +build gc +// +build !noasm + +#include "textflag.h" + +// Register allocation. +#define dst R0 +#define dstorig R1 +#define src R2 +#define dstend R3 +#define srcend R4 +#define match R5 // Match address. +#define token R6 +#define len R7 // Literal and match lengths. +#define offset R6 // Match offset; overlaps with token. +#define tmp1 R8 +#define tmp2 R9 +#define tmp3 R12 + +#define minMatch $4 + +// func decodeBlock(dst, src []byte) int +TEXT ·decodeBlock(SB), NOFRAME|NOSPLIT, $-4-28 + MOVW dst_base +0(FP), dst + MOVW dst_len +4(FP), dstend + MOVW src_base+12(FP), src + MOVW src_len +16(FP), srcend + + CMP $0, srcend + BEQ shortSrc + + ADD dst, dstend + ADD src, srcend + + MOVW dst, dstorig + +loop: + // Read token. Extract literal length. + MOVBU.P 1(src), token + MOVW token >> 4, len + CMP $15, len + BNE readLitlenDone + +readLitlenLoop: + CMP src, srcend + BEQ shortSrc + MOVBU.P 1(src), tmp1 + ADD tmp1, len + CMP $255, tmp1 + BEQ readLitlenLoop + +readLitlenDone: + CMP $0, len + BEQ copyLiteralDone + + // Bounds check dst+len and src+len. + ADD dst, len, tmp1 + CMP dstend, tmp1 + //BHI shortDst // Uncomment for distinct error codes. + ADD src, len, tmp2 + CMP.LS srcend, tmp2 + BHI shortSrc + + // Copy literal. + CMP $4, len + BLO copyLiteralFinish + + // Copy 0-3 bytes until src is aligned. + TST $1, src + MOVBU.NE.P 1(src), tmp1 + MOVB.NE.P tmp1, 1(dst) + SUB.NE $1, len + + TST $2, src + MOVHU.NE.P 2(src), tmp2 + MOVB.NE.P tmp2, 1(dst) + MOVW.NE tmp2 >> 8, tmp1 + MOVB.NE.P tmp1, 1(dst) + SUB.NE $2, len + + B copyLiteralLoopCond + +copyLiteralLoop: + // Aligned load, unaligned write. + MOVW.P 4(src), tmp1 + MOVW tmp1 >> 8, tmp2 + MOVB tmp2, 1(dst) + MOVW tmp1 >> 16, tmp3 + MOVB tmp3, 2(dst) + MOVW tmp1 >> 24, tmp2 + MOVB tmp2, 3(dst) + MOVB.P tmp1, 4(dst) +copyLiteralLoopCond: + // Loop until len-4 < 0. + SUB.S $4, len + BPL copyLiteralLoop + + // Restore len, which is now negative. + ADD $4, len + +copyLiteralFinish: + // Copy remaining 0-3 bytes. + TST $2, len + MOVHU.NE.P 2(src), tmp2 + MOVB.NE.P tmp2, 1(dst) + MOVW.NE tmp2 >> 8, tmp1 + MOVB.NE.P tmp1, 1(dst) + TST $1, len + MOVBU.NE.P 1(src), tmp1 + MOVB.NE.P tmp1, 1(dst) + +copyLiteralDone: + CMP src, srcend + BEQ end + + // Initial part of match length. + // This frees up the token register for reuse as offset. + AND $15, token, len + + // Read offset. + ADD $2, src + CMP srcend, src + BHI shortSrc + MOVBU -2(src), offset + MOVBU -1(src), tmp1 + ORR tmp1 << 8, offset + CMP $0, offset + BEQ corrupt + + // Read rest of match length. + CMP $15, len + BNE readMatchlenDone + +readMatchlenLoop: + CMP src, srcend + BEQ shortSrc + MOVBU.P 1(src), tmp1 + ADD tmp1, len + CMP $255, tmp1 + BEQ readMatchlenLoop + +readMatchlenDone: + ADD minMatch, len + + // Bounds check dst+len and match = dst-offset. + ADD dst, len, tmp1 + CMP dstend, tmp1 + //BHI shortDst // Uncomment for distinct error codes. + SUB offset, dst, match + CMP.LS match, dstorig + BHI corrupt + + // If the offset is at least four (len is, because of minMatch), + // do a four-way unrolled byte copy loop. Using MOVD instead of four + // byte loads is much faster, but to remain portable we'd have to + // align match first, which in turn is too expensive. + CMP $4, offset + BLO copyMatch + + SUB $4, len +copyMatch4: + MOVBU.P 4(match), tmp1 + MOVB.P tmp1, 4(dst) + MOVBU -3(match), tmp2 + MOVB tmp2, -3(dst) + MOVBU -2(match), tmp3 + MOVB tmp3, -2(dst) + MOVBU -1(match), tmp1 + MOVB tmp1, -1(dst) + SUB.S $4, len + BPL copyMatch4 + + // Restore len, which is now negative. + ADD.S $4, len + BEQ copyMatchDone + +copyMatch: + // Simple byte-at-a-time copy. + SUB.S $1, len + MOVBU.P 1(match), tmp2 + MOVB.P tmp2, 1(dst) + BNE copyMatch + +copyMatchDone: + CMP src, srcend + BNE loop + +end: + SUB dstorig, dst, tmp1 + MOVW tmp1, ret+24(FP) + RET + + // The three error cases have distinct labels so we can put different + // return codes here when debugging, or if the error returns need to + // be changed. +shortDst: +shortSrc: +corrupt: + MOVW $-1, tmp1 + MOVW tmp1, ret+24(FP) + RET diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_asm.go b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_asm.go new file mode 100644 index 0000000000..e26f8cd613 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_asm.go @@ -0,0 +1,9 @@ +// +build amd64 arm +// +build !appengine +// +build gc +// +build !noasm + +package lz4block + +//go:noescape +func decodeBlock(dst, src []byte) int diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_other.go b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_other.go new file mode 100644 index 0000000000..9065653a9f --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_other.go @@ -0,0 +1,100 @@ +// +build !amd64,!arm appengine !gc noasm + +package lz4block + +func decodeBlock(dst, src []byte) (ret int) { + const hasError = -2 + defer func() { + if recover() != nil { + ret = hasError + } + }() + + var si, di uint + for { + // Literals and match lengths (token). + b := uint(src[si]) + si++ + + // Literals. + if lLen := b >> 4; lLen > 0 { + switch { + case lLen < 0xF && si+16 < uint(len(src)): + // Shortcut 1 + // if we have enough room in src and dst, and the literals length + // is small enough (0..14) then copy all 16 bytes, even if not all + // are part of the literals. + copy(dst[di:], src[si:si+16]) + si += lLen + di += lLen + if mLen := b & 0xF; mLen < 0xF { + // Shortcut 2 + // if the match length (4..18) fits within the literals, then copy + // all 18 bytes, even if not all are part of the literals. + mLen += 4 + if offset := uint(src[si]) | uint(src[si+1])<<8; mLen <= offset { + i := di - offset + end := i + 18 + if end > uint(len(dst)) { + // The remaining buffer may not hold 18 bytes. + // See https://github.com/pierrec/lz4/issues/51. + end = uint(len(dst)) + } + copy(dst[di:], dst[i:end]) + si += 2 + di += mLen + continue + } + } + case lLen == 0xF: + for src[si] == 0xFF { + lLen += 0xFF + si++ + } + lLen += uint(src[si]) + si++ + fallthrough + default: + copy(dst[di:di+lLen], src[si:si+lLen]) + si += lLen + di += lLen + } + } + if si == uint(len(src)) { + return int(di) + } else if si > uint(len(src)) { + return hasError + } + + offset := uint(src[si]) | uint(src[si+1])<<8 + if offset == 0 { + return hasError + } + si += 2 + + // Match. + mLen := b & 0xF + if mLen == 0xF { + for src[si] == 0xFF { + mLen += 0xFF + si++ + } + mLen += uint(src[si]) + si++ + } + mLen += minMatch + + // Copy the match. + expanded := dst[di-offset:] + if mLen > offset { + // Efficiently copy the match dst[di-offset:di] into the dst slice. + bytesToCopy := offset * (mLen / offset) + for n := offset; n <= bytesToCopy+offset; n *= 2 { + copy(expanded[n:], expanded[:n]) + } + di += bytesToCopy + mLen -= bytesToCopy + } + di += uint(copy(dst[di:di+mLen], expanded[:mLen])) + } +} diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4errors/errors.go b/vendor/github.com/pierrec/lz4/v4/internal/lz4errors/errors.go new file mode 100644 index 0000000000..710ea42812 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/internal/lz4errors/errors.go @@ -0,0 +1,19 @@ +package lz4errors + +type Error string + +func (e Error) Error() string { return string(e) } + +const ( + ErrInvalidSourceShortBuffer Error = "lz4: invalid source or destination buffer too short" + ErrInvalidFrame Error = "lz4: bad magic number" + ErrInternalUnhandledState Error = "lz4: unhandled state" + ErrInvalidHeaderChecksum Error = "lz4: invalid header checksum" + ErrInvalidBlockChecksum Error = "lz4: invalid block checksum" + ErrInvalidFrameChecksum Error = "lz4: invalid frame checksum" + ErrOptionInvalidCompressionLevel Error = "lz4: invalid compression level" + ErrOptionClosedOrError Error = "lz4: cannot apply options on closed or in error object" + ErrOptionInvalidBlockSize Error = "lz4: invalid block size" + ErrOptionNotApplicable Error = "lz4: option not applicable" + ErrWriterNotClosed Error = "lz4: writer not closed" +) diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4stream/frame.go b/vendor/github.com/pierrec/lz4/v4/internal/lz4stream/frame.go new file mode 100644 index 0000000000..f6ab4decb7 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/internal/lz4stream/frame.go @@ -0,0 +1,377 @@ +// Package lz4stream provides the types that support reading and writing LZ4 data streams. +package lz4stream + +import ( + "encoding/binary" + "fmt" + "io" + "io/ioutil" + + "github.com/pierrec/lz4/v4/internal/lz4block" + "github.com/pierrec/lz4/v4/internal/lz4errors" + "github.com/pierrec/lz4/v4/internal/xxh32" +) + +//go:generate go run gen.go + +const ( + frameMagic uint32 = 0x184D2204 + frameSkipMagic uint32 = 0x184D2A50 +) + +func NewFrame() *Frame { + return &Frame{} +} + +type Frame struct { + buf [15]byte // frame descriptor needs at most 4(magic)+4+8+1=11 bytes + Magic uint32 + Descriptor FrameDescriptor + Blocks Blocks + Checksum uint32 + checksum xxh32.XXHZero +} + +// Reset allows reusing the Frame. +// The Descriptor configuration is not modified. +func (f *Frame) Reset(num int) { + f.Magic = 0 + f.Descriptor.Checksum = 0 + f.Descriptor.ContentSize = 0 + _ = f.Blocks.closeW(f, num) + f.Checksum = 0 +} + +func (f *Frame) InitW(dst io.Writer, num int) { + f.Magic = frameMagic + f.Descriptor.initW() + f.Blocks.initW(f, dst, num) + f.checksum.Reset() +} + +func (f *Frame) CloseW(dst io.Writer, num int) error { + if err := f.Blocks.closeW(f, num); err != nil { + return err + } + buf := f.buf[:0] + // End mark (data block size of uint32(0)). + buf = append(buf, 0, 0, 0, 0) + if f.Descriptor.Flags.ContentChecksum() { + buf = f.checksum.Sum(buf) + } + _, err := dst.Write(buf) + return err +} + +func (f *Frame) InitR(src io.Reader) error { + if f.Magic > 0 { + // Header already read. + return nil + } + +newFrame: + var err error + if f.Magic, err = f.readUint32(src); err != nil { + return err + } + switch m := f.Magic; { + case m == frameMagic: + // All 16 values of frameSkipMagic are valid. + case m>>8 == frameSkipMagic>>8: + var skip uint32 + if err := binary.Read(src, binary.LittleEndian, &skip); err != nil { + return err + } + if _, err := io.CopyN(ioutil.Discard, src, int64(skip)); err != nil { + return err + } + goto newFrame + default: + return lz4errors.ErrInvalidFrame + } + if err := f.Descriptor.initR(f, src); err != nil { + return err + } + f.Blocks.initR(f) + f.checksum.Reset() + return nil +} + +func (f *Frame) CloseR(src io.Reader) (err error) { + if !f.Descriptor.Flags.ContentChecksum() { + return nil + } + if f.Checksum, err = f.readUint32(src); err != nil { + return err + } + if c := f.checksum.Sum32(); c != f.Checksum { + return fmt.Errorf("%w: got %x; expected %x", lz4errors.ErrInvalidFrameChecksum, c, f.Checksum) + } + return nil +} + +type FrameDescriptor struct { + Flags DescriptorFlags + ContentSize uint64 + Checksum uint8 +} + +func (fd *FrameDescriptor) initW() { + fd.Flags.VersionSet(1) + fd.Flags.BlockIndependenceSet(true) +} + +func (fd *FrameDescriptor) Write(f *Frame, dst io.Writer) error { + if fd.Checksum > 0 { + // Header already written. + return nil + } + + buf := f.buf[:4+2] + // Write the magic number here even though it belongs to the Frame. + binary.LittleEndian.PutUint32(buf, f.Magic) + binary.LittleEndian.PutUint16(buf[4:], uint16(fd.Flags)) + + if fd.Flags.Size() { + buf = buf[:4+2+8] + binary.LittleEndian.PutUint64(buf[4+2:], fd.ContentSize) + } + fd.Checksum = descriptorChecksum(buf[4:]) + buf = append(buf, fd.Checksum) + + _, err := dst.Write(buf) + return err +} + +func (fd *FrameDescriptor) initR(f *Frame, src io.Reader) error { + // Read the flags and the checksum, hoping that there is not content size. + buf := f.buf[:3] + if _, err := io.ReadFull(src, buf); err != nil { + return err + } + descr := binary.LittleEndian.Uint16(buf) + fd.Flags = DescriptorFlags(descr) + if fd.Flags.Size() { + // Append the 8 missing bytes. + buf = buf[:3+8] + if _, err := io.ReadFull(src, buf[3:]); err != nil { + return err + } + fd.ContentSize = binary.LittleEndian.Uint64(buf[2:]) + } + fd.Checksum = buf[len(buf)-1] // the checksum is the last byte + buf = buf[:len(buf)-1] // all descriptor fields except checksum + if c := descriptorChecksum(buf); fd.Checksum != c { + return fmt.Errorf("%w: got %x; expected %x", lz4errors.ErrInvalidHeaderChecksum, c, fd.Checksum) + } + // Validate the elements that can be. + if idx := fd.Flags.BlockSizeIndex(); !idx.IsValid() { + return lz4errors.ErrOptionInvalidBlockSize + } + return nil +} + +func descriptorChecksum(buf []byte) byte { + return byte(xxh32.ChecksumZero(buf) >> 8) +} + +type Blocks struct { + Block *FrameDataBlock + Blocks chan chan *FrameDataBlock + err error +} + +func (b *Blocks) initW(f *Frame, dst io.Writer, num int) { + size := f.Descriptor.Flags.BlockSizeIndex() + if num == 1 { + b.Blocks = nil + b.Block = NewFrameDataBlock(size) + return + } + b.Block = nil + if cap(b.Blocks) != num { + b.Blocks = make(chan chan *FrameDataBlock, num) + } + // goroutine managing concurrent block compression goroutines. + go func() { + // Process next block compression item. + for c := range b.Blocks { + // Read the next compressed block result. + // Waiting here ensures that the blocks are output in the order they were sent. + // The incoming channel is always closed as it indicates to the caller that + // the block has been processed. + block := <-c + if block == nil { + // Notify the block compression routine that we are done with its result. + // This is used when a sentinel block is sent to terminate the compression. + close(c) + return + } + // Do not attempt to write the block upon any previous failure. + if b.err == nil { + // Write the block. + if err := block.Write(f, dst); err != nil && b.err == nil { + // Keep the first error. + b.err = err + // All pending compression goroutines need to shut down, so we need to keep going. + } + } + close(c) + } + }() +} + +func (b *Blocks) closeW(f *Frame, num int) error { + if num == 1 { + if b.Block == nil { + // Not initialized yet. + return nil + } + b.Block.CloseW(f) + return nil + } + if b.Blocks == nil { + // Not initialized yet. + return nil + } + c := make(chan *FrameDataBlock) + b.Blocks <- c + c <- nil + <-c + err := b.err + b.err = nil + return err +} + +func (b *Blocks) initR(f *Frame) { + size := f.Descriptor.Flags.BlockSizeIndex() + b.Block = NewFrameDataBlock(size) +} + +func NewFrameDataBlock(size lz4block.BlockSizeIndex) *FrameDataBlock { + buf := size.Get() + return &FrameDataBlock{Data: buf, data: buf} +} + +type FrameDataBlock struct { + Size DataBlockSize + Data []byte // compressed or uncompressed data (.data or .src) + Checksum uint32 + data []byte // buffer for compressed data + src []byte // uncompressed data +} + +func (b *FrameDataBlock) CloseW(f *Frame) { + if b.data != nil { + // Block was not already closed. + size := f.Descriptor.Flags.BlockSizeIndex() + size.Put(b.data) + b.Data = nil + b.data = nil + b.src = nil + } +} + +// Block compression errors are ignored since the buffer is sized appropriately. +func (b *FrameDataBlock) Compress(f *Frame, src []byte, level lz4block.CompressionLevel) *FrameDataBlock { + data := b.data[:len(src)] // trigger the incompressible flag in CompressBlock + var n int + switch level { + case lz4block.Fast: + n, _ = lz4block.CompressBlock(src, data) + default: + n, _ = lz4block.CompressBlockHC(src, data, level) + } + if n == 0 { + b.Size.UncompressedSet(true) + b.Data = src + } else { + b.Size.UncompressedSet(false) + b.Data = data[:n] + } + b.Size.sizeSet(len(b.Data)) + b.src = src // keep track of the source for content checksum + + if f.Descriptor.Flags.BlockChecksum() { + b.Checksum = xxh32.ChecksumZero(src) + } + return b +} + +func (b *FrameDataBlock) Write(f *Frame, dst io.Writer) error { + if f.Descriptor.Flags.ContentChecksum() { + _, _ = f.checksum.Write(b.src) + } + buf := f.buf[:] + binary.LittleEndian.PutUint32(buf, uint32(b.Size)) + if _, err := dst.Write(buf[:4]); err != nil { + return err + } + + if _, err := dst.Write(b.Data); err != nil { + return err + } + + if b.Checksum == 0 { + return nil + } + binary.LittleEndian.PutUint32(buf, b.Checksum) + _, err := dst.Write(buf[:4]) + return err +} + +func (b *FrameDataBlock) Uncompress(f *Frame, src io.Reader, dst []byte) (int, error) { + x, err := f.readUint32(src) + if err != nil { + return 0, err + } + b.Size = DataBlockSize(x) + if b.Size == 0 { + // End of frame reached. + return 0, io.EOF + } + + isCompressed := !b.Size.Uncompressed() + size := b.Size.size() + var data []byte + if isCompressed { + // Data is first copied into b.Data and then it will get uncompressed into dst. + data = b.Data + } else { + // Data is directly copied into dst as it is not compressed. + data = dst + } + data = data[:size] + if _, err := io.ReadFull(src, data); err != nil { + return 0, err + } + if isCompressed { + n, err := lz4block.UncompressBlock(data, dst) + if err != nil { + return 0, err + } + data = dst[:n] + } + + if f.Descriptor.Flags.BlockChecksum() { + var err error + if b.Checksum, err = f.readUint32(src); err != nil { + return 0, err + } + if c := xxh32.ChecksumZero(data); c != b.Checksum { + return 0, fmt.Errorf("%w: got %x; expected %x", lz4errors.ErrInvalidBlockChecksum, c, b.Checksum) + } + } + if f.Descriptor.Flags.ContentChecksum() { + _, _ = f.checksum.Write(data) + } + return len(data), nil +} + +func (f *Frame) readUint32(r io.Reader) (x uint32, err error) { + if _, err = io.ReadFull(r, f.buf[:4]); err != nil { + return + } + x = binary.LittleEndian.Uint32(f.buf[:4]) + return +} diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4stream/frame_gen.go b/vendor/github.com/pierrec/lz4/v4/internal/lz4stream/frame_gen.go new file mode 100644 index 0000000000..d33a6be95c --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/internal/lz4stream/frame_gen.go @@ -0,0 +1,103 @@ +// Code generated by `gen.exe`. DO NOT EDIT. + +package lz4stream + +import "github.com/pierrec/lz4/v4/internal/lz4block" + +// DescriptorFlags is defined as follow: +// field bits +// ----- ---- +// _ 2 +// ContentChecksum 1 +// Size 1 +// BlockChecksum 1 +// BlockIndependence 1 +// Version 2 +// _ 4 +// BlockSizeIndex 3 +// _ 1 +type DescriptorFlags uint16 + +// Getters. +func (x DescriptorFlags) ContentChecksum() bool { return x>>2&1 != 0 } +func (x DescriptorFlags) Size() bool { return x>>3&1 != 0 } +func (x DescriptorFlags) BlockChecksum() bool { return x>>4&1 != 0 } +func (x DescriptorFlags) BlockIndependence() bool { return x>>5&1 != 0 } +func (x DescriptorFlags) Version() uint16 { return uint16(x >> 6 & 0x3) } +func (x DescriptorFlags) BlockSizeIndex() lz4block.BlockSizeIndex { + return lz4block.BlockSizeIndex(x >> 12 & 0x7) +} + +// Setters. +func (x *DescriptorFlags) ContentChecksumSet(v bool) *DescriptorFlags { + const b = 1 << 2 + if v { + *x = *x&^b | b + } else { + *x &^= b + } + return x +} +func (x *DescriptorFlags) SizeSet(v bool) *DescriptorFlags { + const b = 1 << 3 + if v { + *x = *x&^b | b + } else { + *x &^= b + } + return x +} +func (x *DescriptorFlags) BlockChecksumSet(v bool) *DescriptorFlags { + const b = 1 << 4 + if v { + *x = *x&^b | b + } else { + *x &^= b + } + return x +} +func (x *DescriptorFlags) BlockIndependenceSet(v bool) *DescriptorFlags { + const b = 1 << 5 + if v { + *x = *x&^b | b + } else { + *x &^= b + } + return x +} +func (x *DescriptorFlags) VersionSet(v uint16) *DescriptorFlags { + *x = *x&^(0x3<<6) | (DescriptorFlags(v) & 0x3 << 6) + return x +} +func (x *DescriptorFlags) BlockSizeIndexSet(v lz4block.BlockSizeIndex) *DescriptorFlags { + *x = *x&^(0x7<<12) | (DescriptorFlags(v) & 0x7 << 12) + return x +} + +// Code generated by `gen.exe`. DO NOT EDIT. + +// DataBlockSize is defined as follow: +// field bits +// ----- ---- +// size 31 +// Uncompressed 1 +type DataBlockSize uint32 + +// Getters. +func (x DataBlockSize) size() int { return int(x & 0x7FFFFFFF) } +func (x DataBlockSize) Uncompressed() bool { return x>>31&1 != 0 } + +// Setters. +func (x *DataBlockSize) sizeSet(v int) *DataBlockSize { + *x = *x&^0x7FFFFFFF | DataBlockSize(v)&0x7FFFFFFF + return x +} +func (x *DataBlockSize) UncompressedSet(v bool) *DataBlockSize { + const b = 1 << 31 + if v { + *x = *x&^b | b + } else { + *x &^= b + } + return x +} diff --git a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero.go b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero.go new file mode 100644 index 0000000000..8d3206a87c --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero.go @@ -0,0 +1,212 @@ +// Package xxh32 implements the very fast XXH hashing algorithm (32 bits version). +// (https://github.com/Cyan4973/XXH/) +package xxh32 + +import ( + "encoding/binary" +) + +const ( + prime1 uint32 = 2654435761 + prime2 uint32 = 2246822519 + prime3 uint32 = 3266489917 + prime4 uint32 = 668265263 + prime5 uint32 = 374761393 + + primeMask = 0xFFFFFFFF + prime1plus2 = uint32((uint64(prime1) + uint64(prime2)) & primeMask) // 606290984 + prime1minus = uint32((-int64(prime1)) & primeMask) // 1640531535 +) + +// XXHZero represents an xxhash32 object with seed 0. +type XXHZero struct { + v [4]uint32 + totalLen uint64 + buf [16]byte + bufused int +} + +// Sum appends the current hash to b and returns the resulting slice. +// It does not change the underlying hash state. +func (xxh XXHZero) Sum(b []byte) []byte { + h32 := xxh.Sum32() + return append(b, byte(h32), byte(h32>>8), byte(h32>>16), byte(h32>>24)) +} + +// Reset resets the Hash to its initial state. +func (xxh *XXHZero) Reset() { + xxh.v[0] = prime1plus2 + xxh.v[1] = prime2 + xxh.v[2] = 0 + xxh.v[3] = prime1minus + xxh.totalLen = 0 + xxh.bufused = 0 +} + +// Size returns the number of bytes returned by Sum(). +func (xxh *XXHZero) Size() int { + return 4 +} + +// BlockSizeIndex gives the minimum number of bytes accepted by Write(). +func (xxh *XXHZero) BlockSize() int { + return 1 +} + +// Write adds input bytes to the Hash. +// It never returns an error. +func (xxh *XXHZero) Write(input []byte) (int, error) { + if xxh.totalLen == 0 { + xxh.Reset() + } + n := len(input) + m := xxh.bufused + + xxh.totalLen += uint64(n) + + r := len(xxh.buf) - m + if n < r { + copy(xxh.buf[m:], input) + xxh.bufused += len(input) + return n, nil + } + + var buf *[16]byte + if m != 0 { + // some data left from previous update + buf = &xxh.buf + c := copy(buf[m:], input) + n -= c + input = input[c:] + } + update(&xxh.v, buf, input) + xxh.bufused = copy(xxh.buf[:], input[n-n%16:]) + + return n, nil +} + +// Portable version of update. This updates v by processing all of buf +// (if not nil) and all full 16-byte blocks of input. +func updateGo(v *[4]uint32, buf *[16]byte, input []byte) { + // Causes compiler to work directly from registers instead of stack: + v1, v2, v3, v4 := v[0], v[1], v[2], v[3] + + if buf != nil { + v1 = rol13(v1+binary.LittleEndian.Uint32(buf[:])*prime2) * prime1 + v2 = rol13(v2+binary.LittleEndian.Uint32(buf[4:])*prime2) * prime1 + v3 = rol13(v3+binary.LittleEndian.Uint32(buf[8:])*prime2) * prime1 + v4 = rol13(v4+binary.LittleEndian.Uint32(buf[12:])*prime2) * prime1 + } + + for ; len(input) >= 16; input = input[16:] { + sub := input[:16] //BCE hint for compiler + v1 = rol13(v1+binary.LittleEndian.Uint32(sub[:])*prime2) * prime1 + v2 = rol13(v2+binary.LittleEndian.Uint32(sub[4:])*prime2) * prime1 + v3 = rol13(v3+binary.LittleEndian.Uint32(sub[8:])*prime2) * prime1 + v4 = rol13(v4+binary.LittleEndian.Uint32(sub[12:])*prime2) * prime1 + } + v[0], v[1], v[2], v[3] = v1, v2, v3, v4 +} + +// Sum32 returns the 32 bits Hash value. +func (xxh *XXHZero) Sum32() uint32 { + h32 := uint32(xxh.totalLen) + if h32 >= 16 { + h32 += rol1(xxh.v[0]) + rol7(xxh.v[1]) + rol12(xxh.v[2]) + rol18(xxh.v[3]) + } else { + h32 += prime5 + } + + p := 0 + n := xxh.bufused + buf := xxh.buf + for n := n - 4; p <= n; p += 4 { + h32 += binary.LittleEndian.Uint32(buf[p:p+4]) * prime3 + h32 = rol17(h32) * prime4 + } + for ; p < n; p++ { + h32 += uint32(buf[p]) * prime5 + h32 = rol11(h32) * prime1 + } + + h32 ^= h32 >> 15 + h32 *= prime2 + h32 ^= h32 >> 13 + h32 *= prime3 + h32 ^= h32 >> 16 + + return h32 +} + +// Portable version of ChecksumZero. +func checksumZeroGo(input []byte) uint32 { + n := len(input) + h32 := uint32(n) + + if n < 16 { + h32 += prime5 + } else { + v1 := prime1plus2 + v2 := prime2 + v3 := uint32(0) + v4 := prime1minus + p := 0 + for n := n - 16; p <= n; p += 16 { + sub := input[p:][:16] //BCE hint for compiler + v1 = rol13(v1+binary.LittleEndian.Uint32(sub[:])*prime2) * prime1 + v2 = rol13(v2+binary.LittleEndian.Uint32(sub[4:])*prime2) * prime1 + v3 = rol13(v3+binary.LittleEndian.Uint32(sub[8:])*prime2) * prime1 + v4 = rol13(v4+binary.LittleEndian.Uint32(sub[12:])*prime2) * prime1 + } + input = input[p:] + n -= p + h32 += rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4) + } + + p := 0 + for n := n - 4; p <= n; p += 4 { + h32 += binary.LittleEndian.Uint32(input[p:p+4]) * prime3 + h32 = rol17(h32) * prime4 + } + for p < n { + h32 += uint32(input[p]) * prime5 + h32 = rol11(h32) * prime1 + p++ + } + + h32 ^= h32 >> 15 + h32 *= prime2 + h32 ^= h32 >> 13 + h32 *= prime3 + h32 ^= h32 >> 16 + + return h32 +} + +func rol1(u uint32) uint32 { + return u<<1 | u>>31 +} + +func rol7(u uint32) uint32 { + return u<<7 | u>>25 +} + +func rol11(u uint32) uint32 { + return u<<11 | u>>21 +} + +func rol12(u uint32) uint32 { + return u<<12 | u>>20 +} + +func rol13(u uint32) uint32 { + return u<<13 | u>>19 +} + +func rol17(u uint32) uint32 { + return u<<17 | u>>15 +} + +func rol18(u uint32) uint32 { + return u<<18 | u>>14 +} diff --git a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.go b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.go new file mode 100644 index 0000000000..0978b2665b --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.go @@ -0,0 +1,11 @@ +// +build !noasm + +package xxh32 + +// ChecksumZero returns the 32-bit hash of input. +// +//go:noescape +func ChecksumZero(input []byte) uint32 + +//go:noescape +func update(v *[4]uint32, buf *[16]byte, input []byte) diff --git a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.s b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.s new file mode 100644 index 0000000000..0e9f146a36 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.s @@ -0,0 +1,259 @@ +// +build !noasm + +#include "textflag.h" + +#define prime1 $2654435761 +#define prime2 $2246822519 +#define prime3 $3266489917 +#define prime4 $668265263 +#define prime5 $374761393 + +#define prime1plus2 $606290984 +#define prime1minus $1640531535 + +// Register allocation. +#define p R0 +#define n R1 +#define h R2 +#define v1 R2 // Alias for h. +#define v2 R3 +#define v3 R4 +#define v4 R5 +#define x1 R6 +#define x2 R7 +#define x3 R8 +#define x4 R9 + +// We need the primes in registers. The 16-byte loop only uses prime{1,2}. +#define prime1r R11 +#define prime2r R12 +#define prime3r R3 // The rest can alias v{2-4}. +#define prime4r R4 +#define prime5r R5 + +// Update round macros. These read from and increment p. + +#define round16aligned \ + MOVM.IA.W (p), [x1, x2, x3, x4] \ + \ + MULA x1, prime2r, v1, v1 \ + MULA x2, prime2r, v2, v2 \ + MULA x3, prime2r, v3, v3 \ + MULA x4, prime2r, v4, v4 \ + \ + MOVW v1 @> 19, v1 \ + MOVW v2 @> 19, v2 \ + MOVW v3 @> 19, v3 \ + MOVW v4 @> 19, v4 \ + \ + MUL prime1r, v1 \ + MUL prime1r, v2 \ + MUL prime1r, v3 \ + MUL prime1r, v4 \ + +#define round16unaligned \ + MOVBU.P 16(p), x1 \ + MOVBU -15(p), x2 \ + ORR x2 << 8, x1 \ + MOVBU -14(p), x3 \ + MOVBU -13(p), x4 \ + ORR x4 << 8, x3 \ + ORR x3 << 16, x1 \ + \ + MULA x1, prime2r, v1, v1 \ + MOVW v1 @> 19, v1 \ + MUL prime1r, v1 \ + \ + MOVBU -12(p), x1 \ + MOVBU -11(p), x2 \ + ORR x2 << 8, x1 \ + MOVBU -10(p), x3 \ + MOVBU -9(p), x4 \ + ORR x4 << 8, x3 \ + ORR x3 << 16, x1 \ + \ + MULA x1, prime2r, v2, v2 \ + MOVW v2 @> 19, v2 \ + MUL prime1r, v2 \ + \ + MOVBU -8(p), x1 \ + MOVBU -7(p), x2 \ + ORR x2 << 8, x1 \ + MOVBU -6(p), x3 \ + MOVBU -5(p), x4 \ + ORR x4 << 8, x3 \ + ORR x3 << 16, x1 \ + \ + MULA x1, prime2r, v3, v3 \ + MOVW v3 @> 19, v3 \ + MUL prime1r, v3 \ + \ + MOVBU -4(p), x1 \ + MOVBU -3(p), x2 \ + ORR x2 << 8, x1 \ + MOVBU -2(p), x3 \ + MOVBU -1(p), x4 \ + ORR x4 << 8, x3 \ + ORR x3 << 16, x1 \ + \ + MULA x1, prime2r, v4, v4 \ + MOVW v4 @> 19, v4 \ + MUL prime1r, v4 \ + + +// func ChecksumZero([]byte) uint32 +TEXT ·ChecksumZero(SB), NOFRAME|NOSPLIT, $-4-16 + MOVW input_base+0(FP), p + MOVW input_len+4(FP), n + + MOVW prime1, prime1r + MOVW prime2, prime2r + + // Set up h for n < 16. It's tempting to say {ADD prime5, n, h} + // here, but that's a pseudo-op that generates a load through R11. + MOVW prime5, prime5r + ADD prime5r, n, h + CMP $0, n + BEQ end + + // We let n go negative so we can do comparisons with SUB.S + // instead of separate CMP. + SUB.S $16, n + BMI loop16done + + MOVW prime1plus2, v1 + MOVW prime2, v2 + MOVW $0, v3 + MOVW prime1minus, v4 + + TST $3, p + BNE loop16unaligned + +loop16aligned: + SUB.S $16, n + round16aligned + BPL loop16aligned + B loop16finish + +loop16unaligned: + SUB.S $16, n + round16unaligned + BPL loop16unaligned + +loop16finish: + MOVW v1 @> 31, h + ADD v2 @> 25, h + ADD v3 @> 20, h + ADD v4 @> 14, h + + // h += len(input) with v2 as temporary. + MOVW input_len+4(FP), v2 + ADD v2, h + +loop16done: + ADD $16, n // Restore number of bytes left. + + SUB.S $4, n + MOVW prime3, prime3r + BMI loop4done + MOVW prime4, prime4r + + TST $3, p + BNE loop4unaligned + +loop4aligned: + SUB.S $4, n + + MOVW.P 4(p), x1 + MULA prime3r, x1, h, h + MOVW h @> 15, h + MUL prime4r, h + + BPL loop4aligned + B loop4done + +loop4unaligned: + SUB.S $4, n + + MOVBU.P 4(p), x1 + MOVBU -3(p), x2 + ORR x2 << 8, x1 + MOVBU -2(p), x3 + ORR x3 << 16, x1 + MOVBU -1(p), x4 + ORR x4 << 24, x1 + + MULA prime3r, x1, h, h + MOVW h @> 15, h + MUL prime4r, h + + BPL loop4unaligned + +loop4done: + ADD.S $4, n // Restore number of bytes left. + BEQ end + + MOVW prime5, prime5r + +loop1: + SUB.S $1, n + + MOVBU.P 1(p), x1 + MULA prime5r, x1, h, h + MOVW h @> 21, h + MUL prime1r, h + + BNE loop1 + +end: + MOVW prime3, prime3r + EOR h >> 15, h + MUL prime2r, h + EOR h >> 13, h + MUL prime3r, h + EOR h >> 16, h + + MOVW h, ret+12(FP) + RET + + +// func update(v *[4]uint64, buf *[16]byte, p []byte) +TEXT ·update(SB), NOFRAME|NOSPLIT, $-4-20 + MOVW v+0(FP), p + MOVM.IA (p), [v1, v2, v3, v4] + + MOVW prime1, prime1r + MOVW prime2, prime2r + + // Process buf, if not nil. + MOVW buf+4(FP), p + CMP $0, p + BEQ noBuffered + + round16aligned + +noBuffered: + MOVW input_base +8(FP), p + MOVW input_len +12(FP), n + + SUB.S $16, n + BMI end + + TST $3, p + BNE loop16unaligned + +loop16aligned: + SUB.S $16, n + round16aligned + BPL loop16aligned + B end + +loop16unaligned: + SUB.S $16, n + round16unaligned + BPL loop16unaligned + +end: + MOVW v+0(FP), p + MOVM.IA [v1, v2, v3, v4], (p) + RET diff --git a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_other.go b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_other.go new file mode 100644 index 0000000000..c96b59b8c3 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_other.go @@ -0,0 +1,10 @@ +// +build !arm noasm + +package xxh32 + +// ChecksumZero returns the 32-bit hash of input. +func ChecksumZero(input []byte) uint32 { return checksumZeroGo(input) } + +func update(v *[4]uint32, buf *[16]byte, input []byte) { + updateGo(v, buf, input) +} diff --git a/vendor/github.com/pierrec/lz4/v4/lz4.go b/vendor/github.com/pierrec/lz4/v4/lz4.go new file mode 100644 index 0000000000..c585d4064f --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/lz4.go @@ -0,0 +1,147 @@ +// Package lz4 implements reading and writing lz4 compressed data. +// +// The package supports both the LZ4 stream format, +// as specified in http://fastcompression.blogspot.fr/2013/04/lz4-streaming-format-final.html, +// and the LZ4 block format, defined at +// http://fastcompression.blogspot.fr/2011/05/lz4-explained.html. +// +// See https://github.com/lz4/lz4 for the reference C implementation. +package lz4 + +import ( + "github.com/pierrec/lz4/v4/internal/lz4block" + "github.com/pierrec/lz4/v4/internal/lz4errors" +) + +func _() { + // Safety checks for duplicated elements. + var x [1]struct{} + _ = x[lz4block.CompressionLevel(Fast)-lz4block.Fast] + _ = x[Block64Kb-BlockSize(lz4block.Block64Kb)] + _ = x[Block256Kb-BlockSize(lz4block.Block256Kb)] + _ = x[Block1Mb-BlockSize(lz4block.Block1Mb)] + _ = x[Block4Mb-BlockSize(lz4block.Block4Mb)] +} + +// CompressBlockBound returns the maximum size of a given buffer of size n, when not compressible. +func CompressBlockBound(n int) int { + return lz4block.CompressBlockBound(n) +} + +// UncompressBlock uncompresses the source buffer into the destination one, +// and returns the uncompressed size. +// +// The destination buffer must be sized appropriately. +// +// An error is returned if the source data is invalid or the destination buffer is too small. +func UncompressBlock(src, dst []byte) (int, error) { + return lz4block.UncompressBlock(src, dst) +} + +// A Compressor compresses data into the LZ4 block format. +// It uses a fast compression algorithm. +// +// A Compressor is not safe for concurrent use by multiple goroutines. +// +// Use a Writer to compress into the LZ4 stream format. +type Compressor struct{ c lz4block.Compressor } + +// CompressBlock compresses the source buffer src into the destination dst. +// +// If compression is successful, the first return value is the size of the +// compressed data, which is always >0. +// +// If dst has length at least CompressBlockBound(len(src)), compression always +// succeeds. Otherwise, the first return value is zero. The error return is +// non-nil if the compressed data does not fit in dst, but it might fit in a +// larger buffer that is still smaller than CompressBlockBound(len(src)). The +// return value (0, nil) means the data is likely incompressible and a buffer +// of length CompressBlockBound(len(src)) should be passed in. +func (c *Compressor) CompressBlock(src, dst []byte) (int, error) { + return c.c.CompressBlock(src, dst) +} + +// CompressBlock compresses the source buffer into the destination one. +// This is the fast version of LZ4 compression and also the default one. +// +// The argument hashTable is scratch space for a hash table used by the +// compressor. If provided, it should have length at least 1<<16. If it is +// shorter (or nil), CompressBlock allocates its own hash table. +// +// The size of the compressed data is returned. +// +// If the destination buffer size is lower than CompressBlockBound and +// the compressed size is 0 and no error, then the data is incompressible. +// +// An error is returned if the destination buffer is too small. + +// CompressBlock is equivalent to Compressor.CompressBlock. +// The final argument is ignored and should be set to nil. +// +// This function is deprecated. Use a Compressor instead. +func CompressBlock(src, dst []byte, _ []int) (int, error) { + return lz4block.CompressBlock(src, dst) +} + +// A CompressorHC compresses data into the LZ4 block format. +// Its compression ratio is potentially better than that of a Compressor, +// but it is also slower and requires more memory. +// +// A Compressor is not safe for concurrent use by multiple goroutines. +// +// Use a Writer to compress into the LZ4 stream format. +type CompressorHC struct { + // Level is the maximum search depth for compression. + // Values <= 0 mean no maximum. + Level CompressionLevel + c lz4block.CompressorHC +} + +// CompressBlock compresses the source buffer src into the destination dst. +// +// If compression is successful, the first return value is the size of the +// compressed data, which is always >0. +// +// If dst has length at least CompressBlockBound(len(src)), compression always +// succeeds. Otherwise, the first return value is zero. The error return is +// non-nil if the compressed data does not fit in dst, but it might fit in a +// larger buffer that is still smaller than CompressBlockBound(len(src)). The +// return value (0, nil) means the data is likely incompressible and a buffer +// of length CompressBlockBound(len(src)) should be passed in. +func (c *CompressorHC) CompressBlock(src, dst []byte) (int, error) { + return c.c.CompressBlock(src, dst, lz4block.CompressionLevel(c.Level)) +} + +// CompressBlockHC is equivalent to CompressorHC.CompressBlock. +// The final two arguments are ignored and should be set to nil. +// +// This function is deprecated. Use a CompressorHC instead. +func CompressBlockHC(src, dst []byte, depth CompressionLevel, _, _ []int) (int, error) { + return lz4block.CompressBlockHC(src, dst, lz4block.CompressionLevel(depth)) +} + +const ( + // ErrInvalidSourceShortBuffer is returned by UncompressBlock or CompressBLock when a compressed + // block is corrupted or the destination buffer is not large enough for the uncompressed data. + ErrInvalidSourceShortBuffer = lz4errors.ErrInvalidSourceShortBuffer + // ErrInvalidFrame is returned when reading an invalid LZ4 archive. + ErrInvalidFrame = lz4errors.ErrInvalidFrame + // ErrInternalUnhandledState is an internal error. + ErrInternalUnhandledState = lz4errors.ErrInternalUnhandledState + // ErrInvalidHeaderChecksum is returned when reading a frame. + ErrInvalidHeaderChecksum = lz4errors.ErrInvalidHeaderChecksum + // ErrInvalidBlockChecksum is returned when reading a frame. + ErrInvalidBlockChecksum = lz4errors.ErrInvalidBlockChecksum + // ErrInvalidFrameChecksum is returned when reading a frame. + ErrInvalidFrameChecksum = lz4errors.ErrInvalidFrameChecksum + // ErrOptionInvalidCompressionLevel is returned when the supplied compression level is invalid. + ErrOptionInvalidCompressionLevel = lz4errors.ErrOptionInvalidCompressionLevel + // ErrOptionClosedOrError is returned when an option is applied to a closed or in error object. + ErrOptionClosedOrError = lz4errors.ErrOptionClosedOrError + // ErrOptionInvalidBlockSize is returned when + ErrOptionInvalidBlockSize = lz4errors.ErrOptionInvalidBlockSize + // ErrOptionNotApplicable is returned when trying to apply an option to an object not supporting it. + ErrOptionNotApplicable = lz4errors.ErrOptionNotApplicable + // ErrWriterNotClosed is returned when attempting to reset an unclosed writer. + ErrWriterNotClosed = lz4errors.ErrWriterNotClosed +) diff --git a/vendor/github.com/pierrec/lz4/v4/options.go b/vendor/github.com/pierrec/lz4/v4/options.go new file mode 100644 index 0000000000..d9a3b4d07a --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/options.go @@ -0,0 +1,187 @@ +package lz4 + +import ( + "fmt" + "reflect" + "runtime" + + "github.com/pierrec/lz4/v4/internal/lz4block" + "github.com/pierrec/lz4/v4/internal/lz4errors" +) + +//go:generate go run golang.org/x/tools/cmd/stringer -type=BlockSize,CompressionLevel -output options_gen.go + +type ( + applier interface { + Apply(...Option) error + private() + } + // Option defines the parameters to setup an LZ4 Writer or Reader. + Option func(applier) error +) + +// String returns a string representation of the option with its parameter(s). +func (o Option) String() string { + return o(nil).Error() +} + +// Default options. +var ( + DefaultBlockSizeOption = BlockSizeOption(Block4Mb) + DefaultChecksumOption = ChecksumOption(true) + DefaultConcurrency = ConcurrencyOption(1) + defaultOnBlockDone = OnBlockDoneOption(nil) +) + +const ( + Block64Kb BlockSize = 1 << (16 + iota*2) + Block256Kb + Block1Mb + Block4Mb +) + +// BlockSizeIndex defines the size of the blocks to be compressed. +type BlockSize uint32 + +// BlockSizeOption defines the maximum size of compressed blocks (default=Block4Mb). +func BlockSizeOption(size BlockSize) Option { + return func(a applier) error { + switch w := a.(type) { + case nil: + s := fmt.Sprintf("BlockSizeOption(%s)", size) + return lz4errors.Error(s) + case *Writer: + size := uint32(size) + if !lz4block.IsValid(size) { + return fmt.Errorf("%w: %d", lz4errors.ErrOptionInvalidBlockSize, size) + } + w.frame.Descriptor.Flags.BlockSizeIndexSet(lz4block.Index(size)) + return nil + } + return lz4errors.ErrOptionNotApplicable + } +} + +// BlockChecksumOption enables or disables block checksum (default=false). +func BlockChecksumOption(flag bool) Option { + return func(a applier) error { + switch w := a.(type) { + case nil: + s := fmt.Sprintf("BlockChecksumOption(%v)", flag) + return lz4errors.Error(s) + case *Writer: + w.frame.Descriptor.Flags.BlockChecksumSet(flag) + return nil + } + return lz4errors.ErrOptionNotApplicable + } +} + +// ChecksumOption enables/disables all blocks or content checksum (default=true). +func ChecksumOption(flag bool) Option { + return func(a applier) error { + switch w := a.(type) { + case nil: + s := fmt.Sprintf("BlockChecksumOption(%v)", flag) + return lz4errors.Error(s) + case *Writer: + w.frame.Descriptor.Flags.ContentChecksumSet(flag) + return nil + } + return lz4errors.ErrOptionNotApplicable + } +} + +// SizeOption sets the size of the original uncompressed data (default=0). It is useful to know the size of the +// whole uncompressed data stream. +func SizeOption(size uint64) Option { + return func(a applier) error { + switch w := a.(type) { + case nil: + s := fmt.Sprintf("SizeOption(%d)", size) + return lz4errors.Error(s) + case *Writer: + w.frame.Descriptor.Flags.SizeSet(size > 0) + w.frame.Descriptor.ContentSize = size + return nil + } + return lz4errors.ErrOptionNotApplicable + } +} + +// ConcurrencyOption sets the number of go routines used for compression. +// If n <= 0, then the output of runtime.GOMAXPROCS(0) is used. +func ConcurrencyOption(n int) Option { + return func(a applier) error { + switch w := a.(type) { + case nil: + s := fmt.Sprintf("ConcurrencyOption(%d)", n) + return lz4errors.Error(s) + case *Writer: + if n <= 0 { + n = runtime.GOMAXPROCS(0) + } + w.num = n + return nil + } + return lz4errors.ErrOptionNotApplicable + } +} + +// CompressionLevel defines the level of compression to use. The higher the better, but slower, compression. +type CompressionLevel uint32 + +const ( + Fast CompressionLevel = 0 + Level1 CompressionLevel = 1 << (8 + iota) + Level2 + Level3 + Level4 + Level5 + Level6 + Level7 + Level8 + Level9 +) + +// CompressionLevelOption defines the compression level (default=Fast). +func CompressionLevelOption(level CompressionLevel) Option { + return func(a applier) error { + switch w := a.(type) { + case nil: + s := fmt.Sprintf("CompressionLevelOption(%s)", level) + return lz4errors.Error(s) + case *Writer: + switch level { + case Fast, Level1, Level2, Level3, Level4, Level5, Level6, Level7, Level8, Level9: + default: + return fmt.Errorf("%w: %d", lz4errors.ErrOptionInvalidCompressionLevel, level) + } + w.level = lz4block.CompressionLevel(level) + return nil + } + return lz4errors.ErrOptionNotApplicable + } +} + +func onBlockDone(int) {} + +// OnBlockDoneOption is triggered when a block has been processed. For a Writer, it is when is has been compressed, +// for a Reader, it is when it has been uncompressed. +func OnBlockDoneOption(handler func(size int)) Option { + if handler == nil { + handler = onBlockDone + } + return func(a applier) error { + switch rw := a.(type) { + case nil: + s := fmt.Sprintf("OnBlockDoneOption(%s)", reflect.TypeOf(handler).String()) + return lz4errors.Error(s) + case *Writer: + rw.handler = handler + case *Reader: + rw.handler = handler + } + return nil + } +} diff --git a/vendor/github.com/pierrec/lz4/v4/options_gen.go b/vendor/github.com/pierrec/lz4/v4/options_gen.go new file mode 100644 index 0000000000..2de814909e --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/options_gen.go @@ -0,0 +1,92 @@ +// Code generated by "stringer -type=BlockSize,CompressionLevel -output options_gen.go"; DO NOT EDIT. + +package lz4 + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[Block64Kb-65536] + _ = x[Block256Kb-262144] + _ = x[Block1Mb-1048576] + _ = x[Block4Mb-4194304] +} + +const ( + _BlockSize_name_0 = "Block64Kb" + _BlockSize_name_1 = "Block256Kb" + _BlockSize_name_2 = "Block1Mb" + _BlockSize_name_3 = "Block4Mb" +) + +func (i BlockSize) String() string { + switch { + case i == 65536: + return _BlockSize_name_0 + case i == 262144: + return _BlockSize_name_1 + case i == 1048576: + return _BlockSize_name_2 + case i == 4194304: + return _BlockSize_name_3 + default: + return "BlockSize(" + strconv.FormatInt(int64(i), 10) + ")" + } +} +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[Fast-0] + _ = x[Level1-512] + _ = x[Level2-1024] + _ = x[Level3-2048] + _ = x[Level4-4096] + _ = x[Level5-8192] + _ = x[Level6-16384] + _ = x[Level7-32768] + _ = x[Level8-65536] + _ = x[Level9-131072] +} + +const ( + _CompressionLevel_name_0 = "Fast" + _CompressionLevel_name_1 = "Level1" + _CompressionLevel_name_2 = "Level2" + _CompressionLevel_name_3 = "Level3" + _CompressionLevel_name_4 = "Level4" + _CompressionLevel_name_5 = "Level5" + _CompressionLevel_name_6 = "Level6" + _CompressionLevel_name_7 = "Level7" + _CompressionLevel_name_8 = "Level8" + _CompressionLevel_name_9 = "Level9" +) + +func (i CompressionLevel) String() string { + switch { + case i == 0: + return _CompressionLevel_name_0 + case i == 512: + return _CompressionLevel_name_1 + case i == 1024: + return _CompressionLevel_name_2 + case i == 2048: + return _CompressionLevel_name_3 + case i == 4096: + return _CompressionLevel_name_4 + case i == 8192: + return _CompressionLevel_name_5 + case i == 16384: + return _CompressionLevel_name_6 + case i == 32768: + return _CompressionLevel_name_7 + case i == 65536: + return _CompressionLevel_name_8 + case i == 131072: + return _CompressionLevel_name_9 + default: + return "CompressionLevel(" + strconv.FormatInt(int64(i), 10) + ")" + } +} diff --git a/vendor/github.com/pierrec/lz4/v4/reader.go b/vendor/github.com/pierrec/lz4/v4/reader.go new file mode 100644 index 0000000000..fb90a7fd8a --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/reader.go @@ -0,0 +1,192 @@ +package lz4 + +import ( + "io" + + "github.com/pierrec/lz4/v4/internal/lz4errors" + "github.com/pierrec/lz4/v4/internal/lz4stream" +) + +var readerStates = []aState{ + noState: newState, + errorState: newState, + newState: readState, + readState: closedState, + closedState: newState, +} + +// NewReader returns a new LZ4 frame decoder. +func NewReader(r io.Reader) *Reader { + zr := &Reader{frame: lz4stream.NewFrame()} + zr.state.init(readerStates) + _ = zr.Apply(defaultOnBlockDone) + zr.Reset(r) + return zr +} + +// Reader allows reading an LZ4 stream. +type Reader struct { + state _State + src io.Reader // source reader + frame *lz4stream.Frame // frame being read + data []byte // pending data + idx int // size of pending data + handler func(int) +} + +func (*Reader) private() {} + +func (r *Reader) Apply(options ...Option) (err error) { + defer r.state.check(&err) + switch r.state.state { + case newState: + case errorState: + return r.state.err + default: + return lz4errors.ErrOptionClosedOrError + } + for _, o := range options { + if err = o(r); err != nil { + return + } + } + return +} + +// Size returns the size of the underlying uncompressed data, if set in the stream. +func (r *Reader) Size() int { + switch r.state.state { + case readState, closedState: + if r.frame.Descriptor.Flags.Size() { + return int(r.frame.Descriptor.ContentSize) + } + } + return 0 +} + +func (r *Reader) init() error { + return r.frame.InitR(r.src) +} + +func (r *Reader) Read(buf []byte) (n int, err error) { + defer r.state.check(&err) + switch r.state.state { + case readState: + case closedState, errorState: + return 0, r.state.err + case newState: + // First initialization. + if err = r.init(); r.state.next(err) { + return + } + size := r.frame.Descriptor.Flags.BlockSizeIndex() + r.data = size.Get() + default: + return 0, r.state.fail() + } + if len(buf) == 0 { + return + } + + var bn int + if r.idx > 0 { + // Some left over data, use it. + goto fillbuf + } + // No uncompressed data yet. + r.data = r.data[:cap(r.data)] + for len(buf) >= len(r.data) { + // Input buffer large enough and no pending data: uncompress directly into it. + switch bn, err = r.frame.Blocks.Block.Uncompress(r.frame, r.src, buf); err { + case nil: + r.handler(bn) + n += bn + buf = buf[bn:] + case io.EOF: + goto close + default: + return + } + } + if n > 0 { + // Some data was read, done for now. + return + } + // Read the next block. + switch bn, err = r.frame.Blocks.Block.Uncompress(r.frame, r.src, r.data); err { + case nil: + r.handler(bn) + r.data = r.data[:bn] + goto fillbuf + case io.EOF: + default: + return + } +close: + if er := r.frame.CloseR(r.src); er != nil { + err = er + } + r.Reset(nil) + return +fillbuf: + bn = copy(buf, r.data[r.idx:]) + n += bn + r.idx += bn + if r.idx == len(r.data) { + // All data read, get ready for the next Read. + r.idx = 0 + } + return +} + +// Reset clears the state of the Reader r such that it is equivalent to its +// initial state from NewReader, but instead writing to writer. +// No access to reader is performed. +// +// w.Close must be called before Reset. +func (r *Reader) Reset(reader io.Reader) { + size := r.frame.Descriptor.Flags.BlockSizeIndex() + size.Put(r.data) + r.frame.Reset(1) + r.src = reader + r.data = nil + r.idx = 0 + r.state.reset() +} + +// WriteTo efficiently uncompresses the data from the Reader underlying source to w. +func (r *Reader) WriteTo(w io.Writer) (n int64, err error) { + switch r.state.state { + case closedState, errorState: + return 0, r.state.err + case newState: + if err = r.init(); r.state.next(err) { + return + } + default: + return 0, r.state.fail() + } + defer r.state.nextd(&err) + + var bn int + block := r.frame.Blocks.Block + size := r.frame.Descriptor.Flags.BlockSizeIndex() + data := size.Get() + defer size.Put(data) + for { + switch bn, err = block.Uncompress(r.frame, r.src, data); err { + case nil: + case io.EOF: + err = r.frame.CloseR(r.src) + return + default: + return + } + r.handler(bn) + bn, err = w.Write(data[:bn]) + n += int64(bn) + if err != nil { + return + } + } +} diff --git a/vendor/github.com/pierrec/lz4/v4/state.go b/vendor/github.com/pierrec/lz4/v4/state.go new file mode 100644 index 0000000000..d94f04d05e --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/state.go @@ -0,0 +1,75 @@ +package lz4 + +import ( + "errors" + "fmt" + "io" + + "github.com/pierrec/lz4/v4/internal/lz4errors" +) + +//go:generate go run golang.org/x/tools/cmd/stringer -type=aState -output state_gen.go + +const ( + noState aState = iota // uninitialized reader + errorState // unrecoverable error encountered + newState // instantiated object + readState // reading data + writeState // writing data + closedState // all done +) + +type ( + aState uint8 + _State struct { + states []aState + state aState + err error + } +) + +func (s *_State) init(states []aState) { + s.states = states + s.state = states[0] +} + +func (s *_State) reset() { + s.state = s.states[0] + s.err = nil +} + +// next sets the state to the next one unless it is passed a non nil error. +// It returns whether or not it is in error. +func (s *_State) next(err error) bool { + if err != nil { + s.err = fmt.Errorf("%s: %w", s.state, err) + s.state = errorState + return true + } + s.state = s.states[s.state] + return false +} + +// nextd is like next but for defers. +func (s *_State) nextd(errp *error) bool { + return errp != nil && s.next(*errp) +} + +// check sets s in error if not already in error and if the error is not nil or io.EOF, +func (s *_State) check(errp *error) { + if s.state == errorState || errp == nil { + return + } + if err := *errp; err != nil { + s.err = fmt.Errorf("%w[%s]", err, s.state) + if !errors.Is(err, io.EOF) { + s.state = errorState + } + } +} + +func (s *_State) fail() error { + s.state = errorState + s.err = fmt.Errorf("%w[%s]", lz4errors.ErrInternalUnhandledState, s.state) + return s.err +} diff --git a/vendor/github.com/pierrec/lz4/v4/state_gen.go b/vendor/github.com/pierrec/lz4/v4/state_gen.go new file mode 100644 index 0000000000..75fb828924 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/state_gen.go @@ -0,0 +1,28 @@ +// Code generated by "stringer -type=aState -output state_gen.go"; DO NOT EDIT. + +package lz4 + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[noState-0] + _ = x[errorState-1] + _ = x[newState-2] + _ = x[readState-3] + _ = x[writeState-4] + _ = x[closedState-5] +} + +const _aState_name = "noStateerrorStatenewStatereadStatewriteStateclosedState" + +var _aState_index = [...]uint8{0, 7, 17, 25, 34, 44, 55} + +func (i aState) String() string { + if i >= aState(len(_aState_index)-1) { + return "aState(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _aState_name[_aState_index[i]:_aState_index[i+1]] +} diff --git a/vendor/github.com/pierrec/lz4/v4/writer.go b/vendor/github.com/pierrec/lz4/v4/writer.go new file mode 100644 index 0000000000..e641be7c6a --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/writer.go @@ -0,0 +1,232 @@ +package lz4 + +import ( + "io" + + "github.com/pierrec/lz4/v4/internal/lz4block" + "github.com/pierrec/lz4/v4/internal/lz4errors" + "github.com/pierrec/lz4/v4/internal/lz4stream" +) + +var writerStates = []aState{ + noState: newState, + newState: writeState, + writeState: closedState, + closedState: newState, + errorState: newState, +} + +// NewWriter returns a new LZ4 frame encoder. +func NewWriter(w io.Writer) *Writer { + zw := &Writer{frame: lz4stream.NewFrame()} + zw.state.init(writerStates) + _ = zw.Apply(DefaultBlockSizeOption, DefaultChecksumOption, DefaultConcurrency, defaultOnBlockDone) + zw.Reset(w) + return zw +} + +// Writer allows writing an LZ4 stream. +type Writer struct { + state _State + src io.Writer // destination writer + level lz4block.CompressionLevel // how hard to try + num int // concurrency level + frame *lz4stream.Frame // frame being built + data []byte // pending data + idx int // size of pending data + handler func(int) +} + +func (*Writer) private() {} + +func (w *Writer) Apply(options ...Option) (err error) { + defer w.state.check(&err) + switch w.state.state { + case newState: + case errorState: + return w.state.err + default: + return lz4errors.ErrOptionClosedOrError + } + for _, o := range options { + if err = o(w); err != nil { + return + } + } + w.Reset(w.src) + return +} + +func (w *Writer) isNotConcurrent() bool { + return w.num == 1 +} + +// init sets up the Writer when in newState. It does not change the Writer state. +func (w *Writer) init() error { + w.frame.InitW(w.src, w.num) + size := w.frame.Descriptor.Flags.BlockSizeIndex() + w.data = size.Get() + w.idx = 0 + return w.frame.Descriptor.Write(w.frame, w.src) +} + +func (w *Writer) Write(buf []byte) (n int, err error) { + defer w.state.check(&err) + switch w.state.state { + case writeState: + case closedState, errorState: + return 0, w.state.err + case newState: + if err = w.init(); w.state.next(err) { + return + } + default: + return 0, w.state.fail() + } + + zn := len(w.data) + for len(buf) > 0 { + if w.idx == 0 && len(buf) >= zn { + // Avoid a copy as there is enough data for a block. + if err = w.write(buf[:zn], false); err != nil { + return + } + n += zn + buf = buf[zn:] + continue + } + // Accumulate the data to be compressed. + m := copy(w.data[w.idx:], buf) + n += m + w.idx += m + buf = buf[m:] + + if w.idx < len(w.data) { + // Buffer not filled. + return + } + + // Buffer full. + if err = w.write(w.data, true); err != nil { + return + } + if !w.isNotConcurrent() { + size := w.frame.Descriptor.Flags.BlockSizeIndex() + w.data = size.Get() + } + w.idx = 0 + } + return +} + +func (w *Writer) write(data []byte, safe bool) error { + if w.isNotConcurrent() { + block := w.frame.Blocks.Block + err := block.Compress(w.frame, data, w.level).Write(w.frame, w.src) + w.handler(len(block.Data)) + return err + } + size := w.frame.Descriptor.Flags.BlockSizeIndex() + c := make(chan *lz4stream.FrameDataBlock) + w.frame.Blocks.Blocks <- c + go func(c chan *lz4stream.FrameDataBlock, data []byte, size lz4block.BlockSizeIndex, safe bool) { + b := lz4stream.NewFrameDataBlock(size) + c <- b.Compress(w.frame, data, w.level) + <-c + w.handler(len(b.Data)) + b.CloseW(w.frame) + if safe { + // safe to put it back as the last usage of it was FrameDataBlock.Write() called before c is closed + size.Put(data) + } + }(c, data, size, safe) + + return nil +} + +// Close closes the Writer, flushing any unwritten data to the underlying io.Writer, +// but does not close the underlying io.Writer. +func (w *Writer) Close() (err error) { + switch w.state.state { + case writeState: + case errorState: + return w.state.err + default: + return nil + } + defer w.state.nextd(&err) + if w.idx > 0 { + // Flush pending data, disable w.data freeing as it is done later on. + if err = w.write(w.data[:w.idx], false); err != nil { + return err + } + w.idx = 0 + } + err = w.frame.CloseW(w.src, w.num) + // It is now safe to free the buffer. + if w.data != nil { + size := w.frame.Descriptor.Flags.BlockSizeIndex() + size.Put(w.data) + w.data = nil + } + return +} + +// Reset clears the state of the Writer w such that it is equivalent to its +// initial state from NewWriter, but instead writing to writer. +// Reset keeps the previous options unless overwritten by the supplied ones. +// No access to writer is performed. +// +// w.Close must be called before Reset or pending data may be dropped. +func (w *Writer) Reset(writer io.Writer) { + w.frame.Reset(w.num) + w.state.reset() + w.src = writer +} + +// ReadFrom efficiently reads from r and compressed into the Writer destination. +func (w *Writer) ReadFrom(r io.Reader) (n int64, err error) { + switch w.state.state { + case closedState, errorState: + return 0, w.state.err + case newState: + if err = w.init(); w.state.next(err) { + return + } + default: + return 0, w.state.fail() + } + defer w.state.check(&err) + + size := w.frame.Descriptor.Flags.BlockSizeIndex() + var done bool + var rn int + data := size.Get() + if w.isNotConcurrent() { + // Keep the same buffer for the whole process. + defer size.Put(data) + } + for !done { + rn, err = io.ReadFull(r, data) + switch err { + case nil: + case io.EOF: + done = true + default: + return + } + n += int64(rn) + err = w.write(data[:rn], true) + if err != nil { + return + } + w.handler(rn) + if !done && !w.isNotConcurrent() { + // The buffer will be returned automatically by go routines (safe=true) + // so get a new one fo the next round. + data = size.Get() + } + } + err = w.Close() + return +} diff --git a/vendor/github.com/pierrec/lz4/writer.go b/vendor/github.com/pierrec/lz4/writer.go deleted file mode 100644 index 0120438025..0000000000 --- a/vendor/github.com/pierrec/lz4/writer.go +++ /dev/null @@ -1,267 +0,0 @@ -package lz4 - -import ( - "encoding/binary" - "fmt" - "io" - - "github.com/pierrec/lz4/internal/xxh32" -) - -// Writer implements the LZ4 frame encoder. -type Writer struct { - Header - - buf [19]byte // magic number(4) + header(flags(2)+[Size(8)+DictID(4)]+checksum(1)) does not exceed 19 bytes - dst io.Writer // Destination. - checksum xxh32.XXHZero // Frame checksum. - zdata []byte // Compressed data. - data []byte // Data to be compressed. - idx int // Index into data. - hashtable [winSize]int // Hash table used in CompressBlock(). -} - -// NewWriter returns a new LZ4 frame encoder. -// No access to the underlying io.Writer is performed. -// The supplied Header is checked at the first Write. -// It is ok to change it before the first Write but then not until a Reset() is performed. -func NewWriter(dst io.Writer) *Writer { - return &Writer{dst: dst} -} - -// writeHeader builds and writes the header (magic+header) to the underlying io.Writer. -func (z *Writer) writeHeader() error { - // Default to 4Mb if BlockMaxSize is not set. - if z.Header.BlockMaxSize == 0 { - z.Header.BlockMaxSize = bsMapID[7] - } - // The only option that needs to be validated. - bSize := z.Header.BlockMaxSize - bSizeID, ok := bsMapValue[bSize] - if !ok { - return fmt.Errorf("lz4: invalid block max size: %d", bSize) - } - // Allocate the compressed/uncompressed buffers. - // The compressed buffer cannot exceed the uncompressed one. - if n := 2 * bSize; cap(z.zdata) < n { - z.zdata = make([]byte, n, n) - } - z.zdata = z.zdata[:bSize] - z.data = z.zdata[:cap(z.zdata)][bSize:] - z.idx = 0 - - // Size is optional. - buf := z.buf[:] - - // Set the fixed size data: magic number, block max size and flags. - binary.LittleEndian.PutUint32(buf[0:], frameMagic) - flg := byte(Version << 6) - flg |= 1 << 5 // No block dependency. - if z.Header.BlockChecksum { - flg |= 1 << 4 - } - if z.Header.Size > 0 { - flg |= 1 << 3 - } - if !z.Header.NoChecksum { - flg |= 1 << 2 - } - buf[4] = flg - buf[5] = bSizeID << 4 - - // Current buffer size: magic(4) + flags(1) + block max size (1). - n := 6 - // Optional items. - if z.Header.Size > 0 { - binary.LittleEndian.PutUint64(buf[n:], z.Header.Size) - n += 8 - } - - // The header checksum includes the flags, block max size and optional Size. - buf[n] = byte(xxh32.ChecksumZero(buf[4:n]) >> 8 & 0xFF) - z.checksum.Reset() - - // Header ready, write it out. - if _, err := z.dst.Write(buf[0 : n+1]); err != nil { - return err - } - z.Header.done = true - if debugFlag { - debug("wrote header %v", z.Header) - } - - return nil -} - -// Write compresses data from the supplied buffer into the underlying io.Writer. -// Write does not return until the data has been written. -func (z *Writer) Write(buf []byte) (int, error) { - if !z.Header.done { - if err := z.writeHeader(); err != nil { - return 0, err - } - } - if debugFlag { - debug("input buffer len=%d index=%d", len(buf), z.idx) - } - - zn := len(z.data) - var n int - for len(buf) > 0 { - if z.idx == 0 && len(buf) >= zn { - // Avoid a copy as there is enough data for a block. - if err := z.compressBlock(buf[:zn]); err != nil { - return n, err - } - n += zn - buf = buf[zn:] - continue - } - // Accumulate the data to be compressed. - m := copy(z.data[z.idx:], buf) - n += m - z.idx += m - buf = buf[m:] - if debugFlag { - debug("%d bytes copied to buf, current index %d", n, z.idx) - } - - if z.idx < len(z.data) { - // Buffer not filled. - if debugFlag { - debug("need more data for compression") - } - return n, nil - } - - // Buffer full. - if err := z.compressBlock(z.data); err != nil { - return n, err - } - z.idx = 0 - } - - return n, nil -} - -// compressBlock compresses a block. -func (z *Writer) compressBlock(data []byte) error { - if !z.NoChecksum { - z.checksum.Write(data) - } - - // The compressed block size cannot exceed the input's. - var zn int - var err error - - if level := z.Header.CompressionLevel; level != 0 { - zn, err = CompressBlockHC(data, z.zdata, level) - } else { - zn, err = CompressBlock(data, z.zdata, z.hashtable[:]) - } - - var zdata []byte - var bLen uint32 - if debugFlag { - debug("block compression %d => %d", len(data), zn) - } - if err == nil && zn > 0 && zn < len(data) { - // Compressible and compressed size smaller than uncompressed: ok! - bLen = uint32(zn) - zdata = z.zdata[:zn] - } else { - // Uncompressed block. - bLen = uint32(len(data)) | compressedBlockFlag - zdata = data - } - if debugFlag { - debug("block compression to be written len=%d data len=%d", bLen, len(zdata)) - } - - // Write the block. - if err := z.writeUint32(bLen); err != nil { - return err - } - if _, err := z.dst.Write(zdata); err != nil { - return err - } - - if z.BlockChecksum { - checksum := xxh32.ChecksumZero(zdata) - if debugFlag { - debug("block checksum %x", checksum) - } - if err := z.writeUint32(checksum); err != nil { - return err - } - } - if debugFlag { - debug("current frame checksum %x", z.checksum.Sum32()) - } - - return nil -} - -// Flush flushes any pending compressed data to the underlying writer. -// Flush does not return until the data has been written. -// If the underlying writer returns an error, Flush returns that error. -func (z *Writer) Flush() error { - if debugFlag { - debug("flush with index %d", z.idx) - } - if z.idx == 0 { - return nil - } - - return z.compressBlock(z.data[:z.idx]) -} - -// Close closes the Writer, flushing any unwritten data to the underlying io.Writer, but does not close the underlying io.Writer. -func (z *Writer) Close() error { - if !z.Header.done { - if err := z.writeHeader(); err != nil { - return err - } - } - - if err := z.Flush(); err != nil { - return err - } - - if debugFlag { - debug("writing last empty block") - } - if err := z.writeUint32(0); err != nil { - return err - } - if !z.NoChecksum { - checksum := z.checksum.Sum32() - if debugFlag { - debug("stream checksum %x", checksum) - } - if err := z.writeUint32(checksum); err != nil { - return err - } - } - return nil -} - -// Reset clears the state of the Writer z such that it is equivalent to its -// initial state from NewWriter, but instead writing to w. -// No access to the underlying io.Writer is performed. -func (z *Writer) Reset(w io.Writer) { - z.Header = Header{} - z.dst = w - z.checksum.Reset() - z.zdata = z.zdata[:0] - z.data = z.data[:0] - z.idx = 0 -} - -// writeUint32 writes a uint32 to the underlying writer. -func (z *Writer) writeUint32(x uint32) error { - buf := z.buf[:4] - binary.LittleEndian.PutUint32(buf, x) - _, err := z.dst.Write(buf) - return err -} diff --git a/vendor/github.com/pkg/errors/.travis.yml b/vendor/github.com/pkg/errors/.travis.yml index d4b92663ba..9159de03e0 100644 --- a/vendor/github.com/pkg/errors/.travis.yml +++ b/vendor/github.com/pkg/errors/.travis.yml @@ -1,15 +1,10 @@ language: go go_import_path: github.com/pkg/errors go: - - 1.4.x - - 1.5.x - - 1.6.x - - 1.7.x - - 1.8.x - - 1.9.x - - 1.10.x - 1.11.x + - 1.12.x + - 1.13.x - tip script: - - go test -v ./... + - make check diff --git a/vendor/github.com/pkg/errors/Makefile b/vendor/github.com/pkg/errors/Makefile new file mode 100644 index 0000000000..ce9d7cded6 --- /dev/null +++ b/vendor/github.com/pkg/errors/Makefile @@ -0,0 +1,44 @@ +PKGS := github.com/pkg/errors +SRCDIRS := $(shell go list -f '{{.Dir}}' $(PKGS)) +GO := go + +check: test vet gofmt misspell unconvert staticcheck ineffassign unparam + +test: + $(GO) test $(PKGS) + +vet: | test + $(GO) vet $(PKGS) + +staticcheck: + $(GO) get honnef.co/go/tools/cmd/staticcheck + staticcheck -checks all $(PKGS) + +misspell: + $(GO) get github.com/client9/misspell/cmd/misspell + misspell \ + -locale GB \ + -error \ + *.md *.go + +unconvert: + $(GO) get github.com/mdempsky/unconvert + unconvert -v $(PKGS) + +ineffassign: + $(GO) get github.com/gordonklaus/ineffassign + find $(SRCDIRS) -name '*.go' | xargs ineffassign + +pedantic: check errcheck + +unparam: + $(GO) get mvdan.cc/unparam + unparam ./... + +errcheck: + $(GO) get github.com/kisielk/errcheck + errcheck $(PKGS) + +gofmt: + @echo Checking code is gofmted + @test -z "$(shell gofmt -s -l -d -e $(SRCDIRS) | tee /dev/stderr)" diff --git a/vendor/github.com/pkg/errors/README.md b/vendor/github.com/pkg/errors/README.md index 6483ba2afb..54dfdcb12e 100644 --- a/vendor/github.com/pkg/errors/README.md +++ b/vendor/github.com/pkg/errors/README.md @@ -41,11 +41,18 @@ default: [Read the package documentation for more information](https://godoc.org/github.com/pkg/errors). +## Roadmap + +With the upcoming [Go2 error proposals](https://go.googlesource.com/proposal/+/master/design/go2draft.md) this package is moving into maintenance mode. The roadmap for a 1.0 release is as follows: + +- 0.9. Remove pre Go 1.9 and Go 1.10 support, address outstanding pull requests (if possible) +- 1.0. Final release. + ## Contributing -We welcome pull requests, bug fixes and issue reports. With that said, the bar for adding new symbols to this package is intentionally set high. +Because of the Go2 errors changes, this package is not accepting proposals for new functionality. With that said, we welcome pull requests, bug fixes and issue reports. -Before proposing a change, please discuss your change by raising an issue. +Before sending a PR, please discuss your change by raising an issue. ## License diff --git a/vendor/github.com/pkg/errors/errors.go b/vendor/github.com/pkg/errors/errors.go index 7421f326ff..161aea2582 100644 --- a/vendor/github.com/pkg/errors/errors.go +++ b/vendor/github.com/pkg/errors/errors.go @@ -82,7 +82,7 @@ // // if err, ok := err.(stackTracer); ok { // for _, f := range err.StackTrace() { -// fmt.Printf("%+s:%d", f) +// fmt.Printf("%+s:%d\n", f, f) // } // } // @@ -159,6 +159,9 @@ type withStack struct { func (w *withStack) Cause() error { return w.error } +// Unwrap provides compatibility for Go 1.13 error chains. +func (w *withStack) Unwrap() error { return w.error } + func (w *withStack) Format(s fmt.State, verb rune) { switch verb { case 'v': @@ -241,6 +244,9 @@ type withMessage struct { func (w *withMessage) Error() string { return w.msg + ": " + w.cause.Error() } func (w *withMessage) Cause() error { return w.cause } +// Unwrap provides compatibility for Go 1.13 error chains. +func (w *withMessage) Unwrap() error { return w.cause } + func (w *withMessage) Format(s fmt.State, verb rune) { switch verb { case 'v': diff --git a/vendor/github.com/pkg/errors/go113.go b/vendor/github.com/pkg/errors/go113.go new file mode 100644 index 0000000000..be0d10d0c7 --- /dev/null +++ b/vendor/github.com/pkg/errors/go113.go @@ -0,0 +1,38 @@ +// +build go1.13 + +package errors + +import ( + stderrors "errors" +) + +// Is reports whether any error in err's chain matches target. +// +// The chain consists of err itself followed by the sequence of errors obtained by +// repeatedly calling Unwrap. +// +// An error is considered to match a target if it is equal to that target or if +// it implements a method Is(error) bool such that Is(target) returns true. +func Is(err, target error) bool { return stderrors.Is(err, target) } + +// As finds the first error in err's chain that matches target, and if so, sets +// target to that error value and returns true. +// +// The chain consists of err itself followed by the sequence of errors obtained by +// repeatedly calling Unwrap. +// +// An error matches target if the error's concrete value is assignable to the value +// pointed to by target, or if the error has a method As(interface{}) bool such that +// As(target) returns true. In the latter case, the As method is responsible for +// setting target. +// +// As will panic if target is not a non-nil pointer to either a type that implements +// error, or to any interface type. As returns false if err is nil. +func As(err error, target interface{}) bool { return stderrors.As(err, target) } + +// Unwrap returns the result of calling the Unwrap method on err, if err's +// type contains an Unwrap method returning error. +// Otherwise, Unwrap returns nil. +func Unwrap(err error) error { + return stderrors.Unwrap(err) +} diff --git a/vendor/github.com/pkg/errors/stack.go b/vendor/github.com/pkg/errors/stack.go index 2874a048cf..779a8348fb 100644 --- a/vendor/github.com/pkg/errors/stack.go +++ b/vendor/github.com/pkg/errors/stack.go @@ -5,10 +5,13 @@ import ( "io" "path" "runtime" + "strconv" "strings" ) // Frame represents a program counter inside a stack frame. +// For historical reasons if Frame is interpreted as a uintptr +// its value represents the program counter + 1. type Frame uintptr // pc returns the program counter for this frame; @@ -37,6 +40,15 @@ func (f Frame) line() int { return line } +// name returns the name of this function, if known. +func (f Frame) name() string { + fn := runtime.FuncForPC(f.pc()) + if fn == nil { + return "unknown" + } + return fn.Name() +} + // Format formats the frame according to the fmt.Formatter interface. // // %s source file @@ -54,22 +66,16 @@ func (f Frame) Format(s fmt.State, verb rune) { case 's': switch { case s.Flag('+'): - pc := f.pc() - fn := runtime.FuncForPC(pc) - if fn == nil { - io.WriteString(s, "unknown") - } else { - file, _ := fn.FileLine(pc) - fmt.Fprintf(s, "%s\n\t%s", fn.Name(), file) - } + io.WriteString(s, f.name()) + io.WriteString(s, "\n\t") + io.WriteString(s, f.file()) default: io.WriteString(s, path.Base(f.file())) } case 'd': - fmt.Fprintf(s, "%d", f.line()) + io.WriteString(s, strconv.Itoa(f.line())) case 'n': - name := runtime.FuncForPC(f.pc()).Name() - io.WriteString(s, funcname(name)) + io.WriteString(s, funcname(f.name())) case 'v': f.Format(s, 's') io.WriteString(s, ":") @@ -77,6 +83,16 @@ func (f Frame) Format(s fmt.State, verb rune) { } } +// MarshalText formats a stacktrace Frame as a text string. The output is the +// same as that of fmt.Sprintf("%+v", f), but without newlines or tabs. +func (f Frame) MarshalText() ([]byte, error) { + name := f.name() + if name == "unknown" { + return []byte(name), nil + } + return []byte(fmt.Sprintf("%s %s:%d", name, f.file(), f.line())), nil +} + // StackTrace is stack of Frames from innermost (newest) to outermost (oldest). type StackTrace []Frame @@ -94,16 +110,30 @@ func (st StackTrace) Format(s fmt.State, verb rune) { switch { case s.Flag('+'): for _, f := range st { - fmt.Fprintf(s, "\n%+v", f) + io.WriteString(s, "\n") + f.Format(s, verb) } case s.Flag('#'): fmt.Fprintf(s, "%#v", []Frame(st)) default: - fmt.Fprintf(s, "%v", []Frame(st)) + st.formatSlice(s, verb) } case 's': - fmt.Fprintf(s, "%s", []Frame(st)) + st.formatSlice(s, verb) + } +} + +// formatSlice will format this StackTrace into the given buffer as a slice of +// Frame, only valid when called with '%s' or '%v'. +func (st StackTrace) formatSlice(s fmt.State, verb rune) { + io.WriteString(s, "[") + for i, f := range st { + if i > 0 { + io.WriteString(s, " ") + } + f.Format(s, verb) } + io.WriteString(s, "]") } // stack represents a stack of program counters. diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu.go b/vendor/github.com/shirou/gopsutil/cpu/cpu.go index d3ea1f245c..24a81167db 100644 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu.go +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu.go @@ -149,7 +149,9 @@ func PercentWithContext(ctx context.Context, interval time.Duration, percpu bool return nil, err } - time.Sleep(interval) + if err := common.Sleep(ctx, interval); err != nil { + return nil, err + } // And at the end of the interval. cpuTimes2, err := Times(percpu) diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin.go index 3d3455ee68..421f1e16b0 100644 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin.go +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin.go @@ -4,10 +4,10 @@ package cpu import ( "context" - "os/exec" "strconv" "strings" + "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" ) @@ -25,17 +25,10 @@ const ( var ClocksPerSec = float64(128) func init() { - getconf, err := exec.LookPath("getconf") - if err != nil { - return - } - out, err := invoke.Command(getconf, "CLK_TCK") + clkTck, err := sysconf.Sysconf(sysconf.SC_CLK_TCK) // ignore errors if err == nil { - i, err := strconv.ParseFloat(strings.TrimSpace(string(out)), 64) - if err == nil { - ClocksPerSec = float64(i) - } + ClocksPerSec = float64(clkTck) } } diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_cgo.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_cgo.go index 180e0afa73..2a7d4a1154 100644 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_cgo.go +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_cgo.go @@ -10,6 +10,7 @@ package cpu #include #include #include +#include #if TARGET_OS_MAC #include #endif diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_dragonfly.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_dragonfly.go new file mode 100644 index 0000000000..45094df1d3 --- /dev/null +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu_dragonfly.go @@ -0,0 +1,154 @@ +package cpu + +import ( + "context" + "fmt" + "reflect" + "regexp" + "runtime" + "strconv" + "strings" + "unsafe" + + "github.com/shirou/gopsutil/internal/common" + "github.com/tklauser/go-sysconf" + "golang.org/x/sys/unix" +) + +var ClocksPerSec = float64(128) +var cpuMatch = regexp.MustCompile(`^CPU:`) +var originMatch = regexp.MustCompile(`Origin\s*=\s*"(.+)"\s+Id\s*=\s*(.+)\s+Stepping\s*=\s*(.+)`) +var featuresMatch = regexp.MustCompile(`Features=.+<(.+)>`) +var featuresMatch2 = regexp.MustCompile(`Features2=[a-f\dx]+<(.+)>`) +var cpuEnd = regexp.MustCompile(`^Trying to mount root`) +var cpuTimesSize int +var emptyTimes cpuTimes + +func init() { + clkTck, err := sysconf.Sysconf(sysconf.SC_CLK_TCK) + // ignore errors + if err == nil { + ClocksPerSec = float64(clkTck) + } +} + +func timeStat(name string, t *cpuTimes) *TimesStat { + return &TimesStat{ + User: float64(t.User) / ClocksPerSec, + Nice: float64(t.Nice) / ClocksPerSec, + System: float64(t.Sys) / ClocksPerSec, + Idle: float64(t.Idle) / ClocksPerSec, + Irq: float64(t.Intr) / ClocksPerSec, + CPU: name, + } +} + +func Times(percpu bool) ([]TimesStat, error) { + return TimesWithContext(context.Background(), percpu) +} + +func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) { + if percpu { + buf, err := unix.SysctlRaw("kern.cp_times") + if err != nil { + return nil, err + } + + // We can't do this in init due to the conflict with cpu.init() + if cpuTimesSize == 0 { + cpuTimesSize = int(reflect.TypeOf(cpuTimes{}).Size()) + } + + ncpus := len(buf) / cpuTimesSize + ret := make([]TimesStat, 0, ncpus) + for i := 0; i < ncpus; i++ { + times := (*cpuTimes)(unsafe.Pointer(&buf[i*cpuTimesSize])) + if *times == emptyTimes { + // CPU not present + continue + } + ret = append(ret, *timeStat(fmt.Sprintf("cpu%d", len(ret)), times)) + } + return ret, nil + } + + buf, err := unix.SysctlRaw("kern.cp_time") + if err != nil { + return nil, err + } + + times := (*cpuTimes)(unsafe.Pointer(&buf[0])) + return []TimesStat{*timeStat("cpu-total", times)}, nil +} + +// Returns only one InfoStat on DragonflyBSD. The information regarding core +// count, however is accurate and it is assumed that all InfoStat attributes +// are the same across CPUs. +func Info() ([]InfoStat, error) { + return InfoWithContext(context.Background()) +} + +func InfoWithContext(ctx context.Context) ([]InfoStat, error) { + const dmesgBoot = "/var/run/dmesg.boot" + + c, err := parseDmesgBoot(dmesgBoot) + if err != nil { + return nil, err + } + + var u32 uint32 + if u32, err = unix.SysctlUint32("hw.clockrate"); err != nil { + return nil, err + } + c.Mhz = float64(u32) + + var num int + var buf string + if buf, err = unix.Sysctl("hw.cpu_topology.tree"); err != nil { + return nil, err + } + num = strings.Count(buf, "CHIP") + c.Cores = int32(strings.Count(string(buf), "CORE") / num) + + if c.ModelName, err = unix.Sysctl("hw.model"); err != nil { + return nil, err + } + + ret := make([]InfoStat, num) + for i := 0; i < num; i++ { + ret[i] = c + } + + return ret, nil +} + +func parseDmesgBoot(fileName string) (InfoStat, error) { + c := InfoStat{} + lines, _ := common.ReadLines(fileName) + for _, line := range lines { + if matches := cpuEnd.FindStringSubmatch(line); matches != nil { + break + } else if matches := originMatch.FindStringSubmatch(line); matches != nil { + c.VendorID = matches[1] + t, err := strconv.ParseInt(matches[2], 10, 32) + if err != nil { + return c, fmt.Errorf("unable to parse DragonflyBSD CPU stepping information from %q: %v", line, err) + } + c.Stepping = int32(t) + } else if matches := featuresMatch.FindStringSubmatch(line); matches != nil { + for _, v := range strings.Split(matches[1], ",") { + c.Flags = append(c.Flags, strings.ToLower(v)) + } + } else if matches := featuresMatch2.FindStringSubmatch(line); matches != nil { + for _, v := range strings.Split(matches[1], ",") { + c.Flags = append(c.Flags, strings.ToLower(v)) + } + } + } + + return c, nil +} + +func CountsWithContext(ctx context.Context, logical bool) (int, error) { + return runtime.NumCPU(), nil +} diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_dragonfly_amd64.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_dragonfly_amd64.go new file mode 100644 index 0000000000..57e14528db --- /dev/null +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu_dragonfly_amd64.go @@ -0,0 +1,9 @@ +package cpu + +type cpuTimes struct { + User uint64 + Nice uint64 + Sys uint64 + Intr uint64 + Idle uint64 +} diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_fallback.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_fallback.go index fbb06083db..5551c49d1d 100644 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu_fallback.go +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu_fallback.go @@ -1,4 +1,4 @@ -// +build !darwin,!linux,!freebsd,!openbsd,!solaris,!windows +// +build !darwin,!linux,!freebsd,!openbsd,!solaris,!windows,!dragonfly package cpu diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd.go index 57beffae11..24527af20f 100644 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd.go +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd.go @@ -3,7 +3,6 @@ package cpu import ( "context" "fmt" - "os/exec" "reflect" "regexp" "runtime" @@ -12,6 +11,7 @@ import ( "unsafe" "github.com/shirou/gopsutil/internal/common" + "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" ) @@ -26,17 +26,10 @@ var cpuTimesSize int var emptyTimes cpuTimes func init() { - getconf, err := exec.LookPath("getconf") - if err != nil { - return - } - out, err := invoke.Command(getconf, "CLK_TCK") + clkTck, err := sysconf.Sysconf(sysconf.SC_CLK_TCK) // ignore errors if err == nil { - i, err := strconv.ParseFloat(strings.TrimSpace(string(out)), 64) - if err == nil { - ClocksPerSec = float64(i) - } + ClocksPerSec = float64(clkTck) } } diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_linux.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_linux.go index 735bd29ed1..b7040c7ea7 100644 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu_linux.go +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu_linux.go @@ -6,27 +6,21 @@ import ( "context" "errors" "fmt" - "os/exec" + "path/filepath" "strconv" "strings" "github.com/shirou/gopsutil/internal/common" + "github.com/tklauser/go-sysconf" ) var ClocksPerSec = float64(100) func init() { - getconf, err := exec.LookPath("getconf") - if err != nil { - return - } - out, err := invoke.CommandWithContext(context.Background(), getconf, "CLK_TCK") + clkTck, err := sysconf.Sysconf(sysconf.SC_CLK_TCK) // ignore errors if err == nil { - i, err := strconv.ParseFloat(strings.TrimSpace(string(out)), 64) - if err == nil { - ClocksPerSec = i - } + ClocksPerSec = float64(clkTck) } } @@ -311,7 +305,29 @@ func CountsWithContext(ctx context.Context, logical bool) (int, error) { } return ret, nil } - // physical cores https://github.com/giampaolo/psutil/blob/d01a9eaa35a8aadf6c519839e987a49d8be2d891/psutil/_pslinux.py#L628 + // physical cores + // https://github.com/giampaolo/psutil/blob/8415355c8badc9c94418b19bdf26e622f06f0cce/psutil/_pslinux.py#L615-L628 + var threadSiblingsLists = make(map[string]bool) + // These 2 files are the same but */core_cpus_list is newer while */thread_siblings_list is deprecated and may disappear in the future. + // https://www.kernel.org/doc/Documentation/admin-guide/cputopology.rst + // https://github.com/giampaolo/psutil/pull/1727#issuecomment-707624964 + // https://lkml.org/lkml/2019/2/26/41 + for _, glob := range []string{"devices/system/cpu/cpu[0-9]*/topology/core_cpus_list", "devices/system/cpu/cpu[0-9]*/topology/thread_siblings_list"} { + if files, err := filepath.Glob(common.HostSys(glob)); err == nil { + for _, file := range files { + lines, err := common.ReadLines(file) + if err != nil || len(lines) != 1 { + continue + } + threadSiblingsLists[lines[0]] = true + } + ret := len(threadSiblingsLists) + if ret != 0 { + return ret, nil + } + } + } + // https://github.com/giampaolo/psutil/blob/122174a10b75c9beebe15f6c07dcf3afbe3b120d/psutil/_pslinux.py#L631-L652 filename := common.HostProc("cpuinfo") lines, err := common.ReadLines(filename) if err != nil { diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_openbsd.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_openbsd.go index 92a8bd75c9..c761aa21d5 100644 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu_openbsd.go +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu_openbsd.go @@ -7,13 +7,13 @@ import ( "context" "encoding/binary" "fmt" - "os/exec" "runtime" "strconv" "strings" "syscall" "github.com/shirou/gopsutil/internal/common" + "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" ) @@ -32,7 +32,6 @@ const ( CTLKern = 1 // "high kernel": proc, limits CTLHw = 6 // CTL_HW SMT = 24 // HW_SMT - NCpuOnline = 25 // HW_NCPUONLINE KernCptime = 40 // KERN_CPTIME KernCptime2 = 71 // KERN_CPTIME2 ) @@ -40,20 +39,12 @@ const ( var ClocksPerSec = float64(128) func init() { - func() { - getconf, err := exec.LookPath("getconf") - if err != nil { - return - } - out, err := invoke.Command(getconf, "CLK_TCK") - // ignore errors - if err == nil { - i, err := strconv.ParseFloat(strings.TrimSpace(string(out)), 64) - if err == nil { - ClocksPerSec = float64(i) - } - } - }() + clkTck, err := sysconf.Sysconf(sysconf.SC_CLK_TCK) + // ignore errors + if err == nil { + ClocksPerSec = float64(clkTck) + } + func() { v, err := unix.Sysctl("kern.osrelease") // can't reuse host.PlatformInformation because of circular import if err != nil { @@ -163,25 +154,17 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) { c := InfoStat{} - var u32 uint32 - if u32, err = unix.SysctlUint32("hw.cpuspeed"); err != nil { - return nil, err - } - c.Mhz = float64(u32) - - mib := []int32{CTLHw, NCpuOnline} - buf, _, err := common.CallSyscall(mib) + mhz, err := unix.SysctlUint32("hw.cpuspeed") if err != nil { return nil, err } + c.Mhz = float64(mhz) - var ncpu int32 - br := bytes.NewReader(buf) - err = binary.Read(br, binary.LittleEndian, &ncpu) + ncpu, err := unix.SysctlUint32("hw.ncpuonline") if err != nil { return nil, err } - c.Cores = ncpu + c.Cores = int32(ncpu) if c.ModelName, err = unix.Sysctl("hw.model"); err != nil { return nil, err diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_solaris.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_solaris.go index 3de0984240..d97688d4a4 100644 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu_solaris.go +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu_solaris.go @@ -10,22 +10,17 @@ import ( "sort" "strconv" "strings" + + "github.com/tklauser/go-sysconf" ) var ClocksPerSec = float64(128) func init() { - getconf, err := exec.LookPath("getconf") - if err != nil { - return - } - out, err := invoke.Command(getconf, "CLK_TCK") + clkTck, err := sysconf.Sysconf(sysconf.SC_CLK_TCK) // ignore errors if err == nil { - i, err := strconv.ParseFloat(strings.TrimSpace(string(out)), 64) - if err == nil { - ClocksPerSec = float64(i) - } + ClocksPerSec = float64(clkTck) } } diff --git a/vendor/github.com/shirou/gopsutil/internal/common/common.go b/vendor/github.com/shirou/gopsutil/internal/common/common.go index d46aaeba39..ebf70ea0bf 100644 --- a/vendor/github.com/shirou/gopsutil/internal/common/common.go +++ b/vendor/github.com/shirou/gopsutil/internal/common/common.go @@ -94,6 +94,17 @@ func (i FakeInvoke) CommandWithContext(ctx context.Context, name string, arg ... var ErrNotImplementedError = errors.New("not implemented yet") +// ReadFile reads contents from a file +func ReadFile(filename string) (string, error) { + content, err := ioutil.ReadFile(filename) + + if err != nil { + return "", err + } + + return string(content), nil +} + // ReadLines reads contents from a file and splits them by new lines. // A convenience wrapper to ReadLinesOffsetN(filename, 0, -1). func ReadLines(filename string) ([]string, error) { @@ -315,7 +326,6 @@ func GetEnv(key string, dfault string, combineWith ...string) string { copy(all[1:], combineWith) return filepath.Join(all...) } - panic("invalid switch case") } func HostProc(combineWith ...string) string { diff --git a/vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go b/vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go index dde5c39037..be46af3d9c 100644 --- a/vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go +++ b/vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go @@ -36,7 +36,7 @@ func CallSyscall(mib []int32) ([]byte, uint64, error) { // get required buffer size length := uint64(0) _, _, err := unix.Syscall6( - unix.SYS___SYSCTL, + 202, // unix.SYS___SYSCTL https://github.com/golang/sys/blob/76b94024e4b621e672466e8db3d7f084e7ddcad2/unix/zsysnum_darwin_amd64.go#L146 uintptr(unsafe.Pointer(&mib[0])), uintptr(miblen), 0, @@ -54,7 +54,7 @@ func CallSyscall(mib []int32) ([]byte, uint64, error) { // get proc info itself buf := make([]byte, length) _, _, err = unix.Syscall6( - unix.SYS___SYSCTL, + 202, // unix.SYS___SYSCTL https://github.com/golang/sys/blob/76b94024e4b621e672466e8db3d7f084e7ddcad2/unix/zsysnum_darwin_amd64.go#L146 uintptr(unsafe.Pointer(&mib[0])), uintptr(miblen), uintptr(unsafe.Pointer(&buf[0])), diff --git a/vendor/github.com/shirou/gopsutil/internal/common/common_linux.go b/vendor/github.com/shirou/gopsutil/internal/common/common_linux.go index 6d0ef37137..7349989936 100644 --- a/vendor/github.com/shirou/gopsutil/internal/common/common_linux.go +++ b/vendor/github.com/shirou/gopsutil/internal/common/common_linux.go @@ -10,6 +10,7 @@ import ( "path/filepath" "strconv" "strings" + "sync" "time" ) @@ -110,9 +111,24 @@ func Virtualization() (string, string, error) { return VirtualizationWithContext(context.Background()) } +// required variables for concurrency safe virtualization caching +var ( + cachedVirtMap map[string]string + cachedVirtMutex sync.RWMutex + cachedVirtOnce sync.Once +) + func VirtualizationWithContext(ctx context.Context) (string, string, error) { - var system string - var role string + var system, role string + + // if cached already, return from cache + cachedVirtMutex.RLock() // unlock won't be deferred so concurrent reads don't wait for long + if cachedVirtMap != nil { + cachedSystem, cachedRole := cachedVirtMap["system"], cachedVirtMap["role"] + cachedVirtMutex.RUnlock() + return cachedSystem, cachedRole, nil + } + cachedVirtMutex.RUnlock() filename := HostProc("xen") if PathExists(filename) { @@ -194,6 +210,17 @@ func VirtualizationWithContext(ctx context.Context) (string, string, error) { } } + if PathExists(filepath.Join(filename, "1", "environ")) { + contents, err := ReadFile(filepath.Join(filename, "1", "environ")) + + if err == nil { + if strings.Contains(contents, "container=lxc") { + system = "lxc" + role = "guest" + } + } + } + if PathExists(filepath.Join(filename, "self", "cgroup")) { contents, err := ReadLines(filepath.Join(filename, "self", "cgroup")) if err == nil { @@ -220,6 +247,17 @@ func VirtualizationWithContext(ctx context.Context) (string, string, error) { role = "host" } } + + // before returning for the first time, cache the system and role + cachedVirtOnce.Do(func() { + cachedVirtMutex.Lock() + defer cachedVirtMutex.Unlock() + cachedVirtMap = map[string]string{ + "system": system, + "role": role, + } + }) + return system, role, nil } diff --git a/vendor/github.com/shirou/gopsutil/internal/common/common_windows.go b/vendor/github.com/shirou/gopsutil/internal/common/common_windows.go index 9bc05ded88..2471bae1f5 100644 --- a/vendor/github.com/shirou/gopsutil/internal/common/common_windows.go +++ b/vendor/github.com/shirou/gopsutil/internal/common/common_windows.go @@ -4,6 +4,7 @@ package common import ( "context" + "fmt" "path/filepath" "strings" "syscall" @@ -69,13 +70,13 @@ var ( ProcNtWow64QueryInformationProcess64 = ModNt.NewProc("NtWow64QueryInformationProcess64") ProcNtWow64ReadVirtualMemory64 = ModNt.NewProc("NtWow64ReadVirtualMemory64") - PdhOpenQuery = ModPdh.NewProc("PdhOpenQuery") - PdhAddCounter = ModPdh.NewProc("PdhAddCounterW") - PdhCollectQueryData = ModPdh.NewProc("PdhCollectQueryData") - PdhGetFormattedCounterValue = ModPdh.NewProc("PdhGetFormattedCounterValue") - PdhCloseQuery = ModPdh.NewProc("PdhCloseQuery") + PdhOpenQuery = ModPdh.NewProc("PdhOpenQuery") + PdhAddEnglishCounterW = ModPdh.NewProc("PdhAddEnglishCounterW") + PdhCollectQueryData = ModPdh.NewProc("PdhCollectQueryData") + PdhGetFormattedCounterValue = ModPdh.NewProc("PdhGetFormattedCounterValue") + PdhCloseQuery = ModPdh.NewProc("PdhCloseQuery") - procQueryDosDeviceW = Modkernel32.NewProc("QueryDosDeviceW") + procQueryDosDeviceW = Modkernel32.NewProc("QueryDosDeviceW") ) type FILETIME struct { @@ -93,7 +94,7 @@ func BytePtrToString(p *uint8) string { return string(a[:i]) } -// CounterInfo +// CounterInfo struct is used to track a windows performance counter // copied from https://github.com/mackerelio/mackerel-agent/ type CounterInfo struct { PostName string @@ -101,7 +102,7 @@ type CounterInfo struct { Counter windows.Handle } -// CreateQuery XXX +// CreateQuery with a PdhOpenQuery call // copied from https://github.com/mackerelio/mackerel-agent/ func CreateQuery() (windows.Handle, error) { var query windows.Handle @@ -112,10 +113,10 @@ func CreateQuery() (windows.Handle, error) { return query, nil } -// CreateCounter XXX +// CreateCounter with a PdhAddEnglishCounterW call func CreateCounter(query windows.Handle, pname, cname string) (*CounterInfo, error) { var counter windows.Handle - r, _, err := PdhAddCounter.Call( + r, _, err := PdhAddEnglishCounterW.Call( uintptr(query), uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(cname))), 0, @@ -130,6 +131,62 @@ func CreateCounter(query windows.Handle, pname, cname string) (*CounterInfo, err }, nil } +// GetCounterValue get counter value from handle +// adapted from https://github.com/mackerelio/mackerel-agent/ +func GetCounterValue(counter windows.Handle) (float64, error) { + var value PDH_FMT_COUNTERVALUE_DOUBLE + r, _, err := PdhGetFormattedCounterValue.Call(uintptr(counter), PDH_FMT_DOUBLE, uintptr(0), uintptr(unsafe.Pointer(&value))) + if r != 0 && r != PDH_INVALID_DATA { + return 0.0, err + } + return value.DoubleValue, nil +} + +type Win32PerformanceCounter struct { + PostName string + CounterName string + Query windows.Handle + Counter windows.Handle +} + +func NewWin32PerformanceCounter(postName, counterName string) (*Win32PerformanceCounter, error) { + query, err := CreateQuery() + if err != nil { + return nil, err + } + var counter = Win32PerformanceCounter{ + Query: query, + PostName: postName, + CounterName: counterName, + } + r, _, err := PdhAddEnglishCounterW.Call( + uintptr(counter.Query), + uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(counter.CounterName))), + 0, + uintptr(unsafe.Pointer(&counter.Counter)), + ) + if r != 0 { + return nil, err + } + return &counter, nil +} + +func (w *Win32PerformanceCounter) GetValue() (float64, error) { + r, _, err := PdhCollectQueryData.Call(uintptr(w.Query)) + if r != 0 && err != nil { + if r == PDH_NO_DATA { + return 0.0, fmt.Errorf("%w: this counter has not data", err) + } + return 0.0, err + } + + return GetCounterValue(w.Counter) +} + +func ProcessorQueueLengthCounter() (*Win32PerformanceCounter, error) { + return NewWin32PerformanceCounter("processor_queue_length", `\System\Processor Queue Length`) +} + // WMIQueryWithContext - wraps wmi.Query with a timed-out context to avoid hanging func WMIQueryWithContext(ctx context.Context, query string, dst interface{}, connectServerArgs ...interface{}) error { if _, ok := ctx.Deadline(); !ok { diff --git a/vendor/github.com/shirou/gopsutil/internal/common/sleep.go b/vendor/github.com/shirou/gopsutil/internal/common/sleep.go new file mode 100644 index 0000000000..ee27e54d46 --- /dev/null +++ b/vendor/github.com/shirou/gopsutil/internal/common/sleep.go @@ -0,0 +1,18 @@ +package common + +import ( + "context" + "time" +) + +// Sleep awaits for provided interval. +// Can be interrupted by context cancelation. +func Sleep(ctx context.Context, interval time.Duration) error { + var timer = time.NewTimer(interval) + select { + case <-ctx.Done(): + return ctx.Err() + case <-timer.C: + return nil + } +} diff --git a/vendor/github.com/shirou/gopsutil/mem/mem.go b/vendor/github.com/shirou/gopsutil/mem/mem.go index 8e444ba0ab..dc2aacb59c 100644 --- a/vendor/github.com/shirou/gopsutil/mem/mem.go +++ b/vendor/github.com/shirou/gopsutil/mem/mem.go @@ -88,6 +88,10 @@ type SwapMemoryStat struct { PgIn uint64 `json:"pgin"` PgOut uint64 `json:"pgout"` PgFault uint64 `json:"pgfault"` + + // Linux specific numbers + // https://www.kernel.org/doc/Documentation/cgroup-v2.txt + PgMajFault uint64 `json:"pgmajfault"` } func (m VirtualMemoryStat) String() string { diff --git a/vendor/github.com/shirou/gopsutil/mem/mem_linux.go b/vendor/github.com/shirou/gopsutil/mem/mem_linux.go index 66ccca9c9e..f9cb8f260f 100644 --- a/vendor/github.com/shirou/gopsutil/mem/mem_linux.go +++ b/vendor/github.com/shirou/gopsutil/mem/mem_linux.go @@ -73,86 +73,226 @@ func fillFromMeminfoWithContext(ctx context.Context) (*VirtualMemoryStat, *Virtu value := strings.TrimSpace(fields[1]) value = strings.Replace(value, " kB", "", -1) - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx,err - } switch key { case "MemTotal": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.Total = t * 1024 case "MemFree": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.Free = t * 1024 case "MemAvailable": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } memavail = true ret.Available = t * 1024 case "Buffers": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.Buffers = t * 1024 case "Cached": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.Cached = t * 1024 case "Active": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.Active = t * 1024 case "Inactive": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.Inactive = t * 1024 case "Active(anon)": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } retEx.ActiveAnon = t * 1024 case "Inactive(anon)": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } retEx.InactiveAnon = t * 1024 case "Active(file)": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } activeFile = true retEx.ActiveFile = t * 1024 case "Inactive(file)": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } inactiveFile = true retEx.InactiveFile = t * 1024 case "Unevictable": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } retEx.Unevictable = t * 1024 case "Writeback": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.Writeback = t * 1024 case "WritebackTmp": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.WritebackTmp = t * 1024 case "Dirty": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.Dirty = t * 1024 case "Shmem": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.Shared = t * 1024 case "Slab": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.Slab = t * 1024 case "SReclaimable": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } sReclaimable = true ret.SReclaimable = t * 1024 case "SUnreclaim": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.SUnreclaim = t * 1024 case "PageTables": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.PageTables = t * 1024 case "SwapCached": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.SwapCached = t * 1024 case "CommitLimit": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.CommitLimit = t * 1024 case "Committed_AS": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.CommittedAS = t * 1024 case "HighTotal": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.HighTotal = t * 1024 case "HighFree": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.HighFree = t * 1024 case "LowTotal": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.LowTotal = t * 1024 case "LowFree": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.LowFree = t * 1024 case "SwapTotal": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.SwapTotal = t * 1024 case "SwapFree": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.SwapFree = t * 1024 case "Mapped": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.Mapped = t * 1024 case "VmallocTotal": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.VMallocTotal = t * 1024 case "VmallocUsed": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.VMallocUsed = t * 1024 case "VmallocChunk": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.VMallocChunk = t * 1024 case "HugePages_Total": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.HugePagesTotal = t case "HugePages_Free": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.HugePagesFree = t case "Hugepagesize": + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx, err + } ret.HugePageSize = t * 1024 } } @@ -232,6 +372,12 @@ func SwapMemoryWithContext(ctx context.Context) (*SwapMemoryStat, error) { continue } ret.PgFault = value * 4 * 1024 + case "pgmajfault": + value, err := strconv.ParseUint(fields[1], 10, 64) + if err != nil { + continue + } + ret.PgMajFault = value * 4 * 1024 } } return ret, nil diff --git a/vendor/github.com/shirou/gopsutil/mem/mem_openbsd.go b/vendor/github.com/shirou/gopsutil/mem/mem_openbsd.go index 35472a3260..7ecdae9fd5 100644 --- a/vendor/github.com/shirou/gopsutil/mem/mem_openbsd.go +++ b/vendor/github.com/shirou/gopsutil/mem/mem_openbsd.go @@ -11,6 +11,7 @@ import ( "os/exec" "github.com/shirou/gopsutil/internal/common" + "golang.org/x/sys/unix" ) func GetPageSize() (uint64, error) { @@ -18,17 +19,7 @@ func GetPageSize() (uint64, error) { } func GetPageSizeWithContext(ctx context.Context) (uint64, error) { - mib := []int32{CTLVm, VmUvmexp} - buf, length, err := common.CallSyscall(mib) - if err != nil { - return 0, err - } - if length < sizeOfUvmexp { - return 0, fmt.Errorf("short syscall ret %d bytes", length) - } - var uvmexp Uvmexp - br := bytes.NewReader(buf) - err = common.Read(br, binary.LittleEndian, &uvmexp) + uvmexp, err := unix.SysctlUvmexp("vm.uvmexp") if err != nil { return 0, err } @@ -40,17 +31,7 @@ func VirtualMemory() (*VirtualMemoryStat, error) { } func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) { - mib := []int32{CTLVm, VmUvmexp} - buf, length, err := common.CallSyscall(mib) - if err != nil { - return nil, err - } - if length < sizeOfUvmexp { - return nil, fmt.Errorf("short syscall ret %d bytes", length) - } - var uvmexp Uvmexp - br := bytes.NewReader(buf) - err = common.Read(br, binary.LittleEndian, &uvmexp) + uvmexp, err := unix.SysctlUvmexp("vm.uvmexp") if err != nil { return nil, err } @@ -69,8 +50,8 @@ func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) { ret.Used = ret.Total - ret.Available ret.UsedPercent = float64(ret.Used) / float64(ret.Total) * 100.0 - mib = []int32{CTLVfs, VfsGeneric, VfsBcacheStat} - buf, length, err = common.CallSyscall(mib) + mib := []int32{CTLVfs, VfsGeneric, VfsBcacheStat} + buf, length, err := common.CallSyscall(mib) if err != nil { return nil, err } @@ -78,7 +59,7 @@ func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) { return nil, fmt.Errorf("short syscall ret %d bytes", length) } var bcs Bcachestats - br = bytes.NewReader(buf) + br := bytes.NewReader(buf) err = common.Read(br, binary.LittleEndian, &bcs) if err != nil { return nil, err diff --git a/vendor/github.com/shirou/gopsutil/mem/mem_openbsd_386.go b/vendor/github.com/shirou/gopsutil/mem/mem_openbsd_386.go new file mode 100644 index 0000000000..aacd4f61e5 --- /dev/null +++ b/vendor/github.com/shirou/gopsutil/mem/mem_openbsd_386.go @@ -0,0 +1,37 @@ +// +build openbsd +// +build 386 +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs mem/types_openbsd.go + +package mem + +const ( + CTLVfs = 10 + VfsGeneric = 0 + VfsBcacheStat = 3 +) + +const ( + sizeOfBcachestats = 0x90 +) + +type Bcachestats struct { + Numbufs int64 + Numbufpages int64 + Numdirtypages int64 + Numcleanpages int64 + Pendingwrites int64 + Pendingreads int64 + Numwrites int64 + Numreads int64 + Cachehits int64 + Busymapped int64 + Dmapages int64 + Highpages int64 + Delwribufs int64 + Kvaslots int64 + Avail int64 + Highflips int64 + Highflops int64 + Dmaflips int64 +} diff --git a/vendor/github.com/shirou/gopsutil/mem/mem_openbsd_amd64.go b/vendor/github.com/shirou/gopsutil/mem/mem_openbsd_amd64.go index e09b908e46..d187abf01f 100644 --- a/vendor/github.com/shirou/gopsutil/mem/mem_openbsd_amd64.go +++ b/vendor/github.com/shirou/gopsutil/mem/mem_openbsd_amd64.go @@ -4,105 +4,15 @@ package mem const ( - CTLVm = 2 CTLVfs = 10 - VmUvmexp = 4 VfsGeneric = 0 VfsBcacheStat = 3 ) const ( - sizeOfUvmexp = 0x154 sizeOfBcachestats = 0x78 ) -type Uvmexp struct { - Pagesize int32 - Pagemask int32 - Pageshift int32 - Npages int32 - Free int32 - Active int32 - Inactive int32 - Paging int32 - Wired int32 - Zeropages int32 - Reserve_pagedaemon int32 - Reserve_kernel int32 - Anonpages int32 - Vnodepages int32 - Vtextpages int32 - Freemin int32 - Freetarg int32 - Inactarg int32 - Wiredmax int32 - Anonmin int32 - Vtextmin int32 - Vnodemin int32 - Anonminpct int32 - Vtextminpct int32 - Vnodeminpct int32 - Nswapdev int32 - Swpages int32 - Swpginuse int32 - Swpgonly int32 - Nswget int32 - Nanon int32 - Nanonneeded int32 - Nfreeanon int32 - Faults int32 - Traps int32 - Intrs int32 - Swtch int32 - Softs int32 - Syscalls int32 - Pageins int32 - Obsolete_swapins int32 - Obsolete_swapouts int32 - Pgswapin int32 - Pgswapout int32 - Forks int32 - Forks_ppwait int32 - Forks_sharevm int32 - Pga_zerohit int32 - Pga_zeromiss int32 - Zeroaborts int32 - Fltnoram int32 - Fltnoanon int32 - Fltpgwait int32 - Fltpgrele int32 - Fltrelck int32 - Fltrelckok int32 - Fltanget int32 - Fltanretry int32 - Fltamcopy int32 - Fltnamap int32 - Fltnomap int32 - Fltlget int32 - Fltget int32 - Flt_anon int32 - Flt_acow int32 - Flt_obj int32 - Flt_prcopy int32 - Flt_przero int32 - Pdwoke int32 - Pdrevs int32 - Pdswout int32 - Pdfreed int32 - Pdscans int32 - Pdanscan int32 - Pdobscan int32 - Pdreact int32 - Pdbusy int32 - Pdpageouts int32 - Pdpending int32 - Pddeact int32 - Pdreanon int32 - Pdrevnode int32 - Pdrevtext int32 - Fpswtch int32 - Kmapent int32 -} type Bcachestats struct { Numbufs int64 Numbufpages int64 diff --git a/vendor/github.com/shirou/gopsutil/mem/mem_windows.go b/vendor/github.com/shirou/gopsutil/mem/mem_windows.go index ced0b197d7..a925faa252 100644 --- a/vendor/github.com/shirou/gopsutil/mem/mem_windows.go +++ b/vendor/github.com/shirou/gopsutil/mem/mem_windows.go @@ -42,6 +42,7 @@ func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) { ret := &VirtualMemoryStat{ Total: memInfo.ullTotalPhys, Available: memInfo.ullAvailPhys, + Free: memInfo.ullAvailPhys, UsedPercent: float64(memInfo.dwMemoryLoad), } diff --git a/vendor/github.com/shirou/gopsutil/net/net_darwin.go b/vendor/github.com/shirou/gopsutil/net/net_darwin.go index 1daed86982..8e6e7f953d 100644 --- a/vendor/github.com/shirou/gopsutil/net/net_darwin.go +++ b/vendor/github.com/shirou/gopsutil/net/net_darwin.go @@ -269,7 +269,7 @@ func FilterCounters() ([]FilterStat, error) { } func FilterCountersWithContext(ctx context.Context) ([]FilterStat, error) { - return nil, errors.New("NetFilterCounters not implemented for darwin") + return nil, common.ErrNotImplementedError } func ConntrackStats(percpu bool) ([]ConntrackStat, error) { @@ -289,5 +289,5 @@ func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { } func ProtoCountersWithContext(ctx context.Context, protocols []string) ([]ProtoCountersStat, error) { - return nil, errors.New("NetProtoCounters not implemented for darwin") + return nil, common.ErrNotImplementedError } diff --git a/vendor/github.com/shirou/gopsutil/net/net_freebsd.go b/vendor/github.com/shirou/gopsutil/net/net_freebsd.go index 2284d982c8..1204f59770 100644 --- a/vendor/github.com/shirou/gopsutil/net/net_freebsd.go +++ b/vendor/github.com/shirou/gopsutil/net/net_freebsd.go @@ -4,7 +4,6 @@ package net import ( "context" - "errors" "os/exec" "strconv" "strings" @@ -109,7 +108,7 @@ func FilterCounters() ([]FilterStat, error) { } func FilterCountersWithContext(ctx context.Context) ([]FilterStat, error) { - return nil, errors.New("NetFilterCounters not implemented for freebsd") + return nil, common.ErrNotImplementedError } func ConntrackStats(percpu bool) ([]ConntrackStat, error) { @@ -117,7 +116,7 @@ func ConntrackStats(percpu bool) ([]ConntrackStat, error) { } func ConntrackStatsWithContext(ctx context.Context, percpu bool) ([]ConntrackStat, error) { - return nil, errors.New("ConntrackStats not implemented for freebsd") + return nil, common.ErrNotImplementedError } // NetProtoCounters returns network statistics for the entire system @@ -129,5 +128,5 @@ func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { } func ProtoCountersWithContext(ctx context.Context, protocols []string) ([]ProtoCountersStat, error) { - return nil, errors.New("NetProtoCounters not implemented for freebsd") + return nil, common.ErrNotImplementedError } diff --git a/vendor/github.com/shirou/gopsutil/net/net_linux.go b/vendor/github.com/shirou/gopsutil/net/net_linux.go index f289a5dcc1..ed5d027b8a 100644 --- a/vendor/github.com/shirou/gopsutil/net/net_linux.go +++ b/vendor/github.com/shirou/gopsutil/net/net_linux.go @@ -696,7 +696,7 @@ func decodeAddress(family uint32, src string) (Addr, error) { return Addr{}, fmt.Errorf("does not contain port, %s", src) } addr := t[0] - port, err := strconv.ParseInt("0x"+t[1], 0, 64) + port, err := strconv.ParseUint(t[1], 16, 16) if err != nil { return Addr{}, fmt.Errorf("invalid port, %s", src) } diff --git a/vendor/github.com/shirou/gopsutil/net/net_openbsd.go b/vendor/github.com/shirou/gopsutil/net/net_openbsd.go index 3cf0a89d47..cfed2bee46 100644 --- a/vendor/github.com/shirou/gopsutil/net/net_openbsd.go +++ b/vendor/github.com/shirou/gopsutil/net/net_openbsd.go @@ -4,7 +4,6 @@ package net import ( "context" - "errors" "fmt" "os/exec" "regexp" @@ -153,7 +152,7 @@ func FilterCounters() ([]FilterStat, error) { } func FilterCountersWithContext(ctx context.Context) ([]FilterStat, error) { - return nil, errors.New("NetFilterCounters not implemented for openbsd") + return nil, common.ErrNotImplementedError } func ConntrackStats(percpu bool) ([]ConntrackStat, error) { @@ -173,7 +172,7 @@ func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { } func ProtoCountersWithContext(ctx context.Context, protocols []string) ([]ProtoCountersStat, error) { - return nil, errors.New("NetProtoCounters not implemented for openbsd") + return nil, common.ErrNotImplementedError } func parseNetstatLine(line string) (ConnectionStat, error) { diff --git a/vendor/github.com/shirou/gopsutil/net/net_unix.go b/vendor/github.com/shirou/gopsutil/net/net_unix.go index d6e4303fdb..abe25c4ed7 100644 --- a/vendor/github.com/shirou/gopsutil/net/net_unix.go +++ b/vendor/github.com/shirou/gopsutil/net/net_unix.go @@ -63,7 +63,7 @@ func ConnectionsPidWithContext(ctx context.Context, kind string, pid int32) ([]C case "udp": args = append(args, "udp") case "udp4": - args = append(args, "6udp") + args = append(args, "4udp") case "udp6": args = append(args, "6udp") case "unix": diff --git a/vendor/github.com/shirou/gopsutil/net/net_windows.go b/vendor/github.com/shirou/gopsutil/net/net_windows.go index 6ab45ab3a7..bdc9287982 100644 --- a/vendor/github.com/shirou/gopsutil/net/net_windows.go +++ b/vendor/github.com/shirou/gopsutil/net/net_windows.go @@ -4,7 +4,6 @@ package net import ( "context" - "errors" "fmt" "net" "os" @@ -323,7 +322,7 @@ func FilterCounters() ([]FilterStat, error) { } func FilterCountersWithContext(ctx context.Context) ([]FilterStat, error) { - return nil, errors.New("NetFilterCounters not implemented for windows") + return nil, common.ErrNotImplementedError } func ConntrackStats(percpu bool) ([]ConntrackStat, error) { @@ -344,7 +343,7 @@ func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { } func ProtoCountersWithContext(ctx context.Context, protocols []string) ([]ProtoCountersStat, error) { - return nil, errors.New("NetProtoCounters not implemented for windows") + return nil, common.ErrNotImplementedError } func getTableUintptr(family uint32, buf []byte) uintptr { @@ -548,7 +547,7 @@ func getUDPConnections(family uint32) ([]ConnectionStat, error) { mibs := (*mibUDPRowOwnerPid)(unsafe.Pointer(&buf[index])) ns := mibs.convertToConnectionStat() stats = append(stats, ns) - case kindUDP4.family: + case kindUDP6.family: mibs := (*mibUDP6RowOwnerPid)(unsafe.Pointer(&buf[index])) ns := mibs.convertToConnectionStat() stats = append(stats, ns) diff --git a/vendor/github.com/shirou/gopsutil/process/process.go b/vendor/github.com/shirou/gopsutil/process/process.go index 59441a0522..a667ddfe7c 100644 --- a/vendor/github.com/shirou/gopsutil/process/process.go +++ b/vendor/github.com/shirou/gopsutil/process/process.go @@ -6,11 +6,14 @@ import ( "errors" "runtime" "sort" + "sync" + "syscall" "time" "github.com/shirou/gopsutil/cpu" "github.com/shirou/gopsutil/internal/common" "github.com/shirou/gopsutil/mem" + "github.com/shirou/gopsutil/net" ) var ( @@ -24,9 +27,11 @@ type Process struct { name string status string parent int32 + parentMutex *sync.RWMutex // for windows ppid cache numCtxSwitches *NumCtxSwitchesStat uids []int32 gids []int32 + groups []int32 numThreads int32 memInfo *MemoryInfoStat sigInfo *SignalInfoStat @@ -149,21 +154,34 @@ func PidsWithContext(ctx context.Context) ([]int32, error) { return pids, err } +// Processes returns a slice of pointers to Process structs for all +// currently running processes. +func Processes() ([]*Process, error) { + return ProcessesWithContext(context.Background()) +} + // NewProcess creates a new Process instance, it only stores the pid and // checks that the process exists. Other method on Process can be used // to get more information about the process. An error will be returned // if the process does not exist. func NewProcess(pid int32) (*Process, error) { - p := &Process{Pid: pid} + return NewProcessWithContext(context.Background(), pid) +} - exists, err := PidExists(pid) +func NewProcessWithContext(ctx context.Context, pid int32) (*Process, error) { + p := &Process{ + Pid: pid, + parentMutex: new(sync.RWMutex), + } + + exists, err := PidExistsWithContext(ctx, pid) if err != nil { return p, err } if !exists { return p, ErrorProcessNotRunning } - p.CreateTime() + p.CreateTimeWithContext(ctx) return p, nil } @@ -191,7 +209,7 @@ func (p *Process) Percent(interval time.Duration) (float64, error) { } func (p *Process) PercentWithContext(ctx context.Context, interval time.Duration) (float64, error) { - cpuTimes, err := p.Times() + cpuTimes, err := p.TimesWithContext(ctx) if err != nil { return 0, err } @@ -200,8 +218,10 @@ func (p *Process) PercentWithContext(ctx context.Context, interval time.Duration if interval > 0 { p.lastCPUTimes = cpuTimes p.lastCPUTime = now - time.Sleep(interval) - cpuTimes, err = p.Times() + if err := common.Sleep(ctx, interval); err != nil { + return 0, err + } + cpuTimes, err = p.TimesWithContext(ctx) now = time.Now() if err != nil { return 0, err @@ -233,7 +253,7 @@ func (p *Process) IsRunningWithContext(ctx context.Context) (bool, error) { if err != nil { return false, err } - p2, err := NewProcess(p.Pid) + p2, err := NewProcessWithContext(ctx, p.Pid) if err == ErrorProcessNotRunning { return false, nil } @@ -273,13 +293,13 @@ func (p *Process) MemoryPercent() (float32, error) { } func (p *Process) MemoryPercentWithContext(ctx context.Context) (float32, error) { - machineMemory, err := mem.VirtualMemory() + machineMemory, err := mem.VirtualMemoryWithContext(ctx) if err != nil { return 0, err } total := machineMemory.Total - processMemory, err := p.MemoryInfo() + processMemory, err := p.MemoryInfoWithContext(ctx) if err != nil { return 0, err } @@ -294,12 +314,12 @@ func (p *Process) CPUPercent() (float64, error) { } func (p *Process) CPUPercentWithContext(ctx context.Context) (float64, error) { - crt_time, err := p.CreateTime() + crt_time, err := p.createTimeWithContext(ctx) if err != nil { return 0, err } - cput, err := p.Times() + cput, err := p.TimesWithContext(ctx) if err != nil { return 0, err } @@ -312,3 +332,214 @@ func (p *Process) CPUPercentWithContext(ctx context.Context) (float64, error) { return 100 * cput.Total() / totalTime, nil } + +// Groups returns all group IDs(include supplementary groups) of the process as a slice of the int +func (p *Process) Groups() ([]int32, error) { + return p.GroupsWithContext(context.Background()) +} + +// Ppid returns Parent Process ID of the process. +func (p *Process) Ppid() (int32, error) { + return p.PpidWithContext(context.Background()) +} + +// Name returns name of the process. +func (p *Process) Name() (string, error) { + return p.NameWithContext(context.Background()) +} + +// Exe returns executable path of the process. +func (p *Process) Exe() (string, error) { + return p.ExeWithContext(context.Background()) +} + +// Cmdline returns the command line arguments of the process as a string with +// each argument separated by 0x20 ascii character. +func (p *Process) Cmdline() (string, error) { + return p.CmdlineWithContext(context.Background()) +} + +// CmdlineSlice returns the command line arguments of the process as a slice with each +// element being an argument. +func (p *Process) CmdlineSlice() ([]string, error) { + return p.CmdlineSliceWithContext(context.Background()) +} + +// Cwd returns current working directory of the process. +func (p *Process) Cwd() (string, error) { + return p.CwdWithContext(context.Background()) +} + +// Parent returns parent Process of the process. +func (p *Process) Parent() (*Process, error) { + return p.ParentWithContext(context.Background()) +} + +// Status returns the process status. +// Return value could be one of these. +// R: Running S: Sleep T: Stop I: Idle +// Z: Zombie W: Wait L: Lock +// The character is same within all supported platforms. +func (p *Process) Status() (string, error) { + return p.StatusWithContext(context.Background()) +} + +// Foreground returns true if the process is in foreground, false otherwise. +func (p *Process) Foreground() (bool, error) { + return p.ForegroundWithContext(context.Background()) +} + +// Uids returns user ids of the process as a slice of the int +func (p *Process) Uids() ([]int32, error) { + return p.UidsWithContext(context.Background()) +} + +// Gids returns group ids of the process as a slice of the int +func (p *Process) Gids() ([]int32, error) { + return p.GidsWithContext(context.Background()) +} + +// Terminal returns a terminal which is associated with the process. +func (p *Process) Terminal() (string, error) { + return p.TerminalWithContext(context.Background()) +} + +// Nice returns a nice value (priority). +func (p *Process) Nice() (int32, error) { + return p.NiceWithContext(context.Background()) +} + +// IOnice returns process I/O nice value (priority). +func (p *Process) IOnice() (int32, error) { + return p.IOniceWithContext(context.Background()) +} + +// Rlimit returns Resource Limits. +func (p *Process) Rlimit() ([]RlimitStat, error) { + return p.RlimitWithContext(context.Background()) +} + +// RlimitUsage returns Resource Limits. +// If gatherUsed is true, the currently used value will be gathered and added +// to the resulting RlimitStat. +func (p *Process) RlimitUsage(gatherUsed bool) ([]RlimitStat, error) { + return p.RlimitUsageWithContext(context.Background(), gatherUsed) +} + +// IOCounters returns IO Counters. +func (p *Process) IOCounters() (*IOCountersStat, error) { + return p.IOCountersWithContext(context.Background()) +} + +// NumCtxSwitches returns the number of the context switches of the process. +func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { + return p.NumCtxSwitchesWithContext(context.Background()) +} + +// NumFDs returns the number of File Descriptors used by the process. +func (p *Process) NumFDs() (int32, error) { + return p.NumFDsWithContext(context.Background()) +} + +// NumThreads returns the number of threads used by the process. +func (p *Process) NumThreads() (int32, error) { + return p.NumThreadsWithContext(context.Background()) +} + +func (p *Process) Threads() (map[int32]*cpu.TimesStat, error) { + return p.ThreadsWithContext(context.Background()) +} + +// Times returns CPU times of the process. +func (p *Process) Times() (*cpu.TimesStat, error) { + return p.TimesWithContext(context.Background()) +} + +// CPUAffinity returns CPU affinity of the process. +func (p *Process) CPUAffinity() ([]int32, error) { + return p.CPUAffinityWithContext(context.Background()) +} + +// MemoryInfo returns generic process memory information, +// such as RSS and VMS. +func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { + return p.MemoryInfoWithContext(context.Background()) +} + +// MemoryInfoEx returns platform-specific process memory information. +func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { + return p.MemoryInfoExWithContext(context.Background()) +} + +// PageFaultsInfo returns the process's page fault counters. +func (p *Process) PageFaults() (*PageFaultsStat, error) { + return p.PageFaultsWithContext(context.Background()) +} + +// Children returns the children of the process represented as a slice +// of pointers to Process type. +func (p *Process) Children() ([]*Process, error) { + return p.ChildrenWithContext(context.Background()) +} + +// OpenFiles returns a slice of OpenFilesStat opend by the process. +// OpenFilesStat includes a file path and file descriptor. +func (p *Process) OpenFiles() ([]OpenFilesStat, error) { + return p.OpenFilesWithContext(context.Background()) +} + +// Connections returns a slice of net.ConnectionStat used by the process. +// This returns all kind of the connection. This means TCP, UDP or UNIX. +func (p *Process) Connections() ([]net.ConnectionStat, error) { + return p.ConnectionsWithContext(context.Background()) +} + +// Connections returns a slice of net.ConnectionStat used by the process at most `max`. +func (p *Process) ConnectionsMax(max int) ([]net.ConnectionStat, error) { + return p.ConnectionsMaxWithContext(context.Background(), max) +} + +// NetIOCounters returns NetIOCounters of the process. +func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { + return p.NetIOCountersWithContext(context.Background(), pernic) +} + +// MemoryMaps get memory maps from /proc/(pid)/smaps +func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { + return p.MemoryMapsWithContext(context.Background(), grouped) +} + +// Tgid returns thread group id of the process. +func (p *Process) Tgid() (int32, error) { + return p.TgidWithContext(context.Background()) +} + +// SendSignal sends a unix.Signal to the process. +func (p *Process) SendSignal(sig syscall.Signal) error { + return p.SendSignalWithContext(context.Background(), sig) +} + +// Suspend sends SIGSTOP to the process. +func (p *Process) Suspend() error { + return p.SuspendWithContext(context.Background()) +} + +// Resume sends SIGCONT to the process. +func (p *Process) Resume() error { + return p.ResumeWithContext(context.Background()) +} + +// Terminate sends SIGTERM to the process. +func (p *Process) Terminate() error { + return p.TerminateWithContext(context.Background()) +} + +// Kill sends SIGKILL to the process. +func (p *Process) Kill() error { + return p.KillWithContext(context.Background()) +} + +// Username returns a username of the process. +func (p *Process) Username() (string, error) { + return p.UsernameWithContext(context.Background()) +} diff --git a/vendor/github.com/shirou/gopsutil/process/process_bsd.go b/vendor/github.com/shirou/gopsutil/process/process_bsd.go new file mode 100644 index 0000000000..ffb748164d --- /dev/null +++ b/vendor/github.com/shirou/gopsutil/process/process_bsd.go @@ -0,0 +1,80 @@ +// +build darwin freebsd openbsd + +package process + +import ( + "bytes" + "context" + "encoding/binary" + + "github.com/shirou/gopsutil/cpu" + "github.com/shirou/gopsutil/internal/common" + "github.com/shirou/gopsutil/net" +) + +type MemoryInfoExStat struct{} + +type MemoryMapsStat struct{} + +func (p *Process) TgidWithContext(ctx context.Context) (int32, error) { + return 0, common.ErrNotImplementedError +} + +func (p *Process) CwdWithContext(ctx context.Context) (string, error) { + return "", common.ErrNotImplementedError +} + +func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) { + return 0, common.ErrNotImplementedError +} + +func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) { + return 0, common.ErrNotImplementedError +} + +func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) { + return nil, common.ErrNotImplementedError +} + +func parseKinfoProc(buf []byte) (KinfoProc, error) { + var k KinfoProc + br := bytes.NewReader(buf) + err := common.Read(br, binary.LittleEndian, &k) + return k, err +} diff --git a/vendor/github.com/shirou/gopsutil/process/process_darwin.go b/vendor/github.com/shirou/gopsutil/process/process_darwin.go index 3eb53e686b..dc75526ccc 100644 --- a/vendor/github.com/shirou/gopsutil/process/process_darwin.go +++ b/vendor/github.com/shirou/gopsutil/process/process_darwin.go @@ -3,16 +3,13 @@ package process import ( - "bytes" "context" - "encoding/binary" "fmt" "os/exec" "path/filepath" "strconv" "strings" "time" - "unsafe" "github.com/shirou/gopsutil/cpu" "github.com/shirou/gopsutil/internal/common" @@ -38,17 +35,10 @@ type _Ctype_struct___0 struct { Pad uint64 } -// MemoryInfoExStat is different between OSes -type MemoryInfoExStat struct { -} - -type MemoryMapsStat struct { -} - func pidsWithContext(ctx context.Context) ([]int32, error) { var ret []int32 - pids, err := callPsWithContext(ctx, "pid", 0, false) + pids, err := callPsWithContext(ctx, "pid", 0, false, false) if err != nil { return ret, err } @@ -64,12 +54,8 @@ func pidsWithContext(ctx context.Context) ([]int32, error) { return ret, nil } -func (p *Process) Ppid() (int32, error) { - return p.PpidWithContext(context.Background()) -} - func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { - r, err := callPsWithContext(ctx, "ppid", p.Pid, false) + r, err := callPsWithContext(ctx, "ppid", p.Pid, false, false) if err != nil { return 0, err } @@ -81,9 +67,6 @@ func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { return int32(v), err } -func (p *Process) Name() (string, error) { - return p.NameWithContext(context.Background()) -} func (p *Process) NameWithContext(ctx context.Context) (string, error) { k, err := p.getKProc() @@ -93,54 +76,47 @@ func (p *Process) NameWithContext(ctx context.Context) (string, error) { name := common.IntToString(k.Proc.P_comm[:]) if len(name) >= 15 { - cmdlineSlice, err := p.CmdlineSliceWithContext(ctx) + cmdName, err := p.cmdNameWithContext(ctx) if err != nil { return "", err } - if len(cmdlineSlice) > 0 { - extendedName := filepath.Base(cmdlineSlice[0]) + if len(cmdName) > 0 { + extendedName := filepath.Base(cmdName[0]) if strings.HasPrefix(extendedName, p.name) { name = extendedName } else { - name = cmdlineSlice[0] + name = cmdName[0] } } } return name, nil } -func (p *Process) Tgid() (int32, error) { - return 0, common.ErrNotImplementedError -} -func (p *Process) Exe() (string, error) { - return p.ExeWithContext(context.Background()) -} - -// Cmdline returns the command line arguments of the process as a string with -// each argument separated by 0x20 ascii character. -func (p *Process) Cmdline() (string, error) { - return p.CmdlineWithContext(context.Background()) -} func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) { - r, err := callPsWithContext(ctx, "command", p.Pid, false) + r, err := callPsWithContext(ctx, "command", p.Pid, false, false) if err != nil { return "", err } return strings.Join(r[0], " "), err } -// CmdlineSlice returns the command line arguments of the process as a slice with each +// cmdNameWithContext returns the command name (including spaces) without any arguments +func (p *Process) cmdNameWithContext(ctx context.Context) ([]string, error) { + r, err := callPsWithContext(ctx, "command", p.Pid, false, true) + if err != nil { + return nil, err + } + return r[0], err +} + +// CmdlineSliceWithContext returns the command line arguments of the process as a slice with each // element being an argument. Because of current deficiencies in the way that the command // line arguments are found, single arguments that have spaces in the will actually be // reported as two separate items. In order to do something better CGO would be needed // to use the native darwin functions. -func (p *Process) CmdlineSlice() ([]string, error) { - return p.CmdlineSliceWithContext(context.Background()) -} - func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) { - r, err := callPsWithContext(ctx, "command", p.Pid, false) + r, err := callPsWithContext(ctx, "command", p.Pid, false, false) if err != nil { return nil, err } @@ -148,7 +124,7 @@ func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) } func (p *Process) createTimeWithContext(ctx context.Context) (int64, error) { - r, err := callPsWithContext(ctx, "etime", p.Pid, false) + r, err := callPsWithContext(ctx, "etime", p.Pid, false, false) if err != nil { return 0, err } @@ -177,41 +153,26 @@ func (p *Process) createTimeWithContext(ctx context.Context) (int64, error) { start := time.Now().Add(-elapsed) return start.Unix() * 1000, nil } -func (p *Process) Cwd() (string, error) { - return p.CwdWithContext(context.Background()) -} - -func (p *Process) CwdWithContext(ctx context.Context) (string, error) { - return "", common.ErrNotImplementedError -} -func (p *Process) Parent() (*Process, error) { - return p.ParentWithContext(context.Background()) -} func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { - rr, err := common.CallLsofWithContext(ctx, invoke, p.Pid, "-FR") + out, err := common.CallLsofWithContext(ctx, invoke, p.Pid, "-FR") if err != nil { return nil, err } - for _, r := range rr { - if strings.HasPrefix(r, "p") { // skip if process - continue - } - l := string(r) - v, err := strconv.Atoi(strings.Replace(l, "R", "", 1)) - if err != nil { - return nil, err + for _, line := range out { + if len(line) >= 1 && line[0] == 'R' { + v, err := strconv.Atoi(line[1:]) + if err != nil { + return nil, err + } + return NewProcessWithContext(ctx, int32(v)) } - return NewProcess(int32(v)) } return nil, fmt.Errorf("could not find parent line") } -func (p *Process) Status() (string, error) { - return p.StatusWithContext(context.Background()) -} func (p *Process) StatusWithContext(ctx context.Context) (string, error) { - r, err := callPsWithContext(ctx, "state", p.Pid, false) + r, err := callPsWithContext(ctx, "state", p.Pid, false, false) if err != nil { return "", err } @@ -219,10 +180,6 @@ func (p *Process) StatusWithContext(ctx context.Context) (string, error) { return r[0][0][0:1], err } -func (p *Process) Foreground() (bool, error) { - return p.ForegroundWithContext(context.Background()) -} - func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { // see https://github.com/shirou/gopsutil/issues/596#issuecomment-432707831 for implementation details pid := p.Pid @@ -237,10 +194,6 @@ func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { return strings.IndexByte(string(out), '+') != -1, nil } -func (p *Process) Uids() ([]int32, error) { - return p.UidsWithContext(context.Background()) -} - func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { k, err := p.getKProc() if err != nil { @@ -252,9 +205,6 @@ func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { return []int32{userEffectiveUID}, nil } -func (p *Process) Gids() ([]int32, error) { - return p.GidsWithContext(context.Background()) -} func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { k, err := p.getKProc() @@ -267,8 +217,20 @@ func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { return gids, nil } -func (p *Process) Terminal() (string, error) { - return p.TerminalWithContext(context.Background()) + +func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { + return nil, common.ErrNotImplementedError + // k, err := p.getKProc() + // if err != nil { + // return nil, err + // } + + // groups := make([]int32, k.Eproc.Ucred.Ngroups) + // for i := int16(0); i < k.Eproc.Ucred.Ngroups; i++ { + // groups[i] = int32(k.Eproc.Ucred.Groups[i]) + // } + + // return groups, nil } func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { @@ -288,9 +250,6 @@ func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { return termmap[ttyNr], nil */ } -func (p *Process) Nice() (int32, error) { - return p.NiceWithContext(context.Background()) -} func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { k, err := p.getKProc() @@ -299,69 +258,18 @@ func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { } return int32(k.Proc.P_nice), nil } -func (p *Process) IOnice() (int32, error) { - return p.IOniceWithContext(context.Background()) -} - -func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) { - return 0, common.ErrNotImplementedError -} -func (p *Process) Rlimit() ([]RlimitStat, error) { - return p.RlimitWithContext(context.Background()) -} - -func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) { - var rlimit []RlimitStat - return rlimit, common.ErrNotImplementedError -} -func (p *Process) RlimitUsage(gatherUsed bool) ([]RlimitStat, error) { - return p.RlimitUsageWithContext(context.Background(), gatherUsed) -} - -func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) { - var rlimit []RlimitStat - return rlimit, common.ErrNotImplementedError -} -func (p *Process) IOCounters() (*IOCountersStat, error) { - return p.IOCountersWithContext(context.Background()) -} func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { - return p.NumCtxSwitchesWithContext(context.Background()) -} - -func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) { - return nil, common.ErrNotImplementedError -} -func (p *Process) NumFDs() (int32, error) { - return p.NumFDsWithContext(context.Background()) -} - -func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) { - return 0, common.ErrNotImplementedError -} -func (p *Process) NumThreads() (int32, error) { - return p.NumThreadsWithContext(context.Background()) -} func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { - r, err := callPsWithContext(ctx, "utime,stime", p.Pid, true) + r, err := callPsWithContext(ctx, "utime,stime", p.Pid, true, false) if err != nil { return 0, err } return int32(len(r)), nil } -func (p *Process) Threads() (map[int32]*cpu.TimesStat, error) { - return p.ThreadsWithContext(context.Background()) -} - -func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) { - ret := make(map[int32]*cpu.TimesStat) - return ret, common.ErrNotImplementedError -} func convertCPUTimes(s string) (ret float64, err error) { var t int @@ -408,12 +316,9 @@ func convertCPUTimes(s string) (ret float64, err error) { t += h return float64(t) / ClockTicks, nil } -func (p *Process) Times() (*cpu.TimesStat, error) { - return p.TimesWithContext(context.Background()) -} func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) { - r, err := callPsWithContext(ctx, "utime,stime", p.Pid, false) + r, err := callPsWithContext(ctx, "utime,stime", p.Pid, false, false) if err != nil { return nil, err @@ -435,19 +340,9 @@ func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) } return ret, nil } -func (p *Process) CPUAffinity() ([]int32, error) { - return p.CPUAffinityWithContext(context.Background()) -} - -func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) { - return nil, common.ErrNotImplementedError -} -func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { - return p.MemoryInfoWithContext(context.Background()) -} func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, error) { - r, err := callPsWithContext(ctx, "rss,vsize,pagein", p.Pid, false) + r, err := callPsWithContext(ctx, "rss,vsize,pagein", p.Pid, false, false) if err != nil { return nil, err } @@ -472,25 +367,6 @@ func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, e return ret, nil } -func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { - return p.MemoryInfoExWithContext(context.Background()) -} - -func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) PageFaults() (*PageFaultsStat, error) { - return p.PageFaultsWithContext(context.Background()) -} - -func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) Children() ([]*Process, error) { - return p.ChildrenWithContext(context.Background()) -} func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { pids, err := common.CallPgrepWithContext(ctx, invoke, p.Pid) @@ -499,7 +375,7 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { } ret := make([]*Process, 0, len(pids)) for _, pid := range pids { - np, err := NewProcess(pid) + np, err := NewProcessWithContext(ctx, pid) if err != nil { return nil, err } @@ -508,50 +384,12 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { return ret, nil } -func (p *Process) OpenFiles() ([]OpenFilesStat, error) { - return p.OpenFilesWithContext(context.Background()) -} - -func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) Connections() ([]net.ConnectionStat, error) { - return p.ConnectionsWithContext(context.Background()) -} - func (p *Process) ConnectionsWithContext(ctx context.Context) ([]net.ConnectionStat, error) { - return net.ConnectionsPid("all", p.Pid) -} - -// Connections returns a slice of net.ConnectionStat used by the process at most `max` -func (p *Process) ConnectionsMax(max int) ([]net.ConnectionStat, error) { - return p.ConnectionsMaxWithContext(context.Background(), max) + return net.ConnectionsPidWithContext(ctx, "all", p.Pid) } func (p *Process) ConnectionsMaxWithContext(ctx context.Context, max int) ([]net.ConnectionStat, error) { - return net.ConnectionsPidMax("all", p.Pid, max) -} - -func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { - return p.NetIOCountersWithContext(context.Background(), pernic) -} - -func (p *Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { - return p.MemoryMapsWithContext(context.Background(), grouped) -} - -func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) { - var ret []MemoryMapsStat - return &ret, common.ErrNotImplementedError -} - -func Processes() ([]*Process, error) { - return ProcessesWithContext(context.Background()) + return net.ConnectionsPidMaxWithContext(ctx, "all", p.Pid, max) } func ProcessesWithContext(ctx context.Context) ([]*Process, error) { @@ -563,7 +401,7 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { } for _, pid := range pids { - p, err := NewProcess(pid) + p, err := NewProcessWithContext(ctx, pid) if err != nil { continue } @@ -573,39 +411,12 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { return out, nil } -func parseKinfoProc(buf []byte) (KinfoProc, error) { - var k KinfoProc - br := bytes.NewReader(buf) - - err := common.Read(br, binary.LittleEndian, &k) - if err != nil { - return k, err - } - - return k, nil -} - // Returns a proc as defined here: // http://unix.superglobalmegacorp.com/Net2/newsrc/sys/kinfo_proc.h.html func (p *Process) getKProc() (*KinfoProc, error) { - return p.getKProcWithContext(context.Background()) -} - -func (p *Process) getKProcWithContext(ctx context.Context) (*KinfoProc, error) { - mib := []int32{CTLKern, KernProc, KernProcPID, p.Pid} - procK := KinfoProc{} - length := uint64(unsafe.Sizeof(procK)) - buf := make([]byte, length) - _, _, syserr := unix.Syscall6( - unix.SYS___SYSCTL, - uintptr(unsafe.Pointer(&mib[0])), - uintptr(len(mib)), - uintptr(unsafe.Pointer(&buf[0])), - uintptr(unsafe.Pointer(&length)), - 0, - 0) - if syserr != 0 { - return nil, syserr + buf, err := unix.SysctlRaw("kern.proc.pid", int(p.Pid)) + if err != nil { + return nil, err } k, err := parseKinfoProc(buf) if err != nil { @@ -617,9 +428,9 @@ func (p *Process) getKProcWithContext(ctx context.Context) (*KinfoProc, error) { // call ps command. // Return value deletes Header line(you must not input wrong arg). -// And splited by Space. Caller have responsibility to manage. +// And split by space. Caller have responsibility to manage. // If passed arg pid is 0, get information from all process. -func callPsWithContext(ctx context.Context, arg string, pid int32, threadOption bool) ([][]string, error) { +func callPsWithContext(ctx context.Context, arg string, pid int32, threadOption bool, nameOption bool) ([][]string, error) { bin, err := exec.LookPath("ps") if err != nil { return [][]string{}, err @@ -633,6 +444,10 @@ func callPsWithContext(ctx context.Context, arg string, pid int32, threadOption } else { cmd = []string{"-x", "-o", arg, "-p", strconv.Itoa(int(pid))} } + + if nameOption { + cmd = append(cmd, "-c") + } out, err := invoke.CommandWithContext(ctx, bin, cmd...) if err != nil { return [][]string{}, err @@ -641,13 +456,19 @@ func callPsWithContext(ctx context.Context, arg string, pid int32, threadOption var ret [][]string for _, l := range lines[1:] { + var lr []string - for _, r := range strings.Split(l, " ") { - if r == "" { - continue + if nameOption { + lr = append(lr, l) + } else { + for _, r := range strings.Split(l, " ") { + if r == "" { + continue + } + lr = append(lr, strings.TrimSpace(r)) } - lr = append(lr, strings.TrimSpace(r)) } + if len(lr) != 0 { ret = append(ret, lr) } diff --git a/vendor/github.com/shirou/gopsutil/process/process_darwin_arm64.go b/vendor/github.com/shirou/gopsutil/process/process_darwin_arm64.go new file mode 100644 index 0000000000..c0063e4e1e --- /dev/null +++ b/vendor/github.com/shirou/gopsutil/process/process_darwin_arm64.go @@ -0,0 +1,205 @@ +// +build darwin +// +build arm64 +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs process/types_darwin.go + +package process + +const ( + sizeofPtr = 0x8 + sizeofShort = 0x2 + sizeofInt = 0x4 + sizeofLong = 0x8 + sizeofLongLong = 0x8 +) + +type ( + _C_short int16 + _C_int int32 + _C_long int64 + _C_long_long int64 +) + +type Timespec struct { + Sec int64 + Nsec int64 +} + +type Timeval struct { + Sec int64 + Usec int32 + Pad_cgo_0 [4]byte +} + +type Rusage struct { + Utime Timeval + Stime Timeval + Maxrss int64 + Ixrss int64 + Idrss int64 + Isrss int64 + Minflt int64 + Majflt int64 + Nswap int64 + Inblock int64 + Oublock int64 + Msgsnd int64 + Msgrcv int64 + Nsignals int64 + Nvcsw int64 + Nivcsw int64 +} + +type Rlimit struct { + Cur uint64 + Max uint64 +} + +type UGid_t uint32 + +type KinfoProc struct { + Proc ExternProc + Eproc Eproc +} + +type Eproc struct { + Paddr *Proc + Sess *Session + Pcred Upcred + Ucred Uucred + Vm Vmspace + Ppid int32 + Pgid int32 + Jobc int16 + Tdev int32 + Tpgid int32 + Tsess *Session + Wmesg [8]int8 + Xsize int32 + Xrssize int16 + Xccount int16 + Xswrss int16 + Flag int32 + Login [12]int8 + Spare [4]int32 + Pad_cgo_0 [4]byte +} + +type Proc struct{} + +type Session struct{} + +type ucred struct{} + +type Uucred struct { + Ref int32 + UID uint32 + Ngroups int16 + Groups [16]uint32 +} + +type Upcred struct { + Pc_lock [72]int8 + Pc_ucred *ucred + P_ruid uint32 + P_svuid uint32 + P_rgid uint32 + P_svgid uint32 + P_refcnt int32 + Pad_cgo_0 [4]byte +} + +type Vmspace struct { + Dummy int32 + Dummy2 *int8 + Dummy3 [5]int32 + Dummy4 [3]*int8 +} + +type Sigacts struct{} + +type ExternProc struct { + P_un [16]byte + P_vmspace *Vmspace + P_sigacts *Sigacts + P_flag int32 + P_stat int8 + P_pid int32 + P_oppid int32 + P_dupfd int32 + User_stack *int8 + Exit_thread *byte + P_debugger int32 + Sigwait int32 + P_estcpu uint32 + P_cpticks int32 + P_pctcpu uint32 + P_wchan *byte + P_wmesg *int8 + P_swtime uint32 + P_slptime uint32 + P_realtimer Itimerval + P_rtime Timeval + P_uticks uint64 + P_sticks uint64 + P_iticks uint64 + P_traceflag int32 + P_tracep *Vnode + P_siglist int32 + P_textvp *Vnode + P_holdcnt int32 + P_sigmask uint32 + P_sigignore uint32 + P_sigcatch uint32 + P_priority uint8 + P_usrpri uint8 + P_nice int8 + P_comm [17]int8 + P_pgrp *Pgrp + P_addr *UserStruct + P_xstat uint16 + P_acflag uint16 + P_ru *Rusage +} + +type Itimerval struct { + Interval Timeval + Value Timeval +} + +type Vnode struct{} + +type Pgrp struct{} + +type UserStruct struct{} + +type Au_session struct { + Aia_p *AuditinfoAddr + Mask AuMask +} + +type Posix_cred struct{} + +type Label struct{} + +type AuditinfoAddr struct { + Auid uint32 + Mask AuMask + Termid AuTidAddr + Asid int32 + Flags uint64 +} +type AuMask struct { + Success uint32 + Failure uint32 +} +type AuTidAddr struct { + Port int32 + Type uint32 + Addr [4]uint32 +} + +type UcredQueue struct { + Next *ucred + Prev **ucred +} diff --git a/vendor/github.com/shirou/gopsutil/process/process_fallback.go b/vendor/github.com/shirou/gopsutil/process/process_fallback.go index 1cb55c8b04..14865efc25 100644 --- a/vendor/github.com/shirou/gopsutil/process/process_fallback.go +++ b/vendor/github.com/shirou/gopsutil/process/process_fallback.go @@ -29,10 +29,6 @@ type MemoryInfoExStat struct { } func pidsWithContext(ctx context.Context) ([]int32, error) { - return []int32{}, common.ErrNotImplementedError -} - -func Processes() ([]*Process, error) { return nil, common.ErrNotImplementedError } @@ -41,291 +37,168 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { } func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) { - pids, err := PidsWithContext(ctx) - if err != nil { - return false, err - } - - for _, i := range pids { - if i == pid { - return true, err - } - } - - return false, err -} - -func (p *Process) Ppid() (int32, error) { - return p.PpidWithContext(context.Background()) + return false, common.ErrNotImplementedError } func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } -func (p *Process) Name() (string, error) { - return p.NameWithContext(context.Background()) -} func (p *Process) NameWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } -func (p *Process) Tgid() (int32, error) { + +func (p *Process) TgidWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } -func (p *Process) Exe() (string, error) { - return p.ExeWithContext(context.Background()) -} func (p *Process) ExeWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } -func (p *Process) Cmdline() (string, error) { - return p.CmdlineWithContext(context.Background()) -} func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } -func (p *Process) CmdlineSlice() ([]string, error) { - return p.CmdlineSliceWithContext(context.Background()) -} func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) { - return []string{}, common.ErrNotImplementedError + return nil, common.ErrNotImplementedError } func (p *Process) createTimeWithContext(ctx context.Context) (int64, error) { return 0, common.ErrNotImplementedError } -func (p *Process) Cwd() (string, error) { - return p.CwdWithContext(context.Background()) -} func (p *Process) CwdWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } -func (p *Process) Parent() (*Process, error) { - return p.ParentWithContext(context.Background()) -} func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { return nil, common.ErrNotImplementedError } -func (p *Process) Status() (string, error) { - return p.StatusWithContext(context.Background()) -} func (p *Process) StatusWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } -func (p *Process) Foreground() (bool, error) { - return p.ForegroundWithContext(context.Background()) -} func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { return false, common.ErrNotImplementedError } -func (p *Process) Uids() ([]int32, error) { - return p.UidsWithContext(context.Background()) -} func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { - return []int32{}, common.ErrNotImplementedError -} -func (p *Process) Gids() ([]int32, error) { - return p.GidsWithContext(context.Background()) + return nil, common.ErrNotImplementedError } func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { - return []int32{}, common.ErrNotImplementedError + return nil, common.ErrNotImplementedError } -func (p *Process) Terminal() (string, error) { - return p.TerminalWithContext(context.Background()) + +func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { + return nil, common.ErrNotImplementedError } func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } -func (p *Process) Nice() (int32, error) { - return p.NiceWithContext(context.Background()) -} func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } -func (p *Process) IOnice() (int32, error) { - return p.IOniceWithContext(context.Background()) -} func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } -func (p *Process) Rlimit() ([]RlimitStat, error) { - return p.RlimitWithContext(context.Background()) -} func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) RlimitUsage(gatherUsed bool) ([]RlimitStat, error) { - return p.RlimitUsageWithContext(context.Background(), gatherUsed) -} func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) IOCounters() (*IOCountersStat, error) { - return p.IOCountersWithContext(context.Background()) -} func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { - return p.NumCtxSwitchesWithContext(context.Background()) -} func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) NumFDs() (int32, error) { - return p.NumFDsWithContext(context.Background()) -} func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } -func (p *Process) NumThreads() (int32, error) { - return p.NumThreadsWithContext(context.Background()) -} func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } -func (p *Process) Threads() (map[int32]*cpu.TimesStat, error) { - return p.ThreadsWithContext(context.Background()) -} func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) Times() (*cpu.TimesStat, error) { - return p.TimesWithContext(context.Background()) -} func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) CPUAffinity() ([]int32, error) { - return p.CPUAffinityWithContext(context.Background()) -} func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) { return nil, common.ErrNotImplementedError } -func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { - return p.MemoryInfoWithContext(context.Background()) -} func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { - return p.MemoryInfoExWithContext(context.Background()) -} func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) PageFaults() (*PageFaultsStat, error) { - return p.PageFaultsWithContext(context.Background()) -} + func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) Children() ([]*Process, error) { - return p.ChildrenWithContext(context.Background()) -} func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { return nil, common.ErrNotImplementedError } -func (p *Process) OpenFiles() ([]OpenFilesStat, error) { - return p.OpenFilesWithContext(context.Background()) -} func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) { - return []OpenFilesStat{}, common.ErrNotImplementedError -} -func (p *Process) Connections() ([]net.ConnectionStat, error) { - return p.ConnectionsWithContext(context.Background()) + return nil, common.ErrNotImplementedError } func (p *Process) ConnectionsWithContext(ctx context.Context) ([]net.ConnectionStat, error) { - return []net.ConnectionStat{}, common.ErrNotImplementedError -} - -func (p *Process) ConnectionsMax(max int) ([]net.ConnectionStat, error) { - return p.ConnectionsMaxWithContext(context.Background(), max) + return nil, common.ErrNotImplementedError } func (p *Process) ConnectionsMaxWithContext(ctx context.Context, max int) ([]net.ConnectionStat, error) { - return []net.ConnectionStat{}, common.ErrNotImplementedError -} - -func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { - return p.NetIOCountersWithContext(context.Background(), pernic) + return nil, common.ErrNotImplementedError } func (p *Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) { - return []net.IOCountersStat{}, common.ErrNotImplementedError -} - -func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { - return p.MemoryMapsWithContext(context.Background(), grouped) + return nil, common.ErrNotImplementedError } func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) SendSignal(sig syscall.Signal) error { - return p.SendSignalWithContext(context.Background(), sig) -} func (p *Process) SendSignalWithContext(ctx context.Context, sig syscall.Signal) error { return common.ErrNotImplementedError } -func (p *Process) Suspend() error { - return p.SuspendWithContext(context.Background()) -} func (p *Process) SuspendWithContext(ctx context.Context) error { return common.ErrNotImplementedError } -func (p *Process) Resume() error { - return p.ResumeWithContext(context.Background()) -} func (p *Process) ResumeWithContext(ctx context.Context) error { return common.ErrNotImplementedError } -func (p *Process) Terminate() error { - return p.TerminateWithContext(context.Background()) -} func (p *Process) TerminateWithContext(ctx context.Context) error { return common.ErrNotImplementedError } -func (p *Process) Kill() error { - return p.KillWithContext(context.Background()) -} func (p *Process) KillWithContext(ctx context.Context) error { return common.ErrNotImplementedError } -func (p *Process) Username() (string, error) { - return p.UsernameWithContext(context.Background()) -} func (p *Process) UsernameWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError diff --git a/vendor/github.com/shirou/gopsutil/process/process_freebsd.go b/vendor/github.com/shirou/gopsutil/process/process_freebsd.go index 0cf1699dd5..0666e7f429 100644 --- a/vendor/github.com/shirou/gopsutil/process/process_freebsd.go +++ b/vendor/github.com/shirou/gopsutil/process/process_freebsd.go @@ -5,7 +5,6 @@ package process import ( "bytes" "context" - "encoding/binary" "os/exec" "path/filepath" "strconv" @@ -17,16 +16,9 @@ import ( "golang.org/x/sys/unix" ) -// MemoryInfoExStat is different between OSes -type MemoryInfoExStat struct { -} - -type MemoryMapsStat struct { -} - func pidsWithContext(ctx context.Context) ([]int32, error) { var ret []int32 - procs, err := Processes() + procs, err := ProcessesWithContext(ctx) if err != nil { return ret, nil } @@ -38,10 +30,6 @@ func pidsWithContext(ctx context.Context) ([]int32, error) { return ret, nil } -func (p *Process) Ppid() (int32, error) { - return p.PpidWithContext(context.Background()) -} - func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { k, err := p.getKProc() if err != nil { @@ -50,9 +38,6 @@ func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { return k.Ppid, nil } -func (p *Process) Name() (string, error) { - return p.NameWithContext(context.Background()) -} func (p *Process) NameWithContext(ctx context.Context) (string, error) { k, err := p.getKProc() @@ -78,21 +63,11 @@ func (p *Process) NameWithContext(ctx context.Context) (string, error) { return name, nil } -func (p *Process) Tgid() (int32, error) { - return 0, common.ErrNotImplementedError -} -func (p *Process) Exe() (string, error) { - return p.ExeWithContext(context.Background()) -} func (p *Process) ExeWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } -func (p *Process) Cmdline() (string, error) { - return p.CmdlineWithContext(context.Background()) -} - func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) { mib := []int32{CTLKern, KernProc, KernProcArgs, p.Pid} buf, _, err := common.CallSyscall(mib) @@ -109,10 +84,6 @@ func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) { return strings.Join(ret, " "), nil } -func (p *Process) CmdlineSlice() ([]string, error) { - return p.CmdlineSliceWithContext(context.Background()) -} - func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) { mib := []int32{CTLKern, KernProc, KernProcArgs, p.Pid} buf, _, err := common.CallSyscall(mib) @@ -137,22 +108,9 @@ func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) func (p *Process) createTimeWithContext(ctx context.Context) (int64, error) { return 0, common.ErrNotImplementedError } -func (p *Process) Cwd() (string, error) { - return p.CwdWithContext(context.Background()) -} - -func (p *Process) CwdWithContext(ctx context.Context) (string, error) { - return "", common.ErrNotImplementedError -} -func (p *Process) Parent() (*Process, error) { - return p.ParentWithContext(context.Background()) -} func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { - return p, common.ErrNotImplementedError -} -func (p *Process) Status() (string, error) { - return p.StatusWithContext(context.Background()) + return nil, common.ErrNotImplementedError } func (p *Process) StatusWithContext(ctx context.Context) (string, error) { @@ -181,10 +139,6 @@ func (p *Process) StatusWithContext(ctx context.Context) (string, error) { return s, nil } -func (p *Process) Foreground() (bool, error) { - return p.ForegroundWithContext(context.Background()) -} - func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { // see https://github.com/shirou/gopsutil/issues/596#issuecomment-432707831 for implementation details pid := p.Pid @@ -199,10 +153,6 @@ func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { return strings.IndexByte(string(out), '+') != -1, nil } -func (p *Process) Uids() ([]int32, error) { - return p.UidsWithContext(context.Background()) -} - func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { k, err := p.getKProc() if err != nil { @@ -215,9 +165,6 @@ func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { return uids, nil } -func (p *Process) Gids() ([]int32, error) { - return p.GidsWithContext(context.Background()) -} func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { k, err := p.getKProc() @@ -230,8 +177,19 @@ func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { return gids, nil } -func (p *Process) Terminal() (string, error) { - return p.TerminalWithContext(context.Background()) + +func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { + k, err := p.getKProc() + if err != nil { + return nil, err + } + + groups := make([]int32, k.Ngroups) + for i := int16(0); i < k.Ngroups; i++ { + groups[i] = int32(k.Groups[i]) + } + + return groups, nil } func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { @@ -249,9 +207,6 @@ func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { return termmap[ttyNr], nil } -func (p *Process) Nice() (int32, error) { - return p.NiceWithContext(context.Background()) -} func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { k, err := p.getKProc() @@ -260,32 +215,6 @@ func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { } return int32(k.Nice), nil } -func (p *Process) IOnice() (int32, error) { - return p.IOniceWithContext(context.Background()) -} - -func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) { - return 0, common.ErrNotImplementedError -} -func (p *Process) Rlimit() ([]RlimitStat, error) { - return p.RlimitWithContext(context.Background()) -} - -func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) { - var rlimit []RlimitStat - return rlimit, common.ErrNotImplementedError -} -func (p *Process) RlimitUsage(gatherUsed bool) ([]RlimitStat, error) { - return p.RlimitUsageWithContext(context.Background(), gatherUsed) -} - -func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) { - var rlimit []RlimitStat - return rlimit, common.ErrNotImplementedError -} -func (p *Process) IOCounters() (*IOCountersStat, error) { - return p.IOCountersWithContext(context.Background()) -} func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, error) { k, err := p.getKProc() @@ -297,23 +226,6 @@ func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, e WriteCount: uint64(k.Rusage.Oublock), }, nil } -func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { - return p.NumCtxSwitchesWithContext(context.Background()) -} - -func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) { - return nil, common.ErrNotImplementedError -} -func (p *Process) NumFDs() (int32, error) { - return p.NumFDsWithContext(context.Background()) -} - -func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) { - return 0, common.ErrNotImplementedError -} -func (p *Process) NumThreads() (int32, error) { - return p.NumThreadsWithContext(context.Background()) -} func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { k, err := p.getKProc() @@ -323,17 +235,6 @@ func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { return k.Numthreads, nil } -func (p *Process) Threads() (map[int32]*cpu.TimesStat, error) { - return p.ThreadsWithContext(context.Background()) -} - -func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) { - ret := make(map[int32]*cpu.TimesStat) - return ret, common.ErrNotImplementedError -} -func (p *Process) Times() (*cpu.TimesStat, error) { - return p.TimesWithContext(context.Background()) -} func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) { k, err := p.getKProc() @@ -346,16 +247,6 @@ func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) System: float64(k.Rusage.Stime.Sec) + float64(k.Rusage.Stime.Usec)/1000000, }, nil } -func (p *Process) CPUAffinity() ([]int32, error) { - return p.CPUAffinityWithContext(context.Background()) -} - -func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) { - return nil, common.ErrNotImplementedError -} -func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { - return p.MemoryInfoWithContext(context.Background()) -} func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, error) { k, err := p.getKProc() @@ -373,25 +264,6 @@ func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, e VMS: uint64(k.Size), }, nil } -func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { - return p.MemoryInfoExWithContext(context.Background()) -} - -func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) PageFaults() (*PageFaultsStat, error) { - return p.PageFaultsWithContext(context.Background()) -} - -func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) Children() ([]*Process, error) { - return p.ChildrenWithContext(context.Background()) -} func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { pids, err := common.CallPgrepWithContext(ctx, invoke, p.Pid) @@ -400,7 +272,7 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { } ret := make([]*Process, 0, len(pids)) for _, pid := range pids { - np, err := NewProcess(pid) + np, err := NewProcessWithContext(ctx, pid) if err != nil { return nil, err } @@ -409,52 +281,14 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { return ret, nil } -func (p *Process) OpenFiles() ([]OpenFilesStat, error) { - return p.OpenFilesWithContext(context.Background()) -} - -func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) Connections() ([]net.ConnectionStat, error) { - return p.ConnectionsWithContext(context.Background()) -} - func (p *Process) ConnectionsWithContext(ctx context.Context) ([]net.ConnectionStat, error) { return nil, common.ErrNotImplementedError } -// Connections returns a slice of net.ConnectionStat used by the process at most `max` -func (p *Process) ConnectionsMax(max int) ([]net.ConnectionStat, error) { - return p.ConnectionsMaxWithContext(context.Background(), max) -} - func (p *Process) ConnectionsMaxWithContext(ctx context.Context, max int) ([]net.ConnectionStat, error) { - return []net.ConnectionStat{}, common.ErrNotImplementedError -} - -func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { - return p.NetIOCountersWithContext(context.Background(), pernic) -} - -func (p *Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { - return p.MemoryMapsWithContext(context.Background(), grouped) -} - -func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) { - var ret []MemoryMapsStat - return &ret, common.ErrNotImplementedError -} - -func Processes() ([]*Process, error) { - return ProcessesWithContext(context.Background()) -} - func ProcessesWithContext(ctx context.Context) ([]*Process, error) { results := []*Process{} @@ -474,7 +308,7 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { if err != nil { continue } - p, err := NewProcess(int32(k.Pid)) + p, err := NewProcessWithContext(ctx, int32(k.Pid)) if err != nil { continue } @@ -485,18 +319,7 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { return results, nil } -func parseKinfoProc(buf []byte) (KinfoProc, error) { - var k KinfoProc - br := bytes.NewReader(buf) - err := common.Read(br, binary.LittleEndian, &k) - return k, err -} - func (p *Process) getKProc() (*KinfoProc, error) { - return p.getKProcWithContext(context.Background()) -} - -func (p *Process) getKProcWithContext(ctx context.Context) (*KinfoProc, error) { mib := []int32{CTLKern, KernProc, KernProcPID, p.Pid} buf, length, err := common.CallSyscall(mib) diff --git a/vendor/github.com/shirou/gopsutil/process/process_linux.go b/vendor/github.com/shirou/gopsutil/process/process_linux.go index afd5e28e86..df460dd13a 100644 --- a/vendor/github.com/shirou/gopsutil/process/process_linux.go +++ b/vendor/github.com/shirou/gopsutil/process/process_linux.go @@ -64,11 +64,6 @@ func (m MemoryMapsStat) String() string { return string(s) } -// Ppid returns Parent Process ID of the process. -func (p *Process) Ppid() (int32, error) { - return p.PpidWithContext(context.Background()) -} - func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { _, ppid, _, _, _, _, _, err := p.fillFromStatWithContext(ctx) if err != nil { @@ -77,11 +72,6 @@ func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { return ppid, nil } -// Name returns name of the process. -func (p *Process) Name() (string, error) { - return p.NameWithContext(context.Background()) -} - func (p *Process) NameWithContext(ctx context.Context) (string, error) { if p.name == "" { if err := p.fillFromStatusWithContext(ctx); err != nil { @@ -91,41 +81,23 @@ func (p *Process) NameWithContext(ctx context.Context) (string, error) { return p.name, nil } -// Tgid returns tgid, a Linux-synonym for user-space Pid -func (p *Process) Tgid() (int32, error) { +func (p *Process) TgidWithContext(ctx context.Context) (int32, error) { if p.tgid == 0 { - if err := p.fillFromStatusWithContext(context.Background()); err != nil { + if err := p.fillFromStatusWithContext(ctx); err != nil { return 0, err } } return p.tgid, nil } -// Exe returns executable path of the process. -func (p *Process) Exe() (string, error) { - return p.ExeWithContext(context.Background()) -} - func (p *Process) ExeWithContext(ctx context.Context) (string, error) { return p.fillFromExeWithContext(ctx) } -// Cmdline returns the command line arguments of the process as a string with -// each argument separated by 0x20 ascii character. -func (p *Process) Cmdline() (string, error) { - return p.CmdlineWithContext(context.Background()) -} - func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) { return p.fillFromCmdlineWithContext(ctx) } -// CmdlineSlice returns the command line arguments of the process as a slice with each -// element being an argument. -func (p *Process) CmdlineSlice() ([]string, error) { - return p.CmdlineSliceWithContext(context.Background()) -} - func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) { return p.fillSliceFromCmdlineWithContext(ctx) } @@ -138,20 +110,10 @@ func (p *Process) createTimeWithContext(ctx context.Context) (int64, error) { return createTime, nil } -// Cwd returns current working directory of the process. -func (p *Process) Cwd() (string, error) { - return p.CwdWithContext(context.Background()) -} - func (p *Process) CwdWithContext(ctx context.Context) (string, error) { return p.fillFromCwdWithContext(ctx) } -// Parent returns parent Process of the process. -func (p *Process) Parent() (*Process, error) { - return p.ParentWithContext(context.Background()) -} - func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { err := p.fillFromStatusWithContext(ctx) if err != nil { @@ -160,16 +122,7 @@ func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { if p.parent == 0 { return nil, fmt.Errorf("wrong number of parents") } - return NewProcess(p.parent) -} - -// Status returns the process status. -// Return value could be one of these. -// R: Running S: Sleep T: Stop I: Idle -// Z: Zombie W: Wait L: Lock -// The character is same within all supported platforms. -func (p *Process) Status() (string, error) { - return p.StatusWithContext(context.Background()) + return NewProcessWithContext(ctx, p.parent) } func (p *Process) StatusWithContext(ctx context.Context) (string, error) { @@ -180,11 +133,6 @@ func (p *Process) StatusWithContext(ctx context.Context) (string, error) { return p.status, nil } -// Foreground returns true if the process is in foreground, false otherwise. -func (p *Process) Foreground() (bool, error) { - return p.ForegroundWithContext(context.Background()) -} - func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { // see https://github.com/shirou/gopsutil/issues/596#issuecomment-432707831 for implementation details pid := p.Pid @@ -202,11 +150,6 @@ func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { return pgid == tpgid, nil } -// Uids returns user ids of the process as a slice of the int -func (p *Process) Uids() ([]int32, error) { - return p.UidsWithContext(context.Background()) -} - func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { err := p.fillFromStatusWithContext(ctx) if err != nil { @@ -215,11 +158,6 @@ func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { return p.uids, nil } -// Gids returns group ids of the process as a slice of the int -func (p *Process) Gids() ([]int32, error) { - return p.GidsWithContext(context.Background()) -} - func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { err := p.fillFromStatusWithContext(ctx) if err != nil { @@ -228,9 +166,12 @@ func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { return p.gids, nil } -// Terminal returns a terminal which is associated with the process. -func (p *Process) Terminal() (string, error) { - return p.TerminalWithContext(context.Background()) +func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { + err := p.fillFromStatusWithContext(ctx) + if err != nil { + return []int32{}, err + } + return p.groups, nil } func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { @@ -246,12 +187,6 @@ func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { return terminal, nil } -// Nice returns a nice value (priority). -// Notice: gopsutil can not set nice value. -func (p *Process) Nice() (int32, error) { - return p.NiceWithContext(context.Background()) -} - func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { _, _, _, _, _, nice, _, err := p.fillFromStatWithContext(ctx) if err != nil { @@ -260,29 +195,12 @@ func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { return nice, nil } -// IOnice returns process I/O nice value (priority). -func (p *Process) IOnice() (int32, error) { - return p.IOniceWithContext(context.Background()) -} - func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } -// Rlimit returns Resource Limits. -func (p *Process) Rlimit() ([]RlimitStat, error) { - return p.RlimitWithContext(context.Background()) -} - func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) { - return p.RlimitUsage(false) -} - -// RlimitUsage returns Resource Limits. -// If gatherUsed is true, the currently used value will be gathered and added -// to the resulting RlimitStat. -func (p *Process) RlimitUsage(gatherUsed bool) ([]RlimitStat, error) { - return p.RlimitUsageWithContext(context.Background(), gatherUsed) + return p.RlimitUsageWithContext(ctx, false) } func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) { @@ -303,7 +221,7 @@ func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ( rs := &rlimits[i] switch rs.Resource { case RLIMIT_CPU: - times, err := p.Times() + times, err := p.TimesWithContext(ctx) if err != nil { return nil, err } @@ -315,7 +233,7 @@ func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ( case RLIMIT_RSS: rs.Used = uint64(p.memInfo.RSS) case RLIMIT_NOFILE: - n, err := p.NumFDs() + n, err := p.NumFDsWithContext(ctx) if err != nil { return nil, err } @@ -340,20 +258,10 @@ func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ( return rlimits, err } -// IOCounters returns IO Counters. -func (p *Process) IOCounters() (*IOCountersStat, error) { - return p.IOCountersWithContext(context.Background()) -} - func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, error) { return p.fillFromIOWithContext(ctx) } -// NumCtxSwitches returns the number of the context switches of the process. -func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { - return p.NumCtxSwitchesWithContext(context.Background()) -} - func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) { err := p.fillFromStatusWithContext(ctx) if err != nil { @@ -362,21 +270,11 @@ func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitche return p.numCtxSwitches, nil } -// NumFDs returns the number of File Descriptors used by the process. -func (p *Process) NumFDs() (int32, error) { - return p.NumFDsWithContext(context.Background()) -} - func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) { _, fnames, err := p.fillFromfdListWithContext(ctx) return int32(len(fnames)), err } -// NumThreads returns the number of threads used by the process. -func (p *Process) NumThreads() (int32, error) { - return p.NumThreadsWithContext(context.Background()) -} - func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { err := p.fillFromStatusWithContext(ctx) if err != nil { @@ -385,10 +283,6 @@ func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { return p.numThreads, nil } -func (p *Process) Threads() (map[int32]*cpu.TimesStat, error) { - return p.ThreadsWithContext(context.Background()) -} - func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) { ret := make(map[int32]*cpu.TimesStat) taskPath := common.HostProc(strconv.Itoa(int(p.Pid)), "task") @@ -409,11 +303,6 @@ func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesS return ret, nil } -// Times returns CPU times of the process. -func (p *Process) Times() (*cpu.TimesStat, error) { - return p.TimesWithContext(context.Background()) -} - func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) { _, _, cpuTimes, _, _, _, _, err := p.fillFromStatWithContext(ctx) if err != nil { @@ -422,22 +311,10 @@ func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) return cpuTimes, nil } -// CPUAffinity returns CPU affinity of the process. -// -// Notice: Not implemented yet. -func (p *Process) CPUAffinity() ([]int32, error) { - return p.CPUAffinityWithContext(context.Background()) -} - func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) { return nil, common.ErrNotImplementedError } -// MemoryInfo returns platform in-dependend memory information, such as RSS, VMS and Swap -func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { - return p.MemoryInfoWithContext(context.Background()) -} - func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, error) { meminfo, _, err := p.fillFromStatmWithContext(ctx) if err != nil { @@ -446,11 +323,6 @@ func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, e return meminfo, nil } -// MemoryInfoEx returns platform dependend memory information. -func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { - return p.MemoryInfoExWithContext(context.Background()) -} - func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) { _, memInfoEx, err := p.fillFromStatmWithContext(ctx) if err != nil { @@ -459,11 +331,6 @@ func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExSta return memInfoEx, nil } -// PageFaultsInfo returns the process's page fault counters -func (p *Process) PageFaults() (*PageFaultsStat, error) { - return p.PageFaultsWithContext(context.Background()) -} - func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) { _, _, _, _, _, _, pageFaults, err := p.fillFromStatWithContext(ctx) if err != nil { @@ -473,11 +340,6 @@ func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, e } -// Children returns a slice of Process of the process. -func (p *Process) Children() ([]*Process, error) { - return p.ChildrenWithContext(context.Background()) -} - func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { pids, err := common.CallPgrepWithContext(ctx, invoke, p.Pid) if err != nil { @@ -488,7 +350,7 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { } ret := make([]*Process, 0, len(pids)) for _, pid := range pids { - np, err := NewProcess(pid) + np, err := NewProcessWithContext(ctx, pid) if err != nil { return nil, err } @@ -497,12 +359,6 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { return ret, nil } -// OpenFiles returns a slice of OpenFilesStat opend by the process. -// OpenFilesStat includes a file path and file descriptor. -func (p *Process) OpenFiles() ([]OpenFilesStat, error) { - return p.OpenFilesWithContext(context.Background()) -} - func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) { _, ofs, err := p.fillFromfdWithContext(ctx) if err != nil { @@ -516,38 +372,17 @@ func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, er return ret, nil } -// Connections returns a slice of net.ConnectionStat used by the process. -// This returns all kind of the connection. This measn TCP, UDP or UNIX. -func (p *Process) Connections() ([]net.ConnectionStat, error) { - return p.ConnectionsWithContext(context.Background()) -} - func (p *Process) ConnectionsWithContext(ctx context.Context) ([]net.ConnectionStat, error) { - return net.ConnectionsPid("all", p.Pid) -} - -// Connections returns a slice of net.ConnectionStat used by the process at most `max` -func (p *Process) ConnectionsMax(max int) ([]net.ConnectionStat, error) { - return p.ConnectionsMaxWithContext(context.Background(), max) + return net.ConnectionsPidWithContext(ctx, "all", p.Pid) } func (p *Process) ConnectionsMaxWithContext(ctx context.Context, max int) ([]net.ConnectionStat, error) { - return net.ConnectionsPidMax("all", p.Pid, max) -} - -// NetIOCounters returns NetIOCounters of the process. -func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { - return p.NetIOCountersWithContext(context.Background(), pernic) + return net.ConnectionsPidMaxWithContext(ctx, "all", p.Pid, max) } func (p *Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) { filename := common.HostProc(strconv.Itoa(int(p.Pid)), "net/dev") - return net.IOCountersByFile(pernic, filename) -} - -// MemoryMaps get memory maps from /proc/(pid)/smaps -func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { - return p.MemoryMapsWithContext(context.Background(), grouped) + return net.IOCountersByFileWithContext(ctx, pernic, filename) } func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) { @@ -564,9 +399,9 @@ func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]M lines := strings.Split(string(contents), "\n") // function of parsing a block - getBlock := func(first_line []string, block []string) (MemoryMapsStat, error) { + getBlock := func(firstLine []string, block []string) (MemoryMapsStat, error) { m := MemoryMapsStat{} - m.Path = first_line[len(first_line)-1] + m.Path = firstLine[len(firstLine)-1] for _, line := range block { if strings.Contains(line, "VmFlags") { @@ -576,7 +411,8 @@ func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]M if len(field) < 2 { continue } - v := strings.Trim(field[1], " kB") // remove last "kB" + v := strings.Trim(field[1], "kB") // remove last "kB" + v = strings.TrimSpace(v) t, err := strconv.ParseUint(v, 10, 64) if err != nil { return m, err @@ -608,13 +444,15 @@ func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]M return m, nil } - blocks := make([]string, 16) - for _, line := range lines { - field := strings.Split(line, " ") - if strings.HasSuffix(field[0], ":") == false { + var firstLine []string + blocks := make([]string, 0, 16) + for i, line := range lines { + fields := strings.Fields(line) + + if (len(fields) > 0 && !strings.HasSuffix(fields[0], ":")) || i == len(lines)-1 { // new block section - if len(blocks) > 0 { - g, err := getBlock(field, blocks) + if len(firstLine) > 0 && len(blocks) > 0 { + g, err := getBlock(firstLine, blocks) if err != nil { return &ret, err } @@ -634,7 +472,8 @@ func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]M } } // starts new block - blocks = make([]string, 16) + blocks = make([]string, 0, 16) + firstLine = fields } else { blocks = append(blocks, line) } @@ -982,8 +821,12 @@ func (p *Process) fillFromStatusWithContext(ctx context.Context) error { } } } + // Ensure we have a copy and not reference into slice + p.name = string([]byte(p.name)) case "State": p.status = value[0:1] + // Ensure we have a copy and not reference into slice + p.status = string([]byte(p.status)) case "PPid", "Ppid": pval, err := strconv.ParseInt(value, 10, 32) if err != nil { @@ -1014,6 +857,16 @@ func (p *Process) fillFromStatusWithContext(ctx context.Context) error { } p.gids = append(p.gids, int32(v)) } + case "Groups": + groups := strings.Fields(value) + p.groups = make([]int32, 0, len(groups)) + for _, i := range groups { + v, err := strconv.ParseInt(i, 10, 32) + if err != nil { + return err + } + p.groups = append(p.groups, int32(v)) + } case "Threads": v, err := strconv.ParseInt(value, 10, 32) if err != nil { @@ -1162,7 +1015,7 @@ func (p *Process) fillFromTIDStatWithContext(ctx context.Context, tid int32) (ui // docs). Note: I am assuming at least Linux 2.6.18 iotime, err := strconv.ParseFloat(fields[i+40], 64) if err != nil { - iotime = 0 // Ancient linux version, most likely + iotime = 0 // Ancient linux version, most likely } cpuTimes := &cpu.TimesStat{ @@ -1230,12 +1083,6 @@ func pidsWithContext(ctx context.Context) ([]int32, error) { return readPidsFromDir(common.HostProc()) } -// Process returns a slice of pointers to Process structs for all -// currently running processes. -func Processes() ([]*Process, error) { - return ProcessesWithContext(context.Background()) -} - func ProcessesWithContext(ctx context.Context) ([]*Process, error) { out := []*Process{} @@ -1245,7 +1092,7 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { } for _, pid := range pids { - p, err := NewProcess(pid) + p, err := NewProcessWithContext(ctx, pid) if err != nil { continue } diff --git a/vendor/github.com/shirou/gopsutil/process/process_openbsd.go b/vendor/github.com/shirou/gopsutil/process/process_openbsd.go index 1f3c645be0..0404b4baec 100644 --- a/vendor/github.com/shirou/gopsutil/process/process_openbsd.go +++ b/vendor/github.com/shirou/gopsutil/process/process_openbsd.go @@ -4,9 +4,7 @@ package process import ( "C" - "bytes" "context" - "encoding/binary" "os/exec" "path/filepath" "strconv" @@ -20,16 +18,9 @@ import ( "golang.org/x/sys/unix" ) -// MemoryInfoExStat is different between OSes -type MemoryInfoExStat struct { -} - -type MemoryMapsStat struct { -} - func pidsWithContext(ctx context.Context) ([]int32, error) { var ret []int32 - procs, err := Processes() + procs, err := ProcessesWithContext(ctx) if err != nil { return ret, nil } @@ -41,10 +32,6 @@ func pidsWithContext(ctx context.Context) ([]int32, error) { return ret, nil } -func (p *Process) Ppid() (int32, error) { - return p.PpidWithContext(context.Background()) -} - func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { k, err := p.getKProc() if err != nil { @@ -53,9 +40,6 @@ func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { return k.Ppid, nil } -func (p *Process) Name() (string, error) { - return p.NameWithContext(context.Background()) -} func (p *Process) NameWithContext(ctx context.Context) (string, error) { k, err := p.getKProc() @@ -81,21 +65,11 @@ func (p *Process) NameWithContext(ctx context.Context) (string, error) { return name, nil } -func (p *Process) Tgid() (int32, error) { - return 0, common.ErrNotImplementedError -} -func (p *Process) Exe() (string, error) { - return p.ExeWithContext(context.Background()) -} func (p *Process) ExeWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } -func (p *Process) CmdlineSlice() ([]string, error) { - return p.CmdlineSliceWithContext(context.Background()) -} - func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) { mib := []int32{CTLKern, KernProcArgs, p.Pid, KernProcArgv} buf, _, err := common.CallSyscall(mib) @@ -119,12 +93,8 @@ func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) return strParts, nil } -func (p *Process) Cmdline() (string, error) { - return p.CmdlineWithContext(context.Background()) -} - func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) { - argv, err := p.CmdlineSlice() + argv, err := p.CmdlineSliceWithContext(ctx) if err != nil { return "", err } @@ -134,22 +104,9 @@ func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) { func (p *Process) createTimeWithContext(ctx context.Context) (int64, error) { return 0, common.ErrNotImplementedError } -func (p *Process) Cwd() (string, error) { - return p.CwdWithContext(context.Background()) -} - -func (p *Process) CwdWithContext(ctx context.Context) (string, error) { - return "", common.ErrNotImplementedError -} -func (p *Process) Parent() (*Process, error) { - return p.ParentWithContext(context.Background()) -} func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { - return p, common.ErrNotImplementedError -} -func (p *Process) Status() (string, error) { - return p.StatusWithContext(context.Background()) + return nil, common.ErrNotImplementedError } func (p *Process) StatusWithContext(ctx context.Context) (string, error) { @@ -173,9 +130,6 @@ func (p *Process) StatusWithContext(ctx context.Context) (string, error) { return s, nil } -func (p *Process) Foreground() (bool, error) { - return p.ForegroundWithContext(context.Background()) -} func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { // see https://github.com/shirou/gopsutil/issues/596#issuecomment-432707831 for implementation details @@ -190,9 +144,6 @@ func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { } return strings.IndexByte(string(out), '+') != -1, nil } -func (p *Process) Uids() ([]int32, error) { - return p.UidsWithContext(context.Background()) -} func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { k, err := p.getKProc() @@ -206,9 +157,6 @@ func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { return uids, nil } -func (p *Process) Gids() ([]int32, error) { - return p.GidsWithContext(context.Background()) -} func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { k, err := p.getKProc() @@ -221,8 +169,19 @@ func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { return gids, nil } -func (p *Process) Terminal() (string, error) { - return p.TerminalWithContext(context.Background()) + +func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { + k, err := p.getKProc() + if err != nil { + return nil, err + } + + groups := make([]int32, k.Ngroups) + for i := int16(0); i < k.Ngroups; i++ { + groups[i] = int32(k.Groups[i]) + } + + return groups, nil } func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { @@ -240,9 +199,6 @@ func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { return termmap[ttyNr], nil } -func (p *Process) Nice() (int32, error) { - return p.NiceWithContext(context.Background()) -} func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { k, err := p.getKProc() @@ -251,32 +207,6 @@ func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { } return int32(k.Nice), nil } -func (p *Process) IOnice() (int32, error) { - return p.IOniceWithContext(context.Background()) -} - -func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) { - return 0, common.ErrNotImplementedError -} -func (p *Process) Rlimit() ([]RlimitStat, error) { - return p.RlimitWithContext(context.Background()) -} - -func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) { - var rlimit []RlimitStat - return rlimit, common.ErrNotImplementedError -} -func (p *Process) RlimitUsage(gatherUsed bool) ([]RlimitStat, error) { - return p.RlimitUsageWithContext(context.Background(), gatherUsed) -} - -func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) { - var rlimit []RlimitStat - return rlimit, common.ErrNotImplementedError -} -func (p *Process) IOCounters() (*IOCountersStat, error) { - return p.IOCountersWithContext(context.Background()) -} func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, error) { k, err := p.getKProc() @@ -288,39 +218,11 @@ func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, e WriteCount: uint64(k.Uru_oublock), }, nil } -func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { - return p.NumCtxSwitchesWithContext(context.Background()) -} - -func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) { - return nil, common.ErrNotImplementedError -} -func (p *Process) NumFDs() (int32, error) { - return p.NumFDsWithContext(context.Background()) -} - -func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) { - return 0, common.ErrNotImplementedError -} -func (p *Process) NumThreads() (int32, error) { - return p.NumThreadsWithContext(context.Background()) -} func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { /* not supported, just return 1 */ return 1, nil } -func (p *Process) Threads() (map[int32]*cpu.TimesStat, error) { - return p.ThreadsWithContext(context.Background()) -} - -func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) { - ret := make(map[int32]*cpu.TimesStat) - return ret, common.ErrNotImplementedError -} -func (p *Process) Times() (*cpu.TimesStat, error) { - return p.TimesWithContext(context.Background()) -} func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) { k, err := p.getKProc() @@ -333,23 +235,13 @@ func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) System: float64(k.Ustime_sec) + float64(k.Ustime_usec)/1000000, }, nil } -func (p *Process) CPUAffinity() ([]int32, error) { - return p.CPUAffinityWithContext(context.Background()) -} - -func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) { - return nil, common.ErrNotImplementedError -} -func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { - return p.MemoryInfoWithContext(context.Background()) -} func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, error) { k, err := p.getKProc() if err != nil { return nil, err } - pageSize, err := mem.GetPageSize() + pageSize, err := mem.GetPageSizeWithContext(ctx) if err != nil { return nil, err } @@ -360,25 +252,6 @@ func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, e uint64(k.Vm_ssize), }, nil } -func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { - return p.MemoryInfoExWithContext(context.Background()) -} - -func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) PageFaults() (*PageFaultsStat, error) { - return p.PageFaultsWithContext(context.Background()) -} - -func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) Children() ([]*Process, error) { - return p.ChildrenWithContext(context.Background()) -} func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { pids, err := common.CallPgrepWithContext(ctx, invoke, p.Pid) @@ -387,7 +260,7 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { } ret := make([]*Process, 0, len(pids)) for _, pid := range pids { - np, err := NewProcess(pid) + np, err := NewProcessWithContext(ctx, pid) if err != nil { return nil, err } @@ -396,55 +269,18 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { return ret, nil } -func (p *Process) OpenFiles() ([]OpenFilesStat, error) { - return p.OpenFilesWithContext(context.Background()) -} - -func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) Connections() ([]net.ConnectionStat, error) { - return p.ConnectionsWithContext(context.Background()) -} - func (p *Process) ConnectionsWithContext(ctx context.Context) ([]net.ConnectionStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) ConnectionsMax(max int) ([]net.ConnectionStat, error) { - return p.ConnectionsMaxWithContext(context.Background(), max) -} - func (p *Process) ConnectionsMaxWithContext(ctx context.Context, max int) ([]net.ConnectionStat, error) { - return []net.ConnectionStat{}, common.ErrNotImplementedError -} - -func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { - return p.NetIOCountersWithContext(context.Background(), pernic) -} - -func (p *Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { - return p.MemoryMapsWithContext(context.Background(), grouped) -} - -func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) { - var ret []MemoryMapsStat - return &ret, common.ErrNotImplementedError -} - -func Processes() ([]*Process, error) { - return ProcessesWithContext(context.Background()) -} - func ProcessesWithContext(ctx context.Context) ([]*Process, error) { results := []*Process{} - buf, length, err := CallKernProcSyscall(KernProcAll, 0) + buf, length, err := callKernProcSyscall(KernProcAll, 0) if err != nil { return results, err @@ -460,7 +296,7 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { if err != nil { continue } - p, err := NewProcess(int32(k.Pid)) + p, err := NewProcessWithContext(ctx, int32(k.Pid)) if err != nil { continue } @@ -471,19 +307,8 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { return results, nil } -func parseKinfoProc(buf []byte) (KinfoProc, error) { - var k KinfoProc - br := bytes.NewReader(buf) - err := common.Read(br, binary.LittleEndian, &k) - return k, err -} - func (p *Process) getKProc() (*KinfoProc, error) { - return p.getKProcWithContext(context.Background()) -} - -func (p *Process) getKProcWithContext(ctx context.Context) (*KinfoProc, error) { - buf, length, err := CallKernProcSyscall(KernProcPID, p.Pid) + buf, length, err := callKernProcSyscall(KernProcPID, p.Pid) if err != nil { return nil, err } @@ -498,11 +323,7 @@ func (p *Process) getKProcWithContext(ctx context.Context) (*KinfoProc, error) { return &k, nil } -func CallKernProcSyscall(op int32, arg int32) ([]byte, uint64, error) { - return CallKernProcSyscallWithContext(context.Background(), op, arg) -} - -func CallKernProcSyscallWithContext(ctx context.Context, op int32, arg int32) ([]byte, uint64, error) { +func callKernProcSyscall(op int32, arg int32) ([]byte, uint64, error) { mib := []int32{CTLKern, KernProc, op, arg, sizeOfKinfoProc, 0} mibptr := unsafe.Pointer(&mib[0]) miblen := uint64(len(mib)) diff --git a/vendor/github.com/shirou/gopsutil/process/process_openbsd_386.go b/vendor/github.com/shirou/gopsutil/process/process_openbsd_386.go new file mode 100644 index 0000000000..b89fb8dc29 --- /dev/null +++ b/vendor/github.com/shirou/gopsutil/process/process_openbsd_386.go @@ -0,0 +1,201 @@ +// +build openbsd +// +build 386 +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs process/types_openbsd.go + +package process + +const ( + CTLKern = 1 + KernProc = 66 + KernProcAll = 0 + KernProcPID = 1 + KernProcProc = 8 + KernProcPathname = 12 + KernProcArgs = 55 + KernProcArgv = 1 + KernProcEnv = 3 +) + +const ( + ArgMax = 256 * 1024 +) + +const ( + sizeofPtr = 0x4 + sizeofShort = 0x2 + sizeofInt = 0x4 + sizeofLong = 0x4 + sizeofLongLong = 0x8 +) + +const ( + sizeOfKinfoVmentry = 0x38 + sizeOfKinfoProc = 0x264 +) + +const ( + SIDL = 1 + SRUN = 2 + SSLEEP = 3 + SSTOP = 4 + SZOMB = 5 + SDEAD = 6 + SONPROC = 7 +) + +type ( + _C_short int16 + _C_int int32 + _C_long int32 + _C_long_long int64 +) + +type Timespec struct { + Sec int64 + Nsec int32 +} + +type Timeval struct { + Sec int64 + Usec int32 +} + +type Rusage struct { + Utime Timeval + Stime Timeval + Maxrss int32 + Ixrss int32 + Idrss int32 + Isrss int32 + Minflt int32 + Majflt int32 + Nswap int32 + Inblock int32 + Oublock int32 + Msgsnd int32 + Msgrcv int32 + Nsignals int32 + Nvcsw int32 + Nivcsw int32 +} + +type Rlimit struct { + Cur uint64 + Max uint64 +} + +type KinfoProc struct { + Forw uint64 + Back uint64 + Paddr uint64 + Addr uint64 + Fd uint64 + Stats uint64 + Limit uint64 + Vmspace uint64 + Sigacts uint64 + Sess uint64 + Tsess uint64 + Ru uint64 + Eflag int32 + Exitsig int32 + Flag int32 + Pid int32 + Ppid int32 + Sid int32 + X_pgid int32 + Tpgid int32 + Uid uint32 + Ruid uint32 + Gid uint32 + Rgid uint32 + Groups [16]uint32 + Ngroups int16 + Jobc int16 + Tdev uint32 + Estcpu uint32 + Rtime_sec uint32 + Rtime_usec uint32 + Cpticks int32 + Pctcpu uint32 + Swtime uint32 + Slptime uint32 + Schedflags int32 + Uticks uint64 + Sticks uint64 + Iticks uint64 + Tracep uint64 + Traceflag int32 + Holdcnt int32 + Siglist int32 + Sigmask uint32 + Sigignore uint32 + Sigcatch uint32 + Stat int8 + Priority uint8 + Usrpri uint8 + Nice uint8 + Xstat uint16 + Acflag uint16 + Comm [24]int8 + Wmesg [8]int8 + Wchan uint64 + Login [32]int8 + Vm_rssize int32 + Vm_tsize int32 + Vm_dsize int32 + Vm_ssize int32 + Uvalid int64 + Ustart_sec uint64 + Ustart_usec uint32 + Uutime_sec uint32 + Uutime_usec uint32 + Ustime_sec uint32 + Ustime_usec uint32 + Uru_maxrss uint64 + Uru_ixrss uint64 + Uru_idrss uint64 + Uru_isrss uint64 + Uru_minflt uint64 + Uru_majflt uint64 + Uru_nswap uint64 + Uru_inblock uint64 + Uru_oublock uint64 + Uru_msgsnd uint64 + Uru_msgrcv uint64 + Uru_nsignals uint64 + Uru_nvcsw uint64 + Uru_nivcsw uint64 + Uctime_sec uint32 + Uctime_usec uint32 + Psflags int32 + Spare int32 + Svuid uint32 + Svgid uint32 + Emul [8]int8 + Rlim_rss_cur uint64 + Cpuid uint64 + Vm_map_size uint64 + Tid int32 + Rtableid uint32 +} + +type Priority struct{} + +type KinfoVmentry struct { + Start uint32 + End uint32 + Guard uint32 + Fspace uint32 + Fspace_augment uint32 + Offset uint64 + Wired_count int32 + Etype int32 + Protection int32 + Max_protection int32 + Advice int32 + Inheritance int32 + Flags uint8 + Pad_cgo_0 [3]byte +} diff --git a/vendor/github.com/shirou/gopsutil/process/process_posix.go b/vendor/github.com/shirou/gopsutil/process/process_posix.go index 109239a577..6f04129b13 100644 --- a/vendor/github.com/shirou/gopsutil/process/process_posix.go +++ b/vendor/github.com/shirou/gopsutil/process/process_posix.go @@ -71,6 +71,25 @@ func getTerminalMap() (map[uint64]string, error) { return ret, nil } +// isMount is a port of python's os.path.ismount() +// https://github.com/python/cpython/blob/08ff4369afca84587b1c82034af4e9f64caddbf2/Lib/posixpath.py#L186-L216 +// https://docs.python.org/3/library/os.path.html#os.path.ismount +func isMount(path string) bool { + var stat1 unix.Stat_t + if err := unix.Lstat(path, &stat1); err != nil { + return false + } + if stat1.Mode == unix.DT_LNK { + return false + } + parent := filepath.Join(path, "..") + var stat2 unix.Stat_t + if err := unix.Lstat(parent, &stat2); err != nil { + return false + } + return stat1.Dev != stat2.Dev || stat1.Ino == stat2.Ino +} + func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) { if pid <= 0 { return false, fmt.Errorf("invalid pid %v", pid) @@ -79,11 +98,7 @@ func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) { if err != nil { return false, err } - - if _, err := os.Stat(common.HostProc()); err == nil { //Means that proc filesystem exist - // Checking PID existence based on existence of //proc/ folder - // This covers the case when running inside container with a different process namespace (by default) - + if isMount(common.HostProc()) { // if //proc exists and is mounted, check if //proc/ folder exists _, err := os.Stat(common.HostProc(strconv.Itoa(int(pid)))) if os.IsNotExist(err) { return false, nil @@ -91,8 +106,7 @@ func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) { return err == nil, err } - //'/proc' filesystem is not exist, checking of PID existence is done via signalling the process - //Make sense only if we run in the same process namespace + // procfs does not exist or is not mounted, check PID existence by signalling the pid err = proc.Signal(syscall.Signal(0)) if err == nil { return true, nil @@ -114,12 +128,6 @@ func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) { return false, err } -// SendSignal sends a unix.Signal to the process. -// Currently, SIGSTOP, SIGCONT, SIGTERM and SIGKILL are supported. -func (p *Process) SendSignal(sig syscall.Signal) error { - return p.SendSignalWithContext(context.Background(), sig) -} - func (p *Process) SendSignalWithContext(ctx context.Context, sig syscall.Signal) error { process, err := os.FindProcess(int(p.Pid)) if err != nil { @@ -134,49 +142,24 @@ func (p *Process) SendSignalWithContext(ctx context.Context, sig syscall.Signal) return nil } -// Suspend sends SIGSTOP to the process. -func (p *Process) Suspend() error { - return p.SuspendWithContext(context.Background()) -} - func (p *Process) SuspendWithContext(ctx context.Context) error { - return p.SendSignal(unix.SIGSTOP) -} - -// Resume sends SIGCONT to the process. -func (p *Process) Resume() error { - return p.ResumeWithContext(context.Background()) + return p.SendSignalWithContext(ctx, unix.SIGSTOP) } func (p *Process) ResumeWithContext(ctx context.Context) error { - return p.SendSignal(unix.SIGCONT) -} - -// Terminate sends SIGTERM to the process. -func (p *Process) Terminate() error { - return p.TerminateWithContext(context.Background()) + return p.SendSignalWithContext(ctx, unix.SIGCONT) } func (p *Process) TerminateWithContext(ctx context.Context) error { - return p.SendSignal(unix.SIGTERM) -} - -// Kill sends SIGKILL to the process. -func (p *Process) Kill() error { - return p.KillWithContext(context.Background()) + return p.SendSignalWithContext(ctx, unix.SIGTERM) } func (p *Process) KillWithContext(ctx context.Context) error { - return p.SendSignal(unix.SIGKILL) -} - -// Username returns a username of the process. -func (p *Process) Username() (string, error) { - return p.UsernameWithContext(context.Background()) + return p.SendSignalWithContext(ctx, unix.SIGKILL) } func (p *Process) UsernameWithContext(ctx context.Context) (string, error) { - uids, err := p.Uids() + uids, err := p.UidsWithContext(ctx) if err != nil { return "", err } diff --git a/vendor/github.com/shirou/gopsutil/process/process_windows.go b/vendor/github.com/shirou/gopsutil/process/process_windows.go index cdce609fba..5475f6ae91 100644 --- a/vendor/github.com/shirou/gopsutil/process/process_windows.go +++ b/vendor/github.com/shirou/gopsutil/process/process_windows.go @@ -18,6 +18,10 @@ import ( ) var ( + modntdll = windows.NewLazySystemDLL("ntdll.dll") + procNtResumeProcess = modntdll.NewProc("NtResumeProcess") + procNtSuspendProcess = modntdll.NewProc("NtSuspendProcess") + modpsapi = windows.NewLazySystemDLL("psapi.dll") procGetProcessMemoryInfo = modpsapi.NewProc("GetProcessMemoryInfo") procGetProcessImageFileNameW = modpsapi.NewProc("GetProcessImageFileNameW") @@ -34,6 +38,8 @@ var ( processorArchitecture uint ) +const processQueryInformation = windows.PROCESS_QUERY_LIMITED_INFORMATION | windows.PROCESS_QUERY_INFORMATION // WinXP doesn't know PROCESS_QUERY_LIMITED_INFORMATION + type SystemProcessInformation struct { NextEntryOffset uint64 NumberOfThreads uint64 @@ -51,10 +57,10 @@ type SystemProcessInformation struct { type systemProcessorInformation struct { ProcessorArchitecture uint16 - ProcessorLevel uint16 - ProcessorRevision uint16 - Reserved uint16 - ProcessorFeatureBits uint16 + ProcessorLevel uint16 + ProcessorRevision uint16 + Reserved uint16 + ProcessorFeatureBits uint16 } type systemInfo struct { @@ -215,7 +221,7 @@ func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) { return false, err } const STILL_ACTIVE = 259 // https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getexitcodeprocess - h, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(pid)) + h, err := windows.OpenProcess(processQueryInformation, false, uint32(pid)) if err == windows.ERROR_ACCESS_DENIED { return true, nil } @@ -231,40 +237,45 @@ func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) { return exitCode == STILL_ACTIVE, err } -func (p *Process) Ppid() (int32, error) { - return p.PpidWithContext(context.Background()) -} - func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { + // if cached already, return from cache + cachedPpid := p.getPpid() + if cachedPpid != 0 { + return cachedPpid, nil + } + ppid, _, _, err := getFromSnapProcess(p.Pid) if err != nil { return 0, err } - return ppid, nil -} -func (p *Process) Name() (string, error) { - return p.NameWithContext(context.Background()) + // no errors and not cached already, so cache it + p.setPpid(ppid) + + return ppid, nil } func (p *Process) NameWithContext(ctx context.Context) (string, error) { - _, _, name, err := getFromSnapProcess(p.Pid) + ppid, _, name, err := getFromSnapProcess(p.Pid) if err != nil { return "", fmt.Errorf("could not get Name: %s", err) } + + // if no errors and not cached already, cache ppid + p.parent = ppid + if 0 == p.getPpid() { + p.setPpid(ppid) + } + return name, nil } -func (p *Process) Tgid() (int32, error) { +func (p *Process) TgidWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } -func (p *Process) Exe() (string, error) { - return p.ExeWithContext(context.Background()) -} - func (p *Process) ExeWithContext(ctx context.Context) (string, error) { - c, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(p.Pid)) + c, err := windows.OpenProcess(processQueryInformation, false, uint32(p.Pid)) if err != nil { return "", err } @@ -290,10 +301,6 @@ func (p *Process) ExeWithContext(ctx context.Context) (string, error) { return common.ConvertDOSPath(windows.UTF16ToString(buf[:])), nil } -func (p *Process) Cmdline() (string, error) { - return p.CmdlineWithContext(context.Background()) -} - func (p *Process) CmdlineWithContext(_ context.Context) (string, error) { cmdline, err := getProcessCommandLine(p.Pid) if err != nil { @@ -302,13 +309,6 @@ func (p *Process) CmdlineWithContext(_ context.Context) (string, error) { return cmdline, nil } -// CmdlineSlice returns the command line arguments of the process as a slice with each -// element being an argument. This merely returns the CommandLine informations passed -// to the process split on the 0x20 ASCII character. -func (p *Process) CmdlineSlice() ([]string, error) { - return p.CmdlineSliceWithContext(context.Background()) -} - func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) { cmdline, err := p.CmdlineWithContext(ctx) if err != nil { @@ -326,16 +326,9 @@ func (p *Process) createTimeWithContext(ctx context.Context) (int64, error) { return ru.CreationTime.Nanoseconds() / 1000000, nil } -func (p *Process) Cwd() (string, error) { - return p.CwdWithContext(context.Background()) -} - func (p *Process) CwdWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } -func (p *Process) Parent() (*Process, error) { - return p.ParentWithContext(context.Background()) -} func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { ppid, err := p.PpidWithContext(ctx) @@ -343,31 +336,20 @@ func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { return nil, fmt.Errorf("could not get ParentProcessID: %s", err) } - return NewProcess(ppid) -} -func (p *Process) Status() (string, error) { - return p.StatusWithContext(context.Background()) + return NewProcessWithContext(ctx, ppid) } func (p *Process) StatusWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } -func (p *Process) Foreground() (bool, error) { - return p.ForegroundWithContext(context.Background()) -} - func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { return false, common.ErrNotImplementedError } -func (p *Process) Username() (string, error) { - return p.UsernameWithContext(context.Background()) -} - func (p *Process) UsernameWithContext(ctx context.Context) (string, error) { pid := p.Pid - c, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(pid)) + c, err := windows.OpenProcess(processQueryInformation, false, uint32(pid)) if err != nil { return "", err } @@ -388,25 +370,16 @@ func (p *Process) UsernameWithContext(ctx context.Context) (string, error) { return domain + "\\" + user, err } -func (p *Process) Uids() ([]int32, error) { - return p.UidsWithContext(context.Background()) -} - func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { - var uids []int32 - - return uids, common.ErrNotImplementedError -} -func (p *Process) Gids() ([]int32, error) { - return p.GidsWithContext(context.Background()) + return nil, common.ErrNotImplementedError } func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { - var gids []int32 - return gids, common.ErrNotImplementedError + return nil, common.ErrNotImplementedError } -func (p *Process) Terminal() (string, error) { - return p.TerminalWithContext(context.Background()) + +func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { + return nil, common.ErrNotImplementedError } func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { @@ -425,13 +398,8 @@ var priorityClasses = map[int]int32{ 0x00000100: 24, // REALTIME_PRIORITY_CLASS } -// Nice returns priority in Windows -func (p *Process) Nice() (int32, error) { - return p.NiceWithContext(context.Background()) -} - func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { - c, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(p.Pid)) + c, err := windows.OpenProcess(processQueryInformation, false, uint32(p.Pid)) if err != nil { return 0, err } @@ -446,38 +414,21 @@ func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { } return priority, nil } -func (p *Process) IOnice() (int32, error) { - return p.IOniceWithContext(context.Background()) -} func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } -func (p *Process) Rlimit() ([]RlimitStat, error) { - return p.RlimitWithContext(context.Background()) -} func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) { - var rlimit []RlimitStat - - return rlimit, common.ErrNotImplementedError -} -func (p *Process) RlimitUsage(gatherUsed bool) ([]RlimitStat, error) { - return p.RlimitUsageWithContext(context.Background(), gatherUsed) + return nil, common.ErrNotImplementedError } func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) { - var rlimit []RlimitStat - - return rlimit, common.ErrNotImplementedError -} - -func (p *Process) IOCounters() (*IOCountersStat, error) { - return p.IOCountersWithContext(context.Background()) + return nil, common.ErrNotImplementedError } func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, error) { - c, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(p.Pid)) + c, err := windows.OpenProcess(processQueryInformation, false, uint32(p.Pid)) if err != nil { return nil, err } @@ -496,41 +447,32 @@ func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, e return stats, nil } -func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { - return p.NumCtxSwitchesWithContext(context.Background()) -} func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) NumFDs() (int32, error) { - return p.NumFDsWithContext(context.Background()) -} func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } -func (p *Process) NumThreads() (int32, error) { - return p.NumThreadsWithContext(context.Background()) -} func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { - _, ret, _, err := getFromSnapProcess(p.Pid) + ppid, ret, _, err := getFromSnapProcess(p.Pid) if err != nil { return 0, err } + + // if no errors and not cached already, cache ppid + p.parent = ppid + if 0 == p.getPpid() { + p.setPpid(ppid) + } + return ret, nil } -func (p *Process) Threads() (map[int32]*cpu.TimesStat, error) { - return p.ThreadsWithContext(context.Background()) -} func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) { - ret := make(map[int32]*cpu.TimesStat) - return ret, common.ErrNotImplementedError -} -func (p *Process) Times() (*cpu.TimesStat, error) { - return p.TimesWithContext(context.Background()) + return nil, common.ErrNotImplementedError } func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) { @@ -556,16 +498,10 @@ func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) System: kernel, }, nil } -func (p *Process) CPUAffinity() ([]int32, error) { - return p.CPUAffinityWithContext(context.Background()) -} func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) { return nil, common.ErrNotImplementedError } -func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { - return p.MemoryInfoWithContext(context.Background()) -} func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, error) { mem, err := getMemoryInfo(p.Pid) @@ -580,26 +516,15 @@ func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, e return ret, nil } -func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { - return p.MemoryInfoExWithContext(context.Background()) -} func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) PageFaults() (*PageFaultsStat, error) { - return p.PageFaultsWithContext(context.Background()) -} - func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) Children() ([]*Process, error) { - return p.ChildrenWithContext(context.Background()) -} - func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { out := []*Process{} snap, err := windows.CreateToolhelp32Snapshot(windows.TH32CS_SNAPPROCESS, uint32(0)) @@ -614,7 +539,7 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { } for { if pe32.ParentProcessID == uint32(p.Pid) { - p, err := NewProcess(int32(pe32.ProcessID)) + p, err := NewProcessWithContext(ctx, int32(pe32.ProcessID)) if err == nil { out = append(out, p) } @@ -626,72 +551,60 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { return out, nil } -func (p *Process) OpenFiles() ([]OpenFilesStat, error) { - return p.OpenFilesWithContext(context.Background()) -} - func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) Connections() ([]net.ConnectionStat, error) { - return p.ConnectionsWithContext(context.Background()) -} - func (p *Process) ConnectionsWithContext(ctx context.Context) ([]net.ConnectionStat, error) { return net.ConnectionsPidWithContext(ctx, "all", p.Pid) } -func (p *Process) ConnectionsMax(max int) ([]net.ConnectionStat, error) { - return p.ConnectionsMaxWithContext(context.Background(), max) -} - func (p *Process) ConnectionsMaxWithContext(ctx context.Context, max int) ([]net.ConnectionStat, error) { - return []net.ConnectionStat{}, common.ErrNotImplementedError -} - -func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { - return p.NetIOCountersWithContext(context.Background(), pernic) + return nil, common.ErrNotImplementedError } func (p *Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) { return nil, common.ErrNotImplementedError } -func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { - return p.MemoryMapsWithContext(context.Background(), grouped) -} - func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) { - var ret []MemoryMapsStat - return &ret, common.ErrNotImplementedError -} - -func (p *Process) SendSignal(sig windows.Signal) error { - return p.SendSignalWithContext(context.Background(), sig) + return nil, common.ErrNotImplementedError } -func (p *Process) SendSignalWithContext(ctx context.Context, sig windows.Signal) error { +func (p *Process) SendSignalWithContext(ctx context.Context, sig syscall.Signal) error { return common.ErrNotImplementedError } -func (p *Process) Suspend() error { - return p.SuspendWithContext(context.Background()) -} - func (p *Process) SuspendWithContext(ctx context.Context) error { - return common.ErrNotImplementedError -} -func (p *Process) Resume() error { - return p.ResumeWithContext(context.Background()) + c, err := windows.OpenProcess(windows.PROCESS_SUSPEND_RESUME, false, uint32(p.Pid)) + if err != nil { + return err + } + defer windows.CloseHandle(c) + + r1, _, _ := procNtSuspendProcess.Call(uintptr(c)) + if r1 != 0 { + // See https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55 + return fmt.Errorf("NtStatus='0x%.8X'", r1) + } + + return nil } func (p *Process) ResumeWithContext(ctx context.Context) error { - return common.ErrNotImplementedError -} + c, err := windows.OpenProcess(windows.PROCESS_SUSPEND_RESUME, false, uint32(p.Pid)) + if err != nil { + return err + } + defer windows.CloseHandle(c) + + r1, _, _ := procNtResumeProcess.Call(uintptr(c)) + if r1 != 0 { + // See https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55 + return fmt.Errorf("NtStatus='0x%.8X'", r1) + } -func (p *Process) Terminate() error { - return p.TerminateWithContext(context.Background()) + return nil } func (p *Process) TerminateWithContext(ctx context.Context) error { @@ -704,15 +617,26 @@ func (p *Process) TerminateWithContext(ctx context.Context) error { return err } -func (p *Process) Kill() error { - return p.KillWithContext(context.Background()) -} - func (p *Process) KillWithContext(ctx context.Context) error { process := os.Process{Pid: int(p.Pid)} return process.Kill() } +// retrieve Ppid in a thread-safe manner +func (p *Process) getPpid() int32 { + p.parentMutex.RLock() + defer p.parentMutex.RUnlock() + return p.parent +} + +// cache Ppid in a thread-safe manner (WINDOWS ONLY) +// see https://psutil.readthedocs.io/en/latest/#psutil.Process.ppid +func (p *Process) setPpid(ppid int32) { + p.parentMutex.Lock() + defer p.parentMutex.Unlock() + p.parent = ppid +} + func getFromSnapProcess(pid int32) (int32, int32, string, error) { snap, err := windows.CreateToolhelp32Snapshot(windows.TH32CS_SNAPPROCESS, uint32(pid)) if err != nil { @@ -736,11 +660,6 @@ func getFromSnapProcess(pid int32) (int32, int32, string, error) { return 0, 0, "", fmt.Errorf("couldn't find pid: %d", pid) } -// Get processes -func Processes() ([]*Process, error) { - return ProcessesWithContext(context.Background()) -} - func ProcessesWithContext(ctx context.Context) ([]*Process, error) { out := []*Process{} @@ -750,7 +669,7 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { } for _, pid := range pids { - p, err := NewProcess(pid) + p, err := NewProcessWithContext(ctx, pid) if err != nil { continue } @@ -763,7 +682,7 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { func getRusage(pid int32) (*windows.Rusage, error) { var CPU windows.Rusage - c, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(pid)) + c, err := windows.OpenProcess(processQueryInformation, false, uint32(pid)) if err != nil { return nil, err } @@ -778,7 +697,7 @@ func getRusage(pid int32) (*windows.Rusage, error) { func getMemoryInfo(pid int32) (PROCESS_MEMORY_COUNTERS, error) { var mem PROCESS_MEMORY_COUNTERS - c, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(pid)) + c, err := windows.OpenProcess(processQueryInformation, false, uint32(pid)) if err != nil { return mem, err } @@ -812,7 +731,7 @@ type SYSTEM_TIMES struct { func getProcessCPUTimes(pid int32) (SYSTEM_TIMES, error) { var times SYSTEM_TIMES - h, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(pid)) + h, err := windows.OpenProcess(processQueryInformation, false, uint32(pid)) if err != nil { return times, err } @@ -853,7 +772,7 @@ func is32BitProcess(procHandle syscall.Handle) bool { } func getProcessCommandLine(pid int32) (string, error) { - h, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION | windows.PROCESS_VM_READ, false, uint32(pid)) + h, err := windows.OpenProcess(processQueryInformation|windows.PROCESS_VM_READ, false, uint32(pid)) if err == windows.ERROR_ACCESS_DENIED || err == windows.ERROR_INVALID_PARAMETER { return "", nil } @@ -897,14 +816,14 @@ func getProcessCommandLine(pid int32) (string, error) { } if procIs32Bits { - buf := readProcessMemory(syscall.Handle(h), procIs32Bits, pebAddress + uint64(16), 4) + buf := readProcessMemory(syscall.Handle(h), procIs32Bits, pebAddress+uint64(16), 4) if len(buf) != 4 { return "", errors.New("cannot locate process user parameters") } userProcParams := uint64(buf[0]) | (uint64(buf[1]) << 8) | (uint64(buf[2]) << 16) | (uint64(buf[3]) << 24) //read CommandLine field from PRTL_USER_PROCESS_PARAMETERS - remoteCmdLine := readProcessMemory(syscall.Handle(h), procIs32Bits, userProcParams + uint64(64), 8) + remoteCmdLine := readProcessMemory(syscall.Handle(h), procIs32Bits, userProcParams+uint64(64), 8) if len(remoteCmdLine) != 8 { return "", errors.New("cannot read cmdline field") } @@ -925,15 +844,15 @@ func getProcessCommandLine(pid int32) (string, error) { return convertUTF16ToString(cmdLine), nil } } else { - buf := readProcessMemory(syscall.Handle(h), procIs32Bits, pebAddress + uint64(32), 8) + buf := readProcessMemory(syscall.Handle(h), procIs32Bits, pebAddress+uint64(32), 8) if len(buf) != 8 { return "", errors.New("cannot locate process user parameters") } - userProcParams := uint64(buf[0]) | (uint64(buf[1]) << 8) | (uint64(buf[2]) << 16) | (uint64(buf[3]) << 24) | + userProcParams := uint64(buf[0]) | (uint64(buf[1]) << 8) | (uint64(buf[2]) << 16) | (uint64(buf[3]) << 24) | (uint64(buf[4]) << 32) | (uint64(buf[5]) << 40) | (uint64(buf[6]) << 48) | (uint64(buf[7]) << 56) //read CommandLine field from PRTL_USER_PROCESS_PARAMETERS - remoteCmdLine := readProcessMemory(syscall.Handle(h), procIs32Bits, userProcParams + uint64(112), 16) + remoteCmdLine := readProcessMemory(syscall.Handle(h), procIs32Bits, userProcParams+uint64(112), 16) if len(remoteCmdLine) != 16 { return "", errors.New("cannot read cmdline field") } @@ -968,7 +887,7 @@ func convertUTF16ToString(src []byte) string { srcIdx := 0 for i := 0; i < srcLen; i++ { - codePoints[i] = uint16(src[srcIdx]) | uint16(src[srcIdx + 1] << 8) + codePoints[i] = uint16(src[srcIdx]) | uint16(src[srcIdx+1])<<8 srcIdx += 2 } return syscall.UTF16ToString(codePoints) diff --git a/vendor/github.com/sirupsen/logrus/.travis.yml b/vendor/github.com/sirupsen/logrus/.travis.yml index 5e20aa4140..c1dbd5a3a3 100644 --- a/vendor/github.com/sirupsen/logrus/.travis.yml +++ b/vendor/github.com/sirupsen/logrus/.travis.yml @@ -4,14 +4,12 @@ git: depth: 1 env: - GO111MODULE=on -go: [1.13.x, 1.14.x] -os: [linux, osx] +go: 1.15.x +os: linux install: - ./travis/install.sh script: - - ./travis/cross_build.sh - - ./travis/lint.sh - - export GOMAXPROCS=4 - - export GORACE=halt_on_error=1 - - go test -race -v ./... - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then go test -race -v -tags appengine ./... ; fi + - cd ci + - go run mage.go -v -w ../ crossBuild + - go run mage.go -v -w ../ lint + - go run mage.go -v -w ../ test diff --git a/vendor/github.com/sirupsen/logrus/CHANGELOG.md b/vendor/github.com/sirupsen/logrus/CHANGELOG.md index 584026d67c..7567f61289 100644 --- a/vendor/github.com/sirupsen/logrus/CHANGELOG.md +++ b/vendor/github.com/sirupsen/logrus/CHANGELOG.md @@ -1,3 +1,39 @@ +# 1.8.1 +Code quality: + * move magefile in its own subdir/submodule to remove magefile dependency on logrus consumer + * improve timestamp format documentation + +Fixes: + * fix race condition on logger hooks + + +# 1.8.0 + +Correct versioning number replacing v1.7.1. + +# 1.7.1 + +Beware this release has introduced a new public API and its semver is therefore incorrect. + +Code quality: + * use go 1.15 in travis + * use magefile as task runner + +Fixes: + * small fixes about new go 1.13 error formatting system + * Fix for long time race condiction with mutating data hooks + +Features: + * build support for zos + +# 1.7.0 +Fixes: + * the dependency toward a windows terminal library has been removed + +Features: + * a new buffer pool management API has been added + * a set of `Fn()` functions have been added + # 1.6.0 Fixes: * end of line cleanup diff --git a/vendor/github.com/sirupsen/logrus/README.md b/vendor/github.com/sirupsen/logrus/README.md index 5796706dbf..5152b6aa40 100644 --- a/vendor/github.com/sirupsen/logrus/README.md +++ b/vendor/github.com/sirupsen/logrus/README.md @@ -402,7 +402,7 @@ func (f *MyJSONFormatter) Format(entry *Entry) ([]byte, error) { // source of the official loggers. serialized, err := json.Marshal(entry.Data) if err != nil { - return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) + return nil, fmt.Errorf("Failed to marshal fields to JSON, %w", err) } return append(serialized, '\n'), nil } diff --git a/vendor/github.com/sirupsen/logrus/entry.go b/vendor/github.com/sirupsen/logrus/entry.go index 5a5cbfe7c8..07a1e5fa72 100644 --- a/vendor/github.com/sirupsen/logrus/entry.go +++ b/vendor/github.com/sirupsen/logrus/entry.go @@ -78,6 +78,14 @@ func NewEntry(logger *Logger) *Entry { } } +func (entry *Entry) Dup() *Entry { + data := make(Fields, len(entry.Data)) + for k, v := range entry.Data { + data[k] = v + } + return &Entry{Logger: entry.Logger, Data: data, Time: entry.Time, Context: entry.Context, err: entry.err} +} + // Returns the bytes representation of this entry from the formatter. func (entry *Entry) Bytes() ([]byte, error) { return entry.Logger.Formatter.Format(entry) @@ -123,11 +131,9 @@ func (entry *Entry) WithFields(fields Fields) *Entry { for k, v := range fields { isErrField := false if t := reflect.TypeOf(v); t != nil { - switch t.Kind() { - case reflect.Func: + switch { + case t.Kind() == reflect.Func, t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Func: isErrField = true - case reflect.Ptr: - isErrField = t.Elem().Kind() == reflect.Func } } if isErrField { @@ -212,68 +218,72 @@ func (entry Entry) HasCaller() (has bool) { entry.Caller != nil } -// This function is not declared with a pointer value because otherwise -// race conditions will occur when using multiple goroutines -func (entry Entry) log(level Level, msg string) { +func (entry *Entry) log(level Level, msg string) { var buffer *bytes.Buffer - // Default to now, but allow users to override if they want. - // - // We don't have to worry about polluting future calls to Entry#log() - // with this assignment because this function is declared with a - // non-pointer receiver. - if entry.Time.IsZero() { - entry.Time = time.Now() + newEntry := entry.Dup() + + if newEntry.Time.IsZero() { + newEntry.Time = time.Now() } - entry.Level = level - entry.Message = msg - entry.Logger.mu.Lock() - if entry.Logger.ReportCaller { - entry.Caller = getCaller() + newEntry.Level = level + newEntry.Message = msg + + newEntry.Logger.mu.Lock() + reportCaller := newEntry.Logger.ReportCaller + newEntry.Logger.mu.Unlock() + + if reportCaller { + newEntry.Caller = getCaller() } - entry.Logger.mu.Unlock() - entry.fireHooks() + newEntry.fireHooks() buffer = getBuffer() defer func() { - entry.Buffer = nil + newEntry.Buffer = nil putBuffer(buffer) }() buffer.Reset() - entry.Buffer = buffer + newEntry.Buffer = buffer - entry.write() + newEntry.write() - entry.Buffer = nil + newEntry.Buffer = nil // To avoid Entry#log() returning a value that only would make sense for // panic() to use in Entry#Panic(), we avoid the allocation by checking // directly here. if level <= PanicLevel { - panic(&entry) + panic(newEntry) } } func (entry *Entry) fireHooks() { + var tmpHooks LevelHooks entry.Logger.mu.Lock() - defer entry.Logger.mu.Unlock() - err := entry.Logger.Hooks.Fire(entry.Level, entry) + tmpHooks = make(LevelHooks, len(entry.Logger.Hooks)) + for k, v := range entry.Logger.Hooks { + tmpHooks[k] = v + } + entry.Logger.mu.Unlock() + + err := tmpHooks.Fire(entry.Level, entry) if err != nil { fmt.Fprintf(os.Stderr, "Failed to fire hook: %v\n", err) } } func (entry *Entry) write() { - entry.Logger.mu.Lock() - defer entry.Logger.mu.Unlock() serialized, err := entry.Logger.Formatter.Format(entry) if err != nil { fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err) return } - if _, err = entry.Logger.Out.Write(serialized); err != nil { + entry.Logger.mu.Lock() + defer entry.Logger.mu.Unlock() + if _, err := entry.Logger.Out.Write(serialized); err != nil { fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err) } } @@ -319,7 +329,6 @@ func (entry *Entry) Fatal(args ...interface{}) { func (entry *Entry) Panic(args ...interface{}) { entry.Log(PanicLevel, args...) - panic(fmt.Sprint(args...)) } // Entry Printf family functions diff --git a/vendor/github.com/sirupsen/logrus/go.sum b/vendor/github.com/sirupsen/logrus/go.sum index 1edc143bed..694c18b845 100644 --- a/vendor/github.com/sirupsen/logrus/go.sum +++ b/vendor/github.com/sirupsen/logrus/go.sum @@ -4,7 +4,5 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/sirupsen/logrus/json_formatter.go b/vendor/github.com/sirupsen/logrus/json_formatter.go index ba7f237112..c96dc5636b 100644 --- a/vendor/github.com/sirupsen/logrus/json_formatter.go +++ b/vendor/github.com/sirupsen/logrus/json_formatter.go @@ -23,6 +23,9 @@ func (f FieldMap) resolve(key fieldKey) string { // JSONFormatter formats logs into parsable json type JSONFormatter struct { // TimestampFormat sets the format used for marshaling timestamps. + // The format to use is the same than for time.Format or time.Parse from the standard + // library. + // The standard Library already provides a set of predefined format. TimestampFormat string // DisableTimestamp allows disabling automatic timestamps in output @@ -118,7 +121,7 @@ func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { encoder.SetIndent("", " ") } if err := encoder.Encode(data); err != nil { - return nil, fmt.Errorf("failed to marshal fields to JSON, %v", err) + return nil, fmt.Errorf("failed to marshal fields to JSON, %w", err) } return b.Bytes(), nil diff --git a/vendor/github.com/sirupsen/logrus/logger.go b/vendor/github.com/sirupsen/logrus/logger.go index dbf627c975..337704457a 100644 --- a/vendor/github.com/sirupsen/logrus/logger.go +++ b/vendor/github.com/sirupsen/logrus/logger.go @@ -12,7 +12,7 @@ import ( // LogFunction For big messages, it can be more efficient to pass a function // and only call it if the log level is actually enables rather than // generating the log message and then checking if the level is enabled -type LogFunction func()[]interface{} +type LogFunction func() []interface{} type Logger struct { // The logs are `io.Copy`'d to this in a mutex. It's common to set this to a diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_unix.go b/vendor/github.com/sirupsen/logrus/terminal_check_unix.go index cc4fe6e317..04748b8515 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_unix.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_unix.go @@ -1,4 +1,4 @@ -// +build linux aix +// +build linux aix zos // +build !js package logrus diff --git a/vendor/github.com/sirupsen/logrus/text_formatter.go b/vendor/github.com/sirupsen/logrus/text_formatter.go index 3c28b54cab..be2c6efe5e 100644 --- a/vendor/github.com/sirupsen/logrus/text_formatter.go +++ b/vendor/github.com/sirupsen/logrus/text_formatter.go @@ -53,7 +53,10 @@ type TextFormatter struct { // the time passed since beginning of execution. FullTimestamp bool - // TimestampFormat to use for display when a full timestamp is printed + // TimestampFormat to use for display when a full timestamp is printed. + // The format to use is the same than for time.Format or time.Parse from the standard + // library. + // The standard Library already provides a set of predefined format. TimestampFormat string // The fields are sorted by default for a consistent output. For applications @@ -235,6 +238,8 @@ func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []strin levelColor = yellow case ErrorLevel, FatalLevel, PanicLevel: levelColor = red + case InfoLevel: + levelColor = blue default: levelColor = blue } diff --git a/vendor/github.com/skycoin/dmsg/go.mod b/vendor/github.com/skycoin/dmsg/go.mod index a42bfca045..6cd89cfded 100644 --- a/vendor/github.com/skycoin/dmsg/go.mod +++ b/vendor/github.com/skycoin/dmsg/go.mod @@ -17,6 +17,7 @@ require ( github.com/modern-go/reflect2 v1.0.1 // indirect github.com/onsi/ginkgo v1.12.0 // indirect github.com/onsi/gomega v1.9.0 // indirect + github.com/pires/go-proxyproto v0.3.3 github.com/sirupsen/logrus v1.4.2 github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6 github.com/skycoin/skycoin v0.26.0 @@ -27,8 +28,10 @@ require ( github.com/spf13/viper v1.6.2 github.com/stretchr/testify v1.4.0 golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 - golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a + golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect + golang.org/x/text v0.3.2 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect + gopkg.in/ini.v1 v1.51.1 // indirect nhooyr.io/websocket v1.8.2 ) diff --git a/vendor/github.com/skycoin/dmsg/go.sum b/vendor/github.com/skycoin/dmsg/go.sum index 9f8f44fc33..4e54f56765 100644 --- a/vendor/github.com/skycoin/dmsg/go.sum +++ b/vendor/github.com/skycoin/dmsg/go.sum @@ -9,7 +9,6 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -100,7 +99,6 @@ github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+v github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= @@ -123,6 +121,8 @@ github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pires/go-proxyproto v0.3.3 h1:jOXGrsAfSQVFiD1hWg1aiHpLYsd6SJw/8cLN594sB7Q= +github.com/pires/go-proxyproto v0.3.3/go.mod h1:Odh9VFOZJCf9G8cLW5o435Xf1J95Jw9Gw5rnCjcwzAY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -200,8 +200,9 @@ golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a h1:+HHJiFUXVOIS9mr1ThqkQD1N8vpFCfCShqADBM12KTc= golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -220,12 +221,14 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -243,8 +246,9 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogR gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.51.1 h1:GyboHr4UqMiLUybYjd22ZjQIKEJEpgtLXtuGbR21Oho= +gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= diff --git a/vendor/github.com/skycoin/dmsg/httputil/httputil.go b/vendor/github.com/skycoin/dmsg/httputil/httputil.go index 1ef7bc76a5..b4b095f38f 100644 --- a/vendor/github.com/skycoin/dmsg/httputil/httputil.go +++ b/vendor/github.com/skycoin/dmsg/httputil/httputil.go @@ -84,6 +84,9 @@ func GetLogger(r *http.Request) logrus.FieldLogger { return logging.NewMasterLogger() } +// todo: investigate if it's used throughout the services (didn't work properly for UT) +// remove and use structured logging + // SetLoggerMiddleware sets logger to context of HTTP requests. func SetLoggerMiddleware(log logrus.FieldLogger) func(next http.Handler) http.Handler { return func(next http.Handler) http.Handler { diff --git a/vendor/github.com/skycoin/dmsg/httputil/log.go b/vendor/github.com/skycoin/dmsg/httputil/log.go new file mode 100644 index 0000000000..ec6778414f --- /dev/null +++ b/vendor/github.com/skycoin/dmsg/httputil/log.go @@ -0,0 +1,56 @@ +package httputil + +import ( + "context" + "net/http" + "time" + + "github.com/go-chi/chi/middleware" + "github.com/sirupsen/logrus" +) + +type structuredLogger struct { + logger logrus.FieldLogger +} + +// NewLogMiddleware creates a new instance of logging middleware. This will allow +// adding log fields in the handler and any further middleware. At the end of request, this +// log entry will be printed at Info level via passed logger +func NewLogMiddleware(logger logrus.FieldLogger) func(http.Handler) http.Handler { + return func(next http.Handler) http.Handler { + fn := func(w http.ResponseWriter, r *http.Request) { + sl := &structuredLogger{logger} + start := time.Now() + var requestID string + if reqID := r.Context().Value(middleware.RequestIDKey); reqID != nil { + requestID = reqID.(string) + } + ww := middleware.NewWrapResponseWriter(w, r.ProtoMajor) + newContext := context.WithValue(r.Context(), middleware.LogEntryCtxKey, sl) + next.ServeHTTP(ww, r.WithContext(newContext)) + latency := time.Since(start) + fields := logrus.Fields{ + "status": ww.Status(), + "took": latency, + "remote": r.RemoteAddr, + "request": r.RequestURI, + "method": r.Method, + } + if requestID != "" { + fields["request_id"] = requestID + } + sl.logger.WithFields(fields).Info() + + } + return http.HandlerFunc(fn) + } +} + +// LogEntrySetField adds new key-value pair to current (request scoped) log entry. This pair will be +// printed along with all other pairs when the request is served. +// This requires log middleware from this package to be installed in the chain +func LogEntrySetField(r *http.Request, key string, value interface{}) { + if sl, ok := r.Context().Value(middleware.LogEntryCtxKey).(*structuredLogger); ok { + sl.logger = sl.logger.WithField(key, value) + } +} diff --git a/vendor/github.com/skycoin/dmsg/metricsutil/victoria_metrics_int_gauge_wrapper.go b/vendor/github.com/skycoin/dmsg/metricsutil/victoria_metrics_int_gauge_wrapper.go index 14bff1b101..326d54f62f 100644 --- a/vendor/github.com/skycoin/dmsg/metricsutil/victoria_metrics_int_gauge_wrapper.go +++ b/vendor/github.com/skycoin/dmsg/metricsutil/victoria_metrics_int_gauge_wrapper.go @@ -34,6 +34,11 @@ func (w *VictoriaMetricsIntGaugeWrapper) Dec() { atomic.AddInt64(&w.val, -1) } +// Set sets gauge value. +func (w *VictoriaMetricsIntGaugeWrapper) Set(val int64) { + atomic.StoreInt64(&w.val, val) +} + // Val gets gauge value. func (w *VictoriaMetricsIntGaugeWrapper) Val() int64 { return atomic.LoadInt64(&w.val) diff --git a/vendor/github.com/skycoin/dmsg/metricsutil/victoria_metrics_uint_gauge_wrapper.go b/vendor/github.com/skycoin/dmsg/metricsutil/victoria_metrics_uint_gauge_wrapper.go index 1a386255c2..bf5e20b459 100644 --- a/vendor/github.com/skycoin/dmsg/metricsutil/victoria_metrics_uint_gauge_wrapper.go +++ b/vendor/github.com/skycoin/dmsg/metricsutil/victoria_metrics_uint_gauge_wrapper.go @@ -34,6 +34,11 @@ func (w *VictoriaMetricsUintGaugeWrapper) Dec() { atomic.AddUint64(&w.val, ^uint64(0)) } +// Set sets gauge value. +func (w *VictoriaMetricsUintGaugeWrapper) Set(val uint64) { + atomic.StoreUint64(&w.val, val) +} + // Val gets gauge value. func (w *VictoriaMetricsUintGaugeWrapper) Val() uint64 { return atomic.LoadUint64(&w.val) diff --git a/vendor/github.com/skycoin/dmsg/noise/read_writer.go b/vendor/github.com/skycoin/dmsg/noise/read_writer.go index b5f97eec8b..c22bacc043 100644 --- a/vendor/github.com/skycoin/dmsg/noise/read_writer.go +++ b/vendor/github.com/skycoin/dmsg/noise/read_writer.go @@ -42,6 +42,7 @@ type netError struct { func (e *netError) Error() string { return e.err.Error() } func (e *netError) Timeout() bool { return e.timeout } func (e *netError) Temporary() bool { return e.temp } +func (e *netError) Unwrap() error { return e.err } // ReadWriter implements noise encrypted read writer. type ReadWriter struct { diff --git a/vendor/github.com/skycoin/dmsg/server.go b/vendor/github.com/skycoin/dmsg/server.go index b6e1551282..7ecc88f84f 100644 --- a/vendor/github.com/skycoin/dmsg/server.go +++ b/vendor/github.com/skycoin/dmsg/server.go @@ -80,7 +80,13 @@ func NewServer(pk cipher.PubKey, sk cipher.SecKey, dc disc.APIClient, conf *Serv func (s *Server) GetSessions() map[cipher.PubKey]*SessionCommon { s.sessionsMx.Lock() defer s.sessionsMx.Unlock() - return s.sessions + + sessions := make(map[cipher.PubKey]*SessionCommon, len(s.sessions)) + for pk, session := range s.sessions { + sessions[pk] = session + } + + return sessions } // Close implements io.Closer @@ -143,7 +149,7 @@ func (s *Server) Serve(lis net.Listener, addr string) error { s.wg.Add(1) go func(conn net.Conn) { - func() { + defer func() { err := recover() if err != nil { log.Warnf("panic in handleSession: %+v", err) diff --git a/vendor/github.com/skycoin/dmsg/servermetrics/empty.go b/vendor/github.com/skycoin/dmsg/servermetrics/empty.go index ff71516bbd..e08d3ab192 100644 --- a/vendor/github.com/skycoin/dmsg/servermetrics/empty.go +++ b/vendor/github.com/skycoin/dmsg/servermetrics/empty.go @@ -1,9 +1,5 @@ package servermetrics -import ( - "net/http" -) - // NewEmpty constructs new empty metrics. func NewEmpty() Empty { return Empty{} @@ -18,5 +14,11 @@ func (Empty) RecordSession(_ DeltaType) {} // RecordStream implements `Metrics`. func (Empty) RecordStream(_ DeltaType) {} -// HandleDisc implements `Metrics`. -func (Empty) HandleDisc(next http.Handler) http.HandlerFunc { return next.ServeHTTP } +// SetPacketsPerMinute implements `Metrics`. +func (Empty) SetPacketsPerMinute(_ uint64) {} + +// SetPacketsPerSecond implements `Metrics`. +func (Empty) SetPacketsPerSecond(_ uint64) {} + +// SetClientsCount implements `Metrics`. +func (Empty) SetClientsCount(_ int64) {} diff --git a/vendor/github.com/skycoin/dmsg/servermetrics/metrics.go b/vendor/github.com/skycoin/dmsg/servermetrics/metrics.go new file mode 100644 index 0000000000..42f1984a2e --- /dev/null +++ b/vendor/github.com/skycoin/dmsg/servermetrics/metrics.go @@ -0,0 +1,10 @@ +package servermetrics + +// Metrics collects metrics for metrics tracking system. +type Metrics interface { + RecordSession(delta DeltaType) + RecordStream(delta DeltaType) + SetClientsCount(val int64) + SetPacketsPerSecond(val uint64) + SetPacketsPerMinute(val uint64) +} diff --git a/vendor/github.com/skycoin/dmsg/servermetrics/victoria_metrics.go b/vendor/github.com/skycoin/dmsg/servermetrics/victoria_metrics.go index ac3741fea4..cec89b4be8 100644 --- a/vendor/github.com/skycoin/dmsg/servermetrics/victoria_metrics.go +++ b/vendor/github.com/skycoin/dmsg/servermetrics/victoria_metrics.go @@ -8,14 +8,11 @@ import ( "github.com/skycoin/dmsg/metricsutil" ) -// Metrics collects metrics for metrics tracking system. -type Metrics interface { - RecordSession(delta DeltaType) - RecordStream(delta DeltaType) -} - // VictoriaMetrics implements `Metrics` using `VictoriaMetrics`. type VictoriaMetrics struct { + packetsPerMinute *metricsutil.VictoriaMetricsUintGaugeWrapper + packetsPerSecond *metricsutil.VictoriaMetricsUintGaugeWrapper + clientsCount *metricsutil.VictoriaMetricsIntGaugeWrapper activeSessions *metricsutil.VictoriaMetricsIntGaugeWrapper successfulSessions *metrics.Counter failedSessions *metrics.Counter @@ -27,6 +24,9 @@ type VictoriaMetrics struct { // NewVictoriaMetrics returns the Victoria Metrics implementation of Metrics. func NewVictoriaMetrics() *VictoriaMetrics { return &VictoriaMetrics{ + packetsPerMinute: metricsutil.NewVictoriaMetricsUintGauge("packets_per_minute"), + packetsPerSecond: metricsutil.NewVictoriaMetricsUintGauge("packets_per_second"), + clientsCount: metricsutil.NewVictoriaMetricsIntGauge("clients_count"), activeSessions: metricsutil.NewVictoriaMetricsIntGauge("vm_active_sessions_count"), successfulSessions: metrics.GetOrCreateCounter("vm_session_success_total"), failedSessions: metrics.GetOrCreateCounter("vm_session_fail_total"), @@ -36,6 +36,21 @@ func NewVictoriaMetrics() *VictoriaMetrics { } } +// SetPacketsPerMinute implements `Metrics`. +func (m *VictoriaMetrics) SetPacketsPerMinute(val uint64) { + m.packetsPerMinute.Set(val) +} + +// SetPacketsPerSecond implements `Metrics`. +func (m *VictoriaMetrics) SetPacketsPerSecond(val uint64) { + m.packetsPerSecond.Set(val) +} + +// SetClientsCount implements `Metrics`. +func (m *VictoriaMetrics) SetClientsCount(val int64) { + m.clientsCount.Set(val) +} + // RecordSession implements `Metrics`. func (m *VictoriaMetrics) RecordSession(delta DeltaType) { switch delta { diff --git a/vendor/github.com/spf13/cobra/.golangci.yml b/vendor/github.com/spf13/cobra/.golangci.yml new file mode 100644 index 0000000000..0d6e61793a --- /dev/null +++ b/vendor/github.com/spf13/cobra/.golangci.yml @@ -0,0 +1,48 @@ +run: + deadline: 5m + +linters: + disable-all: true + enable: + #- bodyclose + - deadcode + #- depguard + #- dogsled + #- dupl + - errcheck + #- exhaustive + #- funlen + - gas + #- gochecknoinits + - goconst + #- gocritic + #- gocyclo + #- gofmt + - goimports + - golint + #- gomnd + #- goprintffuncname + #- gosec + #- gosimple + - govet + - ineffassign + - interfacer + #- lll + - maligned + - megacheck + #- misspell + #- nakedret + #- noctx + #- nolintlint + #- rowserrcheck + #- scopelint + #- staticcheck + - structcheck + #- stylecheck + #- typecheck + - unconvert + #- unparam + #- unused + - varcheck + #- whitespace + fast: false diff --git a/vendor/github.com/spf13/cobra/.travis.yml b/vendor/github.com/spf13/cobra/.travis.yml index a9bd4e5478..e0a3b50043 100644 --- a/vendor/github.com/spf13/cobra/.travis.yml +++ b/vendor/github.com/spf13/cobra/.travis.yml @@ -1,7 +1,6 @@ language: go stages: - - diff - test - build @@ -10,20 +9,20 @@ go: - 1.13.x - tip +env: GO111MODULE=on + before_install: - go get -u github.com/kyoh86/richgo - go get -u github.com/mitchellh/gox + - curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin latest matrix: allow_failures: - go: tip include: - - stage: diff - go: 1.13.x - script: make fmt - stage: build go: 1.13.x script: make cobra_generator -script: +script: - make test diff --git a/vendor/github.com/spf13/cobra/CHANGELOG.md b/vendor/github.com/spf13/cobra/CHANGELOG.md new file mode 100644 index 0000000000..8a23b4f851 --- /dev/null +++ b/vendor/github.com/spf13/cobra/CHANGELOG.md @@ -0,0 +1,51 @@ +# Cobra Changelog + +## v1.1.3 + +* **Fix:** release-branch.cobra1.1 only: Revert "Deprecate Go < 1.14" to maintain backward compatibility + +## v1.1.2 + +### Notable Changes + +* Bump license year to 2021 in golden files (#1309) @Bowbaq +* Enhance PowerShell completion with custom comp (#1208) @Luap99 +* Update gopkg.in/yaml.v2 to v2.4.0: The previous breaking change in yaml.v2 v2.3.0 has been reverted, see go-yaml/yaml#670 +* Documentation readability improvements (#1228 etc.) @zaataylor etc. +* Use golangci-lint: Repair warnings and errors resulting from linting (#1044) @umarcor + +## v1.1.1 + +* **Fix:** yaml.v2 2.3.0 contained a unintended breaking change. This release reverts to yaml.v2 v2.2.8 which has recent critical CVE fixes, but does not have the breaking changes. See https://github.com/spf13/cobra/pull/1259 for context. +* **Fix:** correct internal formatting for go-md2man v2 (which caused man page generation to be broken). See https://github.com/spf13/cobra/issues/1049 for context. + +## v1.1.0 + +### Notable Changes + +* Extend Go completions and revamp zsh comp (#1070) +* Fix man page doc generation - no auto generated tag when `cmd.DisableAutoGenTag = true` (#1104) @jpmcb +* Add completion for help command (#1136) +* Complete subcommands when TraverseChildren is set (#1171) +* Fix stderr printing functions (#894) +* fix: fish output redirection (#1247) + +## v1.0.0 + +Announcing v1.0.0 of Cobra. 🎉 + +### Notable Changes +* Fish completion (including support for Go custom completion) @marckhouzam +* API (urgent): Rename BashCompDirectives to ShellCompDirectives @marckhouzam +* Remove/replace SetOutput on Command - deprecated @jpmcb +* add support for autolabel stale PR @xchapter7x +* Add Labeler Actions @xchapter7x +* Custom completions coded in Go (instead of Bash) @marckhouzam +* Partial Revert of #922 @jharshman +* Add Makefile to project @jharshman +* Correct documentation for InOrStdin @desponda +* Apply formatting to templates @jharshman +* Revert change so help is printed on stdout again @marckhouzam +* Update md2man to v2.0.0 @pdf +* update viper to v1.4.0 @umarcor +* Update cmd/root.go example in README.md @jharshman diff --git a/vendor/github.com/spf13/cobra/CONDUCT.md b/vendor/github.com/spf13/cobra/CONDUCT.md new file mode 100644 index 0000000000..9d16f88fd1 --- /dev/null +++ b/vendor/github.com/spf13/cobra/CONDUCT.md @@ -0,0 +1,37 @@ +## Cobra User Contract + +### Versioning +Cobra will follow a steady release cadence. Non breaking changes will be released as minor versions quarterly. Patch bug releases are at the discretion of the maintainers. Users can expect security patch fixes to be released within relatively short order of a CVE becoming known. For more information on security patch fixes see the CVE section below. Releases will follow [Semantic Versioning](https://semver.org/). Users tracking the Master branch should expect unpredictable breaking changes as the project continues to move forward. For stability, it is highly recommended to use a release. + +### Backward Compatibility +We will maintain two major releases in a moving window. The N-1 release will only receive bug fixes and security updates and will be dropped once N+1 is released. + +### Deprecation +Deprecation of Go versions or dependent packages will only occur in major releases. To reduce the change of this taking users by surprise, any large deprecation will be preceded by an announcement in the [#cobra slack channel](https://gophers.slack.com/archives/CD3LP1199) and an Issue on Github. + +### CVE +Maintainers will make every effort to release security patches in the case of a medium to high severity CVE directly impacting the library. The speed in which these patches reach a release is up to the discretion of the maintainers. A low severity CVE may be a lower priority than a high severity one. + +### Communication +Cobra maintainers will use GitHub issues and the [#cobra slack channel](https://gophers.slack.com/archives/CD3LP1199) as the primary means of communication with the community. This is to foster open communication with all users and contributors. + +### Breaking Changes +Breaking changes are generally allowed in the master branch, as this is the branch used to develop the next release of Cobra. + +There may be times, however, when master is closed for breaking changes. This is likely to happen as we near the release of a new version. + +Breaking changes are not allowed in release branches, as these represent minor versions that have already been released. These version have consumers who expect the APIs, behaviors, etc, to remain stable during the lifetime of the patch stream for the minor release. + +Examples of breaking changes include: +- Removing or renaming exported constant, variable, type, or function. +- Updating the version of critical libraries such as `spf13/pflag`, `spf13/viper` etc... + - Some version updates may be acceptable for picking up bug fixes, but maintainers must exercise caution when reviewing. + +There may, at times, need to be exceptions where breaking changes are allowed in release branches. These are at the discretion of the project's maintainers, and must be carefully considered before merging. + +### CI Testing +Maintainers will ensure the Cobra test suite utilizes the current supported versions of Golang. + +### Disclaimer +Changes to this document and the contents therein are at the discretion of the maintainers. +None of the contents of this document are legally binding in any way to the maintainers or the users. diff --git a/vendor/github.com/spf13/cobra/CONTRIBUTING.md b/vendor/github.com/spf13/cobra/CONTRIBUTING.md new file mode 100644 index 0000000000..6f356e6a82 --- /dev/null +++ b/vendor/github.com/spf13/cobra/CONTRIBUTING.md @@ -0,0 +1,50 @@ +# Contributing to Cobra + +Thank you so much for contributing to Cobra. We appreciate your time and help. +Here are some guidelines to help you get started. + +## Code of Conduct + +Be kind and respectful to the members of the community. Take time to educate +others who are seeking help. Harassment of any kind will not be tolerated. + +## Questions + +If you have questions regarding Cobra, feel free to ask it in the community +[#cobra Slack channel][cobra-slack] + +## Filing a bug or feature + +1. Before filing an issue, please check the existing issues to see if a + similar one was already opened. If there is one already opened, feel free + to comment on it. +1. If you believe you've found a bug, please provide detailed steps of + reproduction, the version of Cobra and anything else you believe will be + useful to help troubleshoot it (e.g. OS environment, environment variables, + etc...). Also state the current behavior vs. the expected behavior. +1. If you'd like to see a feature or an enhancement please open an issue with + a clear title and description of what the feature is and why it would be + beneficial to the project and its users. + +## Submitting changes + +1. CLA: Upon submitting a Pull Request (PR), contributors will be prompted to + sign a CLA. Please sign the CLA :slightly_smiling_face: +1. Tests: If you are submitting code, please ensure you have adequate tests + for the feature. Tests can be run via `go test ./...` or `make test`. +1. Since this is golang project, ensure the new code is properly formatted to + ensure code consistency. Run `make all`. + +### Quick steps to contribute + +1. Fork the project. +1. Download your fork to your PC (`git clone https://github.com/your_username/cobra && cd cobra`) +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Make changes and run tests (`make test`) +1. Add them to staging (`git add .`) +1. Commit your changes (`git commit -m 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new pull request + + +[cobra-slack]: https://gophers.slack.com/archives/CD3LP1199 diff --git a/vendor/github.com/spf13/cobra/Makefile b/vendor/github.com/spf13/cobra/Makefile index e9740d1e17..472c73bf16 100644 --- a/vendor/github.com/spf13/cobra/Makefile +++ b/vendor/github.com/spf13/cobra/Makefile @@ -1,21 +1,29 @@ BIN="./bin" SRC=$(shell find . -name "*.go") +ifeq (, $(shell which golangci-lint)) +$(warning "could not find golangci-lint in $(PATH), run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh") +endif + ifeq (, $(shell which richgo)) $(warning "could not find richgo in $(PATH), run: go get github.com/kyoh86/richgo") endif -.PHONY: fmt vet test cobra_generator install_deps clean +.PHONY: fmt lint test cobra_generator install_deps clean default: all -all: fmt vet test cobra_generator +all: fmt test cobra_generator fmt: $(info ******************** checking formatting ********************) @test -z $(shell gofmt -l $(SRC)) || (gofmt -d $(SRC); exit 1) -test: install_deps vet +lint: + $(info ******************** running lint tools ********************) + golangci-lint run -v + +test: install_deps lint $(info ******************** running tests ********************) richgo test -v ./... @@ -28,9 +36,5 @@ install_deps: $(info ******************** downloading dependencies ********************) go get -v ./... -vet: - $(info ******************** vetting ********************) - go vet ./... - clean: rm -rf $(BIN) diff --git a/vendor/github.com/spf13/cobra/README.md b/vendor/github.com/spf13/cobra/README.md index 9d79934260..a1b13ddda6 100644 --- a/vendor/github.com/spf13/cobra/README.md +++ b/vendor/github.com/spf13/cobra/README.md @@ -2,35 +2,15 @@ Cobra is both a library for creating powerful modern CLI applications as well as a program to generate applications and command files. -Many of the most widely used Go projects are built using Cobra, such as: -[Kubernetes](http://kubernetes.io/), -[Hugo](http://gohugo.io), -[rkt](https://github.com/coreos/rkt), -[etcd](https://github.com/coreos/etcd), -[Moby (former Docker)](https://github.com/moby/moby), -[Docker (distribution)](https://github.com/docker/distribution), -[OpenShift](https://www.openshift.com/), -[Delve](https://github.com/derekparker/delve), -[GopherJS](http://www.gopherjs.org/), -[CockroachDB](http://www.cockroachlabs.com/), -[Bleve](http://www.blevesearch.com/), -[ProjectAtomic (enterprise)](http://www.projectatomic.io/), -[Giant Swarm's gsctl](https://github.com/giantswarm/gsctl), -[Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack), -[rclone](http://rclone.org/), -[nehm](https://github.com/bogem/nehm), -[Pouch](https://github.com/alibaba/pouch), -[Istio](https://istio.io), -[Prototool](https://github.com/uber/prototool), -[mattermost-server](https://github.com/mattermost/mattermost-server), -[Gardener](https://github.com/gardener/gardenctl), -[Linkerd](https://linkerd.io/), -[Github CLI](https://github.com/cli/cli) -etc. +Cobra is used in many Go projects such as [Kubernetes](http://kubernetes.io/), +[Hugo](https://gohugo.io), and [Github CLI](https://github.com/cli/cli) to +name a few. [This list](./projects_using_cobra.md) contains a more extensive list of projects using Cobra. +[![](https://img.shields.io/github/workflow/status/spf13/cobra/Test?longCache=tru&label=Test&logo=github%20actions&logoColor=fff)](https://github.com/spf13/cobra/actions?query=workflow%3ATest) [![Build Status](https://travis-ci.org/spf13/cobra.svg "Travis CI status")](https://travis-ci.org/spf13/cobra) [![GoDoc](https://godoc.org/github.com/spf13/cobra?status.svg)](https://godoc.org/github.com/spf13/cobra) [![Go Report Card](https://goreportcard.com/badge/github.com/spf13/cobra)](https://goreportcard.com/report/github.com/spf13/cobra) +[![Slack](https://img.shields.io/badge/Slack-cobra-brightgreen)](https://gophers.slack.com/archives/CD3LP1199) # Table of Contents @@ -50,9 +30,8 @@ etc. * [PreRun and PostRun Hooks](#prerun-and-postrun-hooks) * [Suggestions when "unknown command" happens](#suggestions-when-unknown-command-happens) * [Generating documentation for your command](#generating-documentation-for-your-command) - * [Generating bash completions](#generating-bash-completions) - * [Generating zsh completions](#generating-zsh-completions) -- [Contributing](#contributing) + * [Generating shell completions](#generating-shell-completions) +- [Contributing](CONTRIBUTING.md) - [License](#license) # Overview @@ -72,7 +51,7 @@ Cobra provides: * Intelligent suggestions (`app srver`... did you mean `app server`?) * Automatic help generation for commands and flags * Automatic help flag recognition of `-h`, `--help`, etc. -* Automatically generated bash autocomplete for your application +* Automatically generated shell autocomplete for your application (bash, zsh, fish, powershell) * Automatically generated man pages for your application * Command aliases so you can change things without breaking them * The flexibility to define your own help, usage, etc. @@ -84,8 +63,8 @@ Cobra is built on a structure of commands, arguments & flags. **Commands** represent actions, **Args** are things and **Flags** are modifiers for those actions. -The best applications will read like sentences when used. Users will know how -to use the application because they will natively understand how to use it. +The best applications read like sentences when used, and as a result, users +intuitively know how to interact with them. The pattern to follow is `APPNAME VERB NOUN --ADJECTIVE.` @@ -130,7 +109,7 @@ Using Cobra is easy. First, use `go get` to install the latest version of the library. This command will install the `cobra` generator executable along with the library and its dependencies: - go get -u github.com/spf13/cobra/cobra + go get -u github.com/spf13/cobra Next, include Cobra in your application: @@ -199,7 +178,7 @@ var rootCmd = &cobra.Command{ func Execute() { if err := rootCmd.Execute(); err != nil { - fmt.Println(err) + fmt.Fprintln(os.Stderr, err) os.Exit(1) } } @@ -256,11 +235,6 @@ func init() { rootCmd.AddCommand(initCmd) } -func er(msg interface{}) { - fmt.Println("Error:", msg) - os.Exit(1) -} - func initConfig() { if cfgFile != "" { // Use config file from the flag. @@ -268,9 +242,7 @@ func initConfig() { } else { // Find home directory. home, err := homedir.Dir() - if err != nil { - er(err) - } + cobra.CheckErr(err) // Search config in home directory with name ".cobra" (without extension). viper.AddConfigPath(home) @@ -290,7 +262,7 @@ func initConfig() { With the root command you need to have your main function execute it. Execute should be run on the root for clarity, though it can be called on any command. -In a Cobra app, typically the main.go file is very bare. It serves, one purpose, to initialize Cobra. +In a Cobra app, typically the main.go file is very bare. It serves one purpose: to initialize Cobra. ```go package main @@ -335,6 +307,37 @@ var versionCmd = &cobra.Command{ } ``` +### Returning and handling errors + +If you wish to return an error to the caller of a command, `RunE` can be used. + +```go +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" +) + +func init() { + rootCmd.AddCommand(tryCmd) +} + +var tryCmd = &cobra.Command{ + Use: "try", + Short: "Try and possibly fail at something", + RunE: func(cmd *cobra.Command, args []string) error { + if err := someFunc(); err != nil { + return err + } + return nil + }, +} +``` + +The error can then be caught at the execute function call. + ## Working with Flags Flags provide modifiers to control how the action command operates. @@ -354,7 +357,7 @@ There are two different approaches to assign a flag. ### Persistent Flags -A flag can be 'persistent' meaning that this flag will be available to the +A flag can be 'persistent', meaning that this flag will be available to the command it's assigned to as well as every command under that command. For global flags, assign a flag as a persistent flag on the root. @@ -364,7 +367,7 @@ rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose out ### Local Flags -A flag can also be assigned locally which will only apply to that specific command. +A flag can also be assigned locally, which will only apply to that specific command. ```go localCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from") @@ -372,8 +375,8 @@ localCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to rea ### Local Flag on Parent Commands -By default Cobra only parses local flags on the target command, any local flags on -parent commands are ignored. By enabling `Command.TraverseChildren` Cobra will +By default, Cobra only parses local flags on the target command, and any local flags on +parent commands are ignored. By enabling `Command.TraverseChildren`, Cobra will parse local flags on each command before executing the target command. ```go @@ -395,8 +398,8 @@ func init() { } ``` -In this example the persistent flag `author` is bound with `viper`. -**Note**, that the variable `author` will not be set to the value from config, +In this example, the persistent flag `author` is bound with `viper`. +**Note**: the variable `author` will not be set to the value from config, when the `--author` flag is not provided by user. More in [viper documentation](https://github.com/spf13/viper#working-with-flags). @@ -410,6 +413,12 @@ rootCmd.Flags().StringVarP(&Region, "region", "r", "", "AWS region (required)") rootCmd.MarkFlagRequired("region") ``` +Or, for persistent flags: +```go +rootCmd.PersistentFlags().StringVarP(&Region, "region", "r", "", "AWS region (required)") +rootCmd.MarkPersistentFlagRequired("region") +``` + ## Positional and Custom Arguments Validation of positional arguments can be specified using the `Args` field @@ -450,7 +459,7 @@ var cmd = &cobra.Command{ In the example below, we have defined three commands. Two are at the top level and one (cmdTimes) is a child of one of the top commands. In this case the root -is not executable meaning that a subcommand is required. This is accomplished +is not executable, meaning that a subcommand is required. This is accomplished by not providing a 'Run' for the 'rootCmd'. We have only defined one flag for a single command. @@ -740,30 +749,11 @@ Run 'kubectl help' for usage. ## Generating documentation for your command -Cobra can generate documentation based on subcommands, flags, etc. in the following formats: - -- [Markdown](doc/md_docs.md) -- [ReStructured Text](doc/rest_docs.md) -- [Man Page](doc/man_docs.md) - -## Generating bash completions - -Cobra can generate a bash-completion file. If you add more information to your command, these completions can be amazingly powerful and flexible. Read more about it in [Bash Completions](bash_completions.md). - -## Generating zsh completions - -Cobra can generate zsh-completion file. Read more about it in -[Zsh Completions](zsh_completions.md). +Cobra can generate documentation based on subcommands, flags, etc. Read more about it in the [docs generation documentation](doc/README.md). -# Contributing +## Generating shell completions -1. Fork it -2. Download your fork to your PC (`git clone https://github.com/your_username/cobra && cd cobra`) -3. Create your feature branch (`git checkout -b my-new-feature`) -4. Make changes and add them (`git add .`) -5. Commit your changes (`git commit -m 'Add some feature'`) -6. Push to the branch (`git push origin my-new-feature`) -7. Create new pull request +Cobra can generate a shell-completion file for the following shells: bash, zsh, fish, PowerShell. If you add more information to your commands, these completions can be amazingly powerful and flexible. Read more about it in [Shell Completions](shell_completions.md). # License diff --git a/vendor/github.com/spf13/cobra/bash_completions.go b/vendor/github.com/spf13/cobra/bash_completions.go index 1e27188c3d..7106147937 100644 --- a/vendor/github.com/spf13/cobra/bash_completions.go +++ b/vendor/github.com/spf13/cobra/bash_completions.go @@ -19,9 +19,9 @@ const ( BashCompSubdirsInDir = "cobra_annotation_bash_completion_subdirs_in_dir" ) -func writePreamble(buf *bytes.Buffer, name string) { - buf.WriteString(fmt.Sprintf("# bash completion for %-36s -*- shell-script -*-\n", name)) - buf.WriteString(fmt.Sprintf(` +func writePreamble(buf io.StringWriter, name string) { + WriteStringAndCheck(buf, fmt.Sprintf("# bash completion for %-36s -*- shell-script -*-\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(` __%[1]s_debug() { if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then @@ -62,6 +62,12 @@ __%[1]s_handle_go_custom_completion() { __%[1]s_debug "${FUNCNAME[0]}: cur is ${cur}, words[*] is ${words[*]}, #words[@] is ${#words[@]}" + local shellCompDirectiveError=%[3]d + local shellCompDirectiveNoSpace=%[4]d + local shellCompDirectiveNoFileComp=%[5]d + local shellCompDirectiveFilterFileExt=%[6]d + local shellCompDirectiveFilterDirs=%[7]d + local out requestComp lastParam lastChar comp directive args # Prepare the command to request completions for the program. @@ -95,24 +101,50 @@ __%[1]s_handle_go_custom_completion() __%[1]s_debug "${FUNCNAME[0]}: the completion directive is: ${directive}" __%[1]s_debug "${FUNCNAME[0]}: the completions are: ${out[*]}" - if [ $((directive & %[3]d)) -ne 0 ]; then + if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then # Error code. No completion. __%[1]s_debug "${FUNCNAME[0]}: received error from custom completion go code" return else - if [ $((directive & %[4]d)) -ne 0 ]; then + if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then if [[ $(type -t compopt) = "builtin" ]]; then __%[1]s_debug "${FUNCNAME[0]}: activating no space" compopt -o nospace fi fi - if [ $((directive & %[5]d)) -ne 0 ]; then + if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then if [[ $(type -t compopt) = "builtin" ]]; then __%[1]s_debug "${FUNCNAME[0]}: activating no file completion" compopt +o default fi fi + fi + if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then + # File extension filtering + local fullFilter filter filteringCmd + # Do not use quotes around the $out variable or else newline + # characters will be kept. + for filter in ${out[*]}; do + fullFilter+="$filter|" + done + + filteringCmd="_filedir $fullFilter" + __%[1]s_debug "File filtering command: $filteringCmd" + $filteringCmd + elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then + # File completion for directories only + local subDir + # Use printf to strip any trailing newline + subdir=$(printf "%%s" "${out[0]}") + if [ -n "$subdir" ]; then + __%[1]s_debug "Listing directories in $subdir" + __%[1]s_handle_subdirs_in_dir_flag "$subdir" + else + __%[1]s_debug "Listing directories in ." + _filedir -d + fi + else while IFS='' read -r comp; do COMPREPLY+=("$comp") done < <(compgen -W "${out[*]}" -- "$cur") @@ -181,10 +213,9 @@ __%[1]s_handle_reply() local completions completions=("${commands[@]}") if [[ ${#must_have_one_noun[@]} -ne 0 ]]; then - completions=("${must_have_one_noun[@]}") + completions+=("${must_have_one_noun[@]}") elif [[ -n "${has_completion_function}" ]]; then # if a go completion function is provided, defer to that function - completions=() __%[1]s_handle_go_custom_completion fi if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then @@ -344,13 +375,15 @@ __%[1]s_handle_word() __%[1]s_handle_word } -`, name, ShellCompNoDescRequestCmd, ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp)) +`, name, ShellCompNoDescRequestCmd, + ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp, + ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs)) } -func writePostscript(buf *bytes.Buffer, name string) { +func writePostscript(buf io.StringWriter, name string) { name = strings.Replace(name, ":", "__", -1) - buf.WriteString(fmt.Sprintf("__start_%s()\n", name)) - buf.WriteString(fmt.Sprintf(`{ + WriteStringAndCheck(buf, fmt.Sprintf("__start_%s()\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(`{ local cur prev words cword declare -A flaghash 2>/dev/null || : declare -A aliashash 2>/dev/null || : @@ -377,33 +410,33 @@ func writePostscript(buf *bytes.Buffer, name string) { } `, name)) - buf.WriteString(fmt.Sprintf(`if [[ $(type -t compopt) = "builtin" ]]; then + WriteStringAndCheck(buf, fmt.Sprintf(`if [[ $(type -t compopt) = "builtin" ]]; then complete -o default -F __start_%s %s else complete -o default -o nospace -F __start_%s %s fi `, name, name, name, name)) - buf.WriteString("# ex: ts=4 sw=4 et filetype=sh\n") + WriteStringAndCheck(buf, "# ex: ts=4 sw=4 et filetype=sh\n") } -func writeCommands(buf *bytes.Buffer, cmd *Command) { - buf.WriteString(" commands=()\n") +func writeCommands(buf io.StringWriter, cmd *Command) { + WriteStringAndCheck(buf, " commands=()\n") for _, c := range cmd.Commands() { - if !c.IsAvailableCommand() || c == cmd.helpCommand { + if !c.IsAvailableCommand() && c != cmd.helpCommand { continue } - buf.WriteString(fmt.Sprintf(" commands+=(%q)\n", c.Name())) + WriteStringAndCheck(buf, fmt.Sprintf(" commands+=(%q)\n", c.Name())) writeCmdAliases(buf, c) } - buf.WriteString("\n") + WriteStringAndCheck(buf, "\n") } -func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]string, cmd *Command) { +func writeFlagHandler(buf io.StringWriter, name string, annotations map[string][]string, cmd *Command) { for key, value := range annotations { switch key { case BashCompFilenameExt: - buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) var ext string if len(value) > 0 { @@ -411,17 +444,18 @@ func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]s } else { ext = "_filedir" } - buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", ext)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", ext)) case BashCompCustom: - buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) + if len(value) > 0 { handlers := strings.Join(value, "; ") - buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", handlers)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", handlers)) } else { - buf.WriteString(" flags_completion+=(:)\n") + WriteStringAndCheck(buf, " flags_completion+=(:)\n") } case BashCompSubdirsInDir: - buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) var ext string if len(value) == 1 { @@ -429,45 +463,49 @@ func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]s } else { ext = "_filedir -d" } - buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", ext)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", ext)) } } } -func writeShortFlag(buf *bytes.Buffer, flag *pflag.Flag, cmd *Command) { +const cbn = "\")\n" + +func writeShortFlag(buf io.StringWriter, flag *pflag.Flag, cmd *Command) { name := flag.Shorthand format := " " if len(flag.NoOptDefVal) == 0 { format += "two_word_" } - format += "flags+=(\"-%s\")\n" - buf.WriteString(fmt.Sprintf(format, name)) + format += "flags+=(\"-%s" + cbn + WriteStringAndCheck(buf, fmt.Sprintf(format, name)) writeFlagHandler(buf, "-"+name, flag.Annotations, cmd) } -func writeFlag(buf *bytes.Buffer, flag *pflag.Flag, cmd *Command) { +func writeFlag(buf io.StringWriter, flag *pflag.Flag, cmd *Command) { name := flag.Name format := " flags+=(\"--%s" if len(flag.NoOptDefVal) == 0 { format += "=" } - format += "\")\n" - buf.WriteString(fmt.Sprintf(format, name)) + format += cbn + WriteStringAndCheck(buf, fmt.Sprintf(format, name)) if len(flag.NoOptDefVal) == 0 { - format = " two_word_flags+=(\"--%s\")\n" - buf.WriteString(fmt.Sprintf(format, name)) + format = " two_word_flags+=(\"--%s" + cbn + WriteStringAndCheck(buf, fmt.Sprintf(format, name)) } writeFlagHandler(buf, "--"+name, flag.Annotations, cmd) } -func writeLocalNonPersistentFlag(buf *bytes.Buffer, flag *pflag.Flag) { +func writeLocalNonPersistentFlag(buf io.StringWriter, flag *pflag.Flag) { name := flag.Name - format := " local_nonpersistent_flags+=(\"--%s" + format := " local_nonpersistent_flags+=(\"--%[1]s" + cbn if len(flag.NoOptDefVal) == 0 { - format += "=" + format += " local_nonpersistent_flags+=(\"--%[1]s=" + cbn + } + WriteStringAndCheck(buf, fmt.Sprintf(format, name)) + if len(flag.Shorthand) > 0 { + WriteStringAndCheck(buf, fmt.Sprintf(" local_nonpersistent_flags+=(\"-%s\")\n", flag.Shorthand)) } - format += "\")\n" - buf.WriteString(fmt.Sprintf(format, name)) } // Setup annotations for go completions for registered flags @@ -484,9 +522,9 @@ func prepareCustomAnnotationsForFlags(cmd *Command) { } } -func writeFlags(buf *bytes.Buffer, cmd *Command) { +func writeFlags(buf io.StringWriter, cmd *Command) { prepareCustomAnnotationsForFlags(cmd) - buf.WriteString(` flags=() + WriteStringAndCheck(buf, ` flags=() two_word_flags=() local_nonpersistent_flags=() flags_with_completion=() @@ -502,7 +540,9 @@ func writeFlags(buf *bytes.Buffer, cmd *Command) { if len(flag.Shorthand) > 0 { writeShortFlag(buf, flag, cmd) } - if localNonPersistentFlags.Lookup(flag.Name) != nil { + // localNonPersistentFlags are used to stop the completion of subcommands when one is set + // if TraverseChildren is true we should allow to complete subcommands + if localNonPersistentFlags.Lookup(flag.Name) != nil && !cmd.Root().TraverseChildren { writeLocalNonPersistentFlag(buf, flag) } }) @@ -516,11 +556,11 @@ func writeFlags(buf *bytes.Buffer, cmd *Command) { } }) - buf.WriteString("\n") + WriteStringAndCheck(buf, "\n") } -func writeRequiredFlag(buf *bytes.Buffer, cmd *Command) { - buf.WriteString(" must_have_one_flag=()\n") +func writeRequiredFlag(buf io.StringWriter, cmd *Command) { + WriteStringAndCheck(buf, " must_have_one_flag=()\n") flags := cmd.NonInheritedFlags() flags.VisitAll(func(flag *pflag.Flag) { if nonCompletableFlag(flag) { @@ -533,57 +573,57 @@ func writeRequiredFlag(buf *bytes.Buffer, cmd *Command) { if flag.Value.Type() != "bool" { format += "=" } - format += "\")\n" - buf.WriteString(fmt.Sprintf(format, flag.Name)) + format += cbn + WriteStringAndCheck(buf, fmt.Sprintf(format, flag.Name)) if len(flag.Shorthand) > 0 { - buf.WriteString(fmt.Sprintf(" must_have_one_flag+=(\"-%s\")\n", flag.Shorthand)) + WriteStringAndCheck(buf, fmt.Sprintf(" must_have_one_flag+=(\"-%s"+cbn, flag.Shorthand)) } } } }) } -func writeRequiredNouns(buf *bytes.Buffer, cmd *Command) { - buf.WriteString(" must_have_one_noun=()\n") - sort.Sort(sort.StringSlice(cmd.ValidArgs)) +func writeRequiredNouns(buf io.StringWriter, cmd *Command) { + WriteStringAndCheck(buf, " must_have_one_noun=()\n") + sort.Strings(cmd.ValidArgs) for _, value := range cmd.ValidArgs { // Remove any description that may be included following a tab character. // Descriptions are not supported by bash completion. value = strings.Split(value, "\t")[0] - buf.WriteString(fmt.Sprintf(" must_have_one_noun+=(%q)\n", value)) + WriteStringAndCheck(buf, fmt.Sprintf(" must_have_one_noun+=(%q)\n", value)) } if cmd.ValidArgsFunction != nil { - buf.WriteString(" has_completion_function=1\n") + WriteStringAndCheck(buf, " has_completion_function=1\n") } } -func writeCmdAliases(buf *bytes.Buffer, cmd *Command) { +func writeCmdAliases(buf io.StringWriter, cmd *Command) { if len(cmd.Aliases) == 0 { return } - sort.Sort(sort.StringSlice(cmd.Aliases)) + sort.Strings(cmd.Aliases) - buf.WriteString(fmt.Sprint(` if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then`, "\n")) + WriteStringAndCheck(buf, fmt.Sprint(` if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then`, "\n")) for _, value := range cmd.Aliases { - buf.WriteString(fmt.Sprintf(" command_aliases+=(%q)\n", value)) - buf.WriteString(fmt.Sprintf(" aliashash[%q]=%q\n", value, cmd.Name())) + WriteStringAndCheck(buf, fmt.Sprintf(" command_aliases+=(%q)\n", value)) + WriteStringAndCheck(buf, fmt.Sprintf(" aliashash[%q]=%q\n", value, cmd.Name())) } - buf.WriteString(` fi`) - buf.WriteString("\n") + WriteStringAndCheck(buf, ` fi`) + WriteStringAndCheck(buf, "\n") } -func writeArgAliases(buf *bytes.Buffer, cmd *Command) { - buf.WriteString(" noun_aliases=()\n") - sort.Sort(sort.StringSlice(cmd.ArgAliases)) +func writeArgAliases(buf io.StringWriter, cmd *Command) { + WriteStringAndCheck(buf, " noun_aliases=()\n") + sort.Strings(cmd.ArgAliases) for _, value := range cmd.ArgAliases { - buf.WriteString(fmt.Sprintf(" noun_aliases+=(%q)\n", value)) + WriteStringAndCheck(buf, fmt.Sprintf(" noun_aliases+=(%q)\n", value)) } } -func gen(buf *bytes.Buffer, cmd *Command) { +func gen(buf io.StringWriter, cmd *Command) { for _, c := range cmd.Commands() { - if !c.IsAvailableCommand() || c == cmd.helpCommand { + if !c.IsAvailableCommand() && c != cmd.helpCommand { continue } gen(buf, c) @@ -593,22 +633,22 @@ func gen(buf *bytes.Buffer, cmd *Command) { commandName = strings.Replace(commandName, ":", "__", -1) if cmd.Root() == cmd { - buf.WriteString(fmt.Sprintf("_%s_root_command()\n{\n", commandName)) + WriteStringAndCheck(buf, fmt.Sprintf("_%s_root_command()\n{\n", commandName)) } else { - buf.WriteString(fmt.Sprintf("_%s()\n{\n", commandName)) + WriteStringAndCheck(buf, fmt.Sprintf("_%s()\n{\n", commandName)) } - buf.WriteString(fmt.Sprintf(" last_command=%q\n", commandName)) - buf.WriteString("\n") - buf.WriteString(" command_aliases=()\n") - buf.WriteString("\n") + WriteStringAndCheck(buf, fmt.Sprintf(" last_command=%q\n", commandName)) + WriteStringAndCheck(buf, "\n") + WriteStringAndCheck(buf, " command_aliases=()\n") + WriteStringAndCheck(buf, "\n") writeCommands(buf, cmd) writeFlags(buf, cmd) writeRequiredFlag(buf, cmd) writeRequiredNouns(buf, cmd) writeArgAliases(buf, cmd) - buf.WriteString("}\n\n") + WriteStringAndCheck(buf, "}\n\n") } // GenBashCompletion generates bash completion file and writes to the passed writer. diff --git a/vendor/github.com/spf13/cobra/bash_completions.md b/vendor/github.com/spf13/cobra/bash_completions.md index e61a3a6546..130f99b923 100644 --- a/vendor/github.com/spf13/cobra/bash_completions.md +++ b/vendor/github.com/spf13/cobra/bash_completions.md @@ -1,206 +1,14 @@ -# Generating Bash Completions For Your Own cobra.Command +# Generating Bash Completions For Your cobra.Command -If you are using the generator you can create a completion command by running +Please refer to [Shell Completions](shell_completions.md) for details. -```bash -cobra add completion -``` - -Update the help text show how to install the bash_completion Linux show here [Kubectl docs show mac options](https://kubernetes.io/docs/tasks/tools/install-kubectl/#enabling-shell-autocompletion) - -Writing the shell script to stdout allows the most flexible use. - -```go -// completionCmd represents the completion command -var completionCmd = &cobra.Command{ - Use: "completion", - Short: "Generates bash completion scripts", - Long: `To load completion run - -. <(bitbucket completion) - -To configure your bash shell to load completions for each session add to your bashrc - -# ~/.bashrc or ~/.profile -. <(bitbucket completion) -`, - Run: func(cmd *cobra.Command, args []string) { - rootCmd.GenBashCompletion(os.Stdout); - }, -} -``` - -**Note:** The cobra generator may include messages printed to stdout for example if the config file is loaded, this will break the auto complete script - - -## Example from kubectl - -Generating bash completions from a cobra command is incredibly easy. An actual program which does so for the kubernetes kubectl binary is as follows: - -```go -package main - -import ( - "io/ioutil" - "os" - - "k8s.io/kubernetes/pkg/kubectl/cmd" - "k8s.io/kubernetes/pkg/kubectl/cmd/util" -) - -func main() { - kubectl := cmd.NewKubectlCommand(util.NewFactory(nil), os.Stdin, ioutil.Discard, ioutil.Discard) - kubectl.GenBashCompletionFile("out.sh") -} -``` - -`out.sh` will get you completions of subcommands and flags. Copy it to `/etc/bash_completion.d/` as described [here](https://debian-administration.org/article/316/An_introduction_to_bash_completion_part_1) and reset your terminal to use autocompletion. If you make additional annotations to your code, you can get even more intelligent and flexible behavior. - -## Have the completions code complete your 'nouns' - -### Static completion of nouns - -This method allows you to provide a pre-defined list of completion choices for your nouns using the `validArgs` field. -For example, if you want `kubectl get [tab][tab]` to show a list of valid "nouns" you have to set them. Simplified code from `kubectl get` looks like: - -```go -validArgs []string = { "pod", "node", "service", "replicationcontroller" } - -cmd := &cobra.Command{ - Use: "get [(-o|--output=)json|yaml|template|...] (RESOURCE [NAME] | RESOURCE/NAME ...)", - Short: "Display one or many resources", - Long: get_long, - Example: get_example, - Run: func(cmd *cobra.Command, args []string) { - err := RunGet(f, out, cmd, args) - util.CheckErr(err) - }, - ValidArgs: validArgs, -} -``` - -Notice we put the "ValidArgs" on the "get" subcommand. Doing so will give results like - -```bash -# kubectl get [tab][tab] -node pod replicationcontroller service -``` - -### Plural form and shortcuts for nouns - -If your nouns have a number of aliases, you can define them alongside `ValidArgs` using `ArgAliases`: - -```go -argAliases []string = { "pods", "nodes", "services", "svc", "replicationcontrollers", "rc" } - -cmd := &cobra.Command{ - ... - ValidArgs: validArgs, - ArgAliases: argAliases -} -``` - -The aliases are not shown to the user on tab completion, but they are accepted as valid nouns by -the completion algorithm if entered manually, e.g. in: - -```bash -# kubectl get rc [tab][tab] -backend frontend database -``` - -Note that without declaring `rc` as an alias, the completion algorithm would show the list of nouns -in this example again instead of the replication controllers. - -### Dynamic completion of nouns - -In some cases it is not possible to provide a list of possible completions in advance. Instead, the list of completions must be determined at execution-time. Cobra provides two ways of defining such dynamic completion of nouns. Note that both these methods can be used along-side each other as long as they are not both used for the same command. +## Bash legacy dynamic completions -**Note**: *Custom Completions written in Go* will automatically work for other shell-completion scripts (e.g., Fish shell), while *Custom Completions written in Bash* will only work for Bash shell-completion. It is therefore recommended to use *Custom Completions written in Go*. - -#### 1. Custom completions of nouns written in Go - -In a similar fashion as for static completions, you can use the `ValidArgsFunction` field to provide a Go function that Cobra will execute when it needs the list of completion choices for the nouns of a command. Note that either `ValidArgs` or `ValidArgsFunction` can be used for a single cobra command, but not both. -Simplified code from `helm status` looks like: - -```go -cmd := &cobra.Command{ - Use: "status RELEASE_NAME", - Short: "Display the status of the named release", - Long: status_long, - RunE: func(cmd *cobra.Command, args []string) { - RunGet(args[0]) - }, - ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { - if len(args) != 0 { - return nil, cobra.ShellCompDirectiveNoFileComp - } - return getReleasesFromCluster(toComplete), cobra.ShellCompDirectiveNoFileComp - }, -} -``` -Where `getReleasesFromCluster()` is a Go function that obtains the list of current Helm releases running on the Kubernetes cluster. -Notice we put the `ValidArgsFunction` on the `status` subcommand. Let's assume the Helm releases on the cluster are: `harbor`, `notary`, `rook` and `thanos` then this dynamic completion will give results like - -```bash -# helm status [tab][tab] -harbor notary rook thanos -``` -You may have noticed the use of `cobra.ShellCompDirective`. These directives are bit fields allowing to control some shell completion behaviors for your particular completion. You can combine them with the bit-or operator such as `cobra.ShellCompDirectiveNoSpace | cobra.ShellCompDirectiveNoFileComp` -```go -// Indicates an error occurred and completions should be ignored. -ShellCompDirectiveError -// Indicates that the shell should not add a space after the completion, -// even if there is a single completion provided. -ShellCompDirectiveNoSpace -// Indicates that the shell should not provide file completion even when -// no completion is provided. -// This currently does not work for zsh or bash < 4 -ShellCompDirectiveNoFileComp -// Indicates that the shell will perform its default behavior after completions -// have been provided (this implies !ShellCompDirectiveNoSpace && !ShellCompDirectiveNoFileComp). -ShellCompDirectiveDefault -``` +For backward compatibility, Cobra still supports its legacy dynamic completion solution (described below). Unlike the `ValidArgsFunction` solution, the legacy solution will only work for Bash shell-completion and not for other shells. This legacy solution can be used along-side `ValidArgsFunction` and `RegisterFlagCompletionFunc()`, as long as both solutions are not used for the same command. This provides a path to gradually migrate from the legacy solution to the new solution. -When using the `ValidArgsFunction`, Cobra will call your registered function after having parsed all flags and arguments provided in the command-line. You therefore don't need to do this parsing yourself. For example, when a user calls `helm status --namespace my-rook-ns [tab][tab]`, Cobra will call your registered `ValidArgsFunction` after having parsed the `--namespace` flag, as it would have done when calling the `RunE` function. +The legacy solution allows you to inject bash functions into the bash completion script. Those bash functions are responsible for providing the completion choices for your own completions. -##### Debugging - -Cobra achieves dynamic completions written in Go through the use of a hidden command called by the completion script. To debug your Go completion code, you can call this hidden command directly: -```bash -# helm __complete status har -harbor -:4 -Completion ended with directive: ShellCompDirectiveNoFileComp # This is on stderr -``` -***Important:*** If the noun to complete is empty, you must pass an empty parameter to the `__complete` command: -```bash -# helm __complete status "" -harbor -notary -rook -thanos -:4 -Completion ended with directive: ShellCompDirectiveNoFileComp # This is on stderr -``` -Calling the `__complete` command directly allows you to run the Go debugger to troubleshoot your code. You can also add printouts to your code; Cobra provides the following functions to use for printouts in Go completion code: -```go -// Prints to the completion script debug file (if BASH_COMP_DEBUG_FILE -// is set to a file path) and optionally prints to stderr. -cobra.CompDebug(msg string, printToStdErr bool) { -cobra.CompDebugln(msg string, printToStdErr bool) - -// Prints to the completion script debug file (if BASH_COMP_DEBUG_FILE -// is set to a file path) and to stderr. -cobra.CompError(msg string) -cobra.CompErrorln(msg string) -``` -***Important:*** You should **not** leave traces that print to stdout in your completion code as they will be interpreted as completion choices by the completion script. Instead, use the cobra-provided debugging traces functions mentioned above. - -#### 2. Custom completions of nouns written in Bash - -This method allows you to inject bash functions into the completion script. Those bash functions are responsible for providing the completion choices for your own completions. - -Some more actual code that works in kubernetes: +Some code that works in kubernetes: ```bash const ( @@ -253,93 +61,7 @@ Find more information at https://github.com/GoogleCloudPlatform/kubernetes.`, The `BashCompletionFunction` option is really only valid/useful on the root command. Doing the above will cause `__kubectl_custom_func()` (`___custom_func()`) to be called when the built in processor was unable to find a solution. In the case of kubernetes a valid command might look something like `kubectl get pod [mypod]`. If you type `kubectl get pod [tab][tab]` the `__kubectl_customc_func()` will run because the cobra.Command only understood "kubectl" and "get." `__kubectl_custom_func()` will see that the cobra.Command is "kubectl_get" and will thus call another helper `__kubectl_get_resource()`. `__kubectl_get_resource` will look at the 'nouns' collected. In our example the only noun will be `pod`. So it will call `__kubectl_parse_get pod`. `__kubectl_parse_get` will actually call out to kubernetes and get any pods. It will then set `COMPREPLY` to valid pods! -## Mark flags as required - -Most of the time completions will only show subcommands. But if a flag is required to make a subcommand work, you probably want it to show up when the user types [tab][tab]. Marking a flag as 'Required' is incredibly easy. - -```go -cmd.MarkFlagRequired("pod") -cmd.MarkFlagRequired("container") -``` - -and you'll get something like - -```bash -# kubectl exec [tab][tab][tab] --c --container= -p --pod= -``` - -# Specify valid filename extensions for flags that take a filename - -In this example we use --filename= and expect to get a json or yaml file as the argument. To make this easier we annotate the --filename flag with valid filename extensions. - -```go - annotations := []string{"json", "yaml", "yml"} - annotation := make(map[string][]string) - annotation[cobra.BashCompFilenameExt] = annotations - - flag := &pflag.Flag{ - Name: "filename", - Shorthand: "f", - Usage: usage, - Value: value, - DefValue: value.String(), - Annotations: annotation, - } - cmd.Flags().AddFlag(flag) -``` - -Now when you run a command with this filename flag you'll get something like - -```bash -# kubectl create -f -test/ example/ rpmbuild/ -hello.yml test.json -``` - -So while there are many other files in the CWD it only shows me subdirs and those with valid extensions. - -# Specify custom flag completion - -As for nouns, Cobra provides two ways of defining dynamic completion of flags. Note that both these methods can be used along-side each other as long as they are not both used for the same flag. - -**Note**: *Custom Completions written in Go* will automatically work for other shell-completion scripts (e.g., Fish shell), while *Custom Completions written in Bash* will only work for Bash shell-completion. It is therefore recommended to use *Custom Completions written in Go*. - -## 1. Custom completions of flags written in Go - -To provide a Go function that Cobra will execute when it needs the list of completion choices for a flag, you must register the function in the following manner: - -```go -flagName := "output" -cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { - return []string{"json", "table", "yaml"}, cobra.ShellCompDirectiveDefault -}) -``` -Notice that calling `RegisterFlagCompletionFunc()` is done through the `command` with which the flag is associated. In our example this dynamic completion will give results like so: - -```bash -# helm status --output [tab][tab] -json table yaml -``` - -### Debugging - -You can also easily debug your Go completion code for flags: -```bash -# helm __complete status --output "" -json -table -yaml -:4 -Completion ended with directive: ShellCompDirectiveNoFileComp # This is on stderr -``` -***Important:*** You should **not** leave traces that print to stdout in your completion code as they will be interpreted as completion choices by the completion script. Instead, use the cobra-provided debugging traces functions mentioned in the above section. - -## 2. Custom completions of flags written in Bash - -Alternatively, you can use bash code for flag custom completion. Similar to the filename -completion and filtering using `cobra.BashCompFilenameExt`, you can specify -a custom flag completion bash function with `cobra.BashCompCustom`: +Similarly, for flags: ```go annotation := make(map[string][]string) @@ -367,17 +89,3 @@ __kubectl_get_namespaces() fi } ``` -# Using bash aliases for commands - -You can also configure the `bash aliases` for the commands and they will also support completions. - -```bash -alias aliasname=origcommand -complete -o default -F __start_origcommand aliasname - -# and now when you run `aliasname` completion will make -# suggestions as it did for `origcommand`. - -$) aliasname -completion firstcommand secondcommand -``` diff --git a/vendor/github.com/spf13/cobra/cobra.go b/vendor/github.com/spf13/cobra/cobra.go index d01becc8fa..d6cbfd7198 100644 --- a/vendor/github.com/spf13/cobra/cobra.go +++ b/vendor/github.com/spf13/cobra/cobra.go @@ -19,6 +19,7 @@ package cobra import ( "fmt" "io" + "os" "reflect" "strconv" "strings" @@ -205,3 +206,17 @@ func stringInSlice(a string, list []string) bool { } return false } + +// CheckErr prints the msg with the prefix 'Error:' and exits with error code 1. If the msg is nil, it does nothing. +func CheckErr(msg interface{}) { + if msg != nil { + fmt.Fprintln(os.Stderr, "Error:", msg) + os.Exit(1) + } +} + +// WriteStringAndCheck writes a string into a buffer, and checks if the error is not nil. +func WriteStringAndCheck(b io.StringWriter, s string) { + _, err := b.WriteString(s) + CheckErr(err) +} diff --git a/vendor/github.com/spf13/cobra/command.go b/vendor/github.com/spf13/cobra/command.go index 88e6ed77d0..d6732ad115 100644 --- a/vendor/github.com/spf13/cobra/command.go +++ b/vendor/github.com/spf13/cobra/command.go @@ -37,6 +37,14 @@ type FParseErrWhitelist flag.ParseErrorsWhitelist // definition to ensure usability. type Command struct { // Use is the one-line usage message. + // Recommended syntax is as follow: + // [ ] identifies an optional argument. Arguments that are not enclosed in brackets are required. + // ... indicates that you can specify multiple values for the previous argument. + // | indicates mutually exclusive information. You can use the argument to the left of the separator or the + // argument to the right of the separator. You cannot use both arguments in a single use of the command. + // { } delimits a set of mutually exclusive arguments when one of the arguments is required. If the arguments are + // optional, they are enclosed in brackets ([ ]). + // Example: add [-F file | -D dir]... [-f format] profile Use string // Aliases is an array of aliases that can be used instead of the first word in Use. @@ -76,9 +84,6 @@ type Command struct { // Deprecated defines, if this command is deprecated and should print this string when used. Deprecated string - // Hidden defines, if this command is hidden and should NOT show up in the list of available commands. - Hidden bool - // Annotations are key/value pairs that can be used by applications to identify or // group commands. Annotations map[string]string @@ -118,55 +123,6 @@ type Command struct { // PersistentPostRunE: PersistentPostRun but returns an error. PersistentPostRunE func(cmd *Command, args []string) error - // SilenceErrors is an option to quiet errors down stream. - SilenceErrors bool - - // SilenceUsage is an option to silence usage when an error occurs. - SilenceUsage bool - - // DisableFlagParsing disables the flag parsing. - // If this is true all flags will be passed to the command as arguments. - DisableFlagParsing bool - - // DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") - // will be printed by generating docs for this command. - DisableAutoGenTag bool - - // DisableFlagsInUseLine will disable the addition of [flags] to the usage - // line of a command when printing help or generating docs - DisableFlagsInUseLine bool - - // DisableSuggestions disables the suggestions based on Levenshtein distance - // that go along with 'unknown command' messages. - DisableSuggestions bool - // SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. - // Must be > 0. - SuggestionsMinimumDistance int - - // TraverseChildren parses flags on all parents before executing child command. - TraverseChildren bool - - // FParseErrWhitelist flag parse errors to be ignored - FParseErrWhitelist FParseErrWhitelist - - ctx context.Context - - // commands is the list of commands supported by this program. - commands []*Command - // parent is a parent command for this command. - parent *Command - // Max lengths of commands' string lengths for use in padding. - commandsMaxUseLen int - commandsMaxCommandPathLen int - commandsMaxNameLen int - // commandsAreSorted defines, if command slice are sorted or not. - commandsAreSorted bool - // commandCalledAs is the name or alias value used to call this command. - commandCalledAs struct { - name string - called bool - } - // args is actual args parsed from flags. args []string // flagErrorBuf contains all error messages from pflag. @@ -208,6 +164,60 @@ type Command struct { outWriter io.Writer // errWriter is a writer defined by the user that replaces stderr errWriter io.Writer + + //FParseErrWhitelist flag parse errors to be ignored + FParseErrWhitelist FParseErrWhitelist + + // commandsAreSorted defines, if command slice are sorted or not. + commandsAreSorted bool + // commandCalledAs is the name or alias value used to call this command. + commandCalledAs struct { + name string + called bool + } + + ctx context.Context + + // commands is the list of commands supported by this program. + commands []*Command + // parent is a parent command for this command. + parent *Command + // Max lengths of commands' string lengths for use in padding. + commandsMaxUseLen int + commandsMaxCommandPathLen int + commandsMaxNameLen int + + // TraverseChildren parses flags on all parents before executing child command. + TraverseChildren bool + + // Hidden defines, if this command is hidden and should NOT show up in the list of available commands. + Hidden bool + + // SilenceErrors is an option to quiet errors down stream. + SilenceErrors bool + + // SilenceUsage is an option to silence usage when an error occurs. + SilenceUsage bool + + // DisableFlagParsing disables the flag parsing. + // If this is true all flags will be passed to the command as arguments. + DisableFlagParsing bool + + // DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") + // will be printed by generating docs for this command. + DisableAutoGenTag bool + + // DisableFlagsInUseLine will disable the addition of [flags] to the usage + // line of a command when printing help or generating docs + DisableFlagsInUseLine bool + + // DisableSuggestions disables the suggestions based on Levenshtein distance + // that go along with 'unknown command' messages. + DisableSuggestions bool + + // SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. + // Must be > 0. + SuggestionsMinimumDistance int } // Context returns underlying command context. If command wasn't @@ -359,7 +369,7 @@ func (c *Command) UsageFunc() (f func(*Command) error) { c.mergePersistentFlags() err := tmpl(c.OutOrStderr(), c.UsageTemplate(), c) if err != nil { - c.Println(err) + c.PrintErrln(err) } return err } @@ -387,7 +397,7 @@ func (c *Command) HelpFunc() func(*Command, []string) { // See https://github.com/spf13/cobra/issues/1002 err := tmpl(c.OutOrStdout(), c.HelpTemplate(), c) if err != nil { - c.Println(err) + c.PrintErrln(err) } } } @@ -410,7 +420,7 @@ func (c *Command) UsageString() string { c.outWriter = bb c.errWriter = bb - c.Usage() + CheckErr(c.Usage()) // Setting things back to normal c.outWriter = tmpOutput @@ -930,8 +940,8 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { c = cmd } if !c.SilenceErrors { - c.Println("Error:", err.Error()) - c.Printf("Run '%v --help' for usage.\n", c.CommandPath()) + c.PrintErrln("Error:", err.Error()) + c.PrintErrf("Run '%v --help' for usage.\n", c.CommandPath()) } return c, err } @@ -956,13 +966,13 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { return cmd, nil } - // If root command has SilentErrors flagged, + // If root command has SilenceErrors flagged, // all subcommands should respect it if !cmd.SilenceErrors && !c.SilenceErrors { - c.Println("Error:", err.Error()) + c.PrintErrln("Error:", err.Error()) } - // If root command has SilentUsage flagged, + // If root command has SilenceUsage flagged, // all subcommands should respect it if !cmd.SilenceUsage && !c.SilenceUsage { c.Println(cmd.UsageString()) @@ -979,6 +989,10 @@ func (c *Command) ValidateArgs(args []string) error { } func (c *Command) validateRequiredFlags() error { + if c.DisableFlagParsing { + return nil + } + flags := c.Flags() missingFlagNames := []string{} flags.VisitAll(func(pflag *flag.Flag) { @@ -1052,15 +1066,33 @@ func (c *Command) InitDefaultHelpCmd() { Short: "Help about any command", Long: `Help provides help for any command in the application. Simply type ` + c.Name() + ` help [path to command] for full details.`, - + ValidArgsFunction: func(c *Command, args []string, toComplete string) ([]string, ShellCompDirective) { + var completions []string + cmd, _, e := c.Root().Find(args) + if e != nil { + return nil, ShellCompDirectiveNoFileComp + } + if cmd == nil { + // Root help command. + cmd = c.Root() + } + for _, subCmd := range cmd.Commands() { + if subCmd.IsAvailableCommand() || subCmd == cmd.helpCommand { + if strings.HasPrefix(subCmd.Name(), toComplete) { + completions = append(completions, fmt.Sprintf("%s\t%s", subCmd.Name(), subCmd.Short)) + } + } + } + return completions, ShellCompDirectiveNoFileComp + }, Run: func(c *Command, args []string) { cmd, _, e := c.Root().Find(args) if cmd == nil || e != nil { c.Printf("Unknown help topic %#q\n", args) - c.Root().Usage() + CheckErr(c.Root().Usage()) } else { cmd.InitDefaultHelpFlag() // make possible 'help' flag to be shown - cmd.Help() + CheckErr(cmd.Help()) } }, } @@ -1179,12 +1211,12 @@ func (c *Command) PrintErr(i ...interface{}) { // PrintErrln is a convenience method to Println to the defined Err output, fallback to Stderr if not set. func (c *Command) PrintErrln(i ...interface{}) { - c.Print(fmt.Sprintln(i...)) + c.PrintErr(fmt.Sprintln(i...)) } // PrintErrf is a convenience method to Printf to the defined Err output, fallback to Stderr if not set. func (c *Command) PrintErrf(format string, i ...interface{}) { - c.Print(fmt.Sprintf(format, i...)) + c.PrintErr(fmt.Sprintf(format, i...)) } // CommandPath returns the full path to this command. diff --git a/vendor/github.com/spf13/cobra/custom_completions.go b/vendor/github.com/spf13/cobra/custom_completions.go index ba57327c15..fa060c147b 100644 --- a/vendor/github.com/spf13/cobra/custom_completions.go +++ b/vendor/github.com/spf13/cobra/custom_completions.go @@ -1,7 +1,6 @@ package cobra import ( - "errors" "fmt" "os" "strings" @@ -38,8 +37,29 @@ const ( // This currently does not work for zsh or bash < 4 ShellCompDirectiveNoFileComp + // ShellCompDirectiveFilterFileExt indicates that the provided completions + // should be used as file extension filters. + // For flags, using Command.MarkFlagFilename() and Command.MarkPersistentFlagFilename() + // is a shortcut to using this directive explicitly. The BashCompFilenameExt + // annotation can also be used to obtain the same behavior for flags. + ShellCompDirectiveFilterFileExt + + // ShellCompDirectiveFilterDirs indicates that only directory names should + // be provided in file completion. To request directory names within another + // directory, the returned completions should specify the directory within + // which to search. The BashCompSubdirsInDir annotation can be used to + // obtain the same behavior but only for flags. + ShellCompDirectiveFilterDirs + + // =========================================================================== + + // All directives using iota should be above this one. + // For internal use. + shellCompDirectiveMaxValue + // ShellCompDirectiveDefault indicates to let the shell perform its default // behavior after completions have been provided. + // This one must be last to avoid messing up the iota count. ShellCompDirectiveDefault ShellCompDirective = 0 ) @@ -68,11 +88,17 @@ func (d ShellCompDirective) string() string { if d&ShellCompDirectiveNoFileComp != 0 { directives = append(directives, "ShellCompDirectiveNoFileComp") } + if d&ShellCompDirectiveFilterFileExt != 0 { + directives = append(directives, "ShellCompDirectiveFilterFileExt") + } + if d&ShellCompDirectiveFilterDirs != 0 { + directives = append(directives, "ShellCompDirectiveFilterDirs") + } if len(directives) == 0 { directives = append(directives, "ShellCompDirectiveDefault") } - if d > ShellCompDirectiveError+ShellCompDirectiveNoSpace+ShellCompDirectiveNoFileComp { + if d >= shellCompDirectiveMaxValue { return fmt.Sprintf("ERROR: unexpected ShellCompDirective value: %d", d) } return strings.Join(directives, ", ") @@ -105,11 +131,25 @@ func (c *Command) initCompleteCmd(args []string) { // Remove any description that may be included following a tab character. comp = strings.Split(comp, "\t")[0] } + + // Make sure we only write the first line to the output. + // This is needed if a description contains a linebreak. + // Otherwise the shell scripts will interpret the other lines as new flags + // and could therefore provide a wrong completion. + comp = strings.Split(comp, "\n")[0] + + // Finally trim the completion. This is especially important to get rid + // of a trailing tab when there are no description following it. + // For example, a sub-command without a description should not be completed + // with a tab at the end (or else zsh will show a -- following it + // although there is no description). + comp = strings.TrimSpace(comp) + // Print each possible completion to stdout for the completion script to consume. fmt.Fprintln(finalCmd.OutOrStdout(), comp) } - if directive > ShellCompDirectiveError+ShellCompDirectiveNoSpace+ShellCompDirectiveNoFileComp { + if directive >= shellCompDirectiveMaxValue { directive = ShellCompDirectiveDefault } @@ -136,90 +176,179 @@ func (c *Command) initCompleteCmd(args []string) { } func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDirective, error) { - var completions []string - // The last argument, which is not completely typed by the user, // should not be part of the list of arguments toComplete := args[len(args)-1] trimmedArgs := args[:len(args)-1] + var finalCmd *Command + var finalArgs []string + var err error // Find the real command for which completion must be performed - finalCmd, finalArgs, err := c.Root().Find(trimmedArgs) + // check if we need to traverse here to parse local flags on parent commands + if c.Root().TraverseChildren { + finalCmd, finalArgs, err = c.Root().Traverse(trimmedArgs) + } else { + finalCmd, finalArgs, err = c.Root().Find(trimmedArgs) + } if err != nil { // Unable to find the real command. E.g., someInvalidCmd - return c, completions, ShellCompDirectiveDefault, fmt.Errorf("Unable to find a command for arguments: %v", trimmedArgs) + return c, []string{}, ShellCompDirectiveDefault, fmt.Errorf("Unable to find a command for arguments: %v", trimmedArgs) + } + + // Check if we are doing flag value completion before parsing the flags. + // This is important because if we are completing a flag value, we need to also + // remove the flag name argument from the list of finalArgs or else the parsing + // could fail due to an invalid value (incomplete) for the flag. + flag, finalArgs, toComplete, err := checkIfFlagCompletion(finalCmd, finalArgs, toComplete) + if err != nil { + // Error while attempting to parse flags + return finalCmd, []string{}, ShellCompDirectiveDefault, err + } + + // Parse the flags early so we can check if required flags are set + if err = finalCmd.ParseFlags(finalArgs); err != nil { + return finalCmd, []string{}, ShellCompDirectiveDefault, fmt.Errorf("Error while parsing flags from args %v: %s", finalArgs, err.Error()) + } + + if flag != nil { + // Check if we are completing a flag value subject to annotations + if validExts, present := flag.Annotations[BashCompFilenameExt]; present { + if len(validExts) != 0 { + // File completion filtered by extensions + return finalCmd, validExts, ShellCompDirectiveFilterFileExt, nil + } + + // The annotation requests simple file completion. There is no reason to do + // that since it is the default behavior anyway. Let's ignore this annotation + // in case the program also registered a completion function for this flag. + // Even though it is a mistake on the program's side, let's be nice when we can. + } + + if subDir, present := flag.Annotations[BashCompSubdirsInDir]; present { + if len(subDir) == 1 { + // Directory completion from within a directory + return finalCmd, subDir, ShellCompDirectiveFilterDirs, nil + } + // Directory completion + return finalCmd, []string{}, ShellCompDirectiveFilterDirs, nil + } } // When doing completion of a flag name, as soon as an argument starts with // a '-' we know it is a flag. We cannot use isFlagArg() here as it requires - // the flag to be complete - if len(toComplete) > 0 && toComplete[0] == '-' && !strings.Contains(toComplete, "=") { - // We are completing a flag name - finalCmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) { - completions = append(completions, getFlagNameCompletions(flag, toComplete)...) - }) - finalCmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) { - completions = append(completions, getFlagNameCompletions(flag, toComplete)...) - }) - - directive := ShellCompDirectiveDefault - if len(completions) > 0 { - if strings.HasSuffix(completions[0], "=") { - directive = ShellCompDirectiveNoSpace + // the flag name to be complete + if flag == nil && len(toComplete) > 0 && toComplete[0] == '-' && !strings.Contains(toComplete, "=") { + var completions []string + + // First check for required flags + completions = completeRequireFlags(finalCmd, toComplete) + + // If we have not found any required flags, only then can we show regular flags + if len(completions) == 0 { + doCompleteFlags := func(flag *pflag.Flag) { + if !flag.Changed || + strings.Contains(flag.Value.Type(), "Slice") || + strings.Contains(flag.Value.Type(), "Array") { + // If the flag is not already present, or if it can be specified multiple times (Array or Slice) + // we suggest it as a completion + completions = append(completions, getFlagNameCompletions(flag, toComplete)...) + } } + + // We cannot use finalCmd.Flags() because we may not have called ParsedFlags() for commands + // that have set DisableFlagParsing; it is ParseFlags() that merges the inherited and + // non-inherited flags. + finalCmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) { + doCompleteFlags(flag) + }) + finalCmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) { + doCompleteFlags(flag) + }) + } + + directive := ShellCompDirectiveNoFileComp + if len(completions) == 1 && strings.HasSuffix(completions[0], "=") { + // If there is a single completion, the shell usually adds a space + // after the completion. We don't want that if the flag ends with an = + directive = ShellCompDirectiveNoSpace } return finalCmd, completions, directive, nil } - var flag *pflag.Flag + // We only remove the flags from the arguments if DisableFlagParsing is not set. + // This is important for commands which have requested to do their own flag completion. if !finalCmd.DisableFlagParsing { - // We only do flag completion if we are allowed to parse flags - // This is important for commands which have requested to do their own flag completion. - flag, finalArgs, toComplete, err = checkIfFlagCompletion(finalCmd, finalArgs, toComplete) - if err != nil { - // Error while attempting to parse flags - return finalCmd, completions, ShellCompDirectiveDefault, err - } + finalArgs = finalCmd.Flags().Args() } + var completions []string + directive := ShellCompDirectiveDefault if flag == nil { - // Complete subcommand names - for _, subCmd := range finalCmd.Commands() { - if subCmd.IsAvailableCommand() && strings.HasPrefix(subCmd.Name(), toComplete) { - completions = append(completions, fmt.Sprintf("%s\t%s", subCmd.Name(), subCmd.Short)) + foundLocalNonPersistentFlag := false + // If TraverseChildren is true on the root command we don't check for + // local flags because we can use a local flag on a parent command + if !finalCmd.Root().TraverseChildren { + // Check if there are any local, non-persistent flags on the command-line + localNonPersistentFlags := finalCmd.LocalNonPersistentFlags() + finalCmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) { + if localNonPersistentFlags.Lookup(flag.Name) != nil && flag.Changed { + foundLocalNonPersistentFlag = true + } + }) + } + + // Complete subcommand names, including the help command + if len(finalArgs) == 0 && !foundLocalNonPersistentFlag { + // We only complete sub-commands if: + // - there are no arguments on the command-line and + // - there are no local, non-peristent flag on the command-line or TraverseChildren is true + for _, subCmd := range finalCmd.Commands() { + if subCmd.IsAvailableCommand() || subCmd == finalCmd.helpCommand { + if strings.HasPrefix(subCmd.Name(), toComplete) { + completions = append(completions, fmt.Sprintf("%s\t%s", subCmd.Name(), subCmd.Short)) + } + directive = ShellCompDirectiveNoFileComp + } } } + // Complete required flags even without the '-' prefix + completions = append(completions, completeRequireFlags(finalCmd, toComplete)...) + + // Always complete ValidArgs, even if we are completing a subcommand name. + // This is for commands that have both subcommands and ValidArgs. if len(finalCmd.ValidArgs) > 0 { - // Always complete ValidArgs, even if we are completing a subcommand name. - // This is for commands that have both subcommands and ValidArgs. - for _, validArg := range finalCmd.ValidArgs { - if strings.HasPrefix(validArg, toComplete) { - completions = append(completions, validArg) + if len(finalArgs) == 0 { + // ValidArgs are only for the first argument + for _, validArg := range finalCmd.ValidArgs { + if strings.HasPrefix(validArg, toComplete) { + completions = append(completions, validArg) + } + } + directive = ShellCompDirectiveNoFileComp + + // If no completions were found within commands or ValidArgs, + // see if there are any ArgAliases that should be completed. + if len(completions) == 0 { + for _, argAlias := range finalCmd.ArgAliases { + if strings.HasPrefix(argAlias, toComplete) { + completions = append(completions, argAlias) + } + } } } // If there are ValidArgs specified (even if they don't match), we stop completion. // Only one of ValidArgs or ValidArgsFunction can be used for a single command. - return finalCmd, completions, ShellCompDirectiveNoFileComp, nil + return finalCmd, completions, directive, nil } - // Always let the logic continue so as to add any ValidArgsFunction completions, + // Let the logic continue so as to add any ValidArgsFunction completions, // even if we already found sub-commands. // This is for commands that have subcommands but also specify a ValidArgsFunction. } - // Parse the flags and extract the arguments to prepare for calling the completion function - if err = finalCmd.ParseFlags(finalArgs); err != nil { - return finalCmd, completions, ShellCompDirectiveDefault, fmt.Errorf("Error while parsing flags from args %v: %s", finalArgs, err.Error()) - } - - // We only remove the flags from the arguments if DisableFlagParsing is not set. - // This is important for commands which have requested to do their own flag completion. - if !finalCmd.DisableFlagParsing { - finalArgs = finalCmd.Flags().Args() - } - // Find the completion function for the flag or command var completionFn func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) if flag != nil { @@ -227,14 +356,14 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi } else { completionFn = finalCmd.ValidArgsFunction } - if completionFn == nil { - // Go custom completion not supported/needed for this flag or command - return finalCmd, completions, ShellCompDirectiveDefault, nil + if completionFn != nil { + // Go custom completion defined for this flag or command. + // Call the registered completion function to get the completions. + var comps []string + comps, directive = completionFn(finalCmd, finalArgs, toComplete) + completions = append(completions, comps...) } - // Call the registered completion function to get the completions - comps, directive := completionFn(finalCmd, finalArgs, toComplete) - completions = append(completions, comps...) return finalCmd, completions, directive, nil } @@ -249,11 +378,18 @@ func getFlagNameCompletions(flag *pflag.Flag, toComplete string) []string { // Flag without the = completions = append(completions, fmt.Sprintf("%s\t%s", flagName, flag.Usage)) - if len(flag.NoOptDefVal) == 0 { - // Flag requires a value, so it can be suffixed with = - flagName += "=" - completions = append(completions, fmt.Sprintf("%s\t%s", flagName, flag.Usage)) - } + // Why suggest both long forms: --flag and --flag= ? + // This forces the user to *always* have to type either an = or a space after the flag name. + // Let's be nice and avoid making users have to do that. + // Since boolean flags and shortname flags don't show the = form, let's go that route and never show it. + // The = form will still work, we just won't suggest it. + // This also makes the list of suggested flags shorter as we avoid all the = forms. + // + // if len(flag.NoOptDefVal) == 0 { + // // Flag requires a value, so it can be suffixed with = + // flagName += "=" + // completions = append(completions, fmt.Sprintf("%s\t%s", flagName, flag.Usage)) + // } } flagName = "-" + flag.Shorthand @@ -264,17 +400,54 @@ func getFlagNameCompletions(flag *pflag.Flag, toComplete string) []string { return completions } +func completeRequireFlags(finalCmd *Command, toComplete string) []string { + var completions []string + + doCompleteRequiredFlags := func(flag *pflag.Flag) { + if _, present := flag.Annotations[BashCompOneRequiredFlag]; present { + if !flag.Changed { + // If the flag is not already present, we suggest it as a completion + completions = append(completions, getFlagNameCompletions(flag, toComplete)...) + } + } + } + + // We cannot use finalCmd.Flags() because we may not have called ParsedFlags() for commands + // that have set DisableFlagParsing; it is ParseFlags() that merges the inherited and + // non-inherited flags. + finalCmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) { + doCompleteRequiredFlags(flag) + }) + finalCmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) { + doCompleteRequiredFlags(flag) + }) + + return completions +} + func checkIfFlagCompletion(finalCmd *Command, args []string, lastArg string) (*pflag.Flag, []string, string, error) { + if finalCmd.DisableFlagParsing { + // We only do flag completion if we are allowed to parse flags + // This is important for commands which have requested to do their own flag completion. + return nil, args, lastArg, nil + } + var flagName string trimmedArgs := args flagWithEqual := false - if isFlagArg(lastArg) { + + // When doing completion of a flag name, as soon as an argument starts with + // a '-' we know it is a flag. We cannot use isFlagArg() here as that function + // requires the flag name to be complete + if len(lastArg) > 0 && lastArg[0] == '-' { if index := strings.Index(lastArg, "="); index >= 0 { + // Flag with an = flagName = strings.TrimLeft(lastArg[:index], "-") lastArg = lastArg[index+1:] flagWithEqual = true } else { - return nil, nil, "", errors.New("Unexpected completion request for flag") + // Normal flag completion + return nil, args, lastArg, nil } } @@ -354,13 +527,13 @@ func CompDebug(msg string, printToStdErr bool) { os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err == nil { defer f.Close() - f.WriteString(msg) + WriteStringAndCheck(f, msg) } } if printToStdErr { // Must print to stderr for this not to be read by the completion script. - fmt.Fprintf(os.Stderr, msg) + fmt.Fprint(os.Stderr, msg) } } diff --git a/vendor/github.com/spf13/cobra/fish_completions.go b/vendor/github.com/spf13/cobra/fish_completions.go index c83609c83b..3e112347d7 100644 --- a/vendor/github.com/spf13/cobra/fish_completions.go +++ b/vendor/github.com/spf13/cobra/fish_completions.go @@ -5,15 +5,21 @@ import ( "fmt" "io" "os" + "strings" ) -func genFishComp(buf *bytes.Buffer, name string, includeDesc bool) { +func genFishComp(buf io.StringWriter, name string, includeDesc bool) { + // Variables should not contain a '-' or ':' character + nameForVar := name + nameForVar = strings.Replace(nameForVar, "-", "_", -1) + nameForVar = strings.Replace(nameForVar, ":", "_", -1) + compCmd := ShellCompRequestCmd if !includeDesc { compCmd = ShellCompNoDescRequestCmd } - buf.WriteString(fmt.Sprintf("# fish completion for %-36s -*- shell-script -*-\n", name)) - buf.WriteString(fmt.Sprintf(` + WriteStringAndCheck(buf, fmt.Sprintf("# fish completion for %-36s -*- shell-script -*-\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(` function __%[1]s_debug set file "$BASH_COMP_DEBUG_FILE" if test -n "$file" @@ -37,7 +43,13 @@ function __%[1]s_perform_completion end __%[1]s_debug "emptyArg: $emptyArg" - set requestComp "$args[1] %[2]s $args[2..-1] $emptyArg" + if not type -q "$args[1]" + # This can happen when "complete --do-complete %[2]s" is called when running this script. + __%[1]s_debug "Cannot find $args[1]. No completions." + return + end + + set requestComp "$args[1] %[3]s $args[2..-1] $emptyArg" __%[1]s_debug "Calling $requestComp" set results (eval $requestComp 2> /dev/null) @@ -71,7 +83,8 @@ function __%[1]s_prepare_completions # Check if the command-line is already provided. This is useful for testing. if not set --query __%[1]s_comp_commandLine - set __%[1]s_comp_commandLine (commandline) + # Use the -c flag to allow for completion in the middle of the line + set __%[1]s_comp_commandLine (commandline -c) end __%[1]s_debug "commandLine is: $__%[1]s_comp_commandLine" @@ -83,7 +96,7 @@ function __%[1]s_prepare_completions __%[1]s_debug "No completion, probably due to a failure" # Might as well do file completion, in case it helps set --global __%[1]s_comp_do_file_comp 1 - return 0 + return 1 end set directive (string sub --start 2 $results[-1]) @@ -92,20 +105,35 @@ function __%[1]s_prepare_completions __%[1]s_debug "Completions are: $__%[1]s_comp_results" __%[1]s_debug "Directive is: $directive" + set shellCompDirectiveError %[4]d + set shellCompDirectiveNoSpace %[5]d + set shellCompDirectiveNoFileComp %[6]d + set shellCompDirectiveFilterFileExt %[7]d + set shellCompDirectiveFilterDirs %[8]d + if test -z "$directive" set directive 0 end - set compErr (math (math --scale 0 $directive / %[3]d) %% 2) + set compErr (math (math --scale 0 $directive / $shellCompDirectiveError) %% 2) if test $compErr -eq 1 __%[1]s_debug "Received error directive: aborting." # Might as well do file completion, in case it helps set --global __%[1]s_comp_do_file_comp 1 - return 0 + return 1 end - set nospace (math (math --scale 0 $directive / %[4]d) %% 2) - set nofiles (math (math --scale 0 $directive / %[5]d) %% 2) + set filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) %% 2) + set dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) %% 2) + if test $filefilter -eq 1; or test $dirfilter -eq 1 + __%[1]s_debug "File extension filtering or directory filtering not supported" + # Do full file completion instead + set --global __%[1]s_comp_do_file_comp 1 + return 1 + end + + set nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) %% 2) + set nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) %% 2) __%[1]s_debug "nospace: $nospace, nofiles: $nofiles" @@ -132,24 +160,31 @@ function __%[1]s_prepare_completions return (not set --query __%[1]s_comp_do_file_comp) end -# Remove any pre-existing completions for the program since we will be handling all of them -# TODO this cleanup is not sufficient. Fish completions are only loaded once the user triggers -# them, so the below deletion will not work as it is run too early. What else can we do? -complete -c %[1]s -e +# Since Fish completions are only loaded once the user triggers them, we trigger them ourselves +# so we can properly delete any completions provided by another script. +# The space after the the program name is essential to trigger completion for the program +# and not completion of the program name itself. +complete --do-complete "%[2]s " > /dev/null 2>&1 +# Using '> /dev/null 2>&1' since '&>' is not supported in older versions of fish. + +# Remove any pre-existing completions for the program since we will be handling all of them. +complete -c %[2]s -e # The order in which the below two lines are defined is very important so that __%[1]s_prepare_completions # is called first. It is __%[1]s_prepare_completions that sets up the __%[1]s_comp_do_file_comp variable. # # This completion will be run second as complete commands are added FILO. # It triggers file completion choices when __%[1]s_comp_do_file_comp is set. -complete -c %[1]s -n 'set --query __%[1]s_comp_do_file_comp' +complete -c %[2]s -n 'set --query __%[1]s_comp_do_file_comp' # This completion will be run first as complete commands are added FILO. -# The call to __%[1]s_prepare_completions will setup both __%[1]s_comp_results abd __%[1]s_comp_do_file_comp. +# The call to __%[1]s_prepare_completions will setup both __%[1]s_comp_results and __%[1]s_comp_do_file_comp. # It provides the program's completion choices. -complete -c %[1]s -n '__%[1]s_prepare_completions' -f -a '$__%[1]s_comp_results' +complete -c %[2]s -n '__%[1]s_prepare_completions' -f -a '$__%[1]s_comp_results' -`, name, compCmd, ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp)) +`, nameForVar, name, compCmd, + ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp, + ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs)) } // GenFishCompletion generates fish completion file and writes to the passed writer. diff --git a/vendor/github.com/spf13/cobra/fish_completions.md b/vendor/github.com/spf13/cobra/fish_completions.md index 6bfe5f88ef..19b2ed1293 100644 --- a/vendor/github.com/spf13/cobra/fish_completions.md +++ b/vendor/github.com/spf13/cobra/fish_completions.md @@ -1,7 +1,4 @@ -## Generating Fish Completions for your own cobra.Command +## Generating Fish Completions For Your cobra.Command -Cobra supports native Fish completions generated from the root `cobra.Command`. You can use the `command.GenFishCompletion()` or `command.GenFishCompletionFile()` functions. You must provide these functions with a parameter indicating if the completions should be annotated with a description; Cobra will provide the description automatically based on usage information. You can choose to make this option configurable by your users. +Please refer to [Shell Completions](shell_completions.md) for details. -### Limitations - -* Custom completions implemented using the `ValidArgsFunction` and `RegisterFlagCompletionFunc()` are supported automatically but the ones implemented in Bash scripting are not. diff --git a/vendor/github.com/spf13/cobra/go.mod b/vendor/github.com/spf13/cobra/go.mod index dea1030ba4..ff56144056 100644 --- a/vendor/github.com/spf13/cobra/go.mod +++ b/vendor/github.com/spf13/cobra/go.mod @@ -6,7 +6,7 @@ require ( github.com/cpuguy83/go-md2man/v2 v2.0.0 github.com/inconshreveable/mousetrap v1.0.0 github.com/mitchellh/go-homedir v1.1.0 - github.com/spf13/pflag v1.0.3 - github.com/spf13/viper v1.4.0 - gopkg.in/yaml.v2 v2.2.2 + github.com/spf13/pflag v1.0.5 + github.com/spf13/viper v1.7.0 + gopkg.in/yaml.v2 v2.4.0 ) diff --git a/vendor/github.com/spf13/cobra/go.sum b/vendor/github.com/spf13/cobra/go.sum index 3aaa2ac0fd..9328ee3ee7 100644 --- a/vendor/github.com/spf13/cobra/go.sum +++ b/vendor/github.com/spf13/cobra/go.sum @@ -1,28 +1,48 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= @@ -32,19 +52,55 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -55,20 +111,34 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -79,11 +149,18 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +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= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= @@ -92,58 +169,145 @@ github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.4.0 h1:yXHLWeravcrgGyFSyCgdYpXQ9dR9c/WED3pg1RhxqEU= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.7.0 h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/vendor/github.com/spf13/cobra/powershell_completions.go b/vendor/github.com/spf13/cobra/powershell_completions.go index 756c61b9dc..c55be71cd1 100644 --- a/vendor/github.com/spf13/cobra/powershell_completions.go +++ b/vendor/github.com/spf13/cobra/powershell_completions.go @@ -1,6 +1,3 @@ -// PowerShell completions are based on the amazing work from clap: -// https://github.com/clap-rs/clap/blob/3294d18efe5f264d12c9035f404c7d189d4824e1/src/completions/powershell.rs -// // The generated scripts require PowerShell v5.0+ (which comes Windows 10, but // can be downloaded separately for windows 7 or 8.1). @@ -11,90 +8,278 @@ import ( "fmt" "io" "os" - "strings" - - "github.com/spf13/pflag" ) -var powerShellCompletionTemplate = `using namespace System.Management.Automation -using namespace System.Management.Automation.Language -Register-ArgumentCompleter -Native -CommandName '%s' -ScriptBlock { - param($wordToComplete, $commandAst, $cursorPosition) - $commandElements = $commandAst.CommandElements - $command = @( - '%s' - for ($i = 1; $i -lt $commandElements.Count; $i++) { - $element = $commandElements[$i] - if ($element -isnot [StringConstantExpressionAst] -or - $element.StringConstantType -ne [StringConstantType]::BareWord -or - $element.Value.StartsWith('-')) { - break - } - $element.Value - } - ) -join ';' - $completions = @(switch ($command) {%s - }) - $completions.Where{ $_.CompletionText -like "$wordToComplete*" } | - Sort-Object -Property ListItemText -}` - -func generatePowerShellSubcommandCases(out io.Writer, cmd *Command, previousCommandName string) { - var cmdName string - if previousCommandName == "" { - cmdName = cmd.Name() - } else { - cmdName = fmt.Sprintf("%s;%s", previousCommandName, cmd.Name()) - } - - fmt.Fprintf(out, "\n '%s' {", cmdName) - - cmd.Flags().VisitAll(func(flag *pflag.Flag) { - if nonCompletableFlag(flag) { - return - } - usage := escapeStringForPowerShell(flag.Usage) - if len(flag.Shorthand) > 0 { - fmt.Fprintf(out, "\n [CompletionResult]::new('-%s', '%s', [CompletionResultType]::ParameterName, '%s')", flag.Shorthand, flag.Shorthand, usage) - } - fmt.Fprintf(out, "\n [CompletionResult]::new('--%s', '%s', [CompletionResultType]::ParameterName, '%s')", flag.Name, flag.Name, usage) - }) - - for _, subCmd := range cmd.Commands() { - usage := escapeStringForPowerShell(subCmd.Short) - fmt.Fprintf(out, "\n [CompletionResult]::new('%s', '%s', [CompletionResultType]::ParameterValue, '%s')", subCmd.Name(), subCmd.Name(), usage) +func genPowerShellComp(buf io.StringWriter, name string, includeDesc bool) { + compCmd := ShellCompRequestCmd + if !includeDesc { + compCmd = ShellCompNoDescRequestCmd } + WriteStringAndCheck(buf, fmt.Sprintf(`# powershell completion for %-36[1]s -*- shell-script -*- - fmt.Fprint(out, "\n break\n }") - - for _, subCmd := range cmd.Commands() { - generatePowerShellSubcommandCases(out, subCmd, cmdName) - } +function __%[1]s_debug { + if ($env:BASH_COMP_DEBUG_FILE) { + "$args" | Out-File -Append -FilePath "$env:BASH_COMP_DEBUG_FILE" + } } -func escapeStringForPowerShell(s string) string { - return strings.Replace(s, "'", "''", -1) +filter __%[1]s_escapeStringWithSpecialChars { +`+" $_ -replace '\\s|#|@|\\$|;|,|''|\\{|\\}|\\(|\\)|\"|`|\\||<|>|&','`$&'"+` } -// GenPowerShellCompletion generates PowerShell completion file and writes to the passed writer. -func (c *Command) GenPowerShellCompletion(w io.Writer) error { - buf := new(bytes.Buffer) +Register-ArgumentCompleter -CommandName '%[1]s' -ScriptBlock { + param( + $WordToComplete, + $CommandAst, + $CursorPosition + ) + + # Get the current command line and convert into a string + $Command = $CommandAst.CommandElements + $Command = "$Command" + + __%[1]s_debug "" + __%[1]s_debug "========= starting completion logic ==========" + __%[1]s_debug "WordToComplete: $WordToComplete Command: $Command CursorPosition: $CursorPosition" + + # The user could have moved the cursor backwards on the command-line. + # We need to trigger completion from the $CursorPosition location, so we need + # to truncate the command-line ($Command) up to the $CursorPosition location. + # Make sure the $Command is longer then the $CursorPosition before we truncate. + # This happens because the $Command does not include the last space. + if ($Command.Length -gt $CursorPosition) { + $Command=$Command.Substring(0,$CursorPosition) + } + __%[1]s_debug "Truncated command: $Command" + + $ShellCompDirectiveError=%[3]d + $ShellCompDirectiveNoSpace=%[4]d + $ShellCompDirectiveNoFileComp=%[5]d + $ShellCompDirectiveFilterFileExt=%[6]d + $ShellCompDirectiveFilterDirs=%[7]d + + # Prepare the command to request completions for the program. + # Split the command at the first space to separate the program and arguments. + $Program,$Arguments = $Command.Split(" ",2) + $RequestComp="$Program %[2]s $Arguments" + __%[1]s_debug "RequestComp: $RequestComp" + + # we cannot use $WordToComplete because it + # has the wrong values if the cursor was moved + # so use the last argument + if ($WordToComplete -ne "" ) { + $WordToComplete = $Arguments.Split(" ")[-1] + } + __%[1]s_debug "New WordToComplete: $WordToComplete" + + + # Check for flag with equal sign + $IsEqualFlag = ($WordToComplete -Like "--*=*" ) + if ( $IsEqualFlag ) { + __%[1]s_debug "Completing equal sign flag" + # Remove the flag part + $Flag,$WordToComplete = $WordToComplete.Split("=",2) + } + + if ( $WordToComplete -eq "" -And ( -Not $IsEqualFlag )) { + # If the last parameter is complete (there is a space following it) + # We add an extra empty parameter so we can indicate this to the go method. + __%[1]s_debug "Adding extra empty parameter" +`+" # We need to use `\"`\" to pass an empty argument a \"\" or '' does not work!!!"+` +`+" $RequestComp=\"$RequestComp\" + ' `\"`\"' "+` + } + + __%[1]s_debug "Calling $RequestComp" + #call the command store the output in $out and redirect stderr and stdout to null + # $Out is an array contains each line per element + Invoke-Expression -OutVariable out "$RequestComp" 2>&1 | Out-Null + + + # get directive from last line + [int]$Directive = $Out[-1].TrimStart(':') + if ($Directive -eq "") { + # There is no directive specified + $Directive = 0 + } + __%[1]s_debug "The completion directive is: $Directive" + + # remove directive (last element) from out + $Out = $Out | Where-Object { $_ -ne $Out[-1] } + __%[1]s_debug "The completions are: $Out" + + if (($Directive -band $ShellCompDirectiveError) -ne 0 ) { + # Error code. No completion. + __%[1]s_debug "Received error from custom completion go code" + return + } + + $Longest = 0 + $Values = $Out | ForEach-Object { + #Split the output in name and description +`+" $Name, $Description = $_.Split(\"`t\",2)"+` + __%[1]s_debug "Name: $Name Description: $Description" + + # Look for the longest completion so that we can format things nicely + if ($Longest -lt $Name.Length) { + $Longest = $Name.Length + } + + # Set the description to a one space string if there is none set. + # This is needed because the CompletionResult does not accept an empty string as argument + if (-Not $Description) { + $Description = " " + } + @{Name="$Name";Description="$Description"} + } + + + $Space = " " + if (($Directive -band $ShellCompDirectiveNoSpace) -ne 0 ) { + # remove the space here + __%[1]s_debug "ShellCompDirectiveNoSpace is called" + $Space = "" + } + + if (($Directive -band $ShellCompDirectiveNoFileComp) -ne 0 ) { + __%[1]s_debug "ShellCompDirectiveNoFileComp is called" + + if ($Values.Length -eq 0) { + # Just print an empty string here so the + # shell does not start to complete paths. + # We cannot use CompletionResult here because + # it does not accept an empty string as argument. + "" + return + } + } + + if ((($Directive -band $ShellCompDirectiveFilterFileExt) -ne 0 ) -or + (($Directive -band $ShellCompDirectiveFilterDirs) -ne 0 )) { + __%[1]s_debug "ShellCompDirectiveFilterFileExt ShellCompDirectiveFilterDirs are not supported" + + # return here to prevent the completion of the extensions + return + } - var subCommandCases bytes.Buffer - generatePowerShellSubcommandCases(&subCommandCases, c, "") - fmt.Fprintf(buf, powerShellCompletionTemplate, c.Name(), c.Name(), subCommandCases.String()) + $Values = $Values | Where-Object { + # filter the result + $_.Name -like "$WordToComplete*" + # Join the flag back if we have a equal sign flag + if ( $IsEqualFlag ) { + __%[1]s_debug "Join the equal sign flag back to the completion value" + $_.Name = $Flag + "=" + $_.Name + } + } + + # Get the current mode + $Mode = (Get-PSReadLineKeyHandler | Where-Object {$_.Key -eq "Tab" }).Function + __%[1]s_debug "Mode: $Mode" + + $Values | ForEach-Object { + + # store temporay because switch will overwrite $_ + $comp = $_ + + # PowerShell supports three different completion modes + # - TabCompleteNext (default windows style - on each key press the next option is displayed) + # - Complete (works like bash) + # - MenuComplete (works like zsh) + # You set the mode with Set-PSReadLineKeyHandler -Key Tab -Function + + # CompletionResult Arguments: + # 1) CompletionText text to be used as the auto completion result + # 2) ListItemText text to be displayed in the suggestion list + # 3) ResultType type of completion result + # 4) ToolTip text for the tooltip with details about the object + + switch ($Mode) { + + # bash like + "Complete" { + + if ($Values.Length -eq 1) { + __%[1]s_debug "Only one completion left" + + # insert space after value + [System.Management.Automation.CompletionResult]::new($($comp.Name | __%[1]s_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + + } else { + # Add the proper number of spaces to align the descriptions + while($comp.Name.Length -lt $Longest) { + $comp.Name = $comp.Name + " " + } + + # Check for empty description and only add parentheses if needed + if ($($comp.Description) -eq " " ) { + $Description = "" + } else { + $Description = " ($($comp.Description))" + } + + [System.Management.Automation.CompletionResult]::new("$($comp.Name)$Description", "$($comp.Name)$Description", 'ParameterValue', "$($comp.Description)") + } + } + + # zsh like + "MenuComplete" { + # insert space after value + # MenuComplete will automatically show the ToolTip of + # the highlighted value at the bottom of the suggestions. + [System.Management.Automation.CompletionResult]::new($($comp.Name | __%[1]s_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + } + + # TabCompleteNext and in case we get something unknown + Default { + # Like MenuComplete but we don't want to add a space here because + # the user need to press space anyway to get the completion. + # Description will not be shown because thats not possible with TabCompleteNext + [System.Management.Automation.CompletionResult]::new($($comp.Name | __%[1]s_escapeStringWithSpecialChars), "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + } + } + + } +} +`, name, compCmd, + ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp, + ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs)) +} + +func (c *Command) genPowerShellCompletion(w io.Writer, includeDesc bool) error { + buf := new(bytes.Buffer) + genPowerShellComp(buf, c.Name(), includeDesc) _, err := buf.WriteTo(w) return err } -// GenPowerShellCompletionFile generates PowerShell completion file. -func (c *Command) GenPowerShellCompletionFile(filename string) error { +func (c *Command) genPowerShellCompletionFile(filename string, includeDesc bool) error { outFile, err := os.Create(filename) if err != nil { return err } defer outFile.Close() - return c.GenPowerShellCompletion(outFile) + return c.genPowerShellCompletion(outFile, includeDesc) +} + +// GenPowerShellCompletionFile generates powershell completion file without descriptions. +func (c *Command) GenPowerShellCompletionFile(filename string) error { + return c.genPowerShellCompletionFile(filename, false) +} + +// GenPowerShellCompletion generates powershell completion file without descriptions +// and writes it to the passed writer. +func (c *Command) GenPowerShellCompletion(w io.Writer) error { + return c.genPowerShellCompletion(w, false) +} + +// GenPowerShellCompletionFileWithDesc generates powershell completion file with descriptions. +func (c *Command) GenPowerShellCompletionFileWithDesc(filename string) error { + return c.genPowerShellCompletionFile(filename, true) +} + +// GenPowerShellCompletionWithDesc generates powershell completion file with descriptions +// and writes it to the passed writer. +func (c *Command) GenPowerShellCompletionWithDesc(w io.Writer) error { + return c.genPowerShellCompletion(w, true) } diff --git a/vendor/github.com/spf13/cobra/powershell_completions.md b/vendor/github.com/spf13/cobra/powershell_completions.md index afed802408..c449f1e5c0 100644 --- a/vendor/github.com/spf13/cobra/powershell_completions.md +++ b/vendor/github.com/spf13/cobra/powershell_completions.md @@ -1,14 +1,3 @@ # Generating PowerShell Completions For Your Own cobra.Command -Cobra can generate PowerShell completion scripts. Users need PowerShell version 5.0 or above, which comes with Windows 10 and can be downloaded separately for Windows 7 or 8.1. They can then write the completions to a file and source this file from their PowerShell profile, which is referenced by the `$Profile` environment variable. See `Get-Help about_Profiles` for more info about PowerShell profiles. - -# What's supported - -- Completion for subcommands using their `.Short` description -- Completion for non-hidden flags using their `.Name` and `.Shorthand` - -# What's not yet supported - -- Command aliases -- Required, filename or custom flags (they will work like normal flags) -- Custom completion scripts +Please refer to [Shell Completions](shell_completions.md#powershell-completions) for details. diff --git a/vendor/github.com/spf13/cobra/projects_using_cobra.md b/vendor/github.com/spf13/cobra/projects_using_cobra.md new file mode 100644 index 0000000000..d98a71e36f --- /dev/null +++ b/vendor/github.com/spf13/cobra/projects_using_cobra.md @@ -0,0 +1,38 @@ +## Projects using Cobra + +- [Arduino CLI](https://github.com/arduino/arduino-cli) +- [Bleve](http://www.blevesearch.com/) +- [CockroachDB](http://www.cockroachlabs.com/) +- [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) +- [Delve](https://github.com/derekparker/delve) +- [Docker (distribution)](https://github.com/docker/distribution) +- [Etcd](https://etcd.io/) +- [Gardener](https://github.com/gardener/gardenctl) +- [Giant Swarm's gsctl](https://github.com/giantswarm/gsctl) +- [Git Bump](https://github.com/erdaltsksn/git-bump) +- [Github CLI](https://github.com/cli/cli) +- [GitHub Labeler](https://github.com/erdaltsksn/gh-label) +- [Golangci-lint](https://golangci-lint.run) +- [GopherJS](http://www.gopherjs.org/) +- [Helm](https://helm.sh) +- [Hugo](https://gohugo.io) +- [Istio](https://istio.io) +- [Kool](https://github.com/kool-dev/kool) +- [Kubernetes](http://kubernetes.io/) +- [Linkerd](https://linkerd.io/) +- [Mattermost-server](https://github.com/mattermost/mattermost-server) +- [Metal Stack CLI](https://github.com/metal-stack/metalctl) +- [Moby (former Docker)](https://github.com/moby/moby) +- [Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack) +- [OpenShift](https://www.openshift.com/) +- [Ory Hydra](https://github.com/ory/hydra) +- [Ory Kratos](https://github.com/ory/kratos) +- [Pouch](https://github.com/alibaba/pouch) +- [ProjectAtomic (enterprise)](http://www.projectatomic.io/) +- [Prototool](https://github.com/uber/prototool) +- [Random](https://github.com/erdaltsksn/random) +- [Rclone](https://rclone.org/) +- [Skaffold](https://skaffold.dev/) +- [Tendermint](https://github.com/tendermint/tendermint) +- [Twitch CLI](https://github.com/twitchdev/twitch-cli) +- [Werf](https://werf.io/) diff --git a/vendor/github.com/spf13/cobra/shell_completions.go b/vendor/github.com/spf13/cobra/shell_completions.go index ba0af9cb55..d99bf91e5f 100644 --- a/vendor/github.com/spf13/cobra/shell_completions.go +++ b/vendor/github.com/spf13/cobra/shell_completions.go @@ -4,82 +4,81 @@ import ( "github.com/spf13/pflag" ) -// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag if it exists, +// MarkFlagRequired instructs the various shell completion implementations to +// prioritize the named flag when performing completion, // and causes your command to report an error if invoked without the flag. func (c *Command) MarkFlagRequired(name string) error { return MarkFlagRequired(c.Flags(), name) } -// MarkPersistentFlagRequired adds the BashCompOneRequiredFlag annotation to the named persistent flag if it exists, +// MarkPersistentFlagRequired instructs the various shell completion implementations to +// prioritize the named persistent flag when performing completion, // and causes your command to report an error if invoked without the flag. func (c *Command) MarkPersistentFlagRequired(name string) error { return MarkFlagRequired(c.PersistentFlags(), name) } -// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag if it exists, +// MarkFlagRequired instructs the various shell completion implementations to +// prioritize the named flag when performing completion, // and causes your command to report an error if invoked without the flag. func MarkFlagRequired(flags *pflag.FlagSet, name string) error { return flags.SetAnnotation(name, BashCompOneRequiredFlag, []string{"true"}) } -// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag, if it exists. -// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided. +// MarkFlagFilename instructs the various shell completion implementations to +// limit completions for the named flag to the specified file extensions. func (c *Command) MarkFlagFilename(name string, extensions ...string) error { return MarkFlagFilename(c.Flags(), name, extensions...) } // MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists. -// Generated bash autocompletion will call the bash function f for the flag. +// The bash completion script will call the bash function f for the flag. +// +// This will only work for bash completion. +// It is recommended to instead use c.RegisterFlagCompletionFunc(...) which allows +// to register a Go function which will work across all shells. func (c *Command) MarkFlagCustom(name string, f string) error { return MarkFlagCustom(c.Flags(), name, f) } // MarkPersistentFlagFilename instructs the various shell completion -// implementations to limit completions for this persistent flag to the -// specified extensions (patterns). -// -// Shell Completion compatibility matrix: bash, zsh +// implementations to limit completions for the named persistent flag to the +// specified file extensions. func (c *Command) MarkPersistentFlagFilename(name string, extensions ...string) error { return MarkFlagFilename(c.PersistentFlags(), name, extensions...) } // MarkFlagFilename instructs the various shell completion implementations to -// limit completions for this flag to the specified extensions (patterns). -// -// Shell Completion compatibility matrix: bash, zsh +// limit completions for the named flag to the specified file extensions. func MarkFlagFilename(flags *pflag.FlagSet, name string, extensions ...string) error { return flags.SetAnnotation(name, BashCompFilenameExt, extensions) } -// MarkFlagCustom instructs the various shell completion implementations to -// limit completions for this flag to the specified extensions (patterns). +// MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists. +// The bash completion script will call the bash function f for the flag. // -// Shell Completion compatibility matrix: bash, zsh +// This will only work for bash completion. +// It is recommended to instead use c.RegisterFlagCompletionFunc(...) which allows +// to register a Go function which will work across all shells. func MarkFlagCustom(flags *pflag.FlagSet, name string, f string) error { return flags.SetAnnotation(name, BashCompCustom, []string{f}) } // MarkFlagDirname instructs the various shell completion implementations to -// complete only directories with this named flag. -// -// Shell Completion compatibility matrix: zsh +// limit completions for the named flag to directory names. func (c *Command) MarkFlagDirname(name string) error { return MarkFlagDirname(c.Flags(), name) } // MarkPersistentFlagDirname instructs the various shell completion -// implementations to complete only directories with this persistent named flag. -// -// Shell Completion compatibility matrix: zsh +// implementations to limit completions for the named persistent flag to +// directory names. func (c *Command) MarkPersistentFlagDirname(name string) error { return MarkFlagDirname(c.PersistentFlags(), name) } // MarkFlagDirname instructs the various shell completion implementations to -// complete only directories with this specified flag. -// -// Shell Completion compatibility matrix: zsh +// limit completions for the named flag to directory names. func MarkFlagDirname(flags *pflag.FlagSet, name string) error { - zshPattern := "-(/)" - return flags.SetAnnotation(name, zshCompDirname, []string{zshPattern}) + return flags.SetAnnotation(name, BashCompSubdirsInDir, []string{}) } diff --git a/vendor/github.com/spf13/cobra/shell_completions.md b/vendor/github.com/spf13/cobra/shell_completions.md new file mode 100644 index 0000000000..cd533ac3d4 --- /dev/null +++ b/vendor/github.com/spf13/cobra/shell_completions.md @@ -0,0 +1,483 @@ +# Generating shell completions + +Cobra can generate shell completions for multiple shells. +The currently supported shells are: +- Bash +- Zsh +- fish +- PowerShell + +If you are using the generator, you can create a completion command by running + +```bash +cobra add completion +``` +and then modifying the generated `cmd/completion.go` file to look something like this +(writing the shell script to stdout allows the most flexible use): + +```go +var completionCmd = &cobra.Command{ + Use: "completion [bash|zsh|fish|powershell]", + Short: "Generate completion script", + Long: `To load completions: + +Bash: + + $ source <(yourprogram completion bash) + + # To load completions for each session, execute once: + # Linux: + $ yourprogram completion bash > /etc/bash_completion.d/yourprogram + # macOS: + $ yourprogram completion bash > /usr/local/etc/bash_completion.d/yourprogram + +Zsh: + + # If shell completion is not already enabled in your environment, + # you will need to enable it. You can execute the following once: + + $ echo "autoload -U compinit; compinit" >> ~/.zshrc + + # To load completions for each session, execute once: + $ yourprogram completion zsh > "${fpath[1]}/_yourprogram" + + # You will need to start a new shell for this setup to take effect. + +fish: + + $ yourprogram completion fish | source + + # To load completions for each session, execute once: + $ yourprogram completion fish > ~/.config/fish/completions/yourprogram.fish + +PowerShell: + + PS> yourprogram completion powershell | Out-String | Invoke-Expression + + # To load completions for every new session, run: + PS> yourprogram completion powershell > yourprogram.ps1 + # and source this file from your PowerShell profile. +`, + DisableFlagsInUseLine: true, + ValidArgs: []string{"bash", "zsh", "fish", "powershell"}, + Args: cobra.ExactValidArgs(1), + Run: func(cmd *cobra.Command, args []string) { + switch args[0] { + case "bash": + cmd.Root().GenBashCompletion(os.Stdout) + case "zsh": + cmd.Root().GenZshCompletion(os.Stdout) + case "fish": + cmd.Root().GenFishCompletion(os.Stdout, true) + case "powershell": + cmd.Root().GenPowerShellCompletion(os.Stdout) + } + }, +} +``` + +**Note:** The cobra generator may include messages printed to stdout, for example, if the config file is loaded; this will break the auto-completion script so must be removed. + +# Customizing completions + +The generated completion scripts will automatically handle completing commands and flags. However, you can make your completions much more powerful by providing information to complete your program's nouns and flag values. + +## Completion of nouns + +### Static completion of nouns + +Cobra allows you to provide a pre-defined list of completion choices for your nouns using the `ValidArgs` field. +For example, if you want `kubectl get [tab][tab]` to show a list of valid "nouns" you have to set them. +Some simplified code from `kubectl get` looks like: + +```go +validArgs []string = { "pod", "node", "service", "replicationcontroller" } + +cmd := &cobra.Command{ + Use: "get [(-o|--output=)json|yaml|template|...] (RESOURCE [NAME] | RESOURCE/NAME ...)", + Short: "Display one or many resources", + Long: get_long, + Example: get_example, + Run: func(cmd *cobra.Command, args []string) { + cobra.CheckErr(RunGet(f, out, cmd, args)) + }, + ValidArgs: validArgs, +} +``` + +Notice we put the `ValidArgs` field on the `get` sub-command. Doing so will give results like: + +```bash +$ kubectl get [tab][tab] +node pod replicationcontroller service +``` + +#### Aliases for nouns + +If your nouns have aliases, you can define them alongside `ValidArgs` using `ArgAliases`: + +```go +argAliases []string = { "pods", "nodes", "services", "svc", "replicationcontrollers", "rc" } + +cmd := &cobra.Command{ + ... + ValidArgs: validArgs, + ArgAliases: argAliases +} +``` + +The aliases are not shown to the user on tab completion, but they are accepted as valid nouns by +the completion algorithm if entered manually, e.g. in: + +```bash +$ kubectl get rc [tab][tab] +backend frontend database +``` + +Note that without declaring `rc` as an alias, the completion algorithm would not know to show the list of +replication controllers following `rc`. + +### Dynamic completion of nouns + +In some cases it is not possible to provide a list of completions in advance. Instead, the list of completions must be determined at execution-time. In a similar fashion as for static completions, you can use the `ValidArgsFunction` field to provide a Go function that Cobra will execute when it needs the list of completion choices for the nouns of a command. Note that either `ValidArgs` or `ValidArgsFunction` can be used for a single cobra command, but not both. +Simplified code from `helm status` looks like: + +```go +cmd := &cobra.Command{ + Use: "status RELEASE_NAME", + Short: "Display the status of the named release", + Long: status_long, + RunE: func(cmd *cobra.Command, args []string) { + RunGet(args[0]) + }, + ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + if len(args) != 0 { + return nil, cobra.ShellCompDirectiveNoFileComp + } + return getReleasesFromCluster(toComplete), cobra.ShellCompDirectiveNoFileComp + }, +} +``` +Where `getReleasesFromCluster()` is a Go function that obtains the list of current Helm releases running on the Kubernetes cluster. +Notice we put the `ValidArgsFunction` on the `status` sub-command. Let's assume the Helm releases on the cluster are: `harbor`, `notary`, `rook` and `thanos` then this dynamic completion will give results like: + +```bash +$ helm status [tab][tab] +harbor notary rook thanos +``` +You may have noticed the use of `cobra.ShellCompDirective`. These directives are bit fields allowing to control some shell completion behaviors for your particular completion. You can combine them with the bit-or operator such as `cobra.ShellCompDirectiveNoSpace | cobra.ShellCompDirectiveNoFileComp` +```go +// Indicates that the shell will perform its default behavior after completions +// have been provided (this implies none of the other directives). +ShellCompDirectiveDefault + +// Indicates an error occurred and completions should be ignored. +ShellCompDirectiveError + +// Indicates that the shell should not add a space after the completion, +// even if there is a single completion provided. +ShellCompDirectiveNoSpace + +// Indicates that the shell should not provide file completion even when +// no completion is provided. +ShellCompDirectiveNoFileComp + +// Indicates that the returned completions should be used as file extension filters. +// For example, to complete only files of the form *.json or *.yaml: +// return []string{"yaml", "json"}, ShellCompDirectiveFilterFileExt +// For flags, using MarkFlagFilename() and MarkPersistentFlagFilename() +// is a shortcut to using this directive explicitly. +// +ShellCompDirectiveFilterFileExt + +// Indicates that only directory names should be provided in file completion. +// For example: +// return nil, ShellCompDirectiveFilterDirs +// For flags, using MarkFlagDirname() is a shortcut to using this directive explicitly. +// +// To request directory names within another directory, the returned completions +// should specify a single directory name within which to search. For example, +// to complete directories within "themes/": +// return []string{"themes"}, ShellCompDirectiveFilterDirs +// +ShellCompDirectiveFilterDirs +``` + +***Note***: When using the `ValidArgsFunction`, Cobra will call your registered function after having parsed all flags and arguments provided in the command-line. You therefore don't need to do this parsing yourself. For example, when a user calls `helm status --namespace my-rook-ns [tab][tab]`, Cobra will call your registered `ValidArgsFunction` after having parsed the `--namespace` flag, as it would have done when calling the `RunE` function. + +#### Debugging + +Cobra achieves dynamic completion through the use of a hidden command called by the completion script. To debug your Go completion code, you can call this hidden command directly: +```bash +$ helm __complete status har +harbor +:4 +Completion ended with directive: ShellCompDirectiveNoFileComp # This is on stderr +``` +***Important:*** If the noun to complete is empty (when the user has not yet typed any letters of that noun), you must pass an empty parameter to the `__complete` command: +```bash +$ helm __complete status "" +harbor +notary +rook +thanos +:4 +Completion ended with directive: ShellCompDirectiveNoFileComp # This is on stderr +``` +Calling the `__complete` command directly allows you to run the Go debugger to troubleshoot your code. You can also add printouts to your code; Cobra provides the following functions to use for printouts in Go completion code: +```go +// Prints to the completion script debug file (if BASH_COMP_DEBUG_FILE +// is set to a file path) and optionally prints to stderr. +cobra.CompDebug(msg string, printToStdErr bool) { +cobra.CompDebugln(msg string, printToStdErr bool) + +// Prints to the completion script debug file (if BASH_COMP_DEBUG_FILE +// is set to a file path) and to stderr. +cobra.CompError(msg string) +cobra.CompErrorln(msg string) +``` +***Important:*** You should **not** leave traces that print directly to stdout in your completion code as they will be interpreted as completion choices by the completion script. Instead, use the cobra-provided debugging traces functions mentioned above. + +## Completions for flags + +### Mark flags as required + +Most of the time completions will only show sub-commands. But if a flag is required to make a sub-command work, you probably want it to show up when the user types [tab][tab]. You can mark a flag as 'Required' like so: + +```go +cmd.MarkFlagRequired("pod") +cmd.MarkFlagRequired("container") +``` + +and you'll get something like + +```bash +$ kubectl exec [tab][tab] +-c --container= -p --pod= +``` + +### Specify dynamic flag completion + +As for nouns, Cobra provides a way of defining dynamic completion of flags. To provide a Go function that Cobra will execute when it needs the list of completion choices for a flag, you must register the function using the `command.RegisterFlagCompletionFunc()` function. + +```go +flagName := "output" +cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + return []string{"json", "table", "yaml"}, cobra.ShellCompDirectiveDefault +}) +``` +Notice that calling `RegisterFlagCompletionFunc()` is done through the `command` with which the flag is associated. In our example this dynamic completion will give results like so: + +```bash +$ helm status --output [tab][tab] +json table yaml +``` + +#### Debugging + +You can also easily debug your Go completion code for flags: +```bash +$ helm __complete status --output "" +json +table +yaml +:4 +Completion ended with directive: ShellCompDirectiveNoFileComp # This is on stderr +``` +***Important:*** You should **not** leave traces that print to stdout in your completion code as they will be interpreted as completion choices by the completion script. Instead, use the cobra-provided debugging traces functions mentioned further above. + +### Specify valid filename extensions for flags that take a filename + +To limit completions of flag values to file names with certain extensions you can either use the different `MarkFlagFilename()` functions or a combination of `RegisterFlagCompletionFunc()` and `ShellCompDirectiveFilterFileExt`, like so: +```go +flagName := "output" +cmd.MarkFlagFilename(flagName, "yaml", "json") +``` +or +```go +flagName := "output" +cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + return []string{"yaml", "json"}, ShellCompDirectiveFilterFileExt}) +``` + +### Limit flag completions to directory names + +To limit completions of flag values to directory names you can either use the `MarkFlagDirname()` functions or a combination of `RegisterFlagCompletionFunc()` and `ShellCompDirectiveFilterDirs`, like so: +```go +flagName := "output" +cmd.MarkFlagDirname(flagName) +``` +or +```go +flagName := "output" +cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + return nil, cobra.ShellCompDirectiveFilterDirs +}) +``` +To limit completions of flag values to directory names *within another directory* you can use a combination of `RegisterFlagCompletionFunc()` and `ShellCompDirectiveFilterDirs` like so: +```go +flagName := "output" +cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + return []string{"themes"}, cobra.ShellCompDirectiveFilterDirs +}) +``` +### Descriptions for completions + +`zsh`, `fish` and `powershell` allow for descriptions to annotate completion choices. For commands and flags, Cobra will provide the descriptions automatically, based on usage information. For example, using zsh: +``` +$ helm s[tab] +search -- search for a keyword in charts +show -- show information of a chart +status -- displays the status of the named release +``` +while using fish: +``` +$ helm s[tab] +search (search for a keyword in charts) show (show information of a chart) status (displays the status of the named release) +``` + +Cobra allows you to add annotations to your own completions. Simply add the annotation text after each completion, following a `\t` separator. This technique applies to completions returned by `ValidArgs`, `ValidArgsFunction` and `RegisterFlagCompletionFunc()`. For example: +```go +ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + return []string{"harbor\tAn image registry", "thanos\tLong-term metrics"}, cobra.ShellCompDirectiveNoFileComp +}} +``` +or +```go +ValidArgs: []string{"bash\tCompletions for bash", "zsh\tCompletions for zsh"} +``` +## Bash completions + +### Dependencies + +The bash completion script generated by Cobra requires the `bash_completion` package. You should update the help text of your completion command to show how to install the `bash_completion` package ([Kubectl docs](https://kubernetes.io/docs/tasks/tools/install-kubectl/#enabling-shell-autocompletion)) + +### Aliases + +You can also configure `bash` aliases for your program and they will also support completions. + +```bash +alias aliasname=origcommand +complete -o default -F __start_origcommand aliasname + +# and now when you run `aliasname` completion will make +# suggestions as it did for `origcommand`. + +$ aliasname +completion firstcommand secondcommand +``` +### Bash legacy dynamic completions + +For backward compatibility, Cobra still supports its bash legacy dynamic completion solution. +Please refer to [Bash Completions](bash_completions.md) for details. + +## Zsh completions + +Cobra supports native zsh completion generated from the root `cobra.Command`. +The generated completion script should be put somewhere in your `$fpath` and be named +`_`. You will need to start a new shell for the completions to become available. + +Zsh supports descriptions for completions. Cobra will provide the description automatically, +based on usage information. Cobra provides a way to completely disable such descriptions by +using `GenZshCompletionNoDesc()` or `GenZshCompletionFileNoDesc()`. You can choose to make +this a configurable option to your users. +``` +# With descriptions +$ helm s[tab] +search -- search for a keyword in charts +show -- show information of a chart +status -- displays the status of the named release + +# Without descriptions +$ helm s[tab] +search show status +``` +*Note*: Because of backward-compatibility requirements, we were forced to have a different API to disable completion descriptions between `zsh` and `fish`. + +### Limitations + +* Custom completions implemented in Bash scripting (legacy) are not supported and will be ignored for `zsh` (including the use of the `BashCompCustom` flag annotation). + * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`, `powershell`). +* The function `MarkFlagCustom()` is not supported and will be ignored for `zsh`. + * You should instead use `RegisterFlagCompletionFunc()`. + +### Zsh completions standardization + +Cobra 1.1 standardized its zsh completion support to align it with its other shell completions. Although the API was kept backward-compatible, some small changes in behavior were introduced. +Please refer to [Zsh Completions](zsh_completions.md) for details. + +## fish completions + +Cobra supports native fish completions generated from the root `cobra.Command`. You can use the `command.GenFishCompletion()` or `command.GenFishCompletionFile()` functions. You must provide these functions with a parameter indicating if the completions should be annotated with a description; Cobra will provide the description automatically based on usage information. You can choose to make this option configurable by your users. +``` +# With descriptions +$ helm s[tab] +search (search for a keyword in charts) show (show information of a chart) status (displays the status of the named release) + +# Without descriptions +$ helm s[tab] +search show status +``` +*Note*: Because of backward-compatibility requirements, we were forced to have a different API to disable completion descriptions between `zsh` and `fish`. + +### Limitations + +* Custom completions implemented in bash scripting (legacy) are not supported and will be ignored for `fish` (including the use of the `BashCompCustom` flag annotation). + * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`, `powershell`). +* The function `MarkFlagCustom()` is not supported and will be ignored for `fish`. + * You should instead use `RegisterFlagCompletionFunc()`. +* The following flag completion annotations are not supported and will be ignored for `fish`: + * `BashCompFilenameExt` (filtering by file extension) + * `BashCompSubdirsInDir` (filtering by directory) +* The functions corresponding to the above annotations are consequently not supported and will be ignored for `fish`: + * `MarkFlagFilename()` and `MarkPersistentFlagFilename()` (filtering by file extension) + * `MarkFlagDirname()` and `MarkPersistentFlagDirname()` (filtering by directory) +* Similarly, the following completion directives are not supported and will be ignored for `fish`: + * `ShellCompDirectiveFilterFileExt` (filtering by file extension) + * `ShellCompDirectiveFilterDirs` (filtering by directory) + +## PowerShell completions + +Cobra supports native PowerShell completions generated from the root `cobra.Command`. You can use the `command.GenPowerShellCompletion()` or `command.GenPowerShellCompletionFile()` functions. To include descriptions use `command.GenPowerShellCompletionWithDesc()` and `command.GenPowerShellCompletionFileWithDesc()`. Cobra will provide the description automatically based on usage information. You can choose to make this option configurable by your users. + +The script is designed to support all three PowerShell completion modes: + +* TabCompleteNext (default windows style - on each key press the next option is displayed) +* Complete (works like bash) +* MenuComplete (works like zsh) + +You set the mode with `Set-PSReadLineKeyHandler -Key Tab -Function `. Descriptions are only displayed when using the `Complete` or `MenuComplete` mode. + +Users need PowerShell version 5.0 or above, which comes with Windows 10 and can be downloaded separately for Windows 7 or 8.1. They can then write the completions to a file and source this file from their PowerShell profile, which is referenced by the `$Profile` environment variable. See `Get-Help about_Profiles` for more info about PowerShell profiles. + +``` +# With descriptions and Mode 'Complete' +$ helm s[tab] +search (search for a keyword in charts) show (show information of a chart) status (displays the status of the named release) + +# With descriptions and Mode 'MenuComplete' The description of the current selected value will be displayed below the suggestions. +$ helm s[tab] +search show status + +search for a keyword in charts + +# Without descriptions +$ helm s[tab] +search show status +``` + +### Limitations + +* Custom completions implemented in bash scripting (legacy) are not supported and will be ignored for `powershell` (including the use of the `BashCompCustom` flag annotation). + * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`, `powershell`). +* The function `MarkFlagCustom()` is not supported and will be ignored for `powershell`. + * You should instead use `RegisterFlagCompletionFunc()`. +* The following flag completion annotations are not supported and will be ignored for `powershell`: + * `BashCompFilenameExt` (filtering by file extension) + * `BashCompSubdirsInDir` (filtering by directory) +* The functions corresponding to the above annotations are consequently not supported and will be ignored for `powershell`: + * `MarkFlagFilename()` and `MarkPersistentFlagFilename()` (filtering by file extension) + * `MarkFlagDirname()` and `MarkPersistentFlagDirname()` (filtering by directory) +* Similarly, the following completion directives are not supported and will be ignored for `powershell`: + * `ShellCompDirectiveFilterFileExt` (filtering by file extension) + * `ShellCompDirectiveFilterDirs` (filtering by directory) diff --git a/vendor/github.com/spf13/cobra/zsh_completions.go b/vendor/github.com/spf13/cobra/zsh_completions.go index 12755482f0..2e840285f3 100644 --- a/vendor/github.com/spf13/cobra/zsh_completions.go +++ b/vendor/github.com/spf13/cobra/zsh_completions.go @@ -1,336 +1,240 @@ package cobra import ( - "encoding/json" + "bytes" "fmt" "io" "os" - "sort" - "strings" - "text/template" - - "github.com/spf13/pflag" -) - -const ( - zshCompArgumentAnnotation = "cobra_annotations_zsh_completion_argument_annotation" - zshCompArgumentFilenameComp = "cobra_annotations_zsh_completion_argument_file_completion" - zshCompArgumentWordComp = "cobra_annotations_zsh_completion_argument_word_completion" - zshCompDirname = "cobra_annotations_zsh_dirname" ) -var ( - zshCompFuncMap = template.FuncMap{ - "genZshFuncName": zshCompGenFuncName, - "extractFlags": zshCompExtractFlag, - "genFlagEntryForZshArguments": zshCompGenFlagEntryForArguments, - "extractArgsCompletions": zshCompExtractArgumentCompletionHintsForRendering, - } - zshCompletionText = ` -{{/* should accept Command (that contains subcommands) as parameter */}} -{{define "argumentsC" -}} -{{ $cmdPath := genZshFuncName .}} -function {{$cmdPath}} { - local -a commands - - _arguments -C \{{- range extractFlags .}} - {{genFlagEntryForZshArguments .}} \{{- end}} - "1: :->cmnds" \ - "*::arg:->args" - - case $state in - cmnds) - commands=({{range .Commands}}{{if not .Hidden}} - "{{.Name}}:{{.Short}}"{{end}}{{end}} - ) - _describe "command" commands - ;; - esac - - case "$words[1]" in {{- range .Commands}}{{if not .Hidden}} - {{.Name}}) - {{$cmdPath}}_{{.Name}} - ;;{{end}}{{end}} - esac -} -{{range .Commands}}{{if not .Hidden}} -{{template "selectCmdTemplate" .}} -{{- end}}{{end}} -{{- end}} - -{{/* should accept Command without subcommands as parameter */}} -{{define "arguments" -}} -function {{genZshFuncName .}} { -{{" _arguments"}}{{range extractFlags .}} \ - {{genFlagEntryForZshArguments . -}} -{{end}}{{range extractArgsCompletions .}} \ - {{.}}{{end}} -} -{{end}} - -{{/* dispatcher for commands with or without subcommands */}} -{{define "selectCmdTemplate" -}} -{{if .Hidden}}{{/* ignore hidden*/}}{{else -}} -{{if .Commands}}{{template "argumentsC" .}}{{else}}{{template "arguments" .}}{{end}} -{{- end}} -{{- end}} - -{{/* template entry point */}} -{{define "Main" -}} -#compdef _{{.Name}} {{.Name}} - -{{template "selectCmdTemplate" .}} -{{end}} -` -) - -// zshCompArgsAnnotation is used to encode/decode zsh completion for -// arguments to/from Command.Annotations. -type zshCompArgsAnnotation map[int]zshCompArgHint - -type zshCompArgHint struct { - // Indicates the type of the completion to use. One of: - // zshCompArgumentFilenameComp or zshCompArgumentWordComp - Tipe string `json:"type"` - - // A value for the type above (globs for file completion or words) - Options []string `json:"options"` -} - -// GenZshCompletionFile generates zsh completion file. +// GenZshCompletionFile generates zsh completion file including descriptions. func (c *Command) GenZshCompletionFile(filename string) error { - outFile, err := os.Create(filename) - if err != nil { - return err - } - defer outFile.Close() - - return c.GenZshCompletion(outFile) + return c.genZshCompletionFile(filename, true) } -// GenZshCompletion generates a zsh completion file and writes to the passed -// writer. The completion always run on the root command regardless of the -// command it was called from. +// GenZshCompletion generates zsh completion file including descriptions +// and writes it to the passed writer. func (c *Command) GenZshCompletion(w io.Writer) error { - tmpl, err := template.New("Main").Funcs(zshCompFuncMap).Parse(zshCompletionText) - if err != nil { - return fmt.Errorf("error creating zsh completion template: %v", err) - } - return tmpl.Execute(w, c.Root()) -} - -// MarkZshCompPositionalArgumentFile marks the specified argument (first -// argument is 1) as completed by file selection. patterns (e.g. "*.txt") are -// optional - if not provided the completion will search for all files. -func (c *Command) MarkZshCompPositionalArgumentFile(argPosition int, patterns ...string) error { - if argPosition < 1 { - return fmt.Errorf("Invalid argument position (%d)", argPosition) - } - annotation, err := c.zshCompGetArgsAnnotations() - if err != nil { - return err - } - if c.zshcompArgsAnnotationnIsDuplicatePosition(annotation, argPosition) { - return fmt.Errorf("Duplicate annotation for positional argument at index %d", argPosition) - } - annotation[argPosition] = zshCompArgHint{ - Tipe: zshCompArgumentFilenameComp, - Options: patterns, - } - return c.zshCompSetArgsAnnotations(annotation) -} - -// MarkZshCompPositionalArgumentWords marks the specified positional argument -// (first argument is 1) as completed by the provided words. At east one word -// must be provided, spaces within words will be offered completion with -// "word\ word". -func (c *Command) MarkZshCompPositionalArgumentWords(argPosition int, words ...string) error { - if argPosition < 1 { - return fmt.Errorf("Invalid argument position (%d)", argPosition) - } - if len(words) == 0 { - return fmt.Errorf("Trying to set empty word list for positional argument %d", argPosition) - } - annotation, err := c.zshCompGetArgsAnnotations() - if err != nil { - return err - } - if c.zshcompArgsAnnotationnIsDuplicatePosition(annotation, argPosition) { - return fmt.Errorf("Duplicate annotation for positional argument at index %d", argPosition) - } - annotation[argPosition] = zshCompArgHint{ - Tipe: zshCompArgumentWordComp, - Options: words, - } - return c.zshCompSetArgsAnnotations(annotation) -} - -func zshCompExtractArgumentCompletionHintsForRendering(c *Command) ([]string, error) { - var result []string - annotation, err := c.zshCompGetArgsAnnotations() - if err != nil { - return nil, err - } - for k, v := range annotation { - s, err := zshCompRenderZshCompArgHint(k, v) - if err != nil { - return nil, err - } - result = append(result, s) - } - if len(c.ValidArgs) > 0 { - if _, positionOneExists := annotation[1]; !positionOneExists { - s, err := zshCompRenderZshCompArgHint(1, zshCompArgHint{ - Tipe: zshCompArgumentWordComp, - Options: c.ValidArgs, - }) - if err != nil { - return nil, err - } - result = append(result, s) - } - } - sort.Strings(result) - return result, nil + return c.genZshCompletion(w, true) } -func zshCompRenderZshCompArgHint(i int, z zshCompArgHint) (string, error) { - switch t := z.Tipe; t { - case zshCompArgumentFilenameComp: - var globs []string - for _, g := range z.Options { - globs = append(globs, fmt.Sprintf(`-g "%s"`, g)) - } - return fmt.Sprintf(`'%d: :_files %s'`, i, strings.Join(globs, " ")), nil - case zshCompArgumentWordComp: - var words []string - for _, w := range z.Options { - words = append(words, fmt.Sprintf("%q", w)) - } - return fmt.Sprintf(`'%d: :(%s)'`, i, strings.Join(words, " ")), nil - default: - return "", fmt.Errorf("Invalid zsh argument completion annotation: %s", t) - } +// GenZshCompletionFileNoDesc generates zsh completion file without descriptions. +func (c *Command) GenZshCompletionFileNoDesc(filename string) error { + return c.genZshCompletionFile(filename, false) } -func (c *Command) zshcompArgsAnnotationnIsDuplicatePosition(annotation zshCompArgsAnnotation, position int) bool { - _, dup := annotation[position] - return dup +// GenZshCompletionNoDesc generates zsh completion file without descriptions +// and writes it to the passed writer. +func (c *Command) GenZshCompletionNoDesc(w io.Writer) error { + return c.genZshCompletion(w, false) } -func (c *Command) zshCompGetArgsAnnotations() (zshCompArgsAnnotation, error) { - annotation := make(zshCompArgsAnnotation) - annotationString, ok := c.Annotations[zshCompArgumentAnnotation] - if !ok { - return annotation, nil - } - err := json.Unmarshal([]byte(annotationString), &annotation) - if err != nil { - return annotation, fmt.Errorf("Error unmarshaling zsh argument annotation: %v", err) - } - return annotation, nil -} - -func (c *Command) zshCompSetArgsAnnotations(annotation zshCompArgsAnnotation) error { - jsn, err := json.Marshal(annotation) - if err != nil { - return fmt.Errorf("Error marshaling zsh argument annotation: %v", err) - } - if c.Annotations == nil { - c.Annotations = make(map[string]string) - } - c.Annotations[zshCompArgumentAnnotation] = string(jsn) +// MarkZshCompPositionalArgumentFile only worked for zsh and its behavior was +// not consistent with Bash completion. It has therefore been disabled. +// Instead, when no other completion is specified, file completion is done by +// default for every argument. One can disable file completion on a per-argument +// basis by using ValidArgsFunction and ShellCompDirectiveNoFileComp. +// To achieve file extension filtering, one can use ValidArgsFunction and +// ShellCompDirectiveFilterFileExt. +// +// Deprecated +func (c *Command) MarkZshCompPositionalArgumentFile(argPosition int, patterns ...string) error { return nil } -func zshCompGenFuncName(c *Command) string { - if c.HasParent() { - return zshCompGenFuncName(c.Parent()) + "_" + c.Name() - } - return "_" + c.Name() -} - -func zshCompExtractFlag(c *Command) []*pflag.Flag { - var flags []*pflag.Flag - c.LocalFlags().VisitAll(func(f *pflag.Flag) { - if !f.Hidden { - flags = append(flags, f) - } - }) - c.InheritedFlags().VisitAll(func(f *pflag.Flag) { - if !f.Hidden { - flags = append(flags, f) - } - }) - return flags -} - -// zshCompGenFlagEntryForArguments returns an entry that matches _arguments -// zsh-completion parameters. It's too complicated to generate in a template. -func zshCompGenFlagEntryForArguments(f *pflag.Flag) string { - if f.Name == "" || f.Shorthand == "" { - return zshCompGenFlagEntryForSingleOptionFlag(f) - } - return zshCompGenFlagEntryForMultiOptionFlag(f) -} - -func zshCompGenFlagEntryForSingleOptionFlag(f *pflag.Flag) string { - var option, multiMark, extras string - - if zshCompFlagCouldBeSpecifiedMoreThenOnce(f) { - multiMark = "*" - } - - option = "--" + f.Name - if option == "--" { - option = "-" + f.Shorthand - } - extras = zshCompGenFlagEntryExtras(f) - - return fmt.Sprintf(`'%s%s[%s]%s'`, multiMark, option, zshCompQuoteFlagDescription(f.Usage), extras) -} - -func zshCompGenFlagEntryForMultiOptionFlag(f *pflag.Flag) string { - var options, parenMultiMark, curlyMultiMark, extras string - - if zshCompFlagCouldBeSpecifiedMoreThenOnce(f) { - parenMultiMark = "*" - curlyMultiMark = "\\*" - } - - options = fmt.Sprintf(`'(%s-%s %s--%s)'{%s-%s,%s--%s}`, - parenMultiMark, f.Shorthand, parenMultiMark, f.Name, curlyMultiMark, f.Shorthand, curlyMultiMark, f.Name) - extras = zshCompGenFlagEntryExtras(f) - - return fmt.Sprintf(`%s'[%s]%s'`, options, zshCompQuoteFlagDescription(f.Usage), extras) +// MarkZshCompPositionalArgumentWords only worked for zsh. It has therefore +// been disabled. +// To achieve the same behavior across all shells, one can use +// ValidArgs (for the first argument only) or ValidArgsFunction for +// any argument (can include the first one also). +// +// Deprecated +func (c *Command) MarkZshCompPositionalArgumentWords(argPosition int, words ...string) error { + return nil } -func zshCompGenFlagEntryExtras(f *pflag.Flag) string { - if f.NoOptDefVal != "" { - return "" - } - - extras := ":" // allow options for flag (even without assistance) - for key, values := range f.Annotations { - switch key { - case zshCompDirname: - extras = fmt.Sprintf(":filename:_files -g %q", values[0]) - case BashCompFilenameExt: - extras = ":filename:_files" - for _, pattern := range values { - extras = extras + fmt.Sprintf(` -g "%s"`, pattern) - } - } +func (c *Command) genZshCompletionFile(filename string, includeDesc bool) error { + outFile, err := os.Create(filename) + if err != nil { + return err } + defer outFile.Close() - return extras -} - -func zshCompFlagCouldBeSpecifiedMoreThenOnce(f *pflag.Flag) bool { - return strings.Contains(f.Value.Type(), "Slice") || - strings.Contains(f.Value.Type(), "Array") -} - -func zshCompQuoteFlagDescription(s string) string { - return strings.Replace(s, "'", `'\''`, -1) + return c.genZshCompletion(outFile, includeDesc) +} + +func (c *Command) genZshCompletion(w io.Writer, includeDesc bool) error { + buf := new(bytes.Buffer) + genZshComp(buf, c.Name(), includeDesc) + _, err := buf.WriteTo(w) + return err +} + +func genZshComp(buf io.StringWriter, name string, includeDesc bool) { + compCmd := ShellCompRequestCmd + if !includeDesc { + compCmd = ShellCompNoDescRequestCmd + } + WriteStringAndCheck(buf, fmt.Sprintf(`#compdef _%[1]s %[1]s + +# zsh completion for %-36[1]s -*- shell-script -*- + +__%[1]s_debug() +{ + local file="$BASH_COMP_DEBUG_FILE" + if [[ -n ${file} ]]; then + echo "$*" >> "${file}" + fi +} + +_%[1]s() +{ + local shellCompDirectiveError=%[3]d + local shellCompDirectiveNoSpace=%[4]d + local shellCompDirectiveNoFileComp=%[5]d + local shellCompDirectiveFilterFileExt=%[6]d + local shellCompDirectiveFilterDirs=%[7]d + + local lastParam lastChar flagPrefix requestComp out directive compCount comp lastComp + local -a completions + + __%[1]s_debug "\n========= starting completion logic ==========" + __%[1]s_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}" + + # The user could have moved the cursor backwards on the command-line. + # We need to trigger completion from the $CURRENT location, so we need + # to truncate the command-line ($words) up to the $CURRENT location. + # (We cannot use $CURSOR as its value does not work when a command is an alias.) + words=("${=words[1,CURRENT]}") + __%[1]s_debug "Truncated words[*]: ${words[*]}," + + lastParam=${words[-1]} + lastChar=${lastParam[-1]} + __%[1]s_debug "lastParam: ${lastParam}, lastChar: ${lastChar}" + + # For zsh, when completing a flag with an = (e.g., %[1]s -n=) + # completions must be prefixed with the flag + setopt local_options BASH_REMATCH + if [[ "${lastParam}" =~ '-.*=' ]]; then + # We are dealing with a flag with an = + flagPrefix="-P ${BASH_REMATCH}" + fi + + # Prepare the command to obtain completions + requestComp="${words[1]} %[2]s ${words[2,-1]}" + if [ "${lastChar}" = "" ]; then + # If the last parameter is complete (there is a space following it) + # We add an extra empty parameter so we can indicate this to the go completion code. + __%[1]s_debug "Adding extra empty parameter" + requestComp="${requestComp} \"\"" + fi + + __%[1]s_debug "About to call: eval ${requestComp}" + + # Use eval to handle any environment variables and such + out=$(eval ${requestComp} 2>/dev/null) + __%[1]s_debug "completion output: ${out}" + + # Extract the directive integer following a : from the last line + local lastLine + while IFS='\n' read -r line; do + lastLine=${line} + done < <(printf "%%s\n" "${out[@]}") + __%[1]s_debug "last line: ${lastLine}" + + if [ "${lastLine[1]}" = : ]; then + directive=${lastLine[2,-1]} + # Remove the directive including the : and the newline + local suffix + (( suffix=${#lastLine}+2)) + out=${out[1,-$suffix]} + else + # There is no directive specified. Leave $out as is. + __%[1]s_debug "No directive found. Setting do default" + directive=0 + fi + + __%[1]s_debug "directive: ${directive}" + __%[1]s_debug "completions: ${out}" + __%[1]s_debug "flagPrefix: ${flagPrefix}" + + if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then + __%[1]s_debug "Completion received error. Ignoring completions." + return + fi + + compCount=0 + while IFS='\n' read -r comp; do + if [ -n "$comp" ]; then + # If requested, completions are returned with a description. + # The description is preceded by a TAB character. + # For zsh's _describe, we need to use a : instead of a TAB. + # We first need to escape any : as part of the completion itself. + comp=${comp//:/\\:} + + local tab=$(printf '\t') + comp=${comp//$tab/:} + + ((compCount++)) + __%[1]s_debug "Adding completion: ${comp}" + completions+=${comp} + lastComp=$comp + fi + done < <(printf "%%s\n" "${out[@]}") + + if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then + # File extension filtering + local filteringCmd + filteringCmd='_files' + for filter in ${completions[@]}; do + if [ ${filter[1]} != '*' ]; then + # zsh requires a glob pattern to do file filtering + filter="\*.$filter" + fi + filteringCmd+=" -g $filter" + done + filteringCmd+=" ${flagPrefix}" + + __%[1]s_debug "File filtering command: $filteringCmd" + _arguments '*:filename:'"$filteringCmd" + elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then + # File completion for directories only + local subDir + subdir="${completions[1]}" + if [ -n "$subdir" ]; then + __%[1]s_debug "Listing directories in $subdir" + pushd "${subdir}" >/dev/null 2>&1 + else + __%[1]s_debug "Listing directories in ." + fi + + _arguments '*:dirname:_files -/'" ${flagPrefix}" + if [ -n "$subdir" ]; then + popd >/dev/null 2>&1 + fi + elif [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ] && [ ${compCount} -eq 1 ]; then + __%[1]s_debug "Activating nospace." + # We can use compadd here as there is no description when + # there is only one completion. + compadd -S '' "${lastComp}" + elif [ ${compCount} -eq 0 ]; then + if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then + __%[1]s_debug "deactivating file completion" + else + # Perform file completion + __%[1]s_debug "activating file completion" + _arguments '*:filename:_files'" ${flagPrefix}" + fi + else + _describe "completions" completions $(echo $flagPrefix) + fi +} + +# don't run the completion function when being source-ed or eval-ed +if [ "$funcstack[1]" = "_%[1]s" ]; then + _%[1]s +fi +`, name, compCmd, + ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp, + ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs)) } diff --git a/vendor/github.com/spf13/cobra/zsh_completions.md b/vendor/github.com/spf13/cobra/zsh_completions.md index df9c2eac93..7cff61787f 100644 --- a/vendor/github.com/spf13/cobra/zsh_completions.md +++ b/vendor/github.com/spf13/cobra/zsh_completions.md @@ -1,39 +1,48 @@ -## Generating Zsh Completion for your cobra.Command - -Cobra supports native Zsh completion generated from the root `cobra.Command`. -The generated completion script should be put somewhere in your `$fpath` named -`_`. - -### What's Supported - -* Completion for all non-hidden subcommands using their `.Short` description. -* Completion for all non-hidden flags using the following rules: - * Filename completion works by marking the flag with `cmd.MarkFlagFilename...` - family of commands. - * The requirement for argument to the flag is decided by the `.NoOptDefVal` - flag value - if it's empty then completion will expect an argument. - * Flags of one of the various `*Array` and `*Slice` types supports multiple - specifications (with or without argument depending on the specific type). -* Completion of positional arguments using the following rules: - * Argument position for all options below starts at `1`. If argument position - `0` is requested it will raise an error. - * Use `command.MarkZshCompPositionalArgumentFile` to complete filenames. Glob - patterns (e.g. `"*.log"`) are optional - if not specified it will offer to - complete all file types. - * Use `command.MarkZshCompPositionalArgumentWords` to offer specific words for - completion. At least one word is required. - * It's possible to specify completion for some arguments and leave some - unspecified (e.g. offer words for second argument but nothing for first - argument). This will cause no completion for first argument but words - completion for second argument. - * If no argument completion was specified for 1st argument (but optionally was - specified for 2nd) and the command has `ValidArgs` it will be used as - completion options for 1st argument. - * Argument completions only offered for commands with no subcommands. - -### What's not yet Supported - -* Custom completion scripts are not supported yet (We should probably create zsh - specific one, doesn't make sense to re-use the bash one as the functions will - be different). -* Whatever other feature you're looking for and doesn't exist :) +## Generating Zsh Completion For Your cobra.Command + +Please refer to [Shell Completions](shell_completions.md) for details. + +## Zsh completions standardization + +Cobra 1.1 standardized its zsh completion support to align it with its other shell completions. Although the API was kept backwards-compatible, some small changes in behavior were introduced. + +### Deprecation summary + +See further below for more details on these deprecations. + +* `cmd.MarkZshCompPositionalArgumentFile(pos, []string{})` is no longer needed. It is therefore **deprecated** and silently ignored. +* `cmd.MarkZshCompPositionalArgumentFile(pos, glob[])` is **deprecated** and silently ignored. + * Instead use `ValidArgsFunction` with `ShellCompDirectiveFilterFileExt`. +* `cmd.MarkZshCompPositionalArgumentWords()` is **deprecated** and silently ignored. + * Instead use `ValidArgsFunction`. + +### Behavioral changes + +**Noun completion** +|Old behavior|New behavior| +|---|---| +|No file completion by default (opposite of bash)|File completion by default; use `ValidArgsFunction` with `ShellCompDirectiveNoFileComp` to turn off file completion on a per-argument basis| +|Completion of flag names without the `-` prefix having been typed|Flag names are only completed if the user has typed the first `-`| +`cmd.MarkZshCompPositionalArgumentFile(pos, []string{})` used to turn on file completion on a per-argument position basis|File completion for all arguments by default; `cmd.MarkZshCompPositionalArgumentFile()` is **deprecated** and silently ignored| +|`cmd.MarkZshCompPositionalArgumentFile(pos, glob[])` used to turn on file completion **with glob filtering** on a per-argument position basis (zsh-specific)|`cmd.MarkZshCompPositionalArgumentFile()` is **deprecated** and silently ignored; use `ValidArgsFunction` with `ShellCompDirectiveFilterFileExt` for file **extension** filtering (not full glob filtering)| +|`cmd.MarkZshCompPositionalArgumentWords(pos, words[])` used to provide completion choices on a per-argument position basis (zsh-specific)|`cmd.MarkZshCompPositionalArgumentWords()` is **deprecated** and silently ignored; use `ValidArgsFunction` to achieve the same behavior| + +**Flag-value completion** + +|Old behavior|New behavior| +|---|---| +|No file completion by default (opposite of bash)|File completion by default; use `RegisterFlagCompletionFunc()` with `ShellCompDirectiveNoFileComp` to turn off file completion| +|`cmd.MarkFlagFilename(flag, []string{})` and similar used to turn on file completion|File completion by default; `cmd.MarkFlagFilename(flag, []string{})` no longer needed in this context and silently ignored| +|`cmd.MarkFlagFilename(flag, glob[])` used to turn on file completion **with glob filtering** (syntax of `[]string{"*.yaml", "*.yml"}` incompatible with bash)|Will continue to work, however, support for bash syntax is added and should be used instead so as to work for all shells (`[]string{"yaml", "yml"}`)| +|`cmd.MarkFlagDirname(flag)` only completes directories (zsh-specific)|Has been added for all shells| +|Completion of a flag name does not repeat, unless flag is of type `*Array` or `*Slice` (not supported by bash)|Retained for `zsh` and added to `fish`| +|Completion of a flag name does not provide the `=` form (unlike bash)|Retained for `zsh` and added to `fish`| + +**Improvements** + +* Custom completion support (`ValidArgsFunction` and `RegisterFlagCompletionFunc()`) +* File completion by default if no other completions found +* Handling of required flags +* File extension filtering no longer mutually exclusive with bash usage +* Completion of directory names *within* another directory +* Support for `=` form of flags diff --git a/vendor/github.com/spf13/pflag/.travis.yml b/vendor/github.com/spf13/pflag/.travis.yml index f8a63b308b..00d04cb9b0 100644 --- a/vendor/github.com/spf13/pflag/.travis.yml +++ b/vendor/github.com/spf13/pflag/.travis.yml @@ -3,8 +3,9 @@ sudo: false language: go go: - - 1.7.3 - - 1.8.1 + - 1.9.x + - 1.10.x + - 1.11.x - tip matrix: @@ -12,7 +13,7 @@ matrix: - go: tip install: - - go get github.com/golang/lint/golint + - go get golang.org/x/lint/golint - export PATH=$GOPATH/bin:$PATH - go install ./... diff --git a/vendor/github.com/spf13/pflag/README.md b/vendor/github.com/spf13/pflag/README.md index b052414d12..7eacc5bdbe 100644 --- a/vendor/github.com/spf13/pflag/README.md +++ b/vendor/github.com/spf13/pflag/README.md @@ -86,8 +86,8 @@ fmt.Println("ip has value ", *ip) fmt.Println("flagvar has value ", flagvar) ``` -There are helpers function to get values later if you have the FlagSet but -it was difficult to keep up with all of the flag pointers in your code. +There are helper functions available to get the value stored in a Flag if you have a FlagSet but find +it difficult to keep up with all of the pointers in your code. If you have a pflag.FlagSet with a flag called 'flagname' of type int you can use GetInt() to get the int value. But notice that 'flagname' must exist and it must be an int. GetString("flagname") will fail. diff --git a/vendor/github.com/spf13/pflag/bool_slice.go b/vendor/github.com/spf13/pflag/bool_slice.go index 5af02f1a75..3731370d6a 100644 --- a/vendor/github.com/spf13/pflag/bool_slice.go +++ b/vendor/github.com/spf13/pflag/bool_slice.go @@ -71,6 +71,44 @@ func (s *boolSliceValue) String() string { return "[" + out + "]" } +func (s *boolSliceValue) fromString(val string) (bool, error) { + return strconv.ParseBool(val) +} + +func (s *boolSliceValue) toString(val bool) string { + return strconv.FormatBool(val) +} + +func (s *boolSliceValue) Append(val string) error { + i, err := s.fromString(val) + if err != nil { + return err + } + *s.value = append(*s.value, i) + return nil +} + +func (s *boolSliceValue) Replace(val []string) error { + out := make([]bool, len(val)) + for i, d := range val { + var err error + out[i], err = s.fromString(d) + if err != nil { + return err + } + } + *s.value = out + return nil +} + +func (s *boolSliceValue) GetSlice() []string { + out := make([]string, len(*s.value)) + for i, d := range *s.value { + out[i] = s.toString(d) + } + return out +} + func boolSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry diff --git a/vendor/github.com/spf13/pflag/count.go b/vendor/github.com/spf13/pflag/count.go index aa126e44d1..a0b2679f71 100644 --- a/vendor/github.com/spf13/pflag/count.go +++ b/vendor/github.com/spf13/pflag/count.go @@ -46,7 +46,7 @@ func (f *FlagSet) GetCount(name string) (int, error) { // CountVar defines a count flag with specified name, default value, and usage string. // The argument p points to an int variable in which to store the value of the flag. -// A count flag will add 1 to its value evey time it is found on the command line +// A count flag will add 1 to its value every time it is found on the command line func (f *FlagSet) CountVar(p *int, name string, usage string) { f.CountVarP(p, name, "", usage) } @@ -69,7 +69,7 @@ func CountVarP(p *int, name, shorthand string, usage string) { // Count defines a count flag with specified name, default value, and usage string. // The return value is the address of an int variable that stores the value of the flag. -// A count flag will add 1 to its value evey time it is found on the command line +// A count flag will add 1 to its value every time it is found on the command line func (f *FlagSet) Count(name string, usage string) *int { p := new(int) f.CountVarP(p, name, "", usage) diff --git a/vendor/github.com/spf13/pflag/duration_slice.go b/vendor/github.com/spf13/pflag/duration_slice.go index 52c6b6dc10..badadda53f 100644 --- a/vendor/github.com/spf13/pflag/duration_slice.go +++ b/vendor/github.com/spf13/pflag/duration_slice.go @@ -51,6 +51,44 @@ func (s *durationSliceValue) String() string { return "[" + strings.Join(out, ",") + "]" } +func (s *durationSliceValue) fromString(val string) (time.Duration, error) { + return time.ParseDuration(val) +} + +func (s *durationSliceValue) toString(val time.Duration) string { + return fmt.Sprintf("%s", val) +} + +func (s *durationSliceValue) Append(val string) error { + i, err := s.fromString(val) + if err != nil { + return err + } + *s.value = append(*s.value, i) + return nil +} + +func (s *durationSliceValue) Replace(val []string) error { + out := make([]time.Duration, len(val)) + for i, d := range val { + var err error + out[i], err = s.fromString(d) + if err != nil { + return err + } + } + *s.value = out + return nil +} + +func (s *durationSliceValue) GetSlice() []string { + out := make([]string, len(*s.value)) + for i, d := range *s.value { + out[i] = s.toString(d) + } + return out +} + func durationSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry diff --git a/vendor/github.com/spf13/pflag/flag.go b/vendor/github.com/spf13/pflag/flag.go index 9beeda8ecc..24a5036e95 100644 --- a/vendor/github.com/spf13/pflag/flag.go +++ b/vendor/github.com/spf13/pflag/flag.go @@ -57,9 +57,9 @@ that give one-letter shorthands for flags. You can use these by appending var ip = flag.IntP("flagname", "f", 1234, "help message") var flagvar bool func init() { - flag.BoolVarP("boolname", "b", true, "help message") + flag.BoolVarP(&flagvar, "boolname", "b", true, "help message") } - flag.VarP(&flagVar, "varname", "v", 1234, "help message") + flag.VarP(&flagval, "varname", "v", "help message") Shorthand letters can be used with single dashes on the command line. Boolean shorthand flags can be combined with other shorthand flags. @@ -190,6 +190,18 @@ type Value interface { Type() string } +// SliceValue is a secondary interface to all flags which hold a list +// of values. This allows full control over the value of list flags, +// and avoids complicated marshalling and unmarshalling to csv. +type SliceValue interface { + // Append adds the specified value to the end of the flag value list. + Append(string) error + // Replace will fully overwrite any data currently in the flag value list. + Replace([]string) error + // GetSlice returns the flag value list as an array of strings. + GetSlice() []string +} + // sortFlags returns the flags as a slice in lexicographical sorted order. func sortFlags(flags map[NormalizedName]*Flag) []*Flag { list := make(sort.StringSlice, len(flags)) diff --git a/vendor/github.com/spf13/pflag/float32_slice.go b/vendor/github.com/spf13/pflag/float32_slice.go new file mode 100644 index 0000000000..caa352741a --- /dev/null +++ b/vendor/github.com/spf13/pflag/float32_slice.go @@ -0,0 +1,174 @@ +package pflag + +import ( + "fmt" + "strconv" + "strings" +) + +// -- float32Slice Value +type float32SliceValue struct { + value *[]float32 + changed bool +} + +func newFloat32SliceValue(val []float32, p *[]float32) *float32SliceValue { + isv := new(float32SliceValue) + isv.value = p + *isv.value = val + return isv +} + +func (s *float32SliceValue) Set(val string) error { + ss := strings.Split(val, ",") + out := make([]float32, len(ss)) + for i, d := range ss { + var err error + var temp64 float64 + temp64, err = strconv.ParseFloat(d, 32) + if err != nil { + return err + } + out[i] = float32(temp64) + + } + if !s.changed { + *s.value = out + } else { + *s.value = append(*s.value, out...) + } + s.changed = true + return nil +} + +func (s *float32SliceValue) Type() string { + return "float32Slice" +} + +func (s *float32SliceValue) String() string { + out := make([]string, len(*s.value)) + for i, d := range *s.value { + out[i] = fmt.Sprintf("%f", d) + } + return "[" + strings.Join(out, ",") + "]" +} + +func (s *float32SliceValue) fromString(val string) (float32, error) { + t64, err := strconv.ParseFloat(val, 32) + if err != nil { + return 0, err + } + return float32(t64), nil +} + +func (s *float32SliceValue) toString(val float32) string { + return fmt.Sprintf("%f", val) +} + +func (s *float32SliceValue) Append(val string) error { + i, err := s.fromString(val) + if err != nil { + return err + } + *s.value = append(*s.value, i) + return nil +} + +func (s *float32SliceValue) Replace(val []string) error { + out := make([]float32, len(val)) + for i, d := range val { + var err error + out[i], err = s.fromString(d) + if err != nil { + return err + } + } + *s.value = out + return nil +} + +func (s *float32SliceValue) GetSlice() []string { + out := make([]string, len(*s.value)) + for i, d := range *s.value { + out[i] = s.toString(d) + } + return out +} + +func float32SliceConv(val string) (interface{}, error) { + val = strings.Trim(val, "[]") + // Empty string would cause a slice with one (empty) entry + if len(val) == 0 { + return []float32{}, nil + } + ss := strings.Split(val, ",") + out := make([]float32, len(ss)) + for i, d := range ss { + var err error + var temp64 float64 + temp64, err = strconv.ParseFloat(d, 32) + if err != nil { + return nil, err + } + out[i] = float32(temp64) + + } + return out, nil +} + +// GetFloat32Slice return the []float32 value of a flag with the given name +func (f *FlagSet) GetFloat32Slice(name string) ([]float32, error) { + val, err := f.getFlagType(name, "float32Slice", float32SliceConv) + if err != nil { + return []float32{}, err + } + return val.([]float32), nil +} + +// Float32SliceVar defines a float32Slice flag with specified name, default value, and usage string. +// The argument p points to a []float32 variable in which to store the value of the flag. +func (f *FlagSet) Float32SliceVar(p *[]float32, name string, value []float32, usage string) { + f.VarP(newFloat32SliceValue(value, p), name, "", usage) +} + +// Float32SliceVarP is like Float32SliceVar, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) Float32SliceVarP(p *[]float32, name, shorthand string, value []float32, usage string) { + f.VarP(newFloat32SliceValue(value, p), name, shorthand, usage) +} + +// Float32SliceVar defines a float32[] flag with specified name, default value, and usage string. +// The argument p points to a float32[] variable in which to store the value of the flag. +func Float32SliceVar(p *[]float32, name string, value []float32, usage string) { + CommandLine.VarP(newFloat32SliceValue(value, p), name, "", usage) +} + +// Float32SliceVarP is like Float32SliceVar, but accepts a shorthand letter that can be used after a single dash. +func Float32SliceVarP(p *[]float32, name, shorthand string, value []float32, usage string) { + CommandLine.VarP(newFloat32SliceValue(value, p), name, shorthand, usage) +} + +// Float32Slice defines a []float32 flag with specified name, default value, and usage string. +// The return value is the address of a []float32 variable that stores the value of the flag. +func (f *FlagSet) Float32Slice(name string, value []float32, usage string) *[]float32 { + p := []float32{} + f.Float32SliceVarP(&p, name, "", value, usage) + return &p +} + +// Float32SliceP is like Float32Slice, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) Float32SliceP(name, shorthand string, value []float32, usage string) *[]float32 { + p := []float32{} + f.Float32SliceVarP(&p, name, shorthand, value, usage) + return &p +} + +// Float32Slice defines a []float32 flag with specified name, default value, and usage string. +// The return value is the address of a []float32 variable that stores the value of the flag. +func Float32Slice(name string, value []float32, usage string) *[]float32 { + return CommandLine.Float32SliceP(name, "", value, usage) +} + +// Float32SliceP is like Float32Slice, but accepts a shorthand letter that can be used after a single dash. +func Float32SliceP(name, shorthand string, value []float32, usage string) *[]float32 { + return CommandLine.Float32SliceP(name, shorthand, value, usage) +} diff --git a/vendor/github.com/spf13/pflag/float64_slice.go b/vendor/github.com/spf13/pflag/float64_slice.go new file mode 100644 index 0000000000..85bf3073d5 --- /dev/null +++ b/vendor/github.com/spf13/pflag/float64_slice.go @@ -0,0 +1,166 @@ +package pflag + +import ( + "fmt" + "strconv" + "strings" +) + +// -- float64Slice Value +type float64SliceValue struct { + value *[]float64 + changed bool +} + +func newFloat64SliceValue(val []float64, p *[]float64) *float64SliceValue { + isv := new(float64SliceValue) + isv.value = p + *isv.value = val + return isv +} + +func (s *float64SliceValue) Set(val string) error { + ss := strings.Split(val, ",") + out := make([]float64, len(ss)) + for i, d := range ss { + var err error + out[i], err = strconv.ParseFloat(d, 64) + if err != nil { + return err + } + + } + if !s.changed { + *s.value = out + } else { + *s.value = append(*s.value, out...) + } + s.changed = true + return nil +} + +func (s *float64SliceValue) Type() string { + return "float64Slice" +} + +func (s *float64SliceValue) String() string { + out := make([]string, len(*s.value)) + for i, d := range *s.value { + out[i] = fmt.Sprintf("%f", d) + } + return "[" + strings.Join(out, ",") + "]" +} + +func (s *float64SliceValue) fromString(val string) (float64, error) { + return strconv.ParseFloat(val, 64) +} + +func (s *float64SliceValue) toString(val float64) string { + return fmt.Sprintf("%f", val) +} + +func (s *float64SliceValue) Append(val string) error { + i, err := s.fromString(val) + if err != nil { + return err + } + *s.value = append(*s.value, i) + return nil +} + +func (s *float64SliceValue) Replace(val []string) error { + out := make([]float64, len(val)) + for i, d := range val { + var err error + out[i], err = s.fromString(d) + if err != nil { + return err + } + } + *s.value = out + return nil +} + +func (s *float64SliceValue) GetSlice() []string { + out := make([]string, len(*s.value)) + for i, d := range *s.value { + out[i] = s.toString(d) + } + return out +} + +func float64SliceConv(val string) (interface{}, error) { + val = strings.Trim(val, "[]") + // Empty string would cause a slice with one (empty) entry + if len(val) == 0 { + return []float64{}, nil + } + ss := strings.Split(val, ",") + out := make([]float64, len(ss)) + for i, d := range ss { + var err error + out[i], err = strconv.ParseFloat(d, 64) + if err != nil { + return nil, err + } + + } + return out, nil +} + +// GetFloat64Slice return the []float64 value of a flag with the given name +func (f *FlagSet) GetFloat64Slice(name string) ([]float64, error) { + val, err := f.getFlagType(name, "float64Slice", float64SliceConv) + if err != nil { + return []float64{}, err + } + return val.([]float64), nil +} + +// Float64SliceVar defines a float64Slice flag with specified name, default value, and usage string. +// The argument p points to a []float64 variable in which to store the value of the flag. +func (f *FlagSet) Float64SliceVar(p *[]float64, name string, value []float64, usage string) { + f.VarP(newFloat64SliceValue(value, p), name, "", usage) +} + +// Float64SliceVarP is like Float64SliceVar, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) Float64SliceVarP(p *[]float64, name, shorthand string, value []float64, usage string) { + f.VarP(newFloat64SliceValue(value, p), name, shorthand, usage) +} + +// Float64SliceVar defines a float64[] flag with specified name, default value, and usage string. +// The argument p points to a float64[] variable in which to store the value of the flag. +func Float64SliceVar(p *[]float64, name string, value []float64, usage string) { + CommandLine.VarP(newFloat64SliceValue(value, p), name, "", usage) +} + +// Float64SliceVarP is like Float64SliceVar, but accepts a shorthand letter that can be used after a single dash. +func Float64SliceVarP(p *[]float64, name, shorthand string, value []float64, usage string) { + CommandLine.VarP(newFloat64SliceValue(value, p), name, shorthand, usage) +} + +// Float64Slice defines a []float64 flag with specified name, default value, and usage string. +// The return value is the address of a []float64 variable that stores the value of the flag. +func (f *FlagSet) Float64Slice(name string, value []float64, usage string) *[]float64 { + p := []float64{} + f.Float64SliceVarP(&p, name, "", value, usage) + return &p +} + +// Float64SliceP is like Float64Slice, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) Float64SliceP(name, shorthand string, value []float64, usage string) *[]float64 { + p := []float64{} + f.Float64SliceVarP(&p, name, shorthand, value, usage) + return &p +} + +// Float64Slice defines a []float64 flag with specified name, default value, and usage string. +// The return value is the address of a []float64 variable that stores the value of the flag. +func Float64Slice(name string, value []float64, usage string) *[]float64 { + return CommandLine.Float64SliceP(name, "", value, usage) +} + +// Float64SliceP is like Float64Slice, but accepts a shorthand letter that can be used after a single dash. +func Float64SliceP(name, shorthand string, value []float64, usage string) *[]float64 { + return CommandLine.Float64SliceP(name, shorthand, value, usage) +} diff --git a/vendor/github.com/spf13/pflag/go.mod b/vendor/github.com/spf13/pflag/go.mod new file mode 100644 index 0000000000..b2287eec13 --- /dev/null +++ b/vendor/github.com/spf13/pflag/go.mod @@ -0,0 +1,3 @@ +module github.com/spf13/pflag + +go 1.12 diff --git a/vendor/github.com/spf13/pflag/go.sum b/vendor/github.com/spf13/pflag/go.sum new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/github.com/spf13/pflag/int32_slice.go b/vendor/github.com/spf13/pflag/int32_slice.go new file mode 100644 index 0000000000..ff128ff06d --- /dev/null +++ b/vendor/github.com/spf13/pflag/int32_slice.go @@ -0,0 +1,174 @@ +package pflag + +import ( + "fmt" + "strconv" + "strings" +) + +// -- int32Slice Value +type int32SliceValue struct { + value *[]int32 + changed bool +} + +func newInt32SliceValue(val []int32, p *[]int32) *int32SliceValue { + isv := new(int32SliceValue) + isv.value = p + *isv.value = val + return isv +} + +func (s *int32SliceValue) Set(val string) error { + ss := strings.Split(val, ",") + out := make([]int32, len(ss)) + for i, d := range ss { + var err error + var temp64 int64 + temp64, err = strconv.ParseInt(d, 0, 32) + if err != nil { + return err + } + out[i] = int32(temp64) + + } + if !s.changed { + *s.value = out + } else { + *s.value = append(*s.value, out...) + } + s.changed = true + return nil +} + +func (s *int32SliceValue) Type() string { + return "int32Slice" +} + +func (s *int32SliceValue) String() string { + out := make([]string, len(*s.value)) + for i, d := range *s.value { + out[i] = fmt.Sprintf("%d", d) + } + return "[" + strings.Join(out, ",") + "]" +} + +func (s *int32SliceValue) fromString(val string) (int32, error) { + t64, err := strconv.ParseInt(val, 0, 32) + if err != nil { + return 0, err + } + return int32(t64), nil +} + +func (s *int32SliceValue) toString(val int32) string { + return fmt.Sprintf("%d", val) +} + +func (s *int32SliceValue) Append(val string) error { + i, err := s.fromString(val) + if err != nil { + return err + } + *s.value = append(*s.value, i) + return nil +} + +func (s *int32SliceValue) Replace(val []string) error { + out := make([]int32, len(val)) + for i, d := range val { + var err error + out[i], err = s.fromString(d) + if err != nil { + return err + } + } + *s.value = out + return nil +} + +func (s *int32SliceValue) GetSlice() []string { + out := make([]string, len(*s.value)) + for i, d := range *s.value { + out[i] = s.toString(d) + } + return out +} + +func int32SliceConv(val string) (interface{}, error) { + val = strings.Trim(val, "[]") + // Empty string would cause a slice with one (empty) entry + if len(val) == 0 { + return []int32{}, nil + } + ss := strings.Split(val, ",") + out := make([]int32, len(ss)) + for i, d := range ss { + var err error + var temp64 int64 + temp64, err = strconv.ParseInt(d, 0, 32) + if err != nil { + return nil, err + } + out[i] = int32(temp64) + + } + return out, nil +} + +// GetInt32Slice return the []int32 value of a flag with the given name +func (f *FlagSet) GetInt32Slice(name string) ([]int32, error) { + val, err := f.getFlagType(name, "int32Slice", int32SliceConv) + if err != nil { + return []int32{}, err + } + return val.([]int32), nil +} + +// Int32SliceVar defines a int32Slice flag with specified name, default value, and usage string. +// The argument p points to a []int32 variable in which to store the value of the flag. +func (f *FlagSet) Int32SliceVar(p *[]int32, name string, value []int32, usage string) { + f.VarP(newInt32SliceValue(value, p), name, "", usage) +} + +// Int32SliceVarP is like Int32SliceVar, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) Int32SliceVarP(p *[]int32, name, shorthand string, value []int32, usage string) { + f.VarP(newInt32SliceValue(value, p), name, shorthand, usage) +} + +// Int32SliceVar defines a int32[] flag with specified name, default value, and usage string. +// The argument p points to a int32[] variable in which to store the value of the flag. +func Int32SliceVar(p *[]int32, name string, value []int32, usage string) { + CommandLine.VarP(newInt32SliceValue(value, p), name, "", usage) +} + +// Int32SliceVarP is like Int32SliceVar, but accepts a shorthand letter that can be used after a single dash. +func Int32SliceVarP(p *[]int32, name, shorthand string, value []int32, usage string) { + CommandLine.VarP(newInt32SliceValue(value, p), name, shorthand, usage) +} + +// Int32Slice defines a []int32 flag with specified name, default value, and usage string. +// The return value is the address of a []int32 variable that stores the value of the flag. +func (f *FlagSet) Int32Slice(name string, value []int32, usage string) *[]int32 { + p := []int32{} + f.Int32SliceVarP(&p, name, "", value, usage) + return &p +} + +// Int32SliceP is like Int32Slice, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) Int32SliceP(name, shorthand string, value []int32, usage string) *[]int32 { + p := []int32{} + f.Int32SliceVarP(&p, name, shorthand, value, usage) + return &p +} + +// Int32Slice defines a []int32 flag with specified name, default value, and usage string. +// The return value is the address of a []int32 variable that stores the value of the flag. +func Int32Slice(name string, value []int32, usage string) *[]int32 { + return CommandLine.Int32SliceP(name, "", value, usage) +} + +// Int32SliceP is like Int32Slice, but accepts a shorthand letter that can be used after a single dash. +func Int32SliceP(name, shorthand string, value []int32, usage string) *[]int32 { + return CommandLine.Int32SliceP(name, shorthand, value, usage) +} diff --git a/vendor/github.com/spf13/pflag/int64_slice.go b/vendor/github.com/spf13/pflag/int64_slice.go new file mode 100644 index 0000000000..25464638f3 --- /dev/null +++ b/vendor/github.com/spf13/pflag/int64_slice.go @@ -0,0 +1,166 @@ +package pflag + +import ( + "fmt" + "strconv" + "strings" +) + +// -- int64Slice Value +type int64SliceValue struct { + value *[]int64 + changed bool +} + +func newInt64SliceValue(val []int64, p *[]int64) *int64SliceValue { + isv := new(int64SliceValue) + isv.value = p + *isv.value = val + return isv +} + +func (s *int64SliceValue) Set(val string) error { + ss := strings.Split(val, ",") + out := make([]int64, len(ss)) + for i, d := range ss { + var err error + out[i], err = strconv.ParseInt(d, 0, 64) + if err != nil { + return err + } + + } + if !s.changed { + *s.value = out + } else { + *s.value = append(*s.value, out...) + } + s.changed = true + return nil +} + +func (s *int64SliceValue) Type() string { + return "int64Slice" +} + +func (s *int64SliceValue) String() string { + out := make([]string, len(*s.value)) + for i, d := range *s.value { + out[i] = fmt.Sprintf("%d", d) + } + return "[" + strings.Join(out, ",") + "]" +} + +func (s *int64SliceValue) fromString(val string) (int64, error) { + return strconv.ParseInt(val, 0, 64) +} + +func (s *int64SliceValue) toString(val int64) string { + return fmt.Sprintf("%d", val) +} + +func (s *int64SliceValue) Append(val string) error { + i, err := s.fromString(val) + if err != nil { + return err + } + *s.value = append(*s.value, i) + return nil +} + +func (s *int64SliceValue) Replace(val []string) error { + out := make([]int64, len(val)) + for i, d := range val { + var err error + out[i], err = s.fromString(d) + if err != nil { + return err + } + } + *s.value = out + return nil +} + +func (s *int64SliceValue) GetSlice() []string { + out := make([]string, len(*s.value)) + for i, d := range *s.value { + out[i] = s.toString(d) + } + return out +} + +func int64SliceConv(val string) (interface{}, error) { + val = strings.Trim(val, "[]") + // Empty string would cause a slice with one (empty) entry + if len(val) == 0 { + return []int64{}, nil + } + ss := strings.Split(val, ",") + out := make([]int64, len(ss)) + for i, d := range ss { + var err error + out[i], err = strconv.ParseInt(d, 0, 64) + if err != nil { + return nil, err + } + + } + return out, nil +} + +// GetInt64Slice return the []int64 value of a flag with the given name +func (f *FlagSet) GetInt64Slice(name string) ([]int64, error) { + val, err := f.getFlagType(name, "int64Slice", int64SliceConv) + if err != nil { + return []int64{}, err + } + return val.([]int64), nil +} + +// Int64SliceVar defines a int64Slice flag with specified name, default value, and usage string. +// The argument p points to a []int64 variable in which to store the value of the flag. +func (f *FlagSet) Int64SliceVar(p *[]int64, name string, value []int64, usage string) { + f.VarP(newInt64SliceValue(value, p), name, "", usage) +} + +// Int64SliceVarP is like Int64SliceVar, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) Int64SliceVarP(p *[]int64, name, shorthand string, value []int64, usage string) { + f.VarP(newInt64SliceValue(value, p), name, shorthand, usage) +} + +// Int64SliceVar defines a int64[] flag with specified name, default value, and usage string. +// The argument p points to a int64[] variable in which to store the value of the flag. +func Int64SliceVar(p *[]int64, name string, value []int64, usage string) { + CommandLine.VarP(newInt64SliceValue(value, p), name, "", usage) +} + +// Int64SliceVarP is like Int64SliceVar, but accepts a shorthand letter that can be used after a single dash. +func Int64SliceVarP(p *[]int64, name, shorthand string, value []int64, usage string) { + CommandLine.VarP(newInt64SliceValue(value, p), name, shorthand, usage) +} + +// Int64Slice defines a []int64 flag with specified name, default value, and usage string. +// The return value is the address of a []int64 variable that stores the value of the flag. +func (f *FlagSet) Int64Slice(name string, value []int64, usage string) *[]int64 { + p := []int64{} + f.Int64SliceVarP(&p, name, "", value, usage) + return &p +} + +// Int64SliceP is like Int64Slice, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) Int64SliceP(name, shorthand string, value []int64, usage string) *[]int64 { + p := []int64{} + f.Int64SliceVarP(&p, name, shorthand, value, usage) + return &p +} + +// Int64Slice defines a []int64 flag with specified name, default value, and usage string. +// The return value is the address of a []int64 variable that stores the value of the flag. +func Int64Slice(name string, value []int64, usage string) *[]int64 { + return CommandLine.Int64SliceP(name, "", value, usage) +} + +// Int64SliceP is like Int64Slice, but accepts a shorthand letter that can be used after a single dash. +func Int64SliceP(name, shorthand string, value []int64, usage string) *[]int64 { + return CommandLine.Int64SliceP(name, shorthand, value, usage) +} diff --git a/vendor/github.com/spf13/pflag/int_slice.go b/vendor/github.com/spf13/pflag/int_slice.go index 1e7c9edde9..e71c39d91a 100644 --- a/vendor/github.com/spf13/pflag/int_slice.go +++ b/vendor/github.com/spf13/pflag/int_slice.go @@ -51,6 +51,36 @@ func (s *intSliceValue) String() string { return "[" + strings.Join(out, ",") + "]" } +func (s *intSliceValue) Append(val string) error { + i, err := strconv.Atoi(val) + if err != nil { + return err + } + *s.value = append(*s.value, i) + return nil +} + +func (s *intSliceValue) Replace(val []string) error { + out := make([]int, len(val)) + for i, d := range val { + var err error + out[i], err = strconv.Atoi(d) + if err != nil { + return err + } + } + *s.value = out + return nil +} + +func (s *intSliceValue) GetSlice() []string { + out := make([]string, len(*s.value)) + for i, d := range *s.value { + out[i] = strconv.Itoa(d) + } + return out +} + func intSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry diff --git a/vendor/github.com/spf13/pflag/ip_slice.go b/vendor/github.com/spf13/pflag/ip_slice.go index 7dd196fe3f..775faae4fd 100644 --- a/vendor/github.com/spf13/pflag/ip_slice.go +++ b/vendor/github.com/spf13/pflag/ip_slice.go @@ -72,9 +72,47 @@ func (s *ipSliceValue) String() string { return "[" + out + "]" } +func (s *ipSliceValue) fromString(val string) (net.IP, error) { + return net.ParseIP(strings.TrimSpace(val)), nil +} + +func (s *ipSliceValue) toString(val net.IP) string { + return val.String() +} + +func (s *ipSliceValue) Append(val string) error { + i, err := s.fromString(val) + if err != nil { + return err + } + *s.value = append(*s.value, i) + return nil +} + +func (s *ipSliceValue) Replace(val []string) error { + out := make([]net.IP, len(val)) + for i, d := range val { + var err error + out[i], err = s.fromString(d) + if err != nil { + return err + } + } + *s.value = out + return nil +} + +func (s *ipSliceValue) GetSlice() []string { + out := make([]string, len(*s.value)) + for i, d := range *s.value { + out[i] = s.toString(d) + } + return out +} + func ipSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") - // Emtpy string would cause a slice with one (empty) entry + // Empty string would cause a slice with one (empty) entry if len(val) == 0 { return []net.IP{}, nil } diff --git a/vendor/github.com/spf13/pflag/string_array.go b/vendor/github.com/spf13/pflag/string_array.go index fa7bc60187..4894af8180 100644 --- a/vendor/github.com/spf13/pflag/string_array.go +++ b/vendor/github.com/spf13/pflag/string_array.go @@ -23,6 +23,32 @@ func (s *stringArrayValue) Set(val string) error { return nil } +func (s *stringArrayValue) Append(val string) error { + *s.value = append(*s.value, val) + return nil +} + +func (s *stringArrayValue) Replace(val []string) error { + out := make([]string, len(val)) + for i, d := range val { + var err error + out[i] = d + if err != nil { + return err + } + } + *s.value = out + return nil +} + +func (s *stringArrayValue) GetSlice() []string { + out := make([]string, len(*s.value)) + for i, d := range *s.value { + out[i] = d + } + return out +} + func (s *stringArrayValue) Type() string { return "stringArray" } diff --git a/vendor/github.com/spf13/pflag/string_slice.go b/vendor/github.com/spf13/pflag/string_slice.go index 0cd3ccc083..3cb2e69dba 100644 --- a/vendor/github.com/spf13/pflag/string_slice.go +++ b/vendor/github.com/spf13/pflag/string_slice.go @@ -62,6 +62,20 @@ func (s *stringSliceValue) String() string { return "[" + str + "]" } +func (s *stringSliceValue) Append(val string) error { + *s.value = append(*s.value, val) + return nil +} + +func (s *stringSliceValue) Replace(val []string) error { + *s.value = val + return nil +} + +func (s *stringSliceValue) GetSlice() []string { + return *s.value +} + func stringSliceConv(sval string) (interface{}, error) { sval = sval[1 : len(sval)-1] // An empty string would cause a slice with one (empty) string @@ -84,7 +98,7 @@ func (f *FlagSet) GetStringSlice(name string) ([]string, error) { // The argument p points to a []string variable in which to store the value of the flag. // Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. // For example: -// --ss="v1,v2" -ss="v3" +// --ss="v1,v2" --ss="v3" // will result in // []string{"v1", "v2", "v3"} func (f *FlagSet) StringSliceVar(p *[]string, name string, value []string, usage string) { @@ -100,7 +114,7 @@ func (f *FlagSet) StringSliceVarP(p *[]string, name, shorthand string, value []s // The argument p points to a []string variable in which to store the value of the flag. // Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. // For example: -// --ss="v1,v2" -ss="v3" +// --ss="v1,v2" --ss="v3" // will result in // []string{"v1", "v2", "v3"} func StringSliceVar(p *[]string, name string, value []string, usage string) { @@ -116,7 +130,7 @@ func StringSliceVarP(p *[]string, name, shorthand string, value []string, usage // The return value is the address of a []string variable that stores the value of the flag. // Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. // For example: -// --ss="v1,v2" -ss="v3" +// --ss="v1,v2" --ss="v3" // will result in // []string{"v1", "v2", "v3"} func (f *FlagSet) StringSlice(name string, value []string, usage string) *[]string { @@ -136,7 +150,7 @@ func (f *FlagSet) StringSliceP(name, shorthand string, value []string, usage str // The return value is the address of a []string variable that stores the value of the flag. // Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. // For example: -// --ss="v1,v2" -ss="v3" +// --ss="v1,v2" --ss="v3" // will result in // []string{"v1", "v2", "v3"} func StringSlice(name string, value []string, usage string) *[]string { diff --git a/vendor/github.com/spf13/pflag/string_to_int64.go b/vendor/github.com/spf13/pflag/string_to_int64.go new file mode 100644 index 0000000000..a807a04a0b --- /dev/null +++ b/vendor/github.com/spf13/pflag/string_to_int64.go @@ -0,0 +1,149 @@ +package pflag + +import ( + "bytes" + "fmt" + "strconv" + "strings" +) + +// -- stringToInt64 Value +type stringToInt64Value struct { + value *map[string]int64 + changed bool +} + +func newStringToInt64Value(val map[string]int64, p *map[string]int64) *stringToInt64Value { + ssv := new(stringToInt64Value) + ssv.value = p + *ssv.value = val + return ssv +} + +// Format: a=1,b=2 +func (s *stringToInt64Value) Set(val string) error { + ss := strings.Split(val, ",") + out := make(map[string]int64, len(ss)) + for _, pair := range ss { + kv := strings.SplitN(pair, "=", 2) + if len(kv) != 2 { + return fmt.Errorf("%s must be formatted as key=value", pair) + } + var err error + out[kv[0]], err = strconv.ParseInt(kv[1], 10, 64) + if err != nil { + return err + } + } + if !s.changed { + *s.value = out + } else { + for k, v := range out { + (*s.value)[k] = v + } + } + s.changed = true + return nil +} + +func (s *stringToInt64Value) Type() string { + return "stringToInt64" +} + +func (s *stringToInt64Value) String() string { + var buf bytes.Buffer + i := 0 + for k, v := range *s.value { + if i > 0 { + buf.WriteRune(',') + } + buf.WriteString(k) + buf.WriteRune('=') + buf.WriteString(strconv.FormatInt(v, 10)) + i++ + } + return "[" + buf.String() + "]" +} + +func stringToInt64Conv(val string) (interface{}, error) { + val = strings.Trim(val, "[]") + // An empty string would cause an empty map + if len(val) == 0 { + return map[string]int64{}, nil + } + ss := strings.Split(val, ",") + out := make(map[string]int64, len(ss)) + for _, pair := range ss { + kv := strings.SplitN(pair, "=", 2) + if len(kv) != 2 { + return nil, fmt.Errorf("%s must be formatted as key=value", pair) + } + var err error + out[kv[0]], err = strconv.ParseInt(kv[1], 10, 64) + if err != nil { + return nil, err + } + } + return out, nil +} + +// GetStringToInt64 return the map[string]int64 value of a flag with the given name +func (f *FlagSet) GetStringToInt64(name string) (map[string]int64, error) { + val, err := f.getFlagType(name, "stringToInt64", stringToInt64Conv) + if err != nil { + return map[string]int64{}, err + } + return val.(map[string]int64), nil +} + +// StringToInt64Var defines a string flag with specified name, default value, and usage string. +// The argument p point64s to a map[string]int64 variable in which to store the values of the multiple flags. +// The value of each argument will not try to be separated by comma +func (f *FlagSet) StringToInt64Var(p *map[string]int64, name string, value map[string]int64, usage string) { + f.VarP(newStringToInt64Value(value, p), name, "", usage) +} + +// StringToInt64VarP is like StringToInt64Var, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) StringToInt64VarP(p *map[string]int64, name, shorthand string, value map[string]int64, usage string) { + f.VarP(newStringToInt64Value(value, p), name, shorthand, usage) +} + +// StringToInt64Var defines a string flag with specified name, default value, and usage string. +// The argument p point64s to a map[string]int64 variable in which to store the value of the flag. +// The value of each argument will not try to be separated by comma +func StringToInt64Var(p *map[string]int64, name string, value map[string]int64, usage string) { + CommandLine.VarP(newStringToInt64Value(value, p), name, "", usage) +} + +// StringToInt64VarP is like StringToInt64Var, but accepts a shorthand letter that can be used after a single dash. +func StringToInt64VarP(p *map[string]int64, name, shorthand string, value map[string]int64, usage string) { + CommandLine.VarP(newStringToInt64Value(value, p), name, shorthand, usage) +} + +// StringToInt64 defines a string flag with specified name, default value, and usage string. +// The return value is the address of a map[string]int64 variable that stores the value of the flag. +// The value of each argument will not try to be separated by comma +func (f *FlagSet) StringToInt64(name string, value map[string]int64, usage string) *map[string]int64 { + p := map[string]int64{} + f.StringToInt64VarP(&p, name, "", value, usage) + return &p +} + +// StringToInt64P is like StringToInt64, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) StringToInt64P(name, shorthand string, value map[string]int64, usage string) *map[string]int64 { + p := map[string]int64{} + f.StringToInt64VarP(&p, name, shorthand, value, usage) + return &p +} + +// StringToInt64 defines a string flag with specified name, default value, and usage string. +// The return value is the address of a map[string]int64 variable that stores the value of the flag. +// The value of each argument will not try to be separated by comma +func StringToInt64(name string, value map[string]int64, usage string) *map[string]int64 { + return CommandLine.StringToInt64P(name, "", value, usage) +} + +// StringToInt64P is like StringToInt64, but accepts a shorthand letter that can be used after a single dash. +func StringToInt64P(name, shorthand string, value map[string]int64, usage string) *map[string]int64 { + return CommandLine.StringToInt64P(name, shorthand, value, usage) +} diff --git a/vendor/github.com/spf13/pflag/uint_slice.go b/vendor/github.com/spf13/pflag/uint_slice.go index edd94c600a..5fa924835e 100644 --- a/vendor/github.com/spf13/pflag/uint_slice.go +++ b/vendor/github.com/spf13/pflag/uint_slice.go @@ -50,6 +50,48 @@ func (s *uintSliceValue) String() string { return "[" + strings.Join(out, ",") + "]" } +func (s *uintSliceValue) fromString(val string) (uint, error) { + t, err := strconv.ParseUint(val, 10, 0) + if err != nil { + return 0, err + } + return uint(t), nil +} + +func (s *uintSliceValue) toString(val uint) string { + return fmt.Sprintf("%d", val) +} + +func (s *uintSliceValue) Append(val string) error { + i, err := s.fromString(val) + if err != nil { + return err + } + *s.value = append(*s.value, i) + return nil +} + +func (s *uintSliceValue) Replace(val []string) error { + out := make([]uint, len(val)) + for i, d := range val { + var err error + out[i], err = s.fromString(d) + if err != nil { + return err + } + } + *s.value = out + return nil +} + +func (s *uintSliceValue) GetSlice() []string { + out := make([]string, len(*s.value)) + for i, d := range *s.value { + out[i] = s.toString(d) + } + return out +} + func uintSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry diff --git a/vendor/github.com/stretchr/testify/assert/assertion_compare.go b/vendor/github.com/stretchr/testify/assert/assertion_compare.go index dc200395ce..41649d2679 100644 --- a/vendor/github.com/stretchr/testify/assert/assertion_compare.go +++ b/vendor/github.com/stretchr/testify/assert/assertion_compare.go @@ -13,12 +13,42 @@ const ( compareGreater ) +var ( + intType = reflect.TypeOf(int(1)) + int8Type = reflect.TypeOf(int8(1)) + int16Type = reflect.TypeOf(int16(1)) + int32Type = reflect.TypeOf(int32(1)) + int64Type = reflect.TypeOf(int64(1)) + + uintType = reflect.TypeOf(uint(1)) + uint8Type = reflect.TypeOf(uint8(1)) + uint16Type = reflect.TypeOf(uint16(1)) + uint32Type = reflect.TypeOf(uint32(1)) + uint64Type = reflect.TypeOf(uint64(1)) + + float32Type = reflect.TypeOf(float32(1)) + float64Type = reflect.TypeOf(float64(1)) + + stringType = reflect.TypeOf("") +) + func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { + obj1Value := reflect.ValueOf(obj1) + obj2Value := reflect.ValueOf(obj2) + + // throughout this switch we try and avoid calling .Convert() if possible, + // as this has a pretty big performance impact switch kind { case reflect.Int: { - intobj1 := obj1.(int) - intobj2 := obj2.(int) + intobj1, ok := obj1.(int) + if !ok { + intobj1 = obj1Value.Convert(intType).Interface().(int) + } + intobj2, ok := obj2.(int) + if !ok { + intobj2 = obj2Value.Convert(intType).Interface().(int) + } if intobj1 > intobj2 { return compareGreater, true } @@ -31,8 +61,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Int8: { - int8obj1 := obj1.(int8) - int8obj2 := obj2.(int8) + int8obj1, ok := obj1.(int8) + if !ok { + int8obj1 = obj1Value.Convert(int8Type).Interface().(int8) + } + int8obj2, ok := obj2.(int8) + if !ok { + int8obj2 = obj2Value.Convert(int8Type).Interface().(int8) + } if int8obj1 > int8obj2 { return compareGreater, true } @@ -45,8 +81,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Int16: { - int16obj1 := obj1.(int16) - int16obj2 := obj2.(int16) + int16obj1, ok := obj1.(int16) + if !ok { + int16obj1 = obj1Value.Convert(int16Type).Interface().(int16) + } + int16obj2, ok := obj2.(int16) + if !ok { + int16obj2 = obj2Value.Convert(int16Type).Interface().(int16) + } if int16obj1 > int16obj2 { return compareGreater, true } @@ -59,8 +101,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Int32: { - int32obj1 := obj1.(int32) - int32obj2 := obj2.(int32) + int32obj1, ok := obj1.(int32) + if !ok { + int32obj1 = obj1Value.Convert(int32Type).Interface().(int32) + } + int32obj2, ok := obj2.(int32) + if !ok { + int32obj2 = obj2Value.Convert(int32Type).Interface().(int32) + } if int32obj1 > int32obj2 { return compareGreater, true } @@ -73,8 +121,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Int64: { - int64obj1 := obj1.(int64) - int64obj2 := obj2.(int64) + int64obj1, ok := obj1.(int64) + if !ok { + int64obj1 = obj1Value.Convert(int64Type).Interface().(int64) + } + int64obj2, ok := obj2.(int64) + if !ok { + int64obj2 = obj2Value.Convert(int64Type).Interface().(int64) + } if int64obj1 > int64obj2 { return compareGreater, true } @@ -87,8 +141,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint: { - uintobj1 := obj1.(uint) - uintobj2 := obj2.(uint) + uintobj1, ok := obj1.(uint) + if !ok { + uintobj1 = obj1Value.Convert(uintType).Interface().(uint) + } + uintobj2, ok := obj2.(uint) + if !ok { + uintobj2 = obj2Value.Convert(uintType).Interface().(uint) + } if uintobj1 > uintobj2 { return compareGreater, true } @@ -101,8 +161,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint8: { - uint8obj1 := obj1.(uint8) - uint8obj2 := obj2.(uint8) + uint8obj1, ok := obj1.(uint8) + if !ok { + uint8obj1 = obj1Value.Convert(uint8Type).Interface().(uint8) + } + uint8obj2, ok := obj2.(uint8) + if !ok { + uint8obj2 = obj2Value.Convert(uint8Type).Interface().(uint8) + } if uint8obj1 > uint8obj2 { return compareGreater, true } @@ -115,8 +181,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint16: { - uint16obj1 := obj1.(uint16) - uint16obj2 := obj2.(uint16) + uint16obj1, ok := obj1.(uint16) + if !ok { + uint16obj1 = obj1Value.Convert(uint16Type).Interface().(uint16) + } + uint16obj2, ok := obj2.(uint16) + if !ok { + uint16obj2 = obj2Value.Convert(uint16Type).Interface().(uint16) + } if uint16obj1 > uint16obj2 { return compareGreater, true } @@ -129,8 +201,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint32: { - uint32obj1 := obj1.(uint32) - uint32obj2 := obj2.(uint32) + uint32obj1, ok := obj1.(uint32) + if !ok { + uint32obj1 = obj1Value.Convert(uint32Type).Interface().(uint32) + } + uint32obj2, ok := obj2.(uint32) + if !ok { + uint32obj2 = obj2Value.Convert(uint32Type).Interface().(uint32) + } if uint32obj1 > uint32obj2 { return compareGreater, true } @@ -143,8 +221,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint64: { - uint64obj1 := obj1.(uint64) - uint64obj2 := obj2.(uint64) + uint64obj1, ok := obj1.(uint64) + if !ok { + uint64obj1 = obj1Value.Convert(uint64Type).Interface().(uint64) + } + uint64obj2, ok := obj2.(uint64) + if !ok { + uint64obj2 = obj2Value.Convert(uint64Type).Interface().(uint64) + } if uint64obj1 > uint64obj2 { return compareGreater, true } @@ -157,8 +241,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Float32: { - float32obj1 := obj1.(float32) - float32obj2 := obj2.(float32) + float32obj1, ok := obj1.(float32) + if !ok { + float32obj1 = obj1Value.Convert(float32Type).Interface().(float32) + } + float32obj2, ok := obj2.(float32) + if !ok { + float32obj2 = obj2Value.Convert(float32Type).Interface().(float32) + } if float32obj1 > float32obj2 { return compareGreater, true } @@ -171,8 +261,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Float64: { - float64obj1 := obj1.(float64) - float64obj2 := obj2.(float64) + float64obj1, ok := obj1.(float64) + if !ok { + float64obj1 = obj1Value.Convert(float64Type).Interface().(float64) + } + float64obj2, ok := obj2.(float64) + if !ok { + float64obj2 = obj2Value.Convert(float64Type).Interface().(float64) + } if float64obj1 > float64obj2 { return compareGreater, true } @@ -185,8 +281,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.String: { - stringobj1 := obj1.(string) - stringobj2 := obj2.(string) + stringobj1, ok := obj1.(string) + if !ok { + stringobj1 = obj1Value.Convert(stringType).Interface().(string) + } + stringobj2, ok := obj2.(string) + if !ok { + stringobj2 = obj2Value.Convert(stringType).Interface().(string) + } if stringobj1 > stringobj2 { return compareGreater, true } @@ -240,6 +342,24 @@ func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...inter return compareTwoValues(t, e1, e2, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs) } +// Positive asserts that the specified element is positive +// +// assert.Positive(t, 1) +// assert.Positive(t, 1.23) +func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) bool { + zero := reflect.Zero(reflect.TypeOf(e)) + return compareTwoValues(t, e, zero.Interface(), []CompareType{compareGreater}, "\"%v\" is not positive", msgAndArgs) +} + +// Negative asserts that the specified element is negative +// +// assert.Negative(t, -1) +// assert.Negative(t, -1.23) +func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) bool { + zero := reflect.Zero(reflect.TypeOf(e)) + return compareTwoValues(t, e, zero.Interface(), []CompareType{compareLess}, "\"%v\" is not negative", msgAndArgs) +} + func compareTwoValues(t TestingT, e1 interface{}, e2 interface{}, allowedComparesResults []CompareType, failMessage string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() diff --git a/vendor/github.com/stretchr/testify/assert/assertion_format.go b/vendor/github.com/stretchr/testify/assert/assertion_format.go index 49370eb167..4dfd1229a8 100644 --- a/vendor/github.com/stretchr/testify/assert/assertion_format.go +++ b/vendor/github.com/stretchr/testify/assert/assertion_format.go @@ -114,6 +114,24 @@ func Errorf(t TestingT, err error, msg string, args ...interface{}) bool { return Error(t, err, append([]interface{}{msg}, args...)...) } +// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return ErrorAs(t, err, target, append([]interface{}{msg}, args...)...) +} + +// ErrorIsf asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return ErrorIs(t, err, target, append([]interface{}{msg}, args...)...) +} + // Eventuallyf asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // @@ -321,6 +339,54 @@ func InEpsilonSlicef(t TestingT, expected interface{}, actual interface{}, epsil return InEpsilonSlice(t, expected, actual, epsilon, append([]interface{}{msg}, args...)...) } +// IsDecreasingf asserts that the collection is decreasing +// +// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted") +func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return IsDecreasing(t, object, append([]interface{}{msg}, args...)...) +} + +// IsIncreasingf asserts that the collection is increasing +// +// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted") +func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return IsIncreasing(t, object, append([]interface{}{msg}, args...)...) +} + +// IsNonDecreasingf asserts that the collection is not decreasing +// +// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted") +func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return IsNonDecreasing(t, object, append([]interface{}{msg}, args...)...) +} + +// IsNonIncreasingf asserts that the collection is not increasing +// +// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted") +func IsNonIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return IsNonIncreasing(t, object, append([]interface{}{msg}, args...)...) +} + // IsTypef asserts that the specified objects are of the same type. func IsTypef(t TestingT, expectedType interface{}, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { @@ -375,6 +441,17 @@ func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args . return LessOrEqual(t, e1, e2, append([]interface{}{msg}, args...)...) } +// Negativef asserts that the specified element is negative +// +// assert.Negativef(t, -1, "error message %s", "formatted") +// assert.Negativef(t, -1.23, "error message %s", "formatted") +func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return Negative(t, e, append([]interface{}{msg}, args...)...) +} + // Neverf asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // @@ -476,6 +553,15 @@ func NotEqualValuesf(t TestingT, expected interface{}, actual interface{}, msg s return NotEqualValues(t, expected, actual, append([]interface{}{msg}, args...)...) } +// NotErrorIsf asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func NotErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return NotErrorIs(t, err, target, append([]interface{}{msg}, args...)...) +} + // NotNilf asserts that the specified object is not nil. // // assert.NotNilf(t, err, "error message %s", "formatted") @@ -572,6 +658,17 @@ func PanicsWithValuef(t TestingT, expected interface{}, f PanicTestFunc, msg str return PanicsWithValue(t, expected, f, append([]interface{}{msg}, args...)...) } +// Positivef asserts that the specified element is positive +// +// assert.Positivef(t, 1, "error message %s", "formatted") +// assert.Positivef(t, 1.23, "error message %s", "formatted") +func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return Positive(t, e, append([]interface{}{msg}, args...)...) +} + // Regexpf asserts that a specified regexp matches a string. // // assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") diff --git a/vendor/github.com/stretchr/testify/assert/assertion_forward.go b/vendor/github.com/stretchr/testify/assert/assertion_forward.go index 9db889427a..25337a6f07 100644 --- a/vendor/github.com/stretchr/testify/assert/assertion_forward.go +++ b/vendor/github.com/stretchr/testify/assert/assertion_forward.go @@ -204,6 +204,42 @@ func (a *Assertions) Error(err error, msgAndArgs ...interface{}) bool { return Error(a.t, err, msgAndArgs...) } +// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func (a *Assertions) ErrorAs(err error, target interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return ErrorAs(a.t, err, target, msgAndArgs...) +} + +// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return ErrorAsf(a.t, err, target, msg, args...) +} + +// ErrorIs asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) ErrorIs(err error, target error, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return ErrorIs(a.t, err, target, msgAndArgs...) +} + +// ErrorIsf asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return ErrorIsf(a.t, err, target, msg, args...) +} + // Errorf asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() @@ -631,6 +667,102 @@ func (a *Assertions) InEpsilonf(expected interface{}, actual interface{}, epsilo return InEpsilonf(a.t, expected, actual, epsilon, msg, args...) } +// IsDecreasing asserts that the collection is decreasing +// +// a.IsDecreasing([]int{2, 1, 0}) +// a.IsDecreasing([]float{2, 1}) +// a.IsDecreasing([]string{"b", "a"}) +func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsDecreasing(a.t, object, msgAndArgs...) +} + +// IsDecreasingf asserts that the collection is decreasing +// +// a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted") +// a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted") +// a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted") +func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsDecreasingf(a.t, object, msg, args...) +} + +// IsIncreasing asserts that the collection is increasing +// +// a.IsIncreasing([]int{1, 2, 3}) +// a.IsIncreasing([]float{1, 2}) +// a.IsIncreasing([]string{"a", "b"}) +func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsIncreasing(a.t, object, msgAndArgs...) +} + +// IsIncreasingf asserts that the collection is increasing +// +// a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted") +// a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted") +// a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted") +func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsIncreasingf(a.t, object, msg, args...) +} + +// IsNonDecreasing asserts that the collection is not decreasing +// +// a.IsNonDecreasing([]int{1, 1, 2}) +// a.IsNonDecreasing([]float{1, 2}) +// a.IsNonDecreasing([]string{"a", "b"}) +func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsNonDecreasing(a.t, object, msgAndArgs...) +} + +// IsNonDecreasingf asserts that the collection is not decreasing +// +// a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted") +// a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted") +// a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted") +func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsNonDecreasingf(a.t, object, msg, args...) +} + +// IsNonIncreasing asserts that the collection is not increasing +// +// a.IsNonIncreasing([]int{2, 1, 1}) +// a.IsNonIncreasing([]float{2, 1}) +// a.IsNonIncreasing([]string{"b", "a"}) +func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsNonIncreasing(a.t, object, msgAndArgs...) +} + +// IsNonIncreasingf asserts that the collection is not increasing +// +// a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted") +// a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted") +// a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted") +func (a *Assertions) IsNonIncreasingf(object interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsNonIncreasingf(a.t, object, msg, args...) +} + // IsType asserts that the specified objects are of the same type. func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { @@ -739,6 +871,28 @@ func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...i return Lessf(a.t, e1, e2, msg, args...) } +// Negative asserts that the specified element is negative +// +// a.Negative(-1) +// a.Negative(-1.23) +func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return Negative(a.t, e, msgAndArgs...) +} + +// Negativef asserts that the specified element is negative +// +// a.Negativef(-1, "error message %s", "formatted") +// a.Negativef(-1.23, "error message %s", "formatted") +func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return Negativef(a.t, e, msg, args...) +} + // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // @@ -941,6 +1095,24 @@ func (a *Assertions) NotEqualf(expected interface{}, actual interface{}, msg str return NotEqualf(a.t, expected, actual, msg, args...) } +// NotErrorIs asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) NotErrorIs(err error, target error, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return NotErrorIs(a.t, err, target, msgAndArgs...) +} + +// NotErrorIsf asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return NotErrorIsf(a.t, err, target, msg, args...) +} + // NotNil asserts that the specified object is not nil. // // a.NotNil(err) @@ -1133,6 +1305,28 @@ func (a *Assertions) Panicsf(f PanicTestFunc, msg string, args ...interface{}) b return Panicsf(a.t, f, msg, args...) } +// Positive asserts that the specified element is positive +// +// a.Positive(1) +// a.Positive(1.23) +func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return Positive(a.t, e, msgAndArgs...) +} + +// Positivef asserts that the specified element is positive +// +// a.Positivef(1, "error message %s", "formatted") +// a.Positivef(1.23, "error message %s", "formatted") +func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return Positivef(a.t, e, msg, args...) +} + // Regexp asserts that a specified regexp matches a string. // // a.Regexp(regexp.MustCompile("start"), "it's starting") diff --git a/vendor/github.com/stretchr/testify/assert/assertion_order.go b/vendor/github.com/stretchr/testify/assert/assertion_order.go new file mode 100644 index 0000000000..1c3b47182a --- /dev/null +++ b/vendor/github.com/stretchr/testify/assert/assertion_order.go @@ -0,0 +1,81 @@ +package assert + +import ( + "fmt" + "reflect" +) + +// isOrdered checks that collection contains orderable elements. +func isOrdered(t TestingT, object interface{}, allowedComparesResults []CompareType, failMessage string, msgAndArgs ...interface{}) bool { + objKind := reflect.TypeOf(object).Kind() + if objKind != reflect.Slice && objKind != reflect.Array { + return false + } + + objValue := reflect.ValueOf(object) + objLen := objValue.Len() + + if objLen <= 1 { + return true + } + + value := objValue.Index(0) + valueInterface := value.Interface() + firstValueKind := value.Kind() + + for i := 1; i < objLen; i++ { + prevValue := value + prevValueInterface := valueInterface + + value = objValue.Index(i) + valueInterface = value.Interface() + + compareResult, isComparable := compare(prevValueInterface, valueInterface, firstValueKind) + + if !isComparable { + return Fail(t, fmt.Sprintf("Can not compare type \"%s\" and \"%s\"", reflect.TypeOf(value), reflect.TypeOf(prevValue)), msgAndArgs...) + } + + if !containsValue(allowedComparesResults, compareResult) { + return Fail(t, fmt.Sprintf(failMessage, prevValue, value), msgAndArgs...) + } + } + + return true +} + +// IsIncreasing asserts that the collection is increasing +// +// assert.IsIncreasing(t, []int{1, 2, 3}) +// assert.IsIncreasing(t, []float{1, 2}) +// assert.IsIncreasing(t, []string{"a", "b"}) +func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + return isOrdered(t, object, []CompareType{compareLess}, "\"%v\" is not less than \"%v\"", msgAndArgs) +} + +// IsNonIncreasing asserts that the collection is not increasing +// +// assert.IsNonIncreasing(t, []int{2, 1, 1}) +// assert.IsNonIncreasing(t, []float{2, 1}) +// assert.IsNonIncreasing(t, []string{"b", "a"}) +func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + return isOrdered(t, object, []CompareType{compareEqual, compareGreater}, "\"%v\" is not greater than or equal to \"%v\"", msgAndArgs) +} + +// IsDecreasing asserts that the collection is decreasing +// +// assert.IsDecreasing(t, []int{2, 1, 0}) +// assert.IsDecreasing(t, []float{2, 1}) +// assert.IsDecreasing(t, []string{"b", "a"}) +func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + return isOrdered(t, object, []CompareType{compareGreater}, "\"%v\" is not greater than \"%v\"", msgAndArgs) +} + +// IsNonDecreasing asserts that the collection is not decreasing +// +// assert.IsNonDecreasing(t, []int{1, 1, 2}) +// assert.IsNonDecreasing(t, []float{1, 2}) +// assert.IsNonDecreasing(t, []string{"a", "b"}) +func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + return isOrdered(t, object, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs) +} diff --git a/vendor/github.com/stretchr/testify/assert/assertions.go b/vendor/github.com/stretchr/testify/assert/assertions.go index 914a10d83a..bcac4401f5 100644 --- a/vendor/github.com/stretchr/testify/assert/assertions.go +++ b/vendor/github.com/stretchr/testify/assert/assertions.go @@ -172,8 +172,8 @@ func isTest(name, prefix string) bool { if len(name) == len(prefix) { // "Test" is ok return true } - rune, _ := utf8.DecodeRuneInString(name[len(prefix):]) - return !unicode.IsLower(rune) + r, _ := utf8.DecodeRuneInString(name[len(prefix):]) + return !unicode.IsLower(r) } func messageFromMsgAndArgs(msgAndArgs ...interface{}) string { @@ -1622,6 +1622,7 @@ var spewConfig = spew.ConfigState{ DisableCapacities: true, SortKeys: true, DisableMethods: true, + MaxDepth: 10, } type tHelper interface { @@ -1693,3 +1694,81 @@ func Never(t TestingT, condition func() bool, waitFor time.Duration, tick time.D } } } + +// ErrorIs asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func ErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if errors.Is(err, target) { + return true + } + + var expectedText string + if target != nil { + expectedText = target.Error() + } + + chain := buildErrorChainString(err) + + return Fail(t, fmt.Sprintf("Target error should be in err chain:\n"+ + "expected: %q\n"+ + "in chain: %s", expectedText, chain, + ), msgAndArgs...) +} + +// NotErrorIs asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func NotErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if !errors.Is(err, target) { + return true + } + + var expectedText string + if target != nil { + expectedText = target.Error() + } + + chain := buildErrorChainString(err) + + return Fail(t, fmt.Sprintf("Target error should not be in err chain:\n"+ + "found: %q\n"+ + "in chain: %s", expectedText, chain, + ), msgAndArgs...) +} + +// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func ErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if errors.As(err, target) { + return true + } + + chain := buildErrorChainString(err) + + return Fail(t, fmt.Sprintf("Should be in error chain:\n"+ + "expected: %q\n"+ + "in chain: %s", target, chain, + ), msgAndArgs...) +} + +func buildErrorChainString(err error) string { + if err == nil { + return "" + } + + e := errors.Unwrap(err) + chain := fmt.Sprintf("%q", err.Error()) + for e != nil { + chain += fmt.Sprintf("\n\t%q", e.Error()) + e = errors.Unwrap(e) + } + return chain +} diff --git a/vendor/github.com/stretchr/testify/mock/mock.go b/vendor/github.com/stretchr/testify/mock/mock.go index c6df4485ab..e2e6a2d237 100644 --- a/vendor/github.com/stretchr/testify/mock/mock.go +++ b/vendor/github.com/stretchr/testify/mock/mock.go @@ -297,25 +297,52 @@ func (m *Mock) findExpectedCall(method string, arguments ...interface{}) (int, * return -1, expectedCall } +type matchCandidate struct { + call *Call + mismatch string + diffCount int +} + +func (c matchCandidate) isBetterMatchThan(other matchCandidate) bool { + if c.call == nil { + return false + } + if other.call == nil { + return true + } + + if c.diffCount > other.diffCount { + return false + } + if c.diffCount < other.diffCount { + return true + } + + if c.call.Repeatability > 0 && other.call.Repeatability <= 0 { + return true + } + return false +} + func (m *Mock) findClosestCall(method string, arguments ...interface{}) (*Call, string) { - var diffCount int - var closestCall *Call - var err string + var bestMatch matchCandidate for _, call := range m.expectedCalls() { if call.Method == method { errInfo, tempDiffCount := call.Arguments.Diff(arguments) - if tempDiffCount < diffCount || diffCount == 0 { - diffCount = tempDiffCount - closestCall = call - err = errInfo + tempCandidate := matchCandidate{ + call: call, + mismatch: errInfo, + diffCount: tempDiffCount, + } + if tempCandidate.isBetterMatchThan(bestMatch) { + bestMatch = tempCandidate } - } } - return closestCall, err + return bestMatch.call, bestMatch.mismatch } func callString(method string, arguments Arguments, includeArgumentValues bool) string { diff --git a/vendor/github.com/stretchr/testify/require/require.go b/vendor/github.com/stretchr/testify/require/require.go index ec4624b282..51820df2e6 100644 --- a/vendor/github.com/stretchr/testify/require/require.go +++ b/vendor/github.com/stretchr/testify/require/require.go @@ -256,6 +256,54 @@ func Error(t TestingT, err error, msgAndArgs ...interface{}) { t.FailNow() } +// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func ErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.ErrorAs(t, err, target, msgAndArgs...) { + return + } + t.FailNow() +} + +// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.ErrorAsf(t, err, target, msg, args...) { + return + } + t.FailNow() +} + +// ErrorIs asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func ErrorIs(t TestingT, err error, target error, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.ErrorIs(t, err, target, msgAndArgs...) { + return + } + t.FailNow() +} + +// ErrorIsf asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.ErrorIsf(t, err, target, msg, args...) { + return + } + t.FailNow() +} + // Errorf asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() @@ -806,6 +854,126 @@ func InEpsilonf(t TestingT, expected interface{}, actual interface{}, epsilon fl t.FailNow() } +// IsDecreasing asserts that the collection is decreasing +// +// assert.IsDecreasing(t, []int{2, 1, 0}) +// assert.IsDecreasing(t, []float{2, 1}) +// assert.IsDecreasing(t, []string{"b", "a"}) +func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsDecreasing(t, object, msgAndArgs...) { + return + } + t.FailNow() +} + +// IsDecreasingf asserts that the collection is decreasing +// +// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted") +func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsDecreasingf(t, object, msg, args...) { + return + } + t.FailNow() +} + +// IsIncreasing asserts that the collection is increasing +// +// assert.IsIncreasing(t, []int{1, 2, 3}) +// assert.IsIncreasing(t, []float{1, 2}) +// assert.IsIncreasing(t, []string{"a", "b"}) +func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsIncreasing(t, object, msgAndArgs...) { + return + } + t.FailNow() +} + +// IsIncreasingf asserts that the collection is increasing +// +// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted") +func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsIncreasingf(t, object, msg, args...) { + return + } + t.FailNow() +} + +// IsNonDecreasing asserts that the collection is not decreasing +// +// assert.IsNonDecreasing(t, []int{1, 1, 2}) +// assert.IsNonDecreasing(t, []float{1, 2}) +// assert.IsNonDecreasing(t, []string{"a", "b"}) +func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsNonDecreasing(t, object, msgAndArgs...) { + return + } + t.FailNow() +} + +// IsNonDecreasingf asserts that the collection is not decreasing +// +// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted") +func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsNonDecreasingf(t, object, msg, args...) { + return + } + t.FailNow() +} + +// IsNonIncreasing asserts that the collection is not increasing +// +// assert.IsNonIncreasing(t, []int{2, 1, 1}) +// assert.IsNonIncreasing(t, []float{2, 1}) +// assert.IsNonIncreasing(t, []string{"b", "a"}) +func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsNonIncreasing(t, object, msgAndArgs...) { + return + } + t.FailNow() +} + +// IsNonIncreasingf asserts that the collection is not increasing +// +// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted") +func IsNonIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsNonIncreasingf(t, object, msg, args...) { + return + } + t.FailNow() +} + // IsType asserts that the specified objects are of the same type. func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { @@ -944,6 +1112,34 @@ func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...inter t.FailNow() } +// Negative asserts that the specified element is negative +// +// assert.Negative(t, -1) +// assert.Negative(t, -1.23) +func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.Negative(t, e, msgAndArgs...) { + return + } + t.FailNow() +} + +// Negativef asserts that the specified element is negative +// +// assert.Negativef(t, -1, "error message %s", "formatted") +// assert.Negativef(t, -1.23, "error message %s", "formatted") +func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.Negativef(t, e, msg, args...) { + return + } + t.FailNow() +} + // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // @@ -1200,6 +1396,30 @@ func NotEqualf(t TestingT, expected interface{}, actual interface{}, msg string, t.FailNow() } +// NotErrorIs asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func NotErrorIs(t TestingT, err error, target error, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.NotErrorIs(t, err, target, msgAndArgs...) { + return + } + t.FailNow() +} + +// NotErrorIsf asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func NotErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.NotErrorIsf(t, err, target, msg, args...) { + return + } + t.FailNow() +} + // NotNil asserts that the specified object is not nil. // // assert.NotNil(t, err) @@ -1446,6 +1666,34 @@ func Panicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{} t.FailNow() } +// Positive asserts that the specified element is positive +// +// assert.Positive(t, 1) +// assert.Positive(t, 1.23) +func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.Positive(t, e, msgAndArgs...) { + return + } + t.FailNow() +} + +// Positivef asserts that the specified element is positive +// +// assert.Positivef(t, 1, "error message %s", "formatted") +// assert.Positivef(t, 1.23, "error message %s", "formatted") +func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.Positivef(t, e, msg, args...) { + return + } + t.FailNow() +} + // Regexp asserts that a specified regexp matches a string. // // assert.Regexp(t, regexp.MustCompile("start"), "it's starting") diff --git a/vendor/github.com/stretchr/testify/require/require_forward.go b/vendor/github.com/stretchr/testify/require/require_forward.go index 103d7dcb6a..ed54a9d83f 100644 --- a/vendor/github.com/stretchr/testify/require/require_forward.go +++ b/vendor/github.com/stretchr/testify/require/require_forward.go @@ -205,6 +205,42 @@ func (a *Assertions) Error(err error, msgAndArgs ...interface{}) { Error(a.t, err, msgAndArgs...) } +// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func (a *Assertions) ErrorAs(err error, target interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + ErrorAs(a.t, err, target, msgAndArgs...) +} + +// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + ErrorAsf(a.t, err, target, msg, args...) +} + +// ErrorIs asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) ErrorIs(err error, target error, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + ErrorIs(a.t, err, target, msgAndArgs...) +} + +// ErrorIsf asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + ErrorIsf(a.t, err, target, msg, args...) +} + // Errorf asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() @@ -632,6 +668,102 @@ func (a *Assertions) InEpsilonf(expected interface{}, actual interface{}, epsilo InEpsilonf(a.t, expected, actual, epsilon, msg, args...) } +// IsDecreasing asserts that the collection is decreasing +// +// a.IsDecreasing([]int{2, 1, 0}) +// a.IsDecreasing([]float{2, 1}) +// a.IsDecreasing([]string{"b", "a"}) +func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsDecreasing(a.t, object, msgAndArgs...) +} + +// IsDecreasingf asserts that the collection is decreasing +// +// a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted") +// a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted") +// a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted") +func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsDecreasingf(a.t, object, msg, args...) +} + +// IsIncreasing asserts that the collection is increasing +// +// a.IsIncreasing([]int{1, 2, 3}) +// a.IsIncreasing([]float{1, 2}) +// a.IsIncreasing([]string{"a", "b"}) +func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsIncreasing(a.t, object, msgAndArgs...) +} + +// IsIncreasingf asserts that the collection is increasing +// +// a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted") +// a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted") +// a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted") +func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsIncreasingf(a.t, object, msg, args...) +} + +// IsNonDecreasing asserts that the collection is not decreasing +// +// a.IsNonDecreasing([]int{1, 1, 2}) +// a.IsNonDecreasing([]float{1, 2}) +// a.IsNonDecreasing([]string{"a", "b"}) +func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsNonDecreasing(a.t, object, msgAndArgs...) +} + +// IsNonDecreasingf asserts that the collection is not decreasing +// +// a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted") +// a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted") +// a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted") +func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsNonDecreasingf(a.t, object, msg, args...) +} + +// IsNonIncreasing asserts that the collection is not increasing +// +// a.IsNonIncreasing([]int{2, 1, 1}) +// a.IsNonIncreasing([]float{2, 1}) +// a.IsNonIncreasing([]string{"b", "a"}) +func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsNonIncreasing(a.t, object, msgAndArgs...) +} + +// IsNonIncreasingf asserts that the collection is not increasing +// +// a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted") +// a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted") +// a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted") +func (a *Assertions) IsNonIncreasingf(object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsNonIncreasingf(a.t, object, msg, args...) +} + // IsType asserts that the specified objects are of the same type. func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { @@ -740,6 +872,28 @@ func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...i Lessf(a.t, e1, e2, msg, args...) } +// Negative asserts that the specified element is negative +// +// a.Negative(-1) +// a.Negative(-1.23) +func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + Negative(a.t, e, msgAndArgs...) +} + +// Negativef asserts that the specified element is negative +// +// a.Negativef(-1, "error message %s", "formatted") +// a.Negativef(-1.23, "error message %s", "formatted") +func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + Negativef(a.t, e, msg, args...) +} + // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // @@ -942,6 +1096,24 @@ func (a *Assertions) NotEqualf(expected interface{}, actual interface{}, msg str NotEqualf(a.t, expected, actual, msg, args...) } +// NotErrorIs asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) NotErrorIs(err error, target error, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + NotErrorIs(a.t, err, target, msgAndArgs...) +} + +// NotErrorIsf asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + NotErrorIsf(a.t, err, target, msg, args...) +} + // NotNil asserts that the specified object is not nil. // // a.NotNil(err) @@ -1134,6 +1306,28 @@ func (a *Assertions) Panicsf(f assert.PanicTestFunc, msg string, args ...interfa Panicsf(a.t, f, msg, args...) } +// Positive asserts that the specified element is positive +// +// a.Positive(1) +// a.Positive(1.23) +func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + Positive(a.t, e, msgAndArgs...) +} + +// Positivef asserts that the specified element is positive +// +// a.Positivef(1, "error message %s", "formatted") +// a.Positivef(1.23, "error message %s", "formatted") +func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + Positivef(a.t, e, msg, args...) +} + // Regexp asserts that a specified regexp matches a string. // // a.Regexp(regexp.MustCompile("start"), "it's starting") diff --git a/vendor/github.com/tjfoc/gmsm/sm4/sm4.go b/vendor/github.com/tjfoc/gmsm/sm4/sm4.go index d97f35c2dc..a87484085a 100644 --- a/vendor/github.com/tjfoc/gmsm/sm4/sm4.go +++ b/vendor/github.com/tjfoc/gmsm/sm4/sm4.go @@ -12,20 +12,16 @@ 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. -sm4 acceration +sm4 acceleration modified by Jack, 2017 Oct */ package sm4 import ( + "bytes" "crypto/cipher" - "crypto/rand" - "crypto/x509" - "encoding/pem" "errors" - "io/ioutil" - "os" "strconv" ) @@ -33,8 +29,6 @@ const BlockSize = 16 type SM4Key []byte -type KeySizeError int - // Cipher is an instance of SM4 encryption. type Sm4Cipher struct { subkeys []uint32 @@ -234,117 +228,260 @@ func generateSubKeys(key []byte) []uint32 { return subkeys } -func EncryptBlock(key SM4Key, dst, src []byte) { - subkeys := generateSubKeys(key) - cryptBlock(subkeys, make([]uint32, 4), make([]byte, 16), dst, src, false) +// NewCipher creates and returns a new cipher.Block. +func NewCipher(key []byte) (cipher.Block, error) { + if len(key) != BlockSize { + return nil, errors.New("SM4: invalid key size " + strconv.Itoa(len(key))) + } + c := new(Sm4Cipher) + c.subkeys = generateSubKeys(key) + c.block1 = make([]uint32, 4) + c.block2 = make([]byte, 16) + return c, nil +} + +func (c *Sm4Cipher) BlockSize() int { + return BlockSize } -func DecryptBlock(key SM4Key, dst, src []byte) { - subkeys := generateSubKeys(key) - cryptBlock(subkeys, make([]uint32, 4), make([]byte, 16), dst, src, true) +func (c *Sm4Cipher) Encrypt(dst, src []byte) { + cryptBlock(c.subkeys, c.block1, c.block2, dst, src, false) } -func ReadKeyFromMem(data []byte, pwd []byte) (SM4Key, error) { - block, _ := pem.Decode(data) - if block == nil { - return nil, errors.New("SM4: pem decode failed") - } - if x509.IsEncryptedPEMBlock(block) { - if block.Type != "SM4 ENCRYPTED KEY" { - return nil, errors.New("SM4: unknown type") - } - if pwd == nil { - return nil, errors.New("SM4: need passwd") - } - data, err := x509.DecryptPEMBlock(block, pwd) - if err != nil { - return nil, err - } - return data, nil + + +func (c *Sm4Cipher) Decrypt(dst, src []byte) { + cryptBlock(c.subkeys, c.block1, c.block2, dst, src, true) +} + + + +func xor(in, iv []byte) (out []byte) { + if len(in) != len(iv) { + return nil } - if block.Type != "SM4 KEY" { - return nil, errors.New("SM4: unknown type") + + out = make([]byte, len(in)) + for i := 0; i < len(in); i++ { + out[i] = in[i] ^ iv[i] } - return block.Bytes, nil + return } -func ReadKeyFromPem(FileName string, pwd []byte) (SM4Key, error) { - data, err := ioutil.ReadFile(FileName) - if err != nil { - return nil, err - } - return ReadKeyFromMem(data, pwd) +func pkcs7Padding(src []byte) []byte { + padding := BlockSize - len(src)%BlockSize + padtext := bytes.Repeat([]byte{byte(padding)}, padding) + return append(src, padtext...) } -func WriteKeytoMem(key SM4Key, pwd []byte) ([]byte, error) { - if pwd != nil { - block, err := x509.EncryptPEMBlock(rand.Reader, - "SM4 ENCRYPTED KEY", key, pwd, x509.PEMCipherAES256) - if err != nil { - return nil, err - } - return pem.EncodeToMemory(block), nil - } else { - block := &pem.Block{ - Type: "SM4 KEY", - Bytes: key, +func pkcs7UnPadding(src []byte) ([]byte, error) { + length := len(src) + unpadding := int(src[length-1]) + if unpadding > BlockSize || unpadding == 0 { + return nil, errors.New("Invalid pkcs7 padding (unpadding > BlockSize || unpadding == 0)") + } + + pad := src[len(src)-unpadding:] + for i := 0; i < unpadding; i++ { + if pad[i] != byte(unpadding) { + return nil, errors.New("Invalid pkcs7 padding (pad[i] != unpadding)") } - return pem.EncodeToMemory(block), nil } + + return src[:(length - unpadding)], nil } -func WriteKeyToPem(FileName string, key SM4Key, pwd []byte) (bool, error) { - var block *pem.Block +func Sm4Cbc(key []byte, in []byte, mode bool) (out []byte, err error) { + if len(key) != BlockSize { + return nil, errors.New("SM4: invalid key size " + strconv.Itoa(len(key))) + } + var inData []byte + if mode { + inData = pkcs7Padding(in) + } else { + inData = in + } + + iv := make([]byte, BlockSize) - if pwd != nil { - var err error - block, err = x509.EncryptPEMBlock(rand.Reader, - "SM4 ENCRYPTED KEY", key, pwd, x509.PEMCipherAES256) - if err != nil { - return false, err + out = make([]byte, len(inData)) + c, err := NewCipher(key) + if err != nil { + panic(err) + } + if mode { + for i := 0; i < len(inData)/16; i++ { + in_tmp := xor(inData[i*16:i*16+16], iv) + out_tmp := make([]byte, 16) + c.Encrypt(out_tmp, in_tmp) + copy(out[i*16:i*16+16], out_tmp) + iv = out_tmp } } else { - block = &pem.Block{ - Type: "SM4 KEY", - Bytes: key, + for i := 0; i < len(inData)/16; i++ { + in_tmp := inData[i*16 : i*16+16] + out_tmp := make([]byte, 16) + c.Decrypt(out_tmp, in_tmp) + out_tmp = xor(out_tmp, iv) + copy(out[i*16:i*16+16], out_tmp) + iv = in_tmp } + out, _ = pkcs7UnPadding(out) } - file, err := os.Create(FileName) - if err != nil { - return false, err + + return out, nil +} +func Sm4Ecb(key []byte, in []byte, mode bool) (out []byte, err error) { + if len(key) != BlockSize { + return nil, errors.New("SM4: invalid key size " + strconv.Itoa(len(key))) } - defer file.Close() - err = pem.Encode(file, block) + var inData []byte + if mode { + inData = pkcs7Padding(in) + } else { + inData = in + } + out = make([]byte, len(inData)) + c, err := NewCipher(key) if err != nil { - return false, nil + panic(err) + } + if mode { + for i := 0; i < len(inData)/16; i++ { + in_tmp := inData[i*16 : i*16+16] + out_tmp := make([]byte, 16) + c.Encrypt(out_tmp, in_tmp) + copy(out[i*16:i*16+16], out_tmp) + } + } else { + for i := 0; i < len(inData)/16; i++ { + in_tmp := inData[i*16 : i*16+16] + out_tmp := make([]byte, 16) + c.Decrypt(out_tmp, in_tmp) + copy(out[i*16:i*16+16], out_tmp) + } + out, _ = pkcs7UnPadding(out) } - return true, nil -} -func (k KeySizeError) Error() string { - return "SM4: invalid key size " + strconv.Itoa(int(k)) + return out, nil } -// NewCipher creates and returns a new cipher.Block. -func NewCipher(key []byte) (cipher.Block, error) { +//密码反馈模式(Cipher FeedBack (CFB)) +//https://blog.csdn.net/zy_strive_2012/article/details/102520356 +//https://blog.csdn.net/sinat_23338865/article/details/72869841 +func Sm4CFB(key []byte, in []byte, mode bool) (out []byte, err error) { if len(key) != BlockSize { - return nil, KeySizeError(len(key)) + return nil, errors.New("SM4: invalid key size " + strconv.Itoa(len(key))) + } + var inData []byte + if mode { + inData = pkcs7Padding(in) + } else { + inData = in } - c := new(Sm4Cipher) - c.subkeys = generateSubKeys(key) - c.block1 = make([]uint32, 4) - c.block2 = make([]byte, 16) - return c, nil -} -func (c *Sm4Cipher) BlockSize() int { - return BlockSize -} + iv := make([]byte, BlockSize) + out = make([]byte, len(inData)) + c, err := NewCipher(key) + if err != nil { + panic(err) + } -func (c *Sm4Cipher) Encrypt(dst, src []byte) { - cryptBlock(c.subkeys, c.block1, c.block2, dst, src, false) + K := make([]byte, BlockSize) + cipherBlock := make([]byte, BlockSize) + plainBlock := make([]byte, BlockSize) + if mode { //加密 + for i := 0; i < len(inData)/16; i++ { + if i == 0 { + c.Encrypt(K, iv) + cipherBlock = xor(K[:BlockSize], inData[i*16:i*16+16]) + copy(out[i*16:i*16+16], cipherBlock) + //copy(cipherBlock,out_tmp) + continue + } + c.Encrypt(K, cipherBlock) + cipherBlock = xor(K[:BlockSize], inData[i*16:i*16+16]) + copy(out[i*16:i*16+16], cipherBlock) + //copy(cipherBlock,out_tmp) + } + + } else { //解密 + var i int = 0 + for ; i < len(inData)/16; i++ { + if i == 0 { + c.Encrypt(K, iv) //这里是加密,而不是调用解密方法Decrypt + plainBlock = xor(K[:BlockSize], inData[i*16:i*16+16]) //获取明文分组 + copy(out[i*16:i*16+16], plainBlock) + continue + } + c.Encrypt(K, inData[(i-1)*16:(i-1)*16+16]) + plainBlock = xor(K[:BlockSize], inData[i*16:i*16+16]) //获取明文分组 + copy(out[i*16:i*16+16], plainBlock) + + } + + out, _ = pkcs7UnPadding(out) + } + + return out, nil } -func (c *Sm4Cipher) Decrypt(dst, src []byte) { - cryptBlock(c.subkeys, c.block1, c.block2, dst, src, true) +//输出反馈模式(Output feedback, OFB) +//https://blog.csdn.net/chengqiuming/article/details/82390910 +//https://blog.csdn.net/sinat_23338865/article/details/72869841 +func Sm4OFB(key []byte, in []byte, mode bool) (out []byte, err error) { + if len(key) != BlockSize { + return nil, errors.New("SM4: invalid key size " + strconv.Itoa(len(key))) + } + var inData []byte + if mode { + inData = pkcs7Padding(in) + } else { + inData = in + } + + iv := make([]byte, BlockSize) + out = make([]byte, len(inData)) + c, err := NewCipher(key) + if err != nil { + panic(err) + } + + K := make([]byte, BlockSize) + cipherBlock := make([]byte, BlockSize) + plainBlock := make([]byte, BlockSize) + shiftIV := make([]byte, BlockSize) + if mode { //加密 + for i := 0; i < len(inData)/16; i++ { + if i == 0 { + c.Encrypt(K, iv) + cipherBlock = xor(K[:BlockSize], inData[i*16:i*16+16]) + copy(out[i*16:i*16+16], cipherBlock) + copy(shiftIV, K[:BlockSize]) + continue + } + c.Encrypt(K, shiftIV) + cipherBlock = xor(K[:BlockSize], inData[i*16:i*16+16]) + copy(out[i*16:i*16+16], cipherBlock) + copy(shiftIV, K[:BlockSize]) + } + + } else { //解密 + for i := 0; i < len(inData)/16; i++ { + if i == 0 { + c.Encrypt(K, iv) //这里是加密,而不是调用解密方法Decrypt + plainBlock = xor(K[:BlockSize], inData[i*16:i*16+16]) //获取明文分组 + copy(out[i*16:i*16+16], plainBlock) + copy(shiftIV, K[:BlockSize]) + continue + } + c.Encrypt(K, shiftIV) + plainBlock = xor(K[:BlockSize], inData[i*16:i*16+16]) //获取明文分组 + copy(out[i*16:i*16+16], plainBlock) + copy(shiftIV, K[:BlockSize]) + } + out, _ = pkcs7UnPadding(out) + } + + return out, nil } diff --git a/vendor/github.com/tjfoc/gmsm/sm4/sm4_gcm.go b/vendor/github.com/tjfoc/gmsm/sm4/sm4_gcm.go new file mode 100644 index 0000000000..40b73f8d13 --- /dev/null +++ b/vendor/github.com/tjfoc/gmsm/sm4/sm4_gcm.go @@ -0,0 +1,332 @@ +/* +Copyright Hyperledger-TWGC All Rights Reserved. +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. + +writed by Zhiwei Yan, 2020 Oct +*/ +package sm4 + +import ( + "errors" + "strconv" +) + +//Paper: The Galois/Counter Mode of Operation (GCM) David A. Mcgrew,John Viega .2004. +func Sm4GCM(key []byte, IV ,in, A []byte, mode bool) ([]byte, []byte, error) { + if len(key) != BlockSize { + return nil,nil, errors.New("SM4: invalid key size " + strconv.Itoa(len(key))) + } + if mode { + C,T:=GCMEncrypt(key,IV,in,A) + return C,T,nil + }else{ + P,_T:=GCMDecrypt(key,IV,in,A) + return P,_T,nil + } +} + +func GetH(key []byte) (H []byte){ + c,err := NewCipher(key) + if err != nil { + panic(err) + } + + zores:=make([]byte, BlockSize) + H =make([]byte, BlockSize) + c.Encrypt(H,zores) + return H +} + +//ut = a + b +func addition(a ,b []byte) (out []byte){ + Len:=len(a) + if Len != len(b) { + return nil + } + out = make([]byte, Len) + for i := 0; i < Len; i++ { + out[i] = a[i] ^ b[i] + } + return out +} + +func Rightshift(V []byte){ + n:=len(V) + for i:=n-1;i>=0;i-- { + V[i]=V[i]>>1 + if i!=0{ + V[i]=((V[i-1]&0x01)<<7)|V[i] + } + } +} + +func findYi( Y []byte,index int) int{ + var temp byte + temp=Y[index/8] + temp=temp>>(7-index%8) + if temp & 0x01 == 1{ + return 1 + }else{ + return 0 + } +} + + +func multiplication(X,Y []byte) (Z []byte){ + + R:=make([]byte,BlockSize) + R[0]=0xe1 + Z=make([]byte,BlockSize) + V:=make([]byte,BlockSize) + copy(V,X) + for i:=0;i<=127;i++{ + if findYi(Y,i)==1{ + Z=addition(Z,V) + } + if V[BlockSize-1]&0x01==0{ + Rightshift(V) + }else{ + Rightshift(V) + V=addition(V,R) + } + } + return Z +} + +func GHASH(H []byte,A []byte,C []byte) (X[]byte){ + + calculm_v:=func(m ,v int) (int,int) { + if(m==0 && v!=0){ + m=1 + v=v*8 + }else if(m!=0 && v==0) { + v=BlockSize*8 + }else if(m!=0 && v!=0){ + m=m+1 + v=v*8 + }else { //m==0 && v==0 + m=1 + v=0 + } + return m,v + } + m:=len(A)/BlockSize + v:=len(A)%BlockSize + m,v=calculm_v(m,v) + + n:=len(C)/BlockSize + u:=(len(C)%BlockSize) + n,u=calculm_v(n,u) + + //i=0 + X=make([]byte,BlockSize*(m+n+2)) //X0 = 0 + for i:=0;im-1 对于数组来说是 0-->m-2 + } + + //i=m + zeros:=make([]byte,(128-v)/8) + Am:=make([]byte,v/8) + copy(Am[:],A[(m-1)*BlockSize:]) + Am=append(Am,zeros...) + copy(X[m*BlockSize:m*BlockSize+BlockSize],multiplication( addition(X[(m-1)*BlockSize:(m-1)*BlockSize+BlockSize],Am),H)) + + //i=m+1...m+n-1 + for i:=m+1;i<=(m+n-1);i++{ + copy(X[i*BlockSize:i*BlockSize+BlockSize],multiplication( addition(X[(i-1)*BlockSize:(i-1)*BlockSize+BlockSize],C[(i-m-1)*BlockSize:(i-m-1)*BlockSize+BlockSize]),H)) + } + + //i=m+n + zeros =make([]byte,(128-u)/8) + Cn:=make([]byte,u/8) + copy(Cn[:],C[(n-1)*BlockSize:]) + Cn=append(Cn,zeros...) + copy(X[(m+n)*BlockSize:(m+n)*BlockSize+BlockSize],multiplication( addition(X[(m+n-1)*BlockSize:(m+n-1)*BlockSize+BlockSize],Cn),H)) + + //i=m+n+1 + var lenAB []byte + calculateLenToBytes :=func(len int) []byte{ + data:=make([]byte,8) + data[0]=byte((len>>56)&0xff) + data[1]=byte((len>>48)&0xff) + data[2]=byte((len>>40)&0xff) + data[3]=byte((len>>32)&0xff) + data[4]=byte((len>>24)&0xff) + data[5]=byte((len>>16)&0xff) + data[6]=byte((len>>8)&0xff) + data[7]=byte((len>>0)&0xff) + return data + } + lenAB=append(lenAB,calculateLenToBytes(len(A))...) + lenAB=append(lenAB,calculateLenToBytes(len(C))...) + copy(X[(m+n+1)*BlockSize:(m+n+1)*BlockSize+BlockSize],multiplication(addition(X[(m+n)*BlockSize:(m+n)*BlockSize+BlockSize],lenAB),H)) + return X[(m+n+1)*BlockSize:(m+n+1)*BlockSize+BlockSize] +} + + +func GetY0(H,IV []byte) []byte{ + if len(IV)*8 == 96 { + zero31one1:=[]byte{0x00,0x00,0x00,0x01} + IV=append(IV,zero31one1...) + return IV + }else{ + return GHASH(H,[]byte{},IV) + + } + +} + +func incr(n int ,Y_i []byte) (Y_ii []byte) { + + Y_ii=make([]byte,BlockSize*n) + copy(Y_ii,Y_i) + + addYone:=func(yi,yii []byte){ + copy(yii[:],yi[:]) + + Len:=len(yi) + var rc byte=0x00 + for i:=Len-1;i>=0;i--{ + if(i==Len-1){ + if(yii[i]<0xff){ + yii[i]=yii[i]+0x01 + rc=0x00 + }else{ + yii[i]=0x00 + rc=0x01 + } + }else{ + if yii[i]+rc<0xff { + yii[i]=yii[i]+rc + rc=0x00 + }else{ + yii[i]=0x00 + rc=0x01 + } + } + } + } + for i:=1;i= 0 { + unix.Close(fd) + return int64(200112), nil + } + return 0, nil + } + return _POSIX_IPV6, nil + case SC_MESSAGE_PASSING: + if _POSIX_MESSAGE_PASSING == 0 { + return yesno(sysctl32("p1003_1b.message_passing")), nil + } + return _POSIX_MESSAGE_PASSING, nil + case SC_PRIORITIZED_IO: + if _POSIX_PRIORITIZED_IO == 0 { + return yesno(sysctl32("p1003_1b.prioritized_io")), nil + } + return _POSIX_PRIORITIZED_IO, nil + case SC_PRIORITY_SCHEDULING: + if _POSIX_PRIORITY_SCHEDULING == 0 { + return yesno(sysctl32("p1003_1b.priority_scheduling")), nil + } + return _POSIX_PRIORITY_SCHEDULING, nil + case SC_REALTIME_SIGNALS: + if _POSIX_REALTIME_SIGNALS == 0 { + return yesno(sysctl32("p1003_1b.realtime_signals")), nil + } + return _POSIX_REALTIME_SIGNALS, nil + case SC_SAVED_IDS: + return yesno(sysctl32("kern.saved_ids")), nil + case SC_SEMAPHORES: + if _POSIX_SEMAPHORES == 0 { + return yesno(sysctl32("p1003_1b.semaphores")), nil + } + return _POSIX_SEMAPHORES, nil + case SC_SPAWN: + return _POSIX_SPAWN, nil + case SC_SPIN_LOCKS: + return _POSIX_SPIN_LOCKS, nil + case SC_SPORADIC_SERVER: + return _POSIX_SPORADIC_SERVER, nil + case SC_SS_REPL_MAX: + return _POSIX_SS_REPL_MAX, nil + case SC_SYNCHRONIZED_IO: + if _POSIX_SYNCHRONIZED_IO == 0 { + return yesno(sysctl32("p1003_1b.synchronized_io")), nil + } + return _POSIX_SYNCHRONIZED_IO, nil + case SC_THREAD_ATTR_STACKADDR: + return _POSIX_THREAD_ATTR_STACKADDR, nil + case SC_THREAD_ATTR_STACKSIZE: + return _POSIX_THREAD_ATTR_STACKSIZE, nil + case SC_THREAD_CPUTIME: + return _POSIX_THREAD_CPUTIME, nil + case SC_THREAD_PRIORITY_SCHEDULING: + return _POSIX_THREAD_PRIORITY_SCHEDULING, nil + case SC_THREAD_PROCESS_SHARED: + return _POSIX_THREAD_PROCESS_SHARED, nil + case SC_THREAD_SAFE_FUNCTIONS: + return _POSIX_THREAD_SAFE_FUNCTIONS, nil + case SC_THREAD_SPORADIC_SERVER: + return _POSIX_THREAD_SPORADIC_SERVER, nil + case SC_TIMERS: + if _POSIX_TIMERS == 0 { + return yesno(sysctl32("p1003_1b.timers")), nil + } + return _POSIX_TIMERS, nil + case SC_TRACE: + return _POSIX_TRACE, nil + case SC_TRACE_EVENT_FILTER: + return _POSIX_TRACE_EVENT_FILTER, nil + case SC_TRACE_EVENT_NAME_MAX: + return _POSIX_TRACE_EVENT_NAME_MAX, nil + case SC_TRACE_INHERIT: + return _POSIX_TRACE_INHERIT, nil + case SC_TRACE_LOG: + return _POSIX_TRACE_LOG, nil + case SC_TRACE_NAME_MAX: + return _POSIX_TRACE_NAME_MAX, nil + case SC_TRACE_SYS_MAX: + return _POSIX_TRACE_SYS_MAX, nil + case SC_TRACE_USER_EVENT_MAX: + return _POSIX_TRACE_USER_EVENT_MAX, nil + case SC_TYPED_MEMORY_OBJECTS: + return _POSIX_TYPED_MEMORY_OBJECTS, nil + case SC_VERSION: + // TODO(tk): darwin libc uses sysctl(CTL_KERN, KERN_POSIX1) + return _POSIX_VERSION, nil + + case SC_V6_ILP32_OFF32: + if _V6_ILP32_OFF32 == 0 { + if unix.SizeofInt*_CHAR_BIT == 32 && + unix.SizeofInt == unix.SizeofLong && + unix.SizeofLong == unix.SizeofPtr && + unix.SizeofPtr == sizeofOffT { + return 1, nil + } + return -1, nil + } + return _V6_ILP32_OFF32, nil + case SC_V6_ILP32_OFFBIG: + if _V6_ILP32_OFFBIG == 0 { + if unix.SizeofInt*_CHAR_BIT == 32 && + unix.SizeofInt == unix.SizeofLong && + unix.SizeofLong == unix.SizeofPtr && + sizeofOffT*_CHAR_BIT >= 64 { + return 1, nil + } + return -1, nil + } + return _V6_ILP32_OFFBIG, nil + case SC_V6_LP64_OFF64: + if _V6_LP64_OFF64 == 0 { + if unix.SizeofInt*_CHAR_BIT == 32 && + unix.SizeofLong*_CHAR_BIT == 64 && + unix.SizeofLong == unix.SizeofPtr && + unix.SizeofPtr == sizeofOffT { + return 1, nil + } + return -1, nil + } + return _V6_LP64_OFF64, nil + case SC_V6_LPBIG_OFFBIG: + if _V6_LPBIG_OFFBIG == 0 { + if unix.SizeofInt*_CHAR_BIT >= 32 && + unix.SizeofLong*_CHAR_BIT >= 64 && + unix.SizeofPtr*_CHAR_BIT >= 64 && + sizeofOffT*_CHAR_BIT >= 64 { + return 1, nil + } + return -1, nil + } + return _V6_LPBIG_OFFBIG, nil + + case SC_2_CHAR_TERM: + return _POSIX2_CHAR_TERM, nil + case SC_2_PBS, + SC_2_PBS_ACCOUNTING, + SC_2_PBS_CHECKPOINT, + SC_2_PBS_LOCATE, + SC_2_PBS_MESSAGE, + SC_2_PBS_TRACK: + return _POSIX2_PBS, nil + case SC_2_UPE: + return _POSIX2_UPE, nil + + case SC_XOPEN_CRYPT: + return _XOPEN_CRYPT, nil + case SC_XOPEN_ENH_I18N: + return _XOPEN_ENH_I18N, nil + case SC_XOPEN_REALTIME: + return _XOPEN_REALTIME, nil + case SC_XOPEN_REALTIME_THREADS: + return _XOPEN_REALTIME_THREADS, nil + case SC_XOPEN_SHM: + return _XOPEN_SHM, nil + case SC_XOPEN_STREAMS: + return -1, nil + case SC_XOPEN_UNIX: + return _XOPEN_UNIX, nil + case SC_XOPEN_VERSION: + return _XOPEN_VERSION, nil + case SC_XOPEN_XCU_VERSION: + return _XOPEN_XCU_VERSION, nil + + case SC_PHYS_PAGES: + return sysctl64("hw.memsize") / int64(unix.Getpagesize()), nil + case SC_NPROCESSORS_CONF: + fallthrough + case SC_NPROCESSORS_ONLN: + return sysctl32("hw.ncpu"), nil + } + + return sysconfGeneric(name) +} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_dragonfly.go b/vendor/github.com/tklauser/go-sysconf/sysconf_dragonfly.go new file mode 100644 index 0000000000..c2ed8d12b4 --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/sysconf_dragonfly.go @@ -0,0 +1,220 @@ +// Copyright 2018 Tobias Klauser. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package sysconf + +import "golang.org/x/sys/unix" + +const ( + _HOST_NAME_MAX = _MAXHOSTNAMELEN - 1 + _LOGIN_NAME_MAX = _MAXLOGNAME + _SYMLOOP_MAX = _MAXSYMLINKS +) + +// sysconf implements sysconf(3) as in the FreeBSD 12 libc. +func sysconf(name int) (int64, error) { + switch name { + case SC_AIO_LISTIO_MAX: + return sysctl32("p1003_1b.aio_listio_max"), nil + case SC_AIO_MAX: + return sysctl32("p1003_1b.aio_max"), nil + case SC_AIO_PRIO_DELTA_MAX: + return sysctl32("p1003_1b.aio_prio_delta_max"), nil + case SC_ARG_MAX: + return sysctl32("kern.argmax"), nil + case SC_ATEXIT_MAX: + return _ATEXIT_SIZE, nil + case SC_CHILD_MAX: + var rlim unix.Rlimit + if err := unix.Getrlimit(unix.RLIMIT_NPROC, &rlim); err == nil { + if rlim.Cur != unix.RLIM_INFINITY { + return rlim.Cur, nil + } + } + return -1, nil + case SC_CLK_TCK: + return _CLK_TCK, nil + case SC_DELAYTIMER_MAX: + return yesno(sysctl32("p1003_1b.delaytimer_max")), nil + case SC_GETGR_R_SIZE_MAX, SC_GETPW_R_SIZE_MAX: + return -1, nil + case SC_IOV_MAX: + return sysctl32("kern.iov_max"), nil + case SC_MQ_OPEN_MAX: + return sysctl32("kern.mqueue.mq_open_max"), nil + case SC_MQ_PRIO_MAX: + return sysctl32("kern.mqueue.mq_prio_max"), nil + case SC_NGROUPS_MAX: + return sysctl32("kern.ngroups"), nil + case SC_OPEN_MAX: + var rlim unix.Rlimit + if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err == nil { + if rlim.Cur != unix.RLIM_INFINITY { + return rlim.Cur, nil + } + } + return -1, nil + case SC_RTSIG_MAX: + return yesno(sysctl32("p1003_1b.rtsig_max")), nil + case SC_SEM_NSEMS_MAX: + return -1, nil + case SC_SEM_VALUE_MAX: + return -1, nil + case SC_SIGQUEUE_MAX: + return yesno(sysctl32("p1003_1b.sigqueue_max")), nil + case SC_STREAM_MAX: + var rlim unix.Rlimit + if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err == nil { + if rlim.Cur != unix.RLIM_INFINITY { + return rlim.Cur, nil + } + } + return -1, nil + case SC_THREAD_DESTRUCTOR_ITERATIONS: + return _PTHREAD_DESTRUCTOR_ITERATIONS, nil + case SC_THREAD_KEYS_MAX: + return _PTHREAD_KEYS_MAX, nil + case SC_THREAD_PRIO_INHERIT: + return _POSIX_THREAD_PRIO_INHERIT, nil + case SC_THREAD_PRIO_PROTECT: + return _POSIX_THREAD_PRIO_PROTECT, nil + case SC_THREAD_STACK_MIN: + return _PTHREAD_STACK_MIN, nil + case SC_THREAD_THREADS_MAX: + return -1, nil + case SC_TIMER_MAX: + return yesno(sysctl32("p1003_1b.timer_max")), nil + case SC_TTY_NAME_MAX: + return pathconf(_PATH_DEV, _PC_NAME_MAX), nil + case SC_TZNAME_MAX: + return pathconf(_PATH_ZONEINFO, _PC_NAME_MAX), nil + + case SC_ASYNCHRONOUS_IO: + if _POSIX_ASYNCHRONOUS_IO == 0 { + return sysctl64("p1003_1b.asynchronous_io"), nil + } + return _POSIX_ASYNCHRONOUS_IO, nil + case SC_IPV6: + if _POSIX_IPV6 == 0 { + fd, err := unix.Socket(unix.AF_INET6, unix.SOCK_DGRAM, 0) + if err == nil && fd >= 0 { + unix.Close(fd) + return int64(200112), nil + } + return 0, nil + } + return _POSIX_IPV6, nil + case SC_MESSAGE_PASSING: + if _POSIX_MESSAGE_PASSING == 0 { + return yesno(sysctl32("p1003_1b.message_passing")), nil + } + return _POSIX_MESSAGE_PASSING, nil + case SC_PRIORITIZED_IO: + if _POSIX_PRIORITIZED_IO == 0 { + return yesno(sysctl32("p1003_1b.prioritized_io")), nil + } + return _POSIX_PRIORITIZED_IO, nil + case SC_PRIORITY_SCHEDULING: + if _POSIX_PRIORITY_SCHEDULING == 0 { + return yesno(sysctl32("p1003_1b.priority_scheduling")), nil + } + return _POSIX_PRIORITY_SCHEDULING, nil + case SC_REALTIME_SIGNALS: + if _POSIX_REALTIME_SIGNALS == 0 { + return yesno(sysctl32("p1003_1b.realtime_signals")), nil + } + return _POSIX_REALTIME_SIGNALS, nil + case SC_SAVED_IDS: + return yesno(sysctl32("kern.saved_ids")), nil + case SC_SEMAPHORES: + if _POSIX_SEMAPHORES == 0 { + return yesno(sysctl32("p1003_1b.semaphores")), nil + } + return _POSIX_SEMAPHORES, nil + case SC_SPAWN: + return _POSIX_SPAWN, nil + case SC_SPIN_LOCKS: + return _POSIX_SPIN_LOCKS, nil + case SC_SPORADIC_SERVER: + return _POSIX_SPORADIC_SERVER, nil + case SC_SYNCHRONIZED_IO: + if _POSIX_SYNCHRONIZED_IO == 0 { + return yesno(sysctl32("p1003_1b.synchronized_io")), nil + } + return _POSIX_SYNCHRONIZED_IO, nil + case SC_THREAD_ATTR_STACKADDR: + return _POSIX_THREAD_ATTR_STACKADDR, nil + case SC_THREAD_ATTR_STACKSIZE: + return _POSIX_THREAD_ATTR_STACKSIZE, nil + case SC_THREAD_CPUTIME: + return _POSIX_THREAD_CPUTIME, nil + case SC_THREAD_PRIORITY_SCHEDULING: + return _POSIX_THREAD_PRIORITY_SCHEDULING, nil + case SC_THREAD_PROCESS_SHARED: + return _POSIX_THREAD_PROCESS_SHARED, nil + case SC_THREAD_SAFE_FUNCTIONS: + return _POSIX_THREAD_SAFE_FUNCTIONS, nil + case SC_THREAD_SPORADIC_SERVER: + return _POSIX_THREAD_SPORADIC_SERVER, nil + case SC_TIMERS: + if _POSIX_TIMERS == 0 { + return yesno(sysctl32("p1003_1b.timers")), nil + } + return _POSIX_TIMERS, nil + case SC_TRACE: + return _POSIX_TRACE, nil + case SC_TYPED_MEMORY_OBJECTS: + return _POSIX_TYPED_MEMORY_OBJECTS, nil + case SC_VERSION: + // TODO(tk): FreeBSD libc uses sysctl(CTL_KERN, KERN_POSIX1) + return _POSIX_VERSION, nil + + /* TODO(tk): these need GOARCH-dependent integer size checks + case SC_V6_ILP32_OFF32: + return _V6_ILP32_OFF32, nil + case SC_V6_ILP32_OFFBIG: + return _V6_ILP32_OFFBIG, nil + case SC_V6_LP64_OFF64: + return _V6_LP64_OFF64, nil + case SC_V6_LPBIG_OFFBIG: + return _V6_LPBIG_OFFBIG, nil + */ + + case SC_2_CHAR_TERM: + return _POSIX2_CHAR_TERM, nil + case SC_2_PBS, + SC_2_PBS_ACCOUNTING, + SC_2_PBS_CHECKPOINT, + SC_2_PBS_LOCATE, + SC_2_PBS_MESSAGE, + SC_2_PBS_TRACK: + return _POSIX2_PBS, nil + case SC_2_UPE: + return _POSIX2_UPE, nil + + case SC_XOPEN_CRYPT: + return _XOPEN_CRYPT, nil + case SC_XOPEN_ENH_I18N: + return _XOPEN_ENH_I18N, nil + case SC_XOPEN_REALTIME: + return _XOPEN_REALTIME, nil + case SC_XOPEN_REALTIME_THREADS: + return _XOPEN_REALTIME_THREADS, nil + case SC_XOPEN_SHM: + return _XOPEN_SHM, nil + case SC_XOPEN_STREAMS: + return -1, nil + case SC_XOPEN_UNIX: + return _XOPEN_UNIX, nil + + case SC_PHYS_PAGES: + return sysctl64("hw.availpages"), nil + case SC_NPROCESSORS_CONF: + fallthrough + case SC_NPROCESSORS_ONLN: + return sysctl32("hw.ncpu"), nil + } + + return sysconfGeneric(name) +} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_freebsd.go b/vendor/github.com/tklauser/go-sysconf/sysconf_freebsd.go new file mode 100644 index 0000000000..b7939888ae --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/sysconf_freebsd.go @@ -0,0 +1,226 @@ +// Copyright 2018 Tobias Klauser. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package sysconf + +import "golang.org/x/sys/unix" + +const ( + _HOST_NAME_MAX = _MAXHOSTNAMELEN - 1 + _LOGIN_NAME_MAX = _MAXLOGNAME + _SYMLOOP_MAX = _MAXSYMLINKS +) + +// sysconf implements sysconf(3) as in the FreeBSD 12 libc. +func sysconf(name int) (int64, error) { + switch name { + case SC_AIO_LISTIO_MAX: + return sysctl32("p1003_1b.aio_listio_max"), nil + case SC_AIO_MAX: + return sysctl32("p1003_1b.aio_max"), nil + case SC_AIO_PRIO_DELTA_MAX: + return sysctl32("p1003_1b.aio_prio_delta_max"), nil + case SC_ARG_MAX: + return sysctl32("kern.argmax"), nil + case SC_ATEXIT_MAX: + return _ATEXIT_SIZE, nil + case SC_CHILD_MAX: + var rlim unix.Rlimit + if err := unix.Getrlimit(unix.RLIMIT_NPROC, &rlim); err == nil { + if rlim.Cur != unix.RLIM_INFINITY { + return rlim.Cur, nil + } + } + return -1, nil + case SC_CLK_TCK: + return _CLK_TCK, nil + case SC_DELAYTIMER_MAX: + return sysctl32("p1003_1b.delaytimer_max"), nil + case SC_GETGR_R_SIZE_MAX, SC_GETPW_R_SIZE_MAX: + return -1, nil + case SC_IOV_MAX: + return sysctl32("kern.iov_max"), nil + case SC_MQ_OPEN_MAX: + return yesno(sysctl32("p1003_1b.mq_open_max")), nil + case SC_MQ_PRIO_MAX: + return _MQ_PRIO_MAX, nil + case SC_NGROUPS_MAX: + return sysctl32("kern.ngroups"), nil + case SC_OPEN_MAX: + var rlim unix.Rlimit + if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err == nil { + if rlim.Cur != unix.RLIM_INFINITY { + return rlim.Cur, nil + } + } + return -1, nil + case SC_RTSIG_MAX: + return sysctl32("p1003_1b.rtsig_max"), nil + case SC_SEM_NSEMS_MAX: + return -1, nil + case SC_SEM_VALUE_MAX: + return _SEM_VALUE_MAX, nil + case SC_SIGQUEUE_MAX: + return sysctl32("p1003_1b.sigqueue_max"), nil + case SC_STREAM_MAX: + var rlim unix.Rlimit + if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err != nil { + return -1, nil + } + if rlim.Cur == unix.RLIM_INFINITY { + return -1, nil + } + if rlim.Cur > _LONG_MAX { + return -1, unix.EOVERFLOW + } + if rlim.Cur > _SHRT_MAX { + return _SHRT_MAX, nil + } + return rlim.Cur, nil + case SC_THREAD_DESTRUCTOR_ITERATIONS: + return _PTHREAD_DESTRUCTOR_ITERATIONS, nil + case SC_THREAD_KEYS_MAX: + return _PTHREAD_KEYS_MAX, nil + case SC_THREAD_PRIO_INHERIT: + return _POSIX_THREAD_PRIO_INHERIT, nil + case SC_THREAD_PRIO_PROTECT: + return _POSIX_THREAD_PRIO_PROTECT, nil + case SC_THREAD_STACK_MIN: + return _PTHREAD_STACK_MIN, nil + case SC_THREAD_THREADS_MAX: + return -1, nil + case SC_TIMER_MAX: + return yesno(sysctl32("p1003_1b.timer_max")), nil + case SC_TTY_NAME_MAX: + return pathconf(_PATH_DEV, _PC_NAME_MAX), nil + case SC_TZNAME_MAX: + return pathconf(_PATH_ZONEINFO, _PC_NAME_MAX), nil + + case SC_IPV6: + if _POSIX_IPV6 == 0 { + fd, err := unix.Socket(unix.AF_INET6, unix.SOCK_DGRAM, 0) + if err == nil && fd >= 0 { + unix.Close(fd) + return int64(200112), nil + } + return 0, nil + } + return _POSIX_IPV6, nil + case SC_MESSAGE_PASSING: + if _POSIX_MESSAGE_PASSING == 0 { + return yesno(sysctl32("p1003_1b.message_passing")), nil + } + return _POSIX_MESSAGE_PASSING, nil + case SC_PRIORITIZED_IO: + if _POSIX_PRIORITIZED_IO == 0 { + return yesno(sysctl32("p1003_1b.prioritized_io")), nil + } + return _POSIX_PRIORITIZED_IO, nil + case SC_PRIORITY_SCHEDULING: + if _POSIX_PRIORITY_SCHEDULING == 0 { + return yesno(sysctl32("p1003_1b.priority_scheduling")), nil + } + return _POSIX_PRIORITY_SCHEDULING, nil + case SC_REALTIME_SIGNALS: + if _POSIX_REALTIME_SIGNALS == 0 { + return yesno(sysctl32("p1003_1b.realtime_signals")), nil + } + return _POSIX_REALTIME_SIGNALS, nil + case SC_SAVED_IDS: + return yesno(sysctl32("kern.saved_ids")), nil + case SC_SEMAPHORES: + if _POSIX_SEMAPHORES == 0 { + return yesno(sysctl32("p1003_1b.semaphores")), nil + } + return _POSIX_SEMAPHORES, nil + case SC_SPAWN: + return _POSIX_SPAWN, nil + case SC_SPIN_LOCKS: + return _POSIX_SPIN_LOCKS, nil + case SC_SPORADIC_SERVER: + return _POSIX_SPORADIC_SERVER, nil + case SC_SYNCHRONIZED_IO: + if _POSIX_SYNCHRONIZED_IO == 0 { + return yesno(sysctl32("p1003_1b.synchronized_io")), nil + } + return _POSIX_SYNCHRONIZED_IO, nil + case SC_THREAD_ATTR_STACKADDR: + return _POSIX_THREAD_ATTR_STACKADDR, nil + case SC_THREAD_ATTR_STACKSIZE: + return _POSIX_THREAD_ATTR_STACKSIZE, nil + case SC_THREAD_CPUTIME: + return _POSIX_THREAD_CPUTIME, nil + case SC_THREAD_PRIORITY_SCHEDULING: + return _POSIX_THREAD_PRIORITY_SCHEDULING, nil + case SC_THREAD_PROCESS_SHARED: + return _POSIX_THREAD_PROCESS_SHARED, nil + case SC_THREAD_SAFE_FUNCTIONS: + return _POSIX_THREAD_SAFE_FUNCTIONS, nil + case SC_TIMERS: + if _POSIX_TIMERS == 0 { + return yesno(sysctl32("p1003_1b.timers")), nil + } + return _POSIX_TIMERS, nil + case SC_TRACE: + return _POSIX_TRACE, nil + case SC_TYPED_MEMORY_OBJECTS: + return _POSIX_TYPED_MEMORY_OBJECTS, nil + case SC_VERSION: + // TODO(tk): FreeBSD libc uses sysctl(CTL_KERN, KERN_POSIX1) + return _POSIX_VERSION, nil + + /* TODO(tk): these need GOARCH-dependent integer size checks + case SC_V6_ILP32_OFF32: + return _V6_ILP32_OFF32, nil + case SC_V6_ILP32_OFFBIG: + return _V6_ILP32_OFFBIG, nil + case SC_V6_LP64_OFF64: + return _V6_LP64_OFF64, nil + case SC_V6_LPBIG_OFFBIG: + return _V6_LPBIG_OFFBIG, nil + */ + + case SC_2_CHAR_TERM: + return _POSIX2_CHAR_TERM, nil + case SC_2_PBS, + SC_2_PBS_ACCOUNTING, + SC_2_PBS_CHECKPOINT, + SC_2_PBS_LOCATE, + SC_2_PBS_MESSAGE, + SC_2_PBS_TRACK: + return _POSIX2_PBS, nil + case SC_2_UPE: + return _POSIX2_UPE, nil + + case SC_XOPEN_CRYPT: + return _XOPEN_CRYPT, nil + case SC_XOPEN_ENH_I18N: + return _XOPEN_ENH_I18N, nil + case SC_XOPEN_REALTIME: + return _XOPEN_REALTIME, nil + case SC_XOPEN_REALTIME_THREADS: + return _XOPEN_REALTIME_THREADS, nil + case SC_XOPEN_SHM: + return _XOPEN_SHM, nil + case SC_XOPEN_STREAMS: + return -1, nil + case SC_XOPEN_UNIX: + return _XOPEN_UNIX, nil + + case SC_PHYS_PAGES: + if val, err := unix.SysctlUint64("hw.availpages"); err == nil { + return int64(val), nil + } + return -1, nil + case SC_NPROCESSORS_CONF: + fallthrough + case SC_NPROCESSORS_ONLN: + if val, err := unix.SysctlUint32("hw.ncpu"); err == nil { + return int64(val), nil + } + return -1, nil + } + + return sysconfGeneric(name) +} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go b/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go new file mode 100644 index 0000000000..248bdc99cd --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go @@ -0,0 +1,46 @@ +// Copyright 2021 Tobias Klauser. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd +// +build darwin dragonfly freebsd linux netbsd openbsd + +package sysconf + +import "os" + +func sysconfGeneric(name int) (int64, error) { + // POSIX default values + if sc, err := sysconfPOSIX(name); err == nil { + return sc, nil + } + + switch name { + case SC_BC_BASE_MAX: + return _BC_BASE_MAX, nil + case SC_BC_DIM_MAX: + return _BC_DIM_MAX, nil + case SC_BC_SCALE_MAX: + return _BC_SCALE_MAX, nil + case SC_BC_STRING_MAX: + return _BC_STRING_MAX, nil + case SC_COLL_WEIGHTS_MAX: + return _COLL_WEIGHTS_MAX, nil + case SC_EXPR_NEST_MAX: + return _EXPR_NEST_MAX, nil + case SC_HOST_NAME_MAX: + return _HOST_NAME_MAX, nil + case SC_LINE_MAX: + return _LINE_MAX, nil + case SC_LOGIN_NAME_MAX: + return _LOGIN_NAME_MAX, nil + case SC_PAGESIZE: // same as SC_PAGE_SIZE + return int64(os.Getpagesize()), nil + case SC_RE_DUP_MAX: + return _RE_DUP_MAX, nil + case SC_SYMLOOP_MAX: + return _SYMLOOP_MAX, nil + } + + return -1, errInvalid +} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_linux.go b/vendor/github.com/tklauser/go-sysconf/sysconf_linux.go new file mode 100644 index 0000000000..355d96e2e5 --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/sysconf_linux.go @@ -0,0 +1,357 @@ +// Copyright 2018 Tobias Klauser. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package sysconf + +import ( + "bufio" + "io/ioutil" + "os" + "runtime" + "strconv" + "strings" + + "github.com/tklauser/numcpus" + "golang.org/x/sys/unix" +) + +const ( + // CLK_TCK is a constant on Linux, see e.g. + // https://git.musl-libc.org/cgit/musl/tree/src/conf/sysconf.c#n30 and + // https://github.com/containerd/cgroups/pull/12 + _SYSTEM_CLK_TCK = 100 +) + +func readProcFsInt64(path string, fallback int64) int64 { + data, err := ioutil.ReadFile(path) + if err != nil { + return fallback + } + i, err := strconv.ParseInt(string(data[:len(data)-1]), 0, 64) + if err != nil { + return fallback + } + return i +} + +// getMemPages computes mem*unit/os.Getpagesize(), but avoids overflowing int64. +func getMemPages(mem uint64, unit uint32) int64 { + pageSize := os.Getpagesize() + for unit > 1 && pageSize > 1 { + unit >>= 1 + pageSize >>= 1 + } + mem *= uint64(unit) + for pageSize > 1 { + pageSize >>= 1 + mem >>= 1 + } + return int64(mem) +} + +func getPhysPages() int64 { + var si unix.Sysinfo_t + err := unix.Sysinfo(&si) + if err != nil { + return int64(0) + } + return getMemPages(uint64(si.Totalram), si.Unit) +} + +func getAvPhysPages() int64 { + var si unix.Sysinfo_t + err := unix.Sysinfo(&si) + if err != nil { + return int64(0) + } + return getMemPages(uint64(si.Freeram), si.Unit) +} + +func getNprocsSysfs() (int64, error) { + n, err := numcpus.GetOnline() + return int64(n), err +} + +func getNprocsProcStat() (int64, error) { + f, err := os.Open("/proc/stat") + if err != nil { + return -1, err + } + defer f.Close() + + count := int64(0) + s := bufio.NewScanner(f) + for s.Scan() { + if line := strings.TrimSpace(s.Text()); strings.HasPrefix(line, "cpu") { + l := strings.SplitN(line, " ", 2) + _, err := strconv.ParseInt(l[0][3:], 10, 64) + if err == nil { + count++ + } + } else { + // The current format of /proc/stat has all the + // cpu* lines at the beginning. Assume this + // stays this way. + break + } + } + return count, nil +} + +func getNprocs() int64 { + count, err := getNprocsSysfs() + if err == nil { + return count + } + + count, err = getNprocsProcStat() + if err == nil { + return count + } + + // default to the value determined at runtime startup if all else fails + return int64(runtime.NumCPU()) +} + +func getNprocsConf() int64 { + // TODO(tk): read /sys/devices/system/cpu/present instead? + d, err := os.Open("/sys/devices/system/cpu") + if err == nil { + defer d.Close() + fis, err := d.Readdir(-1) + if err == nil { + count := int64(0) + for _, fi := range fis { + if name := fi.Name(); fi.IsDir() && strings.HasPrefix(name, "cpu") { + _, err := strconv.ParseInt(name[3:], 10, 64) + if err == nil { + count++ + } + } + } + return count + } + } + + // TODO(tk): fall back to reading /proc/cpuinfo on legacy systems + // without sysfs? + + return getNprocs() +} + +func hasClock(clockid int32) bool { + var res unix.Timespec + if err := unix.ClockGetres(clockid, &res); err != nil { + return false + } + return true +} + +func max(a, b int64) int64 { + if a > b { + return a + } + return b +} + +func sysconf(name int) (int64, error) { + switch name { + case SC_AIO_LISTIO_MAX: + return -1, nil + case SC_AIO_MAX: + return -1, nil + case SC_AIO_PRIO_DELTA_MAX: + return _AIO_PRIO_DELTA_MAX, nil + case SC_ARG_MAX: + argMax := int64(_POSIX_ARG_MAX) + var rlim unix.Rlimit + if err := unix.Getrlimit(unix.RLIMIT_STACK, &rlim); err == nil { + argMax = max(argMax, int64(rlim.Cur/4)) + } + return argMax, nil + case SC_ATEXIT_MAX: + return _INT_MAX, nil + case SC_CHILD_MAX: + childMax := int64(-1) + var rlim unix.Rlimit + if err := unix.Getrlimit(unix.RLIMIT_NPROC, &rlim); err == nil && rlim.Cur != unix.RLIM_INFINITY { + childMax = int64(rlim.Cur) + } + return childMax, nil + case SC_CLK_TCK: + return _SYSTEM_CLK_TCK, nil + case SC_DELAYTIMER_MAX: + return _DELAYTIMER_MAX, nil + case SC_GETGR_R_SIZE_MAX: + return _NSS_BUFLEN_GROUP, nil + case SC_GETPW_R_SIZE_MAX: + return _NSS_BUFLEN_PASSWD, nil + case SC_MQ_OPEN_MAX: + return -1, nil + case SC_MQ_PRIO_MAX: + return _MQ_PRIO_MAX, nil + case SC_NGROUPS_MAX: + return readProcFsInt64("/proc/sys/kernel/ngroups_max", _NGROUPS_MAX), nil + case SC_OPEN_MAX: + openMax := int64(_OPEN_MAX) + var rlim unix.Rlimit + if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err == nil { + openMax = int64(rlim.Cur) + } + return openMax, nil + case SC_RTSIG_MAX: + return _RTSIG_MAX, nil + case SC_SEM_NSEMS_MAX: + return -1, nil + case SC_SEM_VALUE_MAX: + return _SEM_VALUE_MAX, nil + case SC_SIGQUEUE_MAX: + var rlim unix.Rlimit + if err := unix.Getrlimit(unix.RLIMIT_SIGPENDING, &rlim); err == nil { + return int64(rlim.Cur), nil + } + return readProcFsInt64("/proc/sys/kernel/rtsig-max", _POSIX_SIGQUEUE_MAX), nil + case SC_STREAM_MAX: + return _STREAM_MAX, nil + case SC_THREAD_DESTRUCTOR_ITERATIONS: + return _POSIX_THREAD_DESTRUCTOR_ITERATIONS, nil + case SC_THREAD_KEYS_MAX: + return _PTHREAD_KEYS_MAX, nil + case SC_THREAD_PRIO_INHERIT: + return _POSIX_THREAD_PRIO_INHERIT, nil + case SC_THREAD_PRIO_PROTECT: + return _POSIX_THREAD_PRIO_PROTECT, nil + case SC_THREAD_STACK_MIN: + return _PTHREAD_STACK_MIN, nil + case SC_THREAD_THREADS_MAX: + return -1, nil + case SC_TIMER_MAX: + return -1, nil + case SC_TTY_NAME_MAX: + return _TTY_NAME_MAX, nil + case SC_TZNAME_MAX: + return -1, nil + + case SC_CPUTIME: + if hasClock(unix.CLOCK_PROCESS_CPUTIME_ID) { + return _POSIX_VERSION, nil + } + return -1, nil + case SC_MONOTONIC_CLOCK: + if hasClock(unix.CLOCK_MONOTONIC) { + return _POSIX_VERSION, nil + } + return -1, nil + case SC_SAVED_IDS: + return _POSIX_SAVED_IDS, nil + case SC_SPAWN: + return _POSIX_SPAWN, nil + case SC_SPIN_LOCKS: + return _POSIX_SPIN_LOCKS, nil + case SC_SPORADIC_SERVER: + return _POSIX_SPORADIC_SERVER, nil + case SC_SYNCHRONIZED_IO: + return _POSIX_SYNCHRONIZED_IO, nil + case SC_THREAD_ATTR_STACKADDR: + return _POSIX_THREAD_ATTR_STACKADDR, nil + case SC_THREAD_ATTR_STACKSIZE: + return _POSIX_THREAD_ATTR_STACKSIZE, nil + case SC_THREAD_CPUTIME: + if hasClock(unix.CLOCK_THREAD_CPUTIME_ID) { + return _POSIX_VERSION, nil + } + return -1, nil + case SC_THREAD_PRIORITY_SCHEDULING: + return _POSIX_THREAD_PRIORITY_SCHEDULING, nil + case SC_THREAD_PROCESS_SHARED: + return _POSIX_THREAD_PROCESS_SHARED, nil + case SC_THREAD_SAFE_FUNCTIONS: + return _POSIX_THREAD_SAFE_FUNCTIONS, nil + case SC_THREAD_SPORADIC_SERVER: + return _POSIX_THREAD_SPORADIC_SERVER, nil + case SC_TRACE: + return _POSIX_TRACE, nil + case SC_TRACE_EVENT_FILTER: + return _POSIX_TRACE_EVENT_FILTER, nil + case SC_TRACE_EVENT_NAME_MAX: + return -1, nil + case SC_TRACE_INHERIT: + return _POSIX_TRACE_INHERIT, nil + case SC_TRACE_LOG: + return _POSIX_TRACE_LOG, nil + case SC_TRACE_NAME_MAX: + return -1, nil + case SC_TRACE_SYS_MAX: + return -1, nil + case SC_TRACE_USER_EVENT_MAX: + return -1, nil + case SC_TYPED_MEMORY_OBJECTS: + return _POSIX_TYPED_MEMORY_OBJECTS, nil + + case SC_V7_ILP32_OFF32: + return _POSIX_V7_ILP32_OFF32, nil + case SC_V7_ILP32_OFFBIG: + return _POSIX_V7_ILP32_OFFBIG, nil + case SC_V7_LP64_OFF64: + return _POSIX_V7_LP64_OFF64, nil + case SC_V7_LPBIG_OFFBIG: + return _POSIX_V7_LPBIG_OFFBIG, nil + + case SC_V6_ILP32_OFF32: + return _POSIX_V6_ILP32_OFF32, nil + case SC_V6_ILP32_OFFBIG: + return _POSIX_V6_ILP32_OFFBIG, nil + case SC_V6_LP64_OFF64: + return _POSIX_V6_LP64_OFF64, nil + case SC_V6_LPBIG_OFFBIG: + return _POSIX_V6_LPBIG_OFFBIG, nil + + case SC_2_C_VERSION: + return _POSIX2_C_VERSION, nil + case SC_2_CHAR_TERM: + return _POSIX2_CHAR_TERM, nil + case SC_2_PBS, + SC_2_PBS_ACCOUNTING, + SC_2_PBS_CHECKPOINT, + SC_2_PBS_LOCATE, + SC_2_PBS_MESSAGE, + SC_2_PBS_TRACK: + return -1, nil + case SC_2_UPE: + return -1, nil + + case SC_XOPEN_CRYPT: + // removed in glibc 2.28 + return -1, nil + case SC_XOPEN_ENH_I18N: + return _XOPEN_ENH_I18N, nil + case SC_XOPEN_REALTIME: + return _XOPEN_REALTIME, nil + case SC_XOPEN_REALTIME_THREADS: + return _XOPEN_REALTIME_THREADS, nil + case SC_XOPEN_SHM: + return _XOPEN_SHM, nil + case SC_XOPEN_STREAMS: + return -1, nil + case SC_XOPEN_UNIX: + return _XOPEN_UNIX, nil + case SC_XOPEN_VERSION: + return _XOPEN_VERSION, nil + case SC_XOPEN_XCU_VERSION: + return _XOPEN_XCU_VERSION, nil + + case SC_PHYS_PAGES: + return getPhysPages(), nil + case SC_AVPHYS_PAGES: + return getAvPhysPages(), nil + case SC_NPROCESSORS_CONF: + return getNprocsConf(), nil + case SC_NPROCESSORS_ONLN: + return getNprocs(), nil + case SC_UIO_MAXIOV: // same as _SC_IOV_MAX + return _UIO_MAXIOV, nil + } + + return sysconfGeneric(name) +} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_netbsd.go b/vendor/github.com/tklauser/go-sysconf/sysconf_netbsd.go new file mode 100644 index 0000000000..7b7d020567 --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/sysconf_netbsd.go @@ -0,0 +1,154 @@ +// Copyright 2018 Tobias Klauser. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package sysconf + +import ( + "sync" + + "golang.org/x/sys/unix" +) + +const ( + _HOST_NAME_MAX = _MAXHOSTNAMELEN + _LOGIN_NAME_MAX = _MAXLOGNAME + 1 + _SYMLOOP_MAX = _MAXSYMLINKS + + _POSIX2_C_DEV = -1 + _POSIX2_UPE = -1 +) + +var ( + clktck int64 + clktckOnce sync.Once +) + +func sysconfPOSIX(name int) (int64, error) { + // NetBSD does not define all _POSIX_* values used in sysconf_posix.go + // Handle the supported ones here. + switch name { + case SC_SHELL: + return _POSIX_SHELL, nil + case SC_VERSION: + return _POSIX_VERSION, nil + } + + return -1, errInvalid +} + +func sysconf(name int) (int64, error) { + // NetBSD uses sysctl to get some of these values. For the user.* namespace, + // calls get handled by user_sysctl in /usr/src/lib/libc/gen/sysctl.c + // Duplicate the relevant values here. + + switch name { + case SC_ARG_MAX: + return sysctl32("kern.argmax"), nil + case SC_CHILD_MAX: + var rlim unix.Rlimit + if err := unix.Getrlimit(unix.RLIMIT_NPROC, &rlim); err == nil { + if rlim.Cur != unix.RLIM_INFINITY { + return int64(rlim.Cur), nil + } + } + return -1, nil + case SC_STREAM_MAX: + // sysctl("user.stream_max") + return _FOPEN_MAX, nil + case SC_TTY_NAME_MAX: + return pathconf(_PATH_DEV, _PC_NAME_MAX), nil + case SC_CLK_TCK: + clktckOnce.Do(func() { + clktck = -1 + if ci, err := unix.SysctlClockinfo("kern.clockrate"); err == nil { + clktck = int64(ci.Hz) + } + }) + return clktck, nil + case SC_NGROUPS_MAX: + return sysctl32("kern.ngroups"), nil + case SC_JOB_CONTROL: + return sysctl32("kern.job_control"), nil + case SC_OPEN_MAX: + var rlim unix.Rlimit + if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err == nil { + return int64(rlim.Cur), nil + } + return -1, nil + case SC_TZNAME_MAX: + // sysctl("user.tzname_max") + return _NAME_MAX, nil + + // 1003.1b + case SC_FSYNC: + return sysctl32("kern.fsync"), nil + case SC_MAPPED_FILES: + return sysctl32("kern.mapped_files"), nil + case SC_MONOTONIC_CLOCK: + return sysctl32("kern.monotonic_clock"), nil + case SC_SEMAPHORES: + return sysctl32("kern.posix_semaphores"), nil + case SC_TIMERS: + return sysctl32("kern.posix_timers"), nil + + // 1003.1c + case SC_LOGIN_NAME_MAX: + return sysctl32("kern.login_name_max"), nil + case SC_THREADS: + return sysctl32("kern.posix_threads"), nil + + // 1003.1j + case SC_BARRIERS: + return sysctl32("kern.posix_barriers"), nil + + // 1003.2 + case SC_2_VERSION: + // sysctl("user.posix2_version") + return _POSIX2_VERSION, nil + case SC_2_UPE: + // sysctl("user.posix2_upe") + return _POSIX2_UPE, nil + + // XPG 4.2 + case SC_IOV_MAX: + return sysctl32("kern.iov_max"), nil + + // 1003.1-2001, XSI Option Group + case SC_AIO_LISTIO_MAX: + return sysctl32("kern.aio_listio_max"), nil + case SC_AIO_MAX: + return sysctl32("kern.aio_max"), nil + case SC_ASYNCHRONOUS_IO: + return sysctl32("kern.posix_aio"), nil + case SC_MQ_OPEN_MAX: + return sysctl32("kern.mqueue.mq_open_max"), nil + case SC_MQ_PRIO_MAX: + return sysctl32("kern.mqueue.mq_prio_max"), nil + case SC_ATEXIT_MAX: + // sysctl("user.atexit_max") + return -1, nil // TODO + + // Extensions + case SC_NPROCESSORS_CONF: + return sysctl32("hw.ncpu"), nil + case SC_NPROCESSORS_ONLN: + return sysctl32("hw.ncpuonline"), nil + + // Linux/Solaris + case SC_PHYS_PAGES: + return sysctl64("hw.physmem64") / int64(unix.Getpagesize()), nil + + // Native + case SC_THREAD_DESTRUCTOR_ITERATIONS: + return _POSIX_THREAD_DESTRUCTOR_ITERATIONS, nil + case SC_THREAD_KEYS_MAX: + return _POSIX_THREAD_KEYS_MAX, nil + case SC_THREAD_STACK_MIN: + return int64(unix.Getpagesize()), nil + case SC_THREAD_THREADS_MAX: + return sysctl32("kern.maxproc"), nil + } + + return sysconfGeneric(name) +} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_openbsd.go b/vendor/github.com/tklauser/go-sysconf/sysconf_openbsd.go new file mode 100644 index 0000000000..c0c394abe4 --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/sysconf_openbsd.go @@ -0,0 +1,271 @@ +// Copyright 2018 Tobias Klauser. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package sysconf + +import "golang.org/x/sys/unix" + +// sysconf implements sysconf(3) as in the OpenBSD 6.3 libc. +func sysconf(name int) (int64, error) { + switch name { + case SC_AIO_LISTIO_MAX, + SC_AIO_MAX, + SC_AIO_PRIO_DELTA_MAX: + return -1, nil + case SC_ARG_MAX: + return sysctl32("kern.argmax"), nil + case SC_ATEXIT_MAX: + return -1, nil + case SC_CHILD_MAX: + var rlim unix.Rlimit + if err := unix.Getrlimit(unix.RLIMIT_NPROC, &rlim); err == nil { + if rlim.Cur != unix.RLIM_INFINITY { + return int64(rlim.Cur), nil + } + } + return -1, nil + case SC_CLK_TCK: + return _CLK_TCK, nil + case SC_DELAYTIMER_MAX: + return -1, nil + case SC_GETGR_R_SIZE_MAX: + return _GR_BUF_LEN, nil + case SC_GETPW_R_SIZE_MAX: + return _PW_BUF_LEN, nil + case SC_IOV_MAX: + return _IOV_MAX, nil + case SC_LOGIN_NAME_MAX: + return _LOGIN_NAME_MAX, nil + case SC_NGROUPS_MAX: + return sysctl32("kern.ngroups"), nil + case SC_OPEN_MAX: + var rlim unix.Rlimit + if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err == nil { + if rlim.Cur != unix.RLIM_INFINITY { + return int64(rlim.Cur), nil + } + } + return -1, nil + case SC_SEM_NSEMS_MAX: + return -1, nil + case SC_SEM_VALUE_MAX: + return _SEM_VALUE_MAX, nil + case SC_SIGQUEUE_MAX: + return -1, nil + case SC_STREAM_MAX: + var rlim unix.Rlimit + if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err == nil { + if rlim.Cur != unix.RLIM_INFINITY { + if rlim.Cur > _SHRT_MAX { + return _SHRT_MAX, nil + } + return int64(rlim.Cur), nil + } + } + return -1, nil + case SC_THREAD_DESTRUCTOR_ITERATIONS: + return _PTHREAD_DESTRUCTOR_ITERATIONS, nil + case SC_THREAD_KEYS_MAX: + return _PTHREAD_KEYS_MAX, nil + case SC_THREAD_STACK_MIN: + return _PTHREAD_STACK_MIN, nil + case SC_THREAD_THREADS_MAX: + return -1, nil + case SC_TIMER_MAX: + return -1, nil + case SC_TTY_NAME_MAX: + return _TTY_NAME_MAX, nil + case SC_TZNAME_MAX: + return _NAME_MAX, nil + + case SC_BARRIERS: + return _POSIX_BARRIERS, nil + case SC_FSYNC: + return _POSIX_FSYNC, nil + case SC_IPV6: + if _POSIX_IPV6 == 0 { + fd, err := unix.Socket(unix.AF_INET6, unix.SOCK_DGRAM, 0) + if err == nil && fd >= 0 { + unix.Close(fd) + return int64(200112), nil + } + return 0, nil + } + return _POSIX_IPV6, nil + case SC_JOB_CONTROL: + return _POSIX_JOB_CONTROL, nil + case SC_MAPPED_FILES: + return _POSIX_MAPPED_FILES, nil + case SC_MONOTONIC_CLOCK: + return _POSIX_MONOTONIC_CLOCK, nil + case SC_SAVED_IDS: + return _POSIX_SAVED_IDS, nil + case SC_SEMAPHORES: + return _POSIX_SEMAPHORES, nil + case SC_SPAWN: + return _POSIX_SPAWN, nil + case SC_SPIN_LOCKS: + return _POSIX_SPIN_LOCKS, nil + case SC_SPORADIC_SERVER: + return _POSIX_SPORADIC_SERVER, nil + case SC_SYNCHRONIZED_IO: + return _POSIX_SYNCHRONIZED_IO, nil + case SC_THREAD_ATTR_STACKADDR: + return _POSIX_THREAD_ATTR_STACKADDR, nil + case SC_THREAD_ATTR_STACKSIZE: + return _POSIX_THREAD_ATTR_STACKSIZE, nil + case SC_THREAD_CPUTIME: + return _POSIX_THREAD_CPUTIME, nil + case SC_THREAD_PRIO_INHERIT: + return _POSIX_THREAD_PRIO_INHERIT, nil + case SC_THREAD_PRIO_PROTECT: + return _POSIX_THREAD_PRIO_PROTECT, nil + case SC_THREAD_PRIORITY_SCHEDULING: + return _POSIX_THREAD_PRIORITY_SCHEDULING, nil + case SC_THREAD_PROCESS_SHARED: + return _POSIX_THREAD_PROCESS_SHARED, nil + case SC_THREAD_ROBUST_PRIO_INHERIT: + return _POSIX_THREAD_ROBUST_PRIO_INHERIT, nil + case SC_THREAD_ROBUST_PRIO_PROTECT: + return _POSIX_THREAD_ROBUST_PRIO_PROTECT, nil + case SC_THREAD_SAFE_FUNCTIONS: + return _POSIX_THREAD_SAFE_FUNCTIONS, nil + case SC_THREAD_SPORADIC_SERVER: + return _POSIX_THREAD_SPORADIC_SERVER, nil + case SC_THREADS: + return _POSIX_THREADS, nil + case SC_TIMEOUTS: + return _POSIX_TIMEOUTS, nil + case SC_TIMERS: + return _POSIX_TIMERS, nil + case SC_TRACE, + SC_TRACE_EVENT_FILTER, + SC_TRACE_EVENT_NAME_MAX, + SC_TRACE_INHERIT, + SC_TRACE_LOG: + return _POSIX_TRACE, nil + case SC_TYPED_MEMORY_OBJECTS: + return _POSIX_TYPED_MEMORY_OBJECTS, nil + + case SC_V7_ILP32_OFF32: + return _POSIX_V7_ILP32_OFF32, nil + case SC_V7_ILP32_OFFBIG: + if _POSIX_V7_ILP32_OFFBIG == 0 { + if unix.SizeofInt*_CHAR_BIT == 32 && + unix.SizeofLong*_CHAR_BIT == 32 && + unix.SizeofPtr*_CHAR_BIT == 32 && + sizeofOffT*_CHAR_BIT >= 64 { + return 1, nil + } + return -1, nil + } + return _POSIX_V7_ILP32_OFFBIG, nil + case SC_V7_LP64_OFF64: + if _POSIX_V7_LP64_OFF64 == 0 { + if unix.SizeofInt*_CHAR_BIT == 32 && + unix.SizeofLong*_CHAR_BIT == 64 && + unix.SizeofPtr*_CHAR_BIT == 64 && + sizeofOffT*_CHAR_BIT == 64 { + return 1, nil + } + return -1, nil + } + return _POSIX_V7_LP64_OFF64, nil + case SC_V7_LPBIG_OFFBIG: + if _POSIX_V7_LPBIG_OFFBIG == 0 { + if unix.SizeofInt*_CHAR_BIT >= 32 && + unix.SizeofLong*_CHAR_BIT >= 64 && + unix.SizeofPtr*_CHAR_BIT >= 64 && + sizeofOffT*_CHAR_BIT >= 64 { + return 1, nil + } + return -1, nil + } + return _POSIX_V7_LPBIG_OFFBIG, nil + + case SC_V6_ILP32_OFF32: + return _POSIX_V6_ILP32_OFF32, nil + case SC_V6_ILP32_OFFBIG: + if _POSIX_V6_ILP32_OFFBIG == 0 { + if unix.SizeofInt*_CHAR_BIT == 32 && + unix.SizeofLong*_CHAR_BIT == 32 && + unix.SizeofPtr*_CHAR_BIT == 32 && + sizeofOffT*_CHAR_BIT >= 64 { + return 1, nil + } + return -1, nil + } + return _POSIX_V6_ILP32_OFFBIG, nil + case SC_V6_LP64_OFF64: + if _POSIX_V6_LP64_OFF64 == 0 { + if unix.SizeofInt*_CHAR_BIT == 32 && + unix.SizeofLong*_CHAR_BIT == 64 && + unix.SizeofPtr*_CHAR_BIT == 64 && + sizeofOffT*_CHAR_BIT == 64 { + return 1, nil + } + return -1, nil + } + return _POSIX_V6_LP64_OFF64, nil + case SC_V6_LPBIG_OFFBIG: + if _POSIX_V6_LPBIG_OFFBIG == 0 { + if unix.SizeofInt*_CHAR_BIT >= 32 && + unix.SizeofLong*_CHAR_BIT >= 64 && + unix.SizeofPtr*_CHAR_BIT >= 64 && + sizeofOffT*_CHAR_BIT >= 64 { + return 1, nil + } + return -1, nil + } + return _POSIX_V6_LPBIG_OFFBIG, nil + + case SC_2_CHAR_TERM: + return _POSIX2_CHAR_TERM, nil + case SC_2_PBS, + SC_2_PBS_ACCOUNTING, + SC_2_PBS_CHECKPOINT, + SC_2_PBS_LOCATE, + SC_2_PBS_MESSAGE, + SC_2_PBS_TRACK: + return _POSIX2_PBS, nil + case SC_2_UPE: + return _POSIX2_UPE, nil + case SC_2_VERSION: + return _POSIX2_VERSION, nil + + case SC_XOPEN_CRYPT: + return _XOPEN_CRYPT, nil + case SC_XOPEN_ENH_I18N: + return _XOPEN_ENH_I18N, nil + case SC_XOPEN_REALTIME: + return _XOPEN_REALTIME, nil + case SC_XOPEN_REALTIME_THREADS: + return _XOPEN_REALTIME_THREADS, nil + case SC_XOPEN_SHM: + return _XOPEN_SHM, nil + case SC_XOPEN_STREAMS: + return _XOPEN_STREAMS, nil + case SC_XOPEN_UNIX: + return _XOPEN_UNIX, nil + case SC_XOPEN_UUCP: + return _XOPEN_UUCP, nil + + case SC_AVPHYS_PAGES: + if uvm, err := unix.SysctlUvmexp("vm.uvmexp"); err == nil { + return int64(uvm.Free), nil + } + return -1, nil + case SC_PHYS_PAGES: + return sysctl64("hw.physmem") / int64(unix.Getpagesize()), nil + case SC_NPROCESSORS_CONF: + return sysctl32("hw.ncpu"), nil + case SC_NPROCESSORS_ONLN: + if val, err := unix.SysctlUint32("hw.ncpuonline"); err == nil { + return int64(val), nil + } + return sysctl32("hw.ncpu"), nil + } + + return sysconfGeneric(name) +} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_posix.go b/vendor/github.com/tklauser/go-sysconf/sysconf_posix.go new file mode 100644 index 0000000000..e61c0bc73e --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/sysconf_posix.go @@ -0,0 +1,83 @@ +// Copyright 2018 Tobias Klauser. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build darwin || dragonfly || freebsd || linux || openbsd +// +build darwin dragonfly freebsd linux openbsd + +package sysconf + +func sysconfPOSIX(name int) (int64, error) { + switch name { + case SC_ADVISORY_INFO: + return _POSIX_ADVISORY_INFO, nil + case SC_ASYNCHRONOUS_IO: + return _POSIX_ASYNCHRONOUS_IO, nil + case SC_BARRIERS: + return _POSIX_BARRIERS, nil + case SC_CLOCK_SELECTION: + return _POSIX_CLOCK_SELECTION, nil + case SC_CPUTIME: + return _POSIX_CPUTIME, nil + case SC_FSYNC: + return _POSIX_FSYNC, nil + case SC_IPV6: + return _POSIX_IPV6, nil + case SC_JOB_CONTROL: + return _POSIX_JOB_CONTROL, nil + case SC_MAPPED_FILES: + return _POSIX_MAPPED_FILES, nil + case SC_MEMLOCK: + return _POSIX_MEMLOCK, nil + case SC_MEMLOCK_RANGE: + return _POSIX_MEMLOCK_RANGE, nil + case SC_MONOTONIC_CLOCK: + return _POSIX_MONOTONIC_CLOCK, nil + case SC_MEMORY_PROTECTION: + return _POSIX_MEMORY_PROTECTION, nil + case SC_MESSAGE_PASSING: + return _POSIX_MESSAGE_PASSING, nil + case SC_PRIORITIZED_IO: + return _POSIX_PRIORITIZED_IO, nil + case SC_PRIORITY_SCHEDULING: + return _POSIX_PRIORITY_SCHEDULING, nil + case SC_RAW_SOCKETS: + return _POSIX_RAW_SOCKETS, nil + case SC_READER_WRITER_LOCKS: + return _POSIX_READER_WRITER_LOCKS, nil + case SC_REALTIME_SIGNALS: + return _POSIX_REALTIME_SIGNALS, nil + case SC_REGEXP: + return _POSIX_REGEXP, nil + case SC_SEMAPHORES: + return _POSIX_SEMAPHORES, nil + case SC_SHARED_MEMORY_OBJECTS: + return _POSIX_SHARED_MEMORY_OBJECTS, nil + case SC_SHELL: + return _POSIX_SHELL, nil + case SC_THREADS: + return _POSIX_THREADS, nil + case SC_TIMEOUTS: + return _POSIX_TIMEOUTS, nil + case SC_TIMERS: + return _POSIX_TIMERS, nil + case SC_VERSION: + return _POSIX_VERSION, nil + + case SC_2_C_BIND: + return _POSIX2_C_BIND, nil + case SC_2_C_DEV: + return _POSIX2_C_DEV, nil + case SC_2_FORT_DEV: + return -1, nil + case SC_2_FORT_RUN: + return -1, nil + case SC_2_LOCALEDEF: + return _POSIX2_LOCALEDEF, nil + case SC_2_SW_DEV: + return _POSIX2_SW_DEV, nil + case SC_2_VERSION: + return _POSIX2_VERSION, nil + } + return -1, errInvalid +} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_solaris.go b/vendor/github.com/tklauser/go-sysconf/sysconf_solaris.go new file mode 100644 index 0000000000..443b21439d --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/sysconf_solaris.go @@ -0,0 +1,14 @@ +// Copyright 2021 Tobias Klauser. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package sysconf + +import "golang.org/x/sys/unix" + +func sysconf(name int) (int64, error) { + if name < 0 { + return -1, errInvalid + } + return unix.Sysconf(name) +} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_unsupported.go b/vendor/github.com/tklauser/go-sysconf/sysconf_unsupported.go new file mode 100644 index 0000000000..478d692005 --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/sysconf_unsupported.go @@ -0,0 +1,17 @@ +// Copyright 2021 Tobias Klauser. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris +// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris + +package sysconf + +import ( + "fmt" + "runtime" +) + +func sysconf(name int) (int64, error) { + return -1, fmt.Errorf("unsupported on %s", runtime.GOOS) +} diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_darwin.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_darwin.go new file mode 100644 index 0000000000..03d088634e --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_darwin.go @@ -0,0 +1,251 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_defs_darwin.go + +package sysconf + +const ( + SC_AIO_LISTIO_MAX = 0x2a + SC_AIO_MAX = 0x2b + SC_AIO_PRIO_DELTA_MAX = 0x2c + SC_ARG_MAX = 0x1 + SC_ATEXIT_MAX = 0x6b + SC_BC_BASE_MAX = 0x9 + SC_BC_DIM_MAX = 0xa + SC_BC_SCALE_MAX = 0xb + SC_BC_STRING_MAX = 0xc + SC_CHILD_MAX = 0x2 + SC_CLK_TCK = 0x3 + SC_COLL_WEIGHTS_MAX = 0xd + SC_DELAYTIMER_MAX = 0x2d + SC_EXPR_NEST_MAX = 0xe + SC_GETGR_R_SIZE_MAX = 0x46 + SC_GETPW_R_SIZE_MAX = 0x47 + SC_HOST_NAME_MAX = 0x48 + SC_IOV_MAX = 0x38 + SC_LINE_MAX = 0xf + SC_LOGIN_NAME_MAX = 0x49 + SC_MQ_OPEN_MAX = 0x2e + SC_MQ_PRIO_MAX = 0x4b + SC_NGROUPS_MAX = 0x4 + SC_OPEN_MAX = 0x5 + SC_PAGE_SIZE = 0x1d + SC_PAGESIZE = 0x1d + SC_THREAD_DESTRUCTOR_ITERATIONS = 0x55 + SC_THREAD_KEYS_MAX = 0x56 + SC_THREAD_STACK_MIN = 0x5d + SC_THREAD_THREADS_MAX = 0x5e + SC_RE_DUP_MAX = 0x10 + SC_RTSIG_MAX = 0x30 + SC_SEM_NSEMS_MAX = 0x31 + SC_SEM_VALUE_MAX = 0x32 + SC_SIGQUEUE_MAX = 0x33 + SC_STREAM_MAX = 0x1a + SC_SYMLOOP_MAX = 0x78 + SC_TIMER_MAX = 0x34 + SC_TTY_NAME_MAX = 0x65 + SC_TZNAME_MAX = 0x1b + + SC_ADVISORY_INFO = 0x41 + SC_ASYNCHRONOUS_IO = 0x1c + SC_BARRIERS = 0x42 + SC_CLOCK_SELECTION = 0x43 + SC_CPUTIME = 0x44 + SC_FSYNC = 0x26 + SC_IPV6 = 0x76 + SC_JOB_CONTROL = 0x6 + SC_MAPPED_FILES = 0x2f + SC_MEMLOCK = 0x1e + SC_MEMLOCK_RANGE = 0x1f + SC_MEMORY_PROTECTION = 0x20 + SC_MESSAGE_PASSING = 0x21 + SC_MONOTONIC_CLOCK = 0x4a + SC_PRIORITIZED_IO = 0x22 + SC_PRIORITY_SCHEDULING = 0x23 + SC_RAW_SOCKETS = 0x77 + SC_READER_WRITER_LOCKS = 0x4c + SC_REALTIME_SIGNALS = 0x24 + SC_REGEXP = 0x4d + SC_SAVED_IDS = 0x7 + SC_SEMAPHORES = 0x25 + SC_SHARED_MEMORY_OBJECTS = 0x27 + SC_SHELL = 0x4e + SC_SPAWN = 0x4f + SC_SPIN_LOCKS = 0x50 + SC_SPORADIC_SERVER = 0x51 + SC_SS_REPL_MAX = 0x7e + SC_SYNCHRONIZED_IO = 0x28 + SC_THREAD_ATTR_STACKADDR = 0x52 + SC_THREAD_ATTR_STACKSIZE = 0x53 + SC_THREAD_CPUTIME = 0x54 + SC_THREAD_PRIO_INHERIT = 0x57 + SC_THREAD_PRIO_PROTECT = 0x58 + SC_THREAD_PRIORITY_SCHEDULING = 0x59 + SC_THREAD_PROCESS_SHARED = 0x5a + SC_THREAD_SAFE_FUNCTIONS = 0x5b + SC_THREAD_SPORADIC_SERVER = 0x5c + SC_THREADS = 0x60 + SC_TIMEOUTS = 0x5f + SC_TIMERS = 0x29 + SC_TRACE = 0x61 + SC_TRACE_EVENT_FILTER = 0x62 + SC_TRACE_EVENT_NAME_MAX = 0x7f + SC_TRACE_INHERIT = 0x63 + SC_TRACE_LOG = 0x64 + SC_TRACE_NAME_MAX = 0x80 + SC_TRACE_SYS_MAX = 0x81 + SC_TRACE_USER_EVENT_MAX = 0x82 + SC_TYPED_MEMORY_OBJECTS = 0x66 + SC_VERSION = 0x8 + + SC_V6_ILP32_OFF32 = 0x67 + SC_V6_ILP32_OFFBIG = 0x68 + SC_V6_LP64_OFF64 = 0x69 + SC_V6_LPBIG_OFFBIG = 0x6a + + SC_2_C_BIND = 0x12 + SC_2_C_DEV = 0x13 + SC_2_CHAR_TERM = 0x14 + SC_2_FORT_DEV = 0x15 + SC_2_FORT_RUN = 0x16 + SC_2_LOCALEDEF = 0x17 + SC_2_PBS = 0x3b + SC_2_PBS_ACCOUNTING = 0x3c + SC_2_PBS_CHECKPOINT = 0x3d + SC_2_PBS_LOCATE = 0x3e + SC_2_PBS_MESSAGE = 0x3f + SC_2_PBS_TRACK = 0x40 + SC_2_SW_DEV = 0x18 + SC_2_UPE = 0x19 + SC_2_VERSION = 0x11 + + SC_XOPEN_CRYPT = 0x6c + SC_XOPEN_ENH_I18N = 0x6d + SC_XOPEN_REALTIME = 0x6f + SC_XOPEN_REALTIME_THREADS = 0x70 + SC_XOPEN_SHM = 0x71 + SC_XOPEN_STREAMS = 0x72 + SC_XOPEN_UNIX = 0x73 + SC_XOPEN_VERSION = 0x74 + SC_XOPEN_XCU_VERSION = 0x79 + + SC_PHYS_PAGES = 0xc8 + SC_NPROCESSORS_CONF = 0x39 + SC_NPROCESSORS_ONLN = 0x3a +) + +const ( + _BC_BASE_MAX = 0x63 + _BC_DIM_MAX = 0x800 + _BC_SCALE_MAX = 0x63 + _BC_STRING_MAX = 0x3e8 + _COLL_WEIGHTS_MAX = 0x2 + _EXPR_NEST_MAX = 0x20 + _IOV_MAX = 0x400 + _LINE_MAX = 0x800 + _NAME_MAX = 0xff + _RE_DUP_MAX = 0xff + + _CLK_TCK = 0x64 + + _MAXHOSTNAMELEN = 0x100 + _MAXLOGNAME = 0xff + _MAXSYMLINKS = 0x20 + + _POSIX_ADVISORY_INFO = -0x1 + _POSIX_ARG_MAX = 0x1000 + _POSIX_ASYNCHRONOUS_IO = -0x1 + _POSIX_BARRIERS = -0x1 + _POSIX_CHILD_MAX = 0x19 + _POSIX_CLOCK_SELECTION = -0x1 + _POSIX_CPUTIME = -0x1 + _POSIX_FSYNC = 0x30db0 + _POSIX_IPV6 = 0x30db0 + _POSIX_JOB_CONTROL = 0x30db0 + _POSIX_MAPPED_FILES = 0x30db0 + _POSIX_MEMLOCK = -0x1 + _POSIX_MEMLOCK_RANGE = -0x1 + _POSIX_MEMORY_PROTECTION = 0x30db0 + _POSIX_MESSAGE_PASSING = -0x1 + _POSIX_MONOTONIC_CLOCK = -0x1 + _POSIX_PRIORITIZED_IO = -0x1 + _POSIX_PRIORITY_SCHEDULING = -0x1 + _POSIX_RAW_SOCKETS = -0x1 + _POSIX_READER_WRITER_LOCKS = 0x30db0 + _POSIX_REALTIME_SIGNALS = -0x1 + _POSIX_REGEXP = 0x30db0 + _POSIX_SEM_VALUE_MAX = 0x7fff + _POSIX_SEMAPHORES = -0x1 + _POSIX_SHARED_MEMORY_OBJECTS = -0x1 + _POSIX_SHELL = 0x30db0 + _POSIX_SIGQUEUE_MAX = 0x20 + _POSIX_SPAWN = -0x1 + _POSIX_SPIN_LOCKS = -0x1 + _POSIX_SPORADIC_SERVER = -0x1 + _POSIX_SS_REPL_MAX = 0x4 + _POSIX_SYNCHRONIZED_IO = -0x1 + _POSIX_THREAD_ATTR_STACKADDR = 0x30db0 + _POSIX_THREAD_ATTR_STACKSIZE = 0x30db0 + _POSIX_THREAD_CPUTIME = -0x1 + _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 + _POSIX_THREAD_KEYS_MAX = 0x80 + _POSIX_THREAD_PRIO_INHERIT = -0x1 + _POSIX_THREAD_PRIO_PROTECT = -0x1 + _POSIX_THREAD_PRIORITY_SCHEDULING = -0x1 + _POSIX_THREAD_PROCESS_SHARED = 0x30db0 + _POSIX_THREAD_SAFE_FUNCTIONS = 0x30db0 + _POSIX_THREAD_SPORADIC_SERVER = -0x1 + _POSIX_THREADS = 0x30db0 + _POSIX_TIMEOUTS = -0x1 + _POSIX_TIMERS = -0x1 + _POSIX_TRACE = -0x1 + _POSIX_TRACE_EVENT_FILTER = -0x1 + _POSIX_TRACE_EVENT_NAME_MAX = 0x1e + _POSIX_TRACE_INHERIT = -0x1 + _POSIX_TRACE_LOG = -0x1 + _POSIX_TRACE_NAME_MAX = 0x8 + _POSIX_TRACE_SYS_MAX = 0x8 + _POSIX_TRACE_USER_EVENT_MAX = 0x20 + _POSIX_TYPED_MEMORY_OBJECTS = -0x1 + _POSIX_VERSION = 0x30db0 + + _V6_ILP32_OFF32 = -0x1 + _V6_ILP32_OFFBIG = -0x1 + _V6_LP64_OFF64 = 0x1 + _V6_LPBIG_OFFBIG = 0x1 + + _POSIX2_C_BIND = 0x30db0 + _POSIX2_C_DEV = 0x30db0 + _POSIX2_CHAR_TERM = 0x30db0 + _POSIX2_LOCALEDEF = 0x30db0 + _POSIX2_PBS = -0x1 + _POSIX2_SW_DEV = 0x30db0 + _POSIX2_UPE = 0x30db0 + _POSIX2_VERSION = 0x30db0 + + _XOPEN_CRYPT = 0x1 + _XOPEN_ENH_I18N = 0x1 + _XOPEN_REALTIME = -0x1 + _XOPEN_REALTIME_THREADS = -0x1 + _XOPEN_SHM = 0x1 + _XOPEN_UNIX = 0x1 + _XOPEN_VERSION = 0x258 + _XOPEN_XCU_VERSION = 0x4 + + _PTHREAD_DESTRUCTOR_ITERATIONS = 0x4 + _PTHREAD_KEYS_MAX = 0x200 + _PTHREAD_STACK_MIN = 0x2000 +) + +const ( + _PC_NAME_MAX = 0x4 + + _PATH_ZONEINFO = "/usr/share/zoneinfo" +) + +const ( + _CHAR_BIT = 0x8 + + _INT_MAX = 0x7fffffff + + sizeofOffT = 0x8 +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_dragonfly.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_dragonfly.go new file mode 100644 index 0000000000..4e71d6b2dc --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_dragonfly.go @@ -0,0 +1,225 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_defs_dragonfly.go + +package sysconf + +const ( + SC_AIO_LISTIO_MAX = 0x2a + SC_AIO_MAX = 0x2b + SC_AIO_PRIO_DELTA_MAX = 0x2c + SC_ARG_MAX = 0x1 + SC_ATEXIT_MAX = 0x6b + SC_BC_BASE_MAX = 0x9 + SC_BC_DIM_MAX = 0xa + SC_BC_SCALE_MAX = 0xb + SC_BC_STRING_MAX = 0xc + SC_CHILD_MAX = 0x2 + SC_CLK_TCK = 0x3 + SC_COLL_WEIGHTS_MAX = 0xd + SC_DELAYTIMER_MAX = 0x2d + SC_EXPR_NEST_MAX = 0xe + SC_GETGR_R_SIZE_MAX = 0x46 + SC_GETPW_R_SIZE_MAX = 0x47 + SC_HOST_NAME_MAX = 0x48 + SC_IOV_MAX = 0x38 + SC_LINE_MAX = 0xf + SC_LOGIN_NAME_MAX = 0x49 + SC_MQ_OPEN_MAX = 0x2e + SC_MQ_PRIO_MAX = 0x4b + SC_NGROUPS_MAX = 0x4 + SC_OPEN_MAX = 0x5 + SC_PAGE_SIZE = 0x2f + SC_PAGESIZE = 0x2f + SC_RE_DUP_MAX = 0x10 + SC_RTSIG_MAX = 0x30 + SC_SEM_NSEMS_MAX = 0x31 + SC_SEM_VALUE_MAX = 0x32 + SC_SIGQUEUE_MAX = 0x33 + SC_STREAM_MAX = 0x1a + SC_SYMLOOP_MAX = 0x78 + SC_THREAD_DESTRUCTOR_ITERATIONS = 0x55 + SC_THREAD_KEYS_MAX = 0x56 + SC_THREAD_STACK_MIN = 0x5d + SC_THREAD_THREADS_MAX = 0x5e + SC_TIMER_MAX = 0x34 + SC_TTY_NAME_MAX = 0x65 + SC_TZNAME_MAX = 0x1b + + SC_ADVISORY_INFO = 0x41 + SC_ASYNCHRONOUS_IO = 0x1c + SC_BARRIERS = 0x42 + SC_CLOCK_SELECTION = 0x43 + SC_CPUTIME = 0x44 + SC_FSYNC = 0x26 + SC_IPV6 = 0x76 + SC_JOB_CONTROL = 0x6 + SC_MAPPED_FILES = 0x1d + SC_MEMLOCK = 0x1e + SC_MEMLOCK_RANGE = 0x1f + SC_MEMORY_PROTECTION = 0x20 + SC_MESSAGE_PASSING = 0x21 + SC_MONOTONIC_CLOCK = 0x4a + SC_PRIORITIZED_IO = 0x22 + SC_PRIORITY_SCHEDULING = 0x23 + SC_RAW_SOCKETS = 0x77 + SC_READER_WRITER_LOCKS = 0x4c + SC_REALTIME_SIGNALS = 0x24 + SC_REGEXP = 0x4d + SC_SAVED_IDS = 0x7 + SC_SEMAPHORES = 0x25 + SC_SHARED_MEMORY_OBJECTS = 0x27 + SC_SHELL = 0x4e + SC_SPAWN = 0x4f + SC_SPIN_LOCKS = 0x50 + SC_SPORADIC_SERVER = 0x51 + SC_SYNCHRONIZED_IO = 0x28 + SC_THREAD_ATTR_STACKADDR = 0x52 + SC_THREAD_ATTR_STACKSIZE = 0x53 + SC_THREAD_CPUTIME = 0x54 + SC_THREAD_PRIO_INHERIT = 0x57 + SC_THREAD_PRIO_PROTECT = 0x58 + SC_THREAD_PRIORITY_SCHEDULING = 0x59 + SC_THREAD_PROCESS_SHARED = 0x5a + SC_THREAD_SAFE_FUNCTIONS = 0x5b + SC_THREAD_SPORADIC_SERVER = 0x5c + SC_THREADS = 0x60 + SC_TIMEOUTS = 0x5f + SC_TIMERS = 0x29 + SC_TRACE = 0x61 + SC_TRACE_EVENT_FILTER = 0x62 + SC_TRACE_INHERIT = 0x63 + SC_TRACE_LOG = 0x64 + SC_TYPED_MEMORY_OBJECTS = 0x66 + SC_VERSION = 0x8 + + SC_V6_ILP32_OFF32 = 0x67 + SC_V6_ILP32_OFFBIG = 0x68 + SC_V6_LP64_OFF64 = 0x69 + SC_V6_LPBIG_OFFBIG = 0x6a + + SC_2_C_BIND = 0x12 + SC_2_C_DEV = 0x13 + SC_2_CHAR_TERM = 0x14 + SC_2_FORT_DEV = 0x15 + SC_2_FORT_RUN = 0x16 + SC_2_LOCALEDEF = 0x17 + SC_2_PBS = 0x3b + SC_2_PBS_ACCOUNTING = 0x3c + SC_2_PBS_CHECKPOINT = 0x3d + SC_2_PBS_LOCATE = 0x3e + SC_2_PBS_MESSAGE = 0x3f + SC_2_PBS_TRACK = 0x40 + SC_2_SW_DEV = 0x18 + SC_2_UPE = 0x19 + SC_2_VERSION = 0x11 + + SC_XOPEN_CRYPT = 0x6c + SC_XOPEN_ENH_I18N = 0x6d + SC_XOPEN_REALTIME = 0x6f + SC_XOPEN_REALTIME_THREADS = 0x70 + SC_XOPEN_SHM = 0x71 + SC_XOPEN_STREAMS = 0x72 + SC_XOPEN_UNIX = 0x73 + SC_XOPEN_VERSION = 0x74 + SC_XOPEN_XCU_VERSION = 0x75 + + SC_PHYS_PAGES = 0x79 + SC_NPROCESSORS_CONF = 0x39 + SC_NPROCESSORS_ONLN = 0x3a +) + +const ( + _BC_BASE_MAX = 0x63 + _BC_DIM_MAX = 0x800 + _BC_SCALE_MAX = 0x63 + _BC_STRING_MAX = 0x3e8 + _COLL_WEIGHTS_MAX = 0xa + _EXPR_NEST_MAX = 0x20 + _LINE_MAX = 0x800 + _RE_DUP_MAX = 0xff + + _CLK_TCK = 0x80 + + _MAXHOSTNAMELEN = 0x100 + _MAXLOGNAME = 0x11 + _MAXSYMLINKS = 0x20 + _ATEXIT_SIZE = 0x20 + + _POSIX_ADVISORY_INFO = -0x1 + _POSIX_ARG_MAX = 0x1000 + _POSIX_ASYNCHRONOUS_IO = 0x0 + _POSIX_BARRIERS = 0x30db0 + _POSIX_CHILD_MAX = 0x19 + _POSIX_CLOCK_SELECTION = -0x1 + _POSIX_CPUTIME = 0x30db0 + _POSIX_FSYNC = 0x30db0 + _POSIX_IPV6 = 0x0 + _POSIX_JOB_CONTROL = 0x1 + _POSIX_MAPPED_FILES = 0x30db0 + _POSIX_MEMLOCK = -0x1 + _POSIX_MEMLOCK_RANGE = 0x30db0 + _POSIX_MEMORY_PROTECTION = 0x30db0 + _POSIX_MESSAGE_PASSING = 0x30db0 + _POSIX_MONOTONIC_CLOCK = 0x30db0 + _POSIX_PRIORITIZED_IO = -0x1 + _POSIX_PRIORITY_SCHEDULING = 0x30db0 + _POSIX_RAW_SOCKETS = 0x30db0 + _POSIX_READER_WRITER_LOCKS = 0x30db0 + _POSIX_REALTIME_SIGNALS = 0x30db0 + _POSIX_REGEXP = 0x1 + _POSIX_SEM_VALUE_MAX = 0x7fff + _POSIX_SEMAPHORES = 0x30db0 + _POSIX_SHARED_MEMORY_OBJECTS = 0x30db0 + _POSIX_SHELL = 0x1 + _POSIX_SPAWN = 0x30db0 + _POSIX_SPIN_LOCKS = 0x30db0 + _POSIX_SPORADIC_SERVER = -0x1 + _POSIX_SYNCHRONIZED_IO = -0x1 + _POSIX_THREAD_ATTR_STACKADDR = 0x30db0 + _POSIX_THREAD_ATTR_STACKSIZE = 0x30db0 + _POSIX_THREAD_CPUTIME = 0x30db0 + _POSIX_THREAD_PRIO_INHERIT = 0x30db0 + _POSIX_THREAD_PRIO_PROTECT = 0x30db0 + _POSIX_THREAD_PRIORITY_SCHEDULING = 0x30db0 + _POSIX_THREAD_PROCESS_SHARED = -0x1 + _POSIX_THREAD_SAFE_FUNCTIONS = -0x1 + _POSIX_THREAD_SPORADIC_SERVER = -0x1 + _POSIX_THREADS = 0x30db0 + _POSIX_TIMEOUTS = 0x30db0 + _POSIX_TIMERS = 0x30db0 + _POSIX_TRACE = -0x1 + _POSIX_TYPED_MEMORY_OBJECTS = -0x1 + _POSIX_VERSION = 0x30db0 + + _V6_ILP32_OFF32 = -0x1 + _V6_ILP32_OFFBIG = 0x0 + _V6_LP64_OFF64 = 0x0 + _V6_LPBIG_OFFBIG = -0x1 + + _POSIX2_C_BIND = 0x31069 + _POSIX2_C_DEV = 0x31069 + _POSIX2_CHAR_TERM = 0x1 + _POSIX2_LOCALEDEF = 0x31069 + _POSIX2_PBS = -0x1 + _POSIX2_SW_DEV = 0x31069 + _POSIX2_UPE = 0x31069 + _POSIX2_VERSION = 0x30a2c + + _XOPEN_CRYPT = -0x1 + _XOPEN_ENH_I18N = -0x1 + _XOPEN_REALTIME = -0x1 + _XOPEN_REALTIME_THREADS = -0x1 + _XOPEN_SHM = 0x1 + _XOPEN_UNIX = -0x1 + + _PTHREAD_DESTRUCTOR_ITERATIONS = 0x4 + _PTHREAD_KEYS_MAX = 0x100 + _PTHREAD_STACK_MIN = 0x4000 +) + +const ( + _PC_NAME_MAX = 0x4 + + _PATH_DEV = "/dev/" + _PATH_ZONEINFO = "/usr/share/zoneinfo" +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_freebsd.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_freebsd.go new file mode 100644 index 0000000000..cb56d255b7 --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_freebsd.go @@ -0,0 +1,226 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_defs_freebsd.go + +package sysconf + +const ( + SC_AIO_LISTIO_MAX = 0x2a + SC_AIO_MAX = 0x2b + SC_AIO_PRIO_DELTA_MAX = 0x2c + SC_ARG_MAX = 0x1 + SC_ATEXIT_MAX = 0x6b + SC_BC_BASE_MAX = 0x9 + SC_BC_DIM_MAX = 0xa + SC_BC_SCALE_MAX = 0xb + SC_BC_STRING_MAX = 0xc + SC_CHILD_MAX = 0x2 + SC_CLK_TCK = 0x3 + SC_COLL_WEIGHTS_MAX = 0xd + SC_DELAYTIMER_MAX = 0x2d + SC_EXPR_NEST_MAX = 0xe + SC_GETGR_R_SIZE_MAX = 0x46 + SC_GETPW_R_SIZE_MAX = 0x47 + SC_HOST_NAME_MAX = 0x48 + SC_IOV_MAX = 0x38 + SC_LINE_MAX = 0xf + SC_LOGIN_NAME_MAX = 0x49 + SC_MQ_OPEN_MAX = 0x2e + SC_MQ_PRIO_MAX = 0x4b + SC_NGROUPS_MAX = 0x4 + SC_OPEN_MAX = 0x5 + SC_PAGE_SIZE = 0x2f + SC_PAGESIZE = 0x2f + SC_RE_DUP_MAX = 0x10 + SC_RTSIG_MAX = 0x30 + SC_SEM_NSEMS_MAX = 0x31 + SC_SEM_VALUE_MAX = 0x32 + SC_SIGQUEUE_MAX = 0x33 + SC_STREAM_MAX = 0x1a + SC_SYMLOOP_MAX = 0x78 + SC_THREAD_DESTRUCTOR_ITERATIONS = 0x55 + SC_THREAD_KEYS_MAX = 0x56 + SC_THREAD_STACK_MIN = 0x5d + SC_THREAD_THREADS_MAX = 0x5e + SC_TIMER_MAX = 0x34 + SC_TTY_NAME_MAX = 0x65 + SC_TZNAME_MAX = 0x1b + + SC_ADVISORY_INFO = 0x41 + SC_ASYNCHRONOUS_IO = 0x1c + SC_BARRIERS = 0x42 + SC_CLOCK_SELECTION = 0x43 + SC_CPUTIME = 0x44 + SC_FSYNC = 0x26 + SC_IPV6 = 0x76 + SC_JOB_CONTROL = 0x6 + SC_MAPPED_FILES = 0x1d + SC_MEMLOCK = 0x1e + SC_MEMLOCK_RANGE = 0x1f + SC_MEMORY_PROTECTION = 0x20 + SC_MESSAGE_PASSING = 0x21 + SC_MONOTONIC_CLOCK = 0x4a + SC_PRIORITIZED_IO = 0x22 + SC_PRIORITY_SCHEDULING = 0x23 + SC_RAW_SOCKETS = 0x77 + SC_READER_WRITER_LOCKS = 0x4c + SC_REALTIME_SIGNALS = 0x24 + SC_REGEXP = 0x4d + SC_SAVED_IDS = 0x7 + SC_SEMAPHORES = 0x25 + SC_SHARED_MEMORY_OBJECTS = 0x27 + SC_SHELL = 0x4e + SC_SPAWN = 0x4f + SC_SPIN_LOCKS = 0x50 + SC_SPORADIC_SERVER = 0x51 + SC_SYNCHRONIZED_IO = 0x28 + SC_THREAD_ATTR_STACKADDR = 0x52 + SC_THREAD_ATTR_STACKSIZE = 0x53 + SC_THREAD_CPUTIME = 0x54 + SC_THREAD_PRIO_INHERIT = 0x57 + SC_THREAD_PRIO_PROTECT = 0x58 + SC_THREAD_PRIORITY_SCHEDULING = 0x59 + SC_THREAD_PROCESS_SHARED = 0x5a + SC_THREAD_SAFE_FUNCTIONS = 0x5b + SC_THREAD_SPORADIC_SERVER = 0x5c + SC_THREADS = 0x60 + SC_TIMEOUTS = 0x5f + SC_TIMERS = 0x29 + SC_TRACE = 0x61 + SC_TRACE_EVENT_FILTER = 0x62 + SC_TRACE_INHERIT = 0x63 + SC_TRACE_LOG = 0x64 + SC_TYPED_MEMORY_OBJECTS = 0x66 + SC_VERSION = 0x8 + + SC_V6_ILP32_OFF32 = 0x67 + SC_V6_ILP32_OFFBIG = 0x68 + SC_V6_LP64_OFF64 = 0x69 + SC_V6_LPBIG_OFFBIG = 0x6a + + SC_2_C_BIND = 0x12 + SC_2_C_DEV = 0x13 + SC_2_CHAR_TERM = 0x14 + SC_2_FORT_DEV = 0x15 + SC_2_FORT_RUN = 0x16 + SC_2_LOCALEDEF = 0x17 + SC_2_PBS = 0x3b + SC_2_PBS_ACCOUNTING = 0x3c + SC_2_PBS_CHECKPOINT = 0x3d + SC_2_PBS_LOCATE = 0x3e + SC_2_PBS_MESSAGE = 0x3f + SC_2_PBS_TRACK = 0x40 + SC_2_SW_DEV = 0x18 + SC_2_UPE = 0x19 + SC_2_VERSION = 0x11 + + SC_XOPEN_CRYPT = 0x6c + SC_XOPEN_ENH_I18N = 0x6d + SC_XOPEN_REALTIME = 0x6f + SC_XOPEN_REALTIME_THREADS = 0x70 + SC_XOPEN_SHM = 0x71 + SC_XOPEN_STREAMS = 0x72 + SC_XOPEN_UNIX = 0x73 + SC_XOPEN_VERSION = 0x74 + SC_XOPEN_XCU_VERSION = 0x75 + + SC_PHYS_PAGES = 0x79 + SC_NPROCESSORS_CONF = 0x39 + SC_NPROCESSORS_ONLN = 0x3a +) + +const ( + _BC_BASE_MAX = 0x63 + _BC_DIM_MAX = 0x800 + _BC_SCALE_MAX = 0x63 + _BC_STRING_MAX = 0x3e8 + _COLL_WEIGHTS_MAX = 0xa + _EXPR_NEST_MAX = 0x20 + _LINE_MAX = 0x800 + _MQ_PRIO_MAX = 0x40 + _RE_DUP_MAX = 0xff + _SEM_VALUE_MAX = 0x7fffffff + + _CLK_TCK = 0x80 + + _MAXHOSTNAMELEN = 0x100 + _MAXLOGNAME = 0x21 + _MAXSYMLINKS = 0x20 + _ATEXIT_SIZE = 0x20 + + _POSIX_ADVISORY_INFO = 0x30db0 + _POSIX_ARG_MAX = 0x1000 + _POSIX_ASYNCHRONOUS_IO = 0x30db0 + _POSIX_BARRIERS = 0x30db0 + _POSIX_CHILD_MAX = 0x19 + _POSIX_CLOCK_SELECTION = -0x1 + _POSIX_CPUTIME = 0x30db0 + _POSIX_FSYNC = 0x30db0 + _POSIX_IPV6 = 0x0 + _POSIX_JOB_CONTROL = 0x1 + _POSIX_MAPPED_FILES = 0x30db0 + _POSIX_MEMLOCK = -0x1 + _POSIX_MEMLOCK_RANGE = 0x30db0 + _POSIX_MEMORY_PROTECTION = 0x30db0 + _POSIX_MESSAGE_PASSING = 0x30db0 + _POSIX_MONOTONIC_CLOCK = 0x30db0 + _POSIX_PRIORITIZED_IO = -0x1 + _POSIX_PRIORITY_SCHEDULING = 0x0 + _POSIX_RAW_SOCKETS = 0x30db0 + _POSIX_READER_WRITER_LOCKS = 0x30db0 + _POSIX_REALTIME_SIGNALS = 0x30db0 + _POSIX_REGEXP = 0x1 + _POSIX_SEM_VALUE_MAX = 0x7fff + _POSIX_SEMAPHORES = 0x30db0 + _POSIX_SHARED_MEMORY_OBJECTS = 0x30db0 + _POSIX_SHELL = 0x1 + _POSIX_SPAWN = 0x30db0 + _POSIX_SPIN_LOCKS = 0x30db0 + _POSIX_SPORADIC_SERVER = -0x1 + _POSIX_SYNCHRONIZED_IO = -0x1 + _POSIX_THREAD_ATTR_STACKADDR = 0x30db0 + _POSIX_THREAD_ATTR_STACKSIZE = 0x30db0 + _POSIX_THREAD_CPUTIME = 0x30db0 + _POSIX_THREAD_PRIO_INHERIT = 0x30db0 + _POSIX_THREAD_PRIO_PROTECT = 0x30db0 + _POSIX_THREAD_PRIORITY_SCHEDULING = 0x30db0 + _POSIX_THREAD_PROCESS_SHARED = 0x30db0 + _POSIX_THREAD_SAFE_FUNCTIONS = -0x1 + _POSIX_THREADS = 0x30db0 + _POSIX_TIMEOUTS = 0x30db0 + _POSIX_TIMERS = 0x30db0 + _POSIX_TRACE = -0x1 + _POSIX_TYPED_MEMORY_OBJECTS = -0x1 + _POSIX_VERSION = 0x30db0 + + _V6_ILP32_OFF32 = -0x1 + _V6_ILP32_OFFBIG = 0x0 + _V6_LP64_OFF64 = 0x0 + _V6_LPBIG_OFFBIG = -0x1 + + _POSIX2_C_BIND = 0x30db0 + _POSIX2_C_DEV = -0x1 + _POSIX2_CHAR_TERM = 0x1 + _POSIX2_LOCALEDEF = -0x1 + _POSIX2_PBS = -0x1 + _POSIX2_SW_DEV = -0x1 + _POSIX2_UPE = 0x30db0 + _POSIX2_VERSION = 0x30a2c + + _XOPEN_CRYPT = -0x1 + _XOPEN_ENH_I18N = -0x1 + _XOPEN_REALTIME = -0x1 + _XOPEN_REALTIME_THREADS = -0x1 + _XOPEN_SHM = 0x1 + _XOPEN_UNIX = -0x1 + + _PTHREAD_DESTRUCTOR_ITERATIONS = 0x4 + _PTHREAD_KEYS_MAX = 0x100 + _PTHREAD_STACK_MIN = 0x800 +) + +const ( + _PC_NAME_MAX = 0x4 + + _PATH_DEV = "/dev/" + _PATH_ZONEINFO = "/usr/share/zoneinfo" +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_linux.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_linux.go new file mode 100644 index 0000000000..4a4c547fb1 --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_linux.go @@ -0,0 +1,144 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_defs_linux.go + +package sysconf + +const ( + SC_AIO_LISTIO_MAX = 0x17 + SC_AIO_MAX = 0x18 + SC_AIO_PRIO_DELTA_MAX = 0x19 + SC_ARG_MAX = 0x0 + SC_ATEXIT_MAX = 0x57 + SC_BC_BASE_MAX = 0x24 + SC_BC_DIM_MAX = 0x25 + SC_BC_SCALE_MAX = 0x26 + SC_BC_STRING_MAX = 0x27 + SC_CHILD_MAX = 0x1 + SC_CLK_TCK = 0x2 + SC_COLL_WEIGHTS_MAX = 0x28 + SC_DELAYTIMER_MAX = 0x1a + SC_EXPR_NEST_MAX = 0x2a + SC_GETGR_R_SIZE_MAX = 0x45 + SC_GETPW_R_SIZE_MAX = 0x46 + SC_HOST_NAME_MAX = 0xb4 + SC_IOV_MAX = 0x3c + SC_LINE_MAX = 0x2b + SC_LOGIN_NAME_MAX = 0x47 + SC_MQ_OPEN_MAX = 0x1b + SC_MQ_PRIO_MAX = 0x1c + SC_NGROUPS_MAX = 0x3 + SC_OPEN_MAX = 0x4 + SC_PAGE_SIZE = 0x1e + SC_PAGESIZE = 0x1e + SC_THREAD_DESTRUCTOR_ITERATIONS = 0x49 + SC_THREAD_KEYS_MAX = 0x4a + SC_THREAD_STACK_MIN = 0x4b + SC_THREAD_THREADS_MAX = 0x4c + SC_RE_DUP_MAX = 0x2c + SC_RTSIG_MAX = 0x1f + SC_SEM_NSEMS_MAX = 0x20 + SC_SEM_VALUE_MAX = 0x21 + SC_SIGQUEUE_MAX = 0x22 + SC_STREAM_MAX = 0x5 + SC_SYMLOOP_MAX = 0xad + SC_TIMER_MAX = 0x23 + SC_TTY_NAME_MAX = 0x48 + SC_TZNAME_MAX = 0x6 + + SC_ADVISORY_INFO = 0x84 + SC_ASYNCHRONOUS_IO = 0xc + SC_BARRIERS = 0x85 + SC_CLOCK_SELECTION = 0x89 + SC_CPUTIME = 0x8a + SC_FSYNC = 0xf + SC_IPV6 = 0xeb + SC_JOB_CONTROL = 0x7 + SC_MAPPED_FILES = 0x10 + SC_MEMLOCK = 0x11 + SC_MEMLOCK_RANGE = 0x12 + SC_MEMORY_PROTECTION = 0x13 + SC_MESSAGE_PASSING = 0x14 + SC_MONOTONIC_CLOCK = 0x95 + SC_PRIORITIZED_IO = 0xd + SC_PRIORITY_SCHEDULING = 0xa + SC_RAW_SOCKETS = 0xec + SC_READER_WRITER_LOCKS = 0x99 + SC_REALTIME_SIGNALS = 0x9 + SC_REGEXP = 0x9b + SC_SAVED_IDS = 0x8 + SC_SEMAPHORES = 0x15 + SC_SHARED_MEMORY_OBJECTS = 0x16 + SC_SHELL = 0x9d + SC_SPAWN = 0x9f + SC_SPIN_LOCKS = 0x9a + SC_SPORADIC_SERVER = 0xa0 + SC_SS_REPL_MAX = 0xf1 + SC_SYNCHRONIZED_IO = 0xe + SC_THREAD_ATTR_STACKADDR = 0x4d + SC_THREAD_ATTR_STACKSIZE = 0x4e + SC_THREAD_CPUTIME = 0x8b + SC_THREAD_PRIO_INHERIT = 0x50 + SC_THREAD_PRIO_PROTECT = 0x51 + SC_THREAD_PRIORITY_SCHEDULING = 0x4f + SC_THREAD_PROCESS_SHARED = 0x52 + SC_THREAD_ROBUST_PRIO_INHERIT = 0xf7 + SC_THREAD_ROBUST_PRIO_PROTECT = 0xf8 + SC_THREAD_SAFE_FUNCTIONS = 0x44 + SC_THREAD_SPORADIC_SERVER = 0xa1 + SC_THREADS = 0x43 + SC_TIMEOUTS = 0xa4 + SC_TIMERS = 0xb + SC_TRACE = 0xb5 + SC_TRACE_EVENT_FILTER = 0xb6 + SC_TRACE_EVENT_NAME_MAX = 0xf2 + SC_TRACE_INHERIT = 0xb7 + SC_TRACE_LOG = 0xb8 + SC_TRACE_NAME_MAX = 0xf3 + SC_TRACE_SYS_MAX = 0xf4 + SC_TRACE_USER_EVENT_MAX = 0xf5 + SC_TYPED_MEMORY_OBJECTS = 0xa5 + SC_VERSION = 0x1d + + SC_V7_ILP32_OFF32 = 0xed + SC_V7_ILP32_OFFBIG = 0xee + SC_V7_LP64_OFF64 = 0xef + SC_V7_LPBIG_OFFBIG = 0xf0 + + SC_V6_ILP32_OFF32 = 0xb0 + SC_V6_ILP32_OFFBIG = 0xb1 + SC_V6_LP64_OFF64 = 0xb2 + SC_V6_LPBIG_OFFBIG = 0xb3 + + SC_2_C_BIND = 0x2f + SC_2_C_DEV = 0x30 + SC_2_C_VERSION = 0x60 + SC_2_CHAR_TERM = 0x5f + SC_2_FORT_DEV = 0x31 + SC_2_FORT_RUN = 0x32 + SC_2_LOCALEDEF = 0x34 + SC_2_PBS = 0xa8 + SC_2_PBS_ACCOUNTING = 0xa9 + SC_2_PBS_CHECKPOINT = 0xaf + SC_2_PBS_LOCATE = 0xaa + SC_2_PBS_MESSAGE = 0xab + SC_2_PBS_TRACK = 0xac + SC_2_SW_DEV = 0x33 + SC_2_UPE = 0x61 + SC_2_VERSION = 0x2e + + SC_XOPEN_CRYPT = 0x5c + SC_XOPEN_ENH_I18N = 0x5d + SC_XOPEN_REALTIME = 0x82 + SC_XOPEN_REALTIME_THREADS = 0x83 + SC_XOPEN_SHM = 0x5e + SC_XOPEN_STREAMS = 0xf6 + SC_XOPEN_UNIX = 0x5b + SC_XOPEN_VERSION = 0x59 + SC_XOPEN_XCU_VERSION = 0x5a + + SC_PHYS_PAGES = 0x55 + SC_AVPHYS_PAGES = 0x56 + SC_NPROCESSORS_CONF = 0x53 + SC_NPROCESSORS_ONLN = 0x54 + SC_UIO_MAXIOV = 0x3c +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_netbsd.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_netbsd.go new file mode 100644 index 0000000000..4ef07a7565 --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_netbsd.go @@ -0,0 +1,94 @@ +// Created by cgo -godefs - DO NOT EDIT +// cgo -godefs sysconf_defs_netbsd.go + +package sysconf + +const ( + SC_AIO_LISTIO_MAX = 0x33 + SC_AIO_MAX = 0x34 + SC_ARG_MAX = 0x1 + SC_ATEXIT_MAX = 0x28 + SC_BC_BASE_MAX = 0x9 + SC_BC_DIM_MAX = 0xa + SC_BC_SCALE_MAX = 0xb + SC_BC_STRING_MAX = 0xc + SC_CHILD_MAX = 0x2 + SC_CLK_TCK = 0x27 + SC_COLL_WEIGHTS_MAX = 0xd + SC_EXPR_NEST_MAX = 0xe + SC_HOST_NAME_MAX = 0x45 + SC_IOV_MAX = 0x20 + SC_LINE_MAX = 0xf + SC_LOGIN_NAME_MAX = 0x25 + SC_MQ_OPEN_MAX = 0x36 + SC_MQ_PRIO_MAX = 0x37 + SC_NGROUPS_MAX = 0x4 + SC_OPEN_MAX = 0x5 + SC_PAGE_SIZE = 0x1c + SC_PAGESIZE = 0x1c + SC_THREAD_DESTRUCTOR_ITERATIONS = 0x39 + SC_THREAD_KEYS_MAX = 0x3a + SC_THREAD_STACK_MIN = 0x3b + SC_THREAD_THREADS_MAX = 0x3c + SC_RE_DUP_MAX = 0x10 + SC_STREAM_MAX = 0x1a + SC_SYMLOOP_MAX = 0x49 + SC_TTY_NAME_MAX = 0x44 + SC_TZNAME_MAX = 0x1b + + SC_ASYNCHRONOUS_IO = 0x32 + SC_BARRIERS = 0x2b + SC_FSYNC = 0x1d + SC_JOB_CONTROL = 0x6 + SC_MAPPED_FILES = 0x21 + SC_SEMAPHORES = 0x2a + SC_SHELL = 0x48 + SC_THREADS = 0x29 + SC_TIMERS = 0x2c + SC_VERSION = 0x8 + + SC_2_VERSION = 0x11 + SC_2_C_DEV = 0x13 + SC_2_FORT_DEV = 0x15 + SC_2_FORT_RUN = 0x16 + SC_2_LOCALEDEF = 0x17 + SC_2_SW_DEV = 0x18 + SC_2_UPE = 0x19 + + SC_PHYS_PAGES = 0x79 + SC_MONOTONIC_CLOCK = 0x26 + SC_NPROCESSORS_CONF = 0x3e9 + SC_NPROCESSORS_ONLN = 0x3ea +) + +const ( + _MAXHOSTNAMELEN = 0x100 + _MAXLOGNAME = 0x10 + _MAXSYMLINKS = 0x20 + + _POSIX_ARG_MAX = 0x1000 + _POSIX_CHILD_MAX = 0x19 + _POSIX_SHELL = 0x1 + _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 + _POSIX_THREAD_KEYS_MAX = 0x100 + _POSIX_VERSION = 0x30db0 + + _POSIX2_VERSION = 0x30db0 + + _FOPEN_MAX = 0x14 + _NAME_MAX = 0x1ff + _RE_DUP_MAX = 0xff + + _BC_BASE_MAX = 0x7fffffff + _BC_DIM_MAX = 0xffff + _BC_SCALE_MAX = 0x7fffffff + _BC_STRING_MAX = 0x7fffffff + _COLL_WEIGHTS_MAX = 0x2 + _EXPR_NEST_MAX = 0x20 + _LINE_MAX = 0x800 + + _PATH_DEV = "/dev/" + _PATH_ZONEINFO = "/usr/share/zoneinfo" +) + +const _PC_NAME_MAX = 0x4 diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_openbsd.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_openbsd.go new file mode 100644 index 0000000000..87db8ec9d2 --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_openbsd.go @@ -0,0 +1,260 @@ +// Created by cgo -godefs - DO NOT EDIT +// cgo -godefs sysconf_defs_openbsd.go + +package sysconf + +const ( + SC_AIO_LISTIO_MAX = 0x2a + SC_AIO_MAX = 0x2b + SC_AIO_PRIO_DELTA_MAX = 0x2c + SC_ARG_MAX = 0x1 + SC_ATEXIT_MAX = 0x2e + SC_BC_BASE_MAX = 0x9 + SC_BC_DIM_MAX = 0xa + SC_BC_SCALE_MAX = 0xb + SC_BC_STRING_MAX = 0xc + SC_CHILD_MAX = 0x2 + SC_CLK_TCK = 0x3 + SC_COLL_WEIGHTS_MAX = 0xd + SC_DELAYTIMER_MAX = 0x32 + SC_EXPR_NEST_MAX = 0xe + SC_GETGR_R_SIZE_MAX = 0x64 + SC_GETPW_R_SIZE_MAX = 0x65 + SC_HOST_NAME_MAX = 0x21 + SC_IOV_MAX = 0x33 + SC_LINE_MAX = 0xf + SC_LOGIN_NAME_MAX = 0x66 + SC_MQ_OPEN_MAX = 0x3a + SC_MQ_PRIO_MAX = 0x3b + SC_NGROUPS_MAX = 0x4 + SC_OPEN_MAX = 0x5 + SC_PAGE_SIZE = 0x1c + SC_PAGESIZE = 0x1c + SC_THREAD_DESTRUCTOR_ITERATIONS = 0x50 + SC_THREAD_KEYS_MAX = 0x51 + SC_THREAD_STACK_MIN = 0x59 + SC_THREAD_THREADS_MAX = 0x5a + SC_RE_DUP_MAX = 0x10 + SC_SEM_NSEMS_MAX = 0x1f + SC_SEM_VALUE_MAX = 0x20 + SC_SIGQUEUE_MAX = 0x46 + SC_STREAM_MAX = 0x1a + SC_SYMLOOP_MAX = 0x4c + SC_TIMER_MAX = 0x5d + SC_TTY_NAME_MAX = 0x6b + SC_TZNAME_MAX = 0x1b + + SC_ADVISORY_INFO = 0x29 + SC_ASYNCHRONOUS_IO = 0x2d + SC_BARRIERS = 0x2f + SC_CLOCK_SELECTION = 0x30 + SC_CPUTIME = 0x31 + SC_FSYNC = 0x1d + SC_IPV6 = 0x34 + SC_JOB_CONTROL = 0x6 + SC_MAPPED_FILES = 0x35 + SC_MEMLOCK = 0x36 + SC_MEMLOCK_RANGE = 0x37 + SC_MEMORY_PROTECTION = 0x38 + SC_MESSAGE_PASSING = 0x39 + SC_MONOTONIC_CLOCK = 0x22 + SC_PRIORITIZED_IO = 0x3c + SC_PRIORITY_SCHEDULING = 0x3d + SC_RAW_SOCKETS = 0x3e + SC_READER_WRITER_LOCKS = 0x3f + SC_REALTIME_SIGNALS = 0x40 + SC_REGEXP = 0x41 + SC_SAVED_IDS = 0x7 + SC_SEMAPHORES = 0x43 + SC_SHARED_MEMORY_OBJECTS = 0x44 + SC_SHELL = 0x45 + SC_SPAWN = 0x47 + SC_SPIN_LOCKS = 0x48 + SC_SPORADIC_SERVER = 0x49 + SC_SS_REPL_MAX = 0x4a + SC_SYNCHRONIZED_IO = 0x4b + SC_THREAD_ATTR_STACKADDR = 0x4d + SC_THREAD_ATTR_STACKSIZE = 0x4e + SC_THREAD_CPUTIME = 0x4f + SC_THREAD_PRIO_INHERIT = 0x52 + SC_THREAD_PRIO_PROTECT = 0x53 + SC_THREAD_PRIORITY_SCHEDULING = 0x54 + SC_THREAD_PROCESS_SHARED = 0x55 + SC_THREAD_ROBUST_PRIO_INHERIT = 0x56 + SC_THREAD_ROBUST_PRIO_PROTECT = 0x57 + SC_THREAD_SAFE_FUNCTIONS = 0x67 + SC_THREAD_SPORADIC_SERVER = 0x58 + SC_THREADS = 0x5b + SC_TIMEOUTS = 0x5c + SC_TIMERS = 0x5e + SC_TRACE = 0x5f + SC_TRACE_EVENT_FILTER = 0x60 + SC_TRACE_EVENT_NAME_MAX = 0x61 + SC_TRACE_INHERIT = 0x62 + SC_TRACE_LOG = 0x63 + SC_TRACE_NAME_MAX = 0x68 + SC_TRACE_SYS_MAX = 0x69 + SC_TRACE_USER_EVENT_MAX = 0x6a + SC_TYPED_MEMORY_OBJECTS = 0x6c + SC_VERSION = 0x8 + + SC_V7_ILP32_OFF32 = 0x71 + SC_V7_ILP32_OFFBIG = 0x72 + SC_V7_LP64_OFF64 = 0x73 + SC_V7_LPBIG_OFFBIG = 0x74 + + SC_V6_ILP32_OFF32 = 0x6d + SC_V6_ILP32_OFFBIG = 0x6e + SC_V6_LP64_OFF64 = 0x6f + SC_V6_LPBIG_OFFBIG = 0x70 + + SC_2_C_BIND = 0x12 + SC_2_C_DEV = 0x13 + SC_2_CHAR_TERM = 0x14 + SC_2_FORT_DEV = 0x15 + SC_2_FORT_RUN = 0x16 + SC_2_LOCALEDEF = 0x17 + SC_2_PBS = 0x23 + SC_2_PBS_ACCOUNTING = 0x24 + SC_2_PBS_CHECKPOINT = 0x25 + SC_2_PBS_LOCATE = 0x26 + SC_2_PBS_MESSAGE = 0x27 + SC_2_PBS_TRACK = 0x28 + SC_2_SW_DEV = 0x18 + SC_2_UPE = 0x19 + SC_2_VERSION = 0x11 + + SC_XOPEN_CRYPT = 0x75 + SC_XOPEN_ENH_I18N = 0x76 + SC_XOPEN_REALTIME = 0x78 + SC_XOPEN_REALTIME_THREADS = 0x79 + SC_XOPEN_SHM = 0x1e + SC_XOPEN_STREAMS = 0x7a + SC_XOPEN_UNIX = 0x7b + SC_XOPEN_UUCP = 0x7c + SC_XOPEN_VERSION = 0x7d + + SC_AVPHYS_PAGES = 0x1f5 + SC_PHYS_PAGES = 0x1f4 + SC_NPROCESSORS_CONF = 0x1f6 + SC_NPROCESSORS_ONLN = 0x1f7 +) + +const ( + _HOST_NAME_MAX = 0xff + _IOV_MAX = 0x400 + _LOGIN_NAME_MAX = 0x20 + _PTHREAD_DESTRUCTOR_ITERATIONS = 0x4 + _PTHREAD_KEYS_MAX = 0x100 + _PTHREAD_STACK_MIN = 0x1000 + _PTHREAD_THREADS_MAX = 0xffffffffffffffff + _SEM_VALUE_MAX = 0xffffffff + _SYMLOOP_MAX = 0x20 + _TTY_NAME_MAX = 0x104 + + _GR_BUF_LEN = 0xa40 + _PW_BUF_LEN = 0x400 + + _CLK_TCK = 0x64 + + _POSIX_ADVISORY_INFO = -0x1 + _POSIX_ARG_MAX = 0x1000 + _POSIX_ASYNCHRONOUS_IO = -0x1 + _POSIX_BARRIERS = 0x30db0 + _POSIX_CHILD_MAX = 0x19 + _POSIX_CLOCK_SELECTION = -0x1 + _POSIX_CPUTIME = 0x31069 + _POSIX_FSYNC = 0x30db0 + _POSIX_IPV6 = 0x0 + _POSIX_JOB_CONTROL = 0x1 + _POSIX_MAPPED_FILES = 0x30db0 + _POSIX_MEMLOCK = 0x30db0 + _POSIX_MEMLOCK_RANGE = 0x30db0 + _POSIX_MEMORY_PROTECTION = 0x30db0 + _POSIX_MESSAGE_PASSING = -0x1 + _POSIX_MONOTONIC_CLOCK = 0x30db0 + _POSIX_PRIORITIZED_IO = -0x1 + _POSIX_PRIORITY_SCHEDULING = -0x1 + _POSIX_RAW_SOCKETS = 0x30db0 + _POSIX_READER_WRITER_LOCKS = 0x30db0 + _POSIX_REALTIME_SIGNALS = -0x1 + _POSIX_REGEXP = 0x1 + _POSIX_SAVED_IDS = 0x1 + _POSIX_SEMAPHORES = 0x30db0 + _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 + _POSIX_SHELL = 0x1 + _POSIX_SPAWN = 0x30db0 + _POSIX_SPIN_LOCKS = 0x30db0 + _POSIX_SPORADIC_SERVER = -0x1 + _POSIX_SYNCHRONIZED_IO = -0x1 + _POSIX_THREAD_ATTR_STACKADDR = 0x30db0 + _POSIX_THREAD_ATTR_STACKSIZE = 0x30db0 + _POSIX_THREAD_CPUTIME = 0x31069 + _POSIX_THREAD_KEYS_MAX = 0x80 + _POSIX_THREAD_PRIO_INHERIT = -0x1 + _POSIX_THREAD_PRIO_PROTECT = -0x1 + _POSIX_THREAD_PRIORITY_SCHEDULING = -0x1 + _POSIX_THREAD_PROCESS_SHARED = -0x1 + _POSIX_THREAD_ROBUST_PRIO_INHERIT = -0x1 + _POSIX_THREAD_ROBUST_PRIO_PROTECT = -0x1 + _POSIX_THREAD_SAFE_FUNCTIONS = 0x30db0 + _POSIX_THREAD_SPORADIC_SERVER = -0x1 + _POSIX_THREADS = 0x30db0 + _POSIX_TIMERS = -0x1 + _POSIX_TIMEOUTS = 0x30db0 + _POSIX_TRACE = -0x1 + _POSIX_TYPED_MEMORY_OBJECTS = -0x1 + _POSIX_VERSION = 0x31069 + + _POSIX_V7_ILP32_OFF32 = -0x1 + _POSIX_V7_ILP32_OFFBIG = 0x0 + _POSIX_V7_LP64_OFF64 = 0x0 + _POSIX_V7_LPBIG_OFFBIG = 0x0 + + _POSIX_V6_ILP32_OFF32 = -0x1 + _POSIX_V6_ILP32_OFFBIG = 0x0 + _POSIX_V6_LP64_OFF64 = 0x0 + _POSIX_V6_LPBIG_OFFBIG = 0x0 + + _POSIX2_C_BIND = 0x30db0 + _POSIX2_C_DEV = -0x1 + _POSIX2_CHAR_TERM = 0x1 + _POSIX2_LOCALEDEF = -0x1 + _POSIX2_PBS = -0x1 + _POSIX2_SW_DEV = 0x30db0 + _POSIX2_UPE = 0x30db0 + _POSIX2_VERSION = 0x31069 + + _XOPEN_CRYPT = 0x1 + _XOPEN_ENH_I18N = -0x1 + _XOPEN_REALTIME = -0x1 + _XOPEN_REALTIME_THREADS = -0x1 + _XOPEN_SHM = 0x1 + _XOPEN_STREAMS = -0x1 + _XOPEN_UNIX = -0x1 + _XOPEN_UUCP = -0x1 + + _FOPEN_MAX = 0x14 + _NAME_MAX = 0xff + _RE_DUP_MAX = 0xff + + _BC_BASE_MAX = 0x7fffffff + _BC_DIM_MAX = 0xffff + _BC_SCALE_MAX = 0x7fffffff + _BC_STRING_MAX = 0x7fffffff + _COLL_WEIGHTS_MAX = 0x2 + _EXPR_NEST_MAX = 0x20 + _LINE_MAX = 0x800 + + _SHRT_MAX = 0x7fff + + _PATH_ZONEINFO = "/usr/share/zoneinfo" +) + +const ( + _CHAR_BIT = 0x8 + + _INT_MAX = 0x7fffffff + + sizeofOffT = 0x8 +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_solaris.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_solaris.go new file mode 100644 index 0000000000..e0a38d975f --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_solaris.go @@ -0,0 +1,136 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_defs_solaris.go + +package sysconf + +const ( + SC_AIO_LISTIO_MAX = 0x12 + SC_AIO_MAX = 0x13 + SC_AIO_PRIO_DELTA_MAX = 0x14 + SC_ARG_MAX = 0x1 + SC_ATEXIT_MAX = 0x4c + SC_BC_BASE_MAX = 0x36 + SC_BC_DIM_MAX = 0x37 + SC_BC_SCALE_MAX = 0x38 + SC_BC_STRING_MAX = 0x39 + SC_CHILD_MAX = 0x2 + SC_CLK_TCK = 0x3 + SC_COLL_WEIGHTS_MAX = 0x3a + SC_DELAYTIMER_MAX = 0x16 + SC_EXPR_NEST_MAX = 0x3b + SC_GETGR_R_SIZE_MAX = 0x239 + SC_GETPW_R_SIZE_MAX = 0x23a + SC_HOST_NAME_MAX = 0x2df + SC_IOV_MAX = 0x4d + SC_LINE_MAX = 0x3c + SC_LOGIN_NAME_MAX = 0x23b + SC_MQ_OPEN_MAX = 0x1d + SC_MQ_PRIO_MAX = 0x1e + SC_NGROUPS_MAX = 0x4 + SC_OPEN_MAX = 0x5 + SC_PAGE_SIZE = 0xb + SC_PAGESIZE = 0xb + SC_THREAD_DESTRUCTOR_ITERATIONS = 0x238 + SC_THREAD_KEYS_MAX = 0x23c + SC_THREAD_STACK_MIN = 0x23d + SC_THREAD_THREADS_MAX = 0x23e + SC_RE_DUP_MAX = 0x3d + SC_RTSIG_MAX = 0x22 + SC_SEM_NSEMS_MAX = 0x24 + SC_SEM_VALUE_MAX = 0x25 + SC_SIGQUEUE_MAX = 0x27 + SC_STREAM_MAX = 0x10 + SC_SYMLOOP_MAX = 0x2e8 + SC_TIMER_MAX = 0x2c + SC_TTY_NAME_MAX = 0x23f + SC_TZNAME_MAX = 0x11 + + SC_ADVISORY_INFO = 0x2db + SC_ASYNCHRONOUS_IO = 0x15 + SC_BARRIERS = 0x2dc + SC_CLOCK_SELECTION = 0x2dd + SC_CPUTIME = 0x2de + SC_FSYNC = 0x17 + SC_IPV6 = 0x2fa + SC_JOB_CONTROL = 0x6 + SC_MAPPED_FILES = 0x18 + SC_MEMLOCK = 0x19 + SC_MEMLOCK_RANGE = 0x1a + SC_MEMORY_PROTECTION = 0x1b + SC_MESSAGE_PASSING = 0x1c + SC_MONOTONIC_CLOCK = 0x2e0 + SC_PRIORITIZED_IO = 0x1f + SC_PRIORITY_SCHEDULING = 0x20 + SC_RAW_SOCKETS = 0x2fb + SC_READER_WRITER_LOCKS = 0x2e1 + SC_REALTIME_SIGNALS = 0x21 + SC_REGEXP = 0x2e2 + SC_SAVED_IDS = 0x7 + SC_SEMAPHORES = 0x23 + SC_SHARED_MEMORY_OBJECTS = 0x26 + SC_SHELL = 0x2e3 + SC_SPAWN = 0x2e4 + SC_SPIN_LOCKS = 0x2e5 + SC_SPORADIC_SERVER = 0x2e6 + SC_SS_REPL_MAX = 0x2e7 + SC_SYNCHRONIZED_IO = 0x2a + SC_THREAD_ATTR_STACKADDR = 0x241 + SC_THREAD_ATTR_STACKSIZE = 0x242 + SC_THREAD_CPUTIME = 0x2e9 + SC_THREAD_PRIO_INHERIT = 0x244 + SC_THREAD_PRIO_PROTECT = 0x245 + SC_THREAD_PRIORITY_SCHEDULING = 0x243 + SC_THREAD_PROCESS_SHARED = 0x246 + SC_THREAD_SAFE_FUNCTIONS = 0x247 + SC_THREAD_SPORADIC_SERVER = 0x2ea + SC_THREADS = 0x240 + SC_TIMEOUTS = 0x2eb + SC_TIMERS = 0x2b + SC_TRACE = 0x2ec + SC_TRACE_EVENT_FILTER = 0x2ed + SC_TRACE_EVENT_NAME_MAX = 0x2ee + SC_TRACE_INHERIT = 0x2ef + SC_TRACE_LOG = 0x2f0 + SC_TRACE_NAME_MAX = 0x2f1 + SC_TRACE_SYS_MAX = 0x2f2 + SC_TRACE_USER_EVENT_MAX = 0x2f3 + SC_TYPED_MEMORY_OBJECTS = 0x2f4 + SC_VERSION = 0x8 + + SC_V6_ILP32_OFF32 = 0x2f5 + SC_V6_ILP32_OFFBIG = 0x2f6 + SC_V6_LP64_OFF64 = 0x2f7 + SC_V6_LPBIG_OFFBIG = 0x2f8 + + SC_2_C_BIND = 0x2d + SC_2_C_DEV = 0x2e + SC_2_C_VERSION = 0x2f + SC_2_CHAR_TERM = 0x42 + SC_2_FORT_DEV = 0x30 + SC_2_FORT_RUN = 0x31 + SC_2_LOCALEDEF = 0x32 + SC_2_PBS = 0x2d4 + SC_2_PBS_ACCOUNTING = 0x2d5 + SC_2_PBS_CHECKPOINT = 0x2d6 + SC_2_PBS_LOCATE = 0x2d8 + SC_2_PBS_MESSAGE = 0x2d9 + SC_2_PBS_TRACK = 0x2da + SC_2_SW_DEV = 0x33 + SC_2_UPE = 0x34 + SC_2_VERSION = 0x35 + + SC_XOPEN_CRYPT = 0x3e + SC_XOPEN_ENH_I18N = 0x3f + SC_XOPEN_REALTIME = 0x2ce + SC_XOPEN_REALTIME_THREADS = 0x2cf + SC_XOPEN_SHM = 0x40 + SC_XOPEN_STREAMS = 0x2f9 + SC_XOPEN_UNIX = 0x4e + SC_XOPEN_VERSION = 0xc + SC_XOPEN_XCU_VERSION = 0x43 + + SC_PHYS_PAGES = 0x1f4 + SC_AVPHYS_PAGES = 0x1f5 + SC_NPROCESSORS_CONF = 0xe + SC_NPROCESSORS_ONLN = 0xf +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_386.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_386.go new file mode 100644 index 0000000000..e0ad197059 --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_386.go @@ -0,0 +1,9 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_values_freebsd.go + +package sysconf + +const ( + _LONG_MAX = 0x7fffffff + _SHRT_MAX = 0x7fff +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_amd64.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_amd64.go new file mode 100644 index 0000000000..771e5a0a74 --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_amd64.go @@ -0,0 +1,9 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_values_freebsd.go + +package sysconf + +const ( + _LONG_MAX = 0x7fffffffffffffff + _SHRT_MAX = 0x7fff +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm.go new file mode 100644 index 0000000000..e0ad197059 --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm.go @@ -0,0 +1,9 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_values_freebsd.go + +package sysconf + +const ( + _LONG_MAX = 0x7fffffff + _SHRT_MAX = 0x7fff +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm64.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm64.go new file mode 100644 index 0000000000..771e5a0a74 --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm64.go @@ -0,0 +1,9 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_values_freebsd.go + +package sysconf + +const ( + _LONG_MAX = 0x7fffffffffffffff + _SHRT_MAX = 0x7fff +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_386.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_386.go new file mode 100644 index 0000000000..730ec5d335 --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_386.go @@ -0,0 +1,111 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_values_linux.go + +package sysconf + +const ( + _AIO_PRIO_DELTA_MAX = 0x14 + _BC_BASE_MAX = 0x63 + _BC_DIM_MAX = 0x800 + _BC_SCALE_MAX = 0x63 + _BC_STRING_MAX = 0x3e8 + _COLL_WEIGHTS_MAX = 0xff + _DELAYTIMER_MAX = 0x7fffffff + _EXPR_NEST_MAX = 0x20 + _HOST_NAME_MAX = 0x40 + _LINE_MAX = 0x800 + _LOGIN_NAME_MAX = 0x100 + _MQ_PRIO_MAX = 0x8000 + _NGROUPS_MAX = 0x10000 + _NSS_BUFLEN_GROUP = 0x400 + _NSS_BUFLEN_PASSWD = 0x400 + _OPEN_MAX = 0x100 + _PTHREAD_KEYS_MAX = 0x400 + _PTHREAD_STACK_MIN = 0x4000 + _RE_DUP_MAX = 0x7fff + _RTSIG_MAX = 0x20 + _SEM_VALUE_MAX = 0x7fffffff + _STREAM_MAX = 0x10 + _SYMLOOP_MAX = -0x1 + _TTY_NAME_MAX = 0x20 + + _UIO_MAXIOV = 0x400 + + _INT_MAX = 0x7fffffff + + _POSIX_ADVISORY_INFO = 0x31069 + _POSIX_ARG_MAX = 0x1000 + _POSIX_ASYNCHRONOUS_IO = 0x31069 + _POSIX_BARRIERS = 0x31069 + _POSIX_CHILD_MAX = 0x19 + _POSIX_CLOCK_SELECTION = 0x31069 + _POSIX_CPUTIME = 0x0 + _POSIX_FSYNC = 0x31069 + _POSIX_IPV6 = 0x31069 + _POSIX_JOB_CONTROL = 0x1 + _POSIX_MAPPED_FILES = 0x31069 + _POSIX_MEMLOCK = 0x31069 + _POSIX_MEMLOCK_RANGE = 0x31069 + _POSIX_MEMORY_PROTECTION = 0x31069 + _POSIX_MESSAGE_PASSING = 0x31069 + _POSIX_MONOTONIC_CLOCK = 0x0 + _POSIX_PRIORITIZED_IO = 0x31069 + _POSIX_PRIORITY_SCHEDULING = 0x31069 + _POSIX_RAW_SOCKETS = 0x31069 + _POSIX_READER_WRITER_LOCKS = 0x31069 + _POSIX_REALTIME_SIGNALS = 0x31069 + _POSIX_REGEXP = 0x1 + _POSIX_SAVED_IDS = 0x1 + _POSIX_SEMAPHORES = 0x31069 + _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 + _POSIX_SHELL = 0x1 + _POSIX_SIGQUEUE_MAX = 0x20 + _POSIX_SPAWN = 0x31069 + _POSIX_SPIN_LOCKS = 0x31069 + _POSIX_SPORADIC_SERVER = -0x1 + _POSIX_SYNCHRONIZED_IO = 0x31069 + _POSIX_THREAD_ATTR_STACKADDR = 0x31069 + _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 + _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 + _POSIX_THREAD_PRIO_INHERIT = 0x31069 + _POSIX_THREAD_PRIO_PROTECT = 0x31069 + _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 + _POSIX_THREAD_PROCESS_SHARED = 0x31069 + _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 + _POSIX_THREAD_SPORADIC_SERVER = -0x1 + _POSIX_THREADS = 0x31069 + _POSIX_TIMEOUTS = 0x31069 + _POSIX_TIMERS = 0x31069 + _POSIX_TRACE = -0x1 + _POSIX_TRACE_EVENT_FILTER = -0x1 + _POSIX_TRACE_INHERIT = -0x1 + _POSIX_TRACE_LOG = -0x1 + _POSIX_TYPED_MEMORY_OBJECTS = -0x1 + _POSIX_VERSION = 0x31069 + + _POSIX_V7_ILP32_OFF32 = 0x1 + _POSIX_V7_ILP32_OFFBIG = 0x1 + _POSIX_V7_LP64_OFF64 = -0x1 + _POSIX_V7_LPBIG_OFFBIG = -0x1 + + _POSIX_V6_ILP32_OFF32 = 0x1 + _POSIX_V6_ILP32_OFFBIG = 0x1 + _POSIX_V6_LP64_OFF64 = -0x1 + _POSIX_V6_LPBIG_OFFBIG = -0x1 + + _POSIX2_C_BIND = 0x31069 + _POSIX2_C_DEV = 0x31069 + _POSIX2_C_VERSION = 0x31069 + _POSIX2_CHAR_TERM = 0x31069 + _POSIX2_LOCALEDEF = 0x31069 + _POSIX2_SW_DEV = 0x31069 + _POSIX2_VERSION = 0x31069 + + _XOPEN_ENH_I18N = 0x1 + _XOPEN_REALTIME = 0x1 + _XOPEN_REALTIME_THREADS = 0x1 + _XOPEN_SHM = 0x1 + _XOPEN_UNIX = 0x1 + _XOPEN_VERSION = 0x2bc + _XOPEN_XCU_VERSION = 0x4 +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_amd64.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_amd64.go new file mode 100644 index 0000000000..8d9c273d0b --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_amd64.go @@ -0,0 +1,111 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_values_linux.go + +package sysconf + +const ( + _AIO_PRIO_DELTA_MAX = 0x14 + _BC_BASE_MAX = 0x63 + _BC_DIM_MAX = 0x800 + _BC_SCALE_MAX = 0x63 + _BC_STRING_MAX = 0x3e8 + _COLL_WEIGHTS_MAX = 0xff + _DELAYTIMER_MAX = 0x7fffffff + _EXPR_NEST_MAX = 0x20 + _HOST_NAME_MAX = 0x40 + _LINE_MAX = 0x800 + _LOGIN_NAME_MAX = 0x100 + _MQ_PRIO_MAX = 0x8000 + _NGROUPS_MAX = 0x10000 + _NSS_BUFLEN_GROUP = 0x400 + _NSS_BUFLEN_PASSWD = 0x400 + _OPEN_MAX = 0x100 + _PTHREAD_KEYS_MAX = 0x400 + _PTHREAD_STACK_MIN = 0x4000 + _RE_DUP_MAX = 0x7fff + _RTSIG_MAX = 0x20 + _SEM_VALUE_MAX = 0x7fffffff + _STREAM_MAX = 0x10 + _SYMLOOP_MAX = -0x1 + _TTY_NAME_MAX = 0x20 + + _UIO_MAXIOV = 0x400 + + _INT_MAX = 0x7fffffff + + _POSIX_ADVISORY_INFO = 0x31069 + _POSIX_ARG_MAX = 0x1000 + _POSIX_ASYNCHRONOUS_IO = 0x31069 + _POSIX_BARRIERS = 0x31069 + _POSIX_CHILD_MAX = 0x19 + _POSIX_CLOCK_SELECTION = 0x31069 + _POSIX_CPUTIME = 0x0 + _POSIX_FSYNC = 0x31069 + _POSIX_IPV6 = 0x31069 + _POSIX_JOB_CONTROL = 0x1 + _POSIX_MAPPED_FILES = 0x31069 + _POSIX_MEMLOCK = 0x31069 + _POSIX_MEMLOCK_RANGE = 0x31069 + _POSIX_MEMORY_PROTECTION = 0x31069 + _POSIX_MESSAGE_PASSING = 0x31069 + _POSIX_MONOTONIC_CLOCK = 0x0 + _POSIX_PRIORITIZED_IO = 0x31069 + _POSIX_PRIORITY_SCHEDULING = 0x31069 + _POSIX_RAW_SOCKETS = 0x31069 + _POSIX_READER_WRITER_LOCKS = 0x31069 + _POSIX_REALTIME_SIGNALS = 0x31069 + _POSIX_REGEXP = 0x1 + _POSIX_SAVED_IDS = 0x1 + _POSIX_SEMAPHORES = 0x31069 + _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 + _POSIX_SHELL = 0x1 + _POSIX_SIGQUEUE_MAX = 0x20 + _POSIX_SPAWN = 0x31069 + _POSIX_SPIN_LOCKS = 0x31069 + _POSIX_SPORADIC_SERVER = -0x1 + _POSIX_SYNCHRONIZED_IO = 0x31069 + _POSIX_THREAD_ATTR_STACKADDR = 0x31069 + _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 + _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 + _POSIX_THREAD_PRIO_INHERIT = 0x31069 + _POSIX_THREAD_PRIO_PROTECT = 0x31069 + _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 + _POSIX_THREAD_PROCESS_SHARED = 0x31069 + _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 + _POSIX_THREAD_SPORADIC_SERVER = -0x1 + _POSIX_THREADS = 0x31069 + _POSIX_TIMEOUTS = 0x31069 + _POSIX_TIMERS = 0x31069 + _POSIX_TRACE = -0x1 + _POSIX_TRACE_EVENT_FILTER = -0x1 + _POSIX_TRACE_INHERIT = -0x1 + _POSIX_TRACE_LOG = -0x1 + _POSIX_TYPED_MEMORY_OBJECTS = -0x1 + _POSIX_VERSION = 0x31069 + + _POSIX_V7_ILP32_OFF32 = -0x1 + _POSIX_V7_ILP32_OFFBIG = -0x1 + _POSIX_V7_LP64_OFF64 = 0x1 + _POSIX_V7_LPBIG_OFFBIG = -0x1 + + _POSIX_V6_ILP32_OFF32 = -0x1 + _POSIX_V6_ILP32_OFFBIG = -0x1 + _POSIX_V6_LP64_OFF64 = 0x1 + _POSIX_V6_LPBIG_OFFBIG = -0x1 + + _POSIX2_C_BIND = 0x31069 + _POSIX2_C_DEV = 0x31069 + _POSIX2_C_VERSION = 0x31069 + _POSIX2_CHAR_TERM = 0x31069 + _POSIX2_LOCALEDEF = 0x31069 + _POSIX2_SW_DEV = 0x31069 + _POSIX2_VERSION = 0x31069 + + _XOPEN_ENH_I18N = 0x1 + _XOPEN_REALTIME = 0x1 + _XOPEN_REALTIME_THREADS = 0x1 + _XOPEN_SHM = 0x1 + _XOPEN_UNIX = 0x1 + _XOPEN_VERSION = 0x2bc + _XOPEN_XCU_VERSION = 0x4 +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_arm.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_arm.go new file mode 100644 index 0000000000..730ec5d335 --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_arm.go @@ -0,0 +1,111 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_values_linux.go + +package sysconf + +const ( + _AIO_PRIO_DELTA_MAX = 0x14 + _BC_BASE_MAX = 0x63 + _BC_DIM_MAX = 0x800 + _BC_SCALE_MAX = 0x63 + _BC_STRING_MAX = 0x3e8 + _COLL_WEIGHTS_MAX = 0xff + _DELAYTIMER_MAX = 0x7fffffff + _EXPR_NEST_MAX = 0x20 + _HOST_NAME_MAX = 0x40 + _LINE_MAX = 0x800 + _LOGIN_NAME_MAX = 0x100 + _MQ_PRIO_MAX = 0x8000 + _NGROUPS_MAX = 0x10000 + _NSS_BUFLEN_GROUP = 0x400 + _NSS_BUFLEN_PASSWD = 0x400 + _OPEN_MAX = 0x100 + _PTHREAD_KEYS_MAX = 0x400 + _PTHREAD_STACK_MIN = 0x4000 + _RE_DUP_MAX = 0x7fff + _RTSIG_MAX = 0x20 + _SEM_VALUE_MAX = 0x7fffffff + _STREAM_MAX = 0x10 + _SYMLOOP_MAX = -0x1 + _TTY_NAME_MAX = 0x20 + + _UIO_MAXIOV = 0x400 + + _INT_MAX = 0x7fffffff + + _POSIX_ADVISORY_INFO = 0x31069 + _POSIX_ARG_MAX = 0x1000 + _POSIX_ASYNCHRONOUS_IO = 0x31069 + _POSIX_BARRIERS = 0x31069 + _POSIX_CHILD_MAX = 0x19 + _POSIX_CLOCK_SELECTION = 0x31069 + _POSIX_CPUTIME = 0x0 + _POSIX_FSYNC = 0x31069 + _POSIX_IPV6 = 0x31069 + _POSIX_JOB_CONTROL = 0x1 + _POSIX_MAPPED_FILES = 0x31069 + _POSIX_MEMLOCK = 0x31069 + _POSIX_MEMLOCK_RANGE = 0x31069 + _POSIX_MEMORY_PROTECTION = 0x31069 + _POSIX_MESSAGE_PASSING = 0x31069 + _POSIX_MONOTONIC_CLOCK = 0x0 + _POSIX_PRIORITIZED_IO = 0x31069 + _POSIX_PRIORITY_SCHEDULING = 0x31069 + _POSIX_RAW_SOCKETS = 0x31069 + _POSIX_READER_WRITER_LOCKS = 0x31069 + _POSIX_REALTIME_SIGNALS = 0x31069 + _POSIX_REGEXP = 0x1 + _POSIX_SAVED_IDS = 0x1 + _POSIX_SEMAPHORES = 0x31069 + _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 + _POSIX_SHELL = 0x1 + _POSIX_SIGQUEUE_MAX = 0x20 + _POSIX_SPAWN = 0x31069 + _POSIX_SPIN_LOCKS = 0x31069 + _POSIX_SPORADIC_SERVER = -0x1 + _POSIX_SYNCHRONIZED_IO = 0x31069 + _POSIX_THREAD_ATTR_STACKADDR = 0x31069 + _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 + _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 + _POSIX_THREAD_PRIO_INHERIT = 0x31069 + _POSIX_THREAD_PRIO_PROTECT = 0x31069 + _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 + _POSIX_THREAD_PROCESS_SHARED = 0x31069 + _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 + _POSIX_THREAD_SPORADIC_SERVER = -0x1 + _POSIX_THREADS = 0x31069 + _POSIX_TIMEOUTS = 0x31069 + _POSIX_TIMERS = 0x31069 + _POSIX_TRACE = -0x1 + _POSIX_TRACE_EVENT_FILTER = -0x1 + _POSIX_TRACE_INHERIT = -0x1 + _POSIX_TRACE_LOG = -0x1 + _POSIX_TYPED_MEMORY_OBJECTS = -0x1 + _POSIX_VERSION = 0x31069 + + _POSIX_V7_ILP32_OFF32 = 0x1 + _POSIX_V7_ILP32_OFFBIG = 0x1 + _POSIX_V7_LP64_OFF64 = -0x1 + _POSIX_V7_LPBIG_OFFBIG = -0x1 + + _POSIX_V6_ILP32_OFF32 = 0x1 + _POSIX_V6_ILP32_OFFBIG = 0x1 + _POSIX_V6_LP64_OFF64 = -0x1 + _POSIX_V6_LPBIG_OFFBIG = -0x1 + + _POSIX2_C_BIND = 0x31069 + _POSIX2_C_DEV = 0x31069 + _POSIX2_C_VERSION = 0x31069 + _POSIX2_CHAR_TERM = 0x31069 + _POSIX2_LOCALEDEF = 0x31069 + _POSIX2_SW_DEV = 0x31069 + _POSIX2_VERSION = 0x31069 + + _XOPEN_ENH_I18N = 0x1 + _XOPEN_REALTIME = 0x1 + _XOPEN_REALTIME_THREADS = 0x1 + _XOPEN_SHM = 0x1 + _XOPEN_UNIX = 0x1 + _XOPEN_VERSION = 0x2bc + _XOPEN_XCU_VERSION = 0x4 +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_arm64.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_arm64.go new file mode 100644 index 0000000000..7a6d9912cd --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_arm64.go @@ -0,0 +1,111 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_values_linux.go + +package sysconf + +const ( + _AIO_PRIO_DELTA_MAX = 0x14 + _BC_BASE_MAX = 0x63 + _BC_DIM_MAX = 0x800 + _BC_SCALE_MAX = 0x63 + _BC_STRING_MAX = 0x3e8 + _COLL_WEIGHTS_MAX = 0xff + _DELAYTIMER_MAX = 0x7fffffff + _EXPR_NEST_MAX = 0x20 + _HOST_NAME_MAX = 0x40 + _LINE_MAX = 0x800 + _LOGIN_NAME_MAX = 0x100 + _MQ_PRIO_MAX = 0x8000 + _NGROUPS_MAX = 0x10000 + _NSS_BUFLEN_GROUP = 0x400 + _NSS_BUFLEN_PASSWD = 0x400 + _OPEN_MAX = 0x100 + _PTHREAD_KEYS_MAX = 0x400 + _PTHREAD_STACK_MIN = 0x20000 + _RE_DUP_MAX = 0x7fff + _RTSIG_MAX = 0x20 + _SEM_VALUE_MAX = 0x7fffffff + _STREAM_MAX = 0x10 + _SYMLOOP_MAX = -0x1 + _TTY_NAME_MAX = 0x20 + + _UIO_MAXIOV = 0x400 + + _INT_MAX = 0x7fffffff + + _POSIX_ADVISORY_INFO = 0x31069 + _POSIX_ARG_MAX = 0x1000 + _POSIX_ASYNCHRONOUS_IO = 0x31069 + _POSIX_BARRIERS = 0x31069 + _POSIX_CHILD_MAX = 0x19 + _POSIX_CLOCK_SELECTION = 0x31069 + _POSIX_CPUTIME = 0x0 + _POSIX_FSYNC = 0x31069 + _POSIX_IPV6 = 0x31069 + _POSIX_JOB_CONTROL = 0x1 + _POSIX_MAPPED_FILES = 0x31069 + _POSIX_MEMLOCK = 0x31069 + _POSIX_MEMLOCK_RANGE = 0x31069 + _POSIX_MEMORY_PROTECTION = 0x31069 + _POSIX_MESSAGE_PASSING = 0x31069 + _POSIX_MONOTONIC_CLOCK = 0x0 + _POSIX_PRIORITIZED_IO = 0x31069 + _POSIX_PRIORITY_SCHEDULING = 0x31069 + _POSIX_RAW_SOCKETS = 0x31069 + _POSIX_READER_WRITER_LOCKS = 0x31069 + _POSIX_REALTIME_SIGNALS = 0x31069 + _POSIX_REGEXP = 0x1 + _POSIX_SAVED_IDS = 0x1 + _POSIX_SEMAPHORES = 0x31069 + _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 + _POSIX_SHELL = 0x1 + _POSIX_SIGQUEUE_MAX = 0x20 + _POSIX_SPAWN = 0x31069 + _POSIX_SPIN_LOCKS = 0x31069 + _POSIX_SPORADIC_SERVER = -0x1 + _POSIX_SYNCHRONIZED_IO = 0x31069 + _POSIX_THREAD_ATTR_STACKADDR = 0x31069 + _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 + _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 + _POSIX_THREAD_PRIO_INHERIT = 0x31069 + _POSIX_THREAD_PRIO_PROTECT = 0x31069 + _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 + _POSIX_THREAD_PROCESS_SHARED = 0x31069 + _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 + _POSIX_THREAD_SPORADIC_SERVER = -0x1 + _POSIX_THREADS = 0x31069 + _POSIX_TIMEOUTS = 0x31069 + _POSIX_TIMERS = 0x31069 + _POSIX_TRACE = -0x1 + _POSIX_TRACE_EVENT_FILTER = -0x1 + _POSIX_TRACE_INHERIT = -0x1 + _POSIX_TRACE_LOG = -0x1 + _POSIX_TYPED_MEMORY_OBJECTS = -0x1 + _POSIX_VERSION = 0x31069 + + _POSIX_V7_ILP32_OFF32 = -0x1 + _POSIX_V7_ILP32_OFFBIG = -0x1 + _POSIX_V7_LP64_OFF64 = 0x1 + _POSIX_V7_LPBIG_OFFBIG = -0x1 + + _POSIX_V6_ILP32_OFF32 = -0x1 + _POSIX_V6_ILP32_OFFBIG = -0x1 + _POSIX_V6_LP64_OFF64 = 0x1 + _POSIX_V6_LPBIG_OFFBIG = -0x1 + + _POSIX2_C_BIND = 0x31069 + _POSIX2_C_DEV = 0x31069 + _POSIX2_C_VERSION = 0x31069 + _POSIX2_CHAR_TERM = 0x31069 + _POSIX2_LOCALEDEF = 0x31069 + _POSIX2_SW_DEV = 0x31069 + _POSIX2_VERSION = 0x31069 + + _XOPEN_ENH_I18N = 0x1 + _XOPEN_REALTIME = 0x1 + _XOPEN_REALTIME_THREADS = 0x1 + _XOPEN_SHM = 0x1 + _XOPEN_UNIX = 0x1 + _XOPEN_VERSION = 0x2bc + _XOPEN_XCU_VERSION = 0x4 +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips.go new file mode 100644 index 0000000000..a75d5f264f --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips.go @@ -0,0 +1,111 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_values_linux.go + +package sysconf + +const ( + _AIO_PRIO_DELTA_MAX = 0x14 + _BC_BASE_MAX = 0x63 + _BC_DIM_MAX = 0x800 + _BC_SCALE_MAX = 0x63 + _BC_STRING_MAX = 0x3e8 + _COLL_WEIGHTS_MAX = 0xff + _DELAYTIMER_MAX = 0x7fffffff + _EXPR_NEST_MAX = 0x20 + _HOST_NAME_MAX = 0x40 + _LINE_MAX = 0x800 + _LOGIN_NAME_MAX = 0x100 + _MQ_PRIO_MAX = 0x8000 + _NGROUPS_MAX = 0x10000 + _NSS_BUFLEN_GROUP = 0x400 + _NSS_BUFLEN_PASSWD = 0x400 + _OPEN_MAX = 0x100 + _PTHREAD_KEYS_MAX = 0x400 + _PTHREAD_STACK_MIN = 0x20000 + _RE_DUP_MAX = 0x7fff + _RTSIG_MAX = 0x20 + _SEM_VALUE_MAX = 0x7fffffff + _STREAM_MAX = 0x10 + _SYMLOOP_MAX = -0x1 + _TTY_NAME_MAX = 0x20 + + _UIO_MAXIOV = 0x400 + + _INT_MAX = 0x7fffffff + + _POSIX_ADVISORY_INFO = 0x31069 + _POSIX_ARG_MAX = 0x1000 + _POSIX_ASYNCHRONOUS_IO = 0x31069 + _POSIX_BARRIERS = 0x31069 + _POSIX_CHILD_MAX = 0x19 + _POSIX_CLOCK_SELECTION = 0x31069 + _POSIX_CPUTIME = 0x0 + _POSIX_FSYNC = 0x31069 + _POSIX_IPV6 = 0x31069 + _POSIX_JOB_CONTROL = 0x1 + _POSIX_MAPPED_FILES = 0x31069 + _POSIX_MEMLOCK = 0x31069 + _POSIX_MEMLOCK_RANGE = 0x31069 + _POSIX_MEMORY_PROTECTION = 0x31069 + _POSIX_MESSAGE_PASSING = 0x31069 + _POSIX_MONOTONIC_CLOCK = 0x0 + _POSIX_PRIORITIZED_IO = 0x31069 + _POSIX_PRIORITY_SCHEDULING = 0x31069 + _POSIX_RAW_SOCKETS = 0x31069 + _POSIX_READER_WRITER_LOCKS = 0x31069 + _POSIX_REALTIME_SIGNALS = 0x31069 + _POSIX_REGEXP = 0x1 + _POSIX_SAVED_IDS = 0x1 + _POSIX_SEMAPHORES = 0x31069 + _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 + _POSIX_SHELL = 0x1 + _POSIX_SIGQUEUE_MAX = 0x20 + _POSIX_SPAWN = 0x31069 + _POSIX_SPIN_LOCKS = 0x31069 + _POSIX_SPORADIC_SERVER = -0x1 + _POSIX_SYNCHRONIZED_IO = 0x31069 + _POSIX_THREAD_ATTR_STACKADDR = 0x31069 + _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 + _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 + _POSIX_THREAD_PRIO_INHERIT = 0x31069 + _POSIX_THREAD_PRIO_PROTECT = 0x31069 + _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 + _POSIX_THREAD_PROCESS_SHARED = 0x31069 + _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 + _POSIX_THREAD_SPORADIC_SERVER = -0x1 + _POSIX_THREADS = 0x31069 + _POSIX_TIMEOUTS = 0x31069 + _POSIX_TIMERS = 0x31069 + _POSIX_TRACE = -0x1 + _POSIX_TRACE_EVENT_FILTER = -0x1 + _POSIX_TRACE_INHERIT = -0x1 + _POSIX_TRACE_LOG = -0x1 + _POSIX_TYPED_MEMORY_OBJECTS = -0x1 + _POSIX_VERSION = 0x31069 + + _POSIX_V7_ILP32_OFF32 = 0x1 + _POSIX_V7_ILP32_OFFBIG = 0x1 + _POSIX_V7_LP64_OFF64 = -0x1 + _POSIX_V7_LPBIG_OFFBIG = -0x1 + + _POSIX_V6_ILP32_OFF32 = 0x1 + _POSIX_V6_ILP32_OFFBIG = 0x1 + _POSIX_V6_LP64_OFF64 = -0x1 + _POSIX_V6_LPBIG_OFFBIG = -0x1 + + _POSIX2_C_BIND = 0x31069 + _POSIX2_C_DEV = 0x31069 + _POSIX2_C_VERSION = 0x31069 + _POSIX2_CHAR_TERM = 0x31069 + _POSIX2_LOCALEDEF = 0x31069 + _POSIX2_SW_DEV = 0x31069 + _POSIX2_VERSION = 0x31069 + + _XOPEN_ENH_I18N = 0x1 + _XOPEN_REALTIME = 0x1 + _XOPEN_REALTIME_THREADS = 0x1 + _XOPEN_SHM = 0x1 + _XOPEN_UNIX = 0x1 + _XOPEN_VERSION = 0x2bc + _XOPEN_XCU_VERSION = 0x4 +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips64.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips64.go new file mode 100644 index 0000000000..7a6d9912cd --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips64.go @@ -0,0 +1,111 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_values_linux.go + +package sysconf + +const ( + _AIO_PRIO_DELTA_MAX = 0x14 + _BC_BASE_MAX = 0x63 + _BC_DIM_MAX = 0x800 + _BC_SCALE_MAX = 0x63 + _BC_STRING_MAX = 0x3e8 + _COLL_WEIGHTS_MAX = 0xff + _DELAYTIMER_MAX = 0x7fffffff + _EXPR_NEST_MAX = 0x20 + _HOST_NAME_MAX = 0x40 + _LINE_MAX = 0x800 + _LOGIN_NAME_MAX = 0x100 + _MQ_PRIO_MAX = 0x8000 + _NGROUPS_MAX = 0x10000 + _NSS_BUFLEN_GROUP = 0x400 + _NSS_BUFLEN_PASSWD = 0x400 + _OPEN_MAX = 0x100 + _PTHREAD_KEYS_MAX = 0x400 + _PTHREAD_STACK_MIN = 0x20000 + _RE_DUP_MAX = 0x7fff + _RTSIG_MAX = 0x20 + _SEM_VALUE_MAX = 0x7fffffff + _STREAM_MAX = 0x10 + _SYMLOOP_MAX = -0x1 + _TTY_NAME_MAX = 0x20 + + _UIO_MAXIOV = 0x400 + + _INT_MAX = 0x7fffffff + + _POSIX_ADVISORY_INFO = 0x31069 + _POSIX_ARG_MAX = 0x1000 + _POSIX_ASYNCHRONOUS_IO = 0x31069 + _POSIX_BARRIERS = 0x31069 + _POSIX_CHILD_MAX = 0x19 + _POSIX_CLOCK_SELECTION = 0x31069 + _POSIX_CPUTIME = 0x0 + _POSIX_FSYNC = 0x31069 + _POSIX_IPV6 = 0x31069 + _POSIX_JOB_CONTROL = 0x1 + _POSIX_MAPPED_FILES = 0x31069 + _POSIX_MEMLOCK = 0x31069 + _POSIX_MEMLOCK_RANGE = 0x31069 + _POSIX_MEMORY_PROTECTION = 0x31069 + _POSIX_MESSAGE_PASSING = 0x31069 + _POSIX_MONOTONIC_CLOCK = 0x0 + _POSIX_PRIORITIZED_IO = 0x31069 + _POSIX_PRIORITY_SCHEDULING = 0x31069 + _POSIX_RAW_SOCKETS = 0x31069 + _POSIX_READER_WRITER_LOCKS = 0x31069 + _POSIX_REALTIME_SIGNALS = 0x31069 + _POSIX_REGEXP = 0x1 + _POSIX_SAVED_IDS = 0x1 + _POSIX_SEMAPHORES = 0x31069 + _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 + _POSIX_SHELL = 0x1 + _POSIX_SIGQUEUE_MAX = 0x20 + _POSIX_SPAWN = 0x31069 + _POSIX_SPIN_LOCKS = 0x31069 + _POSIX_SPORADIC_SERVER = -0x1 + _POSIX_SYNCHRONIZED_IO = 0x31069 + _POSIX_THREAD_ATTR_STACKADDR = 0x31069 + _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 + _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 + _POSIX_THREAD_PRIO_INHERIT = 0x31069 + _POSIX_THREAD_PRIO_PROTECT = 0x31069 + _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 + _POSIX_THREAD_PROCESS_SHARED = 0x31069 + _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 + _POSIX_THREAD_SPORADIC_SERVER = -0x1 + _POSIX_THREADS = 0x31069 + _POSIX_TIMEOUTS = 0x31069 + _POSIX_TIMERS = 0x31069 + _POSIX_TRACE = -0x1 + _POSIX_TRACE_EVENT_FILTER = -0x1 + _POSIX_TRACE_INHERIT = -0x1 + _POSIX_TRACE_LOG = -0x1 + _POSIX_TYPED_MEMORY_OBJECTS = -0x1 + _POSIX_VERSION = 0x31069 + + _POSIX_V7_ILP32_OFF32 = -0x1 + _POSIX_V7_ILP32_OFFBIG = -0x1 + _POSIX_V7_LP64_OFF64 = 0x1 + _POSIX_V7_LPBIG_OFFBIG = -0x1 + + _POSIX_V6_ILP32_OFF32 = -0x1 + _POSIX_V6_ILP32_OFFBIG = -0x1 + _POSIX_V6_LP64_OFF64 = 0x1 + _POSIX_V6_LPBIG_OFFBIG = -0x1 + + _POSIX2_C_BIND = 0x31069 + _POSIX2_C_DEV = 0x31069 + _POSIX2_C_VERSION = 0x31069 + _POSIX2_CHAR_TERM = 0x31069 + _POSIX2_LOCALEDEF = 0x31069 + _POSIX2_SW_DEV = 0x31069 + _POSIX2_VERSION = 0x31069 + + _XOPEN_ENH_I18N = 0x1 + _XOPEN_REALTIME = 0x1 + _XOPEN_REALTIME_THREADS = 0x1 + _XOPEN_SHM = 0x1 + _XOPEN_UNIX = 0x1 + _XOPEN_VERSION = 0x2bc + _XOPEN_XCU_VERSION = 0x4 +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips64le.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips64le.go new file mode 100644 index 0000000000..7a6d9912cd --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips64le.go @@ -0,0 +1,111 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_values_linux.go + +package sysconf + +const ( + _AIO_PRIO_DELTA_MAX = 0x14 + _BC_BASE_MAX = 0x63 + _BC_DIM_MAX = 0x800 + _BC_SCALE_MAX = 0x63 + _BC_STRING_MAX = 0x3e8 + _COLL_WEIGHTS_MAX = 0xff + _DELAYTIMER_MAX = 0x7fffffff + _EXPR_NEST_MAX = 0x20 + _HOST_NAME_MAX = 0x40 + _LINE_MAX = 0x800 + _LOGIN_NAME_MAX = 0x100 + _MQ_PRIO_MAX = 0x8000 + _NGROUPS_MAX = 0x10000 + _NSS_BUFLEN_GROUP = 0x400 + _NSS_BUFLEN_PASSWD = 0x400 + _OPEN_MAX = 0x100 + _PTHREAD_KEYS_MAX = 0x400 + _PTHREAD_STACK_MIN = 0x20000 + _RE_DUP_MAX = 0x7fff + _RTSIG_MAX = 0x20 + _SEM_VALUE_MAX = 0x7fffffff + _STREAM_MAX = 0x10 + _SYMLOOP_MAX = -0x1 + _TTY_NAME_MAX = 0x20 + + _UIO_MAXIOV = 0x400 + + _INT_MAX = 0x7fffffff + + _POSIX_ADVISORY_INFO = 0x31069 + _POSIX_ARG_MAX = 0x1000 + _POSIX_ASYNCHRONOUS_IO = 0x31069 + _POSIX_BARRIERS = 0x31069 + _POSIX_CHILD_MAX = 0x19 + _POSIX_CLOCK_SELECTION = 0x31069 + _POSIX_CPUTIME = 0x0 + _POSIX_FSYNC = 0x31069 + _POSIX_IPV6 = 0x31069 + _POSIX_JOB_CONTROL = 0x1 + _POSIX_MAPPED_FILES = 0x31069 + _POSIX_MEMLOCK = 0x31069 + _POSIX_MEMLOCK_RANGE = 0x31069 + _POSIX_MEMORY_PROTECTION = 0x31069 + _POSIX_MESSAGE_PASSING = 0x31069 + _POSIX_MONOTONIC_CLOCK = 0x0 + _POSIX_PRIORITIZED_IO = 0x31069 + _POSIX_PRIORITY_SCHEDULING = 0x31069 + _POSIX_RAW_SOCKETS = 0x31069 + _POSIX_READER_WRITER_LOCKS = 0x31069 + _POSIX_REALTIME_SIGNALS = 0x31069 + _POSIX_REGEXP = 0x1 + _POSIX_SAVED_IDS = 0x1 + _POSIX_SEMAPHORES = 0x31069 + _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 + _POSIX_SHELL = 0x1 + _POSIX_SIGQUEUE_MAX = 0x20 + _POSIX_SPAWN = 0x31069 + _POSIX_SPIN_LOCKS = 0x31069 + _POSIX_SPORADIC_SERVER = -0x1 + _POSIX_SYNCHRONIZED_IO = 0x31069 + _POSIX_THREAD_ATTR_STACKADDR = 0x31069 + _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 + _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 + _POSIX_THREAD_PRIO_INHERIT = 0x31069 + _POSIX_THREAD_PRIO_PROTECT = 0x31069 + _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 + _POSIX_THREAD_PROCESS_SHARED = 0x31069 + _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 + _POSIX_THREAD_SPORADIC_SERVER = -0x1 + _POSIX_THREADS = 0x31069 + _POSIX_TIMEOUTS = 0x31069 + _POSIX_TIMERS = 0x31069 + _POSIX_TRACE = -0x1 + _POSIX_TRACE_EVENT_FILTER = -0x1 + _POSIX_TRACE_INHERIT = -0x1 + _POSIX_TRACE_LOG = -0x1 + _POSIX_TYPED_MEMORY_OBJECTS = -0x1 + _POSIX_VERSION = 0x31069 + + _POSIX_V7_ILP32_OFF32 = -0x1 + _POSIX_V7_ILP32_OFFBIG = -0x1 + _POSIX_V7_LP64_OFF64 = 0x1 + _POSIX_V7_LPBIG_OFFBIG = -0x1 + + _POSIX_V6_ILP32_OFF32 = -0x1 + _POSIX_V6_ILP32_OFFBIG = -0x1 + _POSIX_V6_LP64_OFF64 = 0x1 + _POSIX_V6_LPBIG_OFFBIG = -0x1 + + _POSIX2_C_BIND = 0x31069 + _POSIX2_C_DEV = 0x31069 + _POSIX2_C_VERSION = 0x31069 + _POSIX2_CHAR_TERM = 0x31069 + _POSIX2_LOCALEDEF = 0x31069 + _POSIX2_SW_DEV = 0x31069 + _POSIX2_VERSION = 0x31069 + + _XOPEN_ENH_I18N = 0x1 + _XOPEN_REALTIME = 0x1 + _XOPEN_REALTIME_THREADS = 0x1 + _XOPEN_SHM = 0x1 + _XOPEN_UNIX = 0x1 + _XOPEN_VERSION = 0x2bc + _XOPEN_XCU_VERSION = 0x4 +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mipsle.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mipsle.go new file mode 100644 index 0000000000..a75d5f264f --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mipsle.go @@ -0,0 +1,111 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_values_linux.go + +package sysconf + +const ( + _AIO_PRIO_DELTA_MAX = 0x14 + _BC_BASE_MAX = 0x63 + _BC_DIM_MAX = 0x800 + _BC_SCALE_MAX = 0x63 + _BC_STRING_MAX = 0x3e8 + _COLL_WEIGHTS_MAX = 0xff + _DELAYTIMER_MAX = 0x7fffffff + _EXPR_NEST_MAX = 0x20 + _HOST_NAME_MAX = 0x40 + _LINE_MAX = 0x800 + _LOGIN_NAME_MAX = 0x100 + _MQ_PRIO_MAX = 0x8000 + _NGROUPS_MAX = 0x10000 + _NSS_BUFLEN_GROUP = 0x400 + _NSS_BUFLEN_PASSWD = 0x400 + _OPEN_MAX = 0x100 + _PTHREAD_KEYS_MAX = 0x400 + _PTHREAD_STACK_MIN = 0x20000 + _RE_DUP_MAX = 0x7fff + _RTSIG_MAX = 0x20 + _SEM_VALUE_MAX = 0x7fffffff + _STREAM_MAX = 0x10 + _SYMLOOP_MAX = -0x1 + _TTY_NAME_MAX = 0x20 + + _UIO_MAXIOV = 0x400 + + _INT_MAX = 0x7fffffff + + _POSIX_ADVISORY_INFO = 0x31069 + _POSIX_ARG_MAX = 0x1000 + _POSIX_ASYNCHRONOUS_IO = 0x31069 + _POSIX_BARRIERS = 0x31069 + _POSIX_CHILD_MAX = 0x19 + _POSIX_CLOCK_SELECTION = 0x31069 + _POSIX_CPUTIME = 0x0 + _POSIX_FSYNC = 0x31069 + _POSIX_IPV6 = 0x31069 + _POSIX_JOB_CONTROL = 0x1 + _POSIX_MAPPED_FILES = 0x31069 + _POSIX_MEMLOCK = 0x31069 + _POSIX_MEMLOCK_RANGE = 0x31069 + _POSIX_MEMORY_PROTECTION = 0x31069 + _POSIX_MESSAGE_PASSING = 0x31069 + _POSIX_MONOTONIC_CLOCK = 0x0 + _POSIX_PRIORITIZED_IO = 0x31069 + _POSIX_PRIORITY_SCHEDULING = 0x31069 + _POSIX_RAW_SOCKETS = 0x31069 + _POSIX_READER_WRITER_LOCKS = 0x31069 + _POSIX_REALTIME_SIGNALS = 0x31069 + _POSIX_REGEXP = 0x1 + _POSIX_SAVED_IDS = 0x1 + _POSIX_SEMAPHORES = 0x31069 + _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 + _POSIX_SHELL = 0x1 + _POSIX_SIGQUEUE_MAX = 0x20 + _POSIX_SPAWN = 0x31069 + _POSIX_SPIN_LOCKS = 0x31069 + _POSIX_SPORADIC_SERVER = -0x1 + _POSIX_SYNCHRONIZED_IO = 0x31069 + _POSIX_THREAD_ATTR_STACKADDR = 0x31069 + _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 + _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 + _POSIX_THREAD_PRIO_INHERIT = 0x31069 + _POSIX_THREAD_PRIO_PROTECT = 0x31069 + _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 + _POSIX_THREAD_PROCESS_SHARED = 0x31069 + _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 + _POSIX_THREAD_SPORADIC_SERVER = -0x1 + _POSIX_THREADS = 0x31069 + _POSIX_TIMEOUTS = 0x31069 + _POSIX_TIMERS = 0x31069 + _POSIX_TRACE = -0x1 + _POSIX_TRACE_EVENT_FILTER = -0x1 + _POSIX_TRACE_INHERIT = -0x1 + _POSIX_TRACE_LOG = -0x1 + _POSIX_TYPED_MEMORY_OBJECTS = -0x1 + _POSIX_VERSION = 0x31069 + + _POSIX_V7_ILP32_OFF32 = 0x1 + _POSIX_V7_ILP32_OFFBIG = 0x1 + _POSIX_V7_LP64_OFF64 = -0x1 + _POSIX_V7_LPBIG_OFFBIG = -0x1 + + _POSIX_V6_ILP32_OFF32 = 0x1 + _POSIX_V6_ILP32_OFFBIG = 0x1 + _POSIX_V6_LP64_OFF64 = -0x1 + _POSIX_V6_LPBIG_OFFBIG = -0x1 + + _POSIX2_C_BIND = 0x31069 + _POSIX2_C_DEV = 0x31069 + _POSIX2_C_VERSION = 0x31069 + _POSIX2_CHAR_TERM = 0x31069 + _POSIX2_LOCALEDEF = 0x31069 + _POSIX2_SW_DEV = 0x31069 + _POSIX2_VERSION = 0x31069 + + _XOPEN_ENH_I18N = 0x1 + _XOPEN_REALTIME = 0x1 + _XOPEN_REALTIME_THREADS = 0x1 + _XOPEN_SHM = 0x1 + _XOPEN_UNIX = 0x1 + _XOPEN_VERSION = 0x2bc + _XOPEN_XCU_VERSION = 0x4 +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_ppc64.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_ppc64.go new file mode 100644 index 0000000000..7a6d9912cd --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_ppc64.go @@ -0,0 +1,111 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_values_linux.go + +package sysconf + +const ( + _AIO_PRIO_DELTA_MAX = 0x14 + _BC_BASE_MAX = 0x63 + _BC_DIM_MAX = 0x800 + _BC_SCALE_MAX = 0x63 + _BC_STRING_MAX = 0x3e8 + _COLL_WEIGHTS_MAX = 0xff + _DELAYTIMER_MAX = 0x7fffffff + _EXPR_NEST_MAX = 0x20 + _HOST_NAME_MAX = 0x40 + _LINE_MAX = 0x800 + _LOGIN_NAME_MAX = 0x100 + _MQ_PRIO_MAX = 0x8000 + _NGROUPS_MAX = 0x10000 + _NSS_BUFLEN_GROUP = 0x400 + _NSS_BUFLEN_PASSWD = 0x400 + _OPEN_MAX = 0x100 + _PTHREAD_KEYS_MAX = 0x400 + _PTHREAD_STACK_MIN = 0x20000 + _RE_DUP_MAX = 0x7fff + _RTSIG_MAX = 0x20 + _SEM_VALUE_MAX = 0x7fffffff + _STREAM_MAX = 0x10 + _SYMLOOP_MAX = -0x1 + _TTY_NAME_MAX = 0x20 + + _UIO_MAXIOV = 0x400 + + _INT_MAX = 0x7fffffff + + _POSIX_ADVISORY_INFO = 0x31069 + _POSIX_ARG_MAX = 0x1000 + _POSIX_ASYNCHRONOUS_IO = 0x31069 + _POSIX_BARRIERS = 0x31069 + _POSIX_CHILD_MAX = 0x19 + _POSIX_CLOCK_SELECTION = 0x31069 + _POSIX_CPUTIME = 0x0 + _POSIX_FSYNC = 0x31069 + _POSIX_IPV6 = 0x31069 + _POSIX_JOB_CONTROL = 0x1 + _POSIX_MAPPED_FILES = 0x31069 + _POSIX_MEMLOCK = 0x31069 + _POSIX_MEMLOCK_RANGE = 0x31069 + _POSIX_MEMORY_PROTECTION = 0x31069 + _POSIX_MESSAGE_PASSING = 0x31069 + _POSIX_MONOTONIC_CLOCK = 0x0 + _POSIX_PRIORITIZED_IO = 0x31069 + _POSIX_PRIORITY_SCHEDULING = 0x31069 + _POSIX_RAW_SOCKETS = 0x31069 + _POSIX_READER_WRITER_LOCKS = 0x31069 + _POSIX_REALTIME_SIGNALS = 0x31069 + _POSIX_REGEXP = 0x1 + _POSIX_SAVED_IDS = 0x1 + _POSIX_SEMAPHORES = 0x31069 + _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 + _POSIX_SHELL = 0x1 + _POSIX_SIGQUEUE_MAX = 0x20 + _POSIX_SPAWN = 0x31069 + _POSIX_SPIN_LOCKS = 0x31069 + _POSIX_SPORADIC_SERVER = -0x1 + _POSIX_SYNCHRONIZED_IO = 0x31069 + _POSIX_THREAD_ATTR_STACKADDR = 0x31069 + _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 + _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 + _POSIX_THREAD_PRIO_INHERIT = 0x31069 + _POSIX_THREAD_PRIO_PROTECT = 0x31069 + _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 + _POSIX_THREAD_PROCESS_SHARED = 0x31069 + _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 + _POSIX_THREAD_SPORADIC_SERVER = -0x1 + _POSIX_THREADS = 0x31069 + _POSIX_TIMEOUTS = 0x31069 + _POSIX_TIMERS = 0x31069 + _POSIX_TRACE = -0x1 + _POSIX_TRACE_EVENT_FILTER = -0x1 + _POSIX_TRACE_INHERIT = -0x1 + _POSIX_TRACE_LOG = -0x1 + _POSIX_TYPED_MEMORY_OBJECTS = -0x1 + _POSIX_VERSION = 0x31069 + + _POSIX_V7_ILP32_OFF32 = -0x1 + _POSIX_V7_ILP32_OFFBIG = -0x1 + _POSIX_V7_LP64_OFF64 = 0x1 + _POSIX_V7_LPBIG_OFFBIG = -0x1 + + _POSIX_V6_ILP32_OFF32 = -0x1 + _POSIX_V6_ILP32_OFFBIG = -0x1 + _POSIX_V6_LP64_OFF64 = 0x1 + _POSIX_V6_LPBIG_OFFBIG = -0x1 + + _POSIX2_C_BIND = 0x31069 + _POSIX2_C_DEV = 0x31069 + _POSIX2_C_VERSION = 0x31069 + _POSIX2_CHAR_TERM = 0x31069 + _POSIX2_LOCALEDEF = 0x31069 + _POSIX2_SW_DEV = 0x31069 + _POSIX2_VERSION = 0x31069 + + _XOPEN_ENH_I18N = 0x1 + _XOPEN_REALTIME = 0x1 + _XOPEN_REALTIME_THREADS = 0x1 + _XOPEN_SHM = 0x1 + _XOPEN_UNIX = 0x1 + _XOPEN_VERSION = 0x2bc + _XOPEN_XCU_VERSION = 0x4 +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_ppc64le.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_ppc64le.go new file mode 100644 index 0000000000..7a6d9912cd --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_ppc64le.go @@ -0,0 +1,111 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_values_linux.go + +package sysconf + +const ( + _AIO_PRIO_DELTA_MAX = 0x14 + _BC_BASE_MAX = 0x63 + _BC_DIM_MAX = 0x800 + _BC_SCALE_MAX = 0x63 + _BC_STRING_MAX = 0x3e8 + _COLL_WEIGHTS_MAX = 0xff + _DELAYTIMER_MAX = 0x7fffffff + _EXPR_NEST_MAX = 0x20 + _HOST_NAME_MAX = 0x40 + _LINE_MAX = 0x800 + _LOGIN_NAME_MAX = 0x100 + _MQ_PRIO_MAX = 0x8000 + _NGROUPS_MAX = 0x10000 + _NSS_BUFLEN_GROUP = 0x400 + _NSS_BUFLEN_PASSWD = 0x400 + _OPEN_MAX = 0x100 + _PTHREAD_KEYS_MAX = 0x400 + _PTHREAD_STACK_MIN = 0x20000 + _RE_DUP_MAX = 0x7fff + _RTSIG_MAX = 0x20 + _SEM_VALUE_MAX = 0x7fffffff + _STREAM_MAX = 0x10 + _SYMLOOP_MAX = -0x1 + _TTY_NAME_MAX = 0x20 + + _UIO_MAXIOV = 0x400 + + _INT_MAX = 0x7fffffff + + _POSIX_ADVISORY_INFO = 0x31069 + _POSIX_ARG_MAX = 0x1000 + _POSIX_ASYNCHRONOUS_IO = 0x31069 + _POSIX_BARRIERS = 0x31069 + _POSIX_CHILD_MAX = 0x19 + _POSIX_CLOCK_SELECTION = 0x31069 + _POSIX_CPUTIME = 0x0 + _POSIX_FSYNC = 0x31069 + _POSIX_IPV6 = 0x31069 + _POSIX_JOB_CONTROL = 0x1 + _POSIX_MAPPED_FILES = 0x31069 + _POSIX_MEMLOCK = 0x31069 + _POSIX_MEMLOCK_RANGE = 0x31069 + _POSIX_MEMORY_PROTECTION = 0x31069 + _POSIX_MESSAGE_PASSING = 0x31069 + _POSIX_MONOTONIC_CLOCK = 0x0 + _POSIX_PRIORITIZED_IO = 0x31069 + _POSIX_PRIORITY_SCHEDULING = 0x31069 + _POSIX_RAW_SOCKETS = 0x31069 + _POSIX_READER_WRITER_LOCKS = 0x31069 + _POSIX_REALTIME_SIGNALS = 0x31069 + _POSIX_REGEXP = 0x1 + _POSIX_SAVED_IDS = 0x1 + _POSIX_SEMAPHORES = 0x31069 + _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 + _POSIX_SHELL = 0x1 + _POSIX_SIGQUEUE_MAX = 0x20 + _POSIX_SPAWN = 0x31069 + _POSIX_SPIN_LOCKS = 0x31069 + _POSIX_SPORADIC_SERVER = -0x1 + _POSIX_SYNCHRONIZED_IO = 0x31069 + _POSIX_THREAD_ATTR_STACKADDR = 0x31069 + _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 + _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 + _POSIX_THREAD_PRIO_INHERIT = 0x31069 + _POSIX_THREAD_PRIO_PROTECT = 0x31069 + _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 + _POSIX_THREAD_PROCESS_SHARED = 0x31069 + _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 + _POSIX_THREAD_SPORADIC_SERVER = -0x1 + _POSIX_THREADS = 0x31069 + _POSIX_TIMEOUTS = 0x31069 + _POSIX_TIMERS = 0x31069 + _POSIX_TRACE = -0x1 + _POSIX_TRACE_EVENT_FILTER = -0x1 + _POSIX_TRACE_INHERIT = -0x1 + _POSIX_TRACE_LOG = -0x1 + _POSIX_TYPED_MEMORY_OBJECTS = -0x1 + _POSIX_VERSION = 0x31069 + + _POSIX_V7_ILP32_OFF32 = -0x1 + _POSIX_V7_ILP32_OFFBIG = -0x1 + _POSIX_V7_LP64_OFF64 = 0x1 + _POSIX_V7_LPBIG_OFFBIG = -0x1 + + _POSIX_V6_ILP32_OFF32 = -0x1 + _POSIX_V6_ILP32_OFFBIG = -0x1 + _POSIX_V6_LP64_OFF64 = 0x1 + _POSIX_V6_LPBIG_OFFBIG = -0x1 + + _POSIX2_C_BIND = 0x31069 + _POSIX2_C_DEV = 0x31069 + _POSIX2_C_VERSION = 0x31069 + _POSIX2_CHAR_TERM = 0x31069 + _POSIX2_LOCALEDEF = 0x31069 + _POSIX2_SW_DEV = 0x31069 + _POSIX2_VERSION = 0x31069 + + _XOPEN_ENH_I18N = 0x1 + _XOPEN_REALTIME = 0x1 + _XOPEN_REALTIME_THREADS = 0x1 + _XOPEN_SHM = 0x1 + _XOPEN_UNIX = 0x1 + _XOPEN_VERSION = 0x2bc + _XOPEN_XCU_VERSION = 0x4 +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_riscv64.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_riscv64.go new file mode 100644 index 0000000000..8d9c273d0b --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_riscv64.go @@ -0,0 +1,111 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_values_linux.go + +package sysconf + +const ( + _AIO_PRIO_DELTA_MAX = 0x14 + _BC_BASE_MAX = 0x63 + _BC_DIM_MAX = 0x800 + _BC_SCALE_MAX = 0x63 + _BC_STRING_MAX = 0x3e8 + _COLL_WEIGHTS_MAX = 0xff + _DELAYTIMER_MAX = 0x7fffffff + _EXPR_NEST_MAX = 0x20 + _HOST_NAME_MAX = 0x40 + _LINE_MAX = 0x800 + _LOGIN_NAME_MAX = 0x100 + _MQ_PRIO_MAX = 0x8000 + _NGROUPS_MAX = 0x10000 + _NSS_BUFLEN_GROUP = 0x400 + _NSS_BUFLEN_PASSWD = 0x400 + _OPEN_MAX = 0x100 + _PTHREAD_KEYS_MAX = 0x400 + _PTHREAD_STACK_MIN = 0x4000 + _RE_DUP_MAX = 0x7fff + _RTSIG_MAX = 0x20 + _SEM_VALUE_MAX = 0x7fffffff + _STREAM_MAX = 0x10 + _SYMLOOP_MAX = -0x1 + _TTY_NAME_MAX = 0x20 + + _UIO_MAXIOV = 0x400 + + _INT_MAX = 0x7fffffff + + _POSIX_ADVISORY_INFO = 0x31069 + _POSIX_ARG_MAX = 0x1000 + _POSIX_ASYNCHRONOUS_IO = 0x31069 + _POSIX_BARRIERS = 0x31069 + _POSIX_CHILD_MAX = 0x19 + _POSIX_CLOCK_SELECTION = 0x31069 + _POSIX_CPUTIME = 0x0 + _POSIX_FSYNC = 0x31069 + _POSIX_IPV6 = 0x31069 + _POSIX_JOB_CONTROL = 0x1 + _POSIX_MAPPED_FILES = 0x31069 + _POSIX_MEMLOCK = 0x31069 + _POSIX_MEMLOCK_RANGE = 0x31069 + _POSIX_MEMORY_PROTECTION = 0x31069 + _POSIX_MESSAGE_PASSING = 0x31069 + _POSIX_MONOTONIC_CLOCK = 0x0 + _POSIX_PRIORITIZED_IO = 0x31069 + _POSIX_PRIORITY_SCHEDULING = 0x31069 + _POSIX_RAW_SOCKETS = 0x31069 + _POSIX_READER_WRITER_LOCKS = 0x31069 + _POSIX_REALTIME_SIGNALS = 0x31069 + _POSIX_REGEXP = 0x1 + _POSIX_SAVED_IDS = 0x1 + _POSIX_SEMAPHORES = 0x31069 + _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 + _POSIX_SHELL = 0x1 + _POSIX_SIGQUEUE_MAX = 0x20 + _POSIX_SPAWN = 0x31069 + _POSIX_SPIN_LOCKS = 0x31069 + _POSIX_SPORADIC_SERVER = -0x1 + _POSIX_SYNCHRONIZED_IO = 0x31069 + _POSIX_THREAD_ATTR_STACKADDR = 0x31069 + _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 + _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 + _POSIX_THREAD_PRIO_INHERIT = 0x31069 + _POSIX_THREAD_PRIO_PROTECT = 0x31069 + _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 + _POSIX_THREAD_PROCESS_SHARED = 0x31069 + _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 + _POSIX_THREAD_SPORADIC_SERVER = -0x1 + _POSIX_THREADS = 0x31069 + _POSIX_TIMEOUTS = 0x31069 + _POSIX_TIMERS = 0x31069 + _POSIX_TRACE = -0x1 + _POSIX_TRACE_EVENT_FILTER = -0x1 + _POSIX_TRACE_INHERIT = -0x1 + _POSIX_TRACE_LOG = -0x1 + _POSIX_TYPED_MEMORY_OBJECTS = -0x1 + _POSIX_VERSION = 0x31069 + + _POSIX_V7_ILP32_OFF32 = -0x1 + _POSIX_V7_ILP32_OFFBIG = -0x1 + _POSIX_V7_LP64_OFF64 = 0x1 + _POSIX_V7_LPBIG_OFFBIG = -0x1 + + _POSIX_V6_ILP32_OFF32 = -0x1 + _POSIX_V6_ILP32_OFFBIG = -0x1 + _POSIX_V6_LP64_OFF64 = 0x1 + _POSIX_V6_LPBIG_OFFBIG = -0x1 + + _POSIX2_C_BIND = 0x31069 + _POSIX2_C_DEV = 0x31069 + _POSIX2_C_VERSION = 0x31069 + _POSIX2_CHAR_TERM = 0x31069 + _POSIX2_LOCALEDEF = 0x31069 + _POSIX2_SW_DEV = 0x31069 + _POSIX2_VERSION = 0x31069 + + _XOPEN_ENH_I18N = 0x1 + _XOPEN_REALTIME = 0x1 + _XOPEN_REALTIME_THREADS = 0x1 + _XOPEN_SHM = 0x1 + _XOPEN_UNIX = 0x1 + _XOPEN_VERSION = 0x2bc + _XOPEN_XCU_VERSION = 0x4 +) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_s390x.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_s390x.go new file mode 100644 index 0000000000..8d9c273d0b --- /dev/null +++ b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_s390x.go @@ -0,0 +1,111 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs sysconf_values_linux.go + +package sysconf + +const ( + _AIO_PRIO_DELTA_MAX = 0x14 + _BC_BASE_MAX = 0x63 + _BC_DIM_MAX = 0x800 + _BC_SCALE_MAX = 0x63 + _BC_STRING_MAX = 0x3e8 + _COLL_WEIGHTS_MAX = 0xff + _DELAYTIMER_MAX = 0x7fffffff + _EXPR_NEST_MAX = 0x20 + _HOST_NAME_MAX = 0x40 + _LINE_MAX = 0x800 + _LOGIN_NAME_MAX = 0x100 + _MQ_PRIO_MAX = 0x8000 + _NGROUPS_MAX = 0x10000 + _NSS_BUFLEN_GROUP = 0x400 + _NSS_BUFLEN_PASSWD = 0x400 + _OPEN_MAX = 0x100 + _PTHREAD_KEYS_MAX = 0x400 + _PTHREAD_STACK_MIN = 0x4000 + _RE_DUP_MAX = 0x7fff + _RTSIG_MAX = 0x20 + _SEM_VALUE_MAX = 0x7fffffff + _STREAM_MAX = 0x10 + _SYMLOOP_MAX = -0x1 + _TTY_NAME_MAX = 0x20 + + _UIO_MAXIOV = 0x400 + + _INT_MAX = 0x7fffffff + + _POSIX_ADVISORY_INFO = 0x31069 + _POSIX_ARG_MAX = 0x1000 + _POSIX_ASYNCHRONOUS_IO = 0x31069 + _POSIX_BARRIERS = 0x31069 + _POSIX_CHILD_MAX = 0x19 + _POSIX_CLOCK_SELECTION = 0x31069 + _POSIX_CPUTIME = 0x0 + _POSIX_FSYNC = 0x31069 + _POSIX_IPV6 = 0x31069 + _POSIX_JOB_CONTROL = 0x1 + _POSIX_MAPPED_FILES = 0x31069 + _POSIX_MEMLOCK = 0x31069 + _POSIX_MEMLOCK_RANGE = 0x31069 + _POSIX_MEMORY_PROTECTION = 0x31069 + _POSIX_MESSAGE_PASSING = 0x31069 + _POSIX_MONOTONIC_CLOCK = 0x0 + _POSIX_PRIORITIZED_IO = 0x31069 + _POSIX_PRIORITY_SCHEDULING = 0x31069 + _POSIX_RAW_SOCKETS = 0x31069 + _POSIX_READER_WRITER_LOCKS = 0x31069 + _POSIX_REALTIME_SIGNALS = 0x31069 + _POSIX_REGEXP = 0x1 + _POSIX_SAVED_IDS = 0x1 + _POSIX_SEMAPHORES = 0x31069 + _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 + _POSIX_SHELL = 0x1 + _POSIX_SIGQUEUE_MAX = 0x20 + _POSIX_SPAWN = 0x31069 + _POSIX_SPIN_LOCKS = 0x31069 + _POSIX_SPORADIC_SERVER = -0x1 + _POSIX_SYNCHRONIZED_IO = 0x31069 + _POSIX_THREAD_ATTR_STACKADDR = 0x31069 + _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 + _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 + _POSIX_THREAD_PRIO_INHERIT = 0x31069 + _POSIX_THREAD_PRIO_PROTECT = 0x31069 + _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 + _POSIX_THREAD_PROCESS_SHARED = 0x31069 + _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 + _POSIX_THREAD_SPORADIC_SERVER = -0x1 + _POSIX_THREADS = 0x31069 + _POSIX_TIMEOUTS = 0x31069 + _POSIX_TIMERS = 0x31069 + _POSIX_TRACE = -0x1 + _POSIX_TRACE_EVENT_FILTER = -0x1 + _POSIX_TRACE_INHERIT = -0x1 + _POSIX_TRACE_LOG = -0x1 + _POSIX_TYPED_MEMORY_OBJECTS = -0x1 + _POSIX_VERSION = 0x31069 + + _POSIX_V7_ILP32_OFF32 = -0x1 + _POSIX_V7_ILP32_OFFBIG = -0x1 + _POSIX_V7_LP64_OFF64 = 0x1 + _POSIX_V7_LPBIG_OFFBIG = -0x1 + + _POSIX_V6_ILP32_OFF32 = -0x1 + _POSIX_V6_ILP32_OFFBIG = -0x1 + _POSIX_V6_LP64_OFF64 = 0x1 + _POSIX_V6_LPBIG_OFFBIG = -0x1 + + _POSIX2_C_BIND = 0x31069 + _POSIX2_C_DEV = 0x31069 + _POSIX2_C_VERSION = 0x31069 + _POSIX2_CHAR_TERM = 0x31069 + _POSIX2_LOCALEDEF = 0x31069 + _POSIX2_SW_DEV = 0x31069 + _POSIX2_VERSION = 0x31069 + + _XOPEN_ENH_I18N = 0x1 + _XOPEN_REALTIME = 0x1 + _XOPEN_REALTIME_THREADS = 0x1 + _XOPEN_SHM = 0x1 + _XOPEN_UNIX = 0x1 + _XOPEN_VERSION = 0x2bc + _XOPEN_XCU_VERSION = 0x4 +) diff --git a/vendor/github.com/tklauser/numcpus/.cirrus.yml b/vendor/github.com/tklauser/numcpus/.cirrus.yml new file mode 100644 index 0000000000..22ac7a6539 --- /dev/null +++ b/vendor/github.com/tklauser/numcpus/.cirrus.yml @@ -0,0 +1,12 @@ +env: + CIRRUS_CLONE_DEPTH: 1 + +freebsd_12_task: + freebsd_instance: + image_family: freebsd-12-2 + install_script: | + pkg install -y git go + GOBIN=$PWD/bin go get golang.org/dl/go1.16.2 + bin/go1.16.2 download + build_script: bin/go1.16.2 build -v ./... + test_script: bin/go1.16.2 test -race ./... diff --git a/vendor/github.com/tklauser/numcpus/LICENSE b/vendor/github.com/tklauser/numcpus/LICENSE new file mode 100644 index 0000000000..a2e486a803 --- /dev/null +++ b/vendor/github.com/tklauser/numcpus/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} Authors of Cilium + + 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. + diff --git a/vendor/github.com/tklauser/numcpus/README.md b/vendor/github.com/tklauser/numcpus/README.md new file mode 100644 index 0000000000..25db2bc93d --- /dev/null +++ b/vendor/github.com/tklauser/numcpus/README.md @@ -0,0 +1,49 @@ +# numcpus + +[![Go Reference](https://pkg.go.dev/badge/github.com/tklauser/numcpus.svg)](https://pkg.go.dev/github.com/tklauser/numcpus) +[![GitHub Action Status](https://github.com/tklauser/numcpus/workflows/Tests/badge.svg)](https://github.com/tklauser/numcpus/actions?query=workflow%3ATests) +[![Go Report Card](https://goreportcard.com/badge/github.com/tklauser/numcpus)](https://goreportcard.com/report/github.com/tklauser/numcpus) + +Package numcpus provides information about the number of CPU. + +It gets the number of CPUs (online, offline, present, possible or kernel +maximum) on a Linux, Darwin, FreeBSD, NetBSD, OpenBSD, DragonflyBSD or +Solaris/Illumos system. + +On Linux, the information is retrieved by reading the corresponding CPU +topology files in `/sys/devices/system/cpu`. + +Not all functions are supported on Darwin, FreeBSD, NetBSD, OpenBSD, +DragonflyBSD and Solaris/Illumos. + +## Usage + +```Go +package main + +import ( + "fmt" + "os" + + "github.com/tklauser/numcpus" +) + +func main() { + online, err := numcpus.GetOnline() + if err != nil { + fmt.Fprintf(os.Stderr, "GetOnline: %v\n", err) + } + fmt.Printf("online CPUs: %v\n", online) + + possible, err := numcpus.GetPossible() + if err != nil { + fmt.Fprintf(os.Stderr, "GetPossible: %v\n", err) + } + fmt.Printf("possible CPUs: %v\n", possible) +} +``` + +## References + +* [Linux kernel sysfs documenation for CPU attributes](https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-devices-system-cpu) +* [Linux kernel CPU topology documentation](https://www.kernel.org/doc/Documentation/cputopology.txt) diff --git a/vendor/github.com/tklauser/numcpus/go.mod b/vendor/github.com/tklauser/numcpus/go.mod new file mode 100644 index 0000000000..ad88289c2b --- /dev/null +++ b/vendor/github.com/tklauser/numcpus/go.mod @@ -0,0 +1,5 @@ +module github.com/tklauser/numcpus + +go 1.11 + +require golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa diff --git a/vendor/github.com/tklauser/numcpus/go.sum b/vendor/github.com/tklauser/numcpus/go.sum new file mode 100644 index 0000000000..435cbb6b56 --- /dev/null +++ b/vendor/github.com/tklauser/numcpus/go.sum @@ -0,0 +1,2 @@ +golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa h1:ZYxPR6aca/uhfRJyaOAtflSHjJYiktO7QnJC5ut7iY4= +golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/tklauser/numcpus/numcpus.go b/vendor/github.com/tklauser/numcpus/numcpus.go new file mode 100644 index 0000000000..1023e40fdb --- /dev/null +++ b/vendor/github.com/tklauser/numcpus/numcpus.go @@ -0,0 +1,61 @@ +// Copyright 2018 Tobias Klauser +// +// 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 numcpus provides information about the number of CPU. +// +// It gets the number of CPUs (online, offline, present, possible or kernel +// maximum) on a Linux, Darwin, FreeBSD, NetBSD, OpenBSD or DragonflyBSD +// system. +// +// On Linux, the information is retrieved by reading the corresponding CPU +// topology files in /sys/devices/system/cpu. +// +// Not all functions are supported on Darwin, FreeBSD, NetBSD, OpenBSD and +// DragonflyBSD. +package numcpus + +import "errors" + +// ErrNotSupported is the error returned when the function is not supported. +var ErrNotSupported = errors.New("function not supported") + +// GetKernelMax returns the maximum number of CPUs allowed by the kernel +// configuration. This function is only supported on Linux systems. +func GetKernelMax() (int, error) { + return getKernelMax() +} + +// GetOffline returns the number of offline CPUs, i.e. CPUs that are not online +// because they have been hotplugged off or exceed the limit of CPUs allowed by +// the kernel configuration (see GetKernelMax). This function is only supported +// on Linux systems. +func GetOffline() (int, error) { + return getOffline() +} + +// GetOnline returns the number of CPUs that are online and being scheduled. +func GetOnline() (int, error) { + return getOnline() +} + +// GetPossible returns the number of possible CPUs, i.e. CPUs that +// have been allocated resources and can be brought online if they are present. +func GetPossible() (int, error) { + return getPossible() +} + +// GetPresent returns the number of CPUs present in the system. +func GetPresent() (int, error) { + return getPresent() +} diff --git a/vendor/github.com/tklauser/numcpus/numcpus_bsd.go b/vendor/github.com/tklauser/numcpus/numcpus_bsd.go new file mode 100644 index 0000000000..d88c6cb987 --- /dev/null +++ b/vendor/github.com/tklauser/numcpus/numcpus_bsd.go @@ -0,0 +1,57 @@ +// Copyright 2018 Tobias Klauser +// +// 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. + +//go:build darwin || dragonfly || freebsd || netbsd || openbsd +// +build darwin dragonfly freebsd netbsd openbsd + +package numcpus + +import ( + "runtime" + + "golang.org/x/sys/unix" +) + +func getKernelMax() (int, error) { + return 0, ErrNotSupported +} + +func getOffline() (int, error) { + return 0, ErrNotSupported +} + +func getOnline() (int, error) { + var n uint32 + var err error + switch runtime.GOOS { + case "netbsd", "openbsd": + n, err = unix.SysctlUint32("hw.ncpuonline") + if err != nil || n < 0 { + n, err = unix.SysctlUint32("hw.ncpu") + } + default: + n, err = unix.SysctlUint32("hw.ncpu") + } + return int(n), err +} + +func getPossible() (int, error) { + n, err := unix.SysctlUint32("hw.ncpu") + return int(n), err +} + +func getPresent() (int, error) { + n, err := unix.SysctlUint32("hw.ncpu") + return int(n), err +} diff --git a/vendor/github.com/tklauser/numcpus/numcpus_linux.go b/vendor/github.com/tklauser/numcpus/numcpus_linux.go new file mode 100644 index 0000000000..554d2bf9ea --- /dev/null +++ b/vendor/github.com/tklauser/numcpus/numcpus_linux.go @@ -0,0 +1,84 @@ +// Copyright 2018 Tobias Klauser +// +// 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 numcpus + +import ( + "io/ioutil" + "path/filepath" + "strconv" + "strings" +) + +const sysfsCPUBasePath = "/sys/devices/system/cpu" + +func readCPURange(file string) (int, error) { + buf, err := ioutil.ReadFile(filepath.Join(sysfsCPUBasePath, file)) + if err != nil { + return 0, err + } + return parseCPURange(strings.Trim(string(buf), "\n ")) +} + +func parseCPURange(cpus string) (int, error) { + n := int(0) + for _, cpuRange := range strings.Split(cpus, ",") { + if len(cpuRange) == 0 { + continue + } + rangeOp := strings.SplitN(cpuRange, "-", 2) + first, err := strconv.ParseUint(rangeOp[0], 10, 32) + if err != nil { + return 0, err + } + if len(rangeOp) == 1 { + n++ + continue + } + last, err := strconv.ParseUint(rangeOp[1], 10, 32) + if err != nil { + return 0, err + } + n += int(last - first + 1) + } + return n, nil +} + +func getKernelMax() (int, error) { + buf, err := ioutil.ReadFile(filepath.Join(sysfsCPUBasePath, "kernel_max")) + if err != nil { + return 0, err + } + n, err := strconv.ParseInt(strings.Trim(string(buf), "\n "), 10, 32) + if err != nil { + return 0, err + } + return int(n), nil +} + +func getOffline() (int, error) { + return readCPURange("offline") +} + +func getOnline() (int, error) { + return readCPURange("online") +} + +func getPossible() (int, error) { + return readCPURange("possible") +} + +func getPresent() (int, error) { + return readCPURange("present") +} diff --git a/vendor/github.com/tklauser/numcpus/numcpus_solaris.go b/vendor/github.com/tklauser/numcpus/numcpus_solaris.go new file mode 100644 index 0000000000..92c7d776b8 --- /dev/null +++ b/vendor/github.com/tklauser/numcpus/numcpus_solaris.go @@ -0,0 +1,51 @@ +// Copyright 2021 Tobias Klauser +// +// 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. + +//go:build solaris +// +build solaris + +package numcpus + +import "golang.org/x/sys/unix" + +// taken from /usr/include/sys/unistd.h +const ( + _SC_NPROCESSORS_CONF = 14 + _SC_NPROCESSORS_ONLN = 15 + _SC_NPROCESSORS_MAX = 516 +) + +func getKernelMax() (int, error) { + n, err := unix.Sysconf(_SC_NPROCESSORS_MAX) + return int(n), err +} + +func getOffline() (int, error) { + return 0, ErrNotSupported +} + +func getOnline() (int, error) { + n, err := unix.Sysconf(_SC_NPROCESSORS_ONLN) + return int(n), err +} + +func getPossible() (int, error) { + n, err := unix.Sysconf(_SC_NPROCESSORS_CONF) + return int(n), err +} + +func getPresent() (int, error) { + n, err := unix.Sysconf(_SC_NPROCESSORS_CONF) + return int(n), err +} diff --git a/vendor/github.com/tklauser/numcpus/numcpus_unsupported.go b/vendor/github.com/tklauser/numcpus/numcpus_unsupported.go new file mode 100644 index 0000000000..1bec9d7ea4 --- /dev/null +++ b/vendor/github.com/tklauser/numcpus/numcpus_unsupported.go @@ -0,0 +1,38 @@ +// Copyright 2021 Tobias Klauser +// +// 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. + +//go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris +// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris + +package numcpus + +func getKernelMax() (int, error) { + return 0, ErrNotSupported +} + +func getOffline() (int, error) { + return 0, ErrNotSupported +} + +func getOnline() (int, error) { + return 0, ErrNotSupported +} + +func getPossible() (int, error) { + return 0, ErrNotSupported +} + +func getPresent() (int, error) { + return 0, ErrNotSupported +} diff --git a/vendor/github.com/ulikunitz/xz/LICENSE b/vendor/github.com/ulikunitz/xz/LICENSE index 58ebdc162f..d32149979d 100644 --- a/vendor/github.com/ulikunitz/xz/LICENSE +++ b/vendor/github.com/ulikunitz/xz/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014-2016 Ulrich Kunitz +Copyright (c) 2014-2020 Ulrich Kunitz All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/vendor/github.com/ulikunitz/xz/TODO.md b/vendor/github.com/ulikunitz/xz/TODO.md index 1be3bb845b..a4224ce142 100644 --- a/vendor/github.com/ulikunitz/xz/TODO.md +++ b/vendor/github.com/ulikunitz/xz/TODO.md @@ -1,5 +1,9 @@ # TODO list +## Release v0.5.x + +1. Support check flag in gxz command. + ## Release v0.6 1. Review encoder and check for lzma improvements under xz. @@ -86,6 +90,11 @@ ## Log +### 2020-02-24 + +Release v0.5.7 supports the check-ID None and fixes +[issue #27](https://github.com/ulikunitz/xz/issues/27). + ### 2019-02-20 Release v0.5.6 supports the go.mod file. diff --git a/vendor/github.com/ulikunitz/xz/bits.go b/vendor/github.com/ulikunitz/xz/bits.go index fadc1a5944..364213dd94 100644 --- a/vendor/github.com/ulikunitz/xz/bits.go +++ b/vendor/github.com/ulikunitz/xz/bits.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/crc.go b/vendor/github.com/ulikunitz/xz/crc.go index b44dca96e8..638774ada6 100644 --- a/vendor/github.com/ulikunitz/xz/crc.go +++ b/vendor/github.com/ulikunitz/xz/crc.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/format.go b/vendor/github.com/ulikunitz/xz/format.go index 798159c6c6..edfec9a94a 100644 --- a/vendor/github.com/ulikunitz/xz/format.go +++ b/vendor/github.com/ulikunitz/xz/format.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -46,7 +46,8 @@ const HeaderLen = 12 // Constants for the checksum methods supported by xz. const ( - CRC32 byte = 0x1 + None byte = 0x0 + CRC32 = 0x1 CRC64 = 0x4 SHA256 = 0xa ) @@ -58,7 +59,7 @@ var errInvalidFlags = errors.New("xz: invalid flags") // invalid. func verifyFlags(flags byte) error { switch flags { - case CRC32, CRC64, SHA256: + case None, CRC32, CRC64, SHA256: return nil default: return errInvalidFlags @@ -67,6 +68,7 @@ func verifyFlags(flags byte) error { // flagstrings maps flag values to strings. var flagstrings = map[byte]string{ + None: "None", CRC32: "CRC-32", CRC64: "CRC-64", SHA256: "SHA-256", @@ -85,6 +87,8 @@ func flagString(flags byte) string { // hash method encoded in flags. func newHashFunc(flags byte) (newHash func() hash.Hash, err error) { switch flags { + case None: + newHash = newNoneHash case CRC32: newHash = newCRC32 case CRC64: diff --git a/vendor/github.com/ulikunitz/xz/fox-check-none.xz b/vendor/github.com/ulikunitz/xz/fox-check-none.xz new file mode 100644 index 0000000000000000000000000000000000000000..46043f7dc89b610dc3badb9db3426620c4c97462 GIT binary patch literal 96 zcmexsUKJ6=z`*cd=%ynRgCe6CkX@qxbTK1?PDnLRM*R tL9s%9S!$6&2~avGv8qxbB|lw{3#g5Ofzej?!NQIFY(?{`7{LOOQ2>-O93KDx literal 0 HcmV?d00001 diff --git a/vendor/github.com/ulikunitz/xz/go.mod b/vendor/github.com/ulikunitz/xz/go.mod index 9e5eea2c98..330b675bd7 100644 --- a/vendor/github.com/ulikunitz/xz/go.mod +++ b/vendor/github.com/ulikunitz/xz/go.mod @@ -1 +1,3 @@ module github.com/ulikunitz/xz + +go 1.12 diff --git a/vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go b/vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go index a32887872e..f2861ba3f7 100644 --- a/vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go +++ b/vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/internal/hash/doc.go b/vendor/github.com/ulikunitz/xz/internal/hash/doc.go index f99ec22068..e28d23be47 100644 --- a/vendor/github.com/ulikunitz/xz/internal/hash/doc.go +++ b/vendor/github.com/ulikunitz/xz/internal/hash/doc.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go b/vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go index 58635b113a..b8e66d9721 100644 --- a/vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go +++ b/vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/internal/hash/roller.go b/vendor/github.com/ulikunitz/xz/internal/hash/roller.go index ab6a19ca4c..34c81b38a7 100644 --- a/vendor/github.com/ulikunitz/xz/internal/hash/roller.go +++ b/vendor/github.com/ulikunitz/xz/internal/hash/roller.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go b/vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go index 0ba45e8ff3..678b5a0589 100644 --- a/vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go +++ b/vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/bintree.go b/vendor/github.com/ulikunitz/xz/lzma/bintree.go index a781bd1953..58d6a92a72 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/bintree.go +++ b/vendor/github.com/ulikunitz/xz/lzma/bintree.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/bitops.go b/vendor/github.com/ulikunitz/xz/lzma/bitops.go index e9bab01990..2784ec6ba0 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/bitops.go +++ b/vendor/github.com/ulikunitz/xz/lzma/bitops.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/breader.go b/vendor/github.com/ulikunitz/xz/lzma/breader.go index 5350d814fa..4ad09a14e7 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/breader.go +++ b/vendor/github.com/ulikunitz/xz/lzma/breader.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/buffer.go b/vendor/github.com/ulikunitz/xz/lzma/buffer.go index 50e0b6d57b..9cb7838acb 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/buffer.go +++ b/vendor/github.com/ulikunitz/xz/lzma/buffer.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/bytewriter.go b/vendor/github.com/ulikunitz/xz/lzma/bytewriter.go index a3696ba08b..290606ddcc 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/bytewriter.go +++ b/vendor/github.com/ulikunitz/xz/lzma/bytewriter.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/decoder.go b/vendor/github.com/ulikunitz/xz/lzma/decoder.go index 16e14db394..e5a760a50b 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/decoder.go +++ b/vendor/github.com/ulikunitz/xz/lzma/decoder.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/decoderdict.go b/vendor/github.com/ulikunitz/xz/lzma/decoderdict.go index 564a12b834..ba06712b03 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/decoderdict.go +++ b/vendor/github.com/ulikunitz/xz/lzma/decoderdict.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/directcodec.go b/vendor/github.com/ulikunitz/xz/lzma/directcodec.go index e08eb989ff..e6e0c6ddf3 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/directcodec.go +++ b/vendor/github.com/ulikunitz/xz/lzma/directcodec.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/distcodec.go b/vendor/github.com/ulikunitz/xz/lzma/distcodec.go index b053a2dce2..69871c04ad 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/distcodec.go +++ b/vendor/github.com/ulikunitz/xz/lzma/distcodec.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/encoder.go b/vendor/github.com/ulikunitz/xz/lzma/encoder.go index fe1900a66e..59055eb64c 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/encoder.go +++ b/vendor/github.com/ulikunitz/xz/lzma/encoder.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/encoderdict.go b/vendor/github.com/ulikunitz/xz/lzma/encoderdict.go index 9d0fbc7033..40f3d3f64a 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/encoderdict.go +++ b/vendor/github.com/ulikunitz/xz/lzma/encoderdict.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/hashtable.go b/vendor/github.com/ulikunitz/xz/lzma/hashtable.go index d786a9745d..e82970eac2 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/hashtable.go +++ b/vendor/github.com/ulikunitz/xz/lzma/hashtable.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/header.go b/vendor/github.com/ulikunitz/xz/lzma/header.go index bc708969fd..cda39462ce 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/header.go +++ b/vendor/github.com/ulikunitz/xz/lzma/header.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/header2.go b/vendor/github.com/ulikunitz/xz/lzma/header2.go index ac6a71a5a9..cd148812cd 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/header2.go +++ b/vendor/github.com/ulikunitz/xz/lzma/header2.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go b/vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go index e517730924..927395bd80 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go +++ b/vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/literalcodec.go b/vendor/github.com/ulikunitz/xz/lzma/literalcodec.go index c949d6ebd1..ca31530fd5 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/literalcodec.go +++ b/vendor/github.com/ulikunitz/xz/lzma/literalcodec.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go b/vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go index 4a244eb1ac..7d03ec0dc5 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go +++ b/vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/operation.go b/vendor/github.com/ulikunitz/xz/lzma/operation.go index 733bb99da4..a75c9b46c5 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/operation.go +++ b/vendor/github.com/ulikunitz/xz/lzma/operation.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/prob.go b/vendor/github.com/ulikunitz/xz/lzma/prob.go index 24d50ec681..6987a166f0 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/prob.go +++ b/vendor/github.com/ulikunitz/xz/lzma/prob.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/properties.go b/vendor/github.com/ulikunitz/xz/lzma/properties.go index 23418e25d2..662feba872 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/properties.go +++ b/vendor/github.com/ulikunitz/xz/lzma/properties.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/rangecodec.go b/vendor/github.com/ulikunitz/xz/lzma/rangecodec.go index 6361c5e7c8..7189a03776 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/rangecodec.go +++ b/vendor/github.com/ulikunitz/xz/lzma/rangecodec.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/reader.go b/vendor/github.com/ulikunitz/xz/lzma/reader.go index 2ef3dcaaa9..7b7eef31f8 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/reader.go +++ b/vendor/github.com/ulikunitz/xz/lzma/reader.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/reader2.go b/vendor/github.com/ulikunitz/xz/lzma/reader2.go index a55cfaa4e3..33074e6242 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/reader2.go +++ b/vendor/github.com/ulikunitz/xz/lzma/reader2.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/state.go b/vendor/github.com/ulikunitz/xz/lzma/state.go index 502351052f..03f061cf10 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/state.go +++ b/vendor/github.com/ulikunitz/xz/lzma/state.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/treecodecs.go b/vendor/github.com/ulikunitz/xz/lzma/treecodecs.go index 504b3d78e4..1cb3596fe1 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/treecodecs.go +++ b/vendor/github.com/ulikunitz/xz/lzma/treecodecs.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/writer.go b/vendor/github.com/ulikunitz/xz/lzma/writer.go index efe34fb6bf..5803ecca96 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/writer.go +++ b/vendor/github.com/ulikunitz/xz/lzma/writer.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/writer2.go b/vendor/github.com/ulikunitz/xz/lzma/writer2.go index 7c1afe1572..c263b0666a 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/writer2.go +++ b/vendor/github.com/ulikunitz/xz/lzma/writer2.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzmafilter.go b/vendor/github.com/ulikunitz/xz/lzmafilter.go index 69cf5f7c27..6f4aa2c09c 100644 --- a/vendor/github.com/ulikunitz/xz/lzmafilter.go +++ b/vendor/github.com/ulikunitz/xz/lzmafilter.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/none-check.go b/vendor/github.com/ulikunitz/xz/none-check.go new file mode 100644 index 0000000000..e12d8e476b --- /dev/null +++ b/vendor/github.com/ulikunitz/xz/none-check.go @@ -0,0 +1,23 @@ +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xz + +import "hash" + +type noneHash struct{} + +func (h noneHash) Write(p []byte) (n int, err error) { return len(p), nil } + +func (h noneHash) Sum(b []byte) []byte { return b } + +func (h noneHash) Reset() {} + +func (h noneHash) Size() int { return 0 } + +func (h noneHash) BlockSize() int { return 0 } + +func newNoneHash() hash.Hash { + return &noneHash{} +} diff --git a/vendor/github.com/ulikunitz/xz/reader.go b/vendor/github.com/ulikunitz/xz/reader.go index 0634c6bcc0..22cd6d5007 100644 --- a/vendor/github.com/ulikunitz/xz/reader.go +++ b/vendor/github.com/ulikunitz/xz/reader.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -283,7 +283,11 @@ func (c *ReaderConfig) newBlockReader(xz io.Reader, h *blockHeader, if err != nil { return nil, err } - br.r = io.TeeReader(fr, br.hash) + if br.hash.Size() != 0 { + br.r = io.TeeReader(fr, br.hash) + } else { + br.r = fr + } return br, nil } diff --git a/vendor/github.com/ulikunitz/xz/writer.go b/vendor/github.com/ulikunitz/xz/writer.go index c126f70995..aec10dfa62 100644 --- a/vendor/github.com/ulikunitz/xz/writer.go +++ b/vendor/github.com/ulikunitz/xz/writer.go @@ -1,4 +1,4 @@ -// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -18,8 +18,10 @@ type WriterConfig struct { DictCap int BufSize int BlockSize int64 - // checksum method: CRC32, CRC64 or SHA256 + // checksum method: CRC32, CRC64 or SHA256 (default: CRC64) CheckSum byte + // Forces NoChecksum (default: false) + NoCheckSum bool // match algorithm Matcher lzma.MatchAlgorithm } @@ -41,6 +43,9 @@ func (c *WriterConfig) fill() { if c.CheckSum == 0 { c.CheckSum = CRC64 } + if c.NoCheckSum { + c.CheckSum = None + } } // Verify checks the configuration for errors. Zero values will be @@ -284,7 +289,11 @@ func (c *WriterConfig) newBlockWriter(xz io.Writer, hash hash.Hash) (bw *blockWr if err != nil { return nil, err } - bw.mw = io.MultiWriter(bw.w, bw.hash) + if bw.hash.Size() != 0 { + bw.mw = io.MultiWriter(bw.w, bw.hash) + } else { + bw.mw = bw.w + } return bw, nil } diff --git a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go index 8a893fdfff..56bfaaa17d 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go +++ b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.7 && amd64 && gc && !purego // +build go1.7,amd64,gc,!purego package blake2b diff --git a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s index 8608a7f7d1..a78ab3b3d9 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s +++ b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s @@ -282,14 +282,12 @@ TEXT ·hashBlocksAVX2(SB), 4, $320-48 // frame size = 288 + 32 byte alignment MOVQ blocks_len+32(FP), DI MOVQ SP, DX - MOVQ SP, R9 - ADDQ $31, R9 - ANDQ $~31, R9 - MOVQ R9, SP + ADDQ $31, DX + ANDQ $~31, DX - MOVQ CX, 16(SP) + MOVQ CX, 16(DX) XORQ CX, CX - MOVQ CX, 24(SP) + MOVQ CX, 24(DX) VMOVDQU ·AVX2_c40<>(SB), Y4 VMOVDQU ·AVX2_c48<>(SB), Y5 @@ -301,33 +299,33 @@ TEXT ·hashBlocksAVX2(SB), 4, $320-48 // frame size = 288 + 32 byte alignment MOVQ 0(BX), R8 MOVQ 8(BX), R9 - MOVQ R9, 8(SP) + MOVQ R9, 8(DX) loop: ADDQ $128, R8 - MOVQ R8, 0(SP) + MOVQ R8, 0(DX) CMPQ R8, $128 JGE noinc INCQ R9 - MOVQ R9, 8(SP) + MOVQ R9, 8(DX) noinc: VMOVDQA Y8, Y0 VMOVDQA Y9, Y1 VMOVDQA Y6, Y2 - VPXOR 0(SP), Y7, Y3 + VPXOR 0(DX), Y7, Y3 LOAD_MSG_AVX2_0_2_4_6_1_3_5_7_8_10_12_14_9_11_13_15() - VMOVDQA Y12, 32(SP) - VMOVDQA Y13, 64(SP) - VMOVDQA Y14, 96(SP) - VMOVDQA Y15, 128(SP) + VMOVDQA Y12, 32(DX) + VMOVDQA Y13, 64(DX) + VMOVDQA Y14, 96(DX) + VMOVDQA Y15, 128(DX) ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) LOAD_MSG_AVX2_14_4_9_13_10_8_15_6_1_0_11_5_12_2_7_3() - VMOVDQA Y12, 160(SP) - VMOVDQA Y13, 192(SP) - VMOVDQA Y14, 224(SP) - VMOVDQA Y15, 256(SP) + VMOVDQA Y12, 160(DX) + VMOVDQA Y13, 192(DX) + VMOVDQA Y14, 224(DX) + VMOVDQA Y15, 256(DX) ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) LOAD_MSG_AVX2_11_12_5_15_8_0_2_13_10_3_7_9_14_6_1_4() @@ -347,8 +345,8 @@ noinc: LOAD_MSG_AVX2_10_8_7_1_2_4_6_5_15_9_3_13_11_14_12_0() ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) - ROUND_AVX2(32(SP), 64(SP), 96(SP), 128(SP), Y10, Y4, Y5) - ROUND_AVX2(160(SP), 192(SP), 224(SP), 256(SP), Y10, Y4, Y5) + ROUND_AVX2(32(DX), 64(DX), 96(DX), 128(DX), Y10, Y4, Y5) + ROUND_AVX2(160(DX), 192(DX), 224(DX), 256(DX), Y10, Y4, Y5) VPXOR Y0, Y8, Y8 VPXOR Y1, Y9, Y9 @@ -366,7 +364,6 @@ noinc: VMOVDQU Y9, 32(AX) VZEROUPPER - MOVQ DX, SP RET #define VPUNPCKLQDQ_X2_X2_X15 BYTE $0xC5; BYTE $0x69; BYTE $0x6C; BYTE $0xFA @@ -584,11 +581,9 @@ TEXT ·hashBlocksAVX(SB), 4, $288-48 // frame size = 272 + 16 byte alignment MOVQ blocks_base+24(FP), SI MOVQ blocks_len+32(FP), DI - MOVQ SP, BP - MOVQ SP, R9 - ADDQ $15, R9 - ANDQ $~15, R9 - MOVQ R9, SP + MOVQ SP, R10 + ADDQ $15, R10 + ANDQ $~15, R10 VMOVDQU ·AVX_c40<>(SB), X0 VMOVDQU ·AVX_c48<>(SB), X1 @@ -596,8 +591,8 @@ TEXT ·hashBlocksAVX(SB), 4, $288-48 // frame size = 272 + 16 byte alignment VMOVDQA X1, X9 VMOVDQU ·AVX_iv3<>(SB), X0 - VMOVDQA X0, 0(SP) - XORQ CX, 0(SP) // 0(SP) = ·AVX_iv3 ^ (CX || 0) + VMOVDQA X0, 0(R10) + XORQ CX, 0(R10) // 0(R10) = ·AVX_iv3 ^ (CX || 0) VMOVDQU 0(AX), X10 VMOVDQU 16(AX), X11 @@ -624,35 +619,35 @@ noinc: VMOVDQU ·AVX_iv2<>(SB), X6 VPXOR X15, X6, X6 - VMOVDQA 0(SP), X7 + VMOVDQA 0(R10), X7 LOAD_MSG_AVX_0_2_4_6_1_3_5_7() - VMOVDQA X12, 16(SP) - VMOVDQA X13, 32(SP) - VMOVDQA X14, 48(SP) - VMOVDQA X15, 64(SP) + VMOVDQA X12, 16(R10) + VMOVDQA X13, 32(R10) + VMOVDQA X14, 48(R10) + VMOVDQA X15, 64(R10) HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) SHUFFLE_AVX() LOAD_MSG_AVX(8, 10, 12, 14, 9, 11, 13, 15) - VMOVDQA X12, 80(SP) - VMOVDQA X13, 96(SP) - VMOVDQA X14, 112(SP) - VMOVDQA X15, 128(SP) + VMOVDQA X12, 80(R10) + VMOVDQA X13, 96(R10) + VMOVDQA X14, 112(R10) + VMOVDQA X15, 128(R10) HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) SHUFFLE_AVX_INV() LOAD_MSG_AVX(14, 4, 9, 13, 10, 8, 15, 6) - VMOVDQA X12, 144(SP) - VMOVDQA X13, 160(SP) - VMOVDQA X14, 176(SP) - VMOVDQA X15, 192(SP) + VMOVDQA X12, 144(R10) + VMOVDQA X13, 160(R10) + VMOVDQA X14, 176(R10) + VMOVDQA X15, 192(R10) HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) SHUFFLE_AVX() LOAD_MSG_AVX_1_0_11_5_12_2_7_3() - VMOVDQA X12, 208(SP) - VMOVDQA X13, 224(SP) - VMOVDQA X14, 240(SP) - VMOVDQA X15, 256(SP) + VMOVDQA X12, 208(R10) + VMOVDQA X13, 224(R10) + VMOVDQA X14, 240(R10) + VMOVDQA X15, 256(R10) HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) SHUFFLE_AVX_INV() @@ -712,14 +707,14 @@ noinc: HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) SHUFFLE_AVX_INV() - HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 16(SP), 32(SP), 48(SP), 64(SP), X15, X8, X9) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 16(R10), 32(R10), 48(R10), 64(R10), X15, X8, X9) SHUFFLE_AVX() - HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 80(SP), 96(SP), 112(SP), 128(SP), X15, X8, X9) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 80(R10), 96(R10), 112(R10), 128(R10), X15, X8, X9) SHUFFLE_AVX_INV() - HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 144(SP), 160(SP), 176(SP), 192(SP), X15, X8, X9) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 144(R10), 160(R10), 176(R10), 192(R10), X15, X8, X9) SHUFFLE_AVX() - HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 208(SP), 224(SP), 240(SP), 256(SP), X15, X8, X9) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 208(R10), 224(R10), 240(R10), 256(R10), X15, X8, X9) SHUFFLE_AVX_INV() VMOVDQU 32(AX), X14 @@ -746,5 +741,4 @@ noinc: MOVQ R9, 8(BX) VZEROUPPER - MOVQ BP, SP RET diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go index a52c887fcb..5fa1b32841 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go +++ b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !go1.7 && amd64 && gc && !purego // +build !go1.7,amd64,gc,!purego package blake2b diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s index 1f4c6a9279..bb72a03913 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s +++ b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s @@ -118,15 +118,13 @@ TEXT ·hashBlocksSSE4(SB), 4, $288-48 // frame size = 272 + 16 byte alignment MOVQ blocks_base+24(FP), SI MOVQ blocks_len+32(FP), DI - MOVQ SP, BP - MOVQ SP, R9 - ADDQ $15, R9 - ANDQ $~15, R9 - MOVQ R9, SP + MOVQ SP, R10 + ADDQ $15, R10 + ANDQ $~15, R10 MOVOU ·iv3<>(SB), X0 - MOVO X0, 0(SP) - XORQ CX, 0(SP) // 0(SP) = ·iv3 ^ (CX || 0) + MOVO X0, 0(R10) + XORQ CX, 0(R10) // 0(R10) = ·iv3 ^ (CX || 0) MOVOU ·c40<>(SB), X13 MOVOU ·c48<>(SB), X14 @@ -156,35 +154,35 @@ noinc: MOVOU ·iv2<>(SB), X6 PXOR X8, X6 - MOVO 0(SP), X7 + MOVO 0(R10), X7 LOAD_MSG(X8, X9, X10, X11, SI, 0, 2, 4, 6, 1, 3, 5, 7) - MOVO X8, 16(SP) - MOVO X9, 32(SP) - MOVO X10, 48(SP) - MOVO X11, 64(SP) + MOVO X8, 16(R10) + MOVO X9, 32(R10) + MOVO X10, 48(R10) + MOVO X11, 64(R10) HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) LOAD_MSG(X8, X9, X10, X11, SI, 8, 10, 12, 14, 9, 11, 13, 15) - MOVO X8, 80(SP) - MOVO X9, 96(SP) - MOVO X10, 112(SP) - MOVO X11, 128(SP) + MOVO X8, 80(R10) + MOVO X9, 96(R10) + MOVO X10, 112(R10) + MOVO X11, 128(R10) HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) LOAD_MSG(X8, X9, X10, X11, SI, 14, 4, 9, 13, 10, 8, 15, 6) - MOVO X8, 144(SP) - MOVO X9, 160(SP) - MOVO X10, 176(SP) - MOVO X11, 192(SP) + MOVO X8, 144(R10) + MOVO X9, 160(R10) + MOVO X10, 176(R10) + MOVO X11, 192(R10) HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) LOAD_MSG(X8, X9, X10, X11, SI, 1, 0, 11, 5, 12, 2, 7, 3) - MOVO X8, 208(SP) - MOVO X9, 224(SP) - MOVO X10, 240(SP) - MOVO X11, 256(SP) + MOVO X8, 208(R10) + MOVO X9, 224(R10) + MOVO X10, 240(R10) + MOVO X11, 256(R10) HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) @@ -244,14 +242,14 @@ noinc: HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) - HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 16(SP), 32(SP), 48(SP), 64(SP), X11, X13, X14) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 16(R10), 32(R10), 48(R10), 64(R10), X11, X13, X14) SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) - HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 80(SP), 96(SP), 112(SP), 128(SP), X11, X13, X14) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 80(R10), 96(R10), 112(R10), 128(R10), X11, X13, X14) SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) - HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 144(SP), 160(SP), 176(SP), 192(SP), X11, X13, X14) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 144(R10), 160(R10), 176(R10), 192(R10), X11, X13, X14) SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) - HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 208(SP), 224(SP), 240(SP), 256(SP), X11, X13, X14) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 208(R10), 224(R10), 240(R10), 256(R10), X11, X13, X14) SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) MOVOU 32(AX), X10 @@ -277,5 +275,4 @@ noinc: MOVQ R8, 0(BX) MOVQ R9, 8(BX) - MOVQ BP, SP RET diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_ref.go b/vendor/golang.org/x/crypto/blake2b/blake2b_ref.go index 8597457781..b0137cdf02 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2b_ref.go +++ b/vendor/golang.org/x/crypto/blake2b/blake2b_ref.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !amd64 || purego || !gc // +build !amd64 purego !gc package blake2b diff --git a/vendor/golang.org/x/crypto/blake2b/register.go b/vendor/golang.org/x/crypto/blake2b/register.go index efd689af4b..9d8633963c 100644 --- a/vendor/golang.org/x/crypto/blake2b/register.go +++ b/vendor/golang.org/x/crypto/blake2b/register.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.9 // +build go1.9 package blake2b diff --git a/vendor/golang.org/x/crypto/blake2s/blake2s_386.go b/vendor/golang.org/x/crypto/blake2s/blake2s_386.go index 2d8ee63c1a..b4463fb4dc 100644 --- a/vendor/golang.org/x/crypto/blake2s/blake2s_386.go +++ b/vendor/golang.org/x/crypto/blake2s/blake2s_386.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build 386 && gc && !purego // +build 386,gc,!purego package blake2s diff --git a/vendor/golang.org/x/crypto/blake2s/blake2s_386.s b/vendor/golang.org/x/crypto/blake2s/blake2s_386.s index 023532b46d..82894e5a92 100644 --- a/vendor/golang.org/x/crypto/blake2s/blake2s_386.s +++ b/vendor/golang.org/x/crypto/blake2s/blake2s_386.s @@ -297,19 +297,17 @@ TEXT ·hashBlocksSSE2(SB), 0, $672-24 // frame = 656 + 16 byte alignment MOVL blocks_base+12(FP), SI MOVL blocks_len+16(FP), DX - MOVL SP, BP MOVL SP, DI ADDL $15, DI ANDL $~15, DI - MOVL DI, SP - MOVL CX, 8(SP) + MOVL CX, 8(DI) MOVL 0(BX), CX - MOVL CX, 0(SP) + MOVL CX, 0(DI) MOVL 4(BX), CX - MOVL CX, 4(SP) + MOVL CX, 4(DI) XORL CX, CX - MOVL CX, 12(SP) + MOVL CX, 12(DI) MOVOU 0(AX), X0 MOVOU 16(AX), X1 @@ -321,22 +319,22 @@ loop: MOVOU iv0<>(SB), X6 MOVOU iv1<>(SB), X7 - MOVO 0(SP), X3 + MOVO 0(DI), X3 PADDQ X2, X3 PXOR X3, X7 - MOVO X3, 0(SP) - - PRECOMPUTE(SP, 16, SI, CX) - ROUND_SSE2(X4, X5, X6, X7, 16(SP), 32(SP), 48(SP), 64(SP), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+64(SP), 32+64(SP), 48+64(SP), 64+64(SP), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+128(SP), 32+128(SP), 48+128(SP), 64+128(SP), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+192(SP), 32+192(SP), 48+192(SP), 64+192(SP), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+256(SP), 32+256(SP), 48+256(SP), 64+256(SP), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+320(SP), 32+320(SP), 48+320(SP), 64+320(SP), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+384(SP), 32+384(SP), 48+384(SP), 64+384(SP), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+448(SP), 32+448(SP), 48+448(SP), 64+448(SP), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+512(SP), 32+512(SP), 48+512(SP), 64+512(SP), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+576(SP), 32+576(SP), 48+576(SP), 64+576(SP), X3) + MOVO X3, 0(DI) + + PRECOMPUTE(DI, 16, SI, CX) + ROUND_SSE2(X4, X5, X6, X7, 16(DI), 32(DI), 48(DI), 64(DI), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+64(DI), 32+64(DI), 48+64(DI), 64+64(DI), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+128(DI), 32+128(DI), 48+128(DI), 64+128(DI), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+192(DI), 32+192(DI), 48+192(DI), 64+192(DI), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+256(DI), 32+256(DI), 48+256(DI), 64+256(DI), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+320(DI), 32+320(DI), 48+320(DI), 64+320(DI), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+384(DI), 32+384(DI), 48+384(DI), 64+384(DI), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+448(DI), 32+448(DI), 48+448(DI), 64+448(DI), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+512(DI), 32+512(DI), 48+512(DI), 64+512(DI), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+576(DI), 32+576(DI), 48+576(DI), 64+576(DI), X3) PXOR X4, X0 PXOR X5, X1 @@ -347,15 +345,14 @@ loop: SUBL $64, DX JNE loop - MOVL 0(SP), CX + MOVL 0(DI), CX MOVL CX, 0(BX) - MOVL 4(SP), CX + MOVL 4(DI), CX MOVL CX, 4(BX) MOVOU X0, 0(AX) MOVOU X1, 16(AX) - MOVL BP, SP RET // func hashBlocksSSSE3(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) @@ -366,54 +363,52 @@ TEXT ·hashBlocksSSSE3(SB), 0, $704-24 // frame = 688 + 16 byte alignment MOVL blocks_base+12(FP), SI MOVL blocks_len+16(FP), DX - MOVL SP, BP MOVL SP, DI ADDL $15, DI ANDL $~15, DI - MOVL DI, SP - MOVL CX, 8(SP) + MOVL CX, 8(DI) MOVL 0(BX), CX - MOVL CX, 0(SP) + MOVL CX, 0(DI) MOVL 4(BX), CX - MOVL CX, 4(SP) + MOVL CX, 4(DI) XORL CX, CX - MOVL CX, 12(SP) + MOVL CX, 12(DI) MOVOU 0(AX), X0 MOVOU 16(AX), X1 MOVOU counter<>(SB), X2 loop: - MOVO X0, 656(SP) - MOVO X1, 672(SP) + MOVO X0, 656(DI) + MOVO X1, 672(DI) MOVO X0, X4 MOVO X1, X5 MOVOU iv0<>(SB), X6 MOVOU iv1<>(SB), X7 - MOVO 0(SP), X3 + MOVO 0(DI), X3 PADDQ X2, X3 PXOR X3, X7 - MOVO X3, 0(SP) + MOVO X3, 0(DI) MOVOU rol16<>(SB), X0 MOVOU rol8<>(SB), X1 - PRECOMPUTE(SP, 16, SI, CX) - ROUND_SSSE3(X4, X5, X6, X7, 16(SP), 32(SP), 48(SP), 64(SP), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+64(SP), 32+64(SP), 48+64(SP), 64+64(SP), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+128(SP), 32+128(SP), 48+128(SP), 64+128(SP), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+192(SP), 32+192(SP), 48+192(SP), 64+192(SP), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+256(SP), 32+256(SP), 48+256(SP), 64+256(SP), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+320(SP), 32+320(SP), 48+320(SP), 64+320(SP), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+384(SP), 32+384(SP), 48+384(SP), 64+384(SP), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+448(SP), 32+448(SP), 48+448(SP), 64+448(SP), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+512(SP), 32+512(SP), 48+512(SP), 64+512(SP), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+576(SP), 32+576(SP), 48+576(SP), 64+576(SP), X3, X0, X1) - - MOVO 656(SP), X0 - MOVO 672(SP), X1 + PRECOMPUTE(DI, 16, SI, CX) + ROUND_SSSE3(X4, X5, X6, X7, 16(DI), 32(DI), 48(DI), 64(DI), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+64(DI), 32+64(DI), 48+64(DI), 64+64(DI), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+128(DI), 32+128(DI), 48+128(DI), 64+128(DI), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+192(DI), 32+192(DI), 48+192(DI), 64+192(DI), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+256(DI), 32+256(DI), 48+256(DI), 64+256(DI), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+320(DI), 32+320(DI), 48+320(DI), 64+320(DI), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+384(DI), 32+384(DI), 48+384(DI), 64+384(DI), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+448(DI), 32+448(DI), 48+448(DI), 64+448(DI), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+512(DI), 32+512(DI), 48+512(DI), 64+512(DI), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+576(DI), 32+576(DI), 48+576(DI), 64+576(DI), X3, X0, X1) + + MOVO 656(DI), X0 + MOVO 672(DI), X1 PXOR X4, X0 PXOR X5, X1 PXOR X6, X0 @@ -423,13 +418,12 @@ loop: SUBL $64, DX JNE loop - MOVL 0(SP), CX + MOVL 0(DI), CX MOVL CX, 0(BX) - MOVL 4(SP), CX + MOVL 4(DI), CX MOVL CX, 4(BX) MOVOU X0, 0(AX) MOVOU X1, 16(AX) - MOVL BP, SP RET diff --git a/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.go b/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.go index 267bdce1e3..becdaa120f 100644 --- a/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.go +++ b/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build amd64 && gc && !purego // +build amd64,gc,!purego package blake2s diff --git a/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.s b/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.s index b905944fd0..9b8824f741 100644 --- a/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.s +++ b/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.s @@ -317,30 +317,30 @@ GLOBL counter<>(SB), (NOPTR+RODATA), $16 MOVL R15, 8*4+off+576(dst) #define BLAKE2s_SSE2() \ - PRECOMPUTE_MSG(SP, 16, SI, R8, R9, R10, R11, R12, R13, R14, R15); \ - ROUND_SSE2(X4, X5, X6, X7, 16(SP), 32(SP), 48(SP), 64(SP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+64(SP), 32+64(SP), 48+64(SP), 64+64(SP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+128(SP), 32+128(SP), 48+128(SP), 64+128(SP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+192(SP), 32+192(SP), 48+192(SP), 64+192(SP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+256(SP), 32+256(SP), 48+256(SP), 64+256(SP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+320(SP), 32+320(SP), 48+320(SP), 64+320(SP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+384(SP), 32+384(SP), 48+384(SP), 64+384(SP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+448(SP), 32+448(SP), 48+448(SP), 64+448(SP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+512(SP), 32+512(SP), 48+512(SP), 64+512(SP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+576(SP), 32+576(SP), 48+576(SP), 64+576(SP), X8) + PRECOMPUTE_MSG(BP, 16, SI, R8, R9, R10, R11, R12, R13, R14, R15); \ + ROUND_SSE2(X4, X5, X6, X7, 16(BP), 32(BP), 48(BP), 64(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+64(BP), 32+64(BP), 48+64(BP), 64+64(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+128(BP), 32+128(BP), 48+128(BP), 64+128(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+192(BP), 32+192(BP), 48+192(BP), 64+192(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+256(BP), 32+256(BP), 48+256(BP), 64+256(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+320(BP), 32+320(BP), 48+320(BP), 64+320(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+384(BP), 32+384(BP), 48+384(BP), 64+384(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+448(BP), 32+448(BP), 48+448(BP), 64+448(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+512(BP), 32+512(BP), 48+512(BP), 64+512(BP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+576(BP), 32+576(BP), 48+576(BP), 64+576(BP), X8) #define BLAKE2s_SSSE3() \ - PRECOMPUTE_MSG(SP, 16, SI, R8, R9, R10, R11, R12, R13, R14, R15); \ - ROUND_SSSE3(X4, X5, X6, X7, 16(SP), 32(SP), 48(SP), 64(SP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+64(SP), 32+64(SP), 48+64(SP), 64+64(SP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+128(SP), 32+128(SP), 48+128(SP), 64+128(SP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+192(SP), 32+192(SP), 48+192(SP), 64+192(SP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+256(SP), 32+256(SP), 48+256(SP), 64+256(SP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+320(SP), 32+320(SP), 48+320(SP), 64+320(SP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+384(SP), 32+384(SP), 48+384(SP), 64+384(SP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+448(SP), 32+448(SP), 48+448(SP), 64+448(SP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+512(SP), 32+512(SP), 48+512(SP), 64+512(SP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+576(SP), 32+576(SP), 48+576(SP), 64+576(SP), X8, X13, X14) + PRECOMPUTE_MSG(BP, 16, SI, R8, R9, R10, R11, R12, R13, R14, R15); \ + ROUND_SSSE3(X4, X5, X6, X7, 16(BP), 32(BP), 48(BP), 64(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+64(BP), 32+64(BP), 48+64(BP), 64+64(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+128(BP), 32+128(BP), 48+128(BP), 64+128(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+192(BP), 32+192(BP), 48+192(BP), 64+192(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+256(BP), 32+256(BP), 48+256(BP), 64+256(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+320(BP), 32+320(BP), 48+320(BP), 64+320(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+384(BP), 32+384(BP), 48+384(BP), 64+384(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+448(BP), 32+448(BP), 48+448(BP), 64+448(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+512(BP), 32+512(BP), 48+512(BP), 64+512(BP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+576(BP), 32+576(BP), 48+576(BP), 64+576(BP), X8, X13, X14) #define BLAKE2s_SSE4() \ LOAD_MSG_SSE4(X8, X9, X10, X11, SI, 0, 2, 4, 6, 1, 3, 5, 7, 8, 10, 12, 14, 9, 11, 13, 15); \ @@ -372,16 +372,12 @@ GLOBL counter<>(SB), (NOPTR+RODATA), $16 MOVQ blocks_len, DX; \ \ MOVQ SP, BP; \ - MOVQ SP, R9; \ - ADDQ $15, R9; \ - ANDQ $~15, R9; \ - MOVQ R9, SP; \ + ADDQ $15, BP; \ + ANDQ $~15, BP; \ \ MOVQ 0(BX), R9; \ - MOVQ R9, 0(SP); \ - XORQ R9, R9; \ - MOVQ R9, 8(SP); \ - MOVL CX, 8(SP); \ + MOVQ R9, 0(BP); \ + MOVQ CX, 8(BP); \ \ MOVOU 0(AX), X0; \ MOVOU 16(AX), X1; \ @@ -391,7 +387,7 @@ GLOBL counter<>(SB), (NOPTR+RODATA), $16 MOVOU counter<>(SB), X12; \ MOVOU rol16<>(SB), X13; \ MOVOU rol8<>(SB), X14; \ - MOVO 0(SP), X15; \ + MOVO 0(BP), X15; \ \ loop: \ MOVO X0, X4; \ @@ -413,14 +409,12 @@ GLOBL counter<>(SB), (NOPTR+RODATA), $16 SUBQ $64, DX; \ JNE loop; \ \ - MOVO X15, 0(SP); \ - MOVQ 0(SP), R9; \ + MOVO X15, 0(BP); \ + MOVQ 0(BP), R9; \ MOVQ R9, 0(BX); \ \ MOVOU X0, 0(AX); \ - MOVOU X1, 16(AX); \ - \ - MOVQ BP, SP + MOVOU X1, 16(AX) // func hashBlocksSSE2(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) TEXT ·hashBlocksSSE2(SB), 0, $672-48 // frame = 656 + 16 byte alignment diff --git a/vendor/golang.org/x/crypto/blake2s/blake2s_ref.go b/vendor/golang.org/x/crypto/blake2s/blake2s_ref.go index 94ef01d96e..799dba0c41 100644 --- a/vendor/golang.org/x/crypto/blake2s/blake2s_ref.go +++ b/vendor/golang.org/x/crypto/blake2s/blake2s_ref.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (!amd64 && !386) || !gc || purego // +build !amd64,!386 !gc purego package blake2s diff --git a/vendor/golang.org/x/crypto/blake2s/register.go b/vendor/golang.org/x/crypto/blake2s/register.go index d277459a1c..ef79ff3c67 100644 --- a/vendor/golang.org/x/crypto/blake2s/register.go +++ b/vendor/golang.org/x/crypto/blake2s/register.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.9 // +build go1.9 package blake2s diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go b/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go index c474e5a804..94c71ac1ac 100644 --- a/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go +++ b/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.11 && gc && !purego // +build go1.11,gc,!purego package chacha20 diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go b/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go index 3e8a609fbd..025b49897e 100644 --- a/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go +++ b/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (!arm64 && !s390x && !ppc64le) || (arm64 && !go1.11) || !gc || purego // +build !arm64,!s390x,!ppc64le arm64,!go1.11 !gc purego package chacha20 diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go index 2806c6325d..da420b2e97 100644 --- a/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go +++ b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gc && !purego // +build gc,!purego package chacha20 diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go b/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go index a0774dde1c..c5898db465 100644 --- a/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go +++ b/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gc && !purego // +build gc,!purego package chacha20 diff --git a/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go b/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go index c41d061485..25959b9a6e 100644 --- a/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go +++ b/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gc && !purego // +build gc,!purego package chacha20poly1305 diff --git a/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go b/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go index 13941c476f..f832b33d45 100644 --- a/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go +++ b/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !amd64 || !gc || purego // +build !amd64 !gc purego package chacha20poly1305 diff --git a/vendor/golang.org/x/crypto/curve25519/curve25519_amd64.go b/vendor/golang.org/x/crypto/curve25519/curve25519_amd64.go index 877b6de292..84858480df 100644 --- a/vendor/golang.org/x/crypto/curve25519/curve25519_amd64.go +++ b/vendor/golang.org/x/crypto/curve25519/curve25519_amd64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build amd64 && gc && !purego // +build amd64,gc,!purego package curve25519 diff --git a/vendor/golang.org/x/crypto/curve25519/curve25519_noasm.go b/vendor/golang.org/x/crypto/curve25519/curve25519_noasm.go index 80d3300af5..259728af7d 100644 --- a/vendor/golang.org/x/crypto/curve25519/curve25519_noasm.go +++ b/vendor/golang.org/x/crypto/curve25519/curve25519_noasm.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !amd64 || !gc || purego // +build !amd64 !gc purego package curve25519 diff --git a/vendor/golang.org/x/crypto/internal/subtle/aliasing.go b/vendor/golang.org/x/crypto/internal/subtle/aliasing.go index 281c27ef02..4fad24f8dc 100644 --- a/vendor/golang.org/x/crypto/internal/subtle/aliasing.go +++ b/vendor/golang.org/x/crypto/internal/subtle/aliasing.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !purego // +build !purego // Package subtle implements functions that are often useful in cryptographic diff --git a/vendor/golang.org/x/crypto/internal/subtle/aliasing_purego.go b/vendor/golang.org/x/crypto/internal/subtle/aliasing_purego.go index e20a296592..80ccbed2c0 100644 --- a/vendor/golang.org/x/crypto/internal/subtle/aliasing_purego.go +++ b/vendor/golang.org/x/crypto/internal/subtle/aliasing_purego.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build purego // +build purego // Package subtle implements functions that are often useful in cryptographic diff --git a/vendor/golang.org/x/crypto/poly1305/bits_compat.go b/vendor/golang.org/x/crypto/poly1305/bits_compat.go index 157a69f61b..45b5c966b2 100644 --- a/vendor/golang.org/x/crypto/poly1305/bits_compat.go +++ b/vendor/golang.org/x/crypto/poly1305/bits_compat.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !go1.13 // +build !go1.13 package poly1305 diff --git a/vendor/golang.org/x/crypto/poly1305/bits_go1.13.go b/vendor/golang.org/x/crypto/poly1305/bits_go1.13.go index a0a185f0fc..ed52b3418a 100644 --- a/vendor/golang.org/x/crypto/poly1305/bits_go1.13.go +++ b/vendor/golang.org/x/crypto/poly1305/bits_go1.13.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.13 // +build go1.13 package poly1305 diff --git a/vendor/golang.org/x/crypto/poly1305/mac_noasm.go b/vendor/golang.org/x/crypto/poly1305/mac_noasm.go index af6c94f921..f184b67d98 100644 --- a/vendor/golang.org/x/crypto/poly1305/mac_noasm.go +++ b/vendor/golang.org/x/crypto/poly1305/mac_noasm.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (!amd64 && !ppc64le && !s390x) || !gc || purego // +build !amd64,!ppc64le,!s390x !gc purego package poly1305 diff --git a/vendor/golang.org/x/crypto/poly1305/sum_amd64.go b/vendor/golang.org/x/crypto/poly1305/sum_amd64.go index cf3a69ed3b..6d522333f2 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_amd64.go +++ b/vendor/golang.org/x/crypto/poly1305/sum_amd64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gc && !purego // +build gc,!purego package poly1305 diff --git a/vendor/golang.org/x/crypto/poly1305/sum_ppc64le.go b/vendor/golang.org/x/crypto/poly1305/sum_ppc64le.go index cb4b7185dc..4a069941a6 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_ppc64le.go +++ b/vendor/golang.org/x/crypto/poly1305/sum_ppc64le.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gc && !purego // +build gc,!purego package poly1305 diff --git a/vendor/golang.org/x/crypto/poly1305/sum_s390x.go b/vendor/golang.org/x/crypto/poly1305/sum_s390x.go index 188a665e12..62cc9f8470 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_s390x.go +++ b/vendor/golang.org/x/crypto/poly1305/sum_s390x.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gc && !purego // +build gc,!purego package poly1305 diff --git a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go index 5cf1d6d839..c400dfcf7b 100644 --- a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go +++ b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build amd64 && !purego && gc // +build amd64,!purego,gc package salsa diff --git a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s index 9c84012466..f97efc6764 100644 --- a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s +++ b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s @@ -8,7 +8,7 @@ // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html // func salsa2020XORKeyStream(out, in *byte, n uint64, nonce, key *byte) -// This needs up to 64 bytes at 360(SP); hence the non-obvious frame size. +// This needs up to 64 bytes at 360(R12); hence the non-obvious frame size. TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVQ out+0(FP),DI MOVQ in+8(FP),SI @@ -17,10 +17,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVQ key+32(FP),R8 MOVQ SP,R12 - MOVQ SP,R9 - ADDQ $31, R9 - ANDQ $~31, R9 - MOVQ R9, SP + ADDQ $31, R12 + ANDQ $~31, R12 MOVQ DX,R9 MOVQ CX,DX @@ -32,116 +30,116 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL 0(R10),R8 MOVL 0(DX),AX MOVL 16(R10),R11 - MOVL CX,0(SP) - MOVL R8, 4 (SP) - MOVL AX, 8 (SP) - MOVL R11, 12 (SP) + MOVL CX,0(R12) + MOVL R8, 4 (R12) + MOVL AX, 8 (R12) + MOVL R11, 12 (R12) MOVL 8(DX),CX MOVL 24(R10),R8 MOVL 4(R10),AX MOVL 4(DX),R11 - MOVL CX,16(SP) - MOVL R8, 20 (SP) - MOVL AX, 24 (SP) - MOVL R11, 28 (SP) + MOVL CX,16(R12) + MOVL R8, 20 (R12) + MOVL AX, 24 (R12) + MOVL R11, 28 (R12) MOVL 12(DX),CX MOVL 12(R10),DX MOVL 28(R10),R8 MOVL 8(R10),AX - MOVL DX,32(SP) - MOVL CX, 36 (SP) - MOVL R8, 40 (SP) - MOVL AX, 44 (SP) + MOVL DX,32(R12) + MOVL CX, 36 (R12) + MOVL R8, 40 (R12) + MOVL AX, 44 (R12) MOVQ $1634760805,DX MOVQ $857760878,CX MOVQ $2036477234,R8 MOVQ $1797285236,AX - MOVL DX,48(SP) - MOVL CX, 52 (SP) - MOVL R8, 56 (SP) - MOVL AX, 60 (SP) + MOVL DX,48(R12) + MOVL CX, 52 (R12) + MOVL R8, 56 (R12) + MOVL AX, 60 (R12) CMPQ R9,$256 JB BYTESBETWEEN1AND255 - MOVOA 48(SP),X0 + MOVOA 48(R12),X0 PSHUFL $0X55,X0,X1 PSHUFL $0XAA,X0,X2 PSHUFL $0XFF,X0,X3 PSHUFL $0X00,X0,X0 - MOVOA X1,64(SP) - MOVOA X2,80(SP) - MOVOA X3,96(SP) - MOVOA X0,112(SP) - MOVOA 0(SP),X0 + MOVOA X1,64(R12) + MOVOA X2,80(R12) + MOVOA X3,96(R12) + MOVOA X0,112(R12) + MOVOA 0(R12),X0 PSHUFL $0XAA,X0,X1 PSHUFL $0XFF,X0,X2 PSHUFL $0X00,X0,X3 PSHUFL $0X55,X0,X0 - MOVOA X1,128(SP) - MOVOA X2,144(SP) - MOVOA X3,160(SP) - MOVOA X0,176(SP) - MOVOA 16(SP),X0 + MOVOA X1,128(R12) + MOVOA X2,144(R12) + MOVOA X3,160(R12) + MOVOA X0,176(R12) + MOVOA 16(R12),X0 PSHUFL $0XFF,X0,X1 PSHUFL $0X55,X0,X2 PSHUFL $0XAA,X0,X0 - MOVOA X1,192(SP) - MOVOA X2,208(SP) - MOVOA X0,224(SP) - MOVOA 32(SP),X0 + MOVOA X1,192(R12) + MOVOA X2,208(R12) + MOVOA X0,224(R12) + MOVOA 32(R12),X0 PSHUFL $0X00,X0,X1 PSHUFL $0XAA,X0,X2 PSHUFL $0XFF,X0,X0 - MOVOA X1,240(SP) - MOVOA X2,256(SP) - MOVOA X0,272(SP) + MOVOA X1,240(R12) + MOVOA X2,256(R12) + MOVOA X0,272(R12) BYTESATLEAST256: - MOVL 16(SP),DX - MOVL 36 (SP),CX - MOVL DX,288(SP) - MOVL CX,304(SP) + MOVL 16(R12),DX + MOVL 36 (R12),CX + MOVL DX,288(R12) + MOVL CX,304(R12) SHLQ $32,CX ADDQ CX,DX ADDQ $1,DX MOVQ DX,CX SHRQ $32,CX - MOVL DX, 292 (SP) - MOVL CX, 308 (SP) + MOVL DX, 292 (R12) + MOVL CX, 308 (R12) ADDQ $1,DX MOVQ DX,CX SHRQ $32,CX - MOVL DX, 296 (SP) - MOVL CX, 312 (SP) + MOVL DX, 296 (R12) + MOVL CX, 312 (R12) ADDQ $1,DX MOVQ DX,CX SHRQ $32,CX - MOVL DX, 300 (SP) - MOVL CX, 316 (SP) + MOVL DX, 300 (R12) + MOVL CX, 316 (R12) ADDQ $1,DX MOVQ DX,CX SHRQ $32,CX - MOVL DX,16(SP) - MOVL CX, 36 (SP) - MOVQ R9,352(SP) + MOVL DX,16(R12) + MOVL CX, 36 (R12) + MOVQ R9,352(R12) MOVQ $20,DX - MOVOA 64(SP),X0 - MOVOA 80(SP),X1 - MOVOA 96(SP),X2 - MOVOA 256(SP),X3 - MOVOA 272(SP),X4 - MOVOA 128(SP),X5 - MOVOA 144(SP),X6 - MOVOA 176(SP),X7 - MOVOA 192(SP),X8 - MOVOA 208(SP),X9 - MOVOA 224(SP),X10 - MOVOA 304(SP),X11 - MOVOA 112(SP),X12 - MOVOA 160(SP),X13 - MOVOA 240(SP),X14 - MOVOA 288(SP),X15 + MOVOA 64(R12),X0 + MOVOA 80(R12),X1 + MOVOA 96(R12),X2 + MOVOA 256(R12),X3 + MOVOA 272(R12),X4 + MOVOA 128(R12),X5 + MOVOA 144(R12),X6 + MOVOA 176(R12),X7 + MOVOA 192(R12),X8 + MOVOA 208(R12),X9 + MOVOA 224(R12),X10 + MOVOA 304(R12),X11 + MOVOA 112(R12),X12 + MOVOA 160(R12),X13 + MOVOA 240(R12),X14 + MOVOA 288(R12),X15 MAINLOOP1: - MOVOA X1,320(SP) - MOVOA X2,336(SP) + MOVOA X1,320(R12) + MOVOA X2,336(R12) MOVOA X13,X1 PADDL X12,X1 MOVOA X1,X2 @@ -191,8 +189,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X1,X12 PSRLL $14,X2 PXOR X2,X12 - MOVOA 320(SP),X1 - MOVOA X12,320(SP) + MOVOA 320(R12),X1 + MOVOA X12,320(R12) MOVOA X9,X2 PADDL X7,X2 MOVOA X2,X12 @@ -207,8 +205,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X2,X3 PSRLL $25,X12 PXOR X12,X3 - MOVOA 336(SP),X2 - MOVOA X0,336(SP) + MOVOA 336(R12),X2 + MOVOA X0,336(R12) MOVOA X6,X0 PADDL X2,X0 MOVOA X0,X12 @@ -251,8 +249,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X0,X1 PSRLL $14,X12 PXOR X12,X1 - MOVOA 320(SP),X0 - MOVOA X1,320(SP) + MOVOA 320(R12),X0 + MOVOA X1,320(R12) MOVOA X4,X1 PADDL X0,X1 MOVOA X1,X12 @@ -267,8 +265,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X1,X2 PSRLL $14,X12 PXOR X12,X2 - MOVOA 336(SP),X12 - MOVOA X2,336(SP) + MOVOA 336(R12),X12 + MOVOA X2,336(R12) MOVOA X14,X1 PADDL X12,X1 MOVOA X1,X2 @@ -311,8 +309,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X1,X0 PSRLL $14,X2 PXOR X2,X0 - MOVOA 320(SP),X1 - MOVOA X0,320(SP) + MOVOA 320(R12),X1 + MOVOA X0,320(R12) MOVOA X8,X0 PADDL X14,X0 MOVOA X0,X2 @@ -327,8 +325,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X0,X6 PSRLL $25,X2 PXOR X2,X6 - MOVOA 336(SP),X2 - MOVOA X12,336(SP) + MOVOA 336(R12),X2 + MOVOA X12,336(R12) MOVOA X3,X0 PADDL X2,X0 MOVOA X0,X12 @@ -378,14 +376,14 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X0,X2 PSRLL $14,X12 PXOR X12,X2 - MOVOA 320(SP),X12 - MOVOA 336(SP),X0 + MOVOA 320(R12),X12 + MOVOA 336(R12),X0 SUBQ $2,DX JA MAINLOOP1 - PADDL 112(SP),X12 - PADDL 176(SP),X7 - PADDL 224(SP),X10 - PADDL 272(SP),X4 + PADDL 112(R12),X12 + PADDL 176(R12),X7 + PADDL 224(R12),X10 + PADDL 272(R12),X4 MOVD X12,DX MOVD X7,CX MOVD X10,R8 @@ -446,10 +444,10 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL CX,196(DI) MOVL R8,200(DI) MOVL R9,204(DI) - PADDL 240(SP),X14 - PADDL 64(SP),X0 - PADDL 128(SP),X5 - PADDL 192(SP),X8 + PADDL 240(R12),X14 + PADDL 64(R12),X0 + PADDL 128(R12),X5 + PADDL 192(R12),X8 MOVD X14,DX MOVD X0,CX MOVD X5,R8 @@ -510,10 +508,10 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL CX,212(DI) MOVL R8,216(DI) MOVL R9,220(DI) - PADDL 288(SP),X15 - PADDL 304(SP),X11 - PADDL 80(SP),X1 - PADDL 144(SP),X6 + PADDL 288(R12),X15 + PADDL 304(R12),X11 + PADDL 80(R12),X1 + PADDL 144(R12),X6 MOVD X15,DX MOVD X11,CX MOVD X1,R8 @@ -574,10 +572,10 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL CX,228(DI) MOVL R8,232(DI) MOVL R9,236(DI) - PADDL 160(SP),X13 - PADDL 208(SP),X9 - PADDL 256(SP),X3 - PADDL 96(SP),X2 + PADDL 160(R12),X13 + PADDL 208(R12),X9 + PADDL 256(R12),X3 + PADDL 96(R12),X2 MOVD X13,DX MOVD X9,CX MOVD X3,R8 @@ -638,7 +636,7 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL CX,244(DI) MOVL R8,248(DI) MOVL R9,252(DI) - MOVQ 352(SP),R9 + MOVQ 352(R12),R9 SUBQ $256,R9 ADDQ $256,SI ADDQ $256,DI @@ -650,17 +648,17 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment CMPQ R9,$64 JAE NOCOPY MOVQ DI,DX - LEAQ 360(SP),DI + LEAQ 360(R12),DI MOVQ R9,CX REP; MOVSB - LEAQ 360(SP),DI - LEAQ 360(SP),SI + LEAQ 360(R12),DI + LEAQ 360(R12),SI NOCOPY: - MOVQ R9,352(SP) - MOVOA 48(SP),X0 - MOVOA 0(SP),X1 - MOVOA 16(SP),X2 - MOVOA 32(SP),X3 + MOVQ R9,352(R12) + MOVOA 48(R12),X0 + MOVOA 0(R12),X1 + MOVOA 16(R12),X2 + MOVOA 32(R12),X3 MOVOA X1,X4 MOVQ $20,CX MAINLOOP2: @@ -791,10 +789,10 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PSHUFL $0X39,X3,X3 PXOR X6,X0 JA MAINLOOP2 - PADDL 48(SP),X0 - PADDL 0(SP),X1 - PADDL 16(SP),X2 - PADDL 32(SP),X3 + PADDL 48(R12),X0 + PADDL 0(R12),X1 + PADDL 16(R12),X2 + PADDL 32(R12),X3 MOVD X0,CX MOVD X1,R8 MOVD X2,R9 @@ -855,16 +853,16 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL R8,44(DI) MOVL R9,28(DI) MOVL AX,12(DI) - MOVQ 352(SP),R9 - MOVL 16(SP),CX - MOVL 36 (SP),R8 + MOVQ 352(R12),R9 + MOVL 16(R12),CX + MOVL 36 (R12),R8 ADDQ $1,CX SHLQ $32,R8 ADDQ R8,CX MOVQ CX,R8 SHRQ $32,R8 - MOVL CX,16(SP) - MOVL R8, 36 (SP) + MOVL CX,16(R12) + MOVL R8, 36 (R12) CMPQ R9,$64 JA BYTESATLEAST65 JAE BYTESATLEAST64 @@ -874,7 +872,6 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment REP; MOVSB BYTESATLEAST64: DONE: - MOVQ R12,SP RET BYTESATLEAST65: SUBQ $64,R9 diff --git a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go index 24f03c146b..4392cc1ac7 100644 --- a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go +++ b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !amd64 || purego || !gc // +build !amd64 purego !gc package salsa diff --git a/vendor/golang.org/x/net/context/go17.go b/vendor/golang.org/x/net/context/go17.go index d20f52b7de..344bd14334 100644 --- a/vendor/golang.org/x/net/context/go17.go +++ b/vendor/golang.org/x/net/context/go17.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.7 // +build go1.7 package context diff --git a/vendor/golang.org/x/net/context/go19.go b/vendor/golang.org/x/net/context/go19.go index d88bd1db12..64d31ecc3e 100644 --- a/vendor/golang.org/x/net/context/go19.go +++ b/vendor/golang.org/x/net/context/go19.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.9 // +build go1.9 package context diff --git a/vendor/golang.org/x/net/context/pre_go17.go b/vendor/golang.org/x/net/context/pre_go17.go index 0f35592df5..5270db5db7 100644 --- a/vendor/golang.org/x/net/context/pre_go17.go +++ b/vendor/golang.org/x/net/context/pre_go17.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !go1.7 // +build !go1.7 package context diff --git a/vendor/golang.org/x/net/context/pre_go19.go b/vendor/golang.org/x/net/context/pre_go19.go index b105f80be4..1f9715341f 100644 --- a/vendor/golang.org/x/net/context/pre_go19.go +++ b/vendor/golang.org/x/net/context/pre_go19.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !go1.9 // +build !go1.9 package context diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr.go b/vendor/golang.org/x/net/internal/socket/cmsghdr.go index 0a73e277e0..4bdaaaf1ad 100644 --- a/vendor/golang.org/x/net/internal/socket/cmsghdr.go +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos package socket diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_bsd.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_bsd.go index 14dbb3ad42..0d30e0a0f2 100644 --- a/vendor/golang.org/x/net/internal/socket/cmsghdr_bsd.go +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_bsd.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || darwin || dragonfly || freebsd || netbsd || openbsd // +build aix darwin dragonfly freebsd netbsd openbsd package socket diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_32bit.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_32bit.go index bac66811dd..623cf30f4c 100644 --- a/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_32bit.go +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_32bit.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (arm || mips || mipsle || 386) && linux // +build arm mips mipsle 386 // +build linux diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_64bit.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_64bit.go index 27be0efaca..1ba43101fc 100644 --- a/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_64bit.go +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_64bit.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (arm64 || amd64 || ppc64 || ppc64le || mips64 || mips64le || riscv64 || s390x) && linux // +build arm64 amd64 ppc64 ppc64le mips64 mips64le riscv64 s390x // +build linux diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_solaris_64bit.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_solaris_64bit.go index 7dedd430eb..d3dbe1b8e0 100644 --- a/vendor/golang.org/x/net/internal/socket/cmsghdr_solaris_64bit.go +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_solaris_64bit.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build amd64 -// +build solaris +//go:build amd64 && solaris +// +build amd64,solaris package socket diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go index e581011b05..1d9f2ed625 100644 --- a/vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go @@ -2,13 +2,24 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!zos package socket -type cmsghdr struct{} +func controlHeaderLen() int { + return 0 +} + +func controlMessageLen(dataLen int) int { + return 0 +} -const sizeofCmsghdr = 0 +func controlMessageSpace(dataLen int) int { + return 0 +} + +type cmsghdr struct{} func (h *cmsghdr) len() int { return 0 } func (h *cmsghdr) lvl() int { return 0 } diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_unix.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_unix.go new file mode 100644 index 0000000000..aa1b06203c --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_unix.go @@ -0,0 +1,22 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris + +package socket + +import "golang.org/x/sys/unix" + +func controlHeaderLen() int { + return unix.CmsgLen(0) +} + +func controlMessageLen(dataLen int) int { + return unix.CmsgLen(dataLen) +} + +func controlMessageSpace(dataLen int) int { + return unix.CmsgSpace(dataLen) +} diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_zos_s390x.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_zos_s390x.go new file mode 100644 index 0000000000..98be146bc5 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_zos_s390x.go @@ -0,0 +1,25 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package socket + +import "syscall" + +func (h *cmsghdr) set(l, lvl, typ int) { + h.Len = int32(l) + h.Level = int32(lvl) + h.Type = int32(typ) +} + +func controlHeaderLen() int { + return syscall.CmsgLen(0) +} + +func controlMessageLen(dataLen int) int { + return syscall.CmsgLen(dataLen) +} + +func controlMessageSpace(dataLen int) int { + return syscall.CmsgSpace(dataLen) +} diff --git a/vendor/golang.org/x/net/internal/socket/error_unix.go b/vendor/golang.org/x/net/internal/socket/error_unix.go index f14872d3d3..78f4129047 100644 --- a/vendor/golang.org/x/net/internal/socket/error_unix.go +++ b/vendor/golang.org/x/net/internal/socket/error_unix.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos package socket diff --git a/vendor/golang.org/x/net/internal/socket/iovec_32bit.go b/vendor/golang.org/x/net/internal/socket/iovec_32bit.go index 05d6082d14..1f42d034dc 100644 --- a/vendor/golang.org/x/net/internal/socket/iovec_32bit.go +++ b/vendor/golang.org/x/net/internal/socket/iovec_32bit.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (arm || mips || mipsle || 386) && (darwin || dragonfly || freebsd || linux || netbsd || openbsd) // +build arm mips mipsle 386 // +build darwin dragonfly freebsd linux netbsd openbsd diff --git a/vendor/golang.org/x/net/internal/socket/iovec_64bit.go b/vendor/golang.org/x/net/internal/socket/iovec_64bit.go index dfeda752be..3dc5def2bc 100644 --- a/vendor/golang.org/x/net/internal/socket/iovec_64bit.go +++ b/vendor/golang.org/x/net/internal/socket/iovec_64bit.go @@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (arm64 || amd64 || ppc64 || ppc64le || mips64 || mips64le || riscv64 || s390x) && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || zos) // +build arm64 amd64 ppc64 ppc64le mips64 mips64le riscv64 s390x -// +build aix darwin dragonfly freebsd linux netbsd openbsd +// +build aix darwin dragonfly freebsd linux netbsd openbsd zos package socket diff --git a/vendor/golang.org/x/net/internal/socket/iovec_solaris_64bit.go b/vendor/golang.org/x/net/internal/socket/iovec_solaris_64bit.go index 8d17a40c40..f7da2bc4d4 100644 --- a/vendor/golang.org/x/net/internal/socket/iovec_solaris_64bit.go +++ b/vendor/golang.org/x/net/internal/socket/iovec_solaris_64bit.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build amd64 -// +build solaris +//go:build amd64 && solaris +// +build amd64,solaris package socket diff --git a/vendor/golang.org/x/net/internal/socket/iovec_stub.go b/vendor/golang.org/x/net/internal/socket/iovec_stub.go index a746e90e30..14caf52483 100644 --- a/vendor/golang.org/x/net/internal/socket/iovec_stub.go +++ b/vendor/golang.org/x/net/internal/socket/iovec_stub.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!zos package socket diff --git a/vendor/golang.org/x/net/internal/socket/mmsghdr_stub.go b/vendor/golang.org/x/net/internal/socket/mmsghdr_stub.go index 1a7f2792f2..113e773cd5 100644 --- a/vendor/golang.org/x/net/internal/socket/mmsghdr_stub.go +++ b/vendor/golang.org/x/net/internal/socket/mmsghdr_stub.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !aix && !linux && !netbsd // +build !aix,!linux,!netbsd package socket diff --git a/vendor/golang.org/x/net/internal/socket/mmsghdr_unix.go b/vendor/golang.org/x/net/internal/socket/mmsghdr_unix.go index f1100683a5..5025a0f75a 100644 --- a/vendor/golang.org/x/net/internal/socket/mmsghdr_unix.go +++ b/vendor/golang.org/x/net/internal/socket/mmsghdr_unix.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || linux || netbsd // +build aix linux netbsd package socket diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_bsd.go b/vendor/golang.org/x/net/internal/socket/msghdr_bsd.go index 77f44c1f12..25f6847f99 100644 --- a/vendor/golang.org/x/net/internal/socket/msghdr_bsd.go +++ b/vendor/golang.org/x/net/internal/socket/msghdr_bsd.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || darwin || dragonfly || freebsd || netbsd || openbsd // +build aix darwin dragonfly freebsd netbsd openbsd package socket diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_bsdvar.go b/vendor/golang.org/x/net/internal/socket/msghdr_bsdvar.go index c5562dd66a..5b8e00f1cd 100644 --- a/vendor/golang.org/x/net/internal/socket/msghdr_bsdvar.go +++ b/vendor/golang.org/x/net/internal/socket/msghdr_bsdvar.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || darwin || dragonfly || freebsd || netbsd // +build aix darwin dragonfly freebsd netbsd package socket diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_linux_32bit.go b/vendor/golang.org/x/net/internal/socket/msghdr_linux_32bit.go index a7a5987c88..2e09e26699 100644 --- a/vendor/golang.org/x/net/internal/socket/msghdr_linux_32bit.go +++ b/vendor/golang.org/x/net/internal/socket/msghdr_linux_32bit.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (arm || mips || mipsle || 386) && linux // +build arm mips mipsle 386 // +build linux diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_linux_64bit.go b/vendor/golang.org/x/net/internal/socket/msghdr_linux_64bit.go index e731833a26..c9c592ddb8 100644 --- a/vendor/golang.org/x/net/internal/socket/msghdr_linux_64bit.go +++ b/vendor/golang.org/x/net/internal/socket/msghdr_linux_64bit.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (arm64 || amd64 || ppc64 || ppc64le || mips64 || mips64le || riscv64 || s390x) && linux // +build arm64 amd64 ppc64 ppc64le mips64 mips64le riscv64 s390x // +build linux diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_solaris_64bit.go b/vendor/golang.org/x/net/internal/socket/msghdr_solaris_64bit.go index 6465b20732..3098f5d783 100644 --- a/vendor/golang.org/x/net/internal/socket/msghdr_solaris_64bit.go +++ b/vendor/golang.org/x/net/internal/socket/msghdr_solaris_64bit.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build amd64 -// +build solaris +//go:build amd64 && solaris +// +build amd64,solaris package socket diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_stub.go b/vendor/golang.org/x/net/internal/socket/msghdr_stub.go index 873490a7ae..eb79151f6a 100644 --- a/vendor/golang.org/x/net/internal/socket/msghdr_stub.go +++ b/vendor/golang.org/x/net/internal/socket/msghdr_stub.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!zos package socket diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_zos_s390x.go b/vendor/golang.org/x/net/internal/socket/msghdr_zos_s390x.go new file mode 100644 index 0000000000..324e9ee7d1 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/msghdr_zos_s390x.go @@ -0,0 +1,36 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build s390x && zos +// +build s390x,zos + +package socket + +import "unsafe" + +func (h *msghdr) pack(vs []iovec, bs [][]byte, oob []byte, sa []byte) { + for i := range vs { + vs[i].set(bs[i]) + } + if len(vs) > 0 { + h.Iov = &vs[0] + h.Iovlen = int32(len(vs)) + } + if len(oob) > 0 { + h.Control = (*byte)(unsafe.Pointer(&oob[0])) + h.Controllen = uint32(len(oob)) + } + if sa != nil { + h.Name = (*byte)(unsafe.Pointer(&sa[0])) + h.Namelen = uint32(len(sa)) + } +} + +func (h *msghdr) controllen() int { + return int(h.Controllen) +} + +func (h *msghdr) flags() int { + return int(h.Flags) +} diff --git a/vendor/golang.org/x/net/internal/socket/norace.go b/vendor/golang.org/x/net/internal/socket/norace.go index 9519ffbba4..de0ad420fc 100644 --- a/vendor/golang.org/x/net/internal/socket/norace.go +++ b/vendor/golang.org/x/net/internal/socket/norace.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !race // +build !race package socket diff --git a/vendor/golang.org/x/net/internal/socket/race.go b/vendor/golang.org/x/net/internal/socket/race.go index df60c62fff..f0a28a625d 100644 --- a/vendor/golang.org/x/net/internal/socket/race.go +++ b/vendor/golang.org/x/net/internal/socket/race.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build race // +build race package socket diff --git a/vendor/golang.org/x/net/internal/socket/rawconn.go b/vendor/golang.org/x/net/internal/socket/rawconn.go index b07b890050..87e81071c1 100644 --- a/vendor/golang.org/x/net/internal/socket/rawconn.go +++ b/vendor/golang.org/x/net/internal/socket/rawconn.go @@ -17,18 +17,45 @@ type Conn struct { c syscall.RawConn } +// tcpConn is an interface implemented by net.TCPConn. +// It can be used for interface assertions to check if a net.Conn is a TCP connection. +type tcpConn interface { + SyscallConn() (syscall.RawConn, error) + SetLinger(int) error +} + +var _ tcpConn = (*net.TCPConn)(nil) + +// udpConn is an interface implemented by net.UDPConn. +// It can be used for interface assertions to check if a net.Conn is a UDP connection. +type udpConn interface { + SyscallConn() (syscall.RawConn, error) + ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *net.UDPAddr, err error) +} + +var _ udpConn = (*net.UDPConn)(nil) + +// ipConn is an interface implemented by net.IPConn. +// It can be used for interface assertions to check if a net.Conn is an IP connection. +type ipConn interface { + SyscallConn() (syscall.RawConn, error) + ReadMsgIP(b, oob []byte) (n, oobn, flags int, addr *net.IPAddr, err error) +} + +var _ ipConn = (*net.IPConn)(nil) + // NewConn returns a new raw connection. func NewConn(c net.Conn) (*Conn, error) { var err error var cc Conn switch c := c.(type) { - case *net.TCPConn: + case tcpConn: cc.network = "tcp" cc.c, err = c.SyscallConn() - case *net.UDPConn: + case udpConn: cc.network = "udp" cc.c, err = c.SyscallConn() - case *net.IPConn: + case ipConn: cc.network = "ip" cc.c, err = c.SyscallConn() default: diff --git a/vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go b/vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go index d01fc4c7da..5d90de1183 100644 --- a/vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go +++ b/vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux // +build linux package socket diff --git a/vendor/golang.org/x/net/internal/socket/rawconn_msg.go b/vendor/golang.org/x/net/internal/socket/rawconn_msg.go index d5ae3f8e14..dfed9a8da3 100644 --- a/vendor/golang.org/x/net/internal/socket/rawconn_msg.go +++ b/vendor/golang.org/x/net/internal/socket/rawconn_msg.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || windows || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows zos package socket @@ -24,7 +25,7 @@ func (c *Conn) recvMsg(m *Message, flags int) error { var n int fn := func(s uintptr) bool { n, operr = recvmsg(s, &h, flags) - if operr == syscall.EAGAIN { + if operr == syscall.EAGAIN || operr == syscall.EWOULDBLOCK { return false } return true @@ -61,7 +62,7 @@ func (c *Conn) sendMsg(m *Message, flags int) error { var n int fn := func(s uintptr) bool { n, operr = sendmsg(s, &h, flags) - if operr == syscall.EAGAIN { + if operr == syscall.EAGAIN || operr == syscall.EWOULDBLOCK { return false } return true diff --git a/vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go b/vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go index fe5bb942ba..02f3285566 100644 --- a/vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go +++ b/vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !linux // +build !linux package socket diff --git a/vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go b/vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go index b8cea6fe53..dd785877b6 100644 --- a/vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go +++ b/vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos package socket diff --git a/vendor/golang.org/x/net/internal/socket/socket.go b/vendor/golang.org/x/net/internal/socket/socket.go index 23571b8d4d..dba47bf12b 100644 --- a/vendor/golang.org/x/net/internal/socket/socket.go +++ b/vendor/golang.org/x/net/internal/socket/socket.go @@ -90,17 +90,9 @@ func (o *Option) SetInt(c *Conn, v int) error { return o.set(c, b) } -func controlHeaderLen() int { - return roundup(sizeofCmsghdr) -} - -func controlMessageLen(dataLen int) int { - return roundup(sizeofCmsghdr) + dataLen -} - // ControlMessageSpace returns the whole length of control message. func ControlMessageSpace(dataLen int) int { - return roundup(sizeofCmsghdr) + roundup(dataLen) + return controlMessageSpace(dataLen) } // A ControlMessage represents the head message in a stream of control diff --git a/vendor/golang.org/x/net/internal/socket/sys.go b/vendor/golang.org/x/net/internal/socket/sys.go index ee492ba86b..4a26af1863 100644 --- a/vendor/golang.org/x/net/internal/socket/sys.go +++ b/vendor/golang.org/x/net/internal/socket/sys.go @@ -9,13 +9,8 @@ import ( "unsafe" ) -var ( - // NativeEndian is the machine native endian implementation of - // ByteOrder. - NativeEndian binary.ByteOrder - - kernelAlign int -) +// NativeEndian is the machine native endian implementation of ByteOrder. +var NativeEndian binary.ByteOrder func init() { i := uint32(1) @@ -25,9 +20,4 @@ func init() { } else { NativeEndian = binary.BigEndian } - kernelAlign = probeProtocolStack() -} - -func roundup(l int) int { - return (l + kernelAlign - 1) &^ (kernelAlign - 1) } diff --git a/vendor/golang.org/x/net/internal/socket/sys_bsd.go b/vendor/golang.org/x/net/internal/socket/sys_bsd.go index d432835b41..b6cd77088d 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_bsd.go +++ b/vendor/golang.org/x/net/internal/socket/sys_bsd.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || darwin || dragonfly || freebsd || openbsd // +build aix darwin dragonfly freebsd openbsd package socket diff --git a/vendor/golang.org/x/net/internal/socket/sys_bsdvar.go b/vendor/golang.org/x/net/internal/socket/sys_bsdvar.go deleted file mode 100644 index b4f41b5522..0000000000 --- a/vendor/golang.org/x/net/internal/socket/sys_bsdvar.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build aix freebsd netbsd openbsd - -package socket - -import ( - "runtime" - "unsafe" -) - -func probeProtocolStack() int { - if (runtime.GOOS == "netbsd" || runtime.GOOS == "openbsd") && runtime.GOARCH == "arm" { - return 8 - } - if runtime.GOOS == "aix" { - return 1 - } - var p uintptr - return int(unsafe.Sizeof(p)) -} diff --git a/vendor/golang.org/x/net/internal/socket/sys_const_unix.go b/vendor/golang.org/x/net/internal/socket/sys_const_unix.go index 43797d6e53..f077b2f11f 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_const_unix.go +++ b/vendor/golang.org/x/net/internal/socket/sys_const_unix.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package socket diff --git a/vendor/golang.org/x/net/internal/socket/sys_const_zos.go b/vendor/golang.org/x/net/internal/socket/sys_const_zos.go new file mode 100644 index 0000000000..3048629541 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_const_zos.go @@ -0,0 +1,18 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build zos +// +build zos + +package socket + +import "syscall" + +const ( + sysAF_UNSPEC = syscall.AF_UNSPEC + sysAF_INET = syscall.AF_INET + sysAF_INET6 = syscall.AF_INET6 + + sysSOCK_RAW = syscall.SOCK_RAW +) diff --git a/vendor/golang.org/x/net/internal/socket/sys_darwin.go b/vendor/golang.org/x/net/internal/socket/sys_darwin.go deleted file mode 100644 index b17d223bff..0000000000 --- a/vendor/golang.org/x/net/internal/socket/sys_darwin.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package socket - -func probeProtocolStack() int { return 4 } diff --git a/vendor/golang.org/x/net/internal/socket/sys_dragonfly.go b/vendor/golang.org/x/net/internal/socket/sys_dragonfly.go deleted file mode 100644 index ed0448fe98..0000000000 --- a/vendor/golang.org/x/net/internal/socket/sys_dragonfly.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package socket - -import ( - "sync" - "syscall" - "unsafe" -) - -// See version list in https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/sys/param.h -var ( - osreldateOnce sync.Once - osreldate uint32 -) - -// First __DragonFly_version after September 2019 ABI changes -// http://lists.dragonflybsd.org/pipermail/users/2019-September/358280.html -const _dragonflyABIChangeVersion = 500705 - -func probeProtocolStack() int { - osreldateOnce.Do(func() { osreldate, _ = syscall.SysctlUint32("kern.osreldate") }) - var p uintptr - if int(unsafe.Sizeof(p)) == 8 && osreldate >= _dragonflyABIChangeVersion { - return int(unsafe.Sizeof(p)) - } - // 64-bit Dragonfly before the September 2019 ABI changes still requires - // 32-bit aligned access to network subsystem. - return 4 -} diff --git a/vendor/golang.org/x/net/internal/socket/sys_linkname.go b/vendor/golang.org/x/net/internal/socket/sys_linkname.go index 61c3f38a51..21734af4b8 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_linkname.go +++ b/vendor/golang.org/x/net/internal/socket/sys_linkname.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || (go1.12 && darwin) // +build aix go1.12,darwin package socket diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux.go b/vendor/golang.org/x/net/internal/socket/sys_linux.go index 1559521e03..76f5b8ae5d 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_linux.go +++ b/vendor/golang.org/x/net/internal/socket/sys_linux.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux && !s390x && !386 // +build linux,!s390x,!386 package socket @@ -11,11 +12,6 @@ import ( "unsafe" ) -func probeProtocolStack() int { - var p uintptr - return int(unsafe.Sizeof(p)) -} - func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) { n, _, errno := syscall.Syscall6(sysRECVMMSG, s, uintptr(unsafe.Pointer(&hs[0])), uintptr(len(hs)), uintptr(flags), 0, 0) return int(n), errnoErr(errno) diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_386.go b/vendor/golang.org/x/net/internal/socket/sys_linux_386.go index 235b2cc08a..651215321b 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_linux_386.go +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_386.go @@ -9,8 +9,6 @@ import ( "unsafe" ) -func probeProtocolStack() int { return 4 } - const ( sysSETSOCKOPT = 0xe sysGETSOCKOPT = 0xf diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_riscv64.go b/vendor/golang.org/x/net/internal/socket/sys_linux_riscv64.go index 64f69f1dc5..5b128fbb2a 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_linux_riscv64.go +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_riscv64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build riscv64 // +build riscv64 package socket diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.go b/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.go index 327979efbb..651215321b 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.go +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.go @@ -9,8 +9,6 @@ import ( "unsafe" ) -func probeProtocolStack() int { return 8 } - const ( sysSETSOCKOPT = 0xe sysGETSOCKOPT = 0xf diff --git a/vendor/golang.org/x/net/internal/socket/sys_posix.go b/vendor/golang.org/x/net/internal/socket/sys_posix.go index 22eae809c9..25ded21763 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_posix.go +++ b/vendor/golang.org/x/net/internal/socket/sys_posix.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || windows || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows zos package socket diff --git a/vendor/golang.org/x/net/internal/socket/sys_solaris.go b/vendor/golang.org/x/net/internal/socket/sys_solaris.go index 66b5547868..e79ca95183 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_solaris.go +++ b/vendor/golang.org/x/net/internal/socket/sys_solaris.go @@ -5,21 +5,10 @@ package socket import ( - "runtime" "syscall" "unsafe" ) -func probeProtocolStack() int { - switch runtime.GOARCH { - case "amd64": - return 4 - default: - var p uintptr - return int(unsafe.Sizeof(p)) - } -} - //go:cgo_import_dynamic libc___xnet_getsockopt __xnet_getsockopt "libsocket.so" //go:cgo_import_dynamic libc_setsockopt setsockopt "libsocket.so" //go:cgo_import_dynamic libc___xnet_recvmsg __xnet_recvmsg "libsocket.so" diff --git a/vendor/golang.org/x/net/internal/socket/sys_stub.go b/vendor/golang.org/x/net/internal/socket/sys_stub.go index 0f61742628..dc7bb389b3 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_stub.go +++ b/vendor/golang.org/x/net/internal/socket/sys_stub.go @@ -2,15 +2,12 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos package socket -import ( - "net" - "runtime" - "unsafe" -) +import "net" const ( sysAF_UNSPEC = 0x0 @@ -20,16 +17,6 @@ const ( sysSOCK_RAW = 0x3 ) -func probeProtocolStack() int { - switch runtime.GOARCH { - case "amd64p32", "mips64p32": - return 4 - default: - var p uintptr - return int(unsafe.Sizeof(p)) - } -} - func marshalInetAddr(ip net.IP, port int, zone string) []byte { return nil } diff --git a/vendor/golang.org/x/net/internal/socket/sys_unix.go b/vendor/golang.org/x/net/internal/socket/sys_unix.go index 0eb71283f5..c98ebae548 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_unix.go +++ b/vendor/golang.org/x/net/internal/socket/sys_unix.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build dragonfly || freebsd || (linux && !s390x && !386) || netbsd || openbsd // +build dragonfly freebsd linux,!s390x,!386 netbsd openbsd package socket diff --git a/vendor/golang.org/x/net/internal/socket/sys_go1_11_darwin.go b/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.go similarity index 52% rename from vendor/golang.org/x/net/internal/socket/sys_go1_11_darwin.go rename to vendor/golang.org/x/net/internal/socket/sys_zos_s390x.go index 02d2b3cc83..1e38b92232 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_go1_11_darwin.go +++ b/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.go @@ -1,9 +1,7 @@ -// Copyright 2018 The Go Authors. All rights reserved. +// Copyright 2020 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !go1.12 - package socket import ( @@ -11,23 +9,30 @@ import ( "unsafe" ) +func syscall_syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) +func syscall_syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) + +func probeProtocolStack() int { + return 4 // sizeof(int) on GOOS=zos GOARCH=s390x +} + func getsockopt(s uintptr, level, name int, b []byte) (int, error) { l := uint32(len(b)) - _, _, errno := syscall.Syscall6(syscall.SYS_GETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(unsafe.Pointer(&l)), 0) + _, _, errno := syscall_syscall6(syscall.SYS_GETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(unsafe.Pointer(&l)), 0) return int(l), errnoErr(errno) } func setsockopt(s uintptr, level, name int, b []byte) error { - _, _, errno := syscall.Syscall6(syscall.SYS_SETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), 0) + _, _, errno := syscall_syscall6(syscall.SYS_SETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), 0) return errnoErr(errno) } func recvmsg(s uintptr, h *msghdr, flags int) (int, error) { - n, _, errno := syscall.Syscall(syscall.SYS_RECVMSG, s, uintptr(unsafe.Pointer(h)), uintptr(flags)) + n, _, errno := syscall_syscall(syscall.SYS___RECVMSG_A, s, uintptr(unsafe.Pointer(h)), uintptr(flags)) return int(n), errnoErr(errno) } func sendmsg(s uintptr, h *msghdr, flags int) (int, error) { - n, _, errno := syscall.Syscall(syscall.SYS_SENDMSG, s, uintptr(unsafe.Pointer(h)), uintptr(flags)) + n, _, errno := syscall_syscall(syscall.SYS___SENDMSG_A, s, uintptr(unsafe.Pointer(h)), uintptr(flags)) return int(n), errnoErr(errno) } diff --git a/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.s b/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.s new file mode 100644 index 0000000000..60d5839c25 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.s @@ -0,0 +1,11 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "textflag.h" + +TEXT ·syscall_syscall(SB),NOSPLIT,$0 + JMP syscall·_syscall(SB) + +TEXT ·syscall_syscall6(SB),NOSPLIT,$0 + JMP syscall·_syscall6(SB) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go b/vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go index e740c8f024..79f3bdd5b9 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go @@ -2,6 +2,7 @@ // cgo -godefs defs_aix.go // Added for go1.11 compatibility +//go:build aix // +build aix package socket @@ -51,9 +52,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - sizeofCmsghdr = 0xc + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c diff --git a/vendor/golang.org/x/net/internal/socket/zsys_darwin_386.go b/vendor/golang.org/x/net/internal/socket/zsys_darwin_386.go index 083bda51c3..150f980f52 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_darwin_386.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_darwin_386.go @@ -42,9 +42,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c diff --git a/vendor/golang.org/x/net/internal/socket/zsys_darwin_amd64.go b/vendor/golang.org/x/net/internal/socket/zsys_darwin_amd64.go index 55c6c9f577..a686c95285 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_darwin_amd64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_darwin_amd64.go @@ -44,9 +44,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - sizeofCmsghdr = 0xc + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c diff --git a/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm.go b/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm.go index 083bda51c3..150f980f52 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm.go @@ -42,9 +42,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c diff --git a/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm64.go b/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm64.go index 55c6c9f577..a686c95285 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm64.go @@ -44,9 +44,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - sizeofCmsghdr = 0xc + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c diff --git a/vendor/golang.org/x/net/internal/socket/zsys_dragonfly_amd64.go b/vendor/golang.org/x/net/internal/socket/zsys_dragonfly_amd64.go index 8b7d161d7d..d45c197e26 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_dragonfly_amd64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_dragonfly_amd64.go @@ -44,9 +44,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - sizeofCmsghdr = 0xc + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c diff --git a/vendor/golang.org/x/net/internal/socket/zsys_freebsd_386.go b/vendor/golang.org/x/net/internal/socket/zsys_freebsd_386.go index 3e71ff5743..ffec860ea8 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_freebsd_386.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_freebsd_386.go @@ -42,9 +42,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c diff --git a/vendor/golang.org/x/net/internal/socket/zsys_freebsd_amd64.go b/vendor/golang.org/x/net/internal/socket/zsys_freebsd_amd64.go index 238d90de62..aa701ab676 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_freebsd_amd64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_freebsd_amd64.go @@ -44,9 +44,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - sizeofCmsghdr = 0xc + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c diff --git a/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm.go b/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm.go index 3e71ff5743..ffec860ea8 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm.go @@ -42,9 +42,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c diff --git a/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm64.go b/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm64.go index 238d90de62..aa701ab676 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm64.go @@ -44,9 +44,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - sizeofCmsghdr = 0xc + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_386.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_386.go index d33025b70d..0c847bee7a 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_linux_386.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_386.go @@ -45,9 +45,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go index b20d216774..15e2aecaab 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go @@ -48,9 +48,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x38 - sizeofCmsghdr = 0x10 + sizeofIovec = 0x10 + sizeofMsghdr = 0x38 sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go index 1bb10a4289..0c847bee7a 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go @@ -48,8 +48,6 @@ const ( sizeofIovec = 0x8 sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc - sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c ) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go index 7f6e8a7fa4..15e2aecaab 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go @@ -51,8 +51,6 @@ const ( sizeofIovec = 0x10 sizeofMsghdr = 0x38 - sizeofCmsghdr = 0x10 - sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c ) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go index 1bb10a4289..0c847bee7a 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go @@ -48,8 +48,6 @@ const ( sizeofIovec = 0x8 sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc - sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c ) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go index 7f6e8a7fa4..15e2aecaab 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go @@ -51,8 +51,6 @@ const ( sizeofIovec = 0x10 sizeofMsghdr = 0x38 - sizeofCmsghdr = 0x10 - sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c ) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go index 7f6e8a7fa4..15e2aecaab 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go @@ -51,8 +51,6 @@ const ( sizeofIovec = 0x10 sizeofMsghdr = 0x38 - sizeofCmsghdr = 0x10 - sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c ) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go index 1bb10a4289..0c847bee7a 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go @@ -48,8 +48,6 @@ const ( sizeofIovec = 0x8 sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc - sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c ) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go index 7f6e8a7fa4..15e2aecaab 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go @@ -51,8 +51,6 @@ const ( sizeofIovec = 0x10 sizeofMsghdr = 0x38 - sizeofCmsghdr = 0x10 - sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c ) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go index 7f6e8a7fa4..15e2aecaab 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go @@ -51,8 +51,6 @@ const ( sizeofIovec = 0x10 sizeofMsghdr = 0x38 - sizeofCmsghdr = 0x10 - sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c ) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go index f12a1d7682..12ec2e42b8 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go @@ -1,6 +1,7 @@ // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_linux.go +//go:build riscv64 // +build riscv64 package socket @@ -52,8 +53,6 @@ const ( sizeofIovec = 0x10 sizeofMsghdr = 0x38 - sizeofCmsghdr = 0x10 - sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c ) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go index 7f6e8a7fa4..15e2aecaab 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go @@ -51,8 +51,6 @@ const ( sizeofIovec = 0x10 sizeofMsghdr = 0x38 - sizeofCmsghdr = 0x10 - sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c ) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go index 7e258cec29..6b72d24dd9 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go @@ -50,8 +50,6 @@ const ( sizeofIovec = 0x8 sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc - sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c ) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go index b3f9c0d7e5..9aaa4ab1ca 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go @@ -53,8 +53,6 @@ const ( sizeofIovec = 0x10 sizeofMsghdr = 0x30 - sizeofCmsghdr = 0xc - sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c ) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go index 7e258cec29..6b72d24dd9 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go @@ -50,8 +50,6 @@ const ( sizeofIovec = 0x8 sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc - sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c ) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm64.go b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm64.go index da26ef019c..9aaa4ab1ca 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm64.go @@ -50,9 +50,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - sizeofCmsghdr = 0xc + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c diff --git a/vendor/golang.org/x/net/internal/socket/zsys_openbsd_386.go b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_386.go index 73655a14c4..3ec8d42fee 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_openbsd_386.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_386.go @@ -42,9 +42,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c diff --git a/vendor/golang.org/x/net/internal/socket/zsys_openbsd_amd64.go b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_amd64.go index 0a4de80f23..ea0ee008d7 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_openbsd_amd64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_amd64.go @@ -44,9 +44,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - sizeofCmsghdr = 0xc + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c diff --git a/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm.go b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm.go index 73655a14c4..3ec8d42fee 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm.go @@ -42,9 +42,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x8 - sizeofMsghdr = 0x1c - sizeofCmsghdr = 0xc + sizeofIovec = 0x8 + sizeofMsghdr = 0x1c sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c diff --git a/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm64.go b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm64.go index 0a4de80f23..ea0ee008d7 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm64.go @@ -44,9 +44,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - sizeofCmsghdr = 0xc + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x1c diff --git a/vendor/golang.org/x/net/internal/socket/zsys_openbsd_mips64.go b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_mips64.go new file mode 100644 index 0000000000..0112832400 --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_mips64.go @@ -0,0 +1,50 @@ +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs defs_openbsd.go + +package socket + +type iovec struct { + Base *byte + Len uint64 +} + +type msghdr struct { + Name *byte + Namelen uint32 + Iov *iovec + Iovlen uint32 + Control *byte + Controllen uint32 + Flags int32 +} + +type cmsghdr struct { + Len uint32 + Level int32 + Type int32 +} + +type sockaddrInet struct { + Len uint8 + Family uint8 + Port uint16 + Addr [4]byte /* in_addr */ + Zero [8]int8 +} + +type sockaddrInet6 struct { + Len uint8 + Family uint8 + Port uint16 + Flowinfo uint32 + Addr [16]byte /* in6_addr */ + Scope_id uint32 +} + +const ( + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 + + sizeofSockaddrInet = 0x10 + sizeofSockaddrInet6 = 0x1c +) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_solaris_amd64.go b/vendor/golang.org/x/net/internal/socket/zsys_solaris_amd64.go index 353cd5fb4e..48b2b591f6 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_solaris_amd64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_solaris_amd64.go @@ -43,9 +43,8 @@ type sockaddrInet6 struct { } const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - sizeofCmsghdr = 0xc + sizeofIovec = 0x10 + sizeofMsghdr = 0x30 sizeofSockaddrInet = 0x10 sizeofSockaddrInet6 = 0x20 diff --git a/vendor/golang.org/x/net/internal/socket/zsys_zos_s390x.go b/vendor/golang.org/x/net/internal/socket/zsys_zos_s390x.go new file mode 100644 index 0000000000..514ca3754d --- /dev/null +++ b/vendor/golang.org/x/net/internal/socket/zsys_zos_s390x.go @@ -0,0 +1,32 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package socket + +type iovec struct { + Base *byte + Len uint64 +} + +type msghdr struct { + Name *byte + Iov *iovec + Control *byte + Flags int32 + Namelen uint32 + Iovlen int32 + Controllen uint32 +} + +type cmsghdr struct { + Len int32 + Level int32 + Type int32 +} + +const ( + sizeofCmsghdr = 12 + sizeofSockaddrInet = 16 + sizeofSockaddrInet6 = 28 +) diff --git a/vendor/golang.org/x/net/ipv4/control_bsd.go b/vendor/golang.org/x/net/ipv4/control_bsd.go index 69c4f553cd..b7385dfd95 100644 --- a/vendor/golang.org/x/net/ipv4/control_bsd.go +++ b/vendor/golang.org/x/net/ipv4/control_bsd.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || darwin || dragonfly || freebsd || netbsd || openbsd // +build aix darwin dragonfly freebsd netbsd openbsd package ipv4 @@ -13,11 +14,13 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" ) func marshalDst(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIP, sysIP_RECVDSTADDR, net.IPv4len) + m.MarshalHeader(iana.ProtocolIP, unix.IP_RECVDSTADDR, net.IPv4len) return m.Next(net.IPv4len) } @@ -30,7 +33,7 @@ func parseDst(cm *ControlMessage, b []byte) { func marshalInterface(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIP, sysIP_RECVIF, syscall.SizeofSockaddrDatalink) + m.MarshalHeader(iana.ProtocolIP, sockoptReceiveInterface, syscall.SizeofSockaddrDatalink) return m.Next(syscall.SizeofSockaddrDatalink) } diff --git a/vendor/golang.org/x/net/ipv4/control_pktinfo.go b/vendor/golang.org/x/net/ipv4/control_pktinfo.go index 425338f35b..0e748dbdc4 100644 --- a/vendor/golang.org/x/net/ipv4/control_pktinfo.go +++ b/vendor/golang.org/x/net/ipv4/control_pktinfo.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build darwin || linux || solaris // +build darwin linux solaris package ipv4 @@ -12,11 +13,13 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" ) func marshalPacketInfo(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIP, sysIP_PKTINFO, sizeofInetPktinfo) + m.MarshalHeader(iana.ProtocolIP, unix.IP_PKTINFO, sizeofInetPktinfo) if cm != nil { pi := (*inetPktinfo)(unsafe.Pointer(&m.Data(sizeofInetPktinfo)[0])) if ip := cm.Src.To4(); ip != nil { diff --git a/vendor/golang.org/x/net/ipv4/control_stub.go b/vendor/golang.org/x/net/ipv4/control_stub.go index a0c049d683..f27322c3ed 100644 --- a/vendor/golang.org/x/net/ipv4/control_stub.go +++ b/vendor/golang.org/x/net/ipv4/control_stub.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/control_unix.go b/vendor/golang.org/x/net/ipv4/control_unix.go index b27fa4903a..2413e02f8f 100644 --- a/vendor/golang.org/x/net/ipv4/control_unix.go +++ b/vendor/golang.org/x/net/ipv4/control_unix.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package ipv4 @@ -11,6 +12,8 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" ) func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error { @@ -64,7 +67,7 @@ func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) er func marshalTTL(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIP, sysIP_RECVTTL, 1) + m.MarshalHeader(iana.ProtocolIP, unix.IP_RECVTTL, 1) return m.Next(1) } diff --git a/vendor/golang.org/x/net/ipv4/control_zos.go b/vendor/golang.org/x/net/ipv4/control_zos.go new file mode 100644 index 0000000000..de11c42e55 --- /dev/null +++ b/vendor/golang.org/x/net/ipv4/control_zos.go @@ -0,0 +1,88 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ipv4 + +import ( + "net" + "unsafe" + + "golang.org/x/net/internal/iana" + "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" +) + +func marshalPacketInfo(b []byte, cm *ControlMessage) []byte { + m := socket.ControlMessage(b) + m.MarshalHeader(iana.ProtocolIP, unix.IP_PKTINFO, sizeofInetPktinfo) + if cm != nil { + pi := (*inetPktinfo)(unsafe.Pointer(&m.Data(sizeofInetPktinfo)[0])) + if ip := cm.Src.To4(); ip != nil { + copy(pi.Addr[:], ip) + } + if cm.IfIndex > 0 { + pi.setIfindex(cm.IfIndex) + } + } + return m.Next(sizeofInetPktinfo) +} + +func parsePacketInfo(cm *ControlMessage, b []byte) { + pi := (*inetPktinfo)(unsafe.Pointer(&b[0])) + cm.IfIndex = int(pi.Ifindex) + if len(cm.Dst) < net.IPv4len { + cm.Dst = make(net.IP, net.IPv4len) + } + copy(cm.Dst, pi.Addr[:]) +} + +func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error { + opt.Lock() + defer opt.Unlock() + if so, ok := sockOpts[ssoReceiveTTL]; ok && cf&FlagTTL != 0 { + if err := so.SetInt(c, boolint(on)); err != nil { + return err + } + if on { + opt.set(FlagTTL) + } else { + opt.clear(FlagTTL) + } + } + if so, ok := sockOpts[ssoPacketInfo]; ok { + if cf&(FlagSrc|FlagDst|FlagInterface) != 0 { + if err := so.SetInt(c, boolint(on)); err != nil { + return err + } + if on { + opt.set(cf & (FlagSrc | FlagDst | FlagInterface)) + } else { + opt.clear(cf & (FlagSrc | FlagDst | FlagInterface)) + } + } + } else { + if so, ok := sockOpts[ssoReceiveDst]; ok && cf&FlagDst != 0 { + if err := so.SetInt(c, boolint(on)); err != nil { + return err + } + if on { + opt.set(FlagDst) + } else { + opt.clear(FlagDst) + } + } + if so, ok := sockOpts[ssoReceiveInterface]; ok && cf&FlagInterface != 0 { + if err := so.SetInt(c, boolint(on)); err != nil { + return err + } + if on { + opt.set(FlagInterface) + } else { + opt.clear(FlagInterface) + } + } + } + return nil +} diff --git a/vendor/golang.org/x/net/ipv4/header.go b/vendor/golang.org/x/net/ipv4/header.go index c271ca46cb..a00a3eaff9 100644 --- a/vendor/golang.org/x/net/ipv4/header.go +++ b/vendor/golang.org/x/net/ipv4/header.go @@ -67,7 +67,7 @@ func (h *Header) Marshal() ([]byte, error) { b[1] = byte(h.TOS) flagsAndFragOff := (h.FragOff & 0x1fff) | int(h.Flags<<13) switch runtime.GOOS { - case "darwin", "dragonfly", "netbsd": + case "darwin", "ios", "dragonfly", "netbsd": socket.NativeEndian.PutUint16(b[2:4], uint16(h.TotalLen)) socket.NativeEndian.PutUint16(b[6:8], uint16(flagsAndFragOff)) case "freebsd": @@ -126,7 +126,7 @@ func (h *Header) Parse(b []byte) error { h.Src = net.IPv4(b[12], b[13], b[14], b[15]) h.Dst = net.IPv4(b[16], b[17], b[18], b[19]) switch runtime.GOOS { - case "darwin", "dragonfly", "netbsd": + case "darwin", "ios", "dragonfly", "netbsd": h.TotalLen = int(socket.NativeEndian.Uint16(b[2:4])) + hdrlen h.FragOff = int(socket.NativeEndian.Uint16(b[6:8])) case "freebsd": diff --git a/vendor/golang.org/x/net/ipv4/icmp_stub.go b/vendor/golang.org/x/net/ipv4/icmp_stub.go index 21bb29ab36..cd4ee6e1c9 100644 --- a/vendor/golang.org/x/net/ipv4/icmp_stub.go +++ b/vendor/golang.org/x/net/ipv4/icmp_stub.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !linux // +build !linux package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/payload_cmsg.go b/vendor/golang.org/x/net/ipv4/payload_cmsg.go index e7614661d7..1bb370e25f 100644 --- a/vendor/golang.org/x/net/ipv4/payload_cmsg.go +++ b/vendor/golang.org/x/net/ipv4/payload_cmsg.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/payload_nocmsg.go b/vendor/golang.org/x/net/ipv4/payload_nocmsg.go index 1116256f24..53f0794eb7 100644 --- a/vendor/golang.org/x/net/ipv4/payload_nocmsg.go +++ b/vendor/golang.org/x/net/ipv4/payload_nocmsg.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!zos package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sockopt_posix.go b/vendor/golang.org/x/net/ipv4/sockopt_posix.go index dea64519d8..eb07c1c02a 100644 --- a/vendor/golang.org/x/net/ipv4/sockopt_posix.go +++ b/vendor/golang.org/x/net/ipv4/sockopt_posix.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || windows || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows zos package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sockopt_stub.go b/vendor/golang.org/x/net/ipv4/sockopt_stub.go index 37d4806b34..cf036893b7 100644 --- a/vendor/golang.org/x/net/ipv4/sockopt_stub.go +++ b/vendor/golang.org/x/net/ipv4/sockopt_stub.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_aix.go b/vendor/golang.org/x/net/ipv4/sys_aix.go index 3d1201e6d7..02730cdfd2 100644 --- a/vendor/golang.org/x/net/ipv4/sys_aix.go +++ b/vendor/golang.org/x/net/ipv4/sys_aix.go @@ -3,6 +3,7 @@ // license that can be found in the LICENSE file. // Added for go1.11 compatibility +//go:build aix // +build aix package ipv4 @@ -13,26 +14,31 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" ) +// IP_RECVIF is defined on AIX but doesn't work. IP_RECVINTERFACE must be used instead. +const sockoptReceiveInterface = unix.IP_RECVINTERFACE + var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL}, - ctlDst: {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, - ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, + ctlTTL: {unix.IP_RECVTTL, 1, marshalTTL, parseTTL}, + ctlDst: {unix.IP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, + ctlInterface: {unix.IP_RECVINTERFACE, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, } sockOpts = map[int]*sockOpt{ - ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, - ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, - ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 1}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 1}}, - ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}}, - ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVDSTADDR, Len: 4}}, - ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVIF, Len: 4}}, - ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, + ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TOS, Len: 4}}, + ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TTL, Len: 4}}, + ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_TTL, Len: 1}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_LOOP, Len: 1}}, + ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVTTL, Len: 4}}, + ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVDSTADDR, Len: 4}}, + ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVINTERFACE, Len: 4}}, + ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_HDRINCL, Len: 4}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, } ) diff --git a/vendor/golang.org/x/net/ipv4/sys_asmreq.go b/vendor/golang.org/x/net/ipv4/sys_asmreq.go index 76d670acaa..22322b387e 100644 --- a/vendor/golang.org/x/net/ipv4/sys_asmreq.go +++ b/vendor/golang.org/x/net/ipv4/sys_asmreq.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || darwin || dragonfly || freebsd || netbsd || openbsd || solaris || windows // +build aix darwin dragonfly freebsd netbsd openbsd solaris windows package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_asmreq_stub.go b/vendor/golang.org/x/net/ipv4/sys_asmreq_stub.go index 6dc339ce67..fde640142d 100644 --- a/vendor/golang.org/x/net/ipv4/sys_asmreq_stub.go +++ b/vendor/golang.org/x/net/ipv4/sys_asmreq_stub.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !aix && !darwin && !dragonfly && !freebsd && !netbsd && !openbsd && !solaris && !windows // +build !aix,!darwin,!dragonfly,!freebsd,!netbsd,!openbsd,!solaris,!windows package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_asmreqn.go b/vendor/golang.org/x/net/ipv4/sys_asmreqn.go index 1f24f69f3b..fbfe4af69d 100644 --- a/vendor/golang.org/x/net/ipv4/sys_asmreqn.go +++ b/vendor/golang.org/x/net/ipv4/sys_asmreqn.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build darwin || freebsd || linux // +build darwin freebsd linux package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_asmreqn_stub.go b/vendor/golang.org/x/net/ipv4/sys_asmreqn_stub.go index 48ef55624e..dcb15f25a5 100644 --- a/vendor/golang.org/x/net/ipv4/sys_asmreqn_stub.go +++ b/vendor/golang.org/x/net/ipv4/sys_asmreqn_stub.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !darwin && !freebsd && !linux // +build !darwin,!freebsd,!linux package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_bpf.go b/vendor/golang.org/x/net/ipv4/sys_bpf.go index 5c03dce3b7..fb11e324e2 100644 --- a/vendor/golang.org/x/net/ipv4/sys_bpf.go +++ b/vendor/golang.org/x/net/ipv4/sys_bpf.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux // +build linux package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_bpf_stub.go b/vendor/golang.org/x/net/ipv4/sys_bpf_stub.go index 5c98642716..fc53a0d33a 100644 --- a/vendor/golang.org/x/net/ipv4/sys_bpf_stub.go +++ b/vendor/golang.org/x/net/ipv4/sys_bpf_stub.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !linux // +build !linux package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_bsd.go b/vendor/golang.org/x/net/ipv4/sys_bsd.go index 58256dd9d6..e191b2f14f 100644 --- a/vendor/golang.org/x/net/ipv4/sys_bsd.go +++ b/vendor/golang.org/x/net/ipv4/sys_bsd.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build netbsd || openbsd // +build netbsd openbsd package ipv4 @@ -12,26 +13,30 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" ) +const sockoptReceiveInterface = unix.IP_RECVIF + var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL}, - ctlDst: {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, - ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, + ctlTTL: {unix.IP_RECVTTL, 1, marshalTTL, parseTTL}, + ctlDst: {unix.IP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, + ctlInterface: {unix.IP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, } sockOpts = map[int]*sockOpt{ - ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, - ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, - ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 1}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 1}}, - ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}}, - ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVDSTADDR, Len: 4}}, - ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVIF, Len: 4}}, - ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, + ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TOS, Len: 4}}, + ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TTL, Len: 4}}, + ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_TTL, Len: 1}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_LOOP, Len: 1}}, + ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVTTL, Len: 4}}, + ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVDSTADDR, Len: 4}}, + ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVIF, Len: 4}}, + ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_HDRINCL, Len: 4}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, } ) diff --git a/vendor/golang.org/x/net/ipv4/sys_darwin.go b/vendor/golang.org/x/net/ipv4/sys_darwin.go index ac213c7350..c5527acf62 100644 --- a/vendor/golang.org/x/net/ipv4/sys_darwin.go +++ b/vendor/golang.org/x/net/ipv4/sys_darwin.go @@ -11,34 +11,38 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" ) +const sockoptReceiveInterface = unix.IP_RECVIF + var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL}, - ctlDst: {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, - ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, - ctlPacketInfo: {sysIP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo}, + ctlTTL: {unix.IP_RECVTTL, 1, marshalTTL, parseTTL}, + ctlDst: {unix.IP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, + ctlInterface: {unix.IP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, + ctlPacketInfo: {unix.IP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo}, } sockOpts = map[int]*sockOpt{ - ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, - ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, - ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 1}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: sizeofIPMreqn}, typ: ssoTypeIPMreqn}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}}, - ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVDSTADDR, Len: 4}}, - ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVIF, Len: 4}}, - ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, - ssoStripHeader: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_STRIPHDR, Len: 4}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoPacketInfo: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVPKTINFO, Len: 4}}, + ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TOS, Len: 4}}, + ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TTL, Len: 4}}, + ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_TTL, Len: 1}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: sizeofIPMreqn}, typ: ssoTypeIPMreqn}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVTTL, Len: 4}}, + ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVDSTADDR, Len: 4}}, + ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVIF, Len: 4}}, + ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_HDRINCL, Len: 4}}, + ssoStripHeader: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_STRIPHDR, Len: 4}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoPacketInfo: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVPKTINFO, Len: 4}}, } ) diff --git a/vendor/golang.org/x/net/ipv4/sys_dragonfly.go b/vendor/golang.org/x/net/ipv4/sys_dragonfly.go index 859764f33a..0620d0e1ea 100644 --- a/vendor/golang.org/x/net/ipv4/sys_dragonfly.go +++ b/vendor/golang.org/x/net/ipv4/sys_dragonfly.go @@ -10,26 +10,30 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" ) +const sockoptReceiveInterface = unix.IP_RECVIF + var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL}, - ctlDst: {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, - ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, + ctlTTL: {unix.IP_RECVTTL, 1, marshalTTL, parseTTL}, + ctlDst: {unix.IP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, + ctlInterface: {unix.IP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, } sockOpts = map[int]*sockOpt{ - ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, - ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, - ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 1}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}}, - ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVDSTADDR, Len: 4}}, - ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVIF, Len: 4}}, - ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, + ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TOS, Len: 4}}, + ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TTL, Len: 4}}, + ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_TTL, Len: 1}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVTTL, Len: 4}}, + ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVDSTADDR, Len: 4}}, + ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVIF, Len: 4}}, + ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_HDRINCL, Len: 4}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, } ) diff --git a/vendor/golang.org/x/net/ipv4/sys_freebsd.go b/vendor/golang.org/x/net/ipv4/sys_freebsd.go index 482873d9a1..7457bfde92 100644 --- a/vendor/golang.org/x/net/ipv4/sys_freebsd.go +++ b/vendor/golang.org/x/net/ipv4/sys_freebsd.go @@ -13,38 +13,42 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" ) +const sockoptReceiveInterface = unix.IP_RECVIF + var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL}, - ctlDst: {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, - ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, + ctlTTL: {unix.IP_RECVTTL, 1, marshalTTL, parseTTL}, + ctlDst: {unix.IP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, + ctlInterface: {unix.IP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, } sockOpts = map[int]*sockOpt{ - ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, - ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, - ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 1}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}}, - ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVDSTADDR, Len: 4}}, - ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVIF, Len: 4}}, - ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TOS, Len: 4}}, + ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TTL, Len: 4}}, + ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_TTL, Len: 1}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVTTL, Len: 4}}, + ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVDSTADDR, Len: 4}}, + ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVIF, Len: 4}}, + ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_HDRINCL, Len: 4}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, } ) func init() { freebsdVersion, _ = syscall.SysctlUint32("kern.osreldate") if freebsdVersion >= 1000000 { - sockOpts[ssoMulticastInterface] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: sizeofIPMreqn}, typ: ssoTypeIPMreqn} + sockOpts[ssoMulticastInterface] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: sizeofIPMreqn}, typ: ssoTypeIPMreqn} } if runtime.GOOS == "freebsd" && runtime.GOARCH == "386" { archs, _ := syscall.Sysctl("kern.supported_archs") diff --git a/vendor/golang.org/x/net/ipv4/sys_linux.go b/vendor/golang.org/x/net/ipv4/sys_linux.go index cf755c7fba..a0631ac92e 100644 --- a/vendor/golang.org/x/net/ipv4/sys_linux.go +++ b/vendor/golang.org/x/net/ipv4/sys_linux.go @@ -11,31 +11,32 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + "golang.org/x/sys/unix" ) var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {sysIP_TTL, 1, marshalTTL, parseTTL}, - ctlPacketInfo: {sysIP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo}, + ctlTTL: {unix.IP_TTL, 1, marshalTTL, parseTTL}, + ctlPacketInfo: {unix.IP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo}, } sockOpts = map[int]*sockOpt{ - ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, - ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, - ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: sizeofIPMreqn}, typ: ssoTypeIPMreqn}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}}, - ssoPacketInfo: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_PKTINFO, Len: 4}}, - ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, - ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolReserved, Name: sysICMP_FILTER, Len: sizeofICMPFilter}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TOS, Len: 4}}, + ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TTL, Len: 4}}, + ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_TTL, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: sizeofIPMreqn}, typ: ssoTypeIPMreqn}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVTTL, Len: 4}}, + ssoPacketInfo: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_PKTINFO, Len: 4}}, + ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_HDRINCL, Len: 4}}, + ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolReserved, Name: unix.ICMP_FILTER, Len: sizeofICMPFilter}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, ssoAttachFilter: {Option: socket.Option{Level: unix.SOL_SOCKET, Name: unix.SO_ATTACH_FILTER, Len: unix.SizeofSockFprog}}, } ) diff --git a/vendor/golang.org/x/net/ipv4/sys_solaris.go b/vendor/golang.org/x/net/ipv4/sys_solaris.go index 832fef1e2e..0bb9f3e364 100644 --- a/vendor/golang.org/x/net/ipv4/sys_solaris.go +++ b/vendor/golang.org/x/net/ipv4/sys_solaris.go @@ -11,29 +11,33 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" ) +const sockoptReceiveInterface = unix.IP_RECVIF + var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {sysIP_RECVTTL, 4, marshalTTL, parseTTL}, - ctlPacketInfo: {sysIP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo}, + ctlTTL: {unix.IP_RECVTTL, 4, marshalTTL, parseTTL}, + ctlPacketInfo: {unix.IP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo}, } sockOpts = map[int]sockOpt{ - ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, - ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, - ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 1}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 1}}, - ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}}, - ssoPacketInfo: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVPKTINFO, Len: 4}}, - ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TOS, Len: 4}}, + ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TTL, Len: 4}}, + ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_TTL, Len: 1}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_LOOP, Len: 1}}, + ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVTTL, Len: 4}}, + ssoPacketInfo: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVPKTINFO, Len: 4}}, + ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_HDRINCL, Len: 4}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, } ) diff --git a/vendor/golang.org/x/net/ipv4/sys_ssmreq.go b/vendor/golang.org/x/net/ipv4/sys_ssmreq.go index eeced7f313..6a4e7abf9b 100644 --- a/vendor/golang.org/x/net/ipv4/sys_ssmreq.go +++ b/vendor/golang.org/x/net/ipv4/sys_ssmreq.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build darwin || freebsd || linux || solaris // +build darwin freebsd linux solaris package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_ssmreq_stub.go b/vendor/golang.org/x/net/ipv4/sys_ssmreq_stub.go index c0921674b0..157159fd50 100644 --- a/vendor/golang.org/x/net/ipv4/sys_ssmreq_stub.go +++ b/vendor/golang.org/x/net/ipv4/sys_ssmreq_stub.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !darwin && !freebsd && !linux && !solaris // +build !darwin,!freebsd,!linux,!solaris package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_stub.go b/vendor/golang.org/x/net/ipv4/sys_stub.go index b9c85b334f..d550851658 100644 --- a/vendor/golang.org/x/net/ipv4/sys_stub.go +++ b/vendor/golang.org/x/net/ipv4/sys_stub.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_windows.go b/vendor/golang.org/x/net/ipv4/sys_windows.go index b0913d539c..c5e950633c 100644 --- a/vendor/golang.org/x/net/ipv4/sys_windows.go +++ b/vendor/golang.org/x/net/ipv4/sys_windows.go @@ -7,34 +7,15 @@ package ipv4 import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/windows" ) const ( - // See ws2tcpip.h. - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_MULTICAST_IF = 0x9 - sysIP_MULTICAST_TTL = 0xa - sysIP_MULTICAST_LOOP = 0xb - sysIP_ADD_MEMBERSHIP = 0xc - sysIP_DROP_MEMBERSHIP = 0xd - sysIP_DONTFRAGMENT = 0xe - sysIP_ADD_SOURCE_MEMBERSHIP = 0xf - sysIP_DROP_SOURCE_MEMBERSHIP = 0x10 - sysIP_PKTINFO = 0x13 - - sizeofInetPktinfo = 0x8 sizeofIPMreq = 0x8 sizeofIPMreqSource = 0xc ) -type inetPktinfo struct { - Addr [4]byte - Ifindex int32 -} - type ipMreq struct { Multiaddr [4]byte Interface [4]byte @@ -51,17 +32,13 @@ var ( ctlOpts = [ctlMax]ctlOpt{} sockOpts = map[int]*sockOpt{ - ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, - ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, - ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 4}}, - ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, + ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: windows.IP_TOS, Len: 4}}, + ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: windows.IP_TTL, Len: 4}}, + ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: windows.IP_MULTICAST_TTL, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: windows.IP_MULTICAST_IF, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: windows.IP_MULTICAST_LOOP, Len: 4}}, + ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: windows.IP_HDRINCL, Len: 4}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: windows.IP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: windows.IP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, } ) - -func (pi *inetPktinfo) setIfindex(i int) { - pi.Ifindex = int32(i) -} diff --git a/vendor/golang.org/x/net/ipv4/sys_zos.go b/vendor/golang.org/x/net/ipv4/sys_zos.go new file mode 100644 index 0000000000..be20640987 --- /dev/null +++ b/vendor/golang.org/x/net/ipv4/sys_zos.go @@ -0,0 +1,57 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ipv4 + +import ( + "net" + "syscall" + "unsafe" + + "golang.org/x/net/internal/iana" + "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" +) + +var ( + ctlOpts = [ctlMax]ctlOpt{ + ctlPacketInfo: {unix.IP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo}, + } + + sockOpts = map[int]*sockOpt{ + ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_TTL, Len: 1}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_LOOP, Len: 1}}, + ssoPacketInfo: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVPKTINFO, Len: 4}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + } +) + +func (pi *inetPktinfo) setIfindex(i int) { + pi.Ifindex = uint32(i) +} + +func (gr *groupReq) setGroup(grp net.IP) { + sa := (*sockaddrInet4)(unsafe.Pointer(&gr.Group)) + sa.Family = syscall.AF_INET + sa.Len = sizeofSockaddrInet4 + copy(sa.Addr[:], grp) +} + +func (gsr *groupSourceReq) setSourceGroup(grp, src net.IP) { + sa := (*sockaddrInet4)(unsafe.Pointer(&gsr.Group)) + sa.Family = syscall.AF_INET + sa.Len = sizeofSockaddrInet4 + copy(sa.Addr[:], grp) + sa = (*sockaddrInet4)(unsafe.Pointer(&gsr.Source)) + sa.Family = syscall.AF_INET + sa.Len = sizeofSockaddrInet4 + copy(sa.Addr[:], src) +} diff --git a/vendor/golang.org/x/net/ipv4/zsys_aix_ppc64.go b/vendor/golang.org/x/net/ipv4/zsys_aix_ppc64.go index c741d5c8ea..b7f2d6e5c1 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_aix_ppc64.go +++ b/vendor/golang.org/x/net/ipv4/zsys_aix_ppc64.go @@ -2,28 +2,12 @@ // cgo -godefs defs_aix.go // Added for go1.11 compatibility +//go:build aix // +build aix package ipv4 const ( - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_RECVOPTS = 0x5 - sysIP_RECVRETOPTS = 0x6 - sysIP_RECVDSTADDR = 0x7 - sysIP_RETOPTS = 0x8 - sysIP_RECVIF = 0x20 - sysIP_RECVTTL = 0x22 - - sysIP_MULTICAST_IF = 0x9 - sysIP_MULTICAST_TTL = 0xa - sysIP_MULTICAST_LOOP = 0xb - sysIP_ADD_MEMBERSHIP = 0xc - sysIP_DROP_MEMBERSHIP = 0xd - sizeofIPMreq = 0x8 ) diff --git a/vendor/golang.org/x/net/ipv4/zsys_darwin.go b/vendor/golang.org/x/net/ipv4/zsys_darwin.go index e05a251ba0..9c35f97675 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_darwin.go +++ b/vendor/golang.org/x/net/ipv4/zsys_darwin.go @@ -4,39 +4,6 @@ package ipv4 const ( - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_RECVOPTS = 0x5 - sysIP_RECVRETOPTS = 0x6 - sysIP_RECVDSTADDR = 0x7 - sysIP_RETOPTS = 0x8 - sysIP_RECVIF = 0x14 - sysIP_STRIPHDR = 0x17 - sysIP_RECVTTL = 0x18 - sysIP_BOUND_IF = 0x19 - sysIP_PKTINFO = 0x1a - sysIP_RECVPKTINFO = 0x1a - - sysIP_MULTICAST_IF = 0x9 - sysIP_MULTICAST_TTL = 0xa - sysIP_MULTICAST_LOOP = 0xb - sysIP_ADD_MEMBERSHIP = 0xc - sysIP_DROP_MEMBERSHIP = 0xd - sysIP_MULTICAST_VIF = 0xe - sysIP_MULTICAST_IFINDEX = 0x42 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x46 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x47 - sysIP_BLOCK_SOURCE = 0x48 - sysIP_UNBLOCK_SOURCE = 0x49 - sysMCAST_JOIN_GROUP = 0x50 - sysMCAST_LEAVE_GROUP = 0x51 - sysMCAST_JOIN_SOURCE_GROUP = 0x52 - sysMCAST_LEAVE_SOURCE_GROUP = 0x53 - sysMCAST_BLOCK_SOURCE = 0x54 - sysMCAST_UNBLOCK_SOURCE = 0x55 - sizeofSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_dragonfly.go b/vendor/golang.org/x/net/ipv4/zsys_dragonfly.go index 6d65e9fcb8..2155df130a 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_dragonfly.go +++ b/vendor/golang.org/x/net/ipv4/zsys_dragonfly.go @@ -4,24 +4,6 @@ package ipv4 const ( - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_RECVOPTS = 0x5 - sysIP_RECVRETOPTS = 0x6 - sysIP_RECVDSTADDR = 0x7 - sysIP_RETOPTS = 0x8 - sysIP_RECVIF = 0x14 - sysIP_RECVTTL = 0x41 - - sysIP_MULTICAST_IF = 0x9 - sysIP_MULTICAST_TTL = 0xa - sysIP_MULTICAST_LOOP = 0xb - sysIP_MULTICAST_VIF = 0xe - sysIP_ADD_MEMBERSHIP = 0xc - sysIP_DROP_MEMBERSHIP = 0xd - sizeofIPMreq = 0x8 ) diff --git a/vendor/golang.org/x/net/ipv4/zsys_freebsd_386.go b/vendor/golang.org/x/net/ipv4/zsys_freebsd_386.go index 136e2b8f1d..b2208a45db 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_freebsd_386.go +++ b/vendor/golang.org/x/net/ipv4/zsys_freebsd_386.go @@ -4,40 +4,6 @@ package ipv4 const ( - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_RECVOPTS = 0x5 - sysIP_RECVRETOPTS = 0x6 - sysIP_RECVDSTADDR = 0x7 - sysIP_SENDSRCADDR = 0x7 - sysIP_RETOPTS = 0x8 - sysIP_RECVIF = 0x14 - sysIP_ONESBCAST = 0x17 - sysIP_BINDANY = 0x18 - sysIP_RECVTTL = 0x41 - sysIP_MINTTL = 0x42 - sysIP_DONTFRAG = 0x43 - sysIP_RECVTOS = 0x44 - - sysIP_MULTICAST_IF = 0x9 - sysIP_MULTICAST_TTL = 0xa - sysIP_MULTICAST_LOOP = 0xb - sysIP_ADD_MEMBERSHIP = 0xc - sysIP_DROP_MEMBERSHIP = 0xd - sysIP_MULTICAST_VIF = 0xe - sysIP_ADD_SOURCE_MEMBERSHIP = 0x46 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x47 - sysIP_BLOCK_SOURCE = 0x48 - sysIP_UNBLOCK_SOURCE = 0x49 - sysMCAST_JOIN_GROUP = 0x50 - sysMCAST_LEAVE_GROUP = 0x51 - sysMCAST_JOIN_SOURCE_GROUP = 0x52 - sysMCAST_LEAVE_SOURCE_GROUP = 0x53 - sysMCAST_BLOCK_SOURCE = 0x54 - sysMCAST_UNBLOCK_SOURCE = 0x55 - sizeofSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 diff --git a/vendor/golang.org/x/net/ipv4/zsys_freebsd_amd64.go b/vendor/golang.org/x/net/ipv4/zsys_freebsd_amd64.go index 4f730f19ef..6719f19479 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_freebsd_amd64.go +++ b/vendor/golang.org/x/net/ipv4/zsys_freebsd_amd64.go @@ -4,40 +4,6 @@ package ipv4 const ( - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_RECVOPTS = 0x5 - sysIP_RECVRETOPTS = 0x6 - sysIP_RECVDSTADDR = 0x7 - sysIP_SENDSRCADDR = 0x7 - sysIP_RETOPTS = 0x8 - sysIP_RECVIF = 0x14 - sysIP_ONESBCAST = 0x17 - sysIP_BINDANY = 0x18 - sysIP_RECVTTL = 0x41 - sysIP_MINTTL = 0x42 - sysIP_DONTFRAG = 0x43 - sysIP_RECVTOS = 0x44 - - sysIP_MULTICAST_IF = 0x9 - sysIP_MULTICAST_TTL = 0xa - sysIP_MULTICAST_LOOP = 0xb - sysIP_ADD_MEMBERSHIP = 0xc - sysIP_DROP_MEMBERSHIP = 0xd - sysIP_MULTICAST_VIF = 0xe - sysIP_ADD_SOURCE_MEMBERSHIP = 0x46 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x47 - sysIP_BLOCK_SOURCE = 0x48 - sysIP_UNBLOCK_SOURCE = 0x49 - sysMCAST_JOIN_GROUP = 0x50 - sysMCAST_LEAVE_GROUP = 0x51 - sysMCAST_JOIN_SOURCE_GROUP = 0x52 - sysMCAST_LEAVE_SOURCE_GROUP = 0x53 - sysMCAST_BLOCK_SOURCE = 0x54 - sysMCAST_UNBLOCK_SOURCE = 0x55 - sizeofSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 diff --git a/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm.go b/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm.go index 4f730f19ef..6719f19479 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm.go +++ b/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm.go @@ -4,40 +4,6 @@ package ipv4 const ( - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_RECVOPTS = 0x5 - sysIP_RECVRETOPTS = 0x6 - sysIP_RECVDSTADDR = 0x7 - sysIP_SENDSRCADDR = 0x7 - sysIP_RETOPTS = 0x8 - sysIP_RECVIF = 0x14 - sysIP_ONESBCAST = 0x17 - sysIP_BINDANY = 0x18 - sysIP_RECVTTL = 0x41 - sysIP_MINTTL = 0x42 - sysIP_DONTFRAG = 0x43 - sysIP_RECVTOS = 0x44 - - sysIP_MULTICAST_IF = 0x9 - sysIP_MULTICAST_TTL = 0xa - sysIP_MULTICAST_LOOP = 0xb - sysIP_ADD_MEMBERSHIP = 0xc - sysIP_DROP_MEMBERSHIP = 0xd - sysIP_MULTICAST_VIF = 0xe - sysIP_ADD_SOURCE_MEMBERSHIP = 0x46 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x47 - sysIP_BLOCK_SOURCE = 0x48 - sysIP_UNBLOCK_SOURCE = 0x49 - sysMCAST_JOIN_GROUP = 0x50 - sysMCAST_LEAVE_GROUP = 0x51 - sysMCAST_JOIN_SOURCE_GROUP = 0x52 - sysMCAST_LEAVE_SOURCE_GROUP = 0x53 - sysMCAST_BLOCK_SOURCE = 0x54 - sysMCAST_UNBLOCK_SOURCE = 0x55 - sizeofSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 diff --git a/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm64.go b/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm64.go index ecebf32723..07a5f5d7e1 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm64.go +++ b/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm64.go @@ -4,40 +4,6 @@ package ipv4 const ( - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_RECVOPTS = 0x5 - sysIP_RECVRETOPTS = 0x6 - sysIP_RECVDSTADDR = 0x7 - sysIP_SENDSRCADDR = 0x7 - sysIP_RETOPTS = 0x8 - sysIP_RECVIF = 0x14 - sysIP_ONESBCAST = 0x17 - sysIP_BINDANY = 0x18 - sysIP_RECVTTL = 0x41 - sysIP_MINTTL = 0x42 - sysIP_DONTFRAG = 0x43 - sysIP_RECVTOS = 0x44 - - sysIP_MULTICAST_IF = 0x9 - sysIP_MULTICAST_TTL = 0xa - sysIP_MULTICAST_LOOP = 0xb - sysIP_ADD_MEMBERSHIP = 0xc - sysIP_DROP_MEMBERSHIP = 0xd - sysIP_MULTICAST_VIF = 0xe - sysIP_ADD_SOURCE_MEMBERSHIP = 0x46 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x47 - sysIP_BLOCK_SOURCE = 0x48 - sysIP_UNBLOCK_SOURCE = 0x49 - sysMCAST_JOIN_GROUP = 0x50 - sysMCAST_LEAVE_GROUP = 0x51 - sysMCAST_JOIN_SOURCE_GROUP = 0x52 - sysMCAST_LEAVE_SOURCE_GROUP = 0x53 - sysMCAST_BLOCK_SOURCE = 0x54 - sysMCAST_UNBLOCK_SOURCE = 0x55 - sizeofSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_386.go b/vendor/golang.org/x/net/ipv4/zsys_linux_386.go index 1c7fdfa13a..a8e3c26267 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_386.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_386.go @@ -4,57 +4,6 @@ package ipv4 const ( - sysIP_TOS = 0x1 - sysIP_TTL = 0x2 - sysIP_HDRINCL = 0x3 - sysIP_OPTIONS = 0x4 - sysIP_ROUTER_ALERT = 0x5 - sysIP_RECVOPTS = 0x6 - sysIP_RETOPTS = 0x7 - sysIP_PKTINFO = 0x8 - sysIP_PKTOPTIONS = 0x9 - sysIP_MTU_DISCOVER = 0xa - sysIP_RECVERR = 0xb - sysIP_RECVTTL = 0xc - sysIP_RECVTOS = 0xd - sysIP_MTU = 0xe - sysIP_FREEBIND = 0xf - sysIP_TRANSPARENT = 0x13 - sysIP_RECVRETOPTS = 0x7 - sysIP_ORIGDSTADDR = 0x14 - sysIP_RECVORIGDSTADDR = 0x14 - sysIP_MINTTL = 0x15 - sysIP_NODEFRAG = 0x16 - sysIP_UNICAST_IF = 0x32 - - sysIP_MULTICAST_IF = 0x20 - sysIP_MULTICAST_TTL = 0x21 - sysIP_MULTICAST_LOOP = 0x22 - sysIP_ADD_MEMBERSHIP = 0x23 - sysIP_DROP_MEMBERSHIP = 0x24 - sysIP_UNBLOCK_SOURCE = 0x25 - sysIP_BLOCK_SOURCE = 0x26 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 - sysIP_MSFILTER = 0x29 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIP_MULTICAST_ALL = 0x31 - - sysICMP_FILTER = 0x1 - - sysSO_EE_ORIGIN_NONE = 0x0 - sysSO_EE_ORIGIN_LOCAL = 0x1 - sysSO_EE_ORIGIN_ICMP = 0x2 - sysSO_EE_ORIGIN_ICMP6 = 0x3 - sysSO_EE_ORIGIN_TXSTATUS = 0x4 - sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_amd64.go b/vendor/golang.org/x/net/ipv4/zsys_linux_amd64.go index a04e785187..7291f96a02 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_amd64.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_amd64.go @@ -4,57 +4,6 @@ package ipv4 const ( - sysIP_TOS = 0x1 - sysIP_TTL = 0x2 - sysIP_HDRINCL = 0x3 - sysIP_OPTIONS = 0x4 - sysIP_ROUTER_ALERT = 0x5 - sysIP_RECVOPTS = 0x6 - sysIP_RETOPTS = 0x7 - sysIP_PKTINFO = 0x8 - sysIP_PKTOPTIONS = 0x9 - sysIP_MTU_DISCOVER = 0xa - sysIP_RECVERR = 0xb - sysIP_RECVTTL = 0xc - sysIP_RECVTOS = 0xd - sysIP_MTU = 0xe - sysIP_FREEBIND = 0xf - sysIP_TRANSPARENT = 0x13 - sysIP_RECVRETOPTS = 0x7 - sysIP_ORIGDSTADDR = 0x14 - sysIP_RECVORIGDSTADDR = 0x14 - sysIP_MINTTL = 0x15 - sysIP_NODEFRAG = 0x16 - sysIP_UNICAST_IF = 0x32 - - sysIP_MULTICAST_IF = 0x20 - sysIP_MULTICAST_TTL = 0x21 - sysIP_MULTICAST_LOOP = 0x22 - sysIP_ADD_MEMBERSHIP = 0x23 - sysIP_DROP_MEMBERSHIP = 0x24 - sysIP_UNBLOCK_SOURCE = 0x25 - sysIP_BLOCK_SOURCE = 0x26 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 - sysIP_MSFILTER = 0x29 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIP_MULTICAST_ALL = 0x31 - - sysICMP_FILTER = 0x1 - - sysSO_EE_ORIGIN_NONE = 0x0 - sysSO_EE_ORIGIN_LOCAL = 0x1 - sysSO_EE_ORIGIN_ICMP = 0x2 - sysSO_EE_ORIGIN_ICMP6 = 0x3 - sysSO_EE_ORIGIN_TXSTATUS = 0x4 - sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_arm.go b/vendor/golang.org/x/net/ipv4/zsys_linux_arm.go index 1c7fdfa13a..a8e3c26267 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_arm.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_arm.go @@ -4,57 +4,6 @@ package ipv4 const ( - sysIP_TOS = 0x1 - sysIP_TTL = 0x2 - sysIP_HDRINCL = 0x3 - sysIP_OPTIONS = 0x4 - sysIP_ROUTER_ALERT = 0x5 - sysIP_RECVOPTS = 0x6 - sysIP_RETOPTS = 0x7 - sysIP_PKTINFO = 0x8 - sysIP_PKTOPTIONS = 0x9 - sysIP_MTU_DISCOVER = 0xa - sysIP_RECVERR = 0xb - sysIP_RECVTTL = 0xc - sysIP_RECVTOS = 0xd - sysIP_MTU = 0xe - sysIP_FREEBIND = 0xf - sysIP_TRANSPARENT = 0x13 - sysIP_RECVRETOPTS = 0x7 - sysIP_ORIGDSTADDR = 0x14 - sysIP_RECVORIGDSTADDR = 0x14 - sysIP_MINTTL = 0x15 - sysIP_NODEFRAG = 0x16 - sysIP_UNICAST_IF = 0x32 - - sysIP_MULTICAST_IF = 0x20 - sysIP_MULTICAST_TTL = 0x21 - sysIP_MULTICAST_LOOP = 0x22 - sysIP_ADD_MEMBERSHIP = 0x23 - sysIP_DROP_MEMBERSHIP = 0x24 - sysIP_UNBLOCK_SOURCE = 0x25 - sysIP_BLOCK_SOURCE = 0x26 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 - sysIP_MSFILTER = 0x29 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIP_MULTICAST_ALL = 0x31 - - sysICMP_FILTER = 0x1 - - sysSO_EE_ORIGIN_NONE = 0x0 - sysSO_EE_ORIGIN_LOCAL = 0x1 - sysSO_EE_ORIGIN_ICMP = 0x2 - sysSO_EE_ORIGIN_ICMP6 = 0x3 - sysSO_EE_ORIGIN_TXSTATUS = 0x4 - sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_arm64.go b/vendor/golang.org/x/net/ipv4/zsys_linux_arm64.go index a04e785187..7291f96a02 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_arm64.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_arm64.go @@ -4,57 +4,6 @@ package ipv4 const ( - sysIP_TOS = 0x1 - sysIP_TTL = 0x2 - sysIP_HDRINCL = 0x3 - sysIP_OPTIONS = 0x4 - sysIP_ROUTER_ALERT = 0x5 - sysIP_RECVOPTS = 0x6 - sysIP_RETOPTS = 0x7 - sysIP_PKTINFO = 0x8 - sysIP_PKTOPTIONS = 0x9 - sysIP_MTU_DISCOVER = 0xa - sysIP_RECVERR = 0xb - sysIP_RECVTTL = 0xc - sysIP_RECVTOS = 0xd - sysIP_MTU = 0xe - sysIP_FREEBIND = 0xf - sysIP_TRANSPARENT = 0x13 - sysIP_RECVRETOPTS = 0x7 - sysIP_ORIGDSTADDR = 0x14 - sysIP_RECVORIGDSTADDR = 0x14 - sysIP_MINTTL = 0x15 - sysIP_NODEFRAG = 0x16 - sysIP_UNICAST_IF = 0x32 - - sysIP_MULTICAST_IF = 0x20 - sysIP_MULTICAST_TTL = 0x21 - sysIP_MULTICAST_LOOP = 0x22 - sysIP_ADD_MEMBERSHIP = 0x23 - sysIP_DROP_MEMBERSHIP = 0x24 - sysIP_UNBLOCK_SOURCE = 0x25 - sysIP_BLOCK_SOURCE = 0x26 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 - sysIP_MSFILTER = 0x29 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIP_MULTICAST_ALL = 0x31 - - sysICMP_FILTER = 0x1 - - sysSO_EE_ORIGIN_NONE = 0x0 - sysSO_EE_ORIGIN_LOCAL = 0x1 - sysSO_EE_ORIGIN_ICMP = 0x2 - sysSO_EE_ORIGIN_ICMP6 = 0x3 - sysSO_EE_ORIGIN_TXSTATUS = 0x4 - sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_mips.go b/vendor/golang.org/x/net/ipv4/zsys_linux_mips.go index 1c7fdfa13a..a8e3c26267 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_mips.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_mips.go @@ -4,57 +4,6 @@ package ipv4 const ( - sysIP_TOS = 0x1 - sysIP_TTL = 0x2 - sysIP_HDRINCL = 0x3 - sysIP_OPTIONS = 0x4 - sysIP_ROUTER_ALERT = 0x5 - sysIP_RECVOPTS = 0x6 - sysIP_RETOPTS = 0x7 - sysIP_PKTINFO = 0x8 - sysIP_PKTOPTIONS = 0x9 - sysIP_MTU_DISCOVER = 0xa - sysIP_RECVERR = 0xb - sysIP_RECVTTL = 0xc - sysIP_RECVTOS = 0xd - sysIP_MTU = 0xe - sysIP_FREEBIND = 0xf - sysIP_TRANSPARENT = 0x13 - sysIP_RECVRETOPTS = 0x7 - sysIP_ORIGDSTADDR = 0x14 - sysIP_RECVORIGDSTADDR = 0x14 - sysIP_MINTTL = 0x15 - sysIP_NODEFRAG = 0x16 - sysIP_UNICAST_IF = 0x32 - - sysIP_MULTICAST_IF = 0x20 - sysIP_MULTICAST_TTL = 0x21 - sysIP_MULTICAST_LOOP = 0x22 - sysIP_ADD_MEMBERSHIP = 0x23 - sysIP_DROP_MEMBERSHIP = 0x24 - sysIP_UNBLOCK_SOURCE = 0x25 - sysIP_BLOCK_SOURCE = 0x26 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 - sysIP_MSFILTER = 0x29 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIP_MULTICAST_ALL = 0x31 - - sysICMP_FILTER = 0x1 - - sysSO_EE_ORIGIN_NONE = 0x0 - sysSO_EE_ORIGIN_LOCAL = 0x1 - sysSO_EE_ORIGIN_ICMP = 0x2 - sysSO_EE_ORIGIN_ICMP6 = 0x3 - sysSO_EE_ORIGIN_TXSTATUS = 0x4 - sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_mips64.go b/vendor/golang.org/x/net/ipv4/zsys_linux_mips64.go index a04e785187..7291f96a02 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_mips64.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_mips64.go @@ -4,57 +4,6 @@ package ipv4 const ( - sysIP_TOS = 0x1 - sysIP_TTL = 0x2 - sysIP_HDRINCL = 0x3 - sysIP_OPTIONS = 0x4 - sysIP_ROUTER_ALERT = 0x5 - sysIP_RECVOPTS = 0x6 - sysIP_RETOPTS = 0x7 - sysIP_PKTINFO = 0x8 - sysIP_PKTOPTIONS = 0x9 - sysIP_MTU_DISCOVER = 0xa - sysIP_RECVERR = 0xb - sysIP_RECVTTL = 0xc - sysIP_RECVTOS = 0xd - sysIP_MTU = 0xe - sysIP_FREEBIND = 0xf - sysIP_TRANSPARENT = 0x13 - sysIP_RECVRETOPTS = 0x7 - sysIP_ORIGDSTADDR = 0x14 - sysIP_RECVORIGDSTADDR = 0x14 - sysIP_MINTTL = 0x15 - sysIP_NODEFRAG = 0x16 - sysIP_UNICAST_IF = 0x32 - - sysIP_MULTICAST_IF = 0x20 - sysIP_MULTICAST_TTL = 0x21 - sysIP_MULTICAST_LOOP = 0x22 - sysIP_ADD_MEMBERSHIP = 0x23 - sysIP_DROP_MEMBERSHIP = 0x24 - sysIP_UNBLOCK_SOURCE = 0x25 - sysIP_BLOCK_SOURCE = 0x26 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 - sysIP_MSFILTER = 0x29 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIP_MULTICAST_ALL = 0x31 - - sysICMP_FILTER = 0x1 - - sysSO_EE_ORIGIN_NONE = 0x0 - sysSO_EE_ORIGIN_LOCAL = 0x1 - sysSO_EE_ORIGIN_ICMP = 0x2 - sysSO_EE_ORIGIN_ICMP6 = 0x3 - sysSO_EE_ORIGIN_TXSTATUS = 0x4 - sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_mips64le.go b/vendor/golang.org/x/net/ipv4/zsys_linux_mips64le.go index a04e785187..7291f96a02 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_mips64le.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_mips64le.go @@ -4,57 +4,6 @@ package ipv4 const ( - sysIP_TOS = 0x1 - sysIP_TTL = 0x2 - sysIP_HDRINCL = 0x3 - sysIP_OPTIONS = 0x4 - sysIP_ROUTER_ALERT = 0x5 - sysIP_RECVOPTS = 0x6 - sysIP_RETOPTS = 0x7 - sysIP_PKTINFO = 0x8 - sysIP_PKTOPTIONS = 0x9 - sysIP_MTU_DISCOVER = 0xa - sysIP_RECVERR = 0xb - sysIP_RECVTTL = 0xc - sysIP_RECVTOS = 0xd - sysIP_MTU = 0xe - sysIP_FREEBIND = 0xf - sysIP_TRANSPARENT = 0x13 - sysIP_RECVRETOPTS = 0x7 - sysIP_ORIGDSTADDR = 0x14 - sysIP_RECVORIGDSTADDR = 0x14 - sysIP_MINTTL = 0x15 - sysIP_NODEFRAG = 0x16 - sysIP_UNICAST_IF = 0x32 - - sysIP_MULTICAST_IF = 0x20 - sysIP_MULTICAST_TTL = 0x21 - sysIP_MULTICAST_LOOP = 0x22 - sysIP_ADD_MEMBERSHIP = 0x23 - sysIP_DROP_MEMBERSHIP = 0x24 - sysIP_UNBLOCK_SOURCE = 0x25 - sysIP_BLOCK_SOURCE = 0x26 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 - sysIP_MSFILTER = 0x29 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIP_MULTICAST_ALL = 0x31 - - sysICMP_FILTER = 0x1 - - sysSO_EE_ORIGIN_NONE = 0x0 - sysSO_EE_ORIGIN_LOCAL = 0x1 - sysSO_EE_ORIGIN_ICMP = 0x2 - sysSO_EE_ORIGIN_ICMP6 = 0x3 - sysSO_EE_ORIGIN_TXSTATUS = 0x4 - sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_mipsle.go b/vendor/golang.org/x/net/ipv4/zsys_linux_mipsle.go index 1c7fdfa13a..a8e3c26267 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_mipsle.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_mipsle.go @@ -4,57 +4,6 @@ package ipv4 const ( - sysIP_TOS = 0x1 - sysIP_TTL = 0x2 - sysIP_HDRINCL = 0x3 - sysIP_OPTIONS = 0x4 - sysIP_ROUTER_ALERT = 0x5 - sysIP_RECVOPTS = 0x6 - sysIP_RETOPTS = 0x7 - sysIP_PKTINFO = 0x8 - sysIP_PKTOPTIONS = 0x9 - sysIP_MTU_DISCOVER = 0xa - sysIP_RECVERR = 0xb - sysIP_RECVTTL = 0xc - sysIP_RECVTOS = 0xd - sysIP_MTU = 0xe - sysIP_FREEBIND = 0xf - sysIP_TRANSPARENT = 0x13 - sysIP_RECVRETOPTS = 0x7 - sysIP_ORIGDSTADDR = 0x14 - sysIP_RECVORIGDSTADDR = 0x14 - sysIP_MINTTL = 0x15 - sysIP_NODEFRAG = 0x16 - sysIP_UNICAST_IF = 0x32 - - sysIP_MULTICAST_IF = 0x20 - sysIP_MULTICAST_TTL = 0x21 - sysIP_MULTICAST_LOOP = 0x22 - sysIP_ADD_MEMBERSHIP = 0x23 - sysIP_DROP_MEMBERSHIP = 0x24 - sysIP_UNBLOCK_SOURCE = 0x25 - sysIP_BLOCK_SOURCE = 0x26 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 - sysIP_MSFILTER = 0x29 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIP_MULTICAST_ALL = 0x31 - - sysICMP_FILTER = 0x1 - - sysSO_EE_ORIGIN_NONE = 0x0 - sysSO_EE_ORIGIN_LOCAL = 0x1 - sysSO_EE_ORIGIN_ICMP = 0x2 - sysSO_EE_ORIGIN_ICMP6 = 0x3 - sysSO_EE_ORIGIN_TXSTATUS = 0x4 - sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_ppc.go b/vendor/golang.org/x/net/ipv4/zsys_linux_ppc.go index 3c5ea54731..b9adb2af2b 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_ppc.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_ppc.go @@ -4,57 +4,6 @@ package ipv4 const ( - sysIP_TOS = 0x1 - sysIP_TTL = 0x2 - sysIP_HDRINCL = 0x3 - sysIP_OPTIONS = 0x4 - sysIP_ROUTER_ALERT = 0x5 - sysIP_RECVOPTS = 0x6 - sysIP_RETOPTS = 0x7 - sysIP_PKTINFO = 0x8 - sysIP_PKTOPTIONS = 0x9 - sysIP_MTU_DISCOVER = 0xa - sysIP_RECVERR = 0xb - sysIP_RECVTTL = 0xc - sysIP_RECVTOS = 0xd - sysIP_MTU = 0xe - sysIP_FREEBIND = 0xf - sysIP_TRANSPARENT = 0x13 - sysIP_RECVRETOPTS = 0x7 - sysIP_ORIGDSTADDR = 0x14 - sysIP_RECVORIGDSTADDR = 0x14 - sysIP_MINTTL = 0x15 - sysIP_NODEFRAG = 0x16 - sysIP_UNICAST_IF = 0x32 - - sysIP_MULTICAST_IF = 0x20 - sysIP_MULTICAST_TTL = 0x21 - sysIP_MULTICAST_LOOP = 0x22 - sysIP_ADD_MEMBERSHIP = 0x23 - sysIP_DROP_MEMBERSHIP = 0x24 - sysIP_UNBLOCK_SOURCE = 0x25 - sysIP_BLOCK_SOURCE = 0x26 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 - sysIP_MSFILTER = 0x29 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIP_MULTICAST_ALL = 0x31 - - sysICMP_FILTER = 0x1 - - sysSO_EE_ORIGIN_NONE = 0x0 - sysSO_EE_ORIGIN_LOCAL = 0x1 - sysSO_EE_ORIGIN_ICMP = 0x2 - sysSO_EE_ORIGIN_ICMP6 = 0x3 - sysSO_EE_ORIGIN_TXSTATUS = 0x4 - sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64.go b/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64.go index a04e785187..7291f96a02 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64.go @@ -4,57 +4,6 @@ package ipv4 const ( - sysIP_TOS = 0x1 - sysIP_TTL = 0x2 - sysIP_HDRINCL = 0x3 - sysIP_OPTIONS = 0x4 - sysIP_ROUTER_ALERT = 0x5 - sysIP_RECVOPTS = 0x6 - sysIP_RETOPTS = 0x7 - sysIP_PKTINFO = 0x8 - sysIP_PKTOPTIONS = 0x9 - sysIP_MTU_DISCOVER = 0xa - sysIP_RECVERR = 0xb - sysIP_RECVTTL = 0xc - sysIP_RECVTOS = 0xd - sysIP_MTU = 0xe - sysIP_FREEBIND = 0xf - sysIP_TRANSPARENT = 0x13 - sysIP_RECVRETOPTS = 0x7 - sysIP_ORIGDSTADDR = 0x14 - sysIP_RECVORIGDSTADDR = 0x14 - sysIP_MINTTL = 0x15 - sysIP_NODEFRAG = 0x16 - sysIP_UNICAST_IF = 0x32 - - sysIP_MULTICAST_IF = 0x20 - sysIP_MULTICAST_TTL = 0x21 - sysIP_MULTICAST_LOOP = 0x22 - sysIP_ADD_MEMBERSHIP = 0x23 - sysIP_DROP_MEMBERSHIP = 0x24 - sysIP_UNBLOCK_SOURCE = 0x25 - sysIP_BLOCK_SOURCE = 0x26 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 - sysIP_MSFILTER = 0x29 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIP_MULTICAST_ALL = 0x31 - - sysICMP_FILTER = 0x1 - - sysSO_EE_ORIGIN_NONE = 0x0 - sysSO_EE_ORIGIN_LOCAL = 0x1 - sysSO_EE_ORIGIN_ICMP = 0x2 - sysSO_EE_ORIGIN_ICMP6 = 0x3 - sysSO_EE_ORIGIN_TXSTATUS = 0x4 - sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64le.go b/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64le.go index a04e785187..7291f96a02 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64le.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64le.go @@ -4,57 +4,6 @@ package ipv4 const ( - sysIP_TOS = 0x1 - sysIP_TTL = 0x2 - sysIP_HDRINCL = 0x3 - sysIP_OPTIONS = 0x4 - sysIP_ROUTER_ALERT = 0x5 - sysIP_RECVOPTS = 0x6 - sysIP_RETOPTS = 0x7 - sysIP_PKTINFO = 0x8 - sysIP_PKTOPTIONS = 0x9 - sysIP_MTU_DISCOVER = 0xa - sysIP_RECVERR = 0xb - sysIP_RECVTTL = 0xc - sysIP_RECVTOS = 0xd - sysIP_MTU = 0xe - sysIP_FREEBIND = 0xf - sysIP_TRANSPARENT = 0x13 - sysIP_RECVRETOPTS = 0x7 - sysIP_ORIGDSTADDR = 0x14 - sysIP_RECVORIGDSTADDR = 0x14 - sysIP_MINTTL = 0x15 - sysIP_NODEFRAG = 0x16 - sysIP_UNICAST_IF = 0x32 - - sysIP_MULTICAST_IF = 0x20 - sysIP_MULTICAST_TTL = 0x21 - sysIP_MULTICAST_LOOP = 0x22 - sysIP_ADD_MEMBERSHIP = 0x23 - sysIP_DROP_MEMBERSHIP = 0x24 - sysIP_UNBLOCK_SOURCE = 0x25 - sysIP_BLOCK_SOURCE = 0x26 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 - sysIP_MSFILTER = 0x29 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIP_MULTICAST_ALL = 0x31 - - sysICMP_FILTER = 0x1 - - sysSO_EE_ORIGIN_NONE = 0x0 - sysSO_EE_ORIGIN_LOCAL = 0x1 - sysSO_EE_ORIGIN_ICMP = 0x2 - sysSO_EE_ORIGIN_ICMP6 = 0x3 - sysSO_EE_ORIGIN_TXSTATUS = 0x4 - sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_riscv64.go b/vendor/golang.org/x/net/ipv4/zsys_linux_riscv64.go index e626134a8b..b24d2649d1 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_riscv64.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_riscv64.go @@ -1,62 +1,12 @@ // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_linux.go +//go:build riscv64 // +build riscv64 package ipv4 const ( - sysIP_TOS = 0x1 - sysIP_TTL = 0x2 - sysIP_HDRINCL = 0x3 - sysIP_OPTIONS = 0x4 - sysIP_ROUTER_ALERT = 0x5 - sysIP_RECVOPTS = 0x6 - sysIP_RETOPTS = 0x7 - sysIP_PKTINFO = 0x8 - sysIP_PKTOPTIONS = 0x9 - sysIP_MTU_DISCOVER = 0xa - sysIP_RECVERR = 0xb - sysIP_RECVTTL = 0xc - sysIP_RECVTOS = 0xd - sysIP_MTU = 0xe - sysIP_FREEBIND = 0xf - sysIP_TRANSPARENT = 0x13 - sysIP_RECVRETOPTS = 0x7 - sysIP_ORIGDSTADDR = 0x14 - sysIP_RECVORIGDSTADDR = 0x14 - sysIP_MINTTL = 0x15 - sysIP_NODEFRAG = 0x16 - sysIP_UNICAST_IF = 0x32 - - sysIP_MULTICAST_IF = 0x20 - sysIP_MULTICAST_TTL = 0x21 - sysIP_MULTICAST_LOOP = 0x22 - sysIP_ADD_MEMBERSHIP = 0x23 - sysIP_DROP_MEMBERSHIP = 0x24 - sysIP_UNBLOCK_SOURCE = 0x25 - sysIP_BLOCK_SOURCE = 0x26 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 - sysIP_MSFILTER = 0x29 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIP_MULTICAST_ALL = 0x31 - - sysICMP_FILTER = 0x1 - - sysSO_EE_ORIGIN_NONE = 0x0 - sysSO_EE_ORIGIN_LOCAL = 0x1 - sysSO_EE_ORIGIN_ICMP = 0x2 - sysSO_EE_ORIGIN_ICMP6 = 0x3 - sysSO_EE_ORIGIN_TXSTATUS = 0x4 - sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_s390x.go b/vendor/golang.org/x/net/ipv4/zsys_linux_s390x.go index a04e785187..7291f96a02 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_s390x.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_s390x.go @@ -4,57 +4,6 @@ package ipv4 const ( - sysIP_TOS = 0x1 - sysIP_TTL = 0x2 - sysIP_HDRINCL = 0x3 - sysIP_OPTIONS = 0x4 - sysIP_ROUTER_ALERT = 0x5 - sysIP_RECVOPTS = 0x6 - sysIP_RETOPTS = 0x7 - sysIP_PKTINFO = 0x8 - sysIP_PKTOPTIONS = 0x9 - sysIP_MTU_DISCOVER = 0xa - sysIP_RECVERR = 0xb - sysIP_RECVTTL = 0xc - sysIP_RECVTOS = 0xd - sysIP_MTU = 0xe - sysIP_FREEBIND = 0xf - sysIP_TRANSPARENT = 0x13 - sysIP_RECVRETOPTS = 0x7 - sysIP_ORIGDSTADDR = 0x14 - sysIP_RECVORIGDSTADDR = 0x14 - sysIP_MINTTL = 0x15 - sysIP_NODEFRAG = 0x16 - sysIP_UNICAST_IF = 0x32 - - sysIP_MULTICAST_IF = 0x20 - sysIP_MULTICAST_TTL = 0x21 - sysIP_MULTICAST_LOOP = 0x22 - sysIP_ADD_MEMBERSHIP = 0x23 - sysIP_DROP_MEMBERSHIP = 0x24 - sysIP_UNBLOCK_SOURCE = 0x25 - sysIP_BLOCK_SOURCE = 0x26 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 - sysIP_MSFILTER = 0x29 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIP_MULTICAST_ALL = 0x31 - - sysICMP_FILTER = 0x1 - - sysSO_EE_ORIGIN_NONE = 0x0 - sysSO_EE_ORIGIN_LOCAL = 0x1 - sysSO_EE_ORIGIN_ICMP = 0x2 - sysSO_EE_ORIGIN_ICMP6 = 0x3 - sysSO_EE_ORIGIN_TXSTATUS = 0x4 - sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_netbsd.go b/vendor/golang.org/x/net/ipv4/zsys_netbsd.go index 8cfc648ad7..a2ef2f6d6d 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_netbsd.go +++ b/vendor/golang.org/x/net/ipv4/zsys_netbsd.go @@ -4,23 +4,6 @@ package ipv4 const ( - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_RECVOPTS = 0x5 - sysIP_RECVRETOPTS = 0x6 - sysIP_RECVDSTADDR = 0x7 - sysIP_RETOPTS = 0x8 - sysIP_RECVIF = 0x14 - sysIP_RECVTTL = 0x17 - - sysIP_MULTICAST_IF = 0x9 - sysIP_MULTICAST_TTL = 0xa - sysIP_MULTICAST_LOOP = 0xb - sysIP_ADD_MEMBERSHIP = 0xc - sysIP_DROP_MEMBERSHIP = 0xd - sizeofIPMreq = 0x8 ) diff --git a/vendor/golang.org/x/net/ipv4/zsys_openbsd.go b/vendor/golang.org/x/net/ipv4/zsys_openbsd.go index 37629cb0ab..b293a338f8 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_openbsd.go +++ b/vendor/golang.org/x/net/ipv4/zsys_openbsd.go @@ -4,23 +4,6 @@ package ipv4 const ( - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_RECVOPTS = 0x5 - sysIP_RECVRETOPTS = 0x6 - sysIP_RECVDSTADDR = 0x7 - sysIP_RETOPTS = 0x8 - sysIP_RECVIF = 0x1e - sysIP_RECVTTL = 0x1f - - sysIP_MULTICAST_IF = 0x9 - sysIP_MULTICAST_TTL = 0xa - sysIP_MULTICAST_LOOP = 0xb - sysIP_ADD_MEMBERSHIP = 0xc - sysIP_DROP_MEMBERSHIP = 0xd - sizeofIPMreq = 0x8 ) diff --git a/vendor/golang.org/x/net/ipv4/zsys_solaris.go b/vendor/golang.org/x/net/ipv4/zsys_solaris.go index cb80a308b0..e1a961bb61 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_solaris.go +++ b/vendor/golang.org/x/net/ipv4/zsys_solaris.go @@ -4,49 +4,6 @@ package ipv4 const ( - sysIP_OPTIONS = 0x1 - sysIP_HDRINCL = 0x2 - sysIP_TOS = 0x3 - sysIP_TTL = 0x4 - sysIP_RECVOPTS = 0x5 - sysIP_RECVRETOPTS = 0x6 - sysIP_RECVDSTADDR = 0x7 - sysIP_RETOPTS = 0x8 - sysIP_RECVIF = 0x9 - sysIP_RECVSLLA = 0xa - sysIP_RECVTTL = 0xb - - sysIP_MULTICAST_IF = 0x10 - sysIP_MULTICAST_TTL = 0x11 - sysIP_MULTICAST_LOOP = 0x12 - sysIP_ADD_MEMBERSHIP = 0x13 - sysIP_DROP_MEMBERSHIP = 0x14 - sysIP_BLOCK_SOURCE = 0x15 - sysIP_UNBLOCK_SOURCE = 0x16 - sysIP_ADD_SOURCE_MEMBERSHIP = 0x17 - sysIP_DROP_SOURCE_MEMBERSHIP = 0x18 - sysIP_NEXTHOP = 0x19 - - sysIP_PKTINFO = 0x1a - sysIP_RECVPKTINFO = 0x1a - sysIP_DONTFRAG = 0x1b - - sysIP_BOUND_IF = 0x41 - sysIP_UNSPEC_SRC = 0x42 - sysIP_BROADCAST_TTL = 0x43 - sysIP_DHCPINIT_IF = 0x45 - - sysIP_REUSEADDR = 0x104 - sysIP_DONTROUTE = 0x105 - sysIP_BROADCAST = 0x106 - - sysMCAST_JOIN_GROUP = 0x29 - sysMCAST_LEAVE_GROUP = 0x2a - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_JOIN_SOURCE_GROUP = 0x2d - sysMCAST_LEAVE_SOURCE_GROUP = 0x2e - sizeofSockaddrStorage = 0x100 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_zos_s390x.go b/vendor/golang.org/x/net/ipv4/zsys_zos_s390x.go new file mode 100644 index 0000000000..692abf6882 --- /dev/null +++ b/vendor/golang.org/x/net/ipv4/zsys_zos_s390x.go @@ -0,0 +1,56 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Hand edited based on zerrors_zos_s390x.go +// TODO(Bill O'Farrell): auto-generate. + +package ipv4 + +const ( + sizeofIPMreq = 8 + sizeofSockaddrInet4 = 16 + sizeofSockaddrStorage = 128 + sizeofGroupReq = 136 + sizeofGroupSourceReq = 264 + sizeofInetPktinfo = 8 +) + +type sockaddrInet4 struct { + Len uint8 + Family uint8 + Port uint16 + Addr [4]byte + Zero [8]uint8 +} + +type inetPktinfo struct { + Addr [4]byte + Ifindex uint32 +} + +type sockaddrStorage struct { + Len uint8 + Family byte + ss_pad1 [6]byte + ss_align int64 + ss_pad2 [112]byte +} + +type groupReq struct { + Interface uint32 + reserved uint32 + Group sockaddrStorage +} + +type groupSourceReq struct { + Interface uint32 + reserved uint32 + Group sockaddrStorage + Source sockaddrStorage +} + +type ipMreq struct { + Multiaddr [4]byte /* in_addr */ + Interface [4]byte /* in_addr */ +} diff --git a/vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go b/vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go index 9fd9eb15e3..2733ddbe27 100644 --- a/vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go +++ b/vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build darwin // +build darwin package ipv6 @@ -11,11 +12,13 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" ) func marshal2292HopLimit(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_2292HOPLIMIT, 4) + m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_2292HOPLIMIT, 4) if cm != nil { socket.NativeEndian.PutUint32(m.Data(4), uint32(cm.HopLimit)) } @@ -24,7 +27,7 @@ func marshal2292HopLimit(b []byte, cm *ControlMessage) []byte { func marshal2292PacketInfo(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_2292PKTINFO, sizeofInet6Pktinfo) + m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_2292PKTINFO, sizeofInet6Pktinfo) if cm != nil { pi := (*inet6Pktinfo)(unsafe.Pointer(&m.Data(sizeofInet6Pktinfo)[0])) if ip := cm.Src.To16(); ip != nil && ip.To4() == nil { @@ -39,7 +42,7 @@ func marshal2292PacketInfo(b []byte, cm *ControlMessage) []byte { func marshal2292NextHop(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_2292NEXTHOP, sizeofSockaddrInet6) + m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_2292NEXTHOP, sizeofSockaddrInet6) if cm != nil { sa := (*sockaddrInet6)(unsafe.Pointer(&m.Data(sizeofSockaddrInet6)[0])) sa.setSockaddr(cm.NextHop, cm.IfIndex) diff --git a/vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go b/vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go index 8c221b5989..9c90844aac 100644 --- a/vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go +++ b/vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos package ipv6 @@ -12,11 +13,13 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" ) func marshalTrafficClass(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_TCLASS, 4) + m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_TCLASS, 4) if cm != nil { socket.NativeEndian.PutUint32(m.Data(4), uint32(cm.TrafficClass)) } @@ -29,7 +32,7 @@ func parseTrafficClass(cm *ControlMessage, b []byte) { func marshalHopLimit(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_HOPLIMIT, 4) + m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_HOPLIMIT, 4) if cm != nil { socket.NativeEndian.PutUint32(m.Data(4), uint32(cm.HopLimit)) } @@ -42,7 +45,7 @@ func parseHopLimit(cm *ControlMessage, b []byte) { func marshalPacketInfo(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_PKTINFO, sizeofInet6Pktinfo) + m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_PKTINFO, sizeofInet6Pktinfo) if cm != nil { pi := (*inet6Pktinfo)(unsafe.Pointer(&m.Data(sizeofInet6Pktinfo)[0])) if ip := cm.Src.To16(); ip != nil && ip.To4() == nil { @@ -66,7 +69,7 @@ func parsePacketInfo(cm *ControlMessage, b []byte) { func marshalNextHop(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_NEXTHOP, sizeofSockaddrInet6) + m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_NEXTHOP, sizeofSockaddrInet6) if cm != nil { sa := (*sockaddrInet6)(unsafe.Pointer(&m.Data(sizeofSockaddrInet6)[0])) sa.setSockaddr(cm.NextHop, cm.IfIndex) @@ -79,7 +82,7 @@ func parseNextHop(cm *ControlMessage, b []byte) { func marshalPathMTU(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_PATHMTU, sizeofIPv6Mtuinfo) + m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo) return m.Next(sizeofIPv6Mtuinfo) } diff --git a/vendor/golang.org/x/net/ipv6/control_stub.go b/vendor/golang.org/x/net/ipv6/control_stub.go index 1d773cbcc8..b7e8643fc9 100644 --- a/vendor/golang.org/x/net/ipv6/control_stub.go +++ b/vendor/golang.org/x/net/ipv6/control_stub.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/control_unix.go b/vendor/golang.org/x/net/ipv6/control_unix.go index 0971a008bf..63e475db83 100644 --- a/vendor/golang.org/x/net/ipv6/control_unix.go +++ b/vendor/golang.org/x/net/ipv6/control_unix.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/icmp_bsd.go b/vendor/golang.org/x/net/ipv6/icmp_bsd.go index b03025cdcc..120bf87758 100644 --- a/vendor/golang.org/x/net/ipv6/icmp_bsd.go +++ b/vendor/golang.org/x/net/ipv6/icmp_bsd.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || darwin || dragonfly || freebsd || netbsd || openbsd // +build aix darwin dragonfly freebsd netbsd openbsd package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/icmp_stub.go b/vendor/golang.org/x/net/ipv6/icmp_stub.go index 370e51acd1..d60136a901 100644 --- a/vendor/golang.org/x/net/ipv6/icmp_stub.go +++ b/vendor/golang.org/x/net/ipv6/icmp_stub.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/icmp_zos.go b/vendor/golang.org/x/net/ipv6/icmp_zos.go new file mode 100644 index 0000000000..ddf8f093fc --- /dev/null +++ b/vendor/golang.org/x/net/ipv6/icmp_zos.go @@ -0,0 +1,29 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ipv6 + +func (f *icmpv6Filter) accept(typ ICMPType) { + f.Filt[typ>>5] |= 1 << (uint32(typ) & 31) + +} + +func (f *icmpv6Filter) block(typ ICMPType) { + f.Filt[typ>>5] &^= 1 << (uint32(typ) & 31) + +} + +func (f *icmpv6Filter) setAll(block bool) { + for i := range f.Filt { + if block { + f.Filt[i] = 0 + } else { + f.Filt[i] = 1<<32 - 1 + } + } +} + +func (f *icmpv6Filter) willBlock(typ ICMPType) bool { + return f.Filt[typ>>5]&(1<<(uint32(typ)&31)) == 0 +} diff --git a/vendor/golang.org/x/net/ipv6/payload_cmsg.go b/vendor/golang.org/x/net/ipv6/payload_cmsg.go index 284a04278e..b0692e4304 100644 --- a/vendor/golang.org/x/net/ipv6/payload_cmsg.go +++ b/vendor/golang.org/x/net/ipv6/payload_cmsg.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/payload_nocmsg.go b/vendor/golang.org/x/net/ipv6/payload_nocmsg.go index c5a4c96752..cd0ff50838 100644 --- a/vendor/golang.org/x/net/ipv6/payload_nocmsg.go +++ b/vendor/golang.org/x/net/ipv6/payload_nocmsg.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!zos package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sockopt_posix.go b/vendor/golang.org/x/net/ipv6/sockopt_posix.go index 824c623cce..37c6287130 100644 --- a/vendor/golang.org/x/net/ipv6/sockopt_posix.go +++ b/vendor/golang.org/x/net/ipv6/sockopt_posix.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || windows || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows zos package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sockopt_stub.go b/vendor/golang.org/x/net/ipv6/sockopt_stub.go index 0a87a93bbd..32fd8664ce 100644 --- a/vendor/golang.org/x/net/ipv6/sockopt_stub.go +++ b/vendor/golang.org/x/net/ipv6/sockopt_stub.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sys_aix.go b/vendor/golang.org/x/net/ipv6/sys_aix.go index bce7091fb0..a47182afb9 100644 --- a/vendor/golang.org/x/net/ipv6/sys_aix.go +++ b/vendor/golang.org/x/net/ipv6/sys_aix.go @@ -3,6 +3,7 @@ // license that can be found in the LICENSE file. // Added for go1.11 compatibility +//go:build aix // +build aix package ipv6 @@ -14,32 +15,34 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" ) var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, - ctlHopLimit: {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, - ctlPacketInfo: {sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, - ctlNextHop: {sysIPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, - ctlPathMTU: {sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, + ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, + ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, + ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, + ctlNextHop: {unix.IPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, + ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, } sockOpts = map[int]*sockOpt{ - ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_TCLASS, Len: 4}}, - ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_UNICAST_HOPS, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_IF, Len: 4}}, - ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_HOPS, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVTCLASS, Len: 4}}, - ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVHOPLIMIT, Len: 4}}, - ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPKTINFO, Len: 4}}, - ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPATHMTU, Len: 4}}, - ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, - ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_CHECKSUM, Len: 4}}, - ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: sysICMP6_FILTER, Len: sizeofICMPv6Filter}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_JOIN_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_LEAVE_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, + ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}}, + ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}}, + ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}}, + ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}}, + ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}}, + ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}}, + ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, + ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}}, + ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_JOIN_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_LEAVE_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, } ) diff --git a/vendor/golang.org/x/net/ipv6/sys_asmreq.go b/vendor/golang.org/x/net/ipv6/sys_asmreq.go index 8c3934c3ee..6ff9950d13 100644 --- a/vendor/golang.org/x/net/ipv6/sys_asmreq.go +++ b/vendor/golang.org/x/net/ipv6/sys_asmreq.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || windows // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go b/vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go index 87ae481814..485290cb82 100644 --- a/vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go +++ b/vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows // +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sys_bpf.go b/vendor/golang.org/x/net/ipv6/sys_bpf.go index 90ef4dfaf4..b5661fb8f0 100644 --- a/vendor/golang.org/x/net/ipv6/sys_bpf.go +++ b/vendor/golang.org/x/net/ipv6/sys_bpf.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux // +build linux package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sys_bpf_stub.go b/vendor/golang.org/x/net/ipv6/sys_bpf_stub.go index eb9f831623..cb00661872 100644 --- a/vendor/golang.org/x/net/ipv6/sys_bpf_stub.go +++ b/vendor/golang.org/x/net/ipv6/sys_bpf_stub.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !linux // +build !linux package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sys_bsd.go b/vendor/golang.org/x/net/ipv6/sys_bsd.go index e416eaa1fe..bde41a6cef 100644 --- a/vendor/golang.org/x/net/ipv6/sys_bsd.go +++ b/vendor/golang.org/x/net/ipv6/sys_bsd.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build dragonfly || netbsd || openbsd // +build dragonfly netbsd openbsd package ipv6 @@ -12,32 +13,34 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" ) var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, - ctlHopLimit: {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, - ctlPacketInfo: {sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, - ctlNextHop: {sysIPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, - ctlPathMTU: {sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, + ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, + ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, + ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, + ctlNextHop: {unix.IPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, + ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, } sockOpts = map[int]*sockOpt{ - ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_TCLASS, Len: 4}}, - ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_UNICAST_HOPS, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_IF, Len: 4}}, - ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_HOPS, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVTCLASS, Len: 4}}, - ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVHOPLIMIT, Len: 4}}, - ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPKTINFO, Len: 4}}, - ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPATHMTU, Len: 4}}, - ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, - ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_CHECKSUM, Len: 4}}, - ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: sysICMP6_FILTER, Len: sizeofICMPv6Filter}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_JOIN_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_LEAVE_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, + ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}}, + ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}}, + ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}}, + ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}}, + ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}}, + ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}}, + ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, + ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}}, + ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_JOIN_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_LEAVE_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, } ) diff --git a/vendor/golang.org/x/net/ipv6/sys_darwin.go b/vendor/golang.org/x/net/ipv6/sys_darwin.go index 12cc5cb2c1..b80ec8064a 100644 --- a/vendor/golang.org/x/net/ipv6/sys_darwin.go +++ b/vendor/golang.org/x/net/ipv6/sys_darwin.go @@ -11,36 +11,38 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" ) var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, - ctlHopLimit: {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, - ctlPacketInfo: {sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, - ctlNextHop: {sysIPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, - ctlPathMTU: {sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, + ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, + ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, + ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, + ctlNextHop: {unix.IPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, + ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, } sockOpts = map[int]*sockOpt{ - ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_UNICAST_HOPS, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_IF, Len: 4}}, - ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_HOPS, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_LOOP, Len: 4}}, - ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_TCLASS, Len: 4}}, - ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVTCLASS, Len: 4}}, - ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVHOPLIMIT, Len: 4}}, - ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPKTINFO, Len: 4}}, - ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPATHMTU, Len: 4}}, - ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, - ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_CHECKSUM, Len: 4}}, - ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: sysICMP6_FILTER, Len: sizeofICMPv6Filter}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}}, + ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}}, + ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}}, + ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}}, + ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}}, + ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}}, + ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}}, + ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, + ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}}, + ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, } ) diff --git a/vendor/golang.org/x/net/ipv6/sys_freebsd.go b/vendor/golang.org/x/net/ipv6/sys_freebsd.go index 85a9f5d07d..6282cf9770 100644 --- a/vendor/golang.org/x/net/ipv6/sys_freebsd.go +++ b/vendor/golang.org/x/net/ipv6/sys_freebsd.go @@ -13,36 +13,38 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" ) var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, - ctlHopLimit: {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, - ctlPacketInfo: {sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, - ctlNextHop: {sysIPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, - ctlPathMTU: {sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, + ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, + ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, + ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, + ctlNextHop: {unix.IPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, + ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, } sockOpts = map[int]sockOpt{ - ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_TCLASS, Len: 4}}, - ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_UNICAST_HOPS, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_IF, Len: 4}}, - ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_HOPS, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVTCLASS, Len: 4}}, - ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVHOPLIMIT, Len: 4}}, - ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPKTINFO, Len: 4}}, - ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPATHMTU, Len: 4}}, - ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, - ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_CHECKSUM, Len: 4}}, - ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: sysICMP6_FILTER, Len: sizeofICMPv6Filter}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}}, + ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}}, + ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}}, + ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}}, + ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}}, + ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}}, + ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, + ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}}, + ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, } ) diff --git a/vendor/golang.org/x/net/ipv6/sys_linux.go b/vendor/golang.org/x/net/ipv6/sys_linux.go index 96e8093a30..82e2121000 100644 --- a/vendor/golang.org/x/net/ipv6/sys_linux.go +++ b/vendor/golang.org/x/net/ipv6/sys_linux.go @@ -11,36 +11,37 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + "golang.org/x/sys/unix" ) var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, - ctlHopLimit: {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, - ctlPacketInfo: {sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, - ctlPathMTU: {sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, + ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, + ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, + ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, + ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, } sockOpts = map[int]*sockOpt{ - ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_TCLASS, Len: 4}}, - ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_UNICAST_HOPS, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_IF, Len: 4}}, - ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_HOPS, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVTCLASS, Len: 4}}, - ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVHOPLIMIT, Len: 4}}, - ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPKTINFO, Len: 4}}, - ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPATHMTU, Len: 4}}, - ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, - ssoChecksum: {Option: socket.Option{Level: iana.ProtocolReserved, Name: sysIPV6_CHECKSUM, Len: 4}}, - ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: sysICMPV6_FILTER, Len: sizeofICMPv6Filter}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}}, + ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}}, + ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}}, + ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}}, + ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}}, + ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}}, + ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, + ssoChecksum: {Option: socket.Option{Level: iana.ProtocolReserved, Name: unix.IPV6_CHECKSUM, Len: 4}}, + ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMPV6_FILTER, Len: sizeofICMPv6Filter}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, ssoAttachFilter: {Option: socket.Option{Level: unix.SOL_SOCKET, Name: unix.SO_ATTACH_FILTER, Len: unix.SizeofSockFprog}}, } ) diff --git a/vendor/golang.org/x/net/ipv6/sys_solaris.go b/vendor/golang.org/x/net/ipv6/sys_solaris.go index d348b5f6e4..1fc30add4d 100644 --- a/vendor/golang.org/x/net/ipv6/sys_solaris.go +++ b/vendor/golang.org/x/net/ipv6/sys_solaris.go @@ -11,36 +11,38 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" ) var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, - ctlHopLimit: {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, - ctlPacketInfo: {sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, - ctlNextHop: {sysIPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, - ctlPathMTU: {sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, + ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, + ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, + ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, + ctlNextHop: {unix.IPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, + ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, } sockOpts = map[int]*sockOpt{ - ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_TCLASS, Len: 4}}, - ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_UNICAST_HOPS, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_IF, Len: 4}}, - ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_HOPS, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVTCLASS, Len: 4}}, - ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVHOPLIMIT, Len: 4}}, - ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPKTINFO, Len: 4}}, - ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPATHMTU, Len: 4}}, - ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, - ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_CHECKSUM, Len: 4}}, - ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: sysICMP6_FILTER, Len: sizeofICMPv6Filter}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}}, + ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}}, + ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}}, + ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}}, + ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}}, + ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}}, + ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, + ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}}, + ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, } ) diff --git a/vendor/golang.org/x/net/ipv6/sys_ssmreq.go b/vendor/golang.org/x/net/ipv6/sys_ssmreq.go index 9b52e978cb..023488a49c 100644 --- a/vendor/golang.org/x/net/ipv6/sys_ssmreq.go +++ b/vendor/golang.org/x/net/ipv6/sys_ssmreq.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin freebsd linux solaris +//go:build aix || darwin || freebsd || linux || solaris || zos +// +build aix darwin freebsd linux solaris zos package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go b/vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go index d5bc1108c5..acdf2e5cf7 100644 --- a/vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go +++ b/vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !aix,!darwin,!freebsd,!linux,!solaris +//go:build !aix && !darwin && !freebsd && !linux && !solaris && !zos +// +build !aix,!darwin,!freebsd,!linux,!solaris,!zos package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sys_stub.go b/vendor/golang.org/x/net/ipv6/sys_stub.go index 4f252d09f6..5807bba392 100644 --- a/vendor/golang.org/x/net/ipv6/sys_stub.go +++ b/vendor/golang.org/x/net/ipv6/sys_stub.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sys_windows.go b/vendor/golang.org/x/net/ipv6/sys_windows.go index fc36b018bd..fda8a29949 100644 --- a/vendor/golang.org/x/net/ipv6/sys_windows.go +++ b/vendor/golang.org/x/net/ipv6/sys_windows.go @@ -10,18 +10,11 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" + + "golang.org/x/sys/windows" ) const ( - // See ws2tcpip.h. - sysIPV6_UNICAST_HOPS = 0x4 - sysIPV6_MULTICAST_IF = 0x9 - sysIPV6_MULTICAST_HOPS = 0xa - sysIPV6_MULTICAST_LOOP = 0xb - sysIPV6_JOIN_GROUP = 0xc - sysIPV6_LEAVE_GROUP = 0xd - sysIPV6_PKTINFO = 0x13 - sizeofSockaddrInet6 = 0x1c sizeofIPv6Mreq = 0x14 @@ -55,12 +48,12 @@ var ( ctlOpts = [ctlMax]ctlOpt{} sockOpts = map[int]*sockOpt{ - ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_UNICAST_HOPS, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_IF, Len: 4}}, - ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_HOPS, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_LOOP, Len: 4}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_JOIN_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_LEAVE_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, + ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_UNICAST_HOPS, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_MULTICAST_IF, Len: 4}}, + ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_MULTICAST_HOPS, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_MULTICAST_LOOP, Len: 4}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_JOIN_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_LEAVE_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, } ) diff --git a/vendor/golang.org/x/net/ipv6/sys_zos.go b/vendor/golang.org/x/net/ipv6/sys_zos.go new file mode 100644 index 0000000000..31adc86655 --- /dev/null +++ b/vendor/golang.org/x/net/ipv6/sys_zos.go @@ -0,0 +1,72 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ipv6 + +import ( + "net" + "syscall" + "unsafe" + + "golang.org/x/net/internal/iana" + "golang.org/x/net/internal/socket" + + "golang.org/x/sys/unix" +) + +var ( + ctlOpts = [ctlMax]ctlOpt{ + ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, + ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, + ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, + } + + sockOpts = map[int]*sockOpt{ + ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}}, + ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}}, + ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}}, + ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}}, + ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}}, + ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}}, + ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}}, + ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + } +) + +func (sa *sockaddrInet6) setSockaddr(ip net.IP, i int) { + sa.Family = syscall.AF_INET6 + copy(sa.Addr[:], ip) + sa.Scope_id = uint32(i) +} + +func (pi *inet6Pktinfo) setIfindex(i int) { + pi.Ifindex = uint32(i) +} + +func (gr *groupReq) setGroup(grp net.IP) { + sa := (*sockaddrInet6)(unsafe.Pointer(&gr.Group)) + sa.Family = syscall.AF_INET6 + sa.Len = sizeofSockaddrInet6 + copy(sa.Addr[:], grp) +} + +func (gsr *groupSourceReq) setSourceGroup(grp, src net.IP) { + sa := (*sockaddrInet6)(unsafe.Pointer(&gsr.Group)) + sa.Family = syscall.AF_INET6 + sa.Len = sizeofSockaddrInet6 + copy(sa.Addr[:], grp) + sa = (*sockaddrInet6)(unsafe.Pointer(&gsr.Source)) + sa.Family = syscall.AF_INET6 + sa.Len = sizeofSockaddrInet6 + copy(sa.Addr[:], src) +} diff --git a/vendor/golang.org/x/net/ipv6/zsys_aix_ppc64.go b/vendor/golang.org/x/net/ipv6/zsys_aix_ppc64.go index bf44e338bd..f604b0f3b4 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_aix_ppc64.go +++ b/vendor/golang.org/x/net/ipv6/zsys_aix_ppc64.go @@ -2,46 +2,12 @@ // cgo -godefs defs_aix.go // Added for go1.11 compatibility +//go:build aix // +build aix package ipv6 const ( - sysIPV6_UNICAST_HOPS = 0x4 - sysIPV6_MULTICAST_IF = 0x9 - sysIPV6_MULTICAST_HOPS = 0xa - sysIPV6_MULTICAST_LOOP = 0xb - sysIPV6_JOIN_GROUP = 0xc - sysIPV6_LEAVE_GROUP = 0xd - sysICMP6_FILTER = 0x26 - - sysIPV6_CHECKSUM = 0x27 - sysIPV6_V6ONLY = 0x25 - - sysIPV6_RTHDRDSTOPTS = 0x37 - - sysIPV6_RECVPKTINFO = 0x23 - sysIPV6_RECVHOPLIMIT = 0x29 - sysIPV6_RECVRTHDR = 0x33 - sysIPV6_RECVHOPOPTS = 0x35 - sysIPV6_RECVDSTOPTS = 0x38 - - sysIPV6_USE_MIN_MTU = 0x2c - sysIPV6_RECVPATHMTU = 0x2f - sysIPV6_PATHMTU = 0x2e - - sysIPV6_PKTINFO = 0x21 - sysIPV6_HOPLIMIT = 0x28 - sysIPV6_NEXTHOP = 0x30 - sysIPV6_HOPOPTS = 0x34 - sysIPV6_DSTOPTS = 0x36 - sysIPV6_RTHDR = 0x32 - - sysIPV6_RECVTCLASS = 0x2a - - sysIPV6_TCLASS = 0x2b - sysIPV6_DONTFRAG = 0x2d - sizeofSockaddrStorage = 0x508 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_darwin.go b/vendor/golang.org/x/net/ipv6/zsys_darwin.go index 555744afd7..dd6f7b28ec 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_darwin.go +++ b/vendor/golang.org/x/net/ipv6/zsys_darwin.go @@ -4,73 +4,6 @@ package ipv6 const ( - sysIPV6_UNICAST_HOPS = 0x4 - sysIPV6_MULTICAST_IF = 0x9 - sysIPV6_MULTICAST_HOPS = 0xa - sysIPV6_MULTICAST_LOOP = 0xb - sysIPV6_JOIN_GROUP = 0xc - sysIPV6_LEAVE_GROUP = 0xd - - sysIPV6_PORTRANGE = 0xe - sysICMP6_FILTER = 0x12 - sysIPV6_2292PKTINFO = 0x13 - sysIPV6_2292HOPLIMIT = 0x14 - sysIPV6_2292NEXTHOP = 0x15 - sysIPV6_2292HOPOPTS = 0x16 - sysIPV6_2292DSTOPTS = 0x17 - sysIPV6_2292RTHDR = 0x18 - - sysIPV6_2292PKTOPTIONS = 0x19 - - sysIPV6_CHECKSUM = 0x1a - sysIPV6_V6ONLY = 0x1b - - sysIPV6_IPSEC_POLICY = 0x1c - - sysIPV6_RECVTCLASS = 0x23 - sysIPV6_TCLASS = 0x24 - - sysIPV6_RTHDRDSTOPTS = 0x39 - - sysIPV6_RECVPKTINFO = 0x3d - - sysIPV6_RECVHOPLIMIT = 0x25 - sysIPV6_RECVRTHDR = 0x26 - sysIPV6_RECVHOPOPTS = 0x27 - sysIPV6_RECVDSTOPTS = 0x28 - - sysIPV6_USE_MIN_MTU = 0x2a - sysIPV6_RECVPATHMTU = 0x2b - - sysIPV6_PATHMTU = 0x2c - - sysIPV6_PKTINFO = 0x2e - sysIPV6_HOPLIMIT = 0x2f - sysIPV6_NEXTHOP = 0x30 - sysIPV6_HOPOPTS = 0x31 - sysIPV6_DSTOPTS = 0x32 - sysIPV6_RTHDR = 0x33 - - sysIPV6_AUTOFLOWLABEL = 0x3b - - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_PREFER_TEMPADDR = 0x3f - - sysIPV6_MSFILTER = 0x4a - sysMCAST_JOIN_GROUP = 0x50 - sysMCAST_LEAVE_GROUP = 0x51 - sysMCAST_JOIN_SOURCE_GROUP = 0x52 - sysMCAST_LEAVE_SOURCE_GROUP = 0x53 - sysMCAST_BLOCK_SOURCE = 0x54 - sysMCAST_UNBLOCK_SOURCE = 0x55 - - sysIPV6_BOUND_IF = 0x7d - - sysIPV6_PORTRANGE_DEFAULT = 0x0 - sysIPV6_PORTRANGE_HIGH = 0x1 - sysIPV6_PORTRANGE_LOW = 0x2 - sizeofSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_dragonfly.go b/vendor/golang.org/x/net/ipv6/zsys_dragonfly.go index cf3cc1024a..6b45a94fe1 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_dragonfly.go +++ b/vendor/golang.org/x/net/ipv6/zsys_dragonfly.go @@ -4,52 +4,6 @@ package ipv6 const ( - sysIPV6_UNICAST_HOPS = 0x4 - sysIPV6_MULTICAST_IF = 0x9 - sysIPV6_MULTICAST_HOPS = 0xa - sysIPV6_MULTICAST_LOOP = 0xb - sysIPV6_JOIN_GROUP = 0xc - sysIPV6_LEAVE_GROUP = 0xd - sysIPV6_PORTRANGE = 0xe - sysICMP6_FILTER = 0x12 - - sysIPV6_CHECKSUM = 0x1a - sysIPV6_V6ONLY = 0x1b - - sysIPV6_IPSEC_POLICY = 0x1c - - sysIPV6_RTHDRDSTOPTS = 0x23 - sysIPV6_RECVPKTINFO = 0x24 - sysIPV6_RECVHOPLIMIT = 0x25 - sysIPV6_RECVRTHDR = 0x26 - sysIPV6_RECVHOPOPTS = 0x27 - sysIPV6_RECVDSTOPTS = 0x28 - - sysIPV6_USE_MIN_MTU = 0x2a - sysIPV6_RECVPATHMTU = 0x2b - - sysIPV6_PATHMTU = 0x2c - - sysIPV6_PKTINFO = 0x2e - sysIPV6_HOPLIMIT = 0x2f - sysIPV6_NEXTHOP = 0x30 - sysIPV6_HOPOPTS = 0x31 - sysIPV6_DSTOPTS = 0x32 - sysIPV6_RTHDR = 0x33 - - sysIPV6_RECVTCLASS = 0x39 - - sysIPV6_AUTOFLOWLABEL = 0x3b - - sysIPV6_TCLASS = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_PREFER_TEMPADDR = 0x3f - - sysIPV6_PORTRANGE_DEFAULT = 0x0 - sysIPV6_PORTRANGE_HIGH = 0x1 - sysIPV6_PORTRANGE_LOW = 0x2 - sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 sizeofIPv6Mtuinfo = 0x20 diff --git a/vendor/golang.org/x/net/ipv6/zsys_freebsd_386.go b/vendor/golang.org/x/net/ipv6/zsys_freebsd_386.go index 73f31b260e..8da55925f7 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_freebsd_386.go +++ b/vendor/golang.org/x/net/ipv6/zsys_freebsd_386.go @@ -4,64 +4,6 @@ package ipv6 const ( - sysIPV6_UNICAST_HOPS = 0x4 - sysIPV6_MULTICAST_IF = 0x9 - sysIPV6_MULTICAST_HOPS = 0xa - sysIPV6_MULTICAST_LOOP = 0xb - sysIPV6_JOIN_GROUP = 0xc - sysIPV6_LEAVE_GROUP = 0xd - sysIPV6_PORTRANGE = 0xe - sysICMP6_FILTER = 0x12 - - sysIPV6_CHECKSUM = 0x1a - sysIPV6_V6ONLY = 0x1b - - sysIPV6_IPSEC_POLICY = 0x1c - - sysIPV6_RTHDRDSTOPTS = 0x23 - - sysIPV6_RECVPKTINFO = 0x24 - sysIPV6_RECVHOPLIMIT = 0x25 - sysIPV6_RECVRTHDR = 0x26 - sysIPV6_RECVHOPOPTS = 0x27 - sysIPV6_RECVDSTOPTS = 0x28 - - sysIPV6_USE_MIN_MTU = 0x2a - sysIPV6_RECVPATHMTU = 0x2b - - sysIPV6_PATHMTU = 0x2c - - sysIPV6_PKTINFO = 0x2e - sysIPV6_HOPLIMIT = 0x2f - sysIPV6_NEXTHOP = 0x30 - sysIPV6_HOPOPTS = 0x31 - sysIPV6_DSTOPTS = 0x32 - sysIPV6_RTHDR = 0x33 - - sysIPV6_RECVTCLASS = 0x39 - - sysIPV6_AUTOFLOWLABEL = 0x3b - - sysIPV6_TCLASS = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_PREFER_TEMPADDR = 0x3f - - sysIPV6_BINDANY = 0x40 - - sysIPV6_MSFILTER = 0x4a - - sysMCAST_JOIN_GROUP = 0x50 - sysMCAST_LEAVE_GROUP = 0x51 - sysMCAST_JOIN_SOURCE_GROUP = 0x52 - sysMCAST_LEAVE_SOURCE_GROUP = 0x53 - sysMCAST_BLOCK_SOURCE = 0x54 - sysMCAST_UNBLOCK_SOURCE = 0x55 - - sysIPV6_PORTRANGE_DEFAULT = 0x0 - sysIPV6_PORTRANGE_HIGH = 0x1 - sysIPV6_PORTRANGE_LOW = 0x2 - sizeofSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_freebsd_amd64.go b/vendor/golang.org/x/net/ipv6/zsys_freebsd_amd64.go index 490ce7cf10..72a1a65a23 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_freebsd_amd64.go +++ b/vendor/golang.org/x/net/ipv6/zsys_freebsd_amd64.go @@ -4,64 +4,6 @@ package ipv6 const ( - sysIPV6_UNICAST_HOPS = 0x4 - sysIPV6_MULTICAST_IF = 0x9 - sysIPV6_MULTICAST_HOPS = 0xa - sysIPV6_MULTICAST_LOOP = 0xb - sysIPV6_JOIN_GROUP = 0xc - sysIPV6_LEAVE_GROUP = 0xd - sysIPV6_PORTRANGE = 0xe - sysICMP6_FILTER = 0x12 - - sysIPV6_CHECKSUM = 0x1a - sysIPV6_V6ONLY = 0x1b - - sysIPV6_IPSEC_POLICY = 0x1c - - sysIPV6_RTHDRDSTOPTS = 0x23 - - sysIPV6_RECVPKTINFO = 0x24 - sysIPV6_RECVHOPLIMIT = 0x25 - sysIPV6_RECVRTHDR = 0x26 - sysIPV6_RECVHOPOPTS = 0x27 - sysIPV6_RECVDSTOPTS = 0x28 - - sysIPV6_USE_MIN_MTU = 0x2a - sysIPV6_RECVPATHMTU = 0x2b - - sysIPV6_PATHMTU = 0x2c - - sysIPV6_PKTINFO = 0x2e - sysIPV6_HOPLIMIT = 0x2f - sysIPV6_NEXTHOP = 0x30 - sysIPV6_HOPOPTS = 0x31 - sysIPV6_DSTOPTS = 0x32 - sysIPV6_RTHDR = 0x33 - - sysIPV6_RECVTCLASS = 0x39 - - sysIPV6_AUTOFLOWLABEL = 0x3b - - sysIPV6_TCLASS = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_PREFER_TEMPADDR = 0x3f - - sysIPV6_BINDANY = 0x40 - - sysIPV6_MSFILTER = 0x4a - - sysMCAST_JOIN_GROUP = 0x50 - sysMCAST_LEAVE_GROUP = 0x51 - sysMCAST_JOIN_SOURCE_GROUP = 0x52 - sysMCAST_LEAVE_SOURCE_GROUP = 0x53 - sysMCAST_BLOCK_SOURCE = 0x54 - sysMCAST_UNBLOCK_SOURCE = 0x55 - - sysIPV6_PORTRANGE_DEFAULT = 0x0 - sysIPV6_PORTRANGE_HIGH = 0x1 - sysIPV6_PORTRANGE_LOW = 0x2 - sizeofSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm.go b/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm.go index 490ce7cf10..72a1a65a23 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm.go +++ b/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm.go @@ -4,64 +4,6 @@ package ipv6 const ( - sysIPV6_UNICAST_HOPS = 0x4 - sysIPV6_MULTICAST_IF = 0x9 - sysIPV6_MULTICAST_HOPS = 0xa - sysIPV6_MULTICAST_LOOP = 0xb - sysIPV6_JOIN_GROUP = 0xc - sysIPV6_LEAVE_GROUP = 0xd - sysIPV6_PORTRANGE = 0xe - sysICMP6_FILTER = 0x12 - - sysIPV6_CHECKSUM = 0x1a - sysIPV6_V6ONLY = 0x1b - - sysIPV6_IPSEC_POLICY = 0x1c - - sysIPV6_RTHDRDSTOPTS = 0x23 - - sysIPV6_RECVPKTINFO = 0x24 - sysIPV6_RECVHOPLIMIT = 0x25 - sysIPV6_RECVRTHDR = 0x26 - sysIPV6_RECVHOPOPTS = 0x27 - sysIPV6_RECVDSTOPTS = 0x28 - - sysIPV6_USE_MIN_MTU = 0x2a - sysIPV6_RECVPATHMTU = 0x2b - - sysIPV6_PATHMTU = 0x2c - - sysIPV6_PKTINFO = 0x2e - sysIPV6_HOPLIMIT = 0x2f - sysIPV6_NEXTHOP = 0x30 - sysIPV6_HOPOPTS = 0x31 - sysIPV6_DSTOPTS = 0x32 - sysIPV6_RTHDR = 0x33 - - sysIPV6_RECVTCLASS = 0x39 - - sysIPV6_AUTOFLOWLABEL = 0x3b - - sysIPV6_TCLASS = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_PREFER_TEMPADDR = 0x3f - - sysIPV6_BINDANY = 0x40 - - sysIPV6_MSFILTER = 0x4a - - sysMCAST_JOIN_GROUP = 0x50 - sysMCAST_LEAVE_GROUP = 0x51 - sysMCAST_JOIN_SOURCE_GROUP = 0x52 - sysMCAST_LEAVE_SOURCE_GROUP = 0x53 - sysMCAST_BLOCK_SOURCE = 0x54 - sysMCAST_UNBLOCK_SOURCE = 0x55 - - sysIPV6_PORTRANGE_DEFAULT = 0x0 - sysIPV6_PORTRANGE_HIGH = 0x1 - sysIPV6_PORTRANGE_LOW = 0x2 - sizeofSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm64.go b/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm64.go index 47e99ac9d3..5b39eb8dfd 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm64.go +++ b/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm64.go @@ -4,64 +4,6 @@ package ipv6 const ( - sysIPV6_UNICAST_HOPS = 0x4 - sysIPV6_MULTICAST_IF = 0x9 - sysIPV6_MULTICAST_HOPS = 0xa - sysIPV6_MULTICAST_LOOP = 0xb - sysIPV6_JOIN_GROUP = 0xc - sysIPV6_LEAVE_GROUP = 0xd - sysIPV6_PORTRANGE = 0xe - sysICMP6_FILTER = 0x12 - - sysIPV6_CHECKSUM = 0x1a - sysIPV6_V6ONLY = 0x1b - - sysIPV6_IPSEC_POLICY = 0x1c - - sysIPV6_RTHDRDSTOPTS = 0x23 - - sysIPV6_RECVPKTINFO = 0x24 - sysIPV6_RECVHOPLIMIT = 0x25 - sysIPV6_RECVRTHDR = 0x26 - sysIPV6_RECVHOPOPTS = 0x27 - sysIPV6_RECVDSTOPTS = 0x28 - - sysIPV6_USE_MIN_MTU = 0x2a - sysIPV6_RECVPATHMTU = 0x2b - - sysIPV6_PATHMTU = 0x2c - - sysIPV6_PKTINFO = 0x2e - sysIPV6_HOPLIMIT = 0x2f - sysIPV6_NEXTHOP = 0x30 - sysIPV6_HOPOPTS = 0x31 - sysIPV6_DSTOPTS = 0x32 - sysIPV6_RTHDR = 0x33 - - sysIPV6_RECVTCLASS = 0x39 - - sysIPV6_AUTOFLOWLABEL = 0x3b - - sysIPV6_TCLASS = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_PREFER_TEMPADDR = 0x3f - - sysIPV6_BINDANY = 0x40 - - sysIPV6_MSFILTER = 0x4a - - sysMCAST_JOIN_GROUP = 0x50 - sysMCAST_LEAVE_GROUP = 0x51 - sysMCAST_JOIN_SOURCE_GROUP = 0x52 - sysMCAST_LEAVE_SOURCE_GROUP = 0x53 - sysMCAST_BLOCK_SOURCE = 0x54 - sysMCAST_UNBLOCK_SOURCE = 0x55 - - sysIPV6_PORTRANGE_DEFAULT = 0x0 - sysIPV6_PORTRANGE_HIGH = 0x1 - sysIPV6_PORTRANGE_LOW = 0x2 - sizeofSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_386.go b/vendor/golang.org/x/net/ipv6/zsys_linux_386.go index bde4a8f8f5..ad71871b78 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_386.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_386.go @@ -4,86 +4,6 @@ package ipv6 const ( - sysIPV6_ADDRFORM = 0x1 - sysIPV6_2292PKTINFO = 0x2 - sysIPV6_2292HOPOPTS = 0x3 - sysIPV6_2292DSTOPTS = 0x4 - sysIPV6_2292RTHDR = 0x5 - sysIPV6_2292PKTOPTIONS = 0x6 - sysIPV6_CHECKSUM = 0x7 - sysIPV6_2292HOPLIMIT = 0x8 - sysIPV6_NEXTHOP = 0x9 - sysIPV6_FLOWINFO = 0xb - - sysIPV6_UNICAST_HOPS = 0x10 - sysIPV6_MULTICAST_IF = 0x11 - sysIPV6_MULTICAST_HOPS = 0x12 - sysIPV6_MULTICAST_LOOP = 0x13 - sysIPV6_ADD_MEMBERSHIP = 0x14 - sysIPV6_DROP_MEMBERSHIP = 0x15 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIPV6_ROUTER_ALERT = 0x16 - sysIPV6_MTU_DISCOVER = 0x17 - sysIPV6_MTU = 0x18 - sysIPV6_RECVERR = 0x19 - sysIPV6_V6ONLY = 0x1a - sysIPV6_JOIN_ANYCAST = 0x1b - sysIPV6_LEAVE_ANYCAST = 0x1c - - sysIPV6_FLOWLABEL_MGR = 0x20 - sysIPV6_FLOWINFO_SEND = 0x21 - - sysIPV6_IPSEC_POLICY = 0x22 - sysIPV6_XFRM_POLICY = 0x23 - - sysIPV6_RECVPKTINFO = 0x31 - sysIPV6_PKTINFO = 0x32 - sysIPV6_RECVHOPLIMIT = 0x33 - sysIPV6_HOPLIMIT = 0x34 - sysIPV6_RECVHOPOPTS = 0x35 - sysIPV6_HOPOPTS = 0x36 - sysIPV6_RTHDRDSTOPTS = 0x37 - sysIPV6_RECVRTHDR = 0x38 - sysIPV6_RTHDR = 0x39 - sysIPV6_RECVDSTOPTS = 0x3a - sysIPV6_DSTOPTS = 0x3b - sysIPV6_RECVPATHMTU = 0x3c - sysIPV6_PATHMTU = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_RECVTCLASS = 0x42 - sysIPV6_TCLASS = 0x43 - - sysIPV6_ADDR_PREFERENCES = 0x48 - - sysIPV6_PREFER_SRC_TMP = 0x1 - sysIPV6_PREFER_SRC_PUBLIC = 0x2 - sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 - sysIPV6_PREFER_SRC_COA = 0x4 - sysIPV6_PREFER_SRC_HOME = 0x400 - sysIPV6_PREFER_SRC_CGA = 0x8 - sysIPV6_PREFER_SRC_NONCGA = 0x800 - - sysIPV6_MINHOPCOUNT = 0x49 - - sysIPV6_ORIGDSTADDR = 0x4a - sysIPV6_RECVORIGDSTADDR = 0x4a - sysIPV6_TRANSPARENT = 0x4b - sysIPV6_UNICAST_IF = 0x4c - - sysICMPV6_FILTER = 0x1 - - sysICMPV6_FILTER_BLOCK = 0x1 - sysICMPV6_FILTER_PASS = 0x2 - sysICMPV6_FILTER_BLOCKOTHERS = 0x3 - sysICMPV6_FILTER_PASSONLY = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_amd64.go b/vendor/golang.org/x/net/ipv6/zsys_linux_amd64.go index 992ac9ec5f..2514ab9a41 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_amd64.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_amd64.go @@ -4,86 +4,6 @@ package ipv6 const ( - sysIPV6_ADDRFORM = 0x1 - sysIPV6_2292PKTINFO = 0x2 - sysIPV6_2292HOPOPTS = 0x3 - sysIPV6_2292DSTOPTS = 0x4 - sysIPV6_2292RTHDR = 0x5 - sysIPV6_2292PKTOPTIONS = 0x6 - sysIPV6_CHECKSUM = 0x7 - sysIPV6_2292HOPLIMIT = 0x8 - sysIPV6_NEXTHOP = 0x9 - sysIPV6_FLOWINFO = 0xb - - sysIPV6_UNICAST_HOPS = 0x10 - sysIPV6_MULTICAST_IF = 0x11 - sysIPV6_MULTICAST_HOPS = 0x12 - sysIPV6_MULTICAST_LOOP = 0x13 - sysIPV6_ADD_MEMBERSHIP = 0x14 - sysIPV6_DROP_MEMBERSHIP = 0x15 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIPV6_ROUTER_ALERT = 0x16 - sysIPV6_MTU_DISCOVER = 0x17 - sysIPV6_MTU = 0x18 - sysIPV6_RECVERR = 0x19 - sysIPV6_V6ONLY = 0x1a - sysIPV6_JOIN_ANYCAST = 0x1b - sysIPV6_LEAVE_ANYCAST = 0x1c - - sysIPV6_FLOWLABEL_MGR = 0x20 - sysIPV6_FLOWINFO_SEND = 0x21 - - sysIPV6_IPSEC_POLICY = 0x22 - sysIPV6_XFRM_POLICY = 0x23 - - sysIPV6_RECVPKTINFO = 0x31 - sysIPV6_PKTINFO = 0x32 - sysIPV6_RECVHOPLIMIT = 0x33 - sysIPV6_HOPLIMIT = 0x34 - sysIPV6_RECVHOPOPTS = 0x35 - sysIPV6_HOPOPTS = 0x36 - sysIPV6_RTHDRDSTOPTS = 0x37 - sysIPV6_RECVRTHDR = 0x38 - sysIPV6_RTHDR = 0x39 - sysIPV6_RECVDSTOPTS = 0x3a - sysIPV6_DSTOPTS = 0x3b - sysIPV6_RECVPATHMTU = 0x3c - sysIPV6_PATHMTU = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_RECVTCLASS = 0x42 - sysIPV6_TCLASS = 0x43 - - sysIPV6_ADDR_PREFERENCES = 0x48 - - sysIPV6_PREFER_SRC_TMP = 0x1 - sysIPV6_PREFER_SRC_PUBLIC = 0x2 - sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 - sysIPV6_PREFER_SRC_COA = 0x4 - sysIPV6_PREFER_SRC_HOME = 0x400 - sysIPV6_PREFER_SRC_CGA = 0x8 - sysIPV6_PREFER_SRC_NONCGA = 0x800 - - sysIPV6_MINHOPCOUNT = 0x49 - - sysIPV6_ORIGDSTADDR = 0x4a - sysIPV6_RECVORIGDSTADDR = 0x4a - sysIPV6_TRANSPARENT = 0x4b - sysIPV6_UNICAST_IF = 0x4c - - sysICMPV6_FILTER = 0x1 - - sysICMPV6_FILTER_BLOCK = 0x1 - sysICMPV6_FILTER_PASS = 0x2 - sysICMPV6_FILTER_BLOCKOTHERS = 0x3 - sysICMPV6_FILTER_PASSONLY = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_arm.go b/vendor/golang.org/x/net/ipv6/zsys_linux_arm.go index bde4a8f8f5..ad71871b78 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_arm.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_arm.go @@ -4,86 +4,6 @@ package ipv6 const ( - sysIPV6_ADDRFORM = 0x1 - sysIPV6_2292PKTINFO = 0x2 - sysIPV6_2292HOPOPTS = 0x3 - sysIPV6_2292DSTOPTS = 0x4 - sysIPV6_2292RTHDR = 0x5 - sysIPV6_2292PKTOPTIONS = 0x6 - sysIPV6_CHECKSUM = 0x7 - sysIPV6_2292HOPLIMIT = 0x8 - sysIPV6_NEXTHOP = 0x9 - sysIPV6_FLOWINFO = 0xb - - sysIPV6_UNICAST_HOPS = 0x10 - sysIPV6_MULTICAST_IF = 0x11 - sysIPV6_MULTICAST_HOPS = 0x12 - sysIPV6_MULTICAST_LOOP = 0x13 - sysIPV6_ADD_MEMBERSHIP = 0x14 - sysIPV6_DROP_MEMBERSHIP = 0x15 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIPV6_ROUTER_ALERT = 0x16 - sysIPV6_MTU_DISCOVER = 0x17 - sysIPV6_MTU = 0x18 - sysIPV6_RECVERR = 0x19 - sysIPV6_V6ONLY = 0x1a - sysIPV6_JOIN_ANYCAST = 0x1b - sysIPV6_LEAVE_ANYCAST = 0x1c - - sysIPV6_FLOWLABEL_MGR = 0x20 - sysIPV6_FLOWINFO_SEND = 0x21 - - sysIPV6_IPSEC_POLICY = 0x22 - sysIPV6_XFRM_POLICY = 0x23 - - sysIPV6_RECVPKTINFO = 0x31 - sysIPV6_PKTINFO = 0x32 - sysIPV6_RECVHOPLIMIT = 0x33 - sysIPV6_HOPLIMIT = 0x34 - sysIPV6_RECVHOPOPTS = 0x35 - sysIPV6_HOPOPTS = 0x36 - sysIPV6_RTHDRDSTOPTS = 0x37 - sysIPV6_RECVRTHDR = 0x38 - sysIPV6_RTHDR = 0x39 - sysIPV6_RECVDSTOPTS = 0x3a - sysIPV6_DSTOPTS = 0x3b - sysIPV6_RECVPATHMTU = 0x3c - sysIPV6_PATHMTU = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_RECVTCLASS = 0x42 - sysIPV6_TCLASS = 0x43 - - sysIPV6_ADDR_PREFERENCES = 0x48 - - sysIPV6_PREFER_SRC_TMP = 0x1 - sysIPV6_PREFER_SRC_PUBLIC = 0x2 - sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 - sysIPV6_PREFER_SRC_COA = 0x4 - sysIPV6_PREFER_SRC_HOME = 0x400 - sysIPV6_PREFER_SRC_CGA = 0x8 - sysIPV6_PREFER_SRC_NONCGA = 0x800 - - sysIPV6_MINHOPCOUNT = 0x49 - - sysIPV6_ORIGDSTADDR = 0x4a - sysIPV6_RECVORIGDSTADDR = 0x4a - sysIPV6_TRANSPARENT = 0x4b - sysIPV6_UNICAST_IF = 0x4c - - sysICMPV6_FILTER = 0x1 - - sysICMPV6_FILTER_BLOCK = 0x1 - sysICMPV6_FILTER_PASS = 0x2 - sysICMPV6_FILTER_BLOCKOTHERS = 0x3 - sysICMPV6_FILTER_PASSONLY = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_arm64.go b/vendor/golang.org/x/net/ipv6/zsys_linux_arm64.go index 992ac9ec5f..2514ab9a41 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_arm64.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_arm64.go @@ -4,86 +4,6 @@ package ipv6 const ( - sysIPV6_ADDRFORM = 0x1 - sysIPV6_2292PKTINFO = 0x2 - sysIPV6_2292HOPOPTS = 0x3 - sysIPV6_2292DSTOPTS = 0x4 - sysIPV6_2292RTHDR = 0x5 - sysIPV6_2292PKTOPTIONS = 0x6 - sysIPV6_CHECKSUM = 0x7 - sysIPV6_2292HOPLIMIT = 0x8 - sysIPV6_NEXTHOP = 0x9 - sysIPV6_FLOWINFO = 0xb - - sysIPV6_UNICAST_HOPS = 0x10 - sysIPV6_MULTICAST_IF = 0x11 - sysIPV6_MULTICAST_HOPS = 0x12 - sysIPV6_MULTICAST_LOOP = 0x13 - sysIPV6_ADD_MEMBERSHIP = 0x14 - sysIPV6_DROP_MEMBERSHIP = 0x15 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIPV6_ROUTER_ALERT = 0x16 - sysIPV6_MTU_DISCOVER = 0x17 - sysIPV6_MTU = 0x18 - sysIPV6_RECVERR = 0x19 - sysIPV6_V6ONLY = 0x1a - sysIPV6_JOIN_ANYCAST = 0x1b - sysIPV6_LEAVE_ANYCAST = 0x1c - - sysIPV6_FLOWLABEL_MGR = 0x20 - sysIPV6_FLOWINFO_SEND = 0x21 - - sysIPV6_IPSEC_POLICY = 0x22 - sysIPV6_XFRM_POLICY = 0x23 - - sysIPV6_RECVPKTINFO = 0x31 - sysIPV6_PKTINFO = 0x32 - sysIPV6_RECVHOPLIMIT = 0x33 - sysIPV6_HOPLIMIT = 0x34 - sysIPV6_RECVHOPOPTS = 0x35 - sysIPV6_HOPOPTS = 0x36 - sysIPV6_RTHDRDSTOPTS = 0x37 - sysIPV6_RECVRTHDR = 0x38 - sysIPV6_RTHDR = 0x39 - sysIPV6_RECVDSTOPTS = 0x3a - sysIPV6_DSTOPTS = 0x3b - sysIPV6_RECVPATHMTU = 0x3c - sysIPV6_PATHMTU = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_RECVTCLASS = 0x42 - sysIPV6_TCLASS = 0x43 - - sysIPV6_ADDR_PREFERENCES = 0x48 - - sysIPV6_PREFER_SRC_TMP = 0x1 - sysIPV6_PREFER_SRC_PUBLIC = 0x2 - sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 - sysIPV6_PREFER_SRC_COA = 0x4 - sysIPV6_PREFER_SRC_HOME = 0x400 - sysIPV6_PREFER_SRC_CGA = 0x8 - sysIPV6_PREFER_SRC_NONCGA = 0x800 - - sysIPV6_MINHOPCOUNT = 0x49 - - sysIPV6_ORIGDSTADDR = 0x4a - sysIPV6_RECVORIGDSTADDR = 0x4a - sysIPV6_TRANSPARENT = 0x4b - sysIPV6_UNICAST_IF = 0x4c - - sysICMPV6_FILTER = 0x1 - - sysICMPV6_FILTER_BLOCK = 0x1 - sysICMPV6_FILTER_PASS = 0x2 - sysICMPV6_FILTER_BLOCKOTHERS = 0x3 - sysICMPV6_FILTER_PASSONLY = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_mips.go b/vendor/golang.org/x/net/ipv6/zsys_linux_mips.go index bde4a8f8f5..ad71871b78 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_mips.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_mips.go @@ -4,86 +4,6 @@ package ipv6 const ( - sysIPV6_ADDRFORM = 0x1 - sysIPV6_2292PKTINFO = 0x2 - sysIPV6_2292HOPOPTS = 0x3 - sysIPV6_2292DSTOPTS = 0x4 - sysIPV6_2292RTHDR = 0x5 - sysIPV6_2292PKTOPTIONS = 0x6 - sysIPV6_CHECKSUM = 0x7 - sysIPV6_2292HOPLIMIT = 0x8 - sysIPV6_NEXTHOP = 0x9 - sysIPV6_FLOWINFO = 0xb - - sysIPV6_UNICAST_HOPS = 0x10 - sysIPV6_MULTICAST_IF = 0x11 - sysIPV6_MULTICAST_HOPS = 0x12 - sysIPV6_MULTICAST_LOOP = 0x13 - sysIPV6_ADD_MEMBERSHIP = 0x14 - sysIPV6_DROP_MEMBERSHIP = 0x15 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIPV6_ROUTER_ALERT = 0x16 - sysIPV6_MTU_DISCOVER = 0x17 - sysIPV6_MTU = 0x18 - sysIPV6_RECVERR = 0x19 - sysIPV6_V6ONLY = 0x1a - sysIPV6_JOIN_ANYCAST = 0x1b - sysIPV6_LEAVE_ANYCAST = 0x1c - - sysIPV6_FLOWLABEL_MGR = 0x20 - sysIPV6_FLOWINFO_SEND = 0x21 - - sysIPV6_IPSEC_POLICY = 0x22 - sysIPV6_XFRM_POLICY = 0x23 - - sysIPV6_RECVPKTINFO = 0x31 - sysIPV6_PKTINFO = 0x32 - sysIPV6_RECVHOPLIMIT = 0x33 - sysIPV6_HOPLIMIT = 0x34 - sysIPV6_RECVHOPOPTS = 0x35 - sysIPV6_HOPOPTS = 0x36 - sysIPV6_RTHDRDSTOPTS = 0x37 - sysIPV6_RECVRTHDR = 0x38 - sysIPV6_RTHDR = 0x39 - sysIPV6_RECVDSTOPTS = 0x3a - sysIPV6_DSTOPTS = 0x3b - sysIPV6_RECVPATHMTU = 0x3c - sysIPV6_PATHMTU = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_RECVTCLASS = 0x42 - sysIPV6_TCLASS = 0x43 - - sysIPV6_ADDR_PREFERENCES = 0x48 - - sysIPV6_PREFER_SRC_TMP = 0x1 - sysIPV6_PREFER_SRC_PUBLIC = 0x2 - sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 - sysIPV6_PREFER_SRC_COA = 0x4 - sysIPV6_PREFER_SRC_HOME = 0x400 - sysIPV6_PREFER_SRC_CGA = 0x8 - sysIPV6_PREFER_SRC_NONCGA = 0x800 - - sysIPV6_MINHOPCOUNT = 0x49 - - sysIPV6_ORIGDSTADDR = 0x4a - sysIPV6_RECVORIGDSTADDR = 0x4a - sysIPV6_TRANSPARENT = 0x4b - sysIPV6_UNICAST_IF = 0x4c - - sysICMPV6_FILTER = 0x1 - - sysICMPV6_FILTER_BLOCK = 0x1 - sysICMPV6_FILTER_PASS = 0x2 - sysICMPV6_FILTER_BLOCKOTHERS = 0x3 - sysICMPV6_FILTER_PASSONLY = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_mips64.go b/vendor/golang.org/x/net/ipv6/zsys_linux_mips64.go index 992ac9ec5f..2514ab9a41 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_mips64.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_mips64.go @@ -4,86 +4,6 @@ package ipv6 const ( - sysIPV6_ADDRFORM = 0x1 - sysIPV6_2292PKTINFO = 0x2 - sysIPV6_2292HOPOPTS = 0x3 - sysIPV6_2292DSTOPTS = 0x4 - sysIPV6_2292RTHDR = 0x5 - sysIPV6_2292PKTOPTIONS = 0x6 - sysIPV6_CHECKSUM = 0x7 - sysIPV6_2292HOPLIMIT = 0x8 - sysIPV6_NEXTHOP = 0x9 - sysIPV6_FLOWINFO = 0xb - - sysIPV6_UNICAST_HOPS = 0x10 - sysIPV6_MULTICAST_IF = 0x11 - sysIPV6_MULTICAST_HOPS = 0x12 - sysIPV6_MULTICAST_LOOP = 0x13 - sysIPV6_ADD_MEMBERSHIP = 0x14 - sysIPV6_DROP_MEMBERSHIP = 0x15 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIPV6_ROUTER_ALERT = 0x16 - sysIPV6_MTU_DISCOVER = 0x17 - sysIPV6_MTU = 0x18 - sysIPV6_RECVERR = 0x19 - sysIPV6_V6ONLY = 0x1a - sysIPV6_JOIN_ANYCAST = 0x1b - sysIPV6_LEAVE_ANYCAST = 0x1c - - sysIPV6_FLOWLABEL_MGR = 0x20 - sysIPV6_FLOWINFO_SEND = 0x21 - - sysIPV6_IPSEC_POLICY = 0x22 - sysIPV6_XFRM_POLICY = 0x23 - - sysIPV6_RECVPKTINFO = 0x31 - sysIPV6_PKTINFO = 0x32 - sysIPV6_RECVHOPLIMIT = 0x33 - sysIPV6_HOPLIMIT = 0x34 - sysIPV6_RECVHOPOPTS = 0x35 - sysIPV6_HOPOPTS = 0x36 - sysIPV6_RTHDRDSTOPTS = 0x37 - sysIPV6_RECVRTHDR = 0x38 - sysIPV6_RTHDR = 0x39 - sysIPV6_RECVDSTOPTS = 0x3a - sysIPV6_DSTOPTS = 0x3b - sysIPV6_RECVPATHMTU = 0x3c - sysIPV6_PATHMTU = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_RECVTCLASS = 0x42 - sysIPV6_TCLASS = 0x43 - - sysIPV6_ADDR_PREFERENCES = 0x48 - - sysIPV6_PREFER_SRC_TMP = 0x1 - sysIPV6_PREFER_SRC_PUBLIC = 0x2 - sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 - sysIPV6_PREFER_SRC_COA = 0x4 - sysIPV6_PREFER_SRC_HOME = 0x400 - sysIPV6_PREFER_SRC_CGA = 0x8 - sysIPV6_PREFER_SRC_NONCGA = 0x800 - - sysIPV6_MINHOPCOUNT = 0x49 - - sysIPV6_ORIGDSTADDR = 0x4a - sysIPV6_RECVORIGDSTADDR = 0x4a - sysIPV6_TRANSPARENT = 0x4b - sysIPV6_UNICAST_IF = 0x4c - - sysICMPV6_FILTER = 0x1 - - sysICMPV6_FILTER_BLOCK = 0x1 - sysICMPV6_FILTER_PASS = 0x2 - sysICMPV6_FILTER_BLOCKOTHERS = 0x3 - sysICMPV6_FILTER_PASSONLY = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_mips64le.go b/vendor/golang.org/x/net/ipv6/zsys_linux_mips64le.go index 992ac9ec5f..2514ab9a41 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_mips64le.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_mips64le.go @@ -4,86 +4,6 @@ package ipv6 const ( - sysIPV6_ADDRFORM = 0x1 - sysIPV6_2292PKTINFO = 0x2 - sysIPV6_2292HOPOPTS = 0x3 - sysIPV6_2292DSTOPTS = 0x4 - sysIPV6_2292RTHDR = 0x5 - sysIPV6_2292PKTOPTIONS = 0x6 - sysIPV6_CHECKSUM = 0x7 - sysIPV6_2292HOPLIMIT = 0x8 - sysIPV6_NEXTHOP = 0x9 - sysIPV6_FLOWINFO = 0xb - - sysIPV6_UNICAST_HOPS = 0x10 - sysIPV6_MULTICAST_IF = 0x11 - sysIPV6_MULTICAST_HOPS = 0x12 - sysIPV6_MULTICAST_LOOP = 0x13 - sysIPV6_ADD_MEMBERSHIP = 0x14 - sysIPV6_DROP_MEMBERSHIP = 0x15 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIPV6_ROUTER_ALERT = 0x16 - sysIPV6_MTU_DISCOVER = 0x17 - sysIPV6_MTU = 0x18 - sysIPV6_RECVERR = 0x19 - sysIPV6_V6ONLY = 0x1a - sysIPV6_JOIN_ANYCAST = 0x1b - sysIPV6_LEAVE_ANYCAST = 0x1c - - sysIPV6_FLOWLABEL_MGR = 0x20 - sysIPV6_FLOWINFO_SEND = 0x21 - - sysIPV6_IPSEC_POLICY = 0x22 - sysIPV6_XFRM_POLICY = 0x23 - - sysIPV6_RECVPKTINFO = 0x31 - sysIPV6_PKTINFO = 0x32 - sysIPV6_RECVHOPLIMIT = 0x33 - sysIPV6_HOPLIMIT = 0x34 - sysIPV6_RECVHOPOPTS = 0x35 - sysIPV6_HOPOPTS = 0x36 - sysIPV6_RTHDRDSTOPTS = 0x37 - sysIPV6_RECVRTHDR = 0x38 - sysIPV6_RTHDR = 0x39 - sysIPV6_RECVDSTOPTS = 0x3a - sysIPV6_DSTOPTS = 0x3b - sysIPV6_RECVPATHMTU = 0x3c - sysIPV6_PATHMTU = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_RECVTCLASS = 0x42 - sysIPV6_TCLASS = 0x43 - - sysIPV6_ADDR_PREFERENCES = 0x48 - - sysIPV6_PREFER_SRC_TMP = 0x1 - sysIPV6_PREFER_SRC_PUBLIC = 0x2 - sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 - sysIPV6_PREFER_SRC_COA = 0x4 - sysIPV6_PREFER_SRC_HOME = 0x400 - sysIPV6_PREFER_SRC_CGA = 0x8 - sysIPV6_PREFER_SRC_NONCGA = 0x800 - - sysIPV6_MINHOPCOUNT = 0x49 - - sysIPV6_ORIGDSTADDR = 0x4a - sysIPV6_RECVORIGDSTADDR = 0x4a - sysIPV6_TRANSPARENT = 0x4b - sysIPV6_UNICAST_IF = 0x4c - - sysICMPV6_FILTER = 0x1 - - sysICMPV6_FILTER_BLOCK = 0x1 - sysICMPV6_FILTER_PASS = 0x2 - sysICMPV6_FILTER_BLOCKOTHERS = 0x3 - sysICMPV6_FILTER_PASSONLY = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_mipsle.go b/vendor/golang.org/x/net/ipv6/zsys_linux_mipsle.go index bde4a8f8f5..ad71871b78 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_mipsle.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_mipsle.go @@ -4,86 +4,6 @@ package ipv6 const ( - sysIPV6_ADDRFORM = 0x1 - sysIPV6_2292PKTINFO = 0x2 - sysIPV6_2292HOPOPTS = 0x3 - sysIPV6_2292DSTOPTS = 0x4 - sysIPV6_2292RTHDR = 0x5 - sysIPV6_2292PKTOPTIONS = 0x6 - sysIPV6_CHECKSUM = 0x7 - sysIPV6_2292HOPLIMIT = 0x8 - sysIPV6_NEXTHOP = 0x9 - sysIPV6_FLOWINFO = 0xb - - sysIPV6_UNICAST_HOPS = 0x10 - sysIPV6_MULTICAST_IF = 0x11 - sysIPV6_MULTICAST_HOPS = 0x12 - sysIPV6_MULTICAST_LOOP = 0x13 - sysIPV6_ADD_MEMBERSHIP = 0x14 - sysIPV6_DROP_MEMBERSHIP = 0x15 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIPV6_ROUTER_ALERT = 0x16 - sysIPV6_MTU_DISCOVER = 0x17 - sysIPV6_MTU = 0x18 - sysIPV6_RECVERR = 0x19 - sysIPV6_V6ONLY = 0x1a - sysIPV6_JOIN_ANYCAST = 0x1b - sysIPV6_LEAVE_ANYCAST = 0x1c - - sysIPV6_FLOWLABEL_MGR = 0x20 - sysIPV6_FLOWINFO_SEND = 0x21 - - sysIPV6_IPSEC_POLICY = 0x22 - sysIPV6_XFRM_POLICY = 0x23 - - sysIPV6_RECVPKTINFO = 0x31 - sysIPV6_PKTINFO = 0x32 - sysIPV6_RECVHOPLIMIT = 0x33 - sysIPV6_HOPLIMIT = 0x34 - sysIPV6_RECVHOPOPTS = 0x35 - sysIPV6_HOPOPTS = 0x36 - sysIPV6_RTHDRDSTOPTS = 0x37 - sysIPV6_RECVRTHDR = 0x38 - sysIPV6_RTHDR = 0x39 - sysIPV6_RECVDSTOPTS = 0x3a - sysIPV6_DSTOPTS = 0x3b - sysIPV6_RECVPATHMTU = 0x3c - sysIPV6_PATHMTU = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_RECVTCLASS = 0x42 - sysIPV6_TCLASS = 0x43 - - sysIPV6_ADDR_PREFERENCES = 0x48 - - sysIPV6_PREFER_SRC_TMP = 0x1 - sysIPV6_PREFER_SRC_PUBLIC = 0x2 - sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 - sysIPV6_PREFER_SRC_COA = 0x4 - sysIPV6_PREFER_SRC_HOME = 0x400 - sysIPV6_PREFER_SRC_CGA = 0x8 - sysIPV6_PREFER_SRC_NONCGA = 0x800 - - sysIPV6_MINHOPCOUNT = 0x49 - - sysIPV6_ORIGDSTADDR = 0x4a - sysIPV6_RECVORIGDSTADDR = 0x4a - sysIPV6_TRANSPARENT = 0x4b - sysIPV6_UNICAST_IF = 0x4c - - sysICMPV6_FILTER = 0x1 - - sysICMPV6_FILTER_BLOCK = 0x1 - sysICMPV6_FILTER_PASS = 0x2 - sysICMPV6_FILTER_BLOCKOTHERS = 0x3 - sysICMPV6_FILTER_PASSONLY = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_ppc.go b/vendor/golang.org/x/net/ipv6/zsys_linux_ppc.go index 66fd236121..d06c2adecb 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_ppc.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_ppc.go @@ -4,86 +4,6 @@ package ipv6 const ( - sysIPV6_ADDRFORM = 0x1 - sysIPV6_2292PKTINFO = 0x2 - sysIPV6_2292HOPOPTS = 0x3 - sysIPV6_2292DSTOPTS = 0x4 - sysIPV6_2292RTHDR = 0x5 - sysIPV6_2292PKTOPTIONS = 0x6 - sysIPV6_CHECKSUM = 0x7 - sysIPV6_2292HOPLIMIT = 0x8 - sysIPV6_NEXTHOP = 0x9 - sysIPV6_FLOWINFO = 0xb - - sysIPV6_UNICAST_HOPS = 0x10 - sysIPV6_MULTICAST_IF = 0x11 - sysIPV6_MULTICAST_HOPS = 0x12 - sysIPV6_MULTICAST_LOOP = 0x13 - sysIPV6_ADD_MEMBERSHIP = 0x14 - sysIPV6_DROP_MEMBERSHIP = 0x15 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIPV6_ROUTER_ALERT = 0x16 - sysIPV6_MTU_DISCOVER = 0x17 - sysIPV6_MTU = 0x18 - sysIPV6_RECVERR = 0x19 - sysIPV6_V6ONLY = 0x1a - sysIPV6_JOIN_ANYCAST = 0x1b - sysIPV6_LEAVE_ANYCAST = 0x1c - - sysIPV6_FLOWLABEL_MGR = 0x20 - sysIPV6_FLOWINFO_SEND = 0x21 - - sysIPV6_IPSEC_POLICY = 0x22 - sysIPV6_XFRM_POLICY = 0x23 - - sysIPV6_RECVPKTINFO = 0x31 - sysIPV6_PKTINFO = 0x32 - sysIPV6_RECVHOPLIMIT = 0x33 - sysIPV6_HOPLIMIT = 0x34 - sysIPV6_RECVHOPOPTS = 0x35 - sysIPV6_HOPOPTS = 0x36 - sysIPV6_RTHDRDSTOPTS = 0x37 - sysIPV6_RECVRTHDR = 0x38 - sysIPV6_RTHDR = 0x39 - sysIPV6_RECVDSTOPTS = 0x3a - sysIPV6_DSTOPTS = 0x3b - sysIPV6_RECVPATHMTU = 0x3c - sysIPV6_PATHMTU = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_RECVTCLASS = 0x42 - sysIPV6_TCLASS = 0x43 - - sysIPV6_ADDR_PREFERENCES = 0x48 - - sysIPV6_PREFER_SRC_TMP = 0x1 - sysIPV6_PREFER_SRC_PUBLIC = 0x2 - sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 - sysIPV6_PREFER_SRC_COA = 0x4 - sysIPV6_PREFER_SRC_HOME = 0x400 - sysIPV6_PREFER_SRC_CGA = 0x8 - sysIPV6_PREFER_SRC_NONCGA = 0x800 - - sysIPV6_MINHOPCOUNT = 0x49 - - sysIPV6_ORIGDSTADDR = 0x4a - sysIPV6_RECVORIGDSTADDR = 0x4a - sysIPV6_TRANSPARENT = 0x4b - sysIPV6_UNICAST_IF = 0x4c - - sysICMPV6_FILTER = 0x1 - - sysICMPV6_FILTER_BLOCK = 0x1 - sysICMPV6_FILTER_PASS = 0x2 - sysICMPV6_FILTER_BLOCKOTHERS = 0x3 - sysICMPV6_FILTER_PASSONLY = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64.go b/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64.go index 992ac9ec5f..2514ab9a41 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64.go @@ -4,86 +4,6 @@ package ipv6 const ( - sysIPV6_ADDRFORM = 0x1 - sysIPV6_2292PKTINFO = 0x2 - sysIPV6_2292HOPOPTS = 0x3 - sysIPV6_2292DSTOPTS = 0x4 - sysIPV6_2292RTHDR = 0x5 - sysIPV6_2292PKTOPTIONS = 0x6 - sysIPV6_CHECKSUM = 0x7 - sysIPV6_2292HOPLIMIT = 0x8 - sysIPV6_NEXTHOP = 0x9 - sysIPV6_FLOWINFO = 0xb - - sysIPV6_UNICAST_HOPS = 0x10 - sysIPV6_MULTICAST_IF = 0x11 - sysIPV6_MULTICAST_HOPS = 0x12 - sysIPV6_MULTICAST_LOOP = 0x13 - sysIPV6_ADD_MEMBERSHIP = 0x14 - sysIPV6_DROP_MEMBERSHIP = 0x15 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIPV6_ROUTER_ALERT = 0x16 - sysIPV6_MTU_DISCOVER = 0x17 - sysIPV6_MTU = 0x18 - sysIPV6_RECVERR = 0x19 - sysIPV6_V6ONLY = 0x1a - sysIPV6_JOIN_ANYCAST = 0x1b - sysIPV6_LEAVE_ANYCAST = 0x1c - - sysIPV6_FLOWLABEL_MGR = 0x20 - sysIPV6_FLOWINFO_SEND = 0x21 - - sysIPV6_IPSEC_POLICY = 0x22 - sysIPV6_XFRM_POLICY = 0x23 - - sysIPV6_RECVPKTINFO = 0x31 - sysIPV6_PKTINFO = 0x32 - sysIPV6_RECVHOPLIMIT = 0x33 - sysIPV6_HOPLIMIT = 0x34 - sysIPV6_RECVHOPOPTS = 0x35 - sysIPV6_HOPOPTS = 0x36 - sysIPV6_RTHDRDSTOPTS = 0x37 - sysIPV6_RECVRTHDR = 0x38 - sysIPV6_RTHDR = 0x39 - sysIPV6_RECVDSTOPTS = 0x3a - sysIPV6_DSTOPTS = 0x3b - sysIPV6_RECVPATHMTU = 0x3c - sysIPV6_PATHMTU = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_RECVTCLASS = 0x42 - sysIPV6_TCLASS = 0x43 - - sysIPV6_ADDR_PREFERENCES = 0x48 - - sysIPV6_PREFER_SRC_TMP = 0x1 - sysIPV6_PREFER_SRC_PUBLIC = 0x2 - sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 - sysIPV6_PREFER_SRC_COA = 0x4 - sysIPV6_PREFER_SRC_HOME = 0x400 - sysIPV6_PREFER_SRC_CGA = 0x8 - sysIPV6_PREFER_SRC_NONCGA = 0x800 - - sysIPV6_MINHOPCOUNT = 0x49 - - sysIPV6_ORIGDSTADDR = 0x4a - sysIPV6_RECVORIGDSTADDR = 0x4a - sysIPV6_TRANSPARENT = 0x4b - sysIPV6_UNICAST_IF = 0x4c - - sysICMPV6_FILTER = 0x1 - - sysICMPV6_FILTER_BLOCK = 0x1 - sysICMPV6_FILTER_PASS = 0x2 - sysICMPV6_FILTER_BLOCKOTHERS = 0x3 - sysICMPV6_FILTER_PASSONLY = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64le.go b/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64le.go index 992ac9ec5f..2514ab9a41 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64le.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64le.go @@ -4,86 +4,6 @@ package ipv6 const ( - sysIPV6_ADDRFORM = 0x1 - sysIPV6_2292PKTINFO = 0x2 - sysIPV6_2292HOPOPTS = 0x3 - sysIPV6_2292DSTOPTS = 0x4 - sysIPV6_2292RTHDR = 0x5 - sysIPV6_2292PKTOPTIONS = 0x6 - sysIPV6_CHECKSUM = 0x7 - sysIPV6_2292HOPLIMIT = 0x8 - sysIPV6_NEXTHOP = 0x9 - sysIPV6_FLOWINFO = 0xb - - sysIPV6_UNICAST_HOPS = 0x10 - sysIPV6_MULTICAST_IF = 0x11 - sysIPV6_MULTICAST_HOPS = 0x12 - sysIPV6_MULTICAST_LOOP = 0x13 - sysIPV6_ADD_MEMBERSHIP = 0x14 - sysIPV6_DROP_MEMBERSHIP = 0x15 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIPV6_ROUTER_ALERT = 0x16 - sysIPV6_MTU_DISCOVER = 0x17 - sysIPV6_MTU = 0x18 - sysIPV6_RECVERR = 0x19 - sysIPV6_V6ONLY = 0x1a - sysIPV6_JOIN_ANYCAST = 0x1b - sysIPV6_LEAVE_ANYCAST = 0x1c - - sysIPV6_FLOWLABEL_MGR = 0x20 - sysIPV6_FLOWINFO_SEND = 0x21 - - sysIPV6_IPSEC_POLICY = 0x22 - sysIPV6_XFRM_POLICY = 0x23 - - sysIPV6_RECVPKTINFO = 0x31 - sysIPV6_PKTINFO = 0x32 - sysIPV6_RECVHOPLIMIT = 0x33 - sysIPV6_HOPLIMIT = 0x34 - sysIPV6_RECVHOPOPTS = 0x35 - sysIPV6_HOPOPTS = 0x36 - sysIPV6_RTHDRDSTOPTS = 0x37 - sysIPV6_RECVRTHDR = 0x38 - sysIPV6_RTHDR = 0x39 - sysIPV6_RECVDSTOPTS = 0x3a - sysIPV6_DSTOPTS = 0x3b - sysIPV6_RECVPATHMTU = 0x3c - sysIPV6_PATHMTU = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_RECVTCLASS = 0x42 - sysIPV6_TCLASS = 0x43 - - sysIPV6_ADDR_PREFERENCES = 0x48 - - sysIPV6_PREFER_SRC_TMP = 0x1 - sysIPV6_PREFER_SRC_PUBLIC = 0x2 - sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 - sysIPV6_PREFER_SRC_COA = 0x4 - sysIPV6_PREFER_SRC_HOME = 0x400 - sysIPV6_PREFER_SRC_CGA = 0x8 - sysIPV6_PREFER_SRC_NONCGA = 0x800 - - sysIPV6_MINHOPCOUNT = 0x49 - - sysIPV6_ORIGDSTADDR = 0x4a - sysIPV6_RECVORIGDSTADDR = 0x4a - sysIPV6_TRANSPARENT = 0x4b - sysIPV6_UNICAST_IF = 0x4c - - sysICMPV6_FILTER = 0x1 - - sysICMPV6_FILTER_BLOCK = 0x1 - sysICMPV6_FILTER_PASS = 0x2 - sysICMPV6_FILTER_BLOCKOTHERS = 0x3 - sysICMPV6_FILTER_PASSONLY = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_riscv64.go b/vendor/golang.org/x/net/ipv6/zsys_linux_riscv64.go index 6083ddcedc..d4f78e405a 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_riscv64.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_riscv64.go @@ -1,91 +1,12 @@ // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_linux.go +//go:build riscv64 // +build riscv64 package ipv6 const ( - sysIPV6_ADDRFORM = 0x1 - sysIPV6_2292PKTINFO = 0x2 - sysIPV6_2292HOPOPTS = 0x3 - sysIPV6_2292DSTOPTS = 0x4 - sysIPV6_2292RTHDR = 0x5 - sysIPV6_2292PKTOPTIONS = 0x6 - sysIPV6_CHECKSUM = 0x7 - sysIPV6_2292HOPLIMIT = 0x8 - sysIPV6_NEXTHOP = 0x9 - sysIPV6_FLOWINFO = 0xb - - sysIPV6_UNICAST_HOPS = 0x10 - sysIPV6_MULTICAST_IF = 0x11 - sysIPV6_MULTICAST_HOPS = 0x12 - sysIPV6_MULTICAST_LOOP = 0x13 - sysIPV6_ADD_MEMBERSHIP = 0x14 - sysIPV6_DROP_MEMBERSHIP = 0x15 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIPV6_ROUTER_ALERT = 0x16 - sysIPV6_MTU_DISCOVER = 0x17 - sysIPV6_MTU = 0x18 - sysIPV6_RECVERR = 0x19 - sysIPV6_V6ONLY = 0x1a - sysIPV6_JOIN_ANYCAST = 0x1b - sysIPV6_LEAVE_ANYCAST = 0x1c - - sysIPV6_FLOWLABEL_MGR = 0x20 - sysIPV6_FLOWINFO_SEND = 0x21 - - sysIPV6_IPSEC_POLICY = 0x22 - sysIPV6_XFRM_POLICY = 0x23 - - sysIPV6_RECVPKTINFO = 0x31 - sysIPV6_PKTINFO = 0x32 - sysIPV6_RECVHOPLIMIT = 0x33 - sysIPV6_HOPLIMIT = 0x34 - sysIPV6_RECVHOPOPTS = 0x35 - sysIPV6_HOPOPTS = 0x36 - sysIPV6_RTHDRDSTOPTS = 0x37 - sysIPV6_RECVRTHDR = 0x38 - sysIPV6_RTHDR = 0x39 - sysIPV6_RECVDSTOPTS = 0x3a - sysIPV6_DSTOPTS = 0x3b - sysIPV6_RECVPATHMTU = 0x3c - sysIPV6_PATHMTU = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_RECVTCLASS = 0x42 - sysIPV6_TCLASS = 0x43 - - sysIPV6_ADDR_PREFERENCES = 0x48 - - sysIPV6_PREFER_SRC_TMP = 0x1 - sysIPV6_PREFER_SRC_PUBLIC = 0x2 - sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 - sysIPV6_PREFER_SRC_COA = 0x4 - sysIPV6_PREFER_SRC_HOME = 0x400 - sysIPV6_PREFER_SRC_CGA = 0x8 - sysIPV6_PREFER_SRC_NONCGA = 0x800 - - sysIPV6_MINHOPCOUNT = 0x49 - - sysIPV6_ORIGDSTADDR = 0x4a - sysIPV6_RECVORIGDSTADDR = 0x4a - sysIPV6_TRANSPARENT = 0x4b - sysIPV6_UNICAST_IF = 0x4c - - sysICMPV6_FILTER = 0x1 - - sysICMPV6_FILTER_BLOCK = 0x1 - sysICMPV6_FILTER_PASS = 0x2 - sysICMPV6_FILTER_BLOCKOTHERS = 0x3 - sysICMPV6_FILTER_PASSONLY = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_s390x.go b/vendor/golang.org/x/net/ipv6/zsys_linux_s390x.go index 992ac9ec5f..2514ab9a41 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_s390x.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_s390x.go @@ -4,86 +4,6 @@ package ipv6 const ( - sysIPV6_ADDRFORM = 0x1 - sysIPV6_2292PKTINFO = 0x2 - sysIPV6_2292HOPOPTS = 0x3 - sysIPV6_2292DSTOPTS = 0x4 - sysIPV6_2292RTHDR = 0x5 - sysIPV6_2292PKTOPTIONS = 0x6 - sysIPV6_CHECKSUM = 0x7 - sysIPV6_2292HOPLIMIT = 0x8 - sysIPV6_NEXTHOP = 0x9 - sysIPV6_FLOWINFO = 0xb - - sysIPV6_UNICAST_HOPS = 0x10 - sysIPV6_MULTICAST_IF = 0x11 - sysIPV6_MULTICAST_HOPS = 0x12 - sysIPV6_MULTICAST_LOOP = 0x13 - sysIPV6_ADD_MEMBERSHIP = 0x14 - sysIPV6_DROP_MEMBERSHIP = 0x15 - sysMCAST_JOIN_GROUP = 0x2a - sysMCAST_LEAVE_GROUP = 0x2d - sysMCAST_JOIN_SOURCE_GROUP = 0x2e - sysMCAST_LEAVE_SOURCE_GROUP = 0x2f - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_MSFILTER = 0x30 - sysIPV6_ROUTER_ALERT = 0x16 - sysIPV6_MTU_DISCOVER = 0x17 - sysIPV6_MTU = 0x18 - sysIPV6_RECVERR = 0x19 - sysIPV6_V6ONLY = 0x1a - sysIPV6_JOIN_ANYCAST = 0x1b - sysIPV6_LEAVE_ANYCAST = 0x1c - - sysIPV6_FLOWLABEL_MGR = 0x20 - sysIPV6_FLOWINFO_SEND = 0x21 - - sysIPV6_IPSEC_POLICY = 0x22 - sysIPV6_XFRM_POLICY = 0x23 - - sysIPV6_RECVPKTINFO = 0x31 - sysIPV6_PKTINFO = 0x32 - sysIPV6_RECVHOPLIMIT = 0x33 - sysIPV6_HOPLIMIT = 0x34 - sysIPV6_RECVHOPOPTS = 0x35 - sysIPV6_HOPOPTS = 0x36 - sysIPV6_RTHDRDSTOPTS = 0x37 - sysIPV6_RECVRTHDR = 0x38 - sysIPV6_RTHDR = 0x39 - sysIPV6_RECVDSTOPTS = 0x3a - sysIPV6_DSTOPTS = 0x3b - sysIPV6_RECVPATHMTU = 0x3c - sysIPV6_PATHMTU = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_RECVTCLASS = 0x42 - sysIPV6_TCLASS = 0x43 - - sysIPV6_ADDR_PREFERENCES = 0x48 - - sysIPV6_PREFER_SRC_TMP = 0x1 - sysIPV6_PREFER_SRC_PUBLIC = 0x2 - sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 - sysIPV6_PREFER_SRC_COA = 0x4 - sysIPV6_PREFER_SRC_HOME = 0x400 - sysIPV6_PREFER_SRC_CGA = 0x8 - sysIPV6_PREFER_SRC_NONCGA = 0x800 - - sysIPV6_MINHOPCOUNT = 0x49 - - sysIPV6_ORIGDSTADDR = 0x4a - sysIPV6_RECVORIGDSTADDR = 0x4a - sysIPV6_TRANSPARENT = 0x4b - sysIPV6_UNICAST_IF = 0x4c - - sysICMPV6_FILTER = 0x1 - - sysICMPV6_FILTER_BLOCK = 0x1 - sysICMPV6_FILTER_PASS = 0x2 - sysICMPV6_FILTER_BLOCKOTHERS = 0x3 - sysICMPV6_FILTER_PASSONLY = 0x4 - sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_netbsd.go b/vendor/golang.org/x/net/ipv6/zsys_netbsd.go index e39571e072..f7335d5ae4 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_netbsd.go +++ b/vendor/golang.org/x/net/ipv6/zsys_netbsd.go @@ -4,48 +4,6 @@ package ipv6 const ( - sysIPV6_UNICAST_HOPS = 0x4 - sysIPV6_MULTICAST_IF = 0x9 - sysIPV6_MULTICAST_HOPS = 0xa - sysIPV6_MULTICAST_LOOP = 0xb - sysIPV6_JOIN_GROUP = 0xc - sysIPV6_LEAVE_GROUP = 0xd - sysIPV6_PORTRANGE = 0xe - sysICMP6_FILTER = 0x12 - - sysIPV6_CHECKSUM = 0x1a - sysIPV6_V6ONLY = 0x1b - - sysIPV6_IPSEC_POLICY = 0x1c - - sysIPV6_RTHDRDSTOPTS = 0x23 - - sysIPV6_RECVPKTINFO = 0x24 - sysIPV6_RECVHOPLIMIT = 0x25 - sysIPV6_RECVRTHDR = 0x26 - sysIPV6_RECVHOPOPTS = 0x27 - sysIPV6_RECVDSTOPTS = 0x28 - - sysIPV6_USE_MIN_MTU = 0x2a - sysIPV6_RECVPATHMTU = 0x2b - sysIPV6_PATHMTU = 0x2c - - sysIPV6_PKTINFO = 0x2e - sysIPV6_HOPLIMIT = 0x2f - sysIPV6_NEXTHOP = 0x30 - sysIPV6_HOPOPTS = 0x31 - sysIPV6_DSTOPTS = 0x32 - sysIPV6_RTHDR = 0x33 - - sysIPV6_RECVTCLASS = 0x39 - - sysIPV6_TCLASS = 0x3d - sysIPV6_DONTFRAG = 0x3e - - sysIPV6_PORTRANGE_DEFAULT = 0x0 - sysIPV6_PORTRANGE_HIGH = 0x1 - sysIPV6_PORTRANGE_LOW = 0x2 - sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 sizeofIPv6Mtuinfo = 0x20 diff --git a/vendor/golang.org/x/net/ipv6/zsys_openbsd.go b/vendor/golang.org/x/net/ipv6/zsys_openbsd.go index cc1899a630..6d15928122 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_openbsd.go +++ b/vendor/golang.org/x/net/ipv6/zsys_openbsd.go @@ -4,57 +4,6 @@ package ipv6 const ( - sysIPV6_UNICAST_HOPS = 0x4 - sysIPV6_MULTICAST_IF = 0x9 - sysIPV6_MULTICAST_HOPS = 0xa - sysIPV6_MULTICAST_LOOP = 0xb - sysIPV6_JOIN_GROUP = 0xc - sysIPV6_LEAVE_GROUP = 0xd - sysIPV6_PORTRANGE = 0xe - sysICMP6_FILTER = 0x12 - - sysIPV6_CHECKSUM = 0x1a - sysIPV6_V6ONLY = 0x1b - - sysIPV6_RTHDRDSTOPTS = 0x23 - - sysIPV6_RECVPKTINFO = 0x24 - sysIPV6_RECVHOPLIMIT = 0x25 - sysIPV6_RECVRTHDR = 0x26 - sysIPV6_RECVHOPOPTS = 0x27 - sysIPV6_RECVDSTOPTS = 0x28 - - sysIPV6_USE_MIN_MTU = 0x2a - sysIPV6_RECVPATHMTU = 0x2b - - sysIPV6_PATHMTU = 0x2c - - sysIPV6_PKTINFO = 0x2e - sysIPV6_HOPLIMIT = 0x2f - sysIPV6_NEXTHOP = 0x30 - sysIPV6_HOPOPTS = 0x31 - sysIPV6_DSTOPTS = 0x32 - sysIPV6_RTHDR = 0x33 - - sysIPV6_AUTH_LEVEL = 0x35 - sysIPV6_ESP_TRANS_LEVEL = 0x36 - sysIPV6_ESP_NETWORK_LEVEL = 0x37 - sysIPSEC6_OUTSA = 0x38 - sysIPV6_RECVTCLASS = 0x39 - - sysIPV6_AUTOFLOWLABEL = 0x3b - sysIPV6_IPCOMP_LEVEL = 0x3c - - sysIPV6_TCLASS = 0x3d - sysIPV6_DONTFRAG = 0x3e - sysIPV6_PIPEX = 0x3f - - sysIPV6_RTABLE = 0x1021 - - sysIPV6_PORTRANGE_DEFAULT = 0x0 - sysIPV6_PORTRANGE_HIGH = 0x1 - sysIPV6_PORTRANGE_LOW = 0x2 - sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 sizeofIPv6Mtuinfo = 0x20 diff --git a/vendor/golang.org/x/net/ipv6/zsys_solaris.go b/vendor/golang.org/x/net/ipv6/zsys_solaris.go index 690eef9341..1716197477 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_solaris.go +++ b/vendor/golang.org/x/net/ipv6/zsys_solaris.go @@ -4,74 +4,6 @@ package ipv6 const ( - sysIPV6_UNICAST_HOPS = 0x5 - sysIPV6_MULTICAST_IF = 0x6 - sysIPV6_MULTICAST_HOPS = 0x7 - sysIPV6_MULTICAST_LOOP = 0x8 - sysIPV6_JOIN_GROUP = 0x9 - sysIPV6_LEAVE_GROUP = 0xa - - sysIPV6_PKTINFO = 0xb - - sysIPV6_HOPLIMIT = 0xc - sysIPV6_NEXTHOP = 0xd - sysIPV6_HOPOPTS = 0xe - sysIPV6_DSTOPTS = 0xf - - sysIPV6_RTHDR = 0x10 - sysIPV6_RTHDRDSTOPTS = 0x11 - - sysIPV6_RECVPKTINFO = 0x12 - sysIPV6_RECVHOPLIMIT = 0x13 - sysIPV6_RECVHOPOPTS = 0x14 - - sysIPV6_RECVRTHDR = 0x16 - - sysIPV6_RECVRTHDRDSTOPTS = 0x17 - - sysIPV6_CHECKSUM = 0x18 - sysIPV6_RECVTCLASS = 0x19 - sysIPV6_USE_MIN_MTU = 0x20 - sysIPV6_DONTFRAG = 0x21 - sysIPV6_SEC_OPT = 0x22 - sysIPV6_SRC_PREFERENCES = 0x23 - sysIPV6_RECVPATHMTU = 0x24 - sysIPV6_PATHMTU = 0x25 - sysIPV6_TCLASS = 0x26 - sysIPV6_V6ONLY = 0x27 - - sysIPV6_RECVDSTOPTS = 0x28 - - sysMCAST_JOIN_GROUP = 0x29 - sysMCAST_LEAVE_GROUP = 0x2a - sysMCAST_BLOCK_SOURCE = 0x2b - sysMCAST_UNBLOCK_SOURCE = 0x2c - sysMCAST_JOIN_SOURCE_GROUP = 0x2d - sysMCAST_LEAVE_SOURCE_GROUP = 0x2e - - sysIPV6_PREFER_SRC_HOME = 0x1 - sysIPV6_PREFER_SRC_COA = 0x2 - sysIPV6_PREFER_SRC_PUBLIC = 0x4 - sysIPV6_PREFER_SRC_TMP = 0x8 - sysIPV6_PREFER_SRC_NONCGA = 0x10 - sysIPV6_PREFER_SRC_CGA = 0x20 - - sysIPV6_PREFER_SRC_MIPMASK = 0x3 - sysIPV6_PREFER_SRC_MIPDEFAULT = 0x1 - sysIPV6_PREFER_SRC_TMPMASK = 0xc - sysIPV6_PREFER_SRC_TMPDEFAULT = 0x4 - sysIPV6_PREFER_SRC_CGAMASK = 0x30 - sysIPV6_PREFER_SRC_CGADEFAULT = 0x10 - - sysIPV6_PREFER_SRC_MASK = 0x3f - - sysIPV6_PREFER_SRC_DEFAULT = 0x15 - - sysIPV6_BOUND_IF = 0x41 - sysIPV6_UNSPEC_SRC = 0x42 - - sysICMP6_FILTER = 0x1 - sizeofSockaddrStorage = 0x100 sizeofSockaddrInet6 = 0x20 sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_zos_s390x.go b/vendor/golang.org/x/net/ipv6/zsys_zos_s390x.go new file mode 100644 index 0000000000..7c75645967 --- /dev/null +++ b/vendor/golang.org/x/net/ipv6/zsys_zos_s390x.go @@ -0,0 +1,62 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Hand edited based on zerrors_zos_s390x.go +// TODO(Bill O'Farrell): auto-generate. + +package ipv6 + +const ( + sizeofSockaddrStorage = 128 + sizeofICMPv6Filter = 32 + sizeofInet6Pktinfo = 20 + sizeofIPv6Mtuinfo = 32 + sizeofSockaddrInet6 = 28 + sizeofGroupReq = 136 + sizeofGroupSourceReq = 264 +) + +type sockaddrStorage struct { + Len uint8 + Family byte + ss_pad1 [6]byte + ss_align int64 + ss_pad2 [112]byte +} + +type sockaddrInet6 struct { + Len uint8 + Family uint8 + Port uint16 + Flowinfo uint32 + Addr [16]byte + Scope_id uint32 +} + +type inet6Pktinfo struct { + Addr [16]byte + Ifindex uint32 +} + +type ipv6Mtuinfo struct { + Addr sockaddrInet6 + Mtu uint32 +} + +type groupReq struct { + Interface uint32 + reserved uint32 + Group sockaddrStorage +} + +type groupSourceReq struct { + Interface uint32 + reserved uint32 + Group sockaddrStorage + Source sockaddrStorage +} + +type icmpv6Filter struct { + Filt [8]uint32 +} diff --git a/vendor/golang.org/x/net/nettest/nettest.go b/vendor/golang.org/x/net/nettest/nettest.go index a402a46bb3..83ba858e24 100644 --- a/vendor/golang.org/x/net/nettest/nettest.go +++ b/vendor/golang.org/x/net/nettest/nettest.go @@ -97,7 +97,7 @@ func TestableNetwork(network string) bool { switch runtime.GOOS { case "android", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": return false - case "darwin": + case "darwin", "ios": // iOS doesn't support it. if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { return false @@ -118,7 +118,7 @@ func TestableNetwork(network string) bool { return false case "aix": return unixStrmDgramEnabled() - case "darwin": + case "darwin", "ios": // iOS does not support unix, unixgram. if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { return false @@ -126,7 +126,7 @@ func TestableNetwork(network string) bool { } case "unixpacket": switch runtime.GOOS { - case "aix", "android", "fuchsia", "hurd", "darwin", "js", "nacl", "plan9", "windows": + case "aix", "android", "fuchsia", "hurd", "darwin", "ios", "js", "nacl", "plan9", "windows", "zos": return false case "netbsd": // It passes on amd64 at least. 386 fails diff --git a/vendor/golang.org/x/net/nettest/nettest_stub.go b/vendor/golang.org/x/net/nettest/nettest_stub.go index 2bb8c05762..6e3a9312b9 100644 --- a/vendor/golang.org/x/net/nettest/nettest_stub.go +++ b/vendor/golang.org/x/net/nettest/nettest_stub.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows +//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos package nettest diff --git a/vendor/golang.org/x/net/nettest/nettest_unix.go b/vendor/golang.org/x/net/nettest/nettest_unix.go index afff744e8f..b1cb8b2f3b 100644 --- a/vendor/golang.org/x/net/nettest/nettest_unix.go +++ b/vendor/golang.org/x/net/nettest/nettest_unix.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos package nettest diff --git a/vendor/golang.org/x/sys/cpu/cpu_aix.go b/vendor/golang.org/x/sys/cpu/cpu_aix.go index 464a209cf5..28b521643b 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_aix.go +++ b/vendor/golang.org/x/sys/cpu/cpu_aix.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix // +build aix package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go index 7f7f272a01..ccf542a73d 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gc // +build gc package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go b/vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go index 75a9556616..0af2f24841 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gc // +build gc package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go b/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go index 4adb89cf9c..fa7cdb9bcd 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (386 || amd64 || amd64p32) && gc // +build 386 amd64 amd64p32 // +build gc diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go index 53ca8d65c3..2aff318911 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gccgo // +build gccgo package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go index aa986f7782..4bfbda6199 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gccgo // +build gccgo package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go index ba49b91bd3..8478a6d597 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (386 || amd64 || amd64p32) && gccgo // +build 386 amd64 amd64p32 // +build gccgo diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux.go b/vendor/golang.org/x/sys/cpu/cpu_linux.go index 6fc874f7fe..159a686f6f 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !386 && !amd64 && !amd64p32 && !arm64 // +build !386,!amd64,!amd64p32,!arm64 package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go b/vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go index 5a41890053..6000db4cdd 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux && (mips64 || mips64le) // +build linux // +build mips64 mips64le diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go b/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go index 42b5d33cb6..f4992b1a59 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x // +build linux,!arm,!arm64,!mips64,!mips64le,!ppc64,!ppc64le,!s390x package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go b/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go index 99f8a6399e..021356d6de 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux && (ppc64 || ppc64le) // +build linux // +build ppc64 ppc64le diff --git a/vendor/golang.org/x/sys/cpu/cpu_mips64x.go b/vendor/golang.org/x/sys/cpu/cpu_mips64x.go index 57b5b677de..f4063c6642 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_mips64x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_mips64x.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build mips64 || mips64le // +build mips64 mips64le package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_mipsx.go b/vendor/golang.org/x/sys/cpu/cpu_mipsx.go index cfc1946b7b..07c4e36d8f 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_mipsx.go +++ b/vendor/golang.org/x/sys/cpu/cpu_mipsx.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build mips || mipsle // +build mips mipsle package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_arm.go b/vendor/golang.org/x/sys/cpu/cpu_other_arm.go index b412efc1bd..d7b4fb4ccc 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_other_arm.go +++ b/vendor/golang.org/x/sys/cpu/cpu_other_arm.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !linux && arm // +build !linux,arm package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go index 16c1c4090e..f8c484f589 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !linux,!netbsd -// +build arm64 +//go:build !linux && !netbsd && arm64 +// +build !linux,!netbsd,arm64 package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go b/vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go index f49fad6778..0dafe9644a 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !linux && (mips64 || mips64le) // +build !linux // +build mips64 mips64le diff --git a/vendor/golang.org/x/sys/cpu/cpu_ppc64x.go b/vendor/golang.org/x/sys/cpu/cpu_ppc64x.go index d28d675b5f..4e8acd1658 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_ppc64x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_ppc64x.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build ppc64 || ppc64le // +build ppc64 ppc64le package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_riscv64.go b/vendor/golang.org/x/sys/cpu/cpu_riscv64.go index 8b08de341b..bd6c128af9 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_riscv64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_riscv64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build riscv64 // +build riscv64 package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_wasm.go b/vendor/golang.org/x/sys/cpu/cpu_wasm.go index 5382f2a227..7747d888a6 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_wasm.go +++ b/vendor/golang.org/x/sys/cpu/cpu_wasm.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build wasm // +build wasm package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_x86.go b/vendor/golang.org/x/sys/cpu/cpu_x86.go index 48d4293319..fd380c0a71 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_x86.go +++ b/vendor/golang.org/x/sys/cpu/cpu_x86.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build 386 || amd64 || amd64p32 // +build 386 amd64 amd64p32 package cpu diff --git a/vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go b/vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go index 76fbe40b76..a864f24d75 100644 --- a/vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go +++ b/vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go @@ -8,8 +8,8 @@ // Morever, this file will be used during the building of // gccgo's libgo and thus must not used a CGo method. -// +build aix -// +build gccgo +//go:build aix && gccgo +// +build aix,gccgo package cpu diff --git a/vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go b/vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go index 5b427d67e2..904be42ffd 100644 --- a/vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go +++ b/vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go @@ -6,8 +6,8 @@ // system call on AIX without depending on x/sys/unix. // (See golang.org/issue/32102) -// +build aix,ppc64 -// +build gc +//go:build aix && ppc64 && gc +// +build aix,ppc64,gc package cpu diff --git a/vendor/golang.org/x/sys/unix/aliases.go b/vendor/golang.org/x/sys/unix/aliases.go index 951fce4d0d..abc89c104a 100644 --- a/vendor/golang.org/x/sys/unix/aliases.go +++ b/vendor/golang.org/x/sys/unix/aliases.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris +//go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) && go1.9 +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos // +build go1.9 package unix diff --git a/vendor/golang.org/x/sys/unix/asm_freebsd_386.s b/vendor/golang.org/x/sys/unix/asm_bsd_386.s similarity index 70% rename from vendor/golang.org/x/sys/unix/asm_freebsd_386.s rename to vendor/golang.org/x/sys/unix/asm_bsd_386.s index 49f0ac2364..7f29275fa0 100644 --- a/vendor/golang.org/x/sys/unix/asm_freebsd_386.s +++ b/vendor/golang.org/x/sys/unix/asm_bsd_386.s @@ -1,14 +1,14 @@ -// Copyright 2009 The Go Authors. All rights reserved. +// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (darwin || freebsd || netbsd || openbsd) && gc +// +build darwin freebsd netbsd openbsd // +build gc #include "textflag.h" -// -// System call support for 386, FreeBSD -// +// System call support for 386 BSD // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. @@ -22,7 +22,7 @@ TEXT ·Syscall6(SB),NOSPLIT,$0-40 TEXT ·Syscall9(SB),NOSPLIT,$0-52 JMP syscall·Syscall9(SB) -TEXT ·RawSyscall(SB),NOSPLIT,$0-28 +TEXT ·RawSyscall(SB),NOSPLIT,$0-28 JMP syscall·RawSyscall(SB) TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 diff --git a/vendor/golang.org/x/sys/unix/asm_darwin_amd64.s b/vendor/golang.org/x/sys/unix/asm_bsd_amd64.s similarity index 72% rename from vendor/golang.org/x/sys/unix/asm_darwin_amd64.s rename to vendor/golang.org/x/sys/unix/asm_bsd_amd64.s index f2397fde55..2b99c349a2 100644 --- a/vendor/golang.org/x/sys/unix/asm_darwin_amd64.s +++ b/vendor/golang.org/x/sys/unix/asm_bsd_amd64.s @@ -1,14 +1,14 @@ -// Copyright 2009 The Go Authors. All rights reserved. +// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc +// +build darwin dragonfly freebsd netbsd openbsd // +build gc #include "textflag.h" -// -// System call support for AMD64, Darwin -// +// System call support for AMD64 BSD // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. diff --git a/vendor/golang.org/x/sys/unix/asm_freebsd_arm.s b/vendor/golang.org/x/sys/unix/asm_bsd_arm.s similarity index 74% rename from vendor/golang.org/x/sys/unix/asm_freebsd_arm.s rename to vendor/golang.org/x/sys/unix/asm_bsd_arm.s index 6d740db2c0..98ebfad9d5 100644 --- a/vendor/golang.org/x/sys/unix/asm_freebsd_arm.s +++ b/vendor/golang.org/x/sys/unix/asm_bsd_arm.s @@ -1,14 +1,14 @@ -// Copyright 2012 The Go Authors. All rights reserved. +// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (darwin || freebsd || netbsd || openbsd) && gc +// +build darwin freebsd netbsd openbsd // +build gc #include "textflag.h" -// -// System call support for ARM, FreeBSD -// +// System call support for ARM BSD // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. diff --git a/vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s b/vendor/golang.org/x/sys/unix/asm_bsd_arm64.s similarity index 75% rename from vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s rename to vendor/golang.org/x/sys/unix/asm_bsd_arm64.s index e57367c17a..fe36a7391a 100644 --- a/vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s +++ b/vendor/golang.org/x/sys/unix/asm_bsd_arm64.s @@ -1,14 +1,14 @@ -// Copyright 2009 The Go Authors. All rights reserved. +// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (darwin || freebsd || netbsd || openbsd) && gc +// +build darwin freebsd netbsd openbsd // +build gc #include "textflag.h" -// -// System call support for AMD64, NetBSD -// +// System call support for ARM64 BSD // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. diff --git a/vendor/golang.org/x/sys/unix/asm_darwin_386.s b/vendor/golang.org/x/sys/unix/asm_darwin_386.s deleted file mode 100644 index 8a06b87d71..0000000000 --- a/vendor/golang.org/x/sys/unix/asm_darwin_386.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for 386, Darwin -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-28 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-40 - JMP syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-52 - JMP syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-28 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 - JMP syscall·RawSyscall6(SB) diff --git a/vendor/golang.org/x/sys/unix/asm_darwin_arm.s b/vendor/golang.org/x/sys/unix/asm_darwin_arm.s deleted file mode 100644 index c9e6b6fc8b..0000000000 --- a/vendor/golang.org/x/sys/unix/asm_darwin_arm.s +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc -// +build arm,darwin - -#include "textflag.h" - -// -// System call support for ARM, Darwin -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-28 - B syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-40 - B syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-52 - B syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-28 - B syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 - B syscall·RawSyscall6(SB) diff --git a/vendor/golang.org/x/sys/unix/asm_darwin_arm64.s b/vendor/golang.org/x/sys/unix/asm_darwin_arm64.s deleted file mode 100644 index 89843f8f4b..0000000000 --- a/vendor/golang.org/x/sys/unix/asm_darwin_arm64.s +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc -// +build arm64,darwin - -#include "textflag.h" - -// -// System call support for AMD64, Darwin -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-56 - B syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-80 - B syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-104 - B syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-56 - B syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 - B syscall·RawSyscall6(SB) diff --git a/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s b/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s deleted file mode 100644 index 27674e1caf..0000000000 --- a/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for AMD64, DragonFly -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-56 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-80 - JMP syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-104 - JMP syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-56 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 - JMP syscall·RawSyscall6(SB) diff --git a/vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s b/vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s deleted file mode 100644 index f2dfc57b83..0000000000 --- a/vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for AMD64, FreeBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-56 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-80 - JMP syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-104 - JMP syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-56 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 - JMP syscall·RawSyscall6(SB) diff --git a/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s b/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s deleted file mode 100644 index a8f5a29b35..0000000000 --- a/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for ARM64, FreeBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-56 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-80 - JMP syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-104 - JMP syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-56 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 - JMP syscall·RawSyscall6(SB) diff --git a/vendor/golang.org/x/sys/unix/asm_netbsd_386.s b/vendor/golang.org/x/sys/unix/asm_netbsd_386.s deleted file mode 100644 index ae7b498d50..0000000000 --- a/vendor/golang.org/x/sys/unix/asm_netbsd_386.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for 386, NetBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-28 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-40 - JMP syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-52 - JMP syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-28 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 - JMP syscall·RawSyscall6(SB) diff --git a/vendor/golang.org/x/sys/unix/asm_netbsd_arm.s b/vendor/golang.org/x/sys/unix/asm_netbsd_arm.s deleted file mode 100644 index d7da175e1a..0000000000 --- a/vendor/golang.org/x/sys/unix/asm_netbsd_arm.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for ARM, NetBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-28 - B syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-40 - B syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-52 - B syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-28 - B syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 - B syscall·RawSyscall6(SB) diff --git a/vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s b/vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s deleted file mode 100644 index e7cbe1904c..0000000000 --- a/vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for ARM64, NetBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-56 - B syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-80 - B syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-104 - B syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-56 - B syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 - B syscall·RawSyscall6(SB) diff --git a/vendor/golang.org/x/sys/unix/asm_openbsd_386.s b/vendor/golang.org/x/sys/unix/asm_openbsd_386.s deleted file mode 100644 index 2f00b0310f..0000000000 --- a/vendor/golang.org/x/sys/unix/asm_openbsd_386.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for 386, OpenBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-28 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-40 - JMP syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-52 - JMP syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-28 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 - JMP syscall·RawSyscall6(SB) diff --git a/vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s b/vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s deleted file mode 100644 index 07632c99ce..0000000000 --- a/vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for AMD64, OpenBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-56 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-80 - JMP syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-104 - JMP syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-56 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 - JMP syscall·RawSyscall6(SB) diff --git a/vendor/golang.org/x/sys/unix/asm_openbsd_arm.s b/vendor/golang.org/x/sys/unix/asm_openbsd_arm.s deleted file mode 100644 index 73e997320f..0000000000 --- a/vendor/golang.org/x/sys/unix/asm_openbsd_arm.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for ARM, OpenBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-28 - B syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-40 - B syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-52 - B syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-28 - B syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 - B syscall·RawSyscall6(SB) diff --git a/vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s b/vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s deleted file mode 100644 index c47302aa46..0000000000 --- a/vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gc - -#include "textflag.h" - -// -// System call support for arm64, OpenBSD -// - -// Just jump to package syscall's implementation for all these functions. -// The runtime may know about them. - -TEXT ·Syscall(SB),NOSPLIT,$0-56 - JMP syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-80 - JMP syscall·Syscall6(SB) - -TEXT ·Syscall9(SB),NOSPLIT,$0-104 - JMP syscall·Syscall9(SB) - -TEXT ·RawSyscall(SB),NOSPLIT,$0-56 - JMP syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 - JMP syscall·RawSyscall6(SB) diff --git a/vendor/golang.org/x/sys/unix/asm_zos_s390x.s b/vendor/golang.org/x/sys/unix/asm_zos_s390x.s new file mode 100644 index 0000000000..3b54e18581 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/asm_zos_s390x.s @@ -0,0 +1,426 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build zos && s390x && gc +// +build zos +// +build s390x +// +build gc + +#include "textflag.h" + +#define PSALAA 1208(R0) +#define GTAB64(x) 80(x) +#define LCA64(x) 88(x) +#define CAA(x) 8(x) +#define EDCHPXV(x) 1016(x) // in the CAA +#define SAVSTACK_ASYNC(x) 336(x) // in the LCA + +// SS_*, where x=SAVSTACK_ASYNC +#define SS_LE(x) 0(x) +#define SS_GO(x) 8(x) +#define SS_ERRNO(x) 16(x) +#define SS_ERRNOJR(x) 20(x) + +#define LE_CALL BYTE $0x0D; BYTE $0x76; // BL R7, R6 + +TEXT ·clearErrno(SB),NOSPLIT,$0-0 + BL addrerrno<>(SB) + MOVD $0, 0(R3) + RET + +// Returns the address of errno in R3. +TEXT addrerrno<>(SB),NOSPLIT|NOFRAME,$0-0 + // Get library control area (LCA). + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 + + // Get __errno FuncDesc. + MOVD CAA(R8), R9 + MOVD EDCHPXV(R9), R9 + ADD $(0x156*16), R9 + LMG 0(R9), R5, R6 + + // Switch to saved LE stack. + MOVD SAVSTACK_ASYNC(R8), R9 + MOVD 0(R9), R4 + MOVD $0, 0(R9) + + // Call __errno function. + LE_CALL + NOPH + + // Switch back to Go stack. + XOR R0, R0 // Restore R0 to $0. + MOVD R4, 0(R9) // Save stack pointer. + RET + +TEXT ·syscall_syscall(SB),NOSPLIT,$0-56 + BL runtime·entersyscall(SB) + MOVD a1+8(FP), R1 + MOVD a2+16(FP), R2 + MOVD a3+24(FP), R3 + + // Get library control area (LCA). + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 + + // Get function. + MOVD CAA(R8), R9 + MOVD EDCHPXV(R9), R9 + MOVD trap+0(FP), R5 + SLD $4, R5 + ADD R5, R9 + LMG 0(R9), R5, R6 + + // Restore LE stack. + MOVD SAVSTACK_ASYNC(R8), R9 + MOVD 0(R9), R4 + MOVD $0, 0(R9) + + // Call function. + LE_CALL + NOPH + XOR R0, R0 // Restore R0 to $0. + MOVD R4, 0(R9) // Save stack pointer. + + MOVD R3, r1+32(FP) + MOVD R0, r2+40(FP) + MOVD R0, err+48(FP) + MOVW R3, R4 + CMP R4, $-1 + BNE done + BL addrerrno<>(SB) + MOVWZ 0(R3), R3 + MOVD R3, err+48(FP) +done: + BL runtime·exitsyscall(SB) + RET + +TEXT ·syscall_rawsyscall(SB),NOSPLIT,$0-56 + MOVD a1+8(FP), R1 + MOVD a2+16(FP), R2 + MOVD a3+24(FP), R3 + + // Get library control area (LCA). + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 + + // Get function. + MOVD CAA(R8), R9 + MOVD EDCHPXV(R9), R9 + MOVD trap+0(FP), R5 + SLD $4, R5 + ADD R5, R9 + LMG 0(R9), R5, R6 + + // Restore LE stack. + MOVD SAVSTACK_ASYNC(R8), R9 + MOVD 0(R9), R4 + MOVD $0, 0(R9) + + // Call function. + LE_CALL + NOPH + XOR R0, R0 // Restore R0 to $0. + MOVD R4, 0(R9) // Save stack pointer. + + MOVD R3, r1+32(FP) + MOVD R0, r2+40(FP) + MOVD R0, err+48(FP) + MOVW R3, R4 + CMP R4, $-1 + BNE done + BL addrerrno<>(SB) + MOVWZ 0(R3), R3 + MOVD R3, err+48(FP) +done: + RET + +TEXT ·syscall_syscall6(SB),NOSPLIT,$0-80 + BL runtime·entersyscall(SB) + MOVD a1+8(FP), R1 + MOVD a2+16(FP), R2 + MOVD a3+24(FP), R3 + + // Get library control area (LCA). + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 + + // Get function. + MOVD CAA(R8), R9 + MOVD EDCHPXV(R9), R9 + MOVD trap+0(FP), R5 + SLD $4, R5 + ADD R5, R9 + LMG 0(R9), R5, R6 + + // Restore LE stack. + MOVD SAVSTACK_ASYNC(R8), R9 + MOVD 0(R9), R4 + MOVD $0, 0(R9) + + // Fill in parameter list. + MOVD a4+32(FP), R12 + MOVD R12, (2176+24)(R4) + MOVD a5+40(FP), R12 + MOVD R12, (2176+32)(R4) + MOVD a6+48(FP), R12 + MOVD R12, (2176+40)(R4) + + // Call function. + LE_CALL + NOPH + XOR R0, R0 // Restore R0 to $0. + MOVD R4, 0(R9) // Save stack pointer. + + MOVD R3, r1+56(FP) + MOVD R0, r2+64(FP) + MOVD R0, err+72(FP) + MOVW R3, R4 + CMP R4, $-1 + BNE done + BL addrerrno<>(SB) + MOVWZ 0(R3), R3 + MOVD R3, err+72(FP) +done: + BL runtime·exitsyscall(SB) + RET + +TEXT ·syscall_rawsyscall6(SB),NOSPLIT,$0-80 + MOVD a1+8(FP), R1 + MOVD a2+16(FP), R2 + MOVD a3+24(FP), R3 + + // Get library control area (LCA). + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 + + // Get function. + MOVD CAA(R8), R9 + MOVD EDCHPXV(R9), R9 + MOVD trap+0(FP), R5 + SLD $4, R5 + ADD R5, R9 + LMG 0(R9), R5, R6 + + // Restore LE stack. + MOVD SAVSTACK_ASYNC(R8), R9 + MOVD 0(R9), R4 + MOVD $0, 0(R9) + + // Fill in parameter list. + MOVD a4+32(FP), R12 + MOVD R12, (2176+24)(R4) + MOVD a5+40(FP), R12 + MOVD R12, (2176+32)(R4) + MOVD a6+48(FP), R12 + MOVD R12, (2176+40)(R4) + + // Call function. + LE_CALL + NOPH + XOR R0, R0 // Restore R0 to $0. + MOVD R4, 0(R9) // Save stack pointer. + + MOVD R3, r1+56(FP) + MOVD R0, r2+64(FP) + MOVD R0, err+72(FP) + MOVW R3, R4 + CMP R4, $-1 + BNE done + BL ·rrno<>(SB) + MOVWZ 0(R3), R3 + MOVD R3, err+72(FP) +done: + RET + +TEXT ·syscall_syscall9(SB),NOSPLIT,$0 + BL runtime·entersyscall(SB) + MOVD a1+8(FP), R1 + MOVD a2+16(FP), R2 + MOVD a3+24(FP), R3 + + // Get library control area (LCA). + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 + + // Get function. + MOVD CAA(R8), R9 + MOVD EDCHPXV(R9), R9 + MOVD trap+0(FP), R5 + SLD $4, R5 + ADD R5, R9 + LMG 0(R9), R5, R6 + + // Restore LE stack. + MOVD SAVSTACK_ASYNC(R8), R9 + MOVD 0(R9), R4 + MOVD $0, 0(R9) + + // Fill in parameter list. + MOVD a4+32(FP), R12 + MOVD R12, (2176+24)(R4) + MOVD a5+40(FP), R12 + MOVD R12, (2176+32)(R4) + MOVD a6+48(FP), R12 + MOVD R12, (2176+40)(R4) + MOVD a7+56(FP), R12 + MOVD R12, (2176+48)(R4) + MOVD a8+64(FP), R12 + MOVD R12, (2176+56)(R4) + MOVD a9+72(FP), R12 + MOVD R12, (2176+64)(R4) + + // Call function. + LE_CALL + NOPH + XOR R0, R0 // Restore R0 to $0. + MOVD R4, 0(R9) // Save stack pointer. + + MOVD R3, r1+80(FP) + MOVD R0, r2+88(FP) + MOVD R0, err+96(FP) + MOVW R3, R4 + CMP R4, $-1 + BNE done + BL addrerrno<>(SB) + MOVWZ 0(R3), R3 + MOVD R3, err+96(FP) +done: + BL runtime·exitsyscall(SB) + RET + +TEXT ·syscall_rawsyscall9(SB),NOSPLIT,$0 + MOVD a1+8(FP), R1 + MOVD a2+16(FP), R2 + MOVD a3+24(FP), R3 + + // Get library control area (LCA). + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 + + // Get function. + MOVD CAA(R8), R9 + MOVD EDCHPXV(R9), R9 + MOVD trap+0(FP), R5 + SLD $4, R5 + ADD R5, R9 + LMG 0(R9), R5, R6 + + // Restore LE stack. + MOVD SAVSTACK_ASYNC(R8), R9 + MOVD 0(R9), R4 + MOVD $0, 0(R9) + + // Fill in parameter list. + MOVD a4+32(FP), R12 + MOVD R12, (2176+24)(R4) + MOVD a5+40(FP), R12 + MOVD R12, (2176+32)(R4) + MOVD a6+48(FP), R12 + MOVD R12, (2176+40)(R4) + MOVD a7+56(FP), R12 + MOVD R12, (2176+48)(R4) + MOVD a8+64(FP), R12 + MOVD R12, (2176+56)(R4) + MOVD a9+72(FP), R12 + MOVD R12, (2176+64)(R4) + + // Call function. + LE_CALL + NOPH + XOR R0, R0 // Restore R0 to $0. + MOVD R4, 0(R9) // Save stack pointer. + + MOVD R3, r1+80(FP) + MOVD R0, r2+88(FP) + MOVD R0, err+96(FP) + MOVW R3, R4 + CMP R4, $-1 + BNE done + BL addrerrno<>(SB) + MOVWZ 0(R3), R3 + MOVD R3, err+96(FP) +done: + RET + +// func svcCall(fnptr unsafe.Pointer, argv *unsafe.Pointer, dsa *uint64) +TEXT ·svcCall(SB),NOSPLIT,$0 + BL runtime·save_g(SB) // Save g and stack pointer + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 + MOVD SAVSTACK_ASYNC(R8), R9 + MOVD R15, 0(R9) + + MOVD argv+8(FP), R1 // Move function arguments into registers + MOVD dsa+16(FP), g + MOVD fnptr+0(FP), R15 + + BYTE $0x0D // Branch to function + BYTE $0xEF + + BL runtime·load_g(SB) // Restore g and stack pointer + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 + MOVD SAVSTACK_ASYNC(R8), R9 + MOVD 0(R9), R15 + + RET + +// func svcLoad(name *byte) unsafe.Pointer +TEXT ·svcLoad(SB),NOSPLIT,$0 + MOVD R15, R2 // Save go stack pointer + MOVD name+0(FP), R0 // Move SVC args into registers + MOVD $0x80000000, R1 + MOVD $0, R15 + BYTE $0x0A // SVC 08 LOAD + BYTE $0x08 + MOVW R15, R3 // Save return code from SVC + MOVD R2, R15 // Restore go stack pointer + CMP R3, $0 // Check SVC return code + BNE error + + MOVD $-2, R3 // Reset last bit of entry point to zero + AND R0, R3 + MOVD R3, addr+8(FP) // Return entry point returned by SVC + CMP R0, R3 // Check if last bit of entry point was set + BNE done + + MOVD R15, R2 // Save go stack pointer + MOVD $0, R15 // Move SVC args into registers (entry point still in r0 from SVC 08) + BYTE $0x0A // SVC 09 DELETE + BYTE $0x09 + MOVD R2, R15 // Restore go stack pointer + +error: + MOVD $0, addr+8(FP) // Return 0 on failure +done: + XOR R0, R0 // Reset r0 to 0 + RET + +// func svcUnload(name *byte, fnptr unsafe.Pointer) int64 +TEXT ·svcUnload(SB),NOSPLIT,$0 + MOVD R15, R2 // Save go stack pointer + MOVD name+0(FP), R0 // Move SVC args into registers + MOVD addr+8(FP), R15 + BYTE $0x0A // SVC 09 + BYTE $0x09 + XOR R0, R0 // Reset r0 to 0 + MOVD R15, R1 // Save SVC return code + MOVD R2, R15 // Restore go stack pointer + MOVD R1, rc+0(FP) // Return SVC return code + RET + +// func gettid() uint64 +TEXT ·gettid(SB), NOSPLIT, $0 + // Get library control area (LCA). + MOVW PSALAA, R8 + MOVD LCA64(R8), R8 + + // Get CEECAATHDID + MOVD CAA(R8), R9 + MOVD 0x3D0(R9), R9 + MOVD R9, ret+0(FP) + + RET diff --git a/vendor/golang.org/x/sys/unix/cap_freebsd.go b/vendor/golang.org/x/sys/unix/cap_freebsd.go index df52048773..0b7c6adb86 100644 --- a/vendor/golang.org/x/sys/unix/cap_freebsd.go +++ b/vendor/golang.org/x/sys/unix/cap_freebsd.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build freebsd // +build freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/constants.go b/vendor/golang.org/x/sys/unix/constants.go index 3a6ac648dd..394a3965b6 100644 --- a/vendor/golang.org/x/sys/unix/constants.go +++ b/vendor/golang.org/x/sys/unix/constants.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos package unix diff --git a/vendor/golang.org/x/sys/unix/dev_aix_ppc.go b/vendor/golang.org/x/sys/unix/dev_aix_ppc.go index 5e5fb45104..65a998508d 100644 --- a/vendor/golang.org/x/sys/unix/dev_aix_ppc.go +++ b/vendor/golang.org/x/sys/unix/dev_aix_ppc.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix -// +build ppc +//go:build aix && ppc +// +build aix,ppc // Functions to access/create device major and minor numbers matching the // encoding used by AIX. diff --git a/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go b/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go index 8b401244c4..8fc08ad0aa 100644 --- a/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go +++ b/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix -// +build ppc64 +//go:build aix && ppc64 +// +build aix,ppc64 // Functions to access/create device major and minor numbers matching the // encoding used AIX. diff --git a/vendor/golang.org/x/sys/unix/dev_zos.go b/vendor/golang.org/x/sys/unix/dev_zos.go new file mode 100644 index 0000000000..a388e59a0e --- /dev/null +++ b/vendor/golang.org/x/sys/unix/dev_zos.go @@ -0,0 +1,29 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build zos && s390x +// +build zos,s390x + +// Functions to access/create device major and minor numbers matching the +// encoding used by z/OS. +// +// The information below is extracted and adapted from macros. + +package unix + +// Major returns the major component of a z/OS device number. +func Major(dev uint64) uint32 { + return uint32((dev >> 16) & 0x0000FFFF) +} + +// Minor returns the minor component of a z/OS device number. +func Minor(dev uint64) uint32 { + return uint32(dev & 0x0000FFFF) +} + +// Mkdev returns a z/OS device number generated from the given major and minor +// components. +func Mkdev(major, minor uint32) uint64 { + return (uint64(major) << 16) | uint64(minor) +} diff --git a/vendor/golang.org/x/sys/unix/dirent.go b/vendor/golang.org/x/sys/unix/dirent.go index 304016b688..e74e5eaa3b 100644 --- a/vendor/golang.org/x/sys/unix/dirent.go +++ b/vendor/golang.org/x/sys/unix/dirent.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package unix diff --git a/vendor/golang.org/x/sys/unix/endian_big.go b/vendor/golang.org/x/sys/unix/endian_big.go index 86781eac22..a520265576 100644 --- a/vendor/golang.org/x/sys/unix/endian_big.go +++ b/vendor/golang.org/x/sys/unix/endian_big.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +//go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 // +build armbe arm64be m68k mips mips64 mips64p32 ppc ppc64 s390 s390x shbe sparc sparc64 package unix diff --git a/vendor/golang.org/x/sys/unix/endian_little.go b/vendor/golang.org/x/sys/unix/endian_little.go index 8822d8541f..4362f47e2c 100644 --- a/vendor/golang.org/x/sys/unix/endian_little.go +++ b/vendor/golang.org/x/sys/unix/endian_little.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh // +build 386 amd64 amd64p32 alpha arm arm64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh package unix diff --git a/vendor/golang.org/x/sys/unix/env_unix.go b/vendor/golang.org/x/sys/unix/env_unix.go index 84178b0a13..29ccc4d133 100644 --- a/vendor/golang.org/x/sys/unix/env_unix.go +++ b/vendor/golang.org/x/sys/unix/env_unix.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos // Unix environment variables. diff --git a/vendor/golang.org/x/sys/unix/epoll_zos.go b/vendor/golang.org/x/sys/unix/epoll_zos.go new file mode 100644 index 0000000000..cedaf7e024 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/epoll_zos.go @@ -0,0 +1,221 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build zos && s390x +// +build zos,s390x + +package unix + +import ( + "sync" +) + +// This file simulates epoll on z/OS using poll. + +// Analogous to epoll_event on Linux. +// TODO(neeilan): Pad is because the Linux kernel expects a 96-bit struct. We never pass this to the kernel; remove? +type EpollEvent struct { + Events uint32 + Fd int32 + Pad int32 +} + +const ( + EPOLLERR = 0x8 + EPOLLHUP = 0x10 + EPOLLIN = 0x1 + EPOLLMSG = 0x400 + EPOLLOUT = 0x4 + EPOLLPRI = 0x2 + EPOLLRDBAND = 0x80 + EPOLLRDNORM = 0x40 + EPOLLWRBAND = 0x200 + EPOLLWRNORM = 0x100 + EPOLL_CTL_ADD = 0x1 + EPOLL_CTL_DEL = 0x2 + EPOLL_CTL_MOD = 0x3 + // The following constants are part of the epoll API, but represent + // currently unsupported functionality on z/OS. + // EPOLL_CLOEXEC = 0x80000 + // EPOLLET = 0x80000000 + // EPOLLONESHOT = 0x40000000 + // EPOLLRDHUP = 0x2000 // Typically used with edge-triggered notis + // EPOLLEXCLUSIVE = 0x10000000 // Exclusive wake-up mode + // EPOLLWAKEUP = 0x20000000 // Relies on Linux's BLOCK_SUSPEND capability +) + +// TODO(neeilan): We can eliminate these epToPoll / pToEpoll calls by using identical mask values for POLL/EPOLL +// constants where possible The lower 16 bits of epoll events (uint32) can fit any system poll event (int16). + +// epToPollEvt converts epoll event field to poll equivalent. +// In epoll, Events is a 32-bit field, while poll uses 16 bits. +func epToPollEvt(events uint32) int16 { + var ep2p = map[uint32]int16{ + EPOLLIN: POLLIN, + EPOLLOUT: POLLOUT, + EPOLLHUP: POLLHUP, + EPOLLPRI: POLLPRI, + EPOLLERR: POLLERR, + } + + var pollEvts int16 = 0 + for epEvt, pEvt := range ep2p { + if (events & epEvt) != 0 { + pollEvts |= pEvt + } + } + + return pollEvts +} + +// pToEpollEvt converts 16 bit poll event bitfields to 32-bit epoll event fields. +func pToEpollEvt(revents int16) uint32 { + var p2ep = map[int16]uint32{ + POLLIN: EPOLLIN, + POLLOUT: EPOLLOUT, + POLLHUP: EPOLLHUP, + POLLPRI: EPOLLPRI, + POLLERR: EPOLLERR, + } + + var epollEvts uint32 = 0 + for pEvt, epEvt := range p2ep { + if (revents & pEvt) != 0 { + epollEvts |= epEvt + } + } + + return epollEvts +} + +// Per-process epoll implementation. +type epollImpl struct { + mu sync.Mutex + epfd2ep map[int]*eventPoll + nextEpfd int +} + +// eventPoll holds a set of file descriptors being watched by the process. A process can have multiple epoll instances. +// On Linux, this is an in-kernel data structure accessed through a fd. +type eventPoll struct { + mu sync.Mutex + fds map[int]*EpollEvent +} + +// epoll impl for this process. +var impl epollImpl = epollImpl{ + epfd2ep: make(map[int]*eventPoll), + nextEpfd: 0, +} + +func (e *epollImpl) epollcreate(size int) (epfd int, err error) { + e.mu.Lock() + defer e.mu.Unlock() + epfd = e.nextEpfd + e.nextEpfd++ + + e.epfd2ep[epfd] = &eventPoll{ + fds: make(map[int]*EpollEvent), + } + return epfd, nil +} + +func (e *epollImpl) epollcreate1(flag int) (fd int, err error) { + return e.epollcreate(4) +} + +func (e *epollImpl) epollctl(epfd int, op int, fd int, event *EpollEvent) (err error) { + e.mu.Lock() + defer e.mu.Unlock() + + ep, ok := e.epfd2ep[epfd] + if !ok { + + return EBADF + } + + switch op { + case EPOLL_CTL_ADD: + // TODO(neeilan): When we make epfds and fds disjoint, detect epoll + // loops here (instances watching each other) and return ELOOP. + if _, ok := ep.fds[fd]; ok { + return EEXIST + } + ep.fds[fd] = event + case EPOLL_CTL_MOD: + if _, ok := ep.fds[fd]; !ok { + return ENOENT + } + ep.fds[fd] = event + case EPOLL_CTL_DEL: + if _, ok := ep.fds[fd]; !ok { + return ENOENT + } + delete(ep.fds, fd) + + } + return nil +} + +// Must be called while holding ep.mu +func (ep *eventPoll) getFds() []int { + fds := make([]int, len(ep.fds)) + for fd := range ep.fds { + fds = append(fds, fd) + } + return fds +} + +func (e *epollImpl) epollwait(epfd int, events []EpollEvent, msec int) (n int, err error) { + e.mu.Lock() // in [rare] case of concurrent epollcreate + epollwait + ep, ok := e.epfd2ep[epfd] + + if !ok { + e.mu.Unlock() + return 0, EBADF + } + + pollfds := make([]PollFd, 4) + for fd, epollevt := range ep.fds { + pollfds = append(pollfds, PollFd{Fd: int32(fd), Events: epToPollEvt(epollevt.Events)}) + } + e.mu.Unlock() + + n, err = Poll(pollfds, msec) + if err != nil { + return n, err + } + + i := 0 + for _, pFd := range pollfds { + if pFd.Revents != 0 { + events[i] = EpollEvent{Fd: pFd.Fd, Events: pToEpollEvt(pFd.Revents)} + i++ + } + + if i == n { + break + } + } + + return n, nil +} + +func EpollCreate(size int) (fd int, err error) { + return impl.epollcreate(size) +} + +func EpollCreate1(flag int) (fd int, err error) { + return impl.epollcreate1(flag) +} + +func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { + return impl.epollctl(epfd, op, fd, event) +} + +// Because EpollWait mutates events, the caller is expected to coordinate +// concurrent access if calling with the same epfd from multiple goroutines. +func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { + return impl.epollwait(epfd, events, msec) +} diff --git a/vendor/golang.org/x/sys/unix/fcntl.go b/vendor/golang.org/x/sys/unix/fcntl.go index 4dc5348643..e9b991258c 100644 --- a/vendor/golang.org/x/sys/unix/fcntl.go +++ b/vendor/golang.org/x/sys/unix/fcntl.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build dragonfly || freebsd || linux || netbsd || openbsd // +build dragonfly freebsd linux netbsd openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go b/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go index 8db48e5e06..cb0dfbd09a 100644 --- a/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go +++ b/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) // +build linux,386 linux,arm linux,mips linux,mipsle package unix diff --git a/vendor/golang.org/x/sys/unix/fdset.go b/vendor/golang.org/x/sys/unix/fdset.go index b27be0a014..b1e07b2202 100644 --- a/vendor/golang.org/x/sys/unix/fdset.go +++ b/vendor/golang.org/x/sys/unix/fdset.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package unix diff --git a/vendor/golang.org/x/sys/unix/fstatfs_zos.go b/vendor/golang.org/x/sys/unix/fstatfs_zos.go new file mode 100644 index 0000000000..e377cc9f49 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/fstatfs_zos.go @@ -0,0 +1,164 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build zos && s390x +// +build zos,s390x + +package unix + +import ( + "unsafe" +) + +// This file simulates fstatfs on z/OS using fstatvfs and w_getmntent. + +func Fstatfs(fd int, stat *Statfs_t) (err error) { + var stat_v Statvfs_t + err = Fstatvfs(fd, &stat_v) + if err == nil { + // populate stat + stat.Type = 0 + stat.Bsize = stat_v.Bsize + stat.Blocks = stat_v.Blocks + stat.Bfree = stat_v.Bfree + stat.Bavail = stat_v.Bavail + stat.Files = stat_v.Files + stat.Ffree = stat_v.Ffree + stat.Fsid = stat_v.Fsid + stat.Namelen = stat_v.Namemax + stat.Frsize = stat_v.Frsize + stat.Flags = stat_v.Flag + for passn := 0; passn < 5; passn++ { + switch passn { + case 0: + err = tryGetmntent64(stat) + break + case 1: + err = tryGetmntent128(stat) + break + case 2: + err = tryGetmntent256(stat) + break + case 3: + err = tryGetmntent512(stat) + break + case 4: + err = tryGetmntent1024(stat) + break + default: + break + } + //proceed to return if: err is nil (found), err is nonnil but not ERANGE (another error occurred) + if err == nil || err != nil && err != ERANGE { + break + } + } + } + return err +} + +func tryGetmntent64(stat *Statfs_t) (err error) { + var mnt_ent_buffer struct { + header W_Mnth + filesys_info [64]W_Mntent + } + var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer)) + fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size) + if err != nil { + return err + } + err = ERANGE //return ERANGE if no match is found in this batch + for i := 0; i < fs_count; i++ { + if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) { + stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0]) + err = nil + break + } + } + return err +} + +func tryGetmntent128(stat *Statfs_t) (err error) { + var mnt_ent_buffer struct { + header W_Mnth + filesys_info [128]W_Mntent + } + var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer)) + fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size) + if err != nil { + return err + } + err = ERANGE //return ERANGE if no match is found in this batch + for i := 0; i < fs_count; i++ { + if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) { + stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0]) + err = nil + break + } + } + return err +} + +func tryGetmntent256(stat *Statfs_t) (err error) { + var mnt_ent_buffer struct { + header W_Mnth + filesys_info [256]W_Mntent + } + var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer)) + fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size) + if err != nil { + return err + } + err = ERANGE //return ERANGE if no match is found in this batch + for i := 0; i < fs_count; i++ { + if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) { + stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0]) + err = nil + break + } + } + return err +} + +func tryGetmntent512(stat *Statfs_t) (err error) { + var mnt_ent_buffer struct { + header W_Mnth + filesys_info [512]W_Mntent + } + var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer)) + fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size) + if err != nil { + return err + } + err = ERANGE //return ERANGE if no match is found in this batch + for i := 0; i < fs_count; i++ { + if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) { + stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0]) + err = nil + break + } + } + return err +} + +func tryGetmntent1024(stat *Statfs_t) (err error) { + var mnt_ent_buffer struct { + header W_Mnth + filesys_info [1024]W_Mntent + } + var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer)) + fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size) + if err != nil { + return err + } + err = ERANGE //return ERANGE if no match is found in this batch + for i := 0; i < fs_count; i++ { + if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) { + stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0]) + err = nil + break + } + } + return err +} diff --git a/vendor/golang.org/x/sys/unix/gccgo.go b/vendor/golang.org/x/sys/unix/gccgo.go index 86032c11ef..0dee23222c 100644 --- a/vendor/golang.org/x/sys/unix/gccgo.go +++ b/vendor/golang.org/x/sys/unix/gccgo.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build gccgo -// +build !aix +//go:build gccgo && !aix +// +build gccgo,!aix package unix diff --git a/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go b/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go index 251a977a81..e60e49a3d9 100644 --- a/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build gccgo && linux && amd64 // +build gccgo,linux,amd64 package unix diff --git a/vendor/golang.org/x/sys/unix/ioctl.go b/vendor/golang.org/x/sys/unix/ioctl.go index 5641678613..6c7ad052e6 100644 --- a/vendor/golang.org/x/sys/unix/ioctl.go +++ b/vendor/golang.org/x/sys/unix/ioctl.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package unix diff --git a/vendor/golang.org/x/sys/unix/ioctl_linux.go b/vendor/golang.org/x/sys/unix/ioctl_linux.go new file mode 100644 index 0000000000..48773f730a --- /dev/null +++ b/vendor/golang.org/x/sys/unix/ioctl_linux.go @@ -0,0 +1,196 @@ +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package unix + +import ( + "runtime" + "unsafe" +) + +// IoctlRetInt performs an ioctl operation specified by req on a device +// associated with opened file descriptor fd, and returns a non-negative +// integer that is returned by the ioctl syscall. +func IoctlRetInt(fd int, req uint) (int, error) { + ret, _, err := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), 0) + if err != 0 { + return 0, err + } + return int(ret), nil +} + +func IoctlGetUint32(fd int, req uint) (uint32, error) { + var value uint32 + err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) + return value, err +} + +func IoctlGetRTCTime(fd int) (*RTCTime, error) { + var value RTCTime + err := ioctl(fd, RTC_RD_TIME, uintptr(unsafe.Pointer(&value))) + return &value, err +} + +func IoctlSetRTCTime(fd int, value *RTCTime) error { + err := ioctl(fd, RTC_SET_TIME, uintptr(unsafe.Pointer(value))) + runtime.KeepAlive(value) + return err +} + +func IoctlGetRTCWkAlrm(fd int) (*RTCWkAlrm, error) { + var value RTCWkAlrm + err := ioctl(fd, RTC_WKALM_RD, uintptr(unsafe.Pointer(&value))) + return &value, err +} + +func IoctlSetRTCWkAlrm(fd int, value *RTCWkAlrm) error { + err := ioctl(fd, RTC_WKALM_SET, uintptr(unsafe.Pointer(value))) + runtime.KeepAlive(value) + return err +} + +type ifreqEthtool struct { + name [IFNAMSIZ]byte + data unsafe.Pointer +} + +// IoctlGetEthtoolDrvinfo fetches ethtool driver information for the network +// device specified by ifname. +func IoctlGetEthtoolDrvinfo(fd int, ifname string) (*EthtoolDrvinfo, error) { + // Leave room for terminating NULL byte. + if len(ifname) >= IFNAMSIZ { + return nil, EINVAL + } + + value := EthtoolDrvinfo{ + Cmd: ETHTOOL_GDRVINFO, + } + ifreq := ifreqEthtool{ + data: unsafe.Pointer(&value), + } + copy(ifreq.name[:], ifname) + err := ioctl(fd, SIOCETHTOOL, uintptr(unsafe.Pointer(&ifreq))) + runtime.KeepAlive(ifreq) + return &value, err +} + +// IoctlGetWatchdogInfo fetches information about a watchdog device from the +// Linux watchdog API. For more information, see: +// https://www.kernel.org/doc/html/latest/watchdog/watchdog-api.html. +func IoctlGetWatchdogInfo(fd int) (*WatchdogInfo, error) { + var value WatchdogInfo + err := ioctl(fd, WDIOC_GETSUPPORT, uintptr(unsafe.Pointer(&value))) + return &value, err +} + +// IoctlWatchdogKeepalive issues a keepalive ioctl to a watchdog device. For +// more information, see: +// https://www.kernel.org/doc/html/latest/watchdog/watchdog-api.html. +func IoctlWatchdogKeepalive(fd int) error { + return ioctl(fd, WDIOC_KEEPALIVE, 0) +} + +// IoctlFileCloneRange performs an FICLONERANGE ioctl operation to clone the +// range of data conveyed in value to the file associated with the file +// descriptor destFd. See the ioctl_ficlonerange(2) man page for details. +func IoctlFileCloneRange(destFd int, value *FileCloneRange) error { + err := ioctl(destFd, FICLONERANGE, uintptr(unsafe.Pointer(value))) + runtime.KeepAlive(value) + return err +} + +// IoctlFileClone performs an FICLONE ioctl operation to clone the entire file +// associated with the file description srcFd to the file associated with the +// file descriptor destFd. See the ioctl_ficlone(2) man page for details. +func IoctlFileClone(destFd, srcFd int) error { + return ioctl(destFd, FICLONE, uintptr(srcFd)) +} + +type FileDedupeRange struct { + Src_offset uint64 + Src_length uint64 + Reserved1 uint16 + Reserved2 uint32 + Info []FileDedupeRangeInfo +} + +type FileDedupeRangeInfo struct { + Dest_fd int64 + Dest_offset uint64 + Bytes_deduped uint64 + Status int32 + Reserved uint32 +} + +// IoctlFileDedupeRange performs an FIDEDUPERANGE ioctl operation to share the +// range of data conveyed in value from the file associated with the file +// descriptor srcFd to the value.Info destinations. See the +// ioctl_fideduperange(2) man page for details. +func IoctlFileDedupeRange(srcFd int, value *FileDedupeRange) error { + buf := make([]byte, SizeofRawFileDedupeRange+ + len(value.Info)*SizeofRawFileDedupeRangeInfo) + rawrange := (*RawFileDedupeRange)(unsafe.Pointer(&buf[0])) + rawrange.Src_offset = value.Src_offset + rawrange.Src_length = value.Src_length + rawrange.Dest_count = uint16(len(value.Info)) + rawrange.Reserved1 = value.Reserved1 + rawrange.Reserved2 = value.Reserved2 + + for i := range value.Info { + rawinfo := (*RawFileDedupeRangeInfo)(unsafe.Pointer( + uintptr(unsafe.Pointer(&buf[0])) + uintptr(SizeofRawFileDedupeRange) + + uintptr(i*SizeofRawFileDedupeRangeInfo))) + rawinfo.Dest_fd = value.Info[i].Dest_fd + rawinfo.Dest_offset = value.Info[i].Dest_offset + rawinfo.Bytes_deduped = value.Info[i].Bytes_deduped + rawinfo.Status = value.Info[i].Status + rawinfo.Reserved = value.Info[i].Reserved + } + + err := ioctl(srcFd, FIDEDUPERANGE, uintptr(unsafe.Pointer(&buf[0]))) + + // Output + for i := range value.Info { + rawinfo := (*RawFileDedupeRangeInfo)(unsafe.Pointer( + uintptr(unsafe.Pointer(&buf[0])) + uintptr(SizeofRawFileDedupeRange) + + uintptr(i*SizeofRawFileDedupeRangeInfo))) + value.Info[i].Dest_fd = rawinfo.Dest_fd + value.Info[i].Dest_offset = rawinfo.Dest_offset + value.Info[i].Bytes_deduped = rawinfo.Bytes_deduped + value.Info[i].Status = rawinfo.Status + value.Info[i].Reserved = rawinfo.Reserved + } + + return err +} + +func IoctlHIDGetDesc(fd int, value *HIDRawReportDescriptor) error { + err := ioctl(fd, HIDIOCGRDESC, uintptr(unsafe.Pointer(value))) + runtime.KeepAlive(value) + return err +} + +func IoctlHIDGetRawInfo(fd int) (*HIDRawDevInfo, error) { + var value HIDRawDevInfo + err := ioctl(fd, HIDIOCGRAWINFO, uintptr(unsafe.Pointer(&value))) + return &value, err +} + +func IoctlHIDGetRawName(fd int) (string, error) { + var value [_HIDIOCGRAWNAME_LEN]byte + err := ioctl(fd, _HIDIOCGRAWNAME, uintptr(unsafe.Pointer(&value[0]))) + return ByteSliceToString(value[:]), err +} + +func IoctlHIDGetRawPhys(fd int) (string, error) { + var value [_HIDIOCGRAWPHYS_LEN]byte + err := ioctl(fd, _HIDIOCGRAWPHYS, uintptr(unsafe.Pointer(&value[0]))) + return ByteSliceToString(value[:]), err +} + +func IoctlHIDGetRawUniq(fd int) (string, error) { + var value [_HIDIOCGRAWUNIQ_LEN]byte + err := ioctl(fd, _HIDIOCGRAWUNIQ, uintptr(unsafe.Pointer(&value[0]))) + return ByteSliceToString(value[:]), err +} diff --git a/vendor/golang.org/x/sys/unix/ioctl_zos.go b/vendor/golang.org/x/sys/unix/ioctl_zos.go new file mode 100644 index 0000000000..5384e7d91d --- /dev/null +++ b/vendor/golang.org/x/sys/unix/ioctl_zos.go @@ -0,0 +1,74 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build zos && s390x +// +build zos,s390x + +package unix + +import ( + "runtime" + "unsafe" +) + +// ioctl itself should not be exposed directly, but additional get/set +// functions for specific types are permissible. + +// IoctlSetInt performs an ioctl operation which sets an integer value +// on fd, using the specified request number. +func IoctlSetInt(fd int, req uint, value int) error { + return ioctl(fd, req, uintptr(value)) +} + +// IoctlSetWinsize performs an ioctl on fd with a *Winsize argument. +// +// To change fd's window size, the req argument should be TIOCSWINSZ. +func IoctlSetWinsize(fd int, req uint, value *Winsize) error { + // TODO: if we get the chance, remove the req parameter and + // hardcode TIOCSWINSZ. + err := ioctl(fd, req, uintptr(unsafe.Pointer(value))) + runtime.KeepAlive(value) + return err +} + +// IoctlSetTermios performs an ioctl on fd with a *Termios. +// +// The req value is expected to be TCSETS, TCSETSW, or TCSETSF +func IoctlSetTermios(fd int, req uint, value *Termios) error { + if (req != TCSETS) && (req != TCSETSW) && (req != TCSETSF) { + return ENOSYS + } + err := Tcsetattr(fd, int(req), value) + runtime.KeepAlive(value) + return err +} + +// IoctlGetInt performs an ioctl operation which gets an integer value +// from fd, using the specified request number. +// +// A few ioctl requests use the return value as an output parameter; +// for those, IoctlRetInt should be used instead of this function. +func IoctlGetInt(fd int, req uint) (int, error) { + var value int + err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) + return value, err +} + +func IoctlGetWinsize(fd int, req uint) (*Winsize, error) { + var value Winsize + err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) + return &value, err +} + +// IoctlGetTermios performs an ioctl on fd with a *Termios. +// +// The req value is expected to be TCGETS +func IoctlGetTermios(fd int, req uint) (*Termios, error) { + var value Termios + if req != TCGETS { + return &value, ENOSYS + } + err := Tcgetattr(fd, &value) + return &value, err +} diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh index d257fac505..d727cad19c 100644 --- a/vendor/golang.org/x/sys/unix/mkall.sh +++ b/vendor/golang.org/x/sys/unix/mkall.sh @@ -199,7 +199,7 @@ illumos_amd64) mksyscall="go run mksyscall_solaris.go" mkerrors= mksysnum= - mktypes= + mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; *) echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2 diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index 928fa7a9fb..007358af8f 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -56,6 +56,7 @@ includes_Darwin=' #define _DARWIN_C_SOURCE #define KERNEL #define _DARWIN_USE_64_BIT_INODE +#define __APPLE_USE_RFC_3542 #include #include #include @@ -65,6 +66,7 @@ includes_Darwin=' #include #include #include +#include #include #include #include @@ -114,6 +116,7 @@ includes_FreeBSD=' #include #include #include +#include #include #include #include @@ -204,6 +207,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -212,6 +216,8 @@ struct ltchars { #include #include #include +#include +#include #include #include #include @@ -222,6 +228,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -298,6 +305,17 @@ struct ltchars { // Including linux/l2tp.h here causes conflicts between linux/in.h // and netinet/in.h included via net/route.h above. #define IPPROTO_L2TP 115 + +// Copied from linux/hid.h. +// Keep in sync with the size of the referenced fields. +#define _HIDIOCGRAWNAME_LEN 128 // sizeof_field(struct hid_device, name) +#define _HIDIOCGRAWPHYS_LEN 64 // sizeof_field(struct hid_device, phys) +#define _HIDIOCGRAWUNIQ_LEN 64 // sizeof_field(struct hid_device, uniq) + +#define _HIDIOCGRAWNAME HIDIOCGRAWNAME(_HIDIOCGRAWNAME_LEN) +#define _HIDIOCGRAWPHYS HIDIOCGRAWPHYS(_HIDIOCGRAWPHYS_LEN) +#define _HIDIOCGRAWUNIQ HIDIOCGRAWUNIQ(_HIDIOCGRAWUNIQ_LEN) + ' includes_NetBSD=' @@ -387,10 +405,11 @@ includes_SunOS=' #include #include #include +#include #include -#include #include #include +#include ' @@ -445,6 +464,8 @@ ccflags="$@" $2 !~ /^EPROC_/ && $2 !~ /^EQUIV_/ && $2 !~ /^EXPR_/ && + $2 !~ /^EVIOC/ && + $2 !~ /^EV_/ && $2 ~ /^E[A-Z0-9_]+$/ || $2 ~ /^B[0-9_]+$/ || $2 ~ /^(OLD|NEW)DEV$/ || @@ -479,10 +500,10 @@ ccflags="$@" $2 ~ /^LOCK_(SH|EX|NB|UN)$/ || $2 ~ /^LO_(KEY|NAME)_SIZE$/ || $2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ || - $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|MCAST|EVFILT|NOTE|EV|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ || + $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL)_/ || $2 ~ /^TP_STATUS_/ || $2 ~ /^FALLOC_/ || - $2 == "ICMPV6_FILTER" || + $2 ~ /^ICMPV?6?_(FILTER|SEC)/ || $2 == "SOMAXCONN" || $2 == "NAME_MAX" || $2 == "IFNAMSIZ" || @@ -563,11 +584,15 @@ ccflags="$@" $2 ~ /^TIPC_/ || $2 !~ "DEVLINK_RELOAD_LIMITS_VALID_MASK" && $2 ~ /^DEVLINK_/ || + $2 ~ /^ETHTOOL_/ || $2 ~ /^LWTUNNEL_IP/ || $2 !~ "WMESGLEN" && $2 ~ /^W[A-Z0-9]+$/ || $2 ~/^PPPIOC/ || $2 ~ /^FAN_|FANOTIFY_/ || + $2 == "HID_MAX_DESCRIPTOR_SIZE" || + $2 ~ /^_?HIDIOC/ || + $2 ~ /^BUS_(USB|HIL|BLUETOOTH|VIRTUAL)$/ || $2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)} $2 ~ /^__WCOREFLAG$/ {next} $2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)} @@ -605,6 +630,7 @@ echo '#include ' | $CC -x c - -E -dM $ccflags | echo '// mkerrors.sh' "$@" echo '// Code generated by the command above; see README.md. DO NOT EDIT.' echo +echo "//go:build ${GOARCH} && ${GOOS}" echo "// +build ${GOARCH},${GOOS}" echo go tool cgo -godefs -- "$@" _const.go >_error.out diff --git a/vendor/golang.org/x/sys/unix/pagesize_unix.go b/vendor/golang.org/x/sys/unix/pagesize_unix.go index bc2f3629a7..53f1b4c5b8 100644 --- a/vendor/golang.org/x/sys/unix/pagesize_unix.go +++ b/vendor/golang.org/x/sys/unix/pagesize_unix.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris // For Unix, get the pagesize from the runtime. diff --git a/vendor/golang.org/x/sys/unix/ptrace_darwin.go b/vendor/golang.org/x/sys/unix/ptrace_darwin.go new file mode 100644 index 0000000000..463c3eff7f --- /dev/null +++ b/vendor/golang.org/x/sys/unix/ptrace_darwin.go @@ -0,0 +1,12 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build darwin && !ios +// +build darwin,!ios + +package unix + +func ptrace(request int, pid int, addr uintptr, data uintptr) error { + return ptrace1(request, pid, addr, data) +} diff --git a/vendor/golang.org/x/sys/unix/ptrace_ios.go b/vendor/golang.org/x/sys/unix/ptrace_ios.go new file mode 100644 index 0000000000..ed0509a011 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/ptrace_ios.go @@ -0,0 +1,12 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build ios +// +build ios + +package unix + +func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { + return ENOTSUP +} diff --git a/vendor/golang.org/x/sys/unix/race.go b/vendor/golang.org/x/sys/unix/race.go index 61712b51c9..6f6c5fec5a 100644 --- a/vendor/golang.org/x/sys/unix/race.go +++ b/vendor/golang.org/x/sys/unix/race.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (darwin && race) || (linux && race) || (freebsd && race) // +build darwin,race linux,race freebsd,race package unix diff --git a/vendor/golang.org/x/sys/unix/race0.go b/vendor/golang.org/x/sys/unix/race0.go index ad026678c7..706e1322ae 100644 --- a/vendor/golang.org/x/sys/unix/race0.go +++ b/vendor/golang.org/x/sys/unix/race0.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly +//go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos +// +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly zos package unix diff --git a/vendor/golang.org/x/sys/unix/readdirent_getdents.go b/vendor/golang.org/x/sys/unix/readdirent_getdents.go index 3a90aa6dfa..4d6257569e 100644 --- a/vendor/golang.org/x/sys/unix/readdirent_getdents.go +++ b/vendor/golang.org/x/sys/unix/readdirent_getdents.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || dragonfly || freebsd || linux || netbsd || openbsd // +build aix dragonfly freebsd linux netbsd openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go b/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go index 5fdae40b3a..2a4ba47c45 100644 --- a/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go +++ b/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build darwin // +build darwin package unix diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_unix.go b/vendor/golang.org/x/sys/unix/sockcmsg_unix.go index 003916ed7a..453a942c5d 100644 --- a/vendor/golang.org/x/sys/unix/sockcmsg_unix.go +++ b/vendor/golang.org/x/sys/unix/sockcmsg_unix.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos // Socket control messages diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go b/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go index 57a0021da5..0840fe4a57 100644 --- a/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go +++ b/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin freebsd linux netbsd openbsd solaris +//go:build aix || darwin || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin freebsd linux netbsd openbsd solaris zos package unix @@ -36,6 +37,10 @@ func cmsgAlignOf(salen int) int { if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm64" { salign = 16 } + case "zos": + // z/OS socket macros use [32-bit] sizeof(int) alignment, + // not pointer width. + salign = SizeofInt } return (salen + salign - 1) & ^(salign - 1) diff --git a/vendor/golang.org/x/sys/unix/str.go b/vendor/golang.org/x/sys/unix/str.go index 17fb698683..8ba89ed869 100644 --- a/vendor/golang.org/x/sys/unix/str.go +++ b/vendor/golang.org/x/sys/unix/str.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package unix diff --git a/vendor/golang.org/x/sys/unix/syscall.go b/vendor/golang.org/x/sys/unix/syscall.go index ab75ef9cc6..649fa87405 100644 --- a/vendor/golang.org/x/sys/unix/syscall.go +++ b/vendor/golang.org/x/sys/unix/syscall.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos // Package unix contains an interface to the low-level operating system // primitives. OS details vary depending on the underlying system, and diff --git a/vendor/golang.org/x/sys/unix/syscall_aix.go b/vendor/golang.org/x/sys/unix/syscall_aix.go index 4408153822..d8efb715ff 100644 --- a/vendor/golang.org/x/sys/unix/syscall_aix.go +++ b/vendor/golang.org/x/sys/unix/syscall_aix.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix // +build aix // Aix system calls. @@ -251,7 +252,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { } } - bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n] + bytes := (*[len(pp.Path)]byte)(unsafe.Pointer(&pp.Path[0]))[0:n] sa.Name = string(bytes) return sa, nil @@ -419,8 +420,8 @@ func (w WaitStatus) TrapCause() int { return -1 } //sys Mknod(path string, mode uint32, dev int) (err error) //sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) -//sys Open(path string, mode int, perm uint32) (fd int, err error) = open64 -//sys Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) +//sys Open(path string, mode int, perm uint32) (fd int, err error) = open64 +//sys Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) //sys read(fd int, p []byte) (n int, err error) //sys Readlink(path string, buf []byte) (n int, err error) //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) @@ -439,8 +440,8 @@ func (w WaitStatus) TrapCause() int { return -1 } //sysnb Times(tms *Tms) (ticks uintptr, err error) //sysnb Umask(mask int) (oldmask int) //sysnb Uname(buf *Utsname) (err error) -//sys Unlink(path string) (err error) -//sys Unlinkat(dirfd int, path string, flags int) (err error) +//sys Unlink(path string) (err error) +//sys Unlinkat(dirfd int, path string, flags int) (err error) //sys Ustat(dev int, ubuf *Ustat_t) (err error) //sys write(fd int, p []byte) (n int, err error) //sys readlen(fd int, p *byte, np int) (n int, err error) = read @@ -514,7 +515,7 @@ func Munmap(b []byte) (err error) { //sys Munlock(b []byte) (err error) //sys Munlockall() (err error) -//sysnb pipe(p *[2]_C_int) (err error) +//sysnb pipe(p *[2]_C_int) (err error) func Pipe(p []int) (err error) { if len(p) != 2 { diff --git a/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go b/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go index b3c8e3301c..e92a0be163 100644 --- a/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go +++ b/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix -// +build ppc +//go:build aix && ppc +// +build aix,ppc package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go b/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go index 9a6e024179..16eed17098 100644 --- a/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go +++ b/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix -// +build ppc64 +//go:build aix && ppc64 +// +build aix,ppc64 package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_bsd.go b/vendor/golang.org/x/sys/unix/syscall_bsd.go index bc634a280a..95ac3946b5 100644 --- a/vendor/golang.org/x/sys/unix/syscall_bsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_bsd.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build darwin || dragonfly || freebsd || netbsd || openbsd // +build darwin dragonfly freebsd netbsd openbsd // BSD system call wrappers shared by *BSD based systems @@ -318,7 +319,7 @@ func Getsockname(fd int) (sa Sockaddr, err error) { return anyToSockaddr(fd, &rsa) } -//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) +//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) // GetsockoptString returns the string value of the socket option opt for the // socket associated with fd at the given socket level. @@ -332,8 +333,8 @@ func GetsockoptString(fd, level, opt int) (string, error) { return string(buf[:vallen-1]), nil } -//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) -//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) +//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) +//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) { @@ -626,7 +627,7 @@ func Futimes(fd int, tv []Timeval) error { return futimes(fd, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } -//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) +//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) func Poll(fds []PollFd, timeout int) (n int, err error) { if len(fds) == 0 { diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go b/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go index b31ef03588..b0098607c7 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build darwin && go1.12 && !go1.13 // +build darwin,go1.12,!go1.13 package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go b/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go index ee852f1abc..5fc3cda6fc 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build darwin && go1.13 // +build darwin,go1.13 package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go index b625738900..1223d7aed1 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -119,13 +119,16 @@ type attrList struct { Forkattr uint32 } -//sysnb pipe() (r int, w int, err error) +//sysnb pipe(p *[2]int32) (err error) func Pipe(p []int) (err error) { if len(p) != 2 { return EINVAL } - p[0], p[1], err = pipe() + var x [2]int32 + err = pipe(&x) + p[0] = int(x[0]) + p[1] = int(x[1]) return } @@ -269,7 +272,7 @@ func setattrlistTimes(path string, times []Timespec, flags int) error { options) } -//sys setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) +//sys setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error { // Darwin doesn't support SYS_UTIMENSAT @@ -317,7 +320,7 @@ func IoctlSetIfreqMTU(fd int, ifreq *IfreqMTU) error { return err } -//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS_SYSCTL +//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS_SYSCTL func Uname(uname *Utsname) error { mib := []_C_int{CTL_KERN, KERN_OSTYPE} @@ -375,6 +378,15 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e return } +// GetsockoptXucred is a getsockopt wrapper that returns an Xucred struct. +// The usual level and opt are SOL_LOCAL and LOCAL_PEERCRED, respectively. +func GetsockoptXucred(fd, level, opt int) (*Xucred, error) { + x := new(Xucred) + vallen := _Socklen(SizeofXucred) + err := getsockopt(fd, level, opt, unsafe.Pointer(x), &vallen) + return x, err +} + //sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) /* @@ -469,8 +481,8 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys Unlinkat(dirfd int, path string, flags int) (err error) //sys Unmount(path string, flags int) (err error) //sys write(fd int, p []byte) (n int, err error) -//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) -//sys munmap(addr uintptr, length uintptr) (err error) +//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) +//sys munmap(addr uintptr, length uintptr) (err error) //sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ //sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_386.go b/vendor/golang.org/x/sys/unix/syscall_darwin_386.go index 6c1f4ab95b..6474677122 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin_386.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build 386 && darwin // +build 386,darwin package unix @@ -45,6 +46,6 @@ func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64 //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64 //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 -//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error) +//sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 //sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64 diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go index 0582ae256e..b37310ce9b 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build amd64 && darwin // +build amd64,darwin package unix @@ -45,6 +46,6 @@ func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64 //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64 //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 -//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error) +//sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 //sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64 diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go index c6a9733b4c..d30735c5d6 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go @@ -6,7 +6,7 @@ package unix import "syscall" -func ptrace(request int, pid int, addr uintptr, data uintptr) error { +func ptrace1(request int, pid int, addr uintptr, data uintptr) error { return ENOTSUP } diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go index 253afa4de5..d51ec99630 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build arm64 && darwin // +build arm64,darwin package unix @@ -45,6 +46,6 @@ func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, //sys Fstatfs(fd int, stat *Statfs_t) (err error) //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT //sys Lstat(path string, stat *Stat_t) (err error) -//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error) +//sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace //sys Stat(path string, stat *Stat_t) (err error) //sys Statfs(path string, stat *Statfs_t) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go b/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go index f34c86c899..38bec30026 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build darwin && go1.12 // +build darwin,go1.12 package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go index a4f2944a24..5af108a503 100644 --- a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go +++ b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go @@ -95,7 +95,7 @@ func direntNamlen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen)) } -//sysnb pipe() (r int, w int, err error) +//sysnb pipe() (r int, w int, err error) func Pipe(p []int) (err error) { if len(p) != 2 { @@ -105,16 +105,16 @@ func Pipe(p []int) (err error) { return } -//sysnb pipe2(p *[2]_C_int, flags int) (err error) +//sysnb pipe2(p *[2]_C_int, flags int) (r int, w int, err error) -func Pipe2(p []int, flags int) error { +func Pipe2(p []int, flags int) (err error) { if len(p) != 2 { return EINVAL } var pp [2]_C_int - err := pipe2(&pp, flags) - p[0] = int(pp[0]) - p[1] = int(pp[1]) + // pipe2 on dragonfly takes an fds array as an argument, but still + // returns the file descriptors. + p[0], p[1], err = pipe2(&pp, flags) return err } @@ -170,7 +170,7 @@ func setattrlistTimes(path string, times []Timespec, flags int) error { //sys ioctl(fd int, req uint, arg uintptr) (err error) -//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL +//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL func sysctlUname(mib []_C_int, old *byte, oldlen *uintptr) error { err := sysctl(mib, old, oldlen, nil, 0) @@ -337,8 +337,8 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys Unlinkat(dirfd int, path string, flags int) (err error) //sys Unmount(path string, flags int) (err error) //sys write(fd int, p []byte) (n int, err error) -//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) -//sys munmap(addr uintptr, length uintptr) (err error) +//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) +//sys munmap(addr uintptr, length uintptr) (err error) //sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ //sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE //sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go index a6b4830ac8..4e2d32120a 100644 --- a/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build amd64 && dragonfly // +build amd64,dragonfly package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/vendor/golang.org/x/sys/unix/syscall_freebsd.go index acc00c2e6a..18c392cf36 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd.go @@ -126,6 +126,15 @@ func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) { return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq)) } +// GetsockoptXucred is a getsockopt wrapper that returns an Xucred struct. +// The usual level and opt are SOL_LOCAL and LOCAL_PEERCRED, respectively. +func GetsockoptXucred(fd, level, opt int) (*Xucred, error) { + x := new(Xucred) + vallen := _Socklen(SizeofXucred) + err := getsockopt(fd, level, opt, unsafe.Pointer(x), &vallen) + return x, err +} + func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny @@ -188,9 +197,9 @@ func setattrlistTimes(path string, times []Timespec, flags int) error { return ENOSYS } -//sys ioctl(fd int, req uint, arg uintptr) (err error) +//sys ioctl(fd int, req uint, arg uintptr) (err error) -//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL +//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL func Uname(uname *Utsname) error { mib := []_C_int{CTL_KERN, KERN_OSTYPE} @@ -665,8 +674,8 @@ func PtraceSingleStep(pid int) (err error) { //sys Unlinkat(dirfd int, path string, flags int) (err error) //sys Unmount(path string, flags int) (err error) //sys write(fd int, p []byte) (n int, err error) -//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) -//sys munmap(addr uintptr, length uintptr) (err error) +//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) +//sys munmap(addr uintptr, length uintptr) (err error) //sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ //sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE //sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go index 72a506ddcb..342fc32b16 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build 386 && freebsd // +build 386,freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go index d5e376acae..a32d5aa4ae 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build amd64 && freebsd // +build amd64,freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go index 4ea45bce52..1e36d39abe 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build arm && freebsd // +build arm,freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go index aa5326db19..a09a1537bd 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build arm64 && freebsd // +build arm64,freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_illumos.go b/vendor/golang.org/x/sys/unix/syscall_illumos.go index bbc4f3ea54..c5c58806ca 100644 --- a/vendor/golang.org/x/sys/unix/syscall_illumos.go +++ b/vendor/golang.org/x/sys/unix/syscall_illumos.go @@ -4,11 +4,14 @@ // illumos system calls not present on Solaris. +//go:build amd64 && illumos // +build amd64,illumos package unix -import "unsafe" +import ( + "unsafe" +) func bytes2iovec(bs [][]byte) []Iovec { iovecs := make([]Iovec, len(bs)) @@ -76,15 +79,51 @@ func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) { return } -//sysnb pipe2(p *[2]_C_int, flags int) (err error) +//sys putmsg(fd int, clptr *strbuf, dataptr *strbuf, flags int) (err error) -func Pipe2(p []int, flags int) error { - if len(p) != 2 { - return EINVAL +func Putmsg(fd int, cl []byte, data []byte, flags int) (err error) { + var clp, datap *strbuf + if len(cl) > 0 { + clp = &strbuf{ + Len: int32(len(cl)), + Buf: (*int8)(unsafe.Pointer(&cl[0])), + } + } + if len(data) > 0 { + datap = &strbuf{ + Len: int32(len(data)), + Buf: (*int8)(unsafe.Pointer(&data[0])), + } + } + return putmsg(fd, clp, datap, flags) +} + +//sys getmsg(fd int, clptr *strbuf, dataptr *strbuf, flags *int) (err error) + +func Getmsg(fd int, cl []byte, data []byte) (retCl []byte, retData []byte, flags int, err error) { + var clp, datap *strbuf + if len(cl) > 0 { + clp = &strbuf{ + Maxlen: int32(len(cl)), + Buf: (*int8)(unsafe.Pointer(&cl[0])), + } + } + if len(data) > 0 { + datap = &strbuf{ + Maxlen: int32(len(data)), + Buf: (*int8)(unsafe.Pointer(&data[0])), + } + } + + if err = getmsg(fd, clp, datap, &flags); err != nil { + return nil, nil, 0, err + } + + if len(cl) > 0 { + retCl = cl[:clp.Len] + } + if len(data) > 0 { + retData = data[:datap.Len] } - var pp [2]_C_int - err := pipe2(&pp, flags) - p[0] = int(pp[0]) - p[1] = int(pp[1]) - return err + return retCl, retData, flags, nil } diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index 28be1306ec..4263953bee 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -70,88 +70,7 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { // ioctl itself should not be exposed directly, but additional get/set // functions for specific types are permissible. - -// IoctlRetInt performs an ioctl operation specified by req on a device -// associated with opened file descriptor fd, and returns a non-negative -// integer that is returned by the ioctl syscall. -func IoctlRetInt(fd int, req uint) (int, error) { - ret, _, err := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), 0) - if err != 0 { - return 0, err - } - return int(ret), nil -} - -func IoctlSetRTCTime(fd int, value *RTCTime) error { - err := ioctl(fd, RTC_SET_TIME, uintptr(unsafe.Pointer(value))) - runtime.KeepAlive(value) - return err -} - -func IoctlSetRTCWkAlrm(fd int, value *RTCWkAlrm) error { - err := ioctl(fd, RTC_WKALM_SET, uintptr(unsafe.Pointer(value))) - runtime.KeepAlive(value) - return err -} - -func IoctlGetUint32(fd int, req uint) (uint32, error) { - var value uint32 - err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) - return value, err -} - -func IoctlGetRTCTime(fd int) (*RTCTime, error) { - var value RTCTime - err := ioctl(fd, RTC_RD_TIME, uintptr(unsafe.Pointer(&value))) - return &value, err -} - -// IoctlGetWatchdogInfo fetches information about a watchdog device from the -// Linux watchdog API. For more information, see: -// https://www.kernel.org/doc/html/latest/watchdog/watchdog-api.html. -func IoctlGetWatchdogInfo(fd int) (*WatchdogInfo, error) { - var value WatchdogInfo - err := ioctl(fd, WDIOC_GETSUPPORT, uintptr(unsafe.Pointer(&value))) - return &value, err -} - -func IoctlGetRTCWkAlrm(fd int) (*RTCWkAlrm, error) { - var value RTCWkAlrm - err := ioctl(fd, RTC_WKALM_RD, uintptr(unsafe.Pointer(&value))) - return &value, err -} - -// IoctlFileCloneRange performs an FICLONERANGE ioctl operation to clone the -// range of data conveyed in value to the file associated with the file -// descriptor destFd. See the ioctl_ficlonerange(2) man page for details. -func IoctlFileCloneRange(destFd int, value *FileCloneRange) error { - err := ioctl(destFd, FICLONERANGE, uintptr(unsafe.Pointer(value))) - runtime.KeepAlive(value) - return err -} - -// IoctlFileClone performs an FICLONE ioctl operation to clone the entire file -// associated with the file description srcFd to the file associated with the -// file descriptor destFd. See the ioctl_ficlone(2) man page for details. -func IoctlFileClone(destFd, srcFd int) error { - return ioctl(destFd, FICLONE, uintptr(srcFd)) -} - -// IoctlFileDedupeRange performs an FIDEDUPERANGE ioctl operation to share the -// range of data conveyed in value with the file associated with the file -// descriptor destFd. See the ioctl_fideduperange(2) man page for details. -func IoctlFileDedupeRange(destFd int, value *FileDedupeRange) error { - err := ioctl(destFd, FIDEDUPERANGE, uintptr(unsafe.Pointer(value))) - runtime.KeepAlive(value) - return err -} - -// IoctlWatchdogKeepalive issues a keepalive ioctl to a watchdog device. For -// more information, see: -// https://www.kernel.org/doc/html/latest/watchdog/watchdog-api.html. -func IoctlWatchdogKeepalive(fd int) error { - return ioctl(fd, WDIOC_KEEPALIVE, 0) -} +// These are defined in ioctl.go and ioctl_linux.go. //sys Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) @@ -778,16 +697,19 @@ type SockaddrVM struct { // CID and Port specify a context ID and port address for a VM socket. // Guests have a unique CID, and hosts may have a well-known CID of: // - VMADDR_CID_HYPERVISOR: refers to the hypervisor process. + // - VMADDR_CID_LOCAL: refers to local communication (loopback). // - VMADDR_CID_HOST: refers to other processes on the host. - CID uint32 - Port uint32 - raw RawSockaddrVM + CID uint32 + Port uint32 + Flags uint8 + raw RawSockaddrVM } func (sa *SockaddrVM) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_VSOCK sa.raw.Port = sa.Port sa.raw.Cid = sa.CID + sa.raw.Flags = sa.Flags return unsafe.Pointer(&sa.raw), SizeofSockaddrVM, nil } @@ -1092,8 +1014,9 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { case AF_VSOCK: pp := (*RawSockaddrVM)(unsafe.Pointer(rsa)) sa := &SockaddrVM{ - CID: pp.Cid, - Port: pp.Port, + CID: pp.Cid, + Port: pp.Port, + Flags: pp.Flags, } return sa, nil case AF_BLUETOOTH: @@ -1482,8 +1405,8 @@ func KeyctlRestrictKeyring(ringid int, keyType string, restriction string) error return keyctlRestrictKeyringByType(KEYCTL_RESTRICT_KEYRING, ringid, keyType, restriction) } -//sys keyctlRestrictKeyringByType(cmd int, arg2 int, keyType string, restriction string) (err error) = SYS_KEYCTL -//sys keyctlRestrictKeyring(cmd int, arg2 int) (err error) = SYS_KEYCTL +//sys keyctlRestrictKeyringByType(cmd int, arg2 int, keyType string, restriction string) (err error) = SYS_KEYCTL +//sys keyctlRestrictKeyring(cmd int, arg2 int) (err error) = SYS_KEYCTL func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) { var msg Msghdr @@ -1798,6 +1721,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys ClockGettime(clockid int32, time *Timespec) (err error) //sys ClockNanosleep(clockid int32, flags int, request *Timespec, remain *Timespec) (err error) //sys Close(fd int) (err error) +//sys CloseRange(first uint, last uint, flags uint) (err error) //sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) //sys DeleteModule(name string, flags int) (err error) //sys Dup(oldfd int) (fd int, err error) @@ -1860,8 +1784,8 @@ func Getpgrp() (pid int) { //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) //sys PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) //sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT -//sysnb prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT64 -//sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) +//sysnb prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT64 +//sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) //sys Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) = SYS_PSELECT6 //sys read(fd int, p []byte) (n int, err error) //sys Removexattr(path string, attr string) (err error) @@ -1934,9 +1858,9 @@ func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) { //sys Syncfs(fd int) (err error) //sysnb Sysinfo(info *Sysinfo_t) (err error) //sys Tee(rfd int, wfd int, len int, flags int) (n int64, err error) -//sysnb TimerfdCreate(clockid int, flags int) (fd int, err error) -//sysnb TimerfdGettime(fd int, currValue *ItimerSpec) (err error) -//sysnb TimerfdSettime(fd int, flags int, newValue *ItimerSpec, oldValue *ItimerSpec) (err error) +//sysnb TimerfdCreate(clockid int, flags int) (fd int, err error) +//sysnb TimerfdGettime(fd int, currValue *ItimerSpec) (err error) +//sysnb TimerfdSettime(fd int, flags int, newValue *ItimerSpec, oldValue *ItimerSpec) (err error) //sysnb Tgkill(tgid int, tid int, sig syscall.Signal) (err error) //sysnb Times(tms *Tms) (ticks uintptr, err error) //sysnb Umask(mask int) (oldmask int) @@ -2196,8 +2120,8 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { return EACCES } -//sys nameToHandleAt(dirFD int, pathname string, fh *fileHandle, mountID *_C_int, flags int) (err error) = SYS_NAME_TO_HANDLE_AT -//sys openByHandleAt(mountFD int, fh *fileHandle, flags int) (fd int, err error) = SYS_OPEN_BY_HANDLE_AT +//sys nameToHandleAt(dirFD int, pathname string, fh *fileHandle, mountID *_C_int, flags int) (err error) = SYS_NAME_TO_HANDLE_AT +//sys openByHandleAt(mountFD int, fh *fileHandle, flags int) (fd int, err error) = SYS_OPEN_BY_HANDLE_AT // fileHandle is the argument to nameToHandleAt and openByHandleAt. We // originally tried to generate it via unix/linux/types.go with "type diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_386.go index c97c2ee53e..7b52e5d8a4 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_386.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build 386 && linux // +build 386,linux package unix @@ -31,7 +32,7 @@ func Pipe(p []int) (err error) { return } -//sysnb pipe2(p *[2]_C_int, flags int) (err error) +//sysnb pipe2(p *[2]_C_int, flags int) (err error) func Pipe2(p []int, flags int) (err error) { if len(p) != 2 { @@ -98,7 +99,7 @@ type rlimit32 struct { Max uint32 } -//sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_GETRLIMIT +//sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_GETRLIMIT const rlimInf32 = ^uint32(0) const rlimInf64 = ^uint64(0) @@ -129,7 +130,7 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) { return } -//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT +//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT func Setrlimit(resource int, rlim *Rlimit) (err error) { err = prlimit(0, resource, rlim, nil) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go index 72efe86ed4..28b7641152 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build amd64 && linux // +build amd64,linux package unix @@ -138,7 +139,7 @@ func Pipe(p []int) (err error) { return } -//sysnb pipe2(p *[2]_C_int, flags int) (err error) +//sysnb pipe2(p *[2]_C_int, flags int) (err error) func Pipe2(p []int, flags int) (err error) { if len(p) != 2 { diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go b/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go index baa771f8ad..8b0f0f3aa5 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build amd64,linux -// +build gc +//go:build amd64 && linux && gc +// +build amd64,linux,gc package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go index 496837b1e3..68877728ec 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build arm && linux // +build arm,linux package unix @@ -35,7 +36,7 @@ func Pipe(p []int) (err error) { return } -//sysnb pipe2(p *[2]_C_int, flags int) (err error) +//sysnb pipe2(p *[2]_C_int, flags int) (err error) func Pipe2(p []int, flags int) (err error) { if len(p) != 2 { @@ -129,8 +130,8 @@ func Utime(path string, buf *Utimbuf) error { //sys utimes(path string, times *[2]Timeval) (err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 +//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 +//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64 //sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64 @@ -177,7 +178,7 @@ type rlimit32 struct { Max uint32 } -//sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_UGETRLIMIT +//sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_UGETRLIMIT const rlimInf32 = ^uint32(0) const rlimInf64 = ^uint64(0) @@ -208,7 +209,7 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) { return } -//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT +//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT func Setrlimit(resource int, rlim *Rlimit) (err error) { err = prlimit(0, resource, rlim, nil) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go index c6de6b9134..7ed7034761 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build arm64 && linux // +build arm64,linux package unix @@ -155,7 +156,7 @@ func Pipe(p []int) (err error) { return } -//sysnb pipe2(p *[2]_C_int, flags int) (err error) +//sysnb pipe2(p *[2]_C_int, flags int) (err error) func Pipe2(p []int, flags int) (err error) { if len(p) != 2 { diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gc.go b/vendor/golang.org/x/sys/unix/syscall_linux_gc.go index 9edf3961b0..2b1168d7d1 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_gc.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_gc.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux && gc // +build linux,gc package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go index 90e33d8cf7..9843fb4896 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux && gc && 386 // +build linux,gc,386 package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go index 1a97baae73..a6008fccd5 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build arm && gc && linux // +build arm,gc,linux package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go index 308eb7aecf..7740af2428 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux && gccgo && 386 // +build linux,gccgo,386 package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go index aa7fc9e199..e16a12299a 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux && gccgo && arm // +build linux,gccgo,arm package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go index f0287476cd..06dec06fa1 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux && (mips64 || mips64le) // +build linux // +build mips64 mips64le @@ -104,7 +105,7 @@ func Pipe(p []int) (err error) { return } -//sysnb pipe2(p *[2]_C_int, flags int) (err error) +//sysnb pipe2(p *[2]_C_int, flags int) (err error) func Pipe2(p []int, flags int) (err error) { if len(p) != 2 { diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go index c11328111d..8f0d0a5b59 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux && (mips || mipsle) // +build linux // +build mips mipsle @@ -112,7 +113,7 @@ func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: int32(sec), Usec: int32(usec)} } -//sysnb pipe2(p *[2]_C_int, flags int) (err error) +//sysnb pipe2(p *[2]_C_int, flags int) (err error) func Pipe2(p []int, flags int) (err error) { if len(p) != 2 { @@ -125,7 +126,7 @@ func Pipe2(p []int, flags int) (err error) { return } -//sysnb pipe() (p1 int, p2 int, err error) +//sysnb pipe() (p1 int, p2 int, err error) func Pipe(p []int) (err error) { if len(p) != 2 { @@ -153,7 +154,7 @@ type rlimit32 struct { Max uint32 } -//sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_GETRLIMIT +//sysnb getrlimit(resource int, rlim *rlimit32) (err error) = SYS_GETRLIMIT func Getrlimit(resource int, rlim *Rlimit) (err error) { err = prlimit(0, resource, nil, rlim) @@ -181,7 +182,7 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) { return } -//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT +//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT func Setrlimit(resource int, rlim *Rlimit) (err error) { err = prlimit(0, resource, rlim, nil) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go index 349374409b..0b1f0d6da5 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux && (ppc64 || ppc64le) // +build linux // +build ppc64 ppc64le @@ -99,7 +100,7 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } -//sysnb pipe(p *[2]_C_int) (err error) +//sysnb pipe(p *[2]_C_int) (err error) func Pipe(p []int) (err error) { if len(p) != 2 { @@ -112,7 +113,7 @@ func Pipe(p []int) (err error) { return } -//sysnb pipe2(p *[2]_C_int, flags int) (err error) +//sysnb pipe2(p *[2]_C_int, flags int) (err error) func Pipe2(p []int, flags int) (err error) { if len(p) != 2 { diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go index b0b1505565..ce9bcd3171 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build riscv64 && linux // +build riscv64,linux package unix @@ -154,7 +155,7 @@ func Pipe(p []int) (err error) { return } -//sysnb pipe2(p *[2]_C_int, flags int) (err error) +//sysnb pipe2(p *[2]_C_int, flags int) (err error) func Pipe2(p []int, flags int) (err error) { if len(p) != 2 { diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go index 2363f74991..a1e45694b4 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build s390x && linux // +build s390x,linux package unix @@ -76,7 +77,7 @@ func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } -//sysnb pipe2(p *[2]_C_int, flags int) (err error) +//sysnb pipe2(p *[2]_C_int, flags int) (err error) func Pipe(p []int) (err error) { if len(p) != 2 { @@ -249,7 +250,7 @@ func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen } func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) error { - args := [4]uintptr{uintptr(s), uintptr(level), uintptr(name), uintptr(val)} + args := [5]uintptr{uintptr(s), uintptr(level), uintptr(name), uintptr(val), vallen} _, _, err := Syscall(SYS_SOCKETCALL, netSetSockOpt, uintptr(unsafe.Pointer(&args)), 0) if err != 0 { return err diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go index d389f1518f..49055a3cf5 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build sparc64 && linux // +build sparc64,linux package unix @@ -115,7 +116,7 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } -//sysnb pipe(p *[2]_C_int) (err error) +//sysnb pipe(p *[2]_C_int) (err error) func Pipe(p []int) (err error) { if len(p) != 2 { @@ -128,7 +129,7 @@ func Pipe(p []int) (err error) { return } -//sysnb pipe2(p *[2]_C_int, flags int) (err error) +//sysnb pipe2(p *[2]_C_int, flags int) (err error) func Pipe2(p []int, flags int) (err error) { if len(p) != 2 { diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd.go b/vendor/golang.org/x/sys/unix/syscall_netbsd.go index 1e6843b4c3..853d5f0f43 100644 --- a/vendor/golang.org/x/sys/unix/syscall_netbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_netbsd.go @@ -110,7 +110,8 @@ func direntNamlen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen)) } -//sysnb pipe() (fd1 int, fd2 int, err error) +//sysnb pipe() (fd1 int, fd2 int, err error) + func Pipe(p []int) (err error) { if len(p) != 2 { return EINVAL @@ -119,7 +120,21 @@ func Pipe(p []int) (err error) { return } -//sys Getdents(fd int, buf []byte) (n int, err error) +//sysnb pipe2(p *[2]_C_int, flags int) (err error) + +func Pipe2(p []int, flags int) error { + if len(p) != 2 { + return EINVAL + } + var pp [2]_C_int + err := pipe2(&pp, flags) + p[0] = int(pp[0]) + p[1] = int(pp[1]) + return err +} + +//sys Getdents(fd int, buf []byte) (n int, err error) + func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { n, err = Getdents(fd, buf) if err != nil || basep == nil { @@ -159,7 +174,7 @@ func setattrlistTimes(path string, times []Timespec, flags int) error { //sys ioctl(fd int, req uint, arg uintptr) (err error) -//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL +//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL func IoctlGetPtmget(fd int, req uint) (*Ptmget, error) { var value Ptmget diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go index 24da8b5245..5199d282fd 100644 --- a/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build 386 && netbsd // +build 386,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go index 25a0ac8258..70a9c52e98 100644 --- a/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build amd64 && netbsd // +build amd64,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go index 21591ecd4d..3eb5942f93 100644 --- a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build arm && netbsd // +build arm,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go index 8047496350..fc6ccfd810 100644 --- a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build arm64 && netbsd // +build arm64,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go index 6a50b50bd6..22b5503850 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -92,7 +92,7 @@ func Pipe2(p []int, flags int) error { return err } -//sys Getdents(fd int, buf []byte) (n int, err error) +//sys Getdents(fd int, buf []byte) (n int, err error) func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { n, err = Getdents(fd, buf) if err != nil || basep == nil { @@ -154,7 +154,7 @@ func setattrlistTimes(path string, times []Timespec, flags int) error { //sys ioctl(fd int, req uint, arg uintptr) (err error) -//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL +//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL //sys ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go index 42b5a0e51e..6baabcdcb0 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build 386 && openbsd // +build 386,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go index 6ea4b48831..bab25360ea 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build amd64 && openbsd // +build amd64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go index 1c3d26fa2c..8eed3c4d4e 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build arm && openbsd // +build arm,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go index a8c458cb03..483dde99d4 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build arm64 && openbsd // +build arm64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/vendor/golang.org/x/sys/unix/syscall_solaris.go index fee6e99528..77fcde7c18 100644 --- a/vendor/golang.org/x/sys/unix/syscall_solaris.go +++ b/vendor/golang.org/x/sys/unix/syscall_solaris.go @@ -68,6 +68,19 @@ func Pipe(p []int) (err error) { return nil } +//sysnb pipe2(p *[2]_C_int, flags int) (err error) + +func Pipe2(p []int, flags int) error { + if len(p) != 2 { + return EINVAL + } + var pp [2]_C_int + err := pipe2(&pp, flags) + p[0] = int(pp[0]) + p[1] = int(pp[1]) + return err +} + func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { if sa.Port < 0 || sa.Port > 0xFFFF { return nil, 0, EINVAL @@ -552,7 +565,12 @@ func Minor(dev uint64) uint32 { * Expose the ioctl function */ -//sys ioctl(fd int, req uint, arg uintptr) (err error) +//sys ioctlRet(fd int, req uint, arg uintptr) (ret int, err error) = libc.ioctl + +func ioctl(fd int, req uint, arg uintptr) (err error) { + _, err = ioctlRet(fd, req, arg) + return err +} func IoctlSetTermio(fd int, req uint, value *Termio) error { err := ioctl(fd, req, uintptr(unsafe.Pointer(value))) @@ -566,7 +584,7 @@ func IoctlGetTermio(fd int, req uint) (*Termio, error) { return &value, err } -//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) +//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) func Poll(fds []PollFd, timeout int) (n int, err error) { if len(fds) == 0 { @@ -669,6 +687,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys Statvfs(path string, vfsstat *Statvfs_t) (err error) //sys Symlink(path string, link string) (err error) //sys Sync() (err error) +//sys Sysconf(which int) (n int64, err error) //sysnb Times(tms *Tms) (ticks uintptr, err error) //sys Truncate(path string, length int64) (err error) //sys Fsync(fd int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go b/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go index b22a34d7ae..0bd25ef81f 100644 --- a/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build amd64 && solaris // +build amd64,solaris package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_unix.go b/vendor/golang.org/x/sys/unix/syscall_unix.go index 400ba9fbc9..a7618ceb55 100644 --- a/vendor/golang.org/x/sys/unix/syscall_unix.go +++ b/vendor/golang.org/x/sys/unix/syscall_unix.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_unix_gc.go b/vendor/golang.org/x/sys/unix/syscall_unix_gc.go index 87bd161cef..5898e9a52b 100644 --- a/vendor/golang.org/x/sys/unix/syscall_unix_gc.go +++ b/vendor/golang.org/x/sys/unix/syscall_unix_gc.go @@ -2,8 +2,11 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && gc && !ppc64le && !ppc64 // +build darwin dragonfly freebsd linux netbsd openbsd solaris -// +build gc,!ppc64le,!ppc64 +// +build gc +// +build !ppc64le +// +build !ppc64 package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go b/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go index d36216c3ca..f6f707acf2 100644 --- a/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build linux && (ppc64le || ppc64) && gc // +build linux // +build ppc64le ppc64 // +build gc diff --git a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go new file mode 100644 index 0000000000..13f58d2b2f --- /dev/null +++ b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go @@ -0,0 +1,1781 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build zos && s390x +// +build zos,s390x + +package unix + +import ( + "bytes" + "runtime" + "sort" + "sync" + "syscall" + "unsafe" +) + +const ( + O_CLOEXEC = 0 // Dummy value (not supported). + AF_LOCAL = AF_UNIX // AF_LOCAL is an alias for AF_UNIX +) + +func syscall_syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) +func syscall_rawsyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) +func syscall_syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) +func syscall_rawsyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) +func syscall_syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) +func syscall_rawsyscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) + +func copyStat(stat *Stat_t, statLE *Stat_LE_t) { + stat.Dev = uint64(statLE.Dev) + stat.Ino = uint64(statLE.Ino) + stat.Nlink = uint64(statLE.Nlink) + stat.Mode = uint32(statLE.Mode) + stat.Uid = uint32(statLE.Uid) + stat.Gid = uint32(statLE.Gid) + stat.Rdev = uint64(statLE.Rdev) + stat.Size = statLE.Size + stat.Atim.Sec = int64(statLE.Atim) + stat.Atim.Nsec = 0 //zos doesn't return nanoseconds + stat.Mtim.Sec = int64(statLE.Mtim) + stat.Mtim.Nsec = 0 //zos doesn't return nanoseconds + stat.Ctim.Sec = int64(statLE.Ctim) + stat.Ctim.Nsec = 0 //zos doesn't return nanoseconds + stat.Blksize = int64(statLE.Blksize) + stat.Blocks = statLE.Blocks +} + +func svcCall(fnptr unsafe.Pointer, argv *unsafe.Pointer, dsa *uint64) +func svcLoad(name *byte) unsafe.Pointer +func svcUnload(name *byte, fnptr unsafe.Pointer) int64 + +func (d *Dirent) NameString() string { + if d == nil { + return "" + } + return string(d.Name[:d.Namlen]) +} + +func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { + if sa.Port < 0 || sa.Port > 0xFFFF { + return nil, 0, EINVAL + } + sa.raw.Len = SizeofSockaddrInet4 + sa.raw.Family = AF_INET + p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) + p[0] = byte(sa.Port >> 8) + p[1] = byte(sa.Port) + for i := 0; i < len(sa.Addr); i++ { + sa.raw.Addr[i] = sa.Addr[i] + } + return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil +} + +func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) { + if sa.Port < 0 || sa.Port > 0xFFFF { + return nil, 0, EINVAL + } + sa.raw.Len = SizeofSockaddrInet6 + sa.raw.Family = AF_INET6 + p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) + p[0] = byte(sa.Port >> 8) + p[1] = byte(sa.Port) + sa.raw.Scope_id = sa.ZoneId + for i := 0; i < len(sa.Addr); i++ { + sa.raw.Addr[i] = sa.Addr[i] + } + return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil +} + +func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) { + name := sa.Name + n := len(name) + if n >= len(sa.raw.Path) || n == 0 { + return nil, 0, EINVAL + } + sa.raw.Len = byte(3 + n) // 2 for Family, Len; 1 for NUL + sa.raw.Family = AF_UNIX + for i := 0; i < n; i++ { + sa.raw.Path[i] = int8(name[i]) + } + return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil +} + +func anyToSockaddr(_ int, rsa *RawSockaddrAny) (Sockaddr, error) { + // TODO(neeilan): Implement use of first param (fd) + switch rsa.Addr.Family { + case AF_UNIX: + pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa)) + sa := new(SockaddrUnix) + // For z/OS, only replace NUL with @ when the + // length is not zero. + if pp.Len != 0 && pp.Path[0] == 0 { + // "Abstract" Unix domain socket. + // Rewrite leading NUL as @ for textual display. + // (This is the standard convention.) + // Not friendly to overwrite in place, + // but the callers below don't care. + pp.Path[0] = '@' + } + + // Assume path ends at NUL. + // + // For z/OS, the length of the name is a field + // in the structure. To be on the safe side, we + // will still scan the name for a NUL but only + // to the length provided in the structure. + // + // This is not technically the Linux semantics for + // abstract Unix domain sockets--they are supposed + // to be uninterpreted fixed-size binary blobs--but + // everyone uses this convention. + n := 0 + for n < int(pp.Len) && pp.Path[n] != 0 { + n++ + } + bytes := (*[len(pp.Path)]byte)(unsafe.Pointer(&pp.Path[0]))[0:n] + sa.Name = string(bytes) + return sa, nil + + case AF_INET: + pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa)) + sa := new(SockaddrInet4) + p := (*[2]byte)(unsafe.Pointer(&pp.Port)) + sa.Port = int(p[0])<<8 + int(p[1]) + for i := 0; i < len(sa.Addr); i++ { + sa.Addr[i] = pp.Addr[i] + } + return sa, nil + + case AF_INET6: + pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa)) + sa := new(SockaddrInet6) + p := (*[2]byte)(unsafe.Pointer(&pp.Port)) + sa.Port = int(p[0])<<8 + int(p[1]) + sa.ZoneId = pp.Scope_id + for i := 0; i < len(sa.Addr); i++ { + sa.Addr[i] = pp.Addr[i] + } + return sa, nil + } + return nil, EAFNOSUPPORT +} + +func Accept(fd int) (nfd int, sa Sockaddr, err error) { + var rsa RawSockaddrAny + var len _Socklen = SizeofSockaddrAny + nfd, err = accept(fd, &rsa, &len) + if err != nil { + return + } + // TODO(neeilan): Remove 0 in call + sa, err = anyToSockaddr(0, &rsa) + if err != nil { + Close(nfd) + nfd = 0 + } + return +} + +func (iov *Iovec) SetLen(length int) { + iov.Len = uint64(length) +} + +func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = int32(length) +} + +func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = int32(length) +} + +//sys fcntl(fd int, cmd int, arg int) (val int, err error) +//sys read(fd int, p []byte) (n int, err error) +//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ +//sys write(fd int, p []byte) (n int, err error) + +//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) = SYS___ACCEPT_A +//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = SYS___BIND_A +//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = SYS___CONNECT_A +//sysnb getgroups(n int, list *_Gid_t) (nn int, err error) +//sysnb setgroups(n int, list *_Gid_t) (err error) +//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) +//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) +//sysnb socket(domain int, typ int, proto int) (fd int, err error) +//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) +//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = SYS___GETPEERNAME_A +//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) = SYS___GETSOCKNAME_A +//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) = SYS___RECVFROM_A +//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) = SYS___SENDTO_A +//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) = SYS___RECVMSG_A +//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) = SYS___SENDMSG_A +//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) = SYS_MMAP +//sys munmap(addr uintptr, length uintptr) (err error) = SYS_MUNMAP +//sys ioctl(fd int, req uint, arg uintptr) (err error) = SYS_IOCTL + +//sys Access(path string, mode uint32) (err error) = SYS___ACCESS_A +//sys Chdir(path string) (err error) = SYS___CHDIR_A +//sys Chown(path string, uid int, gid int) (err error) = SYS___CHOWN_A +//sys Chmod(path string, mode uint32) (err error) = SYS___CHMOD_A +//sys Creat(path string, mode uint32) (fd int, err error) = SYS___CREAT_A +//sys Dup(oldfd int) (fd int, err error) +//sys Dup2(oldfd int, newfd int) (err error) +//sys Exit(code int) +//sys Fchdir(fd int) (err error) +//sys Fchmod(fd int, mode uint32) (err error) +//sys Fchown(fd int, uid int, gid int) (err error) +//sys FcntlInt(fd uintptr, cmd int, arg int) (retval int, err error) = SYS_FCNTL +//sys fstat(fd int, stat *Stat_LE_t) (err error) + +func Fstat(fd int, stat *Stat_t) (err error) { + var statLE Stat_LE_t + err = fstat(fd, &statLE) + copyStat(stat, &statLE) + return +} + +//sys Fstatvfs(fd int, stat *Statvfs_t) (err error) = SYS_FSTATVFS +//sys Fsync(fd int) (err error) +//sys Ftruncate(fd int, length int64) (err error) +//sys Getpagesize() (pgsize int) = SYS_GETPAGESIZE +//sys Mprotect(b []byte, prot int) (err error) = SYS_MPROTECT +//sys Msync(b []byte, flags int) (err error) = SYS_MSYNC +//sys Poll(fds []PollFd, timeout int) (n int, err error) = SYS_POLL +//sys Times(tms *Tms) (ticks uintptr, err error) = SYS_TIMES +//sys W_Getmntent(buff *byte, size int) (lastsys int, err error) = SYS_W_GETMNTENT + +//sys Mount(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) = SYS___MOUNT_A +//sys Unmount(filesystem string, mtm int) (err error) = SYS___UMOUNT_A +//sys Chroot(path string) (err error) = SYS___CHROOT_A +//sysnb Uname(buf *Utsname) (err error) = SYS___UNAME_A + +func Ptsname(fd int) (name string, err error) { + r0, _, e1 := syscall_syscall(SYS___PTSNAME_A, uintptr(fd), 0, 0) + name = u2s(unsafe.Pointer(r0)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func u2s(cstr unsafe.Pointer) string { + str := (*[1024]uint8)(cstr) + i := 0 + for str[i] != 0 { + i++ + } + return string(str[:i]) +} + +func Close(fd int) (err error) { + _, _, e1 := syscall_syscall(SYS_CLOSE, uintptr(fd), 0, 0) + for i := 0; e1 == EAGAIN && i < 10; i++ { + _, _, _ = syscall_syscall(SYS_USLEEP, uintptr(10), 0, 0) + _, _, e1 = syscall_syscall(SYS_CLOSE, uintptr(fd), 0, 0) + } + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var mapper = &mmapper{ + active: make(map[*byte][]byte), + mmap: mmap, + munmap: munmap, +} + +// Dummy function: there are no semantics for Madvise on z/OS +func Madvise(b []byte, advice int) (err error) { + return +} + +func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) { + return mapper.Mmap(fd, offset, length, prot, flags) +} + +func Munmap(b []byte) (err error) { + return mapper.Munmap(b) +} + +//sys Gethostname(buf []byte) (err error) = SYS___GETHOSTNAME_A +//sysnb Getegid() (egid int) +//sysnb Geteuid() (uid int) +//sysnb Getgid() (gid int) +//sysnb Getpid() (pid int) +//sysnb Getpgid(pid int) (pgid int, err error) = SYS_GETPGID + +func Getpgrp() (pid int) { + pid, _ = Getpgid(0) + return +} + +//sysnb Getppid() (pid int) +//sys Getpriority(which int, who int) (prio int, err error) +//sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = SYS_GETRLIMIT + +//sysnb getrusage(who int, rusage *rusage_zos) (err error) = SYS_GETRUSAGE + +func Getrusage(who int, rusage *Rusage) (err error) { + var ruz rusage_zos + err = getrusage(who, &ruz) + //Only the first two fields of Rusage are set + rusage.Utime.Sec = ruz.Utime.Sec + rusage.Utime.Usec = int64(ruz.Utime.Usec) + rusage.Stime.Sec = ruz.Stime.Sec + rusage.Stime.Usec = int64(ruz.Stime.Usec) + return +} + +//sysnb Getsid(pid int) (sid int, err error) = SYS_GETSID +//sysnb Getuid() (uid int) +//sysnb Kill(pid int, sig Signal) (err error) +//sys Lchown(path string, uid int, gid int) (err error) = SYS___LCHOWN_A +//sys Link(path string, link string) (err error) = SYS___LINK_A +//sys Listen(s int, n int) (err error) +//sys lstat(path string, stat *Stat_LE_t) (err error) = SYS___LSTAT_A + +func Lstat(path string, stat *Stat_t) (err error) { + var statLE Stat_LE_t + err = lstat(path, &statLE) + copyStat(stat, &statLE) + return +} + +//sys Mkdir(path string, mode uint32) (err error) = SYS___MKDIR_A +//sys Mkfifo(path string, mode uint32) (err error) = SYS___MKFIFO_A +//sys Mknod(path string, mode uint32, dev int) (err error) = SYS___MKNOD_A +//sys Pread(fd int, p []byte, offset int64) (n int, err error) +//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) +//sys Readlink(path string, buf []byte) (n int, err error) = SYS___READLINK_A +//sys Rename(from string, to string) (err error) = SYS___RENAME_A +//sys Rmdir(path string) (err error) = SYS___RMDIR_A +//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK +//sys Setpriority(which int, who int, prio int) (err error) +//sysnb Setpgid(pid int, pgid int) (err error) = SYS_SETPGID +//sysnb Setrlimit(resource int, lim *Rlimit) (err error) +//sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID +//sysnb Setreuid(ruid int, euid int) (err error) = SYS_SETREUID +//sysnb Setsid() (pid int, err error) = SYS_SETSID +//sys Setuid(uid int) (err error) = SYS_SETUID +//sys Setgid(uid int) (err error) = SYS_SETGID +//sys Shutdown(fd int, how int) (err error) +//sys stat(path string, statLE *Stat_LE_t) (err error) = SYS___STAT_A + +func Stat(path string, sta *Stat_t) (err error) { + var statLE Stat_LE_t + err = stat(path, &statLE) + copyStat(sta, &statLE) + return +} + +//sys Symlink(path string, link string) (err error) = SYS___SYMLINK_A +//sys Sync() = SYS_SYNC +//sys Truncate(path string, length int64) (err error) = SYS___TRUNCATE_A +//sys Tcgetattr(fildes int, termptr *Termios) (err error) = SYS_TCGETATTR +//sys Tcsetattr(fildes int, when int, termptr *Termios) (err error) = SYS_TCSETATTR +//sys Umask(mask int) (oldmask int) +//sys Unlink(path string) (err error) = SYS___UNLINK_A +//sys Utime(path string, utim *Utimbuf) (err error) = SYS___UTIME_A + +//sys open(path string, mode int, perm uint32) (fd int, err error) = SYS___OPEN_A + +func Open(path string, mode int, perm uint32) (fd int, err error) { + return open(path, mode, perm) +} + +func Mkfifoat(dirfd int, path string, mode uint32) (err error) { + wd, err := Getwd() + if err != nil { + return err + } + + if err := Fchdir(dirfd); err != nil { + return err + } + defer Chdir(wd) + + return Mkfifo(path, mode) +} + +//sys remove(path string) (err error) + +func Remove(path string) error { + return remove(path) +} + +const ImplementsGetwd = true + +func Getcwd(buf []byte) (n int, err error) { + var p unsafe.Pointer + if len(buf) > 0 { + p = unsafe.Pointer(&buf[0]) + } else { + p = unsafe.Pointer(&_zero) + } + _, _, e := syscall_syscall(SYS___GETCWD_A, uintptr(p), uintptr(len(buf)), 0) + n = clen(buf) + 1 + if e != 0 { + err = errnoErr(e) + } + return +} + +func Getwd() (wd string, err error) { + var buf [PathMax]byte + n, err := Getcwd(buf[0:]) + if err != nil { + return "", err + } + // Getcwd returns the number of bytes written to buf, including the NUL. + if n < 1 || n > len(buf) || buf[n-1] != 0 { + return "", EINVAL + } + return string(buf[0 : n-1]), nil +} + +func Getgroups() (gids []int, err error) { + n, err := getgroups(0, nil) + if err != nil { + return nil, err + } + if n == 0 { + return nil, nil + } + + // Sanity check group count. Max is 1<<16 on Linux. + if n < 0 || n > 1<<20 { + return nil, EINVAL + } + + a := make([]_Gid_t, n) + n, err = getgroups(n, &a[0]) + if err != nil { + return nil, err + } + gids = make([]int, n) + for i, v := range a[0:n] { + gids[i] = int(v) + } + return +} + +func Setgroups(gids []int) (err error) { + if len(gids) == 0 { + return setgroups(0, nil) + } + + a := make([]_Gid_t, len(gids)) + for i, v := range gids { + a[i] = _Gid_t(v) + } + return setgroups(len(a), &a[0]) +} + +func gettid() uint64 + +func Gettid() (tid int) { + return int(gettid()) +} + +type WaitStatus uint32 + +// Wait status is 7 bits at bottom, either 0 (exited), +// 0x7F (stopped), or a signal number that caused an exit. +// The 0x80 bit is whether there was a core dump. +// An extra number (exit code, signal causing a stop) +// is in the high bits. At least that's the idea. +// There are various irregularities. For example, the +// "continued" status is 0xFFFF, distinguishing itself +// from stopped via the core dump bit. + +const ( + mask = 0x7F + core = 0x80 + exited = 0x00 + stopped = 0x7F + shift = 8 +) + +func (w WaitStatus) Exited() bool { return w&mask == exited } + +func (w WaitStatus) Signaled() bool { return w&mask != stopped && w&mask != exited } + +func (w WaitStatus) Stopped() bool { return w&0xFF == stopped } + +func (w WaitStatus) Continued() bool { return w == 0xFFFF } + +func (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 } + +func (w WaitStatus) ExitStatus() int { + if !w.Exited() { + return -1 + } + return int(w>>shift) & 0xFF +} + +func (w WaitStatus) Signal() Signal { + if !w.Signaled() { + return -1 + } + return Signal(w & mask) +} + +func (w WaitStatus) StopSignal() Signal { + if !w.Stopped() { + return -1 + } + return Signal(w>>shift) & 0xFF +} + +func (w WaitStatus) TrapCause() int { return -1 } + +//sys waitpid(pid int, wstatus *_C_int, options int) (wpid int, err error) + +func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { + // TODO(mundaym): z/OS doesn't have wait4. I don't think getrusage does what we want. + // At the moment rusage will not be touched. + var status _C_int + wpid, err = waitpid(pid, &status, options) + if wstatus != nil { + *wstatus = WaitStatus(status) + } + return +} + +//sysnb gettimeofday(tv *timeval_zos) (err error) + +func Gettimeofday(tv *Timeval) (err error) { + var tvz timeval_zos + err = gettimeofday(&tvz) + tv.Sec = tvz.Sec + tv.Usec = int64(tvz.Usec) + return +} + +func Time(t *Time_t) (tt Time_t, err error) { + var tv Timeval + err = Gettimeofday(&tv) + if err != nil { + return 0, err + } + if t != nil { + *t = Time_t(tv.Sec) + } + return Time_t(tv.Sec), nil +} + +func setTimespec(sec, nsec int64) Timespec { + return Timespec{Sec: sec, Nsec: nsec} +} + +func setTimeval(sec, usec int64) Timeval { //fix + return Timeval{Sec: sec, Usec: usec} +} + +//sysnb pipe(p *[2]_C_int) (err error) + +func Pipe(p []int) (err error) { + if len(p) != 2 { + return EINVAL + } + var pp [2]_C_int + err = pipe(&pp) + p[0] = int(pp[0]) + p[1] = int(pp[1]) + return +} + +//sys utimes(path string, timeval *[2]Timeval) (err error) = SYS___UTIMES_A + +func Utimes(path string, tv []Timeval) (err error) { + if len(tv) != 2 { + return EINVAL + } + return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) +} + +func UtimesNano(path string, ts []Timespec) error { + if len(ts) != 2 { + return EINVAL + } + // Not as efficient as it could be because Timespec and + // Timeval have different types in the different OSes + tv := [2]Timeval{ + NsecToTimeval(TimespecToNsec(ts[0])), + NsecToTimeval(TimespecToNsec(ts[1])), + } + return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) +} + +func Getsockname(fd int) (sa Sockaddr, err error) { + var rsa RawSockaddrAny + var len _Socklen = SizeofSockaddrAny + if err = getsockname(fd, &rsa, &len); err != nil { + return + } + // TODO(neeilan) : Remove this 0 ( added to get sys/unix compiling on z/OS ) + return anyToSockaddr(0, &rsa) +} + +const ( + // identifier constants + nwmHeaderIdentifier = 0xd5e6d4c8 + nwmFilterIdentifier = 0xd5e6d4c6 + nwmTCPConnIdentifier = 0xd5e6d4c3 + nwmRecHeaderIdentifier = 0xd5e6d4d9 + nwmIPStatsIdentifier = 0xd5e6d4c9d7e2e340 + nwmIPGStatsIdentifier = 0xd5e6d4c9d7c7e2e3 + nwmTCPStatsIdentifier = 0xd5e6d4e3c3d7e2e3 + nwmUDPStatsIdentifier = 0xd5e6d4e4c4d7e2e3 + nwmICMPGStatsEntry = 0xd5e6d4c9c3d4d7c7 + nwmICMPTStatsEntry = 0xd5e6d4c9c3d4d7e3 + + // nwmHeader constants + nwmVersion1 = 1 + nwmVersion2 = 2 + nwmCurrentVer = 2 + + nwmTCPConnType = 1 + nwmGlobalStatsType = 14 + + // nwmFilter constants + nwmFilterLclAddrMask = 0x20000000 // Local address + nwmFilterSrcAddrMask = 0x20000000 // Source address + nwmFilterLclPortMask = 0x10000000 // Local port + nwmFilterSrcPortMask = 0x10000000 // Source port + + // nwmConnEntry constants + nwmTCPStateClosed = 1 + nwmTCPStateListen = 2 + nwmTCPStateSynSent = 3 + nwmTCPStateSynRcvd = 4 + nwmTCPStateEstab = 5 + nwmTCPStateFinWait1 = 6 + nwmTCPStateFinWait2 = 7 + nwmTCPStateClosWait = 8 + nwmTCPStateLastAck = 9 + nwmTCPStateClosing = 10 + nwmTCPStateTimeWait = 11 + nwmTCPStateDeletTCB = 12 + + // Existing constants on linux + BPF_TCP_CLOSE = 1 + BPF_TCP_LISTEN = 2 + BPF_TCP_SYN_SENT = 3 + BPF_TCP_SYN_RECV = 4 + BPF_TCP_ESTABLISHED = 5 + BPF_TCP_FIN_WAIT1 = 6 + BPF_TCP_FIN_WAIT2 = 7 + BPF_TCP_CLOSE_WAIT = 8 + BPF_TCP_LAST_ACK = 9 + BPF_TCP_CLOSING = 10 + BPF_TCP_TIME_WAIT = 11 + BPF_TCP_NEW_SYN_RECV = -1 + BPF_TCP_MAX_STATES = -2 +) + +type nwmTriplet struct { + offset uint32 + length uint32 + number uint32 +} + +type nwmQuadruplet struct { + offset uint32 + length uint32 + number uint32 + match uint32 +} + +type nwmHeader struct { + ident uint32 + length uint32 + version uint16 + nwmType uint16 + bytesNeeded uint32 + options uint32 + _ [16]byte + inputDesc nwmTriplet + outputDesc nwmQuadruplet +} + +type nwmFilter struct { + ident uint32 + flags uint32 + resourceName [8]byte + resourceId uint32 + listenerId uint32 + local [28]byte // union of sockaddr4 and sockaddr6 + remote [28]byte // union of sockaddr4 and sockaddr6 + _ uint16 + _ uint16 + asid uint16 + _ [2]byte + tnLuName [8]byte + tnMonGrp uint32 + tnAppl [8]byte + applData [40]byte + nInterface [16]byte + dVipa [16]byte + dVipaPfx uint16 + dVipaPort uint16 + dVipaFamily byte + _ [3]byte + destXCF [16]byte + destXCFPfx uint16 + destXCFFamily byte + _ [1]byte + targIP [16]byte + targIPPfx uint16 + targIPFamily byte + _ [1]byte + _ [20]byte +} + +type nwmRecHeader struct { + ident uint32 + length uint32 + number byte + _ [3]byte +} + +type nwmTCPStatsEntry struct { + ident uint64 + currEstab uint32 + activeOpened uint32 + passiveOpened uint32 + connClosed uint32 + estabResets uint32 + attemptFails uint32 + passiveDrops uint32 + timeWaitReused uint32 + inSegs uint64 + predictAck uint32 + predictData uint32 + inDupAck uint32 + inBadSum uint32 + inBadLen uint32 + inShort uint32 + inDiscOldTime uint32 + inAllBeforeWin uint32 + inSomeBeforeWin uint32 + inAllAfterWin uint32 + inSomeAfterWin uint32 + inOutOfOrder uint32 + inAfterClose uint32 + inWinProbes uint32 + inWinUpdates uint32 + outWinUpdates uint32 + outSegs uint64 + outDelayAcks uint32 + outRsts uint32 + retransSegs uint32 + retransTimeouts uint32 + retransDrops uint32 + pmtuRetrans uint32 + pmtuErrors uint32 + outWinProbes uint32 + probeDrops uint32 + keepAliveProbes uint32 + keepAliveDrops uint32 + finwait2Drops uint32 + acceptCount uint64 + inBulkQSegs uint64 + inDiscards uint64 + connFloods uint32 + connStalls uint32 + cfgEphemDef uint16 + ephemInUse uint16 + ephemHiWater uint16 + flags byte + _ [1]byte + ephemExhaust uint32 + smcRCurrEstabLnks uint32 + smcRLnkActTimeOut uint32 + smcRActLnkOpened uint32 + smcRPasLnkOpened uint32 + smcRLnksClosed uint32 + smcRCurrEstab uint32 + smcRActiveOpened uint32 + smcRPassiveOpened uint32 + smcRConnClosed uint32 + smcRInSegs uint64 + smcROutSegs uint64 + smcRInRsts uint32 + smcROutRsts uint32 + smcDCurrEstabLnks uint32 + smcDActLnkOpened uint32 + smcDPasLnkOpened uint32 + smcDLnksClosed uint32 + smcDCurrEstab uint32 + smcDActiveOpened uint32 + smcDPassiveOpened uint32 + smcDConnClosed uint32 + smcDInSegs uint64 + smcDOutSegs uint64 + smcDInRsts uint32 + smcDOutRsts uint32 +} + +type nwmConnEntry struct { + ident uint32 + local [28]byte // union of sockaddr4 and sockaddr6 + remote [28]byte // union of sockaddr4 and sockaddr6 + startTime [8]byte // uint64, changed to prevent padding from being inserted + lastActivity [8]byte // uint64 + bytesIn [8]byte // uint64 + bytesOut [8]byte // uint64 + inSegs [8]byte // uint64 + outSegs [8]byte // uint64 + state uint16 + activeOpen byte + flag01 byte + outBuffered uint32 + inBuffered uint32 + maxSndWnd uint32 + reXmtCount uint32 + congestionWnd uint32 + ssThresh uint32 + roundTripTime uint32 + roundTripVar uint32 + sendMSS uint32 + sndWnd uint32 + rcvBufSize uint32 + sndBufSize uint32 + outOfOrderCount uint32 + lcl0WindowCount uint32 + rmt0WindowCount uint32 + dupacks uint32 + flag02 byte + sockOpt6Cont byte + asid uint16 + resourceName [8]byte + resourceId uint32 + subtask uint32 + sockOpt byte + sockOpt6 byte + clusterConnFlag byte + proto byte + targetAppl [8]byte + luName [8]byte + clientUserId [8]byte + logMode [8]byte + timeStamp uint32 + timeStampAge uint32 + serverResourceId uint32 + intfName [16]byte + ttlsStatPol byte + ttlsStatConn byte + ttlsSSLProt uint16 + ttlsNegCiph [2]byte + ttlsSecType byte + ttlsFIPS140Mode byte + ttlsUserID [8]byte + applData [40]byte + inOldestTime [8]byte // uint64 + outOldestTime [8]byte // uint64 + tcpTrustedPartner byte + _ [3]byte + bulkDataIntfName [16]byte + ttlsNegCiph4 [4]byte + smcReason uint32 + lclSMCLinkId uint32 + rmtSMCLinkId uint32 + smcStatus byte + smcFlags byte + _ [2]byte + rcvWnd uint32 + lclSMCBufSz uint32 + rmtSMCBufSz uint32 + ttlsSessID [32]byte + ttlsSessIDLen int16 + _ [1]byte + smcDStatus byte + smcDReason uint32 +} + +var svcNameTable [][]byte = [][]byte{ + []byte("\xc5\xe9\xc2\xd5\xd4\xc9\xc6\xf4"), // svc_EZBNMIF4 +} + +const ( + svc_EZBNMIF4 = 0 +) + +func GetsockoptTCPInfo(fd, level, opt int) (*TCPInfo, error) { + jobname := []byte("\x5c\x40\x40\x40\x40\x40\x40\x40") // "*" + responseBuffer := [4096]byte{0} + var bufferAlet, reasonCode uint32 = 0, 0 + var bufferLen, returnValue, returnCode int32 = 4096, 0, 0 + + dsa := [18]uint64{0} + var argv [7]unsafe.Pointer + argv[0] = unsafe.Pointer(&jobname[0]) + argv[1] = unsafe.Pointer(&responseBuffer[0]) + argv[2] = unsafe.Pointer(&bufferAlet) + argv[3] = unsafe.Pointer(&bufferLen) + argv[4] = unsafe.Pointer(&returnValue) + argv[5] = unsafe.Pointer(&returnCode) + argv[6] = unsafe.Pointer(&reasonCode) + + request := (*struct { + header nwmHeader + filter nwmFilter + })(unsafe.Pointer(&responseBuffer[0])) + + EZBNMIF4 := svcLoad(&svcNameTable[svc_EZBNMIF4][0]) + if EZBNMIF4 == nil { + return nil, errnoErr(EINVAL) + } + + // GetGlobalStats EZBNMIF4 call + request.header.ident = nwmHeaderIdentifier + request.header.length = uint32(unsafe.Sizeof(request.header)) + request.header.version = nwmCurrentVer + request.header.nwmType = nwmGlobalStatsType + request.header.options = 0x80000000 + + svcCall(EZBNMIF4, &argv[0], &dsa[0]) + + // outputDesc field is filled by EZBNMIF4 on success + if returnCode != 0 || request.header.outputDesc.offset == 0 { + return nil, errnoErr(EINVAL) + } + + // Check that EZBNMIF4 returned a nwmRecHeader + recHeader := (*nwmRecHeader)(unsafe.Pointer(&responseBuffer[request.header.outputDesc.offset])) + if recHeader.ident != nwmRecHeaderIdentifier { + return nil, errnoErr(EINVAL) + } + + // Parse nwmTriplets to get offsets of returned entries + var sections []*uint64 + var sectionDesc *nwmTriplet = (*nwmTriplet)(unsafe.Pointer(&responseBuffer[0])) + for i := uint32(0); i < uint32(recHeader.number); i++ { + offset := request.header.outputDesc.offset + uint32(unsafe.Sizeof(*recHeader)) + i*uint32(unsafe.Sizeof(*sectionDesc)) + sectionDesc = (*nwmTriplet)(unsafe.Pointer(&responseBuffer[offset])) + for j := uint32(0); j < sectionDesc.number; j++ { + offset = request.header.outputDesc.offset + sectionDesc.offset + j*sectionDesc.length + sections = append(sections, (*uint64)(unsafe.Pointer(&responseBuffer[offset]))) + } + } + + // Find nwmTCPStatsEntry in returned entries + var tcpStats *nwmTCPStatsEntry = nil + for _, ptr := range sections { + switch *ptr { + case nwmTCPStatsIdentifier: + if tcpStats != nil { + return nil, errnoErr(EINVAL) + } + tcpStats = (*nwmTCPStatsEntry)(unsafe.Pointer(ptr)) + case nwmIPStatsIdentifier: + case nwmIPGStatsIdentifier: + case nwmUDPStatsIdentifier: + case nwmICMPGStatsEntry: + case nwmICMPTStatsEntry: + default: + return nil, errnoErr(EINVAL) + } + } + if tcpStats == nil { + return nil, errnoErr(EINVAL) + } + + // GetConnectionDetail EZBNMIF4 call + responseBuffer = [4096]byte{0} + dsa = [18]uint64{0} + bufferAlet, reasonCode = 0, 0 + bufferLen, returnValue, returnCode = 4096, 0, 0 + nameptr := (*uint32)(unsafe.Pointer(uintptr(0x21c))) // Get jobname of current process + nameptr = (*uint32)(unsafe.Pointer(uintptr(*nameptr + 12))) + argv[0] = unsafe.Pointer(uintptr(*nameptr)) + + request.header.ident = nwmHeaderIdentifier + request.header.length = uint32(unsafe.Sizeof(request.header)) + request.header.version = nwmCurrentVer + request.header.nwmType = nwmTCPConnType + request.header.options = 0x80000000 + + request.filter.ident = nwmFilterIdentifier + + var localSockaddr RawSockaddrAny + socklen := _Socklen(SizeofSockaddrAny) + err := getsockname(fd, &localSockaddr, &socklen) + if err != nil { + return nil, errnoErr(EINVAL) + } + if localSockaddr.Addr.Family == AF_INET { + localSockaddr := (*RawSockaddrInet4)(unsafe.Pointer(&localSockaddr.Addr)) + localSockFilter := (*RawSockaddrInet4)(unsafe.Pointer(&request.filter.local[0])) + localSockFilter.Family = AF_INET + var i int + for i = 0; i < 4; i++ { + if localSockaddr.Addr[i] != 0 { + break + } + } + if i != 4 { + request.filter.flags |= nwmFilterLclAddrMask + for i = 0; i < 4; i++ { + localSockFilter.Addr[i] = localSockaddr.Addr[i] + } + } + if localSockaddr.Port != 0 { + request.filter.flags |= nwmFilterLclPortMask + localSockFilter.Port = localSockaddr.Port + } + } else if localSockaddr.Addr.Family == AF_INET6 { + localSockaddr := (*RawSockaddrInet6)(unsafe.Pointer(&localSockaddr.Addr)) + localSockFilter := (*RawSockaddrInet6)(unsafe.Pointer(&request.filter.local[0])) + localSockFilter.Family = AF_INET6 + var i int + for i = 0; i < 16; i++ { + if localSockaddr.Addr[i] != 0 { + break + } + } + if i != 16 { + request.filter.flags |= nwmFilterLclAddrMask + for i = 0; i < 16; i++ { + localSockFilter.Addr[i] = localSockaddr.Addr[i] + } + } + if localSockaddr.Port != 0 { + request.filter.flags |= nwmFilterLclPortMask + localSockFilter.Port = localSockaddr.Port + } + } + + svcCall(EZBNMIF4, &argv[0], &dsa[0]) + + // outputDesc field is filled by EZBNMIF4 on success + if returnCode != 0 || request.header.outputDesc.offset == 0 { + return nil, errnoErr(EINVAL) + } + + // Check that EZBNMIF4 returned a nwmConnEntry + conn := (*nwmConnEntry)(unsafe.Pointer(&responseBuffer[request.header.outputDesc.offset])) + if conn.ident != nwmTCPConnIdentifier { + return nil, errnoErr(EINVAL) + } + + // Copy data from the returned data structures into tcpInfo + // Stats from nwmConnEntry are specific to that connection. + // Stats from nwmTCPStatsEntry are global (to the interface?) + // Fields may not be an exact match. Some fields have no equivalent. + var tcpinfo TCPInfo + tcpinfo.State = uint8(conn.state) + tcpinfo.Ca_state = 0 // dummy + tcpinfo.Retransmits = uint8(tcpStats.retransSegs) + tcpinfo.Probes = uint8(tcpStats.outWinProbes) + tcpinfo.Backoff = 0 // dummy + tcpinfo.Options = 0 // dummy + tcpinfo.Rto = tcpStats.retransTimeouts + tcpinfo.Ato = tcpStats.outDelayAcks + tcpinfo.Snd_mss = conn.sendMSS + tcpinfo.Rcv_mss = conn.sendMSS // dummy + tcpinfo.Unacked = 0 // dummy + tcpinfo.Sacked = 0 // dummy + tcpinfo.Lost = 0 // dummy + tcpinfo.Retrans = conn.reXmtCount + tcpinfo.Fackets = 0 // dummy + tcpinfo.Last_data_sent = uint32(*(*uint64)(unsafe.Pointer(&conn.lastActivity[0]))) + tcpinfo.Last_ack_sent = uint32(*(*uint64)(unsafe.Pointer(&conn.outOldestTime[0]))) + tcpinfo.Last_data_recv = uint32(*(*uint64)(unsafe.Pointer(&conn.inOldestTime[0]))) + tcpinfo.Last_ack_recv = uint32(*(*uint64)(unsafe.Pointer(&conn.inOldestTime[0]))) + tcpinfo.Pmtu = conn.sendMSS // dummy, NWMIfRouteMtu is a candidate + tcpinfo.Rcv_ssthresh = conn.ssThresh + tcpinfo.Rtt = conn.roundTripTime + tcpinfo.Rttvar = conn.roundTripVar + tcpinfo.Snd_ssthresh = conn.ssThresh // dummy + tcpinfo.Snd_cwnd = conn.congestionWnd + tcpinfo.Advmss = conn.sendMSS // dummy + tcpinfo.Reordering = 0 // dummy + tcpinfo.Rcv_rtt = conn.roundTripTime // dummy + tcpinfo.Rcv_space = conn.sendMSS // dummy + tcpinfo.Total_retrans = conn.reXmtCount + + svcUnload(&svcNameTable[svc_EZBNMIF4][0], EZBNMIF4) + + return &tcpinfo, nil +} + +// GetsockoptString returns the string value of the socket option opt for the +// socket associated with fd at the given socket level. +func GetsockoptString(fd, level, opt int) (string, error) { + buf := make([]byte, 256) + vallen := _Socklen(len(buf)) + err := getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen) + if err != nil { + return "", err + } + + return string(buf[:vallen-1]), nil +} + +func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) { + var msg Msghdr + var rsa RawSockaddrAny + msg.Name = (*byte)(unsafe.Pointer(&rsa)) + msg.Namelen = SizeofSockaddrAny + var iov Iovec + if len(p) > 0 { + iov.Base = (*byte)(unsafe.Pointer(&p[0])) + iov.SetLen(len(p)) + } + var dummy byte + if len(oob) > 0 { + // receive at least one normal byte + if len(p) == 0 { + iov.Base = &dummy + iov.SetLen(1) + } + msg.Control = (*byte)(unsafe.Pointer(&oob[0])) + msg.SetControllen(len(oob)) + } + msg.Iov = &iov + msg.Iovlen = 1 + if n, err = recvmsg(fd, &msg, flags); err != nil { + return + } + oobn = int(msg.Controllen) + recvflags = int(msg.Flags) + // source address is only specified if the socket is unconnected + if rsa.Addr.Family != AF_UNSPEC { + // TODO(neeilan): Remove 0 arg added to get this compiling on z/OS + from, err = anyToSockaddr(0, &rsa) + } + return +} + +func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) { + _, err = SendmsgN(fd, p, oob, to, flags) + return +} + +func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) { + var ptr unsafe.Pointer + var salen _Socklen + if to != nil { + var err error + ptr, salen, err = to.sockaddr() + if err != nil { + return 0, err + } + } + var msg Msghdr + msg.Name = (*byte)(unsafe.Pointer(ptr)) + msg.Namelen = int32(salen) + var iov Iovec + if len(p) > 0 { + iov.Base = (*byte)(unsafe.Pointer(&p[0])) + iov.SetLen(len(p)) + } + var dummy byte + if len(oob) > 0 { + // send at least one normal byte + if len(p) == 0 { + iov.Base = &dummy + iov.SetLen(1) + } + msg.Control = (*byte)(unsafe.Pointer(&oob[0])) + msg.SetControllen(len(oob)) + } + msg.Iov = &iov + msg.Iovlen = 1 + if n, err = sendmsg(fd, &msg, flags); err != nil { + return 0, err + } + if len(oob) > 0 && len(p) == 0 { + n = 0 + } + return n, nil +} + +func Opendir(name string) (uintptr, error) { + p, err := BytePtrFromString(name) + if err != nil { + return 0, err + } + dir, _, e := syscall_syscall(SYS___OPENDIR_A, uintptr(unsafe.Pointer(p)), 0, 0) + runtime.KeepAlive(unsafe.Pointer(p)) + if e != 0 { + err = errnoErr(e) + } + return dir, err +} + +// clearsyscall.Errno resets the errno value to 0. +func clearErrno() + +func Readdir(dir uintptr) (*Dirent, error) { + var ent Dirent + var res uintptr + // __readdir_r_a returns errno at the end of the directory stream, rather than 0. + // Therefore to avoid false positives we clear errno before calling it. + + // TODO(neeilan): Commented this out to get sys/unix compiling on z/OS. Uncomment and fix. Error: "undefined: clearsyscall" + //clearsyscall.Errno() // TODO(mundaym): check pre-emption rules. + + e, _, _ := syscall_syscall(SYS___READDIR_R_A, dir, uintptr(unsafe.Pointer(&ent)), uintptr(unsafe.Pointer(&res))) + var err error + if e != 0 { + err = errnoErr(Errno(e)) + } + if res == 0 { + return nil, err + } + return &ent, err +} + +func Closedir(dir uintptr) error { + _, _, e := syscall_syscall(SYS_CLOSEDIR, dir, 0, 0) + if e != 0 { + return errnoErr(e) + } + return nil +} + +func Seekdir(dir uintptr, pos int) { + _, _, _ = syscall_syscall(SYS_SEEKDIR, dir, uintptr(pos), 0) +} + +func Telldir(dir uintptr) (int, error) { + p, _, e := syscall_syscall(SYS_TELLDIR, dir, 0, 0) + pos := int(p) + if pos == -1 { + return pos, errnoErr(e) + } + return pos, nil +} + +// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. +func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { + // struct flock is packed on z/OS. We can't emulate that in Go so + // instead we pack it here. + var flock [24]byte + *(*int16)(unsafe.Pointer(&flock[0])) = lk.Type + *(*int16)(unsafe.Pointer(&flock[2])) = lk.Whence + *(*int64)(unsafe.Pointer(&flock[4])) = lk.Start + *(*int64)(unsafe.Pointer(&flock[12])) = lk.Len + *(*int32)(unsafe.Pointer(&flock[20])) = lk.Pid + _, _, errno := syscall_syscall(SYS_FCNTL, fd, uintptr(cmd), uintptr(unsafe.Pointer(&flock))) + lk.Type = *(*int16)(unsafe.Pointer(&flock[0])) + lk.Whence = *(*int16)(unsafe.Pointer(&flock[2])) + lk.Start = *(*int64)(unsafe.Pointer(&flock[4])) + lk.Len = *(*int64)(unsafe.Pointer(&flock[12])) + lk.Pid = *(*int32)(unsafe.Pointer(&flock[20])) + if errno == 0 { + return nil + } + return errno +} + +func Flock(fd int, how int) error { + + var flock_type int16 + var fcntl_cmd int + + switch how { + case LOCK_SH | LOCK_NB: + flock_type = F_RDLCK + fcntl_cmd = F_SETLK + case LOCK_EX | LOCK_NB: + flock_type = F_WRLCK + fcntl_cmd = F_SETLK + case LOCK_EX: + flock_type = F_WRLCK + fcntl_cmd = F_SETLKW + case LOCK_UN: + flock_type = F_UNLCK + fcntl_cmd = F_SETLKW + default: + } + + flock := Flock_t{ + Type: int16(flock_type), + Whence: int16(0), + Start: int64(0), + Len: int64(0), + Pid: int32(Getppid()), + } + + err := FcntlFlock(uintptr(fd), fcntl_cmd, &flock) + return err +} + +func Mlock(b []byte) (err error) { + _, _, e1 := syscall_syscall(SYS___MLOCKALL, _BPX_NONSWAP, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func Mlock2(b []byte, flags int) (err error) { + _, _, e1 := syscall_syscall(SYS___MLOCKALL, _BPX_NONSWAP, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func Mlockall(flags int) (err error) { + _, _, e1 := syscall_syscall(SYS___MLOCKALL, _BPX_NONSWAP, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func Munlock(b []byte) (err error) { + _, _, e1 := syscall_syscall(SYS___MLOCKALL, _BPX_SWAP, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func Munlockall() (err error) { + _, _, e1 := syscall_syscall(SYS___MLOCKALL, _BPX_SWAP, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func ClockGettime(clockid int32, ts *Timespec) error { + + var ticks_per_sec uint32 = 100 //TODO(kenan): value is currently hardcoded; need sysconf() call otherwise + var nsec_per_sec int64 = 1000000000 + + if ts == nil { + return EFAULT + } + if clockid == CLOCK_REALTIME || clockid == CLOCK_MONOTONIC { + var nanotime int64 = runtime.Nanotime1() + ts.Sec = nanotime / nsec_per_sec + ts.Nsec = nanotime % nsec_per_sec + } else if clockid == CLOCK_PROCESS_CPUTIME_ID || clockid == CLOCK_THREAD_CPUTIME_ID { + var tm Tms + _, err := Times(&tm) + if err != nil { + return EFAULT + } + ts.Sec = int64(tm.Utime / ticks_per_sec) + ts.Nsec = int64(tm.Utime) * nsec_per_sec / int64(ticks_per_sec) + } else { + return EINVAL + } + return nil +} + +func Statfs(path string, stat *Statfs_t) (err error) { + fd, err := open(path, O_RDONLY, 0) + defer Close(fd) + if err != nil { + return err + } + return Fstatfs(fd, stat) +} + +var ( + Stdin = 0 + Stdout = 1 + Stderr = 2 +) + +// Do the interface allocations only once for common +// Errno values. +var ( + errEAGAIN error = syscall.EAGAIN + errEINVAL error = syscall.EINVAL + errENOENT error = syscall.ENOENT +) + +var ( + signalNameMapOnce sync.Once + signalNameMap map[string]syscall.Signal +) + +// errnoErr returns common boxed Errno values, to prevent +// allocations at runtime. +func errnoErr(e Errno) error { + switch e { + case 0: + return nil + case EAGAIN: + return errEAGAIN + case EINVAL: + return errEINVAL + case ENOENT: + return errENOENT + } + return e +} + +// ErrnoName returns the error name for error number e. +func ErrnoName(e Errno) string { + i := sort.Search(len(errorList), func(i int) bool { + return errorList[i].num >= e + }) + if i < len(errorList) && errorList[i].num == e { + return errorList[i].name + } + return "" +} + +// SignalName returns the signal name for signal number s. +func SignalName(s syscall.Signal) string { + i := sort.Search(len(signalList), func(i int) bool { + return signalList[i].num >= s + }) + if i < len(signalList) && signalList[i].num == s { + return signalList[i].name + } + return "" +} + +// SignalNum returns the syscall.Signal for signal named s, +// or 0 if a signal with such name is not found. +// The signal name should start with "SIG". +func SignalNum(s string) syscall.Signal { + signalNameMapOnce.Do(func() { + signalNameMap = make(map[string]syscall.Signal, len(signalList)) + for _, signal := range signalList { + signalNameMap[signal.name] = signal.num + } + }) + return signalNameMap[s] +} + +// clen returns the index of the first NULL byte in n or len(n) if n contains no NULL byte. +func clen(n []byte) int { + i := bytes.IndexByte(n, 0) + if i == -1 { + i = len(n) + } + return i +} + +// Mmap manager, for use by operating system-specific implementations. + +type mmapper struct { + sync.Mutex + active map[*byte][]byte // active mappings; key is last byte in mapping + mmap func(addr, length uintptr, prot, flags, fd int, offset int64) (uintptr, error) + munmap func(addr uintptr, length uintptr) error +} + +func (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) { + if length <= 0 { + return nil, EINVAL + } + + // Map the requested memory. + addr, errno := m.mmap(0, uintptr(length), prot, flags, fd, offset) + if errno != nil { + return nil, errno + } + + // Slice memory layout + var sl = struct { + addr uintptr + len int + cap int + }{addr, length, length} + + // Use unsafe to turn sl into a []byte. + b := *(*[]byte)(unsafe.Pointer(&sl)) + + // Register mapping in m and return it. + p := &b[cap(b)-1] + m.Lock() + defer m.Unlock() + m.active[p] = b + return b, nil +} + +func (m *mmapper) Munmap(data []byte) (err error) { + if len(data) == 0 || len(data) != cap(data) { + return EINVAL + } + + // Find the base of the mapping. + p := &data[cap(data)-1] + m.Lock() + defer m.Unlock() + b := m.active[p] + if b == nil || &b[0] != &data[0] { + return EINVAL + } + + // Unmap the memory and update m. + if errno := m.munmap(uintptr(unsafe.Pointer(&b[0])), uintptr(len(b))); errno != nil { + return errno + } + delete(m.active, p) + return nil +} + +func Read(fd int, p []byte) (n int, err error) { + n, err = read(fd, p) + if raceenabled { + if n > 0 { + raceWriteRange(unsafe.Pointer(&p[0]), n) + } + if err == nil { + raceAcquire(unsafe.Pointer(&ioSync)) + } + } + return +} + +func Write(fd int, p []byte) (n int, err error) { + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + n, err = write(fd, p) + if raceenabled && n > 0 { + raceReadRange(unsafe.Pointer(&p[0]), n) + } + return +} + +// For testing: clients can set this flag to force +// creation of IPv6 sockets to return EAFNOSUPPORT. +var SocketDisableIPv6 bool + +// Sockaddr represents a socket address. +type Sockaddr interface { + sockaddr() (ptr unsafe.Pointer, len _Socklen, err error) // lowercase; only we can define Sockaddrs +} + +// SockaddrInet4 implements the Sockaddr interface for AF_INET type sockets. +type SockaddrInet4 struct { + Port int + Addr [4]byte + raw RawSockaddrInet4 +} + +// SockaddrInet6 implements the Sockaddr interface for AF_INET6 type sockets. +type SockaddrInet6 struct { + Port int + ZoneId uint32 + Addr [16]byte + raw RawSockaddrInet6 +} + +// SockaddrUnix implements the Sockaddr interface for AF_UNIX type sockets. +type SockaddrUnix struct { + Name string + raw RawSockaddrUnix +} + +func Bind(fd int, sa Sockaddr) (err error) { + ptr, n, err := sa.sockaddr() + if err != nil { + return err + } + return bind(fd, ptr, n) +} + +func Connect(fd int, sa Sockaddr) (err error) { + ptr, n, err := sa.sockaddr() + if err != nil { + return err + } + return connect(fd, ptr, n) +} + +func Getpeername(fd int) (sa Sockaddr, err error) { + var rsa RawSockaddrAny + var len _Socklen = SizeofSockaddrAny + if err = getpeername(fd, &rsa, &len); err != nil { + return + } + return anyToSockaddr(fd, &rsa) +} + +func GetsockoptByte(fd, level, opt int) (value byte, err error) { + var n byte + vallen := _Socklen(1) + err = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen) + return n, err +} + +func GetsockoptInt(fd, level, opt int) (value int, err error) { + var n int32 + vallen := _Socklen(4) + err = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen) + return int(n), err +} + +func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) { + vallen := _Socklen(4) + err = getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen) + return value, err +} + +func GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error) { + var value IPMreq + vallen := _Socklen(SizeofIPMreq) + err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) + return &value, err +} + +func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error) { + var value IPv6Mreq + vallen := _Socklen(SizeofIPv6Mreq) + err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) + return &value, err +} + +func GetsockoptIPv6MTUInfo(fd, level, opt int) (*IPv6MTUInfo, error) { + var value IPv6MTUInfo + vallen := _Socklen(SizeofIPv6MTUInfo) + err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) + return &value, err +} + +func GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error) { + var value ICMPv6Filter + vallen := _Socklen(SizeofICMPv6Filter) + err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) + return &value, err +} + +func GetsockoptLinger(fd, level, opt int) (*Linger, error) { + var linger Linger + vallen := _Socklen(SizeofLinger) + err := getsockopt(fd, level, opt, unsafe.Pointer(&linger), &vallen) + return &linger, err +} + +func GetsockoptTimeval(fd, level, opt int) (*Timeval, error) { + var tv Timeval + vallen := _Socklen(unsafe.Sizeof(tv)) + err := getsockopt(fd, level, opt, unsafe.Pointer(&tv), &vallen) + return &tv, err +} + +func GetsockoptUint64(fd, level, opt int) (value uint64, err error) { + var n uint64 + vallen := _Socklen(8) + err = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen) + return n, err +} + +func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) { + var rsa RawSockaddrAny + var len _Socklen = SizeofSockaddrAny + if n, err = recvfrom(fd, p, flags, &rsa, &len); err != nil { + return + } + if rsa.Addr.Family != AF_UNSPEC { + from, err = anyToSockaddr(fd, &rsa) + } + return +} + +func Sendto(fd int, p []byte, flags int, to Sockaddr) (err error) { + ptr, n, err := to.sockaddr() + if err != nil { + return err + } + return sendto(fd, p, flags, ptr, n) +} + +func SetsockoptByte(fd, level, opt int, value byte) (err error) { + return setsockopt(fd, level, opt, unsafe.Pointer(&value), 1) +} + +func SetsockoptInt(fd, level, opt int, value int) (err error) { + var n = int32(value) + return setsockopt(fd, level, opt, unsafe.Pointer(&n), 4) +} + +func SetsockoptInet4Addr(fd, level, opt int, value [4]byte) (err error) { + return setsockopt(fd, level, opt, unsafe.Pointer(&value[0]), 4) +} + +func SetsockoptIPMreq(fd, level, opt int, mreq *IPMreq) (err error) { + return setsockopt(fd, level, opt, unsafe.Pointer(mreq), SizeofIPMreq) +} + +func SetsockoptIPv6Mreq(fd, level, opt int, mreq *IPv6Mreq) (err error) { + return setsockopt(fd, level, opt, unsafe.Pointer(mreq), SizeofIPv6Mreq) +} + +func SetsockoptICMPv6Filter(fd, level, opt int, filter *ICMPv6Filter) error { + return setsockopt(fd, level, opt, unsafe.Pointer(filter), SizeofICMPv6Filter) +} + +func SetsockoptLinger(fd, level, opt int, l *Linger) (err error) { + return setsockopt(fd, level, opt, unsafe.Pointer(l), SizeofLinger) +} + +func SetsockoptString(fd, level, opt int, s string) (err error) { + var p unsafe.Pointer + if len(s) > 0 { + p = unsafe.Pointer(&[]byte(s)[0]) + } + return setsockopt(fd, level, opt, p, uintptr(len(s))) +} + +func SetsockoptTimeval(fd, level, opt int, tv *Timeval) (err error) { + return setsockopt(fd, level, opt, unsafe.Pointer(tv), unsafe.Sizeof(*tv)) +} + +func SetsockoptUint64(fd, level, opt int, value uint64) (err error) { + return setsockopt(fd, level, opt, unsafe.Pointer(&value), 8) +} + +func Socket(domain, typ, proto int) (fd int, err error) { + if domain == AF_INET6 && SocketDisableIPv6 { + return -1, EAFNOSUPPORT + } + fd, err = socket(domain, typ, proto) + return +} + +func Socketpair(domain, typ, proto int) (fd [2]int, err error) { + var fdx [2]int32 + err = socketpair(domain, typ, proto, &fdx) + if err == nil { + fd[0] = int(fdx[0]) + fd[1] = int(fdx[1]) + } + return +} + +var ioSync int64 + +func CloseOnExec(fd int) { fcntl(fd, F_SETFD, FD_CLOEXEC) } + +func SetNonblock(fd int, nonblocking bool) (err error) { + flag, err := fcntl(fd, F_GETFL, 0) + if err != nil { + return err + } + if nonblocking { + flag |= O_NONBLOCK + } else { + flag &= ^O_NONBLOCK + } + _, err = fcntl(fd, F_SETFL, flag) + return err +} + +// Exec calls execve(2), which replaces the calling executable in the process +// tree. argv0 should be the full path to an executable ("/bin/ls") and the +// executable name should also be the first argument in argv (["ls", "-l"]). +// envv are the environment variables that should be passed to the new +// process (["USER=go", "PWD=/tmp"]). +func Exec(argv0 string, argv []string, envv []string) error { + return syscall.Exec(argv0, argv, envv) +} diff --git a/vendor/golang.org/x/sys/unix/timestruct.go b/vendor/golang.org/x/sys/unix/timestruct.go index 103604299e..3d89304055 100644 --- a/vendor/golang.org/x/sys/unix/timestruct.go +++ b/vendor/golang.org/x/sys/unix/timestruct.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris +//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos package unix diff --git a/vendor/golang.org/x/sys/unix/xattr_bsd.go b/vendor/golang.org/x/sys/unix/xattr_bsd.go index 30c1d71f4e..25df1e3780 100644 --- a/vendor/golang.org/x/sys/unix/xattr_bsd.go +++ b/vendor/golang.org/x/sys/unix/xattr_bsd.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build freebsd || netbsd // +build freebsd netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go index 104994bc6a..ca9799b79e 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go +++ b/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go @@ -1,6 +1,7 @@ // mkerrors.sh -maix32 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build ppc && aix // +build ppc,aix // Created by cgo -godefs - DO NOT EDIT diff --git a/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go index 4fc8d30649..200c8c26fe 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go @@ -1,6 +1,7 @@ // mkerrors.sh -maix64 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build ppc64 && aix // +build ppc64,aix // Code generated by cmd/cgo -godefs; DO NOT EDIT. diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_386.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_386.go index ec376f51bc..7ee196f7fc 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_darwin_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_386.go @@ -1,6 +1,7 @@ // mkerrors.sh -m32 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build 386 && darwin // +build 386,darwin // Code generated by cmd/cgo -godefs; DO NOT EDIT. diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go index fea5dfaadb..991996b609 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go @@ -1,6 +1,7 @@ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && darwin // +build amd64,darwin // Code generated by cmd/cgo -godefs; DO NOT EDIT. @@ -32,7 +33,7 @@ const ( AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 - AF_MAX = 0x28 + AF_MAX = 0x29 AF_NATM = 0x1f AF_NDRV = 0x1b AF_NETBIOS = 0x21 @@ -49,6 +50,7 @@ const ( AF_UNIX = 0x1 AF_UNSPEC = 0x0 AF_UTUN = 0x26 + AF_VSOCK = 0x28 ALTWERASE = 0x200 ATTR_BIT_MAP_COUNT = 0x5 ATTR_CMN_ACCESSMASK = 0x20000 @@ -83,7 +85,7 @@ const ( ATTR_CMN_PAROBJID = 0x80 ATTR_CMN_RETURNED_ATTRS = 0x80000000 ATTR_CMN_SCRIPT = 0x100 - ATTR_CMN_SETMASK = 0x41c7ff00 + ATTR_CMN_SETMASK = 0x51c7ff00 ATTR_CMN_USERACCESS = 0x200000 ATTR_CMN_UUID = 0x800000 ATTR_CMN_VALIDMASK = 0xffffffff @@ -357,7 +359,7 @@ const ( DLT_LINUX_SLL = 0x71 DLT_LOOP = 0x6c DLT_LTALK = 0x72 - DLT_MATCHING_MAX = 0xf5 + DLT_MATCHING_MAX = 0x10a DLT_MATCHING_MIN = 0x68 DLT_MFR = 0xb6 DLT_MOST = 0xd3 @@ -398,6 +400,7 @@ const ( DLT_SYMANTEC_FIREWALL = 0x63 DLT_TZSP = 0x80 DLT_USB = 0xba + DLT_USB_DARWIN = 0x10a DLT_USB_LINUX = 0xbd DLT_USB_LINUX_MMAPPED = 0xdc DLT_USER0 = 0x93 @@ -442,8 +445,8 @@ const ( EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 - EVFILT_SYSCOUNT = 0xf - EVFILT_THREADMARKER = 0xf + EVFILT_SYSCOUNT = 0x11 + EVFILT_THREADMARKER = 0x11 EVFILT_TIMER = -0x7 EVFILT_USER = -0xa EVFILT_VM = -0xc @@ -481,9 +484,12 @@ const ( FSOPT_NOINMEMUPDATE = 0x2 FSOPT_PACK_INVAL_ATTRS = 0x8 FSOPT_REPORT_FULLSIZE = 0x4 + FSOPT_RETURN_REALDEV = 0x200 F_ADDFILESIGS = 0x3d F_ADDFILESIGS_FOR_DYLD_SIM = 0x53 + F_ADDFILESIGS_INFO = 0x67 F_ADDFILESIGS_RETURN = 0x61 + F_ADDFILESUPPL = 0x68 F_ADDSIGS = 0x3b F_ALLOCATEALL = 0x4 F_ALLOCATECONTIG = 0x2 @@ -505,8 +511,10 @@ const ( F_GETOWN = 0x5 F_GETPATH = 0x32 F_GETPATH_MTMINFO = 0x47 + F_GETPATH_NOFIRMLINK = 0x66 F_GETPROTECTIONCLASS = 0x3f F_GETPROTECTIONLEVEL = 0x4d + F_GETSIGSINFO = 0x69 F_GLOBAL_NOCACHE = 0x37 F_LOG2PHYS = 0x31 F_LOG2PHYS_EXT = 0x41 @@ -531,6 +539,7 @@ const ( F_SETPROTECTIONCLASS = 0x40 F_SETSIZE = 0x2b F_SINGLE_WRITER = 0x4c + F_SPECULATIVE_READ = 0x65 F_THAW_FS = 0x36 F_TRANSCODEKEY = 0x4b F_TRIM_ACTIVE_FILE = 0x64 @@ -562,6 +571,7 @@ const ( IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 + IFT_6LOWPAN = 0x40 IFT_AAL5 = 0x31 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 @@ -766,16 +776,28 @@ const ( IPV6_2292PKTINFO = 0x13 IPV6_2292PKTOPTIONS = 0x19 IPV6_2292RTHDR = 0x18 + IPV6_3542DSTOPTS = 0x32 + IPV6_3542HOPLIMIT = 0x2f + IPV6_3542HOPOPTS = 0x31 + IPV6_3542NEXTHOP = 0x30 + IPV6_3542PKTINFO = 0x2e + IPV6_3542RTHDR = 0x33 + IPV6_ADDR_MC_FLAGS_PREFIX = 0x20 + IPV6_ADDR_MC_FLAGS_TRANSIENT = 0x10 + IPV6_ADDR_MC_FLAGS_UNICAST_BASED = 0x30 + IPV6_AUTOFLOWLABEL = 0x3b IPV6_BINDV6ONLY = 0x1b IPV6_BOUND_IF = 0x7d IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 + IPV6_DONTFRAG = 0x3e + IPV6_DSTOPTS = 0x32 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 - IPV6_FLOW_ECN_MASK = 0x300 + IPV6_FLOW_ECN_MASK = 0x3000 IPV6_FRAGTTL = 0x3c IPV6_FW_ADD = 0x1e IPV6_FW_DEL = 0x1f @@ -783,6 +805,8 @@ const ( IPV6_FW_GET = 0x22 IPV6_FW_ZERO = 0x21 IPV6_HLIMDEC = 0x1 + IPV6_HOPLIMIT = 0x2f + IPV6_HOPOPTS = 0x31 IPV6_IPSEC_POLICY = 0x1c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd @@ -794,20 +818,34 @@ const ( IPV6_MAX_SOCK_SRC_FILTER = 0x80 IPV6_MIN_MEMBERSHIPS = 0x1f IPV6_MMTU = 0x500 + IPV6_MSFILTER = 0x4a IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb + IPV6_NEXTHOP = 0x30 + IPV6_PATHMTU = 0x2c + IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 + IPV6_PREFER_TEMPADDR = 0x3f + IPV6_RECVDSTOPTS = 0x28 + IPV6_RECVHOPLIMIT = 0x25 + IPV6_RECVHOPOPTS = 0x27 + IPV6_RECVPATHMTU = 0x2b + IPV6_RECVPKTINFO = 0x3d + IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x23 + IPV6_RTHDR = 0x33 + IPV6_RTHDRDSTOPTS = 0x39 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x24 IPV6_UNICAST_HOPS = 0x4 + IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 @@ -818,6 +856,7 @@ const ( IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 + IP_DONTFRAG = 0x1c IP_DROP_MEMBERSHIP = 0xd IP_DROP_SOURCE_MEMBERSHIP = 0x47 IP_DUMMYNET_CONFIGURE = 0x3c @@ -889,6 +928,12 @@ const ( KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 + LOCAL_PEERCRED = 0x1 + LOCAL_PEEREPID = 0x3 + LOCAL_PEEREUUID = 0x5 + LOCAL_PEERPID = 0x2 + LOCAL_PEERTOKEN = 0x6 + LOCAL_PEERUUID = 0x4 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 @@ -904,6 +949,7 @@ const ( MADV_SEQUENTIAL = 0x2 MADV_WILLNEED = 0x3 MADV_ZERO_WIRED_PAGES = 0x6 + MAP_32BIT = 0x8000 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_COPY = 0x2 @@ -920,6 +966,17 @@ const ( MAP_RESILIENT_CODESIGN = 0x2000 MAP_RESILIENT_MEDIA = 0x4000 MAP_SHARED = 0x1 + MAP_TRANSLATED_ALLOW_EXECUTE = 0x20000 + MAP_UNIX03 = 0x40000 + MCAST_BLOCK_SOURCE = 0x54 + MCAST_EXCLUDE = 0x2 + MCAST_INCLUDE = 0x1 + MCAST_JOIN_GROUP = 0x50 + MCAST_JOIN_SOURCE_GROUP = 0x52 + MCAST_LEAVE_GROUP = 0x51 + MCAST_LEAVE_SOURCE_GROUP = 0x53 + MCAST_UNBLOCK_SOURCE = 0x55 + MCAST_UNDEFINED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ASYNC = 0x40 @@ -931,6 +988,7 @@ const ( MNT_DOVOLFS = 0x8000 MNT_DWAIT = 0x4 MNT_EXPORTED = 0x100 + MNT_EXT_ROOT_DATA_VOL = 0x1 MNT_FORCE = 0x80000 MNT_IGNORE_OWNERSHIP = 0x200000 MNT_JOURNALED = 0x800000 @@ -947,12 +1005,15 @@ const ( MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 + MNT_REMOVABLE = 0x200 MNT_ROOTFS = 0x4000 + MNT_SNAPSHOT = 0x40000000 + MNT_STRICTATIME = 0x80000000 MNT_SYNCHRONOUS = 0x2 MNT_UNION = 0x20 MNT_UNKNOWNPERMISSIONS = 0x200000 MNT_UPDATE = 0x10000 - MNT_VISFLAGMASK = 0x17f0f5ff + MNT_VISFLAGMASK = 0xd7f0f7ff MNT_WAIT = 0x1 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 @@ -963,6 +1024,7 @@ const ( MSG_HAVEMORE = 0x2000 MSG_HOLD = 0x800 MSG_NEEDSA = 0x10000 + MSG_NOSIGNAL = 0x80000 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_RCVMORE = 0x4000 @@ -979,9 +1041,10 @@ const ( NET_RT_DUMP = 0x1 NET_RT_DUMP2 = 0x7 NET_RT_FLAGS = 0x2 + NET_RT_FLAGS_PRIV = 0xa NET_RT_IFLIST = 0x3 NET_RT_IFLIST2 = 0x6 - NET_RT_MAXID = 0xa + NET_RT_MAXID = 0xb NET_RT_STAT = 0x4 NET_RT_TRASH = 0x5 NFDBITS = 0x20 @@ -1019,6 +1082,7 @@ const ( NOTE_LEEWAY = 0x10 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 + NOTE_MACHTIME = 0x100 NOTE_MACH_CONTINUOUS_TIME = 0x80 NOTE_NONE = 0x80 NOTE_NSECONDS = 0x4 @@ -1065,6 +1129,7 @@ const ( O_NDELAY = 0x4 O_NOCTTY = 0x20000 O_NOFOLLOW = 0x100 + O_NOFOLLOW_ANY = 0x20000000 O_NONBLOCK = 0x4 O_POPUP = 0x80000000 O_RDONLY = 0x0 @@ -1136,6 +1201,7 @@ const ( RTF_BROADCAST = 0x400000 RTF_CLONING = 0x100 RTF_CONDEMNED = 0x2000000 + RTF_DEAD = 0x20000000 RTF_DELCLONE = 0x80 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 @@ -1143,6 +1209,7 @@ const ( RTF_HOST = 0x4 RTF_IFREF = 0x4000000 RTF_IFSCOPE = 0x1000000 + RTF_LLDATA = 0x400 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 @@ -1210,6 +1277,7 @@ const ( SIOCGDRVSPEC = 0xc028697b SIOCGETVLAN = 0xc020697f SIOCGHIWAT = 0x40047301 + SIOCGIF6LOWPAN = 0xc02069c5 SIOCGIFADDR = 0xc0206921 SIOCGIFALTMTU = 0xc0206948 SIOCGIFASYNCMAP = 0xc020697c @@ -1220,6 +1288,7 @@ const ( SIOCGIFDEVMTU = 0xc0206944 SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFLAGS = 0xc0206911 + SIOCGIFFUNCTIONALTYPE = 0xc02069ad SIOCGIFGENERIC = 0xc020693a SIOCGIFKPI = 0xc0206987 SIOCGIFMAC = 0xc0206982 @@ -1233,6 +1302,7 @@ const ( SIOCGIFSTATUS = 0xc331693d SIOCGIFVLAN = 0xc020697f SIOCGIFWAKEFLAGS = 0xc0206988 + SIOCGIFXMEDIA = 0xc02c6948 SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCIFCREATE = 0xc0206978 @@ -1243,6 +1313,7 @@ const ( SIOCSDRVSPEC = 0x8028697b SIOCSETVLAN = 0x8020697e SIOCSHIWAT = 0x80047300 + SIOCSIF6LOWPAN = 0x802069c4 SIOCSIFADDR = 0x8020690c SIOCSIFALTMTU = 0x80206945 SIOCSIFASYNCMAP = 0x8020697d @@ -1270,6 +1341,7 @@ const ( SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 + SOL_LOCAL = 0x0 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go index 03feefbf8c..e748cb1105 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go @@ -1,6 +1,7 @@ // mkerrors.sh // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm && darwin // +build arm,darwin // Code generated by cmd/cgo -godefs; DO NOT EDIT. diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go index b40fb1f696..e644eaf5e7 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go @@ -1,6 +1,7 @@ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm64 && darwin // +build arm64,darwin // Code generated by cmd/cgo -godefs; DO NOT EDIT. @@ -32,7 +33,7 @@ const ( AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 - AF_MAX = 0x28 + AF_MAX = 0x29 AF_NATM = 0x1f AF_NDRV = 0x1b AF_NETBIOS = 0x21 @@ -49,6 +50,7 @@ const ( AF_UNIX = 0x1 AF_UNSPEC = 0x0 AF_UTUN = 0x26 + AF_VSOCK = 0x28 ALTWERASE = 0x200 ATTR_BIT_MAP_COUNT = 0x5 ATTR_CMN_ACCESSMASK = 0x20000 @@ -83,7 +85,7 @@ const ( ATTR_CMN_PAROBJID = 0x80 ATTR_CMN_RETURNED_ATTRS = 0x80000000 ATTR_CMN_SCRIPT = 0x100 - ATTR_CMN_SETMASK = 0x41c7ff00 + ATTR_CMN_SETMASK = 0x51c7ff00 ATTR_CMN_USERACCESS = 0x200000 ATTR_CMN_UUID = 0x800000 ATTR_CMN_VALIDMASK = 0xffffffff @@ -357,7 +359,7 @@ const ( DLT_LINUX_SLL = 0x71 DLT_LOOP = 0x6c DLT_LTALK = 0x72 - DLT_MATCHING_MAX = 0xf5 + DLT_MATCHING_MAX = 0x10a DLT_MATCHING_MIN = 0x68 DLT_MFR = 0xb6 DLT_MOST = 0xd3 @@ -398,6 +400,7 @@ const ( DLT_SYMANTEC_FIREWALL = 0x63 DLT_TZSP = 0x80 DLT_USB = 0xba + DLT_USB_DARWIN = 0x10a DLT_USB_LINUX = 0xbd DLT_USB_LINUX_MMAPPED = 0xdc DLT_USER0 = 0x93 @@ -442,8 +445,8 @@ const ( EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 - EVFILT_SYSCOUNT = 0xf - EVFILT_THREADMARKER = 0xf + EVFILT_SYSCOUNT = 0x11 + EVFILT_THREADMARKER = 0x11 EVFILT_TIMER = -0x7 EVFILT_USER = -0xa EVFILT_VM = -0xc @@ -481,9 +484,12 @@ const ( FSOPT_NOINMEMUPDATE = 0x2 FSOPT_PACK_INVAL_ATTRS = 0x8 FSOPT_REPORT_FULLSIZE = 0x4 + FSOPT_RETURN_REALDEV = 0x200 F_ADDFILESIGS = 0x3d F_ADDFILESIGS_FOR_DYLD_SIM = 0x53 + F_ADDFILESIGS_INFO = 0x67 F_ADDFILESIGS_RETURN = 0x61 + F_ADDFILESUPPL = 0x68 F_ADDSIGS = 0x3b F_ALLOCATEALL = 0x4 F_ALLOCATECONTIG = 0x2 @@ -505,8 +511,10 @@ const ( F_GETOWN = 0x5 F_GETPATH = 0x32 F_GETPATH_MTMINFO = 0x47 + F_GETPATH_NOFIRMLINK = 0x66 F_GETPROTECTIONCLASS = 0x3f F_GETPROTECTIONLEVEL = 0x4d + F_GETSIGSINFO = 0x69 F_GLOBAL_NOCACHE = 0x37 F_LOG2PHYS = 0x31 F_LOG2PHYS_EXT = 0x41 @@ -531,6 +539,7 @@ const ( F_SETPROTECTIONCLASS = 0x40 F_SETSIZE = 0x2b F_SINGLE_WRITER = 0x4c + F_SPECULATIVE_READ = 0x65 F_THAW_FS = 0x36 F_TRANSCODEKEY = 0x4b F_TRIM_ACTIVE_FILE = 0x64 @@ -562,6 +571,7 @@ const ( IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 + IFT_6LOWPAN = 0x40 IFT_AAL5 = 0x31 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 @@ -766,16 +776,28 @@ const ( IPV6_2292PKTINFO = 0x13 IPV6_2292PKTOPTIONS = 0x19 IPV6_2292RTHDR = 0x18 + IPV6_3542DSTOPTS = 0x32 + IPV6_3542HOPLIMIT = 0x2f + IPV6_3542HOPOPTS = 0x31 + IPV6_3542NEXTHOP = 0x30 + IPV6_3542PKTINFO = 0x2e + IPV6_3542RTHDR = 0x33 + IPV6_ADDR_MC_FLAGS_PREFIX = 0x20 + IPV6_ADDR_MC_FLAGS_TRANSIENT = 0x10 + IPV6_ADDR_MC_FLAGS_UNICAST_BASED = 0x30 + IPV6_AUTOFLOWLABEL = 0x3b IPV6_BINDV6ONLY = 0x1b IPV6_BOUND_IF = 0x7d IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 + IPV6_DONTFRAG = 0x3e + IPV6_DSTOPTS = 0x32 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 - IPV6_FLOW_ECN_MASK = 0x300 + IPV6_FLOW_ECN_MASK = 0x3000 IPV6_FRAGTTL = 0x3c IPV6_FW_ADD = 0x1e IPV6_FW_DEL = 0x1f @@ -783,6 +805,8 @@ const ( IPV6_FW_GET = 0x22 IPV6_FW_ZERO = 0x21 IPV6_HLIMDEC = 0x1 + IPV6_HOPLIMIT = 0x2f + IPV6_HOPOPTS = 0x31 IPV6_IPSEC_POLICY = 0x1c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd @@ -794,20 +818,34 @@ const ( IPV6_MAX_SOCK_SRC_FILTER = 0x80 IPV6_MIN_MEMBERSHIPS = 0x1f IPV6_MMTU = 0x500 + IPV6_MSFILTER = 0x4a IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb + IPV6_NEXTHOP = 0x30 + IPV6_PATHMTU = 0x2c + IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 + IPV6_PREFER_TEMPADDR = 0x3f + IPV6_RECVDSTOPTS = 0x28 + IPV6_RECVHOPLIMIT = 0x25 + IPV6_RECVHOPOPTS = 0x27 + IPV6_RECVPATHMTU = 0x2b + IPV6_RECVPKTINFO = 0x3d + IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x23 + IPV6_RTHDR = 0x33 + IPV6_RTHDRDSTOPTS = 0x39 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x24 IPV6_UNICAST_HOPS = 0x4 + IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 @@ -818,6 +856,7 @@ const ( IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 + IP_DONTFRAG = 0x1c IP_DROP_MEMBERSHIP = 0xd IP_DROP_SOURCE_MEMBERSHIP = 0x47 IP_DUMMYNET_CONFIGURE = 0x3c @@ -889,6 +928,12 @@ const ( KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 + LOCAL_PEERCRED = 0x1 + LOCAL_PEEREPID = 0x3 + LOCAL_PEEREUUID = 0x5 + LOCAL_PEERPID = 0x2 + LOCAL_PEERTOKEN = 0x6 + LOCAL_PEERUUID = 0x4 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 @@ -904,6 +949,7 @@ const ( MADV_SEQUENTIAL = 0x2 MADV_WILLNEED = 0x3 MADV_ZERO_WIRED_PAGES = 0x6 + MAP_32BIT = 0x8000 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_COPY = 0x2 @@ -920,6 +966,17 @@ const ( MAP_RESILIENT_CODESIGN = 0x2000 MAP_RESILIENT_MEDIA = 0x4000 MAP_SHARED = 0x1 + MAP_TRANSLATED_ALLOW_EXECUTE = 0x20000 + MAP_UNIX03 = 0x40000 + MCAST_BLOCK_SOURCE = 0x54 + MCAST_EXCLUDE = 0x2 + MCAST_INCLUDE = 0x1 + MCAST_JOIN_GROUP = 0x50 + MCAST_JOIN_SOURCE_GROUP = 0x52 + MCAST_LEAVE_GROUP = 0x51 + MCAST_LEAVE_SOURCE_GROUP = 0x53 + MCAST_UNBLOCK_SOURCE = 0x55 + MCAST_UNDEFINED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ASYNC = 0x40 @@ -931,6 +988,7 @@ const ( MNT_DOVOLFS = 0x8000 MNT_DWAIT = 0x4 MNT_EXPORTED = 0x100 + MNT_EXT_ROOT_DATA_VOL = 0x1 MNT_FORCE = 0x80000 MNT_IGNORE_OWNERSHIP = 0x200000 MNT_JOURNALED = 0x800000 @@ -947,12 +1005,15 @@ const ( MNT_QUOTA = 0x2000 MNT_RDONLY = 0x1 MNT_RELOAD = 0x40000 + MNT_REMOVABLE = 0x200 MNT_ROOTFS = 0x4000 + MNT_SNAPSHOT = 0x40000000 + MNT_STRICTATIME = 0x80000000 MNT_SYNCHRONOUS = 0x2 MNT_UNION = 0x20 MNT_UNKNOWNPERMISSIONS = 0x200000 MNT_UPDATE = 0x10000 - MNT_VISFLAGMASK = 0x17f0f5ff + MNT_VISFLAGMASK = 0xd7f0f7ff MNT_WAIT = 0x1 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 @@ -963,6 +1024,7 @@ const ( MSG_HAVEMORE = 0x2000 MSG_HOLD = 0x800 MSG_NEEDSA = 0x10000 + MSG_NOSIGNAL = 0x80000 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_RCVMORE = 0x4000 @@ -979,9 +1041,10 @@ const ( NET_RT_DUMP = 0x1 NET_RT_DUMP2 = 0x7 NET_RT_FLAGS = 0x2 + NET_RT_FLAGS_PRIV = 0xa NET_RT_IFLIST = 0x3 NET_RT_IFLIST2 = 0x6 - NET_RT_MAXID = 0xa + NET_RT_MAXID = 0xb NET_RT_STAT = 0x4 NET_RT_TRASH = 0x5 NFDBITS = 0x20 @@ -1019,6 +1082,7 @@ const ( NOTE_LEEWAY = 0x10 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 + NOTE_MACHTIME = 0x100 NOTE_MACH_CONTINUOUS_TIME = 0x80 NOTE_NONE = 0x80 NOTE_NSECONDS = 0x4 @@ -1065,6 +1129,7 @@ const ( O_NDELAY = 0x4 O_NOCTTY = 0x20000 O_NOFOLLOW = 0x100 + O_NOFOLLOW_ANY = 0x20000000 O_NONBLOCK = 0x4 O_POPUP = 0x80000000 O_RDONLY = 0x0 @@ -1136,6 +1201,7 @@ const ( RTF_BROADCAST = 0x400000 RTF_CLONING = 0x100 RTF_CONDEMNED = 0x2000000 + RTF_DEAD = 0x20000000 RTF_DELCLONE = 0x80 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 @@ -1143,6 +1209,7 @@ const ( RTF_HOST = 0x4 RTF_IFREF = 0x4000000 RTF_IFSCOPE = 0x1000000 + RTF_LLDATA = 0x400 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 @@ -1210,6 +1277,7 @@ const ( SIOCGDRVSPEC = 0xc028697b SIOCGETVLAN = 0xc020697f SIOCGHIWAT = 0x40047301 + SIOCGIF6LOWPAN = 0xc02069c5 SIOCGIFADDR = 0xc0206921 SIOCGIFALTMTU = 0xc0206948 SIOCGIFASYNCMAP = 0xc020697c @@ -1220,6 +1288,7 @@ const ( SIOCGIFDEVMTU = 0xc0206944 SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFLAGS = 0xc0206911 + SIOCGIFFUNCTIONALTYPE = 0xc02069ad SIOCGIFGENERIC = 0xc020693a SIOCGIFKPI = 0xc0206987 SIOCGIFMAC = 0xc0206982 @@ -1233,6 +1302,7 @@ const ( SIOCGIFSTATUS = 0xc331693d SIOCGIFVLAN = 0xc020697f SIOCGIFWAKEFLAGS = 0xc0206988 + SIOCGIFXMEDIA = 0xc02c6948 SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCIFCREATE = 0xc0206978 @@ -1243,6 +1313,7 @@ const ( SIOCSDRVSPEC = 0x8028697b SIOCSETVLAN = 0x8020697e SIOCSHIWAT = 0x80047300 + SIOCSIF6LOWPAN = 0x802069c4 SIOCSIFADDR = 0x8020690c SIOCSIFALTMTU = 0x80206945 SIOCSIFASYNCMAP = 0x8020697d @@ -1270,6 +1341,7 @@ const ( SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 + SOL_LOCAL = 0x0 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 diff --git a/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go index f5e91b7aba..17bba0e44f 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go @@ -1,6 +1,7 @@ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && dragonfly // +build amd64,dragonfly // Code generated by cmd/cgo -godefs; DO NOT EDIT. diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go b/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go index 3689c80848..9c7c5e1654 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go @@ -1,6 +1,7 @@ // mkerrors.sh -m32 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build 386 && freebsd // +build 386,freebsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. @@ -997,6 +998,11 @@ const ( KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 + LOCAL_CONNWAIT = 0x4 + LOCAL_CREDS = 0x2 + LOCAL_CREDS_PERSISTENT = 0x3 + LOCAL_PEERCRED = 0x1 + LOCAL_VENDOR = 0x80000000 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 @@ -1375,6 +1381,7 @@ const ( SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 + SOL_LOCAL = 0x0 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go index b8f7c3c930..b265abb25f 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go @@ -1,6 +1,7 @@ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && freebsd // +build amd64,freebsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. @@ -997,6 +998,11 @@ const ( KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 + LOCAL_CONNWAIT = 0x4 + LOCAL_CREDS = 0x2 + LOCAL_CREDS_PERSISTENT = 0x3 + LOCAL_PEERCRED = 0x1 + LOCAL_VENDOR = 0x80000000 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 @@ -1376,6 +1382,7 @@ const ( SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 + SOL_LOCAL = 0x0 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go b/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go index be14bb1a4c..3df99f285f 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go @@ -1,6 +1,7 @@ // mkerrors.sh // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm && freebsd // +build arm,freebsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. @@ -980,6 +981,11 @@ const ( KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 + LOCAL_CONNWAIT = 0x4 + LOCAL_CREDS = 0x2 + LOCAL_CREDS_PERSISTENT = 0x3 + LOCAL_PEERCRED = 0x1 + LOCAL_VENDOR = 0x80000000 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 @@ -1016,6 +1022,15 @@ const ( MAP_RESERVED0100 = 0x100 MAP_SHARED = 0x1 MAP_STACK = 0x400 + MCAST_BLOCK_SOURCE = 0x54 + MCAST_EXCLUDE = 0x2 + MCAST_INCLUDE = 0x1 + MCAST_JOIN_GROUP = 0x50 + MCAST_JOIN_SOURCE_GROUP = 0x52 + MCAST_LEAVE_GROUP = 0x51 + MCAST_LEAVE_SOURCE_GROUP = 0x53 + MCAST_UNBLOCK_SOURCE = 0x55 + MCAST_UNDEFINED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MNT_ACLS = 0x8000000 @@ -1341,6 +1356,7 @@ const ( SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 + SOL_LOCAL = 0x0 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go index 7ce9c0081a..218d39906d 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go @@ -1,6 +1,7 @@ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm64 && freebsd // +build arm64,freebsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. @@ -997,6 +998,11 @@ const ( KERN_OSRELEASE = 0x2 KERN_OSTYPE = 0x1 KERN_VERSION = 0x4 + LOCAL_CONNWAIT = 0x4 + LOCAL_CREDS = 0x2 + LOCAL_CREDS_PERSISTENT = 0x3 + LOCAL_PEERCRED = 0x1 + LOCAL_VENDOR = 0x80000000 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 @@ -1376,6 +1382,7 @@ const ( SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 + SOL_LOCAL = 0x0 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index f73b4efd07..35de419c6d 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -1,5 +1,6 @@ // Code generated by mkmerge.go; DO NOT EDIT. +//go:build linux // +build linux package unix @@ -244,6 +245,10 @@ const ( BS0 = 0x0 BTRFS_SUPER_MAGIC = 0x9123683e BTRFS_TEST_MAGIC = 0x73727279 + BUS_BLUETOOTH = 0x5 + BUS_HIL = 0x4 + BUS_USB = 0x3 + BUS_VIRTUAL = 0x6 CAN_BCM = 0x2 CAN_EFF_FLAG = 0x80000000 CAN_EFF_ID_BITS = 0x1d @@ -313,6 +318,7 @@ const ( CAN_J1939 = 0x7 CAN_MAX_DLC = 0x8 CAN_MAX_DLEN = 0x8 + CAN_MAX_RAW_DLC = 0xf CAN_MCNET = 0x5 CAN_MTU = 0x10 CAN_NPROTO = 0x8 @@ -527,6 +533,119 @@ const ( EPOLL_CTL_DEL = 0x2 EPOLL_CTL_MOD = 0x3 EROFS_SUPER_MAGIC_V1 = 0xe0f5e1e2 + ESP_V4_FLOW = 0xa + ESP_V6_FLOW = 0xc + ETHER_FLOW = 0x12 + ETHTOOL_BUSINFO_LEN = 0x20 + ETHTOOL_EROMVERS_LEN = 0x20 + ETHTOOL_FEC_AUTO = 0x2 + ETHTOOL_FEC_BASER = 0x10 + ETHTOOL_FEC_LLRS = 0x20 + ETHTOOL_FEC_NONE = 0x1 + ETHTOOL_FEC_OFF = 0x4 + ETHTOOL_FEC_RS = 0x8 + ETHTOOL_FLAG_ALL = 0x7 + ETHTOOL_FLAG_COMPACT_BITSETS = 0x1 + ETHTOOL_FLAG_OMIT_REPLY = 0x2 + ETHTOOL_FLAG_STATS = 0x4 + ETHTOOL_FLASHDEV = 0x33 + ETHTOOL_FLASH_MAX_FILENAME = 0x80 + ETHTOOL_FWVERS_LEN = 0x20 + ETHTOOL_F_COMPAT = 0x4 + ETHTOOL_F_UNSUPPORTED = 0x1 + ETHTOOL_F_WISH = 0x2 + ETHTOOL_GCHANNELS = 0x3c + ETHTOOL_GCOALESCE = 0xe + ETHTOOL_GDRVINFO = 0x3 + ETHTOOL_GEEE = 0x44 + ETHTOOL_GEEPROM = 0xb + ETHTOOL_GENL_NAME = "ethtool" + ETHTOOL_GENL_VERSION = 0x1 + ETHTOOL_GET_DUMP_DATA = 0x40 + ETHTOOL_GET_DUMP_FLAG = 0x3f + ETHTOOL_GET_TS_INFO = 0x41 + ETHTOOL_GFEATURES = 0x3a + ETHTOOL_GFECPARAM = 0x50 + ETHTOOL_GFLAGS = 0x25 + ETHTOOL_GGRO = 0x2b + ETHTOOL_GGSO = 0x23 + ETHTOOL_GLINK = 0xa + ETHTOOL_GLINKSETTINGS = 0x4c + ETHTOOL_GMODULEEEPROM = 0x43 + ETHTOOL_GMODULEINFO = 0x42 + ETHTOOL_GMSGLVL = 0x7 + ETHTOOL_GPAUSEPARAM = 0x12 + ETHTOOL_GPERMADDR = 0x20 + ETHTOOL_GPFLAGS = 0x27 + ETHTOOL_GPHYSTATS = 0x4a + ETHTOOL_GREGS = 0x4 + ETHTOOL_GRINGPARAM = 0x10 + ETHTOOL_GRSSH = 0x46 + ETHTOOL_GRXCLSRLALL = 0x30 + ETHTOOL_GRXCLSRLCNT = 0x2e + ETHTOOL_GRXCLSRULE = 0x2f + ETHTOOL_GRXCSUM = 0x14 + ETHTOOL_GRXFH = 0x29 + ETHTOOL_GRXFHINDIR = 0x38 + ETHTOOL_GRXNTUPLE = 0x36 + ETHTOOL_GRXRINGS = 0x2d + ETHTOOL_GSET = 0x1 + ETHTOOL_GSG = 0x18 + ETHTOOL_GSSET_INFO = 0x37 + ETHTOOL_GSTATS = 0x1d + ETHTOOL_GSTRINGS = 0x1b + ETHTOOL_GTSO = 0x1e + ETHTOOL_GTUNABLE = 0x48 + ETHTOOL_GTXCSUM = 0x16 + ETHTOOL_GUFO = 0x21 + ETHTOOL_GWOL = 0x5 + ETHTOOL_MCGRP_MONITOR_NAME = "monitor" + ETHTOOL_NWAY_RST = 0x9 + ETHTOOL_PERQUEUE = 0x4b + ETHTOOL_PHYS_ID = 0x1c + ETHTOOL_PHY_EDPD_DFLT_TX_MSECS = 0xffff + ETHTOOL_PHY_EDPD_DISABLE = 0x0 + ETHTOOL_PHY_EDPD_NO_TX = 0xfffe + ETHTOOL_PHY_FAST_LINK_DOWN_OFF = 0xff + ETHTOOL_PHY_FAST_LINK_DOWN_ON = 0x0 + ETHTOOL_PHY_GTUNABLE = 0x4e + ETHTOOL_PHY_STUNABLE = 0x4f + ETHTOOL_RESET = 0x34 + ETHTOOL_RXNTUPLE_ACTION_CLEAR = -0x2 + ETHTOOL_RXNTUPLE_ACTION_DROP = -0x1 + ETHTOOL_RX_FLOW_SPEC_RING = 0xffffffff + ETHTOOL_RX_FLOW_SPEC_RING_VF = 0xff00000000 + ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF = 0x20 + ETHTOOL_SCHANNELS = 0x3d + ETHTOOL_SCOALESCE = 0xf + ETHTOOL_SEEE = 0x45 + ETHTOOL_SEEPROM = 0xc + ETHTOOL_SET_DUMP = 0x3e + ETHTOOL_SFEATURES = 0x3b + ETHTOOL_SFECPARAM = 0x51 + ETHTOOL_SFLAGS = 0x26 + ETHTOOL_SGRO = 0x2c + ETHTOOL_SGSO = 0x24 + ETHTOOL_SLINKSETTINGS = 0x4d + ETHTOOL_SMSGLVL = 0x8 + ETHTOOL_SPAUSEPARAM = 0x13 + ETHTOOL_SPFLAGS = 0x28 + ETHTOOL_SRINGPARAM = 0x11 + ETHTOOL_SRSSH = 0x47 + ETHTOOL_SRXCLSRLDEL = 0x31 + ETHTOOL_SRXCLSRLINS = 0x32 + ETHTOOL_SRXCSUM = 0x15 + ETHTOOL_SRXFH = 0x2a + ETHTOOL_SRXFHINDIR = 0x39 + ETHTOOL_SRXNTUPLE = 0x35 + ETHTOOL_SSET = 0x2 + ETHTOOL_SSG = 0x19 + ETHTOOL_STSO = 0x1f + ETHTOOL_STUNABLE = 0x49 + ETHTOOL_STXCSUM = 0x17 + ETHTOOL_SUFO = 0x22 + ETHTOOL_SWOL = 0x6 + ETHTOOL_TEST = 0x1a ETH_P_1588 = 0x88f7 ETH_P_8021AD = 0x88a8 ETH_P_8021AH = 0x88e7 @@ -551,6 +670,7 @@ const ( ETH_P_CAIF = 0xf7 ETH_P_CAN = 0xc ETH_P_CANFD = 0xd + ETH_P_CFM = 0x8902 ETH_P_CONTROL = 0x16 ETH_P_CUST = 0x6006 ETH_P_DDCMP = 0x6 @@ -721,7 +841,6 @@ const ( FSCRYPT_POLICY_FLAGS_PAD_4 = 0x0 FSCRYPT_POLICY_FLAGS_PAD_8 = 0x1 FSCRYPT_POLICY_FLAGS_PAD_MASK = 0x3 - FSCRYPT_POLICY_FLAGS_VALID = 0x1f FSCRYPT_POLICY_FLAG_DIRECT_KEY = 0x4 FSCRYPT_POLICY_FLAG_IV_INO_LBLK_32 = 0x10 FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 = 0x8 @@ -752,7 +871,7 @@ const ( FS_POLICY_FLAGS_PAD_4 = 0x0 FS_POLICY_FLAGS_PAD_8 = 0x1 FS_POLICY_FLAGS_PAD_MASK = 0x3 - FS_POLICY_FLAGS_VALID = 0x1f + FS_POLICY_FLAGS_VALID = 0x7 FS_VERITY_FL = 0x100000 FS_VERITY_HASH_ALG_SHA256 = 0x1 FS_VERITY_HASH_ALG_SHA512 = 0x2 @@ -849,11 +968,17 @@ const ( HDIO_SET_XFER = 0x306 HDIO_TRISTATE_HWIF = 0x31b HDIO_UNREGISTER_HWIF = 0x32a + HID_MAX_DESCRIPTOR_SIZE = 0x1000 HOSTFS_SUPER_MAGIC = 0xc0ffee HPFS_SUPER_MAGIC = 0xf995e849 HUGETLBFS_MAGIC = 0x958458f6 IBSHIFT = 0x10 ICMPV6_FILTER = 0x1 + ICMPV6_FILTER_BLOCK = 0x1 + ICMPV6_FILTER_BLOCKOTHERS = 0x3 + ICMPV6_FILTER_PASS = 0x2 + ICMPV6_FILTER_PASSONLY = 0x4 + ICMP_FILTER = 0x1 ICRNL = 0x100 IFA_F_DADFAILED = 0x8 IFA_F_DEPRECATED = 0x20 @@ -996,6 +1121,7 @@ const ( IPV6_DONTFRAG = 0x3e IPV6_DROP_MEMBERSHIP = 0x15 IPV6_DSTOPTS = 0x3b + IPV6_FLOW = 0x11 IPV6_FREEBIND = 0x4e IPV6_HDRINCL = 0x24 IPV6_HOPLIMIT = 0x34 @@ -1024,6 +1150,7 @@ const ( IPV6_PMTUDISC_WANT = 0x1 IPV6_RECVDSTOPTS = 0x3a IPV6_RECVERR = 0x19 + IPV6_RECVERR_RFC4884 = 0x1f IPV6_RECVFRAGSIZE = 0x4d IPV6_RECVHOPLIMIT = 0x33 IPV6_RECVHOPOPTS = 0x35 @@ -1045,6 +1172,7 @@ const ( IPV6_TRANSPARENT = 0x4b IPV6_UNICAST_HOPS = 0x10 IPV6_UNICAST_IF = 0x4c + IPV6_USER_FLOW = 0xe IPV6_V6ONLY = 0x1a IPV6_XFRM_POLICY = 0x23 IP_ADD_MEMBERSHIP = 0x23 @@ -1087,6 +1215,7 @@ const ( IP_PMTUDISC_PROBE = 0x3 IP_PMTUDISC_WANT = 0x1 IP_RECVERR = 0xb + IP_RECVERR_RFC4884 = 0x1a IP_RECVFRAGSIZE = 0x19 IP_RECVOPTS = 0x6 IP_RECVORIGDSTADDR = 0x14 @@ -1101,6 +1230,7 @@ const ( IP_TTL = 0x2 IP_UNBLOCK_SOURCE = 0x25 IP_UNICAST_IF = 0x32 + IP_USER_FLOW = 0xd IP_XFRM_POLICY = 0x11 ISOFS_SUPER_MAGIC = 0x9660 ISTRIP = 0x20 @@ -1724,6 +1854,7 @@ const ( PR_SET_SECCOMP = 0x16 PR_SET_SECUREBITS = 0x1c PR_SET_SPECULATION_CTRL = 0x35 + PR_SET_SYSCALL_USER_DISPATCH = 0x3b PR_SET_TAGGED_ADDR_CTRL = 0x37 PR_SET_THP_DISABLE = 0x29 PR_SET_TIMERSLACK = 0x1d @@ -1743,6 +1874,8 @@ const ( PR_SVE_SET_VL_ONEXEC = 0x40000 PR_SVE_VL_INHERIT = 0x20000 PR_SVE_VL_LEN_MASK = 0xffff + PR_SYS_DISPATCH_OFF = 0x0 + PR_SYS_DISPATCH_ON = 0x1 PR_TAGGED_ADDR_ENABLE = 0x1 PR_TASK_PERF_EVENTS_DISABLE = 0x1f PR_TASK_PERF_EVENTS_ENABLE = 0x20 @@ -1988,12 +2121,13 @@ const ( RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 RTNH_ALIGNTO = 0x4 - RTNH_COMPARE_MASK = 0x19 + RTNH_COMPARE_MASK = 0x59 RTNH_F_DEAD = 0x1 RTNH_F_LINKDOWN = 0x10 RTNH_F_OFFLOAD = 0x8 RTNH_F_ONLINK = 0x4 RTNH_F_PERVASIVE = 0x2 + RTNH_F_TRAP = 0x40 RTNH_F_UNRESOLVED = 0x20 RTN_MAX = 0xb RTPROT_BABEL = 0x2a @@ -2340,6 +2474,8 @@ const ( TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 + TCP_V4_FLOW = 0x1 + TCP_V6_FLOW = 0x5 TCP_WINDOW_CLAMP = 0xa TCP_ZEROCOPY_RECEIVE = 0x23 TFD_TIMER_ABSTIME = 0x1 @@ -2462,10 +2598,12 @@ const ( VMADDR_CID_HOST = 0x2 VMADDR_CID_HYPERVISOR = 0x0 VMADDR_CID_LOCAL = 0x1 + VMADDR_FLAG_TO_HOST = 0x1 VMADDR_PORT_ANY = 0xffffffff VM_SOCKETS_INVALID_VERSION = 0xffffffff VQUIT = 0x1 VT0 = 0x0 + WAKE_MAGIC = 0x20 WALL = 0x40000000 WCLONE = 0x80000000 WCONTINUED = 0x8 @@ -2608,6 +2746,9 @@ const ( Z3FOLD_MAGIC = 0x33 ZONEFS_MAGIC = 0x5a4f4653 ZSMALLOC_MAGIC = 0x58295829 + _HIDIOCGRAWNAME_LEN = 0x80 + _HIDIOCGRAWPHYS_LEN = 0x40 + _HIDIOCGRAWUNIQ_LEN = 0x40 ) // Errors diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index dd282c08b7..e91a1a9579 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -1,10 +1,11 @@ // mkerrors.sh -Wall -Werror -static -I/tmp/include -m32 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build 386 && linux // +build 386,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 _const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 /build/_const.go package unix @@ -93,6 +94,9 @@ const ( F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 + HIDIOCGRAWINFO = 0x80084803 + HIDIOCGRDESC = 0x90044802 + HIDIOCGRDESCSIZE = 0x80044801 HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 @@ -165,6 +169,7 @@ const ( PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 + PPPIOCBRIDGECHAN = 0x40047435 PPPIOCCONNECT = 0x4004743a PPPIOCDETACH = 0x4004743c PPPIOCDISCONN = 0x7439 @@ -192,6 +197,7 @@ const ( PPPIOCSPASS = 0x40087447 PPPIOCSRASYNCMAP = 0x40047454 PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffff PTRACE_GETFPREGS = 0xe @@ -268,6 +274,7 @@ const ( SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUSY_POLL = 0x2e + SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 @@ -290,6 +297,7 @@ const ( SO_PEERCRED = 0x11 SO_PEERGROUPS = 0x3b SO_PEERSEC = 0x1f + SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 @@ -481,6 +489,9 @@ const ( X86_FXSR_MAGIC = 0x0 XCASE = 0x4 XTABS = 0x1800 + _HIDIOCGRAWNAME = 0x80804804 + _HIDIOCGRAWPHYS = 0x80404805 + _HIDIOCGRAWUNIQ = 0x80404808 ) // Errors diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index 82fc93c7bb..a9cbac6443 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -1,10 +1,11 @@ // mkerrors.sh -Wall -Werror -static -I/tmp/include -m64 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && linux // +build amd64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 _const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 /build/_const.go package unix @@ -93,6 +94,9 @@ const ( F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 + HIDIOCGRAWINFO = 0x80084803 + HIDIOCGRDESC = 0x90044802 + HIDIOCGRDESCSIZE = 0x80044801 HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 @@ -165,6 +169,7 @@ const ( PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 + PPPIOCBRIDGECHAN = 0x40047435 PPPIOCCONNECT = 0x4004743a PPPIOCDETACH = 0x4004743c PPPIOCDISCONN = 0x7439 @@ -192,6 +197,7 @@ const ( PPPIOCSPASS = 0x40107447 PPPIOCSRASYNCMAP = 0x40047454 PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffffffffffff PTRACE_ARCH_PRCTL = 0x1e @@ -269,6 +275,7 @@ const ( SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUSY_POLL = 0x2e + SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 @@ -291,6 +298,7 @@ const ( SO_PEERCRED = 0x11 SO_PEERGROUPS = 0x3b SO_PEERSEC = 0x1f + SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 @@ -481,6 +489,9 @@ const ( WORDSIZE = 0x40 XCASE = 0x4 XTABS = 0x1800 + _HIDIOCGRAWNAME = 0x80804804 + _HIDIOCGRAWPHYS = 0x80404805 + _HIDIOCGRAWUNIQ = 0x80404808 ) // Errors diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index fe7094f276..d74f3c15a1 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -1,10 +1,11 @@ // mkerrors.sh -Wall -Werror -static -I/tmp/include // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm && linux // +build arm,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go package unix @@ -92,6 +93,9 @@ const ( F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 + HIDIOCGRAWINFO = 0x80084803 + HIDIOCGRDESC = 0x90044802 + HIDIOCGRDESCSIZE = 0x80044801 HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 @@ -163,6 +167,7 @@ const ( PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 + PPPIOCBRIDGECHAN = 0x40047435 PPPIOCCONNECT = 0x4004743a PPPIOCDETACH = 0x4004743c PPPIOCDISCONN = 0x7439 @@ -190,6 +195,7 @@ const ( PPPIOCSPASS = 0x40087447 PPPIOCSRASYNCMAP = 0x40047454 PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffff PTRACE_GETCRUNCHREGS = 0x19 @@ -275,6 +281,7 @@ const ( SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUSY_POLL = 0x2e + SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 @@ -297,6 +304,7 @@ const ( SO_PEERCRED = 0x11 SO_PEERGROUPS = 0x3b SO_PEERSEC = 0x1f + SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 @@ -487,6 +495,9 @@ const ( WORDSIZE = 0x20 XCASE = 0x4 XTABS = 0x1800 + _HIDIOCGRAWNAME = 0x80804804 + _HIDIOCGRAWPHYS = 0x80404805 + _HIDIOCGRAWUNIQ = 0x80404808 ) // Errors diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index d04f078f39..e1538995b4 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -1,10 +1,11 @@ // mkerrors.sh -Wall -Werror -static -I/tmp/include -fsigned-char // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm64 && linux // +build arm64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char _const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/_const.go package unix @@ -95,6 +96,9 @@ const ( F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 + HIDIOCGRAWINFO = 0x80084803 + HIDIOCGRDESC = 0x90044802 + HIDIOCGRDESCSIZE = 0x80044801 HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 @@ -166,6 +170,7 @@ const ( PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 + PPPIOCBRIDGECHAN = 0x40047435 PPPIOCCONNECT = 0x4004743a PPPIOCDETACH = 0x4004743c PPPIOCDISCONN = 0x7439 @@ -193,8 +198,10 @@ const ( PPPIOCSPASS = 0x40107447 PPPIOCSRASYNCMAP = 0x40047454 PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PROT_BTI = 0x10 + PROT_MTE = 0x20 PR_SET_PTRACER_ANY = 0xffffffffffffffff PTRACE_PEEKMTETAGS = 0x21 PTRACE_POKEMTETAGS = 0x22 @@ -264,6 +271,7 @@ const ( SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUSY_POLL = 0x2e + SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 @@ -286,6 +294,7 @@ const ( SO_PEERCRED = 0x11 SO_PEERGROUPS = 0x3b SO_PEERSEC = 0x1f + SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 @@ -477,6 +486,9 @@ const ( WORDSIZE = 0x40 XCASE = 0x4 XTABS = 0x1800 + _HIDIOCGRAWNAME = 0x80804804 + _HIDIOCGRAWPHYS = 0x80404805 + _HIDIOCGRAWUNIQ = 0x80404808 ) // Errors diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index ce3d9ae156..5e8e71ff86 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -1,10 +1,11 @@ // mkerrors.sh -Wall -Werror -static -I/tmp/include // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build mips && linux // +build mips,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go package unix @@ -92,6 +93,9 @@ const ( F_SETOWN = 0x18 F_UNLCK = 0x2 F_WRLCK = 0x1 + HIDIOCGRAWINFO = 0x40084803 + HIDIOCGRDESC = 0x50044802 + HIDIOCGRDESCSIZE = 0x40044801 HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x100 @@ -163,6 +167,7 @@ const ( PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 + PPPIOCBRIDGECHAN = 0x80047435 PPPIOCCONNECT = 0x8004743a PPPIOCDETACH = 0x8004743c PPPIOCDISCONN = 0x20007439 @@ -190,6 +195,7 @@ const ( PPPIOCSPASS = 0x80087447 PPPIOCSRASYNCMAP = 0x80047454 PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PR_SET_PTRACER_ANY = 0xffffffff PTRACE_GETFPREGS = 0xe @@ -268,6 +274,7 @@ const ( SO_BROADCAST = 0x20 SO_BSDCOMPAT = 0xe SO_BUSY_POLL = 0x2e + SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 @@ -290,6 +297,7 @@ const ( SO_PEERCRED = 0x12 SO_PEERGROUPS = 0x3b SO_PEERSEC = 0x1e + SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x1028 SO_RCVBUF = 0x1002 SO_RCVBUFFORCE = 0x21 @@ -483,6 +491,9 @@ const ( WORDSIZE = 0x20 XCASE = 0x4 XTABS = 0x1800 + _HIDIOCGRAWNAME = 0x40804804 + _HIDIOCGRAWPHYS = 0x40404805 + _HIDIOCGRAWUNIQ = 0x40404808 ) // Errors diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index 7a85215ce5..e670ee1481 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -1,10 +1,11 @@ // mkerrors.sh -Wall -Werror -static -I/tmp/include // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build mips64 && linux // +build mips64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go package unix @@ -92,6 +93,9 @@ const ( F_SETOWN = 0x18 F_UNLCK = 0x2 F_WRLCK = 0x1 + HIDIOCGRAWINFO = 0x40084803 + HIDIOCGRDESC = 0x50044802 + HIDIOCGRDESCSIZE = 0x40044801 HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x100 @@ -163,6 +167,7 @@ const ( PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 + PPPIOCBRIDGECHAN = 0x80047435 PPPIOCCONNECT = 0x8004743a PPPIOCDETACH = 0x8004743c PPPIOCDISCONN = 0x20007439 @@ -190,6 +195,7 @@ const ( PPPIOCSPASS = 0x80107447 PPPIOCSRASYNCMAP = 0x80047454 PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PR_SET_PTRACER_ANY = 0xffffffffffffffff PTRACE_GETFPREGS = 0xe @@ -268,6 +274,7 @@ const ( SO_BROADCAST = 0x20 SO_BSDCOMPAT = 0xe SO_BUSY_POLL = 0x2e + SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 @@ -290,6 +297,7 @@ const ( SO_PEERCRED = 0x12 SO_PEERGROUPS = 0x3b SO_PEERSEC = 0x1e + SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x1028 SO_RCVBUF = 0x1002 SO_RCVBUFFORCE = 0x21 @@ -483,6 +491,9 @@ const ( WORDSIZE = 0x40 XCASE = 0x4 XTABS = 0x1800 + _HIDIOCGRAWNAME = 0x40804804 + _HIDIOCGRAWPHYS = 0x40404805 + _HIDIOCGRAWUNIQ = 0x40404808 ) // Errors diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index 07d4cc1bd5..dd11eacb81 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -1,10 +1,11 @@ // mkerrors.sh -Wall -Werror -static -I/tmp/include // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build mips64le && linux // +build mips64le,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go package unix @@ -92,6 +93,9 @@ const ( F_SETOWN = 0x18 F_UNLCK = 0x2 F_WRLCK = 0x1 + HIDIOCGRAWINFO = 0x40084803 + HIDIOCGRDESC = 0x50044802 + HIDIOCGRDESCSIZE = 0x40044801 HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x100 @@ -163,6 +167,7 @@ const ( PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 + PPPIOCBRIDGECHAN = 0x80047435 PPPIOCCONNECT = 0x8004743a PPPIOCDETACH = 0x8004743c PPPIOCDISCONN = 0x20007439 @@ -190,6 +195,7 @@ const ( PPPIOCSPASS = 0x80107447 PPPIOCSRASYNCMAP = 0x80047454 PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PR_SET_PTRACER_ANY = 0xffffffffffffffff PTRACE_GETFPREGS = 0xe @@ -268,6 +274,7 @@ const ( SO_BROADCAST = 0x20 SO_BSDCOMPAT = 0xe SO_BUSY_POLL = 0x2e + SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 @@ -290,6 +297,7 @@ const ( SO_PEERCRED = 0x12 SO_PEERGROUPS = 0x3b SO_PEERSEC = 0x1e + SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x1028 SO_RCVBUF = 0x1002 SO_RCVBUFFORCE = 0x21 @@ -483,6 +491,9 @@ const ( WORDSIZE = 0x40 XCASE = 0x4 XTABS = 0x1800 + _HIDIOCGRAWNAME = 0x40804804 + _HIDIOCGRAWPHYS = 0x40404805 + _HIDIOCGRAWUNIQ = 0x40404808 ) // Errors diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index d4842ba1c2..a0a5b22ae9 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -1,10 +1,11 @@ // mkerrors.sh -Wall -Werror -static -I/tmp/include // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build mipsle && linux // +build mipsle,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go package unix @@ -92,6 +93,9 @@ const ( F_SETOWN = 0x18 F_UNLCK = 0x2 F_WRLCK = 0x1 + HIDIOCGRAWINFO = 0x40084803 + HIDIOCGRDESC = 0x50044802 + HIDIOCGRDESCSIZE = 0x40044801 HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x100 @@ -163,6 +167,7 @@ const ( PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 + PPPIOCBRIDGECHAN = 0x80047435 PPPIOCCONNECT = 0x8004743a PPPIOCDETACH = 0x8004743c PPPIOCDISCONN = 0x20007439 @@ -190,6 +195,7 @@ const ( PPPIOCSPASS = 0x80087447 PPPIOCSRASYNCMAP = 0x80047454 PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PR_SET_PTRACER_ANY = 0xffffffff PTRACE_GETFPREGS = 0xe @@ -268,6 +274,7 @@ const ( SO_BROADCAST = 0x20 SO_BSDCOMPAT = 0xe SO_BUSY_POLL = 0x2e + SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 @@ -290,6 +297,7 @@ const ( SO_PEERCRED = 0x12 SO_PEERGROUPS = 0x3b SO_PEERSEC = 0x1e + SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x1028 SO_RCVBUF = 0x1002 SO_RCVBUFFORCE = 0x21 @@ -483,6 +491,9 @@ const ( WORDSIZE = 0x20 XCASE = 0x4 XTABS = 0x1800 + _HIDIOCGRAWNAME = 0x40804804 + _HIDIOCGRAWPHYS = 0x40404805 + _HIDIOCGRAWUNIQ = 0x40404808 ) // Errors diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 941e20dace..e60102f6a9 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -1,10 +1,11 @@ // mkerrors.sh -Wall -Werror -static -I/tmp/include // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build ppc64 && linux // +build ppc64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go package unix @@ -92,6 +93,9 @@ const ( F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 + HIDIOCGRAWINFO = 0x40084803 + HIDIOCGRDESC = 0x50044802 + HIDIOCGRDESCSIZE = 0x40044801 HUPCL = 0x4000 ICANON = 0x100 IEXTEN = 0x400 @@ -165,6 +169,7 @@ const ( PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 + PPPIOCBRIDGECHAN = 0x80047435 PPPIOCCONNECT = 0x8004743a PPPIOCDETACH = 0x8004743c PPPIOCDISCONN = 0x20007439 @@ -192,6 +197,7 @@ const ( PPPIOCSPASS = 0x80107447 PPPIOCSRASYNCMAP = 0x80047454 PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PROT_SAO = 0x10 PR_SET_PTRACER_ANY = 0xffffffffffffffff @@ -327,6 +333,7 @@ const ( SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUSY_POLL = 0x2e + SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 @@ -349,6 +356,7 @@ const ( SO_PEERCRED = 0x15 SO_PEERGROUPS = 0x3b SO_PEERSEC = 0x1f + SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 @@ -543,6 +551,9 @@ const ( WORDSIZE = 0x40 XCASE = 0x4000 XTABS = 0xc00 + _HIDIOCGRAWNAME = 0x40804804 + _HIDIOCGRAWPHYS = 0x40404805 + _HIDIOCGRAWUNIQ = 0x40404808 ) // Errors diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 63d3bc5662..838ff4ea6d 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -1,10 +1,11 @@ // mkerrors.sh -Wall -Werror -static -I/tmp/include // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build ppc64le && linux // +build ppc64le,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go package unix @@ -92,6 +93,9 @@ const ( F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 + HIDIOCGRAWINFO = 0x40084803 + HIDIOCGRDESC = 0x50044802 + HIDIOCGRDESCSIZE = 0x40044801 HUPCL = 0x4000 ICANON = 0x100 IEXTEN = 0x400 @@ -165,6 +169,7 @@ const ( PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 + PPPIOCBRIDGECHAN = 0x80047435 PPPIOCCONNECT = 0x8004743a PPPIOCDETACH = 0x8004743c PPPIOCDISCONN = 0x20007439 @@ -192,6 +197,7 @@ const ( PPPIOCSPASS = 0x80107447 PPPIOCSRASYNCMAP = 0x80047454 PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PROT_SAO = 0x10 PR_SET_PTRACER_ANY = 0xffffffffffffffff @@ -327,6 +333,7 @@ const ( SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUSY_POLL = 0x2e + SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 @@ -349,6 +356,7 @@ const ( SO_PEERCRED = 0x15 SO_PEERGROUPS = 0x3b SO_PEERSEC = 0x1f + SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 @@ -543,6 +551,9 @@ const ( WORDSIZE = 0x40 XCASE = 0x4000 XTABS = 0xc00 + _HIDIOCGRAWNAME = 0x40804804 + _HIDIOCGRAWPHYS = 0x40404805 + _HIDIOCGRAWUNIQ = 0x40404808 ) // Errors diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index 490bee1ab1..7cc98f09c3 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -1,10 +1,11 @@ // mkerrors.sh -Wall -Werror -static -I/tmp/include // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build riscv64 && linux // +build riscv64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go package unix @@ -92,6 +93,9 @@ const ( F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 + HIDIOCGRAWINFO = 0x80084803 + HIDIOCGRDESC = 0x90044802 + HIDIOCGRDESCSIZE = 0x80044801 HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 @@ -163,6 +167,7 @@ const ( PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 + PPPIOCBRIDGECHAN = 0x40047435 PPPIOCCONNECT = 0x4004743a PPPIOCDETACH = 0x4004743c PPPIOCDISCONN = 0x7439 @@ -190,6 +195,7 @@ const ( PPPIOCSPASS = 0x40107447 PPPIOCSRASYNCMAP = 0x40047454 PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffffffffffff RLIMIT_AS = 0x9 @@ -256,6 +262,7 @@ const ( SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUSY_POLL = 0x2e + SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 @@ -278,6 +285,7 @@ const ( SO_PEERCRED = 0x11 SO_PEERGROUPS = 0x3b SO_PEERSEC = 0x1f + SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 @@ -468,6 +476,9 @@ const ( WORDSIZE = 0x40 XCASE = 0x4 XTABS = 0x1800 + _HIDIOCGRAWNAME = 0x80804804 + _HIDIOCGRAWPHYS = 0x80404805 + _HIDIOCGRAWUNIQ = 0x80404808 ) // Errors diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 467b8218e8..a508392d25 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -1,10 +1,11 @@ // mkerrors.sh -Wall -Werror -static -I/tmp/include -fsigned-char // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build s390x && linux // +build s390x,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char _const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/_const.go package unix @@ -92,6 +93,9 @@ const ( F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 + HIDIOCGRAWINFO = 0x80084803 + HIDIOCGRDESC = 0x90044802 + HIDIOCGRDESCSIZE = 0x80044801 HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 @@ -163,6 +167,7 @@ const ( PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PPPIOCATTACH = 0x4004743d PPPIOCATTCHAN = 0x40047438 + PPPIOCBRIDGECHAN = 0x40047435 PPPIOCCONNECT = 0x4004743a PPPIOCDETACH = 0x4004743c PPPIOCDISCONN = 0x7439 @@ -190,6 +195,7 @@ const ( PPPIOCSPASS = 0x40107447 PPPIOCSRASYNCMAP = 0x40047454 PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffffffffffff PTRACE_DISABLE_TE = 0x5010 @@ -329,6 +335,7 @@ const ( SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUSY_POLL = 0x2e + SO_BUSY_POLL_BUDGET = 0x46 SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 @@ -351,6 +358,7 @@ const ( SO_PEERCRED = 0x11 SO_PEERGROUPS = 0x3b SO_PEERSEC = 0x1f + SO_PREFER_BUSY_POLL = 0x45 SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 @@ -541,6 +549,9 @@ const ( WORDSIZE = 0x40 XCASE = 0x4 XTABS = 0x1800 + _HIDIOCGRAWNAME = 0x80804804 + _HIDIOCGRAWPHYS = 0x80404805 + _HIDIOCGRAWUNIQ = 0x80404808 ) // Errors diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index 79fbafbcf6..d5e2dc94fa 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -1,10 +1,11 @@ // mkerrors.sh -Wall -Werror -static -I/tmp/include // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build sparc64 && linux // +build sparc64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go package unix @@ -96,6 +97,9 @@ const ( F_SETOWN = 0x6 F_UNLCK = 0x3 F_WRLCK = 0x2 + HIDIOCGRAWINFO = 0x40084803 + HIDIOCGRDESC = 0x50044802 + HIDIOCGRDESCSIZE = 0x40044801 HUPCL = 0x400 ICANON = 0x2 IEXTEN = 0x8000 @@ -168,6 +172,7 @@ const ( PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 + PPPIOCBRIDGECHAN = 0x80047435 PPPIOCCONNECT = 0x8004743a PPPIOCDETACH = 0x8004743c PPPIOCDISCONN = 0x20007439 @@ -195,6 +200,7 @@ const ( PPPIOCSPASS = 0x80107447 PPPIOCSRASYNCMAP = 0x80047454 PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCUNBRIDGECHAN = 0x20007434 PPPIOCXFERUNIT = 0x2000744e PR_SET_PTRACER_ANY = 0xffffffffffffffff PTRACE_GETFPAREGS = 0x14 @@ -322,6 +328,7 @@ const ( SO_BROADCAST = 0x20 SO_BSDCOMPAT = 0x400 SO_BUSY_POLL = 0x30 + SO_BUSY_POLL_BUDGET = 0x49 SO_CNX_ADVICE = 0x37 SO_COOKIE = 0x3b SO_DETACH_REUSEPORT_BPF = 0x47 @@ -344,6 +351,7 @@ const ( SO_PEERCRED = 0x40 SO_PEERGROUPS = 0x3d SO_PEERSEC = 0x1e + SO_PREFER_BUSY_POLL = 0x48 SO_PROTOCOL = 0x1028 SO_RCVBUF = 0x1002 SO_RCVBUFFORCE = 0x100b @@ -531,6 +539,9 @@ const ( WORDSIZE = 0x40 XCASE = 0x4 XTABS = 0x1800 + _HIDIOCGRAWNAME = 0x40804804 + _HIDIOCGRAWPHYS = 0x40404805 + _HIDIOCGRAWUNIQ = 0x40404808 __TIOCFLUSH = 0x80047410 ) diff --git a/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go b/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go index 20f3a5799f..72f7420d20 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go @@ -1,6 +1,7 @@ // mkerrors.sh -m32 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build 386 && netbsd // +build 386,netbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. diff --git a/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go index 90b8fcd29c..8d4eb0c080 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go @@ -1,6 +1,7 @@ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && netbsd // +build amd64,netbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. diff --git a/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go b/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go index c5c03993b6..9eef9749f6 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go @@ -1,6 +1,7 @@ // mkerrors.sh -marm // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm && netbsd // +build arm,netbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. diff --git a/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm64.go index 14dd3c1d1e..3b62ba192c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm64.go @@ -1,6 +1,7 @@ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm64 && netbsd // +build arm64,netbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go index c865a10df4..593cc0feff 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go @@ -1,6 +1,7 @@ // mkerrors.sh -m32 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build 386 && openbsd // +build 386,openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go index 9db6b2fb6e..25cb609481 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go @@ -1,6 +1,7 @@ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && openbsd // +build amd64,openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go index 7072526a64..a4e4c22314 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go @@ -1,6 +1,7 @@ // mkerrors.sh // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm && openbsd // +build arm,openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go index ac5efbe5ac..90de7dfc33 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go @@ -1,6 +1,7 @@ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm64 && openbsd // +build arm64,openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go index a74639a46f..f1154ff56f 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go @@ -1,6 +1,7 @@ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build mips64 && openbsd // +build mips64,openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. diff --git a/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go index 5312c36cc8..1afee6a089 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go @@ -1,6 +1,7 @@ // mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && solaris // +build amd64,solaris // Code generated by cmd/cgo -godefs; DO NOT EDIT. @@ -365,6 +366,7 @@ const ( HUPCL = 0x400 IBSHIFT = 0x10 ICANON = 0x2 + ICMP6_FILTER = 0x1 ICRNL = 0x100 IEXTEN = 0x8000 IFF_ADDRCONF = 0x80000 @@ -611,6 +613,7 @@ const ( IP_RECVPKTINFO = 0x1a IP_RECVRETOPTS = 0x6 IP_RECVSLLA = 0xa + IP_RECVTOS = 0xc IP_RECVTTL = 0xb IP_RETOPTS = 0x8 IP_REUSEADDR = 0x104 @@ -703,6 +706,7 @@ const ( O_APPEND = 0x8 O_CLOEXEC = 0x800000 O_CREAT = 0x100 + O_DIRECT = 0x2000000 O_DIRECTORY = 0x1000000 O_DSYNC = 0x40 O_EXCL = 0x400 diff --git a/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go new file mode 100644 index 0000000000..4e87b4bebd --- /dev/null +++ b/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go @@ -0,0 +1,838 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build zos && s390x +// +build zos,s390x + +// Hand edited based on zerrors_linux_s390x.go +// TODO: auto-generate. + +package unix + +const ( + BRKINT = 0x0001 + CLOCK_MONOTONIC = 0x1 + CLOCK_PROCESS_CPUTIME_ID = 0x2 + CLOCK_REALTIME = 0x0 + CLOCK_THREAD_CPUTIME_ID = 0x3 + CS8 = 0x0030 + CSIZE = 0x0030 + ECHO = 0x00000008 + ECHONL = 0x00000001 + FD_CLOEXEC = 0x01 + FD_CLOFORK = 0x02 + FNDELAY = 0x04 + F_CLOSFD = 9 + F_CONTROL_CVT = 13 + F_DUPFD = 0 + F_DUPFD2 = 8 + F_GETFD = 1 + F_GETFL = 259 + F_GETLK = 5 + F_GETOWN = 10 + F_OK = 0x0 + F_RDLCK = 1 + F_SETFD = 2 + F_SETFL = 4 + F_SETLK = 6 + F_SETLKW = 7 + F_SETOWN = 11 + F_SETTAG = 12 + F_UNLCK = 3 + F_WRLCK = 2 + FSTYPE_ZFS = 0xe9 //"Z" + FSTYPE_HFS = 0xc8 //"H" + FSTYPE_NFS = 0xd5 //"N" + FSTYPE_TFS = 0xe3 //"T" + FSTYPE_AUTOMOUNT = 0xc1 //"A" + IP6F_MORE_FRAG = 0x0001 + IP6F_OFF_MASK = 0xfff8 + IP6F_RESERVED_MASK = 0x0006 + IP6OPT_JUMBO = 0xc2 + IP6OPT_JUMBO_LEN = 6 + IP6OPT_MUTABLE = 0x20 + IP6OPT_NSAP_ADDR = 0xc3 + IP6OPT_PAD1 = 0x00 + IP6OPT_PADN = 0x01 + IP6OPT_ROUTER_ALERT = 0x05 + IP6OPT_TUNNEL_LIMIT = 0x04 + IP6OPT_TYPE_DISCARD = 0x40 + IP6OPT_TYPE_FORCEICMP = 0x80 + IP6OPT_TYPE_ICMP = 0xc0 + IP6OPT_TYPE_SKIP = 0x00 + IP6_ALERT_AN = 0x0002 + IP6_ALERT_MLD = 0x0000 + IP6_ALERT_RSVP = 0x0001 + IPPORT_RESERVED = 1024 + IPPORT_USERRESERVED = 5000 + IPPROTO_AH = 51 + IPPROTO_DSTOPTS = 60 + IPPROTO_EGP = 8 + IPPROTO_ESP = 50 + IPPROTO_FRAGMENT = 44 + IPPROTO_GGP = 2 + IPPROTO_HOPOPTS = 0 + IPPROTO_ICMP = 1 + IPPROTO_ICMPV6 = 58 + IPPROTO_IDP = 22 + IPPROTO_IP = 0 + IPPROTO_IPV6 = 41 + IPPROTO_MAX = 256 + IPPROTO_NONE = 59 + IPPROTO_PUP = 12 + IPPROTO_RAW = 255 + IPPROTO_ROUTING = 43 + IPPROTO_TCP = 6 + IPPROTO_UDP = 17 + IPV6_ADDR_PREFERENCES = 32 + IPV6_CHECKSUM = 19 + IPV6_DONTFRAG = 29 + IPV6_DSTOPTS = 23 + IPV6_HOPLIMIT = 11 + IPV6_HOPOPTS = 22 + IPV6_JOIN_GROUP = 5 + IPV6_LEAVE_GROUP = 6 + IPV6_MULTICAST_HOPS = 9 + IPV6_MULTICAST_IF = 7 + IPV6_MULTICAST_LOOP = 4 + IPV6_NEXTHOP = 20 + IPV6_PATHMTU = 12 + IPV6_PKTINFO = 13 + IPV6_PREFER_SRC_CGA = 0x10 + IPV6_PREFER_SRC_COA = 0x02 + IPV6_PREFER_SRC_HOME = 0x01 + IPV6_PREFER_SRC_NONCGA = 0x20 + IPV6_PREFER_SRC_PUBLIC = 0x08 + IPV6_PREFER_SRC_TMP = 0x04 + IPV6_RECVDSTOPTS = 28 + IPV6_RECVHOPLIMIT = 14 + IPV6_RECVHOPOPTS = 26 + IPV6_RECVPATHMTU = 16 + IPV6_RECVPKTINFO = 15 + IPV6_RECVRTHDR = 25 + IPV6_RECVTCLASS = 31 + IPV6_RTHDR = 21 + IPV6_RTHDRDSTOPTS = 24 + IPV6_RTHDR_TYPE_0 = 0 + IPV6_TCLASS = 30 + IPV6_UNICAST_HOPS = 3 + IPV6_USE_MIN_MTU = 18 + IPV6_V6ONLY = 10 + IP_ADD_MEMBERSHIP = 5 + IP_ADD_SOURCE_MEMBERSHIP = 12 + IP_BLOCK_SOURCE = 10 + IP_DEFAULT_MULTICAST_LOOP = 1 + IP_DEFAULT_MULTICAST_TTL = 1 + IP_DROP_MEMBERSHIP = 6 + IP_DROP_SOURCE_MEMBERSHIP = 13 + IP_MAX_MEMBERSHIPS = 20 + IP_MULTICAST_IF = 7 + IP_MULTICAST_LOOP = 4 + IP_MULTICAST_TTL = 3 + IP_OPTIONS = 1 + IP_PKTINFO = 101 + IP_RECVPKTINFO = 102 + IP_TOS = 2 + IP_TTL = 3 + IP_UNBLOCK_SOURCE = 11 + ICANON = 0x0010 + ICMP6_FILTER = 0x26 + ICRNL = 0x0002 + IEXTEN = 0x0020 + IGNBRK = 0x0004 + IGNCR = 0x0008 + INLCR = 0x0020 + ISIG = 0x0040 + ISTRIP = 0x0080 + IXON = 0x0200 + IXOFF = 0x0100 + LOCK_SH = 0x1 // Not exist on zOS + LOCK_EX = 0x2 // Not exist on zOS + LOCK_NB = 0x4 // Not exist on zOS + LOCK_UN = 0x8 // Not exist on zOS + POLLIN = 0x0003 + POLLOUT = 0x0004 + POLLPRI = 0x0010 + POLLERR = 0x0020 + POLLHUP = 0x0040 + POLLNVAL = 0x0080 + PROT_READ = 0x1 // mmap - page can be read + PROT_WRITE = 0x2 // page can be written + PROT_NONE = 0x4 // can't be accessed + PROT_EXEC = 0x8 // can be executed + MAP_PRIVATE = 0x1 // changes are private + MAP_SHARED = 0x2 // changes are shared + MAP_FIXED = 0x4 // place exactly + MCAST_JOIN_GROUP = 40 + MCAST_LEAVE_GROUP = 41 + MCAST_JOIN_SOURCE_GROUP = 42 + MCAST_LEAVE_SOURCE_GROUP = 43 + MCAST_BLOCK_SOURCE = 44 + MCAST_UNBLOCK_SOURCE = 45 + MS_SYNC = 0x1 // msync - synchronous writes + MS_ASYNC = 0x2 // asynchronous writes + MS_INVALIDATE = 0x4 // invalidate mappings + MTM_RDONLY = 0x80000000 + MTM_RDWR = 0x40000000 + MTM_UMOUNT = 0x10000000 + MTM_IMMED = 0x08000000 + MTM_FORCE = 0x04000000 + MTM_DRAIN = 0x02000000 + MTM_RESET = 0x01000000 + MTM_SAMEMODE = 0x00100000 + MTM_UNQSEFORCE = 0x00040000 + MTM_NOSUID = 0x00000400 + MTM_SYNCHONLY = 0x00000200 + MTM_REMOUNT = 0x00000100 + MTM_NOSECURITY = 0x00000080 + O_ACCMODE = 0x03 + O_APPEND = 0x08 + O_ASYNCSIG = 0x0200 + O_CREAT = 0x80 + O_EXCL = 0x40 + O_GETFL = 0x0F + O_LARGEFILE = 0x0400 + O_NONBLOCK = 0x04 + O_RDONLY = 0x02 + O_RDWR = 0x03 + O_SYNC = 0x0100 + O_TRUNC = 0x10 + O_WRONLY = 0x01 + O_NOCTTY = 0x20 + OPOST = 0x0001 + ONLCR = 0x0004 + PARENB = 0x0200 + PARMRK = 0x0400 + QUERYCVT = 3 + RUSAGE_CHILDREN = -0x1 + RUSAGE_SELF = 0x0 // RUSAGE_THREAD unsupported on z/OS + SEEK_CUR = 1 + SEEK_END = 2 + SEEK_SET = 0 + SETAUTOCVTALL = 5 + SETAUTOCVTON = 2 + SETCVTALL = 4 + SETCVTOFF = 0 + SETCVTON = 1 + AF_APPLETALK = 16 + AF_CCITT = 10 + AF_CHAOS = 5 + AF_DATAKIT = 9 + AF_DLI = 13 + AF_ECMA = 8 + AF_HYLINK = 15 + AF_IMPLINK = 3 + AF_INET = 2 + AF_INET6 = 19 + AF_INTF = 20 + AF_IUCV = 17 + AF_LAT = 14 + AF_LINK = 18 + AF_MAX = 30 + AF_NBS = 7 + AF_NDD = 23 + AF_NETWARE = 22 + AF_NS = 6 + AF_PUP = 4 + AF_RIF = 21 + AF_ROUTE = 20 + AF_SNA = 11 + AF_UNIX = 1 + AF_UNSPEC = 0 + IBMTCP_IMAGE = 1 + MSG_ACK_EXPECTED = 0x10 + MSG_ACK_GEN = 0x40 + MSG_ACK_TIMEOUT = 0x20 + MSG_CONNTERM = 0x80 + MSG_CTRUNC = 0x20 + MSG_DONTROUTE = 0x4 + MSG_EOF = 0x8000 + MSG_EOR = 0x8 + MSG_MAXIOVLEN = 16 + MSG_NONBLOCK = 0x4000 + MSG_OOB = 0x1 + MSG_PEEK = 0x2 + MSG_TRUNC = 0x10 + MSG_WAITALL = 0x40 + PRIO_PROCESS = 1 + PRIO_PGRP = 2 + PRIO_USER = 3 + RLIMIT_CPU = 0 + RLIMIT_FSIZE = 1 + RLIMIT_DATA = 2 + RLIMIT_STACK = 3 + RLIMIT_CORE = 4 + RLIMIT_AS = 5 + RLIMIT_NOFILE = 6 + RLIMIT_MEMLIMIT = 7 + RLIM_INFINITY = 2147483647 + SCM_RIGHTS = 0x01 + SF_CLOSE = 0x00000002 + SF_REUSE = 0x00000001 + SHUT_RD = 0 + SHUT_RDWR = 2 + SHUT_WR = 1 + SOCK_CONN_DGRAM = 6 + SOCK_DGRAM = 2 + SOCK_RAW = 3 + SOCK_RDM = 4 + SOCK_SEQPACKET = 5 + SOCK_STREAM = 1 + SOL_SOCKET = 0xffff + SOMAXCONN = 10 + SO_ACCEPTCONN = 0x0002 + SO_ACCEPTECONNABORTED = 0x0006 + SO_ACKNOW = 0x7700 + SO_BROADCAST = 0x0020 + SO_BULKMODE = 0x8000 + SO_CKSUMRECV = 0x0800 + SO_CLOSE = 0x01 + SO_CLUSTERCONNTYPE = 0x00004001 + SO_CLUSTERCONNTYPE_INTERNAL = 8 + SO_CLUSTERCONNTYPE_NOCONN = 0 + SO_CLUSTERCONNTYPE_NONE = 1 + SO_CLUSTERCONNTYPE_SAME_CLUSTER = 2 + SO_CLUSTERCONNTYPE_SAME_IMAGE = 4 + SO_DEBUG = 0x0001 + SO_DONTROUTE = 0x0010 + SO_ERROR = 0x1007 + SO_IGNOREINCOMINGPUSH = 0x1 + SO_IGNORESOURCEVIPA = 0x0002 + SO_KEEPALIVE = 0x0008 + SO_LINGER = 0x0080 + SO_NONBLOCKLOCAL = 0x8001 + SO_NOREUSEADDR = 0x1000 + SO_OOBINLINE = 0x0100 + SO_OPTACK = 0x8004 + SO_OPTMSS = 0x8003 + SO_RCVBUF = 0x1002 + SO_RCVLOWAT = 0x1004 + SO_RCVTIMEO = 0x1006 + SO_REUSEADDR = 0x0004 + SO_REUSEPORT = 0x0200 + SO_SECINFO = 0x00004002 + SO_SET = 0x0200 + SO_SNDBUF = 0x1001 + SO_SNDLOWAT = 0x1003 + SO_SNDTIMEO = 0x1005 + SO_TYPE = 0x1008 + SO_UNSET = 0x0400 + SO_USELOOPBACK = 0x0040 + SO_USE_IFBUFS = 0x0400 + S_ISUID = 0x0800 + S_ISGID = 0x0400 + S_ISVTX = 0x0200 + S_IRUSR = 0x0100 + S_IWUSR = 0x0080 + S_IXUSR = 0x0040 + S_IRWXU = 0x01C0 + S_IRGRP = 0x0020 + S_IWGRP = 0x0010 + S_IXGRP = 0x0008 + S_IRWXG = 0x0038 + S_IROTH = 0x0004 + S_IWOTH = 0x0002 + S_IXOTH = 0x0001 + S_IRWXO = 0x0007 + S_IREAD = S_IRUSR + S_IWRITE = S_IWUSR + S_IEXEC = S_IXUSR + S_IFDIR = 0x01000000 + S_IFCHR = 0x02000000 + S_IFREG = 0x03000000 + S_IFFIFO = 0x04000000 + S_IFIFO = 0x04000000 + S_IFLNK = 0x05000000 + S_IFBLK = 0x06000000 + S_IFSOCK = 0x07000000 + S_IFVMEXTL = 0xFE000000 + S_IFVMEXTL_EXEC = 0x00010000 + S_IFVMEXTL_DATA = 0x00020000 + S_IFVMEXTL_MEL = 0x00030000 + S_IFEXTL = 0x00000001 + S_IFPROGCTL = 0x00000002 + S_IFAPFCTL = 0x00000004 + S_IFNOSHARE = 0x00000008 + S_IFSHARELIB = 0x00000010 + S_IFMT = 0xFF000000 + S_IFMST = 0x00FF0000 + TCP_KEEPALIVE = 0x8 + TCP_NODELAY = 0x1 + TIOCGWINSZ = 0x4008a368 + TIOCSWINSZ = 0x8008a367 + TIOCSBRK = 0x2000a77b + TIOCCBRK = 0x2000a77a + TIOCSTI = 0x8001a772 + TIOCGPGRP = 0x4004a777 // _IOR(167, 119, int) + TCSANOW = 0 + TCSETS = 0 // equivalent to TCSANOW for tcsetattr + TCSADRAIN = 1 + TCSETSW = 1 // equivalent to TCSADRAIN for tcsetattr + TCSAFLUSH = 2 + TCSETSF = 2 // equivalent to TCSAFLUSH for tcsetattr + TCGETS = 3 // not defined in ioctl.h -- zos golang only + TCIFLUSH = 0 + TCOFLUSH = 1 + TCIOFLUSH = 2 + TCOOFF = 0 + TCOON = 1 + TCIOFF = 2 + TCION = 3 + TIOCSPGRP = 0x8004a776 + TIOCNOTTY = 0x2000a771 + TIOCEXCL = 0x2000a70d + TIOCNXCL = 0x2000a70e + TIOCGETD = 0x4004a700 + TIOCSETD = 0x8004a701 + TIOCPKT = 0x8004a770 + TIOCSTOP = 0x2000a76f + TIOCSTART = 0x2000a76e + TIOCUCNTL = 0x8004a766 + TIOCREMOTE = 0x8004a769 + TIOCMGET = 0x4004a76a + TIOCMSET = 0x8004a76d + TIOCMBIC = 0x8004a76b + TIOCMBIS = 0x8004a76c + VINTR = 0 + VQUIT = 1 + VERASE = 2 + VKILL = 3 + VEOF = 4 + VEOL = 5 + VMIN = 6 + VSTART = 7 + VSTOP = 8 + VSUSP = 9 + VTIME = 10 + WCONTINUED = 0x4 + WNOHANG = 0x1 + WUNTRACED = 0x2 + _BPX_SWAP = 1 + _BPX_NONSWAP = 2 + MCL_CURRENT = 1 // for Linux compatibility -- no zos semantics + MCL_FUTURE = 2 // for Linux compatibility -- no zos semantics + MCL_ONFAULT = 3 // for Linux compatibility -- no zos semantics + MADV_NORMAL = 0 // for Linux compatibility -- no zos semantics + MADV_RANDOM = 1 // for Linux compatibility -- no zos semantics + MADV_SEQUENTIAL = 2 // for Linux compatibility -- no zos semantics + MADV_WILLNEED = 3 // for Linux compatibility -- no zos semantics + MADV_REMOVE = 4 // for Linux compatibility -- no zos semantics + MADV_DONTFORK = 5 // for Linux compatibility -- no zos semantics + MADV_DOFORK = 6 // for Linux compatibility -- no zos semantics + MADV_HWPOISON = 7 // for Linux compatibility -- no zos semantics + MADV_MERGEABLE = 8 // for Linux compatibility -- no zos semantics + MADV_UNMERGEABLE = 9 // for Linux compatibility -- no zos semantics + MADV_SOFT_OFFLINE = 10 // for Linux compatibility -- no zos semantics + MADV_HUGEPAGE = 11 // for Linux compatibility -- no zos semantics + MADV_NOHUGEPAGE = 12 // for Linux compatibility -- no zos semantics + MADV_DONTDUMP = 13 // for Linux compatibility -- no zos semantics + MADV_DODUMP = 14 // for Linux compatibility -- no zos semantics + MADV_FREE = 15 // for Linux compatibility -- no zos semantics + MADV_WIPEONFORK = 16 // for Linux compatibility -- no zos semantics + MADV_KEEPONFORK = 17 // for Linux compatibility -- no zos semantics + AT_SYMLINK_NOFOLLOW = 1 // for Unix compatibility -- no zos semantics + AT_FDCWD = 2 // for Unix compatibility -- no zos semantics +) + +const ( + EDOM = Errno(1) + ERANGE = Errno(2) + EACCES = Errno(111) + EAGAIN = Errno(112) + EBADF = Errno(113) + EBUSY = Errno(114) + ECHILD = Errno(115) + EDEADLK = Errno(116) + EEXIST = Errno(117) + EFAULT = Errno(118) + EFBIG = Errno(119) + EINTR = Errno(120) + EINVAL = Errno(121) + EIO = Errno(122) + EISDIR = Errno(123) + EMFILE = Errno(124) + EMLINK = Errno(125) + ENAMETOOLONG = Errno(126) + ENFILE = Errno(127) + ENODEV = Errno(128) + ENOENT = Errno(129) + ENOEXEC = Errno(130) + ENOLCK = Errno(131) + ENOMEM = Errno(132) + ENOSPC = Errno(133) + ENOSYS = Errno(134) + ENOTDIR = Errno(135) + ENOTEMPTY = Errno(136) + ENOTTY = Errno(137) + ENXIO = Errno(138) + EPERM = Errno(139) + EPIPE = Errno(140) + EROFS = Errno(141) + ESPIPE = Errno(142) + ESRCH = Errno(143) + EXDEV = Errno(144) + E2BIG = Errno(145) + ELOOP = Errno(146) + EILSEQ = Errno(147) + ENODATA = Errno(148) + EOVERFLOW = Errno(149) + EMVSNOTUP = Errno(150) + ECMSSTORAGE = Errno(151) + EMVSDYNALC = Errno(151) + EMVSCVAF = Errno(152) + EMVSCATLG = Errno(153) + ECMSINITIAL = Errno(156) + EMVSINITIAL = Errno(156) + ECMSERR = Errno(157) + EMVSERR = Errno(157) + EMVSPARM = Errno(158) + ECMSPFSFILE = Errno(159) + EMVSPFSFILE = Errno(159) + EMVSBADCHAR = Errno(160) + ECMSPFSPERM = Errno(162) + EMVSPFSPERM = Errno(162) + EMVSSAFEXTRERR = Errno(163) + EMVSSAF2ERR = Errno(164) + EMVSTODNOTSET = Errno(165) + EMVSPATHOPTS = Errno(166) + EMVSNORTL = Errno(167) + EMVSEXPIRE = Errno(168) + EMVSPASSWORD = Errno(169) + EMVSWLMERROR = Errno(170) + EMVSCPLERROR = Errno(171) + EMVSARMERROR = Errno(172) + ELENOFORK = Errno(200) + ELEMSGERR = Errno(201) + EFPMASKINV = Errno(202) + EFPMODEINV = Errno(203) + EBUFLEN = Errno(227) + EEXTLINK = Errno(228) + ENODD = Errno(229) + ECMSESMERR = Errno(230) + ECPERR = Errno(231) + ELEMULTITHREAD = Errno(232) + ELEFENCE = Errno(244) + EBADDATA = Errno(245) + EUNKNOWN = Errno(246) + ENOTSUP = Errno(247) + EBADNAME = Errno(248) + ENOTSAFE = Errno(249) + ELEMULTITHREADFORK = Errno(257) + ECUNNOENV = Errno(258) + ECUNNOCONV = Errno(259) + ECUNNOTALIGNED = Errno(260) + ECUNERR = Errno(262) + EIBMBADCALL = Errno(1000) + EIBMBADPARM = Errno(1001) + EIBMSOCKOUTOFRANGE = Errno(1002) + EIBMSOCKINUSE = Errno(1003) + EIBMIUCVERR = Errno(1004) + EOFFLOADboxERROR = Errno(1005) + EOFFLOADboxRESTART = Errno(1006) + EOFFLOADboxDOWN = Errno(1007) + EIBMCONFLICT = Errno(1008) + EIBMCANCELLED = Errno(1009) + EIBMBADTCPNAME = Errno(1011) + ENOTBLK = Errno(1100) + ETXTBSY = Errno(1101) + EWOULDBLOCK = Errno(1102) + EINPROGRESS = Errno(1103) + EALREADY = Errno(1104) + ENOTSOCK = Errno(1105) + EDESTADDRREQ = Errno(1106) + EMSGSIZE = Errno(1107) + EPROTOTYPE = Errno(1108) + ENOPROTOOPT = Errno(1109) + EPROTONOSUPPORT = Errno(1110) + ESOCKTNOSUPPORT = Errno(1111) + EOPNOTSUPP = Errno(1112) + EPFNOSUPPORT = Errno(1113) + EAFNOSUPPORT = Errno(1114) + EADDRINUSE = Errno(1115) + EADDRNOTAVAIL = Errno(1116) + ENETDOWN = Errno(1117) + ENETUNREACH = Errno(1118) + ENETRESET = Errno(1119) + ECONNABORTED = Errno(1120) + ECONNRESET = Errno(1121) + ENOBUFS = Errno(1122) + EISCONN = Errno(1123) + ENOTCONN = Errno(1124) + ESHUTDOWN = Errno(1125) + ETOOMANYREFS = Errno(1126) + ETIMEDOUT = Errno(1127) + ECONNREFUSED = Errno(1128) + EHOSTDOWN = Errno(1129) + EHOSTUNREACH = Errno(1130) + EPROCLIM = Errno(1131) + EUSERS = Errno(1132) + EDQUOT = Errno(1133) + ESTALE = Errno(1134) + EREMOTE = Errno(1135) + ENOSTR = Errno(1136) + ETIME = Errno(1137) + ENOSR = Errno(1138) + ENOMSG = Errno(1139) + EBADMSG = Errno(1140) + EIDRM = Errno(1141) + ENONET = Errno(1142) + ERREMOTE = Errno(1143) + ENOLINK = Errno(1144) + EADV = Errno(1145) + ESRMNT = Errno(1146) + ECOMM = Errno(1147) + EPROTO = Errno(1148) + EMULTIHOP = Errno(1149) + EDOTDOT = Errno(1150) + EREMCHG = Errno(1151) + ECANCELED = Errno(1152) + EINTRNODATA = Errno(1159) + ENOREUSE = Errno(1160) + ENOMOVE = Errno(1161) +) + +// Signals +const ( + SIGHUP = Signal(1) + SIGINT = Signal(2) + SIGABRT = Signal(3) + SIGILL = Signal(4) + SIGPOLL = Signal(5) + SIGURG = Signal(6) + SIGSTOP = Signal(7) + SIGFPE = Signal(8) + SIGKILL = Signal(9) + SIGBUS = Signal(10) + SIGSEGV = Signal(11) + SIGSYS = Signal(12) + SIGPIPE = Signal(13) + SIGALRM = Signal(14) + SIGTERM = Signal(15) + SIGUSR1 = Signal(16) + SIGUSR2 = Signal(17) + SIGABND = Signal(18) + SIGCONT = Signal(19) + SIGCHLD = Signal(20) + SIGTTIN = Signal(21) + SIGTTOU = Signal(22) + SIGIO = Signal(23) + SIGQUIT = Signal(24) + SIGTSTP = Signal(25) + SIGTRAP = Signal(26) + SIGIOERR = Signal(27) + SIGWINCH = Signal(28) + SIGXCPU = Signal(29) + SIGXFSZ = Signal(30) + SIGVTALRM = Signal(31) + SIGPROF = Signal(32) + SIGDANGER = Signal(33) + SIGTHSTOP = Signal(34) + SIGTHCONT = Signal(35) + SIGTRACE = Signal(37) + SIGDCE = Signal(38) + SIGDUMP = Signal(39) +) + +// Error table +var errorList = [...]struct { + num Errno + name string + desc string +}{ + {1, "EDC5001I", "A domain error occurred."}, + {2, "EDC5002I", "A range error occurred."}, + {111, "EDC5111I", "Permission denied."}, + {112, "EDC5112I", "Resource temporarily unavailable."}, + {113, "EDC5113I", "Bad file descriptor."}, + {114, "EDC5114I", "Resource busy."}, + {115, "EDC5115I", "No child processes."}, + {116, "EDC5116I", "Resource deadlock avoided."}, + {117, "EDC5117I", "File exists."}, + {118, "EDC5118I", "Incorrect address."}, + {119, "EDC5119I", "File too large."}, + {120, "EDC5120I", "Interrupted function call."}, + {121, "EDC5121I", "Invalid argument."}, + {122, "EDC5122I", "Input/output error."}, + {123, "EDC5123I", "Is a directory."}, + {124, "EDC5124I", "Too many open files."}, + {125, "EDC5125I", "Too many links."}, + {126, "EDC5126I", "Filename too long."}, + {127, "EDC5127I", "Too many open files in system."}, + {128, "EDC5128I", "No such device."}, + {129, "EDC5129I", "No such file or directory."}, + {130, "EDC5130I", "Exec format error."}, + {131, "EDC5131I", "No locks available."}, + {132, "EDC5132I", "Not enough memory."}, + {133, "EDC5133I", "No space left on device."}, + {134, "EDC5134I", "Function not implemented."}, + {135, "EDC5135I", "Not a directory."}, + {136, "EDC5136I", "Directory not empty."}, + {137, "EDC5137I", "Inappropriate I/O control operation."}, + {138, "EDC5138I", "No such device or address."}, + {139, "EDC5139I", "Operation not permitted."}, + {140, "EDC5140I", "Broken pipe."}, + {141, "EDC5141I", "Read-only file system."}, + {142, "EDC5142I", "Invalid seek."}, + {143, "EDC5143I", "No such process."}, + {144, "EDC5144I", "Improper link."}, + {145, "EDC5145I", "The parameter list is too long, or the message to receive was too large for the buffer."}, + {146, "EDC5146I", "Too many levels of symbolic links."}, + {147, "EDC5147I", "Illegal byte sequence."}, + {148, "", ""}, + {149, "EDC5149I", "Value Overflow Error."}, + {150, "EDC5150I", "UNIX System Services is not active."}, + {151, "EDC5151I", "Dynamic allocation error."}, + {152, "EDC5152I", "Common VTOC access facility (CVAF) error."}, + {153, "EDC5153I", "Catalog obtain error."}, + {156, "EDC5156I", "Process initialization error."}, + {157, "EDC5157I", "An internal error has occurred."}, + {158, "EDC5158I", "Bad parameters were passed to the service."}, + {159, "EDC5159I", "The Physical File System encountered a permanent file error."}, + {160, "EDC5160I", "Bad character in environment variable name."}, + {162, "EDC5162I", "The Physical File System encountered a system error."}, + {163, "EDC5163I", "SAF/RACF extract error."}, + {164, "EDC5164I", "SAF/RACF error."}, + {165, "EDC5165I", "System TOD clock not set."}, + {166, "EDC5166I", "Access mode argument on function call conflicts with PATHOPTS parameter on JCL DD statement."}, + {167, "EDC5167I", "Access to the UNIX System Services version of the C RTL is denied."}, + {168, "EDC5168I", "Password has expired."}, + {169, "EDC5169I", "Password is invalid."}, + {170, "EDC5170I", "An error was encountered with WLM."}, + {171, "EDC5171I", "An error was encountered with CPL."}, + {172, "EDC5172I", "An error was encountered with Application Response Measurement (ARM) component."}, + {200, "EDC5200I", "The application contains a Language Environment member language that cannot tolerate a fork()."}, + {201, "EDC5201I", "The Language Environment message file was not found in the hierarchical file system."}, + {202, "EDC5202E", "DLL facilities are not supported under SPC environment."}, + {203, "EDC5203E", "DLL facilities are not supported under POSIX environment."}, + {227, "EDC5227I", "Buffer is not long enough to contain a path definition"}, + {228, "EDC5228I", "The file referred to is an external link"}, + {229, "EDC5229I", "No path definition for ddname in effect"}, + {230, "EDC5230I", "ESM error."}, + {231, "EDC5231I", "CP or the external security manager had an error"}, + {232, "EDC5232I", "The function failed because it was invoked from a multithread environment."}, + {244, "EDC5244I", "The program, module or DLL is not supported in this environment."}, + {245, "EDC5245I", "Data is not valid."}, + {246, "EDC5246I", "Unknown system state."}, + {247, "EDC5247I", "Operation not supported."}, + {248, "EDC5248I", "The object name specified is not correct."}, + {249, "EDC5249I", "The function is not allowed."}, + {257, "EDC5257I", "Function cannot be called in the child process of a fork() from a multithreaded process until exec() is called."}, + {258, "EDC5258I", "A CUN_RS_NO_UNI_ENV error was issued by Unicode Services."}, + {259, "EDC5259I", "A CUN_RS_NO_CONVERSION error was issued by Unicode Services."}, + {260, "EDC5260I", "A CUN_RS_TABLE_NOT_ALIGNED error was issued by Unicode Services."}, + {262, "EDC5262I", "An iconv() function encountered an unexpected error while using Unicode Services."}, + {1000, "EDC8000I", "A bad socket-call constant was found in the IUCV header."}, + {1001, "EDC8001I", "An error was found in the IUCV header."}, + {1002, "EDC8002I", "A socket descriptor is out of range."}, + {1003, "EDC8003I", "A socket descriptor is in use."}, + {1004, "EDC8004I", "Request failed because of an IUCV error."}, + {1005, "EDC8005I", "Offload box error."}, + {1006, "EDC8006I", "Offload box restarted."}, + {1007, "EDC8007I", "Offload box down."}, + {1008, "EDC8008I", "Already a conflicting call outstanding on socket."}, + {1009, "EDC8009I", "Request cancelled using a SOCKcallCANCEL request."}, + {1011, "EDC8011I", "A name of a PFS was specified that either is not configured or is not a Sockets PFS."}, + {1100, "EDC8100I", "Block device required."}, + {1101, "EDC8101I", "Text file busy."}, + {1102, "EDC8102I", "Operation would block."}, + {1103, "EDC8103I", "Operation now in progress."}, + {1104, "EDC8104I", "Connection already in progress."}, + {1105, "EDC8105I", "Socket operation on non-socket."}, + {1106, "EDC8106I", "Destination address required."}, + {1107, "EDC8107I", "Message too long."}, + {1108, "EDC8108I", "Protocol wrong type for socket."}, + {1109, "EDC8109I", "Protocol not available."}, + {1110, "EDC8110I", "Protocol not supported."}, + {1111, "EDC8111I", "Socket type not supported."}, + {1112, "EDC8112I", "Operation not supported on socket."}, + {1113, "EDC8113I", "Protocol family not supported."}, + {1114, "EDC8114I", "Address family not supported."}, + {1115, "EDC8115I", "Address already in use."}, + {1116, "EDC8116I", "Address not available."}, + {1117, "EDC8117I", "Network is down."}, + {1118, "EDC8118I", "Network is unreachable."}, + {1119, "EDC8119I", "Network dropped connection on reset."}, + {1120, "EDC8120I", "Connection ended abnormally."}, + {1121, "EDC8121I", "Connection reset."}, + {1122, "EDC8122I", "No buffer space available."}, + {1123, "EDC8123I", "Socket already connected."}, + {1124, "EDC8124I", "Socket not connected."}, + {1125, "EDC8125I", "Can't send after socket shutdown."}, + {1126, "EDC8126I", "Too many references; can't splice."}, + {1127, "EDC8127I", "Connection timed out."}, + {1128, "EDC8128I", "Connection refused."}, + {1129, "EDC8129I", "Host is not available."}, + {1130, "EDC8130I", "Host cannot be reached."}, + {1131, "EDC8131I", "Too many processes."}, + {1132, "EDC8132I", "Too many users."}, + {1133, "EDC8133I", "Disk quota exceeded."}, + {1134, "EDC8134I", "Stale file handle."}, + {1135, "", ""}, + {1136, "EDC8136I", "File is not a STREAM."}, + {1137, "EDC8137I", "STREAMS ioctl() timeout."}, + {1138, "EDC8138I", "No STREAMS resources."}, + {1139, "EDC8139I", "The message identified by set_id and msg_id is not in the message catalog."}, + {1140, "EDC8140I", "Bad message."}, + {1141, "EDC8141I", "Identifier removed."}, + {1142, "", ""}, + {1143, "", ""}, + {1144, "EDC8144I", "The link has been severed."}, + {1145, "", ""}, + {1146, "", ""}, + {1147, "", ""}, + {1148, "EDC8148I", "Protocol error."}, + {1149, "EDC8149I", "Multihop not allowed."}, + {1150, "", ""}, + {1151, "", ""}, + {1152, "EDC8152I", "The asynchronous I/O request has been canceled."}, + {1159, "EDC8159I", "Function call was interrupted before any data was received."}, + {1160, "EDC8160I", "Socket reuse is not supported."}, + {1161, "EDC8161I", "The file system cannot currently be moved."}, +} + +// Signal table +var signalList = [...]struct { + num Signal + name string + desc string +}{ + {1, "SIGHUP", "hangup"}, + {2, "SIGINT", "interrupt"}, + {3, "SIGABT", "aborted"}, + {4, "SIGILL", "illegal instruction"}, + {5, "SIGPOLL", "pollable event"}, + {6, "SIGURG", "urgent I/O condition"}, + {7, "SIGSTOP", "stop process"}, + {8, "SIGFPE", "floating point exception"}, + {9, "SIGKILL", "killed"}, + {10, "SIGBUS", "bus error"}, + {11, "SIGSEGV", "segmentation fault"}, + {12, "SIGSYS", "bad argument to routine"}, + {13, "SIGPIPE", "broken pipe"}, + {14, "SIGALRM", "alarm clock"}, + {15, "SIGTERM", "terminated"}, + {16, "SIGUSR1", "user defined signal 1"}, + {17, "SIGUSR2", "user defined signal 2"}, + {18, "SIGABND", "abend"}, + {19, "SIGCONT", "continued"}, + {20, "SIGCHLD", "child exited"}, + {21, "SIGTTIN", "stopped (tty input)"}, + {22, "SIGTTOU", "stopped (tty output)"}, + {23, "SIGIO", "I/O possible"}, + {24, "SIGQUIT", "quit"}, + {25, "SIGTSTP", "stopped"}, + {26, "SIGTRAP", "trace/breakpoint trap"}, + {27, "SIGIOER", "I/O error"}, + {28, "SIGWINCH", "window changed"}, + {29, "SIGXCPU", "CPU time limit exceeded"}, + {30, "SIGXFSZ", "file size limit exceeded"}, + {31, "SIGVTALRM", "virtual timer expired"}, + {32, "SIGPROF", "profiling timer expired"}, + {33, "SIGDANGER", "danger"}, + {34, "SIGTHSTOP", "stop thread"}, + {35, "SIGTHCONT", "continue thread"}, + {37, "SIGTRACE", "trace"}, + {38, "", "DCE"}, + {39, "SIGDUMP", "dump"}, +} diff --git a/vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go b/vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go index 89c5920e0c..bd001a6e1c 100644 --- a/vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go +++ b/vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go @@ -1,5 +1,6 @@ // Code generated by linux/mkall.go generatePtracePair("arm", "arm64"). DO NOT EDIT. +//go:build linux && (arm || arm64) // +build linux // +build arm arm64 diff --git a/vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go b/vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go index 24b841eec5..c34d0639be 100644 --- a/vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go +++ b/vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go @@ -1,5 +1,6 @@ // Code generated by linux/mkall.go generatePtracePair("mips", "mips64"). DO NOT EDIT. +//go:build linux && (mips || mips64) // +build linux // +build mips mips64 diff --git a/vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go b/vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go index 47b0489565..3ccf0c0c4a 100644 --- a/vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go +++ b/vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go @@ -1,5 +1,6 @@ // Code generated by linux/mkall.go generatePtracePair("mipsle", "mips64le"). DO NOT EDIT. +//go:build linux && (mipsle || mips64le) // +build linux // +build mipsle mips64le diff --git a/vendor/golang.org/x/sys/unix/zptrace_x86_linux.go b/vendor/golang.org/x/sys/unix/zptrace_x86_linux.go index ea5d9cb536..7d65857004 100644 --- a/vendor/golang.org/x/sys/unix/zptrace_x86_linux.go +++ b/vendor/golang.org/x/sys/unix/zptrace_x86_linux.go @@ -1,5 +1,6 @@ // Code generated by linux/mkall.go generatePtracePair("386", "amd64"). DO NOT EDIT. +//go:build linux && (386 || amd64) // +build linux // +build 386 amd64 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go index ed657ff1bc..91a23cc728 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go @@ -1,6 +1,7 @@ // go run mksyscall_aix_ppc.go -aix -tags aix,ppc syscall_aix.go syscall_aix_ppc.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build aix && ppc // +build aix,ppc package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go index 664b293b43..33c2609b8b 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go @@ -1,6 +1,7 @@ // go run mksyscall_aix_ppc64.go -aix -tags aix,ppc64 syscall_aix.go syscall_aix_ppc64.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build aix && ppc64 // +build aix,ppc64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go index 0550da06d1..8b737fa971 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go @@ -1,8 +1,8 @@ // go run mksyscall_aix_ppc64.go -aix -tags aix,ppc64 syscall_aix.go syscall_aix_ppc64.go // Code generated by the command above; see README.md. DO NOT EDIT. -// +build aix,ppc64 -// +build gc +//go:build aix && ppc64 && gc +// +build aix,ppc64,gc package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go index cde4dbc5f5..3c260917ed 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go @@ -1,8 +1,8 @@ // go run mksyscall_aix_ppc64.go -aix -tags aix,ppc64 syscall_aix.go syscall_aix_ppc64.go // Code generated by the command above; see README.md. DO NOT EDIT. -// +build aix,ppc64 -// +build gccgo +//go:build aix && ppc64 && gccgo +// +build aix,ppc64,gccgo package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.go index c8c142c59a..48a62e3906 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.go @@ -1,6 +1,7 @@ // go run mksyscall.go -l32 -tags darwin,386,go1.13 syscall_darwin.1_13.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build darwin && 386 && go1.13 // +build darwin,386,go1.13 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go index 7f0f117d32..a266636af6 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go @@ -1,6 +1,7 @@ // go run mksyscall.go -l32 -tags darwin,386,go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_386.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build darwin && 386 && go1.12 // +build darwin,386,go1.12 package unix @@ -462,10 +463,8 @@ func libc_munlockall_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pipe() (r int, w int, err error) { - r0, r1, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), 0, 0, 0) - r = int(r0) - w = int(r1) +func pipe(p *[2]int32) (err error) { + _, _, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), uintptr(unsafe.Pointer(p)), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -2381,7 +2380,7 @@ func libc_lstat64_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { +func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) { _, _, e1 := syscall_syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go index 8882623613..e36299ead0 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go @@ -1,6 +1,7 @@ // go run mksyscall.go -tags darwin,amd64,go1.13 syscall_darwin.1_13.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build darwin && amd64 && go1.13 // +build darwin,amd64,go1.13 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go index 2daf0bd628..f411162882 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go @@ -1,6 +1,7 @@ // go run mksyscall.go -tags darwin,amd64,go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build darwin && amd64 && go1.12 // +build darwin,amd64,go1.12 package unix @@ -462,10 +463,8 @@ func libc_munlockall_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pipe() (r int, w int, err error) { - r0, r1, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), 0, 0, 0) - r = int(r0) - w = int(r1) +func pipe(p *[2]int32) (err error) { + _, _, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), uintptr(unsafe.Pointer(p)), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -2381,7 +2380,7 @@ func libc_lstat64_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { +func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) { _, _, e1 := syscall_syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.go index de4738fff8..ed437f89a9 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.go @@ -1,6 +1,7 @@ // go run mksyscall.go -l32 -tags darwin,arm,go1.13 syscall_darwin.1_13.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build darwin && arm && go1.13 // +build darwin,arm,go1.13 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go index 8e79ad377b..7f88cb5ea2 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go @@ -1,6 +1,7 @@ // go run mksyscall.go -l32 -tags darwin,arm,go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_arm.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build darwin && arm && go1.12 // +build darwin,arm,go1.12 package unix @@ -462,10 +463,8 @@ func libc_munlockall_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pipe() (r int, w int, err error) { - r0, r1, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), 0, 0, 0) - r = int(r0) - w = int(r1) +func pipe(p *[2]int32) (err error) { + _, _, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), uintptr(unsafe.Pointer(p)), 0, 0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go index 870eb37abf..d30ec4e29a 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go @@ -1,6 +1,7 @@ // go run mksyscall.go -tags darwin,arm64,go1.13 syscall_darwin.1_13.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build darwin && arm64 && go1.13 // +build darwin,arm64,go1.13 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go index 23be592a9f..a10df58d00 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go @@ -1,6 +1,7 @@ // go run mksyscall.go -tags darwin,arm64,go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_arm64.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build darwin && arm64 && go1.12 // +build darwin,arm64,go1.12 package unix @@ -462,10 +463,8 @@ func libc_munlockall_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pipe() (r int, w int, err error) { - r0, r1, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), 0, 0, 0) - r = int(r0) - w = int(r1) +func pipe(p *[2]int32) (err error) { + _, _, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), uintptr(unsafe.Pointer(p)), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -2381,7 +2380,7 @@ func libc_lstat_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { +func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) { _, _, e1 := syscall_syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go index 1aaccd3615..1b6eedfa61 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go @@ -1,6 +1,7 @@ // go run mksyscall.go -dragonfly -tags dragonfly,amd64 syscall_bsd.go syscall_dragonfly.go syscall_dragonfly_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build dragonfly && amd64 // +build dragonfly,amd64 package unix @@ -362,8 +363,10 @@ func pipe() (r int, w int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pipe2(p *[2]_C_int, flags int) (err error) { - _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) +func pipe2(p *[2]_C_int, flags int) (r int, w int, err error) { + r0, r1, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) + r = int(r0) + w = int(r1) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go index 600f1d26d2..3e9bddb7b2 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go @@ -1,6 +1,7 @@ // go run mksyscall.go -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build freebsd && 386 // +build freebsd,386 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go index 064934b0d1..c72a462b91 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go @@ -1,6 +1,7 @@ // go run mksyscall.go -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build freebsd && amd64 // +build freebsd,amd64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go index 31d2c46165..530d5df90c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go @@ -1,6 +1,7 @@ // go run mksyscall.go -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build freebsd && arm // +build freebsd,arm package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go index 4adaaa5618..71e7df9e85 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go @@ -1,6 +1,7 @@ // go run mksyscall.go -tags freebsd,arm64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm64.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build freebsd && arm64 // +build freebsd,arm64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go index d3af083f4e..af5cb064ec 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go @@ -1,6 +1,7 @@ // go run mksyscall_solaris.go -illumos -tags illumos,amd64 syscall_illumos.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build illumos && amd64 // +build illumos,amd64 package unix @@ -14,14 +15,16 @@ import ( //go:cgo_import_dynamic libc_writev writev "libc.so" //go:cgo_import_dynamic libc_pwritev pwritev "libc.so" //go:cgo_import_dynamic libc_accept4 accept4 "libsocket.so" -//go:cgo_import_dynamic libc_pipe2 pipe2 "libc.so" +//go:cgo_import_dynamic libc_putmsg putmsg "libc.so" +//go:cgo_import_dynamic libc_getmsg getmsg "libc.so" //go:linkname procreadv libc_readv //go:linkname procpreadv libc_preadv //go:linkname procwritev libc_writev //go:linkname procpwritev libc_pwritev //go:linkname procaccept4 libc_accept4 -//go:linkname procpipe2 libc_pipe2 +//go:linkname procputmsg libc_putmsg +//go:linkname procgetmsg libc_getmsg var ( procreadv, @@ -29,7 +32,8 @@ var ( procwritev, procpwritev, procaccept4, - procpipe2 syscallFunc + procputmsg, + procgetmsg syscallFunc ) // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT @@ -105,8 +109,18 @@ func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pipe2(p *[2]_C_int, flags int) (err error) { - _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procpipe2)), 2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0, 0, 0, 0) +func putmsg(fd int, clptr *strbuf, dataptr *strbuf, flags int) (err error) { + _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procputmsg)), 4, uintptr(fd), uintptr(unsafe.Pointer(clptr)), uintptr(unsafe.Pointer(dataptr)), uintptr(flags), 0, 0) + if e1 != 0 { + err = e1 + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getmsg(fd int, clptr *strbuf, dataptr *strbuf, flags *int) (err error) { + _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetmsg)), 4, uintptr(fd), uintptr(unsafe.Pointer(clptr)), uintptr(unsafe.Pointer(dataptr)), uintptr(unsafe.Pointer(flags)), 0, 0) if e1 != 0 { err = e1 } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go index 2fbbbe5a89..7305cc915b 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -1,5 +1,6 @@ // Code generated by mkmerge.go; DO NOT EDIT. +//go:build linux // +build linux package unix @@ -531,6 +532,16 @@ func Close(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func CloseRange(first uint, last uint, flags uint) (err error) { + _, _, e1 := Syscall(SYS_CLOSE_RANGE, uintptr(first), uintptr(last), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go index 19ebd3ff75..e37096e4de 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go @@ -1,6 +1,7 @@ // go run mksyscall.go -l32 -tags linux,386 syscall_linux.go syscall_linux_386.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build linux && 386 // +build linux,386 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go index 5c562182a1..9919d8486d 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go @@ -1,6 +1,7 @@ // go run mksyscall.go -tags linux,amd64 syscall_linux.go syscall_linux_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build linux && amd64 // +build linux,amd64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go index dc69d99c61..076754d48d 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go @@ -1,6 +1,7 @@ // go run mksyscall.go -l32 -arm -tags linux,arm syscall_linux.go syscall_linux_arm.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build linux && arm // +build linux,arm package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go index 1b897dee05..e893f987f9 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go @@ -1,6 +1,7 @@ // go run mksyscall.go -tags linux,arm64 syscall_linux.go syscall_linux_arm64.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build linux && arm64 // +build linux,arm64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go index 49186843ae..4703cf3c33 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go @@ -1,6 +1,7 @@ // go run mksyscall.go -b32 -arm -tags linux,mips syscall_linux.go syscall_linux_mipsx.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build linux && mips // +build linux,mips package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go index 9171d3bd2a..a134f9a4d2 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go @@ -1,6 +1,7 @@ // go run mksyscall.go -tags linux,mips64 syscall_linux.go syscall_linux_mips64x.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build linux && mips64 // +build linux,mips64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go index 82286f04f9..b1fff2d946 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go @@ -1,6 +1,7 @@ // go run mksyscall.go -tags linux,mips64le syscall_linux.go syscall_linux_mips64x.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build linux && mips64le // +build linux,mips64le package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go index 15920621c4..d13d6da01e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go @@ -1,6 +1,7 @@ // go run mksyscall.go -l32 -arm -tags linux,mipsle syscall_linux.go syscall_linux_mipsx.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build linux && mipsle // +build linux,mipsle package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go index 73a42e2ccb..da8ec03966 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go @@ -1,6 +1,7 @@ // go run mksyscall.go -tags linux,ppc64 syscall_linux.go syscall_linux_ppc64x.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build linux && ppc64 // +build linux,ppc64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go index 6b85595366..083f493bb6 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go @@ -1,6 +1,7 @@ // go run mksyscall.go -tags linux,ppc64le syscall_linux.go syscall_linux_ppc64x.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build linux && ppc64le // +build linux,ppc64le package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go index b76133447e..63b393b802 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go @@ -1,6 +1,7 @@ // go run mksyscall.go -tags linux,riscv64 syscall_linux.go syscall_linux_riscv64.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build linux && riscv64 // +build linux,riscv64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go index d7032ab1e4..bb347407d3 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go @@ -1,6 +1,7 @@ // go run mksyscall.go -tags linux,s390x syscall_linux.go syscall_linux_s390x.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build linux && s390x // +build linux,s390x package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go index bcbbdd906e..8edc517e1e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go @@ -1,6 +1,7 @@ // go run mksyscall.go -tags linux,sparc64 syscall_linux.go syscall_linux_sparc64.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build linux && sparc64 // +build linux,sparc64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go index 3bbd9e39cd..4726ab30a8 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go @@ -1,6 +1,7 @@ // go run mksyscall.go -l32 -netbsd -tags netbsd,386 syscall_bsd.go syscall_netbsd.go syscall_netbsd_386.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build netbsd && 386 // +build netbsd,386 package unix @@ -362,6 +363,16 @@ func pipe() (fd1 int, fd2 int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func pipe2(p *[2]_C_int, flags int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go index d8cf5012c2..fe71456dbc 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go @@ -1,6 +1,7 @@ // go run mksyscall.go -netbsd -tags netbsd,amd64 syscall_bsd.go syscall_netbsd.go syscall_netbsd_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build netbsd && amd64 // +build netbsd,amd64 package unix @@ -362,6 +363,16 @@ func pipe() (fd1 int, fd2 int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func pipe2(p *[2]_C_int, flags int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go index 1153fe69b8..0b5b2f0143 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go @@ -1,6 +1,7 @@ // go run mksyscall.go -l32 -netbsd -arm -tags netbsd,arm syscall_bsd.go syscall_netbsd.go syscall_netbsd_arm.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build netbsd && arm // +build netbsd,arm package unix @@ -362,6 +363,16 @@ func pipe() (fd1 int, fd2 int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func pipe2(p *[2]_C_int, flags int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go index 24b4ebb41f..bfca28648f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go @@ -1,6 +1,7 @@ // go run mksyscall.go -netbsd -tags netbsd,arm64 syscall_bsd.go syscall_netbsd.go syscall_netbsd_arm64.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build netbsd && arm64 // +build netbsd,arm64 package unix @@ -362,6 +363,16 @@ func pipe() (fd1 int, fd2 int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func pipe2(p *[2]_C_int, flags int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index b44b31aeb1..8f80f4ade5 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -1,6 +1,7 @@ // go run mksyscall.go -l32 -openbsd -tags openbsd,386 syscall_bsd.go syscall_openbsd.go syscall_openbsd_386.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build openbsd && 386 // +build openbsd,386 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index 67f93ee76d..3a47aca7bf 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -1,6 +1,7 @@ // go run mksyscall.go -openbsd -tags openbsd,amd64 syscall_bsd.go syscall_openbsd.go syscall_openbsd_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build openbsd && amd64 // +build openbsd,amd64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index d7c878b1d0..883a9b45e8 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -1,6 +1,7 @@ // go run mksyscall.go -l32 -openbsd -arm -tags openbsd,arm syscall_bsd.go syscall_openbsd.go syscall_openbsd_arm.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build openbsd && arm // +build openbsd,arm package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go index 8facd695d5..aac7fdc95e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -1,6 +1,7 @@ // go run mksyscall.go -openbsd -tags openbsd,arm64 syscall_bsd.go syscall_openbsd.go syscall_openbsd_arm64.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build openbsd && arm64 // +build openbsd,arm64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go index ec6bd5bb73..8776187462 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go @@ -1,6 +1,7 @@ // go run mksyscall.go -openbsd -tags openbsd,mips64 syscall_bsd.go syscall_openbsd.go syscall_openbsd_mips64.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build openbsd && mips64 // +build openbsd,mips64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go index a96165d4bf..4e18d5c99f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go @@ -1,6 +1,7 @@ // go run mksyscall_solaris.go -tags solaris,amd64 syscall_solaris.go syscall_solaris_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build solaris && amd64 // +build solaris,amd64 package unix @@ -11,6 +12,7 @@ import ( ) //go:cgo_import_dynamic libc_pipe pipe "libc.so" +//go:cgo_import_dynamic libc_pipe2 pipe2 "libc.so" //go:cgo_import_dynamic libc_getsockname getsockname "libsocket.so" //go:cgo_import_dynamic libc_getcwd getcwd "libc.so" //go:cgo_import_dynamic libc_getgroups getgroups "libc.so" @@ -114,6 +116,7 @@ import ( //go:cgo_import_dynamic libc_statvfs statvfs "libc.so" //go:cgo_import_dynamic libc_symlink symlink "libc.so" //go:cgo_import_dynamic libc_sync sync "libc.so" +//go:cgo_import_dynamic libc_sysconf sysconf "libc.so" //go:cgo_import_dynamic libc_times times "libc.so" //go:cgo_import_dynamic libc_truncate truncate "libc.so" //go:cgo_import_dynamic libc_fsync fsync "libc.so" @@ -140,6 +143,7 @@ import ( //go:cgo_import_dynamic libc_recvfrom recvfrom "libsocket.so" //go:linkname procpipe libc_pipe +//go:linkname procpipe2 libc_pipe2 //go:linkname procgetsockname libc_getsockname //go:linkname procGetcwd libc_getcwd //go:linkname procgetgroups libc_getgroups @@ -243,6 +247,7 @@ import ( //go:linkname procStatvfs libc_statvfs //go:linkname procSymlink libc_symlink //go:linkname procSync libc_sync +//go:linkname procSysconf libc_sysconf //go:linkname procTimes libc_times //go:linkname procTruncate libc_truncate //go:linkname procFsync libc_fsync @@ -270,6 +275,7 @@ import ( var ( procpipe, + procpipe2, procgetsockname, procGetcwd, procgetgroups, @@ -373,6 +379,7 @@ var ( procStatvfs, procSymlink, procSync, + procSysconf, procTimes, procTruncate, procFsync, @@ -412,6 +419,16 @@ func pipe(p *[2]_C_int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func pipe2(p *[2]_C_int, flags int) (err error) { + _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procpipe2)), 2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0, 0, 0, 0) + if e1 != 0 { + err = e1 + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetsockname)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) if e1 != 0 { @@ -602,8 +619,9 @@ func __minor(version int, dev uint64) (val uint) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func ioctl(fd int, req uint, arg uintptr) (err error) { - _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procioctl)), 3, uintptr(fd), uintptr(req), uintptr(arg), 0, 0, 0) +func ioctlRet(fd int, req uint, arg uintptr) (ret int, err error) { + r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procioctl)), 3, uintptr(fd), uintptr(req), uintptr(arg), 0, 0, 0) + ret = int(r0) if e1 != 0 { err = e1 } @@ -1674,6 +1692,17 @@ func Sync() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Sysconf(which int) (n int64, err error) { + r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSysconf)), 1, uintptr(which), 0, 0, 0, 0, 0) + n = int64(r0) + if e1 != 0 { + err = e1 + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Times(tms *Tms) (ticks uintptr, err error) { r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procTimes)), 1, uintptr(unsafe.Pointer(tms)), 0, 0, 0, 0, 0) ticks = uintptr(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go b/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go new file mode 100644 index 0000000000..8285ab8419 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go @@ -0,0 +1,1217 @@ +// go run mksyscall.go -tags zos,s390x syscall_zos_s390x.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +//go:build zos && s390x +// +build zos,s390x + +package unix + +import ( + "unsafe" +) + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := syscall_syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func read(fd int, p []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func readlen(fd int, buf *byte, nbuf int) (n int, err error) { + r0, _, e1 := syscall_syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func write(fd int, p []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { + r0, _, e1 := syscall_syscall(SYS___ACCEPT_A, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, _, e1 := syscall_syscall(SYS___BIND_A, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, _, e1 := syscall_syscall(SYS___CONNECT_A, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getgroups(n int, list *_Gid_t) (nn int, err error) { + r0, _, e1 := syscall_rawsyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + nn = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setgroups(n int, list *_Gid_t) (err error) { + _, _, e1 := syscall_rawsyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { + _, _, e1 := syscall_syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { + _, _, e1 := syscall_syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socket(domain int, typ int, proto int) (fd int, err error) { + r0, _, e1 := syscall_rawsyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { + _, _, e1 := syscall_rawsyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, _, e1 := syscall_rawsyscall(SYS___GETPEERNAME_A, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, _, e1 := syscall_rawsyscall(SYS___GETSOCKNAME_A, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(SYS___RECVFROM_A, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := syscall_syscall6(SYS___SENDTO_A, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := syscall_syscall(SYS___RECVMSG_A, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := syscall_syscall(SYS___SENDMSG_A, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { + r0, _, e1 := syscall_syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) + ret = uintptr(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func munmap(addr uintptr, length uintptr) (err error) { + _, _, e1 := syscall_syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ioctl(fd int, req uint, arg uintptr) (err error) { + _, _, e1 := syscall_syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Access(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___ACCESS_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chdir(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___CHDIR_A, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chown(path string, uid int, gid int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___CHOWN_A, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chmod(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___CHMOD_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Creat(path string, mode uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := syscall_syscall(SYS___CREAT_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup(oldfd int) (fd int, err error) { + r0, _, e1 := syscall_syscall(SYS_DUP, uintptr(oldfd), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup2(oldfd int, newfd int) (err error) { + _, _, e1 := syscall_syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Exit(code int) { + syscall_syscall(SYS_EXIT, uintptr(code), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchdir(fd int) (err error) { + _, _, e1 := syscall_syscall(SYS_FCHDIR, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchmod(fd int, mode uint32) (err error) { + _, _, e1 := syscall_syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchown(fd int, uid int, gid int) (err error) { + _, _, e1 := syscall_syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FcntlInt(fd uintptr, cmd int, arg int) (retval int, err error) { + r0, _, e1 := syscall_syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + retval = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstat(fd int, stat *Stat_LE_t) (err error) { + _, _, e1 := syscall_syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatvfs(fd int, stat *Statvfs_t) (err error) { + _, _, e1 := syscall_syscall(SYS_FSTATVFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsync(fd int) (err error) { + _, _, e1 := syscall_syscall(SYS_FSYNC, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Ftruncate(fd int, length int64) (err error) { + _, _, e1 := syscall_syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpagesize() (pgsize int) { + r0, _, _ := syscall_syscall(SYS_GETPAGESIZE, 0, 0, 0) + pgsize = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mprotect(b []byte, prot int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := syscall_syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Msync(b []byte, flags int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := syscall_syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Poll(fds []PollFd, timeout int) (n int, err error) { + var _p0 unsafe.Pointer + if len(fds) > 0 { + _p0 = unsafe.Pointer(&fds[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(SYS_POLL, uintptr(_p0), uintptr(len(fds)), uintptr(timeout)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Times(tms *Tms) (ticks uintptr, err error) { + r0, _, e1 := syscall_syscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) + ticks = uintptr(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func W_Getmntent(buff *byte, size int) (lastsys int, err error) { + r0, _, e1 := syscall_syscall(SYS_W_GETMNTENT, uintptr(unsafe.Pointer(buff)), uintptr(size), 0) + lastsys = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mount(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(filesystem) + if err != nil { + return + } + var _p2 *byte + _p2, err = BytePtrFromString(fstype) + if err != nil { + return + } + var _p3 *byte + _p3, err = BytePtrFromString(parm) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(SYS___MOUNT_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(mtm), uintptr(parmlen), uintptr(unsafe.Pointer(_p3))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unmount(filesystem string, mtm int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(filesystem) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___UMOUNT_A, uintptr(unsafe.Pointer(_p0)), uintptr(mtm), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chroot(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___CHROOT_A, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Uname(buf *Utsname) (err error) { + _, _, e1 := syscall_rawsyscall(SYS___UNAME_A, uintptr(unsafe.Pointer(buf)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Gethostname(buf []byte) (err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := syscall_syscall(SYS___GETHOSTNAME_A, uintptr(_p0), uintptr(len(buf)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getegid() (egid int) { + r0, _, _ := syscall_rawsyscall(SYS_GETEGID, 0, 0, 0) + egid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Geteuid() (uid int) { + r0, _, _ := syscall_rawsyscall(SYS_GETEUID, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getgid() (gid int) { + r0, _, _ := syscall_rawsyscall(SYS_GETGID, 0, 0, 0) + gid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpid() (pid int) { + r0, _, _ := syscall_rawsyscall(SYS_GETPID, 0, 0, 0) + pid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpgid(pid int) (pgid int, err error) { + r0, _, e1 := syscall_rawsyscall(SYS_GETPGID, uintptr(pid), 0, 0) + pgid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getppid() (pid int) { + r0, _, _ := syscall_rawsyscall(SYS_GETPPID, 0, 0, 0) + pid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpriority(which int, who int) (prio int, err error) { + r0, _, e1 := syscall_syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) + prio = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrlimit(resource int, rlim *Rlimit) (err error) { + _, _, e1 := syscall_rawsyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getrusage(who int, rusage *rusage_zos) (err error) { + _, _, e1 := syscall_rawsyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getsid(pid int) (sid int, err error) { + r0, _, e1 := syscall_rawsyscall(SYS_GETSID, uintptr(pid), 0, 0) + sid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getuid() (uid int) { + r0, _, _ := syscall_rawsyscall(SYS_GETUID, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Kill(pid int, sig Signal) (err error) { + _, _, e1 := syscall_rawsyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lchown(path string, uid int, gid int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___LCHOWN_A, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Link(path string, link string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___LINK_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Listen(s int, n int) (err error) { + _, _, e1 := syscall_syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func lstat(path string, stat *Stat_LE_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___LSTAT_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkdir(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___MKDIR_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkfifo(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___MKFIFO_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mknod(path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___MKNOD_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pread(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pwrite(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Readlink(path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(SYS___READLINK_A, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Rename(from string, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___RENAME_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Rmdir(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___RMDIR_A, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Seek(fd int, offset int64, whence int) (off int64, err error) { + r0, _, e1 := syscall_syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) + off = int64(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpriority(which int, who int, prio int) (err error) { + _, _, e1 := syscall_syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpgid(pid int, pgid int) (err error) { + _, _, e1 := syscall_rawsyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setrlimit(resource int, lim *Rlimit) (err error) { + _, _, e1 := syscall_rawsyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(lim)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setregid(rgid int, egid int) (err error) { + _, _, e1 := syscall_rawsyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setreuid(ruid int, euid int) (err error) { + _, _, e1 := syscall_rawsyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setsid() (pid int, err error) { + r0, _, e1 := syscall_rawsyscall(SYS_SETSID, 0, 0, 0) + pid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setuid(uid int) (err error) { + _, _, e1 := syscall_syscall(SYS_SETUID, uintptr(uid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setgid(uid int) (err error) { + _, _, e1 := syscall_syscall(SYS_SETGID, uintptr(uid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Shutdown(fd int, how int) (err error) { + _, _, e1 := syscall_syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func stat(path string, statLE *Stat_LE_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___STAT_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(statLE)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Symlink(path string, link string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___SYMLINK_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Sync() { + syscall_syscall(SYS_SYNC, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Truncate(path string, length int64) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___TRUNCATE_A, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Tcgetattr(fildes int, termptr *Termios) (err error) { + _, _, e1 := syscall_syscall(SYS_TCGETATTR, uintptr(fildes), uintptr(unsafe.Pointer(termptr)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Tcsetattr(fildes int, when int, termptr *Termios) (err error) { + _, _, e1 := syscall_syscall(SYS_TCSETATTR, uintptr(fildes), uintptr(when), uintptr(unsafe.Pointer(termptr))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Umask(mask int) (oldmask int) { + r0, _, _ := syscall_syscall(SYS_UMASK, uintptr(mask), 0, 0) + oldmask = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unlink(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___UNLINK_A, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Utime(path string, utim *Utimbuf) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___UTIME_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(utim)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func open(path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := syscall_syscall(SYS___OPEN_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func remove(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS_REMOVE, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func waitpid(pid int, wstatus *_C_int, options int) (wpid int, err error) { + r0, _, e1 := syscall_syscall(SYS_WAITPID, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options)) + wpid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func gettimeofday(tv *timeval_zos) (err error) { + _, _, e1 := syscall_rawsyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pipe(p *[2]_C_int) (err error) { + _, _, e1 := syscall_rawsyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func utimes(path string, timeval *[2]Timeval) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(SYS___UTIMES_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go index 102f1ab475..9e9d0b2a9c 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go @@ -1,6 +1,7 @@ // go run mksysctl_openbsd.go // Code generated by the command above; DO NOT EDIT. +//go:build 386 && openbsd // +build 386,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go index 4866fced8a..adecd09667 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go @@ -1,6 +1,7 @@ // go run mksysctl_openbsd.go // Code generated by the command above; DO NOT EDIT. +//go:build amd64 && openbsd // +build amd64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go index d3801eb24b..8ea52a4a18 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go @@ -1,6 +1,7 @@ // go run mksysctl_openbsd.go // Code generated by the command above; DO NOT EDIT. +//go:build arm && openbsd // +build arm,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go index ba4304fd23..154b57ae3e 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go @@ -1,6 +1,7 @@ // go run mksysctl_openbsd.go // Code generated by the command above; DO NOT EDIT. +//go:build arm64 && openbsd // +build arm64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go index aca34b3493..d96bb2ba4d 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go @@ -1,6 +1,7 @@ // go run mksysctl_openbsd.go // Code generated by the command above; DO NOT EDIT. +//go:build mips64 && openbsd // +build mips64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go b/vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go index ad62324c7c..1794ffc924 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go @@ -1,6 +1,7 @@ // go run mksysnum.go /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/sys/syscall.h // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build 386 && darwin // +build 386,darwin package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go index a2fc91d6a8..f8298ff9b5 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go @@ -1,6 +1,7 @@ // go run mksysnum.go /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/sys/syscall.h // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && darwin // +build amd64,darwin package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go index 20d7808ace..6dc736449a 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go @@ -1,6 +1,7 @@ // go run mksysnum.go /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk/usr/include/sys/syscall.h // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm && darwin // +build arm,darwin package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go index 527b9588cc..5eb433bbf0 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go @@ -1,6 +1,7 @@ // go run mksysnum.go /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk/usr/include/sys/syscall.h // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm64 && darwin // +build arm64,darwin package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go index 9912c6ee3d..703675c0c4 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go @@ -1,6 +1,7 @@ // go run mksysnum.go https://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && dragonfly // +build amd64,dragonfly package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go index 9474974b65..59d5dfc209 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go @@ -1,6 +1,7 @@ // go run mksysnum.go https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build 386 && freebsd // +build 386,freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go index 48a7beae7b..342d471d2e 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go @@ -1,6 +1,7 @@ // go run mksysnum.go https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && freebsd // +build amd64,freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go index 4a6dfd4a74..e2e3d72c5b 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go @@ -1,6 +1,7 @@ // go run mksysnum.go https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm && freebsd // +build arm,freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go index 3e51af8edd..61ad5ca3c1 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go @@ -1,6 +1,7 @@ // go run mksysnum.go https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm64 && freebsd // +build arm64,freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index f6742bdee0..8e53597134 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -1,6 +1,7 @@ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include -m32 /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build 386 && linux // +build 386,linux package unix @@ -436,4 +437,5 @@ const ( SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 + SYS_EPOLL_PWAIT2 = 441 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index f7e525573b..d7dceb769b 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -1,6 +1,7 @@ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include -m64 /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && linux // +build amd64,linux package unix @@ -358,4 +359,5 @@ const ( SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 + SYS_EPOLL_PWAIT2 = 441 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index 3f60977da6..04093a69fd 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -1,6 +1,7 @@ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm && linux // +build arm,linux package unix @@ -400,4 +401,5 @@ const ( SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 + SYS_EPOLL_PWAIT2 = 441 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index dbedf4cbac..48f94f135d 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -1,6 +1,7 @@ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include -fsigned-char /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm64 && linux // +build arm64,linux package unix @@ -303,4 +304,5 @@ const ( SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 + SYS_EPOLL_PWAIT2 = 441 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index eeff7e1dc9..499978c3e4 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -1,6 +1,7 @@ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build mips && linux // +build mips,linux package unix @@ -421,4 +422,5 @@ const ( SYS_PIDFD_GETFD = 4438 SYS_FACCESSAT2 = 4439 SYS_PROCESS_MADVISE = 4440 + SYS_EPOLL_PWAIT2 = 4441 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index 73cfa535cd..10d1db2be0 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -1,6 +1,7 @@ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build mips64 && linux // +build mips64,linux package unix @@ -351,4 +352,5 @@ const ( SYS_PIDFD_GETFD = 5438 SYS_FACCESSAT2 = 5439 SYS_PROCESS_MADVISE = 5440 + SYS_EPOLL_PWAIT2 = 5441 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index be74729e0c..208d5dcd5a 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -1,6 +1,7 @@ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build mips64le && linux // +build mips64le,linux package unix @@ -351,4 +352,5 @@ const ( SYS_PIDFD_GETFD = 5438 SYS_FACCESSAT2 = 5439 SYS_PROCESS_MADVISE = 5440 + SYS_EPOLL_PWAIT2 = 5441 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index 2a1047c818..f8250602eb 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -1,6 +1,7 @@ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build mipsle && linux // +build mipsle,linux package unix @@ -421,4 +422,5 @@ const ( SYS_PIDFD_GETFD = 4438 SYS_FACCESSAT2 = 4439 SYS_PROCESS_MADVISE = 4440 + SYS_EPOLL_PWAIT2 = 4441 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index 32707428ce..d5ed3ff510 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -1,6 +1,7 @@ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build ppc64 && linux // +build ppc64,linux package unix @@ -400,4 +401,5 @@ const ( SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 + SYS_EPOLL_PWAIT2 = 441 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index a58572f781..e29b4424c2 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -1,6 +1,7 @@ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build ppc64le && linux // +build ppc64le,linux package unix @@ -400,4 +401,5 @@ const ( SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 + SYS_EPOLL_PWAIT2 = 441 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go index 72a65b7602..41deed6c3a 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -1,6 +1,7 @@ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build riscv64 && linux // +build riscv64,linux package unix @@ -302,4 +303,5 @@ const ( SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 + SYS_EPOLL_PWAIT2 = 441 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index 1fb9ae5d49..8e53a9e8ce 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -1,6 +1,7 @@ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include -fsigned-char /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build s390x && linux // +build s390x,linux package unix @@ -365,4 +366,5 @@ const ( SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 + SYS_EPOLL_PWAIT2 = 441 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index 57636e09e4..596e5bc7d3 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -1,6 +1,7 @@ // go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build sparc64 && linux // +build sparc64,linux package unix @@ -379,4 +380,5 @@ const ( SYS_PIDFD_GETFD = 438 SYS_FACCESSAT2 = 439 SYS_PROCESS_MADVISE = 440 + SYS_EPOLL_PWAIT2 = 441 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go b/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go index e66a8c9d39..3a6699eba9 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go @@ -1,6 +1,7 @@ // go run mksysnum.go http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build 386 && netbsd // +build 386,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go index 42c788f249..5677cd4f15 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go @@ -1,6 +1,7 @@ // go run mksysnum.go http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && netbsd // +build amd64,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go index 0a0757179b..e784cb6db1 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go @@ -1,6 +1,7 @@ // go run mksysnum.go http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm && netbsd // +build arm,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go index 0291c0931b..bd4952efa5 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go @@ -1,6 +1,7 @@ // go run mksysnum.go http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; DO NOT EDIT. +//go:build arm64 && netbsd // +build arm64,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go index b0207d1c9b..817edbf95c 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go @@ -1,6 +1,7 @@ // go run mksysnum.go https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build 386 && openbsd // +build 386,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go index f0dec6f0b4..ea453614e6 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go @@ -1,6 +1,7 @@ // go run mksysnum.go https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && openbsd // +build amd64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go index 33d1dc5404..467971eed6 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go @@ -1,6 +1,7 @@ // go run mksysnum.go https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm && openbsd // +build arm,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go index fe2b689b63..32eec5ed56 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go @@ -1,6 +1,7 @@ // go run mksysnum.go https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm64 && openbsd // +build arm64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go index 5c08d573b3..a37f773756 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go @@ -1,6 +1,7 @@ // go run mksysnum.go https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build mips64 && openbsd // +build mips64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go new file mode 100644 index 0000000000..073daad43b --- /dev/null +++ b/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go @@ -0,0 +1,2670 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build zos && s390x +// +build zos,s390x + +package unix + +// TODO: auto-generate. + +const ( + SYS_ACOSD128 = 0xB80 + SYS_ACOSD32 = 0xB7E + SYS_ACOSD64 = 0xB7F + SYS_ACOSHD128 = 0xB83 + SYS_ACOSHD32 = 0xB81 + SYS_ACOSHD64 = 0xB82 + SYS_AIO_FSYNC = 0xC69 + SYS_ASCTIME = 0x0AE + SYS_ASCTIME64 = 0xCD7 + SYS_ASCTIME64_R = 0xCD8 + SYS_ASIND128 = 0xB86 + SYS_ASIND32 = 0xB84 + SYS_ASIND64 = 0xB85 + SYS_ASINHD128 = 0xB89 + SYS_ASINHD32 = 0xB87 + SYS_ASINHD64 = 0xB88 + SYS_ATAN2D128 = 0xB8F + SYS_ATAN2D32 = 0xB8D + SYS_ATAN2D64 = 0xB8E + SYS_ATAND128 = 0xB8C + SYS_ATAND32 = 0xB8A + SYS_ATAND64 = 0xB8B + SYS_ATANHD128 = 0xB92 + SYS_ATANHD32 = 0xB90 + SYS_ATANHD64 = 0xB91 + SYS_BIND2ADDRSEL = 0xD59 + SYS_C16RTOMB = 0xD40 + SYS_C32RTOMB = 0xD41 + SYS_CBRTD128 = 0xB95 + SYS_CBRTD32 = 0xB93 + SYS_CBRTD64 = 0xB94 + SYS_CEILD128 = 0xB98 + SYS_CEILD32 = 0xB96 + SYS_CEILD64 = 0xB97 + SYS_CLEARENV = 0x0C9 + SYS_CLEARERR_UNLOCKED = 0xCA1 + SYS_CLOCK = 0x0AA + SYS_CLOGL = 0xA00 + SYS_CLRMEMF = 0x0BD + SYS_CONJ = 0xA03 + SYS_CONJF = 0xA06 + SYS_CONJL = 0xA09 + SYS_COPYSIGND128 = 0xB9E + SYS_COPYSIGND32 = 0xB9C + SYS_COPYSIGND64 = 0xB9D + SYS_COSD128 = 0xBA1 + SYS_COSD32 = 0xB9F + SYS_COSD64 = 0xBA0 + SYS_COSHD128 = 0xBA4 + SYS_COSHD32 = 0xBA2 + SYS_COSHD64 = 0xBA3 + SYS_CPOW = 0xA0C + SYS_CPOWF = 0xA0F + SYS_CPOWL = 0xA12 + SYS_CPROJ = 0xA15 + SYS_CPROJF = 0xA18 + SYS_CPROJL = 0xA1B + SYS_CREAL = 0xA1E + SYS_CREALF = 0xA21 + SYS_CREALL = 0xA24 + SYS_CSIN = 0xA27 + SYS_CSINF = 0xA2A + SYS_CSINH = 0xA30 + SYS_CSINHF = 0xA33 + SYS_CSINHL = 0xA36 + SYS_CSINL = 0xA2D + SYS_CSNAP = 0x0C5 + SYS_CSQRT = 0xA39 + SYS_CSQRTF = 0xA3C + SYS_CSQRTL = 0xA3F + SYS_CTAN = 0xA42 + SYS_CTANF = 0xA45 + SYS_CTANH = 0xA4B + SYS_CTANHF = 0xA4E + SYS_CTANHL = 0xA51 + SYS_CTANL = 0xA48 + SYS_CTIME = 0x0AB + SYS_CTIME64 = 0xCD9 + SYS_CTIME64_R = 0xCDA + SYS_CTRACE = 0x0C6 + SYS_DIFFTIME = 0x0A7 + SYS_DIFFTIME64 = 0xCDB + SYS_DLADDR = 0xC82 + SYS_DYNALLOC = 0x0C3 + SYS_DYNFREE = 0x0C2 + SYS_ERFCD128 = 0xBAA + SYS_ERFCD32 = 0xBA8 + SYS_ERFCD64 = 0xBA9 + SYS_ERFD128 = 0xBA7 + SYS_ERFD32 = 0xBA5 + SYS_ERFD64 = 0xBA6 + SYS_EXP2D128 = 0xBB0 + SYS_EXP2D32 = 0xBAE + SYS_EXP2D64 = 0xBAF + SYS_EXPD128 = 0xBAD + SYS_EXPD32 = 0xBAB + SYS_EXPD64 = 0xBAC + SYS_EXPM1D128 = 0xBB3 + SYS_EXPM1D32 = 0xBB1 + SYS_EXPM1D64 = 0xBB2 + SYS_FABSD128 = 0xBB6 + SYS_FABSD32 = 0xBB4 + SYS_FABSD64 = 0xBB5 + SYS_FDELREC_UNLOCKED = 0xCA2 + SYS_FDIMD128 = 0xBB9 + SYS_FDIMD32 = 0xBB7 + SYS_FDIMD64 = 0xBB8 + SYS_FDOPEN_UNLOCKED = 0xCFC + SYS_FECLEAREXCEPT = 0xAEA + SYS_FEGETENV = 0xAEB + SYS_FEGETEXCEPTFLAG = 0xAEC + SYS_FEGETROUND = 0xAED + SYS_FEHOLDEXCEPT = 0xAEE + SYS_FEOF_UNLOCKED = 0xCA3 + SYS_FERAISEEXCEPT = 0xAEF + SYS_FERROR_UNLOCKED = 0xCA4 + SYS_FESETENV = 0xAF0 + SYS_FESETEXCEPTFLAG = 0xAF1 + SYS_FESETROUND = 0xAF2 + SYS_FETCHEP = 0x0BF + SYS_FETESTEXCEPT = 0xAF3 + SYS_FEUPDATEENV = 0xAF4 + SYS_FE_DEC_GETROUND = 0xBBA + SYS_FE_DEC_SETROUND = 0xBBB + SYS_FFLUSH_UNLOCKED = 0xCA5 + SYS_FGETC_UNLOCKED = 0xC80 + SYS_FGETPOS64 = 0xCEE + SYS_FGETPOS64_UNLOCKED = 0xCF4 + SYS_FGETPOS_UNLOCKED = 0xCA6 + SYS_FGETS_UNLOCKED = 0xC7C + SYS_FGETWC_UNLOCKED = 0xCA7 + SYS_FGETWS_UNLOCKED = 0xCA8 + SYS_FILENO_UNLOCKED = 0xCA9 + SYS_FLDATA = 0x0C1 + SYS_FLDATA_UNLOCKED = 0xCAA + SYS_FLOCATE_UNLOCKED = 0xCAB + SYS_FLOORD128 = 0xBBE + SYS_FLOORD32 = 0xBBC + SYS_FLOORD64 = 0xBBD + SYS_FMA = 0xA63 + SYS_FMAD128 = 0xBC1 + SYS_FMAD32 = 0xBBF + SYS_FMAD64 = 0xBC0 + SYS_FMAF = 0xA66 + SYS_FMAL = 0xA69 + SYS_FMAX = 0xA6C + SYS_FMAXD128 = 0xBC4 + SYS_FMAXD32 = 0xBC2 + SYS_FMAXD64 = 0xBC3 + SYS_FMAXF = 0xA6F + SYS_FMAXL = 0xA72 + SYS_FMIN = 0xA75 + SYS_FMIND128 = 0xBC7 + SYS_FMIND32 = 0xBC5 + SYS_FMIND64 = 0xBC6 + SYS_FMINF = 0xA78 + SYS_FMINL = 0xA7B + SYS_FMODD128 = 0xBCA + SYS_FMODD32 = 0xBC8 + SYS_FMODD64 = 0xBC9 + SYS_FOPEN64 = 0xD49 + SYS_FOPEN64_UNLOCKED = 0xD4A + SYS_FOPEN_UNLOCKED = 0xCFA + SYS_FPRINTF_UNLOCKED = 0xCAC + SYS_FPUTC_UNLOCKED = 0xC81 + SYS_FPUTS_UNLOCKED = 0xC7E + SYS_FPUTWC_UNLOCKED = 0xCAD + SYS_FPUTWS_UNLOCKED = 0xCAE + SYS_FREAD_NOUPDATE = 0xCEC + SYS_FREAD_NOUPDATE_UNLOCKED = 0xCED + SYS_FREAD_UNLOCKED = 0xC7B + SYS_FREEIFADDRS = 0xCE6 + SYS_FREOPEN64 = 0xD4B + SYS_FREOPEN64_UNLOCKED = 0xD4C + SYS_FREOPEN_UNLOCKED = 0xCFB + SYS_FREXPD128 = 0xBCE + SYS_FREXPD32 = 0xBCC + SYS_FREXPD64 = 0xBCD + SYS_FSCANF_UNLOCKED = 0xCAF + SYS_FSEEK64 = 0xCEF + SYS_FSEEK64_UNLOCKED = 0xCF5 + SYS_FSEEKO64 = 0xCF0 + SYS_FSEEKO64_UNLOCKED = 0xCF6 + SYS_FSEEKO_UNLOCKED = 0xCB1 + SYS_FSEEK_UNLOCKED = 0xCB0 + SYS_FSETPOS64 = 0xCF1 + SYS_FSETPOS64_UNLOCKED = 0xCF7 + SYS_FSETPOS_UNLOCKED = 0xCB3 + SYS_FTELL64 = 0xCF2 + SYS_FTELL64_UNLOCKED = 0xCF8 + SYS_FTELLO64 = 0xCF3 + SYS_FTELLO64_UNLOCKED = 0xCF9 + SYS_FTELLO_UNLOCKED = 0xCB5 + SYS_FTELL_UNLOCKED = 0xCB4 + SYS_FUPDATE = 0x0B5 + SYS_FUPDATE_UNLOCKED = 0xCB7 + SYS_FWIDE_UNLOCKED = 0xCB8 + SYS_FWPRINTF_UNLOCKED = 0xCB9 + SYS_FWRITE_UNLOCKED = 0xC7A + SYS_FWSCANF_UNLOCKED = 0xCBA + SYS_GETDATE64 = 0xD4F + SYS_GETIFADDRS = 0xCE7 + SYS_GETIPV4SOURCEFILTER = 0xC77 + SYS_GETSOURCEFILTER = 0xC79 + SYS_GETSYNTX = 0x0FD + SYS_GETS_UNLOCKED = 0xC7D + SYS_GETTIMEOFDAY64 = 0xD50 + SYS_GETWCHAR_UNLOCKED = 0xCBC + SYS_GETWC_UNLOCKED = 0xCBB + SYS_GMTIME = 0x0B0 + SYS_GMTIME64 = 0xCDC + SYS_GMTIME64_R = 0xCDD + SYS_HYPOTD128 = 0xBD1 + SYS_HYPOTD32 = 0xBCF + SYS_HYPOTD64 = 0xBD0 + SYS_ILOGBD128 = 0xBD4 + SYS_ILOGBD32 = 0xBD2 + SYS_ILOGBD64 = 0xBD3 + SYS_ILOGBF = 0xA7E + SYS_ILOGBL = 0xA81 + SYS_INET6_IS_SRCADDR = 0xD5A + SYS_ISBLANK = 0x0FE + SYS_ISWALNUM = 0x0FF + SYS_LDEXPD128 = 0xBD7 + SYS_LDEXPD32 = 0xBD5 + SYS_LDEXPD64 = 0xBD6 + SYS_LGAMMAD128 = 0xBDA + SYS_LGAMMAD32 = 0xBD8 + SYS_LGAMMAD64 = 0xBD9 + SYS_LIO_LISTIO = 0xC6A + SYS_LLRINT = 0xA84 + SYS_LLRINTD128 = 0xBDD + SYS_LLRINTD32 = 0xBDB + SYS_LLRINTD64 = 0xBDC + SYS_LLRINTF = 0xA87 + SYS_LLRINTL = 0xA8A + SYS_LLROUND = 0xA8D + SYS_LLROUNDD128 = 0xBE0 + SYS_LLROUNDD32 = 0xBDE + SYS_LLROUNDD64 = 0xBDF + SYS_LLROUNDF = 0xA90 + SYS_LLROUNDL = 0xA93 + SYS_LOCALTIM = 0x0B1 + SYS_LOCALTIME = 0x0B1 + SYS_LOCALTIME64 = 0xCDE + SYS_LOCALTIME64_R = 0xCDF + SYS_LOG10D128 = 0xBE6 + SYS_LOG10D32 = 0xBE4 + SYS_LOG10D64 = 0xBE5 + SYS_LOG1PD128 = 0xBE9 + SYS_LOG1PD32 = 0xBE7 + SYS_LOG1PD64 = 0xBE8 + SYS_LOG2D128 = 0xBEC + SYS_LOG2D32 = 0xBEA + SYS_LOG2D64 = 0xBEB + SYS_LOGBD128 = 0xBEF + SYS_LOGBD32 = 0xBED + SYS_LOGBD64 = 0xBEE + SYS_LOGBF = 0xA96 + SYS_LOGBL = 0xA99 + SYS_LOGD128 = 0xBE3 + SYS_LOGD32 = 0xBE1 + SYS_LOGD64 = 0xBE2 + SYS_LRINT = 0xA9C + SYS_LRINTD128 = 0xBF2 + SYS_LRINTD32 = 0xBF0 + SYS_LRINTD64 = 0xBF1 + SYS_LRINTF = 0xA9F + SYS_LRINTL = 0xAA2 + SYS_LROUNDD128 = 0xBF5 + SYS_LROUNDD32 = 0xBF3 + SYS_LROUNDD64 = 0xBF4 + SYS_LROUNDL = 0xAA5 + SYS_MBLEN = 0x0AF + SYS_MBRTOC16 = 0xD42 + SYS_MBRTOC32 = 0xD43 + SYS_MEMSET = 0x0A3 + SYS_MKTIME = 0x0AC + SYS_MKTIME64 = 0xCE0 + SYS_MODFD128 = 0xBF8 + SYS_MODFD32 = 0xBF6 + SYS_MODFD64 = 0xBF7 + SYS_NAN = 0xAA8 + SYS_NAND128 = 0xBFB + SYS_NAND32 = 0xBF9 + SYS_NAND64 = 0xBFA + SYS_NANF = 0xAAA + SYS_NANL = 0xAAC + SYS_NEARBYINT = 0xAAE + SYS_NEARBYINTD128 = 0xBFE + SYS_NEARBYINTD32 = 0xBFC + SYS_NEARBYINTD64 = 0xBFD + SYS_NEARBYINTF = 0xAB1 + SYS_NEARBYINTL = 0xAB4 + SYS_NEXTAFTERD128 = 0xC01 + SYS_NEXTAFTERD32 = 0xBFF + SYS_NEXTAFTERD64 = 0xC00 + SYS_NEXTAFTERF = 0xAB7 + SYS_NEXTAFTERL = 0xABA + SYS_NEXTTOWARD = 0xABD + SYS_NEXTTOWARDD128 = 0xC04 + SYS_NEXTTOWARDD32 = 0xC02 + SYS_NEXTTOWARDD64 = 0xC03 + SYS_NEXTTOWARDF = 0xAC0 + SYS_NEXTTOWARDL = 0xAC3 + SYS_NL_LANGINFO = 0x0FC + SYS_PERROR_UNLOCKED = 0xCBD + SYS_POSIX_FALLOCATE = 0xCE8 + SYS_POSIX_MEMALIGN = 0xCE9 + SYS_POSIX_OPENPT = 0xC66 + SYS_POWD128 = 0xC07 + SYS_POWD32 = 0xC05 + SYS_POWD64 = 0xC06 + SYS_PRINTF_UNLOCKED = 0xCBE + SYS_PSELECT = 0xC67 + SYS_PTHREAD_ATTR_GETSTACK = 0xB3E + SYS_PTHREAD_ATTR_SETSTACK = 0xB3F + SYS_PTHREAD_SECURITY_APPLID_NP = 0xCE4 + SYS_PUTS_UNLOCKED = 0xC7F + SYS_PUTWCHAR_UNLOCKED = 0xCC0 + SYS_PUTWC_UNLOCKED = 0xCBF + SYS_QUANTEXPD128 = 0xD46 + SYS_QUANTEXPD32 = 0xD44 + SYS_QUANTEXPD64 = 0xD45 + SYS_QUANTIZED128 = 0xC0A + SYS_QUANTIZED32 = 0xC08 + SYS_QUANTIZED64 = 0xC09 + SYS_REMAINDERD128 = 0xC0D + SYS_REMAINDERD32 = 0xC0B + SYS_REMAINDERD64 = 0xC0C + SYS_RESIZE_ALLOC = 0xCEB + SYS_REWIND_UNLOCKED = 0xCC1 + SYS_RINTD128 = 0xC13 + SYS_RINTD32 = 0xC11 + SYS_RINTD64 = 0xC12 + SYS_RINTF = 0xACB + SYS_RINTL = 0xACD + SYS_ROUND = 0xACF + SYS_ROUNDD128 = 0xC16 + SYS_ROUNDD32 = 0xC14 + SYS_ROUNDD64 = 0xC15 + SYS_ROUNDF = 0xAD2 + SYS_ROUNDL = 0xAD5 + SYS_SAMEQUANTUMD128 = 0xC19 + SYS_SAMEQUANTUMD32 = 0xC17 + SYS_SAMEQUANTUMD64 = 0xC18 + SYS_SCALBLN = 0xAD8 + SYS_SCALBLND128 = 0xC1C + SYS_SCALBLND32 = 0xC1A + SYS_SCALBLND64 = 0xC1B + SYS_SCALBLNF = 0xADB + SYS_SCALBLNL = 0xADE + SYS_SCALBND128 = 0xC1F + SYS_SCALBND32 = 0xC1D + SYS_SCALBND64 = 0xC1E + SYS_SCALBNF = 0xAE3 + SYS_SCALBNL = 0xAE6 + SYS_SCANF_UNLOCKED = 0xCC2 + SYS_SCHED_YIELD = 0xB32 + SYS_SETENV = 0x0C8 + SYS_SETIPV4SOURCEFILTER = 0xC76 + SYS_SETSOURCEFILTER = 0xC78 + SYS_SHM_OPEN = 0xC8C + SYS_SHM_UNLINK = 0xC8D + SYS_SIND128 = 0xC22 + SYS_SIND32 = 0xC20 + SYS_SIND64 = 0xC21 + SYS_SINHD128 = 0xC25 + SYS_SINHD32 = 0xC23 + SYS_SINHD64 = 0xC24 + SYS_SIZEOF_ALLOC = 0xCEA + SYS_SOCKATMARK = 0xC68 + SYS_SQRTD128 = 0xC28 + SYS_SQRTD32 = 0xC26 + SYS_SQRTD64 = 0xC27 + SYS_STRCHR = 0x0A0 + SYS_STRCSPN = 0x0A1 + SYS_STRERROR = 0x0A8 + SYS_STRERROR_R = 0xB33 + SYS_STRFTIME = 0x0B2 + SYS_STRLEN = 0x0A9 + SYS_STRPBRK = 0x0A2 + SYS_STRSPN = 0x0A4 + SYS_STRSTR = 0x0A5 + SYS_STRTOD128 = 0xC2B + SYS_STRTOD32 = 0xC29 + SYS_STRTOD64 = 0xC2A + SYS_STRTOK = 0x0A6 + SYS_TAND128 = 0xC2E + SYS_TAND32 = 0xC2C + SYS_TAND64 = 0xC2D + SYS_TANHD128 = 0xC31 + SYS_TANHD32 = 0xC2F + SYS_TANHD64 = 0xC30 + SYS_TGAMMAD128 = 0xC34 + SYS_TGAMMAD32 = 0xC32 + SYS_TGAMMAD64 = 0xC33 + SYS_TIME = 0x0AD + SYS_TIME64 = 0xCE1 + SYS_TMPFILE64 = 0xD4D + SYS_TMPFILE64_UNLOCKED = 0xD4E + SYS_TMPFILE_UNLOCKED = 0xCFD + SYS_TRUNCD128 = 0xC40 + SYS_TRUNCD32 = 0xC3E + SYS_TRUNCD64 = 0xC3F + SYS_UNGETC_UNLOCKED = 0xCC3 + SYS_UNGETWC_UNLOCKED = 0xCC4 + SYS_UNSETENV = 0xB34 + SYS_VFPRINTF_UNLOCKED = 0xCC5 + SYS_VFSCANF_UNLOCKED = 0xCC7 + SYS_VFWPRINTF_UNLOCKED = 0xCC9 + SYS_VFWSCANF_UNLOCKED = 0xCCB + SYS_VPRINTF_UNLOCKED = 0xCCD + SYS_VSCANF_UNLOCKED = 0xCCF + SYS_VWPRINTF_UNLOCKED = 0xCD1 + SYS_VWSCANF_UNLOCKED = 0xCD3 + SYS_WCSTOD128 = 0xC43 + SYS_WCSTOD32 = 0xC41 + SYS_WCSTOD64 = 0xC42 + SYS_WPRINTF_UNLOCKED = 0xCD5 + SYS_WSCANF_UNLOCKED = 0xCD6 + SYS__FLUSHLBF = 0xD68 + SYS__FLUSHLBF_UNLOCKED = 0xD6F + SYS___ACOSHF_H = 0xA54 + SYS___ACOSHL_H = 0xA55 + SYS___ASINHF_H = 0xA56 + SYS___ASINHL_H = 0xA57 + SYS___ATANPID128 = 0xC6D + SYS___ATANPID32 = 0xC6B + SYS___ATANPID64 = 0xC6C + SYS___CBRTF_H = 0xA58 + SYS___CBRTL_H = 0xA59 + SYS___CDUMP = 0x0C4 + SYS___CLASS = 0xAFA + SYS___CLASS2 = 0xB99 + SYS___CLASS2D128 = 0xC99 + SYS___CLASS2D32 = 0xC97 + SYS___CLASS2D64 = 0xC98 + SYS___CLASS2F = 0xC91 + SYS___CLASS2F_B = 0xC93 + SYS___CLASS2F_H = 0xC94 + SYS___CLASS2L = 0xC92 + SYS___CLASS2L_B = 0xC95 + SYS___CLASS2L_H = 0xC96 + SYS___CLASS2_B = 0xB9A + SYS___CLASS2_H = 0xB9B + SYS___CLASS_B = 0xAFB + SYS___CLASS_H = 0xAFC + SYS___CLOGL_B = 0xA01 + SYS___CLOGL_H = 0xA02 + SYS___CLRENV = 0x0C9 + SYS___CLRMF = 0x0BD + SYS___CODEPAGE_INFO = 0xC64 + SYS___CONJF_B = 0xA07 + SYS___CONJF_H = 0xA08 + SYS___CONJL_B = 0xA0A + SYS___CONJL_H = 0xA0B + SYS___CONJ_B = 0xA04 + SYS___CONJ_H = 0xA05 + SYS___COPYSIGN_B = 0xA5A + SYS___COPYSIGN_H = 0xAF5 + SYS___COSPID128 = 0xC70 + SYS___COSPID32 = 0xC6E + SYS___COSPID64 = 0xC6F + SYS___CPOWF_B = 0xA10 + SYS___CPOWF_H = 0xA11 + SYS___CPOWL_B = 0xA13 + SYS___CPOWL_H = 0xA14 + SYS___CPOW_B = 0xA0D + SYS___CPOW_H = 0xA0E + SYS___CPROJF_B = 0xA19 + SYS___CPROJF_H = 0xA1A + SYS___CPROJL_B = 0xA1C + SYS___CPROJL_H = 0xA1D + SYS___CPROJ_B = 0xA16 + SYS___CPROJ_H = 0xA17 + SYS___CREALF_B = 0xA22 + SYS___CREALF_H = 0xA23 + SYS___CREALL_B = 0xA25 + SYS___CREALL_H = 0xA26 + SYS___CREAL_B = 0xA1F + SYS___CREAL_H = 0xA20 + SYS___CSINF_B = 0xA2B + SYS___CSINF_H = 0xA2C + SYS___CSINHF_B = 0xA34 + SYS___CSINHF_H = 0xA35 + SYS___CSINHL_B = 0xA37 + SYS___CSINHL_H = 0xA38 + SYS___CSINH_B = 0xA31 + SYS___CSINH_H = 0xA32 + SYS___CSINL_B = 0xA2E + SYS___CSINL_H = 0xA2F + SYS___CSIN_B = 0xA28 + SYS___CSIN_H = 0xA29 + SYS___CSNAP = 0x0C5 + SYS___CSQRTF_B = 0xA3D + SYS___CSQRTF_H = 0xA3E + SYS___CSQRTL_B = 0xA40 + SYS___CSQRTL_H = 0xA41 + SYS___CSQRT_B = 0xA3A + SYS___CSQRT_H = 0xA3B + SYS___CTANF_B = 0xA46 + SYS___CTANF_H = 0xA47 + SYS___CTANHF_B = 0xA4F + SYS___CTANHF_H = 0xA50 + SYS___CTANHL_B = 0xA52 + SYS___CTANHL_H = 0xA53 + SYS___CTANH_B = 0xA4C + SYS___CTANH_H = 0xA4D + SYS___CTANL_B = 0xA49 + SYS___CTANL_H = 0xA4A + SYS___CTAN_B = 0xA43 + SYS___CTAN_H = 0xA44 + SYS___CTEST = 0x0C7 + SYS___CTRACE = 0x0C6 + SYS___D1TOP = 0xC9B + SYS___D2TOP = 0xC9C + SYS___D4TOP = 0xC9D + SYS___DYNALL = 0x0C3 + SYS___DYNFRE = 0x0C2 + SYS___EXP2F_H = 0xA5E + SYS___EXP2L_H = 0xA5F + SYS___EXP2_H = 0xA5D + SYS___EXPM1F_H = 0xA5B + SYS___EXPM1L_H = 0xA5C + SYS___FBUFSIZE = 0xD60 + SYS___FLBF = 0xD62 + SYS___FLDATA = 0x0C1 + SYS___FMAF_B = 0xA67 + SYS___FMAF_H = 0xA68 + SYS___FMAL_B = 0xA6A + SYS___FMAL_H = 0xA6B + SYS___FMAXF_B = 0xA70 + SYS___FMAXF_H = 0xA71 + SYS___FMAXL_B = 0xA73 + SYS___FMAXL_H = 0xA74 + SYS___FMAX_B = 0xA6D + SYS___FMAX_H = 0xA6E + SYS___FMA_B = 0xA64 + SYS___FMA_H = 0xA65 + SYS___FMINF_B = 0xA79 + SYS___FMINF_H = 0xA7A + SYS___FMINL_B = 0xA7C + SYS___FMINL_H = 0xA7D + SYS___FMIN_B = 0xA76 + SYS___FMIN_H = 0xA77 + SYS___FPENDING = 0xD61 + SYS___FPENDING_UNLOCKED = 0xD6C + SYS___FPURGE = 0xD69 + SYS___FPURGE_UNLOCKED = 0xD70 + SYS___FP_CAST_D = 0xBCB + SYS___FREADABLE = 0xD63 + SYS___FREADAHEAD = 0xD6A + SYS___FREADAHEAD_UNLOCKED = 0xD71 + SYS___FREADING = 0xD65 + SYS___FREADING_UNLOCKED = 0xD6D + SYS___FSEEK2 = 0xB3C + SYS___FSETERR = 0xD6B + SYS___FSETLOCKING = 0xD67 + SYS___FTCHEP = 0x0BF + SYS___FTELL2 = 0xB3B + SYS___FUPDT = 0x0B5 + SYS___FWRITABLE = 0xD64 + SYS___FWRITING = 0xD66 + SYS___FWRITING_UNLOCKED = 0xD6E + SYS___GETCB = 0x0B4 + SYS___GETGRGID1 = 0xD5B + SYS___GETGRNAM1 = 0xD5C + SYS___GETTHENT = 0xCE5 + SYS___GETTOD = 0xD3E + SYS___HYPOTF_H = 0xAF6 + SYS___HYPOTL_H = 0xAF7 + SYS___ILOGBF_B = 0xA7F + SYS___ILOGBF_H = 0xA80 + SYS___ILOGBL_B = 0xA82 + SYS___ILOGBL_H = 0xA83 + SYS___ISBLANK_A = 0xB2E + SYS___ISBLNK = 0x0FE + SYS___ISWBLANK_A = 0xB2F + SYS___LE_CEEGTJS = 0xD72 + SYS___LE_TRACEBACK = 0xB7A + SYS___LGAMMAL_H = 0xA62 + SYS___LGAMMA_B_C99 = 0xB39 + SYS___LGAMMA_H_C99 = 0xB38 + SYS___LGAMMA_R_C99 = 0xB3A + SYS___LLRINTF_B = 0xA88 + SYS___LLRINTF_H = 0xA89 + SYS___LLRINTL_B = 0xA8B + SYS___LLRINTL_H = 0xA8C + SYS___LLRINT_B = 0xA85 + SYS___LLRINT_H = 0xA86 + SYS___LLROUNDF_B = 0xA91 + SYS___LLROUNDF_H = 0xA92 + SYS___LLROUNDL_B = 0xA94 + SYS___LLROUNDL_H = 0xA95 + SYS___LLROUND_B = 0xA8E + SYS___LLROUND_H = 0xA8F + SYS___LOCALE_CTL = 0xD47 + SYS___LOG1PF_H = 0xA60 + SYS___LOG1PL_H = 0xA61 + SYS___LOGBF_B = 0xA97 + SYS___LOGBF_H = 0xA98 + SYS___LOGBL_B = 0xA9A + SYS___LOGBL_H = 0xA9B + SYS___LOGIN_APPLID = 0xCE2 + SYS___LRINTF_B = 0xAA0 + SYS___LRINTF_H = 0xAA1 + SYS___LRINTL_B = 0xAA3 + SYS___LRINTL_H = 0xAA4 + SYS___LRINT_B = 0xA9D + SYS___LRINT_H = 0xA9E + SYS___LROUNDF_FIXUP = 0xB31 + SYS___LROUNDL_B = 0xAA6 + SYS___LROUNDL_H = 0xAA7 + SYS___LROUND_FIXUP = 0xB30 + SYS___MOSERVICES = 0xD3D + SYS___MUST_STAY_CLEAN = 0xB7C + SYS___NANF_B = 0xAAB + SYS___NANL_B = 0xAAD + SYS___NAN_B = 0xAA9 + SYS___NEARBYINTF_B = 0xAB2 + SYS___NEARBYINTF_H = 0xAB3 + SYS___NEARBYINTL_B = 0xAB5 + SYS___NEARBYINTL_H = 0xAB6 + SYS___NEARBYINT_B = 0xAAF + SYS___NEARBYINT_H = 0xAB0 + SYS___NEXTAFTERF_B = 0xAB8 + SYS___NEXTAFTERF_H = 0xAB9 + SYS___NEXTAFTERL_B = 0xABB + SYS___NEXTAFTERL_H = 0xABC + SYS___NEXTTOWARDF_B = 0xAC1 + SYS___NEXTTOWARDF_H = 0xAC2 + SYS___NEXTTOWARDL_B = 0xAC4 + SYS___NEXTTOWARDL_H = 0xAC5 + SYS___NEXTTOWARD_B = 0xABE + SYS___NEXTTOWARD_H = 0xABF + SYS___O_ENV = 0xB7D + SYS___PASSWD_APPLID = 0xCE3 + SYS___PTOD1 = 0xC9E + SYS___PTOD2 = 0xC9F + SYS___PTOD4 = 0xCA0 + SYS___REGCOMP_STD = 0x0EA + SYS___REMAINDERF_H = 0xAC6 + SYS___REMAINDERL_H = 0xAC7 + SYS___REMQUOD128 = 0xC10 + SYS___REMQUOD32 = 0xC0E + SYS___REMQUOD64 = 0xC0F + SYS___REMQUOF_H = 0xAC9 + SYS___REMQUOL_H = 0xACA + SYS___REMQUO_H = 0xAC8 + SYS___RINTF_B = 0xACC + SYS___RINTL_B = 0xACE + SYS___ROUNDF_B = 0xAD3 + SYS___ROUNDF_H = 0xAD4 + SYS___ROUNDL_B = 0xAD6 + SYS___ROUNDL_H = 0xAD7 + SYS___ROUND_B = 0xAD0 + SYS___ROUND_H = 0xAD1 + SYS___SCALBLNF_B = 0xADC + SYS___SCALBLNF_H = 0xADD + SYS___SCALBLNL_B = 0xADF + SYS___SCALBLNL_H = 0xAE0 + SYS___SCALBLN_B = 0xAD9 + SYS___SCALBLN_H = 0xADA + SYS___SCALBNF_B = 0xAE4 + SYS___SCALBNF_H = 0xAE5 + SYS___SCALBNL_B = 0xAE7 + SYS___SCALBNL_H = 0xAE8 + SYS___SCALBN_B = 0xAE1 + SYS___SCALBN_H = 0xAE2 + SYS___SETENV = 0x0C8 + SYS___SINPID128 = 0xC73 + SYS___SINPID32 = 0xC71 + SYS___SINPID64 = 0xC72 + SYS___SMF_RECORD2 = 0xD48 + SYS___STATIC_REINIT = 0xB3D + SYS___TGAMMAF_H_C99 = 0xB79 + SYS___TGAMMAL_H = 0xAE9 + SYS___TGAMMA_H_C99 = 0xB78 + SYS___TOCSNAME2 = 0xC9A + SYS_CEIL = 0x01F + SYS_CHAUDIT = 0x1E0 + SYS_EXP = 0x01A + SYS_FCHAUDIT = 0x1E1 + SYS_FREXP = 0x01D + SYS_GETGROUPSBYNAME = 0x1E2 + SYS_GETPWUID = 0x1A0 + SYS_GETUID = 0x1A1 + SYS_ISATTY = 0x1A3 + SYS_KILL = 0x1A4 + SYS_LDEXP = 0x01E + SYS_LINK = 0x1A5 + SYS_LOG10 = 0x01C + SYS_LSEEK = 0x1A6 + SYS_LSTAT = 0x1A7 + SYS_MKDIR = 0x1A8 + SYS_MKFIFO = 0x1A9 + SYS_MKNOD = 0x1AA + SYS_MODF = 0x01B + SYS_MOUNT = 0x1AB + SYS_OPEN = 0x1AC + SYS_OPENDIR = 0x1AD + SYS_PATHCONF = 0x1AE + SYS_PAUSE = 0x1AF + SYS_PIPE = 0x1B0 + SYS_PTHREAD_ATTR_DESTROY = 0x1E7 + SYS_PTHREAD_ATTR_GETDETACHSTATE = 0x1EB + SYS_PTHREAD_ATTR_GETSTACKSIZE = 0x1E9 + SYS_PTHREAD_ATTR_GETWEIGHT_NP = 0x1ED + SYS_PTHREAD_ATTR_INIT = 0x1E6 + SYS_PTHREAD_ATTR_SETDETACHSTATE = 0x1EA + SYS_PTHREAD_ATTR_SETSTACKSIZE = 0x1E8 + SYS_PTHREAD_ATTR_SETWEIGHT_NP = 0x1EC + SYS_PTHREAD_CANCEL = 0x1EE + SYS_PTHREAD_CLEANUP_POP = 0x1F0 + SYS_PTHREAD_CLEANUP_PUSH = 0x1EF + SYS_PTHREAD_CONDATTR_DESTROY = 0x1F2 + SYS_PTHREAD_CONDATTR_INIT = 0x1F1 + SYS_PTHREAD_COND_BROADCAST = 0x1F6 + SYS_PTHREAD_COND_DESTROY = 0x1F4 + SYS_PTHREAD_COND_INIT = 0x1F3 + SYS_PTHREAD_COND_SIGNAL = 0x1F5 + SYS_PTHREAD_COND_TIMEDWAIT = 0x1F8 + SYS_PTHREAD_COND_WAIT = 0x1F7 + SYS_PTHREAD_CREATE = 0x1F9 + SYS_PTHREAD_DETACH = 0x1FA + SYS_PTHREAD_EQUAL = 0x1FB + SYS_PTHREAD_EXIT = 0x1E4 + SYS_PTHREAD_GETSPECIFIC = 0x1FC + SYS_PTHREAD_JOIN = 0x1FD + SYS_PTHREAD_KEY_CREATE = 0x1FE + SYS_PTHREAD_KILL = 0x1E5 + SYS_PTHREAD_MUTEXATTR_INIT = 0x1FF + SYS_READ = 0x1B2 + SYS_READDIR = 0x1B3 + SYS_READLINK = 0x1B4 + SYS_REWINDDIR = 0x1B5 + SYS_RMDIR = 0x1B6 + SYS_SETEGID = 0x1B7 + SYS_SETEUID = 0x1B8 + SYS_SETGID = 0x1B9 + SYS_SETPGID = 0x1BA + SYS_SETSID = 0x1BB + SYS_SETUID = 0x1BC + SYS_SIGACTION = 0x1BD + SYS_SIGADDSET = 0x1BE + SYS_SIGDELSET = 0x1BF + SYS_SIGEMPTYSET = 0x1C0 + SYS_SIGFILLSET = 0x1C1 + SYS_SIGISMEMBER = 0x1C2 + SYS_SIGLONGJMP = 0x1C3 + SYS_SIGPENDING = 0x1C4 + SYS_SIGPROCMASK = 0x1C5 + SYS_SIGSETJMP = 0x1C6 + SYS_SIGSUSPEND = 0x1C7 + SYS_SIGWAIT = 0x1E3 + SYS_SLEEP = 0x1C8 + SYS_STAT = 0x1C9 + SYS_SYMLINK = 0x1CB + SYS_SYSCONF = 0x1CC + SYS_TCDRAIN = 0x1CD + SYS_TCFLOW = 0x1CE + SYS_TCFLUSH = 0x1CF + SYS_TCGETATTR = 0x1D0 + SYS_TCGETPGRP = 0x1D1 + SYS_TCSENDBREAK = 0x1D2 + SYS_TCSETATTR = 0x1D3 + SYS_TCSETPGRP = 0x1D4 + SYS_TIMES = 0x1D5 + SYS_TTYNAME = 0x1D6 + SYS_TZSET = 0x1D7 + SYS_UMASK = 0x1D8 + SYS_UMOUNT = 0x1D9 + SYS_UNAME = 0x1DA + SYS_UNLINK = 0x1DB + SYS_UTIME = 0x1DC + SYS_WAIT = 0x1DD + SYS_WAITPID = 0x1DE + SYS_WRITE = 0x1DF + SYS_W_GETPSENT = 0x1B1 + SYS_W_IOCTL = 0x1A2 + SYS_W_STATFS = 0x1CA + SYS_A64L = 0x2EF + SYS_BCMP = 0x2B9 + SYS_BCOPY = 0x2BA + SYS_BZERO = 0x2BB + SYS_CATCLOSE = 0x2B6 + SYS_CATGETS = 0x2B7 + SYS_CATOPEN = 0x2B8 + SYS_CRYPT = 0x2AC + SYS_DBM_CLEARERR = 0x2F7 + SYS_DBM_CLOSE = 0x2F8 + SYS_DBM_DELETE = 0x2F9 + SYS_DBM_ERROR = 0x2FA + SYS_DBM_FETCH = 0x2FB + SYS_DBM_FIRSTKEY = 0x2FC + SYS_DBM_NEXTKEY = 0x2FD + SYS_DBM_OPEN = 0x2FE + SYS_DBM_STORE = 0x2FF + SYS_DRAND48 = 0x2B2 + SYS_ENCRYPT = 0x2AD + SYS_ENDUTXENT = 0x2E1 + SYS_ERAND48 = 0x2B3 + SYS_ERF = 0x02C + SYS_ERFC = 0x02D + SYS_FCHDIR = 0x2D9 + SYS_FFS = 0x2BC + SYS_FMTMSG = 0x2E5 + SYS_FSTATVFS = 0x2B4 + SYS_FTIME = 0x2F5 + SYS_GAMMA = 0x02E + SYS_GETDATE = 0x2A6 + SYS_GETPAGESIZE = 0x2D8 + SYS_GETTIMEOFDAY = 0x2F6 + SYS_GETUTXENT = 0x2E0 + SYS_GETUTXID = 0x2E2 + SYS_GETUTXLINE = 0x2E3 + SYS_HCREATE = 0x2C6 + SYS_HDESTROY = 0x2C7 + SYS_HSEARCH = 0x2C8 + SYS_HYPOT = 0x02B + SYS_INDEX = 0x2BD + SYS_INITSTATE = 0x2C2 + SYS_INSQUE = 0x2CF + SYS_ISASCII = 0x2ED + SYS_JRAND48 = 0x2E6 + SYS_L64A = 0x2F0 + SYS_LCONG48 = 0x2EA + SYS_LFIND = 0x2C9 + SYS_LRAND48 = 0x2E7 + SYS_LSEARCH = 0x2CA + SYS_MEMCCPY = 0x2D4 + SYS_MRAND48 = 0x2E8 + SYS_NRAND48 = 0x2E9 + SYS_PCLOSE = 0x2D2 + SYS_POPEN = 0x2D1 + SYS_PUTUTXLINE = 0x2E4 + SYS_RANDOM = 0x2C4 + SYS_REMQUE = 0x2D0 + SYS_RINDEX = 0x2BE + SYS_SEED48 = 0x2EC + SYS_SETKEY = 0x2AE + SYS_SETSTATE = 0x2C3 + SYS_SETUTXENT = 0x2DF + SYS_SRAND48 = 0x2EB + SYS_SRANDOM = 0x2C5 + SYS_STATVFS = 0x2B5 + SYS_STRCASECMP = 0x2BF + SYS_STRDUP = 0x2C0 + SYS_STRNCASECMP = 0x2C1 + SYS_SWAB = 0x2D3 + SYS_TDELETE = 0x2CB + SYS_TFIND = 0x2CC + SYS_TOASCII = 0x2EE + SYS_TSEARCH = 0x2CD + SYS_TWALK = 0x2CE + SYS_UALARM = 0x2F1 + SYS_USLEEP = 0x2F2 + SYS_WAIT3 = 0x2A7 + SYS_WAITID = 0x2A8 + SYS_Y1 = 0x02A + SYS___ATOE = 0x2DB + SYS___ATOE_L = 0x2DC + SYS___CATTRM = 0x2A9 + SYS___CNVBLK = 0x2AF + SYS___CRYTRM = 0x2B0 + SYS___DLGHT = 0x2A1 + SYS___ECRTRM = 0x2B1 + SYS___ETOA = 0x2DD + SYS___ETOA_L = 0x2DE + SYS___GDTRM = 0x2AA + SYS___OCLCK = 0x2DA + SYS___OPARGF = 0x2A2 + SYS___OPERRF = 0x2A5 + SYS___OPINDF = 0x2A4 + SYS___OPOPTF = 0x2A3 + SYS___RNDTRM = 0x2AB + SYS___SRCTRM = 0x2F4 + SYS___TZONE = 0x2A0 + SYS___UTXTRM = 0x2F3 + SYS_ASIN = 0x03E + SYS_ISXDIGIT = 0x03B + SYS_SETLOCAL = 0x03A + SYS_SETLOCALE = 0x03A + SYS_SIN = 0x03F + SYS_TOLOWER = 0x03C + SYS_TOUPPER = 0x03D + SYS_ACCEPT_AND_RECV = 0x4F7 + SYS_ATOL = 0x04E + SYS_CHECKSCH = 0x4BC + SYS_CHECKSCHENV = 0x4BC + SYS_CLEARERR = 0x04C + SYS_CONNECTS = 0x4B5 + SYS_CONNECTSERVER = 0x4B5 + SYS_CONNECTW = 0x4B4 + SYS_CONNECTWORKMGR = 0x4B4 + SYS_CONTINUE = 0x4B3 + SYS_CONTINUEWORKUNIT = 0x4B3 + SYS_COPYSIGN = 0x4C2 + SYS_CREATEWO = 0x4B2 + SYS_CREATEWORKUNIT = 0x4B2 + SYS_DELETEWO = 0x4B9 + SYS_DELETEWORKUNIT = 0x4B9 + SYS_DISCONNE = 0x4B6 + SYS_DISCONNECTSERVER = 0x4B6 + SYS_FEOF = 0x04D + SYS_FERROR = 0x04A + SYS_FINITE = 0x4C8 + SYS_GAMMA_R = 0x4E2 + SYS_JOINWORK = 0x4B7 + SYS_JOINWORKUNIT = 0x4B7 + SYS_LEAVEWOR = 0x4B8 + SYS_LEAVEWORKUNIT = 0x4B8 + SYS_LGAMMA_R = 0x4EB + SYS_MATHERR = 0x4D0 + SYS_PERROR = 0x04F + SYS_QUERYMET = 0x4BA + SYS_QUERYMETRICS = 0x4BA + SYS_QUERYSCH = 0x4BB + SYS_QUERYSCHENV = 0x4BB + SYS_REWIND = 0x04B + SYS_SCALBN = 0x4D4 + SYS_SIGNIFIC = 0x4D5 + SYS_SIGNIFICAND = 0x4D5 + SYS___ACOSH_B = 0x4DA + SYS___ACOS_B = 0x4D9 + SYS___ASINH_B = 0x4BE + SYS___ASIN_B = 0x4DB + SYS___ATAN2_B = 0x4DC + SYS___ATANH_B = 0x4DD + SYS___ATAN_B = 0x4BF + SYS___CBRT_B = 0x4C0 + SYS___CEIL_B = 0x4C1 + SYS___COSH_B = 0x4DE + SYS___COS_B = 0x4C3 + SYS___DGHT = 0x4A8 + SYS___ENVN = 0x4B0 + SYS___ERFC_B = 0x4C5 + SYS___ERF_B = 0x4C4 + SYS___EXPM1_B = 0x4C6 + SYS___EXP_B = 0x4DF + SYS___FABS_B = 0x4C7 + SYS___FLOOR_B = 0x4C9 + SYS___FMOD_B = 0x4E0 + SYS___FP_SETMODE = 0x4F8 + SYS___FREXP_B = 0x4CA + SYS___GAMMA_B = 0x4E1 + SYS___GDRR = 0x4A1 + SYS___HRRNO = 0x4A2 + SYS___HYPOT_B = 0x4E3 + SYS___ILOGB_B = 0x4CB + SYS___ISNAN_B = 0x4CC + SYS___J0_B = 0x4E4 + SYS___J1_B = 0x4E6 + SYS___JN_B = 0x4E8 + SYS___LDEXP_B = 0x4CD + SYS___LGAMMA_B = 0x4EA + SYS___LOG10_B = 0x4ED + SYS___LOG1P_B = 0x4CE + SYS___LOGB_B = 0x4CF + SYS___LOGIN = 0x4F5 + SYS___LOG_B = 0x4EC + SYS___MLOCKALL = 0x4B1 + SYS___MODF_B = 0x4D1 + SYS___NEXTAFTER_B = 0x4D2 + SYS___OPENDIR2 = 0x4F3 + SYS___OPEN_STAT = 0x4F6 + SYS___OPND = 0x4A5 + SYS___OPPT = 0x4A6 + SYS___OPRG = 0x4A3 + SYS___OPRR = 0x4A4 + SYS___PID_AFFINITY = 0x4BD + SYS___POW_B = 0x4EE + SYS___READDIR2 = 0x4F4 + SYS___REMAINDER_B = 0x4EF + SYS___RINT_B = 0x4D3 + SYS___SCALB_B = 0x4F0 + SYS___SIGACTIONSET = 0x4FB + SYS___SIGGM = 0x4A7 + SYS___SINH_B = 0x4F1 + SYS___SIN_B = 0x4D6 + SYS___SQRT_B = 0x4F2 + SYS___TANH_B = 0x4D8 + SYS___TAN_B = 0x4D7 + SYS___TRRNO = 0x4AF + SYS___TZNE = 0x4A9 + SYS___TZZN = 0x4AA + SYS___UCREATE = 0x4FC + SYS___UFREE = 0x4FE + SYS___UHEAPREPORT = 0x4FF + SYS___UMALLOC = 0x4FD + SYS___Y0_B = 0x4E5 + SYS___Y1_B = 0x4E7 + SYS___YN_B = 0x4E9 + SYS_ABORT = 0x05C + SYS_ASCTIME_R = 0x5E0 + SYS_ATEXIT = 0x05D + SYS_CONNECTE = 0x5AE + SYS_CONNECTEXPORTIMPORT = 0x5AE + SYS_CTIME_R = 0x5E1 + SYS_DN_COMP = 0x5DF + SYS_DN_EXPAND = 0x5DD + SYS_DN_SKIPNAME = 0x5DE + SYS_EXIT = 0x05A + SYS_EXPORTWO = 0x5A1 + SYS_EXPORTWORKUNIT = 0x5A1 + SYS_EXTRACTW = 0x5A5 + SYS_EXTRACTWORKUNIT = 0x5A5 + SYS_FSEEKO = 0x5C9 + SYS_FTELLO = 0x5C8 + SYS_GETGRGID_R = 0x5E7 + SYS_GETGRNAM_R = 0x5E8 + SYS_GETLOGIN_R = 0x5E9 + SYS_GETPWNAM_R = 0x5EA + SYS_GETPWUID_R = 0x5EB + SYS_GMTIME_R = 0x5E2 + SYS_IMPORTWO = 0x5A3 + SYS_IMPORTWORKUNIT = 0x5A3 + SYS_INET_NTOP = 0x5D3 + SYS_INET_PTON = 0x5D4 + SYS_LLABS = 0x5CE + SYS_LLDIV = 0x5CB + SYS_LOCALTIME_R = 0x5E3 + SYS_PTHREAD_ATFORK = 0x5ED + SYS_PTHREAD_ATTR_GETDETACHSTATE_U98 = 0x5FB + SYS_PTHREAD_ATTR_GETGUARDSIZE = 0x5EE + SYS_PTHREAD_ATTR_GETSCHEDPARAM = 0x5F9 + SYS_PTHREAD_ATTR_GETSTACKADDR = 0x5EF + SYS_PTHREAD_ATTR_SETDETACHSTATE_U98 = 0x5FC + SYS_PTHREAD_ATTR_SETGUARDSIZE = 0x5F0 + SYS_PTHREAD_ATTR_SETSCHEDPARAM = 0x5FA + SYS_PTHREAD_ATTR_SETSTACKADDR = 0x5F1 + SYS_PTHREAD_CONDATTR_GETPSHARED = 0x5F2 + SYS_PTHREAD_CONDATTR_SETPSHARED = 0x5F3 + SYS_PTHREAD_DETACH_U98 = 0x5FD + SYS_PTHREAD_GETCONCURRENCY = 0x5F4 + SYS_PTHREAD_GETSPECIFIC_U98 = 0x5FE + SYS_PTHREAD_KEY_DELETE = 0x5F5 + SYS_PTHREAD_SETCANCELSTATE = 0x5FF + SYS_PTHREAD_SETCONCURRENCY = 0x5F6 + SYS_PTHREAD_SIGMASK = 0x5F7 + SYS_QUERYENC = 0x5AD + SYS_QUERYWORKUNITCLASSIFICATION = 0x5AD + SYS_RAISE = 0x05E + SYS_RAND_R = 0x5E4 + SYS_READDIR_R = 0x5E6 + SYS_REALLOC = 0x05B + SYS_RES_INIT = 0x5D8 + SYS_RES_MKQUERY = 0x5D7 + SYS_RES_QUERY = 0x5D9 + SYS_RES_QUERYDOMAIN = 0x5DC + SYS_RES_SEARCH = 0x5DA + SYS_RES_SEND = 0x5DB + SYS_SETJMP = 0x05F + SYS_SIGQUEUE = 0x5A9 + SYS_STRTOK_R = 0x5E5 + SYS_STRTOLL = 0x5B0 + SYS_STRTOULL = 0x5B1 + SYS_TTYNAME_R = 0x5EC + SYS_UNDOEXPO = 0x5A2 + SYS_UNDOEXPORTWORKUNIT = 0x5A2 + SYS_UNDOIMPO = 0x5A4 + SYS_UNDOIMPORTWORKUNIT = 0x5A4 + SYS_WCSTOLL = 0x5CC + SYS_WCSTOULL = 0x5CD + SYS___ABORT = 0x05C + SYS___CONSOLE2 = 0x5D2 + SYS___CPL = 0x5A6 + SYS___DISCARDDATA = 0x5F8 + SYS___DSA_PREV = 0x5B2 + SYS___EP_FIND = 0x5B3 + SYS___FP_SWAPMODE = 0x5AF + SYS___GETUSERID = 0x5AB + SYS___GET_CPUID = 0x5B9 + SYS___GET_SYSTEM_SETTINGS = 0x5BA + SYS___IPDOMAINNAME = 0x5AC + SYS___MAP_INIT = 0x5A7 + SYS___MAP_SERVICE = 0x5A8 + SYS___MOUNT = 0x5AA + SYS___MSGRCV_TIMED = 0x5B7 + SYS___RES = 0x5D6 + SYS___SEMOP_TIMED = 0x5B8 + SYS___SERVER_THREADS_QUERY = 0x5B4 + SYS_FPRINTF = 0x06D + SYS_FSCANF = 0x06A + SYS_PRINTF = 0x06F + SYS_SETBUF = 0x06B + SYS_SETVBUF = 0x06C + SYS_SSCANF = 0x06E + SYS___CATGETS_A = 0x6C0 + SYS___CHAUDIT_A = 0x6F4 + SYS___CHMOD_A = 0x6E8 + SYS___COLLATE_INIT_A = 0x6AC + SYS___CREAT_A = 0x6F6 + SYS___CTYPE_INIT_A = 0x6AF + SYS___DLLLOAD_A = 0x6DF + SYS___DLLQUERYFN_A = 0x6E0 + SYS___DLLQUERYVAR_A = 0x6E1 + SYS___E2A_L = 0x6E3 + SYS___EXECLE_A = 0x6A0 + SYS___EXECLP_A = 0x6A4 + SYS___EXECVE_A = 0x6C1 + SYS___EXECVP_A = 0x6C2 + SYS___EXECV_A = 0x6B1 + SYS___FPRINTF_A = 0x6FA + SYS___GETADDRINFO_A = 0x6BF + SYS___GETNAMEINFO_A = 0x6C4 + SYS___GET_WCTYPE_STD_A = 0x6AE + SYS___ICONV_OPEN_A = 0x6DE + SYS___IF_INDEXTONAME_A = 0x6DC + SYS___IF_NAMETOINDEX_A = 0x6DB + SYS___ISWCTYPE_A = 0x6B0 + SYS___IS_WCTYPE_STD_A = 0x6B2 + SYS___LOCALECONV_A = 0x6B8 + SYS___LOCALECONV_STD_A = 0x6B9 + SYS___LOCALE_INIT_A = 0x6B7 + SYS___LSTAT_A = 0x6EE + SYS___LSTAT_O_A = 0x6EF + SYS___MKDIR_A = 0x6E9 + SYS___MKFIFO_A = 0x6EC + SYS___MKNOD_A = 0x6F0 + SYS___MONETARY_INIT_A = 0x6BC + SYS___MOUNT_A = 0x6F1 + SYS___NL_CSINFO_A = 0x6D6 + SYS___NL_LANGINFO_A = 0x6BA + SYS___NL_LNAGINFO_STD_A = 0x6BB + SYS___NL_MONINFO_A = 0x6D7 + SYS___NL_NUMINFO_A = 0x6D8 + SYS___NL_RESPINFO_A = 0x6D9 + SYS___NL_TIMINFO_A = 0x6DA + SYS___NUMERIC_INIT_A = 0x6C6 + SYS___OPEN_A = 0x6F7 + SYS___PRINTF_A = 0x6DD + SYS___RESP_INIT_A = 0x6C7 + SYS___RPMATCH_A = 0x6C8 + SYS___RPMATCH_C_A = 0x6C9 + SYS___RPMATCH_STD_A = 0x6CA + SYS___SETLOCALE_A = 0x6F9 + SYS___SPAWNP_A = 0x6C5 + SYS___SPAWN_A = 0x6C3 + SYS___SPRINTF_A = 0x6FB + SYS___STAT_A = 0x6EA + SYS___STAT_O_A = 0x6EB + SYS___STRCOLL_STD_A = 0x6A1 + SYS___STRFMON_A = 0x6BD + SYS___STRFMON_STD_A = 0x6BE + SYS___STRFTIME_A = 0x6CC + SYS___STRFTIME_STD_A = 0x6CD + SYS___STRPTIME_A = 0x6CE + SYS___STRPTIME_STD_A = 0x6CF + SYS___STRXFRM_A = 0x6A2 + SYS___STRXFRM_C_A = 0x6A3 + SYS___STRXFRM_STD_A = 0x6A5 + SYS___SYNTAX_INIT_A = 0x6D4 + SYS___TIME_INIT_A = 0x6CB + SYS___TOD_INIT_A = 0x6D5 + SYS___TOWLOWER_A = 0x6B3 + SYS___TOWLOWER_STD_A = 0x6B4 + SYS___TOWUPPER_A = 0x6B5 + SYS___TOWUPPER_STD_A = 0x6B6 + SYS___UMOUNT_A = 0x6F2 + SYS___VFPRINTF_A = 0x6FC + SYS___VPRINTF_A = 0x6FD + SYS___VSPRINTF_A = 0x6FE + SYS___VSWPRINTF_A = 0x6FF + SYS___WCSCOLL_A = 0x6A6 + SYS___WCSCOLL_C_A = 0x6A7 + SYS___WCSCOLL_STD_A = 0x6A8 + SYS___WCSFTIME_A = 0x6D0 + SYS___WCSFTIME_STD_A = 0x6D1 + SYS___WCSXFRM_A = 0x6A9 + SYS___WCSXFRM_C_A = 0x6AA + SYS___WCSXFRM_STD_A = 0x6AB + SYS___WCTYPE_A = 0x6AD + SYS___W_GETMNTENT_A = 0x6F5 + SYS_____CCSIDTYPE_A = 0x6E6 + SYS_____CHATTR_A = 0x6E2 + SYS_____CSNAMETYPE_A = 0x6E7 + SYS_____OPEN_STAT_A = 0x6ED + SYS_____SPAWN2_A = 0x6D2 + SYS_____SPAWNP2_A = 0x6D3 + SYS_____TOCCSID_A = 0x6E4 + SYS_____TOCSNAME_A = 0x6E5 + SYS_ACL_FREE = 0x7FF + SYS_ACL_INIT = 0x7FE + SYS_FWIDE = 0x7DF + SYS_FWPRINTF = 0x7D1 + SYS_FWRITE = 0x07E + SYS_FWSCANF = 0x7D5 + SYS_GETCHAR = 0x07B + SYS_GETS = 0x07C + SYS_M_CREATE_LAYOUT = 0x7C9 + SYS_M_DESTROY_LAYOUT = 0x7CA + SYS_M_GETVALUES_LAYOUT = 0x7CB + SYS_M_SETVALUES_LAYOUT = 0x7CC + SYS_M_TRANSFORM_LAYOUT = 0x7CD + SYS_M_WTRANSFORM_LAYOUT = 0x7CE + SYS_PREAD = 0x7C7 + SYS_PUTC = 0x07D + SYS_PUTCHAR = 0x07A + SYS_PUTS = 0x07F + SYS_PWRITE = 0x7C8 + SYS_TOWCTRAN = 0x7D8 + SYS_TOWCTRANS = 0x7D8 + SYS_UNATEXIT = 0x7B5 + SYS_VFWPRINT = 0x7D3 + SYS_VFWPRINTF = 0x7D3 + SYS_VWPRINTF = 0x7D4 + SYS_WCTRANS = 0x7D7 + SYS_WPRINTF = 0x7D2 + SYS_WSCANF = 0x7D6 + SYS___ASCTIME_R_A = 0x7A1 + SYS___BASENAME_A = 0x7DC + SYS___BTOWC_A = 0x7E4 + SYS___CDUMP_A = 0x7B7 + SYS___CEE3DMP_A = 0x7B6 + SYS___CEILF_H = 0x7F4 + SYS___CEILL_H = 0x7F5 + SYS___CEIL_H = 0x7EA + SYS___CRYPT_A = 0x7BE + SYS___CSNAP_A = 0x7B8 + SYS___CTEST_A = 0x7B9 + SYS___CTIME_R_A = 0x7A2 + SYS___CTRACE_A = 0x7BA + SYS___DBM_OPEN_A = 0x7E6 + SYS___DIRNAME_A = 0x7DD + SYS___FABSF_H = 0x7FA + SYS___FABSL_H = 0x7FB + SYS___FABS_H = 0x7ED + SYS___FGETWC_A = 0x7AA + SYS___FGETWS_A = 0x7AD + SYS___FLOORF_H = 0x7F6 + SYS___FLOORL_H = 0x7F7 + SYS___FLOOR_H = 0x7EB + SYS___FPUTWC_A = 0x7A5 + SYS___FPUTWS_A = 0x7A8 + SYS___GETTIMEOFDAY_A = 0x7AE + SYS___GETWCHAR_A = 0x7AC + SYS___GETWC_A = 0x7AB + SYS___GLOB_A = 0x7DE + SYS___GMTIME_A = 0x7AF + SYS___GMTIME_R_A = 0x7B0 + SYS___INET_PTON_A = 0x7BC + SYS___J0_H = 0x7EE + SYS___J1_H = 0x7EF + SYS___JN_H = 0x7F0 + SYS___LOCALTIME_A = 0x7B1 + SYS___LOCALTIME_R_A = 0x7B2 + SYS___MALLOC24 = 0x7FC + SYS___MALLOC31 = 0x7FD + SYS___MKTIME_A = 0x7B3 + SYS___MODFF_H = 0x7F8 + SYS___MODFL_H = 0x7F9 + SYS___MODF_H = 0x7EC + SYS___OPENDIR_A = 0x7C2 + SYS___OSNAME = 0x7E0 + SYS___PUTWCHAR_A = 0x7A7 + SYS___PUTWC_A = 0x7A6 + SYS___READDIR_A = 0x7C3 + SYS___STRTOLL_A = 0x7A3 + SYS___STRTOULL_A = 0x7A4 + SYS___SYSLOG_A = 0x7BD + SYS___TZZNA = 0x7B4 + SYS___UNGETWC_A = 0x7A9 + SYS___UTIME_A = 0x7A0 + SYS___VFPRINTF2_A = 0x7E7 + SYS___VPRINTF2_A = 0x7E8 + SYS___VSPRINTF2_A = 0x7E9 + SYS___VSWPRNTF2_A = 0x7BB + SYS___WCSTOD_A = 0x7D9 + SYS___WCSTOL_A = 0x7DA + SYS___WCSTOUL_A = 0x7DB + SYS___WCTOB_A = 0x7E5 + SYS___Y0_H = 0x7F1 + SYS___Y1_H = 0x7F2 + SYS___YN_H = 0x7F3 + SYS_____OPENDIR2_A = 0x7BF + SYS_____OSNAME_A = 0x7E1 + SYS_____READDIR2_A = 0x7C0 + SYS_DLCLOSE = 0x8DF + SYS_DLERROR = 0x8E0 + SYS_DLOPEN = 0x8DD + SYS_DLSYM = 0x8DE + SYS_FLOCKFILE = 0x8D3 + SYS_FTRYLOCKFILE = 0x8D4 + SYS_FUNLOCKFILE = 0x8D5 + SYS_GETCHAR_UNLOCKED = 0x8D7 + SYS_GETC_UNLOCKED = 0x8D6 + SYS_PUTCHAR_UNLOCKED = 0x8D9 + SYS_PUTC_UNLOCKED = 0x8D8 + SYS_SNPRINTF = 0x8DA + SYS_VSNPRINTF = 0x8DB + SYS_WCSCSPN = 0x08B + SYS_WCSLEN = 0x08C + SYS_WCSNCAT = 0x08D + SYS_WCSNCMP = 0x08A + SYS_WCSNCPY = 0x08F + SYS_WCSSPN = 0x08E + SYS___ABSF_H = 0x8E7 + SYS___ABSL_H = 0x8E8 + SYS___ABS_H = 0x8E6 + SYS___ACOSF_H = 0x8EA + SYS___ACOSH_H = 0x8EC + SYS___ACOSL_H = 0x8EB + SYS___ACOS_H = 0x8E9 + SYS___ASINF_H = 0x8EE + SYS___ASINH_H = 0x8F0 + SYS___ASINL_H = 0x8EF + SYS___ASIN_H = 0x8ED + SYS___ATAN2F_H = 0x8F8 + SYS___ATAN2L_H = 0x8F9 + SYS___ATAN2_H = 0x8F7 + SYS___ATANF_H = 0x8F2 + SYS___ATANHF_H = 0x8F5 + SYS___ATANHL_H = 0x8F6 + SYS___ATANH_H = 0x8F4 + SYS___ATANL_H = 0x8F3 + SYS___ATAN_H = 0x8F1 + SYS___CBRT_H = 0x8FA + SYS___COPYSIGNF_H = 0x8FB + SYS___COPYSIGNL_H = 0x8FC + SYS___COSF_H = 0x8FE + SYS___COSL_H = 0x8FF + SYS___COS_H = 0x8FD + SYS___DLERROR_A = 0x8D2 + SYS___DLOPEN_A = 0x8D0 + SYS___DLSYM_A = 0x8D1 + SYS___GETUTXENT_A = 0x8C6 + SYS___GETUTXID_A = 0x8C7 + SYS___GETUTXLINE_A = 0x8C8 + SYS___ITOA = 0x8AA + SYS___ITOA_A = 0x8B0 + SYS___LE_CONDITION_TOKEN_BUILD = 0x8A5 + SYS___LE_MSG_ADD_INSERT = 0x8A6 + SYS___LE_MSG_GET = 0x8A7 + SYS___LE_MSG_GET_AND_WRITE = 0x8A8 + SYS___LE_MSG_WRITE = 0x8A9 + SYS___LLTOA = 0x8AE + SYS___LLTOA_A = 0x8B4 + SYS___LTOA = 0x8AC + SYS___LTOA_A = 0x8B2 + SYS___PUTCHAR_UNLOCKED_A = 0x8CC + SYS___PUTC_UNLOCKED_A = 0x8CB + SYS___PUTUTXLINE_A = 0x8C9 + SYS___RESET_EXCEPTION_HANDLER = 0x8E3 + SYS___REXEC_A = 0x8C4 + SYS___REXEC_AF_A = 0x8C5 + SYS___SET_EXCEPTION_HANDLER = 0x8E2 + SYS___SNPRINTF_A = 0x8CD + SYS___SUPERKILL = 0x8A4 + SYS___TCGETATTR_A = 0x8A1 + SYS___TCSETATTR_A = 0x8A2 + SYS___ULLTOA = 0x8AF + SYS___ULLTOA_A = 0x8B5 + SYS___ULTOA = 0x8AD + SYS___ULTOA_A = 0x8B3 + SYS___UTOA = 0x8AB + SYS___UTOA_A = 0x8B1 + SYS___VHM_EVENT = 0x8E4 + SYS___VSNPRINTF_A = 0x8CE + SYS_____GETENV_A = 0x8C3 + SYS_____UTMPXNAME_A = 0x8CA + SYS_CACOSH = 0x9A0 + SYS_CACOSHF = 0x9A3 + SYS_CACOSHL = 0x9A6 + SYS_CARG = 0x9A9 + SYS_CARGF = 0x9AC + SYS_CARGL = 0x9AF + SYS_CASIN = 0x9B2 + SYS_CASINF = 0x9B5 + SYS_CASINH = 0x9BB + SYS_CASINHF = 0x9BE + SYS_CASINHL = 0x9C1 + SYS_CASINL = 0x9B8 + SYS_CATAN = 0x9C4 + SYS_CATANF = 0x9C7 + SYS_CATANH = 0x9CD + SYS_CATANHF = 0x9D0 + SYS_CATANHL = 0x9D3 + SYS_CATANL = 0x9CA + SYS_CCOS = 0x9D6 + SYS_CCOSF = 0x9D9 + SYS_CCOSH = 0x9DF + SYS_CCOSHF = 0x9E2 + SYS_CCOSHL = 0x9E5 + SYS_CCOSL = 0x9DC + SYS_CEXP = 0x9E8 + SYS_CEXPF = 0x9EB + SYS_CEXPL = 0x9EE + SYS_CIMAG = 0x9F1 + SYS_CIMAGF = 0x9F4 + SYS_CIMAGL = 0x9F7 + SYS_CLOGF = 0x9FD + SYS_MEMCHR = 0x09B + SYS_MEMCMP = 0x09A + SYS_STRCOLL = 0x09C + SYS_STRNCMP = 0x09D + SYS_STRRCHR = 0x09F + SYS_STRXFRM = 0x09E + SYS___CACOSHF_B = 0x9A4 + SYS___CACOSHF_H = 0x9A5 + SYS___CACOSHL_B = 0x9A7 + SYS___CACOSHL_H = 0x9A8 + SYS___CACOSH_B = 0x9A1 + SYS___CACOSH_H = 0x9A2 + SYS___CARGF_B = 0x9AD + SYS___CARGF_H = 0x9AE + SYS___CARGL_B = 0x9B0 + SYS___CARGL_H = 0x9B1 + SYS___CARG_B = 0x9AA + SYS___CARG_H = 0x9AB + SYS___CASINF_B = 0x9B6 + SYS___CASINF_H = 0x9B7 + SYS___CASINHF_B = 0x9BF + SYS___CASINHF_H = 0x9C0 + SYS___CASINHL_B = 0x9C2 + SYS___CASINHL_H = 0x9C3 + SYS___CASINH_B = 0x9BC + SYS___CASINH_H = 0x9BD + SYS___CASINL_B = 0x9B9 + SYS___CASINL_H = 0x9BA + SYS___CASIN_B = 0x9B3 + SYS___CASIN_H = 0x9B4 + SYS___CATANF_B = 0x9C8 + SYS___CATANF_H = 0x9C9 + SYS___CATANHF_B = 0x9D1 + SYS___CATANHF_H = 0x9D2 + SYS___CATANHL_B = 0x9D4 + SYS___CATANHL_H = 0x9D5 + SYS___CATANH_B = 0x9CE + SYS___CATANH_H = 0x9CF + SYS___CATANL_B = 0x9CB + SYS___CATANL_H = 0x9CC + SYS___CATAN_B = 0x9C5 + SYS___CATAN_H = 0x9C6 + SYS___CCOSF_B = 0x9DA + SYS___CCOSF_H = 0x9DB + SYS___CCOSHF_B = 0x9E3 + SYS___CCOSHF_H = 0x9E4 + SYS___CCOSHL_B = 0x9E6 + SYS___CCOSHL_H = 0x9E7 + SYS___CCOSH_B = 0x9E0 + SYS___CCOSH_H = 0x9E1 + SYS___CCOSL_B = 0x9DD + SYS___CCOSL_H = 0x9DE + SYS___CCOS_B = 0x9D7 + SYS___CCOS_H = 0x9D8 + SYS___CEXPF_B = 0x9EC + SYS___CEXPF_H = 0x9ED + SYS___CEXPL_B = 0x9EF + SYS___CEXPL_H = 0x9F0 + SYS___CEXP_B = 0x9E9 + SYS___CEXP_H = 0x9EA + SYS___CIMAGF_B = 0x9F5 + SYS___CIMAGF_H = 0x9F6 + SYS___CIMAGL_B = 0x9F8 + SYS___CIMAGL_H = 0x9F9 + SYS___CIMAG_B = 0x9F2 + SYS___CIMAG_H = 0x9F3 + SYS___CLOG = 0x9FA + SYS___CLOGF_B = 0x9FE + SYS___CLOGF_H = 0x9FF + SYS___CLOG_B = 0x9FB + SYS___CLOG_H = 0x9FC + SYS_ISWCTYPE = 0x10C + SYS_ISWXDIGI = 0x10A + SYS_ISWXDIGIT = 0x10A + SYS_MBSINIT = 0x10F + SYS_TOWLOWER = 0x10D + SYS_TOWUPPER = 0x10E + SYS_WCTYPE = 0x10B + SYS_WCSSTR = 0x11B + SYS___RPMTCH = 0x11A + SYS_WCSTOD = 0x12E + SYS_WCSTOK = 0x12C + SYS_WCSTOL = 0x12D + SYS_WCSTOUL = 0x12F + SYS_FGETWC = 0x13C + SYS_FGETWS = 0x13D + SYS_FPUTWC = 0x13E + SYS_FPUTWS = 0x13F + SYS_REGERROR = 0x13B + SYS_REGFREE = 0x13A + SYS_COLLEQUIV = 0x14F + SYS_COLLTOSTR = 0x14E + SYS_ISMCCOLLEL = 0x14C + SYS_STRTOCOLL = 0x14D + SYS_DLLFREE = 0x16F + SYS_DLLQUERYFN = 0x16D + SYS_DLLQUERYVAR = 0x16E + SYS_GETMCCOLL = 0x16A + SYS_GETWMCCOLL = 0x16B + SYS___ERR2AD = 0x16C + SYS_CFSETOSPEED = 0x17A + SYS_CHDIR = 0x17B + SYS_CHMOD = 0x17C + SYS_CHOWN = 0x17D + SYS_CLOSE = 0x17E + SYS_CLOSEDIR = 0x17F + SYS_LOG = 0x017 + SYS_COSH = 0x018 + SYS_FCHMOD = 0x18A + SYS_FCHOWN = 0x18B + SYS_FCNTL = 0x18C + SYS_FILENO = 0x18D + SYS_FORK = 0x18E + SYS_FPATHCONF = 0x18F + SYS_GETLOGIN = 0x19A + SYS_GETPGRP = 0x19C + SYS_GETPID = 0x19D + SYS_GETPPID = 0x19E + SYS_GETPWNAM = 0x19F + SYS_TANH = 0x019 + SYS_W_GETMNTENT = 0x19B + SYS_POW = 0x020 + SYS_PTHREAD_SELF = 0x20A + SYS_PTHREAD_SETINTR = 0x20B + SYS_PTHREAD_SETINTRTYPE = 0x20C + SYS_PTHREAD_SETSPECIFIC = 0x20D + SYS_PTHREAD_TESTINTR = 0x20E + SYS_PTHREAD_YIELD = 0x20F + SYS_SQRT = 0x021 + SYS_FLOOR = 0x022 + SYS_J1 = 0x023 + SYS_WCSPBRK = 0x23F + SYS_BSEARCH = 0x24C + SYS_FABS = 0x024 + SYS_GETENV = 0x24A + SYS_LDIV = 0x24D + SYS_SYSTEM = 0x24B + SYS_FMOD = 0x025 + SYS___RETHROW = 0x25F + SYS___THROW = 0x25E + SYS_J0 = 0x026 + SYS_PUTENV = 0x26A + SYS___GETENV = 0x26F + SYS_SEMCTL = 0x27A + SYS_SEMGET = 0x27B + SYS_SEMOP = 0x27C + SYS_SHMAT = 0x27D + SYS_SHMCTL = 0x27E + SYS_SHMDT = 0x27F + SYS_YN = 0x027 + SYS_JN = 0x028 + SYS_SIGALTSTACK = 0x28A + SYS_SIGHOLD = 0x28B + SYS_SIGIGNORE = 0x28C + SYS_SIGINTERRUPT = 0x28D + SYS_SIGPAUSE = 0x28E + SYS_SIGRELSE = 0x28F + SYS_GETOPT = 0x29A + SYS_GETSUBOPT = 0x29D + SYS_LCHOWN = 0x29B + SYS_SETPGRP = 0x29E + SYS_TRUNCATE = 0x29C + SYS_Y0 = 0x029 + SYS___GDERR = 0x29F + SYS_ISALPHA = 0x030 + SYS_VFORK = 0x30F + SYS__LONGJMP = 0x30D + SYS__SETJMP = 0x30E + SYS_GLOB = 0x31A + SYS_GLOBFREE = 0x31B + SYS_ISALNUM = 0x031 + SYS_PUTW = 0x31C + SYS_SEEKDIR = 0x31D + SYS_TELLDIR = 0x31E + SYS_TEMPNAM = 0x31F + SYS_GETTIMEOFDAY_R = 0x32E + SYS_ISLOWER = 0x032 + SYS_LGAMMA = 0x32C + SYS_REMAINDER = 0x32A + SYS_SCALB = 0x32B + SYS_SYNC = 0x32F + SYS_TTYSLOT = 0x32D + SYS_ENDPROTOENT = 0x33A + SYS_ENDSERVENT = 0x33B + SYS_GETHOSTBYADDR = 0x33D + SYS_GETHOSTBYADDR_R = 0x33C + SYS_GETHOSTBYNAME = 0x33F + SYS_GETHOSTBYNAME_R = 0x33E + SYS_ISCNTRL = 0x033 + SYS_GETSERVBYNAME = 0x34A + SYS_GETSERVBYPORT = 0x34B + SYS_GETSERVENT = 0x34C + SYS_GETSOCKNAME = 0x34D + SYS_GETSOCKOPT = 0x34E + SYS_INET_ADDR = 0x34F + SYS_ISDIGIT = 0x034 + SYS_ISGRAPH = 0x035 + SYS_SELECT = 0x35B + SYS_SELECTEX = 0x35C + SYS_SEND = 0x35D + SYS_SENDTO = 0x35F + SYS_CHROOT = 0x36A + SYS_ISNAN = 0x36D + SYS_ISUPPER = 0x036 + SYS_ULIMIT = 0x36C + SYS_UTIMES = 0x36E + SYS_W_STATVFS = 0x36B + SYS___H_ERRNO = 0x36F + SYS_GRANTPT = 0x37A + SYS_ISPRINT = 0x037 + SYS_TCGETSID = 0x37C + SYS_UNLOCKPT = 0x37B + SYS___TCGETCP = 0x37D + SYS___TCSETCP = 0x37E + SYS___TCSETTABLES = 0x37F + SYS_ISPUNCT = 0x038 + SYS_NLIST = 0x38C + SYS___IPDBCS = 0x38D + SYS___IPDSPX = 0x38E + SYS___IPMSGC = 0x38F + SYS___STHOSTENT = 0x38B + SYS___STSERVENT = 0x38A + SYS_ISSPACE = 0x039 + SYS_COS = 0x040 + SYS_T_ALLOC = 0x40A + SYS_T_BIND = 0x40B + SYS_T_CLOSE = 0x40C + SYS_T_CONNECT = 0x40D + SYS_T_ERROR = 0x40E + SYS_T_FREE = 0x40F + SYS_TAN = 0x041 + SYS_T_RCVREL = 0x41A + SYS_T_RCVUDATA = 0x41B + SYS_T_RCVUDERR = 0x41C + SYS_T_SND = 0x41D + SYS_T_SNDDIS = 0x41E + SYS_T_SNDREL = 0x41F + SYS_GETPMSG = 0x42A + SYS_ISASTREAM = 0x42B + SYS_PUTMSG = 0x42C + SYS_PUTPMSG = 0x42D + SYS_SINH = 0x042 + SYS___ISPOSIXON = 0x42E + SYS___OPENMVSREL = 0x42F + SYS_ACOS = 0x043 + SYS_ATAN = 0x044 + SYS_ATAN2 = 0x045 + SYS_FTELL = 0x046 + SYS_FGETPOS = 0x047 + SYS_SOCK_DEBUG = 0x47A + SYS_SOCK_DO_TESTSTOR = 0x47D + SYS_TAKESOCKET = 0x47E + SYS___SERVER_INIT = 0x47F + SYS_FSEEK = 0x048 + SYS___IPHOST = 0x48B + SYS___IPNODE = 0x48C + SYS___SERVER_CLASSIFY_CREATE = 0x48D + SYS___SERVER_CLASSIFY_DESTROY = 0x48E + SYS___SERVER_CLASSIFY_RESET = 0x48F + SYS___SMF_RECORD = 0x48A + SYS_FSETPOS = 0x049 + SYS___FNWSA = 0x49B + SYS___SPAWN2 = 0x49D + SYS___SPAWNP2 = 0x49E + SYS_ATOF = 0x050 + SYS_PTHREAD_MUTEXATTR_GETPSHARED = 0x50A + SYS_PTHREAD_MUTEXATTR_SETPSHARED = 0x50B + SYS_PTHREAD_RWLOCK_DESTROY = 0x50C + SYS_PTHREAD_RWLOCK_INIT = 0x50D + SYS_PTHREAD_RWLOCK_RDLOCK = 0x50E + SYS_PTHREAD_RWLOCK_TRYRDLOCK = 0x50F + SYS_ATOI = 0x051 + SYS___FP_CLASS = 0x51D + SYS___FP_CLR_FLAG = 0x51A + SYS___FP_FINITE = 0x51E + SYS___FP_ISNAN = 0x51F + SYS___FP_RAISE_XCP = 0x51C + SYS___FP_READ_FLAG = 0x51B + SYS_RAND = 0x052 + SYS_SIGTIMEDWAIT = 0x52D + SYS_SIGWAITINFO = 0x52E + SYS___CHKBFP = 0x52F + SYS___FPC_RS = 0x52C + SYS___FPC_RW = 0x52A + SYS___FPC_SM = 0x52B + SYS_STRTOD = 0x053 + SYS_STRTOL = 0x054 + SYS_STRTOUL = 0x055 + SYS_MALLOC = 0x056 + SYS_SRAND = 0x057 + SYS_CALLOC = 0x058 + SYS_FREE = 0x059 + SYS___OSENV = 0x59F + SYS___W_PIOCTL = 0x59E + SYS_LONGJMP = 0x060 + SYS___FLOORF_B = 0x60A + SYS___FLOORL_B = 0x60B + SYS___FREXPF_B = 0x60C + SYS___FREXPL_B = 0x60D + SYS___LDEXPF_B = 0x60E + SYS___LDEXPL_B = 0x60F + SYS_SIGNAL = 0x061 + SYS___ATAN2F_B = 0x61A + SYS___ATAN2L_B = 0x61B + SYS___COSHF_B = 0x61C + SYS___COSHL_B = 0x61D + SYS___EXPF_B = 0x61E + SYS___EXPL_B = 0x61F + SYS_TMPNAM = 0x062 + SYS___ABSF_B = 0x62A + SYS___ABSL_B = 0x62C + SYS___ABS_B = 0x62B + SYS___FMODF_B = 0x62D + SYS___FMODL_B = 0x62E + SYS___MODFF_B = 0x62F + SYS_ATANL = 0x63A + SYS_CEILF = 0x63B + SYS_CEILL = 0x63C + SYS_COSF = 0x63D + SYS_COSHF = 0x63F + SYS_COSL = 0x63E + SYS_REMOVE = 0x063 + SYS_POWL = 0x64A + SYS_RENAME = 0x064 + SYS_SINF = 0x64B + SYS_SINHF = 0x64F + SYS_SINL = 0x64C + SYS_SQRTF = 0x64D + SYS_SQRTL = 0x64E + SYS_BTOWC = 0x65F + SYS_FREXPL = 0x65A + SYS_LDEXPF = 0x65B + SYS_LDEXPL = 0x65C + SYS_MODFF = 0x65D + SYS_MODFL = 0x65E + SYS_TMPFILE = 0x065 + SYS_FREOPEN = 0x066 + SYS___CHARMAP_INIT_A = 0x66E + SYS___GETHOSTBYADDR_R_A = 0x66C + SYS___GETHOSTBYNAME_A = 0x66A + SYS___GETHOSTBYNAME_R_A = 0x66D + SYS___MBLEN_A = 0x66F + SYS___RES_INIT_A = 0x66B + SYS_FCLOSE = 0x067 + SYS___GETGRGID_R_A = 0x67D + SYS___WCSTOMBS_A = 0x67A + SYS___WCSTOMBS_STD_A = 0x67B + SYS___WCSWIDTH_A = 0x67C + SYS___WCSWIDTH_ASIA = 0x67F + SYS___WCSWIDTH_STD_A = 0x67E + SYS_FFLUSH = 0x068 + SYS___GETLOGIN_R_A = 0x68E + SYS___GETPWNAM_R_A = 0x68C + SYS___GETPWUID_R_A = 0x68D + SYS___TTYNAME_R_A = 0x68F + SYS___WCWIDTH_ASIA = 0x68B + SYS___WCWIDTH_STD_A = 0x68A + SYS_FOPEN = 0x069 + SYS___REGEXEC_A = 0x69A + SYS___REGEXEC_STD_A = 0x69B + SYS___REGFREE_A = 0x69C + SYS___REGFREE_STD_A = 0x69D + SYS___STRCOLL_A = 0x69E + SYS___STRCOLL_C_A = 0x69F + SYS_SCANF = 0x070 + SYS___A64L_A = 0x70C + SYS___ECVT_A = 0x70D + SYS___FCVT_A = 0x70E + SYS___GCVT_A = 0x70F + SYS___STRTOUL_A = 0x70A + SYS_____AE_CORRESTBL_QUERY_A = 0x70B + SYS_SPRINTF = 0x071 + SYS___ACCESS_A = 0x71F + SYS___CATOPEN_A = 0x71E + SYS___GETOPT_A = 0x71D + SYS___REALPATH_A = 0x71A + SYS___SETENV_A = 0x71B + SYS___SYSTEM_A = 0x71C + SYS_FGETC = 0x072 + SYS___GAI_STRERROR_A = 0x72F + SYS___RMDIR_A = 0x72A + SYS___STATVFS_A = 0x72B + SYS___SYMLINK_A = 0x72C + SYS___TRUNCATE_A = 0x72D + SYS___UNLINK_A = 0x72E + SYS_VFPRINTF = 0x073 + SYS___ISSPACE_A = 0x73A + SYS___ISUPPER_A = 0x73B + SYS___ISWALNUM_A = 0x73F + SYS___ISXDIGIT_A = 0x73C + SYS___TOLOWER_A = 0x73D + SYS___TOUPPER_A = 0x73E + SYS_VPRINTF = 0x074 + SYS___CONFSTR_A = 0x74B + SYS___FDOPEN_A = 0x74E + SYS___FLDATA_A = 0x74F + SYS___FTOK_A = 0x74C + SYS___ISWXDIGIT_A = 0x74A + SYS___MKTEMP_A = 0x74D + SYS_VSPRINTF = 0x075 + SYS___GETGRGID_A = 0x75A + SYS___GETGRNAM_A = 0x75B + SYS___GETGROUPSBYNAME_A = 0x75C + SYS___GETHOSTENT_A = 0x75D + SYS___GETHOSTNAME_A = 0x75E + SYS___GETLOGIN_A = 0x75F + SYS_GETC = 0x076 + SYS___CREATEWORKUNIT_A = 0x76A + SYS___CTERMID_A = 0x76B + SYS___FMTMSG_A = 0x76C + SYS___INITGROUPS_A = 0x76D + SYS___MSGRCV_A = 0x76F + SYS_____LOGIN_A = 0x76E + SYS_FGETS = 0x077 + SYS___STRCASECMP_A = 0x77B + SYS___STRNCASECMP_A = 0x77C + SYS___TTYNAME_A = 0x77D + SYS___UNAME_A = 0x77E + SYS___UTIMES_A = 0x77F + SYS_____SERVER_PWU_A = 0x77A + SYS_FPUTC = 0x078 + SYS___CREAT_O_A = 0x78E + SYS___ENVNA = 0x78F + SYS___FREAD_A = 0x78A + SYS___FWRITE_A = 0x78B + SYS___ISASCII = 0x78D + SYS___OPEN_O_A = 0x78C + SYS_FPUTS = 0x079 + SYS___ASCTIME_A = 0x79C + SYS___CTIME_A = 0x79D + SYS___GETDATE_A = 0x79E + SYS___GETSERVBYPORT_A = 0x79A + SYS___GETSERVENT_A = 0x79B + SYS___TZSET_A = 0x79F + SYS_ACL_FROM_TEXT = 0x80C + SYS_ACL_SET_FD = 0x80A + SYS_ACL_SET_FILE = 0x80B + SYS_ACL_SORT = 0x80E + SYS_ACL_TO_TEXT = 0x80D + SYS_UNGETC = 0x080 + SYS___SHUTDOWN_REGISTRATION = 0x80F + SYS_FREAD = 0x081 + SYS_FREEADDRINFO = 0x81A + SYS_GAI_STRERROR = 0x81B + SYS_REXEC_AF = 0x81C + SYS___DYNALLOC_A = 0x81F + SYS___POE = 0x81D + SYS_WCSTOMBS = 0x082 + SYS___INET_ADDR_A = 0x82F + SYS___NLIST_A = 0x82A + SYS_____TCGETCP_A = 0x82B + SYS_____TCSETCP_A = 0x82C + SYS_____W_PIOCTL_A = 0x82E + SYS_MBTOWC = 0x083 + SYS___CABEND = 0x83D + SYS___LE_CIB_GET = 0x83E + SYS___RECVMSG_A = 0x83B + SYS___SENDMSG_A = 0x83A + SYS___SET_LAA_FOR_JIT = 0x83F + SYS_____LCHATTR_A = 0x83C + SYS_WCTOMB = 0x084 + SYS___CBRTL_B = 0x84A + SYS___COPYSIGNF_B = 0x84B + SYS___COPYSIGNL_B = 0x84C + SYS___COTANF_B = 0x84D + SYS___COTANL_B = 0x84F + SYS___COTAN_B = 0x84E + SYS_MBSTOWCS = 0x085 + SYS___LOG1PL_B = 0x85A + SYS___LOG2F_B = 0x85B + SYS___LOG2L_B = 0x85D + SYS___LOG2_B = 0x85C + SYS___REMAINDERF_B = 0x85E + SYS___REMAINDERL_B = 0x85F + SYS_ACOSHF = 0x86E + SYS_ACOSHL = 0x86F + SYS_WCSCPY = 0x086 + SYS___ERFCF_B = 0x86D + SYS___ERFF_B = 0x86C + SYS___LROUNDF_B = 0x86A + SYS___LROUND_B = 0x86B + SYS_COTANL = 0x87A + SYS_EXP2F = 0x87B + SYS_EXP2L = 0x87C + SYS_EXPM1F = 0x87D + SYS_EXPM1L = 0x87E + SYS_FDIMF = 0x87F + SYS_WCSCAT = 0x087 + SYS___COTANL = 0x87A + SYS_REMAINDERF = 0x88A + SYS_REMAINDERL = 0x88B + SYS_REMAINDF = 0x88A + SYS_REMAINDL = 0x88B + SYS_REMQUO = 0x88D + SYS_REMQUOF = 0x88C + SYS_REMQUOL = 0x88E + SYS_TGAMMAF = 0x88F + SYS_WCSCHR = 0x088 + SYS_ERFCF = 0x89B + SYS_ERFCL = 0x89C + SYS_ERFL = 0x89A + SYS_EXP2 = 0x89E + SYS_WCSCMP = 0x089 + SYS___EXP2_B = 0x89D + SYS___FAR_JUMP = 0x89F + SYS_ABS = 0x090 + SYS___ERFCL_H = 0x90A + SYS___EXPF_H = 0x90C + SYS___EXPL_H = 0x90D + SYS___EXPM1_H = 0x90E + SYS___EXP_H = 0x90B + SYS___FDIM_H = 0x90F + SYS_DIV = 0x091 + SYS___LOG2F_H = 0x91F + SYS___LOG2_H = 0x91E + SYS___LOGB_H = 0x91D + SYS___LOGF_H = 0x91B + SYS___LOGL_H = 0x91C + SYS___LOG_H = 0x91A + SYS_LABS = 0x092 + SYS___POWL_H = 0x92A + SYS___REMAINDER_H = 0x92B + SYS___RINT_H = 0x92C + SYS___SCALB_H = 0x92D + SYS___SINF_H = 0x92F + SYS___SIN_H = 0x92E + SYS_STRNCPY = 0x093 + SYS___TANHF_H = 0x93B + SYS___TANHL_H = 0x93C + SYS___TANH_H = 0x93A + SYS___TGAMMAF_H = 0x93E + SYS___TGAMMA_H = 0x93D + SYS___TRUNC_H = 0x93F + SYS_MEMCPY = 0x094 + SYS_VFWSCANF = 0x94A + SYS_VSWSCANF = 0x94E + SYS_VWSCANF = 0x94C + SYS_INET6_RTH_ADD = 0x95D + SYS_INET6_RTH_INIT = 0x95C + SYS_INET6_RTH_REVERSE = 0x95E + SYS_INET6_RTH_SEGMENTS = 0x95F + SYS_INET6_RTH_SPACE = 0x95B + SYS_MEMMOVE = 0x095 + SYS_WCSTOLD = 0x95A + SYS_STRCPY = 0x096 + SYS_STRCMP = 0x097 + SYS_CABS = 0x98E + SYS_STRCAT = 0x098 + SYS___CABS_B = 0x98F + SYS___POW_II = 0x98A + SYS___POW_II_B = 0x98B + SYS___POW_II_H = 0x98C + SYS_CACOSF = 0x99A + SYS_CACOSL = 0x99D + SYS_STRNCAT = 0x099 + SYS___CACOSF_B = 0x99B + SYS___CACOSF_H = 0x99C + SYS___CACOSL_B = 0x99E + SYS___CACOSL_H = 0x99F + SYS_ISWALPHA = 0x100 + SYS_ISWBLANK = 0x101 + SYS___ISWBLK = 0x101 + SYS_ISWCNTRL = 0x102 + SYS_ISWDIGIT = 0x103 + SYS_ISWGRAPH = 0x104 + SYS_ISWLOWER = 0x105 + SYS_ISWPRINT = 0x106 + SYS_ISWPUNCT = 0x107 + SYS_ISWSPACE = 0x108 + SYS_ISWUPPER = 0x109 + SYS_WCTOB = 0x110 + SYS_MBRLEN = 0x111 + SYS_MBRTOWC = 0x112 + SYS_MBSRTOWC = 0x113 + SYS_MBSRTOWCS = 0x113 + SYS_WCRTOMB = 0x114 + SYS_WCSRTOMB = 0x115 + SYS_WCSRTOMBS = 0x115 + SYS___CSID = 0x116 + SYS___WCSID = 0x117 + SYS_STRPTIME = 0x118 + SYS___STRPTM = 0x118 + SYS_STRFMON = 0x119 + SYS_WCSCOLL = 0x130 + SYS_WCSXFRM = 0x131 + SYS_WCSWIDTH = 0x132 + SYS_WCWIDTH = 0x133 + SYS_WCSFTIME = 0x134 + SYS_SWPRINTF = 0x135 + SYS_VSWPRINT = 0x136 + SYS_VSWPRINTF = 0x136 + SYS_SWSCANF = 0x137 + SYS_REGCOMP = 0x138 + SYS_REGEXEC = 0x139 + SYS_GETWC = 0x140 + SYS_GETWCHAR = 0x141 + SYS_PUTWC = 0x142 + SYS_PUTWCHAR = 0x143 + SYS_UNGETWC = 0x144 + SYS_ICONV_OPEN = 0x145 + SYS_ICONV = 0x146 + SYS_ICONV_CLOSE = 0x147 + SYS_COLLRANGE = 0x150 + SYS_CCLASS = 0x151 + SYS_COLLORDER = 0x152 + SYS___DEMANGLE = 0x154 + SYS_FDOPEN = 0x155 + SYS___ERRNO = 0x156 + SYS___ERRNO2 = 0x157 + SYS___TERROR = 0x158 + SYS_MAXCOLL = 0x169 + SYS_DLLLOAD = 0x170 + SYS__EXIT = 0x174 + SYS_ACCESS = 0x175 + SYS_ALARM = 0x176 + SYS_CFGETISPEED = 0x177 + SYS_CFGETOSPEED = 0x178 + SYS_CFSETISPEED = 0x179 + SYS_CREAT = 0x180 + SYS_CTERMID = 0x181 + SYS_DUP = 0x182 + SYS_DUP2 = 0x183 + SYS_EXECL = 0x184 + SYS_EXECLE = 0x185 + SYS_EXECLP = 0x186 + SYS_EXECV = 0x187 + SYS_EXECVE = 0x188 + SYS_EXECVP = 0x189 + SYS_FSTAT = 0x190 + SYS_FSYNC = 0x191 + SYS_FTRUNCATE = 0x192 + SYS_GETCWD = 0x193 + SYS_GETEGID = 0x194 + SYS_GETEUID = 0x195 + SYS_GETGID = 0x196 + SYS_GETGRGID = 0x197 + SYS_GETGRNAM = 0x198 + SYS_GETGROUPS = 0x199 + SYS_PTHREAD_MUTEXATTR_DESTROY = 0x200 + SYS_PTHREAD_MUTEXATTR_SETKIND_NP = 0x201 + SYS_PTHREAD_MUTEXATTR_GETKIND_NP = 0x202 + SYS_PTHREAD_MUTEX_INIT = 0x203 + SYS_PTHREAD_MUTEX_DESTROY = 0x204 + SYS_PTHREAD_MUTEX_LOCK = 0x205 + SYS_PTHREAD_MUTEX_TRYLOCK = 0x206 + SYS_PTHREAD_MUTEX_UNLOCK = 0x207 + SYS_PTHREAD_ONCE = 0x209 + SYS_TW_OPEN = 0x210 + SYS_TW_FCNTL = 0x211 + SYS_PTHREAD_JOIN_D4_NP = 0x212 + SYS_PTHREAD_CONDATTR_SETKIND_NP = 0x213 + SYS_PTHREAD_CONDATTR_GETKIND_NP = 0x214 + SYS_EXTLINK_NP = 0x215 + SYS___PASSWD = 0x216 + SYS_SETGROUPS = 0x217 + SYS_INITGROUPS = 0x218 + SYS_WCSRCHR = 0x240 + SYS_SVC99 = 0x241 + SYS___SVC99 = 0x241 + SYS_WCSWCS = 0x242 + SYS_LOCALECO = 0x243 + SYS_LOCALECONV = 0x243 + SYS___LIBREL = 0x244 + SYS_RELEASE = 0x245 + SYS___RLSE = 0x245 + SYS_FLOCATE = 0x246 + SYS___FLOCT = 0x246 + SYS_FDELREC = 0x247 + SYS___FDLREC = 0x247 + SYS_FETCH = 0x248 + SYS___FETCH = 0x248 + SYS_QSORT = 0x249 + SYS___CLEANUPCATCH = 0x260 + SYS___CATCHMATCH = 0x261 + SYS___CLEAN2UPCATCH = 0x262 + SYS_GETPRIORITY = 0x270 + SYS_NICE = 0x271 + SYS_SETPRIORITY = 0x272 + SYS_GETITIMER = 0x273 + SYS_SETITIMER = 0x274 + SYS_MSGCTL = 0x275 + SYS_MSGGET = 0x276 + SYS_MSGRCV = 0x277 + SYS_MSGSND = 0x278 + SYS_MSGXRCV = 0x279 + SYS___MSGXR = 0x279 + SYS_SHMGET = 0x280 + SYS___GETIPC = 0x281 + SYS_SETGRENT = 0x282 + SYS_GETGRENT = 0x283 + SYS_ENDGRENT = 0x284 + SYS_SETPWENT = 0x285 + SYS_GETPWENT = 0x286 + SYS_ENDPWENT = 0x287 + SYS_BSD_SIGNAL = 0x288 + SYS_KILLPG = 0x289 + SYS_SIGSET = 0x290 + SYS_SIGSTACK = 0x291 + SYS_GETRLIMIT = 0x292 + SYS_SETRLIMIT = 0x293 + SYS_GETRUSAGE = 0x294 + SYS_MMAP = 0x295 + SYS_MPROTECT = 0x296 + SYS_MSYNC = 0x297 + SYS_MUNMAP = 0x298 + SYS_CONFSTR = 0x299 + SYS___NDMTRM = 0x300 + SYS_FTOK = 0x301 + SYS_BASENAME = 0x302 + SYS_DIRNAME = 0x303 + SYS_GETDTABLESIZE = 0x304 + SYS_MKSTEMP = 0x305 + SYS_MKTEMP = 0x306 + SYS_NFTW = 0x307 + SYS_GETWD = 0x308 + SYS_LOCKF = 0x309 + SYS_WORDEXP = 0x310 + SYS_WORDFREE = 0x311 + SYS_GETPGID = 0x312 + SYS_GETSID = 0x313 + SYS___UTMPXNAME = 0x314 + SYS_CUSERID = 0x315 + SYS_GETPASS = 0x316 + SYS_FNMATCH = 0x317 + SYS_FTW = 0x318 + SYS_GETW = 0x319 + SYS_ACOSH = 0x320 + SYS_ASINH = 0x321 + SYS_ATANH = 0x322 + SYS_CBRT = 0x323 + SYS_EXPM1 = 0x324 + SYS_ILOGB = 0x325 + SYS_LOGB = 0x326 + SYS_LOG1P = 0x327 + SYS_NEXTAFTER = 0x328 + SYS_RINT = 0x329 + SYS_SPAWN = 0x330 + SYS_SPAWNP = 0x331 + SYS_GETLOGIN_UU = 0x332 + SYS_ECVT = 0x333 + SYS_FCVT = 0x334 + SYS_GCVT = 0x335 + SYS_ACCEPT = 0x336 + SYS_BIND = 0x337 + SYS_CONNECT = 0x338 + SYS_ENDHOSTENT = 0x339 + SYS_GETHOSTENT = 0x340 + SYS_GETHOSTID = 0x341 + SYS_GETHOSTNAME = 0x342 + SYS_GETNETBYADDR = 0x343 + SYS_GETNETBYNAME = 0x344 + SYS_GETNETENT = 0x345 + SYS_GETPEERNAME = 0x346 + SYS_GETPROTOBYNAME = 0x347 + SYS_GETPROTOBYNUMBER = 0x348 + SYS_GETPROTOENT = 0x349 + SYS_INET_LNAOF = 0x350 + SYS_INET_MAKEADDR = 0x351 + SYS_INET_NETOF = 0x352 + SYS_INET_NETWORK = 0x353 + SYS_INET_NTOA = 0x354 + SYS_IOCTL = 0x355 + SYS_LISTEN = 0x356 + SYS_READV = 0x357 + SYS_RECV = 0x358 + SYS_RECVFROM = 0x359 + SYS_SETHOSTENT = 0x360 + SYS_SETNETENT = 0x361 + SYS_SETPEER = 0x362 + SYS_SETPROTOENT = 0x363 + SYS_SETSERVENT = 0x364 + SYS_SETSOCKOPT = 0x365 + SYS_SHUTDOWN = 0x366 + SYS_SOCKET = 0x367 + SYS_SOCKETPAIR = 0x368 + SYS_WRITEV = 0x369 + SYS_ENDNETENT = 0x370 + SYS_CLOSELOG = 0x371 + SYS_OPENLOG = 0x372 + SYS_SETLOGMASK = 0x373 + SYS_SYSLOG = 0x374 + SYS_PTSNAME = 0x375 + SYS_SETREUID = 0x376 + SYS_SETREGID = 0x377 + SYS_REALPATH = 0x378 + SYS___SIGNGAM = 0x379 + SYS_POLL = 0x380 + SYS_REXEC = 0x381 + SYS___ISASCII2 = 0x382 + SYS___TOASCII2 = 0x383 + SYS_CHPRIORITY = 0x384 + SYS_PTHREAD_ATTR_SETSYNCTYPE_NP = 0x385 + SYS_PTHREAD_ATTR_GETSYNCTYPE_NP = 0x386 + SYS_PTHREAD_SET_LIMIT_NP = 0x387 + SYS___STNETENT = 0x388 + SYS___STPROTOENT = 0x389 + SYS___SELECT1 = 0x390 + SYS_PTHREAD_SECURITY_NP = 0x391 + SYS___CHECK_RESOURCE_AUTH_NP = 0x392 + SYS___CONVERT_ID_NP = 0x393 + SYS___OPENVMREL = 0x394 + SYS_WMEMCHR = 0x395 + SYS_WMEMCMP = 0x396 + SYS_WMEMCPY = 0x397 + SYS_WMEMMOVE = 0x398 + SYS_WMEMSET = 0x399 + SYS___FPUTWC = 0x400 + SYS___PUTWC = 0x401 + SYS___PWCHAR = 0x402 + SYS___WCSFTM = 0x403 + SYS___WCSTOK = 0x404 + SYS___WCWDTH = 0x405 + SYS_T_ACCEPT = 0x409 + SYS_T_GETINFO = 0x410 + SYS_T_GETPROTADDR = 0x411 + SYS_T_GETSTATE = 0x412 + SYS_T_LISTEN = 0x413 + SYS_T_LOOK = 0x414 + SYS_T_OPEN = 0x415 + SYS_T_OPTMGMT = 0x416 + SYS_T_RCV = 0x417 + SYS_T_RCVCONNECT = 0x418 + SYS_T_RCVDIS = 0x419 + SYS_T_SNDUDATA = 0x420 + SYS_T_STRERROR = 0x421 + SYS_T_SYNC = 0x422 + SYS_T_UNBIND = 0x423 + SYS___T_ERRNO = 0x424 + SYS___RECVMSG2 = 0x425 + SYS___SENDMSG2 = 0x426 + SYS_FATTACH = 0x427 + SYS_FDETACH = 0x428 + SYS_GETMSG = 0x429 + SYS_GETCONTEXT = 0x430 + SYS_SETCONTEXT = 0x431 + SYS_MAKECONTEXT = 0x432 + SYS_SWAPCONTEXT = 0x433 + SYS_PTHREAD_GETSPECIFIC_D8_NP = 0x434 + SYS_GETCLIENTID = 0x470 + SYS___GETCLIENTID = 0x471 + SYS_GETSTABLESIZE = 0x472 + SYS_GETIBMOPT = 0x473 + SYS_GETIBMSOCKOPT = 0x474 + SYS_GIVESOCKET = 0x475 + SYS_IBMSFLUSH = 0x476 + SYS_MAXDESC = 0x477 + SYS_SETIBMOPT = 0x478 + SYS_SETIBMSOCKOPT = 0x479 + SYS___SERVER_PWU = 0x480 + SYS_PTHREAD_TAG_NP = 0x481 + SYS___CONSOLE = 0x482 + SYS___WSINIT = 0x483 + SYS___IPTCPN = 0x489 + SYS___SERVER_CLASSIFY = 0x490 + SYS___HEAPRPT = 0x496 + SYS___ISBFP = 0x500 + SYS___FP_CAST = 0x501 + SYS___CERTIFICATE = 0x502 + SYS_SEND_FILE = 0x503 + SYS_AIO_CANCEL = 0x504 + SYS_AIO_ERROR = 0x505 + SYS_AIO_READ = 0x506 + SYS_AIO_RETURN = 0x507 + SYS_AIO_SUSPEND = 0x508 + SYS_AIO_WRITE = 0x509 + SYS_PTHREAD_RWLOCK_TRYWRLOCK = 0x510 + SYS_PTHREAD_RWLOCK_UNLOCK = 0x511 + SYS_PTHREAD_RWLOCK_WRLOCK = 0x512 + SYS_PTHREAD_RWLOCKATTR_GETPSHARED = 0x513 + SYS_PTHREAD_RWLOCKATTR_SETPSHARED = 0x514 + SYS_PTHREAD_RWLOCKATTR_INIT = 0x515 + SYS_PTHREAD_RWLOCKATTR_DESTROY = 0x516 + SYS___CTTBL = 0x517 + SYS_PTHREAD_MUTEXATTR_SETTYPE = 0x518 + SYS_PTHREAD_MUTEXATTR_GETTYPE = 0x519 + SYS___FP_UNORDERED = 0x520 + SYS___FP_READ_RND = 0x521 + SYS___FP_READ_RND_B = 0x522 + SYS___FP_SWAP_RND = 0x523 + SYS___FP_SWAP_RND_B = 0x524 + SYS___FP_LEVEL = 0x525 + SYS___FP_BTOH = 0x526 + SYS___FP_HTOB = 0x527 + SYS___FPC_RD = 0x528 + SYS___FPC_WR = 0x529 + SYS_PTHREAD_SETCANCELTYPE = 0x600 + SYS_PTHREAD_TESTCANCEL = 0x601 + SYS___ATANF_B = 0x602 + SYS___ATANL_B = 0x603 + SYS___CEILF_B = 0x604 + SYS___CEILL_B = 0x605 + SYS___COSF_B = 0x606 + SYS___COSL_B = 0x607 + SYS___FABSF_B = 0x608 + SYS___FABSL_B = 0x609 + SYS___SINF_B = 0x610 + SYS___SINL_B = 0x611 + SYS___TANF_B = 0x612 + SYS___TANL_B = 0x613 + SYS___TANHF_B = 0x614 + SYS___TANHL_B = 0x615 + SYS___ACOSF_B = 0x616 + SYS___ACOSL_B = 0x617 + SYS___ASINF_B = 0x618 + SYS___ASINL_B = 0x619 + SYS___LOGF_B = 0x620 + SYS___LOGL_B = 0x621 + SYS___LOG10F_B = 0x622 + SYS___LOG10L_B = 0x623 + SYS___POWF_B = 0x624 + SYS___POWL_B = 0x625 + SYS___SINHF_B = 0x626 + SYS___SINHL_B = 0x627 + SYS___SQRTF_B = 0x628 + SYS___SQRTL_B = 0x629 + SYS___MODFL_B = 0x630 + SYS_ABSF = 0x631 + SYS_ABSL = 0x632 + SYS_ACOSF = 0x633 + SYS_ACOSL = 0x634 + SYS_ASINF = 0x635 + SYS_ASINL = 0x636 + SYS_ATAN2F = 0x637 + SYS_ATAN2L = 0x638 + SYS_ATANF = 0x639 + SYS_COSHL = 0x640 + SYS_EXPF = 0x641 + SYS_EXPL = 0x642 + SYS_TANHF = 0x643 + SYS_TANHL = 0x644 + SYS_LOG10F = 0x645 + SYS_LOG10L = 0x646 + SYS_LOGF = 0x647 + SYS_LOGL = 0x648 + SYS_POWF = 0x649 + SYS_SINHL = 0x650 + SYS_TANF = 0x651 + SYS_TANL = 0x652 + SYS_FABSF = 0x653 + SYS_FABSL = 0x654 + SYS_FLOORF = 0x655 + SYS_FLOORL = 0x656 + SYS_FMODF = 0x657 + SYS_FMODL = 0x658 + SYS_FREXPF = 0x659 + SYS___CHATTR = 0x660 + SYS___FCHATTR = 0x661 + SYS___TOCCSID = 0x662 + SYS___CSNAMETYPE = 0x663 + SYS___TOCSNAME = 0x664 + SYS___CCSIDTYPE = 0x665 + SYS___AE_CORRESTBL_QUERY = 0x666 + SYS___AE_AUTOCONVERT_STATE = 0x667 + SYS_DN_FIND = 0x668 + SYS___GETHOSTBYADDR_A = 0x669 + SYS___MBLEN_SB_A = 0x670 + SYS___MBLEN_STD_A = 0x671 + SYS___MBLEN_UTF = 0x672 + SYS___MBSTOWCS_A = 0x673 + SYS___MBSTOWCS_STD_A = 0x674 + SYS___MBTOWC_A = 0x675 + SYS___MBTOWC_ISO1 = 0x676 + SYS___MBTOWC_SBCS = 0x677 + SYS___MBTOWC_MBCS = 0x678 + SYS___MBTOWC_UTF = 0x679 + SYS___CSID_A = 0x680 + SYS___CSID_STD_A = 0x681 + SYS___WCSID_A = 0x682 + SYS___WCSID_STD_A = 0x683 + SYS___WCTOMB_A = 0x684 + SYS___WCTOMB_ISO1 = 0x685 + SYS___WCTOMB_STD_A = 0x686 + SYS___WCTOMB_UTF = 0x687 + SYS___WCWIDTH_A = 0x688 + SYS___GETGRNAM_R_A = 0x689 + SYS___READDIR_R_A = 0x690 + SYS___E2A_S = 0x691 + SYS___FNMATCH_A = 0x692 + SYS___FNMATCH_C_A = 0x693 + SYS___EXECL_A = 0x694 + SYS___FNMATCH_STD_A = 0x695 + SYS___REGCOMP_A = 0x696 + SYS___REGCOMP_STD_A = 0x697 + SYS___REGERROR_A = 0x698 + SYS___REGERROR_STD_A = 0x699 + SYS___SWPRINTF_A = 0x700 + SYS___FSCANF_A = 0x701 + SYS___SCANF_A = 0x702 + SYS___SSCANF_A = 0x703 + SYS___SWSCANF_A = 0x704 + SYS___ATOF_A = 0x705 + SYS___ATOI_A = 0x706 + SYS___ATOL_A = 0x707 + SYS___STRTOD_A = 0x708 + SYS___STRTOL_A = 0x709 + SYS___L64A_A = 0x710 + SYS___STRERROR_A = 0x711 + SYS___PERROR_A = 0x712 + SYS___FETCH_A = 0x713 + SYS___GETENV_A = 0x714 + SYS___MKSTEMP_A = 0x717 + SYS___PTSNAME_A = 0x718 + SYS___PUTENV_A = 0x719 + SYS___CHDIR_A = 0x720 + SYS___CHOWN_A = 0x721 + SYS___CHROOT_A = 0x722 + SYS___GETCWD_A = 0x723 + SYS___GETWD_A = 0x724 + SYS___LCHOWN_A = 0x725 + SYS___LINK_A = 0x726 + SYS___PATHCONF_A = 0x727 + SYS___IF_NAMEINDEX_A = 0x728 + SYS___READLINK_A = 0x729 + SYS___EXTLINK_NP_A = 0x730 + SYS___ISALNUM_A = 0x731 + SYS___ISALPHA_A = 0x732 + SYS___A2E_S = 0x733 + SYS___ISCNTRL_A = 0x734 + SYS___ISDIGIT_A = 0x735 + SYS___ISGRAPH_A = 0x736 + SYS___ISLOWER_A = 0x737 + SYS___ISPRINT_A = 0x738 + SYS___ISPUNCT_A = 0x739 + SYS___ISWALPHA_A = 0x740 + SYS___A2E_L = 0x741 + SYS___ISWCNTRL_A = 0x742 + SYS___ISWDIGIT_A = 0x743 + SYS___ISWGRAPH_A = 0x744 + SYS___ISWLOWER_A = 0x745 + SYS___ISWPRINT_A = 0x746 + SYS___ISWPUNCT_A = 0x747 + SYS___ISWSPACE_A = 0x748 + SYS___ISWUPPER_A = 0x749 + SYS___REMOVE_A = 0x750 + SYS___RENAME_A = 0x751 + SYS___TMPNAM_A = 0x752 + SYS___FOPEN_A = 0x753 + SYS___FREOPEN_A = 0x754 + SYS___CUSERID_A = 0x755 + SYS___POPEN_A = 0x756 + SYS___TEMPNAM_A = 0x757 + SYS___FTW_A = 0x758 + SYS___GETGRENT_A = 0x759 + SYS___INET_NTOP_A = 0x760 + SYS___GETPASS_A = 0x761 + SYS___GETPWENT_A = 0x762 + SYS___GETPWNAM_A = 0x763 + SYS___GETPWUID_A = 0x764 + SYS_____CHECK_RESOURCE_AUTH_NP_A = 0x765 + SYS___CHECKSCHENV_A = 0x766 + SYS___CONNECTSERVER_A = 0x767 + SYS___CONNECTWORKMGR_A = 0x768 + SYS_____CONSOLE_A = 0x769 + SYS___MSGSND_A = 0x770 + SYS___MSGXRCV_A = 0x771 + SYS___NFTW_A = 0x772 + SYS_____PASSWD_A = 0x773 + SYS___PTHREAD_SECURITY_NP_A = 0x774 + SYS___QUERYMETRICS_A = 0x775 + SYS___QUERYSCHENV = 0x776 + SYS___READV_A = 0x777 + SYS_____SERVER_CLASSIFY_A = 0x778 + SYS_____SERVER_INIT_A = 0x779 + SYS___W_GETPSENT_A = 0x780 + SYS___WRITEV_A = 0x781 + SYS___W_STATFS_A = 0x782 + SYS___W_STATVFS_A = 0x783 + SYS___FPUTC_A = 0x784 + SYS___PUTCHAR_A = 0x785 + SYS___PUTS_A = 0x786 + SYS___FGETS_A = 0x787 + SYS___GETS_A = 0x788 + SYS___FPUTS_A = 0x789 + SYS___PUTC_A = 0x790 + SYS___AE_THREAD_SETMODE = 0x791 + SYS___AE_THREAD_SWAPMODE = 0x792 + SYS___GETNETBYADDR_A = 0x793 + SYS___GETNETBYNAME_A = 0x794 + SYS___GETNETENT_A = 0x795 + SYS___GETPROTOBYNAME_A = 0x796 + SYS___GETPROTOBYNUMBER_A = 0x797 + SYS___GETPROTOENT_A = 0x798 + SYS___GETSERVBYNAME_A = 0x799 + SYS_ACL_FIRST_ENTRY = 0x800 + SYS_ACL_GET_ENTRY = 0x801 + SYS_ACL_VALID = 0x802 + SYS_ACL_CREATE_ENTRY = 0x803 + SYS_ACL_DELETE_ENTRY = 0x804 + SYS_ACL_UPDATE_ENTRY = 0x805 + SYS_ACL_DELETE_FD = 0x806 + SYS_ACL_DELETE_FILE = 0x807 + SYS_ACL_GET_FD = 0x808 + SYS_ACL_GET_FILE = 0x809 + SYS___ERFL_B = 0x810 + SYS___ERFCL_B = 0x811 + SYS___LGAMMAL_B = 0x812 + SYS___SETHOOKEVENTS = 0x813 + SYS_IF_NAMETOINDEX = 0x814 + SYS_IF_INDEXTONAME = 0x815 + SYS_IF_NAMEINDEX = 0x816 + SYS_IF_FREENAMEINDEX = 0x817 + SYS_GETADDRINFO = 0x818 + SYS_GETNAMEINFO = 0x819 + SYS___DYNFREE_A = 0x820 + SYS___RES_QUERY_A = 0x821 + SYS___RES_SEARCH_A = 0x822 + SYS___RES_QUERYDOMAIN_A = 0x823 + SYS___RES_MKQUERY_A = 0x824 + SYS___RES_SEND_A = 0x825 + SYS___DN_EXPAND_A = 0x826 + SYS___DN_SKIPNAME_A = 0x827 + SYS___DN_COMP_A = 0x828 + SYS___DN_FIND_A = 0x829 + SYS___INET_NTOA_A = 0x830 + SYS___INET_NETWORK_A = 0x831 + SYS___ACCEPT_A = 0x832 + SYS___ACCEPT_AND_RECV_A = 0x833 + SYS___BIND_A = 0x834 + SYS___CONNECT_A = 0x835 + SYS___GETPEERNAME_A = 0x836 + SYS___GETSOCKNAME_A = 0x837 + SYS___RECVFROM_A = 0x838 + SYS___SENDTO_A = 0x839 + SYS___LCHATTR = 0x840 + SYS___WRITEDOWN = 0x841 + SYS_PTHREAD_MUTEX_INIT2 = 0x842 + SYS___ACOSHF_B = 0x843 + SYS___ACOSHL_B = 0x844 + SYS___ASINHF_B = 0x845 + SYS___ASINHL_B = 0x846 + SYS___ATANHF_B = 0x847 + SYS___ATANHL_B = 0x848 + SYS___CBRTF_B = 0x849 + SYS___EXP2F_B = 0x850 + SYS___EXP2L_B = 0x851 + SYS___EXPM1F_B = 0x852 + SYS___EXPM1L_B = 0x853 + SYS___FDIMF_B = 0x854 + SYS___FDIM_B = 0x855 + SYS___FDIML_B = 0x856 + SYS___HYPOTF_B = 0x857 + SYS___HYPOTL_B = 0x858 + SYS___LOG1PF_B = 0x859 + SYS___REMQUOF_B = 0x860 + SYS___REMQUO_B = 0x861 + SYS___REMQUOL_B = 0x862 + SYS___TGAMMAF_B = 0x863 + SYS___TGAMMA_B = 0x864 + SYS___TGAMMAL_B = 0x865 + SYS___TRUNCF_B = 0x866 + SYS___TRUNC_B = 0x867 + SYS___TRUNCL_B = 0x868 + SYS___LGAMMAF_B = 0x869 + SYS_ASINHF = 0x870 + SYS_ASINHL = 0x871 + SYS_ATANHF = 0x872 + SYS_ATANHL = 0x873 + SYS_CBRTF = 0x874 + SYS_CBRTL = 0x875 + SYS_COPYSIGNF = 0x876 + SYS_CPYSIGNF = 0x876 + SYS_COPYSIGNL = 0x877 + SYS_CPYSIGNL = 0x877 + SYS_COTANF = 0x878 + SYS___COTANF = 0x878 + SYS_COTAN = 0x879 + SYS___COTAN = 0x879 + SYS_FDIM = 0x881 + SYS_FDIML = 0x882 + SYS_HYPOTF = 0x883 + SYS_HYPOTL = 0x884 + SYS_LOG1PF = 0x885 + SYS_LOG1PL = 0x886 + SYS_LOG2F = 0x887 + SYS_LOG2 = 0x888 + SYS_LOG2L = 0x889 + SYS_TGAMMA = 0x890 + SYS_TGAMMAL = 0x891 + SYS_TRUNCF = 0x892 + SYS_TRUNC = 0x893 + SYS_TRUNCL = 0x894 + SYS_LGAMMAF = 0x895 + SYS_LGAMMAL = 0x896 + SYS_LROUNDF = 0x897 + SYS_LROUND = 0x898 + SYS_ERFF = 0x899 + SYS___COSHF_H = 0x900 + SYS___COSHL_H = 0x901 + SYS___COTAN_H = 0x902 + SYS___COTANF_H = 0x903 + SYS___COTANL_H = 0x904 + SYS___ERF_H = 0x905 + SYS___ERFF_H = 0x906 + SYS___ERFL_H = 0x907 + SYS___ERFC_H = 0x908 + SYS___ERFCF_H = 0x909 + SYS___FDIMF_H = 0x910 + SYS___FDIML_H = 0x911 + SYS___FMOD_H = 0x912 + SYS___FMODF_H = 0x913 + SYS___FMODL_H = 0x914 + SYS___GAMMA_H = 0x915 + SYS___HYPOT_H = 0x916 + SYS___ILOGB_H = 0x917 + SYS___LGAMMA_H = 0x918 + SYS___LGAMMAF_H = 0x919 + SYS___LOG2L_H = 0x920 + SYS___LOG1P_H = 0x921 + SYS___LOG10_H = 0x922 + SYS___LOG10F_H = 0x923 + SYS___LOG10L_H = 0x924 + SYS___LROUND_H = 0x925 + SYS___LROUNDF_H = 0x926 + SYS___NEXTAFTER_H = 0x927 + SYS___POW_H = 0x928 + SYS___POWF_H = 0x929 + SYS___SINL_H = 0x930 + SYS___SINH_H = 0x931 + SYS___SINHF_H = 0x932 + SYS___SINHL_H = 0x933 + SYS___SQRT_H = 0x934 + SYS___SQRTF_H = 0x935 + SYS___SQRTL_H = 0x936 + SYS___TAN_H = 0x937 + SYS___TANF_H = 0x938 + SYS___TANL_H = 0x939 + SYS___TRUNCF_H = 0x940 + SYS___TRUNCL_H = 0x941 + SYS___COSH_H = 0x942 + SYS___LE_DEBUG_SET_RESUME_MCH = 0x943 + SYS_VFSCANF = 0x944 + SYS_VSCANF = 0x946 + SYS_VSSCANF = 0x948 + SYS_IMAXABS = 0x950 + SYS_IMAXDIV = 0x951 + SYS_STRTOIMAX = 0x952 + SYS_STRTOUMAX = 0x953 + SYS_WCSTOIMAX = 0x954 + SYS_WCSTOUMAX = 0x955 + SYS_ATOLL = 0x956 + SYS_STRTOF = 0x957 + SYS_STRTOLD = 0x958 + SYS_WCSTOF = 0x959 + SYS_INET6_RTH_GETADDR = 0x960 + SYS_INET6_OPT_INIT = 0x961 + SYS_INET6_OPT_APPEND = 0x962 + SYS_INET6_OPT_FINISH = 0x963 + SYS_INET6_OPT_SET_VAL = 0x964 + SYS_INET6_OPT_NEXT = 0x965 + SYS_INET6_OPT_FIND = 0x966 + SYS_INET6_OPT_GET_VAL = 0x967 + SYS___POW_I = 0x987 + SYS___POW_I_B = 0x988 + SYS___POW_I_H = 0x989 + SYS___CABS_H = 0x990 + SYS_CABSF = 0x991 + SYS___CABSF_B = 0x992 + SYS___CABSF_H = 0x993 + SYS_CABSL = 0x994 + SYS___CABSL_B = 0x995 + SYS___CABSL_H = 0x996 + SYS_CACOS = 0x997 + SYS___CACOS_B = 0x998 + SYS___CACOS_H = 0x999 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go b/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go index 2c1f815e6f..7a8161c1d1 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go +++ b/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go @@ -1,6 +1,7 @@ // cgo -godefs types_aix.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build ppc && aix // +build ppc,aix package unix @@ -219,6 +220,7 @@ const ( SizeofSockaddrUnix = 0x401 SizeofSockaddrDatalink = 0x80 SizeofLinger = 0x8 + SizeofIovec = 0x8 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofIPv6MTUInfo = 0x20 diff --git a/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go index b4a069ecbd..07ed733c51 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go @@ -1,6 +1,7 @@ // cgo -godefs types_aix.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build ppc64 && aix // +build ppc64,aix package unix @@ -223,6 +224,7 @@ const ( SizeofSockaddrUnix = 0x401 SizeofSockaddrDatalink = 0x80 SizeofLinger = 0x8 + SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofIPv6MTUInfo = 0x20 diff --git a/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go b/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go index 725b4bee27..54db433355 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go @@ -1,6 +1,7 @@ // cgo -godefs types_darwin.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build 386 && darwin // +build 386,darwin package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go index 080ffce325..eb73e52fb6 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go @@ -1,6 +1,7 @@ // cgo -godefs types_darwin.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && darwin // +build amd64,darwin package unix @@ -210,6 +211,13 @@ type RawSockaddrCtl struct { type _Socklen uint32 +type Xucred struct { + Version uint32 + Uid uint32 + Ngroups int16 + Groups [16]uint32 +} + type Linger struct { Onoff int32 Linger int32 @@ -273,6 +281,7 @@ const ( SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x14 SizeofSockaddrCtl = 0x20 + SizeofXucred = 0x4c SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go b/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go index f2a77bc4e2..8606d654e5 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go @@ -1,6 +1,7 @@ // cgo -godefs types_darwin.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm && darwin // +build arm,darwin package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go index c9492428bf..dcb51f8404 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go @@ -1,6 +1,7 @@ // cgo -godefs types_darwin.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm64 && darwin // +build arm64,darwin package unix @@ -210,6 +211,13 @@ type RawSockaddrCtl struct { type _Socklen uint32 +type Xucred struct { + Version uint32 + Uid uint32 + Ngroups int16 + Groups [16]uint32 +} + type Linger struct { Onoff int32 Linger int32 @@ -273,6 +281,7 @@ const ( SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x14 SizeofSockaddrCtl = 0x20 + SizeofXucred = 0x4c SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go index c4772df23b..1d049d7a12 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go @@ -1,6 +1,7 @@ // cgo -godefs types_dragonfly.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && dragonfly // +build amd64,dragonfly package unix @@ -234,6 +235,7 @@ const ( SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x36 SizeofLinger = 0x8 + SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go index 2a3ec615f7..c51bc88ffd 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go @@ -1,6 +1,7 @@ // cgo -godefs types_freebsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build 386 && freebsd // +build 386,freebsd package unix @@ -250,6 +251,14 @@ type RawSockaddrAny struct { type _Socklen uint32 +type Xucred struct { + Version uint32 + Uid uint32 + Ngroups int16 + Groups [16]uint32 + _ *byte +} + type Linger struct { Onoff int32 Linger int32 @@ -312,7 +321,9 @@ const ( SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x36 + SizeofXucred = 0x50 SizeofLinger = 0x8 + SizeofIovec = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go index e11e95499e..395b691871 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go @@ -1,6 +1,7 @@ // cgo -godefs types_freebsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && freebsd // +build amd64,freebsd package unix @@ -246,6 +247,14 @@ type RawSockaddrAny struct { type _Socklen uint32 +type Xucred struct { + Version uint32 + Uid uint32 + Ngroups int16 + Groups [16]uint32 + _ *byte +} + type Linger struct { Onoff int32 Linger int32 @@ -308,7 +317,9 @@ const ( SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x36 + SizeofXucred = 0x58 SizeofLinger = 0x8 + SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go index b91c2ae0f0..d3f9d2541b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go @@ -1,6 +1,7 @@ // cgo -godefs -- -fsigned-char types_freebsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm && freebsd // +build arm,freebsd package unix @@ -248,6 +249,14 @@ type RawSockaddrAny struct { type _Socklen uint32 +type Xucred struct { + Version uint32 + Uid uint32 + Ngroups int16 + Groups [16]uint32 + _ *byte +} + type Linger struct { Onoff int32 Linger int32 @@ -310,7 +319,9 @@ const ( SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x36 + SizeofXucred = 0x50 SizeofLinger = 0x8 + SizeofIovec = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go index c6fe1d097d..434d6e8e83 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go @@ -1,6 +1,7 @@ // cgo -godefs -- -fsigned-char types_freebsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm64 && freebsd // +build arm64,freebsd package unix @@ -246,6 +247,14 @@ type RawSockaddrAny struct { type _Socklen uint32 +type Xucred struct { + Version uint32 + Uid uint32 + Ngroups int16 + Groups [16]uint32 + _ *byte +} + type Linger struct { Onoff int32 Linger int32 @@ -308,7 +317,9 @@ const ( SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x36 + SizeofXucred = 0x58 SizeofLinger = 0x8 + SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 diff --git a/vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go new file mode 100644 index 0000000000..1137a5a1f4 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go @@ -0,0 +1,40 @@ +// cgo -godefs types_illumos.go | go run mkpost.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +//go:build amd64 && illumos +// +build amd64,illumos + +package unix + +const ( + TUNNEWPPA = 0x540001 + TUNSETPPA = 0x540002 + + I_STR = 0x5308 + I_POP = 0x5303 + I_PUSH = 0x5302 + I_PLINK = 0x5316 + I_PUNLINK = 0x5317 + + IF_UNITSEL = -0x7ffb8cca +) + +type strbuf struct { + Maxlen int32 + Len int32 + Buf *int8 +} + +type strioctl struct { + Cmd int32 + Timout int32 + Len int32 + Dp *int8 +} + +type lifreq struct { + Name [32]int8 + Lifru1 [4]byte + Type uint32 + Lifru [336]byte +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index 9f73d669bd..3bfc6f7323 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -1,5 +1,6 @@ // Code generated by mkmerge.go; DO NOT EDIT. +//go:build linux // +build linux package unix @@ -83,7 +84,7 @@ type FileCloneRange struct { Dest_offset uint64 } -type FileDedupeRange struct { +type RawFileDedupeRange struct { Src_offset uint64 Src_length uint64 Dest_count uint16 @@ -91,6 +92,21 @@ type FileDedupeRange struct { Reserved2 uint32 } +type RawFileDedupeRangeInfo struct { + Dest_fd int64 + Dest_offset uint64 + Bytes_deduped uint64 + Status int32 + Reserved uint32 +} + +const ( + SizeofRawFileDedupeRange = 0x18 + SizeofRawFileDedupeRangeInfo = 0x20 + FILE_DEDUPE_RANGE_SAME = 0x0 + FILE_DEDUPE_RANGE_DIFFERS = 0x1 +) + type FscryptPolicy struct { Version uint8 Contents_encryption_mode uint8 @@ -288,7 +304,8 @@ type RawSockaddrVM struct { Reserved1 uint16 Port uint32 Cid uint32 - Zero [4]uint8 + Flags uint8 + Zero [3]uint8 } type RawSockaddrXDP struct { @@ -999,7 +1016,7 @@ const ( PERF_SAMPLE_PHYS_ADDR = 0x80000 PERF_SAMPLE_AUX = 0x100000 PERF_SAMPLE_CGROUP = 0x200000 - PERF_SAMPLE_MAX = 0x400000 + PERF_SAMPLE_MAX = 0x1000000 PERF_SAMPLE_BRANCH_USER_SHIFT = 0x0 PERF_SAMPLE_BRANCH_KERNEL_SHIFT = 0x1 PERF_SAMPLE_BRANCH_HV_SHIFT = 0x2 @@ -3222,3 +3239,499 @@ const ( MPLS_IPTUNNEL_TTL = 0x2 MPLS_IPTUNNEL_MAX = 0x2 ) + +const ( + ETHTOOL_ID_UNSPEC = 0x0 + ETHTOOL_RX_COPYBREAK = 0x1 + ETHTOOL_TX_COPYBREAK = 0x2 + ETHTOOL_PFC_PREVENTION_TOUT = 0x3 + ETHTOOL_TUNABLE_UNSPEC = 0x0 + ETHTOOL_TUNABLE_U8 = 0x1 + ETHTOOL_TUNABLE_U16 = 0x2 + ETHTOOL_TUNABLE_U32 = 0x3 + ETHTOOL_TUNABLE_U64 = 0x4 + ETHTOOL_TUNABLE_STRING = 0x5 + ETHTOOL_TUNABLE_S8 = 0x6 + ETHTOOL_TUNABLE_S16 = 0x7 + ETHTOOL_TUNABLE_S32 = 0x8 + ETHTOOL_TUNABLE_S64 = 0x9 + ETHTOOL_PHY_ID_UNSPEC = 0x0 + ETHTOOL_PHY_DOWNSHIFT = 0x1 + ETHTOOL_PHY_FAST_LINK_DOWN = 0x2 + ETHTOOL_PHY_EDPD = 0x3 + ETHTOOL_LINK_EXT_STATE_AUTONEG = 0x0 + ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE = 0x1 + ETHTOOL_LINK_EXT_STATE_LINK_LOGICAL_MISMATCH = 0x2 + ETHTOOL_LINK_EXT_STATE_BAD_SIGNAL_INTEGRITY = 0x3 + ETHTOOL_LINK_EXT_STATE_NO_CABLE = 0x4 + ETHTOOL_LINK_EXT_STATE_CABLE_ISSUE = 0x5 + ETHTOOL_LINK_EXT_STATE_EEPROM_ISSUE = 0x6 + ETHTOOL_LINK_EXT_STATE_CALIBRATION_FAILURE = 0x7 + ETHTOOL_LINK_EXT_STATE_POWER_BUDGET_EXCEEDED = 0x8 + ETHTOOL_LINK_EXT_STATE_OVERHEAT = 0x9 + ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED = 0x1 + ETHTOOL_LINK_EXT_SUBSTATE_AN_ACK_NOT_RECEIVED = 0x2 + ETHTOOL_LINK_EXT_SUBSTATE_AN_NEXT_PAGE_EXCHANGE_FAILED = 0x3 + ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED_FORCE_MODE = 0x4 + ETHTOOL_LINK_EXT_SUBSTATE_AN_FEC_MISMATCH_DURING_OVERRIDE = 0x5 + ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_HCD = 0x6 + ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_FRAME_LOCK_NOT_ACQUIRED = 0x1 + ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_INHIBIT_TIMEOUT = 0x2 + ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_PARTNER_DID_NOT_SET_RECEIVER_READY = 0x3 + ETHTOOL_LINK_EXT_SUBSTATE_LT_REMOTE_FAULT = 0x4 + ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_BLOCK_LOCK = 0x1 + ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_AM_LOCK = 0x2 + ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_GET_ALIGN_STATUS = 0x3 + ETHTOOL_LINK_EXT_SUBSTATE_LLM_FC_FEC_IS_NOT_LOCKED = 0x4 + ETHTOOL_LINK_EXT_SUBSTATE_LLM_RS_FEC_IS_NOT_LOCKED = 0x5 + ETHTOOL_LINK_EXT_SUBSTATE_BSI_LARGE_NUMBER_OF_PHYSICAL_ERRORS = 0x1 + ETHTOOL_LINK_EXT_SUBSTATE_BSI_UNSUPPORTED_RATE = 0x2 + ETHTOOL_LINK_EXT_SUBSTATE_CI_UNSUPPORTED_CABLE = 0x1 + ETHTOOL_LINK_EXT_SUBSTATE_CI_CABLE_TEST_FAILURE = 0x2 + ETHTOOL_FLASH_ALL_REGIONS = 0x0 + ETHTOOL_F_UNSUPPORTED__BIT = 0x0 + ETHTOOL_F_WISH__BIT = 0x1 + ETHTOOL_F_COMPAT__BIT = 0x2 + ETHTOOL_FEC_NONE_BIT = 0x0 + ETHTOOL_FEC_AUTO_BIT = 0x1 + ETHTOOL_FEC_OFF_BIT = 0x2 + ETHTOOL_FEC_RS_BIT = 0x3 + ETHTOOL_FEC_BASER_BIT = 0x4 + ETHTOOL_FEC_LLRS_BIT = 0x5 + ETHTOOL_LINK_MODE_10baseT_Half_BIT = 0x0 + ETHTOOL_LINK_MODE_10baseT_Full_BIT = 0x1 + ETHTOOL_LINK_MODE_100baseT_Half_BIT = 0x2 + ETHTOOL_LINK_MODE_100baseT_Full_BIT = 0x3 + ETHTOOL_LINK_MODE_1000baseT_Half_BIT = 0x4 + ETHTOOL_LINK_MODE_1000baseT_Full_BIT = 0x5 + ETHTOOL_LINK_MODE_Autoneg_BIT = 0x6 + ETHTOOL_LINK_MODE_TP_BIT = 0x7 + ETHTOOL_LINK_MODE_AUI_BIT = 0x8 + ETHTOOL_LINK_MODE_MII_BIT = 0x9 + ETHTOOL_LINK_MODE_FIBRE_BIT = 0xa + ETHTOOL_LINK_MODE_BNC_BIT = 0xb + ETHTOOL_LINK_MODE_10000baseT_Full_BIT = 0xc + ETHTOOL_LINK_MODE_Pause_BIT = 0xd + ETHTOOL_LINK_MODE_Asym_Pause_BIT = 0xe + ETHTOOL_LINK_MODE_2500baseX_Full_BIT = 0xf + ETHTOOL_LINK_MODE_Backplane_BIT = 0x10 + ETHTOOL_LINK_MODE_1000baseKX_Full_BIT = 0x11 + ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT = 0x12 + ETHTOOL_LINK_MODE_10000baseKR_Full_BIT = 0x13 + ETHTOOL_LINK_MODE_10000baseR_FEC_BIT = 0x14 + ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT = 0x15 + ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT = 0x16 + ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT = 0x17 + ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT = 0x18 + ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT = 0x19 + ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT = 0x1a + ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT = 0x1b + ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT = 0x1c + ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 0x1d + ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 0x1e + ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 0x1f + ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 0x20 + ETHTOOL_LINK_MODE_25000baseSR_Full_BIT = 0x21 + ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT = 0x22 + ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT = 0x23 + ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT = 0x24 + ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT = 0x25 + ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT = 0x26 + ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT = 0x27 + ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT = 0x28 + ETHTOOL_LINK_MODE_1000baseX_Full_BIT = 0x29 + ETHTOOL_LINK_MODE_10000baseCR_Full_BIT = 0x2a + ETHTOOL_LINK_MODE_10000baseSR_Full_BIT = 0x2b + ETHTOOL_LINK_MODE_10000baseLR_Full_BIT = 0x2c + ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT = 0x2d + ETHTOOL_LINK_MODE_10000baseER_Full_BIT = 0x2e + ETHTOOL_LINK_MODE_2500baseT_Full_BIT = 0x2f + ETHTOOL_LINK_MODE_5000baseT_Full_BIT = 0x30 + ETHTOOL_LINK_MODE_FEC_NONE_BIT = 0x31 + ETHTOOL_LINK_MODE_FEC_RS_BIT = 0x32 + ETHTOOL_LINK_MODE_FEC_BASER_BIT = 0x33 + ETHTOOL_LINK_MODE_50000baseKR_Full_BIT = 0x34 + ETHTOOL_LINK_MODE_50000baseSR_Full_BIT = 0x35 + ETHTOOL_LINK_MODE_50000baseCR_Full_BIT = 0x36 + ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT = 0x37 + ETHTOOL_LINK_MODE_50000baseDR_Full_BIT = 0x38 + ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT = 0x39 + ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT = 0x3a + ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT = 0x3b + ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT = 0x3c + ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT = 0x3d + ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT = 0x3e + ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT = 0x3f + ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT = 0x40 + ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT = 0x41 + ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT = 0x42 + ETHTOOL_LINK_MODE_100baseT1_Full_BIT = 0x43 + ETHTOOL_LINK_MODE_1000baseT1_Full_BIT = 0x44 + ETHTOOL_LINK_MODE_400000baseKR8_Full_BIT = 0x45 + ETHTOOL_LINK_MODE_400000baseSR8_Full_BIT = 0x46 + ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT = 0x47 + ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT = 0x48 + ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT = 0x49 + ETHTOOL_LINK_MODE_FEC_LLRS_BIT = 0x4a + ETHTOOL_LINK_MODE_100000baseKR_Full_BIT = 0x4b + ETHTOOL_LINK_MODE_100000baseSR_Full_BIT = 0x4c + ETHTOOL_LINK_MODE_100000baseLR_ER_FR_Full_BIT = 0x4d + ETHTOOL_LINK_MODE_100000baseCR_Full_BIT = 0x4e + ETHTOOL_LINK_MODE_100000baseDR_Full_BIT = 0x4f + ETHTOOL_LINK_MODE_200000baseKR2_Full_BIT = 0x50 + ETHTOOL_LINK_MODE_200000baseSR2_Full_BIT = 0x51 + ETHTOOL_LINK_MODE_200000baseLR2_ER2_FR2_Full_BIT = 0x52 + ETHTOOL_LINK_MODE_200000baseDR2_Full_BIT = 0x53 + ETHTOOL_LINK_MODE_200000baseCR2_Full_BIT = 0x54 + ETHTOOL_LINK_MODE_400000baseKR4_Full_BIT = 0x55 + ETHTOOL_LINK_MODE_400000baseSR4_Full_BIT = 0x56 + ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT = 0x57 + ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT = 0x58 + ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT = 0x59 + ETHTOOL_LINK_MODE_100baseFX_Half_BIT = 0x5a + ETHTOOL_LINK_MODE_100baseFX_Full_BIT = 0x5b + + ETHTOOL_MSG_USER_NONE = 0x0 + ETHTOOL_MSG_STRSET_GET = 0x1 + ETHTOOL_MSG_LINKINFO_GET = 0x2 + ETHTOOL_MSG_LINKINFO_SET = 0x3 + ETHTOOL_MSG_LINKMODES_GET = 0x4 + ETHTOOL_MSG_LINKMODES_SET = 0x5 + ETHTOOL_MSG_LINKSTATE_GET = 0x6 + ETHTOOL_MSG_DEBUG_GET = 0x7 + ETHTOOL_MSG_DEBUG_SET = 0x8 + ETHTOOL_MSG_WOL_GET = 0x9 + ETHTOOL_MSG_WOL_SET = 0xa + ETHTOOL_MSG_FEATURES_GET = 0xb + ETHTOOL_MSG_FEATURES_SET = 0xc + ETHTOOL_MSG_PRIVFLAGS_GET = 0xd + ETHTOOL_MSG_PRIVFLAGS_SET = 0xe + ETHTOOL_MSG_RINGS_GET = 0xf + ETHTOOL_MSG_RINGS_SET = 0x10 + ETHTOOL_MSG_CHANNELS_GET = 0x11 + ETHTOOL_MSG_CHANNELS_SET = 0x12 + ETHTOOL_MSG_COALESCE_GET = 0x13 + ETHTOOL_MSG_COALESCE_SET = 0x14 + ETHTOOL_MSG_PAUSE_GET = 0x15 + ETHTOOL_MSG_PAUSE_SET = 0x16 + ETHTOOL_MSG_EEE_GET = 0x17 + ETHTOOL_MSG_EEE_SET = 0x18 + ETHTOOL_MSG_TSINFO_GET = 0x19 + ETHTOOL_MSG_CABLE_TEST_ACT = 0x1a + ETHTOOL_MSG_CABLE_TEST_TDR_ACT = 0x1b + ETHTOOL_MSG_TUNNEL_INFO_GET = 0x1c + ETHTOOL_MSG_USER_MAX = 0x1c + ETHTOOL_MSG_KERNEL_NONE = 0x0 + ETHTOOL_MSG_STRSET_GET_REPLY = 0x1 + ETHTOOL_MSG_LINKINFO_GET_REPLY = 0x2 + ETHTOOL_MSG_LINKINFO_NTF = 0x3 + ETHTOOL_MSG_LINKMODES_GET_REPLY = 0x4 + ETHTOOL_MSG_LINKMODES_NTF = 0x5 + ETHTOOL_MSG_LINKSTATE_GET_REPLY = 0x6 + ETHTOOL_MSG_DEBUG_GET_REPLY = 0x7 + ETHTOOL_MSG_DEBUG_NTF = 0x8 + ETHTOOL_MSG_WOL_GET_REPLY = 0x9 + ETHTOOL_MSG_WOL_NTF = 0xa + ETHTOOL_MSG_FEATURES_GET_REPLY = 0xb + ETHTOOL_MSG_FEATURES_SET_REPLY = 0xc + ETHTOOL_MSG_FEATURES_NTF = 0xd + ETHTOOL_MSG_PRIVFLAGS_GET_REPLY = 0xe + ETHTOOL_MSG_PRIVFLAGS_NTF = 0xf + ETHTOOL_MSG_RINGS_GET_REPLY = 0x10 + ETHTOOL_MSG_RINGS_NTF = 0x11 + ETHTOOL_MSG_CHANNELS_GET_REPLY = 0x12 + ETHTOOL_MSG_CHANNELS_NTF = 0x13 + ETHTOOL_MSG_COALESCE_GET_REPLY = 0x14 + ETHTOOL_MSG_COALESCE_NTF = 0x15 + ETHTOOL_MSG_PAUSE_GET_REPLY = 0x16 + ETHTOOL_MSG_PAUSE_NTF = 0x17 + ETHTOOL_MSG_EEE_GET_REPLY = 0x18 + ETHTOOL_MSG_EEE_NTF = 0x19 + ETHTOOL_MSG_TSINFO_GET_REPLY = 0x1a + ETHTOOL_MSG_CABLE_TEST_NTF = 0x1b + ETHTOOL_MSG_CABLE_TEST_TDR_NTF = 0x1c + ETHTOOL_MSG_TUNNEL_INFO_GET_REPLY = 0x1d + ETHTOOL_MSG_KERNEL_MAX = 0x1d + ETHTOOL_A_HEADER_UNSPEC = 0x0 + ETHTOOL_A_HEADER_DEV_INDEX = 0x1 + ETHTOOL_A_HEADER_DEV_NAME = 0x2 + ETHTOOL_A_HEADER_FLAGS = 0x3 + ETHTOOL_A_HEADER_MAX = 0x3 + ETHTOOL_A_BITSET_BIT_UNSPEC = 0x0 + ETHTOOL_A_BITSET_BIT_INDEX = 0x1 + ETHTOOL_A_BITSET_BIT_NAME = 0x2 + ETHTOOL_A_BITSET_BIT_VALUE = 0x3 + ETHTOOL_A_BITSET_BIT_MAX = 0x3 + ETHTOOL_A_BITSET_BITS_UNSPEC = 0x0 + ETHTOOL_A_BITSET_BITS_BIT = 0x1 + ETHTOOL_A_BITSET_BITS_MAX = 0x1 + ETHTOOL_A_BITSET_UNSPEC = 0x0 + ETHTOOL_A_BITSET_NOMASK = 0x1 + ETHTOOL_A_BITSET_SIZE = 0x2 + ETHTOOL_A_BITSET_BITS = 0x3 + ETHTOOL_A_BITSET_VALUE = 0x4 + ETHTOOL_A_BITSET_MASK = 0x5 + ETHTOOL_A_BITSET_MAX = 0x5 + ETHTOOL_A_STRING_UNSPEC = 0x0 + ETHTOOL_A_STRING_INDEX = 0x1 + ETHTOOL_A_STRING_VALUE = 0x2 + ETHTOOL_A_STRING_MAX = 0x2 + ETHTOOL_A_STRINGS_UNSPEC = 0x0 + ETHTOOL_A_STRINGS_STRING = 0x1 + ETHTOOL_A_STRINGS_MAX = 0x1 + ETHTOOL_A_STRINGSET_UNSPEC = 0x0 + ETHTOOL_A_STRINGSET_ID = 0x1 + ETHTOOL_A_STRINGSET_COUNT = 0x2 + ETHTOOL_A_STRINGSET_STRINGS = 0x3 + ETHTOOL_A_STRINGSET_MAX = 0x3 + ETHTOOL_A_STRINGSETS_UNSPEC = 0x0 + ETHTOOL_A_STRINGSETS_STRINGSET = 0x1 + ETHTOOL_A_STRINGSETS_MAX = 0x1 + ETHTOOL_A_STRSET_UNSPEC = 0x0 + ETHTOOL_A_STRSET_HEADER = 0x1 + ETHTOOL_A_STRSET_STRINGSETS = 0x2 + ETHTOOL_A_STRSET_COUNTS_ONLY = 0x3 + ETHTOOL_A_STRSET_MAX = 0x3 + ETHTOOL_A_LINKINFO_UNSPEC = 0x0 + ETHTOOL_A_LINKINFO_HEADER = 0x1 + ETHTOOL_A_LINKINFO_PORT = 0x2 + ETHTOOL_A_LINKINFO_PHYADDR = 0x3 + ETHTOOL_A_LINKINFO_TP_MDIX = 0x4 + ETHTOOL_A_LINKINFO_TP_MDIX_CTRL = 0x5 + ETHTOOL_A_LINKINFO_TRANSCEIVER = 0x6 + ETHTOOL_A_LINKINFO_MAX = 0x6 + ETHTOOL_A_LINKMODES_UNSPEC = 0x0 + ETHTOOL_A_LINKMODES_HEADER = 0x1 + ETHTOOL_A_LINKMODES_AUTONEG = 0x2 + ETHTOOL_A_LINKMODES_OURS = 0x3 + ETHTOOL_A_LINKMODES_PEER = 0x4 + ETHTOOL_A_LINKMODES_SPEED = 0x5 + ETHTOOL_A_LINKMODES_DUPLEX = 0x6 + ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG = 0x7 + ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE = 0x8 + ETHTOOL_A_LINKMODES_MAX = 0x8 + ETHTOOL_A_LINKSTATE_UNSPEC = 0x0 + ETHTOOL_A_LINKSTATE_HEADER = 0x1 + ETHTOOL_A_LINKSTATE_LINK = 0x2 + ETHTOOL_A_LINKSTATE_SQI = 0x3 + ETHTOOL_A_LINKSTATE_SQI_MAX = 0x4 + ETHTOOL_A_LINKSTATE_EXT_STATE = 0x5 + ETHTOOL_A_LINKSTATE_EXT_SUBSTATE = 0x6 + ETHTOOL_A_LINKSTATE_MAX = 0x6 + ETHTOOL_A_DEBUG_UNSPEC = 0x0 + ETHTOOL_A_DEBUG_HEADER = 0x1 + ETHTOOL_A_DEBUG_MSGMASK = 0x2 + ETHTOOL_A_DEBUG_MAX = 0x2 + ETHTOOL_A_WOL_UNSPEC = 0x0 + ETHTOOL_A_WOL_HEADER = 0x1 + ETHTOOL_A_WOL_MODES = 0x2 + ETHTOOL_A_WOL_SOPASS = 0x3 + ETHTOOL_A_WOL_MAX = 0x3 + ETHTOOL_A_FEATURES_UNSPEC = 0x0 + ETHTOOL_A_FEATURES_HEADER = 0x1 + ETHTOOL_A_FEATURES_HW = 0x2 + ETHTOOL_A_FEATURES_WANTED = 0x3 + ETHTOOL_A_FEATURES_ACTIVE = 0x4 + ETHTOOL_A_FEATURES_NOCHANGE = 0x5 + ETHTOOL_A_FEATURES_MAX = 0x5 + ETHTOOL_A_PRIVFLAGS_UNSPEC = 0x0 + ETHTOOL_A_PRIVFLAGS_HEADER = 0x1 + ETHTOOL_A_PRIVFLAGS_FLAGS = 0x2 + ETHTOOL_A_PRIVFLAGS_MAX = 0x2 + ETHTOOL_A_RINGS_UNSPEC = 0x0 + ETHTOOL_A_RINGS_HEADER = 0x1 + ETHTOOL_A_RINGS_RX_MAX = 0x2 + ETHTOOL_A_RINGS_RX_MINI_MAX = 0x3 + ETHTOOL_A_RINGS_RX_JUMBO_MAX = 0x4 + ETHTOOL_A_RINGS_TX_MAX = 0x5 + ETHTOOL_A_RINGS_RX = 0x6 + ETHTOOL_A_RINGS_RX_MINI = 0x7 + ETHTOOL_A_RINGS_RX_JUMBO = 0x8 + ETHTOOL_A_RINGS_TX = 0x9 + ETHTOOL_A_RINGS_MAX = 0x9 + ETHTOOL_A_CHANNELS_UNSPEC = 0x0 + ETHTOOL_A_CHANNELS_HEADER = 0x1 + ETHTOOL_A_CHANNELS_RX_MAX = 0x2 + ETHTOOL_A_CHANNELS_TX_MAX = 0x3 + ETHTOOL_A_CHANNELS_OTHER_MAX = 0x4 + ETHTOOL_A_CHANNELS_COMBINED_MAX = 0x5 + ETHTOOL_A_CHANNELS_RX_COUNT = 0x6 + ETHTOOL_A_CHANNELS_TX_COUNT = 0x7 + ETHTOOL_A_CHANNELS_OTHER_COUNT = 0x8 + ETHTOOL_A_CHANNELS_COMBINED_COUNT = 0x9 + ETHTOOL_A_CHANNELS_MAX = 0x9 + ETHTOOL_A_COALESCE_UNSPEC = 0x0 + ETHTOOL_A_COALESCE_HEADER = 0x1 + ETHTOOL_A_COALESCE_RX_USECS = 0x2 + ETHTOOL_A_COALESCE_RX_MAX_FRAMES = 0x3 + ETHTOOL_A_COALESCE_RX_USECS_IRQ = 0x4 + ETHTOOL_A_COALESCE_RX_MAX_FRAMES_IRQ = 0x5 + ETHTOOL_A_COALESCE_TX_USECS = 0x6 + ETHTOOL_A_COALESCE_TX_MAX_FRAMES = 0x7 + ETHTOOL_A_COALESCE_TX_USECS_IRQ = 0x8 + ETHTOOL_A_COALESCE_TX_MAX_FRAMES_IRQ = 0x9 + ETHTOOL_A_COALESCE_STATS_BLOCK_USECS = 0xa + ETHTOOL_A_COALESCE_USE_ADAPTIVE_RX = 0xb + ETHTOOL_A_COALESCE_USE_ADAPTIVE_TX = 0xc + ETHTOOL_A_COALESCE_PKT_RATE_LOW = 0xd + ETHTOOL_A_COALESCE_RX_USECS_LOW = 0xe + ETHTOOL_A_COALESCE_RX_MAX_FRAMES_LOW = 0xf + ETHTOOL_A_COALESCE_TX_USECS_LOW = 0x10 + ETHTOOL_A_COALESCE_TX_MAX_FRAMES_LOW = 0x11 + ETHTOOL_A_COALESCE_PKT_RATE_HIGH = 0x12 + ETHTOOL_A_COALESCE_RX_USECS_HIGH = 0x13 + ETHTOOL_A_COALESCE_RX_MAX_FRAMES_HIGH = 0x14 + ETHTOOL_A_COALESCE_TX_USECS_HIGH = 0x15 + ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH = 0x16 + ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL = 0x17 + ETHTOOL_A_COALESCE_MAX = 0x17 + ETHTOOL_A_PAUSE_UNSPEC = 0x0 + ETHTOOL_A_PAUSE_HEADER = 0x1 + ETHTOOL_A_PAUSE_AUTONEG = 0x2 + ETHTOOL_A_PAUSE_RX = 0x3 + ETHTOOL_A_PAUSE_TX = 0x4 + ETHTOOL_A_PAUSE_STATS = 0x5 + ETHTOOL_A_PAUSE_MAX = 0x5 + ETHTOOL_A_PAUSE_STAT_UNSPEC = 0x0 + ETHTOOL_A_PAUSE_STAT_PAD = 0x1 + ETHTOOL_A_PAUSE_STAT_TX_FRAMES = 0x2 + ETHTOOL_A_PAUSE_STAT_RX_FRAMES = 0x3 + ETHTOOL_A_PAUSE_STAT_MAX = 0x3 + ETHTOOL_A_EEE_UNSPEC = 0x0 + ETHTOOL_A_EEE_HEADER = 0x1 + ETHTOOL_A_EEE_MODES_OURS = 0x2 + ETHTOOL_A_EEE_MODES_PEER = 0x3 + ETHTOOL_A_EEE_ACTIVE = 0x4 + ETHTOOL_A_EEE_ENABLED = 0x5 + ETHTOOL_A_EEE_TX_LPI_ENABLED = 0x6 + ETHTOOL_A_EEE_TX_LPI_TIMER = 0x7 + ETHTOOL_A_EEE_MAX = 0x7 + ETHTOOL_A_TSINFO_UNSPEC = 0x0 + ETHTOOL_A_TSINFO_HEADER = 0x1 + ETHTOOL_A_TSINFO_TIMESTAMPING = 0x2 + ETHTOOL_A_TSINFO_TX_TYPES = 0x3 + ETHTOOL_A_TSINFO_RX_FILTERS = 0x4 + ETHTOOL_A_TSINFO_PHC_INDEX = 0x5 + ETHTOOL_A_TSINFO_MAX = 0x5 + ETHTOOL_A_CABLE_TEST_UNSPEC = 0x0 + ETHTOOL_A_CABLE_TEST_HEADER = 0x1 + ETHTOOL_A_CABLE_TEST_MAX = 0x1 + ETHTOOL_A_CABLE_RESULT_CODE_UNSPEC = 0x0 + ETHTOOL_A_CABLE_RESULT_CODE_OK = 0x1 + ETHTOOL_A_CABLE_RESULT_CODE_OPEN = 0x2 + ETHTOOL_A_CABLE_RESULT_CODE_SAME_SHORT = 0x3 + ETHTOOL_A_CABLE_RESULT_CODE_CROSS_SHORT = 0x4 + ETHTOOL_A_CABLE_PAIR_A = 0x0 + ETHTOOL_A_CABLE_PAIR_B = 0x1 + ETHTOOL_A_CABLE_PAIR_C = 0x2 + ETHTOOL_A_CABLE_PAIR_D = 0x3 + ETHTOOL_A_CABLE_RESULT_UNSPEC = 0x0 + ETHTOOL_A_CABLE_RESULT_PAIR = 0x1 + ETHTOOL_A_CABLE_RESULT_CODE = 0x2 + ETHTOOL_A_CABLE_RESULT_MAX = 0x2 + ETHTOOL_A_CABLE_FAULT_LENGTH_UNSPEC = 0x0 + ETHTOOL_A_CABLE_FAULT_LENGTH_PAIR = 0x1 + ETHTOOL_A_CABLE_FAULT_LENGTH_CM = 0x2 + ETHTOOL_A_CABLE_FAULT_LENGTH_MAX = 0x2 + ETHTOOL_A_CABLE_TEST_NTF_STATUS_UNSPEC = 0x0 + ETHTOOL_A_CABLE_TEST_NTF_STATUS_STARTED = 0x1 + ETHTOOL_A_CABLE_TEST_NTF_STATUS_COMPLETED = 0x2 + ETHTOOL_A_CABLE_NEST_UNSPEC = 0x0 + ETHTOOL_A_CABLE_NEST_RESULT = 0x1 + ETHTOOL_A_CABLE_NEST_FAULT_LENGTH = 0x2 + ETHTOOL_A_CABLE_NEST_MAX = 0x2 + ETHTOOL_A_CABLE_TEST_NTF_UNSPEC = 0x0 + ETHTOOL_A_CABLE_TEST_NTF_HEADER = 0x1 + ETHTOOL_A_CABLE_TEST_NTF_STATUS = 0x2 + ETHTOOL_A_CABLE_TEST_NTF_NEST = 0x3 + ETHTOOL_A_CABLE_TEST_NTF_MAX = 0x3 + ETHTOOL_A_CABLE_TEST_TDR_CFG_UNSPEC = 0x0 + ETHTOOL_A_CABLE_TEST_TDR_CFG_FIRST = 0x1 + ETHTOOL_A_CABLE_TEST_TDR_CFG_LAST = 0x2 + ETHTOOL_A_CABLE_TEST_TDR_CFG_STEP = 0x3 + ETHTOOL_A_CABLE_TEST_TDR_CFG_PAIR = 0x4 + ETHTOOL_A_CABLE_TEST_TDR_CFG_MAX = 0x4 + ETHTOOL_A_CABLE_TEST_TDR_UNSPEC = 0x0 + ETHTOOL_A_CABLE_TEST_TDR_HEADER = 0x1 + ETHTOOL_A_CABLE_TEST_TDR_CFG = 0x2 + ETHTOOL_A_CABLE_TEST_TDR_MAX = 0x2 + ETHTOOL_A_CABLE_AMPLITUDE_UNSPEC = 0x0 + ETHTOOL_A_CABLE_AMPLITUDE_PAIR = 0x1 + ETHTOOL_A_CABLE_AMPLITUDE_mV = 0x2 + ETHTOOL_A_CABLE_AMPLITUDE_MAX = 0x2 + ETHTOOL_A_CABLE_PULSE_UNSPEC = 0x0 + ETHTOOL_A_CABLE_PULSE_mV = 0x1 + ETHTOOL_A_CABLE_PULSE_MAX = 0x1 + ETHTOOL_A_CABLE_STEP_UNSPEC = 0x0 + ETHTOOL_A_CABLE_STEP_FIRST_DISTANCE = 0x1 + ETHTOOL_A_CABLE_STEP_LAST_DISTANCE = 0x2 + ETHTOOL_A_CABLE_STEP_STEP_DISTANCE = 0x3 + ETHTOOL_A_CABLE_STEP_MAX = 0x3 + ETHTOOL_A_CABLE_TDR_NEST_UNSPEC = 0x0 + ETHTOOL_A_CABLE_TDR_NEST_STEP = 0x1 + ETHTOOL_A_CABLE_TDR_NEST_AMPLITUDE = 0x2 + ETHTOOL_A_CABLE_TDR_NEST_PULSE = 0x3 + ETHTOOL_A_CABLE_TDR_NEST_MAX = 0x3 + ETHTOOL_A_CABLE_TEST_TDR_NTF_UNSPEC = 0x0 + ETHTOOL_A_CABLE_TEST_TDR_NTF_HEADER = 0x1 + ETHTOOL_A_CABLE_TEST_TDR_NTF_STATUS = 0x2 + ETHTOOL_A_CABLE_TEST_TDR_NTF_NEST = 0x3 + ETHTOOL_A_CABLE_TEST_TDR_NTF_MAX = 0x3 + ETHTOOL_UDP_TUNNEL_TYPE_VXLAN = 0x0 + ETHTOOL_UDP_TUNNEL_TYPE_GENEVE = 0x1 + ETHTOOL_UDP_TUNNEL_TYPE_VXLAN_GPE = 0x2 + ETHTOOL_A_TUNNEL_UDP_ENTRY_UNSPEC = 0x0 + ETHTOOL_A_TUNNEL_UDP_ENTRY_PORT = 0x1 + ETHTOOL_A_TUNNEL_UDP_ENTRY_TYPE = 0x2 + ETHTOOL_A_TUNNEL_UDP_ENTRY_MAX = 0x2 + ETHTOOL_A_TUNNEL_UDP_TABLE_UNSPEC = 0x0 + ETHTOOL_A_TUNNEL_UDP_TABLE_SIZE = 0x1 + ETHTOOL_A_TUNNEL_UDP_TABLE_TYPES = 0x2 + ETHTOOL_A_TUNNEL_UDP_TABLE_ENTRY = 0x3 + ETHTOOL_A_TUNNEL_UDP_TABLE_MAX = 0x3 + ETHTOOL_A_TUNNEL_UDP_UNSPEC = 0x0 + ETHTOOL_A_TUNNEL_UDP_TABLE = 0x1 + ETHTOOL_A_TUNNEL_UDP_MAX = 0x1 + ETHTOOL_A_TUNNEL_INFO_UNSPEC = 0x0 + ETHTOOL_A_TUNNEL_INFO_HEADER = 0x1 + ETHTOOL_A_TUNNEL_INFO_UDP_PORTS = 0x2 + ETHTOOL_A_TUNNEL_INFO_MAX = 0x2 +) + +type EthtoolDrvinfo struct { + Cmd uint32 + Driver [32]byte + Version [32]byte + Fw_version [32]byte + Bus_info [32]byte + Erom_version [32]byte + Reserved2 [12]byte + N_priv_flags uint32 + N_stats uint32 + Testinfo_len uint32 + Eedump_len uint32 + Regdump_len uint32 +} + +type ( + HIDRawReportDescriptor struct { + Size uint32 + Value [4096]uint8 + } + HIDRawDevInfo struct { + Bustype uint32 + Vendor int16 + Product int16 + } +) + +const ( + CLOSE_RANGE_UNSHARE = 0x2 + CLOSE_RANGE_CLOEXEC = 0x4 +) + +const ( + NLMSGERR_ATTR_MSG = 0x1 + NLMSGERR_ATTR_OFFS = 0x2 + NLMSGERR_ATTR_COOKIE = 0x3 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index d54618aa61..4d4d283de5 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -1,6 +1,7 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 /build/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build 386 && linux // +build 386,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index 741d25be95..8a2eed5ec4 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -1,6 +1,7 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 /build/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && linux // +build amd64,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index e8d982c3df..94b34add64 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -1,6 +1,7 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm && linux // +build arm,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index 311cf2155d..2143de4d59 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -1,6 +1,7 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm64 && linux // +build arm64,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 1312bdf77f..a40216eee6 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -1,6 +1,7 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build mips && linux // +build mips,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index 2a99348195..e834b069fd 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -1,6 +1,7 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build mips64 && linux // +build mips64,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index f964307b29..e31083b048 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -1,6 +1,7 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build mips64le && linux // +build mips64le,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index ca0fab2702..42811f7fb5 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -1,6 +1,7 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build mipsle && linux // +build mipsle,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index 257e004247..2a3afbaef9 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -1,6 +1,7 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build ppc64 && linux // +build ppc64,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 980dd31736..c0de30a658 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -1,6 +1,7 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build ppc64le && linux // +build ppc64le,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index d9fdab20b8..74faf2e91f 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -1,6 +1,7 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build riscv64 && linux // +build riscv64,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index c25de8c679..9a8f0c2c6a 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -1,6 +1,7 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build s390x && linux // +build s390x,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 97fca65340..72cdda75bd 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -1,6 +1,7 @@ -// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build sparc64 && linux // +build sparc64,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go index a89100c08a..b10e73abf9 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go @@ -1,6 +1,7 @@ // cgo -godefs types_netbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build 386 && netbsd // +build 386,netbsd package unix @@ -248,6 +249,7 @@ const ( SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x14 SizeofLinger = 0x8 + SizeofIovec = 0x8 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x1c diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go index 289184e0b3..28ed6d55ae 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go @@ -1,6 +1,7 @@ // cgo -godefs types_netbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && netbsd // +build amd64,netbsd package unix @@ -255,6 +256,7 @@ const ( SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x14 SizeofLinger = 0x8 + SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go index 428c450e4c..4ba196ebe5 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go @@ -1,6 +1,7 @@ // cgo -godefs types_netbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm && netbsd // +build arm,netbsd package unix @@ -253,6 +254,7 @@ const ( SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x14 SizeofLinger = 0x8 + SizeofIovec = 0x8 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x1c diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go index 6f1f2842cc..dd642bd9c8 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go @@ -1,6 +1,7 @@ // cgo -godefs types_netbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm64 && netbsd // +build arm64,netbsd package unix @@ -255,6 +256,7 @@ const ( SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x14 SizeofLinger = 0x8 + SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go index 61ea0019a2..1fdb0e5fa5 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go @@ -1,6 +1,7 @@ // cgo -godefs types_openbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build 386 && openbsd // +build 386,openbsd package unix @@ -231,6 +232,7 @@ const ( SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x20 SizeofLinger = 0x8 + SizeofIovec = 0x8 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x1c diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go index 87a493f68f..e2fc93c7c0 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go @@ -1,6 +1,7 @@ // cgo -godefs types_openbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && openbsd // +build amd64,openbsd package unix @@ -235,6 +236,7 @@ const ( SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x20 SizeofLinger = 0x8 + SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go index d80836efab..8d34b5a2fc 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go @@ -1,6 +1,7 @@ // cgo -godefs -- -fsigned-char types_openbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm && openbsd // +build arm,openbsd package unix @@ -235,6 +236,7 @@ const ( SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x20 SizeofLinger = 0x8 + SizeofIovec = 0x8 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x1c diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go index 4e158746f1..ea8f1a0d9b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go @@ -1,6 +1,7 @@ // cgo -godefs -- -fsigned-char types_openbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build arm64 && openbsd // +build arm64,openbsd package unix @@ -231,6 +232,7 @@ const ( SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x20 SizeofLinger = 0x8 + SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go index 992a1f8c01..ec6e8bc3f1 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go @@ -1,6 +1,7 @@ // cgo -godefs -- -fsigned-char types_openbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build mips64 && openbsd // +build mips64,openbsd package unix @@ -231,6 +232,7 @@ const ( SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x20 SizeofLinger = 0x8 + SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 diff --git a/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go index db817f3ba8..85effef9c1 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go @@ -1,6 +1,7 @@ // cgo -godefs types_solaris.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. +//go:build amd64 && solaris // +build amd64,solaris package unix @@ -234,6 +235,7 @@ const ( SizeofSockaddrUnix = 0x6e SizeofSockaddrDatalink = 0xfc SizeofLinger = 0x8 + SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 diff --git a/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go new file mode 100644 index 0000000000..8bffde78e5 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go @@ -0,0 +1,402 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build zos && s390x +// +build zos,s390x + +// Hand edited based on ztypes_linux_s390x.go +// TODO: auto-generate. + +package unix + +const ( + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 + PathMax = 0x1000 +) + +const ( + SizeofSockaddrAny = 128 + SizeofCmsghdr = 12 + SizeofIPMreq = 8 + SizeofIPv6Mreq = 20 + SizeofICMPv6Filter = 32 + SizeofIPv6MTUInfo = 32 + SizeofLinger = 8 + SizeofSockaddrInet4 = 16 + SizeofSockaddrInet6 = 28 + SizeofTCPInfo = 0x68 +) + +type ( + _C_short int16 + _C_int int32 + _C_long int64 + _C_long_long int64 +) + +type Timespec struct { + Sec int64 + Nsec int64 +} + +type Timeval struct { + Sec int64 + Usec int64 +} + +type timeval_zos struct { //correct (with padding and all) + Sec int64 + _ [4]byte // pad + Usec int32 +} + +type Tms struct { //clock_t is 4-byte unsigned int in zos + Utime uint32 + Stime uint32 + Cutime uint32 + Cstime uint32 +} + +type Time_t int64 + +type Utimbuf struct { + Actime int64 + Modtime int64 +} + +type Utsname struct { + Sysname [65]byte + Nodename [65]byte + Release [65]byte + Version [65]byte + Machine [65]byte + Domainname [65]byte +} + +type RawSockaddrInet4 struct { + Len uint8 + Family uint8 + Port uint16 + Addr [4]byte /* in_addr */ + Zero [8]uint8 +} + +type RawSockaddrInet6 struct { + Len uint8 + Family uint8 + Port uint16 + Flowinfo uint32 + Addr [16]byte /* in6_addr */ + Scope_id uint32 +} + +type RawSockaddrUnix struct { + Len uint8 + Family uint8 + Path [108]int8 +} + +type RawSockaddr struct { + Len uint8 + Family uint8 + Data [14]uint8 +} + +type RawSockaddrAny struct { + Addr RawSockaddr + _ [112]uint8 // pad +} + +type _Socklen uint32 + +type Linger struct { + Onoff int32 + Linger int32 +} + +type Iovec struct { + Base *byte + Len uint64 +} + +type IPMreq struct { + Multiaddr [4]byte /* in_addr */ + Interface [4]byte /* in_addr */ +} + +type IPv6Mreq struct { + Multiaddr [16]byte /* in6_addr */ + Interface uint32 +} + +type Msghdr struct { + Name *byte + Iov *Iovec + Control *byte + Flags int32 + Namelen int32 + Iovlen int32 + Controllen int32 +} + +type Cmsghdr struct { + Len int32 + Level int32 + Type int32 +} + +type Inet4Pktinfo struct { + Addr [4]byte /* in_addr */ + Ifindex uint32 +} + +type Inet6Pktinfo struct { + Addr [16]byte /* in6_addr */ + Ifindex uint32 +} + +type IPv6MTUInfo struct { + Addr RawSockaddrInet6 + Mtu uint32 +} + +type ICMPv6Filter struct { + Data [8]uint32 +} + +type TCPInfo struct { + State uint8 + Ca_state uint8 + Retransmits uint8 + Probes uint8 + Backoff uint8 + Options uint8 + Rto uint32 + Ato uint32 + Snd_mss uint32 + Rcv_mss uint32 + Unacked uint32 + Sacked uint32 + Lost uint32 + Retrans uint32 + Fackets uint32 + Last_data_sent uint32 + Last_ack_sent uint32 + Last_data_recv uint32 + Last_ack_recv uint32 + Pmtu uint32 + Rcv_ssthresh uint32 + Rtt uint32 + Rttvar uint32 + Snd_ssthresh uint32 + Snd_cwnd uint32 + Advmss uint32 + Reordering uint32 + Rcv_rtt uint32 + Rcv_space uint32 + Total_retrans uint32 +} + +type _Gid_t uint32 + +type rusage_zos struct { + Utime timeval_zos + Stime timeval_zos +} + +type Rusage struct { + Utime Timeval + Stime Timeval + Maxrss int64 + Ixrss int64 + Idrss int64 + Isrss int64 + Minflt int64 + Majflt int64 + Nswap int64 + Inblock int64 + Oublock int64 + Msgsnd int64 + Msgrcv int64 + Nsignals int64 + Nvcsw int64 + Nivcsw int64 +} + +type Rlimit struct { + Cur uint64 + Max uint64 +} + +// { int, short, short } in poll.h +type PollFd struct { + Fd int32 + Events int16 + Revents int16 +} + +type Stat_t struct { //Linux Definition + Dev uint64 + Ino uint64 + Nlink uint64 + Mode uint32 + Uid uint32 + Gid uint32 + _ int32 + Rdev uint64 + Size int64 + Atim Timespec + Mtim Timespec + Ctim Timespec + Blksize int64 + Blocks int64 + _ [3]int64 +} + +type Stat_LE_t struct { + _ [4]byte // eye catcher + Length uint16 + Version uint16 + Mode int32 + Ino uint32 + Dev uint32 + Nlink int32 + Uid int32 + Gid int32 + Size int64 + Atim31 [4]byte + Mtim31 [4]byte + Ctim31 [4]byte + Rdev uint32 + Auditoraudit uint32 + Useraudit uint32 + Blksize int32 + Creatim31 [4]byte + AuditID [16]byte + _ [4]byte // rsrvd1 + File_tag struct { + Ccsid uint16 + Txtflag uint16 // aggregating Txflag:1 deferred:1 rsvflags:14 + } + CharsetID [8]byte + Blocks int64 + Genvalue uint32 + Reftim31 [4]byte + Fid [8]byte + Filefmt byte + Fspflag2 byte + _ [2]byte // rsrvd2 + Ctimemsec int32 + Seclabel [8]byte + _ [4]byte // rsrvd3 + _ [4]byte // rsrvd4 + Atim Time_t + Mtim Time_t + Ctim Time_t + Creatim Time_t + Reftim Time_t + _ [24]byte // rsrvd5 +} + +type Statvfs_t struct { + ID [4]byte + Len int32 + Bsize uint64 + Blocks uint64 + Usedspace uint64 + Bavail uint64 + Flag uint64 + Maxfilesize int64 + _ [16]byte + Frsize uint64 + Bfree uint64 + Files uint32 + Ffree uint32 + Favail uint32 + Namemax31 uint32 + Invarsec uint32 + _ [4]byte + Fsid uint64 + Namemax uint64 +} + +type Statfs_t struct { + Type uint32 + Bsize uint64 + Blocks uint64 + Bfree uint64 + Bavail uint64 + Files uint32 + Ffree uint32 + Fsid uint64 + Namelen uint64 + Frsize uint64 + Flags uint64 +} + +type Dirent struct { + Reclen uint16 + Namlen uint16 + Ino uint32 + Extra uintptr + Name [256]byte +} + +// This struct is packed on z/OS so it can't be used directly. +type Flock_t struct { + Type int16 + Whence int16 + Start int64 + Len int64 + Pid int32 +} + +type Termios struct { + Cflag uint32 + Iflag uint32 + Lflag uint32 + Oflag uint32 + Cc [11]uint8 +} + +type Winsize struct { + Row uint16 + Col uint16 + Xpixel uint16 + Ypixel uint16 +} + +type W_Mnth struct { + Hid [4]byte + Size int32 + Cur1 int32 //32bit pointer + Cur2 int32 //^ + Devno uint32 + _ [4]byte +} + +type W_Mntent struct { + Fstype uint32 + Mode uint32 + Dev uint32 + Parentdev uint32 + Rootino uint32 + Status byte + Ddname [9]byte + Fstname [9]byte + Fsname [45]byte + Pathlen uint32 + Mountpoint [1024]byte + Jobname [8]byte + PID int32 + Parmoffset int32 + Parmlen int16 + Owner [8]byte + Quiesceowner [8]byte + _ [38]byte +} diff --git a/vendor/golang.org/x/sys/windows/exec_windows.go b/vendor/golang.org/x/sys/windows/exec_windows.go index 3606c3a8b3..9eb1fb633a 100644 --- a/vendor/golang.org/x/sys/windows/exec_windows.go +++ b/vendor/golang.org/x/sys/windows/exec_windows.go @@ -6,6 +6,11 @@ package windows +import ( + errorspkg "errors" + "unsafe" +) + // EscapeArg rewrites command line argument s as prescribed // in http://msdn.microsoft.com/en-us/library/ms880421. // This function returns "" (2 double quotes) if s is empty. @@ -95,3 +100,33 @@ func FullPath(name string) (path string, err error) { } } } + +// NewProcThreadAttributeList allocates a new ProcThreadAttributeList, with the requested maximum number of attributes. +func NewProcThreadAttributeList(maxAttrCount uint32) (*ProcThreadAttributeList, error) { + var size uintptr + err := initializeProcThreadAttributeList(nil, maxAttrCount, 0, &size) + if err != ERROR_INSUFFICIENT_BUFFER { + if err == nil { + return nil, errorspkg.New("unable to query buffer size from InitializeProcThreadAttributeList") + } + return nil, err + } + const psize = unsafe.Sizeof(uintptr(0)) + // size is guaranteed to be ≥1 by InitializeProcThreadAttributeList. + al := (*ProcThreadAttributeList)(unsafe.Pointer(&make([]unsafe.Pointer, (size+psize-1)/psize)[0])) + err = initializeProcThreadAttributeList(al, maxAttrCount, 0, &size) + if err != nil { + return nil, err + } + return al, err +} + +// Update modifies the ProcThreadAttributeList using UpdateProcThreadAttribute. +func (al *ProcThreadAttributeList) Update(attribute uintptr, flags uint32, value unsafe.Pointer, size uintptr, prevValue unsafe.Pointer, returnedSize *uintptr) error { + return updateProcThreadAttribute(al, flags, attribute, value, size, prevValue, returnedSize) +} + +// Delete frees ProcThreadAttributeList's resources. +func (al *ProcThreadAttributeList) Delete() { + deleteProcThreadAttributeList(al) +} diff --git a/vendor/golang.org/x/sys/windows/mkerrors.bash b/vendor/golang.org/x/sys/windows/mkerrors.bash index 2163843a11..58e0188fb7 100644 --- a/vendor/golang.org/x/sys/windows/mkerrors.bash +++ b/vendor/golang.org/x/sys/windows/mkerrors.bash @@ -9,6 +9,8 @@ shopt -s nullglob winerror="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/shared/winerror.h | sort -Vr | head -n 1)" [[ -n $winerror ]] || { echo "Unable to find winerror.h" >&2; exit 1; } +ntstatus="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/shared/ntstatus.h | sort -Vr | head -n 1)" +[[ -n $ntstatus ]] || { echo "Unable to find ntstatus.h" >&2; exit 1; } declare -A errors @@ -59,5 +61,10 @@ declare -A errors echo "$key $vtype = $value" done < "$winerror" + while read -r line; do + [[ $line =~ ^#define\ (STATUS_[^\s]+)\ +\(\(NTSTATUS\)((0x)?[0-9a-fA-F]+)L?\) ]] || continue + echo "${BASH_REMATCH[1]} NTStatus = ${BASH_REMATCH[2]}" + done < "$ntstatus" + echo ")" } | gofmt > "zerrors_windows.go" diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go index 69eb462c59..111c10d3a7 100644 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ b/vendor/golang.org/x/sys/windows/security_windows.go @@ -908,6 +908,19 @@ type SECURITY_DESCRIPTOR struct { dacl *ACL } +type SECURITY_QUALITY_OF_SERVICE struct { + Length uint32 + ImpersonationLevel uint32 + ContextTrackingMode byte + EffectiveOnly byte +} + +// Constants for the ContextTrackingMode field of SECURITY_QUALITY_OF_SERVICE. +const ( + SECURITY_STATIC_TRACKING = 0 + SECURITY_DYNAMIC_TRACKING = 1 +) + type SecurityAttributes struct { Length uint32 SecurityDescriptor *SECURITY_DESCRIPTOR @@ -1321,7 +1334,11 @@ func (absoluteSD *SECURITY_DESCRIPTOR) ToSelfRelative() (selfRelativeSD *SECURIT } func (selfRelativeSD *SECURITY_DESCRIPTOR) copySelfRelativeSecurityDescriptor() *SECURITY_DESCRIPTOR { - sdLen := (int)(selfRelativeSD.Length()) + sdLen := int(selfRelativeSD.Length()) + const min = int(unsafe.Sizeof(SECURITY_DESCRIPTOR{})) + if sdLen < min { + sdLen = min + } var src []byte h := (*unsafeheader.Slice)(unsafe.Pointer(&src)) @@ -1329,7 +1346,15 @@ func (selfRelativeSD *SECURITY_DESCRIPTOR) copySelfRelativeSecurityDescriptor() h.Len = sdLen h.Cap = sdLen - dst := make([]byte, sdLen) + const psize = int(unsafe.Sizeof(uintptr(0))) + + var dst []byte + h = (*unsafeheader.Slice)(unsafe.Pointer(&dst)) + alloc := make([]uintptr, (sdLen+psize-1)/psize) + h.Data = (*unsafeheader.Slice)(unsafe.Pointer(&alloc)).Data + h.Len = sdLen + h.Cap = sdLen + copy(dst, src) return (*SECURITY_DESCRIPTOR)(unsafe.Pointer(&dst[0])) } diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 0f17fb75eb..bb6aaf89e4 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -8,6 +8,8 @@ package windows import ( errorspkg "errors" + "fmt" + "runtime" "sync" "syscall" "time" @@ -18,9 +20,11 @@ import ( ) type Handle uintptr +type HWND uintptr const ( InvalidHandle = ^Handle(0) + InvalidHWND = ^HWND(0) // Flags for DefineDosDevice. DDD_EXACT_MATCH_ON_REMOVE = 0x00000004 @@ -63,9 +67,8 @@ const ( LOCKFILE_FAIL_IMMEDIATELY = 0x00000001 LOCKFILE_EXCLUSIVE_LOCK = 0x00000002 - // Return values of SleepEx and other APC functions - STATUS_USER_APC = 0x000000C0 - WAIT_IO_COMPLETION = STATUS_USER_APC + // Return value of SleepEx and other APC functions + WAIT_IO_COMPLETION = 0x000000C0 ) // StringToUTF16 is deprecated. Use UTF16FromString instead. @@ -178,6 +181,11 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys IsWow64Process(handle Handle, isWow64 *bool) (err error) = IsWow64Process //sys IsWow64Process2(handle Handle, processMachine *uint16, nativeMachine *uint16) (err error) = IsWow64Process2? //sys CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile Handle) (handle Handle, err error) [failretval==InvalidHandle] = CreateFileW +//sys CreateNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *SecurityAttributes) (handle Handle, err error) [failretval==InvalidHandle] = CreateNamedPipeW +//sys ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error) +//sys GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) +//sys GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) = GetNamedPipeHandleStateW +//sys SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32) (err error) = SetNamedPipeHandleState //sys ReadFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) //sys WriteFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) //sys GetOverlappedResult(handle Handle, overlapped *Overlapped, done *uint32, wait bool) (err error) @@ -206,14 +214,21 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys GetSystemTimeAsFileTime(time *Filetime) //sys GetSystemTimePreciseAsFileTime(time *Filetime) //sys GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) [failretval==0xffffffff] -//sys CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uint32, threadcnt uint32) (handle Handle, err error) -//sys GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uint32, overlapped **Overlapped, timeout uint32) (err error) -//sys PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uint32, overlapped *Overlapped) (err error) +//sys CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uintptr, threadcnt uint32) (handle Handle, err error) +//sys GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uintptr, overlapped **Overlapped, timeout uint32) (err error) +//sys PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uintptr, overlapped *Overlapped) (err error) //sys CancelIo(s Handle) (err error) //sys CancelIoEx(s Handle, o *Overlapped) (err error) //sys CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) = CreateProcessW +//sys initializeProcThreadAttributeList(attrlist *ProcThreadAttributeList, attrcount uint32, flags uint32, size *uintptr) (err error) = InitializeProcThreadAttributeList +//sys deleteProcThreadAttributeList(attrlist *ProcThreadAttributeList) = DeleteProcThreadAttributeList +//sys updateProcThreadAttribute(attrlist *ProcThreadAttributeList, flags uint32, attr uintptr, value unsafe.Pointer, size uintptr, prevvalue unsafe.Pointer, returnedsize *uintptr) (err error) = UpdateProcThreadAttribute //sys OpenProcess(desiredAccess uint32, inheritHandle bool, processId uint32) (handle Handle, err error) //sys ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *uint16, showCmd int32) (err error) [failretval<=32] = shell32.ShellExecuteW +//sys GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) = user32.GetWindowThreadProcessId +//sys GetShellWindow() (shellWindow HWND) = user32.GetShellWindow +//sys MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) [failretval==0] = user32.MessageBoxW +//sys ExitWindowsEx(flags uint32, reason uint32) (err error) = user32.ExitWindowsEx //sys shGetKnownFolderPath(id *KNOWNFOLDERID, flags uint32, token Token, path **uint16) (ret error) = shell32.SHGetKnownFolderPath //sys TerminateProcess(handle Handle, exitcode uint32) (err error) //sys GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) @@ -242,13 +257,14 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys GetCommandLine() (cmd *uint16) = kernel32.GetCommandLineW //sys CommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, err error) [failretval==nil] = shell32.CommandLineToArgvW //sys LocalFree(hmem Handle) (handle Handle, err error) [failretval!=0] +//sys LocalAlloc(flags uint32, length uint32) (ptr uintptr, err error) //sys SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) //sys FlushFileBuffers(handle Handle) (err error) //sys GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error) = kernel32.GetFullPathNameW //sys GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err error) = kernel32.GetLongPathNameW //sys GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uint32, err error) = kernel32.GetShortPathNameW //sys GetFinalPathNameByHandle(file Handle, filePath *uint16, filePathSize uint32, flags uint32) (n uint32, err error) = kernel32.GetFinalPathNameByHandleW -//sys CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) = kernel32.CreateFileMappingW +//sys CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) [failretval == 0 || e1 == ERROR_ALREADY_EXISTS] = kernel32.CreateFileMappingW //sys MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error) //sys UnmapViewOfFile(addr uintptr) (err error) //sys FlushViewOfFile(addr uintptr, length uintptr) (err error) @@ -259,17 +275,32 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys VirtualProtect(address uintptr, size uintptr, newprotect uint32, oldprotect *uint32) (err error) = kernel32.VirtualProtect //sys TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error) = mswsock.TransmitFile //sys ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, retlen *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) = kernel32.ReadDirectoryChangesW +//sys FindFirstChangeNotification(path string, watchSubtree bool, notifyFilter uint32) (handle Handle, err error) [failretval==InvalidHandle] = kernel32.FindFirstChangeNotificationW +//sys FindNextChangeNotification(handle Handle) (err error) +//sys FindCloseChangeNotification(handle Handle) (err error) //sys CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) = crypt32.CertOpenSystemStoreW -//sys CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptProv uintptr, flags uint32, para uintptr) (handle Handle, err error) = crypt32.CertOpenStore +//sys CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptProv uintptr, flags uint32, para uintptr) (handle Handle, err error) = crypt32.CertOpenStore //sys CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (context *CertContext, err error) [failretval==nil] = crypt32.CertEnumCertificatesInStore -//sys CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error) = crypt32.CertAddCertificateContextToStore +//sys CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error) = crypt32.CertAddCertificateContextToStore //sys CertCloseStore(store Handle, flags uint32) (err error) = crypt32.CertCloseStore //sys CertDeleteCertificateFromStore(certContext *CertContext) (err error) = crypt32.CertDeleteCertificateFromStore -//sys CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, para *CertChainPara, flags uint32, reserved uintptr, chainCtx **CertChainContext) (err error) = crypt32.CertGetCertificateChain -//sys CertFreeCertificateChain(ctx *CertChainContext) = crypt32.CertFreeCertificateChain -//sys CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, encodedLen uint32) (context *CertContext, err error) [failretval==nil] = crypt32.CertCreateCertificateContext -//sys CertFreeCertificateContext(ctx *CertContext) (err error) = crypt32.CertFreeCertificateContext -//sys CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, status *CertChainPolicyStatus) (err error) = crypt32.CertVerifyCertificateChainPolicy +//sys CertDuplicateCertificateContext(certContext *CertContext) (dupContext *CertContext) = crypt32.CertDuplicateCertificateContext +//sys PFXImportCertStore(pfx *CryptDataBlob, password *uint16, flags uint32) (store Handle, err error) = crypt32.PFXImportCertStore +//sys CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, para *CertChainPara, flags uint32, reserved uintptr, chainCtx **CertChainContext) (err error) = crypt32.CertGetCertificateChain +//sys CertFreeCertificateChain(ctx *CertChainContext) = crypt32.CertFreeCertificateChain +//sys CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, encodedLen uint32) (context *CertContext, err error) [failretval==nil] = crypt32.CertCreateCertificateContext +//sys CertFreeCertificateContext(ctx *CertContext) (err error) = crypt32.CertFreeCertificateContext +//sys CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, status *CertChainPolicyStatus) (err error) = crypt32.CertVerifyCertificateChainPolicy +//sys CertGetNameString(certContext *CertContext, nameType uint32, flags uint32, typePara unsafe.Pointer, name *uint16, size uint32) (chars uint32) = crypt32.CertGetNameStringW +//sys CertFindExtension(objId *byte, countExtensions uint32, extensions *CertExtension) (ret *CertExtension) = crypt32.CertFindExtension +//sys CertFindCertificateInStore(store Handle, certEncodingType uint32, findFlags uint32, findType uint32, findPara unsafe.Pointer, prevCertContext *CertContext) (cert *CertContext, err error) [failretval==nil] = crypt32.CertFindCertificateInStore +//sys CertFindChainInStore(store Handle, certEncodingType uint32, findFlags uint32, findType uint32, findPara unsafe.Pointer, prevChainContext *CertChainContext) (certchain *CertChainContext, err error) [failretval==nil] = crypt32.CertFindChainInStore +//sys CryptAcquireCertificatePrivateKey(cert *CertContext, flags uint32, parameters unsafe.Pointer, cryptProvOrNCryptKey *Handle, keySpec *uint32, callerFreeProvOrNCryptKey *bool) (err error) = crypt32.CryptAcquireCertificatePrivateKey +//sys CryptQueryObject(objectType uint32, object unsafe.Pointer, expectedContentTypeFlags uint32, expectedFormatTypeFlags uint32, flags uint32, msgAndCertEncodingType *uint32, contentType *uint32, formatType *uint32, certStore *Handle, msg *Handle, context *unsafe.Pointer) (err error) = crypt32.CryptQueryObject +//sys CryptDecodeObject(encodingType uint32, structType *byte, encodedBytes *byte, lenEncodedBytes uint32, flags uint32, decoded unsafe.Pointer, decodedLen *uint32) (err error) = crypt32.CryptDecodeObject +//sys CryptProtectData(dataIn *DataBlob, name *uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error) = crypt32.CryptProtectData +//sys CryptUnprotectData(dataIn *DataBlob, name **uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error) = crypt32.CryptUnprotectData +//sys WinVerifyTrustEx(hwnd HWND, actionId *GUID, data *WinTrustData) (ret error) = wintrust.WinVerifyTrustEx //sys RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint32, result *Handle) (regerrno error) = advapi32.RegOpenKeyExW //sys RegCloseKey(key Handle) (regerrno error) = advapi32.RegCloseKey //sys RegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint32, subkeysLen *uint32, maxSubkeyLen *uint32, maxClassLen *uint32, valuesLen *uint32, maxValueNameLen *uint32, maxValueLen *uint32, saLen *uint32, lastWriteTime *Filetime) (regerrno error) = advapi32.RegQueryInfoKeyW @@ -294,14 +325,14 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags uint32) (err error) [failretval&0xff==0] = CreateSymbolicLinkW //sys CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr) (err error) [failretval&0xff==0] = CreateHardLinkW //sys GetCurrentThreadId() (id uint32) -//sys CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle Handle, err error) = kernel32.CreateEventW -//sys CreateEventEx(eventAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) = kernel32.CreateEventExW +//sys CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle Handle, err error) [failretval == 0 || e1 == ERROR_ALREADY_EXISTS] = kernel32.CreateEventW +//sys CreateEventEx(eventAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) [failretval == 0 || e1 == ERROR_ALREADY_EXISTS] = kernel32.CreateEventExW //sys OpenEvent(desiredAccess uint32, inheritHandle bool, name *uint16) (handle Handle, err error) = kernel32.OpenEventW //sys SetEvent(event Handle) (err error) = kernel32.SetEvent //sys ResetEvent(event Handle) (err error) = kernel32.ResetEvent //sys PulseEvent(event Handle) (err error) = kernel32.PulseEvent -//sys CreateMutex(mutexAttrs *SecurityAttributes, initialOwner bool, name *uint16) (handle Handle, err error) = kernel32.CreateMutexW -//sys CreateMutexEx(mutexAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) = kernel32.CreateMutexExW +//sys CreateMutex(mutexAttrs *SecurityAttributes, initialOwner bool, name *uint16) (handle Handle, err error) [failretval == 0 || e1 == ERROR_ALREADY_EXISTS] = kernel32.CreateMutexW +//sys CreateMutexEx(mutexAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) [failretval == 0 || e1 == ERROR_ALREADY_EXISTS] = kernel32.CreateMutexExW //sys OpenMutex(desiredAccess uint32, inheritHandle bool, name *uint16) (handle Handle, err error) = kernel32.OpenMutexW //sys ReleaseMutex(mutex Handle) (err error) = kernel32.ReleaseMutex //sys SleepEx(milliseconds uint32, alertable bool) (ret uint32) = kernel32.SleepEx @@ -316,10 +347,13 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobObjectInformation uintptr, JobObjectInformationLength uint32) (ret int, err error) //sys GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err error) //sys GetProcessId(process Handle) (id uint32, err error) +//sys QueryFullProcessImageName(proc Handle, flags uint32, exeName *uint16, size *uint32) (err error) = kernel32.QueryFullProcessImageNameW //sys OpenThread(desiredAccess uint32, inheritHandle bool, threadId uint32) (handle Handle, err error) //sys SetProcessPriorityBoost(process Handle, disable bool) (err error) = kernel32.SetProcessPriorityBoost //sys GetProcessWorkingSetSizeEx(hProcess Handle, lpMinimumWorkingSetSize *uintptr, lpMaximumWorkingSetSize *uintptr, flags *uint32) //sys SetProcessWorkingSetSizeEx(hProcess Handle, dwMinimumWorkingSetSize uintptr, dwMaximumWorkingSetSize uintptr, flags uint32) (err error) +//sys GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) +//sys SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) // Volume Management Functions //sys DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err error) = DefineDosDeviceW @@ -342,8 +376,6 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys QueryDosDevice(deviceName *uint16, targetPath *uint16, max uint32) (n uint32, err error) [failretval==0] = QueryDosDeviceW //sys SetVolumeLabel(rootPathName *uint16, volumeName *uint16) (err error) = SetVolumeLabelW //sys SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err error) = SetVolumeMountPointW -//sys MessageBox(hwnd Handle, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) [failretval==0] = user32.MessageBoxW -//sys ExitWindowsEx(flags uint32, reason uint32) (err error) = user32.ExitWindowsEx //sys InitiateSystemShutdownEx(machineName *uint16, message *uint16, timeout uint32, forceAppsClosed bool, rebootAfterShutdown bool, reason uint32) (err error) = advapi32.InitiateSystemShutdownExW //sys SetProcessShutdownParameters(level uint32, flags uint32) (err error) = kernel32.SetProcessShutdownParameters //sys GetProcessShutdownParameters(level *uint32, flags *uint32) (err error) = kernel32.GetProcessShutdownParameters @@ -351,16 +383,36 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys stringFromGUID2(rguid *GUID, lpsz *uint16, cchMax int32) (chars int32) = ole32.StringFromGUID2 //sys coCreateGuid(pguid *GUID) (ret error) = ole32.CoCreateGuid //sys CoTaskMemFree(address unsafe.Pointer) = ole32.CoTaskMemFree -//sys rtlGetVersion(info *OsVersionInfoEx) (ret error) = ntdll.RtlGetVersion -//sys rtlGetNtVersionNumbers(majorVersion *uint32, minorVersion *uint32, buildNumber *uint32) = ntdll.RtlGetNtVersionNumbers +//sys CoInitializeEx(reserved uintptr, coInit uint32) (ret error) = ole32.CoInitializeEx +//sys CoUninitialize() = ole32.CoUninitialize +//sys CoGetObject(name *uint16, bindOpts *BIND_OPTS3, guid *GUID, functionTable **uintptr) (ret error) = ole32.CoGetObject //sys getProcessPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) = kernel32.GetProcessPreferredUILanguages //sys getThreadPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) = kernel32.GetThreadPreferredUILanguages //sys getUserPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) = kernel32.GetUserPreferredUILanguages //sys getSystemPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) = kernel32.GetSystemPreferredUILanguages +//sys findResource(module Handle, name uintptr, resType uintptr) (resInfo Handle, err error) = kernel32.FindResourceW +//sys SizeofResource(module Handle, resInfo Handle) (size uint32, err error) = kernel32.SizeofResource +//sys LoadResource(module Handle, resInfo Handle) (resData Handle, err error) = kernel32.LoadResource +//sys LockResource(resData Handle) (addr uintptr, err error) = kernel32.LockResource // Process Status API (PSAPI) //sys EnumProcesses(processIds []uint32, bytesReturned *uint32) (err error) = psapi.EnumProcesses +// NT Native APIs +//sys rtlNtStatusToDosErrorNoTeb(ntstatus NTStatus) (ret syscall.Errno) = ntdll.RtlNtStatusToDosErrorNoTeb +//sys rtlGetVersion(info *OsVersionInfoEx) (ntstatus error) = ntdll.RtlGetVersion +//sys rtlGetNtVersionNumbers(majorVersion *uint32, minorVersion *uint32, buildNumber *uint32) = ntdll.RtlGetNtVersionNumbers +//sys RtlGetCurrentPeb() (peb *PEB) = ntdll.RtlGetCurrentPeb +//sys RtlInitUnicodeString(destinationString *NTUnicodeString, sourceString *uint16) = ntdll.RtlInitUnicodeString +//sys RtlInitString(destinationString *NTString, sourceString *byte) = ntdll.RtlInitString +//sys NtCreateFile(handle *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, allocationSize *int64, attributes uint32, share uint32, disposition uint32, options uint32, eabuffer uintptr, ealength uint32) (ntstatus error) = ntdll.NtCreateFile +//sys NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (ntstatus error) = ntdll.NtCreateNamedPipeFile +//sys RtlDosPathNameToNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) = ntdll.RtlDosPathNameToNtPathName_U_WithStatus +//sys RtlDosPathNameToRelativeNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) = ntdll.RtlDosPathNameToRelativeNtPathName_U_WithStatus +//sys RtlDefaultNpAcl(acl **ACL) (ntstatus error) = ntdll.RtlDefaultNpAcl +//sys NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32, retLen *uint32) (ntstatus error) = ntdll.NtQueryInformationProcess +//sys NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32) (ntstatus error) = ntdll.NtSetInformationProcess + // syscall interface implementation for other packages // GetCurrentProcess returns the handle for the current process. @@ -754,6 +806,7 @@ const socket_error = uintptr(^uint32(0)) //sys WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSASend //sys WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSARecvFrom //sys WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSASendTo +//sys WSASocket(af int32, typ int32, protocol int32, protoInfo *WSAProtocolInfo, group uint32, flags uint32) (handle Handle, err error) [failretval==InvalidHandle] = ws2_32.WSASocketW //sys GetHostByName(name string) (h *Hostent, err error) [failretval==nil] = ws2_32.gethostbyname //sys GetServByName(name string, proto string) (s *Servent, err error) [failretval==nil] = ws2_32.getservbyname //sys Ntohs(netshort uint16) (u uint16) = ws2_32.ntohs @@ -767,6 +820,7 @@ const socket_error = uintptr(^uint32(0)) //sys GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) = iphlpapi.GetAdaptersInfo //sys SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) = kernel32.SetFileCompletionNotificationModes //sys WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error) [failretval==-1] = ws2_32.WSAEnumProtocolsW +//sys WSAGetOverlappedResult(h Handle, o *Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) = ws2_32.WSAGetOverlappedResult //sys GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) = iphlpapi.GetAdaptersAddresses //sys GetACP() (acp uint32) = kernel32.GetACP //sys MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) = kernel32.MultiByteToWideChar @@ -1489,3 +1543,129 @@ func getUILanguages(flags uint32, f func(flags uint32, numLanguages *uint32, buf func SetConsoleCursorPosition(console Handle, position Coord) error { return setConsoleCursorPosition(console, *((*uint32)(unsafe.Pointer(&position)))) } + +func (s NTStatus) Errno() syscall.Errno { + return rtlNtStatusToDosErrorNoTeb(s) +} + +func langID(pri, sub uint16) uint32 { return uint32(sub)<<10 | uint32(pri) } + +func (s NTStatus) Error() string { + b := make([]uint16, 300) + n, err := FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_FROM_HMODULE|FORMAT_MESSAGE_ARGUMENT_ARRAY, modntdll.Handle(), uint32(s), langID(LANG_ENGLISH, SUBLANG_ENGLISH_US), b, nil) + if err != nil { + return fmt.Sprintf("NTSTATUS 0x%08x", uint32(s)) + } + // trim terminating \r and \n + for ; n > 0 && (b[n-1] == '\n' || b[n-1] == '\r'); n-- { + } + return string(utf16.Decode(b[:n])) +} + +// NewNTUnicodeString returns a new NTUnicodeString structure for use with native +// NT APIs that work over the NTUnicodeString type. Note that most Windows APIs +// do not use NTUnicodeString, and instead UTF16PtrFromString should be used for +// the more common *uint16 string type. +func NewNTUnicodeString(s string) (*NTUnicodeString, error) { + var u NTUnicodeString + s16, err := UTF16PtrFromString(s) + if err != nil { + return nil, err + } + RtlInitUnicodeString(&u, s16) + return &u, nil +} + +// Slice returns a uint16 slice that aliases the data in the NTUnicodeString. +func (s *NTUnicodeString) Slice() []uint16 { + var slice []uint16 + hdr := (*unsafeheader.Slice)(unsafe.Pointer(&slice)) + hdr.Data = unsafe.Pointer(s.Buffer) + hdr.Len = int(s.Length) + hdr.Cap = int(s.MaximumLength) + return slice +} + +func (s *NTUnicodeString) String() string { + return UTF16ToString(s.Slice()) +} + +// NewNTString returns a new NTString structure for use with native +// NT APIs that work over the NTString type. Note that most Windows APIs +// do not use NTString, and instead UTF16PtrFromString should be used for +// the more common *uint16 string type. +func NewNTString(s string) (*NTString, error) { + var nts NTString + s8, err := BytePtrFromString(s) + if err != nil { + return nil, err + } + RtlInitString(&nts, s8) + return &nts, nil +} + +// Slice returns a byte slice that aliases the data in the NTString. +func (s *NTString) Slice() []byte { + var slice []byte + hdr := (*unsafeheader.Slice)(unsafe.Pointer(&slice)) + hdr.Data = unsafe.Pointer(s.Buffer) + hdr.Len = int(s.Length) + hdr.Cap = int(s.MaximumLength) + return slice +} + +func (s *NTString) String() string { + return ByteSliceToString(s.Slice()) +} + +// FindResource resolves a resource of the given name and resource type. +func FindResource(module Handle, name, resType ResourceIDOrString) (Handle, error) { + var namePtr, resTypePtr uintptr + var name16, resType16 *uint16 + var err error + resolvePtr := func(i interface{}, keep **uint16) (uintptr, error) { + switch v := i.(type) { + case string: + *keep, err = UTF16PtrFromString(v) + if err != nil { + return 0, err + } + return uintptr(unsafe.Pointer(*keep)), nil + case ResourceID: + return uintptr(v), nil + } + return 0, errorspkg.New("parameter must be a ResourceID or a string") + } + namePtr, err = resolvePtr(name, &name16) + if err != nil { + return 0, err + } + resTypePtr, err = resolvePtr(resType, &resType16) + if err != nil { + return 0, err + } + resInfo, err := findResource(module, namePtr, resTypePtr) + runtime.KeepAlive(name16) + runtime.KeepAlive(resType16) + return resInfo, err +} + +func LoadResourceData(module, resInfo Handle) (data []byte, err error) { + size, err := SizeofResource(module, resInfo) + if err != nil { + return + } + resData, err := LoadResource(module, resInfo) + if err != nil { + return + } + ptr, err := LockResource(resData) + if err != nil { + return + } + h := (*unsafeheader.Slice)(unsafe.Pointer(&data)) + h.Data = unsafe.Pointer(ptr) + h.Len = int(size) + h.Cap = int(size) + return +} diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index bbede40412..23fe18ecef 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -10,6 +10,10 @@ import ( "unsafe" ) +// NTStatus corresponds with NTSTATUS, error values returned by ntdll.dll and +// other native functions. +type NTStatus uint32 + const ( // Invented values to support what package os expects. O_RDONLY = 0x00000 @@ -215,6 +219,18 @@ const ( INHERIT_PARENT_AFFINITY = 0x00010000 ) +const ( + // attributes for ProcThreadAttributeList + PROC_THREAD_ATTRIBUTE_PARENT_PROCESS = 0x00020000 + PROC_THREAD_ATTRIBUTE_HANDLE_LIST = 0x00020002 + PROC_THREAD_ATTRIBUTE_GROUP_AFFINITY = 0x00030003 + PROC_THREAD_ATTRIBUTE_PREFERRED_NODE = 0x00020004 + PROC_THREAD_ATTRIBUTE_IDEAL_PROCESSOR = 0x00030005 + PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY = 0x00020007 + PROC_THREAD_ATTRIBUTE_UMS_THREAD = 0x00030006 + PROC_THREAD_ATTRIBUTE_PROTECTION_LEVEL = 0x0002000b +) + const ( // flags for CreateToolhelp32Snapshot TH32CS_SNAPHEAPLIST = 0x01 @@ -227,7 +243,7 @@ const ( ) const ( - // filters for ReadDirectoryChangesW + // filters for ReadDirectoryChangesW and FindFirstChangeNotificationW FILE_NOTIFY_CHANGE_FILE_NAME = 0x001 FILE_NOTIFY_CHANGE_DIR_NAME = 0x002 FILE_NOTIFY_CHANGE_ATTRIBUTES = 0x004 @@ -249,24 +265,27 @@ const ( const ( // wincrypt.h - PROV_RSA_FULL = 1 - PROV_RSA_SIG = 2 - PROV_DSS = 3 - PROV_FORTEZZA = 4 - PROV_MS_EXCHANGE = 5 - PROV_SSL = 6 - PROV_RSA_SCHANNEL = 12 - PROV_DSS_DH = 13 - PROV_EC_ECDSA_SIG = 14 - PROV_EC_ECNRA_SIG = 15 - PROV_EC_ECDSA_FULL = 16 - PROV_EC_ECNRA_FULL = 17 - PROV_DH_SCHANNEL = 18 - PROV_SPYRUS_LYNKS = 20 - PROV_RNG = 21 - PROV_INTEL_SEC = 22 - PROV_REPLACE_OWF = 23 - PROV_RSA_AES = 24 + /* certenrolld_begin -- PROV_RSA_*/ + PROV_RSA_FULL = 1 + PROV_RSA_SIG = 2 + PROV_DSS = 3 + PROV_FORTEZZA = 4 + PROV_MS_EXCHANGE = 5 + PROV_SSL = 6 + PROV_RSA_SCHANNEL = 12 + PROV_DSS_DH = 13 + PROV_EC_ECDSA_SIG = 14 + PROV_EC_ECNRA_SIG = 15 + PROV_EC_ECDSA_FULL = 16 + PROV_EC_ECNRA_FULL = 17 + PROV_DH_SCHANNEL = 18 + PROV_SPYRUS_LYNKS = 20 + PROV_RNG = 21 + PROV_INTEL_SEC = 22 + PROV_REPLACE_OWF = 23 + PROV_RSA_AES = 24 + + /* dwFlags definitions for CryptAcquireContext */ CRYPT_VERIFYCONTEXT = 0xF0000000 CRYPT_NEWKEYSET = 0x00000008 CRYPT_DELETEKEYSET = 0x00000010 @@ -274,6 +293,34 @@ const ( CRYPT_SILENT = 0x00000040 CRYPT_DEFAULT_CONTAINER_OPTIONAL = 0x00000080 + /* Flags for PFXImportCertStore */ + CRYPT_EXPORTABLE = 0x00000001 + CRYPT_USER_PROTECTED = 0x00000002 + CRYPT_USER_KEYSET = 0x00001000 + PKCS12_PREFER_CNG_KSP = 0x00000100 + PKCS12_ALWAYS_CNG_KSP = 0x00000200 + PKCS12_ALLOW_OVERWRITE_KEY = 0x00004000 + PKCS12_NO_PERSIST_KEY = 0x00008000 + PKCS12_INCLUDE_EXTENDED_PROPERTIES = 0x00000010 + + /* Flags for CryptAcquireCertificatePrivateKey */ + CRYPT_ACQUIRE_CACHE_FLAG = 0x00000001 + CRYPT_ACQUIRE_USE_PROV_INFO_FLAG = 0x00000002 + CRYPT_ACQUIRE_COMPARE_KEY_FLAG = 0x00000004 + CRYPT_ACQUIRE_NO_HEALING = 0x00000008 + CRYPT_ACQUIRE_SILENT_FLAG = 0x00000040 + CRYPT_ACQUIRE_WINDOW_HANDLE_FLAG = 0x00000080 + CRYPT_ACQUIRE_NCRYPT_KEY_FLAGS_MASK = 0x00070000 + CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG = 0x00010000 + CRYPT_ACQUIRE_PREFER_NCRYPT_KEY_FLAG = 0x00020000 + CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG = 0x00040000 + + /* pdwKeySpec for CryptAcquireCertificatePrivateKey */ + AT_KEYEXCHANGE = 1 + AT_SIGNATURE = 2 + CERT_NCRYPT_KEY_SPEC = 0xFFFFFFFF + + /* Default usage match type is AND with value zero */ USAGE_MATCH_TYPE_AND = 0 USAGE_MATCH_TYPE_OR = 1 @@ -398,6 +445,89 @@ const ( CERT_TRUST_IS_CA_TRUSTED = 0x00004000 CERT_TRUST_IS_COMPLEX_CHAIN = 0x00010000 + /* Certificate Information Flags */ + CERT_INFO_VERSION_FLAG = 1 + CERT_INFO_SERIAL_NUMBER_FLAG = 2 + CERT_INFO_SIGNATURE_ALGORITHM_FLAG = 3 + CERT_INFO_ISSUER_FLAG = 4 + CERT_INFO_NOT_BEFORE_FLAG = 5 + CERT_INFO_NOT_AFTER_FLAG = 6 + CERT_INFO_SUBJECT_FLAG = 7 + CERT_INFO_SUBJECT_PUBLIC_KEY_INFO_FLAG = 8 + CERT_INFO_ISSUER_UNIQUE_ID_FLAG = 9 + CERT_INFO_SUBJECT_UNIQUE_ID_FLAG = 10 + CERT_INFO_EXTENSION_FLAG = 11 + + /* dwFindType for CertFindCertificateInStore */ + CERT_COMPARE_MASK = 0xFFFF + CERT_COMPARE_SHIFT = 16 + CERT_COMPARE_ANY = 0 + CERT_COMPARE_SHA1_HASH = 1 + CERT_COMPARE_NAME = 2 + CERT_COMPARE_ATTR = 3 + CERT_COMPARE_MD5_HASH = 4 + CERT_COMPARE_PROPERTY = 5 + CERT_COMPARE_PUBLIC_KEY = 6 + CERT_COMPARE_HASH = CERT_COMPARE_SHA1_HASH + CERT_COMPARE_NAME_STR_A = 7 + CERT_COMPARE_NAME_STR_W = 8 + CERT_COMPARE_KEY_SPEC = 9 + CERT_COMPARE_ENHKEY_USAGE = 10 + CERT_COMPARE_CTL_USAGE = CERT_COMPARE_ENHKEY_USAGE + CERT_COMPARE_SUBJECT_CERT = 11 + CERT_COMPARE_ISSUER_OF = 12 + CERT_COMPARE_EXISTING = 13 + CERT_COMPARE_SIGNATURE_HASH = 14 + CERT_COMPARE_KEY_IDENTIFIER = 15 + CERT_COMPARE_CERT_ID = 16 + CERT_COMPARE_CROSS_CERT_DIST_POINTS = 17 + CERT_COMPARE_PUBKEY_MD5_HASH = 18 + CERT_COMPARE_SUBJECT_INFO_ACCESS = 19 + CERT_COMPARE_HASH_STR = 20 + CERT_COMPARE_HAS_PRIVATE_KEY = 21 + CERT_FIND_ANY = (CERT_COMPARE_ANY << CERT_COMPARE_SHIFT) + CERT_FIND_SHA1_HASH = (CERT_COMPARE_SHA1_HASH << CERT_COMPARE_SHIFT) + CERT_FIND_MD5_HASH = (CERT_COMPARE_MD5_HASH << CERT_COMPARE_SHIFT) + CERT_FIND_SIGNATURE_HASH = (CERT_COMPARE_SIGNATURE_HASH << CERT_COMPARE_SHIFT) + CERT_FIND_KEY_IDENTIFIER = (CERT_COMPARE_KEY_IDENTIFIER << CERT_COMPARE_SHIFT) + CERT_FIND_HASH = CERT_FIND_SHA1_HASH + CERT_FIND_PROPERTY = (CERT_COMPARE_PROPERTY << CERT_COMPARE_SHIFT) + CERT_FIND_PUBLIC_KEY = (CERT_COMPARE_PUBLIC_KEY << CERT_COMPARE_SHIFT) + CERT_FIND_SUBJECT_NAME = (CERT_COMPARE_NAME<" + // 0x006C030C: 0x0000013E + "\x00N\x03\x01\x00\x00\x01C" + // 0x004E0301: 0x00000143 + "\x00n\x03\x01\x00\x00\x01D" + // 0x006E0301: 0x00000144 + "\x00N\x03'\x00\x00\x01E" + // 0x004E0327: 0x00000145 + "\x00n\x03'\x00\x00\x01F" + // 0x006E0327: 0x00000146 + "\x00N\x03\f\x00\x00\x01G" + // 0x004E030C: 0x00000147 + "\x00n\x03\f\x00\x00\x01H" + // 0x006E030C: 0x00000148 + "\x00O\x03\x04\x00\x00\x01L" + // 0x004F0304: 0x0000014C + "\x00o\x03\x04\x00\x00\x01M" + // 0x006F0304: 0x0000014D + "\x00O\x03\x06\x00\x00\x01N" + // 0x004F0306: 0x0000014E + "\x00o\x03\x06\x00\x00\x01O" + // 0x006F0306: 0x0000014F + "\x00O\x03\v\x00\x00\x01P" + // 0x004F030B: 0x00000150 + "\x00o\x03\v\x00\x00\x01Q" + // 0x006F030B: 0x00000151 + "\x00R\x03\x01\x00\x00\x01T" + // 0x00520301: 0x00000154 + "\x00r\x03\x01\x00\x00\x01U" + // 0x00720301: 0x00000155 + "\x00R\x03'\x00\x00\x01V" + // 0x00520327: 0x00000156 + "\x00r\x03'\x00\x00\x01W" + // 0x00720327: 0x00000157 + "\x00R\x03\f\x00\x00\x01X" + // 0x0052030C: 0x00000158 + "\x00r\x03\f\x00\x00\x01Y" + // 0x0072030C: 0x00000159 + "\x00S\x03\x01\x00\x00\x01Z" + // 0x00530301: 0x0000015A + "\x00s\x03\x01\x00\x00\x01[" + // 0x00730301: 0x0000015B + "\x00S\x03\x02\x00\x00\x01\\" + // 0x00530302: 0x0000015C + "\x00s\x03\x02\x00\x00\x01]" + // 0x00730302: 0x0000015D + "\x00S\x03'\x00\x00\x01^" + // 0x00530327: 0x0000015E + "\x00s\x03'\x00\x00\x01_" + // 0x00730327: 0x0000015F + "\x00S\x03\f\x00\x00\x01`" + // 0x0053030C: 0x00000160 + "\x00s\x03\f\x00\x00\x01a" + // 0x0073030C: 0x00000161 + "\x00T\x03'\x00\x00\x01b" + // 0x00540327: 0x00000162 + "\x00t\x03'\x00\x00\x01c" + // 0x00740327: 0x00000163 + "\x00T\x03\f\x00\x00\x01d" + // 0x0054030C: 0x00000164 + "\x00t\x03\f\x00\x00\x01e" + // 0x0074030C: 0x00000165 + "\x00U\x03\x03\x00\x00\x01h" + // 0x00550303: 0x00000168 + "\x00u\x03\x03\x00\x00\x01i" + // 0x00750303: 0x00000169 + "\x00U\x03\x04\x00\x00\x01j" + // 0x00550304: 0x0000016A + "\x00u\x03\x04\x00\x00\x01k" + // 0x00750304: 0x0000016B + "\x00U\x03\x06\x00\x00\x01l" + // 0x00550306: 0x0000016C + "\x00u\x03\x06\x00\x00\x01m" + // 0x00750306: 0x0000016D + "\x00U\x03\n\x00\x00\x01n" + // 0x0055030A: 0x0000016E + "\x00u\x03\n\x00\x00\x01o" + // 0x0075030A: 0x0000016F + "\x00U\x03\v\x00\x00\x01p" + // 0x0055030B: 0x00000170 + "\x00u\x03\v\x00\x00\x01q" + // 0x0075030B: 0x00000171 + "\x00U\x03(\x00\x00\x01r" + // 0x00550328: 0x00000172 + "\x00u\x03(\x00\x00\x01s" + // 0x00750328: 0x00000173 + "\x00W\x03\x02\x00\x00\x01t" + // 0x00570302: 0x00000174 + "\x00w\x03\x02\x00\x00\x01u" + // 0x00770302: 0x00000175 + "\x00Y\x03\x02\x00\x00\x01v" + // 0x00590302: 0x00000176 + "\x00y\x03\x02\x00\x00\x01w" + // 0x00790302: 0x00000177 + "\x00Y\x03\b\x00\x00\x01x" + // 0x00590308: 0x00000178 + "\x00Z\x03\x01\x00\x00\x01y" + // 0x005A0301: 0x00000179 + "\x00z\x03\x01\x00\x00\x01z" + // 0x007A0301: 0x0000017A + "\x00Z\x03\a\x00\x00\x01{" + // 0x005A0307: 0x0000017B + "\x00z\x03\a\x00\x00\x01|" + // 0x007A0307: 0x0000017C + "\x00Z\x03\f\x00\x00\x01}" + // 0x005A030C: 0x0000017D + "\x00z\x03\f\x00\x00\x01~" + // 0x007A030C: 0x0000017E + "\x00O\x03\x1b\x00\x00\x01\xa0" + // 0x004F031B: 0x000001A0 + "\x00o\x03\x1b\x00\x00\x01\xa1" + // 0x006F031B: 0x000001A1 + "\x00U\x03\x1b\x00\x00\x01\xaf" + // 0x0055031B: 0x000001AF + "\x00u\x03\x1b\x00\x00\x01\xb0" + // 0x0075031B: 0x000001B0 + "\x00A\x03\f\x00\x00\x01\xcd" + // 0x0041030C: 0x000001CD + "\x00a\x03\f\x00\x00\x01\xce" + // 0x0061030C: 0x000001CE + "\x00I\x03\f\x00\x00\x01\xcf" + // 0x0049030C: 0x000001CF + "\x00i\x03\f\x00\x00\x01\xd0" + // 0x0069030C: 0x000001D0 + "\x00O\x03\f\x00\x00\x01\xd1" + // 0x004F030C: 0x000001D1 + "\x00o\x03\f\x00\x00\x01\xd2" + // 0x006F030C: 0x000001D2 + "\x00U\x03\f\x00\x00\x01\xd3" + // 0x0055030C: 0x000001D3 + "\x00u\x03\f\x00\x00\x01\xd4" + // 0x0075030C: 0x000001D4 + "\x00\xdc\x03\x04\x00\x00\x01\xd5" + // 0x00DC0304: 0x000001D5 + "\x00\xfc\x03\x04\x00\x00\x01\xd6" + // 0x00FC0304: 0x000001D6 + "\x00\xdc\x03\x01\x00\x00\x01\xd7" + // 0x00DC0301: 0x000001D7 + "\x00\xfc\x03\x01\x00\x00\x01\xd8" + // 0x00FC0301: 0x000001D8 + "\x00\xdc\x03\f\x00\x00\x01\xd9" + // 0x00DC030C: 0x000001D9 + "\x00\xfc\x03\f\x00\x00\x01\xda" + // 0x00FC030C: 0x000001DA + "\x00\xdc\x03\x00\x00\x00\x01\xdb" + // 0x00DC0300: 0x000001DB + "\x00\xfc\x03\x00\x00\x00\x01\xdc" + // 0x00FC0300: 0x000001DC + "\x00\xc4\x03\x04\x00\x00\x01\xde" + // 0x00C40304: 0x000001DE + "\x00\xe4\x03\x04\x00\x00\x01\xdf" + // 0x00E40304: 0x000001DF + "\x02&\x03\x04\x00\x00\x01\xe0" + // 0x02260304: 0x000001E0 + "\x02'\x03\x04\x00\x00\x01\xe1" + // 0x02270304: 0x000001E1 + "\x00\xc6\x03\x04\x00\x00\x01\xe2" + // 0x00C60304: 0x000001E2 + "\x00\xe6\x03\x04\x00\x00\x01\xe3" + // 0x00E60304: 0x000001E3 + "\x00G\x03\f\x00\x00\x01\xe6" + // 0x0047030C: 0x000001E6 + "\x00g\x03\f\x00\x00\x01\xe7" + // 0x0067030C: 0x000001E7 + "\x00K\x03\f\x00\x00\x01\xe8" + // 0x004B030C: 0x000001E8 + "\x00k\x03\f\x00\x00\x01\xe9" + // 0x006B030C: 0x000001E9 + "\x00O\x03(\x00\x00\x01\xea" + // 0x004F0328: 0x000001EA + "\x00o\x03(\x00\x00\x01\xeb" + // 0x006F0328: 0x000001EB + "\x01\xea\x03\x04\x00\x00\x01\xec" + // 0x01EA0304: 0x000001EC + "\x01\xeb\x03\x04\x00\x00\x01\xed" + // 0x01EB0304: 0x000001ED + "\x01\xb7\x03\f\x00\x00\x01\xee" + // 0x01B7030C: 0x000001EE + "\x02\x92\x03\f\x00\x00\x01\xef" + // 0x0292030C: 0x000001EF + "\x00j\x03\f\x00\x00\x01\xf0" + // 0x006A030C: 0x000001F0 + "\x00G\x03\x01\x00\x00\x01\xf4" + // 0x00470301: 0x000001F4 + "\x00g\x03\x01\x00\x00\x01\xf5" + // 0x00670301: 0x000001F5 + "\x00N\x03\x00\x00\x00\x01\xf8" + // 0x004E0300: 0x000001F8 + "\x00n\x03\x00\x00\x00\x01\xf9" + // 0x006E0300: 0x000001F9 + "\x00\xc5\x03\x01\x00\x00\x01\xfa" + // 0x00C50301: 0x000001FA + "\x00\xe5\x03\x01\x00\x00\x01\xfb" + // 0x00E50301: 0x000001FB + "\x00\xc6\x03\x01\x00\x00\x01\xfc" + // 0x00C60301: 0x000001FC + "\x00\xe6\x03\x01\x00\x00\x01\xfd" + // 0x00E60301: 0x000001FD + "\x00\xd8\x03\x01\x00\x00\x01\xfe" + // 0x00D80301: 0x000001FE + "\x00\xf8\x03\x01\x00\x00\x01\xff" + // 0x00F80301: 0x000001FF + "\x00A\x03\x0f\x00\x00\x02\x00" + // 0x0041030F: 0x00000200 + "\x00a\x03\x0f\x00\x00\x02\x01" + // 0x0061030F: 0x00000201 + "\x00A\x03\x11\x00\x00\x02\x02" + // 0x00410311: 0x00000202 + "\x00a\x03\x11\x00\x00\x02\x03" + // 0x00610311: 0x00000203 + "\x00E\x03\x0f\x00\x00\x02\x04" + // 0x0045030F: 0x00000204 + "\x00e\x03\x0f\x00\x00\x02\x05" + // 0x0065030F: 0x00000205 + "\x00E\x03\x11\x00\x00\x02\x06" + // 0x00450311: 0x00000206 + "\x00e\x03\x11\x00\x00\x02\a" + // 0x00650311: 0x00000207 + "\x00I\x03\x0f\x00\x00\x02\b" + // 0x0049030F: 0x00000208 + "\x00i\x03\x0f\x00\x00\x02\t" + // 0x0069030F: 0x00000209 + "\x00I\x03\x11\x00\x00\x02\n" + // 0x00490311: 0x0000020A + "\x00i\x03\x11\x00\x00\x02\v" + // 0x00690311: 0x0000020B + "\x00O\x03\x0f\x00\x00\x02\f" + // 0x004F030F: 0x0000020C + "\x00o\x03\x0f\x00\x00\x02\r" + // 0x006F030F: 0x0000020D + "\x00O\x03\x11\x00\x00\x02\x0e" + // 0x004F0311: 0x0000020E + "\x00o\x03\x11\x00\x00\x02\x0f" + // 0x006F0311: 0x0000020F + "\x00R\x03\x0f\x00\x00\x02\x10" + // 0x0052030F: 0x00000210 + "\x00r\x03\x0f\x00\x00\x02\x11" + // 0x0072030F: 0x00000211 + "\x00R\x03\x11\x00\x00\x02\x12" + // 0x00520311: 0x00000212 + "\x00r\x03\x11\x00\x00\x02\x13" + // 0x00720311: 0x00000213 + "\x00U\x03\x0f\x00\x00\x02\x14" + // 0x0055030F: 0x00000214 + "\x00u\x03\x0f\x00\x00\x02\x15" + // 0x0075030F: 0x00000215 + "\x00U\x03\x11\x00\x00\x02\x16" + // 0x00550311: 0x00000216 + "\x00u\x03\x11\x00\x00\x02\x17" + // 0x00750311: 0x00000217 + "\x00S\x03&\x00\x00\x02\x18" + // 0x00530326: 0x00000218 + "\x00s\x03&\x00\x00\x02\x19" + // 0x00730326: 0x00000219 + "\x00T\x03&\x00\x00\x02\x1a" + // 0x00540326: 0x0000021A + "\x00t\x03&\x00\x00\x02\x1b" + // 0x00740326: 0x0000021B + "\x00H\x03\f\x00\x00\x02\x1e" + // 0x0048030C: 0x0000021E + "\x00h\x03\f\x00\x00\x02\x1f" + // 0x0068030C: 0x0000021F + "\x00A\x03\a\x00\x00\x02&" + // 0x00410307: 0x00000226 + "\x00a\x03\a\x00\x00\x02'" + // 0x00610307: 0x00000227 + "\x00E\x03'\x00\x00\x02(" + // 0x00450327: 0x00000228 + "\x00e\x03'\x00\x00\x02)" + // 0x00650327: 0x00000229 + "\x00\xd6\x03\x04\x00\x00\x02*" + // 0x00D60304: 0x0000022A + "\x00\xf6\x03\x04\x00\x00\x02+" + // 0x00F60304: 0x0000022B + "\x00\xd5\x03\x04\x00\x00\x02," + // 0x00D50304: 0x0000022C + "\x00\xf5\x03\x04\x00\x00\x02-" + // 0x00F50304: 0x0000022D + "\x00O\x03\a\x00\x00\x02." + // 0x004F0307: 0x0000022E + "\x00o\x03\a\x00\x00\x02/" + // 0x006F0307: 0x0000022F + "\x02.\x03\x04\x00\x00\x020" + // 0x022E0304: 0x00000230 + "\x02/\x03\x04\x00\x00\x021" + // 0x022F0304: 0x00000231 + "\x00Y\x03\x04\x00\x00\x022" + // 0x00590304: 0x00000232 + "\x00y\x03\x04\x00\x00\x023" + // 0x00790304: 0x00000233 + "\x00\xa8\x03\x01\x00\x00\x03\x85" + // 0x00A80301: 0x00000385 + "\x03\x91\x03\x01\x00\x00\x03\x86" + // 0x03910301: 0x00000386 + "\x03\x95\x03\x01\x00\x00\x03\x88" + // 0x03950301: 0x00000388 + "\x03\x97\x03\x01\x00\x00\x03\x89" + // 0x03970301: 0x00000389 + "\x03\x99\x03\x01\x00\x00\x03\x8a" + // 0x03990301: 0x0000038A + "\x03\x9f\x03\x01\x00\x00\x03\x8c" + // 0x039F0301: 0x0000038C + "\x03\xa5\x03\x01\x00\x00\x03\x8e" + // 0x03A50301: 0x0000038E + "\x03\xa9\x03\x01\x00\x00\x03\x8f" + // 0x03A90301: 0x0000038F + "\x03\xca\x03\x01\x00\x00\x03\x90" + // 0x03CA0301: 0x00000390 + "\x03\x99\x03\b\x00\x00\x03\xaa" + // 0x03990308: 0x000003AA + "\x03\xa5\x03\b\x00\x00\x03\xab" + // 0x03A50308: 0x000003AB + "\x03\xb1\x03\x01\x00\x00\x03\xac" + // 0x03B10301: 0x000003AC + "\x03\xb5\x03\x01\x00\x00\x03\xad" + // 0x03B50301: 0x000003AD + "\x03\xb7\x03\x01\x00\x00\x03\xae" + // 0x03B70301: 0x000003AE + "\x03\xb9\x03\x01\x00\x00\x03\xaf" + // 0x03B90301: 0x000003AF + "\x03\xcb\x03\x01\x00\x00\x03\xb0" + // 0x03CB0301: 0x000003B0 + "\x03\xb9\x03\b\x00\x00\x03\xca" + // 0x03B90308: 0x000003CA + "\x03\xc5\x03\b\x00\x00\x03\xcb" + // 0x03C50308: 0x000003CB + "\x03\xbf\x03\x01\x00\x00\x03\xcc" + // 0x03BF0301: 0x000003CC + "\x03\xc5\x03\x01\x00\x00\x03\xcd" + // 0x03C50301: 0x000003CD + "\x03\xc9\x03\x01\x00\x00\x03\xce" + // 0x03C90301: 0x000003CE + "\x03\xd2\x03\x01\x00\x00\x03\xd3" + // 0x03D20301: 0x000003D3 + "\x03\xd2\x03\b\x00\x00\x03\xd4" + // 0x03D20308: 0x000003D4 + "\x04\x15\x03\x00\x00\x00\x04\x00" + // 0x04150300: 0x00000400 + "\x04\x15\x03\b\x00\x00\x04\x01" + // 0x04150308: 0x00000401 + "\x04\x13\x03\x01\x00\x00\x04\x03" + // 0x04130301: 0x00000403 + "\x04\x06\x03\b\x00\x00\x04\a" + // 0x04060308: 0x00000407 + "\x04\x1a\x03\x01\x00\x00\x04\f" + // 0x041A0301: 0x0000040C + "\x04\x18\x03\x00\x00\x00\x04\r" + // 0x04180300: 0x0000040D + "\x04#\x03\x06\x00\x00\x04\x0e" + // 0x04230306: 0x0000040E + "\x04\x18\x03\x06\x00\x00\x04\x19" + // 0x04180306: 0x00000419 + "\x048\x03\x06\x00\x00\x049" + // 0x04380306: 0x00000439 + "\x045\x03\x00\x00\x00\x04P" + // 0x04350300: 0x00000450 + "\x045\x03\b\x00\x00\x04Q" + // 0x04350308: 0x00000451 + "\x043\x03\x01\x00\x00\x04S" + // 0x04330301: 0x00000453 + "\x04V\x03\b\x00\x00\x04W" + // 0x04560308: 0x00000457 + "\x04:\x03\x01\x00\x00\x04\\" + // 0x043A0301: 0x0000045C + "\x048\x03\x00\x00\x00\x04]" + // 0x04380300: 0x0000045D + "\x04C\x03\x06\x00\x00\x04^" + // 0x04430306: 0x0000045E + "\x04t\x03\x0f\x00\x00\x04v" + // 0x0474030F: 0x00000476 + "\x04u\x03\x0f\x00\x00\x04w" + // 0x0475030F: 0x00000477 + "\x04\x16\x03\x06\x00\x00\x04\xc1" + // 0x04160306: 0x000004C1 + "\x046\x03\x06\x00\x00\x04\xc2" + // 0x04360306: 0x000004C2 + "\x04\x10\x03\x06\x00\x00\x04\xd0" + // 0x04100306: 0x000004D0 + "\x040\x03\x06\x00\x00\x04\xd1" + // 0x04300306: 0x000004D1 + "\x04\x10\x03\b\x00\x00\x04\xd2" + // 0x04100308: 0x000004D2 + "\x040\x03\b\x00\x00\x04\xd3" + // 0x04300308: 0x000004D3 + "\x04\x15\x03\x06\x00\x00\x04\xd6" + // 0x04150306: 0x000004D6 + "\x045\x03\x06\x00\x00\x04\xd7" + // 0x04350306: 0x000004D7 + "\x04\xd8\x03\b\x00\x00\x04\xda" + // 0x04D80308: 0x000004DA + "\x04\xd9\x03\b\x00\x00\x04\xdb" + // 0x04D90308: 0x000004DB + "\x04\x16\x03\b\x00\x00\x04\xdc" + // 0x04160308: 0x000004DC + "\x046\x03\b\x00\x00\x04\xdd" + // 0x04360308: 0x000004DD + "\x04\x17\x03\b\x00\x00\x04\xde" + // 0x04170308: 0x000004DE + "\x047\x03\b\x00\x00\x04\xdf" + // 0x04370308: 0x000004DF + "\x04\x18\x03\x04\x00\x00\x04\xe2" + // 0x04180304: 0x000004E2 + "\x048\x03\x04\x00\x00\x04\xe3" + // 0x04380304: 0x000004E3 + "\x04\x18\x03\b\x00\x00\x04\xe4" + // 0x04180308: 0x000004E4 + "\x048\x03\b\x00\x00\x04\xe5" + // 0x04380308: 0x000004E5 + "\x04\x1e\x03\b\x00\x00\x04\xe6" + // 0x041E0308: 0x000004E6 + "\x04>\x03\b\x00\x00\x04\xe7" + // 0x043E0308: 0x000004E7 + "\x04\xe8\x03\b\x00\x00\x04\xea" + // 0x04E80308: 0x000004EA + "\x04\xe9\x03\b\x00\x00\x04\xeb" + // 0x04E90308: 0x000004EB + "\x04-\x03\b\x00\x00\x04\xec" + // 0x042D0308: 0x000004EC + "\x04M\x03\b\x00\x00\x04\xed" + // 0x044D0308: 0x000004ED + "\x04#\x03\x04\x00\x00\x04\xee" + // 0x04230304: 0x000004EE + "\x04C\x03\x04\x00\x00\x04\xef" + // 0x04430304: 0x000004EF + "\x04#\x03\b\x00\x00\x04\xf0" + // 0x04230308: 0x000004F0 + "\x04C\x03\b\x00\x00\x04\xf1" + // 0x04430308: 0x000004F1 + "\x04#\x03\v\x00\x00\x04\xf2" + // 0x0423030B: 0x000004F2 + "\x04C\x03\v\x00\x00\x04\xf3" + // 0x0443030B: 0x000004F3 + "\x04'\x03\b\x00\x00\x04\xf4" + // 0x04270308: 0x000004F4 + "\x04G\x03\b\x00\x00\x04\xf5" + // 0x04470308: 0x000004F5 + "\x04+\x03\b\x00\x00\x04\xf8" + // 0x042B0308: 0x000004F8 + "\x04K\x03\b\x00\x00\x04\xf9" + // 0x044B0308: 0x000004F9 + "\x06'\x06S\x00\x00\x06\"" + // 0x06270653: 0x00000622 + "\x06'\x06T\x00\x00\x06#" + // 0x06270654: 0x00000623 + "\x06H\x06T\x00\x00\x06$" + // 0x06480654: 0x00000624 + "\x06'\x06U\x00\x00\x06%" + // 0x06270655: 0x00000625 + "\x06J\x06T\x00\x00\x06&" + // 0x064A0654: 0x00000626 + "\x06\xd5\x06T\x00\x00\x06\xc0" + // 0x06D50654: 0x000006C0 + "\x06\xc1\x06T\x00\x00\x06\xc2" + // 0x06C10654: 0x000006C2 + "\x06\xd2\x06T\x00\x00\x06\xd3" + // 0x06D20654: 0x000006D3 + "\t(\t<\x00\x00\t)" + // 0x0928093C: 0x00000929 + "\t0\t<\x00\x00\t1" + // 0x0930093C: 0x00000931 + "\t3\t<\x00\x00\t4" + // 0x0933093C: 0x00000934 + "\t\xc7\t\xbe\x00\x00\t\xcb" + // 0x09C709BE: 0x000009CB + "\t\xc7\t\xd7\x00\x00\t\xcc" + // 0x09C709D7: 0x000009CC + "\vG\vV\x00\x00\vH" + // 0x0B470B56: 0x00000B48 + "\vG\v>\x00\x00\vK" + // 0x0B470B3E: 0x00000B4B + "\vG\vW\x00\x00\vL" + // 0x0B470B57: 0x00000B4C + "\v\x92\v\xd7\x00\x00\v\x94" + // 0x0B920BD7: 0x00000B94 + "\v\xc6\v\xbe\x00\x00\v\xca" + // 0x0BC60BBE: 0x00000BCA + "\v\xc7\v\xbe\x00\x00\v\xcb" + // 0x0BC70BBE: 0x00000BCB + "\v\xc6\v\xd7\x00\x00\v\xcc" + // 0x0BC60BD7: 0x00000BCC + "\fF\fV\x00\x00\fH" + // 0x0C460C56: 0x00000C48 + "\f\xbf\f\xd5\x00\x00\f\xc0" + // 0x0CBF0CD5: 0x00000CC0 + "\f\xc6\f\xd5\x00\x00\f\xc7" + // 0x0CC60CD5: 0x00000CC7 + "\f\xc6\f\xd6\x00\x00\f\xc8" + // 0x0CC60CD6: 0x00000CC8 + "\f\xc6\f\xc2\x00\x00\f\xca" + // 0x0CC60CC2: 0x00000CCA + "\f\xca\f\xd5\x00\x00\f\xcb" + // 0x0CCA0CD5: 0x00000CCB + "\rF\r>\x00\x00\rJ" + // 0x0D460D3E: 0x00000D4A + "\rG\r>\x00\x00\rK" + // 0x0D470D3E: 0x00000D4B + "\rF\rW\x00\x00\rL" + // 0x0D460D57: 0x00000D4C + "\r\xd9\r\xca\x00\x00\r\xda" + // 0x0DD90DCA: 0x00000DDA + "\r\xd9\r\xcf\x00\x00\r\xdc" + // 0x0DD90DCF: 0x00000DDC + "\r\xdc\r\xca\x00\x00\r\xdd" + // 0x0DDC0DCA: 0x00000DDD + "\r\xd9\r\xdf\x00\x00\r\xde" + // 0x0DD90DDF: 0x00000DDE + "\x10%\x10.\x00\x00\x10&" + // 0x1025102E: 0x00001026 + "\x1b\x05\x1b5\x00\x00\x1b\x06" + // 0x1B051B35: 0x00001B06 + "\x1b\a\x1b5\x00\x00\x1b\b" + // 0x1B071B35: 0x00001B08 + "\x1b\t\x1b5\x00\x00\x1b\n" + // 0x1B091B35: 0x00001B0A + "\x1b\v\x1b5\x00\x00\x1b\f" + // 0x1B0B1B35: 0x00001B0C + "\x1b\r\x1b5\x00\x00\x1b\x0e" + // 0x1B0D1B35: 0x00001B0E + "\x1b\x11\x1b5\x00\x00\x1b\x12" + // 0x1B111B35: 0x00001B12 + "\x1b:\x1b5\x00\x00\x1b;" + // 0x1B3A1B35: 0x00001B3B + "\x1b<\x1b5\x00\x00\x1b=" + // 0x1B3C1B35: 0x00001B3D + "\x1b>\x1b5\x00\x00\x1b@" + // 0x1B3E1B35: 0x00001B40 + "\x1b?\x1b5\x00\x00\x1bA" + // 0x1B3F1B35: 0x00001B41 + "\x1bB\x1b5\x00\x00\x1bC" + // 0x1B421B35: 0x00001B43 + "\x00A\x03%\x00\x00\x1e\x00" + // 0x00410325: 0x00001E00 + "\x00a\x03%\x00\x00\x1e\x01" + // 0x00610325: 0x00001E01 + "\x00B\x03\a\x00\x00\x1e\x02" + // 0x00420307: 0x00001E02 + "\x00b\x03\a\x00\x00\x1e\x03" + // 0x00620307: 0x00001E03 + "\x00B\x03#\x00\x00\x1e\x04" + // 0x00420323: 0x00001E04 + "\x00b\x03#\x00\x00\x1e\x05" + // 0x00620323: 0x00001E05 + "\x00B\x031\x00\x00\x1e\x06" + // 0x00420331: 0x00001E06 + "\x00b\x031\x00\x00\x1e\a" + // 0x00620331: 0x00001E07 + "\x00\xc7\x03\x01\x00\x00\x1e\b" + // 0x00C70301: 0x00001E08 + "\x00\xe7\x03\x01\x00\x00\x1e\t" + // 0x00E70301: 0x00001E09 + "\x00D\x03\a\x00\x00\x1e\n" + // 0x00440307: 0x00001E0A + "\x00d\x03\a\x00\x00\x1e\v" + // 0x00640307: 0x00001E0B + "\x00D\x03#\x00\x00\x1e\f" + // 0x00440323: 0x00001E0C + "\x00d\x03#\x00\x00\x1e\r" + // 0x00640323: 0x00001E0D + "\x00D\x031\x00\x00\x1e\x0e" + // 0x00440331: 0x00001E0E + "\x00d\x031\x00\x00\x1e\x0f" + // 0x00640331: 0x00001E0F + "\x00D\x03'\x00\x00\x1e\x10" + // 0x00440327: 0x00001E10 + "\x00d\x03'\x00\x00\x1e\x11" + // 0x00640327: 0x00001E11 + "\x00D\x03-\x00\x00\x1e\x12" + // 0x0044032D: 0x00001E12 + "\x00d\x03-\x00\x00\x1e\x13" + // 0x0064032D: 0x00001E13 + "\x01\x12\x03\x00\x00\x00\x1e\x14" + // 0x01120300: 0x00001E14 + "\x01\x13\x03\x00\x00\x00\x1e\x15" + // 0x01130300: 0x00001E15 + "\x01\x12\x03\x01\x00\x00\x1e\x16" + // 0x01120301: 0x00001E16 + "\x01\x13\x03\x01\x00\x00\x1e\x17" + // 0x01130301: 0x00001E17 + "\x00E\x03-\x00\x00\x1e\x18" + // 0x0045032D: 0x00001E18 + "\x00e\x03-\x00\x00\x1e\x19" + // 0x0065032D: 0x00001E19 + "\x00E\x030\x00\x00\x1e\x1a" + // 0x00450330: 0x00001E1A + "\x00e\x030\x00\x00\x1e\x1b" + // 0x00650330: 0x00001E1B + "\x02(\x03\x06\x00\x00\x1e\x1c" + // 0x02280306: 0x00001E1C + "\x02)\x03\x06\x00\x00\x1e\x1d" + // 0x02290306: 0x00001E1D + "\x00F\x03\a\x00\x00\x1e\x1e" + // 0x00460307: 0x00001E1E + "\x00f\x03\a\x00\x00\x1e\x1f" + // 0x00660307: 0x00001E1F + "\x00G\x03\x04\x00\x00\x1e " + // 0x00470304: 0x00001E20 + "\x00g\x03\x04\x00\x00\x1e!" + // 0x00670304: 0x00001E21 + "\x00H\x03\a\x00\x00\x1e\"" + // 0x00480307: 0x00001E22 + "\x00h\x03\a\x00\x00\x1e#" + // 0x00680307: 0x00001E23 + "\x00H\x03#\x00\x00\x1e$" + // 0x00480323: 0x00001E24 + "\x00h\x03#\x00\x00\x1e%" + // 0x00680323: 0x00001E25 + "\x00H\x03\b\x00\x00\x1e&" + // 0x00480308: 0x00001E26 + "\x00h\x03\b\x00\x00\x1e'" + // 0x00680308: 0x00001E27 + "\x00H\x03'\x00\x00\x1e(" + // 0x00480327: 0x00001E28 + "\x00h\x03'\x00\x00\x1e)" + // 0x00680327: 0x00001E29 + "\x00H\x03.\x00\x00\x1e*" + // 0x0048032E: 0x00001E2A + "\x00h\x03.\x00\x00\x1e+" + // 0x0068032E: 0x00001E2B + "\x00I\x030\x00\x00\x1e," + // 0x00490330: 0x00001E2C + "\x00i\x030\x00\x00\x1e-" + // 0x00690330: 0x00001E2D + "\x00\xcf\x03\x01\x00\x00\x1e." + // 0x00CF0301: 0x00001E2E + "\x00\xef\x03\x01\x00\x00\x1e/" + // 0x00EF0301: 0x00001E2F + "\x00K\x03\x01\x00\x00\x1e0" + // 0x004B0301: 0x00001E30 + "\x00k\x03\x01\x00\x00\x1e1" + // 0x006B0301: 0x00001E31 + "\x00K\x03#\x00\x00\x1e2" + // 0x004B0323: 0x00001E32 + "\x00k\x03#\x00\x00\x1e3" + // 0x006B0323: 0x00001E33 + "\x00K\x031\x00\x00\x1e4" + // 0x004B0331: 0x00001E34 + "\x00k\x031\x00\x00\x1e5" + // 0x006B0331: 0x00001E35 + "\x00L\x03#\x00\x00\x1e6" + // 0x004C0323: 0x00001E36 + "\x00l\x03#\x00\x00\x1e7" + // 0x006C0323: 0x00001E37 + "\x1e6\x03\x04\x00\x00\x1e8" + // 0x1E360304: 0x00001E38 + "\x1e7\x03\x04\x00\x00\x1e9" + // 0x1E370304: 0x00001E39 + "\x00L\x031\x00\x00\x1e:" + // 0x004C0331: 0x00001E3A + "\x00l\x031\x00\x00\x1e;" + // 0x006C0331: 0x00001E3B + "\x00L\x03-\x00\x00\x1e<" + // 0x004C032D: 0x00001E3C + "\x00l\x03-\x00\x00\x1e=" + // 0x006C032D: 0x00001E3D + "\x00M\x03\x01\x00\x00\x1e>" + // 0x004D0301: 0x00001E3E + "\x00m\x03\x01\x00\x00\x1e?" + // 0x006D0301: 0x00001E3F + "\x00M\x03\a\x00\x00\x1e@" + // 0x004D0307: 0x00001E40 + "\x00m\x03\a\x00\x00\x1eA" + // 0x006D0307: 0x00001E41 + "\x00M\x03#\x00\x00\x1eB" + // 0x004D0323: 0x00001E42 + "\x00m\x03#\x00\x00\x1eC" + // 0x006D0323: 0x00001E43 + "\x00N\x03\a\x00\x00\x1eD" + // 0x004E0307: 0x00001E44 + "\x00n\x03\a\x00\x00\x1eE" + // 0x006E0307: 0x00001E45 + "\x00N\x03#\x00\x00\x1eF" + // 0x004E0323: 0x00001E46 + "\x00n\x03#\x00\x00\x1eG" + // 0x006E0323: 0x00001E47 + "\x00N\x031\x00\x00\x1eH" + // 0x004E0331: 0x00001E48 + "\x00n\x031\x00\x00\x1eI" + // 0x006E0331: 0x00001E49 + "\x00N\x03-\x00\x00\x1eJ" + // 0x004E032D: 0x00001E4A + "\x00n\x03-\x00\x00\x1eK" + // 0x006E032D: 0x00001E4B + "\x00\xd5\x03\x01\x00\x00\x1eL" + // 0x00D50301: 0x00001E4C + "\x00\xf5\x03\x01\x00\x00\x1eM" + // 0x00F50301: 0x00001E4D + "\x00\xd5\x03\b\x00\x00\x1eN" + // 0x00D50308: 0x00001E4E + "\x00\xf5\x03\b\x00\x00\x1eO" + // 0x00F50308: 0x00001E4F + "\x01L\x03\x00\x00\x00\x1eP" + // 0x014C0300: 0x00001E50 + "\x01M\x03\x00\x00\x00\x1eQ" + // 0x014D0300: 0x00001E51 + "\x01L\x03\x01\x00\x00\x1eR" + // 0x014C0301: 0x00001E52 + "\x01M\x03\x01\x00\x00\x1eS" + // 0x014D0301: 0x00001E53 + "\x00P\x03\x01\x00\x00\x1eT" + // 0x00500301: 0x00001E54 + "\x00p\x03\x01\x00\x00\x1eU" + // 0x00700301: 0x00001E55 + "\x00P\x03\a\x00\x00\x1eV" + // 0x00500307: 0x00001E56 + "\x00p\x03\a\x00\x00\x1eW" + // 0x00700307: 0x00001E57 + "\x00R\x03\a\x00\x00\x1eX" + // 0x00520307: 0x00001E58 + "\x00r\x03\a\x00\x00\x1eY" + // 0x00720307: 0x00001E59 + "\x00R\x03#\x00\x00\x1eZ" + // 0x00520323: 0x00001E5A + "\x00r\x03#\x00\x00\x1e[" + // 0x00720323: 0x00001E5B + "\x1eZ\x03\x04\x00\x00\x1e\\" + // 0x1E5A0304: 0x00001E5C + "\x1e[\x03\x04\x00\x00\x1e]" + // 0x1E5B0304: 0x00001E5D + "\x00R\x031\x00\x00\x1e^" + // 0x00520331: 0x00001E5E + "\x00r\x031\x00\x00\x1e_" + // 0x00720331: 0x00001E5F + "\x00S\x03\a\x00\x00\x1e`" + // 0x00530307: 0x00001E60 + "\x00s\x03\a\x00\x00\x1ea" + // 0x00730307: 0x00001E61 + "\x00S\x03#\x00\x00\x1eb" + // 0x00530323: 0x00001E62 + "\x00s\x03#\x00\x00\x1ec" + // 0x00730323: 0x00001E63 + "\x01Z\x03\a\x00\x00\x1ed" + // 0x015A0307: 0x00001E64 + "\x01[\x03\a\x00\x00\x1ee" + // 0x015B0307: 0x00001E65 + "\x01`\x03\a\x00\x00\x1ef" + // 0x01600307: 0x00001E66 + "\x01a\x03\a\x00\x00\x1eg" + // 0x01610307: 0x00001E67 + "\x1eb\x03\a\x00\x00\x1eh" + // 0x1E620307: 0x00001E68 + "\x1ec\x03\a\x00\x00\x1ei" + // 0x1E630307: 0x00001E69 + "\x00T\x03\a\x00\x00\x1ej" + // 0x00540307: 0x00001E6A + "\x00t\x03\a\x00\x00\x1ek" + // 0x00740307: 0x00001E6B + "\x00T\x03#\x00\x00\x1el" + // 0x00540323: 0x00001E6C + "\x00t\x03#\x00\x00\x1em" + // 0x00740323: 0x00001E6D + "\x00T\x031\x00\x00\x1en" + // 0x00540331: 0x00001E6E + "\x00t\x031\x00\x00\x1eo" + // 0x00740331: 0x00001E6F + "\x00T\x03-\x00\x00\x1ep" + // 0x0054032D: 0x00001E70 + "\x00t\x03-\x00\x00\x1eq" + // 0x0074032D: 0x00001E71 + "\x00U\x03$\x00\x00\x1er" + // 0x00550324: 0x00001E72 + "\x00u\x03$\x00\x00\x1es" + // 0x00750324: 0x00001E73 + "\x00U\x030\x00\x00\x1et" + // 0x00550330: 0x00001E74 + "\x00u\x030\x00\x00\x1eu" + // 0x00750330: 0x00001E75 + "\x00U\x03-\x00\x00\x1ev" + // 0x0055032D: 0x00001E76 + "\x00u\x03-\x00\x00\x1ew" + // 0x0075032D: 0x00001E77 + "\x01h\x03\x01\x00\x00\x1ex" + // 0x01680301: 0x00001E78 + "\x01i\x03\x01\x00\x00\x1ey" + // 0x01690301: 0x00001E79 + "\x01j\x03\b\x00\x00\x1ez" + // 0x016A0308: 0x00001E7A + "\x01k\x03\b\x00\x00\x1e{" + // 0x016B0308: 0x00001E7B + "\x00V\x03\x03\x00\x00\x1e|" + // 0x00560303: 0x00001E7C + "\x00v\x03\x03\x00\x00\x1e}" + // 0x00760303: 0x00001E7D + "\x00V\x03#\x00\x00\x1e~" + // 0x00560323: 0x00001E7E + "\x00v\x03#\x00\x00\x1e\u007f" + // 0x00760323: 0x00001E7F + "\x00W\x03\x00\x00\x00\x1e\x80" + // 0x00570300: 0x00001E80 + "\x00w\x03\x00\x00\x00\x1e\x81" + // 0x00770300: 0x00001E81 + "\x00W\x03\x01\x00\x00\x1e\x82" + // 0x00570301: 0x00001E82 + "\x00w\x03\x01\x00\x00\x1e\x83" + // 0x00770301: 0x00001E83 + "\x00W\x03\b\x00\x00\x1e\x84" + // 0x00570308: 0x00001E84 + "\x00w\x03\b\x00\x00\x1e\x85" + // 0x00770308: 0x00001E85 + "\x00W\x03\a\x00\x00\x1e\x86" + // 0x00570307: 0x00001E86 + "\x00w\x03\a\x00\x00\x1e\x87" + // 0x00770307: 0x00001E87 + "\x00W\x03#\x00\x00\x1e\x88" + // 0x00570323: 0x00001E88 + "\x00w\x03#\x00\x00\x1e\x89" + // 0x00770323: 0x00001E89 + "\x00X\x03\a\x00\x00\x1e\x8a" + // 0x00580307: 0x00001E8A + "\x00x\x03\a\x00\x00\x1e\x8b" + // 0x00780307: 0x00001E8B + "\x00X\x03\b\x00\x00\x1e\x8c" + // 0x00580308: 0x00001E8C + "\x00x\x03\b\x00\x00\x1e\x8d" + // 0x00780308: 0x00001E8D + "\x00Y\x03\a\x00\x00\x1e\x8e" + // 0x00590307: 0x00001E8E + "\x00y\x03\a\x00\x00\x1e\x8f" + // 0x00790307: 0x00001E8F + "\x00Z\x03\x02\x00\x00\x1e\x90" + // 0x005A0302: 0x00001E90 + "\x00z\x03\x02\x00\x00\x1e\x91" + // 0x007A0302: 0x00001E91 + "\x00Z\x03#\x00\x00\x1e\x92" + // 0x005A0323: 0x00001E92 + "\x00z\x03#\x00\x00\x1e\x93" + // 0x007A0323: 0x00001E93 + "\x00Z\x031\x00\x00\x1e\x94" + // 0x005A0331: 0x00001E94 + "\x00z\x031\x00\x00\x1e\x95" + // 0x007A0331: 0x00001E95 + "\x00h\x031\x00\x00\x1e\x96" + // 0x00680331: 0x00001E96 + "\x00t\x03\b\x00\x00\x1e\x97" + // 0x00740308: 0x00001E97 + "\x00w\x03\n\x00\x00\x1e\x98" + // 0x0077030A: 0x00001E98 + "\x00y\x03\n\x00\x00\x1e\x99" + // 0x0079030A: 0x00001E99 + "\x01\u007f\x03\a\x00\x00\x1e\x9b" + // 0x017F0307: 0x00001E9B + "\x00A\x03#\x00\x00\x1e\xa0" + // 0x00410323: 0x00001EA0 + "\x00a\x03#\x00\x00\x1e\xa1" + // 0x00610323: 0x00001EA1 + "\x00A\x03\t\x00\x00\x1e\xa2" + // 0x00410309: 0x00001EA2 + "\x00a\x03\t\x00\x00\x1e\xa3" + // 0x00610309: 0x00001EA3 + "\x00\xc2\x03\x01\x00\x00\x1e\xa4" + // 0x00C20301: 0x00001EA4 + "\x00\xe2\x03\x01\x00\x00\x1e\xa5" + // 0x00E20301: 0x00001EA5 + "\x00\xc2\x03\x00\x00\x00\x1e\xa6" + // 0x00C20300: 0x00001EA6 + "\x00\xe2\x03\x00\x00\x00\x1e\xa7" + // 0x00E20300: 0x00001EA7 + "\x00\xc2\x03\t\x00\x00\x1e\xa8" + // 0x00C20309: 0x00001EA8 + "\x00\xe2\x03\t\x00\x00\x1e\xa9" + // 0x00E20309: 0x00001EA9 + "\x00\xc2\x03\x03\x00\x00\x1e\xaa" + // 0x00C20303: 0x00001EAA + "\x00\xe2\x03\x03\x00\x00\x1e\xab" + // 0x00E20303: 0x00001EAB + "\x1e\xa0\x03\x02\x00\x00\x1e\xac" + // 0x1EA00302: 0x00001EAC + "\x1e\xa1\x03\x02\x00\x00\x1e\xad" + // 0x1EA10302: 0x00001EAD + "\x01\x02\x03\x01\x00\x00\x1e\xae" + // 0x01020301: 0x00001EAE + "\x01\x03\x03\x01\x00\x00\x1e\xaf" + // 0x01030301: 0x00001EAF + "\x01\x02\x03\x00\x00\x00\x1e\xb0" + // 0x01020300: 0x00001EB0 + "\x01\x03\x03\x00\x00\x00\x1e\xb1" + // 0x01030300: 0x00001EB1 + "\x01\x02\x03\t\x00\x00\x1e\xb2" + // 0x01020309: 0x00001EB2 + "\x01\x03\x03\t\x00\x00\x1e\xb3" + // 0x01030309: 0x00001EB3 + "\x01\x02\x03\x03\x00\x00\x1e\xb4" + // 0x01020303: 0x00001EB4 + "\x01\x03\x03\x03\x00\x00\x1e\xb5" + // 0x01030303: 0x00001EB5 + "\x1e\xa0\x03\x06\x00\x00\x1e\xb6" + // 0x1EA00306: 0x00001EB6 + "\x1e\xa1\x03\x06\x00\x00\x1e\xb7" + // 0x1EA10306: 0x00001EB7 + "\x00E\x03#\x00\x00\x1e\xb8" + // 0x00450323: 0x00001EB8 + "\x00e\x03#\x00\x00\x1e\xb9" + // 0x00650323: 0x00001EB9 + "\x00E\x03\t\x00\x00\x1e\xba" + // 0x00450309: 0x00001EBA + "\x00e\x03\t\x00\x00\x1e\xbb" + // 0x00650309: 0x00001EBB + "\x00E\x03\x03\x00\x00\x1e\xbc" + // 0x00450303: 0x00001EBC + "\x00e\x03\x03\x00\x00\x1e\xbd" + // 0x00650303: 0x00001EBD + "\x00\xca\x03\x01\x00\x00\x1e\xbe" + // 0x00CA0301: 0x00001EBE + "\x00\xea\x03\x01\x00\x00\x1e\xbf" + // 0x00EA0301: 0x00001EBF + "\x00\xca\x03\x00\x00\x00\x1e\xc0" + // 0x00CA0300: 0x00001EC0 + "\x00\xea\x03\x00\x00\x00\x1e\xc1" + // 0x00EA0300: 0x00001EC1 + "\x00\xca\x03\t\x00\x00\x1e\xc2" + // 0x00CA0309: 0x00001EC2 + "\x00\xea\x03\t\x00\x00\x1e\xc3" + // 0x00EA0309: 0x00001EC3 + "\x00\xca\x03\x03\x00\x00\x1e\xc4" + // 0x00CA0303: 0x00001EC4 + "\x00\xea\x03\x03\x00\x00\x1e\xc5" + // 0x00EA0303: 0x00001EC5 + "\x1e\xb8\x03\x02\x00\x00\x1e\xc6" + // 0x1EB80302: 0x00001EC6 + "\x1e\xb9\x03\x02\x00\x00\x1e\xc7" + // 0x1EB90302: 0x00001EC7 + "\x00I\x03\t\x00\x00\x1e\xc8" + // 0x00490309: 0x00001EC8 + "\x00i\x03\t\x00\x00\x1e\xc9" + // 0x00690309: 0x00001EC9 + "\x00I\x03#\x00\x00\x1e\xca" + // 0x00490323: 0x00001ECA + "\x00i\x03#\x00\x00\x1e\xcb" + // 0x00690323: 0x00001ECB + "\x00O\x03#\x00\x00\x1e\xcc" + // 0x004F0323: 0x00001ECC + "\x00o\x03#\x00\x00\x1e\xcd" + // 0x006F0323: 0x00001ECD + "\x00O\x03\t\x00\x00\x1e\xce" + // 0x004F0309: 0x00001ECE + "\x00o\x03\t\x00\x00\x1e\xcf" + // 0x006F0309: 0x00001ECF + "\x00\xd4\x03\x01\x00\x00\x1e\xd0" + // 0x00D40301: 0x00001ED0 + "\x00\xf4\x03\x01\x00\x00\x1e\xd1" + // 0x00F40301: 0x00001ED1 + "\x00\xd4\x03\x00\x00\x00\x1e\xd2" + // 0x00D40300: 0x00001ED2 + "\x00\xf4\x03\x00\x00\x00\x1e\xd3" + // 0x00F40300: 0x00001ED3 + "\x00\xd4\x03\t\x00\x00\x1e\xd4" + // 0x00D40309: 0x00001ED4 + "\x00\xf4\x03\t\x00\x00\x1e\xd5" + // 0x00F40309: 0x00001ED5 + "\x00\xd4\x03\x03\x00\x00\x1e\xd6" + // 0x00D40303: 0x00001ED6 + "\x00\xf4\x03\x03\x00\x00\x1e\xd7" + // 0x00F40303: 0x00001ED7 + "\x1e\xcc\x03\x02\x00\x00\x1e\xd8" + // 0x1ECC0302: 0x00001ED8 + "\x1e\xcd\x03\x02\x00\x00\x1e\xd9" + // 0x1ECD0302: 0x00001ED9 + "\x01\xa0\x03\x01\x00\x00\x1e\xda" + // 0x01A00301: 0x00001EDA + "\x01\xa1\x03\x01\x00\x00\x1e\xdb" + // 0x01A10301: 0x00001EDB + "\x01\xa0\x03\x00\x00\x00\x1e\xdc" + // 0x01A00300: 0x00001EDC + "\x01\xa1\x03\x00\x00\x00\x1e\xdd" + // 0x01A10300: 0x00001EDD + "\x01\xa0\x03\t\x00\x00\x1e\xde" + // 0x01A00309: 0x00001EDE + "\x01\xa1\x03\t\x00\x00\x1e\xdf" + // 0x01A10309: 0x00001EDF + "\x01\xa0\x03\x03\x00\x00\x1e\xe0" + // 0x01A00303: 0x00001EE0 + "\x01\xa1\x03\x03\x00\x00\x1e\xe1" + // 0x01A10303: 0x00001EE1 + "\x01\xa0\x03#\x00\x00\x1e\xe2" + // 0x01A00323: 0x00001EE2 + "\x01\xa1\x03#\x00\x00\x1e\xe3" + // 0x01A10323: 0x00001EE3 + "\x00U\x03#\x00\x00\x1e\xe4" + // 0x00550323: 0x00001EE4 + "\x00u\x03#\x00\x00\x1e\xe5" + // 0x00750323: 0x00001EE5 + "\x00U\x03\t\x00\x00\x1e\xe6" + // 0x00550309: 0x00001EE6 + "\x00u\x03\t\x00\x00\x1e\xe7" + // 0x00750309: 0x00001EE7 + "\x01\xaf\x03\x01\x00\x00\x1e\xe8" + // 0x01AF0301: 0x00001EE8 + "\x01\xb0\x03\x01\x00\x00\x1e\xe9" + // 0x01B00301: 0x00001EE9 + "\x01\xaf\x03\x00\x00\x00\x1e\xea" + // 0x01AF0300: 0x00001EEA + "\x01\xb0\x03\x00\x00\x00\x1e\xeb" + // 0x01B00300: 0x00001EEB + "\x01\xaf\x03\t\x00\x00\x1e\xec" + // 0x01AF0309: 0x00001EEC + "\x01\xb0\x03\t\x00\x00\x1e\xed" + // 0x01B00309: 0x00001EED + "\x01\xaf\x03\x03\x00\x00\x1e\xee" + // 0x01AF0303: 0x00001EEE + "\x01\xb0\x03\x03\x00\x00\x1e\xef" + // 0x01B00303: 0x00001EEF + "\x01\xaf\x03#\x00\x00\x1e\xf0" + // 0x01AF0323: 0x00001EF0 + "\x01\xb0\x03#\x00\x00\x1e\xf1" + // 0x01B00323: 0x00001EF1 + "\x00Y\x03\x00\x00\x00\x1e\xf2" + // 0x00590300: 0x00001EF2 + "\x00y\x03\x00\x00\x00\x1e\xf3" + // 0x00790300: 0x00001EF3 + "\x00Y\x03#\x00\x00\x1e\xf4" + // 0x00590323: 0x00001EF4 + "\x00y\x03#\x00\x00\x1e\xf5" + // 0x00790323: 0x00001EF5 + "\x00Y\x03\t\x00\x00\x1e\xf6" + // 0x00590309: 0x00001EF6 + "\x00y\x03\t\x00\x00\x1e\xf7" + // 0x00790309: 0x00001EF7 + "\x00Y\x03\x03\x00\x00\x1e\xf8" + // 0x00590303: 0x00001EF8 + "\x00y\x03\x03\x00\x00\x1e\xf9" + // 0x00790303: 0x00001EF9 + "\x03\xb1\x03\x13\x00\x00\x1f\x00" + // 0x03B10313: 0x00001F00 + "\x03\xb1\x03\x14\x00\x00\x1f\x01" + // 0x03B10314: 0x00001F01 + "\x1f\x00\x03\x00\x00\x00\x1f\x02" + // 0x1F000300: 0x00001F02 + "\x1f\x01\x03\x00\x00\x00\x1f\x03" + // 0x1F010300: 0x00001F03 + "\x1f\x00\x03\x01\x00\x00\x1f\x04" + // 0x1F000301: 0x00001F04 + "\x1f\x01\x03\x01\x00\x00\x1f\x05" + // 0x1F010301: 0x00001F05 + "\x1f\x00\x03B\x00\x00\x1f\x06" + // 0x1F000342: 0x00001F06 + "\x1f\x01\x03B\x00\x00\x1f\a" + // 0x1F010342: 0x00001F07 + "\x03\x91\x03\x13\x00\x00\x1f\b" + // 0x03910313: 0x00001F08 + "\x03\x91\x03\x14\x00\x00\x1f\t" + // 0x03910314: 0x00001F09 + "\x1f\b\x03\x00\x00\x00\x1f\n" + // 0x1F080300: 0x00001F0A + "\x1f\t\x03\x00\x00\x00\x1f\v" + // 0x1F090300: 0x00001F0B + "\x1f\b\x03\x01\x00\x00\x1f\f" + // 0x1F080301: 0x00001F0C + "\x1f\t\x03\x01\x00\x00\x1f\r" + // 0x1F090301: 0x00001F0D + "\x1f\b\x03B\x00\x00\x1f\x0e" + // 0x1F080342: 0x00001F0E + "\x1f\t\x03B\x00\x00\x1f\x0f" + // 0x1F090342: 0x00001F0F + "\x03\xb5\x03\x13\x00\x00\x1f\x10" + // 0x03B50313: 0x00001F10 + "\x03\xb5\x03\x14\x00\x00\x1f\x11" + // 0x03B50314: 0x00001F11 + "\x1f\x10\x03\x00\x00\x00\x1f\x12" + // 0x1F100300: 0x00001F12 + "\x1f\x11\x03\x00\x00\x00\x1f\x13" + // 0x1F110300: 0x00001F13 + "\x1f\x10\x03\x01\x00\x00\x1f\x14" + // 0x1F100301: 0x00001F14 + "\x1f\x11\x03\x01\x00\x00\x1f\x15" + // 0x1F110301: 0x00001F15 + "\x03\x95\x03\x13\x00\x00\x1f\x18" + // 0x03950313: 0x00001F18 + "\x03\x95\x03\x14\x00\x00\x1f\x19" + // 0x03950314: 0x00001F19 + "\x1f\x18\x03\x00\x00\x00\x1f\x1a" + // 0x1F180300: 0x00001F1A + "\x1f\x19\x03\x00\x00\x00\x1f\x1b" + // 0x1F190300: 0x00001F1B + "\x1f\x18\x03\x01\x00\x00\x1f\x1c" + // 0x1F180301: 0x00001F1C + "\x1f\x19\x03\x01\x00\x00\x1f\x1d" + // 0x1F190301: 0x00001F1D + "\x03\xb7\x03\x13\x00\x00\x1f " + // 0x03B70313: 0x00001F20 + "\x03\xb7\x03\x14\x00\x00\x1f!" + // 0x03B70314: 0x00001F21 + "\x1f \x03\x00\x00\x00\x1f\"" + // 0x1F200300: 0x00001F22 + "\x1f!\x03\x00\x00\x00\x1f#" + // 0x1F210300: 0x00001F23 + "\x1f \x03\x01\x00\x00\x1f$" + // 0x1F200301: 0x00001F24 + "\x1f!\x03\x01\x00\x00\x1f%" + // 0x1F210301: 0x00001F25 + "\x1f \x03B\x00\x00\x1f&" + // 0x1F200342: 0x00001F26 + "\x1f!\x03B\x00\x00\x1f'" + // 0x1F210342: 0x00001F27 + "\x03\x97\x03\x13\x00\x00\x1f(" + // 0x03970313: 0x00001F28 + "\x03\x97\x03\x14\x00\x00\x1f)" + // 0x03970314: 0x00001F29 + "\x1f(\x03\x00\x00\x00\x1f*" + // 0x1F280300: 0x00001F2A + "\x1f)\x03\x00\x00\x00\x1f+" + // 0x1F290300: 0x00001F2B + "\x1f(\x03\x01\x00\x00\x1f," + // 0x1F280301: 0x00001F2C + "\x1f)\x03\x01\x00\x00\x1f-" + // 0x1F290301: 0x00001F2D + "\x1f(\x03B\x00\x00\x1f." + // 0x1F280342: 0x00001F2E + "\x1f)\x03B\x00\x00\x1f/" + // 0x1F290342: 0x00001F2F + "\x03\xb9\x03\x13\x00\x00\x1f0" + // 0x03B90313: 0x00001F30 + "\x03\xb9\x03\x14\x00\x00\x1f1" + // 0x03B90314: 0x00001F31 + "\x1f0\x03\x00\x00\x00\x1f2" + // 0x1F300300: 0x00001F32 + "\x1f1\x03\x00\x00\x00\x1f3" + // 0x1F310300: 0x00001F33 + "\x1f0\x03\x01\x00\x00\x1f4" + // 0x1F300301: 0x00001F34 + "\x1f1\x03\x01\x00\x00\x1f5" + // 0x1F310301: 0x00001F35 + "\x1f0\x03B\x00\x00\x1f6" + // 0x1F300342: 0x00001F36 + "\x1f1\x03B\x00\x00\x1f7" + // 0x1F310342: 0x00001F37 + "\x03\x99\x03\x13\x00\x00\x1f8" + // 0x03990313: 0x00001F38 + "\x03\x99\x03\x14\x00\x00\x1f9" + // 0x03990314: 0x00001F39 + "\x1f8\x03\x00\x00\x00\x1f:" + // 0x1F380300: 0x00001F3A + "\x1f9\x03\x00\x00\x00\x1f;" + // 0x1F390300: 0x00001F3B + "\x1f8\x03\x01\x00\x00\x1f<" + // 0x1F380301: 0x00001F3C + "\x1f9\x03\x01\x00\x00\x1f=" + // 0x1F390301: 0x00001F3D + "\x1f8\x03B\x00\x00\x1f>" + // 0x1F380342: 0x00001F3E + "\x1f9\x03B\x00\x00\x1f?" + // 0x1F390342: 0x00001F3F + "\x03\xbf\x03\x13\x00\x00\x1f@" + // 0x03BF0313: 0x00001F40 + "\x03\xbf\x03\x14\x00\x00\x1fA" + // 0x03BF0314: 0x00001F41 + "\x1f@\x03\x00\x00\x00\x1fB" + // 0x1F400300: 0x00001F42 + "\x1fA\x03\x00\x00\x00\x1fC" + // 0x1F410300: 0x00001F43 + "\x1f@\x03\x01\x00\x00\x1fD" + // 0x1F400301: 0x00001F44 + "\x1fA\x03\x01\x00\x00\x1fE" + // 0x1F410301: 0x00001F45 + "\x03\x9f\x03\x13\x00\x00\x1fH" + // 0x039F0313: 0x00001F48 + "\x03\x9f\x03\x14\x00\x00\x1fI" + // 0x039F0314: 0x00001F49 + "\x1fH\x03\x00\x00\x00\x1fJ" + // 0x1F480300: 0x00001F4A + "\x1fI\x03\x00\x00\x00\x1fK" + // 0x1F490300: 0x00001F4B + "\x1fH\x03\x01\x00\x00\x1fL" + // 0x1F480301: 0x00001F4C + "\x1fI\x03\x01\x00\x00\x1fM" + // 0x1F490301: 0x00001F4D + "\x03\xc5\x03\x13\x00\x00\x1fP" + // 0x03C50313: 0x00001F50 + "\x03\xc5\x03\x14\x00\x00\x1fQ" + // 0x03C50314: 0x00001F51 + "\x1fP\x03\x00\x00\x00\x1fR" + // 0x1F500300: 0x00001F52 + "\x1fQ\x03\x00\x00\x00\x1fS" + // 0x1F510300: 0x00001F53 + "\x1fP\x03\x01\x00\x00\x1fT" + // 0x1F500301: 0x00001F54 + "\x1fQ\x03\x01\x00\x00\x1fU" + // 0x1F510301: 0x00001F55 + "\x1fP\x03B\x00\x00\x1fV" + // 0x1F500342: 0x00001F56 + "\x1fQ\x03B\x00\x00\x1fW" + // 0x1F510342: 0x00001F57 + "\x03\xa5\x03\x14\x00\x00\x1fY" + // 0x03A50314: 0x00001F59 + "\x1fY\x03\x00\x00\x00\x1f[" + // 0x1F590300: 0x00001F5B + "\x1fY\x03\x01\x00\x00\x1f]" + // 0x1F590301: 0x00001F5D + "\x1fY\x03B\x00\x00\x1f_" + // 0x1F590342: 0x00001F5F + "\x03\xc9\x03\x13\x00\x00\x1f`" + // 0x03C90313: 0x00001F60 + "\x03\xc9\x03\x14\x00\x00\x1fa" + // 0x03C90314: 0x00001F61 + "\x1f`\x03\x00\x00\x00\x1fb" + // 0x1F600300: 0x00001F62 + "\x1fa\x03\x00\x00\x00\x1fc" + // 0x1F610300: 0x00001F63 + "\x1f`\x03\x01\x00\x00\x1fd" + // 0x1F600301: 0x00001F64 + "\x1fa\x03\x01\x00\x00\x1fe" + // 0x1F610301: 0x00001F65 + "\x1f`\x03B\x00\x00\x1ff" + // 0x1F600342: 0x00001F66 + "\x1fa\x03B\x00\x00\x1fg" + // 0x1F610342: 0x00001F67 + "\x03\xa9\x03\x13\x00\x00\x1fh" + // 0x03A90313: 0x00001F68 + "\x03\xa9\x03\x14\x00\x00\x1fi" + // 0x03A90314: 0x00001F69 + "\x1fh\x03\x00\x00\x00\x1fj" + // 0x1F680300: 0x00001F6A + "\x1fi\x03\x00\x00\x00\x1fk" + // 0x1F690300: 0x00001F6B + "\x1fh\x03\x01\x00\x00\x1fl" + // 0x1F680301: 0x00001F6C + "\x1fi\x03\x01\x00\x00\x1fm" + // 0x1F690301: 0x00001F6D + "\x1fh\x03B\x00\x00\x1fn" + // 0x1F680342: 0x00001F6E + "\x1fi\x03B\x00\x00\x1fo" + // 0x1F690342: 0x00001F6F + "\x03\xb1\x03\x00\x00\x00\x1fp" + // 0x03B10300: 0x00001F70 + "\x03\xb5\x03\x00\x00\x00\x1fr" + // 0x03B50300: 0x00001F72 + "\x03\xb7\x03\x00\x00\x00\x1ft" + // 0x03B70300: 0x00001F74 + "\x03\xb9\x03\x00\x00\x00\x1fv" + // 0x03B90300: 0x00001F76 + "\x03\xbf\x03\x00\x00\x00\x1fx" + // 0x03BF0300: 0x00001F78 + "\x03\xc5\x03\x00\x00\x00\x1fz" + // 0x03C50300: 0x00001F7A + "\x03\xc9\x03\x00\x00\x00\x1f|" + // 0x03C90300: 0x00001F7C + "\x1f\x00\x03E\x00\x00\x1f\x80" + // 0x1F000345: 0x00001F80 + "\x1f\x01\x03E\x00\x00\x1f\x81" + // 0x1F010345: 0x00001F81 + "\x1f\x02\x03E\x00\x00\x1f\x82" + // 0x1F020345: 0x00001F82 + "\x1f\x03\x03E\x00\x00\x1f\x83" + // 0x1F030345: 0x00001F83 + "\x1f\x04\x03E\x00\x00\x1f\x84" + // 0x1F040345: 0x00001F84 + "\x1f\x05\x03E\x00\x00\x1f\x85" + // 0x1F050345: 0x00001F85 + "\x1f\x06\x03E\x00\x00\x1f\x86" + // 0x1F060345: 0x00001F86 + "\x1f\a\x03E\x00\x00\x1f\x87" + // 0x1F070345: 0x00001F87 + "\x1f\b\x03E\x00\x00\x1f\x88" + // 0x1F080345: 0x00001F88 + "\x1f\t\x03E\x00\x00\x1f\x89" + // 0x1F090345: 0x00001F89 + "\x1f\n\x03E\x00\x00\x1f\x8a" + // 0x1F0A0345: 0x00001F8A + "\x1f\v\x03E\x00\x00\x1f\x8b" + // 0x1F0B0345: 0x00001F8B + "\x1f\f\x03E\x00\x00\x1f\x8c" + // 0x1F0C0345: 0x00001F8C + "\x1f\r\x03E\x00\x00\x1f\x8d" + // 0x1F0D0345: 0x00001F8D + "\x1f\x0e\x03E\x00\x00\x1f\x8e" + // 0x1F0E0345: 0x00001F8E + "\x1f\x0f\x03E\x00\x00\x1f\x8f" + // 0x1F0F0345: 0x00001F8F + "\x1f \x03E\x00\x00\x1f\x90" + // 0x1F200345: 0x00001F90 + "\x1f!\x03E\x00\x00\x1f\x91" + // 0x1F210345: 0x00001F91 + "\x1f\"\x03E\x00\x00\x1f\x92" + // 0x1F220345: 0x00001F92 + "\x1f#\x03E\x00\x00\x1f\x93" + // 0x1F230345: 0x00001F93 + "\x1f$\x03E\x00\x00\x1f\x94" + // 0x1F240345: 0x00001F94 + "\x1f%\x03E\x00\x00\x1f\x95" + // 0x1F250345: 0x00001F95 + "\x1f&\x03E\x00\x00\x1f\x96" + // 0x1F260345: 0x00001F96 + "\x1f'\x03E\x00\x00\x1f\x97" + // 0x1F270345: 0x00001F97 + "\x1f(\x03E\x00\x00\x1f\x98" + // 0x1F280345: 0x00001F98 + "\x1f)\x03E\x00\x00\x1f\x99" + // 0x1F290345: 0x00001F99 + "\x1f*\x03E\x00\x00\x1f\x9a" + // 0x1F2A0345: 0x00001F9A + "\x1f+\x03E\x00\x00\x1f\x9b" + // 0x1F2B0345: 0x00001F9B + "\x1f,\x03E\x00\x00\x1f\x9c" + // 0x1F2C0345: 0x00001F9C + "\x1f-\x03E\x00\x00\x1f\x9d" + // 0x1F2D0345: 0x00001F9D + "\x1f.\x03E\x00\x00\x1f\x9e" + // 0x1F2E0345: 0x00001F9E + "\x1f/\x03E\x00\x00\x1f\x9f" + // 0x1F2F0345: 0x00001F9F + "\x1f`\x03E\x00\x00\x1f\xa0" + // 0x1F600345: 0x00001FA0 + "\x1fa\x03E\x00\x00\x1f\xa1" + // 0x1F610345: 0x00001FA1 + "\x1fb\x03E\x00\x00\x1f\xa2" + // 0x1F620345: 0x00001FA2 + "\x1fc\x03E\x00\x00\x1f\xa3" + // 0x1F630345: 0x00001FA3 + "\x1fd\x03E\x00\x00\x1f\xa4" + // 0x1F640345: 0x00001FA4 + "\x1fe\x03E\x00\x00\x1f\xa5" + // 0x1F650345: 0x00001FA5 + "\x1ff\x03E\x00\x00\x1f\xa6" + // 0x1F660345: 0x00001FA6 + "\x1fg\x03E\x00\x00\x1f\xa7" + // 0x1F670345: 0x00001FA7 + "\x1fh\x03E\x00\x00\x1f\xa8" + // 0x1F680345: 0x00001FA8 + "\x1fi\x03E\x00\x00\x1f\xa9" + // 0x1F690345: 0x00001FA9 + "\x1fj\x03E\x00\x00\x1f\xaa" + // 0x1F6A0345: 0x00001FAA + "\x1fk\x03E\x00\x00\x1f\xab" + // 0x1F6B0345: 0x00001FAB + "\x1fl\x03E\x00\x00\x1f\xac" + // 0x1F6C0345: 0x00001FAC + "\x1fm\x03E\x00\x00\x1f\xad" + // 0x1F6D0345: 0x00001FAD + "\x1fn\x03E\x00\x00\x1f\xae" + // 0x1F6E0345: 0x00001FAE + "\x1fo\x03E\x00\x00\x1f\xaf" + // 0x1F6F0345: 0x00001FAF + "\x03\xb1\x03\x06\x00\x00\x1f\xb0" + // 0x03B10306: 0x00001FB0 + "\x03\xb1\x03\x04\x00\x00\x1f\xb1" + // 0x03B10304: 0x00001FB1 + "\x1fp\x03E\x00\x00\x1f\xb2" + // 0x1F700345: 0x00001FB2 + "\x03\xb1\x03E\x00\x00\x1f\xb3" + // 0x03B10345: 0x00001FB3 + "\x03\xac\x03E\x00\x00\x1f\xb4" + // 0x03AC0345: 0x00001FB4 + "\x03\xb1\x03B\x00\x00\x1f\xb6" + // 0x03B10342: 0x00001FB6 + "\x1f\xb6\x03E\x00\x00\x1f\xb7" + // 0x1FB60345: 0x00001FB7 + "\x03\x91\x03\x06\x00\x00\x1f\xb8" + // 0x03910306: 0x00001FB8 + "\x03\x91\x03\x04\x00\x00\x1f\xb9" + // 0x03910304: 0x00001FB9 + "\x03\x91\x03\x00\x00\x00\x1f\xba" + // 0x03910300: 0x00001FBA + "\x03\x91\x03E\x00\x00\x1f\xbc" + // 0x03910345: 0x00001FBC + "\x00\xa8\x03B\x00\x00\x1f\xc1" + // 0x00A80342: 0x00001FC1 + "\x1ft\x03E\x00\x00\x1f\xc2" + // 0x1F740345: 0x00001FC2 + "\x03\xb7\x03E\x00\x00\x1f\xc3" + // 0x03B70345: 0x00001FC3 + "\x03\xae\x03E\x00\x00\x1f\xc4" + // 0x03AE0345: 0x00001FC4 + "\x03\xb7\x03B\x00\x00\x1f\xc6" + // 0x03B70342: 0x00001FC6 + "\x1f\xc6\x03E\x00\x00\x1f\xc7" + // 0x1FC60345: 0x00001FC7 + "\x03\x95\x03\x00\x00\x00\x1f\xc8" + // 0x03950300: 0x00001FC8 + "\x03\x97\x03\x00\x00\x00\x1f\xca" + // 0x03970300: 0x00001FCA + "\x03\x97\x03E\x00\x00\x1f\xcc" + // 0x03970345: 0x00001FCC + "\x1f\xbf\x03\x00\x00\x00\x1f\xcd" + // 0x1FBF0300: 0x00001FCD + "\x1f\xbf\x03\x01\x00\x00\x1f\xce" + // 0x1FBF0301: 0x00001FCE + "\x1f\xbf\x03B\x00\x00\x1f\xcf" + // 0x1FBF0342: 0x00001FCF + "\x03\xb9\x03\x06\x00\x00\x1f\xd0" + // 0x03B90306: 0x00001FD0 + "\x03\xb9\x03\x04\x00\x00\x1f\xd1" + // 0x03B90304: 0x00001FD1 + "\x03\xca\x03\x00\x00\x00\x1f\xd2" + // 0x03CA0300: 0x00001FD2 + "\x03\xb9\x03B\x00\x00\x1f\xd6" + // 0x03B90342: 0x00001FD6 + "\x03\xca\x03B\x00\x00\x1f\xd7" + // 0x03CA0342: 0x00001FD7 + "\x03\x99\x03\x06\x00\x00\x1f\xd8" + // 0x03990306: 0x00001FD8 + "\x03\x99\x03\x04\x00\x00\x1f\xd9" + // 0x03990304: 0x00001FD9 + "\x03\x99\x03\x00\x00\x00\x1f\xda" + // 0x03990300: 0x00001FDA + "\x1f\xfe\x03\x00\x00\x00\x1f\xdd" + // 0x1FFE0300: 0x00001FDD + "\x1f\xfe\x03\x01\x00\x00\x1f\xde" + // 0x1FFE0301: 0x00001FDE + "\x1f\xfe\x03B\x00\x00\x1f\xdf" + // 0x1FFE0342: 0x00001FDF + "\x03\xc5\x03\x06\x00\x00\x1f\xe0" + // 0x03C50306: 0x00001FE0 + "\x03\xc5\x03\x04\x00\x00\x1f\xe1" + // 0x03C50304: 0x00001FE1 + "\x03\xcb\x03\x00\x00\x00\x1f\xe2" + // 0x03CB0300: 0x00001FE2 + "\x03\xc1\x03\x13\x00\x00\x1f\xe4" + // 0x03C10313: 0x00001FE4 + "\x03\xc1\x03\x14\x00\x00\x1f\xe5" + // 0x03C10314: 0x00001FE5 + "\x03\xc5\x03B\x00\x00\x1f\xe6" + // 0x03C50342: 0x00001FE6 + "\x03\xcb\x03B\x00\x00\x1f\xe7" + // 0x03CB0342: 0x00001FE7 + "\x03\xa5\x03\x06\x00\x00\x1f\xe8" + // 0x03A50306: 0x00001FE8 + "\x03\xa5\x03\x04\x00\x00\x1f\xe9" + // 0x03A50304: 0x00001FE9 + "\x03\xa5\x03\x00\x00\x00\x1f\xea" + // 0x03A50300: 0x00001FEA + "\x03\xa1\x03\x14\x00\x00\x1f\xec" + // 0x03A10314: 0x00001FEC + "\x00\xa8\x03\x00\x00\x00\x1f\xed" + // 0x00A80300: 0x00001FED + "\x1f|\x03E\x00\x00\x1f\xf2" + // 0x1F7C0345: 0x00001FF2 + "\x03\xc9\x03E\x00\x00\x1f\xf3" + // 0x03C90345: 0x00001FF3 + "\x03\xce\x03E\x00\x00\x1f\xf4" + // 0x03CE0345: 0x00001FF4 + "\x03\xc9\x03B\x00\x00\x1f\xf6" + // 0x03C90342: 0x00001FF6 + "\x1f\xf6\x03E\x00\x00\x1f\xf7" + // 0x1FF60345: 0x00001FF7 + "\x03\x9f\x03\x00\x00\x00\x1f\xf8" + // 0x039F0300: 0x00001FF8 + "\x03\xa9\x03\x00\x00\x00\x1f\xfa" + // 0x03A90300: 0x00001FFA + "\x03\xa9\x03E\x00\x00\x1f\xfc" + // 0x03A90345: 0x00001FFC + "!\x90\x038\x00\x00!\x9a" + // 0x21900338: 0x0000219A + "!\x92\x038\x00\x00!\x9b" + // 0x21920338: 0x0000219B + "!\x94\x038\x00\x00!\xae" + // 0x21940338: 0x000021AE + "!\xd0\x038\x00\x00!\xcd" + // 0x21D00338: 0x000021CD + "!\xd4\x038\x00\x00!\xce" + // 0x21D40338: 0x000021CE + "!\xd2\x038\x00\x00!\xcf" + // 0x21D20338: 0x000021CF + "\"\x03\x038\x00\x00\"\x04" + // 0x22030338: 0x00002204 + "\"\b\x038\x00\x00\"\t" + // 0x22080338: 0x00002209 + "\"\v\x038\x00\x00\"\f" + // 0x220B0338: 0x0000220C + "\"#\x038\x00\x00\"$" + // 0x22230338: 0x00002224 + "\"%\x038\x00\x00\"&" + // 0x22250338: 0x00002226 + "\"<\x038\x00\x00\"A" + // 0x223C0338: 0x00002241 + "\"C\x038\x00\x00\"D" + // 0x22430338: 0x00002244 + "\"E\x038\x00\x00\"G" + // 0x22450338: 0x00002247 + "\"H\x038\x00\x00\"I" + // 0x22480338: 0x00002249 + "\x00=\x038\x00\x00\"`" + // 0x003D0338: 0x00002260 + "\"a\x038\x00\x00\"b" + // 0x22610338: 0x00002262 + "\"M\x038\x00\x00\"m" + // 0x224D0338: 0x0000226D + "\x00<\x038\x00\x00\"n" + // 0x003C0338: 0x0000226E + "\x00>\x038\x00\x00\"o" + // 0x003E0338: 0x0000226F + "\"d\x038\x00\x00\"p" + // 0x22640338: 0x00002270 + "\"e\x038\x00\x00\"q" + // 0x22650338: 0x00002271 + "\"r\x038\x00\x00\"t" + // 0x22720338: 0x00002274 + "\"s\x038\x00\x00\"u" + // 0x22730338: 0x00002275 + "\"v\x038\x00\x00\"x" + // 0x22760338: 0x00002278 + "\"w\x038\x00\x00\"y" + // 0x22770338: 0x00002279 + "\"z\x038\x00\x00\"\x80" + // 0x227A0338: 0x00002280 + "\"{\x038\x00\x00\"\x81" + // 0x227B0338: 0x00002281 + "\"\x82\x038\x00\x00\"\x84" + // 0x22820338: 0x00002284 + "\"\x83\x038\x00\x00\"\x85" + // 0x22830338: 0x00002285 + "\"\x86\x038\x00\x00\"\x88" + // 0x22860338: 0x00002288 + "\"\x87\x038\x00\x00\"\x89" + // 0x22870338: 0x00002289 + "\"\xa2\x038\x00\x00\"\xac" + // 0x22A20338: 0x000022AC + "\"\xa8\x038\x00\x00\"\xad" + // 0x22A80338: 0x000022AD + "\"\xa9\x038\x00\x00\"\xae" + // 0x22A90338: 0x000022AE + "\"\xab\x038\x00\x00\"\xaf" + // 0x22AB0338: 0x000022AF + "\"|\x038\x00\x00\"\xe0" + // 0x227C0338: 0x000022E0 + "\"}\x038\x00\x00\"\xe1" + // 0x227D0338: 0x000022E1 + "\"\x91\x038\x00\x00\"\xe2" + // 0x22910338: 0x000022E2 + "\"\x92\x038\x00\x00\"\xe3" + // 0x22920338: 0x000022E3 + "\"\xb2\x038\x00\x00\"\xea" + // 0x22B20338: 0x000022EA + "\"\xb3\x038\x00\x00\"\xeb" + // 0x22B30338: 0x000022EB + "\"\xb4\x038\x00\x00\"\xec" + // 0x22B40338: 0x000022EC + "\"\xb5\x038\x00\x00\"\xed" + // 0x22B50338: 0x000022ED + "0K0\x99\x00\x000L" + // 0x304B3099: 0x0000304C + "0M0\x99\x00\x000N" + // 0x304D3099: 0x0000304E + "0O0\x99\x00\x000P" + // 0x304F3099: 0x00003050 + "0Q0\x99\x00\x000R" + // 0x30513099: 0x00003052 + "0S0\x99\x00\x000T" + // 0x30533099: 0x00003054 + "0U0\x99\x00\x000V" + // 0x30553099: 0x00003056 + "0W0\x99\x00\x000X" + // 0x30573099: 0x00003058 + "0Y0\x99\x00\x000Z" + // 0x30593099: 0x0000305A + "0[0\x99\x00\x000\\" + // 0x305B3099: 0x0000305C + "0]0\x99\x00\x000^" + // 0x305D3099: 0x0000305E + "0_0\x99\x00\x000`" + // 0x305F3099: 0x00003060 + "0a0\x99\x00\x000b" + // 0x30613099: 0x00003062 + "0d0\x99\x00\x000e" + // 0x30643099: 0x00003065 + "0f0\x99\x00\x000g" + // 0x30663099: 0x00003067 + "0h0\x99\x00\x000i" + // 0x30683099: 0x00003069 + "0o0\x99\x00\x000p" + // 0x306F3099: 0x00003070 + "0o0\x9a\x00\x000q" + // 0x306F309A: 0x00003071 + "0r0\x99\x00\x000s" + // 0x30723099: 0x00003073 + "0r0\x9a\x00\x000t" + // 0x3072309A: 0x00003074 + "0u0\x99\x00\x000v" + // 0x30753099: 0x00003076 + "0u0\x9a\x00\x000w" + // 0x3075309A: 0x00003077 + "0x0\x99\x00\x000y" + // 0x30783099: 0x00003079 + "0x0\x9a\x00\x000z" + // 0x3078309A: 0x0000307A + "0{0\x99\x00\x000|" + // 0x307B3099: 0x0000307C + "0{0\x9a\x00\x000}" + // 0x307B309A: 0x0000307D + "0F0\x99\x00\x000\x94" + // 0x30463099: 0x00003094 + "0\x9d0\x99\x00\x000\x9e" + // 0x309D3099: 0x0000309E + "0\xab0\x99\x00\x000\xac" + // 0x30AB3099: 0x000030AC + "0\xad0\x99\x00\x000\xae" + // 0x30AD3099: 0x000030AE + "0\xaf0\x99\x00\x000\xb0" + // 0x30AF3099: 0x000030B0 + "0\xb10\x99\x00\x000\xb2" + // 0x30B13099: 0x000030B2 + "0\xb30\x99\x00\x000\xb4" + // 0x30B33099: 0x000030B4 + "0\xb50\x99\x00\x000\xb6" + // 0x30B53099: 0x000030B6 + "0\xb70\x99\x00\x000\xb8" + // 0x30B73099: 0x000030B8 + "0\xb90\x99\x00\x000\xba" + // 0x30B93099: 0x000030BA + "0\xbb0\x99\x00\x000\xbc" + // 0x30BB3099: 0x000030BC + "0\xbd0\x99\x00\x000\xbe" + // 0x30BD3099: 0x000030BE + "0\xbf0\x99\x00\x000\xc0" + // 0x30BF3099: 0x000030C0 + "0\xc10\x99\x00\x000\xc2" + // 0x30C13099: 0x000030C2 + "0\xc40\x99\x00\x000\xc5" + // 0x30C43099: 0x000030C5 + "0\xc60\x99\x00\x000\xc7" + // 0x30C63099: 0x000030C7 + "0\xc80\x99\x00\x000\xc9" + // 0x30C83099: 0x000030C9 + "0\xcf0\x99\x00\x000\xd0" + // 0x30CF3099: 0x000030D0 + "0\xcf0\x9a\x00\x000\xd1" + // 0x30CF309A: 0x000030D1 + "0\xd20\x99\x00\x000\xd3" + // 0x30D23099: 0x000030D3 + "0\xd20\x9a\x00\x000\xd4" + // 0x30D2309A: 0x000030D4 + "0\xd50\x99\x00\x000\xd6" + // 0x30D53099: 0x000030D6 + "0\xd50\x9a\x00\x000\xd7" + // 0x30D5309A: 0x000030D7 + "0\xd80\x99\x00\x000\xd9" + // 0x30D83099: 0x000030D9 + "0\xd80\x9a\x00\x000\xda" + // 0x30D8309A: 0x000030DA + "0\xdb0\x99\x00\x000\xdc" + // 0x30DB3099: 0x000030DC + "0\xdb0\x9a\x00\x000\xdd" + // 0x30DB309A: 0x000030DD + "0\xa60\x99\x00\x000\xf4" + // 0x30A63099: 0x000030F4 + "0\xef0\x99\x00\x000\xf7" + // 0x30EF3099: 0x000030F7 + "0\xf00\x99\x00\x000\xf8" + // 0x30F03099: 0x000030F8 + "0\xf10\x99\x00\x000\xf9" + // 0x30F13099: 0x000030F9 + "0\xf20\x99\x00\x000\xfa" + // 0x30F23099: 0x000030FA + "0\xfd0\x99\x00\x000\xfe" + // 0x30FD3099: 0x000030FE + "\x10\x99\x10\xba\x00\x01\x10\x9a" + // 0x109910BA: 0x0001109A + "\x10\x9b\x10\xba\x00\x01\x10\x9c" + // 0x109B10BA: 0x0001109C + "\x10\xa5\x10\xba\x00\x01\x10\xab" + // 0x10A510BA: 0x000110AB + "\x111\x11'\x00\x01\x11." + // 0x11311127: 0x0001112E + "\x112\x11'\x00\x01\x11/" + // 0x11321127: 0x0001112F + "\x13G\x13>\x00\x01\x13K" + // 0x1347133E: 0x0001134B + "\x13G\x13W\x00\x01\x13L" + // 0x13471357: 0x0001134C + "\x14\xb9\x14\xba\x00\x01\x14\xbb" + // 0x14B914BA: 0x000114BB + "\x14\xb9\x14\xb0\x00\x01\x14\xbc" + // 0x14B914B0: 0x000114BC + "\x14\xb9\x14\xbd\x00\x01\x14\xbe" + // 0x14B914BD: 0x000114BE + "\x15\xb8\x15\xaf\x00\x01\x15\xba" + // 0x15B815AF: 0x000115BA + "\x15\xb9\x15\xaf\x00\x01\x15\xbb" + // 0x15B915AF: 0x000115BB + "" + // Total size of tables: 55KB (55977 bytes) diff --git a/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go new file mode 100644 index 0000000000..96a130d30e --- /dev/null +++ b/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go @@ -0,0 +1,7761 @@ +// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. + +//go:build go1.16 +// +build go1.16 + +package norm + +import "sync" + +const ( + // Version is the Unicode edition from which the tables are derived. + Version = "13.0.0" + + // MaxTransformChunkSize indicates the maximum number of bytes that Transform + // may need to write atomically for any Form. Making a destination buffer at + // least this size ensures that Transform can always make progress and that + // the user does not need to grow the buffer on an ErrShortDst. + MaxTransformChunkSize = 35 + maxNonStarters*4 +) + +var ccc = [56]uint8{ + 0, 1, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, + 36, 84, 91, 103, 107, 118, 122, 129, + 130, 132, 202, 214, 216, 218, 220, 222, + 224, 226, 228, 230, 232, 233, 234, 240, +} + +const ( + firstMulti = 0x1870 + firstCCC = 0x2CAB + endMulti = 0x2F77 + firstLeadingCCC = 0x49C5 + firstCCCZeroExcept = 0x4A8F + firstStarterWithNLead = 0x4AB6 + lastDecomp = 0x4AB8 + maxDecomp = 0x8000 +) + +// decomps: 19128 bytes +var decomps = [...]byte{ + // Bytes 0 - 3f + 0x00, 0x41, 0x20, 0x41, 0x21, 0x41, 0x22, 0x41, + 0x23, 0x41, 0x24, 0x41, 0x25, 0x41, 0x26, 0x41, + 0x27, 0x41, 0x28, 0x41, 0x29, 0x41, 0x2A, 0x41, + 0x2B, 0x41, 0x2C, 0x41, 0x2D, 0x41, 0x2E, 0x41, + 0x2F, 0x41, 0x30, 0x41, 0x31, 0x41, 0x32, 0x41, + 0x33, 0x41, 0x34, 0x41, 0x35, 0x41, 0x36, 0x41, + 0x37, 0x41, 0x38, 0x41, 0x39, 0x41, 0x3A, 0x41, + 0x3B, 0x41, 0x3C, 0x41, 0x3D, 0x41, 0x3E, 0x41, + // Bytes 40 - 7f + 0x3F, 0x41, 0x40, 0x41, 0x41, 0x41, 0x42, 0x41, + 0x43, 0x41, 0x44, 0x41, 0x45, 0x41, 0x46, 0x41, + 0x47, 0x41, 0x48, 0x41, 0x49, 0x41, 0x4A, 0x41, + 0x4B, 0x41, 0x4C, 0x41, 0x4D, 0x41, 0x4E, 0x41, + 0x4F, 0x41, 0x50, 0x41, 0x51, 0x41, 0x52, 0x41, + 0x53, 0x41, 0x54, 0x41, 0x55, 0x41, 0x56, 0x41, + 0x57, 0x41, 0x58, 0x41, 0x59, 0x41, 0x5A, 0x41, + 0x5B, 0x41, 0x5C, 0x41, 0x5D, 0x41, 0x5E, 0x41, + // Bytes 80 - bf + 0x5F, 0x41, 0x60, 0x41, 0x61, 0x41, 0x62, 0x41, + 0x63, 0x41, 0x64, 0x41, 0x65, 0x41, 0x66, 0x41, + 0x67, 0x41, 0x68, 0x41, 0x69, 0x41, 0x6A, 0x41, + 0x6B, 0x41, 0x6C, 0x41, 0x6D, 0x41, 0x6E, 0x41, + 0x6F, 0x41, 0x70, 0x41, 0x71, 0x41, 0x72, 0x41, + 0x73, 0x41, 0x74, 0x41, 0x75, 0x41, 0x76, 0x41, + 0x77, 0x41, 0x78, 0x41, 0x79, 0x41, 0x7A, 0x41, + 0x7B, 0x41, 0x7C, 0x41, 0x7D, 0x41, 0x7E, 0x42, + // Bytes c0 - ff + 0xC2, 0xA2, 0x42, 0xC2, 0xA3, 0x42, 0xC2, 0xA5, + 0x42, 0xC2, 0xA6, 0x42, 0xC2, 0xAC, 0x42, 0xC2, + 0xB7, 0x42, 0xC3, 0x86, 0x42, 0xC3, 0xB0, 0x42, + 0xC4, 0xA6, 0x42, 0xC4, 0xA7, 0x42, 0xC4, 0xB1, + 0x42, 0xC5, 0x8B, 0x42, 0xC5, 0x93, 0x42, 0xC6, + 0x8E, 0x42, 0xC6, 0x90, 0x42, 0xC6, 0xAB, 0x42, + 0xC8, 0xA2, 0x42, 0xC8, 0xB7, 0x42, 0xC9, 0x90, + 0x42, 0xC9, 0x91, 0x42, 0xC9, 0x92, 0x42, 0xC9, + // Bytes 100 - 13f + 0x94, 0x42, 0xC9, 0x95, 0x42, 0xC9, 0x99, 0x42, + 0xC9, 0x9B, 0x42, 0xC9, 0x9C, 0x42, 0xC9, 0x9F, + 0x42, 0xC9, 0xA1, 0x42, 0xC9, 0xA3, 0x42, 0xC9, + 0xA5, 0x42, 0xC9, 0xA6, 0x42, 0xC9, 0xA8, 0x42, + 0xC9, 0xA9, 0x42, 0xC9, 0xAA, 0x42, 0xC9, 0xAB, + 0x42, 0xC9, 0xAD, 0x42, 0xC9, 0xAF, 0x42, 0xC9, + 0xB0, 0x42, 0xC9, 0xB1, 0x42, 0xC9, 0xB2, 0x42, + 0xC9, 0xB3, 0x42, 0xC9, 0xB4, 0x42, 0xC9, 0xB5, + // Bytes 140 - 17f + 0x42, 0xC9, 0xB8, 0x42, 0xC9, 0xB9, 0x42, 0xC9, + 0xBB, 0x42, 0xCA, 0x81, 0x42, 0xCA, 0x82, 0x42, + 0xCA, 0x83, 0x42, 0xCA, 0x89, 0x42, 0xCA, 0x8A, + 0x42, 0xCA, 0x8B, 0x42, 0xCA, 0x8C, 0x42, 0xCA, + 0x8D, 0x42, 0xCA, 0x90, 0x42, 0xCA, 0x91, 0x42, + 0xCA, 0x92, 0x42, 0xCA, 0x95, 0x42, 0xCA, 0x9D, + 0x42, 0xCA, 0x9F, 0x42, 0xCA, 0xB9, 0x42, 0xCE, + 0x91, 0x42, 0xCE, 0x92, 0x42, 0xCE, 0x93, 0x42, + // Bytes 180 - 1bf + 0xCE, 0x94, 0x42, 0xCE, 0x95, 0x42, 0xCE, 0x96, + 0x42, 0xCE, 0x97, 0x42, 0xCE, 0x98, 0x42, 0xCE, + 0x99, 0x42, 0xCE, 0x9A, 0x42, 0xCE, 0x9B, 0x42, + 0xCE, 0x9C, 0x42, 0xCE, 0x9D, 0x42, 0xCE, 0x9E, + 0x42, 0xCE, 0x9F, 0x42, 0xCE, 0xA0, 0x42, 0xCE, + 0xA1, 0x42, 0xCE, 0xA3, 0x42, 0xCE, 0xA4, 0x42, + 0xCE, 0xA5, 0x42, 0xCE, 0xA6, 0x42, 0xCE, 0xA7, + 0x42, 0xCE, 0xA8, 0x42, 0xCE, 0xA9, 0x42, 0xCE, + // Bytes 1c0 - 1ff + 0xB1, 0x42, 0xCE, 0xB2, 0x42, 0xCE, 0xB3, 0x42, + 0xCE, 0xB4, 0x42, 0xCE, 0xB5, 0x42, 0xCE, 0xB6, + 0x42, 0xCE, 0xB7, 0x42, 0xCE, 0xB8, 0x42, 0xCE, + 0xB9, 0x42, 0xCE, 0xBA, 0x42, 0xCE, 0xBB, 0x42, + 0xCE, 0xBC, 0x42, 0xCE, 0xBD, 0x42, 0xCE, 0xBE, + 0x42, 0xCE, 0xBF, 0x42, 0xCF, 0x80, 0x42, 0xCF, + 0x81, 0x42, 0xCF, 0x82, 0x42, 0xCF, 0x83, 0x42, + 0xCF, 0x84, 0x42, 0xCF, 0x85, 0x42, 0xCF, 0x86, + // Bytes 200 - 23f + 0x42, 0xCF, 0x87, 0x42, 0xCF, 0x88, 0x42, 0xCF, + 0x89, 0x42, 0xCF, 0x9C, 0x42, 0xCF, 0x9D, 0x42, + 0xD0, 0xBD, 0x42, 0xD1, 0x8A, 0x42, 0xD1, 0x8C, + 0x42, 0xD7, 0x90, 0x42, 0xD7, 0x91, 0x42, 0xD7, + 0x92, 0x42, 0xD7, 0x93, 0x42, 0xD7, 0x94, 0x42, + 0xD7, 0x9B, 0x42, 0xD7, 0x9C, 0x42, 0xD7, 0x9D, + 0x42, 0xD7, 0xA2, 0x42, 0xD7, 0xA8, 0x42, 0xD7, + 0xAA, 0x42, 0xD8, 0xA1, 0x42, 0xD8, 0xA7, 0x42, + // Bytes 240 - 27f + 0xD8, 0xA8, 0x42, 0xD8, 0xA9, 0x42, 0xD8, 0xAA, + 0x42, 0xD8, 0xAB, 0x42, 0xD8, 0xAC, 0x42, 0xD8, + 0xAD, 0x42, 0xD8, 0xAE, 0x42, 0xD8, 0xAF, 0x42, + 0xD8, 0xB0, 0x42, 0xD8, 0xB1, 0x42, 0xD8, 0xB2, + 0x42, 0xD8, 0xB3, 0x42, 0xD8, 0xB4, 0x42, 0xD8, + 0xB5, 0x42, 0xD8, 0xB6, 0x42, 0xD8, 0xB7, 0x42, + 0xD8, 0xB8, 0x42, 0xD8, 0xB9, 0x42, 0xD8, 0xBA, + 0x42, 0xD9, 0x81, 0x42, 0xD9, 0x82, 0x42, 0xD9, + // Bytes 280 - 2bf + 0x83, 0x42, 0xD9, 0x84, 0x42, 0xD9, 0x85, 0x42, + 0xD9, 0x86, 0x42, 0xD9, 0x87, 0x42, 0xD9, 0x88, + 0x42, 0xD9, 0x89, 0x42, 0xD9, 0x8A, 0x42, 0xD9, + 0xAE, 0x42, 0xD9, 0xAF, 0x42, 0xD9, 0xB1, 0x42, + 0xD9, 0xB9, 0x42, 0xD9, 0xBA, 0x42, 0xD9, 0xBB, + 0x42, 0xD9, 0xBE, 0x42, 0xD9, 0xBF, 0x42, 0xDA, + 0x80, 0x42, 0xDA, 0x83, 0x42, 0xDA, 0x84, 0x42, + 0xDA, 0x86, 0x42, 0xDA, 0x87, 0x42, 0xDA, 0x88, + // Bytes 2c0 - 2ff + 0x42, 0xDA, 0x8C, 0x42, 0xDA, 0x8D, 0x42, 0xDA, + 0x8E, 0x42, 0xDA, 0x91, 0x42, 0xDA, 0x98, 0x42, + 0xDA, 0xA1, 0x42, 0xDA, 0xA4, 0x42, 0xDA, 0xA6, + 0x42, 0xDA, 0xA9, 0x42, 0xDA, 0xAD, 0x42, 0xDA, + 0xAF, 0x42, 0xDA, 0xB1, 0x42, 0xDA, 0xB3, 0x42, + 0xDA, 0xBA, 0x42, 0xDA, 0xBB, 0x42, 0xDA, 0xBE, + 0x42, 0xDB, 0x81, 0x42, 0xDB, 0x85, 0x42, 0xDB, + 0x86, 0x42, 0xDB, 0x87, 0x42, 0xDB, 0x88, 0x42, + // Bytes 300 - 33f + 0xDB, 0x89, 0x42, 0xDB, 0x8B, 0x42, 0xDB, 0x8C, + 0x42, 0xDB, 0x90, 0x42, 0xDB, 0x92, 0x43, 0xE0, + 0xBC, 0x8B, 0x43, 0xE1, 0x83, 0x9C, 0x43, 0xE1, + 0x84, 0x80, 0x43, 0xE1, 0x84, 0x81, 0x43, 0xE1, + 0x84, 0x82, 0x43, 0xE1, 0x84, 0x83, 0x43, 0xE1, + 0x84, 0x84, 0x43, 0xE1, 0x84, 0x85, 0x43, 0xE1, + 0x84, 0x86, 0x43, 0xE1, 0x84, 0x87, 0x43, 0xE1, + 0x84, 0x88, 0x43, 0xE1, 0x84, 0x89, 0x43, 0xE1, + // Bytes 340 - 37f + 0x84, 0x8A, 0x43, 0xE1, 0x84, 0x8B, 0x43, 0xE1, + 0x84, 0x8C, 0x43, 0xE1, 0x84, 0x8D, 0x43, 0xE1, + 0x84, 0x8E, 0x43, 0xE1, 0x84, 0x8F, 0x43, 0xE1, + 0x84, 0x90, 0x43, 0xE1, 0x84, 0x91, 0x43, 0xE1, + 0x84, 0x92, 0x43, 0xE1, 0x84, 0x94, 0x43, 0xE1, + 0x84, 0x95, 0x43, 0xE1, 0x84, 0x9A, 0x43, 0xE1, + 0x84, 0x9C, 0x43, 0xE1, 0x84, 0x9D, 0x43, 0xE1, + 0x84, 0x9E, 0x43, 0xE1, 0x84, 0xA0, 0x43, 0xE1, + // Bytes 380 - 3bf + 0x84, 0xA1, 0x43, 0xE1, 0x84, 0xA2, 0x43, 0xE1, + 0x84, 0xA3, 0x43, 0xE1, 0x84, 0xA7, 0x43, 0xE1, + 0x84, 0xA9, 0x43, 0xE1, 0x84, 0xAB, 0x43, 0xE1, + 0x84, 0xAC, 0x43, 0xE1, 0x84, 0xAD, 0x43, 0xE1, + 0x84, 0xAE, 0x43, 0xE1, 0x84, 0xAF, 0x43, 0xE1, + 0x84, 0xB2, 0x43, 0xE1, 0x84, 0xB6, 0x43, 0xE1, + 0x85, 0x80, 0x43, 0xE1, 0x85, 0x87, 0x43, 0xE1, + 0x85, 0x8C, 0x43, 0xE1, 0x85, 0x97, 0x43, 0xE1, + // Bytes 3c0 - 3ff + 0x85, 0x98, 0x43, 0xE1, 0x85, 0x99, 0x43, 0xE1, + 0x85, 0xA0, 0x43, 0xE1, 0x86, 0x84, 0x43, 0xE1, + 0x86, 0x85, 0x43, 0xE1, 0x86, 0x88, 0x43, 0xE1, + 0x86, 0x91, 0x43, 0xE1, 0x86, 0x92, 0x43, 0xE1, + 0x86, 0x94, 0x43, 0xE1, 0x86, 0x9E, 0x43, 0xE1, + 0x86, 0xA1, 0x43, 0xE1, 0x87, 0x87, 0x43, 0xE1, + 0x87, 0x88, 0x43, 0xE1, 0x87, 0x8C, 0x43, 0xE1, + 0x87, 0x8E, 0x43, 0xE1, 0x87, 0x93, 0x43, 0xE1, + // Bytes 400 - 43f + 0x87, 0x97, 0x43, 0xE1, 0x87, 0x99, 0x43, 0xE1, + 0x87, 0x9D, 0x43, 0xE1, 0x87, 0x9F, 0x43, 0xE1, + 0x87, 0xB1, 0x43, 0xE1, 0x87, 0xB2, 0x43, 0xE1, + 0xB4, 0x82, 0x43, 0xE1, 0xB4, 0x96, 0x43, 0xE1, + 0xB4, 0x97, 0x43, 0xE1, 0xB4, 0x9C, 0x43, 0xE1, + 0xB4, 0x9D, 0x43, 0xE1, 0xB4, 0xA5, 0x43, 0xE1, + 0xB5, 0xBB, 0x43, 0xE1, 0xB6, 0x85, 0x43, 0xE2, + 0x80, 0x82, 0x43, 0xE2, 0x80, 0x83, 0x43, 0xE2, + // Bytes 440 - 47f + 0x80, 0x90, 0x43, 0xE2, 0x80, 0x93, 0x43, 0xE2, + 0x80, 0x94, 0x43, 0xE2, 0x82, 0xA9, 0x43, 0xE2, + 0x86, 0x90, 0x43, 0xE2, 0x86, 0x91, 0x43, 0xE2, + 0x86, 0x92, 0x43, 0xE2, 0x86, 0x93, 0x43, 0xE2, + 0x88, 0x82, 0x43, 0xE2, 0x88, 0x87, 0x43, 0xE2, + 0x88, 0x91, 0x43, 0xE2, 0x88, 0x92, 0x43, 0xE2, + 0x94, 0x82, 0x43, 0xE2, 0x96, 0xA0, 0x43, 0xE2, + 0x97, 0x8B, 0x43, 0xE2, 0xA6, 0x85, 0x43, 0xE2, + // Bytes 480 - 4bf + 0xA6, 0x86, 0x43, 0xE2, 0xB5, 0xA1, 0x43, 0xE3, + 0x80, 0x81, 0x43, 0xE3, 0x80, 0x82, 0x43, 0xE3, + 0x80, 0x88, 0x43, 0xE3, 0x80, 0x89, 0x43, 0xE3, + 0x80, 0x8A, 0x43, 0xE3, 0x80, 0x8B, 0x43, 0xE3, + 0x80, 0x8C, 0x43, 0xE3, 0x80, 0x8D, 0x43, 0xE3, + 0x80, 0x8E, 0x43, 0xE3, 0x80, 0x8F, 0x43, 0xE3, + 0x80, 0x90, 0x43, 0xE3, 0x80, 0x91, 0x43, 0xE3, + 0x80, 0x92, 0x43, 0xE3, 0x80, 0x94, 0x43, 0xE3, + // Bytes 4c0 - 4ff + 0x80, 0x95, 0x43, 0xE3, 0x80, 0x96, 0x43, 0xE3, + 0x80, 0x97, 0x43, 0xE3, 0x82, 0xA1, 0x43, 0xE3, + 0x82, 0xA2, 0x43, 0xE3, 0x82, 0xA3, 0x43, 0xE3, + 0x82, 0xA4, 0x43, 0xE3, 0x82, 0xA5, 0x43, 0xE3, + 0x82, 0xA6, 0x43, 0xE3, 0x82, 0xA7, 0x43, 0xE3, + 0x82, 0xA8, 0x43, 0xE3, 0x82, 0xA9, 0x43, 0xE3, + 0x82, 0xAA, 0x43, 0xE3, 0x82, 0xAB, 0x43, 0xE3, + 0x82, 0xAD, 0x43, 0xE3, 0x82, 0xAF, 0x43, 0xE3, + // Bytes 500 - 53f + 0x82, 0xB1, 0x43, 0xE3, 0x82, 0xB3, 0x43, 0xE3, + 0x82, 0xB5, 0x43, 0xE3, 0x82, 0xB7, 0x43, 0xE3, + 0x82, 0xB9, 0x43, 0xE3, 0x82, 0xBB, 0x43, 0xE3, + 0x82, 0xBD, 0x43, 0xE3, 0x82, 0xBF, 0x43, 0xE3, + 0x83, 0x81, 0x43, 0xE3, 0x83, 0x83, 0x43, 0xE3, + 0x83, 0x84, 0x43, 0xE3, 0x83, 0x86, 0x43, 0xE3, + 0x83, 0x88, 0x43, 0xE3, 0x83, 0x8A, 0x43, 0xE3, + 0x83, 0x8B, 0x43, 0xE3, 0x83, 0x8C, 0x43, 0xE3, + // Bytes 540 - 57f + 0x83, 0x8D, 0x43, 0xE3, 0x83, 0x8E, 0x43, 0xE3, + 0x83, 0x8F, 0x43, 0xE3, 0x83, 0x92, 0x43, 0xE3, + 0x83, 0x95, 0x43, 0xE3, 0x83, 0x98, 0x43, 0xE3, + 0x83, 0x9B, 0x43, 0xE3, 0x83, 0x9E, 0x43, 0xE3, + 0x83, 0x9F, 0x43, 0xE3, 0x83, 0xA0, 0x43, 0xE3, + 0x83, 0xA1, 0x43, 0xE3, 0x83, 0xA2, 0x43, 0xE3, + 0x83, 0xA3, 0x43, 0xE3, 0x83, 0xA4, 0x43, 0xE3, + 0x83, 0xA5, 0x43, 0xE3, 0x83, 0xA6, 0x43, 0xE3, + // Bytes 580 - 5bf + 0x83, 0xA7, 0x43, 0xE3, 0x83, 0xA8, 0x43, 0xE3, + 0x83, 0xA9, 0x43, 0xE3, 0x83, 0xAA, 0x43, 0xE3, + 0x83, 0xAB, 0x43, 0xE3, 0x83, 0xAC, 0x43, 0xE3, + 0x83, 0xAD, 0x43, 0xE3, 0x83, 0xAF, 0x43, 0xE3, + 0x83, 0xB0, 0x43, 0xE3, 0x83, 0xB1, 0x43, 0xE3, + 0x83, 0xB2, 0x43, 0xE3, 0x83, 0xB3, 0x43, 0xE3, + 0x83, 0xBB, 0x43, 0xE3, 0x83, 0xBC, 0x43, 0xE3, + 0x92, 0x9E, 0x43, 0xE3, 0x92, 0xB9, 0x43, 0xE3, + // Bytes 5c0 - 5ff + 0x92, 0xBB, 0x43, 0xE3, 0x93, 0x9F, 0x43, 0xE3, + 0x94, 0x95, 0x43, 0xE3, 0x9B, 0xAE, 0x43, 0xE3, + 0x9B, 0xBC, 0x43, 0xE3, 0x9E, 0x81, 0x43, 0xE3, + 0xA0, 0xAF, 0x43, 0xE3, 0xA1, 0xA2, 0x43, 0xE3, + 0xA1, 0xBC, 0x43, 0xE3, 0xA3, 0x87, 0x43, 0xE3, + 0xA3, 0xA3, 0x43, 0xE3, 0xA4, 0x9C, 0x43, 0xE3, + 0xA4, 0xBA, 0x43, 0xE3, 0xA8, 0xAE, 0x43, 0xE3, + 0xA9, 0xAC, 0x43, 0xE3, 0xAB, 0xA4, 0x43, 0xE3, + // Bytes 600 - 63f + 0xAC, 0x88, 0x43, 0xE3, 0xAC, 0x99, 0x43, 0xE3, + 0xAD, 0x89, 0x43, 0xE3, 0xAE, 0x9D, 0x43, 0xE3, + 0xB0, 0x98, 0x43, 0xE3, 0xB1, 0x8E, 0x43, 0xE3, + 0xB4, 0xB3, 0x43, 0xE3, 0xB6, 0x96, 0x43, 0xE3, + 0xBA, 0xAC, 0x43, 0xE3, 0xBA, 0xB8, 0x43, 0xE3, + 0xBC, 0x9B, 0x43, 0xE3, 0xBF, 0xBC, 0x43, 0xE4, + 0x80, 0x88, 0x43, 0xE4, 0x80, 0x98, 0x43, 0xE4, + 0x80, 0xB9, 0x43, 0xE4, 0x81, 0x86, 0x43, 0xE4, + // Bytes 640 - 67f + 0x82, 0x96, 0x43, 0xE4, 0x83, 0xA3, 0x43, 0xE4, + 0x84, 0xAF, 0x43, 0xE4, 0x88, 0x82, 0x43, 0xE4, + 0x88, 0xA7, 0x43, 0xE4, 0x8A, 0xA0, 0x43, 0xE4, + 0x8C, 0x81, 0x43, 0xE4, 0x8C, 0xB4, 0x43, 0xE4, + 0x8D, 0x99, 0x43, 0xE4, 0x8F, 0x95, 0x43, 0xE4, + 0x8F, 0x99, 0x43, 0xE4, 0x90, 0x8B, 0x43, 0xE4, + 0x91, 0xAB, 0x43, 0xE4, 0x94, 0xAB, 0x43, 0xE4, + 0x95, 0x9D, 0x43, 0xE4, 0x95, 0xA1, 0x43, 0xE4, + // Bytes 680 - 6bf + 0x95, 0xAB, 0x43, 0xE4, 0x97, 0x97, 0x43, 0xE4, + 0x97, 0xB9, 0x43, 0xE4, 0x98, 0xB5, 0x43, 0xE4, + 0x9A, 0xBE, 0x43, 0xE4, 0x9B, 0x87, 0x43, 0xE4, + 0xA6, 0x95, 0x43, 0xE4, 0xA7, 0xA6, 0x43, 0xE4, + 0xA9, 0xAE, 0x43, 0xE4, 0xA9, 0xB6, 0x43, 0xE4, + 0xAA, 0xB2, 0x43, 0xE4, 0xAC, 0xB3, 0x43, 0xE4, + 0xAF, 0x8E, 0x43, 0xE4, 0xB3, 0x8E, 0x43, 0xE4, + 0xB3, 0xAD, 0x43, 0xE4, 0xB3, 0xB8, 0x43, 0xE4, + // Bytes 6c0 - 6ff + 0xB5, 0x96, 0x43, 0xE4, 0xB8, 0x80, 0x43, 0xE4, + 0xB8, 0x81, 0x43, 0xE4, 0xB8, 0x83, 0x43, 0xE4, + 0xB8, 0x89, 0x43, 0xE4, 0xB8, 0x8A, 0x43, 0xE4, + 0xB8, 0x8B, 0x43, 0xE4, 0xB8, 0x8D, 0x43, 0xE4, + 0xB8, 0x99, 0x43, 0xE4, 0xB8, 0xA6, 0x43, 0xE4, + 0xB8, 0xA8, 0x43, 0xE4, 0xB8, 0xAD, 0x43, 0xE4, + 0xB8, 0xB2, 0x43, 0xE4, 0xB8, 0xB6, 0x43, 0xE4, + 0xB8, 0xB8, 0x43, 0xE4, 0xB8, 0xB9, 0x43, 0xE4, + // Bytes 700 - 73f + 0xB8, 0xBD, 0x43, 0xE4, 0xB8, 0xBF, 0x43, 0xE4, + 0xB9, 0x81, 0x43, 0xE4, 0xB9, 0x99, 0x43, 0xE4, + 0xB9, 0x9D, 0x43, 0xE4, 0xBA, 0x82, 0x43, 0xE4, + 0xBA, 0x85, 0x43, 0xE4, 0xBA, 0x86, 0x43, 0xE4, + 0xBA, 0x8C, 0x43, 0xE4, 0xBA, 0x94, 0x43, 0xE4, + 0xBA, 0xA0, 0x43, 0xE4, 0xBA, 0xA4, 0x43, 0xE4, + 0xBA, 0xAE, 0x43, 0xE4, 0xBA, 0xBA, 0x43, 0xE4, + 0xBB, 0x80, 0x43, 0xE4, 0xBB, 0x8C, 0x43, 0xE4, + // Bytes 740 - 77f + 0xBB, 0xA4, 0x43, 0xE4, 0xBC, 0x81, 0x43, 0xE4, + 0xBC, 0x91, 0x43, 0xE4, 0xBD, 0xA0, 0x43, 0xE4, + 0xBE, 0x80, 0x43, 0xE4, 0xBE, 0x86, 0x43, 0xE4, + 0xBE, 0x8B, 0x43, 0xE4, 0xBE, 0xAE, 0x43, 0xE4, + 0xBE, 0xBB, 0x43, 0xE4, 0xBE, 0xBF, 0x43, 0xE5, + 0x80, 0x82, 0x43, 0xE5, 0x80, 0xAB, 0x43, 0xE5, + 0x81, 0xBA, 0x43, 0xE5, 0x82, 0x99, 0x43, 0xE5, + 0x83, 0x8F, 0x43, 0xE5, 0x83, 0x9A, 0x43, 0xE5, + // Bytes 780 - 7bf + 0x83, 0xA7, 0x43, 0xE5, 0x84, 0xAA, 0x43, 0xE5, + 0x84, 0xBF, 0x43, 0xE5, 0x85, 0x80, 0x43, 0xE5, + 0x85, 0x85, 0x43, 0xE5, 0x85, 0x8D, 0x43, 0xE5, + 0x85, 0x94, 0x43, 0xE5, 0x85, 0xA4, 0x43, 0xE5, + 0x85, 0xA5, 0x43, 0xE5, 0x85, 0xA7, 0x43, 0xE5, + 0x85, 0xA8, 0x43, 0xE5, 0x85, 0xA9, 0x43, 0xE5, + 0x85, 0xAB, 0x43, 0xE5, 0x85, 0xAD, 0x43, 0xE5, + 0x85, 0xB7, 0x43, 0xE5, 0x86, 0x80, 0x43, 0xE5, + // Bytes 7c0 - 7ff + 0x86, 0x82, 0x43, 0xE5, 0x86, 0x8D, 0x43, 0xE5, + 0x86, 0x92, 0x43, 0xE5, 0x86, 0x95, 0x43, 0xE5, + 0x86, 0x96, 0x43, 0xE5, 0x86, 0x97, 0x43, 0xE5, + 0x86, 0x99, 0x43, 0xE5, 0x86, 0xA4, 0x43, 0xE5, + 0x86, 0xAB, 0x43, 0xE5, 0x86, 0xAC, 0x43, 0xE5, + 0x86, 0xB5, 0x43, 0xE5, 0x86, 0xB7, 0x43, 0xE5, + 0x87, 0x89, 0x43, 0xE5, 0x87, 0x8C, 0x43, 0xE5, + 0x87, 0x9C, 0x43, 0xE5, 0x87, 0x9E, 0x43, 0xE5, + // Bytes 800 - 83f + 0x87, 0xA0, 0x43, 0xE5, 0x87, 0xB5, 0x43, 0xE5, + 0x88, 0x80, 0x43, 0xE5, 0x88, 0x83, 0x43, 0xE5, + 0x88, 0x87, 0x43, 0xE5, 0x88, 0x97, 0x43, 0xE5, + 0x88, 0x9D, 0x43, 0xE5, 0x88, 0xA9, 0x43, 0xE5, + 0x88, 0xBA, 0x43, 0xE5, 0x88, 0xBB, 0x43, 0xE5, + 0x89, 0x86, 0x43, 0xE5, 0x89, 0x8D, 0x43, 0xE5, + 0x89, 0xB2, 0x43, 0xE5, 0x89, 0xB7, 0x43, 0xE5, + 0x8A, 0x89, 0x43, 0xE5, 0x8A, 0x9B, 0x43, 0xE5, + // Bytes 840 - 87f + 0x8A, 0xA3, 0x43, 0xE5, 0x8A, 0xB3, 0x43, 0xE5, + 0x8A, 0xB4, 0x43, 0xE5, 0x8B, 0x87, 0x43, 0xE5, + 0x8B, 0x89, 0x43, 0xE5, 0x8B, 0x92, 0x43, 0xE5, + 0x8B, 0x9E, 0x43, 0xE5, 0x8B, 0xA4, 0x43, 0xE5, + 0x8B, 0xB5, 0x43, 0xE5, 0x8B, 0xB9, 0x43, 0xE5, + 0x8B, 0xBA, 0x43, 0xE5, 0x8C, 0x85, 0x43, 0xE5, + 0x8C, 0x86, 0x43, 0xE5, 0x8C, 0x95, 0x43, 0xE5, + 0x8C, 0x97, 0x43, 0xE5, 0x8C, 0x9A, 0x43, 0xE5, + // Bytes 880 - 8bf + 0x8C, 0xB8, 0x43, 0xE5, 0x8C, 0xBB, 0x43, 0xE5, + 0x8C, 0xBF, 0x43, 0xE5, 0x8D, 0x81, 0x43, 0xE5, + 0x8D, 0x84, 0x43, 0xE5, 0x8D, 0x85, 0x43, 0xE5, + 0x8D, 0x89, 0x43, 0xE5, 0x8D, 0x91, 0x43, 0xE5, + 0x8D, 0x94, 0x43, 0xE5, 0x8D, 0x9A, 0x43, 0xE5, + 0x8D, 0x9C, 0x43, 0xE5, 0x8D, 0xA9, 0x43, 0xE5, + 0x8D, 0xB0, 0x43, 0xE5, 0x8D, 0xB3, 0x43, 0xE5, + 0x8D, 0xB5, 0x43, 0xE5, 0x8D, 0xBD, 0x43, 0xE5, + // Bytes 8c0 - 8ff + 0x8D, 0xBF, 0x43, 0xE5, 0x8E, 0x82, 0x43, 0xE5, + 0x8E, 0xB6, 0x43, 0xE5, 0x8F, 0x83, 0x43, 0xE5, + 0x8F, 0x88, 0x43, 0xE5, 0x8F, 0x8A, 0x43, 0xE5, + 0x8F, 0x8C, 0x43, 0xE5, 0x8F, 0x9F, 0x43, 0xE5, + 0x8F, 0xA3, 0x43, 0xE5, 0x8F, 0xA5, 0x43, 0xE5, + 0x8F, 0xAB, 0x43, 0xE5, 0x8F, 0xAF, 0x43, 0xE5, + 0x8F, 0xB1, 0x43, 0xE5, 0x8F, 0xB3, 0x43, 0xE5, + 0x90, 0x86, 0x43, 0xE5, 0x90, 0x88, 0x43, 0xE5, + // Bytes 900 - 93f + 0x90, 0x8D, 0x43, 0xE5, 0x90, 0x8F, 0x43, 0xE5, + 0x90, 0x9D, 0x43, 0xE5, 0x90, 0xB8, 0x43, 0xE5, + 0x90, 0xB9, 0x43, 0xE5, 0x91, 0x82, 0x43, 0xE5, + 0x91, 0x88, 0x43, 0xE5, 0x91, 0xA8, 0x43, 0xE5, + 0x92, 0x9E, 0x43, 0xE5, 0x92, 0xA2, 0x43, 0xE5, + 0x92, 0xBD, 0x43, 0xE5, 0x93, 0xB6, 0x43, 0xE5, + 0x94, 0x90, 0x43, 0xE5, 0x95, 0x8F, 0x43, 0xE5, + 0x95, 0x93, 0x43, 0xE5, 0x95, 0x95, 0x43, 0xE5, + // Bytes 940 - 97f + 0x95, 0xA3, 0x43, 0xE5, 0x96, 0x84, 0x43, 0xE5, + 0x96, 0x87, 0x43, 0xE5, 0x96, 0x99, 0x43, 0xE5, + 0x96, 0x9D, 0x43, 0xE5, 0x96, 0xAB, 0x43, 0xE5, + 0x96, 0xB3, 0x43, 0xE5, 0x96, 0xB6, 0x43, 0xE5, + 0x97, 0x80, 0x43, 0xE5, 0x97, 0x82, 0x43, 0xE5, + 0x97, 0xA2, 0x43, 0xE5, 0x98, 0x86, 0x43, 0xE5, + 0x99, 0x91, 0x43, 0xE5, 0x99, 0xA8, 0x43, 0xE5, + 0x99, 0xB4, 0x43, 0xE5, 0x9B, 0x97, 0x43, 0xE5, + // Bytes 980 - 9bf + 0x9B, 0x9B, 0x43, 0xE5, 0x9B, 0xB9, 0x43, 0xE5, + 0x9C, 0x96, 0x43, 0xE5, 0x9C, 0x97, 0x43, 0xE5, + 0x9C, 0x9F, 0x43, 0xE5, 0x9C, 0xB0, 0x43, 0xE5, + 0x9E, 0x8B, 0x43, 0xE5, 0x9F, 0x8E, 0x43, 0xE5, + 0x9F, 0xB4, 0x43, 0xE5, 0xA0, 0x8D, 0x43, 0xE5, + 0xA0, 0xB1, 0x43, 0xE5, 0xA0, 0xB2, 0x43, 0xE5, + 0xA1, 0x80, 0x43, 0xE5, 0xA1, 0x9A, 0x43, 0xE5, + 0xA1, 0x9E, 0x43, 0xE5, 0xA2, 0xA8, 0x43, 0xE5, + // Bytes 9c0 - 9ff + 0xA2, 0xAC, 0x43, 0xE5, 0xA2, 0xB3, 0x43, 0xE5, + 0xA3, 0x98, 0x43, 0xE5, 0xA3, 0x9F, 0x43, 0xE5, + 0xA3, 0xAB, 0x43, 0xE5, 0xA3, 0xAE, 0x43, 0xE5, + 0xA3, 0xB0, 0x43, 0xE5, 0xA3, 0xB2, 0x43, 0xE5, + 0xA3, 0xB7, 0x43, 0xE5, 0xA4, 0x82, 0x43, 0xE5, + 0xA4, 0x86, 0x43, 0xE5, 0xA4, 0x8A, 0x43, 0xE5, + 0xA4, 0x95, 0x43, 0xE5, 0xA4, 0x9A, 0x43, 0xE5, + 0xA4, 0x9C, 0x43, 0xE5, 0xA4, 0xA2, 0x43, 0xE5, + // Bytes a00 - a3f + 0xA4, 0xA7, 0x43, 0xE5, 0xA4, 0xA9, 0x43, 0xE5, + 0xA5, 0x84, 0x43, 0xE5, 0xA5, 0x88, 0x43, 0xE5, + 0xA5, 0x91, 0x43, 0xE5, 0xA5, 0x94, 0x43, 0xE5, + 0xA5, 0xA2, 0x43, 0xE5, 0xA5, 0xB3, 0x43, 0xE5, + 0xA7, 0x98, 0x43, 0xE5, 0xA7, 0xAC, 0x43, 0xE5, + 0xA8, 0x9B, 0x43, 0xE5, 0xA8, 0xA7, 0x43, 0xE5, + 0xA9, 0xA2, 0x43, 0xE5, 0xA9, 0xA6, 0x43, 0xE5, + 0xAA, 0xB5, 0x43, 0xE5, 0xAC, 0x88, 0x43, 0xE5, + // Bytes a40 - a7f + 0xAC, 0xA8, 0x43, 0xE5, 0xAC, 0xBE, 0x43, 0xE5, + 0xAD, 0x90, 0x43, 0xE5, 0xAD, 0x97, 0x43, 0xE5, + 0xAD, 0xA6, 0x43, 0xE5, 0xAE, 0x80, 0x43, 0xE5, + 0xAE, 0x85, 0x43, 0xE5, 0xAE, 0x97, 0x43, 0xE5, + 0xAF, 0x83, 0x43, 0xE5, 0xAF, 0x98, 0x43, 0xE5, + 0xAF, 0xA7, 0x43, 0xE5, 0xAF, 0xAE, 0x43, 0xE5, + 0xAF, 0xB3, 0x43, 0xE5, 0xAF, 0xB8, 0x43, 0xE5, + 0xAF, 0xBF, 0x43, 0xE5, 0xB0, 0x86, 0x43, 0xE5, + // Bytes a80 - abf + 0xB0, 0x8F, 0x43, 0xE5, 0xB0, 0xA2, 0x43, 0xE5, + 0xB0, 0xB8, 0x43, 0xE5, 0xB0, 0xBF, 0x43, 0xE5, + 0xB1, 0xA0, 0x43, 0xE5, 0xB1, 0xA2, 0x43, 0xE5, + 0xB1, 0xA4, 0x43, 0xE5, 0xB1, 0xA5, 0x43, 0xE5, + 0xB1, 0xAE, 0x43, 0xE5, 0xB1, 0xB1, 0x43, 0xE5, + 0xB2, 0x8D, 0x43, 0xE5, 0xB3, 0x80, 0x43, 0xE5, + 0xB4, 0x99, 0x43, 0xE5, 0xB5, 0x83, 0x43, 0xE5, + 0xB5, 0x90, 0x43, 0xE5, 0xB5, 0xAB, 0x43, 0xE5, + // Bytes ac0 - aff + 0xB5, 0xAE, 0x43, 0xE5, 0xB5, 0xBC, 0x43, 0xE5, + 0xB6, 0xB2, 0x43, 0xE5, 0xB6, 0xBA, 0x43, 0xE5, + 0xB7, 0x9B, 0x43, 0xE5, 0xB7, 0xA1, 0x43, 0xE5, + 0xB7, 0xA2, 0x43, 0xE5, 0xB7, 0xA5, 0x43, 0xE5, + 0xB7, 0xA6, 0x43, 0xE5, 0xB7, 0xB1, 0x43, 0xE5, + 0xB7, 0xBD, 0x43, 0xE5, 0xB7, 0xBE, 0x43, 0xE5, + 0xB8, 0xA8, 0x43, 0xE5, 0xB8, 0xBD, 0x43, 0xE5, + 0xB9, 0xA9, 0x43, 0xE5, 0xB9, 0xB2, 0x43, 0xE5, + // Bytes b00 - b3f + 0xB9, 0xB4, 0x43, 0xE5, 0xB9, 0xBA, 0x43, 0xE5, + 0xB9, 0xBC, 0x43, 0xE5, 0xB9, 0xBF, 0x43, 0xE5, + 0xBA, 0xA6, 0x43, 0xE5, 0xBA, 0xB0, 0x43, 0xE5, + 0xBA, 0xB3, 0x43, 0xE5, 0xBA, 0xB6, 0x43, 0xE5, + 0xBB, 0x89, 0x43, 0xE5, 0xBB, 0x8A, 0x43, 0xE5, + 0xBB, 0x92, 0x43, 0xE5, 0xBB, 0x93, 0x43, 0xE5, + 0xBB, 0x99, 0x43, 0xE5, 0xBB, 0xAC, 0x43, 0xE5, + 0xBB, 0xB4, 0x43, 0xE5, 0xBB, 0xBE, 0x43, 0xE5, + // Bytes b40 - b7f + 0xBC, 0x84, 0x43, 0xE5, 0xBC, 0x8B, 0x43, 0xE5, + 0xBC, 0x93, 0x43, 0xE5, 0xBC, 0xA2, 0x43, 0xE5, + 0xBD, 0x90, 0x43, 0xE5, 0xBD, 0x93, 0x43, 0xE5, + 0xBD, 0xA1, 0x43, 0xE5, 0xBD, 0xA2, 0x43, 0xE5, + 0xBD, 0xA9, 0x43, 0xE5, 0xBD, 0xAB, 0x43, 0xE5, + 0xBD, 0xB3, 0x43, 0xE5, 0xBE, 0x8B, 0x43, 0xE5, + 0xBE, 0x8C, 0x43, 0xE5, 0xBE, 0x97, 0x43, 0xE5, + 0xBE, 0x9A, 0x43, 0xE5, 0xBE, 0xA9, 0x43, 0xE5, + // Bytes b80 - bbf + 0xBE, 0xAD, 0x43, 0xE5, 0xBF, 0x83, 0x43, 0xE5, + 0xBF, 0x8D, 0x43, 0xE5, 0xBF, 0x97, 0x43, 0xE5, + 0xBF, 0xB5, 0x43, 0xE5, 0xBF, 0xB9, 0x43, 0xE6, + 0x80, 0x92, 0x43, 0xE6, 0x80, 0x9C, 0x43, 0xE6, + 0x81, 0xB5, 0x43, 0xE6, 0x82, 0x81, 0x43, 0xE6, + 0x82, 0x94, 0x43, 0xE6, 0x83, 0x87, 0x43, 0xE6, + 0x83, 0x98, 0x43, 0xE6, 0x83, 0xA1, 0x43, 0xE6, + 0x84, 0x88, 0x43, 0xE6, 0x85, 0x84, 0x43, 0xE6, + // Bytes bc0 - bff + 0x85, 0x88, 0x43, 0xE6, 0x85, 0x8C, 0x43, 0xE6, + 0x85, 0x8E, 0x43, 0xE6, 0x85, 0xA0, 0x43, 0xE6, + 0x85, 0xA8, 0x43, 0xE6, 0x85, 0xBA, 0x43, 0xE6, + 0x86, 0x8E, 0x43, 0xE6, 0x86, 0x90, 0x43, 0xE6, + 0x86, 0xA4, 0x43, 0xE6, 0x86, 0xAF, 0x43, 0xE6, + 0x86, 0xB2, 0x43, 0xE6, 0x87, 0x9E, 0x43, 0xE6, + 0x87, 0xB2, 0x43, 0xE6, 0x87, 0xB6, 0x43, 0xE6, + 0x88, 0x80, 0x43, 0xE6, 0x88, 0x88, 0x43, 0xE6, + // Bytes c00 - c3f + 0x88, 0x90, 0x43, 0xE6, 0x88, 0x9B, 0x43, 0xE6, + 0x88, 0xAE, 0x43, 0xE6, 0x88, 0xB4, 0x43, 0xE6, + 0x88, 0xB6, 0x43, 0xE6, 0x89, 0x8B, 0x43, 0xE6, + 0x89, 0x93, 0x43, 0xE6, 0x89, 0x9D, 0x43, 0xE6, + 0x8A, 0x95, 0x43, 0xE6, 0x8A, 0xB1, 0x43, 0xE6, + 0x8B, 0x89, 0x43, 0xE6, 0x8B, 0x8F, 0x43, 0xE6, + 0x8B, 0x93, 0x43, 0xE6, 0x8B, 0x94, 0x43, 0xE6, + 0x8B, 0xBC, 0x43, 0xE6, 0x8B, 0xBE, 0x43, 0xE6, + // Bytes c40 - c7f + 0x8C, 0x87, 0x43, 0xE6, 0x8C, 0xBD, 0x43, 0xE6, + 0x8D, 0x90, 0x43, 0xE6, 0x8D, 0x95, 0x43, 0xE6, + 0x8D, 0xA8, 0x43, 0xE6, 0x8D, 0xBB, 0x43, 0xE6, + 0x8E, 0x83, 0x43, 0xE6, 0x8E, 0xA0, 0x43, 0xE6, + 0x8E, 0xA9, 0x43, 0xE6, 0x8F, 0x84, 0x43, 0xE6, + 0x8F, 0x85, 0x43, 0xE6, 0x8F, 0xA4, 0x43, 0xE6, + 0x90, 0x9C, 0x43, 0xE6, 0x90, 0xA2, 0x43, 0xE6, + 0x91, 0x92, 0x43, 0xE6, 0x91, 0xA9, 0x43, 0xE6, + // Bytes c80 - cbf + 0x91, 0xB7, 0x43, 0xE6, 0x91, 0xBE, 0x43, 0xE6, + 0x92, 0x9A, 0x43, 0xE6, 0x92, 0x9D, 0x43, 0xE6, + 0x93, 0x84, 0x43, 0xE6, 0x94, 0xAF, 0x43, 0xE6, + 0x94, 0xB4, 0x43, 0xE6, 0x95, 0x8F, 0x43, 0xE6, + 0x95, 0x96, 0x43, 0xE6, 0x95, 0xAC, 0x43, 0xE6, + 0x95, 0xB8, 0x43, 0xE6, 0x96, 0x87, 0x43, 0xE6, + 0x96, 0x97, 0x43, 0xE6, 0x96, 0x99, 0x43, 0xE6, + 0x96, 0xA4, 0x43, 0xE6, 0x96, 0xB0, 0x43, 0xE6, + // Bytes cc0 - cff + 0x96, 0xB9, 0x43, 0xE6, 0x97, 0x85, 0x43, 0xE6, + 0x97, 0xA0, 0x43, 0xE6, 0x97, 0xA2, 0x43, 0xE6, + 0x97, 0xA3, 0x43, 0xE6, 0x97, 0xA5, 0x43, 0xE6, + 0x98, 0x93, 0x43, 0xE6, 0x98, 0xA0, 0x43, 0xE6, + 0x99, 0x89, 0x43, 0xE6, 0x99, 0xB4, 0x43, 0xE6, + 0x9A, 0x88, 0x43, 0xE6, 0x9A, 0x91, 0x43, 0xE6, + 0x9A, 0x9C, 0x43, 0xE6, 0x9A, 0xB4, 0x43, 0xE6, + 0x9B, 0x86, 0x43, 0xE6, 0x9B, 0xB0, 0x43, 0xE6, + // Bytes d00 - d3f + 0x9B, 0xB4, 0x43, 0xE6, 0x9B, 0xB8, 0x43, 0xE6, + 0x9C, 0x80, 0x43, 0xE6, 0x9C, 0x88, 0x43, 0xE6, + 0x9C, 0x89, 0x43, 0xE6, 0x9C, 0x97, 0x43, 0xE6, + 0x9C, 0x9B, 0x43, 0xE6, 0x9C, 0xA1, 0x43, 0xE6, + 0x9C, 0xA8, 0x43, 0xE6, 0x9D, 0x8E, 0x43, 0xE6, + 0x9D, 0x93, 0x43, 0xE6, 0x9D, 0x96, 0x43, 0xE6, + 0x9D, 0x9E, 0x43, 0xE6, 0x9D, 0xBB, 0x43, 0xE6, + 0x9E, 0x85, 0x43, 0xE6, 0x9E, 0x97, 0x43, 0xE6, + // Bytes d40 - d7f + 0x9F, 0xB3, 0x43, 0xE6, 0x9F, 0xBA, 0x43, 0xE6, + 0xA0, 0x97, 0x43, 0xE6, 0xA0, 0x9F, 0x43, 0xE6, + 0xA0, 0xAA, 0x43, 0xE6, 0xA1, 0x92, 0x43, 0xE6, + 0xA2, 0x81, 0x43, 0xE6, 0xA2, 0x85, 0x43, 0xE6, + 0xA2, 0x8E, 0x43, 0xE6, 0xA2, 0xA8, 0x43, 0xE6, + 0xA4, 0x94, 0x43, 0xE6, 0xA5, 0x82, 0x43, 0xE6, + 0xA6, 0xA3, 0x43, 0xE6, 0xA7, 0xAA, 0x43, 0xE6, + 0xA8, 0x82, 0x43, 0xE6, 0xA8, 0x93, 0x43, 0xE6, + // Bytes d80 - dbf + 0xAA, 0xA8, 0x43, 0xE6, 0xAB, 0x93, 0x43, 0xE6, + 0xAB, 0x9B, 0x43, 0xE6, 0xAC, 0x84, 0x43, 0xE6, + 0xAC, 0xA0, 0x43, 0xE6, 0xAC, 0xA1, 0x43, 0xE6, + 0xAD, 0x94, 0x43, 0xE6, 0xAD, 0xA2, 0x43, 0xE6, + 0xAD, 0xA3, 0x43, 0xE6, 0xAD, 0xB2, 0x43, 0xE6, + 0xAD, 0xB7, 0x43, 0xE6, 0xAD, 0xB9, 0x43, 0xE6, + 0xAE, 0x9F, 0x43, 0xE6, 0xAE, 0xAE, 0x43, 0xE6, + 0xAE, 0xB3, 0x43, 0xE6, 0xAE, 0xBA, 0x43, 0xE6, + // Bytes dc0 - dff + 0xAE, 0xBB, 0x43, 0xE6, 0xAF, 0x8B, 0x43, 0xE6, + 0xAF, 0x8D, 0x43, 0xE6, 0xAF, 0x94, 0x43, 0xE6, + 0xAF, 0x9B, 0x43, 0xE6, 0xB0, 0x8F, 0x43, 0xE6, + 0xB0, 0x94, 0x43, 0xE6, 0xB0, 0xB4, 0x43, 0xE6, + 0xB1, 0x8E, 0x43, 0xE6, 0xB1, 0xA7, 0x43, 0xE6, + 0xB2, 0x88, 0x43, 0xE6, 0xB2, 0xBF, 0x43, 0xE6, + 0xB3, 0x8C, 0x43, 0xE6, 0xB3, 0x8D, 0x43, 0xE6, + 0xB3, 0xA5, 0x43, 0xE6, 0xB3, 0xA8, 0x43, 0xE6, + // Bytes e00 - e3f + 0xB4, 0x96, 0x43, 0xE6, 0xB4, 0x9B, 0x43, 0xE6, + 0xB4, 0x9E, 0x43, 0xE6, 0xB4, 0xB4, 0x43, 0xE6, + 0xB4, 0xBE, 0x43, 0xE6, 0xB5, 0x81, 0x43, 0xE6, + 0xB5, 0xA9, 0x43, 0xE6, 0xB5, 0xAA, 0x43, 0xE6, + 0xB5, 0xB7, 0x43, 0xE6, 0xB5, 0xB8, 0x43, 0xE6, + 0xB6, 0x85, 0x43, 0xE6, 0xB7, 0x8B, 0x43, 0xE6, + 0xB7, 0x9A, 0x43, 0xE6, 0xB7, 0xAA, 0x43, 0xE6, + 0xB7, 0xB9, 0x43, 0xE6, 0xB8, 0x9A, 0x43, 0xE6, + // Bytes e40 - e7f + 0xB8, 0xAF, 0x43, 0xE6, 0xB9, 0xAE, 0x43, 0xE6, + 0xBA, 0x80, 0x43, 0xE6, 0xBA, 0x9C, 0x43, 0xE6, + 0xBA, 0xBA, 0x43, 0xE6, 0xBB, 0x87, 0x43, 0xE6, + 0xBB, 0x8B, 0x43, 0xE6, 0xBB, 0x91, 0x43, 0xE6, + 0xBB, 0x9B, 0x43, 0xE6, 0xBC, 0x8F, 0x43, 0xE6, + 0xBC, 0x94, 0x43, 0xE6, 0xBC, 0xA2, 0x43, 0xE6, + 0xBC, 0xA3, 0x43, 0xE6, 0xBD, 0xAE, 0x43, 0xE6, + 0xBF, 0x86, 0x43, 0xE6, 0xBF, 0xAB, 0x43, 0xE6, + // Bytes e80 - ebf + 0xBF, 0xBE, 0x43, 0xE7, 0x80, 0x9B, 0x43, 0xE7, + 0x80, 0x9E, 0x43, 0xE7, 0x80, 0xB9, 0x43, 0xE7, + 0x81, 0x8A, 0x43, 0xE7, 0x81, 0xAB, 0x43, 0xE7, + 0x81, 0xB0, 0x43, 0xE7, 0x81, 0xB7, 0x43, 0xE7, + 0x81, 0xBD, 0x43, 0xE7, 0x82, 0x99, 0x43, 0xE7, + 0x82, 0xAD, 0x43, 0xE7, 0x83, 0x88, 0x43, 0xE7, + 0x83, 0x99, 0x43, 0xE7, 0x84, 0xA1, 0x43, 0xE7, + 0x85, 0x85, 0x43, 0xE7, 0x85, 0x89, 0x43, 0xE7, + // Bytes ec0 - eff + 0x85, 0xAE, 0x43, 0xE7, 0x86, 0x9C, 0x43, 0xE7, + 0x87, 0x8E, 0x43, 0xE7, 0x87, 0x90, 0x43, 0xE7, + 0x88, 0x90, 0x43, 0xE7, 0x88, 0x9B, 0x43, 0xE7, + 0x88, 0xA8, 0x43, 0xE7, 0x88, 0xAA, 0x43, 0xE7, + 0x88, 0xAB, 0x43, 0xE7, 0x88, 0xB5, 0x43, 0xE7, + 0x88, 0xB6, 0x43, 0xE7, 0x88, 0xBB, 0x43, 0xE7, + 0x88, 0xBF, 0x43, 0xE7, 0x89, 0x87, 0x43, 0xE7, + 0x89, 0x90, 0x43, 0xE7, 0x89, 0x99, 0x43, 0xE7, + // Bytes f00 - f3f + 0x89, 0x9B, 0x43, 0xE7, 0x89, 0xA2, 0x43, 0xE7, + 0x89, 0xB9, 0x43, 0xE7, 0x8A, 0x80, 0x43, 0xE7, + 0x8A, 0x95, 0x43, 0xE7, 0x8A, 0xAC, 0x43, 0xE7, + 0x8A, 0xAF, 0x43, 0xE7, 0x8B, 0x80, 0x43, 0xE7, + 0x8B, 0xBC, 0x43, 0xE7, 0x8C, 0xAA, 0x43, 0xE7, + 0x8D, 0xB5, 0x43, 0xE7, 0x8D, 0xBA, 0x43, 0xE7, + 0x8E, 0x84, 0x43, 0xE7, 0x8E, 0x87, 0x43, 0xE7, + 0x8E, 0x89, 0x43, 0xE7, 0x8E, 0x8B, 0x43, 0xE7, + // Bytes f40 - f7f + 0x8E, 0xA5, 0x43, 0xE7, 0x8E, 0xB2, 0x43, 0xE7, + 0x8F, 0x9E, 0x43, 0xE7, 0x90, 0x86, 0x43, 0xE7, + 0x90, 0x89, 0x43, 0xE7, 0x90, 0xA2, 0x43, 0xE7, + 0x91, 0x87, 0x43, 0xE7, 0x91, 0x9C, 0x43, 0xE7, + 0x91, 0xA9, 0x43, 0xE7, 0x91, 0xB1, 0x43, 0xE7, + 0x92, 0x85, 0x43, 0xE7, 0x92, 0x89, 0x43, 0xE7, + 0x92, 0x98, 0x43, 0xE7, 0x93, 0x8A, 0x43, 0xE7, + 0x93, 0x9C, 0x43, 0xE7, 0x93, 0xA6, 0x43, 0xE7, + // Bytes f80 - fbf + 0x94, 0x86, 0x43, 0xE7, 0x94, 0x98, 0x43, 0xE7, + 0x94, 0x9F, 0x43, 0xE7, 0x94, 0xA4, 0x43, 0xE7, + 0x94, 0xA8, 0x43, 0xE7, 0x94, 0xB0, 0x43, 0xE7, + 0x94, 0xB2, 0x43, 0xE7, 0x94, 0xB3, 0x43, 0xE7, + 0x94, 0xB7, 0x43, 0xE7, 0x94, 0xBB, 0x43, 0xE7, + 0x94, 0xBE, 0x43, 0xE7, 0x95, 0x99, 0x43, 0xE7, + 0x95, 0xA5, 0x43, 0xE7, 0x95, 0xB0, 0x43, 0xE7, + 0x96, 0x8B, 0x43, 0xE7, 0x96, 0x92, 0x43, 0xE7, + // Bytes fc0 - fff + 0x97, 0xA2, 0x43, 0xE7, 0x98, 0x90, 0x43, 0xE7, + 0x98, 0x9D, 0x43, 0xE7, 0x98, 0x9F, 0x43, 0xE7, + 0x99, 0x82, 0x43, 0xE7, 0x99, 0xA9, 0x43, 0xE7, + 0x99, 0xB6, 0x43, 0xE7, 0x99, 0xBD, 0x43, 0xE7, + 0x9A, 0xAE, 0x43, 0xE7, 0x9A, 0xBF, 0x43, 0xE7, + 0x9B, 0x8A, 0x43, 0xE7, 0x9B, 0x9B, 0x43, 0xE7, + 0x9B, 0xA3, 0x43, 0xE7, 0x9B, 0xA7, 0x43, 0xE7, + 0x9B, 0xAE, 0x43, 0xE7, 0x9B, 0xB4, 0x43, 0xE7, + // Bytes 1000 - 103f + 0x9C, 0x81, 0x43, 0xE7, 0x9C, 0x9E, 0x43, 0xE7, + 0x9C, 0x9F, 0x43, 0xE7, 0x9D, 0x80, 0x43, 0xE7, + 0x9D, 0x8A, 0x43, 0xE7, 0x9E, 0x8B, 0x43, 0xE7, + 0x9E, 0xA7, 0x43, 0xE7, 0x9F, 0x9B, 0x43, 0xE7, + 0x9F, 0xA2, 0x43, 0xE7, 0x9F, 0xB3, 0x43, 0xE7, + 0xA1, 0x8E, 0x43, 0xE7, 0xA1, 0xAB, 0x43, 0xE7, + 0xA2, 0x8C, 0x43, 0xE7, 0xA2, 0x91, 0x43, 0xE7, + 0xA3, 0x8A, 0x43, 0xE7, 0xA3, 0x8C, 0x43, 0xE7, + // Bytes 1040 - 107f + 0xA3, 0xBB, 0x43, 0xE7, 0xA4, 0xAA, 0x43, 0xE7, + 0xA4, 0xBA, 0x43, 0xE7, 0xA4, 0xBC, 0x43, 0xE7, + 0xA4, 0xBE, 0x43, 0xE7, 0xA5, 0x88, 0x43, 0xE7, + 0xA5, 0x89, 0x43, 0xE7, 0xA5, 0x90, 0x43, 0xE7, + 0xA5, 0x96, 0x43, 0xE7, 0xA5, 0x9D, 0x43, 0xE7, + 0xA5, 0x9E, 0x43, 0xE7, 0xA5, 0xA5, 0x43, 0xE7, + 0xA5, 0xBF, 0x43, 0xE7, 0xA6, 0x81, 0x43, 0xE7, + 0xA6, 0x8D, 0x43, 0xE7, 0xA6, 0x8E, 0x43, 0xE7, + // Bytes 1080 - 10bf + 0xA6, 0x8F, 0x43, 0xE7, 0xA6, 0xAE, 0x43, 0xE7, + 0xA6, 0xB8, 0x43, 0xE7, 0xA6, 0xBE, 0x43, 0xE7, + 0xA7, 0x8A, 0x43, 0xE7, 0xA7, 0x98, 0x43, 0xE7, + 0xA7, 0xAB, 0x43, 0xE7, 0xA8, 0x9C, 0x43, 0xE7, + 0xA9, 0x80, 0x43, 0xE7, 0xA9, 0x8A, 0x43, 0xE7, + 0xA9, 0x8F, 0x43, 0xE7, 0xA9, 0xB4, 0x43, 0xE7, + 0xA9, 0xBA, 0x43, 0xE7, 0xAA, 0x81, 0x43, 0xE7, + 0xAA, 0xB1, 0x43, 0xE7, 0xAB, 0x8B, 0x43, 0xE7, + // Bytes 10c0 - 10ff + 0xAB, 0xAE, 0x43, 0xE7, 0xAB, 0xB9, 0x43, 0xE7, + 0xAC, 0xA0, 0x43, 0xE7, 0xAE, 0x8F, 0x43, 0xE7, + 0xAF, 0x80, 0x43, 0xE7, 0xAF, 0x86, 0x43, 0xE7, + 0xAF, 0x89, 0x43, 0xE7, 0xB0, 0xBE, 0x43, 0xE7, + 0xB1, 0xA0, 0x43, 0xE7, 0xB1, 0xB3, 0x43, 0xE7, + 0xB1, 0xBB, 0x43, 0xE7, 0xB2, 0x92, 0x43, 0xE7, + 0xB2, 0xBE, 0x43, 0xE7, 0xB3, 0x92, 0x43, 0xE7, + 0xB3, 0x96, 0x43, 0xE7, 0xB3, 0xA3, 0x43, 0xE7, + // Bytes 1100 - 113f + 0xB3, 0xA7, 0x43, 0xE7, 0xB3, 0xA8, 0x43, 0xE7, + 0xB3, 0xB8, 0x43, 0xE7, 0xB4, 0x80, 0x43, 0xE7, + 0xB4, 0x90, 0x43, 0xE7, 0xB4, 0xA2, 0x43, 0xE7, + 0xB4, 0xAF, 0x43, 0xE7, 0xB5, 0x82, 0x43, 0xE7, + 0xB5, 0x9B, 0x43, 0xE7, 0xB5, 0xA3, 0x43, 0xE7, + 0xB6, 0xA0, 0x43, 0xE7, 0xB6, 0xBE, 0x43, 0xE7, + 0xB7, 0x87, 0x43, 0xE7, 0xB7, 0xB4, 0x43, 0xE7, + 0xB8, 0x82, 0x43, 0xE7, 0xB8, 0x89, 0x43, 0xE7, + // Bytes 1140 - 117f + 0xB8, 0xB7, 0x43, 0xE7, 0xB9, 0x81, 0x43, 0xE7, + 0xB9, 0x85, 0x43, 0xE7, 0xBC, 0xB6, 0x43, 0xE7, + 0xBC, 0xBE, 0x43, 0xE7, 0xBD, 0x91, 0x43, 0xE7, + 0xBD, 0xB2, 0x43, 0xE7, 0xBD, 0xB9, 0x43, 0xE7, + 0xBD, 0xBA, 0x43, 0xE7, 0xBE, 0x85, 0x43, 0xE7, + 0xBE, 0x8A, 0x43, 0xE7, 0xBE, 0x95, 0x43, 0xE7, + 0xBE, 0x9A, 0x43, 0xE7, 0xBE, 0xBD, 0x43, 0xE7, + 0xBF, 0xBA, 0x43, 0xE8, 0x80, 0x81, 0x43, 0xE8, + // Bytes 1180 - 11bf + 0x80, 0x85, 0x43, 0xE8, 0x80, 0x8C, 0x43, 0xE8, + 0x80, 0x92, 0x43, 0xE8, 0x80, 0xB3, 0x43, 0xE8, + 0x81, 0x86, 0x43, 0xE8, 0x81, 0xA0, 0x43, 0xE8, + 0x81, 0xAF, 0x43, 0xE8, 0x81, 0xB0, 0x43, 0xE8, + 0x81, 0xBE, 0x43, 0xE8, 0x81, 0xBF, 0x43, 0xE8, + 0x82, 0x89, 0x43, 0xE8, 0x82, 0x8B, 0x43, 0xE8, + 0x82, 0xAD, 0x43, 0xE8, 0x82, 0xB2, 0x43, 0xE8, + 0x84, 0x83, 0x43, 0xE8, 0x84, 0xBE, 0x43, 0xE8, + // Bytes 11c0 - 11ff + 0x87, 0x98, 0x43, 0xE8, 0x87, 0xA3, 0x43, 0xE8, + 0x87, 0xA8, 0x43, 0xE8, 0x87, 0xAA, 0x43, 0xE8, + 0x87, 0xAD, 0x43, 0xE8, 0x87, 0xB3, 0x43, 0xE8, + 0x87, 0xBC, 0x43, 0xE8, 0x88, 0x81, 0x43, 0xE8, + 0x88, 0x84, 0x43, 0xE8, 0x88, 0x8C, 0x43, 0xE8, + 0x88, 0x98, 0x43, 0xE8, 0x88, 0x9B, 0x43, 0xE8, + 0x88, 0x9F, 0x43, 0xE8, 0x89, 0xAE, 0x43, 0xE8, + 0x89, 0xAF, 0x43, 0xE8, 0x89, 0xB2, 0x43, 0xE8, + // Bytes 1200 - 123f + 0x89, 0xB8, 0x43, 0xE8, 0x89, 0xB9, 0x43, 0xE8, + 0x8A, 0x8B, 0x43, 0xE8, 0x8A, 0x91, 0x43, 0xE8, + 0x8A, 0x9D, 0x43, 0xE8, 0x8A, 0xB1, 0x43, 0xE8, + 0x8A, 0xB3, 0x43, 0xE8, 0x8A, 0xBD, 0x43, 0xE8, + 0x8B, 0xA5, 0x43, 0xE8, 0x8B, 0xA6, 0x43, 0xE8, + 0x8C, 0x9D, 0x43, 0xE8, 0x8C, 0xA3, 0x43, 0xE8, + 0x8C, 0xB6, 0x43, 0xE8, 0x8D, 0x92, 0x43, 0xE8, + 0x8D, 0x93, 0x43, 0xE8, 0x8D, 0xA3, 0x43, 0xE8, + // Bytes 1240 - 127f + 0x8E, 0xAD, 0x43, 0xE8, 0x8E, 0xBD, 0x43, 0xE8, + 0x8F, 0x89, 0x43, 0xE8, 0x8F, 0x8A, 0x43, 0xE8, + 0x8F, 0x8C, 0x43, 0xE8, 0x8F, 0x9C, 0x43, 0xE8, + 0x8F, 0xA7, 0x43, 0xE8, 0x8F, 0xAF, 0x43, 0xE8, + 0x8F, 0xB1, 0x43, 0xE8, 0x90, 0xBD, 0x43, 0xE8, + 0x91, 0x89, 0x43, 0xE8, 0x91, 0x97, 0x43, 0xE8, + 0x93, 0xAE, 0x43, 0xE8, 0x93, 0xB1, 0x43, 0xE8, + 0x93, 0xB3, 0x43, 0xE8, 0x93, 0xBC, 0x43, 0xE8, + // Bytes 1280 - 12bf + 0x94, 0x96, 0x43, 0xE8, 0x95, 0xA4, 0x43, 0xE8, + 0x97, 0x8D, 0x43, 0xE8, 0x97, 0xBA, 0x43, 0xE8, + 0x98, 0x86, 0x43, 0xE8, 0x98, 0x92, 0x43, 0xE8, + 0x98, 0xAD, 0x43, 0xE8, 0x98, 0xBF, 0x43, 0xE8, + 0x99, 0x8D, 0x43, 0xE8, 0x99, 0x90, 0x43, 0xE8, + 0x99, 0x9C, 0x43, 0xE8, 0x99, 0xA7, 0x43, 0xE8, + 0x99, 0xA9, 0x43, 0xE8, 0x99, 0xAB, 0x43, 0xE8, + 0x9A, 0x88, 0x43, 0xE8, 0x9A, 0xA9, 0x43, 0xE8, + // Bytes 12c0 - 12ff + 0x9B, 0xA2, 0x43, 0xE8, 0x9C, 0x8E, 0x43, 0xE8, + 0x9C, 0xA8, 0x43, 0xE8, 0x9D, 0xAB, 0x43, 0xE8, + 0x9D, 0xB9, 0x43, 0xE8, 0x9E, 0x86, 0x43, 0xE8, + 0x9E, 0xBA, 0x43, 0xE8, 0x9F, 0xA1, 0x43, 0xE8, + 0xA0, 0x81, 0x43, 0xE8, 0xA0, 0x9F, 0x43, 0xE8, + 0xA1, 0x80, 0x43, 0xE8, 0xA1, 0x8C, 0x43, 0xE8, + 0xA1, 0xA0, 0x43, 0xE8, 0xA1, 0xA3, 0x43, 0xE8, + 0xA3, 0x82, 0x43, 0xE8, 0xA3, 0x8F, 0x43, 0xE8, + // Bytes 1300 - 133f + 0xA3, 0x97, 0x43, 0xE8, 0xA3, 0x9E, 0x43, 0xE8, + 0xA3, 0xA1, 0x43, 0xE8, 0xA3, 0xB8, 0x43, 0xE8, + 0xA3, 0xBA, 0x43, 0xE8, 0xA4, 0x90, 0x43, 0xE8, + 0xA5, 0x81, 0x43, 0xE8, 0xA5, 0xA4, 0x43, 0xE8, + 0xA5, 0xBE, 0x43, 0xE8, 0xA6, 0x86, 0x43, 0xE8, + 0xA6, 0x8B, 0x43, 0xE8, 0xA6, 0x96, 0x43, 0xE8, + 0xA7, 0x92, 0x43, 0xE8, 0xA7, 0xA3, 0x43, 0xE8, + 0xA8, 0x80, 0x43, 0xE8, 0xAA, 0xA0, 0x43, 0xE8, + // Bytes 1340 - 137f + 0xAA, 0xAA, 0x43, 0xE8, 0xAA, 0xBF, 0x43, 0xE8, + 0xAB, 0x8B, 0x43, 0xE8, 0xAB, 0x92, 0x43, 0xE8, + 0xAB, 0x96, 0x43, 0xE8, 0xAB, 0xAD, 0x43, 0xE8, + 0xAB, 0xB8, 0x43, 0xE8, 0xAB, 0xBE, 0x43, 0xE8, + 0xAC, 0x81, 0x43, 0xE8, 0xAC, 0xB9, 0x43, 0xE8, + 0xAD, 0x98, 0x43, 0xE8, 0xAE, 0x80, 0x43, 0xE8, + 0xAE, 0x8A, 0x43, 0xE8, 0xB0, 0xB7, 0x43, 0xE8, + 0xB1, 0x86, 0x43, 0xE8, 0xB1, 0x88, 0x43, 0xE8, + // Bytes 1380 - 13bf + 0xB1, 0x95, 0x43, 0xE8, 0xB1, 0xB8, 0x43, 0xE8, + 0xB2, 0x9D, 0x43, 0xE8, 0xB2, 0xA1, 0x43, 0xE8, + 0xB2, 0xA9, 0x43, 0xE8, 0xB2, 0xAB, 0x43, 0xE8, + 0xB3, 0x81, 0x43, 0xE8, 0xB3, 0x82, 0x43, 0xE8, + 0xB3, 0x87, 0x43, 0xE8, 0xB3, 0x88, 0x43, 0xE8, + 0xB3, 0x93, 0x43, 0xE8, 0xB4, 0x88, 0x43, 0xE8, + 0xB4, 0x9B, 0x43, 0xE8, 0xB5, 0xA4, 0x43, 0xE8, + 0xB5, 0xB0, 0x43, 0xE8, 0xB5, 0xB7, 0x43, 0xE8, + // Bytes 13c0 - 13ff + 0xB6, 0xB3, 0x43, 0xE8, 0xB6, 0xBC, 0x43, 0xE8, + 0xB7, 0x8B, 0x43, 0xE8, 0xB7, 0xAF, 0x43, 0xE8, + 0xB7, 0xB0, 0x43, 0xE8, 0xBA, 0xAB, 0x43, 0xE8, + 0xBB, 0x8A, 0x43, 0xE8, 0xBB, 0x94, 0x43, 0xE8, + 0xBC, 0xA6, 0x43, 0xE8, 0xBC, 0xAA, 0x43, 0xE8, + 0xBC, 0xB8, 0x43, 0xE8, 0xBC, 0xBB, 0x43, 0xE8, + 0xBD, 0xA2, 0x43, 0xE8, 0xBE, 0x9B, 0x43, 0xE8, + 0xBE, 0x9E, 0x43, 0xE8, 0xBE, 0xB0, 0x43, 0xE8, + // Bytes 1400 - 143f + 0xBE, 0xB5, 0x43, 0xE8, 0xBE, 0xB6, 0x43, 0xE9, + 0x80, 0xA3, 0x43, 0xE9, 0x80, 0xB8, 0x43, 0xE9, + 0x81, 0x8A, 0x43, 0xE9, 0x81, 0xA9, 0x43, 0xE9, + 0x81, 0xB2, 0x43, 0xE9, 0x81, 0xBC, 0x43, 0xE9, + 0x82, 0x8F, 0x43, 0xE9, 0x82, 0x91, 0x43, 0xE9, + 0x82, 0x94, 0x43, 0xE9, 0x83, 0x8E, 0x43, 0xE9, + 0x83, 0x9E, 0x43, 0xE9, 0x83, 0xB1, 0x43, 0xE9, + 0x83, 0xBD, 0x43, 0xE9, 0x84, 0x91, 0x43, 0xE9, + // Bytes 1440 - 147f + 0x84, 0x9B, 0x43, 0xE9, 0x85, 0x89, 0x43, 0xE9, + 0x85, 0x8D, 0x43, 0xE9, 0x85, 0xAA, 0x43, 0xE9, + 0x86, 0x99, 0x43, 0xE9, 0x86, 0xB4, 0x43, 0xE9, + 0x87, 0x86, 0x43, 0xE9, 0x87, 0x8C, 0x43, 0xE9, + 0x87, 0x8F, 0x43, 0xE9, 0x87, 0x91, 0x43, 0xE9, + 0x88, 0xB4, 0x43, 0xE9, 0x88, 0xB8, 0x43, 0xE9, + 0x89, 0xB6, 0x43, 0xE9, 0x89, 0xBC, 0x43, 0xE9, + 0x8B, 0x97, 0x43, 0xE9, 0x8B, 0x98, 0x43, 0xE9, + // Bytes 1480 - 14bf + 0x8C, 0x84, 0x43, 0xE9, 0x8D, 0x8A, 0x43, 0xE9, + 0x8F, 0xB9, 0x43, 0xE9, 0x90, 0x95, 0x43, 0xE9, + 0x95, 0xB7, 0x43, 0xE9, 0x96, 0x80, 0x43, 0xE9, + 0x96, 0x8B, 0x43, 0xE9, 0x96, 0xAD, 0x43, 0xE9, + 0x96, 0xB7, 0x43, 0xE9, 0x98, 0x9C, 0x43, 0xE9, + 0x98, 0xAE, 0x43, 0xE9, 0x99, 0x8B, 0x43, 0xE9, + 0x99, 0x8D, 0x43, 0xE9, 0x99, 0xB5, 0x43, 0xE9, + 0x99, 0xB8, 0x43, 0xE9, 0x99, 0xBC, 0x43, 0xE9, + // Bytes 14c0 - 14ff + 0x9A, 0x86, 0x43, 0xE9, 0x9A, 0xA3, 0x43, 0xE9, + 0x9A, 0xB6, 0x43, 0xE9, 0x9A, 0xB7, 0x43, 0xE9, + 0x9A, 0xB8, 0x43, 0xE9, 0x9A, 0xB9, 0x43, 0xE9, + 0x9B, 0x83, 0x43, 0xE9, 0x9B, 0xA2, 0x43, 0xE9, + 0x9B, 0xA3, 0x43, 0xE9, 0x9B, 0xA8, 0x43, 0xE9, + 0x9B, 0xB6, 0x43, 0xE9, 0x9B, 0xB7, 0x43, 0xE9, + 0x9C, 0xA3, 0x43, 0xE9, 0x9C, 0xB2, 0x43, 0xE9, + 0x9D, 0x88, 0x43, 0xE9, 0x9D, 0x91, 0x43, 0xE9, + // Bytes 1500 - 153f + 0x9D, 0x96, 0x43, 0xE9, 0x9D, 0x9E, 0x43, 0xE9, + 0x9D, 0xA2, 0x43, 0xE9, 0x9D, 0xA9, 0x43, 0xE9, + 0x9F, 0x8B, 0x43, 0xE9, 0x9F, 0x9B, 0x43, 0xE9, + 0x9F, 0xA0, 0x43, 0xE9, 0x9F, 0xAD, 0x43, 0xE9, + 0x9F, 0xB3, 0x43, 0xE9, 0x9F, 0xBF, 0x43, 0xE9, + 0xA0, 0x81, 0x43, 0xE9, 0xA0, 0x85, 0x43, 0xE9, + 0xA0, 0x8B, 0x43, 0xE9, 0xA0, 0x98, 0x43, 0xE9, + 0xA0, 0xA9, 0x43, 0xE9, 0xA0, 0xBB, 0x43, 0xE9, + // Bytes 1540 - 157f + 0xA1, 0x9E, 0x43, 0xE9, 0xA2, 0xA8, 0x43, 0xE9, + 0xA3, 0x9B, 0x43, 0xE9, 0xA3, 0x9F, 0x43, 0xE9, + 0xA3, 0xA2, 0x43, 0xE9, 0xA3, 0xAF, 0x43, 0xE9, + 0xA3, 0xBC, 0x43, 0xE9, 0xA4, 0xA8, 0x43, 0xE9, + 0xA4, 0xA9, 0x43, 0xE9, 0xA6, 0x96, 0x43, 0xE9, + 0xA6, 0x99, 0x43, 0xE9, 0xA6, 0xA7, 0x43, 0xE9, + 0xA6, 0xAC, 0x43, 0xE9, 0xA7, 0x82, 0x43, 0xE9, + 0xA7, 0xB1, 0x43, 0xE9, 0xA7, 0xBE, 0x43, 0xE9, + // Bytes 1580 - 15bf + 0xA9, 0xAA, 0x43, 0xE9, 0xAA, 0xA8, 0x43, 0xE9, + 0xAB, 0x98, 0x43, 0xE9, 0xAB, 0x9F, 0x43, 0xE9, + 0xAC, 0x92, 0x43, 0xE9, 0xAC, 0xA5, 0x43, 0xE9, + 0xAC, 0xAF, 0x43, 0xE9, 0xAC, 0xB2, 0x43, 0xE9, + 0xAC, 0xBC, 0x43, 0xE9, 0xAD, 0x9A, 0x43, 0xE9, + 0xAD, 0xAF, 0x43, 0xE9, 0xB1, 0x80, 0x43, 0xE9, + 0xB1, 0x97, 0x43, 0xE9, 0xB3, 0xA5, 0x43, 0xE9, + 0xB3, 0xBD, 0x43, 0xE9, 0xB5, 0xA7, 0x43, 0xE9, + // Bytes 15c0 - 15ff + 0xB6, 0xB4, 0x43, 0xE9, 0xB7, 0xBA, 0x43, 0xE9, + 0xB8, 0x9E, 0x43, 0xE9, 0xB9, 0xB5, 0x43, 0xE9, + 0xB9, 0xBF, 0x43, 0xE9, 0xBA, 0x97, 0x43, 0xE9, + 0xBA, 0x9F, 0x43, 0xE9, 0xBA, 0xA5, 0x43, 0xE9, + 0xBA, 0xBB, 0x43, 0xE9, 0xBB, 0x83, 0x43, 0xE9, + 0xBB, 0x8D, 0x43, 0xE9, 0xBB, 0x8E, 0x43, 0xE9, + 0xBB, 0x91, 0x43, 0xE9, 0xBB, 0xB9, 0x43, 0xE9, + 0xBB, 0xBD, 0x43, 0xE9, 0xBB, 0xBE, 0x43, 0xE9, + // Bytes 1600 - 163f + 0xBC, 0x85, 0x43, 0xE9, 0xBC, 0x8E, 0x43, 0xE9, + 0xBC, 0x8F, 0x43, 0xE9, 0xBC, 0x93, 0x43, 0xE9, + 0xBC, 0x96, 0x43, 0xE9, 0xBC, 0xA0, 0x43, 0xE9, + 0xBC, 0xBB, 0x43, 0xE9, 0xBD, 0x83, 0x43, 0xE9, + 0xBD, 0x8A, 0x43, 0xE9, 0xBD, 0x92, 0x43, 0xE9, + 0xBE, 0x8D, 0x43, 0xE9, 0xBE, 0x8E, 0x43, 0xE9, + 0xBE, 0x9C, 0x43, 0xE9, 0xBE, 0x9F, 0x43, 0xE9, + 0xBE, 0xA0, 0x43, 0xEA, 0x9C, 0xA7, 0x43, 0xEA, + // Bytes 1640 - 167f + 0x9D, 0xAF, 0x43, 0xEA, 0xAC, 0xB7, 0x43, 0xEA, + 0xAD, 0x92, 0x44, 0xF0, 0xA0, 0x84, 0xA2, 0x44, + 0xF0, 0xA0, 0x94, 0x9C, 0x44, 0xF0, 0xA0, 0x94, + 0xA5, 0x44, 0xF0, 0xA0, 0x95, 0x8B, 0x44, 0xF0, + 0xA0, 0x98, 0xBA, 0x44, 0xF0, 0xA0, 0xA0, 0x84, + 0x44, 0xF0, 0xA0, 0xA3, 0x9E, 0x44, 0xF0, 0xA0, + 0xA8, 0xAC, 0x44, 0xF0, 0xA0, 0xAD, 0xA3, 0x44, + 0xF0, 0xA1, 0x93, 0xA4, 0x44, 0xF0, 0xA1, 0x9A, + // Bytes 1680 - 16bf + 0xA8, 0x44, 0xF0, 0xA1, 0x9B, 0xAA, 0x44, 0xF0, + 0xA1, 0xA7, 0x88, 0x44, 0xF0, 0xA1, 0xAC, 0x98, + 0x44, 0xF0, 0xA1, 0xB4, 0x8B, 0x44, 0xF0, 0xA1, + 0xB7, 0xA4, 0x44, 0xF0, 0xA1, 0xB7, 0xA6, 0x44, + 0xF0, 0xA2, 0x86, 0x83, 0x44, 0xF0, 0xA2, 0x86, + 0x9F, 0x44, 0xF0, 0xA2, 0x8C, 0xB1, 0x44, 0xF0, + 0xA2, 0x9B, 0x94, 0x44, 0xF0, 0xA2, 0xA1, 0x84, + 0x44, 0xF0, 0xA2, 0xA1, 0x8A, 0x44, 0xF0, 0xA2, + // Bytes 16c0 - 16ff + 0xAC, 0x8C, 0x44, 0xF0, 0xA2, 0xAF, 0xB1, 0x44, + 0xF0, 0xA3, 0x80, 0x8A, 0x44, 0xF0, 0xA3, 0x8A, + 0xB8, 0x44, 0xF0, 0xA3, 0x8D, 0x9F, 0x44, 0xF0, + 0xA3, 0x8E, 0x93, 0x44, 0xF0, 0xA3, 0x8E, 0x9C, + 0x44, 0xF0, 0xA3, 0x8F, 0x83, 0x44, 0xF0, 0xA3, + 0x8F, 0x95, 0x44, 0xF0, 0xA3, 0x91, 0xAD, 0x44, + 0xF0, 0xA3, 0x9A, 0xA3, 0x44, 0xF0, 0xA3, 0xA2, + 0xA7, 0x44, 0xF0, 0xA3, 0xAA, 0x8D, 0x44, 0xF0, + // Bytes 1700 - 173f + 0xA3, 0xAB, 0xBA, 0x44, 0xF0, 0xA3, 0xB2, 0xBC, + 0x44, 0xF0, 0xA3, 0xB4, 0x9E, 0x44, 0xF0, 0xA3, + 0xBB, 0x91, 0x44, 0xF0, 0xA3, 0xBD, 0x9E, 0x44, + 0xF0, 0xA3, 0xBE, 0x8E, 0x44, 0xF0, 0xA4, 0x89, + 0xA3, 0x44, 0xF0, 0xA4, 0x8B, 0xAE, 0x44, 0xF0, + 0xA4, 0x8E, 0xAB, 0x44, 0xF0, 0xA4, 0x98, 0x88, + 0x44, 0xF0, 0xA4, 0x9C, 0xB5, 0x44, 0xF0, 0xA4, + 0xA0, 0x94, 0x44, 0xF0, 0xA4, 0xB0, 0xB6, 0x44, + // Bytes 1740 - 177f + 0xF0, 0xA4, 0xB2, 0x92, 0x44, 0xF0, 0xA4, 0xBE, + 0xA1, 0x44, 0xF0, 0xA4, 0xBE, 0xB8, 0x44, 0xF0, + 0xA5, 0x81, 0x84, 0x44, 0xF0, 0xA5, 0x83, 0xB2, + 0x44, 0xF0, 0xA5, 0x83, 0xB3, 0x44, 0xF0, 0xA5, + 0x84, 0x99, 0x44, 0xF0, 0xA5, 0x84, 0xB3, 0x44, + 0xF0, 0xA5, 0x89, 0x89, 0x44, 0xF0, 0xA5, 0x90, + 0x9D, 0x44, 0xF0, 0xA5, 0x98, 0xA6, 0x44, 0xF0, + 0xA5, 0x9A, 0x9A, 0x44, 0xF0, 0xA5, 0x9B, 0x85, + // Bytes 1780 - 17bf + 0x44, 0xF0, 0xA5, 0xA5, 0xBC, 0x44, 0xF0, 0xA5, + 0xAA, 0xA7, 0x44, 0xF0, 0xA5, 0xAE, 0xAB, 0x44, + 0xF0, 0xA5, 0xB2, 0x80, 0x44, 0xF0, 0xA5, 0xB3, + 0x90, 0x44, 0xF0, 0xA5, 0xBE, 0x86, 0x44, 0xF0, + 0xA6, 0x87, 0x9A, 0x44, 0xF0, 0xA6, 0x88, 0xA8, + 0x44, 0xF0, 0xA6, 0x89, 0x87, 0x44, 0xF0, 0xA6, + 0x8B, 0x99, 0x44, 0xF0, 0xA6, 0x8C, 0xBE, 0x44, + 0xF0, 0xA6, 0x93, 0x9A, 0x44, 0xF0, 0xA6, 0x94, + // Bytes 17c0 - 17ff + 0xA3, 0x44, 0xF0, 0xA6, 0x96, 0xA8, 0x44, 0xF0, + 0xA6, 0x9E, 0xA7, 0x44, 0xF0, 0xA6, 0x9E, 0xB5, + 0x44, 0xF0, 0xA6, 0xAC, 0xBC, 0x44, 0xF0, 0xA6, + 0xB0, 0xB6, 0x44, 0xF0, 0xA6, 0xB3, 0x95, 0x44, + 0xF0, 0xA6, 0xB5, 0xAB, 0x44, 0xF0, 0xA6, 0xBC, + 0xAC, 0x44, 0xF0, 0xA6, 0xBE, 0xB1, 0x44, 0xF0, + 0xA7, 0x83, 0x92, 0x44, 0xF0, 0xA7, 0x8F, 0x8A, + 0x44, 0xF0, 0xA7, 0x99, 0xA7, 0x44, 0xF0, 0xA7, + // Bytes 1800 - 183f + 0xA2, 0xAE, 0x44, 0xF0, 0xA7, 0xA5, 0xA6, 0x44, + 0xF0, 0xA7, 0xB2, 0xA8, 0x44, 0xF0, 0xA7, 0xBB, + 0x93, 0x44, 0xF0, 0xA7, 0xBC, 0xAF, 0x44, 0xF0, + 0xA8, 0x97, 0x92, 0x44, 0xF0, 0xA8, 0x97, 0xAD, + 0x44, 0xF0, 0xA8, 0x9C, 0xAE, 0x44, 0xF0, 0xA8, + 0xAF, 0xBA, 0x44, 0xF0, 0xA8, 0xB5, 0xB7, 0x44, + 0xF0, 0xA9, 0x85, 0x85, 0x44, 0xF0, 0xA9, 0x87, + 0x9F, 0x44, 0xF0, 0xA9, 0x88, 0x9A, 0x44, 0xF0, + // Bytes 1840 - 187f + 0xA9, 0x90, 0x8A, 0x44, 0xF0, 0xA9, 0x92, 0x96, + 0x44, 0xF0, 0xA9, 0x96, 0xB6, 0x44, 0xF0, 0xA9, + 0xAC, 0xB0, 0x44, 0xF0, 0xAA, 0x83, 0x8E, 0x44, + 0xF0, 0xAA, 0x84, 0x85, 0x44, 0xF0, 0xAA, 0x88, + 0x8E, 0x44, 0xF0, 0xAA, 0x8A, 0x91, 0x44, 0xF0, + 0xAA, 0x8E, 0x92, 0x44, 0xF0, 0xAA, 0x98, 0x80, + 0x42, 0x21, 0x21, 0x42, 0x21, 0x3F, 0x42, 0x2E, + 0x2E, 0x42, 0x30, 0x2C, 0x42, 0x30, 0x2E, 0x42, + // Bytes 1880 - 18bf + 0x31, 0x2C, 0x42, 0x31, 0x2E, 0x42, 0x31, 0x30, + 0x42, 0x31, 0x31, 0x42, 0x31, 0x32, 0x42, 0x31, + 0x33, 0x42, 0x31, 0x34, 0x42, 0x31, 0x35, 0x42, + 0x31, 0x36, 0x42, 0x31, 0x37, 0x42, 0x31, 0x38, + 0x42, 0x31, 0x39, 0x42, 0x32, 0x2C, 0x42, 0x32, + 0x2E, 0x42, 0x32, 0x30, 0x42, 0x32, 0x31, 0x42, + 0x32, 0x32, 0x42, 0x32, 0x33, 0x42, 0x32, 0x34, + 0x42, 0x32, 0x35, 0x42, 0x32, 0x36, 0x42, 0x32, + // Bytes 18c0 - 18ff + 0x37, 0x42, 0x32, 0x38, 0x42, 0x32, 0x39, 0x42, + 0x33, 0x2C, 0x42, 0x33, 0x2E, 0x42, 0x33, 0x30, + 0x42, 0x33, 0x31, 0x42, 0x33, 0x32, 0x42, 0x33, + 0x33, 0x42, 0x33, 0x34, 0x42, 0x33, 0x35, 0x42, + 0x33, 0x36, 0x42, 0x33, 0x37, 0x42, 0x33, 0x38, + 0x42, 0x33, 0x39, 0x42, 0x34, 0x2C, 0x42, 0x34, + 0x2E, 0x42, 0x34, 0x30, 0x42, 0x34, 0x31, 0x42, + 0x34, 0x32, 0x42, 0x34, 0x33, 0x42, 0x34, 0x34, + // Bytes 1900 - 193f + 0x42, 0x34, 0x35, 0x42, 0x34, 0x36, 0x42, 0x34, + 0x37, 0x42, 0x34, 0x38, 0x42, 0x34, 0x39, 0x42, + 0x35, 0x2C, 0x42, 0x35, 0x2E, 0x42, 0x35, 0x30, + 0x42, 0x36, 0x2C, 0x42, 0x36, 0x2E, 0x42, 0x37, + 0x2C, 0x42, 0x37, 0x2E, 0x42, 0x38, 0x2C, 0x42, + 0x38, 0x2E, 0x42, 0x39, 0x2C, 0x42, 0x39, 0x2E, + 0x42, 0x3D, 0x3D, 0x42, 0x3F, 0x21, 0x42, 0x3F, + 0x3F, 0x42, 0x41, 0x55, 0x42, 0x42, 0x71, 0x42, + // Bytes 1940 - 197f + 0x43, 0x44, 0x42, 0x44, 0x4A, 0x42, 0x44, 0x5A, + 0x42, 0x44, 0x7A, 0x42, 0x47, 0x42, 0x42, 0x47, + 0x79, 0x42, 0x48, 0x50, 0x42, 0x48, 0x56, 0x42, + 0x48, 0x67, 0x42, 0x48, 0x7A, 0x42, 0x49, 0x49, + 0x42, 0x49, 0x4A, 0x42, 0x49, 0x55, 0x42, 0x49, + 0x56, 0x42, 0x49, 0x58, 0x42, 0x4B, 0x42, 0x42, + 0x4B, 0x4B, 0x42, 0x4B, 0x4D, 0x42, 0x4C, 0x4A, + 0x42, 0x4C, 0x6A, 0x42, 0x4D, 0x42, 0x42, 0x4D, + // Bytes 1980 - 19bf + 0x43, 0x42, 0x4D, 0x44, 0x42, 0x4D, 0x52, 0x42, + 0x4D, 0x56, 0x42, 0x4D, 0x57, 0x42, 0x4E, 0x4A, + 0x42, 0x4E, 0x6A, 0x42, 0x4E, 0x6F, 0x42, 0x50, + 0x48, 0x42, 0x50, 0x52, 0x42, 0x50, 0x61, 0x42, + 0x52, 0x73, 0x42, 0x53, 0x44, 0x42, 0x53, 0x4D, + 0x42, 0x53, 0x53, 0x42, 0x53, 0x76, 0x42, 0x54, + 0x4D, 0x42, 0x56, 0x49, 0x42, 0x57, 0x43, 0x42, + 0x57, 0x5A, 0x42, 0x57, 0x62, 0x42, 0x58, 0x49, + // Bytes 19c0 - 19ff + 0x42, 0x63, 0x63, 0x42, 0x63, 0x64, 0x42, 0x63, + 0x6D, 0x42, 0x64, 0x42, 0x42, 0x64, 0x61, 0x42, + 0x64, 0x6C, 0x42, 0x64, 0x6D, 0x42, 0x64, 0x7A, + 0x42, 0x65, 0x56, 0x42, 0x66, 0x66, 0x42, 0x66, + 0x69, 0x42, 0x66, 0x6C, 0x42, 0x66, 0x6D, 0x42, + 0x68, 0x61, 0x42, 0x69, 0x69, 0x42, 0x69, 0x6A, + 0x42, 0x69, 0x6E, 0x42, 0x69, 0x76, 0x42, 0x69, + 0x78, 0x42, 0x6B, 0x41, 0x42, 0x6B, 0x56, 0x42, + // Bytes 1a00 - 1a3f + 0x6B, 0x57, 0x42, 0x6B, 0x67, 0x42, 0x6B, 0x6C, + 0x42, 0x6B, 0x6D, 0x42, 0x6B, 0x74, 0x42, 0x6C, + 0x6A, 0x42, 0x6C, 0x6D, 0x42, 0x6C, 0x6E, 0x42, + 0x6C, 0x78, 0x42, 0x6D, 0x32, 0x42, 0x6D, 0x33, + 0x42, 0x6D, 0x41, 0x42, 0x6D, 0x56, 0x42, 0x6D, + 0x57, 0x42, 0x6D, 0x62, 0x42, 0x6D, 0x67, 0x42, + 0x6D, 0x6C, 0x42, 0x6D, 0x6D, 0x42, 0x6D, 0x73, + 0x42, 0x6E, 0x41, 0x42, 0x6E, 0x46, 0x42, 0x6E, + // Bytes 1a40 - 1a7f + 0x56, 0x42, 0x6E, 0x57, 0x42, 0x6E, 0x6A, 0x42, + 0x6E, 0x6D, 0x42, 0x6E, 0x73, 0x42, 0x6F, 0x56, + 0x42, 0x70, 0x41, 0x42, 0x70, 0x46, 0x42, 0x70, + 0x56, 0x42, 0x70, 0x57, 0x42, 0x70, 0x63, 0x42, + 0x70, 0x73, 0x42, 0x73, 0x72, 0x42, 0x73, 0x74, + 0x42, 0x76, 0x69, 0x42, 0x78, 0x69, 0x43, 0x28, + 0x31, 0x29, 0x43, 0x28, 0x32, 0x29, 0x43, 0x28, + 0x33, 0x29, 0x43, 0x28, 0x34, 0x29, 0x43, 0x28, + // Bytes 1a80 - 1abf + 0x35, 0x29, 0x43, 0x28, 0x36, 0x29, 0x43, 0x28, + 0x37, 0x29, 0x43, 0x28, 0x38, 0x29, 0x43, 0x28, + 0x39, 0x29, 0x43, 0x28, 0x41, 0x29, 0x43, 0x28, + 0x42, 0x29, 0x43, 0x28, 0x43, 0x29, 0x43, 0x28, + 0x44, 0x29, 0x43, 0x28, 0x45, 0x29, 0x43, 0x28, + 0x46, 0x29, 0x43, 0x28, 0x47, 0x29, 0x43, 0x28, + 0x48, 0x29, 0x43, 0x28, 0x49, 0x29, 0x43, 0x28, + 0x4A, 0x29, 0x43, 0x28, 0x4B, 0x29, 0x43, 0x28, + // Bytes 1ac0 - 1aff + 0x4C, 0x29, 0x43, 0x28, 0x4D, 0x29, 0x43, 0x28, + 0x4E, 0x29, 0x43, 0x28, 0x4F, 0x29, 0x43, 0x28, + 0x50, 0x29, 0x43, 0x28, 0x51, 0x29, 0x43, 0x28, + 0x52, 0x29, 0x43, 0x28, 0x53, 0x29, 0x43, 0x28, + 0x54, 0x29, 0x43, 0x28, 0x55, 0x29, 0x43, 0x28, + 0x56, 0x29, 0x43, 0x28, 0x57, 0x29, 0x43, 0x28, + 0x58, 0x29, 0x43, 0x28, 0x59, 0x29, 0x43, 0x28, + 0x5A, 0x29, 0x43, 0x28, 0x61, 0x29, 0x43, 0x28, + // Bytes 1b00 - 1b3f + 0x62, 0x29, 0x43, 0x28, 0x63, 0x29, 0x43, 0x28, + 0x64, 0x29, 0x43, 0x28, 0x65, 0x29, 0x43, 0x28, + 0x66, 0x29, 0x43, 0x28, 0x67, 0x29, 0x43, 0x28, + 0x68, 0x29, 0x43, 0x28, 0x69, 0x29, 0x43, 0x28, + 0x6A, 0x29, 0x43, 0x28, 0x6B, 0x29, 0x43, 0x28, + 0x6C, 0x29, 0x43, 0x28, 0x6D, 0x29, 0x43, 0x28, + 0x6E, 0x29, 0x43, 0x28, 0x6F, 0x29, 0x43, 0x28, + 0x70, 0x29, 0x43, 0x28, 0x71, 0x29, 0x43, 0x28, + // Bytes 1b40 - 1b7f + 0x72, 0x29, 0x43, 0x28, 0x73, 0x29, 0x43, 0x28, + 0x74, 0x29, 0x43, 0x28, 0x75, 0x29, 0x43, 0x28, + 0x76, 0x29, 0x43, 0x28, 0x77, 0x29, 0x43, 0x28, + 0x78, 0x29, 0x43, 0x28, 0x79, 0x29, 0x43, 0x28, + 0x7A, 0x29, 0x43, 0x2E, 0x2E, 0x2E, 0x43, 0x31, + 0x30, 0x2E, 0x43, 0x31, 0x31, 0x2E, 0x43, 0x31, + 0x32, 0x2E, 0x43, 0x31, 0x33, 0x2E, 0x43, 0x31, + 0x34, 0x2E, 0x43, 0x31, 0x35, 0x2E, 0x43, 0x31, + // Bytes 1b80 - 1bbf + 0x36, 0x2E, 0x43, 0x31, 0x37, 0x2E, 0x43, 0x31, + 0x38, 0x2E, 0x43, 0x31, 0x39, 0x2E, 0x43, 0x32, + 0x30, 0x2E, 0x43, 0x3A, 0x3A, 0x3D, 0x43, 0x3D, + 0x3D, 0x3D, 0x43, 0x43, 0x6F, 0x2E, 0x43, 0x46, + 0x41, 0x58, 0x43, 0x47, 0x48, 0x7A, 0x43, 0x47, + 0x50, 0x61, 0x43, 0x49, 0x49, 0x49, 0x43, 0x4C, + 0x54, 0x44, 0x43, 0x4C, 0xC2, 0xB7, 0x43, 0x4D, + 0x48, 0x7A, 0x43, 0x4D, 0x50, 0x61, 0x43, 0x4D, + // Bytes 1bc0 - 1bff + 0xCE, 0xA9, 0x43, 0x50, 0x50, 0x4D, 0x43, 0x50, + 0x50, 0x56, 0x43, 0x50, 0x54, 0x45, 0x43, 0x54, + 0x45, 0x4C, 0x43, 0x54, 0x48, 0x7A, 0x43, 0x56, + 0x49, 0x49, 0x43, 0x58, 0x49, 0x49, 0x43, 0x61, + 0x2F, 0x63, 0x43, 0x61, 0x2F, 0x73, 0x43, 0x61, + 0xCA, 0xBE, 0x43, 0x62, 0x61, 0x72, 0x43, 0x63, + 0x2F, 0x6F, 0x43, 0x63, 0x2F, 0x75, 0x43, 0x63, + 0x61, 0x6C, 0x43, 0x63, 0x6D, 0x32, 0x43, 0x63, + // Bytes 1c00 - 1c3f + 0x6D, 0x33, 0x43, 0x64, 0x6D, 0x32, 0x43, 0x64, + 0x6D, 0x33, 0x43, 0x65, 0x72, 0x67, 0x43, 0x66, + 0x66, 0x69, 0x43, 0x66, 0x66, 0x6C, 0x43, 0x67, + 0x61, 0x6C, 0x43, 0x68, 0x50, 0x61, 0x43, 0x69, + 0x69, 0x69, 0x43, 0x6B, 0x48, 0x7A, 0x43, 0x6B, + 0x50, 0x61, 0x43, 0x6B, 0x6D, 0x32, 0x43, 0x6B, + 0x6D, 0x33, 0x43, 0x6B, 0xCE, 0xA9, 0x43, 0x6C, + 0x6F, 0x67, 0x43, 0x6C, 0xC2, 0xB7, 0x43, 0x6D, + // Bytes 1c40 - 1c7f + 0x69, 0x6C, 0x43, 0x6D, 0x6D, 0x32, 0x43, 0x6D, + 0x6D, 0x33, 0x43, 0x6D, 0x6F, 0x6C, 0x43, 0x72, + 0x61, 0x64, 0x43, 0x76, 0x69, 0x69, 0x43, 0x78, + 0x69, 0x69, 0x43, 0xC2, 0xB0, 0x43, 0x43, 0xC2, + 0xB0, 0x46, 0x43, 0xCA, 0xBC, 0x6E, 0x43, 0xCE, + 0xBC, 0x41, 0x43, 0xCE, 0xBC, 0x46, 0x43, 0xCE, + 0xBC, 0x56, 0x43, 0xCE, 0xBC, 0x57, 0x43, 0xCE, + 0xBC, 0x67, 0x43, 0xCE, 0xBC, 0x6C, 0x43, 0xCE, + // Bytes 1c80 - 1cbf + 0xBC, 0x6D, 0x43, 0xCE, 0xBC, 0x73, 0x44, 0x28, + 0x31, 0x30, 0x29, 0x44, 0x28, 0x31, 0x31, 0x29, + 0x44, 0x28, 0x31, 0x32, 0x29, 0x44, 0x28, 0x31, + 0x33, 0x29, 0x44, 0x28, 0x31, 0x34, 0x29, 0x44, + 0x28, 0x31, 0x35, 0x29, 0x44, 0x28, 0x31, 0x36, + 0x29, 0x44, 0x28, 0x31, 0x37, 0x29, 0x44, 0x28, + 0x31, 0x38, 0x29, 0x44, 0x28, 0x31, 0x39, 0x29, + 0x44, 0x28, 0x32, 0x30, 0x29, 0x44, 0x30, 0xE7, + // Bytes 1cc0 - 1cff + 0x82, 0xB9, 0x44, 0x31, 0xE2, 0x81, 0x84, 0x44, + 0x31, 0xE6, 0x97, 0xA5, 0x44, 0x31, 0xE6, 0x9C, + 0x88, 0x44, 0x31, 0xE7, 0x82, 0xB9, 0x44, 0x32, + 0xE6, 0x97, 0xA5, 0x44, 0x32, 0xE6, 0x9C, 0x88, + 0x44, 0x32, 0xE7, 0x82, 0xB9, 0x44, 0x33, 0xE6, + 0x97, 0xA5, 0x44, 0x33, 0xE6, 0x9C, 0x88, 0x44, + 0x33, 0xE7, 0x82, 0xB9, 0x44, 0x34, 0xE6, 0x97, + 0xA5, 0x44, 0x34, 0xE6, 0x9C, 0x88, 0x44, 0x34, + // Bytes 1d00 - 1d3f + 0xE7, 0x82, 0xB9, 0x44, 0x35, 0xE6, 0x97, 0xA5, + 0x44, 0x35, 0xE6, 0x9C, 0x88, 0x44, 0x35, 0xE7, + 0x82, 0xB9, 0x44, 0x36, 0xE6, 0x97, 0xA5, 0x44, + 0x36, 0xE6, 0x9C, 0x88, 0x44, 0x36, 0xE7, 0x82, + 0xB9, 0x44, 0x37, 0xE6, 0x97, 0xA5, 0x44, 0x37, + 0xE6, 0x9C, 0x88, 0x44, 0x37, 0xE7, 0x82, 0xB9, + 0x44, 0x38, 0xE6, 0x97, 0xA5, 0x44, 0x38, 0xE6, + 0x9C, 0x88, 0x44, 0x38, 0xE7, 0x82, 0xB9, 0x44, + // Bytes 1d40 - 1d7f + 0x39, 0xE6, 0x97, 0xA5, 0x44, 0x39, 0xE6, 0x9C, + 0x88, 0x44, 0x39, 0xE7, 0x82, 0xB9, 0x44, 0x56, + 0x49, 0x49, 0x49, 0x44, 0x61, 0x2E, 0x6D, 0x2E, + 0x44, 0x6B, 0x63, 0x61, 0x6C, 0x44, 0x70, 0x2E, + 0x6D, 0x2E, 0x44, 0x76, 0x69, 0x69, 0x69, 0x44, + 0xD5, 0xA5, 0xD6, 0x82, 0x44, 0xD5, 0xB4, 0xD5, + 0xA5, 0x44, 0xD5, 0xB4, 0xD5, 0xAB, 0x44, 0xD5, + 0xB4, 0xD5, 0xAD, 0x44, 0xD5, 0xB4, 0xD5, 0xB6, + // Bytes 1d80 - 1dbf + 0x44, 0xD5, 0xBE, 0xD5, 0xB6, 0x44, 0xD7, 0x90, + 0xD7, 0x9C, 0x44, 0xD8, 0xA7, 0xD9, 0xB4, 0x44, + 0xD8, 0xA8, 0xD8, 0xAC, 0x44, 0xD8, 0xA8, 0xD8, + 0xAD, 0x44, 0xD8, 0xA8, 0xD8, 0xAE, 0x44, 0xD8, + 0xA8, 0xD8, 0xB1, 0x44, 0xD8, 0xA8, 0xD8, 0xB2, + 0x44, 0xD8, 0xA8, 0xD9, 0x85, 0x44, 0xD8, 0xA8, + 0xD9, 0x86, 0x44, 0xD8, 0xA8, 0xD9, 0x87, 0x44, + 0xD8, 0xA8, 0xD9, 0x89, 0x44, 0xD8, 0xA8, 0xD9, + // Bytes 1dc0 - 1dff + 0x8A, 0x44, 0xD8, 0xAA, 0xD8, 0xAC, 0x44, 0xD8, + 0xAA, 0xD8, 0xAD, 0x44, 0xD8, 0xAA, 0xD8, 0xAE, + 0x44, 0xD8, 0xAA, 0xD8, 0xB1, 0x44, 0xD8, 0xAA, + 0xD8, 0xB2, 0x44, 0xD8, 0xAA, 0xD9, 0x85, 0x44, + 0xD8, 0xAA, 0xD9, 0x86, 0x44, 0xD8, 0xAA, 0xD9, + 0x87, 0x44, 0xD8, 0xAA, 0xD9, 0x89, 0x44, 0xD8, + 0xAA, 0xD9, 0x8A, 0x44, 0xD8, 0xAB, 0xD8, 0xAC, + 0x44, 0xD8, 0xAB, 0xD8, 0xB1, 0x44, 0xD8, 0xAB, + // Bytes 1e00 - 1e3f + 0xD8, 0xB2, 0x44, 0xD8, 0xAB, 0xD9, 0x85, 0x44, + 0xD8, 0xAB, 0xD9, 0x86, 0x44, 0xD8, 0xAB, 0xD9, + 0x87, 0x44, 0xD8, 0xAB, 0xD9, 0x89, 0x44, 0xD8, + 0xAB, 0xD9, 0x8A, 0x44, 0xD8, 0xAC, 0xD8, 0xAD, + 0x44, 0xD8, 0xAC, 0xD9, 0x85, 0x44, 0xD8, 0xAC, + 0xD9, 0x89, 0x44, 0xD8, 0xAC, 0xD9, 0x8A, 0x44, + 0xD8, 0xAD, 0xD8, 0xAC, 0x44, 0xD8, 0xAD, 0xD9, + 0x85, 0x44, 0xD8, 0xAD, 0xD9, 0x89, 0x44, 0xD8, + // Bytes 1e40 - 1e7f + 0xAD, 0xD9, 0x8A, 0x44, 0xD8, 0xAE, 0xD8, 0xAC, + 0x44, 0xD8, 0xAE, 0xD8, 0xAD, 0x44, 0xD8, 0xAE, + 0xD9, 0x85, 0x44, 0xD8, 0xAE, 0xD9, 0x89, 0x44, + 0xD8, 0xAE, 0xD9, 0x8A, 0x44, 0xD8, 0xB3, 0xD8, + 0xAC, 0x44, 0xD8, 0xB3, 0xD8, 0xAD, 0x44, 0xD8, + 0xB3, 0xD8, 0xAE, 0x44, 0xD8, 0xB3, 0xD8, 0xB1, + 0x44, 0xD8, 0xB3, 0xD9, 0x85, 0x44, 0xD8, 0xB3, + 0xD9, 0x87, 0x44, 0xD8, 0xB3, 0xD9, 0x89, 0x44, + // Bytes 1e80 - 1ebf + 0xD8, 0xB3, 0xD9, 0x8A, 0x44, 0xD8, 0xB4, 0xD8, + 0xAC, 0x44, 0xD8, 0xB4, 0xD8, 0xAD, 0x44, 0xD8, + 0xB4, 0xD8, 0xAE, 0x44, 0xD8, 0xB4, 0xD8, 0xB1, + 0x44, 0xD8, 0xB4, 0xD9, 0x85, 0x44, 0xD8, 0xB4, + 0xD9, 0x87, 0x44, 0xD8, 0xB4, 0xD9, 0x89, 0x44, + 0xD8, 0xB4, 0xD9, 0x8A, 0x44, 0xD8, 0xB5, 0xD8, + 0xAD, 0x44, 0xD8, 0xB5, 0xD8, 0xAE, 0x44, 0xD8, + 0xB5, 0xD8, 0xB1, 0x44, 0xD8, 0xB5, 0xD9, 0x85, + // Bytes 1ec0 - 1eff + 0x44, 0xD8, 0xB5, 0xD9, 0x89, 0x44, 0xD8, 0xB5, + 0xD9, 0x8A, 0x44, 0xD8, 0xB6, 0xD8, 0xAC, 0x44, + 0xD8, 0xB6, 0xD8, 0xAD, 0x44, 0xD8, 0xB6, 0xD8, + 0xAE, 0x44, 0xD8, 0xB6, 0xD8, 0xB1, 0x44, 0xD8, + 0xB6, 0xD9, 0x85, 0x44, 0xD8, 0xB6, 0xD9, 0x89, + 0x44, 0xD8, 0xB6, 0xD9, 0x8A, 0x44, 0xD8, 0xB7, + 0xD8, 0xAD, 0x44, 0xD8, 0xB7, 0xD9, 0x85, 0x44, + 0xD8, 0xB7, 0xD9, 0x89, 0x44, 0xD8, 0xB7, 0xD9, + // Bytes 1f00 - 1f3f + 0x8A, 0x44, 0xD8, 0xB8, 0xD9, 0x85, 0x44, 0xD8, + 0xB9, 0xD8, 0xAC, 0x44, 0xD8, 0xB9, 0xD9, 0x85, + 0x44, 0xD8, 0xB9, 0xD9, 0x89, 0x44, 0xD8, 0xB9, + 0xD9, 0x8A, 0x44, 0xD8, 0xBA, 0xD8, 0xAC, 0x44, + 0xD8, 0xBA, 0xD9, 0x85, 0x44, 0xD8, 0xBA, 0xD9, + 0x89, 0x44, 0xD8, 0xBA, 0xD9, 0x8A, 0x44, 0xD9, + 0x81, 0xD8, 0xAC, 0x44, 0xD9, 0x81, 0xD8, 0xAD, + 0x44, 0xD9, 0x81, 0xD8, 0xAE, 0x44, 0xD9, 0x81, + // Bytes 1f40 - 1f7f + 0xD9, 0x85, 0x44, 0xD9, 0x81, 0xD9, 0x89, 0x44, + 0xD9, 0x81, 0xD9, 0x8A, 0x44, 0xD9, 0x82, 0xD8, + 0xAD, 0x44, 0xD9, 0x82, 0xD9, 0x85, 0x44, 0xD9, + 0x82, 0xD9, 0x89, 0x44, 0xD9, 0x82, 0xD9, 0x8A, + 0x44, 0xD9, 0x83, 0xD8, 0xA7, 0x44, 0xD9, 0x83, + 0xD8, 0xAC, 0x44, 0xD9, 0x83, 0xD8, 0xAD, 0x44, + 0xD9, 0x83, 0xD8, 0xAE, 0x44, 0xD9, 0x83, 0xD9, + 0x84, 0x44, 0xD9, 0x83, 0xD9, 0x85, 0x44, 0xD9, + // Bytes 1f80 - 1fbf + 0x83, 0xD9, 0x89, 0x44, 0xD9, 0x83, 0xD9, 0x8A, + 0x44, 0xD9, 0x84, 0xD8, 0xA7, 0x44, 0xD9, 0x84, + 0xD8, 0xAC, 0x44, 0xD9, 0x84, 0xD8, 0xAD, 0x44, + 0xD9, 0x84, 0xD8, 0xAE, 0x44, 0xD9, 0x84, 0xD9, + 0x85, 0x44, 0xD9, 0x84, 0xD9, 0x87, 0x44, 0xD9, + 0x84, 0xD9, 0x89, 0x44, 0xD9, 0x84, 0xD9, 0x8A, + 0x44, 0xD9, 0x85, 0xD8, 0xA7, 0x44, 0xD9, 0x85, + 0xD8, 0xAC, 0x44, 0xD9, 0x85, 0xD8, 0xAD, 0x44, + // Bytes 1fc0 - 1fff + 0xD9, 0x85, 0xD8, 0xAE, 0x44, 0xD9, 0x85, 0xD9, + 0x85, 0x44, 0xD9, 0x85, 0xD9, 0x89, 0x44, 0xD9, + 0x85, 0xD9, 0x8A, 0x44, 0xD9, 0x86, 0xD8, 0xAC, + 0x44, 0xD9, 0x86, 0xD8, 0xAD, 0x44, 0xD9, 0x86, + 0xD8, 0xAE, 0x44, 0xD9, 0x86, 0xD8, 0xB1, 0x44, + 0xD9, 0x86, 0xD8, 0xB2, 0x44, 0xD9, 0x86, 0xD9, + 0x85, 0x44, 0xD9, 0x86, 0xD9, 0x86, 0x44, 0xD9, + 0x86, 0xD9, 0x87, 0x44, 0xD9, 0x86, 0xD9, 0x89, + // Bytes 2000 - 203f + 0x44, 0xD9, 0x86, 0xD9, 0x8A, 0x44, 0xD9, 0x87, + 0xD8, 0xAC, 0x44, 0xD9, 0x87, 0xD9, 0x85, 0x44, + 0xD9, 0x87, 0xD9, 0x89, 0x44, 0xD9, 0x87, 0xD9, + 0x8A, 0x44, 0xD9, 0x88, 0xD9, 0xB4, 0x44, 0xD9, + 0x8A, 0xD8, 0xAC, 0x44, 0xD9, 0x8A, 0xD8, 0xAD, + 0x44, 0xD9, 0x8A, 0xD8, 0xAE, 0x44, 0xD9, 0x8A, + 0xD8, 0xB1, 0x44, 0xD9, 0x8A, 0xD8, 0xB2, 0x44, + 0xD9, 0x8A, 0xD9, 0x85, 0x44, 0xD9, 0x8A, 0xD9, + // Bytes 2040 - 207f + 0x86, 0x44, 0xD9, 0x8A, 0xD9, 0x87, 0x44, 0xD9, + 0x8A, 0xD9, 0x89, 0x44, 0xD9, 0x8A, 0xD9, 0x8A, + 0x44, 0xD9, 0x8A, 0xD9, 0xB4, 0x44, 0xDB, 0x87, + 0xD9, 0xB4, 0x45, 0x28, 0xE1, 0x84, 0x80, 0x29, + 0x45, 0x28, 0xE1, 0x84, 0x82, 0x29, 0x45, 0x28, + 0xE1, 0x84, 0x83, 0x29, 0x45, 0x28, 0xE1, 0x84, + 0x85, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x86, 0x29, + 0x45, 0x28, 0xE1, 0x84, 0x87, 0x29, 0x45, 0x28, + // Bytes 2080 - 20bf + 0xE1, 0x84, 0x89, 0x29, 0x45, 0x28, 0xE1, 0x84, + 0x8B, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x8C, 0x29, + 0x45, 0x28, 0xE1, 0x84, 0x8E, 0x29, 0x45, 0x28, + 0xE1, 0x84, 0x8F, 0x29, 0x45, 0x28, 0xE1, 0x84, + 0x90, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x91, 0x29, + 0x45, 0x28, 0xE1, 0x84, 0x92, 0x29, 0x45, 0x28, + 0xE4, 0xB8, 0x80, 0x29, 0x45, 0x28, 0xE4, 0xB8, + 0x83, 0x29, 0x45, 0x28, 0xE4, 0xB8, 0x89, 0x29, + // Bytes 20c0 - 20ff + 0x45, 0x28, 0xE4, 0xB9, 0x9D, 0x29, 0x45, 0x28, + 0xE4, 0xBA, 0x8C, 0x29, 0x45, 0x28, 0xE4, 0xBA, + 0x94, 0x29, 0x45, 0x28, 0xE4, 0xBB, 0xA3, 0x29, + 0x45, 0x28, 0xE4, 0xBC, 0x81, 0x29, 0x45, 0x28, + 0xE4, 0xBC, 0x91, 0x29, 0x45, 0x28, 0xE5, 0x85, + 0xAB, 0x29, 0x45, 0x28, 0xE5, 0x85, 0xAD, 0x29, + 0x45, 0x28, 0xE5, 0x8A, 0xB4, 0x29, 0x45, 0x28, + 0xE5, 0x8D, 0x81, 0x29, 0x45, 0x28, 0xE5, 0x8D, + // Bytes 2100 - 213f + 0x94, 0x29, 0x45, 0x28, 0xE5, 0x90, 0x8D, 0x29, + 0x45, 0x28, 0xE5, 0x91, 0xBC, 0x29, 0x45, 0x28, + 0xE5, 0x9B, 0x9B, 0x29, 0x45, 0x28, 0xE5, 0x9C, + 0x9F, 0x29, 0x45, 0x28, 0xE5, 0xAD, 0xA6, 0x29, + 0x45, 0x28, 0xE6, 0x97, 0xA5, 0x29, 0x45, 0x28, + 0xE6, 0x9C, 0x88, 0x29, 0x45, 0x28, 0xE6, 0x9C, + 0x89, 0x29, 0x45, 0x28, 0xE6, 0x9C, 0xA8, 0x29, + 0x45, 0x28, 0xE6, 0xA0, 0xAA, 0x29, 0x45, 0x28, + // Bytes 2140 - 217f + 0xE6, 0xB0, 0xB4, 0x29, 0x45, 0x28, 0xE7, 0x81, + 0xAB, 0x29, 0x45, 0x28, 0xE7, 0x89, 0xB9, 0x29, + 0x45, 0x28, 0xE7, 0x9B, 0xA3, 0x29, 0x45, 0x28, + 0xE7, 0xA4, 0xBE, 0x29, 0x45, 0x28, 0xE7, 0xA5, + 0x9D, 0x29, 0x45, 0x28, 0xE7, 0xA5, 0xAD, 0x29, + 0x45, 0x28, 0xE8, 0x87, 0xAA, 0x29, 0x45, 0x28, + 0xE8, 0x87, 0xB3, 0x29, 0x45, 0x28, 0xE8, 0xB2, + 0xA1, 0x29, 0x45, 0x28, 0xE8, 0xB3, 0x87, 0x29, + // Bytes 2180 - 21bf + 0x45, 0x28, 0xE9, 0x87, 0x91, 0x29, 0x45, 0x30, + 0xE2, 0x81, 0x84, 0x33, 0x45, 0x31, 0x30, 0xE6, + 0x97, 0xA5, 0x45, 0x31, 0x30, 0xE6, 0x9C, 0x88, + 0x45, 0x31, 0x30, 0xE7, 0x82, 0xB9, 0x45, 0x31, + 0x31, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x31, 0xE6, + 0x9C, 0x88, 0x45, 0x31, 0x31, 0xE7, 0x82, 0xB9, + 0x45, 0x31, 0x32, 0xE6, 0x97, 0xA5, 0x45, 0x31, + 0x32, 0xE6, 0x9C, 0x88, 0x45, 0x31, 0x32, 0xE7, + // Bytes 21c0 - 21ff + 0x82, 0xB9, 0x45, 0x31, 0x33, 0xE6, 0x97, 0xA5, + 0x45, 0x31, 0x33, 0xE7, 0x82, 0xB9, 0x45, 0x31, + 0x34, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x34, 0xE7, + 0x82, 0xB9, 0x45, 0x31, 0x35, 0xE6, 0x97, 0xA5, + 0x45, 0x31, 0x35, 0xE7, 0x82, 0xB9, 0x45, 0x31, + 0x36, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x36, 0xE7, + 0x82, 0xB9, 0x45, 0x31, 0x37, 0xE6, 0x97, 0xA5, + 0x45, 0x31, 0x37, 0xE7, 0x82, 0xB9, 0x45, 0x31, + // Bytes 2200 - 223f + 0x38, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x38, 0xE7, + 0x82, 0xB9, 0x45, 0x31, 0x39, 0xE6, 0x97, 0xA5, + 0x45, 0x31, 0x39, 0xE7, 0x82, 0xB9, 0x45, 0x31, + 0xE2, 0x81, 0x84, 0x32, 0x45, 0x31, 0xE2, 0x81, + 0x84, 0x33, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x34, + 0x45, 0x31, 0xE2, 0x81, 0x84, 0x35, 0x45, 0x31, + 0xE2, 0x81, 0x84, 0x36, 0x45, 0x31, 0xE2, 0x81, + 0x84, 0x37, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x38, + // Bytes 2240 - 227f + 0x45, 0x31, 0xE2, 0x81, 0x84, 0x39, 0x45, 0x32, + 0x30, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x30, 0xE7, + 0x82, 0xB9, 0x45, 0x32, 0x31, 0xE6, 0x97, 0xA5, + 0x45, 0x32, 0x31, 0xE7, 0x82, 0xB9, 0x45, 0x32, + 0x32, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x32, 0xE7, + 0x82, 0xB9, 0x45, 0x32, 0x33, 0xE6, 0x97, 0xA5, + 0x45, 0x32, 0x33, 0xE7, 0x82, 0xB9, 0x45, 0x32, + 0x34, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x34, 0xE7, + // Bytes 2280 - 22bf + 0x82, 0xB9, 0x45, 0x32, 0x35, 0xE6, 0x97, 0xA5, + 0x45, 0x32, 0x36, 0xE6, 0x97, 0xA5, 0x45, 0x32, + 0x37, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x38, 0xE6, + 0x97, 0xA5, 0x45, 0x32, 0x39, 0xE6, 0x97, 0xA5, + 0x45, 0x32, 0xE2, 0x81, 0x84, 0x33, 0x45, 0x32, + 0xE2, 0x81, 0x84, 0x35, 0x45, 0x33, 0x30, 0xE6, + 0x97, 0xA5, 0x45, 0x33, 0x31, 0xE6, 0x97, 0xA5, + 0x45, 0x33, 0xE2, 0x81, 0x84, 0x34, 0x45, 0x33, + // Bytes 22c0 - 22ff + 0xE2, 0x81, 0x84, 0x35, 0x45, 0x33, 0xE2, 0x81, + 0x84, 0x38, 0x45, 0x34, 0xE2, 0x81, 0x84, 0x35, + 0x45, 0x35, 0xE2, 0x81, 0x84, 0x36, 0x45, 0x35, + 0xE2, 0x81, 0x84, 0x38, 0x45, 0x37, 0xE2, 0x81, + 0x84, 0x38, 0x45, 0x41, 0xE2, 0x88, 0x95, 0x6D, + 0x45, 0x56, 0xE2, 0x88, 0x95, 0x6D, 0x45, 0x6D, + 0xE2, 0x88, 0x95, 0x73, 0x46, 0x31, 0xE2, 0x81, + 0x84, 0x31, 0x30, 0x46, 0x43, 0xE2, 0x88, 0x95, + // Bytes 2300 - 233f + 0x6B, 0x67, 0x46, 0x6D, 0xE2, 0x88, 0x95, 0x73, + 0x32, 0x46, 0xD8, 0xA8, 0xD8, 0xAD, 0xD9, 0x8A, + 0x46, 0xD8, 0xA8, 0xD8, 0xAE, 0xD9, 0x8A, 0x46, + 0xD8, 0xAA, 0xD8, 0xAC, 0xD9, 0x85, 0x46, 0xD8, + 0xAA, 0xD8, 0xAC, 0xD9, 0x89, 0x46, 0xD8, 0xAA, + 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD8, 0xAA, 0xD8, + 0xAD, 0xD8, 0xAC, 0x46, 0xD8, 0xAA, 0xD8, 0xAD, + 0xD9, 0x85, 0x46, 0xD8, 0xAA, 0xD8, 0xAE, 0xD9, + // Bytes 2340 - 237f + 0x85, 0x46, 0xD8, 0xAA, 0xD8, 0xAE, 0xD9, 0x89, + 0x46, 0xD8, 0xAA, 0xD8, 0xAE, 0xD9, 0x8A, 0x46, + 0xD8, 0xAA, 0xD9, 0x85, 0xD8, 0xAC, 0x46, 0xD8, + 0xAA, 0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD8, 0xAA, + 0xD9, 0x85, 0xD8, 0xAE, 0x46, 0xD8, 0xAA, 0xD9, + 0x85, 0xD9, 0x89, 0x46, 0xD8, 0xAA, 0xD9, 0x85, + 0xD9, 0x8A, 0x46, 0xD8, 0xAC, 0xD8, 0xAD, 0xD9, + 0x89, 0x46, 0xD8, 0xAC, 0xD8, 0xAD, 0xD9, 0x8A, + // Bytes 2380 - 23bf + 0x46, 0xD8, 0xAC, 0xD9, 0x85, 0xD8, 0xAD, 0x46, + 0xD8, 0xAC, 0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD8, + 0xAC, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD8, 0xAD, + 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD8, 0xAD, 0xD9, + 0x85, 0xD9, 0x89, 0x46, 0xD8, 0xAD, 0xD9, 0x85, + 0xD9, 0x8A, 0x46, 0xD8, 0xB3, 0xD8, 0xAC, 0xD8, + 0xAD, 0x46, 0xD8, 0xB3, 0xD8, 0xAC, 0xD9, 0x89, + 0x46, 0xD8, 0xB3, 0xD8, 0xAD, 0xD8, 0xAC, 0x46, + // Bytes 23c0 - 23ff + 0xD8, 0xB3, 0xD8, 0xAE, 0xD9, 0x89, 0x46, 0xD8, + 0xB3, 0xD8, 0xAE, 0xD9, 0x8A, 0x46, 0xD8, 0xB3, + 0xD9, 0x85, 0xD8, 0xAC, 0x46, 0xD8, 0xB3, 0xD9, + 0x85, 0xD8, 0xAD, 0x46, 0xD8, 0xB3, 0xD9, 0x85, + 0xD9, 0x85, 0x46, 0xD8, 0xB4, 0xD8, 0xAC, 0xD9, + 0x8A, 0x46, 0xD8, 0xB4, 0xD8, 0xAD, 0xD9, 0x85, + 0x46, 0xD8, 0xB4, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, + 0xD8, 0xB4, 0xD9, 0x85, 0xD8, 0xAE, 0x46, 0xD8, + // Bytes 2400 - 243f + 0xB4, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xB5, + 0xD8, 0xAD, 0xD8, 0xAD, 0x46, 0xD8, 0xB5, 0xD8, + 0xAD, 0xD9, 0x8A, 0x46, 0xD8, 0xB5, 0xD9, 0x84, + 0xD9, 0x89, 0x46, 0xD8, 0xB5, 0xD9, 0x84, 0xDB, + 0x92, 0x46, 0xD8, 0xB5, 0xD9, 0x85, 0xD9, 0x85, + 0x46, 0xD8, 0xB6, 0xD8, 0xAD, 0xD9, 0x89, 0x46, + 0xD8, 0xB6, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD8, + 0xB6, 0xD8, 0xAE, 0xD9, 0x85, 0x46, 0xD8, 0xB7, + // Bytes 2440 - 247f + 0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD8, 0xB7, 0xD9, + 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xB7, 0xD9, 0x85, + 0xD9, 0x8A, 0x46, 0xD8, 0xB9, 0xD8, 0xAC, 0xD9, + 0x85, 0x46, 0xD8, 0xB9, 0xD9, 0x85, 0xD9, 0x85, + 0x46, 0xD8, 0xB9, 0xD9, 0x85, 0xD9, 0x89, 0x46, + 0xD8, 0xB9, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD8, + 0xBA, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xBA, + 0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD8, 0xBA, 0xD9, + // Bytes 2480 - 24bf + 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x81, 0xD8, 0xAE, + 0xD9, 0x85, 0x46, 0xD9, 0x81, 0xD9, 0x85, 0xD9, + 0x8A, 0x46, 0xD9, 0x82, 0xD9, 0x84, 0xDB, 0x92, + 0x46, 0xD9, 0x82, 0xD9, 0x85, 0xD8, 0xAD, 0x46, + 0xD9, 0x82, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD9, + 0x82, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x83, + 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD9, 0x83, 0xD9, + 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x84, 0xD8, 0xAC, + // Bytes 24c0 - 24ff + 0xD8, 0xAC, 0x46, 0xD9, 0x84, 0xD8, 0xAC, 0xD9, + 0x85, 0x46, 0xD9, 0x84, 0xD8, 0xAC, 0xD9, 0x8A, + 0x46, 0xD9, 0x84, 0xD8, 0xAD, 0xD9, 0x85, 0x46, + 0xD9, 0x84, 0xD8, 0xAD, 0xD9, 0x89, 0x46, 0xD9, + 0x84, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD9, 0x84, + 0xD8, 0xAE, 0xD9, 0x85, 0x46, 0xD9, 0x84, 0xD9, + 0x85, 0xD8, 0xAD, 0x46, 0xD9, 0x84, 0xD9, 0x85, + 0xD9, 0x8A, 0x46, 0xD9, 0x85, 0xD8, 0xAC, 0xD8, + // Bytes 2500 - 253f + 0xAD, 0x46, 0xD9, 0x85, 0xD8, 0xAC, 0xD8, 0xAE, + 0x46, 0xD9, 0x85, 0xD8, 0xAC, 0xD9, 0x85, 0x46, + 0xD9, 0x85, 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD9, + 0x85, 0xD8, 0xAD, 0xD8, 0xAC, 0x46, 0xD9, 0x85, + 0xD8, 0xAD, 0xD9, 0x85, 0x46, 0xD9, 0x85, 0xD8, + 0xAD, 0xD9, 0x8A, 0x46, 0xD9, 0x85, 0xD8, 0xAE, + 0xD8, 0xAC, 0x46, 0xD9, 0x85, 0xD8, 0xAE, 0xD9, + 0x85, 0x46, 0xD9, 0x85, 0xD8, 0xAE, 0xD9, 0x8A, + // Bytes 2540 - 257f + 0x46, 0xD9, 0x85, 0xD9, 0x85, 0xD9, 0x8A, 0x46, + 0xD9, 0x86, 0xD8, 0xAC, 0xD8, 0xAD, 0x46, 0xD9, + 0x86, 0xD8, 0xAC, 0xD9, 0x85, 0x46, 0xD9, 0x86, + 0xD8, 0xAC, 0xD9, 0x89, 0x46, 0xD9, 0x86, 0xD8, + 0xAC, 0xD9, 0x8A, 0x46, 0xD9, 0x86, 0xD8, 0xAD, + 0xD9, 0x85, 0x46, 0xD9, 0x86, 0xD8, 0xAD, 0xD9, + 0x89, 0x46, 0xD9, 0x86, 0xD8, 0xAD, 0xD9, 0x8A, + 0x46, 0xD9, 0x86, 0xD9, 0x85, 0xD9, 0x89, 0x46, + // Bytes 2580 - 25bf + 0xD9, 0x86, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, + 0x87, 0xD9, 0x85, 0xD8, 0xAC, 0x46, 0xD9, 0x87, + 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD9, 0x8A, 0xD8, + 0xAC, 0xD9, 0x8A, 0x46, 0xD9, 0x8A, 0xD8, 0xAD, + 0xD9, 0x8A, 0x46, 0xD9, 0x8A, 0xD9, 0x85, 0xD9, + 0x85, 0x46, 0xD9, 0x8A, 0xD9, 0x85, 0xD9, 0x8A, + 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xA7, 0x46, + 0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xAC, 0x46, 0xD9, + // Bytes 25c0 - 25ff + 0x8A, 0xD9, 0x94, 0xD8, 0xAD, 0x46, 0xD9, 0x8A, + 0xD9, 0x94, 0xD8, 0xAE, 0x46, 0xD9, 0x8A, 0xD9, + 0x94, 0xD8, 0xB1, 0x46, 0xD9, 0x8A, 0xD9, 0x94, + 0xD8, 0xB2, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, + 0x85, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x86, + 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x87, 0x46, + 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x88, 0x46, 0xD9, + 0x8A, 0xD9, 0x94, 0xD9, 0x89, 0x46, 0xD9, 0x8A, + // Bytes 2600 - 263f + 0xD9, 0x94, 0xD9, 0x8A, 0x46, 0xD9, 0x8A, 0xD9, + 0x94, 0xDB, 0x86, 0x46, 0xD9, 0x8A, 0xD9, 0x94, + 0xDB, 0x87, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, + 0x88, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x90, + 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x95, 0x46, + 0xE0, 0xB9, 0x8D, 0xE0, 0xB8, 0xB2, 0x46, 0xE0, + 0xBA, 0xAB, 0xE0, 0xBA, 0x99, 0x46, 0xE0, 0xBA, + 0xAB, 0xE0, 0xBA, 0xA1, 0x46, 0xE0, 0xBB, 0x8D, + // Bytes 2640 - 267f + 0xE0, 0xBA, 0xB2, 0x46, 0xE0, 0xBD, 0x80, 0xE0, + 0xBE, 0xB5, 0x46, 0xE0, 0xBD, 0x82, 0xE0, 0xBE, + 0xB7, 0x46, 0xE0, 0xBD, 0x8C, 0xE0, 0xBE, 0xB7, + 0x46, 0xE0, 0xBD, 0x91, 0xE0, 0xBE, 0xB7, 0x46, + 0xE0, 0xBD, 0x96, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, + 0xBD, 0x9B, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBE, + 0x90, 0xE0, 0xBE, 0xB5, 0x46, 0xE0, 0xBE, 0x92, + 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBE, 0x9C, 0xE0, + // Bytes 2680 - 26bf + 0xBE, 0xB7, 0x46, 0xE0, 0xBE, 0xA1, 0xE0, 0xBE, + 0xB7, 0x46, 0xE0, 0xBE, 0xA6, 0xE0, 0xBE, 0xB7, + 0x46, 0xE0, 0xBE, 0xAB, 0xE0, 0xBE, 0xB7, 0x46, + 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0x46, 0xE2, + 0x80, 0xB5, 0xE2, 0x80, 0xB5, 0x46, 0xE2, 0x88, + 0xAB, 0xE2, 0x88, 0xAB, 0x46, 0xE2, 0x88, 0xAE, + 0xE2, 0x88, 0xAE, 0x46, 0xE3, 0x81, 0xBB, 0xE3, + 0x81, 0x8B, 0x46, 0xE3, 0x82, 0x88, 0xE3, 0x82, + // Bytes 26c0 - 26ff + 0x8A, 0x46, 0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xAD, + 0x46, 0xE3, 0x82, 0xB3, 0xE3, 0x82, 0xB3, 0x46, + 0xE3, 0x82, 0xB3, 0xE3, 0x83, 0x88, 0x46, 0xE3, + 0x83, 0x88, 0xE3, 0x83, 0xB3, 0x46, 0xE3, 0x83, + 0x8A, 0xE3, 0x83, 0x8E, 0x46, 0xE3, 0x83, 0x9B, + 0xE3, 0x83, 0xB3, 0x46, 0xE3, 0x83, 0x9F, 0xE3, + 0x83, 0xAA, 0x46, 0xE3, 0x83, 0xAA, 0xE3, 0x83, + 0xA9, 0x46, 0xE3, 0x83, 0xAC, 0xE3, 0x83, 0xA0, + // Bytes 2700 - 273f + 0x46, 0xE4, 0xBB, 0xA4, 0xE5, 0x92, 0x8C, 0x46, + 0xE5, 0xA4, 0xA7, 0xE6, 0xAD, 0xA3, 0x46, 0xE5, + 0xB9, 0xB3, 0xE6, 0x88, 0x90, 0x46, 0xE6, 0x98, + 0x8E, 0xE6, 0xB2, 0xBB, 0x46, 0xE6, 0x98, 0xAD, + 0xE5, 0x92, 0x8C, 0x47, 0x72, 0x61, 0x64, 0xE2, + 0x88, 0x95, 0x73, 0x47, 0xE3, 0x80, 0x94, 0x53, + 0xE3, 0x80, 0x95, 0x48, 0x28, 0xE1, 0x84, 0x80, + 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, + // Bytes 2740 - 277f + 0x82, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, + 0x84, 0x83, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, + 0xE1, 0x84, 0x85, 0xE1, 0x85, 0xA1, 0x29, 0x48, + 0x28, 0xE1, 0x84, 0x86, 0xE1, 0x85, 0xA1, 0x29, + 0x48, 0x28, 0xE1, 0x84, 0x87, 0xE1, 0x85, 0xA1, + 0x29, 0x48, 0x28, 0xE1, 0x84, 0x89, 0xE1, 0x85, + 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x8B, 0xE1, + 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x8C, + // Bytes 2780 - 27bf + 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, + 0x8C, 0xE1, 0x85, 0xAE, 0x29, 0x48, 0x28, 0xE1, + 0x84, 0x8E, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, + 0xE1, 0x84, 0x8F, 0xE1, 0x85, 0xA1, 0x29, 0x48, + 0x28, 0xE1, 0x84, 0x90, 0xE1, 0x85, 0xA1, 0x29, + 0x48, 0x28, 0xE1, 0x84, 0x91, 0xE1, 0x85, 0xA1, + 0x29, 0x48, 0x28, 0xE1, 0x84, 0x92, 0xE1, 0x85, + 0xA1, 0x29, 0x48, 0x72, 0x61, 0x64, 0xE2, 0x88, + // Bytes 27c0 - 27ff + 0x95, 0x73, 0x32, 0x48, 0xD8, 0xA7, 0xD9, 0x83, + 0xD8, 0xA8, 0xD8, 0xB1, 0x48, 0xD8, 0xA7, 0xD9, + 0x84, 0xD9, 0x84, 0xD9, 0x87, 0x48, 0xD8, 0xB1, + 0xD8, 0xB3, 0xD9, 0x88, 0xD9, 0x84, 0x48, 0xD8, + 0xB1, 0xDB, 0x8C, 0xD8, 0xA7, 0xD9, 0x84, 0x48, + 0xD8, 0xB5, 0xD9, 0x84, 0xD8, 0xB9, 0xD9, 0x85, + 0x48, 0xD8, 0xB9, 0xD9, 0x84, 0xD9, 0x8A, 0xD9, + 0x87, 0x48, 0xD9, 0x85, 0xD8, 0xAD, 0xD9, 0x85, + // Bytes 2800 - 283f + 0xD8, 0xAF, 0x48, 0xD9, 0x88, 0xD8, 0xB3, 0xD9, + 0x84, 0xD9, 0x85, 0x49, 0xE2, 0x80, 0xB2, 0xE2, + 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0x49, 0xE2, 0x80, + 0xB5, 0xE2, 0x80, 0xB5, 0xE2, 0x80, 0xB5, 0x49, + 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0xE2, 0x88, + 0xAB, 0x49, 0xE2, 0x88, 0xAE, 0xE2, 0x88, 0xAE, + 0xE2, 0x88, 0xAE, 0x49, 0xE3, 0x80, 0x94, 0xE4, + 0xB8, 0x89, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, + // Bytes 2840 - 287f + 0x94, 0xE4, 0xBA, 0x8C, 0xE3, 0x80, 0x95, 0x49, + 0xE3, 0x80, 0x94, 0xE5, 0x8B, 0x9D, 0xE3, 0x80, + 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE5, 0xAE, 0x89, + 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE6, + 0x89, 0x93, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, + 0x94, 0xE6, 0x95, 0x97, 0xE3, 0x80, 0x95, 0x49, + 0xE3, 0x80, 0x94, 0xE6, 0x9C, 0xAC, 0xE3, 0x80, + 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE7, 0x82, 0xB9, + // Bytes 2880 - 28bf + 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE7, + 0x9B, 0x97, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x82, + 0xA2, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x49, + 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xB3, 0xE3, 0x83, + 0x81, 0x49, 0xE3, 0x82, 0xA6, 0xE3, 0x82, 0xA9, + 0xE3, 0x83, 0xB3, 0x49, 0xE3, 0x82, 0xAA, 0xE3, + 0x83, 0xB3, 0xE3, 0x82, 0xB9, 0x49, 0xE3, 0x82, + 0xAA, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xA0, 0x49, + // Bytes 28c0 - 28ff + 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0xA4, 0xE3, 0x83, + 0xAA, 0x49, 0xE3, 0x82, 0xB1, 0xE3, 0x83, 0xBC, + 0xE3, 0x82, 0xB9, 0x49, 0xE3, 0x82, 0xB3, 0xE3, + 0x83, 0xAB, 0xE3, 0x83, 0x8A, 0x49, 0xE3, 0x82, + 0xBB, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x81, 0x49, + 0xE3, 0x82, 0xBB, 0xE3, 0x83, 0xB3, 0xE3, 0x83, + 0x88, 0x49, 0xE3, 0x83, 0x86, 0xE3, 0x82, 0x99, + 0xE3, 0x82, 0xB7, 0x49, 0xE3, 0x83, 0x88, 0xE3, + // Bytes 2900 - 293f + 0x82, 0x99, 0xE3, 0x83, 0xAB, 0x49, 0xE3, 0x83, + 0x8E, 0xE3, 0x83, 0x83, 0xE3, 0x83, 0x88, 0x49, + 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0xA4, 0xE3, 0x83, + 0x84, 0x49, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x99, + 0xE3, 0x83, 0xAB, 0x49, 0xE3, 0x83, 0x92, 0xE3, + 0x82, 0x9A, 0xE3, 0x82, 0xB3, 0x49, 0xE3, 0x83, + 0x95, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0xB3, 0x49, + 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x82, + // Bytes 2940 - 297f + 0xBD, 0x49, 0xE3, 0x83, 0x98, 0xE3, 0x83, 0xAB, + 0xE3, 0x83, 0x84, 0x49, 0xE3, 0x83, 0x9B, 0xE3, + 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x49, 0xE3, 0x83, + 0x9B, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xB3, 0x49, + 0xE3, 0x83, 0x9E, 0xE3, 0x82, 0xA4, 0xE3, 0x83, + 0xAB, 0x49, 0xE3, 0x83, 0x9E, 0xE3, 0x83, 0x83, + 0xE3, 0x83, 0x8F, 0x49, 0xE3, 0x83, 0x9E, 0xE3, + 0x83, 0xAB, 0xE3, 0x82, 0xAF, 0x49, 0xE3, 0x83, + // Bytes 2980 - 29bf + 0xA4, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x49, + 0xE3, 0x83, 0xA6, 0xE3, 0x82, 0xA2, 0xE3, 0x83, + 0xB3, 0x49, 0xE3, 0x83, 0xAF, 0xE3, 0x83, 0x83, + 0xE3, 0x83, 0x88, 0x4C, 0xE2, 0x80, 0xB2, 0xE2, + 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, + 0x4C, 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0xE2, + 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0x4C, 0xE3, 0x82, + 0xA2, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x95, 0xE3, + // Bytes 29c0 - 29ff + 0x82, 0xA1, 0x4C, 0xE3, 0x82, 0xA8, 0xE3, 0x83, + 0xBC, 0xE3, 0x82, 0xAB, 0xE3, 0x83, 0xBC, 0x4C, + 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0xE3, 0x83, + 0xAD, 0xE3, 0x83, 0xB3, 0x4C, 0xE3, 0x82, 0xAB, + 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xB3, 0xE3, 0x83, + 0x9E, 0x4C, 0xE3, 0x82, 0xAB, 0xE3, 0x83, 0xA9, + 0xE3, 0x83, 0x83, 0xE3, 0x83, 0x88, 0x4C, 0xE3, + 0x82, 0xAB, 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xAA, + // Bytes 2a00 - 2a3f + 0xE3, 0x83, 0xBC, 0x4C, 0xE3, 0x82, 0xAD, 0xE3, + 0x82, 0x99, 0xE3, 0x83, 0x8B, 0xE3, 0x83, 0xBC, + 0x4C, 0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xA5, 0xE3, + 0x83, 0xAA, 0xE3, 0x83, 0xBC, 0x4C, 0xE3, 0x82, + 0xAF, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xA9, 0xE3, + 0x83, 0xA0, 0x4C, 0xE3, 0x82, 0xAF, 0xE3, 0x83, + 0xAD, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x8D, 0x4C, + 0xE3, 0x82, 0xB5, 0xE3, 0x82, 0xA4, 0xE3, 0x82, + // Bytes 2a40 - 2a7f + 0xAF, 0xE3, 0x83, 0xAB, 0x4C, 0xE3, 0x82, 0xBF, + 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0xE3, 0x82, + 0xB9, 0x4C, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x9A, + 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x84, 0x4C, 0xE3, + 0x83, 0x92, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xAF, + 0xE3, 0x83, 0xAB, 0x4C, 0xE3, 0x83, 0x95, 0xE3, + 0x82, 0xA3, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, + 0x4C, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x99, 0xE3, + // Bytes 2a80 - 2abf + 0x83, 0xBC, 0xE3, 0x82, 0xBF, 0x4C, 0xE3, 0x83, + 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0x8B, 0xE3, + 0x83, 0x92, 0x4C, 0xE3, 0x83, 0x98, 0xE3, 0x82, + 0x9A, 0xE3, 0x83, 0xB3, 0xE3, 0x82, 0xB9, 0x4C, + 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x99, 0xE3, 0x83, + 0xAB, 0xE3, 0x83, 0x88, 0x4C, 0xE3, 0x83, 0x9E, + 0xE3, 0x82, 0xA4, 0xE3, 0x82, 0xAF, 0xE3, 0x83, + 0xAD, 0x4C, 0xE3, 0x83, 0x9F, 0xE3, 0x82, 0xAF, + // Bytes 2ac0 - 2aff + 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xB3, 0x4C, 0xE3, + 0x83, 0xA1, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, + 0xE3, 0x83, 0xAB, 0x4C, 0xE3, 0x83, 0xAA, 0xE3, + 0x83, 0x83, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xAB, + 0x4C, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x92, 0xE3, + 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0x4C, 0xE6, 0xA0, + 0xAA, 0xE5, 0xBC, 0x8F, 0xE4, 0xBC, 0x9A, 0xE7, + 0xA4, 0xBE, 0x4E, 0x28, 0xE1, 0x84, 0x8B, 0xE1, + // Bytes 2b00 - 2b3f + 0x85, 0xA9, 0xE1, 0x84, 0x92, 0xE1, 0x85, 0xAE, + 0x29, 0x4F, 0xD8, 0xAC, 0xD9, 0x84, 0x20, 0xD8, + 0xAC, 0xD9, 0x84, 0xD8, 0xA7, 0xD9, 0x84, 0xD9, + 0x87, 0x4F, 0xE3, 0x82, 0xA2, 0xE3, 0x83, 0x8F, + 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0xE3, 0x83, + 0x88, 0x4F, 0xE3, 0x82, 0xA2, 0xE3, 0x83, 0xB3, + 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x82, + 0xA2, 0x4F, 0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xAD, + // Bytes 2b40 - 2b7f + 0xE3, 0x83, 0xAF, 0xE3, 0x83, 0x83, 0xE3, 0x83, + 0x88, 0x4F, 0xE3, 0x82, 0xB5, 0xE3, 0x83, 0xB3, + 0xE3, 0x83, 0x81, 0xE3, 0x83, 0xBC, 0xE3, 0x83, + 0xA0, 0x4F, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x99, + 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAC, 0xE3, 0x83, + 0xAB, 0x4F, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0xAF, + 0xE3, 0x82, 0xBF, 0xE3, 0x83, 0xBC, 0xE3, 0x83, + 0xAB, 0x4F, 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x9A, + // Bytes 2b80 - 2bbf + 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xB3, 0xE3, 0x83, + 0x88, 0x4F, 0xE3, 0x83, 0x9E, 0xE3, 0x83, 0xB3, + 0xE3, 0x82, 0xB7, 0xE3, 0x83, 0xA7, 0xE3, 0x83, + 0xB3, 0x4F, 0xE3, 0x83, 0xA1, 0xE3, 0x82, 0xAB, + 0xE3, 0x82, 0x99, 0xE3, 0x83, 0x88, 0xE3, 0x83, + 0xB3, 0x4F, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0xBC, + 0xE3, 0x83, 0x95, 0xE3, 0x82, 0x99, 0xE3, 0x83, + 0xAB, 0x51, 0x28, 0xE1, 0x84, 0x8B, 0xE1, 0x85, + // Bytes 2bc0 - 2bff + 0xA9, 0xE1, 0x84, 0x8C, 0xE1, 0x85, 0xA5, 0xE1, + 0x86, 0xAB, 0x29, 0x52, 0xE3, 0x82, 0xAD, 0xE3, + 0x82, 0x99, 0xE3, 0x83, 0xAB, 0xE3, 0x82, 0xBF, + 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0x52, 0xE3, + 0x82, 0xAD, 0xE3, 0x83, 0xAD, 0xE3, 0x82, 0xAF, + 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xA9, 0xE3, 0x83, + 0xA0, 0x52, 0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xAD, + 0xE3, 0x83, 0xA1, 0xE3, 0x83, 0xBC, 0xE3, 0x83, + // Bytes 2c00 - 2c3f + 0x88, 0xE3, 0x83, 0xAB, 0x52, 0xE3, 0x82, 0xAF, + 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xA9, 0xE3, 0x83, + 0xA0, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xB3, 0x52, + 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAB, 0xE3, 0x82, + 0xBB, 0xE3, 0x82, 0x99, 0xE3, 0x82, 0xA4, 0xE3, + 0x83, 0xAD, 0x52, 0xE3, 0x83, 0x8F, 0xE3, 0x82, + 0x9A, 0xE3, 0x83, 0xBC, 0xE3, 0x82, 0xBB, 0xE3, + 0x83, 0xB3, 0xE3, 0x83, 0x88, 0x52, 0xE3, 0x83, + // Bytes 2c40 - 2c7f + 0x92, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xA2, 0xE3, + 0x82, 0xB9, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xAB, + 0x52, 0xE3, 0x83, 0x95, 0xE3, 0x82, 0x99, 0xE3, + 0x83, 0x83, 0xE3, 0x82, 0xB7, 0xE3, 0x82, 0xA7, + 0xE3, 0x83, 0xAB, 0x52, 0xE3, 0x83, 0x9F, 0xE3, + 0x83, 0xAA, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x99, + 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x52, 0xE3, + 0x83, 0xAC, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x88, + // Bytes 2c80 - 2cbf + 0xE3, 0x82, 0xB1, 0xE3, 0x82, 0x99, 0xE3, 0x83, + 0xB3, 0x61, 0xD8, 0xB5, 0xD9, 0x84, 0xD9, 0x89, + 0x20, 0xD8, 0xA7, 0xD9, 0x84, 0xD9, 0x84, 0xD9, + 0x87, 0x20, 0xD8, 0xB9, 0xD9, 0x84, 0xD9, 0x8A, + 0xD9, 0x87, 0x20, 0xD9, 0x88, 0xD8, 0xB3, 0xD9, + 0x84, 0xD9, 0x85, 0x06, 0xE0, 0xA7, 0x87, 0xE0, + 0xA6, 0xBE, 0x01, 0x06, 0xE0, 0xA7, 0x87, 0xE0, + 0xA7, 0x97, 0x01, 0x06, 0xE0, 0xAD, 0x87, 0xE0, + // Bytes 2cc0 - 2cff + 0xAC, 0xBE, 0x01, 0x06, 0xE0, 0xAD, 0x87, 0xE0, + 0xAD, 0x96, 0x01, 0x06, 0xE0, 0xAD, 0x87, 0xE0, + 0xAD, 0x97, 0x01, 0x06, 0xE0, 0xAE, 0x92, 0xE0, + 0xAF, 0x97, 0x01, 0x06, 0xE0, 0xAF, 0x86, 0xE0, + 0xAE, 0xBE, 0x01, 0x06, 0xE0, 0xAF, 0x86, 0xE0, + 0xAF, 0x97, 0x01, 0x06, 0xE0, 0xAF, 0x87, 0xE0, + 0xAE, 0xBE, 0x01, 0x06, 0xE0, 0xB2, 0xBF, 0xE0, + 0xB3, 0x95, 0x01, 0x06, 0xE0, 0xB3, 0x86, 0xE0, + // Bytes 2d00 - 2d3f + 0xB3, 0x95, 0x01, 0x06, 0xE0, 0xB3, 0x86, 0xE0, + 0xB3, 0x96, 0x01, 0x06, 0xE0, 0xB5, 0x86, 0xE0, + 0xB4, 0xBE, 0x01, 0x06, 0xE0, 0xB5, 0x86, 0xE0, + 0xB5, 0x97, 0x01, 0x06, 0xE0, 0xB5, 0x87, 0xE0, + 0xB4, 0xBE, 0x01, 0x06, 0xE0, 0xB7, 0x99, 0xE0, + 0xB7, 0x9F, 0x01, 0x06, 0xE1, 0x80, 0xA5, 0xE1, + 0x80, 0xAE, 0x01, 0x06, 0xE1, 0xAC, 0x85, 0xE1, + 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x87, 0xE1, + // Bytes 2d40 - 2d7f + 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x89, 0xE1, + 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x8B, 0xE1, + 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x8D, 0xE1, + 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x91, 0xE1, + 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0xBA, 0xE1, + 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0xBC, 0xE1, + 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0xBE, 0xE1, + 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0xBF, 0xE1, + // Bytes 2d80 - 2dbf + 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAD, 0x82, 0xE1, + 0xAC, 0xB5, 0x01, 0x08, 0xF0, 0x91, 0x84, 0xB1, + 0xF0, 0x91, 0x84, 0xA7, 0x01, 0x08, 0xF0, 0x91, + 0x84, 0xB2, 0xF0, 0x91, 0x84, 0xA7, 0x01, 0x08, + 0xF0, 0x91, 0x8D, 0x87, 0xF0, 0x91, 0x8C, 0xBE, + 0x01, 0x08, 0xF0, 0x91, 0x8D, 0x87, 0xF0, 0x91, + 0x8D, 0x97, 0x01, 0x08, 0xF0, 0x91, 0x92, 0xB9, + 0xF0, 0x91, 0x92, 0xB0, 0x01, 0x08, 0xF0, 0x91, + // Bytes 2dc0 - 2dff + 0x92, 0xB9, 0xF0, 0x91, 0x92, 0xBA, 0x01, 0x08, + 0xF0, 0x91, 0x92, 0xB9, 0xF0, 0x91, 0x92, 0xBD, + 0x01, 0x08, 0xF0, 0x91, 0x96, 0xB8, 0xF0, 0x91, + 0x96, 0xAF, 0x01, 0x08, 0xF0, 0x91, 0x96, 0xB9, + 0xF0, 0x91, 0x96, 0xAF, 0x01, 0x08, 0xF0, 0x91, + 0xA4, 0xB5, 0xF0, 0x91, 0xA4, 0xB0, 0x01, 0x09, + 0xE0, 0xB3, 0x86, 0xE0, 0xB3, 0x82, 0xE0, 0xB3, + 0x95, 0x02, 0x09, 0xE0, 0xB7, 0x99, 0xE0, 0xB7, + // Bytes 2e00 - 2e3f + 0x8F, 0xE0, 0xB7, 0x8A, 0x16, 0x44, 0x44, 0x5A, + 0xCC, 0x8C, 0xCD, 0x44, 0x44, 0x7A, 0xCC, 0x8C, + 0xCD, 0x44, 0x64, 0x7A, 0xCC, 0x8C, 0xCD, 0x46, + 0xD9, 0x84, 0xD8, 0xA7, 0xD9, 0x93, 0xCD, 0x46, + 0xD9, 0x84, 0xD8, 0xA7, 0xD9, 0x94, 0xCD, 0x46, + 0xD9, 0x84, 0xD8, 0xA7, 0xD9, 0x95, 0xB9, 0x46, + 0xE1, 0x84, 0x80, 0xE1, 0x85, 0xA1, 0x01, 0x46, + 0xE1, 0x84, 0x82, 0xE1, 0x85, 0xA1, 0x01, 0x46, + // Bytes 2e40 - 2e7f + 0xE1, 0x84, 0x83, 0xE1, 0x85, 0xA1, 0x01, 0x46, + 0xE1, 0x84, 0x85, 0xE1, 0x85, 0xA1, 0x01, 0x46, + 0xE1, 0x84, 0x86, 0xE1, 0x85, 0xA1, 0x01, 0x46, + 0xE1, 0x84, 0x87, 0xE1, 0x85, 0xA1, 0x01, 0x46, + 0xE1, 0x84, 0x89, 0xE1, 0x85, 0xA1, 0x01, 0x46, + 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xA1, 0x01, 0x46, + 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xAE, 0x01, 0x46, + 0xE1, 0x84, 0x8C, 0xE1, 0x85, 0xA1, 0x01, 0x46, + // Bytes 2e80 - 2ebf + 0xE1, 0x84, 0x8E, 0xE1, 0x85, 0xA1, 0x01, 0x46, + 0xE1, 0x84, 0x8F, 0xE1, 0x85, 0xA1, 0x01, 0x46, + 0xE1, 0x84, 0x90, 0xE1, 0x85, 0xA1, 0x01, 0x46, + 0xE1, 0x84, 0x91, 0xE1, 0x85, 0xA1, 0x01, 0x46, + 0xE1, 0x84, 0x92, 0xE1, 0x85, 0xA1, 0x01, 0x49, + 0xE3, 0x83, 0xA1, 0xE3, 0x82, 0xAB, 0xE3, 0x82, + 0x99, 0x11, 0x4C, 0xE1, 0x84, 0x8C, 0xE1, 0x85, + 0xAE, 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xB4, 0x01, + // Bytes 2ec0 - 2eff + 0x4C, 0xE3, 0x82, 0xAD, 0xE3, 0x82, 0x99, 0xE3, + 0x82, 0xAB, 0xE3, 0x82, 0x99, 0x11, 0x4C, 0xE3, + 0x82, 0xB3, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x9B, + 0xE3, 0x82, 0x9A, 0x11, 0x4C, 0xE3, 0x83, 0xA4, + 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0xE3, 0x82, + 0x99, 0x11, 0x4F, 0xE1, 0x84, 0x8E, 0xE1, 0x85, + 0xA1, 0xE1, 0x86, 0xB7, 0xE1, 0x84, 0x80, 0xE1, + 0x85, 0xA9, 0x01, 0x4F, 0xE3, 0x82, 0xA4, 0xE3, + // Bytes 2f00 - 2f3f + 0x83, 0x8B, 0xE3, 0x83, 0xB3, 0xE3, 0x82, 0xAF, + 0xE3, 0x82, 0x99, 0x11, 0x4F, 0xE3, 0x82, 0xB7, + 0xE3, 0x83, 0xAA, 0xE3, 0x83, 0xB3, 0xE3, 0x82, + 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x4F, 0xE3, 0x83, + 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0xE3, + 0x82, 0xB7, 0xE3, 0x82, 0x99, 0x11, 0x4F, 0xE3, + 0x83, 0x9B, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xB3, + 0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0x11, 0x52, + // Bytes 2f40 - 2f7f + 0xE3, 0x82, 0xA8, 0xE3, 0x82, 0xB9, 0xE3, 0x82, + 0xAF, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0xE3, + 0x82, 0x99, 0x11, 0x52, 0xE3, 0x83, 0x95, 0xE3, + 0x82, 0xA1, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0x83, + 0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0x11, 0x86, + 0xE0, 0xB3, 0x86, 0xE0, 0xB3, 0x82, 0x01, 0x86, + 0xE0, 0xB7, 0x99, 0xE0, 0xB7, 0x8F, 0x01, 0x03, + 0x3C, 0xCC, 0xB8, 0x05, 0x03, 0x3D, 0xCC, 0xB8, + // Bytes 2f80 - 2fbf + 0x05, 0x03, 0x3E, 0xCC, 0xB8, 0x05, 0x03, 0x41, + 0xCC, 0x80, 0xCD, 0x03, 0x41, 0xCC, 0x81, 0xCD, + 0x03, 0x41, 0xCC, 0x83, 0xCD, 0x03, 0x41, 0xCC, + 0x84, 0xCD, 0x03, 0x41, 0xCC, 0x89, 0xCD, 0x03, + 0x41, 0xCC, 0x8C, 0xCD, 0x03, 0x41, 0xCC, 0x8F, + 0xCD, 0x03, 0x41, 0xCC, 0x91, 0xCD, 0x03, 0x41, + 0xCC, 0xA5, 0xB9, 0x03, 0x41, 0xCC, 0xA8, 0xA9, + 0x03, 0x42, 0xCC, 0x87, 0xCD, 0x03, 0x42, 0xCC, + // Bytes 2fc0 - 2fff + 0xA3, 0xB9, 0x03, 0x42, 0xCC, 0xB1, 0xB9, 0x03, + 0x43, 0xCC, 0x81, 0xCD, 0x03, 0x43, 0xCC, 0x82, + 0xCD, 0x03, 0x43, 0xCC, 0x87, 0xCD, 0x03, 0x43, + 0xCC, 0x8C, 0xCD, 0x03, 0x44, 0xCC, 0x87, 0xCD, + 0x03, 0x44, 0xCC, 0x8C, 0xCD, 0x03, 0x44, 0xCC, + 0xA3, 0xB9, 0x03, 0x44, 0xCC, 0xA7, 0xA9, 0x03, + 0x44, 0xCC, 0xAD, 0xB9, 0x03, 0x44, 0xCC, 0xB1, + 0xB9, 0x03, 0x45, 0xCC, 0x80, 0xCD, 0x03, 0x45, + // Bytes 3000 - 303f + 0xCC, 0x81, 0xCD, 0x03, 0x45, 0xCC, 0x83, 0xCD, + 0x03, 0x45, 0xCC, 0x86, 0xCD, 0x03, 0x45, 0xCC, + 0x87, 0xCD, 0x03, 0x45, 0xCC, 0x88, 0xCD, 0x03, + 0x45, 0xCC, 0x89, 0xCD, 0x03, 0x45, 0xCC, 0x8C, + 0xCD, 0x03, 0x45, 0xCC, 0x8F, 0xCD, 0x03, 0x45, + 0xCC, 0x91, 0xCD, 0x03, 0x45, 0xCC, 0xA8, 0xA9, + 0x03, 0x45, 0xCC, 0xAD, 0xB9, 0x03, 0x45, 0xCC, + 0xB0, 0xB9, 0x03, 0x46, 0xCC, 0x87, 0xCD, 0x03, + // Bytes 3040 - 307f + 0x47, 0xCC, 0x81, 0xCD, 0x03, 0x47, 0xCC, 0x82, + 0xCD, 0x03, 0x47, 0xCC, 0x84, 0xCD, 0x03, 0x47, + 0xCC, 0x86, 0xCD, 0x03, 0x47, 0xCC, 0x87, 0xCD, + 0x03, 0x47, 0xCC, 0x8C, 0xCD, 0x03, 0x47, 0xCC, + 0xA7, 0xA9, 0x03, 0x48, 0xCC, 0x82, 0xCD, 0x03, + 0x48, 0xCC, 0x87, 0xCD, 0x03, 0x48, 0xCC, 0x88, + 0xCD, 0x03, 0x48, 0xCC, 0x8C, 0xCD, 0x03, 0x48, + 0xCC, 0xA3, 0xB9, 0x03, 0x48, 0xCC, 0xA7, 0xA9, + // Bytes 3080 - 30bf + 0x03, 0x48, 0xCC, 0xAE, 0xB9, 0x03, 0x49, 0xCC, + 0x80, 0xCD, 0x03, 0x49, 0xCC, 0x81, 0xCD, 0x03, + 0x49, 0xCC, 0x82, 0xCD, 0x03, 0x49, 0xCC, 0x83, + 0xCD, 0x03, 0x49, 0xCC, 0x84, 0xCD, 0x03, 0x49, + 0xCC, 0x86, 0xCD, 0x03, 0x49, 0xCC, 0x87, 0xCD, + 0x03, 0x49, 0xCC, 0x89, 0xCD, 0x03, 0x49, 0xCC, + 0x8C, 0xCD, 0x03, 0x49, 0xCC, 0x8F, 0xCD, 0x03, + 0x49, 0xCC, 0x91, 0xCD, 0x03, 0x49, 0xCC, 0xA3, + // Bytes 30c0 - 30ff + 0xB9, 0x03, 0x49, 0xCC, 0xA8, 0xA9, 0x03, 0x49, + 0xCC, 0xB0, 0xB9, 0x03, 0x4A, 0xCC, 0x82, 0xCD, + 0x03, 0x4B, 0xCC, 0x81, 0xCD, 0x03, 0x4B, 0xCC, + 0x8C, 0xCD, 0x03, 0x4B, 0xCC, 0xA3, 0xB9, 0x03, + 0x4B, 0xCC, 0xA7, 0xA9, 0x03, 0x4B, 0xCC, 0xB1, + 0xB9, 0x03, 0x4C, 0xCC, 0x81, 0xCD, 0x03, 0x4C, + 0xCC, 0x8C, 0xCD, 0x03, 0x4C, 0xCC, 0xA7, 0xA9, + 0x03, 0x4C, 0xCC, 0xAD, 0xB9, 0x03, 0x4C, 0xCC, + // Bytes 3100 - 313f + 0xB1, 0xB9, 0x03, 0x4D, 0xCC, 0x81, 0xCD, 0x03, + 0x4D, 0xCC, 0x87, 0xCD, 0x03, 0x4D, 0xCC, 0xA3, + 0xB9, 0x03, 0x4E, 0xCC, 0x80, 0xCD, 0x03, 0x4E, + 0xCC, 0x81, 0xCD, 0x03, 0x4E, 0xCC, 0x83, 0xCD, + 0x03, 0x4E, 0xCC, 0x87, 0xCD, 0x03, 0x4E, 0xCC, + 0x8C, 0xCD, 0x03, 0x4E, 0xCC, 0xA3, 0xB9, 0x03, + 0x4E, 0xCC, 0xA7, 0xA9, 0x03, 0x4E, 0xCC, 0xAD, + 0xB9, 0x03, 0x4E, 0xCC, 0xB1, 0xB9, 0x03, 0x4F, + // Bytes 3140 - 317f + 0xCC, 0x80, 0xCD, 0x03, 0x4F, 0xCC, 0x81, 0xCD, + 0x03, 0x4F, 0xCC, 0x86, 0xCD, 0x03, 0x4F, 0xCC, + 0x89, 0xCD, 0x03, 0x4F, 0xCC, 0x8B, 0xCD, 0x03, + 0x4F, 0xCC, 0x8C, 0xCD, 0x03, 0x4F, 0xCC, 0x8F, + 0xCD, 0x03, 0x4F, 0xCC, 0x91, 0xCD, 0x03, 0x50, + 0xCC, 0x81, 0xCD, 0x03, 0x50, 0xCC, 0x87, 0xCD, + 0x03, 0x52, 0xCC, 0x81, 0xCD, 0x03, 0x52, 0xCC, + 0x87, 0xCD, 0x03, 0x52, 0xCC, 0x8C, 0xCD, 0x03, + // Bytes 3180 - 31bf + 0x52, 0xCC, 0x8F, 0xCD, 0x03, 0x52, 0xCC, 0x91, + 0xCD, 0x03, 0x52, 0xCC, 0xA7, 0xA9, 0x03, 0x52, + 0xCC, 0xB1, 0xB9, 0x03, 0x53, 0xCC, 0x82, 0xCD, + 0x03, 0x53, 0xCC, 0x87, 0xCD, 0x03, 0x53, 0xCC, + 0xA6, 0xB9, 0x03, 0x53, 0xCC, 0xA7, 0xA9, 0x03, + 0x54, 0xCC, 0x87, 0xCD, 0x03, 0x54, 0xCC, 0x8C, + 0xCD, 0x03, 0x54, 0xCC, 0xA3, 0xB9, 0x03, 0x54, + 0xCC, 0xA6, 0xB9, 0x03, 0x54, 0xCC, 0xA7, 0xA9, + // Bytes 31c0 - 31ff + 0x03, 0x54, 0xCC, 0xAD, 0xB9, 0x03, 0x54, 0xCC, + 0xB1, 0xB9, 0x03, 0x55, 0xCC, 0x80, 0xCD, 0x03, + 0x55, 0xCC, 0x81, 0xCD, 0x03, 0x55, 0xCC, 0x82, + 0xCD, 0x03, 0x55, 0xCC, 0x86, 0xCD, 0x03, 0x55, + 0xCC, 0x89, 0xCD, 0x03, 0x55, 0xCC, 0x8A, 0xCD, + 0x03, 0x55, 0xCC, 0x8B, 0xCD, 0x03, 0x55, 0xCC, + 0x8C, 0xCD, 0x03, 0x55, 0xCC, 0x8F, 0xCD, 0x03, + 0x55, 0xCC, 0x91, 0xCD, 0x03, 0x55, 0xCC, 0xA3, + // Bytes 3200 - 323f + 0xB9, 0x03, 0x55, 0xCC, 0xA4, 0xB9, 0x03, 0x55, + 0xCC, 0xA8, 0xA9, 0x03, 0x55, 0xCC, 0xAD, 0xB9, + 0x03, 0x55, 0xCC, 0xB0, 0xB9, 0x03, 0x56, 0xCC, + 0x83, 0xCD, 0x03, 0x56, 0xCC, 0xA3, 0xB9, 0x03, + 0x57, 0xCC, 0x80, 0xCD, 0x03, 0x57, 0xCC, 0x81, + 0xCD, 0x03, 0x57, 0xCC, 0x82, 0xCD, 0x03, 0x57, + 0xCC, 0x87, 0xCD, 0x03, 0x57, 0xCC, 0x88, 0xCD, + 0x03, 0x57, 0xCC, 0xA3, 0xB9, 0x03, 0x58, 0xCC, + // Bytes 3240 - 327f + 0x87, 0xCD, 0x03, 0x58, 0xCC, 0x88, 0xCD, 0x03, + 0x59, 0xCC, 0x80, 0xCD, 0x03, 0x59, 0xCC, 0x81, + 0xCD, 0x03, 0x59, 0xCC, 0x82, 0xCD, 0x03, 0x59, + 0xCC, 0x83, 0xCD, 0x03, 0x59, 0xCC, 0x84, 0xCD, + 0x03, 0x59, 0xCC, 0x87, 0xCD, 0x03, 0x59, 0xCC, + 0x88, 0xCD, 0x03, 0x59, 0xCC, 0x89, 0xCD, 0x03, + 0x59, 0xCC, 0xA3, 0xB9, 0x03, 0x5A, 0xCC, 0x81, + 0xCD, 0x03, 0x5A, 0xCC, 0x82, 0xCD, 0x03, 0x5A, + // Bytes 3280 - 32bf + 0xCC, 0x87, 0xCD, 0x03, 0x5A, 0xCC, 0x8C, 0xCD, + 0x03, 0x5A, 0xCC, 0xA3, 0xB9, 0x03, 0x5A, 0xCC, + 0xB1, 0xB9, 0x03, 0x61, 0xCC, 0x80, 0xCD, 0x03, + 0x61, 0xCC, 0x81, 0xCD, 0x03, 0x61, 0xCC, 0x83, + 0xCD, 0x03, 0x61, 0xCC, 0x84, 0xCD, 0x03, 0x61, + 0xCC, 0x89, 0xCD, 0x03, 0x61, 0xCC, 0x8C, 0xCD, + 0x03, 0x61, 0xCC, 0x8F, 0xCD, 0x03, 0x61, 0xCC, + 0x91, 0xCD, 0x03, 0x61, 0xCC, 0xA5, 0xB9, 0x03, + // Bytes 32c0 - 32ff + 0x61, 0xCC, 0xA8, 0xA9, 0x03, 0x62, 0xCC, 0x87, + 0xCD, 0x03, 0x62, 0xCC, 0xA3, 0xB9, 0x03, 0x62, + 0xCC, 0xB1, 0xB9, 0x03, 0x63, 0xCC, 0x81, 0xCD, + 0x03, 0x63, 0xCC, 0x82, 0xCD, 0x03, 0x63, 0xCC, + 0x87, 0xCD, 0x03, 0x63, 0xCC, 0x8C, 0xCD, 0x03, + 0x64, 0xCC, 0x87, 0xCD, 0x03, 0x64, 0xCC, 0x8C, + 0xCD, 0x03, 0x64, 0xCC, 0xA3, 0xB9, 0x03, 0x64, + 0xCC, 0xA7, 0xA9, 0x03, 0x64, 0xCC, 0xAD, 0xB9, + // Bytes 3300 - 333f + 0x03, 0x64, 0xCC, 0xB1, 0xB9, 0x03, 0x65, 0xCC, + 0x80, 0xCD, 0x03, 0x65, 0xCC, 0x81, 0xCD, 0x03, + 0x65, 0xCC, 0x83, 0xCD, 0x03, 0x65, 0xCC, 0x86, + 0xCD, 0x03, 0x65, 0xCC, 0x87, 0xCD, 0x03, 0x65, + 0xCC, 0x88, 0xCD, 0x03, 0x65, 0xCC, 0x89, 0xCD, + 0x03, 0x65, 0xCC, 0x8C, 0xCD, 0x03, 0x65, 0xCC, + 0x8F, 0xCD, 0x03, 0x65, 0xCC, 0x91, 0xCD, 0x03, + 0x65, 0xCC, 0xA8, 0xA9, 0x03, 0x65, 0xCC, 0xAD, + // Bytes 3340 - 337f + 0xB9, 0x03, 0x65, 0xCC, 0xB0, 0xB9, 0x03, 0x66, + 0xCC, 0x87, 0xCD, 0x03, 0x67, 0xCC, 0x81, 0xCD, + 0x03, 0x67, 0xCC, 0x82, 0xCD, 0x03, 0x67, 0xCC, + 0x84, 0xCD, 0x03, 0x67, 0xCC, 0x86, 0xCD, 0x03, + 0x67, 0xCC, 0x87, 0xCD, 0x03, 0x67, 0xCC, 0x8C, + 0xCD, 0x03, 0x67, 0xCC, 0xA7, 0xA9, 0x03, 0x68, + 0xCC, 0x82, 0xCD, 0x03, 0x68, 0xCC, 0x87, 0xCD, + 0x03, 0x68, 0xCC, 0x88, 0xCD, 0x03, 0x68, 0xCC, + // Bytes 3380 - 33bf + 0x8C, 0xCD, 0x03, 0x68, 0xCC, 0xA3, 0xB9, 0x03, + 0x68, 0xCC, 0xA7, 0xA9, 0x03, 0x68, 0xCC, 0xAE, + 0xB9, 0x03, 0x68, 0xCC, 0xB1, 0xB9, 0x03, 0x69, + 0xCC, 0x80, 0xCD, 0x03, 0x69, 0xCC, 0x81, 0xCD, + 0x03, 0x69, 0xCC, 0x82, 0xCD, 0x03, 0x69, 0xCC, + 0x83, 0xCD, 0x03, 0x69, 0xCC, 0x84, 0xCD, 0x03, + 0x69, 0xCC, 0x86, 0xCD, 0x03, 0x69, 0xCC, 0x89, + 0xCD, 0x03, 0x69, 0xCC, 0x8C, 0xCD, 0x03, 0x69, + // Bytes 33c0 - 33ff + 0xCC, 0x8F, 0xCD, 0x03, 0x69, 0xCC, 0x91, 0xCD, + 0x03, 0x69, 0xCC, 0xA3, 0xB9, 0x03, 0x69, 0xCC, + 0xA8, 0xA9, 0x03, 0x69, 0xCC, 0xB0, 0xB9, 0x03, + 0x6A, 0xCC, 0x82, 0xCD, 0x03, 0x6A, 0xCC, 0x8C, + 0xCD, 0x03, 0x6B, 0xCC, 0x81, 0xCD, 0x03, 0x6B, + 0xCC, 0x8C, 0xCD, 0x03, 0x6B, 0xCC, 0xA3, 0xB9, + 0x03, 0x6B, 0xCC, 0xA7, 0xA9, 0x03, 0x6B, 0xCC, + 0xB1, 0xB9, 0x03, 0x6C, 0xCC, 0x81, 0xCD, 0x03, + // Bytes 3400 - 343f + 0x6C, 0xCC, 0x8C, 0xCD, 0x03, 0x6C, 0xCC, 0xA7, + 0xA9, 0x03, 0x6C, 0xCC, 0xAD, 0xB9, 0x03, 0x6C, + 0xCC, 0xB1, 0xB9, 0x03, 0x6D, 0xCC, 0x81, 0xCD, + 0x03, 0x6D, 0xCC, 0x87, 0xCD, 0x03, 0x6D, 0xCC, + 0xA3, 0xB9, 0x03, 0x6E, 0xCC, 0x80, 0xCD, 0x03, + 0x6E, 0xCC, 0x81, 0xCD, 0x03, 0x6E, 0xCC, 0x83, + 0xCD, 0x03, 0x6E, 0xCC, 0x87, 0xCD, 0x03, 0x6E, + 0xCC, 0x8C, 0xCD, 0x03, 0x6E, 0xCC, 0xA3, 0xB9, + // Bytes 3440 - 347f + 0x03, 0x6E, 0xCC, 0xA7, 0xA9, 0x03, 0x6E, 0xCC, + 0xAD, 0xB9, 0x03, 0x6E, 0xCC, 0xB1, 0xB9, 0x03, + 0x6F, 0xCC, 0x80, 0xCD, 0x03, 0x6F, 0xCC, 0x81, + 0xCD, 0x03, 0x6F, 0xCC, 0x86, 0xCD, 0x03, 0x6F, + 0xCC, 0x89, 0xCD, 0x03, 0x6F, 0xCC, 0x8B, 0xCD, + 0x03, 0x6F, 0xCC, 0x8C, 0xCD, 0x03, 0x6F, 0xCC, + 0x8F, 0xCD, 0x03, 0x6F, 0xCC, 0x91, 0xCD, 0x03, + 0x70, 0xCC, 0x81, 0xCD, 0x03, 0x70, 0xCC, 0x87, + // Bytes 3480 - 34bf + 0xCD, 0x03, 0x72, 0xCC, 0x81, 0xCD, 0x03, 0x72, + 0xCC, 0x87, 0xCD, 0x03, 0x72, 0xCC, 0x8C, 0xCD, + 0x03, 0x72, 0xCC, 0x8F, 0xCD, 0x03, 0x72, 0xCC, + 0x91, 0xCD, 0x03, 0x72, 0xCC, 0xA7, 0xA9, 0x03, + 0x72, 0xCC, 0xB1, 0xB9, 0x03, 0x73, 0xCC, 0x82, + 0xCD, 0x03, 0x73, 0xCC, 0x87, 0xCD, 0x03, 0x73, + 0xCC, 0xA6, 0xB9, 0x03, 0x73, 0xCC, 0xA7, 0xA9, + 0x03, 0x74, 0xCC, 0x87, 0xCD, 0x03, 0x74, 0xCC, + // Bytes 34c0 - 34ff + 0x88, 0xCD, 0x03, 0x74, 0xCC, 0x8C, 0xCD, 0x03, + 0x74, 0xCC, 0xA3, 0xB9, 0x03, 0x74, 0xCC, 0xA6, + 0xB9, 0x03, 0x74, 0xCC, 0xA7, 0xA9, 0x03, 0x74, + 0xCC, 0xAD, 0xB9, 0x03, 0x74, 0xCC, 0xB1, 0xB9, + 0x03, 0x75, 0xCC, 0x80, 0xCD, 0x03, 0x75, 0xCC, + 0x81, 0xCD, 0x03, 0x75, 0xCC, 0x82, 0xCD, 0x03, + 0x75, 0xCC, 0x86, 0xCD, 0x03, 0x75, 0xCC, 0x89, + 0xCD, 0x03, 0x75, 0xCC, 0x8A, 0xCD, 0x03, 0x75, + // Bytes 3500 - 353f + 0xCC, 0x8B, 0xCD, 0x03, 0x75, 0xCC, 0x8C, 0xCD, + 0x03, 0x75, 0xCC, 0x8F, 0xCD, 0x03, 0x75, 0xCC, + 0x91, 0xCD, 0x03, 0x75, 0xCC, 0xA3, 0xB9, 0x03, + 0x75, 0xCC, 0xA4, 0xB9, 0x03, 0x75, 0xCC, 0xA8, + 0xA9, 0x03, 0x75, 0xCC, 0xAD, 0xB9, 0x03, 0x75, + 0xCC, 0xB0, 0xB9, 0x03, 0x76, 0xCC, 0x83, 0xCD, + 0x03, 0x76, 0xCC, 0xA3, 0xB9, 0x03, 0x77, 0xCC, + 0x80, 0xCD, 0x03, 0x77, 0xCC, 0x81, 0xCD, 0x03, + // Bytes 3540 - 357f + 0x77, 0xCC, 0x82, 0xCD, 0x03, 0x77, 0xCC, 0x87, + 0xCD, 0x03, 0x77, 0xCC, 0x88, 0xCD, 0x03, 0x77, + 0xCC, 0x8A, 0xCD, 0x03, 0x77, 0xCC, 0xA3, 0xB9, + 0x03, 0x78, 0xCC, 0x87, 0xCD, 0x03, 0x78, 0xCC, + 0x88, 0xCD, 0x03, 0x79, 0xCC, 0x80, 0xCD, 0x03, + 0x79, 0xCC, 0x81, 0xCD, 0x03, 0x79, 0xCC, 0x82, + 0xCD, 0x03, 0x79, 0xCC, 0x83, 0xCD, 0x03, 0x79, + 0xCC, 0x84, 0xCD, 0x03, 0x79, 0xCC, 0x87, 0xCD, + // Bytes 3580 - 35bf + 0x03, 0x79, 0xCC, 0x88, 0xCD, 0x03, 0x79, 0xCC, + 0x89, 0xCD, 0x03, 0x79, 0xCC, 0x8A, 0xCD, 0x03, + 0x79, 0xCC, 0xA3, 0xB9, 0x03, 0x7A, 0xCC, 0x81, + 0xCD, 0x03, 0x7A, 0xCC, 0x82, 0xCD, 0x03, 0x7A, + 0xCC, 0x87, 0xCD, 0x03, 0x7A, 0xCC, 0x8C, 0xCD, + 0x03, 0x7A, 0xCC, 0xA3, 0xB9, 0x03, 0x7A, 0xCC, + 0xB1, 0xB9, 0x04, 0xC2, 0xA8, 0xCC, 0x80, 0xCE, + 0x04, 0xC2, 0xA8, 0xCC, 0x81, 0xCE, 0x04, 0xC2, + // Bytes 35c0 - 35ff + 0xA8, 0xCD, 0x82, 0xCE, 0x04, 0xC3, 0x86, 0xCC, + 0x81, 0xCD, 0x04, 0xC3, 0x86, 0xCC, 0x84, 0xCD, + 0x04, 0xC3, 0x98, 0xCC, 0x81, 0xCD, 0x04, 0xC3, + 0xA6, 0xCC, 0x81, 0xCD, 0x04, 0xC3, 0xA6, 0xCC, + 0x84, 0xCD, 0x04, 0xC3, 0xB8, 0xCC, 0x81, 0xCD, + 0x04, 0xC5, 0xBF, 0xCC, 0x87, 0xCD, 0x04, 0xC6, + 0xB7, 0xCC, 0x8C, 0xCD, 0x04, 0xCA, 0x92, 0xCC, + 0x8C, 0xCD, 0x04, 0xCE, 0x91, 0xCC, 0x80, 0xCD, + // Bytes 3600 - 363f + 0x04, 0xCE, 0x91, 0xCC, 0x81, 0xCD, 0x04, 0xCE, + 0x91, 0xCC, 0x84, 0xCD, 0x04, 0xCE, 0x91, 0xCC, + 0x86, 0xCD, 0x04, 0xCE, 0x91, 0xCD, 0x85, 0xDD, + 0x04, 0xCE, 0x95, 0xCC, 0x80, 0xCD, 0x04, 0xCE, + 0x95, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0x97, 0xCC, + 0x80, 0xCD, 0x04, 0xCE, 0x97, 0xCC, 0x81, 0xCD, + 0x04, 0xCE, 0x97, 0xCD, 0x85, 0xDD, 0x04, 0xCE, + 0x99, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0x99, 0xCC, + // Bytes 3640 - 367f + 0x81, 0xCD, 0x04, 0xCE, 0x99, 0xCC, 0x84, 0xCD, + 0x04, 0xCE, 0x99, 0xCC, 0x86, 0xCD, 0x04, 0xCE, + 0x99, 0xCC, 0x88, 0xCD, 0x04, 0xCE, 0x9F, 0xCC, + 0x80, 0xCD, 0x04, 0xCE, 0x9F, 0xCC, 0x81, 0xCD, + 0x04, 0xCE, 0xA1, 0xCC, 0x94, 0xCD, 0x04, 0xCE, + 0xA5, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0xA5, 0xCC, + 0x81, 0xCD, 0x04, 0xCE, 0xA5, 0xCC, 0x84, 0xCD, + 0x04, 0xCE, 0xA5, 0xCC, 0x86, 0xCD, 0x04, 0xCE, + // Bytes 3680 - 36bf + 0xA5, 0xCC, 0x88, 0xCD, 0x04, 0xCE, 0xA9, 0xCC, + 0x80, 0xCD, 0x04, 0xCE, 0xA9, 0xCC, 0x81, 0xCD, + 0x04, 0xCE, 0xA9, 0xCD, 0x85, 0xDD, 0x04, 0xCE, + 0xB1, 0xCC, 0x84, 0xCD, 0x04, 0xCE, 0xB1, 0xCC, + 0x86, 0xCD, 0x04, 0xCE, 0xB1, 0xCD, 0x85, 0xDD, + 0x04, 0xCE, 0xB5, 0xCC, 0x80, 0xCD, 0x04, 0xCE, + 0xB5, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0xB7, 0xCD, + 0x85, 0xDD, 0x04, 0xCE, 0xB9, 0xCC, 0x80, 0xCD, + // Bytes 36c0 - 36ff + 0x04, 0xCE, 0xB9, 0xCC, 0x81, 0xCD, 0x04, 0xCE, + 0xB9, 0xCC, 0x84, 0xCD, 0x04, 0xCE, 0xB9, 0xCC, + 0x86, 0xCD, 0x04, 0xCE, 0xB9, 0xCD, 0x82, 0xCD, + 0x04, 0xCE, 0xBF, 0xCC, 0x80, 0xCD, 0x04, 0xCE, + 0xBF, 0xCC, 0x81, 0xCD, 0x04, 0xCF, 0x81, 0xCC, + 0x93, 0xCD, 0x04, 0xCF, 0x81, 0xCC, 0x94, 0xCD, + 0x04, 0xCF, 0x85, 0xCC, 0x80, 0xCD, 0x04, 0xCF, + 0x85, 0xCC, 0x81, 0xCD, 0x04, 0xCF, 0x85, 0xCC, + // Bytes 3700 - 373f + 0x84, 0xCD, 0x04, 0xCF, 0x85, 0xCC, 0x86, 0xCD, + 0x04, 0xCF, 0x85, 0xCD, 0x82, 0xCD, 0x04, 0xCF, + 0x89, 0xCD, 0x85, 0xDD, 0x04, 0xCF, 0x92, 0xCC, + 0x81, 0xCD, 0x04, 0xCF, 0x92, 0xCC, 0x88, 0xCD, + 0x04, 0xD0, 0x86, 0xCC, 0x88, 0xCD, 0x04, 0xD0, + 0x90, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0x90, 0xCC, + 0x88, 0xCD, 0x04, 0xD0, 0x93, 0xCC, 0x81, 0xCD, + 0x04, 0xD0, 0x95, 0xCC, 0x80, 0xCD, 0x04, 0xD0, + // Bytes 3740 - 377f + 0x95, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0x95, 0xCC, + 0x88, 0xCD, 0x04, 0xD0, 0x96, 0xCC, 0x86, 0xCD, + 0x04, 0xD0, 0x96, 0xCC, 0x88, 0xCD, 0x04, 0xD0, + 0x97, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x98, 0xCC, + 0x80, 0xCD, 0x04, 0xD0, 0x98, 0xCC, 0x84, 0xCD, + 0x04, 0xD0, 0x98, 0xCC, 0x86, 0xCD, 0x04, 0xD0, + 0x98, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x9A, 0xCC, + 0x81, 0xCD, 0x04, 0xD0, 0x9E, 0xCC, 0x88, 0xCD, + // Bytes 3780 - 37bf + 0x04, 0xD0, 0xA3, 0xCC, 0x84, 0xCD, 0x04, 0xD0, + 0xA3, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0xA3, 0xCC, + 0x88, 0xCD, 0x04, 0xD0, 0xA3, 0xCC, 0x8B, 0xCD, + 0x04, 0xD0, 0xA7, 0xCC, 0x88, 0xCD, 0x04, 0xD0, + 0xAB, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xAD, 0xCC, + 0x88, 0xCD, 0x04, 0xD0, 0xB0, 0xCC, 0x86, 0xCD, + 0x04, 0xD0, 0xB0, 0xCC, 0x88, 0xCD, 0x04, 0xD0, + 0xB3, 0xCC, 0x81, 0xCD, 0x04, 0xD0, 0xB5, 0xCC, + // Bytes 37c0 - 37ff + 0x80, 0xCD, 0x04, 0xD0, 0xB5, 0xCC, 0x86, 0xCD, + 0x04, 0xD0, 0xB5, 0xCC, 0x88, 0xCD, 0x04, 0xD0, + 0xB6, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0xB6, 0xCC, + 0x88, 0xCD, 0x04, 0xD0, 0xB7, 0xCC, 0x88, 0xCD, + 0x04, 0xD0, 0xB8, 0xCC, 0x80, 0xCD, 0x04, 0xD0, + 0xB8, 0xCC, 0x84, 0xCD, 0x04, 0xD0, 0xB8, 0xCC, + 0x86, 0xCD, 0x04, 0xD0, 0xB8, 0xCC, 0x88, 0xCD, + 0x04, 0xD0, 0xBA, 0xCC, 0x81, 0xCD, 0x04, 0xD0, + // Bytes 3800 - 383f + 0xBE, 0xCC, 0x88, 0xCD, 0x04, 0xD1, 0x83, 0xCC, + 0x84, 0xCD, 0x04, 0xD1, 0x83, 0xCC, 0x86, 0xCD, + 0x04, 0xD1, 0x83, 0xCC, 0x88, 0xCD, 0x04, 0xD1, + 0x83, 0xCC, 0x8B, 0xCD, 0x04, 0xD1, 0x87, 0xCC, + 0x88, 0xCD, 0x04, 0xD1, 0x8B, 0xCC, 0x88, 0xCD, + 0x04, 0xD1, 0x8D, 0xCC, 0x88, 0xCD, 0x04, 0xD1, + 0x96, 0xCC, 0x88, 0xCD, 0x04, 0xD1, 0xB4, 0xCC, + 0x8F, 0xCD, 0x04, 0xD1, 0xB5, 0xCC, 0x8F, 0xCD, + // Bytes 3840 - 387f + 0x04, 0xD3, 0x98, 0xCC, 0x88, 0xCD, 0x04, 0xD3, + 0x99, 0xCC, 0x88, 0xCD, 0x04, 0xD3, 0xA8, 0xCC, + 0x88, 0xCD, 0x04, 0xD3, 0xA9, 0xCC, 0x88, 0xCD, + 0x04, 0xD8, 0xA7, 0xD9, 0x93, 0xCD, 0x04, 0xD8, + 0xA7, 0xD9, 0x94, 0xCD, 0x04, 0xD8, 0xA7, 0xD9, + 0x95, 0xB9, 0x04, 0xD9, 0x88, 0xD9, 0x94, 0xCD, + 0x04, 0xD9, 0x8A, 0xD9, 0x94, 0xCD, 0x04, 0xDB, + 0x81, 0xD9, 0x94, 0xCD, 0x04, 0xDB, 0x92, 0xD9, + // Bytes 3880 - 38bf + 0x94, 0xCD, 0x04, 0xDB, 0x95, 0xD9, 0x94, 0xCD, + 0x05, 0x41, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, + 0x41, 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x41, + 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x41, 0xCC, + 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x41, 0xCC, 0x86, + 0xCC, 0x80, 0xCE, 0x05, 0x41, 0xCC, 0x86, 0xCC, + 0x81, 0xCE, 0x05, 0x41, 0xCC, 0x86, 0xCC, 0x83, + 0xCE, 0x05, 0x41, 0xCC, 0x86, 0xCC, 0x89, 0xCE, + // Bytes 38c0 - 38ff + 0x05, 0x41, 0xCC, 0x87, 0xCC, 0x84, 0xCE, 0x05, + 0x41, 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x41, + 0xCC, 0x8A, 0xCC, 0x81, 0xCE, 0x05, 0x41, 0xCC, + 0xA3, 0xCC, 0x82, 0xCE, 0x05, 0x41, 0xCC, 0xA3, + 0xCC, 0x86, 0xCE, 0x05, 0x43, 0xCC, 0xA7, 0xCC, + 0x81, 0xCE, 0x05, 0x45, 0xCC, 0x82, 0xCC, 0x80, + 0xCE, 0x05, 0x45, 0xCC, 0x82, 0xCC, 0x81, 0xCE, + 0x05, 0x45, 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, + // Bytes 3900 - 393f + 0x45, 0xCC, 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x45, + 0xCC, 0x84, 0xCC, 0x80, 0xCE, 0x05, 0x45, 0xCC, + 0x84, 0xCC, 0x81, 0xCE, 0x05, 0x45, 0xCC, 0xA3, + 0xCC, 0x82, 0xCE, 0x05, 0x45, 0xCC, 0xA7, 0xCC, + 0x86, 0xCE, 0x05, 0x49, 0xCC, 0x88, 0xCC, 0x81, + 0xCE, 0x05, 0x4C, 0xCC, 0xA3, 0xCC, 0x84, 0xCE, + 0x05, 0x4F, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, + 0x4F, 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x4F, + // Bytes 3940 - 397f + 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x4F, 0xCC, + 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x4F, 0xCC, 0x83, + 0xCC, 0x81, 0xCE, 0x05, 0x4F, 0xCC, 0x83, 0xCC, + 0x84, 0xCE, 0x05, 0x4F, 0xCC, 0x83, 0xCC, 0x88, + 0xCE, 0x05, 0x4F, 0xCC, 0x84, 0xCC, 0x80, 0xCE, + 0x05, 0x4F, 0xCC, 0x84, 0xCC, 0x81, 0xCE, 0x05, + 0x4F, 0xCC, 0x87, 0xCC, 0x84, 0xCE, 0x05, 0x4F, + 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x4F, 0xCC, + // Bytes 3980 - 39bf + 0x9B, 0xCC, 0x80, 0xCE, 0x05, 0x4F, 0xCC, 0x9B, + 0xCC, 0x81, 0xCE, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, + 0x83, 0xCE, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, 0x89, + 0xCE, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, 0xA3, 0xBA, + 0x05, 0x4F, 0xCC, 0xA3, 0xCC, 0x82, 0xCE, 0x05, + 0x4F, 0xCC, 0xA8, 0xCC, 0x84, 0xCE, 0x05, 0x52, + 0xCC, 0xA3, 0xCC, 0x84, 0xCE, 0x05, 0x53, 0xCC, + 0x81, 0xCC, 0x87, 0xCE, 0x05, 0x53, 0xCC, 0x8C, + // Bytes 39c0 - 39ff + 0xCC, 0x87, 0xCE, 0x05, 0x53, 0xCC, 0xA3, 0xCC, + 0x87, 0xCE, 0x05, 0x55, 0xCC, 0x83, 0xCC, 0x81, + 0xCE, 0x05, 0x55, 0xCC, 0x84, 0xCC, 0x88, 0xCE, + 0x05, 0x55, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x05, + 0x55, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x05, 0x55, + 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x55, 0xCC, + 0x88, 0xCC, 0x8C, 0xCE, 0x05, 0x55, 0xCC, 0x9B, + 0xCC, 0x80, 0xCE, 0x05, 0x55, 0xCC, 0x9B, 0xCC, + // Bytes 3a00 - 3a3f + 0x81, 0xCE, 0x05, 0x55, 0xCC, 0x9B, 0xCC, 0x83, + 0xCE, 0x05, 0x55, 0xCC, 0x9B, 0xCC, 0x89, 0xCE, + 0x05, 0x55, 0xCC, 0x9B, 0xCC, 0xA3, 0xBA, 0x05, + 0x61, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, 0x61, + 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x61, 0xCC, + 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x61, 0xCC, 0x82, + 0xCC, 0x89, 0xCE, 0x05, 0x61, 0xCC, 0x86, 0xCC, + 0x80, 0xCE, 0x05, 0x61, 0xCC, 0x86, 0xCC, 0x81, + // Bytes 3a40 - 3a7f + 0xCE, 0x05, 0x61, 0xCC, 0x86, 0xCC, 0x83, 0xCE, + 0x05, 0x61, 0xCC, 0x86, 0xCC, 0x89, 0xCE, 0x05, + 0x61, 0xCC, 0x87, 0xCC, 0x84, 0xCE, 0x05, 0x61, + 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x61, 0xCC, + 0x8A, 0xCC, 0x81, 0xCE, 0x05, 0x61, 0xCC, 0xA3, + 0xCC, 0x82, 0xCE, 0x05, 0x61, 0xCC, 0xA3, 0xCC, + 0x86, 0xCE, 0x05, 0x63, 0xCC, 0xA7, 0xCC, 0x81, + 0xCE, 0x05, 0x65, 0xCC, 0x82, 0xCC, 0x80, 0xCE, + // Bytes 3a80 - 3abf + 0x05, 0x65, 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, + 0x65, 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x65, + 0xCC, 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x65, 0xCC, + 0x84, 0xCC, 0x80, 0xCE, 0x05, 0x65, 0xCC, 0x84, + 0xCC, 0x81, 0xCE, 0x05, 0x65, 0xCC, 0xA3, 0xCC, + 0x82, 0xCE, 0x05, 0x65, 0xCC, 0xA7, 0xCC, 0x86, + 0xCE, 0x05, 0x69, 0xCC, 0x88, 0xCC, 0x81, 0xCE, + 0x05, 0x6C, 0xCC, 0xA3, 0xCC, 0x84, 0xCE, 0x05, + // Bytes 3ac0 - 3aff + 0x6F, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, 0x6F, + 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x6F, 0xCC, + 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x6F, 0xCC, 0x82, + 0xCC, 0x89, 0xCE, 0x05, 0x6F, 0xCC, 0x83, 0xCC, + 0x81, 0xCE, 0x05, 0x6F, 0xCC, 0x83, 0xCC, 0x84, + 0xCE, 0x05, 0x6F, 0xCC, 0x83, 0xCC, 0x88, 0xCE, + 0x05, 0x6F, 0xCC, 0x84, 0xCC, 0x80, 0xCE, 0x05, + 0x6F, 0xCC, 0x84, 0xCC, 0x81, 0xCE, 0x05, 0x6F, + // Bytes 3b00 - 3b3f + 0xCC, 0x87, 0xCC, 0x84, 0xCE, 0x05, 0x6F, 0xCC, + 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x6F, 0xCC, 0x9B, + 0xCC, 0x80, 0xCE, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, + 0x81, 0xCE, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0x83, + 0xCE, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0x89, 0xCE, + 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0xA3, 0xBA, 0x05, + 0x6F, 0xCC, 0xA3, 0xCC, 0x82, 0xCE, 0x05, 0x6F, + 0xCC, 0xA8, 0xCC, 0x84, 0xCE, 0x05, 0x72, 0xCC, + // Bytes 3b40 - 3b7f + 0xA3, 0xCC, 0x84, 0xCE, 0x05, 0x73, 0xCC, 0x81, + 0xCC, 0x87, 0xCE, 0x05, 0x73, 0xCC, 0x8C, 0xCC, + 0x87, 0xCE, 0x05, 0x73, 0xCC, 0xA3, 0xCC, 0x87, + 0xCE, 0x05, 0x75, 0xCC, 0x83, 0xCC, 0x81, 0xCE, + 0x05, 0x75, 0xCC, 0x84, 0xCC, 0x88, 0xCE, 0x05, + 0x75, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x05, 0x75, + 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x05, 0x75, 0xCC, + 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x75, 0xCC, 0x88, + // Bytes 3b80 - 3bbf + 0xCC, 0x8C, 0xCE, 0x05, 0x75, 0xCC, 0x9B, 0xCC, + 0x80, 0xCE, 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x81, + 0xCE, 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x83, 0xCE, + 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x89, 0xCE, 0x05, + 0x75, 0xCC, 0x9B, 0xCC, 0xA3, 0xBA, 0x05, 0xE1, + 0xBE, 0xBF, 0xCC, 0x80, 0xCE, 0x05, 0xE1, 0xBE, + 0xBF, 0xCC, 0x81, 0xCE, 0x05, 0xE1, 0xBE, 0xBF, + 0xCD, 0x82, 0xCE, 0x05, 0xE1, 0xBF, 0xBE, 0xCC, + // Bytes 3bc0 - 3bff + 0x80, 0xCE, 0x05, 0xE1, 0xBF, 0xBE, 0xCC, 0x81, + 0xCE, 0x05, 0xE1, 0xBF, 0xBE, 0xCD, 0x82, 0xCE, + 0x05, 0xE2, 0x86, 0x90, 0xCC, 0xB8, 0x05, 0x05, + 0xE2, 0x86, 0x92, 0xCC, 0xB8, 0x05, 0x05, 0xE2, + 0x86, 0x94, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x87, + 0x90, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x87, 0x92, + 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x87, 0x94, 0xCC, + 0xB8, 0x05, 0x05, 0xE2, 0x88, 0x83, 0xCC, 0xB8, + // Bytes 3c00 - 3c3f + 0x05, 0x05, 0xE2, 0x88, 0x88, 0xCC, 0xB8, 0x05, + 0x05, 0xE2, 0x88, 0x8B, 0xCC, 0xB8, 0x05, 0x05, + 0xE2, 0x88, 0xA3, 0xCC, 0xB8, 0x05, 0x05, 0xE2, + 0x88, 0xA5, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x88, + 0xBC, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0x83, + 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0x85, 0xCC, + 0xB8, 0x05, 0x05, 0xE2, 0x89, 0x88, 0xCC, 0xB8, + 0x05, 0x05, 0xE2, 0x89, 0x8D, 0xCC, 0xB8, 0x05, + // Bytes 3c40 - 3c7f + 0x05, 0xE2, 0x89, 0xA1, 0xCC, 0xB8, 0x05, 0x05, + 0xE2, 0x89, 0xA4, 0xCC, 0xB8, 0x05, 0x05, 0xE2, + 0x89, 0xA5, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, + 0xB2, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xB3, + 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xB6, 0xCC, + 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xB7, 0xCC, 0xB8, + 0x05, 0x05, 0xE2, 0x89, 0xBA, 0xCC, 0xB8, 0x05, + 0x05, 0xE2, 0x89, 0xBB, 0xCC, 0xB8, 0x05, 0x05, + // Bytes 3c80 - 3cbf + 0xE2, 0x89, 0xBC, 0xCC, 0xB8, 0x05, 0x05, 0xE2, + 0x89, 0xBD, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, + 0x82, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x83, + 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x86, 0xCC, + 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x87, 0xCC, 0xB8, + 0x05, 0x05, 0xE2, 0x8A, 0x91, 0xCC, 0xB8, 0x05, + 0x05, 0xE2, 0x8A, 0x92, 0xCC, 0xB8, 0x05, 0x05, + 0xE2, 0x8A, 0xA2, 0xCC, 0xB8, 0x05, 0x05, 0xE2, + // Bytes 3cc0 - 3cff + 0x8A, 0xA8, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, + 0xA9, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xAB, + 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xB2, 0xCC, + 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xB3, 0xCC, 0xB8, + 0x05, 0x05, 0xE2, 0x8A, 0xB4, 0xCC, 0xB8, 0x05, + 0x05, 0xE2, 0x8A, 0xB5, 0xCC, 0xB8, 0x05, 0x06, + 0xCE, 0x91, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, + 0xCE, 0x91, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, + // Bytes 3d00 - 3d3f + 0xCE, 0x95, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, + 0xCE, 0x95, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, + 0xCE, 0x95, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, + 0xCE, 0x95, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, + 0xCE, 0x97, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, + 0xCE, 0x97, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, + 0xCE, 0x99, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, + 0xCE, 0x99, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, + // Bytes 3d40 - 3d7f + 0xCE, 0x99, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x06, + 0xCE, 0x99, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, + 0xCE, 0x99, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, + 0xCE, 0x99, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x06, + 0xCE, 0x9F, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, + 0xCE, 0x9F, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, + 0xCE, 0x9F, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, + 0xCE, 0x9F, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, + // Bytes 3d80 - 3dbf + 0xCE, 0xA5, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, + 0xCE, 0xA5, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, + 0xCE, 0xA5, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x06, + 0xCE, 0xA9, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, + 0xCE, 0xA9, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, + 0xCE, 0xB1, 0xCC, 0x80, 0xCD, 0x85, 0xDE, 0x06, + 0xCE, 0xB1, 0xCC, 0x81, 0xCD, 0x85, 0xDE, 0x06, + 0xCE, 0xB1, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, + // Bytes 3dc0 - 3dff + 0xCE, 0xB1, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, + 0xCE, 0xB1, 0xCD, 0x82, 0xCD, 0x85, 0xDE, 0x06, + 0xCE, 0xB5, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, + 0xCE, 0xB5, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, + 0xCE, 0xB5, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, + 0xCE, 0xB5, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, + 0xCE, 0xB7, 0xCC, 0x80, 0xCD, 0x85, 0xDE, 0x06, + 0xCE, 0xB7, 0xCC, 0x81, 0xCD, 0x85, 0xDE, 0x06, + // Bytes 3e00 - 3e3f + 0xCE, 0xB7, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, + 0xCE, 0xB7, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, + 0xCE, 0xB7, 0xCD, 0x82, 0xCD, 0x85, 0xDE, 0x06, + 0xCE, 0xB9, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x06, + 0xCE, 0xB9, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x06, + 0xCE, 0xB9, 0xCC, 0x88, 0xCD, 0x82, 0xCE, 0x06, + 0xCE, 0xB9, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, + 0xCE, 0xB9, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, + // Bytes 3e40 - 3e7f + 0xCE, 0xB9, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x06, + 0xCE, 0xB9, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, + 0xCE, 0xB9, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, + 0xCE, 0xB9, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x06, + 0xCE, 0xBF, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, + 0xCE, 0xBF, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, + 0xCE, 0xBF, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, + 0xCE, 0xBF, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, + // Bytes 3e80 - 3ebf + 0xCF, 0x85, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x06, + 0xCF, 0x85, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x06, + 0xCF, 0x85, 0xCC, 0x88, 0xCD, 0x82, 0xCE, 0x06, + 0xCF, 0x85, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, + 0xCF, 0x85, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, + 0xCF, 0x85, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x06, + 0xCF, 0x85, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, + 0xCF, 0x85, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, + // Bytes 3ec0 - 3eff + 0xCF, 0x85, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x06, + 0xCF, 0x89, 0xCC, 0x80, 0xCD, 0x85, 0xDE, 0x06, + 0xCF, 0x89, 0xCC, 0x81, 0xCD, 0x85, 0xDE, 0x06, + 0xCF, 0x89, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, + 0xCF, 0x89, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, + 0xCF, 0x89, 0xCD, 0x82, 0xCD, 0x85, 0xDE, 0x06, + 0xE0, 0xA4, 0xA8, 0xE0, 0xA4, 0xBC, 0x0D, 0x06, + 0xE0, 0xA4, 0xB0, 0xE0, 0xA4, 0xBC, 0x0D, 0x06, + // Bytes 3f00 - 3f3f + 0xE0, 0xA4, 0xB3, 0xE0, 0xA4, 0xBC, 0x0D, 0x06, + 0xE0, 0xB1, 0x86, 0xE0, 0xB1, 0x96, 0x89, 0x06, + 0xE0, 0xB7, 0x99, 0xE0, 0xB7, 0x8A, 0x15, 0x06, + 0xE3, 0x81, 0x86, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0x8B, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0x8D, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0x8F, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0x91, 0xE3, 0x82, 0x99, 0x11, 0x06, + // Bytes 3f40 - 3f7f + 0xE3, 0x81, 0x93, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0x95, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0x97, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0x99, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0x9B, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0x9D, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0x9F, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0xA1, 0xE3, 0x82, 0x99, 0x11, 0x06, + // Bytes 3f80 - 3fbf + 0xE3, 0x81, 0xA4, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0xA6, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0xA8, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0xAF, 0xE3, 0x82, 0x9A, 0x11, 0x06, + 0xE3, 0x81, 0xB2, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0xB2, 0xE3, 0x82, 0x9A, 0x11, 0x06, + 0xE3, 0x81, 0xB5, 0xE3, 0x82, 0x99, 0x11, 0x06, + // Bytes 3fc0 - 3fff + 0xE3, 0x81, 0xB5, 0xE3, 0x82, 0x9A, 0x11, 0x06, + 0xE3, 0x81, 0xB8, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0xB8, 0xE3, 0x82, 0x9A, 0x11, 0x06, + 0xE3, 0x81, 0xBB, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x81, 0xBB, 0xE3, 0x82, 0x9A, 0x11, 0x06, + 0xE3, 0x82, 0x9D, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x82, 0xA6, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0x11, 0x06, + // Bytes 4000 - 403f + 0xE3, 0x82, 0xAD, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x82, 0xB1, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x82, 0xB3, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x82, 0xB5, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x82, 0xB7, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x82, 0xB9, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x82, 0xBB, 0xE3, 0x82, 0x99, 0x11, 0x06, + // Bytes 4040 - 407f + 0xE3, 0x82, 0xBD, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x82, 0xBF, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x83, 0x81, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x83, 0x84, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x83, 0x86, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x9A, 0x11, 0x06, + // Bytes 4080 - 40bf + 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x9A, 0x11, 0x06, + 0xE3, 0x83, 0x95, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x83, 0x95, 0xE3, 0x82, 0x9A, 0x11, 0x06, + 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0x11, 0x06, + 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x9A, 0x11, 0x06, + // Bytes 40c0 - 40ff + 0xE3, 0x83, 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x83, 0xB0, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x83, 0xB1, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x83, 0xB2, 0xE3, 0x82, 0x99, 0x11, 0x06, + 0xE3, 0x83, 0xBD, 0xE3, 0x82, 0x99, 0x11, 0x08, + 0xCE, 0x91, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, + 0xDF, 0x08, 0xCE, 0x91, 0xCC, 0x93, 0xCC, 0x81, + 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x91, 0xCC, 0x93, + // Bytes 4100 - 413f + 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x91, + 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, + 0xCE, 0x91, 0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, + 0xDF, 0x08, 0xCE, 0x91, 0xCC, 0x94, 0xCD, 0x82, + 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, 0xCC, 0x93, + 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, + 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, + 0xCE, 0x97, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, + // Bytes 4140 - 417f + 0xDF, 0x08, 0xCE, 0x97, 0xCC, 0x94, 0xCC, 0x80, + 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, 0xCC, 0x94, + 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, + 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, + 0xCE, 0xA9, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, + 0xDF, 0x08, 0xCE, 0xA9, 0xCC, 0x93, 0xCC, 0x81, + 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xA9, 0xCC, 0x93, + 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xA9, + // Bytes 4180 - 41bf + 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, + 0xCE, 0xA9, 0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, + 0xDF, 0x08, 0xCE, 0xA9, 0xCC, 0x94, 0xCD, 0x82, + 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x93, + 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, + 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, + 0xCE, 0xB1, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, + 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x94, 0xCC, 0x80, + // Bytes 41c0 - 41ff + 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x94, + 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, + 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, + 0xCE, 0xB7, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, + 0xDF, 0x08, 0xCE, 0xB7, 0xCC, 0x93, 0xCC, 0x81, + 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB7, 0xCC, 0x93, + 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB7, + 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, + // Bytes 4200 - 423f + 0xCE, 0xB7, 0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, + 0xDF, 0x08, 0xCE, 0xB7, 0xCC, 0x94, 0xCD, 0x82, + 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, 0xCC, 0x93, + 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, + 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, + 0xCF, 0x89, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, + 0xDF, 0x08, 0xCF, 0x89, 0xCC, 0x94, 0xCC, 0x80, + 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, 0xCC, 0x94, + // Bytes 4240 - 427f + 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, + 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, + 0xF0, 0x91, 0x82, 0x99, 0xF0, 0x91, 0x82, 0xBA, + 0x0D, 0x08, 0xF0, 0x91, 0x82, 0x9B, 0xF0, 0x91, + 0x82, 0xBA, 0x0D, 0x08, 0xF0, 0x91, 0x82, 0xA5, + 0xF0, 0x91, 0x82, 0xBA, 0x0D, 0x42, 0xC2, 0xB4, + 0x01, 0x43, 0x20, 0xCC, 0x81, 0xCD, 0x43, 0x20, + 0xCC, 0x83, 0xCD, 0x43, 0x20, 0xCC, 0x84, 0xCD, + // Bytes 4280 - 42bf + 0x43, 0x20, 0xCC, 0x85, 0xCD, 0x43, 0x20, 0xCC, + 0x86, 0xCD, 0x43, 0x20, 0xCC, 0x87, 0xCD, 0x43, + 0x20, 0xCC, 0x88, 0xCD, 0x43, 0x20, 0xCC, 0x8A, + 0xCD, 0x43, 0x20, 0xCC, 0x8B, 0xCD, 0x43, 0x20, + 0xCC, 0x93, 0xCD, 0x43, 0x20, 0xCC, 0x94, 0xCD, + 0x43, 0x20, 0xCC, 0xA7, 0xA9, 0x43, 0x20, 0xCC, + 0xA8, 0xA9, 0x43, 0x20, 0xCC, 0xB3, 0xB9, 0x43, + 0x20, 0xCD, 0x82, 0xCD, 0x43, 0x20, 0xCD, 0x85, + // Bytes 42c0 - 42ff + 0xDD, 0x43, 0x20, 0xD9, 0x8B, 0x5D, 0x43, 0x20, + 0xD9, 0x8C, 0x61, 0x43, 0x20, 0xD9, 0x8D, 0x65, + 0x43, 0x20, 0xD9, 0x8E, 0x69, 0x43, 0x20, 0xD9, + 0x8F, 0x6D, 0x43, 0x20, 0xD9, 0x90, 0x71, 0x43, + 0x20, 0xD9, 0x91, 0x75, 0x43, 0x20, 0xD9, 0x92, + 0x79, 0x43, 0x41, 0xCC, 0x8A, 0xCD, 0x43, 0x73, + 0xCC, 0x87, 0xCD, 0x44, 0x20, 0xE3, 0x82, 0x99, + 0x11, 0x44, 0x20, 0xE3, 0x82, 0x9A, 0x11, 0x44, + // Bytes 4300 - 433f + 0xC2, 0xA8, 0xCC, 0x81, 0xCE, 0x44, 0xCE, 0x91, + 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0x95, 0xCC, 0x81, + 0xCD, 0x44, 0xCE, 0x97, 0xCC, 0x81, 0xCD, 0x44, + 0xCE, 0x99, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0x9F, + 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xA5, 0xCC, 0x81, + 0xCD, 0x44, 0xCE, 0xA5, 0xCC, 0x88, 0xCD, 0x44, + 0xCE, 0xA9, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xB1, + 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xB5, 0xCC, 0x81, + // Bytes 4340 - 437f + 0xCD, 0x44, 0xCE, 0xB7, 0xCC, 0x81, 0xCD, 0x44, + 0xCE, 0xB9, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xBF, + 0xCC, 0x81, 0xCD, 0x44, 0xCF, 0x85, 0xCC, 0x81, + 0xCD, 0x44, 0xCF, 0x89, 0xCC, 0x81, 0xCD, 0x44, + 0xD7, 0x90, 0xD6, 0xB7, 0x35, 0x44, 0xD7, 0x90, + 0xD6, 0xB8, 0x39, 0x44, 0xD7, 0x90, 0xD6, 0xBC, + 0x45, 0x44, 0xD7, 0x91, 0xD6, 0xBC, 0x45, 0x44, + 0xD7, 0x91, 0xD6, 0xBF, 0x4D, 0x44, 0xD7, 0x92, + // Bytes 4380 - 43bf + 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x93, 0xD6, 0xBC, + 0x45, 0x44, 0xD7, 0x94, 0xD6, 0xBC, 0x45, 0x44, + 0xD7, 0x95, 0xD6, 0xB9, 0x3D, 0x44, 0xD7, 0x95, + 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x96, 0xD6, 0xBC, + 0x45, 0x44, 0xD7, 0x98, 0xD6, 0xBC, 0x45, 0x44, + 0xD7, 0x99, 0xD6, 0xB4, 0x29, 0x44, 0xD7, 0x99, + 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x9A, 0xD6, 0xBC, + 0x45, 0x44, 0xD7, 0x9B, 0xD6, 0xBC, 0x45, 0x44, + // Bytes 43c0 - 43ff + 0xD7, 0x9B, 0xD6, 0xBF, 0x4D, 0x44, 0xD7, 0x9C, + 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x9E, 0xD6, 0xBC, + 0x45, 0x44, 0xD7, 0xA0, 0xD6, 0xBC, 0x45, 0x44, + 0xD7, 0xA1, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA3, + 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA4, 0xD6, 0xBC, + 0x45, 0x44, 0xD7, 0xA4, 0xD6, 0xBF, 0x4D, 0x44, + 0xD7, 0xA6, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA7, + 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA8, 0xD6, 0xBC, + // Bytes 4400 - 443f + 0x45, 0x44, 0xD7, 0xA9, 0xD6, 0xBC, 0x45, 0x44, + 0xD7, 0xA9, 0xD7, 0x81, 0x51, 0x44, 0xD7, 0xA9, + 0xD7, 0x82, 0x55, 0x44, 0xD7, 0xAA, 0xD6, 0xBC, + 0x45, 0x44, 0xD7, 0xB2, 0xD6, 0xB7, 0x35, 0x44, + 0xD8, 0xA7, 0xD9, 0x8B, 0x5D, 0x44, 0xD8, 0xA7, + 0xD9, 0x93, 0xCD, 0x44, 0xD8, 0xA7, 0xD9, 0x94, + 0xCD, 0x44, 0xD8, 0xA7, 0xD9, 0x95, 0xB9, 0x44, + 0xD8, 0xB0, 0xD9, 0xB0, 0x7D, 0x44, 0xD8, 0xB1, + // Bytes 4440 - 447f + 0xD9, 0xB0, 0x7D, 0x44, 0xD9, 0x80, 0xD9, 0x8B, + 0x5D, 0x44, 0xD9, 0x80, 0xD9, 0x8E, 0x69, 0x44, + 0xD9, 0x80, 0xD9, 0x8F, 0x6D, 0x44, 0xD9, 0x80, + 0xD9, 0x90, 0x71, 0x44, 0xD9, 0x80, 0xD9, 0x91, + 0x75, 0x44, 0xD9, 0x80, 0xD9, 0x92, 0x79, 0x44, + 0xD9, 0x87, 0xD9, 0xB0, 0x7D, 0x44, 0xD9, 0x88, + 0xD9, 0x94, 0xCD, 0x44, 0xD9, 0x89, 0xD9, 0xB0, + 0x7D, 0x44, 0xD9, 0x8A, 0xD9, 0x94, 0xCD, 0x44, + // Bytes 4480 - 44bf + 0xDB, 0x92, 0xD9, 0x94, 0xCD, 0x44, 0xDB, 0x95, + 0xD9, 0x94, 0xCD, 0x45, 0x20, 0xCC, 0x88, 0xCC, + 0x80, 0xCE, 0x45, 0x20, 0xCC, 0x88, 0xCC, 0x81, + 0xCE, 0x45, 0x20, 0xCC, 0x88, 0xCD, 0x82, 0xCE, + 0x45, 0x20, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x45, + 0x20, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x45, 0x20, + 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x45, 0x20, 0xCC, + 0x94, 0xCC, 0x80, 0xCE, 0x45, 0x20, 0xCC, 0x94, + // Bytes 44c0 - 44ff + 0xCC, 0x81, 0xCE, 0x45, 0x20, 0xCC, 0x94, 0xCD, + 0x82, 0xCE, 0x45, 0x20, 0xD9, 0x8C, 0xD9, 0x91, + 0x76, 0x45, 0x20, 0xD9, 0x8D, 0xD9, 0x91, 0x76, + 0x45, 0x20, 0xD9, 0x8E, 0xD9, 0x91, 0x76, 0x45, + 0x20, 0xD9, 0x8F, 0xD9, 0x91, 0x76, 0x45, 0x20, + 0xD9, 0x90, 0xD9, 0x91, 0x76, 0x45, 0x20, 0xD9, + 0x91, 0xD9, 0xB0, 0x7E, 0x45, 0xE2, 0xAB, 0x9D, + 0xCC, 0xB8, 0x05, 0x46, 0xCE, 0xB9, 0xCC, 0x88, + // Bytes 4500 - 453f + 0xCC, 0x81, 0xCE, 0x46, 0xCF, 0x85, 0xCC, 0x88, + 0xCC, 0x81, 0xCE, 0x46, 0xD7, 0xA9, 0xD6, 0xBC, + 0xD7, 0x81, 0x52, 0x46, 0xD7, 0xA9, 0xD6, 0xBC, + 0xD7, 0x82, 0x56, 0x46, 0xD9, 0x80, 0xD9, 0x8E, + 0xD9, 0x91, 0x76, 0x46, 0xD9, 0x80, 0xD9, 0x8F, + 0xD9, 0x91, 0x76, 0x46, 0xD9, 0x80, 0xD9, 0x90, + 0xD9, 0x91, 0x76, 0x46, 0xE0, 0xA4, 0x95, 0xE0, + 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0x96, 0xE0, + // Bytes 4540 - 457f + 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0x97, 0xE0, + 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0x9C, 0xE0, + 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0xA1, 0xE0, + 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0xA2, 0xE0, + 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0xAB, 0xE0, + 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0xAF, 0xE0, + 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA6, 0xA1, 0xE0, + 0xA6, 0xBC, 0x0D, 0x46, 0xE0, 0xA6, 0xA2, 0xE0, + // Bytes 4580 - 45bf + 0xA6, 0xBC, 0x0D, 0x46, 0xE0, 0xA6, 0xAF, 0xE0, + 0xA6, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0x96, 0xE0, + 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0x97, 0xE0, + 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0x9C, 0xE0, + 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0xAB, 0xE0, + 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0xB2, 0xE0, + 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0xB8, 0xE0, + 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xAC, 0xA1, 0xE0, + // Bytes 45c0 - 45ff + 0xAC, 0xBC, 0x0D, 0x46, 0xE0, 0xAC, 0xA2, 0xE0, + 0xAC, 0xBC, 0x0D, 0x46, 0xE0, 0xBE, 0xB2, 0xE0, + 0xBE, 0x80, 0xA1, 0x46, 0xE0, 0xBE, 0xB3, 0xE0, + 0xBE, 0x80, 0xA1, 0x46, 0xE3, 0x83, 0x86, 0xE3, + 0x82, 0x99, 0x11, 0x48, 0xF0, 0x9D, 0x85, 0x97, + 0xF0, 0x9D, 0x85, 0xA5, 0xB1, 0x48, 0xF0, 0x9D, + 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xB1, 0x48, + 0xF0, 0x9D, 0x86, 0xB9, 0xF0, 0x9D, 0x85, 0xA5, + // Bytes 4600 - 463f + 0xB1, 0x48, 0xF0, 0x9D, 0x86, 0xBA, 0xF0, 0x9D, + 0x85, 0xA5, 0xB1, 0x49, 0xE0, 0xBE, 0xB2, 0xE0, + 0xBD, 0xB1, 0xE0, 0xBE, 0x80, 0xA2, 0x49, 0xE0, + 0xBE, 0xB3, 0xE0, 0xBD, 0xB1, 0xE0, 0xBE, 0x80, + 0xA2, 0x4C, 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, + 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAE, 0xB2, 0x4C, + 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, + 0xF0, 0x9D, 0x85, 0xAF, 0xB2, 0x4C, 0xF0, 0x9D, + // Bytes 4640 - 467f + 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, + 0x85, 0xB0, 0xB2, 0x4C, 0xF0, 0x9D, 0x85, 0x98, + 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xB1, + 0xB2, 0x4C, 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, + 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xB2, 0xB2, 0x4C, + 0xF0, 0x9D, 0x86, 0xB9, 0xF0, 0x9D, 0x85, 0xA5, + 0xF0, 0x9D, 0x85, 0xAE, 0xB2, 0x4C, 0xF0, 0x9D, + 0x86, 0xB9, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, + // Bytes 4680 - 46bf + 0x85, 0xAF, 0xB2, 0x4C, 0xF0, 0x9D, 0x86, 0xBA, + 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAE, + 0xB2, 0x4C, 0xF0, 0x9D, 0x86, 0xBA, 0xF0, 0x9D, + 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAF, 0xB2, 0x83, + 0x41, 0xCC, 0x82, 0xCD, 0x83, 0x41, 0xCC, 0x86, + 0xCD, 0x83, 0x41, 0xCC, 0x87, 0xCD, 0x83, 0x41, + 0xCC, 0x88, 0xCD, 0x83, 0x41, 0xCC, 0x8A, 0xCD, + 0x83, 0x41, 0xCC, 0xA3, 0xB9, 0x83, 0x43, 0xCC, + // Bytes 46c0 - 46ff + 0xA7, 0xA9, 0x83, 0x45, 0xCC, 0x82, 0xCD, 0x83, + 0x45, 0xCC, 0x84, 0xCD, 0x83, 0x45, 0xCC, 0xA3, + 0xB9, 0x83, 0x45, 0xCC, 0xA7, 0xA9, 0x83, 0x49, + 0xCC, 0x88, 0xCD, 0x83, 0x4C, 0xCC, 0xA3, 0xB9, + 0x83, 0x4F, 0xCC, 0x82, 0xCD, 0x83, 0x4F, 0xCC, + 0x83, 0xCD, 0x83, 0x4F, 0xCC, 0x84, 0xCD, 0x83, + 0x4F, 0xCC, 0x87, 0xCD, 0x83, 0x4F, 0xCC, 0x88, + 0xCD, 0x83, 0x4F, 0xCC, 0x9B, 0xB1, 0x83, 0x4F, + // Bytes 4700 - 473f + 0xCC, 0xA3, 0xB9, 0x83, 0x4F, 0xCC, 0xA8, 0xA9, + 0x83, 0x52, 0xCC, 0xA3, 0xB9, 0x83, 0x53, 0xCC, + 0x81, 0xCD, 0x83, 0x53, 0xCC, 0x8C, 0xCD, 0x83, + 0x53, 0xCC, 0xA3, 0xB9, 0x83, 0x55, 0xCC, 0x83, + 0xCD, 0x83, 0x55, 0xCC, 0x84, 0xCD, 0x83, 0x55, + 0xCC, 0x88, 0xCD, 0x83, 0x55, 0xCC, 0x9B, 0xB1, + 0x83, 0x61, 0xCC, 0x82, 0xCD, 0x83, 0x61, 0xCC, + 0x86, 0xCD, 0x83, 0x61, 0xCC, 0x87, 0xCD, 0x83, + // Bytes 4740 - 477f + 0x61, 0xCC, 0x88, 0xCD, 0x83, 0x61, 0xCC, 0x8A, + 0xCD, 0x83, 0x61, 0xCC, 0xA3, 0xB9, 0x83, 0x63, + 0xCC, 0xA7, 0xA9, 0x83, 0x65, 0xCC, 0x82, 0xCD, + 0x83, 0x65, 0xCC, 0x84, 0xCD, 0x83, 0x65, 0xCC, + 0xA3, 0xB9, 0x83, 0x65, 0xCC, 0xA7, 0xA9, 0x83, + 0x69, 0xCC, 0x88, 0xCD, 0x83, 0x6C, 0xCC, 0xA3, + 0xB9, 0x83, 0x6F, 0xCC, 0x82, 0xCD, 0x83, 0x6F, + 0xCC, 0x83, 0xCD, 0x83, 0x6F, 0xCC, 0x84, 0xCD, + // Bytes 4780 - 47bf + 0x83, 0x6F, 0xCC, 0x87, 0xCD, 0x83, 0x6F, 0xCC, + 0x88, 0xCD, 0x83, 0x6F, 0xCC, 0x9B, 0xB1, 0x83, + 0x6F, 0xCC, 0xA3, 0xB9, 0x83, 0x6F, 0xCC, 0xA8, + 0xA9, 0x83, 0x72, 0xCC, 0xA3, 0xB9, 0x83, 0x73, + 0xCC, 0x81, 0xCD, 0x83, 0x73, 0xCC, 0x8C, 0xCD, + 0x83, 0x73, 0xCC, 0xA3, 0xB9, 0x83, 0x75, 0xCC, + 0x83, 0xCD, 0x83, 0x75, 0xCC, 0x84, 0xCD, 0x83, + 0x75, 0xCC, 0x88, 0xCD, 0x83, 0x75, 0xCC, 0x9B, + // Bytes 47c0 - 47ff + 0xB1, 0x84, 0xCE, 0x91, 0xCC, 0x93, 0xCD, 0x84, + 0xCE, 0x91, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0x95, + 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0x95, 0xCC, 0x94, + 0xCD, 0x84, 0xCE, 0x97, 0xCC, 0x93, 0xCD, 0x84, + 0xCE, 0x97, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0x99, + 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0x99, 0xCC, 0x94, + 0xCD, 0x84, 0xCE, 0x9F, 0xCC, 0x93, 0xCD, 0x84, + 0xCE, 0x9F, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0xA5, + // Bytes 4800 - 483f + 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0xA9, 0xCC, 0x93, + 0xCD, 0x84, 0xCE, 0xA9, 0xCC, 0x94, 0xCD, 0x84, + 0xCE, 0xB1, 0xCC, 0x80, 0xCD, 0x84, 0xCE, 0xB1, + 0xCC, 0x81, 0xCD, 0x84, 0xCE, 0xB1, 0xCC, 0x93, + 0xCD, 0x84, 0xCE, 0xB1, 0xCC, 0x94, 0xCD, 0x84, + 0xCE, 0xB1, 0xCD, 0x82, 0xCD, 0x84, 0xCE, 0xB5, + 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0xB5, 0xCC, 0x94, + 0xCD, 0x84, 0xCE, 0xB7, 0xCC, 0x80, 0xCD, 0x84, + // Bytes 4840 - 487f + 0xCE, 0xB7, 0xCC, 0x81, 0xCD, 0x84, 0xCE, 0xB7, + 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0xB7, 0xCC, 0x94, + 0xCD, 0x84, 0xCE, 0xB7, 0xCD, 0x82, 0xCD, 0x84, + 0xCE, 0xB9, 0xCC, 0x88, 0xCD, 0x84, 0xCE, 0xB9, + 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0xB9, 0xCC, 0x94, + 0xCD, 0x84, 0xCE, 0xBF, 0xCC, 0x93, 0xCD, 0x84, + 0xCE, 0xBF, 0xCC, 0x94, 0xCD, 0x84, 0xCF, 0x85, + 0xCC, 0x88, 0xCD, 0x84, 0xCF, 0x85, 0xCC, 0x93, + // Bytes 4880 - 48bf + 0xCD, 0x84, 0xCF, 0x85, 0xCC, 0x94, 0xCD, 0x84, + 0xCF, 0x89, 0xCC, 0x80, 0xCD, 0x84, 0xCF, 0x89, + 0xCC, 0x81, 0xCD, 0x84, 0xCF, 0x89, 0xCC, 0x93, + 0xCD, 0x84, 0xCF, 0x89, 0xCC, 0x94, 0xCD, 0x84, + 0xCF, 0x89, 0xCD, 0x82, 0xCD, 0x86, 0xCE, 0x91, + 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0x91, + 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0x91, + 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0x91, + // Bytes 48c0 - 48ff + 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0x91, + 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0x91, + 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0x97, + 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0x97, + 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0x97, + 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0x97, + 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0x97, + 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0x97, + // Bytes 4900 - 493f + 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xA9, + 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xA9, + 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xA9, + 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xA9, + 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xA9, + 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xA9, + 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xB1, + 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xB1, + // Bytes 4940 - 497f + 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xB1, + 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xB1, + 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xB1, + 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xB1, + 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xB7, + 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xB7, + 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xB7, + 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xB7, + // Bytes 4980 - 49bf + 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xB7, + 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xB7, + 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCF, 0x89, + 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCF, 0x89, + 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCF, 0x89, + 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCF, 0x89, + 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCF, 0x89, + 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCF, 0x89, + // Bytes 49c0 - 49ff + 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x42, 0xCC, 0x80, + 0xCD, 0x33, 0x42, 0xCC, 0x81, 0xCD, 0x33, 0x42, + 0xCC, 0x93, 0xCD, 0x33, 0x43, 0xE1, 0x85, 0xA1, + 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA2, 0x01, 0x00, + 0x43, 0xE1, 0x85, 0xA3, 0x01, 0x00, 0x43, 0xE1, + 0x85, 0xA4, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA5, + 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA6, 0x01, 0x00, + 0x43, 0xE1, 0x85, 0xA7, 0x01, 0x00, 0x43, 0xE1, + // Bytes 4a00 - 4a3f + 0x85, 0xA8, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA9, + 0x01, 0x00, 0x43, 0xE1, 0x85, 0xAA, 0x01, 0x00, + 0x43, 0xE1, 0x85, 0xAB, 0x01, 0x00, 0x43, 0xE1, + 0x85, 0xAC, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xAD, + 0x01, 0x00, 0x43, 0xE1, 0x85, 0xAE, 0x01, 0x00, + 0x43, 0xE1, 0x85, 0xAF, 0x01, 0x00, 0x43, 0xE1, + 0x85, 0xB0, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xB1, + 0x01, 0x00, 0x43, 0xE1, 0x85, 0xB2, 0x01, 0x00, + // Bytes 4a40 - 4a7f + 0x43, 0xE1, 0x85, 0xB3, 0x01, 0x00, 0x43, 0xE1, + 0x85, 0xB4, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xB5, + 0x01, 0x00, 0x43, 0xE1, 0x86, 0xAA, 0x01, 0x00, + 0x43, 0xE1, 0x86, 0xAC, 0x01, 0x00, 0x43, 0xE1, + 0x86, 0xAD, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB0, + 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB1, 0x01, 0x00, + 0x43, 0xE1, 0x86, 0xB2, 0x01, 0x00, 0x43, 0xE1, + 0x86, 0xB3, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB4, + // Bytes 4a80 - 4abf + 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB5, 0x01, 0x00, + 0x44, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x33, 0x43, + 0xE3, 0x82, 0x99, 0x11, 0x04, 0x43, 0xE3, 0x82, + 0x9A, 0x11, 0x04, 0x46, 0xE0, 0xBD, 0xB1, 0xE0, + 0xBD, 0xB2, 0xA2, 0x27, 0x46, 0xE0, 0xBD, 0xB1, + 0xE0, 0xBD, 0xB4, 0xA6, 0x27, 0x46, 0xE0, 0xBD, + 0xB1, 0xE0, 0xBE, 0x80, 0xA2, 0x27, 0x00, 0x01, +} + +// lookup returns the trie value for the first UTF-8 encoding in s and +// the width in bytes of this encoding. The size will be 0 if s does not +// hold enough bytes to complete the encoding. len(s) must be greater than 0. +func (t *nfcTrie) lookup(s []byte) (v uint16, sz int) { + c0 := s[0] + switch { + case c0 < 0x80: // is ASCII + return nfcValues[c0], 1 + case c0 < 0xC2: + return 0, 1 // Illegal UTF-8: not a starter, not ASCII. + case c0 < 0xE0: // 2-byte UTF-8 + if len(s) < 2 { + return 0, 0 + } + i := nfcIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c1), 2 + case c0 < 0xF0: // 3-byte UTF-8 + if len(s) < 3 { + return 0, 0 + } + i := nfcIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + o := uint32(i)<<6 + uint32(c1) + i = nfcIndex[o] + c2 := s[2] + if c2 < 0x80 || 0xC0 <= c2 { + return 0, 2 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c2), 3 + case c0 < 0xF8: // 4-byte UTF-8 + if len(s) < 4 { + return 0, 0 + } + i := nfcIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + o := uint32(i)<<6 + uint32(c1) + i = nfcIndex[o] + c2 := s[2] + if c2 < 0x80 || 0xC0 <= c2 { + return 0, 2 // Illegal UTF-8: not a continuation byte. + } + o = uint32(i)<<6 + uint32(c2) + i = nfcIndex[o] + c3 := s[3] + if c3 < 0x80 || 0xC0 <= c3 { + return 0, 3 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c3), 4 + } + // Illegal rune + return 0, 1 +} + +// lookupUnsafe returns the trie value for the first UTF-8 encoding in s. +// s must start with a full and valid UTF-8 encoded rune. +func (t *nfcTrie) lookupUnsafe(s []byte) uint16 { + c0 := s[0] + if c0 < 0x80 { // is ASCII + return nfcValues[c0] + } + i := nfcIndex[c0] + if c0 < 0xE0 { // 2-byte UTF-8 + return t.lookupValue(uint32(i), s[1]) + } + i = nfcIndex[uint32(i)<<6+uint32(s[1])] + if c0 < 0xF0 { // 3-byte UTF-8 + return t.lookupValue(uint32(i), s[2]) + } + i = nfcIndex[uint32(i)<<6+uint32(s[2])] + if c0 < 0xF8 { // 4-byte UTF-8 + return t.lookupValue(uint32(i), s[3]) + } + return 0 +} + +// lookupString returns the trie value for the first UTF-8 encoding in s and +// the width in bytes of this encoding. The size will be 0 if s does not +// hold enough bytes to complete the encoding. len(s) must be greater than 0. +func (t *nfcTrie) lookupString(s string) (v uint16, sz int) { + c0 := s[0] + switch { + case c0 < 0x80: // is ASCII + return nfcValues[c0], 1 + case c0 < 0xC2: + return 0, 1 // Illegal UTF-8: not a starter, not ASCII. + case c0 < 0xE0: // 2-byte UTF-8 + if len(s) < 2 { + return 0, 0 + } + i := nfcIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c1), 2 + case c0 < 0xF0: // 3-byte UTF-8 + if len(s) < 3 { + return 0, 0 + } + i := nfcIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + o := uint32(i)<<6 + uint32(c1) + i = nfcIndex[o] + c2 := s[2] + if c2 < 0x80 || 0xC0 <= c2 { + return 0, 2 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c2), 3 + case c0 < 0xF8: // 4-byte UTF-8 + if len(s) < 4 { + return 0, 0 + } + i := nfcIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + o := uint32(i)<<6 + uint32(c1) + i = nfcIndex[o] + c2 := s[2] + if c2 < 0x80 || 0xC0 <= c2 { + return 0, 2 // Illegal UTF-8: not a continuation byte. + } + o = uint32(i)<<6 + uint32(c2) + i = nfcIndex[o] + c3 := s[3] + if c3 < 0x80 || 0xC0 <= c3 { + return 0, 3 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c3), 4 + } + // Illegal rune + return 0, 1 +} + +// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. +// s must start with a full and valid UTF-8 encoded rune. +func (t *nfcTrie) lookupStringUnsafe(s string) uint16 { + c0 := s[0] + if c0 < 0x80 { // is ASCII + return nfcValues[c0] + } + i := nfcIndex[c0] + if c0 < 0xE0 { // 2-byte UTF-8 + return t.lookupValue(uint32(i), s[1]) + } + i = nfcIndex[uint32(i)<<6+uint32(s[1])] + if c0 < 0xF0 { // 3-byte UTF-8 + return t.lookupValue(uint32(i), s[2]) + } + i = nfcIndex[uint32(i)<<6+uint32(s[2])] + if c0 < 0xF8 { // 4-byte UTF-8 + return t.lookupValue(uint32(i), s[3]) + } + return 0 +} + +// nfcTrie. Total size: 10680 bytes (10.43 KiB). Checksum: a555db76d4becdd2. +type nfcTrie struct{} + +func newNfcTrie(i int) *nfcTrie { + return &nfcTrie{} +} + +// lookupValue determines the type of block n and looks up the value for b. +func (t *nfcTrie) lookupValue(n uint32, b byte) uint16 { + switch { + case n < 46: + return uint16(nfcValues[n<<6+uint32(b)]) + default: + n -= 46 + return uint16(nfcSparse.lookup(n, b)) + } +} + +// nfcValues: 48 blocks, 3072 entries, 6144 bytes +// The third block is the zero block. +var nfcValues = [3072]uint16{ + // Block 0x0, offset 0x0 + 0x3c: 0xa000, 0x3d: 0xa000, 0x3e: 0xa000, + // Block 0x1, offset 0x40 + 0x41: 0xa000, 0x42: 0xa000, 0x43: 0xa000, 0x44: 0xa000, 0x45: 0xa000, + 0x46: 0xa000, 0x47: 0xa000, 0x48: 0xa000, 0x49: 0xa000, 0x4a: 0xa000, 0x4b: 0xa000, + 0x4c: 0xa000, 0x4d: 0xa000, 0x4e: 0xa000, 0x4f: 0xa000, 0x50: 0xa000, + 0x52: 0xa000, 0x53: 0xa000, 0x54: 0xa000, 0x55: 0xa000, 0x56: 0xa000, 0x57: 0xa000, + 0x58: 0xa000, 0x59: 0xa000, 0x5a: 0xa000, + 0x61: 0xa000, 0x62: 0xa000, 0x63: 0xa000, + 0x64: 0xa000, 0x65: 0xa000, 0x66: 0xa000, 0x67: 0xa000, 0x68: 0xa000, 0x69: 0xa000, + 0x6a: 0xa000, 0x6b: 0xa000, 0x6c: 0xa000, 0x6d: 0xa000, 0x6e: 0xa000, 0x6f: 0xa000, + 0x70: 0xa000, 0x72: 0xa000, 0x73: 0xa000, 0x74: 0xa000, 0x75: 0xa000, + 0x76: 0xa000, 0x77: 0xa000, 0x78: 0xa000, 0x79: 0xa000, 0x7a: 0xa000, + // Block 0x2, offset 0x80 + // Block 0x3, offset 0xc0 + 0xc0: 0x2f86, 0xc1: 0x2f8b, 0xc2: 0x469f, 0xc3: 0x2f90, 0xc4: 0x46ae, 0xc5: 0x46b3, + 0xc6: 0xa000, 0xc7: 0x46bd, 0xc8: 0x2ff9, 0xc9: 0x2ffe, 0xca: 0x46c2, 0xcb: 0x3012, + 0xcc: 0x3085, 0xcd: 0x308a, 0xce: 0x308f, 0xcf: 0x46d6, 0xd1: 0x311b, + 0xd2: 0x313e, 0xd3: 0x3143, 0xd4: 0x46e0, 0xd5: 0x46e5, 0xd6: 0x46f4, + 0xd8: 0xa000, 0xd9: 0x31ca, 0xda: 0x31cf, 0xdb: 0x31d4, 0xdc: 0x4726, 0xdd: 0x324c, + 0xe0: 0x3292, 0xe1: 0x3297, 0xe2: 0x4730, 0xe3: 0x329c, + 0xe4: 0x473f, 0xe5: 0x4744, 0xe6: 0xa000, 0xe7: 0x474e, 0xe8: 0x3305, 0xe9: 0x330a, + 0xea: 0x4753, 0xeb: 0x331e, 0xec: 0x3396, 0xed: 0x339b, 0xee: 0x33a0, 0xef: 0x4767, + 0xf1: 0x342c, 0xf2: 0x344f, 0xf3: 0x3454, 0xf4: 0x4771, 0xf5: 0x4776, + 0xf6: 0x4785, 0xf8: 0xa000, 0xf9: 0x34e0, 0xfa: 0x34e5, 0xfb: 0x34ea, + 0xfc: 0x47b7, 0xfd: 0x3567, 0xff: 0x3580, + // Block 0x4, offset 0x100 + 0x100: 0x2f95, 0x101: 0x32a1, 0x102: 0x46a4, 0x103: 0x4735, 0x104: 0x2fb3, 0x105: 0x32bf, + 0x106: 0x2fc7, 0x107: 0x32d3, 0x108: 0x2fcc, 0x109: 0x32d8, 0x10a: 0x2fd1, 0x10b: 0x32dd, + 0x10c: 0x2fd6, 0x10d: 0x32e2, 0x10e: 0x2fe0, 0x10f: 0x32ec, + 0x112: 0x46c7, 0x113: 0x4758, 0x114: 0x3008, 0x115: 0x3314, 0x116: 0x300d, 0x117: 0x3319, + 0x118: 0x302b, 0x119: 0x3337, 0x11a: 0x301c, 0x11b: 0x3328, 0x11c: 0x3044, 0x11d: 0x3350, + 0x11e: 0x304e, 0x11f: 0x335a, 0x120: 0x3053, 0x121: 0x335f, 0x122: 0x305d, 0x123: 0x3369, + 0x124: 0x3062, 0x125: 0x336e, 0x128: 0x3094, 0x129: 0x33a5, + 0x12a: 0x3099, 0x12b: 0x33aa, 0x12c: 0x309e, 0x12d: 0x33af, 0x12e: 0x30c1, 0x12f: 0x33cd, + 0x130: 0x30a3, 0x134: 0x30cb, 0x135: 0x33d7, + 0x136: 0x30df, 0x137: 0x33f0, 0x139: 0x30e9, 0x13a: 0x33fa, 0x13b: 0x30f3, + 0x13c: 0x3404, 0x13d: 0x30ee, 0x13e: 0x33ff, + // Block 0x5, offset 0x140 + 0x143: 0x3116, 0x144: 0x3427, 0x145: 0x312f, + 0x146: 0x3440, 0x147: 0x3125, 0x148: 0x3436, + 0x14c: 0x46ea, 0x14d: 0x477b, 0x14e: 0x3148, 0x14f: 0x3459, 0x150: 0x3152, 0x151: 0x3463, + 0x154: 0x3170, 0x155: 0x3481, 0x156: 0x3189, 0x157: 0x349a, + 0x158: 0x317a, 0x159: 0x348b, 0x15a: 0x470d, 0x15b: 0x479e, 0x15c: 0x3193, 0x15d: 0x34a4, + 0x15e: 0x31a2, 0x15f: 0x34b3, 0x160: 0x4712, 0x161: 0x47a3, 0x162: 0x31bb, 0x163: 0x34d1, + 0x164: 0x31ac, 0x165: 0x34c2, 0x168: 0x471c, 0x169: 0x47ad, + 0x16a: 0x4721, 0x16b: 0x47b2, 0x16c: 0x31d9, 0x16d: 0x34ef, 0x16e: 0x31e3, 0x16f: 0x34f9, + 0x170: 0x31e8, 0x171: 0x34fe, 0x172: 0x3206, 0x173: 0x351c, 0x174: 0x3229, 0x175: 0x353f, + 0x176: 0x3251, 0x177: 0x356c, 0x178: 0x3265, 0x179: 0x3274, 0x17a: 0x3594, 0x17b: 0x327e, + 0x17c: 0x359e, 0x17d: 0x3283, 0x17e: 0x35a3, 0x17f: 0xa000, + // Block 0x6, offset 0x180 + 0x184: 0x8100, 0x185: 0x8100, + 0x186: 0x8100, + 0x18d: 0x2f9f, 0x18e: 0x32ab, 0x18f: 0x30ad, 0x190: 0x33b9, 0x191: 0x3157, + 0x192: 0x3468, 0x193: 0x31ed, 0x194: 0x3503, 0x195: 0x39e6, 0x196: 0x3b75, 0x197: 0x39df, + 0x198: 0x3b6e, 0x199: 0x39ed, 0x19a: 0x3b7c, 0x19b: 0x39d8, 0x19c: 0x3b67, + 0x19e: 0x38c7, 0x19f: 0x3a56, 0x1a0: 0x38c0, 0x1a1: 0x3a4f, 0x1a2: 0x35ca, 0x1a3: 0x35dc, + 0x1a6: 0x3058, 0x1a7: 0x3364, 0x1a8: 0x30d5, 0x1a9: 0x33e6, + 0x1aa: 0x4703, 0x1ab: 0x4794, 0x1ac: 0x39a7, 0x1ad: 0x3b36, 0x1ae: 0x35ee, 0x1af: 0x35f4, + 0x1b0: 0x33dc, 0x1b4: 0x303f, 0x1b5: 0x334b, + 0x1b8: 0x3111, 0x1b9: 0x3422, 0x1ba: 0x38ce, 0x1bb: 0x3a5d, + 0x1bc: 0x35c4, 0x1bd: 0x35d6, 0x1be: 0x35d0, 0x1bf: 0x35e2, + // Block 0x7, offset 0x1c0 + 0x1c0: 0x2fa4, 0x1c1: 0x32b0, 0x1c2: 0x2fa9, 0x1c3: 0x32b5, 0x1c4: 0x3021, 0x1c5: 0x332d, + 0x1c6: 0x3026, 0x1c7: 0x3332, 0x1c8: 0x30b2, 0x1c9: 0x33be, 0x1ca: 0x30b7, 0x1cb: 0x33c3, + 0x1cc: 0x315c, 0x1cd: 0x346d, 0x1ce: 0x3161, 0x1cf: 0x3472, 0x1d0: 0x317f, 0x1d1: 0x3490, + 0x1d2: 0x3184, 0x1d3: 0x3495, 0x1d4: 0x31f2, 0x1d5: 0x3508, 0x1d6: 0x31f7, 0x1d7: 0x350d, + 0x1d8: 0x319d, 0x1d9: 0x34ae, 0x1da: 0x31b6, 0x1db: 0x34cc, + 0x1de: 0x3071, 0x1df: 0x337d, + 0x1e6: 0x46a9, 0x1e7: 0x473a, 0x1e8: 0x46d1, 0x1e9: 0x4762, + 0x1ea: 0x3976, 0x1eb: 0x3b05, 0x1ec: 0x3953, 0x1ed: 0x3ae2, 0x1ee: 0x46ef, 0x1ef: 0x4780, + 0x1f0: 0x396f, 0x1f1: 0x3afe, 0x1f2: 0x325b, 0x1f3: 0x3576, + // Block 0x8, offset 0x200 + 0x200: 0x9933, 0x201: 0x9933, 0x202: 0x9933, 0x203: 0x9933, 0x204: 0x9933, 0x205: 0x8133, + 0x206: 0x9933, 0x207: 0x9933, 0x208: 0x9933, 0x209: 0x9933, 0x20a: 0x9933, 0x20b: 0x9933, + 0x20c: 0x9933, 0x20d: 0x8133, 0x20e: 0x8133, 0x20f: 0x9933, 0x210: 0x8133, 0x211: 0x9933, + 0x212: 0x8133, 0x213: 0x9933, 0x214: 0x9933, 0x215: 0x8134, 0x216: 0x812e, 0x217: 0x812e, + 0x218: 0x812e, 0x219: 0x812e, 0x21a: 0x8134, 0x21b: 0x992c, 0x21c: 0x812e, 0x21d: 0x812e, + 0x21e: 0x812e, 0x21f: 0x812e, 0x220: 0x812e, 0x221: 0x812a, 0x222: 0x812a, 0x223: 0x992e, + 0x224: 0x992e, 0x225: 0x992e, 0x226: 0x992e, 0x227: 0x992a, 0x228: 0x992a, 0x229: 0x812e, + 0x22a: 0x812e, 0x22b: 0x812e, 0x22c: 0x812e, 0x22d: 0x992e, 0x22e: 0x992e, 0x22f: 0x812e, + 0x230: 0x992e, 0x231: 0x992e, 0x232: 0x812e, 0x233: 0x812e, 0x234: 0x8101, 0x235: 0x8101, + 0x236: 0x8101, 0x237: 0x8101, 0x238: 0x9901, 0x239: 0x812e, 0x23a: 0x812e, 0x23b: 0x812e, + 0x23c: 0x812e, 0x23d: 0x8133, 0x23e: 0x8133, 0x23f: 0x8133, + // Block 0x9, offset 0x240 + 0x240: 0x49c5, 0x241: 0x49ca, 0x242: 0x9933, 0x243: 0x49cf, 0x244: 0x4a88, 0x245: 0x9937, + 0x246: 0x8133, 0x247: 0x812e, 0x248: 0x812e, 0x249: 0x812e, 0x24a: 0x8133, 0x24b: 0x8133, + 0x24c: 0x8133, 0x24d: 0x812e, 0x24e: 0x812e, 0x250: 0x8133, 0x251: 0x8133, + 0x252: 0x8133, 0x253: 0x812e, 0x254: 0x812e, 0x255: 0x812e, 0x256: 0x812e, 0x257: 0x8133, + 0x258: 0x8134, 0x259: 0x812e, 0x25a: 0x812e, 0x25b: 0x8133, 0x25c: 0x8135, 0x25d: 0x8136, + 0x25e: 0x8136, 0x25f: 0x8135, 0x260: 0x8136, 0x261: 0x8136, 0x262: 0x8135, 0x263: 0x8133, + 0x264: 0x8133, 0x265: 0x8133, 0x266: 0x8133, 0x267: 0x8133, 0x268: 0x8133, 0x269: 0x8133, + 0x26a: 0x8133, 0x26b: 0x8133, 0x26c: 0x8133, 0x26d: 0x8133, 0x26e: 0x8133, 0x26f: 0x8133, + 0x274: 0x0173, + 0x27a: 0x8100, + 0x27e: 0x0037, + // Block 0xa, offset 0x280 + 0x284: 0x8100, 0x285: 0x35b8, + 0x286: 0x3600, 0x287: 0x00ce, 0x288: 0x361e, 0x289: 0x362a, 0x28a: 0x363c, + 0x28c: 0x365a, 0x28e: 0x366c, 0x28f: 0x368a, 0x290: 0x3e1f, 0x291: 0xa000, + 0x295: 0xa000, 0x297: 0xa000, + 0x299: 0xa000, + 0x29f: 0xa000, 0x2a1: 0xa000, + 0x2a5: 0xa000, 0x2a9: 0xa000, + 0x2aa: 0x364e, 0x2ab: 0x367e, 0x2ac: 0x4815, 0x2ad: 0x36ae, 0x2ae: 0x483f, 0x2af: 0x36c0, + 0x2b0: 0x3e87, 0x2b1: 0xa000, 0x2b5: 0xa000, + 0x2b7: 0xa000, 0x2b9: 0xa000, + 0x2bf: 0xa000, + // Block 0xb, offset 0x2c0 + 0x2c0: 0x3738, 0x2c1: 0x3744, 0x2c3: 0x3732, + 0x2c6: 0xa000, 0x2c7: 0x3720, + 0x2cc: 0x3774, 0x2cd: 0x375c, 0x2ce: 0x3786, 0x2d0: 0xa000, + 0x2d3: 0xa000, 0x2d5: 0xa000, 0x2d6: 0xa000, 0x2d7: 0xa000, + 0x2d8: 0xa000, 0x2d9: 0x3768, 0x2da: 0xa000, + 0x2de: 0xa000, 0x2e3: 0xa000, + 0x2e7: 0xa000, + 0x2eb: 0xa000, 0x2ed: 0xa000, + 0x2f0: 0xa000, 0x2f3: 0xa000, 0x2f5: 0xa000, + 0x2f6: 0xa000, 0x2f7: 0xa000, 0x2f8: 0xa000, 0x2f9: 0x37ec, 0x2fa: 0xa000, + 0x2fe: 0xa000, + // Block 0xc, offset 0x300 + 0x301: 0x374a, 0x302: 0x37ce, + 0x310: 0x3726, 0x311: 0x37aa, + 0x312: 0x372c, 0x313: 0x37b0, 0x316: 0x373e, 0x317: 0x37c2, + 0x318: 0xa000, 0x319: 0xa000, 0x31a: 0x3840, 0x31b: 0x3846, 0x31c: 0x3750, 0x31d: 0x37d4, + 0x31e: 0x3756, 0x31f: 0x37da, 0x322: 0x3762, 0x323: 0x37e6, + 0x324: 0x376e, 0x325: 0x37f2, 0x326: 0x377a, 0x327: 0x37fe, 0x328: 0xa000, 0x329: 0xa000, + 0x32a: 0x384c, 0x32b: 0x3852, 0x32c: 0x37a4, 0x32d: 0x3828, 0x32e: 0x3780, 0x32f: 0x3804, + 0x330: 0x378c, 0x331: 0x3810, 0x332: 0x3792, 0x333: 0x3816, 0x334: 0x3798, 0x335: 0x381c, + 0x338: 0x379e, 0x339: 0x3822, + // Block 0xd, offset 0x340 + 0x351: 0x812e, + 0x352: 0x8133, 0x353: 0x8133, 0x354: 0x8133, 0x355: 0x8133, 0x356: 0x812e, 0x357: 0x8133, + 0x358: 0x8133, 0x359: 0x8133, 0x35a: 0x812f, 0x35b: 0x812e, 0x35c: 0x8133, 0x35d: 0x8133, + 0x35e: 0x8133, 0x35f: 0x8133, 0x360: 0x8133, 0x361: 0x8133, 0x362: 0x812e, 0x363: 0x812e, + 0x364: 0x812e, 0x365: 0x812e, 0x366: 0x812e, 0x367: 0x812e, 0x368: 0x8133, 0x369: 0x8133, + 0x36a: 0x812e, 0x36b: 0x8133, 0x36c: 0x8133, 0x36d: 0x812f, 0x36e: 0x8132, 0x36f: 0x8133, + 0x370: 0x8106, 0x371: 0x8107, 0x372: 0x8108, 0x373: 0x8109, 0x374: 0x810a, 0x375: 0x810b, + 0x376: 0x810c, 0x377: 0x810d, 0x378: 0x810e, 0x379: 0x810f, 0x37a: 0x810f, 0x37b: 0x8110, + 0x37c: 0x8111, 0x37d: 0x8112, 0x37f: 0x8113, + // Block 0xe, offset 0x380 + 0x388: 0xa000, 0x38a: 0xa000, 0x38b: 0x8117, + 0x38c: 0x8118, 0x38d: 0x8119, 0x38e: 0x811a, 0x38f: 0x811b, 0x390: 0x811c, 0x391: 0x811d, + 0x392: 0x811e, 0x393: 0x9933, 0x394: 0x9933, 0x395: 0x992e, 0x396: 0x812e, 0x397: 0x8133, + 0x398: 0x8133, 0x399: 0x8133, 0x39a: 0x8133, 0x39b: 0x8133, 0x39c: 0x812e, 0x39d: 0x8133, + 0x39e: 0x8133, 0x39f: 0x812e, + 0x3b0: 0x811f, + // Block 0xf, offset 0x3c0 + 0x3d3: 0x812e, 0x3d4: 0x8133, 0x3d5: 0x8133, 0x3d6: 0x8133, 0x3d7: 0x8133, + 0x3d8: 0x8133, 0x3d9: 0x8133, 0x3da: 0x8133, 0x3db: 0x8133, 0x3dc: 0x8133, 0x3dd: 0x8133, + 0x3de: 0x8133, 0x3df: 0x8133, 0x3e0: 0x8133, 0x3e1: 0x8133, 0x3e3: 0x812e, + 0x3e4: 0x8133, 0x3e5: 0x8133, 0x3e6: 0x812e, 0x3e7: 0x8133, 0x3e8: 0x8133, 0x3e9: 0x812e, + 0x3ea: 0x8133, 0x3eb: 0x8133, 0x3ec: 0x8133, 0x3ed: 0x812e, 0x3ee: 0x812e, 0x3ef: 0x812e, + 0x3f0: 0x8117, 0x3f1: 0x8118, 0x3f2: 0x8119, 0x3f3: 0x8133, 0x3f4: 0x8133, 0x3f5: 0x8133, + 0x3f6: 0x812e, 0x3f7: 0x8133, 0x3f8: 0x8133, 0x3f9: 0x812e, 0x3fa: 0x812e, 0x3fb: 0x8133, + 0x3fc: 0x8133, 0x3fd: 0x8133, 0x3fe: 0x8133, 0x3ff: 0x8133, + // Block 0x10, offset 0x400 + 0x405: 0xa000, + 0x406: 0x2d33, 0x407: 0xa000, 0x408: 0x2d3b, 0x409: 0xa000, 0x40a: 0x2d43, 0x40b: 0xa000, + 0x40c: 0x2d4b, 0x40d: 0xa000, 0x40e: 0x2d53, 0x411: 0xa000, + 0x412: 0x2d5b, + 0x434: 0x8103, 0x435: 0x9900, + 0x43a: 0xa000, 0x43b: 0x2d63, + 0x43c: 0xa000, 0x43d: 0x2d6b, 0x43e: 0xa000, 0x43f: 0xa000, + // Block 0x11, offset 0x440 + 0x440: 0x8133, 0x441: 0x8133, 0x442: 0x812e, 0x443: 0x8133, 0x444: 0x8133, 0x445: 0x8133, + 0x446: 0x8133, 0x447: 0x8133, 0x448: 0x8133, 0x449: 0x8133, 0x44a: 0x812e, 0x44b: 0x8133, + 0x44c: 0x8133, 0x44d: 0x8136, 0x44e: 0x812b, 0x44f: 0x812e, 0x450: 0x812a, 0x451: 0x8133, + 0x452: 0x8133, 0x453: 0x8133, 0x454: 0x8133, 0x455: 0x8133, 0x456: 0x8133, 0x457: 0x8133, + 0x458: 0x8133, 0x459: 0x8133, 0x45a: 0x8133, 0x45b: 0x8133, 0x45c: 0x8133, 0x45d: 0x8133, + 0x45e: 0x8133, 0x45f: 0x8133, 0x460: 0x8133, 0x461: 0x8133, 0x462: 0x8133, 0x463: 0x8133, + 0x464: 0x8133, 0x465: 0x8133, 0x466: 0x8133, 0x467: 0x8133, 0x468: 0x8133, 0x469: 0x8133, + 0x46a: 0x8133, 0x46b: 0x8133, 0x46c: 0x8133, 0x46d: 0x8133, 0x46e: 0x8133, 0x46f: 0x8133, + 0x470: 0x8133, 0x471: 0x8133, 0x472: 0x8133, 0x473: 0x8133, 0x474: 0x8133, 0x475: 0x8133, + 0x476: 0x8134, 0x477: 0x8132, 0x478: 0x8132, 0x479: 0x812e, 0x47b: 0x8133, + 0x47c: 0x8135, 0x47d: 0x812e, 0x47e: 0x8133, 0x47f: 0x812e, + // Block 0x12, offset 0x480 + 0x480: 0x2fae, 0x481: 0x32ba, 0x482: 0x2fb8, 0x483: 0x32c4, 0x484: 0x2fbd, 0x485: 0x32c9, + 0x486: 0x2fc2, 0x487: 0x32ce, 0x488: 0x38e3, 0x489: 0x3a72, 0x48a: 0x2fdb, 0x48b: 0x32e7, + 0x48c: 0x2fe5, 0x48d: 0x32f1, 0x48e: 0x2ff4, 0x48f: 0x3300, 0x490: 0x2fea, 0x491: 0x32f6, + 0x492: 0x2fef, 0x493: 0x32fb, 0x494: 0x3906, 0x495: 0x3a95, 0x496: 0x390d, 0x497: 0x3a9c, + 0x498: 0x3030, 0x499: 0x333c, 0x49a: 0x3035, 0x49b: 0x3341, 0x49c: 0x391b, 0x49d: 0x3aaa, + 0x49e: 0x303a, 0x49f: 0x3346, 0x4a0: 0x3049, 0x4a1: 0x3355, 0x4a2: 0x3067, 0x4a3: 0x3373, + 0x4a4: 0x3076, 0x4a5: 0x3382, 0x4a6: 0x306c, 0x4a7: 0x3378, 0x4a8: 0x307b, 0x4a9: 0x3387, + 0x4aa: 0x3080, 0x4ab: 0x338c, 0x4ac: 0x30c6, 0x4ad: 0x33d2, 0x4ae: 0x3922, 0x4af: 0x3ab1, + 0x4b0: 0x30d0, 0x4b1: 0x33e1, 0x4b2: 0x30da, 0x4b3: 0x33eb, 0x4b4: 0x30e4, 0x4b5: 0x33f5, + 0x4b6: 0x46db, 0x4b7: 0x476c, 0x4b8: 0x3929, 0x4b9: 0x3ab8, 0x4ba: 0x30fd, 0x4bb: 0x340e, + 0x4bc: 0x30f8, 0x4bd: 0x3409, 0x4be: 0x3102, 0x4bf: 0x3413, + // Block 0x13, offset 0x4c0 + 0x4c0: 0x3107, 0x4c1: 0x3418, 0x4c2: 0x310c, 0x4c3: 0x341d, 0x4c4: 0x3120, 0x4c5: 0x3431, + 0x4c6: 0x312a, 0x4c7: 0x343b, 0x4c8: 0x3139, 0x4c9: 0x344a, 0x4ca: 0x3134, 0x4cb: 0x3445, + 0x4cc: 0x394c, 0x4cd: 0x3adb, 0x4ce: 0x395a, 0x4cf: 0x3ae9, 0x4d0: 0x3961, 0x4d1: 0x3af0, + 0x4d2: 0x3968, 0x4d3: 0x3af7, 0x4d4: 0x3166, 0x4d5: 0x3477, 0x4d6: 0x316b, 0x4d7: 0x347c, + 0x4d8: 0x3175, 0x4d9: 0x3486, 0x4da: 0x4708, 0x4db: 0x4799, 0x4dc: 0x39ae, 0x4dd: 0x3b3d, + 0x4de: 0x318e, 0x4df: 0x349f, 0x4e0: 0x3198, 0x4e1: 0x34a9, 0x4e2: 0x4717, 0x4e3: 0x47a8, + 0x4e4: 0x39b5, 0x4e5: 0x3b44, 0x4e6: 0x39bc, 0x4e7: 0x3b4b, 0x4e8: 0x39c3, 0x4e9: 0x3b52, + 0x4ea: 0x31a7, 0x4eb: 0x34b8, 0x4ec: 0x31b1, 0x4ed: 0x34c7, 0x4ee: 0x31c5, 0x4ef: 0x34db, + 0x4f0: 0x31c0, 0x4f1: 0x34d6, 0x4f2: 0x3201, 0x4f3: 0x3517, 0x4f4: 0x3210, 0x4f5: 0x3526, + 0x4f6: 0x320b, 0x4f7: 0x3521, 0x4f8: 0x39ca, 0x4f9: 0x3b59, 0x4fa: 0x39d1, 0x4fb: 0x3b60, + 0x4fc: 0x3215, 0x4fd: 0x352b, 0x4fe: 0x321a, 0x4ff: 0x3530, + // Block 0x14, offset 0x500 + 0x500: 0x321f, 0x501: 0x3535, 0x502: 0x3224, 0x503: 0x353a, 0x504: 0x3233, 0x505: 0x3549, + 0x506: 0x322e, 0x507: 0x3544, 0x508: 0x3238, 0x509: 0x3553, 0x50a: 0x323d, 0x50b: 0x3558, + 0x50c: 0x3242, 0x50d: 0x355d, 0x50e: 0x3260, 0x50f: 0x357b, 0x510: 0x3279, 0x511: 0x3599, + 0x512: 0x3288, 0x513: 0x35a8, 0x514: 0x328d, 0x515: 0x35ad, 0x516: 0x3391, 0x517: 0x34bd, + 0x518: 0x354e, 0x519: 0x358a, 0x51b: 0x35e8, + 0x520: 0x46b8, 0x521: 0x4749, 0x522: 0x2f9a, 0x523: 0x32a6, + 0x524: 0x388f, 0x525: 0x3a1e, 0x526: 0x3888, 0x527: 0x3a17, 0x528: 0x389d, 0x529: 0x3a2c, + 0x52a: 0x3896, 0x52b: 0x3a25, 0x52c: 0x38d5, 0x52d: 0x3a64, 0x52e: 0x38ab, 0x52f: 0x3a3a, + 0x530: 0x38a4, 0x531: 0x3a33, 0x532: 0x38b9, 0x533: 0x3a48, 0x534: 0x38b2, 0x535: 0x3a41, + 0x536: 0x38dc, 0x537: 0x3a6b, 0x538: 0x46cc, 0x539: 0x475d, 0x53a: 0x3017, 0x53b: 0x3323, + 0x53c: 0x3003, 0x53d: 0x330f, 0x53e: 0x38f1, 0x53f: 0x3a80, + // Block 0x15, offset 0x540 + 0x540: 0x38ea, 0x541: 0x3a79, 0x542: 0x38ff, 0x543: 0x3a8e, 0x544: 0x38f8, 0x545: 0x3a87, + 0x546: 0x3914, 0x547: 0x3aa3, 0x548: 0x30a8, 0x549: 0x33b4, 0x54a: 0x30bc, 0x54b: 0x33c8, + 0x54c: 0x46fe, 0x54d: 0x478f, 0x54e: 0x314d, 0x54f: 0x345e, 0x550: 0x3937, 0x551: 0x3ac6, + 0x552: 0x3930, 0x553: 0x3abf, 0x554: 0x3945, 0x555: 0x3ad4, 0x556: 0x393e, 0x557: 0x3acd, + 0x558: 0x39a0, 0x559: 0x3b2f, 0x55a: 0x3984, 0x55b: 0x3b13, 0x55c: 0x397d, 0x55d: 0x3b0c, + 0x55e: 0x3992, 0x55f: 0x3b21, 0x560: 0x398b, 0x561: 0x3b1a, 0x562: 0x3999, 0x563: 0x3b28, + 0x564: 0x31fc, 0x565: 0x3512, 0x566: 0x31de, 0x567: 0x34f4, 0x568: 0x39fb, 0x569: 0x3b8a, + 0x56a: 0x39f4, 0x56b: 0x3b83, 0x56c: 0x3a09, 0x56d: 0x3b98, 0x56e: 0x3a02, 0x56f: 0x3b91, + 0x570: 0x3a10, 0x571: 0x3b9f, 0x572: 0x3247, 0x573: 0x3562, 0x574: 0x326f, 0x575: 0x358f, + 0x576: 0x326a, 0x577: 0x3585, 0x578: 0x3256, 0x579: 0x3571, + // Block 0x16, offset 0x580 + 0x580: 0x481b, 0x581: 0x4821, 0x582: 0x4935, 0x583: 0x494d, 0x584: 0x493d, 0x585: 0x4955, + 0x586: 0x4945, 0x587: 0x495d, 0x588: 0x47c1, 0x589: 0x47c7, 0x58a: 0x48a5, 0x58b: 0x48bd, + 0x58c: 0x48ad, 0x58d: 0x48c5, 0x58e: 0x48b5, 0x58f: 0x48cd, 0x590: 0x482d, 0x591: 0x4833, + 0x592: 0x3dcf, 0x593: 0x3ddf, 0x594: 0x3dd7, 0x595: 0x3de7, + 0x598: 0x47cd, 0x599: 0x47d3, 0x59a: 0x3cff, 0x59b: 0x3d0f, 0x59c: 0x3d07, 0x59d: 0x3d17, + 0x5a0: 0x4845, 0x5a1: 0x484b, 0x5a2: 0x4965, 0x5a3: 0x497d, + 0x5a4: 0x496d, 0x5a5: 0x4985, 0x5a6: 0x4975, 0x5a7: 0x498d, 0x5a8: 0x47d9, 0x5a9: 0x47df, + 0x5aa: 0x48d5, 0x5ab: 0x48ed, 0x5ac: 0x48dd, 0x5ad: 0x48f5, 0x5ae: 0x48e5, 0x5af: 0x48fd, + 0x5b0: 0x485d, 0x5b1: 0x4863, 0x5b2: 0x3e2f, 0x5b3: 0x3e47, 0x5b4: 0x3e37, 0x5b5: 0x3e4f, + 0x5b6: 0x3e3f, 0x5b7: 0x3e57, 0x5b8: 0x47e5, 0x5b9: 0x47eb, 0x5ba: 0x3d2f, 0x5bb: 0x3d47, + 0x5bc: 0x3d37, 0x5bd: 0x3d4f, 0x5be: 0x3d3f, 0x5bf: 0x3d57, + // Block 0x17, offset 0x5c0 + 0x5c0: 0x4869, 0x5c1: 0x486f, 0x5c2: 0x3e5f, 0x5c3: 0x3e6f, 0x5c4: 0x3e67, 0x5c5: 0x3e77, + 0x5c8: 0x47f1, 0x5c9: 0x47f7, 0x5ca: 0x3d5f, 0x5cb: 0x3d6f, + 0x5cc: 0x3d67, 0x5cd: 0x3d77, 0x5d0: 0x487b, 0x5d1: 0x4881, + 0x5d2: 0x3e97, 0x5d3: 0x3eaf, 0x5d4: 0x3e9f, 0x5d5: 0x3eb7, 0x5d6: 0x3ea7, 0x5d7: 0x3ebf, + 0x5d9: 0x47fd, 0x5db: 0x3d7f, 0x5dd: 0x3d87, + 0x5df: 0x3d8f, 0x5e0: 0x4893, 0x5e1: 0x4899, 0x5e2: 0x4995, 0x5e3: 0x49ad, + 0x5e4: 0x499d, 0x5e5: 0x49b5, 0x5e6: 0x49a5, 0x5e7: 0x49bd, 0x5e8: 0x4803, 0x5e9: 0x4809, + 0x5ea: 0x4905, 0x5eb: 0x491d, 0x5ec: 0x490d, 0x5ed: 0x4925, 0x5ee: 0x4915, 0x5ef: 0x492d, + 0x5f0: 0x480f, 0x5f1: 0x4335, 0x5f2: 0x36a8, 0x5f3: 0x433b, 0x5f4: 0x4839, 0x5f5: 0x4341, + 0x5f6: 0x36ba, 0x5f7: 0x4347, 0x5f8: 0x36d8, 0x5f9: 0x434d, 0x5fa: 0x36f0, 0x5fb: 0x4353, + 0x5fc: 0x4887, 0x5fd: 0x4359, + // Block 0x18, offset 0x600 + 0x600: 0x3db7, 0x601: 0x3dbf, 0x602: 0x419b, 0x603: 0x41b9, 0x604: 0x41a5, 0x605: 0x41c3, + 0x606: 0x41af, 0x607: 0x41cd, 0x608: 0x3cef, 0x609: 0x3cf7, 0x60a: 0x40e7, 0x60b: 0x4105, + 0x60c: 0x40f1, 0x60d: 0x410f, 0x60e: 0x40fb, 0x60f: 0x4119, 0x610: 0x3dff, 0x611: 0x3e07, + 0x612: 0x41d7, 0x613: 0x41f5, 0x614: 0x41e1, 0x615: 0x41ff, 0x616: 0x41eb, 0x617: 0x4209, + 0x618: 0x3d1f, 0x619: 0x3d27, 0x61a: 0x4123, 0x61b: 0x4141, 0x61c: 0x412d, 0x61d: 0x414b, + 0x61e: 0x4137, 0x61f: 0x4155, 0x620: 0x3ed7, 0x621: 0x3edf, 0x622: 0x4213, 0x623: 0x4231, + 0x624: 0x421d, 0x625: 0x423b, 0x626: 0x4227, 0x627: 0x4245, 0x628: 0x3d97, 0x629: 0x3d9f, + 0x62a: 0x415f, 0x62b: 0x417d, 0x62c: 0x4169, 0x62d: 0x4187, 0x62e: 0x4173, 0x62f: 0x4191, + 0x630: 0x369c, 0x631: 0x3696, 0x632: 0x3da7, 0x633: 0x36a2, 0x634: 0x3daf, + 0x636: 0x4827, 0x637: 0x3dc7, 0x638: 0x360c, 0x639: 0x3606, 0x63a: 0x35fa, 0x63b: 0x4305, + 0x63c: 0x3612, 0x63d: 0x8100, 0x63e: 0x01d6, 0x63f: 0xa100, + // Block 0x19, offset 0x640 + 0x640: 0x8100, 0x641: 0x35be, 0x642: 0x3def, 0x643: 0x36b4, 0x644: 0x3df7, + 0x646: 0x4851, 0x647: 0x3e0f, 0x648: 0x3618, 0x649: 0x430b, 0x64a: 0x3624, 0x64b: 0x4311, + 0x64c: 0x3630, 0x64d: 0x3ba6, 0x64e: 0x3bad, 0x64f: 0x3bb4, 0x650: 0x36cc, 0x651: 0x36c6, + 0x652: 0x3e17, 0x653: 0x44fb, 0x656: 0x36d2, 0x657: 0x3e27, + 0x658: 0x3648, 0x659: 0x3642, 0x65a: 0x3636, 0x65b: 0x4317, 0x65d: 0x3bbb, + 0x65e: 0x3bc2, 0x65f: 0x3bc9, 0x660: 0x3702, 0x661: 0x36fc, 0x662: 0x3e7f, 0x663: 0x4503, + 0x664: 0x36e4, 0x665: 0x36ea, 0x666: 0x3708, 0x667: 0x3e8f, 0x668: 0x3678, 0x669: 0x3672, + 0x66a: 0x3666, 0x66b: 0x4323, 0x66c: 0x3660, 0x66d: 0x35b2, 0x66e: 0x42ff, 0x66f: 0x0081, + 0x672: 0x3ec7, 0x673: 0x370e, 0x674: 0x3ecf, + 0x676: 0x489f, 0x677: 0x3ee7, 0x678: 0x3654, 0x679: 0x431d, 0x67a: 0x3684, 0x67b: 0x432f, + 0x67c: 0x3690, 0x67d: 0x426d, 0x67e: 0xa100, + // Block 0x1a, offset 0x680 + 0x681: 0x3c1d, 0x683: 0xa000, 0x684: 0x3c24, 0x685: 0xa000, + 0x687: 0x3c2b, 0x688: 0xa000, 0x689: 0x3c32, + 0x68d: 0xa000, + 0x6a0: 0x2f7c, 0x6a1: 0xa000, 0x6a2: 0x3c40, + 0x6a4: 0xa000, 0x6a5: 0xa000, + 0x6ad: 0x3c39, 0x6ae: 0x2f77, 0x6af: 0x2f81, + 0x6b0: 0x3c47, 0x6b1: 0x3c4e, 0x6b2: 0xa000, 0x6b3: 0xa000, 0x6b4: 0x3c55, 0x6b5: 0x3c5c, + 0x6b6: 0xa000, 0x6b7: 0xa000, 0x6b8: 0x3c63, 0x6b9: 0x3c6a, 0x6ba: 0xa000, 0x6bb: 0xa000, + 0x6bc: 0xa000, 0x6bd: 0xa000, + // Block 0x1b, offset 0x6c0 + 0x6c0: 0x3c71, 0x6c1: 0x3c78, 0x6c2: 0xa000, 0x6c3: 0xa000, 0x6c4: 0x3c8d, 0x6c5: 0x3c94, + 0x6c6: 0xa000, 0x6c7: 0xa000, 0x6c8: 0x3c9b, 0x6c9: 0x3ca2, + 0x6d1: 0xa000, + 0x6d2: 0xa000, + 0x6e2: 0xa000, + 0x6e8: 0xa000, 0x6e9: 0xa000, + 0x6eb: 0xa000, 0x6ec: 0x3cb7, 0x6ed: 0x3cbe, 0x6ee: 0x3cc5, 0x6ef: 0x3ccc, + 0x6f2: 0xa000, 0x6f3: 0xa000, 0x6f4: 0xa000, 0x6f5: 0xa000, + // Block 0x1c, offset 0x700 + 0x706: 0xa000, 0x70b: 0xa000, + 0x70c: 0x3f1f, 0x70d: 0xa000, 0x70e: 0x3f27, 0x70f: 0xa000, 0x710: 0x3f2f, 0x711: 0xa000, + 0x712: 0x3f37, 0x713: 0xa000, 0x714: 0x3f3f, 0x715: 0xa000, 0x716: 0x3f47, 0x717: 0xa000, + 0x718: 0x3f4f, 0x719: 0xa000, 0x71a: 0x3f57, 0x71b: 0xa000, 0x71c: 0x3f5f, 0x71d: 0xa000, + 0x71e: 0x3f67, 0x71f: 0xa000, 0x720: 0x3f6f, 0x721: 0xa000, 0x722: 0x3f77, + 0x724: 0xa000, 0x725: 0x3f7f, 0x726: 0xa000, 0x727: 0x3f87, 0x728: 0xa000, 0x729: 0x3f8f, + 0x72f: 0xa000, + 0x730: 0x3f97, 0x731: 0x3f9f, 0x732: 0xa000, 0x733: 0x3fa7, 0x734: 0x3faf, 0x735: 0xa000, + 0x736: 0x3fb7, 0x737: 0x3fbf, 0x738: 0xa000, 0x739: 0x3fc7, 0x73a: 0x3fcf, 0x73b: 0xa000, + 0x73c: 0x3fd7, 0x73d: 0x3fdf, + // Block 0x1d, offset 0x740 + 0x754: 0x3f17, + 0x759: 0x9904, 0x75a: 0x9904, 0x75b: 0x8100, 0x75c: 0x8100, 0x75d: 0xa000, + 0x75e: 0x3fe7, + 0x766: 0xa000, + 0x76b: 0xa000, 0x76c: 0x3ff7, 0x76d: 0xa000, 0x76e: 0x3fff, 0x76f: 0xa000, + 0x770: 0x4007, 0x771: 0xa000, 0x772: 0x400f, 0x773: 0xa000, 0x774: 0x4017, 0x775: 0xa000, + 0x776: 0x401f, 0x777: 0xa000, 0x778: 0x4027, 0x779: 0xa000, 0x77a: 0x402f, 0x77b: 0xa000, + 0x77c: 0x4037, 0x77d: 0xa000, 0x77e: 0x403f, 0x77f: 0xa000, + // Block 0x1e, offset 0x780 + 0x780: 0x4047, 0x781: 0xa000, 0x782: 0x404f, 0x784: 0xa000, 0x785: 0x4057, + 0x786: 0xa000, 0x787: 0x405f, 0x788: 0xa000, 0x789: 0x4067, + 0x78f: 0xa000, 0x790: 0x406f, 0x791: 0x4077, + 0x792: 0xa000, 0x793: 0x407f, 0x794: 0x4087, 0x795: 0xa000, 0x796: 0x408f, 0x797: 0x4097, + 0x798: 0xa000, 0x799: 0x409f, 0x79a: 0x40a7, 0x79b: 0xa000, 0x79c: 0x40af, 0x79d: 0x40b7, + 0x7af: 0xa000, + 0x7b0: 0xa000, 0x7b1: 0xa000, 0x7b2: 0xa000, 0x7b4: 0x3fef, + 0x7b7: 0x40bf, 0x7b8: 0x40c7, 0x7b9: 0x40cf, 0x7ba: 0x40d7, + 0x7bd: 0xa000, 0x7be: 0x40df, + // Block 0x1f, offset 0x7c0 + 0x7c0: 0x137a, 0x7c1: 0x0cfe, 0x7c2: 0x13d6, 0x7c3: 0x13a2, 0x7c4: 0x0e5a, 0x7c5: 0x06ee, + 0x7c6: 0x08e2, 0x7c7: 0x162e, 0x7c8: 0x162e, 0x7c9: 0x0a0e, 0x7ca: 0x1462, 0x7cb: 0x0946, + 0x7cc: 0x0a0a, 0x7cd: 0x0bf2, 0x7ce: 0x0fd2, 0x7cf: 0x1162, 0x7d0: 0x129a, 0x7d1: 0x12d6, + 0x7d2: 0x130a, 0x7d3: 0x141e, 0x7d4: 0x0d76, 0x7d5: 0x0e02, 0x7d6: 0x0eae, 0x7d7: 0x0f46, + 0x7d8: 0x1262, 0x7d9: 0x144a, 0x7da: 0x1576, 0x7db: 0x0712, 0x7dc: 0x08b6, 0x7dd: 0x0d8a, + 0x7de: 0x0ed2, 0x7df: 0x1296, 0x7e0: 0x15c6, 0x7e1: 0x0ab6, 0x7e2: 0x0e7a, 0x7e3: 0x1286, + 0x7e4: 0x131a, 0x7e5: 0x0c26, 0x7e6: 0x11be, 0x7e7: 0x12e2, 0x7e8: 0x0b22, 0x7e9: 0x0d12, + 0x7ea: 0x0e1a, 0x7eb: 0x0f1e, 0x7ec: 0x142a, 0x7ed: 0x0752, 0x7ee: 0x07ea, 0x7ef: 0x0856, + 0x7f0: 0x0c8e, 0x7f1: 0x0d82, 0x7f2: 0x0ece, 0x7f3: 0x0ff2, 0x7f4: 0x117a, 0x7f5: 0x128e, + 0x7f6: 0x12a6, 0x7f7: 0x13ca, 0x7f8: 0x14f2, 0x7f9: 0x15a6, 0x7fa: 0x15c2, 0x7fb: 0x102e, + 0x7fc: 0x106e, 0x7fd: 0x1126, 0x7fe: 0x1246, 0x7ff: 0x147e, + // Block 0x20, offset 0x800 + 0x800: 0x15ce, 0x801: 0x134e, 0x802: 0x09ca, 0x803: 0x0b3e, 0x804: 0x10de, 0x805: 0x119e, + 0x806: 0x0f02, 0x807: 0x1036, 0x808: 0x139a, 0x809: 0x14ea, 0x80a: 0x09c6, 0x80b: 0x0a92, + 0x80c: 0x0d7a, 0x80d: 0x0e2e, 0x80e: 0x0e62, 0x80f: 0x1116, 0x810: 0x113e, 0x811: 0x14aa, + 0x812: 0x0852, 0x813: 0x11aa, 0x814: 0x07f6, 0x815: 0x07f2, 0x816: 0x109a, 0x817: 0x112a, + 0x818: 0x125e, 0x819: 0x14b2, 0x81a: 0x136a, 0x81b: 0x0c2a, 0x81c: 0x0d76, 0x81d: 0x135a, + 0x81e: 0x06fa, 0x81f: 0x0a66, 0x820: 0x0b96, 0x821: 0x0f32, 0x822: 0x0fb2, 0x823: 0x0876, + 0x824: 0x103e, 0x825: 0x0762, 0x826: 0x0b7a, 0x827: 0x06da, 0x828: 0x0dee, 0x829: 0x0ca6, + 0x82a: 0x1112, 0x82b: 0x08ca, 0x82c: 0x09b6, 0x82d: 0x0ffe, 0x82e: 0x1266, 0x82f: 0x133e, + 0x830: 0x0dba, 0x831: 0x13fa, 0x832: 0x0de6, 0x833: 0x0c3a, 0x834: 0x121e, 0x835: 0x0c5a, + 0x836: 0x0fae, 0x837: 0x072e, 0x838: 0x07aa, 0x839: 0x07ee, 0x83a: 0x0d56, 0x83b: 0x10fe, + 0x83c: 0x11f6, 0x83d: 0x134a, 0x83e: 0x145e, 0x83f: 0x085e, + // Block 0x21, offset 0x840 + 0x840: 0x0912, 0x841: 0x0a1a, 0x842: 0x0b32, 0x843: 0x0cc2, 0x844: 0x0e7e, 0x845: 0x1042, + 0x846: 0x149a, 0x847: 0x157e, 0x848: 0x15d2, 0x849: 0x15ea, 0x84a: 0x083a, 0x84b: 0x0cf6, + 0x84c: 0x0da6, 0x84d: 0x13ee, 0x84e: 0x0afe, 0x84f: 0x0bda, 0x850: 0x0bf6, 0x851: 0x0c86, + 0x852: 0x0e6e, 0x853: 0x0eba, 0x854: 0x0f6a, 0x855: 0x108e, 0x856: 0x1132, 0x857: 0x1196, + 0x858: 0x13de, 0x859: 0x126e, 0x85a: 0x1406, 0x85b: 0x1482, 0x85c: 0x0812, 0x85d: 0x083e, + 0x85e: 0x0926, 0x85f: 0x0eaa, 0x860: 0x12f6, 0x861: 0x133e, 0x862: 0x0b1e, 0x863: 0x0b8e, + 0x864: 0x0c52, 0x865: 0x0db2, 0x866: 0x10da, 0x867: 0x0f26, 0x868: 0x073e, 0x869: 0x0982, + 0x86a: 0x0a66, 0x86b: 0x0aca, 0x86c: 0x0b9a, 0x86d: 0x0f42, 0x86e: 0x0f5e, 0x86f: 0x116e, + 0x870: 0x118e, 0x871: 0x1466, 0x872: 0x14e6, 0x873: 0x14f6, 0x874: 0x1532, 0x875: 0x0756, + 0x876: 0x1082, 0x877: 0x1452, 0x878: 0x14ce, 0x879: 0x0bb2, 0x87a: 0x071a, 0x87b: 0x077a, + 0x87c: 0x0a6a, 0x87d: 0x0a8a, 0x87e: 0x0cb2, 0x87f: 0x0d76, + // Block 0x22, offset 0x880 + 0x880: 0x0ec6, 0x881: 0x0fce, 0x882: 0x127a, 0x883: 0x141a, 0x884: 0x1626, 0x885: 0x0ce6, + 0x886: 0x14a6, 0x887: 0x0836, 0x888: 0x0d32, 0x889: 0x0d3e, 0x88a: 0x0e12, 0x88b: 0x0e4a, + 0x88c: 0x0f4e, 0x88d: 0x0faa, 0x88e: 0x102a, 0x88f: 0x110e, 0x890: 0x153e, 0x891: 0x07b2, + 0x892: 0x0c06, 0x893: 0x14b6, 0x894: 0x076a, 0x895: 0x0aae, 0x896: 0x0e32, 0x897: 0x13e2, + 0x898: 0x0b6a, 0x899: 0x0bba, 0x89a: 0x0d46, 0x89b: 0x0f32, 0x89c: 0x14be, 0x89d: 0x081a, + 0x89e: 0x0902, 0x89f: 0x0a9a, 0x8a0: 0x0cd6, 0x8a1: 0x0d22, 0x8a2: 0x0d62, 0x8a3: 0x0df6, + 0x8a4: 0x0f4a, 0x8a5: 0x0fbe, 0x8a6: 0x115a, 0x8a7: 0x12fa, 0x8a8: 0x1306, 0x8a9: 0x145a, + 0x8aa: 0x14da, 0x8ab: 0x0886, 0x8ac: 0x0e4e, 0x8ad: 0x0906, 0x8ae: 0x0eca, 0x8af: 0x0f6e, + 0x8b0: 0x128a, 0x8b1: 0x14c2, 0x8b2: 0x15ae, 0x8b3: 0x15d6, 0x8b4: 0x0d3a, 0x8b5: 0x0e2a, + 0x8b6: 0x11c6, 0x8b7: 0x10ba, 0x8b8: 0x10c6, 0x8b9: 0x10ea, 0x8ba: 0x0f1a, 0x8bb: 0x0ea2, + 0x8bc: 0x1366, 0x8bd: 0x0736, 0x8be: 0x122e, 0x8bf: 0x081e, + // Block 0x23, offset 0x8c0 + 0x8c0: 0x080e, 0x8c1: 0x0b0e, 0x8c2: 0x0c2e, 0x8c3: 0x10f6, 0x8c4: 0x0a56, 0x8c5: 0x0e06, + 0x8c6: 0x0cf2, 0x8c7: 0x13ea, 0x8c8: 0x12ea, 0x8c9: 0x14ae, 0x8ca: 0x1326, 0x8cb: 0x0b2a, + 0x8cc: 0x078a, 0x8cd: 0x095e, 0x8d0: 0x09b2, + 0x8d2: 0x0ce2, 0x8d5: 0x07fa, 0x8d6: 0x0f22, 0x8d7: 0x0fe6, + 0x8d8: 0x104a, 0x8d9: 0x1066, 0x8da: 0x106a, 0x8db: 0x107e, 0x8dc: 0x14fe, 0x8dd: 0x10ee, + 0x8de: 0x1172, 0x8e0: 0x1292, 0x8e2: 0x1356, + 0x8e5: 0x140a, 0x8e6: 0x1436, + 0x8ea: 0x1552, 0x8eb: 0x1556, 0x8ec: 0x155a, 0x8ed: 0x15be, 0x8ee: 0x142e, 0x8ef: 0x14ca, + 0x8f0: 0x075a, 0x8f1: 0x077e, 0x8f2: 0x0792, 0x8f3: 0x084e, 0x8f4: 0x085a, 0x8f5: 0x089a, + 0x8f6: 0x094e, 0x8f7: 0x096a, 0x8f8: 0x0972, 0x8f9: 0x09ae, 0x8fa: 0x09ba, 0x8fb: 0x0a96, + 0x8fc: 0x0a9e, 0x8fd: 0x0ba6, 0x8fe: 0x0bce, 0x8ff: 0x0bd6, + // Block 0x24, offset 0x900 + 0x900: 0x0bee, 0x901: 0x0c9a, 0x902: 0x0cca, 0x903: 0x0cea, 0x904: 0x0d5a, 0x905: 0x0e1e, + 0x906: 0x0e3a, 0x907: 0x0e6a, 0x908: 0x0ebe, 0x909: 0x0ede, 0x90a: 0x0f52, 0x90b: 0x1032, + 0x90c: 0x104e, 0x90d: 0x1056, 0x90e: 0x1052, 0x90f: 0x105a, 0x910: 0x105e, 0x911: 0x1062, + 0x912: 0x1076, 0x913: 0x107a, 0x914: 0x109e, 0x915: 0x10b2, 0x916: 0x10ce, 0x917: 0x1132, + 0x918: 0x113a, 0x919: 0x1142, 0x91a: 0x1156, 0x91b: 0x117e, 0x91c: 0x11ce, 0x91d: 0x1202, + 0x91e: 0x1202, 0x91f: 0x126a, 0x920: 0x1312, 0x921: 0x132a, 0x922: 0x135e, 0x923: 0x1362, + 0x924: 0x13a6, 0x925: 0x13aa, 0x926: 0x1402, 0x927: 0x140a, 0x928: 0x14de, 0x929: 0x1522, + 0x92a: 0x153a, 0x92b: 0x0b9e, 0x92c: 0x1721, 0x92d: 0x11e6, + 0x930: 0x06e2, 0x931: 0x07e6, 0x932: 0x07a6, 0x933: 0x074e, 0x934: 0x078e, 0x935: 0x07ba, + 0x936: 0x084a, 0x937: 0x0866, 0x938: 0x094e, 0x939: 0x093a, 0x93a: 0x094a, 0x93b: 0x0966, + 0x93c: 0x09b2, 0x93d: 0x09c2, 0x93e: 0x0a06, 0x93f: 0x0a12, + // Block 0x25, offset 0x940 + 0x940: 0x0a2e, 0x941: 0x0a3e, 0x942: 0x0b26, 0x943: 0x0b2e, 0x944: 0x0b5e, 0x945: 0x0b7e, + 0x946: 0x0bae, 0x947: 0x0bc6, 0x948: 0x0bb6, 0x949: 0x0bd6, 0x94a: 0x0bca, 0x94b: 0x0bee, + 0x94c: 0x0c0a, 0x94d: 0x0c62, 0x94e: 0x0c6e, 0x94f: 0x0c76, 0x950: 0x0c9e, 0x951: 0x0ce2, + 0x952: 0x0d12, 0x953: 0x0d16, 0x954: 0x0d2a, 0x955: 0x0daa, 0x956: 0x0dba, 0x957: 0x0e12, + 0x958: 0x0e5e, 0x959: 0x0e56, 0x95a: 0x0e6a, 0x95b: 0x0e86, 0x95c: 0x0ebe, 0x95d: 0x1016, + 0x95e: 0x0ee2, 0x95f: 0x0f16, 0x960: 0x0f22, 0x961: 0x0f62, 0x962: 0x0f7e, 0x963: 0x0fa2, + 0x964: 0x0fc6, 0x965: 0x0fca, 0x966: 0x0fe6, 0x967: 0x0fea, 0x968: 0x0ffa, 0x969: 0x100e, + 0x96a: 0x100a, 0x96b: 0x103a, 0x96c: 0x10b6, 0x96d: 0x10ce, 0x96e: 0x10e6, 0x96f: 0x111e, + 0x970: 0x1132, 0x971: 0x114e, 0x972: 0x117e, 0x973: 0x1232, 0x974: 0x125a, 0x975: 0x12ce, + 0x976: 0x1316, 0x977: 0x1322, 0x978: 0x132a, 0x979: 0x1342, 0x97a: 0x1356, 0x97b: 0x1346, + 0x97c: 0x135e, 0x97d: 0x135a, 0x97e: 0x1352, 0x97f: 0x1362, + // Block 0x26, offset 0x980 + 0x980: 0x136e, 0x981: 0x13aa, 0x982: 0x13e6, 0x983: 0x1416, 0x984: 0x144e, 0x985: 0x146e, + 0x986: 0x14ba, 0x987: 0x14de, 0x988: 0x14fe, 0x989: 0x1512, 0x98a: 0x1522, 0x98b: 0x152e, + 0x98c: 0x153a, 0x98d: 0x158e, 0x98e: 0x162e, 0x98f: 0x16b8, 0x990: 0x16b3, 0x991: 0x16e5, + 0x992: 0x060a, 0x993: 0x0632, 0x994: 0x0636, 0x995: 0x1767, 0x996: 0x1794, 0x997: 0x180c, + 0x998: 0x161a, 0x999: 0x162a, + // Block 0x27, offset 0x9c0 + 0x9c0: 0x06fe, 0x9c1: 0x06f6, 0x9c2: 0x0706, 0x9c3: 0x164a, 0x9c4: 0x074a, 0x9c5: 0x075a, + 0x9c6: 0x075e, 0x9c7: 0x0766, 0x9c8: 0x076e, 0x9c9: 0x0772, 0x9ca: 0x077e, 0x9cb: 0x0776, + 0x9cc: 0x05b6, 0x9cd: 0x165e, 0x9ce: 0x0792, 0x9cf: 0x0796, 0x9d0: 0x079a, 0x9d1: 0x07b6, + 0x9d2: 0x164f, 0x9d3: 0x05ba, 0x9d4: 0x07a2, 0x9d5: 0x07c2, 0x9d6: 0x1659, 0x9d7: 0x07d2, + 0x9d8: 0x07da, 0x9d9: 0x073a, 0x9da: 0x07e2, 0x9db: 0x07e6, 0x9dc: 0x1834, 0x9dd: 0x0802, + 0x9de: 0x080a, 0x9df: 0x05c2, 0x9e0: 0x0822, 0x9e1: 0x0826, 0x9e2: 0x082e, 0x9e3: 0x0832, + 0x9e4: 0x05c6, 0x9e5: 0x084a, 0x9e6: 0x084e, 0x9e7: 0x085a, 0x9e8: 0x0866, 0x9e9: 0x086a, + 0x9ea: 0x086e, 0x9eb: 0x0876, 0x9ec: 0x0896, 0x9ed: 0x089a, 0x9ee: 0x08a2, 0x9ef: 0x08b2, + 0x9f0: 0x08ba, 0x9f1: 0x08be, 0x9f2: 0x08be, 0x9f3: 0x08be, 0x9f4: 0x166d, 0x9f5: 0x0e96, + 0x9f6: 0x08d2, 0x9f7: 0x08da, 0x9f8: 0x1672, 0x9f9: 0x08e6, 0x9fa: 0x08ee, 0x9fb: 0x08f6, + 0x9fc: 0x091e, 0x9fd: 0x090a, 0x9fe: 0x0916, 0x9ff: 0x091a, + // Block 0x28, offset 0xa00 + 0xa00: 0x0922, 0xa01: 0x092a, 0xa02: 0x092e, 0xa03: 0x0936, 0xa04: 0x093e, 0xa05: 0x0942, + 0xa06: 0x0942, 0xa07: 0x094a, 0xa08: 0x0952, 0xa09: 0x0956, 0xa0a: 0x0962, 0xa0b: 0x0986, + 0xa0c: 0x096a, 0xa0d: 0x098a, 0xa0e: 0x096e, 0xa0f: 0x0976, 0xa10: 0x080e, 0xa11: 0x09d2, + 0xa12: 0x099a, 0xa13: 0x099e, 0xa14: 0x09a2, 0xa15: 0x0996, 0xa16: 0x09aa, 0xa17: 0x09a6, + 0xa18: 0x09be, 0xa19: 0x1677, 0xa1a: 0x09da, 0xa1b: 0x09de, 0xa1c: 0x09e6, 0xa1d: 0x09f2, + 0xa1e: 0x09fa, 0xa1f: 0x0a16, 0xa20: 0x167c, 0xa21: 0x1681, 0xa22: 0x0a22, 0xa23: 0x0a26, + 0xa24: 0x0a2a, 0xa25: 0x0a1e, 0xa26: 0x0a32, 0xa27: 0x05ca, 0xa28: 0x05ce, 0xa29: 0x0a3a, + 0xa2a: 0x0a42, 0xa2b: 0x0a42, 0xa2c: 0x1686, 0xa2d: 0x0a5e, 0xa2e: 0x0a62, 0xa2f: 0x0a66, + 0xa30: 0x0a6e, 0xa31: 0x168b, 0xa32: 0x0a76, 0xa33: 0x0a7a, 0xa34: 0x0b52, 0xa35: 0x0a82, + 0xa36: 0x05d2, 0xa37: 0x0a8e, 0xa38: 0x0a9e, 0xa39: 0x0aaa, 0xa3a: 0x0aa6, 0xa3b: 0x1695, + 0xa3c: 0x0ab2, 0xa3d: 0x169a, 0xa3e: 0x0abe, 0xa3f: 0x0aba, + // Block 0x29, offset 0xa40 + 0xa40: 0x0ac2, 0xa41: 0x0ad2, 0xa42: 0x0ad6, 0xa43: 0x05d6, 0xa44: 0x0ae6, 0xa45: 0x0aee, + 0xa46: 0x0af2, 0xa47: 0x0af6, 0xa48: 0x05da, 0xa49: 0x169f, 0xa4a: 0x05de, 0xa4b: 0x0b12, + 0xa4c: 0x0b16, 0xa4d: 0x0b1a, 0xa4e: 0x0b22, 0xa4f: 0x1866, 0xa50: 0x0b3a, 0xa51: 0x16a9, + 0xa52: 0x16a9, 0xa53: 0x11da, 0xa54: 0x0b4a, 0xa55: 0x0b4a, 0xa56: 0x05e2, 0xa57: 0x16cc, + 0xa58: 0x179e, 0xa59: 0x0b5a, 0xa5a: 0x0b62, 0xa5b: 0x05e6, 0xa5c: 0x0b76, 0xa5d: 0x0b86, + 0xa5e: 0x0b8a, 0xa5f: 0x0b92, 0xa60: 0x0ba2, 0xa61: 0x05ee, 0xa62: 0x05ea, 0xa63: 0x0ba6, + 0xa64: 0x16ae, 0xa65: 0x0baa, 0xa66: 0x0bbe, 0xa67: 0x0bc2, 0xa68: 0x0bc6, 0xa69: 0x0bc2, + 0xa6a: 0x0bd2, 0xa6b: 0x0bd6, 0xa6c: 0x0be6, 0xa6d: 0x0bde, 0xa6e: 0x0be2, 0xa6f: 0x0bea, + 0xa70: 0x0bee, 0xa71: 0x0bf2, 0xa72: 0x0bfe, 0xa73: 0x0c02, 0xa74: 0x0c1a, 0xa75: 0x0c22, + 0xa76: 0x0c32, 0xa77: 0x0c46, 0xa78: 0x16bd, 0xa79: 0x0c42, 0xa7a: 0x0c36, 0xa7b: 0x0c4e, + 0xa7c: 0x0c56, 0xa7d: 0x0c6a, 0xa7e: 0x16c2, 0xa7f: 0x0c72, + // Block 0x2a, offset 0xa80 + 0xa80: 0x0c66, 0xa81: 0x0c5e, 0xa82: 0x05f2, 0xa83: 0x0c7a, 0xa84: 0x0c82, 0xa85: 0x0c8a, + 0xa86: 0x0c7e, 0xa87: 0x05f6, 0xa88: 0x0c9a, 0xa89: 0x0ca2, 0xa8a: 0x16c7, 0xa8b: 0x0cce, + 0xa8c: 0x0d02, 0xa8d: 0x0cde, 0xa8e: 0x0602, 0xa8f: 0x0cea, 0xa90: 0x05fe, 0xa91: 0x05fa, + 0xa92: 0x07c6, 0xa93: 0x07ca, 0xa94: 0x0d06, 0xa95: 0x0cee, 0xa96: 0x11ae, 0xa97: 0x0666, + 0xa98: 0x0d12, 0xa99: 0x0d16, 0xa9a: 0x0d1a, 0xa9b: 0x0d2e, 0xa9c: 0x0d26, 0xa9d: 0x16e0, + 0xa9e: 0x0606, 0xa9f: 0x0d42, 0xaa0: 0x0d36, 0xaa1: 0x0d52, 0xaa2: 0x0d5a, 0xaa3: 0x16ea, + 0xaa4: 0x0d5e, 0xaa5: 0x0d4a, 0xaa6: 0x0d66, 0xaa7: 0x060a, 0xaa8: 0x0d6a, 0xaa9: 0x0d6e, + 0xaaa: 0x0d72, 0xaab: 0x0d7e, 0xaac: 0x16ef, 0xaad: 0x0d86, 0xaae: 0x060e, 0xaaf: 0x0d92, + 0xab0: 0x16f4, 0xab1: 0x0d96, 0xab2: 0x0612, 0xab3: 0x0da2, 0xab4: 0x0dae, 0xab5: 0x0dba, + 0xab6: 0x0dbe, 0xab7: 0x16f9, 0xab8: 0x1690, 0xab9: 0x16fe, 0xaba: 0x0dde, 0xabb: 0x1703, + 0xabc: 0x0dea, 0xabd: 0x0df2, 0xabe: 0x0de2, 0xabf: 0x0dfe, + // Block 0x2b, offset 0xac0 + 0xac0: 0x0e0e, 0xac1: 0x0e1e, 0xac2: 0x0e12, 0xac3: 0x0e16, 0xac4: 0x0e22, 0xac5: 0x0e26, + 0xac6: 0x1708, 0xac7: 0x0e0a, 0xac8: 0x0e3e, 0xac9: 0x0e42, 0xaca: 0x0616, 0xacb: 0x0e56, + 0xacc: 0x0e52, 0xacd: 0x170d, 0xace: 0x0e36, 0xacf: 0x0e72, 0xad0: 0x1712, 0xad1: 0x1717, + 0xad2: 0x0e76, 0xad3: 0x0e8a, 0xad4: 0x0e86, 0xad5: 0x0e82, 0xad6: 0x061a, 0xad7: 0x0e8e, + 0xad8: 0x0e9e, 0xad9: 0x0e9a, 0xada: 0x0ea6, 0xadb: 0x1654, 0xadc: 0x0eb6, 0xadd: 0x171c, + 0xade: 0x0ec2, 0xadf: 0x1726, 0xae0: 0x0ed6, 0xae1: 0x0ee2, 0xae2: 0x0ef6, 0xae3: 0x172b, + 0xae4: 0x0f0a, 0xae5: 0x0f0e, 0xae6: 0x1730, 0xae7: 0x1735, 0xae8: 0x0f2a, 0xae9: 0x0f3a, + 0xaea: 0x061e, 0xaeb: 0x0f3e, 0xaec: 0x0622, 0xaed: 0x0622, 0xaee: 0x0f56, 0xaef: 0x0f5a, + 0xaf0: 0x0f62, 0xaf1: 0x0f66, 0xaf2: 0x0f72, 0xaf3: 0x0626, 0xaf4: 0x0f8a, 0xaf5: 0x173a, + 0xaf6: 0x0fa6, 0xaf7: 0x173f, 0xaf8: 0x0fb2, 0xaf9: 0x16a4, 0xafa: 0x0fc2, 0xafb: 0x1744, + 0xafc: 0x1749, 0xafd: 0x174e, 0xafe: 0x062a, 0xaff: 0x062e, + // Block 0x2c, offset 0xb00 + 0xb00: 0x0ffa, 0xb01: 0x1758, 0xb02: 0x1753, 0xb03: 0x175d, 0xb04: 0x1762, 0xb05: 0x1002, + 0xb06: 0x1006, 0xb07: 0x1006, 0xb08: 0x100e, 0xb09: 0x0636, 0xb0a: 0x1012, 0xb0b: 0x063a, + 0xb0c: 0x063e, 0xb0d: 0x176c, 0xb0e: 0x1026, 0xb0f: 0x102e, 0xb10: 0x103a, 0xb11: 0x0642, + 0xb12: 0x1771, 0xb13: 0x105e, 0xb14: 0x1776, 0xb15: 0x177b, 0xb16: 0x107e, 0xb17: 0x1096, + 0xb18: 0x0646, 0xb19: 0x109e, 0xb1a: 0x10a2, 0xb1b: 0x10a6, 0xb1c: 0x1780, 0xb1d: 0x1785, + 0xb1e: 0x1785, 0xb1f: 0x10be, 0xb20: 0x064a, 0xb21: 0x178a, 0xb22: 0x10d2, 0xb23: 0x10d6, + 0xb24: 0x064e, 0xb25: 0x178f, 0xb26: 0x10f2, 0xb27: 0x0652, 0xb28: 0x1102, 0xb29: 0x10fa, + 0xb2a: 0x110a, 0xb2b: 0x1799, 0xb2c: 0x1122, 0xb2d: 0x0656, 0xb2e: 0x112e, 0xb2f: 0x1136, + 0xb30: 0x1146, 0xb31: 0x065a, 0xb32: 0x17a3, 0xb33: 0x17a8, 0xb34: 0x065e, 0xb35: 0x17ad, + 0xb36: 0x115e, 0xb37: 0x17b2, 0xb38: 0x116a, 0xb39: 0x1176, 0xb3a: 0x117e, 0xb3b: 0x17b7, + 0xb3c: 0x17bc, 0xb3d: 0x1192, 0xb3e: 0x17c1, 0xb3f: 0x119a, + // Block 0x2d, offset 0xb40 + 0xb40: 0x16d1, 0xb41: 0x0662, 0xb42: 0x11b2, 0xb43: 0x11b6, 0xb44: 0x066a, 0xb45: 0x11ba, + 0xb46: 0x0a36, 0xb47: 0x17c6, 0xb48: 0x17cb, 0xb49: 0x16d6, 0xb4a: 0x16db, 0xb4b: 0x11da, + 0xb4c: 0x11de, 0xb4d: 0x13f6, 0xb4e: 0x066e, 0xb4f: 0x120a, 0xb50: 0x1206, 0xb51: 0x120e, + 0xb52: 0x0842, 0xb53: 0x1212, 0xb54: 0x1216, 0xb55: 0x121a, 0xb56: 0x1222, 0xb57: 0x17d0, + 0xb58: 0x121e, 0xb59: 0x1226, 0xb5a: 0x123a, 0xb5b: 0x123e, 0xb5c: 0x122a, 0xb5d: 0x1242, + 0xb5e: 0x1256, 0xb5f: 0x126a, 0xb60: 0x1236, 0xb61: 0x124a, 0xb62: 0x124e, 0xb63: 0x1252, + 0xb64: 0x17d5, 0xb65: 0x17df, 0xb66: 0x17da, 0xb67: 0x0672, 0xb68: 0x1272, 0xb69: 0x1276, + 0xb6a: 0x127e, 0xb6b: 0x17f3, 0xb6c: 0x1282, 0xb6d: 0x17e4, 0xb6e: 0x0676, 0xb6f: 0x067a, + 0xb70: 0x17e9, 0xb71: 0x17ee, 0xb72: 0x067e, 0xb73: 0x12a2, 0xb74: 0x12a6, 0xb75: 0x12aa, + 0xb76: 0x12ae, 0xb77: 0x12ba, 0xb78: 0x12b6, 0xb79: 0x12c2, 0xb7a: 0x12be, 0xb7b: 0x12ce, + 0xb7c: 0x12c6, 0xb7d: 0x12ca, 0xb7e: 0x12d2, 0xb7f: 0x0682, + // Block 0x2e, offset 0xb80 + 0xb80: 0x12da, 0xb81: 0x12de, 0xb82: 0x0686, 0xb83: 0x12ee, 0xb84: 0x12f2, 0xb85: 0x17f8, + 0xb86: 0x12fe, 0xb87: 0x1302, 0xb88: 0x068a, 0xb89: 0x130e, 0xb8a: 0x05be, 0xb8b: 0x17fd, + 0xb8c: 0x1802, 0xb8d: 0x068e, 0xb8e: 0x0692, 0xb8f: 0x133a, 0xb90: 0x1352, 0xb91: 0x136e, + 0xb92: 0x137e, 0xb93: 0x1807, 0xb94: 0x1392, 0xb95: 0x1396, 0xb96: 0x13ae, 0xb97: 0x13ba, + 0xb98: 0x1811, 0xb99: 0x1663, 0xb9a: 0x13c6, 0xb9b: 0x13c2, 0xb9c: 0x13ce, 0xb9d: 0x1668, + 0xb9e: 0x13da, 0xb9f: 0x13e6, 0xba0: 0x1816, 0xba1: 0x181b, 0xba2: 0x1426, 0xba3: 0x1432, + 0xba4: 0x143a, 0xba5: 0x1820, 0xba6: 0x143e, 0xba7: 0x146a, 0xba8: 0x1476, 0xba9: 0x147a, + 0xbaa: 0x1472, 0xbab: 0x1486, 0xbac: 0x148a, 0xbad: 0x1825, 0xbae: 0x1496, 0xbaf: 0x0696, + 0xbb0: 0x149e, 0xbb1: 0x182a, 0xbb2: 0x069a, 0xbb3: 0x14d6, 0xbb4: 0x0ac6, 0xbb5: 0x14ee, + 0xbb6: 0x182f, 0xbb7: 0x1839, 0xbb8: 0x069e, 0xbb9: 0x06a2, 0xbba: 0x1516, 0xbbb: 0x183e, + 0xbbc: 0x06a6, 0xbbd: 0x1843, 0xbbe: 0x152e, 0xbbf: 0x152e, + // Block 0x2f, offset 0xbc0 + 0xbc0: 0x1536, 0xbc1: 0x1848, 0xbc2: 0x154e, 0xbc3: 0x06aa, 0xbc4: 0x155e, 0xbc5: 0x156a, + 0xbc6: 0x1572, 0xbc7: 0x157a, 0xbc8: 0x06ae, 0xbc9: 0x184d, 0xbca: 0x158e, 0xbcb: 0x15aa, + 0xbcc: 0x15b6, 0xbcd: 0x06b2, 0xbce: 0x06b6, 0xbcf: 0x15ba, 0xbd0: 0x1852, 0xbd1: 0x06ba, + 0xbd2: 0x1857, 0xbd3: 0x185c, 0xbd4: 0x1861, 0xbd5: 0x15de, 0xbd6: 0x06be, 0xbd7: 0x15f2, + 0xbd8: 0x15fa, 0xbd9: 0x15fe, 0xbda: 0x1606, 0xbdb: 0x160e, 0xbdc: 0x1616, 0xbdd: 0x186b, +} + +// nfcIndex: 22 blocks, 1408 entries, 1408 bytes +// Block 0 is the zero block. +var nfcIndex = [1408]uint8{ + // Block 0x0, offset 0x0 + // Block 0x1, offset 0x40 + // Block 0x2, offset 0x80 + // Block 0x3, offset 0xc0 + 0xc2: 0x2e, 0xc3: 0x01, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x2f, 0xc7: 0x04, + 0xc8: 0x05, 0xca: 0x30, 0xcb: 0x31, 0xcc: 0x06, 0xcd: 0x07, 0xce: 0x08, 0xcf: 0x32, + 0xd0: 0x09, 0xd1: 0x33, 0xd2: 0x34, 0xd3: 0x0a, 0xd6: 0x0b, 0xd7: 0x35, + 0xd8: 0x36, 0xd9: 0x0c, 0xdb: 0x37, 0xdc: 0x38, 0xdd: 0x39, 0xdf: 0x3a, + 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, + 0xea: 0x06, 0xeb: 0x07, 0xec: 0x08, 0xed: 0x09, 0xef: 0x0a, + 0xf0: 0x13, + // Block 0x4, offset 0x100 + 0x120: 0x3b, 0x121: 0x3c, 0x123: 0x0d, 0x124: 0x3d, 0x125: 0x3e, 0x126: 0x3f, 0x127: 0x40, + 0x128: 0x41, 0x129: 0x42, 0x12a: 0x43, 0x12b: 0x44, 0x12c: 0x3f, 0x12d: 0x45, 0x12e: 0x46, 0x12f: 0x47, + 0x131: 0x48, 0x132: 0x49, 0x133: 0x4a, 0x134: 0x4b, 0x135: 0x4c, 0x137: 0x4d, + 0x138: 0x4e, 0x139: 0x4f, 0x13a: 0x50, 0x13b: 0x51, 0x13c: 0x52, 0x13d: 0x53, 0x13e: 0x54, 0x13f: 0x55, + // Block 0x5, offset 0x140 + 0x140: 0x56, 0x142: 0x57, 0x144: 0x58, 0x145: 0x59, 0x146: 0x5a, 0x147: 0x5b, + 0x14d: 0x5c, + 0x15c: 0x5d, 0x15f: 0x5e, + 0x162: 0x5f, 0x164: 0x60, + 0x168: 0x61, 0x169: 0x62, 0x16a: 0x63, 0x16b: 0x64, 0x16c: 0x0e, 0x16d: 0x65, 0x16e: 0x66, 0x16f: 0x67, + 0x170: 0x68, 0x173: 0x69, 0x177: 0x0f, + 0x178: 0x10, 0x179: 0x11, 0x17a: 0x12, 0x17b: 0x13, 0x17c: 0x14, 0x17d: 0x15, 0x17e: 0x16, 0x17f: 0x17, + // Block 0x6, offset 0x180 + 0x180: 0x6a, 0x183: 0x6b, 0x184: 0x6c, 0x186: 0x6d, 0x187: 0x6e, + 0x188: 0x6f, 0x189: 0x18, 0x18a: 0x19, 0x18b: 0x70, 0x18c: 0x71, + 0x1ab: 0x72, + 0x1b3: 0x73, 0x1b5: 0x74, 0x1b7: 0x75, + // Block 0x7, offset 0x1c0 + 0x1c0: 0x76, 0x1c1: 0x1a, 0x1c2: 0x1b, 0x1c3: 0x1c, 0x1c4: 0x77, 0x1c5: 0x78, + 0x1c9: 0x79, 0x1cc: 0x7a, 0x1cd: 0x7b, + // Block 0x8, offset 0x200 + 0x219: 0x7c, 0x21a: 0x7d, 0x21b: 0x7e, + 0x220: 0x7f, 0x223: 0x80, 0x224: 0x81, 0x225: 0x82, 0x226: 0x83, 0x227: 0x84, + 0x22a: 0x85, 0x22b: 0x86, 0x22f: 0x87, + 0x230: 0x88, 0x231: 0x89, 0x232: 0x8a, 0x233: 0x8b, 0x234: 0x8c, 0x235: 0x8d, 0x236: 0x8e, 0x237: 0x88, + 0x238: 0x89, 0x239: 0x8a, 0x23a: 0x8b, 0x23b: 0x8c, 0x23c: 0x8d, 0x23d: 0x8e, 0x23e: 0x88, 0x23f: 0x89, + // Block 0x9, offset 0x240 + 0x240: 0x8a, 0x241: 0x8b, 0x242: 0x8c, 0x243: 0x8d, 0x244: 0x8e, 0x245: 0x88, 0x246: 0x89, 0x247: 0x8a, + 0x248: 0x8b, 0x249: 0x8c, 0x24a: 0x8d, 0x24b: 0x8e, 0x24c: 0x88, 0x24d: 0x89, 0x24e: 0x8a, 0x24f: 0x8b, + 0x250: 0x8c, 0x251: 0x8d, 0x252: 0x8e, 0x253: 0x88, 0x254: 0x89, 0x255: 0x8a, 0x256: 0x8b, 0x257: 0x8c, + 0x258: 0x8d, 0x259: 0x8e, 0x25a: 0x88, 0x25b: 0x89, 0x25c: 0x8a, 0x25d: 0x8b, 0x25e: 0x8c, 0x25f: 0x8d, + 0x260: 0x8e, 0x261: 0x88, 0x262: 0x89, 0x263: 0x8a, 0x264: 0x8b, 0x265: 0x8c, 0x266: 0x8d, 0x267: 0x8e, + 0x268: 0x88, 0x269: 0x89, 0x26a: 0x8a, 0x26b: 0x8b, 0x26c: 0x8c, 0x26d: 0x8d, 0x26e: 0x8e, 0x26f: 0x88, + 0x270: 0x89, 0x271: 0x8a, 0x272: 0x8b, 0x273: 0x8c, 0x274: 0x8d, 0x275: 0x8e, 0x276: 0x88, 0x277: 0x89, + 0x278: 0x8a, 0x279: 0x8b, 0x27a: 0x8c, 0x27b: 0x8d, 0x27c: 0x8e, 0x27d: 0x88, 0x27e: 0x89, 0x27f: 0x8a, + // Block 0xa, offset 0x280 + 0x280: 0x8b, 0x281: 0x8c, 0x282: 0x8d, 0x283: 0x8e, 0x284: 0x88, 0x285: 0x89, 0x286: 0x8a, 0x287: 0x8b, + 0x288: 0x8c, 0x289: 0x8d, 0x28a: 0x8e, 0x28b: 0x88, 0x28c: 0x89, 0x28d: 0x8a, 0x28e: 0x8b, 0x28f: 0x8c, + 0x290: 0x8d, 0x291: 0x8e, 0x292: 0x88, 0x293: 0x89, 0x294: 0x8a, 0x295: 0x8b, 0x296: 0x8c, 0x297: 0x8d, + 0x298: 0x8e, 0x299: 0x88, 0x29a: 0x89, 0x29b: 0x8a, 0x29c: 0x8b, 0x29d: 0x8c, 0x29e: 0x8d, 0x29f: 0x8e, + 0x2a0: 0x88, 0x2a1: 0x89, 0x2a2: 0x8a, 0x2a3: 0x8b, 0x2a4: 0x8c, 0x2a5: 0x8d, 0x2a6: 0x8e, 0x2a7: 0x88, + 0x2a8: 0x89, 0x2a9: 0x8a, 0x2aa: 0x8b, 0x2ab: 0x8c, 0x2ac: 0x8d, 0x2ad: 0x8e, 0x2ae: 0x88, 0x2af: 0x89, + 0x2b0: 0x8a, 0x2b1: 0x8b, 0x2b2: 0x8c, 0x2b3: 0x8d, 0x2b4: 0x8e, 0x2b5: 0x88, 0x2b6: 0x89, 0x2b7: 0x8a, + 0x2b8: 0x8b, 0x2b9: 0x8c, 0x2ba: 0x8d, 0x2bb: 0x8e, 0x2bc: 0x88, 0x2bd: 0x89, 0x2be: 0x8a, 0x2bf: 0x8b, + // Block 0xb, offset 0x2c0 + 0x2c0: 0x8c, 0x2c1: 0x8d, 0x2c2: 0x8e, 0x2c3: 0x88, 0x2c4: 0x89, 0x2c5: 0x8a, 0x2c6: 0x8b, 0x2c7: 0x8c, + 0x2c8: 0x8d, 0x2c9: 0x8e, 0x2ca: 0x88, 0x2cb: 0x89, 0x2cc: 0x8a, 0x2cd: 0x8b, 0x2ce: 0x8c, 0x2cf: 0x8d, + 0x2d0: 0x8e, 0x2d1: 0x88, 0x2d2: 0x89, 0x2d3: 0x8a, 0x2d4: 0x8b, 0x2d5: 0x8c, 0x2d6: 0x8d, 0x2d7: 0x8e, + 0x2d8: 0x88, 0x2d9: 0x89, 0x2da: 0x8a, 0x2db: 0x8b, 0x2dc: 0x8c, 0x2dd: 0x8d, 0x2de: 0x8f, + // Block 0xc, offset 0x300 + 0x324: 0x1d, 0x325: 0x1e, 0x326: 0x1f, 0x327: 0x20, + 0x328: 0x21, 0x329: 0x22, 0x32a: 0x23, 0x32b: 0x24, 0x32c: 0x90, 0x32d: 0x91, 0x32e: 0x92, + 0x331: 0x93, 0x332: 0x94, 0x333: 0x95, 0x334: 0x96, + 0x338: 0x97, 0x339: 0x98, 0x33a: 0x99, 0x33b: 0x9a, 0x33e: 0x9b, 0x33f: 0x9c, + // Block 0xd, offset 0x340 + 0x347: 0x9d, + 0x34b: 0x9e, 0x34d: 0x9f, + 0x368: 0xa0, 0x36b: 0xa1, + 0x374: 0xa2, + 0x37a: 0xa3, 0x37d: 0xa4, + // Block 0xe, offset 0x380 + 0x381: 0xa5, 0x382: 0xa6, 0x384: 0xa7, 0x385: 0x83, 0x387: 0xa8, + 0x388: 0xa9, 0x38b: 0xaa, 0x38c: 0xab, 0x38d: 0xac, + 0x391: 0xad, 0x392: 0xae, 0x393: 0xaf, 0x396: 0xb0, 0x397: 0xb1, + 0x398: 0x74, 0x39a: 0xb2, 0x39c: 0xb3, + 0x3a0: 0xb4, 0x3a4: 0xb5, 0x3a5: 0xb6, 0x3a7: 0xb7, + 0x3a8: 0xb8, 0x3a9: 0xb9, 0x3aa: 0xba, + 0x3b0: 0x74, 0x3b5: 0xbb, 0x3b6: 0xbc, + // Block 0xf, offset 0x3c0 + 0x3eb: 0xbd, 0x3ec: 0xbe, + 0x3ff: 0xbf, + // Block 0x10, offset 0x400 + 0x432: 0xc0, + // Block 0x11, offset 0x440 + 0x445: 0xc1, 0x446: 0xc2, 0x447: 0xc3, + 0x449: 0xc4, + // Block 0x12, offset 0x480 + 0x480: 0xc5, 0x484: 0xbe, + 0x48b: 0xc6, + 0x4a3: 0xc7, 0x4a5: 0xc8, + // Block 0x13, offset 0x4c0 + 0x4c8: 0xc9, + // Block 0x14, offset 0x500 + 0x520: 0x25, 0x521: 0x26, 0x522: 0x27, 0x523: 0x28, 0x524: 0x29, 0x525: 0x2a, 0x526: 0x2b, 0x527: 0x2c, + 0x528: 0x2d, + // Block 0x15, offset 0x540 + 0x550: 0x0b, 0x551: 0x0c, 0x556: 0x0d, + 0x55b: 0x0e, 0x55d: 0x0f, 0x55e: 0x10, 0x55f: 0x11, + 0x56f: 0x12, +} + +// nfcSparseOffset: 156 entries, 312 bytes +var nfcSparseOffset = []uint16{0x0, 0x5, 0x9, 0xb, 0xd, 0x18, 0x28, 0x2a, 0x2f, 0x3a, 0x49, 0x56, 0x5e, 0x63, 0x68, 0x6a, 0x72, 0x79, 0x7c, 0x84, 0x88, 0x8c, 0x8e, 0x90, 0x99, 0x9d, 0xa4, 0xa9, 0xac, 0xb6, 0xb9, 0xc0, 0xc8, 0xcb, 0xcd, 0xd0, 0xd2, 0xd7, 0xe8, 0xf4, 0xf6, 0xfc, 0xfe, 0x100, 0x102, 0x104, 0x106, 0x108, 0x10b, 0x10e, 0x110, 0x113, 0x116, 0x11a, 0x120, 0x122, 0x12b, 0x12d, 0x130, 0x132, 0x13d, 0x141, 0x14f, 0x152, 0x158, 0x15e, 0x169, 0x16d, 0x16f, 0x171, 0x173, 0x175, 0x177, 0x17d, 0x181, 0x183, 0x185, 0x18d, 0x191, 0x194, 0x196, 0x198, 0x19b, 0x19e, 0x1a0, 0x1a2, 0x1a4, 0x1a6, 0x1ac, 0x1af, 0x1b1, 0x1b8, 0x1be, 0x1c4, 0x1cc, 0x1d2, 0x1d8, 0x1de, 0x1e2, 0x1f0, 0x1f9, 0x1fc, 0x1ff, 0x201, 0x204, 0x206, 0x20a, 0x20f, 0x211, 0x213, 0x218, 0x21e, 0x220, 0x222, 0x224, 0x22a, 0x22d, 0x22f, 0x231, 0x237, 0x23a, 0x242, 0x249, 0x24c, 0x24f, 0x251, 0x254, 0x25c, 0x260, 0x267, 0x26a, 0x270, 0x272, 0x275, 0x277, 0x27a, 0x27f, 0x281, 0x283, 0x285, 0x287, 0x289, 0x28c, 0x28e, 0x290, 0x292, 0x294, 0x296, 0x2a3, 0x2ad, 0x2af, 0x2b1, 0x2b7, 0x2b9, 0x2bb, 0x2be} + +// nfcSparseValues: 704 entries, 2816 bytes +var nfcSparseValues = [704]valueRange{ + // Block 0x0, offset 0x0 + {value: 0x0000, lo: 0x04}, + {value: 0xa100, lo: 0xa8, hi: 0xa8}, + {value: 0x8100, lo: 0xaf, hi: 0xaf}, + {value: 0x8100, lo: 0xb4, hi: 0xb4}, + {value: 0x8100, lo: 0xb8, hi: 0xb8}, + // Block 0x1, offset 0x5 + {value: 0x0091, lo: 0x03}, + {value: 0x46f9, lo: 0xa0, hi: 0xa1}, + {value: 0x472b, lo: 0xaf, hi: 0xb0}, + {value: 0xa000, lo: 0xb7, hi: 0xb7}, + // Block 0x2, offset 0x9 + {value: 0x0000, lo: 0x01}, + {value: 0xa000, lo: 0x92, hi: 0x92}, + // Block 0x3, offset 0xb + {value: 0x0000, lo: 0x01}, + {value: 0x8100, lo: 0x98, hi: 0x9d}, + // Block 0x4, offset 0xd + {value: 0x0006, lo: 0x0a}, + {value: 0xa000, lo: 0x81, hi: 0x81}, + {value: 0xa000, lo: 0x85, hi: 0x85}, + {value: 0xa000, lo: 0x89, hi: 0x89}, + {value: 0x4857, lo: 0x8a, hi: 0x8a}, + {value: 0x4875, lo: 0x8b, hi: 0x8b}, + {value: 0x36de, lo: 0x8c, hi: 0x8c}, + {value: 0x36f6, lo: 0x8d, hi: 0x8d}, + {value: 0x488d, lo: 0x8e, hi: 0x8e}, + {value: 0xa000, lo: 0x92, hi: 0x92}, + {value: 0x3714, lo: 0x93, hi: 0x94}, + // Block 0x5, offset 0x18 + {value: 0x0000, lo: 0x0f}, + {value: 0xa000, lo: 0x83, hi: 0x83}, + {value: 0xa000, lo: 0x87, hi: 0x87}, + {value: 0xa000, lo: 0x8b, hi: 0x8b}, + {value: 0xa000, lo: 0x8d, hi: 0x8d}, + {value: 0x37bc, lo: 0x90, hi: 0x90}, + {value: 0x37c8, lo: 0x91, hi: 0x91}, + {value: 0x37b6, lo: 0x93, hi: 0x93}, + {value: 0xa000, lo: 0x96, hi: 0x96}, + {value: 0x382e, lo: 0x97, hi: 0x97}, + {value: 0x37f8, lo: 0x9c, hi: 0x9c}, + {value: 0x37e0, lo: 0x9d, hi: 0x9d}, + {value: 0x380a, lo: 0x9e, hi: 0x9e}, + {value: 0xa000, lo: 0xb4, hi: 0xb5}, + {value: 0x3834, lo: 0xb6, hi: 0xb6}, + {value: 0x383a, lo: 0xb7, hi: 0xb7}, + // Block 0x6, offset 0x28 + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0x83, hi: 0x87}, + // Block 0x7, offset 0x2a + {value: 0x0001, lo: 0x04}, + {value: 0x8114, lo: 0x81, hi: 0x82}, + {value: 0x8133, lo: 0x84, hi: 0x84}, + {value: 0x812e, lo: 0x85, hi: 0x85}, + {value: 0x810e, lo: 0x87, hi: 0x87}, + // Block 0x8, offset 0x2f + {value: 0x0000, lo: 0x0a}, + {value: 0x8133, lo: 0x90, hi: 0x97}, + {value: 0x811a, lo: 0x98, hi: 0x98}, + {value: 0x811b, lo: 0x99, hi: 0x99}, + {value: 0x811c, lo: 0x9a, hi: 0x9a}, + {value: 0x3858, lo: 0xa2, hi: 0xa2}, + {value: 0x385e, lo: 0xa3, hi: 0xa3}, + {value: 0x386a, lo: 0xa4, hi: 0xa4}, + {value: 0x3864, lo: 0xa5, hi: 0xa5}, + {value: 0x3870, lo: 0xa6, hi: 0xa6}, + {value: 0xa000, lo: 0xa7, hi: 0xa7}, + // Block 0x9, offset 0x3a + {value: 0x0000, lo: 0x0e}, + {value: 0x3882, lo: 0x80, hi: 0x80}, + {value: 0xa000, lo: 0x81, hi: 0x81}, + {value: 0x3876, lo: 0x82, hi: 0x82}, + {value: 0xa000, lo: 0x92, hi: 0x92}, + {value: 0x387c, lo: 0x93, hi: 0x93}, + {value: 0xa000, lo: 0x95, hi: 0x95}, + {value: 0x8133, lo: 0x96, hi: 0x9c}, + {value: 0x8133, lo: 0x9f, hi: 0xa2}, + {value: 0x812e, lo: 0xa3, hi: 0xa3}, + {value: 0x8133, lo: 0xa4, hi: 0xa4}, + {value: 0x8133, lo: 0xa7, hi: 0xa8}, + {value: 0x812e, lo: 0xaa, hi: 0xaa}, + {value: 0x8133, lo: 0xab, hi: 0xac}, + {value: 0x812e, lo: 0xad, hi: 0xad}, + // Block 0xa, offset 0x49 + {value: 0x0000, lo: 0x0c}, + {value: 0x8120, lo: 0x91, hi: 0x91}, + {value: 0x8133, lo: 0xb0, hi: 0xb0}, + {value: 0x812e, lo: 0xb1, hi: 0xb1}, + {value: 0x8133, lo: 0xb2, hi: 0xb3}, + {value: 0x812e, lo: 0xb4, hi: 0xb4}, + {value: 0x8133, lo: 0xb5, hi: 0xb6}, + {value: 0x812e, lo: 0xb7, hi: 0xb9}, + {value: 0x8133, lo: 0xba, hi: 0xba}, + {value: 0x812e, lo: 0xbb, hi: 0xbc}, + {value: 0x8133, lo: 0xbd, hi: 0xbd}, + {value: 0x812e, lo: 0xbe, hi: 0xbe}, + {value: 0x8133, lo: 0xbf, hi: 0xbf}, + // Block 0xb, offset 0x56 + {value: 0x0005, lo: 0x07}, + {value: 0x8133, lo: 0x80, hi: 0x80}, + {value: 0x8133, lo: 0x81, hi: 0x81}, + {value: 0x812e, lo: 0x82, hi: 0x83}, + {value: 0x812e, lo: 0x84, hi: 0x85}, + {value: 0x812e, lo: 0x86, hi: 0x87}, + {value: 0x812e, lo: 0x88, hi: 0x89}, + {value: 0x8133, lo: 0x8a, hi: 0x8a}, + // Block 0xc, offset 0x5e + {value: 0x0000, lo: 0x04}, + {value: 0x8133, lo: 0xab, hi: 0xb1}, + {value: 0x812e, lo: 0xb2, hi: 0xb2}, + {value: 0x8133, lo: 0xb3, hi: 0xb3}, + {value: 0x812e, lo: 0xbd, hi: 0xbd}, + // Block 0xd, offset 0x63 + {value: 0x0000, lo: 0x04}, + {value: 0x8133, lo: 0x96, hi: 0x99}, + {value: 0x8133, lo: 0x9b, hi: 0xa3}, + {value: 0x8133, lo: 0xa5, hi: 0xa7}, + {value: 0x8133, lo: 0xa9, hi: 0xad}, + // Block 0xe, offset 0x68 + {value: 0x0000, lo: 0x01}, + {value: 0x812e, lo: 0x99, hi: 0x9b}, + // Block 0xf, offset 0x6a + {value: 0x0000, lo: 0x07}, + {value: 0xa000, lo: 0xa8, hi: 0xa8}, + {value: 0x3eef, lo: 0xa9, hi: 0xa9}, + {value: 0xa000, lo: 0xb0, hi: 0xb0}, + {value: 0x3ef7, lo: 0xb1, hi: 0xb1}, + {value: 0xa000, lo: 0xb3, hi: 0xb3}, + {value: 0x3eff, lo: 0xb4, hi: 0xb4}, + {value: 0x9903, lo: 0xbc, hi: 0xbc}, + // Block 0x10, offset 0x72 + {value: 0x0008, lo: 0x06}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x8133, lo: 0x91, hi: 0x91}, + {value: 0x812e, lo: 0x92, hi: 0x92}, + {value: 0x8133, lo: 0x93, hi: 0x93}, + {value: 0x8133, lo: 0x94, hi: 0x94}, + {value: 0x4533, lo: 0x98, hi: 0x9f}, + // Block 0x11, offset 0x79 + {value: 0x0000, lo: 0x02}, + {value: 0x8103, lo: 0xbc, hi: 0xbc}, + {value: 0x9900, lo: 0xbe, hi: 0xbe}, + // Block 0x12, offset 0x7c + {value: 0x0008, lo: 0x07}, + {value: 0xa000, lo: 0x87, hi: 0x87}, + {value: 0x2cab, lo: 0x8b, hi: 0x8c}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x9900, lo: 0x97, hi: 0x97}, + {value: 0x4573, lo: 0x9c, hi: 0x9d}, + {value: 0x4583, lo: 0x9f, hi: 0x9f}, + {value: 0x8133, lo: 0xbe, hi: 0xbe}, + // Block 0x13, offset 0x84 + {value: 0x0000, lo: 0x03}, + {value: 0x45ab, lo: 0xb3, hi: 0xb3}, + {value: 0x45b3, lo: 0xb6, hi: 0xb6}, + {value: 0x8103, lo: 0xbc, hi: 0xbc}, + // Block 0x14, offset 0x88 + {value: 0x0008, lo: 0x03}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x458b, lo: 0x99, hi: 0x9b}, + {value: 0x45a3, lo: 0x9e, hi: 0x9e}, + // Block 0x15, offset 0x8c + {value: 0x0000, lo: 0x01}, + {value: 0x8103, lo: 0xbc, hi: 0xbc}, + // Block 0x16, offset 0x8e + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + // Block 0x17, offset 0x90 + {value: 0x0000, lo: 0x08}, + {value: 0xa000, lo: 0x87, hi: 0x87}, + {value: 0x2cc3, lo: 0x88, hi: 0x88}, + {value: 0x2cbb, lo: 0x8b, hi: 0x8b}, + {value: 0x2ccb, lo: 0x8c, hi: 0x8c}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x9900, lo: 0x96, hi: 0x97}, + {value: 0x45bb, lo: 0x9c, hi: 0x9c}, + {value: 0x45c3, lo: 0x9d, hi: 0x9d}, + // Block 0x18, offset 0x99 + {value: 0x0000, lo: 0x03}, + {value: 0xa000, lo: 0x92, hi: 0x92}, + {value: 0x2cd3, lo: 0x94, hi: 0x94}, + {value: 0x9900, lo: 0xbe, hi: 0xbe}, + // Block 0x19, offset 0x9d + {value: 0x0000, lo: 0x06}, + {value: 0xa000, lo: 0x86, hi: 0x87}, + {value: 0x2cdb, lo: 0x8a, hi: 0x8a}, + {value: 0x2ceb, lo: 0x8b, hi: 0x8b}, + {value: 0x2ce3, lo: 0x8c, hi: 0x8c}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x9900, lo: 0x97, hi: 0x97}, + // Block 0x1a, offset 0xa4 + {value: 0x1801, lo: 0x04}, + {value: 0xa000, lo: 0x86, hi: 0x86}, + {value: 0x3f07, lo: 0x88, hi: 0x88}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x8121, lo: 0x95, hi: 0x96}, + // Block 0x1b, offset 0xa9 + {value: 0x0000, lo: 0x02}, + {value: 0x8103, lo: 0xbc, hi: 0xbc}, + {value: 0xa000, lo: 0xbf, hi: 0xbf}, + // Block 0x1c, offset 0xac + {value: 0x0000, lo: 0x09}, + {value: 0x2cf3, lo: 0x80, hi: 0x80}, + {value: 0x9900, lo: 0x82, hi: 0x82}, + {value: 0xa000, lo: 0x86, hi: 0x86}, + {value: 0x2cfb, lo: 0x87, hi: 0x87}, + {value: 0x2d03, lo: 0x88, hi: 0x88}, + {value: 0x2f67, lo: 0x8a, hi: 0x8a}, + {value: 0x2def, lo: 0x8b, hi: 0x8b}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x9900, lo: 0x95, hi: 0x96}, + // Block 0x1d, offset 0xb6 + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0xbb, hi: 0xbc}, + {value: 0x9900, lo: 0xbe, hi: 0xbe}, + // Block 0x1e, offset 0xb9 + {value: 0x0000, lo: 0x06}, + {value: 0xa000, lo: 0x86, hi: 0x87}, + {value: 0x2d0b, lo: 0x8a, hi: 0x8a}, + {value: 0x2d1b, lo: 0x8b, hi: 0x8b}, + {value: 0x2d13, lo: 0x8c, hi: 0x8c}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x9900, lo: 0x97, hi: 0x97}, + // Block 0x1f, offset 0xc0 + {value: 0x6bdd, lo: 0x07}, + {value: 0x9905, lo: 0x8a, hi: 0x8a}, + {value: 0x9900, lo: 0x8f, hi: 0x8f}, + {value: 0xa000, lo: 0x99, hi: 0x99}, + {value: 0x3f0f, lo: 0x9a, hi: 0x9a}, + {value: 0x2f6f, lo: 0x9c, hi: 0x9c}, + {value: 0x2dfa, lo: 0x9d, hi: 0x9d}, + {value: 0x2d23, lo: 0x9e, hi: 0x9f}, + // Block 0x20, offset 0xc8 + {value: 0x0000, lo: 0x02}, + {value: 0x8123, lo: 0xb8, hi: 0xb9}, + {value: 0x8105, lo: 0xba, hi: 0xba}, + // Block 0x21, offset 0xcb + {value: 0x0000, lo: 0x01}, + {value: 0x8124, lo: 0x88, hi: 0x8b}, + // Block 0x22, offset 0xcd + {value: 0x0000, lo: 0x02}, + {value: 0x8125, lo: 0xb8, hi: 0xb9}, + {value: 0x8105, lo: 0xba, hi: 0xba}, + // Block 0x23, offset 0xd0 + {value: 0x0000, lo: 0x01}, + {value: 0x8126, lo: 0x88, hi: 0x8b}, + // Block 0x24, offset 0xd2 + {value: 0x0000, lo: 0x04}, + {value: 0x812e, lo: 0x98, hi: 0x99}, + {value: 0x812e, lo: 0xb5, hi: 0xb5}, + {value: 0x812e, lo: 0xb7, hi: 0xb7}, + {value: 0x812c, lo: 0xb9, hi: 0xb9}, + // Block 0x25, offset 0xd7 + {value: 0x0000, lo: 0x10}, + {value: 0x264a, lo: 0x83, hi: 0x83}, + {value: 0x2651, lo: 0x8d, hi: 0x8d}, + {value: 0x2658, lo: 0x92, hi: 0x92}, + {value: 0x265f, lo: 0x97, hi: 0x97}, + {value: 0x2666, lo: 0x9c, hi: 0x9c}, + {value: 0x2643, lo: 0xa9, hi: 0xa9}, + {value: 0x8127, lo: 0xb1, hi: 0xb1}, + {value: 0x8128, lo: 0xb2, hi: 0xb2}, + {value: 0x4a9b, lo: 0xb3, hi: 0xb3}, + {value: 0x8129, lo: 0xb4, hi: 0xb4}, + {value: 0x4aa4, lo: 0xb5, hi: 0xb5}, + {value: 0x45cb, lo: 0xb6, hi: 0xb6}, + {value: 0x8200, lo: 0xb7, hi: 0xb7}, + {value: 0x45d3, lo: 0xb8, hi: 0xb8}, + {value: 0x8200, lo: 0xb9, hi: 0xb9}, + {value: 0x8128, lo: 0xba, hi: 0xbd}, + // Block 0x26, offset 0xe8 + {value: 0x0000, lo: 0x0b}, + {value: 0x8128, lo: 0x80, hi: 0x80}, + {value: 0x4aad, lo: 0x81, hi: 0x81}, + {value: 0x8133, lo: 0x82, hi: 0x83}, + {value: 0x8105, lo: 0x84, hi: 0x84}, + {value: 0x8133, lo: 0x86, hi: 0x87}, + {value: 0x2674, lo: 0x93, hi: 0x93}, + {value: 0x267b, lo: 0x9d, hi: 0x9d}, + {value: 0x2682, lo: 0xa2, hi: 0xa2}, + {value: 0x2689, lo: 0xa7, hi: 0xa7}, + {value: 0x2690, lo: 0xac, hi: 0xac}, + {value: 0x266d, lo: 0xb9, hi: 0xb9}, + // Block 0x27, offset 0xf4 + {value: 0x0000, lo: 0x01}, + {value: 0x812e, lo: 0x86, hi: 0x86}, + // Block 0x28, offset 0xf6 + {value: 0x0000, lo: 0x05}, + {value: 0xa000, lo: 0xa5, hi: 0xa5}, + {value: 0x2d2b, lo: 0xa6, hi: 0xa6}, + {value: 0x9900, lo: 0xae, hi: 0xae}, + {value: 0x8103, lo: 0xb7, hi: 0xb7}, + {value: 0x8105, lo: 0xb9, hi: 0xba}, + // Block 0x29, offset 0xfc + {value: 0x0000, lo: 0x01}, + {value: 0x812e, lo: 0x8d, hi: 0x8d}, + // Block 0x2a, offset 0xfe + {value: 0x0000, lo: 0x01}, + {value: 0xa000, lo: 0x80, hi: 0x92}, + // Block 0x2b, offset 0x100 + {value: 0x0000, lo: 0x01}, + {value: 0xb900, lo: 0xa1, hi: 0xb5}, + // Block 0x2c, offset 0x102 + {value: 0x0000, lo: 0x01}, + {value: 0x9900, lo: 0xa8, hi: 0xbf}, + // Block 0x2d, offset 0x104 + {value: 0x0000, lo: 0x01}, + {value: 0x9900, lo: 0x80, hi: 0x82}, + // Block 0x2e, offset 0x106 + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0x9d, hi: 0x9f}, + // Block 0x2f, offset 0x108 + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0x94, hi: 0x94}, + {value: 0x8105, lo: 0xb4, hi: 0xb4}, + // Block 0x30, offset 0x10b + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0x92, hi: 0x92}, + {value: 0x8133, lo: 0x9d, hi: 0x9d}, + // Block 0x31, offset 0x10e + {value: 0x0000, lo: 0x01}, + {value: 0x8132, lo: 0xa9, hi: 0xa9}, + // Block 0x32, offset 0x110 + {value: 0x0004, lo: 0x02}, + {value: 0x812f, lo: 0xb9, hi: 0xba}, + {value: 0x812e, lo: 0xbb, hi: 0xbb}, + // Block 0x33, offset 0x113 + {value: 0x0000, lo: 0x02}, + {value: 0x8133, lo: 0x97, hi: 0x97}, + {value: 0x812e, lo: 0x98, hi: 0x98}, + // Block 0x34, offset 0x116 + {value: 0x0000, lo: 0x03}, + {value: 0x8105, lo: 0xa0, hi: 0xa0}, + {value: 0x8133, lo: 0xb5, hi: 0xbc}, + {value: 0x812e, lo: 0xbf, hi: 0xbf}, + // Block 0x35, offset 0x11a + {value: 0x0000, lo: 0x05}, + {value: 0x8133, lo: 0xb0, hi: 0xb4}, + {value: 0x812e, lo: 0xb5, hi: 0xba}, + {value: 0x8133, lo: 0xbb, hi: 0xbc}, + {value: 0x812e, lo: 0xbd, hi: 0xbd}, + {value: 0x812e, lo: 0xbf, hi: 0xbf}, + // Block 0x36, offset 0x120 + {value: 0x0000, lo: 0x01}, + {value: 0x812e, lo: 0x80, hi: 0x80}, + // Block 0x37, offset 0x122 + {value: 0x0000, lo: 0x08}, + {value: 0x2d73, lo: 0x80, hi: 0x80}, + {value: 0x2d7b, lo: 0x81, hi: 0x81}, + {value: 0xa000, lo: 0x82, hi: 0x82}, + {value: 0x2d83, lo: 0x83, hi: 0x83}, + {value: 0x8105, lo: 0x84, hi: 0x84}, + {value: 0x8133, lo: 0xab, hi: 0xab}, + {value: 0x812e, lo: 0xac, hi: 0xac}, + {value: 0x8133, lo: 0xad, hi: 0xb3}, + // Block 0x38, offset 0x12b + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0xaa, hi: 0xab}, + // Block 0x39, offset 0x12d + {value: 0x0000, lo: 0x02}, + {value: 0x8103, lo: 0xa6, hi: 0xa6}, + {value: 0x8105, lo: 0xb2, hi: 0xb3}, + // Block 0x3a, offset 0x130 + {value: 0x0000, lo: 0x01}, + {value: 0x8103, lo: 0xb7, hi: 0xb7}, + // Block 0x3b, offset 0x132 + {value: 0x0000, lo: 0x0a}, + {value: 0x8133, lo: 0x90, hi: 0x92}, + {value: 0x8101, lo: 0x94, hi: 0x94}, + {value: 0x812e, lo: 0x95, hi: 0x99}, + {value: 0x8133, lo: 0x9a, hi: 0x9b}, + {value: 0x812e, lo: 0x9c, hi: 0x9f}, + {value: 0x8133, lo: 0xa0, hi: 0xa0}, + {value: 0x8101, lo: 0xa2, hi: 0xa8}, + {value: 0x812e, lo: 0xad, hi: 0xad}, + {value: 0x8133, lo: 0xb4, hi: 0xb4}, + {value: 0x8133, lo: 0xb8, hi: 0xb9}, + // Block 0x3c, offset 0x13d + {value: 0x0004, lo: 0x03}, + {value: 0x0436, lo: 0x80, hi: 0x81}, + {value: 0x8100, lo: 0x97, hi: 0x97}, + {value: 0x8100, lo: 0xbe, hi: 0xbe}, + // Block 0x3d, offset 0x141 + {value: 0x0000, lo: 0x0d}, + {value: 0x8133, lo: 0x90, hi: 0x91}, + {value: 0x8101, lo: 0x92, hi: 0x93}, + {value: 0x8133, lo: 0x94, hi: 0x97}, + {value: 0x8101, lo: 0x98, hi: 0x9a}, + {value: 0x8133, lo: 0x9b, hi: 0x9c}, + {value: 0x8133, lo: 0xa1, hi: 0xa1}, + {value: 0x8101, lo: 0xa5, hi: 0xa6}, + {value: 0x8133, lo: 0xa7, hi: 0xa7}, + {value: 0x812e, lo: 0xa8, hi: 0xa8}, + {value: 0x8133, lo: 0xa9, hi: 0xa9}, + {value: 0x8101, lo: 0xaa, hi: 0xab}, + {value: 0x812e, lo: 0xac, hi: 0xaf}, + {value: 0x8133, lo: 0xb0, hi: 0xb0}, + // Block 0x3e, offset 0x14f + {value: 0x4292, lo: 0x02}, + {value: 0x01bb, lo: 0xa6, hi: 0xa6}, + {value: 0x0057, lo: 0xaa, hi: 0xab}, + // Block 0x3f, offset 0x152 + {value: 0x0007, lo: 0x05}, + {value: 0xa000, lo: 0x90, hi: 0x90}, + {value: 0xa000, lo: 0x92, hi: 0x92}, + {value: 0xa000, lo: 0x94, hi: 0x94}, + {value: 0x3bd0, lo: 0x9a, hi: 0x9b}, + {value: 0x3bde, lo: 0xae, hi: 0xae}, + // Block 0x40, offset 0x158 + {value: 0x000e, lo: 0x05}, + {value: 0x3be5, lo: 0x8d, hi: 0x8e}, + {value: 0x3bec, lo: 0x8f, hi: 0x8f}, + {value: 0xa000, lo: 0x90, hi: 0x90}, + {value: 0xa000, lo: 0x92, hi: 0x92}, + {value: 0xa000, lo: 0x94, hi: 0x94}, + // Block 0x41, offset 0x15e + {value: 0x63f1, lo: 0x0a}, + {value: 0xa000, lo: 0x83, hi: 0x83}, + {value: 0x3bfa, lo: 0x84, hi: 0x84}, + {value: 0xa000, lo: 0x88, hi: 0x88}, + {value: 0x3c01, lo: 0x89, hi: 0x89}, + {value: 0xa000, lo: 0x8b, hi: 0x8b}, + {value: 0x3c08, lo: 0x8c, hi: 0x8c}, + {value: 0xa000, lo: 0xa3, hi: 0xa3}, + {value: 0x3c0f, lo: 0xa4, hi: 0xa5}, + {value: 0x3c16, lo: 0xa6, hi: 0xa6}, + {value: 0xa000, lo: 0xbc, hi: 0xbc}, + // Block 0x42, offset 0x169 + {value: 0x0007, lo: 0x03}, + {value: 0x3c7f, lo: 0xa0, hi: 0xa1}, + {value: 0x3ca9, lo: 0xa2, hi: 0xa3}, + {value: 0x3cd3, lo: 0xaa, hi: 0xad}, + // Block 0x43, offset 0x16d + {value: 0x0004, lo: 0x01}, + {value: 0x048e, lo: 0xa9, hi: 0xaa}, + // Block 0x44, offset 0x16f + {value: 0x0000, lo: 0x01}, + {value: 0x44f4, lo: 0x9c, hi: 0x9c}, + // Block 0x45, offset 0x171 + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0xaf, hi: 0xb1}, + // Block 0x46, offset 0x173 + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0xbf, hi: 0xbf}, + // Block 0x47, offset 0x175 + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0xa0, hi: 0xbf}, + // Block 0x48, offset 0x177 + {value: 0x0000, lo: 0x05}, + {value: 0x812d, lo: 0xaa, hi: 0xaa}, + {value: 0x8132, lo: 0xab, hi: 0xab}, + {value: 0x8134, lo: 0xac, hi: 0xac}, + {value: 0x812f, lo: 0xad, hi: 0xad}, + {value: 0x8130, lo: 0xae, hi: 0xaf}, + // Block 0x49, offset 0x17d + {value: 0x0000, lo: 0x03}, + {value: 0x4ab6, lo: 0xb3, hi: 0xb3}, + {value: 0x4ab6, lo: 0xb5, hi: 0xb6}, + {value: 0x4ab6, lo: 0xba, hi: 0xbf}, + // Block 0x4a, offset 0x181 + {value: 0x0000, lo: 0x01}, + {value: 0x4ab6, lo: 0x8f, hi: 0xa3}, + // Block 0x4b, offset 0x183 + {value: 0x0000, lo: 0x01}, + {value: 0x8100, lo: 0xae, hi: 0xbe}, + // Block 0x4c, offset 0x185 + {value: 0x0000, lo: 0x07}, + {value: 0x8100, lo: 0x84, hi: 0x84}, + {value: 0x8100, lo: 0x87, hi: 0x87}, + {value: 0x8100, lo: 0x90, hi: 0x90}, + {value: 0x8100, lo: 0x9e, hi: 0x9e}, + {value: 0x8100, lo: 0xa1, hi: 0xa1}, + {value: 0x8100, lo: 0xb2, hi: 0xb2}, + {value: 0x8100, lo: 0xbb, hi: 0xbb}, + // Block 0x4d, offset 0x18d + {value: 0x0000, lo: 0x03}, + {value: 0x8100, lo: 0x80, hi: 0x80}, + {value: 0x8100, lo: 0x8b, hi: 0x8b}, + {value: 0x8100, lo: 0x8e, hi: 0x8e}, + // Block 0x4e, offset 0x191 + {value: 0x0000, lo: 0x02}, + {value: 0x8133, lo: 0xaf, hi: 0xaf}, + {value: 0x8133, lo: 0xb4, hi: 0xbd}, + // Block 0x4f, offset 0x194 + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0x9e, hi: 0x9f}, + // Block 0x50, offset 0x196 + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0xb0, hi: 0xb1}, + // Block 0x51, offset 0x198 + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0x86, hi: 0x86}, + {value: 0x8105, lo: 0xac, hi: 0xac}, + // Block 0x52, offset 0x19b + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0x84, hi: 0x84}, + {value: 0x8133, lo: 0xa0, hi: 0xb1}, + // Block 0x53, offset 0x19e + {value: 0x0000, lo: 0x01}, + {value: 0x812e, lo: 0xab, hi: 0xad}, + // Block 0x54, offset 0x1a0 + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0x93, hi: 0x93}, + // Block 0x55, offset 0x1a2 + {value: 0x0000, lo: 0x01}, + {value: 0x8103, lo: 0xb3, hi: 0xb3}, + // Block 0x56, offset 0x1a4 + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0x80, hi: 0x80}, + // Block 0x57, offset 0x1a6 + {value: 0x0000, lo: 0x05}, + {value: 0x8133, lo: 0xb0, hi: 0xb0}, + {value: 0x8133, lo: 0xb2, hi: 0xb3}, + {value: 0x812e, lo: 0xb4, hi: 0xb4}, + {value: 0x8133, lo: 0xb7, hi: 0xb8}, + {value: 0x8133, lo: 0xbe, hi: 0xbf}, + // Block 0x58, offset 0x1ac + {value: 0x0000, lo: 0x02}, + {value: 0x8133, lo: 0x81, hi: 0x81}, + {value: 0x8105, lo: 0xb6, hi: 0xb6}, + // Block 0x59, offset 0x1af + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0xad, hi: 0xad}, + // Block 0x5a, offset 0x1b1 + {value: 0x0000, lo: 0x06}, + {value: 0xe500, lo: 0x80, hi: 0x80}, + {value: 0xc600, lo: 0x81, hi: 0x9b}, + {value: 0xe500, lo: 0x9c, hi: 0x9c}, + {value: 0xc600, lo: 0x9d, hi: 0xb7}, + {value: 0xe500, lo: 0xb8, hi: 0xb8}, + {value: 0xc600, lo: 0xb9, hi: 0xbf}, + // Block 0x5b, offset 0x1b8 + {value: 0x0000, lo: 0x05}, + {value: 0xc600, lo: 0x80, hi: 0x93}, + {value: 0xe500, lo: 0x94, hi: 0x94}, + {value: 0xc600, lo: 0x95, hi: 0xaf}, + {value: 0xe500, lo: 0xb0, hi: 0xb0}, + {value: 0xc600, lo: 0xb1, hi: 0xbf}, + // Block 0x5c, offset 0x1be + {value: 0x0000, lo: 0x05}, + {value: 0xc600, lo: 0x80, hi: 0x8b}, + {value: 0xe500, lo: 0x8c, hi: 0x8c}, + {value: 0xc600, lo: 0x8d, hi: 0xa7}, + {value: 0xe500, lo: 0xa8, hi: 0xa8}, + {value: 0xc600, lo: 0xa9, hi: 0xbf}, + // Block 0x5d, offset 0x1c4 + {value: 0x0000, lo: 0x07}, + {value: 0xc600, lo: 0x80, hi: 0x83}, + {value: 0xe500, lo: 0x84, hi: 0x84}, + {value: 0xc600, lo: 0x85, hi: 0x9f}, + {value: 0xe500, lo: 0xa0, hi: 0xa0}, + {value: 0xc600, lo: 0xa1, hi: 0xbb}, + {value: 0xe500, lo: 0xbc, hi: 0xbc}, + {value: 0xc600, lo: 0xbd, hi: 0xbf}, + // Block 0x5e, offset 0x1cc + {value: 0x0000, lo: 0x05}, + {value: 0xc600, lo: 0x80, hi: 0x97}, + {value: 0xe500, lo: 0x98, hi: 0x98}, + {value: 0xc600, lo: 0x99, hi: 0xb3}, + {value: 0xe500, lo: 0xb4, hi: 0xb4}, + {value: 0xc600, lo: 0xb5, hi: 0xbf}, + // Block 0x5f, offset 0x1d2 + {value: 0x0000, lo: 0x05}, + {value: 0xc600, lo: 0x80, hi: 0x8f}, + {value: 0xe500, lo: 0x90, hi: 0x90}, + {value: 0xc600, lo: 0x91, hi: 0xab}, + {value: 0xe500, lo: 0xac, hi: 0xac}, + {value: 0xc600, lo: 0xad, hi: 0xbf}, + // Block 0x60, offset 0x1d8 + {value: 0x0000, lo: 0x05}, + {value: 0xc600, lo: 0x80, hi: 0x87}, + {value: 0xe500, lo: 0x88, hi: 0x88}, + {value: 0xc600, lo: 0x89, hi: 0xa3}, + {value: 0xe500, lo: 0xa4, hi: 0xa4}, + {value: 0xc600, lo: 0xa5, hi: 0xbf}, + // Block 0x61, offset 0x1de + {value: 0x0000, lo: 0x03}, + {value: 0xc600, lo: 0x80, hi: 0x87}, + {value: 0xe500, lo: 0x88, hi: 0x88}, + {value: 0xc600, lo: 0x89, hi: 0xa3}, + // Block 0x62, offset 0x1e2 + {value: 0x0006, lo: 0x0d}, + {value: 0x43a7, lo: 0x9d, hi: 0x9d}, + {value: 0x8116, lo: 0x9e, hi: 0x9e}, + {value: 0x4419, lo: 0x9f, hi: 0x9f}, + {value: 0x4407, lo: 0xaa, hi: 0xab}, + {value: 0x450b, lo: 0xac, hi: 0xac}, + {value: 0x4513, lo: 0xad, hi: 0xad}, + {value: 0x435f, lo: 0xae, hi: 0xb1}, + {value: 0x437d, lo: 0xb2, hi: 0xb4}, + {value: 0x4395, lo: 0xb5, hi: 0xb6}, + {value: 0x43a1, lo: 0xb8, hi: 0xb8}, + {value: 0x43ad, lo: 0xb9, hi: 0xbb}, + {value: 0x43c5, lo: 0xbc, hi: 0xbc}, + {value: 0x43cb, lo: 0xbe, hi: 0xbe}, + // Block 0x63, offset 0x1f0 + {value: 0x0006, lo: 0x08}, + {value: 0x43d1, lo: 0x80, hi: 0x81}, + {value: 0x43dd, lo: 0x83, hi: 0x84}, + {value: 0x43ef, lo: 0x86, hi: 0x89}, + {value: 0x4413, lo: 0x8a, hi: 0x8a}, + {value: 0x438f, lo: 0x8b, hi: 0x8b}, + {value: 0x4377, lo: 0x8c, hi: 0x8c}, + {value: 0x43bf, lo: 0x8d, hi: 0x8d}, + {value: 0x43e9, lo: 0x8e, hi: 0x8e}, + // Block 0x64, offset 0x1f9 + {value: 0x0000, lo: 0x02}, + {value: 0x8100, lo: 0xa4, hi: 0xa5}, + {value: 0x8100, lo: 0xb0, hi: 0xb1}, + // Block 0x65, offset 0x1fc + {value: 0x0000, lo: 0x02}, + {value: 0x8100, lo: 0x9b, hi: 0x9d}, + {value: 0x8200, lo: 0x9e, hi: 0xa3}, + // Block 0x66, offset 0x1ff + {value: 0x0000, lo: 0x01}, + {value: 0x8100, lo: 0x90, hi: 0x90}, + // Block 0x67, offset 0x201 + {value: 0x0000, lo: 0x02}, + {value: 0x8100, lo: 0x99, hi: 0x99}, + {value: 0x8200, lo: 0xb2, hi: 0xb4}, + // Block 0x68, offset 0x204 + {value: 0x0000, lo: 0x01}, + {value: 0x8100, lo: 0xbc, hi: 0xbd}, + // Block 0x69, offset 0x206 + {value: 0x0000, lo: 0x03}, + {value: 0x8133, lo: 0xa0, hi: 0xa6}, + {value: 0x812e, lo: 0xa7, hi: 0xad}, + {value: 0x8133, lo: 0xae, hi: 0xaf}, + // Block 0x6a, offset 0x20a + {value: 0x0000, lo: 0x04}, + {value: 0x8100, lo: 0x89, hi: 0x8c}, + {value: 0x8100, lo: 0xb0, hi: 0xb2}, + {value: 0x8100, lo: 0xb4, hi: 0xb4}, + {value: 0x8100, lo: 0xb6, hi: 0xbf}, + // Block 0x6b, offset 0x20f + {value: 0x0000, lo: 0x01}, + {value: 0x8100, lo: 0x81, hi: 0x8c}, + // Block 0x6c, offset 0x211 + {value: 0x0000, lo: 0x01}, + {value: 0x8100, lo: 0xb5, hi: 0xba}, + // Block 0x6d, offset 0x213 + {value: 0x0000, lo: 0x04}, + {value: 0x4ab6, lo: 0x9e, hi: 0x9f}, + {value: 0x4ab6, lo: 0xa3, hi: 0xa3}, + {value: 0x4ab6, lo: 0xa5, hi: 0xa6}, + {value: 0x4ab6, lo: 0xaa, hi: 0xaf}, + // Block 0x6e, offset 0x218 + {value: 0x0000, lo: 0x05}, + {value: 0x4ab6, lo: 0x82, hi: 0x87}, + {value: 0x4ab6, lo: 0x8a, hi: 0x8f}, + {value: 0x4ab6, lo: 0x92, hi: 0x97}, + {value: 0x4ab6, lo: 0x9a, hi: 0x9c}, + {value: 0x8100, lo: 0xa3, hi: 0xa3}, + // Block 0x6f, offset 0x21e + {value: 0x0000, lo: 0x01}, + {value: 0x812e, lo: 0xbd, hi: 0xbd}, + // Block 0x70, offset 0x220 + {value: 0x0000, lo: 0x01}, + {value: 0x812e, lo: 0xa0, hi: 0xa0}, + // Block 0x71, offset 0x222 + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0xb6, hi: 0xba}, + // Block 0x72, offset 0x224 + {value: 0x002d, lo: 0x05}, + {value: 0x812e, lo: 0x8d, hi: 0x8d}, + {value: 0x8133, lo: 0x8f, hi: 0x8f}, + {value: 0x8133, lo: 0xb8, hi: 0xb8}, + {value: 0x8101, lo: 0xb9, hi: 0xba}, + {value: 0x8105, lo: 0xbf, hi: 0xbf}, + // Block 0x73, offset 0x22a + {value: 0x0000, lo: 0x02}, + {value: 0x8133, lo: 0xa5, hi: 0xa5}, + {value: 0x812e, lo: 0xa6, hi: 0xa6}, + // Block 0x74, offset 0x22d + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0xa4, hi: 0xa7}, + // Block 0x75, offset 0x22f + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0xab, hi: 0xac}, + // Block 0x76, offset 0x231 + {value: 0x0000, lo: 0x05}, + {value: 0x812e, lo: 0x86, hi: 0x87}, + {value: 0x8133, lo: 0x88, hi: 0x8a}, + {value: 0x812e, lo: 0x8b, hi: 0x8b}, + {value: 0x8133, lo: 0x8c, hi: 0x8c}, + {value: 0x812e, lo: 0x8d, hi: 0x90}, + // Block 0x77, offset 0x237 + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0x86, hi: 0x86}, + {value: 0x8105, lo: 0xbf, hi: 0xbf}, + // Block 0x78, offset 0x23a + {value: 0x17fe, lo: 0x07}, + {value: 0xa000, lo: 0x99, hi: 0x99}, + {value: 0x424f, lo: 0x9a, hi: 0x9a}, + {value: 0xa000, lo: 0x9b, hi: 0x9b}, + {value: 0x4259, lo: 0x9c, hi: 0x9c}, + {value: 0xa000, lo: 0xa5, hi: 0xa5}, + {value: 0x4263, lo: 0xab, hi: 0xab}, + {value: 0x8105, lo: 0xb9, hi: 0xba}, + // Block 0x79, offset 0x242 + {value: 0x0000, lo: 0x06}, + {value: 0x8133, lo: 0x80, hi: 0x82}, + {value: 0x9900, lo: 0xa7, hi: 0xa7}, + {value: 0x2d8b, lo: 0xae, hi: 0xae}, + {value: 0x2d95, lo: 0xaf, hi: 0xaf}, + {value: 0xa000, lo: 0xb1, hi: 0xb2}, + {value: 0x8105, lo: 0xb3, hi: 0xb4}, + // Block 0x7a, offset 0x249 + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0x80, hi: 0x80}, + {value: 0x8103, lo: 0x8a, hi: 0x8a}, + // Block 0x7b, offset 0x24c + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0xb5, hi: 0xb5}, + {value: 0x8103, lo: 0xb6, hi: 0xb6}, + // Block 0x7c, offset 0x24f + {value: 0x0002, lo: 0x01}, + {value: 0x8103, lo: 0xa9, hi: 0xaa}, + // Block 0x7d, offset 0x251 + {value: 0x0000, lo: 0x02}, + {value: 0x8103, lo: 0xbb, hi: 0xbc}, + {value: 0x9900, lo: 0xbe, hi: 0xbe}, + // Block 0x7e, offset 0x254 + {value: 0x0000, lo: 0x07}, + {value: 0xa000, lo: 0x87, hi: 0x87}, + {value: 0x2d9f, lo: 0x8b, hi: 0x8b}, + {value: 0x2da9, lo: 0x8c, hi: 0x8c}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x9900, lo: 0x97, hi: 0x97}, + {value: 0x8133, lo: 0xa6, hi: 0xac}, + {value: 0x8133, lo: 0xb0, hi: 0xb4}, + // Block 0x7f, offset 0x25c + {value: 0x0000, lo: 0x03}, + {value: 0x8105, lo: 0x82, hi: 0x82}, + {value: 0x8103, lo: 0x86, hi: 0x86}, + {value: 0x8133, lo: 0x9e, hi: 0x9e}, + // Block 0x80, offset 0x260 + {value: 0x6b4d, lo: 0x06}, + {value: 0x9900, lo: 0xb0, hi: 0xb0}, + {value: 0xa000, lo: 0xb9, hi: 0xb9}, + {value: 0x9900, lo: 0xba, hi: 0xba}, + {value: 0x2dbd, lo: 0xbb, hi: 0xbb}, + {value: 0x2db3, lo: 0xbc, hi: 0xbd}, + {value: 0x2dc7, lo: 0xbe, hi: 0xbe}, + // Block 0x81, offset 0x267 + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0x82, hi: 0x82}, + {value: 0x8103, lo: 0x83, hi: 0x83}, + // Block 0x82, offset 0x26a + {value: 0x0000, lo: 0x05}, + {value: 0x9900, lo: 0xaf, hi: 0xaf}, + {value: 0xa000, lo: 0xb8, hi: 0xb9}, + {value: 0x2dd1, lo: 0xba, hi: 0xba}, + {value: 0x2ddb, lo: 0xbb, hi: 0xbb}, + {value: 0x8105, lo: 0xbf, hi: 0xbf}, + // Block 0x83, offset 0x270 + {value: 0x0000, lo: 0x01}, + {value: 0x8103, lo: 0x80, hi: 0x80}, + // Block 0x84, offset 0x272 + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0xb6, hi: 0xb6}, + {value: 0x8103, lo: 0xb7, hi: 0xb7}, + // Block 0x85, offset 0x275 + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0xab, hi: 0xab}, + // Block 0x86, offset 0x277 + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0xb9, hi: 0xb9}, + {value: 0x8103, lo: 0xba, hi: 0xba}, + // Block 0x87, offset 0x27a + {value: 0x0000, lo: 0x04}, + {value: 0x9900, lo: 0xb0, hi: 0xb0}, + {value: 0xa000, lo: 0xb5, hi: 0xb5}, + {value: 0x2de5, lo: 0xb8, hi: 0xb8}, + {value: 0x8105, lo: 0xbd, hi: 0xbe}, + // Block 0x88, offset 0x27f + {value: 0x0000, lo: 0x01}, + {value: 0x8103, lo: 0x83, hi: 0x83}, + // Block 0x89, offset 0x281 + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0xa0, hi: 0xa0}, + // Block 0x8a, offset 0x283 + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0xb4, hi: 0xb4}, + // Block 0x8b, offset 0x285 + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0x87, hi: 0x87}, + // Block 0x8c, offset 0x287 + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0x99, hi: 0x99}, + // Block 0x8d, offset 0x289 + {value: 0x0000, lo: 0x02}, + {value: 0x8103, lo: 0x82, hi: 0x82}, + {value: 0x8105, lo: 0x84, hi: 0x85}, + // Block 0x8e, offset 0x28c + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0x97, hi: 0x97}, + // Block 0x8f, offset 0x28e + {value: 0x0000, lo: 0x01}, + {value: 0x8101, lo: 0xb0, hi: 0xb4}, + // Block 0x90, offset 0x290 + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0xb0, hi: 0xb6}, + // Block 0x91, offset 0x292 + {value: 0x0000, lo: 0x01}, + {value: 0x8102, lo: 0xb0, hi: 0xb1}, + // Block 0x92, offset 0x294 + {value: 0x0000, lo: 0x01}, + {value: 0x8101, lo: 0x9e, hi: 0x9e}, + // Block 0x93, offset 0x296 + {value: 0x0000, lo: 0x0c}, + {value: 0x45e3, lo: 0x9e, hi: 0x9e}, + {value: 0x45ed, lo: 0x9f, hi: 0x9f}, + {value: 0x4621, lo: 0xa0, hi: 0xa0}, + {value: 0x462f, lo: 0xa1, hi: 0xa1}, + {value: 0x463d, lo: 0xa2, hi: 0xa2}, + {value: 0x464b, lo: 0xa3, hi: 0xa3}, + {value: 0x4659, lo: 0xa4, hi: 0xa4}, + {value: 0x812c, lo: 0xa5, hi: 0xa6}, + {value: 0x8101, lo: 0xa7, hi: 0xa9}, + {value: 0x8131, lo: 0xad, hi: 0xad}, + {value: 0x812c, lo: 0xae, hi: 0xb2}, + {value: 0x812e, lo: 0xbb, hi: 0xbf}, + // Block 0x94, offset 0x2a3 + {value: 0x0000, lo: 0x09}, + {value: 0x812e, lo: 0x80, hi: 0x82}, + {value: 0x8133, lo: 0x85, hi: 0x89}, + {value: 0x812e, lo: 0x8a, hi: 0x8b}, + {value: 0x8133, lo: 0xaa, hi: 0xad}, + {value: 0x45f7, lo: 0xbb, hi: 0xbb}, + {value: 0x4601, lo: 0xbc, hi: 0xbc}, + {value: 0x4667, lo: 0xbd, hi: 0xbd}, + {value: 0x4683, lo: 0xbe, hi: 0xbe}, + {value: 0x4675, lo: 0xbf, hi: 0xbf}, + // Block 0x95, offset 0x2ad + {value: 0x0000, lo: 0x01}, + {value: 0x4691, lo: 0x80, hi: 0x80}, + // Block 0x96, offset 0x2af + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0x82, hi: 0x84}, + // Block 0x97, offset 0x2b1 + {value: 0x0000, lo: 0x05}, + {value: 0x8133, lo: 0x80, hi: 0x86}, + {value: 0x8133, lo: 0x88, hi: 0x98}, + {value: 0x8133, lo: 0x9b, hi: 0xa1}, + {value: 0x8133, lo: 0xa3, hi: 0xa4}, + {value: 0x8133, lo: 0xa6, hi: 0xaa}, + // Block 0x98, offset 0x2b7 + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0xac, hi: 0xaf}, + // Block 0x99, offset 0x2b9 + {value: 0x0000, lo: 0x01}, + {value: 0x812e, lo: 0x90, hi: 0x96}, + // Block 0x9a, offset 0x2bb + {value: 0x0000, lo: 0x02}, + {value: 0x8133, lo: 0x84, hi: 0x89}, + {value: 0x8103, lo: 0x8a, hi: 0x8a}, + // Block 0x9b, offset 0x2be + {value: 0x0000, lo: 0x01}, + {value: 0x8100, lo: 0x93, hi: 0x93}, +} + +// lookup returns the trie value for the first UTF-8 encoding in s and +// the width in bytes of this encoding. The size will be 0 if s does not +// hold enough bytes to complete the encoding. len(s) must be greater than 0. +func (t *nfkcTrie) lookup(s []byte) (v uint16, sz int) { + c0 := s[0] + switch { + case c0 < 0x80: // is ASCII + return nfkcValues[c0], 1 + case c0 < 0xC2: + return 0, 1 // Illegal UTF-8: not a starter, not ASCII. + case c0 < 0xE0: // 2-byte UTF-8 + if len(s) < 2 { + return 0, 0 + } + i := nfkcIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c1), 2 + case c0 < 0xF0: // 3-byte UTF-8 + if len(s) < 3 { + return 0, 0 + } + i := nfkcIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + o := uint32(i)<<6 + uint32(c1) + i = nfkcIndex[o] + c2 := s[2] + if c2 < 0x80 || 0xC0 <= c2 { + return 0, 2 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c2), 3 + case c0 < 0xF8: // 4-byte UTF-8 + if len(s) < 4 { + return 0, 0 + } + i := nfkcIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + o := uint32(i)<<6 + uint32(c1) + i = nfkcIndex[o] + c2 := s[2] + if c2 < 0x80 || 0xC0 <= c2 { + return 0, 2 // Illegal UTF-8: not a continuation byte. + } + o = uint32(i)<<6 + uint32(c2) + i = nfkcIndex[o] + c3 := s[3] + if c3 < 0x80 || 0xC0 <= c3 { + return 0, 3 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c3), 4 + } + // Illegal rune + return 0, 1 +} + +// lookupUnsafe returns the trie value for the first UTF-8 encoding in s. +// s must start with a full and valid UTF-8 encoded rune. +func (t *nfkcTrie) lookupUnsafe(s []byte) uint16 { + c0 := s[0] + if c0 < 0x80 { // is ASCII + return nfkcValues[c0] + } + i := nfkcIndex[c0] + if c0 < 0xE0 { // 2-byte UTF-8 + return t.lookupValue(uint32(i), s[1]) + } + i = nfkcIndex[uint32(i)<<6+uint32(s[1])] + if c0 < 0xF0 { // 3-byte UTF-8 + return t.lookupValue(uint32(i), s[2]) + } + i = nfkcIndex[uint32(i)<<6+uint32(s[2])] + if c0 < 0xF8 { // 4-byte UTF-8 + return t.lookupValue(uint32(i), s[3]) + } + return 0 +} + +// lookupString returns the trie value for the first UTF-8 encoding in s and +// the width in bytes of this encoding. The size will be 0 if s does not +// hold enough bytes to complete the encoding. len(s) must be greater than 0. +func (t *nfkcTrie) lookupString(s string) (v uint16, sz int) { + c0 := s[0] + switch { + case c0 < 0x80: // is ASCII + return nfkcValues[c0], 1 + case c0 < 0xC2: + return 0, 1 // Illegal UTF-8: not a starter, not ASCII. + case c0 < 0xE0: // 2-byte UTF-8 + if len(s) < 2 { + return 0, 0 + } + i := nfkcIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c1), 2 + case c0 < 0xF0: // 3-byte UTF-8 + if len(s) < 3 { + return 0, 0 + } + i := nfkcIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + o := uint32(i)<<6 + uint32(c1) + i = nfkcIndex[o] + c2 := s[2] + if c2 < 0x80 || 0xC0 <= c2 { + return 0, 2 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c2), 3 + case c0 < 0xF8: // 4-byte UTF-8 + if len(s) < 4 { + return 0, 0 + } + i := nfkcIndex[c0] + c1 := s[1] + if c1 < 0x80 || 0xC0 <= c1 { + return 0, 1 // Illegal UTF-8: not a continuation byte. + } + o := uint32(i)<<6 + uint32(c1) + i = nfkcIndex[o] + c2 := s[2] + if c2 < 0x80 || 0xC0 <= c2 { + return 0, 2 // Illegal UTF-8: not a continuation byte. + } + o = uint32(i)<<6 + uint32(c2) + i = nfkcIndex[o] + c3 := s[3] + if c3 < 0x80 || 0xC0 <= c3 { + return 0, 3 // Illegal UTF-8: not a continuation byte. + } + return t.lookupValue(uint32(i), c3), 4 + } + // Illegal rune + return 0, 1 +} + +// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. +// s must start with a full and valid UTF-8 encoded rune. +func (t *nfkcTrie) lookupStringUnsafe(s string) uint16 { + c0 := s[0] + if c0 < 0x80 { // is ASCII + return nfkcValues[c0] + } + i := nfkcIndex[c0] + if c0 < 0xE0 { // 2-byte UTF-8 + return t.lookupValue(uint32(i), s[1]) + } + i = nfkcIndex[uint32(i)<<6+uint32(s[1])] + if c0 < 0xF0 { // 3-byte UTF-8 + return t.lookupValue(uint32(i), s[2]) + } + i = nfkcIndex[uint32(i)<<6+uint32(s[2])] + if c0 < 0xF8 { // 4-byte UTF-8 + return t.lookupValue(uint32(i), s[3]) + } + return 0 +} + +// nfkcTrie. Total size: 18768 bytes (18.33 KiB). Checksum: c51186dd2412943d. +type nfkcTrie struct{} + +func newNfkcTrie(i int) *nfkcTrie { + return &nfkcTrie{} +} + +// lookupValue determines the type of block n and looks up the value for b. +func (t *nfkcTrie) lookupValue(n uint32, b byte) uint16 { + switch { + case n < 92: + return uint16(nfkcValues[n<<6+uint32(b)]) + default: + n -= 92 + return uint16(nfkcSparse.lookup(n, b)) + } +} + +// nfkcValues: 94 blocks, 6016 entries, 12032 bytes +// The third block is the zero block. +var nfkcValues = [6016]uint16{ + // Block 0x0, offset 0x0 + 0x3c: 0xa000, 0x3d: 0xa000, 0x3e: 0xa000, + // Block 0x1, offset 0x40 + 0x41: 0xa000, 0x42: 0xa000, 0x43: 0xa000, 0x44: 0xa000, 0x45: 0xa000, + 0x46: 0xa000, 0x47: 0xa000, 0x48: 0xa000, 0x49: 0xa000, 0x4a: 0xa000, 0x4b: 0xa000, + 0x4c: 0xa000, 0x4d: 0xa000, 0x4e: 0xa000, 0x4f: 0xa000, 0x50: 0xa000, + 0x52: 0xa000, 0x53: 0xa000, 0x54: 0xa000, 0x55: 0xa000, 0x56: 0xa000, 0x57: 0xa000, + 0x58: 0xa000, 0x59: 0xa000, 0x5a: 0xa000, + 0x61: 0xa000, 0x62: 0xa000, 0x63: 0xa000, + 0x64: 0xa000, 0x65: 0xa000, 0x66: 0xa000, 0x67: 0xa000, 0x68: 0xa000, 0x69: 0xa000, + 0x6a: 0xa000, 0x6b: 0xa000, 0x6c: 0xa000, 0x6d: 0xa000, 0x6e: 0xa000, 0x6f: 0xa000, + 0x70: 0xa000, 0x72: 0xa000, 0x73: 0xa000, 0x74: 0xa000, 0x75: 0xa000, + 0x76: 0xa000, 0x77: 0xa000, 0x78: 0xa000, 0x79: 0xa000, 0x7a: 0xa000, + // Block 0x2, offset 0x80 + // Block 0x3, offset 0xc0 + 0xc0: 0x2f86, 0xc1: 0x2f8b, 0xc2: 0x469f, 0xc3: 0x2f90, 0xc4: 0x46ae, 0xc5: 0x46b3, + 0xc6: 0xa000, 0xc7: 0x46bd, 0xc8: 0x2ff9, 0xc9: 0x2ffe, 0xca: 0x46c2, 0xcb: 0x3012, + 0xcc: 0x3085, 0xcd: 0x308a, 0xce: 0x308f, 0xcf: 0x46d6, 0xd1: 0x311b, + 0xd2: 0x313e, 0xd3: 0x3143, 0xd4: 0x46e0, 0xd5: 0x46e5, 0xd6: 0x46f4, + 0xd8: 0xa000, 0xd9: 0x31ca, 0xda: 0x31cf, 0xdb: 0x31d4, 0xdc: 0x4726, 0xdd: 0x324c, + 0xe0: 0x3292, 0xe1: 0x3297, 0xe2: 0x4730, 0xe3: 0x329c, + 0xe4: 0x473f, 0xe5: 0x4744, 0xe6: 0xa000, 0xe7: 0x474e, 0xe8: 0x3305, 0xe9: 0x330a, + 0xea: 0x4753, 0xeb: 0x331e, 0xec: 0x3396, 0xed: 0x339b, 0xee: 0x33a0, 0xef: 0x4767, + 0xf1: 0x342c, 0xf2: 0x344f, 0xf3: 0x3454, 0xf4: 0x4771, 0xf5: 0x4776, + 0xf6: 0x4785, 0xf8: 0xa000, 0xf9: 0x34e0, 0xfa: 0x34e5, 0xfb: 0x34ea, + 0xfc: 0x47b7, 0xfd: 0x3567, 0xff: 0x3580, + // Block 0x4, offset 0x100 + 0x100: 0x2f95, 0x101: 0x32a1, 0x102: 0x46a4, 0x103: 0x4735, 0x104: 0x2fb3, 0x105: 0x32bf, + 0x106: 0x2fc7, 0x107: 0x32d3, 0x108: 0x2fcc, 0x109: 0x32d8, 0x10a: 0x2fd1, 0x10b: 0x32dd, + 0x10c: 0x2fd6, 0x10d: 0x32e2, 0x10e: 0x2fe0, 0x10f: 0x32ec, + 0x112: 0x46c7, 0x113: 0x4758, 0x114: 0x3008, 0x115: 0x3314, 0x116: 0x300d, 0x117: 0x3319, + 0x118: 0x302b, 0x119: 0x3337, 0x11a: 0x301c, 0x11b: 0x3328, 0x11c: 0x3044, 0x11d: 0x3350, + 0x11e: 0x304e, 0x11f: 0x335a, 0x120: 0x3053, 0x121: 0x335f, 0x122: 0x305d, 0x123: 0x3369, + 0x124: 0x3062, 0x125: 0x336e, 0x128: 0x3094, 0x129: 0x33a5, + 0x12a: 0x3099, 0x12b: 0x33aa, 0x12c: 0x309e, 0x12d: 0x33af, 0x12e: 0x30c1, 0x12f: 0x33cd, + 0x130: 0x30a3, 0x132: 0x1960, 0x133: 0x19ed, 0x134: 0x30cb, 0x135: 0x33d7, + 0x136: 0x30df, 0x137: 0x33f0, 0x139: 0x30e9, 0x13a: 0x33fa, 0x13b: 0x30f3, + 0x13c: 0x3404, 0x13d: 0x30ee, 0x13e: 0x33ff, 0x13f: 0x1bb2, + // Block 0x5, offset 0x140 + 0x140: 0x1c3a, 0x143: 0x3116, 0x144: 0x3427, 0x145: 0x312f, + 0x146: 0x3440, 0x147: 0x3125, 0x148: 0x3436, 0x149: 0x1c62, + 0x14c: 0x46ea, 0x14d: 0x477b, 0x14e: 0x3148, 0x14f: 0x3459, 0x150: 0x3152, 0x151: 0x3463, + 0x154: 0x3170, 0x155: 0x3481, 0x156: 0x3189, 0x157: 0x349a, + 0x158: 0x317a, 0x159: 0x348b, 0x15a: 0x470d, 0x15b: 0x479e, 0x15c: 0x3193, 0x15d: 0x34a4, + 0x15e: 0x31a2, 0x15f: 0x34b3, 0x160: 0x4712, 0x161: 0x47a3, 0x162: 0x31bb, 0x163: 0x34d1, + 0x164: 0x31ac, 0x165: 0x34c2, 0x168: 0x471c, 0x169: 0x47ad, + 0x16a: 0x4721, 0x16b: 0x47b2, 0x16c: 0x31d9, 0x16d: 0x34ef, 0x16e: 0x31e3, 0x16f: 0x34f9, + 0x170: 0x31e8, 0x171: 0x34fe, 0x172: 0x3206, 0x173: 0x351c, 0x174: 0x3229, 0x175: 0x353f, + 0x176: 0x3251, 0x177: 0x356c, 0x178: 0x3265, 0x179: 0x3274, 0x17a: 0x3594, 0x17b: 0x327e, + 0x17c: 0x359e, 0x17d: 0x3283, 0x17e: 0x35a3, 0x17f: 0x00a7, + // Block 0x6, offset 0x180 + 0x184: 0x2e05, 0x185: 0x2e0b, + 0x186: 0x2e11, 0x187: 0x1975, 0x188: 0x1978, 0x189: 0x1a0e, 0x18a: 0x198d, 0x18b: 0x1990, + 0x18c: 0x1a44, 0x18d: 0x2f9f, 0x18e: 0x32ab, 0x18f: 0x30ad, 0x190: 0x33b9, 0x191: 0x3157, + 0x192: 0x3468, 0x193: 0x31ed, 0x194: 0x3503, 0x195: 0x39e6, 0x196: 0x3b75, 0x197: 0x39df, + 0x198: 0x3b6e, 0x199: 0x39ed, 0x19a: 0x3b7c, 0x19b: 0x39d8, 0x19c: 0x3b67, + 0x19e: 0x38c7, 0x19f: 0x3a56, 0x1a0: 0x38c0, 0x1a1: 0x3a4f, 0x1a2: 0x35ca, 0x1a3: 0x35dc, + 0x1a6: 0x3058, 0x1a7: 0x3364, 0x1a8: 0x30d5, 0x1a9: 0x33e6, + 0x1aa: 0x4703, 0x1ab: 0x4794, 0x1ac: 0x39a7, 0x1ad: 0x3b36, 0x1ae: 0x35ee, 0x1af: 0x35f4, + 0x1b0: 0x33dc, 0x1b1: 0x1945, 0x1b2: 0x1948, 0x1b3: 0x19d5, 0x1b4: 0x303f, 0x1b5: 0x334b, + 0x1b8: 0x3111, 0x1b9: 0x3422, 0x1ba: 0x38ce, 0x1bb: 0x3a5d, + 0x1bc: 0x35c4, 0x1bd: 0x35d6, 0x1be: 0x35d0, 0x1bf: 0x35e2, + // Block 0x7, offset 0x1c0 + 0x1c0: 0x2fa4, 0x1c1: 0x32b0, 0x1c2: 0x2fa9, 0x1c3: 0x32b5, 0x1c4: 0x3021, 0x1c5: 0x332d, + 0x1c6: 0x3026, 0x1c7: 0x3332, 0x1c8: 0x30b2, 0x1c9: 0x33be, 0x1ca: 0x30b7, 0x1cb: 0x33c3, + 0x1cc: 0x315c, 0x1cd: 0x346d, 0x1ce: 0x3161, 0x1cf: 0x3472, 0x1d0: 0x317f, 0x1d1: 0x3490, + 0x1d2: 0x3184, 0x1d3: 0x3495, 0x1d4: 0x31f2, 0x1d5: 0x3508, 0x1d6: 0x31f7, 0x1d7: 0x350d, + 0x1d8: 0x319d, 0x1d9: 0x34ae, 0x1da: 0x31b6, 0x1db: 0x34cc, + 0x1de: 0x3071, 0x1df: 0x337d, + 0x1e6: 0x46a9, 0x1e7: 0x473a, 0x1e8: 0x46d1, 0x1e9: 0x4762, + 0x1ea: 0x3976, 0x1eb: 0x3b05, 0x1ec: 0x3953, 0x1ed: 0x3ae2, 0x1ee: 0x46ef, 0x1ef: 0x4780, + 0x1f0: 0x396f, 0x1f1: 0x3afe, 0x1f2: 0x325b, 0x1f3: 0x3576, + // Block 0x8, offset 0x200 + 0x200: 0x9933, 0x201: 0x9933, 0x202: 0x9933, 0x203: 0x9933, 0x204: 0x9933, 0x205: 0x8133, + 0x206: 0x9933, 0x207: 0x9933, 0x208: 0x9933, 0x209: 0x9933, 0x20a: 0x9933, 0x20b: 0x9933, + 0x20c: 0x9933, 0x20d: 0x8133, 0x20e: 0x8133, 0x20f: 0x9933, 0x210: 0x8133, 0x211: 0x9933, + 0x212: 0x8133, 0x213: 0x9933, 0x214: 0x9933, 0x215: 0x8134, 0x216: 0x812e, 0x217: 0x812e, + 0x218: 0x812e, 0x219: 0x812e, 0x21a: 0x8134, 0x21b: 0x992c, 0x21c: 0x812e, 0x21d: 0x812e, + 0x21e: 0x812e, 0x21f: 0x812e, 0x220: 0x812e, 0x221: 0x812a, 0x222: 0x812a, 0x223: 0x992e, + 0x224: 0x992e, 0x225: 0x992e, 0x226: 0x992e, 0x227: 0x992a, 0x228: 0x992a, 0x229: 0x812e, + 0x22a: 0x812e, 0x22b: 0x812e, 0x22c: 0x812e, 0x22d: 0x992e, 0x22e: 0x992e, 0x22f: 0x812e, + 0x230: 0x992e, 0x231: 0x992e, 0x232: 0x812e, 0x233: 0x812e, 0x234: 0x8101, 0x235: 0x8101, + 0x236: 0x8101, 0x237: 0x8101, 0x238: 0x9901, 0x239: 0x812e, 0x23a: 0x812e, 0x23b: 0x812e, + 0x23c: 0x812e, 0x23d: 0x8133, 0x23e: 0x8133, 0x23f: 0x8133, + // Block 0x9, offset 0x240 + 0x240: 0x49c5, 0x241: 0x49ca, 0x242: 0x9933, 0x243: 0x49cf, 0x244: 0x4a88, 0x245: 0x9937, + 0x246: 0x8133, 0x247: 0x812e, 0x248: 0x812e, 0x249: 0x812e, 0x24a: 0x8133, 0x24b: 0x8133, + 0x24c: 0x8133, 0x24d: 0x812e, 0x24e: 0x812e, 0x250: 0x8133, 0x251: 0x8133, + 0x252: 0x8133, 0x253: 0x812e, 0x254: 0x812e, 0x255: 0x812e, 0x256: 0x812e, 0x257: 0x8133, + 0x258: 0x8134, 0x259: 0x812e, 0x25a: 0x812e, 0x25b: 0x8133, 0x25c: 0x8135, 0x25d: 0x8136, + 0x25e: 0x8136, 0x25f: 0x8135, 0x260: 0x8136, 0x261: 0x8136, 0x262: 0x8135, 0x263: 0x8133, + 0x264: 0x8133, 0x265: 0x8133, 0x266: 0x8133, 0x267: 0x8133, 0x268: 0x8133, 0x269: 0x8133, + 0x26a: 0x8133, 0x26b: 0x8133, 0x26c: 0x8133, 0x26d: 0x8133, 0x26e: 0x8133, 0x26f: 0x8133, + 0x274: 0x0173, + 0x27a: 0x42bc, + 0x27e: 0x0037, + // Block 0xa, offset 0x280 + 0x284: 0x4271, 0x285: 0x4492, + 0x286: 0x3600, 0x287: 0x00ce, 0x288: 0x361e, 0x289: 0x362a, 0x28a: 0x363c, + 0x28c: 0x365a, 0x28e: 0x366c, 0x28f: 0x368a, 0x290: 0x3e1f, 0x291: 0xa000, + 0x295: 0xa000, 0x297: 0xa000, + 0x299: 0xa000, + 0x29f: 0xa000, 0x2a1: 0xa000, + 0x2a5: 0xa000, 0x2a9: 0xa000, + 0x2aa: 0x364e, 0x2ab: 0x367e, 0x2ac: 0x4815, 0x2ad: 0x36ae, 0x2ae: 0x483f, 0x2af: 0x36c0, + 0x2b0: 0x3e87, 0x2b1: 0xa000, 0x2b5: 0xa000, + 0x2b7: 0xa000, 0x2b9: 0xa000, + 0x2bf: 0xa000, + // Block 0xb, offset 0x2c0 + 0x2c1: 0xa000, 0x2c5: 0xa000, + 0x2c9: 0xa000, 0x2ca: 0x4857, 0x2cb: 0x4875, + 0x2cc: 0x36de, 0x2cd: 0x36f6, 0x2ce: 0x488d, 0x2d0: 0x01c1, 0x2d1: 0x01d3, + 0x2d2: 0x01af, 0x2d3: 0x4323, 0x2d4: 0x4329, 0x2d5: 0x01fd, 0x2d6: 0x01eb, + 0x2f0: 0x01d9, 0x2f1: 0x01ee, 0x2f2: 0x01f1, 0x2f4: 0x018b, 0x2f5: 0x01ca, + 0x2f9: 0x01a9, + // Block 0xc, offset 0x300 + 0x300: 0x3738, 0x301: 0x3744, 0x303: 0x3732, + 0x306: 0xa000, 0x307: 0x3720, + 0x30c: 0x3774, 0x30d: 0x375c, 0x30e: 0x3786, 0x310: 0xa000, + 0x313: 0xa000, 0x315: 0xa000, 0x316: 0xa000, 0x317: 0xa000, + 0x318: 0xa000, 0x319: 0x3768, 0x31a: 0xa000, + 0x31e: 0xa000, 0x323: 0xa000, + 0x327: 0xa000, + 0x32b: 0xa000, 0x32d: 0xa000, + 0x330: 0xa000, 0x333: 0xa000, 0x335: 0xa000, + 0x336: 0xa000, 0x337: 0xa000, 0x338: 0xa000, 0x339: 0x37ec, 0x33a: 0xa000, + 0x33e: 0xa000, + // Block 0xd, offset 0x340 + 0x341: 0x374a, 0x342: 0x37ce, + 0x350: 0x3726, 0x351: 0x37aa, + 0x352: 0x372c, 0x353: 0x37b0, 0x356: 0x373e, 0x357: 0x37c2, + 0x358: 0xa000, 0x359: 0xa000, 0x35a: 0x3840, 0x35b: 0x3846, 0x35c: 0x3750, 0x35d: 0x37d4, + 0x35e: 0x3756, 0x35f: 0x37da, 0x362: 0x3762, 0x363: 0x37e6, + 0x364: 0x376e, 0x365: 0x37f2, 0x366: 0x377a, 0x367: 0x37fe, 0x368: 0xa000, 0x369: 0xa000, + 0x36a: 0x384c, 0x36b: 0x3852, 0x36c: 0x37a4, 0x36d: 0x3828, 0x36e: 0x3780, 0x36f: 0x3804, + 0x370: 0x378c, 0x371: 0x3810, 0x372: 0x3792, 0x373: 0x3816, 0x374: 0x3798, 0x375: 0x381c, + 0x378: 0x379e, 0x379: 0x3822, + // Block 0xe, offset 0x380 + 0x387: 0x1d67, + 0x391: 0x812e, + 0x392: 0x8133, 0x393: 0x8133, 0x394: 0x8133, 0x395: 0x8133, 0x396: 0x812e, 0x397: 0x8133, + 0x398: 0x8133, 0x399: 0x8133, 0x39a: 0x812f, 0x39b: 0x812e, 0x39c: 0x8133, 0x39d: 0x8133, + 0x39e: 0x8133, 0x39f: 0x8133, 0x3a0: 0x8133, 0x3a1: 0x8133, 0x3a2: 0x812e, 0x3a3: 0x812e, + 0x3a4: 0x812e, 0x3a5: 0x812e, 0x3a6: 0x812e, 0x3a7: 0x812e, 0x3a8: 0x8133, 0x3a9: 0x8133, + 0x3aa: 0x812e, 0x3ab: 0x8133, 0x3ac: 0x8133, 0x3ad: 0x812f, 0x3ae: 0x8132, 0x3af: 0x8133, + 0x3b0: 0x8106, 0x3b1: 0x8107, 0x3b2: 0x8108, 0x3b3: 0x8109, 0x3b4: 0x810a, 0x3b5: 0x810b, + 0x3b6: 0x810c, 0x3b7: 0x810d, 0x3b8: 0x810e, 0x3b9: 0x810f, 0x3ba: 0x810f, 0x3bb: 0x8110, + 0x3bc: 0x8111, 0x3bd: 0x8112, 0x3bf: 0x8113, + // Block 0xf, offset 0x3c0 + 0x3c8: 0xa000, 0x3ca: 0xa000, 0x3cb: 0x8117, + 0x3cc: 0x8118, 0x3cd: 0x8119, 0x3ce: 0x811a, 0x3cf: 0x811b, 0x3d0: 0x811c, 0x3d1: 0x811d, + 0x3d2: 0x811e, 0x3d3: 0x9933, 0x3d4: 0x9933, 0x3d5: 0x992e, 0x3d6: 0x812e, 0x3d7: 0x8133, + 0x3d8: 0x8133, 0x3d9: 0x8133, 0x3da: 0x8133, 0x3db: 0x8133, 0x3dc: 0x812e, 0x3dd: 0x8133, + 0x3de: 0x8133, 0x3df: 0x812e, + 0x3f0: 0x811f, 0x3f5: 0x1d8a, + 0x3f6: 0x2019, 0x3f7: 0x2055, 0x3f8: 0x2050, + // Block 0x10, offset 0x400 + 0x413: 0x812e, 0x414: 0x8133, 0x415: 0x8133, 0x416: 0x8133, 0x417: 0x8133, + 0x418: 0x8133, 0x419: 0x8133, 0x41a: 0x8133, 0x41b: 0x8133, 0x41c: 0x8133, 0x41d: 0x8133, + 0x41e: 0x8133, 0x41f: 0x8133, 0x420: 0x8133, 0x421: 0x8133, 0x423: 0x812e, + 0x424: 0x8133, 0x425: 0x8133, 0x426: 0x812e, 0x427: 0x8133, 0x428: 0x8133, 0x429: 0x812e, + 0x42a: 0x8133, 0x42b: 0x8133, 0x42c: 0x8133, 0x42d: 0x812e, 0x42e: 0x812e, 0x42f: 0x812e, + 0x430: 0x8117, 0x431: 0x8118, 0x432: 0x8119, 0x433: 0x8133, 0x434: 0x8133, 0x435: 0x8133, + 0x436: 0x812e, 0x437: 0x8133, 0x438: 0x8133, 0x439: 0x812e, 0x43a: 0x812e, 0x43b: 0x8133, + 0x43c: 0x8133, 0x43d: 0x8133, 0x43e: 0x8133, 0x43f: 0x8133, + // Block 0x11, offset 0x440 + 0x445: 0xa000, + 0x446: 0x2d33, 0x447: 0xa000, 0x448: 0x2d3b, 0x449: 0xa000, 0x44a: 0x2d43, 0x44b: 0xa000, + 0x44c: 0x2d4b, 0x44d: 0xa000, 0x44e: 0x2d53, 0x451: 0xa000, + 0x452: 0x2d5b, + 0x474: 0x8103, 0x475: 0x9900, + 0x47a: 0xa000, 0x47b: 0x2d63, + 0x47c: 0xa000, 0x47d: 0x2d6b, 0x47e: 0xa000, 0x47f: 0xa000, + // Block 0x12, offset 0x480 + 0x480: 0x0069, 0x481: 0x006b, 0x482: 0x006f, 0x483: 0x0083, 0x484: 0x00f5, 0x485: 0x00f8, + 0x486: 0x0416, 0x487: 0x0085, 0x488: 0x0089, 0x489: 0x008b, 0x48a: 0x0104, 0x48b: 0x0107, + 0x48c: 0x010a, 0x48d: 0x008f, 0x48f: 0x0097, 0x490: 0x009b, 0x491: 0x00e0, + 0x492: 0x009f, 0x493: 0x00fe, 0x494: 0x041a, 0x495: 0x041e, 0x496: 0x00a1, 0x497: 0x00a9, + 0x498: 0x00ab, 0x499: 0x0426, 0x49a: 0x012b, 0x49b: 0x00ad, 0x49c: 0x042a, 0x49d: 0x01c1, + 0x49e: 0x01c4, 0x49f: 0x01c7, 0x4a0: 0x01fd, 0x4a1: 0x0200, 0x4a2: 0x0093, 0x4a3: 0x00a5, + 0x4a4: 0x00ab, 0x4a5: 0x00ad, 0x4a6: 0x01c1, 0x4a7: 0x01c4, 0x4a8: 0x01ee, 0x4a9: 0x01fd, + 0x4aa: 0x0200, + 0x4b8: 0x020f, + // Block 0x13, offset 0x4c0 + 0x4db: 0x00fb, 0x4dc: 0x0087, 0x4dd: 0x0101, + 0x4de: 0x00d4, 0x4df: 0x010a, 0x4e0: 0x008d, 0x4e1: 0x010d, 0x4e2: 0x0110, 0x4e3: 0x0116, + 0x4e4: 0x011c, 0x4e5: 0x011f, 0x4e6: 0x0122, 0x4e7: 0x042e, 0x4e8: 0x016d, 0x4e9: 0x0128, + 0x4ea: 0x0432, 0x4eb: 0x0170, 0x4ec: 0x0131, 0x4ed: 0x012e, 0x4ee: 0x0134, 0x4ef: 0x0137, + 0x4f0: 0x013a, 0x4f1: 0x013d, 0x4f2: 0x0140, 0x4f3: 0x014c, 0x4f4: 0x014f, 0x4f5: 0x00ec, + 0x4f6: 0x0152, 0x4f7: 0x0155, 0x4f8: 0x0422, 0x4f9: 0x0158, 0x4fa: 0x015b, 0x4fb: 0x00b5, + 0x4fc: 0x0161, 0x4fd: 0x0164, 0x4fe: 0x0167, 0x4ff: 0x01d3, + // Block 0x14, offset 0x500 + 0x500: 0x8133, 0x501: 0x8133, 0x502: 0x812e, 0x503: 0x8133, 0x504: 0x8133, 0x505: 0x8133, + 0x506: 0x8133, 0x507: 0x8133, 0x508: 0x8133, 0x509: 0x8133, 0x50a: 0x812e, 0x50b: 0x8133, + 0x50c: 0x8133, 0x50d: 0x8136, 0x50e: 0x812b, 0x50f: 0x812e, 0x510: 0x812a, 0x511: 0x8133, + 0x512: 0x8133, 0x513: 0x8133, 0x514: 0x8133, 0x515: 0x8133, 0x516: 0x8133, 0x517: 0x8133, + 0x518: 0x8133, 0x519: 0x8133, 0x51a: 0x8133, 0x51b: 0x8133, 0x51c: 0x8133, 0x51d: 0x8133, + 0x51e: 0x8133, 0x51f: 0x8133, 0x520: 0x8133, 0x521: 0x8133, 0x522: 0x8133, 0x523: 0x8133, + 0x524: 0x8133, 0x525: 0x8133, 0x526: 0x8133, 0x527: 0x8133, 0x528: 0x8133, 0x529: 0x8133, + 0x52a: 0x8133, 0x52b: 0x8133, 0x52c: 0x8133, 0x52d: 0x8133, 0x52e: 0x8133, 0x52f: 0x8133, + 0x530: 0x8133, 0x531: 0x8133, 0x532: 0x8133, 0x533: 0x8133, 0x534: 0x8133, 0x535: 0x8133, + 0x536: 0x8134, 0x537: 0x8132, 0x538: 0x8132, 0x539: 0x812e, 0x53b: 0x8133, + 0x53c: 0x8135, 0x53d: 0x812e, 0x53e: 0x8133, 0x53f: 0x812e, + // Block 0x15, offset 0x540 + 0x540: 0x2fae, 0x541: 0x32ba, 0x542: 0x2fb8, 0x543: 0x32c4, 0x544: 0x2fbd, 0x545: 0x32c9, + 0x546: 0x2fc2, 0x547: 0x32ce, 0x548: 0x38e3, 0x549: 0x3a72, 0x54a: 0x2fdb, 0x54b: 0x32e7, + 0x54c: 0x2fe5, 0x54d: 0x32f1, 0x54e: 0x2ff4, 0x54f: 0x3300, 0x550: 0x2fea, 0x551: 0x32f6, + 0x552: 0x2fef, 0x553: 0x32fb, 0x554: 0x3906, 0x555: 0x3a95, 0x556: 0x390d, 0x557: 0x3a9c, + 0x558: 0x3030, 0x559: 0x333c, 0x55a: 0x3035, 0x55b: 0x3341, 0x55c: 0x391b, 0x55d: 0x3aaa, + 0x55e: 0x303a, 0x55f: 0x3346, 0x560: 0x3049, 0x561: 0x3355, 0x562: 0x3067, 0x563: 0x3373, + 0x564: 0x3076, 0x565: 0x3382, 0x566: 0x306c, 0x567: 0x3378, 0x568: 0x307b, 0x569: 0x3387, + 0x56a: 0x3080, 0x56b: 0x338c, 0x56c: 0x30c6, 0x56d: 0x33d2, 0x56e: 0x3922, 0x56f: 0x3ab1, + 0x570: 0x30d0, 0x571: 0x33e1, 0x572: 0x30da, 0x573: 0x33eb, 0x574: 0x30e4, 0x575: 0x33f5, + 0x576: 0x46db, 0x577: 0x476c, 0x578: 0x3929, 0x579: 0x3ab8, 0x57a: 0x30fd, 0x57b: 0x340e, + 0x57c: 0x30f8, 0x57d: 0x3409, 0x57e: 0x3102, 0x57f: 0x3413, + // Block 0x16, offset 0x580 + 0x580: 0x3107, 0x581: 0x3418, 0x582: 0x310c, 0x583: 0x341d, 0x584: 0x3120, 0x585: 0x3431, + 0x586: 0x312a, 0x587: 0x343b, 0x588: 0x3139, 0x589: 0x344a, 0x58a: 0x3134, 0x58b: 0x3445, + 0x58c: 0x394c, 0x58d: 0x3adb, 0x58e: 0x395a, 0x58f: 0x3ae9, 0x590: 0x3961, 0x591: 0x3af0, + 0x592: 0x3968, 0x593: 0x3af7, 0x594: 0x3166, 0x595: 0x3477, 0x596: 0x316b, 0x597: 0x347c, + 0x598: 0x3175, 0x599: 0x3486, 0x59a: 0x4708, 0x59b: 0x4799, 0x59c: 0x39ae, 0x59d: 0x3b3d, + 0x59e: 0x318e, 0x59f: 0x349f, 0x5a0: 0x3198, 0x5a1: 0x34a9, 0x5a2: 0x4717, 0x5a3: 0x47a8, + 0x5a4: 0x39b5, 0x5a5: 0x3b44, 0x5a6: 0x39bc, 0x5a7: 0x3b4b, 0x5a8: 0x39c3, 0x5a9: 0x3b52, + 0x5aa: 0x31a7, 0x5ab: 0x34b8, 0x5ac: 0x31b1, 0x5ad: 0x34c7, 0x5ae: 0x31c5, 0x5af: 0x34db, + 0x5b0: 0x31c0, 0x5b1: 0x34d6, 0x5b2: 0x3201, 0x5b3: 0x3517, 0x5b4: 0x3210, 0x5b5: 0x3526, + 0x5b6: 0x320b, 0x5b7: 0x3521, 0x5b8: 0x39ca, 0x5b9: 0x3b59, 0x5ba: 0x39d1, 0x5bb: 0x3b60, + 0x5bc: 0x3215, 0x5bd: 0x352b, 0x5be: 0x321a, 0x5bf: 0x3530, + // Block 0x17, offset 0x5c0 + 0x5c0: 0x321f, 0x5c1: 0x3535, 0x5c2: 0x3224, 0x5c3: 0x353a, 0x5c4: 0x3233, 0x5c5: 0x3549, + 0x5c6: 0x322e, 0x5c7: 0x3544, 0x5c8: 0x3238, 0x5c9: 0x3553, 0x5ca: 0x323d, 0x5cb: 0x3558, + 0x5cc: 0x3242, 0x5cd: 0x355d, 0x5ce: 0x3260, 0x5cf: 0x357b, 0x5d0: 0x3279, 0x5d1: 0x3599, + 0x5d2: 0x3288, 0x5d3: 0x35a8, 0x5d4: 0x328d, 0x5d5: 0x35ad, 0x5d6: 0x3391, 0x5d7: 0x34bd, + 0x5d8: 0x354e, 0x5d9: 0x358a, 0x5da: 0x1be6, 0x5db: 0x42ee, + 0x5e0: 0x46b8, 0x5e1: 0x4749, 0x5e2: 0x2f9a, 0x5e3: 0x32a6, + 0x5e4: 0x388f, 0x5e5: 0x3a1e, 0x5e6: 0x3888, 0x5e7: 0x3a17, 0x5e8: 0x389d, 0x5e9: 0x3a2c, + 0x5ea: 0x3896, 0x5eb: 0x3a25, 0x5ec: 0x38d5, 0x5ed: 0x3a64, 0x5ee: 0x38ab, 0x5ef: 0x3a3a, + 0x5f0: 0x38a4, 0x5f1: 0x3a33, 0x5f2: 0x38b9, 0x5f3: 0x3a48, 0x5f4: 0x38b2, 0x5f5: 0x3a41, + 0x5f6: 0x38dc, 0x5f7: 0x3a6b, 0x5f8: 0x46cc, 0x5f9: 0x475d, 0x5fa: 0x3017, 0x5fb: 0x3323, + 0x5fc: 0x3003, 0x5fd: 0x330f, 0x5fe: 0x38f1, 0x5ff: 0x3a80, + // Block 0x18, offset 0x600 + 0x600: 0x38ea, 0x601: 0x3a79, 0x602: 0x38ff, 0x603: 0x3a8e, 0x604: 0x38f8, 0x605: 0x3a87, + 0x606: 0x3914, 0x607: 0x3aa3, 0x608: 0x30a8, 0x609: 0x33b4, 0x60a: 0x30bc, 0x60b: 0x33c8, + 0x60c: 0x46fe, 0x60d: 0x478f, 0x60e: 0x314d, 0x60f: 0x345e, 0x610: 0x3937, 0x611: 0x3ac6, + 0x612: 0x3930, 0x613: 0x3abf, 0x614: 0x3945, 0x615: 0x3ad4, 0x616: 0x393e, 0x617: 0x3acd, + 0x618: 0x39a0, 0x619: 0x3b2f, 0x61a: 0x3984, 0x61b: 0x3b13, 0x61c: 0x397d, 0x61d: 0x3b0c, + 0x61e: 0x3992, 0x61f: 0x3b21, 0x620: 0x398b, 0x621: 0x3b1a, 0x622: 0x3999, 0x623: 0x3b28, + 0x624: 0x31fc, 0x625: 0x3512, 0x626: 0x31de, 0x627: 0x34f4, 0x628: 0x39fb, 0x629: 0x3b8a, + 0x62a: 0x39f4, 0x62b: 0x3b83, 0x62c: 0x3a09, 0x62d: 0x3b98, 0x62e: 0x3a02, 0x62f: 0x3b91, + 0x630: 0x3a10, 0x631: 0x3b9f, 0x632: 0x3247, 0x633: 0x3562, 0x634: 0x326f, 0x635: 0x358f, + 0x636: 0x326a, 0x637: 0x3585, 0x638: 0x3256, 0x639: 0x3571, + // Block 0x19, offset 0x640 + 0x640: 0x481b, 0x641: 0x4821, 0x642: 0x4935, 0x643: 0x494d, 0x644: 0x493d, 0x645: 0x4955, + 0x646: 0x4945, 0x647: 0x495d, 0x648: 0x47c1, 0x649: 0x47c7, 0x64a: 0x48a5, 0x64b: 0x48bd, + 0x64c: 0x48ad, 0x64d: 0x48c5, 0x64e: 0x48b5, 0x64f: 0x48cd, 0x650: 0x482d, 0x651: 0x4833, + 0x652: 0x3dcf, 0x653: 0x3ddf, 0x654: 0x3dd7, 0x655: 0x3de7, + 0x658: 0x47cd, 0x659: 0x47d3, 0x65a: 0x3cff, 0x65b: 0x3d0f, 0x65c: 0x3d07, 0x65d: 0x3d17, + 0x660: 0x4845, 0x661: 0x484b, 0x662: 0x4965, 0x663: 0x497d, + 0x664: 0x496d, 0x665: 0x4985, 0x666: 0x4975, 0x667: 0x498d, 0x668: 0x47d9, 0x669: 0x47df, + 0x66a: 0x48d5, 0x66b: 0x48ed, 0x66c: 0x48dd, 0x66d: 0x48f5, 0x66e: 0x48e5, 0x66f: 0x48fd, + 0x670: 0x485d, 0x671: 0x4863, 0x672: 0x3e2f, 0x673: 0x3e47, 0x674: 0x3e37, 0x675: 0x3e4f, + 0x676: 0x3e3f, 0x677: 0x3e57, 0x678: 0x47e5, 0x679: 0x47eb, 0x67a: 0x3d2f, 0x67b: 0x3d47, + 0x67c: 0x3d37, 0x67d: 0x3d4f, 0x67e: 0x3d3f, 0x67f: 0x3d57, + // Block 0x1a, offset 0x680 + 0x680: 0x4869, 0x681: 0x486f, 0x682: 0x3e5f, 0x683: 0x3e6f, 0x684: 0x3e67, 0x685: 0x3e77, + 0x688: 0x47f1, 0x689: 0x47f7, 0x68a: 0x3d5f, 0x68b: 0x3d6f, + 0x68c: 0x3d67, 0x68d: 0x3d77, 0x690: 0x487b, 0x691: 0x4881, + 0x692: 0x3e97, 0x693: 0x3eaf, 0x694: 0x3e9f, 0x695: 0x3eb7, 0x696: 0x3ea7, 0x697: 0x3ebf, + 0x699: 0x47fd, 0x69b: 0x3d7f, 0x69d: 0x3d87, + 0x69f: 0x3d8f, 0x6a0: 0x4893, 0x6a1: 0x4899, 0x6a2: 0x4995, 0x6a3: 0x49ad, + 0x6a4: 0x499d, 0x6a5: 0x49b5, 0x6a6: 0x49a5, 0x6a7: 0x49bd, 0x6a8: 0x4803, 0x6a9: 0x4809, + 0x6aa: 0x4905, 0x6ab: 0x491d, 0x6ac: 0x490d, 0x6ad: 0x4925, 0x6ae: 0x4915, 0x6af: 0x492d, + 0x6b0: 0x480f, 0x6b1: 0x4335, 0x6b2: 0x36a8, 0x6b3: 0x433b, 0x6b4: 0x4839, 0x6b5: 0x4341, + 0x6b6: 0x36ba, 0x6b7: 0x4347, 0x6b8: 0x36d8, 0x6b9: 0x434d, 0x6ba: 0x36f0, 0x6bb: 0x4353, + 0x6bc: 0x4887, 0x6bd: 0x4359, + // Block 0x1b, offset 0x6c0 + 0x6c0: 0x3db7, 0x6c1: 0x3dbf, 0x6c2: 0x419b, 0x6c3: 0x41b9, 0x6c4: 0x41a5, 0x6c5: 0x41c3, + 0x6c6: 0x41af, 0x6c7: 0x41cd, 0x6c8: 0x3cef, 0x6c9: 0x3cf7, 0x6ca: 0x40e7, 0x6cb: 0x4105, + 0x6cc: 0x40f1, 0x6cd: 0x410f, 0x6ce: 0x40fb, 0x6cf: 0x4119, 0x6d0: 0x3dff, 0x6d1: 0x3e07, + 0x6d2: 0x41d7, 0x6d3: 0x41f5, 0x6d4: 0x41e1, 0x6d5: 0x41ff, 0x6d6: 0x41eb, 0x6d7: 0x4209, + 0x6d8: 0x3d1f, 0x6d9: 0x3d27, 0x6da: 0x4123, 0x6db: 0x4141, 0x6dc: 0x412d, 0x6dd: 0x414b, + 0x6de: 0x4137, 0x6df: 0x4155, 0x6e0: 0x3ed7, 0x6e1: 0x3edf, 0x6e2: 0x4213, 0x6e3: 0x4231, + 0x6e4: 0x421d, 0x6e5: 0x423b, 0x6e6: 0x4227, 0x6e7: 0x4245, 0x6e8: 0x3d97, 0x6e9: 0x3d9f, + 0x6ea: 0x415f, 0x6eb: 0x417d, 0x6ec: 0x4169, 0x6ed: 0x4187, 0x6ee: 0x4173, 0x6ef: 0x4191, + 0x6f0: 0x369c, 0x6f1: 0x3696, 0x6f2: 0x3da7, 0x6f3: 0x36a2, 0x6f4: 0x3daf, + 0x6f6: 0x4827, 0x6f7: 0x3dc7, 0x6f8: 0x360c, 0x6f9: 0x3606, 0x6fa: 0x35fa, 0x6fb: 0x4305, + 0x6fc: 0x3612, 0x6fd: 0x429e, 0x6fe: 0x01d6, 0x6ff: 0x429e, + // Block 0x1c, offset 0x700 + 0x700: 0x42b7, 0x701: 0x4499, 0x702: 0x3def, 0x703: 0x36b4, 0x704: 0x3df7, + 0x706: 0x4851, 0x707: 0x3e0f, 0x708: 0x3618, 0x709: 0x430b, 0x70a: 0x3624, 0x70b: 0x4311, + 0x70c: 0x3630, 0x70d: 0x44a0, 0x70e: 0x44a7, 0x70f: 0x44ae, 0x710: 0x36cc, 0x711: 0x36c6, + 0x712: 0x3e17, 0x713: 0x44fb, 0x716: 0x36d2, 0x717: 0x3e27, + 0x718: 0x3648, 0x719: 0x3642, 0x71a: 0x3636, 0x71b: 0x4317, 0x71d: 0x44b5, + 0x71e: 0x44bc, 0x71f: 0x44c3, 0x720: 0x3702, 0x721: 0x36fc, 0x722: 0x3e7f, 0x723: 0x4503, + 0x724: 0x36e4, 0x725: 0x36ea, 0x726: 0x3708, 0x727: 0x3e8f, 0x728: 0x3678, 0x729: 0x3672, + 0x72a: 0x3666, 0x72b: 0x4323, 0x72c: 0x3660, 0x72d: 0x448b, 0x72e: 0x4492, 0x72f: 0x0081, + 0x732: 0x3ec7, 0x733: 0x370e, 0x734: 0x3ecf, + 0x736: 0x489f, 0x737: 0x3ee7, 0x738: 0x3654, 0x739: 0x431d, 0x73a: 0x3684, 0x73b: 0x432f, + 0x73c: 0x3690, 0x73d: 0x4271, 0x73e: 0x42a3, + // Block 0x1d, offset 0x740 + 0x740: 0x1bde, 0x741: 0x1be2, 0x742: 0x0047, 0x743: 0x1c5a, 0x745: 0x1bee, + 0x746: 0x1bf2, 0x747: 0x00e9, 0x749: 0x1c5e, 0x74a: 0x008f, 0x74b: 0x0051, + 0x74c: 0x0051, 0x74d: 0x0051, 0x74e: 0x0091, 0x74f: 0x00da, 0x750: 0x0053, 0x751: 0x0053, + 0x752: 0x0059, 0x753: 0x0099, 0x755: 0x005d, 0x756: 0x1993, + 0x759: 0x0061, 0x75a: 0x0063, 0x75b: 0x0065, 0x75c: 0x0065, 0x75d: 0x0065, + 0x760: 0x19a5, 0x761: 0x1bce, 0x762: 0x19ae, + 0x764: 0x0075, 0x766: 0x01bb, 0x768: 0x0075, + 0x76a: 0x0057, 0x76b: 0x42e9, 0x76c: 0x0045, 0x76d: 0x0047, 0x76f: 0x008b, + 0x770: 0x004b, 0x771: 0x004d, 0x773: 0x005b, 0x774: 0x009f, 0x775: 0x0218, + 0x776: 0x021b, 0x777: 0x021e, 0x778: 0x0221, 0x779: 0x0093, 0x77b: 0x1b9e, + 0x77c: 0x01eb, 0x77d: 0x01c4, 0x77e: 0x017c, 0x77f: 0x01a3, + // Block 0x1e, offset 0x780 + 0x780: 0x0466, 0x785: 0x0049, + 0x786: 0x0089, 0x787: 0x008b, 0x788: 0x0093, 0x789: 0x0095, + 0x790: 0x2234, 0x791: 0x2240, + 0x792: 0x22f4, 0x793: 0x221c, 0x794: 0x22a0, 0x795: 0x2228, 0x796: 0x22a6, 0x797: 0x22be, + 0x798: 0x22ca, 0x799: 0x222e, 0x79a: 0x22d0, 0x79b: 0x223a, 0x79c: 0x22c4, 0x79d: 0x22d6, + 0x79e: 0x22dc, 0x79f: 0x1cc2, 0x7a0: 0x0053, 0x7a1: 0x195d, 0x7a2: 0x1baa, 0x7a3: 0x1966, + 0x7a4: 0x006d, 0x7a5: 0x19b1, 0x7a6: 0x1bd6, 0x7a7: 0x1d4e, 0x7a8: 0x1969, 0x7a9: 0x0071, + 0x7aa: 0x19bd, 0x7ab: 0x1bda, 0x7ac: 0x0059, 0x7ad: 0x0047, 0x7ae: 0x0049, 0x7af: 0x005b, + 0x7b0: 0x0093, 0x7b1: 0x19ea, 0x7b2: 0x1c1e, 0x7b3: 0x19f3, 0x7b4: 0x00ad, 0x7b5: 0x1a68, + 0x7b6: 0x1c52, 0x7b7: 0x1d62, 0x7b8: 0x19f6, 0x7b9: 0x00b1, 0x7ba: 0x1a6b, 0x7bb: 0x1c56, + 0x7bc: 0x0099, 0x7bd: 0x0087, 0x7be: 0x0089, 0x7bf: 0x009b, + // Block 0x1f, offset 0x7c0 + 0x7c1: 0x3c1d, 0x7c3: 0xa000, 0x7c4: 0x3c24, 0x7c5: 0xa000, + 0x7c7: 0x3c2b, 0x7c8: 0xa000, 0x7c9: 0x3c32, + 0x7cd: 0xa000, + 0x7e0: 0x2f7c, 0x7e1: 0xa000, 0x7e2: 0x3c40, + 0x7e4: 0xa000, 0x7e5: 0xa000, + 0x7ed: 0x3c39, 0x7ee: 0x2f77, 0x7ef: 0x2f81, + 0x7f0: 0x3c47, 0x7f1: 0x3c4e, 0x7f2: 0xa000, 0x7f3: 0xa000, 0x7f4: 0x3c55, 0x7f5: 0x3c5c, + 0x7f6: 0xa000, 0x7f7: 0xa000, 0x7f8: 0x3c63, 0x7f9: 0x3c6a, 0x7fa: 0xa000, 0x7fb: 0xa000, + 0x7fc: 0xa000, 0x7fd: 0xa000, + // Block 0x20, offset 0x800 + 0x800: 0x3c71, 0x801: 0x3c78, 0x802: 0xa000, 0x803: 0xa000, 0x804: 0x3c8d, 0x805: 0x3c94, + 0x806: 0xa000, 0x807: 0xa000, 0x808: 0x3c9b, 0x809: 0x3ca2, + 0x811: 0xa000, + 0x812: 0xa000, + 0x822: 0xa000, + 0x828: 0xa000, 0x829: 0xa000, + 0x82b: 0xa000, 0x82c: 0x3cb7, 0x82d: 0x3cbe, 0x82e: 0x3cc5, 0x82f: 0x3ccc, + 0x832: 0xa000, 0x833: 0xa000, 0x834: 0xa000, 0x835: 0xa000, + // Block 0x21, offset 0x840 + 0x860: 0x0023, 0x861: 0x0025, 0x862: 0x0027, 0x863: 0x0029, + 0x864: 0x002b, 0x865: 0x002d, 0x866: 0x002f, 0x867: 0x0031, 0x868: 0x0033, 0x869: 0x1885, + 0x86a: 0x1888, 0x86b: 0x188b, 0x86c: 0x188e, 0x86d: 0x1891, 0x86e: 0x1894, 0x86f: 0x1897, + 0x870: 0x189a, 0x871: 0x189d, 0x872: 0x18a0, 0x873: 0x18a9, 0x874: 0x1a6e, 0x875: 0x1a72, + 0x876: 0x1a76, 0x877: 0x1a7a, 0x878: 0x1a7e, 0x879: 0x1a82, 0x87a: 0x1a86, 0x87b: 0x1a8a, + 0x87c: 0x1a8e, 0x87d: 0x1c86, 0x87e: 0x1c8b, 0x87f: 0x1c90, + // Block 0x22, offset 0x880 + 0x880: 0x1c95, 0x881: 0x1c9a, 0x882: 0x1c9f, 0x883: 0x1ca4, 0x884: 0x1ca9, 0x885: 0x1cae, + 0x886: 0x1cb3, 0x887: 0x1cb8, 0x888: 0x1882, 0x889: 0x18a6, 0x88a: 0x18ca, 0x88b: 0x18ee, + 0x88c: 0x1912, 0x88d: 0x191b, 0x88e: 0x1921, 0x88f: 0x1927, 0x890: 0x192d, 0x891: 0x1b66, + 0x892: 0x1b6a, 0x893: 0x1b6e, 0x894: 0x1b72, 0x895: 0x1b76, 0x896: 0x1b7a, 0x897: 0x1b7e, + 0x898: 0x1b82, 0x899: 0x1b86, 0x89a: 0x1b8a, 0x89b: 0x1b8e, 0x89c: 0x1afa, 0x89d: 0x1afe, + 0x89e: 0x1b02, 0x89f: 0x1b06, 0x8a0: 0x1b0a, 0x8a1: 0x1b0e, 0x8a2: 0x1b12, 0x8a3: 0x1b16, + 0x8a4: 0x1b1a, 0x8a5: 0x1b1e, 0x8a6: 0x1b22, 0x8a7: 0x1b26, 0x8a8: 0x1b2a, 0x8a9: 0x1b2e, + 0x8aa: 0x1b32, 0x8ab: 0x1b36, 0x8ac: 0x1b3a, 0x8ad: 0x1b3e, 0x8ae: 0x1b42, 0x8af: 0x1b46, + 0x8b0: 0x1b4a, 0x8b1: 0x1b4e, 0x8b2: 0x1b52, 0x8b3: 0x1b56, 0x8b4: 0x1b5a, 0x8b5: 0x1b5e, + 0x8b6: 0x0043, 0x8b7: 0x0045, 0x8b8: 0x0047, 0x8b9: 0x0049, 0x8ba: 0x004b, 0x8bb: 0x004d, + 0x8bc: 0x004f, 0x8bd: 0x0051, 0x8be: 0x0053, 0x8bf: 0x0055, + // Block 0x23, offset 0x8c0 + 0x8c0: 0x06c2, 0x8c1: 0x06e6, 0x8c2: 0x06f2, 0x8c3: 0x0702, 0x8c4: 0x070a, 0x8c5: 0x0716, + 0x8c6: 0x071e, 0x8c7: 0x0726, 0x8c8: 0x0732, 0x8c9: 0x0786, 0x8ca: 0x079e, 0x8cb: 0x07ae, + 0x8cc: 0x07be, 0x8cd: 0x07ce, 0x8ce: 0x07de, 0x8cf: 0x07fe, 0x8d0: 0x0802, 0x8d1: 0x0806, + 0x8d2: 0x083a, 0x8d3: 0x0862, 0x8d4: 0x0872, 0x8d5: 0x087a, 0x8d6: 0x087e, 0x8d7: 0x088a, + 0x8d8: 0x08a6, 0x8d9: 0x08aa, 0x8da: 0x08c2, 0x8db: 0x08c6, 0x8dc: 0x08ce, 0x8dd: 0x08de, + 0x8de: 0x097a, 0x8df: 0x098e, 0x8e0: 0x09ce, 0x8e1: 0x09e2, 0x8e2: 0x09ea, 0x8e3: 0x09ee, + 0x8e4: 0x09fe, 0x8e5: 0x0a1a, 0x8e6: 0x0a46, 0x8e7: 0x0a52, 0x8e8: 0x0a72, 0x8e9: 0x0a7e, + 0x8ea: 0x0a82, 0x8eb: 0x0a86, 0x8ec: 0x0a9e, 0x8ed: 0x0aa2, 0x8ee: 0x0ace, 0x8ef: 0x0ada, + 0x8f0: 0x0ae2, 0x8f1: 0x0aea, 0x8f2: 0x0afa, 0x8f3: 0x0b02, 0x8f4: 0x0b0a, 0x8f5: 0x0b36, + 0x8f6: 0x0b3a, 0x8f7: 0x0b42, 0x8f8: 0x0b46, 0x8f9: 0x0b4e, 0x8fa: 0x0b56, 0x8fb: 0x0b66, + 0x8fc: 0x0b82, 0x8fd: 0x0bfa, 0x8fe: 0x0c0e, 0x8ff: 0x0c12, + // Block 0x24, offset 0x900 + 0x900: 0x0c92, 0x901: 0x0c96, 0x902: 0x0caa, 0x903: 0x0cae, 0x904: 0x0cb6, 0x905: 0x0cbe, + 0x906: 0x0cc6, 0x907: 0x0cd2, 0x908: 0x0cfa, 0x909: 0x0d0a, 0x90a: 0x0d1e, 0x90b: 0x0d8e, + 0x90c: 0x0d9a, 0x90d: 0x0daa, 0x90e: 0x0db6, 0x90f: 0x0dc2, 0x910: 0x0dca, 0x911: 0x0dce, + 0x912: 0x0dd2, 0x913: 0x0dd6, 0x914: 0x0dda, 0x915: 0x0e92, 0x916: 0x0eda, 0x917: 0x0ee6, + 0x918: 0x0eea, 0x919: 0x0eee, 0x91a: 0x0ef2, 0x91b: 0x0efa, 0x91c: 0x0efe, 0x91d: 0x0f12, + 0x91e: 0x0f2e, 0x91f: 0x0f36, 0x920: 0x0f76, 0x921: 0x0f7a, 0x922: 0x0f82, 0x923: 0x0f86, + 0x924: 0x0f8e, 0x925: 0x0f92, 0x926: 0x0fb6, 0x927: 0x0fba, 0x928: 0x0fd6, 0x929: 0x0fda, + 0x92a: 0x0fde, 0x92b: 0x0fe2, 0x92c: 0x0ff6, 0x92d: 0x101a, 0x92e: 0x101e, 0x92f: 0x1022, + 0x930: 0x1046, 0x931: 0x1086, 0x932: 0x108a, 0x933: 0x10aa, 0x934: 0x10ba, 0x935: 0x10c2, + 0x936: 0x10e2, 0x937: 0x1106, 0x938: 0x114a, 0x939: 0x1152, 0x93a: 0x1166, 0x93b: 0x1172, + 0x93c: 0x117a, 0x93d: 0x1182, 0x93e: 0x1186, 0x93f: 0x118a, + // Block 0x25, offset 0x940 + 0x940: 0x11a2, 0x941: 0x11a6, 0x942: 0x11c2, 0x943: 0x11ca, 0x944: 0x11d2, 0x945: 0x11d6, + 0x946: 0x11e2, 0x947: 0x11ea, 0x948: 0x11ee, 0x949: 0x11f2, 0x94a: 0x11fa, 0x94b: 0x11fe, + 0x94c: 0x129e, 0x94d: 0x12b2, 0x94e: 0x12e6, 0x94f: 0x12ea, 0x950: 0x12f2, 0x951: 0x131e, + 0x952: 0x1326, 0x953: 0x132e, 0x954: 0x1336, 0x955: 0x1372, 0x956: 0x1376, 0x957: 0x137e, + 0x958: 0x1382, 0x959: 0x1386, 0x95a: 0x13b2, 0x95b: 0x13b6, 0x95c: 0x13be, 0x95d: 0x13d2, + 0x95e: 0x13d6, 0x95f: 0x13f2, 0x960: 0x13fa, 0x961: 0x13fe, 0x962: 0x1422, 0x963: 0x1442, + 0x964: 0x1456, 0x965: 0x145a, 0x966: 0x1462, 0x967: 0x148e, 0x968: 0x1492, 0x969: 0x14a2, + 0x96a: 0x14c6, 0x96b: 0x14d2, 0x96c: 0x14e2, 0x96d: 0x14fa, 0x96e: 0x1502, 0x96f: 0x1506, + 0x970: 0x150a, 0x971: 0x150e, 0x972: 0x151a, 0x973: 0x151e, 0x974: 0x1526, 0x975: 0x1542, + 0x976: 0x1546, 0x977: 0x154a, 0x978: 0x1562, 0x979: 0x1566, 0x97a: 0x156e, 0x97b: 0x1582, + 0x97c: 0x1586, 0x97d: 0x158a, 0x97e: 0x1592, 0x97f: 0x1596, + // Block 0x26, offset 0x980 + 0x986: 0xa000, 0x98b: 0xa000, + 0x98c: 0x3f1f, 0x98d: 0xa000, 0x98e: 0x3f27, 0x98f: 0xa000, 0x990: 0x3f2f, 0x991: 0xa000, + 0x992: 0x3f37, 0x993: 0xa000, 0x994: 0x3f3f, 0x995: 0xa000, 0x996: 0x3f47, 0x997: 0xa000, + 0x998: 0x3f4f, 0x999: 0xa000, 0x99a: 0x3f57, 0x99b: 0xa000, 0x99c: 0x3f5f, 0x99d: 0xa000, + 0x99e: 0x3f67, 0x99f: 0xa000, 0x9a0: 0x3f6f, 0x9a1: 0xa000, 0x9a2: 0x3f77, + 0x9a4: 0xa000, 0x9a5: 0x3f7f, 0x9a6: 0xa000, 0x9a7: 0x3f87, 0x9a8: 0xa000, 0x9a9: 0x3f8f, + 0x9af: 0xa000, + 0x9b0: 0x3f97, 0x9b1: 0x3f9f, 0x9b2: 0xa000, 0x9b3: 0x3fa7, 0x9b4: 0x3faf, 0x9b5: 0xa000, + 0x9b6: 0x3fb7, 0x9b7: 0x3fbf, 0x9b8: 0xa000, 0x9b9: 0x3fc7, 0x9ba: 0x3fcf, 0x9bb: 0xa000, + 0x9bc: 0x3fd7, 0x9bd: 0x3fdf, + // Block 0x27, offset 0x9c0 + 0x9d4: 0x3f17, + 0x9d9: 0x9904, 0x9da: 0x9904, 0x9db: 0x42f3, 0x9dc: 0x42f9, 0x9dd: 0xa000, + 0x9de: 0x3fe7, 0x9df: 0x26ba, + 0x9e6: 0xa000, + 0x9eb: 0xa000, 0x9ec: 0x3ff7, 0x9ed: 0xa000, 0x9ee: 0x3fff, 0x9ef: 0xa000, + 0x9f0: 0x4007, 0x9f1: 0xa000, 0x9f2: 0x400f, 0x9f3: 0xa000, 0x9f4: 0x4017, 0x9f5: 0xa000, + 0x9f6: 0x401f, 0x9f7: 0xa000, 0x9f8: 0x4027, 0x9f9: 0xa000, 0x9fa: 0x402f, 0x9fb: 0xa000, + 0x9fc: 0x4037, 0x9fd: 0xa000, 0x9fe: 0x403f, 0x9ff: 0xa000, + // Block 0x28, offset 0xa00 + 0xa00: 0x4047, 0xa01: 0xa000, 0xa02: 0x404f, 0xa04: 0xa000, 0xa05: 0x4057, + 0xa06: 0xa000, 0xa07: 0x405f, 0xa08: 0xa000, 0xa09: 0x4067, + 0xa0f: 0xa000, 0xa10: 0x406f, 0xa11: 0x4077, + 0xa12: 0xa000, 0xa13: 0x407f, 0xa14: 0x4087, 0xa15: 0xa000, 0xa16: 0x408f, 0xa17: 0x4097, + 0xa18: 0xa000, 0xa19: 0x409f, 0xa1a: 0x40a7, 0xa1b: 0xa000, 0xa1c: 0x40af, 0xa1d: 0x40b7, + 0xa2f: 0xa000, + 0xa30: 0xa000, 0xa31: 0xa000, 0xa32: 0xa000, 0xa34: 0x3fef, + 0xa37: 0x40bf, 0xa38: 0x40c7, 0xa39: 0x40cf, 0xa3a: 0x40d7, + 0xa3d: 0xa000, 0xa3e: 0x40df, 0xa3f: 0x26cf, + // Block 0x29, offset 0xa40 + 0xa40: 0x036a, 0xa41: 0x032e, 0xa42: 0x0332, 0xa43: 0x0336, 0xa44: 0x037e, 0xa45: 0x033a, + 0xa46: 0x033e, 0xa47: 0x0342, 0xa48: 0x0346, 0xa49: 0x034a, 0xa4a: 0x034e, 0xa4b: 0x0352, + 0xa4c: 0x0356, 0xa4d: 0x035a, 0xa4e: 0x035e, 0xa4f: 0x49d4, 0xa50: 0x49da, 0xa51: 0x49e0, + 0xa52: 0x49e6, 0xa53: 0x49ec, 0xa54: 0x49f2, 0xa55: 0x49f8, 0xa56: 0x49fe, 0xa57: 0x4a04, + 0xa58: 0x4a0a, 0xa59: 0x4a10, 0xa5a: 0x4a16, 0xa5b: 0x4a1c, 0xa5c: 0x4a22, 0xa5d: 0x4a28, + 0xa5e: 0x4a2e, 0xa5f: 0x4a34, 0xa60: 0x4a3a, 0xa61: 0x4a40, 0xa62: 0x4a46, 0xa63: 0x4a4c, + 0xa64: 0x03c6, 0xa65: 0x0362, 0xa66: 0x0366, 0xa67: 0x03ea, 0xa68: 0x03ee, 0xa69: 0x03f2, + 0xa6a: 0x03f6, 0xa6b: 0x03fa, 0xa6c: 0x03fe, 0xa6d: 0x0402, 0xa6e: 0x036e, 0xa6f: 0x0406, + 0xa70: 0x040a, 0xa71: 0x0372, 0xa72: 0x0376, 0xa73: 0x037a, 0xa74: 0x0382, 0xa75: 0x0386, + 0xa76: 0x038a, 0xa77: 0x038e, 0xa78: 0x0392, 0xa79: 0x0396, 0xa7a: 0x039a, 0xa7b: 0x039e, + 0xa7c: 0x03a2, 0xa7d: 0x03a6, 0xa7e: 0x03aa, 0xa7f: 0x03ae, + // Block 0x2a, offset 0xa80 + 0xa80: 0x03b2, 0xa81: 0x03b6, 0xa82: 0x040e, 0xa83: 0x0412, 0xa84: 0x03ba, 0xa85: 0x03be, + 0xa86: 0x03c2, 0xa87: 0x03ca, 0xa88: 0x03ce, 0xa89: 0x03d2, 0xa8a: 0x03d6, 0xa8b: 0x03da, + 0xa8c: 0x03de, 0xa8d: 0x03e2, 0xa8e: 0x03e6, + 0xa92: 0x06c2, 0xa93: 0x071e, 0xa94: 0x06ce, 0xa95: 0x097e, 0xa96: 0x06d2, 0xa97: 0x06ea, + 0xa98: 0x06d6, 0xa99: 0x0f96, 0xa9a: 0x070a, 0xa9b: 0x06de, 0xa9c: 0x06c6, 0xa9d: 0x0a02, + 0xa9e: 0x0992, 0xa9f: 0x0732, + // Block 0x2b, offset 0xac0 + 0xac0: 0x205a, 0xac1: 0x2060, 0xac2: 0x2066, 0xac3: 0x206c, 0xac4: 0x2072, 0xac5: 0x2078, + 0xac6: 0x207e, 0xac7: 0x2084, 0xac8: 0x208a, 0xac9: 0x2090, 0xaca: 0x2096, 0xacb: 0x209c, + 0xacc: 0x20a2, 0xacd: 0x20a8, 0xace: 0x2733, 0xacf: 0x273c, 0xad0: 0x2745, 0xad1: 0x274e, + 0xad2: 0x2757, 0xad3: 0x2760, 0xad4: 0x2769, 0xad5: 0x2772, 0xad6: 0x277b, 0xad7: 0x278d, + 0xad8: 0x2796, 0xad9: 0x279f, 0xada: 0x27a8, 0xadb: 0x27b1, 0xadc: 0x2784, 0xadd: 0x2bb9, + 0xade: 0x2afa, 0xae0: 0x20ae, 0xae1: 0x20c6, 0xae2: 0x20ba, 0xae3: 0x210e, + 0xae4: 0x20cc, 0xae5: 0x20ea, 0xae6: 0x20b4, 0xae7: 0x20e4, 0xae8: 0x20c0, 0xae9: 0x20f6, + 0xaea: 0x2126, 0xaeb: 0x2144, 0xaec: 0x213e, 0xaed: 0x2132, 0xaee: 0x2180, 0xaef: 0x2114, + 0xaf0: 0x2120, 0xaf1: 0x2138, 0xaf2: 0x212c, 0xaf3: 0x2156, 0xaf4: 0x2102, 0xaf5: 0x214a, + 0xaf6: 0x2174, 0xaf7: 0x215c, 0xaf8: 0x20f0, 0xaf9: 0x20d2, 0xafa: 0x2108, 0xafb: 0x211a, + 0xafc: 0x2150, 0xafd: 0x20d8, 0xafe: 0x217a, 0xaff: 0x20fc, + // Block 0x2c, offset 0xb00 + 0xb00: 0x2162, 0xb01: 0x20de, 0xb02: 0x2168, 0xb03: 0x216e, 0xb04: 0x0932, 0xb05: 0x0b06, + 0xb06: 0x0caa, 0xb07: 0x10ca, + 0xb10: 0x1bca, 0xb11: 0x18ac, + 0xb12: 0x18af, 0xb13: 0x18b2, 0xb14: 0x18b5, 0xb15: 0x18b8, 0xb16: 0x18bb, 0xb17: 0x18be, + 0xb18: 0x18c1, 0xb19: 0x18c4, 0xb1a: 0x18cd, 0xb1b: 0x18d0, 0xb1c: 0x18d3, 0xb1d: 0x18d6, + 0xb1e: 0x18d9, 0xb1f: 0x18dc, 0xb20: 0x0316, 0xb21: 0x031e, 0xb22: 0x0322, 0xb23: 0x032a, + 0xb24: 0x032e, 0xb25: 0x0332, 0xb26: 0x033a, 0xb27: 0x0342, 0xb28: 0x0346, 0xb29: 0x034e, + 0xb2a: 0x0352, 0xb2b: 0x0356, 0xb2c: 0x035a, 0xb2d: 0x035e, 0xb2e: 0x2e2f, 0xb2f: 0x2e37, + 0xb30: 0x2e3f, 0xb31: 0x2e47, 0xb32: 0x2e4f, 0xb33: 0x2e57, 0xb34: 0x2e5f, 0xb35: 0x2e67, + 0xb36: 0x2e77, 0xb37: 0x2e7f, 0xb38: 0x2e87, 0xb39: 0x2e8f, 0xb3a: 0x2e97, 0xb3b: 0x2e9f, + 0xb3c: 0x2eea, 0xb3d: 0x2eb2, 0xb3e: 0x2e6f, + // Block 0x2d, offset 0xb40 + 0xb40: 0x06c2, 0xb41: 0x071e, 0xb42: 0x06ce, 0xb43: 0x097e, 0xb44: 0x0722, 0xb45: 0x07b2, + 0xb46: 0x06ca, 0xb47: 0x07ae, 0xb48: 0x070e, 0xb49: 0x088a, 0xb4a: 0x0d0a, 0xb4b: 0x0e92, + 0xb4c: 0x0dda, 0xb4d: 0x0d1e, 0xb4e: 0x1462, 0xb4f: 0x098e, 0xb50: 0x0cd2, 0xb51: 0x0d4e, + 0xb52: 0x0d0e, 0xb53: 0x104e, 0xb54: 0x08fe, 0xb55: 0x0f06, 0xb56: 0x138a, 0xb57: 0x1062, + 0xb58: 0x0846, 0xb59: 0x1092, 0xb5a: 0x0f9e, 0xb5b: 0x0a1a, 0xb5c: 0x1412, 0xb5d: 0x0782, + 0xb5e: 0x08ae, 0xb5f: 0x0dfa, 0xb60: 0x152a, 0xb61: 0x0746, 0xb62: 0x07d6, 0xb63: 0x0d9e, + 0xb64: 0x06d2, 0xb65: 0x06ea, 0xb66: 0x06d6, 0xb67: 0x0ade, 0xb68: 0x08f2, 0xb69: 0x0882, + 0xb6a: 0x0a5a, 0xb6b: 0x0a4e, 0xb6c: 0x0fee, 0xb6d: 0x0742, 0xb6e: 0x139e, 0xb6f: 0x089e, + 0xb70: 0x09f6, 0xb71: 0x18df, 0xb72: 0x18e2, 0xb73: 0x18e5, 0xb74: 0x18e8, 0xb75: 0x18f1, + 0xb76: 0x18f4, 0xb77: 0x18f7, 0xb78: 0x18fa, 0xb79: 0x18fd, 0xb7a: 0x1900, 0xb7b: 0x1903, + 0xb7c: 0x1906, 0xb7d: 0x1909, 0xb7e: 0x190c, 0xb7f: 0x1915, + // Block 0x2e, offset 0xb80 + 0xb80: 0x1ccc, 0xb81: 0x1cdb, 0xb82: 0x1cea, 0xb83: 0x1cf9, 0xb84: 0x1d08, 0xb85: 0x1d17, + 0xb86: 0x1d26, 0xb87: 0x1d35, 0xb88: 0x1d44, 0xb89: 0x2192, 0xb8a: 0x21a4, 0xb8b: 0x21b6, + 0xb8c: 0x1957, 0xb8d: 0x1c0a, 0xb8e: 0x19d8, 0xb8f: 0x1bae, 0xb90: 0x04ce, 0xb91: 0x04d6, + 0xb92: 0x04de, 0xb93: 0x04e6, 0xb94: 0x04ee, 0xb95: 0x04f2, 0xb96: 0x04f6, 0xb97: 0x04fa, + 0xb98: 0x04fe, 0xb99: 0x0502, 0xb9a: 0x0506, 0xb9b: 0x050a, 0xb9c: 0x050e, 0xb9d: 0x0512, + 0xb9e: 0x0516, 0xb9f: 0x051a, 0xba0: 0x051e, 0xba1: 0x0526, 0xba2: 0x052a, 0xba3: 0x052e, + 0xba4: 0x0532, 0xba5: 0x0536, 0xba6: 0x053a, 0xba7: 0x053e, 0xba8: 0x0542, 0xba9: 0x0546, + 0xbaa: 0x054a, 0xbab: 0x054e, 0xbac: 0x0552, 0xbad: 0x0556, 0xbae: 0x055a, 0xbaf: 0x055e, + 0xbb0: 0x0562, 0xbb1: 0x0566, 0xbb2: 0x056a, 0xbb3: 0x0572, 0xbb4: 0x057a, 0xbb5: 0x0582, + 0xbb6: 0x0586, 0xbb7: 0x058a, 0xbb8: 0x058e, 0xbb9: 0x0592, 0xbba: 0x0596, 0xbbb: 0x059a, + 0xbbc: 0x059e, 0xbbd: 0x05a2, 0xbbe: 0x05a6, 0xbbf: 0x2700, + // Block 0x2f, offset 0xbc0 + 0xbc0: 0x2b19, 0xbc1: 0x29b5, 0xbc2: 0x2b29, 0xbc3: 0x288d, 0xbc4: 0x2efb, 0xbc5: 0x2897, + 0xbc6: 0x28a1, 0xbc7: 0x2f3f, 0xbc8: 0x29c2, 0xbc9: 0x28ab, 0xbca: 0x28b5, 0xbcb: 0x28bf, + 0xbcc: 0x29e9, 0xbcd: 0x29f6, 0xbce: 0x29cf, 0xbcf: 0x29dc, 0xbd0: 0x2ec0, 0xbd1: 0x2a03, + 0xbd2: 0x2a10, 0xbd3: 0x2bcb, 0xbd4: 0x26c1, 0xbd5: 0x2bde, 0xbd6: 0x2bf1, 0xbd7: 0x2b39, + 0xbd8: 0x2a1d, 0xbd9: 0x2c04, 0xbda: 0x2c17, 0xbdb: 0x2a2a, 0xbdc: 0x28c9, 0xbdd: 0x28d3, + 0xbde: 0x2ece, 0xbdf: 0x2a37, 0xbe0: 0x2b49, 0xbe1: 0x2f0c, 0xbe2: 0x28dd, 0xbe3: 0x28e7, + 0xbe4: 0x2a44, 0xbe5: 0x28f1, 0xbe6: 0x28fb, 0xbe7: 0x26d6, 0xbe8: 0x26dd, 0xbe9: 0x2905, + 0xbea: 0x290f, 0xbeb: 0x2c2a, 0xbec: 0x2a51, 0xbed: 0x2b59, 0xbee: 0x2c3d, 0xbef: 0x2a5e, + 0xbf0: 0x2923, 0xbf1: 0x2919, 0xbf2: 0x2f53, 0xbf3: 0x2a6b, 0xbf4: 0x2c50, 0xbf5: 0x292d, + 0xbf6: 0x2b69, 0xbf7: 0x2937, 0xbf8: 0x2a85, 0xbf9: 0x2941, 0xbfa: 0x2a92, 0xbfb: 0x2f1d, + 0xbfc: 0x2a78, 0xbfd: 0x2b79, 0xbfe: 0x2a9f, 0xbff: 0x26e4, + // Block 0x30, offset 0xc00 + 0xc00: 0x2f2e, 0xc01: 0x294b, 0xc02: 0x2955, 0xc03: 0x2aac, 0xc04: 0x295f, 0xc05: 0x2969, + 0xc06: 0x2973, 0xc07: 0x2b89, 0xc08: 0x2ab9, 0xc09: 0x26eb, 0xc0a: 0x2c63, 0xc0b: 0x2ea7, + 0xc0c: 0x2b99, 0xc0d: 0x2ac6, 0xc0e: 0x2edc, 0xc0f: 0x297d, 0xc10: 0x2987, 0xc11: 0x2ad3, + 0xc12: 0x26f2, 0xc13: 0x2ae0, 0xc14: 0x2ba9, 0xc15: 0x26f9, 0xc16: 0x2c76, 0xc17: 0x2991, + 0xc18: 0x1cbd, 0xc19: 0x1cd1, 0xc1a: 0x1ce0, 0xc1b: 0x1cef, 0xc1c: 0x1cfe, 0xc1d: 0x1d0d, + 0xc1e: 0x1d1c, 0xc1f: 0x1d2b, 0xc20: 0x1d3a, 0xc21: 0x1d49, 0xc22: 0x2198, 0xc23: 0x21aa, + 0xc24: 0x21bc, 0xc25: 0x21c8, 0xc26: 0x21d4, 0xc27: 0x21e0, 0xc28: 0x21ec, 0xc29: 0x21f8, + 0xc2a: 0x2204, 0xc2b: 0x2210, 0xc2c: 0x224c, 0xc2d: 0x2258, 0xc2e: 0x2264, 0xc2f: 0x2270, + 0xc30: 0x227c, 0xc31: 0x1c1a, 0xc32: 0x19cc, 0xc33: 0x1939, 0xc34: 0x1bea, 0xc35: 0x1a4d, + 0xc36: 0x1a5c, 0xc37: 0x19d2, 0xc38: 0x1c02, 0xc39: 0x1c06, 0xc3a: 0x1963, 0xc3b: 0x270e, + 0xc3c: 0x271c, 0xc3d: 0x2707, 0xc3e: 0x2715, 0xc3f: 0x2aed, + // Block 0x31, offset 0xc40 + 0xc40: 0x1a50, 0xc41: 0x1a38, 0xc42: 0x1c66, 0xc43: 0x1a20, 0xc44: 0x19f9, 0xc45: 0x196c, + 0xc46: 0x197b, 0xc47: 0x194b, 0xc48: 0x1bf6, 0xc49: 0x1d58, 0xc4a: 0x1a53, 0xc4b: 0x1a3b, + 0xc4c: 0x1c6a, 0xc4d: 0x1c76, 0xc4e: 0x1a2c, 0xc4f: 0x1a02, 0xc50: 0x195a, 0xc51: 0x1c22, + 0xc52: 0x1bb6, 0xc53: 0x1ba2, 0xc54: 0x1bd2, 0xc55: 0x1c7a, 0xc56: 0x1a2f, 0xc57: 0x19cf, + 0xc58: 0x1a05, 0xc59: 0x19e4, 0xc5a: 0x1a47, 0xc5b: 0x1c7e, 0xc5c: 0x1a32, 0xc5d: 0x19c6, + 0xc5e: 0x1a08, 0xc5f: 0x1c42, 0xc60: 0x1bfa, 0xc61: 0x1a1a, 0xc62: 0x1c2a, 0xc63: 0x1c46, + 0xc64: 0x1bfe, 0xc65: 0x1a1d, 0xc66: 0x1c2e, 0xc67: 0x22ee, 0xc68: 0x2302, 0xc69: 0x199c, + 0xc6a: 0x1c26, 0xc6b: 0x1bba, 0xc6c: 0x1ba6, 0xc6d: 0x1c4e, 0xc6e: 0x2723, 0xc6f: 0x27ba, + 0xc70: 0x1a5f, 0xc71: 0x1a4a, 0xc72: 0x1c82, 0xc73: 0x1a35, 0xc74: 0x1a56, 0xc75: 0x1a3e, + 0xc76: 0x1c6e, 0xc77: 0x1a23, 0xc78: 0x19fc, 0xc79: 0x1987, 0xc7a: 0x1a59, 0xc7b: 0x1a41, + 0xc7c: 0x1c72, 0xc7d: 0x1a26, 0xc7e: 0x19ff, 0xc7f: 0x198a, + // Block 0x32, offset 0xc80 + 0xc80: 0x1c32, 0xc81: 0x1bbe, 0xc82: 0x1d53, 0xc83: 0x193c, 0xc84: 0x19c0, 0xc85: 0x19c3, + 0xc86: 0x22fb, 0xc87: 0x1b9a, 0xc88: 0x19c9, 0xc89: 0x194e, 0xc8a: 0x19e7, 0xc8b: 0x1951, + 0xc8c: 0x19f0, 0xc8d: 0x196f, 0xc8e: 0x1972, 0xc8f: 0x1a0b, 0xc90: 0x1a11, 0xc91: 0x1a14, + 0xc92: 0x1c36, 0xc93: 0x1a17, 0xc94: 0x1a29, 0xc95: 0x1c3e, 0xc96: 0x1c4a, 0xc97: 0x1996, + 0xc98: 0x1d5d, 0xc99: 0x1bc2, 0xc9a: 0x1999, 0xc9b: 0x1a62, 0xc9c: 0x19ab, 0xc9d: 0x19ba, + 0xc9e: 0x22e8, 0xc9f: 0x22e2, 0xca0: 0x1cc7, 0xca1: 0x1cd6, 0xca2: 0x1ce5, 0xca3: 0x1cf4, + 0xca4: 0x1d03, 0xca5: 0x1d12, 0xca6: 0x1d21, 0xca7: 0x1d30, 0xca8: 0x1d3f, 0xca9: 0x218c, + 0xcaa: 0x219e, 0xcab: 0x21b0, 0xcac: 0x21c2, 0xcad: 0x21ce, 0xcae: 0x21da, 0xcaf: 0x21e6, + 0xcb0: 0x21f2, 0xcb1: 0x21fe, 0xcb2: 0x220a, 0xcb3: 0x2246, 0xcb4: 0x2252, 0xcb5: 0x225e, + 0xcb6: 0x226a, 0xcb7: 0x2276, 0xcb8: 0x2282, 0xcb9: 0x2288, 0xcba: 0x228e, 0xcbb: 0x2294, + 0xcbc: 0x229a, 0xcbd: 0x22ac, 0xcbe: 0x22b2, 0xcbf: 0x1c16, + // Block 0x33, offset 0xcc0 + 0xcc0: 0x137a, 0xcc1: 0x0cfe, 0xcc2: 0x13d6, 0xcc3: 0x13a2, 0xcc4: 0x0e5a, 0xcc5: 0x06ee, + 0xcc6: 0x08e2, 0xcc7: 0x162e, 0xcc8: 0x162e, 0xcc9: 0x0a0e, 0xcca: 0x1462, 0xccb: 0x0946, + 0xccc: 0x0a0a, 0xccd: 0x0bf2, 0xcce: 0x0fd2, 0xccf: 0x1162, 0xcd0: 0x129a, 0xcd1: 0x12d6, + 0xcd2: 0x130a, 0xcd3: 0x141e, 0xcd4: 0x0d76, 0xcd5: 0x0e02, 0xcd6: 0x0eae, 0xcd7: 0x0f46, + 0xcd8: 0x1262, 0xcd9: 0x144a, 0xcda: 0x1576, 0xcdb: 0x0712, 0xcdc: 0x08b6, 0xcdd: 0x0d8a, + 0xcde: 0x0ed2, 0xcdf: 0x1296, 0xce0: 0x15c6, 0xce1: 0x0ab6, 0xce2: 0x0e7a, 0xce3: 0x1286, + 0xce4: 0x131a, 0xce5: 0x0c26, 0xce6: 0x11be, 0xce7: 0x12e2, 0xce8: 0x0b22, 0xce9: 0x0d12, + 0xcea: 0x0e1a, 0xceb: 0x0f1e, 0xcec: 0x142a, 0xced: 0x0752, 0xcee: 0x07ea, 0xcef: 0x0856, + 0xcf0: 0x0c8e, 0xcf1: 0x0d82, 0xcf2: 0x0ece, 0xcf3: 0x0ff2, 0xcf4: 0x117a, 0xcf5: 0x128e, + 0xcf6: 0x12a6, 0xcf7: 0x13ca, 0xcf8: 0x14f2, 0xcf9: 0x15a6, 0xcfa: 0x15c2, 0xcfb: 0x102e, + 0xcfc: 0x106e, 0xcfd: 0x1126, 0xcfe: 0x1246, 0xcff: 0x147e, + // Block 0x34, offset 0xd00 + 0xd00: 0x15ce, 0xd01: 0x134e, 0xd02: 0x09ca, 0xd03: 0x0b3e, 0xd04: 0x10de, 0xd05: 0x119e, + 0xd06: 0x0f02, 0xd07: 0x1036, 0xd08: 0x139a, 0xd09: 0x14ea, 0xd0a: 0x09c6, 0xd0b: 0x0a92, + 0xd0c: 0x0d7a, 0xd0d: 0x0e2e, 0xd0e: 0x0e62, 0xd0f: 0x1116, 0xd10: 0x113e, 0xd11: 0x14aa, + 0xd12: 0x0852, 0xd13: 0x11aa, 0xd14: 0x07f6, 0xd15: 0x07f2, 0xd16: 0x109a, 0xd17: 0x112a, + 0xd18: 0x125e, 0xd19: 0x14b2, 0xd1a: 0x136a, 0xd1b: 0x0c2a, 0xd1c: 0x0d76, 0xd1d: 0x135a, + 0xd1e: 0x06fa, 0xd1f: 0x0a66, 0xd20: 0x0b96, 0xd21: 0x0f32, 0xd22: 0x0fb2, 0xd23: 0x0876, + 0xd24: 0x103e, 0xd25: 0x0762, 0xd26: 0x0b7a, 0xd27: 0x06da, 0xd28: 0x0dee, 0xd29: 0x0ca6, + 0xd2a: 0x1112, 0xd2b: 0x08ca, 0xd2c: 0x09b6, 0xd2d: 0x0ffe, 0xd2e: 0x1266, 0xd2f: 0x133e, + 0xd30: 0x0dba, 0xd31: 0x13fa, 0xd32: 0x0de6, 0xd33: 0x0c3a, 0xd34: 0x121e, 0xd35: 0x0c5a, + 0xd36: 0x0fae, 0xd37: 0x072e, 0xd38: 0x07aa, 0xd39: 0x07ee, 0xd3a: 0x0d56, 0xd3b: 0x10fe, + 0xd3c: 0x11f6, 0xd3d: 0x134a, 0xd3e: 0x145e, 0xd3f: 0x085e, + // Block 0x35, offset 0xd40 + 0xd40: 0x0912, 0xd41: 0x0a1a, 0xd42: 0x0b32, 0xd43: 0x0cc2, 0xd44: 0x0e7e, 0xd45: 0x1042, + 0xd46: 0x149a, 0xd47: 0x157e, 0xd48: 0x15d2, 0xd49: 0x15ea, 0xd4a: 0x083a, 0xd4b: 0x0cf6, + 0xd4c: 0x0da6, 0xd4d: 0x13ee, 0xd4e: 0x0afe, 0xd4f: 0x0bda, 0xd50: 0x0bf6, 0xd51: 0x0c86, + 0xd52: 0x0e6e, 0xd53: 0x0eba, 0xd54: 0x0f6a, 0xd55: 0x108e, 0xd56: 0x1132, 0xd57: 0x1196, + 0xd58: 0x13de, 0xd59: 0x126e, 0xd5a: 0x1406, 0xd5b: 0x1482, 0xd5c: 0x0812, 0xd5d: 0x083e, + 0xd5e: 0x0926, 0xd5f: 0x0eaa, 0xd60: 0x12f6, 0xd61: 0x133e, 0xd62: 0x0b1e, 0xd63: 0x0b8e, + 0xd64: 0x0c52, 0xd65: 0x0db2, 0xd66: 0x10da, 0xd67: 0x0f26, 0xd68: 0x073e, 0xd69: 0x0982, + 0xd6a: 0x0a66, 0xd6b: 0x0aca, 0xd6c: 0x0b9a, 0xd6d: 0x0f42, 0xd6e: 0x0f5e, 0xd6f: 0x116e, + 0xd70: 0x118e, 0xd71: 0x1466, 0xd72: 0x14e6, 0xd73: 0x14f6, 0xd74: 0x1532, 0xd75: 0x0756, + 0xd76: 0x1082, 0xd77: 0x1452, 0xd78: 0x14ce, 0xd79: 0x0bb2, 0xd7a: 0x071a, 0xd7b: 0x077a, + 0xd7c: 0x0a6a, 0xd7d: 0x0a8a, 0xd7e: 0x0cb2, 0xd7f: 0x0d76, + // Block 0x36, offset 0xd80 + 0xd80: 0x0ec6, 0xd81: 0x0fce, 0xd82: 0x127a, 0xd83: 0x141a, 0xd84: 0x1626, 0xd85: 0x0ce6, + 0xd86: 0x14a6, 0xd87: 0x0836, 0xd88: 0x0d32, 0xd89: 0x0d3e, 0xd8a: 0x0e12, 0xd8b: 0x0e4a, + 0xd8c: 0x0f4e, 0xd8d: 0x0faa, 0xd8e: 0x102a, 0xd8f: 0x110e, 0xd90: 0x153e, 0xd91: 0x07b2, + 0xd92: 0x0c06, 0xd93: 0x14b6, 0xd94: 0x076a, 0xd95: 0x0aae, 0xd96: 0x0e32, 0xd97: 0x13e2, + 0xd98: 0x0b6a, 0xd99: 0x0bba, 0xd9a: 0x0d46, 0xd9b: 0x0f32, 0xd9c: 0x14be, 0xd9d: 0x081a, + 0xd9e: 0x0902, 0xd9f: 0x0a9a, 0xda0: 0x0cd6, 0xda1: 0x0d22, 0xda2: 0x0d62, 0xda3: 0x0df6, + 0xda4: 0x0f4a, 0xda5: 0x0fbe, 0xda6: 0x115a, 0xda7: 0x12fa, 0xda8: 0x1306, 0xda9: 0x145a, + 0xdaa: 0x14da, 0xdab: 0x0886, 0xdac: 0x0e4e, 0xdad: 0x0906, 0xdae: 0x0eca, 0xdaf: 0x0f6e, + 0xdb0: 0x128a, 0xdb1: 0x14c2, 0xdb2: 0x15ae, 0xdb3: 0x15d6, 0xdb4: 0x0d3a, 0xdb5: 0x0e2a, + 0xdb6: 0x11c6, 0xdb7: 0x10ba, 0xdb8: 0x10c6, 0xdb9: 0x10ea, 0xdba: 0x0f1a, 0xdbb: 0x0ea2, + 0xdbc: 0x1366, 0xdbd: 0x0736, 0xdbe: 0x122e, 0xdbf: 0x081e, + // Block 0x37, offset 0xdc0 + 0xdc0: 0x080e, 0xdc1: 0x0b0e, 0xdc2: 0x0c2e, 0xdc3: 0x10f6, 0xdc4: 0x0a56, 0xdc5: 0x0e06, + 0xdc6: 0x0cf2, 0xdc7: 0x13ea, 0xdc8: 0x12ea, 0xdc9: 0x14ae, 0xdca: 0x1326, 0xdcb: 0x0b2a, + 0xdcc: 0x078a, 0xdcd: 0x095e, 0xdd0: 0x09b2, + 0xdd2: 0x0ce2, 0xdd5: 0x07fa, 0xdd6: 0x0f22, 0xdd7: 0x0fe6, + 0xdd8: 0x104a, 0xdd9: 0x1066, 0xdda: 0x106a, 0xddb: 0x107e, 0xddc: 0x14fe, 0xddd: 0x10ee, + 0xdde: 0x1172, 0xde0: 0x1292, 0xde2: 0x1356, + 0xde5: 0x140a, 0xde6: 0x1436, + 0xdea: 0x1552, 0xdeb: 0x1556, 0xdec: 0x155a, 0xded: 0x15be, 0xdee: 0x142e, 0xdef: 0x14ca, + 0xdf0: 0x075a, 0xdf1: 0x077e, 0xdf2: 0x0792, 0xdf3: 0x084e, 0xdf4: 0x085a, 0xdf5: 0x089a, + 0xdf6: 0x094e, 0xdf7: 0x096a, 0xdf8: 0x0972, 0xdf9: 0x09ae, 0xdfa: 0x09ba, 0xdfb: 0x0a96, + 0xdfc: 0x0a9e, 0xdfd: 0x0ba6, 0xdfe: 0x0bce, 0xdff: 0x0bd6, + // Block 0x38, offset 0xe00 + 0xe00: 0x0bee, 0xe01: 0x0c9a, 0xe02: 0x0cca, 0xe03: 0x0cea, 0xe04: 0x0d5a, 0xe05: 0x0e1e, + 0xe06: 0x0e3a, 0xe07: 0x0e6a, 0xe08: 0x0ebe, 0xe09: 0x0ede, 0xe0a: 0x0f52, 0xe0b: 0x1032, + 0xe0c: 0x104e, 0xe0d: 0x1056, 0xe0e: 0x1052, 0xe0f: 0x105a, 0xe10: 0x105e, 0xe11: 0x1062, + 0xe12: 0x1076, 0xe13: 0x107a, 0xe14: 0x109e, 0xe15: 0x10b2, 0xe16: 0x10ce, 0xe17: 0x1132, + 0xe18: 0x113a, 0xe19: 0x1142, 0xe1a: 0x1156, 0xe1b: 0x117e, 0xe1c: 0x11ce, 0xe1d: 0x1202, + 0xe1e: 0x1202, 0xe1f: 0x126a, 0xe20: 0x1312, 0xe21: 0x132a, 0xe22: 0x135e, 0xe23: 0x1362, + 0xe24: 0x13a6, 0xe25: 0x13aa, 0xe26: 0x1402, 0xe27: 0x140a, 0xe28: 0x14de, 0xe29: 0x1522, + 0xe2a: 0x153a, 0xe2b: 0x0b9e, 0xe2c: 0x1721, 0xe2d: 0x11e6, + 0xe30: 0x06e2, 0xe31: 0x07e6, 0xe32: 0x07a6, 0xe33: 0x074e, 0xe34: 0x078e, 0xe35: 0x07ba, + 0xe36: 0x084a, 0xe37: 0x0866, 0xe38: 0x094e, 0xe39: 0x093a, 0xe3a: 0x094a, 0xe3b: 0x0966, + 0xe3c: 0x09b2, 0xe3d: 0x09c2, 0xe3e: 0x0a06, 0xe3f: 0x0a12, + // Block 0x39, offset 0xe40 + 0xe40: 0x0a2e, 0xe41: 0x0a3e, 0xe42: 0x0b26, 0xe43: 0x0b2e, 0xe44: 0x0b5e, 0xe45: 0x0b7e, + 0xe46: 0x0bae, 0xe47: 0x0bc6, 0xe48: 0x0bb6, 0xe49: 0x0bd6, 0xe4a: 0x0bca, 0xe4b: 0x0bee, + 0xe4c: 0x0c0a, 0xe4d: 0x0c62, 0xe4e: 0x0c6e, 0xe4f: 0x0c76, 0xe50: 0x0c9e, 0xe51: 0x0ce2, + 0xe52: 0x0d12, 0xe53: 0x0d16, 0xe54: 0x0d2a, 0xe55: 0x0daa, 0xe56: 0x0dba, 0xe57: 0x0e12, + 0xe58: 0x0e5e, 0xe59: 0x0e56, 0xe5a: 0x0e6a, 0xe5b: 0x0e86, 0xe5c: 0x0ebe, 0xe5d: 0x1016, + 0xe5e: 0x0ee2, 0xe5f: 0x0f16, 0xe60: 0x0f22, 0xe61: 0x0f62, 0xe62: 0x0f7e, 0xe63: 0x0fa2, + 0xe64: 0x0fc6, 0xe65: 0x0fca, 0xe66: 0x0fe6, 0xe67: 0x0fea, 0xe68: 0x0ffa, 0xe69: 0x100e, + 0xe6a: 0x100a, 0xe6b: 0x103a, 0xe6c: 0x10b6, 0xe6d: 0x10ce, 0xe6e: 0x10e6, 0xe6f: 0x111e, + 0xe70: 0x1132, 0xe71: 0x114e, 0xe72: 0x117e, 0xe73: 0x1232, 0xe74: 0x125a, 0xe75: 0x12ce, + 0xe76: 0x1316, 0xe77: 0x1322, 0xe78: 0x132a, 0xe79: 0x1342, 0xe7a: 0x1356, 0xe7b: 0x1346, + 0xe7c: 0x135e, 0xe7d: 0x135a, 0xe7e: 0x1352, 0xe7f: 0x1362, + // Block 0x3a, offset 0xe80 + 0xe80: 0x136e, 0xe81: 0x13aa, 0xe82: 0x13e6, 0xe83: 0x1416, 0xe84: 0x144e, 0xe85: 0x146e, + 0xe86: 0x14ba, 0xe87: 0x14de, 0xe88: 0x14fe, 0xe89: 0x1512, 0xe8a: 0x1522, 0xe8b: 0x152e, + 0xe8c: 0x153a, 0xe8d: 0x158e, 0xe8e: 0x162e, 0xe8f: 0x16b8, 0xe90: 0x16b3, 0xe91: 0x16e5, + 0xe92: 0x060a, 0xe93: 0x0632, 0xe94: 0x0636, 0xe95: 0x1767, 0xe96: 0x1794, 0xe97: 0x180c, + 0xe98: 0x161a, 0xe99: 0x162a, + // Block 0x3b, offset 0xec0 + 0xec0: 0x19db, 0xec1: 0x19de, 0xec2: 0x19e1, 0xec3: 0x1c0e, 0xec4: 0x1c12, 0xec5: 0x1a65, + 0xec6: 0x1a65, + 0xed3: 0x1d7b, 0xed4: 0x1d6c, 0xed5: 0x1d71, 0xed6: 0x1d80, 0xed7: 0x1d76, + 0xedd: 0x43a7, + 0xede: 0x8116, 0xedf: 0x4419, 0xee0: 0x0230, 0xee1: 0x0218, 0xee2: 0x0221, 0xee3: 0x0224, + 0xee4: 0x0227, 0xee5: 0x022a, 0xee6: 0x022d, 0xee7: 0x0233, 0xee8: 0x0236, 0xee9: 0x0017, + 0xeea: 0x4407, 0xeeb: 0x440d, 0xeec: 0x450b, 0xeed: 0x4513, 0xeee: 0x435f, 0xeef: 0x4365, + 0xef0: 0x436b, 0xef1: 0x4371, 0xef2: 0x437d, 0xef3: 0x4383, 0xef4: 0x4389, 0xef5: 0x4395, + 0xef6: 0x439b, 0xef8: 0x43a1, 0xef9: 0x43ad, 0xefa: 0x43b3, 0xefb: 0x43b9, + 0xefc: 0x43c5, 0xefe: 0x43cb, + // Block 0x3c, offset 0xf00 + 0xf00: 0x43d1, 0xf01: 0x43d7, 0xf03: 0x43dd, 0xf04: 0x43e3, + 0xf06: 0x43ef, 0xf07: 0x43f5, 0xf08: 0x43fb, 0xf09: 0x4401, 0xf0a: 0x4413, 0xf0b: 0x438f, + 0xf0c: 0x4377, 0xf0d: 0x43bf, 0xf0e: 0x43e9, 0xf0f: 0x1d85, 0xf10: 0x029c, 0xf11: 0x029c, + 0xf12: 0x02a5, 0xf13: 0x02a5, 0xf14: 0x02a5, 0xf15: 0x02a5, 0xf16: 0x02a8, 0xf17: 0x02a8, + 0xf18: 0x02a8, 0xf19: 0x02a8, 0xf1a: 0x02ae, 0xf1b: 0x02ae, 0xf1c: 0x02ae, 0xf1d: 0x02ae, + 0xf1e: 0x02a2, 0xf1f: 0x02a2, 0xf20: 0x02a2, 0xf21: 0x02a2, 0xf22: 0x02ab, 0xf23: 0x02ab, + 0xf24: 0x02ab, 0xf25: 0x02ab, 0xf26: 0x029f, 0xf27: 0x029f, 0xf28: 0x029f, 0xf29: 0x029f, + 0xf2a: 0x02d2, 0xf2b: 0x02d2, 0xf2c: 0x02d2, 0xf2d: 0x02d2, 0xf2e: 0x02d5, 0xf2f: 0x02d5, + 0xf30: 0x02d5, 0xf31: 0x02d5, 0xf32: 0x02b4, 0xf33: 0x02b4, 0xf34: 0x02b4, 0xf35: 0x02b4, + 0xf36: 0x02b1, 0xf37: 0x02b1, 0xf38: 0x02b1, 0xf39: 0x02b1, 0xf3a: 0x02b7, 0xf3b: 0x02b7, + 0xf3c: 0x02b7, 0xf3d: 0x02b7, 0xf3e: 0x02ba, 0xf3f: 0x02ba, + // Block 0x3d, offset 0xf40 + 0xf40: 0x02ba, 0xf41: 0x02ba, 0xf42: 0x02c3, 0xf43: 0x02c3, 0xf44: 0x02c0, 0xf45: 0x02c0, + 0xf46: 0x02c6, 0xf47: 0x02c6, 0xf48: 0x02bd, 0xf49: 0x02bd, 0xf4a: 0x02cc, 0xf4b: 0x02cc, + 0xf4c: 0x02c9, 0xf4d: 0x02c9, 0xf4e: 0x02d8, 0xf4f: 0x02d8, 0xf50: 0x02d8, 0xf51: 0x02d8, + 0xf52: 0x02de, 0xf53: 0x02de, 0xf54: 0x02de, 0xf55: 0x02de, 0xf56: 0x02e4, 0xf57: 0x02e4, + 0xf58: 0x02e4, 0xf59: 0x02e4, 0xf5a: 0x02e1, 0xf5b: 0x02e1, 0xf5c: 0x02e1, 0xf5d: 0x02e1, + 0xf5e: 0x02e7, 0xf5f: 0x02e7, 0xf60: 0x02ea, 0xf61: 0x02ea, 0xf62: 0x02ea, 0xf63: 0x02ea, + 0xf64: 0x4485, 0xf65: 0x4485, 0xf66: 0x02f0, 0xf67: 0x02f0, 0xf68: 0x02f0, 0xf69: 0x02f0, + 0xf6a: 0x02ed, 0xf6b: 0x02ed, 0xf6c: 0x02ed, 0xf6d: 0x02ed, 0xf6e: 0x030b, 0xf6f: 0x030b, + 0xf70: 0x447f, 0xf71: 0x447f, + // Block 0x3e, offset 0xf80 + 0xf93: 0x02db, 0xf94: 0x02db, 0xf95: 0x02db, 0xf96: 0x02db, 0xf97: 0x02f9, + 0xf98: 0x02f9, 0xf99: 0x02f6, 0xf9a: 0x02f6, 0xf9b: 0x02fc, 0xf9c: 0x02fc, 0xf9d: 0x2055, + 0xf9e: 0x0302, 0xf9f: 0x0302, 0xfa0: 0x02f3, 0xfa1: 0x02f3, 0xfa2: 0x02ff, 0xfa3: 0x02ff, + 0xfa4: 0x0308, 0xfa5: 0x0308, 0xfa6: 0x0308, 0xfa7: 0x0308, 0xfa8: 0x0290, 0xfa9: 0x0290, + 0xfaa: 0x25b0, 0xfab: 0x25b0, 0xfac: 0x2620, 0xfad: 0x2620, 0xfae: 0x25ef, 0xfaf: 0x25ef, + 0xfb0: 0x260b, 0xfb1: 0x260b, 0xfb2: 0x2604, 0xfb3: 0x2604, 0xfb4: 0x2612, 0xfb5: 0x2612, + 0xfb6: 0x2619, 0xfb7: 0x2619, 0xfb8: 0x2619, 0xfb9: 0x25f6, 0xfba: 0x25f6, 0xfbb: 0x25f6, + 0xfbc: 0x0305, 0xfbd: 0x0305, 0xfbe: 0x0305, 0xfbf: 0x0305, + // Block 0x3f, offset 0xfc0 + 0xfc0: 0x25b7, 0xfc1: 0x25be, 0xfc2: 0x25da, 0xfc3: 0x25f6, 0xfc4: 0x25fd, 0xfc5: 0x1d8f, + 0xfc6: 0x1d94, 0xfc7: 0x1d99, 0xfc8: 0x1da8, 0xfc9: 0x1db7, 0xfca: 0x1dbc, 0xfcb: 0x1dc1, + 0xfcc: 0x1dc6, 0xfcd: 0x1dcb, 0xfce: 0x1dda, 0xfcf: 0x1de9, 0xfd0: 0x1dee, 0xfd1: 0x1df3, + 0xfd2: 0x1e02, 0xfd3: 0x1e11, 0xfd4: 0x1e16, 0xfd5: 0x1e1b, 0xfd6: 0x1e20, 0xfd7: 0x1e2f, + 0xfd8: 0x1e34, 0xfd9: 0x1e43, 0xfda: 0x1e48, 0xfdb: 0x1e4d, 0xfdc: 0x1e5c, 0xfdd: 0x1e61, + 0xfde: 0x1e66, 0xfdf: 0x1e70, 0xfe0: 0x1eac, 0xfe1: 0x1ebb, 0xfe2: 0x1eca, 0xfe3: 0x1ecf, + 0xfe4: 0x1ed4, 0xfe5: 0x1ede, 0xfe6: 0x1eed, 0xfe7: 0x1ef2, 0xfe8: 0x1f01, 0xfe9: 0x1f06, + 0xfea: 0x1f0b, 0xfeb: 0x1f1a, 0xfec: 0x1f1f, 0xfed: 0x1f2e, 0xfee: 0x1f33, 0xfef: 0x1f38, + 0xff0: 0x1f3d, 0xff1: 0x1f42, 0xff2: 0x1f47, 0xff3: 0x1f4c, 0xff4: 0x1f51, 0xff5: 0x1f56, + 0xff6: 0x1f5b, 0xff7: 0x1f60, 0xff8: 0x1f65, 0xff9: 0x1f6a, 0xffa: 0x1f6f, 0xffb: 0x1f74, + 0xffc: 0x1f79, 0xffd: 0x1f7e, 0xffe: 0x1f83, 0xfff: 0x1f8d, + // Block 0x40, offset 0x1000 + 0x1000: 0x1f92, 0x1001: 0x1f97, 0x1002: 0x1f9c, 0x1003: 0x1fa6, 0x1004: 0x1fab, 0x1005: 0x1fb5, + 0x1006: 0x1fba, 0x1007: 0x1fbf, 0x1008: 0x1fc4, 0x1009: 0x1fc9, 0x100a: 0x1fce, 0x100b: 0x1fd3, + 0x100c: 0x1fd8, 0x100d: 0x1fdd, 0x100e: 0x1fec, 0x100f: 0x1ffb, 0x1010: 0x2000, 0x1011: 0x2005, + 0x1012: 0x200a, 0x1013: 0x200f, 0x1014: 0x2014, 0x1015: 0x201e, 0x1016: 0x2023, 0x1017: 0x2028, + 0x1018: 0x2037, 0x1019: 0x2046, 0x101a: 0x204b, 0x101b: 0x4437, 0x101c: 0x443d, 0x101d: 0x4473, + 0x101e: 0x44ca, 0x101f: 0x44d1, 0x1020: 0x44d8, 0x1021: 0x44df, 0x1022: 0x44e6, 0x1023: 0x44ed, + 0x1024: 0x25cc, 0x1025: 0x25d3, 0x1026: 0x25da, 0x1027: 0x25e1, 0x1028: 0x25f6, 0x1029: 0x25fd, + 0x102a: 0x1d9e, 0x102b: 0x1da3, 0x102c: 0x1da8, 0x102d: 0x1dad, 0x102e: 0x1db7, 0x102f: 0x1dbc, + 0x1030: 0x1dd0, 0x1031: 0x1dd5, 0x1032: 0x1dda, 0x1033: 0x1ddf, 0x1034: 0x1de9, 0x1035: 0x1dee, + 0x1036: 0x1df8, 0x1037: 0x1dfd, 0x1038: 0x1e02, 0x1039: 0x1e07, 0x103a: 0x1e11, 0x103b: 0x1e16, + 0x103c: 0x1f42, 0x103d: 0x1f47, 0x103e: 0x1f56, 0x103f: 0x1f5b, + // Block 0x41, offset 0x1040 + 0x1040: 0x1f60, 0x1041: 0x1f74, 0x1042: 0x1f79, 0x1043: 0x1f7e, 0x1044: 0x1f83, 0x1045: 0x1f9c, + 0x1046: 0x1fa6, 0x1047: 0x1fab, 0x1048: 0x1fb0, 0x1049: 0x1fc4, 0x104a: 0x1fe2, 0x104b: 0x1fe7, + 0x104c: 0x1fec, 0x104d: 0x1ff1, 0x104e: 0x1ffb, 0x104f: 0x2000, 0x1050: 0x4473, 0x1051: 0x202d, + 0x1052: 0x2032, 0x1053: 0x2037, 0x1054: 0x203c, 0x1055: 0x2046, 0x1056: 0x204b, 0x1057: 0x25b7, + 0x1058: 0x25be, 0x1059: 0x25c5, 0x105a: 0x25da, 0x105b: 0x25e8, 0x105c: 0x1d8f, 0x105d: 0x1d94, + 0x105e: 0x1d99, 0x105f: 0x1da8, 0x1060: 0x1db2, 0x1061: 0x1dc1, 0x1062: 0x1dc6, 0x1063: 0x1dcb, + 0x1064: 0x1dda, 0x1065: 0x1de4, 0x1066: 0x1e02, 0x1067: 0x1e1b, 0x1068: 0x1e20, 0x1069: 0x1e2f, + 0x106a: 0x1e34, 0x106b: 0x1e43, 0x106c: 0x1e4d, 0x106d: 0x1e5c, 0x106e: 0x1e61, 0x106f: 0x1e66, + 0x1070: 0x1e70, 0x1071: 0x1eac, 0x1072: 0x1eb1, 0x1073: 0x1ebb, 0x1074: 0x1eca, 0x1075: 0x1ecf, + 0x1076: 0x1ed4, 0x1077: 0x1ede, 0x1078: 0x1eed, 0x1079: 0x1f01, 0x107a: 0x1f06, 0x107b: 0x1f0b, + 0x107c: 0x1f1a, 0x107d: 0x1f1f, 0x107e: 0x1f2e, 0x107f: 0x1f33, + // Block 0x42, offset 0x1080 + 0x1080: 0x1f38, 0x1081: 0x1f3d, 0x1082: 0x1f4c, 0x1083: 0x1f51, 0x1084: 0x1f65, 0x1085: 0x1f6a, + 0x1086: 0x1f6f, 0x1087: 0x1f74, 0x1088: 0x1f79, 0x1089: 0x1f8d, 0x108a: 0x1f92, 0x108b: 0x1f97, + 0x108c: 0x1f9c, 0x108d: 0x1fa1, 0x108e: 0x1fb5, 0x108f: 0x1fba, 0x1090: 0x1fbf, 0x1091: 0x1fc4, + 0x1092: 0x1fd3, 0x1093: 0x1fd8, 0x1094: 0x1fdd, 0x1095: 0x1fec, 0x1096: 0x1ff6, 0x1097: 0x2005, + 0x1098: 0x200a, 0x1099: 0x4467, 0x109a: 0x201e, 0x109b: 0x2023, 0x109c: 0x2028, 0x109d: 0x2037, + 0x109e: 0x2041, 0x109f: 0x25da, 0x10a0: 0x25e8, 0x10a1: 0x1da8, 0x10a2: 0x1db2, 0x10a3: 0x1dda, + 0x10a4: 0x1de4, 0x10a5: 0x1e02, 0x10a6: 0x1e0c, 0x10a7: 0x1e70, 0x10a8: 0x1e75, 0x10a9: 0x1e98, + 0x10aa: 0x1e9d, 0x10ab: 0x1f74, 0x10ac: 0x1f79, 0x10ad: 0x1f9c, 0x10ae: 0x1fec, 0x10af: 0x1ff6, + 0x10b0: 0x2037, 0x10b1: 0x2041, 0x10b2: 0x451b, 0x10b3: 0x4523, 0x10b4: 0x452b, 0x10b5: 0x1ef7, + 0x10b6: 0x1efc, 0x10b7: 0x1f10, 0x10b8: 0x1f15, 0x10b9: 0x1f24, 0x10ba: 0x1f29, 0x10bb: 0x1e7a, + 0x10bc: 0x1e7f, 0x10bd: 0x1ea2, 0x10be: 0x1ea7, 0x10bf: 0x1e39, + // Block 0x43, offset 0x10c0 + 0x10c0: 0x1e3e, 0x10c1: 0x1e25, 0x10c2: 0x1e2a, 0x10c3: 0x1e52, 0x10c4: 0x1e57, 0x10c5: 0x1ec0, + 0x10c6: 0x1ec5, 0x10c7: 0x1ee3, 0x10c8: 0x1ee8, 0x10c9: 0x1e84, 0x10ca: 0x1e89, 0x10cb: 0x1e8e, + 0x10cc: 0x1e98, 0x10cd: 0x1e93, 0x10ce: 0x1e6b, 0x10cf: 0x1eb6, 0x10d0: 0x1ed9, 0x10d1: 0x1ef7, + 0x10d2: 0x1efc, 0x10d3: 0x1f10, 0x10d4: 0x1f15, 0x10d5: 0x1f24, 0x10d6: 0x1f29, 0x10d7: 0x1e7a, + 0x10d8: 0x1e7f, 0x10d9: 0x1ea2, 0x10da: 0x1ea7, 0x10db: 0x1e39, 0x10dc: 0x1e3e, 0x10dd: 0x1e25, + 0x10de: 0x1e2a, 0x10df: 0x1e52, 0x10e0: 0x1e57, 0x10e1: 0x1ec0, 0x10e2: 0x1ec5, 0x10e3: 0x1ee3, + 0x10e4: 0x1ee8, 0x10e5: 0x1e84, 0x10e6: 0x1e89, 0x10e7: 0x1e8e, 0x10e8: 0x1e98, 0x10e9: 0x1e93, + 0x10ea: 0x1e6b, 0x10eb: 0x1eb6, 0x10ec: 0x1ed9, 0x10ed: 0x1e84, 0x10ee: 0x1e89, 0x10ef: 0x1e8e, + 0x10f0: 0x1e98, 0x10f1: 0x1e75, 0x10f2: 0x1e9d, 0x10f3: 0x1ef2, 0x10f4: 0x1e5c, 0x10f5: 0x1e61, + 0x10f6: 0x1e66, 0x10f7: 0x1e84, 0x10f8: 0x1e89, 0x10f9: 0x1e8e, 0x10fa: 0x1ef2, 0x10fb: 0x1f01, + 0x10fc: 0x441f, 0x10fd: 0x441f, + // Block 0x44, offset 0x1100 + 0x1110: 0x2317, 0x1111: 0x232c, + 0x1112: 0x232c, 0x1113: 0x2333, 0x1114: 0x233a, 0x1115: 0x234f, 0x1116: 0x2356, 0x1117: 0x235d, + 0x1118: 0x2380, 0x1119: 0x2380, 0x111a: 0x23a3, 0x111b: 0x239c, 0x111c: 0x23b8, 0x111d: 0x23aa, + 0x111e: 0x23b1, 0x111f: 0x23d4, 0x1120: 0x23d4, 0x1121: 0x23cd, 0x1122: 0x23db, 0x1123: 0x23db, + 0x1124: 0x2405, 0x1125: 0x2405, 0x1126: 0x2421, 0x1127: 0x23e9, 0x1128: 0x23e9, 0x1129: 0x23e2, + 0x112a: 0x23f7, 0x112b: 0x23f7, 0x112c: 0x23fe, 0x112d: 0x23fe, 0x112e: 0x2428, 0x112f: 0x2436, + 0x1130: 0x2436, 0x1131: 0x243d, 0x1132: 0x243d, 0x1133: 0x2444, 0x1134: 0x244b, 0x1135: 0x2452, + 0x1136: 0x2459, 0x1137: 0x2459, 0x1138: 0x2460, 0x1139: 0x246e, 0x113a: 0x247c, 0x113b: 0x2475, + 0x113c: 0x2483, 0x113d: 0x2483, 0x113e: 0x2498, 0x113f: 0x249f, + // Block 0x45, offset 0x1140 + 0x1140: 0x24d0, 0x1141: 0x24de, 0x1142: 0x24d7, 0x1143: 0x24bb, 0x1144: 0x24bb, 0x1145: 0x24e5, + 0x1146: 0x24e5, 0x1147: 0x24ec, 0x1148: 0x24ec, 0x1149: 0x2516, 0x114a: 0x251d, 0x114b: 0x2524, + 0x114c: 0x24fa, 0x114d: 0x2508, 0x114e: 0x252b, 0x114f: 0x2532, + 0x1152: 0x2501, 0x1153: 0x2586, 0x1154: 0x258d, 0x1155: 0x2563, 0x1156: 0x256a, 0x1157: 0x254e, + 0x1158: 0x254e, 0x1159: 0x2555, 0x115a: 0x257f, 0x115b: 0x2578, 0x115c: 0x25a2, 0x115d: 0x25a2, + 0x115e: 0x2310, 0x115f: 0x2325, 0x1160: 0x231e, 0x1161: 0x2348, 0x1162: 0x2341, 0x1163: 0x236b, + 0x1164: 0x2364, 0x1165: 0x238e, 0x1166: 0x2372, 0x1167: 0x2387, 0x1168: 0x23bf, 0x1169: 0x240c, + 0x116a: 0x23f0, 0x116b: 0x242f, 0x116c: 0x24c9, 0x116d: 0x24f3, 0x116e: 0x259b, 0x116f: 0x2594, + 0x1170: 0x25a9, 0x1171: 0x2540, 0x1172: 0x24a6, 0x1173: 0x2571, 0x1174: 0x2498, 0x1175: 0x24d0, + 0x1176: 0x2467, 0x1177: 0x24b4, 0x1178: 0x2547, 0x1179: 0x2539, 0x117a: 0x24c2, 0x117b: 0x24ad, + 0x117c: 0x24c2, 0x117d: 0x2547, 0x117e: 0x2379, 0x117f: 0x2395, + // Block 0x46, offset 0x1180 + 0x1180: 0x250f, 0x1181: 0x248a, 0x1182: 0x2309, 0x1183: 0x24ad, 0x1184: 0x2452, 0x1185: 0x2421, + 0x1186: 0x23c6, 0x1187: 0x255c, + 0x11b0: 0x241a, 0x11b1: 0x2491, 0x11b2: 0x27cc, 0x11b3: 0x27c3, 0x11b4: 0x27f9, 0x11b5: 0x27e7, + 0x11b6: 0x27d5, 0x11b7: 0x27f0, 0x11b8: 0x2802, 0x11b9: 0x2413, 0x11ba: 0x2c89, 0x11bb: 0x2b09, + 0x11bc: 0x27de, + // Block 0x47, offset 0x11c0 + 0x11d0: 0x0019, 0x11d1: 0x0486, + 0x11d2: 0x048a, 0x11d3: 0x0035, 0x11d4: 0x0037, 0x11d5: 0x0003, 0x11d6: 0x003f, 0x11d7: 0x04c2, + 0x11d8: 0x04c6, 0x11d9: 0x1b62, + 0x11e0: 0x8133, 0x11e1: 0x8133, 0x11e2: 0x8133, 0x11e3: 0x8133, + 0x11e4: 0x8133, 0x11e5: 0x8133, 0x11e6: 0x8133, 0x11e7: 0x812e, 0x11e8: 0x812e, 0x11e9: 0x812e, + 0x11ea: 0x812e, 0x11eb: 0x812e, 0x11ec: 0x812e, 0x11ed: 0x812e, 0x11ee: 0x8133, 0x11ef: 0x8133, + 0x11f0: 0x1876, 0x11f1: 0x0446, 0x11f2: 0x0442, 0x11f3: 0x007f, 0x11f4: 0x007f, 0x11f5: 0x0011, + 0x11f6: 0x0013, 0x11f7: 0x00b7, 0x11f8: 0x00bb, 0x11f9: 0x04ba, 0x11fa: 0x04be, 0x11fb: 0x04ae, + 0x11fc: 0x04b2, 0x11fd: 0x0496, 0x11fe: 0x049a, 0x11ff: 0x048e, + // Block 0x48, offset 0x1200 + 0x1200: 0x0492, 0x1201: 0x049e, 0x1202: 0x04a2, 0x1203: 0x04a6, 0x1204: 0x04aa, + 0x1207: 0x0077, 0x1208: 0x007b, 0x1209: 0x4280, 0x120a: 0x4280, 0x120b: 0x4280, + 0x120c: 0x4280, 0x120d: 0x007f, 0x120e: 0x007f, 0x120f: 0x007f, 0x1210: 0x0019, 0x1211: 0x0486, + 0x1212: 0x001d, 0x1214: 0x0037, 0x1215: 0x0035, 0x1216: 0x003f, 0x1217: 0x0003, + 0x1218: 0x0446, 0x1219: 0x0011, 0x121a: 0x0013, 0x121b: 0x00b7, 0x121c: 0x00bb, 0x121d: 0x04ba, + 0x121e: 0x04be, 0x121f: 0x0007, 0x1220: 0x000d, 0x1221: 0x0015, 0x1222: 0x0017, 0x1223: 0x001b, + 0x1224: 0x0039, 0x1225: 0x003d, 0x1226: 0x003b, 0x1228: 0x0079, 0x1229: 0x0009, + 0x122a: 0x000b, 0x122b: 0x0041, + 0x1230: 0x42c1, 0x1231: 0x4443, 0x1232: 0x42c6, 0x1234: 0x42cb, + 0x1236: 0x42d0, 0x1237: 0x4449, 0x1238: 0x42d5, 0x1239: 0x444f, 0x123a: 0x42da, 0x123b: 0x4455, + 0x123c: 0x42df, 0x123d: 0x445b, 0x123e: 0x42e4, 0x123f: 0x4461, + // Block 0x49, offset 0x1240 + 0x1240: 0x0239, 0x1241: 0x4425, 0x1242: 0x4425, 0x1243: 0x442b, 0x1244: 0x442b, 0x1245: 0x446d, + 0x1246: 0x446d, 0x1247: 0x4431, 0x1248: 0x4431, 0x1249: 0x4479, 0x124a: 0x4479, 0x124b: 0x4479, + 0x124c: 0x4479, 0x124d: 0x023c, 0x124e: 0x023c, 0x124f: 0x023f, 0x1250: 0x023f, 0x1251: 0x023f, + 0x1252: 0x023f, 0x1253: 0x0242, 0x1254: 0x0242, 0x1255: 0x0245, 0x1256: 0x0245, 0x1257: 0x0245, + 0x1258: 0x0245, 0x1259: 0x0248, 0x125a: 0x0248, 0x125b: 0x0248, 0x125c: 0x0248, 0x125d: 0x024b, + 0x125e: 0x024b, 0x125f: 0x024b, 0x1260: 0x024b, 0x1261: 0x024e, 0x1262: 0x024e, 0x1263: 0x024e, + 0x1264: 0x024e, 0x1265: 0x0251, 0x1266: 0x0251, 0x1267: 0x0251, 0x1268: 0x0251, 0x1269: 0x0254, + 0x126a: 0x0254, 0x126b: 0x0257, 0x126c: 0x0257, 0x126d: 0x025a, 0x126e: 0x025a, 0x126f: 0x025d, + 0x1270: 0x025d, 0x1271: 0x0260, 0x1272: 0x0260, 0x1273: 0x0260, 0x1274: 0x0260, 0x1275: 0x0263, + 0x1276: 0x0263, 0x1277: 0x0263, 0x1278: 0x0263, 0x1279: 0x0266, 0x127a: 0x0266, 0x127b: 0x0266, + 0x127c: 0x0266, 0x127d: 0x0269, 0x127e: 0x0269, 0x127f: 0x0269, + // Block 0x4a, offset 0x1280 + 0x1280: 0x0269, 0x1281: 0x026c, 0x1282: 0x026c, 0x1283: 0x026c, 0x1284: 0x026c, 0x1285: 0x026f, + 0x1286: 0x026f, 0x1287: 0x026f, 0x1288: 0x026f, 0x1289: 0x0272, 0x128a: 0x0272, 0x128b: 0x0272, + 0x128c: 0x0272, 0x128d: 0x0275, 0x128e: 0x0275, 0x128f: 0x0275, 0x1290: 0x0275, 0x1291: 0x0278, + 0x1292: 0x0278, 0x1293: 0x0278, 0x1294: 0x0278, 0x1295: 0x027b, 0x1296: 0x027b, 0x1297: 0x027b, + 0x1298: 0x027b, 0x1299: 0x027e, 0x129a: 0x027e, 0x129b: 0x027e, 0x129c: 0x027e, 0x129d: 0x0281, + 0x129e: 0x0281, 0x129f: 0x0281, 0x12a0: 0x0281, 0x12a1: 0x0284, 0x12a2: 0x0284, 0x12a3: 0x0284, + 0x12a4: 0x0284, 0x12a5: 0x0287, 0x12a6: 0x0287, 0x12a7: 0x0287, 0x12a8: 0x0287, 0x12a9: 0x028a, + 0x12aa: 0x028a, 0x12ab: 0x028a, 0x12ac: 0x028a, 0x12ad: 0x028d, 0x12ae: 0x028d, 0x12af: 0x0290, + 0x12b0: 0x0290, 0x12b1: 0x0293, 0x12b2: 0x0293, 0x12b3: 0x0293, 0x12b4: 0x0293, 0x12b5: 0x2e17, + 0x12b6: 0x2e17, 0x12b7: 0x2e1f, 0x12b8: 0x2e1f, 0x12b9: 0x2e27, 0x12ba: 0x2e27, 0x12bb: 0x1f88, + 0x12bc: 0x1f88, + // Block 0x4b, offset 0x12c0 + 0x12c0: 0x0081, 0x12c1: 0x0083, 0x12c2: 0x0085, 0x12c3: 0x0087, 0x12c4: 0x0089, 0x12c5: 0x008b, + 0x12c6: 0x008d, 0x12c7: 0x008f, 0x12c8: 0x0091, 0x12c9: 0x0093, 0x12ca: 0x0095, 0x12cb: 0x0097, + 0x12cc: 0x0099, 0x12cd: 0x009b, 0x12ce: 0x009d, 0x12cf: 0x009f, 0x12d0: 0x00a1, 0x12d1: 0x00a3, + 0x12d2: 0x00a5, 0x12d3: 0x00a7, 0x12d4: 0x00a9, 0x12d5: 0x00ab, 0x12d6: 0x00ad, 0x12d7: 0x00af, + 0x12d8: 0x00b1, 0x12d9: 0x00b3, 0x12da: 0x00b5, 0x12db: 0x00b7, 0x12dc: 0x00b9, 0x12dd: 0x00bb, + 0x12de: 0x00bd, 0x12df: 0x047a, 0x12e0: 0x047e, 0x12e1: 0x048a, 0x12e2: 0x049e, 0x12e3: 0x04a2, + 0x12e4: 0x0486, 0x12e5: 0x05ae, 0x12e6: 0x05a6, 0x12e7: 0x04ca, 0x12e8: 0x04d2, 0x12e9: 0x04da, + 0x12ea: 0x04e2, 0x12eb: 0x04ea, 0x12ec: 0x056e, 0x12ed: 0x0576, 0x12ee: 0x057e, 0x12ef: 0x0522, + 0x12f0: 0x05b2, 0x12f1: 0x04ce, 0x12f2: 0x04d6, 0x12f3: 0x04de, 0x12f4: 0x04e6, 0x12f5: 0x04ee, + 0x12f6: 0x04f2, 0x12f7: 0x04f6, 0x12f8: 0x04fa, 0x12f9: 0x04fe, 0x12fa: 0x0502, 0x12fb: 0x0506, + 0x12fc: 0x050a, 0x12fd: 0x050e, 0x12fe: 0x0512, 0x12ff: 0x0516, + // Block 0x4c, offset 0x1300 + 0x1300: 0x051a, 0x1301: 0x051e, 0x1302: 0x0526, 0x1303: 0x052a, 0x1304: 0x052e, 0x1305: 0x0532, + 0x1306: 0x0536, 0x1307: 0x053a, 0x1308: 0x053e, 0x1309: 0x0542, 0x130a: 0x0546, 0x130b: 0x054a, + 0x130c: 0x054e, 0x130d: 0x0552, 0x130e: 0x0556, 0x130f: 0x055a, 0x1310: 0x055e, 0x1311: 0x0562, + 0x1312: 0x0566, 0x1313: 0x056a, 0x1314: 0x0572, 0x1315: 0x057a, 0x1316: 0x0582, 0x1317: 0x0586, + 0x1318: 0x058a, 0x1319: 0x058e, 0x131a: 0x0592, 0x131b: 0x0596, 0x131c: 0x059a, 0x131d: 0x05aa, + 0x131e: 0x4a8f, 0x131f: 0x4a95, 0x1320: 0x03c6, 0x1321: 0x0316, 0x1322: 0x031a, 0x1323: 0x4a52, + 0x1324: 0x031e, 0x1325: 0x4a58, 0x1326: 0x4a5e, 0x1327: 0x0322, 0x1328: 0x0326, 0x1329: 0x032a, + 0x132a: 0x4a64, 0x132b: 0x4a6a, 0x132c: 0x4a70, 0x132d: 0x4a76, 0x132e: 0x4a7c, 0x132f: 0x4a82, + 0x1330: 0x036a, 0x1331: 0x032e, 0x1332: 0x0332, 0x1333: 0x0336, 0x1334: 0x037e, 0x1335: 0x033a, + 0x1336: 0x033e, 0x1337: 0x0342, 0x1338: 0x0346, 0x1339: 0x034a, 0x133a: 0x034e, 0x133b: 0x0352, + 0x133c: 0x0356, 0x133d: 0x035a, 0x133e: 0x035e, + // Block 0x4d, offset 0x1340 + 0x1342: 0x49d4, 0x1343: 0x49da, 0x1344: 0x49e0, 0x1345: 0x49e6, + 0x1346: 0x49ec, 0x1347: 0x49f2, 0x134a: 0x49f8, 0x134b: 0x49fe, + 0x134c: 0x4a04, 0x134d: 0x4a0a, 0x134e: 0x4a10, 0x134f: 0x4a16, + 0x1352: 0x4a1c, 0x1353: 0x4a22, 0x1354: 0x4a28, 0x1355: 0x4a2e, 0x1356: 0x4a34, 0x1357: 0x4a3a, + 0x135a: 0x4a40, 0x135b: 0x4a46, 0x135c: 0x4a4c, + 0x1360: 0x00bf, 0x1361: 0x00c2, 0x1362: 0x00cb, 0x1363: 0x427b, + 0x1364: 0x00c8, 0x1365: 0x00c5, 0x1366: 0x044a, 0x1368: 0x046e, 0x1369: 0x044e, + 0x136a: 0x0452, 0x136b: 0x0456, 0x136c: 0x045a, 0x136d: 0x0472, 0x136e: 0x0476, + // Block 0x4e, offset 0x1380 + 0x1380: 0x0063, 0x1381: 0x0065, 0x1382: 0x0067, 0x1383: 0x0069, 0x1384: 0x006b, 0x1385: 0x006d, + 0x1386: 0x006f, 0x1387: 0x0071, 0x1388: 0x0073, 0x1389: 0x0075, 0x138a: 0x0083, 0x138b: 0x0085, + 0x138c: 0x0087, 0x138d: 0x0089, 0x138e: 0x008b, 0x138f: 0x008d, 0x1390: 0x008f, 0x1391: 0x0091, + 0x1392: 0x0093, 0x1393: 0x0095, 0x1394: 0x0097, 0x1395: 0x0099, 0x1396: 0x009b, 0x1397: 0x009d, + 0x1398: 0x009f, 0x1399: 0x00a1, 0x139a: 0x00a3, 0x139b: 0x00a5, 0x139c: 0x00a7, 0x139d: 0x00a9, + 0x139e: 0x00ab, 0x139f: 0x00ad, 0x13a0: 0x00af, 0x13a1: 0x00b1, 0x13a2: 0x00b3, 0x13a3: 0x00b5, + 0x13a4: 0x00dd, 0x13a5: 0x00f2, 0x13a8: 0x0176, 0x13a9: 0x0179, + 0x13aa: 0x017c, 0x13ab: 0x017f, 0x13ac: 0x0182, 0x13ad: 0x0185, 0x13ae: 0x0188, 0x13af: 0x018b, + 0x13b0: 0x018e, 0x13b1: 0x0191, 0x13b2: 0x0194, 0x13b3: 0x0197, 0x13b4: 0x019a, 0x13b5: 0x019d, + 0x13b6: 0x01a0, 0x13b7: 0x01a3, 0x13b8: 0x01a6, 0x13b9: 0x018b, 0x13ba: 0x01a9, 0x13bb: 0x01ac, + 0x13bc: 0x01af, 0x13bd: 0x01b2, 0x13be: 0x01b5, 0x13bf: 0x01b8, + // Block 0x4f, offset 0x13c0 + 0x13c0: 0x0200, 0x13c1: 0x0203, 0x13c2: 0x0206, 0x13c3: 0x045e, 0x13c4: 0x01ca, 0x13c5: 0x01d3, + 0x13c6: 0x01d9, 0x13c7: 0x01fd, 0x13c8: 0x01ee, 0x13c9: 0x01eb, 0x13ca: 0x0209, 0x13cb: 0x020c, + 0x13ce: 0x0021, 0x13cf: 0x0023, 0x13d0: 0x0025, 0x13d1: 0x0027, + 0x13d2: 0x0029, 0x13d3: 0x002b, 0x13d4: 0x002d, 0x13d5: 0x002f, 0x13d6: 0x0031, 0x13d7: 0x0033, + 0x13d8: 0x0021, 0x13d9: 0x0023, 0x13da: 0x0025, 0x13db: 0x0027, 0x13dc: 0x0029, 0x13dd: 0x002b, + 0x13de: 0x002d, 0x13df: 0x002f, 0x13e0: 0x0031, 0x13e1: 0x0033, 0x13e2: 0x0021, 0x13e3: 0x0023, + 0x13e4: 0x0025, 0x13e5: 0x0027, 0x13e6: 0x0029, 0x13e7: 0x002b, 0x13e8: 0x002d, 0x13e9: 0x002f, + 0x13ea: 0x0031, 0x13eb: 0x0033, 0x13ec: 0x0021, 0x13ed: 0x0023, 0x13ee: 0x0025, 0x13ef: 0x0027, + 0x13f0: 0x0029, 0x13f1: 0x002b, 0x13f2: 0x002d, 0x13f3: 0x002f, 0x13f4: 0x0031, 0x13f5: 0x0033, + 0x13f6: 0x0021, 0x13f7: 0x0023, 0x13f8: 0x0025, 0x13f9: 0x0027, 0x13fa: 0x0029, 0x13fb: 0x002b, + 0x13fc: 0x002d, 0x13fd: 0x002f, 0x13fe: 0x0031, 0x13ff: 0x0033, + // Block 0x50, offset 0x1400 + 0x1400: 0x023c, 0x1401: 0x023f, 0x1402: 0x024b, 0x1403: 0x0254, 0x1405: 0x028d, + 0x1406: 0x025d, 0x1407: 0x024e, 0x1408: 0x026c, 0x1409: 0x0293, 0x140a: 0x027e, 0x140b: 0x0281, + 0x140c: 0x0284, 0x140d: 0x0287, 0x140e: 0x0260, 0x140f: 0x0272, 0x1410: 0x0278, 0x1411: 0x0266, + 0x1412: 0x027b, 0x1413: 0x025a, 0x1414: 0x0263, 0x1415: 0x0245, 0x1416: 0x0248, 0x1417: 0x0251, + 0x1418: 0x0257, 0x1419: 0x0269, 0x141a: 0x026f, 0x141b: 0x0275, 0x141c: 0x0296, 0x141d: 0x02e7, + 0x141e: 0x02cf, 0x141f: 0x0299, 0x1421: 0x023f, 0x1422: 0x024b, + 0x1424: 0x028a, 0x1427: 0x024e, 0x1429: 0x0293, + 0x142a: 0x027e, 0x142b: 0x0281, 0x142c: 0x0284, 0x142d: 0x0287, 0x142e: 0x0260, 0x142f: 0x0272, + 0x1430: 0x0278, 0x1431: 0x0266, 0x1432: 0x027b, 0x1434: 0x0263, 0x1435: 0x0245, + 0x1436: 0x0248, 0x1437: 0x0251, 0x1439: 0x0269, 0x143b: 0x0275, + // Block 0x51, offset 0x1440 + 0x1442: 0x024b, + 0x1447: 0x024e, 0x1449: 0x0293, 0x144b: 0x0281, + 0x144d: 0x0287, 0x144e: 0x0260, 0x144f: 0x0272, 0x1451: 0x0266, + 0x1452: 0x027b, 0x1454: 0x0263, 0x1457: 0x0251, + 0x1459: 0x0269, 0x145b: 0x0275, 0x145d: 0x02e7, + 0x145f: 0x0299, 0x1461: 0x023f, 0x1462: 0x024b, + 0x1464: 0x028a, 0x1467: 0x024e, 0x1468: 0x026c, 0x1469: 0x0293, + 0x146a: 0x027e, 0x146c: 0x0284, 0x146d: 0x0287, 0x146e: 0x0260, 0x146f: 0x0272, + 0x1470: 0x0278, 0x1471: 0x0266, 0x1472: 0x027b, 0x1474: 0x0263, 0x1475: 0x0245, + 0x1476: 0x0248, 0x1477: 0x0251, 0x1479: 0x0269, 0x147a: 0x026f, 0x147b: 0x0275, + 0x147c: 0x0296, 0x147e: 0x02cf, + // Block 0x52, offset 0x1480 + 0x1480: 0x023c, 0x1481: 0x023f, 0x1482: 0x024b, 0x1483: 0x0254, 0x1484: 0x028a, 0x1485: 0x028d, + 0x1486: 0x025d, 0x1487: 0x024e, 0x1488: 0x026c, 0x1489: 0x0293, 0x148b: 0x0281, + 0x148c: 0x0284, 0x148d: 0x0287, 0x148e: 0x0260, 0x148f: 0x0272, 0x1490: 0x0278, 0x1491: 0x0266, + 0x1492: 0x027b, 0x1493: 0x025a, 0x1494: 0x0263, 0x1495: 0x0245, 0x1496: 0x0248, 0x1497: 0x0251, + 0x1498: 0x0257, 0x1499: 0x0269, 0x149a: 0x026f, 0x149b: 0x0275, + 0x14a1: 0x023f, 0x14a2: 0x024b, 0x14a3: 0x0254, + 0x14a5: 0x028d, 0x14a6: 0x025d, 0x14a7: 0x024e, 0x14a8: 0x026c, 0x14a9: 0x0293, + 0x14ab: 0x0281, 0x14ac: 0x0284, 0x14ad: 0x0287, 0x14ae: 0x0260, 0x14af: 0x0272, + 0x14b0: 0x0278, 0x14b1: 0x0266, 0x14b2: 0x027b, 0x14b3: 0x025a, 0x14b4: 0x0263, 0x14b5: 0x0245, + 0x14b6: 0x0248, 0x14b7: 0x0251, 0x14b8: 0x0257, 0x14b9: 0x0269, 0x14ba: 0x026f, 0x14bb: 0x0275, + // Block 0x53, offset 0x14c0 + 0x14c0: 0x187c, 0x14c1: 0x1879, 0x14c2: 0x187f, 0x14c3: 0x18a3, 0x14c4: 0x18c7, 0x14c5: 0x18eb, + 0x14c6: 0x190f, 0x14c7: 0x1918, 0x14c8: 0x191e, 0x14c9: 0x1924, 0x14ca: 0x192a, + 0x14d0: 0x1a92, 0x14d1: 0x1a96, + 0x14d2: 0x1a9a, 0x14d3: 0x1a9e, 0x14d4: 0x1aa2, 0x14d5: 0x1aa6, 0x14d6: 0x1aaa, 0x14d7: 0x1aae, + 0x14d8: 0x1ab2, 0x14d9: 0x1ab6, 0x14da: 0x1aba, 0x14db: 0x1abe, 0x14dc: 0x1ac2, 0x14dd: 0x1ac6, + 0x14de: 0x1aca, 0x14df: 0x1ace, 0x14e0: 0x1ad2, 0x14e1: 0x1ad6, 0x14e2: 0x1ada, 0x14e3: 0x1ade, + 0x14e4: 0x1ae2, 0x14e5: 0x1ae6, 0x14e6: 0x1aea, 0x14e7: 0x1aee, 0x14e8: 0x1af2, 0x14e9: 0x1af6, + 0x14ea: 0x272b, 0x14eb: 0x0047, 0x14ec: 0x0065, 0x14ed: 0x193f, 0x14ee: 0x19b7, + 0x14f0: 0x0043, 0x14f1: 0x0045, 0x14f2: 0x0047, 0x14f3: 0x0049, 0x14f4: 0x004b, 0x14f5: 0x004d, + 0x14f6: 0x004f, 0x14f7: 0x0051, 0x14f8: 0x0053, 0x14f9: 0x0055, 0x14fa: 0x0057, 0x14fb: 0x0059, + 0x14fc: 0x005b, 0x14fd: 0x005d, 0x14fe: 0x005f, 0x14ff: 0x0061, + // Block 0x54, offset 0x1500 + 0x1500: 0x26b3, 0x1501: 0x26c8, 0x1502: 0x0506, + 0x1510: 0x0c12, 0x1511: 0x0a4a, + 0x1512: 0x08d6, 0x1513: 0x45db, 0x1514: 0x071e, 0x1515: 0x09f2, 0x1516: 0x1332, 0x1517: 0x0a02, + 0x1518: 0x072a, 0x1519: 0x0cda, 0x151a: 0x0eb2, 0x151b: 0x0cb2, 0x151c: 0x082a, 0x151d: 0x0b6e, + 0x151e: 0x07c2, 0x151f: 0x0cba, 0x1520: 0x0816, 0x1521: 0x111a, 0x1522: 0x0f86, 0x1523: 0x138e, + 0x1524: 0x09d6, 0x1525: 0x090e, 0x1526: 0x0e66, 0x1527: 0x0c1e, 0x1528: 0x0c4a, 0x1529: 0x06c2, + 0x152a: 0x06ce, 0x152b: 0x140e, 0x152c: 0x0ade, 0x152d: 0x06ea, 0x152e: 0x08f2, 0x152f: 0x0c3e, + 0x1530: 0x13b6, 0x1531: 0x0c16, 0x1532: 0x1072, 0x1533: 0x10ae, 0x1534: 0x08fa, 0x1535: 0x0e46, + 0x1536: 0x0d0e, 0x1537: 0x0d0a, 0x1538: 0x0f9a, 0x1539: 0x082e, 0x153a: 0x095a, 0x153b: 0x1446, + // Block 0x55, offset 0x1540 + 0x1540: 0x06fe, 0x1541: 0x06f6, 0x1542: 0x0706, 0x1543: 0x164a, 0x1544: 0x074a, 0x1545: 0x075a, + 0x1546: 0x075e, 0x1547: 0x0766, 0x1548: 0x076e, 0x1549: 0x0772, 0x154a: 0x077e, 0x154b: 0x0776, + 0x154c: 0x05b6, 0x154d: 0x165e, 0x154e: 0x0792, 0x154f: 0x0796, 0x1550: 0x079a, 0x1551: 0x07b6, + 0x1552: 0x164f, 0x1553: 0x05ba, 0x1554: 0x07a2, 0x1555: 0x07c2, 0x1556: 0x1659, 0x1557: 0x07d2, + 0x1558: 0x07da, 0x1559: 0x073a, 0x155a: 0x07e2, 0x155b: 0x07e6, 0x155c: 0x1834, 0x155d: 0x0802, + 0x155e: 0x080a, 0x155f: 0x05c2, 0x1560: 0x0822, 0x1561: 0x0826, 0x1562: 0x082e, 0x1563: 0x0832, + 0x1564: 0x05c6, 0x1565: 0x084a, 0x1566: 0x084e, 0x1567: 0x085a, 0x1568: 0x0866, 0x1569: 0x086a, + 0x156a: 0x086e, 0x156b: 0x0876, 0x156c: 0x0896, 0x156d: 0x089a, 0x156e: 0x08a2, 0x156f: 0x08b2, + 0x1570: 0x08ba, 0x1571: 0x08be, 0x1572: 0x08be, 0x1573: 0x08be, 0x1574: 0x166d, 0x1575: 0x0e96, + 0x1576: 0x08d2, 0x1577: 0x08da, 0x1578: 0x1672, 0x1579: 0x08e6, 0x157a: 0x08ee, 0x157b: 0x08f6, + 0x157c: 0x091e, 0x157d: 0x090a, 0x157e: 0x0916, 0x157f: 0x091a, + // Block 0x56, offset 0x1580 + 0x1580: 0x0922, 0x1581: 0x092a, 0x1582: 0x092e, 0x1583: 0x0936, 0x1584: 0x093e, 0x1585: 0x0942, + 0x1586: 0x0942, 0x1587: 0x094a, 0x1588: 0x0952, 0x1589: 0x0956, 0x158a: 0x0962, 0x158b: 0x0986, + 0x158c: 0x096a, 0x158d: 0x098a, 0x158e: 0x096e, 0x158f: 0x0976, 0x1590: 0x080e, 0x1591: 0x09d2, + 0x1592: 0x099a, 0x1593: 0x099e, 0x1594: 0x09a2, 0x1595: 0x0996, 0x1596: 0x09aa, 0x1597: 0x09a6, + 0x1598: 0x09be, 0x1599: 0x1677, 0x159a: 0x09da, 0x159b: 0x09de, 0x159c: 0x09e6, 0x159d: 0x09f2, + 0x159e: 0x09fa, 0x159f: 0x0a16, 0x15a0: 0x167c, 0x15a1: 0x1681, 0x15a2: 0x0a22, 0x15a3: 0x0a26, + 0x15a4: 0x0a2a, 0x15a5: 0x0a1e, 0x15a6: 0x0a32, 0x15a7: 0x05ca, 0x15a8: 0x05ce, 0x15a9: 0x0a3a, + 0x15aa: 0x0a42, 0x15ab: 0x0a42, 0x15ac: 0x1686, 0x15ad: 0x0a5e, 0x15ae: 0x0a62, 0x15af: 0x0a66, + 0x15b0: 0x0a6e, 0x15b1: 0x168b, 0x15b2: 0x0a76, 0x15b3: 0x0a7a, 0x15b4: 0x0b52, 0x15b5: 0x0a82, + 0x15b6: 0x05d2, 0x15b7: 0x0a8e, 0x15b8: 0x0a9e, 0x15b9: 0x0aaa, 0x15ba: 0x0aa6, 0x15bb: 0x1695, + 0x15bc: 0x0ab2, 0x15bd: 0x169a, 0x15be: 0x0abe, 0x15bf: 0x0aba, + // Block 0x57, offset 0x15c0 + 0x15c0: 0x0ac2, 0x15c1: 0x0ad2, 0x15c2: 0x0ad6, 0x15c3: 0x05d6, 0x15c4: 0x0ae6, 0x15c5: 0x0aee, + 0x15c6: 0x0af2, 0x15c7: 0x0af6, 0x15c8: 0x05da, 0x15c9: 0x169f, 0x15ca: 0x05de, 0x15cb: 0x0b12, + 0x15cc: 0x0b16, 0x15cd: 0x0b1a, 0x15ce: 0x0b22, 0x15cf: 0x1866, 0x15d0: 0x0b3a, 0x15d1: 0x16a9, + 0x15d2: 0x16a9, 0x15d3: 0x11da, 0x15d4: 0x0b4a, 0x15d5: 0x0b4a, 0x15d6: 0x05e2, 0x15d7: 0x16cc, + 0x15d8: 0x179e, 0x15d9: 0x0b5a, 0x15da: 0x0b62, 0x15db: 0x05e6, 0x15dc: 0x0b76, 0x15dd: 0x0b86, + 0x15de: 0x0b8a, 0x15df: 0x0b92, 0x15e0: 0x0ba2, 0x15e1: 0x05ee, 0x15e2: 0x05ea, 0x15e3: 0x0ba6, + 0x15e4: 0x16ae, 0x15e5: 0x0baa, 0x15e6: 0x0bbe, 0x15e7: 0x0bc2, 0x15e8: 0x0bc6, 0x15e9: 0x0bc2, + 0x15ea: 0x0bd2, 0x15eb: 0x0bd6, 0x15ec: 0x0be6, 0x15ed: 0x0bde, 0x15ee: 0x0be2, 0x15ef: 0x0bea, + 0x15f0: 0x0bee, 0x15f1: 0x0bf2, 0x15f2: 0x0bfe, 0x15f3: 0x0c02, 0x15f4: 0x0c1a, 0x15f5: 0x0c22, + 0x15f6: 0x0c32, 0x15f7: 0x0c46, 0x15f8: 0x16bd, 0x15f9: 0x0c42, 0x15fa: 0x0c36, 0x15fb: 0x0c4e, + 0x15fc: 0x0c56, 0x15fd: 0x0c6a, 0x15fe: 0x16c2, 0x15ff: 0x0c72, + // Block 0x58, offset 0x1600 + 0x1600: 0x0c66, 0x1601: 0x0c5e, 0x1602: 0x05f2, 0x1603: 0x0c7a, 0x1604: 0x0c82, 0x1605: 0x0c8a, + 0x1606: 0x0c7e, 0x1607: 0x05f6, 0x1608: 0x0c9a, 0x1609: 0x0ca2, 0x160a: 0x16c7, 0x160b: 0x0cce, + 0x160c: 0x0d02, 0x160d: 0x0cde, 0x160e: 0x0602, 0x160f: 0x0cea, 0x1610: 0x05fe, 0x1611: 0x05fa, + 0x1612: 0x07c6, 0x1613: 0x07ca, 0x1614: 0x0d06, 0x1615: 0x0cee, 0x1616: 0x11ae, 0x1617: 0x0666, + 0x1618: 0x0d12, 0x1619: 0x0d16, 0x161a: 0x0d1a, 0x161b: 0x0d2e, 0x161c: 0x0d26, 0x161d: 0x16e0, + 0x161e: 0x0606, 0x161f: 0x0d42, 0x1620: 0x0d36, 0x1621: 0x0d52, 0x1622: 0x0d5a, 0x1623: 0x16ea, + 0x1624: 0x0d5e, 0x1625: 0x0d4a, 0x1626: 0x0d66, 0x1627: 0x060a, 0x1628: 0x0d6a, 0x1629: 0x0d6e, + 0x162a: 0x0d72, 0x162b: 0x0d7e, 0x162c: 0x16ef, 0x162d: 0x0d86, 0x162e: 0x060e, 0x162f: 0x0d92, + 0x1630: 0x16f4, 0x1631: 0x0d96, 0x1632: 0x0612, 0x1633: 0x0da2, 0x1634: 0x0dae, 0x1635: 0x0dba, + 0x1636: 0x0dbe, 0x1637: 0x16f9, 0x1638: 0x1690, 0x1639: 0x16fe, 0x163a: 0x0dde, 0x163b: 0x1703, + 0x163c: 0x0dea, 0x163d: 0x0df2, 0x163e: 0x0de2, 0x163f: 0x0dfe, + // Block 0x59, offset 0x1640 + 0x1640: 0x0e0e, 0x1641: 0x0e1e, 0x1642: 0x0e12, 0x1643: 0x0e16, 0x1644: 0x0e22, 0x1645: 0x0e26, + 0x1646: 0x1708, 0x1647: 0x0e0a, 0x1648: 0x0e3e, 0x1649: 0x0e42, 0x164a: 0x0616, 0x164b: 0x0e56, + 0x164c: 0x0e52, 0x164d: 0x170d, 0x164e: 0x0e36, 0x164f: 0x0e72, 0x1650: 0x1712, 0x1651: 0x1717, + 0x1652: 0x0e76, 0x1653: 0x0e8a, 0x1654: 0x0e86, 0x1655: 0x0e82, 0x1656: 0x061a, 0x1657: 0x0e8e, + 0x1658: 0x0e9e, 0x1659: 0x0e9a, 0x165a: 0x0ea6, 0x165b: 0x1654, 0x165c: 0x0eb6, 0x165d: 0x171c, + 0x165e: 0x0ec2, 0x165f: 0x1726, 0x1660: 0x0ed6, 0x1661: 0x0ee2, 0x1662: 0x0ef6, 0x1663: 0x172b, + 0x1664: 0x0f0a, 0x1665: 0x0f0e, 0x1666: 0x1730, 0x1667: 0x1735, 0x1668: 0x0f2a, 0x1669: 0x0f3a, + 0x166a: 0x061e, 0x166b: 0x0f3e, 0x166c: 0x0622, 0x166d: 0x0622, 0x166e: 0x0f56, 0x166f: 0x0f5a, + 0x1670: 0x0f62, 0x1671: 0x0f66, 0x1672: 0x0f72, 0x1673: 0x0626, 0x1674: 0x0f8a, 0x1675: 0x173a, + 0x1676: 0x0fa6, 0x1677: 0x173f, 0x1678: 0x0fb2, 0x1679: 0x16a4, 0x167a: 0x0fc2, 0x167b: 0x1744, + 0x167c: 0x1749, 0x167d: 0x174e, 0x167e: 0x062a, 0x167f: 0x062e, + // Block 0x5a, offset 0x1680 + 0x1680: 0x0ffa, 0x1681: 0x1758, 0x1682: 0x1753, 0x1683: 0x175d, 0x1684: 0x1762, 0x1685: 0x1002, + 0x1686: 0x1006, 0x1687: 0x1006, 0x1688: 0x100e, 0x1689: 0x0636, 0x168a: 0x1012, 0x168b: 0x063a, + 0x168c: 0x063e, 0x168d: 0x176c, 0x168e: 0x1026, 0x168f: 0x102e, 0x1690: 0x103a, 0x1691: 0x0642, + 0x1692: 0x1771, 0x1693: 0x105e, 0x1694: 0x1776, 0x1695: 0x177b, 0x1696: 0x107e, 0x1697: 0x1096, + 0x1698: 0x0646, 0x1699: 0x109e, 0x169a: 0x10a2, 0x169b: 0x10a6, 0x169c: 0x1780, 0x169d: 0x1785, + 0x169e: 0x1785, 0x169f: 0x10be, 0x16a0: 0x064a, 0x16a1: 0x178a, 0x16a2: 0x10d2, 0x16a3: 0x10d6, + 0x16a4: 0x064e, 0x16a5: 0x178f, 0x16a6: 0x10f2, 0x16a7: 0x0652, 0x16a8: 0x1102, 0x16a9: 0x10fa, + 0x16aa: 0x110a, 0x16ab: 0x1799, 0x16ac: 0x1122, 0x16ad: 0x0656, 0x16ae: 0x112e, 0x16af: 0x1136, + 0x16b0: 0x1146, 0x16b1: 0x065a, 0x16b2: 0x17a3, 0x16b3: 0x17a8, 0x16b4: 0x065e, 0x16b5: 0x17ad, + 0x16b6: 0x115e, 0x16b7: 0x17b2, 0x16b8: 0x116a, 0x16b9: 0x1176, 0x16ba: 0x117e, 0x16bb: 0x17b7, + 0x16bc: 0x17bc, 0x16bd: 0x1192, 0x16be: 0x17c1, 0x16bf: 0x119a, + // Block 0x5b, offset 0x16c0 + 0x16c0: 0x16d1, 0x16c1: 0x0662, 0x16c2: 0x11b2, 0x16c3: 0x11b6, 0x16c4: 0x066a, 0x16c5: 0x11ba, + 0x16c6: 0x0a36, 0x16c7: 0x17c6, 0x16c8: 0x17cb, 0x16c9: 0x16d6, 0x16ca: 0x16db, 0x16cb: 0x11da, + 0x16cc: 0x11de, 0x16cd: 0x13f6, 0x16ce: 0x066e, 0x16cf: 0x120a, 0x16d0: 0x1206, 0x16d1: 0x120e, + 0x16d2: 0x0842, 0x16d3: 0x1212, 0x16d4: 0x1216, 0x16d5: 0x121a, 0x16d6: 0x1222, 0x16d7: 0x17d0, + 0x16d8: 0x121e, 0x16d9: 0x1226, 0x16da: 0x123a, 0x16db: 0x123e, 0x16dc: 0x122a, 0x16dd: 0x1242, + 0x16de: 0x1256, 0x16df: 0x126a, 0x16e0: 0x1236, 0x16e1: 0x124a, 0x16e2: 0x124e, 0x16e3: 0x1252, + 0x16e4: 0x17d5, 0x16e5: 0x17df, 0x16e6: 0x17da, 0x16e7: 0x0672, 0x16e8: 0x1272, 0x16e9: 0x1276, + 0x16ea: 0x127e, 0x16eb: 0x17f3, 0x16ec: 0x1282, 0x16ed: 0x17e4, 0x16ee: 0x0676, 0x16ef: 0x067a, + 0x16f0: 0x17e9, 0x16f1: 0x17ee, 0x16f2: 0x067e, 0x16f3: 0x12a2, 0x16f4: 0x12a6, 0x16f5: 0x12aa, + 0x16f6: 0x12ae, 0x16f7: 0x12ba, 0x16f8: 0x12b6, 0x16f9: 0x12c2, 0x16fa: 0x12be, 0x16fb: 0x12ce, + 0x16fc: 0x12c6, 0x16fd: 0x12ca, 0x16fe: 0x12d2, 0x16ff: 0x0682, + // Block 0x5c, offset 0x1700 + 0x1700: 0x12da, 0x1701: 0x12de, 0x1702: 0x0686, 0x1703: 0x12ee, 0x1704: 0x12f2, 0x1705: 0x17f8, + 0x1706: 0x12fe, 0x1707: 0x1302, 0x1708: 0x068a, 0x1709: 0x130e, 0x170a: 0x05be, 0x170b: 0x17fd, + 0x170c: 0x1802, 0x170d: 0x068e, 0x170e: 0x0692, 0x170f: 0x133a, 0x1710: 0x1352, 0x1711: 0x136e, + 0x1712: 0x137e, 0x1713: 0x1807, 0x1714: 0x1392, 0x1715: 0x1396, 0x1716: 0x13ae, 0x1717: 0x13ba, + 0x1718: 0x1811, 0x1719: 0x1663, 0x171a: 0x13c6, 0x171b: 0x13c2, 0x171c: 0x13ce, 0x171d: 0x1668, + 0x171e: 0x13da, 0x171f: 0x13e6, 0x1720: 0x1816, 0x1721: 0x181b, 0x1722: 0x1426, 0x1723: 0x1432, + 0x1724: 0x143a, 0x1725: 0x1820, 0x1726: 0x143e, 0x1727: 0x146a, 0x1728: 0x1476, 0x1729: 0x147a, + 0x172a: 0x1472, 0x172b: 0x1486, 0x172c: 0x148a, 0x172d: 0x1825, 0x172e: 0x1496, 0x172f: 0x0696, + 0x1730: 0x149e, 0x1731: 0x182a, 0x1732: 0x069a, 0x1733: 0x14d6, 0x1734: 0x0ac6, 0x1735: 0x14ee, + 0x1736: 0x182f, 0x1737: 0x1839, 0x1738: 0x069e, 0x1739: 0x06a2, 0x173a: 0x1516, 0x173b: 0x183e, + 0x173c: 0x06a6, 0x173d: 0x1843, 0x173e: 0x152e, 0x173f: 0x152e, + // Block 0x5d, offset 0x1740 + 0x1740: 0x1536, 0x1741: 0x1848, 0x1742: 0x154e, 0x1743: 0x06aa, 0x1744: 0x155e, 0x1745: 0x156a, + 0x1746: 0x1572, 0x1747: 0x157a, 0x1748: 0x06ae, 0x1749: 0x184d, 0x174a: 0x158e, 0x174b: 0x15aa, + 0x174c: 0x15b6, 0x174d: 0x06b2, 0x174e: 0x06b6, 0x174f: 0x15ba, 0x1750: 0x1852, 0x1751: 0x06ba, + 0x1752: 0x1857, 0x1753: 0x185c, 0x1754: 0x1861, 0x1755: 0x15de, 0x1756: 0x06be, 0x1757: 0x15f2, + 0x1758: 0x15fa, 0x1759: 0x15fe, 0x175a: 0x1606, 0x175b: 0x160e, 0x175c: 0x1616, 0x175d: 0x186b, +} + +// nfkcIndex: 22 blocks, 1408 entries, 2816 bytes +// Block 0 is the zero block. +var nfkcIndex = [1408]uint16{ + // Block 0x0, offset 0x0 + // Block 0x1, offset 0x40 + // Block 0x2, offset 0x80 + // Block 0x3, offset 0xc0 + 0xc2: 0x5c, 0xc3: 0x01, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x5d, 0xc7: 0x04, + 0xc8: 0x05, 0xca: 0x5e, 0xcb: 0x5f, 0xcc: 0x06, 0xcd: 0x07, 0xce: 0x08, 0xcf: 0x09, + 0xd0: 0x0a, 0xd1: 0x60, 0xd2: 0x61, 0xd3: 0x0b, 0xd6: 0x0c, 0xd7: 0x62, + 0xd8: 0x63, 0xd9: 0x0d, 0xdb: 0x64, 0xdc: 0x65, 0xdd: 0x66, 0xdf: 0x67, + 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, + 0xea: 0x06, 0xeb: 0x07, 0xec: 0x08, 0xed: 0x09, 0xef: 0x0a, + 0xf0: 0x13, + // Block 0x4, offset 0x100 + 0x120: 0x68, 0x121: 0x69, 0x123: 0x0e, 0x124: 0x6a, 0x125: 0x6b, 0x126: 0x6c, 0x127: 0x6d, + 0x128: 0x6e, 0x129: 0x6f, 0x12a: 0x70, 0x12b: 0x71, 0x12c: 0x6c, 0x12d: 0x72, 0x12e: 0x73, 0x12f: 0x74, + 0x131: 0x75, 0x132: 0x76, 0x133: 0x77, 0x134: 0x78, 0x135: 0x79, 0x137: 0x7a, + 0x138: 0x7b, 0x139: 0x7c, 0x13a: 0x7d, 0x13b: 0x7e, 0x13c: 0x7f, 0x13d: 0x80, 0x13e: 0x81, 0x13f: 0x82, + // Block 0x5, offset 0x140 + 0x140: 0x83, 0x142: 0x84, 0x143: 0x85, 0x144: 0x86, 0x145: 0x87, 0x146: 0x88, 0x147: 0x89, + 0x14d: 0x8a, + 0x15c: 0x8b, 0x15f: 0x8c, + 0x162: 0x8d, 0x164: 0x8e, + 0x168: 0x8f, 0x169: 0x90, 0x16a: 0x91, 0x16b: 0x92, 0x16c: 0x0f, 0x16d: 0x93, 0x16e: 0x94, 0x16f: 0x95, + 0x170: 0x96, 0x173: 0x97, 0x174: 0x98, 0x175: 0x10, 0x176: 0x11, 0x177: 0x12, + 0x178: 0x13, 0x179: 0x14, 0x17a: 0x15, 0x17b: 0x16, 0x17c: 0x17, 0x17d: 0x18, 0x17e: 0x19, 0x17f: 0x1a, + // Block 0x6, offset 0x180 + 0x180: 0x99, 0x181: 0x9a, 0x182: 0x9b, 0x183: 0x9c, 0x184: 0x1b, 0x185: 0x1c, 0x186: 0x9d, 0x187: 0x9e, + 0x188: 0x9f, 0x189: 0x1d, 0x18a: 0x1e, 0x18b: 0xa0, 0x18c: 0xa1, + 0x191: 0x1f, 0x192: 0x20, 0x193: 0xa2, + 0x1a8: 0xa3, 0x1a9: 0xa4, 0x1ab: 0xa5, + 0x1b1: 0xa6, 0x1b3: 0xa7, 0x1b5: 0xa8, 0x1b7: 0xa9, + 0x1ba: 0xaa, 0x1bb: 0xab, 0x1bc: 0x21, 0x1bd: 0x22, 0x1be: 0x23, 0x1bf: 0xac, + // Block 0x7, offset 0x1c0 + 0x1c0: 0xad, 0x1c1: 0x24, 0x1c2: 0x25, 0x1c3: 0x26, 0x1c4: 0xae, 0x1c5: 0x27, 0x1c6: 0x28, + 0x1c8: 0x29, 0x1c9: 0x2a, 0x1ca: 0x2b, 0x1cb: 0x2c, 0x1cc: 0x2d, 0x1cd: 0x2e, 0x1ce: 0x2f, 0x1cf: 0x30, + // Block 0x8, offset 0x200 + 0x219: 0xaf, 0x21a: 0xb0, 0x21b: 0xb1, 0x21d: 0xb2, 0x21f: 0xb3, + 0x220: 0xb4, 0x223: 0xb5, 0x224: 0xb6, 0x225: 0xb7, 0x226: 0xb8, 0x227: 0xb9, + 0x22a: 0xba, 0x22b: 0xbb, 0x22d: 0xbc, 0x22f: 0xbd, + 0x230: 0xbe, 0x231: 0xbf, 0x232: 0xc0, 0x233: 0xc1, 0x234: 0xc2, 0x235: 0xc3, 0x236: 0xc4, 0x237: 0xbe, + 0x238: 0xbf, 0x239: 0xc0, 0x23a: 0xc1, 0x23b: 0xc2, 0x23c: 0xc3, 0x23d: 0xc4, 0x23e: 0xbe, 0x23f: 0xbf, + // Block 0x9, offset 0x240 + 0x240: 0xc0, 0x241: 0xc1, 0x242: 0xc2, 0x243: 0xc3, 0x244: 0xc4, 0x245: 0xbe, 0x246: 0xbf, 0x247: 0xc0, + 0x248: 0xc1, 0x249: 0xc2, 0x24a: 0xc3, 0x24b: 0xc4, 0x24c: 0xbe, 0x24d: 0xbf, 0x24e: 0xc0, 0x24f: 0xc1, + 0x250: 0xc2, 0x251: 0xc3, 0x252: 0xc4, 0x253: 0xbe, 0x254: 0xbf, 0x255: 0xc0, 0x256: 0xc1, 0x257: 0xc2, + 0x258: 0xc3, 0x259: 0xc4, 0x25a: 0xbe, 0x25b: 0xbf, 0x25c: 0xc0, 0x25d: 0xc1, 0x25e: 0xc2, 0x25f: 0xc3, + 0x260: 0xc4, 0x261: 0xbe, 0x262: 0xbf, 0x263: 0xc0, 0x264: 0xc1, 0x265: 0xc2, 0x266: 0xc3, 0x267: 0xc4, + 0x268: 0xbe, 0x269: 0xbf, 0x26a: 0xc0, 0x26b: 0xc1, 0x26c: 0xc2, 0x26d: 0xc3, 0x26e: 0xc4, 0x26f: 0xbe, + 0x270: 0xbf, 0x271: 0xc0, 0x272: 0xc1, 0x273: 0xc2, 0x274: 0xc3, 0x275: 0xc4, 0x276: 0xbe, 0x277: 0xbf, + 0x278: 0xc0, 0x279: 0xc1, 0x27a: 0xc2, 0x27b: 0xc3, 0x27c: 0xc4, 0x27d: 0xbe, 0x27e: 0xbf, 0x27f: 0xc0, + // Block 0xa, offset 0x280 + 0x280: 0xc1, 0x281: 0xc2, 0x282: 0xc3, 0x283: 0xc4, 0x284: 0xbe, 0x285: 0xbf, 0x286: 0xc0, 0x287: 0xc1, + 0x288: 0xc2, 0x289: 0xc3, 0x28a: 0xc4, 0x28b: 0xbe, 0x28c: 0xbf, 0x28d: 0xc0, 0x28e: 0xc1, 0x28f: 0xc2, + 0x290: 0xc3, 0x291: 0xc4, 0x292: 0xbe, 0x293: 0xbf, 0x294: 0xc0, 0x295: 0xc1, 0x296: 0xc2, 0x297: 0xc3, + 0x298: 0xc4, 0x299: 0xbe, 0x29a: 0xbf, 0x29b: 0xc0, 0x29c: 0xc1, 0x29d: 0xc2, 0x29e: 0xc3, 0x29f: 0xc4, + 0x2a0: 0xbe, 0x2a1: 0xbf, 0x2a2: 0xc0, 0x2a3: 0xc1, 0x2a4: 0xc2, 0x2a5: 0xc3, 0x2a6: 0xc4, 0x2a7: 0xbe, + 0x2a8: 0xbf, 0x2a9: 0xc0, 0x2aa: 0xc1, 0x2ab: 0xc2, 0x2ac: 0xc3, 0x2ad: 0xc4, 0x2ae: 0xbe, 0x2af: 0xbf, + 0x2b0: 0xc0, 0x2b1: 0xc1, 0x2b2: 0xc2, 0x2b3: 0xc3, 0x2b4: 0xc4, 0x2b5: 0xbe, 0x2b6: 0xbf, 0x2b7: 0xc0, + 0x2b8: 0xc1, 0x2b9: 0xc2, 0x2ba: 0xc3, 0x2bb: 0xc4, 0x2bc: 0xbe, 0x2bd: 0xbf, 0x2be: 0xc0, 0x2bf: 0xc1, + // Block 0xb, offset 0x2c0 + 0x2c0: 0xc2, 0x2c1: 0xc3, 0x2c2: 0xc4, 0x2c3: 0xbe, 0x2c4: 0xbf, 0x2c5: 0xc0, 0x2c6: 0xc1, 0x2c7: 0xc2, + 0x2c8: 0xc3, 0x2c9: 0xc4, 0x2ca: 0xbe, 0x2cb: 0xbf, 0x2cc: 0xc0, 0x2cd: 0xc1, 0x2ce: 0xc2, 0x2cf: 0xc3, + 0x2d0: 0xc4, 0x2d1: 0xbe, 0x2d2: 0xbf, 0x2d3: 0xc0, 0x2d4: 0xc1, 0x2d5: 0xc2, 0x2d6: 0xc3, 0x2d7: 0xc4, + 0x2d8: 0xbe, 0x2d9: 0xbf, 0x2da: 0xc0, 0x2db: 0xc1, 0x2dc: 0xc2, 0x2dd: 0xc3, 0x2de: 0xc5, + // Block 0xc, offset 0x300 + 0x324: 0x31, 0x325: 0x32, 0x326: 0x33, 0x327: 0x34, + 0x328: 0x35, 0x329: 0x36, 0x32a: 0x37, 0x32b: 0x38, 0x32c: 0x39, 0x32d: 0x3a, 0x32e: 0x3b, 0x32f: 0x3c, + 0x330: 0x3d, 0x331: 0x3e, 0x332: 0x3f, 0x333: 0x40, 0x334: 0x41, 0x335: 0x42, 0x336: 0x43, 0x337: 0x44, + 0x338: 0x45, 0x339: 0x46, 0x33a: 0x47, 0x33b: 0x48, 0x33c: 0xc6, 0x33d: 0x49, 0x33e: 0x4a, 0x33f: 0x4b, + // Block 0xd, offset 0x340 + 0x347: 0xc7, + 0x34b: 0xc8, 0x34d: 0xc9, + 0x368: 0xca, 0x36b: 0xcb, + 0x374: 0xcc, + 0x37a: 0xcd, 0x37d: 0xce, + // Block 0xe, offset 0x380 + 0x381: 0xcf, 0x382: 0xd0, 0x384: 0xd1, 0x385: 0xb8, 0x387: 0xd2, + 0x388: 0xd3, 0x38b: 0xd4, 0x38c: 0xd5, 0x38d: 0xd6, + 0x391: 0xd7, 0x392: 0xd8, 0x393: 0xd9, 0x396: 0xda, 0x397: 0xdb, + 0x398: 0xdc, 0x39a: 0xdd, 0x39c: 0xde, + 0x3a0: 0xdf, 0x3a4: 0xe0, 0x3a5: 0xe1, 0x3a7: 0xe2, + 0x3a8: 0xe3, 0x3a9: 0xe4, 0x3aa: 0xe5, + 0x3b0: 0xdc, 0x3b5: 0xe6, 0x3b6: 0xe7, + // Block 0xf, offset 0x3c0 + 0x3eb: 0xe8, 0x3ec: 0xe9, + 0x3ff: 0xea, + // Block 0x10, offset 0x400 + 0x432: 0xeb, + // Block 0x11, offset 0x440 + 0x445: 0xec, 0x446: 0xed, 0x447: 0xee, + 0x449: 0xef, + 0x450: 0xf0, 0x451: 0xf1, 0x452: 0xf2, 0x453: 0xf3, 0x454: 0xf4, 0x455: 0xf5, 0x456: 0xf6, 0x457: 0xf7, + 0x458: 0xf8, 0x459: 0xf9, 0x45a: 0x4c, 0x45b: 0xfa, 0x45c: 0xfb, 0x45d: 0xfc, 0x45e: 0xfd, 0x45f: 0x4d, + // Block 0x12, offset 0x480 + 0x480: 0xfe, 0x484: 0xe9, + 0x48b: 0xff, + 0x4a3: 0x100, 0x4a5: 0x101, + 0x4b8: 0x4e, 0x4b9: 0x4f, 0x4ba: 0x50, + // Block 0x13, offset 0x4c0 + 0x4c4: 0x51, 0x4c5: 0x102, 0x4c6: 0x103, + 0x4c8: 0x52, 0x4c9: 0x104, + 0x4ef: 0x105, + // Block 0x14, offset 0x500 + 0x520: 0x53, 0x521: 0x54, 0x522: 0x55, 0x523: 0x56, 0x524: 0x57, 0x525: 0x58, 0x526: 0x59, 0x527: 0x5a, + 0x528: 0x5b, + // Block 0x15, offset 0x540 + 0x550: 0x0b, 0x551: 0x0c, 0x556: 0x0d, + 0x55b: 0x0e, 0x55d: 0x0f, 0x55e: 0x10, 0x55f: 0x11, + 0x56f: 0x12, +} + +// nfkcSparseOffset: 170 entries, 340 bytes +var nfkcSparseOffset = []uint16{0x0, 0xe, 0x12, 0x1b, 0x25, 0x35, 0x37, 0x3c, 0x47, 0x56, 0x63, 0x6b, 0x70, 0x75, 0x77, 0x7f, 0x86, 0x89, 0x91, 0x95, 0x99, 0x9b, 0x9d, 0xa6, 0xaa, 0xb1, 0xb6, 0xb9, 0xc3, 0xc6, 0xcd, 0xd5, 0xd9, 0xdb, 0xdf, 0xe3, 0xe9, 0xfa, 0x106, 0x108, 0x10e, 0x110, 0x112, 0x114, 0x116, 0x118, 0x11a, 0x11c, 0x11f, 0x122, 0x124, 0x127, 0x12a, 0x12e, 0x134, 0x136, 0x13f, 0x141, 0x144, 0x146, 0x151, 0x15c, 0x16a, 0x178, 0x188, 0x196, 0x19d, 0x1a3, 0x1b2, 0x1b6, 0x1b8, 0x1bc, 0x1be, 0x1c1, 0x1c3, 0x1c6, 0x1c8, 0x1cb, 0x1cd, 0x1cf, 0x1d1, 0x1dd, 0x1e7, 0x1f1, 0x1f4, 0x1f8, 0x1fa, 0x1fc, 0x1fe, 0x201, 0x204, 0x206, 0x208, 0x20a, 0x20c, 0x212, 0x215, 0x21a, 0x21c, 0x223, 0x229, 0x22f, 0x237, 0x23d, 0x243, 0x249, 0x24d, 0x24f, 0x251, 0x253, 0x255, 0x25b, 0x25e, 0x260, 0x262, 0x268, 0x26b, 0x273, 0x27a, 0x27d, 0x280, 0x282, 0x285, 0x28d, 0x291, 0x298, 0x29b, 0x2a1, 0x2a3, 0x2a5, 0x2a8, 0x2aa, 0x2ad, 0x2b2, 0x2b4, 0x2b6, 0x2b8, 0x2ba, 0x2bc, 0x2bf, 0x2c1, 0x2c3, 0x2c5, 0x2c7, 0x2c9, 0x2d6, 0x2e0, 0x2e2, 0x2e4, 0x2e8, 0x2ed, 0x2f9, 0x2fe, 0x307, 0x30d, 0x312, 0x316, 0x31b, 0x31f, 0x32f, 0x33d, 0x34b, 0x359, 0x35f, 0x361, 0x363, 0x366, 0x371, 0x373, 0x37d} + +// nfkcSparseValues: 895 entries, 3580 bytes +var nfkcSparseValues = [895]valueRange{ + // Block 0x0, offset 0x0 + {value: 0x0002, lo: 0x0d}, + {value: 0x0001, lo: 0xa0, hi: 0xa0}, + {value: 0x428f, lo: 0xa8, hi: 0xa8}, + {value: 0x0083, lo: 0xaa, hi: 0xaa}, + {value: 0x427b, lo: 0xaf, hi: 0xaf}, + {value: 0x0025, lo: 0xb2, hi: 0xb3}, + {value: 0x4271, lo: 0xb4, hi: 0xb4}, + {value: 0x01df, lo: 0xb5, hi: 0xb5}, + {value: 0x42a8, lo: 0xb8, hi: 0xb8}, + {value: 0x0023, lo: 0xb9, hi: 0xb9}, + {value: 0x009f, lo: 0xba, hi: 0xba}, + {value: 0x2222, lo: 0xbc, hi: 0xbc}, + {value: 0x2216, lo: 0xbd, hi: 0xbd}, + {value: 0x22b8, lo: 0xbe, hi: 0xbe}, + // Block 0x1, offset 0xe + {value: 0x0091, lo: 0x03}, + {value: 0x46f9, lo: 0xa0, hi: 0xa1}, + {value: 0x472b, lo: 0xaf, hi: 0xb0}, + {value: 0xa000, lo: 0xb7, hi: 0xb7}, + // Block 0x2, offset 0x12 + {value: 0x0003, lo: 0x08}, + {value: 0xa000, lo: 0x92, hi: 0x92}, + {value: 0x0091, lo: 0xb0, hi: 0xb0}, + {value: 0x0119, lo: 0xb1, hi: 0xb1}, + {value: 0x0095, lo: 0xb2, hi: 0xb2}, + {value: 0x00a5, lo: 0xb3, hi: 0xb3}, + {value: 0x0143, lo: 0xb4, hi: 0xb6}, + {value: 0x00af, lo: 0xb7, hi: 0xb7}, + {value: 0x00b3, lo: 0xb8, hi: 0xb8}, + // Block 0x3, offset 0x1b + {value: 0x000a, lo: 0x09}, + {value: 0x4285, lo: 0x98, hi: 0x98}, + {value: 0x428a, lo: 0x99, hi: 0x9a}, + {value: 0x42ad, lo: 0x9b, hi: 0x9b}, + {value: 0x4276, lo: 0x9c, hi: 0x9c}, + {value: 0x4299, lo: 0x9d, hi: 0x9d}, + {value: 0x0113, lo: 0xa0, hi: 0xa0}, + {value: 0x0099, lo: 0xa1, hi: 0xa1}, + {value: 0x00a7, lo: 0xa2, hi: 0xa3}, + {value: 0x016a, lo: 0xa4, hi: 0xa4}, + // Block 0x4, offset 0x25 + {value: 0x0000, lo: 0x0f}, + {value: 0xa000, lo: 0x83, hi: 0x83}, + {value: 0xa000, lo: 0x87, hi: 0x87}, + {value: 0xa000, lo: 0x8b, hi: 0x8b}, + {value: 0xa000, lo: 0x8d, hi: 0x8d}, + {value: 0x37bc, lo: 0x90, hi: 0x90}, + {value: 0x37c8, lo: 0x91, hi: 0x91}, + {value: 0x37b6, lo: 0x93, hi: 0x93}, + {value: 0xa000, lo: 0x96, hi: 0x96}, + {value: 0x382e, lo: 0x97, hi: 0x97}, + {value: 0x37f8, lo: 0x9c, hi: 0x9c}, + {value: 0x37e0, lo: 0x9d, hi: 0x9d}, + {value: 0x380a, lo: 0x9e, hi: 0x9e}, + {value: 0xa000, lo: 0xb4, hi: 0xb5}, + {value: 0x3834, lo: 0xb6, hi: 0xb6}, + {value: 0x383a, lo: 0xb7, hi: 0xb7}, + // Block 0x5, offset 0x35 + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0x83, hi: 0x87}, + // Block 0x6, offset 0x37 + {value: 0x0001, lo: 0x04}, + {value: 0x8114, lo: 0x81, hi: 0x82}, + {value: 0x8133, lo: 0x84, hi: 0x84}, + {value: 0x812e, lo: 0x85, hi: 0x85}, + {value: 0x810e, lo: 0x87, hi: 0x87}, + // Block 0x7, offset 0x3c + {value: 0x0000, lo: 0x0a}, + {value: 0x8133, lo: 0x90, hi: 0x97}, + {value: 0x811a, lo: 0x98, hi: 0x98}, + {value: 0x811b, lo: 0x99, hi: 0x99}, + {value: 0x811c, lo: 0x9a, hi: 0x9a}, + {value: 0x3858, lo: 0xa2, hi: 0xa2}, + {value: 0x385e, lo: 0xa3, hi: 0xa3}, + {value: 0x386a, lo: 0xa4, hi: 0xa4}, + {value: 0x3864, lo: 0xa5, hi: 0xa5}, + {value: 0x3870, lo: 0xa6, hi: 0xa6}, + {value: 0xa000, lo: 0xa7, hi: 0xa7}, + // Block 0x8, offset 0x47 + {value: 0x0000, lo: 0x0e}, + {value: 0x3882, lo: 0x80, hi: 0x80}, + {value: 0xa000, lo: 0x81, hi: 0x81}, + {value: 0x3876, lo: 0x82, hi: 0x82}, + {value: 0xa000, lo: 0x92, hi: 0x92}, + {value: 0x387c, lo: 0x93, hi: 0x93}, + {value: 0xa000, lo: 0x95, hi: 0x95}, + {value: 0x8133, lo: 0x96, hi: 0x9c}, + {value: 0x8133, lo: 0x9f, hi: 0xa2}, + {value: 0x812e, lo: 0xa3, hi: 0xa3}, + {value: 0x8133, lo: 0xa4, hi: 0xa4}, + {value: 0x8133, lo: 0xa7, hi: 0xa8}, + {value: 0x812e, lo: 0xaa, hi: 0xaa}, + {value: 0x8133, lo: 0xab, hi: 0xac}, + {value: 0x812e, lo: 0xad, hi: 0xad}, + // Block 0x9, offset 0x56 + {value: 0x0000, lo: 0x0c}, + {value: 0x8120, lo: 0x91, hi: 0x91}, + {value: 0x8133, lo: 0xb0, hi: 0xb0}, + {value: 0x812e, lo: 0xb1, hi: 0xb1}, + {value: 0x8133, lo: 0xb2, hi: 0xb3}, + {value: 0x812e, lo: 0xb4, hi: 0xb4}, + {value: 0x8133, lo: 0xb5, hi: 0xb6}, + {value: 0x812e, lo: 0xb7, hi: 0xb9}, + {value: 0x8133, lo: 0xba, hi: 0xba}, + {value: 0x812e, lo: 0xbb, hi: 0xbc}, + {value: 0x8133, lo: 0xbd, hi: 0xbd}, + {value: 0x812e, lo: 0xbe, hi: 0xbe}, + {value: 0x8133, lo: 0xbf, hi: 0xbf}, + // Block 0xa, offset 0x63 + {value: 0x0005, lo: 0x07}, + {value: 0x8133, lo: 0x80, hi: 0x80}, + {value: 0x8133, lo: 0x81, hi: 0x81}, + {value: 0x812e, lo: 0x82, hi: 0x83}, + {value: 0x812e, lo: 0x84, hi: 0x85}, + {value: 0x812e, lo: 0x86, hi: 0x87}, + {value: 0x812e, lo: 0x88, hi: 0x89}, + {value: 0x8133, lo: 0x8a, hi: 0x8a}, + // Block 0xb, offset 0x6b + {value: 0x0000, lo: 0x04}, + {value: 0x8133, lo: 0xab, hi: 0xb1}, + {value: 0x812e, lo: 0xb2, hi: 0xb2}, + {value: 0x8133, lo: 0xb3, hi: 0xb3}, + {value: 0x812e, lo: 0xbd, hi: 0xbd}, + // Block 0xc, offset 0x70 + {value: 0x0000, lo: 0x04}, + {value: 0x8133, lo: 0x96, hi: 0x99}, + {value: 0x8133, lo: 0x9b, hi: 0xa3}, + {value: 0x8133, lo: 0xa5, hi: 0xa7}, + {value: 0x8133, lo: 0xa9, hi: 0xad}, + // Block 0xd, offset 0x75 + {value: 0x0000, lo: 0x01}, + {value: 0x812e, lo: 0x99, hi: 0x9b}, + // Block 0xe, offset 0x77 + {value: 0x0000, lo: 0x07}, + {value: 0xa000, lo: 0xa8, hi: 0xa8}, + {value: 0x3eef, lo: 0xa9, hi: 0xa9}, + {value: 0xa000, lo: 0xb0, hi: 0xb0}, + {value: 0x3ef7, lo: 0xb1, hi: 0xb1}, + {value: 0xa000, lo: 0xb3, hi: 0xb3}, + {value: 0x3eff, lo: 0xb4, hi: 0xb4}, + {value: 0x9903, lo: 0xbc, hi: 0xbc}, + // Block 0xf, offset 0x7f + {value: 0x0008, lo: 0x06}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x8133, lo: 0x91, hi: 0x91}, + {value: 0x812e, lo: 0x92, hi: 0x92}, + {value: 0x8133, lo: 0x93, hi: 0x93}, + {value: 0x8133, lo: 0x94, hi: 0x94}, + {value: 0x4533, lo: 0x98, hi: 0x9f}, + // Block 0x10, offset 0x86 + {value: 0x0000, lo: 0x02}, + {value: 0x8103, lo: 0xbc, hi: 0xbc}, + {value: 0x9900, lo: 0xbe, hi: 0xbe}, + // Block 0x11, offset 0x89 + {value: 0x0008, lo: 0x07}, + {value: 0xa000, lo: 0x87, hi: 0x87}, + {value: 0x2cab, lo: 0x8b, hi: 0x8c}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x9900, lo: 0x97, hi: 0x97}, + {value: 0x4573, lo: 0x9c, hi: 0x9d}, + {value: 0x4583, lo: 0x9f, hi: 0x9f}, + {value: 0x8133, lo: 0xbe, hi: 0xbe}, + // Block 0x12, offset 0x91 + {value: 0x0000, lo: 0x03}, + {value: 0x45ab, lo: 0xb3, hi: 0xb3}, + {value: 0x45b3, lo: 0xb6, hi: 0xb6}, + {value: 0x8103, lo: 0xbc, hi: 0xbc}, + // Block 0x13, offset 0x95 + {value: 0x0008, lo: 0x03}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x458b, lo: 0x99, hi: 0x9b}, + {value: 0x45a3, lo: 0x9e, hi: 0x9e}, + // Block 0x14, offset 0x99 + {value: 0x0000, lo: 0x01}, + {value: 0x8103, lo: 0xbc, hi: 0xbc}, + // Block 0x15, offset 0x9b + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + // Block 0x16, offset 0x9d + {value: 0x0000, lo: 0x08}, + {value: 0xa000, lo: 0x87, hi: 0x87}, + {value: 0x2cc3, lo: 0x88, hi: 0x88}, + {value: 0x2cbb, lo: 0x8b, hi: 0x8b}, + {value: 0x2ccb, lo: 0x8c, hi: 0x8c}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x9900, lo: 0x96, hi: 0x97}, + {value: 0x45bb, lo: 0x9c, hi: 0x9c}, + {value: 0x45c3, lo: 0x9d, hi: 0x9d}, + // Block 0x17, offset 0xa6 + {value: 0x0000, lo: 0x03}, + {value: 0xa000, lo: 0x92, hi: 0x92}, + {value: 0x2cd3, lo: 0x94, hi: 0x94}, + {value: 0x9900, lo: 0xbe, hi: 0xbe}, + // Block 0x18, offset 0xaa + {value: 0x0000, lo: 0x06}, + {value: 0xa000, lo: 0x86, hi: 0x87}, + {value: 0x2cdb, lo: 0x8a, hi: 0x8a}, + {value: 0x2ceb, lo: 0x8b, hi: 0x8b}, + {value: 0x2ce3, lo: 0x8c, hi: 0x8c}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x9900, lo: 0x97, hi: 0x97}, + // Block 0x19, offset 0xb1 + {value: 0x1801, lo: 0x04}, + {value: 0xa000, lo: 0x86, hi: 0x86}, + {value: 0x3f07, lo: 0x88, hi: 0x88}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x8121, lo: 0x95, hi: 0x96}, + // Block 0x1a, offset 0xb6 + {value: 0x0000, lo: 0x02}, + {value: 0x8103, lo: 0xbc, hi: 0xbc}, + {value: 0xa000, lo: 0xbf, hi: 0xbf}, + // Block 0x1b, offset 0xb9 + {value: 0x0000, lo: 0x09}, + {value: 0x2cf3, lo: 0x80, hi: 0x80}, + {value: 0x9900, lo: 0x82, hi: 0x82}, + {value: 0xa000, lo: 0x86, hi: 0x86}, + {value: 0x2cfb, lo: 0x87, hi: 0x87}, + {value: 0x2d03, lo: 0x88, hi: 0x88}, + {value: 0x2f67, lo: 0x8a, hi: 0x8a}, + {value: 0x2def, lo: 0x8b, hi: 0x8b}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x9900, lo: 0x95, hi: 0x96}, + // Block 0x1c, offset 0xc3 + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0xbb, hi: 0xbc}, + {value: 0x9900, lo: 0xbe, hi: 0xbe}, + // Block 0x1d, offset 0xc6 + {value: 0x0000, lo: 0x06}, + {value: 0xa000, lo: 0x86, hi: 0x87}, + {value: 0x2d0b, lo: 0x8a, hi: 0x8a}, + {value: 0x2d1b, lo: 0x8b, hi: 0x8b}, + {value: 0x2d13, lo: 0x8c, hi: 0x8c}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x9900, lo: 0x97, hi: 0x97}, + // Block 0x1e, offset 0xcd + {value: 0x6bdd, lo: 0x07}, + {value: 0x9905, lo: 0x8a, hi: 0x8a}, + {value: 0x9900, lo: 0x8f, hi: 0x8f}, + {value: 0xa000, lo: 0x99, hi: 0x99}, + {value: 0x3f0f, lo: 0x9a, hi: 0x9a}, + {value: 0x2f6f, lo: 0x9c, hi: 0x9c}, + {value: 0x2dfa, lo: 0x9d, hi: 0x9d}, + {value: 0x2d23, lo: 0x9e, hi: 0x9f}, + // Block 0x1f, offset 0xd5 + {value: 0x0000, lo: 0x03}, + {value: 0x2627, lo: 0xb3, hi: 0xb3}, + {value: 0x8123, lo: 0xb8, hi: 0xb9}, + {value: 0x8105, lo: 0xba, hi: 0xba}, + // Block 0x20, offset 0xd9 + {value: 0x0000, lo: 0x01}, + {value: 0x8124, lo: 0x88, hi: 0x8b}, + // Block 0x21, offset 0xdb + {value: 0x0000, lo: 0x03}, + {value: 0x263c, lo: 0xb3, hi: 0xb3}, + {value: 0x8125, lo: 0xb8, hi: 0xb9}, + {value: 0x8105, lo: 0xba, hi: 0xba}, + // Block 0x22, offset 0xdf + {value: 0x0000, lo: 0x03}, + {value: 0x8126, lo: 0x88, hi: 0x8b}, + {value: 0x262e, lo: 0x9c, hi: 0x9c}, + {value: 0x2635, lo: 0x9d, hi: 0x9d}, + // Block 0x23, offset 0xe3 + {value: 0x0000, lo: 0x05}, + {value: 0x030e, lo: 0x8c, hi: 0x8c}, + {value: 0x812e, lo: 0x98, hi: 0x99}, + {value: 0x812e, lo: 0xb5, hi: 0xb5}, + {value: 0x812e, lo: 0xb7, hi: 0xb7}, + {value: 0x812c, lo: 0xb9, hi: 0xb9}, + // Block 0x24, offset 0xe9 + {value: 0x0000, lo: 0x10}, + {value: 0x264a, lo: 0x83, hi: 0x83}, + {value: 0x2651, lo: 0x8d, hi: 0x8d}, + {value: 0x2658, lo: 0x92, hi: 0x92}, + {value: 0x265f, lo: 0x97, hi: 0x97}, + {value: 0x2666, lo: 0x9c, hi: 0x9c}, + {value: 0x2643, lo: 0xa9, hi: 0xa9}, + {value: 0x8127, lo: 0xb1, hi: 0xb1}, + {value: 0x8128, lo: 0xb2, hi: 0xb2}, + {value: 0x4a9b, lo: 0xb3, hi: 0xb3}, + {value: 0x8129, lo: 0xb4, hi: 0xb4}, + {value: 0x4aa4, lo: 0xb5, hi: 0xb5}, + {value: 0x45cb, lo: 0xb6, hi: 0xb6}, + {value: 0x460b, lo: 0xb7, hi: 0xb7}, + {value: 0x45d3, lo: 0xb8, hi: 0xb8}, + {value: 0x4616, lo: 0xb9, hi: 0xb9}, + {value: 0x8128, lo: 0xba, hi: 0xbd}, + // Block 0x25, offset 0xfa + {value: 0x0000, lo: 0x0b}, + {value: 0x8128, lo: 0x80, hi: 0x80}, + {value: 0x4aad, lo: 0x81, hi: 0x81}, + {value: 0x8133, lo: 0x82, hi: 0x83}, + {value: 0x8105, lo: 0x84, hi: 0x84}, + {value: 0x8133, lo: 0x86, hi: 0x87}, + {value: 0x2674, lo: 0x93, hi: 0x93}, + {value: 0x267b, lo: 0x9d, hi: 0x9d}, + {value: 0x2682, lo: 0xa2, hi: 0xa2}, + {value: 0x2689, lo: 0xa7, hi: 0xa7}, + {value: 0x2690, lo: 0xac, hi: 0xac}, + {value: 0x266d, lo: 0xb9, hi: 0xb9}, + // Block 0x26, offset 0x106 + {value: 0x0000, lo: 0x01}, + {value: 0x812e, lo: 0x86, hi: 0x86}, + // Block 0x27, offset 0x108 + {value: 0x0000, lo: 0x05}, + {value: 0xa000, lo: 0xa5, hi: 0xa5}, + {value: 0x2d2b, lo: 0xa6, hi: 0xa6}, + {value: 0x9900, lo: 0xae, hi: 0xae}, + {value: 0x8103, lo: 0xb7, hi: 0xb7}, + {value: 0x8105, lo: 0xb9, hi: 0xba}, + // Block 0x28, offset 0x10e + {value: 0x0000, lo: 0x01}, + {value: 0x812e, lo: 0x8d, hi: 0x8d}, + // Block 0x29, offset 0x110 + {value: 0x0000, lo: 0x01}, + {value: 0x0312, lo: 0xbc, hi: 0xbc}, + // Block 0x2a, offset 0x112 + {value: 0x0000, lo: 0x01}, + {value: 0xa000, lo: 0x80, hi: 0x92}, + // Block 0x2b, offset 0x114 + {value: 0x0000, lo: 0x01}, + {value: 0xb900, lo: 0xa1, hi: 0xb5}, + // Block 0x2c, offset 0x116 + {value: 0x0000, lo: 0x01}, + {value: 0x9900, lo: 0xa8, hi: 0xbf}, + // Block 0x2d, offset 0x118 + {value: 0x0000, lo: 0x01}, + {value: 0x9900, lo: 0x80, hi: 0x82}, + // Block 0x2e, offset 0x11a + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0x9d, hi: 0x9f}, + // Block 0x2f, offset 0x11c + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0x94, hi: 0x94}, + {value: 0x8105, lo: 0xb4, hi: 0xb4}, + // Block 0x30, offset 0x11f + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0x92, hi: 0x92}, + {value: 0x8133, lo: 0x9d, hi: 0x9d}, + // Block 0x31, offset 0x122 + {value: 0x0000, lo: 0x01}, + {value: 0x8132, lo: 0xa9, hi: 0xa9}, + // Block 0x32, offset 0x124 + {value: 0x0004, lo: 0x02}, + {value: 0x812f, lo: 0xb9, hi: 0xba}, + {value: 0x812e, lo: 0xbb, hi: 0xbb}, + // Block 0x33, offset 0x127 + {value: 0x0000, lo: 0x02}, + {value: 0x8133, lo: 0x97, hi: 0x97}, + {value: 0x812e, lo: 0x98, hi: 0x98}, + // Block 0x34, offset 0x12a + {value: 0x0000, lo: 0x03}, + {value: 0x8105, lo: 0xa0, hi: 0xa0}, + {value: 0x8133, lo: 0xb5, hi: 0xbc}, + {value: 0x812e, lo: 0xbf, hi: 0xbf}, + // Block 0x35, offset 0x12e + {value: 0x0000, lo: 0x05}, + {value: 0x8133, lo: 0xb0, hi: 0xb4}, + {value: 0x812e, lo: 0xb5, hi: 0xba}, + {value: 0x8133, lo: 0xbb, hi: 0xbc}, + {value: 0x812e, lo: 0xbd, hi: 0xbd}, + {value: 0x812e, lo: 0xbf, hi: 0xbf}, + // Block 0x36, offset 0x134 + {value: 0x0000, lo: 0x01}, + {value: 0x812e, lo: 0x80, hi: 0x80}, + // Block 0x37, offset 0x136 + {value: 0x0000, lo: 0x08}, + {value: 0x2d73, lo: 0x80, hi: 0x80}, + {value: 0x2d7b, lo: 0x81, hi: 0x81}, + {value: 0xa000, lo: 0x82, hi: 0x82}, + {value: 0x2d83, lo: 0x83, hi: 0x83}, + {value: 0x8105, lo: 0x84, hi: 0x84}, + {value: 0x8133, lo: 0xab, hi: 0xab}, + {value: 0x812e, lo: 0xac, hi: 0xac}, + {value: 0x8133, lo: 0xad, hi: 0xb3}, + // Block 0x38, offset 0x13f + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0xaa, hi: 0xab}, + // Block 0x39, offset 0x141 + {value: 0x0000, lo: 0x02}, + {value: 0x8103, lo: 0xa6, hi: 0xa6}, + {value: 0x8105, lo: 0xb2, hi: 0xb3}, + // Block 0x3a, offset 0x144 + {value: 0x0000, lo: 0x01}, + {value: 0x8103, lo: 0xb7, hi: 0xb7}, + // Block 0x3b, offset 0x146 + {value: 0x0000, lo: 0x0a}, + {value: 0x8133, lo: 0x90, hi: 0x92}, + {value: 0x8101, lo: 0x94, hi: 0x94}, + {value: 0x812e, lo: 0x95, hi: 0x99}, + {value: 0x8133, lo: 0x9a, hi: 0x9b}, + {value: 0x812e, lo: 0x9c, hi: 0x9f}, + {value: 0x8133, lo: 0xa0, hi: 0xa0}, + {value: 0x8101, lo: 0xa2, hi: 0xa8}, + {value: 0x812e, lo: 0xad, hi: 0xad}, + {value: 0x8133, lo: 0xb4, hi: 0xb4}, + {value: 0x8133, lo: 0xb8, hi: 0xb9}, + // Block 0x3c, offset 0x151 + {value: 0x0002, lo: 0x0a}, + {value: 0x0043, lo: 0xac, hi: 0xac}, + {value: 0x00d1, lo: 0xad, hi: 0xad}, + {value: 0x0045, lo: 0xae, hi: 0xae}, + {value: 0x0049, lo: 0xb0, hi: 0xb1}, + {value: 0x00e6, lo: 0xb2, hi: 0xb2}, + {value: 0x004f, lo: 0xb3, hi: 0xba}, + {value: 0x005f, lo: 0xbc, hi: 0xbc}, + {value: 0x00ef, lo: 0xbd, hi: 0xbd}, + {value: 0x0061, lo: 0xbe, hi: 0xbe}, + {value: 0x0065, lo: 0xbf, hi: 0xbf}, + // Block 0x3d, offset 0x15c + {value: 0x0000, lo: 0x0d}, + {value: 0x0001, lo: 0x80, hi: 0x8a}, + {value: 0x043e, lo: 0x91, hi: 0x91}, + {value: 0x42b2, lo: 0x97, hi: 0x97}, + {value: 0x001d, lo: 0xa4, hi: 0xa4}, + {value: 0x1876, lo: 0xa5, hi: 0xa5}, + {value: 0x1b62, lo: 0xa6, hi: 0xa6}, + {value: 0x0001, lo: 0xaf, hi: 0xaf}, + {value: 0x2697, lo: 0xb3, hi: 0xb3}, + {value: 0x280b, lo: 0xb4, hi: 0xb4}, + {value: 0x269e, lo: 0xb6, hi: 0xb6}, + {value: 0x2815, lo: 0xb7, hi: 0xb7}, + {value: 0x1870, lo: 0xbc, hi: 0xbc}, + {value: 0x4280, lo: 0xbe, hi: 0xbe}, + // Block 0x3e, offset 0x16a + {value: 0x0002, lo: 0x0d}, + {value: 0x1936, lo: 0x87, hi: 0x87}, + {value: 0x1933, lo: 0x88, hi: 0x88}, + {value: 0x1873, lo: 0x89, hi: 0x89}, + {value: 0x299b, lo: 0x97, hi: 0x97}, + {value: 0x0001, lo: 0x9f, hi: 0x9f}, + {value: 0x0021, lo: 0xb0, hi: 0xb0}, + {value: 0x0093, lo: 0xb1, hi: 0xb1}, + {value: 0x0029, lo: 0xb4, hi: 0xb9}, + {value: 0x0017, lo: 0xba, hi: 0xba}, + {value: 0x046a, lo: 0xbb, hi: 0xbb}, + {value: 0x003b, lo: 0xbc, hi: 0xbc}, + {value: 0x0011, lo: 0xbd, hi: 0xbe}, + {value: 0x009d, lo: 0xbf, hi: 0xbf}, + // Block 0x3f, offset 0x178 + {value: 0x0002, lo: 0x0f}, + {value: 0x0021, lo: 0x80, hi: 0x89}, + {value: 0x0017, lo: 0x8a, hi: 0x8a}, + {value: 0x046a, lo: 0x8b, hi: 0x8b}, + {value: 0x003b, lo: 0x8c, hi: 0x8c}, + {value: 0x0011, lo: 0x8d, hi: 0x8e}, + {value: 0x0083, lo: 0x90, hi: 0x90}, + {value: 0x008b, lo: 0x91, hi: 0x91}, + {value: 0x009f, lo: 0x92, hi: 0x92}, + {value: 0x00b1, lo: 0x93, hi: 0x93}, + {value: 0x0104, lo: 0x94, hi: 0x94}, + {value: 0x0091, lo: 0x95, hi: 0x95}, + {value: 0x0097, lo: 0x96, hi: 0x99}, + {value: 0x00a1, lo: 0x9a, hi: 0x9a}, + {value: 0x00a7, lo: 0x9b, hi: 0x9c}, + {value: 0x199f, lo: 0xa8, hi: 0xa8}, + // Block 0x40, offset 0x188 + {value: 0x0000, lo: 0x0d}, + {value: 0x8133, lo: 0x90, hi: 0x91}, + {value: 0x8101, lo: 0x92, hi: 0x93}, + {value: 0x8133, lo: 0x94, hi: 0x97}, + {value: 0x8101, lo: 0x98, hi: 0x9a}, + {value: 0x8133, lo: 0x9b, hi: 0x9c}, + {value: 0x8133, lo: 0xa1, hi: 0xa1}, + {value: 0x8101, lo: 0xa5, hi: 0xa6}, + {value: 0x8133, lo: 0xa7, hi: 0xa7}, + {value: 0x812e, lo: 0xa8, hi: 0xa8}, + {value: 0x8133, lo: 0xa9, hi: 0xa9}, + {value: 0x8101, lo: 0xaa, hi: 0xab}, + {value: 0x812e, lo: 0xac, hi: 0xaf}, + {value: 0x8133, lo: 0xb0, hi: 0xb0}, + // Block 0x41, offset 0x196 + {value: 0x0007, lo: 0x06}, + {value: 0x2186, lo: 0x89, hi: 0x89}, + {value: 0xa000, lo: 0x90, hi: 0x90}, + {value: 0xa000, lo: 0x92, hi: 0x92}, + {value: 0xa000, lo: 0x94, hi: 0x94}, + {value: 0x3bd0, lo: 0x9a, hi: 0x9b}, + {value: 0x3bde, lo: 0xae, hi: 0xae}, + // Block 0x42, offset 0x19d + {value: 0x000e, lo: 0x05}, + {value: 0x3be5, lo: 0x8d, hi: 0x8e}, + {value: 0x3bec, lo: 0x8f, hi: 0x8f}, + {value: 0xa000, lo: 0x90, hi: 0x90}, + {value: 0xa000, lo: 0x92, hi: 0x92}, + {value: 0xa000, lo: 0x94, hi: 0x94}, + // Block 0x43, offset 0x1a3 + {value: 0x017a, lo: 0x0e}, + {value: 0xa000, lo: 0x83, hi: 0x83}, + {value: 0x3bfa, lo: 0x84, hi: 0x84}, + {value: 0xa000, lo: 0x88, hi: 0x88}, + {value: 0x3c01, lo: 0x89, hi: 0x89}, + {value: 0xa000, lo: 0x8b, hi: 0x8b}, + {value: 0x3c08, lo: 0x8c, hi: 0x8c}, + {value: 0xa000, lo: 0xa3, hi: 0xa3}, + {value: 0x3c0f, lo: 0xa4, hi: 0xa4}, + {value: 0xa000, lo: 0xa5, hi: 0xa5}, + {value: 0x3c16, lo: 0xa6, hi: 0xa6}, + {value: 0x26a5, lo: 0xac, hi: 0xad}, + {value: 0x26ac, lo: 0xaf, hi: 0xaf}, + {value: 0x2829, lo: 0xb0, hi: 0xb0}, + {value: 0xa000, lo: 0xbc, hi: 0xbc}, + // Block 0x44, offset 0x1b2 + {value: 0x0007, lo: 0x03}, + {value: 0x3c7f, lo: 0xa0, hi: 0xa1}, + {value: 0x3ca9, lo: 0xa2, hi: 0xa3}, + {value: 0x3cd3, lo: 0xaa, hi: 0xad}, + // Block 0x45, offset 0x1b6 + {value: 0x0004, lo: 0x01}, + {value: 0x048e, lo: 0xa9, hi: 0xaa}, + // Block 0x46, offset 0x1b8 + {value: 0x0002, lo: 0x03}, + {value: 0x0057, lo: 0x80, hi: 0x8f}, + {value: 0x0083, lo: 0x90, hi: 0xa9}, + {value: 0x0021, lo: 0xaa, hi: 0xaa}, + // Block 0x47, offset 0x1bc + {value: 0x0000, lo: 0x01}, + {value: 0x29a8, lo: 0x8c, hi: 0x8c}, + // Block 0x48, offset 0x1be + {value: 0x0266, lo: 0x02}, + {value: 0x1b92, lo: 0xb4, hi: 0xb4}, + {value: 0x1930, lo: 0xb5, hi: 0xb6}, + // Block 0x49, offset 0x1c1 + {value: 0x0000, lo: 0x01}, + {value: 0x44f4, lo: 0x9c, hi: 0x9c}, + // Block 0x4a, offset 0x1c3 + {value: 0x0000, lo: 0x02}, + {value: 0x0095, lo: 0xbc, hi: 0xbc}, + {value: 0x006d, lo: 0xbd, hi: 0xbd}, + // Block 0x4b, offset 0x1c6 + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0xaf, hi: 0xb1}, + // Block 0x4c, offset 0x1c8 + {value: 0x0000, lo: 0x02}, + {value: 0x0482, lo: 0xaf, hi: 0xaf}, + {value: 0x8105, lo: 0xbf, hi: 0xbf}, + // Block 0x4d, offset 0x1cb + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0xa0, hi: 0xbf}, + // Block 0x4e, offset 0x1cd + {value: 0x0000, lo: 0x01}, + {value: 0x0dc6, lo: 0x9f, hi: 0x9f}, + // Block 0x4f, offset 0x1cf + {value: 0x0000, lo: 0x01}, + {value: 0x1632, lo: 0xb3, hi: 0xb3}, + // Block 0x50, offset 0x1d1 + {value: 0x0004, lo: 0x0b}, + {value: 0x159a, lo: 0x80, hi: 0x82}, + {value: 0x15b2, lo: 0x83, hi: 0x83}, + {value: 0x15ca, lo: 0x84, hi: 0x85}, + {value: 0x15da, lo: 0x86, hi: 0x89}, + {value: 0x15ee, lo: 0x8a, hi: 0x8c}, + {value: 0x1602, lo: 0x8d, hi: 0x8d}, + {value: 0x160a, lo: 0x8e, hi: 0x8e}, + {value: 0x1612, lo: 0x8f, hi: 0x90}, + {value: 0x161e, lo: 0x91, hi: 0x93}, + {value: 0x162e, lo: 0x94, hi: 0x94}, + {value: 0x1636, lo: 0x95, hi: 0x95}, + // Block 0x51, offset 0x1dd + {value: 0x0004, lo: 0x09}, + {value: 0x0001, lo: 0x80, hi: 0x80}, + {value: 0x812d, lo: 0xaa, hi: 0xaa}, + {value: 0x8132, lo: 0xab, hi: 0xab}, + {value: 0x8134, lo: 0xac, hi: 0xac}, + {value: 0x812f, lo: 0xad, hi: 0xad}, + {value: 0x8130, lo: 0xae, hi: 0xae}, + {value: 0x8130, lo: 0xaf, hi: 0xaf}, + {value: 0x04b6, lo: 0xb6, hi: 0xb6}, + {value: 0x088a, lo: 0xb8, hi: 0xba}, + // Block 0x52, offset 0x1e7 + {value: 0x0006, lo: 0x09}, + {value: 0x0316, lo: 0xb1, hi: 0xb1}, + {value: 0x031a, lo: 0xb2, hi: 0xb2}, + {value: 0x4a52, lo: 0xb3, hi: 0xb3}, + {value: 0x031e, lo: 0xb4, hi: 0xb4}, + {value: 0x4a58, lo: 0xb5, hi: 0xb6}, + {value: 0x0322, lo: 0xb7, hi: 0xb7}, + {value: 0x0326, lo: 0xb8, hi: 0xb8}, + {value: 0x032a, lo: 0xb9, hi: 0xb9}, + {value: 0x4a64, lo: 0xba, hi: 0xbf}, + // Block 0x53, offset 0x1f1 + {value: 0x0000, lo: 0x02}, + {value: 0x8133, lo: 0xaf, hi: 0xaf}, + {value: 0x8133, lo: 0xb4, hi: 0xbd}, + // Block 0x54, offset 0x1f4 + {value: 0x0000, lo: 0x03}, + {value: 0x0212, lo: 0x9c, hi: 0x9c}, + {value: 0x0215, lo: 0x9d, hi: 0x9d}, + {value: 0x8133, lo: 0x9e, hi: 0x9f}, + // Block 0x55, offset 0x1f8 + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0xb0, hi: 0xb1}, + // Block 0x56, offset 0x1fa + {value: 0x0000, lo: 0x01}, + {value: 0x163e, lo: 0xb0, hi: 0xb0}, + // Block 0x57, offset 0x1fc + {value: 0x000c, lo: 0x01}, + {value: 0x00d7, lo: 0xb8, hi: 0xb9}, + // Block 0x58, offset 0x1fe + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0x86, hi: 0x86}, + {value: 0x8105, lo: 0xac, hi: 0xac}, + // Block 0x59, offset 0x201 + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0x84, hi: 0x84}, + {value: 0x8133, lo: 0xa0, hi: 0xb1}, + // Block 0x5a, offset 0x204 + {value: 0x0000, lo: 0x01}, + {value: 0x812e, lo: 0xab, hi: 0xad}, + // Block 0x5b, offset 0x206 + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0x93, hi: 0x93}, + // Block 0x5c, offset 0x208 + {value: 0x0000, lo: 0x01}, + {value: 0x8103, lo: 0xb3, hi: 0xb3}, + // Block 0x5d, offset 0x20a + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0x80, hi: 0x80}, + // Block 0x5e, offset 0x20c + {value: 0x0000, lo: 0x05}, + {value: 0x8133, lo: 0xb0, hi: 0xb0}, + {value: 0x8133, lo: 0xb2, hi: 0xb3}, + {value: 0x812e, lo: 0xb4, hi: 0xb4}, + {value: 0x8133, lo: 0xb7, hi: 0xb8}, + {value: 0x8133, lo: 0xbe, hi: 0xbf}, + // Block 0x5f, offset 0x212 + {value: 0x0000, lo: 0x02}, + {value: 0x8133, lo: 0x81, hi: 0x81}, + {value: 0x8105, lo: 0xb6, hi: 0xb6}, + // Block 0x60, offset 0x215 + {value: 0x0008, lo: 0x04}, + {value: 0x163a, lo: 0x9c, hi: 0x9d}, + {value: 0x0125, lo: 0x9e, hi: 0x9e}, + {value: 0x1646, lo: 0x9f, hi: 0x9f}, + {value: 0x015e, lo: 0xa9, hi: 0xa9}, + // Block 0x61, offset 0x21a + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0xad, hi: 0xad}, + // Block 0x62, offset 0x21c + {value: 0x0000, lo: 0x06}, + {value: 0xe500, lo: 0x80, hi: 0x80}, + {value: 0xc600, lo: 0x81, hi: 0x9b}, + {value: 0xe500, lo: 0x9c, hi: 0x9c}, + {value: 0xc600, lo: 0x9d, hi: 0xb7}, + {value: 0xe500, lo: 0xb8, hi: 0xb8}, + {value: 0xc600, lo: 0xb9, hi: 0xbf}, + // Block 0x63, offset 0x223 + {value: 0x0000, lo: 0x05}, + {value: 0xc600, lo: 0x80, hi: 0x93}, + {value: 0xe500, lo: 0x94, hi: 0x94}, + {value: 0xc600, lo: 0x95, hi: 0xaf}, + {value: 0xe500, lo: 0xb0, hi: 0xb0}, + {value: 0xc600, lo: 0xb1, hi: 0xbf}, + // Block 0x64, offset 0x229 + {value: 0x0000, lo: 0x05}, + {value: 0xc600, lo: 0x80, hi: 0x8b}, + {value: 0xe500, lo: 0x8c, hi: 0x8c}, + {value: 0xc600, lo: 0x8d, hi: 0xa7}, + {value: 0xe500, lo: 0xa8, hi: 0xa8}, + {value: 0xc600, lo: 0xa9, hi: 0xbf}, + // Block 0x65, offset 0x22f + {value: 0x0000, lo: 0x07}, + {value: 0xc600, lo: 0x80, hi: 0x83}, + {value: 0xe500, lo: 0x84, hi: 0x84}, + {value: 0xc600, lo: 0x85, hi: 0x9f}, + {value: 0xe500, lo: 0xa0, hi: 0xa0}, + {value: 0xc600, lo: 0xa1, hi: 0xbb}, + {value: 0xe500, lo: 0xbc, hi: 0xbc}, + {value: 0xc600, lo: 0xbd, hi: 0xbf}, + // Block 0x66, offset 0x237 + {value: 0x0000, lo: 0x05}, + {value: 0xc600, lo: 0x80, hi: 0x97}, + {value: 0xe500, lo: 0x98, hi: 0x98}, + {value: 0xc600, lo: 0x99, hi: 0xb3}, + {value: 0xe500, lo: 0xb4, hi: 0xb4}, + {value: 0xc600, lo: 0xb5, hi: 0xbf}, + // Block 0x67, offset 0x23d + {value: 0x0000, lo: 0x05}, + {value: 0xc600, lo: 0x80, hi: 0x8f}, + {value: 0xe500, lo: 0x90, hi: 0x90}, + {value: 0xc600, lo: 0x91, hi: 0xab}, + {value: 0xe500, lo: 0xac, hi: 0xac}, + {value: 0xc600, lo: 0xad, hi: 0xbf}, + // Block 0x68, offset 0x243 + {value: 0x0000, lo: 0x05}, + {value: 0xc600, lo: 0x80, hi: 0x87}, + {value: 0xe500, lo: 0x88, hi: 0x88}, + {value: 0xc600, lo: 0x89, hi: 0xa3}, + {value: 0xe500, lo: 0xa4, hi: 0xa4}, + {value: 0xc600, lo: 0xa5, hi: 0xbf}, + // Block 0x69, offset 0x249 + {value: 0x0000, lo: 0x03}, + {value: 0xc600, lo: 0x80, hi: 0x87}, + {value: 0xe500, lo: 0x88, hi: 0x88}, + {value: 0xc600, lo: 0x89, hi: 0xa3}, + // Block 0x6a, offset 0x24d + {value: 0x0002, lo: 0x01}, + {value: 0x0003, lo: 0x81, hi: 0xbf}, + // Block 0x6b, offset 0x24f + {value: 0x0000, lo: 0x01}, + {value: 0x812e, lo: 0xbd, hi: 0xbd}, + // Block 0x6c, offset 0x251 + {value: 0x0000, lo: 0x01}, + {value: 0x812e, lo: 0xa0, hi: 0xa0}, + // Block 0x6d, offset 0x253 + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0xb6, hi: 0xba}, + // Block 0x6e, offset 0x255 + {value: 0x002d, lo: 0x05}, + {value: 0x812e, lo: 0x8d, hi: 0x8d}, + {value: 0x8133, lo: 0x8f, hi: 0x8f}, + {value: 0x8133, lo: 0xb8, hi: 0xb8}, + {value: 0x8101, lo: 0xb9, hi: 0xba}, + {value: 0x8105, lo: 0xbf, hi: 0xbf}, + // Block 0x6f, offset 0x25b + {value: 0x0000, lo: 0x02}, + {value: 0x8133, lo: 0xa5, hi: 0xa5}, + {value: 0x812e, lo: 0xa6, hi: 0xa6}, + // Block 0x70, offset 0x25e + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0xa4, hi: 0xa7}, + // Block 0x71, offset 0x260 + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0xab, hi: 0xac}, + // Block 0x72, offset 0x262 + {value: 0x0000, lo: 0x05}, + {value: 0x812e, lo: 0x86, hi: 0x87}, + {value: 0x8133, lo: 0x88, hi: 0x8a}, + {value: 0x812e, lo: 0x8b, hi: 0x8b}, + {value: 0x8133, lo: 0x8c, hi: 0x8c}, + {value: 0x812e, lo: 0x8d, hi: 0x90}, + // Block 0x73, offset 0x268 + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0x86, hi: 0x86}, + {value: 0x8105, lo: 0xbf, hi: 0xbf}, + // Block 0x74, offset 0x26b + {value: 0x17fe, lo: 0x07}, + {value: 0xa000, lo: 0x99, hi: 0x99}, + {value: 0x424f, lo: 0x9a, hi: 0x9a}, + {value: 0xa000, lo: 0x9b, hi: 0x9b}, + {value: 0x4259, lo: 0x9c, hi: 0x9c}, + {value: 0xa000, lo: 0xa5, hi: 0xa5}, + {value: 0x4263, lo: 0xab, hi: 0xab}, + {value: 0x8105, lo: 0xb9, hi: 0xba}, + // Block 0x75, offset 0x273 + {value: 0x0000, lo: 0x06}, + {value: 0x8133, lo: 0x80, hi: 0x82}, + {value: 0x9900, lo: 0xa7, hi: 0xa7}, + {value: 0x2d8b, lo: 0xae, hi: 0xae}, + {value: 0x2d95, lo: 0xaf, hi: 0xaf}, + {value: 0xa000, lo: 0xb1, hi: 0xb2}, + {value: 0x8105, lo: 0xb3, hi: 0xb4}, + // Block 0x76, offset 0x27a + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0x80, hi: 0x80}, + {value: 0x8103, lo: 0x8a, hi: 0x8a}, + // Block 0x77, offset 0x27d + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0xb5, hi: 0xb5}, + {value: 0x8103, lo: 0xb6, hi: 0xb6}, + // Block 0x78, offset 0x280 + {value: 0x0002, lo: 0x01}, + {value: 0x8103, lo: 0xa9, hi: 0xaa}, + // Block 0x79, offset 0x282 + {value: 0x0000, lo: 0x02}, + {value: 0x8103, lo: 0xbb, hi: 0xbc}, + {value: 0x9900, lo: 0xbe, hi: 0xbe}, + // Block 0x7a, offset 0x285 + {value: 0x0000, lo: 0x07}, + {value: 0xa000, lo: 0x87, hi: 0x87}, + {value: 0x2d9f, lo: 0x8b, hi: 0x8b}, + {value: 0x2da9, lo: 0x8c, hi: 0x8c}, + {value: 0x8105, lo: 0x8d, hi: 0x8d}, + {value: 0x9900, lo: 0x97, hi: 0x97}, + {value: 0x8133, lo: 0xa6, hi: 0xac}, + {value: 0x8133, lo: 0xb0, hi: 0xb4}, + // Block 0x7b, offset 0x28d + {value: 0x0000, lo: 0x03}, + {value: 0x8105, lo: 0x82, hi: 0x82}, + {value: 0x8103, lo: 0x86, hi: 0x86}, + {value: 0x8133, lo: 0x9e, hi: 0x9e}, + // Block 0x7c, offset 0x291 + {value: 0x6b4d, lo: 0x06}, + {value: 0x9900, lo: 0xb0, hi: 0xb0}, + {value: 0xa000, lo: 0xb9, hi: 0xb9}, + {value: 0x9900, lo: 0xba, hi: 0xba}, + {value: 0x2dbd, lo: 0xbb, hi: 0xbb}, + {value: 0x2db3, lo: 0xbc, hi: 0xbd}, + {value: 0x2dc7, lo: 0xbe, hi: 0xbe}, + // Block 0x7d, offset 0x298 + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0x82, hi: 0x82}, + {value: 0x8103, lo: 0x83, hi: 0x83}, + // Block 0x7e, offset 0x29b + {value: 0x0000, lo: 0x05}, + {value: 0x9900, lo: 0xaf, hi: 0xaf}, + {value: 0xa000, lo: 0xb8, hi: 0xb9}, + {value: 0x2dd1, lo: 0xba, hi: 0xba}, + {value: 0x2ddb, lo: 0xbb, hi: 0xbb}, + {value: 0x8105, lo: 0xbf, hi: 0xbf}, + // Block 0x7f, offset 0x2a1 + {value: 0x0000, lo: 0x01}, + {value: 0x8103, lo: 0x80, hi: 0x80}, + // Block 0x80, offset 0x2a3 + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0xbf, hi: 0xbf}, + // Block 0x81, offset 0x2a5 + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0xb6, hi: 0xb6}, + {value: 0x8103, lo: 0xb7, hi: 0xb7}, + // Block 0x82, offset 0x2a8 + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0xab, hi: 0xab}, + // Block 0x83, offset 0x2aa + {value: 0x0000, lo: 0x02}, + {value: 0x8105, lo: 0xb9, hi: 0xb9}, + {value: 0x8103, lo: 0xba, hi: 0xba}, + // Block 0x84, offset 0x2ad + {value: 0x0000, lo: 0x04}, + {value: 0x9900, lo: 0xb0, hi: 0xb0}, + {value: 0xa000, lo: 0xb5, hi: 0xb5}, + {value: 0x2de5, lo: 0xb8, hi: 0xb8}, + {value: 0x8105, lo: 0xbd, hi: 0xbe}, + // Block 0x85, offset 0x2b2 + {value: 0x0000, lo: 0x01}, + {value: 0x8103, lo: 0x83, hi: 0x83}, + // Block 0x86, offset 0x2b4 + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0xa0, hi: 0xa0}, + // Block 0x87, offset 0x2b6 + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0xb4, hi: 0xb4}, + // Block 0x88, offset 0x2b8 + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0x87, hi: 0x87}, + // Block 0x89, offset 0x2ba + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0x99, hi: 0x99}, + // Block 0x8a, offset 0x2bc + {value: 0x0000, lo: 0x02}, + {value: 0x8103, lo: 0x82, hi: 0x82}, + {value: 0x8105, lo: 0x84, hi: 0x85}, + // Block 0x8b, offset 0x2bf + {value: 0x0000, lo: 0x01}, + {value: 0x8105, lo: 0x97, hi: 0x97}, + // Block 0x8c, offset 0x2c1 + {value: 0x0000, lo: 0x01}, + {value: 0x8101, lo: 0xb0, hi: 0xb4}, + // Block 0x8d, offset 0x2c3 + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0xb0, hi: 0xb6}, + // Block 0x8e, offset 0x2c5 + {value: 0x0000, lo: 0x01}, + {value: 0x8102, lo: 0xb0, hi: 0xb1}, + // Block 0x8f, offset 0x2c7 + {value: 0x0000, lo: 0x01}, + {value: 0x8101, lo: 0x9e, hi: 0x9e}, + // Block 0x90, offset 0x2c9 + {value: 0x0000, lo: 0x0c}, + {value: 0x45e3, lo: 0x9e, hi: 0x9e}, + {value: 0x45ed, lo: 0x9f, hi: 0x9f}, + {value: 0x4621, lo: 0xa0, hi: 0xa0}, + {value: 0x462f, lo: 0xa1, hi: 0xa1}, + {value: 0x463d, lo: 0xa2, hi: 0xa2}, + {value: 0x464b, lo: 0xa3, hi: 0xa3}, + {value: 0x4659, lo: 0xa4, hi: 0xa4}, + {value: 0x812c, lo: 0xa5, hi: 0xa6}, + {value: 0x8101, lo: 0xa7, hi: 0xa9}, + {value: 0x8131, lo: 0xad, hi: 0xad}, + {value: 0x812c, lo: 0xae, hi: 0xb2}, + {value: 0x812e, lo: 0xbb, hi: 0xbf}, + // Block 0x91, offset 0x2d6 + {value: 0x0000, lo: 0x09}, + {value: 0x812e, lo: 0x80, hi: 0x82}, + {value: 0x8133, lo: 0x85, hi: 0x89}, + {value: 0x812e, lo: 0x8a, hi: 0x8b}, + {value: 0x8133, lo: 0xaa, hi: 0xad}, + {value: 0x45f7, lo: 0xbb, hi: 0xbb}, + {value: 0x4601, lo: 0xbc, hi: 0xbc}, + {value: 0x4667, lo: 0xbd, hi: 0xbd}, + {value: 0x4683, lo: 0xbe, hi: 0xbe}, + {value: 0x4675, lo: 0xbf, hi: 0xbf}, + // Block 0x92, offset 0x2e0 + {value: 0x0000, lo: 0x01}, + {value: 0x4691, lo: 0x80, hi: 0x80}, + // Block 0x93, offset 0x2e2 + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0x82, hi: 0x84}, + // Block 0x94, offset 0x2e4 + {value: 0x0002, lo: 0x03}, + {value: 0x0043, lo: 0x80, hi: 0x99}, + {value: 0x0083, lo: 0x9a, hi: 0xb3}, + {value: 0x0043, lo: 0xb4, hi: 0xbf}, + // Block 0x95, offset 0x2e8 + {value: 0x0002, lo: 0x04}, + {value: 0x005b, lo: 0x80, hi: 0x8d}, + {value: 0x0083, lo: 0x8e, hi: 0x94}, + {value: 0x0093, lo: 0x96, hi: 0xa7}, + {value: 0x0043, lo: 0xa8, hi: 0xbf}, + // Block 0x96, offset 0x2ed + {value: 0x0002, lo: 0x0b}, + {value: 0x0073, lo: 0x80, hi: 0x81}, + {value: 0x0083, lo: 0x82, hi: 0x9b}, + {value: 0x0043, lo: 0x9c, hi: 0x9c}, + {value: 0x0047, lo: 0x9e, hi: 0x9f}, + {value: 0x004f, lo: 0xa2, hi: 0xa2}, + {value: 0x0055, lo: 0xa5, hi: 0xa6}, + {value: 0x005d, lo: 0xa9, hi: 0xac}, + {value: 0x0067, lo: 0xae, hi: 0xb5}, + {value: 0x0083, lo: 0xb6, hi: 0xb9}, + {value: 0x008d, lo: 0xbb, hi: 0xbb}, + {value: 0x0091, lo: 0xbd, hi: 0xbf}, + // Block 0x97, offset 0x2f9 + {value: 0x0002, lo: 0x04}, + {value: 0x0097, lo: 0x80, hi: 0x83}, + {value: 0x00a1, lo: 0x85, hi: 0x8f}, + {value: 0x0043, lo: 0x90, hi: 0xa9}, + {value: 0x0083, lo: 0xaa, hi: 0xbf}, + // Block 0x98, offset 0x2fe + {value: 0x0002, lo: 0x08}, + {value: 0x00af, lo: 0x80, hi: 0x83}, + {value: 0x0043, lo: 0x84, hi: 0x85}, + {value: 0x0049, lo: 0x87, hi: 0x8a}, + {value: 0x0055, lo: 0x8d, hi: 0x94}, + {value: 0x0067, lo: 0x96, hi: 0x9c}, + {value: 0x0083, lo: 0x9e, hi: 0xb7}, + {value: 0x0043, lo: 0xb8, hi: 0xb9}, + {value: 0x0049, lo: 0xbb, hi: 0xbe}, + // Block 0x99, offset 0x307 + {value: 0x0002, lo: 0x05}, + {value: 0x0053, lo: 0x80, hi: 0x84}, + {value: 0x005f, lo: 0x86, hi: 0x86}, + {value: 0x0067, lo: 0x8a, hi: 0x90}, + {value: 0x0083, lo: 0x92, hi: 0xab}, + {value: 0x0043, lo: 0xac, hi: 0xbf}, + // Block 0x9a, offset 0x30d + {value: 0x0002, lo: 0x04}, + {value: 0x006b, lo: 0x80, hi: 0x85}, + {value: 0x0083, lo: 0x86, hi: 0x9f}, + {value: 0x0043, lo: 0xa0, hi: 0xb9}, + {value: 0x0083, lo: 0xba, hi: 0xbf}, + // Block 0x9b, offset 0x312 + {value: 0x0002, lo: 0x03}, + {value: 0x008f, lo: 0x80, hi: 0x93}, + {value: 0x0043, lo: 0x94, hi: 0xad}, + {value: 0x0083, lo: 0xae, hi: 0xbf}, + // Block 0x9c, offset 0x316 + {value: 0x0002, lo: 0x04}, + {value: 0x00a7, lo: 0x80, hi: 0x87}, + {value: 0x0043, lo: 0x88, hi: 0xa1}, + {value: 0x0083, lo: 0xa2, hi: 0xbb}, + {value: 0x0043, lo: 0xbc, hi: 0xbf}, + // Block 0x9d, offset 0x31b + {value: 0x0002, lo: 0x03}, + {value: 0x004b, lo: 0x80, hi: 0x95}, + {value: 0x0083, lo: 0x96, hi: 0xaf}, + {value: 0x0043, lo: 0xb0, hi: 0xbf}, + // Block 0x9e, offset 0x31f + {value: 0x0003, lo: 0x0f}, + {value: 0x01bb, lo: 0x80, hi: 0x80}, + {value: 0x0462, lo: 0x81, hi: 0x81}, + {value: 0x01be, lo: 0x82, hi: 0x9a}, + {value: 0x045e, lo: 0x9b, hi: 0x9b}, + {value: 0x01ca, lo: 0x9c, hi: 0x9c}, + {value: 0x01d3, lo: 0x9d, hi: 0x9d}, + {value: 0x01d9, lo: 0x9e, hi: 0x9e}, + {value: 0x01fd, lo: 0x9f, hi: 0x9f}, + {value: 0x01ee, lo: 0xa0, hi: 0xa0}, + {value: 0x01eb, lo: 0xa1, hi: 0xa1}, + {value: 0x0176, lo: 0xa2, hi: 0xb2}, + {value: 0x018b, lo: 0xb3, hi: 0xb3}, + {value: 0x01a9, lo: 0xb4, hi: 0xba}, + {value: 0x0462, lo: 0xbb, hi: 0xbb}, + {value: 0x01be, lo: 0xbc, hi: 0xbf}, + // Block 0x9f, offset 0x32f + {value: 0x0003, lo: 0x0d}, + {value: 0x01ca, lo: 0x80, hi: 0x94}, + {value: 0x045e, lo: 0x95, hi: 0x95}, + {value: 0x01ca, lo: 0x96, hi: 0x96}, + {value: 0x01d3, lo: 0x97, hi: 0x97}, + {value: 0x01d9, lo: 0x98, hi: 0x98}, + {value: 0x01fd, lo: 0x99, hi: 0x99}, + {value: 0x01ee, lo: 0x9a, hi: 0x9a}, + {value: 0x01eb, lo: 0x9b, hi: 0x9b}, + {value: 0x0176, lo: 0x9c, hi: 0xac}, + {value: 0x018b, lo: 0xad, hi: 0xad}, + {value: 0x01a9, lo: 0xae, hi: 0xb4}, + {value: 0x0462, lo: 0xb5, hi: 0xb5}, + {value: 0x01be, lo: 0xb6, hi: 0xbf}, + // Block 0xa0, offset 0x33d + {value: 0x0003, lo: 0x0d}, + {value: 0x01dc, lo: 0x80, hi: 0x8e}, + {value: 0x045e, lo: 0x8f, hi: 0x8f}, + {value: 0x01ca, lo: 0x90, hi: 0x90}, + {value: 0x01d3, lo: 0x91, hi: 0x91}, + {value: 0x01d9, lo: 0x92, hi: 0x92}, + {value: 0x01fd, lo: 0x93, hi: 0x93}, + {value: 0x01ee, lo: 0x94, hi: 0x94}, + {value: 0x01eb, lo: 0x95, hi: 0x95}, + {value: 0x0176, lo: 0x96, hi: 0xa6}, + {value: 0x018b, lo: 0xa7, hi: 0xa7}, + {value: 0x01a9, lo: 0xa8, hi: 0xae}, + {value: 0x0462, lo: 0xaf, hi: 0xaf}, + {value: 0x01be, lo: 0xb0, hi: 0xbf}, + // Block 0xa1, offset 0x34b + {value: 0x0003, lo: 0x0d}, + {value: 0x01ee, lo: 0x80, hi: 0x88}, + {value: 0x045e, lo: 0x89, hi: 0x89}, + {value: 0x01ca, lo: 0x8a, hi: 0x8a}, + {value: 0x01d3, lo: 0x8b, hi: 0x8b}, + {value: 0x01d9, lo: 0x8c, hi: 0x8c}, + {value: 0x01fd, lo: 0x8d, hi: 0x8d}, + {value: 0x01ee, lo: 0x8e, hi: 0x8e}, + {value: 0x01eb, lo: 0x8f, hi: 0x8f}, + {value: 0x0176, lo: 0x90, hi: 0xa0}, + {value: 0x018b, lo: 0xa1, hi: 0xa1}, + {value: 0x01a9, lo: 0xa2, hi: 0xa8}, + {value: 0x0462, lo: 0xa9, hi: 0xa9}, + {value: 0x01be, lo: 0xaa, hi: 0xbf}, + // Block 0xa2, offset 0x359 + {value: 0x0000, lo: 0x05}, + {value: 0x8133, lo: 0x80, hi: 0x86}, + {value: 0x8133, lo: 0x88, hi: 0x98}, + {value: 0x8133, lo: 0x9b, hi: 0xa1}, + {value: 0x8133, lo: 0xa3, hi: 0xa4}, + {value: 0x8133, lo: 0xa6, hi: 0xaa}, + // Block 0xa3, offset 0x35f + {value: 0x0000, lo: 0x01}, + {value: 0x8133, lo: 0xac, hi: 0xaf}, + // Block 0xa4, offset 0x361 + {value: 0x0000, lo: 0x01}, + {value: 0x812e, lo: 0x90, hi: 0x96}, + // Block 0xa5, offset 0x363 + {value: 0x0000, lo: 0x02}, + {value: 0x8133, lo: 0x84, hi: 0x89}, + {value: 0x8103, lo: 0x8a, hi: 0x8a}, + // Block 0xa6, offset 0x366 + {value: 0x0002, lo: 0x0a}, + {value: 0x0063, lo: 0x80, hi: 0x89}, + {value: 0x1954, lo: 0x8a, hi: 0x8a}, + {value: 0x1987, lo: 0x8b, hi: 0x8b}, + {value: 0x19a2, lo: 0x8c, hi: 0x8c}, + {value: 0x19a8, lo: 0x8d, hi: 0x8d}, + {value: 0x1bc6, lo: 0x8e, hi: 0x8e}, + {value: 0x19b4, lo: 0x8f, hi: 0x8f}, + {value: 0x197e, lo: 0xaa, hi: 0xaa}, + {value: 0x1981, lo: 0xab, hi: 0xab}, + {value: 0x1984, lo: 0xac, hi: 0xac}, + // Block 0xa7, offset 0x371 + {value: 0x0000, lo: 0x01}, + {value: 0x1942, lo: 0x90, hi: 0x90}, + // Block 0xa8, offset 0x373 + {value: 0x0028, lo: 0x09}, + {value: 0x286f, lo: 0x80, hi: 0x80}, + {value: 0x2833, lo: 0x81, hi: 0x81}, + {value: 0x283d, lo: 0x82, hi: 0x82}, + {value: 0x2851, lo: 0x83, hi: 0x84}, + {value: 0x285b, lo: 0x85, hi: 0x86}, + {value: 0x2847, lo: 0x87, hi: 0x87}, + {value: 0x2865, lo: 0x88, hi: 0x88}, + {value: 0x0b72, lo: 0x90, hi: 0x90}, + {value: 0x08ea, lo: 0x91, hi: 0x91}, + // Block 0xa9, offset 0x37d + {value: 0x0002, lo: 0x01}, + {value: 0x0021, lo: 0xb0, hi: 0xb9}, +} + +// recompMap: 7528 bytes (entries only) +var recompMap map[uint32]rune +var recompMapOnce sync.Once + +const recompMapPacked = "" + + "\x00A\x03\x00\x00\x00\x00\xc0" + // 0x00410300: 0x000000C0 + "\x00A\x03\x01\x00\x00\x00\xc1" + // 0x00410301: 0x000000C1 + "\x00A\x03\x02\x00\x00\x00\xc2" + // 0x00410302: 0x000000C2 + "\x00A\x03\x03\x00\x00\x00\xc3" + // 0x00410303: 0x000000C3 + "\x00A\x03\b\x00\x00\x00\xc4" + // 0x00410308: 0x000000C4 + "\x00A\x03\n\x00\x00\x00\xc5" + // 0x0041030A: 0x000000C5 + "\x00C\x03'\x00\x00\x00\xc7" + // 0x00430327: 0x000000C7 + "\x00E\x03\x00\x00\x00\x00\xc8" + // 0x00450300: 0x000000C8 + "\x00E\x03\x01\x00\x00\x00\xc9" + // 0x00450301: 0x000000C9 + "\x00E\x03\x02\x00\x00\x00\xca" + // 0x00450302: 0x000000CA + "\x00E\x03\b\x00\x00\x00\xcb" + // 0x00450308: 0x000000CB + "\x00I\x03\x00\x00\x00\x00\xcc" + // 0x00490300: 0x000000CC + "\x00I\x03\x01\x00\x00\x00\xcd" + // 0x00490301: 0x000000CD + "\x00I\x03\x02\x00\x00\x00\xce" + // 0x00490302: 0x000000CE + "\x00I\x03\b\x00\x00\x00\xcf" + // 0x00490308: 0x000000CF + "\x00N\x03\x03\x00\x00\x00\xd1" + // 0x004E0303: 0x000000D1 + "\x00O\x03\x00\x00\x00\x00\xd2" + // 0x004F0300: 0x000000D2 + "\x00O\x03\x01\x00\x00\x00\xd3" + // 0x004F0301: 0x000000D3 + "\x00O\x03\x02\x00\x00\x00\xd4" + // 0x004F0302: 0x000000D4 + "\x00O\x03\x03\x00\x00\x00\xd5" + // 0x004F0303: 0x000000D5 + "\x00O\x03\b\x00\x00\x00\xd6" + // 0x004F0308: 0x000000D6 + "\x00U\x03\x00\x00\x00\x00\xd9" + // 0x00550300: 0x000000D9 + "\x00U\x03\x01\x00\x00\x00\xda" + // 0x00550301: 0x000000DA + "\x00U\x03\x02\x00\x00\x00\xdb" + // 0x00550302: 0x000000DB + "\x00U\x03\b\x00\x00\x00\xdc" + // 0x00550308: 0x000000DC + "\x00Y\x03\x01\x00\x00\x00\xdd" + // 0x00590301: 0x000000DD + "\x00a\x03\x00\x00\x00\x00\xe0" + // 0x00610300: 0x000000E0 + "\x00a\x03\x01\x00\x00\x00\xe1" + // 0x00610301: 0x000000E1 + "\x00a\x03\x02\x00\x00\x00\xe2" + // 0x00610302: 0x000000E2 + "\x00a\x03\x03\x00\x00\x00\xe3" + // 0x00610303: 0x000000E3 + "\x00a\x03\b\x00\x00\x00\xe4" + // 0x00610308: 0x000000E4 + "\x00a\x03\n\x00\x00\x00\xe5" + // 0x0061030A: 0x000000E5 + "\x00c\x03'\x00\x00\x00\xe7" + // 0x00630327: 0x000000E7 + "\x00e\x03\x00\x00\x00\x00\xe8" + // 0x00650300: 0x000000E8 + "\x00e\x03\x01\x00\x00\x00\xe9" + // 0x00650301: 0x000000E9 + "\x00e\x03\x02\x00\x00\x00\xea" + // 0x00650302: 0x000000EA + "\x00e\x03\b\x00\x00\x00\xeb" + // 0x00650308: 0x000000EB + "\x00i\x03\x00\x00\x00\x00\xec" + // 0x00690300: 0x000000EC + "\x00i\x03\x01\x00\x00\x00\xed" + // 0x00690301: 0x000000ED + "\x00i\x03\x02\x00\x00\x00\xee" + // 0x00690302: 0x000000EE + "\x00i\x03\b\x00\x00\x00\xef" + // 0x00690308: 0x000000EF + "\x00n\x03\x03\x00\x00\x00\xf1" + // 0x006E0303: 0x000000F1 + "\x00o\x03\x00\x00\x00\x00\xf2" + // 0x006F0300: 0x000000F2 + "\x00o\x03\x01\x00\x00\x00\xf3" + // 0x006F0301: 0x000000F3 + "\x00o\x03\x02\x00\x00\x00\xf4" + // 0x006F0302: 0x000000F4 + "\x00o\x03\x03\x00\x00\x00\xf5" + // 0x006F0303: 0x000000F5 + "\x00o\x03\b\x00\x00\x00\xf6" + // 0x006F0308: 0x000000F6 + "\x00u\x03\x00\x00\x00\x00\xf9" + // 0x00750300: 0x000000F9 + "\x00u\x03\x01\x00\x00\x00\xfa" + // 0x00750301: 0x000000FA + "\x00u\x03\x02\x00\x00\x00\xfb" + // 0x00750302: 0x000000FB + "\x00u\x03\b\x00\x00\x00\xfc" + // 0x00750308: 0x000000FC + "\x00y\x03\x01\x00\x00\x00\xfd" + // 0x00790301: 0x000000FD + "\x00y\x03\b\x00\x00\x00\xff" + // 0x00790308: 0x000000FF + "\x00A\x03\x04\x00\x00\x01\x00" + // 0x00410304: 0x00000100 + "\x00a\x03\x04\x00\x00\x01\x01" + // 0x00610304: 0x00000101 + "\x00A\x03\x06\x00\x00\x01\x02" + // 0x00410306: 0x00000102 + "\x00a\x03\x06\x00\x00\x01\x03" + // 0x00610306: 0x00000103 + "\x00A\x03(\x00\x00\x01\x04" + // 0x00410328: 0x00000104 + "\x00a\x03(\x00\x00\x01\x05" + // 0x00610328: 0x00000105 + "\x00C\x03\x01\x00\x00\x01\x06" + // 0x00430301: 0x00000106 + "\x00c\x03\x01\x00\x00\x01\a" + // 0x00630301: 0x00000107 + "\x00C\x03\x02\x00\x00\x01\b" + // 0x00430302: 0x00000108 + "\x00c\x03\x02\x00\x00\x01\t" + // 0x00630302: 0x00000109 + "\x00C\x03\a\x00\x00\x01\n" + // 0x00430307: 0x0000010A + "\x00c\x03\a\x00\x00\x01\v" + // 0x00630307: 0x0000010B + "\x00C\x03\f\x00\x00\x01\f" + // 0x0043030C: 0x0000010C + "\x00c\x03\f\x00\x00\x01\r" + // 0x0063030C: 0x0000010D + "\x00D\x03\f\x00\x00\x01\x0e" + // 0x0044030C: 0x0000010E + "\x00d\x03\f\x00\x00\x01\x0f" + // 0x0064030C: 0x0000010F + "\x00E\x03\x04\x00\x00\x01\x12" + // 0x00450304: 0x00000112 + "\x00e\x03\x04\x00\x00\x01\x13" + // 0x00650304: 0x00000113 + "\x00E\x03\x06\x00\x00\x01\x14" + // 0x00450306: 0x00000114 + "\x00e\x03\x06\x00\x00\x01\x15" + // 0x00650306: 0x00000115 + "\x00E\x03\a\x00\x00\x01\x16" + // 0x00450307: 0x00000116 + "\x00e\x03\a\x00\x00\x01\x17" + // 0x00650307: 0x00000117 + "\x00E\x03(\x00\x00\x01\x18" + // 0x00450328: 0x00000118 + "\x00e\x03(\x00\x00\x01\x19" + // 0x00650328: 0x00000119 + "\x00E\x03\f\x00\x00\x01\x1a" + // 0x0045030C: 0x0000011A + "\x00e\x03\f\x00\x00\x01\x1b" + // 0x0065030C: 0x0000011B + "\x00G\x03\x02\x00\x00\x01\x1c" + // 0x00470302: 0x0000011C + "\x00g\x03\x02\x00\x00\x01\x1d" + // 0x00670302: 0x0000011D + "\x00G\x03\x06\x00\x00\x01\x1e" + // 0x00470306: 0x0000011E + "\x00g\x03\x06\x00\x00\x01\x1f" + // 0x00670306: 0x0000011F + "\x00G\x03\a\x00\x00\x01 " + // 0x00470307: 0x00000120 + "\x00g\x03\a\x00\x00\x01!" + // 0x00670307: 0x00000121 + "\x00G\x03'\x00\x00\x01\"" + // 0x00470327: 0x00000122 + "\x00g\x03'\x00\x00\x01#" + // 0x00670327: 0x00000123 + "\x00H\x03\x02\x00\x00\x01$" + // 0x00480302: 0x00000124 + "\x00h\x03\x02\x00\x00\x01%" + // 0x00680302: 0x00000125 + "\x00I\x03\x03\x00\x00\x01(" + // 0x00490303: 0x00000128 + "\x00i\x03\x03\x00\x00\x01)" + // 0x00690303: 0x00000129 + "\x00I\x03\x04\x00\x00\x01*" + // 0x00490304: 0x0000012A + "\x00i\x03\x04\x00\x00\x01+" + // 0x00690304: 0x0000012B + "\x00I\x03\x06\x00\x00\x01," + // 0x00490306: 0x0000012C + "\x00i\x03\x06\x00\x00\x01-" + // 0x00690306: 0x0000012D + "\x00I\x03(\x00\x00\x01." + // 0x00490328: 0x0000012E + "\x00i\x03(\x00\x00\x01/" + // 0x00690328: 0x0000012F + "\x00I\x03\a\x00\x00\x010" + // 0x00490307: 0x00000130 + "\x00J\x03\x02\x00\x00\x014" + // 0x004A0302: 0x00000134 + "\x00j\x03\x02\x00\x00\x015" + // 0x006A0302: 0x00000135 + "\x00K\x03'\x00\x00\x016" + // 0x004B0327: 0x00000136 + "\x00k\x03'\x00\x00\x017" + // 0x006B0327: 0x00000137 + "\x00L\x03\x01\x00\x00\x019" + // 0x004C0301: 0x00000139 + "\x00l\x03\x01\x00\x00\x01:" + // 0x006C0301: 0x0000013A + "\x00L\x03'\x00\x00\x01;" + // 0x004C0327: 0x0000013B + "\x00l\x03'\x00\x00\x01<" + // 0x006C0327: 0x0000013C + "\x00L\x03\f\x00\x00\x01=" + // 0x004C030C: 0x0000013D + "\x00l\x03\f\x00\x00\x01>" + // 0x006C030C: 0x0000013E + "\x00N\x03\x01\x00\x00\x01C" + // 0x004E0301: 0x00000143 + "\x00n\x03\x01\x00\x00\x01D" + // 0x006E0301: 0x00000144 + "\x00N\x03'\x00\x00\x01E" + // 0x004E0327: 0x00000145 + "\x00n\x03'\x00\x00\x01F" + // 0x006E0327: 0x00000146 + "\x00N\x03\f\x00\x00\x01G" + // 0x004E030C: 0x00000147 + "\x00n\x03\f\x00\x00\x01H" + // 0x006E030C: 0x00000148 + "\x00O\x03\x04\x00\x00\x01L" + // 0x004F0304: 0x0000014C + "\x00o\x03\x04\x00\x00\x01M" + // 0x006F0304: 0x0000014D + "\x00O\x03\x06\x00\x00\x01N" + // 0x004F0306: 0x0000014E + "\x00o\x03\x06\x00\x00\x01O" + // 0x006F0306: 0x0000014F + "\x00O\x03\v\x00\x00\x01P" + // 0x004F030B: 0x00000150 + "\x00o\x03\v\x00\x00\x01Q" + // 0x006F030B: 0x00000151 + "\x00R\x03\x01\x00\x00\x01T" + // 0x00520301: 0x00000154 + "\x00r\x03\x01\x00\x00\x01U" + // 0x00720301: 0x00000155 + "\x00R\x03'\x00\x00\x01V" + // 0x00520327: 0x00000156 + "\x00r\x03'\x00\x00\x01W" + // 0x00720327: 0x00000157 + "\x00R\x03\f\x00\x00\x01X" + // 0x0052030C: 0x00000158 + "\x00r\x03\f\x00\x00\x01Y" + // 0x0072030C: 0x00000159 + "\x00S\x03\x01\x00\x00\x01Z" + // 0x00530301: 0x0000015A + "\x00s\x03\x01\x00\x00\x01[" + // 0x00730301: 0x0000015B + "\x00S\x03\x02\x00\x00\x01\\" + // 0x00530302: 0x0000015C + "\x00s\x03\x02\x00\x00\x01]" + // 0x00730302: 0x0000015D + "\x00S\x03'\x00\x00\x01^" + // 0x00530327: 0x0000015E + "\x00s\x03'\x00\x00\x01_" + // 0x00730327: 0x0000015F + "\x00S\x03\f\x00\x00\x01`" + // 0x0053030C: 0x00000160 + "\x00s\x03\f\x00\x00\x01a" + // 0x0073030C: 0x00000161 + "\x00T\x03'\x00\x00\x01b" + // 0x00540327: 0x00000162 + "\x00t\x03'\x00\x00\x01c" + // 0x00740327: 0x00000163 + "\x00T\x03\f\x00\x00\x01d" + // 0x0054030C: 0x00000164 + "\x00t\x03\f\x00\x00\x01e" + // 0x0074030C: 0x00000165 + "\x00U\x03\x03\x00\x00\x01h" + // 0x00550303: 0x00000168 + "\x00u\x03\x03\x00\x00\x01i" + // 0x00750303: 0x00000169 + "\x00U\x03\x04\x00\x00\x01j" + // 0x00550304: 0x0000016A + "\x00u\x03\x04\x00\x00\x01k" + // 0x00750304: 0x0000016B + "\x00U\x03\x06\x00\x00\x01l" + // 0x00550306: 0x0000016C + "\x00u\x03\x06\x00\x00\x01m" + // 0x00750306: 0x0000016D + "\x00U\x03\n\x00\x00\x01n" + // 0x0055030A: 0x0000016E + "\x00u\x03\n\x00\x00\x01o" + // 0x0075030A: 0x0000016F + "\x00U\x03\v\x00\x00\x01p" + // 0x0055030B: 0x00000170 + "\x00u\x03\v\x00\x00\x01q" + // 0x0075030B: 0x00000171 + "\x00U\x03(\x00\x00\x01r" + // 0x00550328: 0x00000172 + "\x00u\x03(\x00\x00\x01s" + // 0x00750328: 0x00000173 + "\x00W\x03\x02\x00\x00\x01t" + // 0x00570302: 0x00000174 + "\x00w\x03\x02\x00\x00\x01u" + // 0x00770302: 0x00000175 + "\x00Y\x03\x02\x00\x00\x01v" + // 0x00590302: 0x00000176 + "\x00y\x03\x02\x00\x00\x01w" + // 0x00790302: 0x00000177 + "\x00Y\x03\b\x00\x00\x01x" + // 0x00590308: 0x00000178 + "\x00Z\x03\x01\x00\x00\x01y" + // 0x005A0301: 0x00000179 + "\x00z\x03\x01\x00\x00\x01z" + // 0x007A0301: 0x0000017A + "\x00Z\x03\a\x00\x00\x01{" + // 0x005A0307: 0x0000017B + "\x00z\x03\a\x00\x00\x01|" + // 0x007A0307: 0x0000017C + "\x00Z\x03\f\x00\x00\x01}" + // 0x005A030C: 0x0000017D + "\x00z\x03\f\x00\x00\x01~" + // 0x007A030C: 0x0000017E + "\x00O\x03\x1b\x00\x00\x01\xa0" + // 0x004F031B: 0x000001A0 + "\x00o\x03\x1b\x00\x00\x01\xa1" + // 0x006F031B: 0x000001A1 + "\x00U\x03\x1b\x00\x00\x01\xaf" + // 0x0055031B: 0x000001AF + "\x00u\x03\x1b\x00\x00\x01\xb0" + // 0x0075031B: 0x000001B0 + "\x00A\x03\f\x00\x00\x01\xcd" + // 0x0041030C: 0x000001CD + "\x00a\x03\f\x00\x00\x01\xce" + // 0x0061030C: 0x000001CE + "\x00I\x03\f\x00\x00\x01\xcf" + // 0x0049030C: 0x000001CF + "\x00i\x03\f\x00\x00\x01\xd0" + // 0x0069030C: 0x000001D0 + "\x00O\x03\f\x00\x00\x01\xd1" + // 0x004F030C: 0x000001D1 + "\x00o\x03\f\x00\x00\x01\xd2" + // 0x006F030C: 0x000001D2 + "\x00U\x03\f\x00\x00\x01\xd3" + // 0x0055030C: 0x000001D3 + "\x00u\x03\f\x00\x00\x01\xd4" + // 0x0075030C: 0x000001D4 + "\x00\xdc\x03\x04\x00\x00\x01\xd5" + // 0x00DC0304: 0x000001D5 + "\x00\xfc\x03\x04\x00\x00\x01\xd6" + // 0x00FC0304: 0x000001D6 + "\x00\xdc\x03\x01\x00\x00\x01\xd7" + // 0x00DC0301: 0x000001D7 + "\x00\xfc\x03\x01\x00\x00\x01\xd8" + // 0x00FC0301: 0x000001D8 + "\x00\xdc\x03\f\x00\x00\x01\xd9" + // 0x00DC030C: 0x000001D9 + "\x00\xfc\x03\f\x00\x00\x01\xda" + // 0x00FC030C: 0x000001DA + "\x00\xdc\x03\x00\x00\x00\x01\xdb" + // 0x00DC0300: 0x000001DB + "\x00\xfc\x03\x00\x00\x00\x01\xdc" + // 0x00FC0300: 0x000001DC + "\x00\xc4\x03\x04\x00\x00\x01\xde" + // 0x00C40304: 0x000001DE + "\x00\xe4\x03\x04\x00\x00\x01\xdf" + // 0x00E40304: 0x000001DF + "\x02&\x03\x04\x00\x00\x01\xe0" + // 0x02260304: 0x000001E0 + "\x02'\x03\x04\x00\x00\x01\xe1" + // 0x02270304: 0x000001E1 + "\x00\xc6\x03\x04\x00\x00\x01\xe2" + // 0x00C60304: 0x000001E2 + "\x00\xe6\x03\x04\x00\x00\x01\xe3" + // 0x00E60304: 0x000001E3 + "\x00G\x03\f\x00\x00\x01\xe6" + // 0x0047030C: 0x000001E6 + "\x00g\x03\f\x00\x00\x01\xe7" + // 0x0067030C: 0x000001E7 + "\x00K\x03\f\x00\x00\x01\xe8" + // 0x004B030C: 0x000001E8 + "\x00k\x03\f\x00\x00\x01\xe9" + // 0x006B030C: 0x000001E9 + "\x00O\x03(\x00\x00\x01\xea" + // 0x004F0328: 0x000001EA + "\x00o\x03(\x00\x00\x01\xeb" + // 0x006F0328: 0x000001EB + "\x01\xea\x03\x04\x00\x00\x01\xec" + // 0x01EA0304: 0x000001EC + "\x01\xeb\x03\x04\x00\x00\x01\xed" + // 0x01EB0304: 0x000001ED + "\x01\xb7\x03\f\x00\x00\x01\xee" + // 0x01B7030C: 0x000001EE + "\x02\x92\x03\f\x00\x00\x01\xef" + // 0x0292030C: 0x000001EF + "\x00j\x03\f\x00\x00\x01\xf0" + // 0x006A030C: 0x000001F0 + "\x00G\x03\x01\x00\x00\x01\xf4" + // 0x00470301: 0x000001F4 + "\x00g\x03\x01\x00\x00\x01\xf5" + // 0x00670301: 0x000001F5 + "\x00N\x03\x00\x00\x00\x01\xf8" + // 0x004E0300: 0x000001F8 + "\x00n\x03\x00\x00\x00\x01\xf9" + // 0x006E0300: 0x000001F9 + "\x00\xc5\x03\x01\x00\x00\x01\xfa" + // 0x00C50301: 0x000001FA + "\x00\xe5\x03\x01\x00\x00\x01\xfb" + // 0x00E50301: 0x000001FB + "\x00\xc6\x03\x01\x00\x00\x01\xfc" + // 0x00C60301: 0x000001FC + "\x00\xe6\x03\x01\x00\x00\x01\xfd" + // 0x00E60301: 0x000001FD + "\x00\xd8\x03\x01\x00\x00\x01\xfe" + // 0x00D80301: 0x000001FE + "\x00\xf8\x03\x01\x00\x00\x01\xff" + // 0x00F80301: 0x000001FF + "\x00A\x03\x0f\x00\x00\x02\x00" + // 0x0041030F: 0x00000200 + "\x00a\x03\x0f\x00\x00\x02\x01" + // 0x0061030F: 0x00000201 + "\x00A\x03\x11\x00\x00\x02\x02" + // 0x00410311: 0x00000202 + "\x00a\x03\x11\x00\x00\x02\x03" + // 0x00610311: 0x00000203 + "\x00E\x03\x0f\x00\x00\x02\x04" + // 0x0045030F: 0x00000204 + "\x00e\x03\x0f\x00\x00\x02\x05" + // 0x0065030F: 0x00000205 + "\x00E\x03\x11\x00\x00\x02\x06" + // 0x00450311: 0x00000206 + "\x00e\x03\x11\x00\x00\x02\a" + // 0x00650311: 0x00000207 + "\x00I\x03\x0f\x00\x00\x02\b" + // 0x0049030F: 0x00000208 + "\x00i\x03\x0f\x00\x00\x02\t" + // 0x0069030F: 0x00000209 + "\x00I\x03\x11\x00\x00\x02\n" + // 0x00490311: 0x0000020A + "\x00i\x03\x11\x00\x00\x02\v" + // 0x00690311: 0x0000020B + "\x00O\x03\x0f\x00\x00\x02\f" + // 0x004F030F: 0x0000020C + "\x00o\x03\x0f\x00\x00\x02\r" + // 0x006F030F: 0x0000020D + "\x00O\x03\x11\x00\x00\x02\x0e" + // 0x004F0311: 0x0000020E + "\x00o\x03\x11\x00\x00\x02\x0f" + // 0x006F0311: 0x0000020F + "\x00R\x03\x0f\x00\x00\x02\x10" + // 0x0052030F: 0x00000210 + "\x00r\x03\x0f\x00\x00\x02\x11" + // 0x0072030F: 0x00000211 + "\x00R\x03\x11\x00\x00\x02\x12" + // 0x00520311: 0x00000212 + "\x00r\x03\x11\x00\x00\x02\x13" + // 0x00720311: 0x00000213 + "\x00U\x03\x0f\x00\x00\x02\x14" + // 0x0055030F: 0x00000214 + "\x00u\x03\x0f\x00\x00\x02\x15" + // 0x0075030F: 0x00000215 + "\x00U\x03\x11\x00\x00\x02\x16" + // 0x00550311: 0x00000216 + "\x00u\x03\x11\x00\x00\x02\x17" + // 0x00750311: 0x00000217 + "\x00S\x03&\x00\x00\x02\x18" + // 0x00530326: 0x00000218 + "\x00s\x03&\x00\x00\x02\x19" + // 0x00730326: 0x00000219 + "\x00T\x03&\x00\x00\x02\x1a" + // 0x00540326: 0x0000021A + "\x00t\x03&\x00\x00\x02\x1b" + // 0x00740326: 0x0000021B + "\x00H\x03\f\x00\x00\x02\x1e" + // 0x0048030C: 0x0000021E + "\x00h\x03\f\x00\x00\x02\x1f" + // 0x0068030C: 0x0000021F + "\x00A\x03\a\x00\x00\x02&" + // 0x00410307: 0x00000226 + "\x00a\x03\a\x00\x00\x02'" + // 0x00610307: 0x00000227 + "\x00E\x03'\x00\x00\x02(" + // 0x00450327: 0x00000228 + "\x00e\x03'\x00\x00\x02)" + // 0x00650327: 0x00000229 + "\x00\xd6\x03\x04\x00\x00\x02*" + // 0x00D60304: 0x0000022A + "\x00\xf6\x03\x04\x00\x00\x02+" + // 0x00F60304: 0x0000022B + "\x00\xd5\x03\x04\x00\x00\x02," + // 0x00D50304: 0x0000022C + "\x00\xf5\x03\x04\x00\x00\x02-" + // 0x00F50304: 0x0000022D + "\x00O\x03\a\x00\x00\x02." + // 0x004F0307: 0x0000022E + "\x00o\x03\a\x00\x00\x02/" + // 0x006F0307: 0x0000022F + "\x02.\x03\x04\x00\x00\x020" + // 0x022E0304: 0x00000230 + "\x02/\x03\x04\x00\x00\x021" + // 0x022F0304: 0x00000231 + "\x00Y\x03\x04\x00\x00\x022" + // 0x00590304: 0x00000232 + "\x00y\x03\x04\x00\x00\x023" + // 0x00790304: 0x00000233 + "\x00\xa8\x03\x01\x00\x00\x03\x85" + // 0x00A80301: 0x00000385 + "\x03\x91\x03\x01\x00\x00\x03\x86" + // 0x03910301: 0x00000386 + "\x03\x95\x03\x01\x00\x00\x03\x88" + // 0x03950301: 0x00000388 + "\x03\x97\x03\x01\x00\x00\x03\x89" + // 0x03970301: 0x00000389 + "\x03\x99\x03\x01\x00\x00\x03\x8a" + // 0x03990301: 0x0000038A + "\x03\x9f\x03\x01\x00\x00\x03\x8c" + // 0x039F0301: 0x0000038C + "\x03\xa5\x03\x01\x00\x00\x03\x8e" + // 0x03A50301: 0x0000038E + "\x03\xa9\x03\x01\x00\x00\x03\x8f" + // 0x03A90301: 0x0000038F + "\x03\xca\x03\x01\x00\x00\x03\x90" + // 0x03CA0301: 0x00000390 + "\x03\x99\x03\b\x00\x00\x03\xaa" + // 0x03990308: 0x000003AA + "\x03\xa5\x03\b\x00\x00\x03\xab" + // 0x03A50308: 0x000003AB + "\x03\xb1\x03\x01\x00\x00\x03\xac" + // 0x03B10301: 0x000003AC + "\x03\xb5\x03\x01\x00\x00\x03\xad" + // 0x03B50301: 0x000003AD + "\x03\xb7\x03\x01\x00\x00\x03\xae" + // 0x03B70301: 0x000003AE + "\x03\xb9\x03\x01\x00\x00\x03\xaf" + // 0x03B90301: 0x000003AF + "\x03\xcb\x03\x01\x00\x00\x03\xb0" + // 0x03CB0301: 0x000003B0 + "\x03\xb9\x03\b\x00\x00\x03\xca" + // 0x03B90308: 0x000003CA + "\x03\xc5\x03\b\x00\x00\x03\xcb" + // 0x03C50308: 0x000003CB + "\x03\xbf\x03\x01\x00\x00\x03\xcc" + // 0x03BF0301: 0x000003CC + "\x03\xc5\x03\x01\x00\x00\x03\xcd" + // 0x03C50301: 0x000003CD + "\x03\xc9\x03\x01\x00\x00\x03\xce" + // 0x03C90301: 0x000003CE + "\x03\xd2\x03\x01\x00\x00\x03\xd3" + // 0x03D20301: 0x000003D3 + "\x03\xd2\x03\b\x00\x00\x03\xd4" + // 0x03D20308: 0x000003D4 + "\x04\x15\x03\x00\x00\x00\x04\x00" + // 0x04150300: 0x00000400 + "\x04\x15\x03\b\x00\x00\x04\x01" + // 0x04150308: 0x00000401 + "\x04\x13\x03\x01\x00\x00\x04\x03" + // 0x04130301: 0x00000403 + "\x04\x06\x03\b\x00\x00\x04\a" + // 0x04060308: 0x00000407 + "\x04\x1a\x03\x01\x00\x00\x04\f" + // 0x041A0301: 0x0000040C + "\x04\x18\x03\x00\x00\x00\x04\r" + // 0x04180300: 0x0000040D + "\x04#\x03\x06\x00\x00\x04\x0e" + // 0x04230306: 0x0000040E + "\x04\x18\x03\x06\x00\x00\x04\x19" + // 0x04180306: 0x00000419 + "\x048\x03\x06\x00\x00\x049" + // 0x04380306: 0x00000439 + "\x045\x03\x00\x00\x00\x04P" + // 0x04350300: 0x00000450 + "\x045\x03\b\x00\x00\x04Q" + // 0x04350308: 0x00000451 + "\x043\x03\x01\x00\x00\x04S" + // 0x04330301: 0x00000453 + "\x04V\x03\b\x00\x00\x04W" + // 0x04560308: 0x00000457 + "\x04:\x03\x01\x00\x00\x04\\" + // 0x043A0301: 0x0000045C + "\x048\x03\x00\x00\x00\x04]" + // 0x04380300: 0x0000045D + "\x04C\x03\x06\x00\x00\x04^" + // 0x04430306: 0x0000045E + "\x04t\x03\x0f\x00\x00\x04v" + // 0x0474030F: 0x00000476 + "\x04u\x03\x0f\x00\x00\x04w" + // 0x0475030F: 0x00000477 + "\x04\x16\x03\x06\x00\x00\x04\xc1" + // 0x04160306: 0x000004C1 + "\x046\x03\x06\x00\x00\x04\xc2" + // 0x04360306: 0x000004C2 + "\x04\x10\x03\x06\x00\x00\x04\xd0" + // 0x04100306: 0x000004D0 + "\x040\x03\x06\x00\x00\x04\xd1" + // 0x04300306: 0x000004D1 + "\x04\x10\x03\b\x00\x00\x04\xd2" + // 0x04100308: 0x000004D2 + "\x040\x03\b\x00\x00\x04\xd3" + // 0x04300308: 0x000004D3 + "\x04\x15\x03\x06\x00\x00\x04\xd6" + // 0x04150306: 0x000004D6 + "\x045\x03\x06\x00\x00\x04\xd7" + // 0x04350306: 0x000004D7 + "\x04\xd8\x03\b\x00\x00\x04\xda" + // 0x04D80308: 0x000004DA + "\x04\xd9\x03\b\x00\x00\x04\xdb" + // 0x04D90308: 0x000004DB + "\x04\x16\x03\b\x00\x00\x04\xdc" + // 0x04160308: 0x000004DC + "\x046\x03\b\x00\x00\x04\xdd" + // 0x04360308: 0x000004DD + "\x04\x17\x03\b\x00\x00\x04\xde" + // 0x04170308: 0x000004DE + "\x047\x03\b\x00\x00\x04\xdf" + // 0x04370308: 0x000004DF + "\x04\x18\x03\x04\x00\x00\x04\xe2" + // 0x04180304: 0x000004E2 + "\x048\x03\x04\x00\x00\x04\xe3" + // 0x04380304: 0x000004E3 + "\x04\x18\x03\b\x00\x00\x04\xe4" + // 0x04180308: 0x000004E4 + "\x048\x03\b\x00\x00\x04\xe5" + // 0x04380308: 0x000004E5 + "\x04\x1e\x03\b\x00\x00\x04\xe6" + // 0x041E0308: 0x000004E6 + "\x04>\x03\b\x00\x00\x04\xe7" + // 0x043E0308: 0x000004E7 + "\x04\xe8\x03\b\x00\x00\x04\xea" + // 0x04E80308: 0x000004EA + "\x04\xe9\x03\b\x00\x00\x04\xeb" + // 0x04E90308: 0x000004EB + "\x04-\x03\b\x00\x00\x04\xec" + // 0x042D0308: 0x000004EC + "\x04M\x03\b\x00\x00\x04\xed" + // 0x044D0308: 0x000004ED + "\x04#\x03\x04\x00\x00\x04\xee" + // 0x04230304: 0x000004EE + "\x04C\x03\x04\x00\x00\x04\xef" + // 0x04430304: 0x000004EF + "\x04#\x03\b\x00\x00\x04\xf0" + // 0x04230308: 0x000004F0 + "\x04C\x03\b\x00\x00\x04\xf1" + // 0x04430308: 0x000004F1 + "\x04#\x03\v\x00\x00\x04\xf2" + // 0x0423030B: 0x000004F2 + "\x04C\x03\v\x00\x00\x04\xf3" + // 0x0443030B: 0x000004F3 + "\x04'\x03\b\x00\x00\x04\xf4" + // 0x04270308: 0x000004F4 + "\x04G\x03\b\x00\x00\x04\xf5" + // 0x04470308: 0x000004F5 + "\x04+\x03\b\x00\x00\x04\xf8" + // 0x042B0308: 0x000004F8 + "\x04K\x03\b\x00\x00\x04\xf9" + // 0x044B0308: 0x000004F9 + "\x06'\x06S\x00\x00\x06\"" + // 0x06270653: 0x00000622 + "\x06'\x06T\x00\x00\x06#" + // 0x06270654: 0x00000623 + "\x06H\x06T\x00\x00\x06$" + // 0x06480654: 0x00000624 + "\x06'\x06U\x00\x00\x06%" + // 0x06270655: 0x00000625 + "\x06J\x06T\x00\x00\x06&" + // 0x064A0654: 0x00000626 + "\x06\xd5\x06T\x00\x00\x06\xc0" + // 0x06D50654: 0x000006C0 + "\x06\xc1\x06T\x00\x00\x06\xc2" + // 0x06C10654: 0x000006C2 + "\x06\xd2\x06T\x00\x00\x06\xd3" + // 0x06D20654: 0x000006D3 + "\t(\t<\x00\x00\t)" + // 0x0928093C: 0x00000929 + "\t0\t<\x00\x00\t1" + // 0x0930093C: 0x00000931 + "\t3\t<\x00\x00\t4" + // 0x0933093C: 0x00000934 + "\t\xc7\t\xbe\x00\x00\t\xcb" + // 0x09C709BE: 0x000009CB + "\t\xc7\t\xd7\x00\x00\t\xcc" + // 0x09C709D7: 0x000009CC + "\vG\vV\x00\x00\vH" + // 0x0B470B56: 0x00000B48 + "\vG\v>\x00\x00\vK" + // 0x0B470B3E: 0x00000B4B + "\vG\vW\x00\x00\vL" + // 0x0B470B57: 0x00000B4C + "\v\x92\v\xd7\x00\x00\v\x94" + // 0x0B920BD7: 0x00000B94 + "\v\xc6\v\xbe\x00\x00\v\xca" + // 0x0BC60BBE: 0x00000BCA + "\v\xc7\v\xbe\x00\x00\v\xcb" + // 0x0BC70BBE: 0x00000BCB + "\v\xc6\v\xd7\x00\x00\v\xcc" + // 0x0BC60BD7: 0x00000BCC + "\fF\fV\x00\x00\fH" + // 0x0C460C56: 0x00000C48 + "\f\xbf\f\xd5\x00\x00\f\xc0" + // 0x0CBF0CD5: 0x00000CC0 + "\f\xc6\f\xd5\x00\x00\f\xc7" + // 0x0CC60CD5: 0x00000CC7 + "\f\xc6\f\xd6\x00\x00\f\xc8" + // 0x0CC60CD6: 0x00000CC8 + "\f\xc6\f\xc2\x00\x00\f\xca" + // 0x0CC60CC2: 0x00000CCA + "\f\xca\f\xd5\x00\x00\f\xcb" + // 0x0CCA0CD5: 0x00000CCB + "\rF\r>\x00\x00\rJ" + // 0x0D460D3E: 0x00000D4A + "\rG\r>\x00\x00\rK" + // 0x0D470D3E: 0x00000D4B + "\rF\rW\x00\x00\rL" + // 0x0D460D57: 0x00000D4C + "\r\xd9\r\xca\x00\x00\r\xda" + // 0x0DD90DCA: 0x00000DDA + "\r\xd9\r\xcf\x00\x00\r\xdc" + // 0x0DD90DCF: 0x00000DDC + "\r\xdc\r\xca\x00\x00\r\xdd" + // 0x0DDC0DCA: 0x00000DDD + "\r\xd9\r\xdf\x00\x00\r\xde" + // 0x0DD90DDF: 0x00000DDE + "\x10%\x10.\x00\x00\x10&" + // 0x1025102E: 0x00001026 + "\x1b\x05\x1b5\x00\x00\x1b\x06" + // 0x1B051B35: 0x00001B06 + "\x1b\a\x1b5\x00\x00\x1b\b" + // 0x1B071B35: 0x00001B08 + "\x1b\t\x1b5\x00\x00\x1b\n" + // 0x1B091B35: 0x00001B0A + "\x1b\v\x1b5\x00\x00\x1b\f" + // 0x1B0B1B35: 0x00001B0C + "\x1b\r\x1b5\x00\x00\x1b\x0e" + // 0x1B0D1B35: 0x00001B0E + "\x1b\x11\x1b5\x00\x00\x1b\x12" + // 0x1B111B35: 0x00001B12 + "\x1b:\x1b5\x00\x00\x1b;" + // 0x1B3A1B35: 0x00001B3B + "\x1b<\x1b5\x00\x00\x1b=" + // 0x1B3C1B35: 0x00001B3D + "\x1b>\x1b5\x00\x00\x1b@" + // 0x1B3E1B35: 0x00001B40 + "\x1b?\x1b5\x00\x00\x1bA" + // 0x1B3F1B35: 0x00001B41 + "\x1bB\x1b5\x00\x00\x1bC" + // 0x1B421B35: 0x00001B43 + "\x00A\x03%\x00\x00\x1e\x00" + // 0x00410325: 0x00001E00 + "\x00a\x03%\x00\x00\x1e\x01" + // 0x00610325: 0x00001E01 + "\x00B\x03\a\x00\x00\x1e\x02" + // 0x00420307: 0x00001E02 + "\x00b\x03\a\x00\x00\x1e\x03" + // 0x00620307: 0x00001E03 + "\x00B\x03#\x00\x00\x1e\x04" + // 0x00420323: 0x00001E04 + "\x00b\x03#\x00\x00\x1e\x05" + // 0x00620323: 0x00001E05 + "\x00B\x031\x00\x00\x1e\x06" + // 0x00420331: 0x00001E06 + "\x00b\x031\x00\x00\x1e\a" + // 0x00620331: 0x00001E07 + "\x00\xc7\x03\x01\x00\x00\x1e\b" + // 0x00C70301: 0x00001E08 + "\x00\xe7\x03\x01\x00\x00\x1e\t" + // 0x00E70301: 0x00001E09 + "\x00D\x03\a\x00\x00\x1e\n" + // 0x00440307: 0x00001E0A + "\x00d\x03\a\x00\x00\x1e\v" + // 0x00640307: 0x00001E0B + "\x00D\x03#\x00\x00\x1e\f" + // 0x00440323: 0x00001E0C + "\x00d\x03#\x00\x00\x1e\r" + // 0x00640323: 0x00001E0D + "\x00D\x031\x00\x00\x1e\x0e" + // 0x00440331: 0x00001E0E + "\x00d\x031\x00\x00\x1e\x0f" + // 0x00640331: 0x00001E0F + "\x00D\x03'\x00\x00\x1e\x10" + // 0x00440327: 0x00001E10 + "\x00d\x03'\x00\x00\x1e\x11" + // 0x00640327: 0x00001E11 + "\x00D\x03-\x00\x00\x1e\x12" + // 0x0044032D: 0x00001E12 + "\x00d\x03-\x00\x00\x1e\x13" + // 0x0064032D: 0x00001E13 + "\x01\x12\x03\x00\x00\x00\x1e\x14" + // 0x01120300: 0x00001E14 + "\x01\x13\x03\x00\x00\x00\x1e\x15" + // 0x01130300: 0x00001E15 + "\x01\x12\x03\x01\x00\x00\x1e\x16" + // 0x01120301: 0x00001E16 + "\x01\x13\x03\x01\x00\x00\x1e\x17" + // 0x01130301: 0x00001E17 + "\x00E\x03-\x00\x00\x1e\x18" + // 0x0045032D: 0x00001E18 + "\x00e\x03-\x00\x00\x1e\x19" + // 0x0065032D: 0x00001E19 + "\x00E\x030\x00\x00\x1e\x1a" + // 0x00450330: 0x00001E1A + "\x00e\x030\x00\x00\x1e\x1b" + // 0x00650330: 0x00001E1B + "\x02(\x03\x06\x00\x00\x1e\x1c" + // 0x02280306: 0x00001E1C + "\x02)\x03\x06\x00\x00\x1e\x1d" + // 0x02290306: 0x00001E1D + "\x00F\x03\a\x00\x00\x1e\x1e" + // 0x00460307: 0x00001E1E + "\x00f\x03\a\x00\x00\x1e\x1f" + // 0x00660307: 0x00001E1F + "\x00G\x03\x04\x00\x00\x1e " + // 0x00470304: 0x00001E20 + "\x00g\x03\x04\x00\x00\x1e!" + // 0x00670304: 0x00001E21 + "\x00H\x03\a\x00\x00\x1e\"" + // 0x00480307: 0x00001E22 + "\x00h\x03\a\x00\x00\x1e#" + // 0x00680307: 0x00001E23 + "\x00H\x03#\x00\x00\x1e$" + // 0x00480323: 0x00001E24 + "\x00h\x03#\x00\x00\x1e%" + // 0x00680323: 0x00001E25 + "\x00H\x03\b\x00\x00\x1e&" + // 0x00480308: 0x00001E26 + "\x00h\x03\b\x00\x00\x1e'" + // 0x00680308: 0x00001E27 + "\x00H\x03'\x00\x00\x1e(" + // 0x00480327: 0x00001E28 + "\x00h\x03'\x00\x00\x1e)" + // 0x00680327: 0x00001E29 + "\x00H\x03.\x00\x00\x1e*" + // 0x0048032E: 0x00001E2A + "\x00h\x03.\x00\x00\x1e+" + // 0x0068032E: 0x00001E2B + "\x00I\x030\x00\x00\x1e," + // 0x00490330: 0x00001E2C + "\x00i\x030\x00\x00\x1e-" + // 0x00690330: 0x00001E2D + "\x00\xcf\x03\x01\x00\x00\x1e." + // 0x00CF0301: 0x00001E2E + "\x00\xef\x03\x01\x00\x00\x1e/" + // 0x00EF0301: 0x00001E2F + "\x00K\x03\x01\x00\x00\x1e0" + // 0x004B0301: 0x00001E30 + "\x00k\x03\x01\x00\x00\x1e1" + // 0x006B0301: 0x00001E31 + "\x00K\x03#\x00\x00\x1e2" + // 0x004B0323: 0x00001E32 + "\x00k\x03#\x00\x00\x1e3" + // 0x006B0323: 0x00001E33 + "\x00K\x031\x00\x00\x1e4" + // 0x004B0331: 0x00001E34 + "\x00k\x031\x00\x00\x1e5" + // 0x006B0331: 0x00001E35 + "\x00L\x03#\x00\x00\x1e6" + // 0x004C0323: 0x00001E36 + "\x00l\x03#\x00\x00\x1e7" + // 0x006C0323: 0x00001E37 + "\x1e6\x03\x04\x00\x00\x1e8" + // 0x1E360304: 0x00001E38 + "\x1e7\x03\x04\x00\x00\x1e9" + // 0x1E370304: 0x00001E39 + "\x00L\x031\x00\x00\x1e:" + // 0x004C0331: 0x00001E3A + "\x00l\x031\x00\x00\x1e;" + // 0x006C0331: 0x00001E3B + "\x00L\x03-\x00\x00\x1e<" + // 0x004C032D: 0x00001E3C + "\x00l\x03-\x00\x00\x1e=" + // 0x006C032D: 0x00001E3D + "\x00M\x03\x01\x00\x00\x1e>" + // 0x004D0301: 0x00001E3E + "\x00m\x03\x01\x00\x00\x1e?" + // 0x006D0301: 0x00001E3F + "\x00M\x03\a\x00\x00\x1e@" + // 0x004D0307: 0x00001E40 + "\x00m\x03\a\x00\x00\x1eA" + // 0x006D0307: 0x00001E41 + "\x00M\x03#\x00\x00\x1eB" + // 0x004D0323: 0x00001E42 + "\x00m\x03#\x00\x00\x1eC" + // 0x006D0323: 0x00001E43 + "\x00N\x03\a\x00\x00\x1eD" + // 0x004E0307: 0x00001E44 + "\x00n\x03\a\x00\x00\x1eE" + // 0x006E0307: 0x00001E45 + "\x00N\x03#\x00\x00\x1eF" + // 0x004E0323: 0x00001E46 + "\x00n\x03#\x00\x00\x1eG" + // 0x006E0323: 0x00001E47 + "\x00N\x031\x00\x00\x1eH" + // 0x004E0331: 0x00001E48 + "\x00n\x031\x00\x00\x1eI" + // 0x006E0331: 0x00001E49 + "\x00N\x03-\x00\x00\x1eJ" + // 0x004E032D: 0x00001E4A + "\x00n\x03-\x00\x00\x1eK" + // 0x006E032D: 0x00001E4B + "\x00\xd5\x03\x01\x00\x00\x1eL" + // 0x00D50301: 0x00001E4C + "\x00\xf5\x03\x01\x00\x00\x1eM" + // 0x00F50301: 0x00001E4D + "\x00\xd5\x03\b\x00\x00\x1eN" + // 0x00D50308: 0x00001E4E + "\x00\xf5\x03\b\x00\x00\x1eO" + // 0x00F50308: 0x00001E4F + "\x01L\x03\x00\x00\x00\x1eP" + // 0x014C0300: 0x00001E50 + "\x01M\x03\x00\x00\x00\x1eQ" + // 0x014D0300: 0x00001E51 + "\x01L\x03\x01\x00\x00\x1eR" + // 0x014C0301: 0x00001E52 + "\x01M\x03\x01\x00\x00\x1eS" + // 0x014D0301: 0x00001E53 + "\x00P\x03\x01\x00\x00\x1eT" + // 0x00500301: 0x00001E54 + "\x00p\x03\x01\x00\x00\x1eU" + // 0x00700301: 0x00001E55 + "\x00P\x03\a\x00\x00\x1eV" + // 0x00500307: 0x00001E56 + "\x00p\x03\a\x00\x00\x1eW" + // 0x00700307: 0x00001E57 + "\x00R\x03\a\x00\x00\x1eX" + // 0x00520307: 0x00001E58 + "\x00r\x03\a\x00\x00\x1eY" + // 0x00720307: 0x00001E59 + "\x00R\x03#\x00\x00\x1eZ" + // 0x00520323: 0x00001E5A + "\x00r\x03#\x00\x00\x1e[" + // 0x00720323: 0x00001E5B + "\x1eZ\x03\x04\x00\x00\x1e\\" + // 0x1E5A0304: 0x00001E5C + "\x1e[\x03\x04\x00\x00\x1e]" + // 0x1E5B0304: 0x00001E5D + "\x00R\x031\x00\x00\x1e^" + // 0x00520331: 0x00001E5E + "\x00r\x031\x00\x00\x1e_" + // 0x00720331: 0x00001E5F + "\x00S\x03\a\x00\x00\x1e`" + // 0x00530307: 0x00001E60 + "\x00s\x03\a\x00\x00\x1ea" + // 0x00730307: 0x00001E61 + "\x00S\x03#\x00\x00\x1eb" + // 0x00530323: 0x00001E62 + "\x00s\x03#\x00\x00\x1ec" + // 0x00730323: 0x00001E63 + "\x01Z\x03\a\x00\x00\x1ed" + // 0x015A0307: 0x00001E64 + "\x01[\x03\a\x00\x00\x1ee" + // 0x015B0307: 0x00001E65 + "\x01`\x03\a\x00\x00\x1ef" + // 0x01600307: 0x00001E66 + "\x01a\x03\a\x00\x00\x1eg" + // 0x01610307: 0x00001E67 + "\x1eb\x03\a\x00\x00\x1eh" + // 0x1E620307: 0x00001E68 + "\x1ec\x03\a\x00\x00\x1ei" + // 0x1E630307: 0x00001E69 + "\x00T\x03\a\x00\x00\x1ej" + // 0x00540307: 0x00001E6A + "\x00t\x03\a\x00\x00\x1ek" + // 0x00740307: 0x00001E6B + "\x00T\x03#\x00\x00\x1el" + // 0x00540323: 0x00001E6C + "\x00t\x03#\x00\x00\x1em" + // 0x00740323: 0x00001E6D + "\x00T\x031\x00\x00\x1en" + // 0x00540331: 0x00001E6E + "\x00t\x031\x00\x00\x1eo" + // 0x00740331: 0x00001E6F + "\x00T\x03-\x00\x00\x1ep" + // 0x0054032D: 0x00001E70 + "\x00t\x03-\x00\x00\x1eq" + // 0x0074032D: 0x00001E71 + "\x00U\x03$\x00\x00\x1er" + // 0x00550324: 0x00001E72 + "\x00u\x03$\x00\x00\x1es" + // 0x00750324: 0x00001E73 + "\x00U\x030\x00\x00\x1et" + // 0x00550330: 0x00001E74 + "\x00u\x030\x00\x00\x1eu" + // 0x00750330: 0x00001E75 + "\x00U\x03-\x00\x00\x1ev" + // 0x0055032D: 0x00001E76 + "\x00u\x03-\x00\x00\x1ew" + // 0x0075032D: 0x00001E77 + "\x01h\x03\x01\x00\x00\x1ex" + // 0x01680301: 0x00001E78 + "\x01i\x03\x01\x00\x00\x1ey" + // 0x01690301: 0x00001E79 + "\x01j\x03\b\x00\x00\x1ez" + // 0x016A0308: 0x00001E7A + "\x01k\x03\b\x00\x00\x1e{" + // 0x016B0308: 0x00001E7B + "\x00V\x03\x03\x00\x00\x1e|" + // 0x00560303: 0x00001E7C + "\x00v\x03\x03\x00\x00\x1e}" + // 0x00760303: 0x00001E7D + "\x00V\x03#\x00\x00\x1e~" + // 0x00560323: 0x00001E7E + "\x00v\x03#\x00\x00\x1e\u007f" + // 0x00760323: 0x00001E7F + "\x00W\x03\x00\x00\x00\x1e\x80" + // 0x00570300: 0x00001E80 + "\x00w\x03\x00\x00\x00\x1e\x81" + // 0x00770300: 0x00001E81 + "\x00W\x03\x01\x00\x00\x1e\x82" + // 0x00570301: 0x00001E82 + "\x00w\x03\x01\x00\x00\x1e\x83" + // 0x00770301: 0x00001E83 + "\x00W\x03\b\x00\x00\x1e\x84" + // 0x00570308: 0x00001E84 + "\x00w\x03\b\x00\x00\x1e\x85" + // 0x00770308: 0x00001E85 + "\x00W\x03\a\x00\x00\x1e\x86" + // 0x00570307: 0x00001E86 + "\x00w\x03\a\x00\x00\x1e\x87" + // 0x00770307: 0x00001E87 + "\x00W\x03#\x00\x00\x1e\x88" + // 0x00570323: 0x00001E88 + "\x00w\x03#\x00\x00\x1e\x89" + // 0x00770323: 0x00001E89 + "\x00X\x03\a\x00\x00\x1e\x8a" + // 0x00580307: 0x00001E8A + "\x00x\x03\a\x00\x00\x1e\x8b" + // 0x00780307: 0x00001E8B + "\x00X\x03\b\x00\x00\x1e\x8c" + // 0x00580308: 0x00001E8C + "\x00x\x03\b\x00\x00\x1e\x8d" + // 0x00780308: 0x00001E8D + "\x00Y\x03\a\x00\x00\x1e\x8e" + // 0x00590307: 0x00001E8E + "\x00y\x03\a\x00\x00\x1e\x8f" + // 0x00790307: 0x00001E8F + "\x00Z\x03\x02\x00\x00\x1e\x90" + // 0x005A0302: 0x00001E90 + "\x00z\x03\x02\x00\x00\x1e\x91" + // 0x007A0302: 0x00001E91 + "\x00Z\x03#\x00\x00\x1e\x92" + // 0x005A0323: 0x00001E92 + "\x00z\x03#\x00\x00\x1e\x93" + // 0x007A0323: 0x00001E93 + "\x00Z\x031\x00\x00\x1e\x94" + // 0x005A0331: 0x00001E94 + "\x00z\x031\x00\x00\x1e\x95" + // 0x007A0331: 0x00001E95 + "\x00h\x031\x00\x00\x1e\x96" + // 0x00680331: 0x00001E96 + "\x00t\x03\b\x00\x00\x1e\x97" + // 0x00740308: 0x00001E97 + "\x00w\x03\n\x00\x00\x1e\x98" + // 0x0077030A: 0x00001E98 + "\x00y\x03\n\x00\x00\x1e\x99" + // 0x0079030A: 0x00001E99 + "\x01\u007f\x03\a\x00\x00\x1e\x9b" + // 0x017F0307: 0x00001E9B + "\x00A\x03#\x00\x00\x1e\xa0" + // 0x00410323: 0x00001EA0 + "\x00a\x03#\x00\x00\x1e\xa1" + // 0x00610323: 0x00001EA1 + "\x00A\x03\t\x00\x00\x1e\xa2" + // 0x00410309: 0x00001EA2 + "\x00a\x03\t\x00\x00\x1e\xa3" + // 0x00610309: 0x00001EA3 + "\x00\xc2\x03\x01\x00\x00\x1e\xa4" + // 0x00C20301: 0x00001EA4 + "\x00\xe2\x03\x01\x00\x00\x1e\xa5" + // 0x00E20301: 0x00001EA5 + "\x00\xc2\x03\x00\x00\x00\x1e\xa6" + // 0x00C20300: 0x00001EA6 + "\x00\xe2\x03\x00\x00\x00\x1e\xa7" + // 0x00E20300: 0x00001EA7 + "\x00\xc2\x03\t\x00\x00\x1e\xa8" + // 0x00C20309: 0x00001EA8 + "\x00\xe2\x03\t\x00\x00\x1e\xa9" + // 0x00E20309: 0x00001EA9 + "\x00\xc2\x03\x03\x00\x00\x1e\xaa" + // 0x00C20303: 0x00001EAA + "\x00\xe2\x03\x03\x00\x00\x1e\xab" + // 0x00E20303: 0x00001EAB + "\x1e\xa0\x03\x02\x00\x00\x1e\xac" + // 0x1EA00302: 0x00001EAC + "\x1e\xa1\x03\x02\x00\x00\x1e\xad" + // 0x1EA10302: 0x00001EAD + "\x01\x02\x03\x01\x00\x00\x1e\xae" + // 0x01020301: 0x00001EAE + "\x01\x03\x03\x01\x00\x00\x1e\xaf" + // 0x01030301: 0x00001EAF + "\x01\x02\x03\x00\x00\x00\x1e\xb0" + // 0x01020300: 0x00001EB0 + "\x01\x03\x03\x00\x00\x00\x1e\xb1" + // 0x01030300: 0x00001EB1 + "\x01\x02\x03\t\x00\x00\x1e\xb2" + // 0x01020309: 0x00001EB2 + "\x01\x03\x03\t\x00\x00\x1e\xb3" + // 0x01030309: 0x00001EB3 + "\x01\x02\x03\x03\x00\x00\x1e\xb4" + // 0x01020303: 0x00001EB4 + "\x01\x03\x03\x03\x00\x00\x1e\xb5" + // 0x01030303: 0x00001EB5 + "\x1e\xa0\x03\x06\x00\x00\x1e\xb6" + // 0x1EA00306: 0x00001EB6 + "\x1e\xa1\x03\x06\x00\x00\x1e\xb7" + // 0x1EA10306: 0x00001EB7 + "\x00E\x03#\x00\x00\x1e\xb8" + // 0x00450323: 0x00001EB8 + "\x00e\x03#\x00\x00\x1e\xb9" + // 0x00650323: 0x00001EB9 + "\x00E\x03\t\x00\x00\x1e\xba" + // 0x00450309: 0x00001EBA + "\x00e\x03\t\x00\x00\x1e\xbb" + // 0x00650309: 0x00001EBB + "\x00E\x03\x03\x00\x00\x1e\xbc" + // 0x00450303: 0x00001EBC + "\x00e\x03\x03\x00\x00\x1e\xbd" + // 0x00650303: 0x00001EBD + "\x00\xca\x03\x01\x00\x00\x1e\xbe" + // 0x00CA0301: 0x00001EBE + "\x00\xea\x03\x01\x00\x00\x1e\xbf" + // 0x00EA0301: 0x00001EBF + "\x00\xca\x03\x00\x00\x00\x1e\xc0" + // 0x00CA0300: 0x00001EC0 + "\x00\xea\x03\x00\x00\x00\x1e\xc1" + // 0x00EA0300: 0x00001EC1 + "\x00\xca\x03\t\x00\x00\x1e\xc2" + // 0x00CA0309: 0x00001EC2 + "\x00\xea\x03\t\x00\x00\x1e\xc3" + // 0x00EA0309: 0x00001EC3 + "\x00\xca\x03\x03\x00\x00\x1e\xc4" + // 0x00CA0303: 0x00001EC4 + "\x00\xea\x03\x03\x00\x00\x1e\xc5" + // 0x00EA0303: 0x00001EC5 + "\x1e\xb8\x03\x02\x00\x00\x1e\xc6" + // 0x1EB80302: 0x00001EC6 + "\x1e\xb9\x03\x02\x00\x00\x1e\xc7" + // 0x1EB90302: 0x00001EC7 + "\x00I\x03\t\x00\x00\x1e\xc8" + // 0x00490309: 0x00001EC8 + "\x00i\x03\t\x00\x00\x1e\xc9" + // 0x00690309: 0x00001EC9 + "\x00I\x03#\x00\x00\x1e\xca" + // 0x00490323: 0x00001ECA + "\x00i\x03#\x00\x00\x1e\xcb" + // 0x00690323: 0x00001ECB + "\x00O\x03#\x00\x00\x1e\xcc" + // 0x004F0323: 0x00001ECC + "\x00o\x03#\x00\x00\x1e\xcd" + // 0x006F0323: 0x00001ECD + "\x00O\x03\t\x00\x00\x1e\xce" + // 0x004F0309: 0x00001ECE + "\x00o\x03\t\x00\x00\x1e\xcf" + // 0x006F0309: 0x00001ECF + "\x00\xd4\x03\x01\x00\x00\x1e\xd0" + // 0x00D40301: 0x00001ED0 + "\x00\xf4\x03\x01\x00\x00\x1e\xd1" + // 0x00F40301: 0x00001ED1 + "\x00\xd4\x03\x00\x00\x00\x1e\xd2" + // 0x00D40300: 0x00001ED2 + "\x00\xf4\x03\x00\x00\x00\x1e\xd3" + // 0x00F40300: 0x00001ED3 + "\x00\xd4\x03\t\x00\x00\x1e\xd4" + // 0x00D40309: 0x00001ED4 + "\x00\xf4\x03\t\x00\x00\x1e\xd5" + // 0x00F40309: 0x00001ED5 + "\x00\xd4\x03\x03\x00\x00\x1e\xd6" + // 0x00D40303: 0x00001ED6 + "\x00\xf4\x03\x03\x00\x00\x1e\xd7" + // 0x00F40303: 0x00001ED7 + "\x1e\xcc\x03\x02\x00\x00\x1e\xd8" + // 0x1ECC0302: 0x00001ED8 + "\x1e\xcd\x03\x02\x00\x00\x1e\xd9" + // 0x1ECD0302: 0x00001ED9 + "\x01\xa0\x03\x01\x00\x00\x1e\xda" + // 0x01A00301: 0x00001EDA + "\x01\xa1\x03\x01\x00\x00\x1e\xdb" + // 0x01A10301: 0x00001EDB + "\x01\xa0\x03\x00\x00\x00\x1e\xdc" + // 0x01A00300: 0x00001EDC + "\x01\xa1\x03\x00\x00\x00\x1e\xdd" + // 0x01A10300: 0x00001EDD + "\x01\xa0\x03\t\x00\x00\x1e\xde" + // 0x01A00309: 0x00001EDE + "\x01\xa1\x03\t\x00\x00\x1e\xdf" + // 0x01A10309: 0x00001EDF + "\x01\xa0\x03\x03\x00\x00\x1e\xe0" + // 0x01A00303: 0x00001EE0 + "\x01\xa1\x03\x03\x00\x00\x1e\xe1" + // 0x01A10303: 0x00001EE1 + "\x01\xa0\x03#\x00\x00\x1e\xe2" + // 0x01A00323: 0x00001EE2 + "\x01\xa1\x03#\x00\x00\x1e\xe3" + // 0x01A10323: 0x00001EE3 + "\x00U\x03#\x00\x00\x1e\xe4" + // 0x00550323: 0x00001EE4 + "\x00u\x03#\x00\x00\x1e\xe5" + // 0x00750323: 0x00001EE5 + "\x00U\x03\t\x00\x00\x1e\xe6" + // 0x00550309: 0x00001EE6 + "\x00u\x03\t\x00\x00\x1e\xe7" + // 0x00750309: 0x00001EE7 + "\x01\xaf\x03\x01\x00\x00\x1e\xe8" + // 0x01AF0301: 0x00001EE8 + "\x01\xb0\x03\x01\x00\x00\x1e\xe9" + // 0x01B00301: 0x00001EE9 + "\x01\xaf\x03\x00\x00\x00\x1e\xea" + // 0x01AF0300: 0x00001EEA + "\x01\xb0\x03\x00\x00\x00\x1e\xeb" + // 0x01B00300: 0x00001EEB + "\x01\xaf\x03\t\x00\x00\x1e\xec" + // 0x01AF0309: 0x00001EEC + "\x01\xb0\x03\t\x00\x00\x1e\xed" + // 0x01B00309: 0x00001EED + "\x01\xaf\x03\x03\x00\x00\x1e\xee" + // 0x01AF0303: 0x00001EEE + "\x01\xb0\x03\x03\x00\x00\x1e\xef" + // 0x01B00303: 0x00001EEF + "\x01\xaf\x03#\x00\x00\x1e\xf0" + // 0x01AF0323: 0x00001EF0 + "\x01\xb0\x03#\x00\x00\x1e\xf1" + // 0x01B00323: 0x00001EF1 + "\x00Y\x03\x00\x00\x00\x1e\xf2" + // 0x00590300: 0x00001EF2 + "\x00y\x03\x00\x00\x00\x1e\xf3" + // 0x00790300: 0x00001EF3 + "\x00Y\x03#\x00\x00\x1e\xf4" + // 0x00590323: 0x00001EF4 + "\x00y\x03#\x00\x00\x1e\xf5" + // 0x00790323: 0x00001EF5 + "\x00Y\x03\t\x00\x00\x1e\xf6" + // 0x00590309: 0x00001EF6 + "\x00y\x03\t\x00\x00\x1e\xf7" + // 0x00790309: 0x00001EF7 + "\x00Y\x03\x03\x00\x00\x1e\xf8" + // 0x00590303: 0x00001EF8 + "\x00y\x03\x03\x00\x00\x1e\xf9" + // 0x00790303: 0x00001EF9 + "\x03\xb1\x03\x13\x00\x00\x1f\x00" + // 0x03B10313: 0x00001F00 + "\x03\xb1\x03\x14\x00\x00\x1f\x01" + // 0x03B10314: 0x00001F01 + "\x1f\x00\x03\x00\x00\x00\x1f\x02" + // 0x1F000300: 0x00001F02 + "\x1f\x01\x03\x00\x00\x00\x1f\x03" + // 0x1F010300: 0x00001F03 + "\x1f\x00\x03\x01\x00\x00\x1f\x04" + // 0x1F000301: 0x00001F04 + "\x1f\x01\x03\x01\x00\x00\x1f\x05" + // 0x1F010301: 0x00001F05 + "\x1f\x00\x03B\x00\x00\x1f\x06" + // 0x1F000342: 0x00001F06 + "\x1f\x01\x03B\x00\x00\x1f\a" + // 0x1F010342: 0x00001F07 + "\x03\x91\x03\x13\x00\x00\x1f\b" + // 0x03910313: 0x00001F08 + "\x03\x91\x03\x14\x00\x00\x1f\t" + // 0x03910314: 0x00001F09 + "\x1f\b\x03\x00\x00\x00\x1f\n" + // 0x1F080300: 0x00001F0A + "\x1f\t\x03\x00\x00\x00\x1f\v" + // 0x1F090300: 0x00001F0B + "\x1f\b\x03\x01\x00\x00\x1f\f" + // 0x1F080301: 0x00001F0C + "\x1f\t\x03\x01\x00\x00\x1f\r" + // 0x1F090301: 0x00001F0D + "\x1f\b\x03B\x00\x00\x1f\x0e" + // 0x1F080342: 0x00001F0E + "\x1f\t\x03B\x00\x00\x1f\x0f" + // 0x1F090342: 0x00001F0F + "\x03\xb5\x03\x13\x00\x00\x1f\x10" + // 0x03B50313: 0x00001F10 + "\x03\xb5\x03\x14\x00\x00\x1f\x11" + // 0x03B50314: 0x00001F11 + "\x1f\x10\x03\x00\x00\x00\x1f\x12" + // 0x1F100300: 0x00001F12 + "\x1f\x11\x03\x00\x00\x00\x1f\x13" + // 0x1F110300: 0x00001F13 + "\x1f\x10\x03\x01\x00\x00\x1f\x14" + // 0x1F100301: 0x00001F14 + "\x1f\x11\x03\x01\x00\x00\x1f\x15" + // 0x1F110301: 0x00001F15 + "\x03\x95\x03\x13\x00\x00\x1f\x18" + // 0x03950313: 0x00001F18 + "\x03\x95\x03\x14\x00\x00\x1f\x19" + // 0x03950314: 0x00001F19 + "\x1f\x18\x03\x00\x00\x00\x1f\x1a" + // 0x1F180300: 0x00001F1A + "\x1f\x19\x03\x00\x00\x00\x1f\x1b" + // 0x1F190300: 0x00001F1B + "\x1f\x18\x03\x01\x00\x00\x1f\x1c" + // 0x1F180301: 0x00001F1C + "\x1f\x19\x03\x01\x00\x00\x1f\x1d" + // 0x1F190301: 0x00001F1D + "\x03\xb7\x03\x13\x00\x00\x1f " + // 0x03B70313: 0x00001F20 + "\x03\xb7\x03\x14\x00\x00\x1f!" + // 0x03B70314: 0x00001F21 + "\x1f \x03\x00\x00\x00\x1f\"" + // 0x1F200300: 0x00001F22 + "\x1f!\x03\x00\x00\x00\x1f#" + // 0x1F210300: 0x00001F23 + "\x1f \x03\x01\x00\x00\x1f$" + // 0x1F200301: 0x00001F24 + "\x1f!\x03\x01\x00\x00\x1f%" + // 0x1F210301: 0x00001F25 + "\x1f \x03B\x00\x00\x1f&" + // 0x1F200342: 0x00001F26 + "\x1f!\x03B\x00\x00\x1f'" + // 0x1F210342: 0x00001F27 + "\x03\x97\x03\x13\x00\x00\x1f(" + // 0x03970313: 0x00001F28 + "\x03\x97\x03\x14\x00\x00\x1f)" + // 0x03970314: 0x00001F29 + "\x1f(\x03\x00\x00\x00\x1f*" + // 0x1F280300: 0x00001F2A + "\x1f)\x03\x00\x00\x00\x1f+" + // 0x1F290300: 0x00001F2B + "\x1f(\x03\x01\x00\x00\x1f," + // 0x1F280301: 0x00001F2C + "\x1f)\x03\x01\x00\x00\x1f-" + // 0x1F290301: 0x00001F2D + "\x1f(\x03B\x00\x00\x1f." + // 0x1F280342: 0x00001F2E + "\x1f)\x03B\x00\x00\x1f/" + // 0x1F290342: 0x00001F2F + "\x03\xb9\x03\x13\x00\x00\x1f0" + // 0x03B90313: 0x00001F30 + "\x03\xb9\x03\x14\x00\x00\x1f1" + // 0x03B90314: 0x00001F31 + "\x1f0\x03\x00\x00\x00\x1f2" + // 0x1F300300: 0x00001F32 + "\x1f1\x03\x00\x00\x00\x1f3" + // 0x1F310300: 0x00001F33 + "\x1f0\x03\x01\x00\x00\x1f4" + // 0x1F300301: 0x00001F34 + "\x1f1\x03\x01\x00\x00\x1f5" + // 0x1F310301: 0x00001F35 + "\x1f0\x03B\x00\x00\x1f6" + // 0x1F300342: 0x00001F36 + "\x1f1\x03B\x00\x00\x1f7" + // 0x1F310342: 0x00001F37 + "\x03\x99\x03\x13\x00\x00\x1f8" + // 0x03990313: 0x00001F38 + "\x03\x99\x03\x14\x00\x00\x1f9" + // 0x03990314: 0x00001F39 + "\x1f8\x03\x00\x00\x00\x1f:" + // 0x1F380300: 0x00001F3A + "\x1f9\x03\x00\x00\x00\x1f;" + // 0x1F390300: 0x00001F3B + "\x1f8\x03\x01\x00\x00\x1f<" + // 0x1F380301: 0x00001F3C + "\x1f9\x03\x01\x00\x00\x1f=" + // 0x1F390301: 0x00001F3D + "\x1f8\x03B\x00\x00\x1f>" + // 0x1F380342: 0x00001F3E + "\x1f9\x03B\x00\x00\x1f?" + // 0x1F390342: 0x00001F3F + "\x03\xbf\x03\x13\x00\x00\x1f@" + // 0x03BF0313: 0x00001F40 + "\x03\xbf\x03\x14\x00\x00\x1fA" + // 0x03BF0314: 0x00001F41 + "\x1f@\x03\x00\x00\x00\x1fB" + // 0x1F400300: 0x00001F42 + "\x1fA\x03\x00\x00\x00\x1fC" + // 0x1F410300: 0x00001F43 + "\x1f@\x03\x01\x00\x00\x1fD" + // 0x1F400301: 0x00001F44 + "\x1fA\x03\x01\x00\x00\x1fE" + // 0x1F410301: 0x00001F45 + "\x03\x9f\x03\x13\x00\x00\x1fH" + // 0x039F0313: 0x00001F48 + "\x03\x9f\x03\x14\x00\x00\x1fI" + // 0x039F0314: 0x00001F49 + "\x1fH\x03\x00\x00\x00\x1fJ" + // 0x1F480300: 0x00001F4A + "\x1fI\x03\x00\x00\x00\x1fK" + // 0x1F490300: 0x00001F4B + "\x1fH\x03\x01\x00\x00\x1fL" + // 0x1F480301: 0x00001F4C + "\x1fI\x03\x01\x00\x00\x1fM" + // 0x1F490301: 0x00001F4D + "\x03\xc5\x03\x13\x00\x00\x1fP" + // 0x03C50313: 0x00001F50 + "\x03\xc5\x03\x14\x00\x00\x1fQ" + // 0x03C50314: 0x00001F51 + "\x1fP\x03\x00\x00\x00\x1fR" + // 0x1F500300: 0x00001F52 + "\x1fQ\x03\x00\x00\x00\x1fS" + // 0x1F510300: 0x00001F53 + "\x1fP\x03\x01\x00\x00\x1fT" + // 0x1F500301: 0x00001F54 + "\x1fQ\x03\x01\x00\x00\x1fU" + // 0x1F510301: 0x00001F55 + "\x1fP\x03B\x00\x00\x1fV" + // 0x1F500342: 0x00001F56 + "\x1fQ\x03B\x00\x00\x1fW" + // 0x1F510342: 0x00001F57 + "\x03\xa5\x03\x14\x00\x00\x1fY" + // 0x03A50314: 0x00001F59 + "\x1fY\x03\x00\x00\x00\x1f[" + // 0x1F590300: 0x00001F5B + "\x1fY\x03\x01\x00\x00\x1f]" + // 0x1F590301: 0x00001F5D + "\x1fY\x03B\x00\x00\x1f_" + // 0x1F590342: 0x00001F5F + "\x03\xc9\x03\x13\x00\x00\x1f`" + // 0x03C90313: 0x00001F60 + "\x03\xc9\x03\x14\x00\x00\x1fa" + // 0x03C90314: 0x00001F61 + "\x1f`\x03\x00\x00\x00\x1fb" + // 0x1F600300: 0x00001F62 + "\x1fa\x03\x00\x00\x00\x1fc" + // 0x1F610300: 0x00001F63 + "\x1f`\x03\x01\x00\x00\x1fd" + // 0x1F600301: 0x00001F64 + "\x1fa\x03\x01\x00\x00\x1fe" + // 0x1F610301: 0x00001F65 + "\x1f`\x03B\x00\x00\x1ff" + // 0x1F600342: 0x00001F66 + "\x1fa\x03B\x00\x00\x1fg" + // 0x1F610342: 0x00001F67 + "\x03\xa9\x03\x13\x00\x00\x1fh" + // 0x03A90313: 0x00001F68 + "\x03\xa9\x03\x14\x00\x00\x1fi" + // 0x03A90314: 0x00001F69 + "\x1fh\x03\x00\x00\x00\x1fj" + // 0x1F680300: 0x00001F6A + "\x1fi\x03\x00\x00\x00\x1fk" + // 0x1F690300: 0x00001F6B + "\x1fh\x03\x01\x00\x00\x1fl" + // 0x1F680301: 0x00001F6C + "\x1fi\x03\x01\x00\x00\x1fm" + // 0x1F690301: 0x00001F6D + "\x1fh\x03B\x00\x00\x1fn" + // 0x1F680342: 0x00001F6E + "\x1fi\x03B\x00\x00\x1fo" + // 0x1F690342: 0x00001F6F + "\x03\xb1\x03\x00\x00\x00\x1fp" + // 0x03B10300: 0x00001F70 + "\x03\xb5\x03\x00\x00\x00\x1fr" + // 0x03B50300: 0x00001F72 + "\x03\xb7\x03\x00\x00\x00\x1ft" + // 0x03B70300: 0x00001F74 + "\x03\xb9\x03\x00\x00\x00\x1fv" + // 0x03B90300: 0x00001F76 + "\x03\xbf\x03\x00\x00\x00\x1fx" + // 0x03BF0300: 0x00001F78 + "\x03\xc5\x03\x00\x00\x00\x1fz" + // 0x03C50300: 0x00001F7A + "\x03\xc9\x03\x00\x00\x00\x1f|" + // 0x03C90300: 0x00001F7C + "\x1f\x00\x03E\x00\x00\x1f\x80" + // 0x1F000345: 0x00001F80 + "\x1f\x01\x03E\x00\x00\x1f\x81" + // 0x1F010345: 0x00001F81 + "\x1f\x02\x03E\x00\x00\x1f\x82" + // 0x1F020345: 0x00001F82 + "\x1f\x03\x03E\x00\x00\x1f\x83" + // 0x1F030345: 0x00001F83 + "\x1f\x04\x03E\x00\x00\x1f\x84" + // 0x1F040345: 0x00001F84 + "\x1f\x05\x03E\x00\x00\x1f\x85" + // 0x1F050345: 0x00001F85 + "\x1f\x06\x03E\x00\x00\x1f\x86" + // 0x1F060345: 0x00001F86 + "\x1f\a\x03E\x00\x00\x1f\x87" + // 0x1F070345: 0x00001F87 + "\x1f\b\x03E\x00\x00\x1f\x88" + // 0x1F080345: 0x00001F88 + "\x1f\t\x03E\x00\x00\x1f\x89" + // 0x1F090345: 0x00001F89 + "\x1f\n\x03E\x00\x00\x1f\x8a" + // 0x1F0A0345: 0x00001F8A + "\x1f\v\x03E\x00\x00\x1f\x8b" + // 0x1F0B0345: 0x00001F8B + "\x1f\f\x03E\x00\x00\x1f\x8c" + // 0x1F0C0345: 0x00001F8C + "\x1f\r\x03E\x00\x00\x1f\x8d" + // 0x1F0D0345: 0x00001F8D + "\x1f\x0e\x03E\x00\x00\x1f\x8e" + // 0x1F0E0345: 0x00001F8E + "\x1f\x0f\x03E\x00\x00\x1f\x8f" + // 0x1F0F0345: 0x00001F8F + "\x1f \x03E\x00\x00\x1f\x90" + // 0x1F200345: 0x00001F90 + "\x1f!\x03E\x00\x00\x1f\x91" + // 0x1F210345: 0x00001F91 + "\x1f\"\x03E\x00\x00\x1f\x92" + // 0x1F220345: 0x00001F92 + "\x1f#\x03E\x00\x00\x1f\x93" + // 0x1F230345: 0x00001F93 + "\x1f$\x03E\x00\x00\x1f\x94" + // 0x1F240345: 0x00001F94 + "\x1f%\x03E\x00\x00\x1f\x95" + // 0x1F250345: 0x00001F95 + "\x1f&\x03E\x00\x00\x1f\x96" + // 0x1F260345: 0x00001F96 + "\x1f'\x03E\x00\x00\x1f\x97" + // 0x1F270345: 0x00001F97 + "\x1f(\x03E\x00\x00\x1f\x98" + // 0x1F280345: 0x00001F98 + "\x1f)\x03E\x00\x00\x1f\x99" + // 0x1F290345: 0x00001F99 + "\x1f*\x03E\x00\x00\x1f\x9a" + // 0x1F2A0345: 0x00001F9A + "\x1f+\x03E\x00\x00\x1f\x9b" + // 0x1F2B0345: 0x00001F9B + "\x1f,\x03E\x00\x00\x1f\x9c" + // 0x1F2C0345: 0x00001F9C + "\x1f-\x03E\x00\x00\x1f\x9d" + // 0x1F2D0345: 0x00001F9D + "\x1f.\x03E\x00\x00\x1f\x9e" + // 0x1F2E0345: 0x00001F9E + "\x1f/\x03E\x00\x00\x1f\x9f" + // 0x1F2F0345: 0x00001F9F + "\x1f`\x03E\x00\x00\x1f\xa0" + // 0x1F600345: 0x00001FA0 + "\x1fa\x03E\x00\x00\x1f\xa1" + // 0x1F610345: 0x00001FA1 + "\x1fb\x03E\x00\x00\x1f\xa2" + // 0x1F620345: 0x00001FA2 + "\x1fc\x03E\x00\x00\x1f\xa3" + // 0x1F630345: 0x00001FA3 + "\x1fd\x03E\x00\x00\x1f\xa4" + // 0x1F640345: 0x00001FA4 + "\x1fe\x03E\x00\x00\x1f\xa5" + // 0x1F650345: 0x00001FA5 + "\x1ff\x03E\x00\x00\x1f\xa6" + // 0x1F660345: 0x00001FA6 + "\x1fg\x03E\x00\x00\x1f\xa7" + // 0x1F670345: 0x00001FA7 + "\x1fh\x03E\x00\x00\x1f\xa8" + // 0x1F680345: 0x00001FA8 + "\x1fi\x03E\x00\x00\x1f\xa9" + // 0x1F690345: 0x00001FA9 + "\x1fj\x03E\x00\x00\x1f\xaa" + // 0x1F6A0345: 0x00001FAA + "\x1fk\x03E\x00\x00\x1f\xab" + // 0x1F6B0345: 0x00001FAB + "\x1fl\x03E\x00\x00\x1f\xac" + // 0x1F6C0345: 0x00001FAC + "\x1fm\x03E\x00\x00\x1f\xad" + // 0x1F6D0345: 0x00001FAD + "\x1fn\x03E\x00\x00\x1f\xae" + // 0x1F6E0345: 0x00001FAE + "\x1fo\x03E\x00\x00\x1f\xaf" + // 0x1F6F0345: 0x00001FAF + "\x03\xb1\x03\x06\x00\x00\x1f\xb0" + // 0x03B10306: 0x00001FB0 + "\x03\xb1\x03\x04\x00\x00\x1f\xb1" + // 0x03B10304: 0x00001FB1 + "\x1fp\x03E\x00\x00\x1f\xb2" + // 0x1F700345: 0x00001FB2 + "\x03\xb1\x03E\x00\x00\x1f\xb3" + // 0x03B10345: 0x00001FB3 + "\x03\xac\x03E\x00\x00\x1f\xb4" + // 0x03AC0345: 0x00001FB4 + "\x03\xb1\x03B\x00\x00\x1f\xb6" + // 0x03B10342: 0x00001FB6 + "\x1f\xb6\x03E\x00\x00\x1f\xb7" + // 0x1FB60345: 0x00001FB7 + "\x03\x91\x03\x06\x00\x00\x1f\xb8" + // 0x03910306: 0x00001FB8 + "\x03\x91\x03\x04\x00\x00\x1f\xb9" + // 0x03910304: 0x00001FB9 + "\x03\x91\x03\x00\x00\x00\x1f\xba" + // 0x03910300: 0x00001FBA + "\x03\x91\x03E\x00\x00\x1f\xbc" + // 0x03910345: 0x00001FBC + "\x00\xa8\x03B\x00\x00\x1f\xc1" + // 0x00A80342: 0x00001FC1 + "\x1ft\x03E\x00\x00\x1f\xc2" + // 0x1F740345: 0x00001FC2 + "\x03\xb7\x03E\x00\x00\x1f\xc3" + // 0x03B70345: 0x00001FC3 + "\x03\xae\x03E\x00\x00\x1f\xc4" + // 0x03AE0345: 0x00001FC4 + "\x03\xb7\x03B\x00\x00\x1f\xc6" + // 0x03B70342: 0x00001FC6 + "\x1f\xc6\x03E\x00\x00\x1f\xc7" + // 0x1FC60345: 0x00001FC7 + "\x03\x95\x03\x00\x00\x00\x1f\xc8" + // 0x03950300: 0x00001FC8 + "\x03\x97\x03\x00\x00\x00\x1f\xca" + // 0x03970300: 0x00001FCA + "\x03\x97\x03E\x00\x00\x1f\xcc" + // 0x03970345: 0x00001FCC + "\x1f\xbf\x03\x00\x00\x00\x1f\xcd" + // 0x1FBF0300: 0x00001FCD + "\x1f\xbf\x03\x01\x00\x00\x1f\xce" + // 0x1FBF0301: 0x00001FCE + "\x1f\xbf\x03B\x00\x00\x1f\xcf" + // 0x1FBF0342: 0x00001FCF + "\x03\xb9\x03\x06\x00\x00\x1f\xd0" + // 0x03B90306: 0x00001FD0 + "\x03\xb9\x03\x04\x00\x00\x1f\xd1" + // 0x03B90304: 0x00001FD1 + "\x03\xca\x03\x00\x00\x00\x1f\xd2" + // 0x03CA0300: 0x00001FD2 + "\x03\xb9\x03B\x00\x00\x1f\xd6" + // 0x03B90342: 0x00001FD6 + "\x03\xca\x03B\x00\x00\x1f\xd7" + // 0x03CA0342: 0x00001FD7 + "\x03\x99\x03\x06\x00\x00\x1f\xd8" + // 0x03990306: 0x00001FD8 + "\x03\x99\x03\x04\x00\x00\x1f\xd9" + // 0x03990304: 0x00001FD9 + "\x03\x99\x03\x00\x00\x00\x1f\xda" + // 0x03990300: 0x00001FDA + "\x1f\xfe\x03\x00\x00\x00\x1f\xdd" + // 0x1FFE0300: 0x00001FDD + "\x1f\xfe\x03\x01\x00\x00\x1f\xde" + // 0x1FFE0301: 0x00001FDE + "\x1f\xfe\x03B\x00\x00\x1f\xdf" + // 0x1FFE0342: 0x00001FDF + "\x03\xc5\x03\x06\x00\x00\x1f\xe0" + // 0x03C50306: 0x00001FE0 + "\x03\xc5\x03\x04\x00\x00\x1f\xe1" + // 0x03C50304: 0x00001FE1 + "\x03\xcb\x03\x00\x00\x00\x1f\xe2" + // 0x03CB0300: 0x00001FE2 + "\x03\xc1\x03\x13\x00\x00\x1f\xe4" + // 0x03C10313: 0x00001FE4 + "\x03\xc1\x03\x14\x00\x00\x1f\xe5" + // 0x03C10314: 0x00001FE5 + "\x03\xc5\x03B\x00\x00\x1f\xe6" + // 0x03C50342: 0x00001FE6 + "\x03\xcb\x03B\x00\x00\x1f\xe7" + // 0x03CB0342: 0x00001FE7 + "\x03\xa5\x03\x06\x00\x00\x1f\xe8" + // 0x03A50306: 0x00001FE8 + "\x03\xa5\x03\x04\x00\x00\x1f\xe9" + // 0x03A50304: 0x00001FE9 + "\x03\xa5\x03\x00\x00\x00\x1f\xea" + // 0x03A50300: 0x00001FEA + "\x03\xa1\x03\x14\x00\x00\x1f\xec" + // 0x03A10314: 0x00001FEC + "\x00\xa8\x03\x00\x00\x00\x1f\xed" + // 0x00A80300: 0x00001FED + "\x1f|\x03E\x00\x00\x1f\xf2" + // 0x1F7C0345: 0x00001FF2 + "\x03\xc9\x03E\x00\x00\x1f\xf3" + // 0x03C90345: 0x00001FF3 + "\x03\xce\x03E\x00\x00\x1f\xf4" + // 0x03CE0345: 0x00001FF4 + "\x03\xc9\x03B\x00\x00\x1f\xf6" + // 0x03C90342: 0x00001FF6 + "\x1f\xf6\x03E\x00\x00\x1f\xf7" + // 0x1FF60345: 0x00001FF7 + "\x03\x9f\x03\x00\x00\x00\x1f\xf8" + // 0x039F0300: 0x00001FF8 + "\x03\xa9\x03\x00\x00\x00\x1f\xfa" + // 0x03A90300: 0x00001FFA + "\x03\xa9\x03E\x00\x00\x1f\xfc" + // 0x03A90345: 0x00001FFC + "!\x90\x038\x00\x00!\x9a" + // 0x21900338: 0x0000219A + "!\x92\x038\x00\x00!\x9b" + // 0x21920338: 0x0000219B + "!\x94\x038\x00\x00!\xae" + // 0x21940338: 0x000021AE + "!\xd0\x038\x00\x00!\xcd" + // 0x21D00338: 0x000021CD + "!\xd4\x038\x00\x00!\xce" + // 0x21D40338: 0x000021CE + "!\xd2\x038\x00\x00!\xcf" + // 0x21D20338: 0x000021CF + "\"\x03\x038\x00\x00\"\x04" + // 0x22030338: 0x00002204 + "\"\b\x038\x00\x00\"\t" + // 0x22080338: 0x00002209 + "\"\v\x038\x00\x00\"\f" + // 0x220B0338: 0x0000220C + "\"#\x038\x00\x00\"$" + // 0x22230338: 0x00002224 + "\"%\x038\x00\x00\"&" + // 0x22250338: 0x00002226 + "\"<\x038\x00\x00\"A" + // 0x223C0338: 0x00002241 + "\"C\x038\x00\x00\"D" + // 0x22430338: 0x00002244 + "\"E\x038\x00\x00\"G" + // 0x22450338: 0x00002247 + "\"H\x038\x00\x00\"I" + // 0x22480338: 0x00002249 + "\x00=\x038\x00\x00\"`" + // 0x003D0338: 0x00002260 + "\"a\x038\x00\x00\"b" + // 0x22610338: 0x00002262 + "\"M\x038\x00\x00\"m" + // 0x224D0338: 0x0000226D + "\x00<\x038\x00\x00\"n" + // 0x003C0338: 0x0000226E + "\x00>\x038\x00\x00\"o" + // 0x003E0338: 0x0000226F + "\"d\x038\x00\x00\"p" + // 0x22640338: 0x00002270 + "\"e\x038\x00\x00\"q" + // 0x22650338: 0x00002271 + "\"r\x038\x00\x00\"t" + // 0x22720338: 0x00002274 + "\"s\x038\x00\x00\"u" + // 0x22730338: 0x00002275 + "\"v\x038\x00\x00\"x" + // 0x22760338: 0x00002278 + "\"w\x038\x00\x00\"y" + // 0x22770338: 0x00002279 + "\"z\x038\x00\x00\"\x80" + // 0x227A0338: 0x00002280 + "\"{\x038\x00\x00\"\x81" + // 0x227B0338: 0x00002281 + "\"\x82\x038\x00\x00\"\x84" + // 0x22820338: 0x00002284 + "\"\x83\x038\x00\x00\"\x85" + // 0x22830338: 0x00002285 + "\"\x86\x038\x00\x00\"\x88" + // 0x22860338: 0x00002288 + "\"\x87\x038\x00\x00\"\x89" + // 0x22870338: 0x00002289 + "\"\xa2\x038\x00\x00\"\xac" + // 0x22A20338: 0x000022AC + "\"\xa8\x038\x00\x00\"\xad" + // 0x22A80338: 0x000022AD + "\"\xa9\x038\x00\x00\"\xae" + // 0x22A90338: 0x000022AE + "\"\xab\x038\x00\x00\"\xaf" + // 0x22AB0338: 0x000022AF + "\"|\x038\x00\x00\"\xe0" + // 0x227C0338: 0x000022E0 + "\"}\x038\x00\x00\"\xe1" + // 0x227D0338: 0x000022E1 + "\"\x91\x038\x00\x00\"\xe2" + // 0x22910338: 0x000022E2 + "\"\x92\x038\x00\x00\"\xe3" + // 0x22920338: 0x000022E3 + "\"\xb2\x038\x00\x00\"\xea" + // 0x22B20338: 0x000022EA + "\"\xb3\x038\x00\x00\"\xeb" + // 0x22B30338: 0x000022EB + "\"\xb4\x038\x00\x00\"\xec" + // 0x22B40338: 0x000022EC + "\"\xb5\x038\x00\x00\"\xed" + // 0x22B50338: 0x000022ED + "0K0\x99\x00\x000L" + // 0x304B3099: 0x0000304C + "0M0\x99\x00\x000N" + // 0x304D3099: 0x0000304E + "0O0\x99\x00\x000P" + // 0x304F3099: 0x00003050 + "0Q0\x99\x00\x000R" + // 0x30513099: 0x00003052 + "0S0\x99\x00\x000T" + // 0x30533099: 0x00003054 + "0U0\x99\x00\x000V" + // 0x30553099: 0x00003056 + "0W0\x99\x00\x000X" + // 0x30573099: 0x00003058 + "0Y0\x99\x00\x000Z" + // 0x30593099: 0x0000305A + "0[0\x99\x00\x000\\" + // 0x305B3099: 0x0000305C + "0]0\x99\x00\x000^" + // 0x305D3099: 0x0000305E + "0_0\x99\x00\x000`" + // 0x305F3099: 0x00003060 + "0a0\x99\x00\x000b" + // 0x30613099: 0x00003062 + "0d0\x99\x00\x000e" + // 0x30643099: 0x00003065 + "0f0\x99\x00\x000g" + // 0x30663099: 0x00003067 + "0h0\x99\x00\x000i" + // 0x30683099: 0x00003069 + "0o0\x99\x00\x000p" + // 0x306F3099: 0x00003070 + "0o0\x9a\x00\x000q" + // 0x306F309A: 0x00003071 + "0r0\x99\x00\x000s" + // 0x30723099: 0x00003073 + "0r0\x9a\x00\x000t" + // 0x3072309A: 0x00003074 + "0u0\x99\x00\x000v" + // 0x30753099: 0x00003076 + "0u0\x9a\x00\x000w" + // 0x3075309A: 0x00003077 + "0x0\x99\x00\x000y" + // 0x30783099: 0x00003079 + "0x0\x9a\x00\x000z" + // 0x3078309A: 0x0000307A + "0{0\x99\x00\x000|" + // 0x307B3099: 0x0000307C + "0{0\x9a\x00\x000}" + // 0x307B309A: 0x0000307D + "0F0\x99\x00\x000\x94" + // 0x30463099: 0x00003094 + "0\x9d0\x99\x00\x000\x9e" + // 0x309D3099: 0x0000309E + "0\xab0\x99\x00\x000\xac" + // 0x30AB3099: 0x000030AC + "0\xad0\x99\x00\x000\xae" + // 0x30AD3099: 0x000030AE + "0\xaf0\x99\x00\x000\xb0" + // 0x30AF3099: 0x000030B0 + "0\xb10\x99\x00\x000\xb2" + // 0x30B13099: 0x000030B2 + "0\xb30\x99\x00\x000\xb4" + // 0x30B33099: 0x000030B4 + "0\xb50\x99\x00\x000\xb6" + // 0x30B53099: 0x000030B6 + "0\xb70\x99\x00\x000\xb8" + // 0x30B73099: 0x000030B8 + "0\xb90\x99\x00\x000\xba" + // 0x30B93099: 0x000030BA + "0\xbb0\x99\x00\x000\xbc" + // 0x30BB3099: 0x000030BC + "0\xbd0\x99\x00\x000\xbe" + // 0x30BD3099: 0x000030BE + "0\xbf0\x99\x00\x000\xc0" + // 0x30BF3099: 0x000030C0 + "0\xc10\x99\x00\x000\xc2" + // 0x30C13099: 0x000030C2 + "0\xc40\x99\x00\x000\xc5" + // 0x30C43099: 0x000030C5 + "0\xc60\x99\x00\x000\xc7" + // 0x30C63099: 0x000030C7 + "0\xc80\x99\x00\x000\xc9" + // 0x30C83099: 0x000030C9 + "0\xcf0\x99\x00\x000\xd0" + // 0x30CF3099: 0x000030D0 + "0\xcf0\x9a\x00\x000\xd1" + // 0x30CF309A: 0x000030D1 + "0\xd20\x99\x00\x000\xd3" + // 0x30D23099: 0x000030D3 + "0\xd20\x9a\x00\x000\xd4" + // 0x30D2309A: 0x000030D4 + "0\xd50\x99\x00\x000\xd6" + // 0x30D53099: 0x000030D6 + "0\xd50\x9a\x00\x000\xd7" + // 0x30D5309A: 0x000030D7 + "0\xd80\x99\x00\x000\xd9" + // 0x30D83099: 0x000030D9 + "0\xd80\x9a\x00\x000\xda" + // 0x30D8309A: 0x000030DA + "0\xdb0\x99\x00\x000\xdc" + // 0x30DB3099: 0x000030DC + "0\xdb0\x9a\x00\x000\xdd" + // 0x30DB309A: 0x000030DD + "0\xa60\x99\x00\x000\xf4" + // 0x30A63099: 0x000030F4 + "0\xef0\x99\x00\x000\xf7" + // 0x30EF3099: 0x000030F7 + "0\xf00\x99\x00\x000\xf8" + // 0x30F03099: 0x000030F8 + "0\xf10\x99\x00\x000\xf9" + // 0x30F13099: 0x000030F9 + "0\xf20\x99\x00\x000\xfa" + // 0x30F23099: 0x000030FA + "0\xfd0\x99\x00\x000\xfe" + // 0x30FD3099: 0x000030FE + "\x10\x99\x10\xba\x00\x01\x10\x9a" + // 0x109910BA: 0x0001109A + "\x10\x9b\x10\xba\x00\x01\x10\x9c" + // 0x109B10BA: 0x0001109C + "\x10\xa5\x10\xba\x00\x01\x10\xab" + // 0x10A510BA: 0x000110AB + "\x111\x11'\x00\x01\x11." + // 0x11311127: 0x0001112E + "\x112\x11'\x00\x01\x11/" + // 0x11321127: 0x0001112F + "\x13G\x13>\x00\x01\x13K" + // 0x1347133E: 0x0001134B + "\x13G\x13W\x00\x01\x13L" + // 0x13471357: 0x0001134C + "\x14\xb9\x14\xba\x00\x01\x14\xbb" + // 0x14B914BA: 0x000114BB + "\x14\xb9\x14\xb0\x00\x01\x14\xbc" + // 0x14B914B0: 0x000114BC + "\x14\xb9\x14\xbd\x00\x01\x14\xbe" + // 0x14B914BD: 0x000114BE + "\x15\xb8\x15\xaf\x00\x01\x15\xba" + // 0x15B815AF: 0x000115BA + "\x15\xb9\x15\xaf\x00\x01\x15\xbb" + // 0x15B915AF: 0x000115BB + "\x195\x190\x00\x01\x198" + // 0x19351930: 0x00011938 + "" + // Total size of tables: 55KB (56160 bytes) diff --git a/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go index 9429069291..0175eae50a 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go @@ -1,5 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. +//go:build !go1.10 // +build !go1.10 package norm diff --git a/vendor/golang.org/x/tools/AUTHORS b/vendor/golang.org/x/tools/AUTHORS deleted file mode 100644 index 15167cd746..0000000000 --- a/vendor/golang.org/x/tools/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/tools/CONTRIBUTORS b/vendor/golang.org/x/tools/CONTRIBUTORS deleted file mode 100644 index 1c4577e968..0000000000 --- a/vendor/golang.org/x/tools/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/tools/LICENSE b/vendor/golang.org/x/tools/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/vendor/golang.org/x/tools/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/tools/PATENTS b/vendor/golang.org/x/tools/PATENTS deleted file mode 100644 index 733099041f..0000000000 --- a/vendor/golang.org/x/tools/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go b/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go deleted file mode 100644 index f8363d8faa..0000000000 --- a/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gcexportdata provides functions for locating, reading, and -// writing export data files containing type information produced by the -// gc compiler. This package supports go1.7 export data format and all -// later versions. -// -// Although it might seem convenient for this package to live alongside -// go/types in the standard library, this would cause version skew -// problems for developer tools that use it, since they must be able to -// consume the outputs of the gc compiler both before and after a Go -// update such as from Go 1.7 to Go 1.8. Because this package lives in -// golang.org/x/tools, sites can update their version of this repo some -// time before the Go 1.8 release and rebuild and redeploy their -// developer tools, which will then be able to consume both Go 1.7 and -// Go 1.8 export data files, so they will work before and after the -// Go update. (See discussion at https://golang.org/issue/15651.) -// -package gcexportdata // import "golang.org/x/tools/go/gcexportdata" - -import ( - "bufio" - "bytes" - "fmt" - "go/token" - "go/types" - "io" - "io/ioutil" - - "golang.org/x/tools/go/internal/gcimporter" -) - -// Find returns the name of an object (.o) or archive (.a) file -// containing type information for the specified import path, -// using the workspace layout conventions of go/build. -// If no file was found, an empty filename is returned. -// -// A relative srcDir is interpreted relative to the current working directory. -// -// Find also returns the package's resolved (canonical) import path, -// reflecting the effects of srcDir and vendoring on importPath. -func Find(importPath, srcDir string) (filename, path string) { - return gcimporter.FindPkg(importPath, srcDir) -} - -// NewReader returns a reader for the export data section of an object -// (.o) or archive (.a) file read from r. The new reader may provide -// additional trailing data beyond the end of the export data. -func NewReader(r io.Reader) (io.Reader, error) { - buf := bufio.NewReader(r) - _, err := gcimporter.FindExportData(buf) - // If we ever switch to a zip-like archive format with the ToC - // at the end, we can return the correct portion of export data, - // but for now we must return the entire rest of the file. - return buf, err -} - -// Read reads export data from in, decodes it, and returns type -// information for the package. -// The package name is specified by path. -// File position information is added to fset. -// -// Read may inspect and add to the imports map to ensure that references -// within the export data to other packages are consistent. The caller -// must ensure that imports[path] does not exist, or exists but is -// incomplete (see types.Package.Complete), and Read inserts the -// resulting package into this map entry. -// -// On return, the state of the reader is undefined. -func Read(in io.Reader, fset *token.FileSet, imports map[string]*types.Package, path string) (*types.Package, error) { - data, err := ioutil.ReadAll(in) - if err != nil { - return nil, fmt.Errorf("reading export data for %q: %v", path, err) - } - - if bytes.HasPrefix(data, []byte("!")) { - return nil, fmt.Errorf("can't read export data for %q directly from an archive file (call gcexportdata.NewReader first to extract export data)", path) - } - - // The App Engine Go runtime v1.6 uses the old export data format. - // TODO(adonovan): delete once v1.7 has been around for a while. - if bytes.HasPrefix(data, []byte("package ")) { - return gcimporter.ImportData(imports, path, path, bytes.NewReader(data)) - } - - // The indexed export format starts with an 'i'; the older - // binary export format starts with a 'c', 'd', or 'v' - // (from "version"). Select appropriate importer. - if len(data) > 0 && data[0] == 'i' { - _, pkg, err := gcimporter.IImportData(fset, imports, data[1:], path) - return pkg, err - } - - _, pkg, err := gcimporter.BImportData(fset, imports, data, path) - return pkg, err -} - -// Write writes encoded type information for the specified package to out. -// The FileSet provides file position information for named objects. -func Write(out io.Writer, fset *token.FileSet, pkg *types.Package) error { - b, err := gcimporter.IExportData(fset, pkg) - if err != nil { - return err - } - _, err = out.Write(b) - return err -} diff --git a/vendor/golang.org/x/tools/go/gcexportdata/importer.go b/vendor/golang.org/x/tools/go/gcexportdata/importer.go deleted file mode 100644 index efe221e7e1..0000000000 --- a/vendor/golang.org/x/tools/go/gcexportdata/importer.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gcexportdata - -import ( - "fmt" - "go/token" - "go/types" - "os" -) - -// NewImporter returns a new instance of the types.Importer interface -// that reads type information from export data files written by gc. -// The Importer also satisfies types.ImporterFrom. -// -// Export data files are located using "go build" workspace conventions -// and the build.Default context. -// -// Use this importer instead of go/importer.For("gc", ...) to avoid the -// version-skew problems described in the documentation of this package, -// or to control the FileSet or access the imports map populated during -// package loading. -// -func NewImporter(fset *token.FileSet, imports map[string]*types.Package) types.ImporterFrom { - return importer{fset, imports} -} - -type importer struct { - fset *token.FileSet - imports map[string]*types.Package -} - -func (imp importer) Import(importPath string) (*types.Package, error) { - return imp.ImportFrom(importPath, "", 0) -} - -func (imp importer) ImportFrom(importPath, srcDir string, mode types.ImportMode) (_ *types.Package, err error) { - filename, path := Find(importPath, srcDir) - if filename == "" { - if importPath == "unsafe" { - // Even for unsafe, call Find first in case - // the package was vendored. - return types.Unsafe, nil - } - return nil, fmt.Errorf("can't find import: %s", importPath) - } - - if pkg, ok := imp.imports[path]; ok && pkg.Complete() { - return pkg, nil // cache hit - } - - // open file - f, err := os.Open(filename) - if err != nil { - return nil, err - } - defer func() { - f.Close() - if err != nil { - // add file name to error - err = fmt.Errorf("reading export data: %s: %v", filename, err) - } - }() - - r, err := NewReader(f) - if err != nil { - return nil, err - } - - return Read(r, imp.fset, imp.imports, path) -} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go b/vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go deleted file mode 100644 index a807d0aaa2..0000000000 --- a/vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go +++ /dev/null @@ -1,852 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Binary package export. -// This file was derived from $GOROOT/src/cmd/compile/internal/gc/bexport.go; -// see that file for specification of the format. - -package gcimporter - -import ( - "bytes" - "encoding/binary" - "fmt" - "go/ast" - "go/constant" - "go/token" - "go/types" - "math" - "math/big" - "sort" - "strings" -) - -// If debugFormat is set, each integer and string value is preceded by a marker -// and position information in the encoding. This mechanism permits an importer -// to recognize immediately when it is out of sync. The importer recognizes this -// mode automatically (i.e., it can import export data produced with debugging -// support even if debugFormat is not set at the time of import). This mode will -// lead to massively larger export data (by a factor of 2 to 3) and should only -// be enabled during development and debugging. -// -// NOTE: This flag is the first flag to enable if importing dies because of -// (suspected) format errors, and whenever a change is made to the format. -const debugFormat = false // default: false - -// If trace is set, debugging output is printed to std out. -const trace = false // default: false - -// Current export format version. Increase with each format change. -// Note: The latest binary (non-indexed) export format is at version 6. -// This exporter is still at level 4, but it doesn't matter since -// the binary importer can handle older versions just fine. -// 6: package height (CL 105038) -- NOT IMPLEMENTED HERE -// 5: improved position encoding efficiency (issue 20080, CL 41619) -- NOT IMPLEMEMTED HERE -// 4: type name objects support type aliases, uses aliasTag -// 3: Go1.8 encoding (same as version 2, aliasTag defined but never used) -// 2: removed unused bool in ODCL export (compiler only) -// 1: header format change (more regular), export package for _ struct fields -// 0: Go1.7 encoding -const exportVersion = 4 - -// trackAllTypes enables cycle tracking for all types, not just named -// types. The existing compiler invariants assume that unnamed types -// that are not completely set up are not used, or else there are spurious -// errors. -// If disabled, only named types are tracked, possibly leading to slightly -// less efficient encoding in rare cases. It also prevents the export of -// some corner-case type declarations (but those are not handled correctly -// with with the textual export format either). -// TODO(gri) enable and remove once issues caused by it are fixed -const trackAllTypes = false - -type exporter struct { - fset *token.FileSet - out bytes.Buffer - - // object -> index maps, indexed in order of serialization - strIndex map[string]int - pkgIndex map[*types.Package]int - typIndex map[types.Type]int - - // position encoding - posInfoFormat bool - prevFile string - prevLine int - - // debugging support - written int // bytes written - indent int // for trace -} - -// internalError represents an error generated inside this package. -type internalError string - -func (e internalError) Error() string { return "gcimporter: " + string(e) } - -func internalErrorf(format string, args ...interface{}) error { - return internalError(fmt.Sprintf(format, args...)) -} - -// BExportData returns binary export data for pkg. -// If no file set is provided, position info will be missing. -func BExportData(fset *token.FileSet, pkg *types.Package) (b []byte, err error) { - defer func() { - if e := recover(); e != nil { - if ierr, ok := e.(internalError); ok { - err = ierr - return - } - // Not an internal error; panic again. - panic(e) - } - }() - - p := exporter{ - fset: fset, - strIndex: map[string]int{"": 0}, // empty string is mapped to 0 - pkgIndex: make(map[*types.Package]int), - typIndex: make(map[types.Type]int), - posInfoFormat: true, // TODO(gri) might become a flag, eventually - } - - // write version info - // The version string must start with "version %d" where %d is the version - // number. Additional debugging information may follow after a blank; that - // text is ignored by the importer. - p.rawStringln(fmt.Sprintf("version %d", exportVersion)) - var debug string - if debugFormat { - debug = "debug" - } - p.rawStringln(debug) // cannot use p.bool since it's affected by debugFormat; also want to see this clearly - p.bool(trackAllTypes) - p.bool(p.posInfoFormat) - - // --- generic export data --- - - // populate type map with predeclared "known" types - for index, typ := range predeclared() { - p.typIndex[typ] = index - } - if len(p.typIndex) != len(predeclared()) { - return nil, internalError("duplicate entries in type map?") - } - - // write package data - p.pkg(pkg, true) - if trace { - p.tracef("\n") - } - - // write objects - objcount := 0 - scope := pkg.Scope() - for _, name := range scope.Names() { - if !ast.IsExported(name) { - continue - } - if trace { - p.tracef("\n") - } - p.obj(scope.Lookup(name)) - objcount++ - } - - // indicate end of list - if trace { - p.tracef("\n") - } - p.tag(endTag) - - // for self-verification only (redundant) - p.int(objcount) - - if trace { - p.tracef("\n") - } - - // --- end of export data --- - - return p.out.Bytes(), nil -} - -func (p *exporter) pkg(pkg *types.Package, emptypath bool) { - if pkg == nil { - panic(internalError("unexpected nil pkg")) - } - - // if we saw the package before, write its index (>= 0) - if i, ok := p.pkgIndex[pkg]; ok { - p.index('P', i) - return - } - - // otherwise, remember the package, write the package tag (< 0) and package data - if trace { - p.tracef("P%d = { ", len(p.pkgIndex)) - defer p.tracef("} ") - } - p.pkgIndex[pkg] = len(p.pkgIndex) - - p.tag(packageTag) - p.string(pkg.Name()) - if emptypath { - p.string("") - } else { - p.string(pkg.Path()) - } -} - -func (p *exporter) obj(obj types.Object) { - switch obj := obj.(type) { - case *types.Const: - p.tag(constTag) - p.pos(obj) - p.qualifiedName(obj) - p.typ(obj.Type()) - p.value(obj.Val()) - - case *types.TypeName: - if obj.IsAlias() { - p.tag(aliasTag) - p.pos(obj) - p.qualifiedName(obj) - } else { - p.tag(typeTag) - } - p.typ(obj.Type()) - - case *types.Var: - p.tag(varTag) - p.pos(obj) - p.qualifiedName(obj) - p.typ(obj.Type()) - - case *types.Func: - p.tag(funcTag) - p.pos(obj) - p.qualifiedName(obj) - sig := obj.Type().(*types.Signature) - p.paramList(sig.Params(), sig.Variadic()) - p.paramList(sig.Results(), false) - - default: - panic(internalErrorf("unexpected object %v (%T)", obj, obj)) - } -} - -func (p *exporter) pos(obj types.Object) { - if !p.posInfoFormat { - return - } - - file, line := p.fileLine(obj) - if file == p.prevFile { - // common case: write line delta - // delta == 0 means different file or no line change - delta := line - p.prevLine - p.int(delta) - if delta == 0 { - p.int(-1) // -1 means no file change - } - } else { - // different file - p.int(0) - // Encode filename as length of common prefix with previous - // filename, followed by (possibly empty) suffix. Filenames - // frequently share path prefixes, so this can save a lot - // of space and make export data size less dependent on file - // path length. The suffix is unlikely to be empty because - // file names tend to end in ".go". - n := commonPrefixLen(p.prevFile, file) - p.int(n) // n >= 0 - p.string(file[n:]) // write suffix only - p.prevFile = file - p.int(line) - } - p.prevLine = line -} - -func (p *exporter) fileLine(obj types.Object) (file string, line int) { - if p.fset != nil { - pos := p.fset.Position(obj.Pos()) - file = pos.Filename - line = pos.Line - } - return -} - -func commonPrefixLen(a, b string) int { - if len(a) > len(b) { - a, b = b, a - } - // len(a) <= len(b) - i := 0 - for i < len(a) && a[i] == b[i] { - i++ - } - return i -} - -func (p *exporter) qualifiedName(obj types.Object) { - p.string(obj.Name()) - p.pkg(obj.Pkg(), false) -} - -func (p *exporter) typ(t types.Type) { - if t == nil { - panic(internalError("nil type")) - } - - // Possible optimization: Anonymous pointer types *T where - // T is a named type are common. We could canonicalize all - // such types *T to a single type PT = *T. This would lead - // to at most one *T entry in typIndex, and all future *T's - // would be encoded as the respective index directly. Would - // save 1 byte (pointerTag) per *T and reduce the typIndex - // size (at the cost of a canonicalization map). We can do - // this later, without encoding format change. - - // if we saw the type before, write its index (>= 0) - if i, ok := p.typIndex[t]; ok { - p.index('T', i) - return - } - - // otherwise, remember the type, write the type tag (< 0) and type data - if trackAllTypes { - if trace { - p.tracef("T%d = {>\n", len(p.typIndex)) - defer p.tracef("<\n} ") - } - p.typIndex[t] = len(p.typIndex) - } - - switch t := t.(type) { - case *types.Named: - if !trackAllTypes { - // if we don't track all types, track named types now - p.typIndex[t] = len(p.typIndex) - } - - p.tag(namedTag) - p.pos(t.Obj()) - p.qualifiedName(t.Obj()) - p.typ(t.Underlying()) - if !types.IsInterface(t) { - p.assocMethods(t) - } - - case *types.Array: - p.tag(arrayTag) - p.int64(t.Len()) - p.typ(t.Elem()) - - case *types.Slice: - p.tag(sliceTag) - p.typ(t.Elem()) - - case *dddSlice: - p.tag(dddTag) - p.typ(t.elem) - - case *types.Struct: - p.tag(structTag) - p.fieldList(t) - - case *types.Pointer: - p.tag(pointerTag) - p.typ(t.Elem()) - - case *types.Signature: - p.tag(signatureTag) - p.paramList(t.Params(), t.Variadic()) - p.paramList(t.Results(), false) - - case *types.Interface: - p.tag(interfaceTag) - p.iface(t) - - case *types.Map: - p.tag(mapTag) - p.typ(t.Key()) - p.typ(t.Elem()) - - case *types.Chan: - p.tag(chanTag) - p.int(int(3 - t.Dir())) // hack - p.typ(t.Elem()) - - default: - panic(internalErrorf("unexpected type %T: %s", t, t)) - } -} - -func (p *exporter) assocMethods(named *types.Named) { - // Sort methods (for determinism). - var methods []*types.Func - for i := 0; i < named.NumMethods(); i++ { - methods = append(methods, named.Method(i)) - } - sort.Sort(methodsByName(methods)) - - p.int(len(methods)) - - if trace && methods != nil { - p.tracef("associated methods {>\n") - } - - for i, m := range methods { - if trace && i > 0 { - p.tracef("\n") - } - - p.pos(m) - name := m.Name() - p.string(name) - if !exported(name) { - p.pkg(m.Pkg(), false) - } - - sig := m.Type().(*types.Signature) - p.paramList(types.NewTuple(sig.Recv()), false) - p.paramList(sig.Params(), sig.Variadic()) - p.paramList(sig.Results(), false) - p.int(0) // dummy value for go:nointerface pragma - ignored by importer - } - - if trace && methods != nil { - p.tracef("<\n} ") - } -} - -type methodsByName []*types.Func - -func (x methodsByName) Len() int { return len(x) } -func (x methodsByName) Swap(i, j int) { x[i], x[j] = x[j], x[i] } -func (x methodsByName) Less(i, j int) bool { return x[i].Name() < x[j].Name() } - -func (p *exporter) fieldList(t *types.Struct) { - if trace && t.NumFields() > 0 { - p.tracef("fields {>\n") - defer p.tracef("<\n} ") - } - - p.int(t.NumFields()) - for i := 0; i < t.NumFields(); i++ { - if trace && i > 0 { - p.tracef("\n") - } - p.field(t.Field(i)) - p.string(t.Tag(i)) - } -} - -func (p *exporter) field(f *types.Var) { - if !f.IsField() { - panic(internalError("field expected")) - } - - p.pos(f) - p.fieldName(f) - p.typ(f.Type()) -} - -func (p *exporter) iface(t *types.Interface) { - // TODO(gri): enable importer to load embedded interfaces, - // then emit Embeddeds and ExplicitMethods separately here. - p.int(0) - - n := t.NumMethods() - if trace && n > 0 { - p.tracef("methods {>\n") - defer p.tracef("<\n} ") - } - p.int(n) - for i := 0; i < n; i++ { - if trace && i > 0 { - p.tracef("\n") - } - p.method(t.Method(i)) - } -} - -func (p *exporter) method(m *types.Func) { - sig := m.Type().(*types.Signature) - if sig.Recv() == nil { - panic(internalError("method expected")) - } - - p.pos(m) - p.string(m.Name()) - if m.Name() != "_" && !ast.IsExported(m.Name()) { - p.pkg(m.Pkg(), false) - } - - // interface method; no need to encode receiver. - p.paramList(sig.Params(), sig.Variadic()) - p.paramList(sig.Results(), false) -} - -func (p *exporter) fieldName(f *types.Var) { - name := f.Name() - - if f.Anonymous() { - // anonymous field - we distinguish between 3 cases: - // 1) field name matches base type name and is exported - // 2) field name matches base type name and is not exported - // 3) field name doesn't match base type name (alias name) - bname := basetypeName(f.Type()) - if name == bname { - if ast.IsExported(name) { - name = "" // 1) we don't need to know the field name or package - } else { - name = "?" // 2) use unexported name "?" to force package export - } - } else { - // 3) indicate alias and export name as is - // (this requires an extra "@" but this is a rare case) - p.string("@") - } - } - - p.string(name) - if name != "" && !ast.IsExported(name) { - p.pkg(f.Pkg(), false) - } -} - -func basetypeName(typ types.Type) string { - switch typ := deref(typ).(type) { - case *types.Basic: - return typ.Name() - case *types.Named: - return typ.Obj().Name() - default: - return "" // unnamed type - } -} - -func (p *exporter) paramList(params *types.Tuple, variadic bool) { - // use negative length to indicate unnamed parameters - // (look at the first parameter only since either all - // names are present or all are absent) - n := params.Len() - if n > 0 && params.At(0).Name() == "" { - n = -n - } - p.int(n) - for i := 0; i < params.Len(); i++ { - q := params.At(i) - t := q.Type() - if variadic && i == params.Len()-1 { - t = &dddSlice{t.(*types.Slice).Elem()} - } - p.typ(t) - if n > 0 { - name := q.Name() - p.string(name) - if name != "_" { - p.pkg(q.Pkg(), false) - } - } - p.string("") // no compiler-specific info - } -} - -func (p *exporter) value(x constant.Value) { - if trace { - p.tracef("= ") - } - - switch x.Kind() { - case constant.Bool: - tag := falseTag - if constant.BoolVal(x) { - tag = trueTag - } - p.tag(tag) - - case constant.Int: - if v, exact := constant.Int64Val(x); exact { - // common case: x fits into an int64 - use compact encoding - p.tag(int64Tag) - p.int64(v) - return - } - // uncommon case: large x - use float encoding - // (powers of 2 will be encoded efficiently with exponent) - p.tag(floatTag) - p.float(constant.ToFloat(x)) - - case constant.Float: - p.tag(floatTag) - p.float(x) - - case constant.Complex: - p.tag(complexTag) - p.float(constant.Real(x)) - p.float(constant.Imag(x)) - - case constant.String: - p.tag(stringTag) - p.string(constant.StringVal(x)) - - case constant.Unknown: - // package contains type errors - p.tag(unknownTag) - - default: - panic(internalErrorf("unexpected value %v (%T)", x, x)) - } -} - -func (p *exporter) float(x constant.Value) { - if x.Kind() != constant.Float { - panic(internalErrorf("unexpected constant %v, want float", x)) - } - // extract sign (there is no -0) - sign := constant.Sign(x) - if sign == 0 { - // x == 0 - p.int(0) - return - } - // x != 0 - - var f big.Float - if v, exact := constant.Float64Val(x); exact { - // float64 - f.SetFloat64(v) - } else if num, denom := constant.Num(x), constant.Denom(x); num.Kind() == constant.Int { - // TODO(gri): add big.Rat accessor to constant.Value. - r := valueToRat(num) - f.SetRat(r.Quo(r, valueToRat(denom))) - } else { - // Value too large to represent as a fraction => inaccessible. - // TODO(gri): add big.Float accessor to constant.Value. - f.SetFloat64(math.MaxFloat64) // FIXME - } - - // extract exponent such that 0.5 <= m < 1.0 - var m big.Float - exp := f.MantExp(&m) - - // extract mantissa as *big.Int - // - set exponent large enough so mant satisfies mant.IsInt() - // - get *big.Int from mant - m.SetMantExp(&m, int(m.MinPrec())) - mant, acc := m.Int(nil) - if acc != big.Exact { - panic(internalError("internal error")) - } - - p.int(sign) - p.int(exp) - p.string(string(mant.Bytes())) -} - -func valueToRat(x constant.Value) *big.Rat { - // Convert little-endian to big-endian. - // I can't believe this is necessary. - bytes := constant.Bytes(x) - for i := 0; i < len(bytes)/2; i++ { - bytes[i], bytes[len(bytes)-1-i] = bytes[len(bytes)-1-i], bytes[i] - } - return new(big.Rat).SetInt(new(big.Int).SetBytes(bytes)) -} - -func (p *exporter) bool(b bool) bool { - if trace { - p.tracef("[") - defer p.tracef("= %v] ", b) - } - - x := 0 - if b { - x = 1 - } - p.int(x) - return b -} - -// ---------------------------------------------------------------------------- -// Low-level encoders - -func (p *exporter) index(marker byte, index int) { - if index < 0 { - panic(internalError("invalid index < 0")) - } - if debugFormat { - p.marker('t') - } - if trace { - p.tracef("%c%d ", marker, index) - } - p.rawInt64(int64(index)) -} - -func (p *exporter) tag(tag int) { - if tag >= 0 { - panic(internalError("invalid tag >= 0")) - } - if debugFormat { - p.marker('t') - } - if trace { - p.tracef("%s ", tagString[-tag]) - } - p.rawInt64(int64(tag)) -} - -func (p *exporter) int(x int) { - p.int64(int64(x)) -} - -func (p *exporter) int64(x int64) { - if debugFormat { - p.marker('i') - } - if trace { - p.tracef("%d ", x) - } - p.rawInt64(x) -} - -func (p *exporter) string(s string) { - if debugFormat { - p.marker('s') - } - if trace { - p.tracef("%q ", s) - } - // if we saw the string before, write its index (>= 0) - // (the empty string is mapped to 0) - if i, ok := p.strIndex[s]; ok { - p.rawInt64(int64(i)) - return - } - // otherwise, remember string and write its negative length and bytes - p.strIndex[s] = len(p.strIndex) - p.rawInt64(-int64(len(s))) - for i := 0; i < len(s); i++ { - p.rawByte(s[i]) - } -} - -// marker emits a marker byte and position information which makes -// it easy for a reader to detect if it is "out of sync". Used for -// debugFormat format only. -func (p *exporter) marker(m byte) { - p.rawByte(m) - // Enable this for help tracking down the location - // of an incorrect marker when running in debugFormat. - if false && trace { - p.tracef("#%d ", p.written) - } - p.rawInt64(int64(p.written)) -} - -// rawInt64 should only be used by low-level encoders. -func (p *exporter) rawInt64(x int64) { - var tmp [binary.MaxVarintLen64]byte - n := binary.PutVarint(tmp[:], x) - for i := 0; i < n; i++ { - p.rawByte(tmp[i]) - } -} - -// rawStringln should only be used to emit the initial version string. -func (p *exporter) rawStringln(s string) { - for i := 0; i < len(s); i++ { - p.rawByte(s[i]) - } - p.rawByte('\n') -} - -// rawByte is the bottleneck interface to write to p.out. -// rawByte escapes b as follows (any encoding does that -// hides '$'): -// -// '$' => '|' 'S' -// '|' => '|' '|' -// -// Necessary so other tools can find the end of the -// export data by searching for "$$". -// rawByte should only be used by low-level encoders. -func (p *exporter) rawByte(b byte) { - switch b { - case '$': - // write '$' as '|' 'S' - b = 'S' - fallthrough - case '|': - // write '|' as '|' '|' - p.out.WriteByte('|') - p.written++ - } - p.out.WriteByte(b) - p.written++ -} - -// tracef is like fmt.Printf but it rewrites the format string -// to take care of indentation. -func (p *exporter) tracef(format string, args ...interface{}) { - if strings.ContainsAny(format, "<>\n") { - var buf bytes.Buffer - for i := 0; i < len(format); i++ { - // no need to deal with runes - ch := format[i] - switch ch { - case '>': - p.indent++ - continue - case '<': - p.indent-- - continue - } - buf.WriteByte(ch) - if ch == '\n' { - for j := p.indent; j > 0; j-- { - buf.WriteString(". ") - } - } - } - format = buf.String() - } - fmt.Printf(format, args...) -} - -// Debugging support. -// (tagString is only used when tracing is enabled) -var tagString = [...]string{ - // Packages - -packageTag: "package", - - // Types - -namedTag: "named type", - -arrayTag: "array", - -sliceTag: "slice", - -dddTag: "ddd", - -structTag: "struct", - -pointerTag: "pointer", - -signatureTag: "signature", - -interfaceTag: "interface", - -mapTag: "map", - -chanTag: "chan", - - // Values - -falseTag: "false", - -trueTag: "true", - -int64Tag: "int64", - -floatTag: "float", - -fractionTag: "fraction", - -complexTag: "complex", - -stringTag: "string", - -unknownTag: "unknown", - - // Type aliases - -aliasTag: "alias", -} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go b/vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go deleted file mode 100644 index e9f73d14a1..0000000000 --- a/vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go +++ /dev/null @@ -1,1039 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file is a copy of $GOROOT/src/go/internal/gcimporter/bimport.go. - -package gcimporter - -import ( - "encoding/binary" - "fmt" - "go/constant" - "go/token" - "go/types" - "sort" - "strconv" - "strings" - "sync" - "unicode" - "unicode/utf8" -) - -type importer struct { - imports map[string]*types.Package - data []byte - importpath string - buf []byte // for reading strings - version int // export format version - - // object lists - strList []string // in order of appearance - pathList []string // in order of appearance - pkgList []*types.Package // in order of appearance - typList []types.Type // in order of appearance - interfaceList []*types.Interface // for delayed completion only - trackAllTypes bool - - // position encoding - posInfoFormat bool - prevFile string - prevLine int - fake fakeFileSet - - // debugging support - debugFormat bool - read int // bytes read -} - -// BImportData imports a package from the serialized package data -// and returns the number of bytes consumed and a reference to the package. -// If the export data version is not recognized or the format is otherwise -// compromised, an error is returned. -func BImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) { - // catch panics and return them as errors - const currentVersion = 6 - version := -1 // unknown version - defer func() { - if e := recover(); e != nil { - // Return a (possibly nil or incomplete) package unchanged (see #16088). - if version > currentVersion { - err = fmt.Errorf("cannot import %q (%v), export data is newer version - update tool", path, e) - } else { - err = fmt.Errorf("cannot import %q (%v), possibly version skew - reinstall package", path, e) - } - } - }() - - p := importer{ - imports: imports, - data: data, - importpath: path, - version: version, - strList: []string{""}, // empty string is mapped to 0 - pathList: []string{""}, // empty string is mapped to 0 - fake: fakeFileSet{ - fset: fset, - files: make(map[string]*token.File), - }, - } - - // read version info - var versionstr string - if b := p.rawByte(); b == 'c' || b == 'd' { - // Go1.7 encoding; first byte encodes low-level - // encoding format (compact vs debug). - // For backward-compatibility only (avoid problems with - // old installed packages). Newly compiled packages use - // the extensible format string. - // TODO(gri) Remove this support eventually; after Go1.8. - if b == 'd' { - p.debugFormat = true - } - p.trackAllTypes = p.rawByte() == 'a' - p.posInfoFormat = p.int() != 0 - versionstr = p.string() - if versionstr == "v1" { - version = 0 - } - } else { - // Go1.8 extensible encoding - // read version string and extract version number (ignore anything after the version number) - versionstr = p.rawStringln(b) - if s := strings.SplitN(versionstr, " ", 3); len(s) >= 2 && s[0] == "version" { - if v, err := strconv.Atoi(s[1]); err == nil && v > 0 { - version = v - } - } - } - p.version = version - - // read version specific flags - extend as necessary - switch p.version { - // case currentVersion: - // ... - // fallthrough - case currentVersion, 5, 4, 3, 2, 1: - p.debugFormat = p.rawStringln(p.rawByte()) == "debug" - p.trackAllTypes = p.int() != 0 - p.posInfoFormat = p.int() != 0 - case 0: - // Go1.7 encoding format - nothing to do here - default: - errorf("unknown bexport format version %d (%q)", p.version, versionstr) - } - - // --- generic export data --- - - // populate typList with predeclared "known" types - p.typList = append(p.typList, predeclared()...) - - // read package data - pkg = p.pkg() - - // read objects of phase 1 only (see cmd/compile/internal/gc/bexport.go) - objcount := 0 - for { - tag := p.tagOrIndex() - if tag == endTag { - break - } - p.obj(tag) - objcount++ - } - - // self-verification - if count := p.int(); count != objcount { - errorf("got %d objects; want %d", objcount, count) - } - - // ignore compiler-specific import data - - // complete interfaces - // TODO(gri) re-investigate if we still need to do this in a delayed fashion - for _, typ := range p.interfaceList { - typ.Complete() - } - - // record all referenced packages as imports - list := append(([]*types.Package)(nil), p.pkgList[1:]...) - sort.Sort(byPath(list)) - pkg.SetImports(list) - - // package was imported completely and without errors - pkg.MarkComplete() - - return p.read, pkg, nil -} - -func errorf(format string, args ...interface{}) { - panic(fmt.Sprintf(format, args...)) -} - -func (p *importer) pkg() *types.Package { - // if the package was seen before, i is its index (>= 0) - i := p.tagOrIndex() - if i >= 0 { - return p.pkgList[i] - } - - // otherwise, i is the package tag (< 0) - if i != packageTag { - errorf("unexpected package tag %d version %d", i, p.version) - } - - // read package data - name := p.string() - var path string - if p.version >= 5 { - path = p.path() - } else { - path = p.string() - } - if p.version >= 6 { - p.int() // package height; unused by go/types - } - - // we should never see an empty package name - if name == "" { - errorf("empty package name in import") - } - - // an empty path denotes the package we are currently importing; - // it must be the first package we see - if (path == "") != (len(p.pkgList) == 0) { - errorf("package path %q for pkg index %d", path, len(p.pkgList)) - } - - // if the package was imported before, use that one; otherwise create a new one - if path == "" { - path = p.importpath - } - pkg := p.imports[path] - if pkg == nil { - pkg = types.NewPackage(path, name) - p.imports[path] = pkg - } else if pkg.Name() != name { - errorf("conflicting names %s and %s for package %q", pkg.Name(), name, path) - } - p.pkgList = append(p.pkgList, pkg) - - return pkg -} - -// objTag returns the tag value for each object kind. -func objTag(obj types.Object) int { - switch obj.(type) { - case *types.Const: - return constTag - case *types.TypeName: - return typeTag - case *types.Var: - return varTag - case *types.Func: - return funcTag - default: - errorf("unexpected object: %v (%T)", obj, obj) // panics - panic("unreachable") - } -} - -func sameObj(a, b types.Object) bool { - // Because unnamed types are not canonicalized, we cannot simply compare types for - // (pointer) identity. - // Ideally we'd check equality of constant values as well, but this is good enough. - return objTag(a) == objTag(b) && types.Identical(a.Type(), b.Type()) -} - -func (p *importer) declare(obj types.Object) { - pkg := obj.Pkg() - if alt := pkg.Scope().Insert(obj); alt != nil { - // This can only trigger if we import a (non-type) object a second time. - // Excluding type aliases, this cannot happen because 1) we only import a package - // once; and b) we ignore compiler-specific export data which may contain - // functions whose inlined function bodies refer to other functions that - // were already imported. - // However, type aliases require reexporting the original type, so we need - // to allow it (see also the comment in cmd/compile/internal/gc/bimport.go, - // method importer.obj, switch case importing functions). - // TODO(gri) review/update this comment once the gc compiler handles type aliases. - if !sameObj(obj, alt) { - errorf("inconsistent import:\n\t%v\npreviously imported as:\n\t%v\n", obj, alt) - } - } -} - -func (p *importer) obj(tag int) { - switch tag { - case constTag: - pos := p.pos() - pkg, name := p.qualifiedName() - typ := p.typ(nil, nil) - val := p.value() - p.declare(types.NewConst(pos, pkg, name, typ, val)) - - case aliasTag: - // TODO(gri) verify type alias hookup is correct - pos := p.pos() - pkg, name := p.qualifiedName() - typ := p.typ(nil, nil) - p.declare(types.NewTypeName(pos, pkg, name, typ)) - - case typeTag: - p.typ(nil, nil) - - case varTag: - pos := p.pos() - pkg, name := p.qualifiedName() - typ := p.typ(nil, nil) - p.declare(types.NewVar(pos, pkg, name, typ)) - - case funcTag: - pos := p.pos() - pkg, name := p.qualifiedName() - params, isddd := p.paramList() - result, _ := p.paramList() - sig := types.NewSignature(nil, params, result, isddd) - p.declare(types.NewFunc(pos, pkg, name, sig)) - - default: - errorf("unexpected object tag %d", tag) - } -} - -const deltaNewFile = -64 // see cmd/compile/internal/gc/bexport.go - -func (p *importer) pos() token.Pos { - if !p.posInfoFormat { - return token.NoPos - } - - file := p.prevFile - line := p.prevLine - delta := p.int() - line += delta - if p.version >= 5 { - if delta == deltaNewFile { - if n := p.int(); n >= 0 { - // file changed - file = p.path() - line = n - } - } - } else { - if delta == 0 { - if n := p.int(); n >= 0 { - // file changed - file = p.prevFile[:n] + p.string() - line = p.int() - } - } - } - p.prevFile = file - p.prevLine = line - - return p.fake.pos(file, line, 0) -} - -// Synthesize a token.Pos -type fakeFileSet struct { - fset *token.FileSet - files map[string]*token.File -} - -func (s *fakeFileSet) pos(file string, line, column int) token.Pos { - // TODO(mdempsky): Make use of column. - - // Since we don't know the set of needed file positions, we - // reserve maxlines positions per file. - const maxlines = 64 * 1024 - f := s.files[file] - if f == nil { - f = s.fset.AddFile(file, -1, maxlines) - s.files[file] = f - // Allocate the fake linebreak indices on first use. - // TODO(adonovan): opt: save ~512KB using a more complex scheme? - fakeLinesOnce.Do(func() { - fakeLines = make([]int, maxlines) - for i := range fakeLines { - fakeLines[i] = i - } - }) - f.SetLines(fakeLines) - } - - if line > maxlines { - line = 1 - } - - // Treat the file as if it contained only newlines - // and column=1: use the line number as the offset. - return f.Pos(line - 1) -} - -var ( - fakeLines []int - fakeLinesOnce sync.Once -) - -func (p *importer) qualifiedName() (pkg *types.Package, name string) { - name = p.string() - pkg = p.pkg() - return -} - -func (p *importer) record(t types.Type) { - p.typList = append(p.typList, t) -} - -// A dddSlice is a types.Type representing ...T parameters. -// It only appears for parameter types and does not escape -// the importer. -type dddSlice struct { - elem types.Type -} - -func (t *dddSlice) Underlying() types.Type { return t } -func (t *dddSlice) String() string { return "..." + t.elem.String() } - -// parent is the package which declared the type; parent == nil means -// the package currently imported. The parent package is needed for -// exported struct fields and interface methods which don't contain -// explicit package information in the export data. -// -// A non-nil tname is used as the "owner" of the result type; i.e., -// the result type is the underlying type of tname. tname is used -// to give interface methods a named receiver type where possible. -func (p *importer) typ(parent *types.Package, tname *types.Named) types.Type { - // if the type was seen before, i is its index (>= 0) - i := p.tagOrIndex() - if i >= 0 { - return p.typList[i] - } - - // otherwise, i is the type tag (< 0) - switch i { - case namedTag: - // read type object - pos := p.pos() - parent, name := p.qualifiedName() - scope := parent.Scope() - obj := scope.Lookup(name) - - // if the object doesn't exist yet, create and insert it - if obj == nil { - obj = types.NewTypeName(pos, parent, name, nil) - scope.Insert(obj) - } - - if _, ok := obj.(*types.TypeName); !ok { - errorf("pkg = %s, name = %s => %s", parent, name, obj) - } - - // associate new named type with obj if it doesn't exist yet - t0 := types.NewNamed(obj.(*types.TypeName), nil, nil) - - // but record the existing type, if any - tname := obj.Type().(*types.Named) // tname is either t0 or the existing type - p.record(tname) - - // read underlying type - t0.SetUnderlying(p.typ(parent, t0)) - - // interfaces don't have associated methods - if types.IsInterface(t0) { - return tname - } - - // read associated methods - for i := p.int(); i > 0; i-- { - // TODO(gri) replace this with something closer to fieldName - pos := p.pos() - name := p.string() - if !exported(name) { - p.pkg() - } - - recv, _ := p.paramList() // TODO(gri) do we need a full param list for the receiver? - params, isddd := p.paramList() - result, _ := p.paramList() - p.int() // go:nointerface pragma - discarded - - sig := types.NewSignature(recv.At(0), params, result, isddd) - t0.AddMethod(types.NewFunc(pos, parent, name, sig)) - } - - return tname - - case arrayTag: - t := new(types.Array) - if p.trackAllTypes { - p.record(t) - } - - n := p.int64() - *t = *types.NewArray(p.typ(parent, nil), n) - return t - - case sliceTag: - t := new(types.Slice) - if p.trackAllTypes { - p.record(t) - } - - *t = *types.NewSlice(p.typ(parent, nil)) - return t - - case dddTag: - t := new(dddSlice) - if p.trackAllTypes { - p.record(t) - } - - t.elem = p.typ(parent, nil) - return t - - case structTag: - t := new(types.Struct) - if p.trackAllTypes { - p.record(t) - } - - *t = *types.NewStruct(p.fieldList(parent)) - return t - - case pointerTag: - t := new(types.Pointer) - if p.trackAllTypes { - p.record(t) - } - - *t = *types.NewPointer(p.typ(parent, nil)) - return t - - case signatureTag: - t := new(types.Signature) - if p.trackAllTypes { - p.record(t) - } - - params, isddd := p.paramList() - result, _ := p.paramList() - *t = *types.NewSignature(nil, params, result, isddd) - return t - - case interfaceTag: - // Create a dummy entry in the type list. This is safe because we - // cannot expect the interface type to appear in a cycle, as any - // such cycle must contain a named type which would have been - // first defined earlier. - // TODO(gri) Is this still true now that we have type aliases? - // See issue #23225. - n := len(p.typList) - if p.trackAllTypes { - p.record(nil) - } - - var embeddeds []types.Type - for n := p.int(); n > 0; n-- { - p.pos() - embeddeds = append(embeddeds, p.typ(parent, nil)) - } - - t := newInterface(p.methodList(parent, tname), embeddeds) - p.interfaceList = append(p.interfaceList, t) - if p.trackAllTypes { - p.typList[n] = t - } - return t - - case mapTag: - t := new(types.Map) - if p.trackAllTypes { - p.record(t) - } - - key := p.typ(parent, nil) - val := p.typ(parent, nil) - *t = *types.NewMap(key, val) - return t - - case chanTag: - t := new(types.Chan) - if p.trackAllTypes { - p.record(t) - } - - dir := chanDir(p.int()) - val := p.typ(parent, nil) - *t = *types.NewChan(dir, val) - return t - - default: - errorf("unexpected type tag %d", i) // panics - panic("unreachable") - } -} - -func chanDir(d int) types.ChanDir { - // tag values must match the constants in cmd/compile/internal/gc/go.go - switch d { - case 1 /* Crecv */ : - return types.RecvOnly - case 2 /* Csend */ : - return types.SendOnly - case 3 /* Cboth */ : - return types.SendRecv - default: - errorf("unexpected channel dir %d", d) - return 0 - } -} - -func (p *importer) fieldList(parent *types.Package) (fields []*types.Var, tags []string) { - if n := p.int(); n > 0 { - fields = make([]*types.Var, n) - tags = make([]string, n) - for i := range fields { - fields[i], tags[i] = p.field(parent) - } - } - return -} - -func (p *importer) field(parent *types.Package) (*types.Var, string) { - pos := p.pos() - pkg, name, alias := p.fieldName(parent) - typ := p.typ(parent, nil) - tag := p.string() - - anonymous := false - if name == "" { - // anonymous field - typ must be T or *T and T must be a type name - switch typ := deref(typ).(type) { - case *types.Basic: // basic types are named types - pkg = nil // // objects defined in Universe scope have no package - name = typ.Name() - case *types.Named: - name = typ.Obj().Name() - default: - errorf("named base type expected") - } - anonymous = true - } else if alias { - // anonymous field: we have an explicit name because it's an alias - anonymous = true - } - - return types.NewField(pos, pkg, name, typ, anonymous), tag -} - -func (p *importer) methodList(parent *types.Package, baseType *types.Named) (methods []*types.Func) { - if n := p.int(); n > 0 { - methods = make([]*types.Func, n) - for i := range methods { - methods[i] = p.method(parent, baseType) - } - } - return -} - -func (p *importer) method(parent *types.Package, baseType *types.Named) *types.Func { - pos := p.pos() - pkg, name, _ := p.fieldName(parent) - // If we don't have a baseType, use a nil receiver. - // A receiver using the actual interface type (which - // we don't know yet) will be filled in when we call - // types.Interface.Complete. - var recv *types.Var - if baseType != nil { - recv = types.NewVar(token.NoPos, parent, "", baseType) - } - params, isddd := p.paramList() - result, _ := p.paramList() - sig := types.NewSignature(recv, params, result, isddd) - return types.NewFunc(pos, pkg, name, sig) -} - -func (p *importer) fieldName(parent *types.Package) (pkg *types.Package, name string, alias bool) { - name = p.string() - pkg = parent - if pkg == nil { - // use the imported package instead - pkg = p.pkgList[0] - } - if p.version == 0 && name == "_" { - // version 0 didn't export a package for _ fields - return - } - switch name { - case "": - // 1) field name matches base type name and is exported: nothing to do - case "?": - // 2) field name matches base type name and is not exported: need package - name = "" - pkg = p.pkg() - case "@": - // 3) field name doesn't match type name (alias) - name = p.string() - alias = true - fallthrough - default: - if !exported(name) { - pkg = p.pkg() - } - } - return -} - -func (p *importer) paramList() (*types.Tuple, bool) { - n := p.int() - if n == 0 { - return nil, false - } - // negative length indicates unnamed parameters - named := true - if n < 0 { - n = -n - named = false - } - // n > 0 - params := make([]*types.Var, n) - isddd := false - for i := range params { - params[i], isddd = p.param(named) - } - return types.NewTuple(params...), isddd -} - -func (p *importer) param(named bool) (*types.Var, bool) { - t := p.typ(nil, nil) - td, isddd := t.(*dddSlice) - if isddd { - t = types.NewSlice(td.elem) - } - - var pkg *types.Package - var name string - if named { - name = p.string() - if name == "" { - errorf("expected named parameter") - } - if name != "_" { - pkg = p.pkg() - } - if i := strings.Index(name, "·"); i > 0 { - name = name[:i] // cut off gc-specific parameter numbering - } - } - - // read and discard compiler-specific info - p.string() - - return types.NewVar(token.NoPos, pkg, name, t), isddd -} - -func exported(name string) bool { - ch, _ := utf8.DecodeRuneInString(name) - return unicode.IsUpper(ch) -} - -func (p *importer) value() constant.Value { - switch tag := p.tagOrIndex(); tag { - case falseTag: - return constant.MakeBool(false) - case trueTag: - return constant.MakeBool(true) - case int64Tag: - return constant.MakeInt64(p.int64()) - case floatTag: - return p.float() - case complexTag: - re := p.float() - im := p.float() - return constant.BinaryOp(re, token.ADD, constant.MakeImag(im)) - case stringTag: - return constant.MakeString(p.string()) - case unknownTag: - return constant.MakeUnknown() - default: - errorf("unexpected value tag %d", tag) // panics - panic("unreachable") - } -} - -func (p *importer) float() constant.Value { - sign := p.int() - if sign == 0 { - return constant.MakeInt64(0) - } - - exp := p.int() - mant := []byte(p.string()) // big endian - - // remove leading 0's if any - for len(mant) > 0 && mant[0] == 0 { - mant = mant[1:] - } - - // convert to little endian - // TODO(gri) go/constant should have a more direct conversion function - // (e.g., once it supports a big.Float based implementation) - for i, j := 0, len(mant)-1; i < j; i, j = i+1, j-1 { - mant[i], mant[j] = mant[j], mant[i] - } - - // adjust exponent (constant.MakeFromBytes creates an integer value, - // but mant represents the mantissa bits such that 0.5 <= mant < 1.0) - exp -= len(mant) << 3 - if len(mant) > 0 { - for msd := mant[len(mant)-1]; msd&0x80 == 0; msd <<= 1 { - exp++ - } - } - - x := constant.MakeFromBytes(mant) - switch { - case exp < 0: - d := constant.Shift(constant.MakeInt64(1), token.SHL, uint(-exp)) - x = constant.BinaryOp(x, token.QUO, d) - case exp > 0: - x = constant.Shift(x, token.SHL, uint(exp)) - } - - if sign < 0 { - x = constant.UnaryOp(token.SUB, x, 0) - } - return x -} - -// ---------------------------------------------------------------------------- -// Low-level decoders - -func (p *importer) tagOrIndex() int { - if p.debugFormat { - p.marker('t') - } - - return int(p.rawInt64()) -} - -func (p *importer) int() int { - x := p.int64() - if int64(int(x)) != x { - errorf("exported integer too large") - } - return int(x) -} - -func (p *importer) int64() int64 { - if p.debugFormat { - p.marker('i') - } - - return p.rawInt64() -} - -func (p *importer) path() string { - if p.debugFormat { - p.marker('p') - } - // if the path was seen before, i is its index (>= 0) - // (the empty string is at index 0) - i := p.rawInt64() - if i >= 0 { - return p.pathList[i] - } - // otherwise, i is the negative path length (< 0) - a := make([]string, -i) - for n := range a { - a[n] = p.string() - } - s := strings.Join(a, "/") - p.pathList = append(p.pathList, s) - return s -} - -func (p *importer) string() string { - if p.debugFormat { - p.marker('s') - } - // if the string was seen before, i is its index (>= 0) - // (the empty string is at index 0) - i := p.rawInt64() - if i >= 0 { - return p.strList[i] - } - // otherwise, i is the negative string length (< 0) - if n := int(-i); n <= cap(p.buf) { - p.buf = p.buf[:n] - } else { - p.buf = make([]byte, n) - } - for i := range p.buf { - p.buf[i] = p.rawByte() - } - s := string(p.buf) - p.strList = append(p.strList, s) - return s -} - -func (p *importer) marker(want byte) { - if got := p.rawByte(); got != want { - errorf("incorrect marker: got %c; want %c (pos = %d)", got, want, p.read) - } - - pos := p.read - if n := int(p.rawInt64()); n != pos { - errorf("incorrect position: got %d; want %d", n, pos) - } -} - -// rawInt64 should only be used by low-level decoders. -func (p *importer) rawInt64() int64 { - i, err := binary.ReadVarint(p) - if err != nil { - errorf("read error: %v", err) - } - return i -} - -// rawStringln should only be used to read the initial version string. -func (p *importer) rawStringln(b byte) string { - p.buf = p.buf[:0] - for b != '\n' { - p.buf = append(p.buf, b) - b = p.rawByte() - } - return string(p.buf) -} - -// needed for binary.ReadVarint in rawInt64 -func (p *importer) ReadByte() (byte, error) { - return p.rawByte(), nil -} - -// byte is the bottleneck interface for reading p.data. -// It unescapes '|' 'S' to '$' and '|' '|' to '|'. -// rawByte should only be used by low-level decoders. -func (p *importer) rawByte() byte { - b := p.data[0] - r := 1 - if b == '|' { - b = p.data[1] - r = 2 - switch b { - case 'S': - b = '$' - case '|': - // nothing to do - default: - errorf("unexpected escape sequence in export data") - } - } - p.data = p.data[r:] - p.read += r - return b - -} - -// ---------------------------------------------------------------------------- -// Export format - -// Tags. Must be < 0. -const ( - // Objects - packageTag = -(iota + 1) - constTag - typeTag - varTag - funcTag - endTag - - // Types - namedTag - arrayTag - sliceTag - dddTag - structTag - pointerTag - signatureTag - interfaceTag - mapTag - chanTag - - // Values - falseTag - trueTag - int64Tag - floatTag - fractionTag // not used by gc - complexTag - stringTag - nilTag // only used by gc (appears in exported inlined function bodies) - unknownTag // not used by gc (only appears in packages with errors) - - // Type aliases - aliasTag -) - -var predeclOnce sync.Once -var predecl []types.Type // initialized lazily - -func predeclared() []types.Type { - predeclOnce.Do(func() { - // initialize lazily to be sure that all - // elements have been initialized before - predecl = []types.Type{ // basic types - types.Typ[types.Bool], - types.Typ[types.Int], - types.Typ[types.Int8], - types.Typ[types.Int16], - types.Typ[types.Int32], - types.Typ[types.Int64], - types.Typ[types.Uint], - types.Typ[types.Uint8], - types.Typ[types.Uint16], - types.Typ[types.Uint32], - types.Typ[types.Uint64], - types.Typ[types.Uintptr], - types.Typ[types.Float32], - types.Typ[types.Float64], - types.Typ[types.Complex64], - types.Typ[types.Complex128], - types.Typ[types.String], - - // basic type aliases - types.Universe.Lookup("byte").Type(), - types.Universe.Lookup("rune").Type(), - - // error - types.Universe.Lookup("error").Type(), - - // untyped types - types.Typ[types.UntypedBool], - types.Typ[types.UntypedInt], - types.Typ[types.UntypedRune], - types.Typ[types.UntypedFloat], - types.Typ[types.UntypedComplex], - types.Typ[types.UntypedString], - types.Typ[types.UntypedNil], - - // package unsafe - types.Typ[types.UnsafePointer], - - // invalid type - types.Typ[types.Invalid], // only appears in packages with errors - - // used internally by gc; never used by this package or in .a files - anyType{}, - } - }) - return predecl -} - -type anyType struct{} - -func (t anyType) Underlying() types.Type { return t } -func (t anyType) String() string { return "any" } diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go b/vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go deleted file mode 100644 index f33dc5613e..0000000000 --- a/vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file is a copy of $GOROOT/src/go/internal/gcimporter/exportdata.go. - -// This file implements FindExportData. - -package gcimporter - -import ( - "bufio" - "fmt" - "io" - "strconv" - "strings" -) - -func readGopackHeader(r *bufio.Reader) (name string, size int, err error) { - // See $GOROOT/include/ar.h. - hdr := make([]byte, 16+12+6+6+8+10+2) - _, err = io.ReadFull(r, hdr) - if err != nil { - return - } - // leave for debugging - if false { - fmt.Printf("header: %s", hdr) - } - s := strings.TrimSpace(string(hdr[16+12+6+6+8:][:10])) - size, err = strconv.Atoi(s) - if err != nil || hdr[len(hdr)-2] != '`' || hdr[len(hdr)-1] != '\n' { - err = fmt.Errorf("invalid archive header") - return - } - name = strings.TrimSpace(string(hdr[:16])) - return -} - -// FindExportData positions the reader r at the beginning of the -// export data section of an underlying GC-created object/archive -// file by reading from it. The reader must be positioned at the -// start of the file before calling this function. The hdr result -// is the string before the export data, either "$$" or "$$B". -// -func FindExportData(r *bufio.Reader) (hdr string, err error) { - // Read first line to make sure this is an object file. - line, err := r.ReadSlice('\n') - if err != nil { - err = fmt.Errorf("can't find export data (%v)", err) - return - } - - if string(line) == "!\n" { - // Archive file. Scan to __.PKGDEF. - var name string - if name, _, err = readGopackHeader(r); err != nil { - return - } - - // First entry should be __.PKGDEF. - if name != "__.PKGDEF" { - err = fmt.Errorf("go archive is missing __.PKGDEF") - return - } - - // Read first line of __.PKGDEF data, so that line - // is once again the first line of the input. - if line, err = r.ReadSlice('\n'); err != nil { - err = fmt.Errorf("can't find export data (%v)", err) - return - } - } - - // Now at __.PKGDEF in archive or still at beginning of file. - // Either way, line should begin with "go object ". - if !strings.HasPrefix(string(line), "go object ") { - err = fmt.Errorf("not a Go object file") - return - } - - // Skip over object header to export data. - // Begins after first line starting with $$. - for line[0] != '$' { - if line, err = r.ReadSlice('\n'); err != nil { - err = fmt.Errorf("can't find export data (%v)", err) - return - } - } - hdr = string(line) - - return -} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go b/vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go deleted file mode 100644 index 8dcd8bbb71..0000000000 --- a/vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go +++ /dev/null @@ -1,1078 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file is a modified copy of $GOROOT/src/go/internal/gcimporter/gcimporter.go, -// but it also contains the original source-based importer code for Go1.6. -// Once we stop supporting 1.6, we can remove that code. - -// Package gcimporter provides various functions for reading -// gc-generated object files that can be used to implement the -// Importer interface defined by the Go 1.5 standard library package. -package gcimporter // import "golang.org/x/tools/go/internal/gcimporter" - -import ( - "bufio" - "errors" - "fmt" - "go/build" - "go/constant" - "go/token" - "go/types" - "io" - "io/ioutil" - "os" - "path/filepath" - "sort" - "strconv" - "strings" - "text/scanner" -) - -// debugging/development support -const debug = false - -var pkgExts = [...]string{".a", ".o"} - -// FindPkg returns the filename and unique package id for an import -// path based on package information provided by build.Import (using -// the build.Default build.Context). A relative srcDir is interpreted -// relative to the current working directory. -// If no file was found, an empty filename is returned. -// -func FindPkg(path, srcDir string) (filename, id string) { - if path == "" { - return - } - - var noext string - switch { - default: - // "x" -> "$GOPATH/pkg/$GOOS_$GOARCH/x.ext", "x" - // Don't require the source files to be present. - if abs, err := filepath.Abs(srcDir); err == nil { // see issue 14282 - srcDir = abs - } - bp, _ := build.Import(path, srcDir, build.FindOnly|build.AllowBinary) - if bp.PkgObj == "" { - id = path // make sure we have an id to print in error message - return - } - noext = strings.TrimSuffix(bp.PkgObj, ".a") - id = bp.ImportPath - - case build.IsLocalImport(path): - // "./x" -> "/this/directory/x.ext", "/this/directory/x" - noext = filepath.Join(srcDir, path) - id = noext - - case filepath.IsAbs(path): - // for completeness only - go/build.Import - // does not support absolute imports - // "/x" -> "/x.ext", "/x" - noext = path - id = path - } - - if false { // for debugging - if path != id { - fmt.Printf("%s -> %s\n", path, id) - } - } - - // try extensions - for _, ext := range pkgExts { - filename = noext + ext - if f, err := os.Stat(filename); err == nil && !f.IsDir() { - return - } - } - - filename = "" // not found - return -} - -// ImportData imports a package by reading the gc-generated export data, -// adds the corresponding package object to the packages map indexed by id, -// and returns the object. -// -// The packages map must contains all packages already imported. The data -// reader position must be the beginning of the export data section. The -// filename is only used in error messages. -// -// If packages[id] contains the completely imported package, that package -// can be used directly, and there is no need to call this function (but -// there is also no harm but for extra time used). -// -func ImportData(packages map[string]*types.Package, filename, id string, data io.Reader) (pkg *types.Package, err error) { - // support for parser error handling - defer func() { - switch r := recover().(type) { - case nil: - // nothing to do - case importError: - err = r - default: - panic(r) // internal error - } - }() - - var p parser - p.init(filename, id, data, packages) - pkg = p.parseExport() - - return -} - -// Import imports a gc-generated package given its import path and srcDir, adds -// the corresponding package object to the packages map, and returns the object. -// The packages map must contain all packages already imported. -// -func Import(packages map[string]*types.Package, path, srcDir string, lookup func(path string) (io.ReadCloser, error)) (pkg *types.Package, err error) { - var rc io.ReadCloser - var filename, id string - if lookup != nil { - // With custom lookup specified, assume that caller has - // converted path to a canonical import path for use in the map. - if path == "unsafe" { - return types.Unsafe, nil - } - id = path - - // No need to re-import if the package was imported completely before. - if pkg = packages[id]; pkg != nil && pkg.Complete() { - return - } - f, err := lookup(path) - if err != nil { - return nil, err - } - rc = f - } else { - filename, id = FindPkg(path, srcDir) - if filename == "" { - if path == "unsafe" { - return types.Unsafe, nil - } - return nil, fmt.Errorf("can't find import: %q", id) - } - - // no need to re-import if the package was imported completely before - if pkg = packages[id]; pkg != nil && pkg.Complete() { - return - } - - // open file - f, err := os.Open(filename) - if err != nil { - return nil, err - } - defer func() { - if err != nil { - // add file name to error - err = fmt.Errorf("%s: %v", filename, err) - } - }() - rc = f - } - defer rc.Close() - - var hdr string - buf := bufio.NewReader(rc) - if hdr, err = FindExportData(buf); err != nil { - return - } - - switch hdr { - case "$$\n": - // Work-around if we don't have a filename; happens only if lookup != nil. - // Either way, the filename is only needed for importer error messages, so - // this is fine. - if filename == "" { - filename = path - } - return ImportData(packages, filename, id, buf) - - case "$$B\n": - var data []byte - data, err = ioutil.ReadAll(buf) - if err != nil { - break - } - - // TODO(gri): allow clients of go/importer to provide a FileSet. - // Or, define a new standard go/types/gcexportdata package. - fset := token.NewFileSet() - - // The indexed export format starts with an 'i'; the older - // binary export format starts with a 'c', 'd', or 'v' - // (from "version"). Select appropriate importer. - if len(data) > 0 && data[0] == 'i' { - _, pkg, err = IImportData(fset, packages, data[1:], id) - } else { - _, pkg, err = BImportData(fset, packages, data, id) - } - - default: - err = fmt.Errorf("unknown export data header: %q", hdr) - } - - return -} - -// ---------------------------------------------------------------------------- -// Parser - -// TODO(gri) Imported objects don't have position information. -// Ideally use the debug table line info; alternatively -// create some fake position (or the position of the -// import). That way error messages referring to imported -// objects can print meaningful information. - -// parser parses the exports inside a gc compiler-produced -// object/archive file and populates its scope with the results. -type parser struct { - scanner scanner.Scanner - tok rune // current token - lit string // literal string; only valid for Ident, Int, String tokens - id string // package id of imported package - sharedPkgs map[string]*types.Package // package id -> package object (across importer) - localPkgs map[string]*types.Package // package id -> package object (just this package) -} - -func (p *parser) init(filename, id string, src io.Reader, packages map[string]*types.Package) { - p.scanner.Init(src) - p.scanner.Error = func(_ *scanner.Scanner, msg string) { p.error(msg) } - p.scanner.Mode = scanner.ScanIdents | scanner.ScanInts | scanner.ScanChars | scanner.ScanStrings | scanner.ScanComments | scanner.SkipComments - p.scanner.Whitespace = 1<<'\t' | 1<<' ' - p.scanner.Filename = filename // for good error messages - p.next() - p.id = id - p.sharedPkgs = packages - if debug { - // check consistency of packages map - for _, pkg := range packages { - if pkg.Name() == "" { - fmt.Printf("no package name for %s\n", pkg.Path()) - } - } - } -} - -func (p *parser) next() { - p.tok = p.scanner.Scan() - switch p.tok { - case scanner.Ident, scanner.Int, scanner.Char, scanner.String, '·': - p.lit = p.scanner.TokenText() - default: - p.lit = "" - } - if debug { - fmt.Printf("%s: %q -> %q\n", scanner.TokenString(p.tok), p.scanner.TokenText(), p.lit) - } -} - -func declTypeName(pkg *types.Package, name string) *types.TypeName { - scope := pkg.Scope() - if obj := scope.Lookup(name); obj != nil { - return obj.(*types.TypeName) - } - obj := types.NewTypeName(token.NoPos, pkg, name, nil) - // a named type may be referred to before the underlying type - // is known - set it up - types.NewNamed(obj, nil, nil) - scope.Insert(obj) - return obj -} - -// ---------------------------------------------------------------------------- -// Error handling - -// Internal errors are boxed as importErrors. -type importError struct { - pos scanner.Position - err error -} - -func (e importError) Error() string { - return fmt.Sprintf("import error %s (byte offset = %d): %s", e.pos, e.pos.Offset, e.err) -} - -func (p *parser) error(err interface{}) { - if s, ok := err.(string); ok { - err = errors.New(s) - } - // panic with a runtime.Error if err is not an error - panic(importError{p.scanner.Pos(), err.(error)}) -} - -func (p *parser) errorf(format string, args ...interface{}) { - p.error(fmt.Sprintf(format, args...)) -} - -func (p *parser) expect(tok rune) string { - lit := p.lit - if p.tok != tok { - p.errorf("expected %s, got %s (%s)", scanner.TokenString(tok), scanner.TokenString(p.tok), lit) - } - p.next() - return lit -} - -func (p *parser) expectSpecial(tok string) { - sep := 'x' // not white space - i := 0 - for i < len(tok) && p.tok == rune(tok[i]) && sep > ' ' { - sep = p.scanner.Peek() // if sep <= ' ', there is white space before the next token - p.next() - i++ - } - if i < len(tok) { - p.errorf("expected %q, got %q", tok, tok[0:i]) - } -} - -func (p *parser) expectKeyword(keyword string) { - lit := p.expect(scanner.Ident) - if lit != keyword { - p.errorf("expected keyword %s, got %q", keyword, lit) - } -} - -// ---------------------------------------------------------------------------- -// Qualified and unqualified names - -// PackageId = string_lit . -// -func (p *parser) parsePackageID() string { - id, err := strconv.Unquote(p.expect(scanner.String)) - if err != nil { - p.error(err) - } - // id == "" stands for the imported package id - // (only known at time of package installation) - if id == "" { - id = p.id - } - return id -} - -// PackageName = ident . -// -func (p *parser) parsePackageName() string { - return p.expect(scanner.Ident) -} - -// dotIdentifier = ( ident | '·' ) { ident | int | '·' } . -func (p *parser) parseDotIdent() string { - ident := "" - if p.tok != scanner.Int { - sep := 'x' // not white space - for (p.tok == scanner.Ident || p.tok == scanner.Int || p.tok == '·') && sep > ' ' { - ident += p.lit - sep = p.scanner.Peek() // if sep <= ' ', there is white space before the next token - p.next() - } - } - if ident == "" { - p.expect(scanner.Ident) // use expect() for error handling - } - return ident -} - -// QualifiedName = "@" PackageId "." ( "?" | dotIdentifier ) . -// -func (p *parser) parseQualifiedName() (id, name string) { - p.expect('@') - id = p.parsePackageID() - p.expect('.') - // Per rev f280b8a485fd (10/2/2013), qualified names may be used for anonymous fields. - if p.tok == '?' { - p.next() - } else { - name = p.parseDotIdent() - } - return -} - -// getPkg returns the package for a given id. If the package is -// not found, create the package and add it to the p.localPkgs -// and p.sharedPkgs maps. name is the (expected) name of the -// package. If name == "", the package name is expected to be -// set later via an import clause in the export data. -// -// id identifies a package, usually by a canonical package path like -// "encoding/json" but possibly by a non-canonical import path like -// "./json". -// -func (p *parser) getPkg(id, name string) *types.Package { - // package unsafe is not in the packages maps - handle explicitly - if id == "unsafe" { - return types.Unsafe - } - - pkg := p.localPkgs[id] - if pkg == nil { - // first import of id from this package - pkg = p.sharedPkgs[id] - if pkg == nil { - // first import of id by this importer; - // add (possibly unnamed) pkg to shared packages - pkg = types.NewPackage(id, name) - p.sharedPkgs[id] = pkg - } - // add (possibly unnamed) pkg to local packages - if p.localPkgs == nil { - p.localPkgs = make(map[string]*types.Package) - } - p.localPkgs[id] = pkg - } else if name != "" { - // package exists already and we have an expected package name; - // make sure names match or set package name if necessary - if pname := pkg.Name(); pname == "" { - pkg.SetName(name) - } else if pname != name { - p.errorf("%s package name mismatch: %s (given) vs %s (expected)", id, pname, name) - } - } - return pkg -} - -// parseExportedName is like parseQualifiedName, but -// the package id is resolved to an imported *types.Package. -// -func (p *parser) parseExportedName() (pkg *types.Package, name string) { - id, name := p.parseQualifiedName() - pkg = p.getPkg(id, "") - return -} - -// ---------------------------------------------------------------------------- -// Types - -// BasicType = identifier . -// -func (p *parser) parseBasicType() types.Type { - id := p.expect(scanner.Ident) - obj := types.Universe.Lookup(id) - if obj, ok := obj.(*types.TypeName); ok { - return obj.Type() - } - p.errorf("not a basic type: %s", id) - return nil -} - -// ArrayType = "[" int_lit "]" Type . -// -func (p *parser) parseArrayType(parent *types.Package) types.Type { - // "[" already consumed and lookahead known not to be "]" - lit := p.expect(scanner.Int) - p.expect(']') - elem := p.parseType(parent) - n, err := strconv.ParseInt(lit, 10, 64) - if err != nil { - p.error(err) - } - return types.NewArray(elem, n) -} - -// MapType = "map" "[" Type "]" Type . -// -func (p *parser) parseMapType(parent *types.Package) types.Type { - p.expectKeyword("map") - p.expect('[') - key := p.parseType(parent) - p.expect(']') - elem := p.parseType(parent) - return types.NewMap(key, elem) -} - -// Name = identifier | "?" | QualifiedName . -// -// For unqualified and anonymous names, the returned package is the parent -// package unless parent == nil, in which case the returned package is the -// package being imported. (The parent package is not nil if the the name -// is an unqualified struct field or interface method name belonging to a -// type declared in another package.) -// -// For qualified names, the returned package is nil (and not created if -// it doesn't exist yet) unless materializePkg is set (which creates an -// unnamed package with valid package path). In the latter case, a -// subsequent import clause is expected to provide a name for the package. -// -func (p *parser) parseName(parent *types.Package, materializePkg bool) (pkg *types.Package, name string) { - pkg = parent - if pkg == nil { - pkg = p.sharedPkgs[p.id] - } - switch p.tok { - case scanner.Ident: - name = p.lit - p.next() - case '?': - // anonymous - p.next() - case '@': - // exported name prefixed with package path - pkg = nil - var id string - id, name = p.parseQualifiedName() - if materializePkg { - pkg = p.getPkg(id, "") - } - default: - p.error("name expected") - } - return -} - -func deref(typ types.Type) types.Type { - if p, _ := typ.(*types.Pointer); p != nil { - return p.Elem() - } - return typ -} - -// Field = Name Type [ string_lit ] . -// -func (p *parser) parseField(parent *types.Package) (*types.Var, string) { - pkg, name := p.parseName(parent, true) - - if name == "_" { - // Blank fields should be package-qualified because they - // are unexported identifiers, but gc does not qualify them. - // Assuming that the ident belongs to the current package - // causes types to change during re-exporting, leading - // to spurious "can't assign A to B" errors from go/types. - // As a workaround, pretend all blank fields belong - // to the same unique dummy package. - const blankpkg = "<_>" - pkg = p.getPkg(blankpkg, blankpkg) - } - - typ := p.parseType(parent) - anonymous := false - if name == "" { - // anonymous field - typ must be T or *T and T must be a type name - switch typ := deref(typ).(type) { - case *types.Basic: // basic types are named types - pkg = nil // objects defined in Universe scope have no package - name = typ.Name() - case *types.Named: - name = typ.Obj().Name() - default: - p.errorf("anonymous field expected") - } - anonymous = true - } - tag := "" - if p.tok == scanner.String { - s := p.expect(scanner.String) - var err error - tag, err = strconv.Unquote(s) - if err != nil { - p.errorf("invalid struct tag %s: %s", s, err) - } - } - return types.NewField(token.NoPos, pkg, name, typ, anonymous), tag -} - -// StructType = "struct" "{" [ FieldList ] "}" . -// FieldList = Field { ";" Field } . -// -func (p *parser) parseStructType(parent *types.Package) types.Type { - var fields []*types.Var - var tags []string - - p.expectKeyword("struct") - p.expect('{') - for i := 0; p.tok != '}' && p.tok != scanner.EOF; i++ { - if i > 0 { - p.expect(';') - } - fld, tag := p.parseField(parent) - if tag != "" && tags == nil { - tags = make([]string, i) - } - if tags != nil { - tags = append(tags, tag) - } - fields = append(fields, fld) - } - p.expect('}') - - return types.NewStruct(fields, tags) -} - -// Parameter = ( identifier | "?" ) [ "..." ] Type [ string_lit ] . -// -func (p *parser) parseParameter() (par *types.Var, isVariadic bool) { - _, name := p.parseName(nil, false) - // remove gc-specific parameter numbering - if i := strings.Index(name, "·"); i >= 0 { - name = name[:i] - } - if p.tok == '.' { - p.expectSpecial("...") - isVariadic = true - } - typ := p.parseType(nil) - if isVariadic { - typ = types.NewSlice(typ) - } - // ignore argument tag (e.g. "noescape") - if p.tok == scanner.String { - p.next() - } - // TODO(gri) should we provide a package? - par = types.NewVar(token.NoPos, nil, name, typ) - return -} - -// Parameters = "(" [ ParameterList ] ")" . -// ParameterList = { Parameter "," } Parameter . -// -func (p *parser) parseParameters() (list []*types.Var, isVariadic bool) { - p.expect('(') - for p.tok != ')' && p.tok != scanner.EOF { - if len(list) > 0 { - p.expect(',') - } - par, variadic := p.parseParameter() - list = append(list, par) - if variadic { - if isVariadic { - p.error("... not on final argument") - } - isVariadic = true - } - } - p.expect(')') - - return -} - -// Signature = Parameters [ Result ] . -// Result = Type | Parameters . -// -func (p *parser) parseSignature(recv *types.Var) *types.Signature { - params, isVariadic := p.parseParameters() - - // optional result type - var results []*types.Var - if p.tok == '(' { - var variadic bool - results, variadic = p.parseParameters() - if variadic { - p.error("... not permitted on result type") - } - } - - return types.NewSignature(recv, types.NewTuple(params...), types.NewTuple(results...), isVariadic) -} - -// InterfaceType = "interface" "{" [ MethodList ] "}" . -// MethodList = Method { ";" Method } . -// Method = Name Signature . -// -// The methods of embedded interfaces are always "inlined" -// by the compiler and thus embedded interfaces are never -// visible in the export data. -// -func (p *parser) parseInterfaceType(parent *types.Package) types.Type { - var methods []*types.Func - - p.expectKeyword("interface") - p.expect('{') - for i := 0; p.tok != '}' && p.tok != scanner.EOF; i++ { - if i > 0 { - p.expect(';') - } - pkg, name := p.parseName(parent, true) - sig := p.parseSignature(nil) - methods = append(methods, types.NewFunc(token.NoPos, pkg, name, sig)) - } - p.expect('}') - - // Complete requires the type's embedded interfaces to be fully defined, - // but we do not define any - return newInterface(methods, nil).Complete() -} - -// ChanType = ( "chan" [ "<-" ] | "<-" "chan" ) Type . -// -func (p *parser) parseChanType(parent *types.Package) types.Type { - dir := types.SendRecv - if p.tok == scanner.Ident { - p.expectKeyword("chan") - if p.tok == '<' { - p.expectSpecial("<-") - dir = types.SendOnly - } - } else { - p.expectSpecial("<-") - p.expectKeyword("chan") - dir = types.RecvOnly - } - elem := p.parseType(parent) - return types.NewChan(dir, elem) -} - -// Type = -// BasicType | TypeName | ArrayType | SliceType | StructType | -// PointerType | FuncType | InterfaceType | MapType | ChanType | -// "(" Type ")" . -// -// BasicType = ident . -// TypeName = ExportedName . -// SliceType = "[" "]" Type . -// PointerType = "*" Type . -// FuncType = "func" Signature . -// -func (p *parser) parseType(parent *types.Package) types.Type { - switch p.tok { - case scanner.Ident: - switch p.lit { - default: - return p.parseBasicType() - case "struct": - return p.parseStructType(parent) - case "func": - // FuncType - p.next() - return p.parseSignature(nil) - case "interface": - return p.parseInterfaceType(parent) - case "map": - return p.parseMapType(parent) - case "chan": - return p.parseChanType(parent) - } - case '@': - // TypeName - pkg, name := p.parseExportedName() - return declTypeName(pkg, name).Type() - case '[': - p.next() // look ahead - if p.tok == ']' { - // SliceType - p.next() - return types.NewSlice(p.parseType(parent)) - } - return p.parseArrayType(parent) - case '*': - // PointerType - p.next() - return types.NewPointer(p.parseType(parent)) - case '<': - return p.parseChanType(parent) - case '(': - // "(" Type ")" - p.next() - typ := p.parseType(parent) - p.expect(')') - return typ - } - p.errorf("expected type, got %s (%q)", scanner.TokenString(p.tok), p.lit) - return nil -} - -// ---------------------------------------------------------------------------- -// Declarations - -// ImportDecl = "import" PackageName PackageId . -// -func (p *parser) parseImportDecl() { - p.expectKeyword("import") - name := p.parsePackageName() - p.getPkg(p.parsePackageID(), name) -} - -// int_lit = [ "+" | "-" ] { "0" ... "9" } . -// -func (p *parser) parseInt() string { - s := "" - switch p.tok { - case '-': - s = "-" - p.next() - case '+': - p.next() - } - return s + p.expect(scanner.Int) -} - -// number = int_lit [ "p" int_lit ] . -// -func (p *parser) parseNumber() (typ *types.Basic, val constant.Value) { - // mantissa - mant := constant.MakeFromLiteral(p.parseInt(), token.INT, 0) - if mant == nil { - panic("invalid mantissa") - } - - if p.lit == "p" { - // exponent (base 2) - p.next() - exp, err := strconv.ParseInt(p.parseInt(), 10, 0) - if err != nil { - p.error(err) - } - if exp < 0 { - denom := constant.MakeInt64(1) - denom = constant.Shift(denom, token.SHL, uint(-exp)) - typ = types.Typ[types.UntypedFloat] - val = constant.BinaryOp(mant, token.QUO, denom) - return - } - if exp > 0 { - mant = constant.Shift(mant, token.SHL, uint(exp)) - } - typ = types.Typ[types.UntypedFloat] - val = mant - return - } - - typ = types.Typ[types.UntypedInt] - val = mant - return -} - -// ConstDecl = "const" ExportedName [ Type ] "=" Literal . -// Literal = bool_lit | int_lit | float_lit | complex_lit | rune_lit | string_lit . -// bool_lit = "true" | "false" . -// complex_lit = "(" float_lit "+" float_lit "i" ")" . -// rune_lit = "(" int_lit "+" int_lit ")" . -// string_lit = `"` { unicode_char } `"` . -// -func (p *parser) parseConstDecl() { - p.expectKeyword("const") - pkg, name := p.parseExportedName() - - var typ0 types.Type - if p.tok != '=' { - // constant types are never structured - no need for parent type - typ0 = p.parseType(nil) - } - - p.expect('=') - var typ types.Type - var val constant.Value - switch p.tok { - case scanner.Ident: - // bool_lit - if p.lit != "true" && p.lit != "false" { - p.error("expected true or false") - } - typ = types.Typ[types.UntypedBool] - val = constant.MakeBool(p.lit == "true") - p.next() - - case '-', scanner.Int: - // int_lit - typ, val = p.parseNumber() - - case '(': - // complex_lit or rune_lit - p.next() - if p.tok == scanner.Char { - p.next() - p.expect('+') - typ = types.Typ[types.UntypedRune] - _, val = p.parseNumber() - p.expect(')') - break - } - _, re := p.parseNumber() - p.expect('+') - _, im := p.parseNumber() - p.expectKeyword("i") - p.expect(')') - typ = types.Typ[types.UntypedComplex] - val = constant.BinaryOp(re, token.ADD, constant.MakeImag(im)) - - case scanner.Char: - // rune_lit - typ = types.Typ[types.UntypedRune] - val = constant.MakeFromLiteral(p.lit, token.CHAR, 0) - p.next() - - case scanner.String: - // string_lit - typ = types.Typ[types.UntypedString] - val = constant.MakeFromLiteral(p.lit, token.STRING, 0) - p.next() - - default: - p.errorf("expected literal got %s", scanner.TokenString(p.tok)) - } - - if typ0 == nil { - typ0 = typ - } - - pkg.Scope().Insert(types.NewConst(token.NoPos, pkg, name, typ0, val)) -} - -// TypeDecl = "type" ExportedName Type . -// -func (p *parser) parseTypeDecl() { - p.expectKeyword("type") - pkg, name := p.parseExportedName() - obj := declTypeName(pkg, name) - - // The type object may have been imported before and thus already - // have a type associated with it. We still need to parse the type - // structure, but throw it away if the object already has a type. - // This ensures that all imports refer to the same type object for - // a given type declaration. - typ := p.parseType(pkg) - - if name := obj.Type().(*types.Named); name.Underlying() == nil { - name.SetUnderlying(typ) - } -} - -// VarDecl = "var" ExportedName Type . -// -func (p *parser) parseVarDecl() { - p.expectKeyword("var") - pkg, name := p.parseExportedName() - typ := p.parseType(pkg) - pkg.Scope().Insert(types.NewVar(token.NoPos, pkg, name, typ)) -} - -// Func = Signature [ Body ] . -// Body = "{" ... "}" . -// -func (p *parser) parseFunc(recv *types.Var) *types.Signature { - sig := p.parseSignature(recv) - if p.tok == '{' { - p.next() - for i := 1; i > 0; p.next() { - switch p.tok { - case '{': - i++ - case '}': - i-- - } - } - } - return sig -} - -// MethodDecl = "func" Receiver Name Func . -// Receiver = "(" ( identifier | "?" ) [ "*" ] ExportedName ")" . -// -func (p *parser) parseMethodDecl() { - // "func" already consumed - p.expect('(') - recv, _ := p.parseParameter() // receiver - p.expect(')') - - // determine receiver base type object - base := deref(recv.Type()).(*types.Named) - - // parse method name, signature, and possibly inlined body - _, name := p.parseName(nil, false) - sig := p.parseFunc(recv) - - // methods always belong to the same package as the base type object - pkg := base.Obj().Pkg() - - // add method to type unless type was imported before - // and method exists already - // TODO(gri) This leads to a quadratic algorithm - ok for now because method counts are small. - base.AddMethod(types.NewFunc(token.NoPos, pkg, name, sig)) -} - -// FuncDecl = "func" ExportedName Func . -// -func (p *parser) parseFuncDecl() { - // "func" already consumed - pkg, name := p.parseExportedName() - typ := p.parseFunc(nil) - pkg.Scope().Insert(types.NewFunc(token.NoPos, pkg, name, typ)) -} - -// Decl = [ ImportDecl | ConstDecl | TypeDecl | VarDecl | FuncDecl | MethodDecl ] "\n" . -// -func (p *parser) parseDecl() { - if p.tok == scanner.Ident { - switch p.lit { - case "import": - p.parseImportDecl() - case "const": - p.parseConstDecl() - case "type": - p.parseTypeDecl() - case "var": - p.parseVarDecl() - case "func": - p.next() // look ahead - if p.tok == '(' { - p.parseMethodDecl() - } else { - p.parseFuncDecl() - } - } - } - p.expect('\n') -} - -// ---------------------------------------------------------------------------- -// Export - -// Export = "PackageClause { Decl } "$$" . -// PackageClause = "package" PackageName [ "safe" ] "\n" . -// -func (p *parser) parseExport() *types.Package { - p.expectKeyword("package") - name := p.parsePackageName() - if p.tok == scanner.Ident && p.lit == "safe" { - // package was compiled with -u option - ignore - p.next() - } - p.expect('\n') - - pkg := p.getPkg(p.id, name) - - for p.tok != '$' && p.tok != scanner.EOF { - p.parseDecl() - } - - if ch := p.scanner.Peek(); p.tok != '$' || ch != '$' { - // don't call next()/expect() since reading past the - // export data may cause scanner errors (e.g. NUL chars) - p.errorf("expected '$$', got %s %c", scanner.TokenString(p.tok), ch) - } - - if n := p.scanner.ErrorCount; n != 0 { - p.errorf("expected no scanner errors, got %d", n) - } - - // Record all locally referenced packages as imports. - var imports []*types.Package - for id, pkg2 := range p.localPkgs { - if pkg2.Name() == "" { - p.errorf("%s package has no name", id) - } - if id == p.id { - continue // avoid self-edge - } - imports = append(imports, pkg2) - } - sort.Sort(byPath(imports)) - pkg.SetImports(imports) - - // package was imported completely and without errors - pkg.MarkComplete() - - return pkg -} - -type byPath []*types.Package - -func (a byPath) Len() int { return len(a) } -func (a byPath) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a byPath) Less(i, j int) bool { return a[i].Path() < a[j].Path() } diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/iexport.go b/vendor/golang.org/x/tools/go/internal/gcimporter/iexport.go deleted file mode 100644 index 4be32a2e55..0000000000 --- a/vendor/golang.org/x/tools/go/internal/gcimporter/iexport.go +++ /dev/null @@ -1,739 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Indexed binary package export. -// This file was derived from $GOROOT/src/cmd/compile/internal/gc/iexport.go; -// see that file for specification of the format. - -package gcimporter - -import ( - "bytes" - "encoding/binary" - "go/ast" - "go/constant" - "go/token" - "go/types" - "io" - "math/big" - "reflect" - "sort" -) - -// Current indexed export format version. Increase with each format change. -// 0: Go1.11 encoding -const iexportVersion = 0 - -// IExportData returns the binary export data for pkg. -// -// If no file set is provided, position info will be missing. -// The package path of the top-level package will not be recorded, -// so that calls to IImportData can override with a provided package path. -func IExportData(fset *token.FileSet, pkg *types.Package) (b []byte, err error) { - defer func() { - if e := recover(); e != nil { - if ierr, ok := e.(internalError); ok { - err = ierr - return - } - // Not an internal error; panic again. - panic(e) - } - }() - - p := iexporter{ - out: bytes.NewBuffer(nil), - fset: fset, - allPkgs: map[*types.Package]bool{}, - stringIndex: map[string]uint64{}, - declIndex: map[types.Object]uint64{}, - typIndex: map[types.Type]uint64{}, - localpkg: pkg, - } - - for i, pt := range predeclared() { - p.typIndex[pt] = uint64(i) - } - if len(p.typIndex) > predeclReserved { - panic(internalErrorf("too many predeclared types: %d > %d", len(p.typIndex), predeclReserved)) - } - - // Initialize work queue with exported declarations. - scope := pkg.Scope() - for _, name := range scope.Names() { - if ast.IsExported(name) { - p.pushDecl(scope.Lookup(name)) - } - } - - // Loop until no more work. - for !p.declTodo.empty() { - p.doDecl(p.declTodo.popHead()) - } - - // Append indices to data0 section. - dataLen := uint64(p.data0.Len()) - w := p.newWriter() - w.writeIndex(p.declIndex) - w.flush() - - // Assemble header. - var hdr intWriter - hdr.WriteByte('i') - hdr.uint64(iexportVersion) - hdr.uint64(uint64(p.strings.Len())) - hdr.uint64(dataLen) - - // Flush output. - io.Copy(p.out, &hdr) - io.Copy(p.out, &p.strings) - io.Copy(p.out, &p.data0) - - return p.out.Bytes(), nil -} - -// writeIndex writes out an object index. mainIndex indicates whether -// we're writing out the main index, which is also read by -// non-compiler tools and includes a complete package description -// (i.e., name and height). -func (w *exportWriter) writeIndex(index map[types.Object]uint64) { - // Build a map from packages to objects from that package. - pkgObjs := map[*types.Package][]types.Object{} - - // For the main index, make sure to include every package that - // we reference, even if we're not exporting (or reexporting) - // any symbols from it. - pkgObjs[w.p.localpkg] = nil - for pkg := range w.p.allPkgs { - pkgObjs[pkg] = nil - } - - for obj := range index { - pkgObjs[obj.Pkg()] = append(pkgObjs[obj.Pkg()], obj) - } - - var pkgs []*types.Package - for pkg, objs := range pkgObjs { - pkgs = append(pkgs, pkg) - - sort.Slice(objs, func(i, j int) bool { - return objs[i].Name() < objs[j].Name() - }) - } - - sort.Slice(pkgs, func(i, j int) bool { - return w.exportPath(pkgs[i]) < w.exportPath(pkgs[j]) - }) - - w.uint64(uint64(len(pkgs))) - for _, pkg := range pkgs { - w.string(w.exportPath(pkg)) - w.string(pkg.Name()) - w.uint64(uint64(0)) // package height is not needed for go/types - - objs := pkgObjs[pkg] - w.uint64(uint64(len(objs))) - for _, obj := range objs { - w.string(obj.Name()) - w.uint64(index[obj]) - } - } -} - -type iexporter struct { - fset *token.FileSet - out *bytes.Buffer - - localpkg *types.Package - - // allPkgs tracks all packages that have been referenced by - // the export data, so we can ensure to include them in the - // main index. - allPkgs map[*types.Package]bool - - declTodo objQueue - - strings intWriter - stringIndex map[string]uint64 - - data0 intWriter - declIndex map[types.Object]uint64 - typIndex map[types.Type]uint64 -} - -// stringOff returns the offset of s within the string section. -// If not already present, it's added to the end. -func (p *iexporter) stringOff(s string) uint64 { - off, ok := p.stringIndex[s] - if !ok { - off = uint64(p.strings.Len()) - p.stringIndex[s] = off - - p.strings.uint64(uint64(len(s))) - p.strings.WriteString(s) - } - return off -} - -// pushDecl adds n to the declaration work queue, if not already present. -func (p *iexporter) pushDecl(obj types.Object) { - // Package unsafe is known to the compiler and predeclared. - assert(obj.Pkg() != types.Unsafe) - - if _, ok := p.declIndex[obj]; ok { - return - } - - p.declIndex[obj] = ^uint64(0) // mark n present in work queue - p.declTodo.pushTail(obj) -} - -// exportWriter handles writing out individual data section chunks. -type exportWriter struct { - p *iexporter - - data intWriter - currPkg *types.Package - prevFile string - prevLine int64 -} - -func (w *exportWriter) exportPath(pkg *types.Package) string { - if pkg == w.p.localpkg { - return "" - } - return pkg.Path() -} - -func (p *iexporter) doDecl(obj types.Object) { - w := p.newWriter() - w.setPkg(obj.Pkg(), false) - - switch obj := obj.(type) { - case *types.Var: - w.tag('V') - w.pos(obj.Pos()) - w.typ(obj.Type(), obj.Pkg()) - - case *types.Func: - sig, _ := obj.Type().(*types.Signature) - if sig.Recv() != nil { - panic(internalErrorf("unexpected method: %v", sig)) - } - w.tag('F') - w.pos(obj.Pos()) - w.signature(sig) - - case *types.Const: - w.tag('C') - w.pos(obj.Pos()) - w.value(obj.Type(), obj.Val()) - - case *types.TypeName: - if obj.IsAlias() { - w.tag('A') - w.pos(obj.Pos()) - w.typ(obj.Type(), obj.Pkg()) - break - } - - // Defined type. - w.tag('T') - w.pos(obj.Pos()) - - underlying := obj.Type().Underlying() - w.typ(underlying, obj.Pkg()) - - t := obj.Type() - if types.IsInterface(t) { - break - } - - named, ok := t.(*types.Named) - if !ok { - panic(internalErrorf("%s is not a defined type", t)) - } - - n := named.NumMethods() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - m := named.Method(i) - w.pos(m.Pos()) - w.string(m.Name()) - sig, _ := m.Type().(*types.Signature) - w.param(sig.Recv()) - w.signature(sig) - } - - default: - panic(internalErrorf("unexpected object: %v", obj)) - } - - p.declIndex[obj] = w.flush() -} - -func (w *exportWriter) tag(tag byte) { - w.data.WriteByte(tag) -} - -func (w *exportWriter) pos(pos token.Pos) { - if w.p.fset == nil { - w.int64(0) - return - } - - p := w.p.fset.Position(pos) - file := p.Filename - line := int64(p.Line) - - // When file is the same as the last position (common case), - // we can save a few bytes by delta encoding just the line - // number. - // - // Note: Because data objects may be read out of order (or not - // at all), we can only apply delta encoding within a single - // object. This is handled implicitly by tracking prevFile and - // prevLine as fields of exportWriter. - - if file == w.prevFile { - delta := line - w.prevLine - w.int64(delta) - if delta == deltaNewFile { - w.int64(-1) - } - } else { - w.int64(deltaNewFile) - w.int64(line) // line >= 0 - w.string(file) - w.prevFile = file - } - w.prevLine = line -} - -func (w *exportWriter) pkg(pkg *types.Package) { - // Ensure any referenced packages are declared in the main index. - w.p.allPkgs[pkg] = true - - w.string(w.exportPath(pkg)) -} - -func (w *exportWriter) qualifiedIdent(obj types.Object) { - // Ensure any referenced declarations are written out too. - w.p.pushDecl(obj) - - w.string(obj.Name()) - w.pkg(obj.Pkg()) -} - -func (w *exportWriter) typ(t types.Type, pkg *types.Package) { - w.data.uint64(w.p.typOff(t, pkg)) -} - -func (p *iexporter) newWriter() *exportWriter { - return &exportWriter{p: p} -} - -func (w *exportWriter) flush() uint64 { - off := uint64(w.p.data0.Len()) - io.Copy(&w.p.data0, &w.data) - return off -} - -func (p *iexporter) typOff(t types.Type, pkg *types.Package) uint64 { - off, ok := p.typIndex[t] - if !ok { - w := p.newWriter() - w.doTyp(t, pkg) - off = predeclReserved + w.flush() - p.typIndex[t] = off - } - return off -} - -func (w *exportWriter) startType(k itag) { - w.data.uint64(uint64(k)) -} - -func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) { - switch t := t.(type) { - case *types.Named: - w.startType(definedType) - w.qualifiedIdent(t.Obj()) - - case *types.Pointer: - w.startType(pointerType) - w.typ(t.Elem(), pkg) - - case *types.Slice: - w.startType(sliceType) - w.typ(t.Elem(), pkg) - - case *types.Array: - w.startType(arrayType) - w.uint64(uint64(t.Len())) - w.typ(t.Elem(), pkg) - - case *types.Chan: - w.startType(chanType) - // 1 RecvOnly; 2 SendOnly; 3 SendRecv - var dir uint64 - switch t.Dir() { - case types.RecvOnly: - dir = 1 - case types.SendOnly: - dir = 2 - case types.SendRecv: - dir = 3 - } - w.uint64(dir) - w.typ(t.Elem(), pkg) - - case *types.Map: - w.startType(mapType) - w.typ(t.Key(), pkg) - w.typ(t.Elem(), pkg) - - case *types.Signature: - w.startType(signatureType) - w.setPkg(pkg, true) - w.signature(t) - - case *types.Struct: - w.startType(structType) - w.setPkg(pkg, true) - - n := t.NumFields() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - f := t.Field(i) - w.pos(f.Pos()) - w.string(f.Name()) - w.typ(f.Type(), pkg) - w.bool(f.Anonymous()) - w.string(t.Tag(i)) // note (or tag) - } - - case *types.Interface: - w.startType(interfaceType) - w.setPkg(pkg, true) - - n := t.NumEmbeddeds() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - f := t.Embedded(i) - w.pos(f.Obj().Pos()) - w.typ(f.Obj().Type(), f.Obj().Pkg()) - } - - n = t.NumExplicitMethods() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - m := t.ExplicitMethod(i) - w.pos(m.Pos()) - w.string(m.Name()) - sig, _ := m.Type().(*types.Signature) - w.signature(sig) - } - - default: - panic(internalErrorf("unexpected type: %v, %v", t, reflect.TypeOf(t))) - } -} - -func (w *exportWriter) setPkg(pkg *types.Package, write bool) { - if write { - w.pkg(pkg) - } - - w.currPkg = pkg -} - -func (w *exportWriter) signature(sig *types.Signature) { - w.paramList(sig.Params()) - w.paramList(sig.Results()) - if sig.Params().Len() > 0 { - w.bool(sig.Variadic()) - } -} - -func (w *exportWriter) paramList(tup *types.Tuple) { - n := tup.Len() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - w.param(tup.At(i)) - } -} - -func (w *exportWriter) param(obj types.Object) { - w.pos(obj.Pos()) - w.localIdent(obj) - w.typ(obj.Type(), obj.Pkg()) -} - -func (w *exportWriter) value(typ types.Type, v constant.Value) { - w.typ(typ, nil) - - switch v.Kind() { - case constant.Bool: - w.bool(constant.BoolVal(v)) - case constant.Int: - var i big.Int - if i64, exact := constant.Int64Val(v); exact { - i.SetInt64(i64) - } else if ui64, exact := constant.Uint64Val(v); exact { - i.SetUint64(ui64) - } else { - i.SetString(v.ExactString(), 10) - } - w.mpint(&i, typ) - case constant.Float: - f := constantToFloat(v) - w.mpfloat(f, typ) - case constant.Complex: - w.mpfloat(constantToFloat(constant.Real(v)), typ) - w.mpfloat(constantToFloat(constant.Imag(v)), typ) - case constant.String: - w.string(constant.StringVal(v)) - case constant.Unknown: - // package contains type errors - default: - panic(internalErrorf("unexpected value %v (%T)", v, v)) - } -} - -// constantToFloat converts a constant.Value with kind constant.Float to a -// big.Float. -func constantToFloat(x constant.Value) *big.Float { - assert(x.Kind() == constant.Float) - // Use the same floating-point precision (512) as cmd/compile - // (see Mpprec in cmd/compile/internal/gc/mpfloat.go). - const mpprec = 512 - var f big.Float - f.SetPrec(mpprec) - if v, exact := constant.Float64Val(x); exact { - // float64 - f.SetFloat64(v) - } else if num, denom := constant.Num(x), constant.Denom(x); num.Kind() == constant.Int { - // TODO(gri): add big.Rat accessor to constant.Value. - n := valueToRat(num) - d := valueToRat(denom) - f.SetRat(n.Quo(n, d)) - } else { - // Value too large to represent as a fraction => inaccessible. - // TODO(gri): add big.Float accessor to constant.Value. - _, ok := f.SetString(x.ExactString()) - assert(ok) - } - return &f -} - -// mpint exports a multi-precision integer. -// -// For unsigned types, small values are written out as a single -// byte. Larger values are written out as a length-prefixed big-endian -// byte string, where the length prefix is encoded as its complement. -// For example, bytes 0, 1, and 2 directly represent the integer -// values 0, 1, and 2; while bytes 255, 254, and 253 indicate a 1-, -// 2-, and 3-byte big-endian string follow. -// -// Encoding for signed types use the same general approach as for -// unsigned types, except small values use zig-zag encoding and the -// bottom bit of length prefix byte for large values is reserved as a -// sign bit. -// -// The exact boundary between small and large encodings varies -// according to the maximum number of bytes needed to encode a value -// of type typ. As a special case, 8-bit types are always encoded as a -// single byte. -// -// TODO(mdempsky): Is this level of complexity really worthwhile? -func (w *exportWriter) mpint(x *big.Int, typ types.Type) { - basic, ok := typ.Underlying().(*types.Basic) - if !ok { - panic(internalErrorf("unexpected type %v (%T)", typ.Underlying(), typ.Underlying())) - } - - signed, maxBytes := intSize(basic) - - negative := x.Sign() < 0 - if !signed && negative { - panic(internalErrorf("negative unsigned integer; type %v, value %v", typ, x)) - } - - b := x.Bytes() - if len(b) > 0 && b[0] == 0 { - panic(internalErrorf("leading zeros")) - } - if uint(len(b)) > maxBytes { - panic(internalErrorf("bad mpint length: %d > %d (type %v, value %v)", len(b), maxBytes, typ, x)) - } - - maxSmall := 256 - maxBytes - if signed { - maxSmall = 256 - 2*maxBytes - } - if maxBytes == 1 { - maxSmall = 256 - } - - // Check if x can use small value encoding. - if len(b) <= 1 { - var ux uint - if len(b) == 1 { - ux = uint(b[0]) - } - if signed { - ux <<= 1 - if negative { - ux-- - } - } - if ux < maxSmall { - w.data.WriteByte(byte(ux)) - return - } - } - - n := 256 - uint(len(b)) - if signed { - n = 256 - 2*uint(len(b)) - if negative { - n |= 1 - } - } - if n < maxSmall || n >= 256 { - panic(internalErrorf("encoding mistake: %d, %v, %v => %d", len(b), signed, negative, n)) - } - - w.data.WriteByte(byte(n)) - w.data.Write(b) -} - -// mpfloat exports a multi-precision floating point number. -// -// The number's value is decomposed into mantissa × 2**exponent, where -// mantissa is an integer. The value is written out as mantissa (as a -// multi-precision integer) and then the exponent, except exponent is -// omitted if mantissa is zero. -func (w *exportWriter) mpfloat(f *big.Float, typ types.Type) { - if f.IsInf() { - panic("infinite constant") - } - - // Break into f = mant × 2**exp, with 0.5 <= mant < 1. - var mant big.Float - exp := int64(f.MantExp(&mant)) - - // Scale so that mant is an integer. - prec := mant.MinPrec() - mant.SetMantExp(&mant, int(prec)) - exp -= int64(prec) - - manti, acc := mant.Int(nil) - if acc != big.Exact { - panic(internalErrorf("mantissa scaling failed for %f (%s)", f, acc)) - } - w.mpint(manti, typ) - if manti.Sign() != 0 { - w.int64(exp) - } -} - -func (w *exportWriter) bool(b bool) bool { - var x uint64 - if b { - x = 1 - } - w.uint64(x) - return b -} - -func (w *exportWriter) int64(x int64) { w.data.int64(x) } -func (w *exportWriter) uint64(x uint64) { w.data.uint64(x) } -func (w *exportWriter) string(s string) { w.uint64(w.p.stringOff(s)) } - -func (w *exportWriter) localIdent(obj types.Object) { - // Anonymous parameters. - if obj == nil { - w.string("") - return - } - - name := obj.Name() - if name == "_" { - w.string("_") - return - } - - w.string(name) -} - -type intWriter struct { - bytes.Buffer -} - -func (w *intWriter) int64(x int64) { - var buf [binary.MaxVarintLen64]byte - n := binary.PutVarint(buf[:], x) - w.Write(buf[:n]) -} - -func (w *intWriter) uint64(x uint64) { - var buf [binary.MaxVarintLen64]byte - n := binary.PutUvarint(buf[:], x) - w.Write(buf[:n]) -} - -func assert(cond bool) { - if !cond { - panic("internal error: assertion failed") - } -} - -// The below is copied from go/src/cmd/compile/internal/gc/syntax.go. - -// objQueue is a FIFO queue of types.Object. The zero value of objQueue is -// a ready-to-use empty queue. -type objQueue struct { - ring []types.Object - head, tail int -} - -// empty returns true if q contains no Nodes. -func (q *objQueue) empty() bool { - return q.head == q.tail -} - -// pushTail appends n to the tail of the queue. -func (q *objQueue) pushTail(obj types.Object) { - if len(q.ring) == 0 { - q.ring = make([]types.Object, 16) - } else if q.head+len(q.ring) == q.tail { - // Grow the ring. - nring := make([]types.Object, len(q.ring)*2) - // Copy the old elements. - part := q.ring[q.head%len(q.ring):] - if q.tail-q.head <= len(part) { - part = part[:q.tail-q.head] - copy(nring, part) - } else { - pos := copy(nring, part) - copy(nring[pos:], q.ring[:q.tail%len(q.ring)]) - } - q.ring, q.head, q.tail = nring, 0, q.tail-q.head - } - - q.ring[q.tail%len(q.ring)] = obj - q.tail++ -} - -// popHead pops a node from the head of the queue. It panics if q is empty. -func (q *objQueue) popHead() types.Object { - if q.empty() { - panic("dequeue empty") - } - obj := q.ring[q.head%len(q.ring)] - q.head++ - return obj -} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go b/vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go deleted file mode 100644 index a31a880263..0000000000 --- a/vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go +++ /dev/null @@ -1,630 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Indexed package import. -// See cmd/compile/internal/gc/iexport.go for the export data format. - -// This file is a copy of $GOROOT/src/go/internal/gcimporter/iimport.go. - -package gcimporter - -import ( - "bytes" - "encoding/binary" - "fmt" - "go/constant" - "go/token" - "go/types" - "io" - "sort" -) - -type intReader struct { - *bytes.Reader - path string -} - -func (r *intReader) int64() int64 { - i, err := binary.ReadVarint(r.Reader) - if err != nil { - errorf("import %q: read varint error: %v", r.path, err) - } - return i -} - -func (r *intReader) uint64() uint64 { - i, err := binary.ReadUvarint(r.Reader) - if err != nil { - errorf("import %q: read varint error: %v", r.path, err) - } - return i -} - -const predeclReserved = 32 - -type itag uint64 - -const ( - // Types - definedType itag = iota - pointerType - sliceType - arrayType - chanType - mapType - signatureType - structType - interfaceType -) - -// IImportData imports a package from the serialized package data -// and returns the number of bytes consumed and a reference to the package. -// If the export data version is not recognized or the format is otherwise -// compromised, an error is returned. -func IImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) { - const currentVersion = 1 - version := int64(-1) - defer func() { - if e := recover(); e != nil { - if version > currentVersion { - err = fmt.Errorf("cannot import %q (%v), export data is newer version - update tool", path, e) - } else { - err = fmt.Errorf("cannot import %q (%v), possibly version skew - reinstall package", path, e) - } - } - }() - - r := &intReader{bytes.NewReader(data), path} - - version = int64(r.uint64()) - switch version { - case currentVersion, 0: - default: - errorf("unknown iexport format version %d", version) - } - - sLen := int64(r.uint64()) - dLen := int64(r.uint64()) - - whence, _ := r.Seek(0, io.SeekCurrent) - stringData := data[whence : whence+sLen] - declData := data[whence+sLen : whence+sLen+dLen] - r.Seek(sLen+dLen, io.SeekCurrent) - - p := iimporter{ - ipath: path, - version: int(version), - - stringData: stringData, - stringCache: make(map[uint64]string), - pkgCache: make(map[uint64]*types.Package), - - declData: declData, - pkgIndex: make(map[*types.Package]map[string]uint64), - typCache: make(map[uint64]types.Type), - - fake: fakeFileSet{ - fset: fset, - files: make(map[string]*token.File), - }, - } - - for i, pt := range predeclared() { - p.typCache[uint64(i)] = pt - } - - pkgList := make([]*types.Package, r.uint64()) - for i := range pkgList { - pkgPathOff := r.uint64() - pkgPath := p.stringAt(pkgPathOff) - pkgName := p.stringAt(r.uint64()) - _ = r.uint64() // package height; unused by go/types - - if pkgPath == "" { - pkgPath = path - } - pkg := imports[pkgPath] - if pkg == nil { - pkg = types.NewPackage(pkgPath, pkgName) - imports[pkgPath] = pkg - } else if pkg.Name() != pkgName { - errorf("conflicting names %s and %s for package %q", pkg.Name(), pkgName, path) - } - - p.pkgCache[pkgPathOff] = pkg - - nameIndex := make(map[string]uint64) - for nSyms := r.uint64(); nSyms > 0; nSyms-- { - name := p.stringAt(r.uint64()) - nameIndex[name] = r.uint64() - } - - p.pkgIndex[pkg] = nameIndex - pkgList[i] = pkg - } - if len(pkgList) == 0 { - errorf("no packages found for %s", path) - panic("unreachable") - } - p.ipkg = pkgList[0] - names := make([]string, 0, len(p.pkgIndex[p.ipkg])) - for name := range p.pkgIndex[p.ipkg] { - names = append(names, name) - } - sort.Strings(names) - for _, name := range names { - p.doDecl(p.ipkg, name) - } - - for _, typ := range p.interfaceList { - typ.Complete() - } - - // record all referenced packages as imports - list := append(([]*types.Package)(nil), pkgList[1:]...) - sort.Sort(byPath(list)) - p.ipkg.SetImports(list) - - // package was imported completely and without errors - p.ipkg.MarkComplete() - - consumed, _ := r.Seek(0, io.SeekCurrent) - return int(consumed), p.ipkg, nil -} - -type iimporter struct { - ipath string - ipkg *types.Package - version int - - stringData []byte - stringCache map[uint64]string - pkgCache map[uint64]*types.Package - - declData []byte - pkgIndex map[*types.Package]map[string]uint64 - typCache map[uint64]types.Type - - fake fakeFileSet - interfaceList []*types.Interface -} - -func (p *iimporter) doDecl(pkg *types.Package, name string) { - // See if we've already imported this declaration. - if obj := pkg.Scope().Lookup(name); obj != nil { - return - } - - off, ok := p.pkgIndex[pkg][name] - if !ok { - errorf("%v.%v not in index", pkg, name) - } - - r := &importReader{p: p, currPkg: pkg} - r.declReader.Reset(p.declData[off:]) - - r.obj(name) -} - -func (p *iimporter) stringAt(off uint64) string { - if s, ok := p.stringCache[off]; ok { - return s - } - - slen, n := binary.Uvarint(p.stringData[off:]) - if n <= 0 { - errorf("varint failed") - } - spos := off + uint64(n) - s := string(p.stringData[spos : spos+slen]) - p.stringCache[off] = s - return s -} - -func (p *iimporter) pkgAt(off uint64) *types.Package { - if pkg, ok := p.pkgCache[off]; ok { - return pkg - } - path := p.stringAt(off) - if path == p.ipath { - return p.ipkg - } - errorf("missing package %q in %q", path, p.ipath) - return nil -} - -func (p *iimporter) typAt(off uint64, base *types.Named) types.Type { - if t, ok := p.typCache[off]; ok && (base == nil || !isInterface(t)) { - return t - } - - if off < predeclReserved { - errorf("predeclared type missing from cache: %v", off) - } - - r := &importReader{p: p} - r.declReader.Reset(p.declData[off-predeclReserved:]) - t := r.doType(base) - - if base == nil || !isInterface(t) { - p.typCache[off] = t - } - return t -} - -type importReader struct { - p *iimporter - declReader bytes.Reader - currPkg *types.Package - prevFile string - prevLine int64 - prevColumn int64 -} - -func (r *importReader) obj(name string) { - tag := r.byte() - pos := r.pos() - - switch tag { - case 'A': - typ := r.typ() - - r.declare(types.NewTypeName(pos, r.currPkg, name, typ)) - - case 'C': - typ, val := r.value() - - r.declare(types.NewConst(pos, r.currPkg, name, typ, val)) - - case 'F': - sig := r.signature(nil) - - r.declare(types.NewFunc(pos, r.currPkg, name, sig)) - - case 'T': - // Types can be recursive. We need to setup a stub - // declaration before recursing. - obj := types.NewTypeName(pos, r.currPkg, name, nil) - named := types.NewNamed(obj, nil, nil) - r.declare(obj) - - underlying := r.p.typAt(r.uint64(), named).Underlying() - named.SetUnderlying(underlying) - - if !isInterface(underlying) { - for n := r.uint64(); n > 0; n-- { - mpos := r.pos() - mname := r.ident() - recv := r.param() - msig := r.signature(recv) - - named.AddMethod(types.NewFunc(mpos, r.currPkg, mname, msig)) - } - } - - case 'V': - typ := r.typ() - - r.declare(types.NewVar(pos, r.currPkg, name, typ)) - - default: - errorf("unexpected tag: %v", tag) - } -} - -func (r *importReader) declare(obj types.Object) { - obj.Pkg().Scope().Insert(obj) -} - -func (r *importReader) value() (typ types.Type, val constant.Value) { - typ = r.typ() - - switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType { - case types.IsBoolean: - val = constant.MakeBool(r.bool()) - - case types.IsString: - val = constant.MakeString(r.string()) - - case types.IsInteger: - val = r.mpint(b) - - case types.IsFloat: - val = r.mpfloat(b) - - case types.IsComplex: - re := r.mpfloat(b) - im := r.mpfloat(b) - val = constant.BinaryOp(re, token.ADD, constant.MakeImag(im)) - - default: - if b.Kind() == types.Invalid { - val = constant.MakeUnknown() - return - } - errorf("unexpected type %v", typ) // panics - panic("unreachable") - } - - return -} - -func intSize(b *types.Basic) (signed bool, maxBytes uint) { - if (b.Info() & types.IsUntyped) != 0 { - return true, 64 - } - - switch b.Kind() { - case types.Float32, types.Complex64: - return true, 3 - case types.Float64, types.Complex128: - return true, 7 - } - - signed = (b.Info() & types.IsUnsigned) == 0 - switch b.Kind() { - case types.Int8, types.Uint8: - maxBytes = 1 - case types.Int16, types.Uint16: - maxBytes = 2 - case types.Int32, types.Uint32: - maxBytes = 4 - default: - maxBytes = 8 - } - - return -} - -func (r *importReader) mpint(b *types.Basic) constant.Value { - signed, maxBytes := intSize(b) - - maxSmall := 256 - maxBytes - if signed { - maxSmall = 256 - 2*maxBytes - } - if maxBytes == 1 { - maxSmall = 256 - } - - n, _ := r.declReader.ReadByte() - if uint(n) < maxSmall { - v := int64(n) - if signed { - v >>= 1 - if n&1 != 0 { - v = ^v - } - } - return constant.MakeInt64(v) - } - - v := -n - if signed { - v = -(n &^ 1) >> 1 - } - if v < 1 || uint(v) > maxBytes { - errorf("weird decoding: %v, %v => %v", n, signed, v) - } - - buf := make([]byte, v) - io.ReadFull(&r.declReader, buf) - - // convert to little endian - // TODO(gri) go/constant should have a more direct conversion function - // (e.g., once it supports a big.Float based implementation) - for i, j := 0, len(buf)-1; i < j; i, j = i+1, j-1 { - buf[i], buf[j] = buf[j], buf[i] - } - - x := constant.MakeFromBytes(buf) - if signed && n&1 != 0 { - x = constant.UnaryOp(token.SUB, x, 0) - } - return x -} - -func (r *importReader) mpfloat(b *types.Basic) constant.Value { - x := r.mpint(b) - if constant.Sign(x) == 0 { - return x - } - - exp := r.int64() - switch { - case exp > 0: - x = constant.Shift(x, token.SHL, uint(exp)) - case exp < 0: - d := constant.Shift(constant.MakeInt64(1), token.SHL, uint(-exp)) - x = constant.BinaryOp(x, token.QUO, d) - } - return x -} - -func (r *importReader) ident() string { - return r.string() -} - -func (r *importReader) qualifiedIdent() (*types.Package, string) { - name := r.string() - pkg := r.pkg() - return pkg, name -} - -func (r *importReader) pos() token.Pos { - if r.p.version >= 1 { - r.posv1() - } else { - r.posv0() - } - - if r.prevFile == "" && r.prevLine == 0 && r.prevColumn == 0 { - return token.NoPos - } - return r.p.fake.pos(r.prevFile, int(r.prevLine), int(r.prevColumn)) -} - -func (r *importReader) posv0() { - delta := r.int64() - if delta != deltaNewFile { - r.prevLine += delta - } else if l := r.int64(); l == -1 { - r.prevLine += deltaNewFile - } else { - r.prevFile = r.string() - r.prevLine = l - } -} - -func (r *importReader) posv1() { - delta := r.int64() - r.prevColumn += delta >> 1 - if delta&1 != 0 { - delta = r.int64() - r.prevLine += delta >> 1 - if delta&1 != 0 { - r.prevFile = r.string() - } - } -} - -func (r *importReader) typ() types.Type { - return r.p.typAt(r.uint64(), nil) -} - -func isInterface(t types.Type) bool { - _, ok := t.(*types.Interface) - return ok -} - -func (r *importReader) pkg() *types.Package { return r.p.pkgAt(r.uint64()) } -func (r *importReader) string() string { return r.p.stringAt(r.uint64()) } - -func (r *importReader) doType(base *types.Named) types.Type { - switch k := r.kind(); k { - default: - errorf("unexpected kind tag in %q: %v", r.p.ipath, k) - return nil - - case definedType: - pkg, name := r.qualifiedIdent() - r.p.doDecl(pkg, name) - return pkg.Scope().Lookup(name).(*types.TypeName).Type() - case pointerType: - return types.NewPointer(r.typ()) - case sliceType: - return types.NewSlice(r.typ()) - case arrayType: - n := r.uint64() - return types.NewArray(r.typ(), int64(n)) - case chanType: - dir := chanDir(int(r.uint64())) - return types.NewChan(dir, r.typ()) - case mapType: - return types.NewMap(r.typ(), r.typ()) - case signatureType: - r.currPkg = r.pkg() - return r.signature(nil) - - case structType: - r.currPkg = r.pkg() - - fields := make([]*types.Var, r.uint64()) - tags := make([]string, len(fields)) - for i := range fields { - fpos := r.pos() - fname := r.ident() - ftyp := r.typ() - emb := r.bool() - tag := r.string() - - fields[i] = types.NewField(fpos, r.currPkg, fname, ftyp, emb) - tags[i] = tag - } - return types.NewStruct(fields, tags) - - case interfaceType: - r.currPkg = r.pkg() - - embeddeds := make([]types.Type, r.uint64()) - for i := range embeddeds { - _ = r.pos() - embeddeds[i] = r.typ() - } - - methods := make([]*types.Func, r.uint64()) - for i := range methods { - mpos := r.pos() - mname := r.ident() - - // TODO(mdempsky): Matches bimport.go, but I - // don't agree with this. - var recv *types.Var - if base != nil { - recv = types.NewVar(token.NoPos, r.currPkg, "", base) - } - - msig := r.signature(recv) - methods[i] = types.NewFunc(mpos, r.currPkg, mname, msig) - } - - typ := newInterface(methods, embeddeds) - r.p.interfaceList = append(r.p.interfaceList, typ) - return typ - } -} - -func (r *importReader) kind() itag { - return itag(r.uint64()) -} - -func (r *importReader) signature(recv *types.Var) *types.Signature { - params := r.paramList() - results := r.paramList() - variadic := params.Len() > 0 && r.bool() - return types.NewSignature(recv, params, results, variadic) -} - -func (r *importReader) paramList() *types.Tuple { - xs := make([]*types.Var, r.uint64()) - for i := range xs { - xs[i] = r.param() - } - return types.NewTuple(xs...) -} - -func (r *importReader) param() *types.Var { - pos := r.pos() - name := r.ident() - typ := r.typ() - return types.NewParam(pos, r.currPkg, name, typ) -} - -func (r *importReader) bool() bool { - return r.uint64() != 0 -} - -func (r *importReader) int64() int64 { - n, err := binary.ReadVarint(&r.declReader) - if err != nil { - errorf("readVarint: %v", err) - } - return n -} - -func (r *importReader) uint64() uint64 { - n, err := binary.ReadUvarint(&r.declReader) - if err != nil { - errorf("readUvarint: %v", err) - } - return n -} - -func (r *importReader) byte() byte { - x, err := r.declReader.ReadByte() - if err != nil { - errorf("declReader.ReadByte: %v", err) - } - return x -} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface10.go b/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface10.go deleted file mode 100644 index 463f252271..0000000000 --- a/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface10.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !go1.11 - -package gcimporter - -import "go/types" - -func newInterface(methods []*types.Func, embeddeds []types.Type) *types.Interface { - named := make([]*types.Named, len(embeddeds)) - for i, e := range embeddeds { - var ok bool - named[i], ok = e.(*types.Named) - if !ok { - panic("embedding of non-defined interfaces in interfaces is not supported before Go 1.11") - } - } - return types.NewInterface(methods, named) -} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface11.go b/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface11.go deleted file mode 100644 index ab28b95cbb..0000000000 --- a/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface11.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.11 - -package gcimporter - -import "go/types" - -func newInterface(methods []*types.Func, embeddeds []types.Type) *types.Interface { - return types.NewInterfaceType(methods, embeddeds) -} diff --git a/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go b/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go deleted file mode 100644 index dc6177c122..0000000000 --- a/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package packagesdriver fetches type sizes for go/packages and go/analysis. -package packagesdriver - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "go/types" - "os/exec" - "strings" - - "golang.org/x/tools/internal/gocommand" -) - -var debug = false - -func GetSizes(ctx context.Context, buildFlags, env []string, gocmdRunner *gocommand.Runner, dir string) (types.Sizes, error) { - // TODO(matloob): Clean this up. This code is mostly a copy of packages.findExternalDriver. - const toolPrefix = "GOPACKAGESDRIVER=" - tool := "" - for _, env := range env { - if val := strings.TrimPrefix(env, toolPrefix); val != env { - tool = val - } - } - - if tool == "" { - var err error - tool, err = exec.LookPath("gopackagesdriver") - if err != nil { - // We did not find the driver, so use "go list". - tool = "off" - } - } - - if tool == "off" { - return GetSizesGolist(ctx, buildFlags, env, gocmdRunner, dir) - } - - req, err := json.Marshal(struct { - Command string `json:"command"` - Env []string `json:"env"` - BuildFlags []string `json:"build_flags"` - }{ - Command: "sizes", - Env: env, - BuildFlags: buildFlags, - }) - if err != nil { - return nil, fmt.Errorf("failed to encode message to driver tool: %v", err) - } - - buf := new(bytes.Buffer) - cmd := exec.CommandContext(ctx, tool) - cmd.Dir = dir - cmd.Env = env - cmd.Stdin = bytes.NewReader(req) - cmd.Stdout = buf - cmd.Stderr = new(bytes.Buffer) - if err := cmd.Run(); err != nil { - return nil, fmt.Errorf("%v: %v: %s", tool, err, cmd.Stderr) - } - var response struct { - // Sizes, if not nil, is the types.Sizes to use when type checking. - Sizes *types.StdSizes - } - if err := json.Unmarshal(buf.Bytes(), &response); err != nil { - return nil, err - } - return response.Sizes, nil -} - -func GetSizesGolist(ctx context.Context, buildFlags, env []string, gocmdRunner *gocommand.Runner, dir string) (types.Sizes, error) { - inv := gocommand.Invocation{ - Verb: "list", - Args: []string{"-f", "{{context.GOARCH}} {{context.Compiler}}", "--", "unsafe"}, - Env: env, - BuildFlags: buildFlags, - WorkingDir: dir, - } - stdout, stderr, friendlyErr, rawErr := gocmdRunner.RunRaw(ctx, inv) - var goarch, compiler string - if rawErr != nil { - if strings.Contains(rawErr.Error(), "cannot find main module") { - // User's running outside of a module. All bets are off. Get GOARCH and guess compiler is gc. - // TODO(matloob): Is this a problem in practice? - inv := gocommand.Invocation{ - Verb: "env", - Args: []string{"GOARCH"}, - Env: env, - WorkingDir: dir, - } - envout, enverr := gocmdRunner.Run(ctx, inv) - if enverr != nil { - return nil, enverr - } - goarch = strings.TrimSpace(envout.String()) - compiler = "gc" - } else { - return nil, friendlyErr - } - } else { - fields := strings.Fields(stdout.String()) - if len(fields) < 2 { - return nil, fmt.Errorf("could not parse GOARCH and Go compiler in format \" \":\nstdout: <<%s>>\nstderr: <<%s>>", - stdout.String(), stderr.String()) - } - goarch = fields[0] - compiler = fields[1] - } - return types.SizesFor(compiler, goarch), nil -} diff --git a/vendor/golang.org/x/tools/go/packages/doc.go b/vendor/golang.org/x/tools/go/packages/doc.go deleted file mode 100644 index 4bfe28a51f..0000000000 --- a/vendor/golang.org/x/tools/go/packages/doc.go +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package packages loads Go packages for inspection and analysis. - -The Load function takes as input a list of patterns and return a list of Package -structs describing individual packages matched by those patterns. -The LoadMode controls the amount of detail in the loaded packages. - -Load passes most patterns directly to the underlying build tool, -but all patterns with the prefix "query=", where query is a -non-empty string of letters from [a-z], are reserved and may be -interpreted as query operators. - -Two query operators are currently supported: "file" and "pattern". - -The query "file=path/to/file.go" matches the package or packages enclosing -the Go source file path/to/file.go. For example "file=~/go/src/fmt/print.go" -might return the packages "fmt" and "fmt [fmt.test]". - -The query "pattern=string" causes "string" to be passed directly to -the underlying build tool. In most cases this is unnecessary, -but an application can use Load("pattern=" + x) as an escaping mechanism -to ensure that x is not interpreted as a query operator if it contains '='. - -All other query operators are reserved for future use and currently -cause Load to report an error. - -The Package struct provides basic information about the package, including - - - ID, a unique identifier for the package in the returned set; - - GoFiles, the names of the package's Go source files; - - Imports, a map from source import strings to the Packages they name; - - Types, the type information for the package's exported symbols; - - Syntax, the parsed syntax trees for the package's source code; and - - TypeInfo, the result of a complete type-check of the package syntax trees. - -(See the documentation for type Package for the complete list of fields -and more detailed descriptions.) - -For example, - - Load(nil, "bytes", "unicode...") - -returns four Package structs describing the standard library packages -bytes, unicode, unicode/utf16, and unicode/utf8. Note that one pattern -can match multiple packages and that a package might be matched by -multiple patterns: in general it is not possible to determine which -packages correspond to which patterns. - -Note that the list returned by Load contains only the packages matched -by the patterns. Their dependencies can be found by walking the import -graph using the Imports fields. - -The Load function can be configured by passing a pointer to a Config as -the first argument. A nil Config is equivalent to the zero Config, which -causes Load to run in LoadFiles mode, collecting minimal information. -See the documentation for type Config for details. - -As noted earlier, the Config.Mode controls the amount of detail -reported about the loaded packages. See the documentation for type LoadMode -for details. - -Most tools should pass their command-line arguments (after any flags) -uninterpreted to the loader, so that the loader can interpret them -according to the conventions of the underlying build system. -See the Example function for typical usage. - -*/ -package packages // import "golang.org/x/tools/go/packages" - -/* - -Motivation and design considerations - -The new package's design solves problems addressed by two existing -packages: go/build, which locates and describes packages, and -golang.org/x/tools/go/loader, which loads, parses and type-checks them. -The go/build.Package structure encodes too much of the 'go build' way -of organizing projects, leaving us in need of a data type that describes a -package of Go source code independent of the underlying build system. -We wanted something that works equally well with go build and vgo, and -also other build systems such as Bazel and Blaze, making it possible to -construct analysis tools that work in all these environments. -Tools such as errcheck and staticcheck were essentially unavailable to -the Go community at Google, and some of Google's internal tools for Go -are unavailable externally. -This new package provides a uniform way to obtain package metadata by -querying each of these build systems, optionally supporting their -preferred command-line notations for packages, so that tools integrate -neatly with users' build environments. The Metadata query function -executes an external query tool appropriate to the current workspace. - -Loading packages always returns the complete import graph "all the way down", -even if all you want is information about a single package, because the query -mechanisms of all the build systems we currently support ({go,vgo} list, and -blaze/bazel aspect-based query) cannot provide detailed information -about one package without visiting all its dependencies too, so there is -no additional asymptotic cost to providing transitive information. -(This property might not be true of a hypothetical 5th build system.) - -In calls to TypeCheck, all initial packages, and any package that -transitively depends on one of them, must be loaded from source. -Consider A->B->C->D->E: if A,C are initial, A,B,C must be loaded from -source; D may be loaded from export data, and E may not be loaded at all -(though it's possible that D's export data mentions it, so a -types.Package may be created for it and exposed.) - -The old loader had a feature to suppress type-checking of function -bodies on a per-package basis, primarily intended to reduce the work of -obtaining type information for imported packages. Now that imports are -satisfied by export data, the optimization no longer seems necessary. - -Despite some early attempts, the old loader did not exploit export data, -instead always using the equivalent of WholeProgram mode. This was due -to the complexity of mixing source and export data packages (now -resolved by the upward traversal mentioned above), and because export data -files were nearly always missing or stale. Now that 'go build' supports -caching, all the underlying build systems can guarantee to produce -export data in a reasonable (amortized) time. - -Test "main" packages synthesized by the build system are now reported as -first-class packages, avoiding the need for clients (such as go/ssa) to -reinvent this generation logic. - -One way in which go/packages is simpler than the old loader is in its -treatment of in-package tests. In-package tests are packages that -consist of all the files of the library under test, plus the test files. -The old loader constructed in-package tests by a two-phase process of -mutation called "augmentation": first it would construct and type check -all the ordinary library packages and type-check the packages that -depend on them; then it would add more (test) files to the package and -type-check again. This two-phase approach had four major problems: -1) in processing the tests, the loader modified the library package, - leaving no way for a client application to see both the test - package and the library package; one would mutate into the other. -2) because test files can declare additional methods on types defined in - the library portion of the package, the dispatch of method calls in - the library portion was affected by the presence of the test files. - This should have been a clue that the packages were logically - different. -3) this model of "augmentation" assumed at most one in-package test - per library package, which is true of projects using 'go build', - but not other build systems. -4) because of the two-phase nature of test processing, all packages that - import the library package had to be processed before augmentation, - forcing a "one-shot" API and preventing the client from calling Load - in several times in sequence as is now possible in WholeProgram mode. - (TypeCheck mode has a similar one-shot restriction for a different reason.) - -Early drafts of this package supported "multi-shot" operation. -Although it allowed clients to make a sequence of calls (or concurrent -calls) to Load, building up the graph of Packages incrementally, -it was of marginal value: it complicated the API -(since it allowed some options to vary across calls but not others), -it complicated the implementation, -it cannot be made to work in Types mode, as explained above, -and it was less efficient than making one combined call (when this is possible). -Among the clients we have inspected, none made multiple calls to load -but could not be easily and satisfactorily modified to make only a single call. -However, applications changes may be required. -For example, the ssadump command loads the user-specified packages -and in addition the runtime package. It is tempting to simply append -"runtime" to the user-provided list, but that does not work if the user -specified an ad-hoc package such as [a.go b.go]. -Instead, ssadump no longer requests the runtime package, -but seeks it among the dependencies of the user-specified packages, -and emits an error if it is not found. - -Overlays: The Overlay field in the Config allows providing alternate contents -for Go source files, by providing a mapping from file path to contents. -go/packages will pull in new imports added in overlay files when go/packages -is run in LoadImports mode or greater. -Overlay support for the go list driver isn't complete yet: if the file doesn't -exist on disk, it will only be recognized in an overlay if it is a non-test file -and the package would be reported even without the overlay. - -Questions & Tasks - -- Add GOARCH/GOOS? - They are not portable concepts, but could be made portable. - Our goal has been to allow users to express themselves using the conventions - of the underlying build system: if the build system honors GOARCH - during a build and during a metadata query, then so should - applications built atop that query mechanism. - Conversely, if the target architecture of the build is determined by - command-line flags, the application can pass the relevant - flags through to the build system using a command such as: - myapp -query_flag="--cpu=amd64" -query_flag="--os=darwin" - However, this approach is low-level, unwieldy, and non-portable. - GOOS and GOARCH seem important enough to warrant a dedicated option. - -- How should we handle partial failures such as a mixture of good and - malformed patterns, existing and non-existent packages, successful and - failed builds, import failures, import cycles, and so on, in a call to - Load? - -- Support bazel, blaze, and go1.10 list, not just go1.11 list. - -- Handle (and test) various partial success cases, e.g. - a mixture of good packages and: - invalid patterns - nonexistent packages - empty packages - packages with malformed package or import declarations - unreadable files - import cycles - other parse errors - type errors - Make sure we record errors at the correct place in the graph. - -- Missing packages among initial arguments are not reported. - Return bogus packages for them, like golist does. - -- "undeclared name" errors (for example) are reported out of source file - order. I suspect this is due to the breadth-first resolution now used - by go/types. Is that a bug? Discuss with gri. - -*/ diff --git a/vendor/golang.org/x/tools/go/packages/external.go b/vendor/golang.org/x/tools/go/packages/external.go deleted file mode 100644 index 8c8473fd0b..0000000000 --- a/vendor/golang.org/x/tools/go/packages/external.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file enables an external tool to intercept package requests. -// If the tool is present then its results are used in preference to -// the go list command. - -package packages - -import ( - "bytes" - "encoding/json" - "fmt" - "os" - "os/exec" - "strings" -) - -// The Driver Protocol -// -// The driver, given the inputs to a call to Load, returns metadata about the packages specified. -// This allows for different build systems to support go/packages by telling go/packages how the -// packages' source is organized. -// The driver is a binary, either specified by the GOPACKAGESDRIVER environment variable or in -// the path as gopackagesdriver. It's given the inputs to load in its argv. See the package -// documentation in doc.go for the full description of the patterns that need to be supported. -// A driver receives as a JSON-serialized driverRequest struct in standard input and will -// produce a JSON-serialized driverResponse (see definition in packages.go) in its standard output. - -// driverRequest is used to provide the portion of Load's Config that is needed by a driver. -type driverRequest struct { - Mode LoadMode `json:"mode"` - // Env specifies the environment the underlying build system should be run in. - Env []string `json:"env"` - // BuildFlags are flags that should be passed to the underlying build system. - BuildFlags []string `json:"build_flags"` - // Tests specifies whether the patterns should also return test packages. - Tests bool `json:"tests"` - // Overlay maps file paths (relative to the driver's working directory) to the byte contents - // of overlay files. - Overlay map[string][]byte `json:"overlay"` -} - -// findExternalDriver returns the file path of a tool that supplies -// the build system package structure, or "" if not found." -// If GOPACKAGESDRIVER is set in the environment findExternalTool returns its -// value, otherwise it searches for a binary named gopackagesdriver on the PATH. -func findExternalDriver(cfg *Config) driver { - const toolPrefix = "GOPACKAGESDRIVER=" - tool := "" - for _, env := range cfg.Env { - if val := strings.TrimPrefix(env, toolPrefix); val != env { - tool = val - } - } - if tool != "" && tool == "off" { - return nil - } - if tool == "" { - var err error - tool, err = exec.LookPath("gopackagesdriver") - if err != nil { - return nil - } - } - return func(cfg *Config, words ...string) (*driverResponse, error) { - req, err := json.Marshal(driverRequest{ - Mode: cfg.Mode, - Env: cfg.Env, - BuildFlags: cfg.BuildFlags, - Tests: cfg.Tests, - Overlay: cfg.Overlay, - }) - if err != nil { - return nil, fmt.Errorf("failed to encode message to driver tool: %v", err) - } - - buf := new(bytes.Buffer) - stderr := new(bytes.Buffer) - cmd := exec.CommandContext(cfg.Context, tool, words...) - cmd.Dir = cfg.Dir - cmd.Env = cfg.Env - cmd.Stdin = bytes.NewReader(req) - cmd.Stdout = buf - cmd.Stderr = stderr - - if err := cmd.Run(); err != nil { - return nil, fmt.Errorf("%v: %v: %s", tool, err, cmd.Stderr) - } - if len(stderr.Bytes()) != 0 && os.Getenv("GOPACKAGESPRINTDRIVERERRORS") != "" { - fmt.Fprintf(os.Stderr, "%s stderr: <<%s>>\n", cmdDebugStr(cmd, words...), stderr) - } - - var response driverResponse - if err := json.Unmarshal(buf.Bytes(), &response); err != nil { - return nil, err - } - return &response, nil - } -} diff --git a/vendor/golang.org/x/tools/go/packages/golist.go b/vendor/golang.org/x/tools/go/packages/golist.go deleted file mode 100644 index 88ca6691de..0000000000 --- a/vendor/golang.org/x/tools/go/packages/golist.go +++ /dev/null @@ -1,889 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "go/types" - "log" - "os" - "os/exec" - "path" - "path/filepath" - "reflect" - "sort" - "strconv" - "strings" - "sync" - "unicode" - - "golang.org/x/tools/go/internal/packagesdriver" - "golang.org/x/tools/internal/gocommand" - "golang.org/x/tools/internal/packagesinternal" - "golang.org/x/xerrors" -) - -// debug controls verbose logging. -var debug, _ = strconv.ParseBool(os.Getenv("GOPACKAGESDEBUG")) - -// A goTooOldError reports that the go command -// found by exec.LookPath is too old to use the new go list behavior. -type goTooOldError struct { - error -} - -// responseDeduper wraps a driverResponse, deduplicating its contents. -type responseDeduper struct { - seenRoots map[string]bool - seenPackages map[string]*Package - dr *driverResponse -} - -func newDeduper() *responseDeduper { - return &responseDeduper{ - dr: &driverResponse{}, - seenRoots: map[string]bool{}, - seenPackages: map[string]*Package{}, - } -} - -// addAll fills in r with a driverResponse. -func (r *responseDeduper) addAll(dr *driverResponse) { - for _, pkg := range dr.Packages { - r.addPackage(pkg) - } - for _, root := range dr.Roots { - r.addRoot(root) - } -} - -func (r *responseDeduper) addPackage(p *Package) { - if r.seenPackages[p.ID] != nil { - return - } - r.seenPackages[p.ID] = p - r.dr.Packages = append(r.dr.Packages, p) -} - -func (r *responseDeduper) addRoot(id string) { - if r.seenRoots[id] { - return - } - r.seenRoots[id] = true - r.dr.Roots = append(r.dr.Roots, id) -} - -type golistState struct { - cfg *Config - ctx context.Context - - envOnce sync.Once - goEnvError error - goEnv map[string]string - - rootsOnce sync.Once - rootDirsError error - rootDirs map[string]string - - // vendorDirs caches the (non)existence of vendor directories. - vendorDirs map[string]bool -} - -// getEnv returns Go environment variables. Only specific variables are -// populated -- computing all of them is slow. -func (state *golistState) getEnv() (map[string]string, error) { - state.envOnce.Do(func() { - var b *bytes.Buffer - b, state.goEnvError = state.invokeGo("env", "-json", "GOMOD", "GOPATH") - if state.goEnvError != nil { - return - } - - state.goEnv = make(map[string]string) - decoder := json.NewDecoder(b) - if state.goEnvError = decoder.Decode(&state.goEnv); state.goEnvError != nil { - return - } - }) - return state.goEnv, state.goEnvError -} - -// mustGetEnv is a convenience function that can be used if getEnv has already succeeded. -func (state *golistState) mustGetEnv() map[string]string { - env, err := state.getEnv() - if err != nil { - panic(fmt.Sprintf("mustGetEnv: %v", err)) - } - return env -} - -// goListDriver uses the go list command to interpret the patterns and produce -// the build system package structure. -// See driver for more details. -func goListDriver(cfg *Config, patterns ...string) (*driverResponse, error) { - // Make sure that any asynchronous go commands are killed when we return. - parentCtx := cfg.Context - if parentCtx == nil { - parentCtx = context.Background() - } - ctx, cancel := context.WithCancel(parentCtx) - defer cancel() - - response := newDeduper() - - // Fill in response.Sizes asynchronously if necessary. - var sizeserr error - var sizeswg sync.WaitGroup - if cfg.Mode&NeedTypesSizes != 0 || cfg.Mode&NeedTypes != 0 { - sizeswg.Add(1) - go func() { - var sizes types.Sizes - sizes, sizeserr = packagesdriver.GetSizesGolist(ctx, cfg.BuildFlags, cfg.Env, cfg.gocmdRunner, cfg.Dir) - // types.SizesFor always returns nil or a *types.StdSizes. - response.dr.Sizes, _ = sizes.(*types.StdSizes) - sizeswg.Done() - }() - } - - state := &golistState{ - cfg: cfg, - ctx: ctx, - vendorDirs: map[string]bool{}, - } - - // Determine files requested in contains patterns - var containFiles []string - restPatterns := make([]string, 0, len(patterns)) - // Extract file= and other [querytype]= patterns. Report an error if querytype - // doesn't exist. -extractQueries: - for _, pattern := range patterns { - eqidx := strings.Index(pattern, "=") - if eqidx < 0 { - restPatterns = append(restPatterns, pattern) - } else { - query, value := pattern[:eqidx], pattern[eqidx+len("="):] - switch query { - case "file": - containFiles = append(containFiles, value) - case "pattern": - restPatterns = append(restPatterns, value) - case "": // not a reserved query - restPatterns = append(restPatterns, pattern) - default: - for _, rune := range query { - if rune < 'a' || rune > 'z' { // not a reserved query - restPatterns = append(restPatterns, pattern) - continue extractQueries - } - } - // Reject all other patterns containing "=" - return nil, fmt.Errorf("invalid query type %q in query pattern %q", query, pattern) - } - } - } - - // See if we have any patterns to pass through to go list. Zero initial - // patterns also requires a go list call, since it's the equivalent of - // ".". - if len(restPatterns) > 0 || len(patterns) == 0 { - dr, err := state.createDriverResponse(restPatterns...) - if err != nil { - return nil, err - } - response.addAll(dr) - } - - if len(containFiles) != 0 { - if err := state.runContainsQueries(response, containFiles); err != nil { - return nil, err - } - } - - modifiedPkgs, needPkgs, err := state.processGolistOverlay(response) - if err != nil { - return nil, err - } - - var containsCandidates []string - if len(containFiles) > 0 { - containsCandidates = append(containsCandidates, modifiedPkgs...) - containsCandidates = append(containsCandidates, needPkgs...) - } - if err := state.addNeededOverlayPackages(response, needPkgs); err != nil { - return nil, err - } - // Check candidate packages for containFiles. - if len(containFiles) > 0 { - for _, id := range containsCandidates { - pkg, ok := response.seenPackages[id] - if !ok { - response.addPackage(&Package{ - ID: id, - Errors: []Error{ - { - Kind: ListError, - Msg: fmt.Sprintf("package %s expected but not seen", id), - }, - }, - }) - continue - } - for _, f := range containFiles { - for _, g := range pkg.GoFiles { - if sameFile(f, g) { - response.addRoot(id) - } - } - } - } - } - - sizeswg.Wait() - if sizeserr != nil { - return nil, sizeserr - } - return response.dr, nil -} - -func (state *golistState) addNeededOverlayPackages(response *responseDeduper, pkgs []string) error { - if len(pkgs) == 0 { - return nil - } - dr, err := state.createDriverResponse(pkgs...) - if err != nil { - return err - } - for _, pkg := range dr.Packages { - response.addPackage(pkg) - } - _, needPkgs, err := state.processGolistOverlay(response) - if err != nil { - return err - } - return state.addNeededOverlayPackages(response, needPkgs) -} - -func (state *golistState) runContainsQueries(response *responseDeduper, queries []string) error { - for _, query := range queries { - // TODO(matloob): Do only one query per directory. - fdir := filepath.Dir(query) - // Pass absolute path of directory to go list so that it knows to treat it as a directory, - // not a package path. - pattern, err := filepath.Abs(fdir) - if err != nil { - return fmt.Errorf("could not determine absolute path of file= query path %q: %v", query, err) - } - dirResponse, err := state.createDriverResponse(pattern) - - // If there was an error loading the package, or the package is returned - // with errors, try to load the file as an ad-hoc package. - // Usually the error will appear in a returned package, but may not if we're - // in module mode and the ad-hoc is located outside a module. - if err != nil || len(dirResponse.Packages) == 1 && len(dirResponse.Packages[0].GoFiles) == 0 && - len(dirResponse.Packages[0].Errors) == 1 { - var queryErr error - if dirResponse, queryErr = state.adhocPackage(pattern, query); queryErr != nil { - return err // return the original error - } - } - isRoot := make(map[string]bool, len(dirResponse.Roots)) - for _, root := range dirResponse.Roots { - isRoot[root] = true - } - for _, pkg := range dirResponse.Packages { - // Add any new packages to the main set - // We don't bother to filter packages that will be dropped by the changes of roots, - // that will happen anyway during graph construction outside this function. - // Over-reporting packages is not a problem. - response.addPackage(pkg) - // if the package was not a root one, it cannot have the file - if !isRoot[pkg.ID] { - continue - } - for _, pkgFile := range pkg.GoFiles { - if filepath.Base(query) == filepath.Base(pkgFile) { - response.addRoot(pkg.ID) - break - } - } - } - } - return nil -} - -// adhocPackage attempts to load or construct an ad-hoc package for a given -// query, if the original call to the driver produced inadequate results. -func (state *golistState) adhocPackage(pattern, query string) (*driverResponse, error) { - response, err := state.createDriverResponse(query) - if err != nil { - return nil, err - } - // If we get nothing back from `go list`, - // try to make this file into its own ad-hoc package. - // TODO(rstambler): Should this check against the original response? - if len(response.Packages) == 0 { - response.Packages = append(response.Packages, &Package{ - ID: "command-line-arguments", - PkgPath: query, - GoFiles: []string{query}, - CompiledGoFiles: []string{query}, - Imports: make(map[string]*Package), - }) - response.Roots = append(response.Roots, "command-line-arguments") - } - // Handle special cases. - if len(response.Packages) == 1 { - // golang/go#33482: If this is a file= query for ad-hoc packages where - // the file only exists on an overlay, and exists outside of a module, - // add the file to the package and remove the errors. - if response.Packages[0].ID == "command-line-arguments" || - filepath.ToSlash(response.Packages[0].PkgPath) == filepath.ToSlash(query) { - if len(response.Packages[0].GoFiles) == 0 { - filename := filepath.Join(pattern, filepath.Base(query)) // avoid recomputing abspath - // TODO(matloob): check if the file is outside of a root dir? - for path := range state.cfg.Overlay { - if path == filename { - response.Packages[0].Errors = nil - response.Packages[0].GoFiles = []string{path} - response.Packages[0].CompiledGoFiles = []string{path} - } - } - } - } - } - return response, nil -} - -// Fields must match go list; -// see $GOROOT/src/cmd/go/internal/load/pkg.go. -type jsonPackage struct { - ImportPath string - Dir string - Name string - Export string - GoFiles []string - CompiledGoFiles []string - CFiles []string - CgoFiles []string - CXXFiles []string - MFiles []string - HFiles []string - FFiles []string - SFiles []string - SwigFiles []string - SwigCXXFiles []string - SysoFiles []string - Imports []string - ImportMap map[string]string - Deps []string - Module *packagesinternal.Module - TestGoFiles []string - TestImports []string - XTestGoFiles []string - XTestImports []string - ForTest string // q in a "p [q.test]" package, else "" - DepOnly bool - - Error *jsonPackageError -} - -type jsonPackageError struct { - ImportStack []string - Pos string - Err string -} - -func otherFiles(p *jsonPackage) [][]string { - return [][]string{p.CFiles, p.CXXFiles, p.MFiles, p.HFiles, p.FFiles, p.SFiles, p.SwigFiles, p.SwigCXXFiles, p.SysoFiles} -} - -// createDriverResponse uses the "go list" command to expand the pattern -// words and return a response for the specified packages. -func (state *golistState) createDriverResponse(words ...string) (*driverResponse, error) { - // go list uses the following identifiers in ImportPath and Imports: - // - // "p" -- importable package or main (command) - // "q.test" -- q's test executable - // "p [q.test]" -- variant of p as built for q's test executable - // "q_test [q.test]" -- q's external test package - // - // The packages p that are built differently for a test q.test - // are q itself, plus any helpers used by the external test q_test, - // typically including "testing" and all its dependencies. - - // Run "go list" for complete - // information on the specified packages. - buf, err := state.invokeGo("list", golistargs(state.cfg, words)...) - if err != nil { - return nil, err - } - seen := make(map[string]*jsonPackage) - pkgs := make(map[string]*Package) - additionalErrors := make(map[string][]Error) - // Decode the JSON and convert it to Package form. - var response driverResponse - for dec := json.NewDecoder(buf); dec.More(); { - p := new(jsonPackage) - if err := dec.Decode(p); err != nil { - return nil, fmt.Errorf("JSON decoding failed: %v", err) - } - - if p.ImportPath == "" { - // The documentation for go list says that “[e]rroneous packages will have - // a non-empty ImportPath”. If for some reason it comes back empty, we - // prefer to error out rather than silently discarding data or handing - // back a package without any way to refer to it. - if p.Error != nil { - return nil, Error{ - Pos: p.Error.Pos, - Msg: p.Error.Err, - } - } - return nil, fmt.Errorf("package missing import path: %+v", p) - } - - // Work around https://golang.org/issue/33157: - // go list -e, when given an absolute path, will find the package contained at - // that directory. But when no package exists there, it will return a fake package - // with an error and the ImportPath set to the absolute path provided to go list. - // Try to convert that absolute path to what its package path would be if it's - // contained in a known module or GOPATH entry. This will allow the package to be - // properly "reclaimed" when overlays are processed. - if filepath.IsAbs(p.ImportPath) && p.Error != nil { - pkgPath, ok, err := state.getPkgPath(p.ImportPath) - if err != nil { - return nil, err - } - if ok { - p.ImportPath = pkgPath - } - } - - if old, found := seen[p.ImportPath]; found { - // If one version of the package has an error, and the other doesn't, assume - // that this is a case where go list is reporting a fake dependency variant - // of the imported package: When a package tries to invalidly import another - // package, go list emits a variant of the imported package (with the same - // import path, but with an error on it, and the package will have a - // DepError set on it). An example of when this can happen is for imports of - // main packages: main packages can not be imported, but they may be - // separately matched and listed by another pattern. - // See golang.org/issue/36188 for more details. - - // The plan is that eventually, hopefully in Go 1.15, the error will be - // reported on the importing package rather than the duplicate "fake" - // version of the imported package. Once all supported versions of Go - // have the new behavior this logic can be deleted. - // TODO(matloob): delete the workaround logic once all supported versions of - // Go return the errors on the proper package. - - // There should be exactly one version of a package that doesn't have an - // error. - if old.Error == nil && p.Error == nil { - if !reflect.DeepEqual(p, old) { - return nil, fmt.Errorf("internal error: go list gives conflicting information for package %v", p.ImportPath) - } - continue - } - - // Determine if this package's error needs to be bubbled up. - // This is a hack, and we expect for go list to eventually set the error - // on the package. - if old.Error != nil { - var errkind string - if strings.Contains(old.Error.Err, "not an importable package") { - errkind = "not an importable package" - } else if strings.Contains(old.Error.Err, "use of internal package") && strings.Contains(old.Error.Err, "not allowed") { - errkind = "use of internal package not allowed" - } - if errkind != "" { - if len(old.Error.ImportStack) < 1 { - return nil, fmt.Errorf(`internal error: go list gave a %q error with empty import stack`, errkind) - } - importingPkg := old.Error.ImportStack[len(old.Error.ImportStack)-1] - if importingPkg == old.ImportPath { - // Using an older version of Go which put this package itself on top of import - // stack, instead of the importer. Look for importer in second from top - // position. - if len(old.Error.ImportStack) < 2 { - return nil, fmt.Errorf(`internal error: go list gave a %q error with an import stack without importing package`, errkind) - } - importingPkg = old.Error.ImportStack[len(old.Error.ImportStack)-2] - } - additionalErrors[importingPkg] = append(additionalErrors[importingPkg], Error{ - Pos: old.Error.Pos, - Msg: old.Error.Err, - Kind: ListError, - }) - } - } - - // Make sure that if there's a version of the package without an error, - // that's the one reported to the user. - if old.Error == nil { - continue - } - - // This package will replace the old one at the end of the loop. - } - seen[p.ImportPath] = p - - pkg := &Package{ - Name: p.Name, - ID: p.ImportPath, - GoFiles: absJoin(p.Dir, p.GoFiles, p.CgoFiles), - CompiledGoFiles: absJoin(p.Dir, p.CompiledGoFiles), - OtherFiles: absJoin(p.Dir, otherFiles(p)...), - forTest: p.ForTest, - module: p.Module, - } - - // Work around https://golang.org/issue/28749: - // cmd/go puts assembly, C, and C++ files in CompiledGoFiles. - // Filter out any elements of CompiledGoFiles that are also in OtherFiles. - // We have to keep this workaround in place until go1.12 is a distant memory. - if len(pkg.OtherFiles) > 0 { - other := make(map[string]bool, len(pkg.OtherFiles)) - for _, f := range pkg.OtherFiles { - other[f] = true - } - - out := pkg.CompiledGoFiles[:0] - for _, f := range pkg.CompiledGoFiles { - if other[f] { - continue - } - out = append(out, f) - } - pkg.CompiledGoFiles = out - } - - // Extract the PkgPath from the package's ID. - if i := strings.IndexByte(pkg.ID, ' '); i >= 0 { - pkg.PkgPath = pkg.ID[:i] - } else { - pkg.PkgPath = pkg.ID - } - - if pkg.PkgPath == "unsafe" { - pkg.GoFiles = nil // ignore fake unsafe.go file - } - - // Assume go list emits only absolute paths for Dir. - if p.Dir != "" && !filepath.IsAbs(p.Dir) { - log.Fatalf("internal error: go list returned non-absolute Package.Dir: %s", p.Dir) - } - - if p.Export != "" && !filepath.IsAbs(p.Export) { - pkg.ExportFile = filepath.Join(p.Dir, p.Export) - } else { - pkg.ExportFile = p.Export - } - - // imports - // - // Imports contains the IDs of all imported packages. - // ImportsMap records (path, ID) only where they differ. - ids := make(map[string]bool) - for _, id := range p.Imports { - ids[id] = true - } - pkg.Imports = make(map[string]*Package) - for path, id := range p.ImportMap { - pkg.Imports[path] = &Package{ID: id} // non-identity import - delete(ids, id) - } - for id := range ids { - if id == "C" { - continue - } - - pkg.Imports[id] = &Package{ID: id} // identity import - } - if !p.DepOnly { - response.Roots = append(response.Roots, pkg.ID) - } - - // Work around for pre-go.1.11 versions of go list. - // TODO(matloob): they should be handled by the fallback. - // Can we delete this? - if len(pkg.CompiledGoFiles) == 0 { - pkg.CompiledGoFiles = pkg.GoFiles - } - - if p.Error != nil { - msg := strings.TrimSpace(p.Error.Err) // Trim to work around golang.org/issue/32363. - // Address golang.org/issue/35964 by appending import stack to error message. - if msg == "import cycle not allowed" && len(p.Error.ImportStack) != 0 { - msg += fmt.Sprintf(": import stack: %v", p.Error.ImportStack) - } - pkg.Errors = append(pkg.Errors, Error{ - Pos: p.Error.Pos, - Msg: msg, - Kind: ListError, - }) - } - - pkgs[pkg.ID] = pkg - } - - for id, errs := range additionalErrors { - if p, ok := pkgs[id]; ok { - p.Errors = append(p.Errors, errs...) - } - } - for _, pkg := range pkgs { - response.Packages = append(response.Packages, pkg) - } - sort.Slice(response.Packages, func(i, j int) bool { return response.Packages[i].ID < response.Packages[j].ID }) - - return &response, nil -} - -// getPkgPath finds the package path of a directory if it's relative to a root directory. -func (state *golistState) getPkgPath(dir string) (string, bool, error) { - absDir, err := filepath.Abs(dir) - if err != nil { - return "", false, err - } - roots, err := state.determineRootDirs() - if err != nil { - return "", false, err - } - - for rdir, rpath := range roots { - // Make sure that the directory is in the module, - // to avoid creating a path relative to another module. - if !strings.HasPrefix(absDir, rdir) { - continue - } - // TODO(matloob): This doesn't properly handle symlinks. - r, err := filepath.Rel(rdir, dir) - if err != nil { - continue - } - if rpath != "" { - // We choose only one root even though the directory even it can belong in multiple modules - // or GOPATH entries. This is okay because we only need to work with absolute dirs when a - // file is missing from disk, for instance when gopls calls go/packages in an overlay. - // Once the file is saved, gopls, or the next invocation of the tool will get the correct - // result straight from golist. - // TODO(matloob): Implement module tiebreaking? - return path.Join(rpath, filepath.ToSlash(r)), true, nil - } - return filepath.ToSlash(r), true, nil - } - return "", false, nil -} - -// absJoin absolutizes and flattens the lists of files. -func absJoin(dir string, fileses ...[]string) (res []string) { - for _, files := range fileses { - for _, file := range files { - if !filepath.IsAbs(file) { - file = filepath.Join(dir, file) - } - res = append(res, file) - } - } - return res -} - -func golistargs(cfg *Config, words []string) []string { - const findFlags = NeedImports | NeedTypes | NeedSyntax | NeedTypesInfo - fullargs := []string{ - "-e", "-json", - fmt.Sprintf("-compiled=%t", cfg.Mode&(NeedCompiledGoFiles|NeedSyntax|NeedTypes|NeedTypesInfo|NeedTypesSizes) != 0), - fmt.Sprintf("-test=%t", cfg.Tests), - fmt.Sprintf("-export=%t", usesExportData(cfg)), - fmt.Sprintf("-deps=%t", cfg.Mode&NeedImports != 0), - // go list doesn't let you pass -test and -find together, - // probably because you'd just get the TestMain. - fmt.Sprintf("-find=%t", !cfg.Tests && cfg.Mode&findFlags == 0), - } - fullargs = append(fullargs, cfg.BuildFlags...) - fullargs = append(fullargs, "--") - fullargs = append(fullargs, words...) - return fullargs -} - -// invokeGo returns the stdout of a go command invocation. -func (state *golistState) invokeGo(verb string, args ...string) (*bytes.Buffer, error) { - cfg := state.cfg - - inv := gocommand.Invocation{ - Verb: verb, - Args: args, - BuildFlags: cfg.BuildFlags, - Env: cfg.Env, - Logf: cfg.Logf, - WorkingDir: cfg.Dir, - } - gocmdRunner := cfg.gocmdRunner - if gocmdRunner == nil { - gocmdRunner = &gocommand.Runner{} - } - stdout, stderr, _, err := gocmdRunner.RunRaw(cfg.Context, inv) - if err != nil { - // Check for 'go' executable not being found. - if ee, ok := err.(*exec.Error); ok && ee.Err == exec.ErrNotFound { - return nil, fmt.Errorf("'go list' driver requires 'go', but %s", exec.ErrNotFound) - } - - exitErr, ok := err.(*exec.ExitError) - if !ok { - // Catastrophic error: - // - context cancellation - return nil, xerrors.Errorf("couldn't run 'go': %w", err) - } - - // Old go version? - if strings.Contains(stderr.String(), "flag provided but not defined") { - return nil, goTooOldError{fmt.Errorf("unsupported version of go: %s: %s", exitErr, stderr)} - } - - // Related to #24854 - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "unexpected directory layout") { - return nil, fmt.Errorf("%s", stderr.String()) - } - - // Is there an error running the C compiler in cgo? This will be reported in the "Error" field - // and should be suppressed by go list -e. - // - // This condition is not perfect yet because the error message can include other error messages than runtime/cgo. - isPkgPathRune := func(r rune) bool { - // From https://golang.org/ref/spec#Import_declarations: - // Implementation restriction: A compiler may restrict ImportPaths to non-empty strings - // using only characters belonging to Unicode's L, M, N, P, and S general categories - // (the Graphic characters without spaces) and may also exclude the - // characters !"#$%&'()*,:;<=>?[\]^`{|} and the Unicode replacement character U+FFFD. - return unicode.IsOneOf([]*unicode.RangeTable{unicode.L, unicode.M, unicode.N, unicode.P, unicode.S}, r) && - !strings.ContainsRune("!\"#$%&'()*,:;<=>?[\\]^`{|}\uFFFD", r) - } - if len(stderr.String()) > 0 && strings.HasPrefix(stderr.String(), "# ") { - msg := stderr.String()[len("# "):] - if strings.HasPrefix(strings.TrimLeftFunc(msg, isPkgPathRune), "\n") { - return stdout, nil - } - // Treat pkg-config errors as a special case (golang.org/issue/36770). - if strings.HasPrefix(msg, "pkg-config") { - return stdout, nil - } - } - - // This error only appears in stderr. See golang.org/cl/166398 for a fix in go list to show - // the error in the Err section of stdout in case -e option is provided. - // This fix is provided for backwards compatibility. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must be .go files") { - output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Similar to the previous error, but currently lacks a fix in Go. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must all be in one directory") { - output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Backwards compatibility for Go 1.11 because 1.12 and 1.13 put the directory in the ImportPath. - // If the package doesn't exist, put the absolute path of the directory into the error message, - // as Go 1.13 list does. - const noSuchDirectory = "no such directory" - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), noSuchDirectory) { - errstr := stderr.String() - abspath := strings.TrimSpace(errstr[strings.Index(errstr, noSuchDirectory)+len(noSuchDirectory):]) - output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - abspath, strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Workaround for #29280: go list -e has incorrect behavior when an ad-hoc package doesn't exist. - // Note that the error message we look for in this case is different that the one looked for above. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "no such file or directory") { - output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Workaround for #34273. go list -e with GO111MODULE=on has incorrect behavior when listing a - // directory outside any module. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "outside available modules") { - output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - // TODO(matloob): command-line-arguments isn't correct here. - "command-line-arguments", strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Another variation of the previous error - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "outside module root") { - output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - // TODO(matloob): command-line-arguments isn't correct here. - "command-line-arguments", strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Workaround for an instance of golang.org/issue/26755: go list -e will return a non-zero exit - // status if there's a dependency on a package that doesn't exist. But it should return - // a zero exit status and set an error on that package. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "no Go files in") { - // Don't clobber stdout if `go list` actually returned something. - if len(stdout.String()) > 0 { - return stdout, nil - } - // try to extract package name from string - stderrStr := stderr.String() - var importPath string - colon := strings.Index(stderrStr, ":") - if colon > 0 && strings.HasPrefix(stderrStr, "go build ") { - importPath = stderrStr[len("go build "):colon] - } - output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - importPath, strings.Trim(stderrStr, "\n")) - return bytes.NewBufferString(output), nil - } - - // Export mode entails a build. - // If that build fails, errors appear on stderr - // (despite the -e flag) and the Export field is blank. - // Do not fail in that case. - // The same is true if an ad-hoc package given to go list doesn't exist. - // TODO(matloob): Remove these once we can depend on go list to exit with a zero status with -e even when - // packages don't exist or a build fails. - if !usesExportData(cfg) && !containsGoFile(args) { - return nil, fmt.Errorf("go %v: %s: %s", args, exitErr, stderr) - } - } - return stdout, nil -} - -func containsGoFile(s []string) bool { - for _, f := range s { - if strings.HasSuffix(f, ".go") { - return true - } - } - return false -} - -func cmdDebugStr(cmd *exec.Cmd, args ...string) string { - env := make(map[string]string) - for _, kv := range cmd.Env { - split := strings.Split(kv, "=") - k, v := split[0], split[1] - env[k] = v - } - var quotedArgs []string - for _, arg := range args { - quotedArgs = append(quotedArgs, strconv.Quote(arg)) - } - - return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v PWD=%v go %s", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["PWD"], strings.Join(quotedArgs, " ")) -} diff --git a/vendor/golang.org/x/tools/go/packages/golist_overlay.go b/vendor/golang.org/x/tools/go/packages/golist_overlay.go deleted file mode 100644 index 3c99b6e48d..0000000000 --- a/vendor/golang.org/x/tools/go/packages/golist_overlay.go +++ /dev/null @@ -1,438 +0,0 @@ -package packages - -import ( - "encoding/json" - "fmt" - "go/parser" - "go/token" - "log" - "os" - "path/filepath" - "sort" - "strconv" - "strings" -) - -// processGolistOverlay provides rudimentary support for adding -// files that don't exist on disk to an overlay. The results can be -// sometimes incorrect. -// TODO(matloob): Handle unsupported cases, including the following: -// - determining the correct package to add given a new import path -func (state *golistState) processGolistOverlay(response *responseDeduper) (modifiedPkgs, needPkgs []string, err error) { - havePkgs := make(map[string]string) // importPath -> non-test package ID - needPkgsSet := make(map[string]bool) - modifiedPkgsSet := make(map[string]bool) - - pkgOfDir := make(map[string][]*Package) - for _, pkg := range response.dr.Packages { - // This is an approximation of import path to id. This can be - // wrong for tests, vendored packages, and a number of other cases. - havePkgs[pkg.PkgPath] = pkg.ID - x := commonDir(pkg.GoFiles) - if x != "" { - pkgOfDir[x] = append(pkgOfDir[x], pkg) - } - } - - // If no new imports are added, it is safe to avoid loading any needPkgs. - // Otherwise, it's hard to tell which package is actually being loaded - // (due to vendoring) and whether any modified package will show up - // in the transitive set of dependencies (because new imports are added, - // potentially modifying the transitive set of dependencies). - var overlayAddsImports bool - - // If both a package and its test package are created by the overlay, we - // need the real package first. Process all non-test files before test - // files, and make the whole process deterministic while we're at it. - var overlayFiles []string - for opath := range state.cfg.Overlay { - overlayFiles = append(overlayFiles, opath) - } - sort.Slice(overlayFiles, func(i, j int) bool { - iTest := strings.HasSuffix(overlayFiles[i], "_test.go") - jTest := strings.HasSuffix(overlayFiles[j], "_test.go") - if iTest != jTest { - return !iTest // non-tests are before tests. - } - return overlayFiles[i] < overlayFiles[j] - }) - for _, opath := range overlayFiles { - contents := state.cfg.Overlay[opath] - base := filepath.Base(opath) - dir := filepath.Dir(opath) - var pkg *Package // if opath belongs to both a package and its test variant, this will be the test variant - var testVariantOf *Package // if opath is a test file, this is the package it is testing - var fileExists bool - isTestFile := strings.HasSuffix(opath, "_test.go") - pkgName, ok := extractPackageName(opath, contents) - if !ok { - // Don't bother adding a file that doesn't even have a parsable package statement - // to the overlay. - continue - } - // if all the overlay files belong to a different package, change the package - // name to that package. Otherwise leave it alone; there will be an error message. - maybeFixPackageName(pkgName, pkgOfDir, dir) - nextPackage: - for _, p := range response.dr.Packages { - if pkgName != p.Name && p.ID != "command-line-arguments" { - continue - } - for _, f := range p.GoFiles { - if !sameFile(filepath.Dir(f), dir) { - continue - } - // Make sure to capture information on the package's test variant, if needed. - if isTestFile && !hasTestFiles(p) { - // TODO(matloob): Are there packages other than the 'production' variant - // of a package that this can match? This shouldn't match the test main package - // because the file is generated in another directory. - testVariantOf = p - continue nextPackage - } - // We must have already seen the package of which this is a test variant. - if pkg != nil && p != pkg && pkg.PkgPath == p.PkgPath { - if hasTestFiles(p) { - testVariantOf = pkg - } - } - pkg = p - if filepath.Base(f) == base { - fileExists = true - } - } - } - // The overlay could have included an entirely new package. - if pkg == nil { - // Try to find the module or gopath dir the file is contained in. - // Then for modules, add the module opath to the beginning. - pkgPath, ok, err := state.getPkgPath(dir) - if err != nil { - return nil, nil, err - } - if !ok { - break - } - isXTest := strings.HasSuffix(pkgName, "_test") - if isXTest { - pkgPath += "_test" - } - id := pkgPath - if isTestFile && !isXTest { - id = fmt.Sprintf("%s [%s.test]", pkgPath, pkgPath) - } - // Try to reclaim a package with the same id if it exists in the response. - for _, p := range response.dr.Packages { - if reclaimPackage(p, id, opath, contents) { - pkg = p - break - } - } - // Otherwise, create a new package - if pkg == nil { - pkg = &Package{PkgPath: pkgPath, ID: id, Name: pkgName, Imports: make(map[string]*Package)} - response.addPackage(pkg) - havePkgs[pkg.PkgPath] = id - // Add the production package's sources for a test variant. - if isTestFile && !isXTest && testVariantOf != nil { - pkg.GoFiles = append(pkg.GoFiles, testVariantOf.GoFiles...) - pkg.CompiledGoFiles = append(pkg.CompiledGoFiles, testVariantOf.CompiledGoFiles...) - // Add the package under test and its imports to the test variant. - pkg.forTest = testVariantOf.PkgPath - for k, v := range testVariantOf.Imports { - pkg.Imports[k] = &Package{ID: v.ID} - } - } - } - } - if !fileExists { - pkg.GoFiles = append(pkg.GoFiles, opath) - // TODO(matloob): Adding the file to CompiledGoFiles can exhibit the wrong behavior - // if the file will be ignored due to its build tags. - pkg.CompiledGoFiles = append(pkg.CompiledGoFiles, opath) - modifiedPkgsSet[pkg.ID] = true - } - imports, err := extractImports(opath, contents) - if err != nil { - // Let the parser or type checker report errors later. - continue - } - for _, imp := range imports { - if _, found := pkg.Imports[imp]; found { - continue - } - overlayAddsImports = true - id, ok := havePkgs[imp] - if !ok { - var err error - id, err = state.resolveImport(dir, imp) - if err != nil { - return nil, nil, err - } - } - pkg.Imports[imp] = &Package{ID: id} - // Add dependencies to the non-test variant version of this package as well. - if testVariantOf != nil { - testVariantOf.Imports[imp] = &Package{ID: id} - } - } - } - - // toPkgPath guesses the package path given the id. - toPkgPath := func(sourceDir, id string) (string, error) { - if i := strings.IndexByte(id, ' '); i >= 0 { - return state.resolveImport(sourceDir, id[:i]) - } - return state.resolveImport(sourceDir, id) - } - - // Now that new packages have been created, do another pass to determine - // the new set of missing packages. - for _, pkg := range response.dr.Packages { - for _, imp := range pkg.Imports { - if len(pkg.GoFiles) == 0 { - return nil, nil, fmt.Errorf("cannot resolve imports for package %q with no Go files", pkg.PkgPath) - } - pkgPath, err := toPkgPath(filepath.Dir(pkg.GoFiles[0]), imp.ID) - if err != nil { - return nil, nil, err - } - if _, ok := havePkgs[pkgPath]; !ok { - needPkgsSet[pkgPath] = true - } - } - } - - if overlayAddsImports { - needPkgs = make([]string, 0, len(needPkgsSet)) - for pkg := range needPkgsSet { - needPkgs = append(needPkgs, pkg) - } - } - modifiedPkgs = make([]string, 0, len(modifiedPkgsSet)) - for pkg := range modifiedPkgsSet { - modifiedPkgs = append(modifiedPkgs, pkg) - } - return modifiedPkgs, needPkgs, err -} - -// resolveImport finds the the ID of a package given its import path. -// In particular, it will find the right vendored copy when in GOPATH mode. -func (state *golistState) resolveImport(sourceDir, importPath string) (string, error) { - env, err := state.getEnv() - if err != nil { - return "", err - } - if env["GOMOD"] != "" { - return importPath, nil - } - - searchDir := sourceDir - for { - vendorDir := filepath.Join(searchDir, "vendor") - exists, ok := state.vendorDirs[vendorDir] - if !ok { - info, err := os.Stat(vendorDir) - exists = err == nil && info.IsDir() - state.vendorDirs[vendorDir] = exists - } - - if exists { - vendoredPath := filepath.Join(vendorDir, importPath) - if info, err := os.Stat(vendoredPath); err == nil && info.IsDir() { - // We should probably check for .go files here, but shame on anyone who fools us. - path, ok, err := state.getPkgPath(vendoredPath) - if err != nil { - return "", err - } - if ok { - return path, nil - } - } - } - - // We know we've hit the top of the filesystem when we Dir / and get /, - // or C:\ and get C:\, etc. - next := filepath.Dir(searchDir) - if next == searchDir { - break - } - searchDir = next - } - return importPath, nil -} - -func hasTestFiles(p *Package) bool { - for _, f := range p.GoFiles { - if strings.HasSuffix(f, "_test.go") { - return true - } - } - return false -} - -// determineRootDirs returns a mapping from absolute directories that could -// contain code to their corresponding import path prefixes. -func (state *golistState) determineRootDirs() (map[string]string, error) { - env, err := state.getEnv() - if err != nil { - return nil, err - } - if env["GOMOD"] != "" { - state.rootsOnce.Do(func() { - state.rootDirs, state.rootDirsError = state.determineRootDirsModules() - }) - } else { - state.rootsOnce.Do(func() { - state.rootDirs, state.rootDirsError = state.determineRootDirsGOPATH() - }) - } - return state.rootDirs, state.rootDirsError -} - -func (state *golistState) determineRootDirsModules() (map[string]string, error) { - // This will only return the root directory for the main module. - // For now we only support overlays in main modules. - // Editing files in the module cache isn't a great idea, so we don't - // plan to ever support that, but editing files in replaced modules - // is something we may want to support. To do that, we'll want to - // do a go list -m to determine the replaced module's module path and - // directory, and then a go list -m {{with .Replace}}{{.Dir}}{{end}} - // from the main module to determine if that module is actually a replacement. - // See bcmills's comment here: https://github.com/golang/go/issues/37629#issuecomment-594179751 - // for more information. - out, err := state.invokeGo("list", "-m", "-json") - if err != nil { - return nil, err - } - m := map[string]string{} - type jsonMod struct{ Path, Dir string } - for dec := json.NewDecoder(out); dec.More(); { - mod := new(jsonMod) - if err := dec.Decode(mod); err != nil { - return nil, err - } - if mod.Dir != "" && mod.Path != "" { - // This is a valid module; add it to the map. - absDir, err := filepath.Abs(mod.Dir) - if err != nil { - return nil, err - } - m[absDir] = mod.Path - } - } - return m, nil -} - -func (state *golistState) determineRootDirsGOPATH() (map[string]string, error) { - m := map[string]string{} - for _, dir := range filepath.SplitList(state.mustGetEnv()["GOPATH"]) { - absDir, err := filepath.Abs(dir) - if err != nil { - return nil, err - } - m[filepath.Join(absDir, "src")] = "" - } - return m, nil -} - -func extractImports(filename string, contents []byte) ([]string, error) { - f, err := parser.ParseFile(token.NewFileSet(), filename, contents, parser.ImportsOnly) // TODO(matloob): reuse fileset? - if err != nil { - return nil, err - } - var res []string - for _, imp := range f.Imports { - quotedPath := imp.Path.Value - path, err := strconv.Unquote(quotedPath) - if err != nil { - return nil, err - } - res = append(res, path) - } - return res, nil -} - -// reclaimPackage attempts to reuse a package that failed to load in an overlay. -// -// If the package has errors and has no Name, GoFiles, or Imports, -// then it's possible that it doesn't yet exist on disk. -func reclaimPackage(pkg *Package, id string, filename string, contents []byte) bool { - // TODO(rstambler): Check the message of the actual error? - // It differs between $GOPATH and module mode. - if pkg.ID != id { - return false - } - if len(pkg.Errors) != 1 { - return false - } - if pkg.Name != "" || pkg.ExportFile != "" { - return false - } - if len(pkg.GoFiles) > 0 || len(pkg.CompiledGoFiles) > 0 || len(pkg.OtherFiles) > 0 { - return false - } - if len(pkg.Imports) > 0 { - return false - } - pkgName, ok := extractPackageName(filename, contents) - if !ok { - return false - } - pkg.Name = pkgName - pkg.Errors = nil - return true -} - -func extractPackageName(filename string, contents []byte) (string, bool) { - // TODO(rstambler): Check the message of the actual error? - // It differs between $GOPATH and module mode. - f, err := parser.ParseFile(token.NewFileSet(), filename, contents, parser.PackageClauseOnly) // TODO(matloob): reuse fileset? - if err != nil { - return "", false - } - return f.Name.Name, true -} - -func commonDir(a []string) string { - seen := make(map[string]bool) - x := append([]string{}, a...) - for _, f := range x { - seen[filepath.Dir(f)] = true - } - if len(seen) > 1 { - log.Fatalf("commonDir saw %v for %v", seen, x) - } - for k := range seen { - // len(seen) == 1 - return k - } - return "" // no files -} - -// It is possible that the files in the disk directory dir have a different package -// name from newName, which is deduced from the overlays. If they all have a different -// package name, and they all have the same package name, then that name becomes -// the package name. -// It returns true if it changes the package name, false otherwise. -func maybeFixPackageName(newName string, pkgOfDir map[string][]*Package, dir string) bool { - names := make(map[string]int) - for _, p := range pkgOfDir[dir] { - names[p.Name]++ - } - if len(names) != 1 { - // some files are in different packages - return false - } - oldName := "" - for k := range names { - oldName = k - } - if newName == oldName { - return false - } - for _, p := range pkgOfDir[dir] { - p.Name = newName - } - return true -} diff --git a/vendor/golang.org/x/tools/go/packages/loadmode_string.go b/vendor/golang.org/x/tools/go/packages/loadmode_string.go deleted file mode 100644 index 7ea37e7eea..0000000000 --- a/vendor/golang.org/x/tools/go/packages/loadmode_string.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -import ( - "fmt" - "strings" -) - -var allModes = []LoadMode{ - NeedName, - NeedFiles, - NeedCompiledGoFiles, - NeedImports, - NeedDeps, - NeedExportsFile, - NeedTypes, - NeedSyntax, - NeedTypesInfo, - NeedTypesSizes, -} - -var modeStrings = []string{ - "NeedName", - "NeedFiles", - "NeedCompiledGoFiles", - "NeedImports", - "NeedDeps", - "NeedExportsFile", - "NeedTypes", - "NeedSyntax", - "NeedTypesInfo", - "NeedTypesSizes", -} - -func (mod LoadMode) String() string { - m := mod - if m == 0 { - return "LoadMode(0)" - } - var out []string - for i, x := range allModes { - if x > m { - break - } - if (m & x) != 0 { - out = append(out, modeStrings[i]) - m = m ^ x - } - } - if m != 0 { - out = append(out, "Unknown") - } - return fmt.Sprintf("LoadMode(%s)", strings.Join(out, "|")) -} diff --git a/vendor/golang.org/x/tools/go/packages/packages.go b/vendor/golang.org/x/tools/go/packages/packages.go deleted file mode 100644 index 03fd999c0c..0000000000 --- a/vendor/golang.org/x/tools/go/packages/packages.go +++ /dev/null @@ -1,1159 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -// See doc.go for package documentation and implementation notes. - -import ( - "context" - "encoding/json" - "fmt" - "go/ast" - "go/parser" - "go/scanner" - "go/token" - "go/types" - "io/ioutil" - "log" - "os" - "path/filepath" - "strings" - "sync" - - "golang.org/x/tools/go/gcexportdata" - "golang.org/x/tools/internal/gocommand" - "golang.org/x/tools/internal/packagesinternal" -) - -// A LoadMode controls the amount of detail to return when loading. -// The bits below can be combined to specify which fields should be -// filled in the result packages. -// The zero value is a special case, equivalent to combining -// the NeedName, NeedFiles, and NeedCompiledGoFiles bits. -// ID and Errors (if present) will always be filled. -// Load may return more information than requested. -type LoadMode int - -// TODO(matloob): When a V2 of go/packages is released, rename NeedExportsFile to -// NeedExportFile to make it consistent with the Package field it's adding. - -const ( - // NeedName adds Name and PkgPath. - NeedName LoadMode = 1 << iota - - // NeedFiles adds GoFiles and OtherFiles. - NeedFiles - - // NeedCompiledGoFiles adds CompiledGoFiles. - NeedCompiledGoFiles - - // NeedImports adds Imports. If NeedDeps is not set, the Imports field will contain - // "placeholder" Packages with only the ID set. - NeedImports - - // NeedDeps adds the fields requested by the LoadMode in the packages in Imports. - NeedDeps - - // NeedExportsFile adds ExportFile. - NeedExportsFile - - // NeedTypes adds Types, Fset, and IllTyped. - NeedTypes - - // NeedSyntax adds Syntax. - NeedSyntax - - // NeedTypesInfo adds TypesInfo. - NeedTypesInfo - - // NeedTypesSizes adds TypesSizes. - NeedTypesSizes -) - -const ( - // Deprecated: LoadFiles exists for historical compatibility - // and should not be used. Please directly specify the needed fields using the Need values. - LoadFiles = NeedName | NeedFiles | NeedCompiledGoFiles - - // Deprecated: LoadImports exists for historical compatibility - // and should not be used. Please directly specify the needed fields using the Need values. - LoadImports = LoadFiles | NeedImports - - // Deprecated: LoadTypes exists for historical compatibility - // and should not be used. Please directly specify the needed fields using the Need values. - LoadTypes = LoadImports | NeedTypes | NeedTypesSizes - - // Deprecated: LoadSyntax exists for historical compatibility - // and should not be used. Please directly specify the needed fields using the Need values. - LoadSyntax = LoadTypes | NeedSyntax | NeedTypesInfo - - // Deprecated: LoadAllSyntax exists for historical compatibility - // and should not be used. Please directly specify the needed fields using the Need values. - LoadAllSyntax = LoadSyntax | NeedDeps -) - -// A Config specifies details about how packages should be loaded. -// The zero value is a valid configuration. -// Calls to Load do not modify this struct. -type Config struct { - // Mode controls the level of information returned for each package. - Mode LoadMode - - // Context specifies the context for the load operation. - // If the context is cancelled, the loader may stop early - // and return an ErrCancelled error. - // If Context is nil, the load cannot be cancelled. - Context context.Context - - // Logf is the logger for the config. - // If the user provides a logger, debug logging is enabled. - // If the GOPACKAGESDEBUG environment variable is set to true, - // but the logger is nil, default to log.Printf. - Logf func(format string, args ...interface{}) - - // Dir is the directory in which to run the build system's query tool - // that provides information about the packages. - // If Dir is empty, the tool is run in the current directory. - Dir string - - // Env is the environment to use when invoking the build system's query tool. - // If Env is nil, the current environment is used. - // As in os/exec's Cmd, only the last value in the slice for - // each environment key is used. To specify the setting of only - // a few variables, append to the current environment, as in: - // - // opt.Env = append(os.Environ(), "GOOS=plan9", "GOARCH=386") - // - Env []string - - // gocmdRunner guards go command calls from concurrency errors. - gocmdRunner *gocommand.Runner - - // BuildFlags is a list of command-line flags to be passed through to - // the build system's query tool. - BuildFlags []string - - // Fset provides source position information for syntax trees and types. - // If Fset is nil, Load will use a new fileset, but preserve Fset's value. - Fset *token.FileSet - - // ParseFile is called to read and parse each file - // when preparing a package's type-checked syntax tree. - // It must be safe to call ParseFile simultaneously from multiple goroutines. - // If ParseFile is nil, the loader will uses parser.ParseFile. - // - // ParseFile should parse the source from src and use filename only for - // recording position information. - // - // An application may supply a custom implementation of ParseFile - // to change the effective file contents or the behavior of the parser, - // or to modify the syntax tree. For example, selectively eliminating - // unwanted function bodies can significantly accelerate type checking. - ParseFile func(fset *token.FileSet, filename string, src []byte) (*ast.File, error) - - // If Tests is set, the loader includes not just the packages - // matching a particular pattern but also any related test packages, - // including test-only variants of the package and the test executable. - // - // For example, when using the go command, loading "fmt" with Tests=true - // returns four packages, with IDs "fmt" (the standard package), - // "fmt [fmt.test]" (the package as compiled for the test), - // "fmt_test" (the test functions from source files in package fmt_test), - // and "fmt.test" (the test binary). - // - // In build systems with explicit names for tests, - // setting Tests may have no effect. - Tests bool - - // Overlay provides a mapping of absolute file paths to file contents. - // If the file with the given path already exists, the parser will use the - // alternative file contents provided by the map. - // - // Overlays provide incomplete support for when a given file doesn't - // already exist on disk. See the package doc above for more details. - Overlay map[string][]byte -} - -// driver is the type for functions that query the build system for the -// packages named by the patterns. -type driver func(cfg *Config, patterns ...string) (*driverResponse, error) - -// driverResponse contains the results for a driver query. -type driverResponse struct { - // Sizes, if not nil, is the types.Sizes to use when type checking. - Sizes *types.StdSizes - - // Roots is the set of package IDs that make up the root packages. - // We have to encode this separately because when we encode a single package - // we cannot know if it is one of the roots as that requires knowledge of the - // graph it is part of. - Roots []string `json:",omitempty"` - - // Packages is the full set of packages in the graph. - // The packages are not connected into a graph. - // The Imports if populated will be stubs that only have their ID set. - // Imports will be connected and then type and syntax information added in a - // later pass (see refine). - Packages []*Package -} - -// Load loads and returns the Go packages named by the given patterns. -// -// Config specifies loading options; -// nil behaves the same as an empty Config. -// -// Load returns an error if any of the patterns was invalid -// as defined by the underlying build system. -// It may return an empty list of packages without an error, -// for instance for an empty expansion of a valid wildcard. -// Errors associated with a particular package are recorded in the -// corresponding Package's Errors list, and do not cause Load to -// return an error. Clients may need to handle such errors before -// proceeding with further analysis. The PrintErrors function is -// provided for convenient display of all errors. -func Load(cfg *Config, patterns ...string) ([]*Package, error) { - l := newLoader(cfg) - response, err := defaultDriver(&l.Config, patterns...) - if err != nil { - return nil, err - } - l.sizes = response.Sizes - return l.refine(response.Roots, response.Packages...) -} - -// defaultDriver is a driver that looks for an external driver binary, and if -// it does not find it falls back to the built in go list driver. -func defaultDriver(cfg *Config, patterns ...string) (*driverResponse, error) { - driver := findExternalDriver(cfg) - if driver == nil { - driver = goListDriver - } - return driver(cfg, patterns...) -} - -// A Package describes a loaded Go package. -type Package struct { - // ID is a unique identifier for a package, - // in a syntax provided by the underlying build system. - // - // Because the syntax varies based on the build system, - // clients should treat IDs as opaque and not attempt to - // interpret them. - ID string - - // Name is the package name as it appears in the package source code. - Name string - - // PkgPath is the package path as used by the go/types package. - PkgPath string - - // Errors contains any errors encountered querying the metadata - // of the package, or while parsing or type-checking its files. - Errors []Error - - // GoFiles lists the absolute file paths of the package's Go source files. - GoFiles []string - - // CompiledGoFiles lists the absolute file paths of the package's source - // files that were presented to the compiler. - // This may differ from GoFiles if files are processed before compilation. - CompiledGoFiles []string - - // OtherFiles lists the absolute file paths of the package's non-Go source files, - // including assembly, C, C++, Fortran, Objective-C, SWIG, and so on. - OtherFiles []string - - // ExportFile is the absolute path to a file containing type - // information for the package as provided by the build system. - ExportFile string - - // Imports maps import paths appearing in the package's Go source files - // to corresponding loaded Packages. - Imports map[string]*Package - - // Types provides type information for the package. - // The NeedTypes LoadMode bit sets this field for packages matching the - // patterns; type information for dependencies may be missing or incomplete, - // unless NeedDeps and NeedImports are also set. - Types *types.Package - - // Fset provides position information for Types, TypesInfo, and Syntax. - // It is set only when Types is set. - Fset *token.FileSet - - // IllTyped indicates whether the package or any dependency contains errors. - // It is set only when Types is set. - IllTyped bool - - // Syntax is the package's syntax trees, for the files listed in CompiledGoFiles. - // - // The NeedSyntax LoadMode bit populates this field for packages matching the patterns. - // If NeedDeps and NeedImports are also set, this field will also be populated - // for dependencies. - Syntax []*ast.File - - // TypesInfo provides type information about the package's syntax trees. - // It is set only when Syntax is set. - TypesInfo *types.Info - - // TypesSizes provides the effective size function for types in TypesInfo. - TypesSizes types.Sizes - - // forTest is the package under test, if any. - forTest string - - // module is the module information for the package if it exists. - module *packagesinternal.Module -} - -func init() { - packagesinternal.GetForTest = func(p interface{}) string { - return p.(*Package).forTest - } - packagesinternal.GetModule = func(p interface{}) *packagesinternal.Module { - return p.(*Package).module - } - packagesinternal.GetGoCmdRunner = func(config interface{}) *gocommand.Runner { - return config.(*Config).gocmdRunner - } - packagesinternal.SetGoCmdRunner = func(config interface{}, runner *gocommand.Runner) { - config.(*Config).gocmdRunner = runner - } -} - -// An Error describes a problem with a package's metadata, syntax, or types. -type Error struct { - Pos string // "file:line:col" or "file:line" or "" or "-" - Msg string - Kind ErrorKind -} - -// ErrorKind describes the source of the error, allowing the user to -// differentiate between errors generated by the driver, the parser, or the -// type-checker. -type ErrorKind int - -const ( - UnknownError ErrorKind = iota - ListError - ParseError - TypeError -) - -func (err Error) Error() string { - pos := err.Pos - if pos == "" { - pos = "-" // like token.Position{}.String() - } - return pos + ": " + err.Msg -} - -// flatPackage is the JSON form of Package -// It drops all the type and syntax fields, and transforms the Imports -// -// TODO(adonovan): identify this struct with Package, effectively -// publishing the JSON protocol. -type flatPackage struct { - ID string - Name string `json:",omitempty"` - PkgPath string `json:",omitempty"` - Errors []Error `json:",omitempty"` - GoFiles []string `json:",omitempty"` - CompiledGoFiles []string `json:",omitempty"` - OtherFiles []string `json:",omitempty"` - ExportFile string `json:",omitempty"` - Imports map[string]string `json:",omitempty"` -} - -// MarshalJSON returns the Package in its JSON form. -// For the most part, the structure fields are written out unmodified, and -// the type and syntax fields are skipped. -// The imports are written out as just a map of path to package id. -// The errors are written using a custom type that tries to preserve the -// structure of error types we know about. -// -// This method exists to enable support for additional build systems. It is -// not intended for use by clients of the API and we may change the format. -func (p *Package) MarshalJSON() ([]byte, error) { - flat := &flatPackage{ - ID: p.ID, - Name: p.Name, - PkgPath: p.PkgPath, - Errors: p.Errors, - GoFiles: p.GoFiles, - CompiledGoFiles: p.CompiledGoFiles, - OtherFiles: p.OtherFiles, - ExportFile: p.ExportFile, - } - if len(p.Imports) > 0 { - flat.Imports = make(map[string]string, len(p.Imports)) - for path, ipkg := range p.Imports { - flat.Imports[path] = ipkg.ID - } - } - return json.Marshal(flat) -} - -// UnmarshalJSON reads in a Package from its JSON format. -// See MarshalJSON for details about the format accepted. -func (p *Package) UnmarshalJSON(b []byte) error { - flat := &flatPackage{} - if err := json.Unmarshal(b, &flat); err != nil { - return err - } - *p = Package{ - ID: flat.ID, - Name: flat.Name, - PkgPath: flat.PkgPath, - Errors: flat.Errors, - GoFiles: flat.GoFiles, - CompiledGoFiles: flat.CompiledGoFiles, - OtherFiles: flat.OtherFiles, - ExportFile: flat.ExportFile, - } - if len(flat.Imports) > 0 { - p.Imports = make(map[string]*Package, len(flat.Imports)) - for path, id := range flat.Imports { - p.Imports[path] = &Package{ID: id} - } - } - return nil -} - -func (p *Package) String() string { return p.ID } - -// loaderPackage augments Package with state used during the loading phase -type loaderPackage struct { - *Package - importErrors map[string]error // maps each bad import to its error - loadOnce sync.Once - color uint8 // for cycle detection - needsrc bool // load from source (Mode >= LoadTypes) - needtypes bool // type information is either requested or depended on - initial bool // package was matched by a pattern -} - -// loader holds the working state of a single call to load. -type loader struct { - pkgs map[string]*loaderPackage - Config - sizes types.Sizes - parseCache map[string]*parseValue - parseCacheMu sync.Mutex - exportMu sync.Mutex // enforces mutual exclusion of exportdata operations - - // Config.Mode contains the implied mode (see impliedLoadMode). - // Implied mode contains all the fields we need the data for. - // In requestedMode there are the actually requested fields. - // We'll zero them out before returning packages to the user. - // This makes it easier for us to get the conditions where - // we need certain modes right. - requestedMode LoadMode -} - -type parseValue struct { - f *ast.File - err error - ready chan struct{} -} - -func newLoader(cfg *Config) *loader { - ld := &loader{ - parseCache: map[string]*parseValue{}, - } - if cfg != nil { - ld.Config = *cfg - // If the user has provided a logger, use it. - ld.Config.Logf = cfg.Logf - } - if ld.Config.Logf == nil { - // If the GOPACKAGESDEBUG environment variable is set to true, - // but the user has not provided a logger, default to log.Printf. - if debug { - ld.Config.Logf = log.Printf - } else { - ld.Config.Logf = func(format string, args ...interface{}) {} - } - } - if ld.Config.Mode == 0 { - ld.Config.Mode = NeedName | NeedFiles | NeedCompiledGoFiles // Preserve zero behavior of Mode for backwards compatibility. - } - if ld.Config.Env == nil { - ld.Config.Env = os.Environ() - } - if ld.Config.gocmdRunner == nil { - ld.Config.gocmdRunner = &gocommand.Runner{} - } - if ld.Context == nil { - ld.Context = context.Background() - } - if ld.Dir == "" { - if dir, err := os.Getwd(); err == nil { - ld.Dir = dir - } - } - - // Save the actually requested fields. We'll zero them out before returning packages to the user. - ld.requestedMode = ld.Mode - ld.Mode = impliedLoadMode(ld.Mode) - - if ld.Mode&NeedTypes != 0 || ld.Mode&NeedSyntax != 0 { - if ld.Fset == nil { - ld.Fset = token.NewFileSet() - } - - // ParseFile is required even in LoadTypes mode - // because we load source if export data is missing. - if ld.ParseFile == nil { - ld.ParseFile = func(fset *token.FileSet, filename string, src []byte) (*ast.File, error) { - const mode = parser.AllErrors | parser.ParseComments - return parser.ParseFile(fset, filename, src, mode) - } - } - } - - return ld -} - -// refine connects the supplied packages into a graph and then adds type and -// and syntax information as requested by the LoadMode. -func (ld *loader) refine(roots []string, list ...*Package) ([]*Package, error) { - rootMap := make(map[string]int, len(roots)) - for i, root := range roots { - rootMap[root] = i - } - ld.pkgs = make(map[string]*loaderPackage) - // first pass, fixup and build the map and roots - var initial = make([]*loaderPackage, len(roots)) - for _, pkg := range list { - rootIndex := -1 - if i, found := rootMap[pkg.ID]; found { - rootIndex = i - } - - // Overlays can invalidate export data. - // TODO(matloob): make this check fine-grained based on dependencies on overlaid files - exportDataInvalid := len(ld.Overlay) > 0 || pkg.ExportFile == "" && pkg.PkgPath != "unsafe" - // This package needs type information if the caller requested types and the package is - // either a root, or it's a non-root and the user requested dependencies ... - needtypes := (ld.Mode&NeedTypes|NeedTypesInfo != 0 && (rootIndex >= 0 || ld.Mode&NeedDeps != 0)) - // This package needs source if the call requested source (or types info, which implies source) - // and the package is either a root, or itas a non- root and the user requested dependencies... - needsrc := ((ld.Mode&(NeedSyntax|NeedTypesInfo) != 0 && (rootIndex >= 0 || ld.Mode&NeedDeps != 0)) || - // ... or if we need types and the exportData is invalid. We fall back to (incompletely) - // typechecking packages from source if they fail to compile. - (ld.Mode&NeedTypes|NeedTypesInfo != 0 && exportDataInvalid)) && pkg.PkgPath != "unsafe" - lpkg := &loaderPackage{ - Package: pkg, - needtypes: needtypes, - needsrc: needsrc, - } - ld.pkgs[lpkg.ID] = lpkg - if rootIndex >= 0 { - initial[rootIndex] = lpkg - lpkg.initial = true - } - } - for i, root := range roots { - if initial[i] == nil { - return nil, fmt.Errorf("root package %v is missing", root) - } - } - - // Materialize the import graph. - - const ( - white = 0 // new - grey = 1 // in progress - black = 2 // complete - ) - - // visit traverses the import graph, depth-first, - // and materializes the graph as Packages.Imports. - // - // Valid imports are saved in the Packages.Import map. - // Invalid imports (cycles and missing nodes) are saved in the importErrors map. - // Thus, even in the presence of both kinds of errors, the Import graph remains a DAG. - // - // visit returns whether the package needs src or has a transitive - // dependency on a package that does. These are the only packages - // for which we load source code. - var stack []*loaderPackage - var visit func(lpkg *loaderPackage) bool - var srcPkgs []*loaderPackage - visit = func(lpkg *loaderPackage) bool { - switch lpkg.color { - case black: - return lpkg.needsrc - case grey: - panic("internal error: grey node") - } - lpkg.color = grey - stack = append(stack, lpkg) // push - stubs := lpkg.Imports // the structure form has only stubs with the ID in the Imports - // If NeedImports isn't set, the imports fields will all be zeroed out. - if ld.Mode&NeedImports != 0 { - lpkg.Imports = make(map[string]*Package, len(stubs)) - for importPath, ipkg := range stubs { - var importErr error - imp := ld.pkgs[ipkg.ID] - if imp == nil { - // (includes package "C" when DisableCgo) - importErr = fmt.Errorf("missing package: %q", ipkg.ID) - } else if imp.color == grey { - importErr = fmt.Errorf("import cycle: %s", stack) - } - if importErr != nil { - if lpkg.importErrors == nil { - lpkg.importErrors = make(map[string]error) - } - lpkg.importErrors[importPath] = importErr - continue - } - - if visit(imp) { - lpkg.needsrc = true - } - lpkg.Imports[importPath] = imp.Package - } - } - if lpkg.needsrc { - srcPkgs = append(srcPkgs, lpkg) - } - if ld.Mode&NeedTypesSizes != 0 { - lpkg.TypesSizes = ld.sizes - } - stack = stack[:len(stack)-1] // pop - lpkg.color = black - - return lpkg.needsrc - } - - if ld.Mode&NeedImports == 0 { - // We do this to drop the stub import packages that we are not even going to try to resolve. - for _, lpkg := range initial { - lpkg.Imports = nil - } - } else { - // For each initial package, create its import DAG. - for _, lpkg := range initial { - visit(lpkg) - } - } - if ld.Mode&NeedImports != 0 && ld.Mode&NeedTypes != 0 { - for _, lpkg := range srcPkgs { - // Complete type information is required for the - // immediate dependencies of each source package. - for _, ipkg := range lpkg.Imports { - imp := ld.pkgs[ipkg.ID] - imp.needtypes = true - } - } - } - // Load type data and syntax if needed, starting at - // the initial packages (roots of the import DAG). - if ld.Mode&NeedTypes != 0 || ld.Mode&NeedSyntax != 0 { - var wg sync.WaitGroup - for _, lpkg := range initial { - wg.Add(1) - go func(lpkg *loaderPackage) { - ld.loadRecursive(lpkg) - wg.Done() - }(lpkg) - } - wg.Wait() - } - - result := make([]*Package, len(initial)) - for i, lpkg := range initial { - result[i] = lpkg.Package - } - for i := range ld.pkgs { - // Clear all unrequested fields, for extra de-Hyrum-ization. - if ld.requestedMode&NeedName == 0 { - ld.pkgs[i].Name = "" - ld.pkgs[i].PkgPath = "" - } - if ld.requestedMode&NeedFiles == 0 { - ld.pkgs[i].GoFiles = nil - ld.pkgs[i].OtherFiles = nil - } - if ld.requestedMode&NeedCompiledGoFiles == 0 { - ld.pkgs[i].CompiledGoFiles = nil - } - if ld.requestedMode&NeedImports == 0 { - ld.pkgs[i].Imports = nil - } - if ld.requestedMode&NeedExportsFile == 0 { - ld.pkgs[i].ExportFile = "" - } - if ld.requestedMode&NeedTypes == 0 { - ld.pkgs[i].Types = nil - ld.pkgs[i].Fset = nil - ld.pkgs[i].IllTyped = false - } - if ld.requestedMode&NeedSyntax == 0 { - ld.pkgs[i].Syntax = nil - } - if ld.requestedMode&NeedTypesInfo == 0 { - ld.pkgs[i].TypesInfo = nil - } - if ld.requestedMode&NeedTypesSizes == 0 { - ld.pkgs[i].TypesSizes = nil - } - } - - return result, nil -} - -// loadRecursive loads the specified package and its dependencies, -// recursively, in parallel, in topological order. -// It is atomic and idempotent. -// Precondition: ld.Mode&NeedTypes. -func (ld *loader) loadRecursive(lpkg *loaderPackage) { - lpkg.loadOnce.Do(func() { - // Load the direct dependencies, in parallel. - var wg sync.WaitGroup - for _, ipkg := range lpkg.Imports { - imp := ld.pkgs[ipkg.ID] - wg.Add(1) - go func(imp *loaderPackage) { - ld.loadRecursive(imp) - wg.Done() - }(imp) - } - wg.Wait() - ld.loadPackage(lpkg) - }) -} - -// loadPackage loads the specified package. -// It must be called only once per Package, -// after immediate dependencies are loaded. -// Precondition: ld.Mode & NeedTypes. -func (ld *loader) loadPackage(lpkg *loaderPackage) { - if lpkg.PkgPath == "unsafe" { - // Fill in the blanks to avoid surprises. - lpkg.Types = types.Unsafe - lpkg.Fset = ld.Fset - lpkg.Syntax = []*ast.File{} - lpkg.TypesInfo = new(types.Info) - lpkg.TypesSizes = ld.sizes - return - } - - // Call NewPackage directly with explicit name. - // This avoids skew between golist and go/types when the files' - // package declarations are inconsistent. - lpkg.Types = types.NewPackage(lpkg.PkgPath, lpkg.Name) - lpkg.Fset = ld.Fset - - // Subtle: we populate all Types fields with an empty Package - // before loading export data so that export data processing - // never has to create a types.Package for an indirect dependency, - // which would then require that such created packages be explicitly - // inserted back into the Import graph as a final step after export data loading. - // The Diamond test exercises this case. - if !lpkg.needtypes && !lpkg.needsrc { - return - } - if !lpkg.needsrc { - ld.loadFromExportData(lpkg) - return // not a source package, don't get syntax trees - } - - appendError := func(err error) { - // Convert various error types into the one true Error. - var errs []Error - switch err := err.(type) { - case Error: - // from driver - errs = append(errs, err) - - case *os.PathError: - // from parser - errs = append(errs, Error{ - Pos: err.Path + ":1", - Msg: err.Err.Error(), - Kind: ParseError, - }) - - case scanner.ErrorList: - // from parser - for _, err := range err { - errs = append(errs, Error{ - Pos: err.Pos.String(), - Msg: err.Msg, - Kind: ParseError, - }) - } - - case types.Error: - // from type checker - errs = append(errs, Error{ - Pos: err.Fset.Position(err.Pos).String(), - Msg: err.Msg, - Kind: TypeError, - }) - - default: - // unexpected impoverished error from parser? - errs = append(errs, Error{ - Pos: "-", - Msg: err.Error(), - Kind: UnknownError, - }) - - // If you see this error message, please file a bug. - log.Printf("internal error: error %q (%T) without position", err, err) - } - - lpkg.Errors = append(lpkg.Errors, errs...) - } - - if ld.Config.Mode&NeedTypes != 0 && len(lpkg.CompiledGoFiles) == 0 && lpkg.ExportFile != "" { - // The config requested loading sources and types, but sources are missing. - // Add an error to the package and fall back to loading from export data. - appendError(Error{"-", fmt.Sprintf("sources missing for package %s", lpkg.ID), ParseError}) - ld.loadFromExportData(lpkg) - return // can't get syntax trees for this package - } - - files, errs := ld.parseFiles(lpkg.CompiledGoFiles) - for _, err := range errs { - appendError(err) - } - - lpkg.Syntax = files - if ld.Config.Mode&NeedTypes == 0 { - return - } - - lpkg.TypesInfo = &types.Info{ - Types: make(map[ast.Expr]types.TypeAndValue), - Defs: make(map[*ast.Ident]types.Object), - Uses: make(map[*ast.Ident]types.Object), - Implicits: make(map[ast.Node]types.Object), - Scopes: make(map[ast.Node]*types.Scope), - Selections: make(map[*ast.SelectorExpr]*types.Selection), - } - lpkg.TypesSizes = ld.sizes - - importer := importerFunc(func(path string) (*types.Package, error) { - if path == "unsafe" { - return types.Unsafe, nil - } - - // The imports map is keyed by import path. - ipkg := lpkg.Imports[path] - if ipkg == nil { - if err := lpkg.importErrors[path]; err != nil { - return nil, err - } - // There was skew between the metadata and the - // import declarations, likely due to an edit - // race, or because the ParseFile feature was - // used to supply alternative file contents. - return nil, fmt.Errorf("no metadata for %s", path) - } - - if ipkg.Types != nil && ipkg.Types.Complete() { - return ipkg.Types, nil - } - log.Fatalf("internal error: package %q without types was imported from %q", path, lpkg) - panic("unreachable") - }) - - // type-check - tc := &types.Config{ - Importer: importer, - - // Type-check bodies of functions only in non-initial packages. - // Example: for import graph A->B->C and initial packages {A,C}, - // we can ignore function bodies in B. - IgnoreFuncBodies: ld.Mode&NeedDeps == 0 && !lpkg.initial, - - Error: appendError, - Sizes: ld.sizes, - } - types.NewChecker(tc, ld.Fset, lpkg.Types, lpkg.TypesInfo).Files(lpkg.Syntax) - - lpkg.importErrors = nil // no longer needed - - // If !Cgo, the type-checker uses FakeImportC mode, so - // it doesn't invoke the importer for import "C", - // nor report an error for the import, - // or for any undefined C.f reference. - // We must detect this explicitly and correctly - // mark the package as IllTyped (by reporting an error). - // TODO(adonovan): if these errors are annoying, - // we could just set IllTyped quietly. - if tc.FakeImportC { - outer: - for _, f := range lpkg.Syntax { - for _, imp := range f.Imports { - if imp.Path.Value == `"C"` { - err := types.Error{Fset: ld.Fset, Pos: imp.Pos(), Msg: `import "C" ignored`} - appendError(err) - break outer - } - } - } - } - - // Record accumulated errors. - illTyped := len(lpkg.Errors) > 0 - if !illTyped { - for _, imp := range lpkg.Imports { - if imp.IllTyped { - illTyped = true - break - } - } - } - lpkg.IllTyped = illTyped -} - -// An importFunc is an implementation of the single-method -// types.Importer interface based on a function value. -type importerFunc func(path string) (*types.Package, error) - -func (f importerFunc) Import(path string) (*types.Package, error) { return f(path) } - -// We use a counting semaphore to limit -// the number of parallel I/O calls per process. -var ioLimit = make(chan bool, 20) - -func (ld *loader) parseFile(filename string) (*ast.File, error) { - ld.parseCacheMu.Lock() - v, ok := ld.parseCache[filename] - if ok { - // cache hit - ld.parseCacheMu.Unlock() - <-v.ready - } else { - // cache miss - v = &parseValue{ready: make(chan struct{})} - ld.parseCache[filename] = v - ld.parseCacheMu.Unlock() - - var src []byte - for f, contents := range ld.Config.Overlay { - if sameFile(f, filename) { - src = contents - } - } - var err error - if src == nil { - ioLimit <- true // wait - src, err = ioutil.ReadFile(filename) - <-ioLimit // signal - } - if err != nil { - v.err = err - } else { - v.f, v.err = ld.ParseFile(ld.Fset, filename, src) - } - - close(v.ready) - } - return v.f, v.err -} - -// parseFiles reads and parses the Go source files and returns the ASTs -// of the ones that could be at least partially parsed, along with a -// list of I/O and parse errors encountered. -// -// Because files are scanned in parallel, the token.Pos -// positions of the resulting ast.Files are not ordered. -// -func (ld *loader) parseFiles(filenames []string) ([]*ast.File, []error) { - var wg sync.WaitGroup - n := len(filenames) - parsed := make([]*ast.File, n) - errors := make([]error, n) - for i, file := range filenames { - if ld.Config.Context.Err() != nil { - parsed[i] = nil - errors[i] = ld.Config.Context.Err() - continue - } - wg.Add(1) - go func(i int, filename string) { - parsed[i], errors[i] = ld.parseFile(filename) - wg.Done() - }(i, file) - } - wg.Wait() - - // Eliminate nils, preserving order. - var o int - for _, f := range parsed { - if f != nil { - parsed[o] = f - o++ - } - } - parsed = parsed[:o] - - o = 0 - for _, err := range errors { - if err != nil { - errors[o] = err - o++ - } - } - errors = errors[:o] - - return parsed, errors -} - -// sameFile returns true if x and y have the same basename and denote -// the same file. -// -func sameFile(x, y string) bool { - if x == y { - // It could be the case that y doesn't exist. - // For instance, it may be an overlay file that - // hasn't been written to disk. To handle that case - // let x == y through. (We added the exact absolute path - // string to the CompiledGoFiles list, so the unwritten - // overlay case implies x==y.) - return true - } - if strings.EqualFold(filepath.Base(x), filepath.Base(y)) { // (optimisation) - if xi, err := os.Stat(x); err == nil { - if yi, err := os.Stat(y); err == nil { - return os.SameFile(xi, yi) - } - } - } - return false -} - -// loadFromExportData returns type information for the specified -// package, loading it from an export data file on the first request. -func (ld *loader) loadFromExportData(lpkg *loaderPackage) (*types.Package, error) { - if lpkg.PkgPath == "" { - log.Fatalf("internal error: Package %s has no PkgPath", lpkg) - } - - // Because gcexportdata.Read has the potential to create or - // modify the types.Package for each node in the transitive - // closure of dependencies of lpkg, all exportdata operations - // must be sequential. (Finer-grained locking would require - // changes to the gcexportdata API.) - // - // The exportMu lock guards the Package.Pkg field and the - // types.Package it points to, for each Package in the graph. - // - // Not all accesses to Package.Pkg need to be protected by exportMu: - // graph ordering ensures that direct dependencies of source - // packages are fully loaded before the importer reads their Pkg field. - ld.exportMu.Lock() - defer ld.exportMu.Unlock() - - if tpkg := lpkg.Types; tpkg != nil && tpkg.Complete() { - return tpkg, nil // cache hit - } - - lpkg.IllTyped = true // fail safe - - if lpkg.ExportFile == "" { - // Errors while building export data will have been printed to stderr. - return nil, fmt.Errorf("no export data file") - } - f, err := os.Open(lpkg.ExportFile) - if err != nil { - return nil, err - } - defer f.Close() - - // Read gc export data. - // - // We don't currently support gccgo export data because all - // underlying workspaces use the gc toolchain. (Even build - // systems that support gccgo don't use it for workspace - // queries.) - r, err := gcexportdata.NewReader(f) - if err != nil { - return nil, fmt.Errorf("reading %s: %v", lpkg.ExportFile, err) - } - - // Build the view. - // - // The gcexportdata machinery has no concept of package ID. - // It identifies packages by their PkgPath, which although not - // globally unique is unique within the scope of one invocation - // of the linker, type-checker, or gcexportdata. - // - // So, we must build a PkgPath-keyed view of the global - // (conceptually ID-keyed) cache of packages and pass it to - // gcexportdata. The view must contain every existing - // package that might possibly be mentioned by the - // current package---its transitive closure. - // - // In loadPackage, we unconditionally create a types.Package for - // each dependency so that export data loading does not - // create new ones. - // - // TODO(adonovan): it would be simpler and more efficient - // if the export data machinery invoked a callback to - // get-or-create a package instead of a map. - // - view := make(map[string]*types.Package) // view seen by gcexportdata - seen := make(map[*loaderPackage]bool) // all visited packages - var visit func(pkgs map[string]*Package) - visit = func(pkgs map[string]*Package) { - for _, p := range pkgs { - lpkg := ld.pkgs[p.ID] - if !seen[lpkg] { - seen[lpkg] = true - view[lpkg.PkgPath] = lpkg.Types - visit(lpkg.Imports) - } - } - } - visit(lpkg.Imports) - - viewLen := len(view) + 1 // adding the self package - // Parse the export data. - // (May modify incomplete packages in view but not create new ones.) - tpkg, err := gcexportdata.Read(r, ld.Fset, view, lpkg.PkgPath) - if err != nil { - return nil, fmt.Errorf("reading %s: %v", lpkg.ExportFile, err) - } - if viewLen != len(view) { - log.Fatalf("Unexpected package creation during export data loading") - } - - lpkg.Types = tpkg - lpkg.IllTyped = false - - return tpkg, nil -} - -// impliedLoadMode returns loadMode with its dependencies. -func impliedLoadMode(loadMode LoadMode) LoadMode { - if loadMode&NeedTypesInfo != 0 && loadMode&NeedImports == 0 { - // If NeedTypesInfo, go/packages needs to do typechecking itself so it can - // associate type info with the AST. To do so, we need the export data - // for dependencies, which means we need to ask for the direct dependencies. - // NeedImports is used to ask for the direct dependencies. - loadMode |= NeedImports - } - - if loadMode&NeedDeps != 0 && loadMode&NeedImports == 0 { - // With NeedDeps we need to load at least direct dependencies. - // NeedImports is used to ask for the direct dependencies. - loadMode |= NeedImports - } - - return loadMode -} - -func usesExportData(cfg *Config) bool { - return cfg.Mode&NeedExportsFile != 0 || cfg.Mode&NeedTypes != 0 && cfg.Mode&NeedDeps == 0 -} diff --git a/vendor/golang.org/x/tools/go/packages/visit.go b/vendor/golang.org/x/tools/go/packages/visit.go deleted file mode 100644 index b13cb081fc..0000000000 --- a/vendor/golang.org/x/tools/go/packages/visit.go +++ /dev/null @@ -1,55 +0,0 @@ -package packages - -import ( - "fmt" - "os" - "sort" -) - -// Visit visits all the packages in the import graph whose roots are -// pkgs, calling the optional pre function the first time each package -// is encountered (preorder), and the optional post function after a -// package's dependencies have been visited (postorder). -// The boolean result of pre(pkg) determines whether -// the imports of package pkg are visited. -func Visit(pkgs []*Package, pre func(*Package) bool, post func(*Package)) { - seen := make(map[*Package]bool) - var visit func(*Package) - visit = func(pkg *Package) { - if !seen[pkg] { - seen[pkg] = true - - if pre == nil || pre(pkg) { - paths := make([]string, 0, len(pkg.Imports)) - for path := range pkg.Imports { - paths = append(paths, path) - } - sort.Strings(paths) // Imports is a map, this makes visit stable - for _, path := range paths { - visit(pkg.Imports[path]) - } - } - - if post != nil { - post(pkg) - } - } - } - for _, pkg := range pkgs { - visit(pkg) - } -} - -// PrintErrors prints to os.Stderr the accumulated errors of all -// packages in the import graph rooted at pkgs, dependencies first. -// PrintErrors returns the number of errors printed. -func PrintErrors(pkgs []*Package) int { - var n int - Visit(pkgs, nil, func(pkg *Package) { - for _, err := range pkg.Errors { - fmt.Fprintln(os.Stderr, err) - n++ - } - }) - return n -} diff --git a/vendor/golang.org/x/tools/internal/event/core/event.go b/vendor/golang.org/x/tools/internal/event/core/event.go deleted file mode 100644 index 29f293e62d..0000000000 --- a/vendor/golang.org/x/tools/internal/event/core/event.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package core provides support for event based telemetry. -package core - -import ( - "fmt" - "time" - - "golang.org/x/tools/internal/event/label" -) - -type eventType uint8 - -const ( - invalidType = eventType(iota) - LogType // an event that should be recorded in a log - StartSpanType // the start of a span of time - EndSpanType // the end of a span of time - LabelType // some values that should be noted for later events - DetachType // an event that causes a context to detach - RecordType // a value that should be tracked -) - -// Event holds the information about an event of note that ocurred. -type Event struct { - at time.Time - - typ eventType - - // As events are often on the stack, storing the first few labels directly - // in the event can avoid an allocation at all for the very common cases of - // simple events. - // The length needs to be large enough to cope with the majority of events - // but no so large as to cause undue stack pressure. - // A log message with two values will use 3 labels (one for each value and - // one for the message itself). - - static [3]label.Label // inline storage for the first few labels - dynamic []label.Label // dynamically sized storage for remaining labels -} - -// eventLabelMap implements label.Map for a the labels of an Event. -type eventLabelMap struct { - event Event -} - -func (ev Event) At() time.Time { return ev.at } - -func (ev Event) IsLog() bool { return ev.typ == LogType } -func (ev Event) IsEndSpan() bool { return ev.typ == EndSpanType } -func (ev Event) IsStartSpan() bool { return ev.typ == StartSpanType } -func (ev Event) IsLabel() bool { return ev.typ == LabelType } -func (ev Event) IsDetach() bool { return ev.typ == DetachType } -func (ev Event) IsRecord() bool { return ev.typ == RecordType } - -func (ev Event) Format(f fmt.State, r rune) { - if !ev.at.IsZero() { - fmt.Fprint(f, ev.at.Format("2006/01/02 15:04:05 ")) - } - for index := 0; ev.Valid(index); index++ { - l := ev.Label(index) - fmt.Fprintf(f, "\n\t%v", l) - } -} - -func (ev Event) Valid(index int) bool { - return index >= 0 && index < len(ev.static)+len(ev.dynamic) -} - -func (ev Event) Label(index int) label.Label { - if index < len(ev.static) { - return ev.static[index] - } - return ev.dynamic[index-len(ev.static)] -} - -func (ev Event) Find(key label.Key) label.Label { - for _, l := range ev.static { - if l.Key() == key { - return l - } - } - for _, l := range ev.dynamic { - if l.Key() == key { - return l - } - } - return label.Label{} -} - -func MakeEvent(typ eventType, static [3]label.Label, labels []label.Label) Event { - return Event{ - typ: typ, - static: static, - dynamic: labels, - } -} - -// CloneEvent event returns a copy of the event with the time adjusted to at. -func CloneEvent(ev Event, at time.Time) Event { - ev.at = at - return ev -} diff --git a/vendor/golang.org/x/tools/internal/event/core/export.go b/vendor/golang.org/x/tools/internal/event/core/export.go deleted file mode 100644 index 05f3a9a579..0000000000 --- a/vendor/golang.org/x/tools/internal/event/core/export.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package core - -import ( - "context" - "sync/atomic" - "time" - "unsafe" - - "golang.org/x/tools/internal/event/label" -) - -// Exporter is a function that handles events. -// It may return a modified context and event. -type Exporter func(context.Context, Event, label.Map) context.Context - -var ( - exporter unsafe.Pointer -) - -// SetExporter sets the global exporter function that handles all events. -// The exporter is called synchronously from the event call site, so it should -// return quickly so as not to hold up user code. -func SetExporter(e Exporter) { - p := unsafe.Pointer(&e) - if e == nil { - // &e is always valid, and so p is always valid, but for the early abort - // of ProcessEvent to be efficient it needs to make the nil check on the - // pointer without having to dereference it, so we make the nil function - // also a nil pointer - p = nil - } - atomic.StorePointer(&exporter, p) -} - -// deliver is called to deliver an event to the supplied exporter. -// it will fill in the time. -func deliver(ctx context.Context, exporter Exporter, ev Event) context.Context { - // add the current time to the event - ev.at = time.Now() - // hand the event off to the current exporter - return exporter(ctx, ev, ev) -} - -// Export is called to deliver an event to the global exporter if set. -func Export(ctx context.Context, ev Event) context.Context { - // get the global exporter and abort early if there is not one - exporterPtr := (*Exporter)(atomic.LoadPointer(&exporter)) - if exporterPtr == nil { - return ctx - } - return deliver(ctx, *exporterPtr, ev) -} - -// ExportPair is called to deliver a start event to the supplied exporter. -// It also returns a function that will deliver the end event to the same -// exporter. -// It will fill in the time. -func ExportPair(ctx context.Context, begin, end Event) (context.Context, func()) { - // get the global exporter and abort early if there is not one - exporterPtr := (*Exporter)(atomic.LoadPointer(&exporter)) - if exporterPtr == nil { - return ctx, func() {} - } - ctx = deliver(ctx, *exporterPtr, begin) - return ctx, func() { deliver(ctx, *exporterPtr, end) } -} diff --git a/vendor/golang.org/x/tools/internal/event/core/fast.go b/vendor/golang.org/x/tools/internal/event/core/fast.go deleted file mode 100644 index e61f2cf793..0000000000 --- a/vendor/golang.org/x/tools/internal/event/core/fast.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package core - -import ( - "context" - - "golang.org/x/tools/internal/event/keys" - "golang.org/x/tools/internal/event/label" -) - -// Log1 takes a message and one label delivers a log event to the exporter. -// It is a customized version of Print that is faster and does no allocation. -func Log1(ctx context.Context, message string, t1 label.Label) { - Export(ctx, MakeEvent(LogType, [3]label.Label{keys.Msg.Of(message), t1}, nil)) -} - -// Log2 takes a message and two labels and delivers a log event to the exporter. -// It is a customized version of Print that is faster and does no allocation. -func Log2(ctx context.Context, message string, t1 label.Label, t2 label.Label) { - Export(ctx, MakeEvent(LogType, [3]label.Label{keys.Msg.Of(message), t1, t2}, nil)) -} - -// Metric1 sends a label event to the exporter with the supplied labels. -func Metric1(ctx context.Context, t1 label.Label) context.Context { - return Export(ctx, MakeEvent(RecordType, [3]label.Label{t1}, nil)) -} - -// Metric2 sends a label event to the exporter with the supplied labels. -func Metric2(ctx context.Context, t1, t2 label.Label) context.Context { - return Export(ctx, MakeEvent(RecordType, [3]label.Label{t1, t2}, nil)) -} - -// Metric3 sends a label event to the exporter with the supplied labels. -func Metric3(ctx context.Context, t1, t2, t3 label.Label) context.Context { - return Export(ctx, MakeEvent(RecordType, [3]label.Label{t1, t2, t3}, nil)) -} - -// Start1 sends a span start event with the supplied label list to the exporter. -// It also returns a function that will end the span, which should normally be -// deferred. -func Start1(ctx context.Context, name string, t1 label.Label) (context.Context, func()) { - return ExportPair(ctx, - MakeEvent(StartSpanType, [3]label.Label{keys.Name.Of(name), t1}, nil), - MakeEvent(EndSpanType, [3]label.Label{}, nil)) -} - -// Start2 sends a span start event with the supplied label list to the exporter. -// It also returns a function that will end the span, which should normally be -// deferred. -func Start2(ctx context.Context, name string, t1, t2 label.Label) (context.Context, func()) { - return ExportPair(ctx, - MakeEvent(StartSpanType, [3]label.Label{keys.Name.Of(name), t1, t2}, nil), - MakeEvent(EndSpanType, [3]label.Label{}, nil)) -} diff --git a/vendor/golang.org/x/tools/internal/event/event.go b/vendor/golang.org/x/tools/internal/event/event.go deleted file mode 100644 index 730313b8b9..0000000000 --- a/vendor/golang.org/x/tools/internal/event/event.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package event - -import ( - "context" - - "golang.org/x/tools/internal/event/core" - "golang.org/x/tools/internal/event/keys" - "golang.org/x/tools/internal/event/label" -) - -// Exporter is a function that handles events. -// It may return a modified context and event. -type Exporter func(context.Context, core.Event, label.Map) context.Context - -// SetExporter sets the global exporter function that handles all events. -// The exporter is called synchronously from the event call site, so it should -// return quickly so as not to hold up user code. -func SetExporter(e Exporter) { - core.SetExporter(core.Exporter(e)) -} - -// Log takes a message and a label list and combines them into a single event -// before delivering them to the exporter. -func Log(ctx context.Context, message string, labels ...label.Label) { - core.Export(ctx, core.MakeEvent(core.LogType, [3]label.Label{ - keys.Msg.Of(message), - }, labels)) -} - -// Error takes a message and a label list and combines them into a single event -// before delivering them to the exporter. It captures the error in the -// delivered event. -func Error(ctx context.Context, message string, err error, labels ...label.Label) { - core.Export(ctx, core.MakeEvent(core.LogType, [3]label.Label{ - keys.Msg.Of(message), - keys.Err.Of(err), - }, labels)) -} - -// Metric sends a label event to the exporter with the supplied labels. -func Metric(ctx context.Context, labels ...label.Label) { - core.Export(ctx, core.MakeEvent(core.RecordType, [3]label.Label{}, labels)) -} - -// Label sends a label event to the exporter with the supplied labels. -func Label(ctx context.Context, labels ...label.Label) context.Context { - return core.Export(ctx, core.MakeEvent(core.LabelType, [3]label.Label{}, labels)) -} - -// Start sends a span start event with the supplied label list to the exporter. -// It also returns a function that will end the span, which should normally be -// deferred. -func Start(ctx context.Context, name string, labels ...label.Label) (context.Context, func()) { - return core.ExportPair(ctx, - core.MakeEvent(core.StartSpanType, [3]label.Label{ - keys.Name.Of(name), - }, labels), - core.MakeEvent(core.EndSpanType, [3]label.Label{}, nil)) -} - -// Detach returns a context without an associated span. -// This allows the creation of spans that are not children of the current span. -func Detach(ctx context.Context) context.Context { - return core.Export(ctx, core.MakeEvent(core.DetachType, [3]label.Label{}, nil)) -} diff --git a/vendor/golang.org/x/tools/internal/event/keys/keys.go b/vendor/golang.org/x/tools/internal/event/keys/keys.go deleted file mode 100644 index 5814f71a03..0000000000 --- a/vendor/golang.org/x/tools/internal/event/keys/keys.go +++ /dev/null @@ -1,542 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package keys - -import ( - "fmt" - "io" - "math" - "strconv" - - "golang.org/x/tools/internal/event/label" -) - -// Value represents a key for untyped values. -type Value struct { - name string - description string -} - -// New creates a new Key for untyped values. -func New(name, description string) *Value { - return &Value{name: name, description: description} -} - -func (k *Value) Name() string { return k.name } -func (k *Value) Description() string { return k.description } - -func (k *Value) Format(w io.Writer, buf []byte, l label.Label) { - fmt.Fprint(w, k.From(l)) -} - -// Get can be used to get a label for the key from a label.Map. -func (k *Value) Get(lm label.Map) interface{} { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return nil -} - -// From can be used to get a value from a Label. -func (k *Value) From(t label.Label) interface{} { return t.UnpackValue() } - -// Of creates a new Label with this key and the supplied value. -func (k *Value) Of(value interface{}) label.Label { return label.OfValue(k, value) } - -// Int represents a key -type Int struct { - name string - description string -} - -// NewInt creates a new Key for int values. -func NewInt(name, description string) *Int { - return &Int{name: name, description: description} -} - -func (k *Int) Name() string { return k.name } -func (k *Int) Description() string { return k.description } - -func (k *Int) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendInt(buf, int64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Int) Of(v int) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Int) Get(lm label.Map) int { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Int) From(t label.Label) int { return int(t.Unpack64()) } - -// Int8 represents a key -type Int8 struct { - name string - description string -} - -// NewInt8 creates a new Key for int8 values. -func NewInt8(name, description string) *Int8 { - return &Int8{name: name, description: description} -} - -func (k *Int8) Name() string { return k.name } -func (k *Int8) Description() string { return k.description } - -func (k *Int8) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendInt(buf, int64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Int8) Of(v int8) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Int8) Get(lm label.Map) int8 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Int8) From(t label.Label) int8 { return int8(t.Unpack64()) } - -// Int16 represents a key -type Int16 struct { - name string - description string -} - -// NewInt16 creates a new Key for int16 values. -func NewInt16(name, description string) *Int16 { - return &Int16{name: name, description: description} -} - -func (k *Int16) Name() string { return k.name } -func (k *Int16) Description() string { return k.description } - -func (k *Int16) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendInt(buf, int64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Int16) Of(v int16) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Int16) Get(lm label.Map) int16 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Int16) From(t label.Label) int16 { return int16(t.Unpack64()) } - -// Int32 represents a key -type Int32 struct { - name string - description string -} - -// NewInt32 creates a new Key for int32 values. -func NewInt32(name, description string) *Int32 { - return &Int32{name: name, description: description} -} - -func (k *Int32) Name() string { return k.name } -func (k *Int32) Description() string { return k.description } - -func (k *Int32) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendInt(buf, int64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Int32) Of(v int32) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Int32) Get(lm label.Map) int32 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Int32) From(t label.Label) int32 { return int32(t.Unpack64()) } - -// Int64 represents a key -type Int64 struct { - name string - description string -} - -// NewInt64 creates a new Key for int64 values. -func NewInt64(name, description string) *Int64 { - return &Int64{name: name, description: description} -} - -func (k *Int64) Name() string { return k.name } -func (k *Int64) Description() string { return k.description } - -func (k *Int64) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendInt(buf, k.From(l), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Int64) Of(v int64) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Int64) Get(lm label.Map) int64 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Int64) From(t label.Label) int64 { return int64(t.Unpack64()) } - -// UInt represents a key -type UInt struct { - name string - description string -} - -// NewUInt creates a new Key for uint values. -func NewUInt(name, description string) *UInt { - return &UInt{name: name, description: description} -} - -func (k *UInt) Name() string { return k.name } -func (k *UInt) Description() string { return k.description } - -func (k *UInt) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendUint(buf, uint64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *UInt) Of(v uint) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *UInt) Get(lm label.Map) uint { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *UInt) From(t label.Label) uint { return uint(t.Unpack64()) } - -// UInt8 represents a key -type UInt8 struct { - name string - description string -} - -// NewUInt8 creates a new Key for uint8 values. -func NewUInt8(name, description string) *UInt8 { - return &UInt8{name: name, description: description} -} - -func (k *UInt8) Name() string { return k.name } -func (k *UInt8) Description() string { return k.description } - -func (k *UInt8) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendUint(buf, uint64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *UInt8) Of(v uint8) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *UInt8) Get(lm label.Map) uint8 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *UInt8) From(t label.Label) uint8 { return uint8(t.Unpack64()) } - -// UInt16 represents a key -type UInt16 struct { - name string - description string -} - -// NewUInt16 creates a new Key for uint16 values. -func NewUInt16(name, description string) *UInt16 { - return &UInt16{name: name, description: description} -} - -func (k *UInt16) Name() string { return k.name } -func (k *UInt16) Description() string { return k.description } - -func (k *UInt16) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendUint(buf, uint64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *UInt16) Of(v uint16) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *UInt16) Get(lm label.Map) uint16 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *UInt16) From(t label.Label) uint16 { return uint16(t.Unpack64()) } - -// UInt32 represents a key -type UInt32 struct { - name string - description string -} - -// NewUInt32 creates a new Key for uint32 values. -func NewUInt32(name, description string) *UInt32 { - return &UInt32{name: name, description: description} -} - -func (k *UInt32) Name() string { return k.name } -func (k *UInt32) Description() string { return k.description } - -func (k *UInt32) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendUint(buf, uint64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *UInt32) Of(v uint32) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *UInt32) Get(lm label.Map) uint32 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *UInt32) From(t label.Label) uint32 { return uint32(t.Unpack64()) } - -// UInt64 represents a key -type UInt64 struct { - name string - description string -} - -// NewUInt64 creates a new Key for uint64 values. -func NewUInt64(name, description string) *UInt64 { - return &UInt64{name: name, description: description} -} - -func (k *UInt64) Name() string { return k.name } -func (k *UInt64) Description() string { return k.description } - -func (k *UInt64) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendUint(buf, k.From(l), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *UInt64) Of(v uint64) label.Label { return label.Of64(k, v) } - -// Get can be used to get a label for the key from a label.Map. -func (k *UInt64) Get(lm label.Map) uint64 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *UInt64) From(t label.Label) uint64 { return t.Unpack64() } - -// Float32 represents a key -type Float32 struct { - name string - description string -} - -// NewFloat32 creates a new Key for float32 values. -func NewFloat32(name, description string) *Float32 { - return &Float32{name: name, description: description} -} - -func (k *Float32) Name() string { return k.name } -func (k *Float32) Description() string { return k.description } - -func (k *Float32) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendFloat(buf, float64(k.From(l)), 'E', -1, 32)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Float32) Of(v float32) label.Label { - return label.Of64(k, uint64(math.Float32bits(v))) -} - -// Get can be used to get a label for the key from a label.Map. -func (k *Float32) Get(lm label.Map) float32 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Float32) From(t label.Label) float32 { - return math.Float32frombits(uint32(t.Unpack64())) -} - -// Float64 represents a key -type Float64 struct { - name string - description string -} - -// NewFloat64 creates a new Key for int64 values. -func NewFloat64(name, description string) *Float64 { - return &Float64{name: name, description: description} -} - -func (k *Float64) Name() string { return k.name } -func (k *Float64) Description() string { return k.description } - -func (k *Float64) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendFloat(buf, k.From(l), 'E', -1, 64)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Float64) Of(v float64) label.Label { - return label.Of64(k, math.Float64bits(v)) -} - -// Get can be used to get a label for the key from a label.Map. -func (k *Float64) Get(lm label.Map) float64 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Float64) From(t label.Label) float64 { - return math.Float64frombits(t.Unpack64()) -} - -// String represents a key -type String struct { - name string - description string -} - -// NewString creates a new Key for int64 values. -func NewString(name, description string) *String { - return &String{name: name, description: description} -} - -func (k *String) Name() string { return k.name } -func (k *String) Description() string { return k.description } - -func (k *String) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendQuote(buf, k.From(l))) -} - -// Of creates a new Label with this key and the supplied value. -func (k *String) Of(v string) label.Label { return label.OfString(k, v) } - -// Get can be used to get a label for the key from a label.Map. -func (k *String) Get(lm label.Map) string { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return "" -} - -// From can be used to get a value from a Label. -func (k *String) From(t label.Label) string { return t.UnpackString() } - -// Boolean represents a key -type Boolean struct { - name string - description string -} - -// NewBoolean creates a new Key for bool values. -func NewBoolean(name, description string) *Boolean { - return &Boolean{name: name, description: description} -} - -func (k *Boolean) Name() string { return k.name } -func (k *Boolean) Description() string { return k.description } - -func (k *Boolean) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendBool(buf, k.From(l))) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Boolean) Of(v bool) label.Label { - if v { - return label.Of64(k, 1) - } - return label.Of64(k, 0) -} - -// Get can be used to get a label for the key from a label.Map. -func (k *Boolean) Get(lm label.Map) bool { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return false -} - -// From can be used to get a value from a Label. -func (k *Boolean) From(t label.Label) bool { return t.Unpack64() > 0 } - -// Error represents a key -type Error struct { - name string - description string -} - -// NewError creates a new Key for int64 values. -func NewError(name, description string) *Error { - return &Error{name: name, description: description} -} - -func (k *Error) Name() string { return k.name } -func (k *Error) Description() string { return k.description } - -func (k *Error) Format(w io.Writer, buf []byte, l label.Label) { - io.WriteString(w, k.From(l).Error()) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Error) Of(v error) label.Label { return label.OfValue(k, v) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Error) Get(lm label.Map) error { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return nil -} - -// From can be used to get a value from a Label. -func (k *Error) From(t label.Label) error { - err, _ := t.UnpackValue().(error) - return err -} diff --git a/vendor/golang.org/x/tools/internal/event/keys/standard.go b/vendor/golang.org/x/tools/internal/event/keys/standard.go deleted file mode 100644 index 59516c2563..0000000000 --- a/vendor/golang.org/x/tools/internal/event/keys/standard.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package keys - -var ( - // Msg is a key used to add message strings to label lists. - Msg = NewString("message", "a readable message") - // Name is used for things like traces that have a name. - Name = NewString("name", "an entity name") - // Err is a key used to add error values to label lists. - Err = NewError("error", "an error that occurred") -) diff --git a/vendor/golang.org/x/tools/internal/event/label/label.go b/vendor/golang.org/x/tools/internal/event/label/label.go deleted file mode 100644 index b55c12eb25..0000000000 --- a/vendor/golang.org/x/tools/internal/event/label/label.go +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package label - -import ( - "fmt" - "io" - "reflect" - "unsafe" -) - -// Key is used as the identity of a Label. -// Keys are intended to be compared by pointer only, the name should be unique -// for communicating with external systems, but it is not required or enforced. -type Key interface { - // Name returns the key name. - Name() string - // Description returns a string that can be used to describe the value. - Description() string - - // Format is used in formatting to append the value of the label to the - // supplied buffer. - // The formatter may use the supplied buf as a scratch area to avoid - // allocations. - Format(w io.Writer, buf []byte, l Label) -} - -// Label holds a key and value pair. -// It is normally used when passing around lists of labels. -type Label struct { - key Key - packed uint64 - untyped interface{} -} - -// Map is the interface to a collection of Labels indexed by key. -type Map interface { - // Find returns the label that matches the supplied key. - Find(key Key) Label -} - -// List is the interface to something that provides an iterable -// list of labels. -// Iteration should start from 0 and continue until Valid returns false. -type List interface { - // Valid returns true if the index is within range for the list. - // It does not imply the label at that index will itself be valid. - Valid(index int) bool - // Label returns the label at the given index. - Label(index int) Label -} - -// list implements LabelList for a list of Labels. -type list struct { - labels []Label -} - -// filter wraps a LabelList filtering out specific labels. -type filter struct { - keys []Key - underlying List -} - -// listMap implements LabelMap for a simple list of labels. -type listMap struct { - labels []Label -} - -// mapChain implements LabelMap for a list of underlying LabelMap. -type mapChain struct { - maps []Map -} - -// OfValue creates a new label from the key and value. -// This method is for implementing new key types, label creation should -// normally be done with the Of method of the key. -func OfValue(k Key, value interface{}) Label { return Label{key: k, untyped: value} } - -// UnpackValue assumes the label was built using LabelOfValue and returns the value -// that was passed to that constructor. -// This method is for implementing new key types, for type safety normal -// access should be done with the From method of the key. -func (t Label) UnpackValue() interface{} { return t.untyped } - -// Of64 creates a new label from a key and a uint64. This is often -// used for non uint64 values that can be packed into a uint64. -// This method is for implementing new key types, label creation should -// normally be done with the Of method of the key. -func Of64(k Key, v uint64) Label { return Label{key: k, packed: v} } - -// Unpack64 assumes the label was built using LabelOf64 and returns the value that -// was passed to that constructor. -// This method is for implementing new key types, for type safety normal -// access should be done with the From method of the key. -func (t Label) Unpack64() uint64 { return t.packed } - -// OfString creates a new label from a key and a string. -// This method is for implementing new key types, label creation should -// normally be done with the Of method of the key. -func OfString(k Key, v string) Label { - hdr := (*reflect.StringHeader)(unsafe.Pointer(&v)) - return Label{ - key: k, - packed: uint64(hdr.Len), - untyped: unsafe.Pointer(hdr.Data), - } -} - -// UnpackString assumes the label was built using LabelOfString and returns the -// value that was passed to that constructor. -// This method is for implementing new key types, for type safety normal -// access should be done with the From method of the key. -func (t Label) UnpackString() string { - var v string - hdr := (*reflect.StringHeader)(unsafe.Pointer(&v)) - hdr.Data = uintptr(t.untyped.(unsafe.Pointer)) - hdr.Len = int(t.packed) - return *(*string)(unsafe.Pointer(hdr)) -} - -// Valid returns true if the Label is a valid one (it has a key). -func (t Label) Valid() bool { return t.key != nil } - -// Key returns the key of this Label. -func (t Label) Key() Key { return t.key } - -// Format is used for debug printing of labels. -func (t Label) Format(f fmt.State, r rune) { - if !t.Valid() { - io.WriteString(f, `nil`) - return - } - io.WriteString(f, t.Key().Name()) - io.WriteString(f, "=") - var buf [128]byte - t.Key().Format(f, buf[:0], t) -} - -func (l *list) Valid(index int) bool { - return index >= 0 && index < len(l.labels) -} - -func (l *list) Label(index int) Label { - return l.labels[index] -} - -func (f *filter) Valid(index int) bool { - return f.underlying.Valid(index) -} - -func (f *filter) Label(index int) Label { - l := f.underlying.Label(index) - for _, f := range f.keys { - if l.Key() == f { - return Label{} - } - } - return l -} - -func (lm listMap) Find(key Key) Label { - for _, l := range lm.labels { - if l.Key() == key { - return l - } - } - return Label{} -} - -func (c mapChain) Find(key Key) Label { - for _, src := range c.maps { - l := src.Find(key) - if l.Valid() { - return l - } - } - return Label{} -} - -var emptyList = &list{} - -func NewList(labels ...Label) List { - if len(labels) == 0 { - return emptyList - } - return &list{labels: labels} -} - -func Filter(l List, keys ...Key) List { - if len(keys) == 0 { - return l - } - return &filter{keys: keys, underlying: l} -} - -func NewMap(labels ...Label) Map { - return listMap{labels: labels} -} - -func MergeMaps(srcs ...Map) Map { - var nonNil []Map - for _, src := range srcs { - if src != nil { - nonNil = append(nonNil, src) - } - } - if len(nonNil) == 1 { - return nonNil[0] - } - return mapChain{maps: nonNil} -} diff --git a/vendor/golang.org/x/tools/internal/gocommand/invoke.go b/vendor/golang.org/x/tools/internal/gocommand/invoke.go deleted file mode 100644 index 9aa7984561..0000000000 --- a/vendor/golang.org/x/tools/internal/gocommand/invoke.go +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gocommand is a helper for calling the go command. -package gocommand - -import ( - "bytes" - "context" - "fmt" - "io" - "os" - "os/exec" - "regexp" - "strings" - "sync" - "time" - - "golang.org/x/tools/internal/event" -) - -// An Runner will run go command invocations and serialize -// them if it sees a concurrency error. -type Runner struct { - // LoadMu guards packages.Load calls and associated state. - loadMu sync.Mutex - serializeLoads int -} - -// 1.13: go: updates to go.mod needed, but contents have changed -// 1.14: go: updating go.mod: existing contents have changed since last read -var modConcurrencyError = regexp.MustCompile(`go:.*go.mod.*contents have changed`) - -// Run calls Runner.RunRaw, serializing requests if they fight over -// go.mod changes. -func (runner *Runner) Run(ctx context.Context, inv Invocation) (*bytes.Buffer, error) { - stdout, _, friendly, _ := runner.RunRaw(ctx, inv) - return stdout, friendly -} - -// RunRaw calls Invocation.runRaw, serializing requests if they fight over -// go.mod changes. -func (runner *Runner) RunRaw(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error) { - // We want to run invocations concurrently as much as possible. However, - // if go.mod updates are needed, only one can make them and the others will - // fail. We need to retry in those cases, but we don't want to thrash so - // badly we never recover. To avoid that, once we've seen one concurrency - // error, start serializing everything until the backlog has cleared out. - runner.loadMu.Lock() - var locked bool // If true, we hold the mutex and have incremented. - if runner.serializeLoads == 0 { - runner.loadMu.Unlock() - } else { - locked = true - runner.serializeLoads++ - } - defer func() { - if locked { - runner.serializeLoads-- - runner.loadMu.Unlock() - } - }() - - for { - stdout, stderr, friendlyErr, err := inv.runRaw(ctx) - if friendlyErr == nil || !modConcurrencyError.MatchString(friendlyErr.Error()) { - return stdout, stderr, friendlyErr, err - } - event.Error(ctx, "Load concurrency error, will retry serially", err) - if !locked { - runner.loadMu.Lock() - runner.serializeLoads++ - locked = true - } - } -} - -// An Invocation represents a call to the go command. -type Invocation struct { - Verb string - Args []string - BuildFlags []string - Env []string - WorkingDir string - Logf func(format string, args ...interface{}) -} - -// RunRaw is like RunPiped, but also returns the raw stderr and error for callers -// that want to do low-level error handling/recovery. -func (i *Invocation) runRaw(ctx context.Context) (stdout *bytes.Buffer, stderr *bytes.Buffer, friendlyError error, rawError error) { - stdout = &bytes.Buffer{} - stderr = &bytes.Buffer{} - rawError = i.RunPiped(ctx, stdout, stderr) - if rawError != nil { - friendlyError = rawError - // Check for 'go' executable not being found. - if ee, ok := rawError.(*exec.Error); ok && ee.Err == exec.ErrNotFound { - friendlyError = fmt.Errorf("go command required, not found: %v", ee) - } - if ctx.Err() != nil { - friendlyError = ctx.Err() - } - friendlyError = fmt.Errorf("err: %v: stderr: %s", friendlyError, stderr) - } - return -} - -// RunPiped is like Run, but relies on the given stdout/stderr -func (i *Invocation) RunPiped(ctx context.Context, stdout, stderr io.Writer) error { - log := i.Logf - if log == nil { - log = func(string, ...interface{}) {} - } - - goArgs := []string{i.Verb} - switch i.Verb { - case "mod": - // mod needs the sub-verb before build flags. - goArgs = append(goArgs, i.Args[0]) - goArgs = append(goArgs, i.BuildFlags...) - goArgs = append(goArgs, i.Args[1:]...) - case "env": - // env doesn't take build flags. - goArgs = append(goArgs, i.Args...) - default: - goArgs = append(goArgs, i.BuildFlags...) - goArgs = append(goArgs, i.Args...) - } - cmd := exec.Command("go", goArgs...) - cmd.Stdout = stdout - cmd.Stderr = stderr - // On darwin the cwd gets resolved to the real path, which breaks anything that - // expects the working directory to keep the original path, including the - // go command when dealing with modules. - // The Go stdlib has a special feature where if the cwd and the PWD are the - // same node then it trusts the PWD, so by setting it in the env for the child - // process we fix up all the paths returned by the go command. - cmd.Env = append(os.Environ(), i.Env...) - if i.WorkingDir != "" { - cmd.Env = append(cmd.Env, "PWD="+i.WorkingDir) - cmd.Dir = i.WorkingDir - } - - defer func(start time.Time) { log("%s for %v", time.Since(start), cmdDebugStr(cmd)) }(time.Now()) - - return runCmdContext(ctx, cmd) -} - -// runCmdContext is like exec.CommandContext except it sends os.Interrupt -// before os.Kill. -func runCmdContext(ctx context.Context, cmd *exec.Cmd) error { - if err := cmd.Start(); err != nil { - return err - } - resChan := make(chan error, 1) - go func() { - resChan <- cmd.Wait() - }() - - select { - case err := <-resChan: - return err - case <-ctx.Done(): - } - // Cancelled. Interrupt and see if it ends voluntarily. - cmd.Process.Signal(os.Interrupt) - select { - case err := <-resChan: - return err - case <-time.After(time.Second): - } - // Didn't shut down in response to interrupt. Kill it hard. - cmd.Process.Kill() - return <-resChan -} - -func cmdDebugStr(cmd *exec.Cmd) string { - env := make(map[string]string) - for _, kv := range cmd.Env { - split := strings.Split(kv, "=") - k, v := split[0], split[1] - env[k] = v - } - - return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v go %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], cmd.Args) -} diff --git a/vendor/golang.org/x/tools/internal/packagesinternal/packages.go b/vendor/golang.org/x/tools/internal/packagesinternal/packages.go deleted file mode 100644 index a88750be2b..0000000000 --- a/vendor/golang.org/x/tools/internal/packagesinternal/packages.go +++ /dev/null @@ -1,35 +0,0 @@ -// Package packagesinternal exposes internal-only fields from go/packages. -package packagesinternal - -import ( - "time" - - "golang.org/x/tools/internal/gocommand" -) - -// Fields must match go list; -type Module struct { - Path string // module path - Version string // module version - Versions []string // available module versions (with -versions) - Replace *Module // replaced by this module - Time *time.Time // time version was created - Update *Module // available update, if any (with -u) - Main bool // is this the main module? - Indirect bool // is this module only an indirect dependency of main module? - Dir string // directory holding files for this module, if any - GoMod string // path to go.mod file used when loading this module, if any - GoVersion string // go version used in module - Error *ModuleError // error loading module -} -type ModuleError struct { - Err string // the error itself -} - -var GetForTest = func(p interface{}) string { return "" } - -var GetModule = func(p interface{}) *Module { return nil } - -var GetGoCmdRunner = func(config interface{}) *gocommand.Runner { return nil } - -var SetGoCmdRunner = func(config interface{}, runner *gocommand.Runner) {} diff --git a/vendor/golang.org/x/xerrors/LICENSE b/vendor/golang.org/x/xerrors/LICENSE deleted file mode 100644 index e4a47e17f1..0000000000 --- a/vendor/golang.org/x/xerrors/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2019 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/xerrors/PATENTS b/vendor/golang.org/x/xerrors/PATENTS deleted file mode 100644 index 733099041f..0000000000 --- a/vendor/golang.org/x/xerrors/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/xerrors/README b/vendor/golang.org/x/xerrors/README deleted file mode 100644 index aac7867a56..0000000000 --- a/vendor/golang.org/x/xerrors/README +++ /dev/null @@ -1,2 +0,0 @@ -This repository holds the transition packages for the new Go 1.13 error values. -See golang.org/design/29934-error-values. diff --git a/vendor/golang.org/x/xerrors/adaptor.go b/vendor/golang.org/x/xerrors/adaptor.go deleted file mode 100644 index 4317f24833..0000000000 --- a/vendor/golang.org/x/xerrors/adaptor.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xerrors - -import ( - "bytes" - "fmt" - "io" - "reflect" - "strconv" -) - -// FormatError calls the FormatError method of f with an errors.Printer -// configured according to s and verb, and writes the result to s. -func FormatError(f Formatter, s fmt.State, verb rune) { - // Assuming this function is only called from the Format method, and given - // that FormatError takes precedence over Format, it cannot be called from - // any package that supports errors.Formatter. It is therefore safe to - // disregard that State may be a specific printer implementation and use one - // of our choice instead. - - // limitations: does not support printing error as Go struct. - - var ( - sep = " " // separator before next error - p = &state{State: s} - direct = true - ) - - var err error = f - - switch verb { - // Note that this switch must match the preference order - // for ordinary string printing (%#v before %+v, and so on). - - case 'v': - if s.Flag('#') { - if stringer, ok := err.(fmt.GoStringer); ok { - io.WriteString(&p.buf, stringer.GoString()) - goto exit - } - // proceed as if it were %v - } else if s.Flag('+') { - p.printDetail = true - sep = "\n - " - } - case 's': - case 'q', 'x', 'X': - // Use an intermediate buffer in the rare cases that precision, - // truncation, or one of the alternative verbs (q, x, and X) are - // specified. - direct = false - - default: - p.buf.WriteString("%!") - p.buf.WriteRune(verb) - p.buf.WriteByte('(') - switch { - case err != nil: - p.buf.WriteString(reflect.TypeOf(f).String()) - default: - p.buf.WriteString("") - } - p.buf.WriteByte(')') - io.Copy(s, &p.buf) - return - } - -loop: - for { - switch v := err.(type) { - case Formatter: - err = v.FormatError((*printer)(p)) - case fmt.Formatter: - v.Format(p, 'v') - break loop - default: - io.WriteString(&p.buf, v.Error()) - break loop - } - if err == nil { - break - } - if p.needColon || !p.printDetail { - p.buf.WriteByte(':') - p.needColon = false - } - p.buf.WriteString(sep) - p.inDetail = false - p.needNewline = false - } - -exit: - width, okW := s.Width() - prec, okP := s.Precision() - - if !direct || (okW && width > 0) || okP { - // Construct format string from State s. - format := []byte{'%'} - if s.Flag('-') { - format = append(format, '-') - } - if s.Flag('+') { - format = append(format, '+') - } - if s.Flag(' ') { - format = append(format, ' ') - } - if okW { - format = strconv.AppendInt(format, int64(width), 10) - } - if okP { - format = append(format, '.') - format = strconv.AppendInt(format, int64(prec), 10) - } - format = append(format, string(verb)...) - fmt.Fprintf(s, string(format), p.buf.String()) - } else { - io.Copy(s, &p.buf) - } -} - -var detailSep = []byte("\n ") - -// state tracks error printing state. It implements fmt.State. -type state struct { - fmt.State - buf bytes.Buffer - - printDetail bool - inDetail bool - needColon bool - needNewline bool -} - -func (s *state) Write(b []byte) (n int, err error) { - if s.printDetail { - if len(b) == 0 { - return 0, nil - } - if s.inDetail && s.needColon { - s.needNewline = true - if b[0] == '\n' { - b = b[1:] - } - } - k := 0 - for i, c := range b { - if s.needNewline { - if s.inDetail && s.needColon { - s.buf.WriteByte(':') - s.needColon = false - } - s.buf.Write(detailSep) - s.needNewline = false - } - if c == '\n' { - s.buf.Write(b[k:i]) - k = i + 1 - s.needNewline = true - } - } - s.buf.Write(b[k:]) - if !s.inDetail { - s.needColon = true - } - } else if !s.inDetail { - s.buf.Write(b) - } - return len(b), nil -} - -// printer wraps a state to implement an xerrors.Printer. -type printer state - -func (s *printer) Print(args ...interface{}) { - if !s.inDetail || s.printDetail { - fmt.Fprint((*state)(s), args...) - } -} - -func (s *printer) Printf(format string, args ...interface{}) { - if !s.inDetail || s.printDetail { - fmt.Fprintf((*state)(s), format, args...) - } -} - -func (s *printer) Detail() bool { - s.inDetail = true - return s.printDetail -} diff --git a/vendor/golang.org/x/xerrors/codereview.cfg b/vendor/golang.org/x/xerrors/codereview.cfg deleted file mode 100644 index 3f8b14b64e..0000000000 --- a/vendor/golang.org/x/xerrors/codereview.cfg +++ /dev/null @@ -1 +0,0 @@ -issuerepo: golang/go diff --git a/vendor/golang.org/x/xerrors/doc.go b/vendor/golang.org/x/xerrors/doc.go deleted file mode 100644 index eef99d9d54..0000000000 --- a/vendor/golang.org/x/xerrors/doc.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package xerrors implements functions to manipulate errors. -// -// This package is based on the Go 2 proposal for error values: -// https://golang.org/design/29934-error-values -// -// These functions were incorporated into the standard library's errors package -// in Go 1.13: -// - Is -// - As -// - Unwrap -// -// Also, Errorf's %w verb was incorporated into fmt.Errorf. -// -// Use this package to get equivalent behavior in all supported Go versions. -// -// No other features of this package were included in Go 1.13, and at present -// there are no plans to include any of them. -package xerrors // import "golang.org/x/xerrors" diff --git a/vendor/golang.org/x/xerrors/errors.go b/vendor/golang.org/x/xerrors/errors.go deleted file mode 100644 index e88d3772d8..0000000000 --- a/vendor/golang.org/x/xerrors/errors.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xerrors - -import "fmt" - -// errorString is a trivial implementation of error. -type errorString struct { - s string - frame Frame -} - -// New returns an error that formats as the given text. -// -// The returned error contains a Frame set to the caller's location and -// implements Formatter to show this information when printed with details. -func New(text string) error { - return &errorString{text, Caller(1)} -} - -func (e *errorString) Error() string { - return e.s -} - -func (e *errorString) Format(s fmt.State, v rune) { FormatError(e, s, v) } - -func (e *errorString) FormatError(p Printer) (next error) { - p.Print(e.s) - e.frame.Format(p) - return nil -} diff --git a/vendor/golang.org/x/xerrors/fmt.go b/vendor/golang.org/x/xerrors/fmt.go deleted file mode 100644 index 829862ddf6..0000000000 --- a/vendor/golang.org/x/xerrors/fmt.go +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xerrors - -import ( - "fmt" - "strings" - "unicode" - "unicode/utf8" - - "golang.org/x/xerrors/internal" -) - -const percentBangString = "%!" - -// Errorf formats according to a format specifier and returns the string as a -// value that satisfies error. -// -// The returned error includes the file and line number of the caller when -// formatted with additional detail enabled. If the last argument is an error -// the returned error's Format method will return it if the format string ends -// with ": %s", ": %v", or ": %w". If the last argument is an error and the -// format string ends with ": %w", the returned error implements an Unwrap -// method returning it. -// -// If the format specifier includes a %w verb with an error operand in a -// position other than at the end, the returned error will still implement an -// Unwrap method returning the operand, but the error's Format method will not -// return the wrapped error. -// -// It is invalid to include more than one %w verb or to supply it with an -// operand that does not implement the error interface. The %w verb is otherwise -// a synonym for %v. -func Errorf(format string, a ...interface{}) error { - format = formatPlusW(format) - // Support a ": %[wsv]" suffix, which works well with xerrors.Formatter. - wrap := strings.HasSuffix(format, ": %w") - idx, format2, ok := parsePercentW(format) - percentWElsewhere := !wrap && idx >= 0 - if !percentWElsewhere && (wrap || strings.HasSuffix(format, ": %s") || strings.HasSuffix(format, ": %v")) { - err := errorAt(a, len(a)-1) - if err == nil { - return &noWrapError{fmt.Sprintf(format, a...), nil, Caller(1)} - } - // TODO: this is not entirely correct. The error value could be - // printed elsewhere in format if it mixes numbered with unnumbered - // substitutions. With relatively small changes to doPrintf we can - // have it optionally ignore extra arguments and pass the argument - // list in its entirety. - msg := fmt.Sprintf(format[:len(format)-len(": %s")], a[:len(a)-1]...) - frame := Frame{} - if internal.EnableTrace { - frame = Caller(1) - } - if wrap { - return &wrapError{msg, err, frame} - } - return &noWrapError{msg, err, frame} - } - // Support %w anywhere. - // TODO: don't repeat the wrapped error's message when %w occurs in the middle. - msg := fmt.Sprintf(format2, a...) - if idx < 0 { - return &noWrapError{msg, nil, Caller(1)} - } - err := errorAt(a, idx) - if !ok || err == nil { - // Too many %ws or argument of %w is not an error. Approximate the Go - // 1.13 fmt.Errorf message. - return &noWrapError{fmt.Sprintf("%sw(%s)", percentBangString, msg), nil, Caller(1)} - } - frame := Frame{} - if internal.EnableTrace { - frame = Caller(1) - } - return &wrapError{msg, err, frame} -} - -func errorAt(args []interface{}, i int) error { - if i < 0 || i >= len(args) { - return nil - } - err, ok := args[i].(error) - if !ok { - return nil - } - return err -} - -// formatPlusW is used to avoid the vet check that will barf at %w. -func formatPlusW(s string) string { - return s -} - -// Return the index of the only %w in format, or -1 if none. -// Also return a rewritten format string with %w replaced by %v, and -// false if there is more than one %w. -// TODO: handle "%[N]w". -func parsePercentW(format string) (idx int, newFormat string, ok bool) { - // Loosely copied from golang.org/x/tools/go/analysis/passes/printf/printf.go. - idx = -1 - ok = true - n := 0 - sz := 0 - var isW bool - for i := 0; i < len(format); i += sz { - if format[i] != '%' { - sz = 1 - continue - } - // "%%" is not a format directive. - if i+1 < len(format) && format[i+1] == '%' { - sz = 2 - continue - } - sz, isW = parsePrintfVerb(format[i:]) - if isW { - if idx >= 0 { - ok = false - } else { - idx = n - } - // "Replace" the last character, the 'w', with a 'v'. - p := i + sz - 1 - format = format[:p] + "v" + format[p+1:] - } - n++ - } - return idx, format, ok -} - -// Parse the printf verb starting with a % at s[0]. -// Return how many bytes it occupies and whether the verb is 'w'. -func parsePrintfVerb(s string) (int, bool) { - // Assume only that the directive is a sequence of non-letters followed by a single letter. - sz := 0 - var r rune - for i := 1; i < len(s); i += sz { - r, sz = utf8.DecodeRuneInString(s[i:]) - if unicode.IsLetter(r) { - return i + sz, r == 'w' - } - } - return len(s), false -} - -type noWrapError struct { - msg string - err error - frame Frame -} - -func (e *noWrapError) Error() string { - return fmt.Sprint(e) -} - -func (e *noWrapError) Format(s fmt.State, v rune) { FormatError(e, s, v) } - -func (e *noWrapError) FormatError(p Printer) (next error) { - p.Print(e.msg) - e.frame.Format(p) - return e.err -} - -type wrapError struct { - msg string - err error - frame Frame -} - -func (e *wrapError) Error() string { - return fmt.Sprint(e) -} - -func (e *wrapError) Format(s fmt.State, v rune) { FormatError(e, s, v) } - -func (e *wrapError) FormatError(p Printer) (next error) { - p.Print(e.msg) - e.frame.Format(p) - return e.err -} - -func (e *wrapError) Unwrap() error { - return e.err -} diff --git a/vendor/golang.org/x/xerrors/format.go b/vendor/golang.org/x/xerrors/format.go deleted file mode 100644 index 1bc9c26b97..0000000000 --- a/vendor/golang.org/x/xerrors/format.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xerrors - -// A Formatter formats error messages. -type Formatter interface { - error - - // FormatError prints the receiver's first error and returns the next error in - // the error chain, if any. - FormatError(p Printer) (next error) -} - -// A Printer formats error messages. -// -// The most common implementation of Printer is the one provided by package fmt -// during Printf (as of Go 1.13). Localization packages such as golang.org/x/text/message -// typically provide their own implementations. -type Printer interface { - // Print appends args to the message output. - Print(args ...interface{}) - - // Printf writes a formatted string. - Printf(format string, args ...interface{}) - - // Detail reports whether error detail is requested. - // After the first call to Detail, all text written to the Printer - // is formatted as additional detail, or ignored when - // detail has not been requested. - // If Detail returns false, the caller can avoid printing the detail at all. - Detail() bool -} diff --git a/vendor/golang.org/x/xerrors/frame.go b/vendor/golang.org/x/xerrors/frame.go deleted file mode 100644 index 0de628ec50..0000000000 --- a/vendor/golang.org/x/xerrors/frame.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xerrors - -import ( - "runtime" -) - -// A Frame contains part of a call stack. -type Frame struct { - // Make room for three PCs: the one we were asked for, what it called, - // and possibly a PC for skipPleaseUseCallersFrames. See: - // https://go.googlesource.com/go/+/032678e0fb/src/runtime/extern.go#169 - frames [3]uintptr -} - -// Caller returns a Frame that describes a frame on the caller's stack. -// The argument skip is the number of frames to skip over. -// Caller(0) returns the frame for the caller of Caller. -func Caller(skip int) Frame { - var s Frame - runtime.Callers(skip+1, s.frames[:]) - return s -} - -// location reports the file, line, and function of a frame. -// -// The returned function may be "" even if file and line are not. -func (f Frame) location() (function, file string, line int) { - frames := runtime.CallersFrames(f.frames[:]) - if _, ok := frames.Next(); !ok { - return "", "", 0 - } - fr, ok := frames.Next() - if !ok { - return "", "", 0 - } - return fr.Function, fr.File, fr.Line -} - -// Format prints the stack as error detail. -// It should be called from an error's Format implementation -// after printing any other error detail. -func (f Frame) Format(p Printer) { - if p.Detail() { - function, file, line := f.location() - if function != "" { - p.Printf("%s\n ", function) - } - if file != "" { - p.Printf("%s:%d\n", file, line) - } - } -} diff --git a/vendor/golang.org/x/xerrors/go.mod b/vendor/golang.org/x/xerrors/go.mod deleted file mode 100644 index 870d4f612d..0000000000 --- a/vendor/golang.org/x/xerrors/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module golang.org/x/xerrors - -go 1.11 diff --git a/vendor/golang.org/x/xerrors/internal/internal.go b/vendor/golang.org/x/xerrors/internal/internal.go deleted file mode 100644 index 89f4eca5df..0000000000 --- a/vendor/golang.org/x/xerrors/internal/internal.go +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package internal - -// EnableTrace indicates whether stack information should be recorded in errors. -var EnableTrace = true diff --git a/vendor/golang.org/x/xerrors/wrap.go b/vendor/golang.org/x/xerrors/wrap.go deleted file mode 100644 index 9a3b510374..0000000000 --- a/vendor/golang.org/x/xerrors/wrap.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xerrors - -import ( - "reflect" -) - -// A Wrapper provides context around another error. -type Wrapper interface { - // Unwrap returns the next error in the error chain. - // If there is no next error, Unwrap returns nil. - Unwrap() error -} - -// Opaque returns an error with the same error formatting as err -// but that does not match err and cannot be unwrapped. -func Opaque(err error) error { - return noWrapper{err} -} - -type noWrapper struct { - error -} - -func (e noWrapper) FormatError(p Printer) (next error) { - if f, ok := e.error.(Formatter); ok { - return f.FormatError(p) - } - p.Print(e.error) - return nil -} - -// Unwrap returns the result of calling the Unwrap method on err, if err implements -// Unwrap. Otherwise, Unwrap returns nil. -func Unwrap(err error) error { - u, ok := err.(Wrapper) - if !ok { - return nil - } - return u.Unwrap() -} - -// Is reports whether any error in err's chain matches target. -// -// An error is considered to match a target if it is equal to that target or if -// it implements a method Is(error) bool such that Is(target) returns true. -func Is(err, target error) bool { - if target == nil { - return err == target - } - - isComparable := reflect.TypeOf(target).Comparable() - for { - if isComparable && err == target { - return true - } - if x, ok := err.(interface{ Is(error) bool }); ok && x.Is(target) { - return true - } - // TODO: consider supporing target.Is(err). This would allow - // user-definable predicates, but also may allow for coping with sloppy - // APIs, thereby making it easier to get away with them. - if err = Unwrap(err); err == nil { - return false - } - } -} - -// As finds the first error in err's chain that matches the type to which target -// points, and if so, sets the target to its value and returns true. An error -// matches a type if it is assignable to the target type, or if it has a method -// As(interface{}) bool such that As(target) returns true. As will panic if target -// is not a non-nil pointer to a type which implements error or is of interface type. -// -// The As method should set the target to its value and return true if err -// matches the type to which target points. -func As(err error, target interface{}) bool { - if target == nil { - panic("errors: target cannot be nil") - } - val := reflect.ValueOf(target) - typ := val.Type() - if typ.Kind() != reflect.Ptr || val.IsNil() { - panic("errors: target must be a non-nil pointer") - } - if e := typ.Elem(); e.Kind() != reflect.Interface && !e.Implements(errorType) { - panic("errors: *target must be interface or implement error") - } - targetType := typ.Elem() - for err != nil { - if reflect.TypeOf(err).AssignableTo(targetType) { - val.Elem().Set(reflect.ValueOf(err)) - return true - } - if x, ok := err.(interface{ As(interface{}) bool }); ok && x.As(target) { - return true - } - err = Unwrap(err) - } - return false -} - -var errorType = reflect.TypeOf((*error)(nil)).Elem() diff --git a/vendor/modules.txt b/vendor/modules.txt index 3ad6975d6c..b7a40a464b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,13 +1,13 @@ -# github.com/AudriusButkevicius/pfilter v0.0.0-20190627213056-c55ef6137fc6 +# github.com/AudriusButkevicius/pfilter v0.0.0-20210218141631-7468b85d810a ## explicit github.com/AudriusButkevicius/pfilter -# github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d +# github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 ## explicit github.com/StackExchange/wmi -# github.com/VictoriaMetrics/metrics v1.12.3 +# github.com/VictoriaMetrics/metrics v1.17.2 ## explicit github.com/VictoriaMetrics/metrics -# github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6 +# github.com/andybalholm/brotli v1.0.0 github.com/andybalholm/brotli # github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 ## explicit @@ -28,24 +28,21 @@ github.com/dsnet/compress/internal/prefix ## explicit github.com/go-chi/chi github.com/go-chi/chi/middleware -# github.com/go-ole/go-ole v1.2.4 +# github.com/go-ole/go-ole v1.2.5 ## explicit github.com/go-ole/go-ole github.com/go-ole/go-ole/oleutil -# github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721 -github.com/golang/gddo/httputil -github.com/golang/gddo/httputil/header -# github.com/golang/protobuf v1.4.2 +# github.com/golang/protobuf v1.5.2 ## explicit # github.com/golang/snappy v0.0.1 github.com/golang/snappy # github.com/google/go-github v17.0.0+incompatible ## explicit github.com/google/go-github/github -# github.com/google/go-querystring v1.0.0 +# github.com/google/go-querystring v1.1.0 ## explicit github.com/google/go-querystring/query -# github.com/google/uuid v1.1.1 +# github.com/google/uuid v1.2.0 ## explicit github.com/google/uuid # github.com/gorilla/securecookie v1.1.1 @@ -55,18 +52,19 @@ github.com/gorilla/securecookie github.com/inconshreveable/mousetrap # github.com/json-iterator/go v1.1.10 github.com/json-iterator/go -# github.com/klauspost/compress v1.10.0 +# github.com/klauspost/compress v1.10.10 github.com/klauspost/compress/flate github.com/klauspost/compress/fse +github.com/klauspost/compress/gzip github.com/klauspost/compress/huff0 github.com/klauspost/compress/snappy github.com/klauspost/compress/zstd github.com/klauspost/compress/zstd/internal/xxhash -# github.com/klauspost/cpuid v1.2.4 -github.com/klauspost/cpuid -# github.com/klauspost/pgzip v1.2.1 +# github.com/klauspost/cpuid/v2 v2.0.2 +github.com/klauspost/cpuid/v2 +# github.com/klauspost/pgzip v1.2.4 github.com/klauspost/pgzip -# github.com/klauspost/reedsolomon v1.9.9 +# github.com/klauspost/reedsolomon v1.9.12 ## explicit github.com/klauspost/reedsolomon # github.com/kz/discordrus v1.2.0 @@ -79,36 +77,24 @@ github.com/mattn/go-isatty # github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d ## explicit github.com/mgutz/ansi -# github.com/mholt/archiver/v3 v3.3.0 +# github.com/mholt/archiver/v3 v3.5.0 ## explicit github.com/mholt/archiver/v3 # github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db github.com/mitchellh/colorstring -# github.com/mmcloughlin/avo v0.0.0-20200523190732-4439b6b2c061 -## explicit -github.com/mmcloughlin/avo/attr -github.com/mmcloughlin/avo/build -github.com/mmcloughlin/avo/buildtags -github.com/mmcloughlin/avo/gotypes -github.com/mmcloughlin/avo/internal/prnt -github.com/mmcloughlin/avo/internal/stack -github.com/mmcloughlin/avo/ir -github.com/mmcloughlin/avo/operand -github.com/mmcloughlin/avo/pass -github.com/mmcloughlin/avo/printer -github.com/mmcloughlin/avo/reg -github.com/mmcloughlin/avo/src -github.com/mmcloughlin/avo/x86 # github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd github.com/modern-go/concurrent # github.com/modern-go/reflect2 v1.0.1 github.com/modern-go/reflect2 -# github.com/nwaples/rardecode v1.0.0 +# github.com/nwaples/rardecode v1.1.0 github.com/nwaples/rardecode -# github.com/pierrec/lz4 v2.0.5+incompatible -github.com/pierrec/lz4 -github.com/pierrec/lz4/internal/xxh32 -# github.com/pkg/errors v0.8.1 +# github.com/pierrec/lz4/v4 v4.0.3 +github.com/pierrec/lz4/v4 +github.com/pierrec/lz4/v4/internal/lz4block +github.com/pierrec/lz4/v4/internal/lz4errors +github.com/pierrec/lz4/v4/internal/lz4stream +github.com/pierrec/lz4/v4/internal/xxh32 +# github.com/pkg/errors v0.9.1 ## explicit github.com/pkg/errors # github.com/pkg/profile v1.5.0 @@ -116,23 +102,21 @@ github.com/pkg/errors github.com/pkg/profile # github.com/pmezard/go-difflib v1.0.0 github.com/pmezard/go-difflib/difflib -# github.com/prometheus/client_golang v1.7.1 -## explicit # github.com/schollz/progressbar/v2 v2.15.0 ## explicit github.com/schollz/progressbar/v2 -# github.com/shirou/gopsutil v2.20.5+incompatible +# github.com/shirou/gopsutil v3.21.3+incompatible ## explicit github.com/shirou/gopsutil/cpu github.com/shirou/gopsutil/internal/common github.com/shirou/gopsutil/mem github.com/shirou/gopsutil/net github.com/shirou/gopsutil/process -# github.com/sirupsen/logrus v1.7.0 +# github.com/sirupsen/logrus v1.8.1 ## explicit github.com/sirupsen/logrus github.com/sirupsen/logrus/hooks/syslog -# github.com/skycoin/dmsg v0.0.0-20201216183836-dae8a7acfc14 +# github.com/skycoin/dmsg v0.0.0-20210329160412-4e25fc9ad26c ## explicit github.com/skycoin/dmsg github.com/skycoin/dmsg/buildinfo @@ -165,14 +149,14 @@ github.com/skycoin/yamux # github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 ## explicit github.com/songgao/water -# github.com/spf13/cobra v1.0.0 +# github.com/spf13/cobra v1.1.3 ## explicit github.com/spf13/cobra -# github.com/spf13/pflag v1.0.3 +# github.com/spf13/pflag v1.0.5 github.com/spf13/pflag # github.com/stretchr/objx v0.1.1 github.com/stretchr/objx -# github.com/stretchr/testify v1.6.1 +# github.com/stretchr/testify v1.7.0 ## explicit github.com/stretchr/testify/assert github.com/stretchr/testify/mock @@ -186,13 +170,18 @@ github.com/templexxx/cpufeat # github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b ## explicit github.com/templexxx/xor -# github.com/tjfoc/gmsm v1.3.2 +# github.com/tjfoc/gmsm v1.4.0 ## explicit github.com/tjfoc/gmsm/sm4 +# github.com/tklauser/go-sysconf v0.3.5 +## explicit +github.com/tklauser/go-sysconf +# github.com/tklauser/numcpus v0.2.2 +github.com/tklauser/numcpus # github.com/toqueteos/webbrowser v1.2.0 ## explicit github.com/toqueteos/webbrowser -# github.com/ulikunitz/xz v0.5.6 +# github.com/ulikunitz/xz v0.5.7 github.com/ulikunitz/xz github.com/ulikunitz/xz/internal/hash github.com/ulikunitz/xz/internal/xlog @@ -211,7 +200,7 @@ github.com/xtaci/kcp-go # go.etcd.io/bbolt v1.3.5 ## explicit go.etcd.io/bbolt -# golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9 +# golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc ## explicit golang.org/x/crypto/blake2b golang.org/x/crypto/blake2s @@ -229,7 +218,7 @@ golang.org/x/crypto/ssh/terminal golang.org/x/crypto/tea golang.org/x/crypto/twofish golang.org/x/crypto/xtea -# golang.org/x/net v0.0.0-20200625001655-4c5254603344 +# golang.org/x/net v0.0.0-20210420210106-798c2154c571 ## explicit golang.org/x/net/bpf golang.org/x/net/context @@ -240,7 +229,7 @@ golang.org/x/net/ipv4 golang.org/x/net/ipv6 golang.org/x/net/nettest golang.org/x/net/proxy -# golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e +# golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988 ## explicit golang.org/x/sys/cpu golang.org/x/sys/internal/unsafeheader @@ -248,26 +237,14 @@ golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows golang.org/x/sys/windows/registry -# golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf +# golang.org/x/term v0.0.0-20210406210042-72f3dc4e9b72 ## explicit golang.org/x/term -# golang.org/x/text v0.3.2 +# golang.org/x/text v0.3.6 golang.org/x/text/transform golang.org/x/text/unicode/norm -# golang.org/x/tools v0.0.0-20200425043458-8463f397d07c -golang.org/x/tools/go/gcexportdata -golang.org/x/tools/go/internal/gcimporter -golang.org/x/tools/go/internal/packagesdriver -golang.org/x/tools/go/packages -golang.org/x/tools/internal/event -golang.org/x/tools/internal/event/core -golang.org/x/tools/internal/event/keys -golang.org/x/tools/internal/event/label -golang.org/x/tools/internal/gocommand -golang.org/x/tools/internal/packagesinternal -# golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 -golang.org/x/xerrors -golang.org/x/xerrors/internal +# golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 +## explicit # golang.zx2c4.com/wireguard v0.0.20200320 ## explicit golang.zx2c4.com/wireguard/rwcancel @@ -280,7 +257,7 @@ golang.zx2c4.com/wireguard/tun/wintun/registry golang.zx2c4.com/wireguard/tun/wintun/setupapi # gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c gopkg.in/yaml.v3 -# nhooyr.io/websocket v1.8.2 +# nhooyr.io/websocket v1.8.7 ## explicit nhooyr.io/websocket nhooyr.io/websocket/internal/bpool diff --git a/vendor/nhooyr.io/websocket/Makefile b/vendor/nhooyr.io/websocket/Makefile deleted file mode 100644 index f9f31c49f1..0000000000 --- a/vendor/nhooyr.io/websocket/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all: fmt lint test - -.SILENT: - -include ci/fmt.mk -include ci/lint.mk -include ci/test.mk diff --git a/vendor/nhooyr.io/websocket/README.md b/vendor/nhooyr.io/websocket/README.md index 5dddf84ad8..df20c581a5 100644 --- a/vendor/nhooyr.io/websocket/README.md +++ b/vendor/nhooyr.io/websocket/README.md @@ -1,6 +1,7 @@ # websocket -[![godoc](https://godoc.org/nhooyr.io/websocket?status.svg)](https://godoc.org/nhooyr.io/websocket) +[![godoc](https://godoc.org/nhooyr.io/websocket?status.svg)](https://pkg.go.dev/nhooyr.io/websocket) +[![coverage](https://img.shields.io/badge/coverage-88%25-success)](https://nhooyrio-websocket-coverage.netlify.app) websocket is a minimal and idiomatic WebSocket library for Go. @@ -10,21 +11,20 @@ websocket is a minimal and idiomatic WebSocket library for Go. go get nhooyr.io/websocket ``` -## Features +## Highlights - Minimal and idiomatic API - First class [context.Context](https://blog.golang.org/context) support - Fully passes the WebSocket [autobahn-testsuite](https://github.com/crossbario/autobahn-testsuite) -- Thorough unit tests with [90% coverage](https://coveralls.io/github/nhooyr/websocket) -- [Minimal dependencies](https://godoc.org/nhooyr.io/websocket?imports) -- JSON and protobuf helpers in the [wsjson](https://godoc.org/nhooyr.io/websocket/wsjson) and [wspb](https://godoc.org/nhooyr.io/websocket/wspb) subpackages +- [Single dependency](https://pkg.go.dev/nhooyr.io/websocket?tab=imports) +- JSON and protobuf helpers in the [wsjson](https://pkg.go.dev/nhooyr.io/websocket/wsjson) and [wspb](https://pkg.go.dev/nhooyr.io/websocket/wspb) subpackages - Zero alloc reads and writes - Concurrent writes -- [Close handshake](https://godoc.org/nhooyr.io/websocket#Conn.Close) -- [net.Conn](https://godoc.org/nhooyr.io/websocket#NetConn) wrapper -- [Ping pong](https://godoc.org/nhooyr.io/websocket#Conn.Ping) API +- [Close handshake](https://pkg.go.dev/nhooyr.io/websocket#Conn.Close) +- [net.Conn](https://pkg.go.dev/nhooyr.io/websocket#NetConn) wrapper +- [Ping pong](https://pkg.go.dev/nhooyr.io/websocket#Conn.Ping) API - [RFC 7692](https://tools.ietf.org/html/rfc7692) permessage-deflate compression -- Compile to [Wasm](https://godoc.org/nhooyr.io/websocket#hdr-Wasm) +- Compile to [Wasm](https://pkg.go.dev/nhooyr.io/websocket#hdr-Wasm) ## Roadmap @@ -32,7 +32,10 @@ go get nhooyr.io/websocket ## Examples -For a production quality example that demonstrates the complete API, see the [echo example](https://godoc.org/nhooyr.io/websocket#example-package--Echo). +For a production quality example that demonstrates the complete API, see the +[echo example](./examples/echo). + +For a full stack example, see the [chat example](./examples/chat). ### Server @@ -86,14 +89,14 @@ c.Close(websocket.StatusNormalClosure, "") Advantages of [gorilla/websocket](https://github.com/gorilla/websocket): - Mature and widely used -- [Prepared writes](https://godoc.org/github.com/gorilla/websocket#PreparedMessage) -- Configurable [buffer sizes](https://godoc.org/github.com/gorilla/websocket#hdr-Buffers) +- [Prepared writes](https://pkg.go.dev/github.com/gorilla/websocket#PreparedMessage) +- Configurable [buffer sizes](https://pkg.go.dev/github.com/gorilla/websocket#hdr-Buffers) Advantages of nhooyr.io/websocket: - Minimal and idiomatic API - - Compare godoc of [nhooyr.io/websocket](https://godoc.org/nhooyr.io/websocket) with [gorilla/websocket](https://godoc.org/github.com/gorilla/websocket) side by side. -- [net.Conn](https://godoc.org/nhooyr.io/websocket#NetConn) wrapper + - Compare godoc of [nhooyr.io/websocket](https://pkg.go.dev/nhooyr.io/websocket) with [gorilla/websocket](https://pkg.go.dev/github.com/gorilla/websocket) side by side. +- [net.Conn](https://pkg.go.dev/nhooyr.io/websocket#NetConn) wrapper - Zero alloc reads and writes ([gorilla/websocket#535](https://github.com/gorilla/websocket/issues/535)) - Full [context.Context](https://blog.golang.org/context) support - Dial uses [net/http.Client](https://golang.org/pkg/net/http/#Client) @@ -101,24 +104,24 @@ Advantages of nhooyr.io/websocket: - Gorilla writes directly to a net.Conn and so duplicates features of net/http.Client. - Concurrent writes - Close handshake ([gorilla/websocket#448](https://github.com/gorilla/websocket/issues/448)) -- Idiomatic [ping pong](https://godoc.org/nhooyr.io/websocket#Conn.Ping) API +- Idiomatic [ping pong](https://pkg.go.dev/nhooyr.io/websocket#Conn.Ping) API - Gorilla requires registering a pong callback before sending a Ping - Can target Wasm ([gorilla/websocket#432](https://github.com/gorilla/websocket/issues/432)) -- Transparent message buffer reuse with [wsjson](https://godoc.org/nhooyr.io/websocket/wsjson) and [wspb](https://godoc.org/nhooyr.io/websocket/wspb) subpackages +- Transparent message buffer reuse with [wsjson](https://pkg.go.dev/nhooyr.io/websocket/wsjson) and [wspb](https://pkg.go.dev/nhooyr.io/websocket/wspb) subpackages - [1.75x](https://github.com/nhooyr/websocket/releases/tag/v1.7.4) faster WebSocket masking implementation in pure Go - Gorilla's implementation is slower and uses [unsafe](https://golang.org/pkg/unsafe/). - Full [permessage-deflate](https://tools.ietf.org/html/rfc7692) compression extension support - Gorilla only supports no context takeover mode - We use [klauspost/compress](https://github.com/klauspost/compress) for much lower memory usage ([gorilla/websocket#203](https://github.com/gorilla/websocket/issues/203)) -- [CloseRead](https://godoc.org/nhooyr.io/websocket#Conn.CloseRead) helper ([gorilla/websocket#492](https://github.com/gorilla/websocket/issues/492)) +- [CloseRead](https://pkg.go.dev/nhooyr.io/websocket#Conn.CloseRead) helper ([gorilla/websocket#492](https://github.com/gorilla/websocket/issues/492)) - Actively maintained ([gorilla/websocket#370](https://github.com/gorilla/websocket/issues/370)) #### golang.org/x/net/websocket -[golang.org/x/net/websocket](https://godoc.org/golang.org/x/net/websocket) is deprecated. +[golang.org/x/net/websocket](https://pkg.go.dev/golang.org/x/net/websocket) is deprecated. See [golang/go/issues/18152](https://github.com/golang/go/issues/18152). -The [net.Conn](https://godoc.org/nhooyr.io/websocket#NetConn) wrapper will ease in transitioning +The [net.Conn](https://pkg.go.dev/nhooyr.io/websocket#NetConn) can help in transitioning to nhooyr.io/websocket. #### gobwas/ws diff --git a/vendor/nhooyr.io/websocket/accept.go b/vendor/nhooyr.io/websocket/accept.go index 479138fc4c..18536bdb2c 100644 --- a/vendor/nhooyr.io/websocket/accept.go +++ b/vendor/nhooyr.io/websocket/accept.go @@ -9,10 +9,11 @@ import ( "errors" "fmt" "io" + "log" "net/http" "net/textproto" "net/url" - "strconv" + "path/filepath" "strings" "nhooyr.io/websocket/internal/errd" @@ -25,18 +26,29 @@ type AcceptOptions struct { // reject it, close the connection when c.Subprotocol() == "". Subprotocols []string - // InsecureSkipVerify disables Accept's origin verification behaviour. By default, - // the connection will only be accepted if the request origin is equal to the request - // host. + // InsecureSkipVerify is used to disable Accept's origin verification behaviour. // - // This is only required if you want javascript served from a different domain - // to access your WebSocket server. + // You probably want to use OriginPatterns instead. + InsecureSkipVerify bool + + // OriginPatterns lists the host patterns for authorized origins. + // The request host is always authorized. + // Use this to enable cross origin WebSockets. + // + // i.e javascript running on example.com wants to access a WebSocket server at chat.example.com. + // In such a case, example.com is the origin and chat.example.com is the request host. + // One would set this field to []string{"example.com"} to authorize example.com to connect. // - // See https://stackoverflow.com/a/37837709/4283659 + // Each pattern is matched case insensitively against the request origin host + // with filepath.Match. + // See https://golang.org/pkg/path/filepath/#Match // // Please ensure you understand the ramifications of enabling this. // If used incorrectly your WebSocket server will be open to CSRF attacks. - InsecureSkipVerify bool + // + // Do not use * as a pattern to allow any origin, prefer to use InsecureSkipVerify instead + // to bring attention to the danger of such a setting. + OriginPatterns []string // CompressionMode controls the compression mode. // Defaults to CompressionNoContextTakeover. @@ -55,7 +67,7 @@ type AcceptOptions struct { // the connection to a WebSocket. // // Accept will not allow cross origin requests by default. -// See the InsecureSkipVerify option to allow cross origin requests. +// See the InsecureSkipVerify and OriginPatterns options to allow cross origin requests. // // Accept will write a response to w on all errors. func Accept(w http.ResponseWriter, r *http.Request, opts *AcceptOptions) (*Conn, error) { @@ -77,8 +89,12 @@ func accept(w http.ResponseWriter, r *http.Request, opts *AcceptOptions) (_ *Con } if !opts.InsecureSkipVerify { - err = authenticateOrigin(r) + err = authenticateOrigin(r, opts.OriginPatterns) if err != nil { + if errors.Is(err, filepath.ErrBadPattern) { + log.Printf("websocket: %v", err) + err = errors.New(http.StatusText(http.StatusForbidden)) + } http.Error(w, err.Error(), http.StatusForbidden) return nil, err } @@ -108,6 +124,12 @@ func accept(w http.ResponseWriter, r *http.Request, opts *AcceptOptions) (_ *Con } w.WriteHeader(http.StatusSwitchingProtocols) + // See https://github.com/nhooyr/websocket/issues/166 + if ginWriter, ok := w.(interface { + WriteHeaderNow() + }); ok { + ginWriter.WriteHeaderNow() + } netConn, brw, err := hj.Hijack() if err != nil { @@ -137,13 +159,13 @@ func verifyClientRequest(w http.ResponseWriter, r *http.Request) (errCode int, _ return http.StatusUpgradeRequired, fmt.Errorf("WebSocket protocol violation: handshake request must be at least HTTP/1.1: %q", r.Proto) } - if !headerContainsToken(r.Header, "Connection", "Upgrade") { + if !headerContainsTokenIgnoreCase(r.Header, "Connection", "Upgrade") { w.Header().Set("Connection", "Upgrade") w.Header().Set("Upgrade", "websocket") return http.StatusUpgradeRequired, fmt.Errorf("WebSocket protocol violation: Connection header %q does not contain Upgrade", r.Header.Get("Connection")) } - if !headerContainsToken(r.Header, "Upgrade", "websocket") { + if !headerContainsTokenIgnoreCase(r.Header, "Upgrade", "websocket") { w.Header().Set("Connection", "Upgrade") w.Header().Set("Upgrade", "websocket") return http.StatusUpgradeRequired, fmt.Errorf("WebSocket protocol violation: Upgrade header %q does not contain websocket", r.Header.Get("Upgrade")) @@ -165,18 +187,35 @@ func verifyClientRequest(w http.ResponseWriter, r *http.Request) (errCode int, _ return 0, nil } -func authenticateOrigin(r *http.Request) error { +func authenticateOrigin(r *http.Request, originHosts []string) error { origin := r.Header.Get("Origin") - if origin != "" { - u, err := url.Parse(origin) + if origin == "" { + return nil + } + + u, err := url.Parse(origin) + if err != nil { + return fmt.Errorf("failed to parse Origin header %q: %w", origin, err) + } + + if strings.EqualFold(r.Host, u.Host) { + return nil + } + + for _, hostPattern := range originHosts { + matched, err := match(hostPattern, u.Host) if err != nil { - return fmt.Errorf("failed to parse Origin header %q: %w", origin, err) + return fmt.Errorf("failed to parse filepath pattern %q: %w", hostPattern, err) } - if !strings.EqualFold(u.Host, r.Host) { - return fmt.Errorf("request Origin %q is not authorized for Host %q", origin, r.Host) + if matched { + return nil } } - return nil + return fmt.Errorf("request Origin %q is not authorized for Host %q", origin, r.Host) +} + +func match(pattern, s string) (bool, error) { + return filepath.Match(strings.ToLower(pattern), strings.ToLower(s)) } func selectSubprotocol(r *http.Request, subprotocols []string) string { @@ -200,8 +239,9 @@ func acceptCompression(r *http.Request, w http.ResponseWriter, mode CompressionM switch ext.name { case "permessage-deflate": return acceptDeflate(w, ext, mode) - case "x-webkit-deflate-frame": - return acceptWebkitDeflate(w, ext, mode) + // Disabled for now, see https://github.com/nhooyr/websocket/issues/218 + // case "x-webkit-deflate-frame": + // return acceptWebkitDeflate(w, ext, mode) } } return nil, nil @@ -235,16 +275,6 @@ func acceptDeflate(w http.ResponseWriter, ext websocketExtension, mode Compressi return copts, nil } -// parseExtensionParameter parses the value in the extension parameter p. -func parseExtensionParameter(p string) (int, bool) { - ps := strings.Split(p, "=") - if len(ps) == 1 { - return 0, false - } - i, e := strconv.Atoi(strings.Trim(ps[1], `"`)) - return i, e == nil -} - func acceptWebkitDeflate(w http.ResponseWriter, ext websocketExtension, mode CompressionMode) (*compressionOptions, error) { copts := mode.opts() // The peer must explicitly request it. @@ -279,11 +309,9 @@ func acceptWebkitDeflate(w http.ResponseWriter, ext websocketExtension, mode Com return copts, nil } -func headerContainsToken(h http.Header, key, token string) bool { - token = strings.ToLower(token) - +func headerContainsTokenIgnoreCase(h http.Header, key, token string) bool { for _, t := range headerTokens(h, key) { - if t == token { + if strings.EqualFold(t, token) { return true } } @@ -324,7 +352,6 @@ func headerTokens(h http.Header, key string) []string { for _, v := range h[key] { v = strings.TrimSpace(v) for _, t := range strings.Split(v, ",") { - t = strings.ToLower(t) t = strings.TrimSpace(t) tokens = append(tokens, t) } diff --git a/vendor/nhooyr.io/websocket/accept_js.go b/vendor/nhooyr.io/websocket/accept_js.go index 724b35b5bc..daad4b79fe 100644 --- a/vendor/nhooyr.io/websocket/accept_js.go +++ b/vendor/nhooyr.io/websocket/accept_js.go @@ -9,6 +9,7 @@ import ( type AcceptOptions struct { Subprotocols []string InsecureSkipVerify bool + OriginPatterns []string CompressionMode CompressionMode CompressionThreshold int } diff --git a/vendor/nhooyr.io/websocket/close_notjs.go b/vendor/nhooyr.io/websocket/close_notjs.go index c25b088f19..4251311d2e 100644 --- a/vendor/nhooyr.io/websocket/close_notjs.go +++ b/vendor/nhooyr.io/websocket/close_notjs.go @@ -34,15 +34,17 @@ func (c *Conn) Close(code StatusCode, reason string) error { func (c *Conn) closeHandshake(code StatusCode, reason string) (err error) { defer errd.Wrap(&err, "failed to close WebSocket") - err = c.writeClose(code, reason) - if err != nil && CloseStatus(err) == -1 && err != errAlreadyWroteClose { - return err + writeErr := c.writeClose(code, reason) + closeHandshakeErr := c.waitCloseHandshake() + + if writeErr != nil { + return writeErr } - err = c.waitCloseHandshake() - if CloseStatus(err) == -1 { - return err + if CloseStatus(closeHandshakeErr) == -1 { + return closeHandshakeErr } + return nil } @@ -50,10 +52,10 @@ var errAlreadyWroteClose = errors.New("already wrote close") func (c *Conn) writeClose(code StatusCode, reason string) error { c.closeMu.Lock() - closing := c.wroteClose + wroteClose := c.wroteClose c.wroteClose = true c.closeMu.Unlock() - if closing { + if wroteClose { return errAlreadyWroteClose } @@ -62,35 +64,41 @@ func (c *Conn) writeClose(code StatusCode, reason string) error { Reason: reason, } - c.setCloseErr(fmt.Errorf("sent close frame: %w", ce)) - var p []byte - var err error + var marshalErr error if ce.Code != StatusNoStatusRcvd { - p, err = ce.bytes() - if err != nil { - log.Printf("websocket: %v", err) + p, marshalErr = ce.bytes() + if marshalErr != nil { + log.Printf("websocket: %v", marshalErr) } } - werr := c.writeControl(context.Background(), opClose, p) - if err != nil { - return err + writeErr := c.writeControl(context.Background(), opClose, p) + if CloseStatus(writeErr) != -1 { + // Not a real error if it's due to a close frame being received. + writeErr = nil + } + + // We do this after in case there was an error writing the close frame. + c.setCloseErr(fmt.Errorf("sent close frame: %w", ce)) + + if marshalErr != nil { + return marshalErr } - return werr + return writeErr } func (c *Conn) waitCloseHandshake() error { defer c.close(nil) - ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) + ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) defer cancel() - err := c.readMu.Lock(ctx) + err := c.readMu.lock(ctx) if err != nil { return err } - defer c.readMu.Unlock() + defer c.readMu.unlock() if c.readCloseFrameErr != nil { return c.readCloseFrameErr diff --git a/vendor/nhooyr.io/websocket/compress.go b/vendor/nhooyr.io/websocket/compress.go index 57446d01f4..80b46d1c1d 100644 --- a/vendor/nhooyr.io/websocket/compress.go +++ b/vendor/nhooyr.io/websocket/compress.go @@ -7,6 +7,7 @@ package websocket // by safari. See https://tools.ietf.org/html/draft-tyoshino-hybi-websocket-perframe-deflate-06 // It will work the same in every way except that we cannot signal to the peer we // want to use no context takeover on our side, we can only signal that they should. +// It is however currently disabled due to Safari bugs. See https://github.com/nhooyr/websocket/issues/218 type CompressionMode int const ( diff --git a/vendor/nhooyr.io/websocket/conn_notjs.go b/vendor/nhooyr.io/websocket/conn_notjs.go index 7ee60fbc30..0c85ab7711 100644 --- a/vendor/nhooyr.io/websocket/conn_notjs.go +++ b/vendor/nhooyr.io/websocket/conn_notjs.go @@ -139,16 +139,9 @@ func (c *Conn) close(err error) { c.rwc.Close() go func() { - if c.client { - c.writeFrameMu.Lock(context.Background()) - putBufioWriter(c.bw) - } c.msgWriterState.close() c.msgReader.close() - if c.client { - putBufioReader(c.br) - } }() } @@ -196,7 +189,7 @@ func (c *Conn) Ping(ctx context.Context) error { } func (c *Conn) ping(ctx context.Context, p string) error { - pong := make(chan struct{}) + pong := make(chan struct{}, 1) c.activePingsMu.Lock() c.activePings[p] = pong @@ -237,7 +230,11 @@ func newMu(c *Conn) *mu { } } -func (m *mu) Lock(ctx context.Context) error { +func (m *mu) forceLock() { + m.ch <- struct{}{} +} + +func (m *mu) lock(ctx context.Context) error { select { case <-m.c.closed: return m.c.closeErr @@ -246,11 +243,21 @@ func (m *mu) Lock(ctx context.Context) error { m.c.close(err) return err case m.ch <- struct{}{}: + // To make sure the connection is certainly alive. + // As it's possible the send on m.ch was selected + // over the receive on closed. + select { + case <-m.c.closed: + // Make sure to release. + m.unlock() + return m.c.closeErr + default: + } return nil } } -func (m *mu) Unlock() { +func (m *mu) unlock() { select { case <-m.ch: default: diff --git a/vendor/nhooyr.io/websocket/dial.go b/vendor/nhooyr.io/websocket/dial.go index f882f122f5..7a7787ff71 100644 --- a/vendor/nhooyr.io/websocket/dial.go +++ b/vendor/nhooyr.io/websocket/dial.go @@ -8,7 +8,6 @@ import ( "context" "crypto/rand" "encoding/base64" - "errors" "fmt" "io" "io/ioutil" @@ -58,6 +57,8 @@ type DialOptions struct { // This function requires at least Go 1.12 as it uses a new feature // in net/http to perform WebSocket handshakes. // See docs on the HTTPClient option and https://github.com/golang/go/issues/26937#issuecomment-415855861 +// +// URLs with http/https schemes will work and are interpreted as ws/wss. func Dial(ctx context.Context, u string, opts *DialOptions) (*Conn, *http.Response, error) { return dial(ctx, u, opts, nil) } @@ -72,7 +73,17 @@ func dial(ctx context.Context, urls string, opts *DialOptions, rand io.Reader) ( opts = &*opts if opts.HTTPClient == nil { opts.HTTPClient = http.DefaultClient + } else if opts.HTTPClient.Timeout > 0 { + var cancel context.CancelFunc + + ctx, cancel = context.WithTimeout(ctx, opts.HTTPClient.Timeout) + defer cancel() + + newClient := *opts.HTTPClient + newClient.Timeout = 0 + opts.HTTPClient = &newClient } + if opts.HTTPHeader == nil { opts.HTTPHeader = http.Header{} } @@ -131,10 +142,6 @@ func dial(ctx context.Context, urls string, opts *DialOptions, rand io.Reader) ( } func handshakeRequest(ctx context.Context, urls string, opts *DialOptions, copts *compressionOptions, secWebSocketKey string) (*http.Response, error) { - if opts.HTTPClient.Timeout > 0 { - return nil, errors.New("use context for cancellation instead of http.Client.Timeout; see https://github.com/nhooyr/websocket/issues/67") - } - u, err := url.Parse(urls) if err != nil { return nil, fmt.Errorf("failed to parse url: %w", err) @@ -145,6 +152,7 @@ func handshakeRequest(ctx context.Context, urls string, opts *DialOptions, copts u.Scheme = "http" case "wss": u.Scheme = "https" + case "http", "https": default: return nil, fmt.Errorf("unexpected url scheme: %q", u.Scheme) } @@ -186,11 +194,11 @@ func verifyServerResponse(opts *DialOptions, copts *compressionOptions, secWebSo return nil, fmt.Errorf("expected handshake response status code %v but got %v", http.StatusSwitchingProtocols, resp.StatusCode) } - if !headerContainsToken(resp.Header, "Connection", "Upgrade") { + if !headerContainsTokenIgnoreCase(resp.Header, "Connection", "Upgrade") { return nil, fmt.Errorf("WebSocket protocol violation: Connection header %q does not contain Upgrade", resp.Header.Get("Connection")) } - if !headerContainsToken(resp.Header, "Upgrade", "WebSocket") { + if !headerContainsTokenIgnoreCase(resp.Header, "Upgrade", "WebSocket") { return nil, fmt.Errorf("WebSocket protocol violation: Upgrade header %q does not contain websocket", resp.Header.Get("Upgrade")) } @@ -253,10 +261,10 @@ func verifyServerExtensions(copts *compressionOptions, h http.Header) (*compress return copts, nil } -var readerPool sync.Pool +var bufioReaderPool sync.Pool func getBufioReader(r io.Reader) *bufio.Reader { - br, ok := readerPool.Get().(*bufio.Reader) + br, ok := bufioReaderPool.Get().(*bufio.Reader) if !ok { return bufio.NewReader(r) } @@ -265,13 +273,13 @@ func getBufioReader(r io.Reader) *bufio.Reader { } func putBufioReader(br *bufio.Reader) { - readerPool.Put(br) + bufioReaderPool.Put(br) } -var writerPool sync.Pool +var bufioWriterPool sync.Pool func getBufioWriter(w io.Writer) *bufio.Writer { - bw, ok := writerPool.Get().(*bufio.Writer) + bw, ok := bufioWriterPool.Get().(*bufio.Writer) if !ok { return bufio.NewWriter(w) } @@ -280,5 +288,5 @@ func getBufioWriter(w io.Writer) *bufio.Writer { } func putBufioWriter(bw *bufio.Writer) { - writerPool.Put(bw) + bufioWriterPool.Put(bw) } diff --git a/vendor/nhooyr.io/websocket/go.mod b/vendor/nhooyr.io/websocket/go.mod index 801d6be6d4..c5f1a20f59 100644 --- a/vendor/nhooyr.io/websocket/go.mod +++ b/vendor/nhooyr.io/websocket/go.mod @@ -3,12 +3,13 @@ module nhooyr.io/websocket go 1.13 require ( + github.com/gin-gonic/gin v1.6.3 github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee // indirect github.com/gobwas/pool v0.2.0 // indirect github.com/gobwas/ws v1.0.2 - github.com/golang/protobuf v1.3.3 + github.com/golang/protobuf v1.3.5 github.com/google/go-cmp v0.4.0 github.com/gorilla/websocket v1.4.1 - github.com/klauspost/compress v1.10.0 + github.com/klauspost/compress v1.10.3 golang.org/x/time v0.0.0-20191024005414-555d28b269f0 ) diff --git a/vendor/nhooyr.io/websocket/go.sum b/vendor/nhooyr.io/websocket/go.sum index e4bbd62d33..155c301326 100644 --- a/vendor/nhooyr.io/websocket/go.sum +++ b/vendor/nhooyr.io/websocket/go.sum @@ -1,18 +1,64 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5 h1:F768QJ1E9tib+q5Sc8MkdJi1RxLTbRcTf8LJV56aRls= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/klauspost/compress v1.10.0 h1:92XGj1AcYzA6UrVdd4qIIBrT8OroryvRvdmg/IfmC7Y= -github.com/klauspost/compress v1.10.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/klauspost/compress v1.10.3 h1:OP96hzwJVBIHYU52pVTI6CczrxPvrGfgqF9N5eTO0Q8= +github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= +github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= +github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/nhooyr.io/websocket/read.go b/vendor/nhooyr.io/websocket/read.go index a1efecabb2..ae05cf93ed 100644 --- a/vendor/nhooyr.io/websocket/read.go +++ b/vendor/nhooyr.io/websocket/read.go @@ -52,7 +52,7 @@ func (c *Conn) Read(ctx context.Context) (MessageType, []byte, error) { // // Call CloseRead when you do not expect to read any more messages. // Since it actively reads from the connection, it will ensure that ping, pong and close -// frames are responded to. +// frames are responded to. This means c.Ping and c.Close will still work as expected. func (c *Conn) CloseRead(ctx context.Context) context.Context { ctx, cancel := context.WithCancel(ctx) go func() { @@ -109,12 +109,17 @@ func (mr *msgReader) putFlateReader() { } func (mr *msgReader) close() { - mr.c.readMu.Lock(context.Background()) + mr.c.readMu.forceLock() mr.putFlateReader() mr.dict.close() if mr.flateBufio != nil { putBufioReader(mr.flateBufio) } + + if mr.c.client { + putBufioReader(mr.c.br) + mr.c.br = nil + } } func (mr *msgReader) flateContextTakeover() bool { @@ -266,7 +271,10 @@ func (c *Conn) handleControl(ctx context.Context, h header) (err error) { pong, ok := c.activePings[string(b)] c.activePingsMu.Unlock() if ok { - close(pong) + select { + case pong <- struct{}{}: + default: + } } return nil } @@ -292,14 +300,16 @@ func (c *Conn) handleControl(ctx context.Context, h header) (err error) { func (c *Conn) reader(ctx context.Context) (_ MessageType, _ io.Reader, err error) { defer errd.Wrap(&err, "failed to get reader") - err = c.readMu.Lock(ctx) + err = c.readMu.lock(ctx) if err != nil { return 0, nil, err } - defer c.readMu.Unlock() + defer c.readMu.unlock() if !c.msgReader.fin { - return 0, nil, errors.New("previous message not read to completion") + err = errors.New("previous message not read to completion") + c.close(fmt.Errorf("failed to get reader: %w", err)) + return 0, nil, err } h, err := c.readLoop(ctx) @@ -356,29 +366,25 @@ func (mr *msgReader) setFrame(h header) { } func (mr *msgReader) Read(p []byte) (n int, err error) { - defer func() { - if errors.Is(err, io.ErrUnexpectedEOF) && mr.fin && mr.flate { - err = io.EOF - } - if errors.Is(err, io.EOF) { - err = io.EOF - mr.putFlateReader() - return - } - errd.Wrap(&err, "failed to read") - }() - - err = mr.c.readMu.Lock(mr.ctx) + err = mr.c.readMu.lock(mr.ctx) if err != nil { - return 0, err + return 0, fmt.Errorf("failed to read: %w", err) } - defer mr.c.readMu.Unlock() + defer mr.c.readMu.unlock() n, err = mr.limitReader.Read(p) if mr.flate && mr.flateContextTakeover() { p = p[:n] mr.dict.write(p) } + if errors.Is(err, io.EOF) || errors.Is(err, io.ErrUnexpectedEOF) && mr.fin && mr.flate { + mr.putFlateReader() + return n, io.EOF + } + if err != nil { + err = fmt.Errorf("failed to read: %w", err) + mr.c.close(err) + } return n, err } diff --git a/vendor/nhooyr.io/websocket/write.go b/vendor/nhooyr.io/websocket/write.go index 81b9141ae7..2210cf817a 100644 --- a/vendor/nhooyr.io/websocket/write.go +++ b/vendor/nhooyr.io/websocket/write.go @@ -10,7 +10,6 @@ import ( "errors" "fmt" "io" - "sync" "time" "github.com/klauspost/compress/flate" @@ -71,7 +70,7 @@ type msgWriterState struct { c *Conn mu *mu - writeMu sync.Mutex + writeMu *mu ctx context.Context opcode opcode @@ -83,8 +82,9 @@ type msgWriterState struct { func newMsgWriterState(c *Conn) *msgWriterState { mw := &msgWriterState{ - c: c, - mu: newMu(c), + c: c, + mu: newMu(c), + writeMu: newMu(c), } return mw } @@ -125,7 +125,7 @@ func (c *Conn) write(ctx context.Context, typ MessageType, p []byte) (int, error } if !c.flate() { - defer c.msgWriterState.mu.Unlock() + defer c.msgWriterState.mu.unlock() return c.writeFrame(ctx, true, false, c.msgWriterState.opcode, p) } @@ -139,7 +139,7 @@ func (c *Conn) write(ctx context.Context, typ MessageType, p []byte) (int, error } func (mw *msgWriterState) reset(ctx context.Context, typ MessageType) error { - err := mw.mu.Lock(ctx) + err := mw.mu.lock(ctx) if err != nil { return err } @@ -155,10 +155,18 @@ func (mw *msgWriterState) reset(ctx context.Context, typ MessageType) error { // Write writes the given bytes to the WebSocket connection. func (mw *msgWriterState) Write(p []byte) (_ int, err error) { - defer errd.Wrap(&err, "failed to write") + err = mw.writeMu.lock(mw.ctx) + if err != nil { + return 0, fmt.Errorf("failed to write: %w", err) + } + defer mw.writeMu.unlock() - mw.writeMu.Lock() - defer mw.writeMu.Unlock() + defer func() { + if err != nil { + err = fmt.Errorf("failed to write: %w", err) + mw.c.close(err) + } + }() if mw.c.flate() { // Only enables flate if the length crosses the @@ -193,8 +201,11 @@ func (mw *msgWriterState) write(p []byte) (int, error) { func (mw *msgWriterState) Close() (err error) { defer errd.Wrap(&err, "failed to close writer") - mw.writeMu.Lock() - defer mw.writeMu.Unlock() + err = mw.writeMu.lock(mw.ctx) + if err != nil { + return err + } + defer mw.writeMu.unlock() _, err = mw.c.writeFrame(mw.ctx, true, mw.flate, mw.opcode, nil) if err != nil { @@ -204,12 +215,17 @@ func (mw *msgWriterState) Close() (err error) { if mw.flate && !mw.flateContextTakeover() { mw.dict.close() } - mw.mu.Unlock() + mw.mu.unlock() return nil } func (mw *msgWriterState) close() { - mw.writeMu.Lock() + if mw.c.client { + mw.c.writeFrameMu.forceLock() + putBufioWriter(mw.c.bw) + } + + mw.writeMu.forceLock() mw.dict.close() } @@ -225,12 +241,29 @@ func (c *Conn) writeControl(ctx context.Context, opcode opcode, p []byte) error } // frame handles all writes to the connection. -func (c *Conn) writeFrame(ctx context.Context, fin bool, flate bool, opcode opcode, p []byte) (int, error) { - err := c.writeFrameMu.Lock(ctx) +func (c *Conn) writeFrame(ctx context.Context, fin bool, flate bool, opcode opcode, p []byte) (_ int, err error) { + err = c.writeFrameMu.lock(ctx) if err != nil { return 0, err } - defer c.writeFrameMu.Unlock() + defer c.writeFrameMu.unlock() + + // If the state says a close has already been written, we wait until + // the connection is closed and return that error. + // + // However, if the frame being written is a close, that means its the close from + // the state being set so we let it go through. + c.closeMu.Lock() + wroteClose := c.wroteClose + c.closeMu.Unlock() + if wroteClose && opcode != opClose { + select { + case <-ctx.Done(): + return 0, ctx.Err() + case <-c.closed: + return 0, c.closeErr + } + } select { case <-c.closed: @@ -238,6 +271,19 @@ func (c *Conn) writeFrame(ctx context.Context, fin bool, flate bool, opcode opco case c.writeTimeout <- ctx: } + defer func() { + if err != nil { + select { + case <-c.closed: + err = c.closeErr + case <-ctx.Done(): + err = ctx.Err() + } + c.close(err) + err = fmt.Errorf("failed to write frame: %w", err) + } + }() + c.writeHeader.fin = fin c.writeHeader.opcode = opcode c.writeHeader.payloadLength = int64(len(p)) diff --git a/vendor/nhooyr.io/websocket/ws_js.go b/vendor/nhooyr.io/websocket/ws_js.go index 2b560ce87d..b87e32cdaf 100644 --- a/vendor/nhooyr.io/websocket/ws_js.go +++ b/vendor/nhooyr.io/websocket/ws_js.go @@ -9,6 +9,7 @@ import ( "net/http" "reflect" "runtime" + "strings" "sync" "syscall/js" @@ -255,6 +256,9 @@ func dial(ctx context.Context, url string, opts *DialOptions) (*Conn, *http.Resp opts = &DialOptions{} } + url = strings.Replace(url, "http://", "ws://", 1) + url = strings.Replace(url, "https://", "wss://", 1) + ws, err := wsjs.New(url, opts.Subprotocols) if err != nil { return nil, nil, err From 4cede696182040f78f141b82eaf20cbdba071900 Mon Sep 17 00:00:00 2001 From: ersonp Date: Wed, 21 Apr 2021 16:07:28 +0530 Subject: [PATCH 3/6] goimports --- cmd/apps/skychat/chat.go | 5 ++--- cmd/skywire-visor/commands/root.go | 5 ++--- pkg/visor/hypervisorconfig/config.go | 3 +-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/cmd/apps/skychat/chat.go b/cmd/apps/skychat/chat.go index 6a233c8b3f..360fe5e4b0 100644 --- a/cmd/apps/skychat/chat.go +++ b/cmd/apps/skychat/chat.go @@ -4,18 +4,17 @@ skychat app for skywire visor package main import ( + "embed" "encoding/json" "flag" "fmt" + "io/fs" "net" "net/http" "os" "sync" "time" - "embed" - "io/fs" - "github.com/skycoin/dmsg/buildinfo" "github.com/skycoin/dmsg/cipher" diff --git a/cmd/skywire-visor/commands/root.go b/cmd/skywire-visor/commands/root.go index 341c8b8fdf..c15c926996 100644 --- a/cmd/skywire-visor/commands/root.go +++ b/cmd/skywire-visor/commands/root.go @@ -2,8 +2,10 @@ package commands import ( "context" + "embed" "fmt" "io" + "io/fs" "io/ioutil" "net/http" _ "net/http/pprof" // nolint:gosec // https://golang.org/doc/diagnostics.html#profiling @@ -13,9 +15,6 @@ import ( "syscall" "time" - "embed" - "io/fs" - "github.com/pkg/profile" "github.com/skycoin/dmsg/buildinfo" "github.com/skycoin/dmsg/cmdutil" diff --git a/pkg/visor/hypervisorconfig/config.go b/pkg/visor/hypervisorconfig/config.go index 1b165cc331..637e815a89 100644 --- a/pkg/visor/hypervisorconfig/config.go +++ b/pkg/visor/hypervisorconfig/config.go @@ -3,14 +3,13 @@ package hypervisorconfig import ( "encoding/hex" "encoding/json" + "io/fs" "log" "net/http" "os" "path/filepath" "time" - "io/fs" - "github.com/skycoin/dmsg/cipher" "github.com/skycoin/skywire/pkg/skyenv" From 64c39ef09399d428b40bd3979a2c4912280c52f9 Mon Sep 17 00:00:00 2001 From: ersonp Date: Wed, 21 Apr 2021 21:51:22 +0530 Subject: [PATCH 4/6] Removed live mode --- cmd/apps/skychat/chat.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/cmd/apps/skychat/chat.go b/cmd/apps/skychat/chat.go index 360fe5e4b0..d9730e9969 100644 --- a/cmd/apps/skychat/chat.go +++ b/cmd/apps/skychat/chat.go @@ -59,7 +59,7 @@ func main() { conns = make(map[cipher.PubKey]net.Conn) go listenLoop() - http.Handle("/", http.FileServer(getFileSystem(false))) + http.Handle("/", http.FileServer(getFileSystem())) http.HandleFunc("/message", messageHandler) http.HandleFunc("/sse", sseHandler) @@ -204,17 +204,10 @@ func sseHandler(w http.ResponseWriter, req *http.Request) { } } -func getFileSystem(useOS bool) http.FileSystem { - if useOS { - fmt.Print("using live mode") - return http.FS(os.DirFS("static")) - } - - fmt.Print("using embed mode") +func getFileSystem() http.FileSystem { fsys, err := fs.Sub(embededFiles, "static") if err != nil { panic(err) } - return http.FS(fsys) } From 590712447a9fa3b2810066ade8d05312ae201e60 Mon Sep 17 00:00:00 2001 From: ersonp Date: Mon, 26 Apr 2021 17:36:03 +0530 Subject: [PATCH 5/6] Add comment --- cmd/apps/skychat/chat.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/apps/skychat/chat.go b/cmd/apps/skychat/chat.go index d9730e9969..1ff04fb7ef 100644 --- a/cmd/apps/skychat/chat.go +++ b/cmd/apps/skychat/chat.go @@ -39,6 +39,8 @@ var ( connsMu sync.Mutex ) +// the go embed static points to skywire/cmd/apps/skychat/static + //go:embed static var embededFiles embed.FS From 900920bdf93395bc2c92919ed67964c9881aea96 Mon Sep 17 00:00:00 2001 From: ersonp Date: Mon, 26 Apr 2021 18:17:56 +0530 Subject: [PATCH 6/6] Revert dependency upgrades --- go.mod | 43 +- go.sum | 338 +- .../AudriusButkevicius/pfilter/filter.go | 39 +- vendor/github.com/StackExchange/wmi/wmi.go | 150 +- .../VictoriaMetrics/metrics/README.md | 8 +- .../VictoriaMetrics/metrics/histogram.go | 198 +- .../VictoriaMetrics/metrics/metrics.go | 47 +- .../metrics/process_metrics_linux.go | 188 +- .../metrics/process_metrics_other.go | 4 - .../github.com/andybalholm/brotli/encode.go | 3 +- vendor/github.com/andybalholm/brotli/go.mod | 2 + vendor/github.com/andybalholm/brotli/go.sum | 2 + vendor/github.com/andybalholm/brotli/http.go | 192 - .../github.com/andybalholm/brotli/writer.go | 42 +- vendor/github.com/go-ole/go-ole/com.go | 52 +- vendor/github.com/go-ole/go-ole/go.mod | 2 - vendor/github.com/go-ole/go-ole/go.sum | 2 - .../go-ole/go-ole/safearray_windows.go | 58 +- vendor/github.com/go-ole/go-ole/variables.go | 13 +- vendor/github.com/golang/gddo/LICENSE | 27 + .../github.com/golang/gddo/httputil/buster.go | 95 + .../golang/gddo/httputil/header/header.go | 298 + .../golang/gddo/httputil/httputil.go | 25 + .../golang/gddo/httputil/negotiate.go | 79 + .../golang/gddo/httputil/respbuf.go | 58 + .../github.com/golang/gddo/httputil/static.go | 265 + .../golang/gddo/httputil/transport.go | 87 + .../google/go-querystring/query/encode.go | 97 +- vendor/github.com/google/uuid/README.md | 2 +- vendor/github.com/google/uuid/hash.go | 4 +- vendor/github.com/google/uuid/marshal.go | 7 +- vendor/github.com/google/uuid/sql.go | 2 +- vendor/github.com/google/uuid/uuid.go | 10 +- vendor/github.com/google/uuid/version1.go | 12 +- vendor/github.com/google/uuid/version4.go | 15 +- .../klauspost/compress/flate/deflate.go | 57 +- .../klauspost/compress/flate/fast_encoder.go | 7 +- .../klauspost/compress/flate/gen_inflate.go | 274 - .../compress/flate/huffman_bit_writer.go | 13 - .../klauspost/compress/flate/huffman_code.go | 4 +- .../klauspost/compress/flate/inflate.go | 130 +- .../klauspost/compress/flate/inflate_gen.go | 922 - .../klauspost/compress/flate/level1.go | 22 +- .../klauspost/compress/flate/level2.go | 28 +- .../klauspost/compress/flate/level3.go | 54 +- .../klauspost/compress/flate/level4.go | 32 +- .../klauspost/compress/flate/level5.go | 46 +- .../klauspost/compress/flate/level6.go | 36 +- .../klauspost/compress/flate/token.go | 4 +- .../klauspost/compress/fse/bitreader.go | 27 +- .../klauspost/compress/fse/bytereader.go | 13 +- .../github.com/klauspost/compress/fse/fse.go | 37 +- .../klauspost/compress/gzip/gunzip.go | 344 - .../klauspost/compress/gzip/gzip.go | 269 - .../klauspost/compress/huff0/README.md | 6 +- .../klauspost/compress/huff0/bitreader.go | 256 +- .../klauspost/compress/huff0/decompress.go | 904 +- .../klauspost/compress/huff0/huff0.go | 13 +- .../klauspost/compress/zstd/README.md | 214 +- .../klauspost/compress/zstd/bitreader.go | 25 +- .../klauspost/compress/zstd/blockdec.go | 73 +- .../klauspost/compress/zstd/blockenc.go | 12 +- .../klauspost/compress/zstd/bytebuf.go | 4 +- .../klauspost/compress/zstd/bytereader.go | 18 +- .../klauspost/compress/zstd/decoder.go | 55 +- .../compress/zstd/decoder_options.go | 16 - .../klauspost/compress/zstd/dict.go | 104 - .../klauspost/compress/zstd/enc_better.go | 518 - .../klauspost/compress/zstd/enc_dfast.go | 112 +- .../klauspost/compress/zstd/enc_fast.go | 227 +- .../klauspost/compress/zstd/enc_params.go | 3 - .../klauspost/compress/zstd/encoder.go | 91 +- .../compress/zstd/encoder_options.go | 76 +- .../klauspost/compress/zstd/framedec.go | 55 +- .../klauspost/compress/zstd/fse_decoder.go | 23 +- .../klauspost/compress/zstd/fse_encoder.go | 8 +- .../klauspost/compress/zstd/history.go | 18 +- .../zstd/internal/xxhash/xxhash_amd64.s | 8 +- .../klauspost/compress/zstd/seqdec.go | 143 +- .../klauspost/compress/zstd/snappy.go | 2 +- .../klauspost/compress/zstd/zstd.go | 42 +- .../klauspost/cpuid/{v2 => }/.gitignore | 0 vendor/github.com/klauspost/cpuid/.travis.yml | 23 + .../klauspost/cpuid/{v2 => }/CONTRIBUTING.txt | 0 .../klauspost/cpuid/{v2 => }/LICENSE | 0 vendor/github.com/klauspost/cpuid/README.md | 157 + vendor/github.com/klauspost/cpuid/cpuid.go | 1308 + .../klauspost/cpuid/{v2 => }/cpuid_386.s | 2 +- .../klauspost/cpuid/{v2 => }/cpuid_amd64.s | 2 +- .../klauspost/cpuid/detect_intel.go | 17 + .../github.com/klauspost/cpuid/detect_ref.go | 23 + vendor/github.com/klauspost/cpuid/generate.go | 4 + .../github.com/klauspost/cpuid/v2/.travis.yml | 63 - .../github.com/klauspost/cpuid/v2/README.md | 136 - vendor/github.com/klauspost/cpuid/v2/cpuid.go | 1002 - .../klauspost/cpuid/v2/cpuid_arm64.s | 26 - .../klauspost/cpuid/v2/detect_arm64.go | 246 - .../klauspost/cpuid/v2/detect_ref.go | 14 - .../klauspost/cpuid/v2/detect_x86.go | 33 - .../klauspost/cpuid/v2/featureid_string.go | 173 - vendor/github.com/klauspost/cpuid/v2/go.mod | 3 - .../klauspost/cpuid/v2/os_darwin_arm64.go | 15 - .../klauspost/cpuid/v2/os_linux_arm64.go | 161 - .../klauspost/cpuid/v2/os_other_arm64.go | 11 - vendor/github.com/klauspost/pgzip/LICENSE | 3 +- vendor/github.com/klauspost/pgzip/README.md | 17 +- vendor/github.com/klauspost/pgzip/gzip.go | 80 +- .../klauspost/reedsolomon/.travis.yml | 10 +- .../klauspost/reedsolomon/README.md | 20 +- .../klauspost/reedsolomon/galois.go | 10 +- .../klauspost/reedsolomon/galois_gen_amd64.s | 6543 ++- .../github.com/klauspost/reedsolomon/gen.go | 249 + .../github.com/klauspost/reedsolomon/go.mod | 4 +- .../github.com/klauspost/reedsolomon/go.sum | 4 +- .../klauspost/reedsolomon/inversion_tree.go | 30 +- .../klauspost/reedsolomon/matrix.go | 5 +- .../klauspost/reedsolomon/options.go | 27 +- .../klauspost/reedsolomon/reedsolomon.go | 47 +- .../github.com/mholt/archiver/v3/.gitignore | 7 +- .../mholt/archiver/v3/.goreleaser.yml | 41 - .../github.com/mholt/archiver/v3/.prettierrc | 4 - vendor/github.com/mholt/archiver/v3/README.md | 101 +- .../github.com/mholt/archiver/v3/archiver.go | 5 - .../mholt/archiver/v3/azure-pipelines.yml | 51 +- vendor/github.com/mholt/archiver/v3/error.go | 27 - vendor/github.com/mholt/archiver/v3/go.mod | 15 +- vendor/github.com/mholt/archiver/v3/go.sum | 26 +- vendor/github.com/mholt/archiver/v3/gz.go | 4 +- vendor/github.com/mholt/archiver/v3/lz4.go | 11 +- vendor/github.com/mholt/archiver/v3/rar.go | 41 +- vendor/github.com/mholt/archiver/v3/sz.go | 2 +- vendor/github.com/mholt/archiver/v3/tar.go | 64 +- vendor/github.com/mholt/archiver/v3/targz.go | 4 +- vendor/github.com/mholt/archiver/v3/tarlz4.go | 11 +- vendor/github.com/mholt/archiver/v3/tarsz.go | 2 +- vendor/github.com/mholt/archiver/v3/zip.go | 125 +- vendor/github.com/mholt/archiver/v3/zstd.go | 6 +- .../go-sysconf => mmcloughlin/avo}/LICENSE | 2 +- .../github.com/mmcloughlin/avo/attr/attr.go | 102 + .../github.com/mmcloughlin/avo/build/attr.go | 18 + .../github.com/mmcloughlin/avo/build/cli.go | 171 + .../mmcloughlin/avo/build/context.go | 223 + .../github.com/mmcloughlin/avo/build/doc.go | 2 + .../github.com/mmcloughlin/avo/build/error.go | 88 + .../mmcloughlin/avo/build/global.go | 151 + .../mmcloughlin/avo/build/pseudo.go | 70 + .../mmcloughlin/avo/build/zinstructions.go | 26315 ++++++++++++ .../github.com/mmcloughlin/avo/build/zmov.go | 72 + .../mmcloughlin/avo/buildtags/buildtags.go | 312 + .../mmcloughlin/avo/gotypes/components.go | 253 + .../github.com/mmcloughlin/avo/gotypes/doc.go | 2 + .../mmcloughlin/avo/gotypes/signature.go | 177 + .../mmcloughlin/avo/internal/prnt/printer.go | 60 + .../mmcloughlin/avo/internal/stack/stack.go | 73 + vendor/github.com/mmcloughlin/avo/ir/doc.go | 2 + vendor/github.com/mmcloughlin/avo/ir/ir.go | 355 + .../mmcloughlin/avo/operand/checks.go | 247 + .../mmcloughlin/avo/operand/const.go | 36 + .../github.com/mmcloughlin/avo/operand/doc.go | 2 + .../mmcloughlin/avo/operand/types.go | 151 + .../mmcloughlin/avo/operand/zconst.go | 75 + .../github.com/mmcloughlin/avo/pass/alloc.go | 190 + vendor/github.com/mmcloughlin/avo/pass/cfg.go | 81 + .../mmcloughlin/avo/pass/cleanup.go | 123 + vendor/github.com/mmcloughlin/avo/pass/isa.go | 31 + .../github.com/mmcloughlin/avo/pass/pass.go | 100 + vendor/github.com/mmcloughlin/avo/pass/reg.go | 139 + .../mmcloughlin/avo/pass/textflag.go | 42 + .../github.com/mmcloughlin/avo/pass/verify.go | 32 + .../mmcloughlin/avo/printer/goasm.go | 186 + .../mmcloughlin/avo/printer/printer.go | 98 + .../mmcloughlin/avo/printer/stubs.go | 45 + .../mmcloughlin/avo/reg/collection.go | 54 + vendor/github.com/mmcloughlin/avo/reg/doc.go | 2 + vendor/github.com/mmcloughlin/avo/reg/set.go | 112 + .../github.com/mmcloughlin/avo/reg/types.go | 304 + vendor/github.com/mmcloughlin/avo/reg/x86.go | 331 + vendor/github.com/mmcloughlin/avo/src/src.go | 62 + vendor/github.com/mmcloughlin/avo/x86/doc.go | 2 + vendor/github.com/mmcloughlin/avo/x86/gen.go | 4 + .../github.com/mmcloughlin/avo/x86/zctors.go | 34629 ++++++++++++++++ .../github.com/nwaples/rardecode/archive.go | 15 +- .../github.com/nwaples/rardecode/huffman.go | 2 +- vendor/github.com/nwaples/rardecode/reader.go | 7 - .../pierrec/lz4/{v4 => }/.gitignore | 3 +- vendor/github.com/pierrec/lz4/.travis.yml | 18 + .../github.com/pierrec/lz4/{v4 => }/LICENSE | 0 vendor/github.com/pierrec/lz4/README.md | 24 + vendor/github.com/pierrec/lz4/block.go | 397 + vendor/github.com/pierrec/lz4/debug.go | 23 + vendor/github.com/pierrec/lz4/debug_stub.go | 7 + .../pierrec/lz4/internal/xxh32/xxh32zero.go | 222 + vendor/github.com/pierrec/lz4/lz4.go | 68 + vendor/github.com/pierrec/lz4/lz4_go1.10.go | 29 + .../github.com/pierrec/lz4/lz4_notgo1.10.go | 29 + vendor/github.com/pierrec/lz4/reader.go | 295 + vendor/github.com/pierrec/lz4/v4/.travis.yml | 19 - vendor/github.com/pierrec/lz4/v4/README.md | 90 - vendor/github.com/pierrec/lz4/v4/go.mod | 3 - vendor/github.com/pierrec/lz4/v4/go.sum | 0 .../pierrec/lz4/v4/internal/lz4block/block.go | 469 - .../lz4/v4/internal/lz4block/blocks.go | 87 - .../lz4/v4/internal/lz4block/decode_amd64.s | 369 - .../lz4/v4/internal/lz4block/decode_arm.s | 201 - .../lz4/v4/internal/lz4block/decode_asm.go | 9 - .../lz4/v4/internal/lz4block/decode_other.go | 100 - .../lz4/v4/internal/lz4errors/errors.go | 19 - .../lz4/v4/internal/lz4stream/frame.go | 377 - .../lz4/v4/internal/lz4stream/frame_gen.go | 103 - .../lz4/v4/internal/xxh32/xxh32zero.go | 212 - .../lz4/v4/internal/xxh32/xxh32zero_arm.go | 11 - .../lz4/v4/internal/xxh32/xxh32zero_arm.s | 259 - .../lz4/v4/internal/xxh32/xxh32zero_other.go | 10 - vendor/github.com/pierrec/lz4/v4/lz4.go | 147 - vendor/github.com/pierrec/lz4/v4/options.go | 187 - .../github.com/pierrec/lz4/v4/options_gen.go | 92 - vendor/github.com/pierrec/lz4/v4/reader.go | 192 - vendor/github.com/pierrec/lz4/v4/state.go | 75 - vendor/github.com/pierrec/lz4/v4/state_gen.go | 28 - vendor/github.com/pierrec/lz4/v4/writer.go | 232 - vendor/github.com/pierrec/lz4/writer.go | 267 + vendor/github.com/shirou/gopsutil/cpu/cpu.go | 4 +- .../shirou/gopsutil/cpu/cpu_darwin.go | 13 +- .../shirou/gopsutil/cpu/cpu_darwin_cgo.go | 1 - .../shirou/gopsutil/cpu/cpu_dragonfly.go | 154 - .../gopsutil/cpu/cpu_dragonfly_amd64.go | 9 - .../shirou/gopsutil/cpu/cpu_fallback.go | 2 +- .../shirou/gopsutil/cpu/cpu_freebsd.go | 13 +- .../shirou/gopsutil/cpu/cpu_linux.go | 38 +- .../shirou/gopsutil/cpu/cpu_openbsd.go | 39 +- .../shirou/gopsutil/cpu/cpu_solaris.go | 13 +- .../shirou/gopsutil/internal/common/common.go | 12 +- .../gopsutil/internal/common/common_darwin.go | 4 +- .../gopsutil/internal/common/common_linux.go | 42 +- .../internal/common/common_windows.go | 77 +- .../shirou/gopsutil/internal/common/sleep.go | 18 - vendor/github.com/shirou/gopsutil/mem/mem.go | 4 - .../shirou/gopsutil/mem/mem_linux.go | 154 +- .../shirou/gopsutil/mem/mem_openbsd.go | 31 +- .../shirou/gopsutil/mem/mem_openbsd_386.go | 37 - .../shirou/gopsutil/mem/mem_openbsd_amd64.go | 90 + .../shirou/gopsutil/mem/mem_windows.go | 1 - .../shirou/gopsutil/net/net_darwin.go | 4 +- .../shirou/gopsutil/net/net_freebsd.go | 7 +- .../shirou/gopsutil/net/net_linux.go | 2 +- .../shirou/gopsutil/net/net_openbsd.go | 5 +- .../shirou/gopsutil/net/net_unix.go | 2 +- .../shirou/gopsutil/net/net_windows.go | 7 +- .../shirou/gopsutil/process/process.go | 253 +- .../shirou/gopsutil/process/process_bsd.go | 80 - .../shirou/gopsutil/process/process_darwin.go | 315 +- .../gopsutil/process/process_darwin_arm64.go | 205 - .../gopsutil/process/process_fallback.go | 155 +- .../gopsutil/process/process_freebsd.go | 211 +- .../shirou/gopsutil/process/process_linux.go | 245 +- .../gopsutil/process/process_openbsd.go | 223 +- .../gopsutil/process/process_openbsd_386.go | 201 - .../shirou/gopsutil/process/process_posix.go | 69 +- .../gopsutil/process/process_windows.go | 293 +- vendor/github.com/sirupsen/logrus/.travis.yml | 14 +- .../github.com/sirupsen/logrus/CHANGELOG.md | 36 - vendor/github.com/sirupsen/logrus/README.md | 2 +- vendor/github.com/sirupsen/logrus/entry.go | 73 +- vendor/github.com/sirupsen/logrus/go.sum | 2 + .../sirupsen/logrus/json_formatter.go | 5 +- vendor/github.com/sirupsen/logrus/logger.go | 2 +- .../sirupsen/logrus/terminal_check_unix.go | 2 +- .../sirupsen/logrus/text_formatter.go | 7 +- vendor/github.com/skycoin/dmsg/go.mod | 5 +- vendor/github.com/skycoin/dmsg/go.sum | 14 +- .../skycoin/dmsg/httputil/httputil.go | 3 - .../github.com/skycoin/dmsg/httputil/log.go | 56 - .../victoria_metrics_int_gauge_wrapper.go | 5 - .../victoria_metrics_uint_gauge_wrapper.go | 5 - .../skycoin/dmsg/noise/read_writer.go | 1 - vendor/github.com/skycoin/dmsg/server.go | 10 +- .../skycoin/dmsg/servermetrics/empty.go | 14 +- .../skycoin/dmsg/servermetrics/metrics.go | 10 - .../dmsg/servermetrics/victoria_metrics.go | 27 +- vendor/github.com/spf13/cobra/.golangci.yml | 48 - vendor/github.com/spf13/cobra/.travis.yml | 9 +- vendor/github.com/spf13/cobra/CHANGELOG.md | 51 - vendor/github.com/spf13/cobra/CONDUCT.md | 37 - vendor/github.com/spf13/cobra/CONTRIBUTING.md | 50 - vendor/github.com/spf13/cobra/Makefile | 18 +- vendor/github.com/spf13/cobra/README.md | 132 +- .../spf13/cobra/bash_completions.go | 188 +- .../spf13/cobra/bash_completions.md | 306 +- vendor/github.com/spf13/cobra/cobra.go | 15 - vendor/github.com/spf13/cobra/command.go | 162 +- .../spf13/cobra/custom_completions.go | 305 +- .../spf13/cobra/fish_completions.go | 71 +- .../spf13/cobra/fish_completions.md | 7 +- vendor/github.com/spf13/cobra/go.mod | 6 +- vendor/github.com/spf13/cobra/go.sum | 202 +- .../spf13/cobra/powershell_completions.go | 323 +- .../spf13/cobra/powershell_completions.md | 13 +- .../spf13/cobra/projects_using_cobra.md | 38 - .../spf13/cobra/shell_completions.go | 53 +- .../spf13/cobra/shell_completions.md | 483 - .../github.com/spf13/cobra/zsh_completions.go | 524 +- .../github.com/spf13/cobra/zsh_completions.md | 87 +- vendor/github.com/spf13/pflag/.travis.yml | 7 +- vendor/github.com/spf13/pflag/README.md | 4 +- vendor/github.com/spf13/pflag/bool_slice.go | 38 - vendor/github.com/spf13/pflag/count.go | 4 +- .../github.com/spf13/pflag/duration_slice.go | 38 - vendor/github.com/spf13/pflag/flag.go | 16 +- .../github.com/spf13/pflag/float32_slice.go | 174 - .../github.com/spf13/pflag/float64_slice.go | 166 - vendor/github.com/spf13/pflag/go.mod | 3 - vendor/github.com/spf13/pflag/go.sum | 0 vendor/github.com/spf13/pflag/int32_slice.go | 174 - vendor/github.com/spf13/pflag/int64_slice.go | 166 - vendor/github.com/spf13/pflag/int_slice.go | 30 - vendor/github.com/spf13/pflag/ip_slice.go | 40 +- vendor/github.com/spf13/pflag/string_array.go | 26 - vendor/github.com/spf13/pflag/string_slice.go | 22 +- .../github.com/spf13/pflag/string_to_int64.go | 149 - vendor/github.com/spf13/pflag/uint_slice.go | 42 - .../testify/assert/assertion_compare.go | 172 +- .../testify/assert/assertion_format.go | 97 - .../testify/assert/assertion_forward.go | 194 - .../testify/assert/assertion_order.go | 81 - .../stretchr/testify/assert/assertions.go | 83 +- .../github.com/stretchr/testify/mock/mock.go | 45 +- .../stretchr/testify/require/require.go | 248 - .../testify/require/require_forward.go | 194 - vendor/github.com/tjfoc/gmsm/sm4/sm4.go | 317 +- vendor/github.com/tjfoc/gmsm/sm4/sm4_gcm.go | 332 - vendor/github.com/tjfoc/gmsm/sm4/utils.go | 86 - .../tklauser/go-sysconf/.cirrus.yml | 12 - .../github.com/tklauser/go-sysconf/.gitignore | 1 - .../github.com/tklauser/go-sysconf/README.md | 47 - vendor/github.com/tklauser/go-sysconf/go.mod | 8 - vendor/github.com/tklauser/go-sysconf/go.sum | 4 - .../github.com/tklauser/go-sysconf/sysconf.go | 21 - .../tklauser/go-sysconf/sysconf_bsd.go | 38 - .../tklauser/go-sysconf/sysconf_darwin.go | 267 - .../tklauser/go-sysconf/sysconf_dragonfly.go | 220 - .../tklauser/go-sysconf/sysconf_freebsd.go | 226 - .../tklauser/go-sysconf/sysconf_generic.go | 46 - .../tklauser/go-sysconf/sysconf_linux.go | 357 - .../tklauser/go-sysconf/sysconf_netbsd.go | 154 - .../tklauser/go-sysconf/sysconf_openbsd.go | 271 - .../tklauser/go-sysconf/sysconf_posix.go | 83 - .../tklauser/go-sysconf/sysconf_solaris.go | 14 - .../go-sysconf/sysconf_unsupported.go | 17 - .../go-sysconf/zsysconf_defs_darwin.go | 251 - .../go-sysconf/zsysconf_defs_dragonfly.go | 225 - .../go-sysconf/zsysconf_defs_freebsd.go | 226 - .../go-sysconf/zsysconf_defs_linux.go | 144 - .../go-sysconf/zsysconf_defs_netbsd.go | 94 - .../go-sysconf/zsysconf_defs_openbsd.go | 260 - .../go-sysconf/zsysconf_defs_solaris.go | 136 - .../go-sysconf/zsysconf_values_freebsd_386.go | 9 - .../zsysconf_values_freebsd_amd64.go | 9 - .../go-sysconf/zsysconf_values_freebsd_arm.go | 9 - .../zsysconf_values_freebsd_arm64.go | 9 - .../go-sysconf/zsysconf_values_linux_386.go | 111 - .../go-sysconf/zsysconf_values_linux_amd64.go | 111 - .../go-sysconf/zsysconf_values_linux_arm.go | 111 - .../go-sysconf/zsysconf_values_linux_arm64.go | 111 - .../go-sysconf/zsysconf_values_linux_mips.go | 111 - .../zsysconf_values_linux_mips64.go | 111 - .../zsysconf_values_linux_mips64le.go | 111 - .../zsysconf_values_linux_mipsle.go | 111 - .../go-sysconf/zsysconf_values_linux_ppc64.go | 111 - .../zsysconf_values_linux_ppc64le.go | 111 - .../zsysconf_values_linux_riscv64.go | 111 - .../go-sysconf/zsysconf_values_linux_s390x.go | 111 - .../github.com/tklauser/numcpus/.cirrus.yml | 12 - vendor/github.com/tklauser/numcpus/LICENSE | 202 - vendor/github.com/tklauser/numcpus/README.md | 49 - vendor/github.com/tklauser/numcpus/go.mod | 5 - vendor/github.com/tklauser/numcpus/go.sum | 2 - vendor/github.com/tklauser/numcpus/numcpus.go | 61 - .../tklauser/numcpus/numcpus_bsd.go | 57 - .../tklauser/numcpus/numcpus_linux.go | 84 - .../tklauser/numcpus/numcpus_solaris.go | 51 - .../tklauser/numcpus/numcpus_unsupported.go | 38 - vendor/github.com/ulikunitz/xz/LICENSE | 2 +- vendor/github.com/ulikunitz/xz/TODO.md | 9 - vendor/github.com/ulikunitz/xz/bits.go | 2 +- vendor/github.com/ulikunitz/xz/crc.go | 2 +- vendor/github.com/ulikunitz/xz/format.go | 10 +- .../github.com/ulikunitz/xz/fox-check-none.xz | Bin 96 -> 0 bytes vendor/github.com/ulikunitz/xz/go.mod | 2 - .../ulikunitz/xz/internal/hash/cyclic_poly.go | 2 +- .../ulikunitz/xz/internal/hash/doc.go | 2 +- .../ulikunitz/xz/internal/hash/rabin_karp.go | 2 +- .../ulikunitz/xz/internal/hash/roller.go | 2 +- .../ulikunitz/xz/internal/xlog/xlog.go | 2 +- .../github.com/ulikunitz/xz/lzma/bintree.go | 2 +- vendor/github.com/ulikunitz/xz/lzma/bitops.go | 2 +- .../github.com/ulikunitz/xz/lzma/breader.go | 2 +- vendor/github.com/ulikunitz/xz/lzma/buffer.go | 2 +- .../ulikunitz/xz/lzma/bytewriter.go | 2 +- .../github.com/ulikunitz/xz/lzma/decoder.go | 2 +- .../ulikunitz/xz/lzma/decoderdict.go | 2 +- .../ulikunitz/xz/lzma/directcodec.go | 2 +- .../github.com/ulikunitz/xz/lzma/distcodec.go | 2 +- .../github.com/ulikunitz/xz/lzma/encoder.go | 2 +- .../ulikunitz/xz/lzma/encoderdict.go | 2 +- .../github.com/ulikunitz/xz/lzma/hashtable.go | 2 +- vendor/github.com/ulikunitz/xz/lzma/header.go | 2 +- .../github.com/ulikunitz/xz/lzma/header2.go | 2 +- .../ulikunitz/xz/lzma/lengthcodec.go | 2 +- .../ulikunitz/xz/lzma/literalcodec.go | 2 +- .../ulikunitz/xz/lzma/matchalgorithm.go | 2 +- .../github.com/ulikunitz/xz/lzma/operation.go | 2 +- vendor/github.com/ulikunitz/xz/lzma/prob.go | 2 +- .../ulikunitz/xz/lzma/properties.go | 2 +- .../ulikunitz/xz/lzma/rangecodec.go | 2 +- vendor/github.com/ulikunitz/xz/lzma/reader.go | 2 +- .../github.com/ulikunitz/xz/lzma/reader2.go | 2 +- vendor/github.com/ulikunitz/xz/lzma/state.go | 2 +- .../ulikunitz/xz/lzma/treecodecs.go | 2 +- vendor/github.com/ulikunitz/xz/lzma/writer.go | 2 +- .../github.com/ulikunitz/xz/lzma/writer2.go | 2 +- vendor/github.com/ulikunitz/xz/lzmafilter.go | 2 +- vendor/github.com/ulikunitz/xz/none-check.go | 23 - vendor/github.com/ulikunitz/xz/reader.go | 8 +- vendor/github.com/ulikunitz/xz/writer.go | 15 +- .../x/crypto/blake2b/blake2bAVX2_amd64.go | 1 - .../x/crypto/blake2b/blake2bAVX2_amd64.s | 94 +- .../x/crypto/blake2b/blake2b_amd64.go | 1 - .../x/crypto/blake2b/blake2b_amd64.s | 55 +- .../x/crypto/blake2b/blake2b_ref.go | 1 - .../golang.org/x/crypto/blake2b/register.go | 1 - .../x/crypto/blake2s/blake2s_386.go | 1 - .../golang.org/x/crypto/blake2s/blake2s_386.s | 94 +- .../x/crypto/blake2s/blake2s_amd64.go | 1 - .../x/crypto/blake2s/blake2s_amd64.s | 66 +- .../x/crypto/blake2s/blake2s_ref.go | 1 - .../golang.org/x/crypto/blake2s/register.go | 1 - .../x/crypto/chacha20/chacha_arm64.go | 1 - .../x/crypto/chacha20/chacha_noasm.go | 1 - .../x/crypto/chacha20/chacha_ppc64le.go | 1 - .../x/crypto/chacha20/chacha_s390x.go | 1 - .../chacha20poly1305_amd64.go | 1 - .../chacha20poly1305_noasm.go | 1 - .../x/crypto/curve25519/curve25519_amd64.go | 1 - .../x/crypto/curve25519/curve25519_noasm.go | 1 - .../x/crypto/internal/subtle/aliasing.go | 1 - .../crypto/internal/subtle/aliasing_purego.go | 1 - .../x/crypto/poly1305/bits_compat.go | 1 - .../x/crypto/poly1305/bits_go1.13.go | 1 - .../golang.org/x/crypto/poly1305/mac_noasm.go | 1 - .../golang.org/x/crypto/poly1305/sum_amd64.go | 1 - .../x/crypto/poly1305/sum_ppc64le.go | 1 - .../golang.org/x/crypto/poly1305/sum_s390x.go | 1 - .../x/crypto/salsa20/salsa/salsa20_amd64.go | 1 - .../x/crypto/salsa20/salsa/salsa20_amd64.s | 235 +- .../x/crypto/salsa20/salsa/salsa20_noasm.go | 1 - vendor/golang.org/x/mod/LICENSE | 27 + vendor/golang.org/x/mod/PATENTS | 22 + vendor/golang.org/x/mod/semver/semver.go | 391 + vendor/golang.org/x/net/context/go17.go | 1 - vendor/golang.org/x/net/context/go19.go | 1 - vendor/golang.org/x/net/context/pre_go17.go | 1 - vendor/golang.org/x/net/context/pre_go19.go | 1 - .../x/net/internal/socket/cmsghdr.go | 3 +- .../x/net/internal/socket/cmsghdr_bsd.go | 1 - .../internal/socket/cmsghdr_linux_32bit.go | 1 - .../internal/socket/cmsghdr_linux_64bit.go | 1 - .../internal/socket/cmsghdr_solaris_64bit.go | 4 +- .../x/net/internal/socket/cmsghdr_stub.go | 3 +- .../x/net/internal/socket/cmsghdr_unix.go | 1 - .../net/internal/socket/cmsghdr_zos_s390x.go | 25 - .../x/net/internal/socket/error_unix.go | 3 +- .../x/net/internal/socket/iovec_32bit.go | 1 - .../x/net/internal/socket/iovec_64bit.go | 3 +- .../internal/socket/iovec_solaris_64bit.go | 4 +- .../x/net/internal/socket/iovec_stub.go | 3 +- .../x/net/internal/socket/mmsghdr_stub.go | 1 - .../x/net/internal/socket/mmsghdr_unix.go | 1 - .../x/net/internal/socket/msghdr_bsd.go | 1 - .../x/net/internal/socket/msghdr_bsdvar.go | 1 - .../net/internal/socket/msghdr_linux_32bit.go | 1 - .../net/internal/socket/msghdr_linux_64bit.go | 1 - .../internal/socket/msghdr_solaris_64bit.go | 4 +- .../x/net/internal/socket/msghdr_stub.go | 3 +- .../x/net/internal/socket/msghdr_zos_s390x.go | 36 - .../x/net/internal/socket/norace.go | 1 - .../golang.org/x/net/internal/socket/race.go | 1 - .../x/net/internal/socket/rawconn.go | 33 +- .../x/net/internal/socket/rawconn_mmsg.go | 1 - .../x/net/internal/socket/rawconn_msg.go | 7 +- .../x/net/internal/socket/rawconn_nommsg.go | 1 - .../x/net/internal/socket/rawconn_nomsg.go | 3 +- .../x/net/internal/socket/sys_bsd.go | 1 - .../x/net/internal/socket/sys_const_unix.go | 1 - .../x/net/internal/socket/sys_const_zos.go | 18 - .../x/net/internal/socket/sys_linkname.go | 1 - .../x/net/internal/socket/sys_linux.go | 1 - .../net/internal/socket/sys_linux_riscv64.go | 1 - .../x/net/internal/socket/sys_posix.go | 3 +- .../x/net/internal/socket/sys_stub.go | 3 +- .../x/net/internal/socket/sys_unix.go | 1 - .../x/net/internal/socket/sys_zos_s390x.go | 38 - .../x/net/internal/socket/sys_zos_s390x.s | 11 - .../x/net/internal/socket/zsys_aix_ppc64.go | 1 - .../net/internal/socket/zsys_linux_riscv64.go | 1 - .../internal/socket/zsys_openbsd_mips64.go | 50 - .../x/net/internal/socket/zsys_zos_s390x.go | 32 - vendor/golang.org/x/net/ipv4/control_bsd.go | 7 +- .../golang.org/x/net/ipv4/control_pktinfo.go | 5 +- vendor/golang.org/x/net/ipv4/control_stub.go | 3 +- vendor/golang.org/x/net/ipv4/control_unix.go | 5 +- vendor/golang.org/x/net/ipv4/control_zos.go | 88 - vendor/golang.org/x/net/ipv4/icmp_stub.go | 1 - vendor/golang.org/x/net/ipv4/payload_cmsg.go | 3 +- .../golang.org/x/net/ipv4/payload_nocmsg.go | 3 +- vendor/golang.org/x/net/ipv4/sockopt_posix.go | 3 +- vendor/golang.org/x/net/ipv4/sockopt_stub.go | 3 +- vendor/golang.org/x/net/ipv4/sys_aix.go | 34 +- vendor/golang.org/x/net/ipv4/sys_asmreq.go | 1 - .../golang.org/x/net/ipv4/sys_asmreq_stub.go | 1 - vendor/golang.org/x/net/ipv4/sys_asmreqn.go | 1 - .../golang.org/x/net/ipv4/sys_asmreqn_stub.go | 1 - vendor/golang.org/x/net/ipv4/sys_bpf.go | 1 - vendor/golang.org/x/net/ipv4/sys_bpf_stub.go | 1 - vendor/golang.org/x/net/ipv4/sys_bsd.go | 33 +- vendor/golang.org/x/net/ipv4/sys_darwin.go | 46 +- vendor/golang.org/x/net/ipv4/sys_dragonfly.go | 32 +- vendor/golang.org/x/net/ipv4/sys_freebsd.go | 42 +- vendor/golang.org/x/net/ipv4/sys_linux.go | 35 +- vendor/golang.org/x/net/ipv4/sys_solaris.go | 36 +- vendor/golang.org/x/net/ipv4/sys_ssmreq.go | 1 - .../golang.org/x/net/ipv4/sys_ssmreq_stub.go | 1 - vendor/golang.org/x/net/ipv4/sys_stub.go | 3 +- vendor/golang.org/x/net/ipv4/sys_windows.go | 43 +- vendor/golang.org/x/net/ipv4/sys_zos.go | 57 - .../golang.org/x/net/ipv4/zsys_aix_ppc64.go | 18 +- vendor/golang.org/x/net/ipv4/zsys_darwin.go | 33 + .../golang.org/x/net/ipv4/zsys_dragonfly.go | 18 + .../golang.org/x/net/ipv4/zsys_freebsd_386.go | 34 + .../x/net/ipv4/zsys_freebsd_amd64.go | 34 + .../golang.org/x/net/ipv4/zsys_freebsd_arm.go | 34 + .../x/net/ipv4/zsys_freebsd_arm64.go | 34 + .../golang.org/x/net/ipv4/zsys_linux_386.go | 51 + .../golang.org/x/net/ipv4/zsys_linux_amd64.go | 51 + .../golang.org/x/net/ipv4/zsys_linux_arm.go | 51 + .../golang.org/x/net/ipv4/zsys_linux_arm64.go | 51 + .../golang.org/x/net/ipv4/zsys_linux_mips.go | 51 + .../x/net/ipv4/zsys_linux_mips64.go | 51 + .../x/net/ipv4/zsys_linux_mips64le.go | 51 + .../x/net/ipv4/zsys_linux_mipsle.go | 51 + .../golang.org/x/net/ipv4/zsys_linux_ppc.go | 51 + .../golang.org/x/net/ipv4/zsys_linux_ppc64.go | 51 + .../x/net/ipv4/zsys_linux_ppc64le.go | 51 + .../x/net/ipv4/zsys_linux_riscv64.go | 52 +- .../golang.org/x/net/ipv4/zsys_linux_s390x.go | 51 + vendor/golang.org/x/net/ipv4/zsys_netbsd.go | 17 + vendor/golang.org/x/net/ipv4/zsys_openbsd.go | 17 + vendor/golang.org/x/net/ipv4/zsys_solaris.go | 43 + .../golang.org/x/net/ipv4/zsys_zos_s390x.go | 56 - .../x/net/ipv6/control_rfc2292_unix.go | 9 +- .../x/net/ipv6/control_rfc3542_unix.go | 15 +- vendor/golang.org/x/net/ipv6/control_stub.go | 3 +- vendor/golang.org/x/net/ipv6/control_unix.go | 3 +- vendor/golang.org/x/net/ipv6/icmp_bsd.go | 1 - vendor/golang.org/x/net/ipv6/icmp_stub.go | 3 +- vendor/golang.org/x/net/ipv6/icmp_zos.go | 29 - vendor/golang.org/x/net/ipv6/payload_cmsg.go | 3 +- .../golang.org/x/net/ipv6/payload_nocmsg.go | 3 +- vendor/golang.org/x/net/ipv6/sockopt_posix.go | 3 +- vendor/golang.org/x/net/ipv6/sockopt_stub.go | 3 +- vendor/golang.org/x/net/ipv6/sys_aix.go | 41 +- vendor/golang.org/x/net/ipv6/sys_asmreq.go | 1 - .../golang.org/x/net/ipv6/sys_asmreq_stub.go | 1 - vendor/golang.org/x/net/ipv6/sys_bpf.go | 1 - vendor/golang.org/x/net/ipv6/sys_bpf_stub.go | 1 - vendor/golang.org/x/net/ipv6/sys_bsd.go | 41 +- vendor/golang.org/x/net/ipv6/sys_darwin.go | 48 +- vendor/golang.org/x/net/ipv6/sys_freebsd.go | 48 +- vendor/golang.org/x/net/ipv6/sys_linux.go | 45 +- vendor/golang.org/x/net/ipv6/sys_solaris.go | 48 +- vendor/golang.org/x/net/ipv6/sys_ssmreq.go | 3 +- .../golang.org/x/net/ipv6/sys_ssmreq_stub.go | 3 +- vendor/golang.org/x/net/ipv6/sys_stub.go | 3 +- vendor/golang.org/x/net/ipv6/sys_windows.go | 23 +- vendor/golang.org/x/net/ipv6/sys_zos.go | 72 - .../golang.org/x/net/ipv6/zsys_aix_ppc64.go | 36 +- vendor/golang.org/x/net/ipv6/zsys_darwin.go | 67 + .../golang.org/x/net/ipv6/zsys_dragonfly.go | 46 + .../golang.org/x/net/ipv6/zsys_freebsd_386.go | 58 + .../x/net/ipv6/zsys_freebsd_amd64.go | 58 + .../golang.org/x/net/ipv6/zsys_freebsd_arm.go | 58 + .../x/net/ipv6/zsys_freebsd_arm64.go | 58 + .../golang.org/x/net/ipv6/zsys_linux_386.go | 80 + .../golang.org/x/net/ipv6/zsys_linux_amd64.go | 80 + .../golang.org/x/net/ipv6/zsys_linux_arm.go | 80 + .../golang.org/x/net/ipv6/zsys_linux_arm64.go | 80 + .../golang.org/x/net/ipv6/zsys_linux_mips.go | 80 + .../x/net/ipv6/zsys_linux_mips64.go | 80 + .../x/net/ipv6/zsys_linux_mips64le.go | 80 + .../x/net/ipv6/zsys_linux_mipsle.go | 80 + .../golang.org/x/net/ipv6/zsys_linux_ppc.go | 80 + .../golang.org/x/net/ipv6/zsys_linux_ppc64.go | 80 + .../x/net/ipv6/zsys_linux_ppc64le.go | 80 + .../x/net/ipv6/zsys_linux_riscv64.go | 81 +- .../golang.org/x/net/ipv6/zsys_linux_s390x.go | 80 + vendor/golang.org/x/net/ipv6/zsys_netbsd.go | 42 + vendor/golang.org/x/net/ipv6/zsys_openbsd.go | 51 + vendor/golang.org/x/net/ipv6/zsys_solaris.go | 68 + .../golang.org/x/net/ipv6/zsys_zos_s390x.go | 62 - vendor/golang.org/x/net/nettest/nettest.go | 2 +- .../golang.org/x/net/nettest/nettest_stub.go | 3 +- .../golang.org/x/net/nettest/nettest_unix.go | 3 +- vendor/golang.org/x/sys/execabs/execabs.go | 102 + vendor/golang.org/x/term/term.go | 4 +- vendor/golang.org/x/term/term_solaris.go | 111 + vendor/golang.org/x/term/term_unix.go | 3 +- vendor/golang.org/x/term/term_unix_bsd.go | 1 - vendor/golang.org/x/term/term_unsupported.go | 1 - .../x/text/unicode/norm/tables10.0.0.go | 1 - .../x/text/unicode/norm/tables11.0.0.go | 1 - .../x/text/unicode/norm/tables12.0.0.go | 3 +- .../x/text/unicode/norm/tables13.0.0.go | 7761 ---- .../x/text/unicode/norm/tables9.0.0.go | 1 - vendor/golang.org/x/tools/AUTHORS | 3 + vendor/golang.org/x/tools/CONTRIBUTORS | 3 + vendor/golang.org/x/tools/LICENSE | 27 + vendor/golang.org/x/tools/PATENTS | 22 + .../x/tools/go/gcexportdata/gcexportdata.go | 109 + .../x/tools/go/gcexportdata/importer.go | 73 + .../x/tools/go/internal/gcimporter/bexport.go | 852 + .../x/tools/go/internal/gcimporter/bimport.go | 1039 + .../go/internal/gcimporter/exportdata.go | 93 + .../go/internal/gcimporter/gcimporter.go | 1078 + .../x/tools/go/internal/gcimporter/iexport.go | 739 + .../x/tools/go/internal/gcimporter/iimport.go | 630 + .../go/internal/gcimporter/newInterface10.go | 21 + .../go/internal/gcimporter/newInterface11.go | 13 + .../tools/go/internal/packagesdriver/sizes.go | 49 + vendor/golang.org/x/tools/go/packages/doc.go | 221 + .../x/tools/go/packages/external.go | 101 + .../golang.org/x/tools/go/packages/golist.go | 1096 + .../x/tools/go/packages/golist_overlay.go | 575 + .../x/tools/go/packages/loadmode_string.go | 57 + .../x/tools/go/packages/packages.go | 1233 + .../golang.org/x/tools/go/packages/visit.go | 59 + .../x/tools/internal/event/core/event.go | 85 + .../x/tools/internal/event/core/export.go | 70 + .../x/tools/internal/event/core/fast.go | 77 + .../internal/event/doc.go} | 9 +- .../x/tools/internal/event/event.go | 127 + .../x/tools/internal/event/keys/keys.go | 564 + .../x/tools/internal/event/keys/standard.go | 22 + .../x/tools/internal/event/label/label.go | 213 + .../x/tools/internal/gocommand/invoke.go | 273 + .../x/tools/internal/gocommand/vendor.go | 102 + .../x/tools/internal/gocommand/version.go | 51 + .../internal/packagesinternal/packages.go | 21 + .../tools/internal/typesinternal/errorcode.go | 1358 + .../typesinternal/errorcode_string.go | 152 + .../x/tools/internal/typesinternal/types.go | 45 + vendor/golang.org/x/xerrors/LICENSE | 27 + vendor/golang.org/x/xerrors/PATENTS | 22 + vendor/golang.org/x/xerrors/README | 2 + vendor/golang.org/x/xerrors/adaptor.go | 193 + vendor/golang.org/x/xerrors/codereview.cfg | 1 + vendor/golang.org/x/xerrors/doc.go | 22 + vendor/golang.org/x/xerrors/errors.go | 33 + vendor/golang.org/x/xerrors/fmt.go | 187 + vendor/golang.org/x/xerrors/format.go | 34 + vendor/golang.org/x/xerrors/frame.go | 56 + vendor/golang.org/x/xerrors/go.mod | 3 + .../golang.org/x/xerrors/internal/internal.go | 8 + vendor/golang.org/x/xerrors/wrap.go | 106 + vendor/modules.txt | 109 +- vendor/nhooyr.io/websocket/Makefile | 7 + vendor/nhooyr.io/websocket/README.md | 41 +- vendor/nhooyr.io/websocket/accept.go | 99 +- vendor/nhooyr.io/websocket/accept_js.go | 1 - vendor/nhooyr.io/websocket/close_notjs.go | 50 +- vendor/nhooyr.io/websocket/compress.go | 1 - vendor/nhooyr.io/websocket/conn_notjs.go | 27 +- vendor/nhooyr.io/websocket/dial.go | 34 +- vendor/nhooyr.io/websocket/go.mod | 5 +- vendor/nhooyr.io/websocket/go.sum | 52 +- vendor/nhooyr.io/websocket/read.go | 48 +- vendor/nhooyr.io/websocket/write.go | 78 +- vendor/nhooyr.io/websocket/ws_js.go | 4 - 686 files changed, 92245 insertions(+), 36822 deletions(-) delete mode 100644 vendor/github.com/andybalholm/brotli/http.go delete mode 100644 vendor/github.com/go-ole/go-ole/go.sum create mode 100644 vendor/github.com/golang/gddo/LICENSE create mode 100644 vendor/github.com/golang/gddo/httputil/buster.go create mode 100644 vendor/github.com/golang/gddo/httputil/header/header.go create mode 100644 vendor/github.com/golang/gddo/httputil/httputil.go create mode 100644 vendor/github.com/golang/gddo/httputil/negotiate.go create mode 100644 vendor/github.com/golang/gddo/httputil/respbuf.go create mode 100644 vendor/github.com/golang/gddo/httputil/static.go create mode 100644 vendor/github.com/golang/gddo/httputil/transport.go delete mode 100644 vendor/github.com/klauspost/compress/flate/gen_inflate.go delete mode 100644 vendor/github.com/klauspost/compress/flate/inflate_gen.go delete mode 100644 vendor/github.com/klauspost/compress/gzip/gunzip.go delete mode 100644 vendor/github.com/klauspost/compress/gzip/gzip.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/dict.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/enc_better.go rename vendor/github.com/klauspost/cpuid/{v2 => }/.gitignore (100%) create mode 100644 vendor/github.com/klauspost/cpuid/.travis.yml rename vendor/github.com/klauspost/cpuid/{v2 => }/CONTRIBUTING.txt (100%) rename vendor/github.com/klauspost/cpuid/{v2 => }/LICENSE (100%) create mode 100644 vendor/github.com/klauspost/cpuid/README.md create mode 100644 vendor/github.com/klauspost/cpuid/cpuid.go rename vendor/github.com/klauspost/cpuid/{v2 => }/cpuid_386.s (96%) rename vendor/github.com/klauspost/cpuid/{v2 => }/cpuid_amd64.s (95%) create mode 100644 vendor/github.com/klauspost/cpuid/detect_intel.go create mode 100644 vendor/github.com/klauspost/cpuid/detect_ref.go create mode 100644 vendor/github.com/klauspost/cpuid/generate.go delete mode 100644 vendor/github.com/klauspost/cpuid/v2/.travis.yml delete mode 100644 vendor/github.com/klauspost/cpuid/v2/README.md delete mode 100644 vendor/github.com/klauspost/cpuid/v2/cpuid.go delete mode 100644 vendor/github.com/klauspost/cpuid/v2/cpuid_arm64.s delete mode 100644 vendor/github.com/klauspost/cpuid/v2/detect_arm64.go delete mode 100644 vendor/github.com/klauspost/cpuid/v2/detect_ref.go delete mode 100644 vendor/github.com/klauspost/cpuid/v2/detect_x86.go delete mode 100644 vendor/github.com/klauspost/cpuid/v2/featureid_string.go delete mode 100644 vendor/github.com/klauspost/cpuid/v2/go.mod delete mode 100644 vendor/github.com/klauspost/cpuid/v2/os_darwin_arm64.go delete mode 100644 vendor/github.com/klauspost/cpuid/v2/os_linux_arm64.go delete mode 100644 vendor/github.com/klauspost/cpuid/v2/os_other_arm64.go create mode 100644 vendor/github.com/klauspost/reedsolomon/gen.go delete mode 100644 vendor/github.com/mholt/archiver/v3/.goreleaser.yml delete mode 100644 vendor/github.com/mholt/archiver/v3/.prettierrc delete mode 100644 vendor/github.com/mholt/archiver/v3/error.go rename vendor/github.com/{tklauser/go-sysconf => mmcloughlin/avo}/LICENSE (97%) create mode 100644 vendor/github.com/mmcloughlin/avo/attr/attr.go create mode 100644 vendor/github.com/mmcloughlin/avo/build/attr.go create mode 100644 vendor/github.com/mmcloughlin/avo/build/cli.go create mode 100644 vendor/github.com/mmcloughlin/avo/build/context.go create mode 100644 vendor/github.com/mmcloughlin/avo/build/doc.go create mode 100644 vendor/github.com/mmcloughlin/avo/build/error.go create mode 100644 vendor/github.com/mmcloughlin/avo/build/global.go create mode 100644 vendor/github.com/mmcloughlin/avo/build/pseudo.go create mode 100644 vendor/github.com/mmcloughlin/avo/build/zinstructions.go create mode 100644 vendor/github.com/mmcloughlin/avo/build/zmov.go create mode 100644 vendor/github.com/mmcloughlin/avo/buildtags/buildtags.go create mode 100644 vendor/github.com/mmcloughlin/avo/gotypes/components.go create mode 100644 vendor/github.com/mmcloughlin/avo/gotypes/doc.go create mode 100644 vendor/github.com/mmcloughlin/avo/gotypes/signature.go create mode 100644 vendor/github.com/mmcloughlin/avo/internal/prnt/printer.go create mode 100644 vendor/github.com/mmcloughlin/avo/internal/stack/stack.go create mode 100644 vendor/github.com/mmcloughlin/avo/ir/doc.go create mode 100644 vendor/github.com/mmcloughlin/avo/ir/ir.go create mode 100644 vendor/github.com/mmcloughlin/avo/operand/checks.go create mode 100644 vendor/github.com/mmcloughlin/avo/operand/const.go create mode 100644 vendor/github.com/mmcloughlin/avo/operand/doc.go create mode 100644 vendor/github.com/mmcloughlin/avo/operand/types.go create mode 100644 vendor/github.com/mmcloughlin/avo/operand/zconst.go create mode 100644 vendor/github.com/mmcloughlin/avo/pass/alloc.go create mode 100644 vendor/github.com/mmcloughlin/avo/pass/cfg.go create mode 100644 vendor/github.com/mmcloughlin/avo/pass/cleanup.go create mode 100644 vendor/github.com/mmcloughlin/avo/pass/isa.go create mode 100644 vendor/github.com/mmcloughlin/avo/pass/pass.go create mode 100644 vendor/github.com/mmcloughlin/avo/pass/reg.go create mode 100644 vendor/github.com/mmcloughlin/avo/pass/textflag.go create mode 100644 vendor/github.com/mmcloughlin/avo/pass/verify.go create mode 100644 vendor/github.com/mmcloughlin/avo/printer/goasm.go create mode 100644 vendor/github.com/mmcloughlin/avo/printer/printer.go create mode 100644 vendor/github.com/mmcloughlin/avo/printer/stubs.go create mode 100644 vendor/github.com/mmcloughlin/avo/reg/collection.go create mode 100644 vendor/github.com/mmcloughlin/avo/reg/doc.go create mode 100644 vendor/github.com/mmcloughlin/avo/reg/set.go create mode 100644 vendor/github.com/mmcloughlin/avo/reg/types.go create mode 100644 vendor/github.com/mmcloughlin/avo/reg/x86.go create mode 100644 vendor/github.com/mmcloughlin/avo/src/src.go create mode 100644 vendor/github.com/mmcloughlin/avo/x86/doc.go create mode 100644 vendor/github.com/mmcloughlin/avo/x86/gen.go create mode 100644 vendor/github.com/mmcloughlin/avo/x86/zctors.go rename vendor/github.com/pierrec/lz4/{v4 => }/.gitignore (96%) create mode 100644 vendor/github.com/pierrec/lz4/.travis.yml rename vendor/github.com/pierrec/lz4/{v4 => }/LICENSE (100%) create mode 100644 vendor/github.com/pierrec/lz4/README.md create mode 100644 vendor/github.com/pierrec/lz4/block.go create mode 100644 vendor/github.com/pierrec/lz4/debug.go create mode 100644 vendor/github.com/pierrec/lz4/debug_stub.go create mode 100644 vendor/github.com/pierrec/lz4/internal/xxh32/xxh32zero.go create mode 100644 vendor/github.com/pierrec/lz4/lz4.go create mode 100644 vendor/github.com/pierrec/lz4/lz4_go1.10.go create mode 100644 vendor/github.com/pierrec/lz4/lz4_notgo1.10.go create mode 100644 vendor/github.com/pierrec/lz4/reader.go delete mode 100644 vendor/github.com/pierrec/lz4/v4/.travis.yml delete mode 100644 vendor/github.com/pierrec/lz4/v4/README.md delete mode 100644 vendor/github.com/pierrec/lz4/v4/go.mod delete mode 100644 vendor/github.com/pierrec/lz4/v4/go.sum delete mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4block/block.go delete mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4block/blocks.go delete mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_amd64.s delete mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_arm.s delete mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_asm.go delete mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_other.go delete mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4errors/errors.go delete mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4stream/frame.go delete mode 100644 vendor/github.com/pierrec/lz4/v4/internal/lz4stream/frame_gen.go delete mode 100644 vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero.go delete mode 100644 vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.go delete mode 100644 vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.s delete mode 100644 vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_other.go delete mode 100644 vendor/github.com/pierrec/lz4/v4/lz4.go delete mode 100644 vendor/github.com/pierrec/lz4/v4/options.go delete mode 100644 vendor/github.com/pierrec/lz4/v4/options_gen.go delete mode 100644 vendor/github.com/pierrec/lz4/v4/reader.go delete mode 100644 vendor/github.com/pierrec/lz4/v4/state.go delete mode 100644 vendor/github.com/pierrec/lz4/v4/state_gen.go delete mode 100644 vendor/github.com/pierrec/lz4/v4/writer.go create mode 100644 vendor/github.com/pierrec/lz4/writer.go delete mode 100644 vendor/github.com/shirou/gopsutil/cpu/cpu_dragonfly.go delete mode 100644 vendor/github.com/shirou/gopsutil/cpu/cpu_dragonfly_amd64.go delete mode 100644 vendor/github.com/shirou/gopsutil/internal/common/sleep.go delete mode 100644 vendor/github.com/shirou/gopsutil/mem/mem_openbsd_386.go delete mode 100644 vendor/github.com/shirou/gopsutil/process/process_bsd.go delete mode 100644 vendor/github.com/shirou/gopsutil/process/process_darwin_arm64.go delete mode 100644 vendor/github.com/shirou/gopsutil/process/process_openbsd_386.go delete mode 100644 vendor/github.com/skycoin/dmsg/httputil/log.go delete mode 100644 vendor/github.com/skycoin/dmsg/servermetrics/metrics.go delete mode 100644 vendor/github.com/spf13/cobra/.golangci.yml delete mode 100644 vendor/github.com/spf13/cobra/CHANGELOG.md delete mode 100644 vendor/github.com/spf13/cobra/CONDUCT.md delete mode 100644 vendor/github.com/spf13/cobra/CONTRIBUTING.md delete mode 100644 vendor/github.com/spf13/cobra/projects_using_cobra.md delete mode 100644 vendor/github.com/spf13/cobra/shell_completions.md delete mode 100644 vendor/github.com/spf13/pflag/float32_slice.go delete mode 100644 vendor/github.com/spf13/pflag/float64_slice.go delete mode 100644 vendor/github.com/spf13/pflag/go.mod delete mode 100644 vendor/github.com/spf13/pflag/go.sum delete mode 100644 vendor/github.com/spf13/pflag/int32_slice.go delete mode 100644 vendor/github.com/spf13/pflag/int64_slice.go delete mode 100644 vendor/github.com/spf13/pflag/string_to_int64.go delete mode 100644 vendor/github.com/stretchr/testify/assert/assertion_order.go delete mode 100644 vendor/github.com/tjfoc/gmsm/sm4/sm4_gcm.go delete mode 100644 vendor/github.com/tjfoc/gmsm/sm4/utils.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/.cirrus.yml delete mode 100644 vendor/github.com/tklauser/go-sysconf/.gitignore delete mode 100644 vendor/github.com/tklauser/go-sysconf/README.md delete mode 100644 vendor/github.com/tklauser/go-sysconf/go.mod delete mode 100644 vendor/github.com/tklauser/go-sysconf/go.sum delete mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_bsd.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_darwin.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_dragonfly.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_freebsd.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_generic.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_linux.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_netbsd.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_openbsd.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_posix.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_solaris.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/sysconf_unsupported.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_defs_darwin.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_defs_dragonfly.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_defs_freebsd.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_defs_linux.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_defs_netbsd.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_defs_openbsd.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_defs_solaris.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_386.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_amd64.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm64.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_386.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_amd64.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_arm.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_arm64.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips64.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips64le.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mipsle.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_ppc64.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_ppc64le.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_riscv64.go delete mode 100644 vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_s390x.go delete mode 100644 vendor/github.com/tklauser/numcpus/.cirrus.yml delete mode 100644 vendor/github.com/tklauser/numcpus/LICENSE delete mode 100644 vendor/github.com/tklauser/numcpus/README.md delete mode 100644 vendor/github.com/tklauser/numcpus/go.mod delete mode 100644 vendor/github.com/tklauser/numcpus/go.sum delete mode 100644 vendor/github.com/tklauser/numcpus/numcpus.go delete mode 100644 vendor/github.com/tklauser/numcpus/numcpus_bsd.go delete mode 100644 vendor/github.com/tklauser/numcpus/numcpus_linux.go delete mode 100644 vendor/github.com/tklauser/numcpus/numcpus_solaris.go delete mode 100644 vendor/github.com/tklauser/numcpus/numcpus_unsupported.go delete mode 100644 vendor/github.com/ulikunitz/xz/fox-check-none.xz delete mode 100644 vendor/github.com/ulikunitz/xz/none-check.go create mode 100644 vendor/golang.org/x/mod/LICENSE create mode 100644 vendor/golang.org/x/mod/PATENTS create mode 100644 vendor/golang.org/x/mod/semver/semver.go delete mode 100644 vendor/golang.org/x/net/internal/socket/cmsghdr_zos_s390x.go delete mode 100644 vendor/golang.org/x/net/internal/socket/msghdr_zos_s390x.go delete mode 100644 vendor/golang.org/x/net/internal/socket/sys_const_zos.go delete mode 100644 vendor/golang.org/x/net/internal/socket/sys_zos_s390x.go delete mode 100644 vendor/golang.org/x/net/internal/socket/sys_zos_s390x.s delete mode 100644 vendor/golang.org/x/net/internal/socket/zsys_openbsd_mips64.go delete mode 100644 vendor/golang.org/x/net/internal/socket/zsys_zos_s390x.go delete mode 100644 vendor/golang.org/x/net/ipv4/control_zos.go delete mode 100644 vendor/golang.org/x/net/ipv4/sys_zos.go delete mode 100644 vendor/golang.org/x/net/ipv4/zsys_zos_s390x.go delete mode 100644 vendor/golang.org/x/net/ipv6/icmp_zos.go delete mode 100644 vendor/golang.org/x/net/ipv6/sys_zos.go delete mode 100644 vendor/golang.org/x/net/ipv6/zsys_zos_s390x.go create mode 100644 vendor/golang.org/x/sys/execabs/execabs.go create mode 100644 vendor/golang.org/x/term/term_solaris.go delete mode 100644 vendor/golang.org/x/text/unicode/norm/tables13.0.0.go create mode 100644 vendor/golang.org/x/tools/AUTHORS create mode 100644 vendor/golang.org/x/tools/CONTRIBUTORS create mode 100644 vendor/golang.org/x/tools/LICENSE create mode 100644 vendor/golang.org/x/tools/PATENTS create mode 100644 vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go create mode 100644 vendor/golang.org/x/tools/go/gcexportdata/importer.go create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/iexport.go create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/newInterface10.go create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/newInterface11.go create mode 100644 vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go create mode 100644 vendor/golang.org/x/tools/go/packages/doc.go create mode 100644 vendor/golang.org/x/tools/go/packages/external.go create mode 100644 vendor/golang.org/x/tools/go/packages/golist.go create mode 100644 vendor/golang.org/x/tools/go/packages/golist_overlay.go create mode 100644 vendor/golang.org/x/tools/go/packages/loadmode_string.go create mode 100644 vendor/golang.org/x/tools/go/packages/packages.go create mode 100644 vendor/golang.org/x/tools/go/packages/visit.go create mode 100644 vendor/golang.org/x/tools/internal/event/core/event.go create mode 100644 vendor/golang.org/x/tools/internal/event/core/export.go create mode 100644 vendor/golang.org/x/tools/internal/event/core/fast.go rename vendor/golang.org/x/{term/term_unix_solaris.go => tools/internal/event/doc.go} (53%) create mode 100644 vendor/golang.org/x/tools/internal/event/event.go create mode 100644 vendor/golang.org/x/tools/internal/event/keys/keys.go create mode 100644 vendor/golang.org/x/tools/internal/event/keys/standard.go create mode 100644 vendor/golang.org/x/tools/internal/event/label/label.go create mode 100644 vendor/golang.org/x/tools/internal/gocommand/invoke.go create mode 100644 vendor/golang.org/x/tools/internal/gocommand/vendor.go create mode 100644 vendor/golang.org/x/tools/internal/gocommand/version.go create mode 100644 vendor/golang.org/x/tools/internal/packagesinternal/packages.go create mode 100644 vendor/golang.org/x/tools/internal/typesinternal/errorcode.go create mode 100644 vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go create mode 100644 vendor/golang.org/x/tools/internal/typesinternal/types.go create mode 100644 vendor/golang.org/x/xerrors/LICENSE create mode 100644 vendor/golang.org/x/xerrors/PATENTS create mode 100644 vendor/golang.org/x/xerrors/README create mode 100644 vendor/golang.org/x/xerrors/adaptor.go create mode 100644 vendor/golang.org/x/xerrors/codereview.cfg create mode 100644 vendor/golang.org/x/xerrors/doc.go create mode 100644 vendor/golang.org/x/xerrors/errors.go create mode 100644 vendor/golang.org/x/xerrors/fmt.go create mode 100644 vendor/golang.org/x/xerrors/format.go create mode 100644 vendor/golang.org/x/xerrors/frame.go create mode 100644 vendor/golang.org/x/xerrors/go.mod create mode 100644 vendor/golang.org/x/xerrors/internal/internal.go create mode 100644 vendor/golang.org/x/xerrors/wrap.go create mode 100644 vendor/nhooyr.io/websocket/Makefile diff --git a/go.mod b/go.mod index 6971ca9110..a6c2bd60e0 100644 --- a/go.mod +++ b/go.mod @@ -3,49 +3,50 @@ module github.com/skycoin/skywire go 1.16 require ( - github.com/AudriusButkevicius/pfilter v0.0.0-20210218141631-7468b85d810a - github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 // indirect - github.com/VictoriaMetrics/metrics v1.17.2 + github.com/AudriusButkevicius/pfilter v0.0.0-20190627213056-c55ef6137fc6 + github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect + github.com/VictoriaMetrics/metrics v1.12.3 github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 github.com/creack/pty v1.1.11 // indirect github.com/go-chi/chi v4.1.2+incompatible - github.com/go-ole/go-ole v1.2.5 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/go-ole/go-ole v1.2.4 // indirect + github.com/golang/protobuf v1.4.2 // indirect github.com/google/go-github v17.0.0+incompatible - github.com/google/go-querystring v1.1.0 // indirect - github.com/google/uuid v1.2.0 + github.com/google/go-querystring v1.0.0 // indirect + github.com/google/uuid v1.1.1 github.com/gorilla/securecookie v1.1.1 - github.com/klauspost/reedsolomon v1.9.12 // indirect + github.com/klauspost/reedsolomon v1.9.9 // indirect github.com/mattn/go-colorable v0.1.8 // indirect github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect - github.com/mholt/archiver/v3 v3.5.0 + github.com/mholt/archiver/v3 v3.3.0 + github.com/mmcloughlin/avo v0.0.0-20200523190732-4439b6b2c061 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pkg/profile v1.5.0 github.com/schollz/progressbar/v2 v2.15.0 - github.com/shirou/gopsutil v3.21.3+incompatible - github.com/sirupsen/logrus v1.8.1 - github.com/skycoin/dmsg v0.0.0-20210329160412-4e25fc9ad26c + github.com/shirou/gopsutil v2.20.5+incompatible + github.com/sirupsen/logrus v1.7.0 + github.com/skycoin/dmsg v0.0.0-20201216183836-dae8a7acfc14 github.com/skycoin/skycoin v0.27.1 github.com/skycoin/yamux v0.0.0-20200803175205-571ceb89da9f github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 - github.com/spf13/cobra v1.1.3 - github.com/stretchr/testify v1.7.0 + github.com/spf13/cobra v1.0.0 + github.com/stretchr/testify v1.6.1 github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161 // indirect github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b // indirect - github.com/tjfoc/gmsm v1.4.0 // indirect - github.com/tklauser/go-sysconf v0.3.5 // indirect + github.com/tjfoc/gmsm v1.3.2 // indirect github.com/toqueteos/webbrowser v1.2.0 github.com/xtaci/kcp-go v5.4.20+incompatible github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37 // indirect go.etcd.io/bbolt v1.3.5 - golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc // indirect - golang.org/x/net v0.0.0-20210420210106-798c2154c571 + golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9 // indirect + golang.org/x/mod v0.4.2 // indirect + golang.org/x/net v0.0.0-20201021035429-f5854403a974 golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988 - golang.org/x/term v0.0.0-20210406210042-72f3dc4e9b72 // indirect - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf // indirect + golang.org/x/tools v0.1.0 // indirect golang.zx2c4.com/wireguard v0.0.20200320 - nhooyr.io/websocket v1.8.7 + nhooyr.io/websocket v1.8.2 ) // Uncomment for tests with alternate branches of 'dmsg' diff --git a/go.sum b/go.sum index 6e587a8bf7..e3a49dc301 100644 --- a/go.sum +++ b/go.sum @@ -1,50 +1,27 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/AudriusButkevicius/pfilter v0.0.0-20210218141631-7468b85d810a h1:dUzIAgRmHLIUU0PT+OJ0X1WI5j1hlLbf+G420gUjIQg= -github.com/AudriusButkevicius/pfilter v0.0.0-20210218141631-7468b85d810a/go.mod h1:1N0EEx/irz4B1qV17wW82TFbjQrE7oX316Cki6eDY0Q= +github.com/AudriusButkevicius/pfilter v0.0.0-20190627213056-c55ef6137fc6 h1:Apvc4kyfdrOxG+F5dn8osz+45kwGJa6CySQn0tB38SU= +github.com/AudriusButkevicius/pfilter v0.0.0-20190627213056-c55ef6137fc6/go.mod h1:1N0EEx/irz4B1qV17wW82TFbjQrE7oX316Cki6eDY0Q= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 h1:5sXbqlSomvdjlRbWyNqkPsJ3Fg+tQZCbgeX1VGljbQY= -github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= +github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/VictoriaMetrics/metrics v1.12.3 h1:Fe6JHC6MSEKa+BtLhPN8WIvS+HKPzMc2evEpNeCGy7I= github.com/VictoriaMetrics/metrics v1.12.3/go.mod h1:Z1tSfPfngDn12bTfZSCqArT3OPY3u88J12hSoOhuiRE= -github.com/VictoriaMetrics/metrics v1.17.2 h1:9zPJ7DPfxdJWshOGLPLpAtPL0ZZ9AeUyQC3fIqG6Lvo= -github.com/VictoriaMetrics/metrics v1.17.2/go.mod h1:Z1tSfPfngDn12bTfZSCqArT3OPY3u88J12hSoOhuiRE= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/andybalholm/brotli v1.0.0 h1:7UCwP93aiSfvWpapti8g88vVVGp2qqtGyePsSuDafo4= -github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6 h1:bZ28Hqta7TFAK3Q08CMvv8y3/8ATaEqv2nGoc6yff6c= +github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6/go.mod h1:+lx6/Aqd1kLJ1GQfkvOnaZ1WGmLpMpbprPuIOOZX30U= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= @@ -60,31 +37,15 @@ github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8 github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q= github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= -github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/go-chi/chi v4.1.2+incompatible h1:fGFk2Gmi/YKXk0OmGfBh0WgmN3XB8lVnEyNz34tQRec= github.com/go-chi/chi v4.1.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY= -github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= -github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI= +github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-redis/redis v6.15.6+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= @@ -95,105 +56,67 @@ github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721 h1:KRMr9A3qfbVM7iV/WcLY/rL5LICqwMHLhwRXKu99fXw= +github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.9.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.10.0 h1:92XGj1AcYzA6UrVdd4qIIBrT8OroryvRvdmg/IfmC7Y= github.com/klauspost/compress v1.10.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.10.10 h1:a/y8CglcM7gLGYmlbP/stPE5sR3hbhFRUjCBfd/0B3I= -github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid/v2 v2.0.2 h1:pd2FBxFydtPn2ywTLStbFg9CJKrojATnpeJWSP7Ys4k= -github.com/klauspost/cpuid/v2 v2.0.2/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/pgzip v1.2.4 h1:TQ7CNpYKovDOmqzRHKxJh0BeaBI7UdQZYc6p7pMQh1A= -github.com/klauspost/pgzip v1.2.4/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= -github.com/klauspost/reedsolomon v1.9.12 h1:EyOucRmcrLH+2hqKGdoA5SM8pwPKR6BJsf3r6zpYOA0= -github.com/klauspost/reedsolomon v1.9.12/go.mod h1:nLvuzNvy1ZDNQW30IuMc2ZWCbiqrJgdLoUS2X8HAUVg= +github.com/klauspost/cpuid v1.2.4 h1:EBfaK0SWSwk+fgk6efYFWdzl8MwRWoOO1gkmiaTXPW4= +github.com/klauspost/cpuid v1.2.4/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/pgzip v1.2.1 h1:oIPZROsWuPHpOdMVWLuJZXwgjhrW8r1yEX8UqMyeNHM= +github.com/klauspost/pgzip v1.2.1/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/klauspost/reedsolomon v1.9.9 h1:qCL7LZlv17xMixl55nq2/Oa1Y86nfO8EqDfv2GHND54= +github.com/klauspost/reedsolomon v1.9.9/go.mod h1:O7yFFHiQwDR6b2t63KPUpccPtNdp5ADgh1gg4fd12wo= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -205,34 +128,25 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kz/discordrus v1.2.0 h1:r5uplKozPR+TIJ1NUZT758Lv7eukf8+fp3L4uRj+6xs= github.com/kz/discordrus v1.2.0/go.mod h1:cJ3TiJUUuY5Gm3DNYHnnaUa3iol8VBRPzztAeZm7exc= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= -github.com/mholt/archiver/v3 v3.5.0 h1:nE8gZIrw66cu4osS/U7UW7YDuGMHssxKutU8IfWxwWE= -github.com/mholt/archiver/v3 v3.5.0/go.mod h1:qqTTPUK/HZPFgFQ/TJ3BzvTpF/dPtFVJXdQbCmeMxwc= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mholt/archiver/v3 v3.3.0 h1:vWjhY8SQp5yzM9P6OJ/eZEkmi3UAbRrxCq48MxjAzig= +github.com/mholt/archiver/v3 v3.3.0/go.mod h1:YnQtqsp+94Rwd0D/rk5cnLrxusUBUXg+08Ebtr1Mqao= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mmcloughlin/avo v0.0.0-20200523190732-4439b6b2c061 h1:UCU8+cLbbvyxi0sQ9fSeoEhZgvrrD9HKMtX6Gmc1vk8= +github.com/mmcloughlin/avo v0.0.0-20200523190732-4439b6b2c061/go.mod h1:wqKykBG2QzQDJEzvRkcS8x6MiSJkF52hXZsXcjaB3ls= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -240,54 +154,46 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nwaples/rardecode v1.1.0 h1:vSxaY8vQhOcVr4mm5e8XllHWTiM4JF507A0Katqw7MQ= -github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= +github.com/nwaples/rardecode v1.0.0 h1:r7vGuS5akxOnR4JQSkko62RJ1ReCMXxQRPtxsiFMBOs= +github.com/nwaples/rardecode v1.0.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pierrec/lz4/v4 v4.0.3 h1:vNQKSVZNYUEAvRY9FaUXAF1XPbSOHJtDTiP41kzDz2E= -github.com/pierrec/lz4/v4 v4.0.3/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pires/go-proxyproto v0.3.3/go.mod h1:Odh9VFOZJCf9G8cLW5o435Xf1J95Jw9Gw5rnCjcwzAY= +github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.5.0 h1:042Buzk+NhDI+DeSAA62RwJL8VAuZUMQZUjCsRz1Mug= github.com/pkg/profile v1.5.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/schollz/progressbar/v2 v2.15.0 h1:dVzHQ8fHRmtPjD3K10jT3Qgn/+H+92jhPrhmxIJfDz8= github.com/schollz/progressbar/v2 v2.15.0/go.mod h1:UdPq3prGkfQ7MOzZKlDRpYKcFqEMczbD7YmbPgpzKMI= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shirou/gopsutil v3.21.3+incompatible h1:uenXGGa8ESCQq+dbgtl916dmg6PSAz2cXov0uORQ9v8= -github.com/shirou/gopsutil v3.21.3+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shirou/gopsutil v2.20.5+incompatible h1:tYH07UPoQt0OCQdgWWMgYHy3/a9bcxNpBIysykNIP7I= +github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/skycoin/dmsg v0.0.0-20210329160412-4e25fc9ad26c h1:/bAgBF+By+6qexWCFpvnrNVq3hAPkkEtCpqVej4p+CE= -github.com/skycoin/dmsg v0.0.0-20210329160412-4e25fc9ad26c/go.mod h1:tR/47K4BLJ2MT6eyE2BCxcXHLUhfnWiDhgE1OQmtA70= +github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/skycoin/dmsg v0.0.0-20201216183836-dae8a7acfc14 h1:ettvdRq5O1+bx1wIZPS9w+BnjzTxhZeNItDgwYI8KHs= +github.com/skycoin/dmsg v0.0.0-20201216183836-dae8a7acfc14/go.mod h1:aP/e1DEQQ16i5AzHy2e+2EFYT3ZN/sIyWRY0js56yY8= github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6 h1:1Nc5EBY6pjfw1kwW0duwyG+7WliWz5u9kgk1h5MnLuA= github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:UXghlricA7J3aRD/k7p/zBObQfmBawwCxIVPVjz2Q3o= github.com/skycoin/skycoin v0.26.0/go.mod h1:78nHjQzd8KG0jJJVL/j0xMmrihXi70ti63fh8vXScJw= @@ -304,23 +210,22 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= +github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= @@ -328,24 +233,15 @@ github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161 h1:89CEmDvlq/F7S github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161/go.mod h1:wM7WEvslTq+iOEAMDLSzhVuOt5BRZ05WirO+b09GHQU= github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b h1:fj5tQ8acgNUr6O8LEplsxDhUIe2573iLkJc+PqnzZTI= github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b/go.mod h1:5XA7W9S6mni3h5uvOC75dA3m9CCCaS83lltmc0ukdi4= -github.com/tjfoc/gmsm v1.4.0 h1:8nbaiZG+iVdh+fXVw0DZoZZa7a4TGm3Qab+xdrdzj8s= -github.com/tjfoc/gmsm v1.4.0/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE= -github.com/tklauser/go-sysconf v0.3.5 h1:uu3Xl4nkLzQfXNsWn15rPc/HQCJKObbt1dKJeWp3vU4= -github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= -github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA= -github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= +github.com/tjfoc/gmsm v1.3.2 h1:7JVkAn5bvUJ7HtU08iW6UiD+UTmJTIToHCfeFzkcCxM= +github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/toqueteos/webbrowser v1.2.0 h1:tVP/gpK69Fx+qMJKsLE7TD8LuGWPnEV71wBN9rrstGQ= github.com/toqueteos/webbrowser v1.2.0/go.mod h1:XWoZq4cyp9WeUeak7w7LXRUQf1F1ATJMir8RTqb4ayM= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ulikunitz/xz v0.5.6 h1:jGHAfXawEGZQ3blwU5wnWKQJvAraT7Ftq9EXjnXYgt8= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= -github.com/ulikunitz/xz v0.5.7 h1:YvTNdFzX6+W5m9msiYg/zpkSURPPtOlzbqYjrFn7Yt4= -github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/valyala/fastrand v1.0.0 h1:LUKT9aKer2dVQNUi3waewTbKV+7H17kvWFNKs2ObdkI= github.com/valyala/fastrand v1.0.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ= github.com/valyala/histogram v1.1.2 h1:vOk5VrGjMBIoPR5k6wA8vBaC8toeJ8XO0yfRjFEc1h8= @@ -358,92 +254,60 @@ github.com/xtaci/kcp-go v5.4.20+incompatible h1:TN1uey3Raw0sTz0Fg8GkfM0uH3YwzhnZ github.com/xtaci/kcp-go v5.4.20+incompatible/go.mod h1:bN6vIwHQbfHaHtFpEssmWsN45a+AZwO7eyRCmEIbtvE= github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37 h1:EWU6Pktpas0n8lLQwDsRyZfmkPeRbdgPtW609es+/9E= github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37/go.mod h1:HpMP7DB2CyokmAh4lp0EQnnWhmycP/TvwBGzvuie+H0= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/arch v0.0.0-20190909030613-46d78d1859ac/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc h1:+q90ECDSAQirdykUN6sPEiBXBsp8Csjcca8Oy7bgLTA= -golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9 h1:sYNJzB4J8toYPQTM6pAkcmBRgw9SnQKP9oXCHfgy604= +golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191003171128-d98b1b443823/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210420210106-798c2154c571 h1:Q6Bg8xzKzpFPU4Oi1sBnBTHBwlMsLeEXpu4hYBY8rAg= -golang.org/x/net v0.0.0-20210420210106-798c2154c571/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -452,106 +316,62 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988 h1:EjgCl+fVlIaPJSori0ikSz3uV0DOHKWOJFpv1sAAhBM= golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210406210042-72f3dc4e9b72 h1:VqE9gduFZ4dbR7XoL77lHFp0/DyDUBKSXK7CMFkVcV0= -golang.org/x/term v0.0.0-20210406210042-72f3dc4e9b72/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf h1:MZ2shdL+ZM/XzY3ZGOnh4Nlpnxz5GSOhOmtHo3iPU6M= +golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200425043458-8463f397d07c/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.zx2c4.com/wireguard v0.0.20200320 h1:1vE6zVeO7fix9cJX1Z9ZQ+ikPIIx7vIyU0o0tLDD88g= golang.zx2c4.com/wireguard v0.0.20200320/go.mod h1:lDian4Sw4poJ04SgHh35nzMVwGSYlPumkdnHcucAQoY= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +nhooyr.io/websocket v1.8.2 h1:LwdzfyyOZKtVFoXay6A39Acu03KmidSZ3YUUvPa13PA= nhooyr.io/websocket v1.8.2/go.mod h1:LiqdCg1Cu7TPWxEvPjPa0TGYxCsy4pHNTN9gGluwBpQ= -nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= -nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/vendor/github.com/AudriusButkevicius/pfilter/filter.go b/vendor/github.com/AudriusButkevicius/pfilter/filter.go index 7ff501f4a1..a947f67d7a 100644 --- a/vendor/github.com/AudriusButkevicius/pfilter/filter.go +++ b/vendor/github.com/AudriusButkevicius/pfilter/filter.go @@ -93,6 +93,7 @@ func (d *PacketFilter) Start() { func (d *PacketFilter) loop() { var buf []byte +next: for { buf = bufPool.Get().([]byte) n, addr, err := d.conn.ReadFrom(buf) @@ -103,39 +104,33 @@ func (d *PacketFilter) loop() { buf: buf[:n], } + d.mut.Lock() + conns := d.conns + d.mut.Unlock() + if err != nil { - d.mut.Lock() - for _, conn := range d.conns { + for _, conn := range conns { select { case conn.recvBuffer <- pkt: default: atomic.AddUint64(&d.overflow, 1) } } - d.mut.Unlock() return } - d.mut.Lock() - sent := d.sendPacketLocked(pkt) - d.mut.Unlock() - if !sent { - atomic.AddUint64(&d.dropped, 1) - } - bufPool.Put(pkt.buf[:maxPacketSize]) - } -} - -func (d *PacketFilter) sendPacketLocked(pkt packet) bool { - for _, conn := range d.conns { - if conn.filter == nil || conn.filter.ClaimIncoming(pkt.buf, pkt.addr) { - select { - case conn.recvBuffer <- pkt: - default: - atomic.AddUint64(&d.overflow, 1) + for _, conn := range conns { + if conn.filter == nil || conn.filter.ClaimIncoming(pkt.buf, pkt.addr) { + select { + case conn.recvBuffer <- pkt: + default: + bufPool.Put(pkt.buf[:maxPacketSize]) + atomic.AddUint64(&d.overflow, 1) + } + goto next } - return true } + bufPool.Put(pkt.buf[:maxPacketSize]) + atomic.AddUint64(&d.dropped, 1) } - return false } diff --git a/vendor/github.com/StackExchange/wmi/wmi.go b/vendor/github.com/StackExchange/wmi/wmi.go index 652ec74616..eab18cbfee 100644 --- a/vendor/github.com/StackExchange/wmi/wmi.go +++ b/vendor/github.com/StackExchange/wmi/wmi.go @@ -68,8 +68,7 @@ func QueryNamespace(query string, dst interface{}, namespace string) error { // // By default, the local machine and default namespace are used. These can be // changed using connectServerArgs. See -// https://docs.microsoft.com/en-us/windows/desktop/WmiSdk/swbemlocator-connectserver -// for details. +// http://msdn.microsoft.com/en-us/library/aa393720.aspx for details. // // Query is a wrapper around DefaultClient.Query. func Query(query string, dst interface{}, connectServerArgs ...interface{}) error { @@ -79,14 +78,6 @@ func Query(query string, dst interface{}, connectServerArgs ...interface{}) erro return DefaultClient.SWbemServicesClient.Query(query, dst, connectServerArgs...) } -// CallMethod calls a method named methodName on an instance of the class named -// className, with the given params. -// -// CallMethod is a wrapper around DefaultClient.CallMethod. -func CallMethod(connectServerArgs []interface{}, className, methodName string, params []interface{}) (int32, error) { - return DefaultClient.CallMethod(connectServerArgs, className, methodName, params) -} - // A Client is an WMI query client. // // Its zero value (DefaultClient) is a usable client. @@ -118,103 +109,9 @@ type Client struct { SWbemServicesClient *SWbemServices } -// DefaultClient is the default Client and is used by Query, QueryNamespace, and CallMethod. +// DefaultClient is the default Client and is used by Query, QueryNamespace var DefaultClient = &Client{} -// coinitService coinitializes WMI service. If no error is returned, a cleanup function -// is returned which must be executed (usually deferred) to clean up allocated resources. -func (c *Client) coinitService(connectServerArgs ...interface{}) (*ole.IDispatch, func(), error) { - var unknown *ole.IUnknown - var wmi *ole.IDispatch - var serviceRaw *ole.VARIANT - - // be sure teardown happens in the reverse - // order from that which they were created - deferFn := func() { - if serviceRaw != nil { - serviceRaw.Clear() - } - if wmi != nil { - wmi.Release() - } - if unknown != nil { - unknown.Release() - } - ole.CoUninitialize() - } - - // if we error'ed here, clean up immediately - var err error - defer func() { - if err != nil { - deferFn() - } - }() - - err = ole.CoInitializeEx(0, ole.COINIT_MULTITHREADED) - if err != nil { - oleCode := err.(*ole.OleError).Code() - if oleCode != ole.S_OK && oleCode != S_FALSE { - return nil, nil, err - } - } - - unknown, err = oleutil.CreateObject("WbemScripting.SWbemLocator") - if err != nil { - return nil, nil, err - } else if unknown == nil { - return nil, nil, ErrNilCreateObject - } - - wmi, err = unknown.QueryInterface(ole.IID_IDispatch) - if err != nil { - return nil, nil, err - } - - // service is a SWbemServices - serviceRaw, err = oleutil.CallMethod(wmi, "ConnectServer", connectServerArgs...) - if err != nil { - return nil, nil, err - } - - return serviceRaw.ToIDispatch(), deferFn, nil -} - -// CallMethod calls a WMI method named methodName on an instance -// of the class named className. It passes in the arguments given -// in params. Use connectServerArgs to customize the machine and -// namespace; by default, the local machine and default namespace -// are used. See -// https://docs.microsoft.com/en-us/windows/desktop/WmiSdk/swbemlocator-connectserver -// for details. -func (c *Client) CallMethod(connectServerArgs []interface{}, className, methodName string, params []interface{}) (int32, error) { - service, cleanup, err := c.coinitService(connectServerArgs...) - if err != nil { - return 0, fmt.Errorf("coinit: %v", err) - } - defer cleanup() - - // Get class - classRaw, err := oleutil.CallMethod(service, "Get", className) - if err != nil { - return 0, fmt.Errorf("CallMethod Get class %s: %v", className, err) - } - class := classRaw.ToIDispatch() - defer classRaw.Clear() - - // Run method - resultRaw, err := oleutil.CallMethod(class, methodName, params...) - if err != nil { - return 0, fmt.Errorf("CallMethod %s.%s: %v", className, methodName, err) - } - resultInt, ok := resultRaw.Value().(int32) - if !ok { - return 0, fmt.Errorf("return value was not an int32: %v (%T)", resultRaw, resultRaw) - } - - return resultInt, nil -} - // Query runs the WQL query and appends the values to dst. // // dst must have type *[]S or *[]*S, for some struct type S. Fields selected in @@ -224,8 +121,7 @@ func (c *Client) CallMethod(connectServerArgs []interface{}, className, methodNa // // By default, the local machine and default namespace are used. These can be // changed using connectServerArgs. See -// https://docs.microsoft.com/en-us/windows/desktop/WmiSdk/swbemlocator-connectserver -// for details. +// http://msdn.microsoft.com/en-us/library/aa393720.aspx for details. func (c *Client) Query(query string, dst interface{}, connectServerArgs ...interface{}) error { dv := reflect.ValueOf(dst) if dv.Kind() != reflect.Ptr || dv.IsNil() { @@ -242,11 +138,36 @@ func (c *Client) Query(query string, dst interface{}, connectServerArgs ...inter runtime.LockOSThread() defer runtime.UnlockOSThread() - service, cleanup, err := c.coinitService(connectServerArgs...) + err := ole.CoInitializeEx(0, ole.COINIT_MULTITHREADED) + if err != nil { + oleCode := err.(*ole.OleError).Code() + if oleCode != ole.S_OK && oleCode != S_FALSE { + return err + } + } + defer ole.CoUninitialize() + + unknown, err := oleutil.CreateObject("WbemScripting.SWbemLocator") if err != nil { return err + } else if unknown == nil { + return ErrNilCreateObject } - defer cleanup() + defer unknown.Release() + + wmi, err := unknown.QueryInterface(ole.IID_IDispatch) + if err != nil { + return err + } + defer wmi.Release() + + // service is a SWbemServices + serviceRaw, err := oleutil.CallMethod(wmi, "ConnectServer", connectServerArgs...) + if err != nil { + return err + } + service := serviceRaw.ToIDispatch() + defer serviceRaw.Clear() // result is a SWBemObjectSet resultRaw, err := oleutil.CallMethod(service, "ExecQuery", query) @@ -557,10 +478,7 @@ func oleInt64(item *ole.IDispatch, prop string) (int64, error) { // CreateQuery returns a WQL query string that queries all columns of src. where // is an optional string that is appended to the query, to be used with WHERE // clauses. In such a case, the "WHERE" string should appear at the beginning. -// The wmi class is obtained by the name of the type. You can pass a optional -// class throught the variadic class parameter which is useful for anonymous -// structs. -func CreateQuery(src interface{}, where string, class ...string) string { +func CreateQuery(src interface{}, where string) string { var b bytes.Buffer b.WriteString("SELECT ") s := reflect.Indirect(reflect.ValueOf(src)) @@ -577,11 +495,7 @@ func CreateQuery(src interface{}, where string, class ...string) string { } b.WriteString(strings.Join(fields, ", ")) b.WriteString(" FROM ") - if len(class) > 0{ - b.WriteString(class[0]) - } else { - b.WriteString(t.Name()) - } + b.WriteString(t.Name()) b.WriteString(" " + where) return b.String() } diff --git a/vendor/github.com/VictoriaMetrics/metrics/README.md b/vendor/github.com/VictoriaMetrics/metrics/README.md index 5eef96a661..4f1283abb4 100644 --- a/vendor/github.com/VictoriaMetrics/metrics/README.md +++ b/vendor/github.com/VictoriaMetrics/metrics/README.md @@ -86,19 +86,19 @@ Because the `github.com/prometheus/client_golang` is too complex and is hard to #### Why the `metrics.WritePrometheus` doesn't expose documentation for each metric? Because this documentation is ignored by Prometheus. The documentation is for users. -Just give meaningful names to the exported metrics or add comments in the source code -or in other suitable place explaining each metric exposed from your application. +Just add comments in the source code or in other suitable place explaining each metric +exposed from your application. #### How to implement [CounterVec](https://godoc.org/github.com/prometheus/client_golang/prometheus#CounterVec) in `metrics`? Just use [GetOrCreateCounter](http://godoc.org/github.com/VictoriaMetrics/metrics#GetOrCreateCounter) -instead of `CounterVec.With`. See [this example](https://pkg.go.dev/github.com/VictoriaMetrics/metrics#example-Counter-Vec) for details. +instead of `CounterVec.With`. See [this example](https://godoc.org/github.com/VictoriaMetrics/metrics#example-Counter--Vec) for details. #### Why [Histogram](http://godoc.org/github.com/VictoriaMetrics/metrics#Histogram) buckets contain `vmrange` labels instead of `le` labels like in Prometheus histograms? -Buckets with `vmrange` labels occupy less disk space compared to Promethes-style buckets with `le` labels, +Buckets with `vmrange` labels occupy less disk space comparing to Promethes-style buckets with `le` labels, because `vmrange` buckets don't include counters for the previous ranges. [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics) provides `prometheus_buckets` function, which converts `vmrange` buckets to Prometheus-style buckets with `le` labels. This is useful for building heatmaps in Grafana. Additionally, its' `histogram_quantile` function transparently handles histogram buckets with `vmrange` labels. diff --git a/vendor/github.com/VictoriaMetrics/metrics/histogram.go b/vendor/github.com/VictoriaMetrics/metrics/histogram.go index b0e8d575fb..c1879996a1 100644 --- a/vendor/github.com/VictoriaMetrics/metrics/histogram.go +++ b/vendor/github.com/VictoriaMetrics/metrics/histogram.go @@ -9,15 +9,14 @@ import ( ) const ( - e10Min = -9 - e10Max = 18 - bucketsPerDecimal = 18 - decimalBucketsCount = e10Max - e10Min - bucketsCount = decimalBucketsCount * bucketsPerDecimal + e10Min = -9 + e10Max = 18 + decimalMultiplier = 2 + bucketSize = 9 * decimalMultiplier + bucketsCount = e10Max - e10Min + decimalPrecision = 1e-12 ) -var bucketMultiplier = math.Pow(10, 1.0/bucketsPerDecimal) - // Histogram is a histogram for non-negative values with automatically created buckets. // // See https://medium.com/@valyala/improving-histogram-usability-for-prometheus-and-grafana-bc7e5df0e350 @@ -49,8 +48,9 @@ type Histogram struct { // Mu gurantees synchronous update for all the counters and sum. mu sync.Mutex - decimalBuckets [decimalBucketsCount]*[bucketsPerDecimal]uint64 + buckets [bucketsCount]*histogramBucket + zeros uint64 lower uint64 upper uint64 @@ -60,18 +60,22 @@ type Histogram struct { // Reset resets the given histogram. func (h *Histogram) Reset() { h.mu.Lock() - for _, db := range h.decimalBuckets[:] { - if db == nil { + h.resetLocked() + h.mu.Unlock() +} + +func (h *Histogram) resetLocked() { + for _, hb := range h.buckets[:] { + if hb == nil { continue } - for i := range db[:] { - db[i] = 0 + for offset := range hb.counts[:] { + hb.counts[offset] = 0 } } + h.zeros = 0 h.lower = 0 h.upper = 0 - h.sum = 0 - h.mu.Unlock() } // Update updates h with v. @@ -82,31 +86,31 @@ func (h *Histogram) Update(v float64) { // Skip NaNs and negative values. return } - bucketIdx := (math.Log10(v) - e10Min) * bucketsPerDecimal + bucketIdx, offset := getBucketIdxAndOffset(v) h.mu.Lock() + h.updateLocked(v, bucketIdx, offset) + h.mu.Unlock() +} + +func (h *Histogram) updateLocked(v float64, bucketIdx int, offset uint) { h.sum += v if bucketIdx < 0 { - h.lower++ - } else if bucketIdx >= bucketsCount { - h.upper++ - } else { - idx := uint(bucketIdx) - if bucketIdx == float64(idx) && idx > 0 { - // Edge case for 10^n values, which must go to the lower bucket - // according to Prometheus logic for `le`-based histograms. - idx-- - } - decimalBucketIdx := idx / bucketsPerDecimal - offset := idx % bucketsPerDecimal - db := h.decimalBuckets[decimalBucketIdx] - if db == nil { - var b [bucketsPerDecimal]uint64 - db = &b - h.decimalBuckets[decimalBucketIdx] = db + // Special cases for zero, too small or too big value + if offset == 0 { + h.zeros++ + } else if offset == 1 { + h.lower++ + } else { + h.upper++ } - db[offset]++ + return } - h.mu.Unlock() + hb := h.buckets[bucketIdx] + if hb == nil { + hb = &histogramBucket{} + h.buckets[bucketIdx] = hb + } + hb.counts[offset]++ } // VisitNonZeroBuckets calls f for all buckets with non-zero counters. @@ -117,25 +121,38 @@ func (h *Histogram) Update(v float64) { // with `le` (less or equal) labels. func (h *Histogram) VisitNonZeroBuckets(f func(vmrange string, count uint64)) { h.mu.Lock() + h.visitNonZeroBucketsLocked(f) + h.mu.Unlock() +} + +func (h *Histogram) visitNonZeroBucketsLocked(f func(vmrange string, count uint64)) { + if h.zeros > 0 { + vmrange := getVMRange(-1, 0) + f(vmrange, h.zeros) + } if h.lower > 0 { - f(lowerBucketRange, h.lower) + vmrange := getVMRange(-1, 1) + f(vmrange, h.lower) } - for decimalBucketIdx, db := range h.decimalBuckets[:] { - if db == nil { + for bucketIdx, hb := range h.buckets[:] { + if hb == nil { continue } - for offset, count := range db[:] { + for offset, count := range hb.counts[:] { if count > 0 { - bucketIdx := decimalBucketIdx*bucketsPerDecimal + offset - vmrange := getVMRange(bucketIdx) + vmrange := getVMRange(bucketIdx, uint(offset)) f(vmrange, count) } } } if h.upper > 0 { - f(upperBucketRange, h.upper) + vmrange := getVMRange(-1, 2) + f(vmrange, h.upper) } - h.mu.Unlock() +} + +type histogramBucket struct { + counts [bucketSize]uint64 } // NewHistogram creates and returns new histogram with the given name. @@ -176,27 +193,43 @@ func (h *Histogram) UpdateDuration(startTime time.Time) { h.Update(d) } -func getVMRange(bucketIdx int) string { +func getVMRange(bucketIdx int, offset uint) string { bucketRangesOnce.Do(initBucketRanges) - return bucketRanges[bucketIdx] + if bucketIdx < 0 { + if offset > 2 { + panic(fmt.Errorf("BUG: offset must be in range [0...2] for negative bucketIdx; got %d", offset)) + } + return bucketRanges[offset] + } + idx := 3 + uint(bucketIdx)*bucketSize + offset + return bucketRanges[idx] } func initBucketRanges() { - v := math.Pow10(e10Min) - start := fmt.Sprintf("%.3e", v) - for i := 0; i < bucketsCount; i++ { - v *= bucketMultiplier - end := fmt.Sprintf("%.3e", v) - bucketRanges[i] = start + "..." + end - start = end + bucketRanges[0] = "0...0" + bucketRanges[1] = fmt.Sprintf("0...%.1fe%d", 1.0, e10Min) + bucketRanges[2] = fmt.Sprintf("%.1fe%d...+Inf", 1.0, e10Max) + idx := 3 + start := fmt.Sprintf("%.1fe%d", 1.0, e10Min) + for bucketIdx := 0; bucketIdx < bucketsCount; bucketIdx++ { + for offset := 0; offset < bucketSize; offset++ { + e10 := e10Min + bucketIdx + m := 1 + float64(offset+1)/decimalMultiplier + if math.Abs(m-10) < decimalPrecision { + m = 1 + e10++ + } + end := fmt.Sprintf("%.1fe%d", m, e10) + bucketRanges[idx] = start + "..." + end + idx++ + start = end + } } } var ( - lowerBucketRange = fmt.Sprintf("0...%.3e", math.Pow10(e10Min)) - upperBucketRange = fmt.Sprintf("%.3e...+Inf", math.Pow10(e10Max)) - - bucketRanges [bucketsCount]string + // 3 additional buckets for zero, lower and upper. + bucketRanges [3 + bucketsCount*bucketSize]string bucketRangesOnce sync.Once ) @@ -205,21 +238,21 @@ func (h *Histogram) marshalTo(prefix string, w io.Writer) { h.VisitNonZeroBuckets(func(vmrange string, count uint64) { tag := fmt.Sprintf("vmrange=%q", vmrange) metricName := addTag(prefix, tag) - name, labels := splitMetricName(metricName) - fmt.Fprintf(w, "%s_bucket%s %d\n", name, labels, count) + name, filters := splitMetricName(metricName) + fmt.Fprintf(w, "%s_bucket%s %d\n", name, filters, count) countTotal += count }) if countTotal == 0 { return } - name, labels := splitMetricName(prefix) + name, filters := splitMetricName(prefix) sum := h.getSum() if float64(int64(sum)) == sum { - fmt.Fprintf(w, "%s_sum%s %d\n", name, labels, int64(sum)) + fmt.Fprintf(w, "%s_sum%s %d\n", name, filters, int64(sum)) } else { - fmt.Fprintf(w, "%s_sum%s %g\n", name, labels, sum) + fmt.Fprintf(w, "%s_sum%s %g\n", name, filters, sum) } - fmt.Fprintf(w, "%s_count%s %d\n", name, labels, countTotal) + fmt.Fprintf(w, "%s_count%s %d\n", name, filters, countTotal) } func (h *Histogram) getSum() float64 { @@ -228,3 +261,46 @@ func (h *Histogram) getSum() float64 { h.mu.Unlock() return sum } + +func getBucketIdxAndOffset(v float64) (int, uint) { + if v < 0 { + panic(fmt.Errorf("BUG: v must be positive; got %g", v)) + } + if v == 0 { + return -1, 0 + } + if math.IsInf(v, 1) { + return -1, 2 + } + e10 := int(math.Floor(math.Log10(v))) + bucketIdx := e10 - e10Min + if bucketIdx < 0 { + return -1, 1 + } + if bucketIdx >= bucketsCount { + if bucketIdx == bucketsCount && math.Abs(math.Pow10(e10)-v) < decimalPrecision { + // Adjust m to be on par with Prometheus 'le' buckets (aka 'less or equal') + return bucketsCount - 1, bucketSize - 1 + } + return -1, 2 + } + m := ((v / math.Pow10(e10)) - 1) * decimalMultiplier + offset := int(m) + if offset < 0 { + offset = 0 + } else if offset >= bucketSize { + offset = bucketSize - 1 + } + if math.Abs(float64(offset)-m) < decimalPrecision { + // Adjust offset to be on par with Prometheus 'le' buckets (aka 'less or equal') + offset-- + if offset < 0 { + bucketIdx-- + offset = bucketSize - 1 + if bucketIdx < 0 { + return -1, 1 + } + } + } + return bucketIdx, uint(offset) +} diff --git a/vendor/github.com/VictoriaMetrics/metrics/metrics.go b/vendor/github.com/VictoriaMetrics/metrics/metrics.go index c28c036132..962ceef5b2 100644 --- a/vendor/github.com/VictoriaMetrics/metrics/metrics.go +++ b/vendor/github.com/VictoriaMetrics/metrics/metrics.go @@ -47,45 +47,8 @@ func WritePrometheus(w io.Writer, exposeProcessMetrics bool) { // WriteProcessMetrics writes additional process metrics in Prometheus format to w. // -// The following `go_*` and `process_*` metrics are exposed for the currently -// running process. Below is a short description for the exposed `process_*` metrics: -// -// - process_cpu_seconds_system_total - CPU time spent in syscalls -// - process_cpu_seconds_user_total - CPU time spent in userspace -// - process_cpu_seconds_total - CPU time spent by the process -// - process_major_pagefaults_total - page faults resulted in disk IO -// - process_minor_pagefaults_total - page faults resolved without disk IO -// - process_resident_memory_bytes - recently accessed memory (aka RSS or resident memory) -// - process_resident_memory_peak_bytes - the maximum RSS memory usage -// - process_resident_memory_anon_bytes - RSS for memory-mapped files -// - process_resident_memory_file_bytes - RSS for memory allocated by the process -// - process_resident_memory_shared_bytes - RSS for memory shared between multiple processes -// - process_virtual_memory_bytes - virtual memory usage -// - process_virtual_memory_peak_bytes - the maximum virtual memory usage -// - process_num_threads - the number of threads -// - process_start_time_seconds - process start time as unix timestamp -// -// - process_io_read_bytes_total - the number of bytes read via syscalls -// - process_io_written_bytes_total - the number of bytes written via syscalls -// - process_io_read_syscalls_total - the number of read syscalls -// - process_io_write_syscalls_total - the number of write syscalls -// - process_io_storage_read_bytes_total - the number of bytes actually read from disk -// - process_io_storage_written_bytes_total - the number of bytes actually written to disk -// -// - go_memstats_alloc_bytes - memory usage for Go objects in the heap -// - go_memstats_alloc_bytes_total - the cumulative counter for total size of allocated Go objects -// - go_memstats_frees_total - the cumulative counter for number of freed Go objects -// - go_memstats_gc_cpu_fraction - the fraction of CPU spent in Go garbage collector -// - go_memstats_gc_sys_bytes - the size of Go garbage collector metadata -// - go_memstats_heap_alloc_bytes - the same as go_memstats_alloc_bytes -// - go_memstats_heap_idle_bytes - idle memory ready for new Go object allocations -// - go_memstats_heap_objects - the number of Go objects in the heap -// - go_memstats_heap_sys_bytes - memory requested for Go objects from the OS -// - go_memstats_mallocs_total - the number of allocations for Go objects -// - go_memstats_next_gc_bytes - the target heap size when the next garbage collection should start -// - go_memstats_stack_inuse_bytes - memory used for goroutine stacks -// - go_memstats_stack_sys_bytes - memory requested fromthe OS for goroutine stacks -// - go_memstats_sys_bytes - memory requested by Go runtime from the OS +// Various `go_*` and `process_*` metrics are exposed for the currently +// running process. // // The WriteProcessMetrics func is usually called in combination with writing Set metrics // inside "/metrics" handler: @@ -95,17 +58,11 @@ func WritePrometheus(w io.Writer, exposeProcessMetrics bool) { // metrics.WriteProcessMetrics(w) // }) // -// See also WrteFDMetrics. func WriteProcessMetrics(w io.Writer) { writeGoMetrics(w) writeProcessMetrics(w) } -// WriteFDMetrics writes `process_max_fds` and `process_open_fds` metrics to w. -func WriteFDMetrics(w io.Writer) { - writeFDMetrics(w) -} - // UnregisterMetric removes metric with the given name from default set. func UnregisterMetric(name string) bool { return defaultSet.UnregisterMetric(name) diff --git a/vendor/github.com/VictoriaMetrics/metrics/process_metrics_linux.go b/vendor/github.com/VictoriaMetrics/metrics/process_metrics_linux.go index 12b5de8e3d..444299278a 100644 --- a/vendor/github.com/VictoriaMetrics/metrics/process_metrics_linux.go +++ b/vendor/github.com/VictoriaMetrics/metrics/process_metrics_linux.go @@ -6,12 +6,11 @@ import ( "io" "io/ioutil" "log" - "os" - "strconv" - "strings" "time" ) +const statFilepath = "/proc/self/stat" + // See https://github.com/prometheus/procfs/blob/a4ac0826abceb44c40fc71daed2b301db498b93e/proc_stat.go#L40 . const userHZ = 100 @@ -42,7 +41,6 @@ type procStat struct { } func writeProcessMetrics(w io.Writer) { - statFilepath := "/proc/self/stat" data, err := ioutil.ReadFile(statFilepath) if err != nil { log.Printf("ERROR: cannot open %s: %s", statFilepath, err) @@ -67,8 +65,7 @@ func writeProcessMetrics(w io.Writer) { } // It is expensive obtaining `process_open_fds` when big number of file descriptors is opened, - // so don't do it here. - // See writeFDMetrics instead. + // don't do it here. utime := float64(p.Utime) / userHZ stime := float64(p.Stime) / userHZ @@ -81,185 +78,6 @@ func writeProcessMetrics(w io.Writer) { fmt.Fprintf(w, "process_resident_memory_bytes %d\n", p.Rss*4096) fmt.Fprintf(w, "process_start_time_seconds %d\n", startTimeSeconds) fmt.Fprintf(w, "process_virtual_memory_bytes %d\n", p.Vsize) - writeProcessMemMetrics(w) - writeIOMetrics(w) -} - -func writeIOMetrics(w io.Writer) { - ioFilepath := "/proc/self/io" - data, err := ioutil.ReadFile(ioFilepath) - if err != nil { - log.Printf("ERROR: cannot open %q: %s", ioFilepath, err) - } - getInt := func(s string) int64 { - n := strings.IndexByte(s, ' ') - if n < 0 { - log.Printf("ERROR: cannot find whitespace in %q at %q", s, ioFilepath) - return 0 - } - v, err := strconv.ParseInt(s[n+1:], 10, 64) - if err != nil { - log.Printf("ERROR: cannot parse %q at %q: %s", s, ioFilepath, err) - return 0 - } - return v - } - var rchar, wchar, syscr, syscw, readBytes, writeBytes int64 - lines := strings.Split(string(data), "\n") - for _, s := range lines { - s = strings.TrimSpace(s) - switch { - case strings.HasPrefix(s, "rchar: "): - rchar = getInt(s) - case strings.HasPrefix(s, "wchar: "): - wchar = getInt(s) - case strings.HasPrefix(s, "syscr: "): - syscr = getInt(s) - case strings.HasPrefix(s, "syscw: "): - syscw = getInt(s) - case strings.HasPrefix(s, "read_bytes: "): - readBytes = getInt(s) - case strings.HasPrefix(s, "write_bytes: "): - writeBytes = getInt(s) - } - } - fmt.Fprintf(w, "process_io_read_bytes_total %d\n", rchar) - fmt.Fprintf(w, "process_io_written_bytes_total %d\n", wchar) - fmt.Fprintf(w, "process_io_read_syscalls_total %d\n", syscr) - fmt.Fprintf(w, "process_io_write_syscalls_total %d\n", syscw) - fmt.Fprintf(w, "process_io_storage_read_bytes_total %d\n", readBytes) - fmt.Fprintf(w, "process_io_storage_written_bytes_total %d\n", writeBytes) } var startTimeSeconds = time.Now().Unix() - -// writeFDMetrics writes process_max_fds and process_open_fds metrics to w. -func writeFDMetrics(w io.Writer) { - totalOpenFDs, err := getOpenFDsCount("/proc/self/fd") - if err != nil { - log.Printf("ERROR: cannot determine open file descriptors count: %s", err) - return - } - maxOpenFDs, err := getMaxFilesLimit("/proc/self/limits") - if err != nil { - log.Printf("ERROR: cannot determine the limit on open file descritors: %s", err) - return - } - fmt.Fprintf(w, "process_max_fds %d\n", maxOpenFDs) - fmt.Fprintf(w, "process_open_fds %d\n", totalOpenFDs) -} - -func getOpenFDsCount(path string) (uint64, error) { - f, err := os.Open(path) - if err != nil { - return 0, err - } - defer f.Close() - var totalOpenFDs uint64 - for { - names, err := f.Readdirnames(512) - if err == io.EOF { - break - } - if err != nil { - return 0, fmt.Errorf("unexpected error at Readdirnames: %s", err) - } - totalOpenFDs += uint64(len(names)) - } - return totalOpenFDs, nil -} - -func getMaxFilesLimit(path string) (uint64, error) { - data, err := ioutil.ReadFile(path) - if err != nil { - return 0, err - } - lines := strings.Split(string(data), "\n") - const prefix = "Max open files" - for _, s := range lines { - if !strings.HasPrefix(s, prefix) { - continue - } - text := strings.TrimSpace(s[len(prefix):]) - // Extract soft limit. - n := strings.IndexByte(text, ' ') - if n < 0 { - return 0, fmt.Errorf("cannot extract soft limit from %q", s) - } - text = text[:n] - if text == "unlimited" { - return 1<<64 - 1, nil - } - limit, err := strconv.ParseUint(text, 10, 64) - if err != nil { - return 0, fmt.Errorf("cannot parse soft limit from %q: %s", s, err) - } - return limit, nil - } - return 0, fmt.Errorf("cannot find max open files limit") -} - -// https://man7.org/linux/man-pages/man5/procfs.5.html -type memStats struct { - vmPeak uint64 - rssPeak uint64 - rssAnon uint64 - rssFile uint64 - rssShmem uint64 -} - -func writeProcessMemMetrics(w io.Writer) { - ms, err := getMemStats("/proc/self/status") - if err != nil { - log.Printf("ERROR: cannot determine memory status: %s", err) - return - } - fmt.Fprintf(w, "process_virtual_memory_peak_bytes %d\n", ms.vmPeak) - fmt.Fprintf(w, "process_resident_memory_peak_bytes %d\n", ms.rssPeak) - fmt.Fprintf(w, "process_resident_memory_anon_bytes %d\n", ms.rssAnon) - fmt.Fprintf(w, "process_resident_memory_file_bytes %d\n", ms.rssFile) - fmt.Fprintf(w, "process_resident_memory_shared_bytes %d\n", ms.rssShmem) - -} - -func getMemStats(path string) (*memStats, error) { - data, err := ioutil.ReadFile(path) - if err != nil { - return nil, err - } - var ms memStats - lines := strings.Split(string(data), "\n") - for _, s := range lines { - if !strings.HasPrefix(s, "Vm") && !strings.HasPrefix(s, "Rss") { - continue - } - // Extract key value. - line := strings.Fields(s) - if len(line) != 3 { - return nil, fmt.Errorf("unexpected number of fields found in %q; got %d; want %d", s, len(line), 3) - } - memStatName := line[0] - memStatValue := line[1] - value, err := strconv.ParseUint(memStatValue, 10, 64) - if err != nil { - return nil, fmt.Errorf("cannot parse number from %q: %w", s, err) - } - if line[2] != "kB" { - return nil, fmt.Errorf("expecting kB value in %q; got %q", s, line[2]) - } - value *= 1024 - switch memStatName { - case "VmPeak:": - ms.vmPeak = value - case "VmHWM:": - ms.rssPeak = value - case "RssAnon:": - ms.rssAnon = value - case "RssFile:": - ms.rssFile = value - case "RssShmem:": - ms.rssShmem = value - } - } - return &ms, nil -} diff --git a/vendor/github.com/VictoriaMetrics/metrics/process_metrics_other.go b/vendor/github.com/VictoriaMetrics/metrics/process_metrics_other.go index 5e6ac935dc..6874de33ea 100644 --- a/vendor/github.com/VictoriaMetrics/metrics/process_metrics_other.go +++ b/vendor/github.com/VictoriaMetrics/metrics/process_metrics_other.go @@ -9,7 +9,3 @@ import ( func writeProcessMetrics(w io.Writer) { // TODO: implement it } - -func writeFDMetrics(w io.Writer) { - // TODO: implement it. -} diff --git a/vendor/github.com/andybalholm/brotli/encode.go b/vendor/github.com/andybalholm/brotli/encode.go index c01322bf14..0dd3a3e1f4 100644 --- a/vendor/github.com/andybalholm/brotli/encode.go +++ b/vendor/github.com/andybalholm/brotli/encode.go @@ -72,8 +72,7 @@ const ( ) type Writer struct { - dst io.Writer - options WriterOptions + dst io.Writer params encoderParams hasher_ hasherHandle diff --git a/vendor/github.com/andybalholm/brotli/go.mod b/vendor/github.com/andybalholm/brotli/go.mod index 8e609842f3..cb505fa05a 100644 --- a/vendor/github.com/andybalholm/brotli/go.mod +++ b/vendor/github.com/andybalholm/brotli/go.mod @@ -1,3 +1,5 @@ module github.com/andybalholm/brotli go 1.12 + +require github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721 diff --git a/vendor/github.com/andybalholm/brotli/go.sum b/vendor/github.com/andybalholm/brotli/go.sum index e69de29bb2..2ed61f3836 100644 --- a/vendor/github.com/andybalholm/brotli/go.sum +++ b/vendor/github.com/andybalholm/brotli/go.sum @@ -0,0 +1,2 @@ +github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721 h1:KRMr9A3qfbVM7iV/WcLY/rL5LICqwMHLhwRXKu99fXw= +github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4= diff --git a/vendor/github.com/andybalholm/brotli/http.go b/vendor/github.com/andybalholm/brotli/http.go deleted file mode 100644 index af58670f2c..0000000000 --- a/vendor/github.com/andybalholm/brotli/http.go +++ /dev/null @@ -1,192 +0,0 @@ -package brotli - -import ( - "compress/gzip" - "io" - "net/http" - "strings" -) - -// HTTPCompressor chooses a compression method (brotli, gzip, or none) based on -// the Accept-Encoding header, sets the Content-Encoding header, and returns a -// WriteCloser that implements that compression. The Close method must be called -// before the current HTTP handler returns. -// -// Due to https://github.com/golang/go/issues/31753, the response will not be -// compressed unless you set a Content-Type header before you call -// HTTPCompressor. -func HTTPCompressor(w http.ResponseWriter, r *http.Request) io.WriteCloser { - if w.Header().Get("Content-Type") == "" { - return nopCloser{w} - } - - if w.Header().Get("Vary") == "" { - w.Header().Set("Vary", "Accept-Encoding") - } - - encoding := negotiateContentEncoding(r, []string{"br", "gzip"}) - switch encoding { - case "br": - w.Header().Set("Content-Encoding", "br") - return NewWriter(w) - case "gzip": - w.Header().Set("Content-Encoding", "gzip") - return gzip.NewWriter(w) - } - return nopCloser{w} -} - -// negotiateContentEncoding returns the best offered content encoding for the -// request's Accept-Encoding header. If two offers match with equal weight and -// then the offer earlier in the list is preferred. If no offers are -// acceptable, then "" is returned. -func negotiateContentEncoding(r *http.Request, offers []string) string { - bestOffer := "identity" - bestQ := -1.0 - specs := parseAccept(r.Header, "Accept-Encoding") - for _, offer := range offers { - for _, spec := range specs { - if spec.Q > bestQ && - (spec.Value == "*" || spec.Value == offer) { - bestQ = spec.Q - bestOffer = offer - } - } - } - if bestQ == 0 { - bestOffer = "" - } - return bestOffer -} - -// acceptSpec describes an Accept* header. -type acceptSpec struct { - Value string - Q float64 -} - -// parseAccept parses Accept* headers. -func parseAccept(header http.Header, key string) (specs []acceptSpec) { -loop: - for _, s := range header[key] { - for { - var spec acceptSpec - spec.Value, s = expectTokenSlash(s) - if spec.Value == "" { - continue loop - } - spec.Q = 1.0 - s = skipSpace(s) - if strings.HasPrefix(s, ";") { - s = skipSpace(s[1:]) - if !strings.HasPrefix(s, "q=") { - continue loop - } - spec.Q, s = expectQuality(s[2:]) - if spec.Q < 0.0 { - continue loop - } - } - specs = append(specs, spec) - s = skipSpace(s) - if !strings.HasPrefix(s, ",") { - continue loop - } - s = skipSpace(s[1:]) - } - } - return -} - -func skipSpace(s string) (rest string) { - i := 0 - for ; i < len(s); i++ { - if octetTypes[s[i]]&isSpace == 0 { - break - } - } - return s[i:] -} - -func expectTokenSlash(s string) (token, rest string) { - i := 0 - for ; i < len(s); i++ { - b := s[i] - if (octetTypes[b]&isToken == 0) && b != '/' { - break - } - } - return s[:i], s[i:] -} - -func expectQuality(s string) (q float64, rest string) { - switch { - case len(s) == 0: - return -1, "" - case s[0] == '0': - q = 0 - case s[0] == '1': - q = 1 - default: - return -1, "" - } - s = s[1:] - if !strings.HasPrefix(s, ".") { - return q, s - } - s = s[1:] - i := 0 - n := 0 - d := 1 - for ; i < len(s); i++ { - b := s[i] - if b < '0' || b > '9' { - break - } - n = n*10 + int(b) - '0' - d *= 10 - } - return q + float64(n)/float64(d), s[i:] -} - -// Octet types from RFC 2616. -var octetTypes [256]octetType - -type octetType byte - -const ( - isToken octetType = 1 << iota - isSpace -) - -func init() { - // OCTET = - // CHAR = - // CTL = - // CR = - // LF = - // SP = - // HT = - // <"> = - // CRLF = CR LF - // LWS = [CRLF] 1*( SP | HT ) - // TEXT = - // separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> - // | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT - // token = 1* - // qdtext = > - - for c := 0; c < 256; c++ { - var t octetType - isCtl := c <= 31 || c == 127 - isChar := 0 <= c && c <= 127 - isSeparator := strings.IndexRune(" \t\"(),/:;<=>?@[]\\{}", rune(c)) >= 0 - if strings.IndexRune(" \t\r\n", rune(c)) >= 0 { - t |= isSpace - } - if isChar && !isCtl && !isSeparator { - t |= isToken - } - octetTypes[c] = t - } -} diff --git a/vendor/github.com/andybalholm/brotli/writer.go b/vendor/github.com/andybalholm/brotli/writer.go index ec333f9cff..92c128c4d6 100644 --- a/vendor/github.com/andybalholm/brotli/writer.go +++ b/vendor/github.com/andybalholm/brotli/writer.go @@ -1,8 +1,12 @@ package brotli import ( + "compress/gzip" "errors" "io" + "net/http" + + "github.com/golang/gddo/httputil" ) const ( @@ -46,8 +50,11 @@ func NewWriterLevel(dst io.Writer, level int) *Writer { // NewWriterOptions is like NewWriter but specifies WriterOptions func NewWriterOptions(dst io.Writer, options WriterOptions) *Writer { w := new(Writer) - w.options = options w.Reset(dst) + w.params.quality = options.Quality + if options.LGWin > 0 { + w.params.lgwin = uint(options.LGWin) + } return w } @@ -56,10 +63,6 @@ func NewWriterOptions(dst io.Writer, options WriterOptions) *Writer { // instead. This permits reusing a Writer rather than allocating a new one. func (w *Writer) Reset(dst io.Writer) { encoderInitState(w) - w.params.quality = w.options.Quality - if w.options.LGWin > 0 { - w.params.lgwin = uint(w.options.LGWin) - } w.dst = dst } @@ -121,3 +124,32 @@ type nopCloser struct { } func (nopCloser) Close() error { return nil } + +// HTTPCompressor chooses a compression method (brotli, gzip, or none) based on +// the Accept-Encoding header, sets the Content-Encoding header, and returns a +// WriteCloser that implements that compression. The Close method must be called +// before the current HTTP handler returns. +// +// Due to https://github.com/golang/go/issues/31753, the response will not be +// compressed unless you set a Content-Type header before you call +// HTTPCompressor. +func HTTPCompressor(w http.ResponseWriter, r *http.Request) io.WriteCloser { + if w.Header().Get("Content-Type") == "" { + return nopCloser{w} + } + + if w.Header().Get("Vary") == "" { + w.Header().Set("Vary", "Accept-Encoding") + } + + encoding := httputil.NegotiateContentEncoding(r, []string{"br", "gzip"}) + switch encoding { + case "br": + w.Header().Set("Content-Encoding", "br") + return NewWriter(w) + case "gzip": + w.Header().Set("Content-Encoding", "gzip") + return gzip.NewWriter(w) + } + return nopCloser{w} +} diff --git a/vendor/github.com/go-ole/go-ole/com.go b/vendor/github.com/go-ole/go-ole/com.go index a9bef150a3..6f986b1894 100644 --- a/vendor/github.com/go-ole/go-ole/com.go +++ b/vendor/github.com/go-ole/go-ole/com.go @@ -9,32 +9,32 @@ import ( ) var ( - procCoInitialize = modole32.NewProc("CoInitialize") - procCoInitializeEx = modole32.NewProc("CoInitializeEx") - procCoUninitialize = modole32.NewProc("CoUninitialize") - procCoCreateInstance = modole32.NewProc("CoCreateInstance") - procCoTaskMemFree = modole32.NewProc("CoTaskMemFree") - procCLSIDFromProgID = modole32.NewProc("CLSIDFromProgID") - procCLSIDFromString = modole32.NewProc("CLSIDFromString") - procStringFromCLSID = modole32.NewProc("StringFromCLSID") - procStringFromIID = modole32.NewProc("StringFromIID") - procIIDFromString = modole32.NewProc("IIDFromString") - procCoGetObject = modole32.NewProc("CoGetObject") - procGetUserDefaultLCID = modkernel32.NewProc("GetUserDefaultLCID") - procCopyMemory = modkernel32.NewProc("RtlMoveMemory") - procVariantInit = modoleaut32.NewProc("VariantInit") - procVariantClear = modoleaut32.NewProc("VariantClear") - procVariantTimeToSystemTime = modoleaut32.NewProc("VariantTimeToSystemTime") - procSysAllocString = modoleaut32.NewProc("SysAllocString") - procSysAllocStringLen = modoleaut32.NewProc("SysAllocStringLen") - procSysFreeString = modoleaut32.NewProc("SysFreeString") - procSysStringLen = modoleaut32.NewProc("SysStringLen") - procCreateDispTypeInfo = modoleaut32.NewProc("CreateDispTypeInfo") - procCreateStdDispatch = modoleaut32.NewProc("CreateStdDispatch") - procGetActiveObject = modoleaut32.NewProc("GetActiveObject") - - procGetMessageW = moduser32.NewProc("GetMessageW") - procDispatchMessageW = moduser32.NewProc("DispatchMessageW") + procCoInitialize, _ = modole32.FindProc("CoInitialize") + procCoInitializeEx, _ = modole32.FindProc("CoInitializeEx") + procCoUninitialize, _ = modole32.FindProc("CoUninitialize") + procCoCreateInstance, _ = modole32.FindProc("CoCreateInstance") + procCoTaskMemFree, _ = modole32.FindProc("CoTaskMemFree") + procCLSIDFromProgID, _ = modole32.FindProc("CLSIDFromProgID") + procCLSIDFromString, _ = modole32.FindProc("CLSIDFromString") + procStringFromCLSID, _ = modole32.FindProc("StringFromCLSID") + procStringFromIID, _ = modole32.FindProc("StringFromIID") + procIIDFromString, _ = modole32.FindProc("IIDFromString") + procCoGetObject, _ = modole32.FindProc("CoGetObject") + procGetUserDefaultLCID, _ = modkernel32.FindProc("GetUserDefaultLCID") + procCopyMemory, _ = modkernel32.FindProc("RtlMoveMemory") + procVariantInit, _ = modoleaut32.FindProc("VariantInit") + procVariantClear, _ = modoleaut32.FindProc("VariantClear") + procVariantTimeToSystemTime, _ = modoleaut32.FindProc("VariantTimeToSystemTime") + procSysAllocString, _ = modoleaut32.FindProc("SysAllocString") + procSysAllocStringLen, _ = modoleaut32.FindProc("SysAllocStringLen") + procSysFreeString, _ = modoleaut32.FindProc("SysFreeString") + procSysStringLen, _ = modoleaut32.FindProc("SysStringLen") + procCreateDispTypeInfo, _ = modoleaut32.FindProc("CreateDispTypeInfo") + procCreateStdDispatch, _ = modoleaut32.FindProc("CreateStdDispatch") + procGetActiveObject, _ = modoleaut32.FindProc("GetActiveObject") + + procGetMessageW, _ = moduser32.FindProc("GetMessageW") + procDispatchMessageW, _ = moduser32.FindProc("DispatchMessageW") ) // coInitialize initializes COM library on current thread. diff --git a/vendor/github.com/go-ole/go-ole/go.mod b/vendor/github.com/go-ole/go-ole/go.mod index 3a21f7504d..df98533ea9 100644 --- a/vendor/github.com/go-ole/go-ole/go.mod +++ b/vendor/github.com/go-ole/go-ole/go.mod @@ -1,5 +1,3 @@ module github.com/go-ole/go-ole go 1.12 - -require golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 diff --git a/vendor/github.com/go-ole/go-ole/go.sum b/vendor/github.com/go-ole/go-ole/go.sum deleted file mode 100644 index 9814d3163b..0000000000 --- a/vendor/github.com/go-ole/go-ole/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/go-ole/go-ole/safearray_windows.go b/vendor/github.com/go-ole/go-ole/safearray_windows.go index 0c1b3a10ff..b48a2394d1 100644 --- a/vendor/github.com/go-ole/go-ole/safearray_windows.go +++ b/vendor/github.com/go-ole/go-ole/safearray_windows.go @@ -7,35 +7,35 @@ import ( ) var ( - procSafeArrayAccessData = modoleaut32.NewProc("SafeArrayAccessData") - procSafeArrayAllocData = modoleaut32.NewProc("SafeArrayAllocData") - procSafeArrayAllocDescriptor = modoleaut32.NewProc("SafeArrayAllocDescriptor") - procSafeArrayAllocDescriptorEx = modoleaut32.NewProc("SafeArrayAllocDescriptorEx") - procSafeArrayCopy = modoleaut32.NewProc("SafeArrayCopy") - procSafeArrayCopyData = modoleaut32.NewProc("SafeArrayCopyData") - procSafeArrayCreate = modoleaut32.NewProc("SafeArrayCreate") - procSafeArrayCreateEx = modoleaut32.NewProc("SafeArrayCreateEx") - procSafeArrayCreateVector = modoleaut32.NewProc("SafeArrayCreateVector") - procSafeArrayCreateVectorEx = modoleaut32.NewProc("SafeArrayCreateVectorEx") - procSafeArrayDestroy = modoleaut32.NewProc("SafeArrayDestroy") - procSafeArrayDestroyData = modoleaut32.NewProc("SafeArrayDestroyData") - procSafeArrayDestroyDescriptor = modoleaut32.NewProc("SafeArrayDestroyDescriptor") - procSafeArrayGetDim = modoleaut32.NewProc("SafeArrayGetDim") - procSafeArrayGetElement = modoleaut32.NewProc("SafeArrayGetElement") - procSafeArrayGetElemsize = modoleaut32.NewProc("SafeArrayGetElemsize") - procSafeArrayGetIID = modoleaut32.NewProc("SafeArrayGetIID") - procSafeArrayGetLBound = modoleaut32.NewProc("SafeArrayGetLBound") - procSafeArrayGetUBound = modoleaut32.NewProc("SafeArrayGetUBound") - procSafeArrayGetVartype = modoleaut32.NewProc("SafeArrayGetVartype") - procSafeArrayLock = modoleaut32.NewProc("SafeArrayLock") - procSafeArrayPtrOfIndex = modoleaut32.NewProc("SafeArrayPtrOfIndex") - procSafeArrayUnaccessData = modoleaut32.NewProc("SafeArrayUnaccessData") - procSafeArrayUnlock = modoleaut32.NewProc("SafeArrayUnlock") - procSafeArrayPutElement = modoleaut32.NewProc("SafeArrayPutElement") - //procSafeArrayRedim = modoleaut32.NewProc("SafeArrayRedim") // TODO - //procSafeArraySetIID = modoleaut32.NewProc("SafeArraySetIID") // TODO - procSafeArrayGetRecordInfo = modoleaut32.NewProc("SafeArrayGetRecordInfo") - procSafeArraySetRecordInfo = modoleaut32.NewProc("SafeArraySetRecordInfo") + procSafeArrayAccessData, _ = modoleaut32.FindProc("SafeArrayAccessData") + procSafeArrayAllocData, _ = modoleaut32.FindProc("SafeArrayAllocData") + procSafeArrayAllocDescriptor, _ = modoleaut32.FindProc("SafeArrayAllocDescriptor") + procSafeArrayAllocDescriptorEx, _ = modoleaut32.FindProc("SafeArrayAllocDescriptorEx") + procSafeArrayCopy, _ = modoleaut32.FindProc("SafeArrayCopy") + procSafeArrayCopyData, _ = modoleaut32.FindProc("SafeArrayCopyData") + procSafeArrayCreate, _ = modoleaut32.FindProc("SafeArrayCreate") + procSafeArrayCreateEx, _ = modoleaut32.FindProc("SafeArrayCreateEx") + procSafeArrayCreateVector, _ = modoleaut32.FindProc("SafeArrayCreateVector") + procSafeArrayCreateVectorEx, _ = modoleaut32.FindProc("SafeArrayCreateVectorEx") + procSafeArrayDestroy, _ = modoleaut32.FindProc("SafeArrayDestroy") + procSafeArrayDestroyData, _ = modoleaut32.FindProc("SafeArrayDestroyData") + procSafeArrayDestroyDescriptor, _ = modoleaut32.FindProc("SafeArrayDestroyDescriptor") + procSafeArrayGetDim, _ = modoleaut32.FindProc("SafeArrayGetDim") + procSafeArrayGetElement, _ = modoleaut32.FindProc("SafeArrayGetElement") + procSafeArrayGetElemsize, _ = modoleaut32.FindProc("SafeArrayGetElemsize") + procSafeArrayGetIID, _ = modoleaut32.FindProc("SafeArrayGetIID") + procSafeArrayGetLBound, _ = modoleaut32.FindProc("SafeArrayGetLBound") + procSafeArrayGetUBound, _ = modoleaut32.FindProc("SafeArrayGetUBound") + procSafeArrayGetVartype, _ = modoleaut32.FindProc("SafeArrayGetVartype") + procSafeArrayLock, _ = modoleaut32.FindProc("SafeArrayLock") + procSafeArrayPtrOfIndex, _ = modoleaut32.FindProc("SafeArrayPtrOfIndex") + procSafeArrayUnaccessData, _ = modoleaut32.FindProc("SafeArrayUnaccessData") + procSafeArrayUnlock, _ = modoleaut32.FindProc("SafeArrayUnlock") + procSafeArrayPutElement, _ = modoleaut32.FindProc("SafeArrayPutElement") + //procSafeArrayRedim, _ = modoleaut32.FindProc("SafeArrayRedim") // TODO + //procSafeArraySetIID, _ = modoleaut32.FindProc("SafeArraySetIID") // TODO + procSafeArrayGetRecordInfo, _ = modoleaut32.FindProc("SafeArrayGetRecordInfo") + procSafeArraySetRecordInfo, _ = modoleaut32.FindProc("SafeArraySetRecordInfo") ) // safeArrayAccessData returns raw array pointer. diff --git a/vendor/github.com/go-ole/go-ole/variables.go b/vendor/github.com/go-ole/go-ole/variables.go index a6add1b006..ebe00f1cfc 100644 --- a/vendor/github.com/go-ole/go-ole/variables.go +++ b/vendor/github.com/go-ole/go-ole/variables.go @@ -3,13 +3,14 @@ package ole import ( - "golang.org/x/sys/windows" + "syscall" ) var ( - modcombase = windows.NewLazySystemDLL("combase.dll") - modkernel32 = windows.NewLazySystemDLL("kernel32.dll") - modole32 = windows.NewLazySystemDLL("ole32.dll") - modoleaut32 = windows.NewLazySystemDLL("oleaut32.dll") - moduser32 = windows.NewLazySystemDLL("user32.dll") + modcombase = syscall.NewLazyDLL("combase.dll") + modkernel32, _ = syscall.LoadDLL("kernel32.dll") + modole32, _ = syscall.LoadDLL("ole32.dll") + modoleaut32, _ = syscall.LoadDLL("oleaut32.dll") + modmsvcrt, _ = syscall.LoadDLL("msvcrt.dll") + moduser32, _ = syscall.LoadDLL("user32.dll") ) diff --git a/vendor/github.com/golang/gddo/LICENSE b/vendor/github.com/golang/gddo/LICENSE new file mode 100644 index 0000000000..65d761bc9f --- /dev/null +++ b/vendor/github.com/golang/gddo/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2013 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/golang/gddo/httputil/buster.go b/vendor/github.com/golang/gddo/httputil/buster.go new file mode 100644 index 0000000000..beab151a4b --- /dev/null +++ b/vendor/github.com/golang/gddo/httputil/buster.go @@ -0,0 +1,95 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd. + +package httputil + +import ( + "io" + "io/ioutil" + "net/http" + "net/url" + "strings" + "sync" +) + +type busterWriter struct { + headerMap http.Header + status int + io.Writer +} + +func (bw *busterWriter) Header() http.Header { + return bw.headerMap +} + +func (bw *busterWriter) WriteHeader(status int) { + bw.status = status +} + +// CacheBusters maintains a cache of cache busting tokens for static resources served by Handler. +type CacheBusters struct { + Handler http.Handler + + mu sync.Mutex + tokens map[string]string +} + +func sanitizeTokenRune(r rune) rune { + if r <= ' ' || r >= 127 { + return -1 + } + // Convert percent encoding reserved characters to '-'. + if strings.ContainsRune("!#$&'()*+,/:;=?@[]", r) { + return '-' + } + return r +} + +// Get returns the cache busting token for path. If the token is not already +// cached, Get issues a HEAD request on handler and uses the response ETag and +// Last-Modified headers to compute a token. +func (cb *CacheBusters) Get(path string) string { + cb.mu.Lock() + if cb.tokens == nil { + cb.tokens = make(map[string]string) + } + token, ok := cb.tokens[path] + cb.mu.Unlock() + if ok { + return token + } + + w := busterWriter{ + Writer: ioutil.Discard, + headerMap: make(http.Header), + } + r := &http.Request{URL: &url.URL{Path: path}, Method: "HEAD"} + cb.Handler.ServeHTTP(&w, r) + + if w.status == 200 { + token = w.headerMap.Get("Etag") + if token == "" { + token = w.headerMap.Get("Last-Modified") + } + token = strings.Trim(token, `" `) + token = strings.Map(sanitizeTokenRune, token) + } + + cb.mu.Lock() + cb.tokens[path] = token + cb.mu.Unlock() + + return token +} + +// AppendQueryParam appends the token as a query parameter to path. +func (cb *CacheBusters) AppendQueryParam(path string, name string) string { + token := cb.Get(path) + if token == "" { + return path + } + return path + "?" + name + "=" + token +} diff --git a/vendor/github.com/golang/gddo/httputil/header/header.go b/vendor/github.com/golang/gddo/httputil/header/header.go new file mode 100644 index 0000000000..0f1572e3f9 --- /dev/null +++ b/vendor/github.com/golang/gddo/httputil/header/header.go @@ -0,0 +1,298 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd. + +// Package header provides functions for parsing HTTP headers. +package header + +import ( + "net/http" + "strings" + "time" +) + +// Octet types from RFC 2616. +var octetTypes [256]octetType + +type octetType byte + +const ( + isToken octetType = 1 << iota + isSpace +) + +func init() { + // OCTET = + // CHAR = + // CTL = + // CR = + // LF = + // SP = + // HT = + // <"> = + // CRLF = CR LF + // LWS = [CRLF] 1*( SP | HT ) + // TEXT = + // separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> + // | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT + // token = 1* + // qdtext = > + + for c := 0; c < 256; c++ { + var t octetType + isCtl := c <= 31 || c == 127 + isChar := 0 <= c && c <= 127 + isSeparator := strings.IndexRune(" \t\"(),/:;<=>?@[]\\{}", rune(c)) >= 0 + if strings.IndexRune(" \t\r\n", rune(c)) >= 0 { + t |= isSpace + } + if isChar && !isCtl && !isSeparator { + t |= isToken + } + octetTypes[c] = t + } +} + +// Copy returns a shallow copy of the header. +func Copy(header http.Header) http.Header { + h := make(http.Header) + for k, vs := range header { + h[k] = vs + } + return h +} + +var timeLayouts = []string{"Mon, 02 Jan 2006 15:04:05 GMT", time.RFC850, time.ANSIC} + +// ParseTime parses the header as time. The zero value is returned if the +// header is not present or there is an error parsing the +// header. +func ParseTime(header http.Header, key string) time.Time { + if s := header.Get(key); s != "" { + for _, layout := range timeLayouts { + if t, err := time.Parse(layout, s); err == nil { + return t.UTC() + } + } + } + return time.Time{} +} + +// ParseList parses a comma separated list of values. Commas are ignored in +// quoted strings. Quoted values are not unescaped or unquoted. Whitespace is +// trimmed. +func ParseList(header http.Header, key string) []string { + var result []string + for _, s := range header[http.CanonicalHeaderKey(key)] { + begin := 0 + end := 0 + escape := false + quote := false + for i := 0; i < len(s); i++ { + b := s[i] + switch { + case escape: + escape = false + end = i + 1 + case quote: + switch b { + case '\\': + escape = true + case '"': + quote = false + } + end = i + 1 + case b == '"': + quote = true + end = i + 1 + case octetTypes[b]&isSpace != 0: + if begin == end { + begin = i + 1 + end = begin + } + case b == ',': + if begin < end { + result = append(result, s[begin:end]) + } + begin = i + 1 + end = begin + default: + end = i + 1 + } + } + if begin < end { + result = append(result, s[begin:end]) + } + } + return result +} + +// ParseValueAndParams parses a comma separated list of values with optional +// semicolon separated name-value pairs. Content-Type and Content-Disposition +// headers are in this format. +func ParseValueAndParams(header http.Header, key string) (value string, params map[string]string) { + params = make(map[string]string) + s := header.Get(key) + value, s = expectTokenSlash(s) + if value == "" { + return + } + value = strings.ToLower(value) + s = skipSpace(s) + for strings.HasPrefix(s, ";") { + var pkey string + pkey, s = expectToken(skipSpace(s[1:])) + if pkey == "" { + return + } + if !strings.HasPrefix(s, "=") { + return + } + var pvalue string + pvalue, s = expectTokenOrQuoted(s[1:]) + if pvalue == "" { + return + } + pkey = strings.ToLower(pkey) + params[pkey] = pvalue + s = skipSpace(s) + } + return +} + +// AcceptSpec describes an Accept* header. +type AcceptSpec struct { + Value string + Q float64 +} + +// ParseAccept parses Accept* headers. +func ParseAccept(header http.Header, key string) (specs []AcceptSpec) { +loop: + for _, s := range header[key] { + for { + var spec AcceptSpec + spec.Value, s = expectTokenSlash(s) + if spec.Value == "" { + continue loop + } + spec.Q = 1.0 + s = skipSpace(s) + if strings.HasPrefix(s, ";") { + s = skipSpace(s[1:]) + if !strings.HasPrefix(s, "q=") { + continue loop + } + spec.Q, s = expectQuality(s[2:]) + if spec.Q < 0.0 { + continue loop + } + } + specs = append(specs, spec) + s = skipSpace(s) + if !strings.HasPrefix(s, ",") { + continue loop + } + s = skipSpace(s[1:]) + } + } + return +} + +func skipSpace(s string) (rest string) { + i := 0 + for ; i < len(s); i++ { + if octetTypes[s[i]]&isSpace == 0 { + break + } + } + return s[i:] +} + +func expectToken(s string) (token, rest string) { + i := 0 + for ; i < len(s); i++ { + if octetTypes[s[i]]&isToken == 0 { + break + } + } + return s[:i], s[i:] +} + +func expectTokenSlash(s string) (token, rest string) { + i := 0 + for ; i < len(s); i++ { + b := s[i] + if (octetTypes[b]&isToken == 0) && b != '/' { + break + } + } + return s[:i], s[i:] +} + +func expectQuality(s string) (q float64, rest string) { + switch { + case len(s) == 0: + return -1, "" + case s[0] == '0': + q = 0 + case s[0] == '1': + q = 1 + default: + return -1, "" + } + s = s[1:] + if !strings.HasPrefix(s, ".") { + return q, s + } + s = s[1:] + i := 0 + n := 0 + d := 1 + for ; i < len(s); i++ { + b := s[i] + if b < '0' || b > '9' { + break + } + n = n*10 + int(b) - '0' + d *= 10 + } + return q + float64(n)/float64(d), s[i:] +} + +func expectTokenOrQuoted(s string) (value string, rest string) { + if !strings.HasPrefix(s, "\"") { + return expectToken(s) + } + s = s[1:] + for i := 0; i < len(s); i++ { + switch s[i] { + case '"': + return s[:i], s[i+1:] + case '\\': + p := make([]byte, len(s)-1) + j := copy(p, s[:i]) + escape := true + for i = i + 1; i < len(s); i++ { + b := s[i] + switch { + case escape: + escape = false + p[j] = b + j++ + case b == '\\': + escape = true + case b == '"': + return string(p[:j]), s[i+1:] + default: + p[j] = b + j++ + } + } + return "", "" + } + } + return "", "" +} diff --git a/vendor/github.com/golang/gddo/httputil/httputil.go b/vendor/github.com/golang/gddo/httputil/httputil.go new file mode 100644 index 0000000000..a03717c073 --- /dev/null +++ b/vendor/github.com/golang/gddo/httputil/httputil.go @@ -0,0 +1,25 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd. + +// Package httputil is a toolkit for the Go net/http package. +package httputil + +import ( + "net" + "net/http" +) + +// StripPort removes the port specification from an address. +func StripPort(s string) string { + if h, _, err := net.SplitHostPort(s); err == nil { + s = h + } + return s +} + +// Error defines a type for a function that accepts a ResponseWriter for +// a Request with the HTTP status code and error. +type Error func(w http.ResponseWriter, r *http.Request, status int, err error) diff --git a/vendor/github.com/golang/gddo/httputil/negotiate.go b/vendor/github.com/golang/gddo/httputil/negotiate.go new file mode 100644 index 0000000000..6af3e4ca61 --- /dev/null +++ b/vendor/github.com/golang/gddo/httputil/negotiate.go @@ -0,0 +1,79 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd. + +package httputil + +import ( + "github.com/golang/gddo/httputil/header" + "net/http" + "strings" +) + +// NegotiateContentEncoding returns the best offered content encoding for the +// request's Accept-Encoding header. If two offers match with equal weight and +// then the offer earlier in the list is preferred. If no offers are +// acceptable, then "" is returned. +func NegotiateContentEncoding(r *http.Request, offers []string) string { + bestOffer := "identity" + bestQ := -1.0 + specs := header.ParseAccept(r.Header, "Accept-Encoding") + for _, offer := range offers { + for _, spec := range specs { + if spec.Q > bestQ && + (spec.Value == "*" || spec.Value == offer) { + bestQ = spec.Q + bestOffer = offer + } + } + } + if bestQ == 0 { + bestOffer = "" + } + return bestOffer +} + +// NegotiateContentType returns the best offered content type for the request's +// Accept header. If two offers match with equal weight, then the more specific +// offer is preferred. For example, text/* trumps */*. If two offers match +// with equal weight and specificity, then the offer earlier in the list is +// preferred. If no offers match, then defaultOffer is returned. +func NegotiateContentType(r *http.Request, offers []string, defaultOffer string) string { + bestOffer := defaultOffer + bestQ := -1.0 + bestWild := 3 + specs := header.ParseAccept(r.Header, "Accept") + for _, offer := range offers { + for _, spec := range specs { + switch { + case spec.Q == 0.0: + // ignore + case spec.Q < bestQ: + // better match found + case spec.Value == "*/*": + if spec.Q > bestQ || bestWild > 2 { + bestQ = spec.Q + bestWild = 2 + bestOffer = offer + } + case strings.HasSuffix(spec.Value, "/*"): + if strings.HasPrefix(offer, spec.Value[:len(spec.Value)-1]) && + (spec.Q > bestQ || bestWild > 1) { + bestQ = spec.Q + bestWild = 1 + bestOffer = offer + } + default: + if spec.Value == offer && + (spec.Q > bestQ || bestWild > 0) { + bestQ = spec.Q + bestWild = 0 + bestOffer = offer + } + } + } + } + return bestOffer +} diff --git a/vendor/github.com/golang/gddo/httputil/respbuf.go b/vendor/github.com/golang/gddo/httputil/respbuf.go new file mode 100644 index 0000000000..051af2114b --- /dev/null +++ b/vendor/github.com/golang/gddo/httputil/respbuf.go @@ -0,0 +1,58 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd. + +package httputil + +import ( + "bytes" + "net/http" + "strconv" +) + +// ResponseBuffer is the current response being composed by its owner. +// It implements http.ResponseWriter and io.WriterTo. +type ResponseBuffer struct { + buf bytes.Buffer + status int + header http.Header +} + +// Write implements the http.ResponseWriter interface. +func (rb *ResponseBuffer) Write(p []byte) (int, error) { + return rb.buf.Write(p) +} + +// WriteHeader implements the http.ResponseWriter interface. +func (rb *ResponseBuffer) WriteHeader(status int) { + rb.status = status +} + +// Header implements the http.ResponseWriter interface. +func (rb *ResponseBuffer) Header() http.Header { + if rb.header == nil { + rb.header = make(http.Header) + } + return rb.header +} + +// WriteTo implements the io.WriterTo interface. +func (rb *ResponseBuffer) WriteTo(w http.ResponseWriter) error { + for k, v := range rb.header { + w.Header()[k] = v + } + if rb.buf.Len() > 0 { + w.Header().Set("Content-Length", strconv.Itoa(rb.buf.Len())) + } + if rb.status != 0 { + w.WriteHeader(rb.status) + } + if rb.buf.Len() > 0 { + if _, err := w.Write(rb.buf.Bytes()); err != nil { + return err + } + } + return nil +} diff --git a/vendor/github.com/golang/gddo/httputil/static.go b/vendor/github.com/golang/gddo/httputil/static.go new file mode 100644 index 0000000000..6610dde0da --- /dev/null +++ b/vendor/github.com/golang/gddo/httputil/static.go @@ -0,0 +1,265 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd. + +package httputil + +import ( + "bytes" + "crypto/sha1" + "errors" + "fmt" + "github.com/golang/gddo/httputil/header" + "io" + "io/ioutil" + "mime" + "net/http" + "os" + "path" + "path/filepath" + "strconv" + "strings" + "sync" + "time" +) + +// StaticServer serves static files. +type StaticServer struct { + // Dir specifies the location of the directory containing the files to serve. + Dir string + + // MaxAge specifies the maximum age for the cache control and expiration + // headers. + MaxAge time.Duration + + // Error specifies the function used to generate error responses. If Error + // is nil, then http.Error is used to generate error responses. + Error Error + + // MIMETypes is a map from file extensions to MIME types. + MIMETypes map[string]string + + mu sync.Mutex + etags map[string]string +} + +func (ss *StaticServer) resolve(fname string) string { + if path.IsAbs(fname) { + panic("Absolute path not allowed when creating a StaticServer handler") + } + dir := ss.Dir + if dir == "" { + dir = "." + } + fname = filepath.FromSlash(fname) + return filepath.Join(dir, fname) +} + +func (ss *StaticServer) mimeType(fname string) string { + ext := path.Ext(fname) + var mimeType string + if ss.MIMETypes != nil { + mimeType = ss.MIMETypes[ext] + } + if mimeType == "" { + mimeType = mime.TypeByExtension(ext) + } + if mimeType == "" { + mimeType = "application/octet-stream" + } + return mimeType +} + +func (ss *StaticServer) openFile(fname string) (io.ReadCloser, int64, string, error) { + f, err := os.Open(fname) + if err != nil { + return nil, 0, "", err + } + fi, err := f.Stat() + if err != nil { + f.Close() + return nil, 0, "", err + } + const modeType = os.ModeDir | os.ModeSymlink | os.ModeNamedPipe | os.ModeSocket | os.ModeDevice + if fi.Mode()&modeType != 0 { + f.Close() + return nil, 0, "", errors.New("not a regular file") + } + return f, fi.Size(), ss.mimeType(fname), nil +} + +// FileHandler returns a handler that serves a single file. The file is +// specified by a slash separated path relative to the static server's Dir +// field. +func (ss *StaticServer) FileHandler(fileName string) http.Handler { + id := fileName + fileName = ss.resolve(fileName) + return &staticHandler{ + ss: ss, + id: func(_ string) string { return id }, + open: func(_ string) (io.ReadCloser, int64, string, error) { return ss.openFile(fileName) }, + } +} + +// DirectoryHandler returns a handler that serves files from a directory tree. +// The directory is specified by a slash separated path relative to the static +// server's Dir field. +func (ss *StaticServer) DirectoryHandler(prefix, dirName string) http.Handler { + if !strings.HasSuffix(prefix, "/") { + prefix += "/" + } + idBase := dirName + dirName = ss.resolve(dirName) + return &staticHandler{ + ss: ss, + id: func(p string) string { + if !strings.HasPrefix(p, prefix) { + return "." + } + return path.Join(idBase, p[len(prefix):]) + }, + open: func(p string) (io.ReadCloser, int64, string, error) { + if !strings.HasPrefix(p, prefix) { + return nil, 0, "", errors.New("request url does not match directory prefix") + } + p = p[len(prefix):] + return ss.openFile(filepath.Join(dirName, filepath.FromSlash(p))) + }, + } +} + +// FilesHandler returns a handler that serves the concatentation of the +// specified files. The files are specified by slash separated paths relative +// to the static server's Dir field. +func (ss *StaticServer) FilesHandler(fileNames ...string) http.Handler { + + // todo: cache concatenated files on disk and serve from there. + + mimeType := ss.mimeType(fileNames[0]) + var buf []byte + var openErr error + + for _, fileName := range fileNames { + p, err := ioutil.ReadFile(ss.resolve(fileName)) + if err != nil { + openErr = err + buf = nil + break + } + buf = append(buf, p...) + } + + id := strings.Join(fileNames, " ") + + return &staticHandler{ + ss: ss, + id: func(_ string) string { return id }, + open: func(p string) (io.ReadCloser, int64, string, error) { + return ioutil.NopCloser(bytes.NewReader(buf)), int64(len(buf)), mimeType, openErr + }, + } +} + +type staticHandler struct { + id func(fname string) string + open func(p string) (io.ReadCloser, int64, string, error) + ss *StaticServer +} + +func (h *staticHandler) error(w http.ResponseWriter, r *http.Request, status int, err error) { + http.Error(w, http.StatusText(status), status) +} + +func (h *staticHandler) etag(p string) (string, error) { + id := h.id(p) + + h.ss.mu.Lock() + if h.ss.etags == nil { + h.ss.etags = make(map[string]string) + } + etag := h.ss.etags[id] + h.ss.mu.Unlock() + + if etag != "" { + return etag, nil + } + + // todo: if a concurrent goroutine is calculating the hash, then wait for + // it instead of computing it again here. + + rc, _, _, err := h.open(p) + if err != nil { + return "", err + } + + defer rc.Close() + + w := sha1.New() + _, err = io.Copy(w, rc) + if err != nil { + return "", err + } + + etag = fmt.Sprintf(`"%x"`, w.Sum(nil)) + + h.ss.mu.Lock() + h.ss.etags[id] = etag + h.ss.mu.Unlock() + + return etag, nil +} + +func (h *staticHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { + p := path.Clean(r.URL.Path) + if p != r.URL.Path { + http.Redirect(w, r, p, 301) + return + } + + etag, err := h.etag(p) + if err != nil { + h.error(w, r, http.StatusNotFound, err) + return + } + + maxAge := h.ss.MaxAge + if maxAge == 0 { + maxAge = 24 * time.Hour + } + if r.FormValue("v") != "" { + maxAge = 365 * 24 * time.Hour + } + + cacheControl := fmt.Sprintf("public, max-age=%d", maxAge/time.Second) + + for _, e := range header.ParseList(r.Header, "If-None-Match") { + if e == etag { + w.Header().Set("Cache-Control", cacheControl) + w.Header().Set("Etag", etag) + w.WriteHeader(http.StatusNotModified) + return + } + } + + rc, cl, ct, err := h.open(p) + if err != nil { + h.error(w, r, http.StatusNotFound, err) + return + } + defer rc.Close() + + w.Header().Set("Cache-Control", cacheControl) + w.Header().Set("Etag", etag) + if ct != "" { + w.Header().Set("Content-Type", ct) + } + if cl != 0 { + w.Header().Set("Content-Length", strconv.FormatInt(cl, 10)) + } + w.WriteHeader(http.StatusOK) + if r.Method != "HEAD" { + io.Copy(w, rc) + } +} diff --git a/vendor/github.com/golang/gddo/httputil/transport.go b/vendor/github.com/golang/gddo/httputil/transport.go new file mode 100644 index 0000000000..fdad3b4780 --- /dev/null +++ b/vendor/github.com/golang/gddo/httputil/transport.go @@ -0,0 +1,87 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd. + +// This file implements a http.RoundTripper that authenticates +// requests issued against api.github.com endpoint. + +package httputil + +import ( + "net/http" + "net/url" +) + +// AuthTransport is an implementation of http.RoundTripper that authenticates +// with the GitHub API. +// +// When both a token and client credentials are set, the latter is preferred. +type AuthTransport struct { + UserAgent string + GithubToken string + GithubClientID string + GithubClientSecret string + Base http.RoundTripper +} + +// RoundTrip implements the http.RoundTripper interface. +func (t *AuthTransport) RoundTrip(req *http.Request) (*http.Response, error) { + var reqCopy *http.Request + if t.UserAgent != "" { + reqCopy = copyRequest(req) + reqCopy.Header.Set("User-Agent", t.UserAgent) + } + if req.URL.Host == "api.github.com" && req.URL.Scheme == "https" { + switch { + case t.GithubClientID != "" && t.GithubClientSecret != "": + if reqCopy == nil { + reqCopy = copyRequest(req) + } + if reqCopy.URL.RawQuery == "" { + reqCopy.URL.RawQuery = "client_id=" + t.GithubClientID + "&client_secret=" + t.GithubClientSecret + } else { + reqCopy.URL.RawQuery += "&client_id=" + t.GithubClientID + "&client_secret=" + t.GithubClientSecret + } + case t.GithubToken != "": + if reqCopy == nil { + reqCopy = copyRequest(req) + } + reqCopy.Header.Set("Authorization", "token "+t.GithubToken) + } + } + if reqCopy != nil { + return t.base().RoundTrip(reqCopy) + } + return t.base().RoundTrip(req) +} + +// CancelRequest cancels an in-flight request by closing its connection. +func (t *AuthTransport) CancelRequest(req *http.Request) { + type canceler interface { + CancelRequest(req *http.Request) + } + if cr, ok := t.base().(canceler); ok { + cr.CancelRequest(req) + } +} + +func (t *AuthTransport) base() http.RoundTripper { + if t.Base != nil { + return t.Base + } + return http.DefaultTransport +} + +func copyRequest(req *http.Request) *http.Request { + req2 := new(http.Request) + *req2 = *req + req2.URL = new(url.URL) + *req2.URL = *req.URL + req2.Header = make(http.Header, len(req.Header)) + for k, s := range req.Header { + req2.Header[k] = append([]string(nil), s...) + } + return req2 +} diff --git a/vendor/github.com/google/go-querystring/query/encode.go b/vendor/github.com/google/go-querystring/query/encode.go index 91198f819a..37080b19b5 100644 --- a/vendor/github.com/google/go-querystring/query/encode.go +++ b/vendor/github.com/google/go-querystring/query/encode.go @@ -51,8 +51,8 @@ type Encoder interface { // - the field is empty and its tag specifies the "omitempty" option // // The empty values are false, 0, any nil pointer or interface value, any array -// slice, map, or string of length zero, and any type (such as time.Time) that -// returns true for IsZero(). +// slice, map, or string of length zero, and any time.Time that returns true +// for IsZero(). // // The URL parameter name defaults to the struct field name but can be // specified in the struct field's tag value. The "url" key in the struct @@ -82,14 +82,7 @@ type Encoder interface { // // time.Time values default to encoding as RFC3339 timestamps. Including the // "unix" option signals that the field should be encoded as a Unix time (see -// time.Unix()). The "unixmilli" and "unixnano" options will encode the number -// of milliseconds and nanoseconds, respectively, since January 1, 1970 (see -// time.UnixNano()). Including the "layout" struct tag (separate from the -// "url" tag) will use the value of the "layout" tag as a layout passed to -// time.Format. For example: -// -// // Encode a time.Time as YYYY-MM-DD -// Field time.Time `layout:"2006-01-02"` +// time.Unix()) // // Slice and Array values default to encoding as multiple URL values of the // same name. Including the "comma" option signals that the field should be @@ -99,13 +92,7 @@ type Encoder interface { // Including the "brackets" option signals that the multiple URL values should // have "[]" appended to the value name. "numbered" will append a number to // the end of each incidence of the value name, example: -// name0=value0&name1=value1, etc. Including the "del" struct tag (separate -// from the "url" tag) will use the value of the "del" tag as the delimiter. -// For example: -// -// // Encode a slice of bools as ints ("1" for true, "0" for false), -// // separated by exclamation points "!". -// Field []bool `url:",int" del:"!"` +// name0=value0&name1=value1, etc. // // Anonymous struct fields are usually encoded as if their inner exported // fields were fields in the outer struct, subject to the standard Go @@ -164,15 +151,11 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error { continue } name, opts := parseTag(tag) - if name == "" { - if sf.Anonymous { - v := reflect.Indirect(sv) - if v.IsValid() && v.Kind() == reflect.Struct { - // save embedded struct for later processing - embedded = append(embedded, v) - continue - } + if sf.Anonymous && sv.Kind() == reflect.Struct { + // save embedded struct for later processing + embedded = append(embedded, sv) + continue } name = sf.Name @@ -187,9 +170,7 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error { } if sv.Type().Implements(encoderType) { - // if sv is a nil pointer and the custom encoder is defined on a non-pointer - // method receiver, set sv to the zero value of the underlying type - if !reflect.Indirect(sv).IsValid() && sv.Type().Elem().Implements(encoderType) { + if !reflect.Indirect(sv).IsValid() { sv = reflect.New(sv.Type().Elem()) } @@ -200,38 +181,28 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error { continue } - // recursively dereference pointers. break on nil pointers - for sv.Kind() == reflect.Ptr { - if sv.IsNil() { - break - } - sv = sv.Elem() - } - if sv.Kind() == reflect.Slice || sv.Kind() == reflect.Array { - var del string + var del byte if opts.Contains("comma") { - del = "," + del = ',' } else if opts.Contains("space") { - del = " " + del = ' ' } else if opts.Contains("semicolon") { - del = ";" + del = ';' } else if opts.Contains("brackets") { name = name + "[]" - } else { - del = sf.Tag.Get("del") } - if del != "" { + if del != 0 { s := new(bytes.Buffer) first := true for i := 0; i < sv.Len(); i++ { if first { first = false } else { - s.WriteString(del) + s.WriteByte(del) } - s.WriteString(valueString(sv.Index(i), opts, sf)) + s.WriteString(valueString(sv.Index(i), opts)) } values.Add(name, s.String()) } else { @@ -240,25 +211,30 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error { if opts.Contains("numbered") { k = fmt.Sprintf("%s%d", name, i) } - values.Add(k, valueString(sv.Index(i), opts, sf)) + values.Add(k, valueString(sv.Index(i), opts)) } } continue } + for sv.Kind() == reflect.Ptr { + if sv.IsNil() { + break + } + sv = sv.Elem() + } + if sv.Type() == timeType { - values.Add(name, valueString(sv, opts, sf)) + values.Add(name, valueString(sv, opts)) continue } if sv.Kind() == reflect.Struct { - if err := reflectValue(values, sv, name); err != nil { - return err - } + reflectValue(values, sv, name) continue } - values.Add(name, valueString(sv, opts, sf)) + values.Add(name, valueString(sv, opts)) } for _, f := range embedded { @@ -271,7 +247,7 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error { } // valueString returns the string representation of a value. -func valueString(v reflect.Value, opts tagOptions, sf reflect.StructField) string { +func valueString(v reflect.Value, opts tagOptions) string { for v.Kind() == reflect.Ptr { if v.IsNil() { return "" @@ -291,15 +267,6 @@ func valueString(v reflect.Value, opts tagOptions, sf reflect.StructField) strin if opts.Contains("unix") { return strconv.FormatInt(t.Unix(), 10) } - if opts.Contains("unixmilli") { - return strconv.FormatInt((t.UnixNano() / 1e6), 10) - } - if opts.Contains("unixnano") { - return strconv.FormatInt(t.UnixNano(), 10) - } - if layout := sf.Tag.Get("layout"); layout != "" { - return t.Format(layout) - } return t.Format(time.RFC3339) } @@ -324,12 +291,8 @@ func isEmptyValue(v reflect.Value) bool { return v.IsNil() } - type zeroable interface { - IsZero() bool - } - - if z, ok := v.Interface().(zeroable); ok { - return z.IsZero() + if v.Type() == timeType { + return v.Interface().(time.Time).IsZero() } return false diff --git a/vendor/github.com/google/uuid/README.md b/vendor/github.com/google/uuid/README.md index f765a46f91..9d92c11f16 100644 --- a/vendor/github.com/google/uuid/README.md +++ b/vendor/github.com/google/uuid/README.md @@ -16,4 +16,4 @@ change is the ability to represent an invalid UUID (vs a NIL UUID). Full `go doc` style documentation for the package can be viewed online without installing this package by using the GoDoc site here: -http://pkg.go.dev/github.com/google/uuid +http://godoc.org/github.com/google/uuid diff --git a/vendor/github.com/google/uuid/hash.go b/vendor/github.com/google/uuid/hash.go index b404f4bec2..b174616315 100644 --- a/vendor/github.com/google/uuid/hash.go +++ b/vendor/github.com/google/uuid/hash.go @@ -26,8 +26,8 @@ var ( // NewMD5 and NewSHA1. func NewHash(h hash.Hash, space UUID, data []byte, version int) UUID { h.Reset() - h.Write(space[:]) //nolint:errcheck - h.Write(data) //nolint:errcheck + h.Write(space[:]) + h.Write(data) s := h.Sum(nil) var uuid UUID copy(uuid[:], s) diff --git a/vendor/github.com/google/uuid/marshal.go b/vendor/github.com/google/uuid/marshal.go index 14bd34072b..7f9e0c6c0e 100644 --- a/vendor/github.com/google/uuid/marshal.go +++ b/vendor/github.com/google/uuid/marshal.go @@ -16,11 +16,10 @@ func (uuid UUID) MarshalText() ([]byte, error) { // UnmarshalText implements encoding.TextUnmarshaler. func (uuid *UUID) UnmarshalText(data []byte) error { id, err := ParseBytes(data) - if err != nil { - return err + if err == nil { + *uuid = id } - *uuid = id - return nil + return err } // MarshalBinary implements encoding.BinaryMarshaler. diff --git a/vendor/github.com/google/uuid/sql.go b/vendor/github.com/google/uuid/sql.go index 2e02ec06c0..f326b54db3 100644 --- a/vendor/github.com/google/uuid/sql.go +++ b/vendor/github.com/google/uuid/sql.go @@ -9,7 +9,7 @@ import ( "fmt" ) -// Scan implements sql.Scanner so UUIDs can be read from databases transparently. +// Scan implements sql.Scanner so UUIDs can be read from databases transparently // Currently, database types that map to string and []byte are supported. Please // consult database-specific driver documentation for matching types. func (uuid *UUID) Scan(src interface{}) error { diff --git a/vendor/github.com/google/uuid/uuid.go b/vendor/github.com/google/uuid/uuid.go index 60d26bb50c..524404cc52 100644 --- a/vendor/github.com/google/uuid/uuid.go +++ b/vendor/github.com/google/uuid/uuid.go @@ -35,12 +35,6 @@ const ( var rander = rand.Reader // random function -type invalidLengthError struct{ len int } - -func (err invalidLengthError) Error() string { - return fmt.Sprintf("invalid UUID length: %d", err.len) -} - // Parse decodes s into a UUID or returns an error. Both the standard UUID // forms of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded as well as the @@ -74,7 +68,7 @@ func Parse(s string) (UUID, error) { } return uuid, nil default: - return uuid, invalidLengthError{len(s)} + return uuid, fmt.Errorf("invalid UUID length: %d", len(s)) } // s is now at least 36 bytes long // it must be of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx @@ -118,7 +112,7 @@ func ParseBytes(b []byte) (UUID, error) { } return uuid, nil default: - return uuid, invalidLengthError{len(b)} + return uuid, fmt.Errorf("invalid UUID length: %d", len(b)) } // s is now at least 36 bytes long // it must be of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx diff --git a/vendor/github.com/google/uuid/version1.go b/vendor/github.com/google/uuid/version1.go index 463109629e..199a1ac654 100644 --- a/vendor/github.com/google/uuid/version1.go +++ b/vendor/github.com/google/uuid/version1.go @@ -17,6 +17,12 @@ import ( // // In most cases, New should be used. func NewUUID() (UUID, error) { + nodeMu.Lock() + if nodeID == zeroID { + setNodeInterface("") + } + nodeMu.Unlock() + var uuid UUID now, seq, err := GetTime() if err != nil { @@ -32,13 +38,7 @@ func NewUUID() (UUID, error) { binary.BigEndian.PutUint16(uuid[4:], timeMid) binary.BigEndian.PutUint16(uuid[6:], timeHi) binary.BigEndian.PutUint16(uuid[8:], seq) - - nodeMu.Lock() - if nodeID == zeroID { - setNodeInterface("") - } copy(uuid[10:], nodeID[:]) - nodeMu.Unlock() return uuid, nil } diff --git a/vendor/github.com/google/uuid/version4.go b/vendor/github.com/google/uuid/version4.go index 86160fbd07..84af91c9f5 100644 --- a/vendor/github.com/google/uuid/version4.go +++ b/vendor/github.com/google/uuid/version4.go @@ -14,14 +14,6 @@ func New() UUID { return Must(NewRandom()) } -// NewString creates a new random UUID and returns it as a string or panics. -// NewString is equivalent to the expression -// -// uuid.New().String() -func NewString() string { - return Must(NewRandom()).String() -} - // NewRandom returns a Random (Version 4) UUID. // // The strength of the UUIDs is based on the strength of the crypto/rand @@ -35,13 +27,8 @@ func NewString() string { // equivalent to the odds of creating a few tens of trillions of UUIDs in a // year and having one duplicate. func NewRandom() (UUID, error) { - return NewRandomFromReader(rander) -} - -// NewRandomFromReader returns a UUID based on bytes read from a given io.Reader. -func NewRandomFromReader(r io.Reader) (UUID, error) { var uuid UUID - _, err := io.ReadFull(r, uuid[:]) + _, err := io.ReadFull(rander, uuid[:]) if err != nil { return Nil, err } diff --git a/vendor/github.com/klauspost/compress/flate/deflate.go b/vendor/github.com/klauspost/compress/flate/deflate.go index 25dbe3e15f..d9948ab409 100644 --- a/vendor/github.com/klauspost/compress/flate/deflate.go +++ b/vendor/github.com/klauspost/compress/flate/deflate.go @@ -48,8 +48,6 @@ const ( maxHashOffset = 1 << 24 skipNever = math.MaxInt32 - - debugDeflate = false ) type compressionLevel struct { @@ -61,13 +59,15 @@ type compressionLevel struct { // See https://blog.klauspost.com/rebalancing-deflate-compression-levels/ var levels = []compressionLevel{ {}, // 0 - // Level 1-6 uses specialized algorithm - values not used + // Level 1-4 uses specialized algorithm - values not used {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 2}, {0, 0, 0, 0, 0, 3}, {0, 0, 0, 0, 0, 4}, - {0, 0, 0, 0, 0, 5}, - {0, 0, 0, 0, 0, 6}, + // For levels 5-6 we don't bother trying with lazy matches. + // Lazy matching is at least 30% slower, with 1.5% increase. + {6, 0, 12, 8, 12, 5}, + {8, 0, 24, 16, 16, 6}, // Levels 7-9 use increasingly more lazy matching // and increasingly stringent conditions for "good enough". {8, 8, 24, 16, skipNever, 7}, @@ -80,7 +80,9 @@ type advancedState struct { // deflate state length int offset int + hash uint32 maxInsertIndex int + ii uint16 // position of last match, intended to overflow to reset. // Input hash chains // hashHead[hashValue] contains the largest inputIndex with the specified hash value @@ -95,9 +97,6 @@ type advancedState struct { // input window: unprocessed data is window[index:windowEnd] index int hashMatch [maxMatchLength + minMatchLength]uint32 - - hash uint32 - ii uint16 // position of last match, intended to overflow to reset. } type compressor struct { @@ -108,19 +107,18 @@ type compressor struct { // compression algorithm fill func(*compressor, []byte) int // copy data to window step func(*compressor) // process window + sync bool // requesting flush - window []byte - windowEnd int - blockStart int // window index where current tokens start - err error + window []byte + windowEnd int + blockStart int // window index where current tokens start + byteAvailable bool // if true, still need to process window[index-1]. + err error // queued output tokens tokens tokens fast fastEnc state *advancedState - - sync bool // requesting flush - byteAvailable bool // if true, still need to process window[index-1]. } func (d *compressor) fillDeflate(b []byte) int { @@ -205,8 +203,9 @@ func (d *compressor) writeBlockSkip(tok *tokens, index int, eof bool) error { // This is much faster than doing a full encode. // Should only be used after a start/reset. func (d *compressor) fillWindow(b []byte) { - // Do not fill window if we are in store-only or huffman mode. - if d.level <= 0 { + // Do not fill window if we are in store-only mode, + // use constant or Snappy compression. + if d.level == 0 { return } if d.fast != nil { @@ -369,7 +368,7 @@ func (d *compressor) deflateLazy() { // Sanity enables additional runtime tests. // It's intended to be used during development // to supplement the currently ad-hoc unit tests. - const sanity = debugDeflate + const sanity = false if d.windowEnd-s.index < minMatchLength+maxMatchLength && !d.sync { return @@ -668,7 +667,6 @@ func (d *compressor) init(w io.Writer, level int) (err error) { default: return fmt.Errorf("flate: invalid compression level %d: want value in range [-2, 9]", level) } - d.level = level return nil } @@ -722,7 +720,6 @@ func (d *compressor) close() error { return d.w.err } d.w.flush() - d.w.reset(nil) return d.w.err } @@ -753,7 +750,8 @@ func NewWriter(w io.Writer, level int) (*Writer, error) { // can only be decompressed by a Reader initialized with the // same dictionary. func NewWriterDict(w io.Writer, level int, dict []byte) (*Writer, error) { - zw, err := NewWriter(w, level) + dw := &dictWriter{w} + zw, err := NewWriter(dw, level) if err != nil { return nil, err } @@ -762,6 +760,14 @@ func NewWriterDict(w io.Writer, level int, dict []byte) (*Writer, error) { return zw, err } +type dictWriter struct { + w io.Writer +} + +func (w *dictWriter) Write(b []byte) (n int, err error) { + return w.w.Write(b) +} + // A Writer takes data written to it and writes the compressed // form of that data to an underlying writer (see NewWriter). type Writer struct { @@ -799,12 +805,11 @@ func (w *Writer) Close() error { // the result of NewWriter or NewWriterDict called with dst // and w's level and dictionary. func (w *Writer) Reset(dst io.Writer) { - if len(w.dict) > 0 { + if dw, ok := w.d.w.writer.(*dictWriter); ok { // w was created with NewWriterDict - w.d.reset(dst) - if dst != nil { - w.d.fillWindow(w.dict) - } + dw.w = dst + w.d.reset(dw) + w.d.fillWindow(w.dict) } else { // w was created with NewWriter w.d.reset(dst) diff --git a/vendor/github.com/klauspost/compress/flate/fast_encoder.go b/vendor/github.com/klauspost/compress/flate/fast_encoder.go index 6d4c1e98bc..3d2fdcd77a 100644 --- a/vendor/github.com/klauspost/compress/flate/fast_encoder.go +++ b/vendor/github.com/klauspost/compress/flate/fast_encoder.go @@ -35,16 +35,16 @@ func newFastEnc(level int) fastEnc { } const ( - tableBits = 15 // Bits used in the table + tableBits = 16 // Bits used in the table tableSize = 1 << tableBits // Size of the table tableShift = 32 - tableBits // Right-shift to get the tableBits most significant bits of a uint32. baseMatchOffset = 1 // The smallest match offset baseMatchLength = 3 // The smallest match length per the RFC section 3.2.5 maxMatchOffset = 1 << 15 // The largest match offset - bTableBits = 17 // Bits used in the big tables + bTableBits = 18 // Bits used in the big tables bTableSize = 1 << bTableBits // Size of the table - allocHistory = maxStoreBlockSize * 10 // Size to preallocate for history. + allocHistory = maxStoreBlockSize * 20 // Size to preallocate for history. bufferReset = (1 << 31) - allocHistory - maxStoreBlockSize - 1 // Reset the buffer offset when reaching this. ) @@ -92,6 +92,7 @@ func hash(u uint32) uint32 { } type tableEntry struct { + val uint32 offset int32 } diff --git a/vendor/github.com/klauspost/compress/flate/gen_inflate.go b/vendor/github.com/klauspost/compress/flate/gen_inflate.go deleted file mode 100644 index c74a95fe7f..0000000000 --- a/vendor/github.com/klauspost/compress/flate/gen_inflate.go +++ /dev/null @@ -1,274 +0,0 @@ -// +build generate - -//go:generate go run $GOFILE && gofmt -w inflate_gen.go - -package main - -import ( - "os" - "strings" -) - -func main() { - f, err := os.Create("inflate_gen.go") - if err != nil { - panic(err) - } - defer f.Close() - types := []string{"*bytes.Buffer", "*bytes.Reader", "*bufio.Reader", "*strings.Reader"} - names := []string{"BytesBuffer", "BytesReader", "BufioReader", "StringsReader"} - imports := []string{"bytes", "bufio", "io", "strings", "math/bits"} - f.WriteString(`// Code generated by go generate gen_inflate.go. DO NOT EDIT. - -package flate - -import ( -`) - - for _, imp := range imports { - f.WriteString("\t\"" + imp + "\"\n") - } - f.WriteString(")\n\n") - - template := ` - -// Decode a single Huffman block from f. -// hl and hd are the Huffman states for the lit/length values -// and the distance values, respectively. If hd == nil, using the -// fixed distance encoding associated with fixed Huffman blocks. -func (f *decompressor) $FUNCNAME$() { - const ( - stateInit = iota // Zero value must be stateInit - stateDict - ) - fr := f.r.($TYPE$) - moreBits := func() error { - c, err := fr.ReadByte() - if err != nil { - return noEOF(err) - } - f.roffset++ - f.b |= uint32(c) << f.nb - f.nb += 8 - return nil - } - - switch f.stepState { - case stateInit: - goto readLiteral - case stateDict: - goto copyHistory - } - -readLiteral: - // Read literal and/or (length, distance) according to RFC section 3.2.3. - { - var v int - { - // Inlined v, err := f.huffSym(f.hl) - // Since a huffmanDecoder can be empty or be composed of a degenerate tree - // with single element, huffSym must error on these two edge cases. In both - // cases, the chunks slice will be 0 for the invalid sequence, leading it - // satisfy the n == 0 check below. - n := uint(f.hl.maxRead) - // Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers, - // but is smart enough to keep local variables in registers, so use nb and b, - // inline call to moreBits and reassign b,nb back to f on return. - nb, b := f.nb, f.b - for { - for nb < n { - c, err := fr.ReadByte() - if err != nil { - f.b = b - f.nb = nb - f.err = noEOF(err) - return - } - f.roffset++ - b |= uint32(c) << (nb & 31) - nb += 8 - } - chunk := f.hl.chunks[b&(huffmanNumChunks-1)] - n = uint(chunk & huffmanCountMask) - if n > huffmanChunkBits { - chunk = f.hl.links[chunk>>huffmanValueShift][(b>>huffmanChunkBits)&f.hl.linkMask] - n = uint(chunk & huffmanCountMask) - } - if n <= nb { - if n == 0 { - f.b = b - f.nb = nb - if debugDecode { - fmt.Println("huffsym: n==0") - } - f.err = CorruptInputError(f.roffset) - return - } - f.b = b >> (n & 31) - f.nb = nb - n - v = int(chunk >> huffmanValueShift) - break - } - } - } - - var n uint // number of bits extra - var length int - var err error - switch { - case v < 256: - f.dict.writeByte(byte(v)) - if f.dict.availWrite() == 0 { - f.toRead = f.dict.readFlush() - f.step = (*decompressor).$FUNCNAME$ - f.stepState = stateInit - return - } - goto readLiteral - case v == 256: - f.finishBlock() - return - // otherwise, reference to older data - case v < 265: - length = v - (257 - 3) - n = 0 - case v < 269: - length = v*2 - (265*2 - 11) - n = 1 - case v < 273: - length = v*4 - (269*4 - 19) - n = 2 - case v < 277: - length = v*8 - (273*8 - 35) - n = 3 - case v < 281: - length = v*16 - (277*16 - 67) - n = 4 - case v < 285: - length = v*32 - (281*32 - 131) - n = 5 - case v < maxNumLit: - length = 258 - n = 0 - default: - if debugDecode { - fmt.Println(v, ">= maxNumLit") - } - f.err = CorruptInputError(f.roffset) - return - } - if n > 0 { - for f.nb < n { - if err = moreBits(); err != nil { - if debugDecode { - fmt.Println("morebits n>0:", err) - } - f.err = err - return - } - } - length += int(f.b & uint32(1<>= n - f.nb -= n - } - - var dist int - if f.hd == nil { - for f.nb < 5 { - if err = moreBits(); err != nil { - if debugDecode { - fmt.Println("morebits f.nb<5:", err) - } - f.err = err - return - } - } - dist = int(bits.Reverse8(uint8(f.b & 0x1F << 3))) - f.b >>= 5 - f.nb -= 5 - } else { - if dist, err = f.huffSym(f.hd); err != nil { - if debugDecode { - fmt.Println("huffsym:", err) - } - f.err = err - return - } - } - - switch { - case dist < 4: - dist++ - case dist < maxNumDist: - nb := uint(dist-2) >> 1 - // have 1 bit in bottom of dist, need nb more. - extra := (dist & 1) << nb - for f.nb < nb { - if err = moreBits(); err != nil { - if debugDecode { - fmt.Println("morebits f.nb>= nb - f.nb -= nb - dist = 1<<(nb+1) + 1 + extra - default: - if debugDecode { - fmt.Println("dist too big:", dist, maxNumDist) - } - f.err = CorruptInputError(f.roffset) - return - } - - // No check on length; encoding can be prescient. - if dist > f.dict.histSize() { - if debugDecode { - fmt.Println("dist > f.dict.histSize():", dist, f.dict.histSize()) - } - f.err = CorruptInputError(f.roffset) - return - } - - f.copyLen, f.copyDist = length, dist - goto copyHistory - } - -copyHistory: - // Perform a backwards copy according to RFC section 3.2.3. - { - cnt := f.dict.tryWriteCopy(f.copyDist, f.copyLen) - if cnt == 0 { - cnt = f.dict.writeCopy(f.copyDist, f.copyLen) - } - f.copyLen -= cnt - - if f.dict.availWrite() == 0 || f.copyLen > 0 { - f.toRead = f.dict.readFlush() - f.step = (*decompressor).$FUNCNAME$ // We need to continue this work - f.stepState = stateDict - return - } - goto readLiteral - } -} - -` - for i, t := range types { - s := strings.Replace(template, "$FUNCNAME$", "huffman"+names[i], -1) - s = strings.Replace(s, "$TYPE$", t, -1) - f.WriteString(s) - } - f.WriteString("func (f *decompressor) huffmanBlockDecoder() func() {\n") - f.WriteString("\tswitch f.r.(type) {\n") - for i, t := range types { - f.WriteString("\t\tcase " + t + ":\n") - f.WriteString("\t\t\treturn f.huffman" + names[i] + "\n") - } - f.WriteString("\t\tdefault:\n") - f.WriteString("\t\t\treturn f.huffmanBlockGeneric") - f.WriteString("\t}\n}\n") -} diff --git a/vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go b/vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go index 53fe1d06e2..56ee6dc8ba 100644 --- a/vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go +++ b/vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go @@ -484,9 +484,6 @@ func (w *huffmanBitWriter) writeDynamicHeader(numLiterals int, numOffsets int, n } } -// writeStoredHeader will write a stored header. -// If the stored block is only used for EOF, -// it is replaced with a fixed huffman block. func (w *huffmanBitWriter) writeStoredHeader(length int, isEof bool) { if w.err != nil { return @@ -496,16 +493,6 @@ func (w *huffmanBitWriter) writeStoredHeader(length int, isEof bool) { w.writeCode(w.literalEncoding.codes[endBlockMarker]) w.lastHeader = 0 } - - // To write EOF, use a fixed encoding block. 10 bits instead of 5 bytes. - if length == 0 && isEof { - w.writeFixedHeader(isEof) - // EOB: 7 bits, value: 0 - w.writeBits(0, 7) - w.flush() - return - } - var flag int32 if isEof { flag = 1 diff --git a/vendor/github.com/klauspost/compress/flate/huffman_code.go b/vendor/github.com/klauspost/compress/flate/huffman_code.go index 4c39a30187..9d8e81ad69 100644 --- a/vendor/github.com/klauspost/compress/flate/huffman_code.go +++ b/vendor/github.com/klauspost/compress/flate/huffman_code.go @@ -109,8 +109,8 @@ func generateFixedOffsetEncoding() *huffmanEncoder { return h } -var fixedLiteralEncoding = generateFixedLiteralEncoding() -var fixedOffsetEncoding = generateFixedOffsetEncoding() +var fixedLiteralEncoding *huffmanEncoder = generateFixedLiteralEncoding() +var fixedOffsetEncoding *huffmanEncoder = generateFixedOffsetEncoding() func (h *huffmanEncoder) bitLength(freq []uint16) int { var total int diff --git a/vendor/github.com/klauspost/compress/flate/inflate.go b/vendor/github.com/klauspost/compress/flate/inflate.go index 3e4259f157..6dc5b5d06e 100644 --- a/vendor/github.com/klauspost/compress/flate/inflate.go +++ b/vendor/github.com/klauspost/compress/flate/inflate.go @@ -106,7 +106,7 @@ const ( ) type huffmanDecoder struct { - maxRead int // the maximum number of bits we can read and not overread + min int // the minimum code length chunks *[huffmanNumChunks]uint16 // chunks as described above links [][]uint16 // overflow links linkMask uint32 // mask the width of the link table @@ -126,12 +126,12 @@ func (h *huffmanDecoder) init(lengths []int) bool { if h.chunks == nil { h.chunks = &[huffmanNumChunks]uint16{} } - if h.maxRead != 0 { + if h.min != 0 { *h = huffmanDecoder{chunks: h.chunks, links: h.links} } // Count number of codes of each length, - // compute maxRead and max length. + // compute min and max length. var count [maxCodeLen]int var min, max int for _, n := range lengths { @@ -178,7 +178,7 @@ func (h *huffmanDecoder) init(lengths []int) bool { return false } - h.maxRead = min + h.min = min chunks := h.chunks[:] for i := range chunks { chunks[i] = 0 @@ -295,6 +295,10 @@ type decompressor struct { r Reader roffset int64 + // Input bits, in top of b. + b uint32 + nb uint + // Huffman decoders for literal/length, distance. h1, h2 huffmanDecoder @@ -305,24 +309,19 @@ type decompressor struct { // Output history, buffer. dict dictDecoder + // Temporary buffer (avoids repeated allocation). + buf [4]byte + // Next step in the decompression, // and decompression state. step func(*decompressor) stepState int + final bool err error toRead []byte hl, hd *huffmanDecoder copyLen int copyDist int - - // Temporary buffer (avoids repeated allocation). - buf [4]byte - - // Input bits, in top of b. - b uint32 - - nb uint - final bool } func (f *decompressor) nextBlock() { @@ -343,7 +342,7 @@ func (f *decompressor) nextBlock() { // compressed, fixed Huffman tables f.hl = &fixedHuffmanDecoder f.hd = nil - f.huffmanBlockDecoder()() + f.huffmanBlock() case 2: // compressed, dynamic Huffman tables if f.err = f.readHuffman(); f.err != nil { @@ -351,7 +350,7 @@ func (f *decompressor) nextBlock() { } f.hl = &f.h1 f.hd = &f.h2 - f.huffmanBlockDecoder()() + f.huffmanBlock() default: // 3 is reserved. if debugDecode { @@ -544,18 +543,12 @@ func (f *decompressor) readHuffman() error { return CorruptInputError(f.roffset) } - // As an optimization, we can initialize the maxRead bits to read at a time + // As an optimization, we can initialize the min bits to read at a time // for the HLIT tree to the length of the EOB marker since we know that // every block must terminate with one. This preserves the property that // we never read any extra bytes after the end of the DEFLATE stream. - if f.h1.maxRead < f.bits[endBlockMarker] { - f.h1.maxRead = f.bits[endBlockMarker] - } - if !f.final { - // If not the final block, the smallest block possible is - // a predefined table, BTYPE=01, with a single EOB marker. - // This will take up 3 + 7 bits. - f.h1.maxRead += 10 + if f.h1.min < f.bits[endBlockMarker] { + f.h1.min = f.bits[endBlockMarker] } return nil @@ -565,7 +558,7 @@ func (f *decompressor) readHuffman() error { // hl and hd are the Huffman states for the lit/length values // and the distance values, respectively. If hd == nil, using the // fixed distance encoding associated with fixed Huffman blocks. -func (f *decompressor) huffmanBlockGeneric() { +func (f *decompressor) huffmanBlock() { const ( stateInit = iota // Zero value must be stateInit stateDict @@ -581,64 +574,19 @@ func (f *decompressor) huffmanBlockGeneric() { readLiteral: // Read literal and/or (length, distance) according to RFC section 3.2.3. { - var v int - { - // Inlined v, err := f.huffSym(f.hl) - // Since a huffmanDecoder can be empty or be composed of a degenerate tree - // with single element, huffSym must error on these two edge cases. In both - // cases, the chunks slice will be 0 for the invalid sequence, leading it - // satisfy the n == 0 check below. - n := uint(f.hl.maxRead) - // Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers, - // but is smart enough to keep local variables in registers, so use nb and b, - // inline call to moreBits and reassign b,nb back to f on return. - nb, b := f.nb, f.b - for { - for nb < n { - c, err := f.r.ReadByte() - if err != nil { - f.b = b - f.nb = nb - f.err = noEOF(err) - return - } - f.roffset++ - b |= uint32(c) << (nb & 31) - nb += 8 - } - chunk := f.hl.chunks[b&(huffmanNumChunks-1)] - n = uint(chunk & huffmanCountMask) - if n > huffmanChunkBits { - chunk = f.hl.links[chunk>>huffmanValueShift][(b>>huffmanChunkBits)&f.hl.linkMask] - n = uint(chunk & huffmanCountMask) - } - if n <= nb { - if n == 0 { - f.b = b - f.nb = nb - if debugDecode { - fmt.Println("huffsym: n==0") - } - f.err = CorruptInputError(f.roffset) - return - } - f.b = b >> (n & 31) - f.nb = nb - n - v = int(chunk >> huffmanValueShift) - break - } - } + v, err := f.huffSym(f.hl) + if err != nil { + f.err = err + return } - var n uint // number of bits extra var length int - var err error switch { case v < 256: f.dict.writeByte(byte(v)) if f.dict.availWrite() == 0 { f.toRead = f.dict.readFlush() - f.step = (*decompressor).huffmanBlockGeneric + f.step = (*decompressor).huffmanBlock f.stepState = stateInit return } @@ -766,7 +714,7 @@ copyHistory: if f.dict.availWrite() == 0 || f.copyLen > 0 { f.toRead = f.dict.readFlush() - f.step = (*decompressor).huffmanBlockGeneric // We need to continue this work + f.step = (*decompressor).huffmanBlock // We need to continue this work f.stepState = stateDict return } @@ -778,33 +726,21 @@ copyHistory: func (f *decompressor) dataBlock() { // Uncompressed. // Discard current half-byte. - left := (f.nb) & 7 - f.nb -= left - f.b >>= left - - offBytes := f.nb >> 3 - // Unfilled values will be overwritten. - f.buf[0] = uint8(f.b) - f.buf[1] = uint8(f.b >> 8) - f.buf[2] = uint8(f.b >> 16) - f.buf[3] = uint8(f.b >> 24) - - f.roffset += int64(offBytes) - f.nb, f.b = 0, 0 + f.nb = 0 + f.b = 0 // Length then ones-complement of length. - nr, err := io.ReadFull(f.r, f.buf[offBytes:4]) + nr, err := io.ReadFull(f.r, f.buf[0:4]) f.roffset += int64(nr) if err != nil { f.err = noEOF(err) return } - n := uint16(f.buf[0]) | uint16(f.buf[1])<<8 - nn := uint16(f.buf[2]) | uint16(f.buf[3])<<8 - if nn != ^n { + n := int(f.buf[0]) | int(f.buf[1])<<8 + nn := int(f.buf[2]) | int(f.buf[3])<<8 + if uint16(nn) != uint16(^n) { if debugDecode { - ncomp := ^n - fmt.Println("uint16(nn) != uint16(^n)", nn, ncomp) + fmt.Println("uint16(nn) != uint16(^n)", nn, ^n) } f.err = CorruptInputError(f.roffset) return @@ -816,7 +752,7 @@ func (f *decompressor) dataBlock() { return } - f.copyLen = int(n) + f.copyLen = n f.copyData() } @@ -880,7 +816,7 @@ func (f *decompressor) huffSym(h *huffmanDecoder) (int, error) { // with single element, huffSym must error on these two edge cases. In both // cases, the chunks slice will be 0 for the invalid sequence, leading it // satisfy the n == 0 check below. - n := uint(h.maxRead) + n := uint(h.min) // Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers, // but is smart enough to keep local variables in registers, so use nb and b, // inline call to moreBits and reassign b,nb back to f on return. diff --git a/vendor/github.com/klauspost/compress/flate/inflate_gen.go b/vendor/github.com/klauspost/compress/flate/inflate_gen.go deleted file mode 100644 index 397dc1b1a1..0000000000 --- a/vendor/github.com/klauspost/compress/flate/inflate_gen.go +++ /dev/null @@ -1,922 +0,0 @@ -// Code generated by go generate gen_inflate.go. DO NOT EDIT. - -package flate - -import ( - "bufio" - "bytes" - "fmt" - "math/bits" - "strings" -) - -// Decode a single Huffman block from f. -// hl and hd are the Huffman states for the lit/length values -// and the distance values, respectively. If hd == nil, using the -// fixed distance encoding associated with fixed Huffman blocks. -func (f *decompressor) huffmanBytesBuffer() { - const ( - stateInit = iota // Zero value must be stateInit - stateDict - ) - fr := f.r.(*bytes.Buffer) - moreBits := func() error { - c, err := fr.ReadByte() - if err != nil { - return noEOF(err) - } - f.roffset++ - f.b |= uint32(c) << f.nb - f.nb += 8 - return nil - } - - switch f.stepState { - case stateInit: - goto readLiteral - case stateDict: - goto copyHistory - } - -readLiteral: - // Read literal and/or (length, distance) according to RFC section 3.2.3. - { - var v int - { - // Inlined v, err := f.huffSym(f.hl) - // Since a huffmanDecoder can be empty or be composed of a degenerate tree - // with single element, huffSym must error on these two edge cases. In both - // cases, the chunks slice will be 0 for the invalid sequence, leading it - // satisfy the n == 0 check below. - n := uint(f.hl.maxRead) - // Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers, - // but is smart enough to keep local variables in registers, so use nb and b, - // inline call to moreBits and reassign b,nb back to f on return. - nb, b := f.nb, f.b - for { - for nb < n { - c, err := fr.ReadByte() - if err != nil { - f.b = b - f.nb = nb - f.err = noEOF(err) - return - } - f.roffset++ - b |= uint32(c) << (nb & 31) - nb += 8 - } - chunk := f.hl.chunks[b&(huffmanNumChunks-1)] - n = uint(chunk & huffmanCountMask) - if n > huffmanChunkBits { - chunk = f.hl.links[chunk>>huffmanValueShift][(b>>huffmanChunkBits)&f.hl.linkMask] - n = uint(chunk & huffmanCountMask) - } - if n <= nb { - if n == 0 { - f.b = b - f.nb = nb - if debugDecode { - fmt.Println("huffsym: n==0") - } - f.err = CorruptInputError(f.roffset) - return - } - f.b = b >> (n & 31) - f.nb = nb - n - v = int(chunk >> huffmanValueShift) - break - } - } - } - - var n uint // number of bits extra - var length int - var err error - switch { - case v < 256: - f.dict.writeByte(byte(v)) - if f.dict.availWrite() == 0 { - f.toRead = f.dict.readFlush() - f.step = (*decompressor).huffmanBytesBuffer - f.stepState = stateInit - return - } - goto readLiteral - case v == 256: - f.finishBlock() - return - // otherwise, reference to older data - case v < 265: - length = v - (257 - 3) - n = 0 - case v < 269: - length = v*2 - (265*2 - 11) - n = 1 - case v < 273: - length = v*4 - (269*4 - 19) - n = 2 - case v < 277: - length = v*8 - (273*8 - 35) - n = 3 - case v < 281: - length = v*16 - (277*16 - 67) - n = 4 - case v < 285: - length = v*32 - (281*32 - 131) - n = 5 - case v < maxNumLit: - length = 258 - n = 0 - default: - if debugDecode { - fmt.Println(v, ">= maxNumLit") - } - f.err = CorruptInputError(f.roffset) - return - } - if n > 0 { - for f.nb < n { - if err = moreBits(); err != nil { - if debugDecode { - fmt.Println("morebits n>0:", err) - } - f.err = err - return - } - } - length += int(f.b & uint32(1<>= n - f.nb -= n - } - - var dist int - if f.hd == nil { - for f.nb < 5 { - if err = moreBits(); err != nil { - if debugDecode { - fmt.Println("morebits f.nb<5:", err) - } - f.err = err - return - } - } - dist = int(bits.Reverse8(uint8(f.b & 0x1F << 3))) - f.b >>= 5 - f.nb -= 5 - } else { - if dist, err = f.huffSym(f.hd); err != nil { - if debugDecode { - fmt.Println("huffsym:", err) - } - f.err = err - return - } - } - - switch { - case dist < 4: - dist++ - case dist < maxNumDist: - nb := uint(dist-2) >> 1 - // have 1 bit in bottom of dist, need nb more. - extra := (dist & 1) << nb - for f.nb < nb { - if err = moreBits(); err != nil { - if debugDecode { - fmt.Println("morebits f.nb>= nb - f.nb -= nb - dist = 1<<(nb+1) + 1 + extra - default: - if debugDecode { - fmt.Println("dist too big:", dist, maxNumDist) - } - f.err = CorruptInputError(f.roffset) - return - } - - // No check on length; encoding can be prescient. - if dist > f.dict.histSize() { - if debugDecode { - fmt.Println("dist > f.dict.histSize():", dist, f.dict.histSize()) - } - f.err = CorruptInputError(f.roffset) - return - } - - f.copyLen, f.copyDist = length, dist - goto copyHistory - } - -copyHistory: - // Perform a backwards copy according to RFC section 3.2.3. - { - cnt := f.dict.tryWriteCopy(f.copyDist, f.copyLen) - if cnt == 0 { - cnt = f.dict.writeCopy(f.copyDist, f.copyLen) - } - f.copyLen -= cnt - - if f.dict.availWrite() == 0 || f.copyLen > 0 { - f.toRead = f.dict.readFlush() - f.step = (*decompressor).huffmanBytesBuffer // We need to continue this work - f.stepState = stateDict - return - } - goto readLiteral - } -} - -// Decode a single Huffman block from f. -// hl and hd are the Huffman states for the lit/length values -// and the distance values, respectively. If hd == nil, using the -// fixed distance encoding associated with fixed Huffman blocks. -func (f *decompressor) huffmanBytesReader() { - const ( - stateInit = iota // Zero value must be stateInit - stateDict - ) - fr := f.r.(*bytes.Reader) - moreBits := func() error { - c, err := fr.ReadByte() - if err != nil { - return noEOF(err) - } - f.roffset++ - f.b |= uint32(c) << f.nb - f.nb += 8 - return nil - } - - switch f.stepState { - case stateInit: - goto readLiteral - case stateDict: - goto copyHistory - } - -readLiteral: - // Read literal and/or (length, distance) according to RFC section 3.2.3. - { - var v int - { - // Inlined v, err := f.huffSym(f.hl) - // Since a huffmanDecoder can be empty or be composed of a degenerate tree - // with single element, huffSym must error on these two edge cases. In both - // cases, the chunks slice will be 0 for the invalid sequence, leading it - // satisfy the n == 0 check below. - n := uint(f.hl.maxRead) - // Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers, - // but is smart enough to keep local variables in registers, so use nb and b, - // inline call to moreBits and reassign b,nb back to f on return. - nb, b := f.nb, f.b - for { - for nb < n { - c, err := fr.ReadByte() - if err != nil { - f.b = b - f.nb = nb - f.err = noEOF(err) - return - } - f.roffset++ - b |= uint32(c) << (nb & 31) - nb += 8 - } - chunk := f.hl.chunks[b&(huffmanNumChunks-1)] - n = uint(chunk & huffmanCountMask) - if n > huffmanChunkBits { - chunk = f.hl.links[chunk>>huffmanValueShift][(b>>huffmanChunkBits)&f.hl.linkMask] - n = uint(chunk & huffmanCountMask) - } - if n <= nb { - if n == 0 { - f.b = b - f.nb = nb - if debugDecode { - fmt.Println("huffsym: n==0") - } - f.err = CorruptInputError(f.roffset) - return - } - f.b = b >> (n & 31) - f.nb = nb - n - v = int(chunk >> huffmanValueShift) - break - } - } - } - - var n uint // number of bits extra - var length int - var err error - switch { - case v < 256: - f.dict.writeByte(byte(v)) - if f.dict.availWrite() == 0 { - f.toRead = f.dict.readFlush() - f.step = (*decompressor).huffmanBytesReader - f.stepState = stateInit - return - } - goto readLiteral - case v == 256: - f.finishBlock() - return - // otherwise, reference to older data - case v < 265: - length = v - (257 - 3) - n = 0 - case v < 269: - length = v*2 - (265*2 - 11) - n = 1 - case v < 273: - length = v*4 - (269*4 - 19) - n = 2 - case v < 277: - length = v*8 - (273*8 - 35) - n = 3 - case v < 281: - length = v*16 - (277*16 - 67) - n = 4 - case v < 285: - length = v*32 - (281*32 - 131) - n = 5 - case v < maxNumLit: - length = 258 - n = 0 - default: - if debugDecode { - fmt.Println(v, ">= maxNumLit") - } - f.err = CorruptInputError(f.roffset) - return - } - if n > 0 { - for f.nb < n { - if err = moreBits(); err != nil { - if debugDecode { - fmt.Println("morebits n>0:", err) - } - f.err = err - return - } - } - length += int(f.b & uint32(1<>= n - f.nb -= n - } - - var dist int - if f.hd == nil { - for f.nb < 5 { - if err = moreBits(); err != nil { - if debugDecode { - fmt.Println("morebits f.nb<5:", err) - } - f.err = err - return - } - } - dist = int(bits.Reverse8(uint8(f.b & 0x1F << 3))) - f.b >>= 5 - f.nb -= 5 - } else { - if dist, err = f.huffSym(f.hd); err != nil { - if debugDecode { - fmt.Println("huffsym:", err) - } - f.err = err - return - } - } - - switch { - case dist < 4: - dist++ - case dist < maxNumDist: - nb := uint(dist-2) >> 1 - // have 1 bit in bottom of dist, need nb more. - extra := (dist & 1) << nb - for f.nb < nb { - if err = moreBits(); err != nil { - if debugDecode { - fmt.Println("morebits f.nb>= nb - f.nb -= nb - dist = 1<<(nb+1) + 1 + extra - default: - if debugDecode { - fmt.Println("dist too big:", dist, maxNumDist) - } - f.err = CorruptInputError(f.roffset) - return - } - - // No check on length; encoding can be prescient. - if dist > f.dict.histSize() { - if debugDecode { - fmt.Println("dist > f.dict.histSize():", dist, f.dict.histSize()) - } - f.err = CorruptInputError(f.roffset) - return - } - - f.copyLen, f.copyDist = length, dist - goto copyHistory - } - -copyHistory: - // Perform a backwards copy according to RFC section 3.2.3. - { - cnt := f.dict.tryWriteCopy(f.copyDist, f.copyLen) - if cnt == 0 { - cnt = f.dict.writeCopy(f.copyDist, f.copyLen) - } - f.copyLen -= cnt - - if f.dict.availWrite() == 0 || f.copyLen > 0 { - f.toRead = f.dict.readFlush() - f.step = (*decompressor).huffmanBytesReader // We need to continue this work - f.stepState = stateDict - return - } - goto readLiteral - } -} - -// Decode a single Huffman block from f. -// hl and hd are the Huffman states for the lit/length values -// and the distance values, respectively. If hd == nil, using the -// fixed distance encoding associated with fixed Huffman blocks. -func (f *decompressor) huffmanBufioReader() { - const ( - stateInit = iota // Zero value must be stateInit - stateDict - ) - fr := f.r.(*bufio.Reader) - moreBits := func() error { - c, err := fr.ReadByte() - if err != nil { - return noEOF(err) - } - f.roffset++ - f.b |= uint32(c) << f.nb - f.nb += 8 - return nil - } - - switch f.stepState { - case stateInit: - goto readLiteral - case stateDict: - goto copyHistory - } - -readLiteral: - // Read literal and/or (length, distance) according to RFC section 3.2.3. - { - var v int - { - // Inlined v, err := f.huffSym(f.hl) - // Since a huffmanDecoder can be empty or be composed of a degenerate tree - // with single element, huffSym must error on these two edge cases. In both - // cases, the chunks slice will be 0 for the invalid sequence, leading it - // satisfy the n == 0 check below. - n := uint(f.hl.maxRead) - // Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers, - // but is smart enough to keep local variables in registers, so use nb and b, - // inline call to moreBits and reassign b,nb back to f on return. - nb, b := f.nb, f.b - for { - for nb < n { - c, err := fr.ReadByte() - if err != nil { - f.b = b - f.nb = nb - f.err = noEOF(err) - return - } - f.roffset++ - b |= uint32(c) << (nb & 31) - nb += 8 - } - chunk := f.hl.chunks[b&(huffmanNumChunks-1)] - n = uint(chunk & huffmanCountMask) - if n > huffmanChunkBits { - chunk = f.hl.links[chunk>>huffmanValueShift][(b>>huffmanChunkBits)&f.hl.linkMask] - n = uint(chunk & huffmanCountMask) - } - if n <= nb { - if n == 0 { - f.b = b - f.nb = nb - if debugDecode { - fmt.Println("huffsym: n==0") - } - f.err = CorruptInputError(f.roffset) - return - } - f.b = b >> (n & 31) - f.nb = nb - n - v = int(chunk >> huffmanValueShift) - break - } - } - } - - var n uint // number of bits extra - var length int - var err error - switch { - case v < 256: - f.dict.writeByte(byte(v)) - if f.dict.availWrite() == 0 { - f.toRead = f.dict.readFlush() - f.step = (*decompressor).huffmanBufioReader - f.stepState = stateInit - return - } - goto readLiteral - case v == 256: - f.finishBlock() - return - // otherwise, reference to older data - case v < 265: - length = v - (257 - 3) - n = 0 - case v < 269: - length = v*2 - (265*2 - 11) - n = 1 - case v < 273: - length = v*4 - (269*4 - 19) - n = 2 - case v < 277: - length = v*8 - (273*8 - 35) - n = 3 - case v < 281: - length = v*16 - (277*16 - 67) - n = 4 - case v < 285: - length = v*32 - (281*32 - 131) - n = 5 - case v < maxNumLit: - length = 258 - n = 0 - default: - if debugDecode { - fmt.Println(v, ">= maxNumLit") - } - f.err = CorruptInputError(f.roffset) - return - } - if n > 0 { - for f.nb < n { - if err = moreBits(); err != nil { - if debugDecode { - fmt.Println("morebits n>0:", err) - } - f.err = err - return - } - } - length += int(f.b & uint32(1<>= n - f.nb -= n - } - - var dist int - if f.hd == nil { - for f.nb < 5 { - if err = moreBits(); err != nil { - if debugDecode { - fmt.Println("morebits f.nb<5:", err) - } - f.err = err - return - } - } - dist = int(bits.Reverse8(uint8(f.b & 0x1F << 3))) - f.b >>= 5 - f.nb -= 5 - } else { - if dist, err = f.huffSym(f.hd); err != nil { - if debugDecode { - fmt.Println("huffsym:", err) - } - f.err = err - return - } - } - - switch { - case dist < 4: - dist++ - case dist < maxNumDist: - nb := uint(dist-2) >> 1 - // have 1 bit in bottom of dist, need nb more. - extra := (dist & 1) << nb - for f.nb < nb { - if err = moreBits(); err != nil { - if debugDecode { - fmt.Println("morebits f.nb>= nb - f.nb -= nb - dist = 1<<(nb+1) + 1 + extra - default: - if debugDecode { - fmt.Println("dist too big:", dist, maxNumDist) - } - f.err = CorruptInputError(f.roffset) - return - } - - // No check on length; encoding can be prescient. - if dist > f.dict.histSize() { - if debugDecode { - fmt.Println("dist > f.dict.histSize():", dist, f.dict.histSize()) - } - f.err = CorruptInputError(f.roffset) - return - } - - f.copyLen, f.copyDist = length, dist - goto copyHistory - } - -copyHistory: - // Perform a backwards copy according to RFC section 3.2.3. - { - cnt := f.dict.tryWriteCopy(f.copyDist, f.copyLen) - if cnt == 0 { - cnt = f.dict.writeCopy(f.copyDist, f.copyLen) - } - f.copyLen -= cnt - - if f.dict.availWrite() == 0 || f.copyLen > 0 { - f.toRead = f.dict.readFlush() - f.step = (*decompressor).huffmanBufioReader // We need to continue this work - f.stepState = stateDict - return - } - goto readLiteral - } -} - -// Decode a single Huffman block from f. -// hl and hd are the Huffman states for the lit/length values -// and the distance values, respectively. If hd == nil, using the -// fixed distance encoding associated with fixed Huffman blocks. -func (f *decompressor) huffmanStringsReader() { - const ( - stateInit = iota // Zero value must be stateInit - stateDict - ) - fr := f.r.(*strings.Reader) - moreBits := func() error { - c, err := fr.ReadByte() - if err != nil { - return noEOF(err) - } - f.roffset++ - f.b |= uint32(c) << f.nb - f.nb += 8 - return nil - } - - switch f.stepState { - case stateInit: - goto readLiteral - case stateDict: - goto copyHistory - } - -readLiteral: - // Read literal and/or (length, distance) according to RFC section 3.2.3. - { - var v int - { - // Inlined v, err := f.huffSym(f.hl) - // Since a huffmanDecoder can be empty or be composed of a degenerate tree - // with single element, huffSym must error on these two edge cases. In both - // cases, the chunks slice will be 0 for the invalid sequence, leading it - // satisfy the n == 0 check below. - n := uint(f.hl.maxRead) - // Optimization. Compiler isn't smart enough to keep f.b,f.nb in registers, - // but is smart enough to keep local variables in registers, so use nb and b, - // inline call to moreBits and reassign b,nb back to f on return. - nb, b := f.nb, f.b - for { - for nb < n { - c, err := fr.ReadByte() - if err != nil { - f.b = b - f.nb = nb - f.err = noEOF(err) - return - } - f.roffset++ - b |= uint32(c) << (nb & 31) - nb += 8 - } - chunk := f.hl.chunks[b&(huffmanNumChunks-1)] - n = uint(chunk & huffmanCountMask) - if n > huffmanChunkBits { - chunk = f.hl.links[chunk>>huffmanValueShift][(b>>huffmanChunkBits)&f.hl.linkMask] - n = uint(chunk & huffmanCountMask) - } - if n <= nb { - if n == 0 { - f.b = b - f.nb = nb - if debugDecode { - fmt.Println("huffsym: n==0") - } - f.err = CorruptInputError(f.roffset) - return - } - f.b = b >> (n & 31) - f.nb = nb - n - v = int(chunk >> huffmanValueShift) - break - } - } - } - - var n uint // number of bits extra - var length int - var err error - switch { - case v < 256: - f.dict.writeByte(byte(v)) - if f.dict.availWrite() == 0 { - f.toRead = f.dict.readFlush() - f.step = (*decompressor).huffmanStringsReader - f.stepState = stateInit - return - } - goto readLiteral - case v == 256: - f.finishBlock() - return - // otherwise, reference to older data - case v < 265: - length = v - (257 - 3) - n = 0 - case v < 269: - length = v*2 - (265*2 - 11) - n = 1 - case v < 273: - length = v*4 - (269*4 - 19) - n = 2 - case v < 277: - length = v*8 - (273*8 - 35) - n = 3 - case v < 281: - length = v*16 - (277*16 - 67) - n = 4 - case v < 285: - length = v*32 - (281*32 - 131) - n = 5 - case v < maxNumLit: - length = 258 - n = 0 - default: - if debugDecode { - fmt.Println(v, ">= maxNumLit") - } - f.err = CorruptInputError(f.roffset) - return - } - if n > 0 { - for f.nb < n { - if err = moreBits(); err != nil { - if debugDecode { - fmt.Println("morebits n>0:", err) - } - f.err = err - return - } - } - length += int(f.b & uint32(1<>= n - f.nb -= n - } - - var dist int - if f.hd == nil { - for f.nb < 5 { - if err = moreBits(); err != nil { - if debugDecode { - fmt.Println("morebits f.nb<5:", err) - } - f.err = err - return - } - } - dist = int(bits.Reverse8(uint8(f.b & 0x1F << 3))) - f.b >>= 5 - f.nb -= 5 - } else { - if dist, err = f.huffSym(f.hd); err != nil { - if debugDecode { - fmt.Println("huffsym:", err) - } - f.err = err - return - } - } - - switch { - case dist < 4: - dist++ - case dist < maxNumDist: - nb := uint(dist-2) >> 1 - // have 1 bit in bottom of dist, need nb more. - extra := (dist & 1) << nb - for f.nb < nb { - if err = moreBits(); err != nil { - if debugDecode { - fmt.Println("morebits f.nb>= nb - f.nb -= nb - dist = 1<<(nb+1) + 1 + extra - default: - if debugDecode { - fmt.Println("dist too big:", dist, maxNumDist) - } - f.err = CorruptInputError(f.roffset) - return - } - - // No check on length; encoding can be prescient. - if dist > f.dict.histSize() { - if debugDecode { - fmt.Println("dist > f.dict.histSize():", dist, f.dict.histSize()) - } - f.err = CorruptInputError(f.roffset) - return - } - - f.copyLen, f.copyDist = length, dist - goto copyHistory - } - -copyHistory: - // Perform a backwards copy according to RFC section 3.2.3. - { - cnt := f.dict.tryWriteCopy(f.copyDist, f.copyLen) - if cnt == 0 { - cnt = f.dict.writeCopy(f.copyDist, f.copyLen) - } - f.copyLen -= cnt - - if f.dict.availWrite() == 0 || f.copyLen > 0 { - f.toRead = f.dict.readFlush() - f.step = (*decompressor).huffmanStringsReader // We need to continue this work - f.stepState = stateDict - return - } - goto readLiteral - } -} - -func (f *decompressor) huffmanBlockDecoder() func() { - switch f.r.(type) { - case *bytes.Buffer: - return f.huffmanBytesBuffer - case *bytes.Reader: - return f.huffmanBytesReader - case *bufio.Reader: - return f.huffmanBufioReader - case *strings.Reader: - return f.huffmanStringsReader - default: - return f.huffmanBlockGeneric - } -} diff --git a/vendor/github.com/klauspost/compress/flate/level1.go b/vendor/github.com/klauspost/compress/flate/level1.go index 1e5eea3968..102fc74c79 100644 --- a/vendor/github.com/klauspost/compress/flate/level1.go +++ b/vendor/github.com/klauspost/compress/flate/level1.go @@ -16,7 +16,7 @@ func (e *fastEncL1) Encode(dst *tokens, src []byte) { inputMargin = 12 - 1 minNonLiteralBlockSize = 1 + 1 + inputMargin ) - if debugDeflate && e.cur < 0 { + if debugDecode && e.cur < 0 { panic(fmt.Sprint("e.cur < 0: ", e.cur)) } @@ -81,12 +81,12 @@ func (e *fastEncL1) Encode(dst *tokens, src []byte) { } now := load6432(src, nextS) - e.table[nextHash] = tableEntry{offset: s + e.cur} + e.table[nextHash] = tableEntry{offset: s + e.cur, val: cv} nextHash = hash(uint32(now)) offset := s - (candidate.offset - e.cur) - if offset < maxMatchOffset && cv == load3232(src, candidate.offset-e.cur) { - e.table[nextHash] = tableEntry{offset: nextS + e.cur} + if offset < maxMatchOffset && cv == candidate.val { + e.table[nextHash] = tableEntry{offset: nextS + e.cur, val: uint32(now)} break } @@ -96,11 +96,11 @@ func (e *fastEncL1) Encode(dst *tokens, src []byte) { nextS++ candidate = e.table[nextHash] now >>= 8 - e.table[nextHash] = tableEntry{offset: s + e.cur} + e.table[nextHash] = tableEntry{offset: s + e.cur, val: cv} offset = s - (candidate.offset - e.cur) - if offset < maxMatchOffset && cv == load3232(src, candidate.offset-e.cur) { - e.table[nextHash] = tableEntry{offset: nextS + e.cur} + if offset < maxMatchOffset && cv == candidate.val { + e.table[nextHash] = tableEntry{offset: nextS + e.cur, val: uint32(now)} break } cv = uint32(now) @@ -139,7 +139,7 @@ func (e *fastEncL1) Encode(dst *tokens, src []byte) { // Index first pair after match end. if int(s+l+4) < len(src) { cv := load3232(src, s) - e.table[hash(cv)] = tableEntry{offset: s + e.cur} + e.table[hash(cv)] = tableEntry{offset: s + e.cur, val: cv} } goto emitRemainder } @@ -153,14 +153,14 @@ func (e *fastEncL1) Encode(dst *tokens, src []byte) { x := load6432(src, s-2) o := e.cur + s - 2 prevHash := hash(uint32(x)) - e.table[prevHash] = tableEntry{offset: o} + e.table[prevHash] = tableEntry{offset: o, val: uint32(x)} x >>= 16 currHash := hash(uint32(x)) candidate = e.table[currHash] - e.table[currHash] = tableEntry{offset: o + 2} + e.table[currHash] = tableEntry{offset: o + 2, val: uint32(x)} offset := s - (candidate.offset - e.cur) - if offset > maxMatchOffset || uint32(x) != load3232(src, candidate.offset-e.cur) { + if offset > maxMatchOffset || uint32(x) != candidate.val { cv = uint32(x >> 8) s++ break diff --git a/vendor/github.com/klauspost/compress/flate/level2.go b/vendor/github.com/klauspost/compress/flate/level2.go index 5b986a1944..dc6b1d3140 100644 --- a/vendor/github.com/klauspost/compress/flate/level2.go +++ b/vendor/github.com/klauspost/compress/flate/level2.go @@ -18,7 +18,7 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) { minNonLiteralBlockSize = 1 + 1 + inputMargin ) - if debugDeflate && e.cur < 0 { + if debugDecode && e.cur < 0 { panic(fmt.Sprint("e.cur < 0: ", e.cur)) } @@ -83,12 +83,12 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) { } candidate = e.table[nextHash] now := load6432(src, nextS) - e.table[nextHash] = tableEntry{offset: s + e.cur} + e.table[nextHash] = tableEntry{offset: s + e.cur, val: cv} nextHash = hash4u(uint32(now), bTableBits) offset := s - (candidate.offset - e.cur) - if offset < maxMatchOffset && cv == load3232(src, candidate.offset-e.cur) { - e.table[nextHash] = tableEntry{offset: nextS + e.cur} + if offset < maxMatchOffset && cv == candidate.val { + e.table[nextHash] = tableEntry{offset: nextS + e.cur, val: uint32(now)} break } @@ -98,10 +98,10 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) { nextS++ candidate = e.table[nextHash] now >>= 8 - e.table[nextHash] = tableEntry{offset: s + e.cur} + e.table[nextHash] = tableEntry{offset: s + e.cur, val: cv} offset = s - (candidate.offset - e.cur) - if offset < maxMatchOffset && cv == load3232(src, candidate.offset-e.cur) { + if offset < maxMatchOffset && cv == candidate.val { break } cv = uint32(now) @@ -148,7 +148,7 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) { // Index first pair after match end. if int(s+l+4) < len(src) { cv := load3232(src, s) - e.table[hash4u(cv, bTableBits)] = tableEntry{offset: s + e.cur} + e.table[hash4u(cv, bTableBits)] = tableEntry{offset: s + e.cur, val: cv} } goto emitRemainder } @@ -157,15 +157,15 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) { for i := s - l + 2; i < s-5; i += 7 { x := load6432(src, int32(i)) nextHash := hash4u(uint32(x), bTableBits) - e.table[nextHash] = tableEntry{offset: e.cur + i} + e.table[nextHash] = tableEntry{offset: e.cur + i, val: uint32(x)} // Skip one x >>= 16 nextHash = hash4u(uint32(x), bTableBits) - e.table[nextHash] = tableEntry{offset: e.cur + i + 2} + e.table[nextHash] = tableEntry{offset: e.cur + i + 2, val: uint32(x)} // Skip one x >>= 16 nextHash = hash4u(uint32(x), bTableBits) - e.table[nextHash] = tableEntry{offset: e.cur + i + 4} + e.table[nextHash] = tableEntry{offset: e.cur + i + 4, val: uint32(x)} } // We could immediately start working at s now, but to improve @@ -178,14 +178,14 @@ func (e *fastEncL2) Encode(dst *tokens, src []byte) { o := e.cur + s - 2 prevHash := hash4u(uint32(x), bTableBits) prevHash2 := hash4u(uint32(x>>8), bTableBits) - e.table[prevHash] = tableEntry{offset: o} - e.table[prevHash2] = tableEntry{offset: o + 1} + e.table[prevHash] = tableEntry{offset: o, val: uint32(x)} + e.table[prevHash2] = tableEntry{offset: o + 1, val: uint32(x >> 8)} currHash := hash4u(uint32(x>>16), bTableBits) candidate = e.table[currHash] - e.table[currHash] = tableEntry{offset: o + 2} + e.table[currHash] = tableEntry{offset: o + 2, val: uint32(x >> 16)} offset := s - (candidate.offset - e.cur) - if offset > maxMatchOffset || uint32(x>>16) != load3232(src, candidate.offset-e.cur) { + if offset > maxMatchOffset || uint32(x>>16) != candidate.val { cv = uint32(x >> 24) s++ break diff --git a/vendor/github.com/klauspost/compress/flate/level3.go b/vendor/github.com/klauspost/compress/flate/level3.go index c22b4244a5..1a3ff9b6b7 100644 --- a/vendor/github.com/klauspost/compress/flate/level3.go +++ b/vendor/github.com/klauspost/compress/flate/level3.go @@ -15,7 +15,7 @@ func (e *fastEncL3) Encode(dst *tokens, src []byte) { minNonLiteralBlockSize = 1 + 1 + inputMargin ) - if debugDeflate && e.cur < 0 { + if debugDecode && e.cur < 0 { panic(fmt.Sprint("e.cur < 0: ", e.cur)) } @@ -81,26 +81,22 @@ func (e *fastEncL3) Encode(dst *tokens, src []byte) { } candidates := e.table[nextHash] now := load3232(src, nextS) - - // Safe offset distance until s + 4... - minOffset := e.cur + s - (maxMatchOffset - 4) - e.table[nextHash] = tableEntryPrev{Prev: candidates.Cur, Cur: tableEntry{offset: s + e.cur}} + e.table[nextHash] = tableEntryPrev{Prev: candidates.Cur, Cur: tableEntry{offset: s + e.cur, val: cv}} // Check both candidates candidate = candidates.Cur - if candidate.offset < minOffset { - cv = now - // Previous will also be invalid, we have nothing. - continue - } - - if cv == load3232(src, candidate.offset-e.cur) { - if candidates.Prev.offset < minOffset || cv != load3232(src, candidates.Prev.offset-e.cur) { + offset := s - (candidate.offset - e.cur) + if cv == candidate.val { + if offset > maxMatchOffset { + cv = now + // Previous will also be invalid, we have nothing. + continue + } + o2 := s - (candidates.Prev.offset - e.cur) + if cv != candidates.Prev.val || o2 > maxMatchOffset { break } // Both match and are valid, pick longest. - offset := s - (candidate.offset - e.cur) - o2 := s - (candidates.Prev.offset - e.cur) l1, l2 := matchLen(src[s+4:], src[s-offset+4:]), matchLen(src[s+4:], src[s-o2+4:]) if l2 > l1 { candidate = candidates.Prev @@ -110,8 +106,11 @@ func (e *fastEncL3) Encode(dst *tokens, src []byte) { // We only check if value mismatches. // Offset will always be invalid in other cases. candidate = candidates.Prev - if candidate.offset > minOffset && cv == load3232(src, candidate.offset-e.cur) { - break + if cv == candidate.val { + offset := s - (candidate.offset - e.cur) + if offset <= maxMatchOffset { + break + } } } cv = now @@ -159,7 +158,7 @@ func (e *fastEncL3) Encode(dst *tokens, src []byte) { nextHash := hash(cv) e.table[nextHash] = tableEntryPrev{ Prev: e.table[nextHash].Cur, - Cur: tableEntry{offset: e.cur + t}, + Cur: tableEntry{offset: e.cur + t, val: cv}, } } goto emitRemainder @@ -171,21 +170,21 @@ func (e *fastEncL3) Encode(dst *tokens, src []byte) { prevHash := hash(uint32(x)) e.table[prevHash] = tableEntryPrev{ Prev: e.table[prevHash].Cur, - Cur: tableEntry{offset: e.cur + s - 3}, + Cur: tableEntry{offset: e.cur + s - 3, val: uint32(x)}, } x >>= 8 prevHash = hash(uint32(x)) e.table[prevHash] = tableEntryPrev{ Prev: e.table[prevHash].Cur, - Cur: tableEntry{offset: e.cur + s - 2}, + Cur: tableEntry{offset: e.cur + s - 2, val: uint32(x)}, } x >>= 8 prevHash = hash(uint32(x)) e.table[prevHash] = tableEntryPrev{ Prev: e.table[prevHash].Cur, - Cur: tableEntry{offset: e.cur + s - 1}, + Cur: tableEntry{offset: e.cur + s - 1, val: uint32(x)}, } x >>= 8 currHash := hash(uint32(x)) @@ -193,18 +192,21 @@ func (e *fastEncL3) Encode(dst *tokens, src []byte) { cv = uint32(x) e.table[currHash] = tableEntryPrev{ Prev: candidates.Cur, - Cur: tableEntry{offset: s + e.cur}, + Cur: tableEntry{offset: s + e.cur, val: cv}, } // Check both candidates candidate = candidates.Cur - minOffset := e.cur + s - (maxMatchOffset - 4) - - if candidate.offset > minOffset && cv != load3232(src, candidate.offset-e.cur) { + if cv == candidate.val { + offset := s - (candidate.offset - e.cur) + if offset <= maxMatchOffset { + continue + } + } else { // We only check if value mismatches. // Offset will always be invalid in other cases. candidate = candidates.Prev - if candidate.offset > minOffset && cv == load3232(src, candidate.offset-e.cur) { + if cv == candidate.val { offset := s - (candidate.offset - e.cur) if offset <= maxMatchOffset { continue diff --git a/vendor/github.com/klauspost/compress/flate/level4.go b/vendor/github.com/klauspost/compress/flate/level4.go index e62f0c02b1..f3ecc9c4d5 100644 --- a/vendor/github.com/klauspost/compress/flate/level4.go +++ b/vendor/github.com/klauspost/compress/flate/level4.go @@ -13,7 +13,7 @@ func (e *fastEncL4) Encode(dst *tokens, src []byte) { inputMargin = 12 - 1 minNonLiteralBlockSize = 1 + 1 + inputMargin ) - if debugDeflate && e.cur < 0 { + if debugDecode && e.cur < 0 { panic(fmt.Sprint("e.cur < 0: ", e.cur)) } // Protect against e.cur wraparound. @@ -92,24 +92,24 @@ func (e *fastEncL4) Encode(dst *tokens, src []byte) { sCandidate := e.table[nextHashS] lCandidate := e.bTable[nextHashL] next := load6432(src, nextS) - entry := tableEntry{offset: s + e.cur} + entry := tableEntry{offset: s + e.cur, val: uint32(cv)} e.table[nextHashS] = entry e.bTable[nextHashL] = entry t = lCandidate.offset - e.cur - if s-t < maxMatchOffset && uint32(cv) == load3232(src, lCandidate.offset-e.cur) { + if s-t < maxMatchOffset && uint32(cv) == lCandidate.val { // We got a long match. Use that. break } t = sCandidate.offset - e.cur - if s-t < maxMatchOffset && uint32(cv) == load3232(src, sCandidate.offset-e.cur) { + if s-t < maxMatchOffset && uint32(cv) == sCandidate.val { // Found a 4 match... lCandidate = e.bTable[hash7(next, tableBits)] // If the next long is a candidate, check if we should use that instead... lOff := nextS - (lCandidate.offset - e.cur) - if lOff < maxMatchOffset && load3232(src, lCandidate.offset-e.cur) == uint32(next) { + if lOff < maxMatchOffset && lCandidate.val == uint32(next) { l1, l2 := matchLen(src[s+4:], src[t+4:]), matchLen(src[nextS+4:], src[nextS-lOff+4:]) if l2 > l1 { s = nextS @@ -137,7 +137,7 @@ func (e *fastEncL4) Encode(dst *tokens, src []byte) { if nextEmit < s { emitLiteral(dst, src[nextEmit:s]) } - if debugDeflate { + if false { if t >= s { panic("s-t") } @@ -160,8 +160,8 @@ func (e *fastEncL4) Encode(dst *tokens, src []byte) { // Index first pair after match end. if int(s+8) < len(src) { cv := load6432(src, s) - e.table[hash4x64(cv, tableBits)] = tableEntry{offset: s + e.cur} - e.bTable[hash7(cv, tableBits)] = tableEntry{offset: s + e.cur} + e.table[hash4x64(cv, tableBits)] = tableEntry{offset: s + e.cur, val: uint32(cv)} + e.bTable[hash7(cv, tableBits)] = tableEntry{offset: s + e.cur, val: uint32(cv)} } goto emitRemainder } @@ -171,20 +171,20 @@ func (e *fastEncL4) Encode(dst *tokens, src []byte) { i := nextS if i < s-1 { cv := load6432(src, i) - t := tableEntry{offset: i + e.cur} - t2 := tableEntry{offset: t.offset + 1} + t := tableEntry{offset: i + e.cur, val: uint32(cv)} + t2 := tableEntry{val: uint32(cv >> 8), offset: t.offset + 1} e.bTable[hash7(cv, tableBits)] = t e.bTable[hash7(cv>>8, tableBits)] = t2 - e.table[hash4u(uint32(cv>>8), tableBits)] = t2 + e.table[hash4u(t2.val, tableBits)] = t2 i += 3 for ; i < s-1; i += 3 { cv := load6432(src, i) - t := tableEntry{offset: i + e.cur} - t2 := tableEntry{offset: t.offset + 1} + t := tableEntry{offset: i + e.cur, val: uint32(cv)} + t2 := tableEntry{val: uint32(cv >> 8), offset: t.offset + 1} e.bTable[hash7(cv, tableBits)] = t e.bTable[hash7(cv>>8, tableBits)] = t2 - e.table[hash4u(uint32(cv>>8), tableBits)] = t2 + e.table[hash4u(t2.val, tableBits)] = t2 } } } @@ -195,8 +195,8 @@ func (e *fastEncL4) Encode(dst *tokens, src []byte) { o := e.cur + s - 1 prevHashS := hash4x64(x, tableBits) prevHashL := hash7(x, tableBits) - e.table[prevHashS] = tableEntry{offset: o} - e.bTable[prevHashL] = tableEntry{offset: o} + e.table[prevHashS] = tableEntry{offset: o, val: uint32(x)} + e.bTable[prevHashL] = tableEntry{offset: o, val: uint32(x)} cv = x >> 8 } diff --git a/vendor/github.com/klauspost/compress/flate/level5.go b/vendor/github.com/klauspost/compress/flate/level5.go index d513f1ffd3..4e39168250 100644 --- a/vendor/github.com/klauspost/compress/flate/level5.go +++ b/vendor/github.com/klauspost/compress/flate/level5.go @@ -13,7 +13,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) { inputMargin = 12 - 1 minNonLiteralBlockSize = 1 + 1 + inputMargin ) - if debugDeflate && e.cur < 0 { + if debugDecode && e.cur < 0 { panic(fmt.Sprint("e.cur < 0: ", e.cur)) } @@ -100,7 +100,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) { sCandidate := e.table[nextHashS] lCandidate := e.bTable[nextHashL] next := load6432(src, nextS) - entry := tableEntry{offset: s + e.cur} + entry := tableEntry{offset: s + e.cur, val: uint32(cv)} e.table[nextHashS] = entry eLong := &e.bTable[nextHashL] eLong.Cur, eLong.Prev = entry, eLong.Cur @@ -110,14 +110,14 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) { t = lCandidate.Cur.offset - e.cur if s-t < maxMatchOffset { - if uint32(cv) == load3232(src, lCandidate.Cur.offset-e.cur) { + if uint32(cv) == lCandidate.Cur.val { // Store the next match - e.table[nextHashS] = tableEntry{offset: nextS + e.cur} + e.table[nextHashS] = tableEntry{offset: nextS + e.cur, val: uint32(next)} eLong := &e.bTable[nextHashL] - eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur}, eLong.Cur + eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur, val: uint32(next)}, eLong.Cur t2 := lCandidate.Prev.offset - e.cur - if s-t2 < maxMatchOffset && uint32(cv) == load3232(src, lCandidate.Prev.offset-e.cur) { + if s-t2 < maxMatchOffset && uint32(cv) == lCandidate.Prev.val { l = e.matchlen(s+4, t+4, src) + 4 ml1 := e.matchlen(s+4, t2+4, src) + 4 if ml1 > l { @@ -129,30 +129,30 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) { break } t = lCandidate.Prev.offset - e.cur - if s-t < maxMatchOffset && uint32(cv) == load3232(src, lCandidate.Prev.offset-e.cur) { + if s-t < maxMatchOffset && uint32(cv) == lCandidate.Prev.val { // Store the next match - e.table[nextHashS] = tableEntry{offset: nextS + e.cur} + e.table[nextHashS] = tableEntry{offset: nextS + e.cur, val: uint32(next)} eLong := &e.bTable[nextHashL] - eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur}, eLong.Cur + eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur, val: uint32(next)}, eLong.Cur break } } t = sCandidate.offset - e.cur - if s-t < maxMatchOffset && uint32(cv) == load3232(src, sCandidate.offset-e.cur) { + if s-t < maxMatchOffset && uint32(cv) == sCandidate.val { // Found a 4 match... l = e.matchlen(s+4, t+4, src) + 4 lCandidate = e.bTable[nextHashL] // Store the next match - e.table[nextHashS] = tableEntry{offset: nextS + e.cur} + e.table[nextHashS] = tableEntry{offset: nextS + e.cur, val: uint32(next)} eLong := &e.bTable[nextHashL] - eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur}, eLong.Cur + eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur, val: uint32(next)}, eLong.Cur // If the next long is a candidate, use that... t2 := lCandidate.Cur.offset - e.cur if nextS-t2 < maxMatchOffset { - if load3232(src, lCandidate.Cur.offset-e.cur) == uint32(next) { + if lCandidate.Cur.val == uint32(next) { ml := e.matchlen(nextS+4, t2+4, src) + 4 if ml > l { t = t2 @@ -163,7 +163,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) { } // If the previous long is a candidate, use that... t2 = lCandidate.Prev.offset - e.cur - if nextS-t2 < maxMatchOffset && load3232(src, lCandidate.Prev.offset-e.cur) == uint32(next) { + if nextS-t2 < maxMatchOffset && lCandidate.Prev.val == uint32(next) { ml := e.matchlen(nextS+4, t2+4, src) + 4 if ml > l { t = t2 @@ -197,7 +197,7 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) { if nextEmit < s { emitLiteral(dst, src[nextEmit:s]) } - if debugDeflate { + if false { if t >= s { panic(fmt.Sprintln("s-t", s, t)) } @@ -226,31 +226,31 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) { i := s - l + 1 if i < s-1 { cv := load6432(src, i) - t := tableEntry{offset: i + e.cur} + t := tableEntry{offset: i + e.cur, val: uint32(cv)} e.table[hash4x64(cv, tableBits)] = t eLong := &e.bTable[hash7(cv, tableBits)] eLong.Cur, eLong.Prev = t, eLong.Cur // Do an long at i+1 cv >>= 8 - t = tableEntry{offset: t.offset + 1} + t = tableEntry{offset: t.offset + 1, val: uint32(cv)} eLong = &e.bTable[hash7(cv, tableBits)] eLong.Cur, eLong.Prev = t, eLong.Cur // We only have enough bits for a short entry at i+2 cv >>= 8 - t = tableEntry{offset: t.offset + 1} + t = tableEntry{offset: t.offset + 1, val: uint32(cv)} e.table[hash4x64(cv, tableBits)] = t // Skip one - otherwise we risk hitting 's' i += 4 for ; i < s-1; i += hashEvery { cv := load6432(src, i) - t := tableEntry{offset: i + e.cur} - t2 := tableEntry{offset: t.offset + 1} + t := tableEntry{offset: i + e.cur, val: uint32(cv)} + t2 := tableEntry{offset: t.offset + 1, val: uint32(cv >> 8)} eLong := &e.bTable[hash7(cv, tableBits)] eLong.Cur, eLong.Prev = t, eLong.Cur - e.table[hash4u(uint32(cv>>8), tableBits)] = t2 + e.table[hash4u(t2.val, tableBits)] = t2 } } } @@ -261,9 +261,9 @@ func (e *fastEncL5) Encode(dst *tokens, src []byte) { o := e.cur + s - 1 prevHashS := hash4x64(x, tableBits) prevHashL := hash7(x, tableBits) - e.table[prevHashS] = tableEntry{offset: o} + e.table[prevHashS] = tableEntry{offset: o, val: uint32(x)} eLong := &e.bTable[prevHashL] - eLong.Cur, eLong.Prev = tableEntry{offset: o}, eLong.Cur + eLong.Cur, eLong.Prev = tableEntry{offset: o, val: uint32(x)}, eLong.Cur cv = x >> 8 } diff --git a/vendor/github.com/klauspost/compress/flate/level6.go b/vendor/github.com/klauspost/compress/flate/level6.go index a52c80ea45..00a3119776 100644 --- a/vendor/github.com/klauspost/compress/flate/level6.go +++ b/vendor/github.com/klauspost/compress/flate/level6.go @@ -13,7 +13,7 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { inputMargin = 12 - 1 minNonLiteralBlockSize = 1 + 1 + inputMargin ) - if debugDeflate && e.cur < 0 { + if debugDecode && e.cur < 0 { panic(fmt.Sprint("e.cur < 0: ", e.cur)) } @@ -101,7 +101,7 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { sCandidate := e.table[nextHashS] lCandidate := e.bTable[nextHashL] next := load6432(src, nextS) - entry := tableEntry{offset: s + e.cur} + entry := tableEntry{offset: s + e.cur, val: uint32(cv)} e.table[nextHashS] = entry eLong := &e.bTable[nextHashL] eLong.Cur, eLong.Prev = entry, eLong.Cur @@ -112,17 +112,17 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { t = lCandidate.Cur.offset - e.cur if s-t < maxMatchOffset { - if uint32(cv) == load3232(src, lCandidate.Cur.offset-e.cur) { + if uint32(cv) == lCandidate.Cur.val { // Long candidate matches at least 4 bytes. // Store the next match - e.table[nextHashS] = tableEntry{offset: nextS + e.cur} + e.table[nextHashS] = tableEntry{offset: nextS + e.cur, val: uint32(next)} eLong := &e.bTable[nextHashL] - eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur}, eLong.Cur + eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur, val: uint32(next)}, eLong.Cur // Check the previous long candidate as well. t2 := lCandidate.Prev.offset - e.cur - if s-t2 < maxMatchOffset && uint32(cv) == load3232(src, lCandidate.Prev.offset-e.cur) { + if s-t2 < maxMatchOffset && uint32(cv) == lCandidate.Prev.val { l = e.matchlen(s+4, t+4, src) + 4 ml1 := e.matchlen(s+4, t2+4, src) + 4 if ml1 > l { @@ -135,17 +135,17 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { } // Current value did not match, but check if previous long value does. t = lCandidate.Prev.offset - e.cur - if s-t < maxMatchOffset && uint32(cv) == load3232(src, lCandidate.Prev.offset-e.cur) { + if s-t < maxMatchOffset && uint32(cv) == lCandidate.Prev.val { // Store the next match - e.table[nextHashS] = tableEntry{offset: nextS + e.cur} + e.table[nextHashS] = tableEntry{offset: nextS + e.cur, val: uint32(next)} eLong := &e.bTable[nextHashL] - eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur}, eLong.Cur + eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur, val: uint32(next)}, eLong.Cur break } } t = sCandidate.offset - e.cur - if s-t < maxMatchOffset && uint32(cv) == load3232(src, sCandidate.offset-e.cur) { + if s-t < maxMatchOffset && uint32(cv) == sCandidate.val { // Found a 4 match... l = e.matchlen(s+4, t+4, src) + 4 @@ -153,9 +153,9 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { lCandidate = e.bTable[nextHashL] // Store the next match - e.table[nextHashS] = tableEntry{offset: nextS + e.cur} + e.table[nextHashS] = tableEntry{offset: nextS + e.cur, val: uint32(next)} eLong := &e.bTable[nextHashL] - eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur}, eLong.Cur + eLong.Cur, eLong.Prev = tableEntry{offset: nextS + e.cur, val: uint32(next)}, eLong.Cur // Check repeat at s + repOff const repOff = 1 @@ -174,7 +174,7 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { // If the next long is a candidate, use that... t2 = lCandidate.Cur.offset - e.cur if nextS-t2 < maxMatchOffset { - if load3232(src, lCandidate.Cur.offset-e.cur) == uint32(next) { + if lCandidate.Cur.val == uint32(next) { ml := e.matchlen(nextS+4, t2+4, src) + 4 if ml > l { t = t2 @@ -185,7 +185,7 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { } // If the previous long is a candidate, use that... t2 = lCandidate.Prev.offset - e.cur - if nextS-t2 < maxMatchOffset && load3232(src, lCandidate.Prev.offset-e.cur) == uint32(next) { + if nextS-t2 < maxMatchOffset && lCandidate.Prev.val == uint32(next) { ml := e.matchlen(nextS+4, t2+4, src) + 4 if ml > l { t = t2 @@ -244,9 +244,9 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { // Index after match end. for i := nextS + 1; i < int32(len(src))-8; i += 2 { cv := load6432(src, i) - e.table[hash4x64(cv, tableBits)] = tableEntry{offset: i + e.cur} + e.table[hash4x64(cv, tableBits)] = tableEntry{offset: i + e.cur, val: uint32(cv)} eLong := &e.bTable[hash7(cv, tableBits)] - eLong.Cur, eLong.Prev = tableEntry{offset: i + e.cur}, eLong.Cur + eLong.Cur, eLong.Prev = tableEntry{offset: i + e.cur, val: uint32(cv)}, eLong.Cur } goto emitRemainder } @@ -255,8 +255,8 @@ func (e *fastEncL6) Encode(dst *tokens, src []byte) { if true { for i := nextS + 1; i < s-1; i += 2 { cv := load6432(src, i) - t := tableEntry{offset: i + e.cur} - t2 := tableEntry{offset: t.offset + 1} + t := tableEntry{offset: i + e.cur, val: uint32(cv)} + t2 := tableEntry{offset: t.offset + 1, val: uint32(cv >> 8)} eLong := &e.bTable[hash7(cv, tableBits)] eLong2 := &e.bTable[hash7(cv>>8, tableBits)] e.table[hash4x64(cv, tableBits)] = t diff --git a/vendor/github.com/klauspost/compress/flate/token.go b/vendor/github.com/klauspost/compress/flate/token.go index f9abf606d6..099c0ddbc4 100644 --- a/vendor/github.com/klauspost/compress/flate/token.go +++ b/vendor/github.com/klauspost/compress/flate/token.go @@ -262,7 +262,7 @@ func (t *tokens) EstimatedBits() int { // AddMatch adds a match to the tokens. // This function is very sensitive to inlining and right on the border. func (t *tokens) AddMatch(xlength uint32, xoffset uint32) { - if debugDeflate { + if debugDecode { if xlength >= maxMatchLength+baseMatchLength { panic(fmt.Errorf("invalid length: %v", xlength)) } @@ -281,7 +281,7 @@ func (t *tokens) AddMatch(xlength uint32, xoffset uint32) { // AddMatchLong adds a match to the tokens, potentially longer than max match length. // Length should NOT have the base subtracted, only offset should. func (t *tokens) AddMatchLong(xlength int32, xoffset uint32) { - if debugDeflate { + if debugDecode { if xoffset >= maxMatchOffset+baseMatchOffset { panic(fmt.Errorf("invalid offset: %v", xoffset)) } diff --git a/vendor/github.com/klauspost/compress/fse/bitreader.go b/vendor/github.com/klauspost/compress/fse/bitreader.go index f65eb3909c..b9db204f59 100644 --- a/vendor/github.com/klauspost/compress/fse/bitreader.go +++ b/vendor/github.com/klauspost/compress/fse/bitreader.go @@ -6,7 +6,6 @@ package fse import ( - "encoding/binary" "errors" "io" ) @@ -35,12 +34,8 @@ func (b *bitReader) init(in []byte) error { } b.bitsRead = 64 b.value = 0 - if len(in) >= 8 { - b.fillFastStart() - } else { - b.fill() - b.fill() - } + b.fill() + b.fill() b.bitsRead += 8 - uint8(highBits(uint32(v))) return nil } @@ -68,9 +63,8 @@ func (b *bitReader) fillFast() { if b.bitsRead < 32 { return } - // 2 bounds checks. - v := b.in[b.off-4:] - v = v[:4] + // Do single re-slice to avoid bounds checks. + v := b.in[b.off-4 : b.off] low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) b.value = (b.value << 32) | uint64(low) b.bitsRead -= 32 @@ -83,8 +77,7 @@ func (b *bitReader) fill() { return } if b.off > 4 { - v := b.in[b.off-4:] - v = v[:4] + v := b.in[b.off-4 : b.off] low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) b.value = (b.value << 32) | uint64(low) b.bitsRead -= 32 @@ -98,17 +91,9 @@ func (b *bitReader) fill() { } } -// fillFastStart() assumes the bitreader is empty and there is at least 8 bytes to read. -func (b *bitReader) fillFastStart() { - // Do single re-slice to avoid bounds checks. - b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) - b.bitsRead = 0 - b.off -= 8 -} - // finished returns true if all bits have been read from the bit stream. func (b *bitReader) finished() bool { - return b.bitsRead >= 64 && b.off == 0 + return b.off == 0 && b.bitsRead >= 64 } // close the bitstream and returns an error if out-of-buffer reads occurred. diff --git a/vendor/github.com/klauspost/compress/fse/bytereader.go b/vendor/github.com/klauspost/compress/fse/bytereader.go index abade2d605..f228a46cdf 100644 --- a/vendor/github.com/klauspost/compress/fse/bytereader.go +++ b/vendor/github.com/klauspost/compress/fse/bytereader.go @@ -25,10 +25,19 @@ func (b *byteReader) advance(n uint) { b.off += int(n) } +// Int32 returns a little endian int32 starting at current offset. +func (b byteReader) Int32() int32 { + b2 := b.b[b.off : b.off+4 : b.off+4] + v3 := int32(b2[3]) + v2 := int32(b2[2]) + v1 := int32(b2[1]) + v0 := int32(b2[0]) + return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24) +} + // Uint32 returns a little endian uint32 starting at current offset. func (b byteReader) Uint32() uint32 { - b2 := b.b[b.off:] - b2 = b2[:4] + b2 := b.b[b.off : b.off+4 : b.off+4] v3 := uint32(b2[3]) v2 := uint32(b2[2]) v1 := uint32(b2[1]) diff --git a/vendor/github.com/klauspost/compress/fse/fse.go b/vendor/github.com/klauspost/compress/fse/fse.go index 535cbadfde..075357b5b1 100644 --- a/vendor/github.com/klauspost/compress/fse/fse.go +++ b/vendor/github.com/klauspost/compress/fse/fse.go @@ -44,14 +44,18 @@ var ( // Scratch provides temporary storage for compression and decompression. type Scratch struct { // Private - count [maxSymbolValue + 1]uint32 - norm [maxSymbolValue + 1]int16 - br byteReader - bits bitReader - bw bitWriter - ct cTable // Compression tables. - decTable []decSymbol // Decompression table. - maxCount int // count of the most probable symbol + count [maxSymbolValue + 1]uint32 + norm [maxSymbolValue + 1]int16 + symbolLen uint16 // Length of active part of the symbol table. + actualTableLog uint8 // Selected tablelog. + br byteReader + bits bitReader + bw bitWriter + ct cTable // Compression tables. + decTable []decSymbol // Decompression table. + zeroBits bool // no bits has prob > 50%. + clearCount bool // clear count + maxCount int // count of the most probable symbol // Per block parameters. // These can be used to override compression parameters of the block. @@ -64,22 +68,17 @@ type Scratch struct { // and allocation will be avoided. Out []byte - // DecompressLimit limits the maximum decoded size acceptable. - // If > 0 decompression will stop when approximately this many bytes - // has been decoded. - // If 0, maximum size will be 2GB. - DecompressLimit int - - symbolLen uint16 // Length of active part of the symbol table. - actualTableLog uint8 // Selected tablelog. - zeroBits bool // no bits has prob > 50%. - clearCount bool // clear count - // MaxSymbolValue will override the maximum symbol value of the next block. MaxSymbolValue uint8 // TableLog will attempt to override the tablelog for the next block. TableLog uint8 + + // DecompressLimit limits the maximum decoded size acceptable. + // If > 0 decompression will stop when approximately this many bytes + // has been decoded. + // If 0, maximum size will be 2GB. + DecompressLimit int } // Histogram allows to populate the histogram and skip that step in the compression, diff --git a/vendor/github.com/klauspost/compress/gzip/gunzip.go b/vendor/github.com/klauspost/compress/gzip/gunzip.go deleted file mode 100644 index 568b5d4fb8..0000000000 --- a/vendor/github.com/klauspost/compress/gzip/gunzip.go +++ /dev/null @@ -1,344 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gzip implements reading and writing of gzip format compressed files, -// as specified in RFC 1952. -package gzip - -import ( - "bufio" - "encoding/binary" - "errors" - "hash/crc32" - "io" - "time" - - "github.com/klauspost/compress/flate" -) - -const ( - gzipID1 = 0x1f - gzipID2 = 0x8b - gzipDeflate = 8 - flagText = 1 << 0 - flagHdrCrc = 1 << 1 - flagExtra = 1 << 2 - flagName = 1 << 3 - flagComment = 1 << 4 -) - -var ( - // ErrChecksum is returned when reading GZIP data that has an invalid checksum. - ErrChecksum = errors.New("gzip: invalid checksum") - // ErrHeader is returned when reading GZIP data that has an invalid header. - ErrHeader = errors.New("gzip: invalid header") -) - -var le = binary.LittleEndian - -// noEOF converts io.EOF to io.ErrUnexpectedEOF. -func noEOF(err error) error { - if err == io.EOF { - return io.ErrUnexpectedEOF - } - return err -} - -// The gzip file stores a header giving metadata about the compressed file. -// That header is exposed as the fields of the Writer and Reader structs. -// -// Strings must be UTF-8 encoded and may only contain Unicode code points -// U+0001 through U+00FF, due to limitations of the GZIP file format. -type Header struct { - Comment string // comment - Extra []byte // "extra data" - ModTime time.Time // modification time - Name string // file name - OS byte // operating system type -} - -// A Reader is an io.Reader that can be read to retrieve -// uncompressed data from a gzip-format compressed file. -// -// In general, a gzip file can be a concatenation of gzip files, -// each with its own header. Reads from the Reader -// return the concatenation of the uncompressed data of each. -// Only the first header is recorded in the Reader fields. -// -// Gzip files store a length and checksum of the uncompressed data. -// The Reader will return a ErrChecksum when Read -// reaches the end of the uncompressed data if it does not -// have the expected length or checksum. Clients should treat data -// returned by Read as tentative until they receive the io.EOF -// marking the end of the data. -type Reader struct { - Header // valid after NewReader or Reader.Reset - r flate.Reader - decompressor io.ReadCloser - digest uint32 // CRC-32, IEEE polynomial (section 8) - size uint32 // Uncompressed size (section 2.3.1) - buf [512]byte - err error - multistream bool -} - -// NewReader creates a new Reader reading the given reader. -// If r does not also implement io.ByteReader, -// the decompressor may read more data than necessary from r. -// -// It is the caller's responsibility to call Close on the Reader when done. -// -// The Reader.Header fields will be valid in the Reader returned. -func NewReader(r io.Reader) (*Reader, error) { - z := new(Reader) - if err := z.Reset(r); err != nil { - return nil, err - } - return z, nil -} - -// Reset discards the Reader z's state and makes it equivalent to the -// result of its original state from NewReader, but reading from r instead. -// This permits reusing a Reader rather than allocating a new one. -func (z *Reader) Reset(r io.Reader) error { - *z = Reader{ - decompressor: z.decompressor, - multistream: true, - } - if rr, ok := r.(flate.Reader); ok { - z.r = rr - } else { - z.r = bufio.NewReader(r) - } - z.Header, z.err = z.readHeader() - return z.err -} - -// Multistream controls whether the reader supports multistream files. -// -// If enabled (the default), the Reader expects the input to be a sequence -// of individually gzipped data streams, each with its own header and -// trailer, ending at EOF. The effect is that the concatenation of a sequence -// of gzipped files is treated as equivalent to the gzip of the concatenation -// of the sequence. This is standard behavior for gzip readers. -// -// Calling Multistream(false) disables this behavior; disabling the behavior -// can be useful when reading file formats that distinguish individual gzip -// data streams or mix gzip data streams with other data streams. -// In this mode, when the Reader reaches the end of the data stream, -// Read returns io.EOF. If the underlying reader implements io.ByteReader, -// it will be left positioned just after the gzip stream. -// To start the next stream, call z.Reset(r) followed by z.Multistream(false). -// If there is no next stream, z.Reset(r) will return io.EOF. -func (z *Reader) Multistream(ok bool) { - z.multistream = ok -} - -// readString reads a NUL-terminated string from z.r. -// It treats the bytes read as being encoded as ISO 8859-1 (Latin-1) and -// will output a string encoded using UTF-8. -// This method always updates z.digest with the data read. -func (z *Reader) readString() (string, error) { - var err error - needConv := false - for i := 0; ; i++ { - if i >= len(z.buf) { - return "", ErrHeader - } - z.buf[i], err = z.r.ReadByte() - if err != nil { - return "", err - } - if z.buf[i] > 0x7f { - needConv = true - } - if z.buf[i] == 0 { - // Digest covers the NUL terminator. - z.digest = crc32.Update(z.digest, crc32.IEEETable, z.buf[:i+1]) - - // Strings are ISO 8859-1, Latin-1 (RFC 1952, section 2.3.1). - if needConv { - s := make([]rune, 0, i) - for _, v := range z.buf[:i] { - s = append(s, rune(v)) - } - return string(s), nil - } - return string(z.buf[:i]), nil - } - } -} - -// readHeader reads the GZIP header according to section 2.3.1. -// This method does not set z.err. -func (z *Reader) readHeader() (hdr Header, err error) { - if _, err = io.ReadFull(z.r, z.buf[:10]); err != nil { - // RFC 1952, section 2.2, says the following: - // A gzip file consists of a series of "members" (compressed data sets). - // - // Other than this, the specification does not clarify whether a - // "series" is defined as "one or more" or "zero or more". To err on the - // side of caution, Go interprets this to mean "zero or more". - // Thus, it is okay to return io.EOF here. - return hdr, err - } - if z.buf[0] != gzipID1 || z.buf[1] != gzipID2 || z.buf[2] != gzipDeflate { - return hdr, ErrHeader - } - flg := z.buf[3] - hdr.ModTime = time.Unix(int64(le.Uint32(z.buf[4:8])), 0) - // z.buf[8] is XFL and is currently ignored. - hdr.OS = z.buf[9] - z.digest = crc32.ChecksumIEEE(z.buf[:10]) - - if flg&flagExtra != 0 { - if _, err = io.ReadFull(z.r, z.buf[:2]); err != nil { - return hdr, noEOF(err) - } - z.digest = crc32.Update(z.digest, crc32.IEEETable, z.buf[:2]) - data := make([]byte, le.Uint16(z.buf[:2])) - if _, err = io.ReadFull(z.r, data); err != nil { - return hdr, noEOF(err) - } - z.digest = crc32.Update(z.digest, crc32.IEEETable, data) - hdr.Extra = data - } - - var s string - if flg&flagName != 0 { - if s, err = z.readString(); err != nil { - return hdr, err - } - hdr.Name = s - } - - if flg&flagComment != 0 { - if s, err = z.readString(); err != nil { - return hdr, err - } - hdr.Comment = s - } - - if flg&flagHdrCrc != 0 { - if _, err = io.ReadFull(z.r, z.buf[:2]); err != nil { - return hdr, noEOF(err) - } - digest := le.Uint16(z.buf[:2]) - if digest != uint16(z.digest) { - return hdr, ErrHeader - } - } - - z.digest = 0 - if z.decompressor == nil { - z.decompressor = flate.NewReader(z.r) - } else { - z.decompressor.(flate.Resetter).Reset(z.r, nil) - } - return hdr, nil -} - -// Read implements io.Reader, reading uncompressed bytes from its underlying Reader. -func (z *Reader) Read(p []byte) (n int, err error) { - if z.err != nil { - return 0, z.err - } - - n, z.err = z.decompressor.Read(p) - z.digest = crc32.Update(z.digest, crc32.IEEETable, p[:n]) - z.size += uint32(n) - if z.err != io.EOF { - // In the normal case we return here. - return n, z.err - } - - // Finished file; check checksum and size. - if _, err := io.ReadFull(z.r, z.buf[:8]); err != nil { - z.err = noEOF(err) - return n, z.err - } - digest := le.Uint32(z.buf[:4]) - size := le.Uint32(z.buf[4:8]) - if digest != z.digest || size != z.size { - z.err = ErrChecksum - return n, z.err - } - z.digest, z.size = 0, 0 - - // File is ok; check if there is another. - if !z.multistream { - return n, io.EOF - } - z.err = nil // Remove io.EOF - - if _, z.err = z.readHeader(); z.err != nil { - return n, z.err - } - - // Read from next file, if necessary. - if n > 0 { - return n, nil - } - return z.Read(p) -} - -// 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() - for { - if z.err != nil { - if z.err == io.EOF { - return total, nil - } - return total, z.err - } - - // We write both to output and digest. - mw := io.MultiWriter(w, crcWriter) - n, err := z.decompressor.(io.WriterTo).WriteTo(mw) - total += n - z.size += uint32(n) - if err != nil { - z.err = err - return total, z.err - } - - // Finished file; check checksum + size. - if _, err := io.ReadFull(z.r, z.buf[0:8]); err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - z.err = err - return total, err - } - z.digest = crcWriter.Sum32() - digest := le.Uint32(z.buf[:4]) - size := le.Uint32(z.buf[4:8]) - if digest != z.digest || size != z.size { - z.err = ErrChecksum - return total, z.err - } - z.digest, z.size = 0, 0 - - // File is ok; check if there is another. - if !z.multistream { - return total, nil - } - crcWriter.Reset() - z.err = nil // Remove io.EOF - - if _, z.err = z.readHeader(); z.err != nil { - if z.err == io.EOF { - return total, nil - } - return total, z.err - } - } -} - -// Close closes the Reader. It does not close the underlying io.Reader. -// In order for the GZIP checksum to be verified, the reader must be -// fully consumed until the io.EOF. -func (z *Reader) Close() error { return z.decompressor.Close() } diff --git a/vendor/github.com/klauspost/compress/gzip/gzip.go b/vendor/github.com/klauspost/compress/gzip/gzip.go deleted file mode 100644 index 26203851bd..0000000000 --- a/vendor/github.com/klauspost/compress/gzip/gzip.go +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gzip - -import ( - "errors" - "fmt" - "hash/crc32" - "io" - - "github.com/klauspost/compress/flate" -) - -// These constants are copied from the flate package, so that code that imports -// "compress/gzip" does not also have to import "compress/flate". -const ( - NoCompression = flate.NoCompression - BestSpeed = flate.BestSpeed - BestCompression = flate.BestCompression - DefaultCompression = flate.DefaultCompression - ConstantCompression = flate.ConstantCompression - HuffmanOnly = flate.HuffmanOnly - - // StatelessCompression will do compression but without maintaining any state - // between Write calls. - // There will be no memory kept between Write calls, - // but compression and speed will be suboptimal. - // Because of this, the size of actual Write calls will affect output size. - StatelessCompression = -3 -) - -// A Writer is an io.WriteCloser. -// Writes to a Writer are compressed and written to w. -type Writer struct { - Header // written at first call to Write, Flush, or Close - w io.Writer - level int - err error - compressor *flate.Writer - digest uint32 // CRC-32, IEEE polynomial (section 8) - size uint32 // Uncompressed size (section 2.3.1) - wroteHeader bool - closed bool - buf [10]byte -} - -// NewWriter returns a new Writer. -// Writes to the returned writer are compressed and written to w. -// -// It is the caller's responsibility to call Close on the WriteCloser when done. -// Writes may be buffered and not flushed until Close. -// -// Callers that wish to set the fields in Writer.Header must do so before -// the first call to Write, Flush, or Close. -func NewWriter(w io.Writer) *Writer { - z, _ := NewWriterLevel(w, DefaultCompression) - return z -} - -// NewWriterLevel is like NewWriter but specifies the compression level instead -// of assuming DefaultCompression. -// -// The compression level can be DefaultCompression, NoCompression, or any -// integer value between BestSpeed and BestCompression inclusive. The error -// returned will be nil if the level is valid. -func NewWriterLevel(w io.Writer, level int) (*Writer, error) { - if level < StatelessCompression || level > BestCompression { - return nil, fmt.Errorf("gzip: invalid compression level: %d", level) - } - z := new(Writer) - z.init(w, level) - return z, nil -} - -func (z *Writer) init(w io.Writer, level int) { - compressor := z.compressor - if level != StatelessCompression { - if compressor != nil { - compressor.Reset(w) - } - } - - *z = Writer{ - Header: Header{ - OS: 255, // unknown - }, - w: w, - level: level, - compressor: compressor, - } -} - -// Reset discards the Writer z's state and makes it equivalent to the -// result of its original state from NewWriter or NewWriterLevel, but -// writing to w instead. This permits reusing a Writer rather than -// allocating a new one. -func (z *Writer) Reset(w io.Writer) { - z.init(w, z.level) -} - -// writeBytes writes a length-prefixed byte slice to z.w. -func (z *Writer) writeBytes(b []byte) error { - if len(b) > 0xffff { - return errors.New("gzip.Write: Extra data is too large") - } - le.PutUint16(z.buf[:2], uint16(len(b))) - _, err := z.w.Write(z.buf[:2]) - if err != nil { - return err - } - _, err = z.w.Write(b) - return err -} - -// writeString writes a UTF-8 string s in GZIP's format to z.w. -// GZIP (RFC 1952) specifies that strings are NUL-terminated ISO 8859-1 (Latin-1). -func (z *Writer) writeString(s string) (err error) { - // GZIP stores Latin-1 strings; error if non-Latin-1; convert if non-ASCII. - needconv := false - for _, v := range s { - if v == 0 || v > 0xff { - return errors.New("gzip.Write: non-Latin-1 header string") - } - if v > 0x7f { - needconv = true - } - } - if needconv { - b := make([]byte, 0, len(s)) - for _, v := range s { - b = append(b, byte(v)) - } - _, err = z.w.Write(b) - } else { - _, err = io.WriteString(z.w, s) - } - if err != nil { - return err - } - // GZIP strings are NUL-terminated. - z.buf[0] = 0 - _, err = z.w.Write(z.buf[:1]) - return err -} - -// Write writes a compressed form of p to the underlying io.Writer. The -// compressed bytes are not necessarily flushed until the Writer is closed. -func (z *Writer) Write(p []byte) (int, error) { - if z.err != nil { - return 0, z.err - } - var n int - // Write the GZIP header lazily. - if !z.wroteHeader { - z.wroteHeader = true - z.buf[0] = gzipID1 - z.buf[1] = gzipID2 - z.buf[2] = gzipDeflate - z.buf[3] = 0 - if z.Extra != nil { - z.buf[3] |= 0x04 - } - if z.Name != "" { - z.buf[3] |= 0x08 - } - if z.Comment != "" { - z.buf[3] |= 0x10 - } - le.PutUint32(z.buf[4:8], uint32(z.ModTime.Unix())) - if z.level == BestCompression { - z.buf[8] = 2 - } else if z.level == BestSpeed { - z.buf[8] = 4 - } else { - z.buf[8] = 0 - } - z.buf[9] = z.OS - n, z.err = z.w.Write(z.buf[:10]) - if z.err != nil { - return n, z.err - } - if z.Extra != nil { - z.err = z.writeBytes(z.Extra) - if z.err != nil { - return n, z.err - } - } - if z.Name != "" { - z.err = z.writeString(z.Name) - if z.err != nil { - return n, z.err - } - } - if z.Comment != "" { - z.err = z.writeString(z.Comment) - if z.err != nil { - return n, z.err - } - } - - if z.compressor == nil && z.level != StatelessCompression { - z.compressor, _ = flate.NewWriter(z.w, z.level) - } - } - z.size += uint32(len(p)) - z.digest = crc32.Update(z.digest, crc32.IEEETable, p) - if z.level == StatelessCompression { - return len(p), flate.StatelessDeflate(z.w, p, false, nil) - } - n, z.err = z.compressor.Write(p) - return n, z.err -} - -// Flush flushes any pending compressed data to the underlying writer. -// -// It is useful mainly in compressed network protocols, to ensure that -// a remote reader has enough data to reconstruct a packet. Flush does -// not return until the data has been written. If the underlying -// writer returns an error, Flush returns that error. -// -// In the terminology of the zlib library, Flush is equivalent to Z_SYNC_FLUSH. -func (z *Writer) Flush() error { - if z.err != nil { - return z.err - } - if z.closed || z.level == StatelessCompression { - return nil - } - if !z.wroteHeader { - z.Write(nil) - if z.err != nil { - return z.err - } - } - z.err = z.compressor.Flush() - return z.err -} - -// Close closes the Writer, flushing any unwritten data to the underlying -// io.Writer, but does not close the underlying io.Writer. -func (z *Writer) Close() error { - if z.err != nil { - return z.err - } - if z.closed { - return nil - } - z.closed = true - if !z.wroteHeader { - z.Write(nil) - if z.err != nil { - return z.err - } - } - if z.level == StatelessCompression { - z.err = flate.StatelessDeflate(z.w, nil, true, nil) - } else { - z.err = z.compressor.Close() - } - if z.err != nil { - return z.err - } - le.PutUint32(z.buf[:4], z.digest) - le.PutUint32(z.buf[4:8], z.size) - _, z.err = z.w.Write(z.buf[:8]) - return z.err -} diff --git a/vendor/github.com/klauspost/compress/huff0/README.md b/vendor/github.com/klauspost/compress/huff0/README.md index e12da4db2f..0a8448ce9f 100644 --- a/vendor/github.com/klauspost/compress/huff0/README.md +++ b/vendor/github.com/klauspost/compress/huff0/README.md @@ -12,6 +12,8 @@ but it can be used as a secondary step to compressors (like Snappy) that does no * [Godoc documentation](https://godoc.org/github.com/klauspost/compress/huff0) +THIS PACKAGE IS NOT CONSIDERED STABLE AND API OR ENCODING MAY CHANGE IN THE FUTURE. + ## News * Mar 2018: First implementation released. Consider this beta software for now. @@ -73,8 +75,6 @@ which can be given to the decompressor. Decompressing is done by calling the [`Decompress1X`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch.Decompress1X) or [`Decompress4X`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch.Decompress4X) function. -For concurrently decompressing content with a fixed table a stateless [`Decoder`](https://godoc.org/github.com/klauspost/compress/huff0#Decoder) can be requested which will remain correct as long as the scratch is unchanged. The capacity of the provided slice indicates the expected output size. - You must provide the output from the compression stage, at exactly the size you got back. If you receive an error back your input was likely corrupted. @@ -84,4 +84,4 @@ There are no integrity checks, so relying on errors from the decompressor does n # Contributing Contributions are always welcome. Be aware that adding public functions will require good justification and breaking -changes will likely not be accepted. If in doubt open an issue before writing the PR. +changes will likely not be accepted. If in doubt open an issue before writing the PR. \ No newline at end of file diff --git a/vendor/github.com/klauspost/compress/huff0/bitreader.go b/vendor/github.com/klauspost/compress/huff0/bitreader.go index a4979e8868..7d0903c701 100644 --- a/vendor/github.com/klauspost/compress/huff0/bitreader.go +++ b/vendor/github.com/klauspost/compress/huff0/bitreader.go @@ -6,7 +6,6 @@ package huff0 import ( - "encoding/binary" "errors" "io" ) @@ -35,16 +34,29 @@ func (b *bitReader) init(in []byte) error { } b.bitsRead = 64 b.value = 0 - if len(in) >= 8 { - b.fillFastStart() - } else { - b.fill() - b.fill() - } + b.fill() + b.fill() b.bitsRead += 8 - uint8(highBit32(uint32(v))) return nil } +// getBits will return n bits. n can be 0. +func (b *bitReader) getBits(n uint8) uint16 { + if n == 0 || b.bitsRead >= 64 { + return 0 + } + return b.getBitsFast(n) +} + +// getBitsFast requires that at least one bit is requested every time. +// There are no checks if the buffer is filled. +func (b *bitReader) getBitsFast(n uint8) uint16 { + const regMask = 64 - 1 + v := uint16((b.value << (b.bitsRead & regMask)) >> ((regMask + 1 - n) & regMask)) + b.bitsRead += n + return v +} + // peekBitsFast requires that at least one bit is requested every time. // There are no checks if the buffer is filled. func (b *bitReader) peekBitsFast(n uint8) uint16 { @@ -59,36 +71,21 @@ func (b *bitReader) fillFast() { if b.bitsRead < 32 { return } - - // 2 bounds checks. + // Do single re-slice to avoid bounds checks. v := b.in[b.off-4 : b.off] - v = v[:4] low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) b.value = (b.value << 32) | uint64(low) b.bitsRead -= 32 b.off -= 4 } -func (b *bitReader) advance(n uint8) { - b.bitsRead += n -} - -// fillFastStart() assumes the bitreader is empty and there is at least 8 bytes to read. -func (b *bitReader) fillFastStart() { - // Do single re-slice to avoid bounds checks. - b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) - b.bitsRead = 0 - b.off -= 8 -} - // fill() will make sure at least 32 bits are available. func (b *bitReader) fill() { if b.bitsRead < 32 { return } if b.off > 4 { - v := b.in[b.off-4:] - v = v[:4] + v := b.in[b.off-4 : b.off] low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) b.value = (b.value << 32) | uint64(low) b.bitsRead -= 32 @@ -116,214 +113,3 @@ func (b *bitReader) close() error { } return nil } - -// bitReader reads a bitstream in reverse. -// The last set bit indicates the start of the stream and is used -// for aligning the input. -type bitReaderBytes struct { - in []byte - off uint // next byte to read is at in[off - 1] - value uint64 - bitsRead uint8 -} - -// init initializes and resets the bit reader. -func (b *bitReaderBytes) init(in []byte) error { - if len(in) < 1 { - return errors.New("corrupt stream: too short") - } - b.in = in - b.off = uint(len(in)) - // The highest bit of the last byte indicates where to start - v := in[len(in)-1] - if v == 0 { - return errors.New("corrupt stream, did not find end of stream") - } - b.bitsRead = 64 - b.value = 0 - if len(in) >= 8 { - b.fillFastStart() - } else { - b.fill() - b.fill() - } - b.advance(8 - uint8(highBit32(uint32(v)))) - return nil -} - -// peekBitsFast requires that at least one bit is requested every time. -// There are no checks if the buffer is filled. -func (b *bitReaderBytes) peekByteFast() uint8 { - got := uint8(b.value >> 56) - return got -} - -func (b *bitReaderBytes) advance(n uint8) { - b.bitsRead += n - b.value <<= n & 63 -} - -// fillFast() will make sure at least 32 bits are available. -// There must be at least 4 bytes available. -func (b *bitReaderBytes) fillFast() { - if b.bitsRead < 32 { - return - } - - // 2 bounds checks. - v := b.in[b.off-4 : b.off] - v = v[:4] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - b.value |= uint64(low) << (b.bitsRead - 32) - b.bitsRead -= 32 - b.off -= 4 -} - -// fillFastStart() assumes the bitReaderBytes is empty and there is at least 8 bytes to read. -func (b *bitReaderBytes) fillFastStart() { - // Do single re-slice to avoid bounds checks. - b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) - b.bitsRead = 0 - b.off -= 8 -} - -// fill() will make sure at least 32 bits are available. -func (b *bitReaderBytes) fill() { - if b.bitsRead < 32 { - return - } - if b.off > 4 { - v := b.in[b.off-4:] - v = v[:4] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - b.value |= uint64(low) << (b.bitsRead - 32) - b.bitsRead -= 32 - b.off -= 4 - return - } - for b.off > 0 { - b.value |= uint64(b.in[b.off-1]) << (b.bitsRead - 8) - b.bitsRead -= 8 - b.off-- - } -} - -// finished returns true if all bits have been read from the bit stream. -func (b *bitReaderBytes) finished() bool { - return b.off == 0 && b.bitsRead >= 64 -} - -// close the bitstream and returns an error if out-of-buffer reads occurred. -func (b *bitReaderBytes) close() error { - // Release reference. - b.in = nil - if b.bitsRead > 64 { - return io.ErrUnexpectedEOF - } - return nil -} - -// bitReaderShifted reads a bitstream in reverse. -// The last set bit indicates the start of the stream and is used -// for aligning the input. -type bitReaderShifted struct { - in []byte - off uint // next byte to read is at in[off - 1] - value uint64 - bitsRead uint8 -} - -// init initializes and resets the bit reader. -func (b *bitReaderShifted) init(in []byte) error { - if len(in) < 1 { - return errors.New("corrupt stream: too short") - } - b.in = in - b.off = uint(len(in)) - // The highest bit of the last byte indicates where to start - v := in[len(in)-1] - if v == 0 { - return errors.New("corrupt stream, did not find end of stream") - } - b.bitsRead = 64 - b.value = 0 - if len(in) >= 8 { - b.fillFastStart() - } else { - b.fill() - b.fill() - } - b.advance(8 - uint8(highBit32(uint32(v)))) - return nil -} - -// peekBitsFast requires that at least one bit is requested every time. -// There are no checks if the buffer is filled. -func (b *bitReaderShifted) peekBitsFast(n uint8) uint16 { - return uint16(b.value >> ((64 - n) & 63)) -} - -func (b *bitReaderShifted) advance(n uint8) { - b.bitsRead += n - b.value <<= n & 63 -} - -// fillFast() will make sure at least 32 bits are available. -// There must be at least 4 bytes available. -func (b *bitReaderShifted) fillFast() { - if b.bitsRead < 32 { - return - } - - // 2 bounds checks. - v := b.in[b.off-4 : b.off] - v = v[:4] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - b.value |= uint64(low) << ((b.bitsRead - 32) & 63) - b.bitsRead -= 32 - b.off -= 4 -} - -// fillFastStart() assumes the bitReaderShifted is empty and there is at least 8 bytes to read. -func (b *bitReaderShifted) fillFastStart() { - // Do single re-slice to avoid bounds checks. - b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) - b.bitsRead = 0 - b.off -= 8 -} - -// fill() will make sure at least 32 bits are available. -func (b *bitReaderShifted) fill() { - if b.bitsRead < 32 { - return - } - if b.off > 4 { - v := b.in[b.off-4:] - v = v[:4] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - b.value |= uint64(low) << ((b.bitsRead - 32) & 63) - b.bitsRead -= 32 - b.off -= 4 - return - } - for b.off > 0 { - b.value |= uint64(b.in[b.off-1]) << ((b.bitsRead - 8) & 63) - b.bitsRead -= 8 - b.off-- - } -} - -// finished returns true if all bits have been read from the bit stream. -func (b *bitReaderShifted) finished() bool { - return b.off == 0 && b.bitsRead >= 64 -} - -// close the bitstream and returns an error if out-of-buffer reads occurred. -func (b *bitReaderShifted) close() error { - // Release reference. - b.in = nil - if b.bitsRead > 64 { - return io.ErrUnexpectedEOF - } - return nil -} diff --git a/vendor/github.com/klauspost/compress/huff0/decompress.go b/vendor/github.com/klauspost/compress/huff0/decompress.go index a03b2634af..97ae66a4ac 100644 --- a/vendor/github.com/klauspost/compress/huff0/decompress.go +++ b/vendor/github.com/klauspost/compress/huff0/decompress.go @@ -25,9 +25,6 @@ type dEntryDouble struct { len uint8 } -// Uses special code for all tables that are < 8 bits. -const use8BitTables = true - // ReadTable will read a table from the input. // The size of the input may be larger than the table definition. // Any content remaining after the table definition will be returned. @@ -86,7 +83,6 @@ func ReadTable(in []byte, s *Scratch) (s2 *Scratch, remain []byte, err error) { } v2 := v & 15 rankStats[v2]++ - // (1 << (v2-1)) is slower since the compiler cannot prove that v2 isn't 0. weightTotal += (1 << v2) >> 1 } if weightTotal == 0 { @@ -146,14 +142,12 @@ func ReadTable(in []byte, s *Scratch) (s2 *Scratch, remain []byte, err error) { d := dEntrySingle{ entry: uint16(s.actualTableLog+1-w) | (uint16(n) << 8), } - rank := &rankStats[w] - single := s.dt.single[*rank : *rank+length] + single := s.dt.single[rankStats[w] : rankStats[w]+length] for i := range single { single[i] = d } - *rank += length + rankStats[w] += length } - return s, in, nil } @@ -161,905 +155,237 @@ func ReadTable(in []byte, s *Scratch) (s2 *Scratch, remain []byte, err error) { // The length of the supplied input must match the end of a block exactly. // Before this is called, the table must be initialized with ReadTable unless // the encoder re-used the table. -// deprecated: Use the stateless Decoder() to get a concurrent version. func (s *Scratch) Decompress1X(in []byte) (out []byte, err error) { - if cap(s.Out) < s.MaxDecodedSize { - s.Out = make([]byte, s.MaxDecodedSize) - } - s.Out = s.Out[:0:s.MaxDecodedSize] - s.Out, err = s.Decoder().Decompress1X(s.Out, in) - return s.Out, err -} - -// Decompress4X will decompress a 4X encoded stream. -// Before this is called, the table must be initialized with ReadTable unless -// the encoder re-used the table. -// The length of the supplied input must match the end of a block exactly. -// The destination size of the uncompressed data must be known and provided. -// deprecated: Use the stateless Decoder() to get a concurrent version. -func (s *Scratch) Decompress4X(in []byte, dstSize int) (out []byte, err error) { - if dstSize > s.MaxDecodedSize { - return nil, ErrMaxDecodedSizeExceeded - } - if cap(s.Out) < dstSize { - s.Out = make([]byte, s.MaxDecodedSize) + if len(s.dt.single) == 0 { + return nil, errors.New("no table loaded") } - s.Out = s.Out[:0:dstSize] - s.Out, err = s.Decoder().Decompress4X(s.Out, in) - return s.Out, err -} - -// Decoder will return a stateless decoder that can be used by multiple -// decompressors concurrently. -// Before this is called, the table must be initialized with ReadTable. -// The Decoder is still linked to the scratch buffer so that cannot be reused. -// However, it is safe to discard the scratch. -func (s *Scratch) Decoder() *Decoder { - return &Decoder{ - dt: s.dt, - actualTableLog: s.actualTableLog, + var br bitReader + err = br.init(in) + if err != nil { + return nil, err } -} - -// Decoder provides stateless decoding. -type Decoder struct { - dt dTable - actualTableLog uint8 -} + s.Out = s.Out[:0] -// Decompress1X will decompress a 1X encoded stream. -// The cap of the output buffer will be the maximum decompressed size. -// The length of the supplied input must match the end of a block exactly. -func (d *Decoder) Decompress1X(dst, src []byte) ([]byte, error) { - if len(d.dt.single) == 0 { - return nil, errors.New("no table loaded") - } - if use8BitTables && d.actualTableLog <= 8 { - return d.decompress1X8Bit(dst, src) + decode := func() byte { + val := br.peekBitsFast(s.actualTableLog) /* note : actualTableLog >= 1 */ + v := s.dt.single[val] + br.bitsRead += uint8(v.entry) + return uint8(v.entry >> 8) } - var br bitReaderShifted - err := br.init(src) - if err != nil { - return dst, err + hasDec := func(v dEntrySingle) byte { + br.bitsRead += uint8(v.entry) + return uint8(v.entry >> 8) } - maxDecodedSize := cap(dst) - dst = dst[:0] // Avoid bounds check by always having full sized table. const tlSize = 1 << tableLogMax const tlMask = tlSize - 1 - dt := d.dt.single[:tlSize] + dt := s.dt.single[:tlSize] // Use temp table to avoid bound checks/append penalty. - var buf [256]byte + var tmp = s.huffWeight[:256] var off uint8 for br.off >= 8 { br.fillFast() - v := dt[br.peekBitsFast(d.actualTableLog)&tlMask] - br.advance(uint8(v.entry)) - buf[off+0] = uint8(v.entry >> 8) - - v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] - br.advance(uint8(v.entry)) - buf[off+1] = uint8(v.entry >> 8) - - // Refill + tmp[off+0] = hasDec(dt[br.peekBitsFast(s.actualTableLog)&tlMask]) + tmp[off+1] = hasDec(dt[br.peekBitsFast(s.actualTableLog)&tlMask]) br.fillFast() - - v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] - br.advance(uint8(v.entry)) - buf[off+2] = uint8(v.entry >> 8) - - v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] - br.advance(uint8(v.entry)) - buf[off+3] = uint8(v.entry >> 8) - + tmp[off+2] = hasDec(dt[br.peekBitsFast(s.actualTableLog)&tlMask]) + tmp[off+3] = hasDec(dt[br.peekBitsFast(s.actualTableLog)&tlMask]) off += 4 if off == 0 { - if len(dst)+256 > maxDecodedSize { + if len(s.Out)+256 > s.MaxDecodedSize { br.close() return nil, ErrMaxDecodedSizeExceeded } - dst = append(dst, buf[:]...) + s.Out = append(s.Out, tmp...) } } - if len(dst)+int(off) > maxDecodedSize { + if len(s.Out)+int(off) > s.MaxDecodedSize { br.close() return nil, ErrMaxDecodedSizeExceeded } - dst = append(dst, buf[:off]...) + s.Out = append(s.Out, tmp[:off]...) - // br < 8, so uint8 is fine - bitsLeft := uint8(br.off)*8 + 64 - br.bitsRead - for bitsLeft > 0 { + for !br.finished() { br.fill() - if false && br.bitsRead >= 32 { - if br.off >= 4 { - v := br.in[br.off-4:] - v = v[:4] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - br.value = (br.value << 32) | uint64(low) - br.bitsRead -= 32 - br.off -= 4 - } else { - for br.off > 0 { - br.value = (br.value << 8) | uint64(br.in[br.off-1]) - br.bitsRead -= 8 - br.off-- - } - } - } - if len(dst) >= maxDecodedSize { - br.close() - return nil, ErrMaxDecodedSizeExceeded - } - v := d.dt.single[br.peekBitsFast(d.actualTableLog)&tlMask] - nBits := uint8(v.entry) - br.advance(nBits) - bitsLeft -= nBits - dst = append(dst, uint8(v.entry>>8)) - } - return dst, br.close() -} - -// decompress1X8Bit will decompress a 1X encoded stream with tablelog <= 8. -// The cap of the output buffer will be the maximum decompressed size. -// The length of the supplied input must match the end of a block exactly. -func (d *Decoder) decompress1X8Bit(dst, src []byte) ([]byte, error) { - if d.actualTableLog == 8 { - return d.decompress1X8BitExactly(dst, src) - } - var br bitReaderBytes - err := br.init(src) - if err != nil { - return dst, err - } - maxDecodedSize := cap(dst) - dst = dst[:0] - - // Avoid bounds check by always having full sized table. - dt := d.dt.single[:256] - - // Use temp table to avoid bound checks/append penalty. - var buf [256]byte - var off uint8 - - shift := (8 - d.actualTableLog) & 7 - - //fmt.Printf("mask: %b, tl:%d\n", mask, d.actualTableLog) - for br.off >= 4 { - br.fillFast() - v := dt[br.peekByteFast()>>shift] - br.advance(uint8(v.entry)) - buf[off+0] = uint8(v.entry >> 8) - - v = dt[br.peekByteFast()>>shift] - br.advance(uint8(v.entry)) - buf[off+1] = uint8(v.entry >> 8) - - v = dt[br.peekByteFast()>>shift] - br.advance(uint8(v.entry)) - buf[off+2] = uint8(v.entry >> 8) - - v = dt[br.peekByteFast()>>shift] - br.advance(uint8(v.entry)) - buf[off+3] = uint8(v.entry >> 8) - - off += 4 - if off == 0 { - if len(dst)+256 > maxDecodedSize { - br.close() - return nil, ErrMaxDecodedSizeExceeded - } - dst = append(dst, buf[:]...) - } - } - - if len(dst)+int(off) > maxDecodedSize { - br.close() - return nil, ErrMaxDecodedSizeExceeded - } - dst = append(dst, buf[:off]...) - - // br < 4, so uint8 is fine - bitsLeft := int8(uint8(br.off)*8 + (64 - br.bitsRead)) - for bitsLeft > 0 { - if br.bitsRead >= 64-8 { - for br.off > 0 { - br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8) - br.bitsRead -= 8 - br.off-- - } - } - if len(dst) >= maxDecodedSize { - br.close() - return nil, ErrMaxDecodedSizeExceeded - } - v := dt[br.peekByteFast()>>shift] - nBits := uint8(v.entry) - br.advance(nBits) - bitsLeft -= int8(nBits) - dst = append(dst, uint8(v.entry>>8)) - } - return dst, br.close() -} - -// decompress1X8Bit will decompress a 1X encoded stream with tablelog <= 8. -// The cap of the output buffer will be the maximum decompressed size. -// The length of the supplied input must match the end of a block exactly. -func (d *Decoder) decompress1X8BitExactly(dst, src []byte) ([]byte, error) { - var br bitReaderBytes - err := br.init(src) - if err != nil { - return dst, err - } - maxDecodedSize := cap(dst) - dst = dst[:0] - - // Avoid bounds check by always having full sized table. - dt := d.dt.single[:256] - - // Use temp table to avoid bound checks/append penalty. - var buf [256]byte - var off uint8 - - const shift = 0 - - //fmt.Printf("mask: %b, tl:%d\n", mask, d.actualTableLog) - for br.off >= 4 { - br.fillFast() - v := dt[br.peekByteFast()>>shift] - br.advance(uint8(v.entry)) - buf[off+0] = uint8(v.entry >> 8) - - v = dt[br.peekByteFast()>>shift] - br.advance(uint8(v.entry)) - buf[off+1] = uint8(v.entry >> 8) - - v = dt[br.peekByteFast()>>shift] - br.advance(uint8(v.entry)) - buf[off+2] = uint8(v.entry >> 8) - - v = dt[br.peekByteFast()>>shift] - br.advance(uint8(v.entry)) - buf[off+3] = uint8(v.entry >> 8) - - off += 4 - if off == 0 { - if len(dst)+256 > maxDecodedSize { - br.close() - return nil, ErrMaxDecodedSizeExceeded - } - dst = append(dst, buf[:]...) - } - } - - if len(dst)+int(off) > maxDecodedSize { - br.close() - return nil, ErrMaxDecodedSizeExceeded - } - dst = append(dst, buf[:off]...) - - // br < 4, so uint8 is fine - bitsLeft := int8(uint8(br.off)*8 + (64 - br.bitsRead)) - for bitsLeft > 0 { - if br.bitsRead >= 64-8 { - for br.off > 0 { - br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8) - br.bitsRead -= 8 - br.off-- - } - } - if len(dst) >= maxDecodedSize { + if len(s.Out) >= s.MaxDecodedSize { br.close() return nil, ErrMaxDecodedSizeExceeded } - v := dt[br.peekByteFast()>>shift] - nBits := uint8(v.entry) - br.advance(nBits) - bitsLeft -= int8(nBits) - dst = append(dst, uint8(v.entry>>8)) + s.Out = append(s.Out, decode()) } - return dst, br.close() + return s.Out, br.close() } // Decompress4X will decompress a 4X encoded stream. +// Before this is called, the table must be initialized with ReadTable unless +// the encoder re-used the table. // The length of the supplied input must match the end of a block exactly. -// The *capacity* of the dst slice must match the destination size of -// the uncompressed data exactly. -func (d *Decoder) Decompress4X(dst, src []byte) ([]byte, error) { - if len(d.dt.single) == 0 { +// The destination size of the uncompressed data must be known and provided. +func (s *Scratch) Decompress4X(in []byte, dstSize int) (out []byte, err error) { + if len(s.dt.single) == 0 { return nil, errors.New("no table loaded") } - if len(src) < 6+(4*1) { + if len(in) < 6+(4*1) { return nil, errors.New("input too small") } - if use8BitTables && d.actualTableLog <= 8 { - return d.decompress4X8bit(dst, src) + if dstSize > s.MaxDecodedSize { + return nil, ErrMaxDecodedSizeExceeded } + // TODO: We do not detect when we overrun a buffer, except if the last one does. - var br [4]bitReaderShifted + var br [4]bitReader start := 6 for i := 0; i < 3; i++ { - length := int(src[i*2]) | (int(src[i*2+1]) << 8) - if start+length >= len(src) { + length := int(in[i*2]) | (int(in[i*2+1]) << 8) + if start+length >= len(in) { return nil, errors.New("truncated input (or invalid offset)") } - err := br[i].init(src[start : start+length]) + err = br[i].init(in[start : start+length]) if err != nil { return nil, err } start += length } - err := br[3].init(src[start:]) + err = br[3].init(in[start:]) if err != nil { return nil, err } + // Prepare output + if cap(s.Out) < dstSize { + s.Out = make([]byte, 0, dstSize) + } + s.Out = s.Out[:dstSize] // destination, offset to match first output - dstSize := cap(dst) - dst = dst[:dstSize] - out := dst + dstOut := s.Out dstEvery := (dstSize + 3) / 4 const tlSize = 1 << tableLogMax const tlMask = tlSize - 1 - single := d.dt.single[:tlSize] + single := s.dt.single[:tlSize] + + decode := func(br *bitReader) byte { + val := br.peekBitsFast(s.actualTableLog) /* note : actualTableLog >= 1 */ + v := single[val&tlMask] + br.bitsRead += uint8(v.entry) + return uint8(v.entry >> 8) + } // Use temp table to avoid bound checks/append penalty. - var buf [256]byte + var tmp = s.huffWeight[:256] var off uint8 var decoded int // Decode 2 values from each decoder/loop. const bufoff = 256 / 4 +bigloop: for { - if br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4 { - break + for i := range br { + br := &br[i] + if br.off < 4 { + break bigloop + } + br.fillFast() } { const stream = 0 - const stream2 = 1 - br[stream].fillFast() - br[stream2].fillFast() - - val := br[stream].peekBitsFast(d.actualTableLog) + val := br[stream].peekBitsFast(s.actualTableLog) v := single[val&tlMask] - br[stream].advance(uint8(v.entry)) - buf[off+bufoff*stream] = uint8(v.entry >> 8) + br[stream].bitsRead += uint8(v.entry) - val2 := br[stream2].peekBitsFast(d.actualTableLog) + val2 := br[stream].peekBitsFast(s.actualTableLog) v2 := single[val2&tlMask] - br[stream2].advance(uint8(v2.entry)) - buf[off+bufoff*stream2] = uint8(v2.entry >> 8) - - val = br[stream].peekBitsFast(d.actualTableLog) - v = single[val&tlMask] - br[stream].advance(uint8(v.entry)) - buf[off+bufoff*stream+1] = uint8(v.entry >> 8) - - val2 = br[stream2].peekBitsFast(d.actualTableLog) - v2 = single[val2&tlMask] - br[stream2].advance(uint8(v2.entry)) - buf[off+bufoff*stream2+1] = uint8(v2.entry >> 8) + tmp[off+bufoff*stream+1] = uint8(v2.entry >> 8) + tmp[off+bufoff*stream] = uint8(v.entry >> 8) + br[stream].bitsRead += uint8(v2.entry) } { - const stream = 2 - const stream2 = 3 - br[stream].fillFast() - br[stream2].fillFast() - - val := br[stream].peekBitsFast(d.actualTableLog) + const stream = 1 + val := br[stream].peekBitsFast(s.actualTableLog) v := single[val&tlMask] - br[stream].advance(uint8(v.entry)) - buf[off+bufoff*stream] = uint8(v.entry >> 8) + br[stream].bitsRead += uint8(v.entry) - val2 := br[stream2].peekBitsFast(d.actualTableLog) + val2 := br[stream].peekBitsFast(s.actualTableLog) v2 := single[val2&tlMask] - br[stream2].advance(uint8(v2.entry)) - buf[off+bufoff*stream2] = uint8(v2.entry >> 8) - - val = br[stream].peekBitsFast(d.actualTableLog) - v = single[val&tlMask] - br[stream].advance(uint8(v.entry)) - buf[off+bufoff*stream+1] = uint8(v.entry >> 8) - - val2 = br[stream2].peekBitsFast(d.actualTableLog) - v2 = single[val2&tlMask] - br[stream2].advance(uint8(v2.entry)) - buf[off+bufoff*stream2+1] = uint8(v2.entry >> 8) - } - - off += 2 - - if off == bufoff { - if bufoff > dstEvery { - return nil, errors.New("corruption detected: stream overrun 1") - } - copy(out, buf[:bufoff]) - copy(out[dstEvery:], buf[bufoff:bufoff*2]) - copy(out[dstEvery*2:], buf[bufoff*2:bufoff*3]) - copy(out[dstEvery*3:], buf[bufoff*3:bufoff*4]) - off = 0 - out = out[bufoff:] - decoded += 256 - // There must at least be 3 buffers left. - if len(out) < dstEvery*3 { - return nil, errors.New("corruption detected: stream overrun 2") - } - } - } - if off > 0 { - ioff := int(off) - if len(out) < dstEvery*3+ioff { - return nil, errors.New("corruption detected: stream overrun 3") - } - copy(out, buf[:off]) - copy(out[dstEvery:dstEvery+ioff], buf[bufoff:bufoff*2]) - copy(out[dstEvery*2:dstEvery*2+ioff], buf[bufoff*2:bufoff*3]) - copy(out[dstEvery*3:dstEvery*3+ioff], buf[bufoff*3:bufoff*4]) - decoded += int(off) * 4 - out = out[off:] - } - - // Decode remaining. - for i := range br { - offset := dstEvery * i - br := &br[i] - bitsLeft := br.off*8 + uint(64-br.bitsRead) - for bitsLeft > 0 { - br.fill() - if false && br.bitsRead >= 32 { - if br.off >= 4 { - v := br.in[br.off-4:] - v = v[:4] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - br.value = (br.value << 32) | uint64(low) - br.bitsRead -= 32 - br.off -= 4 - } else { - for br.off > 0 { - br.value = (br.value << 8) | uint64(br.in[br.off-1]) - br.bitsRead -= 8 - br.off-- - } - } - } - // end inline... - if offset >= len(out) { - return nil, errors.New("corruption detected: stream overrun 4") - } - - // Read value and increment offset. - val := br.peekBitsFast(d.actualTableLog) - v := single[val&tlMask].entry - nBits := uint8(v) - br.advance(nBits) - bitsLeft -= uint(nBits) - out[offset] = uint8(v >> 8) - offset++ - } - decoded += offset - dstEvery*i - err = br.close() - if err != nil { - return nil, err - } - } - if dstSize != decoded { - return nil, errors.New("corruption detected: short output block") - } - return dst, nil -} - -// Decompress4X will decompress a 4X encoded stream. -// The length of the supplied input must match the end of a block exactly. -// The *capacity* of the dst slice must match the destination size of -// the uncompressed data exactly. -func (d *Decoder) decompress4X8bit(dst, src []byte) ([]byte, error) { - if d.actualTableLog == 8 { - return d.decompress4X8bitExactly(dst, src) - } - - var br [4]bitReaderBytes - start := 6 - for i := 0; i < 3; i++ { - length := int(src[i*2]) | (int(src[i*2+1]) << 8) - if start+length >= len(src) { - return nil, errors.New("truncated input (or invalid offset)") - } - err := br[i].init(src[start : start+length]) - if err != nil { - return nil, err - } - start += length - } - err := br[3].init(src[start:]) - if err != nil { - return nil, err - } - - // destination, offset to match first output - dstSize := cap(dst) - dst = dst[:dstSize] - out := dst - dstEvery := (dstSize + 3) / 4 - - shift := (8 - d.actualTableLog) & 7 - - const tlSize = 1 << 8 - const tlMask = tlSize - 1 - single := d.dt.single[:tlSize] - - // Use temp table to avoid bound checks/append penalty. - var buf [256]byte - var off uint8 - var decoded int - - // Decode 4 values from each decoder/loop. - const bufoff = 256 / 4 - for { - if br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4 { - break - } - - { - // Interleave 2 decodes. - const stream = 0 - const stream2 = 1 - br[stream].fillFast() - br[stream2].fillFast() - - v := single[br[stream].peekByteFast()>>shift].entry - buf[off+bufoff*stream] = uint8(v >> 8) - br[stream].advance(uint8(v)) - - v2 := single[br[stream2].peekByteFast()>>shift].entry - buf[off+bufoff*stream2] = uint8(v2 >> 8) - br[stream2].advance(uint8(v2)) - - v = single[br[stream].peekByteFast()>>shift].entry - buf[off+bufoff*stream+1] = uint8(v >> 8) - br[stream].advance(uint8(v)) - - v2 = single[br[stream2].peekByteFast()>>shift].entry - buf[off+bufoff*stream2+1] = uint8(v2 >> 8) - br[stream2].advance(uint8(v2)) - - v = single[br[stream].peekByteFast()>>shift].entry - buf[off+bufoff*stream+2] = uint8(v >> 8) - br[stream].advance(uint8(v)) - - v2 = single[br[stream2].peekByteFast()>>shift].entry - buf[off+bufoff*stream2+2] = uint8(v2 >> 8) - br[stream2].advance(uint8(v2)) - - v = single[br[stream].peekByteFast()>>shift].entry - buf[off+bufoff*stream+3] = uint8(v >> 8) - br[stream].advance(uint8(v)) - - v2 = single[br[stream2].peekByteFast()>>shift].entry - buf[off+bufoff*stream2+3] = uint8(v2 >> 8) - br[stream2].advance(uint8(v2)) + tmp[off+bufoff*stream+1] = uint8(v2.entry >> 8) + tmp[off+bufoff*stream] = uint8(v.entry >> 8) + br[stream].bitsRead += uint8(v2.entry) } { const stream = 2 - const stream2 = 3 - br[stream].fillFast() - br[stream2].fillFast() - - v := single[br[stream].peekByteFast()>>shift].entry - buf[off+bufoff*stream] = uint8(v >> 8) - br[stream].advance(uint8(v)) - - v2 := single[br[stream2].peekByteFast()>>shift].entry - buf[off+bufoff*stream2] = uint8(v2 >> 8) - br[stream2].advance(uint8(v2)) - - v = single[br[stream].peekByteFast()>>shift].entry - buf[off+bufoff*stream+1] = uint8(v >> 8) - br[stream].advance(uint8(v)) - - v2 = single[br[stream2].peekByteFast()>>shift].entry - buf[off+bufoff*stream2+1] = uint8(v2 >> 8) - br[stream2].advance(uint8(v2)) - - v = single[br[stream].peekByteFast()>>shift].entry - buf[off+bufoff*stream+2] = uint8(v >> 8) - br[stream].advance(uint8(v)) - - v2 = single[br[stream2].peekByteFast()>>shift].entry - buf[off+bufoff*stream2+2] = uint8(v2 >> 8) - br[stream2].advance(uint8(v2)) - - v = single[br[stream].peekByteFast()>>shift].entry - buf[off+bufoff*stream+3] = uint8(v >> 8) - br[stream].advance(uint8(v)) - - v2 = single[br[stream2].peekByteFast()>>shift].entry - buf[off+bufoff*stream2+3] = uint8(v2 >> 8) - br[stream2].advance(uint8(v2)) - } - - off += 4 - - if off == bufoff { - if bufoff > dstEvery { - return nil, errors.New("corruption detected: stream overrun 1") - } - copy(out, buf[:bufoff]) - copy(out[dstEvery:], buf[bufoff:bufoff*2]) - copy(out[dstEvery*2:], buf[bufoff*2:bufoff*3]) - copy(out[dstEvery*3:], buf[bufoff*3:bufoff*4]) - off = 0 - out = out[bufoff:] - decoded += 256 - // There must at least be 3 buffers left. - if len(out) < dstEvery*3 { - return nil, errors.New("corruption detected: stream overrun 2") - } - } - } - if off > 0 { - ioff := int(off) - if len(out) < dstEvery*3+ioff { - return nil, errors.New("corruption detected: stream overrun 3") - } - copy(out, buf[:off]) - copy(out[dstEvery:dstEvery+ioff], buf[bufoff:bufoff*2]) - copy(out[dstEvery*2:dstEvery*2+ioff], buf[bufoff*2:bufoff*3]) - copy(out[dstEvery*3:dstEvery*3+ioff], buf[bufoff*3:bufoff*4]) - decoded += int(off) * 4 - out = out[off:] - } - - // Decode remaining. - for i := range br { - offset := dstEvery * i - br := &br[i] - bitsLeft := int(br.off*8) + int(64-br.bitsRead) - for bitsLeft > 0 { - if br.finished() { - return nil, io.ErrUnexpectedEOF - } - if br.bitsRead >= 56 { - if br.off >= 4 { - v := br.in[br.off-4:] - v = v[:4] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - br.value |= uint64(low) << (br.bitsRead - 32) - br.bitsRead -= 32 - br.off -= 4 - } else { - for br.off > 0 { - br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8) - br.bitsRead -= 8 - br.off-- - } - } - } - // end inline... - if offset >= len(out) { - return nil, errors.New("corruption detected: stream overrun 4") - } - - // Read value and increment offset. - v := single[br.peekByteFast()>>shift].entry - nBits := uint8(v) - br.advance(nBits) - bitsLeft -= int(nBits) - out[offset] = uint8(v >> 8) - offset++ - } - decoded += offset - dstEvery*i - err = br.close() - if err != nil { - return nil, err - } - } - if dstSize != decoded { - return nil, errors.New("corruption detected: short output block") - } - return dst, nil -} - -// Decompress4X will decompress a 4X encoded stream. -// The length of the supplied input must match the end of a block exactly. -// The *capacity* of the dst slice must match the destination size of -// the uncompressed data exactly. -func (d *Decoder) decompress4X8bitExactly(dst, src []byte) ([]byte, error) { - var br [4]bitReaderBytes - start := 6 - for i := 0; i < 3; i++ { - length := int(src[i*2]) | (int(src[i*2+1]) << 8) - if start+length >= len(src) { - return nil, errors.New("truncated input (or invalid offset)") - } - err := br[i].init(src[start : start+length]) - if err != nil { - return nil, err - } - start += length - } - err := br[3].init(src[start:]) - if err != nil { - return nil, err - } - - // destination, offset to match first output - dstSize := cap(dst) - dst = dst[:dstSize] - out := dst - dstEvery := (dstSize + 3) / 4 - - const shift = 0 - const tlSize = 1 << 8 - const tlMask = tlSize - 1 - single := d.dt.single[:tlSize] - - // Use temp table to avoid bound checks/append penalty. - var buf [256]byte - var off uint8 - var decoded int - - // Decode 4 values from each decoder/loop. - const bufoff = 256 / 4 - for { - if br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4 { - break - } - - { - // Interleave 2 decodes. - const stream = 0 - const stream2 = 1 - br[stream].fillFast() - br[stream2].fillFast() - - v := single[br[stream].peekByteFast()>>shift].entry - buf[off+bufoff*stream] = uint8(v >> 8) - br[stream].advance(uint8(v)) - - v2 := single[br[stream2].peekByteFast()>>shift].entry - buf[off+bufoff*stream2] = uint8(v2 >> 8) - br[stream2].advance(uint8(v2)) - - v = single[br[stream].peekByteFast()>>shift].entry - buf[off+bufoff*stream+1] = uint8(v >> 8) - br[stream].advance(uint8(v)) - - v2 = single[br[stream2].peekByteFast()>>shift].entry - buf[off+bufoff*stream2+1] = uint8(v2 >> 8) - br[stream2].advance(uint8(v2)) - - v = single[br[stream].peekByteFast()>>shift].entry - buf[off+bufoff*stream+2] = uint8(v >> 8) - br[stream].advance(uint8(v)) - - v2 = single[br[stream2].peekByteFast()>>shift].entry - buf[off+bufoff*stream2+2] = uint8(v2 >> 8) - br[stream2].advance(uint8(v2)) - - v = single[br[stream].peekByteFast()>>shift].entry - buf[off+bufoff*stream+3] = uint8(v >> 8) - br[stream].advance(uint8(v)) + val := br[stream].peekBitsFast(s.actualTableLog) + v := single[val&tlMask] + br[stream].bitsRead += uint8(v.entry) - v2 = single[br[stream2].peekByteFast()>>shift].entry - buf[off+bufoff*stream2+3] = uint8(v2 >> 8) - br[stream2].advance(uint8(v2)) + val2 := br[stream].peekBitsFast(s.actualTableLog) + v2 := single[val2&tlMask] + tmp[off+bufoff*stream+1] = uint8(v2.entry >> 8) + tmp[off+bufoff*stream] = uint8(v.entry >> 8) + br[stream].bitsRead += uint8(v2.entry) } { - const stream = 2 - const stream2 = 3 - br[stream].fillFast() - br[stream2].fillFast() - - v := single[br[stream].peekByteFast()>>shift].entry - buf[off+bufoff*stream] = uint8(v >> 8) - br[stream].advance(uint8(v)) - - v2 := single[br[stream2].peekByteFast()>>shift].entry - buf[off+bufoff*stream2] = uint8(v2 >> 8) - br[stream2].advance(uint8(v2)) - - v = single[br[stream].peekByteFast()>>shift].entry - buf[off+bufoff*stream+1] = uint8(v >> 8) - br[stream].advance(uint8(v)) - - v2 = single[br[stream2].peekByteFast()>>shift].entry - buf[off+bufoff*stream2+1] = uint8(v2 >> 8) - br[stream2].advance(uint8(v2)) - - v = single[br[stream].peekByteFast()>>shift].entry - buf[off+bufoff*stream+2] = uint8(v >> 8) - br[stream].advance(uint8(v)) - - v2 = single[br[stream2].peekByteFast()>>shift].entry - buf[off+bufoff*stream2+2] = uint8(v2 >> 8) - br[stream2].advance(uint8(v2)) - - v = single[br[stream].peekByteFast()>>shift].entry - buf[off+bufoff*stream+3] = uint8(v >> 8) - br[stream].advance(uint8(v)) + const stream = 3 + val := br[stream].peekBitsFast(s.actualTableLog) + v := single[val&tlMask] + br[stream].bitsRead += uint8(v.entry) - v2 = single[br[stream2].peekByteFast()>>shift].entry - buf[off+bufoff*stream2+3] = uint8(v2 >> 8) - br[stream2].advance(uint8(v2)) + val2 := br[stream].peekBitsFast(s.actualTableLog) + v2 := single[val2&tlMask] + tmp[off+bufoff*stream+1] = uint8(v2.entry >> 8) + tmp[off+bufoff*stream] = uint8(v.entry >> 8) + br[stream].bitsRead += uint8(v2.entry) } - off += 4 + off += 2 if off == bufoff { if bufoff > dstEvery { return nil, errors.New("corruption detected: stream overrun 1") } - copy(out, buf[:bufoff]) - copy(out[dstEvery:], buf[bufoff:bufoff*2]) - copy(out[dstEvery*2:], buf[bufoff*2:bufoff*3]) - copy(out[dstEvery*3:], buf[bufoff*3:bufoff*4]) + copy(dstOut, tmp[:bufoff]) + copy(dstOut[dstEvery:], tmp[bufoff:bufoff*2]) + copy(dstOut[dstEvery*2:], tmp[bufoff*2:bufoff*3]) + copy(dstOut[dstEvery*3:], tmp[bufoff*3:bufoff*4]) off = 0 - out = out[bufoff:] + dstOut = dstOut[bufoff:] decoded += 256 // There must at least be 3 buffers left. - if len(out) < dstEvery*3 { + if len(dstOut) < dstEvery*3 { return nil, errors.New("corruption detected: stream overrun 2") } } } if off > 0 { ioff := int(off) - if len(out) < dstEvery*3+ioff { + if len(dstOut) < dstEvery*3+ioff { return nil, errors.New("corruption detected: stream overrun 3") } - copy(out, buf[:off]) - copy(out[dstEvery:dstEvery+ioff], buf[bufoff:bufoff*2]) - copy(out[dstEvery*2:dstEvery*2+ioff], buf[bufoff*2:bufoff*3]) - copy(out[dstEvery*3:dstEvery*3+ioff], buf[bufoff*3:bufoff*4]) + copy(dstOut, tmp[:off]) + copy(dstOut[dstEvery:dstEvery+ioff], tmp[bufoff:bufoff*2]) + copy(dstOut[dstEvery*2:dstEvery*2+ioff], tmp[bufoff*2:bufoff*3]) + copy(dstOut[dstEvery*3:dstEvery*3+ioff], tmp[bufoff*3:bufoff*4]) decoded += int(off) * 4 - out = out[off:] + dstOut = dstOut[off:] } // Decode remaining. for i := range br { offset := dstEvery * i br := &br[i] - bitsLeft := int(br.off*8) + int(64-br.bitsRead) - for bitsLeft > 0 { - if br.finished() { - return nil, io.ErrUnexpectedEOF - } - if br.bitsRead >= 56 { - if br.off >= 4 { - v := br.in[br.off-4:] - v = v[:4] - low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) - br.value |= uint64(low) << (br.bitsRead - 32) - br.bitsRead -= 32 - br.off -= 4 - } else { - for br.off > 0 { - br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8) - br.bitsRead -= 8 - br.off-- - } - } - } - // end inline... - if offset >= len(out) { + for !br.finished() { + br.fill() + if offset >= len(dstOut) { return nil, errors.New("corruption detected: stream overrun 4") } - - // Read value and increment offset. - v := single[br.peekByteFast()>>shift].entry - nBits := uint8(v) - br.advance(nBits) - bitsLeft -= int(nBits) - out[offset] = uint8(v >> 8) + dstOut[offset] = decode(br) offset++ } decoded += offset - dstEvery*i @@ -1071,7 +397,7 @@ func (d *Decoder) decompress4X8bitExactly(dst, src []byte) ([]byte, error) { if dstSize != decoded { return nil, errors.New("corruption detected: short output block") } - return dst, nil + return s.Out, nil } // matches will compare a decoding table to a coding table. diff --git a/vendor/github.com/klauspost/compress/huff0/huff0.go b/vendor/github.com/klauspost/compress/huff0/huff0.go index 177d6c4ea0..53249df056 100644 --- a/vendor/github.com/klauspost/compress/huff0/huff0.go +++ b/vendor/github.com/klauspost/compress/huff0/huff0.go @@ -79,13 +79,6 @@ type Scratch struct { // Slice of the returned data. OutData []byte - // MaxDecodedSize will set the maximum allowed output size. - // This value will automatically be set to BlockSizeMax if not set. - // Decoders will return ErrMaxDecodedSizeExceeded is this limit is exceeded. - MaxDecodedSize int - - br byteReader - // MaxSymbolValue will override the maximum symbol value of the next block. MaxSymbolValue uint8 @@ -102,6 +95,12 @@ type Scratch struct { // If WantLogLess == 0 any improvement will do. WantLogLess uint8 + // MaxDecodedSize will set the maximum allowed output size. + // This value will automatically be set to BlockSizeMax if not set. + // Decoders will return ErrMaxDecodedSizeExceeded is this limit is exceeded. + MaxDecodedSize int + + br byteReader symbolLen uint16 // Length of active part of the symbol table. maxCount int // count of the most probable symbol clearCount bool // clear count diff --git a/vendor/github.com/klauspost/compress/zstd/README.md b/vendor/github.com/klauspost/compress/zstd/README.md index ac3640dc90..bc977a3023 100644 --- a/vendor/github.com/klauspost/compress/zstd/README.md +++ b/vendor/github.com/klauspost/compress/zstd/README.md @@ -5,9 +5,11 @@ It offers a very wide range of compression / speed trade-off, while being backed A high performance compression algorithm is implemented. For now focused on speed. This package provides [compression](#Compressor) to and [decompression](#Decompressor) of Zstandard content. -Note that custom dictionaries are only supported for decompression. +Note that custom dictionaries are not supported yet, so if your code relies on that, +you cannot use the package as-is. This package is pure Go and without use of "unsafe". +If a significant speedup can be achieved using "unsafe", it may be added as an option later. The `zstd` package is provided as open source software using a Go standard license. @@ -140,96 +142,80 @@ Using the Encoder for both a stream and individual blocks concurrently is safe. I have collected some speed examples to compare speed and compression against other compressors. * `file` is the input file. -* `out` is the compressor used. `zskp` is this package. `zstd` is the Datadog cgo library. `gzstd/gzkp` is gzip standard and this library. +* `out` is the compressor used. `zskp` is this package. `gzstd` is gzip standard library. `zstd` is the Datadog cgo library. * `level` is the compression level used. For `zskp` level 1 is "fastest", level 2 is "default". * `insize`/`outsize` is the input/output size. * `millis` is the number of milliseconds used for compression. * `mb/s` is megabytes (2^20 bytes) per second. ``` -Silesia Corpus: -http://sun.aei.polsl.pl/~sdeor/corpus/silesia.zip - -This package: -file out level insize outsize millis mb/s -silesia.tar zskp 1 211947520 73101992 643 313.87 -silesia.tar zskp 2 211947520 67504318 969 208.38 -silesia.tar zskp 3 211947520 65177448 1899 106.44 - -cgo zstd: -silesia.tar zstd 1 211947520 73605392 543 371.56 -silesia.tar zstd 3 211947520 66793289 864 233.68 -silesia.tar zstd 6 211947520 62916450 1913 105.66 +The test data for the Large Text Compression Benchmark is the first +10^9 bytes of the English Wikipedia dump on Mar. 3, 2006. +http://mattmahoney.net/dc/textdata.html -gzip, stdlib/this package: -silesia.tar gzstd 1 211947520 80007735 1654 122.21 -silesia.tar gzkp 1 211947520 80369488 1168 173.06 +file out level insize outsize millis mb/s +enwik9 zskp 1 1000000000 343833033 5840 163.30 +enwik9 zskp 2 1000000000 317822183 8449 112.87 +enwik9 gzstd 1 1000000000 382578136 13627 69.98 +enwik9 gzstd 3 1000000000 349139651 22344 42.68 +enwik9 zstd 1 1000000000 357416379 4838 197.12 +enwik9 zstd 3 1000000000 313734522 7556 126.21 GOB stream of binary data. Highly compressible. https://files.klauspost.com/compress/gob-stream.7z -file out level insize outsize millis mb/s -gob-stream zskp 1 1911399616 235022249 3088 590.30 -gob-stream zskp 2 1911399616 205669791 3786 481.34 -gob-stream zskp 3 1911399616 185792019 9324 195.48 -gob-stream zstd 1 1911399616 249810424 2637 691.26 -gob-stream zstd 3 1911399616 208192146 3490 522.31 -gob-stream zstd 6 1911399616 193632038 6687 272.56 -gob-stream gzstd 1 1911399616 357382641 10251 177.82 -gob-stream gzkp 1 1911399616 362156523 5695 320.08 - -The test data for the Large Text Compression Benchmark is the first -10^9 bytes of the English Wikipedia dump on Mar. 3, 2006. -http://mattmahoney.net/dc/textdata.html - -file out level insize outsize millis mb/s -enwik9 zskp 1 1000000000 343848582 3609 264.18 -enwik9 zskp 2 1000000000 317276632 5746 165.97 -enwik9 zskp 3 1000000000 294540704 11725 81.34 -enwik9 zstd 1 1000000000 358072021 3110 306.65 -enwik9 zstd 3 1000000000 313734672 4784 199.35 -enwik9 zstd 6 1000000000 295138875 10290 92.68 -enwik9 gzstd 1 1000000000 382578136 9604 99.30 -enwik9 gzkp 1 1000000000 383825945 6544 145.73 - -Highly compressible JSON file. -https://files.klauspost.com/compress/github-june-2days-2019.json.zst - -file out level insize outsize millis mb/s -github-june-2days-2019.json zskp 1 6273951764 699045015 10620 563.40 -github-june-2days-2019.json zskp 2 6273951764 617881763 11687 511.96 -github-june-2days-2019.json zskp 3 6273951764 537511906 29252 204.54 -github-june-2days-2019.json zstd 1 6273951764 766284037 8450 708.00 -github-june-2days-2019.json zstd 3 6273951764 661889476 10927 547.57 -github-june-2days-2019.json zstd 6 6273951764 642756859 22996 260.18 -github-june-2days-2019.json gzstd 1 6273951764 1164400847 29948 199.79 -github-june-2days-2019.json gzkp 1 6273951764 1128755542 19236 311.03 +file out level insize outsize millis mb/s +gob-stream zskp 1 1911399616 234981983 5100 357.42 +gob-stream zskp 2 1911399616 208674003 6698 272.15 +gob-stream gzstd 1 1911399616 357382641 14727 123.78 +gob-stream gzstd 3 1911399616 327835097 17005 107.19 +gob-stream zstd 1 1911399616 250787165 4075 447.22 +gob-stream zstd 3 1911399616 208191888 5511 330.77 + +Highly compressible JSON file. Similar to logs in a lot of ways. +https://files.klauspost.com/compress/adresser.001.gz + +file out level insize outsize millis mb/s +adresser.001 zskp 1 1073741824 18510122 1477 692.83 +adresser.001 zskp 2 1073741824 19831697 1705 600.59 +adresser.001 gzstd 1 1073741824 47755503 3079 332.47 +adresser.001 gzstd 3 1073741824 40052381 3051 335.63 +adresser.001 zstd 1 1073741824 16135896 994 1030.18 +adresser.001 zstd 3 1073741824 17794465 905 1131.49 VM Image, Linux mint with a few installed applications: https://files.klauspost.com/compress/rawstudio-mint14.7z -file out level insize outsize millis mb/s -rawstudio-mint14.tar zskp 1 8558382592 3667489370 20210 403.84 -rawstudio-mint14.tar zskp 2 8558382592 3364592300 31873 256.07 -rawstudio-mint14.tar zskp 3 8558382592 3224594213 71751 113.75 -rawstudio-mint14.tar zstd 1 8558382592 3609250104 17136 476.27 -rawstudio-mint14.tar zstd 3 8558382592 3341679997 29262 278.92 -rawstudio-mint14.tar zstd 6 8558382592 3235846406 77904 104.77 -rawstudio-mint14.tar gzstd 1 8558382592 3926257486 57722 141.40 -rawstudio-mint14.tar gzkp 1 8558382592 3970463184 41749 195.49 - -CSV data: -https://files.klauspost.com/compress/nyc-taxi-data-10M.csv.zst - -file out level insize outsize millis mb/s -nyc-taxi-data-10M.csv zskp 1 3325605752 641339945 8925 355.35 -nyc-taxi-data-10M.csv zskp 2 3325605752 591748091 11268 281.44 -nyc-taxi-data-10M.csv zskp 3 3325605752 538490114 19880 159.53 -nyc-taxi-data-10M.csv zstd 1 3325605752 687399637 8233 385.18 -nyc-taxi-data-10M.csv zstd 3 3325605752 598514411 10065 315.07 -nyc-taxi-data-10M.csv zstd 6 3325605752 570522953 20038 158.27 -nyc-taxi-data-10M.csv gzstd 1 3325605752 928656485 23876 132.83 -nyc-taxi-data-10M.csv gzkp 1 3325605752 924718719 16388 193.53 +file out level insize outsize millis mb/s +rawstudio-mint14.tar zskp 1 8558382592 3648168838 33398 244.38 +rawstudio-mint14.tar zskp 2 8558382592 3376721436 50962 160.16 +rawstudio-mint14.tar gzstd 1 8558382592 3926257486 84712 96.35 +rawstudio-mint14.tar gzstd 3 8558382592 3740711978 176344 46.28 +rawstudio-mint14.tar zstd 1 8558382592 3607859742 27903 292.51 +rawstudio-mint14.tar zstd 3 8558382592 3341710879 46700 174.77 + + +The test data is designed to test archivers in realistic backup scenarios. +http://mattmahoney.net/dc/10gb.html + +file out level insize outsize millis mb/s +10gb.tar zskp 1 10065157632 4883149814 45715 209.97 +10gb.tar zskp 2 10065157632 4638110010 60970 157.44 +10gb.tar gzstd 1 10065157632 5198296126 97769 98.18 +10gb.tar gzstd 3 10065157632 4932665487 313427 30.63 +10gb.tar zstd 1 10065157632 4940796535 40391 237.65 +10gb.tar zstd 3 10065157632 4638618579 52911 181.42 + +Silesia Corpus: +http://sun.aei.polsl.pl/~sdeor/corpus/silesia.zip + +file out level insize outsize millis mb/s +silesia.tar zskp 1 211947520 73025800 1108 182.26 +silesia.tar zskp 2 211947520 67674684 1599 126.41 +silesia.tar gzstd 1 211947520 80007735 2515 80.37 +silesia.tar gzstd 3 211947520 73133380 4259 47.45 +silesia.tar zstd 1 211947520 73513991 933 216.64 +silesia.tar zstd 3 211947520 66793301 1377 146.79 ``` ### Converters @@ -323,20 +309,6 @@ The decoder can be used for *concurrent* decompression of multiple buffers. It will only allow a certain number of concurrent operations to run. To tweak that yourself use the `WithDecoderConcurrency(n)` option when creating the decoder. -### Dictionaries - -Data compressed with [dictionaries](https://github.com/facebook/zstd#the-case-for-small-data-compression) can be decompressed. - -Dictionaries are added individually to Decoders. -Dictionaries are generated by the `zstd --train` command and contains an initial state for the decoder. -To add a dictionary use the `WithDecoderDicts(dicts ...[]byte)` option with the dictionary data. -Several dictionaries can be added at once. - -The dictionary will be used automatically for the data that specifies them. -A re-used Decoder will still contain the dictionaries registered. - -When registering multiple dictionaries with the same ID, the last one will be used. - ### Allocation-less operation The decoder has been designed to operate without allocations after a warmup. @@ -378,42 +350,36 @@ These are some examples of performance compared to [datadog cgo library](https:/ The first two are streaming decodes and the last are smaller inputs. ``` -BenchmarkDecoderSilesia-8 3 385000067 ns/op 550.51 MB/s 5498 B/op 8 allocs/op -BenchmarkDecoderSilesiaCgo-8 6 197666567 ns/op 1072.25 MB/s 270672 B/op 8 allocs/op - -BenchmarkDecoderEnwik9-8 1 2027001600 ns/op 493.34 MB/s 10496 B/op 18 allocs/op -BenchmarkDecoderEnwik9Cgo-8 2 979499200 ns/op 1020.93 MB/s 270672 B/op 8 allocs/op - -Concurrent performance: - -BenchmarkDecoder_DecodeAllParallel/kppkn.gtb.zst-16 28915 42469 ns/op 4340.07 MB/s 114 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/geo.protodata.zst-16 116505 9965 ns/op 11900.16 MB/s 16 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/plrabn12.txt.zst-16 8952 134272 ns/op 3588.70 MB/s 915 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/lcet10.txt.zst-16 11820 102538 ns/op 4161.90 MB/s 594 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/asyoulik.txt.zst-16 34782 34184 ns/op 3661.88 MB/s 60 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/alice29.txt.zst-16 27712 43447 ns/op 3500.58 MB/s 99 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/html_x_4.zst-16 62826 18750 ns/op 21845.10 MB/s 104 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/paper-100k.pdf.zst-16 631545 1794 ns/op 57078.74 MB/s 2 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/fireworks.jpeg.zst-16 1690140 712 ns/op 172938.13 MB/s 1 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/urls.10K.zst-16 10432 113593 ns/op 6180.73 MB/s 1143 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/html.zst-16 113206 10671 ns/op 9596.27 MB/s 15 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallel/comp-data.bin.zst-16 1530615 779 ns/op 5229.49 MB/s 0 B/op 0 allocs/op - -BenchmarkDecoder_DecodeAllParallelCgo/kppkn.gtb.zst-16 65217 16192 ns/op 11383.34 MB/s 46 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/geo.protodata.zst-16 292671 4039 ns/op 29363.19 MB/s 6 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/plrabn12.txt.zst-16 26314 46021 ns/op 10470.43 MB/s 293 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/lcet10.txt.zst-16 33897 34900 ns/op 12227.96 MB/s 205 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/asyoulik.txt.zst-16 104348 11433 ns/op 10949.01 MB/s 20 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/alice29.txt.zst-16 75949 15510 ns/op 9805.60 MB/s 32 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/html_x_4.zst-16 173910 6756 ns/op 60624.29 MB/s 37 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/paper-100k.pdf.zst-16 923076 1339 ns/op 76474.87 MB/s 1 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/fireworks.jpeg.zst-16 922920 1351 ns/op 91102.57 MB/s 2 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/urls.10K.zst-16 27649 43618 ns/op 16096.19 MB/s 407 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/html.zst-16 279073 4160 ns/op 24614.18 MB/s 6 B/op 0 allocs/op -BenchmarkDecoder_DecodeAllParallelCgo/comp-data.bin.zst-16 749938 1579 ns/op 2581.71 MB/s 0 B/op 0 allocs/op +BenchmarkDecoderSilesia-8 20 642550210 ns/op 329.85 MB/s 3101 B/op 8 allocs/op +BenchmarkDecoderSilesiaCgo-8 100 384930000 ns/op 550.61 MB/s 451878 B/op 9713 allocs/op + +BenchmarkDecoderEnwik9-2 10 3146000080 ns/op 317.86 MB/s 2649 B/op 9 allocs/op +BenchmarkDecoderEnwik9Cgo-2 20 1905900000 ns/op 524.69 MB/s 1125120 B/op 45785 allocs/op + +BenchmarkDecoder_DecodeAll/z000000.zst-8 200 7049994 ns/op 138.26 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000001.zst-8 100000 19560 ns/op 97.49 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000002.zst-8 5000 297599 ns/op 236.99 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000003.zst-8 2000 725502 ns/op 141.17 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000004.zst-8 200000 9314 ns/op 54.54 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000005.zst-8 10000 137500 ns/op 104.72 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000006.zst-8 500 2316009 ns/op 206.06 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000007.zst-8 20000 64499 ns/op 344.90 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000008.zst-8 50000 24900 ns/op 219.56 MB/s 40 B/op 2 allocs/op +BenchmarkDecoder_DecodeAll/z000009.zst-8 1000 2348999 ns/op 154.01 MB/s 40 B/op 2 allocs/op + +BenchmarkDecoder_DecodeAllCgo/z000000.zst-8 500 4268005 ns/op 228.38 MB/s 1228849 B/op 3 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000001.zst-8 100000 15250 ns/op 125.05 MB/s 2096 B/op 3 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000002.zst-8 10000 147399 ns/op 478.49 MB/s 73776 B/op 3 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000003.zst-8 5000 320798 ns/op 319.27 MB/s 139312 B/op 3 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000004.zst-8 200000 10004 ns/op 50.77 MB/s 560 B/op 3 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000005.zst-8 20000 73599 ns/op 195.64 MB/s 19120 B/op 3 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000006.zst-8 1000 1119003 ns/op 426.48 MB/s 557104 B/op 3 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000007.zst-8 20000 103450 ns/op 215.04 MB/s 71296 B/op 9 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000008.zst-8 100000 20130 ns/op 271.58 MB/s 6192 B/op 3 allocs/op +BenchmarkDecoder_DecodeAllCgo/z000009.zst-8 2000 1123500 ns/op 322.00 MB/s 368688 B/op 3 allocs/op ``` -This reflects the performance around May 2020, but this may be out of date. +This reflects the performance around May 2019, but this may be out of date. # Contributions diff --git a/vendor/github.com/klauspost/compress/zstd/bitreader.go b/vendor/github.com/klauspost/compress/zstd/bitreader.go index 8544585371..15d79d439f 100644 --- a/vendor/github.com/klauspost/compress/zstd/bitreader.go +++ b/vendor/github.com/klauspost/compress/zstd/bitreader.go @@ -5,7 +5,6 @@ package zstd import ( - "encoding/binary" "errors" "io" "math/bits" @@ -35,12 +34,8 @@ func (b *bitReader) init(in []byte) error { } b.bitsRead = 64 b.value = 0 - if len(in) >= 8 { - b.fillFastStart() - } else { - b.fill() - b.fill() - } + b.fill() + b.fill() b.bitsRead += 8 - uint8(highBits(uint32(v))) return nil } @@ -68,31 +63,21 @@ func (b *bitReader) fillFast() { if b.bitsRead < 32 { return } - // 2 bounds checks. - v := b.in[b.off-4:] - v = v[:4] + // Do single re-slice to avoid bounds checks. + v := b.in[b.off-4 : b.off] low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) b.value = (b.value << 32) | uint64(low) b.bitsRead -= 32 b.off -= 4 } -// fillFastStart() assumes the bitreader is empty and there is at least 8 bytes to read. -func (b *bitReader) fillFastStart() { - // Do single re-slice to avoid bounds checks. - b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) - b.bitsRead = 0 - b.off -= 8 -} - // fill() will make sure at least 32 bits are available. func (b *bitReader) fill() { if b.bitsRead < 32 { return } if b.off >= 4 { - v := b.in[b.off-4:] - v = v[:4] + v := b.in[b.off-4 : b.off] low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) b.value = (b.value << 32) | uint64(low) b.bitsRead -= 32 diff --git a/vendor/github.com/klauspost/compress/zstd/blockdec.go b/vendor/github.com/klauspost/compress/zstd/blockdec.go index c8ec6e3312..ed670bcc7a 100644 --- a/vendor/github.com/klauspost/compress/zstd/blockdec.go +++ b/vendor/github.com/klauspost/compress/zstd/blockdec.go @@ -75,29 +75,21 @@ type blockDec struct { // Window size of the block. WindowSize uint64 + Type blockType + RLESize uint32 + // Is this the last block of a frame? + Last bool + + // Use less memory + lowMem bool history chan *history input chan struct{} result chan decodeOutput sequenceBuf []seq + tmp [4]byte err error decWG sync.WaitGroup - - // Frame to use for singlethreaded decoding. - // Should not be used by the decoder itself since parent may be another frame. - localFrame *frameDec - - // Block is RLE, this is the size. - RLESize uint32 - tmp [4]byte - - Type blockType - - // Is this the last block of a frame? - Last bool - - // Use less memory - lowMem bool } func (b *blockDec) String() string { @@ -135,37 +127,25 @@ func (b *blockDec) reset(br byteBuffer, windowSize uint64) error { b.Type = blockType((bh >> 1) & 3) // find size. cSize := int(bh >> 3) - maxSize := maxBlockSize switch b.Type { case blockTypeReserved: return ErrReservedBlockType case blockTypeRLE: b.RLESize = uint32(cSize) - if b.lowMem { - maxSize = cSize - } cSize = 1 case blockTypeCompressed: if debug { println("Data size on stream:", cSize) } b.RLESize = 0 - maxSize = maxCompressedBlockSize - if windowSize < maxCompressedBlockSize && b.lowMem { - maxSize = int(windowSize) - } if cSize > maxCompressedBlockSize || uint64(cSize) > b.WindowSize { if debug { printf("compressed block too big: csize:%d block: %+v\n", uint64(cSize), b) } return ErrCompressedSizeTooBig } - case blockTypeRaw: - b.RLESize = 0 - // We do not need a destination for raw blocks. - maxSize = -1 default: - panic("Invalid block type") + b.RLESize = 0 } // Read block data. @@ -176,8 +156,8 @@ func (b *blockDec) reset(br byteBuffer, windowSize uint64) error { b.dataStorage = make([]byte, 0, maxBlockSize) } } - if cap(b.dst) <= maxSize { - b.dst = make([]byte, 0, maxSize+1) + if cap(b.dst) <= maxBlockSize { + b.dst = make([]byte, 0, maxBlockSize+1) } var err error b.data, err = br.readBig(cSize, b.dataStorage) @@ -465,22 +445,26 @@ func (b *blockDec) decodeCompressed(hist *history) error { if huff == nil { huff = &huff0.Scratch{} } + huff.Out = b.literalBuf[:0] huff, literals, err = huff0.ReadTable(literals, huff) if err != nil { println("reading huffman table:", err) return err } // Use our out buffer. + huff.Out = b.literalBuf[:0] + huff.MaxDecodedSize = litRegenSize if fourStreams { - literals, err = huff.Decoder().Decompress4X(b.literalBuf[:0:litRegenSize], literals) + literals, err = huff.Decompress4X(literals, litRegenSize) } else { - literals, err = huff.Decoder().Decompress1X(b.literalBuf[:0:litRegenSize], literals) + literals, err = huff.Decompress1X(literals) } if err != nil { println("decoding compressed literals:", err) return err } // Make sure we don't leak our literals buffer + huff.Out = nil if len(literals) != litRegenSize { return fmt.Errorf("literal output size mismatch want %d, got %d", litRegenSize, len(literals)) } @@ -631,12 +615,15 @@ func (b *blockDec) decodeCompressed(hist *history) error { var err error // Use our out buffer. huff = hist.huffTree + huff.Out = b.literalBuf[:0] + huff.MaxDecodedSize = litRegenSize if fourStreams { - literals, err = huff.Decoder().Decompress4X(b.literalBuf[:0:litRegenSize], literals) + literals, err = huff.Decompress4X(literals, litRegenSize) } else { - literals, err = huff.Decoder().Decompress1X(b.literalBuf[:0:litRegenSize], literals) + literals, err = huff.Decompress1X(literals) } // Make sure we don't leak our literals buffer + huff.Out = nil if err != nil { println("decompressing literals:", err) return err @@ -646,13 +633,12 @@ func (b *blockDec) decodeCompressed(hist *history) error { } } else { if hist.huffTree != nil && huff != nil { - if hist.dict == nil || hist.dict.litDec != hist.huffTree { - huffDecoderPool.Put(hist.huffTree) - } + huffDecoderPool.Put(hist.huffTree) hist.huffTree = nil } } if huff != nil { + huff.Out = nil hist.huffTree = huff } if debug { @@ -685,21 +671,12 @@ func (b *blockDec) decodeCompressed(hist *history) error { // If only recent offsets were not transferred, this would be an obvious win. // Also, if first 3 sequences don't reference recent offsets, all sequences can be decoded. - hbytes := hist.b - if len(hbytes) > hist.windowSize { - hbytes = hbytes[len(hbytes)-hist.windowSize:] - // We do not need history any more. - if hist.dict != nil { - hist.dict.content = nil - } - } - if err := seqs.initialize(br, hist, literals, b.dst); err != nil { println("initializing sequences:", err) return err } - err = seqs.decode(nSeqs, br, hbytes) + err = seqs.decode(nSeqs, br, hist.b) if err != nil { return err } diff --git a/vendor/github.com/klauspost/compress/zstd/blockenc.go b/vendor/github.com/klauspost/compress/zstd/blockenc.go index c584f6aabc..507757d525 100644 --- a/vendor/github.com/klauspost/compress/zstd/blockenc.go +++ b/vendor/github.com/klauspost/compress/zstd/blockenc.go @@ -444,9 +444,9 @@ func fuzzFseEncoder(data []byte) int { } // encode will encode the block and append the output in b.output. -func (b *blockEnc) encode(raw, rawAllLits bool) error { +func (b *blockEnc) encode(raw bool) error { if len(b.sequences) == 0 { - return b.encodeLits(rawAllLits) + return b.encodeLits(raw) } // We want some difference if len(b.literals) > (b.size - (b.size >> 5)) { @@ -806,7 +806,7 @@ func (b *blockEnc) genCodes() { mlH[v]++ if v > mlMax { mlMax = v - if debugAsserts && mlMax > maxMatchLengthSymbol { + if debug && mlMax > maxMatchLengthSymbol { panic(fmt.Errorf("mlMax > maxMatchLengthSymbol (%d), matchlen: %d", mlMax, seq.matchLen)) } } @@ -821,13 +821,13 @@ func (b *blockEnc) genCodes() { } return int(max) } - if debugAsserts && mlMax > maxMatchLengthSymbol { + if mlMax > maxMatchLengthSymbol { panic(fmt.Errorf("mlMax > maxMatchLengthSymbol (%d)", mlMax)) } - if debugAsserts && ofMax > maxOffsetBits { + if ofMax > maxOffsetBits { panic(fmt.Errorf("ofMax > maxOffsetBits (%d)", ofMax)) } - if debugAsserts && llMax > maxLiteralLengthSymbol { + if llMax > maxLiteralLengthSymbol { panic(fmt.Errorf("llMax > maxLiteralLengthSymbol (%d)", llMax)) } diff --git a/vendor/github.com/klauspost/compress/zstd/bytebuf.go b/vendor/github.com/klauspost/compress/zstd/bytebuf.go index 658ef78380..07321acb18 100644 --- a/vendor/github.com/klauspost/compress/zstd/bytebuf.go +++ b/vendor/github.com/klauspost/compress/zstd/bytebuf.go @@ -30,7 +30,7 @@ type byteBuffer interface { type byteBuf []byte func (b *byteBuf) readSmall(n int) []byte { - if debugAsserts && n > 8 { + if debug && n > 8 { panic(fmt.Errorf("small read > 8 (%d). use readBig", n)) } bb := *b @@ -82,7 +82,7 @@ type readerWrapper struct { } func (r *readerWrapper) readSmall(n int) []byte { - if debugAsserts && n > 8 { + if debug && n > 8 { panic(fmt.Errorf("small read > 8 (%d). use readBig", n)) } n2, err := io.ReadFull(r.r, r.tmp[:n]) diff --git a/vendor/github.com/klauspost/compress/zstd/bytereader.go b/vendor/github.com/klauspost/compress/zstd/bytereader.go index 2c4fca17fa..dc4378b640 100644 --- a/vendor/github.com/klauspost/compress/zstd/bytereader.go +++ b/vendor/github.com/klauspost/compress/zstd/bytereader.go @@ -31,8 +31,7 @@ func (b *byteReader) overread() bool { // Int32 returns a little endian int32 starting at current offset. func (b byteReader) Int32() int32 { - b2 := b.b[b.off:] - b2 = b2[:4] + b2 := b.b[b.off : b.off+4 : b.off+4] v3 := int32(b2[3]) v2 := int32(b2[2]) v1 := int32(b2[1]) @@ -56,20 +55,7 @@ func (b byteReader) Uint32() uint32 { } return v } - b2 := b.b[b.off:] - b2 = b2[:4] - v3 := uint32(b2[3]) - v2 := uint32(b2[2]) - v1 := uint32(b2[1]) - v0 := uint32(b2[0]) - return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24) -} - -// Uint32NC returns a little endian uint32 starting at current offset. -// The caller must be sure if there are at least 4 bytes left. -func (b byteReader) Uint32NC() uint32 { - b2 := b.b[b.off:] - b2 = b2[:4] + b2 := b.b[b.off : b.off+4 : b.off+4] v3 := uint32(b2[3]) v2 := uint32(b2[2]) v1 := uint32(b2[1]) diff --git a/vendor/github.com/klauspost/compress/zstd/decoder.go b/vendor/github.com/klauspost/compress/zstd/decoder.go index 66b51bf2d3..35a3cda914 100644 --- a/vendor/github.com/klauspost/compress/zstd/decoder.go +++ b/vendor/github.com/klauspost/compress/zstd/decoder.go @@ -23,15 +23,17 @@ type Decoder struct { // Unreferenced decoders, ready for use. decoders chan *blockDec + // Unreferenced decoders, ready for use. + frames chan *frameDec + // Streams ready to be decoded. stream chan decodeStream // Current read position used for Reader functionality. current decoderState - // Custom dictionaries. - // Always uses copies. - dicts map[uint32]dict + // Custom dictionaries + dicts map[uint32]struct{} // streamWg is the waitgroup for all streams streamWg sync.WaitGroup @@ -64,7 +66,7 @@ var ( // A Decoder can be used in two modes: // // 1) As a stream, or -// 2) For stateless decoding using DecodeAll. +// 2) For stateless decoding using DecodeAll or DecodeBuffer. // // Only a single stream can be decoded concurrently, but the same decoder // can run multiple concurrent stateless decodes. It is even possible to @@ -85,19 +87,12 @@ func NewReader(r io.Reader, opts ...DOption) (*Decoder, error) { d.current.output = make(chan decodeOutput, d.o.concurrent) d.current.flushed = true - // Transfer option dicts. - d.dicts = make(map[uint32]dict, len(d.o.dicts)) - for _, dc := range d.o.dicts { - d.dicts[dc.id] = dc - } - d.o.dicts = nil - // Create decoders d.decoders = make(chan *blockDec, d.o.concurrent) + d.frames = make(chan *frameDec, d.o.concurrent) for i := 0; i < d.o.concurrent; i++ { - dec := newBlockDec(d.o.lowMem) - dec.localFrame = newFrameDec(d.o) - d.decoders <- dec + d.frames <- newFrameDec(d.o) + d.decoders <- newBlockDec(d.o.lowMem) } if r == nil { @@ -174,12 +169,7 @@ func (d *Decoder) Reset(r io.Reader) error { println("*bytes.Buffer detected, doing sync decode, len:", bb.Len()) } b := bb.Bytes() - var dst []byte - if cap(d.current.b) > 0 { - dst = d.current.b - } - - dst, err := d.DecodeAll(b, dst[:0]) + dst, err := d.DecodeAll(b, nil) if err == nil { err = io.EOF } @@ -287,31 +277,23 @@ func (d *Decoder) DecodeAll(input, dst []byte) ([]byte, error) { } // Grab a block decoder and frame decoder. - block := <-d.decoders - frame := block.localFrame + block, frame := <-d.decoders, <-d.frames defer func() { if debug { printf("re-adding decoder: %p", block) } + d.decoders <- block frame.rawInput = nil frame.bBuf = nil - d.decoders <- block + d.frames <- frame }() frame.bBuf = input for { - frame.history.reset() err := frame.reset(&frame.bBuf) if err == io.EOF { return dst, nil } - if frame.DictionaryID != nil { - dict, ok := d.dicts[*frame.DictionaryID] - if !ok { - return nil, ErrUnknownDictionary - } - frame.history.setDict(&dict) - } if err != nil { return dst, err } @@ -333,7 +315,7 @@ func (d *Decoder) DecodeAll(input, dst []byte) ([]byte, error) { if size > 1<<20 { size = 1 << 20 } - dst = make([]byte, 0, size) + dst = make([]byte, 0, frame.WindowSize) } dst, err = frame.runDecoder(dst, block) @@ -474,19 +456,10 @@ func (d *Decoder) startStreamDecoder(inStream chan decodeStream) { br := readerWrapper{r: stream.r} decodeStream: for { - frame.history.reset() err := frame.reset(&br) if debug && err != nil { println("Frame decoder returned", err) } - if err == nil && frame.DictionaryID != nil { - dict, ok := d.dicts[*frame.DictionaryID] - if !ok { - err = ErrUnknownDictionary - } else { - frame.history.setDict(&dict) - } - } if err != nil { stream.output <- decodeOutput{ err: err, diff --git a/vendor/github.com/klauspost/compress/zstd/decoder_options.go b/vendor/github.com/klauspost/compress/zstd/decoder_options.go index 284d384492..2ac9cd2dd3 100644 --- a/vendor/github.com/klauspost/compress/zstd/decoder_options.go +++ b/vendor/github.com/klauspost/compress/zstd/decoder_options.go @@ -18,7 +18,6 @@ type decoderOptions struct { lowMem bool concurrent int maxDecodedSize uint64 - dicts []dict } func (o *decoderOptions) setDefault() { @@ -67,18 +66,3 @@ func WithDecoderMaxMemory(n uint64) DOption { return nil } } - -// WithDecoderDicts allows to register one or more dictionaries for the decoder. -// If several dictionaries with the same ID is provided the last one will be used. -func WithDecoderDicts(dicts ...[]byte) DOption { - return func(o *decoderOptions) error { - for _, b := range dicts { - d, err := loadDict(b) - if err != nil { - return err - } - o.dicts = append(o.dicts, *d) - } - return nil - } -} diff --git a/vendor/github.com/klauspost/compress/zstd/dict.go b/vendor/github.com/klauspost/compress/zstd/dict.go deleted file mode 100644 index 8eb6f6ba33..0000000000 --- a/vendor/github.com/klauspost/compress/zstd/dict.go +++ /dev/null @@ -1,104 +0,0 @@ -package zstd - -import ( - "bytes" - "encoding/binary" - "errors" - "fmt" - "io" - - "github.com/klauspost/compress/huff0" -) - -type dict struct { - id uint32 - - litDec *huff0.Scratch - llDec, ofDec, mlDec sequenceDec - offsets [3]int - content []byte -} - -var dictMagic = [4]byte{0x37, 0xa4, 0x30, 0xec} - -// Load a dictionary as described in -// https://github.com/facebook/zstd/blob/master/doc/zstd_compression_format.md#dictionary-format -func loadDict(b []byte) (*dict, error) { - // Check static field size. - if len(b) <= 8+(3*4) { - return nil, io.ErrUnexpectedEOF - } - d := dict{ - llDec: sequenceDec{fse: &fseDecoder{}}, - ofDec: sequenceDec{fse: &fseDecoder{}}, - mlDec: sequenceDec{fse: &fseDecoder{}}, - } - if !bytes.Equal(b[:4], dictMagic[:]) { - return nil, ErrMagicMismatch - } - d.id = binary.LittleEndian.Uint32(b[4:8]) - if d.id == 0 { - return nil, errors.New("dictionaries cannot have ID 0") - } - - // Read literal table - var err error - d.litDec, b, err = huff0.ReadTable(b[8:], nil) - if err != nil { - return nil, err - } - - br := byteReader{ - b: b, - off: 0, - } - readDec := func(i tableIndex, dec *fseDecoder) error { - if err := dec.readNCount(&br, uint16(maxTableSymbol[i])); err != nil { - return err - } - if br.overread() { - return io.ErrUnexpectedEOF - } - err = dec.transform(symbolTableX[i]) - if err != nil { - println("Transform table error:", err) - return err - } - if debug { - println("Read table ok", "symbolLen:", dec.symbolLen) - } - // Set decoders as predefined so they aren't reused. - dec.preDefined = true - return nil - } - - if err := readDec(tableOffsets, d.ofDec.fse); err != nil { - return nil, err - } - if err := readDec(tableMatchLengths, d.mlDec.fse); err != nil { - return nil, err - } - if err := readDec(tableLiteralLengths, d.llDec.fse); err != nil { - return nil, err - } - if br.remain() < 12 { - return nil, io.ErrUnexpectedEOF - } - - d.offsets[0] = int(br.Uint32()) - br.advance(4) - d.offsets[1] = int(br.Uint32()) - br.advance(4) - d.offsets[2] = int(br.Uint32()) - br.advance(4) - if d.offsets[0] <= 0 || d.offsets[1] <= 0 || d.offsets[2] <= 0 { - return nil, errors.New("invalid offset in dictionary") - } - d.content = make([]byte, br.remain()) - copy(d.content, br.unread()) - if d.offsets[0] > len(d.content) || d.offsets[1] > len(d.content) || d.offsets[2] > len(d.content) { - return nil, fmt.Errorf("initial offset bigger than dictionary content size %d, offsets: %v", len(d.content), d.offsets) - } - - return &d, nil -} diff --git a/vendor/github.com/klauspost/compress/zstd/enc_better.go b/vendor/github.com/klauspost/compress/zstd/enc_better.go deleted file mode 100644 index c120d90548..0000000000 --- a/vendor/github.com/klauspost/compress/zstd/enc_better.go +++ /dev/null @@ -1,518 +0,0 @@ -// Copyright 2019+ Klaus Post. All rights reserved. -// License information can be found in the LICENSE file. -// Based on work by Yann Collet, released under BSD License. - -package zstd - -import "fmt" - -const ( - betterLongTableBits = 19 // Bits used in the long match table - betterLongTableSize = 1 << betterLongTableBits // Size of the table - - // Note: Increasing the short table bits or making the hash shorter - // can actually lead to compression degradation since it will 'steal' more from the - // long match table and match offsets are quite big. - // This greatly depends on the type of input. - betterShortTableBits = 13 // Bits used in the short match table - betterShortTableSize = 1 << betterShortTableBits // Size of the table -) - -type prevEntry struct { - offset int32 - prev int32 -} - -// betterFastEncoder uses 2 tables, one for short matches (5 bytes) and one for long matches. -// The long match table contains the previous entry with the same hash, -// effectively making it a "chain" of length 2. -// When we find a long match we choose between the two values and select the longest. -// When we find a short match, after checking the long, we check if we can find a long at n+1 -// and that it is longer (lazy matching). -type betterFastEncoder struct { - fastBase - table [betterShortTableSize]tableEntry - longTable [betterLongTableSize]prevEntry -} - -// Encode improves compression... -func (e *betterFastEncoder) Encode(blk *blockEnc, src []byte) { - const ( - // Input margin is the number of bytes we read (8) - // and the maximum we will read ahead (2) - inputMargin = 8 + 2 - minNonLiteralBlockSize = 16 - ) - - // Protect against e.cur wraparound. - for e.cur >= bufferReset { - if len(e.hist) == 0 { - for i := range e.table[:] { - e.table[i] = tableEntry{} - } - for i := range e.longTable[:] { - e.longTable[i] = prevEntry{} - } - e.cur = e.maxMatchOff - break - } - // Shift down everything in the table that isn't already too far away. - minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff - for i := range e.table[:] { - v := e.table[i].offset - if v < minOff { - v = 0 - } else { - v = v - e.cur + e.maxMatchOff - } - e.table[i].offset = v - } - for i := range e.longTable[:] { - v := e.longTable[i].offset - v2 := e.longTable[i].prev - if v < minOff { - v = 0 - v2 = 0 - } else { - v = v - e.cur + e.maxMatchOff - if v2 < minOff { - v2 = 0 - } else { - v2 = v2 - e.cur + e.maxMatchOff - } - } - e.longTable[i] = prevEntry{ - offset: v, - prev: v2, - } - } - e.cur = e.maxMatchOff - break - } - - s := e.addBlock(src) - blk.size = len(src) - if len(src) < minNonLiteralBlockSize { - blk.extraLits = len(src) - blk.literals = blk.literals[:len(src)] - copy(blk.literals, src) - return - } - - // Override src - src = e.hist - sLimit := int32(len(src)) - inputMargin - // stepSize is the number of bytes to skip on every main loop iteration. - // It should be >= 1. - const stepSize = 1 - - const kSearchStrength = 9 - - // nextEmit is where in src the next emitLiteral should start from. - nextEmit := s - cv := load6432(src, s) - - // Relative offsets - offset1 := int32(blk.recentOffsets[0]) - offset2 := int32(blk.recentOffsets[1]) - - addLiterals := func(s *seq, until int32) { - if until == nextEmit { - return - } - blk.literals = append(blk.literals, src[nextEmit:until]...) - s.litLen = uint32(until - nextEmit) - } - if debug { - println("recent offsets:", blk.recentOffsets) - } - -encodeLoop: - for { - var t int32 - // We allow the encoder to optionally turn off repeat offsets across blocks - canRepeat := len(blk.sequences) > 2 - var matched int32 - - for { - if debugAsserts && canRepeat && offset1 == 0 { - panic("offset0 was 0") - } - - nextHashS := hash5(cv, betterShortTableBits) - nextHashL := hash8(cv, betterLongTableBits) - candidateL := e.longTable[nextHashL] - candidateS := e.table[nextHashS] - - const repOff = 1 - repIndex := s - offset1 + repOff - off := s + e.cur - e.longTable[nextHashL] = prevEntry{offset: off, prev: candidateL.offset} - e.table[nextHashS] = tableEntry{offset: off, val: uint32(cv)} - - if canRepeat { - if repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>(repOff*8)) { - // Consider history as well. - var seq seq - lenght := 4 + e.matchlen(s+4+repOff, repIndex+4, src) - - seq.matchLen = uint32(lenght - zstdMinMatch) - - // We might be able to match backwards. - // Extend as long as we can. - start := s + repOff - // We end the search early, so we don't risk 0 literals - // and have to do special offset treatment. - startLimit := nextEmit + 1 - - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } - for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { - repIndex-- - start-- - seq.matchLen++ - } - addLiterals(&seq, start) - - // rep 0 - seq.offset = 1 - if debugSequences { - println("repeat sequence", seq, "next s:", s) - } - blk.sequences = append(blk.sequences, seq) - - // Index match start+1 (long) -> s - 1 - index0 := s + repOff - s += lenght + repOff - - nextEmit = s - if s >= sLimit { - if debug { - println("repeat ended", s, lenght) - - } - break encodeLoop - } - // Index skipped... - for index0 < s-1 { - cv0 := load6432(src, index0) - cv1 := cv0 >> 8 - h0 := hash8(cv0, betterLongTableBits) - off := index0 + e.cur - e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} - e.table[hash5(cv1, betterShortTableBits)] = tableEntry{offset: off + 1, val: uint32(cv1)} - index0 += 2 - } - cv = load6432(src, s) - continue - } - const repOff2 = 1 - - // We deviate from the reference encoder and also check offset 2. - // Still slower and not much better, so disabled. - // repIndex = s - offset2 + repOff2 - if false && repIndex >= 0 && load6432(src, repIndex) == load6432(src, s+repOff) { - // Consider history as well. - var seq seq - lenght := 8 + e.matchlen(s+8+repOff2, repIndex+8, src) - - seq.matchLen = uint32(lenght - zstdMinMatch) - - // We might be able to match backwards. - // Extend as long as we can. - start := s + repOff2 - // We end the search early, so we don't risk 0 literals - // and have to do special offset treatment. - startLimit := nextEmit + 1 - - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } - for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { - repIndex-- - start-- - seq.matchLen++ - } - addLiterals(&seq, start) - - // rep 2 - seq.offset = 2 - if debugSequences { - println("repeat sequence 2", seq, "next s:", s) - } - blk.sequences = append(blk.sequences, seq) - - index0 := s + repOff2 - s += lenght + repOff2 - nextEmit = s - if s >= sLimit { - if debug { - println("repeat ended", s, lenght) - - } - break encodeLoop - } - - // Index skipped... - for index0 < s-1 { - cv0 := load6432(src, index0) - cv1 := cv0 >> 8 - h0 := hash8(cv0, betterLongTableBits) - off := index0 + e.cur - e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} - e.table[hash5(cv1, betterShortTableBits)] = tableEntry{offset: off + 1, val: uint32(cv1)} - index0 += 2 - } - cv = load6432(src, s) - // Swap offsets - offset1, offset2 = offset2, offset1 - continue - } - } - // Find the offsets of our two matches. - coffsetL := candidateL.offset - e.cur - coffsetLP := candidateL.prev - e.cur - - // Check if we have a long match. - if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) { - // Found a long match, at least 8 bytes. - matched = e.matchlen(s+8, coffsetL+8, src) + 8 - t = coffsetL - if debugAsserts && s <= t { - panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) - } - if debugAsserts && s-t > e.maxMatchOff { - panic("s - t >e.maxMatchOff") - } - if debugMatches { - println("long match") - } - - if s-coffsetLP < e.maxMatchOff && cv == load6432(src, coffsetLP) { - // Found a long match, at least 8 bytes. - prevMatch := e.matchlen(s+8, coffsetLP+8, src) + 8 - if prevMatch > matched { - matched = prevMatch - t = coffsetLP - } - if debugAsserts && s <= t { - panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) - } - if debugAsserts && s-t > e.maxMatchOff { - panic("s - t >e.maxMatchOff") - } - if debugMatches { - println("long match") - } - } - break - } - - // Check if we have a long match on prev. - if s-coffsetLP < e.maxMatchOff && cv == load6432(src, coffsetLP) { - // Found a long match, at least 8 bytes. - matched = e.matchlen(s+8, coffsetLP+8, src) + 8 - t = coffsetLP - if debugAsserts && s <= t { - panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) - } - if debugAsserts && s-t > e.maxMatchOff { - panic("s - t >e.maxMatchOff") - } - if debugMatches { - println("long match") - } - break - } - - coffsetS := candidateS.offset - e.cur - - // Check if we have a short match. - if s-coffsetS < e.maxMatchOff && uint32(cv) == candidateS.val { - // found a regular match - matched = e.matchlen(s+4, coffsetS+4, src) + 4 - - // See if we can find a long match at s+1 - const checkAt = 1 - cv := load6432(src, s+checkAt) - nextHashL = hash8(cv, betterLongTableBits) - candidateL = e.longTable[nextHashL] - coffsetL = candidateL.offset - e.cur - - // We can store it, since we have at least a 4 byte match. - e.longTable[nextHashL] = prevEntry{offset: s + checkAt + e.cur, prev: candidateL.offset} - if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) { - // Found a long match, at least 8 bytes. - matchedNext := e.matchlen(s+8+checkAt, coffsetL+8, src) + 8 - if matchedNext > matched { - t = coffsetL - s += checkAt - matched = matchedNext - if debugMatches { - println("long match (after short)") - } - break - } - } - - // Check prev long... - coffsetL = candidateL.prev - e.cur - if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) { - // Found a long match, at least 8 bytes. - matchedNext := e.matchlen(s+8+checkAt, coffsetL+8, src) + 8 - if matchedNext > matched { - t = coffsetL - s += checkAt - matched = matchedNext - if debugMatches { - println("prev long match (after short)") - } - break - } - } - t = coffsetS - if debugAsserts && s <= t { - panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) - } - if debugAsserts && s-t > e.maxMatchOff { - panic("s - t >e.maxMatchOff") - } - if debugAsserts && t < 0 { - panic("t<0") - } - if debugMatches { - println("short match") - } - break - } - - // No match found, move forward in input. - s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1)) - if s >= sLimit { - break encodeLoop - } - cv = load6432(src, s) - } - - // A 4-byte match has been found. Update recent offsets. - // We'll later see if more than 4 bytes. - offset2 = offset1 - offset1 = s - t - - if debugAsserts && s <= t { - panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) - } - - if debugAsserts && canRepeat && int(offset1) > len(src) { - panic("invalid offset") - } - - // Extend the n-byte match as long as possible. - l := matched - - // Extend backwards - tMin := s - e.maxMatchOff - if tMin < 0 { - tMin = 0 - } - for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { - s-- - t-- - l++ - } - - // Write our sequence - var seq seq - seq.litLen = uint32(s - nextEmit) - seq.matchLen = uint32(l - zstdMinMatch) - if seq.litLen > 0 { - blk.literals = append(blk.literals, src[nextEmit:s]...) - } - seq.offset = uint32(s-t) + 3 - s += l - if debugSequences { - println("sequence", seq, "next s:", s) - } - blk.sequences = append(blk.sequences, seq) - nextEmit = s - if s >= sLimit { - break encodeLoop - } - - // Index match start+1 (long) -> s - 1 - index0 := s - l + 1 - for index0 < s-1 { - cv0 := load6432(src, index0) - cv1 := cv0 >> 8 - h0 := hash8(cv0, betterLongTableBits) - off := index0 + e.cur - e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} - e.table[hash5(cv1, betterShortTableBits)] = tableEntry{offset: off + 1, val: uint32(cv1)} - index0 += 2 - } - - cv = load6432(src, s) - if !canRepeat { - continue - } - - // Check offset 2 - for { - o2 := s - offset2 - if load3232(src, o2) != uint32(cv) { - // Do regular search - break - } - - // Store this, since we have it. - nextHashS := hash5(cv, betterShortTableBits) - nextHashL := hash8(cv, betterLongTableBits) - - // We have at least 4 byte match. - // No need to check backwards. We come straight from a match - l := 4 + e.matchlen(s+4, o2+4, src) - - e.longTable[nextHashL] = prevEntry{offset: s + e.cur, prev: e.longTable[nextHashL].offset} - e.table[nextHashS] = tableEntry{offset: s + e.cur, val: uint32(cv)} - seq.matchLen = uint32(l) - zstdMinMatch - seq.litLen = 0 - - // Since litlen is always 0, this is offset 1. - seq.offset = 1 - s += l - nextEmit = s - if debugSequences { - println("sequence", seq, "next s:", s) - } - blk.sequences = append(blk.sequences, seq) - - // Swap offset 1 and 2. - offset1, offset2 = offset2, offset1 - if s >= sLimit { - // Finished - break encodeLoop - } - cv = load6432(src, s) - } - } - - if int(nextEmit) < len(src) { - blk.literals = append(blk.literals, src[nextEmit:]...) - blk.extraLits = len(src) - int(nextEmit) - } - blk.recentOffsets[0] = uint32(offset1) - blk.recentOffsets[1] = uint32(offset2) - if debug { - println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) - } -} - -// EncodeNoHist will encode a block with no history and no following blocks. -// Most notable difference is that src will not be copied for history and -// we do not need to check for max match length. -func (e *betterFastEncoder) EncodeNoHist(blk *blockEnc, src []byte) { - e.Encode(blk, src) -} diff --git a/vendor/github.com/klauspost/compress/zstd/enc_dfast.go b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go index 50276bcde7..ee3b09b02a 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_dfast.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go @@ -4,8 +4,6 @@ package zstd -import "fmt" - const ( dFastLongTableBits = 17 // Bits used in the long match table dFastLongTableSize = 1 << dFastLongTableBits // Size of the table @@ -31,7 +29,7 @@ func (e *doubleFastEncoder) Encode(blk *blockEnc, src []byte) { ) // Protect against e.cur wraparound. - for e.cur >= bufferReset { + for e.cur > (1<<30)+e.maxMatchOff { if len(e.hist) == 0 { for i := range e.table[:] { e.table[i] = tableEntry{} @@ -63,7 +61,6 @@ func (e *doubleFastEncoder) Encode(blk *blockEnc, src []byte) { e.longTable[i].offset = v } e.cur = e.maxMatchOff - break } s := e.addBlock(src) @@ -80,7 +77,10 @@ func (e *doubleFastEncoder) Encode(blk *blockEnc, src []byte) { sLimit := int32(len(src)) - inputMargin // stepSize is the number of bytes to skip on every main loop iteration. // It should be >= 1. - const stepSize = 1 + stepSize := int32(e.o.targetLength) + if stepSize == 0 { + stepSize++ + } const kSearchStrength = 8 @@ -110,7 +110,7 @@ encodeLoop: canRepeat := len(blk.sequences) > 2 for { - if debugAsserts && canRepeat && offset1 == 0 { + if debug && canRepeat && offset1 == 0 { panic("offset0 was 0") } @@ -169,6 +169,55 @@ encodeLoop: cv = load6432(src, s) continue } + const repOff2 = 1 + // We deviate from the reference encoder and also check offset 2. + // Slower and not consistently better, so disabled. + // repIndex = s - offset2 + repOff2 + if false && repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>(repOff2*8)) { + // Consider history as well. + var seq seq + lenght := 4 + e.matchlen(s+4+repOff2, repIndex+4, src) + + seq.matchLen = uint32(lenght - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + repOff2 + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 2 + seq.offset = 2 + if debugSequences { + println("repeat sequence 2", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + s += lenght + repOff2 + nextEmit = s + if s >= sLimit { + if debug { + println("repeat ended", s, lenght) + + } + break encodeLoop + } + cv = load6432(src, s) + // Swap offsets + offset1, offset2 = offset2, offset1 + continue + } } // Find the offsets of our two matches. coffsetL := s - (candidateL.offset - e.cur) @@ -180,10 +229,10 @@ encodeLoop: // Reference encoder checks all 8 bytes, we only check 4, // but the likelihood of both the first 4 bytes and the hash matching should be enough. t = candidateL.offset - e.cur - if debugAsserts && s <= t { - panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + if debug && s <= t { + panic("s <= t") } - if debugAsserts && s-t > e.maxMatchOff { + if debug && s-t > e.maxMatchOff { panic("s - t >e.maxMatchOff") } if debugMatches { @@ -217,13 +266,13 @@ encodeLoop: } t = candidateS.offset - e.cur - if debugAsserts && s <= t { - panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + if debug && s <= t { + panic("s <= t") } - if debugAsserts && s-t > e.maxMatchOff { + if debug && s-t > e.maxMatchOff { panic("s - t >e.maxMatchOff") } - if debugAsserts && t < 0 { + if debug && t < 0 { panic("t<0") } if debugMatches { @@ -245,11 +294,11 @@ encodeLoop: offset2 = offset1 offset1 = s - t - if debugAsserts && s <= t { - panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + if debug && s <= t { + panic("s <= t") } - if debugAsserts && canRepeat && int(offset1) > len(src) { + if debug && canRepeat && int(offset1) > len(src) { panic("invalid offset") } @@ -320,7 +369,7 @@ encodeLoop: } // Store this, since we have it. - nextHashS := hash5(cv, dFastShortTableBits) + nextHashS := hash5(cv1>>8, dFastShortTableBits) nextHashL := hash8(cv, dFastLongTableBits) // We have at least 4 byte match. @@ -375,7 +424,7 @@ func (e *doubleFastEncoder) EncodeNoHist(blk *blockEnc, src []byte) { ) // Protect against e.cur wraparound. - if e.cur >= bufferReset { + if e.cur > (1<<30)+e.maxMatchOff { for i := range e.table[:] { e.table[i] = tableEntry{} } @@ -398,7 +447,10 @@ func (e *doubleFastEncoder) EncodeNoHist(blk *blockEnc, src []byte) { sLimit := int32(len(src)) - inputMargin // stepSize is the number of bytes to skip on every main loop iteration. // It should be >= 1. - const stepSize = 1 + stepSize := int32(e.o.targetLength) + if stepSize == 0 { + stepSize++ + } const kSearchStrength = 8 @@ -493,10 +545,10 @@ encodeLoop: // Reference encoder checks all 8 bytes, we only check 4, // but the likelihood of both the first 4 bytes and the hash matching should be enough. t = candidateL.offset - e.cur - if debugAsserts && s <= t { - panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + if debug && s <= t { + panic("s <= t") } - if debugAsserts && s-t > e.maxMatchOff { + if debug && s-t > e.maxMatchOff { panic("s - t >e.maxMatchOff") } if debugMatches { @@ -530,13 +582,13 @@ encodeLoop: } t = candidateS.offset - e.cur - if debugAsserts && s <= t { - panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + if debug && s <= t { + panic("s <= t") } - if debugAsserts && s-t > e.maxMatchOff { + if debug && s-t > e.maxMatchOff { panic("s - t >e.maxMatchOff") } - if debugAsserts && t < 0 { + if debug && t < 0 { panic("t<0") } if debugMatches { @@ -558,8 +610,8 @@ encodeLoop: offset2 = offset1 offset1 = s - t - if debugAsserts && s <= t { - panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + if debug && s <= t { + panic("s <= t") } // Extend the 4-byte match as long as possible. @@ -671,8 +723,4 @@ encodeLoop: println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) } - // We do not store history, so we must offset e.cur to avoid false matches for next user. - if e.cur < bufferReset { - e.cur += int32(len(src)) - } } diff --git a/vendor/github.com/klauspost/compress/zstd/enc_fast.go b/vendor/github.com/klauspost/compress/zstd/enc_fast.go index 4104b456ce..0bdddac5b4 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_fast.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_fast.go @@ -5,8 +5,6 @@ package zstd import ( - "fmt" - "math" "math/bits" "github.com/klauspost/compress/zstd/internal/xxhash" @@ -24,29 +22,26 @@ type tableEntry struct { offset int32 } -type fastBase struct { +type fastEncoder struct { + o encParams // cur is the offset at the start of hist cur int32 // maximum offset. Should be at least 2x block size. maxMatchOff int32 hist []byte crc *xxhash.Digest + table [tableSize]tableEntry tmp [8]byte blk *blockEnc } -type fastEncoder struct { - fastBase - table [tableSize]tableEntry -} - // CRC returns the underlying CRC writer. -func (e *fastBase) CRC() *xxhash.Digest { +func (e *fastEncoder) CRC() *xxhash.Digest { return e.crc } // AppendCRC will append the CRC to the destination slice and return it. -func (e *fastBase) AppendCRC(dst []byte) []byte { +func (e *fastEncoder) AppendCRC(dst []byte) []byte { crc := e.crc.Sum(e.tmp[:0]) dst = append(dst, crc[7], crc[6], crc[5], crc[4]) return dst @@ -54,7 +49,7 @@ func (e *fastBase) AppendCRC(dst []byte) []byte { // WindowSize returns the window size of the encoder, // or a window size small enough to contain the input size, if > 0. -func (e *fastBase) WindowSize(size int) int32 { +func (e *fastEncoder) WindowSize(size int) int32 { if size > 0 && size < int(e.maxMatchOff) { b := int32(1) << uint(bits.Len(uint(size))) // Keep minimum window. @@ -67,7 +62,7 @@ func (e *fastBase) WindowSize(size int) int32 { } // Block returns the current block. -func (e *fastBase) Block() *blockEnc { +func (e *fastEncoder) Block() *blockEnc { return e.blk } @@ -79,7 +74,7 @@ func (e *fastEncoder) Encode(blk *blockEnc, src []byte) { ) // Protect against e.cur wraparound. - for e.cur >= bufferReset { + for e.cur > (1<<30)+e.maxMatchOff { if len(e.hist) == 0 { for i := range e.table[:] { e.table[i] = tableEntry{} @@ -99,7 +94,6 @@ func (e *fastEncoder) Encode(blk *blockEnc, src []byte) { e.table[i].offset = v } e.cur = e.maxMatchOff - break } s := e.addBlock(src) @@ -116,7 +110,11 @@ func (e *fastEncoder) Encode(blk *blockEnc, src []byte) { sLimit := int32(len(src)) - inputMargin // stepSize is the number of bytes to skip on every main loop iteration. // It should be >= 2. - const stepSize = 2 + stepSize := int32(e.o.targetLength) + if stepSize == 0 { + stepSize++ + } + stepSize++ // TEMPLATE const hashLog = tableBits @@ -153,7 +151,7 @@ encodeLoop: canRepeat := len(blk.sequences) > 2 for { - if debugAsserts && canRepeat && offset1 == 0 { + if debug && canRepeat && offset1 == 0 { panic("offset0 was 0") } @@ -169,22 +167,9 @@ encodeLoop: if canRepeat && repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>16) { // Consider history as well. var seq seq - var length int32 - // length = 4 + e.matchlen(s+6, repIndex+4, src) - { - a := src[s+6:] - b := src[repIndex+4:] - endI := len(a) & (math.MaxInt32 - 7) - length = int32(endI) + 4 - for i := 0; i < endI; i += 8 { - if diff := load64(a, i) ^ load64(b, i); diff != 0 { - length = int32(i+bits.TrailingZeros64(diff)>>3) + 4 - break - } - } - } + lenght := 4 + e.matchlen(s+6, repIndex+4, src) - seq.matchLen = uint32(length - zstdMinMatch) + seq.matchLen = uint32(lenght - zstdMinMatch) // We might be able to match backwards. // Extend as long as we can. @@ -210,11 +195,11 @@ encodeLoop: println("repeat sequence", seq, "next s:", s) } blk.sequences = append(blk.sequences, seq) - s += length + 2 + s += lenght + 2 nextEmit = s if s >= sLimit { if debug { - println("repeat ended", s, length) + println("repeat ended", s, lenght) } break encodeLoop @@ -227,10 +212,10 @@ encodeLoop: if coffset0 < e.maxMatchOff && uint32(cv) == candidate.val { // found a regular match t = candidate.offset - e.cur - if debugAsserts && s <= t { - panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + if debug && s <= t { + panic("s <= t") } - if debugAsserts && s-t > e.maxMatchOff { + if debug && s-t > e.maxMatchOff { panic("s - t >e.maxMatchOff") } break @@ -240,13 +225,13 @@ encodeLoop: // found a regular match t = candidate2.offset - e.cur s++ - if debugAsserts && s <= t { - panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + if debug && s <= t { + panic("s <= t") } - if debugAsserts && s-t > e.maxMatchOff { + if debug && s-t > e.maxMatchOff { panic("s - t >e.maxMatchOff") } - if debugAsserts && t < 0 { + if debug && t < 0 { panic("t<0") } break @@ -261,29 +246,16 @@ encodeLoop: offset2 = offset1 offset1 = s - t - if debugAsserts && s <= t { - panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + if debug && s <= t { + panic("s <= t") } - if debugAsserts && canRepeat && int(offset1) > len(src) { + if debug && canRepeat && int(offset1) > len(src) { panic("invalid offset") } // Extend the 4-byte match as long as possible. - //l := e.matchlen(s+4, t+4, src) + 4 - var l int32 - { - a := src[s+4:] - b := src[t+4:] - endI := len(a) & (math.MaxInt32 - 7) - l = int32(endI) + 4 - for i := 0; i < endI; i += 8 { - if diff := load64(a, i) ^ load64(b, i); diff != 0 { - l = int32(i+bits.TrailingZeros64(diff)>>3) + 4 - break - } - } - } + l := e.matchlen(s+4, t+4, src) + 4 // Extend backwards tMin := s - e.maxMatchOff @@ -320,20 +292,7 @@ encodeLoop: if o2 := s - offset2; canRepeat && load3232(src, o2) == uint32(cv) { // We have at least 4 byte match. // No need to check backwards. We come straight from a match - //l := 4 + e.matchlen(s+4, o2+4, src) - var l int32 - { - a := src[s+4:] - b := src[o2+4:] - endI := len(a) & (math.MaxInt32 - 7) - l = int32(endI) + 4 - for i := 0; i < endI; i += 8 { - if diff := load64(a, i) ^ load64(b, i); diff != 0 { - l = int32(i+bits.TrailingZeros64(diff)>>3) + 4 - break - } - } - } + l := 4 + e.matchlen(s+4, o2+4, src) // Store this, since we have it. nextHash := hash6(cv, hashLog) @@ -383,9 +342,8 @@ func (e *fastEncoder) EncodeNoHist(blk *blockEnc, src []byte) { panic("src too big") } } - // Protect against e.cur wraparound. - if e.cur >= bufferReset { + if e.cur > (1<<30)+e.maxMatchOff { for i := range e.table[:] { e.table[i] = tableEntry{} } @@ -452,23 +410,10 @@ encodeLoop: if len(blk.sequences) > 2 && load3232(src, repIndex) == uint32(cv>>16) { // Consider history as well. var seq seq - // length := 4 + e.matchlen(s+6, repIndex+4, src) - // length := 4 + int32(matchLen(src[s+6:], src[repIndex+4:])) - var length int32 - { - a := src[s+6:] - b := src[repIndex+4:] - endI := len(a) & (math.MaxInt32 - 7) - length = int32(endI) + 4 - for i := 0; i < endI; i += 8 { - if diff := load64(a, i) ^ load64(b, i); diff != 0 { - length = int32(i+bits.TrailingZeros64(diff)>>3) + 4 - break - } - } - } + // lenght := 4 + e.matchlen(s+6, repIndex+4, src) + lenght := 4 + int32(matchLen(src[s+6:], src[repIndex+4:])) - seq.matchLen = uint32(length - zstdMinMatch) + seq.matchLen = uint32(lenght - zstdMinMatch) // We might be able to match backwards. // Extend as long as we can. @@ -494,11 +439,11 @@ encodeLoop: println("repeat sequence", seq, "next s:", s) } blk.sequences = append(blk.sequences, seq) - s += length + 2 + s += lenght + 2 nextEmit = s if s >= sLimit { if debug { - println("repeat ended", s, length) + println("repeat ended", s, lenght) } break encodeLoop @@ -511,15 +456,12 @@ encodeLoop: if coffset0 < e.maxMatchOff && uint32(cv) == candidate.val { // found a regular match t = candidate.offset - e.cur - if debugAsserts && s <= t { - panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + if debug && s <= t { + panic("s <= t") } - if debugAsserts && s-t > e.maxMatchOff { + if debug && s-t > e.maxMatchOff { panic("s - t >e.maxMatchOff") } - if debugAsserts && t < 0 { - panic(fmt.Sprintf("t (%d) < 0, candidate.offset: %d, e.cur: %d, coffset0: %d, e.maxMatchOff: %d", t, candidate.offset, e.cur, coffset0, e.maxMatchOff)) - } break } @@ -527,13 +469,13 @@ encodeLoop: // found a regular match t = candidate2.offset - e.cur s++ - if debugAsserts && s <= t { - panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + if debug && s <= t { + panic("s <= t") } - if debugAsserts && s-t > e.maxMatchOff { + if debug && s-t > e.maxMatchOff { panic("s - t >e.maxMatchOff") } - if debugAsserts && t < 0 { + if debug && t < 0 { panic("t<0") } break @@ -548,29 +490,13 @@ encodeLoop: offset2 = offset1 offset1 = s - t - if debugAsserts && s <= t { - panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + if debug && s <= t { + panic("s <= t") } - if debugAsserts && t < 0 { - panic(fmt.Sprintf("t (%d) < 0 ", t)) - } // Extend the 4-byte match as long as possible. //l := e.matchlenNoHist(s+4, t+4, src) + 4 - // l := int32(matchLen(src[s+4:], src[t+4:])) + 4 - var l int32 - { - a := src[s+4:] - b := src[t+4:] - endI := len(a) & (math.MaxInt32 - 7) - l = int32(endI) + 4 - for i := 0; i < endI; i += 8 { - if diff := load64(a, i) ^ load64(b, i); diff != 0 { - l = int32(i+bits.TrailingZeros64(diff)>>3) + 4 - break - } - } - } + l := int32(matchLen(src[s+4:], src[t+4:])) + 4 // Extend backwards tMin := s - e.maxMatchOff @@ -608,20 +534,7 @@ encodeLoop: // We have at least 4 byte match. // No need to check backwards. We come straight from a match //l := 4 + e.matchlenNoHist(s+4, o2+4, src) - // l := 4 + int32(matchLen(src[s+4:], src[o2+4:])) - var l int32 - { - a := src[s+4:] - b := src[o2+4:] - endI := len(a) & (math.MaxInt32 - 7) - l = int32(endI) + 4 - for i := 0; i < endI; i += 8 { - if diff := load64(a, i) ^ load64(b, i); diff != 0 { - l = int32(i+bits.TrailingZeros64(diff)>>3) + 4 - break - } - } - } + l := 4 + int32(matchLen(src[s+4:], src[o2+4:])) // Store this, since we have it. nextHash := hash6(cv, hashLog) @@ -654,16 +567,9 @@ encodeLoop: if debug { println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) } - // We do not store history, so we must offset e.cur to avoid false matches for next user. - if e.cur < bufferReset { - e.cur += int32(len(src)) - } } -func (e *fastBase) addBlock(src []byte) int32 { - if debugAsserts && e.cur > bufferReset { - panic(fmt.Sprintf("ecur (%d) > buffer reset (%d)", e.cur, bufferReset)) - } +func (e *fastEncoder) addBlock(src []byte) int32 { // check if we have space already if len(e.hist)+len(src) > cap(e.hist) { if cap(e.hist) == 0 { @@ -691,41 +597,39 @@ func (e *fastBase) addBlock(src []byte) int32 { // useBlock will replace the block with the provided one, // but transfer recent offsets from the previous. -func (e *fastBase) UseBlock(enc *blockEnc) { +func (e *fastEncoder) UseBlock(enc *blockEnc) { enc.reset(e.blk) e.blk = enc } -func (e *fastBase) matchlenNoHist(s, t int32, src []byte) int32 { +func (e *fastEncoder) matchlenNoHist(s, t int32, src []byte) int32 { // Extend the match to be as long as possible. return int32(matchLen(src[s:], src[t:])) } -func (e *fastBase) matchlen(s, t int32, src []byte) int32 { - if debugAsserts { +func (e *fastEncoder) matchlen(s, t int32, src []byte) int32 { + if debug { if s < 0 { - err := fmt.Sprintf("s (%d) < 0", s) - panic(err) + panic("s<0") } if t < 0 { - err := fmt.Sprintf("s (%d) < 0", s) - panic(err) + panic("t<0") } if s-t > e.maxMatchOff { - err := fmt.Sprintf("s (%d) - t (%d) > maxMatchOff (%d)", s, t, e.maxMatchOff) - panic(err) - } - if len(src)-int(s) > maxCompressedBlockSize { - panic(fmt.Sprintf("len(src)-s (%d) > maxCompressedBlockSize (%d)", len(src)-int(s), maxCompressedBlockSize)) + panic(s - t) } } + s1 := int(s) + maxMatchLength - 4 + if s1 > len(src) { + s1 = len(src) + } // Extend the match to be as long as possible. - return int32(matchLen(src[s:], src[t:])) + return int32(matchLen(src[s:s1], src[t:])) } // Reset the encoding table. -func (e *fastBase) Reset(singleBlock bool) { +func (e *fastEncoder) Reset() { if e.blk == nil { e.blk = &blockEnc{} e.blk.init() @@ -738,7 +642,7 @@ func (e *fastBase) Reset(singleBlock bool) { } else { e.crc.Reset() } - if !singleBlock && cap(e.hist) < int(e.maxMatchOff*2) { + if cap(e.hist) < int(e.maxMatchOff*2) { l := e.maxMatchOff * 2 // Make it at least 1MB. if l < 1<<20 { @@ -746,10 +650,7 @@ func (e *fastBase) Reset(singleBlock bool) { } e.hist = make([]byte, 0, l) } - // We offset current position so everything will be out of reach. - // If above reset line, history will be purged. - if e.cur < bufferReset { - e.cur += e.maxMatchOff + int32(len(e.hist)) - } + // We offset current position so everything will be out of reach + e.cur += e.maxMatchOff + int32(len(e.hist)) e.hist = e.hist[:0] } diff --git a/vendor/github.com/klauspost/compress/zstd/enc_params.go b/vendor/github.com/klauspost/compress/zstd/enc_params.go index d874116f71..b6779ecb6d 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_params.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_params.go @@ -4,8 +4,6 @@ package zstd -/* -// encParams are not really used, just here for reference. type encParams struct { // largest match distance : larger == more compression, more memory needed during decompression windowLog uint8 @@ -154,4 +152,3 @@ var defEncParams = [4][]encParams{ {14, 15, 15, 10, 3, 999, strategyBtultra2}, // level 22. }, } -*/ diff --git a/vendor/github.com/klauspost/compress/zstd/encoder.go b/vendor/github.com/klauspost/compress/zstd/encoder.go index c56d2241f7..366dd66bde 100644 --- a/vendor/github.com/klauspost/compress/zstd/encoder.go +++ b/vendor/github.com/klauspost/compress/zstd/encoder.go @@ -35,22 +35,21 @@ type encoder interface { AppendCRC([]byte) []byte WindowSize(size int) int32 UseBlock(*blockEnc) - Reset(singleBlock bool) + Reset() } type encoderState struct { - w io.Writer - filling []byte - current []byte - previous []byte - encoder encoder - writing *blockEnc - err error - writeErr error - nWritten int64 - headerWritten bool - eofWritten bool - fullFrameWritten bool + w io.Writer + filling []byte + current []byte + previous []byte + encoder encoder + writing *blockEnc + err error + writeErr error + nWritten int64 + headerWritten bool + eofWritten bool // This waitgroup indicates an encode is running. wg sync.WaitGroup @@ -72,26 +71,27 @@ func NewWriter(w io.Writer, opts ...EOption) (*Encoder, error) { } if w != nil { e.Reset(w) + } else { + e.init.Do(func() { + e.initialize() + }) } return &e, nil } func (e *Encoder) initialize() { - if e.o.concurrent == 0 { - e.o.setDefault() - } e.encoders = make(chan encoder, e.o.concurrent) for i := 0; i < e.o.concurrent; i++ { - enc := e.o.encoder() - // If not single block, history will be allocated on first use. - enc.Reset(true) - e.encoders <- enc + e.encoders <- e.o.encoder() } } // Reset will re-initialize the writer and new writes will encode to the supplied writer // as a new, independent stream. func (e *Encoder) Reset(w io.Writer) { + e.init.Do(func() { + e.initialize() + }) s := &e.state s.wg.Wait() s.wWg.Wait() @@ -115,10 +115,9 @@ func (e *Encoder) Reset(w io.Writer) { s.filling = s.filling[:0] s.current = s.current[:0] s.previous = s.previous[:0] - s.encoder.Reset(false) + s.encoder.Reset() s.headerWritten = false s.eofWritten = false - s.fullFrameWritten = false s.w = w s.err = nil s.nWritten = 0 @@ -157,7 +156,7 @@ func (e *Encoder) Write(p []byte) (n int, err error) { if err != nil { return n, err } - if debugAsserts && len(s.filling) > 0 { + if debug && len(s.filling) > 0 { panic(len(s.filling)) } } @@ -177,22 +176,6 @@ func (e *Encoder) nextBlock(final bool) error { return fmt.Errorf("block > maxStoreBlockSize") } if !s.headerWritten { - // If we have a single block encode, do a sync compression. - if final && len(s.filling) > 0 { - s.current = e.EncodeAll(s.filling, s.current[:0]) - var n2 int - n2, s.err = s.w.Write(s.current) - if s.err != nil { - return s.err - } - s.nWritten += int64(n2) - s.current = s.current[:0] - s.filling = s.filling[:0] - s.headerWritten = true - s.fullFrameWritten = true - return nil - } - var tmp [maxHeaderSize]byte fh := frameHeader{ ContentSize: 0, @@ -280,7 +263,7 @@ func (e *Encoder) nextBlock(final bool) error { // If we got the exact same number of literals as input, // assume the literals cannot be compressed. if len(src) != len(blk.literals) || len(src) != e.o.blockSize { - err = blk.encode(e.o.noEntropy, !e.o.allLitEntropy) + err = blk.encode(e.o.noEntropy) } switch err { case errIncompressible: @@ -315,9 +298,7 @@ func (e *Encoder) ReadFrom(r io.Reader) (n int64, err error) { src := e.state.filling for { n2, err := r.Read(src) - if e.o.crc { - _, _ = e.state.encoder.CRC().Write(src[:n2]) - } + _, _ = e.state.encoder.CRC().Write(src[:n2]) // src is now the unfilled part... src = src[n2:] n += int64(n2) @@ -382,9 +363,6 @@ func (e *Encoder) Close() error { if err != nil { return err } - if e.state.fullFrameWritten { - return s.err - } s.wg.Wait() s.wWg.Wait() @@ -444,14 +422,18 @@ func (e *Encoder) EncodeAll(src, dst []byte) []byte { } return dst } - e.init.Do(e.initialize) + e.init.Do(func() { + e.o.setDefault() + e.initialize() + }) enc := <-e.encoders defer func() { // Release encoder reference to last block. - // If a non-single block is needed the encoder will reset again. - enc.Reset(true) + enc.Reset() e.encoders <- enc }() + enc.Reset() + blk := enc.Block() // Use single segments when above minimum window and below 1MB. single := len(src) < 1<<20 && len(src) > MinWindowSize if e.o.single != nil { @@ -474,13 +456,12 @@ func (e *Encoder) EncodeAll(src, dst []byte) []byte { panic(err) } - // If we can do everything in one block, prefer that. - if len(src) <= maxCompressedBlockSize { + if len(src) <= e.o.blockSize && len(src) <= maxBlockSize { // Slightly faster with no history and everything in one block. if e.o.crc { _, _ = enc.CRC().Write(src) } - blk := enc.Block() + blk.reset(nil) blk.last = true enc.EncodeNoHist(blk, src) @@ -491,7 +472,7 @@ func (e *Encoder) EncodeAll(src, dst []byte) []byte { if len(blk.literals) != len(src) || len(src) != e.o.blockSize { // Output directly to dst blk.output = dst - err = blk.encode(e.o.noEntropy, !e.o.allLitEntropy) + err = blk.encode(e.o.noEntropy) } switch err { @@ -507,8 +488,6 @@ func (e *Encoder) EncodeAll(src, dst []byte) []byte { } blk.output = oldout } else { - enc.Reset(false) - blk := enc.Block() for len(src) > 0 { todo := src if len(todo) > e.o.blockSize { @@ -528,7 +507,7 @@ func (e *Encoder) EncodeAll(src, dst []byte) []byte { // If we got the exact same number of literals as input, // assume the literals cannot be compressed. if len(blk.literals) != len(todo) || len(todo) != e.o.blockSize { - err = blk.encode(e.o.noEntropy, !e.o.allLitEntropy) + err = blk.encode(e.o.noEntropy) } switch err { diff --git a/vendor/github.com/klauspost/compress/zstd/encoder_options.go b/vendor/github.com/klauspost/compress/zstd/encoder_options.go index dfac14ddde..40eb457331 100644 --- a/vendor/github.com/klauspost/compress/zstd/encoder_options.go +++ b/vendor/github.com/klauspost/compress/zstd/encoder_options.go @@ -12,18 +12,15 @@ type EOption func(*encoderOptions) error // options retains accumulated state of multiple options. type encoderOptions struct { - concurrent int - level EncoderLevel - single *bool - pad int - blockSize int - windowSize int - crc bool - fullZero bool - noEntropy bool - allLitEntropy bool - customWindow bool - customALEntropy bool + concurrent int + crc bool + single *bool + pad int + blockSize int + windowSize int + level EncoderLevel + fullZero bool + noEntropy bool } func (o *encoderOptions) setDefault() { @@ -33,7 +30,7 @@ func (o *encoderOptions) setDefault() { crc: true, single: nil, blockSize: 1 << 16, - windowSize: 8 << 20, + windowSize: 1 << 22, level: SpeedDefault, } } @@ -42,11 +39,9 @@ func (o *encoderOptions) setDefault() { func (o encoderOptions) encoder() encoder { switch o.level { case SpeedDefault: - return &doubleFastEncoder{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize)}}} - case SpeedBetterCompression: - return &betterFastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize)}} + return &doubleFastEncoder{fastEncoder: fastEncoder{maxMatchOff: int32(o.windowSize)}} case SpeedFastest: - return &fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize)}} + return &fastEncoder{maxMatchOff: int32(o.windowSize)} } panic("unknown compression level") } @@ -72,7 +67,7 @@ func WithEncoderConcurrency(n int) EOption { } // WithWindowSize will set the maximum allowed back-reference distance. -// The value must be a power of two between MinWindowSize and MaxWindowSize. +// The value must be a power of two between WindowSizeMin and WindowSizeMax. // A larger value will enable better compression but allocate more memory and, // for above-default values, take considerably longer. // The default value is determined by the compression level. @@ -88,7 +83,6 @@ func WithWindowSize(n int) EOption { } o.windowSize = n - o.customWindow = true if o.blockSize > o.windowSize { o.blockSize = o.windowSize } @@ -136,18 +130,18 @@ const ( // This is roughly equivalent to the default Zstandard mode (level 3). SpeedDefault - // SpeedBetterCompression will yield better compression than the default. - // Currently it is about zstd level 7-8 with ~ 2x-3x the default CPU usage. - // By using this, notice that CPU usage may go up in the future. - SpeedBetterCompression - // speedLast should be kept as the last actual compression option. // The is not for external usage, but is used to keep track of the valid options. speedLast + // SpeedBetterCompression will (in the future) yield better compression than the default, + // but at approximately 4x the CPU usage of the default. + // For now this is not implemented. + SpeedBetterCompression = SpeedDefault + // SpeedBestCompression will choose the best available compression option. // For now this is not implemented. - SpeedBestCompression = SpeedBetterCompression + SpeedBestCompression = SpeedDefault ) // EncoderLevelFromString will convert a string representation of an encoding level back @@ -169,10 +163,8 @@ func EncoderLevelFromZstd(level int) EncoderLevel { switch { case level < 3: return SpeedFastest - case level >= 3 && level < 6: + case level >= 3: return SpeedDefault - case level > 5: - return SpeedBetterCompression } return SpeedDefault } @@ -184,8 +176,6 @@ func (e EncoderLevel) String() string { return "fastest" case SpeedDefault: return "default" - case SpeedBetterCompression: - return "better" default: return "invalid" } @@ -199,20 +189,6 @@ func WithEncoderLevel(l EncoderLevel) EOption { return fmt.Errorf("unknown encoder level") } o.level = l - if !o.customWindow { - switch o.level { - case SpeedFastest: - o.windowSize = 4 << 20 - case SpeedDefault: - o.windowSize = 8 << 20 - case SpeedBetterCompression: - o.windowSize = 16 << 20 - } - } - if !o.customALEntropy { - o.allLitEntropy = l > SpeedFastest - } - return nil } } @@ -227,18 +203,6 @@ func WithZeroFrames(b bool) EOption { } } -// WithAllLitEntropyCompression will apply entropy compression if no matches are found. -// Disabling this will skip incompressible data faster, but in cases with no matches but -// skewed character distribution compression is lost. -// Default value depends on the compression level selected. -func WithAllLitEntropyCompression(b bool) EOption { - return func(o *encoderOptions) error { - o.customALEntropy = true - o.allLitEntropy = b - return nil - } -} - // WithNoEntropyCompression will always skip entropy compression of literals. // This can be useful if content has matches, but unlikely to benefit from entropy // compression. Usually the slight speed improvement is not worth enabling this. diff --git a/vendor/github.com/klauspost/compress/zstd/framedec.go b/vendor/github.com/klauspost/compress/zstd/framedec.go index fc4a566d39..40790747a3 100644 --- a/vendor/github.com/klauspost/compress/zstd/framedec.go +++ b/vendor/github.com/klauspost/compress/zstd/framedec.go @@ -16,11 +16,16 @@ import ( ) type frameDec struct { - o decoderOptions - crc hash.Hash64 - offset int64 + o decoderOptions + crc hash.Hash64 + frameDone sync.WaitGroup + offset int64 - WindowSize uint64 + WindowSize uint64 + DictionaryID uint32 + FrameContentSize uint64 + HasCheckSum bool + SingleSegment bool // maxWindowSize is the maximum windows size to support. // should never be bigger than max-int. @@ -37,22 +42,15 @@ type frameDec struct { // Byte buffer that can be reused for small input blocks. bBuf byteBuf - FrameContentSize uint64 - frameDone sync.WaitGroup - - DictionaryID *uint32 - HasCheckSum bool - SingleSegment bool - // asyncRunning indicates whether the async routine processes input on 'decoding'. - asyncRunningMu sync.Mutex asyncRunning bool + asyncRunningMu sync.Mutex } const ( // The minimum Window_Size is 1 KB. MinWindowSize = 1 << 10 - MaxWindowSize = 1 << 29 + MaxWindowSize = 1 << 30 ) var ( @@ -142,7 +140,7 @@ func (d *frameDec) reset(br byteBuffer) error { // Read Dictionary_ID // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary_id - d.DictionaryID = nil + d.DictionaryID = 0 if size := fhd & 3; size != 0 { if size == 3 { size = 4 @@ -154,22 +152,19 @@ func (d *frameDec) reset(br byteBuffer) error { } return io.ErrUnexpectedEOF } - var id uint32 switch size { case 1: - id = uint32(b[0]) + d.DictionaryID = uint32(b[0]) case 2: - id = uint32(b[0]) | (uint32(b[1]) << 8) + d.DictionaryID = uint32(b[0]) | (uint32(b[1]) << 8) case 4: - id = uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24) + d.DictionaryID = uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24) } if debug { - println("Dict size", size, "ID:", id) + println("Dict size", size, "ID:", d.DictionaryID) } - if id > 0 { - // ID 0 means "sorry, no dictionary anyway". - // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary-format - d.DictionaryID = &id + if d.DictionaryID != 0 { + return ErrUnknownDictionary } } @@ -236,11 +231,7 @@ func (d *frameDec) reset(br byteBuffer) error { return ErrWindowSizeTooSmall } d.history.windowSize = int(d.WindowSize) - if d.o.lowMem && d.history.windowSize < maxBlockSize { - d.history.maxSize = d.history.windowSize * 2 - } else { - d.history.maxSize = d.history.windowSize + maxBlockSize - } + d.history.maxSize = d.history.windowSize + maxBlockSize // history contains input - maybe we do something d.rawInput = br return nil @@ -327,8 +318,8 @@ func (d *frameDec) checkCRC() error { func (d *frameDec) initAsync() { if !d.o.lowMem && !d.SingleSegment { - // set max extra size history to 10MB. - d.history.maxSize = d.history.windowSize + maxBlockSize*5 + // set max extra size history to 20MB. + d.history.maxSize = d.history.windowSize + maxBlockSize*10 } // re-alloc if more than one extra block size. if d.o.lowMem && cap(d.history.b) > d.history.maxSize+maxBlockSize { @@ -354,6 +345,8 @@ func (d *frameDec) initAsync() { // When the frame has finished decoding the *bufio.Reader // containing the remaining input will be sent on frameDec.frameDone. func (d *frameDec) startDecoder(output chan decodeOutput) { + // TODO: Init to dictionary + d.history.reset() written := int64(0) defer func() { @@ -446,6 +439,8 @@ func (d *frameDec) startDecoder(output chan decodeOutput) { // runDecoder will create a sync decoder that will decode a block of data. func (d *frameDec) runDecoder(dst []byte, dec *blockDec) ([]byte, error) { + // TODO: Init to dictionary + d.history.reset() saved := d.history.b // We use the history for output to avoid copying it. diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder.go b/vendor/github.com/klauspost/compress/zstd/fse_decoder.go index e6d3d49b39..9efe34feb3 100644 --- a/vendor/github.com/klauspost/compress/zstd/fse_decoder.go +++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder.go @@ -19,7 +19,7 @@ const ( * Increasing memory usage improves compression ratio * Reduced memory usage can improve speed, due to cache effect * Recommended max value is 14, for 16KB, which nicely fits into Intel x86 L1 cache */ - maxMemoryUsage = tablelogAbsoluteMax + 2 + maxMemoryUsage = 11 maxTableLog = maxMemoryUsage - 2 maxTablesize = 1 << maxTableLog @@ -55,7 +55,7 @@ func (s *fseDecoder) readNCount(b *byteReader, maxSymbol uint16) error { if b.remain() < 4 { return errors.New("input too small") } - bitStream := b.Uint32NC() + bitStream := b.Uint32() nbBits := uint((bitStream & 0xF) + minTablelog) // extract tableLog if nbBits > tablelogAbsoluteMax { println("Invalid tablelog:", nbBits) @@ -79,8 +79,7 @@ func (s *fseDecoder) readNCount(b *byteReader, maxSymbol uint16) error { n0 += 24 if r := b.remain(); r > 5 { b.advance(2) - // The check above should make sure we can read 32 bits - bitStream = b.Uint32NC() >> bitCount + bitStream = b.Uint32() >> bitCount } else { // end of bit stream bitStream >>= 16 @@ -105,11 +104,10 @@ func (s *fseDecoder) readNCount(b *byteReader, maxSymbol uint16) error { charnum++ } - if r := b.remain(); r >= 7 || r-int(bitCount>>3) >= 4 { + if r := b.remain(); r >= 7 || r+int(bitCount>>3) >= 4 { b.advance(bitCount >> 3) bitCount &= 7 - // The check above should make sure we can read 32 bits - bitStream = b.Uint32NC() >> bitCount + bitStream = b.Uint32() >> bitCount } else { bitStream >>= 2 } @@ -120,7 +118,7 @@ func (s *fseDecoder) readNCount(b *byteReader, maxSymbol uint16) error { if int32(bitStream)&(threshold-1) < max { count = int32(bitStream) & (threshold - 1) - if debugAsserts && nbBits < 1 { + if debug && nbBits < 1 { panic("nbBits underflow") } bitCount += nbBits - 1 @@ -150,16 +148,17 @@ func (s *fseDecoder) readNCount(b *byteReader, maxSymbol uint16) error { threshold >>= 1 } - if r := b.remain(); r >= 7 || r-int(bitCount>>3) >= 4 { + //println("b.off:", b.off, "len:", len(b.b), "bc:", bitCount, "remain:", b.remain()) + if r := b.remain(); r >= 7 || r+int(bitCount>>3) >= 4 { b.advance(bitCount >> 3) bitCount &= 7 - // The check above should make sure we can read 32 bits - bitStream = b.Uint32NC() >> (bitCount & 31) } else { bitCount -= (uint)(8 * (len(b.b) - 4 - b.off)) b.off = len(b.b) - 4 - bitStream = b.Uint32() >> (bitCount & 31) + //println("b.off:", b.off, "len:", len(b.b), "bc:", bitCount, "iend", iend) } + bitStream = b.Uint32() >> (bitCount & 31) + //printf("bitstream is now: 0b%b", bitStream) } s.symbolLen = charnum if s.symbolLen <= 1 { diff --git a/vendor/github.com/klauspost/compress/zstd/fse_encoder.go b/vendor/github.com/klauspost/compress/zstd/fse_encoder.go index aa9eba88b8..619836f52f 100644 --- a/vendor/github.com/klauspost/compress/zstd/fse_encoder.go +++ b/vendor/github.com/klauspost/compress/zstd/fse_encoder.go @@ -327,7 +327,7 @@ func (s *fseEncoder) normalizeCount(length int) error { if err != nil { return err } - if debugAsserts { + if debug { err = s.validateNorm() if err != nil { return err @@ -336,7 +336,7 @@ func (s *fseEncoder) normalizeCount(length int) error { return s.buildCTable() } s.norm[largest] += stillToDistribute - if debugAsserts { + if debug { err := s.validateNorm() if err != nil { return err @@ -619,7 +619,7 @@ func (s *fseEncoder) writeCount(out []byte) ([]byte, error) { func (s *fseEncoder) bitCost(symbolValue uint8, accuracyLog uint32) uint32 { minNbBits := s.ct.symbolTT[symbolValue].deltaNbBits >> 16 threshold := (minNbBits + 1) << 16 - if debugAsserts { + if debug { if !(s.actualTableLog < 16) { panic("!s.actualTableLog < 16") } @@ -633,7 +633,7 @@ func (s *fseEncoder) bitCost(symbolValue uint8, accuracyLog uint32) uint32 { // linear interpolation (very approximate) normalizedDeltaFromThreshold := (deltaFromThreshold << accuracyLog) >> s.actualTableLog bitMultiplier := uint32(1) << accuracyLog - if debugAsserts { + if debug { if s.ct.symbolTT[symbolValue].deltaNbBits+tableSize > threshold { panic("s.ct.symbolTT[symbolValue].deltaNbBits+tableSize > threshold") } diff --git a/vendor/github.com/klauspost/compress/zstd/history.go b/vendor/github.com/klauspost/compress/zstd/history.go index f418f50fcd..e8c419bd53 100644 --- a/vendor/github.com/klauspost/compress/zstd/history.go +++ b/vendor/github.com/klauspost/compress/zstd/history.go @@ -17,7 +17,6 @@ type history struct { windowSize int maxSize int error bool - dict *dict } // reset will reset the history to initial state of a frame. @@ -37,27 +36,12 @@ func (h *history) reset() { } h.decoders = sequenceDecs{} if h.huffTree != nil { - if h.dict == nil || h.dict.litDec != h.huffTree { - huffDecoderPool.Put(h.huffTree) - } + huffDecoderPool.Put(h.huffTree) } h.huffTree = nil - h.dict = nil //printf("history created: %+v (l: %d, c: %d)", *h, len(h.b), cap(h.b)) } -func (h *history) setDict(dict *dict) { - if dict == nil { - return - } - h.dict = dict - h.decoders.litLengths = dict.llDec - h.decoders.offsets = dict.ofDec - h.decoders.matchLengths = dict.mlDec - h.recentOffsets = dict.offsets - h.huffTree = dict.litDec -} - // append bytes to history. // This function will make sure there is space for it, // if the buffer has been allocated with enough extra space. diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s index 2c9c5357a1..d580e32aed 100644 --- a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s +++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s @@ -179,13 +179,13 @@ TEXT ·writeBlocks(SB), NOSPLIT, $0-40 MOVQ ·prime2v(SB), R14 // Load slice. - MOVQ arg1_base+8(FP), CX - MOVQ arg1_len+16(FP), DX + MOVQ b_base+8(FP), CX + MOVQ b_len+16(FP), DX LEAQ (CX)(DX*1), BX SUBQ $32, BX // Load vN from d. - MOVQ arg+0(FP), AX + MOVQ d+0(FP), AX MOVQ 0(AX), R8 // v1 MOVQ 8(AX), R9 // v2 MOVQ 16(AX), R10 // v3 @@ -209,7 +209,7 @@ blockLoop: MOVQ R11, 24(AX) // The number of bytes written is CX minus the old base pointer. - SUBQ arg1_base+8(FP), CX + SUBQ b_base+8(FP), CX MOVQ CX, ret+32(FP) RET diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec.go b/vendor/github.com/klauspost/compress/zstd/seqdec.go index 7ff870400d..15a45f7b50 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec.go @@ -62,10 +62,8 @@ type sequenceDecs struct { matchLengths sequenceDec prevOffset [3]int hist []byte - dict []byte literals []byte out []byte - windowSize int maxBits uint8 } @@ -84,12 +82,7 @@ func (s *sequenceDecs) initialize(br *bitReader, hist *history, literals, out [] s.hist = hist.b s.prevOffset = hist.recentOffsets s.maxBits = s.litLengths.fse.maxBits + s.offsets.fse.maxBits + s.matchLengths.fse.maxBits - s.windowSize = hist.windowSize s.out = out - s.dict = nil - if hist.dict != nil { - s.dict = hist.dict.content - } return nil } @@ -105,78 +98,23 @@ func (s *sequenceDecs) decode(seqs int, br *bitReader, hist []byte) error { printf("reading sequence %d, exceeded available data\n", seqs-i) return io.ErrUnexpectedEOF } - var ll, mo, ml int + var litLen, matchOff, matchLen int if br.off > 4+((maxOffsetBits+16+16)>>3) { - // inlined function: - // ll, mo, ml = s.nextFast(br, llState, mlState, ofState) - - // Final will not read from stream. - var llB, mlB, moB uint8 - ll, llB = llState.final() - ml, mlB = mlState.final() - mo, moB = ofState.final() - - // extra bits are stored in reverse order. - br.fillFast() - mo += br.getBits(moB) - if s.maxBits > 32 { - br.fillFast() - } - ml += br.getBits(mlB) - ll += br.getBits(llB) - - if moB > 1 { - s.prevOffset[2] = s.prevOffset[1] - s.prevOffset[1] = s.prevOffset[0] - s.prevOffset[0] = mo - } else { - // mo = s.adjustOffset(mo, ll, moB) - // Inlined for rather big speedup - if ll == 0 { - // There is an exception though, when current sequence's literals_length = 0. - // In this case, repeated offsets are shifted by one, so an offset_value of 1 means Repeated_Offset2, - // an offset_value of 2 means Repeated_Offset3, and an offset_value of 3 means Repeated_Offset1 - 1_byte. - mo++ - } - - if mo == 0 { - mo = s.prevOffset[0] - } else { - var temp int - if mo == 3 { - temp = s.prevOffset[0] - 1 - } else { - temp = s.prevOffset[mo] - } - - if temp == 0 { - // 0 is not valid; input is corrupted; force offset to 1 - println("temp was 0") - temp = 1 - } - - if mo != 1 { - s.prevOffset[2] = s.prevOffset[1] - } - s.prevOffset[1] = s.prevOffset[0] - s.prevOffset[0] = temp - mo = temp - } - } + litLen, matchOff, matchLen = s.nextFast(br, llState, mlState, ofState) br.fillFast() } else { - ll, mo, ml = s.next(br, llState, mlState, ofState) + litLen, matchOff, matchLen = s.next(br, llState, mlState, ofState) br.fill() } if debugSequences { - println("Seq", seqs-i-1, "Litlen:", ll, "mo:", mo, "(abs) ml:", ml) + println("Seq", seqs-i-1, "Litlen:", litLen, "matchOff:", matchOff, "(abs) matchLen:", matchLen) } - if ll > len(s.literals) { - return fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", ll, len(s.literals)) + if litLen > len(s.literals) { + return fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", litLen, len(s.literals)) } - size := ll + ml + len(s.out) + size := litLen + matchLen + len(s.out) if size-startSize > maxBlockSize { return fmt.Errorf("output (%d) bigger than max block size", size) } @@ -187,70 +125,49 @@ func (s *sequenceDecs) decode(seqs int, br *bitReader, hist []byte) error { s.out = append(s.out, make([]byte, maxBlockSize)...) s.out = s.out[:len(s.out)-maxBlockSize] } - if ml > maxMatchLen { - return fmt.Errorf("match len (%d) bigger than max allowed length", ml) + if matchLen > maxMatchLen { + return fmt.Errorf("match len (%d) bigger than max allowed length", matchLen) } - - // Add literals - s.out = append(s.out, s.literals[:ll]...) - s.literals = s.literals[ll:] - out := s.out - - if mo > len(s.out)+len(hist) || mo > s.windowSize { - if len(s.dict) == 0 { - return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(s.out)+len(hist)) - } - - // we may be in dictionary. - dictO := len(s.dict) - (mo - (len(s.out) + len(hist))) - if dictO < 0 || dictO >= len(s.dict) { - return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(s.out)+len(hist)) - } - end := dictO + ml - if end > len(s.dict) { - out = append(out, s.dict[dictO:]...) - mo -= len(s.dict) - dictO - ml -= len(s.dict) - dictO - } else { - out = append(out, s.dict[dictO:end]...) - mo = 0 - ml = 0 - } + if matchOff > len(s.out)+len(hist)+litLen { + return fmt.Errorf("match offset (%d) bigger than current history (%d)", matchOff, len(s.out)+len(hist)+litLen) } - - if mo == 0 && ml > 0 { - return fmt.Errorf("zero matchoff and matchlen (%d) > 0", ml) + if matchOff == 0 && matchLen > 0 { + return fmt.Errorf("zero matchoff and matchlen > 0") } + s.out = append(s.out, s.literals[:litLen]...) + s.literals = s.literals[litLen:] + out := s.out + // Copy from history. // TODO: Blocks without history could be made to ignore this completely. - if v := mo - len(s.out); v > 0 { + if v := matchOff - len(s.out); v > 0 { // v is the start position in history from end. start := len(s.hist) - v - if ml > v { + if matchLen > v { // Some goes into current block. // Copy remainder of history out = append(out, s.hist[start:]...) - mo -= v - ml -= v + matchOff -= v + matchLen -= v } else { - out = append(out, s.hist[start:start+ml]...) - ml = 0 + out = append(out, s.hist[start:start+matchLen]...) + matchLen = 0 } } // We must be in current buffer now - if ml > 0 { - start := len(s.out) - mo - if ml <= len(s.out)-start { + if matchLen > 0 { + start := len(s.out) - matchOff + if matchLen <= len(s.out)-start { // No overlap - out = append(out, s.out[start:start+ml]...) + out = append(out, s.out[start:start+matchLen]...) } else { // Overlapping copy // Extend destination slice and copy one byte at the time. - out = out[:len(out)+ml] - src := out[start : start+ml] + out = out[:len(out)+matchLen] + src := out[start : start+matchLen] // Destination is the space we just added. - dst := out[len(out)-ml:] + dst := out[len(out)-matchLen:] dst = dst[:len(src)] for i := range src { dst[i] = src[i] diff --git a/vendor/github.com/klauspost/compress/zstd/snappy.go b/vendor/github.com/klauspost/compress/zstd/snappy.go index 690428cd24..356956ba25 100644 --- a/vendor/github.com/klauspost/compress/zstd/snappy.go +++ b/vendor/github.com/klauspost/compress/zstd/snappy.go @@ -178,7 +178,7 @@ func (r *SnappyConverter) Convert(in io.Reader, w io.Writer) (int64, error) { r.err = ErrSnappyCorrupt return written, r.err } - err = r.block.encode(false, false) + err = r.block.encode(false) switch err { case errIncompressible: r.block.popOffsets() diff --git a/vendor/github.com/klauspost/compress/zstd/zstd.go b/vendor/github.com/klauspost/compress/zstd/zstd.go index 0807719c8b..57a8a2f5bb 100644 --- a/vendor/github.com/klauspost/compress/zstd/zstd.go +++ b/vendor/github.com/klauspost/compress/zstd/zstd.go @@ -6,20 +6,11 @@ package zstd import ( "errors" "log" - "math" "math/bits" ) -// enable debug printing const debug = false - -// Enable extra assertions. -const debugAsserts = debug || false - -// print sequence details const debugSequences = false - -// print detailed matching information const debugMatches = false // force encoder to use predefined tables. @@ -28,9 +19,6 @@ const forcePreDef = false // zstdMinMatch is the minimum zstd match length. const zstdMinMatch = 3 -// Reset the buffer offset when reaching this. -const bufferReset = math.MaxInt32 - MaxWindowSize - var ( // ErrReservedBlockType is returned when a reserved block type is found. // Typically this indicates wrong or corrupted input. @@ -87,17 +75,6 @@ func printf(format string, a ...interface{}) { } } -// matchLenFast does matching, but will not match the last up to 7 bytes. -func matchLenFast(a, b []byte) int { - endI := len(a) & (math.MaxInt32 - 7) - for i := 0; i < endI; i += 8 { - if diff := load64(a, i) ^ load64(b, i); diff != 0 { - return i + bits.TrailingZeros64(diff)>>3 - } - } - return endI -} - // matchLen returns the maximum length. // a must be the shortest of the two. // The function also returns whether all bytes matched. @@ -108,18 +85,33 @@ func matchLen(a, b []byte) int { return i + (bits.TrailingZeros64(diff) >> 3) } } - checked := (len(a) >> 3) << 3 a = a[checked:] b = b[checked:] + // TODO: We could do a 4 check. for i := range a { if a[i] != b[i] { - return i + checked + return int(i) + checked } } return len(a) + checked } +// matchLen returns a match length in src between index s and t +func matchLenIn(src []byte, s, t int32) int32 { + s1 := len(src) + b := src[t:] + a := src[s:s1] + b = b[:len(a)] + // Extend the match to be as long as possible. + for i := range a { + if a[i] != b[i] { + return int32(i) + } + } + return int32(len(a)) +} + func load3232(b []byte, i int32) uint32 { // Help the compiler eliminate bounds checks on the read so it can be done in a single read. b = b[i:] diff --git a/vendor/github.com/klauspost/cpuid/v2/.gitignore b/vendor/github.com/klauspost/cpuid/.gitignore similarity index 100% rename from vendor/github.com/klauspost/cpuid/v2/.gitignore rename to vendor/github.com/klauspost/cpuid/.gitignore diff --git a/vendor/github.com/klauspost/cpuid/.travis.yml b/vendor/github.com/klauspost/cpuid/.travis.yml new file mode 100644 index 0000000000..4c759adbb4 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/.travis.yml @@ -0,0 +1,23 @@ +language: go + +sudo: false + +os: + - linux + - osx +go: + - 1.11.x + - 1.12.x + - 1.13.x + - master + +script: + - go vet ./... + - go test -v ./... + - go test -race ./... + - diff <(gofmt -d .) <("") + +matrix: + allow_failures: + - go: 'master' + fast_finish: true diff --git a/vendor/github.com/klauspost/cpuid/v2/CONTRIBUTING.txt b/vendor/github.com/klauspost/cpuid/CONTRIBUTING.txt similarity index 100% rename from vendor/github.com/klauspost/cpuid/v2/CONTRIBUTING.txt rename to vendor/github.com/klauspost/cpuid/CONTRIBUTING.txt diff --git a/vendor/github.com/klauspost/cpuid/v2/LICENSE b/vendor/github.com/klauspost/cpuid/LICENSE similarity index 100% rename from vendor/github.com/klauspost/cpuid/v2/LICENSE rename to vendor/github.com/klauspost/cpuid/LICENSE diff --git a/vendor/github.com/klauspost/cpuid/README.md b/vendor/github.com/klauspost/cpuid/README.md new file mode 100644 index 0000000000..58c00f78a1 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/README.md @@ -0,0 +1,157 @@ +# cpuid +Package cpuid provides information about the CPU running the current program. + +CPU features are detected on startup, and kept for fast access through the life of the application. +Currently x86 / x64 (AMD64) is supported, and no external C (cgo) code is used, which should make the library very easy to use. + +You can access the CPU information by accessing the shared CPU variable of the cpuid library. + +Package home: https://github.com/klauspost/cpuid + +[![GoDoc][1]][2] [![Build Status][3]][4] + +[1]: https://godoc.org/github.com/klauspost/cpuid?status.svg +[2]: https://godoc.org/github.com/klauspost/cpuid +[3]: https://travis-ci.org/klauspost/cpuid.svg +[4]: https://travis-ci.org/klauspost/cpuid + +# features +## CPU Instructions +* **CMOV** (i686 CMOV) +* **NX** (NX (No-Execute) bit) +* **AMD3DNOW** (AMD 3DNOW) +* **AMD3DNOWEXT** (AMD 3DNowExt) +* **MMX** (standard MMX) +* **MMXEXT** (SSE integer functions or AMD MMX ext) +* **SSE** (SSE functions) +* **SSE2** (P4 SSE functions) +* **SSE3** (Prescott SSE3 functions) +* **SSSE3** (Conroe SSSE3 functions) +* **SSE4** (Penryn SSE4.1 functions) +* **SSE4A** (AMD Barcelona microarchitecture SSE4a instructions) +* **SSE42** (Nehalem SSE4.2 functions) +* **AVX** (AVX functions) +* **AVX2** (AVX2 functions) +* **FMA3** (Intel FMA 3) +* **FMA4** (Bulldozer FMA4 functions) +* **XOP** (Bulldozer XOP functions) +* **F16C** (Half-precision floating-point conversion) +* **BMI1** (Bit Manipulation Instruction Set 1) +* **BMI2** (Bit Manipulation Instruction Set 2) +* **TBM** (AMD Trailing Bit Manipulation) +* **LZCNT** (LZCNT instruction) +* **POPCNT** (POPCNT instruction) +* **AESNI** (Advanced Encryption Standard New Instructions) +* **CLMUL** (Carry-less Multiplication) +* **HTT** (Hyperthreading (enabled)) +* **HLE** (Hardware Lock Elision) +* **RTM** (Restricted Transactional Memory) +* **RDRAND** (RDRAND instruction is available) +* **RDSEED** (RDSEED instruction is available) +* **ADX** (Intel ADX (Multi-Precision Add-Carry Instruction Extensions)) +* **SHA** (Intel SHA Extensions) +* **AVX512F** (AVX-512 Foundation) +* **AVX512DQ** (AVX-512 Doubleword and Quadword Instructions) +* **AVX512IFMA** (AVX-512 Integer Fused Multiply-Add Instructions) +* **AVX512PF** (AVX-512 Prefetch Instructions) +* **AVX512ER** (AVX-512 Exponential and Reciprocal Instructions) +* **AVX512CD** (AVX-512 Conflict Detection Instructions) +* **AVX512BW** (AVX-512 Byte and Word Instructions) +* **AVX512VL** (AVX-512 Vector Length Extensions) +* **AVX512VBMI** (AVX-512 Vector Bit Manipulation Instructions) +* **AVX512VBMI2** (AVX-512 Vector Bit Manipulation Instructions, Version 2) +* **AVX512VNNI** (AVX-512 Vector Neural Network Instructions) +* **AVX512VPOPCNTDQ** (AVX-512 Vector Population Count Doubleword and Quadword) +* **GFNI** (Galois Field New Instructions) +* **VAES** (Vector AES) +* **AVX512BITALG** (AVX-512 Bit Algorithms) +* **VPCLMULQDQ** (Carry-Less Multiplication Quadword) +* **AVX512BF16** (AVX-512 BFLOAT16 Instructions) +* **AVX512VP2INTERSECT** (AVX-512 Intersect for D/Q) +* **MPX** (Intel MPX (Memory Protection Extensions)) +* **ERMS** (Enhanced REP MOVSB/STOSB) +* **RDTSCP** (RDTSCP Instruction) +* **CX16** (CMPXCHG16B Instruction) +* **SGX** (Software Guard Extensions, with activation details) +* **VMX** (Virtual Machine Extensions) + +## Performance +* **RDTSCP()** Returns current cycle count. Can be used for benchmarking. +* **SSE2SLOW** (SSE2 is supported, but usually not faster) +* **SSE3SLOW** (SSE3 is supported, but usually not faster) +* **ATOM** (Atom processor, some SSSE3 instructions are slower) +* **Cache line** (Probable size of a cache line). +* **L1, L2, L3 Cache size** on newer Intel/AMD CPUs. + +## Cpu Vendor/VM +* **Intel** +* **AMD** +* **VIA** +* **Transmeta** +* **NSC** +* **KVM** (Kernel-based Virtual Machine) +* **MSVM** (Microsoft Hyper-V or Windows Virtual PC) +* **VMware** +* **XenHVM** +* **Bhyve** +* **Hygon** + +# installing + +```go get github.com/klauspost/cpuid``` + +# example + +```Go +package main + +import ( + "fmt" + "github.com/klauspost/cpuid" +) + +func main() { + // Print basic CPU information: + fmt.Println("Name:", cpuid.CPU.BrandName) + fmt.Println("PhysicalCores:", cpuid.CPU.PhysicalCores) + fmt.Println("ThreadsPerCore:", cpuid.CPU.ThreadsPerCore) + fmt.Println("LogicalCores:", cpuid.CPU.LogicalCores) + fmt.Println("Family", cpuid.CPU.Family, "Model:", cpuid.CPU.Model) + fmt.Println("Features:", cpuid.CPU.Features) + fmt.Println("Cacheline bytes:", cpuid.CPU.CacheLine) + fmt.Println("L1 Data Cache:", cpuid.CPU.Cache.L1D, "bytes") + fmt.Println("L1 Instruction Cache:", cpuid.CPU.Cache.L1D, "bytes") + fmt.Println("L2 Cache:", cpuid.CPU.Cache.L2, "bytes") + fmt.Println("L3 Cache:", cpuid.CPU.Cache.L3, "bytes") + + // Test if we have a specific feature: + if cpuid.CPU.SSE() { + fmt.Println("We have Streaming SIMD Extensions") + } +} +``` + +Sample output: +``` +>go run main.go +Name: Intel(R) Core(TM) i5-2540M CPU @ 2.60GHz +PhysicalCores: 2 +ThreadsPerCore: 2 +LogicalCores: 4 +Family 6 Model: 42 +Features: CMOV,MMX,MMXEXT,SSE,SSE2,SSE3,SSSE3,SSE4.1,SSE4.2,AVX,AESNI,CLMUL +Cacheline bytes: 64 +We have Streaming SIMD Extensions +``` + +# private package + +In the "private" folder you can find an autogenerated version of the library you can include in your own packages. + +For this purpose all exports are removed, and functions and constants are lowercased. + +This is not a recommended way of using the library, but provided for convenience, if it is difficult for you to use external packages. + +# license + +This code is published under an MIT license. See LICENSE file for more information. diff --git a/vendor/github.com/klauspost/cpuid/cpuid.go b/vendor/github.com/klauspost/cpuid/cpuid.go new file mode 100644 index 0000000000..4921bcd551 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/cpuid.go @@ -0,0 +1,1308 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +// Package cpuid provides information about the CPU running the current program. +// +// CPU features are detected on startup, and kept for fast access through the life of the application. +// Currently x86 / x64 (AMD64) is supported. +// +// You can access the CPU information by accessing the shared CPU variable of the cpuid library. +// +// Package home: https://github.com/klauspost/cpuid +package cpuid + +import ( + "math" + "strings" +) + +// AMD refererence: https://www.amd.com/system/files/TechDocs/25481.pdf +// and Processor Programming Reference (PPR) + +// Vendor is a representation of a CPU vendor. +type Vendor int + +const ( + Other Vendor = iota + Intel + AMD + VIA + Transmeta + NSC + KVM // Kernel-based Virtual Machine + MSVM // Microsoft Hyper-V or Windows Virtual PC + VMware + XenHVM + Bhyve + Hygon +) + +const ( + CMOV = 1 << iota // i686 CMOV + NX // NX (No-Execute) bit + AMD3DNOW // AMD 3DNOW + AMD3DNOWEXT // AMD 3DNowExt + MMX // standard MMX + MMXEXT // SSE integer functions or AMD MMX ext + SSE // SSE functions + SSE2 // P4 SSE functions + SSE3 // Prescott SSE3 functions + SSSE3 // Conroe SSSE3 functions + SSE4 // Penryn SSE4.1 functions + SSE4A // AMD Barcelona microarchitecture SSE4a instructions + SSE42 // Nehalem SSE4.2 functions + AVX // AVX functions + AVX2 // AVX2 functions + FMA3 // Intel FMA 3 + FMA4 // Bulldozer FMA4 functions + XOP // Bulldozer XOP functions + F16C // Half-precision floating-point conversion + BMI1 // Bit Manipulation Instruction Set 1 + BMI2 // Bit Manipulation Instruction Set 2 + TBM // AMD Trailing Bit Manipulation + LZCNT // LZCNT instruction + POPCNT // POPCNT instruction + AESNI // Advanced Encryption Standard New Instructions + CLMUL // Carry-less Multiplication + HTT // Hyperthreading (enabled) + HLE // Hardware Lock Elision + RTM // Restricted Transactional Memory + RDRAND // RDRAND instruction is available + RDSEED // RDSEED instruction is available + ADX // Intel ADX (Multi-Precision Add-Carry Instruction Extensions) + SHA // Intel SHA Extensions + AVX512F // AVX-512 Foundation + AVX512DQ // AVX-512 Doubleword and Quadword Instructions + AVX512IFMA // AVX-512 Integer Fused Multiply-Add Instructions + AVX512PF // AVX-512 Prefetch Instructions + AVX512ER // AVX-512 Exponential and Reciprocal Instructions + AVX512CD // AVX-512 Conflict Detection Instructions + AVX512BW // AVX-512 Byte and Word Instructions + AVX512VL // AVX-512 Vector Length Extensions + AVX512VBMI // AVX-512 Vector Bit Manipulation Instructions + AVX512VBMI2 // AVX-512 Vector Bit Manipulation Instructions, Version 2 + AVX512VNNI // AVX-512 Vector Neural Network Instructions + AVX512VPOPCNTDQ // AVX-512 Vector Population Count Doubleword and Quadword + GFNI // Galois Field New Instructions + VAES // Vector AES + AVX512BITALG // AVX-512 Bit Algorithms + VPCLMULQDQ // Carry-Less Multiplication Quadword + AVX512BF16 // AVX-512 BFLOAT16 Instructions + AVX512VP2INTERSECT // AVX-512 Intersect for D/Q + MPX // Intel MPX (Memory Protection Extensions) + ERMS // Enhanced REP MOVSB/STOSB + RDTSCP // RDTSCP Instruction + CX16 // CMPXCHG16B Instruction + SGX // Software Guard Extensions + SGXLC // Software Guard Extensions Launch Control + IBPB // Indirect Branch Restricted Speculation (IBRS) and Indirect Branch Predictor Barrier (IBPB) + STIBP // Single Thread Indirect Branch Predictors + VMX // Virtual Machine Extensions + + // Performance indicators + SSE2SLOW // SSE2 is supported, but usually not faster + SSE3SLOW // SSE3 is supported, but usually not faster + ATOM // Atom processor, some SSSE3 instructions are slower +) + +var flagNames = map[Flags]string{ + CMOV: "CMOV", // i686 CMOV + NX: "NX", // NX (No-Execute) bit + AMD3DNOW: "AMD3DNOW", // AMD 3DNOW + AMD3DNOWEXT: "AMD3DNOWEXT", // AMD 3DNowExt + MMX: "MMX", // Standard MMX + MMXEXT: "MMXEXT", // SSE integer functions or AMD MMX ext + SSE: "SSE", // SSE functions + SSE2: "SSE2", // P4 SSE2 functions + SSE3: "SSE3", // Prescott SSE3 functions + SSSE3: "SSSE3", // Conroe SSSE3 functions + SSE4: "SSE4.1", // Penryn SSE4.1 functions + SSE4A: "SSE4A", // AMD Barcelona microarchitecture SSE4a instructions + SSE42: "SSE4.2", // Nehalem SSE4.2 functions + AVX: "AVX", // AVX functions + AVX2: "AVX2", // AVX functions + FMA3: "FMA3", // Intel FMA 3 + FMA4: "FMA4", // Bulldozer FMA4 functions + XOP: "XOP", // Bulldozer XOP functions + F16C: "F16C", // Half-precision floating-point conversion + BMI1: "BMI1", // Bit Manipulation Instruction Set 1 + BMI2: "BMI2", // Bit Manipulation Instruction Set 2 + TBM: "TBM", // AMD Trailing Bit Manipulation + LZCNT: "LZCNT", // LZCNT instruction + POPCNT: "POPCNT", // POPCNT instruction + AESNI: "AESNI", // Advanced Encryption Standard New Instructions + CLMUL: "CLMUL", // Carry-less Multiplication + HTT: "HTT", // Hyperthreading (enabled) + HLE: "HLE", // Hardware Lock Elision + RTM: "RTM", // Restricted Transactional Memory + RDRAND: "RDRAND", // RDRAND instruction is available + RDSEED: "RDSEED", // RDSEED instruction is available + ADX: "ADX", // Intel ADX (Multi-Precision Add-Carry Instruction Extensions) + SHA: "SHA", // Intel SHA Extensions + AVX512F: "AVX512F", // AVX-512 Foundation + AVX512DQ: "AVX512DQ", // AVX-512 Doubleword and Quadword Instructions + AVX512IFMA: "AVX512IFMA", // AVX-512 Integer Fused Multiply-Add Instructions + AVX512PF: "AVX512PF", // AVX-512 Prefetch Instructions + AVX512ER: "AVX512ER", // AVX-512 Exponential and Reciprocal Instructions + AVX512CD: "AVX512CD", // AVX-512 Conflict Detection Instructions + AVX512BW: "AVX512BW", // AVX-512 Byte and Word Instructions + AVX512VL: "AVX512VL", // AVX-512 Vector Length Extensions + AVX512VBMI: "AVX512VBMI", // AVX-512 Vector Bit Manipulation Instructions + AVX512VBMI2: "AVX512VBMI2", // AVX-512 Vector Bit Manipulation Instructions, Version 2 + AVX512VNNI: "AVX512VNNI", // AVX-512 Vector Neural Network Instructions + AVX512VPOPCNTDQ: "AVX512VPOPCNTDQ", // AVX-512 Vector Population Count Doubleword and Quadword + GFNI: "GFNI", // Galois Field New Instructions + VAES: "VAES", // Vector AES + AVX512BITALG: "AVX512BITALG", // AVX-512 Bit Algorithms + VPCLMULQDQ: "VPCLMULQDQ", // Carry-Less Multiplication Quadword + AVX512BF16: "AVX512BF16", // AVX-512 BFLOAT16 Instruction + AVX512VP2INTERSECT: "AVX512VP2INTERSECT", // AVX-512 Intersect for D/Q + MPX: "MPX", // Intel MPX (Memory Protection Extensions) + ERMS: "ERMS", // Enhanced REP MOVSB/STOSB + RDTSCP: "RDTSCP", // RDTSCP Instruction + CX16: "CX16", // CMPXCHG16B Instruction + SGX: "SGX", // Software Guard Extensions + SGXLC: "SGXLC", // Software Guard Extensions Launch Control + IBPB: "IBPB", // Indirect Branch Restricted Speculation and Indirect Branch Predictor Barrier + STIBP: "STIBP", // Single Thread Indirect Branch Predictors + VMX: "VMX", // Virtual Machine Extensions + + // Performance indicators + SSE2SLOW: "SSE2SLOW", // SSE2 supported, but usually not faster + SSE3SLOW: "SSE3SLOW", // SSE3 supported, but usually not faster + ATOM: "ATOM", // Atom processor, some SSSE3 instructions are slower + +} + +// CPUInfo contains information about the detected system CPU. +type CPUInfo struct { + BrandName string // Brand name reported by the CPU + VendorID Vendor // Comparable CPU vendor ID + Features Flags // Features of the CPU + PhysicalCores int // Number of physical processor cores in your CPU. Will be 0 if undetectable. + ThreadsPerCore int // Number of threads per physical core. Will be 1 if undetectable. + LogicalCores int // Number of physical cores times threads that can run on each core through the use of hyperthreading. Will be 0 if undetectable. + Family int // CPU family number + Model int // CPU model number + CacheLine int // Cache line size in bytes. Will be 0 if undetectable. + Hz int64 // Clock speed, if known + Cache struct { + L1I int // L1 Instruction Cache (per core or shared). Will be -1 if undetected + L1D int // L1 Data Cache (per core or shared). Will be -1 if undetected + L2 int // L2 Cache (per core or shared). Will be -1 if undetected + L3 int // L3 Cache (per core, per ccx or shared). Will be -1 if undetected + } + SGX SGXSupport + maxFunc uint32 + maxExFunc uint32 +} + +var cpuid func(op uint32) (eax, ebx, ecx, edx uint32) +var cpuidex func(op, op2 uint32) (eax, ebx, ecx, edx uint32) +var xgetbv func(index uint32) (eax, edx uint32) +var rdtscpAsm func() (eax, ebx, ecx, edx uint32) + +// CPU contains information about the CPU as detected on startup, +// or when Detect last was called. +// +// Use this as the primary entry point to you data, +// this way queries are +var CPU CPUInfo + +func init() { + initCPU() + Detect() +} + +// Detect will re-detect current CPU info. +// This will replace the content of the exported CPU variable. +// +// Unless you expect the CPU to change while you are running your program +// you should not need to call this function. +// If you call this, you must ensure that no other goroutine is accessing the +// exported CPU variable. +func Detect() { + CPU.maxFunc = maxFunctionID() + CPU.maxExFunc = maxExtendedFunction() + CPU.BrandName = brandName() + CPU.CacheLine = cacheLine() + CPU.Family, CPU.Model = familyModel() + CPU.Features = support() + CPU.SGX = hasSGX(CPU.Features&SGX != 0, CPU.Features&SGXLC != 0) + CPU.ThreadsPerCore = threadsPerCore() + CPU.LogicalCores = logicalCores() + CPU.PhysicalCores = physicalCores() + CPU.VendorID = vendorID() + CPU.Hz = hertz(CPU.BrandName) + CPU.cacheSize() +} + +// Generated here: http://play.golang.org/p/BxFH2Gdc0G + +// Cmov indicates support of CMOV instructions +func (c CPUInfo) Cmov() bool { + return c.Features&CMOV != 0 +} + +// Amd3dnow indicates support of AMD 3DNOW! instructions +func (c CPUInfo) Amd3dnow() bool { + return c.Features&AMD3DNOW != 0 +} + +// Amd3dnowExt indicates support of AMD 3DNOW! Extended instructions +func (c CPUInfo) Amd3dnowExt() bool { + return c.Features&AMD3DNOWEXT != 0 +} + +// VMX indicates support of VMX +func (c CPUInfo) VMX() bool { + return c.Features&VMX != 0 +} + +// MMX indicates support of MMX instructions +func (c CPUInfo) MMX() bool { + return c.Features&MMX != 0 +} + +// MMXExt indicates support of MMXEXT instructions +// (SSE integer functions or AMD MMX ext) +func (c CPUInfo) MMXExt() bool { + return c.Features&MMXEXT != 0 +} + +// SSE indicates support of SSE instructions +func (c CPUInfo) SSE() bool { + return c.Features&SSE != 0 +} + +// SSE2 indicates support of SSE 2 instructions +func (c CPUInfo) SSE2() bool { + return c.Features&SSE2 != 0 +} + +// SSE3 indicates support of SSE 3 instructions +func (c CPUInfo) SSE3() bool { + return c.Features&SSE3 != 0 +} + +// SSSE3 indicates support of SSSE 3 instructions +func (c CPUInfo) SSSE3() bool { + return c.Features&SSSE3 != 0 +} + +// SSE4 indicates support of SSE 4 (also called SSE 4.1) instructions +func (c CPUInfo) SSE4() bool { + return c.Features&SSE4 != 0 +} + +// SSE42 indicates support of SSE4.2 instructions +func (c CPUInfo) SSE42() bool { + return c.Features&SSE42 != 0 +} + +// AVX indicates support of AVX instructions +// and operating system support of AVX instructions +func (c CPUInfo) AVX() bool { + return c.Features&AVX != 0 +} + +// AVX2 indicates support of AVX2 instructions +func (c CPUInfo) AVX2() bool { + return c.Features&AVX2 != 0 +} + +// FMA3 indicates support of FMA3 instructions +func (c CPUInfo) FMA3() bool { + return c.Features&FMA3 != 0 +} + +// FMA4 indicates support of FMA4 instructions +func (c CPUInfo) FMA4() bool { + return c.Features&FMA4 != 0 +} + +// XOP indicates support of XOP instructions +func (c CPUInfo) XOP() bool { + return c.Features&XOP != 0 +} + +// F16C indicates support of F16C instructions +func (c CPUInfo) F16C() bool { + return c.Features&F16C != 0 +} + +// BMI1 indicates support of BMI1 instructions +func (c CPUInfo) BMI1() bool { + return c.Features&BMI1 != 0 +} + +// BMI2 indicates support of BMI2 instructions +func (c CPUInfo) BMI2() bool { + return c.Features&BMI2 != 0 +} + +// TBM indicates support of TBM instructions +// (AMD Trailing Bit Manipulation) +func (c CPUInfo) TBM() bool { + return c.Features&TBM != 0 +} + +// Lzcnt indicates support of LZCNT instruction +func (c CPUInfo) Lzcnt() bool { + return c.Features&LZCNT != 0 +} + +// Popcnt indicates support of POPCNT instruction +func (c CPUInfo) Popcnt() bool { + return c.Features&POPCNT != 0 +} + +// HTT indicates the processor has Hyperthreading enabled +func (c CPUInfo) HTT() bool { + return c.Features&HTT != 0 +} + +// SSE2Slow indicates that SSE2 may be slow on this processor +func (c CPUInfo) SSE2Slow() bool { + return c.Features&SSE2SLOW != 0 +} + +// SSE3Slow indicates that SSE3 may be slow on this processor +func (c CPUInfo) SSE3Slow() bool { + return c.Features&SSE3SLOW != 0 +} + +// AesNi indicates support of AES-NI instructions +// (Advanced Encryption Standard New Instructions) +func (c CPUInfo) AesNi() bool { + return c.Features&AESNI != 0 +} + +// Clmul indicates support of CLMUL instructions +// (Carry-less Multiplication) +func (c CPUInfo) Clmul() bool { + return c.Features&CLMUL != 0 +} + +// NX indicates support of NX (No-Execute) bit +func (c CPUInfo) NX() bool { + return c.Features&NX != 0 +} + +// SSE4A indicates support of AMD Barcelona microarchitecture SSE4a instructions +func (c CPUInfo) SSE4A() bool { + return c.Features&SSE4A != 0 +} + +// HLE indicates support of Hardware Lock Elision +func (c CPUInfo) HLE() bool { + return c.Features&HLE != 0 +} + +// RTM indicates support of Restricted Transactional Memory +func (c CPUInfo) RTM() bool { + return c.Features&RTM != 0 +} + +// Rdrand indicates support of RDRAND instruction is available +func (c CPUInfo) Rdrand() bool { + return c.Features&RDRAND != 0 +} + +// Rdseed indicates support of RDSEED instruction is available +func (c CPUInfo) Rdseed() bool { + return c.Features&RDSEED != 0 +} + +// ADX indicates support of Intel ADX (Multi-Precision Add-Carry Instruction Extensions) +func (c CPUInfo) ADX() bool { + return c.Features&ADX != 0 +} + +// SHA indicates support of Intel SHA Extensions +func (c CPUInfo) SHA() bool { + return c.Features&SHA != 0 +} + +// AVX512F indicates support of AVX-512 Foundation +func (c CPUInfo) AVX512F() bool { + return c.Features&AVX512F != 0 +} + +// AVX512DQ indicates support of AVX-512 Doubleword and Quadword Instructions +func (c CPUInfo) AVX512DQ() bool { + return c.Features&AVX512DQ != 0 +} + +// AVX512IFMA indicates support of AVX-512 Integer Fused Multiply-Add Instructions +func (c CPUInfo) AVX512IFMA() bool { + return c.Features&AVX512IFMA != 0 +} + +// AVX512PF indicates support of AVX-512 Prefetch Instructions +func (c CPUInfo) AVX512PF() bool { + return c.Features&AVX512PF != 0 +} + +// AVX512ER indicates support of AVX-512 Exponential and Reciprocal Instructions +func (c CPUInfo) AVX512ER() bool { + return c.Features&AVX512ER != 0 +} + +// AVX512CD indicates support of AVX-512 Conflict Detection Instructions +func (c CPUInfo) AVX512CD() bool { + return c.Features&AVX512CD != 0 +} + +// AVX512BW indicates support of AVX-512 Byte and Word Instructions +func (c CPUInfo) AVX512BW() bool { + return c.Features&AVX512BW != 0 +} + +// AVX512VL indicates support of AVX-512 Vector Length Extensions +func (c CPUInfo) AVX512VL() bool { + return c.Features&AVX512VL != 0 +} + +// AVX512VBMI indicates support of AVX-512 Vector Bit Manipulation Instructions +func (c CPUInfo) AVX512VBMI() bool { + return c.Features&AVX512VBMI != 0 +} + +// AVX512VBMI2 indicates support of AVX-512 Vector Bit Manipulation Instructions, Version 2 +func (c CPUInfo) AVX512VBMI2() bool { + return c.Features&AVX512VBMI2 != 0 +} + +// AVX512VNNI indicates support of AVX-512 Vector Neural Network Instructions +func (c CPUInfo) AVX512VNNI() bool { + return c.Features&AVX512VNNI != 0 +} + +// AVX512VPOPCNTDQ indicates support of AVX-512 Vector Population Count Doubleword and Quadword +func (c CPUInfo) AVX512VPOPCNTDQ() bool { + return c.Features&AVX512VPOPCNTDQ != 0 +} + +// GFNI indicates support of Galois Field New Instructions +func (c CPUInfo) GFNI() bool { + return c.Features&GFNI != 0 +} + +// VAES indicates support of Vector AES +func (c CPUInfo) VAES() bool { + return c.Features&VAES != 0 +} + +// AVX512BITALG indicates support of AVX-512 Bit Algorithms +func (c CPUInfo) AVX512BITALG() bool { + return c.Features&AVX512BITALG != 0 +} + +// VPCLMULQDQ indicates support of Carry-Less Multiplication Quadword +func (c CPUInfo) VPCLMULQDQ() bool { + return c.Features&VPCLMULQDQ != 0 +} + +// AVX512BF16 indicates support of +func (c CPUInfo) AVX512BF16() bool { + return c.Features&AVX512BF16 != 0 +} + +// AVX512VP2INTERSECT indicates support of +func (c CPUInfo) AVX512VP2INTERSECT() bool { + return c.Features&AVX512VP2INTERSECT != 0 +} + +// MPX indicates support of Intel MPX (Memory Protection Extensions) +func (c CPUInfo) MPX() bool { + return c.Features&MPX != 0 +} + +// ERMS indicates support of Enhanced REP MOVSB/STOSB +func (c CPUInfo) ERMS() bool { + return c.Features&ERMS != 0 +} + +// RDTSCP Instruction is available. +func (c CPUInfo) RDTSCP() bool { + return c.Features&RDTSCP != 0 +} + +// CX16 indicates if CMPXCHG16B instruction is available. +func (c CPUInfo) CX16() bool { + return c.Features&CX16 != 0 +} + +// TSX is split into HLE (Hardware Lock Elision) and RTM (Restricted Transactional Memory) detection. +// So TSX simply checks that. +func (c CPUInfo) TSX() bool { + return c.Features&(HLE|RTM) == HLE|RTM +} + +// Atom indicates an Atom processor +func (c CPUInfo) Atom() bool { + return c.Features&ATOM != 0 +} + +// Intel returns true if vendor is recognized as Intel +func (c CPUInfo) Intel() bool { + return c.VendorID == Intel +} + +// AMD returns true if vendor is recognized as AMD +func (c CPUInfo) AMD() bool { + return c.VendorID == AMD +} + +// Hygon returns true if vendor is recognized as Hygon +func (c CPUInfo) Hygon() bool { + return c.VendorID == Hygon +} + +// Transmeta returns true if vendor is recognized as Transmeta +func (c CPUInfo) Transmeta() bool { + return c.VendorID == Transmeta +} + +// NSC returns true if vendor is recognized as National Semiconductor +func (c CPUInfo) NSC() bool { + return c.VendorID == NSC +} + +// VIA returns true if vendor is recognized as VIA +func (c CPUInfo) VIA() bool { + return c.VendorID == VIA +} + +// RTCounter returns the 64-bit time-stamp counter +// Uses the RDTSCP instruction. The value 0 is returned +// if the CPU does not support the instruction. +func (c CPUInfo) RTCounter() uint64 { + if !c.RDTSCP() { + return 0 + } + a, _, _, d := rdtscpAsm() + return uint64(a) | (uint64(d) << 32) +} + +// Ia32TscAux returns the IA32_TSC_AUX part of the RDTSCP. +// This variable is OS dependent, but on Linux contains information +// about the current cpu/core the code is running on. +// If the RDTSCP instruction isn't supported on the CPU, the value 0 is returned. +func (c CPUInfo) Ia32TscAux() uint32 { + if !c.RDTSCP() { + return 0 + } + _, _, ecx, _ := rdtscpAsm() + return ecx +} + +// LogicalCPU will return the Logical CPU the code is currently executing on. +// This is likely to change when the OS re-schedules the running thread +// to another CPU. +// If the current core cannot be detected, -1 will be returned. +func (c CPUInfo) LogicalCPU() int { + if c.maxFunc < 1 { + return -1 + } + _, ebx, _, _ := cpuid(1) + return int(ebx >> 24) +} + +// hertz tries to compute the clock speed of the CPU. If leaf 15 is +// supported, use it, otherwise parse the brand string. Yes, really. +func hertz(model string) int64 { + mfi := maxFunctionID() + if mfi >= 0x15 { + eax, ebx, ecx, _ := cpuid(0x15) + if eax != 0 && ebx != 0 && ecx != 0 { + return int64((int64(ecx) * int64(ebx)) / int64(eax)) + } + } + // computeHz determines the official rated speed of a CPU from its brand + // string. This insanity is *actually the official documented way to do + // this according to Intel*, prior to leaf 0x15 existing. The official + // documentation only shows this working for exactly `x.xx` or `xxxx` + // cases, e.g., `2.50GHz` or `1300MHz`; this parser will accept other + // sizes. + hz := strings.LastIndex(model, "Hz") + if hz < 3 { + return -1 + } + var multiplier int64 + switch model[hz-1] { + case 'M': + multiplier = 1000 * 1000 + case 'G': + multiplier = 1000 * 1000 * 1000 + case 'T': + multiplier = 1000 * 1000 * 1000 * 1000 + } + if multiplier == 0 { + return -1 + } + freq := int64(0) + divisor := int64(0) + decimalShift := int64(1) + var i int + for i = hz - 2; i >= 0 && model[i] != ' '; i-- { + if model[i] >= '0' && model[i] <= '9' { + freq += int64(model[i]-'0') * decimalShift + decimalShift *= 10 + } else if model[i] == '.' { + if divisor != 0 { + return -1 + } + divisor = decimalShift + } else { + return -1 + } + } + // we didn't find a space + if i < 0 { + return -1 + } + if divisor != 0 { + return (freq * multiplier) / divisor + } + return freq * multiplier +} + +// VM Will return true if the cpu id indicates we are in +// a virtual machine. This is only a hint, and will very likely +// have many false negatives. +func (c CPUInfo) VM() bool { + switch c.VendorID { + case MSVM, KVM, VMware, XenHVM, Bhyve: + return true + } + return false +} + +// Flags contains detected cpu features and caracteristics +type Flags uint64 + +// String returns a string representation of the detected +// CPU features. +func (f Flags) String() string { + return strings.Join(f.Strings(), ",") +} + +// Strings returns and array of the detected features. +func (f Flags) Strings() []string { + s := support() + r := make([]string, 0, 20) + for i := uint(0); i < 64; i++ { + key := Flags(1 << i) + val := flagNames[key] + if s&key != 0 { + r = append(r, val) + } + } + return r +} + +func maxExtendedFunction() uint32 { + eax, _, _, _ := cpuid(0x80000000) + return eax +} + +func maxFunctionID() uint32 { + a, _, _, _ := cpuid(0) + return a +} + +func brandName() string { + if maxExtendedFunction() >= 0x80000004 { + v := make([]uint32, 0, 48) + for i := uint32(0); i < 3; i++ { + a, b, c, d := cpuid(0x80000002 + i) + v = append(v, a, b, c, d) + } + return strings.Trim(string(valAsString(v...)), " ") + } + return "unknown" +} + +func threadsPerCore() int { + mfi := maxFunctionID() + if mfi < 0x4 || (vendorID() != Intel && vendorID() != AMD) { + return 1 + } + + if mfi < 0xb { + if vendorID() != Intel { + return 1 + } + _, b, _, d := cpuid(1) + if (d & (1 << 28)) != 0 { + // v will contain logical core count + v := (b >> 16) & 255 + if v > 1 { + a4, _, _, _ := cpuid(4) + // physical cores + v2 := (a4 >> 26) + 1 + if v2 > 0 { + return int(v) / int(v2) + } + } + } + return 1 + } + _, b, _, _ := cpuidex(0xb, 0) + if b&0xffff == 0 { + return 1 + } + return int(b & 0xffff) +} + +func logicalCores() int { + mfi := maxFunctionID() + switch vendorID() { + case Intel: + // Use this on old Intel processors + if mfi < 0xb { + if mfi < 1 { + return 0 + } + // CPUID.1:EBX[23:16] represents the maximum number of addressable IDs (initial APIC ID) + // that can be assigned to logical processors in a physical package. + // The value may not be the same as the number of logical processors that are present in the hardware of a physical package. + _, ebx, _, _ := cpuid(1) + logical := (ebx >> 16) & 0xff + return int(logical) + } + _, b, _, _ := cpuidex(0xb, 1) + return int(b & 0xffff) + case AMD, Hygon: + _, b, _, _ := cpuid(1) + return int((b >> 16) & 0xff) + default: + return 0 + } +} + +func familyModel() (int, int) { + if maxFunctionID() < 0x1 { + return 0, 0 + } + eax, _, _, _ := cpuid(1) + family := ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff) + model := ((eax >> 4) & 0xf) + ((eax >> 12) & 0xf0) + return int(family), int(model) +} + +func physicalCores() int { + switch vendorID() { + case Intel: + return logicalCores() / threadsPerCore() + case AMD, Hygon: + lc := logicalCores() + tpc := threadsPerCore() + if lc > 0 && tpc > 0 { + return lc / tpc + } + // The following is inaccurate on AMD EPYC 7742 64-Core Processor + + if maxExtendedFunction() >= 0x80000008 { + _, _, c, _ := cpuid(0x80000008) + return int(c&0xff) + 1 + } + } + return 0 +} + +// Except from http://en.wikipedia.org/wiki/CPUID#EAX.3D0:_Get_vendor_ID +var vendorMapping = map[string]Vendor{ + "AMDisbetter!": AMD, + "AuthenticAMD": AMD, + "CentaurHauls": VIA, + "GenuineIntel": Intel, + "TransmetaCPU": Transmeta, + "GenuineTMx86": Transmeta, + "Geode by NSC": NSC, + "VIA VIA VIA ": VIA, + "KVMKVMKVMKVM": KVM, + "Microsoft Hv": MSVM, + "VMwareVMware": VMware, + "XenVMMXenVMM": XenHVM, + "bhyve bhyve ": Bhyve, + "HygonGenuine": Hygon, +} + +func vendorID() Vendor { + _, b, c, d := cpuid(0) + v := valAsString(b, d, c) + vend, ok := vendorMapping[string(v)] + if !ok { + return Other + } + return vend +} + +func cacheLine() int { + if maxFunctionID() < 0x1 { + return 0 + } + + _, ebx, _, _ := cpuid(1) + cache := (ebx & 0xff00) >> 5 // cflush size + if cache == 0 && maxExtendedFunction() >= 0x80000006 { + _, _, ecx, _ := cpuid(0x80000006) + cache = ecx & 0xff // cacheline size + } + // TODO: Read from Cache and TLB Information + return int(cache) +} + +func (c *CPUInfo) cacheSize() { + c.Cache.L1D = -1 + c.Cache.L1I = -1 + c.Cache.L2 = -1 + c.Cache.L3 = -1 + vendor := vendorID() + switch vendor { + case Intel: + if maxFunctionID() < 4 { + return + } + for i := uint32(0); ; i++ { + eax, ebx, ecx, _ := cpuidex(4, i) + cacheType := eax & 15 + if cacheType == 0 { + break + } + cacheLevel := (eax >> 5) & 7 + coherency := int(ebx&0xfff) + 1 + partitions := int((ebx>>12)&0x3ff) + 1 + associativity := int((ebx>>22)&0x3ff) + 1 + sets := int(ecx) + 1 + size := associativity * partitions * coherency * sets + switch cacheLevel { + case 1: + if cacheType == 1 { + // 1 = Data Cache + c.Cache.L1D = size + } else if cacheType == 2 { + // 2 = Instruction Cache + c.Cache.L1I = size + } else { + if c.Cache.L1D < 0 { + c.Cache.L1I = size + } + if c.Cache.L1I < 0 { + c.Cache.L1I = size + } + } + case 2: + c.Cache.L2 = size + case 3: + c.Cache.L3 = size + } + } + case AMD, Hygon: + // Untested. + if maxExtendedFunction() < 0x80000005 { + return + } + _, _, ecx, edx := cpuid(0x80000005) + c.Cache.L1D = int(((ecx >> 24) & 0xFF) * 1024) + c.Cache.L1I = int(((edx >> 24) & 0xFF) * 1024) + + if maxExtendedFunction() < 0x80000006 { + return + } + _, _, ecx, _ = cpuid(0x80000006) + c.Cache.L2 = int(((ecx >> 16) & 0xFFFF) * 1024) + + // CPUID Fn8000_001D_EAX_x[N:0] Cache Properties + if maxExtendedFunction() < 0x8000001D { + return + } + for i := uint32(0); i < math.MaxUint32; i++ { + eax, ebx, ecx, _ := cpuidex(0x8000001D, i) + + level := (eax >> 5) & 7 + cacheNumSets := ecx + 1 + cacheLineSize := 1 + (ebx & 2047) + cachePhysPartitions := 1 + ((ebx >> 12) & 511) + cacheNumWays := 1 + ((ebx >> 22) & 511) + + typ := eax & 15 + size := int(cacheNumSets * cacheLineSize * cachePhysPartitions * cacheNumWays) + if typ == 0 { + return + } + + switch level { + case 1: + switch typ { + case 1: + // Data cache + c.Cache.L1D = size + case 2: + // Inst cache + c.Cache.L1I = size + default: + if c.Cache.L1D < 0 { + c.Cache.L1I = size + } + if c.Cache.L1I < 0 { + c.Cache.L1I = size + } + } + case 2: + c.Cache.L2 = size + case 3: + c.Cache.L3 = size + } + } + } + + return +} + +type SGXEPCSection struct { + BaseAddress uint64 + EPCSize uint64 +} + +type SGXSupport struct { + Available bool + LaunchControl bool + SGX1Supported bool + SGX2Supported bool + MaxEnclaveSizeNot64 int64 + MaxEnclaveSize64 int64 + EPCSections []SGXEPCSection +} + +func hasSGX(available, lc bool) (rval SGXSupport) { + rval.Available = available + + if !available { + return + } + + rval.LaunchControl = lc + + a, _, _, d := cpuidex(0x12, 0) + rval.SGX1Supported = a&0x01 != 0 + rval.SGX2Supported = a&0x02 != 0 + rval.MaxEnclaveSizeNot64 = 1 << (d & 0xFF) // pow 2 + rval.MaxEnclaveSize64 = 1 << ((d >> 8) & 0xFF) // pow 2 + rval.EPCSections = make([]SGXEPCSection, 0) + + for subleaf := uint32(2); subleaf < 2+8; subleaf++ { + eax, ebx, ecx, edx := cpuidex(0x12, subleaf) + leafType := eax & 0xf + + if leafType == 0 { + // Invalid subleaf, stop iterating + break + } else if leafType == 1 { + // EPC Section subleaf + baseAddress := uint64(eax&0xfffff000) + (uint64(ebx&0x000fffff) << 32) + size := uint64(ecx&0xfffff000) + (uint64(edx&0x000fffff) << 32) + + section := SGXEPCSection{BaseAddress: baseAddress, EPCSize: size} + rval.EPCSections = append(rval.EPCSections, section) + } + } + + return +} + +func support() Flags { + mfi := maxFunctionID() + vend := vendorID() + if mfi < 0x1 { + return 0 + } + rval := uint64(0) + _, _, c, d := cpuid(1) + if (d & (1 << 15)) != 0 { + rval |= CMOV + } + if (d & (1 << 23)) != 0 { + rval |= MMX + } + if (d & (1 << 25)) != 0 { + rval |= MMXEXT + } + if (d & (1 << 25)) != 0 { + rval |= SSE + } + if (d & (1 << 26)) != 0 { + rval |= SSE2 + } + if (c & 1) != 0 { + rval |= SSE3 + } + if (c & (1 << 5)) != 0 { + rval |= VMX + } + if (c & 0x00000200) != 0 { + rval |= SSSE3 + } + if (c & 0x00080000) != 0 { + rval |= SSE4 + } + if (c & 0x00100000) != 0 { + rval |= SSE42 + } + if (c & (1 << 25)) != 0 { + rval |= AESNI + } + if (c & (1 << 1)) != 0 { + rval |= CLMUL + } + if c&(1<<23) != 0 { + rval |= POPCNT + } + if c&(1<<30) != 0 { + rval |= RDRAND + } + if c&(1<<29) != 0 { + rval |= F16C + } + if c&(1<<13) != 0 { + rval |= CX16 + } + if vend == Intel && (d&(1<<28)) != 0 && mfi >= 4 { + if threadsPerCore() > 1 { + rval |= HTT + } + } + if vend == AMD && (d&(1<<28)) != 0 && mfi >= 4 { + if threadsPerCore() > 1 { + rval |= HTT + } + } + // Check XGETBV, OXSAVE and AVX bits + if c&(1<<26) != 0 && c&(1<<27) != 0 && c&(1<<28) != 0 { + // Check for OS support + eax, _ := xgetbv(0) + if (eax & 0x6) == 0x6 { + rval |= AVX + if (c & 0x00001000) != 0 { + rval |= FMA3 + } + } + } + + // Check AVX2, AVX2 requires OS support, but BMI1/2 don't. + if mfi >= 7 { + _, ebx, ecx, edx := cpuidex(7, 0) + eax1, _, _, _ := cpuidex(7, 1) + if (rval&AVX) != 0 && (ebx&0x00000020) != 0 { + rval |= AVX2 + } + if (ebx & 0x00000008) != 0 { + rval |= BMI1 + if (ebx & 0x00000100) != 0 { + rval |= BMI2 + } + } + if ebx&(1<<2) != 0 { + rval |= SGX + } + if ebx&(1<<4) != 0 { + rval |= HLE + } + if ebx&(1<<9) != 0 { + rval |= ERMS + } + if ebx&(1<<11) != 0 { + rval |= RTM + } + if ebx&(1<<14) != 0 { + rval |= MPX + } + if ebx&(1<<18) != 0 { + rval |= RDSEED + } + if ebx&(1<<19) != 0 { + rval |= ADX + } + if ebx&(1<<29) != 0 { + rval |= SHA + } + if edx&(1<<26) != 0 { + rval |= IBPB + } + if ecx&(1<<30) != 0 { + rval |= SGXLC + } + if edx&(1<<27) != 0 { + rval |= STIBP + } + + // Only detect AVX-512 features if XGETBV is supported + if c&((1<<26)|(1<<27)) == (1<<26)|(1<<27) { + // Check for OS support + eax, _ := xgetbv(0) + + // Verify that XCR0[7:5] = ‘111b’ (OPMASK state, upper 256-bit of ZMM0-ZMM15 and + // ZMM16-ZMM31 state are enabled by OS) + /// and that XCR0[2:1] = ‘11b’ (XMM state and YMM state are enabled by OS). + if (eax>>5)&7 == 7 && (eax>>1)&3 == 3 { + if ebx&(1<<16) != 0 { + rval |= AVX512F + } + if ebx&(1<<17) != 0 { + rval |= AVX512DQ + } + if ebx&(1<<21) != 0 { + rval |= AVX512IFMA + } + if ebx&(1<<26) != 0 { + rval |= AVX512PF + } + if ebx&(1<<27) != 0 { + rval |= AVX512ER + } + if ebx&(1<<28) != 0 { + rval |= AVX512CD + } + if ebx&(1<<30) != 0 { + rval |= AVX512BW + } + if ebx&(1<<31) != 0 { + rval |= AVX512VL + } + // ecx + if ecx&(1<<1) != 0 { + rval |= AVX512VBMI + } + if ecx&(1<<6) != 0 { + rval |= AVX512VBMI2 + } + if ecx&(1<<8) != 0 { + rval |= GFNI + } + if ecx&(1<<9) != 0 { + rval |= VAES + } + if ecx&(1<<10) != 0 { + rval |= VPCLMULQDQ + } + if ecx&(1<<11) != 0 { + rval |= AVX512VNNI + } + if ecx&(1<<12) != 0 { + rval |= AVX512BITALG + } + if ecx&(1<<14) != 0 { + rval |= AVX512VPOPCNTDQ + } + // edx + if edx&(1<<8) != 0 { + rval |= AVX512VP2INTERSECT + } + // cpuid eax 07h,ecx=1 + if eax1&(1<<5) != 0 { + rval |= AVX512BF16 + } + } + } + } + + if maxExtendedFunction() >= 0x80000001 { + _, _, c, d := cpuid(0x80000001) + if (c & (1 << 5)) != 0 { + rval |= LZCNT + rval |= POPCNT + } + if (d & (1 << 31)) != 0 { + rval |= AMD3DNOW + } + if (d & (1 << 30)) != 0 { + rval |= AMD3DNOWEXT + } + if (d & (1 << 23)) != 0 { + rval |= MMX + } + if (d & (1 << 22)) != 0 { + rval |= MMXEXT + } + if (c & (1 << 6)) != 0 { + rval |= SSE4A + } + if d&(1<<20) != 0 { + rval |= NX + } + if d&(1<<27) != 0 { + rval |= RDTSCP + } + + /* Allow for selectively disabling SSE2 functions on AMD processors + with SSE2 support but not SSE4a. This includes Athlon64, some + Opteron, and some Sempron processors. MMX, SSE, or 3DNow! are faster + than SSE2 often enough to utilize this special-case flag. + AV_CPU_FLAG_SSE2 and AV_CPU_FLAG_SSE2SLOW are both set in this case + so that SSE2 is used unless explicitly disabled by checking + AV_CPU_FLAG_SSE2SLOW. */ + if vendorID() != Intel && + rval&SSE2 != 0 && (c&0x00000040) == 0 { + rval |= SSE2SLOW + } + + /* XOP and FMA4 use the AVX instruction coding scheme, so they can't be + * used unless the OS has AVX support. */ + if (rval & AVX) != 0 { + if (c & 0x00000800) != 0 { + rval |= XOP + } + if (c & 0x00010000) != 0 { + rval |= FMA4 + } + } + + if vendorID() == Intel { + family, model := familyModel() + if family == 6 && (model == 9 || model == 13 || model == 14) { + /* 6/9 (pentium-m "banias"), 6/13 (pentium-m "dothan"), and + * 6/14 (core1 "yonah") theoretically support sse2, but it's + * usually slower than mmx. */ + if (rval & SSE2) != 0 { + rval |= SSE2SLOW + } + if (rval & SSE3) != 0 { + rval |= SSE3SLOW + } + } + /* The Atom processor has SSSE3 support, which is useful in many cases, + * but sometimes the SSSE3 version is slower than the SSE2 equivalent + * on the Atom, but is generally faster on other processors supporting + * SSSE3. This flag allows for selectively disabling certain SSSE3 + * functions on the Atom. */ + if family == 6 && model == 28 { + rval |= ATOM + } + } + } + return Flags(rval) +} + +func valAsString(values ...uint32) []byte { + r := make([]byte, 4*len(values)) + for i, v := range values { + dst := r[i*4:] + dst[0] = byte(v & 0xff) + dst[1] = byte((v >> 8) & 0xff) + dst[2] = byte((v >> 16) & 0xff) + dst[3] = byte((v >> 24) & 0xff) + switch { + case dst[0] == 0: + return r[:i*4] + case dst[1] == 0: + return r[:i*4+1] + case dst[2] == 0: + return r[:i*4+2] + case dst[3] == 0: + return r[:i*4+3] + } + } + return r +} diff --git a/vendor/github.com/klauspost/cpuid/v2/cpuid_386.s b/vendor/github.com/klauspost/cpuid/cpuid_386.s similarity index 96% rename from vendor/github.com/klauspost/cpuid/v2/cpuid_386.s rename to vendor/github.com/klauspost/cpuid/cpuid_386.s index 089638f51a..4d731711e4 100644 --- a/vendor/github.com/klauspost/cpuid/v2/cpuid_386.s +++ b/vendor/github.com/klauspost/cpuid/cpuid_386.s @@ -1,6 +1,6 @@ // Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. -//+build 386,!gccgo,!noasm,!appengine +// +build 386,!gccgo // func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32) TEXT ·asmCpuid(SB), 7, $0 diff --git a/vendor/github.com/klauspost/cpuid/v2/cpuid_amd64.s b/vendor/github.com/klauspost/cpuid/cpuid_amd64.s similarity index 95% rename from vendor/github.com/klauspost/cpuid/v2/cpuid_amd64.s rename to vendor/github.com/klauspost/cpuid/cpuid_amd64.s index 3ba0559e93..3c1d60e422 100644 --- a/vendor/github.com/klauspost/cpuid/v2/cpuid_amd64.s +++ b/vendor/github.com/klauspost/cpuid/cpuid_amd64.s @@ -1,6 +1,6 @@ // Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. -//+build amd64,!gccgo,!noasm,!appengine +//+build amd64,!gccgo // func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32) TEXT ·asmCpuid(SB), 7, $0 diff --git a/vendor/github.com/klauspost/cpuid/detect_intel.go b/vendor/github.com/klauspost/cpuid/detect_intel.go new file mode 100644 index 0000000000..a5f04dd6d0 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/detect_intel.go @@ -0,0 +1,17 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +// +build 386,!gccgo amd64,!gccgo + +package cpuid + +func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32) +func asmCpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32) +func asmXgetbv(index uint32) (eax, edx uint32) +func asmRdtscpAsm() (eax, ebx, ecx, edx uint32) + +func initCPU() { + cpuid = asmCpuid + cpuidex = asmCpuidex + xgetbv = asmXgetbv + rdtscpAsm = asmRdtscpAsm +} diff --git a/vendor/github.com/klauspost/cpuid/detect_ref.go b/vendor/github.com/klauspost/cpuid/detect_ref.go new file mode 100644 index 0000000000..909c5d9a7a --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/detect_ref.go @@ -0,0 +1,23 @@ +// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. + +// +build !amd64,!386 gccgo + +package cpuid + +func initCPU() { + cpuid = func(op uint32) (eax, ebx, ecx, edx uint32) { + return 0, 0, 0, 0 + } + + cpuidex = func(op, op2 uint32) (eax, ebx, ecx, edx uint32) { + return 0, 0, 0, 0 + } + + xgetbv = func(index uint32) (eax, edx uint32) { + return 0, 0 + } + + rdtscpAsm = func() (eax, ebx, ecx, edx uint32) { + return 0, 0, 0, 0 + } +} diff --git a/vendor/github.com/klauspost/cpuid/generate.go b/vendor/github.com/klauspost/cpuid/generate.go new file mode 100644 index 0000000000..90e7a98d27 --- /dev/null +++ b/vendor/github.com/klauspost/cpuid/generate.go @@ -0,0 +1,4 @@ +package cpuid + +//go:generate go run private-gen.go +//go:generate gofmt -w ./private diff --git a/vendor/github.com/klauspost/cpuid/v2/.travis.yml b/vendor/github.com/klauspost/cpuid/v2/.travis.yml deleted file mode 100644 index b8e4d02b1b..0000000000 --- a/vendor/github.com/klauspost/cpuid/v2/.travis.yml +++ /dev/null @@ -1,63 +0,0 @@ -language: go - -os: - - linux - - osx - - windows - -arch: - - amd64 - - arm64 - -go: - - 1.13.x - - 1.14.x - - 1.15.x - - master - -script: - - go vet ./... - - go test -test.v -test.run ^TestCPUID$ - - go test -race ./... - - go test -tags=noasm ./... - -matrix: - allow_failures: - - go: 'master' - fast_finish: true - include: - - stage: gofmt - go: 1.15.x - os: linux - arch: amd64 - script: - - diff <(gofmt -d .) <(printf "") - - diff <(gofmt -d ./private) <(printf "") - - go install github.com/klauspost/asmfmt/cmd/asmfmt - - diff <(asmfmt -d .) <(printf "") - - stage: i386 - go: 1.15.x - os: linux - arch: amd64 - script: - - GOOS=linux GOARCH=386 go test . - - stage: buildotherprev - go: 1.14.x - os: linux - arch: amd64 - script: - - GOOS=darwin GOARCH=arm64 go build . - - GOOS=freebsd GOARCH=arm64 go build . - - GOOS=netbsd GOARCH=arm64 go build . - - GOOS=freebsd GOARCH=amd64 go build . - - GOOS=netbsd GOARCH=amd64 go build . - - stage: buildother - go: 1.15.x - os: linux - arch: amd64 - script: - - GOOS=darwin GOARCH=arm64 go build . - - GOOS=freebsd GOARCH=arm64 go build . - - GOOS=netbsd GOARCH=arm64 go build . - - GOOS=freebsd GOARCH=amd64 go build . - - GOOS=netbsd GOARCH=amd64 go build . diff --git a/vendor/github.com/klauspost/cpuid/v2/README.md b/vendor/github.com/klauspost/cpuid/v2/README.md deleted file mode 100644 index eaf1959719..0000000000 --- a/vendor/github.com/klauspost/cpuid/v2/README.md +++ /dev/null @@ -1,136 +0,0 @@ -# cpuid -Package cpuid provides information about the CPU running the current program. - -CPU features are detected on startup, and kept for fast access through the life of the application. -Currently x86 / x64 (AMD64/i386) and ARM (ARM64) is supported, and no external C (cgo) code is used, which should make the library very easy to use. - -You can access the CPU information by accessing the shared CPU variable of the cpuid library. - -Package home: https://github.com/klauspost/cpuid - -[![PkgGoDev](https://pkg.go.dev/badge/github.com/klauspost/cpuid)](https://pkg.go.dev/github.com/klauspost/cpuid/v2) -[![Build Status][3]][4] - -[3]: https://travis-ci.org/klauspost/cpuid.svg?branch=master -[4]: https://travis-ci.org/klauspost/cpuid - -## installing - -`go get -u github.com/klauspost/cpuid/v2` using modules. - -Drop `v2` for others. - -## example - -```Go -package main - -import ( - "fmt" - "strings" - - . "github.com/klauspost/cpuid/v2" -) - -func main() { - // Print basic CPU information: - fmt.Println("Name:", CPU.BrandName) - fmt.Println("PhysicalCores:", CPU.PhysicalCores) - fmt.Println("ThreadsPerCore:", CPU.ThreadsPerCore) - fmt.Println("LogicalCores:", CPU.LogicalCores) - fmt.Println("Family", CPU.Family, "Model:", CPU.Model, "Vendor ID:", CPU.VendorID) - fmt.Println("Features:", fmt.Sprintf(strings.Join(CPU.FeatureSet(), ","))) - fmt.Println("Cacheline bytes:", CPU.CacheLine) - fmt.Println("L1 Data Cache:", CPU.Cache.L1D, "bytes") - fmt.Println("L1 Instruction Cache:", CPU.Cache.L1D, "bytes") - fmt.Println("L2 Cache:", CPU.Cache.L2, "bytes") - fmt.Println("L3 Cache:", CPU.Cache.L3, "bytes") - fmt.Println("Frequency", CPU.Hz, "hz") - - // Test if we have these specific features: - if CPU.Supports(SSE, SSE2) { - fmt.Println("We have Streaming SIMD 2 Extensions") - } -} -``` - -Sample output: -``` ->go run main.go -Name: AMD Ryzen 9 3950X 16-Core Processor -PhysicalCores: 16 -ThreadsPerCore: 2 -LogicalCores: 32 -Family 23 Model: 113 Vendor ID: AMD -Features: ADX,AESNI,AVX,AVX2,BMI1,BMI2,CLMUL,CMOV,CX16,F16C,FMA3,HTT,HYPERVISOR,LZCNT,MMX,MMXEXT,NX,POPCNT,RDRAND,RDSEED,RDTSCP,SHA,SSE,SSE2,SSE3,SSE4,SSE42,SSE4A,SSSE3 -Cacheline bytes: 64 -L1 Data Cache: 32768 bytes -L1 Instruction Cache: 32768 bytes -L2 Cache: 524288 bytes -L3 Cache: 16777216 bytes -Frequency 0 hz -We have Streaming SIMD 2 Extensions -``` - -# usage - -The `cpuid.CPU` provides access to CPU features. Use `cpuid.CPU.Supports()` to access CPU features. - -Note that for some cpu/os combinations some features will not be detected. -`amd64` has rather good support and should work reliably on all platforms. - -Note that hypervisors may not pass through all CPU features. - -## arm64 feature detection - -Not all operating systems provide ARM features directly -and there is no safe way to do so for the rest. - -Currently `arm64/linux` and `arm64/freebsd` should be quite reliable. -`arm64/darwin` adds features expected from the M1 processor, but a lot remains undetected. - -A `DetectARM()` can be used if you are able to control your deployment, -it will detect CPU features, but may crash if the OS doesn't intercept the calls. -A `-cpu.arm` flag for detecting unsafe ARM features can be added. See below. - -Note that currently only features are detected on ARM, -no additional information is currently available. - -## flags - -It is possible to add flags that affects cpu detection. - -For this the `Flags()` command is provided. - -This must be called *before* `flag.Parse()` AND after the flags have been parsed `Detect()` must be called. - -This means that any detection used in `init()` functions will not contain these flags. - -Example: - -```Go -package main - -import ( - "flag" - "fmt" - "strings" - - "github.com/klauspost/cpuid/v2" -) - -func main() { - cpuid.Flags() - flag.Parse() - cpuid.Detect() - - // Test if we have these specific features: - if cpuid.CPU.Supports(cpuid.SSE, cpuid.SSE2) { - fmt.Println("We have Streaming SIMD 2 Extensions") - } -} -``` - -# license - -This code is published under an MIT license. See LICENSE file for more information. diff --git a/vendor/github.com/klauspost/cpuid/v2/cpuid.go b/vendor/github.com/klauspost/cpuid/v2/cpuid.go deleted file mode 100644 index c2cdd7f564..0000000000 --- a/vendor/github.com/klauspost/cpuid/v2/cpuid.go +++ /dev/null @@ -1,1002 +0,0 @@ -// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. - -// Package cpuid provides information about the CPU running the current program. -// -// CPU features are detected on startup, and kept for fast access through the life of the application. -// Currently x86 / x64 (AMD64) as well as arm64 is supported. -// -// You can access the CPU information by accessing the shared CPU variable of the cpuid library. -// -// Package home: https://github.com/klauspost/cpuid -package cpuid - -import ( - "flag" - "math" - "strings" -) - -// AMD refererence: https://www.amd.com/system/files/TechDocs/25481.pdf -// and Processor Programming Reference (PPR) - -// Vendor is a representation of a CPU vendor. -type Vendor int - -const ( - VendorUnknown Vendor = iota - Intel - AMD - VIA - Transmeta - NSC - KVM // Kernel-based Virtual Machine - MSVM // Microsoft Hyper-V or Windows Virtual PC - VMware - XenHVM - Bhyve - Hygon - SiS - RDC - - Ampere - ARM - Broadcom - Cavium - DEC - Fujitsu - Infineon - Motorola - NVIDIA - AMCC - Qualcomm - Marvell - - lastVendor -) - -//go:generate stringer -type=FeatureID,Vendor - -// FeatureID is the ID of a specific cpu feature. -type FeatureID int - -const ( - // Keep index -1 as unknown - UNKNOWN = -1 - - // Add features - ADX FeatureID = iota // Intel ADX (Multi-Precision Add-Carry Instruction Extensions) - AESNI // Advanced Encryption Standard New Instructions - AMD3DNOW // AMD 3DNOW - AMD3DNOWEXT // AMD 3DNowExt - AMXBF16 // Tile computational operations on BFLOAT16 numbers - AMXINT8 // Tile computational operations on 8-bit integers - AMXTILE // Tile architecture - AVX // AVX functions - AVX2 // AVX2 functions - AVX512BF16 // AVX-512 BFLOAT16 Instructions - AVX512BITALG // AVX-512 Bit Algorithms - AVX512BW // AVX-512 Byte and Word Instructions - AVX512CD // AVX-512 Conflict Detection Instructions - AVX512DQ // AVX-512 Doubleword and Quadword Instructions - AVX512ER // AVX-512 Exponential and Reciprocal Instructions - AVX512F // AVX-512 Foundation - AVX512IFMA // AVX-512 Integer Fused Multiply-Add Instructions - AVX512PF // AVX-512 Prefetch Instructions - AVX512VBMI // AVX-512 Vector Bit Manipulation Instructions - AVX512VBMI2 // AVX-512 Vector Bit Manipulation Instructions, Version 2 - AVX512VL // AVX-512 Vector Length Extensions - AVX512VNNI // AVX-512 Vector Neural Network Instructions - AVX512VP2INTERSECT // AVX-512 Intersect for D/Q - AVX512VPOPCNTDQ // AVX-512 Vector Population Count Doubleword and Quadword - AVXSLOW // Indicates the CPU performs 2 128 bit operations instead of one. - BMI1 // Bit Manipulation Instruction Set 1 - BMI2 // Bit Manipulation Instruction Set 2 - CLDEMOTE // Cache Line Demote - CLMUL // Carry-less Multiplication - CMOV // i686 CMOV - CX16 // CMPXCHG16B Instruction - ENQCMD // Enqueue Command - ERMS // Enhanced REP MOVSB/STOSB - F16C // Half-precision floating-point conversion - FMA3 // Intel FMA 3. Does not imply AVX. - FMA4 // Bulldozer FMA4 functions - GFNI // Galois Field New Instructions - HLE // Hardware Lock Elision - HTT // Hyperthreading (enabled) - HYPERVISOR // This bit has been reserved by Intel & AMD for use by hypervisors - IBPB // Indirect Branch Restricted Speculation (IBRS) and Indirect Branch Predictor Barrier (IBPB) - IBS // Instruction Based Sampling (AMD) - IBSBRNTRGT // Instruction Based Sampling Feature (AMD) - IBSFETCHSAM // Instruction Based Sampling Feature (AMD) - IBSFFV // Instruction Based Sampling Feature (AMD) - IBSOPCNT // Instruction Based Sampling Feature (AMD) - IBSOPCNTEXT // Instruction Based Sampling Feature (AMD) - IBSOPSAM // Instruction Based Sampling Feature (AMD) - IBSRDWROPCNT // Instruction Based Sampling Feature (AMD) - IBSRIPINVALIDCHK // Instruction Based Sampling Feature (AMD) - LZCNT // LZCNT instruction - MMX // standard MMX - MMXEXT // SSE integer functions or AMD MMX ext - MOVDIR64B // Move 64 Bytes as Direct Store - MOVDIRI // Move Doubleword as Direct Store - MPX // Intel MPX (Memory Protection Extensions) - NX // NX (No-Execute) bit - POPCNT // POPCNT instruction - RDRAND // RDRAND instruction is available - RDSEED // RDSEED instruction is available - RDTSCP // RDTSCP Instruction - RTM // Restricted Transactional Memory - SERIALIZE // Serialize Instruction Execution - SGX // Software Guard Extensions - SGXLC // Software Guard Extensions Launch Control - SHA // Intel SHA Extensions - SSE // SSE functions - SSE2 // P4 SSE functions - SSE3 // Prescott SSE3 functions - SSE4 // Penryn SSE4.1 functions - SSE42 // Nehalem SSE4.2 functions - SSE4A // AMD Barcelona microarchitecture SSE4a instructions - SSSE3 // Conroe SSSE3 functions - STIBP // Single Thread Indirect Branch Predictors - TBM // AMD Trailing Bit Manipulation - TSXLDTRK // Intel TSX Suspend Load Address Tracking - VAES // Vector AES - VMX // Virtual Machine Extensions - VPCLMULQDQ // Carry-Less Multiplication Quadword - WAITPKG // TPAUSE, UMONITOR, UMWAIT - WBNOINVD // Write Back and Do Not Invalidate Cache - XOP // Bulldozer XOP functions - - // ARM features: - AESARM // AES instructions - ARMCPUID // Some CPU ID registers readable at user-level - ASIMD // Advanced SIMD - ASIMDDP // SIMD Dot Product - ASIMDHP // Advanced SIMD half-precision floating point - ASIMDRDM // Rounding Double Multiply Accumulate/Subtract (SQRDMLAH/SQRDMLSH) - ATOMICS // Large System Extensions (LSE) - CRC32 // CRC32/CRC32C instructions - DCPOP // Data cache clean to Point of Persistence (DC CVAP) - EVTSTRM // Generic timer - FCMA // Floatin point complex number addition and multiplication - FP // Single-precision and double-precision floating point - FPHP // Half-precision floating point - GPA // Generic Pointer Authentication - JSCVT // Javascript-style double->int convert (FJCVTZS) - LRCPC // Weaker release consistency (LDAPR, etc) - PMULL // Polynomial Multiply instructions (PMULL/PMULL2) - SHA1 // SHA-1 instructions (SHA1C, etc) - SHA2 // SHA-2 instructions (SHA256H, etc) - SHA3 // SHA-3 instructions (EOR3, RAXI, XAR, BCAX) - SHA512 // SHA512 instructions - SM3 // SM3 instructions - SM4 // SM4 instructions - SVE // Scalable Vector Extension - - // Keep it last. It automatically defines the size of []flagSet - lastID - - firstID FeatureID = UNKNOWN + 1 -) - -// CPUInfo contains information about the detected system CPU. -type CPUInfo struct { - BrandName string // Brand name reported by the CPU - VendorID Vendor // Comparable CPU vendor ID - VendorString string // Raw vendor string. - featureSet flagSet // Features of the CPU - PhysicalCores int // Number of physical processor cores in your CPU. Will be 0 if undetectable. - ThreadsPerCore int // Number of threads per physical core. Will be 1 if undetectable. - LogicalCores int // Number of physical cores times threads that can run on each core through the use of hyperthreading. Will be 0 if undetectable. - Family int // CPU family number - Model int // CPU model number - CacheLine int // Cache line size in bytes. Will be 0 if undetectable. - Hz int64 // Clock speed, if known, 0 otherwise - Cache struct { - L1I int // L1 Instruction Cache (per core or shared). Will be -1 if undetected - L1D int // L1 Data Cache (per core or shared). Will be -1 if undetected - L2 int // L2 Cache (per core or shared). Will be -1 if undetected - L3 int // L3 Cache (per core, per ccx or shared). Will be -1 if undetected - } - SGX SGXSupport - maxFunc uint32 - maxExFunc uint32 -} - -var cpuid func(op uint32) (eax, ebx, ecx, edx uint32) -var cpuidex func(op, op2 uint32) (eax, ebx, ecx, edx uint32) -var xgetbv func(index uint32) (eax, edx uint32) -var rdtscpAsm func() (eax, ebx, ecx, edx uint32) - -// CPU contains information about the CPU as detected on startup, -// or when Detect last was called. -// -// Use this as the primary entry point to you data. -var CPU CPUInfo - -func init() { - initCPU() - Detect() -} - -// Detect will re-detect current CPU info. -// This will replace the content of the exported CPU variable. -// -// Unless you expect the CPU to change while you are running your program -// you should not need to call this function. -// If you call this, you must ensure that no other goroutine is accessing the -// exported CPU variable. -func Detect() { - // Set defaults - CPU.ThreadsPerCore = 1 - CPU.Cache.L1I = -1 - CPU.Cache.L1D = -1 - CPU.Cache.L2 = -1 - CPU.Cache.L3 = -1 - safe := true - if detectArmFlag != nil { - safe = !*detectArmFlag - } - addInfo(&CPU, safe) - if disableFlag != nil { - s := strings.Split(*disableFlag, ",") - for _, feat := range s { - feat := ParseFeature(strings.TrimSpace(feat)) - if feat != UNKNOWN { - CPU.featureSet.unset(feat) - } - } - } -} - -// DetectARM will detect ARM64 features. -// This is NOT done automatically since it can potentially crash -// if the OS does not handle the command. -// If in the future this can be done safely this function may not -// do anything. -func DetectARM() { - addInfo(&CPU, false) -} - -var detectArmFlag *bool -var disableFlag *string - -// Flags will enable flags. -// This must be called *before* flag.Parse AND -// Detect must be called after the flags have been parsed. -// Note that this means that any detection used in init() functions -// will not contain these flags. -func Flags() { - disableFlag = flag.String("cpu.disable", "", "disable cpu features; comma separated list") - detectArmFlag = flag.Bool("cpu.arm", false, "allow ARM features to be detected; can potentially crash") -} - -// Supports returns whether the CPU supports all of the requested features. -func (c CPUInfo) Supports(ids ...FeatureID) bool { - for _, id := range ids { - if !c.featureSet.inSet(id) { - return false - } - } - return true -} - -// Disable will disable one or several features. -func (c *CPUInfo) Disable(ids ...FeatureID) bool { - for _, id := range ids { - c.featureSet.unset(id) - } - return true -} - -// Enable will disable one or several features even if they were undetected. -// This is of course not recommended for obvious reasons. -func (c *CPUInfo) Enable(ids ...FeatureID) bool { - for _, id := range ids { - c.featureSet.set(id) - } - return true -} - -// IsVendor returns true if vendor is recognized as Intel -func (c CPUInfo) IsVendor(v Vendor) bool { - return c.VendorID == v -} - -func (c CPUInfo) FeatureSet() []string { - s := make([]string, 0) - for _, f := range c.featureSet.Strings() { - s = append(s, f) - } - return s -} - -// RTCounter returns the 64-bit time-stamp counter -// Uses the RDTSCP instruction. The value 0 is returned -// if the CPU does not support the instruction. -func (c CPUInfo) RTCounter() uint64 { - if !c.Supports(RDTSCP) { - return 0 - } - a, _, _, d := rdtscpAsm() - return uint64(a) | (uint64(d) << 32) -} - -// Ia32TscAux returns the IA32_TSC_AUX part of the RDTSCP. -// This variable is OS dependent, but on Linux contains information -// about the current cpu/core the code is running on. -// If the RDTSCP instruction isn't supported on the CPU, the value 0 is returned. -func (c CPUInfo) Ia32TscAux() uint32 { - if !c.Supports(RDTSCP) { - return 0 - } - _, _, ecx, _ := rdtscpAsm() - return ecx -} - -// LogicalCPU will return the Logical CPU the code is currently executing on. -// This is likely to change when the OS re-schedules the running thread -// to another CPU. -// If the current core cannot be detected, -1 will be returned. -func (c CPUInfo) LogicalCPU() int { - if c.maxFunc < 1 { - return -1 - } - _, ebx, _, _ := cpuid(1) - return int(ebx >> 24) -} - -// hertz tries to compute the clock speed of the CPU. If leaf 15 is -// supported, use it, otherwise parse the brand string. Yes, really. -func hertz(model string) int64 { - mfi := maxFunctionID() - if mfi >= 0x15 { - eax, ebx, ecx, _ := cpuid(0x15) - if eax != 0 && ebx != 0 && ecx != 0 { - return int64((int64(ecx) * int64(ebx)) / int64(eax)) - } - } - // computeHz determines the official rated speed of a CPU from its brand - // string. This insanity is *actually the official documented way to do - // this according to Intel*, prior to leaf 0x15 existing. The official - // documentation only shows this working for exactly `x.xx` or `xxxx` - // cases, e.g., `2.50GHz` or `1300MHz`; this parser will accept other - // sizes. - hz := strings.LastIndex(model, "Hz") - if hz < 3 { - return 0 - } - var multiplier int64 - switch model[hz-1] { - case 'M': - multiplier = 1000 * 1000 - case 'G': - multiplier = 1000 * 1000 * 1000 - case 'T': - multiplier = 1000 * 1000 * 1000 * 1000 - } - if multiplier == 0 { - return 0 - } - freq := int64(0) - divisor := int64(0) - decimalShift := int64(1) - var i int - for i = hz - 2; i >= 0 && model[i] != ' '; i-- { - if model[i] >= '0' && model[i] <= '9' { - freq += int64(model[i]-'0') * decimalShift - decimalShift *= 10 - } else if model[i] == '.' { - if divisor != 0 { - return 0 - } - divisor = decimalShift - } else { - return 0 - } - } - // we didn't find a space - if i < 0 { - return 0 - } - if divisor != 0 { - return (freq * multiplier) / divisor - } - return freq * multiplier -} - -// VM Will return true if the cpu id indicates we are in -// a virtual machine. -func (c CPUInfo) VM() bool { - return CPU.featureSet.inSet(HYPERVISOR) -} - -// flags contains detected cpu features and characteristics -type flags uint64 - -// log2(bits_in_uint64) -const flagBitsLog2 = 6 -const flagBits = 1 << flagBitsLog2 -const flagMask = flagBits - 1 - -// flagSet contains detected cpu features and characteristics in an array of flags -type flagSet [(lastID + flagMask) / flagBits]flags - -func (s flagSet) inSet(feat FeatureID) bool { - return s[feat>>flagBitsLog2]&(1<<(feat&flagMask)) != 0 -} - -func (s *flagSet) set(feat FeatureID) { - s[feat>>flagBitsLog2] |= 1 << (feat & flagMask) -} - -// setIf will set a feature if boolean is true. -func (s *flagSet) setIf(cond bool, features ...FeatureID) { - if cond { - for _, offset := range features { - s[offset>>flagBitsLog2] |= 1 << (offset & flagMask) - } - } -} - -func (s *flagSet) unset(offset FeatureID) { - bit := flags(1 << (offset & flagMask)) - s[offset>>flagBitsLog2] = s[offset>>flagBitsLog2] & ^bit -} - -// or with another flagset. -func (s *flagSet) or(other flagSet) { - for i, v := range other[:] { - s[i] |= v - } -} - -// ParseFeature will parse the string and return the ID of the matching feature. -// Will return UNKNOWN if not found. -func ParseFeature(s string) FeatureID { - s = strings.ToUpper(s) - for i := firstID; i < lastID; i++ { - if i.String() == s { - return i - } - } - return UNKNOWN -} - -// Strings returns an array of the detected features for FlagsSet. -func (s flagSet) Strings() []string { - if len(s) == 0 { - return []string{""} - } - r := make([]string, 0) - for i := firstID; i < lastID; i++ { - if s.inSet(i) { - r = append(r, i.String()) - } - } - return r -} - -func maxExtendedFunction() uint32 { - eax, _, _, _ := cpuid(0x80000000) - return eax -} - -func maxFunctionID() uint32 { - a, _, _, _ := cpuid(0) - return a -} - -func brandName() string { - if maxExtendedFunction() >= 0x80000004 { - v := make([]uint32, 0, 48) - for i := uint32(0); i < 3; i++ { - a, b, c, d := cpuid(0x80000002 + i) - v = append(v, a, b, c, d) - } - return strings.Trim(string(valAsString(v...)), " ") - } - return "unknown" -} - -func threadsPerCore() int { - mfi := maxFunctionID() - vend, _ := vendorID() - - if mfi < 0x4 || (vend != Intel && vend != AMD) { - return 1 - } - - if mfi < 0xb { - if vend != Intel { - return 1 - } - _, b, _, d := cpuid(1) - if (d & (1 << 28)) != 0 { - // v will contain logical core count - v := (b >> 16) & 255 - if v > 1 { - a4, _, _, _ := cpuid(4) - // physical cores - v2 := (a4 >> 26) + 1 - if v2 > 0 { - return int(v) / int(v2) - } - } - } - return 1 - } - _, b, _, _ := cpuidex(0xb, 0) - if b&0xffff == 0 { - if vend == AMD { - // Workaround for AMD returning 0, assume 2 if >= Zen 2 - // It will be more correct than not. - fam, _ := familyModel() - _, _, _, d := cpuid(1) - if (d&(1<<28)) != 0 && fam >= 23 { - return 2 - } - } - return 1 - } - return int(b & 0xffff) -} - -func logicalCores() int { - mfi := maxFunctionID() - v, _ := vendorID() - switch v { - case Intel: - // Use this on old Intel processors - if mfi < 0xb { - if mfi < 1 { - return 0 - } - // CPUID.1:EBX[23:16] represents the maximum number of addressable IDs (initial APIC ID) - // that can be assigned to logical processors in a physical package. - // The value may not be the same as the number of logical processors that are present in the hardware of a physical package. - _, ebx, _, _ := cpuid(1) - logical := (ebx >> 16) & 0xff - return int(logical) - } - _, b, _, _ := cpuidex(0xb, 1) - return int(b & 0xffff) - case AMD, Hygon: - _, b, _, _ := cpuid(1) - return int((b >> 16) & 0xff) - default: - return 0 - } -} - -func familyModel() (int, int) { - if maxFunctionID() < 0x1 { - return 0, 0 - } - eax, _, _, _ := cpuid(1) - family := ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff) - model := ((eax >> 4) & 0xf) + ((eax >> 12) & 0xf0) - return int(family), int(model) -} - -func physicalCores() int { - v, _ := vendorID() - switch v { - case Intel: - return logicalCores() / threadsPerCore() - case AMD, Hygon: - lc := logicalCores() - tpc := threadsPerCore() - if lc > 0 && tpc > 0 { - return lc / tpc - } - - // The following is inaccurate on AMD EPYC 7742 64-Core Processor - if maxExtendedFunction() >= 0x80000008 { - _, _, c, _ := cpuid(0x80000008) - if c&0xff > 0 { - return int(c&0xff) + 1 - } - } - } - return 0 -} - -// Except from http://en.wikipedia.org/wiki/CPUID#EAX.3D0:_Get_vendor_ID -var vendorMapping = map[string]Vendor{ - "AMDisbetter!": AMD, - "AuthenticAMD": AMD, - "CentaurHauls": VIA, - "GenuineIntel": Intel, - "TransmetaCPU": Transmeta, - "GenuineTMx86": Transmeta, - "Geode by NSC": NSC, - "VIA VIA VIA ": VIA, - "KVMKVMKVMKVM": KVM, - "Microsoft Hv": MSVM, - "VMwareVMware": VMware, - "XenVMMXenVMM": XenHVM, - "bhyve bhyve ": Bhyve, - "HygonGenuine": Hygon, - "Vortex86 SoC": SiS, - "SiS SiS SiS ": SiS, - "RiseRiseRise": SiS, - "Genuine RDC": RDC, -} - -func vendorID() (Vendor, string) { - _, b, c, d := cpuid(0) - v := string(valAsString(b, d, c)) - vend, ok := vendorMapping[v] - if !ok { - return VendorUnknown, v - } - return vend, v -} - -func cacheLine() int { - if maxFunctionID() < 0x1 { - return 0 - } - - _, ebx, _, _ := cpuid(1) - cache := (ebx & 0xff00) >> 5 // cflush size - if cache == 0 && maxExtendedFunction() >= 0x80000006 { - _, _, ecx, _ := cpuid(0x80000006) - cache = ecx & 0xff // cacheline size - } - // TODO: Read from Cache and TLB Information - return int(cache) -} - -func (c *CPUInfo) cacheSize() { - c.Cache.L1D = -1 - c.Cache.L1I = -1 - c.Cache.L2 = -1 - c.Cache.L3 = -1 - vendor, _ := vendorID() - switch vendor { - case Intel: - if maxFunctionID() < 4 { - return - } - for i := uint32(0); ; i++ { - eax, ebx, ecx, _ := cpuidex(4, i) - cacheType := eax & 15 - if cacheType == 0 { - break - } - cacheLevel := (eax >> 5) & 7 - coherency := int(ebx&0xfff) + 1 - partitions := int((ebx>>12)&0x3ff) + 1 - associativity := int((ebx>>22)&0x3ff) + 1 - sets := int(ecx) + 1 - size := associativity * partitions * coherency * sets - switch cacheLevel { - case 1: - if cacheType == 1 { - // 1 = Data Cache - c.Cache.L1D = size - } else if cacheType == 2 { - // 2 = Instruction Cache - c.Cache.L1I = size - } else { - if c.Cache.L1D < 0 { - c.Cache.L1I = size - } - if c.Cache.L1I < 0 { - c.Cache.L1I = size - } - } - case 2: - c.Cache.L2 = size - case 3: - c.Cache.L3 = size - } - } - case AMD, Hygon: - // Untested. - if maxExtendedFunction() < 0x80000005 { - return - } - _, _, ecx, edx := cpuid(0x80000005) - c.Cache.L1D = int(((ecx >> 24) & 0xFF) * 1024) - c.Cache.L1I = int(((edx >> 24) & 0xFF) * 1024) - - if maxExtendedFunction() < 0x80000006 { - return - } - _, _, ecx, _ = cpuid(0x80000006) - c.Cache.L2 = int(((ecx >> 16) & 0xFFFF) * 1024) - - // CPUID Fn8000_001D_EAX_x[N:0] Cache Properties - if maxExtendedFunction() < 0x8000001D { - return - } - for i := uint32(0); i < math.MaxUint32; i++ { - eax, ebx, ecx, _ := cpuidex(0x8000001D, i) - - level := (eax >> 5) & 7 - cacheNumSets := ecx + 1 - cacheLineSize := 1 + (ebx & 2047) - cachePhysPartitions := 1 + ((ebx >> 12) & 511) - cacheNumWays := 1 + ((ebx >> 22) & 511) - - typ := eax & 15 - size := int(cacheNumSets * cacheLineSize * cachePhysPartitions * cacheNumWays) - if typ == 0 { - return - } - - switch level { - case 1: - switch typ { - case 1: - // Data cache - c.Cache.L1D = size - case 2: - // Inst cache - c.Cache.L1I = size - default: - if c.Cache.L1D < 0 { - c.Cache.L1I = size - } - if c.Cache.L1I < 0 { - c.Cache.L1I = size - } - } - case 2: - c.Cache.L2 = size - case 3: - c.Cache.L3 = size - } - } - } - - return -} - -type SGXEPCSection struct { - BaseAddress uint64 - EPCSize uint64 -} - -type SGXSupport struct { - Available bool - LaunchControl bool - SGX1Supported bool - SGX2Supported bool - MaxEnclaveSizeNot64 int64 - MaxEnclaveSize64 int64 - EPCSections []SGXEPCSection -} - -func hasSGX(available, lc bool) (rval SGXSupport) { - rval.Available = available - - if !available { - return - } - - rval.LaunchControl = lc - - a, _, _, d := cpuidex(0x12, 0) - rval.SGX1Supported = a&0x01 != 0 - rval.SGX2Supported = a&0x02 != 0 - rval.MaxEnclaveSizeNot64 = 1 << (d & 0xFF) // pow 2 - rval.MaxEnclaveSize64 = 1 << ((d >> 8) & 0xFF) // pow 2 - rval.EPCSections = make([]SGXEPCSection, 0) - - for subleaf := uint32(2); subleaf < 2+8; subleaf++ { - eax, ebx, ecx, edx := cpuidex(0x12, subleaf) - leafType := eax & 0xf - - if leafType == 0 { - // Invalid subleaf, stop iterating - break - } else if leafType == 1 { - // EPC Section subleaf - baseAddress := uint64(eax&0xfffff000) + (uint64(ebx&0x000fffff) << 32) - size := uint64(ecx&0xfffff000) + (uint64(edx&0x000fffff) << 32) - - section := SGXEPCSection{BaseAddress: baseAddress, EPCSize: size} - rval.EPCSections = append(rval.EPCSections, section) - } - } - - return -} - -func support() flagSet { - var fs flagSet - mfi := maxFunctionID() - vend, _ := vendorID() - if mfi < 0x1 { - return fs - } - family, model := familyModel() - - _, _, c, d := cpuid(1) - fs.setIf((d&(1<<15)) != 0, CMOV) - fs.setIf((d&(1<<23)) != 0, MMX) - fs.setIf((d&(1<<25)) != 0, MMXEXT) - fs.setIf((d&(1<<25)) != 0, SSE) - fs.setIf((d&(1<<26)) != 0, SSE2) - fs.setIf((c&1) != 0, SSE3) - fs.setIf((c&(1<<5)) != 0, VMX) - fs.setIf((c&0x00000200) != 0, SSSE3) - fs.setIf((c&0x00080000) != 0, SSE4) - fs.setIf((c&0x00100000) != 0, SSE42) - fs.setIf((c&(1<<25)) != 0, AESNI) - fs.setIf((c&(1<<1)) != 0, CLMUL) - fs.setIf(c&(1<<23) != 0, POPCNT) - fs.setIf(c&(1<<30) != 0, RDRAND) - - // This bit has been reserved by Intel & AMD for use by hypervisors, - // and indicates the presence of a hypervisor. - fs.setIf(c&(1<<31) != 0, HYPERVISOR) - fs.setIf(c&(1<<29) != 0, F16C) - fs.setIf(c&(1<<13) != 0, CX16) - - if vend == Intel && (d&(1<<28)) != 0 && mfi >= 4 { - fs.setIf(threadsPerCore() > 1, HTT) - } - if vend == AMD && (d&(1<<28)) != 0 && mfi >= 4 { - fs.setIf(threadsPerCore() > 1, HTT) - } - // Check XGETBV/XSAVE (26), OXSAVE (27) and AVX (28) bits - const avxCheck = 1<<26 | 1<<27 | 1<<28 - if c&avxCheck == avxCheck { - // Check for OS support - eax, _ := xgetbv(0) - if (eax & 0x6) == 0x6 { - fs.set(AVX) - switch vend { - case Intel: - // Older than Haswell. - fs.setIf(family == 6 && model < 60, AVXSLOW) - case AMD: - // Older than Zen 2 - fs.setIf(family < 23 || (family == 23 && model < 49), AVXSLOW) - } - } - } - // FMA3 can be used with SSE registers, so no OS support is strictly needed. - // fma3 and OSXSAVE needed. - const fma3Check = 1<<12 | 1<<27 - fs.setIf(c&fma3Check == fma3Check, FMA3) - - // Check AVX2, AVX2 requires OS support, but BMI1/2 don't. - if mfi >= 7 { - _, ebx, ecx, edx := cpuidex(7, 0) - eax1, _, _, _ := cpuidex(7, 1) - if fs.inSet(AVX) && (ebx&0x00000020) != 0 { - fs.set(AVX2) - } - // CPUID.(EAX=7, ECX=0).EBX - if (ebx & 0x00000008) != 0 { - fs.set(BMI1) - fs.setIf((ebx&0x00000100) != 0, BMI2) - } - fs.setIf(ebx&(1<<2) != 0, SGX) - fs.setIf(ebx&(1<<4) != 0, HLE) - fs.setIf(ebx&(1<<9) != 0, ERMS) - fs.setIf(ebx&(1<<11) != 0, RTM) - fs.setIf(ebx&(1<<14) != 0, MPX) - fs.setIf(ebx&(1<<18) != 0, RDSEED) - fs.setIf(ebx&(1<<19) != 0, ADX) - fs.setIf(ebx&(1<<29) != 0, SHA) - // CPUID.(EAX=7, ECX=0).ECX - fs.setIf(ecx&(1<<5) != 0, WAITPKG) - fs.setIf(ecx&(1<<25) != 0, CLDEMOTE) - fs.setIf(ecx&(1<<27) != 0, MOVDIRI) - fs.setIf(ecx&(1<<28) != 0, MOVDIR64B) - fs.setIf(ecx&(1<<29) != 0, ENQCMD) - fs.setIf(ecx&(1<<30) != 0, SGXLC) - // CPUID.(EAX=7, ECX=0).EDX - fs.setIf(edx&(1<<14) != 0, SERIALIZE) - fs.setIf(edx&(1<<16) != 0, TSXLDTRK) - fs.setIf(edx&(1<<26) != 0, IBPB) - fs.setIf(edx&(1<<27) != 0, STIBP) - - // Only detect AVX-512 features if XGETBV is supported - if c&((1<<26)|(1<<27)) == (1<<26)|(1<<27) { - // Check for OS support - eax, _ := xgetbv(0) - - // Verify that XCR0[7:5] = ‘111b’ (OPMASK state, upper 256-bit of ZMM0-ZMM15 and - // ZMM16-ZMM31 state are enabled by OS) - /// and that XCR0[2:1] = ‘11b’ (XMM state and YMM state are enabled by OS). - if (eax>>5)&7 == 7 && (eax>>1)&3 == 3 { - fs.setIf(ebx&(1<<16) != 0, AVX512F) - fs.setIf(ebx&(1<<17) != 0, AVX512DQ) - fs.setIf(ebx&(1<<21) != 0, AVX512IFMA) - fs.setIf(ebx&(1<<26) != 0, AVX512PF) - fs.setIf(ebx&(1<<27) != 0, AVX512ER) - fs.setIf(ebx&(1<<28) != 0, AVX512CD) - fs.setIf(ebx&(1<<30) != 0, AVX512BW) - fs.setIf(ebx&(1<<31) != 0, AVX512VL) - // ecx - fs.setIf(ecx&(1<<1) != 0, AVX512VBMI) - fs.setIf(ecx&(1<<6) != 0, AVX512VBMI2) - fs.setIf(ecx&(1<<8) != 0, GFNI) - fs.setIf(ecx&(1<<9) != 0, VAES) - fs.setIf(ecx&(1<<10) != 0, VPCLMULQDQ) - fs.setIf(ecx&(1<<11) != 0, AVX512VNNI) - fs.setIf(ecx&(1<<12) != 0, AVX512BITALG) - fs.setIf(ecx&(1<<14) != 0, AVX512VPOPCNTDQ) - // edx - fs.setIf(edx&(1<<8) != 0, AVX512VP2INTERSECT) - fs.setIf(edx&(1<<22) != 0, AMXBF16) - fs.setIf(edx&(1<<24) != 0, AMXTILE) - fs.setIf(edx&(1<<25) != 0, AMXINT8) - // eax1 = CPUID.(EAX=7, ECX=1).EAX - fs.setIf(eax1&(1<<5) != 0, AVX512BF16) - } - } - } - - if maxExtendedFunction() >= 0x80000001 { - _, _, c, d := cpuid(0x80000001) - if (c & (1 << 5)) != 0 { - fs.set(LZCNT) - fs.set(POPCNT) - } - fs.setIf((c&(1<<10)) != 0, IBS) - fs.setIf((d&(1<<31)) != 0, AMD3DNOW) - fs.setIf((d&(1<<30)) != 0, AMD3DNOWEXT) - fs.setIf((d&(1<<23)) != 0, MMX) - fs.setIf((d&(1<<22)) != 0, MMXEXT) - fs.setIf((c&(1<<6)) != 0, SSE4A) - fs.setIf(d&(1<<20) != 0, NX) - fs.setIf(d&(1<<27) != 0, RDTSCP) - - /* XOP and FMA4 use the AVX instruction coding scheme, so they can't be - * used unless the OS has AVX support. */ - if fs.inSet(AVX) { - fs.setIf((c&0x00000800) != 0, XOP) - fs.setIf((c&0x00010000) != 0, FMA4) - } - - } - if maxExtendedFunction() >= 0x80000008 { - _, b, _, _ := cpuid(0x80000008) - fs.setIf((b&(1<<9)) != 0, WBNOINVD) - } - - if maxExtendedFunction() >= 0x8000001b && fs.inSet(IBS) { - eax, _, _, _ := cpuid(0x8000001b) - fs.setIf((eax>>0)&1 == 1, IBSFFV) - fs.setIf((eax>>1)&1 == 1, IBSFETCHSAM) - fs.setIf((eax>>2)&1 == 1, IBSOPSAM) - fs.setIf((eax>>3)&1 == 1, IBSRDWROPCNT) - fs.setIf((eax>>4)&1 == 1, IBSOPCNT) - fs.setIf((eax>>5)&1 == 1, IBSBRNTRGT) - fs.setIf((eax>>6)&1 == 1, IBSOPCNTEXT) - fs.setIf((eax>>7)&1 == 1, IBSRIPINVALIDCHK) - } - - return fs -} - -func valAsString(values ...uint32) []byte { - r := make([]byte, 4*len(values)) - for i, v := range values { - dst := r[i*4:] - dst[0] = byte(v & 0xff) - dst[1] = byte((v >> 8) & 0xff) - dst[2] = byte((v >> 16) & 0xff) - dst[3] = byte((v >> 24) & 0xff) - switch { - case dst[0] == 0: - return r[:i*4] - case dst[1] == 0: - return r[:i*4+1] - case dst[2] == 0: - return r[:i*4+2] - case dst[3] == 0: - return r[:i*4+3] - } - } - return r -} diff --git a/vendor/github.com/klauspost/cpuid/v2/cpuid_arm64.s b/vendor/github.com/klauspost/cpuid/v2/cpuid_arm64.s deleted file mode 100644 index b31d6aec43..0000000000 --- a/vendor/github.com/klauspost/cpuid/v2/cpuid_arm64.s +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. - -//+build arm64,!gccgo,!noasm,!appengine - -// See https://www.kernel.org/doc/Documentation/arm64/cpu-feature-registers.txt - -// func getMidr -TEXT ·getMidr(SB), 7, $0 - WORD $0xd5380000 // mrs x0, midr_el1 /* Main ID Register */ - MOVD R0, midr+0(FP) - RET - -// func getProcFeatures -TEXT ·getProcFeatures(SB), 7, $0 - WORD $0xd5380400 // mrs x0, id_aa64pfr0_el1 /* Processor Feature Register 0 */ - MOVD R0, procFeatures+0(FP) - RET - -// func getInstAttributes -TEXT ·getInstAttributes(SB), 7, $0 - WORD $0xd5380600 // mrs x0, id_aa64isar0_el1 /* Instruction Set Attribute Register 0 */ - WORD $0xd5380621 // mrs x1, id_aa64isar1_el1 /* Instruction Set Attribute Register 1 */ - MOVD R0, instAttrReg0+0(FP) - MOVD R1, instAttrReg1+8(FP) - RET - diff --git a/vendor/github.com/klauspost/cpuid/v2/detect_arm64.go b/vendor/github.com/klauspost/cpuid/v2/detect_arm64.go deleted file mode 100644 index 9bf9f77f37..0000000000 --- a/vendor/github.com/klauspost/cpuid/v2/detect_arm64.go +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. - -//+build arm64,!gccgo,!noasm,!appengine - -package cpuid - -import "runtime" - -func getMidr() (midr uint64) -func getProcFeatures() (procFeatures uint64) -func getInstAttributes() (instAttrReg0, instAttrReg1 uint64) - -func initCPU() { - cpuid = func(uint32) (a, b, c, d uint32) { return 0, 0, 0, 0 } - cpuidex = func(x, y uint32) (a, b, c, d uint32) { return 0, 0, 0, 0 } - xgetbv = func(uint32) (a, b uint32) { return 0, 0 } - rdtscpAsm = func() (a, b, c, d uint32) { return 0, 0, 0, 0 } -} - -func addInfo(c *CPUInfo, safe bool) { - // Seems to be safe to assume on ARM64 - c.CacheLine = 64 - detectOS(c) - - // ARM64 disabled since it may crash if interrupt is not intercepted by OS. - if safe && !c.Supports(ARMCPUID) && runtime.GOOS != "freebsd" { - return - } - midr := getMidr() - - // MIDR_EL1 - Main ID Register - // https://developer.arm.com/docs/ddi0595/h/aarch64-system-registers/midr_el1 - // x--------------------------------------------------x - // | Name | bits | visible | - // |--------------------------------------------------| - // | Implementer | [31-24] | y | - // |--------------------------------------------------| - // | Variant | [23-20] | y | - // |--------------------------------------------------| - // | Architecture | [19-16] | y | - // |--------------------------------------------------| - // | PartNum | [15-4] | y | - // |--------------------------------------------------| - // | Revision | [3-0] | y | - // x--------------------------------------------------x - - switch (midr >> 24) & 0xff { - case 0xC0: - c.VendorString = "Ampere Computing" - c.VendorID = Ampere - case 0x41: - c.VendorString = "Arm Limited" - c.VendorID = ARM - case 0x42: - c.VendorString = "Broadcom Corporation" - c.VendorID = Broadcom - case 0x43: - c.VendorString = "Cavium Inc" - c.VendorID = Cavium - case 0x44: - c.VendorString = "Digital Equipment Corporation" - c.VendorID = DEC - case 0x46: - c.VendorString = "Fujitsu Ltd" - c.VendorID = Fujitsu - case 0x49: - c.VendorString = "Infineon Technologies AG" - c.VendorID = Infineon - case 0x4D: - c.VendorString = "Motorola or Freescale Semiconductor Inc" - c.VendorID = Motorola - case 0x4E: - c.VendorString = "NVIDIA Corporation" - c.VendorID = NVIDIA - case 0x50: - c.VendorString = "Applied Micro Circuits Corporation" - c.VendorID = AMCC - case 0x51: - c.VendorString = "Qualcomm Inc" - c.VendorID = Qualcomm - case 0x56: - c.VendorString = "Marvell International Ltd" - c.VendorID = Marvell - case 0x69: - c.VendorString = "Intel Corporation" - c.VendorID = Intel - } - - // Lower 4 bits: Architecture - // Architecture Meaning - // 0b0001 Armv4. - // 0b0010 Armv4T. - // 0b0011 Armv5 (obsolete). - // 0b0100 Armv5T. - // 0b0101 Armv5TE. - // 0b0110 Armv5TEJ. - // 0b0111 Armv6. - // 0b1111 Architectural features are individually identified in the ID_* registers, see 'ID registers'. - // Upper 4 bit: Variant - // An IMPLEMENTATION DEFINED variant number. - // Typically, this field is used to distinguish between different product variants, or major revisions of a product. - c.Family = int(midr>>16) & 0xff - - // PartNum, bits [15:4] - // An IMPLEMENTATION DEFINED primary part number for the device. - // On processors implemented by Arm, if the top four bits of the primary - // part number are 0x0 or 0x7, the variant and architecture are encoded differently. - // Revision, bits [3:0] - // An IMPLEMENTATION DEFINED revision number for the device. - c.Model = int(midr) & 0xffff - - procFeatures := getProcFeatures() - - // ID_AA64PFR0_EL1 - Processor Feature Register 0 - // x--------------------------------------------------x - // | Name | bits | visible | - // |--------------------------------------------------| - // | DIT | [51-48] | y | - // |--------------------------------------------------| - // | SVE | [35-32] | y | - // |--------------------------------------------------| - // | GIC | [27-24] | n | - // |--------------------------------------------------| - // | AdvSIMD | [23-20] | y | - // |--------------------------------------------------| - // | FP | [19-16] | y | - // |--------------------------------------------------| - // | EL3 | [15-12] | n | - // |--------------------------------------------------| - // | EL2 | [11-8] | n | - // |--------------------------------------------------| - // | EL1 | [7-4] | n | - // |--------------------------------------------------| - // | EL0 | [3-0] | n | - // x--------------------------------------------------x - - var f flagSet - // if procFeatures&(0xf<<48) != 0 { - // fmt.Println("DIT") - // } - f.setIf(procFeatures&(0xf<<32) != 0, SVE) - if procFeatures&(0xf<<20) != 15<<20 { - f.set(ASIMD) - // https://developer.arm.com/docs/ddi0595/b/aarch64-system-registers/id_aa64pfr0_el1 - // 0b0001 --> As for 0b0000, and also includes support for half-precision floating-point arithmetic. - f.setIf(procFeatures&(0xf<<20) == 1<<20, FPHP, ASIMDHP) - } - f.setIf(procFeatures&(0xf<<16) != 0, FP) - - instAttrReg0, instAttrReg1 := getInstAttributes() - - // https://developer.arm.com/docs/ddi0595/b/aarch64-system-registers/id_aa64isar0_el1 - // - // ID_AA64ISAR0_EL1 - Instruction Set Attribute Register 0 - // x--------------------------------------------------x - // | Name | bits | visible | - // |--------------------------------------------------| - // | TS | [55-52] | y | - // |--------------------------------------------------| - // | FHM | [51-48] | y | - // |--------------------------------------------------| - // | DP | [47-44] | y | - // |--------------------------------------------------| - // | SM4 | [43-40] | y | - // |--------------------------------------------------| - // | SM3 | [39-36] | y | - // |--------------------------------------------------| - // | SHA3 | [35-32] | y | - // |--------------------------------------------------| - // | RDM | [31-28] | y | - // |--------------------------------------------------| - // | ATOMICS | [23-20] | y | - // |--------------------------------------------------| - // | CRC32 | [19-16] | y | - // |--------------------------------------------------| - // | SHA2 | [15-12] | y | - // |--------------------------------------------------| - // | SHA1 | [11-8] | y | - // |--------------------------------------------------| - // | AES | [7-4] | y | - // x--------------------------------------------------x - - // if instAttrReg0&(0xf<<52) != 0 { - // fmt.Println("TS") - // } - // if instAttrReg0&(0xf<<48) != 0 { - // fmt.Println("FHM") - // } - f.setIf(instAttrReg0&(0xf<<44) != 0, ASIMDDP) - f.setIf(instAttrReg0&(0xf<<40) != 0, SM4) - f.setIf(instAttrReg0&(0xf<<36) != 0, SM3) - f.setIf(instAttrReg0&(0xf<<32) != 0, SHA3) - f.setIf(instAttrReg0&(0xf<<28) != 0, ASIMDRDM) - f.setIf(instAttrReg0&(0xf<<20) != 0, ATOMICS) - f.setIf(instAttrReg0&(0xf<<16) != 0, CRC32) - f.setIf(instAttrReg0&(0xf<<12) != 0, SHA2) - // https://developer.arm.com/docs/ddi0595/b/aarch64-system-registers/id_aa64isar0_el1 - // 0b0010 --> As 0b0001, plus SHA512H, SHA512H2, SHA512SU0, and SHA512SU1 instructions implemented. - f.setIf(instAttrReg0&(0xf<<12) == 2<<12, SHA512) - f.setIf(instAttrReg0&(0xf<<8) != 0, SHA1) - f.setIf(instAttrReg0&(0xf<<4) != 0, AESARM) - // https://developer.arm.com/docs/ddi0595/b/aarch64-system-registers/id_aa64isar0_el1 - // 0b0010 --> As for 0b0001, plus PMULL/PMULL2 instructions operating on 64-bit data quantities. - f.setIf(instAttrReg0&(0xf<<4) == 2<<4, PMULL) - - // https://developer.arm.com/docs/ddi0595/b/aarch64-system-registers/id_aa64isar1_el1 - // - // ID_AA64ISAR1_EL1 - Instruction set attribute register 1 - // x--------------------------------------------------x - // | Name | bits | visible | - // |--------------------------------------------------| - // | GPI | [31-28] | y | - // |--------------------------------------------------| - // | GPA | [27-24] | y | - // |--------------------------------------------------| - // | LRCPC | [23-20] | y | - // |--------------------------------------------------| - // | FCMA | [19-16] | y | - // |--------------------------------------------------| - // | JSCVT | [15-12] | y | - // |--------------------------------------------------| - // | API | [11-8] | y | - // |--------------------------------------------------| - // | APA | [7-4] | y | - // |--------------------------------------------------| - // | DPB | [3-0] | y | - // x--------------------------------------------------x - - // if instAttrReg1&(0xf<<28) != 0 { - // fmt.Println("GPI") - // } - f.setIf(instAttrReg1&(0xf<<28) != 24, GPA) - f.setIf(instAttrReg1&(0xf<<20) != 0, LRCPC) - f.setIf(instAttrReg1&(0xf<<16) != 0, FCMA) - f.setIf(instAttrReg1&(0xf<<12) != 0, JSCVT) - // if instAttrReg1&(0xf<<8) != 0 { - // fmt.Println("API") - // } - // if instAttrReg1&(0xf<<4) != 0 { - // fmt.Println("APA") - // } - f.setIf(instAttrReg1&(0xf<<0) != 0, DCPOP) - - // Store - c.featureSet.or(f) -} diff --git a/vendor/github.com/klauspost/cpuid/v2/detect_ref.go b/vendor/github.com/klauspost/cpuid/v2/detect_ref.go deleted file mode 100644 index e9c8606ab9..0000000000 --- a/vendor/github.com/klauspost/cpuid/v2/detect_ref.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. - -//+build !amd64,!386,!arm64 gccgo noasm appengine - -package cpuid - -func initCPU() { - cpuid = func(uint32) (a, b, c, d uint32) { return 0, 0, 0, 0 } - cpuidex = func(x, y uint32) (a, b, c, d uint32) { return 0, 0, 0, 0 } - xgetbv = func(uint32) (a, b uint32) { return 0, 0 } - rdtscpAsm = func() (a, b, c, d uint32) { return 0, 0, 0, 0 } -} - -func addInfo(info *CPUInfo, safe bool) {} diff --git a/vendor/github.com/klauspost/cpuid/v2/detect_x86.go b/vendor/github.com/klauspost/cpuid/v2/detect_x86.go deleted file mode 100644 index cdb9e7ad73..0000000000 --- a/vendor/github.com/klauspost/cpuid/v2/detect_x86.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file. - -//+build 386,!gccgo,!noasm amd64,!gccgo,!noasm,!appengine - -package cpuid - -func asmCpuid(op uint32) (eax, ebx, ecx, edx uint32) -func asmCpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32) -func asmXgetbv(index uint32) (eax, edx uint32) -func asmRdtscpAsm() (eax, ebx, ecx, edx uint32) - -func initCPU() { - cpuid = asmCpuid - cpuidex = asmCpuidex - xgetbv = asmXgetbv - rdtscpAsm = asmRdtscpAsm -} - -func addInfo(c *CPUInfo, safe bool) { - c.maxFunc = maxFunctionID() - c.maxExFunc = maxExtendedFunction() - c.BrandName = brandName() - c.CacheLine = cacheLine() - c.Family, c.Model = familyModel() - c.featureSet = support() - c.SGX = hasSGX(c.featureSet.inSet(SGX), c.featureSet.inSet(SGXLC)) - c.ThreadsPerCore = threadsPerCore() - c.LogicalCores = logicalCores() - c.PhysicalCores = physicalCores() - c.VendorID, c.VendorString = vendorID() - c.Hz = hertz(c.BrandName) - c.cacheSize() -} diff --git a/vendor/github.com/klauspost/cpuid/v2/featureid_string.go b/vendor/github.com/klauspost/cpuid/v2/featureid_string.go deleted file mode 100644 index 0e764f9027..0000000000 --- a/vendor/github.com/klauspost/cpuid/v2/featureid_string.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by "stringer -type=FeatureID,Vendor"; DO NOT EDIT. - -package cpuid - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[ADX-1] - _ = x[AESNI-2] - _ = x[AMD3DNOW-3] - _ = x[AMD3DNOWEXT-4] - _ = x[AMXBF16-5] - _ = x[AMXINT8-6] - _ = x[AMXTILE-7] - _ = x[AVX-8] - _ = x[AVX2-9] - _ = x[AVX512BF16-10] - _ = x[AVX512BITALG-11] - _ = x[AVX512BW-12] - _ = x[AVX512CD-13] - _ = x[AVX512DQ-14] - _ = x[AVX512ER-15] - _ = x[AVX512F-16] - _ = x[AVX512IFMA-17] - _ = x[AVX512PF-18] - _ = x[AVX512VBMI-19] - _ = x[AVX512VBMI2-20] - _ = x[AVX512VL-21] - _ = x[AVX512VNNI-22] - _ = x[AVX512VP2INTERSECT-23] - _ = x[AVX512VPOPCNTDQ-24] - _ = x[AVXSLOW-25] - _ = x[BMI1-26] - _ = x[BMI2-27] - _ = x[CLDEMOTE-28] - _ = x[CLMUL-29] - _ = x[CMOV-30] - _ = x[CX16-31] - _ = x[ENQCMD-32] - _ = x[ERMS-33] - _ = x[F16C-34] - _ = x[FMA3-35] - _ = x[FMA4-36] - _ = x[GFNI-37] - _ = x[HLE-38] - _ = x[HTT-39] - _ = x[HYPERVISOR-40] - _ = x[IBPB-41] - _ = x[IBS-42] - _ = x[IBSBRNTRGT-43] - _ = x[IBSFETCHSAM-44] - _ = x[IBSFFV-45] - _ = x[IBSOPCNT-46] - _ = x[IBSOPCNTEXT-47] - _ = x[IBSOPSAM-48] - _ = x[IBSRDWROPCNT-49] - _ = x[IBSRIPINVALIDCHK-50] - _ = x[LZCNT-51] - _ = x[MMX-52] - _ = x[MMXEXT-53] - _ = x[MOVDIR64B-54] - _ = x[MOVDIRI-55] - _ = x[MPX-56] - _ = x[NX-57] - _ = x[POPCNT-58] - _ = x[RDRAND-59] - _ = x[RDSEED-60] - _ = x[RDTSCP-61] - _ = x[RTM-62] - _ = x[SERIALIZE-63] - _ = x[SGX-64] - _ = x[SGXLC-65] - _ = x[SHA-66] - _ = x[SSE-67] - _ = x[SSE2-68] - _ = x[SSE3-69] - _ = x[SSE4-70] - _ = x[SSE42-71] - _ = x[SSE4A-72] - _ = x[SSSE3-73] - _ = x[STIBP-74] - _ = x[TBM-75] - _ = x[TSXLDTRK-76] - _ = x[VAES-77] - _ = x[VMX-78] - _ = x[VPCLMULQDQ-79] - _ = x[WAITPKG-80] - _ = x[WBNOINVD-81] - _ = x[XOP-82] - _ = x[AESARM-83] - _ = x[ARMCPUID-84] - _ = x[ASIMD-85] - _ = x[ASIMDDP-86] - _ = x[ASIMDHP-87] - _ = x[ASIMDRDM-88] - _ = x[ATOMICS-89] - _ = x[CRC32-90] - _ = x[DCPOP-91] - _ = x[EVTSTRM-92] - _ = x[FCMA-93] - _ = x[FP-94] - _ = x[FPHP-95] - _ = x[GPA-96] - _ = x[JSCVT-97] - _ = x[LRCPC-98] - _ = x[PMULL-99] - _ = x[SHA1-100] - _ = x[SHA2-101] - _ = x[SHA3-102] - _ = x[SHA512-103] - _ = x[SM3-104] - _ = x[SM4-105] - _ = x[SVE-106] - _ = x[lastID-107] - _ = x[firstID-0] -} - -const _FeatureID_name = "firstIDADXAESNIAMD3DNOWAMD3DNOWEXTAMXBF16AMXINT8AMXTILEAVXAVX2AVX512BF16AVX512BITALGAVX512BWAVX512CDAVX512DQAVX512ERAVX512FAVX512IFMAAVX512PFAVX512VBMIAVX512VBMI2AVX512VLAVX512VNNIAVX512VP2INTERSECTAVX512VPOPCNTDQAVXSLOWBMI1BMI2CLDEMOTECLMULCMOVCX16ENQCMDERMSF16CFMA3FMA4GFNIHLEHTTHYPERVISORIBPBIBSIBSBRNTRGTIBSFETCHSAMIBSFFVIBSOPCNTIBSOPCNTEXTIBSOPSAMIBSRDWROPCNTIBSRIPINVALIDCHKLZCNTMMXMMXEXTMOVDIR64BMOVDIRIMPXNXPOPCNTRDRANDRDSEEDRDTSCPRTMSERIALIZESGXSGXLCSHASSESSE2SSE3SSE4SSE42SSE4ASSSE3STIBPTBMTSXLDTRKVAESVMXVPCLMULQDQWAITPKGWBNOINVDXOPAESARMARMCPUIDASIMDASIMDDPASIMDHPASIMDRDMATOMICSCRC32DCPOPEVTSTRMFCMAFPFPHPGPAJSCVTLRCPCPMULLSHA1SHA2SHA3SHA512SM3SM4SVElastID" - -var _FeatureID_index = [...]uint16{0, 7, 10, 15, 23, 34, 41, 48, 55, 58, 62, 72, 84, 92, 100, 108, 116, 123, 133, 141, 151, 162, 170, 180, 198, 213, 220, 224, 228, 236, 241, 245, 249, 255, 259, 263, 267, 271, 275, 278, 281, 291, 295, 298, 308, 319, 325, 333, 344, 352, 364, 380, 385, 388, 394, 403, 410, 413, 415, 421, 427, 433, 439, 442, 451, 454, 459, 462, 465, 469, 473, 477, 482, 487, 492, 497, 500, 508, 512, 515, 525, 532, 540, 543, 549, 557, 562, 569, 576, 584, 591, 596, 601, 608, 612, 614, 618, 621, 626, 631, 636, 640, 644, 648, 654, 657, 660, 663, 669} - -func (i FeatureID) String() string { - if i < 0 || i >= FeatureID(len(_FeatureID_index)-1) { - return "FeatureID(" + strconv.FormatInt(int64(i), 10) + ")" - } - return _FeatureID_name[_FeatureID_index[i]:_FeatureID_index[i+1]] -} -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[VendorUnknown-0] - _ = x[Intel-1] - _ = x[AMD-2] - _ = x[VIA-3] - _ = x[Transmeta-4] - _ = x[NSC-5] - _ = x[KVM-6] - _ = x[MSVM-7] - _ = x[VMware-8] - _ = x[XenHVM-9] - _ = x[Bhyve-10] - _ = x[Hygon-11] - _ = x[SiS-12] - _ = x[RDC-13] - _ = x[Ampere-14] - _ = x[ARM-15] - _ = x[Broadcom-16] - _ = x[Cavium-17] - _ = x[DEC-18] - _ = x[Fujitsu-19] - _ = x[Infineon-20] - _ = x[Motorola-21] - _ = x[NVIDIA-22] - _ = x[AMCC-23] - _ = x[Qualcomm-24] - _ = x[Marvell-25] - _ = x[lastVendor-26] -} - -const _Vendor_name = "VendorUnknownIntelAMDVIATransmetaNSCKVMMSVMVMwareXenHVMBhyveHygonSiSRDCAmpereARMBroadcomCaviumDECFujitsuInfineonMotorolaNVIDIAAMCCQualcommMarvelllastVendor" - -var _Vendor_index = [...]uint8{0, 13, 18, 21, 24, 33, 36, 39, 43, 49, 55, 60, 65, 68, 71, 77, 80, 88, 94, 97, 104, 112, 120, 126, 130, 138, 145, 155} - -func (i Vendor) String() string { - if i < 0 || i >= Vendor(len(_Vendor_index)-1) { - return "Vendor(" + strconv.FormatInt(int64(i), 10) + ")" - } - return _Vendor_name[_Vendor_index[i]:_Vendor_index[i+1]] -} diff --git a/vendor/github.com/klauspost/cpuid/v2/go.mod b/vendor/github.com/klauspost/cpuid/v2/go.mod deleted file mode 100644 index 2afac8eb28..0000000000 --- a/vendor/github.com/klauspost/cpuid/v2/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/klauspost/cpuid/v2 - -go 1.13 diff --git a/vendor/github.com/klauspost/cpuid/v2/os_darwin_arm64.go b/vendor/github.com/klauspost/cpuid/v2/os_darwin_arm64.go deleted file mode 100644 index 82d272fab3..0000000000 --- a/vendor/github.com/klauspost/cpuid/v2/os_darwin_arm64.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2020 Klaus Post, released under MIT License. See LICENSE file. - -package cpuid - -import "runtime" - -func detectOS(c *CPUInfo) bool { - // There are no hw.optional sysctl values for the below features on Mac OS 11.0 - // to detect their supported state dynamically. Assume the CPU features that - // Apple Silicon M1 supports to be available as a minimal set of features - // to all Go programs running on darwin/arm64. - // TODO: Add more if we know them. - c.featureSet.setIf(runtime.GOOS != "ios", AESARM, PMULL, SHA1, SHA2) - return true -} diff --git a/vendor/github.com/klauspost/cpuid/v2/os_linux_arm64.go b/vendor/github.com/klauspost/cpuid/v2/os_linux_arm64.go deleted file mode 100644 index a01afad81c..0000000000 --- a/vendor/github.com/klauspost/cpuid/v2/os_linux_arm64.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) 2020 Klaus Post, released under MIT License. See LICENSE file. - -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file located -// here https://github.com/golang/sys/blob/master/LICENSE - -package cpuid - -import ( - "encoding/binary" - "io/ioutil" - "runtime" - "unsafe" -) - -// HWCAP bits. -const ( - hwcap_FP = 1 << 0 - hwcap_ASIMD = 1 << 1 - hwcap_EVTSTRM = 1 << 2 - hwcap_AES = 1 << 3 - hwcap_PMULL = 1 << 4 - hwcap_SHA1 = 1 << 5 - hwcap_SHA2 = 1 << 6 - hwcap_CRC32 = 1 << 7 - hwcap_ATOMICS = 1 << 8 - hwcap_FPHP = 1 << 9 - hwcap_ASIMDHP = 1 << 10 - hwcap_CPUID = 1 << 11 - hwcap_ASIMDRDM = 1 << 12 - hwcap_JSCVT = 1 << 13 - hwcap_FCMA = 1 << 14 - hwcap_LRCPC = 1 << 15 - hwcap_DCPOP = 1 << 16 - hwcap_SHA3 = 1 << 17 - hwcap_SM3 = 1 << 18 - hwcap_SM4 = 1 << 19 - hwcap_ASIMDDP = 1 << 20 - hwcap_SHA512 = 1 << 21 - hwcap_SVE = 1 << 22 - hwcap_ASIMDFHM = 1 << 23 -) - -//go:linkname hwcap internal/cpu.HWCap -var hwcap uint - -func detectOS(c *CPUInfo) bool { - // For now assuming no hyperthreading is reasonable. - c.LogicalCores = int(getproccount()) - c.PhysicalCores = c.LogicalCores - c.ThreadsPerCore = 1 - if hwcap == 0 { - // We did not get values from the runtime. - // Try reading /proc/self/auxv - - // From https://github.com/golang/sys - const ( - _AT_HWCAP = 16 - _AT_HWCAP2 = 26 - - uintSize = int(32 << (^uint(0) >> 63)) - ) - - buf, err := ioutil.ReadFile("/proc/self/auxv") - if err != nil { - // e.g. on android /proc/self/auxv is not accessible, so silently - // ignore the error and leave Initialized = false. On some - // architectures (e.g. arm64) doinit() implements a fallback - // readout and will set Initialized = true again. - return false - } - bo := binary.LittleEndian - for len(buf) >= 2*(uintSize/8) { - var tag, val uint - switch uintSize { - case 32: - tag = uint(bo.Uint32(buf[0:])) - val = uint(bo.Uint32(buf[4:])) - buf = buf[8:] - case 64: - tag = uint(bo.Uint64(buf[0:])) - val = uint(bo.Uint64(buf[8:])) - buf = buf[16:] - } - switch tag { - case _AT_HWCAP: - hwcap = val - case _AT_HWCAP2: - // Not used - } - } - if hwcap == 0 { - return false - } - } - - // HWCap was populated by the runtime from the auxiliary vector. - // Use HWCap information since reading aarch64 system registers - // is not supported in user space on older linux kernels. - c.featureSet.setIf(isSet(hwcap, hwcap_AES), AESARM) - c.featureSet.setIf(isSet(hwcap, hwcap_ASIMD), ASIMD) - c.featureSet.setIf(isSet(hwcap, hwcap_ASIMDDP), ASIMDDP) - c.featureSet.setIf(isSet(hwcap, hwcap_ASIMDHP), ASIMDHP) - c.featureSet.setIf(isSet(hwcap, hwcap_ASIMDRDM), ASIMDRDM) - c.featureSet.setIf(isSet(hwcap, hwcap_CPUID), ARMCPUID) - c.featureSet.setIf(isSet(hwcap, hwcap_CRC32), CRC32) - c.featureSet.setIf(isSet(hwcap, hwcap_DCPOP), DCPOP) - c.featureSet.setIf(isSet(hwcap, hwcap_EVTSTRM), EVTSTRM) - c.featureSet.setIf(isSet(hwcap, hwcap_FCMA), FCMA) - c.featureSet.setIf(isSet(hwcap, hwcap_FP), FP) - c.featureSet.setIf(isSet(hwcap, hwcap_FPHP), FPHP) - c.featureSet.setIf(isSet(hwcap, hwcap_JSCVT), JSCVT) - c.featureSet.setIf(isSet(hwcap, hwcap_LRCPC), LRCPC) - c.featureSet.setIf(isSet(hwcap, hwcap_PMULL), PMULL) - c.featureSet.setIf(isSet(hwcap, hwcap_SHA1), SHA1) - c.featureSet.setIf(isSet(hwcap, hwcap_SHA2), SHA2) - c.featureSet.setIf(isSet(hwcap, hwcap_SHA3), SHA3) - c.featureSet.setIf(isSet(hwcap, hwcap_SHA512), SHA512) - c.featureSet.setIf(isSet(hwcap, hwcap_SM3), SM3) - c.featureSet.setIf(isSet(hwcap, hwcap_SM4), SM4) - c.featureSet.setIf(isSet(hwcap, hwcap_SVE), SVE) - - // The Samsung S9+ kernel reports support for atomics, but not all cores - // actually support them, resulting in SIGILL. See issue #28431. - // TODO(elias.naur): Only disable the optimization on bad chipsets on android. - c.featureSet.setIf(isSet(hwcap, hwcap_ATOMICS) && runtime.GOOS != "android", ATOMICS) - - return true -} - -func isSet(hwc uint, value uint) bool { - return hwc&value != 0 -} - -//go:noescape -//go:linkname sched_getaffinity runtime.sched_getaffinity -func sched_getaffinity(pid, len uintptr, buf *byte) int32 - -func getproccount() int32 { - // This buffer is huge (8 kB) but we are on the system stack - // and there should be plenty of space (64 kB). - // Also this is a leaf, so we're not holding up the memory for long. - const maxCPUs = 64 * 1024 - var buf [maxCPUs / 8]byte - r := sched_getaffinity(0, unsafe.Sizeof(buf), &buf[0]) - if r < 0 { - return 0 - } - n := int32(0) - for _, v := range buf[:r] { - for v != 0 { - n += int32(v & 1) - v >>= 1 - } - } - if n == 0 { - n = 1 - } - return n -} diff --git a/vendor/github.com/klauspost/cpuid/v2/os_other_arm64.go b/vendor/github.com/klauspost/cpuid/v2/os_other_arm64.go deleted file mode 100644 index df0ad06b38..0000000000 --- a/vendor/github.com/klauspost/cpuid/v2/os_other_arm64.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2020 Klaus Post, released under MIT License. See LICENSE file. - -// +build arm64 -// +build !linux -// +build !darwin - -package cpuid - -func detectOS(c *CPUInfo) bool { - return false -} diff --git a/vendor/github.com/klauspost/pgzip/LICENSE b/vendor/github.com/klauspost/pgzip/LICENSE index 3909da4103..2bdc0d7517 100644 --- a/vendor/github.com/klauspost/pgzip/LICENSE +++ b/vendor/github.com/klauspost/pgzip/LICENSE @@ -1,4 +1,4 @@ -MIT License +The MIT License (MIT) Copyright (c) 2014 Klaus Post @@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/vendor/github.com/klauspost/pgzip/README.md b/vendor/github.com/klauspost/pgzip/README.md index 171b978fdc..81000996c9 100644 --- a/vendor/github.com/klauspost/pgzip/README.md +++ b/vendor/github.com/klauspost/pgzip/README.md @@ -39,6 +39,7 @@ You might need to get/update the dependencies: ``` go get -u github.com/klauspost/compress +go get -u github.com/klauspost/crc32 ``` Usage @@ -64,7 +65,7 @@ Changes in [github.com/klauspost/compress](https://github.com/klauspost/compress ## Compression The simplest way to use this is to simply do the same as you would when using [compress/gzip](http://golang.org/pkg/compress/gzip). -To change the block size, use the added (*pgzip.Writer).SetConcurrency(blockSize, blocks int) function. With this you can control the approximate size of your blocks, as well as how many you want to be processing in parallel. Default values for this is SetConcurrency(1MB, runtime.GOMAXPROCS(0)), meaning blocks are split at 1 MB and up to the number of CPU threads blocks can be processing at once before the writer blocks. +To change the block size, use the added (*pgzip.Writer).SetConcurrency(blockSize, blocks int) function. With this you can control the approximate size of your blocks, as well as how many you want to be processing in parallel. Default values for this is SetConcurrency(250000, 16), meaning blocks are split at 250000 bytes and up to 16 blocks can be processing at once before the writer blocks. Example: @@ -98,19 +99,19 @@ See my blog post in [Benchmarks of Golang Gzip](https://blog.klauspost.com/go-gz Compression cost is usually about 0.2% with default settings with a block size of 250k. -Example with GOMAXPROC set to 32 (16 core CPU) +Example with GOMAXPROC set to 8 (quad core with 8 hyperthreads) Content is [Matt Mahoneys 10GB corpus](http://mattmahoney.net/dc/10gb.html). Compression level 6. Compressor | MB/sec | speedup | size | size overhead (lower=better) ------------|----------|---------|------|--------- -[gzip](http://golang.org/pkg/compress/gzip) (golang) | 15.44MB/s (1 thread) | 1.0x | 4781329307 | 0% -[gzip](http://github.com/klauspost/compress/gzip) (klauspost) | 135.04MB/s (1 thread) | 8.74x | 4894858258 | +2.37% -[pgzip](https://github.com/klauspost/pgzip) (klauspost) | 1573.23MB/s| 101.9x | 4902285651 | +2.53% -[bgzf](https://godoc.org/github.com/biogo/hts/bgzf) (biogo) | 361.40MB/s | 23.4x | 4869686090 | +1.85% -[pargzip](https://godoc.org/github.com/golang/build/pargzip) (builder) | 306.01MB/s | 19.8x | 4786890417 | +0.12% +[gzip](http://golang.org/pkg/compress/gzip) (golang) | 7.21MB/s | 1.0x | 4786608902 | 0% +[gzip](http://github.com/klauspost/compress/gzip) (klauspost) | 10.98MB/s | 1.52x | 4781331645 | -0.11% +[pgzip](https://github.com/klauspost/pgzip) (klauspost) | 50.76MB/s|7.04x | 4784121440 | -0.052% +[bgzf](https://godoc.org/github.com/biogo/hts/bgzf) (biogo) | 38.65MB/s | 5.36x | 4924899484 | 2.889% +[pargzip](https://godoc.org/github.com/golang/build/pargzip) (builder) | 32.00MB/s | 4.44x | 4791226567 | 0.096% -pgzip also contains a [linear time compression](https://github.com/klauspost/compress#linear-time-compression-huffman-only) mode, that will allow compression at ~250MB per core per second, independent of the content. +pgzip also contains a [linear time compression](https://github.com/klauspost/compress#linear-time-compression) mode, that will allow compression at ~150MB per core per second, independent of the content. See the [complete sheet](https://docs.google.com/spreadsheets/d/1nuNE2nPfuINCZJRMt6wFWhKpToF95I47XjSsc-1rbPQ/edit?usp=sharing) for different content types and compression settings. diff --git a/vendor/github.com/klauspost/pgzip/gzip.go b/vendor/github.com/klauspost/pgzip/gzip.go index 257c4d299f..85d14e9cbc 100644 --- a/vendor/github.com/klauspost/pgzip/gzip.go +++ b/vendor/github.com/klauspost/pgzip/gzip.go @@ -11,7 +11,6 @@ import ( "hash" "hash/crc32" "io" - "runtime" "sync" "time" @@ -19,9 +18,9 @@ import ( ) const ( - defaultBlockSize = 1 << 20 + defaultBlockSize = 256 << 10 tailSize = 16384 - defaultBlocks = 4 + defaultBlocks = 16 ) // These constants are copied from the flate package, so that code that imports @@ -69,8 +68,8 @@ type result struct { // With this you can control the approximate size of your blocks, // as well as how many you want to be processing in parallel. // -// Default values for this is SetConcurrency(defaultBlockSize, runtime.GOMAXPROCS(0)), -// meaning blocks are split at 1 MB and up to the number of CPU threads +// Default values for this is SetConcurrency(250000, 16), +// meaning blocks are split at 250000 bytes and up to 16 blocks // can be processing at once before the writer blocks. func (z *Writer) SetConcurrency(blockSize, blocks int) error { if blockSize <= tailSize { @@ -85,7 +84,7 @@ func (z *Writer) SetConcurrency(blockSize, blocks int) error { z.blockSize = blockSize z.results = make(chan result, blocks) z.blocks = blocks - z.dstPool.New = func() interface{} { return make([]byte, 0, blockSize+(blockSize)>>4) } + z.dstPool = sync.Pool{New: func() interface{} { return make([]byte, 0, blockSize+(blockSize)>>4) }} return nil } @@ -116,7 +115,7 @@ func NewWriterLevel(w io.Writer, level int) (*Writer, error) { return nil, fmt.Errorf("gzip: invalid compression level: %d", level) } z := new(Writer) - z.SetConcurrency(defaultBlockSize, runtime.GOMAXPROCS(0)) + z.SetConcurrency(defaultBlockSize, defaultBlocks) z.init(w, level) return z, nil } @@ -175,7 +174,7 @@ func (z *Writer) Reset(w io.Writer) { if z.results != nil && !z.closed { close(z.results) } - z.SetConcurrency(defaultBlockSize, runtime.GOMAXPROCS(0)) + z.SetConcurrency(defaultBlockSize, defaultBlocks) z.init(w, z.level) } @@ -240,36 +239,36 @@ func (z *Writer) writeString(s string) (err error) { // compressCurrent will compress the data currently buffered // This should only be called from the main writer/flush/closer func (z *Writer) compressCurrent(flush bool) { - c := z.currentBuffer - if len(c) > z.blockSize { - // This can never happen through the public interface. - panic("len(z.currentBuffer) > z.blockSize (most likely due to concurrent Write race)") - } - r := result{} r.result = make(chan []byte, 1) r.notifyWritten = make(chan struct{}, 0) - // Reserve a result slot select { case z.results <- r: case <-z.pushedErr: return } + // If block given is more than twice the block size, split it. + c := z.currentBuffer + if len(c) > z.blockSize*2 { + c = c[:z.blockSize] + z.wg.Add(1) + go z.compressBlock(c, z.prevTail, r, false) + z.prevTail = c[len(c)-tailSize:] + z.currentBuffer = z.currentBuffer[z.blockSize:] + z.compressCurrent(flush) + // Last one flushes if needed + return + } + z.wg.Add(1) - tail := z.prevTail + go z.compressBlock(c, z.prevTail, r, z.closed) if len(c) > tailSize { - buf := z.dstPool.Get().([]byte) // Put in .compressBlock - // Copy tail from current buffer before handing the buffer over to the - // compressBlock goroutine. - buf = append(buf[:0], c[len(c)-tailSize:]...) - z.prevTail = buf + z.prevTail = c[len(c)-tailSize:] } else { z.prevTail = nil } - go z.compressBlock(c, tail, r, z.closed) - - z.currentBuffer = z.dstPool.Get().([]byte) // Put in .compressBlock + z.currentBuffer = z.dstPool.Get().([]byte) z.currentBuffer = z.currentBuffer[:0] // Wait if flushing @@ -359,37 +358,29 @@ func (z *Writer) Write(p []byte) (int, error) { // Start receiving data from compressors go func() { listen := z.results - var failed bool for { r, ok := <-listen // If closed, we are finished. if !ok { return } - if failed { - close(r.notifyWritten) - continue - } buf := <-r.result n, err := z.w.Write(buf) if err != nil { z.pushError(err) close(r.notifyWritten) - failed = true - continue + return } if n != len(buf) { z.pushError(fmt.Errorf("gzip: short write %d should be %d", n, len(buf))) - failed = true close(r.notifyWritten) - continue + return } z.dstPool.Put(buf) close(r.notifyWritten) } }() - z.currentBuffer = z.dstPool.Get().([]byte) - z.currentBuffer = z.currentBuffer[:0] + z.currentBuffer = make([]byte, 0, z.blockSize) } q := p for len(q) > 0 { @@ -399,13 +390,10 @@ func (z *Writer) Write(p []byte) (int, error) { } z.digest.Write(q[:length]) z.currentBuffer = append(z.currentBuffer, q[:length]...) - if len(z.currentBuffer) > z.blockSize { - panic("z.currentBuffer too large (most likely due to concurrent Write race)") - } - if len(z.currentBuffer) == z.blockSize { + if len(z.currentBuffer) >= z.blockSize { z.compressCurrent(false) if err := z.checkError(); err != nil { - return len(p) - len(q), err + return len(p) - len(q) - length, err } } z.size += length @@ -422,13 +410,12 @@ func (z *Writer) compressBlock(p, prevTail []byte, r result, closed bool) { close(r.result) z.wg.Done() }() - buf := z.dstPool.Get().([]byte) // Corresponding Put in .Write's result writer + buf := z.dstPool.Get().([]byte) dest := bytes.NewBuffer(buf[:0]) - compressor := z.dictFlatePool.Get().(*flate.Writer) // Put below + compressor := z.dictFlatePool.Get().(*flate.Writer) compressor.ResetDict(dest, prevTail) compressor.Write(p) - z.dstPool.Put(p) // Corresponding Get in .Write and .compressCurrent err := compressor.Flush() if err != nil { @@ -442,12 +429,7 @@ func (z *Writer) compressBlock(p, prevTail []byte, r result, closed bool) { return } } - z.dictFlatePool.Put(compressor) // Get above - - if prevTail != nil { - z.dstPool.Put(prevTail) // Get in .compressCurrent - } - + z.dictFlatePool.Put(compressor) // Read back buffer buf = dest.Bytes() r.result <- buf diff --git a/vendor/github.com/klauspost/reedsolomon/.travis.yml b/vendor/github.com/klauspost/reedsolomon/.travis.yml index 51e23b1683..f77b85c5bb 100644 --- a/vendor/github.com/klauspost/reedsolomon/.travis.yml +++ b/vendor/github.com/klauspost/reedsolomon/.travis.yml @@ -12,9 +12,9 @@ arch: - s390x go: + - 1.12.x - 1.13.x - 1.14.x - - 1.15.x - master install: @@ -41,7 +41,7 @@ jobs: fast_finish: true include: - stage: gofmt - go: 1.15.x + go: 1.14.x os: linux arch: amd64 script: @@ -50,7 +50,7 @@ jobs: - go install github.com/klauspost/asmfmt/cmd/asmfmt - diff <(asmfmt -d .) <(printf "") - stage: race - go: 1.15.x + go: 1.14.x os: linux arch: amd64 script: @@ -62,7 +62,7 @@ jobs: - go test -no-avx512 -no-avx2 -short -race . - go test -no-avx512 -no-avx2 -no-ssse3 -short -race . - stage: amd64-noasm - go: 1.15.x + go: 1.14.x os: linux arch: amd64 script: @@ -70,7 +70,7 @@ jobs: - go test -no-avx512 -no-avx2 - go test -no-avx512 -no-avx2 -no-ssse3 - stage: i386 - go: 1.15.x + go: 1.14.x os: linux arch: amd64 script: diff --git a/vendor/github.com/klauspost/reedsolomon/README.md b/vendor/github.com/klauspost/reedsolomon/README.md index ff50f4329c..f9824cbb85 100644 --- a/vendor/github.com/klauspost/reedsolomon/README.md +++ b/vendor/github.com/klauspost/reedsolomon/README.md @@ -23,8 +23,6 @@ To get the package use the standard: go get -u github.com/klauspost/reedsolomon ``` -Using Go modules recommended. - # Changes ## May 2020 @@ -302,16 +300,14 @@ Performance depends mainly on the number of parity shards. In rough terms, doubling the number of parity shards will double the encoding time. Here are the throughput numbers with some different selections of data and parity shards. -For reference each shard is 1MB random data, and 16 CPU cores are used for encoding. - -| Data | Parity | Go MB/s | SSSE3 MB/s | AVX2 MB/s | -|------|--------|---------|------------|-----------| -| 5 | 2 | 14287 | 66355 | 108755 | -| 8 | 8 | 5569 | 34298 | 70516 | -| 10 | 4 | 6766 | 48237 | 93875 | -| 50 | 20 | 1540 | 12130 | 22090 | - -The throughput numbers here is the size of the encoded data and parity shards. +For reference each shard is 1MB random data, and 2 CPU cores are used for encoding. + +| Data | Parity | Parity | MB/s | SSSE3 MB/s | SSSE3 Speed | Rel. Speed | +|------|--------|--------|--------|-------------|-------------|------------| +| 5 | 2 | 40% | 576,11 | 2599,2 | 451% | 100,00% | +| 10 | 2 | 20% | 587,73 | 3100,28 | 528% | 102,02% | +| 10 | 4 | 40% | 298,38 | 2470,97 | 828% | 51,79% | +| 50 | 20 | 40% | 59,81 | 713,28 | 1193% | 10,38% | If `runtime.GOMAXPROCS()` is set to a value higher than 1, the encoder will use multiple goroutines to perform the calculations in `Verify`, `Encode` and `Reconstruct`. diff --git a/vendor/github.com/klauspost/reedsolomon/galois.go b/vendor/github.com/klauspost/reedsolomon/galois.go index ff93d65860..76049f9d78 100644 --- a/vendor/github.com/klauspost/reedsolomon/galois.go +++ b/vendor/github.com/klauspost/reedsolomon/galois.go @@ -917,14 +917,12 @@ func genAvx2Matrix(matrixRows [][]byte, inputs, outputs int, dst []byte) []byte for i, row := range matrixRows[:outputs] { for j, idx := range row[:inputs] { dstIdx := (j*outputs + i) * 64 - dstPart := dst[dstIdx:] - dstPart = dstPart[:64] lo := mulTableLow[idx][:] hi := mulTableHigh[idx][:] - copy(dstPart[:16], lo) - copy(dstPart[16:32], lo) - copy(dstPart[32:48], hi) - copy(dstPart[48:64], hi) + copy(dst[dstIdx:], lo) + copy(dst[dstIdx+16:], lo) + copy(dst[dstIdx+32:], hi) + copy(dst[dstIdx+48:], hi) } } return dst diff --git a/vendor/github.com/klauspost/reedsolomon/galois_gen_amd64.s b/vendor/github.com/klauspost/reedsolomon/galois_gen_amd64.s index c7154b7868..c76db3c82d 100644 --- a/vendor/github.com/klauspost/reedsolomon/galois_gen_amd64.s +++ b/vendor/github.com/klauspost/reedsolomon/galois_gen_amd64.s @@ -9,50 +9,42 @@ // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_1x1(SB), $0-88 // Loading all tables to registers - // Destination kept in GP registers // Full registers estimated 6 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_1x1_end - VMOVDQU (CX), Y0 - VMOVDQU 32(CX), Y1 - MOVQ in_base+24(FP), CX - MOVQ (CX), CX - MOVQ out_base+48(FP), DX - MOVQ (DX), DX - MOVQ start+72(FP), BX - - // Add start offset to output - ADDQ BX, DX - - // Add start offset to input - ADDQ BX, CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_1x1_end + MOVQ out_base+48(FP), DX + MOVQ (DX), DX + VMOVDQU (CX), Y1 + VMOVDQU 32(CX), Y2 + MOVQ in_base+24(FP), CX + MOVQ (CX), CX MOVQ $0x0000000f, BX MOVQ BX, X3 VPBROADCASTB X3, Y3 + MOVQ start+72(FP), BX mulAvxTwo_1x1_loop: // Clear 1 outputs - VPXOR Y2, Y2, Y2 + VPXOR Y0, Y0, Y0 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (CX), Y4 - ADDQ $0x20, CX + VMOVDQU (CX)(BX*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y3, Y4, Y4 VPAND Y3, Y5, Y5 - VPSHUFB Y4, Y0, Y4 - VPSHUFB Y5, Y1, Y5 + VPSHUFB Y4, Y1, Y4 + VPSHUFB Y5, Y2, Y5 VPXOR Y4, Y5, Y4 - VPXOR Y4, Y2, Y2 + VPXOR Y4, Y0, Y0 // Store 1 outputs - VMOVDQU Y2, (DX) - ADDQ $0x20, DX + VMOVDQU Y0, (DX)(BX*1) // Prepare for next loop + ADDQ $0x20, BX DECQ AX JNZ mulAvxTwo_1x1_loop VZEROUPPER @@ -64,61 +56,51 @@ mulAvxTwo_1x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_1x2(SB), $0-88 // Loading all tables to registers - // Destination kept in GP registers // Full registers estimated 11 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_1x2_end - VMOVDQU (CX), Y0 - VMOVDQU 32(CX), Y1 - VMOVDQU 64(CX), Y2 - VMOVDQU 96(CX), Y3 - MOVQ in_base+24(FP), CX - MOVQ (CX), CX - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), DX - MOVQ start+72(FP), BP - - // Add start offset to output - ADDQ BP, BX - ADDQ BP, DX - - // Add start offset to input - ADDQ BP, CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_1x2_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), DX + VMOVDQU (CX), Y2 + VMOVDQU 32(CX), Y3 + VMOVDQU 64(CX), Y4 + VMOVDQU 96(CX), Y5 + MOVQ in_base+24(FP), CX + MOVQ (CX), CX MOVQ $0x0000000f, BP MOVQ BP, X6 VPBROADCASTB X6, Y6 + MOVQ start+72(FP), BP mulAvxTwo_1x2_loop: // Clear 2 outputs - VPXOR Y4, Y4, Y4 - VPXOR Y5, Y5, Y5 + VPXOR Y0, Y0, Y0 + VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (CX), Y9 - ADDQ $0x20, CX + VMOVDQU (CX)(BP*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 - VPSHUFB Y9, Y0, Y7 - VPSHUFB Y10, Y1, Y8 - VPXOR Y7, Y8, Y7 - VPXOR Y7, Y4, Y4 VPSHUFB Y9, Y2, Y7 VPSHUFB Y10, Y3, Y8 VPXOR Y7, Y8, Y7 - VPXOR Y7, Y5, Y5 + VPXOR Y7, Y0, Y0 + VPSHUFB Y9, Y4, Y7 + VPSHUFB Y10, Y5, Y8 + VPXOR Y7, Y8, Y7 + VPXOR Y7, Y1, Y1 // Store 2 outputs - VMOVDQU Y4, (BX) - ADDQ $0x20, BX - VMOVDQU Y5, (DX) - ADDQ $0x20, DX + VMOVDQU Y0, (BX)(BP*1) + VMOVDQU Y1, (DX)(BP*1) // Prepare for next loop + ADDQ $0x20, BP DECQ AX JNZ mulAvxTwo_1x2_loop VZEROUPPER @@ -130,72 +112,60 @@ mulAvxTwo_1x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_1x3(SB), $0-88 // Loading all tables to registers - // Destination kept in GP registers // Full registers estimated 14 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_1x3_end - VMOVDQU (CX), Y0 - VMOVDQU 32(CX), Y1 - VMOVDQU 64(CX), Y2 - VMOVDQU 96(CX), Y3 - VMOVDQU 128(CX), Y4 - VMOVDQU 160(CX), Y5 - MOVQ in_base+24(FP), CX - MOVQ (CX), CX - MOVQ out_base+48(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), DX - MOVQ start+72(FP), SI - - // Add start offset to output - ADDQ SI, BX - ADDQ SI, BP - ADDQ SI, DX - - // Add start offset to input - ADDQ SI, CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_1x3_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), DX + VMOVDQU (CX), Y3 + VMOVDQU 32(CX), Y4 + VMOVDQU 64(CX), Y5 + VMOVDQU 96(CX), Y6 + VMOVDQU 128(CX), Y7 + VMOVDQU 160(CX), Y8 + MOVQ in_base+24(FP), CX + MOVQ (CX), CX MOVQ $0x0000000f, SI MOVQ SI, X9 VPBROADCASTB X9, Y9 + MOVQ start+72(FP), SI mulAvxTwo_1x3_loop: // Clear 3 outputs - VPXOR Y6, Y6, Y6 - VPXOR Y7, Y7, Y7 - VPXOR Y8, Y8, Y8 + VPXOR Y0, Y0, Y0 + VPXOR Y1, Y1, Y1 + VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (CX), Y12 - ADDQ $0x20, CX + VMOVDQU (CX)(SI*1), Y12 VPSRLQ $0x04, Y12, Y13 VPAND Y9, Y12, Y12 VPAND Y9, Y13, Y13 - VPSHUFB Y12, Y0, Y10 - VPSHUFB Y13, Y1, Y11 + VPSHUFB Y12, Y3, Y10 + VPSHUFB Y13, Y4, Y11 VPXOR Y10, Y11, Y10 - VPXOR Y10, Y6, Y6 - VPSHUFB Y12, Y2, Y10 - VPSHUFB Y13, Y3, Y11 + VPXOR Y10, Y0, Y0 + VPSHUFB Y12, Y5, Y10 + VPSHUFB Y13, Y6, Y11 VPXOR Y10, Y11, Y10 - VPXOR Y10, Y7, Y7 - VPSHUFB Y12, Y4, Y10 - VPSHUFB Y13, Y5, Y11 + VPXOR Y10, Y1, Y1 + VPSHUFB Y12, Y7, Y10 + VPSHUFB Y13, Y8, Y11 VPXOR Y10, Y11, Y10 - VPXOR Y10, Y8, Y8 + VPXOR Y10, Y2, Y2 // Store 3 outputs - VMOVDQU Y6, (BX) - ADDQ $0x20, BX - VMOVDQU Y7, (BP) - ADDQ $0x20, BP - VMOVDQU Y8, (DX) - ADDQ $0x20, DX + VMOVDQU Y0, (BX)(SI*1) + VMOVDQU Y1, (BP)(SI*1) + VMOVDQU Y2, (DX)(SI*1) // Prepare for next loop + ADDQ $0x20, SI DECQ AX JNZ mulAvxTwo_1x3_loop VZEROUPPER @@ -207,33 +177,23 @@ mulAvxTwo_1x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_1x4(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 17 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_1x4_end - MOVQ in_base+24(FP), DX - MOVQ (DX), DX - MOVQ out_base+48(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), BX - MOVQ start+72(FP), R8 - - // Add start offset to output - ADDQ R8, BP - ADDQ R8, SI - ADDQ R8, DI - ADDQ R8, BX - - // Add start offset to input - ADDQ R8, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_1x4_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DX + MOVQ in_base+24(FP), DI + MOVQ (DI), DI MOVQ $0x0000000f, R8 MOVQ R8, X4 VPBROADCASTB X4, Y4 + MOVQ start+72(FP), R8 mulAvxTwo_1x4_loop: // Clear 4 outputs @@ -243,8 +203,7 @@ mulAvxTwo_1x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (DX), Y7 - ADDQ $0x20, DX + VMOVDQU (DI)(R8*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -274,16 +233,13 @@ mulAvxTwo_1x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - VMOVDQU Y0, (BP) - ADDQ $0x20, BP - VMOVDQU Y1, (SI) - ADDQ $0x20, SI - VMOVDQU Y2, (DI) - ADDQ $0x20, DI - VMOVDQU Y3, (BX) - ADDQ $0x20, BX + VMOVDQU Y0, (BX)(R8*1) + VMOVDQU Y1, (BP)(R8*1) + VMOVDQU Y2, (SI)(R8*1) + VMOVDQU Y3, (DX)(R8*1) // Prepare for next loop + ADDQ $0x20, R8 DECQ AX JNZ mulAvxTwo_1x4_loop VZEROUPPER @@ -295,35 +251,24 @@ mulAvxTwo_1x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_1x5(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 20 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_1x5_end - MOVQ in_base+24(FP), DX - MOVQ (DX), DX - MOVQ out_base+48(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), BX - MOVQ start+72(FP), R9 - - // Add start offset to output - ADDQ R9, BP - ADDQ R9, SI - ADDQ R9, DI - ADDQ R9, R8 - ADDQ R9, BX - - // Add start offset to input - ADDQ R9, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_1x5_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), DX + MOVQ in_base+24(FP), R8 + MOVQ (R8), R8 MOVQ $0x0000000f, R9 MOVQ R9, X5 VPBROADCASTB X5, Y5 + MOVQ start+72(FP), R9 mulAvxTwo_1x5_loop: // Clear 5 outputs @@ -334,8 +279,7 @@ mulAvxTwo_1x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (DX), Y8 - ADDQ $0x20, DX + VMOVDQU (R8)(R9*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -371,18 +315,14 @@ mulAvxTwo_1x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - VMOVDQU Y0, (BP) - ADDQ $0x20, BP - VMOVDQU Y1, (SI) - ADDQ $0x20, SI - VMOVDQU Y2, (DI) - ADDQ $0x20, DI - VMOVDQU Y3, (R8) - ADDQ $0x20, R8 - VMOVDQU Y4, (BX) - ADDQ $0x20, BX + VMOVDQU Y0, (BX)(R9*1) + VMOVDQU Y1, (BP)(R9*1) + VMOVDQU Y2, (SI)(R9*1) + VMOVDQU Y3, (DI)(R9*1) + VMOVDQU Y4, (DX)(R9*1) // Prepare for next loop + ADDQ $0x20, R9 DECQ AX JNZ mulAvxTwo_1x5_loop VZEROUPPER @@ -394,37 +334,25 @@ mulAvxTwo_1x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_1x6(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 23 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_1x6_end - MOVQ in_base+24(FP), DX - MOVQ (DX), DX - MOVQ out_base+48(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), BX - MOVQ start+72(FP), R10 - - // Add start offset to output - ADDQ R10, BP - ADDQ R10, SI - ADDQ R10, DI - ADDQ R10, R8 - ADDQ R10, R9 - ADDQ R10, BX - - // Add start offset to input - ADDQ R10, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_1x6_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), DX + MOVQ in_base+24(FP), R9 + MOVQ (R9), R9 MOVQ $0x0000000f, R10 MOVQ R10, X6 VPBROADCASTB X6, Y6 + MOVQ start+72(FP), R10 mulAvxTwo_1x6_loop: // Clear 6 outputs @@ -436,8 +364,7 @@ mulAvxTwo_1x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (DX), Y9 - ADDQ $0x20, DX + VMOVDQU (R9)(R10*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -479,20 +406,15 @@ mulAvxTwo_1x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - VMOVDQU Y0, (BP) - ADDQ $0x20, BP - VMOVDQU Y1, (SI) - ADDQ $0x20, SI - VMOVDQU Y2, (DI) - ADDQ $0x20, DI - VMOVDQU Y3, (R8) - ADDQ $0x20, R8 - VMOVDQU Y4, (R9) - ADDQ $0x20, R9 - VMOVDQU Y5, (BX) - ADDQ $0x20, BX + VMOVDQU Y0, (BX)(R10*1) + VMOVDQU Y1, (BP)(R10*1) + VMOVDQU Y2, (SI)(R10*1) + VMOVDQU Y3, (DI)(R10*1) + VMOVDQU Y4, (R8)(R10*1) + VMOVDQU Y5, (DX)(R10*1) // Prepare for next loop + ADDQ $0x20, R10 DECQ AX JNZ mulAvxTwo_1x6_loop VZEROUPPER @@ -504,39 +426,26 @@ mulAvxTwo_1x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_1x7(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 26 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_1x7_end - MOVQ in_base+24(FP), DX - MOVQ (DX), DX - MOVQ out_base+48(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), BX - MOVQ start+72(FP), R11 - - // Add start offset to output - ADDQ R11, BP - ADDQ R11, SI - ADDQ R11, DI - ADDQ R11, R8 - ADDQ R11, R9 - ADDQ R11, R10 - ADDQ R11, BX - - // Add start offset to input - ADDQ R11, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_1x7_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), DX + MOVQ in_base+24(FP), R10 + MOVQ (R10), R10 MOVQ $0x0000000f, R11 MOVQ R11, X7 VPBROADCASTB X7, Y7 + MOVQ start+72(FP), R11 mulAvxTwo_1x7_loop: // Clear 7 outputs @@ -549,8 +458,7 @@ mulAvxTwo_1x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (DX), Y10 - ADDQ $0x20, DX + VMOVDQU (R10)(R11*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -598,22 +506,16 @@ mulAvxTwo_1x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - VMOVDQU Y0, (BP) - ADDQ $0x20, BP - VMOVDQU Y1, (SI) - ADDQ $0x20, SI - VMOVDQU Y2, (DI) - ADDQ $0x20, DI - VMOVDQU Y3, (R8) - ADDQ $0x20, R8 - VMOVDQU Y4, (R9) - ADDQ $0x20, R9 - VMOVDQU Y5, (R10) - ADDQ $0x20, R10 - VMOVDQU Y6, (BX) - ADDQ $0x20, BX + VMOVDQU Y0, (BX)(R11*1) + VMOVDQU Y1, (BP)(R11*1) + VMOVDQU Y2, (SI)(R11*1) + VMOVDQU Y3, (DI)(R11*1) + VMOVDQU Y4, (R8)(R11*1) + VMOVDQU Y5, (R9)(R11*1) + VMOVDQU Y6, (DX)(R11*1) // Prepare for next loop + ADDQ $0x20, R11 DECQ AX JNZ mulAvxTwo_1x7_loop VZEROUPPER @@ -625,41 +527,27 @@ mulAvxTwo_1x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_1x8(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 29 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_1x8_end - MOVQ in_base+24(FP), DX - MOVQ (DX), DX - MOVQ out_base+48(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), SI - MOVQ 48(BX), DI - MOVQ 72(BX), R8 - MOVQ 96(BX), R9 - MOVQ 120(BX), R10 - MOVQ 144(BX), R11 - MOVQ 168(BX), BX - MOVQ start+72(FP), R12 - - // Add start offset to output - ADDQ R12, BP - ADDQ R12, SI - ADDQ R12, DI - ADDQ R12, R8 - ADDQ R12, R9 - ADDQ R12, R10 - ADDQ R12, R11 - ADDQ R12, BX - - // Add start offset to input - ADDQ R12, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_1x8_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), DX + MOVQ in_base+24(FP), R11 + MOVQ (R11), R11 MOVQ $0x0000000f, R12 MOVQ R12, X8 VPBROADCASTB X8, Y8 + MOVQ start+72(FP), R12 mulAvxTwo_1x8_loop: // Clear 8 outputs @@ -673,8 +561,7 @@ mulAvxTwo_1x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (DX), Y11 - ADDQ $0x20, DX + VMOVDQU (R11)(R12*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -728,24 +615,17 @@ mulAvxTwo_1x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - VMOVDQU Y0, (BP) - ADDQ $0x20, BP - VMOVDQU Y1, (SI) - ADDQ $0x20, SI - VMOVDQU Y2, (DI) - ADDQ $0x20, DI - VMOVDQU Y3, (R8) - ADDQ $0x20, R8 - VMOVDQU Y4, (R9) - ADDQ $0x20, R9 - VMOVDQU Y5, (R10) - ADDQ $0x20, R10 - VMOVDQU Y6, (R11) - ADDQ $0x20, R11 - VMOVDQU Y7, (BX) - ADDQ $0x20, BX + VMOVDQU Y0, (BX)(R12*1) + VMOVDQU Y1, (BP)(R12*1) + VMOVDQU Y2, (SI)(R12*1) + VMOVDQU Y3, (DI)(R12*1) + VMOVDQU Y4, (R8)(R12*1) + VMOVDQU Y5, (R9)(R12*1) + VMOVDQU Y6, (R10)(R12*1) + VMOVDQU Y7, (DX)(R12*1) // Prepare for next loop + ADDQ $0x20, R12 DECQ AX JNZ mulAvxTwo_1x8_loop VZEROUPPER @@ -757,65 +637,55 @@ mulAvxTwo_1x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_2x1(SB), $0-88 // Loading all tables to registers - // Destination kept in GP registers // Full registers estimated 8 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_2x1_end - VMOVDQU (CX), Y0 - VMOVDQU 32(CX), Y1 - VMOVDQU 64(CX), Y2 - VMOVDQU 96(CX), Y3 - MOVQ in_base+24(FP), CX - MOVQ (CX), DX - MOVQ 24(CX), CX - MOVQ out_base+48(FP), BX - MOVQ (BX), BX - MOVQ start+72(FP), BP - - // Add start offset to output - ADDQ BP, BX - - // Add start offset to input - ADDQ BP, DX - ADDQ BP, CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_2x1_end + MOVQ out_base+48(FP), DX + MOVQ (DX), DX + VMOVDQU (CX), Y1 + VMOVDQU 32(CX), Y2 + VMOVDQU 64(CX), Y3 + VMOVDQU 96(CX), Y4 + MOVQ in_base+24(FP), CX + MOVQ (CX), BX + MOVQ 24(CX), CX MOVQ $0x0000000f, BP MOVQ BP, X5 VPBROADCASTB X5, Y5 + MOVQ start+72(FP), BP mulAvxTwo_2x1_loop: // Clear 1 outputs - VPXOR Y4, Y4, Y4 + VPXOR Y0, Y0, Y0 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (DX), Y6 - ADDQ $0x20, DX + VMOVDQU (BX)(BP*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y5, Y6, Y6 VPAND Y5, Y7, Y7 - VPSHUFB Y6, Y0, Y6 - VPSHUFB Y7, Y1, Y7 + VPSHUFB Y6, Y1, Y6 + VPSHUFB Y7, Y2, Y7 VPXOR Y6, Y7, Y6 - VPXOR Y6, Y4, Y4 + VPXOR Y6, Y0, Y0 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (CX), Y6 - ADDQ $0x20, CX + VMOVDQU (CX)(BP*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y5, Y6, Y6 VPAND Y5, Y7, Y7 - VPSHUFB Y6, Y2, Y6 - VPSHUFB Y7, Y3, Y7 + VPSHUFB Y6, Y3, Y6 + VPSHUFB Y7, Y4, Y7 VPXOR Y6, Y7, Y6 - VPXOR Y6, Y4, Y4 + VPXOR Y6, Y0, Y0 // Store 1 outputs - VMOVDQU Y4, (BX) - ADDQ $0x20, BX + VMOVDQU Y0, (DX)(BP*1) // Prepare for next loop + ADDQ $0x20, BP DECQ AX JNZ mulAvxTwo_2x1_loop VZEROUPPER @@ -827,82 +697,70 @@ mulAvxTwo_2x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_2x2(SB), $0-88 // Loading all tables to registers - // Destination kept in GP registers // Full registers estimated 15 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_2x2_end - VMOVDQU (CX), Y0 - VMOVDQU 32(CX), Y1 - VMOVDQU 64(CX), Y2 - VMOVDQU 96(CX), Y3 - VMOVDQU 128(CX), Y4 - VMOVDQU 160(CX), Y5 - VMOVDQU 192(CX), Y6 - VMOVDQU 224(CX), Y7 - MOVQ in_base+24(FP), CX - MOVQ (CX), DX - MOVQ 24(CX), CX - MOVQ out_base+48(FP), BX - MOVQ (BX), BP - MOVQ 24(BX), BX - MOVQ start+72(FP), SI - - // Add start offset to output - ADDQ SI, BP - ADDQ SI, BX - - // Add start offset to input - ADDQ SI, DX - ADDQ SI, CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_2x2_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), DX + VMOVDQU (CX), Y2 + VMOVDQU 32(CX), Y3 + VMOVDQU 64(CX), Y4 + VMOVDQU 96(CX), Y5 + VMOVDQU 128(CX), Y6 + VMOVDQU 160(CX), Y7 + VMOVDQU 192(CX), Y8 + VMOVDQU 224(CX), Y9 + MOVQ in_base+24(FP), CX + MOVQ (CX), BP + MOVQ 24(CX), CX MOVQ $0x0000000f, SI MOVQ SI, X10 VPBROADCASTB X10, Y10 + MOVQ start+72(FP), SI mulAvxTwo_2x2_loop: // Clear 2 outputs - VPXOR Y8, Y8, Y8 - VPXOR Y9, Y9, Y9 + VPXOR Y0, Y0, Y0 + VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (DX), Y13 - ADDQ $0x20, DX + VMOVDQU (BP)(SI*1), Y13 VPSRLQ $0x04, Y13, Y14 VPAND Y10, Y13, Y13 VPAND Y10, Y14, Y14 - VPSHUFB Y13, Y0, Y11 - VPSHUFB Y14, Y1, Y12 - VPXOR Y11, Y12, Y11 - VPXOR Y11, Y8, Y8 VPSHUFB Y13, Y2, Y11 VPSHUFB Y14, Y3, Y12 VPXOR Y11, Y12, Y11 - VPXOR Y11, Y9, Y9 + VPXOR Y11, Y0, Y0 + VPSHUFB Y13, Y4, Y11 + VPSHUFB Y14, Y5, Y12 + VPXOR Y11, Y12, Y11 + VPXOR Y11, Y1, Y1 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (CX), Y13 - ADDQ $0x20, CX + VMOVDQU (CX)(SI*1), Y13 VPSRLQ $0x04, Y13, Y14 VPAND Y10, Y13, Y13 VPAND Y10, Y14, Y14 - VPSHUFB Y13, Y4, Y11 - VPSHUFB Y14, Y5, Y12 - VPXOR Y11, Y12, Y11 - VPXOR Y11, Y8, Y8 VPSHUFB Y13, Y6, Y11 VPSHUFB Y14, Y7, Y12 VPXOR Y11, Y12, Y11 - VPXOR Y11, Y9, Y9 + VPXOR Y11, Y0, Y0 + VPSHUFB Y13, Y8, Y11 + VPSHUFB Y14, Y9, Y12 + VPXOR Y11, Y12, Y11 + VPXOR Y11, Y1, Y1 // Store 2 outputs - VMOVDQU Y8, (BP) - ADDQ $0x20, BP - VMOVDQU Y9, (BX) - ADDQ $0x20, BX + VMOVDQU Y0, (BX)(SI*1) + VMOVDQU Y1, (DX)(SI*1) // Prepare for next loop + ADDQ $0x20, SI DECQ AX JNZ mulAvxTwo_2x2_loop VZEROUPPER @@ -914,33 +772,23 @@ mulAvxTwo_2x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_2x3(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 20 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_2x3_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), DX - MOVQ out_base+48(FP), BP - MOVQ (BP), SI - MOVQ 24(BP), DI - MOVQ 48(BP), BP - MOVQ start+72(FP), R8 - - // Add start offset to output - ADDQ R8, SI - ADDQ R8, DI - ADDQ R8, BP - - // Add start offset to input - ADDQ R8, BX - ADDQ R8, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_2x3_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), DX + MOVQ in_base+24(FP), SI + MOVQ (SI), DI + MOVQ 24(SI), SI MOVQ $0x0000000f, R8 MOVQ R8, X3 VPBROADCASTB X3, Y3 + MOVQ start+72(FP), R8 mulAvxTwo_2x3_loop: // Clear 3 outputs @@ -949,8 +797,7 @@ mulAvxTwo_2x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (BX), Y6 - ADDQ $0x20, BX + VMOVDQU (DI)(R8*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -974,8 +821,7 @@ mulAvxTwo_2x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (DX), Y6 - ADDQ $0x20, DX + VMOVDQU (SI)(R8*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -999,14 +845,12 @@ mulAvxTwo_2x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - VMOVDQU Y0, (SI) - ADDQ $0x20, SI - VMOVDQU Y1, (DI) - ADDQ $0x20, DI - VMOVDQU Y2, (BP) - ADDQ $0x20, BP + VMOVDQU Y0, (BX)(R8*1) + VMOVDQU Y1, (BP)(R8*1) + VMOVDQU Y2, (DX)(R8*1) // Prepare for next loop + ADDQ $0x20, R8 DECQ AX JNZ mulAvxTwo_2x3_loop VZEROUPPER @@ -1018,35 +862,24 @@ mulAvxTwo_2x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_2x4(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 25 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_2x4_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), DX - MOVQ out_base+48(FP), BP - MOVQ (BP), SI - MOVQ 24(BP), DI - MOVQ 48(BP), R8 - MOVQ 72(BP), BP - MOVQ start+72(FP), R9 - - // Add start offset to output - ADDQ R9, SI - ADDQ R9, DI - ADDQ R9, R8 - ADDQ R9, BP - - // Add start offset to input - ADDQ R9, BX - ADDQ R9, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_2x4_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DX + MOVQ in_base+24(FP), DI + MOVQ (DI), R8 + MOVQ 24(DI), DI MOVQ $0x0000000f, R9 MOVQ R9, X4 VPBROADCASTB X4, Y4 + MOVQ start+72(FP), R9 mulAvxTwo_2x4_loop: // Clear 4 outputs @@ -1056,8 +889,7 @@ mulAvxTwo_2x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (BX), Y7 - ADDQ $0x20, BX + VMOVDQU (R8)(R9*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -1087,8 +919,7 @@ mulAvxTwo_2x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (DX), Y7 - ADDQ $0x20, DX + VMOVDQU (DI)(R9*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -1118,16 +949,13 @@ mulAvxTwo_2x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - VMOVDQU Y0, (SI) - ADDQ $0x20, SI - VMOVDQU Y1, (DI) - ADDQ $0x20, DI - VMOVDQU Y2, (R8) - ADDQ $0x20, R8 - VMOVDQU Y3, (BP) - ADDQ $0x20, BP + VMOVDQU Y0, (BX)(R9*1) + VMOVDQU Y1, (BP)(R9*1) + VMOVDQU Y2, (SI)(R9*1) + VMOVDQU Y3, (DX)(R9*1) // Prepare for next loop + ADDQ $0x20, R9 DECQ AX JNZ mulAvxTwo_2x4_loop VZEROUPPER @@ -1139,37 +967,25 @@ mulAvxTwo_2x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_2x5(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 30 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_2x5_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), DX - MOVQ out_base+48(FP), BP - MOVQ (BP), SI - MOVQ 24(BP), DI - MOVQ 48(BP), R8 - MOVQ 72(BP), R9 - MOVQ 96(BP), BP - MOVQ start+72(FP), R10 - - // Add start offset to output - ADDQ R10, SI - ADDQ R10, DI - ADDQ R10, R8 - ADDQ R10, R9 - ADDQ R10, BP - - // Add start offset to input - ADDQ R10, BX - ADDQ R10, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_2x5_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), DX + MOVQ in_base+24(FP), R8 + MOVQ (R8), R9 + MOVQ 24(R8), R8 MOVQ $0x0000000f, R10 MOVQ R10, X5 VPBROADCASTB X5, Y5 + MOVQ start+72(FP), R10 mulAvxTwo_2x5_loop: // Clear 5 outputs @@ -1180,8 +996,7 @@ mulAvxTwo_2x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (BX), Y8 - ADDQ $0x20, BX + VMOVDQU (R9)(R10*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -1217,8 +1032,7 @@ mulAvxTwo_2x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (DX), Y8 - ADDQ $0x20, DX + VMOVDQU (R8)(R10*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -1254,18 +1068,14 @@ mulAvxTwo_2x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - VMOVDQU Y0, (SI) - ADDQ $0x20, SI - VMOVDQU Y1, (DI) - ADDQ $0x20, DI - VMOVDQU Y2, (R8) - ADDQ $0x20, R8 - VMOVDQU Y3, (R9) - ADDQ $0x20, R9 - VMOVDQU Y4, (BP) - ADDQ $0x20, BP + VMOVDQU Y0, (BX)(R10*1) + VMOVDQU Y1, (BP)(R10*1) + VMOVDQU Y2, (SI)(R10*1) + VMOVDQU Y3, (DI)(R10*1) + VMOVDQU Y4, (DX)(R10*1) // Prepare for next loop + ADDQ $0x20, R10 DECQ AX JNZ mulAvxTwo_2x5_loop VZEROUPPER @@ -1277,39 +1087,26 @@ mulAvxTwo_2x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_2x6(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 35 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_2x6_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), DX - MOVQ out_base+48(FP), BP - MOVQ (BP), SI - MOVQ 24(BP), DI - MOVQ 48(BP), R8 - MOVQ 72(BP), R9 - MOVQ 96(BP), R10 - MOVQ 120(BP), BP - MOVQ start+72(FP), R11 - - // Add start offset to output - ADDQ R11, SI - ADDQ R11, DI - ADDQ R11, R8 - ADDQ R11, R9 - ADDQ R11, R10 - ADDQ R11, BP - - // Add start offset to input - ADDQ R11, BX - ADDQ R11, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_2x6_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), DX + MOVQ in_base+24(FP), R9 + MOVQ (R9), R10 + MOVQ 24(R9), R9 MOVQ $0x0000000f, R11 MOVQ R11, X6 VPBROADCASTB X6, Y6 + MOVQ start+72(FP), R11 mulAvxTwo_2x6_loop: // Clear 6 outputs @@ -1321,8 +1118,7 @@ mulAvxTwo_2x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (BX), Y9 - ADDQ $0x20, BX + VMOVDQU (R10)(R11*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -1364,8 +1160,7 @@ mulAvxTwo_2x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (DX), Y9 - ADDQ $0x20, DX + VMOVDQU (R9)(R11*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -1407,20 +1202,15 @@ mulAvxTwo_2x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - VMOVDQU Y0, (SI) - ADDQ $0x20, SI - VMOVDQU Y1, (DI) - ADDQ $0x20, DI - VMOVDQU Y2, (R8) - ADDQ $0x20, R8 - VMOVDQU Y3, (R9) - ADDQ $0x20, R9 - VMOVDQU Y4, (R10) - ADDQ $0x20, R10 - VMOVDQU Y5, (BP) - ADDQ $0x20, BP + VMOVDQU Y0, (BX)(R11*1) + VMOVDQU Y1, (BP)(R11*1) + VMOVDQU Y2, (SI)(R11*1) + VMOVDQU Y3, (DI)(R11*1) + VMOVDQU Y4, (R8)(R11*1) + VMOVDQU Y5, (DX)(R11*1) // Prepare for next loop + ADDQ $0x20, R11 DECQ AX JNZ mulAvxTwo_2x6_loop VZEROUPPER @@ -1432,41 +1222,27 @@ mulAvxTwo_2x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_2x7(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 40 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_2x7_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), DX - MOVQ out_base+48(FP), BP - MOVQ (BP), SI - MOVQ 24(BP), DI - MOVQ 48(BP), R8 - MOVQ 72(BP), R9 - MOVQ 96(BP), R10 - MOVQ 120(BP), R11 - MOVQ 144(BP), BP - MOVQ start+72(FP), R12 - - // Add start offset to output - ADDQ R12, SI - ADDQ R12, DI - ADDQ R12, R8 - ADDQ R12, R9 - ADDQ R12, R10 - ADDQ R12, R11 - ADDQ R12, BP - - // Add start offset to input - ADDQ R12, BX - ADDQ R12, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_2x7_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), DX + MOVQ in_base+24(FP), R10 + MOVQ (R10), R11 + MOVQ 24(R10), R10 MOVQ $0x0000000f, R12 MOVQ R12, X7 VPBROADCASTB X7, Y7 + MOVQ start+72(FP), R12 mulAvxTwo_2x7_loop: // Clear 7 outputs @@ -1479,8 +1255,7 @@ mulAvxTwo_2x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (BX), Y10 - ADDQ $0x20, BX + VMOVDQU (R11)(R12*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -1528,8 +1303,7 @@ mulAvxTwo_2x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (DX), Y10 - ADDQ $0x20, DX + VMOVDQU (R10)(R12*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -1577,22 +1351,16 @@ mulAvxTwo_2x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - VMOVDQU Y0, (SI) - ADDQ $0x20, SI - VMOVDQU Y1, (DI) - ADDQ $0x20, DI - VMOVDQU Y2, (R8) - ADDQ $0x20, R8 - VMOVDQU Y3, (R9) - ADDQ $0x20, R9 - VMOVDQU Y4, (R10) - ADDQ $0x20, R10 - VMOVDQU Y5, (R11) - ADDQ $0x20, R11 - VMOVDQU Y6, (BP) - ADDQ $0x20, BP + VMOVDQU Y0, (BX)(R12*1) + VMOVDQU Y1, (BP)(R12*1) + VMOVDQU Y2, (SI)(R12*1) + VMOVDQU Y3, (DI)(R12*1) + VMOVDQU Y4, (R8)(R12*1) + VMOVDQU Y5, (R9)(R12*1) + VMOVDQU Y6, (DX)(R12*1) // Prepare for next loop + ADDQ $0x20, R12 DECQ AX JNZ mulAvxTwo_2x7_loop VZEROUPPER @@ -1604,43 +1372,28 @@ mulAvxTwo_2x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_2x8(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 45 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_2x8_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), DX - MOVQ out_base+48(FP), BP - MOVQ (BP), SI - MOVQ 24(BP), DI - MOVQ 48(BP), R8 - MOVQ 72(BP), R9 - MOVQ 96(BP), R10 - MOVQ 120(BP), R11 - MOVQ 144(BP), R12 - MOVQ 168(BP), BP - MOVQ start+72(FP), R13 - - // Add start offset to output - ADDQ R13, SI - ADDQ R13, DI - ADDQ R13, R8 - ADDQ R13, R9 - ADDQ R13, R10 - ADDQ R13, R11 - ADDQ R13, R12 - ADDQ R13, BP - - // Add start offset to input - ADDQ R13, BX - ADDQ R13, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_2x8_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), DX + MOVQ in_base+24(FP), R11 + MOVQ (R11), R12 + MOVQ 24(R11), R11 MOVQ $0x0000000f, R13 MOVQ R13, X8 VPBROADCASTB X8, Y8 + MOVQ start+72(FP), R13 mulAvxTwo_2x8_loop: // Clear 8 outputs @@ -1654,8 +1407,7 @@ mulAvxTwo_2x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (BX), Y11 - ADDQ $0x20, BX + VMOVDQU (R12)(R13*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -1709,8 +1461,7 @@ mulAvxTwo_2x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (DX), Y11 - ADDQ $0x20, DX + VMOVDQU (R11)(R13*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -1764,24 +1515,17 @@ mulAvxTwo_2x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - VMOVDQU Y0, (SI) - ADDQ $0x20, SI - VMOVDQU Y1, (DI) - ADDQ $0x20, DI - VMOVDQU Y2, (R8) - ADDQ $0x20, R8 - VMOVDQU Y3, (R9) - ADDQ $0x20, R9 - VMOVDQU Y4, (R10) - ADDQ $0x20, R10 - VMOVDQU Y5, (R11) - ADDQ $0x20, R11 - VMOVDQU Y6, (R12) - ADDQ $0x20, R12 - VMOVDQU Y7, (BP) - ADDQ $0x20, BP + VMOVDQU Y0, (BX)(R13*1) + VMOVDQU Y1, (BP)(R13*1) + VMOVDQU Y2, (SI)(R13*1) + VMOVDQU Y3, (DI)(R13*1) + VMOVDQU Y4, (R8)(R13*1) + VMOVDQU Y5, (R9)(R13*1) + VMOVDQU Y6, (R10)(R13*1) + VMOVDQU Y7, (DX)(R13*1) // Prepare for next loop + ADDQ $0x20, R13 DECQ AX JNZ mulAvxTwo_2x8_loop VZEROUPPER @@ -1793,80 +1537,68 @@ mulAvxTwo_2x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_3x1(SB), $0-88 // Loading all tables to registers - // Destination kept in GP registers // Full registers estimated 10 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_3x1_end - VMOVDQU (CX), Y0 - VMOVDQU 32(CX), Y1 - VMOVDQU 64(CX), Y2 - VMOVDQU 96(CX), Y3 - VMOVDQU 128(CX), Y4 - VMOVDQU 160(CX), Y5 - MOVQ in_base+24(FP), CX - MOVQ (CX), DX - MOVQ 24(CX), BX - MOVQ 48(CX), CX - MOVQ out_base+48(FP), BP - MOVQ (BP), BP - MOVQ start+72(FP), SI - - // Add start offset to output - ADDQ SI, BP - - // Add start offset to input - ADDQ SI, DX - ADDQ SI, BX - ADDQ SI, CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_3x1_end + MOVQ out_base+48(FP), DX + MOVQ (DX), DX + VMOVDQU (CX), Y1 + VMOVDQU 32(CX), Y2 + VMOVDQU 64(CX), Y3 + VMOVDQU 96(CX), Y4 + VMOVDQU 128(CX), Y5 + VMOVDQU 160(CX), Y6 + MOVQ in_base+24(FP), CX + MOVQ (CX), BX + MOVQ 24(CX), BP + MOVQ 48(CX), CX MOVQ $0x0000000f, SI MOVQ SI, X7 VPBROADCASTB X7, Y7 + MOVQ start+72(FP), SI mulAvxTwo_3x1_loop: // Clear 1 outputs - VPXOR Y6, Y6, Y6 + VPXOR Y0, Y0, Y0 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (DX), Y8 - ADDQ $0x20, DX + VMOVDQU (BX)(SI*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y7, Y8, Y8 VPAND Y7, Y9, Y9 - VPSHUFB Y8, Y0, Y8 - VPSHUFB Y9, Y1, Y9 + VPSHUFB Y8, Y1, Y8 + VPSHUFB Y9, Y2, Y9 VPXOR Y8, Y9, Y8 - VPXOR Y8, Y6, Y6 + VPXOR Y8, Y0, Y0 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (BX), Y8 - ADDQ $0x20, BX + VMOVDQU (BP)(SI*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y7, Y8, Y8 VPAND Y7, Y9, Y9 - VPSHUFB Y8, Y2, Y8 - VPSHUFB Y9, Y3, Y9 + VPSHUFB Y8, Y3, Y8 + VPSHUFB Y9, Y4, Y9 VPXOR Y8, Y9, Y8 - VPXOR Y8, Y6, Y6 + VPXOR Y8, Y0, Y0 // Load and process 32 bytes from input 2 to 1 outputs - VMOVDQU (CX), Y8 - ADDQ $0x20, CX + VMOVDQU (CX)(SI*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y7, Y8, Y8 VPAND Y7, Y9, Y9 - VPSHUFB Y8, Y4, Y8 - VPSHUFB Y9, Y5, Y9 + VPSHUFB Y8, Y5, Y8 + VPSHUFB Y9, Y6, Y9 VPXOR Y8, Y9, Y8 - VPXOR Y8, Y6, Y6 + VPXOR Y8, Y0, Y0 // Store 1 outputs - VMOVDQU Y6, (BP) - ADDQ $0x20, BP + VMOVDQU Y0, (DX)(SI*1) // Prepare for next loop + ADDQ $0x20, SI DECQ AX JNZ mulAvxTwo_3x1_loop VZEROUPPER @@ -1878,33 +1610,23 @@ mulAvxTwo_3x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_3x2(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 19 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_3x2_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), DX - MOVQ out_base+48(FP), SI - MOVQ (SI), DI - MOVQ 24(SI), SI - MOVQ start+72(FP), R8 - - // Add start offset to output - ADDQ R8, DI - ADDQ R8, SI - - // Add start offset to input - ADDQ R8, BX - ADDQ R8, BP - ADDQ R8, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_3x2_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), DX + MOVQ in_base+24(FP), BP + MOVQ (BP), SI + MOVQ 24(BP), DI + MOVQ 48(BP), BP MOVQ $0x0000000f, R8 MOVQ R8, X2 VPBROADCASTB X2, Y2 + MOVQ start+72(FP), R8 mulAvxTwo_3x2_loop: // Clear 2 outputs @@ -1912,8 +1634,7 @@ mulAvxTwo_3x2_loop: VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (BX), Y5 - ADDQ $0x20, BX + VMOVDQU (SI)(R8*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -1931,8 +1652,7 @@ mulAvxTwo_3x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (BP), Y5 - ADDQ $0x20, BP + VMOVDQU (DI)(R8*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -1950,8 +1670,7 @@ mulAvxTwo_3x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 2 to 2 outputs - VMOVDQU (DX), Y5 - ADDQ $0x20, DX + VMOVDQU (BP)(R8*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -1969,12 +1688,11 @@ mulAvxTwo_3x2_loop: VPXOR Y3, Y1, Y1 // Store 2 outputs - VMOVDQU Y0, (DI) - ADDQ $0x20, DI - VMOVDQU Y1, (SI) - ADDQ $0x20, SI + VMOVDQU Y0, (BX)(R8*1) + VMOVDQU Y1, (DX)(R8*1) // Prepare for next loop + ADDQ $0x20, R8 DECQ AX JNZ mulAvxTwo_3x2_loop VZEROUPPER @@ -1986,35 +1704,24 @@ mulAvxTwo_3x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_3x3(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 26 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_3x3_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), DX - MOVQ out_base+48(FP), SI - MOVQ (SI), DI - MOVQ 24(SI), R8 - MOVQ 48(SI), SI - MOVQ start+72(FP), R9 - - // Add start offset to output - ADDQ R9, DI - ADDQ R9, R8 - ADDQ R9, SI - - // Add start offset to input - ADDQ R9, BX - ADDQ R9, BP - ADDQ R9, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_3x3_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), DX + MOVQ in_base+24(FP), SI + MOVQ (SI), DI + MOVQ 24(SI), R8 + MOVQ 48(SI), SI MOVQ $0x0000000f, R9 MOVQ R9, X3 VPBROADCASTB X3, Y3 + MOVQ start+72(FP), R9 mulAvxTwo_3x3_loop: // Clear 3 outputs @@ -2023,8 +1730,7 @@ mulAvxTwo_3x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (BX), Y6 - ADDQ $0x20, BX + VMOVDQU (DI)(R9*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -2048,8 +1754,7 @@ mulAvxTwo_3x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (BP), Y6 - ADDQ $0x20, BP + VMOVDQU (R8)(R9*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -2073,8 +1778,7 @@ mulAvxTwo_3x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 2 to 3 outputs - VMOVDQU (DX), Y6 - ADDQ $0x20, DX + VMOVDQU (SI)(R9*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -2098,14 +1802,12 @@ mulAvxTwo_3x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - VMOVDQU Y0, (DI) - ADDQ $0x20, DI - VMOVDQU Y1, (R8) - ADDQ $0x20, R8 - VMOVDQU Y2, (SI) - ADDQ $0x20, SI + VMOVDQU Y0, (BX)(R9*1) + VMOVDQU Y1, (BP)(R9*1) + VMOVDQU Y2, (DX)(R9*1) // Prepare for next loop + ADDQ $0x20, R9 DECQ AX JNZ mulAvxTwo_3x3_loop VZEROUPPER @@ -2117,37 +1819,25 @@ mulAvxTwo_3x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_3x4(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 33 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_3x4_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), DX - MOVQ out_base+48(FP), SI - MOVQ (SI), DI - MOVQ 24(SI), R8 - MOVQ 48(SI), R9 - MOVQ 72(SI), SI - MOVQ start+72(FP), R10 - - // Add start offset to output - ADDQ R10, DI - ADDQ R10, R8 - ADDQ R10, R9 - ADDQ R10, SI - - // Add start offset to input - ADDQ R10, BX - ADDQ R10, BP - ADDQ R10, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_3x4_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DX + MOVQ in_base+24(FP), DI + MOVQ (DI), R8 + MOVQ 24(DI), R9 + MOVQ 48(DI), DI MOVQ $0x0000000f, R10 MOVQ R10, X4 VPBROADCASTB X4, Y4 + MOVQ start+72(FP), R10 mulAvxTwo_3x4_loop: // Clear 4 outputs @@ -2157,8 +1847,7 @@ mulAvxTwo_3x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (BX), Y7 - ADDQ $0x20, BX + VMOVDQU (R8)(R10*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -2188,8 +1877,7 @@ mulAvxTwo_3x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (BP), Y7 - ADDQ $0x20, BP + VMOVDQU (R9)(R10*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -2219,8 +1907,7 @@ mulAvxTwo_3x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 2 to 4 outputs - VMOVDQU (DX), Y7 - ADDQ $0x20, DX + VMOVDQU (DI)(R10*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -2250,16 +1937,13 @@ mulAvxTwo_3x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - VMOVDQU Y0, (DI) - ADDQ $0x20, DI - VMOVDQU Y1, (R8) - ADDQ $0x20, R8 - VMOVDQU Y2, (R9) - ADDQ $0x20, R9 - VMOVDQU Y3, (SI) - ADDQ $0x20, SI + VMOVDQU Y0, (BX)(R10*1) + VMOVDQU Y1, (BP)(R10*1) + VMOVDQU Y2, (SI)(R10*1) + VMOVDQU Y3, (DX)(R10*1) // Prepare for next loop + ADDQ $0x20, R10 DECQ AX JNZ mulAvxTwo_3x4_loop VZEROUPPER @@ -2271,39 +1955,26 @@ mulAvxTwo_3x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_3x5(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 40 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_3x5_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), DX - MOVQ out_base+48(FP), SI - MOVQ (SI), DI - MOVQ 24(SI), R8 - MOVQ 48(SI), R9 - MOVQ 72(SI), R10 - MOVQ 96(SI), SI - MOVQ start+72(FP), R11 - - // Add start offset to output - ADDQ R11, DI - ADDQ R11, R8 - ADDQ R11, R9 - ADDQ R11, R10 - ADDQ R11, SI - - // Add start offset to input - ADDQ R11, BX - ADDQ R11, BP - ADDQ R11, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_3x5_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), DX + MOVQ in_base+24(FP), R8 + MOVQ (R8), R9 + MOVQ 24(R8), R10 + MOVQ 48(R8), R8 MOVQ $0x0000000f, R11 MOVQ R11, X5 VPBROADCASTB X5, Y5 + MOVQ start+72(FP), R11 mulAvxTwo_3x5_loop: // Clear 5 outputs @@ -2314,8 +1985,7 @@ mulAvxTwo_3x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (BX), Y8 - ADDQ $0x20, BX + VMOVDQU (R9)(R11*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -2351,8 +2021,7 @@ mulAvxTwo_3x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (BP), Y8 - ADDQ $0x20, BP + VMOVDQU (R10)(R11*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -2388,8 +2057,7 @@ mulAvxTwo_3x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 2 to 5 outputs - VMOVDQU (DX), Y8 - ADDQ $0x20, DX + VMOVDQU (R8)(R11*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -2425,18 +2093,14 @@ mulAvxTwo_3x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - VMOVDQU Y0, (DI) - ADDQ $0x20, DI - VMOVDQU Y1, (R8) - ADDQ $0x20, R8 - VMOVDQU Y2, (R9) - ADDQ $0x20, R9 - VMOVDQU Y3, (R10) - ADDQ $0x20, R10 - VMOVDQU Y4, (SI) - ADDQ $0x20, SI + VMOVDQU Y0, (BX)(R11*1) + VMOVDQU Y1, (BP)(R11*1) + VMOVDQU Y2, (SI)(R11*1) + VMOVDQU Y3, (DI)(R11*1) + VMOVDQU Y4, (DX)(R11*1) // Prepare for next loop + ADDQ $0x20, R11 DECQ AX JNZ mulAvxTwo_3x5_loop VZEROUPPER @@ -2448,41 +2112,27 @@ mulAvxTwo_3x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_3x6(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 47 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_3x6_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), DX - MOVQ out_base+48(FP), SI - MOVQ (SI), DI - MOVQ 24(SI), R8 - MOVQ 48(SI), R9 - MOVQ 72(SI), R10 - MOVQ 96(SI), R11 - MOVQ 120(SI), SI - MOVQ start+72(FP), R12 - - // Add start offset to output - ADDQ R12, DI - ADDQ R12, R8 - ADDQ R12, R9 - ADDQ R12, R10 - ADDQ R12, R11 - ADDQ R12, SI - - // Add start offset to input - ADDQ R12, BX - ADDQ R12, BP - ADDQ R12, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_3x6_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), DX + MOVQ in_base+24(FP), R9 + MOVQ (R9), R10 + MOVQ 24(R9), R11 + MOVQ 48(R9), R9 MOVQ $0x0000000f, R12 MOVQ R12, X6 VPBROADCASTB X6, Y6 + MOVQ start+72(FP), R12 mulAvxTwo_3x6_loop: // Clear 6 outputs @@ -2494,8 +2144,7 @@ mulAvxTwo_3x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (BX), Y9 - ADDQ $0x20, BX + VMOVDQU (R10)(R12*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -2537,8 +2186,7 @@ mulAvxTwo_3x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (BP), Y9 - ADDQ $0x20, BP + VMOVDQU (R11)(R12*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -2580,8 +2228,7 @@ mulAvxTwo_3x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 2 to 6 outputs - VMOVDQU (DX), Y9 - ADDQ $0x20, DX + VMOVDQU (R9)(R12*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -2623,20 +2270,15 @@ mulAvxTwo_3x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - VMOVDQU Y0, (DI) - ADDQ $0x20, DI - VMOVDQU Y1, (R8) - ADDQ $0x20, R8 - VMOVDQU Y2, (R9) - ADDQ $0x20, R9 - VMOVDQU Y3, (R10) - ADDQ $0x20, R10 - VMOVDQU Y4, (R11) - ADDQ $0x20, R11 - VMOVDQU Y5, (SI) - ADDQ $0x20, SI + VMOVDQU Y0, (BX)(R12*1) + VMOVDQU Y1, (BP)(R12*1) + VMOVDQU Y2, (SI)(R12*1) + VMOVDQU Y3, (DI)(R12*1) + VMOVDQU Y4, (R8)(R12*1) + VMOVDQU Y5, (DX)(R12*1) // Prepare for next loop + ADDQ $0x20, R12 DECQ AX JNZ mulAvxTwo_3x6_loop VZEROUPPER @@ -2648,43 +2290,28 @@ mulAvxTwo_3x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_3x7(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 54 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_3x7_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), DX - MOVQ out_base+48(FP), SI - MOVQ (SI), DI - MOVQ 24(SI), R8 - MOVQ 48(SI), R9 - MOVQ 72(SI), R10 - MOVQ 96(SI), R11 - MOVQ 120(SI), R12 - MOVQ 144(SI), SI - MOVQ start+72(FP), R13 - - // Add start offset to output - ADDQ R13, DI - ADDQ R13, R8 - ADDQ R13, R9 - ADDQ R13, R10 - ADDQ R13, R11 - ADDQ R13, R12 - ADDQ R13, SI - - // Add start offset to input - ADDQ R13, BX - ADDQ R13, BP - ADDQ R13, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_3x7_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), DX + MOVQ in_base+24(FP), R10 + MOVQ (R10), R11 + MOVQ 24(R10), R12 + MOVQ 48(R10), R10 MOVQ $0x0000000f, R13 MOVQ R13, X7 VPBROADCASTB X7, Y7 + MOVQ start+72(FP), R13 mulAvxTwo_3x7_loop: // Clear 7 outputs @@ -2697,8 +2324,7 @@ mulAvxTwo_3x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (BX), Y10 - ADDQ $0x20, BX + VMOVDQU (R11)(R13*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -2746,8 +2372,7 @@ mulAvxTwo_3x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (BP), Y10 - ADDQ $0x20, BP + VMOVDQU (R12)(R13*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -2795,8 +2420,7 @@ mulAvxTwo_3x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 2 to 7 outputs - VMOVDQU (DX), Y10 - ADDQ $0x20, DX + VMOVDQU (R10)(R13*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -2844,22 +2468,16 @@ mulAvxTwo_3x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - VMOVDQU Y0, (DI) - ADDQ $0x20, DI - VMOVDQU Y1, (R8) - ADDQ $0x20, R8 - VMOVDQU Y2, (R9) - ADDQ $0x20, R9 - VMOVDQU Y3, (R10) - ADDQ $0x20, R10 - VMOVDQU Y4, (R11) - ADDQ $0x20, R11 - VMOVDQU Y5, (R12) - ADDQ $0x20, R12 - VMOVDQU Y6, (SI) - ADDQ $0x20, SI + VMOVDQU Y0, (BX)(R13*1) + VMOVDQU Y1, (BP)(R13*1) + VMOVDQU Y2, (SI)(R13*1) + VMOVDQU Y3, (DI)(R13*1) + VMOVDQU Y4, (R8)(R13*1) + VMOVDQU Y5, (R9)(R13*1) + VMOVDQU Y6, (DX)(R13*1) // Prepare for next loop + ADDQ $0x20, R13 DECQ AX JNZ mulAvxTwo_3x7_loop VZEROUPPER @@ -2871,45 +2489,29 @@ mulAvxTwo_3x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_3x8(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 61 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_3x8_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), DX - MOVQ out_base+48(FP), SI - MOVQ (SI), DI - MOVQ 24(SI), R8 - MOVQ 48(SI), R9 - MOVQ 72(SI), R10 - MOVQ 96(SI), R11 - MOVQ 120(SI), R12 - MOVQ 144(SI), R13 - MOVQ 168(SI), SI - MOVQ start+72(FP), R14 - - // Add start offset to output - ADDQ R14, DI - ADDQ R14, R8 - ADDQ R14, R9 - ADDQ R14, R10 - ADDQ R14, R11 - ADDQ R14, R12 - ADDQ R14, R13 - ADDQ R14, SI - - // Add start offset to input - ADDQ R14, BX - ADDQ R14, BP - ADDQ R14, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_3x8_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), DX + MOVQ in_base+24(FP), R11 + MOVQ (R11), R12 + MOVQ 24(R11), R13 + MOVQ 48(R11), R11 MOVQ $0x0000000f, R14 MOVQ R14, X8 VPBROADCASTB X8, Y8 + MOVQ start+72(FP), R14 mulAvxTwo_3x8_loop: // Clear 8 outputs @@ -2923,8 +2525,7 @@ mulAvxTwo_3x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (BX), Y11 - ADDQ $0x20, BX + VMOVDQU (R12)(R14*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -2978,8 +2579,7 @@ mulAvxTwo_3x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (BP), Y11 - ADDQ $0x20, BP + VMOVDQU (R13)(R14*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -3033,8 +2633,7 @@ mulAvxTwo_3x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 2 to 8 outputs - VMOVDQU (DX), Y11 - ADDQ $0x20, DX + VMOVDQU (R11)(R14*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -3088,24 +2687,17 @@ mulAvxTwo_3x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - VMOVDQU Y0, (DI) - ADDQ $0x20, DI - VMOVDQU Y1, (R8) - ADDQ $0x20, R8 - VMOVDQU Y2, (R9) - ADDQ $0x20, R9 - VMOVDQU Y3, (R10) - ADDQ $0x20, R10 - VMOVDQU Y4, (R11) - ADDQ $0x20, R11 - VMOVDQU Y5, (R12) - ADDQ $0x20, R12 - VMOVDQU Y6, (R13) - ADDQ $0x20, R13 - VMOVDQU Y7, (SI) - ADDQ $0x20, SI + VMOVDQU Y0, (BX)(R14*1) + VMOVDQU Y1, (BP)(R14*1) + VMOVDQU Y2, (SI)(R14*1) + VMOVDQU Y3, (DI)(R14*1) + VMOVDQU Y4, (R8)(R14*1) + VMOVDQU Y5, (R9)(R14*1) + VMOVDQU Y6, (R10)(R14*1) + VMOVDQU Y7, (DX)(R14*1) // Prepare for next loop + ADDQ $0x20, R14 DECQ AX JNZ mulAvxTwo_3x8_loop VZEROUPPER @@ -3117,95 +2709,81 @@ mulAvxTwo_3x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_4x1(SB), $0-88 // Loading all tables to registers - // Destination kept in GP registers // Full registers estimated 12 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_4x1_end - VMOVDQU (CX), Y0 - VMOVDQU 32(CX), Y1 - VMOVDQU 64(CX), Y2 - VMOVDQU 96(CX), Y3 - VMOVDQU 128(CX), Y4 - VMOVDQU 160(CX), Y5 - VMOVDQU 192(CX), Y6 - VMOVDQU 224(CX), Y7 - MOVQ in_base+24(FP), CX - MOVQ (CX), DX - MOVQ 24(CX), BX - MOVQ 48(CX), BP - MOVQ 72(CX), CX - MOVQ out_base+48(FP), SI - MOVQ (SI), SI - MOVQ start+72(FP), DI - - // Add start offset to output - ADDQ DI, SI - - // Add start offset to input - ADDQ DI, DX - ADDQ DI, BX - ADDQ DI, BP - ADDQ DI, CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_4x1_end + MOVQ out_base+48(FP), DX + MOVQ (DX), DX + VMOVDQU (CX), Y1 + VMOVDQU 32(CX), Y2 + VMOVDQU 64(CX), Y3 + VMOVDQU 96(CX), Y4 + VMOVDQU 128(CX), Y5 + VMOVDQU 160(CX), Y6 + VMOVDQU 192(CX), Y7 + VMOVDQU 224(CX), Y8 + MOVQ in_base+24(FP), CX + MOVQ (CX), BX + MOVQ 24(CX), BP + MOVQ 48(CX), SI + MOVQ 72(CX), CX MOVQ $0x0000000f, DI MOVQ DI, X9 VPBROADCASTB X9, Y9 + MOVQ start+72(FP), DI mulAvxTwo_4x1_loop: // Clear 1 outputs - VPXOR Y8, Y8, Y8 + VPXOR Y0, Y0, Y0 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (DX), Y10 - ADDQ $0x20, DX + VMOVDQU (BX)(DI*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y9, Y10, Y10 VPAND Y9, Y11, Y11 - VPSHUFB Y10, Y0, Y10 - VPSHUFB Y11, Y1, Y11 + VPSHUFB Y10, Y1, Y10 + VPSHUFB Y11, Y2, Y11 VPXOR Y10, Y11, Y10 - VPXOR Y10, Y8, Y8 + VPXOR Y10, Y0, Y0 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (BX), Y10 - ADDQ $0x20, BX + VMOVDQU (BP)(DI*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y9, Y10, Y10 VPAND Y9, Y11, Y11 - VPSHUFB Y10, Y2, Y10 - VPSHUFB Y11, Y3, Y11 + VPSHUFB Y10, Y3, Y10 + VPSHUFB Y11, Y4, Y11 VPXOR Y10, Y11, Y10 - VPXOR Y10, Y8, Y8 + VPXOR Y10, Y0, Y0 // Load and process 32 bytes from input 2 to 1 outputs - VMOVDQU (BP), Y10 - ADDQ $0x20, BP + VMOVDQU (SI)(DI*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y9, Y10, Y10 VPAND Y9, Y11, Y11 - VPSHUFB Y10, Y4, Y10 - VPSHUFB Y11, Y5, Y11 + VPSHUFB Y10, Y5, Y10 + VPSHUFB Y11, Y6, Y11 VPXOR Y10, Y11, Y10 - VPXOR Y10, Y8, Y8 + VPXOR Y10, Y0, Y0 // Load and process 32 bytes from input 3 to 1 outputs - VMOVDQU (CX), Y10 - ADDQ $0x20, CX + VMOVDQU (CX)(DI*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y9, Y10, Y10 VPAND Y9, Y11, Y11 - VPSHUFB Y10, Y6, Y10 - VPSHUFB Y11, Y7, Y11 + VPSHUFB Y10, Y7, Y10 + VPSHUFB Y11, Y8, Y11 VPXOR Y10, Y11, Y10 - VPXOR Y10, Y8, Y8 + VPXOR Y10, Y0, Y0 // Store 1 outputs - VMOVDQU Y8, (SI) - ADDQ $0x20, SI + VMOVDQU Y0, (DX)(DI*1) // Prepare for next loop + ADDQ $0x20, DI DECQ AX JNZ mulAvxTwo_4x1_loop VZEROUPPER @@ -3217,35 +2795,24 @@ mulAvxTwo_4x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_4x2(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 23 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_4x2_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DX - MOVQ out_base+48(FP), DI - MOVQ (DI), R8 - MOVQ 24(DI), DI - MOVQ start+72(FP), R9 - - // Add start offset to output - ADDQ R9, R8 - ADDQ R9, DI - - // Add start offset to input - ADDQ R9, BX - ADDQ R9, BP - ADDQ R9, SI - ADDQ R9, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_4x2_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), DX + MOVQ in_base+24(FP), BP + MOVQ (BP), SI + MOVQ 24(BP), DI + MOVQ 48(BP), R8 + MOVQ 72(BP), BP MOVQ $0x0000000f, R9 MOVQ R9, X2 VPBROADCASTB X2, Y2 + MOVQ start+72(FP), R9 mulAvxTwo_4x2_loop: // Clear 2 outputs @@ -3253,8 +2820,7 @@ mulAvxTwo_4x2_loop: VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (BX), Y5 - ADDQ $0x20, BX + VMOVDQU (SI)(R9*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -3272,8 +2838,7 @@ mulAvxTwo_4x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (BP), Y5 - ADDQ $0x20, BP + VMOVDQU (DI)(R9*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -3291,8 +2856,7 @@ mulAvxTwo_4x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 2 to 2 outputs - VMOVDQU (SI), Y5 - ADDQ $0x20, SI + VMOVDQU (R8)(R9*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -3310,8 +2874,7 @@ mulAvxTwo_4x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 3 to 2 outputs - VMOVDQU (DX), Y5 - ADDQ $0x20, DX + VMOVDQU (BP)(R9*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -3329,12 +2892,11 @@ mulAvxTwo_4x2_loop: VPXOR Y3, Y1, Y1 // Store 2 outputs - VMOVDQU Y0, (R8) - ADDQ $0x20, R8 - VMOVDQU Y1, (DI) - ADDQ $0x20, DI + VMOVDQU Y0, (BX)(R9*1) + VMOVDQU Y1, (DX)(R9*1) // Prepare for next loop + ADDQ $0x20, R9 DECQ AX JNZ mulAvxTwo_4x2_loop VZEROUPPER @@ -3346,37 +2908,25 @@ mulAvxTwo_4x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_4x3(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 32 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_4x3_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DX - MOVQ out_base+48(FP), DI - MOVQ (DI), R8 - MOVQ 24(DI), R9 - MOVQ 48(DI), DI - MOVQ start+72(FP), R10 - - // Add start offset to output - ADDQ R10, R8 - ADDQ R10, R9 - ADDQ R10, DI - - // Add start offset to input - ADDQ R10, BX - ADDQ R10, BP - ADDQ R10, SI - ADDQ R10, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_4x3_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), DX + MOVQ in_base+24(FP), SI + MOVQ (SI), DI + MOVQ 24(SI), R8 + MOVQ 48(SI), R9 + MOVQ 72(SI), SI MOVQ $0x0000000f, R10 MOVQ R10, X3 VPBROADCASTB X3, Y3 + MOVQ start+72(FP), R10 mulAvxTwo_4x3_loop: // Clear 3 outputs @@ -3385,8 +2935,7 @@ mulAvxTwo_4x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (BX), Y6 - ADDQ $0x20, BX + VMOVDQU (DI)(R10*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -3410,8 +2959,7 @@ mulAvxTwo_4x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (BP), Y6 - ADDQ $0x20, BP + VMOVDQU (R8)(R10*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -3435,8 +2983,7 @@ mulAvxTwo_4x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 2 to 3 outputs - VMOVDQU (SI), Y6 - ADDQ $0x20, SI + VMOVDQU (R9)(R10*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -3460,8 +3007,7 @@ mulAvxTwo_4x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 3 to 3 outputs - VMOVDQU (DX), Y6 - ADDQ $0x20, DX + VMOVDQU (SI)(R10*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -3485,14 +3031,12 @@ mulAvxTwo_4x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - VMOVDQU Y0, (R8) - ADDQ $0x20, R8 - VMOVDQU Y1, (R9) - ADDQ $0x20, R9 - VMOVDQU Y2, (DI) - ADDQ $0x20, DI + VMOVDQU Y0, (BX)(R10*1) + VMOVDQU Y1, (BP)(R10*1) + VMOVDQU Y2, (DX)(R10*1) // Prepare for next loop + ADDQ $0x20, R10 DECQ AX JNZ mulAvxTwo_4x3_loop VZEROUPPER @@ -3504,39 +3048,26 @@ mulAvxTwo_4x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_4x4(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 41 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_4x4_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DX - MOVQ out_base+48(FP), DI - MOVQ (DI), R8 - MOVQ 24(DI), R9 - MOVQ 48(DI), R10 - MOVQ 72(DI), DI - MOVQ start+72(FP), R11 - - // Add start offset to output - ADDQ R11, R8 - ADDQ R11, R9 - ADDQ R11, R10 - ADDQ R11, DI - - // Add start offset to input - ADDQ R11, BX - ADDQ R11, BP - ADDQ R11, SI - ADDQ R11, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_4x4_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DX + MOVQ in_base+24(FP), DI + MOVQ (DI), R8 + MOVQ 24(DI), R9 + MOVQ 48(DI), R10 + MOVQ 72(DI), DI MOVQ $0x0000000f, R11 MOVQ R11, X4 VPBROADCASTB X4, Y4 + MOVQ start+72(FP), R11 mulAvxTwo_4x4_loop: // Clear 4 outputs @@ -3546,8 +3077,7 @@ mulAvxTwo_4x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (BX), Y7 - ADDQ $0x20, BX + VMOVDQU (R8)(R11*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -3577,8 +3107,7 @@ mulAvxTwo_4x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (BP), Y7 - ADDQ $0x20, BP + VMOVDQU (R9)(R11*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -3608,8 +3137,7 @@ mulAvxTwo_4x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 2 to 4 outputs - VMOVDQU (SI), Y7 - ADDQ $0x20, SI + VMOVDQU (R10)(R11*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -3639,8 +3167,7 @@ mulAvxTwo_4x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 3 to 4 outputs - VMOVDQU (DX), Y7 - ADDQ $0x20, DX + VMOVDQU (DI)(R11*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -3670,16 +3197,13 @@ mulAvxTwo_4x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - VMOVDQU Y0, (R8) - ADDQ $0x20, R8 - VMOVDQU Y1, (R9) - ADDQ $0x20, R9 - VMOVDQU Y2, (R10) - ADDQ $0x20, R10 - VMOVDQU Y3, (DI) - ADDQ $0x20, DI + VMOVDQU Y0, (BX)(R11*1) + VMOVDQU Y1, (BP)(R11*1) + VMOVDQU Y2, (SI)(R11*1) + VMOVDQU Y3, (DX)(R11*1) // Prepare for next loop + ADDQ $0x20, R11 DECQ AX JNZ mulAvxTwo_4x4_loop VZEROUPPER @@ -3691,41 +3215,27 @@ mulAvxTwo_4x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_4x5(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 50 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_4x5_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DX - MOVQ out_base+48(FP), DI - MOVQ (DI), R8 - MOVQ 24(DI), R9 - MOVQ 48(DI), R10 - MOVQ 72(DI), R11 - MOVQ 96(DI), DI - MOVQ start+72(FP), R12 - - // Add start offset to output - ADDQ R12, R8 - ADDQ R12, R9 - ADDQ R12, R10 - ADDQ R12, R11 - ADDQ R12, DI - - // Add start offset to input - ADDQ R12, BX - ADDQ R12, BP - ADDQ R12, SI - ADDQ R12, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_4x5_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), DX + MOVQ in_base+24(FP), R8 + MOVQ (R8), R9 + MOVQ 24(R8), R10 + MOVQ 48(R8), R11 + MOVQ 72(R8), R8 MOVQ $0x0000000f, R12 MOVQ R12, X5 VPBROADCASTB X5, Y5 + MOVQ start+72(FP), R12 mulAvxTwo_4x5_loop: // Clear 5 outputs @@ -3736,8 +3246,7 @@ mulAvxTwo_4x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (BX), Y8 - ADDQ $0x20, BX + VMOVDQU (R9)(R12*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -3773,8 +3282,7 @@ mulAvxTwo_4x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (BP), Y8 - ADDQ $0x20, BP + VMOVDQU (R10)(R12*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -3810,8 +3318,7 @@ mulAvxTwo_4x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 2 to 5 outputs - VMOVDQU (SI), Y8 - ADDQ $0x20, SI + VMOVDQU (R11)(R12*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -3847,8 +3354,7 @@ mulAvxTwo_4x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 3 to 5 outputs - VMOVDQU (DX), Y8 - ADDQ $0x20, DX + VMOVDQU (R8)(R12*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -3884,18 +3390,14 @@ mulAvxTwo_4x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - VMOVDQU Y0, (R8) - ADDQ $0x20, R8 - VMOVDQU Y1, (R9) - ADDQ $0x20, R9 - VMOVDQU Y2, (R10) - ADDQ $0x20, R10 - VMOVDQU Y3, (R11) - ADDQ $0x20, R11 - VMOVDQU Y4, (DI) - ADDQ $0x20, DI + VMOVDQU Y0, (BX)(R12*1) + VMOVDQU Y1, (BP)(R12*1) + VMOVDQU Y2, (SI)(R12*1) + VMOVDQU Y3, (DI)(R12*1) + VMOVDQU Y4, (DX)(R12*1) // Prepare for next loop + ADDQ $0x20, R12 DECQ AX JNZ mulAvxTwo_4x5_loop VZEROUPPER @@ -3907,43 +3409,28 @@ mulAvxTwo_4x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_4x6(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 59 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_4x6_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DX - MOVQ out_base+48(FP), DI - MOVQ (DI), R8 - MOVQ 24(DI), R9 - MOVQ 48(DI), R10 - MOVQ 72(DI), R11 - MOVQ 96(DI), R12 - MOVQ 120(DI), DI - MOVQ start+72(FP), R13 - - // Add start offset to output - ADDQ R13, R8 - ADDQ R13, R9 - ADDQ R13, R10 - ADDQ R13, R11 - ADDQ R13, R12 - ADDQ R13, DI - - // Add start offset to input - ADDQ R13, BX - ADDQ R13, BP - ADDQ R13, SI - ADDQ R13, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_4x6_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), DX + MOVQ in_base+24(FP), R9 + MOVQ (R9), R10 + MOVQ 24(R9), R11 + MOVQ 48(R9), R12 + MOVQ 72(R9), R9 MOVQ $0x0000000f, R13 MOVQ R13, X6 VPBROADCASTB X6, Y6 + MOVQ start+72(FP), R13 mulAvxTwo_4x6_loop: // Clear 6 outputs @@ -3955,8 +3442,7 @@ mulAvxTwo_4x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (BX), Y9 - ADDQ $0x20, BX + VMOVDQU (R10)(R13*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -3998,8 +3484,7 @@ mulAvxTwo_4x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (BP), Y9 - ADDQ $0x20, BP + VMOVDQU (R11)(R13*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -4041,8 +3526,7 @@ mulAvxTwo_4x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 2 to 6 outputs - VMOVDQU (SI), Y9 - ADDQ $0x20, SI + VMOVDQU (R12)(R13*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -4084,8 +3568,7 @@ mulAvxTwo_4x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 3 to 6 outputs - VMOVDQU (DX), Y9 - ADDQ $0x20, DX + VMOVDQU (R9)(R13*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -4127,20 +3610,15 @@ mulAvxTwo_4x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - VMOVDQU Y0, (R8) - ADDQ $0x20, R8 - VMOVDQU Y1, (R9) - ADDQ $0x20, R9 - VMOVDQU Y2, (R10) - ADDQ $0x20, R10 - VMOVDQU Y3, (R11) - ADDQ $0x20, R11 - VMOVDQU Y4, (R12) - ADDQ $0x20, R12 - VMOVDQU Y5, (DI) - ADDQ $0x20, DI + VMOVDQU Y0, (BX)(R13*1) + VMOVDQU Y1, (BP)(R13*1) + VMOVDQU Y2, (SI)(R13*1) + VMOVDQU Y3, (DI)(R13*1) + VMOVDQU Y4, (R8)(R13*1) + VMOVDQU Y5, (DX)(R13*1) // Prepare for next loop + ADDQ $0x20, R13 DECQ AX JNZ mulAvxTwo_4x6_loop VZEROUPPER @@ -4152,45 +3630,29 @@ mulAvxTwo_4x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_4x7(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 68 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_4x7_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DX - MOVQ out_base+48(FP), DI - MOVQ (DI), R8 - MOVQ 24(DI), R9 - MOVQ 48(DI), R10 - MOVQ 72(DI), R11 - MOVQ 96(DI), R12 - MOVQ 120(DI), R13 - MOVQ 144(DI), DI - MOVQ start+72(FP), R14 - - // Add start offset to output - ADDQ R14, R8 - ADDQ R14, R9 - ADDQ R14, R10 - ADDQ R14, R11 - ADDQ R14, R12 - ADDQ R14, R13 - ADDQ R14, DI - - // Add start offset to input - ADDQ R14, BX - ADDQ R14, BP - ADDQ R14, SI - ADDQ R14, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_4x7_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), DX + MOVQ in_base+24(FP), R10 + MOVQ (R10), R11 + MOVQ 24(R10), R12 + MOVQ 48(R10), R13 + MOVQ 72(R10), R10 MOVQ $0x0000000f, R14 MOVQ R14, X7 VPBROADCASTB X7, Y7 + MOVQ start+72(FP), R14 mulAvxTwo_4x7_loop: // Clear 7 outputs @@ -4203,8 +3665,7 @@ mulAvxTwo_4x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (BX), Y10 - ADDQ $0x20, BX + VMOVDQU (R11)(R14*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -4252,8 +3713,7 @@ mulAvxTwo_4x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (BP), Y10 - ADDQ $0x20, BP + VMOVDQU (R12)(R14*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -4301,8 +3761,7 @@ mulAvxTwo_4x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 2 to 7 outputs - VMOVDQU (SI), Y10 - ADDQ $0x20, SI + VMOVDQU (R13)(R14*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -4350,8 +3809,7 @@ mulAvxTwo_4x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 3 to 7 outputs - VMOVDQU (DX), Y10 - ADDQ $0x20, DX + VMOVDQU (R10)(R14*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -4399,22 +3857,16 @@ mulAvxTwo_4x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - VMOVDQU Y0, (R8) - ADDQ $0x20, R8 - VMOVDQU Y1, (R9) - ADDQ $0x20, R9 - VMOVDQU Y2, (R10) - ADDQ $0x20, R10 - VMOVDQU Y3, (R11) - ADDQ $0x20, R11 - VMOVDQU Y4, (R12) - ADDQ $0x20, R12 - VMOVDQU Y5, (R13) - ADDQ $0x20, R13 - VMOVDQU Y6, (DI) - ADDQ $0x20, DI + VMOVDQU Y0, (BX)(R14*1) + VMOVDQU Y1, (BP)(R14*1) + VMOVDQU Y2, (SI)(R14*1) + VMOVDQU Y3, (DI)(R14*1) + VMOVDQU Y4, (R8)(R14*1) + VMOVDQU Y5, (R9)(R14*1) + VMOVDQU Y6, (DX)(R14*1) // Prepare for next loop + ADDQ $0x20, R14 DECQ AX JNZ mulAvxTwo_4x7_loop VZEROUPPER @@ -4426,47 +3878,30 @@ mulAvxTwo_4x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_4x8(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 77 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_4x8_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DX - MOVQ out_base+48(FP), DI - MOVQ (DI), R8 - MOVQ 24(DI), R9 - MOVQ 48(DI), R10 - MOVQ 72(DI), R11 - MOVQ 96(DI), R12 - MOVQ 120(DI), R13 - MOVQ 144(DI), R14 - MOVQ 168(DI), DI - MOVQ start+72(FP), R15 - - // Add start offset to output - ADDQ R15, R8 - ADDQ R15, R9 - ADDQ R15, R10 - ADDQ R15, R11 - ADDQ R15, R12 - ADDQ R15, R13 - ADDQ R15, R14 - ADDQ R15, DI - - // Add start offset to input - ADDQ R15, BX - ADDQ R15, BP - ADDQ R15, SI - ADDQ R15, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_4x8_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), R10 + MOVQ 168(DX), DX + MOVQ in_base+24(FP), R11 + MOVQ (R11), R12 + MOVQ 24(R11), R13 + MOVQ 48(R11), R14 + MOVQ 72(R11), R11 MOVQ $0x0000000f, R15 MOVQ R15, X8 VPBROADCASTB X8, Y8 + MOVQ start+72(FP), R15 mulAvxTwo_4x8_loop: // Clear 8 outputs @@ -4480,8 +3915,7 @@ mulAvxTwo_4x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (BX), Y11 - ADDQ $0x20, BX + VMOVDQU (R12)(R15*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -4535,8 +3969,7 @@ mulAvxTwo_4x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (BP), Y11 - ADDQ $0x20, BP + VMOVDQU (R13)(R15*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -4590,8 +4023,7 @@ mulAvxTwo_4x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 2 to 8 outputs - VMOVDQU (SI), Y11 - ADDQ $0x20, SI + VMOVDQU (R14)(R15*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -4645,8 +4077,7 @@ mulAvxTwo_4x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 3 to 8 outputs - VMOVDQU (DX), Y11 - ADDQ $0x20, DX + VMOVDQU (R11)(R15*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -4700,24 +4131,17 @@ mulAvxTwo_4x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - VMOVDQU Y0, (R8) - ADDQ $0x20, R8 - VMOVDQU Y1, (R9) - ADDQ $0x20, R9 - VMOVDQU Y2, (R10) - ADDQ $0x20, R10 - VMOVDQU Y3, (R11) - ADDQ $0x20, R11 - VMOVDQU Y4, (R12) - ADDQ $0x20, R12 - VMOVDQU Y5, (R13) - ADDQ $0x20, R13 - VMOVDQU Y6, (R14) - ADDQ $0x20, R14 - VMOVDQU Y7, (DI) - ADDQ $0x20, DI + VMOVDQU Y0, (BX)(R15*1) + VMOVDQU Y1, (BP)(R15*1) + VMOVDQU Y2, (SI)(R15*1) + VMOVDQU Y3, (DI)(R15*1) + VMOVDQU Y4, (R8)(R15*1) + VMOVDQU Y5, (R9)(R15*1) + VMOVDQU Y6, (R10)(R15*1) + VMOVDQU Y7, (DX)(R15*1) // Prepare for next loop + ADDQ $0x20, R15 DECQ AX JNZ mulAvxTwo_4x8_loop VZEROUPPER @@ -4729,110 +4153,94 @@ mulAvxTwo_4x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_5x1(SB), $0-88 // Loading all tables to registers - // Destination kept in GP registers // Full registers estimated 14 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_5x1_end - VMOVDQU (CX), Y0 - VMOVDQU 32(CX), Y1 - VMOVDQU 64(CX), Y2 - VMOVDQU 96(CX), Y3 - VMOVDQU 128(CX), Y4 - VMOVDQU 160(CX), Y5 - VMOVDQU 192(CX), Y6 - VMOVDQU 224(CX), Y7 - VMOVDQU 256(CX), Y8 - VMOVDQU 288(CX), Y9 - MOVQ in_base+24(FP), CX - MOVQ (CX), DX - MOVQ 24(CX), BX - MOVQ 48(CX), BP - MOVQ 72(CX), SI - MOVQ 96(CX), CX - MOVQ out_base+48(FP), DI - MOVQ (DI), DI - MOVQ start+72(FP), R8 - - // Add start offset to output - ADDQ R8, DI - - // Add start offset to input - ADDQ R8, DX - ADDQ R8, BX - ADDQ R8, BP - ADDQ R8, SI - ADDQ R8, CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_5x1_end + MOVQ out_base+48(FP), DX + MOVQ (DX), DX + VMOVDQU (CX), Y1 + VMOVDQU 32(CX), Y2 + VMOVDQU 64(CX), Y3 + VMOVDQU 96(CX), Y4 + VMOVDQU 128(CX), Y5 + VMOVDQU 160(CX), Y6 + VMOVDQU 192(CX), Y7 + VMOVDQU 224(CX), Y8 + VMOVDQU 256(CX), Y9 + VMOVDQU 288(CX), Y10 + MOVQ in_base+24(FP), CX + MOVQ (CX), BX + MOVQ 24(CX), BP + MOVQ 48(CX), SI + MOVQ 72(CX), DI + MOVQ 96(CX), CX MOVQ $0x0000000f, R8 MOVQ R8, X11 VPBROADCASTB X11, Y11 + MOVQ start+72(FP), R8 mulAvxTwo_5x1_loop: // Clear 1 outputs - VPXOR Y10, Y10, Y10 + VPXOR Y0, Y0, Y0 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (DX), Y12 - ADDQ $0x20, DX + VMOVDQU (BX)(R8*1), Y12 VPSRLQ $0x04, Y12, Y13 VPAND Y11, Y12, Y12 VPAND Y11, Y13, Y13 - VPSHUFB Y12, Y0, Y12 - VPSHUFB Y13, Y1, Y13 + VPSHUFB Y12, Y1, Y12 + VPSHUFB Y13, Y2, Y13 VPXOR Y12, Y13, Y12 - VPXOR Y12, Y10, Y10 + VPXOR Y12, Y0, Y0 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (BX), Y12 - ADDQ $0x20, BX + VMOVDQU (BP)(R8*1), Y12 VPSRLQ $0x04, Y12, Y13 VPAND Y11, Y12, Y12 VPAND Y11, Y13, Y13 - VPSHUFB Y12, Y2, Y12 - VPSHUFB Y13, Y3, Y13 + VPSHUFB Y12, Y3, Y12 + VPSHUFB Y13, Y4, Y13 VPXOR Y12, Y13, Y12 - VPXOR Y12, Y10, Y10 + VPXOR Y12, Y0, Y0 // Load and process 32 bytes from input 2 to 1 outputs - VMOVDQU (BP), Y12 - ADDQ $0x20, BP + VMOVDQU (SI)(R8*1), Y12 VPSRLQ $0x04, Y12, Y13 VPAND Y11, Y12, Y12 VPAND Y11, Y13, Y13 - VPSHUFB Y12, Y4, Y12 - VPSHUFB Y13, Y5, Y13 + VPSHUFB Y12, Y5, Y12 + VPSHUFB Y13, Y6, Y13 VPXOR Y12, Y13, Y12 - VPXOR Y12, Y10, Y10 + VPXOR Y12, Y0, Y0 // Load and process 32 bytes from input 3 to 1 outputs - VMOVDQU (SI), Y12 - ADDQ $0x20, SI + VMOVDQU (DI)(R8*1), Y12 VPSRLQ $0x04, Y12, Y13 VPAND Y11, Y12, Y12 VPAND Y11, Y13, Y13 - VPSHUFB Y12, Y6, Y12 - VPSHUFB Y13, Y7, Y13 + VPSHUFB Y12, Y7, Y12 + VPSHUFB Y13, Y8, Y13 VPXOR Y12, Y13, Y12 - VPXOR Y12, Y10, Y10 + VPXOR Y12, Y0, Y0 // Load and process 32 bytes from input 4 to 1 outputs - VMOVDQU (CX), Y12 - ADDQ $0x20, CX + VMOVDQU (CX)(R8*1), Y12 VPSRLQ $0x04, Y12, Y13 VPAND Y11, Y12, Y12 VPAND Y11, Y13, Y13 - VPSHUFB Y12, Y8, Y12 - VPSHUFB Y13, Y9, Y13 + VPSHUFB Y12, Y9, Y12 + VPSHUFB Y13, Y10, Y13 VPXOR Y12, Y13, Y12 - VPXOR Y12, Y10, Y10 + VPXOR Y12, Y0, Y0 // Store 1 outputs - VMOVDQU Y10, (DI) - ADDQ $0x20, DI + VMOVDQU Y0, (DX)(R8*1) // Prepare for next loop + ADDQ $0x20, R8 DECQ AX JNZ mulAvxTwo_5x1_loop VZEROUPPER @@ -4844,37 +4252,25 @@ mulAvxTwo_5x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_5x2(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 27 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_5x2_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), DX - MOVQ out_base+48(FP), R8 - MOVQ (R8), R9 - MOVQ 24(R8), R8 - MOVQ start+72(FP), R10 - - // Add start offset to output - ADDQ R10, R9 - ADDQ R10, R8 - - // Add start offset to input - ADDQ R10, BX - ADDQ R10, BP - ADDQ R10, SI - ADDQ R10, DI - ADDQ R10, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_5x2_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), DX + MOVQ in_base+24(FP), BP + MOVQ (BP), SI + MOVQ 24(BP), DI + MOVQ 48(BP), R8 + MOVQ 72(BP), R9 + MOVQ 96(BP), BP MOVQ $0x0000000f, R10 MOVQ R10, X2 VPBROADCASTB X2, Y2 + MOVQ start+72(FP), R10 mulAvxTwo_5x2_loop: // Clear 2 outputs @@ -4882,8 +4278,7 @@ mulAvxTwo_5x2_loop: VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (BX), Y5 - ADDQ $0x20, BX + VMOVDQU (SI)(R10*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -4901,8 +4296,7 @@ mulAvxTwo_5x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (BP), Y5 - ADDQ $0x20, BP + VMOVDQU (DI)(R10*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -4920,8 +4314,7 @@ mulAvxTwo_5x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 2 to 2 outputs - VMOVDQU (SI), Y5 - ADDQ $0x20, SI + VMOVDQU (R8)(R10*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -4939,8 +4332,7 @@ mulAvxTwo_5x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 3 to 2 outputs - VMOVDQU (DI), Y5 - ADDQ $0x20, DI + VMOVDQU (R9)(R10*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -4958,8 +4350,7 @@ mulAvxTwo_5x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 4 to 2 outputs - VMOVDQU (DX), Y5 - ADDQ $0x20, DX + VMOVDQU (BP)(R10*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -4977,12 +4368,11 @@ mulAvxTwo_5x2_loop: VPXOR Y3, Y1, Y1 // Store 2 outputs - VMOVDQU Y0, (R9) - ADDQ $0x20, R9 - VMOVDQU Y1, (R8) - ADDQ $0x20, R8 + VMOVDQU Y0, (BX)(R10*1) + VMOVDQU Y1, (DX)(R10*1) // Prepare for next loop + ADDQ $0x20, R10 DECQ AX JNZ mulAvxTwo_5x2_loop VZEROUPPER @@ -4994,39 +4384,26 @@ mulAvxTwo_5x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_5x3(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 38 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_5x3_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), DX - MOVQ out_base+48(FP), R8 - MOVQ (R8), R9 - MOVQ 24(R8), R10 - MOVQ 48(R8), R8 - MOVQ start+72(FP), R11 - - // Add start offset to output - ADDQ R11, R9 - ADDQ R11, R10 - ADDQ R11, R8 - - // Add start offset to input - ADDQ R11, BX - ADDQ R11, BP - ADDQ R11, SI - ADDQ R11, DI - ADDQ R11, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_5x3_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), DX + MOVQ in_base+24(FP), SI + MOVQ (SI), DI + MOVQ 24(SI), R8 + MOVQ 48(SI), R9 + MOVQ 72(SI), R10 + MOVQ 96(SI), SI MOVQ $0x0000000f, R11 MOVQ R11, X3 VPBROADCASTB X3, Y3 + MOVQ start+72(FP), R11 mulAvxTwo_5x3_loop: // Clear 3 outputs @@ -5035,8 +4412,7 @@ mulAvxTwo_5x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (BX), Y6 - ADDQ $0x20, BX + VMOVDQU (DI)(R11*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -5060,8 +4436,7 @@ mulAvxTwo_5x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (BP), Y6 - ADDQ $0x20, BP + VMOVDQU (R8)(R11*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -5085,8 +4460,7 @@ mulAvxTwo_5x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 2 to 3 outputs - VMOVDQU (SI), Y6 - ADDQ $0x20, SI + VMOVDQU (R9)(R11*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -5110,8 +4484,7 @@ mulAvxTwo_5x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 3 to 3 outputs - VMOVDQU (DI), Y6 - ADDQ $0x20, DI + VMOVDQU (R10)(R11*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -5135,8 +4508,7 @@ mulAvxTwo_5x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 4 to 3 outputs - VMOVDQU (DX), Y6 - ADDQ $0x20, DX + VMOVDQU (SI)(R11*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -5160,14 +4532,12 @@ mulAvxTwo_5x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - VMOVDQU Y0, (R9) - ADDQ $0x20, R9 - VMOVDQU Y1, (R10) - ADDQ $0x20, R10 - VMOVDQU Y2, (R8) - ADDQ $0x20, R8 + VMOVDQU Y0, (BX)(R11*1) + VMOVDQU Y1, (BP)(R11*1) + VMOVDQU Y2, (DX)(R11*1) // Prepare for next loop + ADDQ $0x20, R11 DECQ AX JNZ mulAvxTwo_5x3_loop VZEROUPPER @@ -5179,41 +4549,27 @@ mulAvxTwo_5x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_5x4(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 49 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_5x4_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), DX - MOVQ out_base+48(FP), R8 - MOVQ (R8), R9 - MOVQ 24(R8), R10 - MOVQ 48(R8), R11 - MOVQ 72(R8), R8 - MOVQ start+72(FP), R12 - - // Add start offset to output - ADDQ R12, R9 - ADDQ R12, R10 - ADDQ R12, R11 - ADDQ R12, R8 - - // Add start offset to input - ADDQ R12, BX - ADDQ R12, BP - ADDQ R12, SI - ADDQ R12, DI - ADDQ R12, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_5x4_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DX + MOVQ in_base+24(FP), DI + MOVQ (DI), R8 + MOVQ 24(DI), R9 + MOVQ 48(DI), R10 + MOVQ 72(DI), R11 + MOVQ 96(DI), DI MOVQ $0x0000000f, R12 MOVQ R12, X4 VPBROADCASTB X4, Y4 + MOVQ start+72(FP), R12 mulAvxTwo_5x4_loop: // Clear 4 outputs @@ -5223,8 +4579,7 @@ mulAvxTwo_5x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (BX), Y7 - ADDQ $0x20, BX + VMOVDQU (R8)(R12*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -5254,8 +4609,7 @@ mulAvxTwo_5x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (BP), Y7 - ADDQ $0x20, BP + VMOVDQU (R9)(R12*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -5285,8 +4639,7 @@ mulAvxTwo_5x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 2 to 4 outputs - VMOVDQU (SI), Y7 - ADDQ $0x20, SI + VMOVDQU (R10)(R12*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -5316,8 +4669,7 @@ mulAvxTwo_5x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 3 to 4 outputs - VMOVDQU (DI), Y7 - ADDQ $0x20, DI + VMOVDQU (R11)(R12*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -5347,8 +4699,7 @@ mulAvxTwo_5x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 4 to 4 outputs - VMOVDQU (DX), Y7 - ADDQ $0x20, DX + VMOVDQU (DI)(R12*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -5378,16 +4729,13 @@ mulAvxTwo_5x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - VMOVDQU Y0, (R9) - ADDQ $0x20, R9 - VMOVDQU Y1, (R10) - ADDQ $0x20, R10 - VMOVDQU Y2, (R11) - ADDQ $0x20, R11 - VMOVDQU Y3, (R8) - ADDQ $0x20, R8 + VMOVDQU Y0, (BX)(R12*1) + VMOVDQU Y1, (BP)(R12*1) + VMOVDQU Y2, (SI)(R12*1) + VMOVDQU Y3, (DX)(R12*1) // Prepare for next loop + ADDQ $0x20, R12 DECQ AX JNZ mulAvxTwo_5x4_loop VZEROUPPER @@ -5399,43 +4747,28 @@ mulAvxTwo_5x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_5x5(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 60 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_5x5_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), DX - MOVQ out_base+48(FP), R8 - MOVQ (R8), R9 - MOVQ 24(R8), R10 - MOVQ 48(R8), R11 - MOVQ 72(R8), R12 - MOVQ 96(R8), R8 - MOVQ start+72(FP), R13 - - // Add start offset to output - ADDQ R13, R9 - ADDQ R13, R10 - ADDQ R13, R11 - ADDQ R13, R12 - ADDQ R13, R8 - - // Add start offset to input - ADDQ R13, BX - ADDQ R13, BP - ADDQ R13, SI - ADDQ R13, DI - ADDQ R13, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_5x5_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), DX + MOVQ in_base+24(FP), R8 + MOVQ (R8), R9 + MOVQ 24(R8), R10 + MOVQ 48(R8), R11 + MOVQ 72(R8), R12 + MOVQ 96(R8), R8 MOVQ $0x0000000f, R13 MOVQ R13, X5 VPBROADCASTB X5, Y5 + MOVQ start+72(FP), R13 mulAvxTwo_5x5_loop: // Clear 5 outputs @@ -5446,8 +4779,7 @@ mulAvxTwo_5x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (BX), Y8 - ADDQ $0x20, BX + VMOVDQU (R9)(R13*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -5483,8 +4815,7 @@ mulAvxTwo_5x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (BP), Y8 - ADDQ $0x20, BP + VMOVDQU (R10)(R13*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -5520,8 +4851,7 @@ mulAvxTwo_5x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 2 to 5 outputs - VMOVDQU (SI), Y8 - ADDQ $0x20, SI + VMOVDQU (R11)(R13*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -5557,8 +4887,7 @@ mulAvxTwo_5x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 3 to 5 outputs - VMOVDQU (DI), Y8 - ADDQ $0x20, DI + VMOVDQU (R12)(R13*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -5594,8 +4923,7 @@ mulAvxTwo_5x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 4 to 5 outputs - VMOVDQU (DX), Y8 - ADDQ $0x20, DX + VMOVDQU (R8)(R13*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -5631,18 +4959,14 @@ mulAvxTwo_5x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - VMOVDQU Y0, (R9) - ADDQ $0x20, R9 - VMOVDQU Y1, (R10) - ADDQ $0x20, R10 - VMOVDQU Y2, (R11) - ADDQ $0x20, R11 - VMOVDQU Y3, (R12) - ADDQ $0x20, R12 - VMOVDQU Y4, (R8) - ADDQ $0x20, R8 + VMOVDQU Y0, (BX)(R13*1) + VMOVDQU Y1, (BP)(R13*1) + VMOVDQU Y2, (SI)(R13*1) + VMOVDQU Y3, (DI)(R13*1) + VMOVDQU Y4, (DX)(R13*1) // Prepare for next loop + ADDQ $0x20, R13 DECQ AX JNZ mulAvxTwo_5x5_loop VZEROUPPER @@ -5654,45 +4978,29 @@ mulAvxTwo_5x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_5x6(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 71 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_5x6_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), DX - MOVQ out_base+48(FP), R8 - MOVQ (R8), R9 - MOVQ 24(R8), R10 - MOVQ 48(R8), R11 - MOVQ 72(R8), R12 - MOVQ 96(R8), R13 - MOVQ 120(R8), R8 - MOVQ start+72(FP), R14 - - // Add start offset to output - ADDQ R14, R9 - ADDQ R14, R10 - ADDQ R14, R11 - ADDQ R14, R12 - ADDQ R14, R13 - ADDQ R14, R8 - - // Add start offset to input - ADDQ R14, BX - ADDQ R14, BP - ADDQ R14, SI - ADDQ R14, DI - ADDQ R14, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_5x6_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), DX + MOVQ in_base+24(FP), R9 + MOVQ (R9), R10 + MOVQ 24(R9), R11 + MOVQ 48(R9), R12 + MOVQ 72(R9), R13 + MOVQ 96(R9), R9 MOVQ $0x0000000f, R14 MOVQ R14, X6 VPBROADCASTB X6, Y6 + MOVQ start+72(FP), R14 mulAvxTwo_5x6_loop: // Clear 6 outputs @@ -5704,8 +5012,7 @@ mulAvxTwo_5x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (BX), Y9 - ADDQ $0x20, BX + VMOVDQU (R10)(R14*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -5747,8 +5054,7 @@ mulAvxTwo_5x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (BP), Y9 - ADDQ $0x20, BP + VMOVDQU (R11)(R14*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -5790,8 +5096,7 @@ mulAvxTwo_5x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 2 to 6 outputs - VMOVDQU (SI), Y9 - ADDQ $0x20, SI + VMOVDQU (R12)(R14*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -5833,8 +5138,7 @@ mulAvxTwo_5x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 3 to 6 outputs - VMOVDQU (DI), Y9 - ADDQ $0x20, DI + VMOVDQU (R13)(R14*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -5876,8 +5180,7 @@ mulAvxTwo_5x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 4 to 6 outputs - VMOVDQU (DX), Y9 - ADDQ $0x20, DX + VMOVDQU (R9)(R14*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -5919,20 +5222,15 @@ mulAvxTwo_5x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - VMOVDQU Y0, (R9) - ADDQ $0x20, R9 - VMOVDQU Y1, (R10) - ADDQ $0x20, R10 - VMOVDQU Y2, (R11) - ADDQ $0x20, R11 - VMOVDQU Y3, (R12) - ADDQ $0x20, R12 - VMOVDQU Y4, (R13) - ADDQ $0x20, R13 - VMOVDQU Y5, (R8) - ADDQ $0x20, R8 + VMOVDQU Y0, (BX)(R14*1) + VMOVDQU Y1, (BP)(R14*1) + VMOVDQU Y2, (SI)(R14*1) + VMOVDQU Y3, (DI)(R14*1) + VMOVDQU Y4, (R8)(R14*1) + VMOVDQU Y5, (DX)(R14*1) // Prepare for next loop + ADDQ $0x20, R14 DECQ AX JNZ mulAvxTwo_5x6_loop VZEROUPPER @@ -5944,47 +5242,30 @@ mulAvxTwo_5x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_5x7(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 82 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_5x7_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), DX - MOVQ out_base+48(FP), R8 - MOVQ (R8), R9 - MOVQ 24(R8), R10 - MOVQ 48(R8), R11 - MOVQ 72(R8), R12 - MOVQ 96(R8), R13 - MOVQ 120(R8), R14 - MOVQ 144(R8), R8 - MOVQ start+72(FP), R15 - - // Add start offset to output - ADDQ R15, R9 - ADDQ R15, R10 - ADDQ R15, R11 - ADDQ R15, R12 - ADDQ R15, R13 - ADDQ R15, R14 - ADDQ R15, R8 - - // Add start offset to input - ADDQ R15, BX - ADDQ R15, BP - ADDQ R15, SI - ADDQ R15, DI - ADDQ R15, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_5x7_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), R9 + MOVQ 144(DX), DX + MOVQ in_base+24(FP), R10 + MOVQ (R10), R11 + MOVQ 24(R10), R12 + MOVQ 48(R10), R13 + MOVQ 72(R10), R14 + MOVQ 96(R10), R10 MOVQ $0x0000000f, R15 MOVQ R15, X7 VPBROADCASTB X7, Y7 + MOVQ start+72(FP), R15 mulAvxTwo_5x7_loop: // Clear 7 outputs @@ -5997,8 +5278,7 @@ mulAvxTwo_5x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (BX), Y10 - ADDQ $0x20, BX + VMOVDQU (R11)(R15*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -6046,8 +5326,7 @@ mulAvxTwo_5x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (BP), Y10 - ADDQ $0x20, BP + VMOVDQU (R12)(R15*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -6095,8 +5374,7 @@ mulAvxTwo_5x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 2 to 7 outputs - VMOVDQU (SI), Y10 - ADDQ $0x20, SI + VMOVDQU (R13)(R15*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -6144,8 +5422,7 @@ mulAvxTwo_5x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 3 to 7 outputs - VMOVDQU (DI), Y10 - ADDQ $0x20, DI + VMOVDQU (R14)(R15*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -6193,8 +5470,7 @@ mulAvxTwo_5x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 4 to 7 outputs - VMOVDQU (DX), Y10 - ADDQ $0x20, DX + VMOVDQU (R10)(R15*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -6242,22 +5518,16 @@ mulAvxTwo_5x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - VMOVDQU Y0, (R9) - ADDQ $0x20, R9 - VMOVDQU Y1, (R10) - ADDQ $0x20, R10 - VMOVDQU Y2, (R11) - ADDQ $0x20, R11 - VMOVDQU Y3, (R12) - ADDQ $0x20, R12 - VMOVDQU Y4, (R13) - ADDQ $0x20, R13 - VMOVDQU Y5, (R14) - ADDQ $0x20, R14 - VMOVDQU Y6, (R8) - ADDQ $0x20, R8 + VMOVDQU Y0, (BX)(R15*1) + VMOVDQU Y1, (BP)(R15*1) + VMOVDQU Y2, (SI)(R15*1) + VMOVDQU Y3, (DI)(R15*1) + VMOVDQU Y4, (R8)(R15*1) + VMOVDQU Y5, (R9)(R15*1) + VMOVDQU Y6, (DX)(R15*1) // Prepare for next loop + ADDQ $0x20, R15 DECQ AX JNZ mulAvxTwo_5x7_loop VZEROUPPER @@ -6269,51 +5539,23 @@ mulAvxTwo_5x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_5x8(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 93 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_5x8_end - MOVQ in_base+24(FP), AX - MOVQ (AX), DX - MOVQ 24(AX), BX - MOVQ 48(AX), BP - MOVQ 72(AX), SI - MOVQ 96(AX), AX - MOVQ out_base+48(FP), DI - MOVQ (DI), R8 - MOVQ 24(DI), R9 - MOVQ 48(DI), R10 - MOVQ 72(DI), R11 - MOVQ 96(DI), R12 - MOVQ 120(DI), R13 - MOVQ 144(DI), R14 - MOVQ 168(DI), DI - MOVQ start+72(FP), R15 - - // Add start offset to output - ADDQ R15, R8 - ADDQ R15, R9 - ADDQ R15, R10 - ADDQ R15, R11 - ADDQ R15, R12 - ADDQ R15, R13 - ADDQ R15, R14 - ADDQ R15, DI - - // Add start offset to input - ADDQ R15, DX - ADDQ R15, BX - ADDQ R15, BP - ADDQ R15, SI - ADDQ R15, AX - MOVQ $0x0000000f, R15 - MOVQ R15, X8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_5x8_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), BX + MOVQ $0x0000000f, R9 + MOVQ R9, X8 VPBROADCASTB X8, Y8 - MOVQ n+80(FP), R15 - SHRQ $0x05, R15 + MOVQ start+72(FP), R9 mulAvxTwo_5x8_loop: // Clear 8 outputs @@ -6327,8 +5569,7 @@ mulAvxTwo_5x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (DX), Y11 - ADDQ $0x20, DX + VMOVDQU (BP)(R9*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -6382,8 +5623,7 @@ mulAvxTwo_5x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (BX), Y11 - ADDQ $0x20, BX + VMOVDQU (SI)(R9*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -6437,8 +5677,7 @@ mulAvxTwo_5x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 2 to 8 outputs - VMOVDQU (BP), Y11 - ADDQ $0x20, BP + VMOVDQU (DI)(R9*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -6492,8 +5731,7 @@ mulAvxTwo_5x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 3 to 8 outputs - VMOVDQU (SI), Y11 - ADDQ $0x20, SI + VMOVDQU (R8)(R9*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -6547,8 +5785,7 @@ mulAvxTwo_5x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 4 to 8 outputs - VMOVDQU (AX), Y11 - ADDQ $0x20, AX + VMOVDQU (BX)(R9*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -6602,25 +5839,26 @@ mulAvxTwo_5x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - VMOVDQU Y0, (R8) - ADDQ $0x20, R8 - VMOVDQU Y1, (R9) - ADDQ $0x20, R9 - VMOVDQU Y2, (R10) - ADDQ $0x20, R10 - VMOVDQU Y3, (R11) - ADDQ $0x20, R11 - VMOVDQU Y4, (R12) - ADDQ $0x20, R12 - VMOVDQU Y5, (R13) - ADDQ $0x20, R13 - VMOVDQU Y6, (R14) - ADDQ $0x20, R14 - VMOVDQU Y7, (DI) - ADDQ $0x20, DI + MOVQ (DX), R10 + VMOVDQU Y0, (R10)(R9*1) + MOVQ 24(DX), R10 + VMOVDQU Y1, (R10)(R9*1) + MOVQ 48(DX), R10 + VMOVDQU Y2, (R10)(R9*1) + MOVQ 72(DX), R10 + VMOVDQU Y3, (R10)(R9*1) + MOVQ 96(DX), R10 + VMOVDQU Y4, (R10)(R9*1) + MOVQ 120(DX), R10 + VMOVDQU Y5, (R10)(R9*1) + MOVQ 144(DX), R10 + VMOVDQU Y6, (R10)(R9*1) + MOVQ 168(DX), R10 + VMOVDQU Y7, (R10)(R9*1) // Prepare for next loop - DECQ R15 + ADDQ $0x20, R9 + DECQ AX JNZ mulAvxTwo_5x8_loop VZEROUPPER @@ -6631,125 +5869,107 @@ mulAvxTwo_5x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_6x1(SB), $0-88 // Loading all tables to registers - // Destination kept in GP registers // Full registers estimated 16 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_6x1_end - VMOVDQU (CX), Y0 - VMOVDQU 32(CX), Y1 - VMOVDQU 64(CX), Y2 - VMOVDQU 96(CX), Y3 - VMOVDQU 128(CX), Y4 - VMOVDQU 160(CX), Y5 - VMOVDQU 192(CX), Y6 - VMOVDQU 224(CX), Y7 - VMOVDQU 256(CX), Y8 - VMOVDQU 288(CX), Y9 - VMOVDQU 320(CX), Y10 - VMOVDQU 352(CX), Y11 - MOVQ in_base+24(FP), CX - MOVQ (CX), DX - MOVQ 24(CX), BX - MOVQ 48(CX), BP - MOVQ 72(CX), SI - MOVQ 96(CX), DI - MOVQ 120(CX), CX - MOVQ out_base+48(FP), R8 - MOVQ (R8), R8 - MOVQ start+72(FP), R9 - - // Add start offset to output - ADDQ R9, R8 - - // Add start offset to input - ADDQ R9, DX - ADDQ R9, BX - ADDQ R9, BP - ADDQ R9, SI - ADDQ R9, DI - ADDQ R9, CX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_6x1_end + MOVQ out_base+48(FP), DX + MOVQ (DX), DX + VMOVDQU (CX), Y1 + VMOVDQU 32(CX), Y2 + VMOVDQU 64(CX), Y3 + VMOVDQU 96(CX), Y4 + VMOVDQU 128(CX), Y5 + VMOVDQU 160(CX), Y6 + VMOVDQU 192(CX), Y7 + VMOVDQU 224(CX), Y8 + VMOVDQU 256(CX), Y9 + VMOVDQU 288(CX), Y10 + VMOVDQU 320(CX), Y11 + VMOVDQU 352(CX), Y12 + MOVQ in_base+24(FP), CX + MOVQ (CX), BX + MOVQ 24(CX), BP + MOVQ 48(CX), SI + MOVQ 72(CX), DI + MOVQ 96(CX), R8 + MOVQ 120(CX), CX MOVQ $0x0000000f, R9 MOVQ R9, X13 VPBROADCASTB X13, Y13 + MOVQ start+72(FP), R9 mulAvxTwo_6x1_loop: // Clear 1 outputs - VPXOR Y12, Y12, Y12 + VPXOR Y0, Y0, Y0 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (DX), Y14 - ADDQ $0x20, DX + VMOVDQU (BX)(R9*1), Y14 VPSRLQ $0x04, Y14, Y15 VPAND Y13, Y14, Y14 VPAND Y13, Y15, Y15 - VPSHUFB Y14, Y0, Y14 - VPSHUFB Y15, Y1, Y15 + VPSHUFB Y14, Y1, Y14 + VPSHUFB Y15, Y2, Y15 VPXOR Y14, Y15, Y14 - VPXOR Y14, Y12, Y12 + VPXOR Y14, Y0, Y0 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (BX), Y14 - ADDQ $0x20, BX + VMOVDQU (BP)(R9*1), Y14 VPSRLQ $0x04, Y14, Y15 VPAND Y13, Y14, Y14 VPAND Y13, Y15, Y15 - VPSHUFB Y14, Y2, Y14 - VPSHUFB Y15, Y3, Y15 + VPSHUFB Y14, Y3, Y14 + VPSHUFB Y15, Y4, Y15 VPXOR Y14, Y15, Y14 - VPXOR Y14, Y12, Y12 + VPXOR Y14, Y0, Y0 // Load and process 32 bytes from input 2 to 1 outputs - VMOVDQU (BP), Y14 - ADDQ $0x20, BP + VMOVDQU (SI)(R9*1), Y14 VPSRLQ $0x04, Y14, Y15 VPAND Y13, Y14, Y14 VPAND Y13, Y15, Y15 - VPSHUFB Y14, Y4, Y14 - VPSHUFB Y15, Y5, Y15 + VPSHUFB Y14, Y5, Y14 + VPSHUFB Y15, Y6, Y15 VPXOR Y14, Y15, Y14 - VPXOR Y14, Y12, Y12 + VPXOR Y14, Y0, Y0 // Load and process 32 bytes from input 3 to 1 outputs - VMOVDQU (SI), Y14 - ADDQ $0x20, SI + VMOVDQU (DI)(R9*1), Y14 VPSRLQ $0x04, Y14, Y15 VPAND Y13, Y14, Y14 VPAND Y13, Y15, Y15 - VPSHUFB Y14, Y6, Y14 - VPSHUFB Y15, Y7, Y15 + VPSHUFB Y14, Y7, Y14 + VPSHUFB Y15, Y8, Y15 VPXOR Y14, Y15, Y14 - VPXOR Y14, Y12, Y12 + VPXOR Y14, Y0, Y0 // Load and process 32 bytes from input 4 to 1 outputs - VMOVDQU (DI), Y14 - ADDQ $0x20, DI + VMOVDQU (R8)(R9*1), Y14 VPSRLQ $0x04, Y14, Y15 VPAND Y13, Y14, Y14 VPAND Y13, Y15, Y15 - VPSHUFB Y14, Y8, Y14 - VPSHUFB Y15, Y9, Y15 + VPSHUFB Y14, Y9, Y14 + VPSHUFB Y15, Y10, Y15 VPXOR Y14, Y15, Y14 - VPXOR Y14, Y12, Y12 + VPXOR Y14, Y0, Y0 // Load and process 32 bytes from input 5 to 1 outputs - VMOVDQU (CX), Y14 - ADDQ $0x20, CX + VMOVDQU (CX)(R9*1), Y14 VPSRLQ $0x04, Y14, Y15 VPAND Y13, Y14, Y14 VPAND Y13, Y15, Y15 - VPSHUFB Y14, Y10, Y14 - VPSHUFB Y15, Y11, Y15 + VPSHUFB Y14, Y11, Y14 + VPSHUFB Y15, Y12, Y15 VPXOR Y14, Y15, Y14 - VPXOR Y14, Y12, Y12 + VPXOR Y14, Y0, Y0 // Store 1 outputs - VMOVDQU Y12, (R8) - ADDQ $0x20, R8 + VMOVDQU Y0, (DX)(R9*1) // Prepare for next loop + ADDQ $0x20, R9 DECQ AX JNZ mulAvxTwo_6x1_loop VZEROUPPER @@ -6761,39 +5981,26 @@ mulAvxTwo_6x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_6x2(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 31 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_6x2_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), DX - MOVQ out_base+48(FP), R9 - MOVQ (R9), R10 - MOVQ 24(R9), R9 - MOVQ start+72(FP), R11 - - // Add start offset to output - ADDQ R11, R10 - ADDQ R11, R9 - - // Add start offset to input - ADDQ R11, BX - ADDQ R11, BP - ADDQ R11, SI - ADDQ R11, DI - ADDQ R11, R8 - ADDQ R11, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_6x2_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), DX + MOVQ in_base+24(FP), BP + MOVQ (BP), SI + MOVQ 24(BP), DI + MOVQ 48(BP), R8 + MOVQ 72(BP), R9 + MOVQ 96(BP), R10 + MOVQ 120(BP), BP MOVQ $0x0000000f, R11 MOVQ R11, X2 VPBROADCASTB X2, Y2 + MOVQ start+72(FP), R11 mulAvxTwo_6x2_loop: // Clear 2 outputs @@ -6801,8 +6008,7 @@ mulAvxTwo_6x2_loop: VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (BX), Y5 - ADDQ $0x20, BX + VMOVDQU (SI)(R11*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -6820,8 +6026,7 @@ mulAvxTwo_6x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (BP), Y5 - ADDQ $0x20, BP + VMOVDQU (DI)(R11*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -6839,8 +6044,7 @@ mulAvxTwo_6x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 2 to 2 outputs - VMOVDQU (SI), Y5 - ADDQ $0x20, SI + VMOVDQU (R8)(R11*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -6858,8 +6062,7 @@ mulAvxTwo_6x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 3 to 2 outputs - VMOVDQU (DI), Y5 - ADDQ $0x20, DI + VMOVDQU (R9)(R11*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -6877,8 +6080,7 @@ mulAvxTwo_6x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 4 to 2 outputs - VMOVDQU (R8), Y5 - ADDQ $0x20, R8 + VMOVDQU (R10)(R11*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -6896,8 +6098,7 @@ mulAvxTwo_6x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 5 to 2 outputs - VMOVDQU (DX), Y5 - ADDQ $0x20, DX + VMOVDQU (BP)(R11*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -6915,12 +6116,11 @@ mulAvxTwo_6x2_loop: VPXOR Y3, Y1, Y1 // Store 2 outputs - VMOVDQU Y0, (R10) - ADDQ $0x20, R10 - VMOVDQU Y1, (R9) - ADDQ $0x20, R9 + VMOVDQU Y0, (BX)(R11*1) + VMOVDQU Y1, (DX)(R11*1) // Prepare for next loop + ADDQ $0x20, R11 DECQ AX JNZ mulAvxTwo_6x2_loop VZEROUPPER @@ -6932,41 +6132,27 @@ mulAvxTwo_6x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_6x3(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 44 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_6x3_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), DX - MOVQ out_base+48(FP), R9 - MOVQ (R9), R10 - MOVQ 24(R9), R11 - MOVQ 48(R9), R9 - MOVQ start+72(FP), R12 - - // Add start offset to output - ADDQ R12, R10 - ADDQ R12, R11 - ADDQ R12, R9 - - // Add start offset to input - ADDQ R12, BX - ADDQ R12, BP - ADDQ R12, SI - ADDQ R12, DI - ADDQ R12, R8 - ADDQ R12, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_6x3_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), DX + MOVQ in_base+24(FP), SI + MOVQ (SI), DI + MOVQ 24(SI), R8 + MOVQ 48(SI), R9 + MOVQ 72(SI), R10 + MOVQ 96(SI), R11 + MOVQ 120(SI), SI MOVQ $0x0000000f, R12 MOVQ R12, X3 VPBROADCASTB X3, Y3 + MOVQ start+72(FP), R12 mulAvxTwo_6x3_loop: // Clear 3 outputs @@ -6975,8 +6161,7 @@ mulAvxTwo_6x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (BX), Y6 - ADDQ $0x20, BX + VMOVDQU (DI)(R12*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -7000,8 +6185,7 @@ mulAvxTwo_6x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (BP), Y6 - ADDQ $0x20, BP + VMOVDQU (R8)(R12*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -7025,8 +6209,7 @@ mulAvxTwo_6x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 2 to 3 outputs - VMOVDQU (SI), Y6 - ADDQ $0x20, SI + VMOVDQU (R9)(R12*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -7050,8 +6233,7 @@ mulAvxTwo_6x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 3 to 3 outputs - VMOVDQU (DI), Y6 - ADDQ $0x20, DI + VMOVDQU (R10)(R12*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -7075,8 +6257,7 @@ mulAvxTwo_6x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 4 to 3 outputs - VMOVDQU (R8), Y6 - ADDQ $0x20, R8 + VMOVDQU (R11)(R12*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -7100,8 +6281,7 @@ mulAvxTwo_6x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 5 to 3 outputs - VMOVDQU (DX), Y6 - ADDQ $0x20, DX + VMOVDQU (SI)(R12*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -7125,14 +6305,12 @@ mulAvxTwo_6x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - VMOVDQU Y0, (R10) - ADDQ $0x20, R10 - VMOVDQU Y1, (R11) - ADDQ $0x20, R11 - VMOVDQU Y2, (R9) - ADDQ $0x20, R9 + VMOVDQU Y0, (BX)(R12*1) + VMOVDQU Y1, (BP)(R12*1) + VMOVDQU Y2, (DX)(R12*1) // Prepare for next loop + ADDQ $0x20, R12 DECQ AX JNZ mulAvxTwo_6x3_loop VZEROUPPER @@ -7144,43 +6322,28 @@ mulAvxTwo_6x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_6x4(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 57 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_6x4_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), DX - MOVQ out_base+48(FP), R9 - MOVQ (R9), R10 - MOVQ 24(R9), R11 - MOVQ 48(R9), R12 - MOVQ 72(R9), R9 - MOVQ start+72(FP), R13 - - // Add start offset to output - ADDQ R13, R10 - ADDQ R13, R11 - ADDQ R13, R12 - ADDQ R13, R9 - - // Add start offset to input - ADDQ R13, BX - ADDQ R13, BP - ADDQ R13, SI - ADDQ R13, DI - ADDQ R13, R8 - ADDQ R13, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_6x4_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DX + MOVQ in_base+24(FP), DI + MOVQ (DI), R8 + MOVQ 24(DI), R9 + MOVQ 48(DI), R10 + MOVQ 72(DI), R11 + MOVQ 96(DI), R12 + MOVQ 120(DI), DI MOVQ $0x0000000f, R13 MOVQ R13, X4 VPBROADCASTB X4, Y4 + MOVQ start+72(FP), R13 mulAvxTwo_6x4_loop: // Clear 4 outputs @@ -7190,8 +6353,7 @@ mulAvxTwo_6x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (BX), Y7 - ADDQ $0x20, BX + VMOVDQU (R8)(R13*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -7221,8 +6383,7 @@ mulAvxTwo_6x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (BP), Y7 - ADDQ $0x20, BP + VMOVDQU (R9)(R13*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -7252,8 +6413,7 @@ mulAvxTwo_6x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 2 to 4 outputs - VMOVDQU (SI), Y7 - ADDQ $0x20, SI + VMOVDQU (R10)(R13*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -7283,8 +6443,7 @@ mulAvxTwo_6x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 3 to 4 outputs - VMOVDQU (DI), Y7 - ADDQ $0x20, DI + VMOVDQU (R11)(R13*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -7314,8 +6473,7 @@ mulAvxTwo_6x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 4 to 4 outputs - VMOVDQU (R8), Y7 - ADDQ $0x20, R8 + VMOVDQU (R12)(R13*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -7345,8 +6503,7 @@ mulAvxTwo_6x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 5 to 4 outputs - VMOVDQU (DX), Y7 - ADDQ $0x20, DX + VMOVDQU (DI)(R13*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -7376,16 +6533,13 @@ mulAvxTwo_6x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - VMOVDQU Y0, (R10) - ADDQ $0x20, R10 - VMOVDQU Y1, (R11) - ADDQ $0x20, R11 - VMOVDQU Y2, (R12) - ADDQ $0x20, R12 - VMOVDQU Y3, (R9) - ADDQ $0x20, R9 + VMOVDQU Y0, (BX)(R13*1) + VMOVDQU Y1, (BP)(R13*1) + VMOVDQU Y2, (SI)(R13*1) + VMOVDQU Y3, (DX)(R13*1) // Prepare for next loop + ADDQ $0x20, R13 DECQ AX JNZ mulAvxTwo_6x4_loop VZEROUPPER @@ -7397,45 +6551,29 @@ mulAvxTwo_6x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_6x5(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 70 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_6x5_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), DX - MOVQ out_base+48(FP), R9 - MOVQ (R9), R10 - MOVQ 24(R9), R11 - MOVQ 48(R9), R12 - MOVQ 72(R9), R13 - MOVQ 96(R9), R9 - MOVQ start+72(FP), R14 - - // Add start offset to output - ADDQ R14, R10 - ADDQ R14, R11 - ADDQ R14, R12 - ADDQ R14, R13 - ADDQ R14, R9 - - // Add start offset to input - ADDQ R14, BX - ADDQ R14, BP - ADDQ R14, SI - ADDQ R14, DI - ADDQ R14, R8 - ADDQ R14, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_6x5_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), DX + MOVQ in_base+24(FP), R8 + MOVQ (R8), R9 + MOVQ 24(R8), R10 + MOVQ 48(R8), R11 + MOVQ 72(R8), R12 + MOVQ 96(R8), R13 + MOVQ 120(R8), R8 MOVQ $0x0000000f, R14 MOVQ R14, X5 VPBROADCASTB X5, Y5 + MOVQ start+72(FP), R14 mulAvxTwo_6x5_loop: // Clear 5 outputs @@ -7446,8 +6584,7 @@ mulAvxTwo_6x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (BX), Y8 - ADDQ $0x20, BX + VMOVDQU (R9)(R14*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -7483,8 +6620,7 @@ mulAvxTwo_6x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (BP), Y8 - ADDQ $0x20, BP + VMOVDQU (R10)(R14*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -7520,8 +6656,7 @@ mulAvxTwo_6x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 2 to 5 outputs - VMOVDQU (SI), Y8 - ADDQ $0x20, SI + VMOVDQU (R11)(R14*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -7557,8 +6692,7 @@ mulAvxTwo_6x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 3 to 5 outputs - VMOVDQU (DI), Y8 - ADDQ $0x20, DI + VMOVDQU (R12)(R14*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -7594,8 +6728,7 @@ mulAvxTwo_6x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 4 to 5 outputs - VMOVDQU (R8), Y8 - ADDQ $0x20, R8 + VMOVDQU (R13)(R14*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -7631,8 +6764,7 @@ mulAvxTwo_6x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 5 to 5 outputs - VMOVDQU (DX), Y8 - ADDQ $0x20, DX + VMOVDQU (R8)(R14*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -7668,18 +6800,14 @@ mulAvxTwo_6x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - VMOVDQU Y0, (R10) - ADDQ $0x20, R10 - VMOVDQU Y1, (R11) - ADDQ $0x20, R11 - VMOVDQU Y2, (R12) - ADDQ $0x20, R12 - VMOVDQU Y3, (R13) - ADDQ $0x20, R13 - VMOVDQU Y4, (R9) - ADDQ $0x20, R9 + VMOVDQU Y0, (BX)(R14*1) + VMOVDQU Y1, (BP)(R14*1) + VMOVDQU Y2, (SI)(R14*1) + VMOVDQU Y3, (DI)(R14*1) + VMOVDQU Y4, (DX)(R14*1) // Prepare for next loop + ADDQ $0x20, R14 DECQ AX JNZ mulAvxTwo_6x5_loop VZEROUPPER @@ -7691,47 +6819,30 @@ mulAvxTwo_6x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_6x6(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 83 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_6x6_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), DX - MOVQ out_base+48(FP), R9 - MOVQ (R9), R10 - MOVQ 24(R9), R11 - MOVQ 48(R9), R12 - MOVQ 72(R9), R13 - MOVQ 96(R9), R14 - MOVQ 120(R9), R9 - MOVQ start+72(FP), R15 - - // Add start offset to output - ADDQ R15, R10 - ADDQ R15, R11 - ADDQ R15, R12 - ADDQ R15, R13 - ADDQ R15, R14 - ADDQ R15, R9 - - // Add start offset to input - ADDQ R15, BX - ADDQ R15, BP - ADDQ R15, SI - ADDQ R15, DI - ADDQ R15, R8 - ADDQ R15, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_6x6_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), R8 + MOVQ 120(DX), DX + MOVQ in_base+24(FP), R9 + MOVQ (R9), R10 + MOVQ 24(R9), R11 + MOVQ 48(R9), R12 + MOVQ 72(R9), R13 + MOVQ 96(R9), R14 + MOVQ 120(R9), R9 MOVQ $0x0000000f, R15 MOVQ R15, X6 VPBROADCASTB X6, Y6 + MOVQ start+72(FP), R15 mulAvxTwo_6x6_loop: // Clear 6 outputs @@ -7743,8 +6854,7 @@ mulAvxTwo_6x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (BX), Y9 - ADDQ $0x20, BX + VMOVDQU (R10)(R15*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -7786,8 +6896,7 @@ mulAvxTwo_6x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (BP), Y9 - ADDQ $0x20, BP + VMOVDQU (R11)(R15*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -7829,8 +6938,7 @@ mulAvxTwo_6x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 2 to 6 outputs - VMOVDQU (SI), Y9 - ADDQ $0x20, SI + VMOVDQU (R12)(R15*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -7872,8 +6980,7 @@ mulAvxTwo_6x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 3 to 6 outputs - VMOVDQU (DI), Y9 - ADDQ $0x20, DI + VMOVDQU (R13)(R15*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -7915,8 +7022,7 @@ mulAvxTwo_6x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 4 to 6 outputs - VMOVDQU (R8), Y9 - ADDQ $0x20, R8 + VMOVDQU (R14)(R15*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -7958,8 +7064,7 @@ mulAvxTwo_6x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 5 to 6 outputs - VMOVDQU (DX), Y9 - ADDQ $0x20, DX + VMOVDQU (R9)(R15*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -8001,20 +7106,15 @@ mulAvxTwo_6x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - VMOVDQU Y0, (R10) - ADDQ $0x20, R10 - VMOVDQU Y1, (R11) - ADDQ $0x20, R11 - VMOVDQU Y2, (R12) - ADDQ $0x20, R12 - VMOVDQU Y3, (R13) - ADDQ $0x20, R13 - VMOVDQU Y4, (R14) - ADDQ $0x20, R14 - VMOVDQU Y5, (R9) - ADDQ $0x20, R9 + VMOVDQU Y0, (BX)(R15*1) + VMOVDQU Y1, (BP)(R15*1) + VMOVDQU Y2, (SI)(R15*1) + VMOVDQU Y3, (DI)(R15*1) + VMOVDQU Y4, (R8)(R15*1) + VMOVDQU Y5, (DX)(R15*1) // Prepare for next loop + ADDQ $0x20, R15 DECQ AX JNZ mulAvxTwo_6x6_loop VZEROUPPER @@ -8026,51 +7126,24 @@ mulAvxTwo_6x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_6x7(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 96 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_6x7_end - MOVQ in_base+24(FP), AX - MOVQ (AX), DX - MOVQ 24(AX), BX - MOVQ 48(AX), BP - MOVQ 72(AX), SI - MOVQ 96(AX), DI - MOVQ 120(AX), AX - MOVQ out_base+48(FP), R8 - MOVQ (R8), R9 - MOVQ 24(R8), R10 - MOVQ 48(R8), R11 - MOVQ 72(R8), R12 - MOVQ 96(R8), R13 - MOVQ 120(R8), R14 - MOVQ 144(R8), R8 - MOVQ start+72(FP), R15 - - // Add start offset to output - ADDQ R15, R9 - ADDQ R15, R10 - ADDQ R15, R11 - ADDQ R15, R12 - ADDQ R15, R13 - ADDQ R15, R14 - ADDQ R15, R8 - - // Add start offset to input - ADDQ R15, DX - ADDQ R15, BX - ADDQ R15, BP - ADDQ R15, SI - ADDQ R15, DI - ADDQ R15, AX - MOVQ $0x0000000f, R15 - MOVQ R15, X7 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_6x7_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), BX + MOVQ $0x0000000f, R10 + MOVQ R10, X7 VPBROADCASTB X7, Y7 - MOVQ n+80(FP), R15 - SHRQ $0x05, R15 + MOVQ start+72(FP), R10 mulAvxTwo_6x7_loop: // Clear 7 outputs @@ -8083,8 +7156,7 @@ mulAvxTwo_6x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (DX), Y10 - ADDQ $0x20, DX + VMOVDQU (BP)(R10*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -8132,8 +7204,7 @@ mulAvxTwo_6x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (BX), Y10 - ADDQ $0x20, BX + VMOVDQU (SI)(R10*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -8181,8 +7252,7 @@ mulAvxTwo_6x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 2 to 7 outputs - VMOVDQU (BP), Y10 - ADDQ $0x20, BP + VMOVDQU (DI)(R10*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -8230,8 +7300,7 @@ mulAvxTwo_6x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 3 to 7 outputs - VMOVDQU (SI), Y10 - ADDQ $0x20, SI + VMOVDQU (R8)(R10*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -8279,8 +7348,7 @@ mulAvxTwo_6x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 4 to 7 outputs - VMOVDQU (DI), Y10 - ADDQ $0x20, DI + VMOVDQU (R9)(R10*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -8328,8 +7396,7 @@ mulAvxTwo_6x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 5 to 7 outputs - VMOVDQU (AX), Y10 - ADDQ $0x20, AX + VMOVDQU (BX)(R10*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -8377,23 +7444,24 @@ mulAvxTwo_6x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - VMOVDQU Y0, (R9) - ADDQ $0x20, R9 - VMOVDQU Y1, (R10) - ADDQ $0x20, R10 - VMOVDQU Y2, (R11) - ADDQ $0x20, R11 - VMOVDQU Y3, (R12) - ADDQ $0x20, R12 - VMOVDQU Y4, (R13) - ADDQ $0x20, R13 - VMOVDQU Y5, (R14) - ADDQ $0x20, R14 - VMOVDQU Y6, (R8) - ADDQ $0x20, R8 + MOVQ (DX), R11 + VMOVDQU Y0, (R11)(R10*1) + MOVQ 24(DX), R11 + VMOVDQU Y1, (R11)(R10*1) + MOVQ 48(DX), R11 + VMOVDQU Y2, (R11)(R10*1) + MOVQ 72(DX), R11 + VMOVDQU Y3, (R11)(R10*1) + MOVQ 96(DX), R11 + VMOVDQU Y4, (R11)(R10*1) + MOVQ 120(DX), R11 + VMOVDQU Y5, (R11)(R10*1) + MOVQ 144(DX), R11 + VMOVDQU Y6, (R11)(R10*1) // Prepare for next loop - DECQ R15 + ADDQ $0x20, R10 + DECQ AX JNZ mulAvxTwo_6x7_loop VZEROUPPER @@ -8404,33 +7472,24 @@ mulAvxTwo_6x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_6x8(SB), $0-88 // Loading no tables to registers - // Destination kept on stack // Full registers estimated 109 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_6x8_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), DX - MOVQ out_base+48(FP), R9 - MOVQ start+72(FP), R10 - - // Add start offset to input - ADDQ R10, BX - ADDQ R10, BP - ADDQ R10, SI - ADDQ R10, DI - ADDQ R10, R8 - ADDQ R10, DX - MOVQ $0x0000000f, R11 - MOVQ R11, X8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_6x8_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), BX + MOVQ $0x0000000f, R10 + MOVQ R10, X8 VPBROADCASTB X8, Y8 + MOVQ start+72(FP), R10 mulAvxTwo_6x8_loop: // Clear 8 outputs @@ -8444,8 +7503,7 @@ mulAvxTwo_6x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (BX), Y11 - ADDQ $0x20, BX + VMOVDQU (BP)(R10*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -8499,8 +7557,7 @@ mulAvxTwo_6x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (BP), Y11 - ADDQ $0x20, BP + VMOVDQU (SI)(R10*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -8554,8 +7611,7 @@ mulAvxTwo_6x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 2 to 8 outputs - VMOVDQU (SI), Y11 - ADDQ $0x20, SI + VMOVDQU (DI)(R10*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -8609,8 +7665,7 @@ mulAvxTwo_6x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 3 to 8 outputs - VMOVDQU (DI), Y11 - ADDQ $0x20, DI + VMOVDQU (R8)(R10*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -8664,8 +7719,7 @@ mulAvxTwo_6x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 4 to 8 outputs - VMOVDQU (R8), Y11 - ADDQ $0x20, R8 + VMOVDQU (R9)(R10*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -8719,8 +7773,7 @@ mulAvxTwo_6x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 5 to 8 outputs - VMOVDQU (DX), Y11 - ADDQ $0x20, DX + VMOVDQU (BX)(R10*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -8774,21 +7827,21 @@ mulAvxTwo_6x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - MOVQ (R9), R11 + MOVQ (DX), R11 VMOVDQU Y0, (R11)(R10*1) - MOVQ 24(R9), R11 + MOVQ 24(DX), R11 VMOVDQU Y1, (R11)(R10*1) - MOVQ 48(R9), R11 + MOVQ 48(DX), R11 VMOVDQU Y2, (R11)(R10*1) - MOVQ 72(R9), R11 + MOVQ 72(DX), R11 VMOVDQU Y3, (R11)(R10*1) - MOVQ 96(R9), R11 + MOVQ 96(DX), R11 VMOVDQU Y4, (R11)(R10*1) - MOVQ 120(R9), R11 + MOVQ 120(DX), R11 VMOVDQU Y5, (R11)(R10*1) - MOVQ 144(R9), R11 + MOVQ 144(DX), R11 VMOVDQU Y6, (R11)(R10*1) - MOVQ 168(R9), R11 + MOVQ 168(DX), R11 VMOVDQU Y7, (R11)(R10*1) // Prepare for next loop @@ -8804,47 +7857,33 @@ mulAvxTwo_6x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_7x1(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 18 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_7x1_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), DX - MOVQ out_base+48(FP), R10 - MOVQ (R10), R10 - MOVQ start+72(FP), R11 - - // Add start offset to output - ADDQ R11, R10 - - // Add start offset to input - ADDQ R11, BX - ADDQ R11, BP - ADDQ R11, SI - ADDQ R11, DI - ADDQ R11, R8 - ADDQ R11, R9 - ADDQ R11, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_7x1_end + MOVQ out_base+48(FP), DX + MOVQ (DX), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), BX MOVQ $0x0000000f, R11 MOVQ R11, X1 VPBROADCASTB X1, Y1 + MOVQ start+72(FP), R11 mulAvxTwo_7x1_loop: // Clear 1 outputs VPXOR Y0, Y0, Y0 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (BX), Y4 - ADDQ $0x20, BX + VMOVDQU (BP)(R11*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -8856,8 +7895,7 @@ mulAvxTwo_7x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (BP), Y4 - ADDQ $0x20, BP + VMOVDQU (SI)(R11*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -8869,8 +7907,7 @@ mulAvxTwo_7x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 2 to 1 outputs - VMOVDQU (SI), Y4 - ADDQ $0x20, SI + VMOVDQU (DI)(R11*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -8882,8 +7919,7 @@ mulAvxTwo_7x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 3 to 1 outputs - VMOVDQU (DI), Y4 - ADDQ $0x20, DI + VMOVDQU (R8)(R11*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -8895,8 +7931,7 @@ mulAvxTwo_7x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 4 to 1 outputs - VMOVDQU (R8), Y4 - ADDQ $0x20, R8 + VMOVDQU (R9)(R11*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -8908,8 +7943,7 @@ mulAvxTwo_7x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 5 to 1 outputs - VMOVDQU (R9), Y4 - ADDQ $0x20, R9 + VMOVDQU (R10)(R11*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -8921,8 +7955,7 @@ mulAvxTwo_7x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 6 to 1 outputs - VMOVDQU (DX), Y4 - ADDQ $0x20, DX + VMOVDQU (BX)(R11*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -8934,10 +7967,10 @@ mulAvxTwo_7x1_loop: VPXOR Y2, Y0, Y0 // Store 1 outputs - VMOVDQU Y0, (R10) - ADDQ $0x20, R10 + VMOVDQU Y0, (DX)(R11*1) // Prepare for next loop + ADDQ $0x20, R11 DECQ AX JNZ mulAvxTwo_7x1_loop VZEROUPPER @@ -8949,41 +7982,27 @@ mulAvxTwo_7x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_7x2(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 35 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_7x2_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), DX - MOVQ out_base+48(FP), R10 - MOVQ (R10), R11 - MOVQ 24(R10), R10 - MOVQ start+72(FP), R12 - - // Add start offset to output - ADDQ R12, R11 - ADDQ R12, R10 - - // Add start offset to input - ADDQ R12, BX - ADDQ R12, BP - ADDQ R12, SI - ADDQ R12, DI - ADDQ R12, R8 - ADDQ R12, R9 - ADDQ R12, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_7x2_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), DX + MOVQ in_base+24(FP), BP + MOVQ (BP), SI + MOVQ 24(BP), DI + MOVQ 48(BP), R8 + MOVQ 72(BP), R9 + MOVQ 96(BP), R10 + MOVQ 120(BP), R11 + MOVQ 144(BP), BP MOVQ $0x0000000f, R12 MOVQ R12, X2 VPBROADCASTB X2, Y2 + MOVQ start+72(FP), R12 mulAvxTwo_7x2_loop: // Clear 2 outputs @@ -8991,8 +8010,7 @@ mulAvxTwo_7x2_loop: VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (BX), Y5 - ADDQ $0x20, BX + VMOVDQU (SI)(R12*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -9010,8 +8028,7 @@ mulAvxTwo_7x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (BP), Y5 - ADDQ $0x20, BP + VMOVDQU (DI)(R12*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -9029,8 +8046,7 @@ mulAvxTwo_7x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 2 to 2 outputs - VMOVDQU (SI), Y5 - ADDQ $0x20, SI + VMOVDQU (R8)(R12*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -9048,8 +8064,7 @@ mulAvxTwo_7x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 3 to 2 outputs - VMOVDQU (DI), Y5 - ADDQ $0x20, DI + VMOVDQU (R9)(R12*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -9067,8 +8082,7 @@ mulAvxTwo_7x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 4 to 2 outputs - VMOVDQU (R8), Y5 - ADDQ $0x20, R8 + VMOVDQU (R10)(R12*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -9086,8 +8100,7 @@ mulAvxTwo_7x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 5 to 2 outputs - VMOVDQU (R9), Y5 - ADDQ $0x20, R9 + VMOVDQU (R11)(R12*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -9105,8 +8118,7 @@ mulAvxTwo_7x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 6 to 2 outputs - VMOVDQU (DX), Y5 - ADDQ $0x20, DX + VMOVDQU (BP)(R12*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -9124,12 +8136,11 @@ mulAvxTwo_7x2_loop: VPXOR Y3, Y1, Y1 // Store 2 outputs - VMOVDQU Y0, (R11) - ADDQ $0x20, R11 - VMOVDQU Y1, (R10) - ADDQ $0x20, R10 + VMOVDQU Y0, (BX)(R12*1) + VMOVDQU Y1, (DX)(R12*1) // Prepare for next loop + ADDQ $0x20, R12 DECQ AX JNZ mulAvxTwo_7x2_loop VZEROUPPER @@ -9141,43 +8152,28 @@ mulAvxTwo_7x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_7x3(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 50 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_7x3_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), DX - MOVQ out_base+48(FP), R10 - MOVQ (R10), R11 - MOVQ 24(R10), R12 - MOVQ 48(R10), R10 - MOVQ start+72(FP), R13 - - // Add start offset to output - ADDQ R13, R11 - ADDQ R13, R12 - ADDQ R13, R10 - - // Add start offset to input - ADDQ R13, BX - ADDQ R13, BP - ADDQ R13, SI - ADDQ R13, DI - ADDQ R13, R8 - ADDQ R13, R9 - ADDQ R13, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_7x3_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), DX + MOVQ in_base+24(FP), SI + MOVQ (SI), DI + MOVQ 24(SI), R8 + MOVQ 48(SI), R9 + MOVQ 72(SI), R10 + MOVQ 96(SI), R11 + MOVQ 120(SI), R12 + MOVQ 144(SI), SI MOVQ $0x0000000f, R13 MOVQ R13, X3 VPBROADCASTB X3, Y3 + MOVQ start+72(FP), R13 mulAvxTwo_7x3_loop: // Clear 3 outputs @@ -9186,8 +8182,7 @@ mulAvxTwo_7x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (BX), Y6 - ADDQ $0x20, BX + VMOVDQU (DI)(R13*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -9211,8 +8206,7 @@ mulAvxTwo_7x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (BP), Y6 - ADDQ $0x20, BP + VMOVDQU (R8)(R13*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -9236,8 +8230,7 @@ mulAvxTwo_7x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 2 to 3 outputs - VMOVDQU (SI), Y6 - ADDQ $0x20, SI + VMOVDQU (R9)(R13*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -9261,8 +8254,7 @@ mulAvxTwo_7x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 3 to 3 outputs - VMOVDQU (DI), Y6 - ADDQ $0x20, DI + VMOVDQU (R10)(R13*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -9286,8 +8278,7 @@ mulAvxTwo_7x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 4 to 3 outputs - VMOVDQU (R8), Y6 - ADDQ $0x20, R8 + VMOVDQU (R11)(R13*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -9311,8 +8302,7 @@ mulAvxTwo_7x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 5 to 3 outputs - VMOVDQU (R9), Y6 - ADDQ $0x20, R9 + VMOVDQU (R12)(R13*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -9336,8 +8326,7 @@ mulAvxTwo_7x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 6 to 3 outputs - VMOVDQU (DX), Y6 - ADDQ $0x20, DX + VMOVDQU (SI)(R13*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -9361,14 +8350,12 @@ mulAvxTwo_7x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - VMOVDQU Y0, (R11) - ADDQ $0x20, R11 - VMOVDQU Y1, (R12) - ADDQ $0x20, R12 - VMOVDQU Y2, (R10) - ADDQ $0x20, R10 + VMOVDQU Y0, (BX)(R13*1) + VMOVDQU Y1, (BP)(R13*1) + VMOVDQU Y2, (DX)(R13*1) // Prepare for next loop + ADDQ $0x20, R13 DECQ AX JNZ mulAvxTwo_7x3_loop VZEROUPPER @@ -9380,45 +8367,29 @@ mulAvxTwo_7x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_7x4(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 65 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_7x4_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), DX - MOVQ out_base+48(FP), R10 - MOVQ (R10), R11 - MOVQ 24(R10), R12 - MOVQ 48(R10), R13 - MOVQ 72(R10), R10 - MOVQ start+72(FP), R14 - - // Add start offset to output - ADDQ R14, R11 - ADDQ R14, R12 - ADDQ R14, R13 - ADDQ R14, R10 - - // Add start offset to input - ADDQ R14, BX - ADDQ R14, BP - ADDQ R14, SI - ADDQ R14, DI - ADDQ R14, R8 - ADDQ R14, R9 - ADDQ R14, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_7x4_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DX + MOVQ in_base+24(FP), DI + MOVQ (DI), R8 + MOVQ 24(DI), R9 + MOVQ 48(DI), R10 + MOVQ 72(DI), R11 + MOVQ 96(DI), R12 + MOVQ 120(DI), R13 + MOVQ 144(DI), DI MOVQ $0x0000000f, R14 MOVQ R14, X4 VPBROADCASTB X4, Y4 + MOVQ start+72(FP), R14 mulAvxTwo_7x4_loop: // Clear 4 outputs @@ -9428,8 +8399,7 @@ mulAvxTwo_7x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (BX), Y7 - ADDQ $0x20, BX + VMOVDQU (R8)(R14*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -9459,8 +8429,7 @@ mulAvxTwo_7x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (BP), Y7 - ADDQ $0x20, BP + VMOVDQU (R9)(R14*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -9490,8 +8459,7 @@ mulAvxTwo_7x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 2 to 4 outputs - VMOVDQU (SI), Y7 - ADDQ $0x20, SI + VMOVDQU (R10)(R14*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -9521,8 +8489,7 @@ mulAvxTwo_7x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 3 to 4 outputs - VMOVDQU (DI), Y7 - ADDQ $0x20, DI + VMOVDQU (R11)(R14*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -9552,8 +8519,7 @@ mulAvxTwo_7x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 4 to 4 outputs - VMOVDQU (R8), Y7 - ADDQ $0x20, R8 + VMOVDQU (R12)(R14*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -9583,8 +8549,7 @@ mulAvxTwo_7x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 5 to 4 outputs - VMOVDQU (R9), Y7 - ADDQ $0x20, R9 + VMOVDQU (R13)(R14*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -9614,8 +8579,7 @@ mulAvxTwo_7x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 6 to 4 outputs - VMOVDQU (DX), Y7 - ADDQ $0x20, DX + VMOVDQU (DI)(R14*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -9645,16 +8609,13 @@ mulAvxTwo_7x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - VMOVDQU Y0, (R11) - ADDQ $0x20, R11 - VMOVDQU Y1, (R12) - ADDQ $0x20, R12 - VMOVDQU Y2, (R13) - ADDQ $0x20, R13 - VMOVDQU Y3, (R10) - ADDQ $0x20, R10 + VMOVDQU Y0, (BX)(R14*1) + VMOVDQU Y1, (BP)(R14*1) + VMOVDQU Y2, (SI)(R14*1) + VMOVDQU Y3, (DX)(R14*1) // Prepare for next loop + ADDQ $0x20, R14 DECQ AX JNZ mulAvxTwo_7x4_loop VZEROUPPER @@ -9666,47 +8627,30 @@ mulAvxTwo_7x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_7x5(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 80 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_7x5_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), DX - MOVQ out_base+48(FP), R10 - MOVQ (R10), R11 - MOVQ 24(R10), R12 - MOVQ 48(R10), R13 - MOVQ 72(R10), R14 - MOVQ 96(R10), R10 - MOVQ start+72(FP), R15 - - // Add start offset to output - ADDQ R15, R11 - ADDQ R15, R12 - ADDQ R15, R13 - ADDQ R15, R14 - ADDQ R15, R10 - - // Add start offset to input - ADDQ R15, BX - ADDQ R15, BP - ADDQ R15, SI - ADDQ R15, DI - ADDQ R15, R8 - ADDQ R15, R9 - ADDQ R15, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_7x5_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DI + MOVQ 96(DX), DX + MOVQ in_base+24(FP), R8 + MOVQ (R8), R9 + MOVQ 24(R8), R10 + MOVQ 48(R8), R11 + MOVQ 72(R8), R12 + MOVQ 96(R8), R13 + MOVQ 120(R8), R14 + MOVQ 144(R8), R8 MOVQ $0x0000000f, R15 MOVQ R15, X5 VPBROADCASTB X5, Y5 + MOVQ start+72(FP), R15 mulAvxTwo_7x5_loop: // Clear 5 outputs @@ -9717,8 +8661,7 @@ mulAvxTwo_7x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (BX), Y8 - ADDQ $0x20, BX + VMOVDQU (R9)(R15*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -9754,8 +8697,7 @@ mulAvxTwo_7x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (BP), Y8 - ADDQ $0x20, BP + VMOVDQU (R10)(R15*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -9791,8 +8733,7 @@ mulAvxTwo_7x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 2 to 5 outputs - VMOVDQU (SI), Y8 - ADDQ $0x20, SI + VMOVDQU (R11)(R15*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -9828,8 +8769,7 @@ mulAvxTwo_7x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 3 to 5 outputs - VMOVDQU (DI), Y8 - ADDQ $0x20, DI + VMOVDQU (R12)(R15*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -9865,8 +8805,7 @@ mulAvxTwo_7x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 4 to 5 outputs - VMOVDQU (R8), Y8 - ADDQ $0x20, R8 + VMOVDQU (R13)(R15*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -9902,8 +8841,7 @@ mulAvxTwo_7x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 5 to 5 outputs - VMOVDQU (R9), Y8 - ADDQ $0x20, R9 + VMOVDQU (R14)(R15*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -9939,8 +8877,7 @@ mulAvxTwo_7x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 6 to 5 outputs - VMOVDQU (DX), Y8 - ADDQ $0x20, DX + VMOVDQU (R8)(R15*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -9976,18 +8913,14 @@ mulAvxTwo_7x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - VMOVDQU Y0, (R11) - ADDQ $0x20, R11 - VMOVDQU Y1, (R12) - ADDQ $0x20, R12 - VMOVDQU Y2, (R13) - ADDQ $0x20, R13 - VMOVDQU Y3, (R14) - ADDQ $0x20, R14 - VMOVDQU Y4, (R10) - ADDQ $0x20, R10 + VMOVDQU Y0, (BX)(R15*1) + VMOVDQU Y1, (BP)(R15*1) + VMOVDQU Y2, (SI)(R15*1) + VMOVDQU Y3, (DI)(R15*1) + VMOVDQU Y4, (DX)(R15*1) // Prepare for next loop + ADDQ $0x20, R15 DECQ AX JNZ mulAvxTwo_7x5_loop VZEROUPPER @@ -9999,51 +8932,25 @@ mulAvxTwo_7x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_7x6(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 95 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_7x6_end - MOVQ in_base+24(FP), AX - MOVQ (AX), DX - MOVQ 24(AX), BX - MOVQ 48(AX), BP - MOVQ 72(AX), SI - MOVQ 96(AX), DI - MOVQ 120(AX), R8 - MOVQ 144(AX), AX - MOVQ out_base+48(FP), R9 - MOVQ (R9), R10 - MOVQ 24(R9), R11 - MOVQ 48(R9), R12 - MOVQ 72(R9), R13 - MOVQ 96(R9), R14 - MOVQ 120(R9), R9 - MOVQ start+72(FP), R15 - - // Add start offset to output - ADDQ R15, R10 - ADDQ R15, R11 - ADDQ R15, R12 - ADDQ R15, R13 - ADDQ R15, R14 - ADDQ R15, R9 - - // Add start offset to input - ADDQ R15, DX - ADDQ R15, BX - ADDQ R15, BP - ADDQ R15, SI - ADDQ R15, DI - ADDQ R15, R8 - ADDQ R15, AX - MOVQ $0x0000000f, R15 - MOVQ R15, X6 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_7x6_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), BX + MOVQ $0x0000000f, R11 + MOVQ R11, X6 VPBROADCASTB X6, Y6 - MOVQ n+80(FP), R15 - SHRQ $0x05, R15 + MOVQ start+72(FP), R11 mulAvxTwo_7x6_loop: // Clear 6 outputs @@ -10055,8 +8962,7 @@ mulAvxTwo_7x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (DX), Y9 - ADDQ $0x20, DX + VMOVDQU (BP)(R11*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -10098,8 +9004,7 @@ mulAvxTwo_7x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (BX), Y9 - ADDQ $0x20, BX + VMOVDQU (SI)(R11*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -10141,8 +9046,7 @@ mulAvxTwo_7x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 2 to 6 outputs - VMOVDQU (BP), Y9 - ADDQ $0x20, BP + VMOVDQU (DI)(R11*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -10184,8 +9088,7 @@ mulAvxTwo_7x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 3 to 6 outputs - VMOVDQU (SI), Y9 - ADDQ $0x20, SI + VMOVDQU (R8)(R11*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -10227,8 +9130,7 @@ mulAvxTwo_7x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 4 to 6 outputs - VMOVDQU (DI), Y9 - ADDQ $0x20, DI + VMOVDQU (R9)(R11*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -10270,8 +9172,7 @@ mulAvxTwo_7x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 5 to 6 outputs - VMOVDQU (R8), Y9 - ADDQ $0x20, R8 + VMOVDQU (R10)(R11*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -10313,8 +9214,7 @@ mulAvxTwo_7x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 6 to 6 outputs - VMOVDQU (AX), Y9 - ADDQ $0x20, AX + VMOVDQU (BX)(R11*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -10356,21 +9256,22 @@ mulAvxTwo_7x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - VMOVDQU Y0, (R10) - ADDQ $0x20, R10 - VMOVDQU Y1, (R11) - ADDQ $0x20, R11 - VMOVDQU Y2, (R12) - ADDQ $0x20, R12 - VMOVDQU Y3, (R13) - ADDQ $0x20, R13 - VMOVDQU Y4, (R14) - ADDQ $0x20, R14 - VMOVDQU Y5, (R9) - ADDQ $0x20, R9 + MOVQ (DX), R12 + VMOVDQU Y0, (R12)(R11*1) + MOVQ 24(DX), R12 + VMOVDQU Y1, (R12)(R11*1) + MOVQ 48(DX), R12 + VMOVDQU Y2, (R12)(R11*1) + MOVQ 72(DX), R12 + VMOVDQU Y3, (R12)(R11*1) + MOVQ 96(DX), R12 + VMOVDQU Y4, (R12)(R11*1) + MOVQ 120(DX), R12 + VMOVDQU Y5, (R12)(R11*1) // Prepare for next loop - DECQ R15 + ADDQ $0x20, R11 + DECQ AX JNZ mulAvxTwo_7x6_loop VZEROUPPER @@ -10381,35 +9282,25 @@ mulAvxTwo_7x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_7x7(SB), $0-88 // Loading no tables to registers - // Destination kept on stack // Full registers estimated 110 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_7x7_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), DX - MOVQ out_base+48(FP), R10 - MOVQ start+72(FP), R11 - - // Add start offset to input - ADDQ R11, BX - ADDQ R11, BP - ADDQ R11, SI - ADDQ R11, DI - ADDQ R11, R8 - ADDQ R11, R9 - ADDQ R11, DX - MOVQ $0x0000000f, R12 - MOVQ R12, X7 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_7x7_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), BX + MOVQ $0x0000000f, R11 + MOVQ R11, X7 VPBROADCASTB X7, Y7 + MOVQ start+72(FP), R11 mulAvxTwo_7x7_loop: // Clear 7 outputs @@ -10422,8 +9313,7 @@ mulAvxTwo_7x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (BX), Y10 - ADDQ $0x20, BX + VMOVDQU (BP)(R11*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -10471,8 +9361,7 @@ mulAvxTwo_7x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (BP), Y10 - ADDQ $0x20, BP + VMOVDQU (SI)(R11*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -10520,8 +9409,7 @@ mulAvxTwo_7x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 2 to 7 outputs - VMOVDQU (SI), Y10 - ADDQ $0x20, SI + VMOVDQU (DI)(R11*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -10569,8 +9457,7 @@ mulAvxTwo_7x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 3 to 7 outputs - VMOVDQU (DI), Y10 - ADDQ $0x20, DI + VMOVDQU (R8)(R11*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -10618,8 +9505,7 @@ mulAvxTwo_7x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 4 to 7 outputs - VMOVDQU (R8), Y10 - ADDQ $0x20, R8 + VMOVDQU (R9)(R11*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -10667,8 +9553,7 @@ mulAvxTwo_7x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 5 to 7 outputs - VMOVDQU (R9), Y10 - ADDQ $0x20, R9 + VMOVDQU (R10)(R11*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -10716,8 +9601,7 @@ mulAvxTwo_7x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 6 to 7 outputs - VMOVDQU (DX), Y10 - ADDQ $0x20, DX + VMOVDQU (BX)(R11*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -10765,19 +9649,19 @@ mulAvxTwo_7x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - MOVQ (R10), R12 + MOVQ (DX), R12 VMOVDQU Y0, (R12)(R11*1) - MOVQ 24(R10), R12 + MOVQ 24(DX), R12 VMOVDQU Y1, (R12)(R11*1) - MOVQ 48(R10), R12 + MOVQ 48(DX), R12 VMOVDQU Y2, (R12)(R11*1) - MOVQ 72(R10), R12 + MOVQ 72(DX), R12 VMOVDQU Y3, (R12)(R11*1) - MOVQ 96(R10), R12 + MOVQ 96(DX), R12 VMOVDQU Y4, (R12)(R11*1) - MOVQ 120(R10), R12 + MOVQ 120(DX), R12 VMOVDQU Y5, (R12)(R11*1) - MOVQ 144(R10), R12 + MOVQ 144(DX), R12 VMOVDQU Y6, (R12)(R11*1) // Prepare for next loop @@ -10793,35 +9677,25 @@ mulAvxTwo_7x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_7x8(SB), $0-88 // Loading no tables to registers - // Destination kept on stack // Full registers estimated 125 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_7x8_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), DX - MOVQ out_base+48(FP), R10 - MOVQ start+72(FP), R11 - - // Add start offset to input - ADDQ R11, BX - ADDQ R11, BP - ADDQ R11, SI - ADDQ R11, DI - ADDQ R11, R8 - ADDQ R11, R9 - ADDQ R11, DX - MOVQ $0x0000000f, R12 - MOVQ R12, X8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_7x8_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), BX + MOVQ $0x0000000f, R11 + MOVQ R11, X8 VPBROADCASTB X8, Y8 + MOVQ start+72(FP), R11 mulAvxTwo_7x8_loop: // Clear 8 outputs @@ -10835,8 +9709,7 @@ mulAvxTwo_7x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (BX), Y11 - ADDQ $0x20, BX + VMOVDQU (BP)(R11*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -10890,8 +9763,7 @@ mulAvxTwo_7x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (BP), Y11 - ADDQ $0x20, BP + VMOVDQU (SI)(R11*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -10945,8 +9817,7 @@ mulAvxTwo_7x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 2 to 8 outputs - VMOVDQU (SI), Y11 - ADDQ $0x20, SI + VMOVDQU (DI)(R11*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -11000,8 +9871,7 @@ mulAvxTwo_7x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 3 to 8 outputs - VMOVDQU (DI), Y11 - ADDQ $0x20, DI + VMOVDQU (R8)(R11*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -11055,8 +9925,7 @@ mulAvxTwo_7x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 4 to 8 outputs - VMOVDQU (R8), Y11 - ADDQ $0x20, R8 + VMOVDQU (R9)(R11*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -11110,8 +9979,7 @@ mulAvxTwo_7x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 5 to 8 outputs - VMOVDQU (R9), Y11 - ADDQ $0x20, R9 + VMOVDQU (R10)(R11*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -11165,8 +10033,7 @@ mulAvxTwo_7x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 6 to 8 outputs - VMOVDQU (DX), Y11 - ADDQ $0x20, DX + VMOVDQU (BX)(R11*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -11220,21 +10087,21 @@ mulAvxTwo_7x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - MOVQ (R10), R12 + MOVQ (DX), R12 VMOVDQU Y0, (R12)(R11*1) - MOVQ 24(R10), R12 + MOVQ 24(DX), R12 VMOVDQU Y1, (R12)(R11*1) - MOVQ 48(R10), R12 + MOVQ 48(DX), R12 VMOVDQU Y2, (R12)(R11*1) - MOVQ 72(R10), R12 + MOVQ 72(DX), R12 VMOVDQU Y3, (R12)(R11*1) - MOVQ 96(R10), R12 + MOVQ 96(DX), R12 VMOVDQU Y4, (R12)(R11*1) - MOVQ 120(R10), R12 + MOVQ 120(DX), R12 VMOVDQU Y5, (R12)(R11*1) - MOVQ 144(R10), R12 + MOVQ 144(DX), R12 VMOVDQU Y6, (R12)(R11*1) - MOVQ 168(R10), R12 + MOVQ 168(DX), R12 VMOVDQU Y7, (R12)(R11*1) // Prepare for next loop @@ -11250,49 +10117,34 @@ mulAvxTwo_7x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_8x1(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 20 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_8x1_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), DX - MOVQ out_base+48(FP), R11 - MOVQ (R11), R11 - MOVQ start+72(FP), R12 - - // Add start offset to output - ADDQ R12, R11 - - // Add start offset to input - ADDQ R12, BX - ADDQ R12, BP - ADDQ R12, SI - ADDQ R12, DI - ADDQ R12, R8 - ADDQ R12, R9 - ADDQ R12, R10 - ADDQ R12, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_8x1_end + MOVQ out_base+48(FP), DX + MOVQ (DX), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), BX MOVQ $0x0000000f, R12 MOVQ R12, X1 VPBROADCASTB X1, Y1 + MOVQ start+72(FP), R12 mulAvxTwo_8x1_loop: // Clear 1 outputs VPXOR Y0, Y0, Y0 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (BX), Y4 - ADDQ $0x20, BX + VMOVDQU (BP)(R12*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -11304,8 +10156,7 @@ mulAvxTwo_8x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (BP), Y4 - ADDQ $0x20, BP + VMOVDQU (SI)(R12*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -11317,8 +10168,7 @@ mulAvxTwo_8x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 2 to 1 outputs - VMOVDQU (SI), Y4 - ADDQ $0x20, SI + VMOVDQU (DI)(R12*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -11330,8 +10180,7 @@ mulAvxTwo_8x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 3 to 1 outputs - VMOVDQU (DI), Y4 - ADDQ $0x20, DI + VMOVDQU (R8)(R12*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -11343,8 +10192,7 @@ mulAvxTwo_8x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 4 to 1 outputs - VMOVDQU (R8), Y4 - ADDQ $0x20, R8 + VMOVDQU (R9)(R12*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -11356,8 +10204,7 @@ mulAvxTwo_8x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 5 to 1 outputs - VMOVDQU (R9), Y4 - ADDQ $0x20, R9 + VMOVDQU (R10)(R12*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -11369,8 +10216,7 @@ mulAvxTwo_8x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 6 to 1 outputs - VMOVDQU (R10), Y4 - ADDQ $0x20, R10 + VMOVDQU (R11)(R12*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -11382,8 +10228,7 @@ mulAvxTwo_8x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 7 to 1 outputs - VMOVDQU (DX), Y4 - ADDQ $0x20, DX + VMOVDQU (BX)(R12*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -11395,10 +10240,10 @@ mulAvxTwo_8x1_loop: VPXOR Y2, Y0, Y0 // Store 1 outputs - VMOVDQU Y0, (R11) - ADDQ $0x20, R11 + VMOVDQU Y0, (DX)(R12*1) // Prepare for next loop + ADDQ $0x20, R12 DECQ AX JNZ mulAvxTwo_8x1_loop VZEROUPPER @@ -11410,43 +10255,28 @@ mulAvxTwo_8x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_8x2(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 39 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_8x2_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), DX - MOVQ out_base+48(FP), R11 - MOVQ (R11), R12 - MOVQ 24(R11), R11 - MOVQ start+72(FP), R13 - - // Add start offset to output - ADDQ R13, R12 - ADDQ R13, R11 - - // Add start offset to input - ADDQ R13, BX - ADDQ R13, BP - ADDQ R13, SI - ADDQ R13, DI - ADDQ R13, R8 - ADDQ R13, R9 - ADDQ R13, R10 - ADDQ R13, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_8x2_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), DX + MOVQ in_base+24(FP), BP + MOVQ (BP), SI + MOVQ 24(BP), DI + MOVQ 48(BP), R8 + MOVQ 72(BP), R9 + MOVQ 96(BP), R10 + MOVQ 120(BP), R11 + MOVQ 144(BP), R12 + MOVQ 168(BP), BP MOVQ $0x0000000f, R13 MOVQ R13, X2 VPBROADCASTB X2, Y2 + MOVQ start+72(FP), R13 mulAvxTwo_8x2_loop: // Clear 2 outputs @@ -11454,8 +10284,7 @@ mulAvxTwo_8x2_loop: VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (BX), Y5 - ADDQ $0x20, BX + VMOVDQU (SI)(R13*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -11473,8 +10302,7 @@ mulAvxTwo_8x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (BP), Y5 - ADDQ $0x20, BP + VMOVDQU (DI)(R13*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -11492,8 +10320,7 @@ mulAvxTwo_8x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 2 to 2 outputs - VMOVDQU (SI), Y5 - ADDQ $0x20, SI + VMOVDQU (R8)(R13*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -11511,8 +10338,7 @@ mulAvxTwo_8x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 3 to 2 outputs - VMOVDQU (DI), Y5 - ADDQ $0x20, DI + VMOVDQU (R9)(R13*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -11530,8 +10356,7 @@ mulAvxTwo_8x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 4 to 2 outputs - VMOVDQU (R8), Y5 - ADDQ $0x20, R8 + VMOVDQU (R10)(R13*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -11549,8 +10374,7 @@ mulAvxTwo_8x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 5 to 2 outputs - VMOVDQU (R9), Y5 - ADDQ $0x20, R9 + VMOVDQU (R11)(R13*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -11568,8 +10392,7 @@ mulAvxTwo_8x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 6 to 2 outputs - VMOVDQU (R10), Y5 - ADDQ $0x20, R10 + VMOVDQU (R12)(R13*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -11587,8 +10410,7 @@ mulAvxTwo_8x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 7 to 2 outputs - VMOVDQU (DX), Y5 - ADDQ $0x20, DX + VMOVDQU (BP)(R13*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -11606,12 +10428,11 @@ mulAvxTwo_8x2_loop: VPXOR Y3, Y1, Y1 // Store 2 outputs - VMOVDQU Y0, (R12) - ADDQ $0x20, R12 - VMOVDQU Y1, (R11) - ADDQ $0x20, R11 + VMOVDQU Y0, (BX)(R13*1) + VMOVDQU Y1, (DX)(R13*1) // Prepare for next loop + ADDQ $0x20, R13 DECQ AX JNZ mulAvxTwo_8x2_loop VZEROUPPER @@ -11623,45 +10444,29 @@ mulAvxTwo_8x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_8x3(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 56 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_8x3_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), DX - MOVQ out_base+48(FP), R11 - MOVQ (R11), R12 - MOVQ 24(R11), R13 - MOVQ 48(R11), R11 - MOVQ start+72(FP), R14 - - // Add start offset to output - ADDQ R14, R12 - ADDQ R14, R13 - ADDQ R14, R11 - - // Add start offset to input - ADDQ R14, BX - ADDQ R14, BP - ADDQ R14, SI - ADDQ R14, DI - ADDQ R14, R8 - ADDQ R14, R9 - ADDQ R14, R10 - ADDQ R14, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_8x3_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), DX + MOVQ in_base+24(FP), SI + MOVQ (SI), DI + MOVQ 24(SI), R8 + MOVQ 48(SI), R9 + MOVQ 72(SI), R10 + MOVQ 96(SI), R11 + MOVQ 120(SI), R12 + MOVQ 144(SI), R13 + MOVQ 168(SI), SI MOVQ $0x0000000f, R14 MOVQ R14, X3 VPBROADCASTB X3, Y3 + MOVQ start+72(FP), R14 mulAvxTwo_8x3_loop: // Clear 3 outputs @@ -11670,8 +10475,7 @@ mulAvxTwo_8x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (BX), Y6 - ADDQ $0x20, BX + VMOVDQU (DI)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -11695,8 +10499,7 @@ mulAvxTwo_8x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (BP), Y6 - ADDQ $0x20, BP + VMOVDQU (R8)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -11720,8 +10523,7 @@ mulAvxTwo_8x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 2 to 3 outputs - VMOVDQU (SI), Y6 - ADDQ $0x20, SI + VMOVDQU (R9)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -11745,8 +10547,7 @@ mulAvxTwo_8x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 3 to 3 outputs - VMOVDQU (DI), Y6 - ADDQ $0x20, DI + VMOVDQU (R10)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -11770,8 +10571,7 @@ mulAvxTwo_8x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 4 to 3 outputs - VMOVDQU (R8), Y6 - ADDQ $0x20, R8 + VMOVDQU (R11)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -11795,8 +10595,7 @@ mulAvxTwo_8x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 5 to 3 outputs - VMOVDQU (R9), Y6 - ADDQ $0x20, R9 + VMOVDQU (R12)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -11820,8 +10619,7 @@ mulAvxTwo_8x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 6 to 3 outputs - VMOVDQU (R10), Y6 - ADDQ $0x20, R10 + VMOVDQU (R13)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -11845,8 +10643,7 @@ mulAvxTwo_8x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 7 to 3 outputs - VMOVDQU (DX), Y6 - ADDQ $0x20, DX + VMOVDQU (SI)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -11870,14 +10667,12 @@ mulAvxTwo_8x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - VMOVDQU Y0, (R12) - ADDQ $0x20, R12 - VMOVDQU Y1, (R13) - ADDQ $0x20, R13 - VMOVDQU Y2, (R11) - ADDQ $0x20, R11 + VMOVDQU Y0, (BX)(R14*1) + VMOVDQU Y1, (BP)(R14*1) + VMOVDQU Y2, (DX)(R14*1) // Prepare for next loop + ADDQ $0x20, R14 DECQ AX JNZ mulAvxTwo_8x3_loop VZEROUPPER @@ -11889,47 +10684,30 @@ mulAvxTwo_8x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_8x4(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 73 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_8x4_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), DX - MOVQ out_base+48(FP), R11 - MOVQ (R11), R12 - MOVQ 24(R11), R13 - MOVQ 48(R11), R14 - MOVQ 72(R11), R11 - MOVQ start+72(FP), R15 - - // Add start offset to output - ADDQ R15, R12 - ADDQ R15, R13 - ADDQ R15, R14 - ADDQ R15, R11 - - // Add start offset to input - ADDQ R15, BX - ADDQ R15, BP - ADDQ R15, SI - ADDQ R15, DI - ADDQ R15, R8 - ADDQ R15, R9 - ADDQ R15, R10 - ADDQ R15, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_8x4_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), SI + MOVQ 72(DX), DX + MOVQ in_base+24(FP), DI + MOVQ (DI), R8 + MOVQ 24(DI), R9 + MOVQ 48(DI), R10 + MOVQ 72(DI), R11 + MOVQ 96(DI), R12 + MOVQ 120(DI), R13 + MOVQ 144(DI), R14 + MOVQ 168(DI), DI MOVQ $0x0000000f, R15 MOVQ R15, X4 VPBROADCASTB X4, Y4 + MOVQ start+72(FP), R15 mulAvxTwo_8x4_loop: // Clear 4 outputs @@ -11939,8 +10717,7 @@ mulAvxTwo_8x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (BX), Y7 - ADDQ $0x20, BX + VMOVDQU (R8)(R15*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -11970,8 +10747,7 @@ mulAvxTwo_8x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (BP), Y7 - ADDQ $0x20, BP + VMOVDQU (R9)(R15*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -12001,8 +10777,7 @@ mulAvxTwo_8x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 2 to 4 outputs - VMOVDQU (SI), Y7 - ADDQ $0x20, SI + VMOVDQU (R10)(R15*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -12032,8 +10807,7 @@ mulAvxTwo_8x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 3 to 4 outputs - VMOVDQU (DI), Y7 - ADDQ $0x20, DI + VMOVDQU (R11)(R15*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -12063,8 +10837,7 @@ mulAvxTwo_8x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 4 to 4 outputs - VMOVDQU (R8), Y7 - ADDQ $0x20, R8 + VMOVDQU (R12)(R15*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -12094,8 +10867,7 @@ mulAvxTwo_8x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 5 to 4 outputs - VMOVDQU (R9), Y7 - ADDQ $0x20, R9 + VMOVDQU (R13)(R15*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -12125,8 +10897,7 @@ mulAvxTwo_8x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 6 to 4 outputs - VMOVDQU (R10), Y7 - ADDQ $0x20, R10 + VMOVDQU (R14)(R15*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -12156,8 +10927,7 @@ mulAvxTwo_8x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 7 to 4 outputs - VMOVDQU (DX), Y7 - ADDQ $0x20, DX + VMOVDQU (DI)(R15*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -12187,16 +10957,13 @@ mulAvxTwo_8x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - VMOVDQU Y0, (R12) - ADDQ $0x20, R12 - VMOVDQU Y1, (R13) - ADDQ $0x20, R13 - VMOVDQU Y2, (R14) - ADDQ $0x20, R14 - VMOVDQU Y3, (R11) - ADDQ $0x20, R11 + VMOVDQU Y0, (BX)(R15*1) + VMOVDQU Y1, (BP)(R15*1) + VMOVDQU Y2, (SI)(R15*1) + VMOVDQU Y3, (DX)(R15*1) // Prepare for next loop + ADDQ $0x20, R15 DECQ AX JNZ mulAvxTwo_8x4_loop VZEROUPPER @@ -12208,51 +10975,26 @@ mulAvxTwo_8x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_8x5(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 90 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_8x5_end - MOVQ in_base+24(FP), AX - MOVQ (AX), DX - MOVQ 24(AX), BX - MOVQ 48(AX), BP - MOVQ 72(AX), SI - MOVQ 96(AX), DI - MOVQ 120(AX), R8 - MOVQ 144(AX), R9 - MOVQ 168(AX), AX - MOVQ out_base+48(FP), R10 - MOVQ (R10), R11 - MOVQ 24(R10), R12 - MOVQ 48(R10), R13 - MOVQ 72(R10), R14 - MOVQ 96(R10), R10 - MOVQ start+72(FP), R15 - - // Add start offset to output - ADDQ R15, R11 - ADDQ R15, R12 - ADDQ R15, R13 - ADDQ R15, R14 - ADDQ R15, R10 - - // Add start offset to input - ADDQ R15, DX - ADDQ R15, BX - ADDQ R15, BP - ADDQ R15, SI - ADDQ R15, DI - ADDQ R15, R8 - ADDQ R15, R9 - ADDQ R15, AX - MOVQ $0x0000000f, R15 - MOVQ R15, X5 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_8x5_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), BX + MOVQ $0x0000000f, R12 + MOVQ R12, X5 VPBROADCASTB X5, Y5 - MOVQ n+80(FP), R15 - SHRQ $0x05, R15 + MOVQ start+72(FP), R12 mulAvxTwo_8x5_loop: // Clear 5 outputs @@ -12263,8 +11005,7 @@ mulAvxTwo_8x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (DX), Y8 - ADDQ $0x20, DX + VMOVDQU (BP)(R12*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -12300,8 +11041,7 @@ mulAvxTwo_8x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (BX), Y8 - ADDQ $0x20, BX + VMOVDQU (SI)(R12*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -12337,8 +11077,7 @@ mulAvxTwo_8x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 2 to 5 outputs - VMOVDQU (BP), Y8 - ADDQ $0x20, BP + VMOVDQU (DI)(R12*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -12374,8 +11113,7 @@ mulAvxTwo_8x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 3 to 5 outputs - VMOVDQU (SI), Y8 - ADDQ $0x20, SI + VMOVDQU (R8)(R12*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -12411,8 +11149,7 @@ mulAvxTwo_8x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 4 to 5 outputs - VMOVDQU (DI), Y8 - ADDQ $0x20, DI + VMOVDQU (R9)(R12*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -12448,8 +11185,7 @@ mulAvxTwo_8x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 5 to 5 outputs - VMOVDQU (R8), Y8 - ADDQ $0x20, R8 + VMOVDQU (R10)(R12*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -12485,8 +11221,7 @@ mulAvxTwo_8x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 6 to 5 outputs - VMOVDQU (R9), Y8 - ADDQ $0x20, R9 + VMOVDQU (R11)(R12*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -12522,8 +11257,7 @@ mulAvxTwo_8x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 7 to 5 outputs - VMOVDQU (AX), Y8 - ADDQ $0x20, AX + VMOVDQU (BX)(R12*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -12559,19 +11293,20 @@ mulAvxTwo_8x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - VMOVDQU Y0, (R11) - ADDQ $0x20, R11 - VMOVDQU Y1, (R12) - ADDQ $0x20, R12 - VMOVDQU Y2, (R13) - ADDQ $0x20, R13 - VMOVDQU Y3, (R14) - ADDQ $0x20, R14 - VMOVDQU Y4, (R10) - ADDQ $0x20, R10 + MOVQ (DX), R13 + VMOVDQU Y0, (R13)(R12*1) + MOVQ 24(DX), R13 + VMOVDQU Y1, (R13)(R12*1) + MOVQ 48(DX), R13 + VMOVDQU Y2, (R13)(R12*1) + MOVQ 72(DX), R13 + VMOVDQU Y3, (R13)(R12*1) + MOVQ 96(DX), R13 + VMOVDQU Y4, (R13)(R12*1) // Prepare for next loop - DECQ R15 + ADDQ $0x20, R12 + DECQ AX JNZ mulAvxTwo_8x5_loop VZEROUPPER @@ -12582,37 +11317,26 @@ mulAvxTwo_8x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_8x6(SB), $0-88 // Loading no tables to registers - // Destination kept on stack // Full registers estimated 107 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_8x6_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), DX - MOVQ out_base+48(FP), R11 - MOVQ start+72(FP), R12 - - // Add start offset to input - ADDQ R12, BX - ADDQ R12, BP - ADDQ R12, SI - ADDQ R12, DI - ADDQ R12, R8 - ADDQ R12, R9 - ADDQ R12, R10 - ADDQ R12, DX - MOVQ $0x0000000f, R13 - MOVQ R13, X6 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_8x6_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), BX + MOVQ $0x0000000f, R12 + MOVQ R12, X6 VPBROADCASTB X6, Y6 + MOVQ start+72(FP), R12 mulAvxTwo_8x6_loop: // Clear 6 outputs @@ -12624,8 +11348,7 @@ mulAvxTwo_8x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (BX), Y9 - ADDQ $0x20, BX + VMOVDQU (BP)(R12*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -12667,8 +11390,7 @@ mulAvxTwo_8x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (BP), Y9 - ADDQ $0x20, BP + VMOVDQU (SI)(R12*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -12710,8 +11432,7 @@ mulAvxTwo_8x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 2 to 6 outputs - VMOVDQU (SI), Y9 - ADDQ $0x20, SI + VMOVDQU (DI)(R12*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -12753,8 +11474,7 @@ mulAvxTwo_8x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 3 to 6 outputs - VMOVDQU (DI), Y9 - ADDQ $0x20, DI + VMOVDQU (R8)(R12*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -12796,8 +11516,7 @@ mulAvxTwo_8x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 4 to 6 outputs - VMOVDQU (R8), Y9 - ADDQ $0x20, R8 + VMOVDQU (R9)(R12*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -12839,8 +11558,7 @@ mulAvxTwo_8x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 5 to 6 outputs - VMOVDQU (R9), Y9 - ADDQ $0x20, R9 + VMOVDQU (R10)(R12*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -12882,8 +11600,7 @@ mulAvxTwo_8x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 6 to 6 outputs - VMOVDQU (R10), Y9 - ADDQ $0x20, R10 + VMOVDQU (R11)(R12*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -12925,8 +11642,7 @@ mulAvxTwo_8x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 7 to 6 outputs - VMOVDQU (DX), Y9 - ADDQ $0x20, DX + VMOVDQU (BX)(R12*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -12968,17 +11684,17 @@ mulAvxTwo_8x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - MOVQ (R11), R13 + MOVQ (DX), R13 VMOVDQU Y0, (R13)(R12*1) - MOVQ 24(R11), R13 + MOVQ 24(DX), R13 VMOVDQU Y1, (R13)(R12*1) - MOVQ 48(R11), R13 + MOVQ 48(DX), R13 VMOVDQU Y2, (R13)(R12*1) - MOVQ 72(R11), R13 + MOVQ 72(DX), R13 VMOVDQU Y3, (R13)(R12*1) - MOVQ 96(R11), R13 + MOVQ 96(DX), R13 VMOVDQU Y4, (R13)(R12*1) - MOVQ 120(R11), R13 + MOVQ 120(DX), R13 VMOVDQU Y5, (R13)(R12*1) // Prepare for next loop @@ -12994,37 +11710,26 @@ mulAvxTwo_8x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_8x7(SB), $0-88 // Loading no tables to registers - // Destination kept on stack // Full registers estimated 124 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_8x7_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), DX - MOVQ out_base+48(FP), R11 - MOVQ start+72(FP), R12 - - // Add start offset to input - ADDQ R12, BX - ADDQ R12, BP - ADDQ R12, SI - ADDQ R12, DI - ADDQ R12, R8 - ADDQ R12, R9 - ADDQ R12, R10 - ADDQ R12, DX - MOVQ $0x0000000f, R13 - MOVQ R13, X7 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_8x7_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), BX + MOVQ $0x0000000f, R12 + MOVQ R12, X7 VPBROADCASTB X7, Y7 + MOVQ start+72(FP), R12 mulAvxTwo_8x7_loop: // Clear 7 outputs @@ -13037,8 +11742,7 @@ mulAvxTwo_8x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (BX), Y10 - ADDQ $0x20, BX + VMOVDQU (BP)(R12*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -13086,8 +11790,7 @@ mulAvxTwo_8x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (BP), Y10 - ADDQ $0x20, BP + VMOVDQU (SI)(R12*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -13135,8 +11838,7 @@ mulAvxTwo_8x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 2 to 7 outputs - VMOVDQU (SI), Y10 - ADDQ $0x20, SI + VMOVDQU (DI)(R12*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -13184,8 +11886,7 @@ mulAvxTwo_8x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 3 to 7 outputs - VMOVDQU (DI), Y10 - ADDQ $0x20, DI + VMOVDQU (R8)(R12*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -13233,8 +11934,7 @@ mulAvxTwo_8x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 4 to 7 outputs - VMOVDQU (R8), Y10 - ADDQ $0x20, R8 + VMOVDQU (R9)(R12*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -13282,8 +11982,7 @@ mulAvxTwo_8x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 5 to 7 outputs - VMOVDQU (R9), Y10 - ADDQ $0x20, R9 + VMOVDQU (R10)(R12*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -13331,8 +12030,7 @@ mulAvxTwo_8x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 6 to 7 outputs - VMOVDQU (R10), Y10 - ADDQ $0x20, R10 + VMOVDQU (R11)(R12*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -13380,8 +12078,7 @@ mulAvxTwo_8x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 7 to 7 outputs - VMOVDQU (DX), Y10 - ADDQ $0x20, DX + VMOVDQU (BX)(R12*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -13429,19 +12126,19 @@ mulAvxTwo_8x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - MOVQ (R11), R13 + MOVQ (DX), R13 VMOVDQU Y0, (R13)(R12*1) - MOVQ 24(R11), R13 + MOVQ 24(DX), R13 VMOVDQU Y1, (R13)(R12*1) - MOVQ 48(R11), R13 + MOVQ 48(DX), R13 VMOVDQU Y2, (R13)(R12*1) - MOVQ 72(R11), R13 + MOVQ 72(DX), R13 VMOVDQU Y3, (R13)(R12*1) - MOVQ 96(R11), R13 + MOVQ 96(DX), R13 VMOVDQU Y4, (R13)(R12*1) - MOVQ 120(R11), R13 + MOVQ 120(DX), R13 VMOVDQU Y5, (R13)(R12*1) - MOVQ 144(R11), R13 + MOVQ 144(DX), R13 VMOVDQU Y6, (R13)(R12*1) // Prepare for next loop @@ -13457,37 +12154,26 @@ mulAvxTwo_8x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_8x8(SB), $0-88 // Loading no tables to registers - // Destination kept on stack // Full registers estimated 141 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_8x8_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), DX - MOVQ out_base+48(FP), R11 - MOVQ start+72(FP), R12 - - // Add start offset to input - ADDQ R12, BX - ADDQ R12, BP - ADDQ R12, SI - ADDQ R12, DI - ADDQ R12, R8 - ADDQ R12, R9 - ADDQ R12, R10 - ADDQ R12, DX - MOVQ $0x0000000f, R13 - MOVQ R13, X8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_8x8_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), BX + MOVQ $0x0000000f, R12 + MOVQ R12, X8 VPBROADCASTB X8, Y8 + MOVQ start+72(FP), R12 mulAvxTwo_8x8_loop: // Clear 8 outputs @@ -13501,8 +12187,7 @@ mulAvxTwo_8x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (BX), Y11 - ADDQ $0x20, BX + VMOVDQU (BP)(R12*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -13556,8 +12241,7 @@ mulAvxTwo_8x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (BP), Y11 - ADDQ $0x20, BP + VMOVDQU (SI)(R12*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -13611,8 +12295,7 @@ mulAvxTwo_8x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 2 to 8 outputs - VMOVDQU (SI), Y11 - ADDQ $0x20, SI + VMOVDQU (DI)(R12*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -13666,8 +12349,7 @@ mulAvxTwo_8x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 3 to 8 outputs - VMOVDQU (DI), Y11 - ADDQ $0x20, DI + VMOVDQU (R8)(R12*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -13721,8 +12403,7 @@ mulAvxTwo_8x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 4 to 8 outputs - VMOVDQU (R8), Y11 - ADDQ $0x20, R8 + VMOVDQU (R9)(R12*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -13776,8 +12457,7 @@ mulAvxTwo_8x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 5 to 8 outputs - VMOVDQU (R9), Y11 - ADDQ $0x20, R9 + VMOVDQU (R10)(R12*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -13831,8 +12511,7 @@ mulAvxTwo_8x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 6 to 8 outputs - VMOVDQU (R10), Y11 - ADDQ $0x20, R10 + VMOVDQU (R11)(R12*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -13886,8 +12565,7 @@ mulAvxTwo_8x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 7 to 8 outputs - VMOVDQU (DX), Y11 - ADDQ $0x20, DX + VMOVDQU (BX)(R12*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -13941,21 +12619,21 @@ mulAvxTwo_8x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - MOVQ (R11), R13 + MOVQ (DX), R13 VMOVDQU Y0, (R13)(R12*1) - MOVQ 24(R11), R13 + MOVQ 24(DX), R13 VMOVDQU Y1, (R13)(R12*1) - MOVQ 48(R11), R13 + MOVQ 48(DX), R13 VMOVDQU Y2, (R13)(R12*1) - MOVQ 72(R11), R13 + MOVQ 72(DX), R13 VMOVDQU Y3, (R13)(R12*1) - MOVQ 96(R11), R13 + MOVQ 96(DX), R13 VMOVDQU Y4, (R13)(R12*1) - MOVQ 120(R11), R13 + MOVQ 120(DX), R13 VMOVDQU Y5, (R13)(R12*1) - MOVQ 144(R11), R13 + MOVQ 144(DX), R13 VMOVDQU Y6, (R13)(R12*1) - MOVQ 168(R11), R13 + MOVQ 168(DX), R13 VMOVDQU Y7, (R13)(R12*1) // Prepare for next loop @@ -13971,51 +12649,35 @@ mulAvxTwo_8x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_9x1(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 22 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_9x1_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), R11 - MOVQ 192(DX), DX - MOVQ out_base+48(FP), R12 - MOVQ (R12), R12 - MOVQ start+72(FP), R13 - - // Add start offset to output - ADDQ R13, R12 - - // Add start offset to input - ADDQ R13, BX - ADDQ R13, BP - ADDQ R13, SI - ADDQ R13, DI - ADDQ R13, R8 - ADDQ R13, R9 - ADDQ R13, R10 - ADDQ R13, R11 - ADDQ R13, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_9x1_end + MOVQ out_base+48(FP), DX + MOVQ (DX), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), R12 + MOVQ 192(BX), BX MOVQ $0x0000000f, R13 MOVQ R13, X1 VPBROADCASTB X1, Y1 + MOVQ start+72(FP), R13 mulAvxTwo_9x1_loop: // Clear 1 outputs VPXOR Y0, Y0, Y0 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (BX), Y4 - ADDQ $0x20, BX + VMOVDQU (BP)(R13*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -14027,8 +12689,7 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (BP), Y4 - ADDQ $0x20, BP + VMOVDQU (SI)(R13*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -14040,8 +12701,7 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 2 to 1 outputs - VMOVDQU (SI), Y4 - ADDQ $0x20, SI + VMOVDQU (DI)(R13*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -14053,8 +12713,7 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 3 to 1 outputs - VMOVDQU (DI), Y4 - ADDQ $0x20, DI + VMOVDQU (R8)(R13*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -14066,8 +12725,7 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 4 to 1 outputs - VMOVDQU (R8), Y4 - ADDQ $0x20, R8 + VMOVDQU (R9)(R13*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -14079,8 +12737,7 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 5 to 1 outputs - VMOVDQU (R9), Y4 - ADDQ $0x20, R9 + VMOVDQU (R10)(R13*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -14092,8 +12749,7 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 6 to 1 outputs - VMOVDQU (R10), Y4 - ADDQ $0x20, R10 + VMOVDQU (R11)(R13*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -14105,8 +12761,7 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 7 to 1 outputs - VMOVDQU (R11), Y4 - ADDQ $0x20, R11 + VMOVDQU (R12)(R13*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -14118,8 +12773,7 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 8 to 1 outputs - VMOVDQU (DX), Y4 - ADDQ $0x20, DX + VMOVDQU (BX)(R13*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -14131,10 +12785,10 @@ mulAvxTwo_9x1_loop: VPXOR Y2, Y0, Y0 // Store 1 outputs - VMOVDQU Y0, (R12) - ADDQ $0x20, R12 + VMOVDQU Y0, (DX)(R13*1) // Prepare for next loop + ADDQ $0x20, R13 DECQ AX JNZ mulAvxTwo_9x1_loop VZEROUPPER @@ -14146,45 +12800,29 @@ mulAvxTwo_9x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_9x2(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 43 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_9x2_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), R11 - MOVQ 192(DX), DX - MOVQ out_base+48(FP), R12 - MOVQ (R12), R13 - MOVQ 24(R12), R12 - MOVQ start+72(FP), R14 - - // Add start offset to output - ADDQ R14, R13 - ADDQ R14, R12 - - // Add start offset to input - ADDQ R14, BX - ADDQ R14, BP - ADDQ R14, SI - ADDQ R14, DI - ADDQ R14, R8 - ADDQ R14, R9 - ADDQ R14, R10 - ADDQ R14, R11 - ADDQ R14, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_9x2_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), DX + MOVQ in_base+24(FP), BP + MOVQ (BP), SI + MOVQ 24(BP), DI + MOVQ 48(BP), R8 + MOVQ 72(BP), R9 + MOVQ 96(BP), R10 + MOVQ 120(BP), R11 + MOVQ 144(BP), R12 + MOVQ 168(BP), R13 + MOVQ 192(BP), BP MOVQ $0x0000000f, R14 MOVQ R14, X2 VPBROADCASTB X2, Y2 + MOVQ start+72(FP), R14 mulAvxTwo_9x2_loop: // Clear 2 outputs @@ -14192,8 +12830,7 @@ mulAvxTwo_9x2_loop: VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (BX), Y5 - ADDQ $0x20, BX + VMOVDQU (SI)(R14*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -14211,8 +12848,7 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (BP), Y5 - ADDQ $0x20, BP + VMOVDQU (DI)(R14*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -14230,8 +12866,7 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 2 to 2 outputs - VMOVDQU (SI), Y5 - ADDQ $0x20, SI + VMOVDQU (R8)(R14*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -14249,8 +12884,7 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 3 to 2 outputs - VMOVDQU (DI), Y5 - ADDQ $0x20, DI + VMOVDQU (R9)(R14*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -14268,8 +12902,7 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 4 to 2 outputs - VMOVDQU (R8), Y5 - ADDQ $0x20, R8 + VMOVDQU (R10)(R14*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -14287,8 +12920,7 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 5 to 2 outputs - VMOVDQU (R9), Y5 - ADDQ $0x20, R9 + VMOVDQU (R11)(R14*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -14306,8 +12938,7 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 6 to 2 outputs - VMOVDQU (R10), Y5 - ADDQ $0x20, R10 + VMOVDQU (R12)(R14*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -14325,8 +12956,7 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 7 to 2 outputs - VMOVDQU (R11), Y5 - ADDQ $0x20, R11 + VMOVDQU (R13)(R14*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -14344,8 +12974,7 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 8 to 2 outputs - VMOVDQU (DX), Y5 - ADDQ $0x20, DX + VMOVDQU (BP)(R14*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -14363,12 +12992,11 @@ mulAvxTwo_9x2_loop: VPXOR Y3, Y1, Y1 // Store 2 outputs - VMOVDQU Y0, (R13) - ADDQ $0x20, R13 - VMOVDQU Y1, (R12) - ADDQ $0x20, R12 + VMOVDQU Y0, (BX)(R14*1) + VMOVDQU Y1, (DX)(R14*1) // Prepare for next loop + ADDQ $0x20, R14 DECQ AX JNZ mulAvxTwo_9x2_loop VZEROUPPER @@ -14380,47 +13008,30 @@ mulAvxTwo_9x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_9x3(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 62 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_9x3_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), R11 - MOVQ 192(DX), DX - MOVQ out_base+48(FP), R12 - MOVQ (R12), R13 - MOVQ 24(R12), R14 - MOVQ 48(R12), R12 - MOVQ start+72(FP), R15 - - // Add start offset to output - ADDQ R15, R13 - ADDQ R15, R14 - ADDQ R15, R12 - - // Add start offset to input - ADDQ R15, BX - ADDQ R15, BP - ADDQ R15, SI - ADDQ R15, DI - ADDQ R15, R8 - ADDQ R15, R9 - ADDQ R15, R10 - ADDQ R15, R11 - ADDQ R15, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_9x3_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), BP + MOVQ 48(DX), DX + MOVQ in_base+24(FP), SI + MOVQ (SI), DI + MOVQ 24(SI), R8 + MOVQ 48(SI), R9 + MOVQ 72(SI), R10 + MOVQ 96(SI), R11 + MOVQ 120(SI), R12 + MOVQ 144(SI), R13 + MOVQ 168(SI), R14 + MOVQ 192(SI), SI MOVQ $0x0000000f, R15 MOVQ R15, X3 VPBROADCASTB X3, Y3 + MOVQ start+72(FP), R15 mulAvxTwo_9x3_loop: // Clear 3 outputs @@ -14429,8 +13040,7 @@ mulAvxTwo_9x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (BX), Y6 - ADDQ $0x20, BX + VMOVDQU (DI)(R15*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -14454,8 +13064,7 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (BP), Y6 - ADDQ $0x20, BP + VMOVDQU (R8)(R15*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -14479,8 +13088,7 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 2 to 3 outputs - VMOVDQU (SI), Y6 - ADDQ $0x20, SI + VMOVDQU (R9)(R15*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -14504,8 +13112,7 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 3 to 3 outputs - VMOVDQU (DI), Y6 - ADDQ $0x20, DI + VMOVDQU (R10)(R15*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -14529,8 +13136,7 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 4 to 3 outputs - VMOVDQU (R8), Y6 - ADDQ $0x20, R8 + VMOVDQU (R11)(R15*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -14554,8 +13160,7 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 5 to 3 outputs - VMOVDQU (R9), Y6 - ADDQ $0x20, R9 + VMOVDQU (R12)(R15*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -14579,8 +13184,7 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 6 to 3 outputs - VMOVDQU (R10), Y6 - ADDQ $0x20, R10 + VMOVDQU (R13)(R15*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -14604,8 +13208,7 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 7 to 3 outputs - VMOVDQU (R11), Y6 - ADDQ $0x20, R11 + VMOVDQU (R14)(R15*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -14629,8 +13232,7 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 8 to 3 outputs - VMOVDQU (DX), Y6 - ADDQ $0x20, DX + VMOVDQU (SI)(R15*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -14654,14 +13256,12 @@ mulAvxTwo_9x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - VMOVDQU Y0, (R13) - ADDQ $0x20, R13 - VMOVDQU Y1, (R14) - ADDQ $0x20, R14 - VMOVDQU Y2, (R12) - ADDQ $0x20, R12 + VMOVDQU Y0, (BX)(R15*1) + VMOVDQU Y1, (BP)(R15*1) + VMOVDQU Y2, (DX)(R15*1) // Prepare for next loop + ADDQ $0x20, R15 DECQ AX JNZ mulAvxTwo_9x3_loop VZEROUPPER @@ -14673,51 +13273,27 @@ mulAvxTwo_9x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_9x4(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 81 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_9x4_end - MOVQ in_base+24(FP), AX - MOVQ (AX), DX - MOVQ 24(AX), BX - MOVQ 48(AX), BP - MOVQ 72(AX), SI - MOVQ 96(AX), DI - MOVQ 120(AX), R8 - MOVQ 144(AX), R9 - MOVQ 168(AX), R10 - MOVQ 192(AX), AX - MOVQ out_base+48(FP), R11 - MOVQ (R11), R12 - MOVQ 24(R11), R13 - MOVQ 48(R11), R14 - MOVQ 72(R11), R11 - MOVQ start+72(FP), R15 - - // Add start offset to output - ADDQ R15, R12 - ADDQ R15, R13 - ADDQ R15, R14 - ADDQ R15, R11 - - // Add start offset to input - ADDQ R15, DX - ADDQ R15, BX - ADDQ R15, BP - ADDQ R15, SI - ADDQ R15, DI - ADDQ R15, R8 - ADDQ R15, R9 - ADDQ R15, R10 - ADDQ R15, AX - MOVQ $0x0000000f, R15 - MOVQ R15, X4 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_9x4_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), R12 + MOVQ 192(BX), BX + MOVQ $0x0000000f, R13 + MOVQ R13, X4 VPBROADCASTB X4, Y4 - MOVQ n+80(FP), R15 - SHRQ $0x05, R15 + MOVQ start+72(FP), R13 mulAvxTwo_9x4_loop: // Clear 4 outputs @@ -14727,8 +13303,7 @@ mulAvxTwo_9x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (DX), Y7 - ADDQ $0x20, DX + VMOVDQU (BP)(R13*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -14758,8 +13333,7 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (BX), Y7 - ADDQ $0x20, BX + VMOVDQU (SI)(R13*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -14789,8 +13363,7 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 2 to 4 outputs - VMOVDQU (BP), Y7 - ADDQ $0x20, BP + VMOVDQU (DI)(R13*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -14820,8 +13393,7 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 3 to 4 outputs - VMOVDQU (SI), Y7 - ADDQ $0x20, SI + VMOVDQU (R8)(R13*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -14851,8 +13423,7 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 4 to 4 outputs - VMOVDQU (DI), Y7 - ADDQ $0x20, DI + VMOVDQU (R9)(R13*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -14882,8 +13453,7 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 5 to 4 outputs - VMOVDQU (R8), Y7 - ADDQ $0x20, R8 + VMOVDQU (R10)(R13*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -14913,8 +13483,7 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 6 to 4 outputs - VMOVDQU (R9), Y7 - ADDQ $0x20, R9 + VMOVDQU (R11)(R13*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -14944,8 +13513,7 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 7 to 4 outputs - VMOVDQU (R10), Y7 - ADDQ $0x20, R10 + VMOVDQU (R12)(R13*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -14975,8 +13543,7 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 8 to 4 outputs - VMOVDQU (AX), Y7 - ADDQ $0x20, AX + VMOVDQU (BX)(R13*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -15006,17 +13573,18 @@ mulAvxTwo_9x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - VMOVDQU Y0, (R12) - ADDQ $0x20, R12 - VMOVDQU Y1, (R13) - ADDQ $0x20, R13 - VMOVDQU Y2, (R14) - ADDQ $0x20, R14 - VMOVDQU Y3, (R11) - ADDQ $0x20, R11 + MOVQ (DX), R14 + VMOVDQU Y0, (R14)(R13*1) + MOVQ 24(DX), R14 + VMOVDQU Y1, (R14)(R13*1) + MOVQ 48(DX), R14 + VMOVDQU Y2, (R14)(R13*1) + MOVQ 72(DX), R14 + VMOVDQU Y3, (R14)(R13*1) // Prepare for next loop - DECQ R15 + ADDQ $0x20, R13 + DECQ AX JNZ mulAvxTwo_9x4_loop VZEROUPPER @@ -15027,39 +13595,27 @@ mulAvxTwo_9x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_9x5(SB), $0-88 // Loading no tables to registers - // Destination kept on stack // Full registers estimated 100 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_9x5_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), R11 - MOVQ 192(DX), DX - MOVQ out_base+48(FP), R12 - MOVQ start+72(FP), R13 - - // Add start offset to input - ADDQ R13, BX - ADDQ R13, BP - ADDQ R13, SI - ADDQ R13, DI - ADDQ R13, R8 - ADDQ R13, R9 - ADDQ R13, R10 - ADDQ R13, R11 - ADDQ R13, DX - MOVQ $0x0000000f, R14 - MOVQ R14, X5 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_9x5_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), R12 + MOVQ 192(BX), BX + MOVQ $0x0000000f, R13 + MOVQ R13, X5 VPBROADCASTB X5, Y5 + MOVQ start+72(FP), R13 mulAvxTwo_9x5_loop: // Clear 5 outputs @@ -15070,8 +13626,7 @@ mulAvxTwo_9x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (BX), Y8 - ADDQ $0x20, BX + VMOVDQU (BP)(R13*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -15107,8 +13662,7 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (BP), Y8 - ADDQ $0x20, BP + VMOVDQU (SI)(R13*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -15144,8 +13698,7 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 2 to 5 outputs - VMOVDQU (SI), Y8 - ADDQ $0x20, SI + VMOVDQU (DI)(R13*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -15181,8 +13734,7 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 3 to 5 outputs - VMOVDQU (DI), Y8 - ADDQ $0x20, DI + VMOVDQU (R8)(R13*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -15218,8 +13770,7 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 4 to 5 outputs - VMOVDQU (R8), Y8 - ADDQ $0x20, R8 + VMOVDQU (R9)(R13*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -15255,8 +13806,7 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 5 to 5 outputs - VMOVDQU (R9), Y8 - ADDQ $0x20, R9 + VMOVDQU (R10)(R13*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -15292,8 +13842,7 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 6 to 5 outputs - VMOVDQU (R10), Y8 - ADDQ $0x20, R10 + VMOVDQU (R11)(R13*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -15329,8 +13878,7 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 7 to 5 outputs - VMOVDQU (R11), Y8 - ADDQ $0x20, R11 + VMOVDQU (R12)(R13*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -15366,8 +13914,7 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 8 to 5 outputs - VMOVDQU (DX), Y8 - ADDQ $0x20, DX + VMOVDQU (BX)(R13*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -15403,15 +13950,15 @@ mulAvxTwo_9x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - MOVQ (R12), R14 + MOVQ (DX), R14 VMOVDQU Y0, (R14)(R13*1) - MOVQ 24(R12), R14 + MOVQ 24(DX), R14 VMOVDQU Y1, (R14)(R13*1) - MOVQ 48(R12), R14 + MOVQ 48(DX), R14 VMOVDQU Y2, (R14)(R13*1) - MOVQ 72(R12), R14 + MOVQ 72(DX), R14 VMOVDQU Y3, (R14)(R13*1) - MOVQ 96(R12), R14 + MOVQ 96(DX), R14 VMOVDQU Y4, (R14)(R13*1) // Prepare for next loop @@ -15427,39 +13974,27 @@ mulAvxTwo_9x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_9x6(SB), $0-88 // Loading no tables to registers - // Destination kept on stack // Full registers estimated 119 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_9x6_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), R11 - MOVQ 192(DX), DX - MOVQ out_base+48(FP), R12 - MOVQ start+72(FP), R13 - - // Add start offset to input - ADDQ R13, BX - ADDQ R13, BP - ADDQ R13, SI - ADDQ R13, DI - ADDQ R13, R8 - ADDQ R13, R9 - ADDQ R13, R10 - ADDQ R13, R11 - ADDQ R13, DX - MOVQ $0x0000000f, R14 - MOVQ R14, X6 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_9x6_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), R12 + MOVQ 192(BX), BX + MOVQ $0x0000000f, R13 + MOVQ R13, X6 VPBROADCASTB X6, Y6 + MOVQ start+72(FP), R13 mulAvxTwo_9x6_loop: // Clear 6 outputs @@ -15471,8 +14006,7 @@ mulAvxTwo_9x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (BX), Y9 - ADDQ $0x20, BX + VMOVDQU (BP)(R13*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -15514,8 +14048,7 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (BP), Y9 - ADDQ $0x20, BP + VMOVDQU (SI)(R13*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -15557,8 +14090,7 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 2 to 6 outputs - VMOVDQU (SI), Y9 - ADDQ $0x20, SI + VMOVDQU (DI)(R13*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -15600,8 +14132,7 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 3 to 6 outputs - VMOVDQU (DI), Y9 - ADDQ $0x20, DI + VMOVDQU (R8)(R13*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -15643,8 +14174,7 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 4 to 6 outputs - VMOVDQU (R8), Y9 - ADDQ $0x20, R8 + VMOVDQU (R9)(R13*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -15686,8 +14216,7 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 5 to 6 outputs - VMOVDQU (R9), Y9 - ADDQ $0x20, R9 + VMOVDQU (R10)(R13*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -15729,8 +14258,7 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 6 to 6 outputs - VMOVDQU (R10), Y9 - ADDQ $0x20, R10 + VMOVDQU (R11)(R13*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -15772,8 +14300,7 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 7 to 6 outputs - VMOVDQU (R11), Y9 - ADDQ $0x20, R11 + VMOVDQU (R12)(R13*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -15815,8 +14342,7 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 8 to 6 outputs - VMOVDQU (DX), Y9 - ADDQ $0x20, DX + VMOVDQU (BX)(R13*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -15858,17 +14384,17 @@ mulAvxTwo_9x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - MOVQ (R12), R14 + MOVQ (DX), R14 VMOVDQU Y0, (R14)(R13*1) - MOVQ 24(R12), R14 + MOVQ 24(DX), R14 VMOVDQU Y1, (R14)(R13*1) - MOVQ 48(R12), R14 + MOVQ 48(DX), R14 VMOVDQU Y2, (R14)(R13*1) - MOVQ 72(R12), R14 + MOVQ 72(DX), R14 VMOVDQU Y3, (R14)(R13*1) - MOVQ 96(R12), R14 + MOVQ 96(DX), R14 VMOVDQU Y4, (R14)(R13*1) - MOVQ 120(R12), R14 + MOVQ 120(DX), R14 VMOVDQU Y5, (R14)(R13*1) // Prepare for next loop @@ -15884,39 +14410,27 @@ mulAvxTwo_9x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_9x7(SB), $0-88 // Loading no tables to registers - // Destination kept on stack // Full registers estimated 138 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_9x7_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), R11 - MOVQ 192(DX), DX - MOVQ out_base+48(FP), R12 - MOVQ start+72(FP), R13 - - // Add start offset to input - ADDQ R13, BX - ADDQ R13, BP - ADDQ R13, SI - ADDQ R13, DI - ADDQ R13, R8 - ADDQ R13, R9 - ADDQ R13, R10 - ADDQ R13, R11 - ADDQ R13, DX - MOVQ $0x0000000f, R14 - MOVQ R14, X7 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_9x7_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), R12 + MOVQ 192(BX), BX + MOVQ $0x0000000f, R13 + MOVQ R13, X7 VPBROADCASTB X7, Y7 + MOVQ start+72(FP), R13 mulAvxTwo_9x7_loop: // Clear 7 outputs @@ -15929,8 +14443,7 @@ mulAvxTwo_9x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (BX), Y10 - ADDQ $0x20, BX + VMOVDQU (BP)(R13*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -15978,8 +14491,7 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (BP), Y10 - ADDQ $0x20, BP + VMOVDQU (SI)(R13*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -16027,8 +14539,7 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 2 to 7 outputs - VMOVDQU (SI), Y10 - ADDQ $0x20, SI + VMOVDQU (DI)(R13*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -16076,8 +14587,7 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 3 to 7 outputs - VMOVDQU (DI), Y10 - ADDQ $0x20, DI + VMOVDQU (R8)(R13*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -16125,8 +14635,7 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 4 to 7 outputs - VMOVDQU (R8), Y10 - ADDQ $0x20, R8 + VMOVDQU (R9)(R13*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -16174,8 +14683,7 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 5 to 7 outputs - VMOVDQU (R9), Y10 - ADDQ $0x20, R9 + VMOVDQU (R10)(R13*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -16223,8 +14731,7 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 6 to 7 outputs - VMOVDQU (R10), Y10 - ADDQ $0x20, R10 + VMOVDQU (R11)(R13*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -16272,8 +14779,7 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 7 to 7 outputs - VMOVDQU (R11), Y10 - ADDQ $0x20, R11 + VMOVDQU (R12)(R13*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -16321,8 +14827,7 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 8 to 7 outputs - VMOVDQU (DX), Y10 - ADDQ $0x20, DX + VMOVDQU (BX)(R13*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -16370,19 +14875,19 @@ mulAvxTwo_9x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - MOVQ (R12), R14 + MOVQ (DX), R14 VMOVDQU Y0, (R14)(R13*1) - MOVQ 24(R12), R14 + MOVQ 24(DX), R14 VMOVDQU Y1, (R14)(R13*1) - MOVQ 48(R12), R14 + MOVQ 48(DX), R14 VMOVDQU Y2, (R14)(R13*1) - MOVQ 72(R12), R14 + MOVQ 72(DX), R14 VMOVDQU Y3, (R14)(R13*1) - MOVQ 96(R12), R14 + MOVQ 96(DX), R14 VMOVDQU Y4, (R14)(R13*1) - MOVQ 120(R12), R14 + MOVQ 120(DX), R14 VMOVDQU Y5, (R14)(R13*1) - MOVQ 144(R12), R14 + MOVQ 144(DX), R14 VMOVDQU Y6, (R14)(R13*1) // Prepare for next loop @@ -16398,39 +14903,27 @@ mulAvxTwo_9x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_9x8(SB), $0-88 // Loading no tables to registers - // Destination kept on stack // Full registers estimated 157 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_9x8_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), R11 - MOVQ 192(DX), DX - MOVQ out_base+48(FP), R12 - MOVQ start+72(FP), R13 - - // Add start offset to input - ADDQ R13, BX - ADDQ R13, BP - ADDQ R13, SI - ADDQ R13, DI - ADDQ R13, R8 - ADDQ R13, R9 - ADDQ R13, R10 - ADDQ R13, R11 - ADDQ R13, DX - MOVQ $0x0000000f, R14 - MOVQ R14, X8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_9x8_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), R12 + MOVQ 192(BX), BX + MOVQ $0x0000000f, R13 + MOVQ R13, X8 VPBROADCASTB X8, Y8 + MOVQ start+72(FP), R13 mulAvxTwo_9x8_loop: // Clear 8 outputs @@ -16444,8 +14937,7 @@ mulAvxTwo_9x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (BX), Y11 - ADDQ $0x20, BX + VMOVDQU (BP)(R13*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -16499,8 +14991,7 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (BP), Y11 - ADDQ $0x20, BP + VMOVDQU (SI)(R13*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -16554,8 +15045,7 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 2 to 8 outputs - VMOVDQU (SI), Y11 - ADDQ $0x20, SI + VMOVDQU (DI)(R13*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -16609,8 +15099,7 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 3 to 8 outputs - VMOVDQU (DI), Y11 - ADDQ $0x20, DI + VMOVDQU (R8)(R13*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -16664,8 +15153,7 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 4 to 8 outputs - VMOVDQU (R8), Y11 - ADDQ $0x20, R8 + VMOVDQU (R9)(R13*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -16719,8 +15207,7 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 5 to 8 outputs - VMOVDQU (R9), Y11 - ADDQ $0x20, R9 + VMOVDQU (R10)(R13*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -16774,8 +15261,7 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 6 to 8 outputs - VMOVDQU (R10), Y11 - ADDQ $0x20, R10 + VMOVDQU (R11)(R13*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -16829,8 +15315,7 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 7 to 8 outputs - VMOVDQU (R11), Y11 - ADDQ $0x20, R11 + VMOVDQU (R12)(R13*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -16884,8 +15369,7 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 8 to 8 outputs - VMOVDQU (DX), Y11 - ADDQ $0x20, DX + VMOVDQU (BX)(R13*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -16939,21 +15423,21 @@ mulAvxTwo_9x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - MOVQ (R12), R14 + MOVQ (DX), R14 VMOVDQU Y0, (R14)(R13*1) - MOVQ 24(R12), R14 + MOVQ 24(DX), R14 VMOVDQU Y1, (R14)(R13*1) - MOVQ 48(R12), R14 + MOVQ 48(DX), R14 VMOVDQU Y2, (R14)(R13*1) - MOVQ 72(R12), R14 + MOVQ 72(DX), R14 VMOVDQU Y3, (R14)(R13*1) - MOVQ 96(R12), R14 + MOVQ 96(DX), R14 VMOVDQU Y4, (R14)(R13*1) - MOVQ 120(R12), R14 + MOVQ 120(DX), R14 VMOVDQU Y5, (R14)(R13*1) - MOVQ 144(R12), R14 + MOVQ 144(DX), R14 VMOVDQU Y6, (R14)(R13*1) - MOVQ 168(R12), R14 + MOVQ 168(DX), R14 VMOVDQU Y7, (R14)(R13*1) // Prepare for next loop @@ -16969,53 +15453,36 @@ mulAvxTwo_9x8_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_10x1(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 24 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_10x1_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), R11 - MOVQ 192(DX), R12 - MOVQ 216(DX), DX - MOVQ out_base+48(FP), R13 - MOVQ (R13), R13 - MOVQ start+72(FP), R14 - - // Add start offset to output - ADDQ R14, R13 - - // Add start offset to input - ADDQ R14, BX - ADDQ R14, BP - ADDQ R14, SI - ADDQ R14, DI - ADDQ R14, R8 - ADDQ R14, R9 - ADDQ R14, R10 - ADDQ R14, R11 - ADDQ R14, R12 - ADDQ R14, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_10x1_end + MOVQ out_base+48(FP), DX + MOVQ (DX), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), R12 + MOVQ 192(BX), R13 + MOVQ 216(BX), BX MOVQ $0x0000000f, R14 MOVQ R14, X1 VPBROADCASTB X1, Y1 + MOVQ start+72(FP), R14 mulAvxTwo_10x1_loop: // Clear 1 outputs VPXOR Y0, Y0, Y0 // Load and process 32 bytes from input 0 to 1 outputs - VMOVDQU (BX), Y4 - ADDQ $0x20, BX + VMOVDQU (BP)(R14*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -17027,8 +15494,7 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 1 to 1 outputs - VMOVDQU (BP), Y4 - ADDQ $0x20, BP + VMOVDQU (SI)(R14*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -17040,8 +15506,7 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 2 to 1 outputs - VMOVDQU (SI), Y4 - ADDQ $0x20, SI + VMOVDQU (DI)(R14*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -17053,8 +15518,7 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 3 to 1 outputs - VMOVDQU (DI), Y4 - ADDQ $0x20, DI + VMOVDQU (R8)(R14*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -17066,8 +15530,7 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 4 to 1 outputs - VMOVDQU (R8), Y4 - ADDQ $0x20, R8 + VMOVDQU (R9)(R14*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -17079,8 +15542,7 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 5 to 1 outputs - VMOVDQU (R9), Y4 - ADDQ $0x20, R9 + VMOVDQU (R10)(R14*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -17092,8 +15554,7 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 6 to 1 outputs - VMOVDQU (R10), Y4 - ADDQ $0x20, R10 + VMOVDQU (R11)(R14*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -17105,8 +15566,7 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 7 to 1 outputs - VMOVDQU (R11), Y4 - ADDQ $0x20, R11 + VMOVDQU (R12)(R14*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -17118,8 +15578,7 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 8 to 1 outputs - VMOVDQU (R12), Y4 - ADDQ $0x20, R12 + VMOVDQU (R13)(R14*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -17131,8 +15590,7 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Load and process 32 bytes from input 9 to 1 outputs - VMOVDQU (DX), Y4 - ADDQ $0x20, DX + VMOVDQU (BX)(R14*1), Y4 VPSRLQ $0x04, Y4, Y5 VPAND Y1, Y4, Y4 VPAND Y1, Y5, Y5 @@ -17144,10 +15602,10 @@ mulAvxTwo_10x1_loop: VPXOR Y2, Y0, Y0 // Store 1 outputs - VMOVDQU Y0, (R13) - ADDQ $0x20, R13 + VMOVDQU Y0, (DX)(R14*1) // Prepare for next loop + ADDQ $0x20, R14 DECQ AX JNZ mulAvxTwo_10x1_loop VZEROUPPER @@ -17159,47 +15617,30 @@ mulAvxTwo_10x1_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_10x2(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 47 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_10x2_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), R11 - MOVQ 192(DX), R12 - MOVQ 216(DX), DX - MOVQ out_base+48(FP), R13 - MOVQ (R13), R14 - MOVQ 24(R13), R13 - MOVQ start+72(FP), R15 - - // Add start offset to output - ADDQ R15, R14 - ADDQ R15, R13 - - // Add start offset to input - ADDQ R15, BX - ADDQ R15, BP - ADDQ R15, SI - ADDQ R15, DI - ADDQ R15, R8 - ADDQ R15, R9 - ADDQ R15, R10 - ADDQ R15, R11 - ADDQ R15, R12 - ADDQ R15, DX + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_10x2_end + MOVQ out_base+48(FP), DX + MOVQ (DX), BX + MOVQ 24(DX), DX + MOVQ in_base+24(FP), BP + MOVQ (BP), SI + MOVQ 24(BP), DI + MOVQ 48(BP), R8 + MOVQ 72(BP), R9 + MOVQ 96(BP), R10 + MOVQ 120(BP), R11 + MOVQ 144(BP), R12 + MOVQ 168(BP), R13 + MOVQ 192(BP), R14 + MOVQ 216(BP), BP MOVQ $0x0000000f, R15 MOVQ R15, X2 VPBROADCASTB X2, Y2 + MOVQ start+72(FP), R15 mulAvxTwo_10x2_loop: // Clear 2 outputs @@ -17207,8 +15648,7 @@ mulAvxTwo_10x2_loop: VPXOR Y1, Y1, Y1 // Load and process 32 bytes from input 0 to 2 outputs - VMOVDQU (BX), Y5 - ADDQ $0x20, BX + VMOVDQU (SI)(R15*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -17226,8 +15666,7 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 1 to 2 outputs - VMOVDQU (BP), Y5 - ADDQ $0x20, BP + VMOVDQU (DI)(R15*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -17245,8 +15684,7 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 2 to 2 outputs - VMOVDQU (SI), Y5 - ADDQ $0x20, SI + VMOVDQU (R8)(R15*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -17264,8 +15702,7 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 3 to 2 outputs - VMOVDQU (DI), Y5 - ADDQ $0x20, DI + VMOVDQU (R9)(R15*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -17283,8 +15720,7 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 4 to 2 outputs - VMOVDQU (R8), Y5 - ADDQ $0x20, R8 + VMOVDQU (R10)(R15*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -17302,8 +15738,7 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 5 to 2 outputs - VMOVDQU (R9), Y5 - ADDQ $0x20, R9 + VMOVDQU (R11)(R15*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -17321,8 +15756,7 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 6 to 2 outputs - VMOVDQU (R10), Y5 - ADDQ $0x20, R10 + VMOVDQU (R12)(R15*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -17340,8 +15774,7 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 7 to 2 outputs - VMOVDQU (R11), Y5 - ADDQ $0x20, R11 + VMOVDQU (R13)(R15*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -17359,8 +15792,7 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 8 to 2 outputs - VMOVDQU (R12), Y5 - ADDQ $0x20, R12 + VMOVDQU (R14)(R15*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -17378,8 +15810,7 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Load and process 32 bytes from input 9 to 2 outputs - VMOVDQU (DX), Y5 - ADDQ $0x20, DX + VMOVDQU (BP)(R15*1), Y5 VPSRLQ $0x04, Y5, Y6 VPAND Y2, Y5, Y5 VPAND Y2, Y6, Y6 @@ -17397,12 +15828,11 @@ mulAvxTwo_10x2_loop: VPXOR Y3, Y1, Y1 // Store 2 outputs - VMOVDQU Y0, (R14) - ADDQ $0x20, R14 - VMOVDQU Y1, (R13) - ADDQ $0x20, R13 + VMOVDQU Y0, (BX)(R15*1) + VMOVDQU Y1, (DX)(R15*1) // Prepare for next loop + ADDQ $0x20, R15 DECQ AX JNZ mulAvxTwo_10x2_loop VZEROUPPER @@ -17414,51 +15844,28 @@ mulAvxTwo_10x2_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_10x3(SB), $0-88 // Loading no tables to registers - // Destination kept in GP registers // Full registers estimated 68 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_10x3_end - MOVQ in_base+24(FP), AX - MOVQ (AX), DX - MOVQ 24(AX), BX - MOVQ 48(AX), BP - MOVQ 72(AX), SI - MOVQ 96(AX), DI - MOVQ 120(AX), R8 - MOVQ 144(AX), R9 - MOVQ 168(AX), R10 - MOVQ 192(AX), R11 - MOVQ 216(AX), AX - MOVQ out_base+48(FP), R12 - MOVQ (R12), R13 - MOVQ 24(R12), R14 - MOVQ 48(R12), R12 - MOVQ start+72(FP), R15 - - // Add start offset to output - ADDQ R15, R13 - ADDQ R15, R14 - ADDQ R15, R12 - - // Add start offset to input - ADDQ R15, DX - ADDQ R15, BX - ADDQ R15, BP - ADDQ R15, SI - ADDQ R15, DI - ADDQ R15, R8 - ADDQ R15, R9 - ADDQ R15, R10 - ADDQ R15, R11 - ADDQ R15, AX - MOVQ $0x0000000f, R15 - MOVQ R15, X3 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_10x3_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), R12 + MOVQ 192(BX), R13 + MOVQ 216(BX), BX + MOVQ $0x0000000f, R14 + MOVQ R14, X3 VPBROADCASTB X3, Y3 - MOVQ n+80(FP), R15 - SHRQ $0x05, R15 + MOVQ start+72(FP), R14 mulAvxTwo_10x3_loop: // Clear 3 outputs @@ -17467,8 +15874,7 @@ mulAvxTwo_10x3_loop: VPXOR Y2, Y2, Y2 // Load and process 32 bytes from input 0 to 3 outputs - VMOVDQU (DX), Y6 - ADDQ $0x20, DX + VMOVDQU (BP)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -17492,8 +15898,7 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 1 to 3 outputs - VMOVDQU (BX), Y6 - ADDQ $0x20, BX + VMOVDQU (SI)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -17517,8 +15922,7 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 2 to 3 outputs - VMOVDQU (BP), Y6 - ADDQ $0x20, BP + VMOVDQU (DI)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -17542,8 +15946,7 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 3 to 3 outputs - VMOVDQU (SI), Y6 - ADDQ $0x20, SI + VMOVDQU (R8)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -17567,8 +15970,7 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 4 to 3 outputs - VMOVDQU (DI), Y6 - ADDQ $0x20, DI + VMOVDQU (R9)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -17592,8 +15994,7 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 5 to 3 outputs - VMOVDQU (R8), Y6 - ADDQ $0x20, R8 + VMOVDQU (R10)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -17617,8 +16018,7 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 6 to 3 outputs - VMOVDQU (R9), Y6 - ADDQ $0x20, R9 + VMOVDQU (R11)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -17642,8 +16042,7 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 7 to 3 outputs - VMOVDQU (R10), Y6 - ADDQ $0x20, R10 + VMOVDQU (R12)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -17667,8 +16066,7 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 8 to 3 outputs - VMOVDQU (R11), Y6 - ADDQ $0x20, R11 + VMOVDQU (R13)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -17692,8 +16090,7 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Load and process 32 bytes from input 9 to 3 outputs - VMOVDQU (AX), Y6 - ADDQ $0x20, AX + VMOVDQU (BX)(R14*1), Y6 VPSRLQ $0x04, Y6, Y7 VPAND Y3, Y6, Y6 VPAND Y3, Y7, Y7 @@ -17717,15 +16114,16 @@ mulAvxTwo_10x3_loop: VPXOR Y4, Y2, Y2 // Store 3 outputs - VMOVDQU Y0, (R13) - ADDQ $0x20, R13 - VMOVDQU Y1, (R14) - ADDQ $0x20, R14 - VMOVDQU Y2, (R12) - ADDQ $0x20, R12 + MOVQ (DX), R15 + VMOVDQU Y0, (R15)(R14*1) + MOVQ 24(DX), R15 + VMOVDQU Y1, (R15)(R14*1) + MOVQ 48(DX), R15 + VMOVDQU Y2, (R15)(R14*1) // Prepare for next loop - DECQ R15 + ADDQ $0x20, R14 + DECQ AX JNZ mulAvxTwo_10x3_loop VZEROUPPER @@ -17736,41 +16134,28 @@ mulAvxTwo_10x3_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_10x4(SB), $0-88 // Loading no tables to registers - // Destination kept on stack // Full registers estimated 89 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_10x4_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), R11 - MOVQ 192(DX), R12 - MOVQ 216(DX), DX - MOVQ out_base+48(FP), R13 - MOVQ start+72(FP), R14 - - // Add start offset to input - ADDQ R14, BX - ADDQ R14, BP - ADDQ R14, SI - ADDQ R14, DI - ADDQ R14, R8 - ADDQ R14, R9 - ADDQ R14, R10 - ADDQ R14, R11 - ADDQ R14, R12 - ADDQ R14, DX - MOVQ $0x0000000f, R15 - MOVQ R15, X4 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_10x4_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), R12 + MOVQ 192(BX), R13 + MOVQ 216(BX), BX + MOVQ $0x0000000f, R14 + MOVQ R14, X4 VPBROADCASTB X4, Y4 + MOVQ start+72(FP), R14 mulAvxTwo_10x4_loop: // Clear 4 outputs @@ -17780,8 +16165,7 @@ mulAvxTwo_10x4_loop: VPXOR Y3, Y3, Y3 // Load and process 32 bytes from input 0 to 4 outputs - VMOVDQU (BX), Y7 - ADDQ $0x20, BX + VMOVDQU (BP)(R14*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -17811,8 +16195,7 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 1 to 4 outputs - VMOVDQU (BP), Y7 - ADDQ $0x20, BP + VMOVDQU (SI)(R14*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -17842,8 +16225,7 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 2 to 4 outputs - VMOVDQU (SI), Y7 - ADDQ $0x20, SI + VMOVDQU (DI)(R14*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -17873,8 +16255,7 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 3 to 4 outputs - VMOVDQU (DI), Y7 - ADDQ $0x20, DI + VMOVDQU (R8)(R14*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -17904,8 +16285,7 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 4 to 4 outputs - VMOVDQU (R8), Y7 - ADDQ $0x20, R8 + VMOVDQU (R9)(R14*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -17935,8 +16315,7 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 5 to 4 outputs - VMOVDQU (R9), Y7 - ADDQ $0x20, R9 + VMOVDQU (R10)(R14*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -17966,8 +16345,7 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 6 to 4 outputs - VMOVDQU (R10), Y7 - ADDQ $0x20, R10 + VMOVDQU (R11)(R14*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -17997,8 +16375,7 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 7 to 4 outputs - VMOVDQU (R11), Y7 - ADDQ $0x20, R11 + VMOVDQU (R12)(R14*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -18028,8 +16405,7 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 8 to 4 outputs - VMOVDQU (R12), Y7 - ADDQ $0x20, R12 + VMOVDQU (R13)(R14*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -18059,8 +16435,7 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Load and process 32 bytes from input 9 to 4 outputs - VMOVDQU (DX), Y7 - ADDQ $0x20, DX + VMOVDQU (BX)(R14*1), Y7 VPSRLQ $0x04, Y7, Y8 VPAND Y4, Y7, Y7 VPAND Y4, Y8, Y8 @@ -18090,13 +16465,13 @@ mulAvxTwo_10x4_loop: VPXOR Y5, Y3, Y3 // Store 4 outputs - MOVQ (R13), R15 + MOVQ (DX), R15 VMOVDQU Y0, (R15)(R14*1) - MOVQ 24(R13), R15 + MOVQ 24(DX), R15 VMOVDQU Y1, (R15)(R14*1) - MOVQ 48(R13), R15 + MOVQ 48(DX), R15 VMOVDQU Y2, (R15)(R14*1) - MOVQ 72(R13), R15 + MOVQ 72(DX), R15 VMOVDQU Y3, (R15)(R14*1) // Prepare for next loop @@ -18112,41 +16487,28 @@ mulAvxTwo_10x4_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_10x5(SB), $0-88 // Loading no tables to registers - // Destination kept on stack // Full registers estimated 110 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_10x5_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), R11 - MOVQ 192(DX), R12 - MOVQ 216(DX), DX - MOVQ out_base+48(FP), R13 - MOVQ start+72(FP), R14 - - // Add start offset to input - ADDQ R14, BX - ADDQ R14, BP - ADDQ R14, SI - ADDQ R14, DI - ADDQ R14, R8 - ADDQ R14, R9 - ADDQ R14, R10 - ADDQ R14, R11 - ADDQ R14, R12 - ADDQ R14, DX - MOVQ $0x0000000f, R15 - MOVQ R15, X5 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_10x5_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), R12 + MOVQ 192(BX), R13 + MOVQ 216(BX), BX + MOVQ $0x0000000f, R14 + MOVQ R14, X5 VPBROADCASTB X5, Y5 + MOVQ start+72(FP), R14 mulAvxTwo_10x5_loop: // Clear 5 outputs @@ -18157,8 +16519,7 @@ mulAvxTwo_10x5_loop: VPXOR Y4, Y4, Y4 // Load and process 32 bytes from input 0 to 5 outputs - VMOVDQU (BX), Y8 - ADDQ $0x20, BX + VMOVDQU (BP)(R14*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -18194,8 +16555,7 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 1 to 5 outputs - VMOVDQU (BP), Y8 - ADDQ $0x20, BP + VMOVDQU (SI)(R14*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -18231,8 +16591,7 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 2 to 5 outputs - VMOVDQU (SI), Y8 - ADDQ $0x20, SI + VMOVDQU (DI)(R14*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -18268,8 +16627,7 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 3 to 5 outputs - VMOVDQU (DI), Y8 - ADDQ $0x20, DI + VMOVDQU (R8)(R14*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -18305,8 +16663,7 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 4 to 5 outputs - VMOVDQU (R8), Y8 - ADDQ $0x20, R8 + VMOVDQU (R9)(R14*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -18342,8 +16699,7 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 5 to 5 outputs - VMOVDQU (R9), Y8 - ADDQ $0x20, R9 + VMOVDQU (R10)(R14*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -18379,8 +16735,7 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 6 to 5 outputs - VMOVDQU (R10), Y8 - ADDQ $0x20, R10 + VMOVDQU (R11)(R14*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -18416,8 +16771,7 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 7 to 5 outputs - VMOVDQU (R11), Y8 - ADDQ $0x20, R11 + VMOVDQU (R12)(R14*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -18453,8 +16807,7 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 8 to 5 outputs - VMOVDQU (R12), Y8 - ADDQ $0x20, R12 + VMOVDQU (R13)(R14*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -18490,8 +16843,7 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Load and process 32 bytes from input 9 to 5 outputs - VMOVDQU (DX), Y8 - ADDQ $0x20, DX + VMOVDQU (BX)(R14*1), Y8 VPSRLQ $0x04, Y8, Y9 VPAND Y5, Y8, Y8 VPAND Y5, Y9, Y9 @@ -18527,15 +16879,15 @@ mulAvxTwo_10x5_loop: VPXOR Y6, Y4, Y4 // Store 5 outputs - MOVQ (R13), R15 + MOVQ (DX), R15 VMOVDQU Y0, (R15)(R14*1) - MOVQ 24(R13), R15 + MOVQ 24(DX), R15 VMOVDQU Y1, (R15)(R14*1) - MOVQ 48(R13), R15 + MOVQ 48(DX), R15 VMOVDQU Y2, (R15)(R14*1) - MOVQ 72(R13), R15 + MOVQ 72(DX), R15 VMOVDQU Y3, (R15)(R14*1) - MOVQ 96(R13), R15 + MOVQ 96(DX), R15 VMOVDQU Y4, (R15)(R14*1) // Prepare for next loop @@ -18551,41 +16903,28 @@ mulAvxTwo_10x5_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_10x6(SB), $0-88 // Loading no tables to registers - // Destination kept on stack // Full registers estimated 131 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_10x6_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), R11 - MOVQ 192(DX), R12 - MOVQ 216(DX), DX - MOVQ out_base+48(FP), R13 - MOVQ start+72(FP), R14 - - // Add start offset to input - ADDQ R14, BX - ADDQ R14, BP - ADDQ R14, SI - ADDQ R14, DI - ADDQ R14, R8 - ADDQ R14, R9 - ADDQ R14, R10 - ADDQ R14, R11 - ADDQ R14, R12 - ADDQ R14, DX - MOVQ $0x0000000f, R15 - MOVQ R15, X6 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_10x6_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), R12 + MOVQ 192(BX), R13 + MOVQ 216(BX), BX + MOVQ $0x0000000f, R14 + MOVQ R14, X6 VPBROADCASTB X6, Y6 + MOVQ start+72(FP), R14 mulAvxTwo_10x6_loop: // Clear 6 outputs @@ -18597,8 +16936,7 @@ mulAvxTwo_10x6_loop: VPXOR Y5, Y5, Y5 // Load and process 32 bytes from input 0 to 6 outputs - VMOVDQU (BX), Y9 - ADDQ $0x20, BX + VMOVDQU (BP)(R14*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -18640,8 +16978,7 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 1 to 6 outputs - VMOVDQU (BP), Y9 - ADDQ $0x20, BP + VMOVDQU (SI)(R14*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -18683,8 +17020,7 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 2 to 6 outputs - VMOVDQU (SI), Y9 - ADDQ $0x20, SI + VMOVDQU (DI)(R14*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -18726,8 +17062,7 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 3 to 6 outputs - VMOVDQU (DI), Y9 - ADDQ $0x20, DI + VMOVDQU (R8)(R14*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -18769,8 +17104,7 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 4 to 6 outputs - VMOVDQU (R8), Y9 - ADDQ $0x20, R8 + VMOVDQU (R9)(R14*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -18812,8 +17146,7 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 5 to 6 outputs - VMOVDQU (R9), Y9 - ADDQ $0x20, R9 + VMOVDQU (R10)(R14*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -18855,8 +17188,7 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 6 to 6 outputs - VMOVDQU (R10), Y9 - ADDQ $0x20, R10 + VMOVDQU (R11)(R14*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -18898,8 +17230,7 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 7 to 6 outputs - VMOVDQU (R11), Y9 - ADDQ $0x20, R11 + VMOVDQU (R12)(R14*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -18941,8 +17272,7 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 8 to 6 outputs - VMOVDQU (R12), Y9 - ADDQ $0x20, R12 + VMOVDQU (R13)(R14*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -18984,8 +17314,7 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Load and process 32 bytes from input 9 to 6 outputs - VMOVDQU (DX), Y9 - ADDQ $0x20, DX + VMOVDQU (BX)(R14*1), Y9 VPSRLQ $0x04, Y9, Y10 VPAND Y6, Y9, Y9 VPAND Y6, Y10, Y10 @@ -19027,17 +17356,17 @@ mulAvxTwo_10x6_loop: VPXOR Y7, Y5, Y5 // Store 6 outputs - MOVQ (R13), R15 + MOVQ (DX), R15 VMOVDQU Y0, (R15)(R14*1) - MOVQ 24(R13), R15 + MOVQ 24(DX), R15 VMOVDQU Y1, (R15)(R14*1) - MOVQ 48(R13), R15 + MOVQ 48(DX), R15 VMOVDQU Y2, (R15)(R14*1) - MOVQ 72(R13), R15 + MOVQ 72(DX), R15 VMOVDQU Y3, (R15)(R14*1) - MOVQ 96(R13), R15 + MOVQ 96(DX), R15 VMOVDQU Y4, (R15)(R14*1) - MOVQ 120(R13), R15 + MOVQ 120(DX), R15 VMOVDQU Y5, (R15)(R14*1) // Prepare for next loop @@ -19053,41 +17382,28 @@ mulAvxTwo_10x6_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_10x7(SB), $0-88 // Loading no tables to registers - // Destination kept on stack // Full registers estimated 152 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_10x7_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), R11 - MOVQ 192(DX), R12 - MOVQ 216(DX), DX - MOVQ out_base+48(FP), R13 - MOVQ start+72(FP), R14 - - // Add start offset to input - ADDQ R14, BX - ADDQ R14, BP - ADDQ R14, SI - ADDQ R14, DI - ADDQ R14, R8 - ADDQ R14, R9 - ADDQ R14, R10 - ADDQ R14, R11 - ADDQ R14, R12 - ADDQ R14, DX - MOVQ $0x0000000f, R15 - MOVQ R15, X7 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_10x7_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), R12 + MOVQ 192(BX), R13 + MOVQ 216(BX), BX + MOVQ $0x0000000f, R14 + MOVQ R14, X7 VPBROADCASTB X7, Y7 + MOVQ start+72(FP), R14 mulAvxTwo_10x7_loop: // Clear 7 outputs @@ -19100,8 +17416,7 @@ mulAvxTwo_10x7_loop: VPXOR Y6, Y6, Y6 // Load and process 32 bytes from input 0 to 7 outputs - VMOVDQU (BX), Y10 - ADDQ $0x20, BX + VMOVDQU (BP)(R14*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -19149,8 +17464,7 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 1 to 7 outputs - VMOVDQU (BP), Y10 - ADDQ $0x20, BP + VMOVDQU (SI)(R14*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -19198,8 +17512,7 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 2 to 7 outputs - VMOVDQU (SI), Y10 - ADDQ $0x20, SI + VMOVDQU (DI)(R14*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -19247,8 +17560,7 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 3 to 7 outputs - VMOVDQU (DI), Y10 - ADDQ $0x20, DI + VMOVDQU (R8)(R14*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -19296,8 +17608,7 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 4 to 7 outputs - VMOVDQU (R8), Y10 - ADDQ $0x20, R8 + VMOVDQU (R9)(R14*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -19345,8 +17656,7 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 5 to 7 outputs - VMOVDQU (R9), Y10 - ADDQ $0x20, R9 + VMOVDQU (R10)(R14*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -19394,8 +17704,7 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 6 to 7 outputs - VMOVDQU (R10), Y10 - ADDQ $0x20, R10 + VMOVDQU (R11)(R14*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -19443,8 +17752,7 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 7 to 7 outputs - VMOVDQU (R11), Y10 - ADDQ $0x20, R11 + VMOVDQU (R12)(R14*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -19492,8 +17800,7 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 8 to 7 outputs - VMOVDQU (R12), Y10 - ADDQ $0x20, R12 + VMOVDQU (R13)(R14*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -19541,8 +17848,7 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Load and process 32 bytes from input 9 to 7 outputs - VMOVDQU (DX), Y10 - ADDQ $0x20, DX + VMOVDQU (BX)(R14*1), Y10 VPSRLQ $0x04, Y10, Y11 VPAND Y7, Y10, Y10 VPAND Y7, Y11, Y11 @@ -19590,19 +17896,19 @@ mulAvxTwo_10x7_loop: VPXOR Y8, Y6, Y6 // Store 7 outputs - MOVQ (R13), R15 + MOVQ (DX), R15 VMOVDQU Y0, (R15)(R14*1) - MOVQ 24(R13), R15 + MOVQ 24(DX), R15 VMOVDQU Y1, (R15)(R14*1) - MOVQ 48(R13), R15 + MOVQ 48(DX), R15 VMOVDQU Y2, (R15)(R14*1) - MOVQ 72(R13), R15 + MOVQ 72(DX), R15 VMOVDQU Y3, (R15)(R14*1) - MOVQ 96(R13), R15 + MOVQ 96(DX), R15 VMOVDQU Y4, (R15)(R14*1) - MOVQ 120(R13), R15 + MOVQ 120(DX), R15 VMOVDQU Y5, (R15)(R14*1) - MOVQ 144(R13), R15 + MOVQ 144(DX), R15 VMOVDQU Y6, (R15)(R14*1) // Prepare for next loop @@ -19618,41 +17924,28 @@ mulAvxTwo_10x7_end: // Requires: AVX, AVX2, SSE2 TEXT ·mulAvxTwo_10x8(SB), $0-88 // Loading no tables to registers - // Destination kept on stack // Full registers estimated 173 YMM used - MOVQ n+80(FP), AX - MOVQ matrix_base+0(FP), CX - SHRQ $0x05, AX - TESTQ AX, AX - JZ mulAvxTwo_10x8_end - MOVQ in_base+24(FP), DX - MOVQ (DX), BX - MOVQ 24(DX), BP - MOVQ 48(DX), SI - MOVQ 72(DX), DI - MOVQ 96(DX), R8 - MOVQ 120(DX), R9 - MOVQ 144(DX), R10 - MOVQ 168(DX), R11 - MOVQ 192(DX), R12 - MOVQ 216(DX), DX - MOVQ out_base+48(FP), R13 - MOVQ start+72(FP), R14 - - // Add start offset to input - ADDQ R14, BX - ADDQ R14, BP - ADDQ R14, SI - ADDQ R14, DI - ADDQ R14, R8 - ADDQ R14, R9 - ADDQ R14, R10 - ADDQ R14, R11 - ADDQ R14, R12 - ADDQ R14, DX - MOVQ $0x0000000f, R15 - MOVQ R15, X8 + MOVQ n+80(FP), AX + MOVQ matrix_base+0(FP), CX + SHRQ $0x05, AX + TESTQ AX, AX + JZ mulAvxTwo_10x8_end + MOVQ out_base+48(FP), DX + MOVQ in_base+24(FP), BX + MOVQ (BX), BP + MOVQ 24(BX), SI + MOVQ 48(BX), DI + MOVQ 72(BX), R8 + MOVQ 96(BX), R9 + MOVQ 120(BX), R10 + MOVQ 144(BX), R11 + MOVQ 168(BX), R12 + MOVQ 192(BX), R13 + MOVQ 216(BX), BX + MOVQ $0x0000000f, R14 + MOVQ R14, X8 VPBROADCASTB X8, Y8 + MOVQ start+72(FP), R14 mulAvxTwo_10x8_loop: // Clear 8 outputs @@ -19666,8 +17959,7 @@ mulAvxTwo_10x8_loop: VPXOR Y7, Y7, Y7 // Load and process 32 bytes from input 0 to 8 outputs - VMOVDQU (BX), Y11 - ADDQ $0x20, BX + VMOVDQU (BP)(R14*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -19721,8 +18013,7 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 1 to 8 outputs - VMOVDQU (BP), Y11 - ADDQ $0x20, BP + VMOVDQU (SI)(R14*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -19776,8 +18067,7 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 2 to 8 outputs - VMOVDQU (SI), Y11 - ADDQ $0x20, SI + VMOVDQU (DI)(R14*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -19831,8 +18121,7 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 3 to 8 outputs - VMOVDQU (DI), Y11 - ADDQ $0x20, DI + VMOVDQU (R8)(R14*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -19886,8 +18175,7 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 4 to 8 outputs - VMOVDQU (R8), Y11 - ADDQ $0x20, R8 + VMOVDQU (R9)(R14*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -19941,8 +18229,7 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 5 to 8 outputs - VMOVDQU (R9), Y11 - ADDQ $0x20, R9 + VMOVDQU (R10)(R14*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -19996,8 +18283,7 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 6 to 8 outputs - VMOVDQU (R10), Y11 - ADDQ $0x20, R10 + VMOVDQU (R11)(R14*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -20051,8 +18337,7 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 7 to 8 outputs - VMOVDQU (R11), Y11 - ADDQ $0x20, R11 + VMOVDQU (R12)(R14*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -20106,8 +18391,7 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 8 to 8 outputs - VMOVDQU (R12), Y11 - ADDQ $0x20, R12 + VMOVDQU (R13)(R14*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -20161,8 +18445,7 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Load and process 32 bytes from input 9 to 8 outputs - VMOVDQU (DX), Y11 - ADDQ $0x20, DX + VMOVDQU (BX)(R14*1), Y11 VPSRLQ $0x04, Y11, Y12 VPAND Y8, Y11, Y11 VPAND Y8, Y12, Y12 @@ -20216,21 +18499,21 @@ mulAvxTwo_10x8_loop: VPXOR Y9, Y7, Y7 // Store 8 outputs - MOVQ (R13), R15 + MOVQ (DX), R15 VMOVDQU Y0, (R15)(R14*1) - MOVQ 24(R13), R15 + MOVQ 24(DX), R15 VMOVDQU Y1, (R15)(R14*1) - MOVQ 48(R13), R15 + MOVQ 48(DX), R15 VMOVDQU Y2, (R15)(R14*1) - MOVQ 72(R13), R15 + MOVQ 72(DX), R15 VMOVDQU Y3, (R15)(R14*1) - MOVQ 96(R13), R15 + MOVQ 96(DX), R15 VMOVDQU Y4, (R15)(R14*1) - MOVQ 120(R13), R15 + MOVQ 120(DX), R15 VMOVDQU Y5, (R15)(R14*1) - MOVQ 144(R13), R15 + MOVQ 144(DX), R15 VMOVDQU Y6, (R15)(R14*1) - MOVQ 168(R13), R15 + MOVQ 168(DX), R15 VMOVDQU Y7, (R15)(R14*1) // Prepare for next loop diff --git a/vendor/github.com/klauspost/reedsolomon/gen.go b/vendor/github.com/klauspost/reedsolomon/gen.go new file mode 100644 index 0000000000..6fc545c47b --- /dev/null +++ b/vendor/github.com/klauspost/reedsolomon/gen.go @@ -0,0 +1,249 @@ +//+build generate + +//go:generate go run gen.go -out galois_gen_amd64.s -stubs galois_gen_amd64.go +//go:generate gofmt -w galois_gen_switch_amd64.go + +package main + +import ( + "bufio" + "fmt" + "os" + + . "github.com/mmcloughlin/avo/build" + "github.com/mmcloughlin/avo/buildtags" + . "github.com/mmcloughlin/avo/operand" + "github.com/mmcloughlin/avo/reg" +) + +// Technically we can do slightly bigger, but we stay reasonable. +const inputMax = 10 +const outputMax = 8 + +var switchDefs [inputMax][outputMax]string +var switchDefsX [inputMax][outputMax]string + +const perLoopBits = 5 +const perLoop = 1 << perLoopBits + +func main() { + Constraint(buildtags.Not("appengine").ToConstraint()) + Constraint(buildtags.Not("noasm").ToConstraint()) + Constraint(buildtags.Not("nogen").ToConstraint()) + Constraint(buildtags.Term("gc").ToConstraint()) + + for i := 1; i <= inputMax; i++ { + for j := 1; j <= outputMax; j++ { + //genMulAvx2(fmt.Sprintf("mulAvxTwoXor_%dx%d", i, j), i, j, true) + genMulAvx2(fmt.Sprintf("mulAvxTwo_%dx%d", i, j), i, j, false) + } + } + f, err := os.Create("galois_gen_switch_amd64.go") + if err != nil { + panic(err) + } + defer f.Close() + w := bufio.NewWriter(f) + defer w.Flush() + w.WriteString(`// Code generated by command: go generate ` + os.Getenv("GOFILE") + `. DO NOT EDIT. + +// +build !appengine +// +build !noasm +// +build gc +// +build !nogen + +package reedsolomon + +import "fmt" + +`) + + w.WriteString("const avx2CodeGen = true\n") + w.WriteString(fmt.Sprintf("const maxAvx2Inputs = %d\nconst maxAvx2Outputs = %d\n", inputMax, outputMax)) + w.WriteString(` + +func galMulSlicesAvx2(matrix []byte, in, out [][]byte, start, stop int) int { + n := stop-start +`) + + w.WriteString(fmt.Sprintf("n = (n>>%d)<<%d\n\n", perLoopBits, perLoopBits)) + w.WriteString(`switch len(in) { +`) + for in, defs := range switchDefs[:] { + w.WriteString(fmt.Sprintf(" case %d:\n switch len(out) {\n", in+1)) + for out, def := range defs[:] { + w.WriteString(fmt.Sprintf(" case %d:\n", out+1)) + w.WriteString(def) + } + w.WriteString("}\n") + } + w.WriteString(`} + panic(fmt.Sprintf("unhandled size: %dx%d", len(in), len(out))) +} +`) + Generate() +} + +func genMulAvx2(name string, inputs int, outputs int, xor bool) { + total := inputs * outputs + + doc := []string{ + fmt.Sprintf("%s takes %d inputs and produces %d outputs.", name, inputs, outputs), + } + if !xor { + doc = append(doc, "The output is initialized to 0.") + } + + // Load shuffle masks on every use. + var loadNone bool + // Use registers for destination registers. + var regDst = true + + // lo, hi, 1 in, 1 out, 2 tmp, 1 mask + est := total*2 + outputs + 5 + if outputs == 1 { + // We don't need to keep a copy of the input if only 1 output. + est -= 2 + } + + if est > 16 { + loadNone = true + // We run out of GP registers first, now. + if inputs+outputs > 12 { + regDst = false + } + } + + TEXT(name, 0, fmt.Sprintf("func(matrix []byte, in [][]byte, out [][]byte, start, n int)")) + + // SWITCH DEFINITION: + s := fmt.Sprintf(" mulAvxTwo_%dx%d(matrix, in, out, start, n)\n", inputs, outputs) + s += fmt.Sprintf("\t\t\t\treturn n\n") + switchDefs[inputs-1][outputs-1] = s + + if loadNone { + Comment("Loading no tables to registers") + } else { + // loadNone == false + Comment("Loading all tables to registers") + } + + Doc(doc...) + Pragma("noescape") + Commentf("Full registers estimated %d YMM used", est) + + length := Load(Param("n"), GP64()) + matrixBase := GP64() + MOVQ(Param("matrix").Base().MustAddr(), matrixBase) + SHRQ(U8(perLoopBits), length) + TESTQ(length, length) + JZ(LabelRef(name + "_end")) + + dst := make([]reg.VecVirtual, outputs) + dstPtr := make([]reg.GPVirtual, outputs) + outBase := Param("out").Base().MustAddr() + outSlicePtr := GP64() + MOVQ(outBase, outSlicePtr) + for i := range dst { + dst[i] = YMM() + if !regDst { + continue + } + ptr := GP64() + MOVQ(Mem{Base: outSlicePtr, Disp: i * 24}, ptr) + dstPtr[i] = ptr + } + + inLo := make([]reg.VecVirtual, total) + inHi := make([]reg.VecVirtual, total) + + for i := range inLo { + if loadNone { + break + } + tableLo := YMM() + tableHi := YMM() + VMOVDQU(Mem{Base: matrixBase, Disp: i * 64}, tableLo) + VMOVDQU(Mem{Base: matrixBase, Disp: i*64 + 32}, tableHi) + inLo[i] = tableLo + inHi[i] = tableHi + } + + inPtrs := make([]reg.GPVirtual, inputs) + inSlicePtr := GP64() + MOVQ(Param("in").Base().MustAddr(), inSlicePtr) + for i := range inPtrs { + ptr := GP64() + MOVQ(Mem{Base: inSlicePtr, Disp: i * 24}, ptr) + inPtrs[i] = ptr + } + + tmpMask := GP64() + MOVQ(U32(15), tmpMask) + lowMask := YMM() + MOVQ(tmpMask, lowMask.AsX()) + VPBROADCASTB(lowMask.AsX(), lowMask) + + offset := GP64() + MOVQ(Param("start").MustAddr(), offset) + Label(name + "_loop") + if xor { + Commentf("Load %d outputs", outputs) + } else { + Commentf("Clear %d outputs", outputs) + } + for i := range dst { + if xor { + if regDst { + VMOVDQU(Mem{Base: dstPtr[i], Index: offset, Scale: 1}, dst[i]) + continue + } + ptr := GP64() + MOVQ(outBase, ptr) + VMOVDQU(Mem{Base: ptr, Index: offset, Scale: 1}, dst[i]) + } else { + VPXOR(dst[i], dst[i], dst[i]) + } + } + + lookLow, lookHigh := YMM(), YMM() + inLow, inHigh := YMM(), YMM() + for i := range inPtrs { + Commentf("Load and process 32 bytes from input %d to %d outputs", i, outputs) + VMOVDQU(Mem{Base: inPtrs[i], Index: offset, Scale: 1}, inLow) + VPSRLQ(U8(4), inLow, inHigh) + VPAND(lowMask, inLow, inLow) + VPAND(lowMask, inHigh, inHigh) + for j := range dst { + if loadNone { + VMOVDQU(Mem{Base: matrixBase, Disp: 64 * (i*outputs + j)}, lookLow) + VMOVDQU(Mem{Base: matrixBase, Disp: 32 + 64*(i*outputs+j)}, lookHigh) + VPSHUFB(inLow, lookLow, lookLow) + VPSHUFB(inHigh, lookHigh, lookHigh) + } else { + VPSHUFB(inLow, inLo[i*outputs+j], lookLow) + VPSHUFB(inHigh, inHi[i*outputs+j], lookHigh) + } + VPXOR(lookLow, lookHigh, lookLow) + VPXOR(lookLow, dst[j], dst[j]) + } + } + Commentf("Store %d outputs", outputs) + for i := range dst { + if regDst { + VMOVDQU(dst[i], Mem{Base: dstPtr[i], Index: offset, Scale: 1}) + continue + } + ptr := GP64() + MOVQ(Mem{Base: outSlicePtr, Disp: i * 24}, ptr) + VMOVDQU(dst[i], Mem{Base: ptr, Index: offset, Scale: 1}) + } + Comment("Prepare for next loop") + ADDQ(U8(perLoop), offset) + DECQ(length) + JNZ(LabelRef(name + "_loop")) + VZEROUPPER() + + Label(name + "_end") + RET() +} diff --git a/vendor/github.com/klauspost/reedsolomon/go.mod b/vendor/github.com/klauspost/reedsolomon/go.mod index 94e444bffe..a059d86706 100644 --- a/vendor/github.com/klauspost/reedsolomon/go.mod +++ b/vendor/github.com/klauspost/reedsolomon/go.mod @@ -2,4 +2,6 @@ module github.com/klauspost/reedsolomon go 1.14 -require github.com/klauspost/cpuid/v2 v2.0.2 +require ( + github.com/klauspost/cpuid v1.2.4 +) diff --git a/vendor/github.com/klauspost/reedsolomon/go.sum b/vendor/github.com/klauspost/reedsolomon/go.sum index a445e735d4..5a44d819b4 100644 --- a/vendor/github.com/klauspost/reedsolomon/go.sum +++ b/vendor/github.com/klauspost/reedsolomon/go.sum @@ -1,2 +1,2 @@ -github.com/klauspost/cpuid/v2 v2.0.2 h1:pd2FBxFydtPn2ywTLStbFg9CJKrojATnpeJWSP7Ys4k= -github.com/klauspost/cpuid/v2 v2.0.2/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid v1.2.4 h1:EBfaK0SWSwk+fgk6efYFWdzl8MwRWoOO1gkmiaTXPW4= +github.com/klauspost/cpuid v1.2.4/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= diff --git a/vendor/github.com/klauspost/reedsolomon/inversion_tree.go b/vendor/github.com/klauspost/reedsolomon/inversion_tree.go index 3f97f810a7..c9d8ab2e7e 100644 --- a/vendor/github.com/klauspost/reedsolomon/inversion_tree.go +++ b/vendor/github.com/klauspost/reedsolomon/inversion_tree.go @@ -14,7 +14,7 @@ import ( // The tree uses a Reader-Writer mutex to make it thread-safe // when accessing cached matrices and inserting new ones. type inversionTree struct { - mutex sync.RWMutex + mutex *sync.RWMutex root inversionNode } @@ -26,22 +26,21 @@ type inversionNode struct { // newInversionTree initializes a tree for storing inverted matrices. // Note that the root node is the identity matrix as it implies // there were no errors with the original data. -func newInversionTree(dataShards, parityShards int) *inversionTree { +func newInversionTree(dataShards, parityShards int) inversionTree { identity, _ := identityMatrix(dataShards) - return &inversionTree{ - root: inversionNode{ - matrix: identity, - children: make([]*inversionNode, dataShards+parityShards), - }, + root := inversionNode{ + matrix: identity, + children: make([]*inversionNode, dataShards+parityShards), + } + return inversionTree{ + mutex: &sync.RWMutex{}, + root: root, } } // GetInvertedMatrix returns the cached inverted matrix or nil if it // is not found in the tree keyed on the indices of invalid rows. -func (t *inversionTree) GetInvertedMatrix(invalidIndices []int) matrix { - if t == nil { - return nil - } +func (t inversionTree) GetInvertedMatrix(invalidIndices []int) matrix { // Lock the tree for reading before accessing the tree. t.mutex.RLock() defer t.mutex.RUnlock() @@ -64,10 +63,7 @@ var errAlreadySet = errors.New("the root node identity matrix is already set") // keyed by the indices of invalid rows. The total number of shards // is required for creating the proper length lists of child nodes for // each node. -func (t *inversionTree) InsertInvertedMatrix(invalidIndices []int, matrix matrix, shards int) error { - if t == nil { - return nil - } +func (t inversionTree) InsertInvertedMatrix(invalidIndices []int, matrix matrix, shards int) error { // If no invalid indices were given then we are done because the // root node is already set with the identity matrix. if len(invalidIndices) == 0 { @@ -90,7 +86,7 @@ func (t *inversionTree) InsertInvertedMatrix(invalidIndices []int, matrix matrix return nil } -func (n *inversionNode) getInvertedMatrix(invalidIndices []int, parent int) matrix { +func (n inversionNode) getInvertedMatrix(invalidIndices []int, parent int) matrix { // Get the child node to search next from the list of children. The // list of children starts relative to the parent index passed in // because the indices of invalid rows is sorted (by default). As we @@ -121,7 +117,7 @@ func (n *inversionNode) getInvertedMatrix(invalidIndices []int, parent int) matr return node.matrix } -func (n *inversionNode) insertInvertedMatrix(invalidIndices []int, matrix matrix, shards, parent int) { +func (n inversionNode) insertInvertedMatrix(invalidIndices []int, matrix matrix, shards, parent int) { // As above, get the child node to search next from the list of children. // The list of children starts relative to the parent index passed in // because the indices of invalid rows is sorted (by default). As we diff --git a/vendor/github.com/klauspost/reedsolomon/matrix.go b/vendor/github.com/klauspost/reedsolomon/matrix.go index 22669c27e5..a6b9730c7d 100644 --- a/vendor/github.com/klauspost/reedsolomon/matrix.go +++ b/vendor/github.com/klauspost/reedsolomon/matrix.go @@ -218,10 +218,7 @@ func (m matrix) gaussianElimination() error { if m[r][r] == 0 { for rowBelow := r + 1; rowBelow < rows; rowBelow++ { if m[rowBelow][r] != 0 { - err := m.SwapRows(r, rowBelow) - if err != nil { - return err - } + m.SwapRows(r, rowBelow) break } } diff --git a/vendor/github.com/klauspost/reedsolomon/options.go b/vendor/github.com/klauspost/reedsolomon/options.go index 26269eb797..b4adc2a3b9 100644 --- a/vendor/github.com/klauspost/reedsolomon/options.go +++ b/vendor/github.com/klauspost/reedsolomon/options.go @@ -3,7 +3,7 @@ package reedsolomon import ( "runtime" - "github.com/klauspost/cpuid/v2" + "github.com/klauspost/cpuid" ) // Option allows to override processing parameters. @@ -19,7 +19,6 @@ type options struct { usePAR1Matrix bool useCauchy bool fastOneParity bool - inversionCache bool // stream options concReads bool @@ -28,16 +27,15 @@ type options struct { } var defaultOptions = options{ - maxGoroutines: 384, - minSplitSize: -1, - fastOneParity: false, - inversionCache: true, + maxGoroutines: 384, + minSplitSize: -1, + fastOneParity: false, // Detect CPU capabilities. - useSSSE3: cpuid.CPU.Supports(cpuid.SSSE3), - useSSE2: cpuid.CPU.Supports(cpuid.SSE2), - useAVX2: cpuid.CPU.Supports(cpuid.AVX2), - useAVX512: cpuid.CPU.Supports(cpuid.AVX512F, cpuid.AVX512BW), + useSSSE3: cpuid.CPU.SSSE3(), + useSSE2: cpuid.CPU.SSE2(), + useAVX2: cpuid.CPU.AVX2(), + useAVX512: cpuid.CPU.AVX512F() && cpuid.CPU.AVX512BW(), } func init() { @@ -111,15 +109,6 @@ func WithConcurrentStreamWrites(enabled bool) Option { } } -// WithInversionCache allows to control the inversion cache. -// This will cache reconstruction matrices so they can be reused. -// Enabled by default. -func WithInversionCache(enabled bool) Option { - return func(o *options) { - o.inversionCache = enabled - } -} - // WithStreamBlockSize allows to set a custom block size per round of reads/writes. // If not set, any shard size set with WithAutoGoroutines will be used. // If WithAutoGoroutines is also unset, 4MB will be used. diff --git a/vendor/github.com/klauspost/reedsolomon/reedsolomon.go b/vendor/github.com/klauspost/reedsolomon/reedsolomon.go index 57f693956c..13a35d21c1 100644 --- a/vendor/github.com/klauspost/reedsolomon/reedsolomon.go +++ b/vendor/github.com/klauspost/reedsolomon/reedsolomon.go @@ -18,7 +18,7 @@ import ( "runtime" "sync" - "github.com/klauspost/cpuid/v2" + "github.com/klauspost/cpuid" ) // Encoder is an interface to encode Reed-Salomon parity sets for your data. @@ -110,16 +110,15 @@ type reedSolomon struct { ParityShards int // Number of parity shards, should not be modified. Shards int // Total number of shards. Calculated, and should not be modified. m matrix - tree *inversionTree + tree inversionTree parity [][]byte o options mPool sync.Pool } // ErrInvShardNum will be returned by New, if you attempt to create -// an Encoder with less than one data shard or less than zero parity -// shards. -var ErrInvShardNum = errors.New("cannot create Encoder with less than one data shard or less than zero parity shards") +// an Encoder where either data or parity shards is zero or less. +var ErrInvShardNum = errors.New("cannot create Encoder with zero or less data/parity shards") // ErrMaxShardNum will be returned by New, if you attempt to create an // Encoder where data and parity shards are bigger than the order of @@ -250,7 +249,7 @@ func New(dataShards, parityShards int, opts ...Option) (Encoder, error) { for _, opt := range opts { opt(&r.o) } - if dataShards <= 0 || parityShards < 0 { + if dataShards <= 0 || parityShards <= 0 { return nil, ErrInvShardNum } @@ -258,10 +257,6 @@ func New(dataShards, parityShards int, opts ...Option) (Encoder, error) { return nil, ErrMaxShardNum } - if parityShards == 0 { - return &r, nil - } - var err error switch { case r.o.fastOneParity && parityShards == 1: @@ -338,9 +333,7 @@ func New(dataShards, parityShards int, opts ...Option) (Encoder, error) { // The inversion root node will have the identity matrix as // its inversion matrix because it implies there are no errors // with the original data. - if r.o.inversionCache { - r.tree = newInversionTree(dataShards, parityShards) - } + r.tree = newInversionTree(dataShards, parityShards) r.parity = make([][]byte, parityShards) for i := range r.parity { @@ -428,10 +421,6 @@ func (r *reedSolomon) Update(shards [][]byte, newDatashards [][]byte) error { } func (r *reedSolomon) updateParityShards(matrixRows, oldinputs, newinputs, outputs [][]byte, outputCount, byteCount int) { - if len(outputs) == 0 { - return - } - if r.o.maxGoroutines > 1 && byteCount > r.o.minSplitSize { r.updateParityShardsP(matrixRows, oldinputs, newinputs, outputs, outputCount, byteCount) return @@ -531,7 +520,7 @@ func (r *reedSolomon) codeSomeShards(matrixRows, inputs, outputs [][]byte, outpu if end > len(inputs[0]) { end = len(inputs[0]) } - if avx2CodeGen && r.o.useAVX2 && byteCount >= 32 && len(inputs)+len(outputs) >= 4 && len(inputs) <= maxAvx2Inputs && len(outputs) <= maxAvx2Outputs { + if avx2CodeGen && r.o.useAVX2 && byteCount >= 32 && len(inputs) > 1 && len(outputs) > 1 && len(inputs) <= maxAvx2Inputs && len(outputs) <= maxAvx2Outputs { m := genAvx2Matrix(matrixRows, len(inputs), len(outputs), r.mPool.Get().([]byte)) start += galMulSlicesAvx2(m, inputs, outputs, 0, byteCount) r.mPool.Put(m) @@ -561,23 +550,18 @@ func (r *reedSolomon) codeSomeShards(matrixRows, inputs, outputs [][]byte, outpu // several goroutines. func (r *reedSolomon) codeSomeShardsP(matrixRows, inputs, outputs [][]byte, outputCount, byteCount int) { var wg sync.WaitGroup - gor := r.o.maxGoroutines - - var avx2Matrix []byte - useAvx2 := avx2CodeGen && r.o.useAVX2 && byteCount >= 32 && len(inputs)+len(outputs) >= 4 && len(inputs) <= maxAvx2Inputs && len(outputs) <= maxAvx2Outputs - if useAvx2 { - avx2Matrix = genAvx2Matrix(matrixRows, len(inputs), len(outputs), r.mPool.Get().([]byte)) - defer r.mPool.Put(avx2Matrix) - } - - do := byteCount / gor + do := byteCount / r.o.maxGoroutines if do < r.o.minSplitSize { do = r.o.minSplitSize } - // Make sizes divisible by 64 do = (do + 63) & (^63) start := 0 + var avx2Matrix []byte + if avx2CodeGen && r.o.useAVX2 && byteCount >= 32 && len(inputs) > 1 && len(outputs) > 1 && len(inputs) <= maxAvx2Inputs && len(outputs) <= maxAvx2Outputs { + avx2Matrix = genAvx2Matrix(matrixRows, len(inputs), len(outputs), r.mPool.Get().([]byte)) + defer r.mPool.Put(avx2Matrix) + } for start < byteCount { if start+do > byteCount { do = byteCount - start @@ -585,7 +569,7 @@ func (r *reedSolomon) codeSomeShardsP(matrixRows, inputs, outputs [][]byte, outp wg.Add(1) go func(start, stop int) { - if useAvx2 && stop-start >= 32 { + if avx2CodeGen && r.o.useAVX2 && stop-start >= 32 && len(inputs) > 1 && len(outputs) > 1 && len(inputs) <= maxAvx2Inputs && len(outputs) <= maxAvx2Outputs { start += galMulSlicesAvx2(avx2Matrix, inputs, outputs, start, stop) } @@ -621,9 +605,6 @@ func (r *reedSolomon) codeSomeShardsP(matrixRows, inputs, outputs [][]byte, outp // except this will check values and return // as soon as a difference is found. func (r *reedSolomon) checkSomeShards(matrixRows, inputs, toCheck [][]byte, outputCount, byteCount int) bool { - if len(toCheck) == 0 { - return true - } if r.o.maxGoroutines > 1 && byteCount > r.o.minSplitSize { return r.checkSomeShardsP(matrixRows, inputs, toCheck, outputCount, byteCount) } diff --git a/vendor/github.com/mholt/archiver/v3/.gitignore b/vendor/github.com/mholt/archiver/v3/.gitignore index 4a87fc1aaf..ac8f8b2516 100644 --- a/vendor/github.com/mholt/archiver/v3/.gitignore +++ b/vendor/github.com/mholt/archiver/v3/.gitignore @@ -1,10 +1,5 @@ -/arc -/cmd/arc/arc -/dist/ -/vendor/ - .DS_Store _gitignore builds/ *.test -.*.sw* +cmd/archiver/archiver diff --git a/vendor/github.com/mholt/archiver/v3/.goreleaser.yml b/vendor/github.com/mholt/archiver/v3/.goreleaser.yml deleted file mode 100644 index 13cc2a679b..0000000000 --- a/vendor/github.com/mholt/archiver/v3/.goreleaser.yml +++ /dev/null @@ -1,41 +0,0 @@ -# This is an example goreleaser.yaml file with some sane defaults. -# Make sure to check the documentation at http://goreleaser.com -project_name: arc -before: - hooks: - # You may remove this if you don't use go modules. - - go mod download - # you may remove this if you don't need go generate - - go generate ./... -builds: - - - env: - - CGO_ENABLED=0 - main: ./cmd/arc - goos: - - linux - - windows - - darwin - goarch: - - 386 - - amd64 - - arm - - arm64 - goarm: - - 6 - - 7 -archives: - - - format: binary - replacements: - darwin: mac -checksum: - name_template: 'checksums.txt' -snapshot: - name_template: "{{ .Tag }}-next" -changelog: - sort: asc - filters: - exclude: - - '^docs:' - - '^test:' diff --git a/vendor/github.com/mholt/archiver/v3/.prettierrc b/vendor/github.com/mholt/archiver/v3/.prettierrc deleted file mode 100644 index f9f5139c57..0000000000 --- a/vendor/github.com/mholt/archiver/v3/.prettierrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "bracketSpacing": true, - "printWidth": 120, -} diff --git a/vendor/github.com/mholt/archiver/v3/README.md b/vendor/github.com/mholt/archiver/v3/README.md index 5f7cd514ff..cbf17d53d4 100644 --- a/vendor/github.com/mholt/archiver/v3/README.md +++ b/vendor/github.com/mholt/archiver/v3/README.md @@ -1,4 +1,5 @@ -# archiver [![archiver GoDoc](https://img.shields.io/badge/reference-godoc-blue.svg?style=flat-square)](https://pkg.go.dev/github.com/mholt/archiver?tab=doc) +archiver [![archiver GoDoc](https://img.shields.io/badge/reference-godoc-blue.svg?style=flat-square)](https://pkg.go.dev/github.com/mholt/archiver?tab=doc) +======== Introducing **Archiver 3.1** - a cross-platform, multi-format archive utility and Go library. A powerful and flexible library meets an elegant CLI in this generic replacement for several platform-specific or format-specific archive utilities. @@ -48,76 +49,23 @@ Files are put into the root of the archive; directories are recursively added, p Tar files can optionally be compressed using any of the above compression formats. -## GoDoc - -See ## Install -### With webi - -[`webi`](https://webinstall.dev/arc) will install `webi` and `arc` to `~/.local/bin/` and update your `PATH`. - -#### Mac, Linux, Raspberry Pi +To install the runnable binary to your $GOPATH/bin: ```bash -curl -fsS https://webinstall.dev/arc | bash +$ go install github.com/mholt/archiver/cmd/arc ``` -#### Windows 10 - -```pwsh -curl.exe -fsS -A MS https://webinstall.dev/arc | powershell -``` +Or download binaries from the [releases](https://github.com/mholt/archiver/releases) page. -### With Go - -To install the runnable binary to your \$GOPATH/bin: +To use as a dependency in your project: -```bash -go get github.com/mholt/archiver/cmd/arc ``` - -### Manually - -To install manually - -1. Download the binary for your platform from the [Github Releases](https://github.com/mholt/archiver/releases) page. -2. Move the binary to a location in your path, for example: - - without `sudo`: - ```bash - chmod a+x ~/Downloads/arc_* - mkdir -p ~/.local/bin - mv ~/Downloads/arc_* ~/.local/bin/arc - ``` - - as `root`: - ```bash - chmod a+x ~/Downloads/arc_* - sudo mkdir -p /usr/local/bin - sudo mv ~/Downloads/arc_* /usr/local/bin/arc - ``` -3. If needed, update `~/.bashrc` or `~/.profile` to include add `arc` in your `PATH`, for example: - ``` - echo 'PATH="$HOME:/.local/bin:$PATH"' >> ~/.bashrc - ``` - -## Build from Source - -You can successfully build `arc` with just the go tooling, or with `goreleaser`. - -### With `go` - -```bash -go build cmd/arc/*.go +$ go get github.com/mholt/archiver/v3 ``` -### Multi-platform with `goreleaser` - -Builds with `goreleaser` will also include version info. - -```bash -goreleaser --snapshot --skip-publish --rm-dist -``` ## Command Use @@ -126,32 +74,31 @@ goreleaser --snapshot --skip-publish --rm-dist ```bash # Syntax: arc archive [archive name] [input files...] -arc archive test.tar.gz file1.txt images/file2.jpg folder/subfolder +$ arc archive test.tar.gz file1.txt images/file2.jpg folder/subfolder ``` (At least one input file is required.) + ### Extract entire archive ```bash # Syntax: arc unarchive [archive name] [destination] -arc unarchive test.tar.gz +$ arc unarchive test.tar.gz ``` (The destination path is optional; default is current directory.) The archive name must end with a supported file extension—this is how it knows what kind of archive to make. Run `arc help` for more help. + ### List archive contents ```bash # Syntax: arc ls [archive name] -arc ls caddy_dist.tar.gz -``` - -```txt +$ arc ls caddy_dist.tar.gz drwxr-xr-x matt staff 0 2018-09-19 15:47:18 -0600 MDT dist/ -rw-r--r-- matt staff 6148 2017-08-07 18:34:22 -0600 MDT dist/.DS_Store -rw-r--r-- matt staff 22481 2018-09-19 15:47:18 -0600 MDT dist/CHANGES.txt @@ -162,21 +109,23 @@ drwxr-xr-x matt staff 0 2018-09-19 15:47:18 -0600 MDT dist/ ... ``` + ### Extract a specific file or folder from an archive ```bash # Syntax: arc extract [archive name] [path in archive] [destination on disk] -arc extract test.tar.gz foo/hello.txt extracted/hello.txt +$ arc extract test.tar.gz foo/hello.txt extracted/hello.txt ``` + ### Compress a single file ```bash # Syntax: arc compress [input file] [output file] -arc compress test.txt compressed_test.txt.gz -arc compress test.txt gz +$ arc compress test.txt compressed_test.txt.gz +$ arc compress test.txt gz ``` For convenience, the output file (second argument) may simply be a compression format (without leading dot), in which case the output filename will be the same as the input filename but with the format extension appended, and the input file will be deleted if successful. @@ -186,25 +135,22 @@ For convenience, the output file (second argument) may simply be a compression f ```bash # Syntax: arc decompress [input file] [output file] -arc decompress test.txt.gz original_test.txt -arc decompress test.txt.gz +$ arc decompress test.txt.gz original_test.txt +$ arc decompress test.txt.gz ``` For convenience, the output file (second argument) may be omitted. In that case, the output filename will have the same name as the input filename, but with the compression extension stripped from the end; and the input file will be deleted if successful. + ### Flags Flags are specified before the subcommand. Use `arc help` or `arc -h` to get usage help and a description of flags with their default values. -## Library Use -The archiver package allows you to easily create and open archives, walk their contents, extract specific files, compress and decompress files, and even stream archives in and out using pure io.Reader and io.Writer interfaces, without ever needing to touch the disk. -To use as a dependency in your project: +## Library Use -```bash -go get github.com/mholt/archiver/v3 -``` +The archiver package allows you to easily create and open archives, walk their contents, extract specific files, compress and decompress files, and even stream archives in and out using pure io.Reader and io.Writer interfaces, without ever needing to touch the disk. ```go import "github.com/mholt/archiver/v3" @@ -263,7 +209,7 @@ for _, fname := range filenames { if err != nil { return err } - + // get file's name for the inside of the archive internalName, err := archiver.NameInArchive(info, fname, fname) if err != nil { @@ -297,6 +243,7 @@ There's a lot more that can be done, too. [See the GoDoc](https://pkg.go.dev/git **Security note: This package does NOT attempt to mitigate zip-slip attacks.** It is [extremely difficult](https://github.com/rubyzip/rubyzip/pull/376) [to do properly](https://github.com/mholt/archiver/pull/65#issuecomment-395988244) and [seemingly impossible to mitigate effectively across platforms](https://github.com/golang/go/issues/20126). [Attempted fixes have broken processing of legitimate files in production](https://github.com/mholt/archiver/pull/70#issuecomment-423267320), rendering the program unusable. Our recommendation instead is to inspect the contents of an untrusted archive before extracting it (this package provides `Walkers`) and decide if you want to proceed with extraction. + ## Project Values This project has a few principle-based goals that guide its development: diff --git a/vendor/github.com/mholt/archiver/v3/archiver.go b/vendor/github.com/mholt/archiver/v3/archiver.go index b09699d676..ecf315e058 100644 --- a/vendor/github.com/mholt/archiver/v3/archiver.go +++ b/vendor/github.com/mholt/archiver/v3/archiver.go @@ -72,11 +72,6 @@ type ExtensionChecker interface { CheckExt(name string) error } -// FilenameChecker validates filenames to prevent path traversal attacks -type FilenameChecker interface { - CheckPath(to, filename string) error -} - // Unarchiver is a type that can extract archive files // into a folder. type Unarchiver interface { diff --git a/vendor/github.com/mholt/archiver/v3/azure-pipelines.yml b/vendor/github.com/mholt/archiver/v3/azure-pipelines.yml index 672dce356c..a86a62059f 100644 --- a/vendor/github.com/mholt/archiver/v3/azure-pipelines.yml +++ b/vendor/github.com/mholt/archiver/v3/azure-pipelines.yml @@ -4,11 +4,10 @@ trigger: strategy: matrix: linux: - imageName: ubuntu-18.04 + imageName: ubuntu-16.04 gorootDir: /usr/local mac: - # Mojave - imageName: macos-10.14 + imageName: macos-10.13 gorootDir: /usr/local windows: imageName: windows-2019 @@ -27,12 +26,6 @@ variables: #GO111MODULE: on steps: - -- bash: git config --global core.autocrlf false - displayName: "Disable line ending conversion for git to" - -- checkout: self - - bash: | latestGo=$(curl "https://golang.org/VERSION?m=text") echo "##vso[task.setvariable variable=LATEST_GO]$latestGo" @@ -64,16 +57,18 @@ steps: displayName: Install Go on macOS - powershell: | - echo "Downloading Go..." - # Windows comes with BSD curl, which is MUCH faster than the native Windows HTTP - curl.exe -fsSL -o "$(LATEST_GO).windows-amd64.zip" "https://dl.google.com/go/$(LATEST_GO).windows-amd64.zip" - echo "Extracting Go..." - # Yes, Windows tar (BSD tar) handles zip files. Who knew!? - # (and it's MUCH, MUCH, MUCH faster than the native Windows expander) - tar.exe xf "$(LATEST_GO).windows-amd64.zip" -C "$(gorootDir)" + Write-Host "Downloading Go... (please be patient, I am very slow)" + (New-Object System.Net.WebClient).DownloadFile("https://dl.google.com/go/$(LATEST_GO).windows-amd64.zip", "$(LATEST_GO).windows-amd64.zip") + Write-Host "Extracting Go... (I'm slow too)" + Expand-Archive "$(LATEST_GO).windows-amd64.zip" -DestinationPath "$(gorootDir)" condition: eq( variables['Agent.OS'], 'Windows_NT' ) displayName: Install Go on Windows +# TODO: When this issue is fixed, replace with installer script: +# https://github.com/golangci/golangci-lint/issues/472 +- script: go get -v github.com/golangci/golangci-lint/cmd/golangci-lint + displayName: Install golangci-lint + - bash: | printf "Using go at: $(which go)\n" printf "Go version: $(go version)\n" @@ -84,28 +79,8 @@ steps: displayName: Print Go version and environment - script: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.31.0 - ./bin/golangci-lint run -E gofmt -E goimports -E misspell ./... - workingDirectory: '$(modulePath)' - condition: eq( variables['Agent.OS'], 'Linux' ) - displayName: Run Lint - -- bash: | - go mod tidy - if [ ! -z "$(git status --porcelain go.mod)" ]; then - printf "go.mod has modifications\n" - git diff go.mod - exit 1 - fi - if [ ! -z "$(git status --porcelain go.sum)" ]; then - printf "go.sum has modifications\n" - git diff go.sum - exit 1 - fi - workingDirectory: '$(modulePath)' - displayName: Ensure that module definition and checksums are correct - -- script: | + go get -v -t -d ./... + golangci-lint run -E gofmt -E goimports -E misspell go test -race ./... workingDirectory: '$(modulePath)' displayName: Run tests diff --git a/vendor/github.com/mholt/archiver/v3/error.go b/vendor/github.com/mholt/archiver/v3/error.go deleted file mode 100644 index a46235c652..0000000000 --- a/vendor/github.com/mholt/archiver/v3/error.go +++ /dev/null @@ -1,27 +0,0 @@ -package archiver - -import ( - "fmt" - "strings" -) - -// IllegalPathError is an error returned when an illegal -// path is detected during the archival process. -// -// By default, only the Filename is showed on error, but you might -// also get the absolute value of the invalid path on the AbsolutePath -// field. -type IllegalPathError struct { - AbsolutePath string - Filename string -} - -func (err *IllegalPathError) Error() string { - return fmt.Sprintf("illegal file path: %s", err.Filename) -} - -// IsIllegalPathError returns true if the provided error is of -// the type IllegalPathError. -func IsIllegalPathError(err error) bool { - return err != nil && strings.Contains(err.Error(), "illegal file path: ") -} diff --git a/vendor/github.com/mholt/archiver/v3/go.mod b/vendor/github.com/mholt/archiver/v3/go.mod index 8d8e4e16fa..8586b7a19b 100644 --- a/vendor/github.com/mholt/archiver/v3/go.mod +++ b/vendor/github.com/mholt/archiver/v3/go.mod @@ -1,15 +1,16 @@ module github.com/mholt/archiver/v3 -go 1.13 +go 1.12 require ( - github.com/andybalholm/brotli v1.0.0 + github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6 github.com/dsnet/compress v0.0.1 github.com/golang/snappy v0.0.1 - github.com/klauspost/compress v1.10.10 - github.com/klauspost/pgzip v1.2.4 - github.com/nwaples/rardecode v1.1.0 - github.com/pierrec/lz4/v4 v4.0.3 - github.com/ulikunitz/xz v0.5.7 + github.com/google/go-cmp v0.3.0 // indirect + github.com/klauspost/compress v1.9.2 + github.com/klauspost/pgzip v1.2.1 + github.com/nwaples/rardecode v1.0.0 + github.com/pierrec/lz4 v2.0.5+incompatible + github.com/ulikunitz/xz v0.5.6 github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 ) diff --git a/vendor/github.com/mholt/archiver/v3/go.sum b/vendor/github.com/mholt/archiver/v3/go.sum index adf9ee7dbb..29c45105fe 100644 --- a/vendor/github.com/mholt/archiver/v3/go.sum +++ b/vendor/github.com/mholt/archiver/v3/go.sum @@ -1,24 +1,26 @@ -github.com/andybalholm/brotli v1.0.0 h1:7UCwP93aiSfvWpapti8g88vVVGp2qqtGyePsSuDafo4= -github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6 h1:bZ28Hqta7TFAK3Q08CMvv8y3/8ATaEqv2nGoc6yff6c= +github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6/go.mod h1:+lx6/Aqd1kLJ1GQfkvOnaZ1WGmLpMpbprPuIOOZX30U= github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q= github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= +github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721 h1:KRMr9A3qfbVM7iV/WcLY/rL5LICqwMHLhwRXKu99fXw= +github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.10.10 h1:a/y8CglcM7gLGYmlbP/stPE5sR3hbhFRUjCBfd/0B3I= -github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.9.2 h1:LfVyl+ZlLlLDeQ/d2AqfGIIH4qEDu0Ed2S5GyhCWIWY= +github.com/klauspost/compress v1.9.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/pgzip v1.2.4 h1:TQ7CNpYKovDOmqzRHKxJh0BeaBI7UdQZYc6p7pMQh1A= -github.com/klauspost/pgzip v1.2.4/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= -github.com/nwaples/rardecode v1.1.0 h1:vSxaY8vQhOcVr4mm5e8XllHWTiM4JF507A0Katqw7MQ= -github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= -github.com/pierrec/lz4/v4 v4.0.3 h1:vNQKSVZNYUEAvRY9FaUXAF1XPbSOHJtDTiP41kzDz2E= -github.com/pierrec/lz4/v4 v4.0.3/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/klauspost/pgzip v1.2.1 h1:oIPZROsWuPHpOdMVWLuJZXwgjhrW8r1yEX8UqMyeNHM= +github.com/klauspost/pgzip v1.2.1/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/nwaples/rardecode v1.0.0 h1:r7vGuS5akxOnR4JQSkko62RJ1ReCMXxQRPtxsiFMBOs= +github.com/nwaples/rardecode v1.0.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= +github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/ulikunitz/xz v0.5.6 h1:jGHAfXawEGZQ3blwU5wnWKQJvAraT7Ftq9EXjnXYgt8= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= -github.com/ulikunitz/xz v0.5.7 h1:YvTNdFzX6+W5m9msiYg/zpkSURPPtOlzbqYjrFn7Yt4= -github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= diff --git a/vendor/github.com/mholt/archiver/v3/gz.go b/vendor/github.com/mholt/archiver/v3/gz.go index 650718d0f3..3922e7a53b 100644 --- a/vendor/github.com/mholt/archiver/v3/gz.go +++ b/vendor/github.com/mholt/archiver/v3/gz.go @@ -1,12 +1,12 @@ package archiver import ( + "compress/gzip" "fmt" "io" "path/filepath" - "github.com/klauspost/compress/gzip" - "github.com/klauspost/pgzip" + pgzip "github.com/klauspost/pgzip" ) // Gz facilitates gzip compression. diff --git a/vendor/github.com/mholt/archiver/v3/lz4.go b/vendor/github.com/mholt/archiver/v3/lz4.go index 3d6b0a212d..daff631d6d 100644 --- a/vendor/github.com/mholt/archiver/v3/lz4.go +++ b/vendor/github.com/mholt/archiver/v3/lz4.go @@ -5,7 +5,7 @@ import ( "io" "path/filepath" - "github.com/pierrec/lz4/v4" + "github.com/pierrec/lz4" ) // Lz4 facilitates LZ4 compression. @@ -16,14 +16,7 @@ type Lz4 struct { // Compress reads in, compresses it, and writes it to out. func (lz *Lz4) Compress(in io.Reader, out io.Writer) error { w := lz4.NewWriter(out) - // TODO archiver v4: use proper lz4.Fast - // bitshifting for backwards compatibility with lz4/v3 - options := []lz4.Option{ - lz4.CompressionLevelOption(lz4.CompressionLevel(1 << (8 + lz.CompressionLevel))), - } - if err := w.Apply(options...); err != nil { - return err - } + w.Header.CompressionLevel = lz.CompressionLevel defer w.Close() _, err := io.Copy(w, in) return err diff --git a/vendor/github.com/mholt/archiver/v3/rar.go b/vendor/github.com/mholt/archiver/v3/rar.go index 56c2a3e3e8..84eabda820 100644 --- a/vendor/github.com/mholt/archiver/v3/rar.go +++ b/vendor/github.com/mholt/archiver/v3/rar.go @@ -40,10 +40,6 @@ type Rar struct { // especially on extraction. ImplicitTopLevelFolder bool - // Strip number of leading paths. This feature is available - // only during unpacking of the entire archive. - StripComponents int - // If true, errors encountered during reading // or writing a single file will be logged and // the operation will continue on remaining files. @@ -64,17 +60,6 @@ func (*Rar) CheckExt(filename string) error { return nil } -// CheckPath ensures that the filename has not been crafted to perform path traversal attacks -func (*Rar) CheckPath(to, filename string) error { - to, _ = filepath.Abs(to) //explicit the destination folder to prevent that 'string.HasPrefix' check can be 'bypassed' when no destination folder is supplied in input - dest := filepath.Join(to, filename) - //prevent path traversal attacks - if !strings.HasPrefix(dest, to) { - return &IllegalPathError{AbsolutePath: dest, Filename: filename} - } - return nil -} - // Unarchive unpacks the .rar file at source to destination. // Destination will be treated as a folder name. It supports // multi-volume archives. @@ -109,7 +94,7 @@ func (r *Rar) Unarchive(source, destination string) error { break } if err != nil { - if r.ContinueOnError || IsIllegalPathError(err) { + if r.ContinueOnError { log.Printf("[ERROR] Reading file in rar archive: %v", err) continue } @@ -160,29 +145,10 @@ func (r *Rar) unrarNext(to string) error { if err != nil { return err // don't wrap error; calling loop must break on io.EOF } - defer f.Close() - header, ok := f.Header.(*rardecode.FileHeader) if !ok { return fmt.Errorf("expected header to be *rardecode.FileHeader but was %T", f.Header) } - - errPath := r.CheckPath(to, header.Name) - if errPath != nil { - return fmt.Errorf("checking path traversal attempt: %v", errPath) - } - - if r.StripComponents > 0 { - if strings.Count(header.Name, "/") < r.StripComponents { - return nil // skip path with fewer components - } - - for i := 0; i < r.StripComponents; i++ { - slash := strings.Index(header.Name, "/") - header.Name = header.Name[slash+1:] - } - } - return r.unrarFile(f, filepath.Join(to, header.Name)) } @@ -397,9 +363,7 @@ func (*Rar) Match(file io.ReadSeeker) (bool, error) { if err != nil { return false, err } - defer func() { - _, _ = file.Seek(currentPos, io.SeekStart) - }() + defer file.Seek(currentPos, io.SeekStart) buf := make([]byte, 8) if n, err := file.Read(buf); err != nil || n < 8 { @@ -438,7 +402,6 @@ var ( _ = Extractor(new(Rar)) _ = Matcher(new(Rar)) _ = ExtensionChecker(new(Rar)) - _ = FilenameChecker(new(Rar)) _ = os.FileInfo(rarFileInfo{}) ) diff --git a/vendor/github.com/mholt/archiver/v3/sz.go b/vendor/github.com/mholt/archiver/v3/sz.go index 02009b528f..39c5865efe 100644 --- a/vendor/github.com/mholt/archiver/v3/sz.go +++ b/vendor/github.com/mholt/archiver/v3/sz.go @@ -13,7 +13,7 @@ type Snappy struct{} // Compress reads in, compresses it, and writes it to out. func (s *Snappy) Compress(in io.Reader, out io.Writer) error { - w := snappy.NewBufferedWriter(out) + w := snappy.NewWriter(out) defer w.Close() _, err := io.Copy(w, in) return err diff --git a/vendor/github.com/mholt/archiver/v3/tar.go b/vendor/github.com/mholt/archiver/v3/tar.go index 60c58fd135..e983531533 100644 --- a/vendor/github.com/mholt/archiver/v3/tar.go +++ b/vendor/github.com/mholt/archiver/v3/tar.go @@ -40,10 +40,6 @@ type Tar struct { // especially on extraction. ImplicitTopLevelFolder bool - // Strip number of leading paths. This feature is available - // only during unpacking of the entire archive. - StripComponents int - // If true, errors encountered during reading // or writing a single file will be logged and // the operation will continue on remaining files. @@ -65,17 +61,6 @@ func (*Tar) CheckExt(filename string) error { return nil } -// CheckPath ensures that the filename has not been crafted to perform path traversal attacks -func (*Tar) CheckPath(to, filename string) error { - to, _ = filepath.Abs(to) //explicit the destination folder to prevent that 'string.HasPrefix' check can be 'bypassed' when no destination folder is supplied in input - dest := filepath.Join(to, filename) - //prevent path traversal attacks - if !strings.HasPrefix(dest, to) { - return &IllegalPathError{AbsolutePath: dest, Filename: filename} - } - return nil -} - // Archive creates a tarball file at destination containing // the files listed in sources. The destination must end with // ".tar". File paths can be those of regular files or @@ -165,7 +150,7 @@ func (t *Tar) Unarchive(source, destination string) error { break } if err != nil { - if t.ContinueOnError || IsIllegalPathError(err) { + if t.ContinueOnError { log.Printf("[ERROR] Reading file in tar archive: %v", err) continue } @@ -221,44 +206,29 @@ func (t *Tar) addTopLevelFolder(sourceArchive, destination string) (string, erro return destination, nil } -func (t *Tar) untarNext(destination string) error { +func (t *Tar) untarNext(to string) error { f, err := t.Read() if err != nil { return err // don't wrap error; calling loop must break on io.EOF } - defer f.Close() - header, ok := f.Header.(*tar.Header) if !ok { return fmt.Errorf("expected header to be *tar.Header but was %T", f.Header) } - - errPath := t.CheckPath(destination, header.Name) - if errPath != nil { - return fmt.Errorf("checking path traversal attempt: %v", errPath) - } - - if t.StripComponents > 0 { - if strings.Count(header.Name, "/") < t.StripComponents { - return nil // skip path with fewer components - } - - for i := 0; i < t.StripComponents; i++ { - slash := strings.Index(header.Name, "/") - header.Name = header.Name[slash+1:] - } - } - return t.untarFile(f, destination, header) + return t.untarFile(f, filepath.Join(to, header.Name)) } -func (t *Tar) untarFile(f File, destination string, hdr *tar.Header) error { - to := filepath.Join(destination, hdr.Name) - +func (t *Tar) untarFile(f File, to string) error { // do not overwrite existing files, if configured if !f.IsDir() && !t.OverwriteExisting && fileExists(to) { return fmt.Errorf("file already exists: %s", to) } + hdr, ok := f.Header.(*tar.Header) + if !ok { + return fmt.Errorf("expected header to be *tar.Header but was %T", f.Header) + } + switch hdr.Typeflag { case tar.TypeDir: return mkdir(to, f.Mode()) @@ -267,7 +237,7 @@ func (t *Tar) untarFile(f File, destination string, hdr *tar.Header) error { case tar.TypeSymlink: return writeNewSymbolicLink(to, hdr.Linkname) case tar.TypeLink: - return writeNewHardLink(to, filepath.Join(destination, hdr.Linkname)) + return writeNewHardLink(to, filepath.Join(to, hdr.Linkname)) case tar.TypeXGlobalHeader: return nil // ignore the pax global header from git-generated tarballs default: @@ -543,14 +513,9 @@ func (t *Tar) Extract(source, target, destination string) error { if err != nil { return fmt.Errorf("relativizing paths: %v", err) } - th.Name = end - - // relativize any hardlink names - if th.Typeflag == tar.TypeLink { - th.Linkname = filepath.Join(filepath.Base(filepath.Dir(th.Linkname)), filepath.Base(th.Linkname)) - } + joined := filepath.Join(destination, end) - err = t.untarFile(f, destination, th) + err = t.untarFile(f, joined) if err != nil { return fmt.Errorf("extracting file %s: %v", th.Name, err) } @@ -579,9 +544,7 @@ func (*Tar) Match(file io.ReadSeeker) (bool, error) { if err != nil { return false, err } - defer func() { - _, _ = file.Seek(currentPos, io.SeekStart) - }() + defer file.Seek(currentPos, io.SeekStart) buf := make([]byte, tarBlockSize) if _, err = io.ReadFull(file, buf); err != nil { @@ -647,7 +610,6 @@ var ( _ = Extractor(new(Tar)) _ = Matcher(new(Tar)) _ = ExtensionChecker(new(Tar)) - _ = FilenameChecker(new(Tar)) ) // DefaultTar is a default instance that is conveniently ready to use. diff --git a/vendor/github.com/mholt/archiver/v3/targz.go b/vendor/github.com/mholt/archiver/v3/targz.go index 283fd01b2b..07777d0cfa 100644 --- a/vendor/github.com/mholt/archiver/v3/targz.go +++ b/vendor/github.com/mholt/archiver/v3/targz.go @@ -1,12 +1,12 @@ package archiver import ( + "compress/gzip" "fmt" "io" "strings" - "github.com/klauspost/compress/gzip" - "github.com/klauspost/pgzip" + pgzip "github.com/klauspost/pgzip" ) // TarGz facilitates gzip compression diff --git a/vendor/github.com/mholt/archiver/v3/tarlz4.go b/vendor/github.com/mholt/archiver/v3/tarlz4.go index 42cbc90bbb..4a178f691c 100644 --- a/vendor/github.com/mholt/archiver/v3/tarlz4.go +++ b/vendor/github.com/mholt/archiver/v3/tarlz4.go @@ -5,7 +5,7 @@ import ( "io" "strings" - "github.com/pierrec/lz4/v4" + "github.com/pierrec/lz4" ) // TarLz4 facilitates lz4 compression @@ -84,14 +84,7 @@ func (tlz4 *TarLz4) wrapWriter() { var lz4w *lz4.Writer tlz4.Tar.writerWrapFn = func(w io.Writer) (io.Writer, error) { lz4w = lz4.NewWriter(w) - // TODO archiver v4: use proper lz4.Fast - // bitshifting for backwards compatibility with lz4/v3 - options := []lz4.Option{ - lz4.CompressionLevelOption(lz4.CompressionLevel(1 << (8 + tlz4.CompressionLevel))), - } - if err := lz4w.Apply(options...); err != nil { - return lz4w, err - } + lz4w.Header.CompressionLevel = tlz4.CompressionLevel return lz4w, nil } tlz4.Tar.cleanupWrapFn = func() { diff --git a/vendor/github.com/mholt/archiver/v3/tarsz.go b/vendor/github.com/mholt/archiver/v3/tarsz.go index ee3808e63d..0569e66473 100644 --- a/vendor/github.com/mholt/archiver/v3/tarsz.go +++ b/vendor/github.com/mholt/archiver/v3/tarsz.go @@ -77,7 +77,7 @@ func (tsz *TarSz) Extract(source, target, destination string) error { func (tsz *TarSz) wrapWriter() { var sw *snappy.Writer tsz.Tar.writerWrapFn = func(w io.Writer) (io.Writer, error) { - sw = snappy.NewBufferedWriter(w) + sw = snappy.NewWriter(w) return sw, nil } tsz.Tar.cleanupWrapFn = func() { diff --git a/vendor/github.com/mholt/archiver/v3/zip.go b/vendor/github.com/mholt/archiver/v3/zip.go index 81694bdc45..192bf60766 100644 --- a/vendor/github.com/mholt/archiver/v3/zip.go +++ b/vendor/github.com/mholt/archiver/v3/zip.go @@ -6,31 +6,11 @@ import ( "compress/flate" "fmt" "io" - "io/ioutil" "log" "os" "path" "path/filepath" "strings" - - "github.com/dsnet/compress/bzip2" - "github.com/klauspost/compress/zstd" - "github.com/ulikunitz/xz" -) - -// ZipCompressionMethod Compression type -type ZipCompressionMethod uint16 - -// Compression methods. -// see https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT. -// Note LZMA: Disabled - because 7z isn't able to unpack ZIP+LZMA ZIP+LZMA2 archives made this way - and vice versa. -const ( - Store ZipCompressionMethod = 0 - Deflate ZipCompressionMethod = 8 - BZIP2 ZipCompressionMethod = 12 - LZMA ZipCompressionMethod = 14 - ZSTD ZipCompressionMethod = 93 - XZ ZipCompressionMethod = 95 ) // Zip provides facilities for operating ZIP archives. @@ -70,21 +50,14 @@ type Zip struct { // especially on extraction. ImplicitTopLevelFolder bool - // Strip number of leading paths. This feature is available - // only during unpacking of the entire archive. - StripComponents int - // If true, errors encountered during reading // or writing a single file will be logged and // the operation will continue on remaining files. ContinueOnError bool - // Compression algorithm - FileMethod ZipCompressionMethod - zw *zip.Writer - zr *zip.Reader - ridx int - //decinitialized bool + zw *zip.Writer + zr *zip.Reader + ridx int } // CheckExt ensures the file extension matches the format. @@ -95,43 +68,6 @@ func (*Zip) CheckExt(filename string) error { return nil } -// Registering a global decompressor is not reentrant and may panic -func registerDecompressor(zr *zip.Reader) { - // register zstd decompressor - zr.RegisterDecompressor(uint16(ZSTD), func(r io.Reader) io.ReadCloser { - zr, err := zstd.NewReader(r) - if err != nil { - return nil - } - return zr.IOReadCloser() - }) - zr.RegisterDecompressor(uint16(BZIP2), func(r io.Reader) io.ReadCloser { - bz2r, err := bzip2.NewReader(r, nil) - if err != nil { - return nil - } - return bz2r - }) - zr.RegisterDecompressor(uint16(XZ), func(r io.Reader) io.ReadCloser { - xr, err := xz.NewReader(r) - if err != nil { - return nil - } - return ioutil.NopCloser(xr) - }) -} - -// CheckPath ensures the file extension matches the format. -func (*Zip) CheckPath(to, filename string) error { - to, _ = filepath.Abs(to) //explicit the destination folder to prevent that 'string.HasPrefix' check can be 'bypassed' when no destination folder is supplied in input - dest := filepath.Join(to, filename) - //prevent path traversal attacks - if !strings.HasPrefix(dest, to) { - return &IllegalPathError{AbsolutePath: dest, Filename: filename} - } - return nil -} - // Archive creates a .zip file at destination containing // the files listed in sources. The destination must end // with ".zip". File paths can be those of regular files @@ -229,7 +165,7 @@ func (z *Zip) Unarchive(source, destination string) error { break } if err != nil { - if z.ContinueOnError || IsIllegalPathError(err) { + if z.ContinueOnError { log.Printf("[ERROR] Reading file in zip archive: %v", err) continue } @@ -246,31 +182,15 @@ func (z *Zip) extractNext(to string) error { return err // don't wrap error; calling loop must break on io.EOF } defer f.Close() + return z.extractFile(f, to) +} +func (z *Zip) extractFile(f File, to string) error { header, ok := f.Header.(zip.FileHeader) if !ok { return fmt.Errorf("expected header to be zip.FileHeader but was %T", f.Header) } - errPath := z.CheckPath(to, header.Name) - if errPath != nil { - return fmt.Errorf("checking path traversal attempt: %v", errPath) - } - - if z.StripComponents > 0 { - if strings.Count(header.Name, "/") < z.StripComponents { - return nil // skip path with fewer components - } - - for i := 0; i < z.StripComponents; i++ { - slash := strings.Index(header.Name, "/") - header.Name = header.Name[slash+1:] - } - } - return z.extractFile(f, to, &header) -} - -func (z *Zip) extractFile(f File, to string, header *zip.FileHeader) error { to = filepath.Join(to, header.Name) // if a directory, no content; simply make the directory and return @@ -372,20 +292,6 @@ func (z *Zip) Create(out io.Writer) error { return flate.NewWriter(out, z.CompressionLevel) }) } - switch z.FileMethod { - case BZIP2: - z.zw.RegisterCompressor(uint16(BZIP2), func(out io.Writer) (io.WriteCloser, error) { - return bzip2.NewWriter(out, &bzip2.WriterConfig{Level: z.CompressionLevel}) - }) - case ZSTD: - z.zw.RegisterCompressor(uint16(ZSTD), func(out io.Writer) (io.WriteCloser, error) { - return zstd.NewWriter(out) - }) - case XZ: - z.zw.RegisterCompressor(uint16(XZ), func(out io.Writer) (io.WriteCloser, error) { - return xz.NewWriter(out) - }) - } return nil } @@ -414,7 +320,7 @@ func (z *Zip) Write(f File) error { if _, ok := compressedFormats[ext]; ok && z.SelectiveCompression { header.Method = zip.Store } else { - header.Method = uint16(z.FileMethod) + header.Method = zip.Deflate } } @@ -470,7 +376,6 @@ func (z *Zip) Open(in io.Reader, size int64) error { if err != nil { return fmt.Errorf("creating reader: %v", err) } - registerDecompressor(z.zr) z.ridx = 0 return nil } @@ -527,13 +432,11 @@ func (z *Zip) Walk(archive string, walkFn WalkFunc) error { return fmt.Errorf("opening zip reader: %v", err) } defer zr.Close() - registerDecompressor(&zr.Reader) + for _, zf := range zr.File { zfrc, err := zf.Open() if err != nil { - if zfrc != nil { - zfrc.Close() - } + zfrc.Close() if z.ContinueOnError { log.Printf("[ERROR] Opening %s: %v", zf.Name, err) continue @@ -598,7 +501,7 @@ func (z *Zip) Extract(source, target, destination string) error { } joined := filepath.Join(destination, end) - err = z.extractFile(f, joined, &zfh) + err = z.extractFile(f, joined) if err != nil { return fmt.Errorf("extracting file %s: %v", zfh.Name, err) } @@ -627,9 +530,7 @@ func (*Zip) Match(file io.ReadSeeker) (bool, error) { if err != nil { return false, err } - defer func() { - _, _ = file.Seek(currentPos, io.SeekStart) - }() + defer file.Seek(currentPos, io.SeekStart) buf := make([]byte, 4) if n, err := file.Read(buf); err != nil || n < 4 { @@ -646,7 +547,6 @@ func NewZip() *Zip { CompressionLevel: flate.DefaultCompression, MkdirAll: true, SelectiveCompression: true, - FileMethod: Deflate, } } @@ -660,7 +560,6 @@ var ( _ = Extractor(new(Zip)) _ = Matcher(new(Zip)) _ = ExtensionChecker(new(Zip)) - _ = FilenameChecker(new(Zip)) ) // compressedFormats is a (non-exhaustive) set of lowercased diff --git a/vendor/github.com/mholt/archiver/v3/zstd.go b/vendor/github.com/mholt/archiver/v3/zstd.go index 60c11efc49..3955628c7f 100644 --- a/vendor/github.com/mholt/archiver/v3/zstd.go +++ b/vendor/github.com/mholt/archiver/v3/zstd.go @@ -10,13 +10,11 @@ import ( // Zstd facilitates Zstandard compression. type Zstd struct { - EncoderOptions []zstd.EOption - DecoderOptions []zstd.DOption } // Compress reads in, compresses it, and writes it to out. func (zs *Zstd) Compress(in io.Reader, out io.Writer) error { - w, err := zstd.NewWriter(out, zs.EncoderOptions...) + w, err := zstd.NewWriter(out) if err != nil { return err } @@ -27,7 +25,7 @@ func (zs *Zstd) Compress(in io.Reader, out io.Writer) error { // Decompress reads in, decompresses it, and writes it to out. func (zs *Zstd) Decompress(in io.Reader, out io.Writer) error { - r, err := zstd.NewReader(in, zs.DecoderOptions...) + r, err := zstd.NewReader(in) if err != nil { return err } diff --git a/vendor/github.com/tklauser/go-sysconf/LICENSE b/vendor/github.com/mmcloughlin/avo/LICENSE similarity index 97% rename from vendor/github.com/tklauser/go-sysconf/LICENSE rename to vendor/github.com/mmcloughlin/avo/LICENSE index cf198debc6..c986d80776 100644 --- a/vendor/github.com/tklauser/go-sysconf/LICENSE +++ b/vendor/github.com/mmcloughlin/avo/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2018-2021, Tobias Klauser +Copyright (c) 2018, Michael McLoughlin All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/vendor/github.com/mmcloughlin/avo/attr/attr.go b/vendor/github.com/mmcloughlin/avo/attr/attr.go new file mode 100644 index 0000000000..016e0a4c37 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/attr/attr.go @@ -0,0 +1,102 @@ +// Package attr provides attributes for text and data sections. +package attr + +import ( + "fmt" + "math/bits" + "strings" +) + +// Attribute represents TEXT or DATA flags. +type Attribute uint16 + +// Reference: https://github.com/golang/go/blob/aafe257390cc9048e8b5df898fabd79a9e0d4c39/src/runtime/textflag.h#L11-L37 +// +// // Don't profile the marked routine. This flag is deprecated. +// #define NOPROF 1 +// // It is ok for the linker to get multiple of these symbols. It will +// // pick one of the duplicates to use. +// #define DUPOK 2 +// // Don't insert stack check preamble. +// #define NOSPLIT 4 +// // Put this data in a read-only section. +// #define RODATA 8 +// // This data contains no pointers. +// #define NOPTR 16 +// // This is a wrapper function and should not count as disabling 'recover'. +// #define WRAPPER 32 +// // This function uses its incoming context register. +// #define NEEDCTXT 64 +// // Allocate a word of thread local storage and store the offset from the +// // thread local base to the thread local storage in this variable. +// #define TLSBSS 256 +// // Do not insert instructions to allocate a stack frame for this function. +// // Only valid on functions that declare a frame size of 0. +// // TODO(mwhudson): only implemented for ppc64x at present. +// #define NOFRAME 512 +// // Function can call reflect.Type.Method or reflect.Type.MethodByName. +// #define REFLECTMETHOD 1024 +// // Function is the top of the call stack. Call stack unwinders should stop +// // at this function. +// #define TOPFRAME 2048 +// +const ( + NOPROF Attribute = 1 << iota + DUPOK + NOSPLIT + RODATA + NOPTR + WRAPPER + NEEDCTXT + _ + TLSBSS + NOFRAME + REFLECTMETHOD + TOPFRAME +) + +// Asm returns a representation of the attributes in assembly syntax. This may use macros from "textflags.h"; see ContainsTextFlags() to determine if this header is required. +func (a Attribute) Asm() string { + parts, rest := a.split() + if len(parts) == 0 || rest != 0 { + parts = append(parts, fmt.Sprintf("%d", rest)) + } + return strings.Join(parts, "|") +} + +// ContainsTextFlags returns whether the Asm() representation requires macros in "textflags.h". +func (a Attribute) ContainsTextFlags() bool { + flags, _ := a.split() + return len(flags) > 0 +} + +// split splits a into known flags and any remaining bits. +func (a Attribute) split() ([]string, Attribute) { + var flags []string + var rest Attribute + for a != 0 { + i := uint(bits.TrailingZeros16(uint16(a))) + bit := Attribute(1) << i + if flag := attrname[bit]; flag != "" { + flags = append(flags, flag) + } else { + rest |= bit + } + a ^= bit + } + return flags, rest +} + +var attrname = map[Attribute]string{ + NOPROF: "NOPROF", + DUPOK: "DUPOK", + NOSPLIT: "NOSPLIT", + RODATA: "RODATA", + NOPTR: "NOPTR", + WRAPPER: "WRAPPER", + NEEDCTXT: "NEEDCTXT", + TLSBSS: "TLSBSS", + NOFRAME: "NOFRAME", + REFLECTMETHOD: "REFLECTMETHOD", + TOPFRAME: "TOPFRAME", +} diff --git a/vendor/github.com/mmcloughlin/avo/build/attr.go b/vendor/github.com/mmcloughlin/avo/build/attr.go new file mode 100644 index 0000000000..1a9870b0fe --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/build/attr.go @@ -0,0 +1,18 @@ +package build + +import "github.com/mmcloughlin/avo/attr" + +// TEXT and DATA attribute values included for convenience. +const ( + NOPROF = attr.NOPROF + DUPOK = attr.DUPOK + NOSPLIT = attr.NOSPLIT + RODATA = attr.RODATA + NOPTR = attr.NOPTR + WRAPPER = attr.WRAPPER + NEEDCTXT = attr.NEEDCTXT + TLSBSS = attr.TLSBSS + NOFRAME = attr.NOFRAME + REFLECTMETHOD = attr.REFLECTMETHOD + TOPFRAME = attr.TOPFRAME +) diff --git a/vendor/github.com/mmcloughlin/avo/build/cli.go b/vendor/github.com/mmcloughlin/avo/build/cli.go new file mode 100644 index 0000000000..8a4a379ef0 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/build/cli.go @@ -0,0 +1,171 @@ +package build + +import ( + "flag" + "io" + "log" + "os" + "runtime/pprof" + + "github.com/mmcloughlin/avo/pass" + "github.com/mmcloughlin/avo/printer" +) + +// Config contains options for an avo main function. +type Config struct { + ErrOut io.Writer + MaxErrors int // max errors to report; 0 means unlimited + CPUProfile io.WriteCloser + Passes []pass.Interface +} + +// Main is the standard main function for an avo program. This extracts the +// result from the build Context (logging and exiting on error), and performs +// configured passes. +func Main(cfg *Config, context *Context) int { + diag := log.New(cfg.ErrOut, "", 0) + + if cfg.CPUProfile != nil { + defer cfg.CPUProfile.Close() + if err := pprof.StartCPUProfile(cfg.CPUProfile); err != nil { + diag.Println("could not start CPU profile: ", err) + return 1 + } + defer pprof.StopCPUProfile() + } + + f, err := context.Result() + if err != nil { + LogError(diag, err, cfg.MaxErrors) + return 1 + } + + p := pass.Concat(cfg.Passes...) + if err := p.Execute(f); err != nil { + diag.Println(err) + return 1 + } + + return 0 +} + +// Flags represents CLI flags for an avo program. +type Flags struct { + errout *outputValue + allerrors bool + cpuprof *outputValue + pkg string + printers []*printerValue +} + +// NewFlags initializes avo flags for the given FlagSet. +func NewFlags(fs *flag.FlagSet) *Flags { + f := &Flags{} + + f.errout = newOutputValue(os.Stderr) + fs.Var(f.errout, "log", "diagnostics output") + + fs.BoolVar(&f.allerrors, "e", false, "no limit on number of errors reported") + + f.cpuprof = newOutputValue(nil) + fs.Var(f.cpuprof, "cpuprofile", "write cpu profile to `file`") + + fs.StringVar(&f.pkg, "pkg", "", "package name (defaults to current directory name)") + + goasm := newPrinterValue(printer.NewGoAsm, os.Stdout) + fs.Var(goasm, "out", "assembly output") + f.printers = append(f.printers, goasm) + + stubs := newPrinterValue(printer.NewStubs, nil) + fs.Var(stubs, "stubs", "go stub file") + f.printers = append(f.printers, stubs) + + return f +} + +// Config builds a configuration object based on flag values. +func (f *Flags) Config() *Config { + pc := printer.NewGoRunConfig() + if f.pkg != "" { + pc.Pkg = f.pkg + } + passes := []pass.Interface{pass.Compile} + for _, pv := range f.printers { + p := pv.Build(pc) + if p != nil { + passes = append(passes, p) + } + } + + cfg := &Config{ + ErrOut: f.errout.w, + MaxErrors: 10, + CPUProfile: f.cpuprof.w, + Passes: passes, + } + + if f.allerrors { + cfg.MaxErrors = 0 + } + + return cfg +} + +type outputValue struct { + w io.WriteCloser + filename string +} + +func newOutputValue(dflt io.WriteCloser) *outputValue { + return &outputValue{w: dflt} +} + +func (o *outputValue) String() string { + if o == nil { + return "" + } + return o.filename +} + +func (o *outputValue) Set(s string) error { + o.filename = s + if s == "-" { + o.w = nopwritecloser{os.Stdout} + return nil + } + f, err := os.Create(s) + if err != nil { + return err + } + o.w = f + return nil +} + +type printerValue struct { + *outputValue + Builder printer.Builder +} + +func newPrinterValue(b printer.Builder, dflt io.WriteCloser) *printerValue { + return &printerValue{ + outputValue: newOutputValue(dflt), + Builder: b, + } +} + +func (p *printerValue) Build(cfg printer.Config) pass.Interface { + if p.outputValue.w == nil { + return nil + } + return &pass.Output{ + Writer: p.outputValue.w, + Printer: p.Builder(cfg), + } +} + +// nopwritecloser wraps a Writer and provides a null implementation of Close(). +type nopwritecloser struct { + io.Writer +} + +func (nopwritecloser) Close() error { return nil } diff --git a/vendor/github.com/mmcloughlin/avo/build/context.go b/vendor/github.com/mmcloughlin/avo/build/context.go new file mode 100644 index 0000000000..beb4f60fce --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/build/context.go @@ -0,0 +1,223 @@ +package build + +import ( + "errors" + "fmt" + "go/types" + + "golang.org/x/tools/go/packages" + + "github.com/mmcloughlin/avo/attr" + "github.com/mmcloughlin/avo/buildtags" + "github.com/mmcloughlin/avo/gotypes" + "github.com/mmcloughlin/avo/ir" + "github.com/mmcloughlin/avo/operand" + "github.com/mmcloughlin/avo/reg" +) + +// Context maintains state for incrementally building an avo File. +type Context struct { + pkg *packages.Package + file *ir.File + function *ir.Function + global *ir.Global + errs ErrorList + reg.Collection +} + +// NewContext initializes an empty build Context. +func NewContext() *Context { + return &Context{ + file: ir.NewFile(), + Collection: *reg.NewCollection(), + } +} + +// Package sets the package the generated file will belong to. Required to be able to reference types in the package. +func (c *Context) Package(path string) { + cfg := &packages.Config{ + Mode: packages.NeedTypes | packages.NeedDeps | packages.NeedImports, + } + pkgs, err := packages.Load(cfg, path) + if err != nil { + c.adderror(err) + return + } + pkg := pkgs[0] + if len(pkg.Errors) > 0 { + for _, err := range pkg.Errors { + c.adderror(err) + } + return + } + c.pkg = pkg +} + +// Constraints sets build constraints for the file. +func (c *Context) Constraints(t buildtags.ConstraintsConvertable) { + cs := t.ToConstraints() + if err := cs.Validate(); err != nil { + c.adderror(err) + return + } + c.file.Constraints = cs +} + +// Constraint appends a constraint to the file's build constraints. +func (c *Context) Constraint(t buildtags.ConstraintConvertable) { + c.Constraints(append(c.file.Constraints, t.ToConstraint())) +} + +// ConstraintExpr appends a constraint to the file's build constraints. The +// constraint to add is parsed from the given expression. The expression should +// look the same as the content following "// +build " in regular build +// constraint comments. +func (c *Context) ConstraintExpr(expr string) { + constraint, err := buildtags.ParseConstraint(expr) + if err != nil { + c.adderror(err) + return + } + c.Constraint(constraint) +} + +// Function starts building a new function with the given name. +func (c *Context) Function(name string) { + c.function = ir.NewFunction(name) + c.file.AddSection(c.function) +} + +// Doc sets documentation comment lines for the currently active function. +func (c *Context) Doc(lines ...string) { + c.activefunc().Doc = lines +} + +// Pragma adds a compiler directive to the currently active function. +func (c *Context) Pragma(directive string, args ...string) { + c.activefunc().AddPragma(directive, args...) +} + +// Attributes sets function attributes for the currently active function. +func (c *Context) Attributes(a attr.Attribute) { + c.activefunc().Attributes = a +} + +// Signature sets the signature for the currently active function. +func (c *Context) Signature(s *gotypes.Signature) { + c.activefunc().SetSignature(s) +} + +// SignatureExpr parses the signature expression and sets it as the active function's signature. +func (c *Context) SignatureExpr(expr string) { + s, err := gotypes.ParseSignatureInPackage(c.types(), expr) + if err != nil { + c.adderror(err) + return + } + c.Signature(s) +} + +// Implement starts building a function of the given name, whose type is +// specified by a stub in the containing package. +func (c *Context) Implement(name string) { + pkg := c.types() + if pkg == nil { + c.adderrormessage("no package specified") + return + } + s, err := gotypes.LookupSignature(pkg, name) + if err != nil { + c.adderror(err) + return + } + c.Function(name) + c.Signature(s) +} + +func (c *Context) types() *types.Package { + if c.pkg == nil { + return nil + } + return c.pkg.Types +} + +// AllocLocal allocates size bytes in the stack of the currently active function. +// Returns a reference to the base pointer for the newly allocated region. +func (c *Context) AllocLocal(size int) operand.Mem { + return c.activefunc().AllocLocal(size) +} + +// Instruction adds an instruction to the active function. +func (c *Context) Instruction(i *ir.Instruction) { + c.activefunc().AddInstruction(i) +} + +// Label adds a label to the active function. +func (c *Context) Label(name string) { + c.activefunc().AddLabel(ir.Label(name)) +} + +// Comment adds comment lines to the active function. +func (c *Context) Comment(lines ...string) { + c.activefunc().AddComment(lines...) +} + +// Commentf adds a formtted comment line. +func (c *Context) Commentf(format string, a ...interface{}) { + c.Comment(fmt.Sprintf(format, a...)) +} + +func (c *Context) activefunc() *ir.Function { + if c.function == nil { + c.adderrormessage("no active function") + return ir.NewFunction("") + } + return c.function +} + +//go:generate avogen -output zinstructions.go build + +// StaticGlobal adds a new static data section to the file and returns a pointer to it. +func (c *Context) StaticGlobal(name string) operand.Mem { + c.global = ir.NewStaticGlobal(name) + c.file.AddSection(c.global) + return c.global.Base() +} + +// DataAttributes sets the attributes on the current active global data section. +func (c *Context) DataAttributes(a attr.Attribute) { + c.activeglobal().Attributes = a +} + +// AddDatum adds constant v at offset to the current active global data section. +func (c *Context) AddDatum(offset int, v operand.Constant) { + if err := c.activeglobal().AddDatum(ir.NewDatum(offset, v)); err != nil { + c.adderror(err) + } +} + +// AppendDatum appends a constant to the current active global data section. +func (c *Context) AppendDatum(v operand.Constant) { + c.activeglobal().Append(v) +} + +func (c *Context) activeglobal() *ir.Global { + if c.global == nil { + c.adderrormessage("no active global") + return ir.NewStaticGlobal("") + } + return c.global +} + +func (c *Context) adderror(err error) { + c.errs.addext(err) +} + +func (c *Context) adderrormessage(msg string) { + c.adderror(errors.New(msg)) +} + +// Result returns the built file and any accumulated errors. +func (c *Context) Result() (*ir.File, error) { + return c.file, c.errs.Err() +} diff --git a/vendor/github.com/mmcloughlin/avo/build/doc.go b/vendor/github.com/mmcloughlin/avo/build/doc.go new file mode 100644 index 0000000000..8b9a604709 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/build/doc.go @@ -0,0 +1,2 @@ +// Package build provides an assembly-like interface for incremental building of avo Files. +package build diff --git a/vendor/github.com/mmcloughlin/avo/build/error.go b/vendor/github.com/mmcloughlin/avo/build/error.go new file mode 100644 index 0000000000..1da00cbfb6 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/build/error.go @@ -0,0 +1,88 @@ +package build + +import ( + "fmt" + "log" + + "github.com/mmcloughlin/avo/internal/stack" + "github.com/mmcloughlin/avo/src" +) + +// Error represents an error during building, optionally tagged with the position at which it happened. +type Error struct { + Position src.Position + Err error +} + +// exterr constructs an Error with position derived from the first frame in the +// call stack outside this package. +func exterr(err error) Error { + e := Error{Err: err} + if f := stack.ExternalCaller(); f != nil { + e.Position = src.FramePosition(*f).Relwd() + } + return e +} + +func (e Error) Error() string { + msg := e.Err.Error() + if e.Position.IsValid() { + return e.Position.String() + ": " + msg + } + return msg +} + +// ErrorList is a collection of errors for a source file. +type ErrorList []Error + +// Add appends an error to the list. +func (e *ErrorList) Add(err Error) { + *e = append(*e, err) +} + +// AddAt appends an error at position p. +func (e *ErrorList) AddAt(p src.Position, err error) { + e.Add(Error{p, err}) +} + +// addext appends an error to the list, tagged with the +func (e *ErrorList) addext(err error) { + e.Add(exterr(err)) +} + +// Err returns an error equivalent to this error list. +// If the list is empty, Err returns nil. +func (e ErrorList) Err() error { + if len(e) == 0 { + return nil + } + return e +} + +// An ErrorList implements the error interface. +func (e ErrorList) Error() string { + switch len(e) { + case 0: + return "no errors" + case 1: + return e[0].Error() + } + return fmt.Sprintf("%s (and %d more errors)", e[0], len(e)-1) +} + +// LogError logs a list of errors, one error per line, if the err parameter is +// an ErrorList. Otherwise it just logs the err string. Reports at most max +// errors, or unlimited if max is 0. +func LogError(l *log.Logger, err error, max int) { + if list, ok := err.(ErrorList); ok { + for i, e := range list { + if max > 0 && i == max { + l.Print("too many errors") + return + } + l.Printf("%s\n", e) + } + } else if err != nil { + l.Printf("%s\n", err) + } +} diff --git a/vendor/github.com/mmcloughlin/avo/build/global.go b/vendor/github.com/mmcloughlin/avo/build/global.go new file mode 100644 index 0000000000..4095f81b1d --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/build/global.go @@ -0,0 +1,151 @@ +package build + +import ( + "flag" + "os" + + "github.com/mmcloughlin/avo/attr" + "github.com/mmcloughlin/avo/buildtags" + "github.com/mmcloughlin/avo/gotypes" + "github.com/mmcloughlin/avo/operand" + + "github.com/mmcloughlin/avo/reg" +) + +// ctx provides a global build context. +var ctx = NewContext() + +// TEXT starts building a new function called name, with attributes a, and sets its signature (see SignatureExpr). +func TEXT(name string, a attr.Attribute, signature string) { + ctx.Function(name) + ctx.Attributes(a) + ctx.SignatureExpr(signature) +} + +// GLOBL declares a new static global data section with the given attributes. +func GLOBL(name string, a attr.Attribute) operand.Mem { + // TODO(mbm): should this be static? + g := ctx.StaticGlobal(name) + ctx.DataAttributes(a) + return g +} + +// DATA adds a data value to the active data section. +func DATA(offset int, v operand.Constant) { + ctx.AddDatum(offset, v) +} + +var flags = NewFlags(flag.CommandLine) + +// Generate builds and compiles the avo file built with the global context. This +// should be the final line of any avo program. Configuration is determined from command-line flags. +func Generate() { + if !flag.Parsed() { + flag.Parse() + } + cfg := flags.Config() + + status := Main(cfg, ctx) + + // To record coverage of integration tests we wrap main() functions in a test + // functions. In this case we need the main function to terminate, therefore we + // only exit for failure status codes. + if status != 0 { + os.Exit(status) + } +} + +// Package sets the package the generated file will belong to. Required to be able to reference types in the package. +func Package(path string) { ctx.Package(path) } + +// Constraints sets build constraints for the file. +func Constraints(t buildtags.ConstraintsConvertable) { ctx.Constraints(t) } + +// Constraint appends a constraint to the file's build constraints. +func Constraint(t buildtags.ConstraintConvertable) { ctx.Constraint(t) } + +// ConstraintExpr appends a constraint to the file's build constraints. The +// constraint to add is parsed from the given expression. The expression should +// look the same as the content following "// +build " in regular build +// constraint comments. +func ConstraintExpr(expr string) { ctx.ConstraintExpr(expr) } + +// GP8L allocates and returns a general-purpose 8-bit register (low byte). +func GP8L() reg.GPVirtual { return ctx.GP8L() } + +// GP8H allocates and returns a general-purpose 8-bit register (high byte). +func GP8H() reg.GPVirtual { return ctx.GP8H() } + +// GP8 allocates and returns a general-purpose 8-bit register (low byte). +func GP8() reg.GPVirtual { return ctx.GP8() } + +// GP16 allocates and returns a general-purpose 16-bit register. +func GP16() reg.GPVirtual { return ctx.GP16() } + +// GP32 allocates and returns a general-purpose 32-bit register. +func GP32() reg.GPVirtual { return ctx.GP32() } + +// GP64 allocates and returns a general-purpose 64-bit register. +func GP64() reg.GPVirtual { return ctx.GP64() } + +// XMM allocates and returns a 128-bit vector register. +func XMM() reg.VecVirtual { return ctx.XMM() } + +// YMM allocates and returns a 256-bit vector register. +func YMM() reg.VecVirtual { return ctx.YMM() } + +// ZMM allocates and returns a 512-bit vector register. +func ZMM() reg.VecVirtual { return ctx.ZMM() } + +// Param returns a the named argument of the active function. +func Param(name string) gotypes.Component { return ctx.Param(name) } + +// ParamIndex returns the ith argument of the active function. +func ParamIndex(i int) gotypes.Component { return ctx.ParamIndex(i) } + +// Return returns a the named return value of the active function. +func Return(name string) gotypes.Component { return ctx.Return(name) } + +// ReturnIndex returns the ith argument of the active function. +func ReturnIndex(i int) gotypes.Component { return ctx.ReturnIndex(i) } + +// Load the function argument src into register dst. Returns the destination +// register. This is syntactic sugar: it will attempt to select the right MOV +// instruction based on the types involved. +func Load(src gotypes.Component, dst reg.Register) reg.Register { return ctx.Load(src, dst) } + +// Store register src into return value dst. This is syntactic sugar: it will +// attempt to select the right MOV instruction based on the types involved. +func Store(src reg.Register, dst gotypes.Component) { ctx.Store(src, dst) } + +// Dereference loads a pointer and returns its element type. +func Dereference(ptr gotypes.Component) gotypes.Component { return ctx.Dereference(ptr) } + +// Doc sets documentation comment lines for the currently active function. +func Doc(lines ...string) { ctx.Doc(lines...) } + +// Pragma adds a compiler directive to the currently active function. +func Pragma(directive string, args ...string) { ctx.Pragma(directive, args...) } + +// Attributes sets function attributes for the currently active function. +func Attributes(a attr.Attribute) { ctx.Attributes(a) } + +// Implement starts building a function of the given name, whose type is +// specified by a stub in the containing package. +func Implement(name string) { ctx.Implement(name) } + +// AllocLocal allocates size bytes in the stack of the currently active function. +// Returns a reference to the base pointer for the newly allocated region. +func AllocLocal(size int) operand.Mem { return ctx.AllocLocal(size) } + +// Label adds a label to the active function. +func Label(name string) { ctx.Label(name) } + +// Comment adds comment lines to the active function. +func Comment(lines ...string) { ctx.Comment(lines...) } + +// Commentf adds a formtted comment line. +func Commentf(format string, a ...interface{}) { ctx.Commentf(format, a...) } + +// ConstData builds a static data section containing just the given constant. +func ConstData(name string, v operand.Constant) operand.Mem { return ctx.ConstData(name, v) } diff --git a/vendor/github.com/mmcloughlin/avo/build/pseudo.go b/vendor/github.com/mmcloughlin/avo/build/pseudo.go new file mode 100644 index 0000000000..83a570e440 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/build/pseudo.go @@ -0,0 +1,70 @@ +package build + +import ( + "github.com/mmcloughlin/avo/attr" + "github.com/mmcloughlin/avo/operand" + "github.com/mmcloughlin/avo/reg" + + "github.com/mmcloughlin/avo/gotypes" +) + +//go:generate avogen -output zmov.go mov + +// Param returns a the named argument of the active function. +func (c *Context) Param(name string) gotypes.Component { + return c.activefunc().Signature.Params().Lookup(name) +} + +// ParamIndex returns the ith argument of the active function. +func (c *Context) ParamIndex(i int) gotypes.Component { + return c.activefunc().Signature.Params().At(i) +} + +// Return returns a the named return value of the active function. +func (c *Context) Return(name string) gotypes.Component { + return c.activefunc().Signature.Results().Lookup(name) +} + +// ReturnIndex returns the ith argument of the active function. +func (c *Context) ReturnIndex(i int) gotypes.Component { + return c.activefunc().Signature.Results().At(i) +} + +// Load the function argument src into register dst. Returns the destination +// register. This is syntactic sugar: it will attempt to select the right MOV +// instruction based on the types involved. +func (c *Context) Load(src gotypes.Component, dst reg.Register) reg.Register { + b, err := src.Resolve() + if err != nil { + c.adderror(err) + return dst + } + c.mov(b.Addr, dst, int(gotypes.Sizes.Sizeof(b.Type)), int(dst.Size()), b.Type) + return dst +} + +// Store register src into return value dst. This is syntactic sugar: it will +// attempt to select the right MOV instruction based on the types involved. +func (c *Context) Store(src reg.Register, dst gotypes.Component) { + b, err := dst.Resolve() + if err != nil { + c.adderror(err) + return + } + c.mov(src, b.Addr, int(src.Size()), int(gotypes.Sizes.Sizeof(b.Type)), b.Type) +} + +// Dereference loads a pointer and returns its element type. +func (c *Context) Dereference(ptr gotypes.Component) gotypes.Component { + r := c.GP64() + c.Load(ptr, r) + return ptr.Dereference(r) +} + +// ConstData builds a static data section containing just the given constant. +func (c *Context) ConstData(name string, v operand.Constant) operand.Mem { + g := c.StaticGlobal(name) + c.DataAttributes(attr.RODATA | attr.NOPTR) + c.AppendDatum(v) + return g +} diff --git a/vendor/github.com/mmcloughlin/avo/build/zinstructions.go b/vendor/github.com/mmcloughlin/avo/build/zinstructions.go new file mode 100644 index 0000000000..33c2085ee9 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/build/zinstructions.go @@ -0,0 +1,26315 @@ +// Code generated by command: avogen -output zinstructions.go build. DO NOT EDIT. + +package build + +import ( + "github.com/mmcloughlin/avo/operand" + "github.com/mmcloughlin/avo/x86" +) + +// ADCB: Add with Carry. +// +// Forms: +// +// ADCB imm8 al +// ADCB imm8 r8 +// ADCB r8 r8 +// ADCB m8 r8 +// ADCB imm8 m8 +// ADCB r8 m8 +// Construct and append a ADCB instruction to the active function. +func (c *Context) ADCB(imr, amr operand.Op) { + if inst, err := x86.ADCB(imr, amr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADCB: Add with Carry. +// +// Forms: +// +// ADCB imm8 al +// ADCB imm8 r8 +// ADCB r8 r8 +// ADCB m8 r8 +// ADCB imm8 m8 +// ADCB r8 m8 +// Construct and append a ADCB instruction to the active function. +// Operates on the global context. +func ADCB(imr, amr operand.Op) { ctx.ADCB(imr, amr) } + +// ADCL: Add with Carry. +// +// Forms: +// +// ADCL imm32 eax +// ADCL imm8 r32 +// ADCL imm32 r32 +// ADCL r32 r32 +// ADCL m32 r32 +// ADCL imm8 m32 +// ADCL imm32 m32 +// ADCL r32 m32 +// Construct and append a ADCL instruction to the active function. +func (c *Context) ADCL(imr, emr operand.Op) { + if inst, err := x86.ADCL(imr, emr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADCL: Add with Carry. +// +// Forms: +// +// ADCL imm32 eax +// ADCL imm8 r32 +// ADCL imm32 r32 +// ADCL r32 r32 +// ADCL m32 r32 +// ADCL imm8 m32 +// ADCL imm32 m32 +// ADCL r32 m32 +// Construct and append a ADCL instruction to the active function. +// Operates on the global context. +func ADCL(imr, emr operand.Op) { ctx.ADCL(imr, emr) } + +// ADCQ: Add with Carry. +// +// Forms: +// +// ADCQ imm32 rax +// ADCQ imm8 r64 +// ADCQ imm32 r64 +// ADCQ r64 r64 +// ADCQ m64 r64 +// ADCQ imm8 m64 +// ADCQ imm32 m64 +// ADCQ r64 m64 +// Construct and append a ADCQ instruction to the active function. +func (c *Context) ADCQ(imr, mr operand.Op) { + if inst, err := x86.ADCQ(imr, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADCQ: Add with Carry. +// +// Forms: +// +// ADCQ imm32 rax +// ADCQ imm8 r64 +// ADCQ imm32 r64 +// ADCQ r64 r64 +// ADCQ m64 r64 +// ADCQ imm8 m64 +// ADCQ imm32 m64 +// ADCQ r64 m64 +// Construct and append a ADCQ instruction to the active function. +// Operates on the global context. +func ADCQ(imr, mr operand.Op) { ctx.ADCQ(imr, mr) } + +// ADCW: Add with Carry. +// +// Forms: +// +// ADCW imm16 ax +// ADCW imm8 r16 +// ADCW imm16 r16 +// ADCW r16 r16 +// ADCW m16 r16 +// ADCW imm8 m16 +// ADCW imm16 m16 +// ADCW r16 m16 +// Construct and append a ADCW instruction to the active function. +func (c *Context) ADCW(imr, amr operand.Op) { + if inst, err := x86.ADCW(imr, amr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADCW: Add with Carry. +// +// Forms: +// +// ADCW imm16 ax +// ADCW imm8 r16 +// ADCW imm16 r16 +// ADCW r16 r16 +// ADCW m16 r16 +// ADCW imm8 m16 +// ADCW imm16 m16 +// ADCW r16 m16 +// Construct and append a ADCW instruction to the active function. +// Operates on the global context. +func ADCW(imr, amr operand.Op) { ctx.ADCW(imr, amr) } + +// ADCXL: Unsigned Integer Addition of Two Operands with Carry Flag. +// +// Forms: +// +// ADCXL r32 r32 +// ADCXL m32 r32 +// Construct and append a ADCXL instruction to the active function. +func (c *Context) ADCXL(mr, r operand.Op) { + if inst, err := x86.ADCXL(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADCXL: Unsigned Integer Addition of Two Operands with Carry Flag. +// +// Forms: +// +// ADCXL r32 r32 +// ADCXL m32 r32 +// Construct and append a ADCXL instruction to the active function. +// Operates on the global context. +func ADCXL(mr, r operand.Op) { ctx.ADCXL(mr, r) } + +// ADCXQ: Unsigned Integer Addition of Two Operands with Carry Flag. +// +// Forms: +// +// ADCXQ r64 r64 +// ADCXQ m64 r64 +// Construct and append a ADCXQ instruction to the active function. +func (c *Context) ADCXQ(mr, r operand.Op) { + if inst, err := x86.ADCXQ(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADCXQ: Unsigned Integer Addition of Two Operands with Carry Flag. +// +// Forms: +// +// ADCXQ r64 r64 +// ADCXQ m64 r64 +// Construct and append a ADCXQ instruction to the active function. +// Operates on the global context. +func ADCXQ(mr, r operand.Op) { ctx.ADCXQ(mr, r) } + +// ADDB: Add. +// +// Forms: +// +// ADDB imm8 al +// ADDB imm8 r8 +// ADDB r8 r8 +// ADDB m8 r8 +// ADDB imm8 m8 +// ADDB r8 m8 +// Construct and append a ADDB instruction to the active function. +func (c *Context) ADDB(imr, amr operand.Op) { + if inst, err := x86.ADDB(imr, amr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADDB: Add. +// +// Forms: +// +// ADDB imm8 al +// ADDB imm8 r8 +// ADDB r8 r8 +// ADDB m8 r8 +// ADDB imm8 m8 +// ADDB r8 m8 +// Construct and append a ADDB instruction to the active function. +// Operates on the global context. +func ADDB(imr, amr operand.Op) { ctx.ADDB(imr, amr) } + +// ADDL: Add. +// +// Forms: +// +// ADDL imm32 eax +// ADDL imm8 r32 +// ADDL imm32 r32 +// ADDL r32 r32 +// ADDL m32 r32 +// ADDL imm8 m32 +// ADDL imm32 m32 +// ADDL r32 m32 +// Construct and append a ADDL instruction to the active function. +func (c *Context) ADDL(imr, emr operand.Op) { + if inst, err := x86.ADDL(imr, emr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADDL: Add. +// +// Forms: +// +// ADDL imm32 eax +// ADDL imm8 r32 +// ADDL imm32 r32 +// ADDL r32 r32 +// ADDL m32 r32 +// ADDL imm8 m32 +// ADDL imm32 m32 +// ADDL r32 m32 +// Construct and append a ADDL instruction to the active function. +// Operates on the global context. +func ADDL(imr, emr operand.Op) { ctx.ADDL(imr, emr) } + +// ADDPD: Add Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// ADDPD xmm xmm +// ADDPD m128 xmm +// Construct and append a ADDPD instruction to the active function. +func (c *Context) ADDPD(mx, x operand.Op) { + if inst, err := x86.ADDPD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADDPD: Add Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// ADDPD xmm xmm +// ADDPD m128 xmm +// Construct and append a ADDPD instruction to the active function. +// Operates on the global context. +func ADDPD(mx, x operand.Op) { ctx.ADDPD(mx, x) } + +// ADDPS: Add Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// ADDPS xmm xmm +// ADDPS m128 xmm +// Construct and append a ADDPS instruction to the active function. +func (c *Context) ADDPS(mx, x operand.Op) { + if inst, err := x86.ADDPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADDPS: Add Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// ADDPS xmm xmm +// ADDPS m128 xmm +// Construct and append a ADDPS instruction to the active function. +// Operates on the global context. +func ADDPS(mx, x operand.Op) { ctx.ADDPS(mx, x) } + +// ADDQ: Add. +// +// Forms: +// +// ADDQ imm32 rax +// ADDQ imm8 r64 +// ADDQ imm32 r64 +// ADDQ r64 r64 +// ADDQ m64 r64 +// ADDQ imm8 m64 +// ADDQ imm32 m64 +// ADDQ r64 m64 +// Construct and append a ADDQ instruction to the active function. +func (c *Context) ADDQ(imr, mr operand.Op) { + if inst, err := x86.ADDQ(imr, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADDQ: Add. +// +// Forms: +// +// ADDQ imm32 rax +// ADDQ imm8 r64 +// ADDQ imm32 r64 +// ADDQ r64 r64 +// ADDQ m64 r64 +// ADDQ imm8 m64 +// ADDQ imm32 m64 +// ADDQ r64 m64 +// Construct and append a ADDQ instruction to the active function. +// Operates on the global context. +func ADDQ(imr, mr operand.Op) { ctx.ADDQ(imr, mr) } + +// ADDSD: Add Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// ADDSD xmm xmm +// ADDSD m64 xmm +// Construct and append a ADDSD instruction to the active function. +func (c *Context) ADDSD(mx, x operand.Op) { + if inst, err := x86.ADDSD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADDSD: Add Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// ADDSD xmm xmm +// ADDSD m64 xmm +// Construct and append a ADDSD instruction to the active function. +// Operates on the global context. +func ADDSD(mx, x operand.Op) { ctx.ADDSD(mx, x) } + +// ADDSS: Add Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// ADDSS xmm xmm +// ADDSS m32 xmm +// Construct and append a ADDSS instruction to the active function. +func (c *Context) ADDSS(mx, x operand.Op) { + if inst, err := x86.ADDSS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADDSS: Add Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// ADDSS xmm xmm +// ADDSS m32 xmm +// Construct and append a ADDSS instruction to the active function. +// Operates on the global context. +func ADDSS(mx, x operand.Op) { ctx.ADDSS(mx, x) } + +// ADDSUBPD: Packed Double-FP Add/Subtract. +// +// Forms: +// +// ADDSUBPD xmm xmm +// ADDSUBPD m128 xmm +// Construct and append a ADDSUBPD instruction to the active function. +func (c *Context) ADDSUBPD(mx, x operand.Op) { + if inst, err := x86.ADDSUBPD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADDSUBPD: Packed Double-FP Add/Subtract. +// +// Forms: +// +// ADDSUBPD xmm xmm +// ADDSUBPD m128 xmm +// Construct and append a ADDSUBPD instruction to the active function. +// Operates on the global context. +func ADDSUBPD(mx, x operand.Op) { ctx.ADDSUBPD(mx, x) } + +// ADDSUBPS: Packed Single-FP Add/Subtract. +// +// Forms: +// +// ADDSUBPS xmm xmm +// ADDSUBPS m128 xmm +// Construct and append a ADDSUBPS instruction to the active function. +func (c *Context) ADDSUBPS(mx, x operand.Op) { + if inst, err := x86.ADDSUBPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADDSUBPS: Packed Single-FP Add/Subtract. +// +// Forms: +// +// ADDSUBPS xmm xmm +// ADDSUBPS m128 xmm +// Construct and append a ADDSUBPS instruction to the active function. +// Operates on the global context. +func ADDSUBPS(mx, x operand.Op) { ctx.ADDSUBPS(mx, x) } + +// ADDW: Add. +// +// Forms: +// +// ADDW imm16 ax +// ADDW imm8 r16 +// ADDW imm16 r16 +// ADDW r16 r16 +// ADDW m16 r16 +// ADDW imm8 m16 +// ADDW imm16 m16 +// ADDW r16 m16 +// Construct and append a ADDW instruction to the active function. +func (c *Context) ADDW(imr, amr operand.Op) { + if inst, err := x86.ADDW(imr, amr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADDW: Add. +// +// Forms: +// +// ADDW imm16 ax +// ADDW imm8 r16 +// ADDW imm16 r16 +// ADDW r16 r16 +// ADDW m16 r16 +// ADDW imm8 m16 +// ADDW imm16 m16 +// ADDW r16 m16 +// Construct and append a ADDW instruction to the active function. +// Operates on the global context. +func ADDW(imr, amr operand.Op) { ctx.ADDW(imr, amr) } + +// ADOXL: Unsigned Integer Addition of Two Operands with Overflow Flag. +// +// Forms: +// +// ADOXL r32 r32 +// ADOXL m32 r32 +// Construct and append a ADOXL instruction to the active function. +func (c *Context) ADOXL(mr, r operand.Op) { + if inst, err := x86.ADOXL(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADOXL: Unsigned Integer Addition of Two Operands with Overflow Flag. +// +// Forms: +// +// ADOXL r32 r32 +// ADOXL m32 r32 +// Construct and append a ADOXL instruction to the active function. +// Operates on the global context. +func ADOXL(mr, r operand.Op) { ctx.ADOXL(mr, r) } + +// ADOXQ: Unsigned Integer Addition of Two Operands with Overflow Flag. +// +// Forms: +// +// ADOXQ r64 r64 +// ADOXQ m64 r64 +// Construct and append a ADOXQ instruction to the active function. +func (c *Context) ADOXQ(mr, r operand.Op) { + if inst, err := x86.ADOXQ(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ADOXQ: Unsigned Integer Addition of Two Operands with Overflow Flag. +// +// Forms: +// +// ADOXQ r64 r64 +// ADOXQ m64 r64 +// Construct and append a ADOXQ instruction to the active function. +// Operates on the global context. +func ADOXQ(mr, r operand.Op) { ctx.ADOXQ(mr, r) } + +// AESDEC: Perform One Round of an AES Decryption Flow. +// +// Forms: +// +// AESDEC xmm xmm +// AESDEC m128 xmm +// Construct and append a AESDEC instruction to the active function. +func (c *Context) AESDEC(mx, x operand.Op) { + if inst, err := x86.AESDEC(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// AESDEC: Perform One Round of an AES Decryption Flow. +// +// Forms: +// +// AESDEC xmm xmm +// AESDEC m128 xmm +// Construct and append a AESDEC instruction to the active function. +// Operates on the global context. +func AESDEC(mx, x operand.Op) { ctx.AESDEC(mx, x) } + +// AESDECLAST: Perform Last Round of an AES Decryption Flow. +// +// Forms: +// +// AESDECLAST xmm xmm +// AESDECLAST m128 xmm +// Construct and append a AESDECLAST instruction to the active function. +func (c *Context) AESDECLAST(mx, x operand.Op) { + if inst, err := x86.AESDECLAST(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// AESDECLAST: Perform Last Round of an AES Decryption Flow. +// +// Forms: +// +// AESDECLAST xmm xmm +// AESDECLAST m128 xmm +// Construct and append a AESDECLAST instruction to the active function. +// Operates on the global context. +func AESDECLAST(mx, x operand.Op) { ctx.AESDECLAST(mx, x) } + +// AESENC: Perform One Round of an AES Encryption Flow. +// +// Forms: +// +// AESENC xmm xmm +// AESENC m128 xmm +// Construct and append a AESENC instruction to the active function. +func (c *Context) AESENC(mx, x operand.Op) { + if inst, err := x86.AESENC(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// AESENC: Perform One Round of an AES Encryption Flow. +// +// Forms: +// +// AESENC xmm xmm +// AESENC m128 xmm +// Construct and append a AESENC instruction to the active function. +// Operates on the global context. +func AESENC(mx, x operand.Op) { ctx.AESENC(mx, x) } + +// AESENCLAST: Perform Last Round of an AES Encryption Flow. +// +// Forms: +// +// AESENCLAST xmm xmm +// AESENCLAST m128 xmm +// Construct and append a AESENCLAST instruction to the active function. +func (c *Context) AESENCLAST(mx, x operand.Op) { + if inst, err := x86.AESENCLAST(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// AESENCLAST: Perform Last Round of an AES Encryption Flow. +// +// Forms: +// +// AESENCLAST xmm xmm +// AESENCLAST m128 xmm +// Construct and append a AESENCLAST instruction to the active function. +// Operates on the global context. +func AESENCLAST(mx, x operand.Op) { ctx.AESENCLAST(mx, x) } + +// AESIMC: Perform the AES InvMixColumn Transformation. +// +// Forms: +// +// AESIMC xmm xmm +// AESIMC m128 xmm +// Construct and append a AESIMC instruction to the active function. +func (c *Context) AESIMC(mx, x operand.Op) { + if inst, err := x86.AESIMC(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// AESIMC: Perform the AES InvMixColumn Transformation. +// +// Forms: +// +// AESIMC xmm xmm +// AESIMC m128 xmm +// Construct and append a AESIMC instruction to the active function. +// Operates on the global context. +func AESIMC(mx, x operand.Op) { ctx.AESIMC(mx, x) } + +// AESKEYGENASSIST: AES Round Key Generation Assist. +// +// Forms: +// +// AESKEYGENASSIST imm8 xmm xmm +// AESKEYGENASSIST imm8 m128 xmm +// Construct and append a AESKEYGENASSIST instruction to the active function. +func (c *Context) AESKEYGENASSIST(i, mx, x operand.Op) { + if inst, err := x86.AESKEYGENASSIST(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// AESKEYGENASSIST: AES Round Key Generation Assist. +// +// Forms: +// +// AESKEYGENASSIST imm8 xmm xmm +// AESKEYGENASSIST imm8 m128 xmm +// Construct and append a AESKEYGENASSIST instruction to the active function. +// Operates on the global context. +func AESKEYGENASSIST(i, mx, x operand.Op) { ctx.AESKEYGENASSIST(i, mx, x) } + +// ANDB: Logical AND. +// +// Forms: +// +// ANDB imm8 al +// ANDB imm8 r8 +// ANDB r8 r8 +// ANDB m8 r8 +// ANDB imm8 m8 +// ANDB r8 m8 +// Construct and append a ANDB instruction to the active function. +func (c *Context) ANDB(imr, amr operand.Op) { + if inst, err := x86.ANDB(imr, amr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ANDB: Logical AND. +// +// Forms: +// +// ANDB imm8 al +// ANDB imm8 r8 +// ANDB r8 r8 +// ANDB m8 r8 +// ANDB imm8 m8 +// ANDB r8 m8 +// Construct and append a ANDB instruction to the active function. +// Operates on the global context. +func ANDB(imr, amr operand.Op) { ctx.ANDB(imr, amr) } + +// ANDL: Logical AND. +// +// Forms: +// +// ANDL imm32 eax +// ANDL imm8 r32 +// ANDL imm32 r32 +// ANDL r32 r32 +// ANDL m32 r32 +// ANDL imm8 m32 +// ANDL imm32 m32 +// ANDL r32 m32 +// Construct and append a ANDL instruction to the active function. +func (c *Context) ANDL(imr, emr operand.Op) { + if inst, err := x86.ANDL(imr, emr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ANDL: Logical AND. +// +// Forms: +// +// ANDL imm32 eax +// ANDL imm8 r32 +// ANDL imm32 r32 +// ANDL r32 r32 +// ANDL m32 r32 +// ANDL imm8 m32 +// ANDL imm32 m32 +// ANDL r32 m32 +// Construct and append a ANDL instruction to the active function. +// Operates on the global context. +func ANDL(imr, emr operand.Op) { ctx.ANDL(imr, emr) } + +// ANDNL: Logical AND NOT. +// +// Forms: +// +// ANDNL r32 r32 r32 +// ANDNL m32 r32 r32 +// Construct and append a ANDNL instruction to the active function. +func (c *Context) ANDNL(mr, r, r1 operand.Op) { + if inst, err := x86.ANDNL(mr, r, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ANDNL: Logical AND NOT. +// +// Forms: +// +// ANDNL r32 r32 r32 +// ANDNL m32 r32 r32 +// Construct and append a ANDNL instruction to the active function. +// Operates on the global context. +func ANDNL(mr, r, r1 operand.Op) { ctx.ANDNL(mr, r, r1) } + +// ANDNPD: Bitwise Logical AND NOT of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// ANDNPD xmm xmm +// ANDNPD m128 xmm +// Construct and append a ANDNPD instruction to the active function. +func (c *Context) ANDNPD(mx, x operand.Op) { + if inst, err := x86.ANDNPD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ANDNPD: Bitwise Logical AND NOT of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// ANDNPD xmm xmm +// ANDNPD m128 xmm +// Construct and append a ANDNPD instruction to the active function. +// Operates on the global context. +func ANDNPD(mx, x operand.Op) { ctx.ANDNPD(mx, x) } + +// ANDNPS: Bitwise Logical AND NOT of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// ANDNPS xmm xmm +// ANDNPS m128 xmm +// Construct and append a ANDNPS instruction to the active function. +func (c *Context) ANDNPS(mx, x operand.Op) { + if inst, err := x86.ANDNPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ANDNPS: Bitwise Logical AND NOT of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// ANDNPS xmm xmm +// ANDNPS m128 xmm +// Construct and append a ANDNPS instruction to the active function. +// Operates on the global context. +func ANDNPS(mx, x operand.Op) { ctx.ANDNPS(mx, x) } + +// ANDNQ: Logical AND NOT. +// +// Forms: +// +// ANDNQ r64 r64 r64 +// ANDNQ m64 r64 r64 +// Construct and append a ANDNQ instruction to the active function. +func (c *Context) ANDNQ(mr, r, r1 operand.Op) { + if inst, err := x86.ANDNQ(mr, r, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ANDNQ: Logical AND NOT. +// +// Forms: +// +// ANDNQ r64 r64 r64 +// ANDNQ m64 r64 r64 +// Construct and append a ANDNQ instruction to the active function. +// Operates on the global context. +func ANDNQ(mr, r, r1 operand.Op) { ctx.ANDNQ(mr, r, r1) } + +// ANDPD: Bitwise Logical AND of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// ANDPD xmm xmm +// ANDPD m128 xmm +// Construct and append a ANDPD instruction to the active function. +func (c *Context) ANDPD(mx, x operand.Op) { + if inst, err := x86.ANDPD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ANDPD: Bitwise Logical AND of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// ANDPD xmm xmm +// ANDPD m128 xmm +// Construct and append a ANDPD instruction to the active function. +// Operates on the global context. +func ANDPD(mx, x operand.Op) { ctx.ANDPD(mx, x) } + +// ANDPS: Bitwise Logical AND of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// ANDPS xmm xmm +// ANDPS m128 xmm +// Construct and append a ANDPS instruction to the active function. +func (c *Context) ANDPS(mx, x operand.Op) { + if inst, err := x86.ANDPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ANDPS: Bitwise Logical AND of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// ANDPS xmm xmm +// ANDPS m128 xmm +// Construct and append a ANDPS instruction to the active function. +// Operates on the global context. +func ANDPS(mx, x operand.Op) { ctx.ANDPS(mx, x) } + +// ANDQ: Logical AND. +// +// Forms: +// +// ANDQ imm32 rax +// ANDQ imm8 r64 +// ANDQ imm32 r64 +// ANDQ r64 r64 +// ANDQ m64 r64 +// ANDQ imm8 m64 +// ANDQ imm32 m64 +// ANDQ r64 m64 +// Construct and append a ANDQ instruction to the active function. +func (c *Context) ANDQ(imr, mr operand.Op) { + if inst, err := x86.ANDQ(imr, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ANDQ: Logical AND. +// +// Forms: +// +// ANDQ imm32 rax +// ANDQ imm8 r64 +// ANDQ imm32 r64 +// ANDQ r64 r64 +// ANDQ m64 r64 +// ANDQ imm8 m64 +// ANDQ imm32 m64 +// ANDQ r64 m64 +// Construct and append a ANDQ instruction to the active function. +// Operates on the global context. +func ANDQ(imr, mr operand.Op) { ctx.ANDQ(imr, mr) } + +// ANDW: Logical AND. +// +// Forms: +// +// ANDW imm16 ax +// ANDW imm8 r16 +// ANDW imm16 r16 +// ANDW r16 r16 +// ANDW m16 r16 +// ANDW imm8 m16 +// ANDW imm16 m16 +// ANDW r16 m16 +// Construct and append a ANDW instruction to the active function. +func (c *Context) ANDW(imr, amr operand.Op) { + if inst, err := x86.ANDW(imr, amr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ANDW: Logical AND. +// +// Forms: +// +// ANDW imm16 ax +// ANDW imm8 r16 +// ANDW imm16 r16 +// ANDW r16 r16 +// ANDW m16 r16 +// ANDW imm8 m16 +// ANDW imm16 m16 +// ANDW r16 m16 +// Construct and append a ANDW instruction to the active function. +// Operates on the global context. +func ANDW(imr, amr operand.Op) { ctx.ANDW(imr, amr) } + +// BEXTRL: Bit Field Extract. +// +// Forms: +// +// BEXTRL r32 r32 r32 +// BEXTRL r32 m32 r32 +// Construct and append a BEXTRL instruction to the active function. +func (c *Context) BEXTRL(r, mr, r1 operand.Op) { + if inst, err := x86.BEXTRL(r, mr, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BEXTRL: Bit Field Extract. +// +// Forms: +// +// BEXTRL r32 r32 r32 +// BEXTRL r32 m32 r32 +// Construct and append a BEXTRL instruction to the active function. +// Operates on the global context. +func BEXTRL(r, mr, r1 operand.Op) { ctx.BEXTRL(r, mr, r1) } + +// BEXTRQ: Bit Field Extract. +// +// Forms: +// +// BEXTRQ r64 r64 r64 +// BEXTRQ r64 m64 r64 +// Construct and append a BEXTRQ instruction to the active function. +func (c *Context) BEXTRQ(r, mr, r1 operand.Op) { + if inst, err := x86.BEXTRQ(r, mr, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BEXTRQ: Bit Field Extract. +// +// Forms: +// +// BEXTRQ r64 r64 r64 +// BEXTRQ r64 m64 r64 +// Construct and append a BEXTRQ instruction to the active function. +// Operates on the global context. +func BEXTRQ(r, mr, r1 operand.Op) { ctx.BEXTRQ(r, mr, r1) } + +// BLENDPD: Blend Packed Double Precision Floating-Point Values. +// +// Forms: +// +// BLENDPD imm8 xmm xmm +// BLENDPD imm8 m128 xmm +// Construct and append a BLENDPD instruction to the active function. +func (c *Context) BLENDPD(i, mx, x operand.Op) { + if inst, err := x86.BLENDPD(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BLENDPD: Blend Packed Double Precision Floating-Point Values. +// +// Forms: +// +// BLENDPD imm8 xmm xmm +// BLENDPD imm8 m128 xmm +// Construct and append a BLENDPD instruction to the active function. +// Operates on the global context. +func BLENDPD(i, mx, x operand.Op) { ctx.BLENDPD(i, mx, x) } + +// BLENDPS: Blend Packed Single Precision Floating-Point Values. +// +// Forms: +// +// BLENDPS imm8 xmm xmm +// BLENDPS imm8 m128 xmm +// Construct and append a BLENDPS instruction to the active function. +func (c *Context) BLENDPS(i, mx, x operand.Op) { + if inst, err := x86.BLENDPS(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BLENDPS: Blend Packed Single Precision Floating-Point Values. +// +// Forms: +// +// BLENDPS imm8 xmm xmm +// BLENDPS imm8 m128 xmm +// Construct and append a BLENDPS instruction to the active function. +// Operates on the global context. +func BLENDPS(i, mx, x operand.Op) { ctx.BLENDPS(i, mx, x) } + +// BLENDVPD: Variable Blend Packed Double Precision Floating-Point Values. +// +// Forms: +// +// BLENDVPD xmm0 xmm xmm +// BLENDVPD xmm0 m128 xmm +// Construct and append a BLENDVPD instruction to the active function. +func (c *Context) BLENDVPD(x, mx, x1 operand.Op) { + if inst, err := x86.BLENDVPD(x, mx, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BLENDVPD: Variable Blend Packed Double Precision Floating-Point Values. +// +// Forms: +// +// BLENDVPD xmm0 xmm xmm +// BLENDVPD xmm0 m128 xmm +// Construct and append a BLENDVPD instruction to the active function. +// Operates on the global context. +func BLENDVPD(x, mx, x1 operand.Op) { ctx.BLENDVPD(x, mx, x1) } + +// BLENDVPS: Variable Blend Packed Single Precision Floating-Point Values. +// +// Forms: +// +// BLENDVPS xmm0 xmm xmm +// BLENDVPS xmm0 m128 xmm +// Construct and append a BLENDVPS instruction to the active function. +func (c *Context) BLENDVPS(x, mx, x1 operand.Op) { + if inst, err := x86.BLENDVPS(x, mx, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BLENDVPS: Variable Blend Packed Single Precision Floating-Point Values. +// +// Forms: +// +// BLENDVPS xmm0 xmm xmm +// BLENDVPS xmm0 m128 xmm +// Construct and append a BLENDVPS instruction to the active function. +// Operates on the global context. +func BLENDVPS(x, mx, x1 operand.Op) { ctx.BLENDVPS(x, mx, x1) } + +// BLSIL: Isolate Lowest Set Bit. +// +// Forms: +// +// BLSIL r32 r32 +// BLSIL m32 r32 +// Construct and append a BLSIL instruction to the active function. +func (c *Context) BLSIL(mr, r operand.Op) { + if inst, err := x86.BLSIL(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BLSIL: Isolate Lowest Set Bit. +// +// Forms: +// +// BLSIL r32 r32 +// BLSIL m32 r32 +// Construct and append a BLSIL instruction to the active function. +// Operates on the global context. +func BLSIL(mr, r operand.Op) { ctx.BLSIL(mr, r) } + +// BLSIQ: Isolate Lowest Set Bit. +// +// Forms: +// +// BLSIQ r64 r64 +// BLSIQ m64 r64 +// Construct and append a BLSIQ instruction to the active function. +func (c *Context) BLSIQ(mr, r operand.Op) { + if inst, err := x86.BLSIQ(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BLSIQ: Isolate Lowest Set Bit. +// +// Forms: +// +// BLSIQ r64 r64 +// BLSIQ m64 r64 +// Construct and append a BLSIQ instruction to the active function. +// Operates on the global context. +func BLSIQ(mr, r operand.Op) { ctx.BLSIQ(mr, r) } + +// BLSMSKL: Mask From Lowest Set Bit. +// +// Forms: +// +// BLSMSKL r32 r32 +// BLSMSKL m32 r32 +// Construct and append a BLSMSKL instruction to the active function. +func (c *Context) BLSMSKL(mr, r operand.Op) { + if inst, err := x86.BLSMSKL(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BLSMSKL: Mask From Lowest Set Bit. +// +// Forms: +// +// BLSMSKL r32 r32 +// BLSMSKL m32 r32 +// Construct and append a BLSMSKL instruction to the active function. +// Operates on the global context. +func BLSMSKL(mr, r operand.Op) { ctx.BLSMSKL(mr, r) } + +// BLSMSKQ: Mask From Lowest Set Bit. +// +// Forms: +// +// BLSMSKQ r64 r64 +// BLSMSKQ m64 r64 +// Construct and append a BLSMSKQ instruction to the active function. +func (c *Context) BLSMSKQ(mr, r operand.Op) { + if inst, err := x86.BLSMSKQ(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BLSMSKQ: Mask From Lowest Set Bit. +// +// Forms: +// +// BLSMSKQ r64 r64 +// BLSMSKQ m64 r64 +// Construct and append a BLSMSKQ instruction to the active function. +// Operates on the global context. +func BLSMSKQ(mr, r operand.Op) { ctx.BLSMSKQ(mr, r) } + +// BLSRL: Reset Lowest Set Bit. +// +// Forms: +// +// BLSRL r32 r32 +// BLSRL m32 r32 +// Construct and append a BLSRL instruction to the active function. +func (c *Context) BLSRL(mr, r operand.Op) { + if inst, err := x86.BLSRL(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BLSRL: Reset Lowest Set Bit. +// +// Forms: +// +// BLSRL r32 r32 +// BLSRL m32 r32 +// Construct and append a BLSRL instruction to the active function. +// Operates on the global context. +func BLSRL(mr, r operand.Op) { ctx.BLSRL(mr, r) } + +// BLSRQ: Reset Lowest Set Bit. +// +// Forms: +// +// BLSRQ r64 r64 +// BLSRQ m64 r64 +// Construct and append a BLSRQ instruction to the active function. +func (c *Context) BLSRQ(mr, r operand.Op) { + if inst, err := x86.BLSRQ(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BLSRQ: Reset Lowest Set Bit. +// +// Forms: +// +// BLSRQ r64 r64 +// BLSRQ m64 r64 +// Construct and append a BLSRQ instruction to the active function. +// Operates on the global context. +func BLSRQ(mr, r operand.Op) { ctx.BLSRQ(mr, r) } + +// BSFL: Bit Scan Forward. +// +// Forms: +// +// BSFL r32 r32 +// BSFL m32 r32 +// Construct and append a BSFL instruction to the active function. +func (c *Context) BSFL(mr, r operand.Op) { + if inst, err := x86.BSFL(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BSFL: Bit Scan Forward. +// +// Forms: +// +// BSFL r32 r32 +// BSFL m32 r32 +// Construct and append a BSFL instruction to the active function. +// Operates on the global context. +func BSFL(mr, r operand.Op) { ctx.BSFL(mr, r) } + +// BSFQ: Bit Scan Forward. +// +// Forms: +// +// BSFQ r64 r64 +// BSFQ m64 r64 +// Construct and append a BSFQ instruction to the active function. +func (c *Context) BSFQ(mr, r operand.Op) { + if inst, err := x86.BSFQ(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BSFQ: Bit Scan Forward. +// +// Forms: +// +// BSFQ r64 r64 +// BSFQ m64 r64 +// Construct and append a BSFQ instruction to the active function. +// Operates on the global context. +func BSFQ(mr, r operand.Op) { ctx.BSFQ(mr, r) } + +// BSFW: Bit Scan Forward. +// +// Forms: +// +// BSFW r16 r16 +// BSFW m16 r16 +// Construct and append a BSFW instruction to the active function. +func (c *Context) BSFW(mr, r operand.Op) { + if inst, err := x86.BSFW(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BSFW: Bit Scan Forward. +// +// Forms: +// +// BSFW r16 r16 +// BSFW m16 r16 +// Construct and append a BSFW instruction to the active function. +// Operates on the global context. +func BSFW(mr, r operand.Op) { ctx.BSFW(mr, r) } + +// BSRL: Bit Scan Reverse. +// +// Forms: +// +// BSRL r32 r32 +// BSRL m32 r32 +// Construct and append a BSRL instruction to the active function. +func (c *Context) BSRL(mr, r operand.Op) { + if inst, err := x86.BSRL(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BSRL: Bit Scan Reverse. +// +// Forms: +// +// BSRL r32 r32 +// BSRL m32 r32 +// Construct and append a BSRL instruction to the active function. +// Operates on the global context. +func BSRL(mr, r operand.Op) { ctx.BSRL(mr, r) } + +// BSRQ: Bit Scan Reverse. +// +// Forms: +// +// BSRQ r64 r64 +// BSRQ m64 r64 +// Construct and append a BSRQ instruction to the active function. +func (c *Context) BSRQ(mr, r operand.Op) { + if inst, err := x86.BSRQ(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BSRQ: Bit Scan Reverse. +// +// Forms: +// +// BSRQ r64 r64 +// BSRQ m64 r64 +// Construct and append a BSRQ instruction to the active function. +// Operates on the global context. +func BSRQ(mr, r operand.Op) { ctx.BSRQ(mr, r) } + +// BSRW: Bit Scan Reverse. +// +// Forms: +// +// BSRW r16 r16 +// BSRW m16 r16 +// Construct and append a BSRW instruction to the active function. +func (c *Context) BSRW(mr, r operand.Op) { + if inst, err := x86.BSRW(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BSRW: Bit Scan Reverse. +// +// Forms: +// +// BSRW r16 r16 +// BSRW m16 r16 +// Construct and append a BSRW instruction to the active function. +// Operates on the global context. +func BSRW(mr, r operand.Op) { ctx.BSRW(mr, r) } + +// BSWAPL: Byte Swap. +// +// Forms: +// +// BSWAPL r32 +// Construct and append a BSWAPL instruction to the active function. +func (c *Context) BSWAPL(r operand.Op) { + if inst, err := x86.BSWAPL(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BSWAPL: Byte Swap. +// +// Forms: +// +// BSWAPL r32 +// Construct and append a BSWAPL instruction to the active function. +// Operates on the global context. +func BSWAPL(r operand.Op) { ctx.BSWAPL(r) } + +// BSWAPQ: Byte Swap. +// +// Forms: +// +// BSWAPQ r64 +// Construct and append a BSWAPQ instruction to the active function. +func (c *Context) BSWAPQ(r operand.Op) { + if inst, err := x86.BSWAPQ(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BSWAPQ: Byte Swap. +// +// Forms: +// +// BSWAPQ r64 +// Construct and append a BSWAPQ instruction to the active function. +// Operates on the global context. +func BSWAPQ(r operand.Op) { ctx.BSWAPQ(r) } + +// BTCL: Bit Test and Complement. +// +// Forms: +// +// BTCL imm8 r32 +// BTCL r32 r32 +// BTCL imm8 m32 +// BTCL r32 m32 +// Construct and append a BTCL instruction to the active function. +func (c *Context) BTCL(ir, mr operand.Op) { + if inst, err := x86.BTCL(ir, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BTCL: Bit Test and Complement. +// +// Forms: +// +// BTCL imm8 r32 +// BTCL r32 r32 +// BTCL imm8 m32 +// BTCL r32 m32 +// Construct and append a BTCL instruction to the active function. +// Operates on the global context. +func BTCL(ir, mr operand.Op) { ctx.BTCL(ir, mr) } + +// BTCQ: Bit Test and Complement. +// +// Forms: +// +// BTCQ imm8 r64 +// BTCQ r64 r64 +// BTCQ imm8 m64 +// BTCQ r64 m64 +// Construct and append a BTCQ instruction to the active function. +func (c *Context) BTCQ(ir, mr operand.Op) { + if inst, err := x86.BTCQ(ir, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BTCQ: Bit Test and Complement. +// +// Forms: +// +// BTCQ imm8 r64 +// BTCQ r64 r64 +// BTCQ imm8 m64 +// BTCQ r64 m64 +// Construct and append a BTCQ instruction to the active function. +// Operates on the global context. +func BTCQ(ir, mr operand.Op) { ctx.BTCQ(ir, mr) } + +// BTCW: Bit Test and Complement. +// +// Forms: +// +// BTCW imm8 r16 +// BTCW r16 r16 +// BTCW imm8 m16 +// BTCW r16 m16 +// Construct and append a BTCW instruction to the active function. +func (c *Context) BTCW(ir, mr operand.Op) { + if inst, err := x86.BTCW(ir, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BTCW: Bit Test and Complement. +// +// Forms: +// +// BTCW imm8 r16 +// BTCW r16 r16 +// BTCW imm8 m16 +// BTCW r16 m16 +// Construct and append a BTCW instruction to the active function. +// Operates on the global context. +func BTCW(ir, mr operand.Op) { ctx.BTCW(ir, mr) } + +// BTL: Bit Test. +// +// Forms: +// +// BTL imm8 r32 +// BTL r32 r32 +// BTL imm8 m32 +// BTL r32 m32 +// Construct and append a BTL instruction to the active function. +func (c *Context) BTL(ir, mr operand.Op) { + if inst, err := x86.BTL(ir, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BTL: Bit Test. +// +// Forms: +// +// BTL imm8 r32 +// BTL r32 r32 +// BTL imm8 m32 +// BTL r32 m32 +// Construct and append a BTL instruction to the active function. +// Operates on the global context. +func BTL(ir, mr operand.Op) { ctx.BTL(ir, mr) } + +// BTQ: Bit Test. +// +// Forms: +// +// BTQ imm8 r64 +// BTQ r64 r64 +// BTQ imm8 m64 +// BTQ r64 m64 +// Construct and append a BTQ instruction to the active function. +func (c *Context) BTQ(ir, mr operand.Op) { + if inst, err := x86.BTQ(ir, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BTQ: Bit Test. +// +// Forms: +// +// BTQ imm8 r64 +// BTQ r64 r64 +// BTQ imm8 m64 +// BTQ r64 m64 +// Construct and append a BTQ instruction to the active function. +// Operates on the global context. +func BTQ(ir, mr operand.Op) { ctx.BTQ(ir, mr) } + +// BTRL: Bit Test and Reset. +// +// Forms: +// +// BTRL imm8 r32 +// BTRL r32 r32 +// BTRL imm8 m32 +// BTRL r32 m32 +// Construct and append a BTRL instruction to the active function. +func (c *Context) BTRL(ir, mr operand.Op) { + if inst, err := x86.BTRL(ir, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BTRL: Bit Test and Reset. +// +// Forms: +// +// BTRL imm8 r32 +// BTRL r32 r32 +// BTRL imm8 m32 +// BTRL r32 m32 +// Construct and append a BTRL instruction to the active function. +// Operates on the global context. +func BTRL(ir, mr operand.Op) { ctx.BTRL(ir, mr) } + +// BTRQ: Bit Test and Reset. +// +// Forms: +// +// BTRQ imm8 r64 +// BTRQ r64 r64 +// BTRQ imm8 m64 +// BTRQ r64 m64 +// Construct and append a BTRQ instruction to the active function. +func (c *Context) BTRQ(ir, mr operand.Op) { + if inst, err := x86.BTRQ(ir, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BTRQ: Bit Test and Reset. +// +// Forms: +// +// BTRQ imm8 r64 +// BTRQ r64 r64 +// BTRQ imm8 m64 +// BTRQ r64 m64 +// Construct and append a BTRQ instruction to the active function. +// Operates on the global context. +func BTRQ(ir, mr operand.Op) { ctx.BTRQ(ir, mr) } + +// BTRW: Bit Test and Reset. +// +// Forms: +// +// BTRW imm8 r16 +// BTRW r16 r16 +// BTRW imm8 m16 +// BTRW r16 m16 +// Construct and append a BTRW instruction to the active function. +func (c *Context) BTRW(ir, mr operand.Op) { + if inst, err := x86.BTRW(ir, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BTRW: Bit Test and Reset. +// +// Forms: +// +// BTRW imm8 r16 +// BTRW r16 r16 +// BTRW imm8 m16 +// BTRW r16 m16 +// Construct and append a BTRW instruction to the active function. +// Operates on the global context. +func BTRW(ir, mr operand.Op) { ctx.BTRW(ir, mr) } + +// BTSL: Bit Test and Set. +// +// Forms: +// +// BTSL imm8 r32 +// BTSL r32 r32 +// BTSL imm8 m32 +// BTSL r32 m32 +// Construct and append a BTSL instruction to the active function. +func (c *Context) BTSL(ir, mr operand.Op) { + if inst, err := x86.BTSL(ir, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BTSL: Bit Test and Set. +// +// Forms: +// +// BTSL imm8 r32 +// BTSL r32 r32 +// BTSL imm8 m32 +// BTSL r32 m32 +// Construct and append a BTSL instruction to the active function. +// Operates on the global context. +func BTSL(ir, mr operand.Op) { ctx.BTSL(ir, mr) } + +// BTSQ: Bit Test and Set. +// +// Forms: +// +// BTSQ imm8 r64 +// BTSQ r64 r64 +// BTSQ imm8 m64 +// BTSQ r64 m64 +// Construct and append a BTSQ instruction to the active function. +func (c *Context) BTSQ(ir, mr operand.Op) { + if inst, err := x86.BTSQ(ir, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BTSQ: Bit Test and Set. +// +// Forms: +// +// BTSQ imm8 r64 +// BTSQ r64 r64 +// BTSQ imm8 m64 +// BTSQ r64 m64 +// Construct and append a BTSQ instruction to the active function. +// Operates on the global context. +func BTSQ(ir, mr operand.Op) { ctx.BTSQ(ir, mr) } + +// BTSW: Bit Test and Set. +// +// Forms: +// +// BTSW imm8 r16 +// BTSW r16 r16 +// BTSW imm8 m16 +// BTSW r16 m16 +// Construct and append a BTSW instruction to the active function. +func (c *Context) BTSW(ir, mr operand.Op) { + if inst, err := x86.BTSW(ir, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BTSW: Bit Test and Set. +// +// Forms: +// +// BTSW imm8 r16 +// BTSW r16 r16 +// BTSW imm8 m16 +// BTSW r16 m16 +// Construct and append a BTSW instruction to the active function. +// Operates on the global context. +func BTSW(ir, mr operand.Op) { ctx.BTSW(ir, mr) } + +// BTW: Bit Test. +// +// Forms: +// +// BTW imm8 r16 +// BTW r16 r16 +// BTW imm8 m16 +// BTW r16 m16 +// Construct and append a BTW instruction to the active function. +func (c *Context) BTW(ir, mr operand.Op) { + if inst, err := x86.BTW(ir, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BTW: Bit Test. +// +// Forms: +// +// BTW imm8 r16 +// BTW r16 r16 +// BTW imm8 m16 +// BTW r16 m16 +// Construct and append a BTW instruction to the active function. +// Operates on the global context. +func BTW(ir, mr operand.Op) { ctx.BTW(ir, mr) } + +// BZHIL: Zero High Bits Starting with Specified Bit Position. +// +// Forms: +// +// BZHIL r32 r32 r32 +// BZHIL r32 m32 r32 +// Construct and append a BZHIL instruction to the active function. +func (c *Context) BZHIL(r, mr, r1 operand.Op) { + if inst, err := x86.BZHIL(r, mr, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BZHIL: Zero High Bits Starting with Specified Bit Position. +// +// Forms: +// +// BZHIL r32 r32 r32 +// BZHIL r32 m32 r32 +// Construct and append a BZHIL instruction to the active function. +// Operates on the global context. +func BZHIL(r, mr, r1 operand.Op) { ctx.BZHIL(r, mr, r1) } + +// BZHIQ: Zero High Bits Starting with Specified Bit Position. +// +// Forms: +// +// BZHIQ r64 r64 r64 +// BZHIQ r64 m64 r64 +// Construct and append a BZHIQ instruction to the active function. +func (c *Context) BZHIQ(r, mr, r1 operand.Op) { + if inst, err := x86.BZHIQ(r, mr, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// BZHIQ: Zero High Bits Starting with Specified Bit Position. +// +// Forms: +// +// BZHIQ r64 r64 r64 +// BZHIQ r64 m64 r64 +// Construct and append a BZHIQ instruction to the active function. +// Operates on the global context. +func BZHIQ(r, mr, r1 operand.Op) { ctx.BZHIQ(r, mr, r1) } + +// CALL: Call Procedure. +// +// Forms: +// +// CALL rel32 +// Construct and append a CALL instruction to the active function. +func (c *Context) CALL(r operand.Op) { + if inst, err := x86.CALL(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CALL: Call Procedure. +// +// Forms: +// +// CALL rel32 +// Construct and append a CALL instruction to the active function. +// Operates on the global context. +func CALL(r operand.Op) { ctx.CALL(r) } + +// CBW: Convert Byte to Word. +// +// Forms: +// +// CBW +// Construct and append a CBW instruction to the active function. +func (c *Context) CBW() { + if inst, err := x86.CBW(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CBW: Convert Byte to Word. +// +// Forms: +// +// CBW +// Construct and append a CBW instruction to the active function. +// Operates on the global context. +func CBW() { ctx.CBW() } + +// CDQ: Convert Doubleword to Quadword. +// +// Forms: +// +// CDQ +// Construct and append a CDQ instruction to the active function. +func (c *Context) CDQ() { + if inst, err := x86.CDQ(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CDQ: Convert Doubleword to Quadword. +// +// Forms: +// +// CDQ +// Construct and append a CDQ instruction to the active function. +// Operates on the global context. +func CDQ() { ctx.CDQ() } + +// CDQE: Convert Doubleword to Quadword. +// +// Forms: +// +// CDQE +// Construct and append a CDQE instruction to the active function. +func (c *Context) CDQE() { + if inst, err := x86.CDQE(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CDQE: Convert Doubleword to Quadword. +// +// Forms: +// +// CDQE +// Construct and append a CDQE instruction to the active function. +// Operates on the global context. +func CDQE() { ctx.CDQE() } + +// CLC: Clear Carry Flag. +// +// Forms: +// +// CLC +// Construct and append a CLC instruction to the active function. +func (c *Context) CLC() { + if inst, err := x86.CLC(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CLC: Clear Carry Flag. +// +// Forms: +// +// CLC +// Construct and append a CLC instruction to the active function. +// Operates on the global context. +func CLC() { ctx.CLC() } + +// CLD: Clear Direction Flag. +// +// Forms: +// +// CLD +// Construct and append a CLD instruction to the active function. +func (c *Context) CLD() { + if inst, err := x86.CLD(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CLD: Clear Direction Flag. +// +// Forms: +// +// CLD +// Construct and append a CLD instruction to the active function. +// Operates on the global context. +func CLD() { ctx.CLD() } + +// CLFLUSH: Flush Cache Line. +// +// Forms: +// +// CLFLUSH m8 +// Construct and append a CLFLUSH instruction to the active function. +func (c *Context) CLFLUSH(m operand.Op) { + if inst, err := x86.CLFLUSH(m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CLFLUSH: Flush Cache Line. +// +// Forms: +// +// CLFLUSH m8 +// Construct and append a CLFLUSH instruction to the active function. +// Operates on the global context. +func CLFLUSH(m operand.Op) { ctx.CLFLUSH(m) } + +// CLFLUSHOPT: Flush Cache Line Optimized. +// +// Forms: +// +// CLFLUSHOPT m8 +// Construct and append a CLFLUSHOPT instruction to the active function. +func (c *Context) CLFLUSHOPT(m operand.Op) { + if inst, err := x86.CLFLUSHOPT(m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CLFLUSHOPT: Flush Cache Line Optimized. +// +// Forms: +// +// CLFLUSHOPT m8 +// Construct and append a CLFLUSHOPT instruction to the active function. +// Operates on the global context. +func CLFLUSHOPT(m operand.Op) { ctx.CLFLUSHOPT(m) } + +// CMC: Complement Carry Flag. +// +// Forms: +// +// CMC +// Construct and append a CMC instruction to the active function. +func (c *Context) CMC() { + if inst, err := x86.CMC(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMC: Complement Carry Flag. +// +// Forms: +// +// CMC +// Construct and append a CMC instruction to the active function. +// Operates on the global context. +func CMC() { ctx.CMC() } + +// CMOVLCC: Move if above or equal (CF == 0). +// +// Forms: +// +// CMOVLCC r32 r32 +// CMOVLCC m32 r32 +// Construct and append a CMOVLCC instruction to the active function. +func (c *Context) CMOVLCC(mr, r operand.Op) { + if inst, err := x86.CMOVLCC(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVLCC: Move if above or equal (CF == 0). +// +// Forms: +// +// CMOVLCC r32 r32 +// CMOVLCC m32 r32 +// Construct and append a CMOVLCC instruction to the active function. +// Operates on the global context. +func CMOVLCC(mr, r operand.Op) { ctx.CMOVLCC(mr, r) } + +// CMOVLCS: Move if below (CF == 1). +// +// Forms: +// +// CMOVLCS r32 r32 +// CMOVLCS m32 r32 +// Construct and append a CMOVLCS instruction to the active function. +func (c *Context) CMOVLCS(mr, r operand.Op) { + if inst, err := x86.CMOVLCS(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVLCS: Move if below (CF == 1). +// +// Forms: +// +// CMOVLCS r32 r32 +// CMOVLCS m32 r32 +// Construct and append a CMOVLCS instruction to the active function. +// Operates on the global context. +func CMOVLCS(mr, r operand.Op) { ctx.CMOVLCS(mr, r) } + +// CMOVLEQ: Move if equal (ZF == 1). +// +// Forms: +// +// CMOVLEQ r32 r32 +// CMOVLEQ m32 r32 +// Construct and append a CMOVLEQ instruction to the active function. +func (c *Context) CMOVLEQ(mr, r operand.Op) { + if inst, err := x86.CMOVLEQ(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVLEQ: Move if equal (ZF == 1). +// +// Forms: +// +// CMOVLEQ r32 r32 +// CMOVLEQ m32 r32 +// Construct and append a CMOVLEQ instruction to the active function. +// Operates on the global context. +func CMOVLEQ(mr, r operand.Op) { ctx.CMOVLEQ(mr, r) } + +// CMOVLGE: Move if greater or equal (SF == OF). +// +// Forms: +// +// CMOVLGE r32 r32 +// CMOVLGE m32 r32 +// Construct and append a CMOVLGE instruction to the active function. +func (c *Context) CMOVLGE(mr, r operand.Op) { + if inst, err := x86.CMOVLGE(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVLGE: Move if greater or equal (SF == OF). +// +// Forms: +// +// CMOVLGE r32 r32 +// CMOVLGE m32 r32 +// Construct and append a CMOVLGE instruction to the active function. +// Operates on the global context. +func CMOVLGE(mr, r operand.Op) { ctx.CMOVLGE(mr, r) } + +// CMOVLGT: Move if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// CMOVLGT r32 r32 +// CMOVLGT m32 r32 +// Construct and append a CMOVLGT instruction to the active function. +func (c *Context) CMOVLGT(mr, r operand.Op) { + if inst, err := x86.CMOVLGT(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVLGT: Move if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// CMOVLGT r32 r32 +// CMOVLGT m32 r32 +// Construct and append a CMOVLGT instruction to the active function. +// Operates on the global context. +func CMOVLGT(mr, r operand.Op) { ctx.CMOVLGT(mr, r) } + +// CMOVLHI: Move if above (CF == 0 and ZF == 0). +// +// Forms: +// +// CMOVLHI r32 r32 +// CMOVLHI m32 r32 +// Construct and append a CMOVLHI instruction to the active function. +func (c *Context) CMOVLHI(mr, r operand.Op) { + if inst, err := x86.CMOVLHI(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVLHI: Move if above (CF == 0 and ZF == 0). +// +// Forms: +// +// CMOVLHI r32 r32 +// CMOVLHI m32 r32 +// Construct and append a CMOVLHI instruction to the active function. +// Operates on the global context. +func CMOVLHI(mr, r operand.Op) { ctx.CMOVLHI(mr, r) } + +// CMOVLLE: Move if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// CMOVLLE r32 r32 +// CMOVLLE m32 r32 +// Construct and append a CMOVLLE instruction to the active function. +func (c *Context) CMOVLLE(mr, r operand.Op) { + if inst, err := x86.CMOVLLE(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVLLE: Move if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// CMOVLLE r32 r32 +// CMOVLLE m32 r32 +// Construct and append a CMOVLLE instruction to the active function. +// Operates on the global context. +func CMOVLLE(mr, r operand.Op) { ctx.CMOVLLE(mr, r) } + +// CMOVLLS: Move if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// CMOVLLS r32 r32 +// CMOVLLS m32 r32 +// Construct and append a CMOVLLS instruction to the active function. +func (c *Context) CMOVLLS(mr, r operand.Op) { + if inst, err := x86.CMOVLLS(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVLLS: Move if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// CMOVLLS r32 r32 +// CMOVLLS m32 r32 +// Construct and append a CMOVLLS instruction to the active function. +// Operates on the global context. +func CMOVLLS(mr, r operand.Op) { ctx.CMOVLLS(mr, r) } + +// CMOVLLT: Move if less (SF != OF). +// +// Forms: +// +// CMOVLLT r32 r32 +// CMOVLLT m32 r32 +// Construct and append a CMOVLLT instruction to the active function. +func (c *Context) CMOVLLT(mr, r operand.Op) { + if inst, err := x86.CMOVLLT(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVLLT: Move if less (SF != OF). +// +// Forms: +// +// CMOVLLT r32 r32 +// CMOVLLT m32 r32 +// Construct and append a CMOVLLT instruction to the active function. +// Operates on the global context. +func CMOVLLT(mr, r operand.Op) { ctx.CMOVLLT(mr, r) } + +// CMOVLMI: Move if sign (SF == 1). +// +// Forms: +// +// CMOVLMI r32 r32 +// CMOVLMI m32 r32 +// Construct and append a CMOVLMI instruction to the active function. +func (c *Context) CMOVLMI(mr, r operand.Op) { + if inst, err := x86.CMOVLMI(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVLMI: Move if sign (SF == 1). +// +// Forms: +// +// CMOVLMI r32 r32 +// CMOVLMI m32 r32 +// Construct and append a CMOVLMI instruction to the active function. +// Operates on the global context. +func CMOVLMI(mr, r operand.Op) { ctx.CMOVLMI(mr, r) } + +// CMOVLNE: Move if not equal (ZF == 0). +// +// Forms: +// +// CMOVLNE r32 r32 +// CMOVLNE m32 r32 +// Construct and append a CMOVLNE instruction to the active function. +func (c *Context) CMOVLNE(mr, r operand.Op) { + if inst, err := x86.CMOVLNE(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVLNE: Move if not equal (ZF == 0). +// +// Forms: +// +// CMOVLNE r32 r32 +// CMOVLNE m32 r32 +// Construct and append a CMOVLNE instruction to the active function. +// Operates on the global context. +func CMOVLNE(mr, r operand.Op) { ctx.CMOVLNE(mr, r) } + +// CMOVLOC: Move if not overflow (OF == 0). +// +// Forms: +// +// CMOVLOC r32 r32 +// CMOVLOC m32 r32 +// Construct and append a CMOVLOC instruction to the active function. +func (c *Context) CMOVLOC(mr, r operand.Op) { + if inst, err := x86.CMOVLOC(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVLOC: Move if not overflow (OF == 0). +// +// Forms: +// +// CMOVLOC r32 r32 +// CMOVLOC m32 r32 +// Construct and append a CMOVLOC instruction to the active function. +// Operates on the global context. +func CMOVLOC(mr, r operand.Op) { ctx.CMOVLOC(mr, r) } + +// CMOVLOS: Move if overflow (OF == 1). +// +// Forms: +// +// CMOVLOS r32 r32 +// CMOVLOS m32 r32 +// Construct and append a CMOVLOS instruction to the active function. +func (c *Context) CMOVLOS(mr, r operand.Op) { + if inst, err := x86.CMOVLOS(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVLOS: Move if overflow (OF == 1). +// +// Forms: +// +// CMOVLOS r32 r32 +// CMOVLOS m32 r32 +// Construct and append a CMOVLOS instruction to the active function. +// Operates on the global context. +func CMOVLOS(mr, r operand.Op) { ctx.CMOVLOS(mr, r) } + +// CMOVLPC: Move if not parity (PF == 0). +// +// Forms: +// +// CMOVLPC r32 r32 +// CMOVLPC m32 r32 +// Construct and append a CMOVLPC instruction to the active function. +func (c *Context) CMOVLPC(mr, r operand.Op) { + if inst, err := x86.CMOVLPC(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVLPC: Move if not parity (PF == 0). +// +// Forms: +// +// CMOVLPC r32 r32 +// CMOVLPC m32 r32 +// Construct and append a CMOVLPC instruction to the active function. +// Operates on the global context. +func CMOVLPC(mr, r operand.Op) { ctx.CMOVLPC(mr, r) } + +// CMOVLPL: Move if not sign (SF == 0). +// +// Forms: +// +// CMOVLPL r32 r32 +// CMOVLPL m32 r32 +// Construct and append a CMOVLPL instruction to the active function. +func (c *Context) CMOVLPL(mr, r operand.Op) { + if inst, err := x86.CMOVLPL(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVLPL: Move if not sign (SF == 0). +// +// Forms: +// +// CMOVLPL r32 r32 +// CMOVLPL m32 r32 +// Construct and append a CMOVLPL instruction to the active function. +// Operates on the global context. +func CMOVLPL(mr, r operand.Op) { ctx.CMOVLPL(mr, r) } + +// CMOVLPS: Move if parity (PF == 1). +// +// Forms: +// +// CMOVLPS r32 r32 +// CMOVLPS m32 r32 +// Construct and append a CMOVLPS instruction to the active function. +func (c *Context) CMOVLPS(mr, r operand.Op) { + if inst, err := x86.CMOVLPS(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVLPS: Move if parity (PF == 1). +// +// Forms: +// +// CMOVLPS r32 r32 +// CMOVLPS m32 r32 +// Construct and append a CMOVLPS instruction to the active function. +// Operates on the global context. +func CMOVLPS(mr, r operand.Op) { ctx.CMOVLPS(mr, r) } + +// CMOVQCC: Move if above or equal (CF == 0). +// +// Forms: +// +// CMOVQCC r64 r64 +// CMOVQCC m64 r64 +// Construct and append a CMOVQCC instruction to the active function. +func (c *Context) CMOVQCC(mr, r operand.Op) { + if inst, err := x86.CMOVQCC(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVQCC: Move if above or equal (CF == 0). +// +// Forms: +// +// CMOVQCC r64 r64 +// CMOVQCC m64 r64 +// Construct and append a CMOVQCC instruction to the active function. +// Operates on the global context. +func CMOVQCC(mr, r operand.Op) { ctx.CMOVQCC(mr, r) } + +// CMOVQCS: Move if below (CF == 1). +// +// Forms: +// +// CMOVQCS r64 r64 +// CMOVQCS m64 r64 +// Construct and append a CMOVQCS instruction to the active function. +func (c *Context) CMOVQCS(mr, r operand.Op) { + if inst, err := x86.CMOVQCS(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVQCS: Move if below (CF == 1). +// +// Forms: +// +// CMOVQCS r64 r64 +// CMOVQCS m64 r64 +// Construct and append a CMOVQCS instruction to the active function. +// Operates on the global context. +func CMOVQCS(mr, r operand.Op) { ctx.CMOVQCS(mr, r) } + +// CMOVQEQ: Move if equal (ZF == 1). +// +// Forms: +// +// CMOVQEQ r64 r64 +// CMOVQEQ m64 r64 +// Construct and append a CMOVQEQ instruction to the active function. +func (c *Context) CMOVQEQ(mr, r operand.Op) { + if inst, err := x86.CMOVQEQ(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVQEQ: Move if equal (ZF == 1). +// +// Forms: +// +// CMOVQEQ r64 r64 +// CMOVQEQ m64 r64 +// Construct and append a CMOVQEQ instruction to the active function. +// Operates on the global context. +func CMOVQEQ(mr, r operand.Op) { ctx.CMOVQEQ(mr, r) } + +// CMOVQGE: Move if greater or equal (SF == OF). +// +// Forms: +// +// CMOVQGE r64 r64 +// CMOVQGE m64 r64 +// Construct and append a CMOVQGE instruction to the active function. +func (c *Context) CMOVQGE(mr, r operand.Op) { + if inst, err := x86.CMOVQGE(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVQGE: Move if greater or equal (SF == OF). +// +// Forms: +// +// CMOVQGE r64 r64 +// CMOVQGE m64 r64 +// Construct and append a CMOVQGE instruction to the active function. +// Operates on the global context. +func CMOVQGE(mr, r operand.Op) { ctx.CMOVQGE(mr, r) } + +// CMOVQGT: Move if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// CMOVQGT r64 r64 +// CMOVQGT m64 r64 +// Construct and append a CMOVQGT instruction to the active function. +func (c *Context) CMOVQGT(mr, r operand.Op) { + if inst, err := x86.CMOVQGT(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVQGT: Move if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// CMOVQGT r64 r64 +// CMOVQGT m64 r64 +// Construct and append a CMOVQGT instruction to the active function. +// Operates on the global context. +func CMOVQGT(mr, r operand.Op) { ctx.CMOVQGT(mr, r) } + +// CMOVQHI: Move if above (CF == 0 and ZF == 0). +// +// Forms: +// +// CMOVQHI r64 r64 +// CMOVQHI m64 r64 +// Construct and append a CMOVQHI instruction to the active function. +func (c *Context) CMOVQHI(mr, r operand.Op) { + if inst, err := x86.CMOVQHI(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVQHI: Move if above (CF == 0 and ZF == 0). +// +// Forms: +// +// CMOVQHI r64 r64 +// CMOVQHI m64 r64 +// Construct and append a CMOVQHI instruction to the active function. +// Operates on the global context. +func CMOVQHI(mr, r operand.Op) { ctx.CMOVQHI(mr, r) } + +// CMOVQLE: Move if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// CMOVQLE r64 r64 +// CMOVQLE m64 r64 +// Construct and append a CMOVQLE instruction to the active function. +func (c *Context) CMOVQLE(mr, r operand.Op) { + if inst, err := x86.CMOVQLE(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVQLE: Move if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// CMOVQLE r64 r64 +// CMOVQLE m64 r64 +// Construct and append a CMOVQLE instruction to the active function. +// Operates on the global context. +func CMOVQLE(mr, r operand.Op) { ctx.CMOVQLE(mr, r) } + +// CMOVQLS: Move if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// CMOVQLS r64 r64 +// CMOVQLS m64 r64 +// Construct and append a CMOVQLS instruction to the active function. +func (c *Context) CMOVQLS(mr, r operand.Op) { + if inst, err := x86.CMOVQLS(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVQLS: Move if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// CMOVQLS r64 r64 +// CMOVQLS m64 r64 +// Construct and append a CMOVQLS instruction to the active function. +// Operates on the global context. +func CMOVQLS(mr, r operand.Op) { ctx.CMOVQLS(mr, r) } + +// CMOVQLT: Move if less (SF != OF). +// +// Forms: +// +// CMOVQLT r64 r64 +// CMOVQLT m64 r64 +// Construct and append a CMOVQLT instruction to the active function. +func (c *Context) CMOVQLT(mr, r operand.Op) { + if inst, err := x86.CMOVQLT(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVQLT: Move if less (SF != OF). +// +// Forms: +// +// CMOVQLT r64 r64 +// CMOVQLT m64 r64 +// Construct and append a CMOVQLT instruction to the active function. +// Operates on the global context. +func CMOVQLT(mr, r operand.Op) { ctx.CMOVQLT(mr, r) } + +// CMOVQMI: Move if sign (SF == 1). +// +// Forms: +// +// CMOVQMI r64 r64 +// CMOVQMI m64 r64 +// Construct and append a CMOVQMI instruction to the active function. +func (c *Context) CMOVQMI(mr, r operand.Op) { + if inst, err := x86.CMOVQMI(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVQMI: Move if sign (SF == 1). +// +// Forms: +// +// CMOVQMI r64 r64 +// CMOVQMI m64 r64 +// Construct and append a CMOVQMI instruction to the active function. +// Operates on the global context. +func CMOVQMI(mr, r operand.Op) { ctx.CMOVQMI(mr, r) } + +// CMOVQNE: Move if not equal (ZF == 0). +// +// Forms: +// +// CMOVQNE r64 r64 +// CMOVQNE m64 r64 +// Construct and append a CMOVQNE instruction to the active function. +func (c *Context) CMOVQNE(mr, r operand.Op) { + if inst, err := x86.CMOVQNE(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVQNE: Move if not equal (ZF == 0). +// +// Forms: +// +// CMOVQNE r64 r64 +// CMOVQNE m64 r64 +// Construct and append a CMOVQNE instruction to the active function. +// Operates on the global context. +func CMOVQNE(mr, r operand.Op) { ctx.CMOVQNE(mr, r) } + +// CMOVQOC: Move if not overflow (OF == 0). +// +// Forms: +// +// CMOVQOC r64 r64 +// CMOVQOC m64 r64 +// Construct and append a CMOVQOC instruction to the active function. +func (c *Context) CMOVQOC(mr, r operand.Op) { + if inst, err := x86.CMOVQOC(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVQOC: Move if not overflow (OF == 0). +// +// Forms: +// +// CMOVQOC r64 r64 +// CMOVQOC m64 r64 +// Construct and append a CMOVQOC instruction to the active function. +// Operates on the global context. +func CMOVQOC(mr, r operand.Op) { ctx.CMOVQOC(mr, r) } + +// CMOVQOS: Move if overflow (OF == 1). +// +// Forms: +// +// CMOVQOS r64 r64 +// CMOVQOS m64 r64 +// Construct and append a CMOVQOS instruction to the active function. +func (c *Context) CMOVQOS(mr, r operand.Op) { + if inst, err := x86.CMOVQOS(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVQOS: Move if overflow (OF == 1). +// +// Forms: +// +// CMOVQOS r64 r64 +// CMOVQOS m64 r64 +// Construct and append a CMOVQOS instruction to the active function. +// Operates on the global context. +func CMOVQOS(mr, r operand.Op) { ctx.CMOVQOS(mr, r) } + +// CMOVQPC: Move if not parity (PF == 0). +// +// Forms: +// +// CMOVQPC r64 r64 +// CMOVQPC m64 r64 +// Construct and append a CMOVQPC instruction to the active function. +func (c *Context) CMOVQPC(mr, r operand.Op) { + if inst, err := x86.CMOVQPC(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVQPC: Move if not parity (PF == 0). +// +// Forms: +// +// CMOVQPC r64 r64 +// CMOVQPC m64 r64 +// Construct and append a CMOVQPC instruction to the active function. +// Operates on the global context. +func CMOVQPC(mr, r operand.Op) { ctx.CMOVQPC(mr, r) } + +// CMOVQPL: Move if not sign (SF == 0). +// +// Forms: +// +// CMOVQPL r64 r64 +// CMOVQPL m64 r64 +// Construct and append a CMOVQPL instruction to the active function. +func (c *Context) CMOVQPL(mr, r operand.Op) { + if inst, err := x86.CMOVQPL(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVQPL: Move if not sign (SF == 0). +// +// Forms: +// +// CMOVQPL r64 r64 +// CMOVQPL m64 r64 +// Construct and append a CMOVQPL instruction to the active function. +// Operates on the global context. +func CMOVQPL(mr, r operand.Op) { ctx.CMOVQPL(mr, r) } + +// CMOVQPS: Move if parity (PF == 1). +// +// Forms: +// +// CMOVQPS r64 r64 +// CMOVQPS m64 r64 +// Construct and append a CMOVQPS instruction to the active function. +func (c *Context) CMOVQPS(mr, r operand.Op) { + if inst, err := x86.CMOVQPS(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVQPS: Move if parity (PF == 1). +// +// Forms: +// +// CMOVQPS r64 r64 +// CMOVQPS m64 r64 +// Construct and append a CMOVQPS instruction to the active function. +// Operates on the global context. +func CMOVQPS(mr, r operand.Op) { ctx.CMOVQPS(mr, r) } + +// CMOVWCC: Move if above or equal (CF == 0). +// +// Forms: +// +// CMOVWCC r16 r16 +// CMOVWCC m16 r16 +// Construct and append a CMOVWCC instruction to the active function. +func (c *Context) CMOVWCC(mr, r operand.Op) { + if inst, err := x86.CMOVWCC(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVWCC: Move if above or equal (CF == 0). +// +// Forms: +// +// CMOVWCC r16 r16 +// CMOVWCC m16 r16 +// Construct and append a CMOVWCC instruction to the active function. +// Operates on the global context. +func CMOVWCC(mr, r operand.Op) { ctx.CMOVWCC(mr, r) } + +// CMOVWCS: Move if below (CF == 1). +// +// Forms: +// +// CMOVWCS r16 r16 +// CMOVWCS m16 r16 +// Construct and append a CMOVWCS instruction to the active function. +func (c *Context) CMOVWCS(mr, r operand.Op) { + if inst, err := x86.CMOVWCS(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVWCS: Move if below (CF == 1). +// +// Forms: +// +// CMOVWCS r16 r16 +// CMOVWCS m16 r16 +// Construct and append a CMOVWCS instruction to the active function. +// Operates on the global context. +func CMOVWCS(mr, r operand.Op) { ctx.CMOVWCS(mr, r) } + +// CMOVWEQ: Move if equal (ZF == 1). +// +// Forms: +// +// CMOVWEQ r16 r16 +// CMOVWEQ m16 r16 +// Construct and append a CMOVWEQ instruction to the active function. +func (c *Context) CMOVWEQ(mr, r operand.Op) { + if inst, err := x86.CMOVWEQ(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVWEQ: Move if equal (ZF == 1). +// +// Forms: +// +// CMOVWEQ r16 r16 +// CMOVWEQ m16 r16 +// Construct and append a CMOVWEQ instruction to the active function. +// Operates on the global context. +func CMOVWEQ(mr, r operand.Op) { ctx.CMOVWEQ(mr, r) } + +// CMOVWGE: Move if greater or equal (SF == OF). +// +// Forms: +// +// CMOVWGE r16 r16 +// CMOVWGE m16 r16 +// Construct and append a CMOVWGE instruction to the active function. +func (c *Context) CMOVWGE(mr, r operand.Op) { + if inst, err := x86.CMOVWGE(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVWGE: Move if greater or equal (SF == OF). +// +// Forms: +// +// CMOVWGE r16 r16 +// CMOVWGE m16 r16 +// Construct and append a CMOVWGE instruction to the active function. +// Operates on the global context. +func CMOVWGE(mr, r operand.Op) { ctx.CMOVWGE(mr, r) } + +// CMOVWGT: Move if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// CMOVWGT r16 r16 +// CMOVWGT m16 r16 +// Construct and append a CMOVWGT instruction to the active function. +func (c *Context) CMOVWGT(mr, r operand.Op) { + if inst, err := x86.CMOVWGT(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVWGT: Move if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// CMOVWGT r16 r16 +// CMOVWGT m16 r16 +// Construct and append a CMOVWGT instruction to the active function. +// Operates on the global context. +func CMOVWGT(mr, r operand.Op) { ctx.CMOVWGT(mr, r) } + +// CMOVWHI: Move if above (CF == 0 and ZF == 0). +// +// Forms: +// +// CMOVWHI r16 r16 +// CMOVWHI m16 r16 +// Construct and append a CMOVWHI instruction to the active function. +func (c *Context) CMOVWHI(mr, r operand.Op) { + if inst, err := x86.CMOVWHI(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVWHI: Move if above (CF == 0 and ZF == 0). +// +// Forms: +// +// CMOVWHI r16 r16 +// CMOVWHI m16 r16 +// Construct and append a CMOVWHI instruction to the active function. +// Operates on the global context. +func CMOVWHI(mr, r operand.Op) { ctx.CMOVWHI(mr, r) } + +// CMOVWLE: Move if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// CMOVWLE r16 r16 +// CMOVWLE m16 r16 +// Construct and append a CMOVWLE instruction to the active function. +func (c *Context) CMOVWLE(mr, r operand.Op) { + if inst, err := x86.CMOVWLE(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVWLE: Move if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// CMOVWLE r16 r16 +// CMOVWLE m16 r16 +// Construct and append a CMOVWLE instruction to the active function. +// Operates on the global context. +func CMOVWLE(mr, r operand.Op) { ctx.CMOVWLE(mr, r) } + +// CMOVWLS: Move if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// CMOVWLS r16 r16 +// CMOVWLS m16 r16 +// Construct and append a CMOVWLS instruction to the active function. +func (c *Context) CMOVWLS(mr, r operand.Op) { + if inst, err := x86.CMOVWLS(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVWLS: Move if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// CMOVWLS r16 r16 +// CMOVWLS m16 r16 +// Construct and append a CMOVWLS instruction to the active function. +// Operates on the global context. +func CMOVWLS(mr, r operand.Op) { ctx.CMOVWLS(mr, r) } + +// CMOVWLT: Move if less (SF != OF). +// +// Forms: +// +// CMOVWLT r16 r16 +// CMOVWLT m16 r16 +// Construct and append a CMOVWLT instruction to the active function. +func (c *Context) CMOVWLT(mr, r operand.Op) { + if inst, err := x86.CMOVWLT(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVWLT: Move if less (SF != OF). +// +// Forms: +// +// CMOVWLT r16 r16 +// CMOVWLT m16 r16 +// Construct and append a CMOVWLT instruction to the active function. +// Operates on the global context. +func CMOVWLT(mr, r operand.Op) { ctx.CMOVWLT(mr, r) } + +// CMOVWMI: Move if sign (SF == 1). +// +// Forms: +// +// CMOVWMI r16 r16 +// CMOVWMI m16 r16 +// Construct and append a CMOVWMI instruction to the active function. +func (c *Context) CMOVWMI(mr, r operand.Op) { + if inst, err := x86.CMOVWMI(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVWMI: Move if sign (SF == 1). +// +// Forms: +// +// CMOVWMI r16 r16 +// CMOVWMI m16 r16 +// Construct and append a CMOVWMI instruction to the active function. +// Operates on the global context. +func CMOVWMI(mr, r operand.Op) { ctx.CMOVWMI(mr, r) } + +// CMOVWNE: Move if not equal (ZF == 0). +// +// Forms: +// +// CMOVWNE r16 r16 +// CMOVWNE m16 r16 +// Construct and append a CMOVWNE instruction to the active function. +func (c *Context) CMOVWNE(mr, r operand.Op) { + if inst, err := x86.CMOVWNE(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVWNE: Move if not equal (ZF == 0). +// +// Forms: +// +// CMOVWNE r16 r16 +// CMOVWNE m16 r16 +// Construct and append a CMOVWNE instruction to the active function. +// Operates on the global context. +func CMOVWNE(mr, r operand.Op) { ctx.CMOVWNE(mr, r) } + +// CMOVWOC: Move if not overflow (OF == 0). +// +// Forms: +// +// CMOVWOC r16 r16 +// CMOVWOC m16 r16 +// Construct and append a CMOVWOC instruction to the active function. +func (c *Context) CMOVWOC(mr, r operand.Op) { + if inst, err := x86.CMOVWOC(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVWOC: Move if not overflow (OF == 0). +// +// Forms: +// +// CMOVWOC r16 r16 +// CMOVWOC m16 r16 +// Construct and append a CMOVWOC instruction to the active function. +// Operates on the global context. +func CMOVWOC(mr, r operand.Op) { ctx.CMOVWOC(mr, r) } + +// CMOVWOS: Move if overflow (OF == 1). +// +// Forms: +// +// CMOVWOS r16 r16 +// CMOVWOS m16 r16 +// Construct and append a CMOVWOS instruction to the active function. +func (c *Context) CMOVWOS(mr, r operand.Op) { + if inst, err := x86.CMOVWOS(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVWOS: Move if overflow (OF == 1). +// +// Forms: +// +// CMOVWOS r16 r16 +// CMOVWOS m16 r16 +// Construct and append a CMOVWOS instruction to the active function. +// Operates on the global context. +func CMOVWOS(mr, r operand.Op) { ctx.CMOVWOS(mr, r) } + +// CMOVWPC: Move if not parity (PF == 0). +// +// Forms: +// +// CMOVWPC r16 r16 +// CMOVWPC m16 r16 +// Construct and append a CMOVWPC instruction to the active function. +func (c *Context) CMOVWPC(mr, r operand.Op) { + if inst, err := x86.CMOVWPC(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVWPC: Move if not parity (PF == 0). +// +// Forms: +// +// CMOVWPC r16 r16 +// CMOVWPC m16 r16 +// Construct and append a CMOVWPC instruction to the active function. +// Operates on the global context. +func CMOVWPC(mr, r operand.Op) { ctx.CMOVWPC(mr, r) } + +// CMOVWPL: Move if not sign (SF == 0). +// +// Forms: +// +// CMOVWPL r16 r16 +// CMOVWPL m16 r16 +// Construct and append a CMOVWPL instruction to the active function. +func (c *Context) CMOVWPL(mr, r operand.Op) { + if inst, err := x86.CMOVWPL(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVWPL: Move if not sign (SF == 0). +// +// Forms: +// +// CMOVWPL r16 r16 +// CMOVWPL m16 r16 +// Construct and append a CMOVWPL instruction to the active function. +// Operates on the global context. +func CMOVWPL(mr, r operand.Op) { ctx.CMOVWPL(mr, r) } + +// CMOVWPS: Move if parity (PF == 1). +// +// Forms: +// +// CMOVWPS r16 r16 +// CMOVWPS m16 r16 +// Construct and append a CMOVWPS instruction to the active function. +func (c *Context) CMOVWPS(mr, r operand.Op) { + if inst, err := x86.CMOVWPS(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMOVWPS: Move if parity (PF == 1). +// +// Forms: +// +// CMOVWPS r16 r16 +// CMOVWPS m16 r16 +// Construct and append a CMOVWPS instruction to the active function. +// Operates on the global context. +func CMOVWPS(mr, r operand.Op) { ctx.CMOVWPS(mr, r) } + +// CMPB: Compare Two Operands. +// +// Forms: +// +// CMPB al imm8 +// CMPB r8 imm8 +// CMPB r8 r8 +// CMPB r8 m8 +// CMPB m8 imm8 +// CMPB m8 r8 +// Construct and append a CMPB instruction to the active function. +func (c *Context) CMPB(amr, imr operand.Op) { + if inst, err := x86.CMPB(amr, imr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMPB: Compare Two Operands. +// +// Forms: +// +// CMPB al imm8 +// CMPB r8 imm8 +// CMPB r8 r8 +// CMPB r8 m8 +// CMPB m8 imm8 +// CMPB m8 r8 +// Construct and append a CMPB instruction to the active function. +// Operates on the global context. +func CMPB(amr, imr operand.Op) { ctx.CMPB(amr, imr) } + +// CMPL: Compare Two Operands. +// +// Forms: +// +// CMPL eax imm32 +// CMPL r32 imm8 +// CMPL r32 imm32 +// CMPL r32 r32 +// CMPL r32 m32 +// CMPL m32 imm8 +// CMPL m32 imm32 +// CMPL m32 r32 +// Construct and append a CMPL instruction to the active function. +func (c *Context) CMPL(emr, imr operand.Op) { + if inst, err := x86.CMPL(emr, imr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMPL: Compare Two Operands. +// +// Forms: +// +// CMPL eax imm32 +// CMPL r32 imm8 +// CMPL r32 imm32 +// CMPL r32 r32 +// CMPL r32 m32 +// CMPL m32 imm8 +// CMPL m32 imm32 +// CMPL m32 r32 +// Construct and append a CMPL instruction to the active function. +// Operates on the global context. +func CMPL(emr, imr operand.Op) { ctx.CMPL(emr, imr) } + +// CMPPD: Compare Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// CMPPD xmm xmm imm8 +// CMPPD m128 xmm imm8 +// Construct and append a CMPPD instruction to the active function. +func (c *Context) CMPPD(mx, x, i operand.Op) { + if inst, err := x86.CMPPD(mx, x, i); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMPPD: Compare Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// CMPPD xmm xmm imm8 +// CMPPD m128 xmm imm8 +// Construct and append a CMPPD instruction to the active function. +// Operates on the global context. +func CMPPD(mx, x, i operand.Op) { ctx.CMPPD(mx, x, i) } + +// CMPPS: Compare Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// CMPPS xmm xmm imm8 +// CMPPS m128 xmm imm8 +// Construct and append a CMPPS instruction to the active function. +func (c *Context) CMPPS(mx, x, i operand.Op) { + if inst, err := x86.CMPPS(mx, x, i); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMPPS: Compare Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// CMPPS xmm xmm imm8 +// CMPPS m128 xmm imm8 +// Construct and append a CMPPS instruction to the active function. +// Operates on the global context. +func CMPPS(mx, x, i operand.Op) { ctx.CMPPS(mx, x, i) } + +// CMPQ: Compare Two Operands. +// +// Forms: +// +// CMPQ rax imm32 +// CMPQ r64 imm8 +// CMPQ r64 imm32 +// CMPQ r64 r64 +// CMPQ r64 m64 +// CMPQ m64 imm8 +// CMPQ m64 imm32 +// CMPQ m64 r64 +// Construct and append a CMPQ instruction to the active function. +func (c *Context) CMPQ(mr, imr operand.Op) { + if inst, err := x86.CMPQ(mr, imr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMPQ: Compare Two Operands. +// +// Forms: +// +// CMPQ rax imm32 +// CMPQ r64 imm8 +// CMPQ r64 imm32 +// CMPQ r64 r64 +// CMPQ r64 m64 +// CMPQ m64 imm8 +// CMPQ m64 imm32 +// CMPQ m64 r64 +// Construct and append a CMPQ instruction to the active function. +// Operates on the global context. +func CMPQ(mr, imr operand.Op) { ctx.CMPQ(mr, imr) } + +// CMPSD: Compare Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// CMPSD xmm xmm imm8 +// CMPSD m64 xmm imm8 +// Construct and append a CMPSD instruction to the active function. +func (c *Context) CMPSD(mx, x, i operand.Op) { + if inst, err := x86.CMPSD(mx, x, i); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMPSD: Compare Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// CMPSD xmm xmm imm8 +// CMPSD m64 xmm imm8 +// Construct and append a CMPSD instruction to the active function. +// Operates on the global context. +func CMPSD(mx, x, i operand.Op) { ctx.CMPSD(mx, x, i) } + +// CMPSS: Compare Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// CMPSS xmm xmm imm8 +// CMPSS m32 xmm imm8 +// Construct and append a CMPSS instruction to the active function. +func (c *Context) CMPSS(mx, x, i operand.Op) { + if inst, err := x86.CMPSS(mx, x, i); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMPSS: Compare Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// CMPSS xmm xmm imm8 +// CMPSS m32 xmm imm8 +// Construct and append a CMPSS instruction to the active function. +// Operates on the global context. +func CMPSS(mx, x, i operand.Op) { ctx.CMPSS(mx, x, i) } + +// CMPW: Compare Two Operands. +// +// Forms: +// +// CMPW ax imm16 +// CMPW r16 imm8 +// CMPW r16 imm16 +// CMPW r16 r16 +// CMPW r16 m16 +// CMPW m16 imm8 +// CMPW m16 imm16 +// CMPW m16 r16 +// Construct and append a CMPW instruction to the active function. +func (c *Context) CMPW(amr, imr operand.Op) { + if inst, err := x86.CMPW(amr, imr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMPW: Compare Two Operands. +// +// Forms: +// +// CMPW ax imm16 +// CMPW r16 imm8 +// CMPW r16 imm16 +// CMPW r16 r16 +// CMPW r16 m16 +// CMPW m16 imm8 +// CMPW m16 imm16 +// CMPW m16 r16 +// Construct and append a CMPW instruction to the active function. +// Operates on the global context. +func CMPW(amr, imr operand.Op) { ctx.CMPW(amr, imr) } + +// CMPXCHG16B: Compare and Exchange 16 Bytes. +// +// Forms: +// +// CMPXCHG16B m128 +// Construct and append a CMPXCHG16B instruction to the active function. +func (c *Context) CMPXCHG16B(m operand.Op) { + if inst, err := x86.CMPXCHG16B(m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMPXCHG16B: Compare and Exchange 16 Bytes. +// +// Forms: +// +// CMPXCHG16B m128 +// Construct and append a CMPXCHG16B instruction to the active function. +// Operates on the global context. +func CMPXCHG16B(m operand.Op) { ctx.CMPXCHG16B(m) } + +// CMPXCHG8B: Compare and Exchange 8 Bytes. +// +// Forms: +// +// CMPXCHG8B m64 +// Construct and append a CMPXCHG8B instruction to the active function. +func (c *Context) CMPXCHG8B(m operand.Op) { + if inst, err := x86.CMPXCHG8B(m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMPXCHG8B: Compare and Exchange 8 Bytes. +// +// Forms: +// +// CMPXCHG8B m64 +// Construct and append a CMPXCHG8B instruction to the active function. +// Operates on the global context. +func CMPXCHG8B(m operand.Op) { ctx.CMPXCHG8B(m) } + +// CMPXCHGB: Compare and Exchange. +// +// Forms: +// +// CMPXCHGB r8 r8 +// CMPXCHGB r8 m8 +// Construct and append a CMPXCHGB instruction to the active function. +func (c *Context) CMPXCHGB(r, mr operand.Op) { + if inst, err := x86.CMPXCHGB(r, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMPXCHGB: Compare and Exchange. +// +// Forms: +// +// CMPXCHGB r8 r8 +// CMPXCHGB r8 m8 +// Construct and append a CMPXCHGB instruction to the active function. +// Operates on the global context. +func CMPXCHGB(r, mr operand.Op) { ctx.CMPXCHGB(r, mr) } + +// CMPXCHGL: Compare and Exchange. +// +// Forms: +// +// CMPXCHGL r32 r32 +// CMPXCHGL r32 m32 +// Construct and append a CMPXCHGL instruction to the active function. +func (c *Context) CMPXCHGL(r, mr operand.Op) { + if inst, err := x86.CMPXCHGL(r, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMPXCHGL: Compare and Exchange. +// +// Forms: +// +// CMPXCHGL r32 r32 +// CMPXCHGL r32 m32 +// Construct and append a CMPXCHGL instruction to the active function. +// Operates on the global context. +func CMPXCHGL(r, mr operand.Op) { ctx.CMPXCHGL(r, mr) } + +// CMPXCHGQ: Compare and Exchange. +// +// Forms: +// +// CMPXCHGQ r64 r64 +// CMPXCHGQ r64 m64 +// Construct and append a CMPXCHGQ instruction to the active function. +func (c *Context) CMPXCHGQ(r, mr operand.Op) { + if inst, err := x86.CMPXCHGQ(r, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMPXCHGQ: Compare and Exchange. +// +// Forms: +// +// CMPXCHGQ r64 r64 +// CMPXCHGQ r64 m64 +// Construct and append a CMPXCHGQ instruction to the active function. +// Operates on the global context. +func CMPXCHGQ(r, mr operand.Op) { ctx.CMPXCHGQ(r, mr) } + +// CMPXCHGW: Compare and Exchange. +// +// Forms: +// +// CMPXCHGW r16 r16 +// CMPXCHGW r16 m16 +// Construct and append a CMPXCHGW instruction to the active function. +func (c *Context) CMPXCHGW(r, mr operand.Op) { + if inst, err := x86.CMPXCHGW(r, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CMPXCHGW: Compare and Exchange. +// +// Forms: +// +// CMPXCHGW r16 r16 +// CMPXCHGW r16 m16 +// Construct and append a CMPXCHGW instruction to the active function. +// Operates on the global context. +func CMPXCHGW(r, mr operand.Op) { ctx.CMPXCHGW(r, mr) } + +// COMISD: Compare Scalar Ordered Double-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// COMISD xmm xmm +// COMISD m64 xmm +// Construct and append a COMISD instruction to the active function. +func (c *Context) COMISD(mx, x operand.Op) { + if inst, err := x86.COMISD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// COMISD: Compare Scalar Ordered Double-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// COMISD xmm xmm +// COMISD m64 xmm +// Construct and append a COMISD instruction to the active function. +// Operates on the global context. +func COMISD(mx, x operand.Op) { ctx.COMISD(mx, x) } + +// COMISS: Compare Scalar Ordered Single-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// COMISS xmm xmm +// COMISS m32 xmm +// Construct and append a COMISS instruction to the active function. +func (c *Context) COMISS(mx, x operand.Op) { + if inst, err := x86.COMISS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// COMISS: Compare Scalar Ordered Single-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// COMISS xmm xmm +// COMISS m32 xmm +// Construct and append a COMISS instruction to the active function. +// Operates on the global context. +func COMISS(mx, x operand.Op) { ctx.COMISS(mx, x) } + +// CPUID: CPU Identification. +// +// Forms: +// +// CPUID +// Construct and append a CPUID instruction to the active function. +func (c *Context) CPUID() { + if inst, err := x86.CPUID(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CPUID: CPU Identification. +// +// Forms: +// +// CPUID +// Construct and append a CPUID instruction to the active function. +// Operates on the global context. +func CPUID() { ctx.CPUID() } + +// CQO: Convert Quadword to Octaword. +// +// Forms: +// +// CQO +// Construct and append a CQO instruction to the active function. +func (c *Context) CQO() { + if inst, err := x86.CQO(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CQO: Convert Quadword to Octaword. +// +// Forms: +// +// CQO +// Construct and append a CQO instruction to the active function. +// Operates on the global context. +func CQO() { ctx.CQO() } + +// CRC32B: Accumulate CRC32 Value. +// +// Forms: +// +// CRC32B r8 r32 +// CRC32B m8 r32 +// CRC32B r8 r64 +// CRC32B m8 r64 +// Construct and append a CRC32B instruction to the active function. +func (c *Context) CRC32B(mr, r operand.Op) { + if inst, err := x86.CRC32B(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CRC32B: Accumulate CRC32 Value. +// +// Forms: +// +// CRC32B r8 r32 +// CRC32B m8 r32 +// CRC32B r8 r64 +// CRC32B m8 r64 +// Construct and append a CRC32B instruction to the active function. +// Operates on the global context. +func CRC32B(mr, r operand.Op) { ctx.CRC32B(mr, r) } + +// CRC32L: Accumulate CRC32 Value. +// +// Forms: +// +// CRC32L r32 r32 +// CRC32L m32 r32 +// Construct and append a CRC32L instruction to the active function. +func (c *Context) CRC32L(mr, r operand.Op) { + if inst, err := x86.CRC32L(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CRC32L: Accumulate CRC32 Value. +// +// Forms: +// +// CRC32L r32 r32 +// CRC32L m32 r32 +// Construct and append a CRC32L instruction to the active function. +// Operates on the global context. +func CRC32L(mr, r operand.Op) { ctx.CRC32L(mr, r) } + +// CRC32Q: Accumulate CRC32 Value. +// +// Forms: +// +// CRC32Q r64 r64 +// CRC32Q m64 r64 +// Construct and append a CRC32Q instruction to the active function. +func (c *Context) CRC32Q(mr, r operand.Op) { + if inst, err := x86.CRC32Q(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CRC32Q: Accumulate CRC32 Value. +// +// Forms: +// +// CRC32Q r64 r64 +// CRC32Q m64 r64 +// Construct and append a CRC32Q instruction to the active function. +// Operates on the global context. +func CRC32Q(mr, r operand.Op) { ctx.CRC32Q(mr, r) } + +// CRC32W: Accumulate CRC32 Value. +// +// Forms: +// +// CRC32W r16 r32 +// CRC32W m16 r32 +// Construct and append a CRC32W instruction to the active function. +func (c *Context) CRC32W(mr, r operand.Op) { + if inst, err := x86.CRC32W(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CRC32W: Accumulate CRC32 Value. +// +// Forms: +// +// CRC32W r16 r32 +// CRC32W m16 r32 +// Construct and append a CRC32W instruction to the active function. +// Operates on the global context. +func CRC32W(mr, r operand.Op) { ctx.CRC32W(mr, r) } + +// CVTPD2PL: Convert Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// CVTPD2PL xmm xmm +// CVTPD2PL m128 xmm +// Construct and append a CVTPD2PL instruction to the active function. +func (c *Context) CVTPD2PL(mx, x operand.Op) { + if inst, err := x86.CVTPD2PL(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTPD2PL: Convert Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// CVTPD2PL xmm xmm +// CVTPD2PL m128 xmm +// Construct and append a CVTPD2PL instruction to the active function. +// Operates on the global context. +func CVTPD2PL(mx, x operand.Op) { ctx.CVTPD2PL(mx, x) } + +// CVTPD2PS: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. +// +// Forms: +// +// CVTPD2PS xmm xmm +// CVTPD2PS m128 xmm +// Construct and append a CVTPD2PS instruction to the active function. +func (c *Context) CVTPD2PS(mx, x operand.Op) { + if inst, err := x86.CVTPD2PS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTPD2PS: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. +// +// Forms: +// +// CVTPD2PS xmm xmm +// CVTPD2PS m128 xmm +// Construct and append a CVTPD2PS instruction to the active function. +// Operates on the global context. +func CVTPD2PS(mx, x operand.Op) { ctx.CVTPD2PS(mx, x) } + +// CVTPL2PD: Convert Packed Dword Integers to Packed Double-Precision FP Values. +// +// Forms: +// +// CVTPL2PD xmm xmm +// CVTPL2PD m64 xmm +// Construct and append a CVTPL2PD instruction to the active function. +func (c *Context) CVTPL2PD(mx, x operand.Op) { + if inst, err := x86.CVTPL2PD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTPL2PD: Convert Packed Dword Integers to Packed Double-Precision FP Values. +// +// Forms: +// +// CVTPL2PD xmm xmm +// CVTPL2PD m64 xmm +// Construct and append a CVTPL2PD instruction to the active function. +// Operates on the global context. +func CVTPL2PD(mx, x operand.Op) { ctx.CVTPL2PD(mx, x) } + +// CVTPL2PS: Convert Packed Dword Integers to Packed Single-Precision FP Values. +// +// Forms: +// +// CVTPL2PS xmm xmm +// CVTPL2PS m128 xmm +// Construct and append a CVTPL2PS instruction to the active function. +func (c *Context) CVTPL2PS(mx, x operand.Op) { + if inst, err := x86.CVTPL2PS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTPL2PS: Convert Packed Dword Integers to Packed Single-Precision FP Values. +// +// Forms: +// +// CVTPL2PS xmm xmm +// CVTPL2PS m128 xmm +// Construct and append a CVTPL2PS instruction to the active function. +// Operates on the global context. +func CVTPL2PS(mx, x operand.Op) { ctx.CVTPL2PS(mx, x) } + +// CVTPS2PD: Convert Packed Single-Precision FP Values to Packed Double-Precision FP Values. +// +// Forms: +// +// CVTPS2PD xmm xmm +// CVTPS2PD m64 xmm +// Construct and append a CVTPS2PD instruction to the active function. +func (c *Context) CVTPS2PD(mx, x operand.Op) { + if inst, err := x86.CVTPS2PD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTPS2PD: Convert Packed Single-Precision FP Values to Packed Double-Precision FP Values. +// +// Forms: +// +// CVTPS2PD xmm xmm +// CVTPS2PD m64 xmm +// Construct and append a CVTPS2PD instruction to the active function. +// Operates on the global context. +func CVTPS2PD(mx, x operand.Op) { ctx.CVTPS2PD(mx, x) } + +// CVTPS2PL: Convert Packed Single-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// CVTPS2PL xmm xmm +// CVTPS2PL m128 xmm +// Construct and append a CVTPS2PL instruction to the active function. +func (c *Context) CVTPS2PL(mx, x operand.Op) { + if inst, err := x86.CVTPS2PL(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTPS2PL: Convert Packed Single-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// CVTPS2PL xmm xmm +// CVTPS2PL m128 xmm +// Construct and append a CVTPS2PL instruction to the active function. +// Operates on the global context. +func CVTPS2PL(mx, x operand.Op) { ctx.CVTPS2PL(mx, x) } + +// CVTSD2SL: Convert Scalar Double-Precision FP Value to Integer. +// +// Forms: +// +// CVTSD2SL xmm r32 +// CVTSD2SL m64 r32 +// CVTSD2SL xmm r64 +// CVTSD2SL m64 r64 +// Construct and append a CVTSD2SL instruction to the active function. +func (c *Context) CVTSD2SL(mx, r operand.Op) { + if inst, err := x86.CVTSD2SL(mx, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTSD2SL: Convert Scalar Double-Precision FP Value to Integer. +// +// Forms: +// +// CVTSD2SL xmm r32 +// CVTSD2SL m64 r32 +// CVTSD2SL xmm r64 +// CVTSD2SL m64 r64 +// Construct and append a CVTSD2SL instruction to the active function. +// Operates on the global context. +func CVTSD2SL(mx, r operand.Op) { ctx.CVTSD2SL(mx, r) } + +// CVTSD2SS: Convert Scalar Double-Precision FP Value to Scalar Single-Precision FP Value. +// +// Forms: +// +// CVTSD2SS xmm xmm +// CVTSD2SS m64 xmm +// Construct and append a CVTSD2SS instruction to the active function. +func (c *Context) CVTSD2SS(mx, x operand.Op) { + if inst, err := x86.CVTSD2SS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTSD2SS: Convert Scalar Double-Precision FP Value to Scalar Single-Precision FP Value. +// +// Forms: +// +// CVTSD2SS xmm xmm +// CVTSD2SS m64 xmm +// Construct and append a CVTSD2SS instruction to the active function. +// Operates on the global context. +func CVTSD2SS(mx, x operand.Op) { ctx.CVTSD2SS(mx, x) } + +// CVTSL2SD: Convert Dword Integer to Scalar Double-Precision FP Value. +// +// Forms: +// +// CVTSL2SD r32 xmm +// CVTSL2SD m32 xmm +// Construct and append a CVTSL2SD instruction to the active function. +func (c *Context) CVTSL2SD(mr, x operand.Op) { + if inst, err := x86.CVTSL2SD(mr, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTSL2SD: Convert Dword Integer to Scalar Double-Precision FP Value. +// +// Forms: +// +// CVTSL2SD r32 xmm +// CVTSL2SD m32 xmm +// Construct and append a CVTSL2SD instruction to the active function. +// Operates on the global context. +func CVTSL2SD(mr, x operand.Op) { ctx.CVTSL2SD(mr, x) } + +// CVTSL2SS: Convert Dword Integer to Scalar Single-Precision FP Value. +// +// Forms: +// +// CVTSL2SS r32 xmm +// CVTSL2SS m32 xmm +// Construct and append a CVTSL2SS instruction to the active function. +func (c *Context) CVTSL2SS(mr, x operand.Op) { + if inst, err := x86.CVTSL2SS(mr, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTSL2SS: Convert Dword Integer to Scalar Single-Precision FP Value. +// +// Forms: +// +// CVTSL2SS r32 xmm +// CVTSL2SS m32 xmm +// Construct and append a CVTSL2SS instruction to the active function. +// Operates on the global context. +func CVTSL2SS(mr, x operand.Op) { ctx.CVTSL2SS(mr, x) } + +// CVTSQ2SD: Convert Dword Integer to Scalar Double-Precision FP Value. +// +// Forms: +// +// CVTSQ2SD r64 xmm +// CVTSQ2SD m64 xmm +// Construct and append a CVTSQ2SD instruction to the active function. +func (c *Context) CVTSQ2SD(mr, x operand.Op) { + if inst, err := x86.CVTSQ2SD(mr, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTSQ2SD: Convert Dword Integer to Scalar Double-Precision FP Value. +// +// Forms: +// +// CVTSQ2SD r64 xmm +// CVTSQ2SD m64 xmm +// Construct and append a CVTSQ2SD instruction to the active function. +// Operates on the global context. +func CVTSQ2SD(mr, x operand.Op) { ctx.CVTSQ2SD(mr, x) } + +// CVTSQ2SS: Convert Dword Integer to Scalar Single-Precision FP Value. +// +// Forms: +// +// CVTSQ2SS r64 xmm +// CVTSQ2SS m64 xmm +// Construct and append a CVTSQ2SS instruction to the active function. +func (c *Context) CVTSQ2SS(mr, x operand.Op) { + if inst, err := x86.CVTSQ2SS(mr, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTSQ2SS: Convert Dword Integer to Scalar Single-Precision FP Value. +// +// Forms: +// +// CVTSQ2SS r64 xmm +// CVTSQ2SS m64 xmm +// Construct and append a CVTSQ2SS instruction to the active function. +// Operates on the global context. +func CVTSQ2SS(mr, x operand.Op) { ctx.CVTSQ2SS(mr, x) } + +// CVTSS2SD: Convert Scalar Single-Precision FP Value to Scalar Double-Precision FP Value. +// +// Forms: +// +// CVTSS2SD xmm xmm +// CVTSS2SD m32 xmm +// Construct and append a CVTSS2SD instruction to the active function. +func (c *Context) CVTSS2SD(mx, x operand.Op) { + if inst, err := x86.CVTSS2SD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTSS2SD: Convert Scalar Single-Precision FP Value to Scalar Double-Precision FP Value. +// +// Forms: +// +// CVTSS2SD xmm xmm +// CVTSS2SD m32 xmm +// Construct and append a CVTSS2SD instruction to the active function. +// Operates on the global context. +func CVTSS2SD(mx, x operand.Op) { ctx.CVTSS2SD(mx, x) } + +// CVTSS2SL: Convert Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// CVTSS2SL xmm r32 +// CVTSS2SL m32 r32 +// CVTSS2SL xmm r64 +// CVTSS2SL m32 r64 +// Construct and append a CVTSS2SL instruction to the active function. +func (c *Context) CVTSS2SL(mx, r operand.Op) { + if inst, err := x86.CVTSS2SL(mx, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTSS2SL: Convert Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// CVTSS2SL xmm r32 +// CVTSS2SL m32 r32 +// CVTSS2SL xmm r64 +// CVTSS2SL m32 r64 +// Construct and append a CVTSS2SL instruction to the active function. +// Operates on the global context. +func CVTSS2SL(mx, r operand.Op) { ctx.CVTSS2SL(mx, r) } + +// CVTTPD2PL: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// CVTTPD2PL xmm xmm +// CVTTPD2PL m128 xmm +// Construct and append a CVTTPD2PL instruction to the active function. +func (c *Context) CVTTPD2PL(mx, x operand.Op) { + if inst, err := x86.CVTTPD2PL(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTTPD2PL: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// CVTTPD2PL xmm xmm +// CVTTPD2PL m128 xmm +// Construct and append a CVTTPD2PL instruction to the active function. +// Operates on the global context. +func CVTTPD2PL(mx, x operand.Op) { ctx.CVTTPD2PL(mx, x) } + +// CVTTPS2PL: Convert with Truncation Packed Single-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// CVTTPS2PL xmm xmm +// CVTTPS2PL m128 xmm +// Construct and append a CVTTPS2PL instruction to the active function. +func (c *Context) CVTTPS2PL(mx, x operand.Op) { + if inst, err := x86.CVTTPS2PL(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTTPS2PL: Convert with Truncation Packed Single-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// CVTTPS2PL xmm xmm +// CVTTPS2PL m128 xmm +// Construct and append a CVTTPS2PL instruction to the active function. +// Operates on the global context. +func CVTTPS2PL(mx, x operand.Op) { ctx.CVTTPS2PL(mx, x) } + +// CVTTSD2SL: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. +// +// Forms: +// +// CVTTSD2SL xmm r32 +// CVTTSD2SL m64 r32 +// Construct and append a CVTTSD2SL instruction to the active function. +func (c *Context) CVTTSD2SL(mx, r operand.Op) { + if inst, err := x86.CVTTSD2SL(mx, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTTSD2SL: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. +// +// Forms: +// +// CVTTSD2SL xmm r32 +// CVTTSD2SL m64 r32 +// Construct and append a CVTTSD2SL instruction to the active function. +// Operates on the global context. +func CVTTSD2SL(mx, r operand.Op) { ctx.CVTTSD2SL(mx, r) } + +// CVTTSD2SQ: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. +// +// Forms: +// +// CVTTSD2SQ xmm r64 +// CVTTSD2SQ m64 r64 +// Construct and append a CVTTSD2SQ instruction to the active function. +func (c *Context) CVTTSD2SQ(mx, r operand.Op) { + if inst, err := x86.CVTTSD2SQ(mx, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTTSD2SQ: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. +// +// Forms: +// +// CVTTSD2SQ xmm r64 +// CVTTSD2SQ m64 r64 +// Construct and append a CVTTSD2SQ instruction to the active function. +// Operates on the global context. +func CVTTSD2SQ(mx, r operand.Op) { ctx.CVTTSD2SQ(mx, r) } + +// CVTTSS2SL: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// CVTTSS2SL xmm r32 +// CVTTSS2SL m32 r32 +// CVTTSS2SL xmm r64 +// CVTTSS2SL m32 r64 +// Construct and append a CVTTSS2SL instruction to the active function. +func (c *Context) CVTTSS2SL(mx, r operand.Op) { + if inst, err := x86.CVTTSS2SL(mx, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CVTTSS2SL: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// CVTTSS2SL xmm r32 +// CVTTSS2SL m32 r32 +// CVTTSS2SL xmm r64 +// CVTTSS2SL m32 r64 +// Construct and append a CVTTSS2SL instruction to the active function. +// Operates on the global context. +func CVTTSS2SL(mx, r operand.Op) { ctx.CVTTSS2SL(mx, r) } + +// CWD: Convert Word to Doubleword. +// +// Forms: +// +// CWD +// Construct and append a CWD instruction to the active function. +func (c *Context) CWD() { + if inst, err := x86.CWD(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CWD: Convert Word to Doubleword. +// +// Forms: +// +// CWD +// Construct and append a CWD instruction to the active function. +// Operates on the global context. +func CWD() { ctx.CWD() } + +// CWDE: Convert Word to Doubleword. +// +// Forms: +// +// CWDE +// Construct and append a CWDE instruction to the active function. +func (c *Context) CWDE() { + if inst, err := x86.CWDE(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// CWDE: Convert Word to Doubleword. +// +// Forms: +// +// CWDE +// Construct and append a CWDE instruction to the active function. +// Operates on the global context. +func CWDE() { ctx.CWDE() } + +// DECB: Decrement by 1. +// +// Forms: +// +// DECB r8 +// DECB m8 +// Construct and append a DECB instruction to the active function. +func (c *Context) DECB(mr operand.Op) { + if inst, err := x86.DECB(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// DECB: Decrement by 1. +// +// Forms: +// +// DECB r8 +// DECB m8 +// Construct and append a DECB instruction to the active function. +// Operates on the global context. +func DECB(mr operand.Op) { ctx.DECB(mr) } + +// DECL: Decrement by 1. +// +// Forms: +// +// DECL r32 +// DECL m32 +// Construct and append a DECL instruction to the active function. +func (c *Context) DECL(mr operand.Op) { + if inst, err := x86.DECL(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// DECL: Decrement by 1. +// +// Forms: +// +// DECL r32 +// DECL m32 +// Construct and append a DECL instruction to the active function. +// Operates on the global context. +func DECL(mr operand.Op) { ctx.DECL(mr) } + +// DECQ: Decrement by 1. +// +// Forms: +// +// DECQ r64 +// DECQ m64 +// Construct and append a DECQ instruction to the active function. +func (c *Context) DECQ(mr operand.Op) { + if inst, err := x86.DECQ(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// DECQ: Decrement by 1. +// +// Forms: +// +// DECQ r64 +// DECQ m64 +// Construct and append a DECQ instruction to the active function. +// Operates on the global context. +func DECQ(mr operand.Op) { ctx.DECQ(mr) } + +// DECW: Decrement by 1. +// +// Forms: +// +// DECW r16 +// DECW m16 +// Construct and append a DECW instruction to the active function. +func (c *Context) DECW(mr operand.Op) { + if inst, err := x86.DECW(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// DECW: Decrement by 1. +// +// Forms: +// +// DECW r16 +// DECW m16 +// Construct and append a DECW instruction to the active function. +// Operates on the global context. +func DECW(mr operand.Op) { ctx.DECW(mr) } + +// DIVB: Unsigned Divide. +// +// Forms: +// +// DIVB r8 +// DIVB m8 +// Construct and append a DIVB instruction to the active function. +func (c *Context) DIVB(mr operand.Op) { + if inst, err := x86.DIVB(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// DIVB: Unsigned Divide. +// +// Forms: +// +// DIVB r8 +// DIVB m8 +// Construct and append a DIVB instruction to the active function. +// Operates on the global context. +func DIVB(mr operand.Op) { ctx.DIVB(mr) } + +// DIVL: Unsigned Divide. +// +// Forms: +// +// DIVL r32 +// DIVL m32 +// Construct and append a DIVL instruction to the active function. +func (c *Context) DIVL(mr operand.Op) { + if inst, err := x86.DIVL(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// DIVL: Unsigned Divide. +// +// Forms: +// +// DIVL r32 +// DIVL m32 +// Construct and append a DIVL instruction to the active function. +// Operates on the global context. +func DIVL(mr operand.Op) { ctx.DIVL(mr) } + +// DIVPD: Divide Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// DIVPD xmm xmm +// DIVPD m128 xmm +// Construct and append a DIVPD instruction to the active function. +func (c *Context) DIVPD(mx, x operand.Op) { + if inst, err := x86.DIVPD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// DIVPD: Divide Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// DIVPD xmm xmm +// DIVPD m128 xmm +// Construct and append a DIVPD instruction to the active function. +// Operates on the global context. +func DIVPD(mx, x operand.Op) { ctx.DIVPD(mx, x) } + +// DIVPS: Divide Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// DIVPS xmm xmm +// DIVPS m128 xmm +// Construct and append a DIVPS instruction to the active function. +func (c *Context) DIVPS(mx, x operand.Op) { + if inst, err := x86.DIVPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// DIVPS: Divide Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// DIVPS xmm xmm +// DIVPS m128 xmm +// Construct and append a DIVPS instruction to the active function. +// Operates on the global context. +func DIVPS(mx, x operand.Op) { ctx.DIVPS(mx, x) } + +// DIVQ: Unsigned Divide. +// +// Forms: +// +// DIVQ r64 +// DIVQ m64 +// Construct and append a DIVQ instruction to the active function. +func (c *Context) DIVQ(mr operand.Op) { + if inst, err := x86.DIVQ(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// DIVQ: Unsigned Divide. +// +// Forms: +// +// DIVQ r64 +// DIVQ m64 +// Construct and append a DIVQ instruction to the active function. +// Operates on the global context. +func DIVQ(mr operand.Op) { ctx.DIVQ(mr) } + +// DIVSD: Divide Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// DIVSD xmm xmm +// DIVSD m64 xmm +// Construct and append a DIVSD instruction to the active function. +func (c *Context) DIVSD(mx, x operand.Op) { + if inst, err := x86.DIVSD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// DIVSD: Divide Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// DIVSD xmm xmm +// DIVSD m64 xmm +// Construct and append a DIVSD instruction to the active function. +// Operates on the global context. +func DIVSD(mx, x operand.Op) { ctx.DIVSD(mx, x) } + +// DIVSS: Divide Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// DIVSS xmm xmm +// DIVSS m32 xmm +// Construct and append a DIVSS instruction to the active function. +func (c *Context) DIVSS(mx, x operand.Op) { + if inst, err := x86.DIVSS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// DIVSS: Divide Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// DIVSS xmm xmm +// DIVSS m32 xmm +// Construct and append a DIVSS instruction to the active function. +// Operates on the global context. +func DIVSS(mx, x operand.Op) { ctx.DIVSS(mx, x) } + +// DIVW: Unsigned Divide. +// +// Forms: +// +// DIVW r16 +// DIVW m16 +// Construct and append a DIVW instruction to the active function. +func (c *Context) DIVW(mr operand.Op) { + if inst, err := x86.DIVW(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// DIVW: Unsigned Divide. +// +// Forms: +// +// DIVW r16 +// DIVW m16 +// Construct and append a DIVW instruction to the active function. +// Operates on the global context. +func DIVW(mr operand.Op) { ctx.DIVW(mr) } + +// DPPD: Dot Product of Packed Double Precision Floating-Point Values. +// +// Forms: +// +// DPPD imm8 xmm xmm +// DPPD imm8 m128 xmm +// Construct and append a DPPD instruction to the active function. +func (c *Context) DPPD(i, mx, x operand.Op) { + if inst, err := x86.DPPD(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// DPPD: Dot Product of Packed Double Precision Floating-Point Values. +// +// Forms: +// +// DPPD imm8 xmm xmm +// DPPD imm8 m128 xmm +// Construct and append a DPPD instruction to the active function. +// Operates on the global context. +func DPPD(i, mx, x operand.Op) { ctx.DPPD(i, mx, x) } + +// DPPS: Dot Product of Packed Single Precision Floating-Point Values. +// +// Forms: +// +// DPPS imm8 xmm xmm +// DPPS imm8 m128 xmm +// Construct and append a DPPS instruction to the active function. +func (c *Context) DPPS(i, mx, x operand.Op) { + if inst, err := x86.DPPS(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// DPPS: Dot Product of Packed Single Precision Floating-Point Values. +// +// Forms: +// +// DPPS imm8 xmm xmm +// DPPS imm8 m128 xmm +// Construct and append a DPPS instruction to the active function. +// Operates on the global context. +func DPPS(i, mx, x operand.Op) { ctx.DPPS(i, mx, x) } + +// EXTRACTPS: Extract Packed Single Precision Floating-Point Value. +// +// Forms: +// +// EXTRACTPS imm2u xmm r32 +// EXTRACTPS imm2u xmm m32 +// Construct and append a EXTRACTPS instruction to the active function. +func (c *Context) EXTRACTPS(i, x, mr operand.Op) { + if inst, err := x86.EXTRACTPS(i, x, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// EXTRACTPS: Extract Packed Single Precision Floating-Point Value. +// +// Forms: +// +// EXTRACTPS imm2u xmm r32 +// EXTRACTPS imm2u xmm m32 +// Construct and append a EXTRACTPS instruction to the active function. +// Operates on the global context. +func EXTRACTPS(i, x, mr operand.Op) { ctx.EXTRACTPS(i, x, mr) } + +// HADDPD: Packed Double-FP Horizontal Add. +// +// Forms: +// +// HADDPD xmm xmm +// HADDPD m128 xmm +// Construct and append a HADDPD instruction to the active function. +func (c *Context) HADDPD(mx, x operand.Op) { + if inst, err := x86.HADDPD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// HADDPD: Packed Double-FP Horizontal Add. +// +// Forms: +// +// HADDPD xmm xmm +// HADDPD m128 xmm +// Construct and append a HADDPD instruction to the active function. +// Operates on the global context. +func HADDPD(mx, x operand.Op) { ctx.HADDPD(mx, x) } + +// HADDPS: Packed Single-FP Horizontal Add. +// +// Forms: +// +// HADDPS xmm xmm +// HADDPS m128 xmm +// Construct and append a HADDPS instruction to the active function. +func (c *Context) HADDPS(mx, x operand.Op) { + if inst, err := x86.HADDPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// HADDPS: Packed Single-FP Horizontal Add. +// +// Forms: +// +// HADDPS xmm xmm +// HADDPS m128 xmm +// Construct and append a HADDPS instruction to the active function. +// Operates on the global context. +func HADDPS(mx, x operand.Op) { ctx.HADDPS(mx, x) } + +// HSUBPD: Packed Double-FP Horizontal Subtract. +// +// Forms: +// +// HSUBPD xmm xmm +// HSUBPD m128 xmm +// Construct and append a HSUBPD instruction to the active function. +func (c *Context) HSUBPD(mx, x operand.Op) { + if inst, err := x86.HSUBPD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// HSUBPD: Packed Double-FP Horizontal Subtract. +// +// Forms: +// +// HSUBPD xmm xmm +// HSUBPD m128 xmm +// Construct and append a HSUBPD instruction to the active function. +// Operates on the global context. +func HSUBPD(mx, x operand.Op) { ctx.HSUBPD(mx, x) } + +// HSUBPS: Packed Single-FP Horizontal Subtract. +// +// Forms: +// +// HSUBPS xmm xmm +// HSUBPS m128 xmm +// Construct and append a HSUBPS instruction to the active function. +func (c *Context) HSUBPS(mx, x operand.Op) { + if inst, err := x86.HSUBPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// HSUBPS: Packed Single-FP Horizontal Subtract. +// +// Forms: +// +// HSUBPS xmm xmm +// HSUBPS m128 xmm +// Construct and append a HSUBPS instruction to the active function. +// Operates on the global context. +func HSUBPS(mx, x operand.Op) { ctx.HSUBPS(mx, x) } + +// IDIVB: Signed Divide. +// +// Forms: +// +// IDIVB r8 +// IDIVB m8 +// Construct and append a IDIVB instruction to the active function. +func (c *Context) IDIVB(mr operand.Op) { + if inst, err := x86.IDIVB(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// IDIVB: Signed Divide. +// +// Forms: +// +// IDIVB r8 +// IDIVB m8 +// Construct and append a IDIVB instruction to the active function. +// Operates on the global context. +func IDIVB(mr operand.Op) { ctx.IDIVB(mr) } + +// IDIVL: Signed Divide. +// +// Forms: +// +// IDIVL r32 +// IDIVL m32 +// Construct and append a IDIVL instruction to the active function. +func (c *Context) IDIVL(mr operand.Op) { + if inst, err := x86.IDIVL(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// IDIVL: Signed Divide. +// +// Forms: +// +// IDIVL r32 +// IDIVL m32 +// Construct and append a IDIVL instruction to the active function. +// Operates on the global context. +func IDIVL(mr operand.Op) { ctx.IDIVL(mr) } + +// IDIVQ: Signed Divide. +// +// Forms: +// +// IDIVQ r64 +// IDIVQ m64 +// Construct and append a IDIVQ instruction to the active function. +func (c *Context) IDIVQ(mr operand.Op) { + if inst, err := x86.IDIVQ(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// IDIVQ: Signed Divide. +// +// Forms: +// +// IDIVQ r64 +// IDIVQ m64 +// Construct and append a IDIVQ instruction to the active function. +// Operates on the global context. +func IDIVQ(mr operand.Op) { ctx.IDIVQ(mr) } + +// IDIVW: Signed Divide. +// +// Forms: +// +// IDIVW r16 +// IDIVW m16 +// Construct and append a IDIVW instruction to the active function. +func (c *Context) IDIVW(mr operand.Op) { + if inst, err := x86.IDIVW(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// IDIVW: Signed Divide. +// +// Forms: +// +// IDIVW r16 +// IDIVW m16 +// Construct and append a IDIVW instruction to the active function. +// Operates on the global context. +func IDIVW(mr operand.Op) { ctx.IDIVW(mr) } + +// IMUL3L: Signed Multiply. +// +// Forms: +// +// IMUL3L imm8 r32 r32 +// IMUL3L imm32 r32 r32 +// IMUL3L imm8 m32 r32 +// IMUL3L imm32 m32 r32 +// Construct and append a IMUL3L instruction to the active function. +func (c *Context) IMUL3L(i, mr, r operand.Op) { + if inst, err := x86.IMUL3L(i, mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// IMUL3L: Signed Multiply. +// +// Forms: +// +// IMUL3L imm8 r32 r32 +// IMUL3L imm32 r32 r32 +// IMUL3L imm8 m32 r32 +// IMUL3L imm32 m32 r32 +// Construct and append a IMUL3L instruction to the active function. +// Operates on the global context. +func IMUL3L(i, mr, r operand.Op) { ctx.IMUL3L(i, mr, r) } + +// IMUL3Q: Signed Multiply. +// +// Forms: +// +// IMUL3Q imm8 r64 r64 +// IMUL3Q imm32 r64 r64 +// IMUL3Q imm8 m64 r64 +// IMUL3Q imm32 m64 r64 +// Construct and append a IMUL3Q instruction to the active function. +func (c *Context) IMUL3Q(i, mr, r operand.Op) { + if inst, err := x86.IMUL3Q(i, mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// IMUL3Q: Signed Multiply. +// +// Forms: +// +// IMUL3Q imm8 r64 r64 +// IMUL3Q imm32 r64 r64 +// IMUL3Q imm8 m64 r64 +// IMUL3Q imm32 m64 r64 +// Construct and append a IMUL3Q instruction to the active function. +// Operates on the global context. +func IMUL3Q(i, mr, r operand.Op) { ctx.IMUL3Q(i, mr, r) } + +// IMUL3W: Signed Multiply. +// +// Forms: +// +// IMUL3W imm8 r16 r16 +// IMUL3W imm16 r16 r16 +// IMUL3W imm8 m16 r16 +// IMUL3W imm16 m16 r16 +// Construct and append a IMUL3W instruction to the active function. +func (c *Context) IMUL3W(i, mr, r operand.Op) { + if inst, err := x86.IMUL3W(i, mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// IMUL3W: Signed Multiply. +// +// Forms: +// +// IMUL3W imm8 r16 r16 +// IMUL3W imm16 r16 r16 +// IMUL3W imm8 m16 r16 +// IMUL3W imm16 m16 r16 +// Construct and append a IMUL3W instruction to the active function. +// Operates on the global context. +func IMUL3W(i, mr, r operand.Op) { ctx.IMUL3W(i, mr, r) } + +// IMULB: Signed Multiply. +// +// Forms: +// +// IMULB r8 +// IMULB m8 +// Construct and append a IMULB instruction to the active function. +func (c *Context) IMULB(mr operand.Op) { + if inst, err := x86.IMULB(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// IMULB: Signed Multiply. +// +// Forms: +// +// IMULB r8 +// IMULB m8 +// Construct and append a IMULB instruction to the active function. +// Operates on the global context. +func IMULB(mr operand.Op) { ctx.IMULB(mr) } + +// IMULL: Signed Multiply. +// +// Forms: +// +// IMULL r32 +// IMULL m32 +// IMULL r32 r32 +// IMULL m32 r32 +// Construct and append a IMULL instruction to the active function. +func (c *Context) IMULL(ops ...operand.Op) { + if inst, err := x86.IMULL(ops...); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// IMULL: Signed Multiply. +// +// Forms: +// +// IMULL r32 +// IMULL m32 +// IMULL r32 r32 +// IMULL m32 r32 +// Construct and append a IMULL instruction to the active function. +// Operates on the global context. +func IMULL(ops ...operand.Op) { ctx.IMULL(ops...) } + +// IMULQ: Signed Multiply. +// +// Forms: +// +// IMULQ r64 +// IMULQ m64 +// IMULQ r64 r64 +// IMULQ m64 r64 +// Construct and append a IMULQ instruction to the active function. +func (c *Context) IMULQ(ops ...operand.Op) { + if inst, err := x86.IMULQ(ops...); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// IMULQ: Signed Multiply. +// +// Forms: +// +// IMULQ r64 +// IMULQ m64 +// IMULQ r64 r64 +// IMULQ m64 r64 +// Construct and append a IMULQ instruction to the active function. +// Operates on the global context. +func IMULQ(ops ...operand.Op) { ctx.IMULQ(ops...) } + +// IMULW: Signed Multiply. +// +// Forms: +// +// IMULW r16 +// IMULW m16 +// IMULW r16 r16 +// IMULW m16 r16 +// Construct and append a IMULW instruction to the active function. +func (c *Context) IMULW(ops ...operand.Op) { + if inst, err := x86.IMULW(ops...); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// IMULW: Signed Multiply. +// +// Forms: +// +// IMULW r16 +// IMULW m16 +// IMULW r16 r16 +// IMULW m16 r16 +// Construct and append a IMULW instruction to the active function. +// Operates on the global context. +func IMULW(ops ...operand.Op) { ctx.IMULW(ops...) } + +// INCB: Increment by 1. +// +// Forms: +// +// INCB r8 +// INCB m8 +// Construct and append a INCB instruction to the active function. +func (c *Context) INCB(mr operand.Op) { + if inst, err := x86.INCB(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// INCB: Increment by 1. +// +// Forms: +// +// INCB r8 +// INCB m8 +// Construct and append a INCB instruction to the active function. +// Operates on the global context. +func INCB(mr operand.Op) { ctx.INCB(mr) } + +// INCL: Increment by 1. +// +// Forms: +// +// INCL r32 +// INCL m32 +// Construct and append a INCL instruction to the active function. +func (c *Context) INCL(mr operand.Op) { + if inst, err := x86.INCL(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// INCL: Increment by 1. +// +// Forms: +// +// INCL r32 +// INCL m32 +// Construct and append a INCL instruction to the active function. +// Operates on the global context. +func INCL(mr operand.Op) { ctx.INCL(mr) } + +// INCQ: Increment by 1. +// +// Forms: +// +// INCQ r64 +// INCQ m64 +// Construct and append a INCQ instruction to the active function. +func (c *Context) INCQ(mr operand.Op) { + if inst, err := x86.INCQ(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// INCQ: Increment by 1. +// +// Forms: +// +// INCQ r64 +// INCQ m64 +// Construct and append a INCQ instruction to the active function. +// Operates on the global context. +func INCQ(mr operand.Op) { ctx.INCQ(mr) } + +// INCW: Increment by 1. +// +// Forms: +// +// INCW r16 +// INCW m16 +// Construct and append a INCW instruction to the active function. +func (c *Context) INCW(mr operand.Op) { + if inst, err := x86.INCW(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// INCW: Increment by 1. +// +// Forms: +// +// INCW r16 +// INCW m16 +// Construct and append a INCW instruction to the active function. +// Operates on the global context. +func INCW(mr operand.Op) { ctx.INCW(mr) } + +// INSERTPS: Insert Packed Single Precision Floating-Point Value. +// +// Forms: +// +// INSERTPS imm8 xmm xmm +// INSERTPS imm8 m32 xmm +// Construct and append a INSERTPS instruction to the active function. +func (c *Context) INSERTPS(i, mx, x operand.Op) { + if inst, err := x86.INSERTPS(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// INSERTPS: Insert Packed Single Precision Floating-Point Value. +// +// Forms: +// +// INSERTPS imm8 xmm xmm +// INSERTPS imm8 m32 xmm +// Construct and append a INSERTPS instruction to the active function. +// Operates on the global context. +func INSERTPS(i, mx, x operand.Op) { ctx.INSERTPS(i, mx, x) } + +// INT: Call to Interrupt Procedure. +// +// Forms: +// +// INT 3 +// INT imm8 +// Construct and append a INT instruction to the active function. +func (c *Context) INT(i operand.Op) { + if inst, err := x86.INT(i); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// INT: Call to Interrupt Procedure. +// +// Forms: +// +// INT 3 +// INT imm8 +// Construct and append a INT instruction to the active function. +// Operates on the global context. +func INT(i operand.Op) { ctx.INT(i) } + +// JA: Jump if above (CF == 0 and ZF == 0). +// +// Forms: +// +// JA rel8 +// JA rel32 +// Construct and append a JA instruction to the active function. +func (c *Context) JA(r operand.Op) { + if inst, err := x86.JA(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JA: Jump if above (CF == 0 and ZF == 0). +// +// Forms: +// +// JA rel8 +// JA rel32 +// Construct and append a JA instruction to the active function. +// Operates on the global context. +func JA(r operand.Op) { ctx.JA(r) } + +// JAE: Jump if above or equal (CF == 0). +// +// Forms: +// +// JAE rel8 +// JAE rel32 +// Construct and append a JAE instruction to the active function. +func (c *Context) JAE(r operand.Op) { + if inst, err := x86.JAE(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JAE: Jump if above or equal (CF == 0). +// +// Forms: +// +// JAE rel8 +// JAE rel32 +// Construct and append a JAE instruction to the active function. +// Operates on the global context. +func JAE(r operand.Op) { ctx.JAE(r) } + +// JB: Jump if below (CF == 1). +// +// Forms: +// +// JB rel8 +// JB rel32 +// Construct and append a JB instruction to the active function. +func (c *Context) JB(r operand.Op) { + if inst, err := x86.JB(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JB: Jump if below (CF == 1). +// +// Forms: +// +// JB rel8 +// JB rel32 +// Construct and append a JB instruction to the active function. +// Operates on the global context. +func JB(r operand.Op) { ctx.JB(r) } + +// JBE: Jump if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// JBE rel8 +// JBE rel32 +// Construct and append a JBE instruction to the active function. +func (c *Context) JBE(r operand.Op) { + if inst, err := x86.JBE(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JBE: Jump if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// JBE rel8 +// JBE rel32 +// Construct and append a JBE instruction to the active function. +// Operates on the global context. +func JBE(r operand.Op) { ctx.JBE(r) } + +// JC: Jump if below (CF == 1). +// +// Forms: +// +// JC rel8 +// JC rel32 +// Construct and append a JC instruction to the active function. +func (c *Context) JC(r operand.Op) { + if inst, err := x86.JC(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JC: Jump if below (CF == 1). +// +// Forms: +// +// JC rel8 +// JC rel32 +// Construct and append a JC instruction to the active function. +// Operates on the global context. +func JC(r operand.Op) { ctx.JC(r) } + +// JCC: Jump if above or equal (CF == 0). +// +// Forms: +// +// JCC rel8 +// JCC rel32 +// Construct and append a JCC instruction to the active function. +func (c *Context) JCC(r operand.Op) { + if inst, err := x86.JCC(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JCC: Jump if above or equal (CF == 0). +// +// Forms: +// +// JCC rel8 +// JCC rel32 +// Construct and append a JCC instruction to the active function. +// Operates on the global context. +func JCC(r operand.Op) { ctx.JCC(r) } + +// JCS: Jump if below (CF == 1). +// +// Forms: +// +// JCS rel8 +// JCS rel32 +// Construct and append a JCS instruction to the active function. +func (c *Context) JCS(r operand.Op) { + if inst, err := x86.JCS(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JCS: Jump if below (CF == 1). +// +// Forms: +// +// JCS rel8 +// JCS rel32 +// Construct and append a JCS instruction to the active function. +// Operates on the global context. +func JCS(r operand.Op) { ctx.JCS(r) } + +// JCXZL: Jump if ECX register is 0. +// +// Forms: +// +// JCXZL rel8 +// Construct and append a JCXZL instruction to the active function. +func (c *Context) JCXZL(r operand.Op) { + if inst, err := x86.JCXZL(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JCXZL: Jump if ECX register is 0. +// +// Forms: +// +// JCXZL rel8 +// Construct and append a JCXZL instruction to the active function. +// Operates on the global context. +func JCXZL(r operand.Op) { ctx.JCXZL(r) } + +// JCXZQ: Jump if RCX register is 0. +// +// Forms: +// +// JCXZQ rel8 +// Construct and append a JCXZQ instruction to the active function. +func (c *Context) JCXZQ(r operand.Op) { + if inst, err := x86.JCXZQ(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JCXZQ: Jump if RCX register is 0. +// +// Forms: +// +// JCXZQ rel8 +// Construct and append a JCXZQ instruction to the active function. +// Operates on the global context. +func JCXZQ(r operand.Op) { ctx.JCXZQ(r) } + +// JE: Jump if equal (ZF == 1). +// +// Forms: +// +// JE rel8 +// JE rel32 +// Construct and append a JE instruction to the active function. +func (c *Context) JE(r operand.Op) { + if inst, err := x86.JE(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JE: Jump if equal (ZF == 1). +// +// Forms: +// +// JE rel8 +// JE rel32 +// Construct and append a JE instruction to the active function. +// Operates on the global context. +func JE(r operand.Op) { ctx.JE(r) } + +// JEQ: Jump if equal (ZF == 1). +// +// Forms: +// +// JEQ rel8 +// JEQ rel32 +// Construct and append a JEQ instruction to the active function. +func (c *Context) JEQ(r operand.Op) { + if inst, err := x86.JEQ(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JEQ: Jump if equal (ZF == 1). +// +// Forms: +// +// JEQ rel8 +// JEQ rel32 +// Construct and append a JEQ instruction to the active function. +// Operates on the global context. +func JEQ(r operand.Op) { ctx.JEQ(r) } + +// JG: Jump if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// JG rel8 +// JG rel32 +// Construct and append a JG instruction to the active function. +func (c *Context) JG(r operand.Op) { + if inst, err := x86.JG(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JG: Jump if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// JG rel8 +// JG rel32 +// Construct and append a JG instruction to the active function. +// Operates on the global context. +func JG(r operand.Op) { ctx.JG(r) } + +// JGE: Jump if greater or equal (SF == OF). +// +// Forms: +// +// JGE rel8 +// JGE rel32 +// Construct and append a JGE instruction to the active function. +func (c *Context) JGE(r operand.Op) { + if inst, err := x86.JGE(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JGE: Jump if greater or equal (SF == OF). +// +// Forms: +// +// JGE rel8 +// JGE rel32 +// Construct and append a JGE instruction to the active function. +// Operates on the global context. +func JGE(r operand.Op) { ctx.JGE(r) } + +// JGT: Jump if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// JGT rel8 +// JGT rel32 +// Construct and append a JGT instruction to the active function. +func (c *Context) JGT(r operand.Op) { + if inst, err := x86.JGT(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JGT: Jump if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// JGT rel8 +// JGT rel32 +// Construct and append a JGT instruction to the active function. +// Operates on the global context. +func JGT(r operand.Op) { ctx.JGT(r) } + +// JHI: Jump if above (CF == 0 and ZF == 0). +// +// Forms: +// +// JHI rel8 +// JHI rel32 +// Construct and append a JHI instruction to the active function. +func (c *Context) JHI(r operand.Op) { + if inst, err := x86.JHI(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JHI: Jump if above (CF == 0 and ZF == 0). +// +// Forms: +// +// JHI rel8 +// JHI rel32 +// Construct and append a JHI instruction to the active function. +// Operates on the global context. +func JHI(r operand.Op) { ctx.JHI(r) } + +// JHS: Jump if above or equal (CF == 0). +// +// Forms: +// +// JHS rel8 +// JHS rel32 +// Construct and append a JHS instruction to the active function. +func (c *Context) JHS(r operand.Op) { + if inst, err := x86.JHS(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JHS: Jump if above or equal (CF == 0). +// +// Forms: +// +// JHS rel8 +// JHS rel32 +// Construct and append a JHS instruction to the active function. +// Operates on the global context. +func JHS(r operand.Op) { ctx.JHS(r) } + +// JL: Jump if less (SF != OF). +// +// Forms: +// +// JL rel8 +// JL rel32 +// Construct and append a JL instruction to the active function. +func (c *Context) JL(r operand.Op) { + if inst, err := x86.JL(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JL: Jump if less (SF != OF). +// +// Forms: +// +// JL rel8 +// JL rel32 +// Construct and append a JL instruction to the active function. +// Operates on the global context. +func JL(r operand.Op) { ctx.JL(r) } + +// JLE: Jump if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// JLE rel8 +// JLE rel32 +// Construct and append a JLE instruction to the active function. +func (c *Context) JLE(r operand.Op) { + if inst, err := x86.JLE(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JLE: Jump if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// JLE rel8 +// JLE rel32 +// Construct and append a JLE instruction to the active function. +// Operates on the global context. +func JLE(r operand.Op) { ctx.JLE(r) } + +// JLO: Jump if below (CF == 1). +// +// Forms: +// +// JLO rel8 +// JLO rel32 +// Construct and append a JLO instruction to the active function. +func (c *Context) JLO(r operand.Op) { + if inst, err := x86.JLO(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JLO: Jump if below (CF == 1). +// +// Forms: +// +// JLO rel8 +// JLO rel32 +// Construct and append a JLO instruction to the active function. +// Operates on the global context. +func JLO(r operand.Op) { ctx.JLO(r) } + +// JLS: Jump if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// JLS rel8 +// JLS rel32 +// Construct and append a JLS instruction to the active function. +func (c *Context) JLS(r operand.Op) { + if inst, err := x86.JLS(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JLS: Jump if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// JLS rel8 +// JLS rel32 +// Construct and append a JLS instruction to the active function. +// Operates on the global context. +func JLS(r operand.Op) { ctx.JLS(r) } + +// JLT: Jump if less (SF != OF). +// +// Forms: +// +// JLT rel8 +// JLT rel32 +// Construct and append a JLT instruction to the active function. +func (c *Context) JLT(r operand.Op) { + if inst, err := x86.JLT(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JLT: Jump if less (SF != OF). +// +// Forms: +// +// JLT rel8 +// JLT rel32 +// Construct and append a JLT instruction to the active function. +// Operates on the global context. +func JLT(r operand.Op) { ctx.JLT(r) } + +// JMI: Jump if sign (SF == 1). +// +// Forms: +// +// JMI rel8 +// JMI rel32 +// Construct and append a JMI instruction to the active function. +func (c *Context) JMI(r operand.Op) { + if inst, err := x86.JMI(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JMI: Jump if sign (SF == 1). +// +// Forms: +// +// JMI rel8 +// JMI rel32 +// Construct and append a JMI instruction to the active function. +// Operates on the global context. +func JMI(r operand.Op) { ctx.JMI(r) } + +// JMP: Jump Unconditionally. +// +// Forms: +// +// JMP rel8 +// JMP rel32 +// JMP r64 +// JMP m64 +// Construct and append a JMP instruction to the active function. +func (c *Context) JMP(mr operand.Op) { + if inst, err := x86.JMP(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JMP: Jump Unconditionally. +// +// Forms: +// +// JMP rel8 +// JMP rel32 +// JMP r64 +// JMP m64 +// Construct and append a JMP instruction to the active function. +// Operates on the global context. +func JMP(mr operand.Op) { ctx.JMP(mr) } + +// JNA: Jump if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// JNA rel8 +// JNA rel32 +// Construct and append a JNA instruction to the active function. +func (c *Context) JNA(r operand.Op) { + if inst, err := x86.JNA(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JNA: Jump if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// JNA rel8 +// JNA rel32 +// Construct and append a JNA instruction to the active function. +// Operates on the global context. +func JNA(r operand.Op) { ctx.JNA(r) } + +// JNAE: Jump if below (CF == 1). +// +// Forms: +// +// JNAE rel8 +// JNAE rel32 +// Construct and append a JNAE instruction to the active function. +func (c *Context) JNAE(r operand.Op) { + if inst, err := x86.JNAE(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JNAE: Jump if below (CF == 1). +// +// Forms: +// +// JNAE rel8 +// JNAE rel32 +// Construct and append a JNAE instruction to the active function. +// Operates on the global context. +func JNAE(r operand.Op) { ctx.JNAE(r) } + +// JNB: Jump if above or equal (CF == 0). +// +// Forms: +// +// JNB rel8 +// JNB rel32 +// Construct and append a JNB instruction to the active function. +func (c *Context) JNB(r operand.Op) { + if inst, err := x86.JNB(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JNB: Jump if above or equal (CF == 0). +// +// Forms: +// +// JNB rel8 +// JNB rel32 +// Construct and append a JNB instruction to the active function. +// Operates on the global context. +func JNB(r operand.Op) { ctx.JNB(r) } + +// JNBE: Jump if above (CF == 0 and ZF == 0). +// +// Forms: +// +// JNBE rel8 +// JNBE rel32 +// Construct and append a JNBE instruction to the active function. +func (c *Context) JNBE(r operand.Op) { + if inst, err := x86.JNBE(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JNBE: Jump if above (CF == 0 and ZF == 0). +// +// Forms: +// +// JNBE rel8 +// JNBE rel32 +// Construct and append a JNBE instruction to the active function. +// Operates on the global context. +func JNBE(r operand.Op) { ctx.JNBE(r) } + +// JNC: Jump if above or equal (CF == 0). +// +// Forms: +// +// JNC rel8 +// JNC rel32 +// Construct and append a JNC instruction to the active function. +func (c *Context) JNC(r operand.Op) { + if inst, err := x86.JNC(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JNC: Jump if above or equal (CF == 0). +// +// Forms: +// +// JNC rel8 +// JNC rel32 +// Construct and append a JNC instruction to the active function. +// Operates on the global context. +func JNC(r operand.Op) { ctx.JNC(r) } + +// JNE: Jump if not equal (ZF == 0). +// +// Forms: +// +// JNE rel8 +// JNE rel32 +// Construct and append a JNE instruction to the active function. +func (c *Context) JNE(r operand.Op) { + if inst, err := x86.JNE(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JNE: Jump if not equal (ZF == 0). +// +// Forms: +// +// JNE rel8 +// JNE rel32 +// Construct and append a JNE instruction to the active function. +// Operates on the global context. +func JNE(r operand.Op) { ctx.JNE(r) } + +// JNG: Jump if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// JNG rel8 +// JNG rel32 +// Construct and append a JNG instruction to the active function. +func (c *Context) JNG(r operand.Op) { + if inst, err := x86.JNG(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JNG: Jump if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// JNG rel8 +// JNG rel32 +// Construct and append a JNG instruction to the active function. +// Operates on the global context. +func JNG(r operand.Op) { ctx.JNG(r) } + +// JNGE: Jump if less (SF != OF). +// +// Forms: +// +// JNGE rel8 +// JNGE rel32 +// Construct and append a JNGE instruction to the active function. +func (c *Context) JNGE(r operand.Op) { + if inst, err := x86.JNGE(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JNGE: Jump if less (SF != OF). +// +// Forms: +// +// JNGE rel8 +// JNGE rel32 +// Construct and append a JNGE instruction to the active function. +// Operates on the global context. +func JNGE(r operand.Op) { ctx.JNGE(r) } + +// JNL: Jump if greater or equal (SF == OF). +// +// Forms: +// +// JNL rel8 +// JNL rel32 +// Construct and append a JNL instruction to the active function. +func (c *Context) JNL(r operand.Op) { + if inst, err := x86.JNL(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JNL: Jump if greater or equal (SF == OF). +// +// Forms: +// +// JNL rel8 +// JNL rel32 +// Construct and append a JNL instruction to the active function. +// Operates on the global context. +func JNL(r operand.Op) { ctx.JNL(r) } + +// JNLE: Jump if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// JNLE rel8 +// JNLE rel32 +// Construct and append a JNLE instruction to the active function. +func (c *Context) JNLE(r operand.Op) { + if inst, err := x86.JNLE(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JNLE: Jump if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// JNLE rel8 +// JNLE rel32 +// Construct and append a JNLE instruction to the active function. +// Operates on the global context. +func JNLE(r operand.Op) { ctx.JNLE(r) } + +// JNO: Jump if not overflow (OF == 0). +// +// Forms: +// +// JNO rel8 +// JNO rel32 +// Construct and append a JNO instruction to the active function. +func (c *Context) JNO(r operand.Op) { + if inst, err := x86.JNO(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JNO: Jump if not overflow (OF == 0). +// +// Forms: +// +// JNO rel8 +// JNO rel32 +// Construct and append a JNO instruction to the active function. +// Operates on the global context. +func JNO(r operand.Op) { ctx.JNO(r) } + +// JNP: Jump if not parity (PF == 0). +// +// Forms: +// +// JNP rel8 +// JNP rel32 +// Construct and append a JNP instruction to the active function. +func (c *Context) JNP(r operand.Op) { + if inst, err := x86.JNP(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JNP: Jump if not parity (PF == 0). +// +// Forms: +// +// JNP rel8 +// JNP rel32 +// Construct and append a JNP instruction to the active function. +// Operates on the global context. +func JNP(r operand.Op) { ctx.JNP(r) } + +// JNS: Jump if not sign (SF == 0). +// +// Forms: +// +// JNS rel8 +// JNS rel32 +// Construct and append a JNS instruction to the active function. +func (c *Context) JNS(r operand.Op) { + if inst, err := x86.JNS(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JNS: Jump if not sign (SF == 0). +// +// Forms: +// +// JNS rel8 +// JNS rel32 +// Construct and append a JNS instruction to the active function. +// Operates on the global context. +func JNS(r operand.Op) { ctx.JNS(r) } + +// JNZ: Jump if not equal (ZF == 0). +// +// Forms: +// +// JNZ rel8 +// JNZ rel32 +// Construct and append a JNZ instruction to the active function. +func (c *Context) JNZ(r operand.Op) { + if inst, err := x86.JNZ(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JNZ: Jump if not equal (ZF == 0). +// +// Forms: +// +// JNZ rel8 +// JNZ rel32 +// Construct and append a JNZ instruction to the active function. +// Operates on the global context. +func JNZ(r operand.Op) { ctx.JNZ(r) } + +// JO: Jump if overflow (OF == 1). +// +// Forms: +// +// JO rel8 +// JO rel32 +// Construct and append a JO instruction to the active function. +func (c *Context) JO(r operand.Op) { + if inst, err := x86.JO(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JO: Jump if overflow (OF == 1). +// +// Forms: +// +// JO rel8 +// JO rel32 +// Construct and append a JO instruction to the active function. +// Operates on the global context. +func JO(r operand.Op) { ctx.JO(r) } + +// JOC: Jump if not overflow (OF == 0). +// +// Forms: +// +// JOC rel8 +// JOC rel32 +// Construct and append a JOC instruction to the active function. +func (c *Context) JOC(r operand.Op) { + if inst, err := x86.JOC(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JOC: Jump if not overflow (OF == 0). +// +// Forms: +// +// JOC rel8 +// JOC rel32 +// Construct and append a JOC instruction to the active function. +// Operates on the global context. +func JOC(r operand.Op) { ctx.JOC(r) } + +// JOS: Jump if overflow (OF == 1). +// +// Forms: +// +// JOS rel8 +// JOS rel32 +// Construct and append a JOS instruction to the active function. +func (c *Context) JOS(r operand.Op) { + if inst, err := x86.JOS(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JOS: Jump if overflow (OF == 1). +// +// Forms: +// +// JOS rel8 +// JOS rel32 +// Construct and append a JOS instruction to the active function. +// Operates on the global context. +func JOS(r operand.Op) { ctx.JOS(r) } + +// JP: Jump if parity (PF == 1). +// +// Forms: +// +// JP rel8 +// JP rel32 +// Construct and append a JP instruction to the active function. +func (c *Context) JP(r operand.Op) { + if inst, err := x86.JP(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JP: Jump if parity (PF == 1). +// +// Forms: +// +// JP rel8 +// JP rel32 +// Construct and append a JP instruction to the active function. +// Operates on the global context. +func JP(r operand.Op) { ctx.JP(r) } + +// JPC: Jump if not parity (PF == 0). +// +// Forms: +// +// JPC rel8 +// JPC rel32 +// Construct and append a JPC instruction to the active function. +func (c *Context) JPC(r operand.Op) { + if inst, err := x86.JPC(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JPC: Jump if not parity (PF == 0). +// +// Forms: +// +// JPC rel8 +// JPC rel32 +// Construct and append a JPC instruction to the active function. +// Operates on the global context. +func JPC(r operand.Op) { ctx.JPC(r) } + +// JPE: Jump if parity (PF == 1). +// +// Forms: +// +// JPE rel8 +// JPE rel32 +// Construct and append a JPE instruction to the active function. +func (c *Context) JPE(r operand.Op) { + if inst, err := x86.JPE(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JPE: Jump if parity (PF == 1). +// +// Forms: +// +// JPE rel8 +// JPE rel32 +// Construct and append a JPE instruction to the active function. +// Operates on the global context. +func JPE(r operand.Op) { ctx.JPE(r) } + +// JPL: Jump if not sign (SF == 0). +// +// Forms: +// +// JPL rel8 +// JPL rel32 +// Construct and append a JPL instruction to the active function. +func (c *Context) JPL(r operand.Op) { + if inst, err := x86.JPL(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JPL: Jump if not sign (SF == 0). +// +// Forms: +// +// JPL rel8 +// JPL rel32 +// Construct and append a JPL instruction to the active function. +// Operates on the global context. +func JPL(r operand.Op) { ctx.JPL(r) } + +// JPO: Jump if not parity (PF == 0). +// +// Forms: +// +// JPO rel8 +// JPO rel32 +// Construct and append a JPO instruction to the active function. +func (c *Context) JPO(r operand.Op) { + if inst, err := x86.JPO(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JPO: Jump if not parity (PF == 0). +// +// Forms: +// +// JPO rel8 +// JPO rel32 +// Construct and append a JPO instruction to the active function. +// Operates on the global context. +func JPO(r operand.Op) { ctx.JPO(r) } + +// JPS: Jump if parity (PF == 1). +// +// Forms: +// +// JPS rel8 +// JPS rel32 +// Construct and append a JPS instruction to the active function. +func (c *Context) JPS(r operand.Op) { + if inst, err := x86.JPS(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JPS: Jump if parity (PF == 1). +// +// Forms: +// +// JPS rel8 +// JPS rel32 +// Construct and append a JPS instruction to the active function. +// Operates on the global context. +func JPS(r operand.Op) { ctx.JPS(r) } + +// JS: Jump if sign (SF == 1). +// +// Forms: +// +// JS rel8 +// JS rel32 +// Construct and append a JS instruction to the active function. +func (c *Context) JS(r operand.Op) { + if inst, err := x86.JS(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JS: Jump if sign (SF == 1). +// +// Forms: +// +// JS rel8 +// JS rel32 +// Construct and append a JS instruction to the active function. +// Operates on the global context. +func JS(r operand.Op) { ctx.JS(r) } + +// JZ: Jump if equal (ZF == 1). +// +// Forms: +// +// JZ rel8 +// JZ rel32 +// Construct and append a JZ instruction to the active function. +func (c *Context) JZ(r operand.Op) { + if inst, err := x86.JZ(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// JZ: Jump if equal (ZF == 1). +// +// Forms: +// +// JZ rel8 +// JZ rel32 +// Construct and append a JZ instruction to the active function. +// Operates on the global context. +func JZ(r operand.Op) { ctx.JZ(r) } + +// LDDQU: Load Unaligned Integer 128 Bits. +// +// Forms: +// +// LDDQU m128 xmm +// Construct and append a LDDQU instruction to the active function. +func (c *Context) LDDQU(m, x operand.Op) { + if inst, err := x86.LDDQU(m, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// LDDQU: Load Unaligned Integer 128 Bits. +// +// Forms: +// +// LDDQU m128 xmm +// Construct and append a LDDQU instruction to the active function. +// Operates on the global context. +func LDDQU(m, x operand.Op) { ctx.LDDQU(m, x) } + +// LDMXCSR: Load MXCSR Register. +// +// Forms: +// +// LDMXCSR m32 +// Construct and append a LDMXCSR instruction to the active function. +func (c *Context) LDMXCSR(m operand.Op) { + if inst, err := x86.LDMXCSR(m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// LDMXCSR: Load MXCSR Register. +// +// Forms: +// +// LDMXCSR m32 +// Construct and append a LDMXCSR instruction to the active function. +// Operates on the global context. +func LDMXCSR(m operand.Op) { ctx.LDMXCSR(m) } + +// LEAL: Load Effective Address. +// +// Forms: +// +// LEAL m r32 +// Construct and append a LEAL instruction to the active function. +func (c *Context) LEAL(m, r operand.Op) { + if inst, err := x86.LEAL(m, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// LEAL: Load Effective Address. +// +// Forms: +// +// LEAL m r32 +// Construct and append a LEAL instruction to the active function. +// Operates on the global context. +func LEAL(m, r operand.Op) { ctx.LEAL(m, r) } + +// LEAQ: Load Effective Address. +// +// Forms: +// +// LEAQ m r64 +// Construct and append a LEAQ instruction to the active function. +func (c *Context) LEAQ(m, r operand.Op) { + if inst, err := x86.LEAQ(m, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// LEAQ: Load Effective Address. +// +// Forms: +// +// LEAQ m r64 +// Construct and append a LEAQ instruction to the active function. +// Operates on the global context. +func LEAQ(m, r operand.Op) { ctx.LEAQ(m, r) } + +// LEAW: Load Effective Address. +// +// Forms: +// +// LEAW m r16 +// Construct and append a LEAW instruction to the active function. +func (c *Context) LEAW(m, r operand.Op) { + if inst, err := x86.LEAW(m, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// LEAW: Load Effective Address. +// +// Forms: +// +// LEAW m r16 +// Construct and append a LEAW instruction to the active function. +// Operates on the global context. +func LEAW(m, r operand.Op) { ctx.LEAW(m, r) } + +// LFENCE: Load Fence. +// +// Forms: +// +// LFENCE +// Construct and append a LFENCE instruction to the active function. +func (c *Context) LFENCE() { + if inst, err := x86.LFENCE(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// LFENCE: Load Fence. +// +// Forms: +// +// LFENCE +// Construct and append a LFENCE instruction to the active function. +// Operates on the global context. +func LFENCE() { ctx.LFENCE() } + +// LZCNTL: Count the Number of Leading Zero Bits. +// +// Forms: +// +// LZCNTL r32 r32 +// LZCNTL m32 r32 +// Construct and append a LZCNTL instruction to the active function. +func (c *Context) LZCNTL(mr, r operand.Op) { + if inst, err := x86.LZCNTL(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// LZCNTL: Count the Number of Leading Zero Bits. +// +// Forms: +// +// LZCNTL r32 r32 +// LZCNTL m32 r32 +// Construct and append a LZCNTL instruction to the active function. +// Operates on the global context. +func LZCNTL(mr, r operand.Op) { ctx.LZCNTL(mr, r) } + +// LZCNTQ: Count the Number of Leading Zero Bits. +// +// Forms: +// +// LZCNTQ r64 r64 +// LZCNTQ m64 r64 +// Construct and append a LZCNTQ instruction to the active function. +func (c *Context) LZCNTQ(mr, r operand.Op) { + if inst, err := x86.LZCNTQ(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// LZCNTQ: Count the Number of Leading Zero Bits. +// +// Forms: +// +// LZCNTQ r64 r64 +// LZCNTQ m64 r64 +// Construct and append a LZCNTQ instruction to the active function. +// Operates on the global context. +func LZCNTQ(mr, r operand.Op) { ctx.LZCNTQ(mr, r) } + +// LZCNTW: Count the Number of Leading Zero Bits. +// +// Forms: +// +// LZCNTW r16 r16 +// LZCNTW m16 r16 +// Construct and append a LZCNTW instruction to the active function. +func (c *Context) LZCNTW(mr, r operand.Op) { + if inst, err := x86.LZCNTW(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// LZCNTW: Count the Number of Leading Zero Bits. +// +// Forms: +// +// LZCNTW r16 r16 +// LZCNTW m16 r16 +// Construct and append a LZCNTW instruction to the active function. +// Operates on the global context. +func LZCNTW(mr, r operand.Op) { ctx.LZCNTW(mr, r) } + +// MASKMOVDQU: Store Selected Bytes of Double Quadword. +// +// Forms: +// +// MASKMOVDQU xmm xmm +// Construct and append a MASKMOVDQU instruction to the active function. +func (c *Context) MASKMOVDQU(x, x1 operand.Op) { + if inst, err := x86.MASKMOVDQU(x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MASKMOVDQU: Store Selected Bytes of Double Quadword. +// +// Forms: +// +// MASKMOVDQU xmm xmm +// Construct and append a MASKMOVDQU instruction to the active function. +// Operates on the global context. +func MASKMOVDQU(x, x1 operand.Op) { ctx.MASKMOVDQU(x, x1) } + +// MASKMOVOU: Store Selected Bytes of Double Quadword. +// +// Forms: +// +// MASKMOVOU xmm xmm +// Construct and append a MASKMOVOU instruction to the active function. +func (c *Context) MASKMOVOU(x, x1 operand.Op) { + if inst, err := x86.MASKMOVOU(x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MASKMOVOU: Store Selected Bytes of Double Quadword. +// +// Forms: +// +// MASKMOVOU xmm xmm +// Construct and append a MASKMOVOU instruction to the active function. +// Operates on the global context. +func MASKMOVOU(x, x1 operand.Op) { ctx.MASKMOVOU(x, x1) } + +// MAXPD: Return Maximum Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// MAXPD xmm xmm +// MAXPD m128 xmm +// Construct and append a MAXPD instruction to the active function. +func (c *Context) MAXPD(mx, x operand.Op) { + if inst, err := x86.MAXPD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MAXPD: Return Maximum Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// MAXPD xmm xmm +// MAXPD m128 xmm +// Construct and append a MAXPD instruction to the active function. +// Operates on the global context. +func MAXPD(mx, x operand.Op) { ctx.MAXPD(mx, x) } + +// MAXPS: Return Maximum Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MAXPS xmm xmm +// MAXPS m128 xmm +// Construct and append a MAXPS instruction to the active function. +func (c *Context) MAXPS(mx, x operand.Op) { + if inst, err := x86.MAXPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MAXPS: Return Maximum Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MAXPS xmm xmm +// MAXPS m128 xmm +// Construct and append a MAXPS instruction to the active function. +// Operates on the global context. +func MAXPS(mx, x operand.Op) { ctx.MAXPS(mx, x) } + +// MAXSD: Return Maximum Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// MAXSD xmm xmm +// MAXSD m64 xmm +// Construct and append a MAXSD instruction to the active function. +func (c *Context) MAXSD(mx, x operand.Op) { + if inst, err := x86.MAXSD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MAXSD: Return Maximum Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// MAXSD xmm xmm +// MAXSD m64 xmm +// Construct and append a MAXSD instruction to the active function. +// Operates on the global context. +func MAXSD(mx, x operand.Op) { ctx.MAXSD(mx, x) } + +// MAXSS: Return Maximum Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// MAXSS xmm xmm +// MAXSS m32 xmm +// Construct and append a MAXSS instruction to the active function. +func (c *Context) MAXSS(mx, x operand.Op) { + if inst, err := x86.MAXSS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MAXSS: Return Maximum Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// MAXSS xmm xmm +// MAXSS m32 xmm +// Construct and append a MAXSS instruction to the active function. +// Operates on the global context. +func MAXSS(mx, x operand.Op) { ctx.MAXSS(mx, x) } + +// MFENCE: Memory Fence. +// +// Forms: +// +// MFENCE +// Construct and append a MFENCE instruction to the active function. +func (c *Context) MFENCE() { + if inst, err := x86.MFENCE(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MFENCE: Memory Fence. +// +// Forms: +// +// MFENCE +// Construct and append a MFENCE instruction to the active function. +// Operates on the global context. +func MFENCE() { ctx.MFENCE() } + +// MINPD: Return Minimum Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// MINPD xmm xmm +// MINPD m128 xmm +// Construct and append a MINPD instruction to the active function. +func (c *Context) MINPD(mx, x operand.Op) { + if inst, err := x86.MINPD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MINPD: Return Minimum Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// MINPD xmm xmm +// MINPD m128 xmm +// Construct and append a MINPD instruction to the active function. +// Operates on the global context. +func MINPD(mx, x operand.Op) { ctx.MINPD(mx, x) } + +// MINPS: Return Minimum Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MINPS xmm xmm +// MINPS m128 xmm +// Construct and append a MINPS instruction to the active function. +func (c *Context) MINPS(mx, x operand.Op) { + if inst, err := x86.MINPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MINPS: Return Minimum Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MINPS xmm xmm +// MINPS m128 xmm +// Construct and append a MINPS instruction to the active function. +// Operates on the global context. +func MINPS(mx, x operand.Op) { ctx.MINPS(mx, x) } + +// MINSD: Return Minimum Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// MINSD xmm xmm +// MINSD m64 xmm +// Construct and append a MINSD instruction to the active function. +func (c *Context) MINSD(mx, x operand.Op) { + if inst, err := x86.MINSD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MINSD: Return Minimum Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// MINSD xmm xmm +// MINSD m64 xmm +// Construct and append a MINSD instruction to the active function. +// Operates on the global context. +func MINSD(mx, x operand.Op) { ctx.MINSD(mx, x) } + +// MINSS: Return Minimum Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// MINSS xmm xmm +// MINSS m32 xmm +// Construct and append a MINSS instruction to the active function. +func (c *Context) MINSS(mx, x operand.Op) { + if inst, err := x86.MINSS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MINSS: Return Minimum Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// MINSS xmm xmm +// MINSS m32 xmm +// Construct and append a MINSS instruction to the active function. +// Operates on the global context. +func MINSS(mx, x operand.Op) { ctx.MINSS(mx, x) } + +// MONITOR: Monitor a Linear Address Range. +// +// Forms: +// +// MONITOR +// Construct and append a MONITOR instruction to the active function. +func (c *Context) MONITOR() { + if inst, err := x86.MONITOR(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MONITOR: Monitor a Linear Address Range. +// +// Forms: +// +// MONITOR +// Construct and append a MONITOR instruction to the active function. +// Operates on the global context. +func MONITOR() { ctx.MONITOR() } + +// MOVAPD: Move Aligned Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// MOVAPD xmm xmm +// MOVAPD m128 xmm +// MOVAPD xmm m128 +// Construct and append a MOVAPD instruction to the active function. +func (c *Context) MOVAPD(mx, mx1 operand.Op) { + if inst, err := x86.MOVAPD(mx, mx1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVAPD: Move Aligned Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// MOVAPD xmm xmm +// MOVAPD m128 xmm +// MOVAPD xmm m128 +// Construct and append a MOVAPD instruction to the active function. +// Operates on the global context. +func MOVAPD(mx, mx1 operand.Op) { ctx.MOVAPD(mx, mx1) } + +// MOVAPS: Move Aligned Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MOVAPS xmm xmm +// MOVAPS m128 xmm +// MOVAPS xmm m128 +// Construct and append a MOVAPS instruction to the active function. +func (c *Context) MOVAPS(mx, mx1 operand.Op) { + if inst, err := x86.MOVAPS(mx, mx1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVAPS: Move Aligned Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MOVAPS xmm xmm +// MOVAPS m128 xmm +// MOVAPS xmm m128 +// Construct and append a MOVAPS instruction to the active function. +// Operates on the global context. +func MOVAPS(mx, mx1 operand.Op) { ctx.MOVAPS(mx, mx1) } + +// MOVB: Move. +// +// Forms: +// +// MOVB imm8 r8 +// MOVB r8 r8 +// MOVB m8 r8 +// MOVB imm8 m8 +// MOVB r8 m8 +// Construct and append a MOVB instruction to the active function. +func (c *Context) MOVB(imr, mr operand.Op) { + if inst, err := x86.MOVB(imr, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVB: Move. +// +// Forms: +// +// MOVB imm8 r8 +// MOVB r8 r8 +// MOVB m8 r8 +// MOVB imm8 m8 +// MOVB r8 m8 +// Construct and append a MOVB instruction to the active function. +// Operates on the global context. +func MOVB(imr, mr operand.Op) { ctx.MOVB(imr, mr) } + +// MOVBELL: Move Data After Swapping Bytes. +// +// Forms: +// +// MOVBELL m32 r32 +// MOVBELL r32 m32 +// Construct and append a MOVBELL instruction to the active function. +func (c *Context) MOVBELL(mr, mr1 operand.Op) { + if inst, err := x86.MOVBELL(mr, mr1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVBELL: Move Data After Swapping Bytes. +// +// Forms: +// +// MOVBELL m32 r32 +// MOVBELL r32 m32 +// Construct and append a MOVBELL instruction to the active function. +// Operates on the global context. +func MOVBELL(mr, mr1 operand.Op) { ctx.MOVBELL(mr, mr1) } + +// MOVBEQQ: Move Data After Swapping Bytes. +// +// Forms: +// +// MOVBEQQ m64 r64 +// MOVBEQQ r64 m64 +// Construct and append a MOVBEQQ instruction to the active function. +func (c *Context) MOVBEQQ(mr, mr1 operand.Op) { + if inst, err := x86.MOVBEQQ(mr, mr1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVBEQQ: Move Data After Swapping Bytes. +// +// Forms: +// +// MOVBEQQ m64 r64 +// MOVBEQQ r64 m64 +// Construct and append a MOVBEQQ instruction to the active function. +// Operates on the global context. +func MOVBEQQ(mr, mr1 operand.Op) { ctx.MOVBEQQ(mr, mr1) } + +// MOVBEWW: Move Data After Swapping Bytes. +// +// Forms: +// +// MOVBEWW m16 r16 +// MOVBEWW r16 m16 +// Construct and append a MOVBEWW instruction to the active function. +func (c *Context) MOVBEWW(mr, mr1 operand.Op) { + if inst, err := x86.MOVBEWW(mr, mr1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVBEWW: Move Data After Swapping Bytes. +// +// Forms: +// +// MOVBEWW m16 r16 +// MOVBEWW r16 m16 +// Construct and append a MOVBEWW instruction to the active function. +// Operates on the global context. +func MOVBEWW(mr, mr1 operand.Op) { ctx.MOVBEWW(mr, mr1) } + +// MOVBLSX: Move with Sign-Extension. +// +// Forms: +// +// MOVBLSX r8 r32 +// MOVBLSX m8 r32 +// Construct and append a MOVBLSX instruction to the active function. +func (c *Context) MOVBLSX(mr, r operand.Op) { + if inst, err := x86.MOVBLSX(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVBLSX: Move with Sign-Extension. +// +// Forms: +// +// MOVBLSX r8 r32 +// MOVBLSX m8 r32 +// Construct and append a MOVBLSX instruction to the active function. +// Operates on the global context. +func MOVBLSX(mr, r operand.Op) { ctx.MOVBLSX(mr, r) } + +// MOVBLZX: Move with Zero-Extend. +// +// Forms: +// +// MOVBLZX r8 r32 +// MOVBLZX m8 r32 +// Construct and append a MOVBLZX instruction to the active function. +func (c *Context) MOVBLZX(mr, r operand.Op) { + if inst, err := x86.MOVBLZX(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVBLZX: Move with Zero-Extend. +// +// Forms: +// +// MOVBLZX r8 r32 +// MOVBLZX m8 r32 +// Construct and append a MOVBLZX instruction to the active function. +// Operates on the global context. +func MOVBLZX(mr, r operand.Op) { ctx.MOVBLZX(mr, r) } + +// MOVBQSX: Move with Sign-Extension. +// +// Forms: +// +// MOVBQSX r8 r64 +// MOVBQSX m8 r64 +// Construct and append a MOVBQSX instruction to the active function. +func (c *Context) MOVBQSX(mr, r operand.Op) { + if inst, err := x86.MOVBQSX(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVBQSX: Move with Sign-Extension. +// +// Forms: +// +// MOVBQSX r8 r64 +// MOVBQSX m8 r64 +// Construct and append a MOVBQSX instruction to the active function. +// Operates on the global context. +func MOVBQSX(mr, r operand.Op) { ctx.MOVBQSX(mr, r) } + +// MOVBQZX: Move with Zero-Extend. +// +// Forms: +// +// MOVBQZX r8 r64 +// MOVBQZX m8 r64 +// Construct and append a MOVBQZX instruction to the active function. +func (c *Context) MOVBQZX(mr, r operand.Op) { + if inst, err := x86.MOVBQZX(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVBQZX: Move with Zero-Extend. +// +// Forms: +// +// MOVBQZX r8 r64 +// MOVBQZX m8 r64 +// Construct and append a MOVBQZX instruction to the active function. +// Operates on the global context. +func MOVBQZX(mr, r operand.Op) { ctx.MOVBQZX(mr, r) } + +// MOVBWSX: Move with Sign-Extension. +// +// Forms: +// +// MOVBWSX r8 r16 +// MOVBWSX m8 r16 +// Construct and append a MOVBWSX instruction to the active function. +func (c *Context) MOVBWSX(mr, r operand.Op) { + if inst, err := x86.MOVBWSX(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVBWSX: Move with Sign-Extension. +// +// Forms: +// +// MOVBWSX r8 r16 +// MOVBWSX m8 r16 +// Construct and append a MOVBWSX instruction to the active function. +// Operates on the global context. +func MOVBWSX(mr, r operand.Op) { ctx.MOVBWSX(mr, r) } + +// MOVBWZX: Move with Zero-Extend. +// +// Forms: +// +// MOVBWZX r8 r16 +// MOVBWZX m8 r16 +// Construct and append a MOVBWZX instruction to the active function. +func (c *Context) MOVBWZX(mr, r operand.Op) { + if inst, err := x86.MOVBWZX(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVBWZX: Move with Zero-Extend. +// +// Forms: +// +// MOVBWZX r8 r16 +// MOVBWZX m8 r16 +// Construct and append a MOVBWZX instruction to the active function. +// Operates on the global context. +func MOVBWZX(mr, r operand.Op) { ctx.MOVBWZX(mr, r) } + +// MOVD: Move. +// +// Forms: +// +// MOVD imm32 r64 +// MOVD imm64 r64 +// MOVD r64 r64 +// MOVD m64 r64 +// MOVD imm32 m64 +// MOVD r64 m64 +// MOVD xmm r64 +// MOVD r64 xmm +// MOVD xmm xmm +// MOVD m64 xmm +// MOVD xmm m64 +// MOVD xmm r32 +// MOVD r32 xmm +// MOVD m32 xmm +// MOVD xmm m32 +// Construct and append a MOVD instruction to the active function. +func (c *Context) MOVD(imrx, mrx operand.Op) { + if inst, err := x86.MOVD(imrx, mrx); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVD: Move. +// +// Forms: +// +// MOVD imm32 r64 +// MOVD imm64 r64 +// MOVD r64 r64 +// MOVD m64 r64 +// MOVD imm32 m64 +// MOVD r64 m64 +// MOVD xmm r64 +// MOVD r64 xmm +// MOVD xmm xmm +// MOVD m64 xmm +// MOVD xmm m64 +// MOVD xmm r32 +// MOVD r32 xmm +// MOVD m32 xmm +// MOVD xmm m32 +// Construct and append a MOVD instruction to the active function. +// Operates on the global context. +func MOVD(imrx, mrx operand.Op) { ctx.MOVD(imrx, mrx) } + +// MOVDDUP: Move One Double-FP and Duplicate. +// +// Forms: +// +// MOVDDUP xmm xmm +// MOVDDUP m64 xmm +// Construct and append a MOVDDUP instruction to the active function. +func (c *Context) MOVDDUP(mx, x operand.Op) { + if inst, err := x86.MOVDDUP(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVDDUP: Move One Double-FP and Duplicate. +// +// Forms: +// +// MOVDDUP xmm xmm +// MOVDDUP m64 xmm +// Construct and append a MOVDDUP instruction to the active function. +// Operates on the global context. +func MOVDDUP(mx, x operand.Op) { ctx.MOVDDUP(mx, x) } + +// MOVDQ2Q: Move. +// +// Forms: +// +// MOVDQ2Q imm32 r64 +// MOVDQ2Q imm64 r64 +// MOVDQ2Q r64 r64 +// MOVDQ2Q m64 r64 +// MOVDQ2Q imm32 m64 +// MOVDQ2Q r64 m64 +// MOVDQ2Q xmm r64 +// MOVDQ2Q r64 xmm +// MOVDQ2Q xmm xmm +// MOVDQ2Q m64 xmm +// MOVDQ2Q xmm m64 +// MOVDQ2Q xmm r32 +// MOVDQ2Q r32 xmm +// MOVDQ2Q m32 xmm +// MOVDQ2Q xmm m32 +// Construct and append a MOVDQ2Q instruction to the active function. +func (c *Context) MOVDQ2Q(imrx, mrx operand.Op) { + if inst, err := x86.MOVDQ2Q(imrx, mrx); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVDQ2Q: Move. +// +// Forms: +// +// MOVDQ2Q imm32 r64 +// MOVDQ2Q imm64 r64 +// MOVDQ2Q r64 r64 +// MOVDQ2Q m64 r64 +// MOVDQ2Q imm32 m64 +// MOVDQ2Q r64 m64 +// MOVDQ2Q xmm r64 +// MOVDQ2Q r64 xmm +// MOVDQ2Q xmm xmm +// MOVDQ2Q m64 xmm +// MOVDQ2Q xmm m64 +// MOVDQ2Q xmm r32 +// MOVDQ2Q r32 xmm +// MOVDQ2Q m32 xmm +// MOVDQ2Q xmm m32 +// Construct and append a MOVDQ2Q instruction to the active function. +// Operates on the global context. +func MOVDQ2Q(imrx, mrx operand.Op) { ctx.MOVDQ2Q(imrx, mrx) } + +// MOVHLPS: Move Packed Single-Precision Floating-Point Values High to Low. +// +// Forms: +// +// MOVHLPS xmm xmm +// Construct and append a MOVHLPS instruction to the active function. +func (c *Context) MOVHLPS(x, x1 operand.Op) { + if inst, err := x86.MOVHLPS(x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVHLPS: Move Packed Single-Precision Floating-Point Values High to Low. +// +// Forms: +// +// MOVHLPS xmm xmm +// Construct and append a MOVHLPS instruction to the active function. +// Operates on the global context. +func MOVHLPS(x, x1 operand.Op) { ctx.MOVHLPS(x, x1) } + +// MOVHPD: Move High Packed Double-Precision Floating-Point Value. +// +// Forms: +// +// MOVHPD m64 xmm +// MOVHPD xmm m64 +// Construct and append a MOVHPD instruction to the active function. +func (c *Context) MOVHPD(mx, mx1 operand.Op) { + if inst, err := x86.MOVHPD(mx, mx1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVHPD: Move High Packed Double-Precision Floating-Point Value. +// +// Forms: +// +// MOVHPD m64 xmm +// MOVHPD xmm m64 +// Construct and append a MOVHPD instruction to the active function. +// Operates on the global context. +func MOVHPD(mx, mx1 operand.Op) { ctx.MOVHPD(mx, mx1) } + +// MOVHPS: Move High Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MOVHPS m64 xmm +// MOVHPS xmm m64 +// Construct and append a MOVHPS instruction to the active function. +func (c *Context) MOVHPS(mx, mx1 operand.Op) { + if inst, err := x86.MOVHPS(mx, mx1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVHPS: Move High Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MOVHPS m64 xmm +// MOVHPS xmm m64 +// Construct and append a MOVHPS instruction to the active function. +// Operates on the global context. +func MOVHPS(mx, mx1 operand.Op) { ctx.MOVHPS(mx, mx1) } + +// MOVL: Move. +// +// Forms: +// +// MOVL imm32 r32 +// MOVL r32 r32 +// MOVL m32 r32 +// MOVL imm32 m32 +// MOVL r32 m32 +// Construct and append a MOVL instruction to the active function. +func (c *Context) MOVL(imr, mr operand.Op) { + if inst, err := x86.MOVL(imr, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVL: Move. +// +// Forms: +// +// MOVL imm32 r32 +// MOVL r32 r32 +// MOVL m32 r32 +// MOVL imm32 m32 +// MOVL r32 m32 +// Construct and append a MOVL instruction to the active function. +// Operates on the global context. +func MOVL(imr, mr operand.Op) { ctx.MOVL(imr, mr) } + +// MOVLHPS: Move Packed Single-Precision Floating-Point Values Low to High. +// +// Forms: +// +// MOVLHPS xmm xmm +// Construct and append a MOVLHPS instruction to the active function. +func (c *Context) MOVLHPS(x, x1 operand.Op) { + if inst, err := x86.MOVLHPS(x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVLHPS: Move Packed Single-Precision Floating-Point Values Low to High. +// +// Forms: +// +// MOVLHPS xmm xmm +// Construct and append a MOVLHPS instruction to the active function. +// Operates on the global context. +func MOVLHPS(x, x1 operand.Op) { ctx.MOVLHPS(x, x1) } + +// MOVLPD: Move Low Packed Double-Precision Floating-Point Value. +// +// Forms: +// +// MOVLPD m64 xmm +// MOVLPD xmm m64 +// Construct and append a MOVLPD instruction to the active function. +func (c *Context) MOVLPD(mx, mx1 operand.Op) { + if inst, err := x86.MOVLPD(mx, mx1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVLPD: Move Low Packed Double-Precision Floating-Point Value. +// +// Forms: +// +// MOVLPD m64 xmm +// MOVLPD xmm m64 +// Construct and append a MOVLPD instruction to the active function. +// Operates on the global context. +func MOVLPD(mx, mx1 operand.Op) { ctx.MOVLPD(mx, mx1) } + +// MOVLPS: Move Low Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MOVLPS m64 xmm +// MOVLPS xmm m64 +// Construct and append a MOVLPS instruction to the active function. +func (c *Context) MOVLPS(mx, mx1 operand.Op) { + if inst, err := x86.MOVLPS(mx, mx1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVLPS: Move Low Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MOVLPS m64 xmm +// MOVLPS xmm m64 +// Construct and append a MOVLPS instruction to the active function. +// Operates on the global context. +func MOVLPS(mx, mx1 operand.Op) { ctx.MOVLPS(mx, mx1) } + +// MOVLQSX: Move Doubleword to Quadword with Sign-Extension. +// +// Forms: +// +// MOVLQSX r32 r64 +// MOVLQSX m32 r64 +// Construct and append a MOVLQSX instruction to the active function. +func (c *Context) MOVLQSX(mr, r operand.Op) { + if inst, err := x86.MOVLQSX(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVLQSX: Move Doubleword to Quadword with Sign-Extension. +// +// Forms: +// +// MOVLQSX r32 r64 +// MOVLQSX m32 r64 +// Construct and append a MOVLQSX instruction to the active function. +// Operates on the global context. +func MOVLQSX(mr, r operand.Op) { ctx.MOVLQSX(mr, r) } + +// MOVLQZX: Move with Zero-Extend. +// +// Forms: +// +// MOVLQZX m32 r64 +// Construct and append a MOVLQZX instruction to the active function. +func (c *Context) MOVLQZX(m, r operand.Op) { + if inst, err := x86.MOVLQZX(m, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVLQZX: Move with Zero-Extend. +// +// Forms: +// +// MOVLQZX m32 r64 +// Construct and append a MOVLQZX instruction to the active function. +// Operates on the global context. +func MOVLQZX(m, r operand.Op) { ctx.MOVLQZX(m, r) } + +// MOVMSKPD: Extract Packed Double-Precision Floating-Point Sign Mask. +// +// Forms: +// +// MOVMSKPD xmm r32 +// Construct and append a MOVMSKPD instruction to the active function. +func (c *Context) MOVMSKPD(x, r operand.Op) { + if inst, err := x86.MOVMSKPD(x, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVMSKPD: Extract Packed Double-Precision Floating-Point Sign Mask. +// +// Forms: +// +// MOVMSKPD xmm r32 +// Construct and append a MOVMSKPD instruction to the active function. +// Operates on the global context. +func MOVMSKPD(x, r operand.Op) { ctx.MOVMSKPD(x, r) } + +// MOVMSKPS: Extract Packed Single-Precision Floating-Point Sign Mask. +// +// Forms: +// +// MOVMSKPS xmm r32 +// Construct and append a MOVMSKPS instruction to the active function. +func (c *Context) MOVMSKPS(x, r operand.Op) { + if inst, err := x86.MOVMSKPS(x, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVMSKPS: Extract Packed Single-Precision Floating-Point Sign Mask. +// +// Forms: +// +// MOVMSKPS xmm r32 +// Construct and append a MOVMSKPS instruction to the active function. +// Operates on the global context. +func MOVMSKPS(x, r operand.Op) { ctx.MOVMSKPS(x, r) } + +// MOVNTDQ: Store Double Quadword Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTDQ xmm m128 +// Construct and append a MOVNTDQ instruction to the active function. +func (c *Context) MOVNTDQ(x, m operand.Op) { + if inst, err := x86.MOVNTDQ(x, m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVNTDQ: Store Double Quadword Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTDQ xmm m128 +// Construct and append a MOVNTDQ instruction to the active function. +// Operates on the global context. +func MOVNTDQ(x, m operand.Op) { ctx.MOVNTDQ(x, m) } + +// MOVNTDQA: Load Double Quadword Non-Temporal Aligned Hint. +// +// Forms: +// +// MOVNTDQA m128 xmm +// Construct and append a MOVNTDQA instruction to the active function. +func (c *Context) MOVNTDQA(m, x operand.Op) { + if inst, err := x86.MOVNTDQA(m, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVNTDQA: Load Double Quadword Non-Temporal Aligned Hint. +// +// Forms: +// +// MOVNTDQA m128 xmm +// Construct and append a MOVNTDQA instruction to the active function. +// Operates on the global context. +func MOVNTDQA(m, x operand.Op) { ctx.MOVNTDQA(m, x) } + +// MOVNTIL: Store Doubleword Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTIL r32 m32 +// Construct and append a MOVNTIL instruction to the active function. +func (c *Context) MOVNTIL(r, m operand.Op) { + if inst, err := x86.MOVNTIL(r, m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVNTIL: Store Doubleword Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTIL r32 m32 +// Construct and append a MOVNTIL instruction to the active function. +// Operates on the global context. +func MOVNTIL(r, m operand.Op) { ctx.MOVNTIL(r, m) } + +// MOVNTIQ: Store Doubleword Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTIQ r64 m64 +// Construct and append a MOVNTIQ instruction to the active function. +func (c *Context) MOVNTIQ(r, m operand.Op) { + if inst, err := x86.MOVNTIQ(r, m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVNTIQ: Store Doubleword Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTIQ r64 m64 +// Construct and append a MOVNTIQ instruction to the active function. +// Operates on the global context. +func MOVNTIQ(r, m operand.Op) { ctx.MOVNTIQ(r, m) } + +// MOVNTO: Store Double Quadword Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTO xmm m128 +// Construct and append a MOVNTO instruction to the active function. +func (c *Context) MOVNTO(x, m operand.Op) { + if inst, err := x86.MOVNTO(x, m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVNTO: Store Double Quadword Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTO xmm m128 +// Construct and append a MOVNTO instruction to the active function. +// Operates on the global context. +func MOVNTO(x, m operand.Op) { ctx.MOVNTO(x, m) } + +// MOVNTPD: Store Packed Double-Precision Floating-Point Values Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTPD xmm m128 +// Construct and append a MOVNTPD instruction to the active function. +func (c *Context) MOVNTPD(x, m operand.Op) { + if inst, err := x86.MOVNTPD(x, m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVNTPD: Store Packed Double-Precision Floating-Point Values Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTPD xmm m128 +// Construct and append a MOVNTPD instruction to the active function. +// Operates on the global context. +func MOVNTPD(x, m operand.Op) { ctx.MOVNTPD(x, m) } + +// MOVNTPS: Store Packed Single-Precision Floating-Point Values Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTPS xmm m128 +// Construct and append a MOVNTPS instruction to the active function. +func (c *Context) MOVNTPS(x, m operand.Op) { + if inst, err := x86.MOVNTPS(x, m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVNTPS: Store Packed Single-Precision Floating-Point Values Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTPS xmm m128 +// Construct and append a MOVNTPS instruction to the active function. +// Operates on the global context. +func MOVNTPS(x, m operand.Op) { ctx.MOVNTPS(x, m) } + +// MOVO: Move Aligned Double Quadword. +// +// Forms: +// +// MOVO xmm xmm +// MOVO m128 xmm +// MOVO xmm m128 +// Construct and append a MOVO instruction to the active function. +func (c *Context) MOVO(mx, mx1 operand.Op) { + if inst, err := x86.MOVO(mx, mx1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVO: Move Aligned Double Quadword. +// +// Forms: +// +// MOVO xmm xmm +// MOVO m128 xmm +// MOVO xmm m128 +// Construct and append a MOVO instruction to the active function. +// Operates on the global context. +func MOVO(mx, mx1 operand.Op) { ctx.MOVO(mx, mx1) } + +// MOVOA: Move Aligned Double Quadword. +// +// Forms: +// +// MOVOA xmm xmm +// MOVOA m128 xmm +// MOVOA xmm m128 +// Construct and append a MOVOA instruction to the active function. +func (c *Context) MOVOA(mx, mx1 operand.Op) { + if inst, err := x86.MOVOA(mx, mx1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVOA: Move Aligned Double Quadword. +// +// Forms: +// +// MOVOA xmm xmm +// MOVOA m128 xmm +// MOVOA xmm m128 +// Construct and append a MOVOA instruction to the active function. +// Operates on the global context. +func MOVOA(mx, mx1 operand.Op) { ctx.MOVOA(mx, mx1) } + +// MOVOU: Move Unaligned Double Quadword. +// +// Forms: +// +// MOVOU xmm xmm +// MOVOU m128 xmm +// MOVOU xmm m128 +// Construct and append a MOVOU instruction to the active function. +func (c *Context) MOVOU(mx, mx1 operand.Op) { + if inst, err := x86.MOVOU(mx, mx1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVOU: Move Unaligned Double Quadword. +// +// Forms: +// +// MOVOU xmm xmm +// MOVOU m128 xmm +// MOVOU xmm m128 +// Construct and append a MOVOU instruction to the active function. +// Operates on the global context. +func MOVOU(mx, mx1 operand.Op) { ctx.MOVOU(mx, mx1) } + +// MOVQ: Move. +// +// Forms: +// +// MOVQ imm32 r64 +// MOVQ imm64 r64 +// MOVQ r64 r64 +// MOVQ m64 r64 +// MOVQ imm32 m64 +// MOVQ r64 m64 +// MOVQ xmm r64 +// MOVQ r64 xmm +// MOVQ xmm xmm +// MOVQ m64 xmm +// MOVQ xmm m64 +// MOVQ xmm r32 +// MOVQ r32 xmm +// MOVQ m32 xmm +// MOVQ xmm m32 +// Construct and append a MOVQ instruction to the active function. +func (c *Context) MOVQ(imrx, mrx operand.Op) { + if inst, err := x86.MOVQ(imrx, mrx); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVQ: Move. +// +// Forms: +// +// MOVQ imm32 r64 +// MOVQ imm64 r64 +// MOVQ r64 r64 +// MOVQ m64 r64 +// MOVQ imm32 m64 +// MOVQ r64 m64 +// MOVQ xmm r64 +// MOVQ r64 xmm +// MOVQ xmm xmm +// MOVQ m64 xmm +// MOVQ xmm m64 +// MOVQ xmm r32 +// MOVQ r32 xmm +// MOVQ m32 xmm +// MOVQ xmm m32 +// Construct and append a MOVQ instruction to the active function. +// Operates on the global context. +func MOVQ(imrx, mrx operand.Op) { ctx.MOVQ(imrx, mrx) } + +// MOVSD: Move Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// MOVSD xmm xmm +// MOVSD m64 xmm +// MOVSD xmm m64 +// Construct and append a MOVSD instruction to the active function. +func (c *Context) MOVSD(mx, mx1 operand.Op) { + if inst, err := x86.MOVSD(mx, mx1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVSD: Move Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// MOVSD xmm xmm +// MOVSD m64 xmm +// MOVSD xmm m64 +// Construct and append a MOVSD instruction to the active function. +// Operates on the global context. +func MOVSD(mx, mx1 operand.Op) { ctx.MOVSD(mx, mx1) } + +// MOVSHDUP: Move Packed Single-FP High and Duplicate. +// +// Forms: +// +// MOVSHDUP xmm xmm +// MOVSHDUP m128 xmm +// Construct and append a MOVSHDUP instruction to the active function. +func (c *Context) MOVSHDUP(mx, x operand.Op) { + if inst, err := x86.MOVSHDUP(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVSHDUP: Move Packed Single-FP High and Duplicate. +// +// Forms: +// +// MOVSHDUP xmm xmm +// MOVSHDUP m128 xmm +// Construct and append a MOVSHDUP instruction to the active function. +// Operates on the global context. +func MOVSHDUP(mx, x operand.Op) { ctx.MOVSHDUP(mx, x) } + +// MOVSLDUP: Move Packed Single-FP Low and Duplicate. +// +// Forms: +// +// MOVSLDUP xmm xmm +// MOVSLDUP m128 xmm +// Construct and append a MOVSLDUP instruction to the active function. +func (c *Context) MOVSLDUP(mx, x operand.Op) { + if inst, err := x86.MOVSLDUP(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVSLDUP: Move Packed Single-FP Low and Duplicate. +// +// Forms: +// +// MOVSLDUP xmm xmm +// MOVSLDUP m128 xmm +// Construct and append a MOVSLDUP instruction to the active function. +// Operates on the global context. +func MOVSLDUP(mx, x operand.Op) { ctx.MOVSLDUP(mx, x) } + +// MOVSS: Move Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// MOVSS xmm xmm +// MOVSS m32 xmm +// MOVSS xmm m32 +// Construct and append a MOVSS instruction to the active function. +func (c *Context) MOVSS(mx, mx1 operand.Op) { + if inst, err := x86.MOVSS(mx, mx1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVSS: Move Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// MOVSS xmm xmm +// MOVSS m32 xmm +// MOVSS xmm m32 +// Construct and append a MOVSS instruction to the active function. +// Operates on the global context. +func MOVSS(mx, mx1 operand.Op) { ctx.MOVSS(mx, mx1) } + +// MOVUPD: Move Unaligned Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// MOVUPD xmm xmm +// MOVUPD m128 xmm +// MOVUPD xmm m128 +// Construct and append a MOVUPD instruction to the active function. +func (c *Context) MOVUPD(mx, mx1 operand.Op) { + if inst, err := x86.MOVUPD(mx, mx1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVUPD: Move Unaligned Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// MOVUPD xmm xmm +// MOVUPD m128 xmm +// MOVUPD xmm m128 +// Construct and append a MOVUPD instruction to the active function. +// Operates on the global context. +func MOVUPD(mx, mx1 operand.Op) { ctx.MOVUPD(mx, mx1) } + +// MOVUPS: Move Unaligned Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MOVUPS xmm xmm +// MOVUPS m128 xmm +// MOVUPS xmm m128 +// Construct and append a MOVUPS instruction to the active function. +func (c *Context) MOVUPS(mx, mx1 operand.Op) { + if inst, err := x86.MOVUPS(mx, mx1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVUPS: Move Unaligned Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MOVUPS xmm xmm +// MOVUPS m128 xmm +// MOVUPS xmm m128 +// Construct and append a MOVUPS instruction to the active function. +// Operates on the global context. +func MOVUPS(mx, mx1 operand.Op) { ctx.MOVUPS(mx, mx1) } + +// MOVW: Move. +// +// Forms: +// +// MOVW imm16 r16 +// MOVW r16 r16 +// MOVW m16 r16 +// MOVW imm16 m16 +// MOVW r16 m16 +// Construct and append a MOVW instruction to the active function. +func (c *Context) MOVW(imr, mr operand.Op) { + if inst, err := x86.MOVW(imr, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVW: Move. +// +// Forms: +// +// MOVW imm16 r16 +// MOVW r16 r16 +// MOVW m16 r16 +// MOVW imm16 m16 +// MOVW r16 m16 +// Construct and append a MOVW instruction to the active function. +// Operates on the global context. +func MOVW(imr, mr operand.Op) { ctx.MOVW(imr, mr) } + +// MOVWLSX: Move with Sign-Extension. +// +// Forms: +// +// MOVWLSX r16 r32 +// MOVWLSX m16 r32 +// Construct and append a MOVWLSX instruction to the active function. +func (c *Context) MOVWLSX(mr, r operand.Op) { + if inst, err := x86.MOVWLSX(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVWLSX: Move with Sign-Extension. +// +// Forms: +// +// MOVWLSX r16 r32 +// MOVWLSX m16 r32 +// Construct and append a MOVWLSX instruction to the active function. +// Operates on the global context. +func MOVWLSX(mr, r operand.Op) { ctx.MOVWLSX(mr, r) } + +// MOVWLZX: Move with Zero-Extend. +// +// Forms: +// +// MOVWLZX r16 r32 +// MOVWLZX m16 r32 +// Construct and append a MOVWLZX instruction to the active function. +func (c *Context) MOVWLZX(mr, r operand.Op) { + if inst, err := x86.MOVWLZX(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVWLZX: Move with Zero-Extend. +// +// Forms: +// +// MOVWLZX r16 r32 +// MOVWLZX m16 r32 +// Construct and append a MOVWLZX instruction to the active function. +// Operates on the global context. +func MOVWLZX(mr, r operand.Op) { ctx.MOVWLZX(mr, r) } + +// MOVWQSX: Move with Sign-Extension. +// +// Forms: +// +// MOVWQSX r16 r64 +// MOVWQSX m16 r64 +// Construct and append a MOVWQSX instruction to the active function. +func (c *Context) MOVWQSX(mr, r operand.Op) { + if inst, err := x86.MOVWQSX(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVWQSX: Move with Sign-Extension. +// +// Forms: +// +// MOVWQSX r16 r64 +// MOVWQSX m16 r64 +// Construct and append a MOVWQSX instruction to the active function. +// Operates on the global context. +func MOVWQSX(mr, r operand.Op) { ctx.MOVWQSX(mr, r) } + +// MOVWQZX: Move with Zero-Extend. +// +// Forms: +// +// MOVWQZX r16 r64 +// MOVWQZX m16 r64 +// Construct and append a MOVWQZX instruction to the active function. +func (c *Context) MOVWQZX(mr, r operand.Op) { + if inst, err := x86.MOVWQZX(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MOVWQZX: Move with Zero-Extend. +// +// Forms: +// +// MOVWQZX r16 r64 +// MOVWQZX m16 r64 +// Construct and append a MOVWQZX instruction to the active function. +// Operates on the global context. +func MOVWQZX(mr, r operand.Op) { ctx.MOVWQZX(mr, r) } + +// MPSADBW: Compute Multiple Packed Sums of Absolute Difference. +// +// Forms: +// +// MPSADBW imm8 xmm xmm +// MPSADBW imm8 m128 xmm +// Construct and append a MPSADBW instruction to the active function. +func (c *Context) MPSADBW(i, mx, x operand.Op) { + if inst, err := x86.MPSADBW(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MPSADBW: Compute Multiple Packed Sums of Absolute Difference. +// +// Forms: +// +// MPSADBW imm8 xmm xmm +// MPSADBW imm8 m128 xmm +// Construct and append a MPSADBW instruction to the active function. +// Operates on the global context. +func MPSADBW(i, mx, x operand.Op) { ctx.MPSADBW(i, mx, x) } + +// MULB: Unsigned Multiply. +// +// Forms: +// +// MULB r8 +// MULB m8 +// Construct and append a MULB instruction to the active function. +func (c *Context) MULB(mr operand.Op) { + if inst, err := x86.MULB(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MULB: Unsigned Multiply. +// +// Forms: +// +// MULB r8 +// MULB m8 +// Construct and append a MULB instruction to the active function. +// Operates on the global context. +func MULB(mr operand.Op) { ctx.MULB(mr) } + +// MULL: Unsigned Multiply. +// +// Forms: +// +// MULL r32 +// MULL m32 +// Construct and append a MULL instruction to the active function. +func (c *Context) MULL(mr operand.Op) { + if inst, err := x86.MULL(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MULL: Unsigned Multiply. +// +// Forms: +// +// MULL r32 +// MULL m32 +// Construct and append a MULL instruction to the active function. +// Operates on the global context. +func MULL(mr operand.Op) { ctx.MULL(mr) } + +// MULPD: Multiply Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// MULPD xmm xmm +// MULPD m128 xmm +// Construct and append a MULPD instruction to the active function. +func (c *Context) MULPD(mx, x operand.Op) { + if inst, err := x86.MULPD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MULPD: Multiply Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// MULPD xmm xmm +// MULPD m128 xmm +// Construct and append a MULPD instruction to the active function. +// Operates on the global context. +func MULPD(mx, x operand.Op) { ctx.MULPD(mx, x) } + +// MULPS: Multiply Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MULPS xmm xmm +// MULPS m128 xmm +// Construct and append a MULPS instruction to the active function. +func (c *Context) MULPS(mx, x operand.Op) { + if inst, err := x86.MULPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MULPS: Multiply Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MULPS xmm xmm +// MULPS m128 xmm +// Construct and append a MULPS instruction to the active function. +// Operates on the global context. +func MULPS(mx, x operand.Op) { ctx.MULPS(mx, x) } + +// MULQ: Unsigned Multiply. +// +// Forms: +// +// MULQ r64 +// MULQ m64 +// Construct and append a MULQ instruction to the active function. +func (c *Context) MULQ(mr operand.Op) { + if inst, err := x86.MULQ(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MULQ: Unsigned Multiply. +// +// Forms: +// +// MULQ r64 +// MULQ m64 +// Construct and append a MULQ instruction to the active function. +// Operates on the global context. +func MULQ(mr operand.Op) { ctx.MULQ(mr) } + +// MULSD: Multiply Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// MULSD xmm xmm +// MULSD m64 xmm +// Construct and append a MULSD instruction to the active function. +func (c *Context) MULSD(mx, x operand.Op) { + if inst, err := x86.MULSD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MULSD: Multiply Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// MULSD xmm xmm +// MULSD m64 xmm +// Construct and append a MULSD instruction to the active function. +// Operates on the global context. +func MULSD(mx, x operand.Op) { ctx.MULSD(mx, x) } + +// MULSS: Multiply Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// MULSS xmm xmm +// MULSS m32 xmm +// Construct and append a MULSS instruction to the active function. +func (c *Context) MULSS(mx, x operand.Op) { + if inst, err := x86.MULSS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MULSS: Multiply Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// MULSS xmm xmm +// MULSS m32 xmm +// Construct and append a MULSS instruction to the active function. +// Operates on the global context. +func MULSS(mx, x operand.Op) { ctx.MULSS(mx, x) } + +// MULW: Unsigned Multiply. +// +// Forms: +// +// MULW r16 +// MULW m16 +// Construct and append a MULW instruction to the active function. +func (c *Context) MULW(mr operand.Op) { + if inst, err := x86.MULW(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MULW: Unsigned Multiply. +// +// Forms: +// +// MULW r16 +// MULW m16 +// Construct and append a MULW instruction to the active function. +// Operates on the global context. +func MULW(mr operand.Op) { ctx.MULW(mr) } + +// MULXL: Unsigned Multiply Without Affecting Flags. +// +// Forms: +// +// MULXL r32 r32 r32 +// MULXL m32 r32 r32 +// Construct and append a MULXL instruction to the active function. +func (c *Context) MULXL(mr, r, r1 operand.Op) { + if inst, err := x86.MULXL(mr, r, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MULXL: Unsigned Multiply Without Affecting Flags. +// +// Forms: +// +// MULXL r32 r32 r32 +// MULXL m32 r32 r32 +// Construct and append a MULXL instruction to the active function. +// Operates on the global context. +func MULXL(mr, r, r1 operand.Op) { ctx.MULXL(mr, r, r1) } + +// MULXQ: Unsigned Multiply Without Affecting Flags. +// +// Forms: +// +// MULXQ r64 r64 r64 +// MULXQ m64 r64 r64 +// Construct and append a MULXQ instruction to the active function. +func (c *Context) MULXQ(mr, r, r1 operand.Op) { + if inst, err := x86.MULXQ(mr, r, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MULXQ: Unsigned Multiply Without Affecting Flags. +// +// Forms: +// +// MULXQ r64 r64 r64 +// MULXQ m64 r64 r64 +// Construct and append a MULXQ instruction to the active function. +// Operates on the global context. +func MULXQ(mr, r, r1 operand.Op) { ctx.MULXQ(mr, r, r1) } + +// MWAIT: Monitor Wait. +// +// Forms: +// +// MWAIT +// Construct and append a MWAIT instruction to the active function. +func (c *Context) MWAIT() { + if inst, err := x86.MWAIT(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// MWAIT: Monitor Wait. +// +// Forms: +// +// MWAIT +// Construct and append a MWAIT instruction to the active function. +// Operates on the global context. +func MWAIT() { ctx.MWAIT() } + +// NEGB: Two's Complement Negation. +// +// Forms: +// +// NEGB r8 +// NEGB m8 +// Construct and append a NEGB instruction to the active function. +func (c *Context) NEGB(mr operand.Op) { + if inst, err := x86.NEGB(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// NEGB: Two's Complement Negation. +// +// Forms: +// +// NEGB r8 +// NEGB m8 +// Construct and append a NEGB instruction to the active function. +// Operates on the global context. +func NEGB(mr operand.Op) { ctx.NEGB(mr) } + +// NEGL: Two's Complement Negation. +// +// Forms: +// +// NEGL r32 +// NEGL m32 +// Construct and append a NEGL instruction to the active function. +func (c *Context) NEGL(mr operand.Op) { + if inst, err := x86.NEGL(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// NEGL: Two's Complement Negation. +// +// Forms: +// +// NEGL r32 +// NEGL m32 +// Construct and append a NEGL instruction to the active function. +// Operates on the global context. +func NEGL(mr operand.Op) { ctx.NEGL(mr) } + +// NEGQ: Two's Complement Negation. +// +// Forms: +// +// NEGQ r64 +// NEGQ m64 +// Construct and append a NEGQ instruction to the active function. +func (c *Context) NEGQ(mr operand.Op) { + if inst, err := x86.NEGQ(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// NEGQ: Two's Complement Negation. +// +// Forms: +// +// NEGQ r64 +// NEGQ m64 +// Construct and append a NEGQ instruction to the active function. +// Operates on the global context. +func NEGQ(mr operand.Op) { ctx.NEGQ(mr) } + +// NEGW: Two's Complement Negation. +// +// Forms: +// +// NEGW r16 +// NEGW m16 +// Construct and append a NEGW instruction to the active function. +func (c *Context) NEGW(mr operand.Op) { + if inst, err := x86.NEGW(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// NEGW: Two's Complement Negation. +// +// Forms: +// +// NEGW r16 +// NEGW m16 +// Construct and append a NEGW instruction to the active function. +// Operates on the global context. +func NEGW(mr operand.Op) { ctx.NEGW(mr) } + +// NOP: No Operation. +// +// Forms: +// +// NOP +// Construct and append a NOP instruction to the active function. +func (c *Context) NOP() { + if inst, err := x86.NOP(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// NOP: No Operation. +// +// Forms: +// +// NOP +// Construct and append a NOP instruction to the active function. +// Operates on the global context. +func NOP() { ctx.NOP() } + +// NOTB: One's Complement Negation. +// +// Forms: +// +// NOTB r8 +// NOTB m8 +// Construct and append a NOTB instruction to the active function. +func (c *Context) NOTB(mr operand.Op) { + if inst, err := x86.NOTB(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// NOTB: One's Complement Negation. +// +// Forms: +// +// NOTB r8 +// NOTB m8 +// Construct and append a NOTB instruction to the active function. +// Operates on the global context. +func NOTB(mr operand.Op) { ctx.NOTB(mr) } + +// NOTL: One's Complement Negation. +// +// Forms: +// +// NOTL r32 +// NOTL m32 +// Construct and append a NOTL instruction to the active function. +func (c *Context) NOTL(mr operand.Op) { + if inst, err := x86.NOTL(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// NOTL: One's Complement Negation. +// +// Forms: +// +// NOTL r32 +// NOTL m32 +// Construct and append a NOTL instruction to the active function. +// Operates on the global context. +func NOTL(mr operand.Op) { ctx.NOTL(mr) } + +// NOTQ: One's Complement Negation. +// +// Forms: +// +// NOTQ r64 +// NOTQ m64 +// Construct and append a NOTQ instruction to the active function. +func (c *Context) NOTQ(mr operand.Op) { + if inst, err := x86.NOTQ(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// NOTQ: One's Complement Negation. +// +// Forms: +// +// NOTQ r64 +// NOTQ m64 +// Construct and append a NOTQ instruction to the active function. +// Operates on the global context. +func NOTQ(mr operand.Op) { ctx.NOTQ(mr) } + +// NOTW: One's Complement Negation. +// +// Forms: +// +// NOTW r16 +// NOTW m16 +// Construct and append a NOTW instruction to the active function. +func (c *Context) NOTW(mr operand.Op) { + if inst, err := x86.NOTW(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// NOTW: One's Complement Negation. +// +// Forms: +// +// NOTW r16 +// NOTW m16 +// Construct and append a NOTW instruction to the active function. +// Operates on the global context. +func NOTW(mr operand.Op) { ctx.NOTW(mr) } + +// ORB: Logical Inclusive OR. +// +// Forms: +// +// ORB imm8 al +// ORB imm8 r8 +// ORB r8 r8 +// ORB m8 r8 +// ORB imm8 m8 +// ORB r8 m8 +// Construct and append a ORB instruction to the active function. +func (c *Context) ORB(imr, amr operand.Op) { + if inst, err := x86.ORB(imr, amr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ORB: Logical Inclusive OR. +// +// Forms: +// +// ORB imm8 al +// ORB imm8 r8 +// ORB r8 r8 +// ORB m8 r8 +// ORB imm8 m8 +// ORB r8 m8 +// Construct and append a ORB instruction to the active function. +// Operates on the global context. +func ORB(imr, amr operand.Op) { ctx.ORB(imr, amr) } + +// ORL: Logical Inclusive OR. +// +// Forms: +// +// ORL imm32 eax +// ORL imm8 r32 +// ORL imm32 r32 +// ORL r32 r32 +// ORL m32 r32 +// ORL imm8 m32 +// ORL imm32 m32 +// ORL r32 m32 +// Construct and append a ORL instruction to the active function. +func (c *Context) ORL(imr, emr operand.Op) { + if inst, err := x86.ORL(imr, emr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ORL: Logical Inclusive OR. +// +// Forms: +// +// ORL imm32 eax +// ORL imm8 r32 +// ORL imm32 r32 +// ORL r32 r32 +// ORL m32 r32 +// ORL imm8 m32 +// ORL imm32 m32 +// ORL r32 m32 +// Construct and append a ORL instruction to the active function. +// Operates on the global context. +func ORL(imr, emr operand.Op) { ctx.ORL(imr, emr) } + +// ORPD: Bitwise Logical OR of Double-Precision Floating-Point Values. +// +// Forms: +// +// ORPD xmm xmm +// ORPD m128 xmm +// Construct and append a ORPD instruction to the active function. +func (c *Context) ORPD(mx, x operand.Op) { + if inst, err := x86.ORPD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ORPD: Bitwise Logical OR of Double-Precision Floating-Point Values. +// +// Forms: +// +// ORPD xmm xmm +// ORPD m128 xmm +// Construct and append a ORPD instruction to the active function. +// Operates on the global context. +func ORPD(mx, x operand.Op) { ctx.ORPD(mx, x) } + +// ORPS: Bitwise Logical OR of Single-Precision Floating-Point Values. +// +// Forms: +// +// ORPS xmm xmm +// ORPS m128 xmm +// Construct and append a ORPS instruction to the active function. +func (c *Context) ORPS(mx, x operand.Op) { + if inst, err := x86.ORPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ORPS: Bitwise Logical OR of Single-Precision Floating-Point Values. +// +// Forms: +// +// ORPS xmm xmm +// ORPS m128 xmm +// Construct and append a ORPS instruction to the active function. +// Operates on the global context. +func ORPS(mx, x operand.Op) { ctx.ORPS(mx, x) } + +// ORQ: Logical Inclusive OR. +// +// Forms: +// +// ORQ imm32 rax +// ORQ imm8 r64 +// ORQ imm32 r64 +// ORQ r64 r64 +// ORQ m64 r64 +// ORQ imm8 m64 +// ORQ imm32 m64 +// ORQ r64 m64 +// Construct and append a ORQ instruction to the active function. +func (c *Context) ORQ(imr, mr operand.Op) { + if inst, err := x86.ORQ(imr, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ORQ: Logical Inclusive OR. +// +// Forms: +// +// ORQ imm32 rax +// ORQ imm8 r64 +// ORQ imm32 r64 +// ORQ r64 r64 +// ORQ m64 r64 +// ORQ imm8 m64 +// ORQ imm32 m64 +// ORQ r64 m64 +// Construct and append a ORQ instruction to the active function. +// Operates on the global context. +func ORQ(imr, mr operand.Op) { ctx.ORQ(imr, mr) } + +// ORW: Logical Inclusive OR. +// +// Forms: +// +// ORW imm16 ax +// ORW imm8 r16 +// ORW imm16 r16 +// ORW r16 r16 +// ORW m16 r16 +// ORW imm8 m16 +// ORW imm16 m16 +// ORW r16 m16 +// Construct and append a ORW instruction to the active function. +func (c *Context) ORW(imr, amr operand.Op) { + if inst, err := x86.ORW(imr, amr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ORW: Logical Inclusive OR. +// +// Forms: +// +// ORW imm16 ax +// ORW imm8 r16 +// ORW imm16 r16 +// ORW r16 r16 +// ORW m16 r16 +// ORW imm8 m16 +// ORW imm16 m16 +// ORW r16 m16 +// Construct and append a ORW instruction to the active function. +// Operates on the global context. +func ORW(imr, amr operand.Op) { ctx.ORW(imr, amr) } + +// PABSB: Packed Absolute Value of Byte Integers. +// +// Forms: +// +// PABSB xmm xmm +// PABSB m128 xmm +// Construct and append a PABSB instruction to the active function. +func (c *Context) PABSB(mx, x operand.Op) { + if inst, err := x86.PABSB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PABSB: Packed Absolute Value of Byte Integers. +// +// Forms: +// +// PABSB xmm xmm +// PABSB m128 xmm +// Construct and append a PABSB instruction to the active function. +// Operates on the global context. +func PABSB(mx, x operand.Op) { ctx.PABSB(mx, x) } + +// PABSD: Packed Absolute Value of Doubleword Integers. +// +// Forms: +// +// PABSD xmm xmm +// PABSD m128 xmm +// Construct and append a PABSD instruction to the active function. +func (c *Context) PABSD(mx, x operand.Op) { + if inst, err := x86.PABSD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PABSD: Packed Absolute Value of Doubleword Integers. +// +// Forms: +// +// PABSD xmm xmm +// PABSD m128 xmm +// Construct and append a PABSD instruction to the active function. +// Operates on the global context. +func PABSD(mx, x operand.Op) { ctx.PABSD(mx, x) } + +// PABSW: Packed Absolute Value of Word Integers. +// +// Forms: +// +// PABSW xmm xmm +// PABSW m128 xmm +// Construct and append a PABSW instruction to the active function. +func (c *Context) PABSW(mx, x operand.Op) { + if inst, err := x86.PABSW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PABSW: Packed Absolute Value of Word Integers. +// +// Forms: +// +// PABSW xmm xmm +// PABSW m128 xmm +// Construct and append a PABSW instruction to the active function. +// Operates on the global context. +func PABSW(mx, x operand.Op) { ctx.PABSW(mx, x) } + +// PACKSSLW: Pack Doublewords into Words with Signed Saturation. +// +// Forms: +// +// PACKSSLW xmm xmm +// PACKSSLW m128 xmm +// Construct and append a PACKSSLW instruction to the active function. +func (c *Context) PACKSSLW(mx, x operand.Op) { + if inst, err := x86.PACKSSLW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PACKSSLW: Pack Doublewords into Words with Signed Saturation. +// +// Forms: +// +// PACKSSLW xmm xmm +// PACKSSLW m128 xmm +// Construct and append a PACKSSLW instruction to the active function. +// Operates on the global context. +func PACKSSLW(mx, x operand.Op) { ctx.PACKSSLW(mx, x) } + +// PACKSSWB: Pack Words into Bytes with Signed Saturation. +// +// Forms: +// +// PACKSSWB xmm xmm +// PACKSSWB m128 xmm +// Construct and append a PACKSSWB instruction to the active function. +func (c *Context) PACKSSWB(mx, x operand.Op) { + if inst, err := x86.PACKSSWB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PACKSSWB: Pack Words into Bytes with Signed Saturation. +// +// Forms: +// +// PACKSSWB xmm xmm +// PACKSSWB m128 xmm +// Construct and append a PACKSSWB instruction to the active function. +// Operates on the global context. +func PACKSSWB(mx, x operand.Op) { ctx.PACKSSWB(mx, x) } + +// PACKUSDW: Pack Doublewords into Words with Unsigned Saturation. +// +// Forms: +// +// PACKUSDW xmm xmm +// PACKUSDW m128 xmm +// Construct and append a PACKUSDW instruction to the active function. +func (c *Context) PACKUSDW(mx, x operand.Op) { + if inst, err := x86.PACKUSDW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PACKUSDW: Pack Doublewords into Words with Unsigned Saturation. +// +// Forms: +// +// PACKUSDW xmm xmm +// PACKUSDW m128 xmm +// Construct and append a PACKUSDW instruction to the active function. +// Operates on the global context. +func PACKUSDW(mx, x operand.Op) { ctx.PACKUSDW(mx, x) } + +// PACKUSWB: Pack Words into Bytes with Unsigned Saturation. +// +// Forms: +// +// PACKUSWB xmm xmm +// PACKUSWB m128 xmm +// Construct and append a PACKUSWB instruction to the active function. +func (c *Context) PACKUSWB(mx, x operand.Op) { + if inst, err := x86.PACKUSWB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PACKUSWB: Pack Words into Bytes with Unsigned Saturation. +// +// Forms: +// +// PACKUSWB xmm xmm +// PACKUSWB m128 xmm +// Construct and append a PACKUSWB instruction to the active function. +// Operates on the global context. +func PACKUSWB(mx, x operand.Op) { ctx.PACKUSWB(mx, x) } + +// PADDB: Add Packed Byte Integers. +// +// Forms: +// +// PADDB xmm xmm +// PADDB m128 xmm +// Construct and append a PADDB instruction to the active function. +func (c *Context) PADDB(mx, x operand.Op) { + if inst, err := x86.PADDB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PADDB: Add Packed Byte Integers. +// +// Forms: +// +// PADDB xmm xmm +// PADDB m128 xmm +// Construct and append a PADDB instruction to the active function. +// Operates on the global context. +func PADDB(mx, x operand.Op) { ctx.PADDB(mx, x) } + +// PADDD: Add Packed Doubleword Integers. +// +// Forms: +// +// PADDD xmm xmm +// PADDD m128 xmm +// Construct and append a PADDD instruction to the active function. +func (c *Context) PADDD(mx, x operand.Op) { + if inst, err := x86.PADDD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PADDD: Add Packed Doubleword Integers. +// +// Forms: +// +// PADDD xmm xmm +// PADDD m128 xmm +// Construct and append a PADDD instruction to the active function. +// Operates on the global context. +func PADDD(mx, x operand.Op) { ctx.PADDD(mx, x) } + +// PADDL: Add Packed Doubleword Integers. +// +// Forms: +// +// PADDL xmm xmm +// PADDL m128 xmm +// Construct and append a PADDL instruction to the active function. +func (c *Context) PADDL(mx, x operand.Op) { + if inst, err := x86.PADDL(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PADDL: Add Packed Doubleword Integers. +// +// Forms: +// +// PADDL xmm xmm +// PADDL m128 xmm +// Construct and append a PADDL instruction to the active function. +// Operates on the global context. +func PADDL(mx, x operand.Op) { ctx.PADDL(mx, x) } + +// PADDQ: Add Packed Quadword Integers. +// +// Forms: +// +// PADDQ xmm xmm +// PADDQ m128 xmm +// Construct and append a PADDQ instruction to the active function. +func (c *Context) PADDQ(mx, x operand.Op) { + if inst, err := x86.PADDQ(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PADDQ: Add Packed Quadword Integers. +// +// Forms: +// +// PADDQ xmm xmm +// PADDQ m128 xmm +// Construct and append a PADDQ instruction to the active function. +// Operates on the global context. +func PADDQ(mx, x operand.Op) { ctx.PADDQ(mx, x) } + +// PADDSB: Add Packed Signed Byte Integers with Signed Saturation. +// +// Forms: +// +// PADDSB xmm xmm +// PADDSB m128 xmm +// Construct and append a PADDSB instruction to the active function. +func (c *Context) PADDSB(mx, x operand.Op) { + if inst, err := x86.PADDSB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PADDSB: Add Packed Signed Byte Integers with Signed Saturation. +// +// Forms: +// +// PADDSB xmm xmm +// PADDSB m128 xmm +// Construct and append a PADDSB instruction to the active function. +// Operates on the global context. +func PADDSB(mx, x operand.Op) { ctx.PADDSB(mx, x) } + +// PADDSW: Add Packed Signed Word Integers with Signed Saturation. +// +// Forms: +// +// PADDSW xmm xmm +// PADDSW m128 xmm +// Construct and append a PADDSW instruction to the active function. +func (c *Context) PADDSW(mx, x operand.Op) { + if inst, err := x86.PADDSW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PADDSW: Add Packed Signed Word Integers with Signed Saturation. +// +// Forms: +// +// PADDSW xmm xmm +// PADDSW m128 xmm +// Construct and append a PADDSW instruction to the active function. +// Operates on the global context. +func PADDSW(mx, x operand.Op) { ctx.PADDSW(mx, x) } + +// PADDUSB: Add Packed Unsigned Byte Integers with Unsigned Saturation. +// +// Forms: +// +// PADDUSB xmm xmm +// PADDUSB m128 xmm +// Construct and append a PADDUSB instruction to the active function. +func (c *Context) PADDUSB(mx, x operand.Op) { + if inst, err := x86.PADDUSB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PADDUSB: Add Packed Unsigned Byte Integers with Unsigned Saturation. +// +// Forms: +// +// PADDUSB xmm xmm +// PADDUSB m128 xmm +// Construct and append a PADDUSB instruction to the active function. +// Operates on the global context. +func PADDUSB(mx, x operand.Op) { ctx.PADDUSB(mx, x) } + +// PADDUSW: Add Packed Unsigned Word Integers with Unsigned Saturation. +// +// Forms: +// +// PADDUSW xmm xmm +// PADDUSW m128 xmm +// Construct and append a PADDUSW instruction to the active function. +func (c *Context) PADDUSW(mx, x operand.Op) { + if inst, err := x86.PADDUSW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PADDUSW: Add Packed Unsigned Word Integers with Unsigned Saturation. +// +// Forms: +// +// PADDUSW xmm xmm +// PADDUSW m128 xmm +// Construct and append a PADDUSW instruction to the active function. +// Operates on the global context. +func PADDUSW(mx, x operand.Op) { ctx.PADDUSW(mx, x) } + +// PADDW: Add Packed Word Integers. +// +// Forms: +// +// PADDW xmm xmm +// PADDW m128 xmm +// Construct and append a PADDW instruction to the active function. +func (c *Context) PADDW(mx, x operand.Op) { + if inst, err := x86.PADDW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PADDW: Add Packed Word Integers. +// +// Forms: +// +// PADDW xmm xmm +// PADDW m128 xmm +// Construct and append a PADDW instruction to the active function. +// Operates on the global context. +func PADDW(mx, x operand.Op) { ctx.PADDW(mx, x) } + +// PALIGNR: Packed Align Right. +// +// Forms: +// +// PALIGNR imm8 xmm xmm +// PALIGNR imm8 m128 xmm +// Construct and append a PALIGNR instruction to the active function. +func (c *Context) PALIGNR(i, mx, x operand.Op) { + if inst, err := x86.PALIGNR(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PALIGNR: Packed Align Right. +// +// Forms: +// +// PALIGNR imm8 xmm xmm +// PALIGNR imm8 m128 xmm +// Construct and append a PALIGNR instruction to the active function. +// Operates on the global context. +func PALIGNR(i, mx, x operand.Op) { ctx.PALIGNR(i, mx, x) } + +// PAND: Packed Bitwise Logical AND. +// +// Forms: +// +// PAND xmm xmm +// PAND m128 xmm +// Construct and append a PAND instruction to the active function. +func (c *Context) PAND(mx, x operand.Op) { + if inst, err := x86.PAND(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PAND: Packed Bitwise Logical AND. +// +// Forms: +// +// PAND xmm xmm +// PAND m128 xmm +// Construct and append a PAND instruction to the active function. +// Operates on the global context. +func PAND(mx, x operand.Op) { ctx.PAND(mx, x) } + +// PANDN: Packed Bitwise Logical AND NOT. +// +// Forms: +// +// PANDN xmm xmm +// PANDN m128 xmm +// Construct and append a PANDN instruction to the active function. +func (c *Context) PANDN(mx, x operand.Op) { + if inst, err := x86.PANDN(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PANDN: Packed Bitwise Logical AND NOT. +// +// Forms: +// +// PANDN xmm xmm +// PANDN m128 xmm +// Construct and append a PANDN instruction to the active function. +// Operates on the global context. +func PANDN(mx, x operand.Op) { ctx.PANDN(mx, x) } + +// PAUSE: Spin Loop Hint. +// +// Forms: +// +// PAUSE +// Construct and append a PAUSE instruction to the active function. +func (c *Context) PAUSE() { + if inst, err := x86.PAUSE(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PAUSE: Spin Loop Hint. +// +// Forms: +// +// PAUSE +// Construct and append a PAUSE instruction to the active function. +// Operates on the global context. +func PAUSE() { ctx.PAUSE() } + +// PAVGB: Average Packed Byte Integers. +// +// Forms: +// +// PAVGB xmm xmm +// PAVGB m128 xmm +// Construct and append a PAVGB instruction to the active function. +func (c *Context) PAVGB(mx, x operand.Op) { + if inst, err := x86.PAVGB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PAVGB: Average Packed Byte Integers. +// +// Forms: +// +// PAVGB xmm xmm +// PAVGB m128 xmm +// Construct and append a PAVGB instruction to the active function. +// Operates on the global context. +func PAVGB(mx, x operand.Op) { ctx.PAVGB(mx, x) } + +// PAVGW: Average Packed Word Integers. +// +// Forms: +// +// PAVGW xmm xmm +// PAVGW m128 xmm +// Construct and append a PAVGW instruction to the active function. +func (c *Context) PAVGW(mx, x operand.Op) { + if inst, err := x86.PAVGW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PAVGW: Average Packed Word Integers. +// +// Forms: +// +// PAVGW xmm xmm +// PAVGW m128 xmm +// Construct and append a PAVGW instruction to the active function. +// Operates on the global context. +func PAVGW(mx, x operand.Op) { ctx.PAVGW(mx, x) } + +// PBLENDVB: Variable Blend Packed Bytes. +// +// Forms: +// +// PBLENDVB xmm0 xmm xmm +// PBLENDVB xmm0 m128 xmm +// Construct and append a PBLENDVB instruction to the active function. +func (c *Context) PBLENDVB(x, mx, x1 operand.Op) { + if inst, err := x86.PBLENDVB(x, mx, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PBLENDVB: Variable Blend Packed Bytes. +// +// Forms: +// +// PBLENDVB xmm0 xmm xmm +// PBLENDVB xmm0 m128 xmm +// Construct and append a PBLENDVB instruction to the active function. +// Operates on the global context. +func PBLENDVB(x, mx, x1 operand.Op) { ctx.PBLENDVB(x, mx, x1) } + +// PBLENDW: Blend Packed Words. +// +// Forms: +// +// PBLENDW imm8 xmm xmm +// PBLENDW imm8 m128 xmm +// Construct and append a PBLENDW instruction to the active function. +func (c *Context) PBLENDW(i, mx, x operand.Op) { + if inst, err := x86.PBLENDW(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PBLENDW: Blend Packed Words. +// +// Forms: +// +// PBLENDW imm8 xmm xmm +// PBLENDW imm8 m128 xmm +// Construct and append a PBLENDW instruction to the active function. +// Operates on the global context. +func PBLENDW(i, mx, x operand.Op) { ctx.PBLENDW(i, mx, x) } + +// PCLMULQDQ: Carry-Less Quadword Multiplication. +// +// Forms: +// +// PCLMULQDQ imm8 xmm xmm +// PCLMULQDQ imm8 m128 xmm +// Construct and append a PCLMULQDQ instruction to the active function. +func (c *Context) PCLMULQDQ(i, mx, x operand.Op) { + if inst, err := x86.PCLMULQDQ(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PCLMULQDQ: Carry-Less Quadword Multiplication. +// +// Forms: +// +// PCLMULQDQ imm8 xmm xmm +// PCLMULQDQ imm8 m128 xmm +// Construct and append a PCLMULQDQ instruction to the active function. +// Operates on the global context. +func PCLMULQDQ(i, mx, x operand.Op) { ctx.PCLMULQDQ(i, mx, x) } + +// PCMPEQB: Compare Packed Byte Data for Equality. +// +// Forms: +// +// PCMPEQB xmm xmm +// PCMPEQB m128 xmm +// Construct and append a PCMPEQB instruction to the active function. +func (c *Context) PCMPEQB(mx, x operand.Op) { + if inst, err := x86.PCMPEQB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PCMPEQB: Compare Packed Byte Data for Equality. +// +// Forms: +// +// PCMPEQB xmm xmm +// PCMPEQB m128 xmm +// Construct and append a PCMPEQB instruction to the active function. +// Operates on the global context. +func PCMPEQB(mx, x operand.Op) { ctx.PCMPEQB(mx, x) } + +// PCMPEQL: Compare Packed Doubleword Data for Equality. +// +// Forms: +// +// PCMPEQL xmm xmm +// PCMPEQL m128 xmm +// Construct and append a PCMPEQL instruction to the active function. +func (c *Context) PCMPEQL(mx, x operand.Op) { + if inst, err := x86.PCMPEQL(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PCMPEQL: Compare Packed Doubleword Data for Equality. +// +// Forms: +// +// PCMPEQL xmm xmm +// PCMPEQL m128 xmm +// Construct and append a PCMPEQL instruction to the active function. +// Operates on the global context. +func PCMPEQL(mx, x operand.Op) { ctx.PCMPEQL(mx, x) } + +// PCMPEQQ: Compare Packed Quadword Data for Equality. +// +// Forms: +// +// PCMPEQQ xmm xmm +// PCMPEQQ m128 xmm +// Construct and append a PCMPEQQ instruction to the active function. +func (c *Context) PCMPEQQ(mx, x operand.Op) { + if inst, err := x86.PCMPEQQ(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PCMPEQQ: Compare Packed Quadword Data for Equality. +// +// Forms: +// +// PCMPEQQ xmm xmm +// PCMPEQQ m128 xmm +// Construct and append a PCMPEQQ instruction to the active function. +// Operates on the global context. +func PCMPEQQ(mx, x operand.Op) { ctx.PCMPEQQ(mx, x) } + +// PCMPEQW: Compare Packed Word Data for Equality. +// +// Forms: +// +// PCMPEQW xmm xmm +// PCMPEQW m128 xmm +// Construct and append a PCMPEQW instruction to the active function. +func (c *Context) PCMPEQW(mx, x operand.Op) { + if inst, err := x86.PCMPEQW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PCMPEQW: Compare Packed Word Data for Equality. +// +// Forms: +// +// PCMPEQW xmm xmm +// PCMPEQW m128 xmm +// Construct and append a PCMPEQW instruction to the active function. +// Operates on the global context. +func PCMPEQW(mx, x operand.Op) { ctx.PCMPEQW(mx, x) } + +// PCMPESTRI: Packed Compare Explicit Length Strings, Return Index. +// +// Forms: +// +// PCMPESTRI imm8 xmm xmm +// PCMPESTRI imm8 m128 xmm +// Construct and append a PCMPESTRI instruction to the active function. +func (c *Context) PCMPESTRI(i, mx, x operand.Op) { + if inst, err := x86.PCMPESTRI(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PCMPESTRI: Packed Compare Explicit Length Strings, Return Index. +// +// Forms: +// +// PCMPESTRI imm8 xmm xmm +// PCMPESTRI imm8 m128 xmm +// Construct and append a PCMPESTRI instruction to the active function. +// Operates on the global context. +func PCMPESTRI(i, mx, x operand.Op) { ctx.PCMPESTRI(i, mx, x) } + +// PCMPESTRM: Packed Compare Explicit Length Strings, Return Mask. +// +// Forms: +// +// PCMPESTRM imm8 xmm xmm +// PCMPESTRM imm8 m128 xmm +// Construct and append a PCMPESTRM instruction to the active function. +func (c *Context) PCMPESTRM(i, mx, x operand.Op) { + if inst, err := x86.PCMPESTRM(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PCMPESTRM: Packed Compare Explicit Length Strings, Return Mask. +// +// Forms: +// +// PCMPESTRM imm8 xmm xmm +// PCMPESTRM imm8 m128 xmm +// Construct and append a PCMPESTRM instruction to the active function. +// Operates on the global context. +func PCMPESTRM(i, mx, x operand.Op) { ctx.PCMPESTRM(i, mx, x) } + +// PCMPGTB: Compare Packed Signed Byte Integers for Greater Than. +// +// Forms: +// +// PCMPGTB xmm xmm +// PCMPGTB m128 xmm +// Construct and append a PCMPGTB instruction to the active function. +func (c *Context) PCMPGTB(mx, x operand.Op) { + if inst, err := x86.PCMPGTB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PCMPGTB: Compare Packed Signed Byte Integers for Greater Than. +// +// Forms: +// +// PCMPGTB xmm xmm +// PCMPGTB m128 xmm +// Construct and append a PCMPGTB instruction to the active function. +// Operates on the global context. +func PCMPGTB(mx, x operand.Op) { ctx.PCMPGTB(mx, x) } + +// PCMPGTL: Compare Packed Signed Doubleword Integers for Greater Than. +// +// Forms: +// +// PCMPGTL xmm xmm +// PCMPGTL m128 xmm +// Construct and append a PCMPGTL instruction to the active function. +func (c *Context) PCMPGTL(mx, x operand.Op) { + if inst, err := x86.PCMPGTL(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PCMPGTL: Compare Packed Signed Doubleword Integers for Greater Than. +// +// Forms: +// +// PCMPGTL xmm xmm +// PCMPGTL m128 xmm +// Construct and append a PCMPGTL instruction to the active function. +// Operates on the global context. +func PCMPGTL(mx, x operand.Op) { ctx.PCMPGTL(mx, x) } + +// PCMPGTQ: Compare Packed Data for Greater Than. +// +// Forms: +// +// PCMPGTQ xmm xmm +// PCMPGTQ m128 xmm +// Construct and append a PCMPGTQ instruction to the active function. +func (c *Context) PCMPGTQ(mx, x operand.Op) { + if inst, err := x86.PCMPGTQ(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PCMPGTQ: Compare Packed Data for Greater Than. +// +// Forms: +// +// PCMPGTQ xmm xmm +// PCMPGTQ m128 xmm +// Construct and append a PCMPGTQ instruction to the active function. +// Operates on the global context. +func PCMPGTQ(mx, x operand.Op) { ctx.PCMPGTQ(mx, x) } + +// PCMPGTW: Compare Packed Signed Word Integers for Greater Than. +// +// Forms: +// +// PCMPGTW xmm xmm +// PCMPGTW m128 xmm +// Construct and append a PCMPGTW instruction to the active function. +func (c *Context) PCMPGTW(mx, x operand.Op) { + if inst, err := x86.PCMPGTW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PCMPGTW: Compare Packed Signed Word Integers for Greater Than. +// +// Forms: +// +// PCMPGTW xmm xmm +// PCMPGTW m128 xmm +// Construct and append a PCMPGTW instruction to the active function. +// Operates on the global context. +func PCMPGTW(mx, x operand.Op) { ctx.PCMPGTW(mx, x) } + +// PCMPISTRI: Packed Compare Implicit Length Strings, Return Index. +// +// Forms: +// +// PCMPISTRI imm8 xmm xmm +// PCMPISTRI imm8 m128 xmm +// Construct and append a PCMPISTRI instruction to the active function. +func (c *Context) PCMPISTRI(i, mx, x operand.Op) { + if inst, err := x86.PCMPISTRI(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PCMPISTRI: Packed Compare Implicit Length Strings, Return Index. +// +// Forms: +// +// PCMPISTRI imm8 xmm xmm +// PCMPISTRI imm8 m128 xmm +// Construct and append a PCMPISTRI instruction to the active function. +// Operates on the global context. +func PCMPISTRI(i, mx, x operand.Op) { ctx.PCMPISTRI(i, mx, x) } + +// PCMPISTRM: Packed Compare Implicit Length Strings, Return Mask. +// +// Forms: +// +// PCMPISTRM imm8 xmm xmm +// PCMPISTRM imm8 m128 xmm +// Construct and append a PCMPISTRM instruction to the active function. +func (c *Context) PCMPISTRM(i, mx, x operand.Op) { + if inst, err := x86.PCMPISTRM(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PCMPISTRM: Packed Compare Implicit Length Strings, Return Mask. +// +// Forms: +// +// PCMPISTRM imm8 xmm xmm +// PCMPISTRM imm8 m128 xmm +// Construct and append a PCMPISTRM instruction to the active function. +// Operates on the global context. +func PCMPISTRM(i, mx, x operand.Op) { ctx.PCMPISTRM(i, mx, x) } + +// PDEPL: Parallel Bits Deposit. +// +// Forms: +// +// PDEPL r32 r32 r32 +// PDEPL m32 r32 r32 +// Construct and append a PDEPL instruction to the active function. +func (c *Context) PDEPL(mr, r, r1 operand.Op) { + if inst, err := x86.PDEPL(mr, r, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PDEPL: Parallel Bits Deposit. +// +// Forms: +// +// PDEPL r32 r32 r32 +// PDEPL m32 r32 r32 +// Construct and append a PDEPL instruction to the active function. +// Operates on the global context. +func PDEPL(mr, r, r1 operand.Op) { ctx.PDEPL(mr, r, r1) } + +// PDEPQ: Parallel Bits Deposit. +// +// Forms: +// +// PDEPQ r64 r64 r64 +// PDEPQ m64 r64 r64 +// Construct and append a PDEPQ instruction to the active function. +func (c *Context) PDEPQ(mr, r, r1 operand.Op) { + if inst, err := x86.PDEPQ(mr, r, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PDEPQ: Parallel Bits Deposit. +// +// Forms: +// +// PDEPQ r64 r64 r64 +// PDEPQ m64 r64 r64 +// Construct and append a PDEPQ instruction to the active function. +// Operates on the global context. +func PDEPQ(mr, r, r1 operand.Op) { ctx.PDEPQ(mr, r, r1) } + +// PEXTL: Parallel Bits Extract. +// +// Forms: +// +// PEXTL r32 r32 r32 +// PEXTL m32 r32 r32 +// Construct and append a PEXTL instruction to the active function. +func (c *Context) PEXTL(mr, r, r1 operand.Op) { + if inst, err := x86.PEXTL(mr, r, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PEXTL: Parallel Bits Extract. +// +// Forms: +// +// PEXTL r32 r32 r32 +// PEXTL m32 r32 r32 +// Construct and append a PEXTL instruction to the active function. +// Operates on the global context. +func PEXTL(mr, r, r1 operand.Op) { ctx.PEXTL(mr, r, r1) } + +// PEXTQ: Parallel Bits Extract. +// +// Forms: +// +// PEXTQ r64 r64 r64 +// PEXTQ m64 r64 r64 +// Construct and append a PEXTQ instruction to the active function. +func (c *Context) PEXTQ(mr, r, r1 operand.Op) { + if inst, err := x86.PEXTQ(mr, r, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PEXTQ: Parallel Bits Extract. +// +// Forms: +// +// PEXTQ r64 r64 r64 +// PEXTQ m64 r64 r64 +// Construct and append a PEXTQ instruction to the active function. +// Operates on the global context. +func PEXTQ(mr, r, r1 operand.Op) { ctx.PEXTQ(mr, r, r1) } + +// PEXTRB: Extract Byte. +// +// Forms: +// +// PEXTRB imm8 xmm r32 +// PEXTRB imm8 xmm m8 +// Construct and append a PEXTRB instruction to the active function. +func (c *Context) PEXTRB(i, x, mr operand.Op) { + if inst, err := x86.PEXTRB(i, x, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PEXTRB: Extract Byte. +// +// Forms: +// +// PEXTRB imm8 xmm r32 +// PEXTRB imm8 xmm m8 +// Construct and append a PEXTRB instruction to the active function. +// Operates on the global context. +func PEXTRB(i, x, mr operand.Op) { ctx.PEXTRB(i, x, mr) } + +// PEXTRD: Extract Doubleword. +// +// Forms: +// +// PEXTRD imm8 xmm r32 +// PEXTRD imm8 xmm m32 +// Construct and append a PEXTRD instruction to the active function. +func (c *Context) PEXTRD(i, x, mr operand.Op) { + if inst, err := x86.PEXTRD(i, x, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PEXTRD: Extract Doubleword. +// +// Forms: +// +// PEXTRD imm8 xmm r32 +// PEXTRD imm8 xmm m32 +// Construct and append a PEXTRD instruction to the active function. +// Operates on the global context. +func PEXTRD(i, x, mr operand.Op) { ctx.PEXTRD(i, x, mr) } + +// PEXTRQ: Extract Quadword. +// +// Forms: +// +// PEXTRQ imm8 xmm r64 +// PEXTRQ imm8 xmm m64 +// Construct and append a PEXTRQ instruction to the active function. +func (c *Context) PEXTRQ(i, x, mr operand.Op) { + if inst, err := x86.PEXTRQ(i, x, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PEXTRQ: Extract Quadword. +// +// Forms: +// +// PEXTRQ imm8 xmm r64 +// PEXTRQ imm8 xmm m64 +// Construct and append a PEXTRQ instruction to the active function. +// Operates on the global context. +func PEXTRQ(i, x, mr operand.Op) { ctx.PEXTRQ(i, x, mr) } + +// PEXTRW: Extract Word. +// +// Forms: +// +// PEXTRW imm8 xmm r32 +// PEXTRW imm8 xmm m16 +// Construct and append a PEXTRW instruction to the active function. +func (c *Context) PEXTRW(i, x, mr operand.Op) { + if inst, err := x86.PEXTRW(i, x, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PEXTRW: Extract Word. +// +// Forms: +// +// PEXTRW imm8 xmm r32 +// PEXTRW imm8 xmm m16 +// Construct and append a PEXTRW instruction to the active function. +// Operates on the global context. +func PEXTRW(i, x, mr operand.Op) { ctx.PEXTRW(i, x, mr) } + +// PHADDD: Packed Horizontal Add Doubleword Integer. +// +// Forms: +// +// PHADDD xmm xmm +// PHADDD m128 xmm +// Construct and append a PHADDD instruction to the active function. +func (c *Context) PHADDD(mx, x operand.Op) { + if inst, err := x86.PHADDD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PHADDD: Packed Horizontal Add Doubleword Integer. +// +// Forms: +// +// PHADDD xmm xmm +// PHADDD m128 xmm +// Construct and append a PHADDD instruction to the active function. +// Operates on the global context. +func PHADDD(mx, x operand.Op) { ctx.PHADDD(mx, x) } + +// PHADDSW: Packed Horizontal Add Signed Word Integers with Signed Saturation. +// +// Forms: +// +// PHADDSW xmm xmm +// PHADDSW m128 xmm +// Construct and append a PHADDSW instruction to the active function. +func (c *Context) PHADDSW(mx, x operand.Op) { + if inst, err := x86.PHADDSW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PHADDSW: Packed Horizontal Add Signed Word Integers with Signed Saturation. +// +// Forms: +// +// PHADDSW xmm xmm +// PHADDSW m128 xmm +// Construct and append a PHADDSW instruction to the active function. +// Operates on the global context. +func PHADDSW(mx, x operand.Op) { ctx.PHADDSW(mx, x) } + +// PHADDW: Packed Horizontal Add Word Integers. +// +// Forms: +// +// PHADDW xmm xmm +// PHADDW m128 xmm +// Construct and append a PHADDW instruction to the active function. +func (c *Context) PHADDW(mx, x operand.Op) { + if inst, err := x86.PHADDW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PHADDW: Packed Horizontal Add Word Integers. +// +// Forms: +// +// PHADDW xmm xmm +// PHADDW m128 xmm +// Construct and append a PHADDW instruction to the active function. +// Operates on the global context. +func PHADDW(mx, x operand.Op) { ctx.PHADDW(mx, x) } + +// PHMINPOSUW: Packed Horizontal Minimum of Unsigned Word Integers. +// +// Forms: +// +// PHMINPOSUW xmm xmm +// PHMINPOSUW m128 xmm +// Construct and append a PHMINPOSUW instruction to the active function. +func (c *Context) PHMINPOSUW(mx, x operand.Op) { + if inst, err := x86.PHMINPOSUW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PHMINPOSUW: Packed Horizontal Minimum of Unsigned Word Integers. +// +// Forms: +// +// PHMINPOSUW xmm xmm +// PHMINPOSUW m128 xmm +// Construct and append a PHMINPOSUW instruction to the active function. +// Operates on the global context. +func PHMINPOSUW(mx, x operand.Op) { ctx.PHMINPOSUW(mx, x) } + +// PHSUBD: Packed Horizontal Subtract Doubleword Integers. +// +// Forms: +// +// PHSUBD xmm xmm +// PHSUBD m128 xmm +// Construct and append a PHSUBD instruction to the active function. +func (c *Context) PHSUBD(mx, x operand.Op) { + if inst, err := x86.PHSUBD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PHSUBD: Packed Horizontal Subtract Doubleword Integers. +// +// Forms: +// +// PHSUBD xmm xmm +// PHSUBD m128 xmm +// Construct and append a PHSUBD instruction to the active function. +// Operates on the global context. +func PHSUBD(mx, x operand.Op) { ctx.PHSUBD(mx, x) } + +// PHSUBSW: Packed Horizontal Subtract Signed Word Integers with Signed Saturation. +// +// Forms: +// +// PHSUBSW xmm xmm +// PHSUBSW m128 xmm +// Construct and append a PHSUBSW instruction to the active function. +func (c *Context) PHSUBSW(mx, x operand.Op) { + if inst, err := x86.PHSUBSW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PHSUBSW: Packed Horizontal Subtract Signed Word Integers with Signed Saturation. +// +// Forms: +// +// PHSUBSW xmm xmm +// PHSUBSW m128 xmm +// Construct and append a PHSUBSW instruction to the active function. +// Operates on the global context. +func PHSUBSW(mx, x operand.Op) { ctx.PHSUBSW(mx, x) } + +// PHSUBW: Packed Horizontal Subtract Word Integers. +// +// Forms: +// +// PHSUBW xmm xmm +// PHSUBW m128 xmm +// Construct and append a PHSUBW instruction to the active function. +func (c *Context) PHSUBW(mx, x operand.Op) { + if inst, err := x86.PHSUBW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PHSUBW: Packed Horizontal Subtract Word Integers. +// +// Forms: +// +// PHSUBW xmm xmm +// PHSUBW m128 xmm +// Construct and append a PHSUBW instruction to the active function. +// Operates on the global context. +func PHSUBW(mx, x operand.Op) { ctx.PHSUBW(mx, x) } + +// PINSRB: Insert Byte. +// +// Forms: +// +// PINSRB imm8 r32 xmm +// PINSRB imm8 m8 xmm +// Construct and append a PINSRB instruction to the active function. +func (c *Context) PINSRB(i, mr, x operand.Op) { + if inst, err := x86.PINSRB(i, mr, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PINSRB: Insert Byte. +// +// Forms: +// +// PINSRB imm8 r32 xmm +// PINSRB imm8 m8 xmm +// Construct and append a PINSRB instruction to the active function. +// Operates on the global context. +func PINSRB(i, mr, x operand.Op) { ctx.PINSRB(i, mr, x) } + +// PINSRD: Insert Doubleword. +// +// Forms: +// +// PINSRD imm8 r32 xmm +// PINSRD imm8 m32 xmm +// Construct and append a PINSRD instruction to the active function. +func (c *Context) PINSRD(i, mr, x operand.Op) { + if inst, err := x86.PINSRD(i, mr, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PINSRD: Insert Doubleword. +// +// Forms: +// +// PINSRD imm8 r32 xmm +// PINSRD imm8 m32 xmm +// Construct and append a PINSRD instruction to the active function. +// Operates on the global context. +func PINSRD(i, mr, x operand.Op) { ctx.PINSRD(i, mr, x) } + +// PINSRQ: Insert Quadword. +// +// Forms: +// +// PINSRQ imm8 r64 xmm +// PINSRQ imm8 m64 xmm +// Construct and append a PINSRQ instruction to the active function. +func (c *Context) PINSRQ(i, mr, x operand.Op) { + if inst, err := x86.PINSRQ(i, mr, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PINSRQ: Insert Quadword. +// +// Forms: +// +// PINSRQ imm8 r64 xmm +// PINSRQ imm8 m64 xmm +// Construct and append a PINSRQ instruction to the active function. +// Operates on the global context. +func PINSRQ(i, mr, x operand.Op) { ctx.PINSRQ(i, mr, x) } + +// PINSRW: Insert Word. +// +// Forms: +// +// PINSRW imm8 r32 xmm +// PINSRW imm8 m16 xmm +// Construct and append a PINSRW instruction to the active function. +func (c *Context) PINSRW(i, mr, x operand.Op) { + if inst, err := x86.PINSRW(i, mr, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PINSRW: Insert Word. +// +// Forms: +// +// PINSRW imm8 r32 xmm +// PINSRW imm8 m16 xmm +// Construct and append a PINSRW instruction to the active function. +// Operates on the global context. +func PINSRW(i, mr, x operand.Op) { ctx.PINSRW(i, mr, x) } + +// PMADDUBSW: Multiply and Add Packed Signed and Unsigned Byte Integers. +// +// Forms: +// +// PMADDUBSW xmm xmm +// PMADDUBSW m128 xmm +// Construct and append a PMADDUBSW instruction to the active function. +func (c *Context) PMADDUBSW(mx, x operand.Op) { + if inst, err := x86.PMADDUBSW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMADDUBSW: Multiply and Add Packed Signed and Unsigned Byte Integers. +// +// Forms: +// +// PMADDUBSW xmm xmm +// PMADDUBSW m128 xmm +// Construct and append a PMADDUBSW instruction to the active function. +// Operates on the global context. +func PMADDUBSW(mx, x operand.Op) { ctx.PMADDUBSW(mx, x) } + +// PMADDWL: Multiply and Add Packed Signed Word Integers. +// +// Forms: +// +// PMADDWL xmm xmm +// PMADDWL m128 xmm +// Construct and append a PMADDWL instruction to the active function. +func (c *Context) PMADDWL(mx, x operand.Op) { + if inst, err := x86.PMADDWL(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMADDWL: Multiply and Add Packed Signed Word Integers. +// +// Forms: +// +// PMADDWL xmm xmm +// PMADDWL m128 xmm +// Construct and append a PMADDWL instruction to the active function. +// Operates on the global context. +func PMADDWL(mx, x operand.Op) { ctx.PMADDWL(mx, x) } + +// PMAXSB: Maximum of Packed Signed Byte Integers. +// +// Forms: +// +// PMAXSB xmm xmm +// PMAXSB m128 xmm +// Construct and append a PMAXSB instruction to the active function. +func (c *Context) PMAXSB(mx, x operand.Op) { + if inst, err := x86.PMAXSB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMAXSB: Maximum of Packed Signed Byte Integers. +// +// Forms: +// +// PMAXSB xmm xmm +// PMAXSB m128 xmm +// Construct and append a PMAXSB instruction to the active function. +// Operates on the global context. +func PMAXSB(mx, x operand.Op) { ctx.PMAXSB(mx, x) } + +// PMAXSD: Maximum of Packed Signed Doubleword Integers. +// +// Forms: +// +// PMAXSD xmm xmm +// PMAXSD m128 xmm +// Construct and append a PMAXSD instruction to the active function. +func (c *Context) PMAXSD(mx, x operand.Op) { + if inst, err := x86.PMAXSD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMAXSD: Maximum of Packed Signed Doubleword Integers. +// +// Forms: +// +// PMAXSD xmm xmm +// PMAXSD m128 xmm +// Construct and append a PMAXSD instruction to the active function. +// Operates on the global context. +func PMAXSD(mx, x operand.Op) { ctx.PMAXSD(mx, x) } + +// PMAXSW: Maximum of Packed Signed Word Integers. +// +// Forms: +// +// PMAXSW xmm xmm +// PMAXSW m128 xmm +// Construct and append a PMAXSW instruction to the active function. +func (c *Context) PMAXSW(mx, x operand.Op) { + if inst, err := x86.PMAXSW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMAXSW: Maximum of Packed Signed Word Integers. +// +// Forms: +// +// PMAXSW xmm xmm +// PMAXSW m128 xmm +// Construct and append a PMAXSW instruction to the active function. +// Operates on the global context. +func PMAXSW(mx, x operand.Op) { ctx.PMAXSW(mx, x) } + +// PMAXUB: Maximum of Packed Unsigned Byte Integers. +// +// Forms: +// +// PMAXUB xmm xmm +// PMAXUB m128 xmm +// Construct and append a PMAXUB instruction to the active function. +func (c *Context) PMAXUB(mx, x operand.Op) { + if inst, err := x86.PMAXUB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMAXUB: Maximum of Packed Unsigned Byte Integers. +// +// Forms: +// +// PMAXUB xmm xmm +// PMAXUB m128 xmm +// Construct and append a PMAXUB instruction to the active function. +// Operates on the global context. +func PMAXUB(mx, x operand.Op) { ctx.PMAXUB(mx, x) } + +// PMAXUD: Maximum of Packed Unsigned Doubleword Integers. +// +// Forms: +// +// PMAXUD xmm xmm +// PMAXUD m128 xmm +// Construct and append a PMAXUD instruction to the active function. +func (c *Context) PMAXUD(mx, x operand.Op) { + if inst, err := x86.PMAXUD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMAXUD: Maximum of Packed Unsigned Doubleword Integers. +// +// Forms: +// +// PMAXUD xmm xmm +// PMAXUD m128 xmm +// Construct and append a PMAXUD instruction to the active function. +// Operates on the global context. +func PMAXUD(mx, x operand.Op) { ctx.PMAXUD(mx, x) } + +// PMAXUW: Maximum of Packed Unsigned Word Integers. +// +// Forms: +// +// PMAXUW xmm xmm +// PMAXUW m128 xmm +// Construct and append a PMAXUW instruction to the active function. +func (c *Context) PMAXUW(mx, x operand.Op) { + if inst, err := x86.PMAXUW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMAXUW: Maximum of Packed Unsigned Word Integers. +// +// Forms: +// +// PMAXUW xmm xmm +// PMAXUW m128 xmm +// Construct and append a PMAXUW instruction to the active function. +// Operates on the global context. +func PMAXUW(mx, x operand.Op) { ctx.PMAXUW(mx, x) } + +// PMINSB: Minimum of Packed Signed Byte Integers. +// +// Forms: +// +// PMINSB xmm xmm +// PMINSB m128 xmm +// Construct and append a PMINSB instruction to the active function. +func (c *Context) PMINSB(mx, x operand.Op) { + if inst, err := x86.PMINSB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMINSB: Minimum of Packed Signed Byte Integers. +// +// Forms: +// +// PMINSB xmm xmm +// PMINSB m128 xmm +// Construct and append a PMINSB instruction to the active function. +// Operates on the global context. +func PMINSB(mx, x operand.Op) { ctx.PMINSB(mx, x) } + +// PMINSD: Minimum of Packed Signed Doubleword Integers. +// +// Forms: +// +// PMINSD xmm xmm +// PMINSD m128 xmm +// Construct and append a PMINSD instruction to the active function. +func (c *Context) PMINSD(mx, x operand.Op) { + if inst, err := x86.PMINSD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMINSD: Minimum of Packed Signed Doubleword Integers. +// +// Forms: +// +// PMINSD xmm xmm +// PMINSD m128 xmm +// Construct and append a PMINSD instruction to the active function. +// Operates on the global context. +func PMINSD(mx, x operand.Op) { ctx.PMINSD(mx, x) } + +// PMINSW: Minimum of Packed Signed Word Integers. +// +// Forms: +// +// PMINSW xmm xmm +// PMINSW m128 xmm +// Construct and append a PMINSW instruction to the active function. +func (c *Context) PMINSW(mx, x operand.Op) { + if inst, err := x86.PMINSW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMINSW: Minimum of Packed Signed Word Integers. +// +// Forms: +// +// PMINSW xmm xmm +// PMINSW m128 xmm +// Construct and append a PMINSW instruction to the active function. +// Operates on the global context. +func PMINSW(mx, x operand.Op) { ctx.PMINSW(mx, x) } + +// PMINUB: Minimum of Packed Unsigned Byte Integers. +// +// Forms: +// +// PMINUB xmm xmm +// PMINUB m128 xmm +// Construct and append a PMINUB instruction to the active function. +func (c *Context) PMINUB(mx, x operand.Op) { + if inst, err := x86.PMINUB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMINUB: Minimum of Packed Unsigned Byte Integers. +// +// Forms: +// +// PMINUB xmm xmm +// PMINUB m128 xmm +// Construct and append a PMINUB instruction to the active function. +// Operates on the global context. +func PMINUB(mx, x operand.Op) { ctx.PMINUB(mx, x) } + +// PMINUD: Minimum of Packed Unsigned Doubleword Integers. +// +// Forms: +// +// PMINUD xmm xmm +// PMINUD m128 xmm +// Construct and append a PMINUD instruction to the active function. +func (c *Context) PMINUD(mx, x operand.Op) { + if inst, err := x86.PMINUD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMINUD: Minimum of Packed Unsigned Doubleword Integers. +// +// Forms: +// +// PMINUD xmm xmm +// PMINUD m128 xmm +// Construct and append a PMINUD instruction to the active function. +// Operates on the global context. +func PMINUD(mx, x operand.Op) { ctx.PMINUD(mx, x) } + +// PMINUW: Minimum of Packed Unsigned Word Integers. +// +// Forms: +// +// PMINUW xmm xmm +// PMINUW m128 xmm +// Construct and append a PMINUW instruction to the active function. +func (c *Context) PMINUW(mx, x operand.Op) { + if inst, err := x86.PMINUW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMINUW: Minimum of Packed Unsigned Word Integers. +// +// Forms: +// +// PMINUW xmm xmm +// PMINUW m128 xmm +// Construct and append a PMINUW instruction to the active function. +// Operates on the global context. +func PMINUW(mx, x operand.Op) { ctx.PMINUW(mx, x) } + +// PMOVMSKB: Move Byte Mask. +// +// Forms: +// +// PMOVMSKB xmm r32 +// Construct and append a PMOVMSKB instruction to the active function. +func (c *Context) PMOVMSKB(x, r operand.Op) { + if inst, err := x86.PMOVMSKB(x, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMOVMSKB: Move Byte Mask. +// +// Forms: +// +// PMOVMSKB xmm r32 +// Construct and append a PMOVMSKB instruction to the active function. +// Operates on the global context. +func PMOVMSKB(x, r operand.Op) { ctx.PMOVMSKB(x, r) } + +// PMOVSXBD: Move Packed Byte Integers to Doubleword Integers with Sign Extension. +// +// Forms: +// +// PMOVSXBD xmm xmm +// PMOVSXBD m32 xmm +// Construct and append a PMOVSXBD instruction to the active function. +func (c *Context) PMOVSXBD(mx, x operand.Op) { + if inst, err := x86.PMOVSXBD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMOVSXBD: Move Packed Byte Integers to Doubleword Integers with Sign Extension. +// +// Forms: +// +// PMOVSXBD xmm xmm +// PMOVSXBD m32 xmm +// Construct and append a PMOVSXBD instruction to the active function. +// Operates on the global context. +func PMOVSXBD(mx, x operand.Op) { ctx.PMOVSXBD(mx, x) } + +// PMOVSXBQ: Move Packed Byte Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// PMOVSXBQ xmm xmm +// PMOVSXBQ m16 xmm +// Construct and append a PMOVSXBQ instruction to the active function. +func (c *Context) PMOVSXBQ(mx, x operand.Op) { + if inst, err := x86.PMOVSXBQ(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMOVSXBQ: Move Packed Byte Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// PMOVSXBQ xmm xmm +// PMOVSXBQ m16 xmm +// Construct and append a PMOVSXBQ instruction to the active function. +// Operates on the global context. +func PMOVSXBQ(mx, x operand.Op) { ctx.PMOVSXBQ(mx, x) } + +// PMOVSXBW: Move Packed Byte Integers to Word Integers with Sign Extension. +// +// Forms: +// +// PMOVSXBW xmm xmm +// PMOVSXBW m64 xmm +// Construct and append a PMOVSXBW instruction to the active function. +func (c *Context) PMOVSXBW(mx, x operand.Op) { + if inst, err := x86.PMOVSXBW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMOVSXBW: Move Packed Byte Integers to Word Integers with Sign Extension. +// +// Forms: +// +// PMOVSXBW xmm xmm +// PMOVSXBW m64 xmm +// Construct and append a PMOVSXBW instruction to the active function. +// Operates on the global context. +func PMOVSXBW(mx, x operand.Op) { ctx.PMOVSXBW(mx, x) } + +// PMOVSXDQ: Move Packed Doubleword Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// PMOVSXDQ xmm xmm +// PMOVSXDQ m64 xmm +// Construct and append a PMOVSXDQ instruction to the active function. +func (c *Context) PMOVSXDQ(mx, x operand.Op) { + if inst, err := x86.PMOVSXDQ(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMOVSXDQ: Move Packed Doubleword Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// PMOVSXDQ xmm xmm +// PMOVSXDQ m64 xmm +// Construct and append a PMOVSXDQ instruction to the active function. +// Operates on the global context. +func PMOVSXDQ(mx, x operand.Op) { ctx.PMOVSXDQ(mx, x) } + +// PMOVSXWD: Move Packed Word Integers to Doubleword Integers with Sign Extension. +// +// Forms: +// +// PMOVSXWD xmm xmm +// PMOVSXWD m64 xmm +// Construct and append a PMOVSXWD instruction to the active function. +func (c *Context) PMOVSXWD(mx, x operand.Op) { + if inst, err := x86.PMOVSXWD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMOVSXWD: Move Packed Word Integers to Doubleword Integers with Sign Extension. +// +// Forms: +// +// PMOVSXWD xmm xmm +// PMOVSXWD m64 xmm +// Construct and append a PMOVSXWD instruction to the active function. +// Operates on the global context. +func PMOVSXWD(mx, x operand.Op) { ctx.PMOVSXWD(mx, x) } + +// PMOVSXWQ: Move Packed Word Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// PMOVSXWQ xmm xmm +// PMOVSXWQ m32 xmm +// Construct and append a PMOVSXWQ instruction to the active function. +func (c *Context) PMOVSXWQ(mx, x operand.Op) { + if inst, err := x86.PMOVSXWQ(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMOVSXWQ: Move Packed Word Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// PMOVSXWQ xmm xmm +// PMOVSXWQ m32 xmm +// Construct and append a PMOVSXWQ instruction to the active function. +// Operates on the global context. +func PMOVSXWQ(mx, x operand.Op) { ctx.PMOVSXWQ(mx, x) } + +// PMOVZXBD: Move Packed Byte Integers to Doubleword Integers with Zero Extension. +// +// Forms: +// +// PMOVZXBD xmm xmm +// PMOVZXBD m32 xmm +// Construct and append a PMOVZXBD instruction to the active function. +func (c *Context) PMOVZXBD(mx, x operand.Op) { + if inst, err := x86.PMOVZXBD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMOVZXBD: Move Packed Byte Integers to Doubleword Integers with Zero Extension. +// +// Forms: +// +// PMOVZXBD xmm xmm +// PMOVZXBD m32 xmm +// Construct and append a PMOVZXBD instruction to the active function. +// Operates on the global context. +func PMOVZXBD(mx, x operand.Op) { ctx.PMOVZXBD(mx, x) } + +// PMOVZXBQ: Move Packed Byte Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// PMOVZXBQ xmm xmm +// PMOVZXBQ m16 xmm +// Construct and append a PMOVZXBQ instruction to the active function. +func (c *Context) PMOVZXBQ(mx, x operand.Op) { + if inst, err := x86.PMOVZXBQ(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMOVZXBQ: Move Packed Byte Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// PMOVZXBQ xmm xmm +// PMOVZXBQ m16 xmm +// Construct and append a PMOVZXBQ instruction to the active function. +// Operates on the global context. +func PMOVZXBQ(mx, x operand.Op) { ctx.PMOVZXBQ(mx, x) } + +// PMOVZXBW: Move Packed Byte Integers to Word Integers with Zero Extension. +// +// Forms: +// +// PMOVZXBW xmm xmm +// PMOVZXBW m64 xmm +// Construct and append a PMOVZXBW instruction to the active function. +func (c *Context) PMOVZXBW(mx, x operand.Op) { + if inst, err := x86.PMOVZXBW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMOVZXBW: Move Packed Byte Integers to Word Integers with Zero Extension. +// +// Forms: +// +// PMOVZXBW xmm xmm +// PMOVZXBW m64 xmm +// Construct and append a PMOVZXBW instruction to the active function. +// Operates on the global context. +func PMOVZXBW(mx, x operand.Op) { ctx.PMOVZXBW(mx, x) } + +// PMOVZXDQ: Move Packed Doubleword Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// PMOVZXDQ xmm xmm +// PMOVZXDQ m64 xmm +// Construct and append a PMOVZXDQ instruction to the active function. +func (c *Context) PMOVZXDQ(mx, x operand.Op) { + if inst, err := x86.PMOVZXDQ(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMOVZXDQ: Move Packed Doubleword Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// PMOVZXDQ xmm xmm +// PMOVZXDQ m64 xmm +// Construct and append a PMOVZXDQ instruction to the active function. +// Operates on the global context. +func PMOVZXDQ(mx, x operand.Op) { ctx.PMOVZXDQ(mx, x) } + +// PMOVZXWD: Move Packed Word Integers to Doubleword Integers with Zero Extension. +// +// Forms: +// +// PMOVZXWD xmm xmm +// PMOVZXWD m64 xmm +// Construct and append a PMOVZXWD instruction to the active function. +func (c *Context) PMOVZXWD(mx, x operand.Op) { + if inst, err := x86.PMOVZXWD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMOVZXWD: Move Packed Word Integers to Doubleword Integers with Zero Extension. +// +// Forms: +// +// PMOVZXWD xmm xmm +// PMOVZXWD m64 xmm +// Construct and append a PMOVZXWD instruction to the active function. +// Operates on the global context. +func PMOVZXWD(mx, x operand.Op) { ctx.PMOVZXWD(mx, x) } + +// PMOVZXWQ: Move Packed Word Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// PMOVZXWQ xmm xmm +// PMOVZXWQ m32 xmm +// Construct and append a PMOVZXWQ instruction to the active function. +func (c *Context) PMOVZXWQ(mx, x operand.Op) { + if inst, err := x86.PMOVZXWQ(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMOVZXWQ: Move Packed Word Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// PMOVZXWQ xmm xmm +// PMOVZXWQ m32 xmm +// Construct and append a PMOVZXWQ instruction to the active function. +// Operates on the global context. +func PMOVZXWQ(mx, x operand.Op) { ctx.PMOVZXWQ(mx, x) } + +// PMULDQ: Multiply Packed Signed Doubleword Integers and Store Quadword Result. +// +// Forms: +// +// PMULDQ xmm xmm +// PMULDQ m128 xmm +// Construct and append a PMULDQ instruction to the active function. +func (c *Context) PMULDQ(mx, x operand.Op) { + if inst, err := x86.PMULDQ(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMULDQ: Multiply Packed Signed Doubleword Integers and Store Quadword Result. +// +// Forms: +// +// PMULDQ xmm xmm +// PMULDQ m128 xmm +// Construct and append a PMULDQ instruction to the active function. +// Operates on the global context. +func PMULDQ(mx, x operand.Op) { ctx.PMULDQ(mx, x) } + +// PMULHRSW: Packed Multiply Signed Word Integers and Store High Result with Round and Scale. +// +// Forms: +// +// PMULHRSW xmm xmm +// PMULHRSW m128 xmm +// Construct and append a PMULHRSW instruction to the active function. +func (c *Context) PMULHRSW(mx, x operand.Op) { + if inst, err := x86.PMULHRSW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMULHRSW: Packed Multiply Signed Word Integers and Store High Result with Round and Scale. +// +// Forms: +// +// PMULHRSW xmm xmm +// PMULHRSW m128 xmm +// Construct and append a PMULHRSW instruction to the active function. +// Operates on the global context. +func PMULHRSW(mx, x operand.Op) { ctx.PMULHRSW(mx, x) } + +// PMULHUW: Multiply Packed Unsigned Word Integers and Store High Result. +// +// Forms: +// +// PMULHUW xmm xmm +// PMULHUW m128 xmm +// Construct and append a PMULHUW instruction to the active function. +func (c *Context) PMULHUW(mx, x operand.Op) { + if inst, err := x86.PMULHUW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMULHUW: Multiply Packed Unsigned Word Integers and Store High Result. +// +// Forms: +// +// PMULHUW xmm xmm +// PMULHUW m128 xmm +// Construct and append a PMULHUW instruction to the active function. +// Operates on the global context. +func PMULHUW(mx, x operand.Op) { ctx.PMULHUW(mx, x) } + +// PMULHW: Multiply Packed Signed Word Integers and Store High Result. +// +// Forms: +// +// PMULHW xmm xmm +// PMULHW m128 xmm +// Construct and append a PMULHW instruction to the active function. +func (c *Context) PMULHW(mx, x operand.Op) { + if inst, err := x86.PMULHW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMULHW: Multiply Packed Signed Word Integers and Store High Result. +// +// Forms: +// +// PMULHW xmm xmm +// PMULHW m128 xmm +// Construct and append a PMULHW instruction to the active function. +// Operates on the global context. +func PMULHW(mx, x operand.Op) { ctx.PMULHW(mx, x) } + +// PMULLD: Multiply Packed Signed Doubleword Integers and Store Low Result. +// +// Forms: +// +// PMULLD xmm xmm +// PMULLD m128 xmm +// Construct and append a PMULLD instruction to the active function. +func (c *Context) PMULLD(mx, x operand.Op) { + if inst, err := x86.PMULLD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMULLD: Multiply Packed Signed Doubleword Integers and Store Low Result. +// +// Forms: +// +// PMULLD xmm xmm +// PMULLD m128 xmm +// Construct and append a PMULLD instruction to the active function. +// Operates on the global context. +func PMULLD(mx, x operand.Op) { ctx.PMULLD(mx, x) } + +// PMULLW: Multiply Packed Signed Word Integers and Store Low Result. +// +// Forms: +// +// PMULLW xmm xmm +// PMULLW m128 xmm +// Construct and append a PMULLW instruction to the active function. +func (c *Context) PMULLW(mx, x operand.Op) { + if inst, err := x86.PMULLW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMULLW: Multiply Packed Signed Word Integers and Store Low Result. +// +// Forms: +// +// PMULLW xmm xmm +// PMULLW m128 xmm +// Construct and append a PMULLW instruction to the active function. +// Operates on the global context. +func PMULLW(mx, x operand.Op) { ctx.PMULLW(mx, x) } + +// PMULULQ: Multiply Packed Unsigned Doubleword Integers. +// +// Forms: +// +// PMULULQ xmm xmm +// PMULULQ m128 xmm +// Construct and append a PMULULQ instruction to the active function. +func (c *Context) PMULULQ(mx, x operand.Op) { + if inst, err := x86.PMULULQ(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PMULULQ: Multiply Packed Unsigned Doubleword Integers. +// +// Forms: +// +// PMULULQ xmm xmm +// PMULULQ m128 xmm +// Construct and append a PMULULQ instruction to the active function. +// Operates on the global context. +func PMULULQ(mx, x operand.Op) { ctx.PMULULQ(mx, x) } + +// POPCNTL: Count of Number of Bits Set to 1. +// +// Forms: +// +// POPCNTL r32 r32 +// POPCNTL m32 r32 +// Construct and append a POPCNTL instruction to the active function. +func (c *Context) POPCNTL(mr, r operand.Op) { + if inst, err := x86.POPCNTL(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// POPCNTL: Count of Number of Bits Set to 1. +// +// Forms: +// +// POPCNTL r32 r32 +// POPCNTL m32 r32 +// Construct and append a POPCNTL instruction to the active function. +// Operates on the global context. +func POPCNTL(mr, r operand.Op) { ctx.POPCNTL(mr, r) } + +// POPCNTQ: Count of Number of Bits Set to 1. +// +// Forms: +// +// POPCNTQ r64 r64 +// POPCNTQ m64 r64 +// Construct and append a POPCNTQ instruction to the active function. +func (c *Context) POPCNTQ(mr, r operand.Op) { + if inst, err := x86.POPCNTQ(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// POPCNTQ: Count of Number of Bits Set to 1. +// +// Forms: +// +// POPCNTQ r64 r64 +// POPCNTQ m64 r64 +// Construct and append a POPCNTQ instruction to the active function. +// Operates on the global context. +func POPCNTQ(mr, r operand.Op) { ctx.POPCNTQ(mr, r) } + +// POPCNTW: Count of Number of Bits Set to 1. +// +// Forms: +// +// POPCNTW r16 r16 +// POPCNTW m16 r16 +// Construct and append a POPCNTW instruction to the active function. +func (c *Context) POPCNTW(mr, r operand.Op) { + if inst, err := x86.POPCNTW(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// POPCNTW: Count of Number of Bits Set to 1. +// +// Forms: +// +// POPCNTW r16 r16 +// POPCNTW m16 r16 +// Construct and append a POPCNTW instruction to the active function. +// Operates on the global context. +func POPCNTW(mr, r operand.Op) { ctx.POPCNTW(mr, r) } + +// POPQ: Pop a Value from the Stack. +// +// Forms: +// +// POPQ r64 +// POPQ m64 +// Construct and append a POPQ instruction to the active function. +func (c *Context) POPQ(mr operand.Op) { + if inst, err := x86.POPQ(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// POPQ: Pop a Value from the Stack. +// +// Forms: +// +// POPQ r64 +// POPQ m64 +// Construct and append a POPQ instruction to the active function. +// Operates on the global context. +func POPQ(mr operand.Op) { ctx.POPQ(mr) } + +// POPW: Pop a Value from the Stack. +// +// Forms: +// +// POPW r16 +// POPW m16 +// Construct and append a POPW instruction to the active function. +func (c *Context) POPW(mr operand.Op) { + if inst, err := x86.POPW(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// POPW: Pop a Value from the Stack. +// +// Forms: +// +// POPW r16 +// POPW m16 +// Construct and append a POPW instruction to the active function. +// Operates on the global context. +func POPW(mr operand.Op) { ctx.POPW(mr) } + +// POR: Packed Bitwise Logical OR. +// +// Forms: +// +// POR xmm xmm +// POR m128 xmm +// Construct and append a POR instruction to the active function. +func (c *Context) POR(mx, x operand.Op) { + if inst, err := x86.POR(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// POR: Packed Bitwise Logical OR. +// +// Forms: +// +// POR xmm xmm +// POR m128 xmm +// Construct and append a POR instruction to the active function. +// Operates on the global context. +func POR(mx, x operand.Op) { ctx.POR(mx, x) } + +// PREFETCHNTA: Prefetch Data Into Caches using NTA Hint. +// +// Forms: +// +// PREFETCHNTA m8 +// Construct and append a PREFETCHNTA instruction to the active function. +func (c *Context) PREFETCHNTA(m operand.Op) { + if inst, err := x86.PREFETCHNTA(m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PREFETCHNTA: Prefetch Data Into Caches using NTA Hint. +// +// Forms: +// +// PREFETCHNTA m8 +// Construct and append a PREFETCHNTA instruction to the active function. +// Operates on the global context. +func PREFETCHNTA(m operand.Op) { ctx.PREFETCHNTA(m) } + +// PREFETCHT0: Prefetch Data Into Caches using T0 Hint. +// +// Forms: +// +// PREFETCHT0 m8 +// Construct and append a PREFETCHT0 instruction to the active function. +func (c *Context) PREFETCHT0(m operand.Op) { + if inst, err := x86.PREFETCHT0(m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PREFETCHT0: Prefetch Data Into Caches using T0 Hint. +// +// Forms: +// +// PREFETCHT0 m8 +// Construct and append a PREFETCHT0 instruction to the active function. +// Operates on the global context. +func PREFETCHT0(m operand.Op) { ctx.PREFETCHT0(m) } + +// PREFETCHT1: Prefetch Data Into Caches using T1 Hint. +// +// Forms: +// +// PREFETCHT1 m8 +// Construct and append a PREFETCHT1 instruction to the active function. +func (c *Context) PREFETCHT1(m operand.Op) { + if inst, err := x86.PREFETCHT1(m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PREFETCHT1: Prefetch Data Into Caches using T1 Hint. +// +// Forms: +// +// PREFETCHT1 m8 +// Construct and append a PREFETCHT1 instruction to the active function. +// Operates on the global context. +func PREFETCHT1(m operand.Op) { ctx.PREFETCHT1(m) } + +// PREFETCHT2: Prefetch Data Into Caches using T2 Hint. +// +// Forms: +// +// PREFETCHT2 m8 +// Construct and append a PREFETCHT2 instruction to the active function. +func (c *Context) PREFETCHT2(m operand.Op) { + if inst, err := x86.PREFETCHT2(m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PREFETCHT2: Prefetch Data Into Caches using T2 Hint. +// +// Forms: +// +// PREFETCHT2 m8 +// Construct and append a PREFETCHT2 instruction to the active function. +// Operates on the global context. +func PREFETCHT2(m operand.Op) { ctx.PREFETCHT2(m) } + +// PSADBW: Compute Sum of Absolute Differences. +// +// Forms: +// +// PSADBW xmm xmm +// PSADBW m128 xmm +// Construct and append a PSADBW instruction to the active function. +func (c *Context) PSADBW(mx, x operand.Op) { + if inst, err := x86.PSADBW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSADBW: Compute Sum of Absolute Differences. +// +// Forms: +// +// PSADBW xmm xmm +// PSADBW m128 xmm +// Construct and append a PSADBW instruction to the active function. +// Operates on the global context. +func PSADBW(mx, x operand.Op) { ctx.PSADBW(mx, x) } + +// PSHUFB: Packed Shuffle Bytes. +// +// Forms: +// +// PSHUFB xmm xmm +// PSHUFB m128 xmm +// Construct and append a PSHUFB instruction to the active function. +func (c *Context) PSHUFB(mx, x operand.Op) { + if inst, err := x86.PSHUFB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSHUFB: Packed Shuffle Bytes. +// +// Forms: +// +// PSHUFB xmm xmm +// PSHUFB m128 xmm +// Construct and append a PSHUFB instruction to the active function. +// Operates on the global context. +func PSHUFB(mx, x operand.Op) { ctx.PSHUFB(mx, x) } + +// PSHUFD: Shuffle Packed Doublewords. +// +// Forms: +// +// PSHUFD imm8 xmm xmm +// PSHUFD imm8 m128 xmm +// Construct and append a PSHUFD instruction to the active function. +func (c *Context) PSHUFD(i, mx, x operand.Op) { + if inst, err := x86.PSHUFD(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSHUFD: Shuffle Packed Doublewords. +// +// Forms: +// +// PSHUFD imm8 xmm xmm +// PSHUFD imm8 m128 xmm +// Construct and append a PSHUFD instruction to the active function. +// Operates on the global context. +func PSHUFD(i, mx, x operand.Op) { ctx.PSHUFD(i, mx, x) } + +// PSHUFHW: Shuffle Packed High Words. +// +// Forms: +// +// PSHUFHW imm8 xmm xmm +// PSHUFHW imm8 m128 xmm +// Construct and append a PSHUFHW instruction to the active function. +func (c *Context) PSHUFHW(i, mx, x operand.Op) { + if inst, err := x86.PSHUFHW(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSHUFHW: Shuffle Packed High Words. +// +// Forms: +// +// PSHUFHW imm8 xmm xmm +// PSHUFHW imm8 m128 xmm +// Construct and append a PSHUFHW instruction to the active function. +// Operates on the global context. +func PSHUFHW(i, mx, x operand.Op) { ctx.PSHUFHW(i, mx, x) } + +// PSHUFL: Shuffle Packed Doublewords. +// +// Forms: +// +// PSHUFL imm8 xmm xmm +// PSHUFL imm8 m128 xmm +// Construct and append a PSHUFL instruction to the active function. +func (c *Context) PSHUFL(i, mx, x operand.Op) { + if inst, err := x86.PSHUFL(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSHUFL: Shuffle Packed Doublewords. +// +// Forms: +// +// PSHUFL imm8 xmm xmm +// PSHUFL imm8 m128 xmm +// Construct and append a PSHUFL instruction to the active function. +// Operates on the global context. +func PSHUFL(i, mx, x operand.Op) { ctx.PSHUFL(i, mx, x) } + +// PSHUFLW: Shuffle Packed Low Words. +// +// Forms: +// +// PSHUFLW imm8 xmm xmm +// PSHUFLW imm8 m128 xmm +// Construct and append a PSHUFLW instruction to the active function. +func (c *Context) PSHUFLW(i, mx, x operand.Op) { + if inst, err := x86.PSHUFLW(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSHUFLW: Shuffle Packed Low Words. +// +// Forms: +// +// PSHUFLW imm8 xmm xmm +// PSHUFLW imm8 m128 xmm +// Construct and append a PSHUFLW instruction to the active function. +// Operates on the global context. +func PSHUFLW(i, mx, x operand.Op) { ctx.PSHUFLW(i, mx, x) } + +// PSIGNB: Packed Sign of Byte Integers. +// +// Forms: +// +// PSIGNB xmm xmm +// PSIGNB m128 xmm +// Construct and append a PSIGNB instruction to the active function. +func (c *Context) PSIGNB(mx, x operand.Op) { + if inst, err := x86.PSIGNB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSIGNB: Packed Sign of Byte Integers. +// +// Forms: +// +// PSIGNB xmm xmm +// PSIGNB m128 xmm +// Construct and append a PSIGNB instruction to the active function. +// Operates on the global context. +func PSIGNB(mx, x operand.Op) { ctx.PSIGNB(mx, x) } + +// PSIGND: Packed Sign of Doubleword Integers. +// +// Forms: +// +// PSIGND xmm xmm +// PSIGND m128 xmm +// Construct and append a PSIGND instruction to the active function. +func (c *Context) PSIGND(mx, x operand.Op) { + if inst, err := x86.PSIGND(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSIGND: Packed Sign of Doubleword Integers. +// +// Forms: +// +// PSIGND xmm xmm +// PSIGND m128 xmm +// Construct and append a PSIGND instruction to the active function. +// Operates on the global context. +func PSIGND(mx, x operand.Op) { ctx.PSIGND(mx, x) } + +// PSIGNW: Packed Sign of Word Integers. +// +// Forms: +// +// PSIGNW xmm xmm +// PSIGNW m128 xmm +// Construct and append a PSIGNW instruction to the active function. +func (c *Context) PSIGNW(mx, x operand.Op) { + if inst, err := x86.PSIGNW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSIGNW: Packed Sign of Word Integers. +// +// Forms: +// +// PSIGNW xmm xmm +// PSIGNW m128 xmm +// Construct and append a PSIGNW instruction to the active function. +// Operates on the global context. +func PSIGNW(mx, x operand.Op) { ctx.PSIGNW(mx, x) } + +// PSLLDQ: Shift Packed Double Quadword Left Logical. +// +// Forms: +// +// PSLLDQ imm8 xmm +// Construct and append a PSLLDQ instruction to the active function. +func (c *Context) PSLLDQ(i, x operand.Op) { + if inst, err := x86.PSLLDQ(i, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSLLDQ: Shift Packed Double Quadword Left Logical. +// +// Forms: +// +// PSLLDQ imm8 xmm +// Construct and append a PSLLDQ instruction to the active function. +// Operates on the global context. +func PSLLDQ(i, x operand.Op) { ctx.PSLLDQ(i, x) } + +// PSLLL: Shift Packed Doubleword Data Left Logical. +// +// Forms: +// +// PSLLL imm8 xmm +// PSLLL xmm xmm +// PSLLL m128 xmm +// Construct and append a PSLLL instruction to the active function. +func (c *Context) PSLLL(imx, x operand.Op) { + if inst, err := x86.PSLLL(imx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSLLL: Shift Packed Doubleword Data Left Logical. +// +// Forms: +// +// PSLLL imm8 xmm +// PSLLL xmm xmm +// PSLLL m128 xmm +// Construct and append a PSLLL instruction to the active function. +// Operates on the global context. +func PSLLL(imx, x operand.Op) { ctx.PSLLL(imx, x) } + +// PSLLO: Shift Packed Double Quadword Left Logical. +// +// Forms: +// +// PSLLO imm8 xmm +// Construct and append a PSLLO instruction to the active function. +func (c *Context) PSLLO(i, x operand.Op) { + if inst, err := x86.PSLLO(i, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSLLO: Shift Packed Double Quadword Left Logical. +// +// Forms: +// +// PSLLO imm8 xmm +// Construct and append a PSLLO instruction to the active function. +// Operates on the global context. +func PSLLO(i, x operand.Op) { ctx.PSLLO(i, x) } + +// PSLLQ: Shift Packed Quadword Data Left Logical. +// +// Forms: +// +// PSLLQ imm8 xmm +// PSLLQ xmm xmm +// PSLLQ m128 xmm +// Construct and append a PSLLQ instruction to the active function. +func (c *Context) PSLLQ(imx, x operand.Op) { + if inst, err := x86.PSLLQ(imx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSLLQ: Shift Packed Quadword Data Left Logical. +// +// Forms: +// +// PSLLQ imm8 xmm +// PSLLQ xmm xmm +// PSLLQ m128 xmm +// Construct and append a PSLLQ instruction to the active function. +// Operates on the global context. +func PSLLQ(imx, x operand.Op) { ctx.PSLLQ(imx, x) } + +// PSLLW: Shift Packed Word Data Left Logical. +// +// Forms: +// +// PSLLW imm8 xmm +// PSLLW xmm xmm +// PSLLW m128 xmm +// Construct and append a PSLLW instruction to the active function. +func (c *Context) PSLLW(imx, x operand.Op) { + if inst, err := x86.PSLLW(imx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSLLW: Shift Packed Word Data Left Logical. +// +// Forms: +// +// PSLLW imm8 xmm +// PSLLW xmm xmm +// PSLLW m128 xmm +// Construct and append a PSLLW instruction to the active function. +// Operates on the global context. +func PSLLW(imx, x operand.Op) { ctx.PSLLW(imx, x) } + +// PSRAL: Shift Packed Doubleword Data Right Arithmetic. +// +// Forms: +// +// PSRAL imm8 xmm +// PSRAL xmm xmm +// PSRAL m128 xmm +// Construct and append a PSRAL instruction to the active function. +func (c *Context) PSRAL(imx, x operand.Op) { + if inst, err := x86.PSRAL(imx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSRAL: Shift Packed Doubleword Data Right Arithmetic. +// +// Forms: +// +// PSRAL imm8 xmm +// PSRAL xmm xmm +// PSRAL m128 xmm +// Construct and append a PSRAL instruction to the active function. +// Operates on the global context. +func PSRAL(imx, x operand.Op) { ctx.PSRAL(imx, x) } + +// PSRAW: Shift Packed Word Data Right Arithmetic. +// +// Forms: +// +// PSRAW imm8 xmm +// PSRAW xmm xmm +// PSRAW m128 xmm +// Construct and append a PSRAW instruction to the active function. +func (c *Context) PSRAW(imx, x operand.Op) { + if inst, err := x86.PSRAW(imx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSRAW: Shift Packed Word Data Right Arithmetic. +// +// Forms: +// +// PSRAW imm8 xmm +// PSRAW xmm xmm +// PSRAW m128 xmm +// Construct and append a PSRAW instruction to the active function. +// Operates on the global context. +func PSRAW(imx, x operand.Op) { ctx.PSRAW(imx, x) } + +// PSRLDQ: Shift Packed Double Quadword Right Logical. +// +// Forms: +// +// PSRLDQ imm8 xmm +// Construct and append a PSRLDQ instruction to the active function. +func (c *Context) PSRLDQ(i, x operand.Op) { + if inst, err := x86.PSRLDQ(i, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSRLDQ: Shift Packed Double Quadword Right Logical. +// +// Forms: +// +// PSRLDQ imm8 xmm +// Construct and append a PSRLDQ instruction to the active function. +// Operates on the global context. +func PSRLDQ(i, x operand.Op) { ctx.PSRLDQ(i, x) } + +// PSRLL: Shift Packed Doubleword Data Right Logical. +// +// Forms: +// +// PSRLL imm8 xmm +// PSRLL xmm xmm +// PSRLL m128 xmm +// Construct and append a PSRLL instruction to the active function. +func (c *Context) PSRLL(imx, x operand.Op) { + if inst, err := x86.PSRLL(imx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSRLL: Shift Packed Doubleword Data Right Logical. +// +// Forms: +// +// PSRLL imm8 xmm +// PSRLL xmm xmm +// PSRLL m128 xmm +// Construct and append a PSRLL instruction to the active function. +// Operates on the global context. +func PSRLL(imx, x operand.Op) { ctx.PSRLL(imx, x) } + +// PSRLO: Shift Packed Double Quadword Right Logical. +// +// Forms: +// +// PSRLO imm8 xmm +// Construct and append a PSRLO instruction to the active function. +func (c *Context) PSRLO(i, x operand.Op) { + if inst, err := x86.PSRLO(i, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSRLO: Shift Packed Double Quadword Right Logical. +// +// Forms: +// +// PSRLO imm8 xmm +// Construct and append a PSRLO instruction to the active function. +// Operates on the global context. +func PSRLO(i, x operand.Op) { ctx.PSRLO(i, x) } + +// PSRLQ: Shift Packed Quadword Data Right Logical. +// +// Forms: +// +// PSRLQ imm8 xmm +// PSRLQ xmm xmm +// PSRLQ m128 xmm +// Construct and append a PSRLQ instruction to the active function. +func (c *Context) PSRLQ(imx, x operand.Op) { + if inst, err := x86.PSRLQ(imx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSRLQ: Shift Packed Quadword Data Right Logical. +// +// Forms: +// +// PSRLQ imm8 xmm +// PSRLQ xmm xmm +// PSRLQ m128 xmm +// Construct and append a PSRLQ instruction to the active function. +// Operates on the global context. +func PSRLQ(imx, x operand.Op) { ctx.PSRLQ(imx, x) } + +// PSRLW: Shift Packed Word Data Right Logical. +// +// Forms: +// +// PSRLW imm8 xmm +// PSRLW xmm xmm +// PSRLW m128 xmm +// Construct and append a PSRLW instruction to the active function. +func (c *Context) PSRLW(imx, x operand.Op) { + if inst, err := x86.PSRLW(imx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSRLW: Shift Packed Word Data Right Logical. +// +// Forms: +// +// PSRLW imm8 xmm +// PSRLW xmm xmm +// PSRLW m128 xmm +// Construct and append a PSRLW instruction to the active function. +// Operates on the global context. +func PSRLW(imx, x operand.Op) { ctx.PSRLW(imx, x) } + +// PSUBB: Subtract Packed Byte Integers. +// +// Forms: +// +// PSUBB xmm xmm +// PSUBB m128 xmm +// Construct and append a PSUBB instruction to the active function. +func (c *Context) PSUBB(mx, x operand.Op) { + if inst, err := x86.PSUBB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSUBB: Subtract Packed Byte Integers. +// +// Forms: +// +// PSUBB xmm xmm +// PSUBB m128 xmm +// Construct and append a PSUBB instruction to the active function. +// Operates on the global context. +func PSUBB(mx, x operand.Op) { ctx.PSUBB(mx, x) } + +// PSUBL: Subtract Packed Doubleword Integers. +// +// Forms: +// +// PSUBL xmm xmm +// PSUBL m128 xmm +// Construct and append a PSUBL instruction to the active function. +func (c *Context) PSUBL(mx, x operand.Op) { + if inst, err := x86.PSUBL(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSUBL: Subtract Packed Doubleword Integers. +// +// Forms: +// +// PSUBL xmm xmm +// PSUBL m128 xmm +// Construct and append a PSUBL instruction to the active function. +// Operates on the global context. +func PSUBL(mx, x operand.Op) { ctx.PSUBL(mx, x) } + +// PSUBQ: Subtract Packed Quadword Integers. +// +// Forms: +// +// PSUBQ xmm xmm +// PSUBQ m128 xmm +// Construct and append a PSUBQ instruction to the active function. +func (c *Context) PSUBQ(mx, x operand.Op) { + if inst, err := x86.PSUBQ(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSUBQ: Subtract Packed Quadword Integers. +// +// Forms: +// +// PSUBQ xmm xmm +// PSUBQ m128 xmm +// Construct and append a PSUBQ instruction to the active function. +// Operates on the global context. +func PSUBQ(mx, x operand.Op) { ctx.PSUBQ(mx, x) } + +// PSUBSB: Subtract Packed Signed Byte Integers with Signed Saturation. +// +// Forms: +// +// PSUBSB xmm xmm +// PSUBSB m128 xmm +// Construct and append a PSUBSB instruction to the active function. +func (c *Context) PSUBSB(mx, x operand.Op) { + if inst, err := x86.PSUBSB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSUBSB: Subtract Packed Signed Byte Integers with Signed Saturation. +// +// Forms: +// +// PSUBSB xmm xmm +// PSUBSB m128 xmm +// Construct and append a PSUBSB instruction to the active function. +// Operates on the global context. +func PSUBSB(mx, x operand.Op) { ctx.PSUBSB(mx, x) } + +// PSUBSW: Subtract Packed Signed Word Integers with Signed Saturation. +// +// Forms: +// +// PSUBSW xmm xmm +// PSUBSW m128 xmm +// Construct and append a PSUBSW instruction to the active function. +func (c *Context) PSUBSW(mx, x operand.Op) { + if inst, err := x86.PSUBSW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSUBSW: Subtract Packed Signed Word Integers with Signed Saturation. +// +// Forms: +// +// PSUBSW xmm xmm +// PSUBSW m128 xmm +// Construct and append a PSUBSW instruction to the active function. +// Operates on the global context. +func PSUBSW(mx, x operand.Op) { ctx.PSUBSW(mx, x) } + +// PSUBUSB: Subtract Packed Unsigned Byte Integers with Unsigned Saturation. +// +// Forms: +// +// PSUBUSB xmm xmm +// PSUBUSB m128 xmm +// Construct and append a PSUBUSB instruction to the active function. +func (c *Context) PSUBUSB(mx, x operand.Op) { + if inst, err := x86.PSUBUSB(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSUBUSB: Subtract Packed Unsigned Byte Integers with Unsigned Saturation. +// +// Forms: +// +// PSUBUSB xmm xmm +// PSUBUSB m128 xmm +// Construct and append a PSUBUSB instruction to the active function. +// Operates on the global context. +func PSUBUSB(mx, x operand.Op) { ctx.PSUBUSB(mx, x) } + +// PSUBUSW: Subtract Packed Unsigned Word Integers with Unsigned Saturation. +// +// Forms: +// +// PSUBUSW xmm xmm +// PSUBUSW m128 xmm +// Construct and append a PSUBUSW instruction to the active function. +func (c *Context) PSUBUSW(mx, x operand.Op) { + if inst, err := x86.PSUBUSW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSUBUSW: Subtract Packed Unsigned Word Integers with Unsigned Saturation. +// +// Forms: +// +// PSUBUSW xmm xmm +// PSUBUSW m128 xmm +// Construct and append a PSUBUSW instruction to the active function. +// Operates on the global context. +func PSUBUSW(mx, x operand.Op) { ctx.PSUBUSW(mx, x) } + +// PSUBW: Subtract Packed Word Integers. +// +// Forms: +// +// PSUBW xmm xmm +// PSUBW m128 xmm +// Construct and append a PSUBW instruction to the active function. +func (c *Context) PSUBW(mx, x operand.Op) { + if inst, err := x86.PSUBW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PSUBW: Subtract Packed Word Integers. +// +// Forms: +// +// PSUBW xmm xmm +// PSUBW m128 xmm +// Construct and append a PSUBW instruction to the active function. +// Operates on the global context. +func PSUBW(mx, x operand.Op) { ctx.PSUBW(mx, x) } + +// PTEST: Packed Logical Compare. +// +// Forms: +// +// PTEST xmm xmm +// PTEST m128 xmm +// Construct and append a PTEST instruction to the active function. +func (c *Context) PTEST(mx, x operand.Op) { + if inst, err := x86.PTEST(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PTEST: Packed Logical Compare. +// +// Forms: +// +// PTEST xmm xmm +// PTEST m128 xmm +// Construct and append a PTEST instruction to the active function. +// Operates on the global context. +func PTEST(mx, x operand.Op) { ctx.PTEST(mx, x) } + +// PUNPCKHBW: Unpack and Interleave High-Order Bytes into Words. +// +// Forms: +// +// PUNPCKHBW xmm xmm +// PUNPCKHBW m128 xmm +// Construct and append a PUNPCKHBW instruction to the active function. +func (c *Context) PUNPCKHBW(mx, x operand.Op) { + if inst, err := x86.PUNPCKHBW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PUNPCKHBW: Unpack and Interleave High-Order Bytes into Words. +// +// Forms: +// +// PUNPCKHBW xmm xmm +// PUNPCKHBW m128 xmm +// Construct and append a PUNPCKHBW instruction to the active function. +// Operates on the global context. +func PUNPCKHBW(mx, x operand.Op) { ctx.PUNPCKHBW(mx, x) } + +// PUNPCKHLQ: Unpack and Interleave High-Order Doublewords into Quadwords. +// +// Forms: +// +// PUNPCKHLQ xmm xmm +// PUNPCKHLQ m128 xmm +// Construct and append a PUNPCKHLQ instruction to the active function. +func (c *Context) PUNPCKHLQ(mx, x operand.Op) { + if inst, err := x86.PUNPCKHLQ(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PUNPCKHLQ: Unpack and Interleave High-Order Doublewords into Quadwords. +// +// Forms: +// +// PUNPCKHLQ xmm xmm +// PUNPCKHLQ m128 xmm +// Construct and append a PUNPCKHLQ instruction to the active function. +// Operates on the global context. +func PUNPCKHLQ(mx, x operand.Op) { ctx.PUNPCKHLQ(mx, x) } + +// PUNPCKHQDQ: Unpack and Interleave High-Order Quadwords into Double Quadwords. +// +// Forms: +// +// PUNPCKHQDQ xmm xmm +// PUNPCKHQDQ m128 xmm +// Construct and append a PUNPCKHQDQ instruction to the active function. +func (c *Context) PUNPCKHQDQ(mx, x operand.Op) { + if inst, err := x86.PUNPCKHQDQ(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PUNPCKHQDQ: Unpack and Interleave High-Order Quadwords into Double Quadwords. +// +// Forms: +// +// PUNPCKHQDQ xmm xmm +// PUNPCKHQDQ m128 xmm +// Construct and append a PUNPCKHQDQ instruction to the active function. +// Operates on the global context. +func PUNPCKHQDQ(mx, x operand.Op) { ctx.PUNPCKHQDQ(mx, x) } + +// PUNPCKHWL: Unpack and Interleave High-Order Words into Doublewords. +// +// Forms: +// +// PUNPCKHWL xmm xmm +// PUNPCKHWL m128 xmm +// Construct and append a PUNPCKHWL instruction to the active function. +func (c *Context) PUNPCKHWL(mx, x operand.Op) { + if inst, err := x86.PUNPCKHWL(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PUNPCKHWL: Unpack and Interleave High-Order Words into Doublewords. +// +// Forms: +// +// PUNPCKHWL xmm xmm +// PUNPCKHWL m128 xmm +// Construct and append a PUNPCKHWL instruction to the active function. +// Operates on the global context. +func PUNPCKHWL(mx, x operand.Op) { ctx.PUNPCKHWL(mx, x) } + +// PUNPCKLBW: Unpack and Interleave Low-Order Bytes into Words. +// +// Forms: +// +// PUNPCKLBW xmm xmm +// PUNPCKLBW m128 xmm +// Construct and append a PUNPCKLBW instruction to the active function. +func (c *Context) PUNPCKLBW(mx, x operand.Op) { + if inst, err := x86.PUNPCKLBW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PUNPCKLBW: Unpack and Interleave Low-Order Bytes into Words. +// +// Forms: +// +// PUNPCKLBW xmm xmm +// PUNPCKLBW m128 xmm +// Construct and append a PUNPCKLBW instruction to the active function. +// Operates on the global context. +func PUNPCKLBW(mx, x operand.Op) { ctx.PUNPCKLBW(mx, x) } + +// PUNPCKLLQ: Unpack and Interleave Low-Order Doublewords into Quadwords. +// +// Forms: +// +// PUNPCKLLQ xmm xmm +// PUNPCKLLQ m128 xmm +// Construct and append a PUNPCKLLQ instruction to the active function. +func (c *Context) PUNPCKLLQ(mx, x operand.Op) { + if inst, err := x86.PUNPCKLLQ(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PUNPCKLLQ: Unpack and Interleave Low-Order Doublewords into Quadwords. +// +// Forms: +// +// PUNPCKLLQ xmm xmm +// PUNPCKLLQ m128 xmm +// Construct and append a PUNPCKLLQ instruction to the active function. +// Operates on the global context. +func PUNPCKLLQ(mx, x operand.Op) { ctx.PUNPCKLLQ(mx, x) } + +// PUNPCKLQDQ: Unpack and Interleave Low-Order Quadwords into Double Quadwords. +// +// Forms: +// +// PUNPCKLQDQ xmm xmm +// PUNPCKLQDQ m128 xmm +// Construct and append a PUNPCKLQDQ instruction to the active function. +func (c *Context) PUNPCKLQDQ(mx, x operand.Op) { + if inst, err := x86.PUNPCKLQDQ(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PUNPCKLQDQ: Unpack and Interleave Low-Order Quadwords into Double Quadwords. +// +// Forms: +// +// PUNPCKLQDQ xmm xmm +// PUNPCKLQDQ m128 xmm +// Construct and append a PUNPCKLQDQ instruction to the active function. +// Operates on the global context. +func PUNPCKLQDQ(mx, x operand.Op) { ctx.PUNPCKLQDQ(mx, x) } + +// PUNPCKLWL: Unpack and Interleave Low-Order Words into Doublewords. +// +// Forms: +// +// PUNPCKLWL xmm xmm +// PUNPCKLWL m128 xmm +// Construct and append a PUNPCKLWL instruction to the active function. +func (c *Context) PUNPCKLWL(mx, x operand.Op) { + if inst, err := x86.PUNPCKLWL(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PUNPCKLWL: Unpack and Interleave Low-Order Words into Doublewords. +// +// Forms: +// +// PUNPCKLWL xmm xmm +// PUNPCKLWL m128 xmm +// Construct and append a PUNPCKLWL instruction to the active function. +// Operates on the global context. +func PUNPCKLWL(mx, x operand.Op) { ctx.PUNPCKLWL(mx, x) } + +// PUSHQ: Push Value Onto the Stack. +// +// Forms: +// +// PUSHQ imm8 +// PUSHQ imm32 +// PUSHQ r64 +// PUSHQ m64 +// Construct and append a PUSHQ instruction to the active function. +func (c *Context) PUSHQ(imr operand.Op) { + if inst, err := x86.PUSHQ(imr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PUSHQ: Push Value Onto the Stack. +// +// Forms: +// +// PUSHQ imm8 +// PUSHQ imm32 +// PUSHQ r64 +// PUSHQ m64 +// Construct and append a PUSHQ instruction to the active function. +// Operates on the global context. +func PUSHQ(imr operand.Op) { ctx.PUSHQ(imr) } + +// PUSHW: Push Value Onto the Stack. +// +// Forms: +// +// PUSHW r16 +// PUSHW m16 +// Construct and append a PUSHW instruction to the active function. +func (c *Context) PUSHW(mr operand.Op) { + if inst, err := x86.PUSHW(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PUSHW: Push Value Onto the Stack. +// +// Forms: +// +// PUSHW r16 +// PUSHW m16 +// Construct and append a PUSHW instruction to the active function. +// Operates on the global context. +func PUSHW(mr operand.Op) { ctx.PUSHW(mr) } + +// PXOR: Packed Bitwise Logical Exclusive OR. +// +// Forms: +// +// PXOR xmm xmm +// PXOR m128 xmm +// Construct and append a PXOR instruction to the active function. +func (c *Context) PXOR(mx, x operand.Op) { + if inst, err := x86.PXOR(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// PXOR: Packed Bitwise Logical Exclusive OR. +// +// Forms: +// +// PXOR xmm xmm +// PXOR m128 xmm +// Construct and append a PXOR instruction to the active function. +// Operates on the global context. +func PXOR(mx, x operand.Op) { ctx.PXOR(mx, x) } + +// RCLB: Rotate Left through Carry Flag. +// +// Forms: +// +// RCLB 1 r8 +// RCLB imm8 r8 +// RCLB cl r8 +// RCLB 1 m8 +// RCLB imm8 m8 +// RCLB cl m8 +// Construct and append a RCLB instruction to the active function. +func (c *Context) RCLB(ci, mr operand.Op) { + if inst, err := x86.RCLB(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RCLB: Rotate Left through Carry Flag. +// +// Forms: +// +// RCLB 1 r8 +// RCLB imm8 r8 +// RCLB cl r8 +// RCLB 1 m8 +// RCLB imm8 m8 +// RCLB cl m8 +// Construct and append a RCLB instruction to the active function. +// Operates on the global context. +func RCLB(ci, mr operand.Op) { ctx.RCLB(ci, mr) } + +// RCLL: Rotate Left through Carry Flag. +// +// Forms: +// +// RCLL 1 r32 +// RCLL imm8 r32 +// RCLL cl r32 +// RCLL 1 m32 +// RCLL imm8 m32 +// RCLL cl m32 +// Construct and append a RCLL instruction to the active function. +func (c *Context) RCLL(ci, mr operand.Op) { + if inst, err := x86.RCLL(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RCLL: Rotate Left through Carry Flag. +// +// Forms: +// +// RCLL 1 r32 +// RCLL imm8 r32 +// RCLL cl r32 +// RCLL 1 m32 +// RCLL imm8 m32 +// RCLL cl m32 +// Construct and append a RCLL instruction to the active function. +// Operates on the global context. +func RCLL(ci, mr operand.Op) { ctx.RCLL(ci, mr) } + +// RCLQ: Rotate Left through Carry Flag. +// +// Forms: +// +// RCLQ 1 r64 +// RCLQ imm8 r64 +// RCLQ cl r64 +// RCLQ 1 m64 +// RCLQ imm8 m64 +// RCLQ cl m64 +// Construct and append a RCLQ instruction to the active function. +func (c *Context) RCLQ(ci, mr operand.Op) { + if inst, err := x86.RCLQ(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RCLQ: Rotate Left through Carry Flag. +// +// Forms: +// +// RCLQ 1 r64 +// RCLQ imm8 r64 +// RCLQ cl r64 +// RCLQ 1 m64 +// RCLQ imm8 m64 +// RCLQ cl m64 +// Construct and append a RCLQ instruction to the active function. +// Operates on the global context. +func RCLQ(ci, mr operand.Op) { ctx.RCLQ(ci, mr) } + +// RCLW: Rotate Left through Carry Flag. +// +// Forms: +// +// RCLW 1 r16 +// RCLW imm8 r16 +// RCLW cl r16 +// RCLW 1 m16 +// RCLW imm8 m16 +// RCLW cl m16 +// Construct and append a RCLW instruction to the active function. +func (c *Context) RCLW(ci, mr operand.Op) { + if inst, err := x86.RCLW(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RCLW: Rotate Left through Carry Flag. +// +// Forms: +// +// RCLW 1 r16 +// RCLW imm8 r16 +// RCLW cl r16 +// RCLW 1 m16 +// RCLW imm8 m16 +// RCLW cl m16 +// Construct and append a RCLW instruction to the active function. +// Operates on the global context. +func RCLW(ci, mr operand.Op) { ctx.RCLW(ci, mr) } + +// RCPPS: Compute Approximate Reciprocals of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// RCPPS xmm xmm +// RCPPS m128 xmm +// Construct and append a RCPPS instruction to the active function. +func (c *Context) RCPPS(mx, x operand.Op) { + if inst, err := x86.RCPPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RCPPS: Compute Approximate Reciprocals of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// RCPPS xmm xmm +// RCPPS m128 xmm +// Construct and append a RCPPS instruction to the active function. +// Operates on the global context. +func RCPPS(mx, x operand.Op) { ctx.RCPPS(mx, x) } + +// RCPSS: Compute Approximate Reciprocal of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// RCPSS xmm xmm +// RCPSS m32 xmm +// Construct and append a RCPSS instruction to the active function. +func (c *Context) RCPSS(mx, x operand.Op) { + if inst, err := x86.RCPSS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RCPSS: Compute Approximate Reciprocal of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// RCPSS xmm xmm +// RCPSS m32 xmm +// Construct and append a RCPSS instruction to the active function. +// Operates on the global context. +func RCPSS(mx, x operand.Op) { ctx.RCPSS(mx, x) } + +// RCRB: Rotate Right through Carry Flag. +// +// Forms: +// +// RCRB 1 r8 +// RCRB imm8 r8 +// RCRB cl r8 +// RCRB 1 m8 +// RCRB imm8 m8 +// RCRB cl m8 +// Construct and append a RCRB instruction to the active function. +func (c *Context) RCRB(ci, mr operand.Op) { + if inst, err := x86.RCRB(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RCRB: Rotate Right through Carry Flag. +// +// Forms: +// +// RCRB 1 r8 +// RCRB imm8 r8 +// RCRB cl r8 +// RCRB 1 m8 +// RCRB imm8 m8 +// RCRB cl m8 +// Construct and append a RCRB instruction to the active function. +// Operates on the global context. +func RCRB(ci, mr operand.Op) { ctx.RCRB(ci, mr) } + +// RCRL: Rotate Right through Carry Flag. +// +// Forms: +// +// RCRL 1 r32 +// RCRL imm8 r32 +// RCRL cl r32 +// RCRL 1 m32 +// RCRL imm8 m32 +// RCRL cl m32 +// Construct and append a RCRL instruction to the active function. +func (c *Context) RCRL(ci, mr operand.Op) { + if inst, err := x86.RCRL(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RCRL: Rotate Right through Carry Flag. +// +// Forms: +// +// RCRL 1 r32 +// RCRL imm8 r32 +// RCRL cl r32 +// RCRL 1 m32 +// RCRL imm8 m32 +// RCRL cl m32 +// Construct and append a RCRL instruction to the active function. +// Operates on the global context. +func RCRL(ci, mr operand.Op) { ctx.RCRL(ci, mr) } + +// RCRQ: Rotate Right through Carry Flag. +// +// Forms: +// +// RCRQ 1 r64 +// RCRQ imm8 r64 +// RCRQ cl r64 +// RCRQ 1 m64 +// RCRQ imm8 m64 +// RCRQ cl m64 +// Construct and append a RCRQ instruction to the active function. +func (c *Context) RCRQ(ci, mr operand.Op) { + if inst, err := x86.RCRQ(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RCRQ: Rotate Right through Carry Flag. +// +// Forms: +// +// RCRQ 1 r64 +// RCRQ imm8 r64 +// RCRQ cl r64 +// RCRQ 1 m64 +// RCRQ imm8 m64 +// RCRQ cl m64 +// Construct and append a RCRQ instruction to the active function. +// Operates on the global context. +func RCRQ(ci, mr operand.Op) { ctx.RCRQ(ci, mr) } + +// RCRW: Rotate Right through Carry Flag. +// +// Forms: +// +// RCRW 1 r16 +// RCRW imm8 r16 +// RCRW cl r16 +// RCRW 1 m16 +// RCRW imm8 m16 +// RCRW cl m16 +// Construct and append a RCRW instruction to the active function. +func (c *Context) RCRW(ci, mr operand.Op) { + if inst, err := x86.RCRW(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RCRW: Rotate Right through Carry Flag. +// +// Forms: +// +// RCRW 1 r16 +// RCRW imm8 r16 +// RCRW cl r16 +// RCRW 1 m16 +// RCRW imm8 m16 +// RCRW cl m16 +// Construct and append a RCRW instruction to the active function. +// Operates on the global context. +func RCRW(ci, mr operand.Op) { ctx.RCRW(ci, mr) } + +// RDRANDL: Read Random Number. +// +// Forms: +// +// RDRANDL r32 +// Construct and append a RDRANDL instruction to the active function. +func (c *Context) RDRANDL(r operand.Op) { + if inst, err := x86.RDRANDL(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RDRANDL: Read Random Number. +// +// Forms: +// +// RDRANDL r32 +// Construct and append a RDRANDL instruction to the active function. +// Operates on the global context. +func RDRANDL(r operand.Op) { ctx.RDRANDL(r) } + +// RDRANDQ: Read Random Number. +// +// Forms: +// +// RDRANDQ r64 +// Construct and append a RDRANDQ instruction to the active function. +func (c *Context) RDRANDQ(r operand.Op) { + if inst, err := x86.RDRANDQ(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RDRANDQ: Read Random Number. +// +// Forms: +// +// RDRANDQ r64 +// Construct and append a RDRANDQ instruction to the active function. +// Operates on the global context. +func RDRANDQ(r operand.Op) { ctx.RDRANDQ(r) } + +// RDRANDW: Read Random Number. +// +// Forms: +// +// RDRANDW r16 +// Construct and append a RDRANDW instruction to the active function. +func (c *Context) RDRANDW(r operand.Op) { + if inst, err := x86.RDRANDW(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RDRANDW: Read Random Number. +// +// Forms: +// +// RDRANDW r16 +// Construct and append a RDRANDW instruction to the active function. +// Operates on the global context. +func RDRANDW(r operand.Op) { ctx.RDRANDW(r) } + +// RDSEEDL: Read Random SEED. +// +// Forms: +// +// RDSEEDL r32 +// Construct and append a RDSEEDL instruction to the active function. +func (c *Context) RDSEEDL(r operand.Op) { + if inst, err := x86.RDSEEDL(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RDSEEDL: Read Random SEED. +// +// Forms: +// +// RDSEEDL r32 +// Construct and append a RDSEEDL instruction to the active function. +// Operates on the global context. +func RDSEEDL(r operand.Op) { ctx.RDSEEDL(r) } + +// RDSEEDQ: Read Random SEED. +// +// Forms: +// +// RDSEEDQ r64 +// Construct and append a RDSEEDQ instruction to the active function. +func (c *Context) RDSEEDQ(r operand.Op) { + if inst, err := x86.RDSEEDQ(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RDSEEDQ: Read Random SEED. +// +// Forms: +// +// RDSEEDQ r64 +// Construct and append a RDSEEDQ instruction to the active function. +// Operates on the global context. +func RDSEEDQ(r operand.Op) { ctx.RDSEEDQ(r) } + +// RDSEEDW: Read Random SEED. +// +// Forms: +// +// RDSEEDW r16 +// Construct and append a RDSEEDW instruction to the active function. +func (c *Context) RDSEEDW(r operand.Op) { + if inst, err := x86.RDSEEDW(r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RDSEEDW: Read Random SEED. +// +// Forms: +// +// RDSEEDW r16 +// Construct and append a RDSEEDW instruction to the active function. +// Operates on the global context. +func RDSEEDW(r operand.Op) { ctx.RDSEEDW(r) } + +// RDTSC: Read Time-Stamp Counter. +// +// Forms: +// +// RDTSC +// Construct and append a RDTSC instruction to the active function. +func (c *Context) RDTSC() { + if inst, err := x86.RDTSC(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RDTSC: Read Time-Stamp Counter. +// +// Forms: +// +// RDTSC +// Construct and append a RDTSC instruction to the active function. +// Operates on the global context. +func RDTSC() { ctx.RDTSC() } + +// RDTSCP: Read Time-Stamp Counter and Processor ID. +// +// Forms: +// +// RDTSCP +// Construct and append a RDTSCP instruction to the active function. +func (c *Context) RDTSCP() { + if inst, err := x86.RDTSCP(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RDTSCP: Read Time-Stamp Counter and Processor ID. +// +// Forms: +// +// RDTSCP +// Construct and append a RDTSCP instruction to the active function. +// Operates on the global context. +func RDTSCP() { ctx.RDTSCP() } + +// RET: Return from Procedure. +// +// Forms: +// +// RET +// Construct and append a RET instruction to the active function. +func (c *Context) RET() { + if inst, err := x86.RET(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RET: Return from Procedure. +// +// Forms: +// +// RET +// Construct and append a RET instruction to the active function. +// Operates on the global context. +func RET() { ctx.RET() } + +// RETFL: Return from Procedure. +// +// Forms: +// +// RETFL imm16 +// Construct and append a RETFL instruction to the active function. +func (c *Context) RETFL(i operand.Op) { + if inst, err := x86.RETFL(i); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RETFL: Return from Procedure. +// +// Forms: +// +// RETFL imm16 +// Construct and append a RETFL instruction to the active function. +// Operates on the global context. +func RETFL(i operand.Op) { ctx.RETFL(i) } + +// RETFQ: Return from Procedure. +// +// Forms: +// +// RETFQ imm16 +// Construct and append a RETFQ instruction to the active function. +func (c *Context) RETFQ(i operand.Op) { + if inst, err := x86.RETFQ(i); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RETFQ: Return from Procedure. +// +// Forms: +// +// RETFQ imm16 +// Construct and append a RETFQ instruction to the active function. +// Operates on the global context. +func RETFQ(i operand.Op) { ctx.RETFQ(i) } + +// RETFW: Return from Procedure. +// +// Forms: +// +// RETFW imm16 +// Construct and append a RETFW instruction to the active function. +func (c *Context) RETFW(i operand.Op) { + if inst, err := x86.RETFW(i); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RETFW: Return from Procedure. +// +// Forms: +// +// RETFW imm16 +// Construct and append a RETFW instruction to the active function. +// Operates on the global context. +func RETFW(i operand.Op) { ctx.RETFW(i) } + +// ROLB: Rotate Left. +// +// Forms: +// +// ROLB 1 r8 +// ROLB imm8 r8 +// ROLB cl r8 +// ROLB 1 m8 +// ROLB imm8 m8 +// ROLB cl m8 +// Construct and append a ROLB instruction to the active function. +func (c *Context) ROLB(ci, mr operand.Op) { + if inst, err := x86.ROLB(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ROLB: Rotate Left. +// +// Forms: +// +// ROLB 1 r8 +// ROLB imm8 r8 +// ROLB cl r8 +// ROLB 1 m8 +// ROLB imm8 m8 +// ROLB cl m8 +// Construct and append a ROLB instruction to the active function. +// Operates on the global context. +func ROLB(ci, mr operand.Op) { ctx.ROLB(ci, mr) } + +// ROLL: Rotate Left. +// +// Forms: +// +// ROLL 1 r32 +// ROLL imm8 r32 +// ROLL cl r32 +// ROLL 1 m32 +// ROLL imm8 m32 +// ROLL cl m32 +// Construct and append a ROLL instruction to the active function. +func (c *Context) ROLL(ci, mr operand.Op) { + if inst, err := x86.ROLL(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ROLL: Rotate Left. +// +// Forms: +// +// ROLL 1 r32 +// ROLL imm8 r32 +// ROLL cl r32 +// ROLL 1 m32 +// ROLL imm8 m32 +// ROLL cl m32 +// Construct and append a ROLL instruction to the active function. +// Operates on the global context. +func ROLL(ci, mr operand.Op) { ctx.ROLL(ci, mr) } + +// ROLQ: Rotate Left. +// +// Forms: +// +// ROLQ 1 r64 +// ROLQ imm8 r64 +// ROLQ cl r64 +// ROLQ 1 m64 +// ROLQ imm8 m64 +// ROLQ cl m64 +// Construct and append a ROLQ instruction to the active function. +func (c *Context) ROLQ(ci, mr operand.Op) { + if inst, err := x86.ROLQ(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ROLQ: Rotate Left. +// +// Forms: +// +// ROLQ 1 r64 +// ROLQ imm8 r64 +// ROLQ cl r64 +// ROLQ 1 m64 +// ROLQ imm8 m64 +// ROLQ cl m64 +// Construct and append a ROLQ instruction to the active function. +// Operates on the global context. +func ROLQ(ci, mr operand.Op) { ctx.ROLQ(ci, mr) } + +// ROLW: Rotate Left. +// +// Forms: +// +// ROLW 1 r16 +// ROLW imm8 r16 +// ROLW cl r16 +// ROLW 1 m16 +// ROLW imm8 m16 +// ROLW cl m16 +// Construct and append a ROLW instruction to the active function. +func (c *Context) ROLW(ci, mr operand.Op) { + if inst, err := x86.ROLW(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ROLW: Rotate Left. +// +// Forms: +// +// ROLW 1 r16 +// ROLW imm8 r16 +// ROLW cl r16 +// ROLW 1 m16 +// ROLW imm8 m16 +// ROLW cl m16 +// Construct and append a ROLW instruction to the active function. +// Operates on the global context. +func ROLW(ci, mr operand.Op) { ctx.ROLW(ci, mr) } + +// RORB: Rotate Right. +// +// Forms: +// +// RORB 1 r8 +// RORB imm8 r8 +// RORB cl r8 +// RORB 1 m8 +// RORB imm8 m8 +// RORB cl m8 +// Construct and append a RORB instruction to the active function. +func (c *Context) RORB(ci, mr operand.Op) { + if inst, err := x86.RORB(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RORB: Rotate Right. +// +// Forms: +// +// RORB 1 r8 +// RORB imm8 r8 +// RORB cl r8 +// RORB 1 m8 +// RORB imm8 m8 +// RORB cl m8 +// Construct and append a RORB instruction to the active function. +// Operates on the global context. +func RORB(ci, mr operand.Op) { ctx.RORB(ci, mr) } + +// RORL: Rotate Right. +// +// Forms: +// +// RORL 1 r32 +// RORL imm8 r32 +// RORL cl r32 +// RORL 1 m32 +// RORL imm8 m32 +// RORL cl m32 +// Construct and append a RORL instruction to the active function. +func (c *Context) RORL(ci, mr operand.Op) { + if inst, err := x86.RORL(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RORL: Rotate Right. +// +// Forms: +// +// RORL 1 r32 +// RORL imm8 r32 +// RORL cl r32 +// RORL 1 m32 +// RORL imm8 m32 +// RORL cl m32 +// Construct and append a RORL instruction to the active function. +// Operates on the global context. +func RORL(ci, mr operand.Op) { ctx.RORL(ci, mr) } + +// RORQ: Rotate Right. +// +// Forms: +// +// RORQ 1 r64 +// RORQ imm8 r64 +// RORQ cl r64 +// RORQ 1 m64 +// RORQ imm8 m64 +// RORQ cl m64 +// Construct and append a RORQ instruction to the active function. +func (c *Context) RORQ(ci, mr operand.Op) { + if inst, err := x86.RORQ(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RORQ: Rotate Right. +// +// Forms: +// +// RORQ 1 r64 +// RORQ imm8 r64 +// RORQ cl r64 +// RORQ 1 m64 +// RORQ imm8 m64 +// RORQ cl m64 +// Construct and append a RORQ instruction to the active function. +// Operates on the global context. +func RORQ(ci, mr operand.Op) { ctx.RORQ(ci, mr) } + +// RORW: Rotate Right. +// +// Forms: +// +// RORW 1 r16 +// RORW imm8 r16 +// RORW cl r16 +// RORW 1 m16 +// RORW imm8 m16 +// RORW cl m16 +// Construct and append a RORW instruction to the active function. +func (c *Context) RORW(ci, mr operand.Op) { + if inst, err := x86.RORW(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RORW: Rotate Right. +// +// Forms: +// +// RORW 1 r16 +// RORW imm8 r16 +// RORW cl r16 +// RORW 1 m16 +// RORW imm8 m16 +// RORW cl m16 +// Construct and append a RORW instruction to the active function. +// Operates on the global context. +func RORW(ci, mr operand.Op) { ctx.RORW(ci, mr) } + +// RORXL: Rotate Right Logical Without Affecting Flags. +// +// Forms: +// +// RORXL imm8 r32 r32 +// RORXL imm8 m32 r32 +// Construct and append a RORXL instruction to the active function. +func (c *Context) RORXL(i, mr, r operand.Op) { + if inst, err := x86.RORXL(i, mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RORXL: Rotate Right Logical Without Affecting Flags. +// +// Forms: +// +// RORXL imm8 r32 r32 +// RORXL imm8 m32 r32 +// Construct and append a RORXL instruction to the active function. +// Operates on the global context. +func RORXL(i, mr, r operand.Op) { ctx.RORXL(i, mr, r) } + +// RORXQ: Rotate Right Logical Without Affecting Flags. +// +// Forms: +// +// RORXQ imm8 r64 r64 +// RORXQ imm8 m64 r64 +// Construct and append a RORXQ instruction to the active function. +func (c *Context) RORXQ(i, mr, r operand.Op) { + if inst, err := x86.RORXQ(i, mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RORXQ: Rotate Right Logical Without Affecting Flags. +// +// Forms: +// +// RORXQ imm8 r64 r64 +// RORXQ imm8 m64 r64 +// Construct and append a RORXQ instruction to the active function. +// Operates on the global context. +func RORXQ(i, mr, r operand.Op) { ctx.RORXQ(i, mr, r) } + +// ROUNDPD: Round Packed Double Precision Floating-Point Values. +// +// Forms: +// +// ROUNDPD imm8 xmm xmm +// ROUNDPD imm8 m128 xmm +// Construct and append a ROUNDPD instruction to the active function. +func (c *Context) ROUNDPD(i, mx, x operand.Op) { + if inst, err := x86.ROUNDPD(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ROUNDPD: Round Packed Double Precision Floating-Point Values. +// +// Forms: +// +// ROUNDPD imm8 xmm xmm +// ROUNDPD imm8 m128 xmm +// Construct and append a ROUNDPD instruction to the active function. +// Operates on the global context. +func ROUNDPD(i, mx, x operand.Op) { ctx.ROUNDPD(i, mx, x) } + +// ROUNDPS: Round Packed Single Precision Floating-Point Values. +// +// Forms: +// +// ROUNDPS imm8 xmm xmm +// ROUNDPS imm8 m128 xmm +// Construct and append a ROUNDPS instruction to the active function. +func (c *Context) ROUNDPS(i, mx, x operand.Op) { + if inst, err := x86.ROUNDPS(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ROUNDPS: Round Packed Single Precision Floating-Point Values. +// +// Forms: +// +// ROUNDPS imm8 xmm xmm +// ROUNDPS imm8 m128 xmm +// Construct and append a ROUNDPS instruction to the active function. +// Operates on the global context. +func ROUNDPS(i, mx, x operand.Op) { ctx.ROUNDPS(i, mx, x) } + +// ROUNDSD: Round Scalar Double Precision Floating-Point Values. +// +// Forms: +// +// ROUNDSD imm8 xmm xmm +// ROUNDSD imm8 m64 xmm +// Construct and append a ROUNDSD instruction to the active function. +func (c *Context) ROUNDSD(i, mx, x operand.Op) { + if inst, err := x86.ROUNDSD(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ROUNDSD: Round Scalar Double Precision Floating-Point Values. +// +// Forms: +// +// ROUNDSD imm8 xmm xmm +// ROUNDSD imm8 m64 xmm +// Construct and append a ROUNDSD instruction to the active function. +// Operates on the global context. +func ROUNDSD(i, mx, x operand.Op) { ctx.ROUNDSD(i, mx, x) } + +// ROUNDSS: Round Scalar Single Precision Floating-Point Values. +// +// Forms: +// +// ROUNDSS imm8 xmm xmm +// ROUNDSS imm8 m32 xmm +// Construct and append a ROUNDSS instruction to the active function. +func (c *Context) ROUNDSS(i, mx, x operand.Op) { + if inst, err := x86.ROUNDSS(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// ROUNDSS: Round Scalar Single Precision Floating-Point Values. +// +// Forms: +// +// ROUNDSS imm8 xmm xmm +// ROUNDSS imm8 m32 xmm +// Construct and append a ROUNDSS instruction to the active function. +// Operates on the global context. +func ROUNDSS(i, mx, x operand.Op) { ctx.ROUNDSS(i, mx, x) } + +// RSQRTPS: Compute Reciprocals of Square Roots of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// RSQRTPS xmm xmm +// RSQRTPS m128 xmm +// Construct and append a RSQRTPS instruction to the active function. +func (c *Context) RSQRTPS(mx, x operand.Op) { + if inst, err := x86.RSQRTPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RSQRTPS: Compute Reciprocals of Square Roots of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// RSQRTPS xmm xmm +// RSQRTPS m128 xmm +// Construct and append a RSQRTPS instruction to the active function. +// Operates on the global context. +func RSQRTPS(mx, x operand.Op) { ctx.RSQRTPS(mx, x) } + +// RSQRTSS: Compute Reciprocal of Square Root of Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// RSQRTSS xmm xmm +// RSQRTSS m32 xmm +// Construct and append a RSQRTSS instruction to the active function. +func (c *Context) RSQRTSS(mx, x operand.Op) { + if inst, err := x86.RSQRTSS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// RSQRTSS: Compute Reciprocal of Square Root of Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// RSQRTSS xmm xmm +// RSQRTSS m32 xmm +// Construct and append a RSQRTSS instruction to the active function. +// Operates on the global context. +func RSQRTSS(mx, x operand.Op) { ctx.RSQRTSS(mx, x) } + +// SALB: Arithmetic Shift Left. +// +// Forms: +// +// SALB 1 r8 +// SALB imm8 r8 +// SALB cl r8 +// SALB 1 m8 +// SALB imm8 m8 +// SALB cl m8 +// Construct and append a SALB instruction to the active function. +func (c *Context) SALB(ci, mr operand.Op) { + if inst, err := x86.SALB(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SALB: Arithmetic Shift Left. +// +// Forms: +// +// SALB 1 r8 +// SALB imm8 r8 +// SALB cl r8 +// SALB 1 m8 +// SALB imm8 m8 +// SALB cl m8 +// Construct and append a SALB instruction to the active function. +// Operates on the global context. +func SALB(ci, mr operand.Op) { ctx.SALB(ci, mr) } + +// SALL: Arithmetic Shift Left. +// +// Forms: +// +// SALL 1 r32 +// SALL imm8 r32 +// SALL cl r32 +// SALL 1 m32 +// SALL imm8 m32 +// SALL cl m32 +// Construct and append a SALL instruction to the active function. +func (c *Context) SALL(ci, mr operand.Op) { + if inst, err := x86.SALL(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SALL: Arithmetic Shift Left. +// +// Forms: +// +// SALL 1 r32 +// SALL imm8 r32 +// SALL cl r32 +// SALL 1 m32 +// SALL imm8 m32 +// SALL cl m32 +// Construct and append a SALL instruction to the active function. +// Operates on the global context. +func SALL(ci, mr operand.Op) { ctx.SALL(ci, mr) } + +// SALQ: Arithmetic Shift Left. +// +// Forms: +// +// SALQ 1 r64 +// SALQ imm8 r64 +// SALQ cl r64 +// SALQ 1 m64 +// SALQ imm8 m64 +// SALQ cl m64 +// Construct and append a SALQ instruction to the active function. +func (c *Context) SALQ(ci, mr operand.Op) { + if inst, err := x86.SALQ(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SALQ: Arithmetic Shift Left. +// +// Forms: +// +// SALQ 1 r64 +// SALQ imm8 r64 +// SALQ cl r64 +// SALQ 1 m64 +// SALQ imm8 m64 +// SALQ cl m64 +// Construct and append a SALQ instruction to the active function. +// Operates on the global context. +func SALQ(ci, mr operand.Op) { ctx.SALQ(ci, mr) } + +// SALW: Arithmetic Shift Left. +// +// Forms: +// +// SALW 1 r16 +// SALW imm8 r16 +// SALW cl r16 +// SALW 1 m16 +// SALW imm8 m16 +// SALW cl m16 +// Construct and append a SALW instruction to the active function. +func (c *Context) SALW(ci, mr operand.Op) { + if inst, err := x86.SALW(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SALW: Arithmetic Shift Left. +// +// Forms: +// +// SALW 1 r16 +// SALW imm8 r16 +// SALW cl r16 +// SALW 1 m16 +// SALW imm8 m16 +// SALW cl m16 +// Construct and append a SALW instruction to the active function. +// Operates on the global context. +func SALW(ci, mr operand.Op) { ctx.SALW(ci, mr) } + +// SARB: Arithmetic Shift Right. +// +// Forms: +// +// SARB 1 r8 +// SARB imm8 r8 +// SARB cl r8 +// SARB 1 m8 +// SARB imm8 m8 +// SARB cl m8 +// Construct and append a SARB instruction to the active function. +func (c *Context) SARB(ci, mr operand.Op) { + if inst, err := x86.SARB(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SARB: Arithmetic Shift Right. +// +// Forms: +// +// SARB 1 r8 +// SARB imm8 r8 +// SARB cl r8 +// SARB 1 m8 +// SARB imm8 m8 +// SARB cl m8 +// Construct and append a SARB instruction to the active function. +// Operates on the global context. +func SARB(ci, mr operand.Op) { ctx.SARB(ci, mr) } + +// SARL: Arithmetic Shift Right. +// +// Forms: +// +// SARL 1 r32 +// SARL imm8 r32 +// SARL cl r32 +// SARL 1 m32 +// SARL imm8 m32 +// SARL cl m32 +// Construct and append a SARL instruction to the active function. +func (c *Context) SARL(ci, mr operand.Op) { + if inst, err := x86.SARL(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SARL: Arithmetic Shift Right. +// +// Forms: +// +// SARL 1 r32 +// SARL imm8 r32 +// SARL cl r32 +// SARL 1 m32 +// SARL imm8 m32 +// SARL cl m32 +// Construct and append a SARL instruction to the active function. +// Operates on the global context. +func SARL(ci, mr operand.Op) { ctx.SARL(ci, mr) } + +// SARQ: Arithmetic Shift Right. +// +// Forms: +// +// SARQ 1 r64 +// SARQ imm8 r64 +// SARQ cl r64 +// SARQ 1 m64 +// SARQ imm8 m64 +// SARQ cl m64 +// Construct and append a SARQ instruction to the active function. +func (c *Context) SARQ(ci, mr operand.Op) { + if inst, err := x86.SARQ(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SARQ: Arithmetic Shift Right. +// +// Forms: +// +// SARQ 1 r64 +// SARQ imm8 r64 +// SARQ cl r64 +// SARQ 1 m64 +// SARQ imm8 m64 +// SARQ cl m64 +// Construct and append a SARQ instruction to the active function. +// Operates on the global context. +func SARQ(ci, mr operand.Op) { ctx.SARQ(ci, mr) } + +// SARW: Arithmetic Shift Right. +// +// Forms: +// +// SARW 1 r16 +// SARW imm8 r16 +// SARW cl r16 +// SARW 1 m16 +// SARW imm8 m16 +// SARW cl m16 +// Construct and append a SARW instruction to the active function. +func (c *Context) SARW(ci, mr operand.Op) { + if inst, err := x86.SARW(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SARW: Arithmetic Shift Right. +// +// Forms: +// +// SARW 1 r16 +// SARW imm8 r16 +// SARW cl r16 +// SARW 1 m16 +// SARW imm8 m16 +// SARW cl m16 +// Construct and append a SARW instruction to the active function. +// Operates on the global context. +func SARW(ci, mr operand.Op) { ctx.SARW(ci, mr) } + +// SARXL: Arithmetic Shift Right Without Affecting Flags. +// +// Forms: +// +// SARXL r32 r32 r32 +// SARXL r32 m32 r32 +// Construct and append a SARXL instruction to the active function. +func (c *Context) SARXL(r, mr, r1 operand.Op) { + if inst, err := x86.SARXL(r, mr, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SARXL: Arithmetic Shift Right Without Affecting Flags. +// +// Forms: +// +// SARXL r32 r32 r32 +// SARXL r32 m32 r32 +// Construct and append a SARXL instruction to the active function. +// Operates on the global context. +func SARXL(r, mr, r1 operand.Op) { ctx.SARXL(r, mr, r1) } + +// SARXQ: Arithmetic Shift Right Without Affecting Flags. +// +// Forms: +// +// SARXQ r64 r64 r64 +// SARXQ r64 m64 r64 +// Construct and append a SARXQ instruction to the active function. +func (c *Context) SARXQ(r, mr, r1 operand.Op) { + if inst, err := x86.SARXQ(r, mr, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SARXQ: Arithmetic Shift Right Without Affecting Flags. +// +// Forms: +// +// SARXQ r64 r64 r64 +// SARXQ r64 m64 r64 +// Construct and append a SARXQ instruction to the active function. +// Operates on the global context. +func SARXQ(r, mr, r1 operand.Op) { ctx.SARXQ(r, mr, r1) } + +// SBBB: Subtract with Borrow. +// +// Forms: +// +// SBBB imm8 al +// SBBB imm8 r8 +// SBBB r8 r8 +// SBBB m8 r8 +// SBBB imm8 m8 +// SBBB r8 m8 +// Construct and append a SBBB instruction to the active function. +func (c *Context) SBBB(imr, amr operand.Op) { + if inst, err := x86.SBBB(imr, amr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SBBB: Subtract with Borrow. +// +// Forms: +// +// SBBB imm8 al +// SBBB imm8 r8 +// SBBB r8 r8 +// SBBB m8 r8 +// SBBB imm8 m8 +// SBBB r8 m8 +// Construct and append a SBBB instruction to the active function. +// Operates on the global context. +func SBBB(imr, amr operand.Op) { ctx.SBBB(imr, amr) } + +// SBBL: Subtract with Borrow. +// +// Forms: +// +// SBBL imm32 eax +// SBBL imm8 r32 +// SBBL imm32 r32 +// SBBL r32 r32 +// SBBL m32 r32 +// SBBL imm8 m32 +// SBBL imm32 m32 +// SBBL r32 m32 +// Construct and append a SBBL instruction to the active function. +func (c *Context) SBBL(imr, emr operand.Op) { + if inst, err := x86.SBBL(imr, emr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SBBL: Subtract with Borrow. +// +// Forms: +// +// SBBL imm32 eax +// SBBL imm8 r32 +// SBBL imm32 r32 +// SBBL r32 r32 +// SBBL m32 r32 +// SBBL imm8 m32 +// SBBL imm32 m32 +// SBBL r32 m32 +// Construct and append a SBBL instruction to the active function. +// Operates on the global context. +func SBBL(imr, emr operand.Op) { ctx.SBBL(imr, emr) } + +// SBBQ: Subtract with Borrow. +// +// Forms: +// +// SBBQ imm32 rax +// SBBQ imm8 r64 +// SBBQ imm32 r64 +// SBBQ r64 r64 +// SBBQ m64 r64 +// SBBQ imm8 m64 +// SBBQ imm32 m64 +// SBBQ r64 m64 +// Construct and append a SBBQ instruction to the active function. +func (c *Context) SBBQ(imr, mr operand.Op) { + if inst, err := x86.SBBQ(imr, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SBBQ: Subtract with Borrow. +// +// Forms: +// +// SBBQ imm32 rax +// SBBQ imm8 r64 +// SBBQ imm32 r64 +// SBBQ r64 r64 +// SBBQ m64 r64 +// SBBQ imm8 m64 +// SBBQ imm32 m64 +// SBBQ r64 m64 +// Construct and append a SBBQ instruction to the active function. +// Operates on the global context. +func SBBQ(imr, mr operand.Op) { ctx.SBBQ(imr, mr) } + +// SBBW: Subtract with Borrow. +// +// Forms: +// +// SBBW imm16 ax +// SBBW imm8 r16 +// SBBW imm16 r16 +// SBBW r16 r16 +// SBBW m16 r16 +// SBBW imm8 m16 +// SBBW imm16 m16 +// SBBW r16 m16 +// Construct and append a SBBW instruction to the active function. +func (c *Context) SBBW(imr, amr operand.Op) { + if inst, err := x86.SBBW(imr, amr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SBBW: Subtract with Borrow. +// +// Forms: +// +// SBBW imm16 ax +// SBBW imm8 r16 +// SBBW imm16 r16 +// SBBW r16 r16 +// SBBW m16 r16 +// SBBW imm8 m16 +// SBBW imm16 m16 +// SBBW r16 m16 +// Construct and append a SBBW instruction to the active function. +// Operates on the global context. +func SBBW(imr, amr operand.Op) { ctx.SBBW(imr, amr) } + +// SETCC: Set byte if above or equal (CF == 0). +// +// Forms: +// +// SETCC r8 +// SETCC m8 +// Construct and append a SETCC instruction to the active function. +func (c *Context) SETCC(mr operand.Op) { + if inst, err := x86.SETCC(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SETCC: Set byte if above or equal (CF == 0). +// +// Forms: +// +// SETCC r8 +// SETCC m8 +// Construct and append a SETCC instruction to the active function. +// Operates on the global context. +func SETCC(mr operand.Op) { ctx.SETCC(mr) } + +// SETCS: Set byte if below (CF == 1). +// +// Forms: +// +// SETCS r8 +// SETCS m8 +// Construct and append a SETCS instruction to the active function. +func (c *Context) SETCS(mr operand.Op) { + if inst, err := x86.SETCS(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SETCS: Set byte if below (CF == 1). +// +// Forms: +// +// SETCS r8 +// SETCS m8 +// Construct and append a SETCS instruction to the active function. +// Operates on the global context. +func SETCS(mr operand.Op) { ctx.SETCS(mr) } + +// SETEQ: Set byte if equal (ZF == 1). +// +// Forms: +// +// SETEQ r8 +// SETEQ m8 +// Construct and append a SETEQ instruction to the active function. +func (c *Context) SETEQ(mr operand.Op) { + if inst, err := x86.SETEQ(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SETEQ: Set byte if equal (ZF == 1). +// +// Forms: +// +// SETEQ r8 +// SETEQ m8 +// Construct and append a SETEQ instruction to the active function. +// Operates on the global context. +func SETEQ(mr operand.Op) { ctx.SETEQ(mr) } + +// SETGE: Set byte if greater or equal (SF == OF). +// +// Forms: +// +// SETGE r8 +// SETGE m8 +// Construct and append a SETGE instruction to the active function. +func (c *Context) SETGE(mr operand.Op) { + if inst, err := x86.SETGE(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SETGE: Set byte if greater or equal (SF == OF). +// +// Forms: +// +// SETGE r8 +// SETGE m8 +// Construct and append a SETGE instruction to the active function. +// Operates on the global context. +func SETGE(mr operand.Op) { ctx.SETGE(mr) } + +// SETGT: Set byte if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// SETGT r8 +// SETGT m8 +// Construct and append a SETGT instruction to the active function. +func (c *Context) SETGT(mr operand.Op) { + if inst, err := x86.SETGT(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SETGT: Set byte if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// SETGT r8 +// SETGT m8 +// Construct and append a SETGT instruction to the active function. +// Operates on the global context. +func SETGT(mr operand.Op) { ctx.SETGT(mr) } + +// SETHI: Set byte if above (CF == 0 and ZF == 0). +// +// Forms: +// +// SETHI r8 +// SETHI m8 +// Construct and append a SETHI instruction to the active function. +func (c *Context) SETHI(mr operand.Op) { + if inst, err := x86.SETHI(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SETHI: Set byte if above (CF == 0 and ZF == 0). +// +// Forms: +// +// SETHI r8 +// SETHI m8 +// Construct and append a SETHI instruction to the active function. +// Operates on the global context. +func SETHI(mr operand.Op) { ctx.SETHI(mr) } + +// SETLE: Set byte if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// SETLE r8 +// SETLE m8 +// Construct and append a SETLE instruction to the active function. +func (c *Context) SETLE(mr operand.Op) { + if inst, err := x86.SETLE(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SETLE: Set byte if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// SETLE r8 +// SETLE m8 +// Construct and append a SETLE instruction to the active function. +// Operates on the global context. +func SETLE(mr operand.Op) { ctx.SETLE(mr) } + +// SETLS: Set byte if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// SETLS r8 +// SETLS m8 +// Construct and append a SETLS instruction to the active function. +func (c *Context) SETLS(mr operand.Op) { + if inst, err := x86.SETLS(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SETLS: Set byte if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// SETLS r8 +// SETLS m8 +// Construct and append a SETLS instruction to the active function. +// Operates on the global context. +func SETLS(mr operand.Op) { ctx.SETLS(mr) } + +// SETLT: Set byte if less (SF != OF). +// +// Forms: +// +// SETLT r8 +// SETLT m8 +// Construct and append a SETLT instruction to the active function. +func (c *Context) SETLT(mr operand.Op) { + if inst, err := x86.SETLT(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SETLT: Set byte if less (SF != OF). +// +// Forms: +// +// SETLT r8 +// SETLT m8 +// Construct and append a SETLT instruction to the active function. +// Operates on the global context. +func SETLT(mr operand.Op) { ctx.SETLT(mr) } + +// SETMI: Set byte if sign (SF == 1). +// +// Forms: +// +// SETMI r8 +// SETMI m8 +// Construct and append a SETMI instruction to the active function. +func (c *Context) SETMI(mr operand.Op) { + if inst, err := x86.SETMI(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SETMI: Set byte if sign (SF == 1). +// +// Forms: +// +// SETMI r8 +// SETMI m8 +// Construct and append a SETMI instruction to the active function. +// Operates on the global context. +func SETMI(mr operand.Op) { ctx.SETMI(mr) } + +// SETNE: Set byte if not equal (ZF == 0). +// +// Forms: +// +// SETNE r8 +// SETNE m8 +// Construct and append a SETNE instruction to the active function. +func (c *Context) SETNE(mr operand.Op) { + if inst, err := x86.SETNE(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SETNE: Set byte if not equal (ZF == 0). +// +// Forms: +// +// SETNE r8 +// SETNE m8 +// Construct and append a SETNE instruction to the active function. +// Operates on the global context. +func SETNE(mr operand.Op) { ctx.SETNE(mr) } + +// SETOC: Set byte if not overflow (OF == 0). +// +// Forms: +// +// SETOC r8 +// SETOC m8 +// Construct and append a SETOC instruction to the active function. +func (c *Context) SETOC(mr operand.Op) { + if inst, err := x86.SETOC(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SETOC: Set byte if not overflow (OF == 0). +// +// Forms: +// +// SETOC r8 +// SETOC m8 +// Construct and append a SETOC instruction to the active function. +// Operates on the global context. +func SETOC(mr operand.Op) { ctx.SETOC(mr) } + +// SETOS: Set byte if overflow (OF == 1). +// +// Forms: +// +// SETOS r8 +// SETOS m8 +// Construct and append a SETOS instruction to the active function. +func (c *Context) SETOS(mr operand.Op) { + if inst, err := x86.SETOS(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SETOS: Set byte if overflow (OF == 1). +// +// Forms: +// +// SETOS r8 +// SETOS m8 +// Construct and append a SETOS instruction to the active function. +// Operates on the global context. +func SETOS(mr operand.Op) { ctx.SETOS(mr) } + +// SETPC: Set byte if not parity (PF == 0). +// +// Forms: +// +// SETPC r8 +// SETPC m8 +// Construct and append a SETPC instruction to the active function. +func (c *Context) SETPC(mr operand.Op) { + if inst, err := x86.SETPC(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SETPC: Set byte if not parity (PF == 0). +// +// Forms: +// +// SETPC r8 +// SETPC m8 +// Construct and append a SETPC instruction to the active function. +// Operates on the global context. +func SETPC(mr operand.Op) { ctx.SETPC(mr) } + +// SETPL: Set byte if not sign (SF == 0). +// +// Forms: +// +// SETPL r8 +// SETPL m8 +// Construct and append a SETPL instruction to the active function. +func (c *Context) SETPL(mr operand.Op) { + if inst, err := x86.SETPL(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SETPL: Set byte if not sign (SF == 0). +// +// Forms: +// +// SETPL r8 +// SETPL m8 +// Construct and append a SETPL instruction to the active function. +// Operates on the global context. +func SETPL(mr operand.Op) { ctx.SETPL(mr) } + +// SETPS: Set byte if parity (PF == 1). +// +// Forms: +// +// SETPS r8 +// SETPS m8 +// Construct and append a SETPS instruction to the active function. +func (c *Context) SETPS(mr operand.Op) { + if inst, err := x86.SETPS(mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SETPS: Set byte if parity (PF == 1). +// +// Forms: +// +// SETPS r8 +// SETPS m8 +// Construct and append a SETPS instruction to the active function. +// Operates on the global context. +func SETPS(mr operand.Op) { ctx.SETPS(mr) } + +// SFENCE: Store Fence. +// +// Forms: +// +// SFENCE +// Construct and append a SFENCE instruction to the active function. +func (c *Context) SFENCE() { + if inst, err := x86.SFENCE(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SFENCE: Store Fence. +// +// Forms: +// +// SFENCE +// Construct and append a SFENCE instruction to the active function. +// Operates on the global context. +func SFENCE() { ctx.SFENCE() } + +// SHA1MSG1: Perform an Intermediate Calculation for the Next Four SHA1 Message Doublewords. +// +// Forms: +// +// SHA1MSG1 xmm xmm +// SHA1MSG1 m128 xmm +// Construct and append a SHA1MSG1 instruction to the active function. +func (c *Context) SHA1MSG1(mx, x operand.Op) { + if inst, err := x86.SHA1MSG1(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHA1MSG1: Perform an Intermediate Calculation for the Next Four SHA1 Message Doublewords. +// +// Forms: +// +// SHA1MSG1 xmm xmm +// SHA1MSG1 m128 xmm +// Construct and append a SHA1MSG1 instruction to the active function. +// Operates on the global context. +func SHA1MSG1(mx, x operand.Op) { ctx.SHA1MSG1(mx, x) } + +// SHA1MSG2: Perform a Final Calculation for the Next Four SHA1 Message Doublewords. +// +// Forms: +// +// SHA1MSG2 xmm xmm +// SHA1MSG2 m128 xmm +// Construct and append a SHA1MSG2 instruction to the active function. +func (c *Context) SHA1MSG2(mx, x operand.Op) { + if inst, err := x86.SHA1MSG2(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHA1MSG2: Perform a Final Calculation for the Next Four SHA1 Message Doublewords. +// +// Forms: +// +// SHA1MSG2 xmm xmm +// SHA1MSG2 m128 xmm +// Construct and append a SHA1MSG2 instruction to the active function. +// Operates on the global context. +func SHA1MSG2(mx, x operand.Op) { ctx.SHA1MSG2(mx, x) } + +// SHA1NEXTE: Calculate SHA1 State Variable E after Four Rounds. +// +// Forms: +// +// SHA1NEXTE xmm xmm +// SHA1NEXTE m128 xmm +// Construct and append a SHA1NEXTE instruction to the active function. +func (c *Context) SHA1NEXTE(mx, x operand.Op) { + if inst, err := x86.SHA1NEXTE(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHA1NEXTE: Calculate SHA1 State Variable E after Four Rounds. +// +// Forms: +// +// SHA1NEXTE xmm xmm +// SHA1NEXTE m128 xmm +// Construct and append a SHA1NEXTE instruction to the active function. +// Operates on the global context. +func SHA1NEXTE(mx, x operand.Op) { ctx.SHA1NEXTE(mx, x) } + +// SHA1RNDS4: Perform Four Rounds of SHA1 Operation. +// +// Forms: +// +// SHA1RNDS4 imm2u xmm xmm +// SHA1RNDS4 imm2u m128 xmm +// Construct and append a SHA1RNDS4 instruction to the active function. +func (c *Context) SHA1RNDS4(i, mx, x operand.Op) { + if inst, err := x86.SHA1RNDS4(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHA1RNDS4: Perform Four Rounds of SHA1 Operation. +// +// Forms: +// +// SHA1RNDS4 imm2u xmm xmm +// SHA1RNDS4 imm2u m128 xmm +// Construct and append a SHA1RNDS4 instruction to the active function. +// Operates on the global context. +func SHA1RNDS4(i, mx, x operand.Op) { ctx.SHA1RNDS4(i, mx, x) } + +// SHA256MSG1: Perform an Intermediate Calculation for the Next Four SHA256 Message Doublewords. +// +// Forms: +// +// SHA256MSG1 xmm xmm +// SHA256MSG1 m128 xmm +// Construct and append a SHA256MSG1 instruction to the active function. +func (c *Context) SHA256MSG1(mx, x operand.Op) { + if inst, err := x86.SHA256MSG1(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHA256MSG1: Perform an Intermediate Calculation for the Next Four SHA256 Message Doublewords. +// +// Forms: +// +// SHA256MSG1 xmm xmm +// SHA256MSG1 m128 xmm +// Construct and append a SHA256MSG1 instruction to the active function. +// Operates on the global context. +func SHA256MSG1(mx, x operand.Op) { ctx.SHA256MSG1(mx, x) } + +// SHA256MSG2: Perform a Final Calculation for the Next Four SHA256 Message Doublewords. +// +// Forms: +// +// SHA256MSG2 xmm xmm +// SHA256MSG2 m128 xmm +// Construct and append a SHA256MSG2 instruction to the active function. +func (c *Context) SHA256MSG2(mx, x operand.Op) { + if inst, err := x86.SHA256MSG2(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHA256MSG2: Perform a Final Calculation for the Next Four SHA256 Message Doublewords. +// +// Forms: +// +// SHA256MSG2 xmm xmm +// SHA256MSG2 m128 xmm +// Construct and append a SHA256MSG2 instruction to the active function. +// Operates on the global context. +func SHA256MSG2(mx, x operand.Op) { ctx.SHA256MSG2(mx, x) } + +// SHA256RNDS2: Perform Two Rounds of SHA256 Operation. +// +// Forms: +// +// SHA256RNDS2 xmm0 xmm xmm +// SHA256RNDS2 xmm0 m128 xmm +// Construct and append a SHA256RNDS2 instruction to the active function. +func (c *Context) SHA256RNDS2(x, mx, x1 operand.Op) { + if inst, err := x86.SHA256RNDS2(x, mx, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHA256RNDS2: Perform Two Rounds of SHA256 Operation. +// +// Forms: +// +// SHA256RNDS2 xmm0 xmm xmm +// SHA256RNDS2 xmm0 m128 xmm +// Construct and append a SHA256RNDS2 instruction to the active function. +// Operates on the global context. +func SHA256RNDS2(x, mx, x1 operand.Op) { ctx.SHA256RNDS2(x, mx, x1) } + +// SHLB: Logical Shift Left. +// +// Forms: +// +// SHLB 1 r8 +// SHLB imm8 r8 +// SHLB cl r8 +// SHLB 1 m8 +// SHLB imm8 m8 +// SHLB cl m8 +// Construct and append a SHLB instruction to the active function. +func (c *Context) SHLB(ci, mr operand.Op) { + if inst, err := x86.SHLB(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHLB: Logical Shift Left. +// +// Forms: +// +// SHLB 1 r8 +// SHLB imm8 r8 +// SHLB cl r8 +// SHLB 1 m8 +// SHLB imm8 m8 +// SHLB cl m8 +// Construct and append a SHLB instruction to the active function. +// Operates on the global context. +func SHLB(ci, mr operand.Op) { ctx.SHLB(ci, mr) } + +// SHLL: Logical Shift Left. +// +// Forms: +// +// SHLL 1 r32 +// SHLL imm8 r32 +// SHLL cl r32 +// SHLL 1 m32 +// SHLL imm8 m32 +// SHLL cl m32 +// SHLL imm8 r32 r32 +// SHLL cl r32 r32 +// SHLL imm8 r32 m32 +// SHLL cl r32 m32 +// Construct and append a SHLL instruction to the active function. +func (c *Context) SHLL(ops ...operand.Op) { + if inst, err := x86.SHLL(ops...); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHLL: Logical Shift Left. +// +// Forms: +// +// SHLL 1 r32 +// SHLL imm8 r32 +// SHLL cl r32 +// SHLL 1 m32 +// SHLL imm8 m32 +// SHLL cl m32 +// SHLL imm8 r32 r32 +// SHLL cl r32 r32 +// SHLL imm8 r32 m32 +// SHLL cl r32 m32 +// Construct and append a SHLL instruction to the active function. +// Operates on the global context. +func SHLL(ops ...operand.Op) { ctx.SHLL(ops...) } + +// SHLQ: Logical Shift Left. +// +// Forms: +// +// SHLQ 1 r64 +// SHLQ imm8 r64 +// SHLQ cl r64 +// SHLQ 1 m64 +// SHLQ imm8 m64 +// SHLQ cl m64 +// SHLQ imm8 r64 r64 +// SHLQ cl r64 r64 +// SHLQ imm8 r64 m64 +// SHLQ cl r64 m64 +// Construct and append a SHLQ instruction to the active function. +func (c *Context) SHLQ(ops ...operand.Op) { + if inst, err := x86.SHLQ(ops...); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHLQ: Logical Shift Left. +// +// Forms: +// +// SHLQ 1 r64 +// SHLQ imm8 r64 +// SHLQ cl r64 +// SHLQ 1 m64 +// SHLQ imm8 m64 +// SHLQ cl m64 +// SHLQ imm8 r64 r64 +// SHLQ cl r64 r64 +// SHLQ imm8 r64 m64 +// SHLQ cl r64 m64 +// Construct and append a SHLQ instruction to the active function. +// Operates on the global context. +func SHLQ(ops ...operand.Op) { ctx.SHLQ(ops...) } + +// SHLW: Logical Shift Left. +// +// Forms: +// +// SHLW 1 r16 +// SHLW imm8 r16 +// SHLW cl r16 +// SHLW 1 m16 +// SHLW imm8 m16 +// SHLW cl m16 +// SHLW imm8 r16 r16 +// SHLW cl r16 r16 +// SHLW imm8 r16 m16 +// SHLW cl r16 m16 +// Construct and append a SHLW instruction to the active function. +func (c *Context) SHLW(ops ...operand.Op) { + if inst, err := x86.SHLW(ops...); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHLW: Logical Shift Left. +// +// Forms: +// +// SHLW 1 r16 +// SHLW imm8 r16 +// SHLW cl r16 +// SHLW 1 m16 +// SHLW imm8 m16 +// SHLW cl m16 +// SHLW imm8 r16 r16 +// SHLW cl r16 r16 +// SHLW imm8 r16 m16 +// SHLW cl r16 m16 +// Construct and append a SHLW instruction to the active function. +// Operates on the global context. +func SHLW(ops ...operand.Op) { ctx.SHLW(ops...) } + +// SHLXL: Logical Shift Left Without Affecting Flags. +// +// Forms: +// +// SHLXL r32 r32 r32 +// SHLXL r32 m32 r32 +// Construct and append a SHLXL instruction to the active function. +func (c *Context) SHLXL(r, mr, r1 operand.Op) { + if inst, err := x86.SHLXL(r, mr, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHLXL: Logical Shift Left Without Affecting Flags. +// +// Forms: +// +// SHLXL r32 r32 r32 +// SHLXL r32 m32 r32 +// Construct and append a SHLXL instruction to the active function. +// Operates on the global context. +func SHLXL(r, mr, r1 operand.Op) { ctx.SHLXL(r, mr, r1) } + +// SHLXQ: Logical Shift Left Without Affecting Flags. +// +// Forms: +// +// SHLXQ r64 r64 r64 +// SHLXQ r64 m64 r64 +// Construct and append a SHLXQ instruction to the active function. +func (c *Context) SHLXQ(r, mr, r1 operand.Op) { + if inst, err := x86.SHLXQ(r, mr, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHLXQ: Logical Shift Left Without Affecting Flags. +// +// Forms: +// +// SHLXQ r64 r64 r64 +// SHLXQ r64 m64 r64 +// Construct and append a SHLXQ instruction to the active function. +// Operates on the global context. +func SHLXQ(r, mr, r1 operand.Op) { ctx.SHLXQ(r, mr, r1) } + +// SHRB: Logical Shift Right. +// +// Forms: +// +// SHRB 1 r8 +// SHRB imm8 r8 +// SHRB cl r8 +// SHRB 1 m8 +// SHRB imm8 m8 +// SHRB cl m8 +// Construct and append a SHRB instruction to the active function. +func (c *Context) SHRB(ci, mr operand.Op) { + if inst, err := x86.SHRB(ci, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHRB: Logical Shift Right. +// +// Forms: +// +// SHRB 1 r8 +// SHRB imm8 r8 +// SHRB cl r8 +// SHRB 1 m8 +// SHRB imm8 m8 +// SHRB cl m8 +// Construct and append a SHRB instruction to the active function. +// Operates on the global context. +func SHRB(ci, mr operand.Op) { ctx.SHRB(ci, mr) } + +// SHRL: Logical Shift Right. +// +// Forms: +// +// SHRL 1 r32 +// SHRL imm8 r32 +// SHRL cl r32 +// SHRL 1 m32 +// SHRL imm8 m32 +// SHRL cl m32 +// SHRL imm8 r32 r32 +// SHRL cl r32 r32 +// SHRL imm8 r32 m32 +// SHRL cl r32 m32 +// Construct and append a SHRL instruction to the active function. +func (c *Context) SHRL(ops ...operand.Op) { + if inst, err := x86.SHRL(ops...); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHRL: Logical Shift Right. +// +// Forms: +// +// SHRL 1 r32 +// SHRL imm8 r32 +// SHRL cl r32 +// SHRL 1 m32 +// SHRL imm8 m32 +// SHRL cl m32 +// SHRL imm8 r32 r32 +// SHRL cl r32 r32 +// SHRL imm8 r32 m32 +// SHRL cl r32 m32 +// Construct and append a SHRL instruction to the active function. +// Operates on the global context. +func SHRL(ops ...operand.Op) { ctx.SHRL(ops...) } + +// SHRQ: Logical Shift Right. +// +// Forms: +// +// SHRQ 1 r64 +// SHRQ imm8 r64 +// SHRQ cl r64 +// SHRQ 1 m64 +// SHRQ imm8 m64 +// SHRQ cl m64 +// SHRQ imm8 r64 r64 +// SHRQ cl r64 r64 +// SHRQ imm8 r64 m64 +// SHRQ cl r64 m64 +// Construct and append a SHRQ instruction to the active function. +func (c *Context) SHRQ(ops ...operand.Op) { + if inst, err := x86.SHRQ(ops...); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHRQ: Logical Shift Right. +// +// Forms: +// +// SHRQ 1 r64 +// SHRQ imm8 r64 +// SHRQ cl r64 +// SHRQ 1 m64 +// SHRQ imm8 m64 +// SHRQ cl m64 +// SHRQ imm8 r64 r64 +// SHRQ cl r64 r64 +// SHRQ imm8 r64 m64 +// SHRQ cl r64 m64 +// Construct and append a SHRQ instruction to the active function. +// Operates on the global context. +func SHRQ(ops ...operand.Op) { ctx.SHRQ(ops...) } + +// SHRW: Logical Shift Right. +// +// Forms: +// +// SHRW 1 r16 +// SHRW imm8 r16 +// SHRW cl r16 +// SHRW 1 m16 +// SHRW imm8 m16 +// SHRW cl m16 +// SHRW imm8 r16 r16 +// SHRW cl r16 r16 +// SHRW imm8 r16 m16 +// SHRW cl r16 m16 +// Construct and append a SHRW instruction to the active function. +func (c *Context) SHRW(ops ...operand.Op) { + if inst, err := x86.SHRW(ops...); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHRW: Logical Shift Right. +// +// Forms: +// +// SHRW 1 r16 +// SHRW imm8 r16 +// SHRW cl r16 +// SHRW 1 m16 +// SHRW imm8 m16 +// SHRW cl m16 +// SHRW imm8 r16 r16 +// SHRW cl r16 r16 +// SHRW imm8 r16 m16 +// SHRW cl r16 m16 +// Construct and append a SHRW instruction to the active function. +// Operates on the global context. +func SHRW(ops ...operand.Op) { ctx.SHRW(ops...) } + +// SHRXL: Logical Shift Right Without Affecting Flags. +// +// Forms: +// +// SHRXL r32 r32 r32 +// SHRXL r32 m32 r32 +// Construct and append a SHRXL instruction to the active function. +func (c *Context) SHRXL(r, mr, r1 operand.Op) { + if inst, err := x86.SHRXL(r, mr, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHRXL: Logical Shift Right Without Affecting Flags. +// +// Forms: +// +// SHRXL r32 r32 r32 +// SHRXL r32 m32 r32 +// Construct and append a SHRXL instruction to the active function. +// Operates on the global context. +func SHRXL(r, mr, r1 operand.Op) { ctx.SHRXL(r, mr, r1) } + +// SHRXQ: Logical Shift Right Without Affecting Flags. +// +// Forms: +// +// SHRXQ r64 r64 r64 +// SHRXQ r64 m64 r64 +// Construct and append a SHRXQ instruction to the active function. +func (c *Context) SHRXQ(r, mr, r1 operand.Op) { + if inst, err := x86.SHRXQ(r, mr, r1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHRXQ: Logical Shift Right Without Affecting Flags. +// +// Forms: +// +// SHRXQ r64 r64 r64 +// SHRXQ r64 m64 r64 +// Construct and append a SHRXQ instruction to the active function. +// Operates on the global context. +func SHRXQ(r, mr, r1 operand.Op) { ctx.SHRXQ(r, mr, r1) } + +// SHUFPD: Shuffle Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// SHUFPD imm8 xmm xmm +// SHUFPD imm8 m128 xmm +// Construct and append a SHUFPD instruction to the active function. +func (c *Context) SHUFPD(i, mx, x operand.Op) { + if inst, err := x86.SHUFPD(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHUFPD: Shuffle Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// SHUFPD imm8 xmm xmm +// SHUFPD imm8 m128 xmm +// Construct and append a SHUFPD instruction to the active function. +// Operates on the global context. +func SHUFPD(i, mx, x operand.Op) { ctx.SHUFPD(i, mx, x) } + +// SHUFPS: Shuffle Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// SHUFPS imm8 xmm xmm +// SHUFPS imm8 m128 xmm +// Construct and append a SHUFPS instruction to the active function. +func (c *Context) SHUFPS(i, mx, x operand.Op) { + if inst, err := x86.SHUFPS(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SHUFPS: Shuffle Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// SHUFPS imm8 xmm xmm +// SHUFPS imm8 m128 xmm +// Construct and append a SHUFPS instruction to the active function. +// Operates on the global context. +func SHUFPS(i, mx, x operand.Op) { ctx.SHUFPS(i, mx, x) } + +// SQRTPD: Compute Square Roots of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// SQRTPD xmm xmm +// SQRTPD m128 xmm +// Construct and append a SQRTPD instruction to the active function. +func (c *Context) SQRTPD(mx, x operand.Op) { + if inst, err := x86.SQRTPD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SQRTPD: Compute Square Roots of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// SQRTPD xmm xmm +// SQRTPD m128 xmm +// Construct and append a SQRTPD instruction to the active function. +// Operates on the global context. +func SQRTPD(mx, x operand.Op) { ctx.SQRTPD(mx, x) } + +// SQRTPS: Compute Square Roots of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// SQRTPS xmm xmm +// SQRTPS m128 xmm +// Construct and append a SQRTPS instruction to the active function. +func (c *Context) SQRTPS(mx, x operand.Op) { + if inst, err := x86.SQRTPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SQRTPS: Compute Square Roots of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// SQRTPS xmm xmm +// SQRTPS m128 xmm +// Construct and append a SQRTPS instruction to the active function. +// Operates on the global context. +func SQRTPS(mx, x operand.Op) { ctx.SQRTPS(mx, x) } + +// SQRTSD: Compute Square Root of Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// SQRTSD xmm xmm +// SQRTSD m64 xmm +// Construct and append a SQRTSD instruction to the active function. +func (c *Context) SQRTSD(mx, x operand.Op) { + if inst, err := x86.SQRTSD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SQRTSD: Compute Square Root of Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// SQRTSD xmm xmm +// SQRTSD m64 xmm +// Construct and append a SQRTSD instruction to the active function. +// Operates on the global context. +func SQRTSD(mx, x operand.Op) { ctx.SQRTSD(mx, x) } + +// SQRTSS: Compute Square Root of Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// SQRTSS xmm xmm +// SQRTSS m32 xmm +// Construct and append a SQRTSS instruction to the active function. +func (c *Context) SQRTSS(mx, x operand.Op) { + if inst, err := x86.SQRTSS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SQRTSS: Compute Square Root of Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// SQRTSS xmm xmm +// SQRTSS m32 xmm +// Construct and append a SQRTSS instruction to the active function. +// Operates on the global context. +func SQRTSS(mx, x operand.Op) { ctx.SQRTSS(mx, x) } + +// STC: Set Carry Flag. +// +// Forms: +// +// STC +// Construct and append a STC instruction to the active function. +func (c *Context) STC() { + if inst, err := x86.STC(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// STC: Set Carry Flag. +// +// Forms: +// +// STC +// Construct and append a STC instruction to the active function. +// Operates on the global context. +func STC() { ctx.STC() } + +// STD: Set Direction Flag. +// +// Forms: +// +// STD +// Construct and append a STD instruction to the active function. +func (c *Context) STD() { + if inst, err := x86.STD(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// STD: Set Direction Flag. +// +// Forms: +// +// STD +// Construct and append a STD instruction to the active function. +// Operates on the global context. +func STD() { ctx.STD() } + +// STMXCSR: Store MXCSR Register State. +// +// Forms: +// +// STMXCSR m32 +// Construct and append a STMXCSR instruction to the active function. +func (c *Context) STMXCSR(m operand.Op) { + if inst, err := x86.STMXCSR(m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// STMXCSR: Store MXCSR Register State. +// +// Forms: +// +// STMXCSR m32 +// Construct and append a STMXCSR instruction to the active function. +// Operates on the global context. +func STMXCSR(m operand.Op) { ctx.STMXCSR(m) } + +// SUBB: Subtract. +// +// Forms: +// +// SUBB imm8 al +// SUBB imm8 r8 +// SUBB r8 r8 +// SUBB m8 r8 +// SUBB imm8 m8 +// SUBB r8 m8 +// Construct and append a SUBB instruction to the active function. +func (c *Context) SUBB(imr, amr operand.Op) { + if inst, err := x86.SUBB(imr, amr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SUBB: Subtract. +// +// Forms: +// +// SUBB imm8 al +// SUBB imm8 r8 +// SUBB r8 r8 +// SUBB m8 r8 +// SUBB imm8 m8 +// SUBB r8 m8 +// Construct and append a SUBB instruction to the active function. +// Operates on the global context. +func SUBB(imr, amr operand.Op) { ctx.SUBB(imr, amr) } + +// SUBL: Subtract. +// +// Forms: +// +// SUBL imm32 eax +// SUBL imm8 r32 +// SUBL imm32 r32 +// SUBL r32 r32 +// SUBL m32 r32 +// SUBL imm8 m32 +// SUBL imm32 m32 +// SUBL r32 m32 +// Construct and append a SUBL instruction to the active function. +func (c *Context) SUBL(imr, emr operand.Op) { + if inst, err := x86.SUBL(imr, emr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SUBL: Subtract. +// +// Forms: +// +// SUBL imm32 eax +// SUBL imm8 r32 +// SUBL imm32 r32 +// SUBL r32 r32 +// SUBL m32 r32 +// SUBL imm8 m32 +// SUBL imm32 m32 +// SUBL r32 m32 +// Construct and append a SUBL instruction to the active function. +// Operates on the global context. +func SUBL(imr, emr operand.Op) { ctx.SUBL(imr, emr) } + +// SUBPD: Subtract Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// SUBPD xmm xmm +// SUBPD m128 xmm +// Construct and append a SUBPD instruction to the active function. +func (c *Context) SUBPD(mx, x operand.Op) { + if inst, err := x86.SUBPD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SUBPD: Subtract Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// SUBPD xmm xmm +// SUBPD m128 xmm +// Construct and append a SUBPD instruction to the active function. +// Operates on the global context. +func SUBPD(mx, x operand.Op) { ctx.SUBPD(mx, x) } + +// SUBPS: Subtract Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// SUBPS xmm xmm +// SUBPS m128 xmm +// Construct and append a SUBPS instruction to the active function. +func (c *Context) SUBPS(mx, x operand.Op) { + if inst, err := x86.SUBPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SUBPS: Subtract Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// SUBPS xmm xmm +// SUBPS m128 xmm +// Construct and append a SUBPS instruction to the active function. +// Operates on the global context. +func SUBPS(mx, x operand.Op) { ctx.SUBPS(mx, x) } + +// SUBQ: Subtract. +// +// Forms: +// +// SUBQ imm32 rax +// SUBQ imm8 r64 +// SUBQ imm32 r64 +// SUBQ r64 r64 +// SUBQ m64 r64 +// SUBQ imm8 m64 +// SUBQ imm32 m64 +// SUBQ r64 m64 +// Construct and append a SUBQ instruction to the active function. +func (c *Context) SUBQ(imr, mr operand.Op) { + if inst, err := x86.SUBQ(imr, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SUBQ: Subtract. +// +// Forms: +// +// SUBQ imm32 rax +// SUBQ imm8 r64 +// SUBQ imm32 r64 +// SUBQ r64 r64 +// SUBQ m64 r64 +// SUBQ imm8 m64 +// SUBQ imm32 m64 +// SUBQ r64 m64 +// Construct and append a SUBQ instruction to the active function. +// Operates on the global context. +func SUBQ(imr, mr operand.Op) { ctx.SUBQ(imr, mr) } + +// SUBSD: Subtract Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// SUBSD xmm xmm +// SUBSD m64 xmm +// Construct and append a SUBSD instruction to the active function. +func (c *Context) SUBSD(mx, x operand.Op) { + if inst, err := x86.SUBSD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SUBSD: Subtract Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// SUBSD xmm xmm +// SUBSD m64 xmm +// Construct and append a SUBSD instruction to the active function. +// Operates on the global context. +func SUBSD(mx, x operand.Op) { ctx.SUBSD(mx, x) } + +// SUBSS: Subtract Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// SUBSS xmm xmm +// SUBSS m32 xmm +// Construct and append a SUBSS instruction to the active function. +func (c *Context) SUBSS(mx, x operand.Op) { + if inst, err := x86.SUBSS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SUBSS: Subtract Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// SUBSS xmm xmm +// SUBSS m32 xmm +// Construct and append a SUBSS instruction to the active function. +// Operates on the global context. +func SUBSS(mx, x operand.Op) { ctx.SUBSS(mx, x) } + +// SUBW: Subtract. +// +// Forms: +// +// SUBW imm16 ax +// SUBW imm8 r16 +// SUBW imm16 r16 +// SUBW r16 r16 +// SUBW m16 r16 +// SUBW imm8 m16 +// SUBW imm16 m16 +// SUBW r16 m16 +// Construct and append a SUBW instruction to the active function. +func (c *Context) SUBW(imr, amr operand.Op) { + if inst, err := x86.SUBW(imr, amr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SUBW: Subtract. +// +// Forms: +// +// SUBW imm16 ax +// SUBW imm8 r16 +// SUBW imm16 r16 +// SUBW r16 r16 +// SUBW m16 r16 +// SUBW imm8 m16 +// SUBW imm16 m16 +// SUBW r16 m16 +// Construct and append a SUBW instruction to the active function. +// Operates on the global context. +func SUBW(imr, amr operand.Op) { ctx.SUBW(imr, amr) } + +// SYSCALL: Fast System Call. +// +// Forms: +// +// SYSCALL +// Construct and append a SYSCALL instruction to the active function. +func (c *Context) SYSCALL() { + if inst, err := x86.SYSCALL(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// SYSCALL: Fast System Call. +// +// Forms: +// +// SYSCALL +// Construct and append a SYSCALL instruction to the active function. +// Operates on the global context. +func SYSCALL() { ctx.SYSCALL() } + +// TESTB: Logical Compare. +// +// Forms: +// +// TESTB imm8 al +// TESTB imm8 r8 +// TESTB r8 r8 +// TESTB imm8 m8 +// TESTB r8 m8 +// Construct and append a TESTB instruction to the active function. +func (c *Context) TESTB(ir, amr operand.Op) { + if inst, err := x86.TESTB(ir, amr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// TESTB: Logical Compare. +// +// Forms: +// +// TESTB imm8 al +// TESTB imm8 r8 +// TESTB r8 r8 +// TESTB imm8 m8 +// TESTB r8 m8 +// Construct and append a TESTB instruction to the active function. +// Operates on the global context. +func TESTB(ir, amr operand.Op) { ctx.TESTB(ir, amr) } + +// TESTL: Logical Compare. +// +// Forms: +// +// TESTL imm32 eax +// TESTL imm32 r32 +// TESTL r32 r32 +// TESTL imm32 m32 +// TESTL r32 m32 +// Construct and append a TESTL instruction to the active function. +func (c *Context) TESTL(ir, emr operand.Op) { + if inst, err := x86.TESTL(ir, emr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// TESTL: Logical Compare. +// +// Forms: +// +// TESTL imm32 eax +// TESTL imm32 r32 +// TESTL r32 r32 +// TESTL imm32 m32 +// TESTL r32 m32 +// Construct and append a TESTL instruction to the active function. +// Operates on the global context. +func TESTL(ir, emr operand.Op) { ctx.TESTL(ir, emr) } + +// TESTQ: Logical Compare. +// +// Forms: +// +// TESTQ imm32 rax +// TESTQ imm32 r64 +// TESTQ r64 r64 +// TESTQ imm32 m64 +// TESTQ r64 m64 +// Construct and append a TESTQ instruction to the active function. +func (c *Context) TESTQ(ir, mr operand.Op) { + if inst, err := x86.TESTQ(ir, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// TESTQ: Logical Compare. +// +// Forms: +// +// TESTQ imm32 rax +// TESTQ imm32 r64 +// TESTQ r64 r64 +// TESTQ imm32 m64 +// TESTQ r64 m64 +// Construct and append a TESTQ instruction to the active function. +// Operates on the global context. +func TESTQ(ir, mr operand.Op) { ctx.TESTQ(ir, mr) } + +// TESTW: Logical Compare. +// +// Forms: +// +// TESTW imm16 ax +// TESTW imm16 r16 +// TESTW r16 r16 +// TESTW imm16 m16 +// TESTW r16 m16 +// Construct and append a TESTW instruction to the active function. +func (c *Context) TESTW(ir, amr operand.Op) { + if inst, err := x86.TESTW(ir, amr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// TESTW: Logical Compare. +// +// Forms: +// +// TESTW imm16 ax +// TESTW imm16 r16 +// TESTW r16 r16 +// TESTW imm16 m16 +// TESTW r16 m16 +// Construct and append a TESTW instruction to the active function. +// Operates on the global context. +func TESTW(ir, amr operand.Op) { ctx.TESTW(ir, amr) } + +// TZCNTL: Count the Number of Trailing Zero Bits. +// +// Forms: +// +// TZCNTL r32 r32 +// TZCNTL m32 r32 +// Construct and append a TZCNTL instruction to the active function. +func (c *Context) TZCNTL(mr, r operand.Op) { + if inst, err := x86.TZCNTL(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// TZCNTL: Count the Number of Trailing Zero Bits. +// +// Forms: +// +// TZCNTL r32 r32 +// TZCNTL m32 r32 +// Construct and append a TZCNTL instruction to the active function. +// Operates on the global context. +func TZCNTL(mr, r operand.Op) { ctx.TZCNTL(mr, r) } + +// TZCNTQ: Count the Number of Trailing Zero Bits. +// +// Forms: +// +// TZCNTQ r64 r64 +// TZCNTQ m64 r64 +// Construct and append a TZCNTQ instruction to the active function. +func (c *Context) TZCNTQ(mr, r operand.Op) { + if inst, err := x86.TZCNTQ(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// TZCNTQ: Count the Number of Trailing Zero Bits. +// +// Forms: +// +// TZCNTQ r64 r64 +// TZCNTQ m64 r64 +// Construct and append a TZCNTQ instruction to the active function. +// Operates on the global context. +func TZCNTQ(mr, r operand.Op) { ctx.TZCNTQ(mr, r) } + +// TZCNTW: Count the Number of Trailing Zero Bits. +// +// Forms: +// +// TZCNTW r16 r16 +// TZCNTW m16 r16 +// Construct and append a TZCNTW instruction to the active function. +func (c *Context) TZCNTW(mr, r operand.Op) { + if inst, err := x86.TZCNTW(mr, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// TZCNTW: Count the Number of Trailing Zero Bits. +// +// Forms: +// +// TZCNTW r16 r16 +// TZCNTW m16 r16 +// Construct and append a TZCNTW instruction to the active function. +// Operates on the global context. +func TZCNTW(mr, r operand.Op) { ctx.TZCNTW(mr, r) } + +// UCOMISD: Unordered Compare Scalar Double-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// UCOMISD xmm xmm +// UCOMISD m64 xmm +// Construct and append a UCOMISD instruction to the active function. +func (c *Context) UCOMISD(mx, x operand.Op) { + if inst, err := x86.UCOMISD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// UCOMISD: Unordered Compare Scalar Double-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// UCOMISD xmm xmm +// UCOMISD m64 xmm +// Construct and append a UCOMISD instruction to the active function. +// Operates on the global context. +func UCOMISD(mx, x operand.Op) { ctx.UCOMISD(mx, x) } + +// UCOMISS: Unordered Compare Scalar Single-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// UCOMISS xmm xmm +// UCOMISS m32 xmm +// Construct and append a UCOMISS instruction to the active function. +func (c *Context) UCOMISS(mx, x operand.Op) { + if inst, err := x86.UCOMISS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// UCOMISS: Unordered Compare Scalar Single-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// UCOMISS xmm xmm +// UCOMISS m32 xmm +// Construct and append a UCOMISS instruction to the active function. +// Operates on the global context. +func UCOMISS(mx, x operand.Op) { ctx.UCOMISS(mx, x) } + +// UD2: Undefined Instruction. +// +// Forms: +// +// UD2 +// Construct and append a UD2 instruction to the active function. +func (c *Context) UD2() { + if inst, err := x86.UD2(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// UD2: Undefined Instruction. +// +// Forms: +// +// UD2 +// Construct and append a UD2 instruction to the active function. +// Operates on the global context. +func UD2() { ctx.UD2() } + +// UNPCKHPD: Unpack and Interleave High Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// UNPCKHPD xmm xmm +// UNPCKHPD m128 xmm +// Construct and append a UNPCKHPD instruction to the active function. +func (c *Context) UNPCKHPD(mx, x operand.Op) { + if inst, err := x86.UNPCKHPD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// UNPCKHPD: Unpack and Interleave High Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// UNPCKHPD xmm xmm +// UNPCKHPD m128 xmm +// Construct and append a UNPCKHPD instruction to the active function. +// Operates on the global context. +func UNPCKHPD(mx, x operand.Op) { ctx.UNPCKHPD(mx, x) } + +// UNPCKHPS: Unpack and Interleave High Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// UNPCKHPS xmm xmm +// UNPCKHPS m128 xmm +// Construct and append a UNPCKHPS instruction to the active function. +func (c *Context) UNPCKHPS(mx, x operand.Op) { + if inst, err := x86.UNPCKHPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// UNPCKHPS: Unpack and Interleave High Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// UNPCKHPS xmm xmm +// UNPCKHPS m128 xmm +// Construct and append a UNPCKHPS instruction to the active function. +// Operates on the global context. +func UNPCKHPS(mx, x operand.Op) { ctx.UNPCKHPS(mx, x) } + +// UNPCKLPD: Unpack and Interleave Low Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// UNPCKLPD xmm xmm +// UNPCKLPD m128 xmm +// Construct and append a UNPCKLPD instruction to the active function. +func (c *Context) UNPCKLPD(mx, x operand.Op) { + if inst, err := x86.UNPCKLPD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// UNPCKLPD: Unpack and Interleave Low Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// UNPCKLPD xmm xmm +// UNPCKLPD m128 xmm +// Construct and append a UNPCKLPD instruction to the active function. +// Operates on the global context. +func UNPCKLPD(mx, x operand.Op) { ctx.UNPCKLPD(mx, x) } + +// UNPCKLPS: Unpack and Interleave Low Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// UNPCKLPS xmm xmm +// UNPCKLPS m128 xmm +// Construct and append a UNPCKLPS instruction to the active function. +func (c *Context) UNPCKLPS(mx, x operand.Op) { + if inst, err := x86.UNPCKLPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// UNPCKLPS: Unpack and Interleave Low Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// UNPCKLPS xmm xmm +// UNPCKLPS m128 xmm +// Construct and append a UNPCKLPS instruction to the active function. +// Operates on the global context. +func UNPCKLPS(mx, x operand.Op) { ctx.UNPCKLPS(mx, x) } + +// VADDPD: Add Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VADDPD xmm xmm xmm +// VADDPD m128 xmm xmm +// VADDPD ymm ymm ymm +// VADDPD m256 ymm ymm +// Construct and append a VADDPD instruction to the active function. +func (c *Context) VADDPD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VADDPD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VADDPD: Add Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VADDPD xmm xmm xmm +// VADDPD m128 xmm xmm +// VADDPD ymm ymm ymm +// VADDPD m256 ymm ymm +// Construct and append a VADDPD instruction to the active function. +// Operates on the global context. +func VADDPD(mxy, xy, xy1 operand.Op) { ctx.VADDPD(mxy, xy, xy1) } + +// VADDPS: Add Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VADDPS xmm xmm xmm +// VADDPS m128 xmm xmm +// VADDPS ymm ymm ymm +// VADDPS m256 ymm ymm +// Construct and append a VADDPS instruction to the active function. +func (c *Context) VADDPS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VADDPS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VADDPS: Add Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VADDPS xmm xmm xmm +// VADDPS m128 xmm xmm +// VADDPS ymm ymm ymm +// VADDPS m256 ymm ymm +// Construct and append a VADDPS instruction to the active function. +// Operates on the global context. +func VADDPS(mxy, xy, xy1 operand.Op) { ctx.VADDPS(mxy, xy, xy1) } + +// VADDSD: Add Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VADDSD xmm xmm xmm +// VADDSD m64 xmm xmm +// Construct and append a VADDSD instruction to the active function. +func (c *Context) VADDSD(mx, x, x1 operand.Op) { + if inst, err := x86.VADDSD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VADDSD: Add Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VADDSD xmm xmm xmm +// VADDSD m64 xmm xmm +// Construct and append a VADDSD instruction to the active function. +// Operates on the global context. +func VADDSD(mx, x, x1 operand.Op) { ctx.VADDSD(mx, x, x1) } + +// VADDSS: Add Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VADDSS xmm xmm xmm +// VADDSS m32 xmm xmm +// Construct and append a VADDSS instruction to the active function. +func (c *Context) VADDSS(mx, x, x1 operand.Op) { + if inst, err := x86.VADDSS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VADDSS: Add Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VADDSS xmm xmm xmm +// VADDSS m32 xmm xmm +// Construct and append a VADDSS instruction to the active function. +// Operates on the global context. +func VADDSS(mx, x, x1 operand.Op) { ctx.VADDSS(mx, x, x1) } + +// VADDSUBPD: Packed Double-FP Add/Subtract. +// +// Forms: +// +// VADDSUBPD xmm xmm xmm +// VADDSUBPD m128 xmm xmm +// VADDSUBPD ymm ymm ymm +// VADDSUBPD m256 ymm ymm +// Construct and append a VADDSUBPD instruction to the active function. +func (c *Context) VADDSUBPD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VADDSUBPD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VADDSUBPD: Packed Double-FP Add/Subtract. +// +// Forms: +// +// VADDSUBPD xmm xmm xmm +// VADDSUBPD m128 xmm xmm +// VADDSUBPD ymm ymm ymm +// VADDSUBPD m256 ymm ymm +// Construct and append a VADDSUBPD instruction to the active function. +// Operates on the global context. +func VADDSUBPD(mxy, xy, xy1 operand.Op) { ctx.VADDSUBPD(mxy, xy, xy1) } + +// VADDSUBPS: Packed Single-FP Add/Subtract. +// +// Forms: +// +// VADDSUBPS xmm xmm xmm +// VADDSUBPS m128 xmm xmm +// VADDSUBPS ymm ymm ymm +// VADDSUBPS m256 ymm ymm +// Construct and append a VADDSUBPS instruction to the active function. +func (c *Context) VADDSUBPS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VADDSUBPS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VADDSUBPS: Packed Single-FP Add/Subtract. +// +// Forms: +// +// VADDSUBPS xmm xmm xmm +// VADDSUBPS m128 xmm xmm +// VADDSUBPS ymm ymm ymm +// VADDSUBPS m256 ymm ymm +// Construct and append a VADDSUBPS instruction to the active function. +// Operates on the global context. +func VADDSUBPS(mxy, xy, xy1 operand.Op) { ctx.VADDSUBPS(mxy, xy, xy1) } + +// VAESDEC: Perform One Round of an AES Decryption Flow. +// +// Forms: +// +// VAESDEC xmm xmm xmm +// VAESDEC m128 xmm xmm +// Construct and append a VAESDEC instruction to the active function. +func (c *Context) VAESDEC(mx, x, x1 operand.Op) { + if inst, err := x86.VAESDEC(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VAESDEC: Perform One Round of an AES Decryption Flow. +// +// Forms: +// +// VAESDEC xmm xmm xmm +// VAESDEC m128 xmm xmm +// Construct and append a VAESDEC instruction to the active function. +// Operates on the global context. +func VAESDEC(mx, x, x1 operand.Op) { ctx.VAESDEC(mx, x, x1) } + +// VAESDECLAST: Perform Last Round of an AES Decryption Flow. +// +// Forms: +// +// VAESDECLAST xmm xmm xmm +// VAESDECLAST m128 xmm xmm +// Construct and append a VAESDECLAST instruction to the active function. +func (c *Context) VAESDECLAST(mx, x, x1 operand.Op) { + if inst, err := x86.VAESDECLAST(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VAESDECLAST: Perform Last Round of an AES Decryption Flow. +// +// Forms: +// +// VAESDECLAST xmm xmm xmm +// VAESDECLAST m128 xmm xmm +// Construct and append a VAESDECLAST instruction to the active function. +// Operates on the global context. +func VAESDECLAST(mx, x, x1 operand.Op) { ctx.VAESDECLAST(mx, x, x1) } + +// VAESENC: Perform One Round of an AES Encryption Flow. +// +// Forms: +// +// VAESENC xmm xmm xmm +// VAESENC m128 xmm xmm +// Construct and append a VAESENC instruction to the active function. +func (c *Context) VAESENC(mx, x, x1 operand.Op) { + if inst, err := x86.VAESENC(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VAESENC: Perform One Round of an AES Encryption Flow. +// +// Forms: +// +// VAESENC xmm xmm xmm +// VAESENC m128 xmm xmm +// Construct and append a VAESENC instruction to the active function. +// Operates on the global context. +func VAESENC(mx, x, x1 operand.Op) { ctx.VAESENC(mx, x, x1) } + +// VAESENCLAST: Perform Last Round of an AES Encryption Flow. +// +// Forms: +// +// VAESENCLAST xmm xmm xmm +// VAESENCLAST m128 xmm xmm +// Construct and append a VAESENCLAST instruction to the active function. +func (c *Context) VAESENCLAST(mx, x, x1 operand.Op) { + if inst, err := x86.VAESENCLAST(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VAESENCLAST: Perform Last Round of an AES Encryption Flow. +// +// Forms: +// +// VAESENCLAST xmm xmm xmm +// VAESENCLAST m128 xmm xmm +// Construct and append a VAESENCLAST instruction to the active function. +// Operates on the global context. +func VAESENCLAST(mx, x, x1 operand.Op) { ctx.VAESENCLAST(mx, x, x1) } + +// VAESIMC: Perform the AES InvMixColumn Transformation. +// +// Forms: +// +// VAESIMC xmm xmm +// VAESIMC m128 xmm +// Construct and append a VAESIMC instruction to the active function. +func (c *Context) VAESIMC(mx, x operand.Op) { + if inst, err := x86.VAESIMC(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VAESIMC: Perform the AES InvMixColumn Transformation. +// +// Forms: +// +// VAESIMC xmm xmm +// VAESIMC m128 xmm +// Construct and append a VAESIMC instruction to the active function. +// Operates on the global context. +func VAESIMC(mx, x operand.Op) { ctx.VAESIMC(mx, x) } + +// VAESKEYGENASSIST: AES Round Key Generation Assist. +// +// Forms: +// +// VAESKEYGENASSIST imm8 xmm xmm +// VAESKEYGENASSIST imm8 m128 xmm +// Construct and append a VAESKEYGENASSIST instruction to the active function. +func (c *Context) VAESKEYGENASSIST(i, mx, x operand.Op) { + if inst, err := x86.VAESKEYGENASSIST(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VAESKEYGENASSIST: AES Round Key Generation Assist. +// +// Forms: +// +// VAESKEYGENASSIST imm8 xmm xmm +// VAESKEYGENASSIST imm8 m128 xmm +// Construct and append a VAESKEYGENASSIST instruction to the active function. +// Operates on the global context. +func VAESKEYGENASSIST(i, mx, x operand.Op) { ctx.VAESKEYGENASSIST(i, mx, x) } + +// VANDNPD: Bitwise Logical AND NOT of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VANDNPD xmm xmm xmm +// VANDNPD m128 xmm xmm +// VANDNPD ymm ymm ymm +// VANDNPD m256 ymm ymm +// Construct and append a VANDNPD instruction to the active function. +func (c *Context) VANDNPD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VANDNPD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VANDNPD: Bitwise Logical AND NOT of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VANDNPD xmm xmm xmm +// VANDNPD m128 xmm xmm +// VANDNPD ymm ymm ymm +// VANDNPD m256 ymm ymm +// Construct and append a VANDNPD instruction to the active function. +// Operates on the global context. +func VANDNPD(mxy, xy, xy1 operand.Op) { ctx.VANDNPD(mxy, xy, xy1) } + +// VANDNPS: Bitwise Logical AND NOT of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VANDNPS xmm xmm xmm +// VANDNPS m128 xmm xmm +// VANDNPS ymm ymm ymm +// VANDNPS m256 ymm ymm +// Construct and append a VANDNPS instruction to the active function. +func (c *Context) VANDNPS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VANDNPS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VANDNPS: Bitwise Logical AND NOT of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VANDNPS xmm xmm xmm +// VANDNPS m128 xmm xmm +// VANDNPS ymm ymm ymm +// VANDNPS m256 ymm ymm +// Construct and append a VANDNPS instruction to the active function. +// Operates on the global context. +func VANDNPS(mxy, xy, xy1 operand.Op) { ctx.VANDNPS(mxy, xy, xy1) } + +// VANDPD: Bitwise Logical AND of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VANDPD xmm xmm xmm +// VANDPD m128 xmm xmm +// VANDPD ymm ymm ymm +// VANDPD m256 ymm ymm +// Construct and append a VANDPD instruction to the active function. +func (c *Context) VANDPD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VANDPD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VANDPD: Bitwise Logical AND of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VANDPD xmm xmm xmm +// VANDPD m128 xmm xmm +// VANDPD ymm ymm ymm +// VANDPD m256 ymm ymm +// Construct and append a VANDPD instruction to the active function. +// Operates on the global context. +func VANDPD(mxy, xy, xy1 operand.Op) { ctx.VANDPD(mxy, xy, xy1) } + +// VANDPS: Bitwise Logical AND of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VANDPS xmm xmm xmm +// VANDPS m128 xmm xmm +// VANDPS ymm ymm ymm +// VANDPS m256 ymm ymm +// Construct and append a VANDPS instruction to the active function. +func (c *Context) VANDPS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VANDPS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VANDPS: Bitwise Logical AND of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VANDPS xmm xmm xmm +// VANDPS m128 xmm xmm +// VANDPS ymm ymm ymm +// VANDPS m256 ymm ymm +// Construct and append a VANDPS instruction to the active function. +// Operates on the global context. +func VANDPS(mxy, xy, xy1 operand.Op) { ctx.VANDPS(mxy, xy, xy1) } + +// VBLENDPD: Blend Packed Double Precision Floating-Point Values. +// +// Forms: +// +// VBLENDPD imm8 xmm xmm xmm +// VBLENDPD imm8 m128 xmm xmm +// VBLENDPD imm8 ymm ymm ymm +// VBLENDPD imm8 m256 ymm ymm +// Construct and append a VBLENDPD instruction to the active function. +func (c *Context) VBLENDPD(i, mxy, xy, xy1 operand.Op) { + if inst, err := x86.VBLENDPD(i, mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VBLENDPD: Blend Packed Double Precision Floating-Point Values. +// +// Forms: +// +// VBLENDPD imm8 xmm xmm xmm +// VBLENDPD imm8 m128 xmm xmm +// VBLENDPD imm8 ymm ymm ymm +// VBLENDPD imm8 m256 ymm ymm +// Construct and append a VBLENDPD instruction to the active function. +// Operates on the global context. +func VBLENDPD(i, mxy, xy, xy1 operand.Op) { ctx.VBLENDPD(i, mxy, xy, xy1) } + +// VBLENDPS: Blend Packed Single Precision Floating-Point Values. +// +// Forms: +// +// VBLENDPS imm8 xmm xmm xmm +// VBLENDPS imm8 m128 xmm xmm +// VBLENDPS imm8 ymm ymm ymm +// VBLENDPS imm8 m256 ymm ymm +// Construct and append a VBLENDPS instruction to the active function. +func (c *Context) VBLENDPS(i, mxy, xy, xy1 operand.Op) { + if inst, err := x86.VBLENDPS(i, mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VBLENDPS: Blend Packed Single Precision Floating-Point Values. +// +// Forms: +// +// VBLENDPS imm8 xmm xmm xmm +// VBLENDPS imm8 m128 xmm xmm +// VBLENDPS imm8 ymm ymm ymm +// VBLENDPS imm8 m256 ymm ymm +// Construct and append a VBLENDPS instruction to the active function. +// Operates on the global context. +func VBLENDPS(i, mxy, xy, xy1 operand.Op) { ctx.VBLENDPS(i, mxy, xy, xy1) } + +// VBLENDVPD: Variable Blend Packed Double Precision Floating-Point Values. +// +// Forms: +// +// VBLENDVPD xmm xmm xmm xmm +// VBLENDVPD xmm m128 xmm xmm +// VBLENDVPD ymm ymm ymm ymm +// VBLENDVPD ymm m256 ymm ymm +// Construct and append a VBLENDVPD instruction to the active function. +func (c *Context) VBLENDVPD(xy, mxy, xy1, xy2 operand.Op) { + if inst, err := x86.VBLENDVPD(xy, mxy, xy1, xy2); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VBLENDVPD: Variable Blend Packed Double Precision Floating-Point Values. +// +// Forms: +// +// VBLENDVPD xmm xmm xmm xmm +// VBLENDVPD xmm m128 xmm xmm +// VBLENDVPD ymm ymm ymm ymm +// VBLENDVPD ymm m256 ymm ymm +// Construct and append a VBLENDVPD instruction to the active function. +// Operates on the global context. +func VBLENDVPD(xy, mxy, xy1, xy2 operand.Op) { ctx.VBLENDVPD(xy, mxy, xy1, xy2) } + +// VBLENDVPS: Variable Blend Packed Single Precision Floating-Point Values. +// +// Forms: +// +// VBLENDVPS xmm xmm xmm xmm +// VBLENDVPS xmm m128 xmm xmm +// VBLENDVPS ymm ymm ymm ymm +// VBLENDVPS ymm m256 ymm ymm +// Construct and append a VBLENDVPS instruction to the active function. +func (c *Context) VBLENDVPS(xy, mxy, xy1, xy2 operand.Op) { + if inst, err := x86.VBLENDVPS(xy, mxy, xy1, xy2); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VBLENDVPS: Variable Blend Packed Single Precision Floating-Point Values. +// +// Forms: +// +// VBLENDVPS xmm xmm xmm xmm +// VBLENDVPS xmm m128 xmm xmm +// VBLENDVPS ymm ymm ymm ymm +// VBLENDVPS ymm m256 ymm ymm +// Construct and append a VBLENDVPS instruction to the active function. +// Operates on the global context. +func VBLENDVPS(xy, mxy, xy1, xy2 operand.Op) { ctx.VBLENDVPS(xy, mxy, xy1, xy2) } + +// VBROADCASTF128: Broadcast 128 Bit of Floating-Point Data. +// +// Forms: +// +// VBROADCASTF128 m128 ymm +// Construct and append a VBROADCASTF128 instruction to the active function. +func (c *Context) VBROADCASTF128(m, y operand.Op) { + if inst, err := x86.VBROADCASTF128(m, y); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VBROADCASTF128: Broadcast 128 Bit of Floating-Point Data. +// +// Forms: +// +// VBROADCASTF128 m128 ymm +// Construct and append a VBROADCASTF128 instruction to the active function. +// Operates on the global context. +func VBROADCASTF128(m, y operand.Op) { ctx.VBROADCASTF128(m, y) } + +// VBROADCASTI128: Broadcast 128 Bits of Integer Data. +// +// Forms: +// +// VBROADCASTI128 m128 ymm +// Construct and append a VBROADCASTI128 instruction to the active function. +func (c *Context) VBROADCASTI128(m, y operand.Op) { + if inst, err := x86.VBROADCASTI128(m, y); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VBROADCASTI128: Broadcast 128 Bits of Integer Data. +// +// Forms: +// +// VBROADCASTI128 m128 ymm +// Construct and append a VBROADCASTI128 instruction to the active function. +// Operates on the global context. +func VBROADCASTI128(m, y operand.Op) { ctx.VBROADCASTI128(m, y) } + +// VBROADCASTSD: Broadcast Double-Precision Floating-Point Element. +// +// Forms: +// +// VBROADCASTSD xmm ymm +// VBROADCASTSD m64 ymm +// Construct and append a VBROADCASTSD instruction to the active function. +func (c *Context) VBROADCASTSD(mx, y operand.Op) { + if inst, err := x86.VBROADCASTSD(mx, y); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VBROADCASTSD: Broadcast Double-Precision Floating-Point Element. +// +// Forms: +// +// VBROADCASTSD xmm ymm +// VBROADCASTSD m64 ymm +// Construct and append a VBROADCASTSD instruction to the active function. +// Operates on the global context. +func VBROADCASTSD(mx, y operand.Op) { ctx.VBROADCASTSD(mx, y) } + +// VBROADCASTSS: Broadcast Single-Precision Floating-Point Element. +// +// Forms: +// +// VBROADCASTSS xmm xmm +// VBROADCASTSS m32 xmm +// VBROADCASTSS xmm ymm +// VBROADCASTSS m32 ymm +// Construct and append a VBROADCASTSS instruction to the active function. +func (c *Context) VBROADCASTSS(mx, xy operand.Op) { + if inst, err := x86.VBROADCASTSS(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VBROADCASTSS: Broadcast Single-Precision Floating-Point Element. +// +// Forms: +// +// VBROADCASTSS xmm xmm +// VBROADCASTSS m32 xmm +// VBROADCASTSS xmm ymm +// VBROADCASTSS m32 ymm +// Construct and append a VBROADCASTSS instruction to the active function. +// Operates on the global context. +func VBROADCASTSS(mx, xy operand.Op) { ctx.VBROADCASTSS(mx, xy) } + +// VCMPPD: Compare Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VCMPPD imm8 xmm xmm xmm +// VCMPPD imm8 m128 xmm xmm +// VCMPPD imm8 ymm ymm ymm +// VCMPPD imm8 m256 ymm ymm +// Construct and append a VCMPPD instruction to the active function. +func (c *Context) VCMPPD(i, mxy, xy, xy1 operand.Op) { + if inst, err := x86.VCMPPD(i, mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCMPPD: Compare Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VCMPPD imm8 xmm xmm xmm +// VCMPPD imm8 m128 xmm xmm +// VCMPPD imm8 ymm ymm ymm +// VCMPPD imm8 m256 ymm ymm +// Construct and append a VCMPPD instruction to the active function. +// Operates on the global context. +func VCMPPD(i, mxy, xy, xy1 operand.Op) { ctx.VCMPPD(i, mxy, xy, xy1) } + +// VCMPPS: Compare Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VCMPPS imm8 xmm xmm xmm +// VCMPPS imm8 m128 xmm xmm +// VCMPPS imm8 ymm ymm ymm +// VCMPPS imm8 m256 ymm ymm +// Construct and append a VCMPPS instruction to the active function. +func (c *Context) VCMPPS(i, mxy, xy, xy1 operand.Op) { + if inst, err := x86.VCMPPS(i, mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCMPPS: Compare Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VCMPPS imm8 xmm xmm xmm +// VCMPPS imm8 m128 xmm xmm +// VCMPPS imm8 ymm ymm ymm +// VCMPPS imm8 m256 ymm ymm +// Construct and append a VCMPPS instruction to the active function. +// Operates on the global context. +func VCMPPS(i, mxy, xy, xy1 operand.Op) { ctx.VCMPPS(i, mxy, xy, xy1) } + +// VCMPSD: Compare Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VCMPSD imm8 xmm xmm xmm +// VCMPSD imm8 m64 xmm xmm +// Construct and append a VCMPSD instruction to the active function. +func (c *Context) VCMPSD(i, mx, x, x1 operand.Op) { + if inst, err := x86.VCMPSD(i, mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCMPSD: Compare Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VCMPSD imm8 xmm xmm xmm +// VCMPSD imm8 m64 xmm xmm +// Construct and append a VCMPSD instruction to the active function. +// Operates on the global context. +func VCMPSD(i, mx, x, x1 operand.Op) { ctx.VCMPSD(i, mx, x, x1) } + +// VCMPSS: Compare Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VCMPSS imm8 xmm xmm xmm +// VCMPSS imm8 m32 xmm xmm +// Construct and append a VCMPSS instruction to the active function. +func (c *Context) VCMPSS(i, mx, x, x1 operand.Op) { + if inst, err := x86.VCMPSS(i, mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCMPSS: Compare Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VCMPSS imm8 xmm xmm xmm +// VCMPSS imm8 m32 xmm xmm +// Construct and append a VCMPSS instruction to the active function. +// Operates on the global context. +func VCMPSS(i, mx, x, x1 operand.Op) { ctx.VCMPSS(i, mx, x, x1) } + +// VCOMISD: Compare Scalar Ordered Double-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// VCOMISD xmm xmm +// VCOMISD m64 xmm +// Construct and append a VCOMISD instruction to the active function. +func (c *Context) VCOMISD(mx, x operand.Op) { + if inst, err := x86.VCOMISD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCOMISD: Compare Scalar Ordered Double-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// VCOMISD xmm xmm +// VCOMISD m64 xmm +// Construct and append a VCOMISD instruction to the active function. +// Operates on the global context. +func VCOMISD(mx, x operand.Op) { ctx.VCOMISD(mx, x) } + +// VCOMISS: Compare Scalar Ordered Single-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// VCOMISS xmm xmm +// VCOMISS m32 xmm +// Construct and append a VCOMISS instruction to the active function. +func (c *Context) VCOMISS(mx, x operand.Op) { + if inst, err := x86.VCOMISS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCOMISS: Compare Scalar Ordered Single-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// VCOMISS xmm xmm +// VCOMISS m32 xmm +// Construct and append a VCOMISS instruction to the active function. +// Operates on the global context. +func VCOMISS(mx, x operand.Op) { ctx.VCOMISS(mx, x) } + +// VCVTDQ2PD: Convert Packed Dword Integers to Packed Double-Precision FP Values. +// +// Forms: +// +// VCVTDQ2PD xmm xmm +// VCVTDQ2PD m64 xmm +// VCVTDQ2PD xmm ymm +// VCVTDQ2PD m128 ymm +// Construct and append a VCVTDQ2PD instruction to the active function. +func (c *Context) VCVTDQ2PD(mx, xy operand.Op) { + if inst, err := x86.VCVTDQ2PD(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTDQ2PD: Convert Packed Dword Integers to Packed Double-Precision FP Values. +// +// Forms: +// +// VCVTDQ2PD xmm xmm +// VCVTDQ2PD m64 xmm +// VCVTDQ2PD xmm ymm +// VCVTDQ2PD m128 ymm +// Construct and append a VCVTDQ2PD instruction to the active function. +// Operates on the global context. +func VCVTDQ2PD(mx, xy operand.Op) { ctx.VCVTDQ2PD(mx, xy) } + +// VCVTDQ2PS: Convert Packed Dword Integers to Packed Single-Precision FP Values. +// +// Forms: +// +// VCVTDQ2PS xmm xmm +// VCVTDQ2PS m128 xmm +// VCVTDQ2PS ymm ymm +// VCVTDQ2PS m256 ymm +// Construct and append a VCVTDQ2PS instruction to the active function. +func (c *Context) VCVTDQ2PS(mxy, xy operand.Op) { + if inst, err := x86.VCVTDQ2PS(mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTDQ2PS: Convert Packed Dword Integers to Packed Single-Precision FP Values. +// +// Forms: +// +// VCVTDQ2PS xmm xmm +// VCVTDQ2PS m128 xmm +// VCVTDQ2PS ymm ymm +// VCVTDQ2PS m256 ymm +// Construct and append a VCVTDQ2PS instruction to the active function. +// Operates on the global context. +func VCVTDQ2PS(mxy, xy operand.Op) { ctx.VCVTDQ2PS(mxy, xy) } + +// VCVTPD2DQX: Convert Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTPD2DQX xmm xmm +// VCVTPD2DQX m128 xmm +// Construct and append a VCVTPD2DQX instruction to the active function. +func (c *Context) VCVTPD2DQX(mx, x operand.Op) { + if inst, err := x86.VCVTPD2DQX(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTPD2DQX: Convert Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTPD2DQX xmm xmm +// VCVTPD2DQX m128 xmm +// Construct and append a VCVTPD2DQX instruction to the active function. +// Operates on the global context. +func VCVTPD2DQX(mx, x operand.Op) { ctx.VCVTPD2DQX(mx, x) } + +// VCVTPD2DQY: Convert Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTPD2DQY ymm xmm +// VCVTPD2DQY m256 xmm +// Construct and append a VCVTPD2DQY instruction to the active function. +func (c *Context) VCVTPD2DQY(my, x operand.Op) { + if inst, err := x86.VCVTPD2DQY(my, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTPD2DQY: Convert Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTPD2DQY ymm xmm +// VCVTPD2DQY m256 xmm +// Construct and append a VCVTPD2DQY instruction to the active function. +// Operates on the global context. +func VCVTPD2DQY(my, x operand.Op) { ctx.VCVTPD2DQY(my, x) } + +// VCVTPD2PSX: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. +// +// Forms: +// +// VCVTPD2PSX xmm xmm +// VCVTPD2PSX m128 xmm +// Construct and append a VCVTPD2PSX instruction to the active function. +func (c *Context) VCVTPD2PSX(mx, x operand.Op) { + if inst, err := x86.VCVTPD2PSX(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTPD2PSX: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. +// +// Forms: +// +// VCVTPD2PSX xmm xmm +// VCVTPD2PSX m128 xmm +// Construct and append a VCVTPD2PSX instruction to the active function. +// Operates on the global context. +func VCVTPD2PSX(mx, x operand.Op) { ctx.VCVTPD2PSX(mx, x) } + +// VCVTPD2PSY: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. +// +// Forms: +// +// VCVTPD2PSY ymm xmm +// VCVTPD2PSY m256 xmm +// Construct and append a VCVTPD2PSY instruction to the active function. +func (c *Context) VCVTPD2PSY(my, x operand.Op) { + if inst, err := x86.VCVTPD2PSY(my, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTPD2PSY: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. +// +// Forms: +// +// VCVTPD2PSY ymm xmm +// VCVTPD2PSY m256 xmm +// Construct and append a VCVTPD2PSY instruction to the active function. +// Operates on the global context. +func VCVTPD2PSY(my, x operand.Op) { ctx.VCVTPD2PSY(my, x) } + +// VCVTPH2PS: Convert Half-Precision FP Values to Single-Precision FP Values. +// +// Forms: +// +// VCVTPH2PS xmm xmm +// VCVTPH2PS m64 xmm +// VCVTPH2PS xmm ymm +// VCVTPH2PS m128 ymm +// Construct and append a VCVTPH2PS instruction to the active function. +func (c *Context) VCVTPH2PS(mx, xy operand.Op) { + if inst, err := x86.VCVTPH2PS(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTPH2PS: Convert Half-Precision FP Values to Single-Precision FP Values. +// +// Forms: +// +// VCVTPH2PS xmm xmm +// VCVTPH2PS m64 xmm +// VCVTPH2PS xmm ymm +// VCVTPH2PS m128 ymm +// Construct and append a VCVTPH2PS instruction to the active function. +// Operates on the global context. +func VCVTPH2PS(mx, xy operand.Op) { ctx.VCVTPH2PS(mx, xy) } + +// VCVTPS2DQ: Convert Packed Single-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTPS2DQ xmm xmm +// VCVTPS2DQ m128 xmm +// VCVTPS2DQ ymm ymm +// VCVTPS2DQ m256 ymm +// Construct and append a VCVTPS2DQ instruction to the active function. +func (c *Context) VCVTPS2DQ(mxy, xy operand.Op) { + if inst, err := x86.VCVTPS2DQ(mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTPS2DQ: Convert Packed Single-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTPS2DQ xmm xmm +// VCVTPS2DQ m128 xmm +// VCVTPS2DQ ymm ymm +// VCVTPS2DQ m256 ymm +// Construct and append a VCVTPS2DQ instruction to the active function. +// Operates on the global context. +func VCVTPS2DQ(mxy, xy operand.Op) { ctx.VCVTPS2DQ(mxy, xy) } + +// VCVTPS2PD: Convert Packed Single-Precision FP Values to Packed Double-Precision FP Values. +// +// Forms: +// +// VCVTPS2PD xmm xmm +// VCVTPS2PD m64 xmm +// VCVTPS2PD xmm ymm +// VCVTPS2PD m128 ymm +// Construct and append a VCVTPS2PD instruction to the active function. +func (c *Context) VCVTPS2PD(mx, xy operand.Op) { + if inst, err := x86.VCVTPS2PD(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTPS2PD: Convert Packed Single-Precision FP Values to Packed Double-Precision FP Values. +// +// Forms: +// +// VCVTPS2PD xmm xmm +// VCVTPS2PD m64 xmm +// VCVTPS2PD xmm ymm +// VCVTPS2PD m128 ymm +// Construct and append a VCVTPS2PD instruction to the active function. +// Operates on the global context. +func VCVTPS2PD(mx, xy operand.Op) { ctx.VCVTPS2PD(mx, xy) } + +// VCVTPS2PH: Convert Single-Precision FP value to Half-Precision FP value. +// +// Forms: +// +// VCVTPS2PH imm8 xmm xmm +// VCVTPS2PH imm8 ymm xmm +// VCVTPS2PH imm8 xmm m64 +// VCVTPS2PH imm8 ymm m128 +// Construct and append a VCVTPS2PH instruction to the active function. +func (c *Context) VCVTPS2PH(i, xy, mx operand.Op) { + if inst, err := x86.VCVTPS2PH(i, xy, mx); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTPS2PH: Convert Single-Precision FP value to Half-Precision FP value. +// +// Forms: +// +// VCVTPS2PH imm8 xmm xmm +// VCVTPS2PH imm8 ymm xmm +// VCVTPS2PH imm8 xmm m64 +// VCVTPS2PH imm8 ymm m128 +// Construct and append a VCVTPS2PH instruction to the active function. +// Operates on the global context. +func VCVTPS2PH(i, xy, mx operand.Op) { ctx.VCVTPS2PH(i, xy, mx) } + +// VCVTSD2SI: Convert Scalar Double-Precision FP Value to Integer. +// +// Forms: +// +// VCVTSD2SI xmm r32 +// VCVTSD2SI m64 r32 +// Construct and append a VCVTSD2SI instruction to the active function. +func (c *Context) VCVTSD2SI(mx, r operand.Op) { + if inst, err := x86.VCVTSD2SI(mx, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTSD2SI: Convert Scalar Double-Precision FP Value to Integer. +// +// Forms: +// +// VCVTSD2SI xmm r32 +// VCVTSD2SI m64 r32 +// Construct and append a VCVTSD2SI instruction to the active function. +// Operates on the global context. +func VCVTSD2SI(mx, r operand.Op) { ctx.VCVTSD2SI(mx, r) } + +// VCVTSD2SIQ: Convert Scalar Double-Precision FP Value to Integer. +// +// Forms: +// +// VCVTSD2SIQ xmm r64 +// VCVTSD2SIQ m64 r64 +// Construct and append a VCVTSD2SIQ instruction to the active function. +func (c *Context) VCVTSD2SIQ(mx, r operand.Op) { + if inst, err := x86.VCVTSD2SIQ(mx, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTSD2SIQ: Convert Scalar Double-Precision FP Value to Integer. +// +// Forms: +// +// VCVTSD2SIQ xmm r64 +// VCVTSD2SIQ m64 r64 +// Construct and append a VCVTSD2SIQ instruction to the active function. +// Operates on the global context. +func VCVTSD2SIQ(mx, r operand.Op) { ctx.VCVTSD2SIQ(mx, r) } + +// VCVTSD2SS: Convert Scalar Double-Precision FP Value to Scalar Single-Precision FP Value. +// +// Forms: +// +// VCVTSD2SS xmm xmm xmm +// VCVTSD2SS m64 xmm xmm +// Construct and append a VCVTSD2SS instruction to the active function. +func (c *Context) VCVTSD2SS(mx, x, x1 operand.Op) { + if inst, err := x86.VCVTSD2SS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTSD2SS: Convert Scalar Double-Precision FP Value to Scalar Single-Precision FP Value. +// +// Forms: +// +// VCVTSD2SS xmm xmm xmm +// VCVTSD2SS m64 xmm xmm +// Construct and append a VCVTSD2SS instruction to the active function. +// Operates on the global context. +func VCVTSD2SS(mx, x, x1 operand.Op) { ctx.VCVTSD2SS(mx, x, x1) } + +// VCVTSI2SDL: Convert Dword Integer to Scalar Double-Precision FP Value. +// +// Forms: +// +// VCVTSI2SDL r32 xmm xmm +// VCVTSI2SDL m32 xmm xmm +// Construct and append a VCVTSI2SDL instruction to the active function. +func (c *Context) VCVTSI2SDL(mr, x, x1 operand.Op) { + if inst, err := x86.VCVTSI2SDL(mr, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTSI2SDL: Convert Dword Integer to Scalar Double-Precision FP Value. +// +// Forms: +// +// VCVTSI2SDL r32 xmm xmm +// VCVTSI2SDL m32 xmm xmm +// Construct and append a VCVTSI2SDL instruction to the active function. +// Operates on the global context. +func VCVTSI2SDL(mr, x, x1 operand.Op) { ctx.VCVTSI2SDL(mr, x, x1) } + +// VCVTSI2SDQ: Convert Dword Integer to Scalar Double-Precision FP Value. +// +// Forms: +// +// VCVTSI2SDQ r64 xmm xmm +// VCVTSI2SDQ m64 xmm xmm +// Construct and append a VCVTSI2SDQ instruction to the active function. +func (c *Context) VCVTSI2SDQ(mr, x, x1 operand.Op) { + if inst, err := x86.VCVTSI2SDQ(mr, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTSI2SDQ: Convert Dword Integer to Scalar Double-Precision FP Value. +// +// Forms: +// +// VCVTSI2SDQ r64 xmm xmm +// VCVTSI2SDQ m64 xmm xmm +// Construct and append a VCVTSI2SDQ instruction to the active function. +// Operates on the global context. +func VCVTSI2SDQ(mr, x, x1 operand.Op) { ctx.VCVTSI2SDQ(mr, x, x1) } + +// VCVTSI2SSL: Convert Dword Integer to Scalar Single-Precision FP Value. +// +// Forms: +// +// VCVTSI2SSL r32 xmm xmm +// VCVTSI2SSL m32 xmm xmm +// Construct and append a VCVTSI2SSL instruction to the active function. +func (c *Context) VCVTSI2SSL(mr, x, x1 operand.Op) { + if inst, err := x86.VCVTSI2SSL(mr, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTSI2SSL: Convert Dword Integer to Scalar Single-Precision FP Value. +// +// Forms: +// +// VCVTSI2SSL r32 xmm xmm +// VCVTSI2SSL m32 xmm xmm +// Construct and append a VCVTSI2SSL instruction to the active function. +// Operates on the global context. +func VCVTSI2SSL(mr, x, x1 operand.Op) { ctx.VCVTSI2SSL(mr, x, x1) } + +// VCVTSI2SSQ: Convert Dword Integer to Scalar Single-Precision FP Value. +// +// Forms: +// +// VCVTSI2SSQ r64 xmm xmm +// VCVTSI2SSQ m64 xmm xmm +// Construct and append a VCVTSI2SSQ instruction to the active function. +func (c *Context) VCVTSI2SSQ(mr, x, x1 operand.Op) { + if inst, err := x86.VCVTSI2SSQ(mr, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTSI2SSQ: Convert Dword Integer to Scalar Single-Precision FP Value. +// +// Forms: +// +// VCVTSI2SSQ r64 xmm xmm +// VCVTSI2SSQ m64 xmm xmm +// Construct and append a VCVTSI2SSQ instruction to the active function. +// Operates on the global context. +func VCVTSI2SSQ(mr, x, x1 operand.Op) { ctx.VCVTSI2SSQ(mr, x, x1) } + +// VCVTSS2SD: Convert Scalar Single-Precision FP Value to Scalar Double-Precision FP Value. +// +// Forms: +// +// VCVTSS2SD xmm xmm xmm +// VCVTSS2SD m32 xmm xmm +// Construct and append a VCVTSS2SD instruction to the active function. +func (c *Context) VCVTSS2SD(mx, x, x1 operand.Op) { + if inst, err := x86.VCVTSS2SD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTSS2SD: Convert Scalar Single-Precision FP Value to Scalar Double-Precision FP Value. +// +// Forms: +// +// VCVTSS2SD xmm xmm xmm +// VCVTSS2SD m32 xmm xmm +// Construct and append a VCVTSS2SD instruction to the active function. +// Operates on the global context. +func VCVTSS2SD(mx, x, x1 operand.Op) { ctx.VCVTSS2SD(mx, x, x1) } + +// VCVTSS2SI: Convert Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// VCVTSS2SI xmm r32 +// VCVTSS2SI m32 r32 +// Construct and append a VCVTSS2SI instruction to the active function. +func (c *Context) VCVTSS2SI(mx, r operand.Op) { + if inst, err := x86.VCVTSS2SI(mx, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTSS2SI: Convert Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// VCVTSS2SI xmm r32 +// VCVTSS2SI m32 r32 +// Construct and append a VCVTSS2SI instruction to the active function. +// Operates on the global context. +func VCVTSS2SI(mx, r operand.Op) { ctx.VCVTSS2SI(mx, r) } + +// VCVTSS2SIQ: Convert Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// VCVTSS2SIQ xmm r64 +// VCVTSS2SIQ m32 r64 +// Construct and append a VCVTSS2SIQ instruction to the active function. +func (c *Context) VCVTSS2SIQ(mx, r operand.Op) { + if inst, err := x86.VCVTSS2SIQ(mx, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTSS2SIQ: Convert Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// VCVTSS2SIQ xmm r64 +// VCVTSS2SIQ m32 r64 +// Construct and append a VCVTSS2SIQ instruction to the active function. +// Operates on the global context. +func VCVTSS2SIQ(mx, r operand.Op) { ctx.VCVTSS2SIQ(mx, r) } + +// VCVTTPD2DQX: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTTPD2DQX xmm xmm +// VCVTTPD2DQX m128 xmm +// Construct and append a VCVTTPD2DQX instruction to the active function. +func (c *Context) VCVTTPD2DQX(mx, x operand.Op) { + if inst, err := x86.VCVTTPD2DQX(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTTPD2DQX: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTTPD2DQX xmm xmm +// VCVTTPD2DQX m128 xmm +// Construct and append a VCVTTPD2DQX instruction to the active function. +// Operates on the global context. +func VCVTTPD2DQX(mx, x operand.Op) { ctx.VCVTTPD2DQX(mx, x) } + +// VCVTTPD2DQY: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTTPD2DQY ymm xmm +// VCVTTPD2DQY m256 xmm +// Construct and append a VCVTTPD2DQY instruction to the active function. +func (c *Context) VCVTTPD2DQY(my, x operand.Op) { + if inst, err := x86.VCVTTPD2DQY(my, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTTPD2DQY: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTTPD2DQY ymm xmm +// VCVTTPD2DQY m256 xmm +// Construct and append a VCVTTPD2DQY instruction to the active function. +// Operates on the global context. +func VCVTTPD2DQY(my, x operand.Op) { ctx.VCVTTPD2DQY(my, x) } + +// VCVTTPS2DQ: Convert with Truncation Packed Single-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTTPS2DQ xmm xmm +// VCVTTPS2DQ m128 xmm +// VCVTTPS2DQ ymm ymm +// VCVTTPS2DQ m256 ymm +// Construct and append a VCVTTPS2DQ instruction to the active function. +func (c *Context) VCVTTPS2DQ(mxy, xy operand.Op) { + if inst, err := x86.VCVTTPS2DQ(mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTTPS2DQ: Convert with Truncation Packed Single-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTTPS2DQ xmm xmm +// VCVTTPS2DQ m128 xmm +// VCVTTPS2DQ ymm ymm +// VCVTTPS2DQ m256 ymm +// Construct and append a VCVTTPS2DQ instruction to the active function. +// Operates on the global context. +func VCVTTPS2DQ(mxy, xy operand.Op) { ctx.VCVTTPS2DQ(mxy, xy) } + +// VCVTTSD2SI: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. +// +// Forms: +// +// VCVTTSD2SI xmm r32 +// VCVTTSD2SI m64 r32 +// Construct and append a VCVTTSD2SI instruction to the active function. +func (c *Context) VCVTTSD2SI(mx, r operand.Op) { + if inst, err := x86.VCVTTSD2SI(mx, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTTSD2SI: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. +// +// Forms: +// +// VCVTTSD2SI xmm r32 +// VCVTTSD2SI m64 r32 +// Construct and append a VCVTTSD2SI instruction to the active function. +// Operates on the global context. +func VCVTTSD2SI(mx, r operand.Op) { ctx.VCVTTSD2SI(mx, r) } + +// VCVTTSD2SIQ: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. +// +// Forms: +// +// VCVTTSD2SIQ xmm r64 +// VCVTTSD2SIQ m64 r64 +// Construct and append a VCVTTSD2SIQ instruction to the active function. +func (c *Context) VCVTTSD2SIQ(mx, r operand.Op) { + if inst, err := x86.VCVTTSD2SIQ(mx, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTTSD2SIQ: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. +// +// Forms: +// +// VCVTTSD2SIQ xmm r64 +// VCVTTSD2SIQ m64 r64 +// Construct and append a VCVTTSD2SIQ instruction to the active function. +// Operates on the global context. +func VCVTTSD2SIQ(mx, r operand.Op) { ctx.VCVTTSD2SIQ(mx, r) } + +// VCVTTSS2SI: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// VCVTTSS2SI xmm r32 +// VCVTTSS2SI m32 r32 +// Construct and append a VCVTTSS2SI instruction to the active function. +func (c *Context) VCVTTSS2SI(mx, r operand.Op) { + if inst, err := x86.VCVTTSS2SI(mx, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTTSS2SI: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// VCVTTSS2SI xmm r32 +// VCVTTSS2SI m32 r32 +// Construct and append a VCVTTSS2SI instruction to the active function. +// Operates on the global context. +func VCVTTSS2SI(mx, r operand.Op) { ctx.VCVTTSS2SI(mx, r) } + +// VCVTTSS2SIQ: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// VCVTTSS2SIQ xmm r64 +// VCVTTSS2SIQ m32 r64 +// Construct and append a VCVTTSS2SIQ instruction to the active function. +func (c *Context) VCVTTSS2SIQ(mx, r operand.Op) { + if inst, err := x86.VCVTTSS2SIQ(mx, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VCVTTSS2SIQ: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// VCVTTSS2SIQ xmm r64 +// VCVTTSS2SIQ m32 r64 +// Construct and append a VCVTTSS2SIQ instruction to the active function. +// Operates on the global context. +func VCVTTSS2SIQ(mx, r operand.Op) { ctx.VCVTTSS2SIQ(mx, r) } + +// VDIVPD: Divide Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VDIVPD xmm xmm xmm +// VDIVPD m128 xmm xmm +// VDIVPD ymm ymm ymm +// VDIVPD m256 ymm ymm +// Construct and append a VDIVPD instruction to the active function. +func (c *Context) VDIVPD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VDIVPD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VDIVPD: Divide Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VDIVPD xmm xmm xmm +// VDIVPD m128 xmm xmm +// VDIVPD ymm ymm ymm +// VDIVPD m256 ymm ymm +// Construct and append a VDIVPD instruction to the active function. +// Operates on the global context. +func VDIVPD(mxy, xy, xy1 operand.Op) { ctx.VDIVPD(mxy, xy, xy1) } + +// VDIVPS: Divide Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VDIVPS xmm xmm xmm +// VDIVPS m128 xmm xmm +// VDIVPS ymm ymm ymm +// VDIVPS m256 ymm ymm +// Construct and append a VDIVPS instruction to the active function. +func (c *Context) VDIVPS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VDIVPS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VDIVPS: Divide Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VDIVPS xmm xmm xmm +// VDIVPS m128 xmm xmm +// VDIVPS ymm ymm ymm +// VDIVPS m256 ymm ymm +// Construct and append a VDIVPS instruction to the active function. +// Operates on the global context. +func VDIVPS(mxy, xy, xy1 operand.Op) { ctx.VDIVPS(mxy, xy, xy1) } + +// VDIVSD: Divide Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VDIVSD xmm xmm xmm +// VDIVSD m64 xmm xmm +// Construct and append a VDIVSD instruction to the active function. +func (c *Context) VDIVSD(mx, x, x1 operand.Op) { + if inst, err := x86.VDIVSD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VDIVSD: Divide Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VDIVSD xmm xmm xmm +// VDIVSD m64 xmm xmm +// Construct and append a VDIVSD instruction to the active function. +// Operates on the global context. +func VDIVSD(mx, x, x1 operand.Op) { ctx.VDIVSD(mx, x, x1) } + +// VDIVSS: Divide Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VDIVSS xmm xmm xmm +// VDIVSS m32 xmm xmm +// Construct and append a VDIVSS instruction to the active function. +func (c *Context) VDIVSS(mx, x, x1 operand.Op) { + if inst, err := x86.VDIVSS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VDIVSS: Divide Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VDIVSS xmm xmm xmm +// VDIVSS m32 xmm xmm +// Construct and append a VDIVSS instruction to the active function. +// Operates on the global context. +func VDIVSS(mx, x, x1 operand.Op) { ctx.VDIVSS(mx, x, x1) } + +// VDPPD: Dot Product of Packed Double Precision Floating-Point Values. +// +// Forms: +// +// VDPPD imm8 xmm xmm xmm +// VDPPD imm8 m128 xmm xmm +// Construct and append a VDPPD instruction to the active function. +func (c *Context) VDPPD(i, mx, x, x1 operand.Op) { + if inst, err := x86.VDPPD(i, mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VDPPD: Dot Product of Packed Double Precision Floating-Point Values. +// +// Forms: +// +// VDPPD imm8 xmm xmm xmm +// VDPPD imm8 m128 xmm xmm +// Construct and append a VDPPD instruction to the active function. +// Operates on the global context. +func VDPPD(i, mx, x, x1 operand.Op) { ctx.VDPPD(i, mx, x, x1) } + +// VDPPS: Dot Product of Packed Single Precision Floating-Point Values. +// +// Forms: +// +// VDPPS imm8 xmm xmm xmm +// VDPPS imm8 m128 xmm xmm +// VDPPS imm8 ymm ymm ymm +// VDPPS imm8 m256 ymm ymm +// Construct and append a VDPPS instruction to the active function. +func (c *Context) VDPPS(i, mxy, xy, xy1 operand.Op) { + if inst, err := x86.VDPPS(i, mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VDPPS: Dot Product of Packed Single Precision Floating-Point Values. +// +// Forms: +// +// VDPPS imm8 xmm xmm xmm +// VDPPS imm8 m128 xmm xmm +// VDPPS imm8 ymm ymm ymm +// VDPPS imm8 m256 ymm ymm +// Construct and append a VDPPS instruction to the active function. +// Operates on the global context. +func VDPPS(i, mxy, xy, xy1 operand.Op) { ctx.VDPPS(i, mxy, xy, xy1) } + +// VEXTRACTF128: Extract Packed Floating-Point Values. +// +// Forms: +// +// VEXTRACTF128 imm8 ymm xmm +// VEXTRACTF128 imm8 ymm m128 +// Construct and append a VEXTRACTF128 instruction to the active function. +func (c *Context) VEXTRACTF128(i, y, mx operand.Op) { + if inst, err := x86.VEXTRACTF128(i, y, mx); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VEXTRACTF128: Extract Packed Floating-Point Values. +// +// Forms: +// +// VEXTRACTF128 imm8 ymm xmm +// VEXTRACTF128 imm8 ymm m128 +// Construct and append a VEXTRACTF128 instruction to the active function. +// Operates on the global context. +func VEXTRACTF128(i, y, mx operand.Op) { ctx.VEXTRACTF128(i, y, mx) } + +// VEXTRACTI128: Extract Packed Integer Values. +// +// Forms: +// +// VEXTRACTI128 imm8 ymm xmm +// VEXTRACTI128 imm8 ymm m128 +// Construct and append a VEXTRACTI128 instruction to the active function. +func (c *Context) VEXTRACTI128(i, y, mx operand.Op) { + if inst, err := x86.VEXTRACTI128(i, y, mx); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VEXTRACTI128: Extract Packed Integer Values. +// +// Forms: +// +// VEXTRACTI128 imm8 ymm xmm +// VEXTRACTI128 imm8 ymm m128 +// Construct and append a VEXTRACTI128 instruction to the active function. +// Operates on the global context. +func VEXTRACTI128(i, y, mx operand.Op) { ctx.VEXTRACTI128(i, y, mx) } + +// VEXTRACTPS: Extract Packed Single Precision Floating-Point Value. +// +// Forms: +// +// VEXTRACTPS imm8 xmm r32 +// VEXTRACTPS imm8 xmm m32 +// Construct and append a VEXTRACTPS instruction to the active function. +func (c *Context) VEXTRACTPS(i, x, mr operand.Op) { + if inst, err := x86.VEXTRACTPS(i, x, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VEXTRACTPS: Extract Packed Single Precision Floating-Point Value. +// +// Forms: +// +// VEXTRACTPS imm8 xmm r32 +// VEXTRACTPS imm8 xmm m32 +// Construct and append a VEXTRACTPS instruction to the active function. +// Operates on the global context. +func VEXTRACTPS(i, x, mr operand.Op) { ctx.VEXTRACTPS(i, x, mr) } + +// VFMADD132PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD132PD xmm xmm xmm +// VFMADD132PD m128 xmm xmm +// VFMADD132PD ymm ymm ymm +// VFMADD132PD m256 ymm ymm +// Construct and append a VFMADD132PD instruction to the active function. +func (c *Context) VFMADD132PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMADD132PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADD132PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD132PD xmm xmm xmm +// VFMADD132PD m128 xmm xmm +// VFMADD132PD ymm ymm ymm +// VFMADD132PD m256 ymm ymm +// Construct and append a VFMADD132PD instruction to the active function. +// Operates on the global context. +func VFMADD132PD(mxy, xy, xy1 operand.Op) { ctx.VFMADD132PD(mxy, xy, xy1) } + +// VFMADD132PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD132PS xmm xmm xmm +// VFMADD132PS m128 xmm xmm +// VFMADD132PS ymm ymm ymm +// VFMADD132PS m256 ymm ymm +// Construct and append a VFMADD132PS instruction to the active function. +func (c *Context) VFMADD132PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMADD132PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADD132PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD132PS xmm xmm xmm +// VFMADD132PS m128 xmm xmm +// VFMADD132PS ymm ymm ymm +// VFMADD132PS m256 ymm ymm +// Construct and append a VFMADD132PS instruction to the active function. +// Operates on the global context. +func VFMADD132PS(mxy, xy, xy1 operand.Op) { ctx.VFMADD132PS(mxy, xy, xy1) } + +// VFMADD132SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD132SD xmm xmm xmm +// VFMADD132SD m64 xmm xmm +// Construct and append a VFMADD132SD instruction to the active function. +func (c *Context) VFMADD132SD(mx, x, x1 operand.Op) { + if inst, err := x86.VFMADD132SD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADD132SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD132SD xmm xmm xmm +// VFMADD132SD m64 xmm xmm +// Construct and append a VFMADD132SD instruction to the active function. +// Operates on the global context. +func VFMADD132SD(mx, x, x1 operand.Op) { ctx.VFMADD132SD(mx, x, x1) } + +// VFMADD132SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD132SS xmm xmm xmm +// VFMADD132SS m32 xmm xmm +// Construct and append a VFMADD132SS instruction to the active function. +func (c *Context) VFMADD132SS(mx, x, x1 operand.Op) { + if inst, err := x86.VFMADD132SS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADD132SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD132SS xmm xmm xmm +// VFMADD132SS m32 xmm xmm +// Construct and append a VFMADD132SS instruction to the active function. +// Operates on the global context. +func VFMADD132SS(mx, x, x1 operand.Op) { ctx.VFMADD132SS(mx, x, x1) } + +// VFMADD213PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD213PD xmm xmm xmm +// VFMADD213PD m128 xmm xmm +// VFMADD213PD ymm ymm ymm +// VFMADD213PD m256 ymm ymm +// Construct and append a VFMADD213PD instruction to the active function. +func (c *Context) VFMADD213PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMADD213PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADD213PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD213PD xmm xmm xmm +// VFMADD213PD m128 xmm xmm +// VFMADD213PD ymm ymm ymm +// VFMADD213PD m256 ymm ymm +// Construct and append a VFMADD213PD instruction to the active function. +// Operates on the global context. +func VFMADD213PD(mxy, xy, xy1 operand.Op) { ctx.VFMADD213PD(mxy, xy, xy1) } + +// VFMADD213PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD213PS xmm xmm xmm +// VFMADD213PS m128 xmm xmm +// VFMADD213PS ymm ymm ymm +// VFMADD213PS m256 ymm ymm +// Construct and append a VFMADD213PS instruction to the active function. +func (c *Context) VFMADD213PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMADD213PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADD213PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD213PS xmm xmm xmm +// VFMADD213PS m128 xmm xmm +// VFMADD213PS ymm ymm ymm +// VFMADD213PS m256 ymm ymm +// Construct and append a VFMADD213PS instruction to the active function. +// Operates on the global context. +func VFMADD213PS(mxy, xy, xy1 operand.Op) { ctx.VFMADD213PS(mxy, xy, xy1) } + +// VFMADD213SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD213SD xmm xmm xmm +// VFMADD213SD m64 xmm xmm +// Construct and append a VFMADD213SD instruction to the active function. +func (c *Context) VFMADD213SD(mx, x, x1 operand.Op) { + if inst, err := x86.VFMADD213SD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADD213SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD213SD xmm xmm xmm +// VFMADD213SD m64 xmm xmm +// Construct and append a VFMADD213SD instruction to the active function. +// Operates on the global context. +func VFMADD213SD(mx, x, x1 operand.Op) { ctx.VFMADD213SD(mx, x, x1) } + +// VFMADD213SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD213SS xmm xmm xmm +// VFMADD213SS m32 xmm xmm +// Construct and append a VFMADD213SS instruction to the active function. +func (c *Context) VFMADD213SS(mx, x, x1 operand.Op) { + if inst, err := x86.VFMADD213SS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADD213SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD213SS xmm xmm xmm +// VFMADD213SS m32 xmm xmm +// Construct and append a VFMADD213SS instruction to the active function. +// Operates on the global context. +func VFMADD213SS(mx, x, x1 operand.Op) { ctx.VFMADD213SS(mx, x, x1) } + +// VFMADD231PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD231PD xmm xmm xmm +// VFMADD231PD m128 xmm xmm +// VFMADD231PD ymm ymm ymm +// VFMADD231PD m256 ymm ymm +// Construct and append a VFMADD231PD instruction to the active function. +func (c *Context) VFMADD231PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMADD231PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADD231PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD231PD xmm xmm xmm +// VFMADD231PD m128 xmm xmm +// VFMADD231PD ymm ymm ymm +// VFMADD231PD m256 ymm ymm +// Construct and append a VFMADD231PD instruction to the active function. +// Operates on the global context. +func VFMADD231PD(mxy, xy, xy1 operand.Op) { ctx.VFMADD231PD(mxy, xy, xy1) } + +// VFMADD231PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD231PS xmm xmm xmm +// VFMADD231PS m128 xmm xmm +// VFMADD231PS ymm ymm ymm +// VFMADD231PS m256 ymm ymm +// Construct and append a VFMADD231PS instruction to the active function. +func (c *Context) VFMADD231PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMADD231PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADD231PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD231PS xmm xmm xmm +// VFMADD231PS m128 xmm xmm +// VFMADD231PS ymm ymm ymm +// VFMADD231PS m256 ymm ymm +// Construct and append a VFMADD231PS instruction to the active function. +// Operates on the global context. +func VFMADD231PS(mxy, xy, xy1 operand.Op) { ctx.VFMADD231PS(mxy, xy, xy1) } + +// VFMADD231SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD231SD xmm xmm xmm +// VFMADD231SD m64 xmm xmm +// Construct and append a VFMADD231SD instruction to the active function. +func (c *Context) VFMADD231SD(mx, x, x1 operand.Op) { + if inst, err := x86.VFMADD231SD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADD231SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD231SD xmm xmm xmm +// VFMADD231SD m64 xmm xmm +// Construct and append a VFMADD231SD instruction to the active function. +// Operates on the global context. +func VFMADD231SD(mx, x, x1 operand.Op) { ctx.VFMADD231SD(mx, x, x1) } + +// VFMADD231SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD231SS xmm xmm xmm +// VFMADD231SS m32 xmm xmm +// Construct and append a VFMADD231SS instruction to the active function. +func (c *Context) VFMADD231SS(mx, x, x1 operand.Op) { + if inst, err := x86.VFMADD231SS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADD231SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD231SS xmm xmm xmm +// VFMADD231SS m32 xmm xmm +// Construct and append a VFMADD231SS instruction to the active function. +// Operates on the global context. +func VFMADD231SS(mx, x, x1 operand.Op) { ctx.VFMADD231SS(mx, x, x1) } + +// VFMADDSUB132PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB132PD xmm xmm xmm +// VFMADDSUB132PD m128 xmm xmm +// VFMADDSUB132PD ymm ymm ymm +// VFMADDSUB132PD m256 ymm ymm +// Construct and append a VFMADDSUB132PD instruction to the active function. +func (c *Context) VFMADDSUB132PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMADDSUB132PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADDSUB132PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB132PD xmm xmm xmm +// VFMADDSUB132PD m128 xmm xmm +// VFMADDSUB132PD ymm ymm ymm +// VFMADDSUB132PD m256 ymm ymm +// Construct and append a VFMADDSUB132PD instruction to the active function. +// Operates on the global context. +func VFMADDSUB132PD(mxy, xy, xy1 operand.Op) { ctx.VFMADDSUB132PD(mxy, xy, xy1) } + +// VFMADDSUB132PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB132PS xmm xmm xmm +// VFMADDSUB132PS m128 xmm xmm +// VFMADDSUB132PS ymm ymm ymm +// VFMADDSUB132PS m256 ymm ymm +// Construct and append a VFMADDSUB132PS instruction to the active function. +func (c *Context) VFMADDSUB132PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMADDSUB132PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADDSUB132PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB132PS xmm xmm xmm +// VFMADDSUB132PS m128 xmm xmm +// VFMADDSUB132PS ymm ymm ymm +// VFMADDSUB132PS m256 ymm ymm +// Construct and append a VFMADDSUB132PS instruction to the active function. +// Operates on the global context. +func VFMADDSUB132PS(mxy, xy, xy1 operand.Op) { ctx.VFMADDSUB132PS(mxy, xy, xy1) } + +// VFMADDSUB213PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB213PD xmm xmm xmm +// VFMADDSUB213PD m128 xmm xmm +// VFMADDSUB213PD ymm ymm ymm +// VFMADDSUB213PD m256 ymm ymm +// Construct and append a VFMADDSUB213PD instruction to the active function. +func (c *Context) VFMADDSUB213PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMADDSUB213PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADDSUB213PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB213PD xmm xmm xmm +// VFMADDSUB213PD m128 xmm xmm +// VFMADDSUB213PD ymm ymm ymm +// VFMADDSUB213PD m256 ymm ymm +// Construct and append a VFMADDSUB213PD instruction to the active function. +// Operates on the global context. +func VFMADDSUB213PD(mxy, xy, xy1 operand.Op) { ctx.VFMADDSUB213PD(mxy, xy, xy1) } + +// VFMADDSUB213PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB213PS xmm xmm xmm +// VFMADDSUB213PS m128 xmm xmm +// VFMADDSUB213PS ymm ymm ymm +// VFMADDSUB213PS m256 ymm ymm +// Construct and append a VFMADDSUB213PS instruction to the active function. +func (c *Context) VFMADDSUB213PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMADDSUB213PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADDSUB213PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB213PS xmm xmm xmm +// VFMADDSUB213PS m128 xmm xmm +// VFMADDSUB213PS ymm ymm ymm +// VFMADDSUB213PS m256 ymm ymm +// Construct and append a VFMADDSUB213PS instruction to the active function. +// Operates on the global context. +func VFMADDSUB213PS(mxy, xy, xy1 operand.Op) { ctx.VFMADDSUB213PS(mxy, xy, xy1) } + +// VFMADDSUB231PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB231PD xmm xmm xmm +// VFMADDSUB231PD m128 xmm xmm +// VFMADDSUB231PD ymm ymm ymm +// VFMADDSUB231PD m256 ymm ymm +// Construct and append a VFMADDSUB231PD instruction to the active function. +func (c *Context) VFMADDSUB231PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMADDSUB231PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADDSUB231PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB231PD xmm xmm xmm +// VFMADDSUB231PD m128 xmm xmm +// VFMADDSUB231PD ymm ymm ymm +// VFMADDSUB231PD m256 ymm ymm +// Construct and append a VFMADDSUB231PD instruction to the active function. +// Operates on the global context. +func VFMADDSUB231PD(mxy, xy, xy1 operand.Op) { ctx.VFMADDSUB231PD(mxy, xy, xy1) } + +// VFMADDSUB231PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB231PS xmm xmm xmm +// VFMADDSUB231PS m128 xmm xmm +// VFMADDSUB231PS ymm ymm ymm +// VFMADDSUB231PS m256 ymm ymm +// Construct and append a VFMADDSUB231PS instruction to the active function. +func (c *Context) VFMADDSUB231PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMADDSUB231PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMADDSUB231PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB231PS xmm xmm xmm +// VFMADDSUB231PS m128 xmm xmm +// VFMADDSUB231PS ymm ymm ymm +// VFMADDSUB231PS m256 ymm ymm +// Construct and append a VFMADDSUB231PS instruction to the active function. +// Operates on the global context. +func VFMADDSUB231PS(mxy, xy, xy1 operand.Op) { ctx.VFMADDSUB231PS(mxy, xy, xy1) } + +// VFMSUB132PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB132PD xmm xmm xmm +// VFMSUB132PD m128 xmm xmm +// VFMSUB132PD ymm ymm ymm +// VFMSUB132PD m256 ymm ymm +// Construct and append a VFMSUB132PD instruction to the active function. +func (c *Context) VFMSUB132PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMSUB132PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUB132PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB132PD xmm xmm xmm +// VFMSUB132PD m128 xmm xmm +// VFMSUB132PD ymm ymm ymm +// VFMSUB132PD m256 ymm ymm +// Construct and append a VFMSUB132PD instruction to the active function. +// Operates on the global context. +func VFMSUB132PD(mxy, xy, xy1 operand.Op) { ctx.VFMSUB132PD(mxy, xy, xy1) } + +// VFMSUB132PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB132PS xmm xmm xmm +// VFMSUB132PS m128 xmm xmm +// VFMSUB132PS ymm ymm ymm +// VFMSUB132PS m256 ymm ymm +// Construct and append a VFMSUB132PS instruction to the active function. +func (c *Context) VFMSUB132PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMSUB132PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUB132PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB132PS xmm xmm xmm +// VFMSUB132PS m128 xmm xmm +// VFMSUB132PS ymm ymm ymm +// VFMSUB132PS m256 ymm ymm +// Construct and append a VFMSUB132PS instruction to the active function. +// Operates on the global context. +func VFMSUB132PS(mxy, xy, xy1 operand.Op) { ctx.VFMSUB132PS(mxy, xy, xy1) } + +// VFMSUB132SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB132SD xmm xmm xmm +// VFMSUB132SD m64 xmm xmm +// Construct and append a VFMSUB132SD instruction to the active function. +func (c *Context) VFMSUB132SD(mx, x, x1 operand.Op) { + if inst, err := x86.VFMSUB132SD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUB132SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB132SD xmm xmm xmm +// VFMSUB132SD m64 xmm xmm +// Construct and append a VFMSUB132SD instruction to the active function. +// Operates on the global context. +func VFMSUB132SD(mx, x, x1 operand.Op) { ctx.VFMSUB132SD(mx, x, x1) } + +// VFMSUB132SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB132SS xmm xmm xmm +// VFMSUB132SS m32 xmm xmm +// Construct and append a VFMSUB132SS instruction to the active function. +func (c *Context) VFMSUB132SS(mx, x, x1 operand.Op) { + if inst, err := x86.VFMSUB132SS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUB132SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB132SS xmm xmm xmm +// VFMSUB132SS m32 xmm xmm +// Construct and append a VFMSUB132SS instruction to the active function. +// Operates on the global context. +func VFMSUB132SS(mx, x, x1 operand.Op) { ctx.VFMSUB132SS(mx, x, x1) } + +// VFMSUB213PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB213PD xmm xmm xmm +// VFMSUB213PD m128 xmm xmm +// VFMSUB213PD ymm ymm ymm +// VFMSUB213PD m256 ymm ymm +// Construct and append a VFMSUB213PD instruction to the active function. +func (c *Context) VFMSUB213PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMSUB213PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUB213PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB213PD xmm xmm xmm +// VFMSUB213PD m128 xmm xmm +// VFMSUB213PD ymm ymm ymm +// VFMSUB213PD m256 ymm ymm +// Construct and append a VFMSUB213PD instruction to the active function. +// Operates on the global context. +func VFMSUB213PD(mxy, xy, xy1 operand.Op) { ctx.VFMSUB213PD(mxy, xy, xy1) } + +// VFMSUB213PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB213PS xmm xmm xmm +// VFMSUB213PS m128 xmm xmm +// VFMSUB213PS ymm ymm ymm +// VFMSUB213PS m256 ymm ymm +// Construct and append a VFMSUB213PS instruction to the active function. +func (c *Context) VFMSUB213PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMSUB213PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUB213PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB213PS xmm xmm xmm +// VFMSUB213PS m128 xmm xmm +// VFMSUB213PS ymm ymm ymm +// VFMSUB213PS m256 ymm ymm +// Construct and append a VFMSUB213PS instruction to the active function. +// Operates on the global context. +func VFMSUB213PS(mxy, xy, xy1 operand.Op) { ctx.VFMSUB213PS(mxy, xy, xy1) } + +// VFMSUB213SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB213SD xmm xmm xmm +// VFMSUB213SD m64 xmm xmm +// Construct and append a VFMSUB213SD instruction to the active function. +func (c *Context) VFMSUB213SD(mx, x, x1 operand.Op) { + if inst, err := x86.VFMSUB213SD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUB213SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB213SD xmm xmm xmm +// VFMSUB213SD m64 xmm xmm +// Construct and append a VFMSUB213SD instruction to the active function. +// Operates on the global context. +func VFMSUB213SD(mx, x, x1 operand.Op) { ctx.VFMSUB213SD(mx, x, x1) } + +// VFMSUB213SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB213SS xmm xmm xmm +// VFMSUB213SS m32 xmm xmm +// Construct and append a VFMSUB213SS instruction to the active function. +func (c *Context) VFMSUB213SS(mx, x, x1 operand.Op) { + if inst, err := x86.VFMSUB213SS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUB213SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB213SS xmm xmm xmm +// VFMSUB213SS m32 xmm xmm +// Construct and append a VFMSUB213SS instruction to the active function. +// Operates on the global context. +func VFMSUB213SS(mx, x, x1 operand.Op) { ctx.VFMSUB213SS(mx, x, x1) } + +// VFMSUB231PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB231PD xmm xmm xmm +// VFMSUB231PD m128 xmm xmm +// VFMSUB231PD ymm ymm ymm +// VFMSUB231PD m256 ymm ymm +// Construct and append a VFMSUB231PD instruction to the active function. +func (c *Context) VFMSUB231PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMSUB231PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUB231PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB231PD xmm xmm xmm +// VFMSUB231PD m128 xmm xmm +// VFMSUB231PD ymm ymm ymm +// VFMSUB231PD m256 ymm ymm +// Construct and append a VFMSUB231PD instruction to the active function. +// Operates on the global context. +func VFMSUB231PD(mxy, xy, xy1 operand.Op) { ctx.VFMSUB231PD(mxy, xy, xy1) } + +// VFMSUB231PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB231PS xmm xmm xmm +// VFMSUB231PS m128 xmm xmm +// VFMSUB231PS ymm ymm ymm +// VFMSUB231PS m256 ymm ymm +// Construct and append a VFMSUB231PS instruction to the active function. +func (c *Context) VFMSUB231PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMSUB231PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUB231PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB231PS xmm xmm xmm +// VFMSUB231PS m128 xmm xmm +// VFMSUB231PS ymm ymm ymm +// VFMSUB231PS m256 ymm ymm +// Construct and append a VFMSUB231PS instruction to the active function. +// Operates on the global context. +func VFMSUB231PS(mxy, xy, xy1 operand.Op) { ctx.VFMSUB231PS(mxy, xy, xy1) } + +// VFMSUB231SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB231SD xmm xmm xmm +// VFMSUB231SD m64 xmm xmm +// Construct and append a VFMSUB231SD instruction to the active function. +func (c *Context) VFMSUB231SD(mx, x, x1 operand.Op) { + if inst, err := x86.VFMSUB231SD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUB231SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB231SD xmm xmm xmm +// VFMSUB231SD m64 xmm xmm +// Construct and append a VFMSUB231SD instruction to the active function. +// Operates on the global context. +func VFMSUB231SD(mx, x, x1 operand.Op) { ctx.VFMSUB231SD(mx, x, x1) } + +// VFMSUB231SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB231SS xmm xmm xmm +// VFMSUB231SS m32 xmm xmm +// Construct and append a VFMSUB231SS instruction to the active function. +func (c *Context) VFMSUB231SS(mx, x, x1 operand.Op) { + if inst, err := x86.VFMSUB231SS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUB231SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB231SS xmm xmm xmm +// VFMSUB231SS m32 xmm xmm +// Construct and append a VFMSUB231SS instruction to the active function. +// Operates on the global context. +func VFMSUB231SS(mx, x, x1 operand.Op) { ctx.VFMSUB231SS(mx, x, x1) } + +// VFMSUBADD132PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD132PD xmm xmm xmm +// VFMSUBADD132PD m128 xmm xmm +// VFMSUBADD132PD ymm ymm ymm +// VFMSUBADD132PD m256 ymm ymm +// Construct and append a VFMSUBADD132PD instruction to the active function. +func (c *Context) VFMSUBADD132PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMSUBADD132PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUBADD132PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD132PD xmm xmm xmm +// VFMSUBADD132PD m128 xmm xmm +// VFMSUBADD132PD ymm ymm ymm +// VFMSUBADD132PD m256 ymm ymm +// Construct and append a VFMSUBADD132PD instruction to the active function. +// Operates on the global context. +func VFMSUBADD132PD(mxy, xy, xy1 operand.Op) { ctx.VFMSUBADD132PD(mxy, xy, xy1) } + +// VFMSUBADD132PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD132PS xmm xmm xmm +// VFMSUBADD132PS m128 xmm xmm +// VFMSUBADD132PS ymm ymm ymm +// VFMSUBADD132PS m256 ymm ymm +// Construct and append a VFMSUBADD132PS instruction to the active function. +func (c *Context) VFMSUBADD132PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMSUBADD132PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUBADD132PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD132PS xmm xmm xmm +// VFMSUBADD132PS m128 xmm xmm +// VFMSUBADD132PS ymm ymm ymm +// VFMSUBADD132PS m256 ymm ymm +// Construct and append a VFMSUBADD132PS instruction to the active function. +// Operates on the global context. +func VFMSUBADD132PS(mxy, xy, xy1 operand.Op) { ctx.VFMSUBADD132PS(mxy, xy, xy1) } + +// VFMSUBADD213PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD213PD xmm xmm xmm +// VFMSUBADD213PD m128 xmm xmm +// VFMSUBADD213PD ymm ymm ymm +// VFMSUBADD213PD m256 ymm ymm +// Construct and append a VFMSUBADD213PD instruction to the active function. +func (c *Context) VFMSUBADD213PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMSUBADD213PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUBADD213PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD213PD xmm xmm xmm +// VFMSUBADD213PD m128 xmm xmm +// VFMSUBADD213PD ymm ymm ymm +// VFMSUBADD213PD m256 ymm ymm +// Construct and append a VFMSUBADD213PD instruction to the active function. +// Operates on the global context. +func VFMSUBADD213PD(mxy, xy, xy1 operand.Op) { ctx.VFMSUBADD213PD(mxy, xy, xy1) } + +// VFMSUBADD213PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD213PS xmm xmm xmm +// VFMSUBADD213PS m128 xmm xmm +// VFMSUBADD213PS ymm ymm ymm +// VFMSUBADD213PS m256 ymm ymm +// Construct and append a VFMSUBADD213PS instruction to the active function. +func (c *Context) VFMSUBADD213PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMSUBADD213PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUBADD213PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD213PS xmm xmm xmm +// VFMSUBADD213PS m128 xmm xmm +// VFMSUBADD213PS ymm ymm ymm +// VFMSUBADD213PS m256 ymm ymm +// Construct and append a VFMSUBADD213PS instruction to the active function. +// Operates on the global context. +func VFMSUBADD213PS(mxy, xy, xy1 operand.Op) { ctx.VFMSUBADD213PS(mxy, xy, xy1) } + +// VFMSUBADD231PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD231PD xmm xmm xmm +// VFMSUBADD231PD m128 xmm xmm +// VFMSUBADD231PD ymm ymm ymm +// VFMSUBADD231PD m256 ymm ymm +// Construct and append a VFMSUBADD231PD instruction to the active function. +func (c *Context) VFMSUBADD231PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMSUBADD231PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUBADD231PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD231PD xmm xmm xmm +// VFMSUBADD231PD m128 xmm xmm +// VFMSUBADD231PD ymm ymm ymm +// VFMSUBADD231PD m256 ymm ymm +// Construct and append a VFMSUBADD231PD instruction to the active function. +// Operates on the global context. +func VFMSUBADD231PD(mxy, xy, xy1 operand.Op) { ctx.VFMSUBADD231PD(mxy, xy, xy1) } + +// VFMSUBADD231PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD231PS xmm xmm xmm +// VFMSUBADD231PS m128 xmm xmm +// VFMSUBADD231PS ymm ymm ymm +// VFMSUBADD231PS m256 ymm ymm +// Construct and append a VFMSUBADD231PS instruction to the active function. +func (c *Context) VFMSUBADD231PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFMSUBADD231PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFMSUBADD231PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD231PS xmm xmm xmm +// VFMSUBADD231PS m128 xmm xmm +// VFMSUBADD231PS ymm ymm ymm +// VFMSUBADD231PS m256 ymm ymm +// Construct and append a VFMSUBADD231PS instruction to the active function. +// Operates on the global context. +func VFMSUBADD231PS(mxy, xy, xy1 operand.Op) { ctx.VFMSUBADD231PS(mxy, xy, xy1) } + +// VFNMADD132PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD132PD xmm xmm xmm +// VFNMADD132PD m128 xmm xmm +// VFNMADD132PD ymm ymm ymm +// VFNMADD132PD m256 ymm ymm +// Construct and append a VFNMADD132PD instruction to the active function. +func (c *Context) VFNMADD132PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFNMADD132PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMADD132PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD132PD xmm xmm xmm +// VFNMADD132PD m128 xmm xmm +// VFNMADD132PD ymm ymm ymm +// VFNMADD132PD m256 ymm ymm +// Construct and append a VFNMADD132PD instruction to the active function. +// Operates on the global context. +func VFNMADD132PD(mxy, xy, xy1 operand.Op) { ctx.VFNMADD132PD(mxy, xy, xy1) } + +// VFNMADD132PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD132PS xmm xmm xmm +// VFNMADD132PS m128 xmm xmm +// VFNMADD132PS ymm ymm ymm +// VFNMADD132PS m256 ymm ymm +// Construct and append a VFNMADD132PS instruction to the active function. +func (c *Context) VFNMADD132PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFNMADD132PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMADD132PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD132PS xmm xmm xmm +// VFNMADD132PS m128 xmm xmm +// VFNMADD132PS ymm ymm ymm +// VFNMADD132PS m256 ymm ymm +// Construct and append a VFNMADD132PS instruction to the active function. +// Operates on the global context. +func VFNMADD132PS(mxy, xy, xy1 operand.Op) { ctx.VFNMADD132PS(mxy, xy, xy1) } + +// VFNMADD132SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD132SD xmm xmm xmm +// VFNMADD132SD m64 xmm xmm +// Construct and append a VFNMADD132SD instruction to the active function. +func (c *Context) VFNMADD132SD(mx, x, x1 operand.Op) { + if inst, err := x86.VFNMADD132SD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMADD132SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD132SD xmm xmm xmm +// VFNMADD132SD m64 xmm xmm +// Construct and append a VFNMADD132SD instruction to the active function. +// Operates on the global context. +func VFNMADD132SD(mx, x, x1 operand.Op) { ctx.VFNMADD132SD(mx, x, x1) } + +// VFNMADD132SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD132SS xmm xmm xmm +// VFNMADD132SS m32 xmm xmm +// Construct and append a VFNMADD132SS instruction to the active function. +func (c *Context) VFNMADD132SS(mx, x, x1 operand.Op) { + if inst, err := x86.VFNMADD132SS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMADD132SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD132SS xmm xmm xmm +// VFNMADD132SS m32 xmm xmm +// Construct and append a VFNMADD132SS instruction to the active function. +// Operates on the global context. +func VFNMADD132SS(mx, x, x1 operand.Op) { ctx.VFNMADD132SS(mx, x, x1) } + +// VFNMADD213PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD213PD xmm xmm xmm +// VFNMADD213PD m128 xmm xmm +// VFNMADD213PD ymm ymm ymm +// VFNMADD213PD m256 ymm ymm +// Construct and append a VFNMADD213PD instruction to the active function. +func (c *Context) VFNMADD213PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFNMADD213PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMADD213PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD213PD xmm xmm xmm +// VFNMADD213PD m128 xmm xmm +// VFNMADD213PD ymm ymm ymm +// VFNMADD213PD m256 ymm ymm +// Construct and append a VFNMADD213PD instruction to the active function. +// Operates on the global context. +func VFNMADD213PD(mxy, xy, xy1 operand.Op) { ctx.VFNMADD213PD(mxy, xy, xy1) } + +// VFNMADD213PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD213PS xmm xmm xmm +// VFNMADD213PS m128 xmm xmm +// VFNMADD213PS ymm ymm ymm +// VFNMADD213PS m256 ymm ymm +// Construct and append a VFNMADD213PS instruction to the active function. +func (c *Context) VFNMADD213PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFNMADD213PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMADD213PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD213PS xmm xmm xmm +// VFNMADD213PS m128 xmm xmm +// VFNMADD213PS ymm ymm ymm +// VFNMADD213PS m256 ymm ymm +// Construct and append a VFNMADD213PS instruction to the active function. +// Operates on the global context. +func VFNMADD213PS(mxy, xy, xy1 operand.Op) { ctx.VFNMADD213PS(mxy, xy, xy1) } + +// VFNMADD213SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD213SD xmm xmm xmm +// VFNMADD213SD m64 xmm xmm +// Construct and append a VFNMADD213SD instruction to the active function. +func (c *Context) VFNMADD213SD(mx, x, x1 operand.Op) { + if inst, err := x86.VFNMADD213SD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMADD213SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD213SD xmm xmm xmm +// VFNMADD213SD m64 xmm xmm +// Construct and append a VFNMADD213SD instruction to the active function. +// Operates on the global context. +func VFNMADD213SD(mx, x, x1 operand.Op) { ctx.VFNMADD213SD(mx, x, x1) } + +// VFNMADD213SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD213SS xmm xmm xmm +// VFNMADD213SS m32 xmm xmm +// Construct and append a VFNMADD213SS instruction to the active function. +func (c *Context) VFNMADD213SS(mx, x, x1 operand.Op) { + if inst, err := x86.VFNMADD213SS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMADD213SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD213SS xmm xmm xmm +// VFNMADD213SS m32 xmm xmm +// Construct and append a VFNMADD213SS instruction to the active function. +// Operates on the global context. +func VFNMADD213SS(mx, x, x1 operand.Op) { ctx.VFNMADD213SS(mx, x, x1) } + +// VFNMADD231PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD231PD xmm xmm xmm +// VFNMADD231PD m128 xmm xmm +// VFNMADD231PD ymm ymm ymm +// VFNMADD231PD m256 ymm ymm +// Construct and append a VFNMADD231PD instruction to the active function. +func (c *Context) VFNMADD231PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFNMADD231PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMADD231PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD231PD xmm xmm xmm +// VFNMADD231PD m128 xmm xmm +// VFNMADD231PD ymm ymm ymm +// VFNMADD231PD m256 ymm ymm +// Construct and append a VFNMADD231PD instruction to the active function. +// Operates on the global context. +func VFNMADD231PD(mxy, xy, xy1 operand.Op) { ctx.VFNMADD231PD(mxy, xy, xy1) } + +// VFNMADD231PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD231PS xmm xmm xmm +// VFNMADD231PS m128 xmm xmm +// VFNMADD231PS ymm ymm ymm +// VFNMADD231PS m256 ymm ymm +// Construct and append a VFNMADD231PS instruction to the active function. +func (c *Context) VFNMADD231PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFNMADD231PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMADD231PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD231PS xmm xmm xmm +// VFNMADD231PS m128 xmm xmm +// VFNMADD231PS ymm ymm ymm +// VFNMADD231PS m256 ymm ymm +// Construct and append a VFNMADD231PS instruction to the active function. +// Operates on the global context. +func VFNMADD231PS(mxy, xy, xy1 operand.Op) { ctx.VFNMADD231PS(mxy, xy, xy1) } + +// VFNMADD231SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD231SD xmm xmm xmm +// VFNMADD231SD m64 xmm xmm +// Construct and append a VFNMADD231SD instruction to the active function. +func (c *Context) VFNMADD231SD(mx, x, x1 operand.Op) { + if inst, err := x86.VFNMADD231SD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMADD231SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD231SD xmm xmm xmm +// VFNMADD231SD m64 xmm xmm +// Construct and append a VFNMADD231SD instruction to the active function. +// Operates on the global context. +func VFNMADD231SD(mx, x, x1 operand.Op) { ctx.VFNMADD231SD(mx, x, x1) } + +// VFNMADD231SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD231SS xmm xmm xmm +// VFNMADD231SS m32 xmm xmm +// Construct and append a VFNMADD231SS instruction to the active function. +func (c *Context) VFNMADD231SS(mx, x, x1 operand.Op) { + if inst, err := x86.VFNMADD231SS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMADD231SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD231SS xmm xmm xmm +// VFNMADD231SS m32 xmm xmm +// Construct and append a VFNMADD231SS instruction to the active function. +// Operates on the global context. +func VFNMADD231SS(mx, x, x1 operand.Op) { ctx.VFNMADD231SS(mx, x, x1) } + +// VFNMSUB132PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB132PD xmm xmm xmm +// VFNMSUB132PD m128 xmm xmm +// VFNMSUB132PD ymm ymm ymm +// VFNMSUB132PD m256 ymm ymm +// Construct and append a VFNMSUB132PD instruction to the active function. +func (c *Context) VFNMSUB132PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFNMSUB132PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMSUB132PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB132PD xmm xmm xmm +// VFNMSUB132PD m128 xmm xmm +// VFNMSUB132PD ymm ymm ymm +// VFNMSUB132PD m256 ymm ymm +// Construct and append a VFNMSUB132PD instruction to the active function. +// Operates on the global context. +func VFNMSUB132PD(mxy, xy, xy1 operand.Op) { ctx.VFNMSUB132PD(mxy, xy, xy1) } + +// VFNMSUB132PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB132PS xmm xmm xmm +// VFNMSUB132PS m128 xmm xmm +// VFNMSUB132PS ymm ymm ymm +// VFNMSUB132PS m256 ymm ymm +// Construct and append a VFNMSUB132PS instruction to the active function. +func (c *Context) VFNMSUB132PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFNMSUB132PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMSUB132PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB132PS xmm xmm xmm +// VFNMSUB132PS m128 xmm xmm +// VFNMSUB132PS ymm ymm ymm +// VFNMSUB132PS m256 ymm ymm +// Construct and append a VFNMSUB132PS instruction to the active function. +// Operates on the global context. +func VFNMSUB132PS(mxy, xy, xy1 operand.Op) { ctx.VFNMSUB132PS(mxy, xy, xy1) } + +// VFNMSUB132SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB132SD xmm xmm xmm +// VFNMSUB132SD m64 xmm xmm +// Construct and append a VFNMSUB132SD instruction to the active function. +func (c *Context) VFNMSUB132SD(mx, x, x1 operand.Op) { + if inst, err := x86.VFNMSUB132SD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMSUB132SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB132SD xmm xmm xmm +// VFNMSUB132SD m64 xmm xmm +// Construct and append a VFNMSUB132SD instruction to the active function. +// Operates on the global context. +func VFNMSUB132SD(mx, x, x1 operand.Op) { ctx.VFNMSUB132SD(mx, x, x1) } + +// VFNMSUB132SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB132SS xmm xmm xmm +// VFNMSUB132SS m32 xmm xmm +// Construct and append a VFNMSUB132SS instruction to the active function. +func (c *Context) VFNMSUB132SS(mx, x, x1 operand.Op) { + if inst, err := x86.VFNMSUB132SS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMSUB132SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB132SS xmm xmm xmm +// VFNMSUB132SS m32 xmm xmm +// Construct and append a VFNMSUB132SS instruction to the active function. +// Operates on the global context. +func VFNMSUB132SS(mx, x, x1 operand.Op) { ctx.VFNMSUB132SS(mx, x, x1) } + +// VFNMSUB213PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB213PD xmm xmm xmm +// VFNMSUB213PD m128 xmm xmm +// VFNMSUB213PD ymm ymm ymm +// VFNMSUB213PD m256 ymm ymm +// Construct and append a VFNMSUB213PD instruction to the active function. +func (c *Context) VFNMSUB213PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFNMSUB213PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMSUB213PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB213PD xmm xmm xmm +// VFNMSUB213PD m128 xmm xmm +// VFNMSUB213PD ymm ymm ymm +// VFNMSUB213PD m256 ymm ymm +// Construct and append a VFNMSUB213PD instruction to the active function. +// Operates on the global context. +func VFNMSUB213PD(mxy, xy, xy1 operand.Op) { ctx.VFNMSUB213PD(mxy, xy, xy1) } + +// VFNMSUB213PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB213PS xmm xmm xmm +// VFNMSUB213PS m128 xmm xmm +// VFNMSUB213PS ymm ymm ymm +// VFNMSUB213PS m256 ymm ymm +// Construct and append a VFNMSUB213PS instruction to the active function. +func (c *Context) VFNMSUB213PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFNMSUB213PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMSUB213PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB213PS xmm xmm xmm +// VFNMSUB213PS m128 xmm xmm +// VFNMSUB213PS ymm ymm ymm +// VFNMSUB213PS m256 ymm ymm +// Construct and append a VFNMSUB213PS instruction to the active function. +// Operates on the global context. +func VFNMSUB213PS(mxy, xy, xy1 operand.Op) { ctx.VFNMSUB213PS(mxy, xy, xy1) } + +// VFNMSUB213SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB213SD xmm xmm xmm +// VFNMSUB213SD m64 xmm xmm +// Construct and append a VFNMSUB213SD instruction to the active function. +func (c *Context) VFNMSUB213SD(mx, x, x1 operand.Op) { + if inst, err := x86.VFNMSUB213SD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMSUB213SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB213SD xmm xmm xmm +// VFNMSUB213SD m64 xmm xmm +// Construct and append a VFNMSUB213SD instruction to the active function. +// Operates on the global context. +func VFNMSUB213SD(mx, x, x1 operand.Op) { ctx.VFNMSUB213SD(mx, x, x1) } + +// VFNMSUB213SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB213SS xmm xmm xmm +// VFNMSUB213SS m32 xmm xmm +// Construct and append a VFNMSUB213SS instruction to the active function. +func (c *Context) VFNMSUB213SS(mx, x, x1 operand.Op) { + if inst, err := x86.VFNMSUB213SS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMSUB213SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB213SS xmm xmm xmm +// VFNMSUB213SS m32 xmm xmm +// Construct and append a VFNMSUB213SS instruction to the active function. +// Operates on the global context. +func VFNMSUB213SS(mx, x, x1 operand.Op) { ctx.VFNMSUB213SS(mx, x, x1) } + +// VFNMSUB231PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB231PD xmm xmm xmm +// VFNMSUB231PD m128 xmm xmm +// VFNMSUB231PD ymm ymm ymm +// VFNMSUB231PD m256 ymm ymm +// Construct and append a VFNMSUB231PD instruction to the active function. +func (c *Context) VFNMSUB231PD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFNMSUB231PD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMSUB231PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB231PD xmm xmm xmm +// VFNMSUB231PD m128 xmm xmm +// VFNMSUB231PD ymm ymm ymm +// VFNMSUB231PD m256 ymm ymm +// Construct and append a VFNMSUB231PD instruction to the active function. +// Operates on the global context. +func VFNMSUB231PD(mxy, xy, xy1 operand.Op) { ctx.VFNMSUB231PD(mxy, xy, xy1) } + +// VFNMSUB231PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB231PS xmm xmm xmm +// VFNMSUB231PS m128 xmm xmm +// VFNMSUB231PS ymm ymm ymm +// VFNMSUB231PS m256 ymm ymm +// Construct and append a VFNMSUB231PS instruction to the active function. +func (c *Context) VFNMSUB231PS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VFNMSUB231PS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMSUB231PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB231PS xmm xmm xmm +// VFNMSUB231PS m128 xmm xmm +// VFNMSUB231PS ymm ymm ymm +// VFNMSUB231PS m256 ymm ymm +// Construct and append a VFNMSUB231PS instruction to the active function. +// Operates on the global context. +func VFNMSUB231PS(mxy, xy, xy1 operand.Op) { ctx.VFNMSUB231PS(mxy, xy, xy1) } + +// VFNMSUB231SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB231SD xmm xmm xmm +// VFNMSUB231SD m64 xmm xmm +// Construct and append a VFNMSUB231SD instruction to the active function. +func (c *Context) VFNMSUB231SD(mx, x, x1 operand.Op) { + if inst, err := x86.VFNMSUB231SD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMSUB231SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB231SD xmm xmm xmm +// VFNMSUB231SD m64 xmm xmm +// Construct and append a VFNMSUB231SD instruction to the active function. +// Operates on the global context. +func VFNMSUB231SD(mx, x, x1 operand.Op) { ctx.VFNMSUB231SD(mx, x, x1) } + +// VFNMSUB231SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB231SS xmm xmm xmm +// VFNMSUB231SS m32 xmm xmm +// Construct and append a VFNMSUB231SS instruction to the active function. +func (c *Context) VFNMSUB231SS(mx, x, x1 operand.Op) { + if inst, err := x86.VFNMSUB231SS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VFNMSUB231SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB231SS xmm xmm xmm +// VFNMSUB231SS m32 xmm xmm +// Construct and append a VFNMSUB231SS instruction to the active function. +// Operates on the global context. +func VFNMSUB231SS(mx, x, x1 operand.Op) { ctx.VFNMSUB231SS(mx, x, x1) } + +// VGATHERDPD: Gather Packed Double-Precision Floating-Point Values Using Signed Doubleword Indices. +// +// Forms: +// +// VGATHERDPD xmm vm32x xmm +// VGATHERDPD ymm vm32x ymm +// Construct and append a VGATHERDPD instruction to the active function. +func (c *Context) VGATHERDPD(xy, v, xy1 operand.Op) { + if inst, err := x86.VGATHERDPD(xy, v, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VGATHERDPD: Gather Packed Double-Precision Floating-Point Values Using Signed Doubleword Indices. +// +// Forms: +// +// VGATHERDPD xmm vm32x xmm +// VGATHERDPD ymm vm32x ymm +// Construct and append a VGATHERDPD instruction to the active function. +// Operates on the global context. +func VGATHERDPD(xy, v, xy1 operand.Op) { ctx.VGATHERDPD(xy, v, xy1) } + +// VGATHERDPS: Gather Packed Single-Precision Floating-Point Values Using Signed Doubleword Indices. +// +// Forms: +// +// VGATHERDPS xmm vm32x xmm +// VGATHERDPS ymm vm32y ymm +// Construct and append a VGATHERDPS instruction to the active function. +func (c *Context) VGATHERDPS(xy, v, xy1 operand.Op) { + if inst, err := x86.VGATHERDPS(xy, v, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VGATHERDPS: Gather Packed Single-Precision Floating-Point Values Using Signed Doubleword Indices. +// +// Forms: +// +// VGATHERDPS xmm vm32x xmm +// VGATHERDPS ymm vm32y ymm +// Construct and append a VGATHERDPS instruction to the active function. +// Operates on the global context. +func VGATHERDPS(xy, v, xy1 operand.Op) { ctx.VGATHERDPS(xy, v, xy1) } + +// VGATHERQPD: Gather Packed Double-Precision Floating-Point Values Using Signed Quadword Indices. +// +// Forms: +// +// VGATHERQPD xmm vm64x xmm +// VGATHERQPD ymm vm64y ymm +// Construct and append a VGATHERQPD instruction to the active function. +func (c *Context) VGATHERQPD(xy, v, xy1 operand.Op) { + if inst, err := x86.VGATHERQPD(xy, v, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VGATHERQPD: Gather Packed Double-Precision Floating-Point Values Using Signed Quadword Indices. +// +// Forms: +// +// VGATHERQPD xmm vm64x xmm +// VGATHERQPD ymm vm64y ymm +// Construct and append a VGATHERQPD instruction to the active function. +// Operates on the global context. +func VGATHERQPD(xy, v, xy1 operand.Op) { ctx.VGATHERQPD(xy, v, xy1) } + +// VGATHERQPS: Gather Packed Single-Precision Floating-Point Values Using Signed Quadword Indices. +// +// Forms: +// +// VGATHERQPS xmm vm64x xmm +// VGATHERQPS xmm vm64y xmm +// Construct and append a VGATHERQPS instruction to the active function. +func (c *Context) VGATHERQPS(x, v, x1 operand.Op) { + if inst, err := x86.VGATHERQPS(x, v, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VGATHERQPS: Gather Packed Single-Precision Floating-Point Values Using Signed Quadword Indices. +// +// Forms: +// +// VGATHERQPS xmm vm64x xmm +// VGATHERQPS xmm vm64y xmm +// Construct and append a VGATHERQPS instruction to the active function. +// Operates on the global context. +func VGATHERQPS(x, v, x1 operand.Op) { ctx.VGATHERQPS(x, v, x1) } + +// VHADDPD: Packed Double-FP Horizontal Add. +// +// Forms: +// +// VHADDPD xmm xmm xmm +// VHADDPD m128 xmm xmm +// VHADDPD ymm ymm ymm +// VHADDPD m256 ymm ymm +// Construct and append a VHADDPD instruction to the active function. +func (c *Context) VHADDPD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VHADDPD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VHADDPD: Packed Double-FP Horizontal Add. +// +// Forms: +// +// VHADDPD xmm xmm xmm +// VHADDPD m128 xmm xmm +// VHADDPD ymm ymm ymm +// VHADDPD m256 ymm ymm +// Construct and append a VHADDPD instruction to the active function. +// Operates on the global context. +func VHADDPD(mxy, xy, xy1 operand.Op) { ctx.VHADDPD(mxy, xy, xy1) } + +// VHADDPS: Packed Single-FP Horizontal Add. +// +// Forms: +// +// VHADDPS xmm xmm xmm +// VHADDPS m128 xmm xmm +// VHADDPS ymm ymm ymm +// VHADDPS m256 ymm ymm +// Construct and append a VHADDPS instruction to the active function. +func (c *Context) VHADDPS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VHADDPS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VHADDPS: Packed Single-FP Horizontal Add. +// +// Forms: +// +// VHADDPS xmm xmm xmm +// VHADDPS m128 xmm xmm +// VHADDPS ymm ymm ymm +// VHADDPS m256 ymm ymm +// Construct and append a VHADDPS instruction to the active function. +// Operates on the global context. +func VHADDPS(mxy, xy, xy1 operand.Op) { ctx.VHADDPS(mxy, xy, xy1) } + +// VHSUBPD: Packed Double-FP Horizontal Subtract. +// +// Forms: +// +// VHSUBPD xmm xmm xmm +// VHSUBPD m128 xmm xmm +// VHSUBPD ymm ymm ymm +// VHSUBPD m256 ymm ymm +// Construct and append a VHSUBPD instruction to the active function. +func (c *Context) VHSUBPD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VHSUBPD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VHSUBPD: Packed Double-FP Horizontal Subtract. +// +// Forms: +// +// VHSUBPD xmm xmm xmm +// VHSUBPD m128 xmm xmm +// VHSUBPD ymm ymm ymm +// VHSUBPD m256 ymm ymm +// Construct and append a VHSUBPD instruction to the active function. +// Operates on the global context. +func VHSUBPD(mxy, xy, xy1 operand.Op) { ctx.VHSUBPD(mxy, xy, xy1) } + +// VHSUBPS: Packed Single-FP Horizontal Subtract. +// +// Forms: +// +// VHSUBPS xmm xmm xmm +// VHSUBPS m128 xmm xmm +// VHSUBPS ymm ymm ymm +// VHSUBPS m256 ymm ymm +// Construct and append a VHSUBPS instruction to the active function. +func (c *Context) VHSUBPS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VHSUBPS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VHSUBPS: Packed Single-FP Horizontal Subtract. +// +// Forms: +// +// VHSUBPS xmm xmm xmm +// VHSUBPS m128 xmm xmm +// VHSUBPS ymm ymm ymm +// VHSUBPS m256 ymm ymm +// Construct and append a VHSUBPS instruction to the active function. +// Operates on the global context. +func VHSUBPS(mxy, xy, xy1 operand.Op) { ctx.VHSUBPS(mxy, xy, xy1) } + +// VINSERTF128: Insert Packed Floating-Point Values. +// +// Forms: +// +// VINSERTF128 imm8 xmm ymm ymm +// VINSERTF128 imm8 m128 ymm ymm +// Construct and append a VINSERTF128 instruction to the active function. +func (c *Context) VINSERTF128(i, mx, y, y1 operand.Op) { + if inst, err := x86.VINSERTF128(i, mx, y, y1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VINSERTF128: Insert Packed Floating-Point Values. +// +// Forms: +// +// VINSERTF128 imm8 xmm ymm ymm +// VINSERTF128 imm8 m128 ymm ymm +// Construct and append a VINSERTF128 instruction to the active function. +// Operates on the global context. +func VINSERTF128(i, mx, y, y1 operand.Op) { ctx.VINSERTF128(i, mx, y, y1) } + +// VINSERTI128: Insert Packed Integer Values. +// +// Forms: +// +// VINSERTI128 imm8 xmm ymm ymm +// VINSERTI128 imm8 m128 ymm ymm +// Construct and append a VINSERTI128 instruction to the active function. +func (c *Context) VINSERTI128(i, mx, y, y1 operand.Op) { + if inst, err := x86.VINSERTI128(i, mx, y, y1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VINSERTI128: Insert Packed Integer Values. +// +// Forms: +// +// VINSERTI128 imm8 xmm ymm ymm +// VINSERTI128 imm8 m128 ymm ymm +// Construct and append a VINSERTI128 instruction to the active function. +// Operates on the global context. +func VINSERTI128(i, mx, y, y1 operand.Op) { ctx.VINSERTI128(i, mx, y, y1) } + +// VINSERTPS: Insert Packed Single Precision Floating-Point Value. +// +// Forms: +// +// VINSERTPS imm8 xmm xmm xmm +// VINSERTPS imm8 m32 xmm xmm +// Construct and append a VINSERTPS instruction to the active function. +func (c *Context) VINSERTPS(i, mx, x, x1 operand.Op) { + if inst, err := x86.VINSERTPS(i, mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VINSERTPS: Insert Packed Single Precision Floating-Point Value. +// +// Forms: +// +// VINSERTPS imm8 xmm xmm xmm +// VINSERTPS imm8 m32 xmm xmm +// Construct and append a VINSERTPS instruction to the active function. +// Operates on the global context. +func VINSERTPS(i, mx, x, x1 operand.Op) { ctx.VINSERTPS(i, mx, x, x1) } + +// VLDDQU: Load Unaligned Integer 128 Bits. +// +// Forms: +// +// VLDDQU m128 xmm +// VLDDQU m256 ymm +// Construct and append a VLDDQU instruction to the active function. +func (c *Context) VLDDQU(m, xy operand.Op) { + if inst, err := x86.VLDDQU(m, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VLDDQU: Load Unaligned Integer 128 Bits. +// +// Forms: +// +// VLDDQU m128 xmm +// VLDDQU m256 ymm +// Construct and append a VLDDQU instruction to the active function. +// Operates on the global context. +func VLDDQU(m, xy operand.Op) { ctx.VLDDQU(m, xy) } + +// VLDMXCSR: Load MXCSR Register. +// +// Forms: +// +// VLDMXCSR m32 +// Construct and append a VLDMXCSR instruction to the active function. +func (c *Context) VLDMXCSR(m operand.Op) { + if inst, err := x86.VLDMXCSR(m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VLDMXCSR: Load MXCSR Register. +// +// Forms: +// +// VLDMXCSR m32 +// Construct and append a VLDMXCSR instruction to the active function. +// Operates on the global context. +func VLDMXCSR(m operand.Op) { ctx.VLDMXCSR(m) } + +// VMASKMOVDQU: Store Selected Bytes of Double Quadword. +// +// Forms: +// +// VMASKMOVDQU xmm xmm +// Construct and append a VMASKMOVDQU instruction to the active function. +func (c *Context) VMASKMOVDQU(x, x1 operand.Op) { + if inst, err := x86.VMASKMOVDQU(x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMASKMOVDQU: Store Selected Bytes of Double Quadword. +// +// Forms: +// +// VMASKMOVDQU xmm xmm +// Construct and append a VMASKMOVDQU instruction to the active function. +// Operates on the global context. +func VMASKMOVDQU(x, x1 operand.Op) { ctx.VMASKMOVDQU(x, x1) } + +// VMASKMOVPD: Conditional Move Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMASKMOVPD m128 xmm xmm +// VMASKMOVPD m256 ymm ymm +// VMASKMOVPD xmm xmm m128 +// VMASKMOVPD ymm ymm m256 +// Construct and append a VMASKMOVPD instruction to the active function. +func (c *Context) VMASKMOVPD(mxy, xy, mxy1 operand.Op) { + if inst, err := x86.VMASKMOVPD(mxy, xy, mxy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMASKMOVPD: Conditional Move Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMASKMOVPD m128 xmm xmm +// VMASKMOVPD m256 ymm ymm +// VMASKMOVPD xmm xmm m128 +// VMASKMOVPD ymm ymm m256 +// Construct and append a VMASKMOVPD instruction to the active function. +// Operates on the global context. +func VMASKMOVPD(mxy, xy, mxy1 operand.Op) { ctx.VMASKMOVPD(mxy, xy, mxy1) } + +// VMASKMOVPS: Conditional Move Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMASKMOVPS m128 xmm xmm +// VMASKMOVPS m256 ymm ymm +// VMASKMOVPS xmm xmm m128 +// VMASKMOVPS ymm ymm m256 +// Construct and append a VMASKMOVPS instruction to the active function. +func (c *Context) VMASKMOVPS(mxy, xy, mxy1 operand.Op) { + if inst, err := x86.VMASKMOVPS(mxy, xy, mxy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMASKMOVPS: Conditional Move Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMASKMOVPS m128 xmm xmm +// VMASKMOVPS m256 ymm ymm +// VMASKMOVPS xmm xmm m128 +// VMASKMOVPS ymm ymm m256 +// Construct and append a VMASKMOVPS instruction to the active function. +// Operates on the global context. +func VMASKMOVPS(mxy, xy, mxy1 operand.Op) { ctx.VMASKMOVPS(mxy, xy, mxy1) } + +// VMAXPD: Return Maximum Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMAXPD xmm xmm xmm +// VMAXPD m128 xmm xmm +// VMAXPD ymm ymm ymm +// VMAXPD m256 ymm ymm +// Construct and append a VMAXPD instruction to the active function. +func (c *Context) VMAXPD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VMAXPD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMAXPD: Return Maximum Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMAXPD xmm xmm xmm +// VMAXPD m128 xmm xmm +// VMAXPD ymm ymm ymm +// VMAXPD m256 ymm ymm +// Construct and append a VMAXPD instruction to the active function. +// Operates on the global context. +func VMAXPD(mxy, xy, xy1 operand.Op) { ctx.VMAXPD(mxy, xy, xy1) } + +// VMAXPS: Return Maximum Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMAXPS xmm xmm xmm +// VMAXPS m128 xmm xmm +// VMAXPS ymm ymm ymm +// VMAXPS m256 ymm ymm +// Construct and append a VMAXPS instruction to the active function. +func (c *Context) VMAXPS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VMAXPS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMAXPS: Return Maximum Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMAXPS xmm xmm xmm +// VMAXPS m128 xmm xmm +// VMAXPS ymm ymm ymm +// VMAXPS m256 ymm ymm +// Construct and append a VMAXPS instruction to the active function. +// Operates on the global context. +func VMAXPS(mxy, xy, xy1 operand.Op) { ctx.VMAXPS(mxy, xy, xy1) } + +// VMAXSD: Return Maximum Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// VMAXSD xmm xmm xmm +// VMAXSD m64 xmm xmm +// Construct and append a VMAXSD instruction to the active function. +func (c *Context) VMAXSD(mx, x, x1 operand.Op) { + if inst, err := x86.VMAXSD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMAXSD: Return Maximum Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// VMAXSD xmm xmm xmm +// VMAXSD m64 xmm xmm +// Construct and append a VMAXSD instruction to the active function. +// Operates on the global context. +func VMAXSD(mx, x, x1 operand.Op) { ctx.VMAXSD(mx, x, x1) } + +// VMAXSS: Return Maximum Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// VMAXSS xmm xmm xmm +// VMAXSS m32 xmm xmm +// Construct and append a VMAXSS instruction to the active function. +func (c *Context) VMAXSS(mx, x, x1 operand.Op) { + if inst, err := x86.VMAXSS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMAXSS: Return Maximum Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// VMAXSS xmm xmm xmm +// VMAXSS m32 xmm xmm +// Construct and append a VMAXSS instruction to the active function. +// Operates on the global context. +func VMAXSS(mx, x, x1 operand.Op) { ctx.VMAXSS(mx, x, x1) } + +// VMINPD: Return Minimum Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMINPD xmm xmm xmm +// VMINPD m128 xmm xmm +// VMINPD ymm ymm ymm +// VMINPD m256 ymm ymm +// Construct and append a VMINPD instruction to the active function. +func (c *Context) VMINPD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VMINPD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMINPD: Return Minimum Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMINPD xmm xmm xmm +// VMINPD m128 xmm xmm +// VMINPD ymm ymm ymm +// VMINPD m256 ymm ymm +// Construct and append a VMINPD instruction to the active function. +// Operates on the global context. +func VMINPD(mxy, xy, xy1 operand.Op) { ctx.VMINPD(mxy, xy, xy1) } + +// VMINPS: Return Minimum Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMINPS xmm xmm xmm +// VMINPS m128 xmm xmm +// VMINPS ymm ymm ymm +// VMINPS m256 ymm ymm +// Construct and append a VMINPS instruction to the active function. +func (c *Context) VMINPS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VMINPS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMINPS: Return Minimum Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMINPS xmm xmm xmm +// VMINPS m128 xmm xmm +// VMINPS ymm ymm ymm +// VMINPS m256 ymm ymm +// Construct and append a VMINPS instruction to the active function. +// Operates on the global context. +func VMINPS(mxy, xy, xy1 operand.Op) { ctx.VMINPS(mxy, xy, xy1) } + +// VMINSD: Return Minimum Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// VMINSD xmm xmm xmm +// VMINSD m64 xmm xmm +// Construct and append a VMINSD instruction to the active function. +func (c *Context) VMINSD(mx, x, x1 operand.Op) { + if inst, err := x86.VMINSD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMINSD: Return Minimum Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// VMINSD xmm xmm xmm +// VMINSD m64 xmm xmm +// Construct and append a VMINSD instruction to the active function. +// Operates on the global context. +func VMINSD(mx, x, x1 operand.Op) { ctx.VMINSD(mx, x, x1) } + +// VMINSS: Return Minimum Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// VMINSS xmm xmm xmm +// VMINSS m32 xmm xmm +// Construct and append a VMINSS instruction to the active function. +func (c *Context) VMINSS(mx, x, x1 operand.Op) { + if inst, err := x86.VMINSS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMINSS: Return Minimum Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// VMINSS xmm xmm xmm +// VMINSS m32 xmm xmm +// Construct and append a VMINSS instruction to the active function. +// Operates on the global context. +func VMINSS(mx, x, x1 operand.Op) { ctx.VMINSS(mx, x, x1) } + +// VMOVAPD: Move Aligned Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMOVAPD xmm xmm +// VMOVAPD m128 xmm +// VMOVAPD ymm ymm +// VMOVAPD m256 ymm +// VMOVAPD xmm m128 +// VMOVAPD ymm m256 +// Construct and append a VMOVAPD instruction to the active function. +func (c *Context) VMOVAPD(mxy, mxy1 operand.Op) { + if inst, err := x86.VMOVAPD(mxy, mxy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVAPD: Move Aligned Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMOVAPD xmm xmm +// VMOVAPD m128 xmm +// VMOVAPD ymm ymm +// VMOVAPD m256 ymm +// VMOVAPD xmm m128 +// VMOVAPD ymm m256 +// Construct and append a VMOVAPD instruction to the active function. +// Operates on the global context. +func VMOVAPD(mxy, mxy1 operand.Op) { ctx.VMOVAPD(mxy, mxy1) } + +// VMOVAPS: Move Aligned Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMOVAPS xmm xmm +// VMOVAPS m128 xmm +// VMOVAPS ymm ymm +// VMOVAPS m256 ymm +// VMOVAPS xmm m128 +// VMOVAPS ymm m256 +// Construct and append a VMOVAPS instruction to the active function. +func (c *Context) VMOVAPS(mxy, mxy1 operand.Op) { + if inst, err := x86.VMOVAPS(mxy, mxy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVAPS: Move Aligned Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMOVAPS xmm xmm +// VMOVAPS m128 xmm +// VMOVAPS ymm ymm +// VMOVAPS m256 ymm +// VMOVAPS xmm m128 +// VMOVAPS ymm m256 +// Construct and append a VMOVAPS instruction to the active function. +// Operates on the global context. +func VMOVAPS(mxy, mxy1 operand.Op) { ctx.VMOVAPS(mxy, mxy1) } + +// VMOVD: Move Doubleword. +// +// Forms: +// +// VMOVD xmm r32 +// VMOVD r32 xmm +// VMOVD m32 xmm +// VMOVD xmm m32 +// Construct and append a VMOVD instruction to the active function. +func (c *Context) VMOVD(mrx, mrx1 operand.Op) { + if inst, err := x86.VMOVD(mrx, mrx1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVD: Move Doubleword. +// +// Forms: +// +// VMOVD xmm r32 +// VMOVD r32 xmm +// VMOVD m32 xmm +// VMOVD xmm m32 +// Construct and append a VMOVD instruction to the active function. +// Operates on the global context. +func VMOVD(mrx, mrx1 operand.Op) { ctx.VMOVD(mrx, mrx1) } + +// VMOVDDUP: Move One Double-FP and Duplicate. +// +// Forms: +// +// VMOVDDUP xmm xmm +// VMOVDDUP m64 xmm +// VMOVDDUP ymm ymm +// VMOVDDUP m256 ymm +// Construct and append a VMOVDDUP instruction to the active function. +func (c *Context) VMOVDDUP(mxy, xy operand.Op) { + if inst, err := x86.VMOVDDUP(mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVDDUP: Move One Double-FP and Duplicate. +// +// Forms: +// +// VMOVDDUP xmm xmm +// VMOVDDUP m64 xmm +// VMOVDDUP ymm ymm +// VMOVDDUP m256 ymm +// Construct and append a VMOVDDUP instruction to the active function. +// Operates on the global context. +func VMOVDDUP(mxy, xy operand.Op) { ctx.VMOVDDUP(mxy, xy) } + +// VMOVDQA: Move Aligned Double Quadword. +// +// Forms: +// +// VMOVDQA xmm xmm +// VMOVDQA m128 xmm +// VMOVDQA ymm ymm +// VMOVDQA m256 ymm +// VMOVDQA xmm m128 +// VMOVDQA ymm m256 +// Construct and append a VMOVDQA instruction to the active function. +func (c *Context) VMOVDQA(mxy, mxy1 operand.Op) { + if inst, err := x86.VMOVDQA(mxy, mxy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVDQA: Move Aligned Double Quadword. +// +// Forms: +// +// VMOVDQA xmm xmm +// VMOVDQA m128 xmm +// VMOVDQA ymm ymm +// VMOVDQA m256 ymm +// VMOVDQA xmm m128 +// VMOVDQA ymm m256 +// Construct and append a VMOVDQA instruction to the active function. +// Operates on the global context. +func VMOVDQA(mxy, mxy1 operand.Op) { ctx.VMOVDQA(mxy, mxy1) } + +// VMOVDQU: Move Unaligned Double Quadword. +// +// Forms: +// +// VMOVDQU xmm xmm +// VMOVDQU m128 xmm +// VMOVDQU ymm ymm +// VMOVDQU m256 ymm +// VMOVDQU xmm m128 +// VMOVDQU ymm m256 +// Construct and append a VMOVDQU instruction to the active function. +func (c *Context) VMOVDQU(mxy, mxy1 operand.Op) { + if inst, err := x86.VMOVDQU(mxy, mxy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVDQU: Move Unaligned Double Quadword. +// +// Forms: +// +// VMOVDQU xmm xmm +// VMOVDQU m128 xmm +// VMOVDQU ymm ymm +// VMOVDQU m256 ymm +// VMOVDQU xmm m128 +// VMOVDQU ymm m256 +// Construct and append a VMOVDQU instruction to the active function. +// Operates on the global context. +func VMOVDQU(mxy, mxy1 operand.Op) { ctx.VMOVDQU(mxy, mxy1) } + +// VMOVHLPS: Move Packed Single-Precision Floating-Point Values High to Low. +// +// Forms: +// +// VMOVHLPS xmm xmm xmm +// Construct and append a VMOVHLPS instruction to the active function. +func (c *Context) VMOVHLPS(x, x1, x2 operand.Op) { + if inst, err := x86.VMOVHLPS(x, x1, x2); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVHLPS: Move Packed Single-Precision Floating-Point Values High to Low. +// +// Forms: +// +// VMOVHLPS xmm xmm xmm +// Construct and append a VMOVHLPS instruction to the active function. +// Operates on the global context. +func VMOVHLPS(x, x1, x2 operand.Op) { ctx.VMOVHLPS(x, x1, x2) } + +// VMOVHPD: Move High Packed Double-Precision Floating-Point Value. +// +// Forms: +// +// VMOVHPD xmm m64 +// VMOVHPD m64 xmm xmm +// Construct and append a VMOVHPD instruction to the active function. +func (c *Context) VMOVHPD(ops ...operand.Op) { + if inst, err := x86.VMOVHPD(ops...); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVHPD: Move High Packed Double-Precision Floating-Point Value. +// +// Forms: +// +// VMOVHPD xmm m64 +// VMOVHPD m64 xmm xmm +// Construct and append a VMOVHPD instruction to the active function. +// Operates on the global context. +func VMOVHPD(ops ...operand.Op) { ctx.VMOVHPD(ops...) } + +// VMOVHPS: Move High Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMOVHPS xmm m64 +// VMOVHPS m64 xmm xmm +// Construct and append a VMOVHPS instruction to the active function. +func (c *Context) VMOVHPS(ops ...operand.Op) { + if inst, err := x86.VMOVHPS(ops...); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVHPS: Move High Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMOVHPS xmm m64 +// VMOVHPS m64 xmm xmm +// Construct and append a VMOVHPS instruction to the active function. +// Operates on the global context. +func VMOVHPS(ops ...operand.Op) { ctx.VMOVHPS(ops...) } + +// VMOVLHPS: Move Packed Single-Precision Floating-Point Values Low to High. +// +// Forms: +// +// VMOVLHPS xmm xmm xmm +// Construct and append a VMOVLHPS instruction to the active function. +func (c *Context) VMOVLHPS(x, x1, x2 operand.Op) { + if inst, err := x86.VMOVLHPS(x, x1, x2); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVLHPS: Move Packed Single-Precision Floating-Point Values Low to High. +// +// Forms: +// +// VMOVLHPS xmm xmm xmm +// Construct and append a VMOVLHPS instruction to the active function. +// Operates on the global context. +func VMOVLHPS(x, x1, x2 operand.Op) { ctx.VMOVLHPS(x, x1, x2) } + +// VMOVLPD: Move Low Packed Double-Precision Floating-Point Value. +// +// Forms: +// +// VMOVLPD xmm m64 +// VMOVLPD m64 xmm xmm +// Construct and append a VMOVLPD instruction to the active function. +func (c *Context) VMOVLPD(ops ...operand.Op) { + if inst, err := x86.VMOVLPD(ops...); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVLPD: Move Low Packed Double-Precision Floating-Point Value. +// +// Forms: +// +// VMOVLPD xmm m64 +// VMOVLPD m64 xmm xmm +// Construct and append a VMOVLPD instruction to the active function. +// Operates on the global context. +func VMOVLPD(ops ...operand.Op) { ctx.VMOVLPD(ops...) } + +// VMOVLPS: Move Low Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMOVLPS xmm m64 +// VMOVLPS m64 xmm xmm +// Construct and append a VMOVLPS instruction to the active function. +func (c *Context) VMOVLPS(ops ...operand.Op) { + if inst, err := x86.VMOVLPS(ops...); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVLPS: Move Low Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMOVLPS xmm m64 +// VMOVLPS m64 xmm xmm +// Construct and append a VMOVLPS instruction to the active function. +// Operates on the global context. +func VMOVLPS(ops ...operand.Op) { ctx.VMOVLPS(ops...) } + +// VMOVMSKPD: Extract Packed Double-Precision Floating-Point Sign Mask. +// +// Forms: +// +// VMOVMSKPD xmm r32 +// VMOVMSKPD ymm r32 +// Construct and append a VMOVMSKPD instruction to the active function. +func (c *Context) VMOVMSKPD(xy, r operand.Op) { + if inst, err := x86.VMOVMSKPD(xy, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVMSKPD: Extract Packed Double-Precision Floating-Point Sign Mask. +// +// Forms: +// +// VMOVMSKPD xmm r32 +// VMOVMSKPD ymm r32 +// Construct and append a VMOVMSKPD instruction to the active function. +// Operates on the global context. +func VMOVMSKPD(xy, r operand.Op) { ctx.VMOVMSKPD(xy, r) } + +// VMOVMSKPS: Extract Packed Single-Precision Floating-Point Sign Mask. +// +// Forms: +// +// VMOVMSKPS xmm r32 +// VMOVMSKPS ymm r32 +// Construct and append a VMOVMSKPS instruction to the active function. +func (c *Context) VMOVMSKPS(xy, r operand.Op) { + if inst, err := x86.VMOVMSKPS(xy, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVMSKPS: Extract Packed Single-Precision Floating-Point Sign Mask. +// +// Forms: +// +// VMOVMSKPS xmm r32 +// VMOVMSKPS ymm r32 +// Construct and append a VMOVMSKPS instruction to the active function. +// Operates on the global context. +func VMOVMSKPS(xy, r operand.Op) { ctx.VMOVMSKPS(xy, r) } + +// VMOVNTDQ: Store Double Quadword Using Non-Temporal Hint. +// +// Forms: +// +// VMOVNTDQ xmm m128 +// VMOVNTDQ ymm m256 +// Construct and append a VMOVNTDQ instruction to the active function. +func (c *Context) VMOVNTDQ(xy, m operand.Op) { + if inst, err := x86.VMOVNTDQ(xy, m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVNTDQ: Store Double Quadword Using Non-Temporal Hint. +// +// Forms: +// +// VMOVNTDQ xmm m128 +// VMOVNTDQ ymm m256 +// Construct and append a VMOVNTDQ instruction to the active function. +// Operates on the global context. +func VMOVNTDQ(xy, m operand.Op) { ctx.VMOVNTDQ(xy, m) } + +// VMOVNTDQA: Load Double Quadword Non-Temporal Aligned Hint. +// +// Forms: +// +// VMOVNTDQA m128 xmm +// VMOVNTDQA m256 ymm +// Construct and append a VMOVNTDQA instruction to the active function. +func (c *Context) VMOVNTDQA(m, xy operand.Op) { + if inst, err := x86.VMOVNTDQA(m, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVNTDQA: Load Double Quadword Non-Temporal Aligned Hint. +// +// Forms: +// +// VMOVNTDQA m128 xmm +// VMOVNTDQA m256 ymm +// Construct and append a VMOVNTDQA instruction to the active function. +// Operates on the global context. +func VMOVNTDQA(m, xy operand.Op) { ctx.VMOVNTDQA(m, xy) } + +// VMOVNTPD: Store Packed Double-Precision Floating-Point Values Using Non-Temporal Hint. +// +// Forms: +// +// VMOVNTPD xmm m128 +// VMOVNTPD ymm m256 +// Construct and append a VMOVNTPD instruction to the active function. +func (c *Context) VMOVNTPD(xy, m operand.Op) { + if inst, err := x86.VMOVNTPD(xy, m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVNTPD: Store Packed Double-Precision Floating-Point Values Using Non-Temporal Hint. +// +// Forms: +// +// VMOVNTPD xmm m128 +// VMOVNTPD ymm m256 +// Construct and append a VMOVNTPD instruction to the active function. +// Operates on the global context. +func VMOVNTPD(xy, m operand.Op) { ctx.VMOVNTPD(xy, m) } + +// VMOVNTPS: Store Packed Single-Precision Floating-Point Values Using Non-Temporal Hint. +// +// Forms: +// +// VMOVNTPS xmm m128 +// VMOVNTPS ymm m256 +// Construct and append a VMOVNTPS instruction to the active function. +func (c *Context) VMOVNTPS(xy, m operand.Op) { + if inst, err := x86.VMOVNTPS(xy, m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVNTPS: Store Packed Single-Precision Floating-Point Values Using Non-Temporal Hint. +// +// Forms: +// +// VMOVNTPS xmm m128 +// VMOVNTPS ymm m256 +// Construct and append a VMOVNTPS instruction to the active function. +// Operates on the global context. +func VMOVNTPS(xy, m operand.Op) { ctx.VMOVNTPS(xy, m) } + +// VMOVQ: Move Quadword. +// +// Forms: +// +// VMOVQ xmm r64 +// VMOVQ r64 xmm +// VMOVQ xmm xmm +// VMOVQ m64 xmm +// VMOVQ xmm m64 +// Construct and append a VMOVQ instruction to the active function. +func (c *Context) VMOVQ(mrx, mrx1 operand.Op) { + if inst, err := x86.VMOVQ(mrx, mrx1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVQ: Move Quadword. +// +// Forms: +// +// VMOVQ xmm r64 +// VMOVQ r64 xmm +// VMOVQ xmm xmm +// VMOVQ m64 xmm +// VMOVQ xmm m64 +// Construct and append a VMOVQ instruction to the active function. +// Operates on the global context. +func VMOVQ(mrx, mrx1 operand.Op) { ctx.VMOVQ(mrx, mrx1) } + +// VMOVSD: Move Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// VMOVSD m64 xmm +// VMOVSD xmm m64 +// VMOVSD xmm xmm xmm +// Construct and append a VMOVSD instruction to the active function. +func (c *Context) VMOVSD(ops ...operand.Op) { + if inst, err := x86.VMOVSD(ops...); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVSD: Move Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// VMOVSD m64 xmm +// VMOVSD xmm m64 +// VMOVSD xmm xmm xmm +// Construct and append a VMOVSD instruction to the active function. +// Operates on the global context. +func VMOVSD(ops ...operand.Op) { ctx.VMOVSD(ops...) } + +// VMOVSHDUP: Move Packed Single-FP High and Duplicate. +// +// Forms: +// +// VMOVSHDUP xmm xmm +// VMOVSHDUP m128 xmm +// VMOVSHDUP ymm ymm +// VMOVSHDUP m256 ymm +// Construct and append a VMOVSHDUP instruction to the active function. +func (c *Context) VMOVSHDUP(mxy, xy operand.Op) { + if inst, err := x86.VMOVSHDUP(mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVSHDUP: Move Packed Single-FP High and Duplicate. +// +// Forms: +// +// VMOVSHDUP xmm xmm +// VMOVSHDUP m128 xmm +// VMOVSHDUP ymm ymm +// VMOVSHDUP m256 ymm +// Construct and append a VMOVSHDUP instruction to the active function. +// Operates on the global context. +func VMOVSHDUP(mxy, xy operand.Op) { ctx.VMOVSHDUP(mxy, xy) } + +// VMOVSLDUP: Move Packed Single-FP Low and Duplicate. +// +// Forms: +// +// VMOVSLDUP xmm xmm +// VMOVSLDUP m128 xmm +// VMOVSLDUP ymm ymm +// VMOVSLDUP m256 ymm +// Construct and append a VMOVSLDUP instruction to the active function. +func (c *Context) VMOVSLDUP(mxy, xy operand.Op) { + if inst, err := x86.VMOVSLDUP(mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVSLDUP: Move Packed Single-FP Low and Duplicate. +// +// Forms: +// +// VMOVSLDUP xmm xmm +// VMOVSLDUP m128 xmm +// VMOVSLDUP ymm ymm +// VMOVSLDUP m256 ymm +// Construct and append a VMOVSLDUP instruction to the active function. +// Operates on the global context. +func VMOVSLDUP(mxy, xy operand.Op) { ctx.VMOVSLDUP(mxy, xy) } + +// VMOVSS: Move Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VMOVSS m32 xmm +// VMOVSS xmm m32 +// VMOVSS xmm xmm xmm +// Construct and append a VMOVSS instruction to the active function. +func (c *Context) VMOVSS(ops ...operand.Op) { + if inst, err := x86.VMOVSS(ops...); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVSS: Move Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VMOVSS m32 xmm +// VMOVSS xmm m32 +// VMOVSS xmm xmm xmm +// Construct and append a VMOVSS instruction to the active function. +// Operates on the global context. +func VMOVSS(ops ...operand.Op) { ctx.VMOVSS(ops...) } + +// VMOVUPD: Move Unaligned Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMOVUPD xmm xmm +// VMOVUPD m128 xmm +// VMOVUPD ymm ymm +// VMOVUPD m256 ymm +// VMOVUPD xmm m128 +// VMOVUPD ymm m256 +// Construct and append a VMOVUPD instruction to the active function. +func (c *Context) VMOVUPD(mxy, mxy1 operand.Op) { + if inst, err := x86.VMOVUPD(mxy, mxy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVUPD: Move Unaligned Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMOVUPD xmm xmm +// VMOVUPD m128 xmm +// VMOVUPD ymm ymm +// VMOVUPD m256 ymm +// VMOVUPD xmm m128 +// VMOVUPD ymm m256 +// Construct and append a VMOVUPD instruction to the active function. +// Operates on the global context. +func VMOVUPD(mxy, mxy1 operand.Op) { ctx.VMOVUPD(mxy, mxy1) } + +// VMOVUPS: Move Unaligned Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMOVUPS xmm xmm +// VMOVUPS m128 xmm +// VMOVUPS ymm ymm +// VMOVUPS m256 ymm +// VMOVUPS xmm m128 +// VMOVUPS ymm m256 +// Construct and append a VMOVUPS instruction to the active function. +func (c *Context) VMOVUPS(mxy, mxy1 operand.Op) { + if inst, err := x86.VMOVUPS(mxy, mxy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMOVUPS: Move Unaligned Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMOVUPS xmm xmm +// VMOVUPS m128 xmm +// VMOVUPS ymm ymm +// VMOVUPS m256 ymm +// VMOVUPS xmm m128 +// VMOVUPS ymm m256 +// Construct and append a VMOVUPS instruction to the active function. +// Operates on the global context. +func VMOVUPS(mxy, mxy1 operand.Op) { ctx.VMOVUPS(mxy, mxy1) } + +// VMPSADBW: Compute Multiple Packed Sums of Absolute Difference. +// +// Forms: +// +// VMPSADBW imm8 xmm xmm xmm +// VMPSADBW imm8 m128 xmm xmm +// VMPSADBW imm8 ymm ymm ymm +// VMPSADBW imm8 m256 ymm ymm +// Construct and append a VMPSADBW instruction to the active function. +func (c *Context) VMPSADBW(i, mxy, xy, xy1 operand.Op) { + if inst, err := x86.VMPSADBW(i, mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMPSADBW: Compute Multiple Packed Sums of Absolute Difference. +// +// Forms: +// +// VMPSADBW imm8 xmm xmm xmm +// VMPSADBW imm8 m128 xmm xmm +// VMPSADBW imm8 ymm ymm ymm +// VMPSADBW imm8 m256 ymm ymm +// Construct and append a VMPSADBW instruction to the active function. +// Operates on the global context. +func VMPSADBW(i, mxy, xy, xy1 operand.Op) { ctx.VMPSADBW(i, mxy, xy, xy1) } + +// VMULPD: Multiply Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMULPD xmm xmm xmm +// VMULPD m128 xmm xmm +// VMULPD ymm ymm ymm +// VMULPD m256 ymm ymm +// Construct and append a VMULPD instruction to the active function. +func (c *Context) VMULPD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VMULPD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMULPD: Multiply Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMULPD xmm xmm xmm +// VMULPD m128 xmm xmm +// VMULPD ymm ymm ymm +// VMULPD m256 ymm ymm +// Construct and append a VMULPD instruction to the active function. +// Operates on the global context. +func VMULPD(mxy, xy, xy1 operand.Op) { ctx.VMULPD(mxy, xy, xy1) } + +// VMULPS: Multiply Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMULPS xmm xmm xmm +// VMULPS m128 xmm xmm +// VMULPS ymm ymm ymm +// VMULPS m256 ymm ymm +// Construct and append a VMULPS instruction to the active function. +func (c *Context) VMULPS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VMULPS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMULPS: Multiply Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMULPS xmm xmm xmm +// VMULPS m128 xmm xmm +// VMULPS ymm ymm ymm +// VMULPS m256 ymm ymm +// Construct and append a VMULPS instruction to the active function. +// Operates on the global context. +func VMULPS(mxy, xy, xy1 operand.Op) { ctx.VMULPS(mxy, xy, xy1) } + +// VMULSD: Multiply Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VMULSD xmm xmm xmm +// VMULSD m64 xmm xmm +// Construct and append a VMULSD instruction to the active function. +func (c *Context) VMULSD(mx, x, x1 operand.Op) { + if inst, err := x86.VMULSD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMULSD: Multiply Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VMULSD xmm xmm xmm +// VMULSD m64 xmm xmm +// Construct and append a VMULSD instruction to the active function. +// Operates on the global context. +func VMULSD(mx, x, x1 operand.Op) { ctx.VMULSD(mx, x, x1) } + +// VMULSS: Multiply Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VMULSS xmm xmm xmm +// VMULSS m32 xmm xmm +// Construct and append a VMULSS instruction to the active function. +func (c *Context) VMULSS(mx, x, x1 operand.Op) { + if inst, err := x86.VMULSS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VMULSS: Multiply Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VMULSS xmm xmm xmm +// VMULSS m32 xmm xmm +// Construct and append a VMULSS instruction to the active function. +// Operates on the global context. +func VMULSS(mx, x, x1 operand.Op) { ctx.VMULSS(mx, x, x1) } + +// VORPD: Bitwise Logical OR of Double-Precision Floating-Point Values. +// +// Forms: +// +// VORPD xmm xmm xmm +// VORPD m128 xmm xmm +// VORPD ymm ymm ymm +// VORPD m256 ymm ymm +// Construct and append a VORPD instruction to the active function. +func (c *Context) VORPD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VORPD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VORPD: Bitwise Logical OR of Double-Precision Floating-Point Values. +// +// Forms: +// +// VORPD xmm xmm xmm +// VORPD m128 xmm xmm +// VORPD ymm ymm ymm +// VORPD m256 ymm ymm +// Construct and append a VORPD instruction to the active function. +// Operates on the global context. +func VORPD(mxy, xy, xy1 operand.Op) { ctx.VORPD(mxy, xy, xy1) } + +// VORPS: Bitwise Logical OR of Single-Precision Floating-Point Values. +// +// Forms: +// +// VORPS xmm xmm xmm +// VORPS m128 xmm xmm +// VORPS ymm ymm ymm +// VORPS m256 ymm ymm +// Construct and append a VORPS instruction to the active function. +func (c *Context) VORPS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VORPS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VORPS: Bitwise Logical OR of Single-Precision Floating-Point Values. +// +// Forms: +// +// VORPS xmm xmm xmm +// VORPS m128 xmm xmm +// VORPS ymm ymm ymm +// VORPS m256 ymm ymm +// Construct and append a VORPS instruction to the active function. +// Operates on the global context. +func VORPS(mxy, xy, xy1 operand.Op) { ctx.VORPS(mxy, xy, xy1) } + +// VPABSB: Packed Absolute Value of Byte Integers. +// +// Forms: +// +// VPABSB xmm xmm +// VPABSB m128 xmm +// VPABSB ymm ymm +// VPABSB m256 ymm +// Construct and append a VPABSB instruction to the active function. +func (c *Context) VPABSB(mxy, xy operand.Op) { + if inst, err := x86.VPABSB(mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPABSB: Packed Absolute Value of Byte Integers. +// +// Forms: +// +// VPABSB xmm xmm +// VPABSB m128 xmm +// VPABSB ymm ymm +// VPABSB m256 ymm +// Construct and append a VPABSB instruction to the active function. +// Operates on the global context. +func VPABSB(mxy, xy operand.Op) { ctx.VPABSB(mxy, xy) } + +// VPABSD: Packed Absolute Value of Doubleword Integers. +// +// Forms: +// +// VPABSD xmm xmm +// VPABSD m128 xmm +// VPABSD ymm ymm +// VPABSD m256 ymm +// Construct and append a VPABSD instruction to the active function. +func (c *Context) VPABSD(mxy, xy operand.Op) { + if inst, err := x86.VPABSD(mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPABSD: Packed Absolute Value of Doubleword Integers. +// +// Forms: +// +// VPABSD xmm xmm +// VPABSD m128 xmm +// VPABSD ymm ymm +// VPABSD m256 ymm +// Construct and append a VPABSD instruction to the active function. +// Operates on the global context. +func VPABSD(mxy, xy operand.Op) { ctx.VPABSD(mxy, xy) } + +// VPABSW: Packed Absolute Value of Word Integers. +// +// Forms: +// +// VPABSW xmm xmm +// VPABSW m128 xmm +// VPABSW ymm ymm +// VPABSW m256 ymm +// Construct and append a VPABSW instruction to the active function. +func (c *Context) VPABSW(mxy, xy operand.Op) { + if inst, err := x86.VPABSW(mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPABSW: Packed Absolute Value of Word Integers. +// +// Forms: +// +// VPABSW xmm xmm +// VPABSW m128 xmm +// VPABSW ymm ymm +// VPABSW m256 ymm +// Construct and append a VPABSW instruction to the active function. +// Operates on the global context. +func VPABSW(mxy, xy operand.Op) { ctx.VPABSW(mxy, xy) } + +// VPACKSSDW: Pack Doublewords into Words with Signed Saturation. +// +// Forms: +// +// VPACKSSDW xmm xmm xmm +// VPACKSSDW m128 xmm xmm +// VPACKSSDW ymm ymm ymm +// VPACKSSDW m256 ymm ymm +// Construct and append a VPACKSSDW instruction to the active function. +func (c *Context) VPACKSSDW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPACKSSDW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPACKSSDW: Pack Doublewords into Words with Signed Saturation. +// +// Forms: +// +// VPACKSSDW xmm xmm xmm +// VPACKSSDW m128 xmm xmm +// VPACKSSDW ymm ymm ymm +// VPACKSSDW m256 ymm ymm +// Construct and append a VPACKSSDW instruction to the active function. +// Operates on the global context. +func VPACKSSDW(mxy, xy, xy1 operand.Op) { ctx.VPACKSSDW(mxy, xy, xy1) } + +// VPACKSSWB: Pack Words into Bytes with Signed Saturation. +// +// Forms: +// +// VPACKSSWB xmm xmm xmm +// VPACKSSWB m128 xmm xmm +// VPACKSSWB ymm ymm ymm +// VPACKSSWB m256 ymm ymm +// Construct and append a VPACKSSWB instruction to the active function. +func (c *Context) VPACKSSWB(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPACKSSWB(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPACKSSWB: Pack Words into Bytes with Signed Saturation. +// +// Forms: +// +// VPACKSSWB xmm xmm xmm +// VPACKSSWB m128 xmm xmm +// VPACKSSWB ymm ymm ymm +// VPACKSSWB m256 ymm ymm +// Construct and append a VPACKSSWB instruction to the active function. +// Operates on the global context. +func VPACKSSWB(mxy, xy, xy1 operand.Op) { ctx.VPACKSSWB(mxy, xy, xy1) } + +// VPACKUSDW: Pack Doublewords into Words with Unsigned Saturation. +// +// Forms: +// +// VPACKUSDW xmm xmm xmm +// VPACKUSDW m128 xmm xmm +// VPACKUSDW ymm ymm ymm +// VPACKUSDW m256 ymm ymm +// Construct and append a VPACKUSDW instruction to the active function. +func (c *Context) VPACKUSDW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPACKUSDW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPACKUSDW: Pack Doublewords into Words with Unsigned Saturation. +// +// Forms: +// +// VPACKUSDW xmm xmm xmm +// VPACKUSDW m128 xmm xmm +// VPACKUSDW ymm ymm ymm +// VPACKUSDW m256 ymm ymm +// Construct and append a VPACKUSDW instruction to the active function. +// Operates on the global context. +func VPACKUSDW(mxy, xy, xy1 operand.Op) { ctx.VPACKUSDW(mxy, xy, xy1) } + +// VPACKUSWB: Pack Words into Bytes with Unsigned Saturation. +// +// Forms: +// +// VPACKUSWB xmm xmm xmm +// VPACKUSWB m128 xmm xmm +// VPACKUSWB ymm ymm ymm +// VPACKUSWB m256 ymm ymm +// Construct and append a VPACKUSWB instruction to the active function. +func (c *Context) VPACKUSWB(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPACKUSWB(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPACKUSWB: Pack Words into Bytes with Unsigned Saturation. +// +// Forms: +// +// VPACKUSWB xmm xmm xmm +// VPACKUSWB m128 xmm xmm +// VPACKUSWB ymm ymm ymm +// VPACKUSWB m256 ymm ymm +// Construct and append a VPACKUSWB instruction to the active function. +// Operates on the global context. +func VPACKUSWB(mxy, xy, xy1 operand.Op) { ctx.VPACKUSWB(mxy, xy, xy1) } + +// VPADDB: Add Packed Byte Integers. +// +// Forms: +// +// VPADDB xmm xmm xmm +// VPADDB m128 xmm xmm +// VPADDB ymm ymm ymm +// VPADDB m256 ymm ymm +// Construct and append a VPADDB instruction to the active function. +func (c *Context) VPADDB(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPADDB(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPADDB: Add Packed Byte Integers. +// +// Forms: +// +// VPADDB xmm xmm xmm +// VPADDB m128 xmm xmm +// VPADDB ymm ymm ymm +// VPADDB m256 ymm ymm +// Construct and append a VPADDB instruction to the active function. +// Operates on the global context. +func VPADDB(mxy, xy, xy1 operand.Op) { ctx.VPADDB(mxy, xy, xy1) } + +// VPADDD: Add Packed Doubleword Integers. +// +// Forms: +// +// VPADDD xmm xmm xmm +// VPADDD m128 xmm xmm +// VPADDD ymm ymm ymm +// VPADDD m256 ymm ymm +// Construct and append a VPADDD instruction to the active function. +func (c *Context) VPADDD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPADDD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPADDD: Add Packed Doubleword Integers. +// +// Forms: +// +// VPADDD xmm xmm xmm +// VPADDD m128 xmm xmm +// VPADDD ymm ymm ymm +// VPADDD m256 ymm ymm +// Construct and append a VPADDD instruction to the active function. +// Operates on the global context. +func VPADDD(mxy, xy, xy1 operand.Op) { ctx.VPADDD(mxy, xy, xy1) } + +// VPADDQ: Add Packed Quadword Integers. +// +// Forms: +// +// VPADDQ xmm xmm xmm +// VPADDQ m128 xmm xmm +// VPADDQ ymm ymm ymm +// VPADDQ m256 ymm ymm +// Construct and append a VPADDQ instruction to the active function. +func (c *Context) VPADDQ(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPADDQ(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPADDQ: Add Packed Quadword Integers. +// +// Forms: +// +// VPADDQ xmm xmm xmm +// VPADDQ m128 xmm xmm +// VPADDQ ymm ymm ymm +// VPADDQ m256 ymm ymm +// Construct and append a VPADDQ instruction to the active function. +// Operates on the global context. +func VPADDQ(mxy, xy, xy1 operand.Op) { ctx.VPADDQ(mxy, xy, xy1) } + +// VPADDSB: Add Packed Signed Byte Integers with Signed Saturation. +// +// Forms: +// +// VPADDSB xmm xmm xmm +// VPADDSB m128 xmm xmm +// VPADDSB ymm ymm ymm +// VPADDSB m256 ymm ymm +// Construct and append a VPADDSB instruction to the active function. +func (c *Context) VPADDSB(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPADDSB(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPADDSB: Add Packed Signed Byte Integers with Signed Saturation. +// +// Forms: +// +// VPADDSB xmm xmm xmm +// VPADDSB m128 xmm xmm +// VPADDSB ymm ymm ymm +// VPADDSB m256 ymm ymm +// Construct and append a VPADDSB instruction to the active function. +// Operates on the global context. +func VPADDSB(mxy, xy, xy1 operand.Op) { ctx.VPADDSB(mxy, xy, xy1) } + +// VPADDSW: Add Packed Signed Word Integers with Signed Saturation. +// +// Forms: +// +// VPADDSW xmm xmm xmm +// VPADDSW m128 xmm xmm +// VPADDSW ymm ymm ymm +// VPADDSW m256 ymm ymm +// Construct and append a VPADDSW instruction to the active function. +func (c *Context) VPADDSW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPADDSW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPADDSW: Add Packed Signed Word Integers with Signed Saturation. +// +// Forms: +// +// VPADDSW xmm xmm xmm +// VPADDSW m128 xmm xmm +// VPADDSW ymm ymm ymm +// VPADDSW m256 ymm ymm +// Construct and append a VPADDSW instruction to the active function. +// Operates on the global context. +func VPADDSW(mxy, xy, xy1 operand.Op) { ctx.VPADDSW(mxy, xy, xy1) } + +// VPADDUSB: Add Packed Unsigned Byte Integers with Unsigned Saturation. +// +// Forms: +// +// VPADDUSB xmm xmm xmm +// VPADDUSB m128 xmm xmm +// VPADDUSB ymm ymm ymm +// VPADDUSB m256 ymm ymm +// Construct and append a VPADDUSB instruction to the active function. +func (c *Context) VPADDUSB(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPADDUSB(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPADDUSB: Add Packed Unsigned Byte Integers with Unsigned Saturation. +// +// Forms: +// +// VPADDUSB xmm xmm xmm +// VPADDUSB m128 xmm xmm +// VPADDUSB ymm ymm ymm +// VPADDUSB m256 ymm ymm +// Construct and append a VPADDUSB instruction to the active function. +// Operates on the global context. +func VPADDUSB(mxy, xy, xy1 operand.Op) { ctx.VPADDUSB(mxy, xy, xy1) } + +// VPADDUSW: Add Packed Unsigned Word Integers with Unsigned Saturation. +// +// Forms: +// +// VPADDUSW xmm xmm xmm +// VPADDUSW m128 xmm xmm +// VPADDUSW ymm ymm ymm +// VPADDUSW m256 ymm ymm +// Construct and append a VPADDUSW instruction to the active function. +func (c *Context) VPADDUSW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPADDUSW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPADDUSW: Add Packed Unsigned Word Integers with Unsigned Saturation. +// +// Forms: +// +// VPADDUSW xmm xmm xmm +// VPADDUSW m128 xmm xmm +// VPADDUSW ymm ymm ymm +// VPADDUSW m256 ymm ymm +// Construct and append a VPADDUSW instruction to the active function. +// Operates on the global context. +func VPADDUSW(mxy, xy, xy1 operand.Op) { ctx.VPADDUSW(mxy, xy, xy1) } + +// VPADDW: Add Packed Word Integers. +// +// Forms: +// +// VPADDW xmm xmm xmm +// VPADDW m128 xmm xmm +// VPADDW ymm ymm ymm +// VPADDW m256 ymm ymm +// Construct and append a VPADDW instruction to the active function. +func (c *Context) VPADDW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPADDW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPADDW: Add Packed Word Integers. +// +// Forms: +// +// VPADDW xmm xmm xmm +// VPADDW m128 xmm xmm +// VPADDW ymm ymm ymm +// VPADDW m256 ymm ymm +// Construct and append a VPADDW instruction to the active function. +// Operates on the global context. +func VPADDW(mxy, xy, xy1 operand.Op) { ctx.VPADDW(mxy, xy, xy1) } + +// VPALIGNR: Packed Align Right. +// +// Forms: +// +// VPALIGNR imm8 xmm xmm xmm +// VPALIGNR imm8 m128 xmm xmm +// VPALIGNR imm8 ymm ymm ymm +// VPALIGNR imm8 m256 ymm ymm +// Construct and append a VPALIGNR instruction to the active function. +func (c *Context) VPALIGNR(i, mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPALIGNR(i, mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPALIGNR: Packed Align Right. +// +// Forms: +// +// VPALIGNR imm8 xmm xmm xmm +// VPALIGNR imm8 m128 xmm xmm +// VPALIGNR imm8 ymm ymm ymm +// VPALIGNR imm8 m256 ymm ymm +// Construct and append a VPALIGNR instruction to the active function. +// Operates on the global context. +func VPALIGNR(i, mxy, xy, xy1 operand.Op) { ctx.VPALIGNR(i, mxy, xy, xy1) } + +// VPAND: Packed Bitwise Logical AND. +// +// Forms: +// +// VPAND xmm xmm xmm +// VPAND m128 xmm xmm +// VPAND ymm ymm ymm +// VPAND m256 ymm ymm +// Construct and append a VPAND instruction to the active function. +func (c *Context) VPAND(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPAND(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPAND: Packed Bitwise Logical AND. +// +// Forms: +// +// VPAND xmm xmm xmm +// VPAND m128 xmm xmm +// VPAND ymm ymm ymm +// VPAND m256 ymm ymm +// Construct and append a VPAND instruction to the active function. +// Operates on the global context. +func VPAND(mxy, xy, xy1 operand.Op) { ctx.VPAND(mxy, xy, xy1) } + +// VPANDN: Packed Bitwise Logical AND NOT. +// +// Forms: +// +// VPANDN xmm xmm xmm +// VPANDN m128 xmm xmm +// VPANDN ymm ymm ymm +// VPANDN m256 ymm ymm +// Construct and append a VPANDN instruction to the active function. +func (c *Context) VPANDN(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPANDN(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPANDN: Packed Bitwise Logical AND NOT. +// +// Forms: +// +// VPANDN xmm xmm xmm +// VPANDN m128 xmm xmm +// VPANDN ymm ymm ymm +// VPANDN m256 ymm ymm +// Construct and append a VPANDN instruction to the active function. +// Operates on the global context. +func VPANDN(mxy, xy, xy1 operand.Op) { ctx.VPANDN(mxy, xy, xy1) } + +// VPAVGB: Average Packed Byte Integers. +// +// Forms: +// +// VPAVGB xmm xmm xmm +// VPAVGB m128 xmm xmm +// VPAVGB ymm ymm ymm +// VPAVGB m256 ymm ymm +// Construct and append a VPAVGB instruction to the active function. +func (c *Context) VPAVGB(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPAVGB(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPAVGB: Average Packed Byte Integers. +// +// Forms: +// +// VPAVGB xmm xmm xmm +// VPAVGB m128 xmm xmm +// VPAVGB ymm ymm ymm +// VPAVGB m256 ymm ymm +// Construct and append a VPAVGB instruction to the active function. +// Operates on the global context. +func VPAVGB(mxy, xy, xy1 operand.Op) { ctx.VPAVGB(mxy, xy, xy1) } + +// VPAVGW: Average Packed Word Integers. +// +// Forms: +// +// VPAVGW xmm xmm xmm +// VPAVGW m128 xmm xmm +// VPAVGW ymm ymm ymm +// VPAVGW m256 ymm ymm +// Construct and append a VPAVGW instruction to the active function. +func (c *Context) VPAVGW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPAVGW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPAVGW: Average Packed Word Integers. +// +// Forms: +// +// VPAVGW xmm xmm xmm +// VPAVGW m128 xmm xmm +// VPAVGW ymm ymm ymm +// VPAVGW m256 ymm ymm +// Construct and append a VPAVGW instruction to the active function. +// Operates on the global context. +func VPAVGW(mxy, xy, xy1 operand.Op) { ctx.VPAVGW(mxy, xy, xy1) } + +// VPBLENDD: Blend Packed Doublewords. +// +// Forms: +// +// VPBLENDD imm8 xmm xmm xmm +// VPBLENDD imm8 m128 xmm xmm +// VPBLENDD imm8 ymm ymm ymm +// VPBLENDD imm8 m256 ymm ymm +// Construct and append a VPBLENDD instruction to the active function. +func (c *Context) VPBLENDD(i, mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPBLENDD(i, mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPBLENDD: Blend Packed Doublewords. +// +// Forms: +// +// VPBLENDD imm8 xmm xmm xmm +// VPBLENDD imm8 m128 xmm xmm +// VPBLENDD imm8 ymm ymm ymm +// VPBLENDD imm8 m256 ymm ymm +// Construct and append a VPBLENDD instruction to the active function. +// Operates on the global context. +func VPBLENDD(i, mxy, xy, xy1 operand.Op) { ctx.VPBLENDD(i, mxy, xy, xy1) } + +// VPBLENDVB: Variable Blend Packed Bytes. +// +// Forms: +// +// VPBLENDVB xmm xmm xmm xmm +// VPBLENDVB xmm m128 xmm xmm +// VPBLENDVB ymm ymm ymm ymm +// VPBLENDVB ymm m256 ymm ymm +// Construct and append a VPBLENDVB instruction to the active function. +func (c *Context) VPBLENDVB(xy, mxy, xy1, xy2 operand.Op) { + if inst, err := x86.VPBLENDVB(xy, mxy, xy1, xy2); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPBLENDVB: Variable Blend Packed Bytes. +// +// Forms: +// +// VPBLENDVB xmm xmm xmm xmm +// VPBLENDVB xmm m128 xmm xmm +// VPBLENDVB ymm ymm ymm ymm +// VPBLENDVB ymm m256 ymm ymm +// Construct and append a VPBLENDVB instruction to the active function. +// Operates on the global context. +func VPBLENDVB(xy, mxy, xy1, xy2 operand.Op) { ctx.VPBLENDVB(xy, mxy, xy1, xy2) } + +// VPBLENDW: Blend Packed Words. +// +// Forms: +// +// VPBLENDW imm8 xmm xmm xmm +// VPBLENDW imm8 m128 xmm xmm +// VPBLENDW imm8 ymm ymm ymm +// VPBLENDW imm8 m256 ymm ymm +// Construct and append a VPBLENDW instruction to the active function. +func (c *Context) VPBLENDW(i, mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPBLENDW(i, mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPBLENDW: Blend Packed Words. +// +// Forms: +// +// VPBLENDW imm8 xmm xmm xmm +// VPBLENDW imm8 m128 xmm xmm +// VPBLENDW imm8 ymm ymm ymm +// VPBLENDW imm8 m256 ymm ymm +// Construct and append a VPBLENDW instruction to the active function. +// Operates on the global context. +func VPBLENDW(i, mxy, xy, xy1 operand.Op) { ctx.VPBLENDW(i, mxy, xy, xy1) } + +// VPBROADCASTB: Broadcast Byte Integer. +// +// Forms: +// +// VPBROADCASTB xmm xmm +// VPBROADCASTB m8 xmm +// VPBROADCASTB xmm ymm +// VPBROADCASTB m8 ymm +// Construct and append a VPBROADCASTB instruction to the active function. +func (c *Context) VPBROADCASTB(mx, xy operand.Op) { + if inst, err := x86.VPBROADCASTB(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPBROADCASTB: Broadcast Byte Integer. +// +// Forms: +// +// VPBROADCASTB xmm xmm +// VPBROADCASTB m8 xmm +// VPBROADCASTB xmm ymm +// VPBROADCASTB m8 ymm +// Construct and append a VPBROADCASTB instruction to the active function. +// Operates on the global context. +func VPBROADCASTB(mx, xy operand.Op) { ctx.VPBROADCASTB(mx, xy) } + +// VPBROADCASTD: Broadcast Doubleword Integer. +// +// Forms: +// +// VPBROADCASTD xmm xmm +// VPBROADCASTD m32 xmm +// VPBROADCASTD xmm ymm +// VPBROADCASTD m32 ymm +// Construct and append a VPBROADCASTD instruction to the active function. +func (c *Context) VPBROADCASTD(mx, xy operand.Op) { + if inst, err := x86.VPBROADCASTD(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPBROADCASTD: Broadcast Doubleword Integer. +// +// Forms: +// +// VPBROADCASTD xmm xmm +// VPBROADCASTD m32 xmm +// VPBROADCASTD xmm ymm +// VPBROADCASTD m32 ymm +// Construct and append a VPBROADCASTD instruction to the active function. +// Operates on the global context. +func VPBROADCASTD(mx, xy operand.Op) { ctx.VPBROADCASTD(mx, xy) } + +// VPBROADCASTQ: Broadcast Quadword Integer. +// +// Forms: +// +// VPBROADCASTQ xmm xmm +// VPBROADCASTQ m64 xmm +// VPBROADCASTQ xmm ymm +// VPBROADCASTQ m64 ymm +// Construct and append a VPBROADCASTQ instruction to the active function. +func (c *Context) VPBROADCASTQ(mx, xy operand.Op) { + if inst, err := x86.VPBROADCASTQ(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPBROADCASTQ: Broadcast Quadword Integer. +// +// Forms: +// +// VPBROADCASTQ xmm xmm +// VPBROADCASTQ m64 xmm +// VPBROADCASTQ xmm ymm +// VPBROADCASTQ m64 ymm +// Construct and append a VPBROADCASTQ instruction to the active function. +// Operates on the global context. +func VPBROADCASTQ(mx, xy operand.Op) { ctx.VPBROADCASTQ(mx, xy) } + +// VPBROADCASTW: Broadcast Word Integer. +// +// Forms: +// +// VPBROADCASTW xmm xmm +// VPBROADCASTW m16 xmm +// VPBROADCASTW xmm ymm +// VPBROADCASTW m16 ymm +// Construct and append a VPBROADCASTW instruction to the active function. +func (c *Context) VPBROADCASTW(mx, xy operand.Op) { + if inst, err := x86.VPBROADCASTW(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPBROADCASTW: Broadcast Word Integer. +// +// Forms: +// +// VPBROADCASTW xmm xmm +// VPBROADCASTW m16 xmm +// VPBROADCASTW xmm ymm +// VPBROADCASTW m16 ymm +// Construct and append a VPBROADCASTW instruction to the active function. +// Operates on the global context. +func VPBROADCASTW(mx, xy operand.Op) { ctx.VPBROADCASTW(mx, xy) } + +// VPCLMULQDQ: Carry-Less Quadword Multiplication. +// +// Forms: +// +// VPCLMULQDQ imm8 xmm xmm xmm +// VPCLMULQDQ imm8 m128 xmm xmm +// Construct and append a VPCLMULQDQ instruction to the active function. +func (c *Context) VPCLMULQDQ(i, mx, x, x1 operand.Op) { + if inst, err := x86.VPCLMULQDQ(i, mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPCLMULQDQ: Carry-Less Quadword Multiplication. +// +// Forms: +// +// VPCLMULQDQ imm8 xmm xmm xmm +// VPCLMULQDQ imm8 m128 xmm xmm +// Construct and append a VPCLMULQDQ instruction to the active function. +// Operates on the global context. +func VPCLMULQDQ(i, mx, x, x1 operand.Op) { ctx.VPCLMULQDQ(i, mx, x, x1) } + +// VPCMPEQB: Compare Packed Byte Data for Equality. +// +// Forms: +// +// VPCMPEQB xmm xmm xmm +// VPCMPEQB m128 xmm xmm +// VPCMPEQB ymm ymm ymm +// VPCMPEQB m256 ymm ymm +// Construct and append a VPCMPEQB instruction to the active function. +func (c *Context) VPCMPEQB(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPCMPEQB(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPCMPEQB: Compare Packed Byte Data for Equality. +// +// Forms: +// +// VPCMPEQB xmm xmm xmm +// VPCMPEQB m128 xmm xmm +// VPCMPEQB ymm ymm ymm +// VPCMPEQB m256 ymm ymm +// Construct and append a VPCMPEQB instruction to the active function. +// Operates on the global context. +func VPCMPEQB(mxy, xy, xy1 operand.Op) { ctx.VPCMPEQB(mxy, xy, xy1) } + +// VPCMPEQD: Compare Packed Doubleword Data for Equality. +// +// Forms: +// +// VPCMPEQD xmm xmm xmm +// VPCMPEQD m128 xmm xmm +// VPCMPEQD ymm ymm ymm +// VPCMPEQD m256 ymm ymm +// Construct and append a VPCMPEQD instruction to the active function. +func (c *Context) VPCMPEQD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPCMPEQD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPCMPEQD: Compare Packed Doubleword Data for Equality. +// +// Forms: +// +// VPCMPEQD xmm xmm xmm +// VPCMPEQD m128 xmm xmm +// VPCMPEQD ymm ymm ymm +// VPCMPEQD m256 ymm ymm +// Construct and append a VPCMPEQD instruction to the active function. +// Operates on the global context. +func VPCMPEQD(mxy, xy, xy1 operand.Op) { ctx.VPCMPEQD(mxy, xy, xy1) } + +// VPCMPEQQ: Compare Packed Quadword Data for Equality. +// +// Forms: +// +// VPCMPEQQ xmm xmm xmm +// VPCMPEQQ m128 xmm xmm +// VPCMPEQQ ymm ymm ymm +// VPCMPEQQ m256 ymm ymm +// Construct and append a VPCMPEQQ instruction to the active function. +func (c *Context) VPCMPEQQ(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPCMPEQQ(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPCMPEQQ: Compare Packed Quadword Data for Equality. +// +// Forms: +// +// VPCMPEQQ xmm xmm xmm +// VPCMPEQQ m128 xmm xmm +// VPCMPEQQ ymm ymm ymm +// VPCMPEQQ m256 ymm ymm +// Construct and append a VPCMPEQQ instruction to the active function. +// Operates on the global context. +func VPCMPEQQ(mxy, xy, xy1 operand.Op) { ctx.VPCMPEQQ(mxy, xy, xy1) } + +// VPCMPEQW: Compare Packed Word Data for Equality. +// +// Forms: +// +// VPCMPEQW xmm xmm xmm +// VPCMPEQW m128 xmm xmm +// VPCMPEQW ymm ymm ymm +// VPCMPEQW m256 ymm ymm +// Construct and append a VPCMPEQW instruction to the active function. +func (c *Context) VPCMPEQW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPCMPEQW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPCMPEQW: Compare Packed Word Data for Equality. +// +// Forms: +// +// VPCMPEQW xmm xmm xmm +// VPCMPEQW m128 xmm xmm +// VPCMPEQW ymm ymm ymm +// VPCMPEQW m256 ymm ymm +// Construct and append a VPCMPEQW instruction to the active function. +// Operates on the global context. +func VPCMPEQW(mxy, xy, xy1 operand.Op) { ctx.VPCMPEQW(mxy, xy, xy1) } + +// VPCMPESTRI: Packed Compare Explicit Length Strings, Return Index. +// +// Forms: +// +// VPCMPESTRI imm8 xmm xmm +// VPCMPESTRI imm8 m128 xmm +// Construct and append a VPCMPESTRI instruction to the active function. +func (c *Context) VPCMPESTRI(i, mx, x operand.Op) { + if inst, err := x86.VPCMPESTRI(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPCMPESTRI: Packed Compare Explicit Length Strings, Return Index. +// +// Forms: +// +// VPCMPESTRI imm8 xmm xmm +// VPCMPESTRI imm8 m128 xmm +// Construct and append a VPCMPESTRI instruction to the active function. +// Operates on the global context. +func VPCMPESTRI(i, mx, x operand.Op) { ctx.VPCMPESTRI(i, mx, x) } + +// VPCMPESTRM: Packed Compare Explicit Length Strings, Return Mask. +// +// Forms: +// +// VPCMPESTRM imm8 xmm xmm +// VPCMPESTRM imm8 m128 xmm +// Construct and append a VPCMPESTRM instruction to the active function. +func (c *Context) VPCMPESTRM(i, mx, x operand.Op) { + if inst, err := x86.VPCMPESTRM(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPCMPESTRM: Packed Compare Explicit Length Strings, Return Mask. +// +// Forms: +// +// VPCMPESTRM imm8 xmm xmm +// VPCMPESTRM imm8 m128 xmm +// Construct and append a VPCMPESTRM instruction to the active function. +// Operates on the global context. +func VPCMPESTRM(i, mx, x operand.Op) { ctx.VPCMPESTRM(i, mx, x) } + +// VPCMPGTB: Compare Packed Signed Byte Integers for Greater Than. +// +// Forms: +// +// VPCMPGTB xmm xmm xmm +// VPCMPGTB m128 xmm xmm +// VPCMPGTB ymm ymm ymm +// VPCMPGTB m256 ymm ymm +// Construct and append a VPCMPGTB instruction to the active function. +func (c *Context) VPCMPGTB(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPCMPGTB(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPCMPGTB: Compare Packed Signed Byte Integers for Greater Than. +// +// Forms: +// +// VPCMPGTB xmm xmm xmm +// VPCMPGTB m128 xmm xmm +// VPCMPGTB ymm ymm ymm +// VPCMPGTB m256 ymm ymm +// Construct and append a VPCMPGTB instruction to the active function. +// Operates on the global context. +func VPCMPGTB(mxy, xy, xy1 operand.Op) { ctx.VPCMPGTB(mxy, xy, xy1) } + +// VPCMPGTD: Compare Packed Signed Doubleword Integers for Greater Than. +// +// Forms: +// +// VPCMPGTD xmm xmm xmm +// VPCMPGTD m128 xmm xmm +// VPCMPGTD ymm ymm ymm +// VPCMPGTD m256 ymm ymm +// Construct and append a VPCMPGTD instruction to the active function. +func (c *Context) VPCMPGTD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPCMPGTD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPCMPGTD: Compare Packed Signed Doubleword Integers for Greater Than. +// +// Forms: +// +// VPCMPGTD xmm xmm xmm +// VPCMPGTD m128 xmm xmm +// VPCMPGTD ymm ymm ymm +// VPCMPGTD m256 ymm ymm +// Construct and append a VPCMPGTD instruction to the active function. +// Operates on the global context. +func VPCMPGTD(mxy, xy, xy1 operand.Op) { ctx.VPCMPGTD(mxy, xy, xy1) } + +// VPCMPGTQ: Compare Packed Data for Greater Than. +// +// Forms: +// +// VPCMPGTQ xmm xmm xmm +// VPCMPGTQ m128 xmm xmm +// VPCMPGTQ ymm ymm ymm +// VPCMPGTQ m256 ymm ymm +// Construct and append a VPCMPGTQ instruction to the active function. +func (c *Context) VPCMPGTQ(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPCMPGTQ(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPCMPGTQ: Compare Packed Data for Greater Than. +// +// Forms: +// +// VPCMPGTQ xmm xmm xmm +// VPCMPGTQ m128 xmm xmm +// VPCMPGTQ ymm ymm ymm +// VPCMPGTQ m256 ymm ymm +// Construct and append a VPCMPGTQ instruction to the active function. +// Operates on the global context. +func VPCMPGTQ(mxy, xy, xy1 operand.Op) { ctx.VPCMPGTQ(mxy, xy, xy1) } + +// VPCMPGTW: Compare Packed Signed Word Integers for Greater Than. +// +// Forms: +// +// VPCMPGTW xmm xmm xmm +// VPCMPGTW m128 xmm xmm +// VPCMPGTW ymm ymm ymm +// VPCMPGTW m256 ymm ymm +// Construct and append a VPCMPGTW instruction to the active function. +func (c *Context) VPCMPGTW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPCMPGTW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPCMPGTW: Compare Packed Signed Word Integers for Greater Than. +// +// Forms: +// +// VPCMPGTW xmm xmm xmm +// VPCMPGTW m128 xmm xmm +// VPCMPGTW ymm ymm ymm +// VPCMPGTW m256 ymm ymm +// Construct and append a VPCMPGTW instruction to the active function. +// Operates on the global context. +func VPCMPGTW(mxy, xy, xy1 operand.Op) { ctx.VPCMPGTW(mxy, xy, xy1) } + +// VPCMPISTRI: Packed Compare Implicit Length Strings, Return Index. +// +// Forms: +// +// VPCMPISTRI imm8 xmm xmm +// VPCMPISTRI imm8 m128 xmm +// Construct and append a VPCMPISTRI instruction to the active function. +func (c *Context) VPCMPISTRI(i, mx, x operand.Op) { + if inst, err := x86.VPCMPISTRI(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPCMPISTRI: Packed Compare Implicit Length Strings, Return Index. +// +// Forms: +// +// VPCMPISTRI imm8 xmm xmm +// VPCMPISTRI imm8 m128 xmm +// Construct and append a VPCMPISTRI instruction to the active function. +// Operates on the global context. +func VPCMPISTRI(i, mx, x operand.Op) { ctx.VPCMPISTRI(i, mx, x) } + +// VPCMPISTRM: Packed Compare Implicit Length Strings, Return Mask. +// +// Forms: +// +// VPCMPISTRM imm8 xmm xmm +// VPCMPISTRM imm8 m128 xmm +// Construct and append a VPCMPISTRM instruction to the active function. +func (c *Context) VPCMPISTRM(i, mx, x operand.Op) { + if inst, err := x86.VPCMPISTRM(i, mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPCMPISTRM: Packed Compare Implicit Length Strings, Return Mask. +// +// Forms: +// +// VPCMPISTRM imm8 xmm xmm +// VPCMPISTRM imm8 m128 xmm +// Construct and append a VPCMPISTRM instruction to the active function. +// Operates on the global context. +func VPCMPISTRM(i, mx, x operand.Op) { ctx.VPCMPISTRM(i, mx, x) } + +// VPERM2F128: Permute Floating-Point Values. +// +// Forms: +// +// VPERM2F128 imm8 ymm ymm ymm +// VPERM2F128 imm8 m256 ymm ymm +// Construct and append a VPERM2F128 instruction to the active function. +func (c *Context) VPERM2F128(i, my, y, y1 operand.Op) { + if inst, err := x86.VPERM2F128(i, my, y, y1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPERM2F128: Permute Floating-Point Values. +// +// Forms: +// +// VPERM2F128 imm8 ymm ymm ymm +// VPERM2F128 imm8 m256 ymm ymm +// Construct and append a VPERM2F128 instruction to the active function. +// Operates on the global context. +func VPERM2F128(i, my, y, y1 operand.Op) { ctx.VPERM2F128(i, my, y, y1) } + +// VPERM2I128: Permute 128-Bit Integer Values. +// +// Forms: +// +// VPERM2I128 imm8 ymm ymm ymm +// VPERM2I128 imm8 m256 ymm ymm +// Construct and append a VPERM2I128 instruction to the active function. +func (c *Context) VPERM2I128(i, my, y, y1 operand.Op) { + if inst, err := x86.VPERM2I128(i, my, y, y1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPERM2I128: Permute 128-Bit Integer Values. +// +// Forms: +// +// VPERM2I128 imm8 ymm ymm ymm +// VPERM2I128 imm8 m256 ymm ymm +// Construct and append a VPERM2I128 instruction to the active function. +// Operates on the global context. +func VPERM2I128(i, my, y, y1 operand.Op) { ctx.VPERM2I128(i, my, y, y1) } + +// VPERMD: Permute Doubleword Integers. +// +// Forms: +// +// VPERMD ymm ymm ymm +// VPERMD m256 ymm ymm +// Construct and append a VPERMD instruction to the active function. +func (c *Context) VPERMD(my, y, y1 operand.Op) { + if inst, err := x86.VPERMD(my, y, y1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPERMD: Permute Doubleword Integers. +// +// Forms: +// +// VPERMD ymm ymm ymm +// VPERMD m256 ymm ymm +// Construct and append a VPERMD instruction to the active function. +// Operates on the global context. +func VPERMD(my, y, y1 operand.Op) { ctx.VPERMD(my, y, y1) } + +// VPERMILPD: Permute Double-Precision Floating-Point Values. +// +// Forms: +// +// VPERMILPD imm8 xmm xmm +// VPERMILPD xmm xmm xmm +// VPERMILPD m128 xmm xmm +// VPERMILPD imm8 m128 xmm +// VPERMILPD imm8 ymm ymm +// VPERMILPD ymm ymm ymm +// VPERMILPD m256 ymm ymm +// VPERMILPD imm8 m256 ymm +// Construct and append a VPERMILPD instruction to the active function. +func (c *Context) VPERMILPD(imxy, mxy, xy operand.Op) { + if inst, err := x86.VPERMILPD(imxy, mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPERMILPD: Permute Double-Precision Floating-Point Values. +// +// Forms: +// +// VPERMILPD imm8 xmm xmm +// VPERMILPD xmm xmm xmm +// VPERMILPD m128 xmm xmm +// VPERMILPD imm8 m128 xmm +// VPERMILPD imm8 ymm ymm +// VPERMILPD ymm ymm ymm +// VPERMILPD m256 ymm ymm +// VPERMILPD imm8 m256 ymm +// Construct and append a VPERMILPD instruction to the active function. +// Operates on the global context. +func VPERMILPD(imxy, mxy, xy operand.Op) { ctx.VPERMILPD(imxy, mxy, xy) } + +// VPERMILPS: Permute Single-Precision Floating-Point Values. +// +// Forms: +// +// VPERMILPS imm8 xmm xmm +// VPERMILPS xmm xmm xmm +// VPERMILPS m128 xmm xmm +// VPERMILPS imm8 m128 xmm +// VPERMILPS imm8 ymm ymm +// VPERMILPS ymm ymm ymm +// VPERMILPS m256 ymm ymm +// VPERMILPS imm8 m256 ymm +// Construct and append a VPERMILPS instruction to the active function. +func (c *Context) VPERMILPS(imxy, mxy, xy operand.Op) { + if inst, err := x86.VPERMILPS(imxy, mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPERMILPS: Permute Single-Precision Floating-Point Values. +// +// Forms: +// +// VPERMILPS imm8 xmm xmm +// VPERMILPS xmm xmm xmm +// VPERMILPS m128 xmm xmm +// VPERMILPS imm8 m128 xmm +// VPERMILPS imm8 ymm ymm +// VPERMILPS ymm ymm ymm +// VPERMILPS m256 ymm ymm +// VPERMILPS imm8 m256 ymm +// Construct and append a VPERMILPS instruction to the active function. +// Operates on the global context. +func VPERMILPS(imxy, mxy, xy operand.Op) { ctx.VPERMILPS(imxy, mxy, xy) } + +// VPERMPD: Permute Double-Precision Floating-Point Elements. +// +// Forms: +// +// VPERMPD imm8 ymm ymm +// VPERMPD imm8 m256 ymm +// Construct and append a VPERMPD instruction to the active function. +func (c *Context) VPERMPD(i, my, y operand.Op) { + if inst, err := x86.VPERMPD(i, my, y); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPERMPD: Permute Double-Precision Floating-Point Elements. +// +// Forms: +// +// VPERMPD imm8 ymm ymm +// VPERMPD imm8 m256 ymm +// Construct and append a VPERMPD instruction to the active function. +// Operates on the global context. +func VPERMPD(i, my, y operand.Op) { ctx.VPERMPD(i, my, y) } + +// VPERMPS: Permute Single-Precision Floating-Point Elements. +// +// Forms: +// +// VPERMPS ymm ymm ymm +// VPERMPS m256 ymm ymm +// Construct and append a VPERMPS instruction to the active function. +func (c *Context) VPERMPS(my, y, y1 operand.Op) { + if inst, err := x86.VPERMPS(my, y, y1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPERMPS: Permute Single-Precision Floating-Point Elements. +// +// Forms: +// +// VPERMPS ymm ymm ymm +// VPERMPS m256 ymm ymm +// Construct and append a VPERMPS instruction to the active function. +// Operates on the global context. +func VPERMPS(my, y, y1 operand.Op) { ctx.VPERMPS(my, y, y1) } + +// VPERMQ: Permute Quadword Integers. +// +// Forms: +// +// VPERMQ imm8 ymm ymm +// VPERMQ imm8 m256 ymm +// Construct and append a VPERMQ instruction to the active function. +func (c *Context) VPERMQ(i, my, y operand.Op) { + if inst, err := x86.VPERMQ(i, my, y); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPERMQ: Permute Quadword Integers. +// +// Forms: +// +// VPERMQ imm8 ymm ymm +// VPERMQ imm8 m256 ymm +// Construct and append a VPERMQ instruction to the active function. +// Operates on the global context. +func VPERMQ(i, my, y operand.Op) { ctx.VPERMQ(i, my, y) } + +// VPEXTRB: Extract Byte. +// +// Forms: +// +// VPEXTRB imm8 xmm r32 +// VPEXTRB imm8 xmm m8 +// Construct and append a VPEXTRB instruction to the active function. +func (c *Context) VPEXTRB(i, x, mr operand.Op) { + if inst, err := x86.VPEXTRB(i, x, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPEXTRB: Extract Byte. +// +// Forms: +// +// VPEXTRB imm8 xmm r32 +// VPEXTRB imm8 xmm m8 +// Construct and append a VPEXTRB instruction to the active function. +// Operates on the global context. +func VPEXTRB(i, x, mr operand.Op) { ctx.VPEXTRB(i, x, mr) } + +// VPEXTRD: Extract Doubleword. +// +// Forms: +// +// VPEXTRD imm8 xmm r32 +// VPEXTRD imm8 xmm m32 +// Construct and append a VPEXTRD instruction to the active function. +func (c *Context) VPEXTRD(i, x, mr operand.Op) { + if inst, err := x86.VPEXTRD(i, x, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPEXTRD: Extract Doubleword. +// +// Forms: +// +// VPEXTRD imm8 xmm r32 +// VPEXTRD imm8 xmm m32 +// Construct and append a VPEXTRD instruction to the active function. +// Operates on the global context. +func VPEXTRD(i, x, mr operand.Op) { ctx.VPEXTRD(i, x, mr) } + +// VPEXTRQ: Extract Quadword. +// +// Forms: +// +// VPEXTRQ imm8 xmm r64 +// VPEXTRQ imm8 xmm m64 +// Construct and append a VPEXTRQ instruction to the active function. +func (c *Context) VPEXTRQ(i, x, mr operand.Op) { + if inst, err := x86.VPEXTRQ(i, x, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPEXTRQ: Extract Quadword. +// +// Forms: +// +// VPEXTRQ imm8 xmm r64 +// VPEXTRQ imm8 xmm m64 +// Construct and append a VPEXTRQ instruction to the active function. +// Operates on the global context. +func VPEXTRQ(i, x, mr operand.Op) { ctx.VPEXTRQ(i, x, mr) } + +// VPEXTRW: Extract Word. +// +// Forms: +// +// VPEXTRW imm8 xmm r32 +// VPEXTRW imm8 xmm m16 +// Construct and append a VPEXTRW instruction to the active function. +func (c *Context) VPEXTRW(i, x, mr operand.Op) { + if inst, err := x86.VPEXTRW(i, x, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPEXTRW: Extract Word. +// +// Forms: +// +// VPEXTRW imm8 xmm r32 +// VPEXTRW imm8 xmm m16 +// Construct and append a VPEXTRW instruction to the active function. +// Operates on the global context. +func VPEXTRW(i, x, mr operand.Op) { ctx.VPEXTRW(i, x, mr) } + +// VPGATHERDD: Gather Packed Doubleword Values Using Signed Doubleword Indices. +// +// Forms: +// +// VPGATHERDD xmm vm32x xmm +// VPGATHERDD ymm vm32y ymm +// Construct and append a VPGATHERDD instruction to the active function. +func (c *Context) VPGATHERDD(xy, v, xy1 operand.Op) { + if inst, err := x86.VPGATHERDD(xy, v, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPGATHERDD: Gather Packed Doubleword Values Using Signed Doubleword Indices. +// +// Forms: +// +// VPGATHERDD xmm vm32x xmm +// VPGATHERDD ymm vm32y ymm +// Construct and append a VPGATHERDD instruction to the active function. +// Operates on the global context. +func VPGATHERDD(xy, v, xy1 operand.Op) { ctx.VPGATHERDD(xy, v, xy1) } + +// VPGATHERDQ: Gather Packed Quadword Values Using Signed Doubleword Indices. +// +// Forms: +// +// VPGATHERDQ xmm vm32x xmm +// VPGATHERDQ ymm vm32x ymm +// Construct and append a VPGATHERDQ instruction to the active function. +func (c *Context) VPGATHERDQ(xy, v, xy1 operand.Op) { + if inst, err := x86.VPGATHERDQ(xy, v, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPGATHERDQ: Gather Packed Quadword Values Using Signed Doubleword Indices. +// +// Forms: +// +// VPGATHERDQ xmm vm32x xmm +// VPGATHERDQ ymm vm32x ymm +// Construct and append a VPGATHERDQ instruction to the active function. +// Operates on the global context. +func VPGATHERDQ(xy, v, xy1 operand.Op) { ctx.VPGATHERDQ(xy, v, xy1) } + +// VPGATHERQD: Gather Packed Doubleword Values Using Signed Quadword Indices. +// +// Forms: +// +// VPGATHERQD xmm vm64x xmm +// VPGATHERQD xmm vm64y xmm +// Construct and append a VPGATHERQD instruction to the active function. +func (c *Context) VPGATHERQD(x, v, x1 operand.Op) { + if inst, err := x86.VPGATHERQD(x, v, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPGATHERQD: Gather Packed Doubleword Values Using Signed Quadword Indices. +// +// Forms: +// +// VPGATHERQD xmm vm64x xmm +// VPGATHERQD xmm vm64y xmm +// Construct and append a VPGATHERQD instruction to the active function. +// Operates on the global context. +func VPGATHERQD(x, v, x1 operand.Op) { ctx.VPGATHERQD(x, v, x1) } + +// VPGATHERQQ: Gather Packed Quadword Values Using Signed Quadword Indices. +// +// Forms: +// +// VPGATHERQQ xmm vm64x xmm +// VPGATHERQQ ymm vm64y ymm +// Construct and append a VPGATHERQQ instruction to the active function. +func (c *Context) VPGATHERQQ(xy, v, xy1 operand.Op) { + if inst, err := x86.VPGATHERQQ(xy, v, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPGATHERQQ: Gather Packed Quadword Values Using Signed Quadword Indices. +// +// Forms: +// +// VPGATHERQQ xmm vm64x xmm +// VPGATHERQQ ymm vm64y ymm +// Construct and append a VPGATHERQQ instruction to the active function. +// Operates on the global context. +func VPGATHERQQ(xy, v, xy1 operand.Op) { ctx.VPGATHERQQ(xy, v, xy1) } + +// VPHADDD: Packed Horizontal Add Doubleword Integer. +// +// Forms: +// +// VPHADDD xmm xmm xmm +// VPHADDD m128 xmm xmm +// VPHADDD ymm ymm ymm +// VPHADDD m256 ymm ymm +// Construct and append a VPHADDD instruction to the active function. +func (c *Context) VPHADDD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPHADDD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPHADDD: Packed Horizontal Add Doubleword Integer. +// +// Forms: +// +// VPHADDD xmm xmm xmm +// VPHADDD m128 xmm xmm +// VPHADDD ymm ymm ymm +// VPHADDD m256 ymm ymm +// Construct and append a VPHADDD instruction to the active function. +// Operates on the global context. +func VPHADDD(mxy, xy, xy1 operand.Op) { ctx.VPHADDD(mxy, xy, xy1) } + +// VPHADDSW: Packed Horizontal Add Signed Word Integers with Signed Saturation. +// +// Forms: +// +// VPHADDSW xmm xmm xmm +// VPHADDSW m128 xmm xmm +// VPHADDSW ymm ymm ymm +// VPHADDSW m256 ymm ymm +// Construct and append a VPHADDSW instruction to the active function. +func (c *Context) VPHADDSW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPHADDSW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPHADDSW: Packed Horizontal Add Signed Word Integers with Signed Saturation. +// +// Forms: +// +// VPHADDSW xmm xmm xmm +// VPHADDSW m128 xmm xmm +// VPHADDSW ymm ymm ymm +// VPHADDSW m256 ymm ymm +// Construct and append a VPHADDSW instruction to the active function. +// Operates on the global context. +func VPHADDSW(mxy, xy, xy1 operand.Op) { ctx.VPHADDSW(mxy, xy, xy1) } + +// VPHADDW: Packed Horizontal Add Word Integers. +// +// Forms: +// +// VPHADDW xmm xmm xmm +// VPHADDW m128 xmm xmm +// VPHADDW ymm ymm ymm +// VPHADDW m256 ymm ymm +// Construct and append a VPHADDW instruction to the active function. +func (c *Context) VPHADDW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPHADDW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPHADDW: Packed Horizontal Add Word Integers. +// +// Forms: +// +// VPHADDW xmm xmm xmm +// VPHADDW m128 xmm xmm +// VPHADDW ymm ymm ymm +// VPHADDW m256 ymm ymm +// Construct and append a VPHADDW instruction to the active function. +// Operates on the global context. +func VPHADDW(mxy, xy, xy1 operand.Op) { ctx.VPHADDW(mxy, xy, xy1) } + +// VPHMINPOSUW: Packed Horizontal Minimum of Unsigned Word Integers. +// +// Forms: +// +// VPHMINPOSUW xmm xmm +// VPHMINPOSUW m128 xmm +// Construct and append a VPHMINPOSUW instruction to the active function. +func (c *Context) VPHMINPOSUW(mx, x operand.Op) { + if inst, err := x86.VPHMINPOSUW(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPHMINPOSUW: Packed Horizontal Minimum of Unsigned Word Integers. +// +// Forms: +// +// VPHMINPOSUW xmm xmm +// VPHMINPOSUW m128 xmm +// Construct and append a VPHMINPOSUW instruction to the active function. +// Operates on the global context. +func VPHMINPOSUW(mx, x operand.Op) { ctx.VPHMINPOSUW(mx, x) } + +// VPHSUBD: Packed Horizontal Subtract Doubleword Integers. +// +// Forms: +// +// VPHSUBD xmm xmm xmm +// VPHSUBD m128 xmm xmm +// VPHSUBD ymm ymm ymm +// VPHSUBD m256 ymm ymm +// Construct and append a VPHSUBD instruction to the active function. +func (c *Context) VPHSUBD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPHSUBD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPHSUBD: Packed Horizontal Subtract Doubleword Integers. +// +// Forms: +// +// VPHSUBD xmm xmm xmm +// VPHSUBD m128 xmm xmm +// VPHSUBD ymm ymm ymm +// VPHSUBD m256 ymm ymm +// Construct and append a VPHSUBD instruction to the active function. +// Operates on the global context. +func VPHSUBD(mxy, xy, xy1 operand.Op) { ctx.VPHSUBD(mxy, xy, xy1) } + +// VPHSUBSW: Packed Horizontal Subtract Signed Word Integers with Signed Saturation. +// +// Forms: +// +// VPHSUBSW xmm xmm xmm +// VPHSUBSW m128 xmm xmm +// VPHSUBSW ymm ymm ymm +// VPHSUBSW m256 ymm ymm +// Construct and append a VPHSUBSW instruction to the active function. +func (c *Context) VPHSUBSW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPHSUBSW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPHSUBSW: Packed Horizontal Subtract Signed Word Integers with Signed Saturation. +// +// Forms: +// +// VPHSUBSW xmm xmm xmm +// VPHSUBSW m128 xmm xmm +// VPHSUBSW ymm ymm ymm +// VPHSUBSW m256 ymm ymm +// Construct and append a VPHSUBSW instruction to the active function. +// Operates on the global context. +func VPHSUBSW(mxy, xy, xy1 operand.Op) { ctx.VPHSUBSW(mxy, xy, xy1) } + +// VPHSUBW: Packed Horizontal Subtract Word Integers. +// +// Forms: +// +// VPHSUBW xmm xmm xmm +// VPHSUBW m128 xmm xmm +// VPHSUBW ymm ymm ymm +// VPHSUBW m256 ymm ymm +// Construct and append a VPHSUBW instruction to the active function. +func (c *Context) VPHSUBW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPHSUBW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPHSUBW: Packed Horizontal Subtract Word Integers. +// +// Forms: +// +// VPHSUBW xmm xmm xmm +// VPHSUBW m128 xmm xmm +// VPHSUBW ymm ymm ymm +// VPHSUBW m256 ymm ymm +// Construct and append a VPHSUBW instruction to the active function. +// Operates on the global context. +func VPHSUBW(mxy, xy, xy1 operand.Op) { ctx.VPHSUBW(mxy, xy, xy1) } + +// VPINSRB: Insert Byte. +// +// Forms: +// +// VPINSRB imm8 r32 xmm xmm +// VPINSRB imm8 m8 xmm xmm +// Construct and append a VPINSRB instruction to the active function. +func (c *Context) VPINSRB(i, mr, x, x1 operand.Op) { + if inst, err := x86.VPINSRB(i, mr, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPINSRB: Insert Byte. +// +// Forms: +// +// VPINSRB imm8 r32 xmm xmm +// VPINSRB imm8 m8 xmm xmm +// Construct and append a VPINSRB instruction to the active function. +// Operates on the global context. +func VPINSRB(i, mr, x, x1 operand.Op) { ctx.VPINSRB(i, mr, x, x1) } + +// VPINSRD: Insert Doubleword. +// +// Forms: +// +// VPINSRD imm8 r32 xmm xmm +// VPINSRD imm8 m32 xmm xmm +// Construct and append a VPINSRD instruction to the active function. +func (c *Context) VPINSRD(i, mr, x, x1 operand.Op) { + if inst, err := x86.VPINSRD(i, mr, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPINSRD: Insert Doubleword. +// +// Forms: +// +// VPINSRD imm8 r32 xmm xmm +// VPINSRD imm8 m32 xmm xmm +// Construct and append a VPINSRD instruction to the active function. +// Operates on the global context. +func VPINSRD(i, mr, x, x1 operand.Op) { ctx.VPINSRD(i, mr, x, x1) } + +// VPINSRQ: Insert Quadword. +// +// Forms: +// +// VPINSRQ imm8 r64 xmm xmm +// VPINSRQ imm8 m64 xmm xmm +// Construct and append a VPINSRQ instruction to the active function. +func (c *Context) VPINSRQ(i, mr, x, x1 operand.Op) { + if inst, err := x86.VPINSRQ(i, mr, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPINSRQ: Insert Quadword. +// +// Forms: +// +// VPINSRQ imm8 r64 xmm xmm +// VPINSRQ imm8 m64 xmm xmm +// Construct and append a VPINSRQ instruction to the active function. +// Operates on the global context. +func VPINSRQ(i, mr, x, x1 operand.Op) { ctx.VPINSRQ(i, mr, x, x1) } + +// VPINSRW: Insert Word. +// +// Forms: +// +// VPINSRW imm8 r32 xmm xmm +// VPINSRW imm8 m16 xmm xmm +// Construct and append a VPINSRW instruction to the active function. +func (c *Context) VPINSRW(i, mr, x, x1 operand.Op) { + if inst, err := x86.VPINSRW(i, mr, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPINSRW: Insert Word. +// +// Forms: +// +// VPINSRW imm8 r32 xmm xmm +// VPINSRW imm8 m16 xmm xmm +// Construct and append a VPINSRW instruction to the active function. +// Operates on the global context. +func VPINSRW(i, mr, x, x1 operand.Op) { ctx.VPINSRW(i, mr, x, x1) } + +// VPMADDUBSW: Multiply and Add Packed Signed and Unsigned Byte Integers. +// +// Forms: +// +// VPMADDUBSW xmm xmm xmm +// VPMADDUBSW m128 xmm xmm +// VPMADDUBSW ymm ymm ymm +// VPMADDUBSW m256 ymm ymm +// Construct and append a VPMADDUBSW instruction to the active function. +func (c *Context) VPMADDUBSW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMADDUBSW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMADDUBSW: Multiply and Add Packed Signed and Unsigned Byte Integers. +// +// Forms: +// +// VPMADDUBSW xmm xmm xmm +// VPMADDUBSW m128 xmm xmm +// VPMADDUBSW ymm ymm ymm +// VPMADDUBSW m256 ymm ymm +// Construct and append a VPMADDUBSW instruction to the active function. +// Operates on the global context. +func VPMADDUBSW(mxy, xy, xy1 operand.Op) { ctx.VPMADDUBSW(mxy, xy, xy1) } + +// VPMADDWD: Multiply and Add Packed Signed Word Integers. +// +// Forms: +// +// VPMADDWD xmm xmm xmm +// VPMADDWD m128 xmm xmm +// VPMADDWD ymm ymm ymm +// VPMADDWD m256 ymm ymm +// Construct and append a VPMADDWD instruction to the active function. +func (c *Context) VPMADDWD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMADDWD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMADDWD: Multiply and Add Packed Signed Word Integers. +// +// Forms: +// +// VPMADDWD xmm xmm xmm +// VPMADDWD m128 xmm xmm +// VPMADDWD ymm ymm ymm +// VPMADDWD m256 ymm ymm +// Construct and append a VPMADDWD instruction to the active function. +// Operates on the global context. +func VPMADDWD(mxy, xy, xy1 operand.Op) { ctx.VPMADDWD(mxy, xy, xy1) } + +// VPMASKMOVD: Conditional Move Packed Doubleword Integers. +// +// Forms: +// +// VPMASKMOVD m128 xmm xmm +// VPMASKMOVD m256 ymm ymm +// VPMASKMOVD xmm xmm m128 +// VPMASKMOVD ymm ymm m256 +// Construct and append a VPMASKMOVD instruction to the active function. +func (c *Context) VPMASKMOVD(mxy, xy, mxy1 operand.Op) { + if inst, err := x86.VPMASKMOVD(mxy, xy, mxy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMASKMOVD: Conditional Move Packed Doubleword Integers. +// +// Forms: +// +// VPMASKMOVD m128 xmm xmm +// VPMASKMOVD m256 ymm ymm +// VPMASKMOVD xmm xmm m128 +// VPMASKMOVD ymm ymm m256 +// Construct and append a VPMASKMOVD instruction to the active function. +// Operates on the global context. +func VPMASKMOVD(mxy, xy, mxy1 operand.Op) { ctx.VPMASKMOVD(mxy, xy, mxy1) } + +// VPMASKMOVQ: Conditional Move Packed Quadword Integers. +// +// Forms: +// +// VPMASKMOVQ m128 xmm xmm +// VPMASKMOVQ m256 ymm ymm +// VPMASKMOVQ xmm xmm m128 +// VPMASKMOVQ ymm ymm m256 +// Construct and append a VPMASKMOVQ instruction to the active function. +func (c *Context) VPMASKMOVQ(mxy, xy, mxy1 operand.Op) { + if inst, err := x86.VPMASKMOVQ(mxy, xy, mxy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMASKMOVQ: Conditional Move Packed Quadword Integers. +// +// Forms: +// +// VPMASKMOVQ m128 xmm xmm +// VPMASKMOVQ m256 ymm ymm +// VPMASKMOVQ xmm xmm m128 +// VPMASKMOVQ ymm ymm m256 +// Construct and append a VPMASKMOVQ instruction to the active function. +// Operates on the global context. +func VPMASKMOVQ(mxy, xy, mxy1 operand.Op) { ctx.VPMASKMOVQ(mxy, xy, mxy1) } + +// VPMAXSB: Maximum of Packed Signed Byte Integers. +// +// Forms: +// +// VPMAXSB xmm xmm xmm +// VPMAXSB m128 xmm xmm +// VPMAXSB ymm ymm ymm +// VPMAXSB m256 ymm ymm +// Construct and append a VPMAXSB instruction to the active function. +func (c *Context) VPMAXSB(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMAXSB(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMAXSB: Maximum of Packed Signed Byte Integers. +// +// Forms: +// +// VPMAXSB xmm xmm xmm +// VPMAXSB m128 xmm xmm +// VPMAXSB ymm ymm ymm +// VPMAXSB m256 ymm ymm +// Construct and append a VPMAXSB instruction to the active function. +// Operates on the global context. +func VPMAXSB(mxy, xy, xy1 operand.Op) { ctx.VPMAXSB(mxy, xy, xy1) } + +// VPMAXSD: Maximum of Packed Signed Doubleword Integers. +// +// Forms: +// +// VPMAXSD xmm xmm xmm +// VPMAXSD m128 xmm xmm +// VPMAXSD ymm ymm ymm +// VPMAXSD m256 ymm ymm +// Construct and append a VPMAXSD instruction to the active function. +func (c *Context) VPMAXSD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMAXSD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMAXSD: Maximum of Packed Signed Doubleword Integers. +// +// Forms: +// +// VPMAXSD xmm xmm xmm +// VPMAXSD m128 xmm xmm +// VPMAXSD ymm ymm ymm +// VPMAXSD m256 ymm ymm +// Construct and append a VPMAXSD instruction to the active function. +// Operates on the global context. +func VPMAXSD(mxy, xy, xy1 operand.Op) { ctx.VPMAXSD(mxy, xy, xy1) } + +// VPMAXSW: Maximum of Packed Signed Word Integers. +// +// Forms: +// +// VPMAXSW xmm xmm xmm +// VPMAXSW m128 xmm xmm +// VPMAXSW ymm ymm ymm +// VPMAXSW m256 ymm ymm +// Construct and append a VPMAXSW instruction to the active function. +func (c *Context) VPMAXSW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMAXSW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMAXSW: Maximum of Packed Signed Word Integers. +// +// Forms: +// +// VPMAXSW xmm xmm xmm +// VPMAXSW m128 xmm xmm +// VPMAXSW ymm ymm ymm +// VPMAXSW m256 ymm ymm +// Construct and append a VPMAXSW instruction to the active function. +// Operates on the global context. +func VPMAXSW(mxy, xy, xy1 operand.Op) { ctx.VPMAXSW(mxy, xy, xy1) } + +// VPMAXUB: Maximum of Packed Unsigned Byte Integers. +// +// Forms: +// +// VPMAXUB xmm xmm xmm +// VPMAXUB m128 xmm xmm +// VPMAXUB ymm ymm ymm +// VPMAXUB m256 ymm ymm +// Construct and append a VPMAXUB instruction to the active function. +func (c *Context) VPMAXUB(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMAXUB(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMAXUB: Maximum of Packed Unsigned Byte Integers. +// +// Forms: +// +// VPMAXUB xmm xmm xmm +// VPMAXUB m128 xmm xmm +// VPMAXUB ymm ymm ymm +// VPMAXUB m256 ymm ymm +// Construct and append a VPMAXUB instruction to the active function. +// Operates on the global context. +func VPMAXUB(mxy, xy, xy1 operand.Op) { ctx.VPMAXUB(mxy, xy, xy1) } + +// VPMAXUD: Maximum of Packed Unsigned Doubleword Integers. +// +// Forms: +// +// VPMAXUD xmm xmm xmm +// VPMAXUD m128 xmm xmm +// VPMAXUD ymm ymm ymm +// VPMAXUD m256 ymm ymm +// Construct and append a VPMAXUD instruction to the active function. +func (c *Context) VPMAXUD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMAXUD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMAXUD: Maximum of Packed Unsigned Doubleword Integers. +// +// Forms: +// +// VPMAXUD xmm xmm xmm +// VPMAXUD m128 xmm xmm +// VPMAXUD ymm ymm ymm +// VPMAXUD m256 ymm ymm +// Construct and append a VPMAXUD instruction to the active function. +// Operates on the global context. +func VPMAXUD(mxy, xy, xy1 operand.Op) { ctx.VPMAXUD(mxy, xy, xy1) } + +// VPMAXUW: Maximum of Packed Unsigned Word Integers. +// +// Forms: +// +// VPMAXUW xmm xmm xmm +// VPMAXUW m128 xmm xmm +// VPMAXUW ymm ymm ymm +// VPMAXUW m256 ymm ymm +// Construct and append a VPMAXUW instruction to the active function. +func (c *Context) VPMAXUW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMAXUW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMAXUW: Maximum of Packed Unsigned Word Integers. +// +// Forms: +// +// VPMAXUW xmm xmm xmm +// VPMAXUW m128 xmm xmm +// VPMAXUW ymm ymm ymm +// VPMAXUW m256 ymm ymm +// Construct and append a VPMAXUW instruction to the active function. +// Operates on the global context. +func VPMAXUW(mxy, xy, xy1 operand.Op) { ctx.VPMAXUW(mxy, xy, xy1) } + +// VPMINSB: Minimum of Packed Signed Byte Integers. +// +// Forms: +// +// VPMINSB xmm xmm xmm +// VPMINSB m128 xmm xmm +// VPMINSB ymm ymm ymm +// VPMINSB m256 ymm ymm +// Construct and append a VPMINSB instruction to the active function. +func (c *Context) VPMINSB(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMINSB(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMINSB: Minimum of Packed Signed Byte Integers. +// +// Forms: +// +// VPMINSB xmm xmm xmm +// VPMINSB m128 xmm xmm +// VPMINSB ymm ymm ymm +// VPMINSB m256 ymm ymm +// Construct and append a VPMINSB instruction to the active function. +// Operates on the global context. +func VPMINSB(mxy, xy, xy1 operand.Op) { ctx.VPMINSB(mxy, xy, xy1) } + +// VPMINSD: Minimum of Packed Signed Doubleword Integers. +// +// Forms: +// +// VPMINSD xmm xmm xmm +// VPMINSD m128 xmm xmm +// VPMINSD ymm ymm ymm +// VPMINSD m256 ymm ymm +// Construct and append a VPMINSD instruction to the active function. +func (c *Context) VPMINSD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMINSD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMINSD: Minimum of Packed Signed Doubleword Integers. +// +// Forms: +// +// VPMINSD xmm xmm xmm +// VPMINSD m128 xmm xmm +// VPMINSD ymm ymm ymm +// VPMINSD m256 ymm ymm +// Construct and append a VPMINSD instruction to the active function. +// Operates on the global context. +func VPMINSD(mxy, xy, xy1 operand.Op) { ctx.VPMINSD(mxy, xy, xy1) } + +// VPMINSW: Minimum of Packed Signed Word Integers. +// +// Forms: +// +// VPMINSW xmm xmm xmm +// VPMINSW m128 xmm xmm +// VPMINSW ymm ymm ymm +// VPMINSW m256 ymm ymm +// Construct and append a VPMINSW instruction to the active function. +func (c *Context) VPMINSW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMINSW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMINSW: Minimum of Packed Signed Word Integers. +// +// Forms: +// +// VPMINSW xmm xmm xmm +// VPMINSW m128 xmm xmm +// VPMINSW ymm ymm ymm +// VPMINSW m256 ymm ymm +// Construct and append a VPMINSW instruction to the active function. +// Operates on the global context. +func VPMINSW(mxy, xy, xy1 operand.Op) { ctx.VPMINSW(mxy, xy, xy1) } + +// VPMINUB: Minimum of Packed Unsigned Byte Integers. +// +// Forms: +// +// VPMINUB xmm xmm xmm +// VPMINUB m128 xmm xmm +// VPMINUB ymm ymm ymm +// VPMINUB m256 ymm ymm +// Construct and append a VPMINUB instruction to the active function. +func (c *Context) VPMINUB(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMINUB(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMINUB: Minimum of Packed Unsigned Byte Integers. +// +// Forms: +// +// VPMINUB xmm xmm xmm +// VPMINUB m128 xmm xmm +// VPMINUB ymm ymm ymm +// VPMINUB m256 ymm ymm +// Construct and append a VPMINUB instruction to the active function. +// Operates on the global context. +func VPMINUB(mxy, xy, xy1 operand.Op) { ctx.VPMINUB(mxy, xy, xy1) } + +// VPMINUD: Minimum of Packed Unsigned Doubleword Integers. +// +// Forms: +// +// VPMINUD xmm xmm xmm +// VPMINUD m128 xmm xmm +// VPMINUD ymm ymm ymm +// VPMINUD m256 ymm ymm +// Construct and append a VPMINUD instruction to the active function. +func (c *Context) VPMINUD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMINUD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMINUD: Minimum of Packed Unsigned Doubleword Integers. +// +// Forms: +// +// VPMINUD xmm xmm xmm +// VPMINUD m128 xmm xmm +// VPMINUD ymm ymm ymm +// VPMINUD m256 ymm ymm +// Construct and append a VPMINUD instruction to the active function. +// Operates on the global context. +func VPMINUD(mxy, xy, xy1 operand.Op) { ctx.VPMINUD(mxy, xy, xy1) } + +// VPMINUW: Minimum of Packed Unsigned Word Integers. +// +// Forms: +// +// VPMINUW xmm xmm xmm +// VPMINUW m128 xmm xmm +// VPMINUW ymm ymm ymm +// VPMINUW m256 ymm ymm +// Construct and append a VPMINUW instruction to the active function. +func (c *Context) VPMINUW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMINUW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMINUW: Minimum of Packed Unsigned Word Integers. +// +// Forms: +// +// VPMINUW xmm xmm xmm +// VPMINUW m128 xmm xmm +// VPMINUW ymm ymm ymm +// VPMINUW m256 ymm ymm +// Construct and append a VPMINUW instruction to the active function. +// Operates on the global context. +func VPMINUW(mxy, xy, xy1 operand.Op) { ctx.VPMINUW(mxy, xy, xy1) } + +// VPMOVMSKB: Move Byte Mask. +// +// Forms: +// +// VPMOVMSKB xmm r32 +// VPMOVMSKB ymm r32 +// Construct and append a VPMOVMSKB instruction to the active function. +func (c *Context) VPMOVMSKB(xy, r operand.Op) { + if inst, err := x86.VPMOVMSKB(xy, r); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMOVMSKB: Move Byte Mask. +// +// Forms: +// +// VPMOVMSKB xmm r32 +// VPMOVMSKB ymm r32 +// Construct and append a VPMOVMSKB instruction to the active function. +// Operates on the global context. +func VPMOVMSKB(xy, r operand.Op) { ctx.VPMOVMSKB(xy, r) } + +// VPMOVSXBD: Move Packed Byte Integers to Doubleword Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXBD xmm xmm +// VPMOVSXBD m32 xmm +// VPMOVSXBD xmm ymm +// VPMOVSXBD m64 ymm +// Construct and append a VPMOVSXBD instruction to the active function. +func (c *Context) VPMOVSXBD(mx, xy operand.Op) { + if inst, err := x86.VPMOVSXBD(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMOVSXBD: Move Packed Byte Integers to Doubleword Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXBD xmm xmm +// VPMOVSXBD m32 xmm +// VPMOVSXBD xmm ymm +// VPMOVSXBD m64 ymm +// Construct and append a VPMOVSXBD instruction to the active function. +// Operates on the global context. +func VPMOVSXBD(mx, xy operand.Op) { ctx.VPMOVSXBD(mx, xy) } + +// VPMOVSXBQ: Move Packed Byte Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXBQ xmm xmm +// VPMOVSXBQ m16 xmm +// VPMOVSXBQ xmm ymm +// VPMOVSXBQ m32 ymm +// Construct and append a VPMOVSXBQ instruction to the active function. +func (c *Context) VPMOVSXBQ(mx, xy operand.Op) { + if inst, err := x86.VPMOVSXBQ(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMOVSXBQ: Move Packed Byte Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXBQ xmm xmm +// VPMOVSXBQ m16 xmm +// VPMOVSXBQ xmm ymm +// VPMOVSXBQ m32 ymm +// Construct and append a VPMOVSXBQ instruction to the active function. +// Operates on the global context. +func VPMOVSXBQ(mx, xy operand.Op) { ctx.VPMOVSXBQ(mx, xy) } + +// VPMOVSXBW: Move Packed Byte Integers to Word Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXBW xmm xmm +// VPMOVSXBW m64 xmm +// VPMOVSXBW xmm ymm +// VPMOVSXBW m128 ymm +// Construct and append a VPMOVSXBW instruction to the active function. +func (c *Context) VPMOVSXBW(mx, xy operand.Op) { + if inst, err := x86.VPMOVSXBW(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMOVSXBW: Move Packed Byte Integers to Word Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXBW xmm xmm +// VPMOVSXBW m64 xmm +// VPMOVSXBW xmm ymm +// VPMOVSXBW m128 ymm +// Construct and append a VPMOVSXBW instruction to the active function. +// Operates on the global context. +func VPMOVSXBW(mx, xy operand.Op) { ctx.VPMOVSXBW(mx, xy) } + +// VPMOVSXDQ: Move Packed Doubleword Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXDQ xmm xmm +// VPMOVSXDQ m64 xmm +// VPMOVSXDQ xmm ymm +// VPMOVSXDQ m128 ymm +// Construct and append a VPMOVSXDQ instruction to the active function. +func (c *Context) VPMOVSXDQ(mx, xy operand.Op) { + if inst, err := x86.VPMOVSXDQ(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMOVSXDQ: Move Packed Doubleword Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXDQ xmm xmm +// VPMOVSXDQ m64 xmm +// VPMOVSXDQ xmm ymm +// VPMOVSXDQ m128 ymm +// Construct and append a VPMOVSXDQ instruction to the active function. +// Operates on the global context. +func VPMOVSXDQ(mx, xy operand.Op) { ctx.VPMOVSXDQ(mx, xy) } + +// VPMOVSXWD: Move Packed Word Integers to Doubleword Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXWD xmm xmm +// VPMOVSXWD m64 xmm +// VPMOVSXWD xmm ymm +// VPMOVSXWD m128 ymm +// Construct and append a VPMOVSXWD instruction to the active function. +func (c *Context) VPMOVSXWD(mx, xy operand.Op) { + if inst, err := x86.VPMOVSXWD(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMOVSXWD: Move Packed Word Integers to Doubleword Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXWD xmm xmm +// VPMOVSXWD m64 xmm +// VPMOVSXWD xmm ymm +// VPMOVSXWD m128 ymm +// Construct and append a VPMOVSXWD instruction to the active function. +// Operates on the global context. +func VPMOVSXWD(mx, xy operand.Op) { ctx.VPMOVSXWD(mx, xy) } + +// VPMOVSXWQ: Move Packed Word Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXWQ xmm xmm +// VPMOVSXWQ m32 xmm +// VPMOVSXWQ xmm ymm +// VPMOVSXWQ m64 ymm +// Construct and append a VPMOVSXWQ instruction to the active function. +func (c *Context) VPMOVSXWQ(mx, xy operand.Op) { + if inst, err := x86.VPMOVSXWQ(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMOVSXWQ: Move Packed Word Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXWQ xmm xmm +// VPMOVSXWQ m32 xmm +// VPMOVSXWQ xmm ymm +// VPMOVSXWQ m64 ymm +// Construct and append a VPMOVSXWQ instruction to the active function. +// Operates on the global context. +func VPMOVSXWQ(mx, xy operand.Op) { ctx.VPMOVSXWQ(mx, xy) } + +// VPMOVZXBD: Move Packed Byte Integers to Doubleword Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXBD xmm xmm +// VPMOVZXBD m32 xmm +// VPMOVZXBD xmm ymm +// VPMOVZXBD m64 ymm +// Construct and append a VPMOVZXBD instruction to the active function. +func (c *Context) VPMOVZXBD(mx, xy operand.Op) { + if inst, err := x86.VPMOVZXBD(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMOVZXBD: Move Packed Byte Integers to Doubleword Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXBD xmm xmm +// VPMOVZXBD m32 xmm +// VPMOVZXBD xmm ymm +// VPMOVZXBD m64 ymm +// Construct and append a VPMOVZXBD instruction to the active function. +// Operates on the global context. +func VPMOVZXBD(mx, xy operand.Op) { ctx.VPMOVZXBD(mx, xy) } + +// VPMOVZXBQ: Move Packed Byte Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXBQ xmm xmm +// VPMOVZXBQ m16 xmm +// VPMOVZXBQ xmm ymm +// VPMOVZXBQ m32 ymm +// Construct and append a VPMOVZXBQ instruction to the active function. +func (c *Context) VPMOVZXBQ(mx, xy operand.Op) { + if inst, err := x86.VPMOVZXBQ(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMOVZXBQ: Move Packed Byte Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXBQ xmm xmm +// VPMOVZXBQ m16 xmm +// VPMOVZXBQ xmm ymm +// VPMOVZXBQ m32 ymm +// Construct and append a VPMOVZXBQ instruction to the active function. +// Operates on the global context. +func VPMOVZXBQ(mx, xy operand.Op) { ctx.VPMOVZXBQ(mx, xy) } + +// VPMOVZXBW: Move Packed Byte Integers to Word Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXBW xmm xmm +// VPMOVZXBW m64 xmm +// VPMOVZXBW xmm ymm +// VPMOVZXBW m128 ymm +// Construct and append a VPMOVZXBW instruction to the active function. +func (c *Context) VPMOVZXBW(mx, xy operand.Op) { + if inst, err := x86.VPMOVZXBW(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMOVZXBW: Move Packed Byte Integers to Word Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXBW xmm xmm +// VPMOVZXBW m64 xmm +// VPMOVZXBW xmm ymm +// VPMOVZXBW m128 ymm +// Construct and append a VPMOVZXBW instruction to the active function. +// Operates on the global context. +func VPMOVZXBW(mx, xy operand.Op) { ctx.VPMOVZXBW(mx, xy) } + +// VPMOVZXDQ: Move Packed Doubleword Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXDQ xmm xmm +// VPMOVZXDQ m64 xmm +// VPMOVZXDQ xmm ymm +// VPMOVZXDQ m128 ymm +// Construct and append a VPMOVZXDQ instruction to the active function. +func (c *Context) VPMOVZXDQ(mx, xy operand.Op) { + if inst, err := x86.VPMOVZXDQ(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMOVZXDQ: Move Packed Doubleword Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXDQ xmm xmm +// VPMOVZXDQ m64 xmm +// VPMOVZXDQ xmm ymm +// VPMOVZXDQ m128 ymm +// Construct and append a VPMOVZXDQ instruction to the active function. +// Operates on the global context. +func VPMOVZXDQ(mx, xy operand.Op) { ctx.VPMOVZXDQ(mx, xy) } + +// VPMOVZXWD: Move Packed Word Integers to Doubleword Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXWD xmm xmm +// VPMOVZXWD m64 xmm +// VPMOVZXWD xmm ymm +// VPMOVZXWD m128 ymm +// Construct and append a VPMOVZXWD instruction to the active function. +func (c *Context) VPMOVZXWD(mx, xy operand.Op) { + if inst, err := x86.VPMOVZXWD(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMOVZXWD: Move Packed Word Integers to Doubleword Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXWD xmm xmm +// VPMOVZXWD m64 xmm +// VPMOVZXWD xmm ymm +// VPMOVZXWD m128 ymm +// Construct and append a VPMOVZXWD instruction to the active function. +// Operates on the global context. +func VPMOVZXWD(mx, xy operand.Op) { ctx.VPMOVZXWD(mx, xy) } + +// VPMOVZXWQ: Move Packed Word Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXWQ xmm xmm +// VPMOVZXWQ m32 xmm +// VPMOVZXWQ xmm ymm +// VPMOVZXWQ m64 ymm +// Construct and append a VPMOVZXWQ instruction to the active function. +func (c *Context) VPMOVZXWQ(mx, xy operand.Op) { + if inst, err := x86.VPMOVZXWQ(mx, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMOVZXWQ: Move Packed Word Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXWQ xmm xmm +// VPMOVZXWQ m32 xmm +// VPMOVZXWQ xmm ymm +// VPMOVZXWQ m64 ymm +// Construct and append a VPMOVZXWQ instruction to the active function. +// Operates on the global context. +func VPMOVZXWQ(mx, xy operand.Op) { ctx.VPMOVZXWQ(mx, xy) } + +// VPMULDQ: Multiply Packed Signed Doubleword Integers and Store Quadword Result. +// +// Forms: +// +// VPMULDQ xmm xmm xmm +// VPMULDQ m128 xmm xmm +// VPMULDQ ymm ymm ymm +// VPMULDQ m256 ymm ymm +// Construct and append a VPMULDQ instruction to the active function. +func (c *Context) VPMULDQ(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMULDQ(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMULDQ: Multiply Packed Signed Doubleword Integers and Store Quadword Result. +// +// Forms: +// +// VPMULDQ xmm xmm xmm +// VPMULDQ m128 xmm xmm +// VPMULDQ ymm ymm ymm +// VPMULDQ m256 ymm ymm +// Construct and append a VPMULDQ instruction to the active function. +// Operates on the global context. +func VPMULDQ(mxy, xy, xy1 operand.Op) { ctx.VPMULDQ(mxy, xy, xy1) } + +// VPMULHRSW: Packed Multiply Signed Word Integers and Store High Result with Round and Scale. +// +// Forms: +// +// VPMULHRSW xmm xmm xmm +// VPMULHRSW m128 xmm xmm +// VPMULHRSW ymm ymm ymm +// VPMULHRSW m256 ymm ymm +// Construct and append a VPMULHRSW instruction to the active function. +func (c *Context) VPMULHRSW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMULHRSW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMULHRSW: Packed Multiply Signed Word Integers and Store High Result with Round and Scale. +// +// Forms: +// +// VPMULHRSW xmm xmm xmm +// VPMULHRSW m128 xmm xmm +// VPMULHRSW ymm ymm ymm +// VPMULHRSW m256 ymm ymm +// Construct and append a VPMULHRSW instruction to the active function. +// Operates on the global context. +func VPMULHRSW(mxy, xy, xy1 operand.Op) { ctx.VPMULHRSW(mxy, xy, xy1) } + +// VPMULHUW: Multiply Packed Unsigned Word Integers and Store High Result. +// +// Forms: +// +// VPMULHUW xmm xmm xmm +// VPMULHUW m128 xmm xmm +// VPMULHUW ymm ymm ymm +// VPMULHUW m256 ymm ymm +// Construct and append a VPMULHUW instruction to the active function. +func (c *Context) VPMULHUW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMULHUW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMULHUW: Multiply Packed Unsigned Word Integers and Store High Result. +// +// Forms: +// +// VPMULHUW xmm xmm xmm +// VPMULHUW m128 xmm xmm +// VPMULHUW ymm ymm ymm +// VPMULHUW m256 ymm ymm +// Construct and append a VPMULHUW instruction to the active function. +// Operates on the global context. +func VPMULHUW(mxy, xy, xy1 operand.Op) { ctx.VPMULHUW(mxy, xy, xy1) } + +// VPMULHW: Multiply Packed Signed Word Integers and Store High Result. +// +// Forms: +// +// VPMULHW xmm xmm xmm +// VPMULHW m128 xmm xmm +// VPMULHW ymm ymm ymm +// VPMULHW m256 ymm ymm +// Construct and append a VPMULHW instruction to the active function. +func (c *Context) VPMULHW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMULHW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMULHW: Multiply Packed Signed Word Integers and Store High Result. +// +// Forms: +// +// VPMULHW xmm xmm xmm +// VPMULHW m128 xmm xmm +// VPMULHW ymm ymm ymm +// VPMULHW m256 ymm ymm +// Construct and append a VPMULHW instruction to the active function. +// Operates on the global context. +func VPMULHW(mxy, xy, xy1 operand.Op) { ctx.VPMULHW(mxy, xy, xy1) } + +// VPMULLD: Multiply Packed Signed Doubleword Integers and Store Low Result. +// +// Forms: +// +// VPMULLD xmm xmm xmm +// VPMULLD m128 xmm xmm +// VPMULLD ymm ymm ymm +// VPMULLD m256 ymm ymm +// Construct and append a VPMULLD instruction to the active function. +func (c *Context) VPMULLD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMULLD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMULLD: Multiply Packed Signed Doubleword Integers and Store Low Result. +// +// Forms: +// +// VPMULLD xmm xmm xmm +// VPMULLD m128 xmm xmm +// VPMULLD ymm ymm ymm +// VPMULLD m256 ymm ymm +// Construct and append a VPMULLD instruction to the active function. +// Operates on the global context. +func VPMULLD(mxy, xy, xy1 operand.Op) { ctx.VPMULLD(mxy, xy, xy1) } + +// VPMULLW: Multiply Packed Signed Word Integers and Store Low Result. +// +// Forms: +// +// VPMULLW xmm xmm xmm +// VPMULLW m128 xmm xmm +// VPMULLW ymm ymm ymm +// VPMULLW m256 ymm ymm +// Construct and append a VPMULLW instruction to the active function. +func (c *Context) VPMULLW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMULLW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMULLW: Multiply Packed Signed Word Integers and Store Low Result. +// +// Forms: +// +// VPMULLW xmm xmm xmm +// VPMULLW m128 xmm xmm +// VPMULLW ymm ymm ymm +// VPMULLW m256 ymm ymm +// Construct and append a VPMULLW instruction to the active function. +// Operates on the global context. +func VPMULLW(mxy, xy, xy1 operand.Op) { ctx.VPMULLW(mxy, xy, xy1) } + +// VPMULUDQ: Multiply Packed Unsigned Doubleword Integers. +// +// Forms: +// +// VPMULUDQ xmm xmm xmm +// VPMULUDQ m128 xmm xmm +// VPMULUDQ ymm ymm ymm +// VPMULUDQ m256 ymm ymm +// Construct and append a VPMULUDQ instruction to the active function. +func (c *Context) VPMULUDQ(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPMULUDQ(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPMULUDQ: Multiply Packed Unsigned Doubleword Integers. +// +// Forms: +// +// VPMULUDQ xmm xmm xmm +// VPMULUDQ m128 xmm xmm +// VPMULUDQ ymm ymm ymm +// VPMULUDQ m256 ymm ymm +// Construct and append a VPMULUDQ instruction to the active function. +// Operates on the global context. +func VPMULUDQ(mxy, xy, xy1 operand.Op) { ctx.VPMULUDQ(mxy, xy, xy1) } + +// VPOR: Packed Bitwise Logical OR. +// +// Forms: +// +// VPOR xmm xmm xmm +// VPOR m128 xmm xmm +// VPOR ymm ymm ymm +// VPOR m256 ymm ymm +// Construct and append a VPOR instruction to the active function. +func (c *Context) VPOR(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPOR(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPOR: Packed Bitwise Logical OR. +// +// Forms: +// +// VPOR xmm xmm xmm +// VPOR m128 xmm xmm +// VPOR ymm ymm ymm +// VPOR m256 ymm ymm +// Construct and append a VPOR instruction to the active function. +// Operates on the global context. +func VPOR(mxy, xy, xy1 operand.Op) { ctx.VPOR(mxy, xy, xy1) } + +// VPSADBW: Compute Sum of Absolute Differences. +// +// Forms: +// +// VPSADBW xmm xmm xmm +// VPSADBW m128 xmm xmm +// VPSADBW ymm ymm ymm +// VPSADBW m256 ymm ymm +// Construct and append a VPSADBW instruction to the active function. +func (c *Context) VPSADBW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSADBW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSADBW: Compute Sum of Absolute Differences. +// +// Forms: +// +// VPSADBW xmm xmm xmm +// VPSADBW m128 xmm xmm +// VPSADBW ymm ymm ymm +// VPSADBW m256 ymm ymm +// Construct and append a VPSADBW instruction to the active function. +// Operates on the global context. +func VPSADBW(mxy, xy, xy1 operand.Op) { ctx.VPSADBW(mxy, xy, xy1) } + +// VPSHUFB: Packed Shuffle Bytes. +// +// Forms: +// +// VPSHUFB xmm xmm xmm +// VPSHUFB m128 xmm xmm +// VPSHUFB ymm ymm ymm +// VPSHUFB m256 ymm ymm +// Construct and append a VPSHUFB instruction to the active function. +func (c *Context) VPSHUFB(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSHUFB(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSHUFB: Packed Shuffle Bytes. +// +// Forms: +// +// VPSHUFB xmm xmm xmm +// VPSHUFB m128 xmm xmm +// VPSHUFB ymm ymm ymm +// VPSHUFB m256 ymm ymm +// Construct and append a VPSHUFB instruction to the active function. +// Operates on the global context. +func VPSHUFB(mxy, xy, xy1 operand.Op) { ctx.VPSHUFB(mxy, xy, xy1) } + +// VPSHUFD: Shuffle Packed Doublewords. +// +// Forms: +// +// VPSHUFD imm8 xmm xmm +// VPSHUFD imm8 m128 xmm +// VPSHUFD imm8 ymm ymm +// VPSHUFD imm8 m256 ymm +// Construct and append a VPSHUFD instruction to the active function. +func (c *Context) VPSHUFD(i, mxy, xy operand.Op) { + if inst, err := x86.VPSHUFD(i, mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSHUFD: Shuffle Packed Doublewords. +// +// Forms: +// +// VPSHUFD imm8 xmm xmm +// VPSHUFD imm8 m128 xmm +// VPSHUFD imm8 ymm ymm +// VPSHUFD imm8 m256 ymm +// Construct and append a VPSHUFD instruction to the active function. +// Operates on the global context. +func VPSHUFD(i, mxy, xy operand.Op) { ctx.VPSHUFD(i, mxy, xy) } + +// VPSHUFHW: Shuffle Packed High Words. +// +// Forms: +// +// VPSHUFHW imm8 xmm xmm +// VPSHUFHW imm8 m128 xmm +// VPSHUFHW imm8 ymm ymm +// VPSHUFHW imm8 m256 ymm +// Construct and append a VPSHUFHW instruction to the active function. +func (c *Context) VPSHUFHW(i, mxy, xy operand.Op) { + if inst, err := x86.VPSHUFHW(i, mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSHUFHW: Shuffle Packed High Words. +// +// Forms: +// +// VPSHUFHW imm8 xmm xmm +// VPSHUFHW imm8 m128 xmm +// VPSHUFHW imm8 ymm ymm +// VPSHUFHW imm8 m256 ymm +// Construct and append a VPSHUFHW instruction to the active function. +// Operates on the global context. +func VPSHUFHW(i, mxy, xy operand.Op) { ctx.VPSHUFHW(i, mxy, xy) } + +// VPSHUFLW: Shuffle Packed Low Words. +// +// Forms: +// +// VPSHUFLW imm8 xmm xmm +// VPSHUFLW imm8 m128 xmm +// VPSHUFLW imm8 ymm ymm +// VPSHUFLW imm8 m256 ymm +// Construct and append a VPSHUFLW instruction to the active function. +func (c *Context) VPSHUFLW(i, mxy, xy operand.Op) { + if inst, err := x86.VPSHUFLW(i, mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSHUFLW: Shuffle Packed Low Words. +// +// Forms: +// +// VPSHUFLW imm8 xmm xmm +// VPSHUFLW imm8 m128 xmm +// VPSHUFLW imm8 ymm ymm +// VPSHUFLW imm8 m256 ymm +// Construct and append a VPSHUFLW instruction to the active function. +// Operates on the global context. +func VPSHUFLW(i, mxy, xy operand.Op) { ctx.VPSHUFLW(i, mxy, xy) } + +// VPSIGNB: Packed Sign of Byte Integers. +// +// Forms: +// +// VPSIGNB xmm xmm xmm +// VPSIGNB m128 xmm xmm +// VPSIGNB ymm ymm ymm +// VPSIGNB m256 ymm ymm +// Construct and append a VPSIGNB instruction to the active function. +func (c *Context) VPSIGNB(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSIGNB(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSIGNB: Packed Sign of Byte Integers. +// +// Forms: +// +// VPSIGNB xmm xmm xmm +// VPSIGNB m128 xmm xmm +// VPSIGNB ymm ymm ymm +// VPSIGNB m256 ymm ymm +// Construct and append a VPSIGNB instruction to the active function. +// Operates on the global context. +func VPSIGNB(mxy, xy, xy1 operand.Op) { ctx.VPSIGNB(mxy, xy, xy1) } + +// VPSIGND: Packed Sign of Doubleword Integers. +// +// Forms: +// +// VPSIGND xmm xmm xmm +// VPSIGND m128 xmm xmm +// VPSIGND ymm ymm ymm +// VPSIGND m256 ymm ymm +// Construct and append a VPSIGND instruction to the active function. +func (c *Context) VPSIGND(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSIGND(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSIGND: Packed Sign of Doubleword Integers. +// +// Forms: +// +// VPSIGND xmm xmm xmm +// VPSIGND m128 xmm xmm +// VPSIGND ymm ymm ymm +// VPSIGND m256 ymm ymm +// Construct and append a VPSIGND instruction to the active function. +// Operates on the global context. +func VPSIGND(mxy, xy, xy1 operand.Op) { ctx.VPSIGND(mxy, xy, xy1) } + +// VPSIGNW: Packed Sign of Word Integers. +// +// Forms: +// +// VPSIGNW xmm xmm xmm +// VPSIGNW m128 xmm xmm +// VPSIGNW ymm ymm ymm +// VPSIGNW m256 ymm ymm +// Construct and append a VPSIGNW instruction to the active function. +func (c *Context) VPSIGNW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSIGNW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSIGNW: Packed Sign of Word Integers. +// +// Forms: +// +// VPSIGNW xmm xmm xmm +// VPSIGNW m128 xmm xmm +// VPSIGNW ymm ymm ymm +// VPSIGNW m256 ymm ymm +// Construct and append a VPSIGNW instruction to the active function. +// Operates on the global context. +func VPSIGNW(mxy, xy, xy1 operand.Op) { ctx.VPSIGNW(mxy, xy, xy1) } + +// VPSLLD: Shift Packed Doubleword Data Left Logical. +// +// Forms: +// +// VPSLLD imm8 xmm xmm +// VPSLLD xmm xmm xmm +// VPSLLD m128 xmm xmm +// VPSLLD imm8 ymm ymm +// VPSLLD xmm ymm ymm +// VPSLLD m128 ymm ymm +// Construct and append a VPSLLD instruction to the active function. +func (c *Context) VPSLLD(imx, xy, xy1 operand.Op) { + if inst, err := x86.VPSLLD(imx, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSLLD: Shift Packed Doubleword Data Left Logical. +// +// Forms: +// +// VPSLLD imm8 xmm xmm +// VPSLLD xmm xmm xmm +// VPSLLD m128 xmm xmm +// VPSLLD imm8 ymm ymm +// VPSLLD xmm ymm ymm +// VPSLLD m128 ymm ymm +// Construct and append a VPSLLD instruction to the active function. +// Operates on the global context. +func VPSLLD(imx, xy, xy1 operand.Op) { ctx.VPSLLD(imx, xy, xy1) } + +// VPSLLDQ: Shift Packed Double Quadword Left Logical. +// +// Forms: +// +// VPSLLDQ imm8 xmm xmm +// VPSLLDQ imm8 ymm ymm +// Construct and append a VPSLLDQ instruction to the active function. +func (c *Context) VPSLLDQ(i, xy, xy1 operand.Op) { + if inst, err := x86.VPSLLDQ(i, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSLLDQ: Shift Packed Double Quadword Left Logical. +// +// Forms: +// +// VPSLLDQ imm8 xmm xmm +// VPSLLDQ imm8 ymm ymm +// Construct and append a VPSLLDQ instruction to the active function. +// Operates on the global context. +func VPSLLDQ(i, xy, xy1 operand.Op) { ctx.VPSLLDQ(i, xy, xy1) } + +// VPSLLQ: Shift Packed Quadword Data Left Logical. +// +// Forms: +// +// VPSLLQ imm8 xmm xmm +// VPSLLQ xmm xmm xmm +// VPSLLQ m128 xmm xmm +// VPSLLQ imm8 ymm ymm +// VPSLLQ xmm ymm ymm +// VPSLLQ m128 ymm ymm +// Construct and append a VPSLLQ instruction to the active function. +func (c *Context) VPSLLQ(imx, xy, xy1 operand.Op) { + if inst, err := x86.VPSLLQ(imx, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSLLQ: Shift Packed Quadword Data Left Logical. +// +// Forms: +// +// VPSLLQ imm8 xmm xmm +// VPSLLQ xmm xmm xmm +// VPSLLQ m128 xmm xmm +// VPSLLQ imm8 ymm ymm +// VPSLLQ xmm ymm ymm +// VPSLLQ m128 ymm ymm +// Construct and append a VPSLLQ instruction to the active function. +// Operates on the global context. +func VPSLLQ(imx, xy, xy1 operand.Op) { ctx.VPSLLQ(imx, xy, xy1) } + +// VPSLLVD: Variable Shift Packed Doubleword Data Left Logical. +// +// Forms: +// +// VPSLLVD xmm xmm xmm +// VPSLLVD m128 xmm xmm +// VPSLLVD ymm ymm ymm +// VPSLLVD m256 ymm ymm +// Construct and append a VPSLLVD instruction to the active function. +func (c *Context) VPSLLVD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSLLVD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSLLVD: Variable Shift Packed Doubleword Data Left Logical. +// +// Forms: +// +// VPSLLVD xmm xmm xmm +// VPSLLVD m128 xmm xmm +// VPSLLVD ymm ymm ymm +// VPSLLVD m256 ymm ymm +// Construct and append a VPSLLVD instruction to the active function. +// Operates on the global context. +func VPSLLVD(mxy, xy, xy1 operand.Op) { ctx.VPSLLVD(mxy, xy, xy1) } + +// VPSLLVQ: Variable Shift Packed Quadword Data Left Logical. +// +// Forms: +// +// VPSLLVQ xmm xmm xmm +// VPSLLVQ m128 xmm xmm +// VPSLLVQ ymm ymm ymm +// VPSLLVQ m256 ymm ymm +// Construct and append a VPSLLVQ instruction to the active function. +func (c *Context) VPSLLVQ(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSLLVQ(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSLLVQ: Variable Shift Packed Quadword Data Left Logical. +// +// Forms: +// +// VPSLLVQ xmm xmm xmm +// VPSLLVQ m128 xmm xmm +// VPSLLVQ ymm ymm ymm +// VPSLLVQ m256 ymm ymm +// Construct and append a VPSLLVQ instruction to the active function. +// Operates on the global context. +func VPSLLVQ(mxy, xy, xy1 operand.Op) { ctx.VPSLLVQ(mxy, xy, xy1) } + +// VPSLLW: Shift Packed Word Data Left Logical. +// +// Forms: +// +// VPSLLW imm8 xmm xmm +// VPSLLW xmm xmm xmm +// VPSLLW m128 xmm xmm +// VPSLLW imm8 ymm ymm +// VPSLLW xmm ymm ymm +// VPSLLW m128 ymm ymm +// Construct and append a VPSLLW instruction to the active function. +func (c *Context) VPSLLW(imx, xy, xy1 operand.Op) { + if inst, err := x86.VPSLLW(imx, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSLLW: Shift Packed Word Data Left Logical. +// +// Forms: +// +// VPSLLW imm8 xmm xmm +// VPSLLW xmm xmm xmm +// VPSLLW m128 xmm xmm +// VPSLLW imm8 ymm ymm +// VPSLLW xmm ymm ymm +// VPSLLW m128 ymm ymm +// Construct and append a VPSLLW instruction to the active function. +// Operates on the global context. +func VPSLLW(imx, xy, xy1 operand.Op) { ctx.VPSLLW(imx, xy, xy1) } + +// VPSRAD: Shift Packed Doubleword Data Right Arithmetic. +// +// Forms: +// +// VPSRAD imm8 xmm xmm +// VPSRAD xmm xmm xmm +// VPSRAD m128 xmm xmm +// VPSRAD imm8 ymm ymm +// VPSRAD xmm ymm ymm +// VPSRAD m128 ymm ymm +// Construct and append a VPSRAD instruction to the active function. +func (c *Context) VPSRAD(imx, xy, xy1 operand.Op) { + if inst, err := x86.VPSRAD(imx, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSRAD: Shift Packed Doubleword Data Right Arithmetic. +// +// Forms: +// +// VPSRAD imm8 xmm xmm +// VPSRAD xmm xmm xmm +// VPSRAD m128 xmm xmm +// VPSRAD imm8 ymm ymm +// VPSRAD xmm ymm ymm +// VPSRAD m128 ymm ymm +// Construct and append a VPSRAD instruction to the active function. +// Operates on the global context. +func VPSRAD(imx, xy, xy1 operand.Op) { ctx.VPSRAD(imx, xy, xy1) } + +// VPSRAVD: Variable Shift Packed Doubleword Data Right Arithmetic. +// +// Forms: +// +// VPSRAVD xmm xmm xmm +// VPSRAVD m128 xmm xmm +// VPSRAVD ymm ymm ymm +// VPSRAVD m256 ymm ymm +// Construct and append a VPSRAVD instruction to the active function. +func (c *Context) VPSRAVD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSRAVD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSRAVD: Variable Shift Packed Doubleword Data Right Arithmetic. +// +// Forms: +// +// VPSRAVD xmm xmm xmm +// VPSRAVD m128 xmm xmm +// VPSRAVD ymm ymm ymm +// VPSRAVD m256 ymm ymm +// Construct and append a VPSRAVD instruction to the active function. +// Operates on the global context. +func VPSRAVD(mxy, xy, xy1 operand.Op) { ctx.VPSRAVD(mxy, xy, xy1) } + +// VPSRAW: Shift Packed Word Data Right Arithmetic. +// +// Forms: +// +// VPSRAW imm8 xmm xmm +// VPSRAW xmm xmm xmm +// VPSRAW m128 xmm xmm +// VPSRAW imm8 ymm ymm +// VPSRAW xmm ymm ymm +// VPSRAW m128 ymm ymm +// Construct and append a VPSRAW instruction to the active function. +func (c *Context) VPSRAW(imx, xy, xy1 operand.Op) { + if inst, err := x86.VPSRAW(imx, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSRAW: Shift Packed Word Data Right Arithmetic. +// +// Forms: +// +// VPSRAW imm8 xmm xmm +// VPSRAW xmm xmm xmm +// VPSRAW m128 xmm xmm +// VPSRAW imm8 ymm ymm +// VPSRAW xmm ymm ymm +// VPSRAW m128 ymm ymm +// Construct and append a VPSRAW instruction to the active function. +// Operates on the global context. +func VPSRAW(imx, xy, xy1 operand.Op) { ctx.VPSRAW(imx, xy, xy1) } + +// VPSRLD: Shift Packed Doubleword Data Right Logical. +// +// Forms: +// +// VPSRLD imm8 xmm xmm +// VPSRLD xmm xmm xmm +// VPSRLD m128 xmm xmm +// VPSRLD imm8 ymm ymm +// VPSRLD xmm ymm ymm +// VPSRLD m128 ymm ymm +// Construct and append a VPSRLD instruction to the active function. +func (c *Context) VPSRLD(imx, xy, xy1 operand.Op) { + if inst, err := x86.VPSRLD(imx, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSRLD: Shift Packed Doubleword Data Right Logical. +// +// Forms: +// +// VPSRLD imm8 xmm xmm +// VPSRLD xmm xmm xmm +// VPSRLD m128 xmm xmm +// VPSRLD imm8 ymm ymm +// VPSRLD xmm ymm ymm +// VPSRLD m128 ymm ymm +// Construct and append a VPSRLD instruction to the active function. +// Operates on the global context. +func VPSRLD(imx, xy, xy1 operand.Op) { ctx.VPSRLD(imx, xy, xy1) } + +// VPSRLDQ: Shift Packed Double Quadword Right Logical. +// +// Forms: +// +// VPSRLDQ imm8 xmm xmm +// VPSRLDQ imm8 ymm ymm +// Construct and append a VPSRLDQ instruction to the active function. +func (c *Context) VPSRLDQ(i, xy, xy1 operand.Op) { + if inst, err := x86.VPSRLDQ(i, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSRLDQ: Shift Packed Double Quadword Right Logical. +// +// Forms: +// +// VPSRLDQ imm8 xmm xmm +// VPSRLDQ imm8 ymm ymm +// Construct and append a VPSRLDQ instruction to the active function. +// Operates on the global context. +func VPSRLDQ(i, xy, xy1 operand.Op) { ctx.VPSRLDQ(i, xy, xy1) } + +// VPSRLQ: Shift Packed Quadword Data Right Logical. +// +// Forms: +// +// VPSRLQ imm8 xmm xmm +// VPSRLQ xmm xmm xmm +// VPSRLQ m128 xmm xmm +// VPSRLQ imm8 ymm ymm +// VPSRLQ xmm ymm ymm +// VPSRLQ m128 ymm ymm +// Construct and append a VPSRLQ instruction to the active function. +func (c *Context) VPSRLQ(imx, xy, xy1 operand.Op) { + if inst, err := x86.VPSRLQ(imx, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSRLQ: Shift Packed Quadword Data Right Logical. +// +// Forms: +// +// VPSRLQ imm8 xmm xmm +// VPSRLQ xmm xmm xmm +// VPSRLQ m128 xmm xmm +// VPSRLQ imm8 ymm ymm +// VPSRLQ xmm ymm ymm +// VPSRLQ m128 ymm ymm +// Construct and append a VPSRLQ instruction to the active function. +// Operates on the global context. +func VPSRLQ(imx, xy, xy1 operand.Op) { ctx.VPSRLQ(imx, xy, xy1) } + +// VPSRLVD: Variable Shift Packed Doubleword Data Right Logical. +// +// Forms: +// +// VPSRLVD xmm xmm xmm +// VPSRLVD m128 xmm xmm +// VPSRLVD ymm ymm ymm +// VPSRLVD m256 ymm ymm +// Construct and append a VPSRLVD instruction to the active function. +func (c *Context) VPSRLVD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSRLVD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSRLVD: Variable Shift Packed Doubleword Data Right Logical. +// +// Forms: +// +// VPSRLVD xmm xmm xmm +// VPSRLVD m128 xmm xmm +// VPSRLVD ymm ymm ymm +// VPSRLVD m256 ymm ymm +// Construct and append a VPSRLVD instruction to the active function. +// Operates on the global context. +func VPSRLVD(mxy, xy, xy1 operand.Op) { ctx.VPSRLVD(mxy, xy, xy1) } + +// VPSRLVQ: Variable Shift Packed Quadword Data Right Logical. +// +// Forms: +// +// VPSRLVQ xmm xmm xmm +// VPSRLVQ m128 xmm xmm +// VPSRLVQ ymm ymm ymm +// VPSRLVQ m256 ymm ymm +// Construct and append a VPSRLVQ instruction to the active function. +func (c *Context) VPSRLVQ(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSRLVQ(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSRLVQ: Variable Shift Packed Quadword Data Right Logical. +// +// Forms: +// +// VPSRLVQ xmm xmm xmm +// VPSRLVQ m128 xmm xmm +// VPSRLVQ ymm ymm ymm +// VPSRLVQ m256 ymm ymm +// Construct and append a VPSRLVQ instruction to the active function. +// Operates on the global context. +func VPSRLVQ(mxy, xy, xy1 operand.Op) { ctx.VPSRLVQ(mxy, xy, xy1) } + +// VPSRLW: Shift Packed Word Data Right Logical. +// +// Forms: +// +// VPSRLW imm8 xmm xmm +// VPSRLW xmm xmm xmm +// VPSRLW m128 xmm xmm +// VPSRLW imm8 ymm ymm +// VPSRLW xmm ymm ymm +// VPSRLW m128 ymm ymm +// Construct and append a VPSRLW instruction to the active function. +func (c *Context) VPSRLW(imx, xy, xy1 operand.Op) { + if inst, err := x86.VPSRLW(imx, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSRLW: Shift Packed Word Data Right Logical. +// +// Forms: +// +// VPSRLW imm8 xmm xmm +// VPSRLW xmm xmm xmm +// VPSRLW m128 xmm xmm +// VPSRLW imm8 ymm ymm +// VPSRLW xmm ymm ymm +// VPSRLW m128 ymm ymm +// Construct and append a VPSRLW instruction to the active function. +// Operates on the global context. +func VPSRLW(imx, xy, xy1 operand.Op) { ctx.VPSRLW(imx, xy, xy1) } + +// VPSUBB: Subtract Packed Byte Integers. +// +// Forms: +// +// VPSUBB xmm xmm xmm +// VPSUBB m128 xmm xmm +// VPSUBB ymm ymm ymm +// VPSUBB m256 ymm ymm +// Construct and append a VPSUBB instruction to the active function. +func (c *Context) VPSUBB(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSUBB(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSUBB: Subtract Packed Byte Integers. +// +// Forms: +// +// VPSUBB xmm xmm xmm +// VPSUBB m128 xmm xmm +// VPSUBB ymm ymm ymm +// VPSUBB m256 ymm ymm +// Construct and append a VPSUBB instruction to the active function. +// Operates on the global context. +func VPSUBB(mxy, xy, xy1 operand.Op) { ctx.VPSUBB(mxy, xy, xy1) } + +// VPSUBD: Subtract Packed Doubleword Integers. +// +// Forms: +// +// VPSUBD xmm xmm xmm +// VPSUBD m128 xmm xmm +// VPSUBD ymm ymm ymm +// VPSUBD m256 ymm ymm +// Construct and append a VPSUBD instruction to the active function. +func (c *Context) VPSUBD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSUBD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSUBD: Subtract Packed Doubleword Integers. +// +// Forms: +// +// VPSUBD xmm xmm xmm +// VPSUBD m128 xmm xmm +// VPSUBD ymm ymm ymm +// VPSUBD m256 ymm ymm +// Construct and append a VPSUBD instruction to the active function. +// Operates on the global context. +func VPSUBD(mxy, xy, xy1 operand.Op) { ctx.VPSUBD(mxy, xy, xy1) } + +// VPSUBQ: Subtract Packed Quadword Integers. +// +// Forms: +// +// VPSUBQ xmm xmm xmm +// VPSUBQ m128 xmm xmm +// VPSUBQ ymm ymm ymm +// VPSUBQ m256 ymm ymm +// Construct and append a VPSUBQ instruction to the active function. +func (c *Context) VPSUBQ(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSUBQ(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSUBQ: Subtract Packed Quadword Integers. +// +// Forms: +// +// VPSUBQ xmm xmm xmm +// VPSUBQ m128 xmm xmm +// VPSUBQ ymm ymm ymm +// VPSUBQ m256 ymm ymm +// Construct and append a VPSUBQ instruction to the active function. +// Operates on the global context. +func VPSUBQ(mxy, xy, xy1 operand.Op) { ctx.VPSUBQ(mxy, xy, xy1) } + +// VPSUBSB: Subtract Packed Signed Byte Integers with Signed Saturation. +// +// Forms: +// +// VPSUBSB xmm xmm xmm +// VPSUBSB m128 xmm xmm +// VPSUBSB ymm ymm ymm +// VPSUBSB m256 ymm ymm +// Construct and append a VPSUBSB instruction to the active function. +func (c *Context) VPSUBSB(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSUBSB(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSUBSB: Subtract Packed Signed Byte Integers with Signed Saturation. +// +// Forms: +// +// VPSUBSB xmm xmm xmm +// VPSUBSB m128 xmm xmm +// VPSUBSB ymm ymm ymm +// VPSUBSB m256 ymm ymm +// Construct and append a VPSUBSB instruction to the active function. +// Operates on the global context. +func VPSUBSB(mxy, xy, xy1 operand.Op) { ctx.VPSUBSB(mxy, xy, xy1) } + +// VPSUBSW: Subtract Packed Signed Word Integers with Signed Saturation. +// +// Forms: +// +// VPSUBSW xmm xmm xmm +// VPSUBSW m128 xmm xmm +// VPSUBSW ymm ymm ymm +// VPSUBSW m256 ymm ymm +// Construct and append a VPSUBSW instruction to the active function. +func (c *Context) VPSUBSW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSUBSW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSUBSW: Subtract Packed Signed Word Integers with Signed Saturation. +// +// Forms: +// +// VPSUBSW xmm xmm xmm +// VPSUBSW m128 xmm xmm +// VPSUBSW ymm ymm ymm +// VPSUBSW m256 ymm ymm +// Construct and append a VPSUBSW instruction to the active function. +// Operates on the global context. +func VPSUBSW(mxy, xy, xy1 operand.Op) { ctx.VPSUBSW(mxy, xy, xy1) } + +// VPSUBUSB: Subtract Packed Unsigned Byte Integers with Unsigned Saturation. +// +// Forms: +// +// VPSUBUSB xmm xmm xmm +// VPSUBUSB m128 xmm xmm +// VPSUBUSB ymm ymm ymm +// VPSUBUSB m256 ymm ymm +// Construct and append a VPSUBUSB instruction to the active function. +func (c *Context) VPSUBUSB(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSUBUSB(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSUBUSB: Subtract Packed Unsigned Byte Integers with Unsigned Saturation. +// +// Forms: +// +// VPSUBUSB xmm xmm xmm +// VPSUBUSB m128 xmm xmm +// VPSUBUSB ymm ymm ymm +// VPSUBUSB m256 ymm ymm +// Construct and append a VPSUBUSB instruction to the active function. +// Operates on the global context. +func VPSUBUSB(mxy, xy, xy1 operand.Op) { ctx.VPSUBUSB(mxy, xy, xy1) } + +// VPSUBUSW: Subtract Packed Unsigned Word Integers with Unsigned Saturation. +// +// Forms: +// +// VPSUBUSW xmm xmm xmm +// VPSUBUSW m128 xmm xmm +// VPSUBUSW ymm ymm ymm +// VPSUBUSW m256 ymm ymm +// Construct and append a VPSUBUSW instruction to the active function. +func (c *Context) VPSUBUSW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSUBUSW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSUBUSW: Subtract Packed Unsigned Word Integers with Unsigned Saturation. +// +// Forms: +// +// VPSUBUSW xmm xmm xmm +// VPSUBUSW m128 xmm xmm +// VPSUBUSW ymm ymm ymm +// VPSUBUSW m256 ymm ymm +// Construct and append a VPSUBUSW instruction to the active function. +// Operates on the global context. +func VPSUBUSW(mxy, xy, xy1 operand.Op) { ctx.VPSUBUSW(mxy, xy, xy1) } + +// VPSUBW: Subtract Packed Word Integers. +// +// Forms: +// +// VPSUBW xmm xmm xmm +// VPSUBW m128 xmm xmm +// VPSUBW ymm ymm ymm +// VPSUBW m256 ymm ymm +// Construct and append a VPSUBW instruction to the active function. +func (c *Context) VPSUBW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPSUBW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPSUBW: Subtract Packed Word Integers. +// +// Forms: +// +// VPSUBW xmm xmm xmm +// VPSUBW m128 xmm xmm +// VPSUBW ymm ymm ymm +// VPSUBW m256 ymm ymm +// Construct and append a VPSUBW instruction to the active function. +// Operates on the global context. +func VPSUBW(mxy, xy, xy1 operand.Op) { ctx.VPSUBW(mxy, xy, xy1) } + +// VPTEST: Packed Logical Compare. +// +// Forms: +// +// VPTEST xmm xmm +// VPTEST m128 xmm +// VPTEST ymm ymm +// VPTEST m256 ymm +// Construct and append a VPTEST instruction to the active function. +func (c *Context) VPTEST(mxy, xy operand.Op) { + if inst, err := x86.VPTEST(mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPTEST: Packed Logical Compare. +// +// Forms: +// +// VPTEST xmm xmm +// VPTEST m128 xmm +// VPTEST ymm ymm +// VPTEST m256 ymm +// Construct and append a VPTEST instruction to the active function. +// Operates on the global context. +func VPTEST(mxy, xy operand.Op) { ctx.VPTEST(mxy, xy) } + +// VPUNPCKHBW: Unpack and Interleave High-Order Bytes into Words. +// +// Forms: +// +// VPUNPCKHBW xmm xmm xmm +// VPUNPCKHBW m128 xmm xmm +// VPUNPCKHBW ymm ymm ymm +// VPUNPCKHBW m256 ymm ymm +// Construct and append a VPUNPCKHBW instruction to the active function. +func (c *Context) VPUNPCKHBW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPUNPCKHBW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPUNPCKHBW: Unpack and Interleave High-Order Bytes into Words. +// +// Forms: +// +// VPUNPCKHBW xmm xmm xmm +// VPUNPCKHBW m128 xmm xmm +// VPUNPCKHBW ymm ymm ymm +// VPUNPCKHBW m256 ymm ymm +// Construct and append a VPUNPCKHBW instruction to the active function. +// Operates on the global context. +func VPUNPCKHBW(mxy, xy, xy1 operand.Op) { ctx.VPUNPCKHBW(mxy, xy, xy1) } + +// VPUNPCKHDQ: Unpack and Interleave High-Order Doublewords into Quadwords. +// +// Forms: +// +// VPUNPCKHDQ xmm xmm xmm +// VPUNPCKHDQ m128 xmm xmm +// VPUNPCKHDQ ymm ymm ymm +// VPUNPCKHDQ m256 ymm ymm +// Construct and append a VPUNPCKHDQ instruction to the active function. +func (c *Context) VPUNPCKHDQ(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPUNPCKHDQ(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPUNPCKHDQ: Unpack and Interleave High-Order Doublewords into Quadwords. +// +// Forms: +// +// VPUNPCKHDQ xmm xmm xmm +// VPUNPCKHDQ m128 xmm xmm +// VPUNPCKHDQ ymm ymm ymm +// VPUNPCKHDQ m256 ymm ymm +// Construct and append a VPUNPCKHDQ instruction to the active function. +// Operates on the global context. +func VPUNPCKHDQ(mxy, xy, xy1 operand.Op) { ctx.VPUNPCKHDQ(mxy, xy, xy1) } + +// VPUNPCKHQDQ: Unpack and Interleave High-Order Quadwords into Double Quadwords. +// +// Forms: +// +// VPUNPCKHQDQ xmm xmm xmm +// VPUNPCKHQDQ m128 xmm xmm +// VPUNPCKHQDQ ymm ymm ymm +// VPUNPCKHQDQ m256 ymm ymm +// Construct and append a VPUNPCKHQDQ instruction to the active function. +func (c *Context) VPUNPCKHQDQ(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPUNPCKHQDQ(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPUNPCKHQDQ: Unpack and Interleave High-Order Quadwords into Double Quadwords. +// +// Forms: +// +// VPUNPCKHQDQ xmm xmm xmm +// VPUNPCKHQDQ m128 xmm xmm +// VPUNPCKHQDQ ymm ymm ymm +// VPUNPCKHQDQ m256 ymm ymm +// Construct and append a VPUNPCKHQDQ instruction to the active function. +// Operates on the global context. +func VPUNPCKHQDQ(mxy, xy, xy1 operand.Op) { ctx.VPUNPCKHQDQ(mxy, xy, xy1) } + +// VPUNPCKHWD: Unpack and Interleave High-Order Words into Doublewords. +// +// Forms: +// +// VPUNPCKHWD xmm xmm xmm +// VPUNPCKHWD m128 xmm xmm +// VPUNPCKHWD ymm ymm ymm +// VPUNPCKHWD m256 ymm ymm +// Construct and append a VPUNPCKHWD instruction to the active function. +func (c *Context) VPUNPCKHWD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPUNPCKHWD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPUNPCKHWD: Unpack and Interleave High-Order Words into Doublewords. +// +// Forms: +// +// VPUNPCKHWD xmm xmm xmm +// VPUNPCKHWD m128 xmm xmm +// VPUNPCKHWD ymm ymm ymm +// VPUNPCKHWD m256 ymm ymm +// Construct and append a VPUNPCKHWD instruction to the active function. +// Operates on the global context. +func VPUNPCKHWD(mxy, xy, xy1 operand.Op) { ctx.VPUNPCKHWD(mxy, xy, xy1) } + +// VPUNPCKLBW: Unpack and Interleave Low-Order Bytes into Words. +// +// Forms: +// +// VPUNPCKLBW xmm xmm xmm +// VPUNPCKLBW m128 xmm xmm +// VPUNPCKLBW ymm ymm ymm +// VPUNPCKLBW m256 ymm ymm +// Construct and append a VPUNPCKLBW instruction to the active function. +func (c *Context) VPUNPCKLBW(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPUNPCKLBW(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPUNPCKLBW: Unpack and Interleave Low-Order Bytes into Words. +// +// Forms: +// +// VPUNPCKLBW xmm xmm xmm +// VPUNPCKLBW m128 xmm xmm +// VPUNPCKLBW ymm ymm ymm +// VPUNPCKLBW m256 ymm ymm +// Construct and append a VPUNPCKLBW instruction to the active function. +// Operates on the global context. +func VPUNPCKLBW(mxy, xy, xy1 operand.Op) { ctx.VPUNPCKLBW(mxy, xy, xy1) } + +// VPUNPCKLDQ: Unpack and Interleave Low-Order Doublewords into Quadwords. +// +// Forms: +// +// VPUNPCKLDQ xmm xmm xmm +// VPUNPCKLDQ m128 xmm xmm +// VPUNPCKLDQ ymm ymm ymm +// VPUNPCKLDQ m256 ymm ymm +// Construct and append a VPUNPCKLDQ instruction to the active function. +func (c *Context) VPUNPCKLDQ(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPUNPCKLDQ(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPUNPCKLDQ: Unpack and Interleave Low-Order Doublewords into Quadwords. +// +// Forms: +// +// VPUNPCKLDQ xmm xmm xmm +// VPUNPCKLDQ m128 xmm xmm +// VPUNPCKLDQ ymm ymm ymm +// VPUNPCKLDQ m256 ymm ymm +// Construct and append a VPUNPCKLDQ instruction to the active function. +// Operates on the global context. +func VPUNPCKLDQ(mxy, xy, xy1 operand.Op) { ctx.VPUNPCKLDQ(mxy, xy, xy1) } + +// VPUNPCKLQDQ: Unpack and Interleave Low-Order Quadwords into Double Quadwords. +// +// Forms: +// +// VPUNPCKLQDQ xmm xmm xmm +// VPUNPCKLQDQ m128 xmm xmm +// VPUNPCKLQDQ ymm ymm ymm +// VPUNPCKLQDQ m256 ymm ymm +// Construct and append a VPUNPCKLQDQ instruction to the active function. +func (c *Context) VPUNPCKLQDQ(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPUNPCKLQDQ(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPUNPCKLQDQ: Unpack and Interleave Low-Order Quadwords into Double Quadwords. +// +// Forms: +// +// VPUNPCKLQDQ xmm xmm xmm +// VPUNPCKLQDQ m128 xmm xmm +// VPUNPCKLQDQ ymm ymm ymm +// VPUNPCKLQDQ m256 ymm ymm +// Construct and append a VPUNPCKLQDQ instruction to the active function. +// Operates on the global context. +func VPUNPCKLQDQ(mxy, xy, xy1 operand.Op) { ctx.VPUNPCKLQDQ(mxy, xy, xy1) } + +// VPUNPCKLWD: Unpack and Interleave Low-Order Words into Doublewords. +// +// Forms: +// +// VPUNPCKLWD xmm xmm xmm +// VPUNPCKLWD m128 xmm xmm +// VPUNPCKLWD ymm ymm ymm +// VPUNPCKLWD m256 ymm ymm +// Construct and append a VPUNPCKLWD instruction to the active function. +func (c *Context) VPUNPCKLWD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPUNPCKLWD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPUNPCKLWD: Unpack and Interleave Low-Order Words into Doublewords. +// +// Forms: +// +// VPUNPCKLWD xmm xmm xmm +// VPUNPCKLWD m128 xmm xmm +// VPUNPCKLWD ymm ymm ymm +// VPUNPCKLWD m256 ymm ymm +// Construct and append a VPUNPCKLWD instruction to the active function. +// Operates on the global context. +func VPUNPCKLWD(mxy, xy, xy1 operand.Op) { ctx.VPUNPCKLWD(mxy, xy, xy1) } + +// VPXOR: Packed Bitwise Logical Exclusive OR. +// +// Forms: +// +// VPXOR xmm xmm xmm +// VPXOR m128 xmm xmm +// VPXOR ymm ymm ymm +// VPXOR m256 ymm ymm +// Construct and append a VPXOR instruction to the active function. +func (c *Context) VPXOR(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VPXOR(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VPXOR: Packed Bitwise Logical Exclusive OR. +// +// Forms: +// +// VPXOR xmm xmm xmm +// VPXOR m128 xmm xmm +// VPXOR ymm ymm ymm +// VPXOR m256 ymm ymm +// Construct and append a VPXOR instruction to the active function. +// Operates on the global context. +func VPXOR(mxy, xy, xy1 operand.Op) { ctx.VPXOR(mxy, xy, xy1) } + +// VRCPPS: Compute Approximate Reciprocals of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VRCPPS xmm xmm +// VRCPPS m128 xmm +// VRCPPS ymm ymm +// VRCPPS m256 ymm +// Construct and append a VRCPPS instruction to the active function. +func (c *Context) VRCPPS(mxy, xy operand.Op) { + if inst, err := x86.VRCPPS(mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VRCPPS: Compute Approximate Reciprocals of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VRCPPS xmm xmm +// VRCPPS m128 xmm +// VRCPPS ymm ymm +// VRCPPS m256 ymm +// Construct and append a VRCPPS instruction to the active function. +// Operates on the global context. +func VRCPPS(mxy, xy operand.Op) { ctx.VRCPPS(mxy, xy) } + +// VRCPSS: Compute Approximate Reciprocal of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VRCPSS xmm xmm xmm +// VRCPSS m32 xmm xmm +// Construct and append a VRCPSS instruction to the active function. +func (c *Context) VRCPSS(mx, x, x1 operand.Op) { + if inst, err := x86.VRCPSS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VRCPSS: Compute Approximate Reciprocal of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VRCPSS xmm xmm xmm +// VRCPSS m32 xmm xmm +// Construct and append a VRCPSS instruction to the active function. +// Operates on the global context. +func VRCPSS(mx, x, x1 operand.Op) { ctx.VRCPSS(mx, x, x1) } + +// VROUNDPD: Round Packed Double Precision Floating-Point Values. +// +// Forms: +// +// VROUNDPD imm8 xmm xmm +// VROUNDPD imm8 m128 xmm +// VROUNDPD imm8 ymm ymm +// VROUNDPD imm8 m256 ymm +// Construct and append a VROUNDPD instruction to the active function. +func (c *Context) VROUNDPD(i, mxy, xy operand.Op) { + if inst, err := x86.VROUNDPD(i, mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VROUNDPD: Round Packed Double Precision Floating-Point Values. +// +// Forms: +// +// VROUNDPD imm8 xmm xmm +// VROUNDPD imm8 m128 xmm +// VROUNDPD imm8 ymm ymm +// VROUNDPD imm8 m256 ymm +// Construct and append a VROUNDPD instruction to the active function. +// Operates on the global context. +func VROUNDPD(i, mxy, xy operand.Op) { ctx.VROUNDPD(i, mxy, xy) } + +// VROUNDPS: Round Packed Single Precision Floating-Point Values. +// +// Forms: +// +// VROUNDPS imm8 xmm xmm +// VROUNDPS imm8 m128 xmm +// VROUNDPS imm8 ymm ymm +// VROUNDPS imm8 m256 ymm +// Construct and append a VROUNDPS instruction to the active function. +func (c *Context) VROUNDPS(i, mxy, xy operand.Op) { + if inst, err := x86.VROUNDPS(i, mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VROUNDPS: Round Packed Single Precision Floating-Point Values. +// +// Forms: +// +// VROUNDPS imm8 xmm xmm +// VROUNDPS imm8 m128 xmm +// VROUNDPS imm8 ymm ymm +// VROUNDPS imm8 m256 ymm +// Construct and append a VROUNDPS instruction to the active function. +// Operates on the global context. +func VROUNDPS(i, mxy, xy operand.Op) { ctx.VROUNDPS(i, mxy, xy) } + +// VROUNDSD: Round Scalar Double Precision Floating-Point Values. +// +// Forms: +// +// VROUNDSD imm8 xmm xmm xmm +// VROUNDSD imm8 m64 xmm xmm +// Construct and append a VROUNDSD instruction to the active function. +func (c *Context) VROUNDSD(i, mx, x, x1 operand.Op) { + if inst, err := x86.VROUNDSD(i, mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VROUNDSD: Round Scalar Double Precision Floating-Point Values. +// +// Forms: +// +// VROUNDSD imm8 xmm xmm xmm +// VROUNDSD imm8 m64 xmm xmm +// Construct and append a VROUNDSD instruction to the active function. +// Operates on the global context. +func VROUNDSD(i, mx, x, x1 operand.Op) { ctx.VROUNDSD(i, mx, x, x1) } + +// VROUNDSS: Round Scalar Single Precision Floating-Point Values. +// +// Forms: +// +// VROUNDSS imm8 xmm xmm xmm +// VROUNDSS imm8 m32 xmm xmm +// Construct and append a VROUNDSS instruction to the active function. +func (c *Context) VROUNDSS(i, mx, x, x1 operand.Op) { + if inst, err := x86.VROUNDSS(i, mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VROUNDSS: Round Scalar Single Precision Floating-Point Values. +// +// Forms: +// +// VROUNDSS imm8 xmm xmm xmm +// VROUNDSS imm8 m32 xmm xmm +// Construct and append a VROUNDSS instruction to the active function. +// Operates on the global context. +func VROUNDSS(i, mx, x, x1 operand.Op) { ctx.VROUNDSS(i, mx, x, x1) } + +// VRSQRTPS: Compute Reciprocals of Square Roots of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VRSQRTPS xmm xmm +// VRSQRTPS m128 xmm +// VRSQRTPS ymm ymm +// VRSQRTPS m256 ymm +// Construct and append a VRSQRTPS instruction to the active function. +func (c *Context) VRSQRTPS(mxy, xy operand.Op) { + if inst, err := x86.VRSQRTPS(mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VRSQRTPS: Compute Reciprocals of Square Roots of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VRSQRTPS xmm xmm +// VRSQRTPS m128 xmm +// VRSQRTPS ymm ymm +// VRSQRTPS m256 ymm +// Construct and append a VRSQRTPS instruction to the active function. +// Operates on the global context. +func VRSQRTPS(mxy, xy operand.Op) { ctx.VRSQRTPS(mxy, xy) } + +// VRSQRTSS: Compute Reciprocal of Square Root of Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// VRSQRTSS xmm xmm xmm +// VRSQRTSS m32 xmm xmm +// Construct and append a VRSQRTSS instruction to the active function. +func (c *Context) VRSQRTSS(mx, x, x1 operand.Op) { + if inst, err := x86.VRSQRTSS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VRSQRTSS: Compute Reciprocal of Square Root of Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// VRSQRTSS xmm xmm xmm +// VRSQRTSS m32 xmm xmm +// Construct and append a VRSQRTSS instruction to the active function. +// Operates on the global context. +func VRSQRTSS(mx, x, x1 operand.Op) { ctx.VRSQRTSS(mx, x, x1) } + +// VSHUFPD: Shuffle Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VSHUFPD imm8 xmm xmm xmm +// VSHUFPD imm8 m128 xmm xmm +// VSHUFPD imm8 ymm ymm ymm +// VSHUFPD imm8 m256 ymm ymm +// Construct and append a VSHUFPD instruction to the active function. +func (c *Context) VSHUFPD(i, mxy, xy, xy1 operand.Op) { + if inst, err := x86.VSHUFPD(i, mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VSHUFPD: Shuffle Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VSHUFPD imm8 xmm xmm xmm +// VSHUFPD imm8 m128 xmm xmm +// VSHUFPD imm8 ymm ymm ymm +// VSHUFPD imm8 m256 ymm ymm +// Construct and append a VSHUFPD instruction to the active function. +// Operates on the global context. +func VSHUFPD(i, mxy, xy, xy1 operand.Op) { ctx.VSHUFPD(i, mxy, xy, xy1) } + +// VSHUFPS: Shuffle Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VSHUFPS imm8 xmm xmm xmm +// VSHUFPS imm8 m128 xmm xmm +// VSHUFPS imm8 ymm ymm ymm +// VSHUFPS imm8 m256 ymm ymm +// Construct and append a VSHUFPS instruction to the active function. +func (c *Context) VSHUFPS(i, mxy, xy, xy1 operand.Op) { + if inst, err := x86.VSHUFPS(i, mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VSHUFPS: Shuffle Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VSHUFPS imm8 xmm xmm xmm +// VSHUFPS imm8 m128 xmm xmm +// VSHUFPS imm8 ymm ymm ymm +// VSHUFPS imm8 m256 ymm ymm +// Construct and append a VSHUFPS instruction to the active function. +// Operates on the global context. +func VSHUFPS(i, mxy, xy, xy1 operand.Op) { ctx.VSHUFPS(i, mxy, xy, xy1) } + +// VSQRTPD: Compute Square Roots of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VSQRTPD xmm xmm +// VSQRTPD m128 xmm +// VSQRTPD ymm ymm +// VSQRTPD m256 ymm +// Construct and append a VSQRTPD instruction to the active function. +func (c *Context) VSQRTPD(mxy, xy operand.Op) { + if inst, err := x86.VSQRTPD(mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VSQRTPD: Compute Square Roots of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VSQRTPD xmm xmm +// VSQRTPD m128 xmm +// VSQRTPD ymm ymm +// VSQRTPD m256 ymm +// Construct and append a VSQRTPD instruction to the active function. +// Operates on the global context. +func VSQRTPD(mxy, xy operand.Op) { ctx.VSQRTPD(mxy, xy) } + +// VSQRTPS: Compute Square Roots of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VSQRTPS xmm xmm +// VSQRTPS m128 xmm +// VSQRTPS ymm ymm +// VSQRTPS m256 ymm +// Construct and append a VSQRTPS instruction to the active function. +func (c *Context) VSQRTPS(mxy, xy operand.Op) { + if inst, err := x86.VSQRTPS(mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VSQRTPS: Compute Square Roots of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VSQRTPS xmm xmm +// VSQRTPS m128 xmm +// VSQRTPS ymm ymm +// VSQRTPS m256 ymm +// Construct and append a VSQRTPS instruction to the active function. +// Operates on the global context. +func VSQRTPS(mxy, xy operand.Op) { ctx.VSQRTPS(mxy, xy) } + +// VSQRTSD: Compute Square Root of Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// VSQRTSD xmm xmm xmm +// VSQRTSD m64 xmm xmm +// Construct and append a VSQRTSD instruction to the active function. +func (c *Context) VSQRTSD(mx, x, x1 operand.Op) { + if inst, err := x86.VSQRTSD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VSQRTSD: Compute Square Root of Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// VSQRTSD xmm xmm xmm +// VSQRTSD m64 xmm xmm +// Construct and append a VSQRTSD instruction to the active function. +// Operates on the global context. +func VSQRTSD(mx, x, x1 operand.Op) { ctx.VSQRTSD(mx, x, x1) } + +// VSQRTSS: Compute Square Root of Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// VSQRTSS xmm xmm xmm +// VSQRTSS m32 xmm xmm +// Construct and append a VSQRTSS instruction to the active function. +func (c *Context) VSQRTSS(mx, x, x1 operand.Op) { + if inst, err := x86.VSQRTSS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VSQRTSS: Compute Square Root of Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// VSQRTSS xmm xmm xmm +// VSQRTSS m32 xmm xmm +// Construct and append a VSQRTSS instruction to the active function. +// Operates on the global context. +func VSQRTSS(mx, x, x1 operand.Op) { ctx.VSQRTSS(mx, x, x1) } + +// VSTMXCSR: Store MXCSR Register State. +// +// Forms: +// +// VSTMXCSR m32 +// Construct and append a VSTMXCSR instruction to the active function. +func (c *Context) VSTMXCSR(m operand.Op) { + if inst, err := x86.VSTMXCSR(m); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VSTMXCSR: Store MXCSR Register State. +// +// Forms: +// +// VSTMXCSR m32 +// Construct and append a VSTMXCSR instruction to the active function. +// Operates on the global context. +func VSTMXCSR(m operand.Op) { ctx.VSTMXCSR(m) } + +// VSUBPD: Subtract Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VSUBPD xmm xmm xmm +// VSUBPD m128 xmm xmm +// VSUBPD ymm ymm ymm +// VSUBPD m256 ymm ymm +// Construct and append a VSUBPD instruction to the active function. +func (c *Context) VSUBPD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VSUBPD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VSUBPD: Subtract Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VSUBPD xmm xmm xmm +// VSUBPD m128 xmm xmm +// VSUBPD ymm ymm ymm +// VSUBPD m256 ymm ymm +// Construct and append a VSUBPD instruction to the active function. +// Operates on the global context. +func VSUBPD(mxy, xy, xy1 operand.Op) { ctx.VSUBPD(mxy, xy, xy1) } + +// VSUBPS: Subtract Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VSUBPS xmm xmm xmm +// VSUBPS m128 xmm xmm +// VSUBPS ymm ymm ymm +// VSUBPS m256 ymm ymm +// Construct and append a VSUBPS instruction to the active function. +func (c *Context) VSUBPS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VSUBPS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VSUBPS: Subtract Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VSUBPS xmm xmm xmm +// VSUBPS m128 xmm xmm +// VSUBPS ymm ymm ymm +// VSUBPS m256 ymm ymm +// Construct and append a VSUBPS instruction to the active function. +// Operates on the global context. +func VSUBPS(mxy, xy, xy1 operand.Op) { ctx.VSUBPS(mxy, xy, xy1) } + +// VSUBSD: Subtract Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VSUBSD xmm xmm xmm +// VSUBSD m64 xmm xmm +// Construct and append a VSUBSD instruction to the active function. +func (c *Context) VSUBSD(mx, x, x1 operand.Op) { + if inst, err := x86.VSUBSD(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VSUBSD: Subtract Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VSUBSD xmm xmm xmm +// VSUBSD m64 xmm xmm +// Construct and append a VSUBSD instruction to the active function. +// Operates on the global context. +func VSUBSD(mx, x, x1 operand.Op) { ctx.VSUBSD(mx, x, x1) } + +// VSUBSS: Subtract Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VSUBSS xmm xmm xmm +// VSUBSS m32 xmm xmm +// Construct and append a VSUBSS instruction to the active function. +func (c *Context) VSUBSS(mx, x, x1 operand.Op) { + if inst, err := x86.VSUBSS(mx, x, x1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VSUBSS: Subtract Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VSUBSS xmm xmm xmm +// VSUBSS m32 xmm xmm +// Construct and append a VSUBSS instruction to the active function. +// Operates on the global context. +func VSUBSS(mx, x, x1 operand.Op) { ctx.VSUBSS(mx, x, x1) } + +// VTESTPD: Packed Double-Precision Floating-Point Bit Test. +// +// Forms: +// +// VTESTPD xmm xmm +// VTESTPD m128 xmm +// VTESTPD ymm ymm +// VTESTPD m256 ymm +// Construct and append a VTESTPD instruction to the active function. +func (c *Context) VTESTPD(mxy, xy operand.Op) { + if inst, err := x86.VTESTPD(mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VTESTPD: Packed Double-Precision Floating-Point Bit Test. +// +// Forms: +// +// VTESTPD xmm xmm +// VTESTPD m128 xmm +// VTESTPD ymm ymm +// VTESTPD m256 ymm +// Construct and append a VTESTPD instruction to the active function. +// Operates on the global context. +func VTESTPD(mxy, xy operand.Op) { ctx.VTESTPD(mxy, xy) } + +// VTESTPS: Packed Single-Precision Floating-Point Bit Test. +// +// Forms: +// +// VTESTPS xmm xmm +// VTESTPS m128 xmm +// VTESTPS ymm ymm +// VTESTPS m256 ymm +// Construct and append a VTESTPS instruction to the active function. +func (c *Context) VTESTPS(mxy, xy operand.Op) { + if inst, err := x86.VTESTPS(mxy, xy); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VTESTPS: Packed Single-Precision Floating-Point Bit Test. +// +// Forms: +// +// VTESTPS xmm xmm +// VTESTPS m128 xmm +// VTESTPS ymm ymm +// VTESTPS m256 ymm +// Construct and append a VTESTPS instruction to the active function. +// Operates on the global context. +func VTESTPS(mxy, xy operand.Op) { ctx.VTESTPS(mxy, xy) } + +// VUCOMISD: Unordered Compare Scalar Double-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// VUCOMISD xmm xmm +// VUCOMISD m64 xmm +// Construct and append a VUCOMISD instruction to the active function. +func (c *Context) VUCOMISD(mx, x operand.Op) { + if inst, err := x86.VUCOMISD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VUCOMISD: Unordered Compare Scalar Double-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// VUCOMISD xmm xmm +// VUCOMISD m64 xmm +// Construct and append a VUCOMISD instruction to the active function. +// Operates on the global context. +func VUCOMISD(mx, x operand.Op) { ctx.VUCOMISD(mx, x) } + +// VUCOMISS: Unordered Compare Scalar Single-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// VUCOMISS xmm xmm +// VUCOMISS m32 xmm +// Construct and append a VUCOMISS instruction to the active function. +func (c *Context) VUCOMISS(mx, x operand.Op) { + if inst, err := x86.VUCOMISS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VUCOMISS: Unordered Compare Scalar Single-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// VUCOMISS xmm xmm +// VUCOMISS m32 xmm +// Construct and append a VUCOMISS instruction to the active function. +// Operates on the global context. +func VUCOMISS(mx, x operand.Op) { ctx.VUCOMISS(mx, x) } + +// VUNPCKHPD: Unpack and Interleave High Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VUNPCKHPD xmm xmm xmm +// VUNPCKHPD m128 xmm xmm +// VUNPCKHPD ymm ymm ymm +// VUNPCKHPD m256 ymm ymm +// Construct and append a VUNPCKHPD instruction to the active function. +func (c *Context) VUNPCKHPD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VUNPCKHPD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VUNPCKHPD: Unpack and Interleave High Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VUNPCKHPD xmm xmm xmm +// VUNPCKHPD m128 xmm xmm +// VUNPCKHPD ymm ymm ymm +// VUNPCKHPD m256 ymm ymm +// Construct and append a VUNPCKHPD instruction to the active function. +// Operates on the global context. +func VUNPCKHPD(mxy, xy, xy1 operand.Op) { ctx.VUNPCKHPD(mxy, xy, xy1) } + +// VUNPCKHPS: Unpack and Interleave High Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VUNPCKHPS xmm xmm xmm +// VUNPCKHPS m128 xmm xmm +// VUNPCKHPS ymm ymm ymm +// VUNPCKHPS m256 ymm ymm +// Construct and append a VUNPCKHPS instruction to the active function. +func (c *Context) VUNPCKHPS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VUNPCKHPS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VUNPCKHPS: Unpack and Interleave High Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VUNPCKHPS xmm xmm xmm +// VUNPCKHPS m128 xmm xmm +// VUNPCKHPS ymm ymm ymm +// VUNPCKHPS m256 ymm ymm +// Construct and append a VUNPCKHPS instruction to the active function. +// Operates on the global context. +func VUNPCKHPS(mxy, xy, xy1 operand.Op) { ctx.VUNPCKHPS(mxy, xy, xy1) } + +// VUNPCKLPD: Unpack and Interleave Low Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VUNPCKLPD xmm xmm xmm +// VUNPCKLPD m128 xmm xmm +// VUNPCKLPD ymm ymm ymm +// VUNPCKLPD m256 ymm ymm +// Construct and append a VUNPCKLPD instruction to the active function. +func (c *Context) VUNPCKLPD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VUNPCKLPD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VUNPCKLPD: Unpack and Interleave Low Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VUNPCKLPD xmm xmm xmm +// VUNPCKLPD m128 xmm xmm +// VUNPCKLPD ymm ymm ymm +// VUNPCKLPD m256 ymm ymm +// Construct and append a VUNPCKLPD instruction to the active function. +// Operates on the global context. +func VUNPCKLPD(mxy, xy, xy1 operand.Op) { ctx.VUNPCKLPD(mxy, xy, xy1) } + +// VUNPCKLPS: Unpack and Interleave Low Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VUNPCKLPS xmm xmm xmm +// VUNPCKLPS m128 xmm xmm +// VUNPCKLPS ymm ymm ymm +// VUNPCKLPS m256 ymm ymm +// Construct and append a VUNPCKLPS instruction to the active function. +func (c *Context) VUNPCKLPS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VUNPCKLPS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VUNPCKLPS: Unpack and Interleave Low Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VUNPCKLPS xmm xmm xmm +// VUNPCKLPS m128 xmm xmm +// VUNPCKLPS ymm ymm ymm +// VUNPCKLPS m256 ymm ymm +// Construct and append a VUNPCKLPS instruction to the active function. +// Operates on the global context. +func VUNPCKLPS(mxy, xy, xy1 operand.Op) { ctx.VUNPCKLPS(mxy, xy, xy1) } + +// VXORPD: Bitwise Logical XOR for Double-Precision Floating-Point Values. +// +// Forms: +// +// VXORPD xmm xmm xmm +// VXORPD m128 xmm xmm +// VXORPD ymm ymm ymm +// VXORPD m256 ymm ymm +// Construct and append a VXORPD instruction to the active function. +func (c *Context) VXORPD(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VXORPD(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VXORPD: Bitwise Logical XOR for Double-Precision Floating-Point Values. +// +// Forms: +// +// VXORPD xmm xmm xmm +// VXORPD m128 xmm xmm +// VXORPD ymm ymm ymm +// VXORPD m256 ymm ymm +// Construct and append a VXORPD instruction to the active function. +// Operates on the global context. +func VXORPD(mxy, xy, xy1 operand.Op) { ctx.VXORPD(mxy, xy, xy1) } + +// VXORPS: Bitwise Logical XOR for Single-Precision Floating-Point Values. +// +// Forms: +// +// VXORPS xmm xmm xmm +// VXORPS m128 xmm xmm +// VXORPS ymm ymm ymm +// VXORPS m256 ymm ymm +// Construct and append a VXORPS instruction to the active function. +func (c *Context) VXORPS(mxy, xy, xy1 operand.Op) { + if inst, err := x86.VXORPS(mxy, xy, xy1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VXORPS: Bitwise Logical XOR for Single-Precision Floating-Point Values. +// +// Forms: +// +// VXORPS xmm xmm xmm +// VXORPS m128 xmm xmm +// VXORPS ymm ymm ymm +// VXORPS m256 ymm ymm +// Construct and append a VXORPS instruction to the active function. +// Operates on the global context. +func VXORPS(mxy, xy, xy1 operand.Op) { ctx.VXORPS(mxy, xy, xy1) } + +// VZEROALL: Zero All YMM Registers. +// +// Forms: +// +// VZEROALL +// Construct and append a VZEROALL instruction to the active function. +func (c *Context) VZEROALL() { + if inst, err := x86.VZEROALL(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VZEROALL: Zero All YMM Registers. +// +// Forms: +// +// VZEROALL +// Construct and append a VZEROALL instruction to the active function. +// Operates on the global context. +func VZEROALL() { ctx.VZEROALL() } + +// VZEROUPPER: Zero Upper Bits of YMM Registers. +// +// Forms: +// +// VZEROUPPER +// Construct and append a VZEROUPPER instruction to the active function. +func (c *Context) VZEROUPPER() { + if inst, err := x86.VZEROUPPER(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// VZEROUPPER: Zero Upper Bits of YMM Registers. +// +// Forms: +// +// VZEROUPPER +// Construct and append a VZEROUPPER instruction to the active function. +// Operates on the global context. +func VZEROUPPER() { ctx.VZEROUPPER() } + +// XADDB: Exchange and Add. +// +// Forms: +// +// XADDB r8 r8 +// XADDB r8 m8 +// Construct and append a XADDB instruction to the active function. +func (c *Context) XADDB(r, mr operand.Op) { + if inst, err := x86.XADDB(r, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// XADDB: Exchange and Add. +// +// Forms: +// +// XADDB r8 r8 +// XADDB r8 m8 +// Construct and append a XADDB instruction to the active function. +// Operates on the global context. +func XADDB(r, mr operand.Op) { ctx.XADDB(r, mr) } + +// XADDL: Exchange and Add. +// +// Forms: +// +// XADDL r32 r32 +// XADDL r32 m32 +// Construct and append a XADDL instruction to the active function. +func (c *Context) XADDL(r, mr operand.Op) { + if inst, err := x86.XADDL(r, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// XADDL: Exchange and Add. +// +// Forms: +// +// XADDL r32 r32 +// XADDL r32 m32 +// Construct and append a XADDL instruction to the active function. +// Operates on the global context. +func XADDL(r, mr operand.Op) { ctx.XADDL(r, mr) } + +// XADDQ: Exchange and Add. +// +// Forms: +// +// XADDQ r64 r64 +// XADDQ r64 m64 +// Construct and append a XADDQ instruction to the active function. +func (c *Context) XADDQ(r, mr operand.Op) { + if inst, err := x86.XADDQ(r, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// XADDQ: Exchange and Add. +// +// Forms: +// +// XADDQ r64 r64 +// XADDQ r64 m64 +// Construct and append a XADDQ instruction to the active function. +// Operates on the global context. +func XADDQ(r, mr operand.Op) { ctx.XADDQ(r, mr) } + +// XADDW: Exchange and Add. +// +// Forms: +// +// XADDW r16 r16 +// XADDW r16 m16 +// Construct and append a XADDW instruction to the active function. +func (c *Context) XADDW(r, mr operand.Op) { + if inst, err := x86.XADDW(r, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// XADDW: Exchange and Add. +// +// Forms: +// +// XADDW r16 r16 +// XADDW r16 m16 +// Construct and append a XADDW instruction to the active function. +// Operates on the global context. +func XADDW(r, mr operand.Op) { ctx.XADDW(r, mr) } + +// XCHGB: Exchange Register/Memory with Register. +// +// Forms: +// +// XCHGB r8 r8 +// XCHGB m8 r8 +// XCHGB r8 m8 +// Construct and append a XCHGB instruction to the active function. +func (c *Context) XCHGB(mr, mr1 operand.Op) { + if inst, err := x86.XCHGB(mr, mr1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// XCHGB: Exchange Register/Memory with Register. +// +// Forms: +// +// XCHGB r8 r8 +// XCHGB m8 r8 +// XCHGB r8 m8 +// Construct and append a XCHGB instruction to the active function. +// Operates on the global context. +func XCHGB(mr, mr1 operand.Op) { ctx.XCHGB(mr, mr1) } + +// XCHGL: Exchange Register/Memory with Register. +// +// Forms: +// +// XCHGL r32 eax +// XCHGL eax r32 +// XCHGL r32 r32 +// XCHGL m32 r32 +// XCHGL r32 m32 +// Construct and append a XCHGL instruction to the active function. +func (c *Context) XCHGL(emr, emr1 operand.Op) { + if inst, err := x86.XCHGL(emr, emr1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// XCHGL: Exchange Register/Memory with Register. +// +// Forms: +// +// XCHGL r32 eax +// XCHGL eax r32 +// XCHGL r32 r32 +// XCHGL m32 r32 +// XCHGL r32 m32 +// Construct and append a XCHGL instruction to the active function. +// Operates on the global context. +func XCHGL(emr, emr1 operand.Op) { ctx.XCHGL(emr, emr1) } + +// XCHGQ: Exchange Register/Memory with Register. +// +// Forms: +// +// XCHGQ r64 rax +// XCHGQ rax r64 +// XCHGQ r64 r64 +// XCHGQ m64 r64 +// XCHGQ r64 m64 +// Construct and append a XCHGQ instruction to the active function. +func (c *Context) XCHGQ(mr, mr1 operand.Op) { + if inst, err := x86.XCHGQ(mr, mr1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// XCHGQ: Exchange Register/Memory with Register. +// +// Forms: +// +// XCHGQ r64 rax +// XCHGQ rax r64 +// XCHGQ r64 r64 +// XCHGQ m64 r64 +// XCHGQ r64 m64 +// Construct and append a XCHGQ instruction to the active function. +// Operates on the global context. +func XCHGQ(mr, mr1 operand.Op) { ctx.XCHGQ(mr, mr1) } + +// XCHGW: Exchange Register/Memory with Register. +// +// Forms: +// +// XCHGW r16 ax +// XCHGW ax r16 +// XCHGW r16 r16 +// XCHGW m16 r16 +// XCHGW r16 m16 +// Construct and append a XCHGW instruction to the active function. +func (c *Context) XCHGW(amr, amr1 operand.Op) { + if inst, err := x86.XCHGW(amr, amr1); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// XCHGW: Exchange Register/Memory with Register. +// +// Forms: +// +// XCHGW r16 ax +// XCHGW ax r16 +// XCHGW r16 r16 +// XCHGW m16 r16 +// XCHGW r16 m16 +// Construct and append a XCHGW instruction to the active function. +// Operates on the global context. +func XCHGW(amr, amr1 operand.Op) { ctx.XCHGW(amr, amr1) } + +// XGETBV: Get Value of Extended Control Register. +// +// Forms: +// +// XGETBV +// Construct and append a XGETBV instruction to the active function. +func (c *Context) XGETBV() { + if inst, err := x86.XGETBV(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// XGETBV: Get Value of Extended Control Register. +// +// Forms: +// +// XGETBV +// Construct and append a XGETBV instruction to the active function. +// Operates on the global context. +func XGETBV() { ctx.XGETBV() } + +// XLAT: Table Look-up Translation. +// +// Forms: +// +// XLAT +// Construct and append a XLAT instruction to the active function. +func (c *Context) XLAT() { + if inst, err := x86.XLAT(); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// XLAT: Table Look-up Translation. +// +// Forms: +// +// XLAT +// Construct and append a XLAT instruction to the active function. +// Operates on the global context. +func XLAT() { ctx.XLAT() } + +// XORB: Logical Exclusive OR. +// +// Forms: +// +// XORB imm8 al +// XORB imm8 r8 +// XORB r8 r8 +// XORB m8 r8 +// XORB imm8 m8 +// XORB r8 m8 +// Construct and append a XORB instruction to the active function. +func (c *Context) XORB(imr, amr operand.Op) { + if inst, err := x86.XORB(imr, amr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// XORB: Logical Exclusive OR. +// +// Forms: +// +// XORB imm8 al +// XORB imm8 r8 +// XORB r8 r8 +// XORB m8 r8 +// XORB imm8 m8 +// XORB r8 m8 +// Construct and append a XORB instruction to the active function. +// Operates on the global context. +func XORB(imr, amr operand.Op) { ctx.XORB(imr, amr) } + +// XORL: Logical Exclusive OR. +// +// Forms: +// +// XORL imm32 eax +// XORL imm8 r32 +// XORL imm32 r32 +// XORL r32 r32 +// XORL m32 r32 +// XORL imm8 m32 +// XORL imm32 m32 +// XORL r32 m32 +// Construct and append a XORL instruction to the active function. +func (c *Context) XORL(imr, emr operand.Op) { + if inst, err := x86.XORL(imr, emr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// XORL: Logical Exclusive OR. +// +// Forms: +// +// XORL imm32 eax +// XORL imm8 r32 +// XORL imm32 r32 +// XORL r32 r32 +// XORL m32 r32 +// XORL imm8 m32 +// XORL imm32 m32 +// XORL r32 m32 +// Construct and append a XORL instruction to the active function. +// Operates on the global context. +func XORL(imr, emr operand.Op) { ctx.XORL(imr, emr) } + +// XORPD: Bitwise Logical XOR for Double-Precision Floating-Point Values. +// +// Forms: +// +// XORPD xmm xmm +// XORPD m128 xmm +// Construct and append a XORPD instruction to the active function. +func (c *Context) XORPD(mx, x operand.Op) { + if inst, err := x86.XORPD(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// XORPD: Bitwise Logical XOR for Double-Precision Floating-Point Values. +// +// Forms: +// +// XORPD xmm xmm +// XORPD m128 xmm +// Construct and append a XORPD instruction to the active function. +// Operates on the global context. +func XORPD(mx, x operand.Op) { ctx.XORPD(mx, x) } + +// XORPS: Bitwise Logical XOR for Single-Precision Floating-Point Values. +// +// Forms: +// +// XORPS xmm xmm +// XORPS m128 xmm +// Construct and append a XORPS instruction to the active function. +func (c *Context) XORPS(mx, x operand.Op) { + if inst, err := x86.XORPS(mx, x); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// XORPS: Bitwise Logical XOR for Single-Precision Floating-Point Values. +// +// Forms: +// +// XORPS xmm xmm +// XORPS m128 xmm +// Construct and append a XORPS instruction to the active function. +// Operates on the global context. +func XORPS(mx, x operand.Op) { ctx.XORPS(mx, x) } + +// XORQ: Logical Exclusive OR. +// +// Forms: +// +// XORQ imm32 rax +// XORQ imm8 r64 +// XORQ imm32 r64 +// XORQ r64 r64 +// XORQ m64 r64 +// XORQ imm8 m64 +// XORQ imm32 m64 +// XORQ r64 m64 +// Construct and append a XORQ instruction to the active function. +func (c *Context) XORQ(imr, mr operand.Op) { + if inst, err := x86.XORQ(imr, mr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// XORQ: Logical Exclusive OR. +// +// Forms: +// +// XORQ imm32 rax +// XORQ imm8 r64 +// XORQ imm32 r64 +// XORQ r64 r64 +// XORQ m64 r64 +// XORQ imm8 m64 +// XORQ imm32 m64 +// XORQ r64 m64 +// Construct and append a XORQ instruction to the active function. +// Operates on the global context. +func XORQ(imr, mr operand.Op) { ctx.XORQ(imr, mr) } + +// XORW: Logical Exclusive OR. +// +// Forms: +// +// XORW imm16 ax +// XORW imm8 r16 +// XORW imm16 r16 +// XORW r16 r16 +// XORW m16 r16 +// XORW imm8 m16 +// XORW imm16 m16 +// XORW r16 m16 +// Construct and append a XORW instruction to the active function. +func (c *Context) XORW(imr, amr operand.Op) { + if inst, err := x86.XORW(imr, amr); err == nil { + c.Instruction(inst) + } else { + c.adderror(err) + } +} + +// XORW: Logical Exclusive OR. +// +// Forms: +// +// XORW imm16 ax +// XORW imm8 r16 +// XORW imm16 r16 +// XORW r16 r16 +// XORW m16 r16 +// XORW imm8 m16 +// XORW imm16 m16 +// XORW r16 m16 +// Construct and append a XORW instruction to the active function. +// Operates on the global context. +func XORW(imr, amr operand.Op) { ctx.XORW(imr, amr) } diff --git a/vendor/github.com/mmcloughlin/avo/build/zmov.go b/vendor/github.com/mmcloughlin/avo/build/zmov.go new file mode 100644 index 0000000000..ca9bb5542c --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/build/zmov.go @@ -0,0 +1,72 @@ +// Code generated by command: avogen -output zmov.go mov. DO NOT EDIT. + +package build + +import ( + "go/types" + + "github.com/mmcloughlin/avo/operand" +) + +func (c *Context) mov(a, b operand.Op, an, bn int, t *types.Basic) { + switch { + case (t.Info()&types.IsInteger) != 0 && an == 1 && bn == 1: + c.MOVB(a, b) + case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 1 && bn == 4: + c.MOVBLSX(a, b) + case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 1 && bn == 4: + c.MOVBLZX(a, b) + case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 1 && bn == 8: + c.MOVBQSX(a, b) + case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 1 && bn == 8: + c.MOVBQZX(a, b) + case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 1 && bn == 2: + c.MOVBWSX(a, b) + case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 1 && bn == 2: + c.MOVBWZX(a, b) + case (t.Info()&types.IsInteger) != 0 && an == 4 && bn == 4: + c.MOVL(a, b) + case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 4 && bn == 8: + c.MOVLQSX(a, b) + case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 4 && bn == 8: + c.MOVLQZX(a, b) + case (t.Info()&types.IsInteger) != 0 && an == 16 && bn == 16: + c.MOVOU(a, b) + case (t.Info()&types.IsInteger) != 0 && an == 4 && bn == 16: + c.MOVQ(a, b) + case (t.Info()&types.IsInteger) != 0 && an == 8 && bn == 8: + c.MOVQ(a, b) + case (t.Info()&types.IsInteger) != 0 && an == 8 && bn == 16: + c.MOVQ(a, b) + case (t.Info()&types.IsInteger) != 0 && an == 16 && bn == 4: + c.MOVQ(a, b) + case (t.Info()&types.IsInteger) != 0 && an == 16 && bn == 8: + c.MOVQ(a, b) + case (t.Info()&types.IsInteger) != 0 && an == 16 && bn == 16: + c.MOVQ(a, b) + case (t.Info()&types.IsFloat) != 0 && an == 8 && bn == 16: + c.MOVSD(a, b) + case (t.Info()&types.IsFloat) != 0 && an == 16 && bn == 8: + c.MOVSD(a, b) + case (t.Info()&types.IsFloat) != 0 && an == 16 && bn == 16: + c.MOVSD(a, b) + case (t.Info()&types.IsFloat) != 0 && an == 4 && bn == 16: + c.MOVSS(a, b) + case (t.Info()&types.IsFloat) != 0 && an == 16 && bn == 4: + c.MOVSS(a, b) + case (t.Info()&types.IsFloat) != 0 && an == 16 && bn == 16: + c.MOVSS(a, b) + case (t.Info()&types.IsInteger) != 0 && an == 2 && bn == 2: + c.MOVW(a, b) + case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 2 && bn == 4: + c.MOVWLSX(a, b) + case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 2 && bn == 4: + c.MOVWLZX(a, b) + case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) == 0 && an == 2 && bn == 8: + c.MOVWQSX(a, b) + case (t.Info()&types.IsInteger) != 0 && (t.Info()&types.IsUnsigned) != 0 && an == 2 && bn == 8: + c.MOVWQZX(a, b) + default: + c.adderrormessage("could not deduce mov instruction") + } +} diff --git a/vendor/github.com/mmcloughlin/avo/buildtags/buildtags.go b/vendor/github.com/mmcloughlin/avo/buildtags/buildtags.go new file mode 100644 index 0000000000..8fd61e10d3 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/buildtags/buildtags.go @@ -0,0 +1,312 @@ +// Package buildtags provides types for representing and manipulating build constraints. +// +// In Go, build constraints are represented as comments in source code together with file naming conventions. For example +// +// // +build linux,386 darwin,!cgo +// // +build !purego +// +// Any terms provided in the filename can be thought of as an implicit extra +// constraint comment line. Collectively, these are referred to as +// ``constraints''. Each line is a ``constraint''. Within each constraint the +// space-separated terms are ``options'', and within that the comma-separated +// items are ``terms'' which may be negated with at most one exclaimation mark. +// +// These represent a boolean formulae. The constraints are evaluated as the AND +// of constraint lines; a constraint is evaluated as the OR of its options and +// an option is evaluated as the AND of its terms. Overall build constraints are +// a boolean formula that is an AND of ORs of ANDs. +// +// This level of complexity is rarely used in Go programs. Therefore this +// package aims to provide access to all these layers of nesting if required, +// but make it easy to forget about for basic use cases too. +package buildtags + +import ( + "errors" + "fmt" + "strings" + "unicode" +) + +// Reference: https://github.com/golang/go/blob/204a8f55dc2e0ac8d27a781dab0da609b98560da/src/go/build/doc.go#L73-L92 +// +// // A build constraint is evaluated as the OR of space-separated options; +// // each option evaluates as the AND of its comma-separated terms; +// // and each term is an alphanumeric word or, preceded by !, its negation. +// // That is, the build constraint: +// // +// // // +build linux,386 darwin,!cgo +// // +// // corresponds to the boolean formula: +// // +// // (linux AND 386) OR (darwin AND (NOT cgo)) +// // +// // A file may have multiple build constraints. The overall constraint is the AND +// // of the individual constraints. That is, the build constraints: +// // +// // // +build linux darwin +// // // +build 386 +// // +// // corresponds to the boolean formula: +// // +// // (linux OR darwin) AND 386 +// + +// Interface represents a build constraint. +type Interface interface { + ConstraintsConvertable + fmt.GoStringer + Evaluate(v map[string]bool) bool + Validate() error +} + +// ConstraintsConvertable can be converted to a Constraints object. +type ConstraintsConvertable interface { + ToConstraints() Constraints +} + +// ConstraintConvertable can be converted to a Constraint. +type ConstraintConvertable interface { + ToConstraint() Constraint +} + +// OptionConvertable can be converted to an Option. +type OptionConvertable interface { + ToOption() Option +} + +// Constraints represents the AND of a list of Constraint lines. +type Constraints []Constraint + +// And builds Constraints that will be true if all of its constraints are true. +func And(cs ...ConstraintConvertable) Constraints { + constraints := Constraints{} + for _, c := range cs { + constraints = append(constraints, c.ToConstraint()) + } + return constraints +} + +// ToConstraints returns cs. +func (cs Constraints) ToConstraints() Constraints { return cs } + +// Validate validates the constraints set. +func (cs Constraints) Validate() error { + for _, c := range cs { + if err := c.Validate(); err != nil { + return err + } + } + return nil +} + +// Evaluate the boolean formula represented by cs under the given assignment of +// tag values. This is the AND of the values of the constituent Constraints. +func (cs Constraints) Evaluate(v map[string]bool) bool { + r := true + for _, c := range cs { + r = r && c.Evaluate(v) + } + return r +} + +// GoString represents Constraints as +build comment lines. +func (cs Constraints) GoString() string { + s := "" + for _, c := range cs { + s += c.GoString() + } + return s +} + +// Constraint represents the OR of a list of Options. +type Constraint []Option + +// Any builds a Constraint that will be true if any of its options are true. +func Any(opts ...OptionConvertable) Constraint { + c := Constraint{} + for _, opt := range opts { + c = append(c, opt.ToOption()) + } + return c +} + +// ParseConstraint parses a space-separated list of options. +func ParseConstraint(expr string) (Constraint, error) { + c := Constraint{} + for _, field := range strings.Fields(expr) { + opt, err := ParseOption(field) + if err != nil { + return c, err + } + c = append(c, opt) + } + return c, nil +} + +// ToConstraints returns the list of constraints containing just c. +func (c Constraint) ToConstraints() Constraints { return Constraints{c} } + +// ToConstraint returns c. +func (c Constraint) ToConstraint() Constraint { return c } + +// Validate validates the constraint. +func (c Constraint) Validate() error { + for _, o := range c { + if err := o.Validate(); err != nil { + return err + } + } + return nil +} + +// Evaluate the boolean formula represented by c under the given assignment of +// tag values. This is the OR of the values of the constituent Options. +func (c Constraint) Evaluate(v map[string]bool) bool { + r := false + for _, o := range c { + r = r || o.Evaluate(v) + } + return r +} + +// GoString represents the Constraint as one +build comment line. +func (c Constraint) GoString() string { + s := "// +build" + for _, o := range c { + s += " " + o.GoString() + } + return s + "\n" +} + +// Option represents the AND of a list of Terms. +type Option []Term + +// Opt builds an Option from the list of Terms. +func Opt(terms ...Term) Option { + return Option(terms) +} + +// ParseOption parses a comma-separated list of terms. +func ParseOption(expr string) (Option, error) { + opt := Option{} + for _, t := range strings.Split(expr, ",") { + opt = append(opt, Term(t)) + } + return opt, opt.Validate() +} + +// ToConstraints returns Constraints containing just this option. +func (o Option) ToConstraints() Constraints { return o.ToConstraint().ToConstraints() } + +// ToConstraint returns a Constraint containing just this option. +func (o Option) ToConstraint() Constraint { return Constraint{o} } + +// ToOption returns o. +func (o Option) ToOption() Option { return o } + +// Validate validates o. +func (o Option) Validate() error { + for _, t := range o { + if err := t.Validate(); err != nil { + return fmt.Errorf("invalid term \"%s\": %s", t, err) + } + } + return nil +} + +// Evaluate the boolean formula represented by o under the given assignment of +// tag values. This is the AND of the values of the constituent Terms. +func (o Option) Evaluate(v map[string]bool) bool { + r := true + for _, t := range o { + r = r && t.Evaluate(v) + } + return r +} + +// GoString represents the Option as a comma-separated list of terms. +func (o Option) GoString() string { + var ts []string + for _, t := range o { + ts = append(ts, t.GoString()) + } + return strings.Join(ts, ",") +} + +// Term is an atomic term in a build constraint: an identifier or its negation. +type Term string + +// Not returns a term for the negation of ident. +func Not(ident string) Term { + return Term("!" + ident) +} + +// ToConstraints returns Constraints containing just this term. +func (t Term) ToConstraints() Constraints { return t.ToOption().ToConstraints() } + +// ToConstraint returns a Constraint containing just this term. +func (t Term) ToConstraint() Constraint { return t.ToOption().ToConstraint() } + +// ToOption returns an Option containing just this term. +func (t Term) ToOption() Option { return Option{t} } + +// IsNegated reports whether t is the negation of an identifier. +func (t Term) IsNegated() bool { return strings.HasPrefix(string(t), "!") } + +// Name returns the identifier for this term. +func (t Term) Name() string { + return strings.TrimPrefix(string(t), "!") +} + +// Validate the term. +func (t Term) Validate() error { + // Reference: https://github.com/golang/go/blob/204a8f55dc2e0ac8d27a781dab0da609b98560da/src/cmd/go/internal/imports/build.go#L110-L112 + // + // if strings.HasPrefix(name, "!!") { // bad syntax, reject always + // return false + // } + // + if strings.HasPrefix(string(t), "!!") { + return errors.New("at most one '!' allowed") + } + + if len(t.Name()) == 0 { + return errors.New("empty tag name") + } + + // Reference: https://github.com/golang/go/blob/204a8f55dc2e0ac8d27a781dab0da609b98560da/src/cmd/go/internal/imports/build.go#L121-L127 + // + // // Tags must be letters, digits, underscores or dots. + // // Unlike in Go identifiers, all digits are fine (e.g., "386"). + // for _, c := range name { + // if !unicode.IsLetter(c) && !unicode.IsDigit(c) && c != '_' && c != '.' { + // return false + // } + // } + // + for _, c := range t.Name() { + if !unicode.IsLetter(c) && !unicode.IsDigit(c) && c != '_' && c != '.' { + return fmt.Errorf("character '%c' disallowed in tags", c) + } + } + + return nil +} + +// Evaluate the term under the given set of identifier values. +func (t Term) Evaluate(v map[string]bool) bool { + return (t.Validate() == nil) && (v[t.Name()] == !t.IsNegated()) +} + +// GoString returns t. +func (t Term) GoString() string { return string(t) } + +// SetTags builds a set where the given list of identifiers are true. +func SetTags(idents ...string) map[string]bool { + v := map[string]bool{} + for _, ident := range idents { + v[ident] = true + } + return v +} diff --git a/vendor/github.com/mmcloughlin/avo/gotypes/components.go b/vendor/github.com/mmcloughlin/avo/gotypes/components.go new file mode 100644 index 0000000000..2206afa669 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/gotypes/components.go @@ -0,0 +1,253 @@ +package gotypes + +import ( + "errors" + "fmt" + "go/token" + "go/types" + "strconv" + + "github.com/mmcloughlin/avo/reg" + + "github.com/mmcloughlin/avo/operand" +) + +// Sizes provides type sizes used by the standard Go compiler on amd64. +var Sizes = types.SizesFor("gc", "amd64") + +// Basic represents a primitive/basic type at a given memory address. +type Basic struct { + Addr operand.Mem + Type *types.Basic +} + +// Component provides access to sub-components of a Go type. +type Component interface { + // When the component has no further sub-components, Resolve will return a + // reference to the components type and memory address. If there was an error + // during any previous calls to Component methods, they will be returned at + // resolution time. + Resolve() (*Basic, error) + + Dereference(r reg.Register) Component // dereference a pointer + Base() Component // base pointer of a string or slice + Len() Component // length of a string or slice + Cap() Component // capacity of a slice + Real() Component // real part of a complex value + Imag() Component // imaginary part of a complex value + Index(int) Component // index into an array + Field(string) Component // access a struct field +} + +// componenterr is an error that also provides a null implementation of the +// Component interface. This enables us to return an error from Component +// methods whilst also allowing method chaining to continue. +type componenterr string + +func errorf(format string, args ...interface{}) Component { + return componenterr(fmt.Sprintf(format, args...)) +} + +func (c componenterr) Error() string { return string(c) } +func (c componenterr) Resolve() (*Basic, error) { return nil, c } +func (c componenterr) Dereference(r reg.Register) Component { return c } +func (c componenterr) Base() Component { return c } +func (c componenterr) Len() Component { return c } +func (c componenterr) Cap() Component { return c } +func (c componenterr) Real() Component { return c } +func (c componenterr) Imag() Component { return c } +func (c componenterr) Index(int) Component { return c } +func (c componenterr) Field(string) Component { return c } + +type component struct { + typ types.Type + addr operand.Mem +} + +// NewComponent builds a component for the named type at the given address. +func NewComponent(t types.Type, addr operand.Mem) Component { + return &component{ + typ: t, + addr: addr, + } +} + +func (c *component) Resolve() (*Basic, error) { + b := toprimitive(c.typ) + if b == nil { + return nil, errors.New("component is not primitive") + } + return &Basic{ + Addr: c.addr, + Type: b, + }, nil +} + +func (c *component) Dereference(r reg.Register) Component { + p, ok := c.typ.Underlying().(*types.Pointer) + if !ok { + return errorf("not pointer type") + } + return NewComponent(p.Elem(), operand.Mem{Base: r}) +} + +// Reference: https://github.com/golang/go/blob/50bd1c4d4eb4fac8ddeb5f063c099daccfb71b26/src/reflect/value.go#L1800-L1804 +// +// type SliceHeader struct { +// Data uintptr +// Len int +// Cap int +// } +// +var slicehdroffsets = Sizes.Offsetsof([]*types.Var{ + types.NewField(token.NoPos, nil, "Data", types.Typ[types.Uintptr], false), + types.NewField(token.NoPos, nil, "Len", types.Typ[types.Int], false), + types.NewField(token.NoPos, nil, "Cap", types.Typ[types.Int], false), +}) + +func (c *component) Base() Component { + if !isslice(c.typ) && !isstring(c.typ) { + return errorf("only slices and strings have base pointers") + } + return c.sub("_base", int(slicehdroffsets[0]), types.Typ[types.Uintptr]) +} + +func (c *component) Len() Component { + if !isslice(c.typ) && !isstring(c.typ) { + return errorf("only slices and strings have length fields") + } + return c.sub("_len", int(slicehdroffsets[1]), types.Typ[types.Int]) +} + +func (c *component) Cap() Component { + if !isslice(c.typ) { + return errorf("only slices have capacity fields") + } + return c.sub("_cap", int(slicehdroffsets[2]), types.Typ[types.Int]) +} + +func (c *component) Real() Component { + if !iscomplex(c.typ) { + return errorf("only complex types have real values") + } + f := complextofloat(c.typ) + return c.sub("_real", 0, f) +} + +func (c *component) Imag() Component { + if !iscomplex(c.typ) { + return errorf("only complex types have imaginary values") + } + f := complextofloat(c.typ) + return c.sub("_imag", int(Sizes.Sizeof(f)), f) +} + +func (c *component) Index(i int) Component { + a, ok := c.typ.Underlying().(*types.Array) + if !ok { + return errorf("not array type") + } + if int64(i) >= a.Len() { + return errorf("array index out of bounds") + } + // Reference: https://github.com/golang/tools/blob/bcd4e47d02889ebbc25c9f4bf3d27e4124b0bf9d/go/analysis/passes/asmdecl/asmdecl.go#L482-L494 + // + // case asmArray: + // tu := t.Underlying().(*types.Array) + // elem := tu.Elem() + // // Calculate offset of each element array. + // fields := []*types.Var{ + // types.NewVar(token.NoPos, nil, "fake0", elem), + // types.NewVar(token.NoPos, nil, "fake1", elem), + // } + // offsets := arch.sizes.Offsetsof(fields) + // elemoff := int(offsets[1]) + // for i := 0; i < int(tu.Len()); i++ { + // cc = appendComponentsRecursive(arch, elem, cc, suffix+"_"+strconv.Itoa(i), i*elemoff) + // } + // + elem := a.Elem() + elemsize := int(Sizes.Sizeof(types.NewArray(elem, 2)) - Sizes.Sizeof(types.NewArray(elem, 1))) + return c.sub("_"+strconv.Itoa(i), i*elemsize, elem) +} + +func (c *component) Field(n string) Component { + s, ok := c.typ.Underlying().(*types.Struct) + if !ok { + return errorf("not struct type") + } + // Reference: https://github.com/golang/tools/blob/13ba8ad772dfbf0f451b5dd0679e9c5605afc05d/go/analysis/passes/asmdecl/asmdecl.go#L471-L480 + // + // case asmStruct: + // tu := t.Underlying().(*types.Struct) + // fields := make([]*types.Var, tu.NumFields()) + // for i := 0; i < tu.NumFields(); i++ { + // fields[i] = tu.Field(i) + // } + // offsets := arch.sizes.Offsetsof(fields) + // for i, f := range fields { + // cc = appendComponentsRecursive(arch, f.Type(), cc, suffix+"_"+f.Name(), off+int(offsets[i])) + // } + // + fields := make([]*types.Var, s.NumFields()) + for i := 0; i < s.NumFields(); i++ { + fields[i] = s.Field(i) + } + offsets := Sizes.Offsetsof(fields) + for i, f := range fields { + if f.Name() == n { + return c.sub("_"+n, int(offsets[i]), f.Type()) + } + } + return errorf("struct does not have field '%s'", n) +} + +func (c *component) sub(suffix string, offset int, t types.Type) *component { + s := *c + if s.addr.Symbol.Name != "" { + s.addr.Symbol.Name += suffix + } + s.addr = s.addr.Offset(offset) + s.typ = t + return &s +} + +func isslice(t types.Type) bool { + _, ok := t.Underlying().(*types.Slice) + return ok +} + +func isstring(t types.Type) bool { + b, ok := t.Underlying().(*types.Basic) + return ok && b.Kind() == types.String +} + +func iscomplex(t types.Type) bool { + b, ok := t.Underlying().(*types.Basic) + return ok && (b.Info()&types.IsComplex) != 0 +} + +func complextofloat(t types.Type) types.Type { + switch Sizes.Sizeof(t) { + case 16: + return types.Typ[types.Float64] + case 8: + return types.Typ[types.Float32] + } + panic("bad") +} + +// toprimitive determines whether t is primitive (cannot be reduced into +// components). If it is, it returns the basic type for t, otherwise returns +// nil. +func toprimitive(t types.Type) *types.Basic { + switch b := t.(type) { + case *types.Basic: + if (b.Info() & (types.IsString | types.IsComplex)) == 0 { + return b + } + case *types.Pointer: + return types.Typ[types.Uintptr] + } + return nil +} diff --git a/vendor/github.com/mmcloughlin/avo/gotypes/doc.go b/vendor/github.com/mmcloughlin/avo/gotypes/doc.go new file mode 100644 index 0000000000..fa8f0783d7 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/gotypes/doc.go @@ -0,0 +1,2 @@ +// Package gotypes provides helpers for interacting with Go types within avo functions. +package gotypes diff --git a/vendor/github.com/mmcloughlin/avo/gotypes/signature.go b/vendor/github.com/mmcloughlin/avo/gotypes/signature.go new file mode 100644 index 0000000000..e00002034d --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/gotypes/signature.go @@ -0,0 +1,177 @@ +package gotypes + +import ( + "bytes" + "errors" + "fmt" + "go/token" + "go/types" + "strconv" + + "github.com/mmcloughlin/avo/operand" +) + +// Signature represents a Go function signature. +type Signature struct { + pkg *types.Package + sig *types.Signature + params *Tuple + results *Tuple +} + +// NewSignature constructs a Signature. +func NewSignature(pkg *types.Package, sig *types.Signature) *Signature { + s := &Signature{ + pkg: pkg, + sig: sig, + } + s.init() + return s +} + +// NewSignatureVoid builds the void signature "func()". +func NewSignatureVoid() *Signature { + return NewSignature(nil, types.NewSignature(nil, nil, nil, false)) +} + +// LookupSignature returns the signature of the named function in the provided package. +func LookupSignature(pkg *types.Package, name string) (*Signature, error) { + scope := pkg.Scope() + obj := scope.Lookup(name) + if obj == nil { + return nil, fmt.Errorf("could not find function \"%s\"", name) + } + s, ok := obj.Type().(*types.Signature) + if !ok { + return nil, fmt.Errorf("object \"%s\" does not have signature type", name) + } + return NewSignature(pkg, s), nil +} + +// ParseSignature builds a Signature by parsing a Go function type expression. +// The function type must reference builtin types only; see +// ParseSignatureInPackage if custom types are required. +func ParseSignature(expr string) (*Signature, error) { + return ParseSignatureInPackage(nil, expr) +} + +// ParseSignatureInPackage builds a Signature by parsing a Go function type +// expression. The expression may reference types in the provided package. +func ParseSignatureInPackage(pkg *types.Package, expr string) (*Signature, error) { + tv, err := types.Eval(token.NewFileSet(), pkg, token.NoPos, expr) + if err != nil { + return nil, err + } + if tv.Value != nil { + return nil, errors.New("signature expression should have nil value") + } + s, ok := tv.Type.(*types.Signature) + if !ok { + return nil, errors.New("provided type is not a function signature") + } + return NewSignature(pkg, s), nil +} + +// Params returns the function signature argument types. +func (s *Signature) Params() *Tuple { return s.params } + +// Results returns the function return types. +func (s *Signature) Results() *Tuple { return s.results } + +// Bytes returns the total size of the function arguments and return values. +func (s *Signature) Bytes() int { return s.Params().Bytes() + s.Results().Bytes() } + +// String writes Signature as a string. This does not include the "func" keyword. +func (s *Signature) String() string { + var buf bytes.Buffer + types.WriteSignature(&buf, s.sig, func(pkg *types.Package) string { + if pkg == s.pkg { + return "" + } + return pkg.Name() + }) + return buf.String() +} + +func (s *Signature) init() { + p := s.sig.Params() + r := s.sig.Results() + + // Compute parameter offsets. + vs := tuplevars(p) + vs = append(vs, types.NewParam(token.NoPos, nil, "sentinel", types.Typ[types.Uint64])) + paramsoffsets := Sizes.Offsetsof(vs) + paramssize := paramsoffsets[p.Len()] + s.params = newTuple(p, paramsoffsets, paramssize, "arg") + + // Result offsets. + vs = tuplevars(r) + resultsoffsets := Sizes.Offsetsof(vs) + var resultssize int64 + if n := len(vs); n > 0 { + resultssize = resultsoffsets[n-1] + Sizes.Sizeof(vs[n-1].Type()) + } + for i := range resultsoffsets { + resultsoffsets[i] += paramssize + } + s.results = newTuple(r, resultsoffsets, resultssize, "ret") +} + +// Tuple represents a tuple of variables, such as function arguments or results. +type Tuple struct { + components []Component + byname map[string]Component + size int +} + +func newTuple(t *types.Tuple, offsets []int64, size int64, defaultprefix string) *Tuple { + tuple := &Tuple{ + byname: map[string]Component{}, + size: int(size), + } + for i := 0; i < t.Len(); i++ { + v := t.At(i) + name := v.Name() + if name == "" { + name = defaultprefix + if i > 0 { + name += strconv.Itoa(i) + } + } + addr := operand.NewParamAddr(name, int(offsets[i])) + c := NewComponent(v.Type(), addr) + tuple.components = append(tuple.components, c) + if v.Name() != "" { + tuple.byname[v.Name()] = c + } + } + return tuple +} + +// Lookup returns the variable with the given name. +func (t *Tuple) Lookup(name string) Component { + e := t.byname[name] + if e == nil { + return errorf("unknown variable \"%s\"", name) + } + return e +} + +// At returns the variable at index i. +func (t *Tuple) At(i int) Component { + if i >= len(t.components) { + return errorf("index out of range") + } + return t.components[i] +} + +// Bytes returns the size of the Tuple. This may include additional padding. +func (t *Tuple) Bytes() int { return t.size } + +func tuplevars(t *types.Tuple) []*types.Var { + vs := make([]*types.Var, t.Len()) + for i := 0; i < t.Len(); i++ { + vs[i] = t.At(i) + } + return vs +} diff --git a/vendor/github.com/mmcloughlin/avo/internal/prnt/printer.go b/vendor/github.com/mmcloughlin/avo/internal/prnt/printer.go new file mode 100644 index 0000000000..410895cb07 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/internal/prnt/printer.go @@ -0,0 +1,60 @@ +// Package prnt provides common functionality for code generators. +package prnt + +import ( + "bytes" + "fmt" + "io" + "strings" +) + +// Generator provides convenience methods for code generators. In particular it +// provides fmt-like methods which print to an internal buffer. It also allows +// any errors to be stored so they can be checked at the end, rather than having +// error checks obscuring the code generation. +type Generator struct { + buf bytes.Buffer + err error +} + +// Raw provides direct access to the underlying output stream. +func (g *Generator) Raw() io.Writer { + return &g.buf +} + +// Printf prints to the internal buffer. +func (g *Generator) Printf(format string, args ...interface{}) { + if g.err != nil { + return + } + _, err := fmt.Fprintf(&g.buf, format, args...) + g.AddError(err) +} + +// NL prints a new line. +func (g *Generator) NL() { + g.Printf("\n") +} + +// Comment writes comment lines prefixed with "// ". +func (g *Generator) Comment(lines ...string) { + for _, line := range lines { + line = strings.TrimSpace("// " + line) + g.Printf("%s\n", line) + } +} + +// AddError records an error in code generation. The first non-nil error will +// prevent printing operations from writing anything else, and the error will be +// returned from Result(). +func (g *Generator) AddError(err error) { + if err != nil && g.err == nil { + g.err = err + } +} + +// Result returns the printed bytes. If any error was recorded with AddError +// during code generation, the first such error will be returned here. +func (g *Generator) Result() ([]byte, error) { + return g.buf.Bytes(), g.err +} diff --git a/vendor/github.com/mmcloughlin/avo/internal/stack/stack.go b/vendor/github.com/mmcloughlin/avo/internal/stack/stack.go new file mode 100644 index 0000000000..1d327d9da4 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/internal/stack/stack.go @@ -0,0 +1,73 @@ +// Package stack provides helpers for querying the callstack. +package stack + +import ( + "path" + "runtime" + "strings" +) + +// Frames returns at most max callstack Frames, starting with its caller and +// skipping skip Frames. +func Frames(skip, max int) []runtime.Frame { + pc := make([]uintptr, max) + n := runtime.Callers(skip+2, pc) + if n == 0 { + return nil + } + pc = pc[:n] + frames := runtime.CallersFrames(pc) + var fs []runtime.Frame + for { + f, more := frames.Next() + fs = append(fs, f) + if !more { + break + } + } + return fs +} + +// Match returns the first stack frame for which the predicate function returns +// true. Returns nil if no match is found. Starts matching after skip frames, +// starting with its caller. +func Match(skip int, predicate func(runtime.Frame) bool) *runtime.Frame { + i, n := skip+1, 16 + for { + fs := Frames(i, n) + for j, f := range fs { + if predicate(f) { + return &fs[j] + } + } + if len(fs) < n { + break + } + i += n + } + return nil +} + +// Main returns the main() function Frame. +func Main() *runtime.Frame { + return Match(1, func(f runtime.Frame) bool { + return f.Function == "main.main" + }) +} + +// ExternalCaller returns the first frame outside the callers package. +func ExternalCaller() *runtime.Frame { + var first *runtime.Frame + return Match(1, func(f runtime.Frame) bool { + if first == nil { + first = &f + } + return pkg(first.Function) != pkg(f.Function) + }) +} + +func pkg(ident string) string { + dir, name := path.Split(ident) + parts := strings.Split(name, ".") + return dir + parts[0] +} diff --git a/vendor/github.com/mmcloughlin/avo/ir/doc.go b/vendor/github.com/mmcloughlin/avo/ir/doc.go new file mode 100644 index 0000000000..de02f46406 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/ir/doc.go @@ -0,0 +1,2 @@ +// Package ir provides the intermediate representation of avo programs. +package ir diff --git a/vendor/github.com/mmcloughlin/avo/ir/ir.go b/vendor/github.com/mmcloughlin/avo/ir/ir.go new file mode 100644 index 0000000000..6fb9216997 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/ir/ir.go @@ -0,0 +1,355 @@ +package ir + +import ( + "errors" + + "github.com/mmcloughlin/avo/attr" + "github.com/mmcloughlin/avo/buildtags" + "github.com/mmcloughlin/avo/gotypes" + "github.com/mmcloughlin/avo/operand" + "github.com/mmcloughlin/avo/reg" +) + +// Node is a part of a Function. +type Node interface { + node() +} + +// Label within a function. +type Label string + +func (l Label) node() {} + +// Comment represents a multi-line comment. +type Comment struct { + Lines []string +} + +func (c *Comment) node() {} + +// NewComment builds a Comment consisting of the provided lines. +func NewComment(lines ...string) *Comment { + return &Comment{ + Lines: lines, + } +} + +// Instruction is a single instruction in a function. +type Instruction struct { + Opcode string + Operands []operand.Op + + Inputs []operand.Op + Outputs []operand.Op + + IsTerminal bool + IsBranch bool + IsConditional bool + CancellingInputs bool + + // ISA is the list of required instruction set extensions. + ISA []string + + // CFG. + Pred []*Instruction + Succ []*Instruction + + // LiveIn/LiveOut are sets of live register IDs pre/post execution. + LiveIn reg.MaskSet + LiveOut reg.MaskSet +} + +func (i *Instruction) node() {} + +// IsUnconditionalBranch reports whether i is an unconditional branch. +func (i Instruction) IsUnconditionalBranch() bool { + return i.IsBranch && !i.IsConditional +} + +// TargetLabel returns the label referenced by this instruction. Returns nil if +// no label is referenced. +func (i Instruction) TargetLabel() *Label { + if !i.IsBranch { + return nil + } + if len(i.Operands) == 0 { + return nil + } + if ref, ok := i.Operands[0].(operand.LabelRef); ok { + lbl := Label(ref) + return &lbl + } + return nil +} + +// Registers returns all registers involved in the instruction. +func (i Instruction) Registers() []reg.Register { + var rs []reg.Register + for _, op := range i.Operands { + rs = append(rs, operand.Registers(op)...) + } + return rs +} + +// InputRegisters returns all registers read by this instruction. +func (i Instruction) InputRegisters() []reg.Register { + var rs []reg.Register + for _, op := range i.Inputs { + rs = append(rs, operand.Registers(op)...) + } + if i.CancellingInputs && rs[0] == rs[1] { + rs = []reg.Register{} + } + for _, op := range i.Outputs { + if operand.IsMem(op) { + rs = append(rs, operand.Registers(op)...) + } + } + return rs +} + +// OutputRegisters returns all registers written by this instruction. +func (i Instruction) OutputRegisters() []reg.Register { + var rs []reg.Register + for _, op := range i.Outputs { + if r, ok := op.(reg.Register); ok { + rs = append(rs, r) + } + } + return rs +} + +// Section is a part of a file. +type Section interface { + section() +} + +// File represents an assembly file. +type File struct { + Constraints buildtags.Constraints + Includes []string + Sections []Section +} + +// NewFile initializes an empty file. +func NewFile() *File { + return &File{} +} + +// AddSection appends a Section to the file. +func (f *File) AddSection(s Section) { + f.Sections = append(f.Sections, s) +} + +// Functions returns all functions in the file. +func (f *File) Functions() []*Function { + var fns []*Function + for _, s := range f.Sections { + if fn, ok := s.(*Function); ok { + fns = append(fns, fn) + } + } + return fns +} + +// Pragma represents a function compiler directive. +type Pragma struct { + Directive string + Arguments []string +} + +// Function represents an assembly function. +type Function struct { + Name string + Attributes attr.Attribute + Pragmas []Pragma + Doc []string + Signature *gotypes.Signature + LocalSize int + + Nodes []Node + + // LabelTarget maps from label name to the following instruction. + LabelTarget map[Label]*Instruction + + // Register allocation. + Allocation reg.Allocation + + // ISA is the list of required instruction set extensions. + ISA []string +} + +func (f *Function) section() {} + +// NewFunction builds an empty function of the given name. +func NewFunction(name string) *Function { + return &Function{ + Name: name, + Signature: gotypes.NewSignatureVoid(), + } +} + +// AddPragma adds a pragma to this function. +func (f *Function) AddPragma(directive string, args ...string) { + f.Pragmas = append(f.Pragmas, Pragma{ + Directive: directive, + Arguments: args, + }) +} + +// SetSignature sets the function signature. +func (f *Function) SetSignature(s *gotypes.Signature) { + f.Signature = s +} + +// AllocLocal allocates size bytes in this function's stack. +// Returns a reference to the base pointer for the newly allocated region. +func (f *Function) AllocLocal(size int) operand.Mem { + ptr := operand.NewStackAddr(f.LocalSize) + f.LocalSize += size + return ptr +} + +// AddInstruction appends an instruction to f. +func (f *Function) AddInstruction(i *Instruction) { + f.AddNode(i) +} + +// AddLabel appends a label to f. +func (f *Function) AddLabel(l Label) { + f.AddNode(l) +} + +// AddComment adds comment lines to f. +func (f *Function) AddComment(lines ...string) { + f.AddNode(NewComment(lines...)) +} + +// AddNode appends a Node to f. +func (f *Function) AddNode(n Node) { + f.Nodes = append(f.Nodes, n) +} + +// Instructions returns just the list of instruction nodes. +func (f *Function) Instructions() []*Instruction { + var is []*Instruction + for _, n := range f.Nodes { + i, ok := n.(*Instruction) + if ok { + is = append(is, i) + } + } + return is +} + +// Labels returns just the list of label nodes. +func (f *Function) Labels() []Label { + var lbls []Label + for _, n := range f.Nodes { + lbl, ok := n.(Label) + if ok { + lbls = append(lbls, lbl) + } + } + return lbls +} + +// Stub returns the Go function declaration. +func (f *Function) Stub() string { + return "func " + f.Name + f.Signature.String() +} + +// FrameBytes returns the size of the stack frame in bytes. +func (f *Function) FrameBytes() int { + return f.LocalSize +} + +// ArgumentBytes returns the size of the arguments in bytes. +func (f *Function) ArgumentBytes() int { + return f.Signature.Bytes() +} + +// Datum represents a data element at a particular offset of a data section. +type Datum struct { + Offset int + Value operand.Constant +} + +// NewDatum builds a Datum from the given constant. +func NewDatum(offset int, v operand.Constant) Datum { + return Datum{ + Offset: offset, + Value: v, + } +} + +// Interval returns the range of bytes this datum will occupy within its section. +func (d Datum) Interval() (int, int) { + return d.Offset, d.Offset + d.Value.Bytes() +} + +// Overlaps returns true +func (d Datum) Overlaps(other Datum) bool { + s, e := d.Interval() + so, eo := other.Interval() + return !(eo <= s || e <= so) +} + +// Global represents a DATA section. +type Global struct { + Symbol operand.Symbol + Attributes attr.Attribute + Data []Datum + Size int +} + +// NewGlobal constructs an empty DATA section. +func NewGlobal(sym operand.Symbol) *Global { + return &Global{ + Symbol: sym, + } +} + +// NewStaticGlobal is a convenience for building a static DATA section. +func NewStaticGlobal(name string) *Global { + return NewGlobal(operand.NewStaticSymbol(name)) +} + +func (g *Global) section() {} + +// Base returns a pointer to the start of the data section. +func (g *Global) Base() operand.Mem { + return operand.NewDataAddr(g.Symbol, 0) +} + +// Grow ensures that the data section has at least the given size. +func (g *Global) Grow(size int) { + if g.Size < size { + g.Size = size + } +} + +// AddDatum adds d to this data section, growing it if necessary. Errors if the datum overlaps with existing data. +func (g *Global) AddDatum(d Datum) error { + for _, other := range g.Data { + if d.Overlaps(other) { + return errors.New("overlaps existing datum") + } + } + g.add(d) + return nil +} + +// Append the constant to the end of the data section. +func (g *Global) Append(v operand.Constant) { + g.add(Datum{ + Offset: g.Size, + Value: v, + }) +} + +func (g *Global) add(d Datum) { + _, end := d.Interval() + g.Grow(end) + g.Data = append(g.Data, d) +} diff --git a/vendor/github.com/mmcloughlin/avo/operand/checks.go b/vendor/github.com/mmcloughlin/avo/operand/checks.go new file mode 100644 index 0000000000..2585479d33 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/operand/checks.go @@ -0,0 +1,247 @@ +package operand + +import "github.com/mmcloughlin/avo/reg" + +// Pure type assertion checks: + +// IsRegister returns whether op has type reg.Register. +func IsRegister(op Op) bool { _, ok := op.(reg.Register); return ok } + +// IsMem returns whether op has type Mem. +func IsMem(op Op) bool { _, ok := op.(Mem); return ok } + +// IsRel returns whether op has type Rel. +func IsRel(op Op) bool { _, ok := op.(Rel); return ok } + +// Checks corresponding to specific operand types in the Intel Manual: + +// Is1 returns true if op is the immediate constant 1. +func Is1(op Op) bool { + i, ok := op.(U8) + return ok && i == 1 +} + +// Is3 returns true if op is the immediate constant 3. +func Is3(op Op) bool { + i, ok := op.(U8) + return ok && i == 3 +} + +// IsIMM2U returns true if op is a 2-bit unsigned immediate (less than 4). +func IsIMM2U(op Op) bool { + i, ok := op.(U8) + return ok && i < 4 +} + +// IsIMM8 returns true is op is an 8-bit immediate. +func IsIMM8(op Op) bool { + _, ok := op.(U8) + return ok +} + +// IsIMM16 returns true is op is a 16-bit immediate. +func IsIMM16(op Op) bool { + _, ok := op.(U16) + return ok +} + +// IsIMM32 returns true is op is a 32-bit immediate. +func IsIMM32(op Op) bool { + _, ok := op.(U32) + return ok +} + +// IsIMM64 returns true is op is a 64-bit immediate. +func IsIMM64(op Op) bool { + _, ok := op.(U64) + return ok +} + +// IsAL returns true if op is the AL register. +func IsAL(op Op) bool { + return op == reg.AL +} + +// IsCL returns true if op is the CL register. +func IsCL(op Op) bool { + return op == reg.CL +} + +// IsAX returns true if op is the 16-bit AX register. +func IsAX(op Op) bool { + return op == reg.AX +} + +// IsEAX returns true if op is the 32-bit EAX register. +func IsEAX(op Op) bool { + return op == reg.EAX +} + +// IsRAX returns true if op is the 64-bit RAX register. +func IsRAX(op Op) bool { + return op == reg.RAX +} + +// IsR8 returns true if op is an 8-bit general-purpose register. +func IsR8(op Op) bool { + return IsGP(op, 1) +} + +// IsR16 returns true if op is a 16-bit general-purpose register. +func IsR16(op Op) bool { + return IsGP(op, 2) +} + +// IsR32 returns true if op is a 32-bit general-purpose register. +func IsR32(op Op) bool { + return IsGP(op, 4) +} + +// IsR64 returns true if op is a 64-bit general-purpose register. +func IsR64(op Op) bool { + return IsGP(op, 8) +} + +// IsPseudo returns true if op is a pseudo register. +func IsPseudo(op Op) bool { + return IsRegisterKind(op, reg.KindPseudo) +} + +// IsGP returns true if op is a general-purpose register of size n bytes. +func IsGP(op Op, n uint) bool { + return IsRegisterKindSize(op, reg.KindGP, n) +} + +// IsXMM0 returns true if op is the X0 register. +func IsXMM0(op Op) bool { + return op == reg.X0 +} + +// IsXMM returns true if op is a 128-bit XMM register. +func IsXMM(op Op) bool { + return IsRegisterKindSize(op, reg.KindVector, 16) +} + +// IsYMM returns true if op is a 256-bit YMM register. +func IsYMM(op Op) bool { + return IsRegisterKindSize(op, reg.KindVector, 32) +} + +// IsRegisterKindSize returns true if op is a register of the given kind and size in bytes. +func IsRegisterKindSize(op Op, k reg.Kind, n uint) bool { + r, ok := op.(reg.Register) + return ok && r.Kind() == k && r.Size() == n +} + +// IsRegisterKind returns true if op is a register of the given kind. +func IsRegisterKind(op Op, k reg.Kind) bool { + r, ok := op.(reg.Register) + return ok && r.Kind() == k +} + +// IsM returns true if op is a 16-, 32- or 64-bit memory operand. +func IsM(op Op) bool { + // TODO(mbm): confirm "m" check is defined correctly + // Intel manual: "A 16-, 32- or 64-bit operand in memory." + return IsM16(op) || IsM32(op) || IsM64(op) +} + +// IsM8 returns true if op is an 8-bit memory operand. +func IsM8(op Op) bool { + // TODO(mbm): confirm "m8" check is defined correctly + // Intel manual: "A byte operand in memory, usually expressed as a variable or + // array name, but pointed to by the DS:(E)SI or ES:(E)DI registers. In 64-bit + // mode, it is pointed to by the RSI or RDI registers." + return IsMSize(op, 1) +} + +// IsM16 returns true if op is a 16-bit memory operand. +func IsM16(op Op) bool { + return IsMSize(op, 2) +} + +// IsM32 returns true if op is a 16-bit memory operand. +func IsM32(op Op) bool { + return IsMSize(op, 4) +} + +// IsM64 returns true if op is a 64-bit memory operand. +func IsM64(op Op) bool { + return IsMSize(op, 8) +} + +// IsMSize returns true if op is a memory operand using general-purpose address +// registers of the given size in bytes. +func IsMSize(op Op, n uint) bool { + // TODO(mbm): should memory operands have a size attribute as well? + // TODO(mbm): m8,m16,m32,m64 checks do not actually check size + m, ok := op.(Mem) + return ok && IsMReg(m.Base) && (m.Index == nil || IsMReg(m.Index)) +} + +// IsMReg returns true if op is a register that can be used in a memory operand. +func IsMReg(op Op) bool { + return IsPseudo(op) || IsRegisterKind(op, reg.KindGP) +} + +// IsM128 returns true if op is a 128-bit memory operand. +func IsM128(op Op) bool { + // TODO(mbm): should "m128" be the same as "m64"? + return IsM64(op) +} + +// IsM256 returns true if op is a 256-bit memory operand. +func IsM256(op Op) bool { + // TODO(mbm): should "m256" be the same as "m64"? + return IsM64(op) +} + +// IsVM32X returns true if op is a vector memory operand with 32-bit XMM index. +func IsVM32X(op Op) bool { + return IsVmx(op) +} + +// IsVM64X returns true if op is a vector memory operand with 64-bit XMM index. +func IsVM64X(op Op) bool { + return IsVmx(op) +} + +// IsVmx returns true if op is a vector memory operand with XMM index. +func IsVmx(op Op) bool { + return isvm(op, IsXMM) +} + +// IsVM32Y returns true if op is a vector memory operand with 32-bit YMM index. +func IsVM32Y(op Op) bool { + return IsVmy(op) +} + +// IsVM64Y returns true if op is a vector memory operand with 64-bit YMM index. +func IsVM64Y(op Op) bool { + return IsVmy(op) +} + +// IsVmy returns true if op is a vector memory operand with YMM index. +func IsVmy(op Op) bool { + return isvm(op, IsYMM) +} + +func isvm(op Op, idx func(Op) bool) bool { + m, ok := op.(Mem) + return ok && IsR64(m.Base) && idx(m.Index) +} + +// IsREL8 returns true if op is an 8-bit offset relative to instruction pointer. +func IsREL8(op Op) bool { + r, ok := op.(Rel) + return ok && r == Rel(int8(r)) +} + +// IsREL32 returns true if op is an offset relative to instruction pointer, or a +// label reference. +func IsREL32(op Op) bool { + // TODO(mbm): should labels be considered separately? + _, rel := op.(Rel) + _, label := op.(LabelRef) + return rel || label +} diff --git a/vendor/github.com/mmcloughlin/avo/operand/const.go b/vendor/github.com/mmcloughlin/avo/operand/const.go new file mode 100644 index 0000000000..b2c6a6f77d --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/operand/const.go @@ -0,0 +1,36 @@ +package operand + +import "fmt" + +// Constant represents a constant literal. +type Constant interface { + Op + Bytes() int + constant() +} + +//go:generate go run make_const.go -output zconst.go + +// String is a string constant. +type String string + +// Asm returns an assembly syntax representation of the string s. +func (s String) Asm() string { return fmt.Sprintf("$%q", s) } + +// Bytes returns the length of s. +func (s String) Bytes() int { return len(s) } + +func (s String) constant() {} + +// Imm returns an unsigned integer constant with size guessed from x. +func Imm(x uint64) Constant { + switch { + case uint64(uint8(x)) == x: + return U8(x) + case uint64(uint16(x)) == x: + return U16(x) + case uint64(uint32(x)) == x: + return U32(x) + } + return U64(x) +} diff --git a/vendor/github.com/mmcloughlin/avo/operand/doc.go b/vendor/github.com/mmcloughlin/avo/operand/doc.go new file mode 100644 index 0000000000..51c44dfb84 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/operand/doc.go @@ -0,0 +1,2 @@ +// Package operand provides types for instruction operands. +package operand diff --git a/vendor/github.com/mmcloughlin/avo/operand/types.go b/vendor/github.com/mmcloughlin/avo/operand/types.go new file mode 100644 index 0000000000..878425ec1d --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/operand/types.go @@ -0,0 +1,151 @@ +package operand + +import ( + "fmt" + + "github.com/mmcloughlin/avo/reg" +) + +// Op is an operand. +type Op interface { + Asm() string +} + +// Symbol represents a symbol name. +type Symbol struct { + Name string + Static bool // only visible in current source file +} + +// NewStaticSymbol builds a static Symbol. Static symbols are only visible in the current source file. +func NewStaticSymbol(name string) Symbol { + return Symbol{Name: name, Static: true} +} + +func (s Symbol) String() string { + n := s.Name + if s.Static { + n += "<>" + } + return n +} + +// Mem represents a memory reference. +type Mem struct { + Symbol Symbol + Disp int + Base reg.Register + Index reg.Register + Scale uint8 +} + +// NewParamAddr is a convenience to build a Mem operand pointing to a function +// parameter, which is a named offset from the frame pointer pseudo register. +func NewParamAddr(name string, offset int) Mem { + return Mem{ + Symbol: Symbol{ + Name: name, + Static: false, + }, + Disp: offset, + Base: reg.FramePointer, + } +} + +// NewStackAddr returns a memory reference relative to the stack pointer. +func NewStackAddr(offset int) Mem { + return Mem{ + Disp: offset, + Base: reg.StackPointer, + } +} + +// NewDataAddr returns a memory reference relative to the named data symbol. +func NewDataAddr(sym Symbol, offset int) Mem { + return Mem{ + Symbol: sym, + Disp: offset, + Base: reg.StaticBase, + } +} + +// Offset returns a reference to m plus idx bytes. +func (m Mem) Offset(idx int) Mem { + a := m + a.Disp += idx + return a +} + +// Idx returns a new memory reference with (Index, Scale) set to (r, s). +func (m Mem) Idx(r reg.Register, s uint8) Mem { + a := m + a.Index = r + a.Scale = s + return a +} + +// Asm returns an assembly syntax representation of m. +func (m Mem) Asm() string { + a := m.Symbol.String() + if a != "" { + a += fmt.Sprintf("%+d", m.Disp) + } else if m.Disp != 0 { + a += fmt.Sprintf("%d", m.Disp) + } + if m.Base != nil { + a += fmt.Sprintf("(%s)", m.Base.Asm()) + } + if m.Index != nil && m.Scale != 0 { + a += fmt.Sprintf("(%s*%d)", m.Index.Asm(), m.Scale) + } + return a +} + +// Rel is an offset relative to the instruction pointer. +type Rel int32 + +// Asm returns an assembly syntax representation of r. +func (r Rel) Asm() string { + return fmt.Sprintf(".%+d", r) +} + +// LabelRef is a reference to a label. +type LabelRef string + +// Asm returns an assembly syntax representation of l. +func (l LabelRef) Asm() string { + return string(l) +} + +// Registers returns the list of all operands involved in the given operand. +func Registers(op Op) []reg.Register { + switch op := op.(type) { + case reg.Register: + return []reg.Register{op} + case Mem: + var r []reg.Register + if op.Base != nil { + r = append(r, op.Base) + } + if op.Index != nil { + r = append(r, op.Index) + } + return r + case Constant, Rel, LabelRef: + return nil + } + panic("unknown operand type") +} + +// ApplyAllocation returns an operand with allocated registers replaced. Registers missing from the allocation are left alone. +func ApplyAllocation(op Op, a reg.Allocation) Op { + switch op := op.(type) { + case reg.Register: + return a.LookupRegisterDefault(op) + case Mem: + op.Base = a.LookupRegisterDefault(op.Base) + op.Index = a.LookupRegisterDefault(op.Index) + return op + } + return op +} diff --git a/vendor/github.com/mmcloughlin/avo/operand/zconst.go b/vendor/github.com/mmcloughlin/avo/operand/zconst.go new file mode 100644 index 0000000000..324b4a96f2 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/operand/zconst.go @@ -0,0 +1,75 @@ +// Code generated by make_const.go. DO NOT EDIT. + +package operand + +import "fmt" + +// I8 is a 8-bit signed integer constant. +type I8 int8 + +func (i I8) Asm() string { return fmt.Sprintf("$%+d", i) } +func (i I8) Bytes() int { return 1 } +func (i I8) constant() {} + +// U8 is a 8-bit unsigned integer constant. +type U8 uint8 + +func (u U8) Asm() string { return fmt.Sprintf("$%#02x", u) } +func (u U8) Bytes() int { return 1 } +func (u U8) constant() {} + +// I16 is a 16-bit signed integer constant. +type I16 int16 + +func (i I16) Asm() string { return fmt.Sprintf("$%+d", i) } +func (i I16) Bytes() int { return 2 } +func (i I16) constant() {} + +// U16 is a 16-bit unsigned integer constant. +type U16 uint16 + +func (u U16) Asm() string { return fmt.Sprintf("$%#04x", u) } +func (u U16) Bytes() int { return 2 } +func (u U16) constant() {} + +// F32 is a 32-bit floating point constant. +type F32 float32 + +func (f F32) Asm() string { return fmt.Sprintf("$(%#v)", f) } +func (f F32) Bytes() int { return 4 } +func (f F32) constant() {} + +// I32 is a 32-bit signed integer constant. +type I32 int32 + +func (i I32) Asm() string { return fmt.Sprintf("$%+d", i) } +func (i I32) Bytes() int { return 4 } +func (i I32) constant() {} + +// U32 is a 32-bit unsigned integer constant. +type U32 uint32 + +func (u U32) Asm() string { return fmt.Sprintf("$%#08x", u) } +func (u U32) Bytes() int { return 4 } +func (u U32) constant() {} + +// F64 is a 64-bit floating point constant. +type F64 float64 + +func (f F64) Asm() string { return fmt.Sprintf("$(%#v)", f) } +func (f F64) Bytes() int { return 8 } +func (f F64) constant() {} + +// I64 is a 64-bit signed integer constant. +type I64 int64 + +func (i I64) Asm() string { return fmt.Sprintf("$%+d", i) } +func (i I64) Bytes() int { return 8 } +func (i I64) constant() {} + +// U64 is a 64-bit unsigned integer constant. +type U64 uint64 + +func (u U64) Asm() string { return fmt.Sprintf("$%#016x", u) } +func (u U64) Bytes() int { return 8 } +func (u U64) constant() {} diff --git a/vendor/github.com/mmcloughlin/avo/pass/alloc.go b/vendor/github.com/mmcloughlin/avo/pass/alloc.go new file mode 100644 index 0000000000..fc7773abc1 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/pass/alloc.go @@ -0,0 +1,190 @@ +package pass + +import ( + "errors" + "math" + "sort" + + "github.com/mmcloughlin/avo/reg" +) + +// edge is an edge of the interference graph, indicating that registers X and Y +// must be in non-conflicting registers. +type edge struct { + X, Y reg.ID +} + +// Allocator is a graph-coloring register allocator. +type Allocator struct { + registers []reg.ID + allocation reg.Allocation + edges []*edge + possible map[reg.ID][]reg.ID +} + +// NewAllocator builds an allocator for the given physical registers. +func NewAllocator(rs []reg.Physical) (*Allocator, error) { + // Set of IDs, excluding restricted registers. + idset := map[reg.ID]bool{} + for _, r := range rs { + if (r.Info() & reg.Restricted) != 0 { + continue + } + idset[r.ID()] = true + } + + if len(idset) == 0 { + return nil, errors.New("no allocatable registers") + } + + // Produce slice of unique register IDs. + var ids []reg.ID + for id := range idset { + ids = append(ids, id) + } + sort.Slice(ids, func(i, j int) bool { return ids[i] < ids[j] }) + + return &Allocator{ + registers: ids, + allocation: reg.NewEmptyAllocation(), + possible: map[reg.ID][]reg.ID{}, + }, nil +} + +// NewAllocatorForKind builds an allocator for the given kind of registers. +func NewAllocatorForKind(k reg.Kind) (*Allocator, error) { + f := reg.FamilyOfKind(k) + if f == nil { + return nil, errors.New("unknown register family") + } + return NewAllocator(f.Registers()) +} + +// AddInterferenceSet records that r interferes with every register in s. Convenience wrapper around AddInterference. +func (a *Allocator) AddInterferenceSet(r reg.Register, s reg.MaskSet) { + for id, mask := range s { + if (r.Mask() & mask) != 0 { + a.AddInterference(r.ID(), id) + } + } +} + +// AddInterference records that x and y must be assigned to non-conflicting physical registers. +func (a *Allocator) AddInterference(x, y reg.ID) { + a.Add(x) + a.Add(y) + a.edges = append(a.edges, &edge{X: x, Y: y}) +} + +// Add adds a register to be allocated. Does nothing if the register has already been added. +func (a *Allocator) Add(v reg.ID) { + if !v.IsVirtual() { + return + } + if _, found := a.possible[v]; found { + return + } + a.possible[v] = a.possibleregisters(v) +} + +// Allocate allocates physical registers. +func (a *Allocator) Allocate() (reg.Allocation, error) { + for { + if err := a.update(); err != nil { + return nil, err + } + + if a.remaining() == 0 { + break + } + + v := a.mostrestricted() + if err := a.alloc(v); err != nil { + return nil, err + } + } + return a.allocation, nil +} + +// update possible allocations based on edges. +func (a *Allocator) update() error { + var rem []*edge + for _, e := range a.edges { + x := a.allocation.LookupDefault(e.X) + y := a.allocation.LookupDefault(e.Y) + switch { + case x.IsVirtual() && y.IsVirtual(): + rem = append(rem, e) + continue + case x.IsPhysical() && y.IsPhysical(): + if x == y { + return errors.New("impossible register allocation") + } + case x.IsPhysical() && y.IsVirtual(): + a.discardconflicting(y, x) + case x.IsVirtual() && y.IsPhysical(): + a.discardconflicting(x, y) + default: + panic("unreachable") + } + } + a.edges = rem + + return nil +} + +// mostrestricted returns the virtual register with the least possibilities. +func (a *Allocator) mostrestricted() reg.ID { + n := int(math.MaxInt32) + var v reg.ID + for w, p := range a.possible { + // On a tie, choose the smallest ID in numeric order. This avoids + // non-deterministic allocations due to map iteration order. + if len(p) < n || (len(p) == n && w < v) { + n = len(p) + v = w + } + } + return v +} + +// discardconflicting removes registers from vs possible list that conflict with p. +func (a *Allocator) discardconflicting(v, p reg.ID) { + a.possible[v] = filterregisters(a.possible[v], func(r reg.ID) bool { + return r != p + }) +} + +// alloc attempts to allocate a register to v. +func (a *Allocator) alloc(v reg.ID) error { + ps := a.possible[v] + if len(ps) == 0 { + return errors.New("failed to allocate registers") + } + p := ps[0] + a.allocation[v] = p + delete(a.possible, v) + return nil +} + +// remaining returns the number of unallocated registers. +func (a *Allocator) remaining() int { + return len(a.possible) +} + +// possibleregisters returns all allocate-able registers for the given virtual. +func (a *Allocator) possibleregisters(v reg.ID) []reg.ID { + return filterregisters(a.registers, func(r reg.ID) bool { + return v.Kind() == r.Kind() + }) +} + +func filterregisters(in []reg.ID, predicate func(reg.ID) bool) []reg.ID { + var rs []reg.ID + for _, r := range in { + if predicate(r) { + rs = append(rs, r) + } + } + return rs +} diff --git a/vendor/github.com/mmcloughlin/avo/pass/cfg.go b/vendor/github.com/mmcloughlin/avo/pass/cfg.go new file mode 100644 index 0000000000..d5f6ea4e6f --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/pass/cfg.go @@ -0,0 +1,81 @@ +package pass + +import ( + "errors" + "fmt" + + "github.com/mmcloughlin/avo/ir" +) + +// LabelTarget populates the LabelTarget of the given function. This maps from +// label name to the following instruction. +func LabelTarget(fn *ir.Function) error { + target := map[ir.Label]*ir.Instruction{} + var pending []ir.Label + for _, node := range fn.Nodes { + switch n := node.(type) { + case ir.Label: + if _, found := target[n]; found { + return fmt.Errorf("duplicate label \"%s\"", n) + } + pending = append(pending, n) + case *ir.Instruction: + for _, label := range pending { + target[label] = n + } + pending = nil + } + } + if len(pending) != 0 { + return errors.New("function ends with label") + } + fn.LabelTarget = target + return nil +} + +// CFG constructs the call-flow-graph for the function. +func CFG(fn *ir.Function) error { + is := fn.Instructions() + n := len(is) + + // Populate successors. + for i := 0; i < n; i++ { + cur := is[i] + var nxt *ir.Instruction + if i+1 < n { + nxt = is[i+1] + } + + // If it's a branch, locate the target. + if cur.IsBranch { + lbl := cur.TargetLabel() + if lbl == nil { + return errors.New("no label for branch instruction") + } + target, found := fn.LabelTarget[*lbl] + if !found { + return fmt.Errorf("unknown label %q", *lbl) + } + cur.Succ = append(cur.Succ, target) + } + + // Otherwise, could continue to the following instruction. + switch { + case cur.IsTerminal: + case cur.IsUnconditionalBranch(): + default: + cur.Succ = append(cur.Succ, nxt) + } + } + + // Populate predecessors. + for _, i := range is { + for _, s := range i.Succ { + if s != nil { + s.Pred = append(s.Pred, i) + } + } + } + + return nil +} diff --git a/vendor/github.com/mmcloughlin/avo/pass/cleanup.go b/vendor/github.com/mmcloughlin/avo/pass/cleanup.go new file mode 100644 index 0000000000..d91250f3b8 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/pass/cleanup.go @@ -0,0 +1,123 @@ +package pass + +import ( + "github.com/mmcloughlin/avo/ir" + "github.com/mmcloughlin/avo/operand" +) + +// PruneJumpToFollowingLabel removes jump instructions that target an +// immediately following label. +func PruneJumpToFollowingLabel(fn *ir.Function) error { + for i := 0; i+1 < len(fn.Nodes); i++ { + node := fn.Nodes[i] + next := fn.Nodes[i+1] + + // This node is an unconditional jump. + inst, ok := node.(*ir.Instruction) + if !ok || !inst.IsBranch || inst.IsConditional { + continue + } + + target := inst.TargetLabel() + if target == nil { + continue + } + + // And the jump target is the immediately following node. + lbl, ok := next.(ir.Label) + if !ok || lbl != *target { + continue + } + + // Then the jump is unnecessary and can be removed. + fn.Nodes = deletenode(fn.Nodes, i) + i-- + } + + return nil +} + +// PruneDanglingLabels removes labels that are not referenced by any branches. +func PruneDanglingLabels(fn *ir.Function) error { + // Count label references. + count := map[ir.Label]int{} + for _, n := range fn.Nodes { + i, ok := n.(*ir.Instruction) + if !ok || !i.IsBranch { + continue + } + + target := i.TargetLabel() + if target == nil { + continue + } + + count[*target]++ + } + + // Look for labels with no references. + for i := 0; i < len(fn.Nodes); i++ { + node := fn.Nodes[i] + lbl, ok := node.(ir.Label) + if !ok { + continue + } + + if count[lbl] == 0 { + fn.Nodes = deletenode(fn.Nodes, i) + i-- + } + } + + return nil +} + +// PruneSelfMoves removes move instructions from one register to itself. +func PruneSelfMoves(fn *ir.Function) error { + return removeinstructions(fn, func(i *ir.Instruction) bool { + switch i.Opcode { + case "MOVB", "MOVW", "MOVL", "MOVQ": + default: + return false + } + + return operand.IsRegister(i.Operands[0]) && operand.IsRegister(i.Operands[1]) && i.Operands[0] == i.Operands[1] + }) +} + +// removeinstructions deletes instructions from the given function which match predicate. +func removeinstructions(fn *ir.Function, predicate func(*ir.Instruction) bool) error { + // Removal of instructions has the potential to invalidate CFG structures. + // Clear them to prevent accidental use of stale structures after this pass. + invalidatecfg(fn) + + for i := 0; i < len(fn.Nodes); i++ { + n := fn.Nodes[i] + + inst, ok := n.(*ir.Instruction) + if !ok || !predicate(inst) { + continue + } + + fn.Nodes = deletenode(fn.Nodes, i) + } + + return nil +} + +// deletenode deletes node i from nodes and returns the resulting slice. +func deletenode(nodes []ir.Node, i int) []ir.Node { + n := len(nodes) + copy(nodes[i:], nodes[i+1:]) + nodes[n-1] = nil + return nodes[:n-1] +} + +// invalidatecfg clears CFG structures. +func invalidatecfg(fn *ir.Function) { + fn.LabelTarget = nil + for _, i := range fn.Instructions() { + i.Pred = nil + i.Succ = nil + } +} diff --git a/vendor/github.com/mmcloughlin/avo/pass/isa.go b/vendor/github.com/mmcloughlin/avo/pass/isa.go new file mode 100644 index 0000000000..951834d17d --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/pass/isa.go @@ -0,0 +1,31 @@ +package pass + +import ( + "sort" + + "github.com/mmcloughlin/avo/ir" +) + +// RequiredISAExtensions determines ISA extensions required for the given +// function. Populates the ISA field. +func RequiredISAExtensions(fn *ir.Function) error { + // Collect ISA set. + set := map[string]bool{} + for _, i := range fn.Instructions() { + for _, isa := range i.ISA { + set[isa] = true + } + } + + if len(set) == 0 { + return nil + } + + // Populate the function's ISA field with the unique sorted list. + for isa := range set { + fn.ISA = append(fn.ISA, isa) + } + sort.Strings(fn.ISA) + + return nil +} diff --git a/vendor/github.com/mmcloughlin/avo/pass/pass.go b/vendor/github.com/mmcloughlin/avo/pass/pass.go new file mode 100644 index 0000000000..62f37b1079 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/pass/pass.go @@ -0,0 +1,100 @@ +// Package pass implements processing passes on avo Files. +package pass + +import ( + "io" + + "github.com/mmcloughlin/avo/ir" + "github.com/mmcloughlin/avo/printer" +) + +// Compile pass compiles an avo file. Upon successful completion the avo file +// may be printed to Go assembly. +var Compile = Concat( + Verify, + FunctionPass(PruneJumpToFollowingLabel), + FunctionPass(PruneDanglingLabels), + FunctionPass(LabelTarget), + FunctionPass(CFG), + InstructionPass(ZeroExtend32BitOutputs), + FunctionPass(Liveness), + FunctionPass(AllocateRegisters), + FunctionPass(BindRegisters), + FunctionPass(VerifyAllocation), + Func(IncludeTextFlagHeader), + FunctionPass(PruneSelfMoves), + FunctionPass(RequiredISAExtensions), +) + +// Interface for a processing pass. +type Interface interface { + Execute(*ir.File) error +} + +// Func adapts a function to the pass Interface. +type Func func(*ir.File) error + +// Execute calls p. +func (p Func) Execute(f *ir.File) error { + return p(f) +} + +// FunctionPass is a convenience for implementing a full file pass with a +// function that operates on each avo Function independently. +type FunctionPass func(*ir.Function) error + +// Execute calls p on every function in the file. Exits on the first error. +func (p FunctionPass) Execute(f *ir.File) error { + for _, fn := range f.Functions() { + if err := p(fn); err != nil { + return err + } + } + return nil +} + +// InstructionPass is a convenience for implementing a full file pass with a +// function that operates on each Instruction independently. +type InstructionPass func(*ir.Instruction) error + +// Execute calls p on every instruction in the file. Exits on the first error. +func (p InstructionPass) Execute(f *ir.File) error { + for _, fn := range f.Functions() { + for _, i := range fn.Instructions() { + if err := p(i); err != nil { + return err + } + } + } + return nil +} + +// Concat returns a pass that executes the given passes in order, stopping on the first error. +func Concat(passes ...Interface) Interface { + return Func(func(f *ir.File) error { + for _, p := range passes { + if err := p.Execute(f); err != nil { + return err + } + } + return nil + }) +} + +// Output pass prints a file. +type Output struct { + Writer io.WriteCloser + Printer printer.Printer +} + +// Execute prints f with the configured Printer and writes output to Writer. +func (o *Output) Execute(f *ir.File) error { + b, err := o.Printer.Print(f) + if err != nil { + return err + } + if _, err = o.Writer.Write(b); err != nil { + return err + } + return o.Writer.Close() +} diff --git a/vendor/github.com/mmcloughlin/avo/pass/reg.go b/vendor/github.com/mmcloughlin/avo/pass/reg.go new file mode 100644 index 0000000000..79147b030d --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/pass/reg.go @@ -0,0 +1,139 @@ +package pass + +import ( + "errors" + + "github.com/mmcloughlin/avo/ir" + "github.com/mmcloughlin/avo/operand" + "github.com/mmcloughlin/avo/reg" +) + +// ZeroExtend32BitOutputs applies the rule that "32-bit operands generate a +// 32-bit result, zero-extended to a 64-bit result in the destination +// general-purpose register" (Intel Software Developer’s Manual, Volume 1, +// 3.4.1.1). +func ZeroExtend32BitOutputs(i *ir.Instruction) error { + for j, op := range i.Outputs { + if !operand.IsR32(op) { + continue + } + r, ok := op.(reg.GP) + if !ok { + panic("r32 operand should satisfy reg.GP") + } + i.Outputs[j] = r.As64() + } + return nil +} + +// Liveness computes register liveness. +func Liveness(fn *ir.Function) error { + // Note this implementation is initially naive so as to be "obviously correct". + // There are a well-known optimizations we can apply if necessary. + + is := fn.Instructions() + + // Process instructions in reverse: poor approximation to topological sort. + // TODO(mbm): process instructions in topological sort order + for l, r := 0, len(is)-1; l < r; l, r = l+1, r-1 { + is[l], is[r] = is[r], is[l] + } + + // Initialize. + for _, i := range is { + i.LiveIn = reg.NewMaskSetFromRegisters(i.InputRegisters()) + i.LiveOut = reg.NewEmptyMaskSet() + } + + // Iterative dataflow analysis. + for { + changes := false + + for _, i := range is { + // out[n] = UNION[s IN succ[n]] in[s] + for _, s := range i.Succ { + if s == nil { + continue + } + changes = i.LiveOut.Update(s.LiveIn) || changes + } + + // in[n] = use[n] UNION (out[n] - def[n]) + def := reg.NewMaskSetFromRegisters(i.OutputRegisters()) + changes = i.LiveIn.Update(i.LiveOut.Difference(def)) || changes + } + + if !changes { + break + } + } + + return nil +} + +// AllocateRegisters performs register allocation. +func AllocateRegisters(fn *ir.Function) error { + // Populate allocators (one per kind). + as := map[reg.Kind]*Allocator{} + for _, i := range fn.Instructions() { + for _, r := range i.Registers() { + k := r.Kind() + if _, found := as[k]; !found { + a, err := NewAllocatorForKind(k) + if err != nil { + return err + } + as[k] = a + } + as[k].Add(r.ID()) + } + } + + // Record register interferences. + for _, i := range fn.Instructions() { + for _, d := range i.OutputRegisters() { + k := d.Kind() + out := i.LiveOut.OfKind(k) + out.DiscardRegister(d) + as[k].AddInterferenceSet(d, out) + } + } + + // Execute register allocation. + fn.Allocation = reg.NewEmptyAllocation() + for _, a := range as { + al, err := a.Allocate() + if err != nil { + return err + } + if err := fn.Allocation.Merge(al); err != nil { + return err + } + } + + return nil +} + +// BindRegisters applies the result of register allocation, replacing all virtual registers with their assigned physical registers. +func BindRegisters(fn *ir.Function) error { + for _, i := range fn.Instructions() { + for idx := range i.Operands { + i.Operands[idx] = operand.ApplyAllocation(i.Operands[idx], fn.Allocation) + } + } + return nil +} + +// VerifyAllocation performs sanity checks following register allocation. +func VerifyAllocation(fn *ir.Function) error { + // All registers should be physical. + for _, i := range fn.Instructions() { + for _, r := range i.Registers() { + if reg.ToPhysical(r) == nil { + return errors.New("non physical register found") + } + } + } + + return nil +} diff --git a/vendor/github.com/mmcloughlin/avo/pass/textflag.go b/vendor/github.com/mmcloughlin/avo/pass/textflag.go new file mode 100644 index 0000000000..35a848b830 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/pass/textflag.go @@ -0,0 +1,42 @@ +package pass + +import ( + "github.com/mmcloughlin/avo/attr" + "github.com/mmcloughlin/avo/ir" +) + +// IncludeTextFlagHeader includes textflag.h if necessary. +func IncludeTextFlagHeader(f *ir.File) error { + const textflagheader = "textflag.h" + + // Check if we already have it. + for _, path := range f.Includes { + if path == textflagheader { + return nil + } + } + + // Add it if necessary. + if requirestextflags(f) { + f.Includes = append(f.Includes, textflagheader) + } + + return nil +} + +// requirestextflags returns whether the file uses flags in the textflags.h header. +func requirestextflags(f *ir.File) bool { + for _, s := range f.Sections { + var a attr.Attribute + switch s := s.(type) { + case *ir.Function: + a = s.Attributes + case *ir.Global: + a = s.Attributes + } + if a.ContainsTextFlags() { + return true + } + } + return false +} diff --git a/vendor/github.com/mmcloughlin/avo/pass/verify.go b/vendor/github.com/mmcloughlin/avo/pass/verify.go new file mode 100644 index 0000000000..1e7b3683ab --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/pass/verify.go @@ -0,0 +1,32 @@ +package pass + +import ( + "errors" + + "github.com/mmcloughlin/avo/ir" + "github.com/mmcloughlin/avo/operand" +) + +// Verify pass validates an avo file. +var Verify = Concat( + InstructionPass(VerifyMemOperands), +) + +// VerifyMemOperands checks the instruction's memory operands. +func VerifyMemOperands(i *ir.Instruction) error { + for _, op := range i.Operands { + m, ok := op.(operand.Mem) + if !ok { + continue + } + + if m.Base == nil { + return errors.New("bad memory operand: missing base register") + } + + if m.Index != nil && m.Scale == 0 { + return errors.New("bad memory operand: index register with scale 0") + } + } + return nil +} diff --git a/vendor/github.com/mmcloughlin/avo/printer/goasm.go b/vendor/github.com/mmcloughlin/avo/printer/goasm.go new file mode 100644 index 0000000000..0d8a12cbe2 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/printer/goasm.go @@ -0,0 +1,186 @@ +package printer + +import ( + "strconv" + "strings" + + "github.com/mmcloughlin/avo/internal/prnt" + "github.com/mmcloughlin/avo/ir" + "github.com/mmcloughlin/avo/operand" +) + +// dot is the pesky unicode dot used in Go assembly. +const dot = "\u00b7" + +type goasm struct { + cfg Config + prnt.Generator + + instructions []*ir.Instruction + clear bool +} + +// NewGoAsm constructs a printer for writing Go assembly files. +func NewGoAsm(cfg Config) Printer { + return &goasm{cfg: cfg} +} + +func (p *goasm) Print(f *ir.File) ([]byte, error) { + p.header(f) + for _, s := range f.Sections { + switch s := s.(type) { + case *ir.Function: + p.function(s) + case *ir.Global: + p.global(s) + default: + panic("unknown section type") + } + } + return p.Result() +} + +func (p *goasm) header(f *ir.File) { + p.Comment(p.cfg.GeneratedWarning()) + + if len(f.Constraints) > 0 { + p.NL() + p.Printf(f.Constraints.GoString()) + } + + if len(f.Includes) > 0 { + p.NL() + p.includes(f.Includes) + } +} + +func (p *goasm) includes(paths []string) { + for _, path := range paths { + p.Printf("#include \"%s\"\n", path) + } +} + +func (p *goasm) function(f *ir.Function) { + p.NL() + p.Comment(f.Stub()) + + if len(f.ISA) > 0 { + p.Comment("Requires: " + strings.Join(f.ISA, ", ")) + } + + // Reference: https://github.com/golang/go/blob/b115207baf6c2decc3820ada4574ef4e5ad940ec/src/cmd/internal/obj/util.go#L166-L176 + // + // if p.As == ATEXT { + // // If there are attributes, print them. Otherwise, skip the comma. + // // In short, print one of these two: + // // TEXT foo(SB), DUPOK|NOSPLIT, $0 + // // TEXT foo(SB), $0 + // s := p.From.Sym.Attribute.TextAttrString() + // if s != "" { + // fmt.Fprintf(&buf, "%s%s", sep, s) + // sep = ", " + // } + // } + // + p.Printf("TEXT %s%s(SB)", dot, f.Name) + if f.Attributes != 0 { + p.Printf(", %s", f.Attributes.Asm()) + } + p.Printf(", %s\n", textsize(f)) + + p.clear = true + for _, node := range f.Nodes { + switch n := node.(type) { + case *ir.Instruction: + p.instruction(n) + if n.IsTerminal || n.IsUnconditionalBranch() { + p.flush() + } + case ir.Label: + p.flush() + p.ensureclear() + p.Printf("%s:\n", n) + case *ir.Comment: + p.flush() + p.ensureclear() + for _, line := range n.Lines { + p.Printf("\t// %s\n", line) + } + default: + panic("unexpected node type") + } + } + p.flush() +} + +func (p *goasm) instruction(i *ir.Instruction) { + p.instructions = append(p.instructions, i) + p.clear = false +} + +func (p *goasm) flush() { + if len(p.instructions) == 0 { + return + } + + // Determine instruction width. Instructions with no operands are not + // considered in this calculation. + width := 0 + for _, i := range p.instructions { + if len(i.Operands) > 0 && len(i.Opcode) > width { + width = len(i.Opcode) + } + } + + // Output instruction block. + for _, i := range p.instructions { + if len(i.Operands) > 0 { + p.Printf("\t%-*s%s\n", width+1, i.Opcode, joinOperands(i.Operands)) + } else { + p.Printf("\t%s\n", i.Opcode) + } + } + + p.instructions = nil +} + +func (p *goasm) ensureclear() { + if !p.clear { + p.NL() + p.clear = true + } +} + +func (p *goasm) global(g *ir.Global) { + p.NL() + for _, d := range g.Data { + a := operand.NewDataAddr(g.Symbol, d.Offset) + p.Printf("DATA %s/%d, %s\n", a.Asm(), d.Value.Bytes(), d.Value.Asm()) + } + p.Printf("GLOBL %s(SB), %s, $%d\n", g.Symbol, g.Attributes.Asm(), g.Size) +} + +func textsize(f *ir.Function) string { + // Reference: https://github.com/golang/go/blob/b115207baf6c2decc3820ada4574ef4e5ad940ec/src/cmd/internal/obj/util.go#L260-L265 + // + // case TYPE_TEXTSIZE: + // if a.Val.(int32) == objabi.ArgsSizeUnknown { + // str = fmt.Sprintf("$%d", a.Offset) + // } else { + // str = fmt.Sprintf("$%d-%d", a.Offset, a.Val.(int32)) + // } + // + s := "$" + strconv.Itoa(f.FrameBytes()) + if argsize := f.ArgumentBytes(); argsize > 0 { + return s + "-" + strconv.Itoa(argsize) + } + return s +} + +func joinOperands(operands []operand.Op) string { + asm := make([]string, len(operands)) + for i, op := range operands { + asm[i] = op.Asm() + } + return strings.Join(asm, ", ") +} diff --git a/vendor/github.com/mmcloughlin/avo/printer/printer.go b/vendor/github.com/mmcloughlin/avo/printer/printer.go new file mode 100644 index 0000000000..b562c74ea8 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/printer/printer.go @@ -0,0 +1,98 @@ +// Package printer implements printing of avo files in various formats. +package printer + +import ( + "fmt" + "os" + "path/filepath" + "strings" + + "github.com/mmcloughlin/avo/internal/stack" + "github.com/mmcloughlin/avo/ir" +) + +// Printer can produce output for an avo File. +type Printer interface { + Print(*ir.File) ([]byte, error) +} + +// Builder can construct a printer. +type Builder func(Config) Printer + +// Config represents general printing configuration. +type Config struct { + // Command-line arguments passed to the generator. If provided, this will be + // included in a code generation warning. + Argv []string + + // Name of the code generator. + Name string + + // Name of Go package the generated code will belong to. + Pkg string +} + +// NewDefaultConfig produces a config with Name "avo". +// The package name is guessed from the current directory. +func NewDefaultConfig() Config { + return Config{ + Name: "avo", + Pkg: pkg(), + } +} + +// NewArgvConfig constructs a Config from os.Args. +// The package name is guessed from the current directory. +func NewArgvConfig() Config { + return Config{ + Argv: os.Args, + Pkg: pkg(), + } +} + +// NewGoRunConfig produces a Config for a generator that's expected to be +// executed via "go run ...". +func NewGoRunConfig() Config { + path := mainfile() + if path == "" { + return NewDefaultConfig() + } + argv := []string{"go", "run", filepath.Base(path)} + if len(os.Args) > 1 { + argv = append(argv, os.Args[1:]...) + } + return Config{ + Argv: argv, + Pkg: pkg(), + } +} + +// GeneratedBy returns a description of the code generator. +func (c Config) GeneratedBy() string { + if c.Argv == nil { + return c.Name + } + return fmt.Sprintf("command: %s", strings.Join(c.Argv, " ")) +} + +// GeneratedWarning returns text for a code generation warning. Conforms to https://golang.org/s/generatedcode. +func (c Config) GeneratedWarning() string { + return fmt.Sprintf("Code generated by %s. DO NOT EDIT.", c.GeneratedBy()) +} + +// mainfile attempts to determine the file path of the main function by +// inspecting the stack. Returns empty string on failure. +func mainfile() string { + if m := stack.Main(); m != nil { + return m.File + } + return "" +} + +// pkg guesses the name of the package from the working directory. +func pkg() string { + if cwd, err := os.Getwd(); err == nil { + return filepath.Base(cwd) + } + return "" +} diff --git a/vendor/github.com/mmcloughlin/avo/printer/stubs.go b/vendor/github.com/mmcloughlin/avo/printer/stubs.go new file mode 100644 index 0000000000..171bc62991 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/printer/stubs.go @@ -0,0 +1,45 @@ +package printer + +import ( + "github.com/mmcloughlin/avo/internal/prnt" + "github.com/mmcloughlin/avo/ir" +) + +type stubs struct { + cfg Config + prnt.Generator +} + +// NewStubs constructs a printer for writing stub function declarations. +func NewStubs(cfg Config) Printer { + return &stubs{cfg: cfg} +} + +func (s *stubs) Print(f *ir.File) ([]byte, error) { + s.Comment(s.cfg.GeneratedWarning()) + + if len(f.Constraints) > 0 { + s.NL() + s.Printf(f.Constraints.GoString()) + } + + s.NL() + s.Printf("package %s\n", s.cfg.Pkg) + for _, fn := range f.Functions() { + s.NL() + s.Comment(fn.Doc...) + for _, pragma := range fn.Pragmas { + s.pragma(pragma) + } + s.Printf("%s\n", fn.Stub()) + } + return s.Result() +} + +func (s *stubs) pragma(p ir.Pragma) { + s.Printf("//go:%s", p.Directive) + for _, arg := range p.Arguments { + s.Printf(" %s", arg) + } + s.NL() +} diff --git a/vendor/github.com/mmcloughlin/avo/reg/collection.go b/vendor/github.com/mmcloughlin/avo/reg/collection.go new file mode 100644 index 0000000000..d35c3a03ce --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/reg/collection.go @@ -0,0 +1,54 @@ +package reg + +// Collection represents a collection of virtual registers. This is primarily +// useful for allocating virtual registers with distinct IDs. +type Collection struct { + idx map[Kind]Index +} + +// NewCollection builds an empty register collection. +func NewCollection() *Collection { + return &Collection{ + idx: map[Kind]Index{}, + } +} + +// VirtualRegister allocates and returns a new virtual register of the given kind and width. +func (c *Collection) VirtualRegister(k Kind, s Spec) Virtual { + idx := c.idx[k] + c.idx[k]++ + return NewVirtual(idx, k, s) +} + +// GP8L allocates and returns a general-purpose 8-bit register (low byte). +func (c *Collection) GP8L() GPVirtual { return c.GP(S8L) } + +// GP8H allocates and returns a general-purpose 8-bit register (high byte). +func (c *Collection) GP8H() GPVirtual { return c.GP(S8H) } + +// GP8 allocates and returns a general-purpose 8-bit register (low byte). +func (c *Collection) GP8() GPVirtual { return c.GP8L() } + +// GP16 allocates and returns a general-purpose 16-bit register. +func (c *Collection) GP16() GPVirtual { return c.GP(S16) } + +// GP32 allocates and returns a general-purpose 32-bit register. +func (c *Collection) GP32() GPVirtual { return c.GP(S32) } + +// GP64 allocates and returns a general-purpose 64-bit register. +func (c *Collection) GP64() GPVirtual { return c.GP(S64) } + +// GP allocates and returns a general-purpose register of the given width. +func (c *Collection) GP(s Spec) GPVirtual { return newgpv(c.VirtualRegister(KindGP, s)) } + +// XMM allocates and returns a 128-bit vector register. +func (c *Collection) XMM() VecVirtual { return c.Vec(S128) } + +// YMM allocates and returns a 256-bit vector register. +func (c *Collection) YMM() VecVirtual { return c.Vec(S256) } + +// ZMM allocates and returns a 512-bit vector register. +func (c *Collection) ZMM() VecVirtual { return c.Vec(S512) } + +// Vec allocates and returns a vector register of the given width. +func (c *Collection) Vec(s Spec) VecVirtual { return newvecv(c.VirtualRegister(KindVector, s)) } diff --git a/vendor/github.com/mmcloughlin/avo/reg/doc.go b/vendor/github.com/mmcloughlin/avo/reg/doc.go new file mode 100644 index 0000000000..1c0aee374a --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/reg/doc.go @@ -0,0 +1,2 @@ +// Package reg provides types for physical and virtual registers, and definitions of x86-64 register families. +package reg diff --git a/vendor/github.com/mmcloughlin/avo/reg/set.go b/vendor/github.com/mmcloughlin/avo/reg/set.go new file mode 100644 index 0000000000..2cf88147c5 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/reg/set.go @@ -0,0 +1,112 @@ +package reg + +// MaskSet maps register IDs to masks. +type MaskSet map[ID]uint16 + +// NewEmptyMaskSet builds an empty register mask set. +func NewEmptyMaskSet() MaskSet { + return MaskSet{} +} + +// NewMaskSetFromRegisters forms a mask set from the given register list. +func NewMaskSetFromRegisters(rs []Register) MaskSet { + s := NewEmptyMaskSet() + for _, r := range rs { + s.AddRegister(r) + } + return s +} + +// Clone returns a copy of s. +func (s MaskSet) Clone() MaskSet { + c := NewEmptyMaskSet() + for id, mask := range s { + c.Add(id, mask) + } + return c +} + +// Add mask to the given register ID. +// Reports whether this made any change to the set. +func (s MaskSet) Add(id ID, mask uint16) bool { + if (s[id] & mask) == mask { + return false + } + s[id] |= mask + return true +} + +// AddRegister is a convenience for adding the register's (ID, mask) to the set. +// Reports whether this made any change to the set. +func (s MaskSet) AddRegister(r Register) bool { + return s.Add(r.ID(), r.Mask()) +} + +// Discard clears masked bits from register ID. +// Reports whether this made any change to the set. +func (s MaskSet) Discard(id ID, mask uint16) bool { + if curr, found := s[id]; !found || (curr&mask) == 0 { + return false + } + s[id] &^= mask + if s[id] == 0 { + delete(s, id) + } + return true +} + +// DiscardRegister is a convenience for discarding the register's (ID, mask) from the set. +// Reports whether this made any change to the set. +func (s MaskSet) DiscardRegister(r Register) bool { + return s.Discard(r.ID(), r.Mask()) +} + +// Update adds masks in t to s. +// Reports whether this made any change to the set. +func (s MaskSet) Update(t MaskSet) bool { + change := false + for id, mask := range t { + change = s.Add(id, mask) || change + } + return change +} + +// Difference returns the set of registers in s but not t. +func (s MaskSet) Difference(t MaskSet) MaskSet { + d := s.Clone() + d.DifferenceUpdate(t) + return d +} + +// DifferenceUpdate removes every element of t from s. +func (s MaskSet) DifferenceUpdate(t MaskSet) bool { + change := false + for id, mask := range t { + change = s.Discard(id, mask) || change + } + return change +} + +// Equals returns true if s and t contain the same masks. +func (s MaskSet) Equals(t MaskSet) bool { + if len(s) != len(t) { + return false + } + for id, mask := range s { + if _, found := t[id]; !found || mask != t[id] { + return false + } + } + return true +} + +// OfKind returns the set of elements of s with kind k. +func (s MaskSet) OfKind(k Kind) MaskSet { + t := NewEmptyMaskSet() + for id, mask := range s { + if id.Kind() == k { + t.Add(id, mask) + } + } + return t +} diff --git a/vendor/github.com/mmcloughlin/avo/reg/types.go b/vendor/github.com/mmcloughlin/avo/reg/types.go new file mode 100644 index 0000000000..9f69e9168b --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/reg/types.go @@ -0,0 +1,304 @@ +package reg + +import ( + "errors" + "fmt" +) + +// Kind is a class of registers. +type Kind uint8 + +// Index of a register within a kind. +type Index uint16 + +// Family is a collection of Physical registers of a common kind. +type Family struct { + Kind Kind + registers []Physical +} + +// define builds a register and adds it to the Family. +func (f *Family) define(s Spec, idx Index, name string, flags ...Info) Physical { + r := newregister(f, s, idx, name, flags...) + f.add(r) + return r +} + +// add r to the family. +func (f *Family) add(r Physical) { + if r.Kind() != f.Kind { + panic("bad kind") + } + f.registers = append(f.registers, r) +} + +// Virtual returns a virtual register from this family's kind. +func (f *Family) Virtual(idx Index, s Spec) Virtual { + return NewVirtual(idx, f.Kind, s) +} + +// Registers returns the registers in this family. +func (f *Family) Registers() []Physical { + return append([]Physical(nil), f.registers...) +} + +// Lookup returns the register with given physical index and spec. Returns nil if no such register exists. +func (f *Family) Lookup(idx Index, s Spec) Physical { + for _, r := range f.registers { + if r.PhysicalIndex() == idx && r.Mask() == s.Mask() { + return r + } + } + return nil +} + +// ID is a register identifier. +type ID uint32 + +// newid builds a new register ID from the virtual flag v, kind and index. +func newid(v uint8, kind Kind, idx Index) ID { + return ID(v) | (ID(kind) << 8) | (ID(idx) << 16) +} + +// IsVirtual reports whether this is an ID for a virtual register. +func (id ID) IsVirtual() bool { return (id & 1) == 1 } + +// IsPhysical reports whether this is an ID for a physical register. +func (id ID) IsPhysical() bool { return !id.IsVirtual() } + +// Kind extracts the kind from the register ID. +func (id ID) Kind() Kind { return Kind(id >> 8) } + +// Index extracts the index from the register ID. +func (id ID) Index() Index { return Index(id >> 16) } + +// Register represents a virtual or physical register. +type Register interface { + ID() ID + Kind() Kind + Size() uint + Mask() uint16 + Asm() string + as(Spec) Register + spec() Spec + register() +} + +// Equal reports whether a and b are equal registers. +func Equal(a, b Register) bool { + return (a.ID() == b.ID()) && (a.Mask() == b.Mask()) +} + +// Virtual is a register of a given type and size, not yet allocated to a physical register. +type Virtual interface { + VirtualIndex() Index + Register +} + +// ToVirtual converts r to Virtual if possible, otherwise returns nil. +func ToVirtual(r Register) Virtual { + if v, ok := r.(Virtual); ok { + return v + } + return nil +} + +type virtual struct { + idx Index + kind Kind + Spec +} + +// NewVirtual builds a Virtual register. +func NewVirtual(idx Index, k Kind, s Spec) Virtual { + return virtual{ + idx: idx, + kind: k, + Spec: s, + } +} + +func (v virtual) ID() ID { return newid(1, v.kind, v.idx) } +func (v virtual) VirtualIndex() Index { return v.idx } +func (v virtual) Kind() Kind { return v.kind } + +func (v virtual) Asm() string { + // TODO(mbm): decide on virtual register syntax + return fmt.Sprintf("", v.idx, v.Kind(), v.Size()) +} + +func (v virtual) as(s Spec) Register { + return virtual{ + idx: v.idx, + kind: v.kind, + Spec: s, + } +} + +func (v virtual) spec() Spec { return v.Spec } +func (v virtual) register() {} + +// Info is a bitmask of register properties. +type Info uint8 + +// Defined register Info flags. +const ( + None Info = 0 + Restricted Info = 1 << iota +) + +// Physical is a concrete register. +type Physical interface { + PhysicalIndex() Index + Info() Info + Register +} + +// ToPhysical converts r to Physical if possible, otherwise returns nil. +func ToPhysical(r Register) Physical { + if p, ok := r.(Physical); ok { + return p + } + return nil +} + +// register implements Physical. +type register struct { + family *Family + idx Index + name string + info Info + Spec +} + +func newregister(f *Family, s Spec, idx Index, name string, flags ...Info) register { + r := register{ + family: f, + idx: idx, + name: name, + info: None, + Spec: s, + } + for _, flag := range flags { + r.info |= flag + } + return r +} + +func (r register) ID() ID { return newid(0, r.Kind(), r.idx) } +func (r register) PhysicalIndex() Index { return r.idx } +func (r register) Kind() Kind { return r.family.Kind } +func (r register) Asm() string { return r.name } +func (r register) Info() Info { return r.info } + +func (r register) as(s Spec) Register { + return r.family.Lookup(r.PhysicalIndex(), s) +} + +func (r register) spec() Spec { return r.Spec } +func (r register) register() {} + +// Spec defines the size of a register as well as the bit ranges it occupies in +// an underlying physical register. +type Spec uint16 + +// Spec values required for x86-64. +const ( + S0 Spec = 0x0 // zero value reserved for pseudo registers + S8L Spec = 0x1 + S8H Spec = 0x2 + S8 = S8L + S16 Spec = 0x3 + S32 Spec = 0x7 + S64 Spec = 0xf + S128 Spec = 0x1f + S256 Spec = 0x3f + S512 Spec = 0x7f +) + +// Mask returns a mask representing which bytes of an underlying register are +// used by this register. This is almost always the low bytes, except for the +// case of the high-byte registers. If bit n of the mask is set, this means +// bytes 2^(n-1) to 2^n-1 are used. +func (s Spec) Mask() uint16 { + return uint16(s) +} + +// Size returns the register width in bytes. +func (s Spec) Size() uint { + x := uint(s) + return (x >> 1) + (x & 1) +} + +// LookupPhysical returns the physical register with the given parameters, or nil if not found. +func LookupPhysical(k Kind, idx Index, s Spec) Physical { + f := FamilyOfKind(k) + if f == nil { + return nil + } + return f.Lookup(idx, s) +} + +// LookupID returns the physical register with the given id and spec, or nil if not found. +func LookupID(id ID, s Spec) Physical { + if id.IsVirtual() { + return nil + } + return LookupPhysical(id.Kind(), id.Index(), s) +} + +// Allocation records a register allocation. +type Allocation map[ID]ID + +// NewEmptyAllocation builds an empty register allocation. +func NewEmptyAllocation() Allocation { + return Allocation{} +} + +// Merge allocations from b into a. Errors if there is disagreement on a common +// register. +func (a Allocation) Merge(b Allocation) error { + for id, p := range b { + if alt, found := a[id]; found && alt != p { + return errors.New("disagreement on overlapping register") + } + a[id] = p + } + return nil +} + +// LookupDefault returns the register ID assigned by this allocation, returning +// id if none is found. +func (a Allocation) LookupDefault(id ID) ID { + if _, found := a[id]; found { + return a[id] + } + return id +} + +// LookupRegister the allocation for register r, or return nil if there is none. +func (a Allocation) LookupRegister(r Register) Physical { + // Return immediately if it is already a physical register. + if p := ToPhysical(r); p != nil { + return p + } + + // Lookup an allocation for this virtual ID. + id, found := a[r.ID()] + if !found { + return nil + } + + return LookupID(id, r.spec()) +} + +// LookupRegisterDefault returns the register assigned to r, or r itself if there is none. +func (a Allocation) LookupRegisterDefault(r Register) Register { + if r == nil { + return nil + } + if p := a.LookupRegister(r); p != nil { + return p + } + return r +} diff --git a/vendor/github.com/mmcloughlin/avo/reg/x86.go b/vendor/github.com/mmcloughlin/avo/reg/x86.go new file mode 100644 index 0000000000..a1ec94c73f --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/reg/x86.go @@ -0,0 +1,331 @@ +package reg + +// Register kinds. +const ( + KindPseudo Kind = iota + KindGP + KindVector +) + +// Declare register families. +var ( + Pseudo = &Family{Kind: KindPseudo} + GeneralPurpose = &Family{Kind: KindGP} + Vector = &Family{Kind: KindVector} + + Families = []*Family{ + Pseudo, + GeneralPurpose, + Vector, + } +) + +var familiesByKind = map[Kind]*Family{} + +func init() { + for _, f := range Families { + familiesByKind[f.Kind] = f + } +} + +// FamilyOfKind returns the Family of registers of the given kind, or nil if not found. +func FamilyOfKind(k Kind) *Family { + return familiesByKind[k] +} + +// Pseudo registers. +var ( + FramePointer = Pseudo.define(S0, 0, "FP") + ProgramCounter = Pseudo.define(S0, 0, "PC") + StaticBase = Pseudo.define(S0, 0, "SB") + StackPointer = Pseudo.define(S0, 0, "SP") +) + +// GP provides additional methods for general purpose registers. +type GP interface { + As8() Register + As8L() Register + As8H() Register + As16() Register + As32() Register + As64() Register +} + +// GPPhysical is a general-purpose physical register. +type GPPhysical interface { + Physical + GP +} + +type gpp struct { + Physical +} + +func newgpp(r Physical) GPPhysical { return gpp{Physical: r} } + +func (p gpp) As8() Register { return newgpp(p.as(S8).(Physical)) } +func (p gpp) As8L() Register { return newgpp(p.as(S8L).(Physical)) } +func (p gpp) As8H() Register { return newgpp(p.as(S8H).(Physical)) } +func (p gpp) As16() Register { return newgpp(p.as(S16).(Physical)) } +func (p gpp) As32() Register { return newgpp(p.as(S32).(Physical)) } +func (p gpp) As64() Register { return newgpp(p.as(S64).(Physical)) } + +// GPVirtual is a general-purpose virtual register. +type GPVirtual interface { + Virtual + GP +} + +type gpv struct { + Virtual +} + +func newgpv(v Virtual) GPVirtual { return gpv{Virtual: v} } + +func (v gpv) As8() Register { return newgpv(v.as(S8).(Virtual)) } +func (v gpv) As8L() Register { return newgpv(v.as(S8L).(Virtual)) } +func (v gpv) As8H() Register { return newgpv(v.as(S8H).(Virtual)) } +func (v gpv) As16() Register { return newgpv(v.as(S16).(Virtual)) } +func (v gpv) As32() Register { return newgpv(v.as(S32).(Virtual)) } +func (v gpv) As64() Register { return newgpv(v.as(S64).(Virtual)) } + +func gp(s Spec, id Index, name string, flags ...Info) GPPhysical { + r := newgpp(newregister(GeneralPurpose, s, id, name, flags...)) + GeneralPurpose.add(r) + return r +} + +// General purpose registers. +var ( + // Low byte + AL = gp(S8L, 0, "AL") + CL = gp(S8L, 1, "CL") + DL = gp(S8L, 2, "DL") + BL = gp(S8L, 3, "BL") + + // High byte + AH = gp(S8H, 0, "AH") + CH = gp(S8H, 1, "CH") + DH = gp(S8H, 2, "DH") + BH = gp(S8H, 3, "BH") + + // 8-bit + SPB = gp(S8, 4, "SP", Restricted) + BPB = gp(S8, 5, "BP") + SIB = gp(S8, 6, "SI") + DIB = gp(S8, 7, "DI") + R8B = gp(S8, 8, "R8") + R9B = gp(S8, 9, "R9") + R10B = gp(S8, 10, "R10") + R11B = gp(S8, 11, "R11") + R12B = gp(S8, 12, "R12") + R13B = gp(S8, 13, "R13") + R14B = gp(S8, 14, "R14") + R15B = gp(S8, 15, "R15") + + // 16-bit + AX = gp(S16, 0, "AX") + CX = gp(S16, 1, "CX") + DX = gp(S16, 2, "DX") + BX = gp(S16, 3, "BX") + SP = gp(S16, 4, "SP", Restricted) + BP = gp(S16, 5, "BP") + SI = gp(S16, 6, "SI") + DI = gp(S16, 7, "DI") + R8W = gp(S16, 8, "R8") + R9W = gp(S16, 9, "R9") + R10W = gp(S16, 10, "R10") + R11W = gp(S16, 11, "R11") + R12W = gp(S16, 12, "R12") + R13W = gp(S16, 13, "R13") + R14W = gp(S16, 14, "R14") + R15W = gp(S16, 15, "R15") + + // 32-bit + EAX = gp(S32, 0, "AX") + ECX = gp(S32, 1, "CX") + EDX = gp(S32, 2, "DX") + EBX = gp(S32, 3, "BX") + ESP = gp(S32, 4, "SP", Restricted) + EBP = gp(S32, 5, "BP") + ESI = gp(S32, 6, "SI") + EDI = gp(S32, 7, "DI") + R8L = gp(S32, 8, "R8") + R9L = gp(S32, 9, "R9") + R10L = gp(S32, 10, "R10") + R11L = gp(S32, 11, "R11") + R12L = gp(S32, 12, "R12") + R13L = gp(S32, 13, "R13") + R14L = gp(S32, 14, "R14") + R15L = gp(S32, 15, "R15") + + // 64-bit + RAX = gp(S64, 0, "AX") + RCX = gp(S64, 1, "CX") + RDX = gp(S64, 2, "DX") + RBX = gp(S64, 3, "BX") + RSP = gp(S64, 4, "SP", Restricted) + RBP = gp(S64, 5, "BP") + RSI = gp(S64, 6, "SI") + RDI = gp(S64, 7, "DI") + R8 = gp(S64, 8, "R8") + R9 = gp(S64, 9, "R9") + R10 = gp(S64, 10, "R10") + R11 = gp(S64, 11, "R11") + R12 = gp(S64, 12, "R12") + R13 = gp(S64, 13, "R13") + R14 = gp(S64, 14, "R14") + R15 = gp(S64, 15, "R15") +) + +// Vec provides methods for vector registers. +type Vec interface { + AsX() Register + AsY() Register + AsZ() Register +} + +// VecPhysical is a physical vector register. +type VecPhysical interface { + Physical + Vec +} + +type vecp struct { + Physical + Vec +} + +func newvecp(r Physical) VecPhysical { return vecp{Physical: r} } + +func (p vecp) AsX() Register { return newvecp(p.as(S128).(Physical)) } +func (p vecp) AsY() Register { return newvecp(p.as(S256).(Physical)) } +func (p vecp) AsZ() Register { return newvecp(p.as(S512).(Physical)) } + +// VecVirtual is a virtual vector register. +type VecVirtual interface { + Virtual + Vec +} + +type vecv struct { + Virtual + Vec +} + +func newvecv(v Virtual) VecVirtual { return vecv{Virtual: v} } + +func (v vecv) AsX() Register { return newvecv(v.as(S128).(Virtual)) } +func (v vecv) AsY() Register { return newvecv(v.as(S256).(Virtual)) } +func (v vecv) AsZ() Register { return newvecv(v.as(S512).(Virtual)) } + +func vec(s Spec, id Index, name string, flags ...Info) VecPhysical { + r := newvecp(newregister(Vector, s, id, name, flags...)) + Vector.add(r) + return r +} + +// Vector registers. +var ( + // 128-bit + X0 = vec(S128, 0, "X0") + X1 = vec(S128, 1, "X1") + X2 = vec(S128, 2, "X2") + X3 = vec(S128, 3, "X3") + X4 = vec(S128, 4, "X4") + X5 = vec(S128, 5, "X5") + X6 = vec(S128, 6, "X6") + X7 = vec(S128, 7, "X7") + X8 = vec(S128, 8, "X8") + X9 = vec(S128, 9, "X9") + X10 = vec(S128, 10, "X10") + X11 = vec(S128, 11, "X11") + X12 = vec(S128, 12, "X12") + X13 = vec(S128, 13, "X13") + X14 = vec(S128, 14, "X14") + X15 = vec(S128, 15, "X15") + X16 = vec(S128, 16, "X16") + X17 = vec(S128, 17, "X17") + X18 = vec(S128, 18, "X18") + X19 = vec(S128, 19, "X19") + X20 = vec(S128, 20, "X20") + X21 = vec(S128, 21, "X21") + X22 = vec(S128, 22, "X22") + X23 = vec(S128, 23, "X23") + X24 = vec(S128, 24, "X24") + X25 = vec(S128, 25, "X25") + X26 = vec(S128, 26, "X26") + X27 = vec(S128, 27, "X27") + X28 = vec(S128, 28, "X28") + X29 = vec(S128, 29, "X29") + X30 = vec(S128, 30, "X30") + X31 = vec(S128, 31, "X31") + + // 256-bit + Y0 = vec(S256, 0, "Y0") + Y1 = vec(S256, 1, "Y1") + Y2 = vec(S256, 2, "Y2") + Y3 = vec(S256, 3, "Y3") + Y4 = vec(S256, 4, "Y4") + Y5 = vec(S256, 5, "Y5") + Y6 = vec(S256, 6, "Y6") + Y7 = vec(S256, 7, "Y7") + Y8 = vec(S256, 8, "Y8") + Y9 = vec(S256, 9, "Y9") + Y10 = vec(S256, 10, "Y10") + Y11 = vec(S256, 11, "Y11") + Y12 = vec(S256, 12, "Y12") + Y13 = vec(S256, 13, "Y13") + Y14 = vec(S256, 14, "Y14") + Y15 = vec(S256, 15, "Y15") + Y16 = vec(S256, 16, "Y16") + Y17 = vec(S256, 17, "Y17") + Y18 = vec(S256, 18, "Y18") + Y19 = vec(S256, 19, "Y19") + Y20 = vec(S256, 20, "Y20") + Y21 = vec(S256, 21, "Y21") + Y22 = vec(S256, 22, "Y22") + Y23 = vec(S256, 23, "Y23") + Y24 = vec(S256, 24, "Y24") + Y25 = vec(S256, 25, "Y25") + Y26 = vec(S256, 26, "Y26") + Y27 = vec(S256, 27, "Y27") + Y28 = vec(S256, 28, "Y28") + Y29 = vec(S256, 29, "Y29") + Y30 = vec(S256, 30, "Y30") + Y31 = vec(S256, 31, "Y31") + + // 512-bit + Z0 = vec(S512, 0, "Z0") + Z1 = vec(S512, 1, "Z1") + Z2 = vec(S512, 2, "Z2") + Z3 = vec(S512, 3, "Z3") + Z4 = vec(S512, 4, "Z4") + Z5 = vec(S512, 5, "Z5") + Z6 = vec(S512, 6, "Z6") + Z7 = vec(S512, 7, "Z7") + Z8 = vec(S512, 8, "Z8") + Z9 = vec(S512, 9, "Z9") + Z10 = vec(S512, 10, "Z10") + Z11 = vec(S512, 11, "Z11") + Z12 = vec(S512, 12, "Z12") + Z13 = vec(S512, 13, "Z13") + Z14 = vec(S512, 14, "Z14") + Z15 = vec(S512, 15, "Z15") + Z16 = vec(S512, 16, "Z16") + Z17 = vec(S512, 17, "Z17") + Z18 = vec(S512, 18, "Z18") + Z19 = vec(S512, 19, "Z19") + Z20 = vec(S512, 20, "Z20") + Z21 = vec(S512, 21, "Z21") + Z22 = vec(S512, 22, "Z22") + Z23 = vec(S512, 23, "Z23") + Z24 = vec(S512, 24, "Z24") + Z25 = vec(S512, 25, "Z25") + Z26 = vec(S512, 26, "Z26") + Z27 = vec(S512, 27, "Z27") + Z28 = vec(S512, 28, "Z28") + Z29 = vec(S512, 29, "Z29") + Z30 = vec(S512, 30, "Z30") + Z31 = vec(S512, 31, "Z31") +) diff --git a/vendor/github.com/mmcloughlin/avo/src/src.go b/vendor/github.com/mmcloughlin/avo/src/src.go new file mode 100644 index 0000000000..3a47886e65 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/src/src.go @@ -0,0 +1,62 @@ +// Package src provides types for working with source files. +package src + +import ( + "os" + "path/filepath" + "runtime" + "strconv" +) + +// Position represents a position in a source file. +type Position struct { + Filename string + Line int // 1-up +} + +// FramePosition returns the Position of the given stack frame. +func FramePosition(f runtime.Frame) Position { + return Position{ + Filename: f.File, + Line: f.Line, + } +} + +// IsValid reports whether the position is valid: Line must be positive, but +// Filename may be empty. +func (p Position) IsValid() bool { + return p.Line > 0 +} + +// String represents Position as a string. +func (p Position) String() string { + if !p.IsValid() { + return "-" + } + var s string + if p.Filename != "" { + s += p.Filename + ":" + } + s += strconv.Itoa(p.Line) + return s +} + +// Rel returns Position relative to basepath. If the given filename cannot be +// expressed relative to basepath the position will be returned unchanged. +func (p Position) Rel(basepath string) Position { + q := p + if rel, err := filepath.Rel(basepath, q.Filename); err == nil { + q.Filename = rel + } + return q +} + +// Relwd returns Position relative to the current working directory. Returns p +// unchanged if the working directory cannot be determined, or the filename +// cannot be expressed relative to the working directory. +func (p Position) Relwd() Position { + if wd, err := os.Getwd(); err == nil { + return p.Rel(wd) + } + return p +} diff --git a/vendor/github.com/mmcloughlin/avo/x86/doc.go b/vendor/github.com/mmcloughlin/avo/x86/doc.go new file mode 100644 index 0000000000..6e4c8ee859 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/x86/doc.go @@ -0,0 +1,2 @@ +// Package x86 provides constructors for all x86-64 instructions. +package x86 diff --git a/vendor/github.com/mmcloughlin/avo/x86/gen.go b/vendor/github.com/mmcloughlin/avo/x86/gen.go new file mode 100644 index 0000000000..25d15fa638 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/x86/gen.go @@ -0,0 +1,4 @@ +package x86 + +//go:generate avogen -output zctors.go ctors +//go:generate avogen -output zctors_test.go ctorstest diff --git a/vendor/github.com/mmcloughlin/avo/x86/zctors.go b/vendor/github.com/mmcloughlin/avo/x86/zctors.go new file mode 100644 index 0000000000..447c0a1a59 --- /dev/null +++ b/vendor/github.com/mmcloughlin/avo/x86/zctors.go @@ -0,0 +1,34629 @@ +// Code generated by command: avogen -output zctors.go ctors. DO NOT EDIT. + +package x86 + +import ( + "errors" + + intrep "github.com/mmcloughlin/avo/ir" + "github.com/mmcloughlin/avo/operand" + "github.com/mmcloughlin/avo/reg" +) + +// ADCB: Add with Carry. +// +// Forms: +// +// ADCB imm8 al +// ADCB imm8 r8 +// ADCB r8 r8 +// ADCB m8 r8 +// ADCB imm8 m8 +// ADCB r8 m8 +func ADCB(imr, amr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imr) && operand.IsAL(amr): + return &intrep.Instruction{ + Opcode: "ADCB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "ADCB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "ADCB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsM8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "ADCB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM8(amr): + return &intrep.Instruction{ + Opcode: "ADCB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR8(imr) && operand.IsM8(amr): + return &intrep.Instruction{ + Opcode: "ADCB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + } + return nil, errors.New("ADCB: bad operands") +} + +// ADCL: Add with Carry. +// +// Forms: +// +// ADCL imm32 eax +// ADCL imm8 r32 +// ADCL imm32 r32 +// ADCL r32 r32 +// ADCL m32 r32 +// ADCL imm8 m32 +// ADCL imm32 m32 +// ADCL r32 m32 +func ADCL(imr, emr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imr) && operand.IsEAX(emr): + return &intrep.Instruction{ + Opcode: "ADCL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "ADCL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "ADCL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsR32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "ADCL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsM32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "ADCL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "ADCL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM32(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "ADCL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsR32(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "ADCL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + } + return nil, errors.New("ADCL: bad operands") +} + +// ADCQ: Add with Carry. +// +// Forms: +// +// ADCQ imm32 rax +// ADCQ imm8 r64 +// ADCQ imm32 r64 +// ADCQ r64 r64 +// ADCQ m64 r64 +// ADCQ imm8 m64 +// ADCQ imm32 m64 +// ADCQ r64 m64 +func ADCQ(imr, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imr) && operand.IsRAX(mr): + return &intrep.Instruction{ + Opcode: "ADCQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ADCQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM32(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ADCQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ADCQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM64(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ADCQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "ADCQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM32(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "ADCQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "ADCQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("ADCQ: bad operands") +} + +// ADCW: Add with Carry. +// +// Forms: +// +// ADCW imm16 ax +// ADCW imm8 r16 +// ADCW imm16 r16 +// ADCW r16 r16 +// ADCW m16 r16 +// ADCW imm8 m16 +// ADCW imm16 m16 +// ADCW r16 m16 +func ADCW(imr, amr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM16(imr) && operand.IsAX(amr): + return &intrep.Instruction{ + Opcode: "ADCW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "ADCW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "ADCW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "ADCW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsM16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "ADCW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "ADCW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM16(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "ADCW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR16(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "ADCW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + } + return nil, errors.New("ADCW: bad operands") +} + +// ADCXL: Unsigned Integer Addition of Two Operands with Carry Flag. +// +// Forms: +// +// ADCXL r32 r32 +// ADCXL m32 r32 +func ADCXL(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "ADCXL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"ADX"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "ADCXL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"ADX"}, + }, nil + } + return nil, errors.New("ADCXL: bad operands") +} + +// ADCXQ: Unsigned Integer Addition of Two Operands with Carry Flag. +// +// Forms: +// +// ADCXQ r64 r64 +// ADCXQ m64 r64 +func ADCXQ(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "ADCXQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"ADX"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "ADCXQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"ADX"}, + }, nil + } + return nil, errors.New("ADCXQ: bad operands") +} + +// ADDB: Add. +// +// Forms: +// +// ADDB imm8 al +// ADDB imm8 r8 +// ADDB r8 r8 +// ADDB m8 r8 +// ADDB imm8 m8 +// ADDB r8 m8 +func ADDB(imr, amr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imr) && operand.IsAL(amr): + return &intrep.Instruction{ + Opcode: "ADDB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "ADDB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "ADDB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsM8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "ADDB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM8(amr): + return &intrep.Instruction{ + Opcode: "ADDB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR8(imr) && operand.IsM8(amr): + return &intrep.Instruction{ + Opcode: "ADDB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + } + return nil, errors.New("ADDB: bad operands") +} + +// ADDL: Add. +// +// Forms: +// +// ADDL imm32 eax +// ADDL imm8 r32 +// ADDL imm32 r32 +// ADDL r32 r32 +// ADDL m32 r32 +// ADDL imm8 m32 +// ADDL imm32 m32 +// ADDL r32 m32 +func ADDL(imr, emr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imr) && operand.IsEAX(emr): + return &intrep.Instruction{ + Opcode: "ADDL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "ADDL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "ADDL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsR32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "ADDL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsM32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "ADDL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "ADDL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM32(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "ADDL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsR32(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "ADDL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + } + return nil, errors.New("ADDL: bad operands") +} + +// ADDPD: Add Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// ADDPD xmm xmm +// ADDPD m128 xmm +func ADDPD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ADDPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ADDPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("ADDPD: bad operands") +} + +// ADDPS: Add Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// ADDPS xmm xmm +// ADDPS m128 xmm +func ADDPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ADDPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ADDPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("ADDPS: bad operands") +} + +// ADDQ: Add. +// +// Forms: +// +// ADDQ imm32 rax +// ADDQ imm8 r64 +// ADDQ imm32 r64 +// ADDQ r64 r64 +// ADDQ m64 r64 +// ADDQ imm8 m64 +// ADDQ imm32 m64 +// ADDQ r64 m64 +func ADDQ(imr, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imr) && operand.IsRAX(mr): + return &intrep.Instruction{ + Opcode: "ADDQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ADDQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM32(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ADDQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ADDQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM64(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ADDQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "ADDQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM32(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "ADDQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "ADDQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("ADDQ: bad operands") +} + +// ADDSD: Add Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// ADDSD xmm xmm +// ADDSD m64 xmm +func ADDSD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ADDSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ADDSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("ADDSD: bad operands") +} + +// ADDSS: Add Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// ADDSS xmm xmm +// ADDSS m32 xmm +func ADDSS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ADDSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ADDSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("ADDSS: bad operands") +} + +// ADDSUBPD: Packed Double-FP Add/Subtract. +// +// Forms: +// +// ADDSUBPD xmm xmm +// ADDSUBPD m128 xmm +func ADDSUBPD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ADDSUBPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ADDSUBPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + } + return nil, errors.New("ADDSUBPD: bad operands") +} + +// ADDSUBPS: Packed Single-FP Add/Subtract. +// +// Forms: +// +// ADDSUBPS xmm xmm +// ADDSUBPS m128 xmm +func ADDSUBPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ADDSUBPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ADDSUBPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + } + return nil, errors.New("ADDSUBPS: bad operands") +} + +// ADDW: Add. +// +// Forms: +// +// ADDW imm16 ax +// ADDW imm8 r16 +// ADDW imm16 r16 +// ADDW r16 r16 +// ADDW m16 r16 +// ADDW imm8 m16 +// ADDW imm16 m16 +// ADDW r16 m16 +func ADDW(imr, amr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM16(imr) && operand.IsAX(amr): + return &intrep.Instruction{ + Opcode: "ADDW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "ADDW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "ADDW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "ADDW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsM16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "ADDW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "ADDW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM16(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "ADDW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR16(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "ADDW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + } + return nil, errors.New("ADDW: bad operands") +} + +// ADOXL: Unsigned Integer Addition of Two Operands with Overflow Flag. +// +// Forms: +// +// ADOXL r32 r32 +// ADOXL m32 r32 +func ADOXL(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "ADOXL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"ADX"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "ADOXL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"ADX"}, + }, nil + } + return nil, errors.New("ADOXL: bad operands") +} + +// ADOXQ: Unsigned Integer Addition of Two Operands with Overflow Flag. +// +// Forms: +// +// ADOXQ r64 r64 +// ADOXQ m64 r64 +func ADOXQ(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "ADOXQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"ADX"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "ADOXQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"ADX"}, + }, nil + } + return nil, errors.New("ADOXQ: bad operands") +} + +// AESDEC: Perform One Round of an AES Decryption Flow. +// +// Forms: +// +// AESDEC xmm xmm +// AESDEC m128 xmm +func AESDEC(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "AESDEC", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AES"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "AESDEC", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AES"}, + }, nil + } + return nil, errors.New("AESDEC: bad operands") +} + +// AESDECLAST: Perform Last Round of an AES Decryption Flow. +// +// Forms: +// +// AESDECLAST xmm xmm +// AESDECLAST m128 xmm +func AESDECLAST(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "AESDECLAST", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AES"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "AESDECLAST", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AES"}, + }, nil + } + return nil, errors.New("AESDECLAST: bad operands") +} + +// AESENC: Perform One Round of an AES Encryption Flow. +// +// Forms: +// +// AESENC xmm xmm +// AESENC m128 xmm +func AESENC(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "AESENC", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"AES"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "AESENC", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"AES"}, + }, nil + } + return nil, errors.New("AESENC: bad operands") +} + +// AESENCLAST: Perform Last Round of an AES Encryption Flow. +// +// Forms: +// +// AESENCLAST xmm xmm +// AESENCLAST m128 xmm +func AESENCLAST(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "AESENCLAST", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"AES"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "AESENCLAST", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"AES"}, + }, nil + } + return nil, errors.New("AESENCLAST: bad operands") +} + +// AESIMC: Perform the AES InvMixColumn Transformation. +// +// Forms: +// +// AESIMC xmm xmm +// AESIMC m128 xmm +func AESIMC(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "AESIMC", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AES"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "AESIMC", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AES"}, + }, nil + } + return nil, errors.New("AESIMC: bad operands") +} + +// AESKEYGENASSIST: AES Round Key Generation Assist. +// +// Forms: +// +// AESKEYGENASSIST imm8 xmm xmm +// AESKEYGENASSIST imm8 m128 xmm +func AESKEYGENASSIST(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "AESKEYGENASSIST", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AES"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "AESKEYGENASSIST", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AES"}, + }, nil + } + return nil, errors.New("AESKEYGENASSIST: bad operands") +} + +// ANDB: Logical AND. +// +// Forms: +// +// ANDB imm8 al +// ANDB imm8 r8 +// ANDB r8 r8 +// ANDB m8 r8 +// ANDB imm8 m8 +// ANDB r8 m8 +func ANDB(imr, amr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imr) && operand.IsAL(amr): + return &intrep.Instruction{ + Opcode: "ANDB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "ANDB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "ANDB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsM8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "ANDB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM8(amr): + return &intrep.Instruction{ + Opcode: "ANDB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR8(imr) && operand.IsM8(amr): + return &intrep.Instruction{ + Opcode: "ANDB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + } + return nil, errors.New("ANDB: bad operands") +} + +// ANDL: Logical AND. +// +// Forms: +// +// ANDL imm32 eax +// ANDL imm8 r32 +// ANDL imm32 r32 +// ANDL r32 r32 +// ANDL m32 r32 +// ANDL imm8 m32 +// ANDL imm32 m32 +// ANDL r32 m32 +func ANDL(imr, emr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imr) && operand.IsEAX(emr): + return &intrep.Instruction{ + Opcode: "ANDL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "ANDL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "ANDL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsR32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "ANDL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsM32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "ANDL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "ANDL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM32(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "ANDL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsR32(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "ANDL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + } + return nil, errors.New("ANDL: bad operands") +} + +// ANDNL: Logical AND NOT. +// +// Forms: +// +// ANDNL r32 r32 r32 +// ANDNL m32 r32 r32 +func ANDNL(mr, r, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "ANDNL", + Operands: []operand.Op{mr, r, r1}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI"}, + CancellingInputs: true, + }, nil + case operand.IsM32(mr) && operand.IsR32(r) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "ANDNL", + Operands: []operand.Op{mr, r, r1}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI"}, + }, nil + } + return nil, errors.New("ANDNL: bad operands") +} + +// ANDNPD: Bitwise Logical AND NOT of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// ANDNPD xmm xmm +// ANDNPD m128 xmm +func ANDNPD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ANDNPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ANDNPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("ANDNPD: bad operands") +} + +// ANDNPS: Bitwise Logical AND NOT of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// ANDNPS xmm xmm +// ANDNPS m128 xmm +func ANDNPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ANDNPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ANDNPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("ANDNPS: bad operands") +} + +// ANDNQ: Logical AND NOT. +// +// Forms: +// +// ANDNQ r64 r64 r64 +// ANDNQ m64 r64 r64 +func ANDNQ(mr, r, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "ANDNQ", + Operands: []operand.Op{mr, r, r1}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI"}, + CancellingInputs: true, + }, nil + case operand.IsM64(mr) && operand.IsR64(r) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "ANDNQ", + Operands: []operand.Op{mr, r, r1}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI"}, + }, nil + } + return nil, errors.New("ANDNQ: bad operands") +} + +// ANDPD: Bitwise Logical AND of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// ANDPD xmm xmm +// ANDPD m128 xmm +func ANDPD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ANDPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ANDPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("ANDPD: bad operands") +} + +// ANDPS: Bitwise Logical AND of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// ANDPS xmm xmm +// ANDPS m128 xmm +func ANDPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ANDPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ANDPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("ANDPS: bad operands") +} + +// ANDQ: Logical AND. +// +// Forms: +// +// ANDQ imm32 rax +// ANDQ imm8 r64 +// ANDQ imm32 r64 +// ANDQ r64 r64 +// ANDQ m64 r64 +// ANDQ imm8 m64 +// ANDQ imm32 m64 +// ANDQ r64 m64 +func ANDQ(imr, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imr) && operand.IsRAX(mr): + return &intrep.Instruction{ + Opcode: "ANDQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ANDQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM32(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ANDQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ANDQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM64(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ANDQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "ANDQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM32(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "ANDQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "ANDQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("ANDQ: bad operands") +} + +// ANDW: Logical AND. +// +// Forms: +// +// ANDW imm16 ax +// ANDW imm8 r16 +// ANDW imm16 r16 +// ANDW r16 r16 +// ANDW m16 r16 +// ANDW imm8 m16 +// ANDW imm16 m16 +// ANDW r16 m16 +func ANDW(imr, amr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM16(imr) && operand.IsAX(amr): + return &intrep.Instruction{ + Opcode: "ANDW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "ANDW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "ANDW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "ANDW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsM16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "ANDW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "ANDW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM16(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "ANDW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR16(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "ANDW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + } + return nil, errors.New("ANDW: bad operands") +} + +// BEXTRL: Bit Field Extract. +// +// Forms: +// +// BEXTRL r32 r32 r32 +// BEXTRL r32 m32 r32 +func BEXTRL(r, mr, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(r) && operand.IsR32(mr) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "BEXTRL", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI"}, + }, nil + case operand.IsR32(r) && operand.IsM32(mr) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "BEXTRL", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI"}, + }, nil + } + return nil, errors.New("BEXTRL: bad operands") +} + +// BEXTRQ: Bit Field Extract. +// +// Forms: +// +// BEXTRQ r64 r64 r64 +// BEXTRQ r64 m64 r64 +func BEXTRQ(r, mr, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(r) && operand.IsR64(mr) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "BEXTRQ", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI"}, + }, nil + case operand.IsR64(r) && operand.IsM64(mr) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "BEXTRQ", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI"}, + }, nil + } + return nil, errors.New("BEXTRQ: bad operands") +} + +// BLENDPD: Blend Packed Double Precision Floating-Point Values. +// +// Forms: +// +// BLENDPD imm8 xmm xmm +// BLENDPD imm8 m128 xmm +func BLENDPD(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "BLENDPD", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "BLENDPD", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("BLENDPD: bad operands") +} + +// BLENDPS: Blend Packed Single Precision Floating-Point Values. +// +// Forms: +// +// BLENDPS imm8 xmm xmm +// BLENDPS imm8 m128 xmm +func BLENDPS(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "BLENDPS", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "BLENDPS", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("BLENDPS: bad operands") +} + +// BLENDVPD: Variable Blend Packed Double Precision Floating-Point Values. +// +// Forms: +// +// BLENDVPD xmm0 xmm xmm +// BLENDVPD xmm0 m128 xmm +func BLENDVPD(x, mx, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM0(x) && operand.IsXMM(mx) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "BLENDVPD", + Operands: []operand.Op{x, mx, x1}, + Inputs: []operand.Op{x, mx, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsXMM0(x) && operand.IsM128(mx) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "BLENDVPD", + Operands: []operand.Op{x, mx, x1}, + Inputs: []operand.Op{x, mx, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("BLENDVPD: bad operands") +} + +// BLENDVPS: Variable Blend Packed Single Precision Floating-Point Values. +// +// Forms: +// +// BLENDVPS xmm0 xmm xmm +// BLENDVPS xmm0 m128 xmm +func BLENDVPS(x, mx, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM0(x) && operand.IsXMM(mx) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "BLENDVPS", + Operands: []operand.Op{x, mx, x1}, + Inputs: []operand.Op{x, mx, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsXMM0(x) && operand.IsM128(mx) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "BLENDVPS", + Operands: []operand.Op{x, mx, x1}, + Inputs: []operand.Op{x, mx, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("BLENDVPS: bad operands") +} + +// BLSIL: Isolate Lowest Set Bit. +// +// Forms: +// +// BLSIL r32 r32 +// BLSIL m32 r32 +func BLSIL(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "BLSIL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "BLSIL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + } + return nil, errors.New("BLSIL: bad operands") +} + +// BLSIQ: Isolate Lowest Set Bit. +// +// Forms: +// +// BLSIQ r64 r64 +// BLSIQ m64 r64 +func BLSIQ(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "BLSIQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "BLSIQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + } + return nil, errors.New("BLSIQ: bad operands") +} + +// BLSMSKL: Mask From Lowest Set Bit. +// +// Forms: +// +// BLSMSKL r32 r32 +// BLSMSKL m32 r32 +func BLSMSKL(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "BLSMSKL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "BLSMSKL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + } + return nil, errors.New("BLSMSKL: bad operands") +} + +// BLSMSKQ: Mask From Lowest Set Bit. +// +// Forms: +// +// BLSMSKQ r64 r64 +// BLSMSKQ m64 r64 +func BLSMSKQ(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "BLSMSKQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "BLSMSKQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + } + return nil, errors.New("BLSMSKQ: bad operands") +} + +// BLSRL: Reset Lowest Set Bit. +// +// Forms: +// +// BLSRL r32 r32 +// BLSRL m32 r32 +func BLSRL(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "BLSRL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "BLSRL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + } + return nil, errors.New("BLSRL: bad operands") +} + +// BLSRQ: Reset Lowest Set Bit. +// +// Forms: +// +// BLSRQ r64 r64 +// BLSRQ m64 r64 +func BLSRQ(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "BLSRQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "BLSRQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + } + return nil, errors.New("BLSRQ: bad operands") +} + +// BSFL: Bit Scan Forward. +// +// Forms: +// +// BSFL r32 r32 +// BSFL m32 r32 +func BSFL(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "BSFL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "BSFL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("BSFL: bad operands") +} + +// BSFQ: Bit Scan Forward. +// +// Forms: +// +// BSFQ r64 r64 +// BSFQ m64 r64 +func BSFQ(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "BSFQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "BSFQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("BSFQ: bad operands") +} + +// BSFW: Bit Scan Forward. +// +// Forms: +// +// BSFW r16 r16 +// BSFW m16 r16 +func BSFW(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "BSFW", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "BSFW", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("BSFW: bad operands") +} + +// BSRL: Bit Scan Reverse. +// +// Forms: +// +// BSRL r32 r32 +// BSRL m32 r32 +func BSRL(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "BSRL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "BSRL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("BSRL: bad operands") +} + +// BSRQ: Bit Scan Reverse. +// +// Forms: +// +// BSRQ r64 r64 +// BSRQ m64 r64 +func BSRQ(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "BSRQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "BSRQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("BSRQ: bad operands") +} + +// BSRW: Bit Scan Reverse. +// +// Forms: +// +// BSRW r16 r16 +// BSRW m16 r16 +func BSRW(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "BSRW", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "BSRW", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("BSRW: bad operands") +} + +// BSWAPL: Byte Swap. +// +// Forms: +// +// BSWAPL r32 +func BSWAPL(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "BSWAPL", + Operands: []operand.Op{r}, + Inputs: []operand.Op{r}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("BSWAPL: bad operands") +} + +// BSWAPQ: Byte Swap. +// +// Forms: +// +// BSWAPQ r64 +func BSWAPQ(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "BSWAPQ", + Operands: []operand.Op{r}, + Inputs: []operand.Op{r}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("BSWAPQ: bad operands") +} + +// BTCL: Bit Test and Complement. +// +// Forms: +// +// BTCL imm8 r32 +// BTCL r32 r32 +// BTCL imm8 m32 +// BTCL r32 m32 +func BTCL(ir, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(ir) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "BTCL", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR32(ir) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "BTCL", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ir) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "BTCL", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR32(ir) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "BTCL", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("BTCL: bad operands") +} + +// BTCQ: Bit Test and Complement. +// +// Forms: +// +// BTCQ imm8 r64 +// BTCQ r64 r64 +// BTCQ imm8 m64 +// BTCQ r64 m64 +func BTCQ(ir, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(ir) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "BTCQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(ir) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "BTCQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ir) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "BTCQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(ir) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "BTCQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("BTCQ: bad operands") +} + +// BTCW: Bit Test and Complement. +// +// Forms: +// +// BTCW imm8 r16 +// BTCW r16 r16 +// BTCW imm8 m16 +// BTCW r16 m16 +func BTCW(ir, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(ir) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "BTCW", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR16(ir) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "BTCW", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ir) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "BTCW", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR16(ir) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "BTCW", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("BTCW: bad operands") +} + +// BTL: Bit Test. +// +// Forms: +// +// BTL imm8 r32 +// BTL r32 r32 +// BTL imm8 m32 +// BTL r32 m32 +func BTL(ir, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(ir) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "BTL", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR32(ir) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "BTL", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsIMM8(ir) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "BTL", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR32(ir) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "BTL", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("BTL: bad operands") +} + +// BTQ: Bit Test. +// +// Forms: +// +// BTQ imm8 r64 +// BTQ r64 r64 +// BTQ imm8 m64 +// BTQ r64 m64 +func BTQ(ir, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(ir) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "BTQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR64(ir) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "BTQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsIMM8(ir) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "BTQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR64(ir) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "BTQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("BTQ: bad operands") +} + +// BTRL: Bit Test and Reset. +// +// Forms: +// +// BTRL imm8 r32 +// BTRL r32 r32 +// BTRL imm8 m32 +// BTRL r32 m32 +func BTRL(ir, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(ir) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "BTRL", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR32(ir) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "BTRL", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ir) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "BTRL", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR32(ir) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "BTRL", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("BTRL: bad operands") +} + +// BTRQ: Bit Test and Reset. +// +// Forms: +// +// BTRQ imm8 r64 +// BTRQ r64 r64 +// BTRQ imm8 m64 +// BTRQ r64 m64 +func BTRQ(ir, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(ir) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "BTRQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(ir) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "BTRQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ir) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "BTRQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(ir) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "BTRQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("BTRQ: bad operands") +} + +// BTRW: Bit Test and Reset. +// +// Forms: +// +// BTRW imm8 r16 +// BTRW r16 r16 +// BTRW imm8 m16 +// BTRW r16 m16 +func BTRW(ir, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(ir) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "BTRW", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR16(ir) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "BTRW", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ir) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "BTRW", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR16(ir) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "BTRW", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("BTRW: bad operands") +} + +// BTSL: Bit Test and Set. +// +// Forms: +// +// BTSL imm8 r32 +// BTSL r32 r32 +// BTSL imm8 m32 +// BTSL r32 m32 +func BTSL(ir, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(ir) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "BTSL", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR32(ir) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "BTSL", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ir) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "BTSL", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR32(ir) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "BTSL", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("BTSL: bad operands") +} + +// BTSQ: Bit Test and Set. +// +// Forms: +// +// BTSQ imm8 r64 +// BTSQ r64 r64 +// BTSQ imm8 m64 +// BTSQ r64 m64 +func BTSQ(ir, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(ir) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "BTSQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(ir) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "BTSQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ir) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "BTSQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(ir) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "BTSQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("BTSQ: bad operands") +} + +// BTSW: Bit Test and Set. +// +// Forms: +// +// BTSW imm8 r16 +// BTSW r16 r16 +// BTSW imm8 m16 +// BTSW r16 m16 +func BTSW(ir, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(ir) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "BTSW", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR16(ir) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "BTSW", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ir) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "BTSW", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR16(ir) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "BTSW", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("BTSW: bad operands") +} + +// BTW: Bit Test. +// +// Forms: +// +// BTW imm8 r16 +// BTW r16 r16 +// BTW imm8 m16 +// BTW r16 m16 +func BTW(ir, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(ir) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "BTW", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR16(ir) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "BTW", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsIMM8(ir) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "BTW", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR16(ir) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "BTW", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("BTW: bad operands") +} + +// BZHIL: Zero High Bits Starting with Specified Bit Position. +// +// Forms: +// +// BZHIL r32 r32 r32 +// BZHIL r32 m32 r32 +func BZHIL(r, mr, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(r) && operand.IsR32(mr) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "BZHIL", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + case operand.IsR32(r) && operand.IsM32(mr) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "BZHIL", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + } + return nil, errors.New("BZHIL: bad operands") +} + +// BZHIQ: Zero High Bits Starting with Specified Bit Position. +// +// Forms: +// +// BZHIQ r64 r64 r64 +// BZHIQ r64 m64 r64 +func BZHIQ(r, mr, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(r) && operand.IsR64(mr) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "BZHIQ", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + case operand.IsR64(r) && operand.IsM64(mr) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "BZHIQ", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + } + return nil, errors.New("BZHIQ: bad operands") +} + +// CALL: Call Procedure. +// +// Forms: +// +// CALL rel32 +func CALL(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "CALL", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("CALL: bad operands") +} + +// CBW: Convert Byte to Word. +// +// Forms: +// +// CBW +func CBW() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "CBW", + Operands: nil, + Inputs: []operand.Op{reg.AL}, + Outputs: []operand.Op{reg.AX}, + }, nil +} + +// CDQ: Convert Doubleword to Quadword. +// +// Forms: +// +// CDQ +func CDQ() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "CDQ", + Operands: nil, + Inputs: []operand.Op{reg.EAX}, + Outputs: []operand.Op{reg.EDX}, + }, nil +} + +// CDQE: Convert Doubleword to Quadword. +// +// Forms: +// +// CDQE +func CDQE() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "CDQE", + Operands: nil, + Inputs: []operand.Op{reg.EAX}, + Outputs: []operand.Op{reg.RAX}, + }, nil +} + +// CLC: Clear Carry Flag. +// +// Forms: +// +// CLC +func CLC() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "CLC", + Operands: nil, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + }, nil +} + +// CLD: Clear Direction Flag. +// +// Forms: +// +// CLD +func CLD() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "CLD", + Operands: nil, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + }, nil +} + +// CLFLUSH: Flush Cache Line. +// +// Forms: +// +// CLFLUSH m8 +func CLFLUSH(m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM8(m): + return &intrep.Instruction{ + Opcode: "CLFLUSH", + Operands: []operand.Op{m}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{}, + ISA: []string{"CLFLUSH"}, + }, nil + } + return nil, errors.New("CLFLUSH: bad operands") +} + +// CLFLUSHOPT: Flush Cache Line Optimized. +// +// Forms: +// +// CLFLUSHOPT m8 +func CLFLUSHOPT(m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM8(m): + return &intrep.Instruction{ + Opcode: "CLFLUSHOPT", + Operands: []operand.Op{m}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{}, + ISA: []string{"CLFLUSHOPT"}, + }, nil + } + return nil, errors.New("CLFLUSHOPT: bad operands") +} + +// CMC: Complement Carry Flag. +// +// Forms: +// +// CMC +func CMC() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "CMC", + Operands: nil, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + }, nil +} + +// CMOVLCC: Move if above or equal (CF == 0). +// +// Forms: +// +// CMOVLCC r32 r32 +// CMOVLCC m32 r32 +func CMOVLCC(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLCC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLCC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVLCC: bad operands") +} + +// CMOVLCS: Move if below (CF == 1). +// +// Forms: +// +// CMOVLCS r32 r32 +// CMOVLCS m32 r32 +func CMOVLCS(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLCS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLCS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVLCS: bad operands") +} + +// CMOVLEQ: Move if equal (ZF == 1). +// +// Forms: +// +// CMOVLEQ r32 r32 +// CMOVLEQ m32 r32 +func CMOVLEQ(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLEQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLEQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVLEQ: bad operands") +} + +// CMOVLGE: Move if greater or equal (SF == OF). +// +// Forms: +// +// CMOVLGE r32 r32 +// CMOVLGE m32 r32 +func CMOVLGE(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLGE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLGE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVLGE: bad operands") +} + +// CMOVLGT: Move if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// CMOVLGT r32 r32 +// CMOVLGT m32 r32 +func CMOVLGT(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLGT", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLGT", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVLGT: bad operands") +} + +// CMOVLHI: Move if above (CF == 0 and ZF == 0). +// +// Forms: +// +// CMOVLHI r32 r32 +// CMOVLHI m32 r32 +func CMOVLHI(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLHI", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLHI", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVLHI: bad operands") +} + +// CMOVLLE: Move if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// CMOVLLE r32 r32 +// CMOVLLE m32 r32 +func CMOVLLE(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLLE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLLE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVLLE: bad operands") +} + +// CMOVLLS: Move if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// CMOVLLS r32 r32 +// CMOVLLS m32 r32 +func CMOVLLS(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLLS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLLS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVLLS: bad operands") +} + +// CMOVLLT: Move if less (SF != OF). +// +// Forms: +// +// CMOVLLT r32 r32 +// CMOVLLT m32 r32 +func CMOVLLT(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLLT", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLLT", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVLLT: bad operands") +} + +// CMOVLMI: Move if sign (SF == 1). +// +// Forms: +// +// CMOVLMI r32 r32 +// CMOVLMI m32 r32 +func CMOVLMI(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLMI", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLMI", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVLMI: bad operands") +} + +// CMOVLNE: Move if not equal (ZF == 0). +// +// Forms: +// +// CMOVLNE r32 r32 +// CMOVLNE m32 r32 +func CMOVLNE(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLNE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLNE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVLNE: bad operands") +} + +// CMOVLOC: Move if not overflow (OF == 0). +// +// Forms: +// +// CMOVLOC r32 r32 +// CMOVLOC m32 r32 +func CMOVLOC(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLOC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLOC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVLOC: bad operands") +} + +// CMOVLOS: Move if overflow (OF == 1). +// +// Forms: +// +// CMOVLOS r32 r32 +// CMOVLOS m32 r32 +func CMOVLOS(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLOS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLOS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVLOS: bad operands") +} + +// CMOVLPC: Move if not parity (PF == 0). +// +// Forms: +// +// CMOVLPC r32 r32 +// CMOVLPC m32 r32 +func CMOVLPC(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLPC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLPC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVLPC: bad operands") +} + +// CMOVLPL: Move if not sign (SF == 0). +// +// Forms: +// +// CMOVLPL r32 r32 +// CMOVLPL m32 r32 +func CMOVLPL(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLPL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLPL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVLPL: bad operands") +} + +// CMOVLPS: Move if parity (PF == 1). +// +// Forms: +// +// CMOVLPS r32 r32 +// CMOVLPS m32 r32 +func CMOVLPS(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLPS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CMOVLPS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVLPS: bad operands") +} + +// CMOVQCC: Move if above or equal (CF == 0). +// +// Forms: +// +// CMOVQCC r64 r64 +// CMOVQCC m64 r64 +func CMOVQCC(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQCC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQCC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVQCC: bad operands") +} + +// CMOVQCS: Move if below (CF == 1). +// +// Forms: +// +// CMOVQCS r64 r64 +// CMOVQCS m64 r64 +func CMOVQCS(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQCS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQCS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVQCS: bad operands") +} + +// CMOVQEQ: Move if equal (ZF == 1). +// +// Forms: +// +// CMOVQEQ r64 r64 +// CMOVQEQ m64 r64 +func CMOVQEQ(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQEQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQEQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVQEQ: bad operands") +} + +// CMOVQGE: Move if greater or equal (SF == OF). +// +// Forms: +// +// CMOVQGE r64 r64 +// CMOVQGE m64 r64 +func CMOVQGE(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQGE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQGE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVQGE: bad operands") +} + +// CMOVQGT: Move if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// CMOVQGT r64 r64 +// CMOVQGT m64 r64 +func CMOVQGT(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQGT", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQGT", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVQGT: bad operands") +} + +// CMOVQHI: Move if above (CF == 0 and ZF == 0). +// +// Forms: +// +// CMOVQHI r64 r64 +// CMOVQHI m64 r64 +func CMOVQHI(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQHI", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQHI", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVQHI: bad operands") +} + +// CMOVQLE: Move if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// CMOVQLE r64 r64 +// CMOVQLE m64 r64 +func CMOVQLE(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQLE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQLE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVQLE: bad operands") +} + +// CMOVQLS: Move if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// CMOVQLS r64 r64 +// CMOVQLS m64 r64 +func CMOVQLS(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQLS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQLS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVQLS: bad operands") +} + +// CMOVQLT: Move if less (SF != OF). +// +// Forms: +// +// CMOVQLT r64 r64 +// CMOVQLT m64 r64 +func CMOVQLT(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQLT", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQLT", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVQLT: bad operands") +} + +// CMOVQMI: Move if sign (SF == 1). +// +// Forms: +// +// CMOVQMI r64 r64 +// CMOVQMI m64 r64 +func CMOVQMI(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQMI", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQMI", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVQMI: bad operands") +} + +// CMOVQNE: Move if not equal (ZF == 0). +// +// Forms: +// +// CMOVQNE r64 r64 +// CMOVQNE m64 r64 +func CMOVQNE(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQNE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQNE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVQNE: bad operands") +} + +// CMOVQOC: Move if not overflow (OF == 0). +// +// Forms: +// +// CMOVQOC r64 r64 +// CMOVQOC m64 r64 +func CMOVQOC(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQOC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQOC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVQOC: bad operands") +} + +// CMOVQOS: Move if overflow (OF == 1). +// +// Forms: +// +// CMOVQOS r64 r64 +// CMOVQOS m64 r64 +func CMOVQOS(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQOS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQOS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVQOS: bad operands") +} + +// CMOVQPC: Move if not parity (PF == 0). +// +// Forms: +// +// CMOVQPC r64 r64 +// CMOVQPC m64 r64 +func CMOVQPC(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQPC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQPC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVQPC: bad operands") +} + +// CMOVQPL: Move if not sign (SF == 0). +// +// Forms: +// +// CMOVQPL r64 r64 +// CMOVQPL m64 r64 +func CMOVQPL(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQPL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQPL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVQPL: bad operands") +} + +// CMOVQPS: Move if parity (PF == 1). +// +// Forms: +// +// CMOVQPS r64 r64 +// CMOVQPS m64 r64 +func CMOVQPS(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQPS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CMOVQPS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVQPS: bad operands") +} + +// CMOVWCC: Move if above or equal (CF == 0). +// +// Forms: +// +// CMOVWCC r16 r16 +// CMOVWCC m16 r16 +func CMOVWCC(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWCC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWCC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVWCC: bad operands") +} + +// CMOVWCS: Move if below (CF == 1). +// +// Forms: +// +// CMOVWCS r16 r16 +// CMOVWCS m16 r16 +func CMOVWCS(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWCS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWCS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVWCS: bad operands") +} + +// CMOVWEQ: Move if equal (ZF == 1). +// +// Forms: +// +// CMOVWEQ r16 r16 +// CMOVWEQ m16 r16 +func CMOVWEQ(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWEQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWEQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVWEQ: bad operands") +} + +// CMOVWGE: Move if greater or equal (SF == OF). +// +// Forms: +// +// CMOVWGE r16 r16 +// CMOVWGE m16 r16 +func CMOVWGE(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWGE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWGE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVWGE: bad operands") +} + +// CMOVWGT: Move if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// CMOVWGT r16 r16 +// CMOVWGT m16 r16 +func CMOVWGT(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWGT", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWGT", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVWGT: bad operands") +} + +// CMOVWHI: Move if above (CF == 0 and ZF == 0). +// +// Forms: +// +// CMOVWHI r16 r16 +// CMOVWHI m16 r16 +func CMOVWHI(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWHI", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWHI", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVWHI: bad operands") +} + +// CMOVWLE: Move if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// CMOVWLE r16 r16 +// CMOVWLE m16 r16 +func CMOVWLE(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWLE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWLE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVWLE: bad operands") +} + +// CMOVWLS: Move if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// CMOVWLS r16 r16 +// CMOVWLS m16 r16 +func CMOVWLS(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWLS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWLS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVWLS: bad operands") +} + +// CMOVWLT: Move if less (SF != OF). +// +// Forms: +// +// CMOVWLT r16 r16 +// CMOVWLT m16 r16 +func CMOVWLT(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWLT", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWLT", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVWLT: bad operands") +} + +// CMOVWMI: Move if sign (SF == 1). +// +// Forms: +// +// CMOVWMI r16 r16 +// CMOVWMI m16 r16 +func CMOVWMI(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWMI", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWMI", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVWMI: bad operands") +} + +// CMOVWNE: Move if not equal (ZF == 0). +// +// Forms: +// +// CMOVWNE r16 r16 +// CMOVWNE m16 r16 +func CMOVWNE(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWNE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWNE", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVWNE: bad operands") +} + +// CMOVWOC: Move if not overflow (OF == 0). +// +// Forms: +// +// CMOVWOC r16 r16 +// CMOVWOC m16 r16 +func CMOVWOC(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWOC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWOC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVWOC: bad operands") +} + +// CMOVWOS: Move if overflow (OF == 1). +// +// Forms: +// +// CMOVWOS r16 r16 +// CMOVWOS m16 r16 +func CMOVWOS(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWOS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWOS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVWOS: bad operands") +} + +// CMOVWPC: Move if not parity (PF == 0). +// +// Forms: +// +// CMOVWPC r16 r16 +// CMOVWPC m16 r16 +func CMOVWPC(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWPC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWPC", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVWPC: bad operands") +} + +// CMOVWPL: Move if not sign (SF == 0). +// +// Forms: +// +// CMOVWPL r16 r16 +// CMOVWPL m16 r16 +func CMOVWPL(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWPL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWPL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVWPL: bad operands") +} + +// CMOVWPS: Move if parity (PF == 1). +// +// Forms: +// +// CMOVWPS r16 r16 +// CMOVWPS m16 r16 +func CMOVWPS(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWPS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "CMOVWPS", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"CMOV"}, + }, nil + } + return nil, errors.New("CMOVWPS: bad operands") +} + +// CMPB: Compare Two Operands. +// +// Forms: +// +// CMPB al imm8 +// CMPB r8 imm8 +// CMPB r8 r8 +// CMPB r8 m8 +// CMPB m8 imm8 +// CMPB m8 r8 +func CMPB(amr, imr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsAL(amr) && operand.IsIMM8(imr): + return &intrep.Instruction{ + Opcode: "CMPB", + Operands: []operand.Op{amr, imr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR8(amr) && operand.IsIMM8(imr): + return &intrep.Instruction{ + Opcode: "CMPB", + Operands: []operand.Op{amr, imr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR8(amr) && operand.IsR8(imr): + return &intrep.Instruction{ + Opcode: "CMPB", + Operands: []operand.Op{amr, imr}, + Inputs: []operand.Op{amr, imr}, + Outputs: []operand.Op{}, + CancellingInputs: true, + }, nil + case operand.IsR8(amr) && operand.IsM8(imr): + return &intrep.Instruction{ + Opcode: "CMPB", + Operands: []operand.Op{amr, imr}, + Inputs: []operand.Op{amr, imr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsM8(amr) && operand.IsIMM8(imr): + return &intrep.Instruction{ + Opcode: "CMPB", + Operands: []operand.Op{amr, imr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsM8(amr) && operand.IsR8(imr): + return &intrep.Instruction{ + Opcode: "CMPB", + Operands: []operand.Op{amr, imr}, + Inputs: []operand.Op{amr, imr}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("CMPB: bad operands") +} + +// CMPL: Compare Two Operands. +// +// Forms: +// +// CMPL eax imm32 +// CMPL r32 imm8 +// CMPL r32 imm32 +// CMPL r32 r32 +// CMPL r32 m32 +// CMPL m32 imm8 +// CMPL m32 imm32 +// CMPL m32 r32 +func CMPL(emr, imr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsEAX(emr) && operand.IsIMM32(imr): + return &intrep.Instruction{ + Opcode: "CMPL", + Operands: []operand.Op{emr, imr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR32(emr) && operand.IsIMM8(imr): + return &intrep.Instruction{ + Opcode: "CMPL", + Operands: []operand.Op{emr, imr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR32(emr) && operand.IsIMM32(imr): + return &intrep.Instruction{ + Opcode: "CMPL", + Operands: []operand.Op{emr, imr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR32(emr) && operand.IsR32(imr): + return &intrep.Instruction{ + Opcode: "CMPL", + Operands: []operand.Op{emr, imr}, + Inputs: []operand.Op{emr, imr}, + Outputs: []operand.Op{}, + CancellingInputs: true, + }, nil + case operand.IsR32(emr) && operand.IsM32(imr): + return &intrep.Instruction{ + Opcode: "CMPL", + Operands: []operand.Op{emr, imr}, + Inputs: []operand.Op{emr, imr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsM32(emr) && operand.IsIMM8(imr): + return &intrep.Instruction{ + Opcode: "CMPL", + Operands: []operand.Op{emr, imr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsM32(emr) && operand.IsIMM32(imr): + return &intrep.Instruction{ + Opcode: "CMPL", + Operands: []operand.Op{emr, imr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsM32(emr) && operand.IsR32(imr): + return &intrep.Instruction{ + Opcode: "CMPL", + Operands: []operand.Op{emr, imr}, + Inputs: []operand.Op{emr, imr}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("CMPL: bad operands") +} + +// CMPPD: Compare Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// CMPPD xmm xmm imm8 +// CMPPD m128 xmm imm8 +func CMPPD(mx, x, i operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsIMM8(i): + return &intrep.Instruction{ + Opcode: "CMPPD", + Operands: []operand.Op{mx, x, i}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x) && operand.IsIMM8(i): + return &intrep.Instruction{ + Opcode: "CMPPD", + Operands: []operand.Op{mx, x, i}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("CMPPD: bad operands") +} + +// CMPPS: Compare Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// CMPPS xmm xmm imm8 +// CMPPS m128 xmm imm8 +func CMPPS(mx, x, i operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsIMM8(i): + return &intrep.Instruction{ + Opcode: "CMPPS", + Operands: []operand.Op{mx, x, i}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x) && operand.IsIMM8(i): + return &intrep.Instruction{ + Opcode: "CMPPS", + Operands: []operand.Op{mx, x, i}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("CMPPS: bad operands") +} + +// CMPQ: Compare Two Operands. +// +// Forms: +// +// CMPQ rax imm32 +// CMPQ r64 imm8 +// CMPQ r64 imm32 +// CMPQ r64 r64 +// CMPQ r64 m64 +// CMPQ m64 imm8 +// CMPQ m64 imm32 +// CMPQ m64 r64 +func CMPQ(mr, imr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsRAX(mr) && operand.IsIMM32(imr): + return &intrep.Instruction{ + Opcode: "CMPQ", + Operands: []operand.Op{mr, imr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR64(mr) && operand.IsIMM8(imr): + return &intrep.Instruction{ + Opcode: "CMPQ", + Operands: []operand.Op{mr, imr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR64(mr) && operand.IsIMM32(imr): + return &intrep.Instruction{ + Opcode: "CMPQ", + Operands: []operand.Op{mr, imr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR64(mr) && operand.IsR64(imr): + return &intrep.Instruction{ + Opcode: "CMPQ", + Operands: []operand.Op{mr, imr}, + Inputs: []operand.Op{mr, imr}, + Outputs: []operand.Op{}, + CancellingInputs: true, + }, nil + case operand.IsR64(mr) && operand.IsM64(imr): + return &intrep.Instruction{ + Opcode: "CMPQ", + Operands: []operand.Op{mr, imr}, + Inputs: []operand.Op{mr, imr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsM64(mr) && operand.IsIMM8(imr): + return &intrep.Instruction{ + Opcode: "CMPQ", + Operands: []operand.Op{mr, imr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsM64(mr) && operand.IsIMM32(imr): + return &intrep.Instruction{ + Opcode: "CMPQ", + Operands: []operand.Op{mr, imr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsM64(mr) && operand.IsR64(imr): + return &intrep.Instruction{ + Opcode: "CMPQ", + Operands: []operand.Op{mr, imr}, + Inputs: []operand.Op{mr, imr}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("CMPQ: bad operands") +} + +// CMPSD: Compare Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// CMPSD xmm xmm imm8 +// CMPSD m64 xmm imm8 +func CMPSD(mx, x, i operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsIMM8(i): + return &intrep.Instruction{ + Opcode: "CMPSD", + Operands: []operand.Op{mx, x, i}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsIMM8(i): + return &intrep.Instruction{ + Opcode: "CMPSD", + Operands: []operand.Op{mx, x, i}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("CMPSD: bad operands") +} + +// CMPSS: Compare Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// CMPSS xmm xmm imm8 +// CMPSS m32 xmm imm8 +func CMPSS(mx, x, i operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsIMM8(i): + return &intrep.Instruction{ + Opcode: "CMPSS", + Operands: []operand.Op{mx, x, i}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsIMM8(i): + return &intrep.Instruction{ + Opcode: "CMPSS", + Operands: []operand.Op{mx, x, i}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("CMPSS: bad operands") +} + +// CMPW: Compare Two Operands. +// +// Forms: +// +// CMPW ax imm16 +// CMPW r16 imm8 +// CMPW r16 imm16 +// CMPW r16 r16 +// CMPW r16 m16 +// CMPW m16 imm8 +// CMPW m16 imm16 +// CMPW m16 r16 +func CMPW(amr, imr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsAX(amr) && operand.IsIMM16(imr): + return &intrep.Instruction{ + Opcode: "CMPW", + Operands: []operand.Op{amr, imr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR16(amr) && operand.IsIMM8(imr): + return &intrep.Instruction{ + Opcode: "CMPW", + Operands: []operand.Op{amr, imr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR16(amr) && operand.IsIMM16(imr): + return &intrep.Instruction{ + Opcode: "CMPW", + Operands: []operand.Op{amr, imr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR16(amr) && operand.IsR16(imr): + return &intrep.Instruction{ + Opcode: "CMPW", + Operands: []operand.Op{amr, imr}, + Inputs: []operand.Op{amr, imr}, + Outputs: []operand.Op{}, + CancellingInputs: true, + }, nil + case operand.IsR16(amr) && operand.IsM16(imr): + return &intrep.Instruction{ + Opcode: "CMPW", + Operands: []operand.Op{amr, imr}, + Inputs: []operand.Op{amr, imr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsM16(amr) && operand.IsIMM8(imr): + return &intrep.Instruction{ + Opcode: "CMPW", + Operands: []operand.Op{amr, imr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsM16(amr) && operand.IsIMM16(imr): + return &intrep.Instruction{ + Opcode: "CMPW", + Operands: []operand.Op{amr, imr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsM16(amr) && operand.IsR16(imr): + return &intrep.Instruction{ + Opcode: "CMPW", + Operands: []operand.Op{amr, imr}, + Inputs: []operand.Op{amr, imr}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("CMPW: bad operands") +} + +// CMPXCHG16B: Compare and Exchange 16 Bytes. +// +// Forms: +// +// CMPXCHG16B m128 +func CMPXCHG16B(m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM128(m): + return &intrep.Instruction{ + Opcode: "CMPXCHG16B", + Operands: []operand.Op{m}, + Inputs: []operand.Op{m, reg.RAX, reg.RBX, reg.RCX, reg.RDX}, + Outputs: []operand.Op{reg.RAX, reg.RDX}, + }, nil + } + return nil, errors.New("CMPXCHG16B: bad operands") +} + +// CMPXCHG8B: Compare and Exchange 8 Bytes. +// +// Forms: +// +// CMPXCHG8B m64 +func CMPXCHG8B(m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM64(m): + return &intrep.Instruction{ + Opcode: "CMPXCHG8B", + Operands: []operand.Op{m}, + Inputs: []operand.Op{m, reg.EAX, reg.EBX, reg.ECX, reg.EDX}, + Outputs: []operand.Op{reg.EAX, reg.EDX}, + }, nil + } + return nil, errors.New("CMPXCHG8B: bad operands") +} + +// CMPXCHGB: Compare and Exchange. +// +// Forms: +// +// CMPXCHGB r8 r8 +// CMPXCHGB r8 m8 +func CMPXCHGB(r, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(r) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "CMPXCHGB", + Operands: []operand.Op{r, mr}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR8(r) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "CMPXCHGB", + Operands: []operand.Op{r, mr}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("CMPXCHGB: bad operands") +} + +// CMPXCHGL: Compare and Exchange. +// +// Forms: +// +// CMPXCHGL r32 r32 +// CMPXCHGL r32 m32 +func CMPXCHGL(r, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(r) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "CMPXCHGL", + Operands: []operand.Op{r, mr}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR32(r) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "CMPXCHGL", + Operands: []operand.Op{r, mr}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("CMPXCHGL: bad operands") +} + +// CMPXCHGQ: Compare and Exchange. +// +// Forms: +// +// CMPXCHGQ r64 r64 +// CMPXCHGQ r64 m64 +func CMPXCHGQ(r, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(r) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "CMPXCHGQ", + Operands: []operand.Op{r, mr}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(r) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "CMPXCHGQ", + Operands: []operand.Op{r, mr}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("CMPXCHGQ: bad operands") +} + +// CMPXCHGW: Compare and Exchange. +// +// Forms: +// +// CMPXCHGW r16 r16 +// CMPXCHGW r16 m16 +func CMPXCHGW(r, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(r) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "CMPXCHGW", + Operands: []operand.Op{r, mr}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR16(r) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "CMPXCHGW", + Operands: []operand.Op{r, mr}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("CMPXCHGW: bad operands") +} + +// COMISD: Compare Scalar Ordered Double-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// COMISD xmm xmm +// COMISD m64 xmm +func COMISD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "COMISD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "COMISD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("COMISD: bad operands") +} + +// COMISS: Compare Scalar Ordered Single-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// COMISS xmm xmm +// COMISS m32 xmm +func COMISS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "COMISS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "COMISS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("COMISS: bad operands") +} + +// CPUID: CPU Identification. +// +// Forms: +// +// CPUID +func CPUID() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "CPUID", + Operands: nil, + Inputs: []operand.Op{reg.EAX, reg.ECX}, + Outputs: []operand.Op{reg.EAX, reg.EBX, reg.ECX, reg.EDX}, + ISA: []string{"CPUID"}, + }, nil +} + +// CQO: Convert Quadword to Octaword. +// +// Forms: +// +// CQO +func CQO() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "CQO", + Operands: nil, + Inputs: []operand.Op{reg.RAX}, + Outputs: []operand.Op{reg.RDX}, + }, nil +} + +// CRC32B: Accumulate CRC32 Value. +// +// Forms: +// +// CRC32B r8 r32 +// CRC32B m8 r32 +// CRC32B r8 r64 +// CRC32B m8 r64 +func CRC32B(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CRC32B", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE4.2"}, + }, nil + case operand.IsM8(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CRC32B", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE4.2"}, + }, nil + case operand.IsR8(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CRC32B", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE4.2"}, + }, nil + case operand.IsM8(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CRC32B", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE4.2"}, + }, nil + } + return nil, errors.New("CRC32B: bad operands") +} + +// CRC32L: Accumulate CRC32 Value. +// +// Forms: +// +// CRC32L r32 r32 +// CRC32L m32 r32 +func CRC32L(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CRC32L", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE4.2"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CRC32L", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE4.2"}, + }, nil + } + return nil, errors.New("CRC32L: bad operands") +} + +// CRC32Q: Accumulate CRC32 Value. +// +// Forms: +// +// CRC32Q r64 r64 +// CRC32Q m64 r64 +func CRC32Q(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CRC32Q", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE4.2"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CRC32Q", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE4.2"}, + }, nil + } + return nil, errors.New("CRC32Q: bad operands") +} + +// CRC32W: Accumulate CRC32 Value. +// +// Forms: +// +// CRC32W r16 r32 +// CRC32W m16 r32 +func CRC32W(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CRC32W", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE4.2"}, + }, nil + case operand.IsM16(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CRC32W", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE4.2"}, + }, nil + } + return nil, errors.New("CRC32W: bad operands") +} + +// CVTPD2PL: Convert Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// CVTPD2PL xmm xmm +// CVTPD2PL m128 xmm +func CVTPD2PL(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTPD2PL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTPD2PL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("CVTPD2PL: bad operands") +} + +// CVTPD2PS: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. +// +// Forms: +// +// CVTPD2PS xmm xmm +// CVTPD2PS m128 xmm +func CVTPD2PS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTPD2PS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTPD2PS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("CVTPD2PS: bad operands") +} + +// CVTPL2PD: Convert Packed Dword Integers to Packed Double-Precision FP Values. +// +// Forms: +// +// CVTPL2PD xmm xmm +// CVTPL2PD m64 xmm +func CVTPL2PD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTPL2PD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTPL2PD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("CVTPL2PD: bad operands") +} + +// CVTPL2PS: Convert Packed Dword Integers to Packed Single-Precision FP Values. +// +// Forms: +// +// CVTPL2PS xmm xmm +// CVTPL2PS m128 xmm +func CVTPL2PS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTPL2PS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTPL2PS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("CVTPL2PS: bad operands") +} + +// CVTPS2PD: Convert Packed Single-Precision FP Values to Packed Double-Precision FP Values. +// +// Forms: +// +// CVTPS2PD xmm xmm +// CVTPS2PD m64 xmm +func CVTPS2PD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTPS2PD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTPS2PD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("CVTPS2PD: bad operands") +} + +// CVTPS2PL: Convert Packed Single-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// CVTPS2PL xmm xmm +// CVTPS2PL m128 xmm +func CVTPS2PL(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTPS2PL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTPS2PL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("CVTPS2PL: bad operands") +} + +// CVTSD2SL: Convert Scalar Double-Precision FP Value to Integer. +// +// Forms: +// +// CVTSD2SL xmm r32 +// CVTSD2SL m64 r32 +// CVTSD2SL xmm r64 +// CVTSD2SL m64 r64 +func CVTSD2SL(mx, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CVTSD2SL", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CVTSD2SL", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(mx) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CVTSD2SL", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CVTSD2SL", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("CVTSD2SL: bad operands") +} + +// CVTSD2SS: Convert Scalar Double-Precision FP Value to Scalar Single-Precision FP Value. +// +// Forms: +// +// CVTSD2SS xmm xmm +// CVTSD2SS m64 xmm +func CVTSD2SS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTSD2SS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTSD2SS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("CVTSD2SS: bad operands") +} + +// CVTSL2SD: Convert Dword Integer to Scalar Double-Precision FP Value. +// +// Forms: +// +// CVTSL2SD r32 xmm +// CVTSL2SD m32 xmm +func CVTSL2SD(mr, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTSL2SD", + Operands: []operand.Op{mr, x}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM32(mr) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTSL2SD", + Operands: []operand.Op{mr, x}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("CVTSL2SD: bad operands") +} + +// CVTSL2SS: Convert Dword Integer to Scalar Single-Precision FP Value. +// +// Forms: +// +// CVTSL2SS r32 xmm +// CVTSL2SS m32 xmm +func CVTSL2SS(mr, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTSL2SS", + Operands: []operand.Op{mr, x}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mr) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTSL2SS", + Operands: []operand.Op{mr, x}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("CVTSL2SS: bad operands") +} + +// CVTSQ2SD: Convert Dword Integer to Scalar Double-Precision FP Value. +// +// Forms: +// +// CVTSQ2SD r64 xmm +// CVTSQ2SD m64 xmm +func CVTSQ2SD(mr, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTSQ2SD", + Operands: []operand.Op{mr, x}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mr) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTSQ2SD", + Operands: []operand.Op{mr, x}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("CVTSQ2SD: bad operands") +} + +// CVTSQ2SS: Convert Dword Integer to Scalar Single-Precision FP Value. +// +// Forms: +// +// CVTSQ2SS r64 xmm +// CVTSQ2SS m64 xmm +func CVTSQ2SS(mr, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTSQ2SS", + Operands: []operand.Op{mr, x}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM64(mr) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTSQ2SS", + Operands: []operand.Op{mr, x}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("CVTSQ2SS: bad operands") +} + +// CVTSS2SD: Convert Scalar Single-Precision FP Value to Scalar Double-Precision FP Value. +// +// Forms: +// +// CVTSS2SD xmm xmm +// CVTSS2SD m32 xmm +func CVTSS2SD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTSS2SD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTSS2SD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("CVTSS2SD: bad operands") +} + +// CVTSS2SL: Convert Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// CVTSS2SL xmm r32 +// CVTSS2SL m32 r32 +// CVTSS2SL xmm r64 +// CVTSS2SL m32 r64 +func CVTSS2SL(mx, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CVTSS2SL", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mx) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CVTSS2SL", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE"}, + }, nil + case operand.IsXMM(mx) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CVTSS2SL", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mx) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CVTSS2SL", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("CVTSS2SL: bad operands") +} + +// CVTTPD2PL: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// CVTTPD2PL xmm xmm +// CVTTPD2PL m128 xmm +func CVTTPD2PL(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTTPD2PL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTTPD2PL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("CVTTPD2PL: bad operands") +} + +// CVTTPS2PL: Convert with Truncation Packed Single-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// CVTTPS2PL xmm xmm +// CVTTPS2PL m128 xmm +func CVTTPS2PL(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTTPS2PL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "CVTTPS2PL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("CVTTPS2PL: bad operands") +} + +// CVTTSD2SL: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. +// +// Forms: +// +// CVTTSD2SL xmm r32 +// CVTTSD2SL m64 r32 +func CVTTSD2SL(mx, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CVTTSD2SL", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CVTTSD2SL", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("CVTTSD2SL: bad operands") +} + +// CVTTSD2SQ: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. +// +// Forms: +// +// CVTTSD2SQ xmm r64 +// CVTTSD2SQ m64 r64 +func CVTTSD2SQ(mx, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CVTTSD2SQ", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CVTTSD2SQ", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("CVTTSD2SQ: bad operands") +} + +// CVTTSS2SL: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// CVTTSS2SL xmm r32 +// CVTTSS2SL m32 r32 +// CVTTSS2SL xmm r64 +// CVTTSS2SL m32 r64 +func CVTTSS2SL(mx, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CVTTSS2SL", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mx) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "CVTTSS2SL", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE"}, + }, nil + case operand.IsXMM(mx) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CVTTSS2SL", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mx) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "CVTTSS2SL", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("CVTTSS2SL: bad operands") +} + +// CWD: Convert Word to Doubleword. +// +// Forms: +// +// CWD +func CWD() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "CWD", + Operands: nil, + Inputs: []operand.Op{reg.AX}, + Outputs: []operand.Op{reg.DX}, + }, nil +} + +// CWDE: Convert Word to Doubleword. +// +// Forms: +// +// CWDE +func CWDE() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "CWDE", + Operands: nil, + Inputs: []operand.Op{reg.AX}, + Outputs: []operand.Op{reg.EAX}, + }, nil +} + +// DECB: Decrement by 1. +// +// Forms: +// +// DECB r8 +// DECB m8 +func DECB(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "DECB", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "DECB", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("DECB: bad operands") +} + +// DECL: Decrement by 1. +// +// Forms: +// +// DECL r32 +// DECL m32 +func DECL(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "DECL", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "DECL", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("DECL: bad operands") +} + +// DECQ: Decrement by 1. +// +// Forms: +// +// DECQ r64 +// DECQ m64 +func DECQ(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "DECQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "DECQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("DECQ: bad operands") +} + +// DECW: Decrement by 1. +// +// Forms: +// +// DECW r16 +// DECW m16 +func DECW(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "DECW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "DECW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("DECW: bad operands") +} + +// DIVB: Unsigned Divide. +// +// Forms: +// +// DIVB r8 +// DIVB m8 +func DIVB(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "DIVB", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.AX}, + Outputs: []operand.Op{reg.AX}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "DIVB", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.AX}, + Outputs: []operand.Op{reg.AX}, + }, nil + } + return nil, errors.New("DIVB: bad operands") +} + +// DIVL: Unsigned Divide. +// +// Forms: +// +// DIVL r32 +// DIVL m32 +func DIVL(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "DIVL", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.EAX, reg.EDX}, + Outputs: []operand.Op{reg.EAX, reg.EDX}, + }, nil + case operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "DIVL", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.EAX, reg.EDX}, + Outputs: []operand.Op{reg.EAX, reg.EDX}, + }, nil + } + return nil, errors.New("DIVL: bad operands") +} + +// DIVPD: Divide Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// DIVPD xmm xmm +// DIVPD m128 xmm +func DIVPD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "DIVPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "DIVPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("DIVPD: bad operands") +} + +// DIVPS: Divide Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// DIVPS xmm xmm +// DIVPS m128 xmm +func DIVPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "DIVPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "DIVPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("DIVPS: bad operands") +} + +// DIVQ: Unsigned Divide. +// +// Forms: +// +// DIVQ r64 +// DIVQ m64 +func DIVQ(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "DIVQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.RAX, reg.RDX}, + Outputs: []operand.Op{reg.RAX, reg.RDX}, + }, nil + case operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "DIVQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.RAX, reg.RDX}, + Outputs: []operand.Op{reg.RAX, reg.RDX}, + }, nil + } + return nil, errors.New("DIVQ: bad operands") +} + +// DIVSD: Divide Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// DIVSD xmm xmm +// DIVSD m64 xmm +func DIVSD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "DIVSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "DIVSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("DIVSD: bad operands") +} + +// DIVSS: Divide Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// DIVSS xmm xmm +// DIVSS m32 xmm +func DIVSS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "DIVSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "DIVSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("DIVSS: bad operands") +} + +// DIVW: Unsigned Divide. +// +// Forms: +// +// DIVW r16 +// DIVW m16 +func DIVW(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "DIVW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.AX, reg.DX}, + Outputs: []operand.Op{reg.AX, reg.DX}, + }, nil + case operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "DIVW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.AX, reg.DX}, + Outputs: []operand.Op{reg.AX, reg.DX}, + }, nil + } + return nil, errors.New("DIVW: bad operands") +} + +// DPPD: Dot Product of Packed Double Precision Floating-Point Values. +// +// Forms: +// +// DPPD imm8 xmm xmm +// DPPD imm8 m128 xmm +func DPPD(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "DPPD", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "DPPD", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("DPPD: bad operands") +} + +// DPPS: Dot Product of Packed Single Precision Floating-Point Values. +// +// Forms: +// +// DPPS imm8 xmm xmm +// DPPS imm8 m128 xmm +func DPPS(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "DPPS", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "DPPS", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("DPPS: bad operands") +} + +// EXTRACTPS: Extract Packed Single Precision Floating-Point Value. +// +// Forms: +// +// EXTRACTPS imm2u xmm r32 +// EXTRACTPS imm2u xmm m32 +func EXTRACTPS(i, x, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM2U(i) && operand.IsXMM(x) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "EXTRACTPS", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM2U(i) && operand.IsXMM(x) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "EXTRACTPS", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("EXTRACTPS: bad operands") +} + +// HADDPD: Packed Double-FP Horizontal Add. +// +// Forms: +// +// HADDPD xmm xmm +// HADDPD m128 xmm +func HADDPD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "HADDPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "HADDPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + } + return nil, errors.New("HADDPD: bad operands") +} + +// HADDPS: Packed Single-FP Horizontal Add. +// +// Forms: +// +// HADDPS xmm xmm +// HADDPS m128 xmm +func HADDPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "HADDPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "HADDPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + } + return nil, errors.New("HADDPS: bad operands") +} + +// HSUBPD: Packed Double-FP Horizontal Subtract. +// +// Forms: +// +// HSUBPD xmm xmm +// HSUBPD m128 xmm +func HSUBPD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "HSUBPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "HSUBPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + } + return nil, errors.New("HSUBPD: bad operands") +} + +// HSUBPS: Packed Single-FP Horizontal Subtract. +// +// Forms: +// +// HSUBPS xmm xmm +// HSUBPS m128 xmm +func HSUBPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "HSUBPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "HSUBPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + } + return nil, errors.New("HSUBPS: bad operands") +} + +// IDIVB: Signed Divide. +// +// Forms: +// +// IDIVB r8 +// IDIVB m8 +func IDIVB(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "IDIVB", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.AX}, + Outputs: []operand.Op{reg.AX}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "IDIVB", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.AX}, + Outputs: []operand.Op{reg.AX}, + }, nil + } + return nil, errors.New("IDIVB: bad operands") +} + +// IDIVL: Signed Divide. +// +// Forms: +// +// IDIVL r32 +// IDIVL m32 +func IDIVL(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "IDIVL", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.EAX, reg.EDX}, + Outputs: []operand.Op{reg.EAX, reg.EDX}, + }, nil + case operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "IDIVL", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.EAX, reg.EDX}, + Outputs: []operand.Op{reg.EAX, reg.EDX}, + }, nil + } + return nil, errors.New("IDIVL: bad operands") +} + +// IDIVQ: Signed Divide. +// +// Forms: +// +// IDIVQ r64 +// IDIVQ m64 +func IDIVQ(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "IDIVQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.RAX, reg.RDX}, + Outputs: []operand.Op{reg.RAX, reg.RDX}, + }, nil + case operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "IDIVQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.RAX, reg.RDX}, + Outputs: []operand.Op{reg.RAX, reg.RDX}, + }, nil + } + return nil, errors.New("IDIVQ: bad operands") +} + +// IDIVW: Signed Divide. +// +// Forms: +// +// IDIVW r16 +// IDIVW m16 +func IDIVW(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "IDIVW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.AX, reg.DX}, + Outputs: []operand.Op{reg.AX, reg.DX}, + }, nil + case operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "IDIVW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.AX, reg.DX}, + Outputs: []operand.Op{reg.AX, reg.DX}, + }, nil + } + return nil, errors.New("IDIVW: bad operands") +} + +// IMUL3L: Signed Multiply. +// +// Forms: +// +// IMUL3L imm8 r32 r32 +// IMUL3L imm32 r32 r32 +// IMUL3L imm8 m32 r32 +// IMUL3L imm32 m32 r32 +func IMUL3L(i, mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "IMUL3L", + Operands: []operand.Op{i, mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsIMM32(i) && operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "IMUL3L", + Operands: []operand.Op{i, mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsIMM8(i) && operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "IMUL3L", + Operands: []operand.Op{i, mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsIMM32(i) && operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "IMUL3L", + Operands: []operand.Op{i, mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("IMUL3L: bad operands") +} + +// IMUL3Q: Signed Multiply. +// +// Forms: +// +// IMUL3Q imm8 r64 r64 +// IMUL3Q imm32 r64 r64 +// IMUL3Q imm8 m64 r64 +// IMUL3Q imm32 m64 r64 +func IMUL3Q(i, mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "IMUL3Q", + Operands: []operand.Op{i, mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsIMM32(i) && operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "IMUL3Q", + Operands: []operand.Op{i, mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsIMM8(i) && operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "IMUL3Q", + Operands: []operand.Op{i, mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsIMM32(i) && operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "IMUL3Q", + Operands: []operand.Op{i, mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("IMUL3Q: bad operands") +} + +// IMUL3W: Signed Multiply. +// +// Forms: +// +// IMUL3W imm8 r16 r16 +// IMUL3W imm16 r16 r16 +// IMUL3W imm8 m16 r16 +// IMUL3W imm16 m16 r16 +func IMUL3W(i, mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "IMUL3W", + Operands: []operand.Op{i, mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsIMM16(i) && operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "IMUL3W", + Operands: []operand.Op{i, mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsIMM8(i) && operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "IMUL3W", + Operands: []operand.Op{i, mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsIMM16(i) && operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "IMUL3W", + Operands: []operand.Op{i, mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("IMUL3W: bad operands") +} + +// IMULB: Signed Multiply. +// +// Forms: +// +// IMULB r8 +// IMULB m8 +func IMULB(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "IMULB", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.AL}, + Outputs: []operand.Op{reg.AX}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "IMULB", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.AL}, + Outputs: []operand.Op{reg.AX}, + }, nil + } + return nil, errors.New("IMULB: bad operands") +} + +// IMULL: Signed Multiply. +// +// Forms: +// +// IMULL r32 +// IMULL m32 +// IMULL r32 r32 +// IMULL m32 r32 +func IMULL(ops ...operand.Op) (*intrep.Instruction, error) { + switch { + case len(ops) == 1 && operand.IsR32(ops[0]): + return &intrep.Instruction{ + Opcode: "IMULL", + Operands: ops, + Inputs: []operand.Op{ops[0], reg.EAX}, + Outputs: []operand.Op{reg.EAX, reg.EDX}, + }, nil + case len(ops) == 1 && operand.IsM32(ops[0]): + return &intrep.Instruction{ + Opcode: "IMULL", + Operands: ops, + Inputs: []operand.Op{ops[0], reg.EAX}, + Outputs: []operand.Op{reg.EAX, reg.EDX}, + }, nil + case len(ops) == 2 && operand.IsR32(ops[0]) && operand.IsR32(ops[1]): + return &intrep.Instruction{ + Opcode: "IMULL", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsM32(ops[0]) && operand.IsR32(ops[1]): + return &intrep.Instruction{ + Opcode: "IMULL", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + } + return nil, errors.New("IMULL: bad operands") +} + +// IMULQ: Signed Multiply. +// +// Forms: +// +// IMULQ r64 +// IMULQ m64 +// IMULQ r64 r64 +// IMULQ m64 r64 +func IMULQ(ops ...operand.Op) (*intrep.Instruction, error) { + switch { + case len(ops) == 1 && operand.IsR64(ops[0]): + return &intrep.Instruction{ + Opcode: "IMULQ", + Operands: ops, + Inputs: []operand.Op{ops[0], reg.RAX}, + Outputs: []operand.Op{reg.RAX, reg.RDX}, + }, nil + case len(ops) == 1 && operand.IsM64(ops[0]): + return &intrep.Instruction{ + Opcode: "IMULQ", + Operands: ops, + Inputs: []operand.Op{ops[0], reg.RAX}, + Outputs: []operand.Op{reg.RAX, reg.RDX}, + }, nil + case len(ops) == 2 && operand.IsR64(ops[0]) && operand.IsR64(ops[1]): + return &intrep.Instruction{ + Opcode: "IMULQ", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsM64(ops[0]) && operand.IsR64(ops[1]): + return &intrep.Instruction{ + Opcode: "IMULQ", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + } + return nil, errors.New("IMULQ: bad operands") +} + +// IMULW: Signed Multiply. +// +// Forms: +// +// IMULW r16 +// IMULW m16 +// IMULW r16 r16 +// IMULW m16 r16 +func IMULW(ops ...operand.Op) (*intrep.Instruction, error) { + switch { + case len(ops) == 1 && operand.IsR16(ops[0]): + return &intrep.Instruction{ + Opcode: "IMULW", + Operands: ops, + Inputs: []operand.Op{ops[0], reg.AX}, + Outputs: []operand.Op{reg.AX, reg.DX}, + }, nil + case len(ops) == 1 && operand.IsM16(ops[0]): + return &intrep.Instruction{ + Opcode: "IMULW", + Operands: ops, + Inputs: []operand.Op{ops[0], reg.AX}, + Outputs: []operand.Op{reg.AX, reg.DX}, + }, nil + case len(ops) == 2 && operand.IsR16(ops[0]) && operand.IsR16(ops[1]): + return &intrep.Instruction{ + Opcode: "IMULW", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsM16(ops[0]) && operand.IsR16(ops[1]): + return &intrep.Instruction{ + Opcode: "IMULW", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + } + return nil, errors.New("IMULW: bad operands") +} + +// INCB: Increment by 1. +// +// Forms: +// +// INCB r8 +// INCB m8 +func INCB(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "INCB", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "INCB", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("INCB: bad operands") +} + +// INCL: Increment by 1. +// +// Forms: +// +// INCL r32 +// INCL m32 +func INCL(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "INCL", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "INCL", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("INCL: bad operands") +} + +// INCQ: Increment by 1. +// +// Forms: +// +// INCQ r64 +// INCQ m64 +func INCQ(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "INCQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "INCQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("INCQ: bad operands") +} + +// INCW: Increment by 1. +// +// Forms: +// +// INCW r16 +// INCW m16 +func INCW(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "INCW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "INCW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("INCW: bad operands") +} + +// INSERTPS: Insert Packed Single Precision Floating-Point Value. +// +// Forms: +// +// INSERTPS imm8 xmm xmm +// INSERTPS imm8 m32 xmm +func INSERTPS(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "INSERTPS", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "INSERTPS", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("INSERTPS: bad operands") +} + +// INT: Call to Interrupt Procedure. +// +// Forms: +// +// INT 3 +// INT imm8 +func INT(i operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is3(i): + return &intrep.Instruction{ + Opcode: "INT", + Operands: []operand.Op{i}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + }, nil + case operand.IsIMM8(i): + return &intrep.Instruction{ + Opcode: "INT", + Operands: []operand.Op{i}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("INT: bad operands") +} + +// JA: Jump if above (CF == 0 and ZF == 0). +// +// Forms: +// +// JA rel8 +// JA rel32 +func JA(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JA", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JA", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JA: bad operands") +} + +// JAE: Jump if above or equal (CF == 0). +// +// Forms: +// +// JAE rel8 +// JAE rel32 +func JAE(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JAE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JAE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JAE: bad operands") +} + +// JB: Jump if below (CF == 1). +// +// Forms: +// +// JB rel8 +// JB rel32 +func JB(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JB", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JB", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JB: bad operands") +} + +// JBE: Jump if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// JBE rel8 +// JBE rel32 +func JBE(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JBE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JBE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JBE: bad operands") +} + +// JC: Jump if below (CF == 1). +// +// Forms: +// +// JC rel8 +// JC rel32 +func JC(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JC", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JC", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JC: bad operands") +} + +// JCC: Jump if above or equal (CF == 0). +// +// Forms: +// +// JCC rel8 +// JCC rel32 +func JCC(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JCC", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JCC", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JCC: bad operands") +} + +// JCS: Jump if below (CF == 1). +// +// Forms: +// +// JCS rel8 +// JCS rel32 +func JCS(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JCS", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JCS", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JCS: bad operands") +} + +// JCXZL: Jump if ECX register is 0. +// +// Forms: +// +// JCXZL rel8 +func JCXZL(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JCXZL", + Operands: []operand.Op{r}, + Inputs: []operand.Op{reg.ECX}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JCXZL: bad operands") +} + +// JCXZQ: Jump if RCX register is 0. +// +// Forms: +// +// JCXZQ rel8 +func JCXZQ(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JCXZQ", + Operands: []operand.Op{r}, + Inputs: []operand.Op{reg.RCX}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JCXZQ: bad operands") +} + +// JE: Jump if equal (ZF == 1). +// +// Forms: +// +// JE rel8 +// JE rel32 +func JE(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JE: bad operands") +} + +// JEQ: Jump if equal (ZF == 1). +// +// Forms: +// +// JEQ rel8 +// JEQ rel32 +func JEQ(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JEQ", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JEQ", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JEQ: bad operands") +} + +// JG: Jump if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// JG rel8 +// JG rel32 +func JG(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JG", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JG", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JG: bad operands") +} + +// JGE: Jump if greater or equal (SF == OF). +// +// Forms: +// +// JGE rel8 +// JGE rel32 +func JGE(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JGE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JGE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JGE: bad operands") +} + +// JGT: Jump if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// JGT rel8 +// JGT rel32 +func JGT(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JGT", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JGT", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JGT: bad operands") +} + +// JHI: Jump if above (CF == 0 and ZF == 0). +// +// Forms: +// +// JHI rel8 +// JHI rel32 +func JHI(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JHI", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JHI", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JHI: bad operands") +} + +// JHS: Jump if above or equal (CF == 0). +// +// Forms: +// +// JHS rel8 +// JHS rel32 +func JHS(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JHS", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JHS", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JHS: bad operands") +} + +// JL: Jump if less (SF != OF). +// +// Forms: +// +// JL rel8 +// JL rel32 +func JL(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JL", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JL", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JL: bad operands") +} + +// JLE: Jump if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// JLE rel8 +// JLE rel32 +func JLE(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JLE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JLE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JLE: bad operands") +} + +// JLO: Jump if below (CF == 1). +// +// Forms: +// +// JLO rel8 +// JLO rel32 +func JLO(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JLO", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JLO", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JLO: bad operands") +} + +// JLS: Jump if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// JLS rel8 +// JLS rel32 +func JLS(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JLS", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JLS", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JLS: bad operands") +} + +// JLT: Jump if less (SF != OF). +// +// Forms: +// +// JLT rel8 +// JLT rel32 +func JLT(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JLT", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JLT", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JLT: bad operands") +} + +// JMI: Jump if sign (SF == 1). +// +// Forms: +// +// JMI rel8 +// JMI rel32 +func JMI(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JMI", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JMI", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JMI: bad operands") +} + +// JMP: Jump Unconditionally. +// +// Forms: +// +// JMP rel8 +// JMP rel32 +// JMP r64 +// JMP m64 +func JMP(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(mr): + return &intrep.Instruction{ + Opcode: "JMP", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: false, + }, nil + case operand.IsREL32(mr): + return &intrep.Instruction{ + Opcode: "JMP", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: false, + }, nil + case operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "JMP", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: false, + }, nil + case operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "JMP", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: false, + }, nil + } + return nil, errors.New("JMP: bad operands") +} + +// JNA: Jump if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// JNA rel8 +// JNA rel32 +func JNA(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JNA", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JNA", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JNA: bad operands") +} + +// JNAE: Jump if below (CF == 1). +// +// Forms: +// +// JNAE rel8 +// JNAE rel32 +func JNAE(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JNAE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JNAE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JNAE: bad operands") +} + +// JNB: Jump if above or equal (CF == 0). +// +// Forms: +// +// JNB rel8 +// JNB rel32 +func JNB(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JNB", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JNB", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JNB: bad operands") +} + +// JNBE: Jump if above (CF == 0 and ZF == 0). +// +// Forms: +// +// JNBE rel8 +// JNBE rel32 +func JNBE(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JNBE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JNBE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JNBE: bad operands") +} + +// JNC: Jump if above or equal (CF == 0). +// +// Forms: +// +// JNC rel8 +// JNC rel32 +func JNC(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JNC", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JNC", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JNC: bad operands") +} + +// JNE: Jump if not equal (ZF == 0). +// +// Forms: +// +// JNE rel8 +// JNE rel32 +func JNE(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JNE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JNE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JNE: bad operands") +} + +// JNG: Jump if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// JNG rel8 +// JNG rel32 +func JNG(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JNG", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JNG", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JNG: bad operands") +} + +// JNGE: Jump if less (SF != OF). +// +// Forms: +// +// JNGE rel8 +// JNGE rel32 +func JNGE(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JNGE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JNGE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JNGE: bad operands") +} + +// JNL: Jump if greater or equal (SF == OF). +// +// Forms: +// +// JNL rel8 +// JNL rel32 +func JNL(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JNL", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JNL", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JNL: bad operands") +} + +// JNLE: Jump if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// JNLE rel8 +// JNLE rel32 +func JNLE(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JNLE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JNLE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JNLE: bad operands") +} + +// JNO: Jump if not overflow (OF == 0). +// +// Forms: +// +// JNO rel8 +// JNO rel32 +func JNO(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JNO", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JNO", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JNO: bad operands") +} + +// JNP: Jump if not parity (PF == 0). +// +// Forms: +// +// JNP rel8 +// JNP rel32 +func JNP(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JNP", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JNP", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JNP: bad operands") +} + +// JNS: Jump if not sign (SF == 0). +// +// Forms: +// +// JNS rel8 +// JNS rel32 +func JNS(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JNS", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JNS", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JNS: bad operands") +} + +// JNZ: Jump if not equal (ZF == 0). +// +// Forms: +// +// JNZ rel8 +// JNZ rel32 +func JNZ(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JNZ", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JNZ", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JNZ: bad operands") +} + +// JO: Jump if overflow (OF == 1). +// +// Forms: +// +// JO rel8 +// JO rel32 +func JO(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JO", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JO", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JO: bad operands") +} + +// JOC: Jump if not overflow (OF == 0). +// +// Forms: +// +// JOC rel8 +// JOC rel32 +func JOC(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JOC", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JOC", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JOC: bad operands") +} + +// JOS: Jump if overflow (OF == 1). +// +// Forms: +// +// JOS rel8 +// JOS rel32 +func JOS(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JOS", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JOS", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JOS: bad operands") +} + +// JP: Jump if parity (PF == 1). +// +// Forms: +// +// JP rel8 +// JP rel32 +func JP(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JP", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JP", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JP: bad operands") +} + +// JPC: Jump if not parity (PF == 0). +// +// Forms: +// +// JPC rel8 +// JPC rel32 +func JPC(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JPC", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JPC", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JPC: bad operands") +} + +// JPE: Jump if parity (PF == 1). +// +// Forms: +// +// JPE rel8 +// JPE rel32 +func JPE(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JPE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JPE", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JPE: bad operands") +} + +// JPL: Jump if not sign (SF == 0). +// +// Forms: +// +// JPL rel8 +// JPL rel32 +func JPL(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JPL", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JPL", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JPL: bad operands") +} + +// JPO: Jump if not parity (PF == 0). +// +// Forms: +// +// JPO rel8 +// JPO rel32 +func JPO(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JPO", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JPO", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JPO: bad operands") +} + +// JPS: Jump if parity (PF == 1). +// +// Forms: +// +// JPS rel8 +// JPS rel32 +func JPS(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JPS", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JPS", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JPS: bad operands") +} + +// JS: Jump if sign (SF == 1). +// +// Forms: +// +// JS rel8 +// JS rel32 +func JS(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JS", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JS", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JS: bad operands") +} + +// JZ: Jump if equal (ZF == 1). +// +// Forms: +// +// JZ rel8 +// JZ rel32 +func JZ(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsREL8(r): + return &intrep.Instruction{ + Opcode: "JZ", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + case operand.IsREL32(r): + return &intrep.Instruction{ + Opcode: "JZ", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsBranch: true, + IsConditional: true, + }, nil + } + return nil, errors.New("JZ: bad operands") +} + +// LDDQU: Load Unaligned Integer 128 Bits. +// +// Forms: +// +// LDDQU m128 xmm +func LDDQU(m, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM128(m) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "LDDQU", + Operands: []operand.Op{m, x}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + } + return nil, errors.New("LDDQU: bad operands") +} + +// LDMXCSR: Load MXCSR Register. +// +// Forms: +// +// LDMXCSR m32 +func LDMXCSR(m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM32(m): + return &intrep.Instruction{ + Opcode: "LDMXCSR", + Operands: []operand.Op{m}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("LDMXCSR: bad operands") +} + +// LEAL: Load Effective Address. +// +// Forms: +// +// LEAL m r32 +func LEAL(m, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM(m) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "LEAL", + Operands: []operand.Op{m, r}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("LEAL: bad operands") +} + +// LEAQ: Load Effective Address. +// +// Forms: +// +// LEAQ m r64 +func LEAQ(m, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM(m) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "LEAQ", + Operands: []operand.Op{m, r}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("LEAQ: bad operands") +} + +// LEAW: Load Effective Address. +// +// Forms: +// +// LEAW m r16 +func LEAW(m, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM(m) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "LEAW", + Operands: []operand.Op{m, r}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("LEAW: bad operands") +} + +// LFENCE: Load Fence. +// +// Forms: +// +// LFENCE +func LFENCE() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "LFENCE", + Operands: nil, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + ISA: []string{"SSE2"}, + }, nil +} + +// LZCNTL: Count the Number of Leading Zero Bits. +// +// Forms: +// +// LZCNTL r32 r32 +// LZCNTL m32 r32 +func LZCNTL(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "LZCNTL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"LZCNT"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "LZCNTL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"LZCNT"}, + }, nil + } + return nil, errors.New("LZCNTL: bad operands") +} + +// LZCNTQ: Count the Number of Leading Zero Bits. +// +// Forms: +// +// LZCNTQ r64 r64 +// LZCNTQ m64 r64 +func LZCNTQ(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "LZCNTQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"LZCNT"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "LZCNTQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"LZCNT"}, + }, nil + } + return nil, errors.New("LZCNTQ: bad operands") +} + +// LZCNTW: Count the Number of Leading Zero Bits. +// +// Forms: +// +// LZCNTW r16 r16 +// LZCNTW m16 r16 +func LZCNTW(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "LZCNTW", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"LZCNT"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "LZCNTW", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"LZCNT"}, + }, nil + } + return nil, errors.New("LZCNTW: bad operands") +} + +// MASKMOVDQU: Store Selected Bytes of Double Quadword. +// +// Forms: +// +// MASKMOVDQU xmm xmm +func MASKMOVDQU(x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "MASKMOVDQU", + Operands: []operand.Op{x, x1}, + Inputs: []operand.Op{x, x1, reg.RDI}, + Outputs: []operand.Op{}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MASKMOVDQU: bad operands") +} + +// MASKMOVOU: Store Selected Bytes of Double Quadword. +// +// Forms: +// +// MASKMOVOU xmm xmm +func MASKMOVOU(x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "MASKMOVOU", + Operands: []operand.Op{x, x1}, + Inputs: []operand.Op{x, x1, reg.RDI}, + Outputs: []operand.Op{}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MASKMOVOU: bad operands") +} + +// MAXPD: Return Maximum Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// MAXPD xmm xmm +// MAXPD m128 xmm +func MAXPD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MAXPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MAXPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MAXPD: bad operands") +} + +// MAXPS: Return Maximum Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MAXPS xmm xmm +// MAXPS m128 xmm +func MAXPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MAXPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MAXPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("MAXPS: bad operands") +} + +// MAXSD: Return Maximum Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// MAXSD xmm xmm +// MAXSD m64 xmm +func MAXSD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MAXSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MAXSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MAXSD: bad operands") +} + +// MAXSS: Return Maximum Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// MAXSS xmm xmm +// MAXSS m32 xmm +func MAXSS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MAXSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MAXSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("MAXSS: bad operands") +} + +// MFENCE: Memory Fence. +// +// Forms: +// +// MFENCE +func MFENCE() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "MFENCE", + Operands: nil, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + ISA: []string{"SSE2"}, + }, nil +} + +// MINPD: Return Minimum Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// MINPD xmm xmm +// MINPD m128 xmm +func MINPD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MINPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MINPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MINPD: bad operands") +} + +// MINPS: Return Minimum Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MINPS xmm xmm +// MINPS m128 xmm +func MINPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MINPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MINPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("MINPS: bad operands") +} + +// MINSD: Return Minimum Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// MINSD xmm xmm +// MINSD m64 xmm +func MINSD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MINSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MINSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MINSD: bad operands") +} + +// MINSS: Return Minimum Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// MINSS xmm xmm +// MINSS m32 xmm +func MINSS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MINSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MINSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("MINSS: bad operands") +} + +// MONITOR: Monitor a Linear Address Range. +// +// Forms: +// +// MONITOR +func MONITOR() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "MONITOR", + Operands: nil, + Inputs: []operand.Op{reg.RAX, reg.ECX, reg.EDX}, + Outputs: []operand.Op{}, + ISA: []string{"MONITOR"}, + }, nil +} + +// MOVAPD: Move Aligned Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// MOVAPD xmm xmm +// MOVAPD m128 xmm +// MOVAPD xmm m128 +func MOVAPD(mx, mx1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVAPD", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVAPD", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(mx) && operand.IsM128(mx1): + return &intrep.Instruction{ + Opcode: "MOVAPD", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MOVAPD: bad operands") +} + +// MOVAPS: Move Aligned Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MOVAPS xmm xmm +// MOVAPS m128 xmm +// MOVAPS xmm m128 +func MOVAPS(mx, mx1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVAPS", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVAPS", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE"}, + }, nil + case operand.IsXMM(mx) && operand.IsM128(mx1): + return &intrep.Instruction{ + Opcode: "MOVAPS", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("MOVAPS: bad operands") +} + +// MOVB: Move. +// +// Forms: +// +// MOVB imm8 r8 +// MOVB r8 r8 +// MOVB m8 r8 +// MOVB imm8 m8 +// MOVB r8 m8 +func MOVB(imr, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imr) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "MOVB", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR8(imr) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "MOVB", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(imr) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "MOVB", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "MOVB", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR8(imr) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "MOVB", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("MOVB: bad operands") +} + +// MOVBELL: Move Data After Swapping Bytes. +// +// Forms: +// +// MOVBELL m32 r32 +// MOVBELL r32 m32 +func MOVBELL(mr, mr1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM32(mr) && operand.IsR32(mr1): + return &intrep.Instruction{ + Opcode: "MOVBELL", + Operands: []operand.Op{mr, mr1}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr1}, + ISA: []string{"MOVBE"}, + }, nil + case operand.IsR32(mr) && operand.IsM32(mr1): + return &intrep.Instruction{ + Opcode: "MOVBELL", + Operands: []operand.Op{mr, mr1}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr1}, + ISA: []string{"MOVBE"}, + }, nil + } + return nil, errors.New("MOVBELL: bad operands") +} + +// MOVBEQQ: Move Data After Swapping Bytes. +// +// Forms: +// +// MOVBEQQ m64 r64 +// MOVBEQQ r64 m64 +func MOVBEQQ(mr, mr1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM64(mr) && operand.IsR64(mr1): + return &intrep.Instruction{ + Opcode: "MOVBEQQ", + Operands: []operand.Op{mr, mr1}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr1}, + ISA: []string{"MOVBE"}, + }, nil + case operand.IsR64(mr) && operand.IsM64(mr1): + return &intrep.Instruction{ + Opcode: "MOVBEQQ", + Operands: []operand.Op{mr, mr1}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr1}, + ISA: []string{"MOVBE"}, + }, nil + } + return nil, errors.New("MOVBEQQ: bad operands") +} + +// MOVBEWW: Move Data After Swapping Bytes. +// +// Forms: +// +// MOVBEWW m16 r16 +// MOVBEWW r16 m16 +func MOVBEWW(mr, mr1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM16(mr) && operand.IsR16(mr1): + return &intrep.Instruction{ + Opcode: "MOVBEWW", + Operands: []operand.Op{mr, mr1}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr1}, + ISA: []string{"MOVBE"}, + }, nil + case operand.IsR16(mr) && operand.IsM16(mr1): + return &intrep.Instruction{ + Opcode: "MOVBEWW", + Operands: []operand.Op{mr, mr1}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr1}, + ISA: []string{"MOVBE"}, + }, nil + } + return nil, errors.New("MOVBEWW: bad operands") +} + +// MOVBLSX: Move with Sign-Extension. +// +// Forms: +// +// MOVBLSX r8 r32 +// MOVBLSX m8 r32 +func MOVBLSX(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "MOVBLSX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsM8(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "MOVBLSX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("MOVBLSX: bad operands") +} + +// MOVBLZX: Move with Zero-Extend. +// +// Forms: +// +// MOVBLZX r8 r32 +// MOVBLZX m8 r32 +func MOVBLZX(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "MOVBLZX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsM8(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "MOVBLZX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("MOVBLZX: bad operands") +} + +// MOVBQSX: Move with Sign-Extension. +// +// Forms: +// +// MOVBQSX r8 r64 +// MOVBQSX m8 r64 +func MOVBQSX(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "MOVBQSX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsM8(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "MOVBQSX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("MOVBQSX: bad operands") +} + +// MOVBQZX: Move with Zero-Extend. +// +// Forms: +// +// MOVBQZX r8 r64 +// MOVBQZX m8 r64 +func MOVBQZX(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "MOVBQZX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsM8(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "MOVBQZX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("MOVBQZX: bad operands") +} + +// MOVBWSX: Move with Sign-Extension. +// +// Forms: +// +// MOVBWSX r8 r16 +// MOVBWSX m8 r16 +func MOVBWSX(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "MOVBWSX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsM8(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "MOVBWSX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("MOVBWSX: bad operands") +} + +// MOVBWZX: Move with Zero-Extend. +// +// Forms: +// +// MOVBWZX r8 r16 +// MOVBWZX m8 r16 +func MOVBWZX(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "MOVBWZX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsM8(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "MOVBWZX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("MOVBWZX: bad operands") +} + +// MOVD: Move. +// +// Forms: +// +// MOVD imm32 r64 +// MOVD imm64 r64 +// MOVD r64 r64 +// MOVD m64 r64 +// MOVD imm32 m64 +// MOVD r64 m64 +// MOVD xmm r64 +// MOVD r64 xmm +// MOVD xmm xmm +// MOVD m64 xmm +// MOVD xmm m64 +// MOVD xmm r32 +// MOVD r32 xmm +// MOVD m32 xmm +// MOVD xmm m32 +func MOVD(imrx, mrx operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imrx) && operand.IsR64(mrx): + return &intrep.Instruction{ + Opcode: "MOVD", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsIMM64(imrx) && operand.IsR64(mrx): + return &intrep.Instruction{ + Opcode: "MOVD", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsR64(imrx) && operand.IsR64(mrx): + return &intrep.Instruction{ + Opcode: "MOVD", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsM64(imrx) && operand.IsR64(mrx): + return &intrep.Instruction{ + Opcode: "MOVD", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsIMM32(imrx) && operand.IsM64(mrx): + return &intrep.Instruction{ + Opcode: "MOVD", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsR64(imrx) && operand.IsM64(mrx): + return &intrep.Instruction{ + Opcode: "MOVD", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsXMM(imrx) && operand.IsR64(mrx): + return &intrep.Instruction{ + Opcode: "MOVD", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsR64(imrx) && operand.IsXMM(mrx): + return &intrep.Instruction{ + Opcode: "MOVD", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imrx) && operand.IsXMM(mrx): + return &intrep.Instruction{ + Opcode: "MOVD", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(imrx) && operand.IsXMM(mrx): + return &intrep.Instruction{ + Opcode: "MOVD", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imrx) && operand.IsM64(mrx): + return &intrep.Instruction{ + Opcode: "MOVD", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imrx) && operand.IsR32(mrx): + return &intrep.Instruction{ + Opcode: "MOVD", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsR32(imrx) && operand.IsXMM(mrx): + return &intrep.Instruction{ + Opcode: "MOVD", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM32(imrx) && operand.IsXMM(mrx): + return &intrep.Instruction{ + Opcode: "MOVD", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imrx) && operand.IsM32(mrx): + return &intrep.Instruction{ + Opcode: "MOVD", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MOVD: bad operands") +} + +// MOVDDUP: Move One Double-FP and Duplicate. +// +// Forms: +// +// MOVDDUP xmm xmm +// MOVDDUP m64 xmm +func MOVDDUP(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MOVDDUP", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MOVDDUP", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + } + return nil, errors.New("MOVDDUP: bad operands") +} + +// MOVDQ2Q: Move. +// +// Forms: +// +// MOVDQ2Q imm32 r64 +// MOVDQ2Q imm64 r64 +// MOVDQ2Q r64 r64 +// MOVDQ2Q m64 r64 +// MOVDQ2Q imm32 m64 +// MOVDQ2Q r64 m64 +// MOVDQ2Q xmm r64 +// MOVDQ2Q r64 xmm +// MOVDQ2Q xmm xmm +// MOVDQ2Q m64 xmm +// MOVDQ2Q xmm m64 +// MOVDQ2Q xmm r32 +// MOVDQ2Q r32 xmm +// MOVDQ2Q m32 xmm +// MOVDQ2Q xmm m32 +func MOVDQ2Q(imrx, mrx operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imrx) && operand.IsR64(mrx): + return &intrep.Instruction{ + Opcode: "MOVDQ2Q", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsIMM64(imrx) && operand.IsR64(mrx): + return &intrep.Instruction{ + Opcode: "MOVDQ2Q", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsR64(imrx) && operand.IsR64(mrx): + return &intrep.Instruction{ + Opcode: "MOVDQ2Q", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsM64(imrx) && operand.IsR64(mrx): + return &intrep.Instruction{ + Opcode: "MOVDQ2Q", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsIMM32(imrx) && operand.IsM64(mrx): + return &intrep.Instruction{ + Opcode: "MOVDQ2Q", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsR64(imrx) && operand.IsM64(mrx): + return &intrep.Instruction{ + Opcode: "MOVDQ2Q", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsXMM(imrx) && operand.IsR64(mrx): + return &intrep.Instruction{ + Opcode: "MOVDQ2Q", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsR64(imrx) && operand.IsXMM(mrx): + return &intrep.Instruction{ + Opcode: "MOVDQ2Q", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imrx) && operand.IsXMM(mrx): + return &intrep.Instruction{ + Opcode: "MOVDQ2Q", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(imrx) && operand.IsXMM(mrx): + return &intrep.Instruction{ + Opcode: "MOVDQ2Q", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imrx) && operand.IsM64(mrx): + return &intrep.Instruction{ + Opcode: "MOVDQ2Q", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imrx) && operand.IsR32(mrx): + return &intrep.Instruction{ + Opcode: "MOVDQ2Q", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsR32(imrx) && operand.IsXMM(mrx): + return &intrep.Instruction{ + Opcode: "MOVDQ2Q", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM32(imrx) && operand.IsXMM(mrx): + return &intrep.Instruction{ + Opcode: "MOVDQ2Q", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imrx) && operand.IsM32(mrx): + return &intrep.Instruction{ + Opcode: "MOVDQ2Q", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MOVDQ2Q: bad operands") +} + +// MOVHLPS: Move Packed Single-Precision Floating-Point Values High to Low. +// +// Forms: +// +// MOVHLPS xmm xmm +func MOVHLPS(x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "MOVHLPS", + Operands: []operand.Op{x, x1}, + Inputs: []operand.Op{x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("MOVHLPS: bad operands") +} + +// MOVHPD: Move High Packed Double-Precision Floating-Point Value. +// +// Forms: +// +// MOVHPD m64 xmm +// MOVHPD xmm m64 +func MOVHPD(mx, mx1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM64(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVHPD", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx, mx1}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(mx) && operand.IsM64(mx1): + return &intrep.Instruction{ + Opcode: "MOVHPD", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MOVHPD: bad operands") +} + +// MOVHPS: Move High Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MOVHPS m64 xmm +// MOVHPS xmm m64 +func MOVHPS(mx, mx1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM64(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVHPS", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx, mx1}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE"}, + }, nil + case operand.IsXMM(mx) && operand.IsM64(mx1): + return &intrep.Instruction{ + Opcode: "MOVHPS", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("MOVHPS: bad operands") +} + +// MOVL: Move. +// +// Forms: +// +// MOVL imm32 r32 +// MOVL r32 r32 +// MOVL m32 r32 +// MOVL imm32 m32 +// MOVL r32 m32 +func MOVL(imr, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imr) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "MOVL", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR32(imr) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "MOVL", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM32(imr) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "MOVL", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM32(imr) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "MOVL", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR32(imr) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "MOVL", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("MOVL: bad operands") +} + +// MOVLHPS: Move Packed Single-Precision Floating-Point Values Low to High. +// +// Forms: +// +// MOVLHPS xmm xmm +func MOVLHPS(x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "MOVLHPS", + Operands: []operand.Op{x, x1}, + Inputs: []operand.Op{x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("MOVLHPS: bad operands") +} + +// MOVLPD: Move Low Packed Double-Precision Floating-Point Value. +// +// Forms: +// +// MOVLPD m64 xmm +// MOVLPD xmm m64 +func MOVLPD(mx, mx1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM64(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVLPD", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx, mx1}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(mx) && operand.IsM64(mx1): + return &intrep.Instruction{ + Opcode: "MOVLPD", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MOVLPD: bad operands") +} + +// MOVLPS: Move Low Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MOVLPS m64 xmm +// MOVLPS xmm m64 +func MOVLPS(mx, mx1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM64(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVLPS", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx, mx1}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE"}, + }, nil + case operand.IsXMM(mx) && operand.IsM64(mx1): + return &intrep.Instruction{ + Opcode: "MOVLPS", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("MOVLPS: bad operands") +} + +// MOVLQSX: Move Doubleword to Quadword with Sign-Extension. +// +// Forms: +// +// MOVLQSX r32 r64 +// MOVLQSX m32 r64 +func MOVLQSX(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "MOVLQSX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsM32(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "MOVLQSX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("MOVLQSX: bad operands") +} + +// MOVLQZX: Move with Zero-Extend. +// +// Forms: +// +// MOVLQZX m32 r64 +func MOVLQZX(m, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM32(m) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "MOVLQZX", + Operands: []operand.Op{m, r}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("MOVLQZX: bad operands") +} + +// MOVMSKPD: Extract Packed Double-Precision Floating-Point Sign Mask. +// +// Forms: +// +// MOVMSKPD xmm r32 +func MOVMSKPD(x, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(x) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "MOVMSKPD", + Operands: []operand.Op{x, r}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MOVMSKPD: bad operands") +} + +// MOVMSKPS: Extract Packed Single-Precision Floating-Point Sign Mask. +// +// Forms: +// +// MOVMSKPS xmm r32 +func MOVMSKPS(x, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(x) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "MOVMSKPS", + Operands: []operand.Op{x, r}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("MOVMSKPS: bad operands") +} + +// MOVNTDQ: Store Double Quadword Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTDQ xmm m128 +func MOVNTDQ(x, m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(x) && operand.IsM128(m): + return &intrep.Instruction{ + Opcode: "MOVNTDQ", + Operands: []operand.Op{x, m}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{m}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MOVNTDQ: bad operands") +} + +// MOVNTDQA: Load Double Quadword Non-Temporal Aligned Hint. +// +// Forms: +// +// MOVNTDQA m128 xmm +func MOVNTDQA(m, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM128(m) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MOVNTDQA", + Operands: []operand.Op{m, x}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("MOVNTDQA: bad operands") +} + +// MOVNTIL: Store Doubleword Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTIL r32 m32 +func MOVNTIL(r, m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(r) && operand.IsM32(m): + return &intrep.Instruction{ + Opcode: "MOVNTIL", + Operands: []operand.Op{r, m}, + Inputs: []operand.Op{r}, + Outputs: []operand.Op{m}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MOVNTIL: bad operands") +} + +// MOVNTIQ: Store Doubleword Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTIQ r64 m64 +func MOVNTIQ(r, m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(r) && operand.IsM64(m): + return &intrep.Instruction{ + Opcode: "MOVNTIQ", + Operands: []operand.Op{r, m}, + Inputs: []operand.Op{r}, + Outputs: []operand.Op{m}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MOVNTIQ: bad operands") +} + +// MOVNTO: Store Double Quadword Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTO xmm m128 +func MOVNTO(x, m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(x) && operand.IsM128(m): + return &intrep.Instruction{ + Opcode: "MOVNTO", + Operands: []operand.Op{x, m}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{m}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MOVNTO: bad operands") +} + +// MOVNTPD: Store Packed Double-Precision Floating-Point Values Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTPD xmm m128 +func MOVNTPD(x, m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(x) && operand.IsM128(m): + return &intrep.Instruction{ + Opcode: "MOVNTPD", + Operands: []operand.Op{x, m}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{m}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MOVNTPD: bad operands") +} + +// MOVNTPS: Store Packed Single-Precision Floating-Point Values Using Non-Temporal Hint. +// +// Forms: +// +// MOVNTPS xmm m128 +func MOVNTPS(x, m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(x) && operand.IsM128(m): + return &intrep.Instruction{ + Opcode: "MOVNTPS", + Operands: []operand.Op{x, m}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{m}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("MOVNTPS: bad operands") +} + +// MOVO: Move Aligned Double Quadword. +// +// Forms: +// +// MOVO xmm xmm +// MOVO m128 xmm +// MOVO xmm m128 +func MOVO(mx, mx1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVO", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVO", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(mx) && operand.IsM128(mx1): + return &intrep.Instruction{ + Opcode: "MOVO", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MOVO: bad operands") +} + +// MOVOA: Move Aligned Double Quadword. +// +// Forms: +// +// MOVOA xmm xmm +// MOVOA m128 xmm +// MOVOA xmm m128 +func MOVOA(mx, mx1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVOA", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVOA", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(mx) && operand.IsM128(mx1): + return &intrep.Instruction{ + Opcode: "MOVOA", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MOVOA: bad operands") +} + +// MOVOU: Move Unaligned Double Quadword. +// +// Forms: +// +// MOVOU xmm xmm +// MOVOU m128 xmm +// MOVOU xmm m128 +func MOVOU(mx, mx1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVOU", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVOU", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(mx) && operand.IsM128(mx1): + return &intrep.Instruction{ + Opcode: "MOVOU", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MOVOU: bad operands") +} + +// MOVQ: Move. +// +// Forms: +// +// MOVQ imm32 r64 +// MOVQ imm64 r64 +// MOVQ r64 r64 +// MOVQ m64 r64 +// MOVQ imm32 m64 +// MOVQ r64 m64 +// MOVQ xmm r64 +// MOVQ r64 xmm +// MOVQ xmm xmm +// MOVQ m64 xmm +// MOVQ xmm m64 +// MOVQ xmm r32 +// MOVQ r32 xmm +// MOVQ m32 xmm +// MOVQ xmm m32 +func MOVQ(imrx, mrx operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imrx) && operand.IsR64(mrx): + return &intrep.Instruction{ + Opcode: "MOVQ", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsIMM64(imrx) && operand.IsR64(mrx): + return &intrep.Instruction{ + Opcode: "MOVQ", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsR64(imrx) && operand.IsR64(mrx): + return &intrep.Instruction{ + Opcode: "MOVQ", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsM64(imrx) && operand.IsR64(mrx): + return &intrep.Instruction{ + Opcode: "MOVQ", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsIMM32(imrx) && operand.IsM64(mrx): + return &intrep.Instruction{ + Opcode: "MOVQ", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsR64(imrx) && operand.IsM64(mrx): + return &intrep.Instruction{ + Opcode: "MOVQ", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + }, nil + case operand.IsXMM(imrx) && operand.IsR64(mrx): + return &intrep.Instruction{ + Opcode: "MOVQ", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsR64(imrx) && operand.IsXMM(mrx): + return &intrep.Instruction{ + Opcode: "MOVQ", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imrx) && operand.IsXMM(mrx): + return &intrep.Instruction{ + Opcode: "MOVQ", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(imrx) && operand.IsXMM(mrx): + return &intrep.Instruction{ + Opcode: "MOVQ", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imrx) && operand.IsM64(mrx): + return &intrep.Instruction{ + Opcode: "MOVQ", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imrx) && operand.IsR32(mrx): + return &intrep.Instruction{ + Opcode: "MOVQ", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsR32(imrx) && operand.IsXMM(mrx): + return &intrep.Instruction{ + Opcode: "MOVQ", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM32(imrx) && operand.IsXMM(mrx): + return &intrep.Instruction{ + Opcode: "MOVQ", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imrx) && operand.IsM32(mrx): + return &intrep.Instruction{ + Opcode: "MOVQ", + Operands: []operand.Op{imrx, mrx}, + Inputs: []operand.Op{imrx}, + Outputs: []operand.Op{mrx}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MOVQ: bad operands") +} + +// MOVSD: Move Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// MOVSD xmm xmm +// MOVSD m64 xmm +// MOVSD xmm m64 +func MOVSD(mx, mx1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVSD", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx, mx1}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVSD", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(mx) && operand.IsM64(mx1): + return &intrep.Instruction{ + Opcode: "MOVSD", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MOVSD: bad operands") +} + +// MOVSHDUP: Move Packed Single-FP High and Duplicate. +// +// Forms: +// +// MOVSHDUP xmm xmm +// MOVSHDUP m128 xmm +func MOVSHDUP(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MOVSHDUP", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MOVSHDUP", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + } + return nil, errors.New("MOVSHDUP: bad operands") +} + +// MOVSLDUP: Move Packed Single-FP Low and Duplicate. +// +// Forms: +// +// MOVSLDUP xmm xmm +// MOVSLDUP m128 xmm +func MOVSLDUP(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MOVSLDUP", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MOVSLDUP", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE3"}, + }, nil + } + return nil, errors.New("MOVSLDUP: bad operands") +} + +// MOVSS: Move Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// MOVSS xmm xmm +// MOVSS m32 xmm +// MOVSS xmm m32 +func MOVSS(mx, mx1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVSS", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx, mx1}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVSS", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE"}, + }, nil + case operand.IsXMM(mx) && operand.IsM32(mx1): + return &intrep.Instruction{ + Opcode: "MOVSS", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("MOVSS: bad operands") +} + +// MOVUPD: Move Unaligned Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// MOVUPD xmm xmm +// MOVUPD m128 xmm +// MOVUPD xmm m128 +func MOVUPD(mx, mx1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVUPD", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVUPD", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(mx) && operand.IsM128(mx1): + return &intrep.Instruction{ + Opcode: "MOVUPD", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MOVUPD: bad operands") +} + +// MOVUPS: Move Unaligned Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MOVUPS xmm xmm +// MOVUPS m128 xmm +// MOVUPS xmm m128 +func MOVUPS(mx, mx1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVUPS", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(mx1): + return &intrep.Instruction{ + Opcode: "MOVUPS", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE"}, + }, nil + case operand.IsXMM(mx) && operand.IsM128(mx1): + return &intrep.Instruction{ + Opcode: "MOVUPS", + Operands: []operand.Op{mx, mx1}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{mx1}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("MOVUPS: bad operands") +} + +// MOVW: Move. +// +// Forms: +// +// MOVW imm16 r16 +// MOVW r16 r16 +// MOVW m16 r16 +// MOVW imm16 m16 +// MOVW r16 m16 +func MOVW(imr, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM16(imr) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "MOVW", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR16(imr) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "MOVW", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM16(imr) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "MOVW", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM16(imr) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "MOVW", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR16(imr) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "MOVW", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("MOVW: bad operands") +} + +// MOVWLSX: Move with Sign-Extension. +// +// Forms: +// +// MOVWLSX r16 r32 +// MOVWLSX m16 r32 +func MOVWLSX(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "MOVWLSX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsM16(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "MOVWLSX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("MOVWLSX: bad operands") +} + +// MOVWLZX: Move with Zero-Extend. +// +// Forms: +// +// MOVWLZX r16 r32 +// MOVWLZX m16 r32 +func MOVWLZX(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "MOVWLZX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsM16(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "MOVWLZX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("MOVWLZX: bad operands") +} + +// MOVWQSX: Move with Sign-Extension. +// +// Forms: +// +// MOVWQSX r16 r64 +// MOVWQSX m16 r64 +func MOVWQSX(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "MOVWQSX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsM16(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "MOVWQSX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("MOVWQSX: bad operands") +} + +// MOVWQZX: Move with Zero-Extend. +// +// Forms: +// +// MOVWQZX r16 r64 +// MOVWQZX m16 r64 +func MOVWQZX(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "MOVWQZX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + case operand.IsM16(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "MOVWQZX", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + }, nil + } + return nil, errors.New("MOVWQZX: bad operands") +} + +// MPSADBW: Compute Multiple Packed Sums of Absolute Difference. +// +// Forms: +// +// MPSADBW imm8 xmm xmm +// MPSADBW imm8 m128 xmm +func MPSADBW(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MPSADBW", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MPSADBW", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("MPSADBW: bad operands") +} + +// MULB: Unsigned Multiply. +// +// Forms: +// +// MULB r8 +// MULB m8 +func MULB(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "MULB", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.AL}, + Outputs: []operand.Op{reg.AX}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "MULB", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.AL}, + Outputs: []operand.Op{reg.AX}, + }, nil + } + return nil, errors.New("MULB: bad operands") +} + +// MULL: Unsigned Multiply. +// +// Forms: +// +// MULL r32 +// MULL m32 +func MULL(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "MULL", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.EAX}, + Outputs: []operand.Op{reg.EAX, reg.EDX}, + }, nil + case operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "MULL", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.EAX}, + Outputs: []operand.Op{reg.EAX, reg.EDX}, + }, nil + } + return nil, errors.New("MULL: bad operands") +} + +// MULPD: Multiply Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// MULPD xmm xmm +// MULPD m128 xmm +func MULPD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MULPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MULPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MULPD: bad operands") +} + +// MULPS: Multiply Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// MULPS xmm xmm +// MULPS m128 xmm +func MULPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MULPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MULPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("MULPS: bad operands") +} + +// MULQ: Unsigned Multiply. +// +// Forms: +// +// MULQ r64 +// MULQ m64 +func MULQ(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "MULQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.RAX}, + Outputs: []operand.Op{reg.RAX, reg.RDX}, + }, nil + case operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "MULQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.RAX}, + Outputs: []operand.Op{reg.RAX, reg.RDX}, + }, nil + } + return nil, errors.New("MULQ: bad operands") +} + +// MULSD: Multiply Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// MULSD xmm xmm +// MULSD m64 xmm +func MULSD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MULSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MULSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("MULSD: bad operands") +} + +// MULSS: Multiply Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// MULSS xmm xmm +// MULSS m32 xmm +func MULSS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MULSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "MULSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("MULSS: bad operands") +} + +// MULW: Unsigned Multiply. +// +// Forms: +// +// MULW r16 +// MULW m16 +func MULW(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "MULW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.AX}, + Outputs: []operand.Op{reg.AX, reg.DX}, + }, nil + case operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "MULW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr, reg.AX}, + Outputs: []operand.Op{reg.AX, reg.DX}, + }, nil + } + return nil, errors.New("MULW: bad operands") +} + +// MULXL: Unsigned Multiply Without Affecting Flags. +// +// Forms: +// +// MULXL r32 r32 r32 +// MULXL m32 r32 r32 +func MULXL(mr, r, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "MULXL", + Operands: []operand.Op{mr, r, r1}, + Inputs: []operand.Op{mr, reg.EDX}, + Outputs: []operand.Op{r, r1}, + ISA: []string{"BMI2"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "MULXL", + Operands: []operand.Op{mr, r, r1}, + Inputs: []operand.Op{mr, reg.EDX}, + Outputs: []operand.Op{r, r1}, + ISA: []string{"BMI2"}, + }, nil + } + return nil, errors.New("MULXL: bad operands") +} + +// MULXQ: Unsigned Multiply Without Affecting Flags. +// +// Forms: +// +// MULXQ r64 r64 r64 +// MULXQ m64 r64 r64 +func MULXQ(mr, r, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "MULXQ", + Operands: []operand.Op{mr, r, r1}, + Inputs: []operand.Op{mr, reg.RDX}, + Outputs: []operand.Op{r, r1}, + ISA: []string{"BMI2"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "MULXQ", + Operands: []operand.Op{mr, r, r1}, + Inputs: []operand.Op{mr, reg.RDX}, + Outputs: []operand.Op{r, r1}, + ISA: []string{"BMI2"}, + }, nil + } + return nil, errors.New("MULXQ: bad operands") +} + +// MWAIT: Monitor Wait. +// +// Forms: +// +// MWAIT +func MWAIT() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "MWAIT", + Operands: nil, + Inputs: []operand.Op{reg.EAX, reg.ECX}, + Outputs: []operand.Op{}, + ISA: []string{"MONITOR"}, + }, nil +} + +// NEGB: Two's Complement Negation. +// +// Forms: +// +// NEGB r8 +// NEGB m8 +func NEGB(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "NEGB", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "NEGB", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("NEGB: bad operands") +} + +// NEGL: Two's Complement Negation. +// +// Forms: +// +// NEGL r32 +// NEGL m32 +func NEGL(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "NEGL", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "NEGL", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("NEGL: bad operands") +} + +// NEGQ: Two's Complement Negation. +// +// Forms: +// +// NEGQ r64 +// NEGQ m64 +func NEGQ(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "NEGQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "NEGQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("NEGQ: bad operands") +} + +// NEGW: Two's Complement Negation. +// +// Forms: +// +// NEGW r16 +// NEGW m16 +func NEGW(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "NEGW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "NEGW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("NEGW: bad operands") +} + +// NOP: No Operation. +// +// Forms: +// +// NOP +func NOP() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "NOP", + Operands: nil, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + }, nil +} + +// NOTB: One's Complement Negation. +// +// Forms: +// +// NOTB r8 +// NOTB m8 +func NOTB(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "NOTB", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "NOTB", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("NOTB: bad operands") +} + +// NOTL: One's Complement Negation. +// +// Forms: +// +// NOTL r32 +// NOTL m32 +func NOTL(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "NOTL", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "NOTL", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("NOTL: bad operands") +} + +// NOTQ: One's Complement Negation. +// +// Forms: +// +// NOTQ r64 +// NOTQ m64 +func NOTQ(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "NOTQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "NOTQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("NOTQ: bad operands") +} + +// NOTW: One's Complement Negation. +// +// Forms: +// +// NOTW r16 +// NOTW m16 +func NOTW(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "NOTW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "NOTW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("NOTW: bad operands") +} + +// ORB: Logical Inclusive OR. +// +// Forms: +// +// ORB imm8 al +// ORB imm8 r8 +// ORB r8 r8 +// ORB m8 r8 +// ORB imm8 m8 +// ORB r8 m8 +func ORB(imr, amr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imr) && operand.IsAL(amr): + return &intrep.Instruction{ + Opcode: "ORB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "ORB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "ORB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsM8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "ORB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM8(amr): + return &intrep.Instruction{ + Opcode: "ORB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR8(imr) && operand.IsM8(amr): + return &intrep.Instruction{ + Opcode: "ORB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + } + return nil, errors.New("ORB: bad operands") +} + +// ORL: Logical Inclusive OR. +// +// Forms: +// +// ORL imm32 eax +// ORL imm8 r32 +// ORL imm32 r32 +// ORL r32 r32 +// ORL m32 r32 +// ORL imm8 m32 +// ORL imm32 m32 +// ORL r32 m32 +func ORL(imr, emr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imr) && operand.IsEAX(emr): + return &intrep.Instruction{ + Opcode: "ORL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "ORL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "ORL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsR32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "ORL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsM32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "ORL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "ORL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM32(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "ORL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsR32(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "ORL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + } + return nil, errors.New("ORL: bad operands") +} + +// ORPD: Bitwise Logical OR of Double-Precision Floating-Point Values. +// +// Forms: +// +// ORPD xmm xmm +// ORPD m128 xmm +func ORPD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ORPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ORPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("ORPD: bad operands") +} + +// ORPS: Bitwise Logical OR of Single-Precision Floating-Point Values. +// +// Forms: +// +// ORPS xmm xmm +// ORPS m128 xmm +func ORPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ORPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ORPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("ORPS: bad operands") +} + +// ORQ: Logical Inclusive OR. +// +// Forms: +// +// ORQ imm32 rax +// ORQ imm8 r64 +// ORQ imm32 r64 +// ORQ r64 r64 +// ORQ m64 r64 +// ORQ imm8 m64 +// ORQ imm32 m64 +// ORQ r64 m64 +func ORQ(imr, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imr) && operand.IsRAX(mr): + return &intrep.Instruction{ + Opcode: "ORQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ORQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM32(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ORQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ORQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM64(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ORQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "ORQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM32(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "ORQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "ORQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("ORQ: bad operands") +} + +// ORW: Logical Inclusive OR. +// +// Forms: +// +// ORW imm16 ax +// ORW imm8 r16 +// ORW imm16 r16 +// ORW r16 r16 +// ORW m16 r16 +// ORW imm8 m16 +// ORW imm16 m16 +// ORW r16 m16 +func ORW(imr, amr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM16(imr) && operand.IsAX(amr): + return &intrep.Instruction{ + Opcode: "ORW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "ORW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "ORW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "ORW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsM16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "ORW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "ORW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM16(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "ORW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR16(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "ORW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + } + return nil, errors.New("ORW: bad operands") +} + +// PABSB: Packed Absolute Value of Byte Integers. +// +// Forms: +// +// PABSB xmm xmm +// PABSB m128 xmm +func PABSB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PABSB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PABSB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + } + return nil, errors.New("PABSB: bad operands") +} + +// PABSD: Packed Absolute Value of Doubleword Integers. +// +// Forms: +// +// PABSD xmm xmm +// PABSD m128 xmm +func PABSD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PABSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PABSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + } + return nil, errors.New("PABSD: bad operands") +} + +// PABSW: Packed Absolute Value of Word Integers. +// +// Forms: +// +// PABSW xmm xmm +// PABSW m128 xmm +func PABSW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PABSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PABSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + } + return nil, errors.New("PABSW: bad operands") +} + +// PACKSSLW: Pack Doublewords into Words with Signed Saturation. +// +// Forms: +// +// PACKSSLW xmm xmm +// PACKSSLW m128 xmm +func PACKSSLW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PACKSSLW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PACKSSLW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PACKSSLW: bad operands") +} + +// PACKSSWB: Pack Words into Bytes with Signed Saturation. +// +// Forms: +// +// PACKSSWB xmm xmm +// PACKSSWB m128 xmm +func PACKSSWB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PACKSSWB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PACKSSWB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PACKSSWB: bad operands") +} + +// PACKUSDW: Pack Doublewords into Words with Unsigned Saturation. +// +// Forms: +// +// PACKUSDW xmm xmm +// PACKUSDW m128 xmm +func PACKUSDW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PACKUSDW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PACKUSDW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PACKUSDW: bad operands") +} + +// PACKUSWB: Pack Words into Bytes with Unsigned Saturation. +// +// Forms: +// +// PACKUSWB xmm xmm +// PACKUSWB m128 xmm +func PACKUSWB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PACKUSWB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PACKUSWB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PACKUSWB: bad operands") +} + +// PADDB: Add Packed Byte Integers. +// +// Forms: +// +// PADDB xmm xmm +// PADDB m128 xmm +func PADDB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PADDB: bad operands") +} + +// PADDD: Add Packed Doubleword Integers. +// +// Forms: +// +// PADDD xmm xmm +// PADDD m128 xmm +func PADDD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PADDD: bad operands") +} + +// PADDL: Add Packed Doubleword Integers. +// +// Forms: +// +// PADDL xmm xmm +// PADDL m128 xmm +func PADDL(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PADDL: bad operands") +} + +// PADDQ: Add Packed Quadword Integers. +// +// Forms: +// +// PADDQ xmm xmm +// PADDQ m128 xmm +func PADDQ(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PADDQ: bad operands") +} + +// PADDSB: Add Packed Signed Byte Integers with Signed Saturation. +// +// Forms: +// +// PADDSB xmm xmm +// PADDSB m128 xmm +func PADDSB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDSB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDSB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PADDSB: bad operands") +} + +// PADDSW: Add Packed Signed Word Integers with Signed Saturation. +// +// Forms: +// +// PADDSW xmm xmm +// PADDSW m128 xmm +func PADDSW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PADDSW: bad operands") +} + +// PADDUSB: Add Packed Unsigned Byte Integers with Unsigned Saturation. +// +// Forms: +// +// PADDUSB xmm xmm +// PADDUSB m128 xmm +func PADDUSB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDUSB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDUSB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PADDUSB: bad operands") +} + +// PADDUSW: Add Packed Unsigned Word Integers with Unsigned Saturation. +// +// Forms: +// +// PADDUSW xmm xmm +// PADDUSW m128 xmm +func PADDUSW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDUSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDUSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PADDUSW: bad operands") +} + +// PADDW: Add Packed Word Integers. +// +// Forms: +// +// PADDW xmm xmm +// PADDW m128 xmm +func PADDW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PADDW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PADDW: bad operands") +} + +// PALIGNR: Packed Align Right. +// +// Forms: +// +// PALIGNR imm8 xmm xmm +// PALIGNR imm8 m128 xmm +func PALIGNR(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PALIGNR", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PALIGNR", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + } + return nil, errors.New("PALIGNR: bad operands") +} + +// PAND: Packed Bitwise Logical AND. +// +// Forms: +// +// PAND xmm xmm +// PAND m128 xmm +func PAND(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PAND", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PAND", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PAND: bad operands") +} + +// PANDN: Packed Bitwise Logical AND NOT. +// +// Forms: +// +// PANDN xmm xmm +// PANDN m128 xmm +func PANDN(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PANDN", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PANDN", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PANDN: bad operands") +} + +// PAUSE: Spin Loop Hint. +// +// Forms: +// +// PAUSE +func PAUSE() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "PAUSE", + Operands: nil, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + }, nil +} + +// PAVGB: Average Packed Byte Integers. +// +// Forms: +// +// PAVGB xmm xmm +// PAVGB m128 xmm +func PAVGB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PAVGB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PAVGB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PAVGB: bad operands") +} + +// PAVGW: Average Packed Word Integers. +// +// Forms: +// +// PAVGW xmm xmm +// PAVGW m128 xmm +func PAVGW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PAVGW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PAVGW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PAVGW: bad operands") +} + +// PBLENDVB: Variable Blend Packed Bytes. +// +// Forms: +// +// PBLENDVB xmm0 xmm xmm +// PBLENDVB xmm0 m128 xmm +func PBLENDVB(x, mx, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM0(x) && operand.IsXMM(mx) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "PBLENDVB", + Operands: []operand.Op{x, mx, x1}, + Inputs: []operand.Op{x, mx, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsXMM0(x) && operand.IsM128(mx) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "PBLENDVB", + Operands: []operand.Op{x, mx, x1}, + Inputs: []operand.Op{x, mx, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PBLENDVB: bad operands") +} + +// PBLENDW: Blend Packed Words. +// +// Forms: +// +// PBLENDW imm8 xmm xmm +// PBLENDW imm8 m128 xmm +func PBLENDW(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PBLENDW", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PBLENDW", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PBLENDW: bad operands") +} + +// PCLMULQDQ: Carry-Less Quadword Multiplication. +// +// Forms: +// +// PCLMULQDQ imm8 xmm xmm +// PCLMULQDQ imm8 m128 xmm +func PCLMULQDQ(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCLMULQDQ", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"PCLMULQDQ"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCLMULQDQ", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"PCLMULQDQ"}, + }, nil + } + return nil, errors.New("PCLMULQDQ: bad operands") +} + +// PCMPEQB: Compare Packed Byte Data for Equality. +// +// Forms: +// +// PCMPEQB xmm xmm +// PCMPEQB m128 xmm +func PCMPEQB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPEQB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPEQB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PCMPEQB: bad operands") +} + +// PCMPEQL: Compare Packed Doubleword Data for Equality. +// +// Forms: +// +// PCMPEQL xmm xmm +// PCMPEQL m128 xmm +func PCMPEQL(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPEQL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPEQL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PCMPEQL: bad operands") +} + +// PCMPEQQ: Compare Packed Quadword Data for Equality. +// +// Forms: +// +// PCMPEQQ xmm xmm +// PCMPEQQ m128 xmm +func PCMPEQQ(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPEQQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPEQQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PCMPEQQ: bad operands") +} + +// PCMPEQW: Compare Packed Word Data for Equality. +// +// Forms: +// +// PCMPEQW xmm xmm +// PCMPEQW m128 xmm +func PCMPEQW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPEQW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPEQW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PCMPEQW: bad operands") +} + +// PCMPESTRI: Packed Compare Explicit Length Strings, Return Index. +// +// Forms: +// +// PCMPESTRI imm8 xmm xmm +// PCMPESTRI imm8 m128 xmm +func PCMPESTRI(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPESTRI", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x, reg.EAX, reg.EDX}, + Outputs: []operand.Op{reg.ECX}, + ISA: []string{"SSE4.2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPESTRI", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x, reg.EAX, reg.EDX}, + Outputs: []operand.Op{reg.ECX}, + ISA: []string{"SSE4.2"}, + }, nil + } + return nil, errors.New("PCMPESTRI: bad operands") +} + +// PCMPESTRM: Packed Compare Explicit Length Strings, Return Mask. +// +// Forms: +// +// PCMPESTRM imm8 xmm xmm +// PCMPESTRM imm8 m128 xmm +func PCMPESTRM(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPESTRM", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x, reg.EAX, reg.EDX}, + Outputs: []operand.Op{reg.X0}, + ISA: []string{"SSE4.2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPESTRM", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x, reg.EAX, reg.EDX}, + Outputs: []operand.Op{reg.X0}, + ISA: []string{"SSE4.2"}, + }, nil + } + return nil, errors.New("PCMPESTRM: bad operands") +} + +// PCMPGTB: Compare Packed Signed Byte Integers for Greater Than. +// +// Forms: +// +// PCMPGTB xmm xmm +// PCMPGTB m128 xmm +func PCMPGTB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPGTB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPGTB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PCMPGTB: bad operands") +} + +// PCMPGTL: Compare Packed Signed Doubleword Integers for Greater Than. +// +// Forms: +// +// PCMPGTL xmm xmm +// PCMPGTL m128 xmm +func PCMPGTL(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPGTL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPGTL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PCMPGTL: bad operands") +} + +// PCMPGTQ: Compare Packed Data for Greater Than. +// +// Forms: +// +// PCMPGTQ xmm xmm +// PCMPGTQ m128 xmm +func PCMPGTQ(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPGTQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPGTQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.2"}, + }, nil + } + return nil, errors.New("PCMPGTQ: bad operands") +} + +// PCMPGTW: Compare Packed Signed Word Integers for Greater Than. +// +// Forms: +// +// PCMPGTW xmm xmm +// PCMPGTW m128 xmm +func PCMPGTW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPGTW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPGTW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PCMPGTW: bad operands") +} + +// PCMPISTRI: Packed Compare Implicit Length Strings, Return Index. +// +// Forms: +// +// PCMPISTRI imm8 xmm xmm +// PCMPISTRI imm8 m128 xmm +func PCMPISTRI(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPISTRI", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{reg.ECX}, + ISA: []string{"SSE4.2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPISTRI", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{reg.ECX}, + ISA: []string{"SSE4.2"}, + }, nil + } + return nil, errors.New("PCMPISTRI: bad operands") +} + +// PCMPISTRM: Packed Compare Implicit Length Strings, Return Mask. +// +// Forms: +// +// PCMPISTRM imm8 xmm xmm +// PCMPISTRM imm8 m128 xmm +func PCMPISTRM(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPISTRM", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{reg.X0}, + ISA: []string{"SSE4.2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PCMPISTRM", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{reg.X0}, + ISA: []string{"SSE4.2"}, + }, nil + } + return nil, errors.New("PCMPISTRM: bad operands") +} + +// PDEPL: Parallel Bits Deposit. +// +// Forms: +// +// PDEPL r32 r32 r32 +// PDEPL m32 r32 r32 +func PDEPL(mr, r, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "PDEPL", + Operands: []operand.Op{mr, r, r1}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "PDEPL", + Operands: []operand.Op{mr, r, r1}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + } + return nil, errors.New("PDEPL: bad operands") +} + +// PDEPQ: Parallel Bits Deposit. +// +// Forms: +// +// PDEPQ r64 r64 r64 +// PDEPQ m64 r64 r64 +func PDEPQ(mr, r, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "PDEPQ", + Operands: []operand.Op{mr, r, r1}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "PDEPQ", + Operands: []operand.Op{mr, r, r1}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + } + return nil, errors.New("PDEPQ: bad operands") +} + +// PEXTL: Parallel Bits Extract. +// +// Forms: +// +// PEXTL r32 r32 r32 +// PEXTL m32 r32 r32 +func PEXTL(mr, r, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "PEXTL", + Operands: []operand.Op{mr, r, r1}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "PEXTL", + Operands: []operand.Op{mr, r, r1}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + } + return nil, errors.New("PEXTL: bad operands") +} + +// PEXTQ: Parallel Bits Extract. +// +// Forms: +// +// PEXTQ r64 r64 r64 +// PEXTQ m64 r64 r64 +func PEXTQ(mr, r, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "PEXTQ", + Operands: []operand.Op{mr, r, r1}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "PEXTQ", + Operands: []operand.Op{mr, r, r1}, + Inputs: []operand.Op{mr, r}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + } + return nil, errors.New("PEXTQ: bad operands") +} + +// PEXTRB: Extract Byte. +// +// Forms: +// +// PEXTRB imm8 xmm r32 +// PEXTRB imm8 xmm m8 +func PEXTRB(i, x, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "PEXTRB", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "PEXTRB", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PEXTRB: bad operands") +} + +// PEXTRD: Extract Doubleword. +// +// Forms: +// +// PEXTRD imm8 xmm r32 +// PEXTRD imm8 xmm m32 +func PEXTRD(i, x, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "PEXTRD", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "PEXTRD", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PEXTRD: bad operands") +} + +// PEXTRQ: Extract Quadword. +// +// Forms: +// +// PEXTRQ imm8 xmm r64 +// PEXTRQ imm8 xmm m64 +func PEXTRQ(i, x, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "PEXTRQ", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "PEXTRQ", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PEXTRQ: bad operands") +} + +// PEXTRW: Extract Word. +// +// Forms: +// +// PEXTRW imm8 xmm r32 +// PEXTRW imm8 xmm m16 +func PEXTRW(i, x, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "PEXTRW", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "PEXTRW", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PEXTRW: bad operands") +} + +// PHADDD: Packed Horizontal Add Doubleword Integer. +// +// Forms: +// +// PHADDD xmm xmm +// PHADDD m128 xmm +func PHADDD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PHADDD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PHADDD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + } + return nil, errors.New("PHADDD: bad operands") +} + +// PHADDSW: Packed Horizontal Add Signed Word Integers with Signed Saturation. +// +// Forms: +// +// PHADDSW xmm xmm +// PHADDSW m128 xmm +func PHADDSW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PHADDSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PHADDSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + } + return nil, errors.New("PHADDSW: bad operands") +} + +// PHADDW: Packed Horizontal Add Word Integers. +// +// Forms: +// +// PHADDW xmm xmm +// PHADDW m128 xmm +func PHADDW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PHADDW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PHADDW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + } + return nil, errors.New("PHADDW: bad operands") +} + +// PHMINPOSUW: Packed Horizontal Minimum of Unsigned Word Integers. +// +// Forms: +// +// PHMINPOSUW xmm xmm +// PHMINPOSUW m128 xmm +func PHMINPOSUW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PHMINPOSUW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PHMINPOSUW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PHMINPOSUW: bad operands") +} + +// PHSUBD: Packed Horizontal Subtract Doubleword Integers. +// +// Forms: +// +// PHSUBD xmm xmm +// PHSUBD m128 xmm +func PHSUBD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PHSUBD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PHSUBD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + } + return nil, errors.New("PHSUBD: bad operands") +} + +// PHSUBSW: Packed Horizontal Subtract Signed Word Integers with Signed Saturation. +// +// Forms: +// +// PHSUBSW xmm xmm +// PHSUBSW m128 xmm +func PHSUBSW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PHSUBSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PHSUBSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + } + return nil, errors.New("PHSUBSW: bad operands") +} + +// PHSUBW: Packed Horizontal Subtract Word Integers. +// +// Forms: +// +// PHSUBW xmm xmm +// PHSUBW m128 xmm +func PHSUBW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PHSUBW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PHSUBW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + } + return nil, errors.New("PHSUBW: bad operands") +} + +// PINSRB: Insert Byte. +// +// Forms: +// +// PINSRB imm8 r32 xmm +// PINSRB imm8 m8 xmm +func PINSRB(i, mr, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsR32(mr) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PINSRB", + Operands: []operand.Op{i, mr, x}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsM8(mr) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PINSRB", + Operands: []operand.Op{i, mr, x}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PINSRB: bad operands") +} + +// PINSRD: Insert Doubleword. +// +// Forms: +// +// PINSRD imm8 r32 xmm +// PINSRD imm8 m32 xmm +func PINSRD(i, mr, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsR32(mr) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PINSRD", + Operands: []operand.Op{i, mr, x}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsM32(mr) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PINSRD", + Operands: []operand.Op{i, mr, x}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PINSRD: bad operands") +} + +// PINSRQ: Insert Quadword. +// +// Forms: +// +// PINSRQ imm8 r64 xmm +// PINSRQ imm8 m64 xmm +func PINSRQ(i, mr, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsR64(mr) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PINSRQ", + Operands: []operand.Op{i, mr, x}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsM64(mr) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PINSRQ", + Operands: []operand.Op{i, mr, x}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PINSRQ: bad operands") +} + +// PINSRW: Insert Word. +// +// Forms: +// +// PINSRW imm8 r32 xmm +// PINSRW imm8 m16 xmm +func PINSRW(i, mr, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsR32(mr) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PINSRW", + Operands: []operand.Op{i, mr, x}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM16(mr) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PINSRW", + Operands: []operand.Op{i, mr, x}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PINSRW: bad operands") +} + +// PMADDUBSW: Multiply and Add Packed Signed and Unsigned Byte Integers. +// +// Forms: +// +// PMADDUBSW xmm xmm +// PMADDUBSW m128 xmm +func PMADDUBSW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMADDUBSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMADDUBSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + } + return nil, errors.New("PMADDUBSW: bad operands") +} + +// PMADDWL: Multiply and Add Packed Signed Word Integers. +// +// Forms: +// +// PMADDWL xmm xmm +// PMADDWL m128 xmm +func PMADDWL(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMADDWL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMADDWL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PMADDWL: bad operands") +} + +// PMAXSB: Maximum of Packed Signed Byte Integers. +// +// Forms: +// +// PMAXSB xmm xmm +// PMAXSB m128 xmm +func PMAXSB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMAXSB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMAXSB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMAXSB: bad operands") +} + +// PMAXSD: Maximum of Packed Signed Doubleword Integers. +// +// Forms: +// +// PMAXSD xmm xmm +// PMAXSD m128 xmm +func PMAXSD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMAXSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMAXSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMAXSD: bad operands") +} + +// PMAXSW: Maximum of Packed Signed Word Integers. +// +// Forms: +// +// PMAXSW xmm xmm +// PMAXSW m128 xmm +func PMAXSW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMAXSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMAXSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PMAXSW: bad operands") +} + +// PMAXUB: Maximum of Packed Unsigned Byte Integers. +// +// Forms: +// +// PMAXUB xmm xmm +// PMAXUB m128 xmm +func PMAXUB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMAXUB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMAXUB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PMAXUB: bad operands") +} + +// PMAXUD: Maximum of Packed Unsigned Doubleword Integers. +// +// Forms: +// +// PMAXUD xmm xmm +// PMAXUD m128 xmm +func PMAXUD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMAXUD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMAXUD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMAXUD: bad operands") +} + +// PMAXUW: Maximum of Packed Unsigned Word Integers. +// +// Forms: +// +// PMAXUW xmm xmm +// PMAXUW m128 xmm +func PMAXUW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMAXUW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMAXUW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMAXUW: bad operands") +} + +// PMINSB: Minimum of Packed Signed Byte Integers. +// +// Forms: +// +// PMINSB xmm xmm +// PMINSB m128 xmm +func PMINSB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMINSB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMINSB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMINSB: bad operands") +} + +// PMINSD: Minimum of Packed Signed Doubleword Integers. +// +// Forms: +// +// PMINSD xmm xmm +// PMINSD m128 xmm +func PMINSD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMINSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMINSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMINSD: bad operands") +} + +// PMINSW: Minimum of Packed Signed Word Integers. +// +// Forms: +// +// PMINSW xmm xmm +// PMINSW m128 xmm +func PMINSW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMINSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMINSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PMINSW: bad operands") +} + +// PMINUB: Minimum of Packed Unsigned Byte Integers. +// +// Forms: +// +// PMINUB xmm xmm +// PMINUB m128 xmm +func PMINUB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMINUB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMINUB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PMINUB: bad operands") +} + +// PMINUD: Minimum of Packed Unsigned Doubleword Integers. +// +// Forms: +// +// PMINUD xmm xmm +// PMINUD m128 xmm +func PMINUD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMINUD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMINUD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMINUD: bad operands") +} + +// PMINUW: Minimum of Packed Unsigned Word Integers. +// +// Forms: +// +// PMINUW xmm xmm +// PMINUW m128 xmm +func PMINUW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMINUW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMINUW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMINUW: bad operands") +} + +// PMOVMSKB: Move Byte Mask. +// +// Forms: +// +// PMOVMSKB xmm r32 +func PMOVMSKB(x, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(x) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "PMOVMSKB", + Operands: []operand.Op{x, r}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{r}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PMOVMSKB: bad operands") +} + +// PMOVSXBD: Move Packed Byte Integers to Doubleword Integers with Sign Extension. +// +// Forms: +// +// PMOVSXBD xmm xmm +// PMOVSXBD m32 xmm +func PMOVSXBD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVSXBD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVSXBD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMOVSXBD: bad operands") +} + +// PMOVSXBQ: Move Packed Byte Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// PMOVSXBQ xmm xmm +// PMOVSXBQ m16 xmm +func PMOVSXBQ(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVSXBQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM16(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVSXBQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMOVSXBQ: bad operands") +} + +// PMOVSXBW: Move Packed Byte Integers to Word Integers with Sign Extension. +// +// Forms: +// +// PMOVSXBW xmm xmm +// PMOVSXBW m64 xmm +func PMOVSXBW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVSXBW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVSXBW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMOVSXBW: bad operands") +} + +// PMOVSXDQ: Move Packed Doubleword Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// PMOVSXDQ xmm xmm +// PMOVSXDQ m64 xmm +func PMOVSXDQ(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVSXDQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVSXDQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMOVSXDQ: bad operands") +} + +// PMOVSXWD: Move Packed Word Integers to Doubleword Integers with Sign Extension. +// +// Forms: +// +// PMOVSXWD xmm xmm +// PMOVSXWD m64 xmm +func PMOVSXWD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVSXWD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVSXWD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMOVSXWD: bad operands") +} + +// PMOVSXWQ: Move Packed Word Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// PMOVSXWQ xmm xmm +// PMOVSXWQ m32 xmm +func PMOVSXWQ(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVSXWQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVSXWQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMOVSXWQ: bad operands") +} + +// PMOVZXBD: Move Packed Byte Integers to Doubleword Integers with Zero Extension. +// +// Forms: +// +// PMOVZXBD xmm xmm +// PMOVZXBD m32 xmm +func PMOVZXBD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVZXBD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVZXBD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMOVZXBD: bad operands") +} + +// PMOVZXBQ: Move Packed Byte Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// PMOVZXBQ xmm xmm +// PMOVZXBQ m16 xmm +func PMOVZXBQ(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVZXBQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM16(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVZXBQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMOVZXBQ: bad operands") +} + +// PMOVZXBW: Move Packed Byte Integers to Word Integers with Zero Extension. +// +// Forms: +// +// PMOVZXBW xmm xmm +// PMOVZXBW m64 xmm +func PMOVZXBW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVZXBW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVZXBW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMOVZXBW: bad operands") +} + +// PMOVZXDQ: Move Packed Doubleword Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// PMOVZXDQ xmm xmm +// PMOVZXDQ m64 xmm +func PMOVZXDQ(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVZXDQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVZXDQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMOVZXDQ: bad operands") +} + +// PMOVZXWD: Move Packed Word Integers to Doubleword Integers with Zero Extension. +// +// Forms: +// +// PMOVZXWD xmm xmm +// PMOVZXWD m64 xmm +func PMOVZXWD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVZXWD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVZXWD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMOVZXWD: bad operands") +} + +// PMOVZXWQ: Move Packed Word Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// PMOVZXWQ xmm xmm +// PMOVZXWQ m32 xmm +func PMOVZXWQ(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVZXWQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMOVZXWQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMOVZXWQ: bad operands") +} + +// PMULDQ: Multiply Packed Signed Doubleword Integers and Store Quadword Result. +// +// Forms: +// +// PMULDQ xmm xmm +// PMULDQ m128 xmm +func PMULDQ(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMULDQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMULDQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMULDQ: bad operands") +} + +// PMULHRSW: Packed Multiply Signed Word Integers and Store High Result with Round and Scale. +// +// Forms: +// +// PMULHRSW xmm xmm +// PMULHRSW m128 xmm +func PMULHRSW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMULHRSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMULHRSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + } + return nil, errors.New("PMULHRSW: bad operands") +} + +// PMULHUW: Multiply Packed Unsigned Word Integers and Store High Result. +// +// Forms: +// +// PMULHUW xmm xmm +// PMULHUW m128 xmm +func PMULHUW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMULHUW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMULHUW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PMULHUW: bad operands") +} + +// PMULHW: Multiply Packed Signed Word Integers and Store High Result. +// +// Forms: +// +// PMULHW xmm xmm +// PMULHW m128 xmm +func PMULHW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMULHW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMULHW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PMULHW: bad operands") +} + +// PMULLD: Multiply Packed Signed Doubleword Integers and Store Low Result. +// +// Forms: +// +// PMULLD xmm xmm +// PMULLD m128 xmm +func PMULLD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMULLD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMULLD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PMULLD: bad operands") +} + +// PMULLW: Multiply Packed Signed Word Integers and Store Low Result. +// +// Forms: +// +// PMULLW xmm xmm +// PMULLW m128 xmm +func PMULLW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMULLW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMULLW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PMULLW: bad operands") +} + +// PMULULQ: Multiply Packed Unsigned Doubleword Integers. +// +// Forms: +// +// PMULULQ xmm xmm +// PMULULQ m128 xmm +func PMULULQ(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMULULQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PMULULQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PMULULQ: bad operands") +} + +// POPCNTL: Count of Number of Bits Set to 1. +// +// Forms: +// +// POPCNTL r32 r32 +// POPCNTL m32 r32 +func POPCNTL(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "POPCNTL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"POPCNT"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "POPCNTL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"POPCNT"}, + }, nil + } + return nil, errors.New("POPCNTL: bad operands") +} + +// POPCNTQ: Count of Number of Bits Set to 1. +// +// Forms: +// +// POPCNTQ r64 r64 +// POPCNTQ m64 r64 +func POPCNTQ(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "POPCNTQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"POPCNT"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "POPCNTQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"POPCNT"}, + }, nil + } + return nil, errors.New("POPCNTQ: bad operands") +} + +// POPCNTW: Count of Number of Bits Set to 1. +// +// Forms: +// +// POPCNTW r16 r16 +// POPCNTW m16 r16 +func POPCNTW(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "POPCNTW", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"POPCNT"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "POPCNTW", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"POPCNT"}, + }, nil + } + return nil, errors.New("POPCNTW: bad operands") +} + +// POPQ: Pop a Value from the Stack. +// +// Forms: +// +// POPQ r64 +// POPQ m64 +func POPQ(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "POPQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "POPQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("POPQ: bad operands") +} + +// POPW: Pop a Value from the Stack. +// +// Forms: +// +// POPW r16 +// POPW m16 +func POPW(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "POPW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "POPW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("POPW: bad operands") +} + +// POR: Packed Bitwise Logical OR. +// +// Forms: +// +// POR xmm xmm +// POR m128 xmm +func POR(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "POR", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "POR", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("POR: bad operands") +} + +// PREFETCHNTA: Prefetch Data Into Caches using NTA Hint. +// +// Forms: +// +// PREFETCHNTA m8 +func PREFETCHNTA(m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM8(m): + return &intrep.Instruction{ + Opcode: "PREFETCHNTA", + Operands: []operand.Op{m}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{}, + ISA: []string{"MMX+"}, + }, nil + } + return nil, errors.New("PREFETCHNTA: bad operands") +} + +// PREFETCHT0: Prefetch Data Into Caches using T0 Hint. +// +// Forms: +// +// PREFETCHT0 m8 +func PREFETCHT0(m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM8(m): + return &intrep.Instruction{ + Opcode: "PREFETCHT0", + Operands: []operand.Op{m}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{}, + ISA: []string{"MMX+"}, + }, nil + } + return nil, errors.New("PREFETCHT0: bad operands") +} + +// PREFETCHT1: Prefetch Data Into Caches using T1 Hint. +// +// Forms: +// +// PREFETCHT1 m8 +func PREFETCHT1(m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM8(m): + return &intrep.Instruction{ + Opcode: "PREFETCHT1", + Operands: []operand.Op{m}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{}, + ISA: []string{"MMX+"}, + }, nil + } + return nil, errors.New("PREFETCHT1: bad operands") +} + +// PREFETCHT2: Prefetch Data Into Caches using T2 Hint. +// +// Forms: +// +// PREFETCHT2 m8 +func PREFETCHT2(m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM8(m): + return &intrep.Instruction{ + Opcode: "PREFETCHT2", + Operands: []operand.Op{m}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{}, + ISA: []string{"MMX+"}, + }, nil + } + return nil, errors.New("PREFETCHT2: bad operands") +} + +// PSADBW: Compute Sum of Absolute Differences. +// +// Forms: +// +// PSADBW xmm xmm +// PSADBW m128 xmm +func PSADBW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSADBW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSADBW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSADBW: bad operands") +} + +// PSHUFB: Packed Shuffle Bytes. +// +// Forms: +// +// PSHUFB xmm xmm +// PSHUFB m128 xmm +func PSHUFB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSHUFB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSHUFB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + } + return nil, errors.New("PSHUFB: bad operands") +} + +// PSHUFD: Shuffle Packed Doublewords. +// +// Forms: +// +// PSHUFD imm8 xmm xmm +// PSHUFD imm8 m128 xmm +func PSHUFD(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSHUFD", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSHUFD", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSHUFD: bad operands") +} + +// PSHUFHW: Shuffle Packed High Words. +// +// Forms: +// +// PSHUFHW imm8 xmm xmm +// PSHUFHW imm8 m128 xmm +func PSHUFHW(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSHUFHW", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSHUFHW", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSHUFHW: bad operands") +} + +// PSHUFL: Shuffle Packed Doublewords. +// +// Forms: +// +// PSHUFL imm8 xmm xmm +// PSHUFL imm8 m128 xmm +func PSHUFL(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSHUFL", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSHUFL", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSHUFL: bad operands") +} + +// PSHUFLW: Shuffle Packed Low Words. +// +// Forms: +// +// PSHUFLW imm8 xmm xmm +// PSHUFLW imm8 m128 xmm +func PSHUFLW(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSHUFLW", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSHUFLW", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSHUFLW: bad operands") +} + +// PSIGNB: Packed Sign of Byte Integers. +// +// Forms: +// +// PSIGNB xmm xmm +// PSIGNB m128 xmm +func PSIGNB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSIGNB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSIGNB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + } + return nil, errors.New("PSIGNB: bad operands") +} + +// PSIGND: Packed Sign of Doubleword Integers. +// +// Forms: +// +// PSIGND xmm xmm +// PSIGND m128 xmm +func PSIGND(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSIGND", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSIGND", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + } + return nil, errors.New("PSIGND: bad operands") +} + +// PSIGNW: Packed Sign of Word Integers. +// +// Forms: +// +// PSIGNW xmm xmm +// PSIGNW m128 xmm +func PSIGNW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSIGNW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSIGNW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSSE3"}, + }, nil + } + return nil, errors.New("PSIGNW: bad operands") +} + +// PSLLDQ: Shift Packed Double Quadword Left Logical. +// +// Forms: +// +// PSLLDQ imm8 xmm +func PSLLDQ(i, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSLLDQ", + Operands: []operand.Op{i, x}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSLLDQ: bad operands") +} + +// PSLLL: Shift Packed Doubleword Data Left Logical. +// +// Forms: +// +// PSLLL imm8 xmm +// PSLLL xmm xmm +// PSLLL m128 xmm +func PSLLL(imx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSLLL", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSLLL", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{imx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSLLL", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{imx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSLLL: bad operands") +} + +// PSLLO: Shift Packed Double Quadword Left Logical. +// +// Forms: +// +// PSLLO imm8 xmm +func PSLLO(i, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSLLO", + Operands: []operand.Op{i, x}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSLLO: bad operands") +} + +// PSLLQ: Shift Packed Quadword Data Left Logical. +// +// Forms: +// +// PSLLQ imm8 xmm +// PSLLQ xmm xmm +// PSLLQ m128 xmm +func PSLLQ(imx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSLLQ", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSLLQ", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{imx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSLLQ", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{imx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSLLQ: bad operands") +} + +// PSLLW: Shift Packed Word Data Left Logical. +// +// Forms: +// +// PSLLW imm8 xmm +// PSLLW xmm xmm +// PSLLW m128 xmm +func PSLLW(imx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSLLW", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSLLW", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{imx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSLLW", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{imx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSLLW: bad operands") +} + +// PSRAL: Shift Packed Doubleword Data Right Arithmetic. +// +// Forms: +// +// PSRAL imm8 xmm +// PSRAL xmm xmm +// PSRAL m128 xmm +func PSRAL(imx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSRAL", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSRAL", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{imx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSRAL", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{imx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSRAL: bad operands") +} + +// PSRAW: Shift Packed Word Data Right Arithmetic. +// +// Forms: +// +// PSRAW imm8 xmm +// PSRAW xmm xmm +// PSRAW m128 xmm +func PSRAW(imx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSRAW", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSRAW", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{imx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSRAW", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{imx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSRAW: bad operands") +} + +// PSRLDQ: Shift Packed Double Quadword Right Logical. +// +// Forms: +// +// PSRLDQ imm8 xmm +func PSRLDQ(i, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSRLDQ", + Operands: []operand.Op{i, x}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSRLDQ: bad operands") +} + +// PSRLL: Shift Packed Doubleword Data Right Logical. +// +// Forms: +// +// PSRLL imm8 xmm +// PSRLL xmm xmm +// PSRLL m128 xmm +func PSRLL(imx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSRLL", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSRLL", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{imx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSRLL", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{imx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSRLL: bad operands") +} + +// PSRLO: Shift Packed Double Quadword Right Logical. +// +// Forms: +// +// PSRLO imm8 xmm +func PSRLO(i, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSRLO", + Operands: []operand.Op{i, x}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSRLO: bad operands") +} + +// PSRLQ: Shift Packed Quadword Data Right Logical. +// +// Forms: +// +// PSRLQ imm8 xmm +// PSRLQ xmm xmm +// PSRLQ m128 xmm +func PSRLQ(imx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSRLQ", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSRLQ", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{imx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSRLQ", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{imx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSRLQ: bad operands") +} + +// PSRLW: Shift Packed Word Data Right Logical. +// +// Forms: +// +// PSRLW imm8 xmm +// PSRLW xmm xmm +// PSRLW m128 xmm +func PSRLW(imx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSRLW", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsXMM(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSRLW", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{imx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(imx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSRLW", + Operands: []operand.Op{imx, x}, + Inputs: []operand.Op{imx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSRLW: bad operands") +} + +// PSUBB: Subtract Packed Byte Integers. +// +// Forms: +// +// PSUBB xmm xmm +// PSUBB m128 xmm +func PSUBB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSUBB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSUBB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSUBB: bad operands") +} + +// PSUBL: Subtract Packed Doubleword Integers. +// +// Forms: +// +// PSUBL xmm xmm +// PSUBL m128 xmm +func PSUBL(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSUBL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSUBL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSUBL: bad operands") +} + +// PSUBQ: Subtract Packed Quadword Integers. +// +// Forms: +// +// PSUBQ xmm xmm +// PSUBQ m128 xmm +func PSUBQ(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSUBQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSUBQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSUBQ: bad operands") +} + +// PSUBSB: Subtract Packed Signed Byte Integers with Signed Saturation. +// +// Forms: +// +// PSUBSB xmm xmm +// PSUBSB m128 xmm +func PSUBSB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSUBSB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSUBSB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSUBSB: bad operands") +} + +// PSUBSW: Subtract Packed Signed Word Integers with Signed Saturation. +// +// Forms: +// +// PSUBSW xmm xmm +// PSUBSW m128 xmm +func PSUBSW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSUBSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSUBSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSUBSW: bad operands") +} + +// PSUBUSB: Subtract Packed Unsigned Byte Integers with Unsigned Saturation. +// +// Forms: +// +// PSUBUSB xmm xmm +// PSUBUSB m128 xmm +func PSUBUSB(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSUBUSB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSUBUSB", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSUBUSB: bad operands") +} + +// PSUBUSW: Subtract Packed Unsigned Word Integers with Unsigned Saturation. +// +// Forms: +// +// PSUBUSW xmm xmm +// PSUBUSW m128 xmm +func PSUBUSW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSUBUSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSUBUSW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSUBUSW: bad operands") +} + +// PSUBW: Subtract Packed Word Integers. +// +// Forms: +// +// PSUBW xmm xmm +// PSUBW m128 xmm +func PSUBW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSUBW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PSUBW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PSUBW: bad operands") +} + +// PTEST: Packed Logical Compare. +// +// Forms: +// +// PTEST xmm xmm +// PTEST m128 xmm +func PTEST(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PTEST", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PTEST", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("PTEST: bad operands") +} + +// PUNPCKHBW: Unpack and Interleave High-Order Bytes into Words. +// +// Forms: +// +// PUNPCKHBW xmm xmm +// PUNPCKHBW m128 xmm +func PUNPCKHBW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PUNPCKHBW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PUNPCKHBW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PUNPCKHBW: bad operands") +} + +// PUNPCKHLQ: Unpack and Interleave High-Order Doublewords into Quadwords. +// +// Forms: +// +// PUNPCKHLQ xmm xmm +// PUNPCKHLQ m128 xmm +func PUNPCKHLQ(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PUNPCKHLQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PUNPCKHLQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PUNPCKHLQ: bad operands") +} + +// PUNPCKHQDQ: Unpack and Interleave High-Order Quadwords into Double Quadwords. +// +// Forms: +// +// PUNPCKHQDQ xmm xmm +// PUNPCKHQDQ m128 xmm +func PUNPCKHQDQ(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PUNPCKHQDQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PUNPCKHQDQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PUNPCKHQDQ: bad operands") +} + +// PUNPCKHWL: Unpack and Interleave High-Order Words into Doublewords. +// +// Forms: +// +// PUNPCKHWL xmm xmm +// PUNPCKHWL m128 xmm +func PUNPCKHWL(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PUNPCKHWL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PUNPCKHWL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PUNPCKHWL: bad operands") +} + +// PUNPCKLBW: Unpack and Interleave Low-Order Bytes into Words. +// +// Forms: +// +// PUNPCKLBW xmm xmm +// PUNPCKLBW m128 xmm +func PUNPCKLBW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PUNPCKLBW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PUNPCKLBW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PUNPCKLBW: bad operands") +} + +// PUNPCKLLQ: Unpack and Interleave Low-Order Doublewords into Quadwords. +// +// Forms: +// +// PUNPCKLLQ xmm xmm +// PUNPCKLLQ m128 xmm +func PUNPCKLLQ(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PUNPCKLLQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PUNPCKLLQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PUNPCKLLQ: bad operands") +} + +// PUNPCKLQDQ: Unpack and Interleave Low-Order Quadwords into Double Quadwords. +// +// Forms: +// +// PUNPCKLQDQ xmm xmm +// PUNPCKLQDQ m128 xmm +func PUNPCKLQDQ(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PUNPCKLQDQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PUNPCKLQDQ", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PUNPCKLQDQ: bad operands") +} + +// PUNPCKLWL: Unpack and Interleave Low-Order Words into Doublewords. +// +// Forms: +// +// PUNPCKLWL xmm xmm +// PUNPCKLWL m128 xmm +func PUNPCKLWL(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PUNPCKLWL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PUNPCKLWL", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PUNPCKLWL: bad operands") +} + +// PUSHQ: Push Value Onto the Stack. +// +// Forms: +// +// PUSHQ imm8 +// PUSHQ imm32 +// PUSHQ r64 +// PUSHQ m64 +func PUSHQ(imr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imr): + return &intrep.Instruction{ + Opcode: "PUSHQ", + Operands: []operand.Op{imr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + }, nil + case operand.IsIMM32(imr): + return &intrep.Instruction{ + Opcode: "PUSHQ", + Operands: []operand.Op{imr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR64(imr): + return &intrep.Instruction{ + Opcode: "PUSHQ", + Operands: []operand.Op{imr}, + Inputs: []operand.Op{imr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsM64(imr): + return &intrep.Instruction{ + Opcode: "PUSHQ", + Operands: []operand.Op{imr}, + Inputs: []operand.Op{imr}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("PUSHQ: bad operands") +} + +// PUSHW: Push Value Onto the Stack. +// +// Forms: +// +// PUSHW r16 +// PUSHW m16 +func PUSHW(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "PUSHW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "PUSHW", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("PUSHW: bad operands") +} + +// PXOR: Packed Bitwise Logical Exclusive OR. +// +// Forms: +// +// PXOR xmm xmm +// PXOR m128 xmm +func PXOR(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PXOR", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "PXOR", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("PXOR: bad operands") +} + +// RCLB: Rotate Left through Carry Flag. +// +// Forms: +// +// RCLB 1 r8 +// RCLB imm8 r8 +// RCLB cl r8 +// RCLB 1 m8 +// RCLB imm8 m8 +// RCLB cl m8 +func RCLB(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "RCLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "RCLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "RCLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "RCLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "RCLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "RCLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("RCLB: bad operands") +} + +// RCLL: Rotate Left through Carry Flag. +// +// Forms: +// +// RCLL 1 r32 +// RCLL imm8 r32 +// RCLL cl r32 +// RCLL 1 m32 +// RCLL imm8 m32 +// RCLL cl m32 +func RCLL(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "RCLL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "RCLL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "RCLL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "RCLL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "RCLL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "RCLL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("RCLL: bad operands") +} + +// RCLQ: Rotate Left through Carry Flag. +// +// Forms: +// +// RCLQ 1 r64 +// RCLQ imm8 r64 +// RCLQ cl r64 +// RCLQ 1 m64 +// RCLQ imm8 m64 +// RCLQ cl m64 +func RCLQ(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "RCLQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "RCLQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "RCLQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "RCLQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "RCLQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "RCLQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("RCLQ: bad operands") +} + +// RCLW: Rotate Left through Carry Flag. +// +// Forms: +// +// RCLW 1 r16 +// RCLW imm8 r16 +// RCLW cl r16 +// RCLW 1 m16 +// RCLW imm8 m16 +// RCLW cl m16 +func RCLW(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "RCLW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "RCLW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "RCLW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "RCLW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "RCLW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "RCLW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("RCLW: bad operands") +} + +// RCPPS: Compute Approximate Reciprocals of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// RCPPS xmm xmm +// RCPPS m128 xmm +func RCPPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "RCPPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "RCPPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("RCPPS: bad operands") +} + +// RCPSS: Compute Approximate Reciprocal of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// RCPSS xmm xmm +// RCPSS m32 xmm +func RCPSS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "RCPSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "RCPSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("RCPSS: bad operands") +} + +// RCRB: Rotate Right through Carry Flag. +// +// Forms: +// +// RCRB 1 r8 +// RCRB imm8 r8 +// RCRB cl r8 +// RCRB 1 m8 +// RCRB imm8 m8 +// RCRB cl m8 +func RCRB(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "RCRB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "RCRB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "RCRB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "RCRB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "RCRB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "RCRB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("RCRB: bad operands") +} + +// RCRL: Rotate Right through Carry Flag. +// +// Forms: +// +// RCRL 1 r32 +// RCRL imm8 r32 +// RCRL cl r32 +// RCRL 1 m32 +// RCRL imm8 m32 +// RCRL cl m32 +func RCRL(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "RCRL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "RCRL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "RCRL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "RCRL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "RCRL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "RCRL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("RCRL: bad operands") +} + +// RCRQ: Rotate Right through Carry Flag. +// +// Forms: +// +// RCRQ 1 r64 +// RCRQ imm8 r64 +// RCRQ cl r64 +// RCRQ 1 m64 +// RCRQ imm8 m64 +// RCRQ cl m64 +func RCRQ(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "RCRQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "RCRQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "RCRQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "RCRQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "RCRQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "RCRQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("RCRQ: bad operands") +} + +// RCRW: Rotate Right through Carry Flag. +// +// Forms: +// +// RCRW 1 r16 +// RCRW imm8 r16 +// RCRW cl r16 +// RCRW 1 m16 +// RCRW imm8 m16 +// RCRW cl m16 +func RCRW(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "RCRW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "RCRW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "RCRW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "RCRW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "RCRW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "RCRW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("RCRW: bad operands") +} + +// RDRANDL: Read Random Number. +// +// Forms: +// +// RDRANDL r32 +func RDRANDL(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "RDRANDL", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{r}, + ISA: []string{"RDRAND"}, + }, nil + } + return nil, errors.New("RDRANDL: bad operands") +} + +// RDRANDQ: Read Random Number. +// +// Forms: +// +// RDRANDQ r64 +func RDRANDQ(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "RDRANDQ", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{r}, + ISA: []string{"RDRAND"}, + }, nil + } + return nil, errors.New("RDRANDQ: bad operands") +} + +// RDRANDW: Read Random Number. +// +// Forms: +// +// RDRANDW r16 +func RDRANDW(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "RDRANDW", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{r}, + ISA: []string{"RDRAND"}, + }, nil + } + return nil, errors.New("RDRANDW: bad operands") +} + +// RDSEEDL: Read Random SEED. +// +// Forms: +// +// RDSEEDL r32 +func RDSEEDL(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "RDSEEDL", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{r}, + ISA: []string{"RDSEED"}, + }, nil + } + return nil, errors.New("RDSEEDL: bad operands") +} + +// RDSEEDQ: Read Random SEED. +// +// Forms: +// +// RDSEEDQ r64 +func RDSEEDQ(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "RDSEEDQ", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{r}, + ISA: []string{"RDSEED"}, + }, nil + } + return nil, errors.New("RDSEEDQ: bad operands") +} + +// RDSEEDW: Read Random SEED. +// +// Forms: +// +// RDSEEDW r16 +func RDSEEDW(r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "RDSEEDW", + Operands: []operand.Op{r}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{r}, + ISA: []string{"RDSEED"}, + }, nil + } + return nil, errors.New("RDSEEDW: bad operands") +} + +// RDTSC: Read Time-Stamp Counter. +// +// Forms: +// +// RDTSC +func RDTSC() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "RDTSC", + Operands: nil, + Inputs: []operand.Op{}, + Outputs: []operand.Op{reg.EAX, reg.EDX}, + ISA: []string{"RDTSC"}, + }, nil +} + +// RDTSCP: Read Time-Stamp Counter and Processor ID. +// +// Forms: +// +// RDTSCP +func RDTSCP() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "RDTSCP", + Operands: nil, + Inputs: []operand.Op{}, + Outputs: []operand.Op{reg.EAX, reg.ECX, reg.EDX}, + ISA: []string{"RDTSCP"}, + }, nil +} + +// RET: Return from Procedure. +// +// Forms: +// +// RET +func RET() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "RET", + Operands: nil, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + IsTerminal: true, + }, nil +} + +// RETFL: Return from Procedure. +// +// Forms: +// +// RETFL imm16 +func RETFL(i operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM16(i): + return &intrep.Instruction{ + Opcode: "RETFL", + Operands: []operand.Op{i}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("RETFL: bad operands") +} + +// RETFQ: Return from Procedure. +// +// Forms: +// +// RETFQ imm16 +func RETFQ(i operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM16(i): + return &intrep.Instruction{ + Opcode: "RETFQ", + Operands: []operand.Op{i}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("RETFQ: bad operands") +} + +// RETFW: Return from Procedure. +// +// Forms: +// +// RETFW imm16 +func RETFW(i operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM16(i): + return &intrep.Instruction{ + Opcode: "RETFW", + Operands: []operand.Op{i}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("RETFW: bad operands") +} + +// ROLB: Rotate Left. +// +// Forms: +// +// ROLB 1 r8 +// ROLB imm8 r8 +// ROLB cl r8 +// ROLB 1 m8 +// ROLB imm8 m8 +// ROLB cl m8 +func ROLB(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "ROLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "ROLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "ROLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "ROLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "ROLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "ROLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("ROLB: bad operands") +} + +// ROLL: Rotate Left. +// +// Forms: +// +// ROLL 1 r32 +// ROLL imm8 r32 +// ROLL cl r32 +// ROLL 1 m32 +// ROLL imm8 m32 +// ROLL cl m32 +func ROLL(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "ROLL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "ROLL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "ROLL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "ROLL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "ROLL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "ROLL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("ROLL: bad operands") +} + +// ROLQ: Rotate Left. +// +// Forms: +// +// ROLQ 1 r64 +// ROLQ imm8 r64 +// ROLQ cl r64 +// ROLQ 1 m64 +// ROLQ imm8 m64 +// ROLQ cl m64 +func ROLQ(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ROLQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ROLQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "ROLQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "ROLQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "ROLQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "ROLQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("ROLQ: bad operands") +} + +// ROLW: Rotate Left. +// +// Forms: +// +// ROLW 1 r16 +// ROLW imm8 r16 +// ROLW cl r16 +// ROLW 1 m16 +// ROLW imm8 m16 +// ROLW cl m16 +func ROLW(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "ROLW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "ROLW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "ROLW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "ROLW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "ROLW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "ROLW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("ROLW: bad operands") +} + +// RORB: Rotate Right. +// +// Forms: +// +// RORB 1 r8 +// RORB imm8 r8 +// RORB cl r8 +// RORB 1 m8 +// RORB imm8 m8 +// RORB cl m8 +func RORB(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "RORB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "RORB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "RORB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "RORB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "RORB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "RORB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("RORB: bad operands") +} + +// RORL: Rotate Right. +// +// Forms: +// +// RORL 1 r32 +// RORL imm8 r32 +// RORL cl r32 +// RORL 1 m32 +// RORL imm8 m32 +// RORL cl m32 +func RORL(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "RORL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "RORL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "RORL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "RORL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "RORL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "RORL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("RORL: bad operands") +} + +// RORQ: Rotate Right. +// +// Forms: +// +// RORQ 1 r64 +// RORQ imm8 r64 +// RORQ cl r64 +// RORQ 1 m64 +// RORQ imm8 m64 +// RORQ cl m64 +func RORQ(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "RORQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "RORQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "RORQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "RORQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "RORQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "RORQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("RORQ: bad operands") +} + +// RORW: Rotate Right. +// +// Forms: +// +// RORW 1 r16 +// RORW imm8 r16 +// RORW cl r16 +// RORW 1 m16 +// RORW imm8 m16 +// RORW cl m16 +func RORW(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "RORW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "RORW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "RORW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "RORW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "RORW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "RORW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("RORW: bad operands") +} + +// RORXL: Rotate Right Logical Without Affecting Flags. +// +// Forms: +// +// RORXL imm8 r32 r32 +// RORXL imm8 m32 r32 +func RORXL(i, mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "RORXL", + Operands: []operand.Op{i, mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "RORXL", + Operands: []operand.Op{i, mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI2"}, + }, nil + } + return nil, errors.New("RORXL: bad operands") +} + +// RORXQ: Rotate Right Logical Without Affecting Flags. +// +// Forms: +// +// RORXQ imm8 r64 r64 +// RORXQ imm8 m64 r64 +func RORXQ(i, mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "RORXQ", + Operands: []operand.Op{i, mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "RORXQ", + Operands: []operand.Op{i, mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI2"}, + }, nil + } + return nil, errors.New("RORXQ: bad operands") +} + +// ROUNDPD: Round Packed Double Precision Floating-Point Values. +// +// Forms: +// +// ROUNDPD imm8 xmm xmm +// ROUNDPD imm8 m128 xmm +func ROUNDPD(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ROUNDPD", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ROUNDPD", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("ROUNDPD: bad operands") +} + +// ROUNDPS: Round Packed Single Precision Floating-Point Values. +// +// Forms: +// +// ROUNDPS imm8 xmm xmm +// ROUNDPS imm8 m128 xmm +func ROUNDPS(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ROUNDPS", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ROUNDPS", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("ROUNDPS: bad operands") +} + +// ROUNDSD: Round Scalar Double Precision Floating-Point Values. +// +// Forms: +// +// ROUNDSD imm8 xmm xmm +// ROUNDSD imm8 m64 xmm +func ROUNDSD(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ROUNDSD", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ROUNDSD", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("ROUNDSD: bad operands") +} + +// ROUNDSS: Round Scalar Single Precision Floating-Point Values. +// +// Forms: +// +// ROUNDSS imm8 xmm xmm +// ROUNDSS imm8 m32 xmm +func ROUNDSS(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ROUNDSS", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + case operand.IsIMM8(i) && operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "ROUNDSS", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE4.1"}, + }, nil + } + return nil, errors.New("ROUNDSS: bad operands") +} + +// RSQRTPS: Compute Reciprocals of Square Roots of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// RSQRTPS xmm xmm +// RSQRTPS m128 xmm +func RSQRTPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "RSQRTPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "RSQRTPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("RSQRTPS: bad operands") +} + +// RSQRTSS: Compute Reciprocal of Square Root of Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// RSQRTSS xmm xmm +// RSQRTSS m32 xmm +func RSQRTSS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "RSQRTSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "RSQRTSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("RSQRTSS: bad operands") +} + +// SALB: Arithmetic Shift Left. +// +// Forms: +// +// SALB 1 r8 +// SALB imm8 r8 +// SALB cl r8 +// SALB 1 m8 +// SALB imm8 m8 +// SALB cl m8 +func SALB(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SALB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SALB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SALB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SALB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SALB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SALB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SALB: bad operands") +} + +// SALL: Arithmetic Shift Left. +// +// Forms: +// +// SALL 1 r32 +// SALL imm8 r32 +// SALL cl r32 +// SALL 1 m32 +// SALL imm8 m32 +// SALL cl m32 +func SALL(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "SALL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "SALL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "SALL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "SALL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "SALL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "SALL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SALL: bad operands") +} + +// SALQ: Arithmetic Shift Left. +// +// Forms: +// +// SALQ 1 r64 +// SALQ imm8 r64 +// SALQ cl r64 +// SALQ 1 m64 +// SALQ imm8 m64 +// SALQ cl m64 +func SALQ(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "SALQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "SALQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "SALQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "SALQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "SALQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "SALQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SALQ: bad operands") +} + +// SALW: Arithmetic Shift Left. +// +// Forms: +// +// SALW 1 r16 +// SALW imm8 r16 +// SALW cl r16 +// SALW 1 m16 +// SALW imm8 m16 +// SALW cl m16 +func SALW(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "SALW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "SALW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "SALW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "SALW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "SALW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "SALW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SALW: bad operands") +} + +// SARB: Arithmetic Shift Right. +// +// Forms: +// +// SARB 1 r8 +// SARB imm8 r8 +// SARB cl r8 +// SARB 1 m8 +// SARB imm8 m8 +// SARB cl m8 +func SARB(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SARB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SARB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SARB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SARB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SARB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SARB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SARB: bad operands") +} + +// SARL: Arithmetic Shift Right. +// +// Forms: +// +// SARL 1 r32 +// SARL imm8 r32 +// SARL cl r32 +// SARL 1 m32 +// SARL imm8 m32 +// SARL cl m32 +func SARL(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "SARL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "SARL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "SARL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "SARL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "SARL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "SARL", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SARL: bad operands") +} + +// SARQ: Arithmetic Shift Right. +// +// Forms: +// +// SARQ 1 r64 +// SARQ imm8 r64 +// SARQ cl r64 +// SARQ 1 m64 +// SARQ imm8 m64 +// SARQ cl m64 +func SARQ(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "SARQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "SARQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "SARQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "SARQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "SARQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "SARQ", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SARQ: bad operands") +} + +// SARW: Arithmetic Shift Right. +// +// Forms: +// +// SARW 1 r16 +// SARW imm8 r16 +// SARW cl r16 +// SARW 1 m16 +// SARW imm8 m16 +// SARW cl m16 +func SARW(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "SARW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "SARW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "SARW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "SARW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "SARW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "SARW", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SARW: bad operands") +} + +// SARXL: Arithmetic Shift Right Without Affecting Flags. +// +// Forms: +// +// SARXL r32 r32 r32 +// SARXL r32 m32 r32 +func SARXL(r, mr, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(r) && operand.IsR32(mr) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "SARXL", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + case operand.IsR32(r) && operand.IsM32(mr) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "SARXL", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + } + return nil, errors.New("SARXL: bad operands") +} + +// SARXQ: Arithmetic Shift Right Without Affecting Flags. +// +// Forms: +// +// SARXQ r64 r64 r64 +// SARXQ r64 m64 r64 +func SARXQ(r, mr, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(r) && operand.IsR64(mr) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "SARXQ", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + case operand.IsR64(r) && operand.IsM64(mr) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "SARXQ", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + } + return nil, errors.New("SARXQ: bad operands") +} + +// SBBB: Subtract with Borrow. +// +// Forms: +// +// SBBB imm8 al +// SBBB imm8 r8 +// SBBB r8 r8 +// SBBB m8 r8 +// SBBB imm8 m8 +// SBBB r8 m8 +func SBBB(imr, amr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imr) && operand.IsAL(amr): + return &intrep.Instruction{ + Opcode: "SBBB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "SBBB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "SBBB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + CancellingInputs: true, + }, nil + case operand.IsM8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "SBBB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM8(amr): + return &intrep.Instruction{ + Opcode: "SBBB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR8(imr) && operand.IsM8(amr): + return &intrep.Instruction{ + Opcode: "SBBB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + } + return nil, errors.New("SBBB: bad operands") +} + +// SBBL: Subtract with Borrow. +// +// Forms: +// +// SBBL imm32 eax +// SBBL imm8 r32 +// SBBL imm32 r32 +// SBBL r32 r32 +// SBBL m32 r32 +// SBBL imm8 m32 +// SBBL imm32 m32 +// SBBL r32 m32 +func SBBL(imr, emr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imr) && operand.IsEAX(emr): + return &intrep.Instruction{ + Opcode: "SBBL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "SBBL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "SBBL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsR32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "SBBL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + CancellingInputs: true, + }, nil + case operand.IsM32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "SBBL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "SBBL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM32(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "SBBL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsR32(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "SBBL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + } + return nil, errors.New("SBBL: bad operands") +} + +// SBBQ: Subtract with Borrow. +// +// Forms: +// +// SBBQ imm32 rax +// SBBQ imm8 r64 +// SBBQ imm32 r64 +// SBBQ r64 r64 +// SBBQ m64 r64 +// SBBQ imm8 m64 +// SBBQ imm32 m64 +// SBBQ r64 m64 +func SBBQ(imr, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imr) && operand.IsRAX(mr): + return &intrep.Instruction{ + Opcode: "SBBQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "SBBQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM32(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "SBBQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "SBBQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + CancellingInputs: true, + }, nil + case operand.IsM64(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "SBBQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "SBBQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM32(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "SBBQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "SBBQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SBBQ: bad operands") +} + +// SBBW: Subtract with Borrow. +// +// Forms: +// +// SBBW imm16 ax +// SBBW imm8 r16 +// SBBW imm16 r16 +// SBBW r16 r16 +// SBBW m16 r16 +// SBBW imm8 m16 +// SBBW imm16 m16 +// SBBW r16 m16 +func SBBW(imr, amr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM16(imr) && operand.IsAX(amr): + return &intrep.Instruction{ + Opcode: "SBBW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "SBBW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "SBBW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "SBBW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + CancellingInputs: true, + }, nil + case operand.IsM16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "SBBW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "SBBW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM16(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "SBBW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR16(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "SBBW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + } + return nil, errors.New("SBBW: bad operands") +} + +// SETCC: Set byte if above or equal (CF == 0). +// +// Forms: +// +// SETCC r8 +// SETCC m8 +func SETCC(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SETCC", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SETCC", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SETCC: bad operands") +} + +// SETCS: Set byte if below (CF == 1). +// +// Forms: +// +// SETCS r8 +// SETCS m8 +func SETCS(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SETCS", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SETCS", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SETCS: bad operands") +} + +// SETEQ: Set byte if equal (ZF == 1). +// +// Forms: +// +// SETEQ r8 +// SETEQ m8 +func SETEQ(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SETEQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SETEQ", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SETEQ: bad operands") +} + +// SETGE: Set byte if greater or equal (SF == OF). +// +// Forms: +// +// SETGE r8 +// SETGE m8 +func SETGE(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SETGE", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SETGE", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SETGE: bad operands") +} + +// SETGT: Set byte if greater (ZF == 0 and SF == OF). +// +// Forms: +// +// SETGT r8 +// SETGT m8 +func SETGT(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SETGT", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SETGT", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SETGT: bad operands") +} + +// SETHI: Set byte if above (CF == 0 and ZF == 0). +// +// Forms: +// +// SETHI r8 +// SETHI m8 +func SETHI(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SETHI", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SETHI", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SETHI: bad operands") +} + +// SETLE: Set byte if less or equal (ZF == 1 or SF != OF). +// +// Forms: +// +// SETLE r8 +// SETLE m8 +func SETLE(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SETLE", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SETLE", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SETLE: bad operands") +} + +// SETLS: Set byte if below or equal (CF == 1 or ZF == 1). +// +// Forms: +// +// SETLS r8 +// SETLS m8 +func SETLS(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SETLS", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SETLS", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SETLS: bad operands") +} + +// SETLT: Set byte if less (SF != OF). +// +// Forms: +// +// SETLT r8 +// SETLT m8 +func SETLT(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SETLT", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SETLT", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SETLT: bad operands") +} + +// SETMI: Set byte if sign (SF == 1). +// +// Forms: +// +// SETMI r8 +// SETMI m8 +func SETMI(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SETMI", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SETMI", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SETMI: bad operands") +} + +// SETNE: Set byte if not equal (ZF == 0). +// +// Forms: +// +// SETNE r8 +// SETNE m8 +func SETNE(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SETNE", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SETNE", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SETNE: bad operands") +} + +// SETOC: Set byte if not overflow (OF == 0). +// +// Forms: +// +// SETOC r8 +// SETOC m8 +func SETOC(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SETOC", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SETOC", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SETOC: bad operands") +} + +// SETOS: Set byte if overflow (OF == 1). +// +// Forms: +// +// SETOS r8 +// SETOS m8 +func SETOS(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SETOS", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SETOS", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SETOS: bad operands") +} + +// SETPC: Set byte if not parity (PF == 0). +// +// Forms: +// +// SETPC r8 +// SETPC m8 +func SETPC(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SETPC", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SETPC", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SETPC: bad operands") +} + +// SETPL: Set byte if not sign (SF == 0). +// +// Forms: +// +// SETPL r8 +// SETPL m8 +func SETPL(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SETPL", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SETPL", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SETPL: bad operands") +} + +// SETPS: Set byte if parity (PF == 1). +// +// Forms: +// +// SETPS r8 +// SETPS m8 +func SETPS(mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SETPS", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SETPS", + Operands: []operand.Op{mr}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SETPS: bad operands") +} + +// SFENCE: Store Fence. +// +// Forms: +// +// SFENCE +func SFENCE() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "SFENCE", + Operands: nil, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + ISA: []string{"MMX+"}, + }, nil +} + +// SHA1MSG1: Perform an Intermediate Calculation for the Next Four SHA1 Message Doublewords. +// +// Forms: +// +// SHA1MSG1 xmm xmm +// SHA1MSG1 m128 xmm +func SHA1MSG1(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SHA1MSG1", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SHA"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SHA1MSG1", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SHA"}, + }, nil + } + return nil, errors.New("SHA1MSG1: bad operands") +} + +// SHA1MSG2: Perform a Final Calculation for the Next Four SHA1 Message Doublewords. +// +// Forms: +// +// SHA1MSG2 xmm xmm +// SHA1MSG2 m128 xmm +func SHA1MSG2(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SHA1MSG2", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SHA"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SHA1MSG2", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SHA"}, + }, nil + } + return nil, errors.New("SHA1MSG2: bad operands") +} + +// SHA1NEXTE: Calculate SHA1 State Variable E after Four Rounds. +// +// Forms: +// +// SHA1NEXTE xmm xmm +// SHA1NEXTE m128 xmm +func SHA1NEXTE(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SHA1NEXTE", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SHA"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SHA1NEXTE", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SHA"}, + }, nil + } + return nil, errors.New("SHA1NEXTE: bad operands") +} + +// SHA1RNDS4: Perform Four Rounds of SHA1 Operation. +// +// Forms: +// +// SHA1RNDS4 imm2u xmm xmm +// SHA1RNDS4 imm2u m128 xmm +func SHA1RNDS4(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM2U(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SHA1RNDS4", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SHA"}, + }, nil + case operand.IsIMM2U(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SHA1RNDS4", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SHA"}, + }, nil + } + return nil, errors.New("SHA1RNDS4: bad operands") +} + +// SHA256MSG1: Perform an Intermediate Calculation for the Next Four SHA256 Message Doublewords. +// +// Forms: +// +// SHA256MSG1 xmm xmm +// SHA256MSG1 m128 xmm +func SHA256MSG1(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SHA256MSG1", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SHA"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SHA256MSG1", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SHA"}, + }, nil + } + return nil, errors.New("SHA256MSG1: bad operands") +} + +// SHA256MSG2: Perform a Final Calculation for the Next Four SHA256 Message Doublewords. +// +// Forms: +// +// SHA256MSG2 xmm xmm +// SHA256MSG2 m128 xmm +func SHA256MSG2(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SHA256MSG2", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SHA"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SHA256MSG2", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SHA"}, + }, nil + } + return nil, errors.New("SHA256MSG2: bad operands") +} + +// SHA256RNDS2: Perform Two Rounds of SHA256 Operation. +// +// Forms: +// +// SHA256RNDS2 xmm0 xmm xmm +// SHA256RNDS2 xmm0 m128 xmm +func SHA256RNDS2(x, mx, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM0(x) && operand.IsXMM(mx) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "SHA256RNDS2", + Operands: []operand.Op{x, mx, x1}, + Inputs: []operand.Op{x, mx, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"SHA"}, + }, nil + case operand.IsXMM0(x) && operand.IsM128(mx) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "SHA256RNDS2", + Operands: []operand.Op{x, mx, x1}, + Inputs: []operand.Op{x, mx, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"SHA"}, + }, nil + } + return nil, errors.New("SHA256RNDS2: bad operands") +} + +// SHLB: Logical Shift Left. +// +// Forms: +// +// SHLB 1 r8 +// SHLB imm8 r8 +// SHLB cl r8 +// SHLB 1 m8 +// SHLB imm8 m8 +// SHLB cl m8 +func SHLB(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SHLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SHLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SHLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SHLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SHLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SHLB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SHLB: bad operands") +} + +// SHLL: Logical Shift Left. +// +// Forms: +// +// SHLL 1 r32 +// SHLL imm8 r32 +// SHLL cl r32 +// SHLL 1 m32 +// SHLL imm8 m32 +// SHLL cl m32 +// SHLL imm8 r32 r32 +// SHLL cl r32 r32 +// SHLL imm8 r32 m32 +// SHLL cl r32 m32 +func SHLL(ops ...operand.Op) (*intrep.Instruction, error) { + switch { + case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsR32(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLL", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsR32(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLL", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsR32(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLL", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsM32(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLL", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsM32(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLL", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsM32(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLL", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR32(ops[1]) && operand.IsR32(ops[2]): + return &intrep.Instruction{ + Opcode: "SHLL", + Operands: ops, + Inputs: []operand.Op{ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR32(ops[1]) && operand.IsR32(ops[2]): + return &intrep.Instruction{ + Opcode: "SHLL", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR32(ops[1]) && operand.IsM32(ops[2]): + return &intrep.Instruction{ + Opcode: "SHLL", + Operands: ops, + Inputs: []operand.Op{ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR32(ops[1]) && operand.IsM32(ops[2]): + return &intrep.Instruction{ + Opcode: "SHLL", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + } + return nil, errors.New("SHLL: bad operands") +} + +// SHLQ: Logical Shift Left. +// +// Forms: +// +// SHLQ 1 r64 +// SHLQ imm8 r64 +// SHLQ cl r64 +// SHLQ 1 m64 +// SHLQ imm8 m64 +// SHLQ cl m64 +// SHLQ imm8 r64 r64 +// SHLQ cl r64 r64 +// SHLQ imm8 r64 m64 +// SHLQ cl r64 m64 +func SHLQ(ops ...operand.Op) (*intrep.Instruction, error) { + switch { + case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsR64(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLQ", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsR64(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLQ", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsR64(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLQ", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsM64(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLQ", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsM64(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLQ", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsM64(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLQ", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR64(ops[1]) && operand.IsR64(ops[2]): + return &intrep.Instruction{ + Opcode: "SHLQ", + Operands: ops, + Inputs: []operand.Op{ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR64(ops[1]) && operand.IsR64(ops[2]): + return &intrep.Instruction{ + Opcode: "SHLQ", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR64(ops[1]) && operand.IsM64(ops[2]): + return &intrep.Instruction{ + Opcode: "SHLQ", + Operands: ops, + Inputs: []operand.Op{ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR64(ops[1]) && operand.IsM64(ops[2]): + return &intrep.Instruction{ + Opcode: "SHLQ", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + } + return nil, errors.New("SHLQ: bad operands") +} + +// SHLW: Logical Shift Left. +// +// Forms: +// +// SHLW 1 r16 +// SHLW imm8 r16 +// SHLW cl r16 +// SHLW 1 m16 +// SHLW imm8 m16 +// SHLW cl m16 +// SHLW imm8 r16 r16 +// SHLW cl r16 r16 +// SHLW imm8 r16 m16 +// SHLW cl r16 m16 +func SHLW(ops ...operand.Op) (*intrep.Instruction, error) { + switch { + case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsR16(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLW", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsR16(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLW", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsR16(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLW", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsM16(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLW", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsM16(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLW", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsM16(ops[1]): + return &intrep.Instruction{ + Opcode: "SHLW", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR16(ops[1]) && operand.IsR16(ops[2]): + return &intrep.Instruction{ + Opcode: "SHLW", + Operands: ops, + Inputs: []operand.Op{ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR16(ops[1]) && operand.IsR16(ops[2]): + return &intrep.Instruction{ + Opcode: "SHLW", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR16(ops[1]) && operand.IsM16(ops[2]): + return &intrep.Instruction{ + Opcode: "SHLW", + Operands: ops, + Inputs: []operand.Op{ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR16(ops[1]) && operand.IsM16(ops[2]): + return &intrep.Instruction{ + Opcode: "SHLW", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + } + return nil, errors.New("SHLW: bad operands") +} + +// SHLXL: Logical Shift Left Without Affecting Flags. +// +// Forms: +// +// SHLXL r32 r32 r32 +// SHLXL r32 m32 r32 +func SHLXL(r, mr, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(r) && operand.IsR32(mr) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "SHLXL", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + case operand.IsR32(r) && operand.IsM32(mr) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "SHLXL", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + } + return nil, errors.New("SHLXL: bad operands") +} + +// SHLXQ: Logical Shift Left Without Affecting Flags. +// +// Forms: +// +// SHLXQ r64 r64 r64 +// SHLXQ r64 m64 r64 +func SHLXQ(r, mr, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(r) && operand.IsR64(mr) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "SHLXQ", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + case operand.IsR64(r) && operand.IsM64(mr) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "SHLXQ", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + } + return nil, errors.New("SHLXQ: bad operands") +} + +// SHRB: Logical Shift Right. +// +// Forms: +// +// SHRB 1 r8 +// SHRB imm8 r8 +// SHRB cl r8 +// SHRB 1 m8 +// SHRB imm8 m8 +// SHRB cl m8 +func SHRB(ci, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.Is1(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SHRB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SHRB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "SHRB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.Is1(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SHRB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SHRB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsCL(ci) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "SHRB", + Operands: []operand.Op{ci, mr}, + Inputs: []operand.Op{ci, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SHRB: bad operands") +} + +// SHRL: Logical Shift Right. +// +// Forms: +// +// SHRL 1 r32 +// SHRL imm8 r32 +// SHRL cl r32 +// SHRL 1 m32 +// SHRL imm8 m32 +// SHRL cl m32 +// SHRL imm8 r32 r32 +// SHRL cl r32 r32 +// SHRL imm8 r32 m32 +// SHRL cl r32 m32 +func SHRL(ops ...operand.Op) (*intrep.Instruction, error) { + switch { + case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsR32(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRL", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsR32(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRL", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsR32(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRL", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsM32(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRL", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsM32(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRL", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsM32(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRL", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR32(ops[1]) && operand.IsR32(ops[2]): + return &intrep.Instruction{ + Opcode: "SHRL", + Operands: ops, + Inputs: []operand.Op{ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR32(ops[1]) && operand.IsR32(ops[2]): + return &intrep.Instruction{ + Opcode: "SHRL", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR32(ops[1]) && operand.IsM32(ops[2]): + return &intrep.Instruction{ + Opcode: "SHRL", + Operands: ops, + Inputs: []operand.Op{ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR32(ops[1]) && operand.IsM32(ops[2]): + return &intrep.Instruction{ + Opcode: "SHRL", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + } + return nil, errors.New("SHRL: bad operands") +} + +// SHRQ: Logical Shift Right. +// +// Forms: +// +// SHRQ 1 r64 +// SHRQ imm8 r64 +// SHRQ cl r64 +// SHRQ 1 m64 +// SHRQ imm8 m64 +// SHRQ cl m64 +// SHRQ imm8 r64 r64 +// SHRQ cl r64 r64 +// SHRQ imm8 r64 m64 +// SHRQ cl r64 m64 +func SHRQ(ops ...operand.Op) (*intrep.Instruction, error) { + switch { + case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsR64(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRQ", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsR64(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRQ", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsR64(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRQ", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsM64(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRQ", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsM64(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRQ", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsM64(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRQ", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR64(ops[1]) && operand.IsR64(ops[2]): + return &intrep.Instruction{ + Opcode: "SHRQ", + Operands: ops, + Inputs: []operand.Op{ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR64(ops[1]) && operand.IsR64(ops[2]): + return &intrep.Instruction{ + Opcode: "SHRQ", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR64(ops[1]) && operand.IsM64(ops[2]): + return &intrep.Instruction{ + Opcode: "SHRQ", + Operands: ops, + Inputs: []operand.Op{ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR64(ops[1]) && operand.IsM64(ops[2]): + return &intrep.Instruction{ + Opcode: "SHRQ", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + } + return nil, errors.New("SHRQ: bad operands") +} + +// SHRW: Logical Shift Right. +// +// Forms: +// +// SHRW 1 r16 +// SHRW imm8 r16 +// SHRW cl r16 +// SHRW 1 m16 +// SHRW imm8 m16 +// SHRW cl m16 +// SHRW imm8 r16 r16 +// SHRW cl r16 r16 +// SHRW imm8 r16 m16 +// SHRW cl r16 m16 +func SHRW(ops ...operand.Op) (*intrep.Instruction, error) { + switch { + case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsR16(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRW", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsR16(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRW", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsR16(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRW", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.Is1(ops[0]) && operand.IsM16(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRW", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsIMM8(ops[0]) && operand.IsM16(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRW", + Operands: ops, + Inputs: []operand.Op{ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 2 && operand.IsCL(ops[0]) && operand.IsM16(ops[1]): + return &intrep.Instruction{ + Opcode: "SHRW", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[1]}, + }, nil + case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR16(ops[1]) && operand.IsR16(ops[2]): + return &intrep.Instruction{ + Opcode: "SHRW", + Operands: ops, + Inputs: []operand.Op{ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR16(ops[1]) && operand.IsR16(ops[2]): + return &intrep.Instruction{ + Opcode: "SHRW", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsIMM8(ops[0]) && operand.IsR16(ops[1]) && operand.IsM16(ops[2]): + return &intrep.Instruction{ + Opcode: "SHRW", + Operands: ops, + Inputs: []operand.Op{ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + case len(ops) == 3 && operand.IsCL(ops[0]) && operand.IsR16(ops[1]) && operand.IsM16(ops[2]): + return &intrep.Instruction{ + Opcode: "SHRW", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1], ops[2]}, + Outputs: []operand.Op{ops[2]}, + }, nil + } + return nil, errors.New("SHRW: bad operands") +} + +// SHRXL: Logical Shift Right Without Affecting Flags. +// +// Forms: +// +// SHRXL r32 r32 r32 +// SHRXL r32 m32 r32 +func SHRXL(r, mr, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(r) && operand.IsR32(mr) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "SHRXL", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + case operand.IsR32(r) && operand.IsM32(mr) && operand.IsR32(r1): + return &intrep.Instruction{ + Opcode: "SHRXL", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + } + return nil, errors.New("SHRXL: bad operands") +} + +// SHRXQ: Logical Shift Right Without Affecting Flags. +// +// Forms: +// +// SHRXQ r64 r64 r64 +// SHRXQ r64 m64 r64 +func SHRXQ(r, mr, r1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(r) && operand.IsR64(mr) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "SHRXQ", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + case operand.IsR64(r) && operand.IsM64(mr) && operand.IsR64(r1): + return &intrep.Instruction{ + Opcode: "SHRXQ", + Operands: []operand.Op{r, mr, r1}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r1}, + ISA: []string{"BMI2"}, + }, nil + } + return nil, errors.New("SHRXQ: bad operands") +} + +// SHUFPD: Shuffle Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// SHUFPD imm8 xmm xmm +// SHUFPD imm8 m128 xmm +func SHUFPD(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SHUFPD", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SHUFPD", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("SHUFPD: bad operands") +} + +// SHUFPS: Shuffle Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// SHUFPS imm8 xmm xmm +// SHUFPS imm8 m128 xmm +func SHUFPS(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SHUFPS", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SHUFPS", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("SHUFPS: bad operands") +} + +// SQRTPD: Compute Square Roots of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// SQRTPD xmm xmm +// SQRTPD m128 xmm +func SQRTPD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SQRTPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SQRTPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("SQRTPD: bad operands") +} + +// SQRTPS: Compute Square Roots of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// SQRTPS xmm xmm +// SQRTPS m128 xmm +func SQRTPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SQRTPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SQRTPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("SQRTPS: bad operands") +} + +// SQRTSD: Compute Square Root of Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// SQRTSD xmm xmm +// SQRTSD m64 xmm +func SQRTSD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SQRTSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SQRTSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("SQRTSD: bad operands") +} + +// SQRTSS: Compute Square Root of Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// SQRTSS xmm xmm +// SQRTSS m32 xmm +func SQRTSS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SQRTSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SQRTSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("SQRTSS: bad operands") +} + +// STC: Set Carry Flag. +// +// Forms: +// +// STC +func STC() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "STC", + Operands: nil, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + }, nil +} + +// STD: Set Direction Flag. +// +// Forms: +// +// STD +func STD() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "STD", + Operands: nil, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + }, nil +} + +// STMXCSR: Store MXCSR Register State. +// +// Forms: +// +// STMXCSR m32 +func STMXCSR(m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM32(m): + return &intrep.Instruction{ + Opcode: "STMXCSR", + Operands: []operand.Op{m}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{m}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("STMXCSR: bad operands") +} + +// SUBB: Subtract. +// +// Forms: +// +// SUBB imm8 al +// SUBB imm8 r8 +// SUBB r8 r8 +// SUBB m8 r8 +// SUBB imm8 m8 +// SUBB r8 m8 +func SUBB(imr, amr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imr) && operand.IsAL(amr): + return &intrep.Instruction{ + Opcode: "SUBB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "SUBB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "SUBB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + CancellingInputs: true, + }, nil + case operand.IsM8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "SUBB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM8(amr): + return &intrep.Instruction{ + Opcode: "SUBB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR8(imr) && operand.IsM8(amr): + return &intrep.Instruction{ + Opcode: "SUBB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + } + return nil, errors.New("SUBB: bad operands") +} + +// SUBL: Subtract. +// +// Forms: +// +// SUBL imm32 eax +// SUBL imm8 r32 +// SUBL imm32 r32 +// SUBL r32 r32 +// SUBL m32 r32 +// SUBL imm8 m32 +// SUBL imm32 m32 +// SUBL r32 m32 +func SUBL(imr, emr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imr) && operand.IsEAX(emr): + return &intrep.Instruction{ + Opcode: "SUBL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "SUBL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "SUBL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsR32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "SUBL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + CancellingInputs: true, + }, nil + case operand.IsM32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "SUBL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "SUBL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM32(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "SUBL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsR32(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "SUBL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + } + return nil, errors.New("SUBL: bad operands") +} + +// SUBPD: Subtract Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// SUBPD xmm xmm +// SUBPD m128 xmm +func SUBPD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SUBPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SUBPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("SUBPD: bad operands") +} + +// SUBPS: Subtract Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// SUBPS xmm xmm +// SUBPS m128 xmm +func SUBPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SUBPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SUBPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("SUBPS: bad operands") +} + +// SUBQ: Subtract. +// +// Forms: +// +// SUBQ imm32 rax +// SUBQ imm8 r64 +// SUBQ imm32 r64 +// SUBQ r64 r64 +// SUBQ m64 r64 +// SUBQ imm8 m64 +// SUBQ imm32 m64 +// SUBQ r64 m64 +func SUBQ(imr, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imr) && operand.IsRAX(mr): + return &intrep.Instruction{ + Opcode: "SUBQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "SUBQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM32(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "SUBQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "SUBQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + CancellingInputs: true, + }, nil + case operand.IsM64(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "SUBQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "SUBQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM32(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "SUBQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "SUBQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("SUBQ: bad operands") +} + +// SUBSD: Subtract Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// SUBSD xmm xmm +// SUBSD m64 xmm +func SUBSD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SUBSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SUBSD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("SUBSD: bad operands") +} + +// SUBSS: Subtract Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// SUBSS xmm xmm +// SUBSS m32 xmm +func SUBSS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SUBSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "SUBSS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("SUBSS: bad operands") +} + +// SUBW: Subtract. +// +// Forms: +// +// SUBW imm16 ax +// SUBW imm8 r16 +// SUBW imm16 r16 +// SUBW r16 r16 +// SUBW m16 r16 +// SUBW imm8 m16 +// SUBW imm16 m16 +// SUBW r16 m16 +func SUBW(imr, amr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM16(imr) && operand.IsAX(amr): + return &intrep.Instruction{ + Opcode: "SUBW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "SUBW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "SUBW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "SUBW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + CancellingInputs: true, + }, nil + case operand.IsM16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "SUBW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "SUBW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM16(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "SUBW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR16(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "SUBW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + } + return nil, errors.New("SUBW: bad operands") +} + +// SYSCALL: Fast System Call. +// +// Forms: +// +// SYSCALL +func SYSCALL() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "SYSCALL", + Operands: nil, + Inputs: []operand.Op{}, + Outputs: []operand.Op{reg.R11, reg.RCX}, + }, nil +} + +// TESTB: Logical Compare. +// +// Forms: +// +// TESTB imm8 al +// TESTB imm8 r8 +// TESTB r8 r8 +// TESTB imm8 m8 +// TESTB r8 m8 +func TESTB(ir, amr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(ir) && operand.IsAL(amr): + return &intrep.Instruction{ + Opcode: "TESTB", + Operands: []operand.Op{ir, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsIMM8(ir) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "TESTB", + Operands: []operand.Op{ir, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR8(ir) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "TESTB", + Operands: []operand.Op{ir, amr}, + Inputs: []operand.Op{ir, amr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsIMM8(ir) && operand.IsM8(amr): + return &intrep.Instruction{ + Opcode: "TESTB", + Operands: []operand.Op{ir, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR8(ir) && operand.IsM8(amr): + return &intrep.Instruction{ + Opcode: "TESTB", + Operands: []operand.Op{ir, amr}, + Inputs: []operand.Op{ir, amr}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("TESTB: bad operands") +} + +// TESTL: Logical Compare. +// +// Forms: +// +// TESTL imm32 eax +// TESTL imm32 r32 +// TESTL r32 r32 +// TESTL imm32 m32 +// TESTL r32 m32 +func TESTL(ir, emr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(ir) && operand.IsEAX(emr): + return &intrep.Instruction{ + Opcode: "TESTL", + Operands: []operand.Op{ir, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsIMM32(ir) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "TESTL", + Operands: []operand.Op{ir, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR32(ir) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "TESTL", + Operands: []operand.Op{ir, emr}, + Inputs: []operand.Op{ir, emr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsIMM32(ir) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "TESTL", + Operands: []operand.Op{ir, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR32(ir) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "TESTL", + Operands: []operand.Op{ir, emr}, + Inputs: []operand.Op{ir, emr}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("TESTL: bad operands") +} + +// TESTQ: Logical Compare. +// +// Forms: +// +// TESTQ imm32 rax +// TESTQ imm32 r64 +// TESTQ r64 r64 +// TESTQ imm32 m64 +// TESTQ r64 m64 +func TESTQ(ir, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(ir) && operand.IsRAX(mr): + return &intrep.Instruction{ + Opcode: "TESTQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsIMM32(ir) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "TESTQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR64(ir) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "TESTQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsIMM32(ir) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "TESTQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR64(ir) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "TESTQ", + Operands: []operand.Op{ir, mr}, + Inputs: []operand.Op{ir, mr}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("TESTQ: bad operands") +} + +// TESTW: Logical Compare. +// +// Forms: +// +// TESTW imm16 ax +// TESTW imm16 r16 +// TESTW r16 r16 +// TESTW imm16 m16 +// TESTW r16 m16 +func TESTW(ir, amr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM16(ir) && operand.IsAX(amr): + return &intrep.Instruction{ + Opcode: "TESTW", + Operands: []operand.Op{ir, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsIMM16(ir) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "TESTW", + Operands: []operand.Op{ir, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR16(ir) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "TESTW", + Operands: []operand.Op{ir, amr}, + Inputs: []operand.Op{ir, amr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsIMM16(ir) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "TESTW", + Operands: []operand.Op{ir, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{}, + }, nil + case operand.IsR16(ir) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "TESTW", + Operands: []operand.Op{ir, amr}, + Inputs: []operand.Op{ir, amr}, + Outputs: []operand.Op{}, + }, nil + } + return nil, errors.New("TESTW: bad operands") +} + +// TZCNTL: Count the Number of Trailing Zero Bits. +// +// Forms: +// +// TZCNTL r32 r32 +// TZCNTL m32 r32 +func TZCNTL(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "TZCNTL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + case operand.IsM32(mr) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "TZCNTL", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + } + return nil, errors.New("TZCNTL: bad operands") +} + +// TZCNTQ: Count the Number of Trailing Zero Bits. +// +// Forms: +// +// TZCNTQ r64 r64 +// TZCNTQ m64 r64 +func TZCNTQ(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "TZCNTQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + case operand.IsM64(mr) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "TZCNTQ", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + } + return nil, errors.New("TZCNTQ: bad operands") +} + +// TZCNTW: Count the Number of Trailing Zero Bits. +// +// Forms: +// +// TZCNTW r16 r16 +// TZCNTW m16 r16 +func TZCNTW(mr, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "TZCNTW", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + case operand.IsM16(mr) && operand.IsR16(r): + return &intrep.Instruction{ + Opcode: "TZCNTW", + Operands: []operand.Op{mr, r}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{r}, + ISA: []string{"BMI"}, + }, nil + } + return nil, errors.New("TZCNTW: bad operands") +} + +// UCOMISD: Unordered Compare Scalar Double-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// UCOMISD xmm xmm +// UCOMISD m64 xmm +func UCOMISD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "UCOMISD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "UCOMISD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("UCOMISD: bad operands") +} + +// UCOMISS: Unordered Compare Scalar Single-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// UCOMISS xmm xmm +// UCOMISS m32 xmm +func UCOMISS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "UCOMISS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "UCOMISS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("UCOMISS: bad operands") +} + +// UD2: Undefined Instruction. +// +// Forms: +// +// UD2 +func UD2() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "UD2", + Operands: nil, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + }, nil +} + +// UNPCKHPD: Unpack and Interleave High Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// UNPCKHPD xmm xmm +// UNPCKHPD m128 xmm +func UNPCKHPD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "UNPCKHPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "UNPCKHPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("UNPCKHPD: bad operands") +} + +// UNPCKHPS: Unpack and Interleave High Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// UNPCKHPS xmm xmm +// UNPCKHPS m128 xmm +func UNPCKHPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "UNPCKHPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "UNPCKHPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("UNPCKHPS: bad operands") +} + +// UNPCKLPD: Unpack and Interleave Low Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// UNPCKLPD xmm xmm +// UNPCKLPD m128 xmm +func UNPCKLPD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "UNPCKLPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "UNPCKLPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("UNPCKLPD: bad operands") +} + +// UNPCKLPS: Unpack and Interleave Low Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// UNPCKLPS xmm xmm +// UNPCKLPS m128 xmm +func UNPCKLPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "UNPCKLPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "UNPCKLPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("UNPCKLPS: bad operands") +} + +// VADDPD: Add Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VADDPD xmm xmm xmm +// VADDPD m128 xmm xmm +// VADDPD ymm ymm ymm +// VADDPD m256 ymm ymm +func VADDPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VADDPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VADDPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VADDPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VADDPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VADDPD: bad operands") +} + +// VADDPS: Add Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VADDPS xmm xmm xmm +// VADDPS m128 xmm xmm +// VADDPS ymm ymm ymm +// VADDPS m256 ymm ymm +func VADDPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VADDPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VADDPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VADDPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VADDPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VADDPS: bad operands") +} + +// VADDSD: Add Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VADDSD xmm xmm xmm +// VADDSD m64 xmm xmm +func VADDSD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VADDSD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VADDSD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VADDSD: bad operands") +} + +// VADDSS: Add Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VADDSS xmm xmm xmm +// VADDSS m32 xmm xmm +func VADDSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VADDSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VADDSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VADDSS: bad operands") +} + +// VADDSUBPD: Packed Double-FP Add/Subtract. +// +// Forms: +// +// VADDSUBPD xmm xmm xmm +// VADDSUBPD m128 xmm xmm +// VADDSUBPD ymm ymm ymm +// VADDSUBPD m256 ymm ymm +func VADDSUBPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VADDSUBPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VADDSUBPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VADDSUBPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VADDSUBPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VADDSUBPD: bad operands") +} + +// VADDSUBPS: Packed Single-FP Add/Subtract. +// +// Forms: +// +// VADDSUBPS xmm xmm xmm +// VADDSUBPS m128 xmm xmm +// VADDSUBPS ymm ymm ymm +// VADDSUBPS m256 ymm ymm +func VADDSUBPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VADDSUBPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VADDSUBPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VADDSUBPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VADDSUBPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VADDSUBPS: bad operands") +} + +// VAESDEC: Perform One Round of an AES Decryption Flow. +// +// Forms: +// +// VAESDEC xmm xmm xmm +// VAESDEC m128 xmm xmm +func VAESDEC(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VAESDEC", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX", "AES"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VAESDEC", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX", "AES"}, + }, nil + } + return nil, errors.New("VAESDEC: bad operands") +} + +// VAESDECLAST: Perform Last Round of an AES Decryption Flow. +// +// Forms: +// +// VAESDECLAST xmm xmm xmm +// VAESDECLAST m128 xmm xmm +func VAESDECLAST(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VAESDECLAST", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX", "AES"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VAESDECLAST", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX", "AES"}, + }, nil + } + return nil, errors.New("VAESDECLAST: bad operands") +} + +// VAESENC: Perform One Round of an AES Encryption Flow. +// +// Forms: +// +// VAESENC xmm xmm xmm +// VAESENC m128 xmm xmm +func VAESENC(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VAESENC", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX", "AES"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VAESENC", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX", "AES"}, + }, nil + } + return nil, errors.New("VAESENC: bad operands") +} + +// VAESENCLAST: Perform Last Round of an AES Encryption Flow. +// +// Forms: +// +// VAESENCLAST xmm xmm xmm +// VAESENCLAST m128 xmm xmm +func VAESENCLAST(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VAESENCLAST", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX", "AES"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VAESENCLAST", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX", "AES"}, + }, nil + } + return nil, errors.New("VAESENCLAST: bad operands") +} + +// VAESIMC: Perform the AES InvMixColumn Transformation. +// +// Forms: +// +// VAESIMC xmm xmm +// VAESIMC m128 xmm +func VAESIMC(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VAESIMC", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX", "AES"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VAESIMC", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX", "AES"}, + }, nil + } + return nil, errors.New("VAESIMC: bad operands") +} + +// VAESKEYGENASSIST: AES Round Key Generation Assist. +// +// Forms: +// +// VAESKEYGENASSIST imm8 xmm xmm +// VAESKEYGENASSIST imm8 m128 xmm +func VAESKEYGENASSIST(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VAESKEYGENASSIST", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX", "AES"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VAESKEYGENASSIST", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX", "AES"}, + }, nil + } + return nil, errors.New("VAESKEYGENASSIST: bad operands") +} + +// VANDNPD: Bitwise Logical AND NOT of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VANDNPD xmm xmm xmm +// VANDNPD m128 xmm xmm +// VANDNPD ymm ymm ymm +// VANDNPD m256 ymm ymm +func VANDNPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VANDNPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VANDNPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VANDNPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VANDNPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VANDNPD: bad operands") +} + +// VANDNPS: Bitwise Logical AND NOT of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VANDNPS xmm xmm xmm +// VANDNPS m128 xmm xmm +// VANDNPS ymm ymm ymm +// VANDNPS m256 ymm ymm +func VANDNPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VANDNPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VANDNPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VANDNPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VANDNPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VANDNPS: bad operands") +} + +// VANDPD: Bitwise Logical AND of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VANDPD xmm xmm xmm +// VANDPD m128 xmm xmm +// VANDPD ymm ymm ymm +// VANDPD m256 ymm ymm +func VANDPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VANDPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VANDPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VANDPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VANDPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VANDPD: bad operands") +} + +// VANDPS: Bitwise Logical AND of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VANDPS xmm xmm xmm +// VANDPS m128 xmm xmm +// VANDPS ymm ymm ymm +// VANDPS m256 ymm ymm +func VANDPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VANDPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VANDPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VANDPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VANDPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VANDPS: bad operands") +} + +// VBLENDPD: Blend Packed Double Precision Floating-Point Values. +// +// Forms: +// +// VBLENDPD imm8 xmm xmm xmm +// VBLENDPD imm8 m128 xmm xmm +// VBLENDPD imm8 ymm ymm ymm +// VBLENDPD imm8 m256 ymm ymm +func VBLENDPD(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VBLENDPD", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VBLENDPD", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VBLENDPD", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VBLENDPD", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VBLENDPD: bad operands") +} + +// VBLENDPS: Blend Packed Single Precision Floating-Point Values. +// +// Forms: +// +// VBLENDPS imm8 xmm xmm xmm +// VBLENDPS imm8 m128 xmm xmm +// VBLENDPS imm8 ymm ymm ymm +// VBLENDPS imm8 m256 ymm ymm +func VBLENDPS(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VBLENDPS", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VBLENDPS", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VBLENDPS", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VBLENDPS", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VBLENDPS: bad operands") +} + +// VBLENDVPD: Variable Blend Packed Double Precision Floating-Point Values. +// +// Forms: +// +// VBLENDVPD xmm xmm xmm xmm +// VBLENDVPD xmm m128 xmm xmm +// VBLENDVPD ymm ymm ymm ymm +// VBLENDVPD ymm m256 ymm ymm +func VBLENDVPD(xy, mxy, xy1, xy2 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(xy) && operand.IsXMM(mxy) && operand.IsXMM(xy1) && operand.IsXMM(xy2): + return &intrep.Instruction{ + Opcode: "VBLENDVPD", + Operands: []operand.Op{xy, mxy, xy1, xy2}, + Inputs: []operand.Op{xy, mxy, xy1}, + Outputs: []operand.Op{xy2}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(xy) && operand.IsM128(mxy) && operand.IsXMM(xy1) && operand.IsXMM(xy2): + return &intrep.Instruction{ + Opcode: "VBLENDVPD", + Operands: []operand.Op{xy, mxy, xy1, xy2}, + Inputs: []operand.Op{xy, mxy, xy1}, + Outputs: []operand.Op{xy2}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(xy) && operand.IsYMM(mxy) && operand.IsYMM(xy1) && operand.IsYMM(xy2): + return &intrep.Instruction{ + Opcode: "VBLENDVPD", + Operands: []operand.Op{xy, mxy, xy1, xy2}, + Inputs: []operand.Op{xy, mxy, xy1}, + Outputs: []operand.Op{xy2}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(xy) && operand.IsM256(mxy) && operand.IsYMM(xy1) && operand.IsYMM(xy2): + return &intrep.Instruction{ + Opcode: "VBLENDVPD", + Operands: []operand.Op{xy, mxy, xy1, xy2}, + Inputs: []operand.Op{xy, mxy, xy1}, + Outputs: []operand.Op{xy2}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VBLENDVPD: bad operands") +} + +// VBLENDVPS: Variable Blend Packed Single Precision Floating-Point Values. +// +// Forms: +// +// VBLENDVPS xmm xmm xmm xmm +// VBLENDVPS xmm m128 xmm xmm +// VBLENDVPS ymm ymm ymm ymm +// VBLENDVPS ymm m256 ymm ymm +func VBLENDVPS(xy, mxy, xy1, xy2 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(xy) && operand.IsXMM(mxy) && operand.IsXMM(xy1) && operand.IsXMM(xy2): + return &intrep.Instruction{ + Opcode: "VBLENDVPS", + Operands: []operand.Op{xy, mxy, xy1, xy2}, + Inputs: []operand.Op{xy, mxy, xy1}, + Outputs: []operand.Op{xy2}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(xy) && operand.IsM128(mxy) && operand.IsXMM(xy1) && operand.IsXMM(xy2): + return &intrep.Instruction{ + Opcode: "VBLENDVPS", + Operands: []operand.Op{xy, mxy, xy1, xy2}, + Inputs: []operand.Op{xy, mxy, xy1}, + Outputs: []operand.Op{xy2}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(xy) && operand.IsYMM(mxy) && operand.IsYMM(xy1) && operand.IsYMM(xy2): + return &intrep.Instruction{ + Opcode: "VBLENDVPS", + Operands: []operand.Op{xy, mxy, xy1, xy2}, + Inputs: []operand.Op{xy, mxy, xy1}, + Outputs: []operand.Op{xy2}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(xy) && operand.IsM256(mxy) && operand.IsYMM(xy1) && operand.IsYMM(xy2): + return &intrep.Instruction{ + Opcode: "VBLENDVPS", + Operands: []operand.Op{xy, mxy, xy1, xy2}, + Inputs: []operand.Op{xy, mxy, xy1}, + Outputs: []operand.Op{xy2}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VBLENDVPS: bad operands") +} + +// VBROADCASTF128: Broadcast 128 Bit of Floating-Point Data. +// +// Forms: +// +// VBROADCASTF128 m128 ymm +func VBROADCASTF128(m, y operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM128(m) && operand.IsYMM(y): + return &intrep.Instruction{ + Opcode: "VBROADCASTF128", + Operands: []operand.Op{m, y}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{y}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VBROADCASTF128: bad operands") +} + +// VBROADCASTI128: Broadcast 128 Bits of Integer Data. +// +// Forms: +// +// VBROADCASTI128 m128 ymm +func VBROADCASTI128(m, y operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM128(m) && operand.IsYMM(y): + return &intrep.Instruction{ + Opcode: "VBROADCASTI128", + Operands: []operand.Op{m, y}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{y}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VBROADCASTI128: bad operands") +} + +// VBROADCASTSD: Broadcast Double-Precision Floating-Point Element. +// +// Forms: +// +// VBROADCASTSD xmm ymm +// VBROADCASTSD m64 ymm +func VBROADCASTSD(mx, y operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsYMM(y): + return &intrep.Instruction{ + Opcode: "VBROADCASTSD", + Operands: []operand.Op{mx, y}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{y}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM64(mx) && operand.IsYMM(y): + return &intrep.Instruction{ + Opcode: "VBROADCASTSD", + Operands: []operand.Op{mx, y}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{y}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VBROADCASTSD: bad operands") +} + +// VBROADCASTSS: Broadcast Single-Precision Floating-Point Element. +// +// Forms: +// +// VBROADCASTSS xmm xmm +// VBROADCASTSS m32 xmm +// VBROADCASTSS xmm ymm +// VBROADCASTSS m32 ymm +func VBROADCASTSS(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VBROADCASTSS", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VBROADCASTSS", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VBROADCASTSS", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM32(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VBROADCASTSS", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VBROADCASTSS: bad operands") +} + +// VCMPPD: Compare Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VCMPPD imm8 xmm xmm xmm +// VCMPPD imm8 m128 xmm xmm +// VCMPPD imm8 ymm ymm ymm +// VCMPPD imm8 m256 ymm ymm +func VCMPPD(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VCMPPD", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VCMPPD", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VCMPPD", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VCMPPD", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCMPPD: bad operands") +} + +// VCMPPS: Compare Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VCMPPS imm8 xmm xmm xmm +// VCMPPS imm8 m128 xmm xmm +// VCMPPS imm8 ymm ymm ymm +// VCMPPS imm8 m256 ymm ymm +func VCMPPS(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VCMPPS", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VCMPPS", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VCMPPS", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VCMPPS", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCMPPS: bad operands") +} + +// VCMPSD: Compare Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VCMPSD imm8 xmm xmm xmm +// VCMPSD imm8 m64 xmm xmm +func VCMPSD(i, mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VCMPSD", + Operands: []operand.Op{i, mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VCMPSD", + Operands: []operand.Op{i, mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCMPSD: bad operands") +} + +// VCMPSS: Compare Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VCMPSS imm8 xmm xmm xmm +// VCMPSS imm8 m32 xmm xmm +func VCMPSS(i, mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VCMPSS", + Operands: []operand.Op{i, mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VCMPSS", + Operands: []operand.Op{i, mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCMPSS: bad operands") +} + +// VCOMISD: Compare Scalar Ordered Double-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// VCOMISD xmm xmm +// VCOMISD m64 xmm +func VCOMISD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VCOMISD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VCOMISD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCOMISD: bad operands") +} + +// VCOMISS: Compare Scalar Ordered Single-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// VCOMISS xmm xmm +// VCOMISS m32 xmm +func VCOMISS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VCOMISS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VCOMISS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCOMISS: bad operands") +} + +// VCVTDQ2PD: Convert Packed Dword Integers to Packed Double-Precision FP Values. +// +// Forms: +// +// VCVTDQ2PD xmm xmm +// VCVTDQ2PD m64 xmm +// VCVTDQ2PD xmm ymm +// VCVTDQ2PD m128 ymm +func VCVTDQ2PD(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTDQ2PD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTDQ2PD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTDQ2PD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTDQ2PD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTDQ2PD: bad operands") +} + +// VCVTDQ2PS: Convert Packed Dword Integers to Packed Single-Precision FP Values. +// +// Forms: +// +// VCVTDQ2PS xmm xmm +// VCVTDQ2PS m128 xmm +// VCVTDQ2PS ymm ymm +// VCVTDQ2PS m256 ymm +func VCVTDQ2PS(mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTDQ2PS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTDQ2PS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTDQ2PS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTDQ2PS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTDQ2PS: bad operands") +} + +// VCVTPD2DQX: Convert Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTPD2DQX xmm xmm +// VCVTPD2DQX m128 xmm +func VCVTPD2DQX(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VCVTPD2DQX", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VCVTPD2DQX", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTPD2DQX: bad operands") +} + +// VCVTPD2DQY: Convert Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTPD2DQY ymm xmm +// VCVTPD2DQY m256 xmm +func VCVTPD2DQY(my, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsYMM(my) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VCVTPD2DQY", + Operands: []operand.Op{my, x}, + Inputs: []operand.Op{my}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(my) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VCVTPD2DQY", + Operands: []operand.Op{my, x}, + Inputs: []operand.Op{my}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTPD2DQY: bad operands") +} + +// VCVTPD2PSX: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. +// +// Forms: +// +// VCVTPD2PSX xmm xmm +// VCVTPD2PSX m128 xmm +func VCVTPD2PSX(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VCVTPD2PSX", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VCVTPD2PSX", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTPD2PSX: bad operands") +} + +// VCVTPD2PSY: Convert Packed Double-Precision FP Values to Packed Single-Precision FP Values. +// +// Forms: +// +// VCVTPD2PSY ymm xmm +// VCVTPD2PSY m256 xmm +func VCVTPD2PSY(my, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsYMM(my) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VCVTPD2PSY", + Operands: []operand.Op{my, x}, + Inputs: []operand.Op{my}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(my) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VCVTPD2PSY", + Operands: []operand.Op{my, x}, + Inputs: []operand.Op{my}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTPD2PSY: bad operands") +} + +// VCVTPH2PS: Convert Half-Precision FP Values to Single-Precision FP Values. +// +// Forms: +// +// VCVTPH2PS xmm xmm +// VCVTPH2PS m64 xmm +// VCVTPH2PS xmm ymm +// VCVTPH2PS m128 ymm +func VCVTPH2PS(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTPH2PS", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"F16C"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTPH2PS", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"F16C"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTPH2PS", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"F16C"}, + }, nil + case operand.IsM128(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTPH2PS", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"F16C"}, + }, nil + } + return nil, errors.New("VCVTPH2PS: bad operands") +} + +// VCVTPS2DQ: Convert Packed Single-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTPS2DQ xmm xmm +// VCVTPS2DQ m128 xmm +// VCVTPS2DQ ymm ymm +// VCVTPS2DQ m256 ymm +func VCVTPS2DQ(mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTPS2DQ", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTPS2DQ", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTPS2DQ", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTPS2DQ", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTPS2DQ: bad operands") +} + +// VCVTPS2PD: Convert Packed Single-Precision FP Values to Packed Double-Precision FP Values. +// +// Forms: +// +// VCVTPS2PD xmm xmm +// VCVTPS2PD m64 xmm +// VCVTPS2PD xmm ymm +// VCVTPS2PD m128 ymm +func VCVTPS2PD(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTPS2PD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTPS2PD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTPS2PD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTPS2PD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTPS2PD: bad operands") +} + +// VCVTPS2PH: Convert Single-Precision FP value to Half-Precision FP value. +// +// Forms: +// +// VCVTPS2PH imm8 xmm xmm +// VCVTPS2PH imm8 ymm xmm +// VCVTPS2PH imm8 xmm m64 +// VCVTPS2PH imm8 ymm m128 +func VCVTPS2PH(i, xy, mx operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(xy) && operand.IsXMM(mx): + return &intrep.Instruction{ + Opcode: "VCVTPS2PH", + Operands: []operand.Op{i, xy, mx}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{mx}, + ISA: []string{"F16C"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(xy) && operand.IsXMM(mx): + return &intrep.Instruction{ + Opcode: "VCVTPS2PH", + Operands: []operand.Op{i, xy, mx}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{mx}, + ISA: []string{"F16C"}, + }, nil + case operand.IsIMM8(i) && operand.IsXMM(xy) && operand.IsM64(mx): + return &intrep.Instruction{ + Opcode: "VCVTPS2PH", + Operands: []operand.Op{i, xy, mx}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{mx}, + ISA: []string{"F16C"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(xy) && operand.IsM128(mx): + return &intrep.Instruction{ + Opcode: "VCVTPS2PH", + Operands: []operand.Op{i, xy, mx}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{mx}, + ISA: []string{"F16C"}, + }, nil + } + return nil, errors.New("VCVTPS2PH: bad operands") +} + +// VCVTSD2SI: Convert Scalar Double-Precision FP Value to Integer. +// +// Forms: +// +// VCVTSD2SI xmm r32 +// VCVTSD2SI m64 r32 +func VCVTSD2SI(mx, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "VCVTSD2SI", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "VCVTSD2SI", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTSD2SI: bad operands") +} + +// VCVTSD2SIQ: Convert Scalar Double-Precision FP Value to Integer. +// +// Forms: +// +// VCVTSD2SIQ xmm r64 +// VCVTSD2SIQ m64 r64 +func VCVTSD2SIQ(mx, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "VCVTSD2SIQ", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "VCVTSD2SIQ", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTSD2SIQ: bad operands") +} + +// VCVTSD2SS: Convert Scalar Double-Precision FP Value to Scalar Single-Precision FP Value. +// +// Forms: +// +// VCVTSD2SS xmm xmm xmm +// VCVTSD2SS m64 xmm xmm +func VCVTSD2SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VCVTSD2SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VCVTSD2SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTSD2SS: bad operands") +} + +// VCVTSI2SDL: Convert Dword Integer to Scalar Double-Precision FP Value. +// +// Forms: +// +// VCVTSI2SDL r32 xmm xmm +// VCVTSI2SDL m32 xmm xmm +func VCVTSI2SDL(mr, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VCVTSI2SDL", + Operands: []operand.Op{mr, x, x1}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mr) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VCVTSI2SDL", + Operands: []operand.Op{mr, x, x1}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTSI2SDL: bad operands") +} + +// VCVTSI2SDQ: Convert Dword Integer to Scalar Double-Precision FP Value. +// +// Forms: +// +// VCVTSI2SDQ r64 xmm xmm +// VCVTSI2SDQ m64 xmm xmm +func VCVTSI2SDQ(mr, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VCVTSI2SDQ", + Operands: []operand.Op{mr, x, x1}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mr) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VCVTSI2SDQ", + Operands: []operand.Op{mr, x, x1}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTSI2SDQ: bad operands") +} + +// VCVTSI2SSL: Convert Dword Integer to Scalar Single-Precision FP Value. +// +// Forms: +// +// VCVTSI2SSL r32 xmm xmm +// VCVTSI2SSL m32 xmm xmm +func VCVTSI2SSL(mr, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(mr) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VCVTSI2SSL", + Operands: []operand.Op{mr, x, x1}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mr) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VCVTSI2SSL", + Operands: []operand.Op{mr, x, x1}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTSI2SSL: bad operands") +} + +// VCVTSI2SSQ: Convert Dword Integer to Scalar Single-Precision FP Value. +// +// Forms: +// +// VCVTSI2SSQ r64 xmm xmm +// VCVTSI2SSQ m64 xmm xmm +func VCVTSI2SSQ(mr, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VCVTSI2SSQ", + Operands: []operand.Op{mr, x, x1}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mr) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VCVTSI2SSQ", + Operands: []operand.Op{mr, x, x1}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTSI2SSQ: bad operands") +} + +// VCVTSS2SD: Convert Scalar Single-Precision FP Value to Scalar Double-Precision FP Value. +// +// Forms: +// +// VCVTSS2SD xmm xmm xmm +// VCVTSS2SD m32 xmm xmm +func VCVTSS2SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VCVTSS2SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VCVTSS2SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTSS2SD: bad operands") +} + +// VCVTSS2SI: Convert Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// VCVTSS2SI xmm r32 +// VCVTSS2SI m32 r32 +func VCVTSS2SI(mx, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "VCVTSS2SI", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "VCVTSS2SI", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTSS2SI: bad operands") +} + +// VCVTSS2SIQ: Convert Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// VCVTSS2SIQ xmm r64 +// VCVTSS2SIQ m32 r64 +func VCVTSS2SIQ(mx, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "VCVTSS2SIQ", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "VCVTSS2SIQ", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTSS2SIQ: bad operands") +} + +// VCVTTPD2DQX: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTTPD2DQX xmm xmm +// VCVTTPD2DQX m128 xmm +func VCVTTPD2DQX(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VCVTTPD2DQX", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VCVTTPD2DQX", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTTPD2DQX: bad operands") +} + +// VCVTTPD2DQY: Convert with Truncation Packed Double-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTTPD2DQY ymm xmm +// VCVTTPD2DQY m256 xmm +func VCVTTPD2DQY(my, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsYMM(my) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VCVTTPD2DQY", + Operands: []operand.Op{my, x}, + Inputs: []operand.Op{my}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(my) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VCVTTPD2DQY", + Operands: []operand.Op{my, x}, + Inputs: []operand.Op{my}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTTPD2DQY: bad operands") +} + +// VCVTTPS2DQ: Convert with Truncation Packed Single-Precision FP Values to Packed Dword Integers. +// +// Forms: +// +// VCVTTPS2DQ xmm xmm +// VCVTTPS2DQ m128 xmm +// VCVTTPS2DQ ymm ymm +// VCVTTPS2DQ m256 ymm +func VCVTTPS2DQ(mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTTPS2DQ", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTTPS2DQ", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTTPS2DQ", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VCVTTPS2DQ", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTTPS2DQ: bad operands") +} + +// VCVTTSD2SI: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. +// +// Forms: +// +// VCVTTSD2SI xmm r32 +// VCVTTSD2SI m64 r32 +func VCVTTSD2SI(mx, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "VCVTTSD2SI", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "VCVTTSD2SI", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTTSD2SI: bad operands") +} + +// VCVTTSD2SIQ: Convert with Truncation Scalar Double-Precision FP Value to Signed Integer. +// +// Forms: +// +// VCVTTSD2SIQ xmm r64 +// VCVTTSD2SIQ m64 r64 +func VCVTTSD2SIQ(mx, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "VCVTTSD2SIQ", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "VCVTTSD2SIQ", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTTSD2SIQ: bad operands") +} + +// VCVTTSS2SI: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// VCVTTSS2SI xmm r32 +// VCVTTSS2SI m32 r32 +func VCVTTSS2SI(mx, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "VCVTTSS2SI", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "VCVTTSS2SI", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTTSS2SI: bad operands") +} + +// VCVTTSS2SIQ: Convert with Truncation Scalar Single-Precision FP Value to Dword Integer. +// +// Forms: +// +// VCVTTSS2SIQ xmm r64 +// VCVTTSS2SIQ m32 r64 +func VCVTTSS2SIQ(mx, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "VCVTTSS2SIQ", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsR64(r): + return &intrep.Instruction{ + Opcode: "VCVTTSS2SIQ", + Operands: []operand.Op{mx, r}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VCVTTSS2SIQ: bad operands") +} + +// VDIVPD: Divide Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VDIVPD xmm xmm xmm +// VDIVPD m128 xmm xmm +// VDIVPD ymm ymm ymm +// VDIVPD m256 ymm ymm +func VDIVPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VDIVPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VDIVPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VDIVPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VDIVPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VDIVPD: bad operands") +} + +// VDIVPS: Divide Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VDIVPS xmm xmm xmm +// VDIVPS m128 xmm xmm +// VDIVPS ymm ymm ymm +// VDIVPS m256 ymm ymm +func VDIVPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VDIVPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VDIVPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VDIVPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VDIVPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VDIVPS: bad operands") +} + +// VDIVSD: Divide Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VDIVSD xmm xmm xmm +// VDIVSD m64 xmm xmm +func VDIVSD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VDIVSD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VDIVSD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VDIVSD: bad operands") +} + +// VDIVSS: Divide Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VDIVSS xmm xmm xmm +// VDIVSS m32 xmm xmm +func VDIVSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VDIVSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VDIVSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VDIVSS: bad operands") +} + +// VDPPD: Dot Product of Packed Double Precision Floating-Point Values. +// +// Forms: +// +// VDPPD imm8 xmm xmm xmm +// VDPPD imm8 m128 xmm xmm +func VDPPD(i, mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VDPPD", + Operands: []operand.Op{i, mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VDPPD", + Operands: []operand.Op{i, mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VDPPD: bad operands") +} + +// VDPPS: Dot Product of Packed Single Precision Floating-Point Values. +// +// Forms: +// +// VDPPS imm8 xmm xmm xmm +// VDPPS imm8 m128 xmm xmm +// VDPPS imm8 ymm ymm ymm +// VDPPS imm8 m256 ymm ymm +func VDPPS(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VDPPS", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VDPPS", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VDPPS", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VDPPS", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VDPPS: bad operands") +} + +// VEXTRACTF128: Extract Packed Floating-Point Values. +// +// Forms: +// +// VEXTRACTF128 imm8 ymm xmm +// VEXTRACTF128 imm8 ymm m128 +func VEXTRACTF128(i, y, mx operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsYMM(y) && operand.IsXMM(mx): + return &intrep.Instruction{ + Opcode: "VEXTRACTF128", + Operands: []operand.Op{i, y, mx}, + Inputs: []operand.Op{y}, + Outputs: []operand.Op{mx}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(y) && operand.IsM128(mx): + return &intrep.Instruction{ + Opcode: "VEXTRACTF128", + Operands: []operand.Op{i, y, mx}, + Inputs: []operand.Op{y}, + Outputs: []operand.Op{mx}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VEXTRACTF128: bad operands") +} + +// VEXTRACTI128: Extract Packed Integer Values. +// +// Forms: +// +// VEXTRACTI128 imm8 ymm xmm +// VEXTRACTI128 imm8 ymm m128 +func VEXTRACTI128(i, y, mx operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsYMM(y) && operand.IsXMM(mx): + return &intrep.Instruction{ + Opcode: "VEXTRACTI128", + Operands: []operand.Op{i, y, mx}, + Inputs: []operand.Op{y}, + Outputs: []operand.Op{mx}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(y) && operand.IsM128(mx): + return &intrep.Instruction{ + Opcode: "VEXTRACTI128", + Operands: []operand.Op{i, y, mx}, + Inputs: []operand.Op{y}, + Outputs: []operand.Op{mx}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VEXTRACTI128: bad operands") +} + +// VEXTRACTPS: Extract Packed Single Precision Floating-Point Value. +// +// Forms: +// +// VEXTRACTPS imm8 xmm r32 +// VEXTRACTPS imm8 xmm m32 +func VEXTRACTPS(i, x, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "VEXTRACTPS", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "VEXTRACTPS", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VEXTRACTPS: bad operands") +} + +// VFMADD132PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD132PD xmm xmm xmm +// VFMADD132PD m128 xmm xmm +// VFMADD132PD ymm ymm ymm +// VFMADD132PD m256 ymm ymm +func VFMADD132PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADD132PD: bad operands") +} + +// VFMADD132PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD132PS xmm xmm xmm +// VFMADD132PS m128 xmm xmm +// VFMADD132PS ymm ymm ymm +// VFMADD132PS m256 ymm ymm +func VFMADD132PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADD132PS: bad operands") +} + +// VFMADD132SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD132SD xmm xmm xmm +// VFMADD132SD m64 xmm xmm +func VFMADD132SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMADD132SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMADD132SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADD132SD: bad operands") +} + +// VFMADD132SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD132SS xmm xmm xmm +// VFMADD132SS m32 xmm xmm +func VFMADD132SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMADD132SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMADD132SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADD132SS: bad operands") +} + +// VFMADD213PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD213PD xmm xmm xmm +// VFMADD213PD m128 xmm xmm +// VFMADD213PD ymm ymm ymm +// VFMADD213PD m256 ymm ymm +func VFMADD213PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADD213PD: bad operands") +} + +// VFMADD213PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD213PS xmm xmm xmm +// VFMADD213PS m128 xmm xmm +// VFMADD213PS ymm ymm ymm +// VFMADD213PS m256 ymm ymm +func VFMADD213PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADD213PS: bad operands") +} + +// VFMADD213SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD213SD xmm xmm xmm +// VFMADD213SD m64 xmm xmm +func VFMADD213SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMADD213SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMADD213SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADD213SD: bad operands") +} + +// VFMADD213SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD213SS xmm xmm xmm +// VFMADD213SS m32 xmm xmm +func VFMADD213SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMADD213SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMADD213SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADD213SS: bad operands") +} + +// VFMADD231PD: Fused Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD231PD xmm xmm xmm +// VFMADD231PD m128 xmm xmm +// VFMADD231PD ymm ymm ymm +// VFMADD231PD m256 ymm ymm +func VFMADD231PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADD231PD: bad operands") +} + +// VFMADD231PS: Fused Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD231PS xmm xmm xmm +// VFMADD231PS m128 xmm xmm +// VFMADD231PS ymm ymm ymm +// VFMADD231PS m256 ymm ymm +func VFMADD231PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADD231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADD231PS: bad operands") +} + +// VFMADD231SD: Fused Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD231SD xmm xmm xmm +// VFMADD231SD m64 xmm xmm +func VFMADD231SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMADD231SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMADD231SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADD231SD: bad operands") +} + +// VFMADD231SS: Fused Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADD231SS xmm xmm xmm +// VFMADD231SS m32 xmm xmm +func VFMADD231SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMADD231SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMADD231SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADD231SS: bad operands") +} + +// VFMADDSUB132PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB132PD xmm xmm xmm +// VFMADDSUB132PD m128 xmm xmm +// VFMADDSUB132PD ymm ymm ymm +// VFMADDSUB132PD m256 ymm ymm +func VFMADDSUB132PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADDSUB132PD: bad operands") +} + +// VFMADDSUB132PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB132PS xmm xmm xmm +// VFMADDSUB132PS m128 xmm xmm +// VFMADDSUB132PS ymm ymm ymm +// VFMADDSUB132PS m256 ymm ymm +func VFMADDSUB132PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADDSUB132PS: bad operands") +} + +// VFMADDSUB213PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB213PD xmm xmm xmm +// VFMADDSUB213PD m128 xmm xmm +// VFMADDSUB213PD ymm ymm ymm +// VFMADDSUB213PD m256 ymm ymm +func VFMADDSUB213PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADDSUB213PD: bad operands") +} + +// VFMADDSUB213PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB213PS xmm xmm xmm +// VFMADDSUB213PS m128 xmm xmm +// VFMADDSUB213PS ymm ymm ymm +// VFMADDSUB213PS m256 ymm ymm +func VFMADDSUB213PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADDSUB213PS: bad operands") +} + +// VFMADDSUB231PD: Fused Multiply-Alternating Add/Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB231PD xmm xmm xmm +// VFMADDSUB231PD m128 xmm xmm +// VFMADDSUB231PD ymm ymm ymm +// VFMADDSUB231PD m256 ymm ymm +func VFMADDSUB231PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADDSUB231PD: bad operands") +} + +// VFMADDSUB231PS: Fused Multiply-Alternating Add/Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMADDSUB231PS xmm xmm xmm +// VFMADDSUB231PS m128 xmm xmm +// VFMADDSUB231PS ymm ymm ymm +// VFMADDSUB231PS m256 ymm ymm +func VFMADDSUB231PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMADDSUB231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMADDSUB231PS: bad operands") +} + +// VFMSUB132PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB132PD xmm xmm xmm +// VFMSUB132PD m128 xmm xmm +// VFMSUB132PD ymm ymm ymm +// VFMSUB132PD m256 ymm ymm +func VFMSUB132PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUB132PD: bad operands") +} + +// VFMSUB132PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB132PS xmm xmm xmm +// VFMSUB132PS m128 xmm xmm +// VFMSUB132PS ymm ymm ymm +// VFMSUB132PS m256 ymm ymm +func VFMSUB132PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUB132PS: bad operands") +} + +// VFMSUB132SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB132SD xmm xmm xmm +// VFMSUB132SD m64 xmm xmm +func VFMSUB132SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMSUB132SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMSUB132SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUB132SD: bad operands") +} + +// VFMSUB132SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB132SS xmm xmm xmm +// VFMSUB132SS m32 xmm xmm +func VFMSUB132SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMSUB132SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMSUB132SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUB132SS: bad operands") +} + +// VFMSUB213PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB213PD xmm xmm xmm +// VFMSUB213PD m128 xmm xmm +// VFMSUB213PD ymm ymm ymm +// VFMSUB213PD m256 ymm ymm +func VFMSUB213PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUB213PD: bad operands") +} + +// VFMSUB213PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB213PS xmm xmm xmm +// VFMSUB213PS m128 xmm xmm +// VFMSUB213PS ymm ymm ymm +// VFMSUB213PS m256 ymm ymm +func VFMSUB213PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUB213PS: bad operands") +} + +// VFMSUB213SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB213SD xmm xmm xmm +// VFMSUB213SD m64 xmm xmm +func VFMSUB213SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMSUB213SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMSUB213SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUB213SD: bad operands") +} + +// VFMSUB213SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB213SS xmm xmm xmm +// VFMSUB213SS m32 xmm xmm +func VFMSUB213SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMSUB213SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMSUB213SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUB213SS: bad operands") +} + +// VFMSUB231PD: Fused Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB231PD xmm xmm xmm +// VFMSUB231PD m128 xmm xmm +// VFMSUB231PD ymm ymm ymm +// VFMSUB231PD m256 ymm ymm +func VFMSUB231PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUB231PD: bad operands") +} + +// VFMSUB231PS: Fused Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB231PS xmm xmm xmm +// VFMSUB231PS m128 xmm xmm +// VFMSUB231PS ymm ymm ymm +// VFMSUB231PS m256 ymm ymm +func VFMSUB231PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUB231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUB231PS: bad operands") +} + +// VFMSUB231SD: Fused Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB231SD xmm xmm xmm +// VFMSUB231SD m64 xmm xmm +func VFMSUB231SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMSUB231SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMSUB231SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUB231SD: bad operands") +} + +// VFMSUB231SS: Fused Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUB231SS xmm xmm xmm +// VFMSUB231SS m32 xmm xmm +func VFMSUB231SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMSUB231SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFMSUB231SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUB231SS: bad operands") +} + +// VFMSUBADD132PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD132PD xmm xmm xmm +// VFMSUBADD132PD m128 xmm xmm +// VFMSUBADD132PD ymm ymm ymm +// VFMSUBADD132PD m256 ymm ymm +func VFMSUBADD132PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUBADD132PD: bad operands") +} + +// VFMSUBADD132PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD132PS xmm xmm xmm +// VFMSUBADD132PS m128 xmm xmm +// VFMSUBADD132PS ymm ymm ymm +// VFMSUBADD132PS m256 ymm ymm +func VFMSUBADD132PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUBADD132PS: bad operands") +} + +// VFMSUBADD213PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD213PD xmm xmm xmm +// VFMSUBADD213PD m128 xmm xmm +// VFMSUBADD213PD ymm ymm ymm +// VFMSUBADD213PD m256 ymm ymm +func VFMSUBADD213PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUBADD213PD: bad operands") +} + +// VFMSUBADD213PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD213PS xmm xmm xmm +// VFMSUBADD213PS m128 xmm xmm +// VFMSUBADD213PS ymm ymm ymm +// VFMSUBADD213PS m256 ymm ymm +func VFMSUBADD213PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUBADD213PS: bad operands") +} + +// VFMSUBADD231PD: Fused Multiply-Alternating Subtract/Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD231PD xmm xmm xmm +// VFMSUBADD231PD m128 xmm xmm +// VFMSUBADD231PD ymm ymm ymm +// VFMSUBADD231PD m256 ymm ymm +func VFMSUBADD231PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUBADD231PD: bad operands") +} + +// VFMSUBADD231PS: Fused Multiply-Alternating Subtract/Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFMSUBADD231PS xmm xmm xmm +// VFMSUBADD231PS m128 xmm xmm +// VFMSUBADD231PS ymm ymm ymm +// VFMSUBADD231PS m256 ymm ymm +func VFMSUBADD231PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFMSUBADD231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFMSUBADD231PS: bad operands") +} + +// VFNMADD132PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD132PD xmm xmm xmm +// VFNMADD132PD m128 xmm xmm +// VFNMADD132PD ymm ymm ymm +// VFNMADD132PD m256 ymm ymm +func VFNMADD132PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMADD132PD: bad operands") +} + +// VFNMADD132PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD132PS xmm xmm xmm +// VFNMADD132PS m128 xmm xmm +// VFNMADD132PS ymm ymm ymm +// VFNMADD132PS m256 ymm ymm +func VFNMADD132PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMADD132PS: bad operands") +} + +// VFNMADD132SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD132SD xmm xmm xmm +// VFNMADD132SD m64 xmm xmm +func VFNMADD132SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMADD132SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMADD132SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMADD132SD: bad operands") +} + +// VFNMADD132SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD132SS xmm xmm xmm +// VFNMADD132SS m32 xmm xmm +func VFNMADD132SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMADD132SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMADD132SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMADD132SS: bad operands") +} + +// VFNMADD213PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD213PD xmm xmm xmm +// VFNMADD213PD m128 xmm xmm +// VFNMADD213PD ymm ymm ymm +// VFNMADD213PD m256 ymm ymm +func VFNMADD213PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMADD213PD: bad operands") +} + +// VFNMADD213PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD213PS xmm xmm xmm +// VFNMADD213PS m128 xmm xmm +// VFNMADD213PS ymm ymm ymm +// VFNMADD213PS m256 ymm ymm +func VFNMADD213PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMADD213PS: bad operands") +} + +// VFNMADD213SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD213SD xmm xmm xmm +// VFNMADD213SD m64 xmm xmm +func VFNMADD213SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMADD213SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMADD213SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMADD213SD: bad operands") +} + +// VFNMADD213SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD213SS xmm xmm xmm +// VFNMADD213SS m32 xmm xmm +func VFNMADD213SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMADD213SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMADD213SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMADD213SS: bad operands") +} + +// VFNMADD231PD: Fused Negative Multiply-Add of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD231PD xmm xmm xmm +// VFNMADD231PD m128 xmm xmm +// VFNMADD231PD ymm ymm ymm +// VFNMADD231PD m256 ymm ymm +func VFNMADD231PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMADD231PD: bad operands") +} + +// VFNMADD231PS: Fused Negative Multiply-Add of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD231PS xmm xmm xmm +// VFNMADD231PS m128 xmm xmm +// VFNMADD231PS ymm ymm ymm +// VFNMADD231PS m256 ymm ymm +func VFNMADD231PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMADD231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMADD231PS: bad operands") +} + +// VFNMADD231SD: Fused Negative Multiply-Add of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD231SD xmm xmm xmm +// VFNMADD231SD m64 xmm xmm +func VFNMADD231SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMADD231SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMADD231SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMADD231SD: bad operands") +} + +// VFNMADD231SS: Fused Negative Multiply-Add of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMADD231SS xmm xmm xmm +// VFNMADD231SS m32 xmm xmm +func VFNMADD231SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMADD231SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMADD231SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMADD231SS: bad operands") +} + +// VFNMSUB132PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB132PD xmm xmm xmm +// VFNMSUB132PD m128 xmm xmm +// VFNMSUB132PD ymm ymm ymm +// VFNMSUB132PD m256 ymm ymm +func VFNMSUB132PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB132PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMSUB132PD: bad operands") +} + +// VFNMSUB132PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB132PS xmm xmm xmm +// VFNMSUB132PS m128 xmm xmm +// VFNMSUB132PS ymm ymm ymm +// VFNMSUB132PS m256 ymm ymm +func VFNMSUB132PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB132PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMSUB132PS: bad operands") +} + +// VFNMSUB132SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB132SD xmm xmm xmm +// VFNMSUB132SD m64 xmm xmm +func VFNMSUB132SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMSUB132SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMSUB132SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMSUB132SD: bad operands") +} + +// VFNMSUB132SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB132SS xmm xmm xmm +// VFNMSUB132SS m32 xmm xmm +func VFNMSUB132SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMSUB132SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMSUB132SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMSUB132SS: bad operands") +} + +// VFNMSUB213PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB213PD xmm xmm xmm +// VFNMSUB213PD m128 xmm xmm +// VFNMSUB213PD ymm ymm ymm +// VFNMSUB213PD m256 ymm ymm +func VFNMSUB213PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB213PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMSUB213PD: bad operands") +} + +// VFNMSUB213PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB213PS xmm xmm xmm +// VFNMSUB213PS m128 xmm xmm +// VFNMSUB213PS ymm ymm ymm +// VFNMSUB213PS m256 ymm ymm +func VFNMSUB213PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB213PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMSUB213PS: bad operands") +} + +// VFNMSUB213SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB213SD xmm xmm xmm +// VFNMSUB213SD m64 xmm xmm +func VFNMSUB213SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMSUB213SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMSUB213SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMSUB213SD: bad operands") +} + +// VFNMSUB213SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB213SS xmm xmm xmm +// VFNMSUB213SS m32 xmm xmm +func VFNMSUB213SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMSUB213SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMSUB213SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMSUB213SS: bad operands") +} + +// VFNMSUB231PD: Fused Negative Multiply-Subtract of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB231PD xmm xmm xmm +// VFNMSUB231PD m128 xmm xmm +// VFNMSUB231PD ymm ymm ymm +// VFNMSUB231PD m256 ymm ymm +func VFNMSUB231PD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB231PD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMSUB231PD: bad operands") +} + +// VFNMSUB231PS: Fused Negative Multiply-Subtract of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB231PS xmm xmm xmm +// VFNMSUB231PS m128 xmm xmm +// VFNMSUB231PS ymm ymm ymm +// VFNMSUB231PS m256 ymm ymm +func VFNMSUB231PS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VFNMSUB231PS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy, xy1}, + Outputs: []operand.Op{xy1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMSUB231PS: bad operands") +} + +// VFNMSUB231SD: Fused Negative Multiply-Subtract of Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB231SD xmm xmm xmm +// VFNMSUB231SD m64 xmm xmm +func VFNMSUB231SD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMSUB231SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMSUB231SD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMSUB231SD: bad operands") +} + +// VFNMSUB231SS: Fused Negative Multiply-Subtract of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VFNMSUB231SS xmm xmm xmm +// VFNMSUB231SS m32 xmm xmm +func VFNMSUB231SS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMSUB231SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VFNMSUB231SS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x, x1}, + Outputs: []operand.Op{x1}, + ISA: []string{"FMA3"}, + }, nil + } + return nil, errors.New("VFNMSUB231SS: bad operands") +} + +// VGATHERDPD: Gather Packed Double-Precision Floating-Point Values Using Signed Doubleword Indices. +// +// Forms: +// +// VGATHERDPD xmm vm32x xmm +// VGATHERDPD ymm vm32x ymm +func VGATHERDPD(xy, v, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(xy) && operand.IsVM32X(v) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VGATHERDPD", + Operands: []operand.Op{xy, v, xy1}, + Inputs: []operand.Op{xy, v, xy1}, + Outputs: []operand.Op{xy, xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsYMM(xy) && operand.IsVM32X(v) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VGATHERDPD", + Operands: []operand.Op{xy, v, xy1}, + Inputs: []operand.Op{xy, v, xy1}, + Outputs: []operand.Op{xy, xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VGATHERDPD: bad operands") +} + +// VGATHERDPS: Gather Packed Single-Precision Floating-Point Values Using Signed Doubleword Indices. +// +// Forms: +// +// VGATHERDPS xmm vm32x xmm +// VGATHERDPS ymm vm32y ymm +func VGATHERDPS(xy, v, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(xy) && operand.IsVM32X(v) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VGATHERDPS", + Operands: []operand.Op{xy, v, xy1}, + Inputs: []operand.Op{xy, v, xy1}, + Outputs: []operand.Op{xy, xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsYMM(xy) && operand.IsVM32Y(v) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VGATHERDPS", + Operands: []operand.Op{xy, v, xy1}, + Inputs: []operand.Op{xy, v, xy1}, + Outputs: []operand.Op{xy, xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VGATHERDPS: bad operands") +} + +// VGATHERQPD: Gather Packed Double-Precision Floating-Point Values Using Signed Quadword Indices. +// +// Forms: +// +// VGATHERQPD xmm vm64x xmm +// VGATHERQPD ymm vm64y ymm +func VGATHERQPD(xy, v, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(xy) && operand.IsVM64X(v) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VGATHERQPD", + Operands: []operand.Op{xy, v, xy1}, + Inputs: []operand.Op{xy, v, xy1}, + Outputs: []operand.Op{xy, xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsYMM(xy) && operand.IsVM64Y(v) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VGATHERQPD", + Operands: []operand.Op{xy, v, xy1}, + Inputs: []operand.Op{xy, v, xy1}, + Outputs: []operand.Op{xy, xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VGATHERQPD: bad operands") +} + +// VGATHERQPS: Gather Packed Single-Precision Floating-Point Values Using Signed Quadword Indices. +// +// Forms: +// +// VGATHERQPS xmm vm64x xmm +// VGATHERQPS xmm vm64y xmm +func VGATHERQPS(x, v, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(x) && operand.IsVM64X(v) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VGATHERQPS", + Operands: []operand.Op{x, v, x1}, + Inputs: []operand.Op{x, v, x1}, + Outputs: []operand.Op{x, x1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsXMM(x) && operand.IsVM64Y(v) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VGATHERQPS", + Operands: []operand.Op{x, v, x1}, + Inputs: []operand.Op{x, v, x1}, + Outputs: []operand.Op{x, x1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VGATHERQPS: bad operands") +} + +// VHADDPD: Packed Double-FP Horizontal Add. +// +// Forms: +// +// VHADDPD xmm xmm xmm +// VHADDPD m128 xmm xmm +// VHADDPD ymm ymm ymm +// VHADDPD m256 ymm ymm +func VHADDPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VHADDPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VHADDPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VHADDPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VHADDPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VHADDPD: bad operands") +} + +// VHADDPS: Packed Single-FP Horizontal Add. +// +// Forms: +// +// VHADDPS xmm xmm xmm +// VHADDPS m128 xmm xmm +// VHADDPS ymm ymm ymm +// VHADDPS m256 ymm ymm +func VHADDPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VHADDPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VHADDPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VHADDPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VHADDPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VHADDPS: bad operands") +} + +// VHSUBPD: Packed Double-FP Horizontal Subtract. +// +// Forms: +// +// VHSUBPD xmm xmm xmm +// VHSUBPD m128 xmm xmm +// VHSUBPD ymm ymm ymm +// VHSUBPD m256 ymm ymm +func VHSUBPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VHSUBPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VHSUBPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VHSUBPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VHSUBPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VHSUBPD: bad operands") +} + +// VHSUBPS: Packed Single-FP Horizontal Subtract. +// +// Forms: +// +// VHSUBPS xmm xmm xmm +// VHSUBPS m128 xmm xmm +// VHSUBPS ymm ymm ymm +// VHSUBPS m256 ymm ymm +func VHSUBPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VHSUBPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VHSUBPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VHSUBPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VHSUBPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VHSUBPS: bad operands") +} + +// VINSERTF128: Insert Packed Floating-Point Values. +// +// Forms: +// +// VINSERTF128 imm8 xmm ymm ymm +// VINSERTF128 imm8 m128 ymm ymm +func VINSERTF128(i, mx, y, y1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsYMM(y) && operand.IsYMM(y1): + return &intrep.Instruction{ + Opcode: "VINSERTF128", + Operands: []operand.Op{i, mx, y, y1}, + Inputs: []operand.Op{mx, y}, + Outputs: []operand.Op{y1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsYMM(y) && operand.IsYMM(y1): + return &intrep.Instruction{ + Opcode: "VINSERTF128", + Operands: []operand.Op{i, mx, y, y1}, + Inputs: []operand.Op{mx, y}, + Outputs: []operand.Op{y1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VINSERTF128: bad operands") +} + +// VINSERTI128: Insert Packed Integer Values. +// +// Forms: +// +// VINSERTI128 imm8 xmm ymm ymm +// VINSERTI128 imm8 m128 ymm ymm +func VINSERTI128(i, mx, y, y1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsYMM(y) && operand.IsYMM(y1): + return &intrep.Instruction{ + Opcode: "VINSERTI128", + Operands: []operand.Op{i, mx, y, y1}, + Inputs: []operand.Op{mx, y}, + Outputs: []operand.Op{y1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsYMM(y) && operand.IsYMM(y1): + return &intrep.Instruction{ + Opcode: "VINSERTI128", + Operands: []operand.Op{i, mx, y, y1}, + Inputs: []operand.Op{mx, y}, + Outputs: []operand.Op{y1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VINSERTI128: bad operands") +} + +// VINSERTPS: Insert Packed Single Precision Floating-Point Value. +// +// Forms: +// +// VINSERTPS imm8 xmm xmm xmm +// VINSERTPS imm8 m32 xmm xmm +func VINSERTPS(i, mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VINSERTPS", + Operands: []operand.Op{i, mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VINSERTPS", + Operands: []operand.Op{i, mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VINSERTPS: bad operands") +} + +// VLDDQU: Load Unaligned Integer 128 Bits. +// +// Forms: +// +// VLDDQU m128 xmm +// VLDDQU m256 ymm +func VLDDQU(m, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM128(m) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VLDDQU", + Operands: []operand.Op{m, xy}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(m) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VLDDQU", + Operands: []operand.Op{m, xy}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VLDDQU: bad operands") +} + +// VLDMXCSR: Load MXCSR Register. +// +// Forms: +// +// VLDMXCSR m32 +func VLDMXCSR(m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM32(m): + return &intrep.Instruction{ + Opcode: "VLDMXCSR", + Operands: []operand.Op{m}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VLDMXCSR: bad operands") +} + +// VMASKMOVDQU: Store Selected Bytes of Double Quadword. +// +// Forms: +// +// VMASKMOVDQU xmm xmm +func VMASKMOVDQU(x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VMASKMOVDQU", + Operands: []operand.Op{x, x1}, + Inputs: []operand.Op{x, x1, reg.RDI}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMASKMOVDQU: bad operands") +} + +// VMASKMOVPD: Conditional Move Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMASKMOVPD m128 xmm xmm +// VMASKMOVPD m256 ymm ymm +// VMASKMOVPD xmm xmm m128 +// VMASKMOVPD ymm ymm m256 +func VMASKMOVPD(mxy, xy, mxy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMASKMOVPD", + Operands: []operand.Op{mxy, xy, mxy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMASKMOVPD", + Operands: []operand.Op{mxy, xy, mxy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsM128(mxy1): + return &intrep.Instruction{ + Opcode: "VMASKMOVPD", + Operands: []operand.Op{mxy, xy, mxy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsM256(mxy1): + return &intrep.Instruction{ + Opcode: "VMASKMOVPD", + Operands: []operand.Op{mxy, xy, mxy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMASKMOVPD: bad operands") +} + +// VMASKMOVPS: Conditional Move Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMASKMOVPS m128 xmm xmm +// VMASKMOVPS m256 ymm ymm +// VMASKMOVPS xmm xmm m128 +// VMASKMOVPS ymm ymm m256 +func VMASKMOVPS(mxy, xy, mxy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMASKMOVPS", + Operands: []operand.Op{mxy, xy, mxy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMASKMOVPS", + Operands: []operand.Op{mxy, xy, mxy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsM128(mxy1): + return &intrep.Instruction{ + Opcode: "VMASKMOVPS", + Operands: []operand.Op{mxy, xy, mxy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsM256(mxy1): + return &intrep.Instruction{ + Opcode: "VMASKMOVPS", + Operands: []operand.Op{mxy, xy, mxy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMASKMOVPS: bad operands") +} + +// VMAXPD: Return Maximum Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMAXPD xmm xmm xmm +// VMAXPD m128 xmm xmm +// VMAXPD ymm ymm ymm +// VMAXPD m256 ymm ymm +func VMAXPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VMAXPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VMAXPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VMAXPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VMAXPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMAXPD: bad operands") +} + +// VMAXPS: Return Maximum Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMAXPS xmm xmm xmm +// VMAXPS m128 xmm xmm +// VMAXPS ymm ymm ymm +// VMAXPS m256 ymm ymm +func VMAXPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VMAXPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VMAXPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VMAXPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VMAXPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMAXPS: bad operands") +} + +// VMAXSD: Return Maximum Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// VMAXSD xmm xmm xmm +// VMAXSD m64 xmm xmm +func VMAXSD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VMAXSD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VMAXSD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMAXSD: bad operands") +} + +// VMAXSS: Return Maximum Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// VMAXSS xmm xmm xmm +// VMAXSS m32 xmm xmm +func VMAXSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VMAXSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VMAXSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMAXSS: bad operands") +} + +// VMINPD: Return Minimum Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMINPD xmm xmm xmm +// VMINPD m128 xmm xmm +// VMINPD ymm ymm ymm +// VMINPD m256 ymm ymm +func VMINPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VMINPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VMINPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VMINPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VMINPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMINPD: bad operands") +} + +// VMINPS: Return Minimum Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMINPS xmm xmm xmm +// VMINPS m128 xmm xmm +// VMINPS ymm ymm ymm +// VMINPS m256 ymm ymm +func VMINPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VMINPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VMINPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VMINPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VMINPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMINPS: bad operands") +} + +// VMINSD: Return Minimum Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// VMINSD xmm xmm xmm +// VMINSD m64 xmm xmm +func VMINSD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VMINSD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VMINSD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMINSD: bad operands") +} + +// VMINSS: Return Minimum Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// VMINSS xmm xmm xmm +// VMINSS m32 xmm xmm +func VMINSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VMINSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VMINSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMINSS: bad operands") +} + +// VMOVAPD: Move Aligned Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMOVAPD xmm xmm +// VMOVAPD m128 xmm +// VMOVAPD ymm ymm +// VMOVAPD m256 ymm +// VMOVAPD xmm m128 +// VMOVAPD ymm m256 +func VMOVAPD(mxy, mxy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVAPD", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVAPD", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVAPD", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVAPD", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mxy) && operand.IsM128(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVAPD", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsM256(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVAPD", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVAPD: bad operands") +} + +// VMOVAPS: Move Aligned Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMOVAPS xmm xmm +// VMOVAPS m128 xmm +// VMOVAPS ymm ymm +// VMOVAPS m256 ymm +// VMOVAPS xmm m128 +// VMOVAPS ymm m256 +func VMOVAPS(mxy, mxy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVAPS", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVAPS", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVAPS", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVAPS", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mxy) && operand.IsM128(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVAPS", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsM256(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVAPS", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVAPS: bad operands") +} + +// VMOVD: Move Doubleword. +// +// Forms: +// +// VMOVD xmm r32 +// VMOVD r32 xmm +// VMOVD m32 xmm +// VMOVD xmm m32 +func VMOVD(mrx, mrx1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mrx) && operand.IsR32(mrx1): + return &intrep.Instruction{ + Opcode: "VMOVD", + Operands: []operand.Op{mrx, mrx1}, + Inputs: []operand.Op{mrx}, + Outputs: []operand.Op{mrx1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsR32(mrx) && operand.IsXMM(mrx1): + return &intrep.Instruction{ + Opcode: "VMOVD", + Operands: []operand.Op{mrx, mrx1}, + Inputs: []operand.Op{mrx}, + Outputs: []operand.Op{mrx1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mrx) && operand.IsXMM(mrx1): + return &intrep.Instruction{ + Opcode: "VMOVD", + Operands: []operand.Op{mrx, mrx1}, + Inputs: []operand.Op{mrx}, + Outputs: []operand.Op{mrx1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mrx) && operand.IsM32(mrx1): + return &intrep.Instruction{ + Opcode: "VMOVD", + Operands: []operand.Op{mrx, mrx1}, + Inputs: []operand.Op{mrx}, + Outputs: []operand.Op{mrx1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVD: bad operands") +} + +// VMOVDDUP: Move One Double-FP and Duplicate. +// +// Forms: +// +// VMOVDDUP xmm xmm +// VMOVDDUP m64 xmm +// VMOVDDUP ymm ymm +// VMOVDDUP m256 ymm +func VMOVDDUP(mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VMOVDDUP", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VMOVDDUP", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VMOVDDUP", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VMOVDDUP", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVDDUP: bad operands") +} + +// VMOVDQA: Move Aligned Double Quadword. +// +// Forms: +// +// VMOVDQA xmm xmm +// VMOVDQA m128 xmm +// VMOVDQA ymm ymm +// VMOVDQA m256 ymm +// VMOVDQA xmm m128 +// VMOVDQA ymm m256 +func VMOVDQA(mxy, mxy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVDQA", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVDQA", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVDQA", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVDQA", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mxy) && operand.IsM128(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVDQA", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsM256(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVDQA", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVDQA: bad operands") +} + +// VMOVDQU: Move Unaligned Double Quadword. +// +// Forms: +// +// VMOVDQU xmm xmm +// VMOVDQU m128 xmm +// VMOVDQU ymm ymm +// VMOVDQU m256 ymm +// VMOVDQU xmm m128 +// VMOVDQU ymm m256 +func VMOVDQU(mxy, mxy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVDQU", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVDQU", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVDQU", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVDQU", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mxy) && operand.IsM128(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVDQU", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsM256(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVDQU", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVDQU: bad operands") +} + +// VMOVHLPS: Move Packed Single-Precision Floating-Point Values High to Low. +// +// Forms: +// +// VMOVHLPS xmm xmm xmm +func VMOVHLPS(x, x1, x2 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(x) && operand.IsXMM(x1) && operand.IsXMM(x2): + return &intrep.Instruction{ + Opcode: "VMOVHLPS", + Operands: []operand.Op{x, x1, x2}, + Inputs: []operand.Op{x, x1}, + Outputs: []operand.Op{x2}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVHLPS: bad operands") +} + +// VMOVHPD: Move High Packed Double-Precision Floating-Point Value. +// +// Forms: +// +// VMOVHPD xmm m64 +// VMOVHPD m64 xmm xmm +func VMOVHPD(ops ...operand.Op) (*intrep.Instruction, error) { + switch { + case len(ops) == 2 && operand.IsXMM(ops[0]) && operand.IsM64(ops[1]): + return &intrep.Instruction{ + Opcode: "VMOVHPD", + Operands: ops, + Inputs: []operand.Op{ops[0]}, + Outputs: []operand.Op{ops[1]}, + ISA: []string{"AVX"}, + }, nil + case len(ops) == 3 && operand.IsM64(ops[0]) && operand.IsXMM(ops[1]) && operand.IsXMM(ops[2]): + return &intrep.Instruction{ + Opcode: "VMOVHPD", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[2]}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVHPD: bad operands") +} + +// VMOVHPS: Move High Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMOVHPS xmm m64 +// VMOVHPS m64 xmm xmm +func VMOVHPS(ops ...operand.Op) (*intrep.Instruction, error) { + switch { + case len(ops) == 2 && operand.IsXMM(ops[0]) && operand.IsM64(ops[1]): + return &intrep.Instruction{ + Opcode: "VMOVHPS", + Operands: ops, + Inputs: []operand.Op{ops[0]}, + Outputs: []operand.Op{ops[1]}, + ISA: []string{"AVX"}, + }, nil + case len(ops) == 3 && operand.IsM64(ops[0]) && operand.IsXMM(ops[1]) && operand.IsXMM(ops[2]): + return &intrep.Instruction{ + Opcode: "VMOVHPS", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[2]}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVHPS: bad operands") +} + +// VMOVLHPS: Move Packed Single-Precision Floating-Point Values Low to High. +// +// Forms: +// +// VMOVLHPS xmm xmm xmm +func VMOVLHPS(x, x1, x2 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(x) && operand.IsXMM(x1) && operand.IsXMM(x2): + return &intrep.Instruction{ + Opcode: "VMOVLHPS", + Operands: []operand.Op{x, x1, x2}, + Inputs: []operand.Op{x, x1}, + Outputs: []operand.Op{x2}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVLHPS: bad operands") +} + +// VMOVLPD: Move Low Packed Double-Precision Floating-Point Value. +// +// Forms: +// +// VMOVLPD xmm m64 +// VMOVLPD m64 xmm xmm +func VMOVLPD(ops ...operand.Op) (*intrep.Instruction, error) { + switch { + case len(ops) == 2 && operand.IsXMM(ops[0]) && operand.IsM64(ops[1]): + return &intrep.Instruction{ + Opcode: "VMOVLPD", + Operands: ops, + Inputs: []operand.Op{ops[0]}, + Outputs: []operand.Op{ops[1]}, + ISA: []string{"AVX"}, + }, nil + case len(ops) == 3 && operand.IsM64(ops[0]) && operand.IsXMM(ops[1]) && operand.IsXMM(ops[2]): + return &intrep.Instruction{ + Opcode: "VMOVLPD", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[2]}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVLPD: bad operands") +} + +// VMOVLPS: Move Low Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMOVLPS xmm m64 +// VMOVLPS m64 xmm xmm +func VMOVLPS(ops ...operand.Op) (*intrep.Instruction, error) { + switch { + case len(ops) == 2 && operand.IsXMM(ops[0]) && operand.IsM64(ops[1]): + return &intrep.Instruction{ + Opcode: "VMOVLPS", + Operands: ops, + Inputs: []operand.Op{ops[0]}, + Outputs: []operand.Op{ops[1]}, + ISA: []string{"AVX"}, + }, nil + case len(ops) == 3 && operand.IsM64(ops[0]) && operand.IsXMM(ops[1]) && operand.IsXMM(ops[2]): + return &intrep.Instruction{ + Opcode: "VMOVLPS", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[2]}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVLPS: bad operands") +} + +// VMOVMSKPD: Extract Packed Double-Precision Floating-Point Sign Mask. +// +// Forms: +// +// VMOVMSKPD xmm r32 +// VMOVMSKPD ymm r32 +func VMOVMSKPD(xy, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(xy) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "VMOVMSKPD", + Operands: []operand.Op{xy, r}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(xy) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "VMOVMSKPD", + Operands: []operand.Op{xy, r}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVMSKPD: bad operands") +} + +// VMOVMSKPS: Extract Packed Single-Precision Floating-Point Sign Mask. +// +// Forms: +// +// VMOVMSKPS xmm r32 +// VMOVMSKPS ymm r32 +func VMOVMSKPS(xy, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(xy) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "VMOVMSKPS", + Operands: []operand.Op{xy, r}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(xy) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "VMOVMSKPS", + Operands: []operand.Op{xy, r}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVMSKPS: bad operands") +} + +// VMOVNTDQ: Store Double Quadword Using Non-Temporal Hint. +// +// Forms: +// +// VMOVNTDQ xmm m128 +// VMOVNTDQ ymm m256 +func VMOVNTDQ(xy, m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(xy) && operand.IsM128(m): + return &intrep.Instruction{ + Opcode: "VMOVNTDQ", + Operands: []operand.Op{xy, m}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{m}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(xy) && operand.IsM256(m): + return &intrep.Instruction{ + Opcode: "VMOVNTDQ", + Operands: []operand.Op{xy, m}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{m}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVNTDQ: bad operands") +} + +// VMOVNTDQA: Load Double Quadword Non-Temporal Aligned Hint. +// +// Forms: +// +// VMOVNTDQA m128 xmm +// VMOVNTDQA m256 ymm +func VMOVNTDQA(m, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM128(m) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VMOVNTDQA", + Operands: []operand.Op{m, xy}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(m) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VMOVNTDQA", + Operands: []operand.Op{m, xy}, + Inputs: []operand.Op{m}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VMOVNTDQA: bad operands") +} + +// VMOVNTPD: Store Packed Double-Precision Floating-Point Values Using Non-Temporal Hint. +// +// Forms: +// +// VMOVNTPD xmm m128 +// VMOVNTPD ymm m256 +func VMOVNTPD(xy, m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(xy) && operand.IsM128(m): + return &intrep.Instruction{ + Opcode: "VMOVNTPD", + Operands: []operand.Op{xy, m}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{m}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(xy) && operand.IsM256(m): + return &intrep.Instruction{ + Opcode: "VMOVNTPD", + Operands: []operand.Op{xy, m}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{m}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVNTPD: bad operands") +} + +// VMOVNTPS: Store Packed Single-Precision Floating-Point Values Using Non-Temporal Hint. +// +// Forms: +// +// VMOVNTPS xmm m128 +// VMOVNTPS ymm m256 +func VMOVNTPS(xy, m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(xy) && operand.IsM128(m): + return &intrep.Instruction{ + Opcode: "VMOVNTPS", + Operands: []operand.Op{xy, m}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{m}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(xy) && operand.IsM256(m): + return &intrep.Instruction{ + Opcode: "VMOVNTPS", + Operands: []operand.Op{xy, m}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{m}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVNTPS: bad operands") +} + +// VMOVQ: Move Quadword. +// +// Forms: +// +// VMOVQ xmm r64 +// VMOVQ r64 xmm +// VMOVQ xmm xmm +// VMOVQ m64 xmm +// VMOVQ xmm m64 +func VMOVQ(mrx, mrx1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mrx) && operand.IsR64(mrx1): + return &intrep.Instruction{ + Opcode: "VMOVQ", + Operands: []operand.Op{mrx, mrx1}, + Inputs: []operand.Op{mrx}, + Outputs: []operand.Op{mrx1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsR64(mrx) && operand.IsXMM(mrx1): + return &intrep.Instruction{ + Opcode: "VMOVQ", + Operands: []operand.Op{mrx, mrx1}, + Inputs: []operand.Op{mrx}, + Outputs: []operand.Op{mrx1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mrx) && operand.IsXMM(mrx1): + return &intrep.Instruction{ + Opcode: "VMOVQ", + Operands: []operand.Op{mrx, mrx1}, + Inputs: []operand.Op{mrx}, + Outputs: []operand.Op{mrx1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mrx) && operand.IsXMM(mrx1): + return &intrep.Instruction{ + Opcode: "VMOVQ", + Operands: []operand.Op{mrx, mrx1}, + Inputs: []operand.Op{mrx}, + Outputs: []operand.Op{mrx1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mrx) && operand.IsM64(mrx1): + return &intrep.Instruction{ + Opcode: "VMOVQ", + Operands: []operand.Op{mrx, mrx1}, + Inputs: []operand.Op{mrx}, + Outputs: []operand.Op{mrx1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVQ: bad operands") +} + +// VMOVSD: Move Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// VMOVSD m64 xmm +// VMOVSD xmm m64 +// VMOVSD xmm xmm xmm +func VMOVSD(ops ...operand.Op) (*intrep.Instruction, error) { + switch { + case len(ops) == 2 && operand.IsM64(ops[0]) && operand.IsXMM(ops[1]): + return &intrep.Instruction{ + Opcode: "VMOVSD", + Operands: ops, + Inputs: []operand.Op{ops[0]}, + Outputs: []operand.Op{ops[1]}, + ISA: []string{"AVX"}, + }, nil + case len(ops) == 2 && operand.IsXMM(ops[0]) && operand.IsM64(ops[1]): + return &intrep.Instruction{ + Opcode: "VMOVSD", + Operands: ops, + Inputs: []operand.Op{ops[0]}, + Outputs: []operand.Op{ops[1]}, + ISA: []string{"AVX"}, + }, nil + case len(ops) == 3 && operand.IsXMM(ops[0]) && operand.IsXMM(ops[1]) && operand.IsXMM(ops[2]): + return &intrep.Instruction{ + Opcode: "VMOVSD", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[2]}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVSD: bad operands") +} + +// VMOVSHDUP: Move Packed Single-FP High and Duplicate. +// +// Forms: +// +// VMOVSHDUP xmm xmm +// VMOVSHDUP m128 xmm +// VMOVSHDUP ymm ymm +// VMOVSHDUP m256 ymm +func VMOVSHDUP(mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VMOVSHDUP", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VMOVSHDUP", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VMOVSHDUP", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VMOVSHDUP", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVSHDUP: bad operands") +} + +// VMOVSLDUP: Move Packed Single-FP Low and Duplicate. +// +// Forms: +// +// VMOVSLDUP xmm xmm +// VMOVSLDUP m128 xmm +// VMOVSLDUP ymm ymm +// VMOVSLDUP m256 ymm +func VMOVSLDUP(mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VMOVSLDUP", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VMOVSLDUP", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VMOVSLDUP", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VMOVSLDUP", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVSLDUP: bad operands") +} + +// VMOVSS: Move Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VMOVSS m32 xmm +// VMOVSS xmm m32 +// VMOVSS xmm xmm xmm +func VMOVSS(ops ...operand.Op) (*intrep.Instruction, error) { + switch { + case len(ops) == 2 && operand.IsM32(ops[0]) && operand.IsXMM(ops[1]): + return &intrep.Instruction{ + Opcode: "VMOVSS", + Operands: ops, + Inputs: []operand.Op{ops[0]}, + Outputs: []operand.Op{ops[1]}, + ISA: []string{"AVX"}, + }, nil + case len(ops) == 2 && operand.IsXMM(ops[0]) && operand.IsM32(ops[1]): + return &intrep.Instruction{ + Opcode: "VMOVSS", + Operands: ops, + Inputs: []operand.Op{ops[0]}, + Outputs: []operand.Op{ops[1]}, + ISA: []string{"AVX"}, + }, nil + case len(ops) == 3 && operand.IsXMM(ops[0]) && operand.IsXMM(ops[1]) && operand.IsXMM(ops[2]): + return &intrep.Instruction{ + Opcode: "VMOVSS", + Operands: ops, + Inputs: []operand.Op{ops[0], ops[1]}, + Outputs: []operand.Op{ops[2]}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVSS: bad operands") +} + +// VMOVUPD: Move Unaligned Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMOVUPD xmm xmm +// VMOVUPD m128 xmm +// VMOVUPD ymm ymm +// VMOVUPD m256 ymm +// VMOVUPD xmm m128 +// VMOVUPD ymm m256 +func VMOVUPD(mxy, mxy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVUPD", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVUPD", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVUPD", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVUPD", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mxy) && operand.IsM128(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVUPD", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsM256(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVUPD", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVUPD: bad operands") +} + +// VMOVUPS: Move Unaligned Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMOVUPS xmm xmm +// VMOVUPS m128 xmm +// VMOVUPS ymm ymm +// VMOVUPS m256 ymm +// VMOVUPS xmm m128 +// VMOVUPS ymm m256 +func VMOVUPS(mxy, mxy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVUPS", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVUPS", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVUPS", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVUPS", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mxy) && operand.IsM128(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVUPS", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsM256(mxy1): + return &intrep.Instruction{ + Opcode: "VMOVUPS", + Operands: []operand.Op{mxy, mxy1}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMOVUPS: bad operands") +} + +// VMPSADBW: Compute Multiple Packed Sums of Absolute Difference. +// +// Forms: +// +// VMPSADBW imm8 xmm xmm xmm +// VMPSADBW imm8 m128 xmm xmm +// VMPSADBW imm8 ymm ymm ymm +// VMPSADBW imm8 m256 ymm ymm +func VMPSADBW(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VMPSADBW", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VMPSADBW", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VMPSADBW", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VMPSADBW", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VMPSADBW: bad operands") +} + +// VMULPD: Multiply Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VMULPD xmm xmm xmm +// VMULPD m128 xmm xmm +// VMULPD ymm ymm ymm +// VMULPD m256 ymm ymm +func VMULPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VMULPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VMULPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VMULPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VMULPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMULPD: bad operands") +} + +// VMULPS: Multiply Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VMULPS xmm xmm xmm +// VMULPS m128 xmm xmm +// VMULPS ymm ymm ymm +// VMULPS m256 ymm ymm +func VMULPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VMULPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VMULPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VMULPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VMULPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMULPS: bad operands") +} + +// VMULSD: Multiply Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VMULSD xmm xmm xmm +// VMULSD m64 xmm xmm +func VMULSD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VMULSD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VMULSD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMULSD: bad operands") +} + +// VMULSS: Multiply Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VMULSS xmm xmm xmm +// VMULSS m32 xmm xmm +func VMULSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VMULSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VMULSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VMULSS: bad operands") +} + +// VORPD: Bitwise Logical OR of Double-Precision Floating-Point Values. +// +// Forms: +// +// VORPD xmm xmm xmm +// VORPD m128 xmm xmm +// VORPD ymm ymm ymm +// VORPD m256 ymm ymm +func VORPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VORPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VORPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VORPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VORPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VORPD: bad operands") +} + +// VORPS: Bitwise Logical OR of Single-Precision Floating-Point Values. +// +// Forms: +// +// VORPS xmm xmm xmm +// VORPS m128 xmm xmm +// VORPS ymm ymm ymm +// VORPS m256 ymm ymm +func VORPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VORPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VORPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VORPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VORPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VORPS: bad operands") +} + +// VPABSB: Packed Absolute Value of Byte Integers. +// +// Forms: +// +// VPABSB xmm xmm +// VPABSB m128 xmm +// VPABSB ymm ymm +// VPABSB m256 ymm +func VPABSB(mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPABSB", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPABSB", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPABSB", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPABSB", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPABSB: bad operands") +} + +// VPABSD: Packed Absolute Value of Doubleword Integers. +// +// Forms: +// +// VPABSD xmm xmm +// VPABSD m128 xmm +// VPABSD ymm ymm +// VPABSD m256 ymm +func VPABSD(mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPABSD", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPABSD", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPABSD", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPABSD", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPABSD: bad operands") +} + +// VPABSW: Packed Absolute Value of Word Integers. +// +// Forms: +// +// VPABSW xmm xmm +// VPABSW m128 xmm +// VPABSW ymm ymm +// VPABSW m256 ymm +func VPABSW(mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPABSW", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPABSW", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPABSW", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPABSW", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPABSW: bad operands") +} + +// VPACKSSDW: Pack Doublewords into Words with Signed Saturation. +// +// Forms: +// +// VPACKSSDW xmm xmm xmm +// VPACKSSDW m128 xmm xmm +// VPACKSSDW ymm ymm ymm +// VPACKSSDW m256 ymm ymm +func VPACKSSDW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPACKSSDW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPACKSSDW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPACKSSDW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPACKSSDW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPACKSSDW: bad operands") +} + +// VPACKSSWB: Pack Words into Bytes with Signed Saturation. +// +// Forms: +// +// VPACKSSWB xmm xmm xmm +// VPACKSSWB m128 xmm xmm +// VPACKSSWB ymm ymm ymm +// VPACKSSWB m256 ymm ymm +func VPACKSSWB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPACKSSWB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPACKSSWB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPACKSSWB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPACKSSWB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPACKSSWB: bad operands") +} + +// VPACKUSDW: Pack Doublewords into Words with Unsigned Saturation. +// +// Forms: +// +// VPACKUSDW xmm xmm xmm +// VPACKUSDW m128 xmm xmm +// VPACKUSDW ymm ymm ymm +// VPACKUSDW m256 ymm ymm +func VPACKUSDW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPACKUSDW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPACKUSDW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPACKUSDW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPACKUSDW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPACKUSDW: bad operands") +} + +// VPACKUSWB: Pack Words into Bytes with Unsigned Saturation. +// +// Forms: +// +// VPACKUSWB xmm xmm xmm +// VPACKUSWB m128 xmm xmm +// VPACKUSWB ymm ymm ymm +// VPACKUSWB m256 ymm ymm +func VPACKUSWB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPACKUSWB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPACKUSWB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPACKUSWB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPACKUSWB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPACKUSWB: bad operands") +} + +// VPADDB: Add Packed Byte Integers. +// +// Forms: +// +// VPADDB xmm xmm xmm +// VPADDB m128 xmm xmm +// VPADDB ymm ymm ymm +// VPADDB m256 ymm ymm +func VPADDB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPADDB: bad operands") +} + +// VPADDD: Add Packed Doubleword Integers. +// +// Forms: +// +// VPADDD xmm xmm xmm +// VPADDD m128 xmm xmm +// VPADDD ymm ymm ymm +// VPADDD m256 ymm ymm +func VPADDD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPADDD: bad operands") +} + +// VPADDQ: Add Packed Quadword Integers. +// +// Forms: +// +// VPADDQ xmm xmm xmm +// VPADDQ m128 xmm xmm +// VPADDQ ymm ymm ymm +// VPADDQ m256 ymm ymm +func VPADDQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPADDQ: bad operands") +} + +// VPADDSB: Add Packed Signed Byte Integers with Signed Saturation. +// +// Forms: +// +// VPADDSB xmm xmm xmm +// VPADDSB m128 xmm xmm +// VPADDSB ymm ymm ymm +// VPADDSB m256 ymm ymm +func VPADDSB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPADDSB: bad operands") +} + +// VPADDSW: Add Packed Signed Word Integers with Signed Saturation. +// +// Forms: +// +// VPADDSW xmm xmm xmm +// VPADDSW m128 xmm xmm +// VPADDSW ymm ymm ymm +// VPADDSW m256 ymm ymm +func VPADDSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPADDSW: bad operands") +} + +// VPADDUSB: Add Packed Unsigned Byte Integers with Unsigned Saturation. +// +// Forms: +// +// VPADDUSB xmm xmm xmm +// VPADDUSB m128 xmm xmm +// VPADDUSB ymm ymm ymm +// VPADDUSB m256 ymm ymm +func VPADDUSB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDUSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDUSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDUSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDUSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPADDUSB: bad operands") +} + +// VPADDUSW: Add Packed Unsigned Word Integers with Unsigned Saturation. +// +// Forms: +// +// VPADDUSW xmm xmm xmm +// VPADDUSW m128 xmm xmm +// VPADDUSW ymm ymm ymm +// VPADDUSW m256 ymm ymm +func VPADDUSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDUSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDUSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDUSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDUSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPADDUSW: bad operands") +} + +// VPADDW: Add Packed Word Integers. +// +// Forms: +// +// VPADDW xmm xmm xmm +// VPADDW m128 xmm xmm +// VPADDW ymm ymm ymm +// VPADDW m256 ymm ymm +func VPADDW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPADDW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPADDW: bad operands") +} + +// VPALIGNR: Packed Align Right. +// +// Forms: +// +// VPALIGNR imm8 xmm xmm xmm +// VPALIGNR imm8 m128 xmm xmm +// VPALIGNR imm8 ymm ymm ymm +// VPALIGNR imm8 m256 ymm ymm +func VPALIGNR(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPALIGNR", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPALIGNR", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPALIGNR", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPALIGNR", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPALIGNR: bad operands") +} + +// VPAND: Packed Bitwise Logical AND. +// +// Forms: +// +// VPAND xmm xmm xmm +// VPAND m128 xmm xmm +// VPAND ymm ymm ymm +// VPAND m256 ymm ymm +func VPAND(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPAND", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPAND", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPAND", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPAND", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPAND: bad operands") +} + +// VPANDN: Packed Bitwise Logical AND NOT. +// +// Forms: +// +// VPANDN xmm xmm xmm +// VPANDN m128 xmm xmm +// VPANDN ymm ymm ymm +// VPANDN m256 ymm ymm +func VPANDN(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPANDN", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPANDN", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPANDN", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPANDN", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPANDN: bad operands") +} + +// VPAVGB: Average Packed Byte Integers. +// +// Forms: +// +// VPAVGB xmm xmm xmm +// VPAVGB m128 xmm xmm +// VPAVGB ymm ymm ymm +// VPAVGB m256 ymm ymm +func VPAVGB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPAVGB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPAVGB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPAVGB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPAVGB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPAVGB: bad operands") +} + +// VPAVGW: Average Packed Word Integers. +// +// Forms: +// +// VPAVGW xmm xmm xmm +// VPAVGW m128 xmm xmm +// VPAVGW ymm ymm ymm +// VPAVGW m256 ymm ymm +func VPAVGW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPAVGW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPAVGW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPAVGW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPAVGW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPAVGW: bad operands") +} + +// VPBLENDD: Blend Packed Doublewords. +// +// Forms: +// +// VPBLENDD imm8 xmm xmm xmm +// VPBLENDD imm8 m128 xmm xmm +// VPBLENDD imm8 ymm ymm ymm +// VPBLENDD imm8 m256 ymm ymm +func VPBLENDD(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPBLENDD", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPBLENDD", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPBLENDD", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPBLENDD", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPBLENDD: bad operands") +} + +// VPBLENDVB: Variable Blend Packed Bytes. +// +// Forms: +// +// VPBLENDVB xmm xmm xmm xmm +// VPBLENDVB xmm m128 xmm xmm +// VPBLENDVB ymm ymm ymm ymm +// VPBLENDVB ymm m256 ymm ymm +func VPBLENDVB(xy, mxy, xy1, xy2 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(xy) && operand.IsXMM(mxy) && operand.IsXMM(xy1) && operand.IsXMM(xy2): + return &intrep.Instruction{ + Opcode: "VPBLENDVB", + Operands: []operand.Op{xy, mxy, xy1, xy2}, + Inputs: []operand.Op{xy, mxy, xy1}, + Outputs: []operand.Op{xy2}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(xy) && operand.IsM128(mxy) && operand.IsXMM(xy1) && operand.IsXMM(xy2): + return &intrep.Instruction{ + Opcode: "VPBLENDVB", + Operands: []operand.Op{xy, mxy, xy1, xy2}, + Inputs: []operand.Op{xy, mxy, xy1}, + Outputs: []operand.Op{xy2}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(xy) && operand.IsYMM(mxy) && operand.IsYMM(xy1) && operand.IsYMM(xy2): + return &intrep.Instruction{ + Opcode: "VPBLENDVB", + Operands: []operand.Op{xy, mxy, xy1, xy2}, + Inputs: []operand.Op{xy, mxy, xy1}, + Outputs: []operand.Op{xy2}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsYMM(xy) && operand.IsM256(mxy) && operand.IsYMM(xy1) && operand.IsYMM(xy2): + return &intrep.Instruction{ + Opcode: "VPBLENDVB", + Operands: []operand.Op{xy, mxy, xy1, xy2}, + Inputs: []operand.Op{xy, mxy, xy1}, + Outputs: []operand.Op{xy2}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPBLENDVB: bad operands") +} + +// VPBLENDW: Blend Packed Words. +// +// Forms: +// +// VPBLENDW imm8 xmm xmm xmm +// VPBLENDW imm8 m128 xmm xmm +// VPBLENDW imm8 ymm ymm ymm +// VPBLENDW imm8 m256 ymm ymm +func VPBLENDW(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPBLENDW", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPBLENDW", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPBLENDW", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPBLENDW", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPBLENDW: bad operands") +} + +// VPBROADCASTB: Broadcast Byte Integer. +// +// Forms: +// +// VPBROADCASTB xmm xmm +// VPBROADCASTB m8 xmm +// VPBROADCASTB xmm ymm +// VPBROADCASTB m8 ymm +func VPBROADCASTB(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPBROADCASTB", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM8(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPBROADCASTB", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPBROADCASTB", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM8(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPBROADCASTB", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPBROADCASTB: bad operands") +} + +// VPBROADCASTD: Broadcast Doubleword Integer. +// +// Forms: +// +// VPBROADCASTD xmm xmm +// VPBROADCASTD m32 xmm +// VPBROADCASTD xmm ymm +// VPBROADCASTD m32 ymm +func VPBROADCASTD(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPBROADCASTD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPBROADCASTD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPBROADCASTD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM32(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPBROADCASTD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPBROADCASTD: bad operands") +} + +// VPBROADCASTQ: Broadcast Quadword Integer. +// +// Forms: +// +// VPBROADCASTQ xmm xmm +// VPBROADCASTQ m64 xmm +// VPBROADCASTQ xmm ymm +// VPBROADCASTQ m64 ymm +func VPBROADCASTQ(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPBROADCASTQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPBROADCASTQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPBROADCASTQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM64(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPBROADCASTQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPBROADCASTQ: bad operands") +} + +// VPBROADCASTW: Broadcast Word Integer. +// +// Forms: +// +// VPBROADCASTW xmm xmm +// VPBROADCASTW m16 xmm +// VPBROADCASTW xmm ymm +// VPBROADCASTW m16 ymm +func VPBROADCASTW(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPBROADCASTW", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM16(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPBROADCASTW", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPBROADCASTW", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM16(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPBROADCASTW", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPBROADCASTW: bad operands") +} + +// VPCLMULQDQ: Carry-Less Quadword Multiplication. +// +// Forms: +// +// VPCLMULQDQ imm8 xmm xmm xmm +// VPCLMULQDQ imm8 m128 xmm xmm +func VPCLMULQDQ(i, mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VPCLMULQDQ", + Operands: []operand.Op{i, mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX", "PCLMULQDQ"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VPCLMULQDQ", + Operands: []operand.Op{i, mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX", "PCLMULQDQ"}, + }, nil + } + return nil, errors.New("VPCLMULQDQ: bad operands") +} + +// VPCMPEQB: Compare Packed Byte Data for Equality. +// +// Forms: +// +// VPCMPEQB xmm xmm xmm +// VPCMPEQB m128 xmm xmm +// VPCMPEQB ymm ymm ymm +// VPCMPEQB m256 ymm ymm +func VPCMPEQB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPEQB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPEQB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPEQB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPEQB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPCMPEQB: bad operands") +} + +// VPCMPEQD: Compare Packed Doubleword Data for Equality. +// +// Forms: +// +// VPCMPEQD xmm xmm xmm +// VPCMPEQD m128 xmm xmm +// VPCMPEQD ymm ymm ymm +// VPCMPEQD m256 ymm ymm +func VPCMPEQD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPEQD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPEQD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPEQD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPEQD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPCMPEQD: bad operands") +} + +// VPCMPEQQ: Compare Packed Quadword Data for Equality. +// +// Forms: +// +// VPCMPEQQ xmm xmm xmm +// VPCMPEQQ m128 xmm xmm +// VPCMPEQQ ymm ymm ymm +// VPCMPEQQ m256 ymm ymm +func VPCMPEQQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPEQQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPEQQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPEQQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPEQQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPCMPEQQ: bad operands") +} + +// VPCMPEQW: Compare Packed Word Data for Equality. +// +// Forms: +// +// VPCMPEQW xmm xmm xmm +// VPCMPEQW m128 xmm xmm +// VPCMPEQW ymm ymm ymm +// VPCMPEQW m256 ymm ymm +func VPCMPEQW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPEQW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPEQW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPEQW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPEQW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPCMPEQW: bad operands") +} + +// VPCMPESTRI: Packed Compare Explicit Length Strings, Return Index. +// +// Forms: +// +// VPCMPESTRI imm8 xmm xmm +// VPCMPESTRI imm8 m128 xmm +func VPCMPESTRI(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VPCMPESTRI", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x, reg.EAX, reg.EDX}, + Outputs: []operand.Op{reg.ECX}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VPCMPESTRI", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x, reg.EAX, reg.EDX}, + Outputs: []operand.Op{reg.ECX}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VPCMPESTRI: bad operands") +} + +// VPCMPESTRM: Packed Compare Explicit Length Strings, Return Mask. +// +// Forms: +// +// VPCMPESTRM imm8 xmm xmm +// VPCMPESTRM imm8 m128 xmm +func VPCMPESTRM(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VPCMPESTRM", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x, reg.EAX, reg.EDX}, + Outputs: []operand.Op{reg.X0}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VPCMPESTRM", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x, reg.EAX, reg.EDX}, + Outputs: []operand.Op{reg.X0}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VPCMPESTRM: bad operands") +} + +// VPCMPGTB: Compare Packed Signed Byte Integers for Greater Than. +// +// Forms: +// +// VPCMPGTB xmm xmm xmm +// VPCMPGTB m128 xmm xmm +// VPCMPGTB ymm ymm ymm +// VPCMPGTB m256 ymm ymm +func VPCMPGTB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPGTB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPGTB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPGTB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPGTB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPCMPGTB: bad operands") +} + +// VPCMPGTD: Compare Packed Signed Doubleword Integers for Greater Than. +// +// Forms: +// +// VPCMPGTD xmm xmm xmm +// VPCMPGTD m128 xmm xmm +// VPCMPGTD ymm ymm ymm +// VPCMPGTD m256 ymm ymm +func VPCMPGTD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPGTD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPGTD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPGTD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPGTD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPCMPGTD: bad operands") +} + +// VPCMPGTQ: Compare Packed Data for Greater Than. +// +// Forms: +// +// VPCMPGTQ xmm xmm xmm +// VPCMPGTQ m128 xmm xmm +// VPCMPGTQ ymm ymm ymm +// VPCMPGTQ m256 ymm ymm +func VPCMPGTQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPGTQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPGTQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPGTQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPGTQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPCMPGTQ: bad operands") +} + +// VPCMPGTW: Compare Packed Signed Word Integers for Greater Than. +// +// Forms: +// +// VPCMPGTW xmm xmm xmm +// VPCMPGTW m128 xmm xmm +// VPCMPGTW ymm ymm ymm +// VPCMPGTW m256 ymm ymm +func VPCMPGTW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPGTW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPGTW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPGTW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPCMPGTW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPCMPGTW: bad operands") +} + +// VPCMPISTRI: Packed Compare Implicit Length Strings, Return Index. +// +// Forms: +// +// VPCMPISTRI imm8 xmm xmm +// VPCMPISTRI imm8 m128 xmm +func VPCMPISTRI(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VPCMPISTRI", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{reg.ECX}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VPCMPISTRI", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{reg.ECX}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VPCMPISTRI: bad operands") +} + +// VPCMPISTRM: Packed Compare Implicit Length Strings, Return Mask. +// +// Forms: +// +// VPCMPISTRM imm8 xmm xmm +// VPCMPISTRM imm8 m128 xmm +func VPCMPISTRM(i, mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VPCMPISTRM", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{reg.X0}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VPCMPISTRM", + Operands: []operand.Op{i, mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{reg.X0}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VPCMPISTRM: bad operands") +} + +// VPERM2F128: Permute Floating-Point Values. +// +// Forms: +// +// VPERM2F128 imm8 ymm ymm ymm +// VPERM2F128 imm8 m256 ymm ymm +func VPERM2F128(i, my, y, y1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsYMM(my) && operand.IsYMM(y) && operand.IsYMM(y1): + return &intrep.Instruction{ + Opcode: "VPERM2F128", + Operands: []operand.Op{i, my, y, y1}, + Inputs: []operand.Op{my, y}, + Outputs: []operand.Op{y1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(my) && operand.IsYMM(y) && operand.IsYMM(y1): + return &intrep.Instruction{ + Opcode: "VPERM2F128", + Operands: []operand.Op{i, my, y, y1}, + Inputs: []operand.Op{my, y}, + Outputs: []operand.Op{y1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VPERM2F128: bad operands") +} + +// VPERM2I128: Permute 128-Bit Integer Values. +// +// Forms: +// +// VPERM2I128 imm8 ymm ymm ymm +// VPERM2I128 imm8 m256 ymm ymm +func VPERM2I128(i, my, y, y1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsYMM(my) && operand.IsYMM(y) && operand.IsYMM(y1): + return &intrep.Instruction{ + Opcode: "VPERM2I128", + Operands: []operand.Op{i, my, y, y1}, + Inputs: []operand.Op{my, y}, + Outputs: []operand.Op{y1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(my) && operand.IsYMM(y) && operand.IsYMM(y1): + return &intrep.Instruction{ + Opcode: "VPERM2I128", + Operands: []operand.Op{i, my, y, y1}, + Inputs: []operand.Op{my, y}, + Outputs: []operand.Op{y1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPERM2I128: bad operands") +} + +// VPERMD: Permute Doubleword Integers. +// +// Forms: +// +// VPERMD ymm ymm ymm +// VPERMD m256 ymm ymm +func VPERMD(my, y, y1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsYMM(my) && operand.IsYMM(y) && operand.IsYMM(y1): + return &intrep.Instruction{ + Opcode: "VPERMD", + Operands: []operand.Op{my, y, y1}, + Inputs: []operand.Op{my, y}, + Outputs: []operand.Op{y1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(my) && operand.IsYMM(y) && operand.IsYMM(y1): + return &intrep.Instruction{ + Opcode: "VPERMD", + Operands: []operand.Op{my, y, y1}, + Inputs: []operand.Op{my, y}, + Outputs: []operand.Op{y1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPERMD: bad operands") +} + +// VPERMILPD: Permute Double-Precision Floating-Point Values. +// +// Forms: +// +// VPERMILPD imm8 xmm xmm +// VPERMILPD xmm xmm xmm +// VPERMILPD m128 xmm xmm +// VPERMILPD imm8 m128 xmm +// VPERMILPD imm8 ymm ymm +// VPERMILPD ymm ymm ymm +// VPERMILPD m256 ymm ymm +// VPERMILPD imm8 m256 ymm +func VPERMILPD(imxy, mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imxy) && operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPERMILPD", + Operands: []operand.Op{imxy, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(imxy) && operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPERMILPD", + Operands: []operand.Op{imxy, mxy, xy}, + Inputs: []operand.Op{imxy, mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(imxy) && operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPERMILPD", + Operands: []operand.Op{imxy, mxy, xy}, + Inputs: []operand.Op{imxy, mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(imxy) && operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPERMILPD", + Operands: []operand.Op{imxy, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(imxy) && operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPERMILPD", + Operands: []operand.Op{imxy, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(imxy) && operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPERMILPD", + Operands: []operand.Op{imxy, mxy, xy}, + Inputs: []operand.Op{imxy, mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(imxy) && operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPERMILPD", + Operands: []operand.Op{imxy, mxy, xy}, + Inputs: []operand.Op{imxy, mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(imxy) && operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPERMILPD", + Operands: []operand.Op{imxy, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VPERMILPD: bad operands") +} + +// VPERMILPS: Permute Single-Precision Floating-Point Values. +// +// Forms: +// +// VPERMILPS imm8 xmm xmm +// VPERMILPS xmm xmm xmm +// VPERMILPS m128 xmm xmm +// VPERMILPS imm8 m128 xmm +// VPERMILPS imm8 ymm ymm +// VPERMILPS ymm ymm ymm +// VPERMILPS m256 ymm ymm +// VPERMILPS imm8 m256 ymm +func VPERMILPS(imxy, mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imxy) && operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPERMILPS", + Operands: []operand.Op{imxy, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(imxy) && operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPERMILPS", + Operands: []operand.Op{imxy, mxy, xy}, + Inputs: []operand.Op{imxy, mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(imxy) && operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPERMILPS", + Operands: []operand.Op{imxy, mxy, xy}, + Inputs: []operand.Op{imxy, mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(imxy) && operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPERMILPS", + Operands: []operand.Op{imxy, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(imxy) && operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPERMILPS", + Operands: []operand.Op{imxy, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(imxy) && operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPERMILPS", + Operands: []operand.Op{imxy, mxy, xy}, + Inputs: []operand.Op{imxy, mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(imxy) && operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPERMILPS", + Operands: []operand.Op{imxy, mxy, xy}, + Inputs: []operand.Op{imxy, mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(imxy) && operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPERMILPS", + Operands: []operand.Op{imxy, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VPERMILPS: bad operands") +} + +// VPERMPD: Permute Double-Precision Floating-Point Elements. +// +// Forms: +// +// VPERMPD imm8 ymm ymm +// VPERMPD imm8 m256 ymm +func VPERMPD(i, my, y operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsYMM(my) && operand.IsYMM(y): + return &intrep.Instruction{ + Opcode: "VPERMPD", + Operands: []operand.Op{i, my, y}, + Inputs: []operand.Op{my}, + Outputs: []operand.Op{y}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(my) && operand.IsYMM(y): + return &intrep.Instruction{ + Opcode: "VPERMPD", + Operands: []operand.Op{i, my, y}, + Inputs: []operand.Op{my}, + Outputs: []operand.Op{y}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPERMPD: bad operands") +} + +// VPERMPS: Permute Single-Precision Floating-Point Elements. +// +// Forms: +// +// VPERMPS ymm ymm ymm +// VPERMPS m256 ymm ymm +func VPERMPS(my, y, y1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsYMM(my) && operand.IsYMM(y) && operand.IsYMM(y1): + return &intrep.Instruction{ + Opcode: "VPERMPS", + Operands: []operand.Op{my, y, y1}, + Inputs: []operand.Op{my, y}, + Outputs: []operand.Op{y1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(my) && operand.IsYMM(y) && operand.IsYMM(y1): + return &intrep.Instruction{ + Opcode: "VPERMPS", + Operands: []operand.Op{my, y, y1}, + Inputs: []operand.Op{my, y}, + Outputs: []operand.Op{y1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPERMPS: bad operands") +} + +// VPERMQ: Permute Quadword Integers. +// +// Forms: +// +// VPERMQ imm8 ymm ymm +// VPERMQ imm8 m256 ymm +func VPERMQ(i, my, y operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsYMM(my) && operand.IsYMM(y): + return &intrep.Instruction{ + Opcode: "VPERMQ", + Operands: []operand.Op{i, my, y}, + Inputs: []operand.Op{my}, + Outputs: []operand.Op{y}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(my) && operand.IsYMM(y): + return &intrep.Instruction{ + Opcode: "VPERMQ", + Operands: []operand.Op{i, my, y}, + Inputs: []operand.Op{my}, + Outputs: []operand.Op{y}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPERMQ: bad operands") +} + +// VPEXTRB: Extract Byte. +// +// Forms: +// +// VPEXTRB imm8 xmm r32 +// VPEXTRB imm8 xmm m8 +func VPEXTRB(i, x, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "VPEXTRB", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "VPEXTRB", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VPEXTRB: bad operands") +} + +// VPEXTRD: Extract Doubleword. +// +// Forms: +// +// VPEXTRD imm8 xmm r32 +// VPEXTRD imm8 xmm m32 +func VPEXTRD(i, x, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "VPEXTRD", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "VPEXTRD", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VPEXTRD: bad operands") +} + +// VPEXTRQ: Extract Quadword. +// +// Forms: +// +// VPEXTRQ imm8 xmm r64 +// VPEXTRQ imm8 xmm m64 +func VPEXTRQ(i, x, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "VPEXTRQ", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "VPEXTRQ", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VPEXTRQ: bad operands") +} + +// VPEXTRW: Extract Word. +// +// Forms: +// +// VPEXTRW imm8 xmm r32 +// VPEXTRW imm8 xmm m16 +func VPEXTRW(i, x, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "VPEXTRW", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsXMM(x) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "VPEXTRW", + Operands: []operand.Op{i, x, mr}, + Inputs: []operand.Op{x}, + Outputs: []operand.Op{mr}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VPEXTRW: bad operands") +} + +// VPGATHERDD: Gather Packed Doubleword Values Using Signed Doubleword Indices. +// +// Forms: +// +// VPGATHERDD xmm vm32x xmm +// VPGATHERDD ymm vm32y ymm +func VPGATHERDD(xy, v, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(xy) && operand.IsVM32X(v) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPGATHERDD", + Operands: []operand.Op{xy, v, xy1}, + Inputs: []operand.Op{xy, v, xy1}, + Outputs: []operand.Op{xy, xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsYMM(xy) && operand.IsVM32Y(v) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPGATHERDD", + Operands: []operand.Op{xy, v, xy1}, + Inputs: []operand.Op{xy, v, xy1}, + Outputs: []operand.Op{xy, xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPGATHERDD: bad operands") +} + +// VPGATHERDQ: Gather Packed Quadword Values Using Signed Doubleword Indices. +// +// Forms: +// +// VPGATHERDQ xmm vm32x xmm +// VPGATHERDQ ymm vm32x ymm +func VPGATHERDQ(xy, v, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(xy) && operand.IsVM32X(v) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPGATHERDQ", + Operands: []operand.Op{xy, v, xy1}, + Inputs: []operand.Op{xy, v, xy1}, + Outputs: []operand.Op{xy, xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsYMM(xy) && operand.IsVM32X(v) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPGATHERDQ", + Operands: []operand.Op{xy, v, xy1}, + Inputs: []operand.Op{xy, v, xy1}, + Outputs: []operand.Op{xy, xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPGATHERDQ: bad operands") +} + +// VPGATHERQD: Gather Packed Doubleword Values Using Signed Quadword Indices. +// +// Forms: +// +// VPGATHERQD xmm vm64x xmm +// VPGATHERQD xmm vm64y xmm +func VPGATHERQD(x, v, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(x) && operand.IsVM64X(v) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VPGATHERQD", + Operands: []operand.Op{x, v, x1}, + Inputs: []operand.Op{x, v, x1}, + Outputs: []operand.Op{x, x1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsXMM(x) && operand.IsVM64Y(v) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VPGATHERQD", + Operands: []operand.Op{x, v, x1}, + Inputs: []operand.Op{x, v, x1}, + Outputs: []operand.Op{x, x1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPGATHERQD: bad operands") +} + +// VPGATHERQQ: Gather Packed Quadword Values Using Signed Quadword Indices. +// +// Forms: +// +// VPGATHERQQ xmm vm64x xmm +// VPGATHERQQ ymm vm64y ymm +func VPGATHERQQ(xy, v, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(xy) && operand.IsVM64X(v) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPGATHERQQ", + Operands: []operand.Op{xy, v, xy1}, + Inputs: []operand.Op{xy, v, xy1}, + Outputs: []operand.Op{xy, xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsYMM(xy) && operand.IsVM64Y(v) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPGATHERQQ", + Operands: []operand.Op{xy, v, xy1}, + Inputs: []operand.Op{xy, v, xy1}, + Outputs: []operand.Op{xy, xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPGATHERQQ: bad operands") +} + +// VPHADDD: Packed Horizontal Add Doubleword Integer. +// +// Forms: +// +// VPHADDD xmm xmm xmm +// VPHADDD m128 xmm xmm +// VPHADDD ymm ymm ymm +// VPHADDD m256 ymm ymm +func VPHADDD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHADDD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHADDD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHADDD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHADDD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPHADDD: bad operands") +} + +// VPHADDSW: Packed Horizontal Add Signed Word Integers with Signed Saturation. +// +// Forms: +// +// VPHADDSW xmm xmm xmm +// VPHADDSW m128 xmm xmm +// VPHADDSW ymm ymm ymm +// VPHADDSW m256 ymm ymm +func VPHADDSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHADDSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHADDSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHADDSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHADDSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPHADDSW: bad operands") +} + +// VPHADDW: Packed Horizontal Add Word Integers. +// +// Forms: +// +// VPHADDW xmm xmm xmm +// VPHADDW m128 xmm xmm +// VPHADDW ymm ymm ymm +// VPHADDW m256 ymm ymm +func VPHADDW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHADDW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHADDW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHADDW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHADDW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPHADDW: bad operands") +} + +// VPHMINPOSUW: Packed Horizontal Minimum of Unsigned Word Integers. +// +// Forms: +// +// VPHMINPOSUW xmm xmm +// VPHMINPOSUW m128 xmm +func VPHMINPOSUW(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VPHMINPOSUW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VPHMINPOSUW", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{x}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VPHMINPOSUW: bad operands") +} + +// VPHSUBD: Packed Horizontal Subtract Doubleword Integers. +// +// Forms: +// +// VPHSUBD xmm xmm xmm +// VPHSUBD m128 xmm xmm +// VPHSUBD ymm ymm ymm +// VPHSUBD m256 ymm ymm +func VPHSUBD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHSUBD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHSUBD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHSUBD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHSUBD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPHSUBD: bad operands") +} + +// VPHSUBSW: Packed Horizontal Subtract Signed Word Integers with Signed Saturation. +// +// Forms: +// +// VPHSUBSW xmm xmm xmm +// VPHSUBSW m128 xmm xmm +// VPHSUBSW ymm ymm ymm +// VPHSUBSW m256 ymm ymm +func VPHSUBSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHSUBSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHSUBSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHSUBSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHSUBSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPHSUBSW: bad operands") +} + +// VPHSUBW: Packed Horizontal Subtract Word Integers. +// +// Forms: +// +// VPHSUBW xmm xmm xmm +// VPHSUBW m128 xmm xmm +// VPHSUBW ymm ymm ymm +// VPHSUBW m256 ymm ymm +func VPHSUBW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHSUBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHSUBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHSUBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPHSUBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPHSUBW: bad operands") +} + +// VPINSRB: Insert Byte. +// +// Forms: +// +// VPINSRB imm8 r32 xmm xmm +// VPINSRB imm8 m8 xmm xmm +func VPINSRB(i, mr, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsR32(mr) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VPINSRB", + Operands: []operand.Op{i, mr, x, x1}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM8(mr) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VPINSRB", + Operands: []operand.Op{i, mr, x, x1}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VPINSRB: bad operands") +} + +// VPINSRD: Insert Doubleword. +// +// Forms: +// +// VPINSRD imm8 r32 xmm xmm +// VPINSRD imm8 m32 xmm xmm +func VPINSRD(i, mr, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsR32(mr) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VPINSRD", + Operands: []operand.Op{i, mr, x, x1}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM32(mr) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VPINSRD", + Operands: []operand.Op{i, mr, x, x1}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VPINSRD: bad operands") +} + +// VPINSRQ: Insert Quadword. +// +// Forms: +// +// VPINSRQ imm8 r64 xmm xmm +// VPINSRQ imm8 m64 xmm xmm +func VPINSRQ(i, mr, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsR64(mr) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VPINSRQ", + Operands: []operand.Op{i, mr, x, x1}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM64(mr) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VPINSRQ", + Operands: []operand.Op{i, mr, x, x1}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VPINSRQ: bad operands") +} + +// VPINSRW: Insert Word. +// +// Forms: +// +// VPINSRW imm8 r32 xmm xmm +// VPINSRW imm8 m16 xmm xmm +func VPINSRW(i, mr, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsR32(mr) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VPINSRW", + Operands: []operand.Op{i, mr, x, x1}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM16(mr) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VPINSRW", + Operands: []operand.Op{i, mr, x, x1}, + Inputs: []operand.Op{mr, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VPINSRW: bad operands") +} + +// VPMADDUBSW: Multiply and Add Packed Signed and Unsigned Byte Integers. +// +// Forms: +// +// VPMADDUBSW xmm xmm xmm +// VPMADDUBSW m128 xmm xmm +// VPMADDUBSW ymm ymm ymm +// VPMADDUBSW m256 ymm ymm +func VPMADDUBSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMADDUBSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMADDUBSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMADDUBSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMADDUBSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMADDUBSW: bad operands") +} + +// VPMADDWD: Multiply and Add Packed Signed Word Integers. +// +// Forms: +// +// VPMADDWD xmm xmm xmm +// VPMADDWD m128 xmm xmm +// VPMADDWD ymm ymm ymm +// VPMADDWD m256 ymm ymm +func VPMADDWD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMADDWD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMADDWD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMADDWD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMADDWD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMADDWD: bad operands") +} + +// VPMASKMOVD: Conditional Move Packed Doubleword Integers. +// +// Forms: +// +// VPMASKMOVD m128 xmm xmm +// VPMASKMOVD m256 ymm ymm +// VPMASKMOVD xmm xmm m128 +// VPMASKMOVD ymm ymm m256 +func VPMASKMOVD(mxy, xy, mxy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(mxy1): + return &intrep.Instruction{ + Opcode: "VPMASKMOVD", + Operands: []operand.Op{mxy, xy, mxy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(mxy1): + return &intrep.Instruction{ + Opcode: "VPMASKMOVD", + Operands: []operand.Op{mxy, xy, mxy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsM128(mxy1): + return &intrep.Instruction{ + Opcode: "VPMASKMOVD", + Operands: []operand.Op{mxy, xy, mxy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsM256(mxy1): + return &intrep.Instruction{ + Opcode: "VPMASKMOVD", + Operands: []operand.Op{mxy, xy, mxy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMASKMOVD: bad operands") +} + +// VPMASKMOVQ: Conditional Move Packed Quadword Integers. +// +// Forms: +// +// VPMASKMOVQ m128 xmm xmm +// VPMASKMOVQ m256 ymm ymm +// VPMASKMOVQ xmm xmm m128 +// VPMASKMOVQ ymm ymm m256 +func VPMASKMOVQ(mxy, xy, mxy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(mxy1): + return &intrep.Instruction{ + Opcode: "VPMASKMOVQ", + Operands: []operand.Op{mxy, xy, mxy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(mxy1): + return &intrep.Instruction{ + Opcode: "VPMASKMOVQ", + Operands: []operand.Op{mxy, xy, mxy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsM128(mxy1): + return &intrep.Instruction{ + Opcode: "VPMASKMOVQ", + Operands: []operand.Op{mxy, xy, mxy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsM256(mxy1): + return &intrep.Instruction{ + Opcode: "VPMASKMOVQ", + Operands: []operand.Op{mxy, xy, mxy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{mxy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMASKMOVQ: bad operands") +} + +// VPMAXSB: Maximum of Packed Signed Byte Integers. +// +// Forms: +// +// VPMAXSB xmm xmm xmm +// VPMAXSB m128 xmm xmm +// VPMAXSB ymm ymm ymm +// VPMAXSB m256 ymm ymm +func VPMAXSB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMAXSB: bad operands") +} + +// VPMAXSD: Maximum of Packed Signed Doubleword Integers. +// +// Forms: +// +// VPMAXSD xmm xmm xmm +// VPMAXSD m128 xmm xmm +// VPMAXSD ymm ymm ymm +// VPMAXSD m256 ymm ymm +func VPMAXSD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXSD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXSD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXSD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXSD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMAXSD: bad operands") +} + +// VPMAXSW: Maximum of Packed Signed Word Integers. +// +// Forms: +// +// VPMAXSW xmm xmm xmm +// VPMAXSW m128 xmm xmm +// VPMAXSW ymm ymm ymm +// VPMAXSW m256 ymm ymm +func VPMAXSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMAXSW: bad operands") +} + +// VPMAXUB: Maximum of Packed Unsigned Byte Integers. +// +// Forms: +// +// VPMAXUB xmm xmm xmm +// VPMAXUB m128 xmm xmm +// VPMAXUB ymm ymm ymm +// VPMAXUB m256 ymm ymm +func VPMAXUB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXUB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXUB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXUB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXUB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMAXUB: bad operands") +} + +// VPMAXUD: Maximum of Packed Unsigned Doubleword Integers. +// +// Forms: +// +// VPMAXUD xmm xmm xmm +// VPMAXUD m128 xmm xmm +// VPMAXUD ymm ymm ymm +// VPMAXUD m256 ymm ymm +func VPMAXUD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXUD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXUD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXUD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXUD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMAXUD: bad operands") +} + +// VPMAXUW: Maximum of Packed Unsigned Word Integers. +// +// Forms: +// +// VPMAXUW xmm xmm xmm +// VPMAXUW m128 xmm xmm +// VPMAXUW ymm ymm ymm +// VPMAXUW m256 ymm ymm +func VPMAXUW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXUW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXUW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXUW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMAXUW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMAXUW: bad operands") +} + +// VPMINSB: Minimum of Packed Signed Byte Integers. +// +// Forms: +// +// VPMINSB xmm xmm xmm +// VPMINSB m128 xmm xmm +// VPMINSB ymm ymm ymm +// VPMINSB m256 ymm ymm +func VPMINSB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMINSB: bad operands") +} + +// VPMINSD: Minimum of Packed Signed Doubleword Integers. +// +// Forms: +// +// VPMINSD xmm xmm xmm +// VPMINSD m128 xmm xmm +// VPMINSD ymm ymm ymm +// VPMINSD m256 ymm ymm +func VPMINSD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINSD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINSD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINSD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINSD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMINSD: bad operands") +} + +// VPMINSW: Minimum of Packed Signed Word Integers. +// +// Forms: +// +// VPMINSW xmm xmm xmm +// VPMINSW m128 xmm xmm +// VPMINSW ymm ymm ymm +// VPMINSW m256 ymm ymm +func VPMINSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMINSW: bad operands") +} + +// VPMINUB: Minimum of Packed Unsigned Byte Integers. +// +// Forms: +// +// VPMINUB xmm xmm xmm +// VPMINUB m128 xmm xmm +// VPMINUB ymm ymm ymm +// VPMINUB m256 ymm ymm +func VPMINUB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINUB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINUB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINUB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINUB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMINUB: bad operands") +} + +// VPMINUD: Minimum of Packed Unsigned Doubleword Integers. +// +// Forms: +// +// VPMINUD xmm xmm xmm +// VPMINUD m128 xmm xmm +// VPMINUD ymm ymm ymm +// VPMINUD m256 ymm ymm +func VPMINUD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINUD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINUD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINUD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINUD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMINUD: bad operands") +} + +// VPMINUW: Minimum of Packed Unsigned Word Integers. +// +// Forms: +// +// VPMINUW xmm xmm xmm +// VPMINUW m128 xmm xmm +// VPMINUW ymm ymm ymm +// VPMINUW m256 ymm ymm +func VPMINUW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINUW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINUW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINUW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMINUW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMINUW: bad operands") +} + +// VPMOVMSKB: Move Byte Mask. +// +// Forms: +// +// VPMOVMSKB xmm r32 +// VPMOVMSKB ymm r32 +func VPMOVMSKB(xy, r operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(xy) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "VPMOVMSKB", + Operands: []operand.Op{xy, r}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(xy) && operand.IsR32(r): + return &intrep.Instruction{ + Opcode: "VPMOVMSKB", + Operands: []operand.Op{xy, r}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{r}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMOVMSKB: bad operands") +} + +// VPMOVSXBD: Move Packed Byte Integers to Doubleword Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXBD xmm xmm +// VPMOVSXBD m32 xmm +// VPMOVSXBD xmm ymm +// VPMOVSXBD m64 ymm +func VPMOVSXBD(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXBD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXBD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXBD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM64(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXBD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMOVSXBD: bad operands") +} + +// VPMOVSXBQ: Move Packed Byte Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXBQ xmm xmm +// VPMOVSXBQ m16 xmm +// VPMOVSXBQ xmm ymm +// VPMOVSXBQ m32 ymm +func VPMOVSXBQ(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXBQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM16(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXBQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXBQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM32(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXBQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMOVSXBQ: bad operands") +} + +// VPMOVSXBW: Move Packed Byte Integers to Word Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXBW xmm xmm +// VPMOVSXBW m64 xmm +// VPMOVSXBW xmm ymm +// VPMOVSXBW m128 ymm +func VPMOVSXBW(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXBW", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXBW", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXBW", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXBW", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMOVSXBW: bad operands") +} + +// VPMOVSXDQ: Move Packed Doubleword Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXDQ xmm xmm +// VPMOVSXDQ m64 xmm +// VPMOVSXDQ xmm ymm +// VPMOVSXDQ m128 ymm +func VPMOVSXDQ(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXDQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXDQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXDQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXDQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMOVSXDQ: bad operands") +} + +// VPMOVSXWD: Move Packed Word Integers to Doubleword Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXWD xmm xmm +// VPMOVSXWD m64 xmm +// VPMOVSXWD xmm ymm +// VPMOVSXWD m128 ymm +func VPMOVSXWD(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXWD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXWD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXWD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXWD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMOVSXWD: bad operands") +} + +// VPMOVSXWQ: Move Packed Word Integers to Quadword Integers with Sign Extension. +// +// Forms: +// +// VPMOVSXWQ xmm xmm +// VPMOVSXWQ m32 xmm +// VPMOVSXWQ xmm ymm +// VPMOVSXWQ m64 ymm +func VPMOVSXWQ(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXWQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXWQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXWQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM64(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVSXWQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMOVSXWQ: bad operands") +} + +// VPMOVZXBD: Move Packed Byte Integers to Doubleword Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXBD xmm xmm +// VPMOVZXBD m32 xmm +// VPMOVZXBD xmm ymm +// VPMOVZXBD m64 ymm +func VPMOVZXBD(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXBD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXBD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXBD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM64(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXBD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMOVZXBD: bad operands") +} + +// VPMOVZXBQ: Move Packed Byte Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXBQ xmm xmm +// VPMOVZXBQ m16 xmm +// VPMOVZXBQ xmm ymm +// VPMOVZXBQ m32 ymm +func VPMOVZXBQ(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXBQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM16(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXBQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXBQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM32(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXBQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMOVZXBQ: bad operands") +} + +// VPMOVZXBW: Move Packed Byte Integers to Word Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXBW xmm xmm +// VPMOVZXBW m64 xmm +// VPMOVZXBW xmm ymm +// VPMOVZXBW m128 ymm +func VPMOVZXBW(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXBW", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXBW", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXBW", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXBW", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMOVZXBW: bad operands") +} + +// VPMOVZXDQ: Move Packed Doubleword Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXDQ xmm xmm +// VPMOVZXDQ m64 xmm +// VPMOVZXDQ xmm ymm +// VPMOVZXDQ m128 ymm +func VPMOVZXDQ(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXDQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXDQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXDQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXDQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMOVZXDQ: bad operands") +} + +// VPMOVZXWD: Move Packed Word Integers to Doubleword Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXWD xmm xmm +// VPMOVZXWD m64 xmm +// VPMOVZXWD xmm ymm +// VPMOVZXWD m128 ymm +func VPMOVZXWD(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXWD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXWD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXWD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXWD", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMOVZXWD: bad operands") +} + +// VPMOVZXWQ: Move Packed Word Integers to Quadword Integers with Zero Extension. +// +// Forms: +// +// VPMOVZXWQ xmm xmm +// VPMOVZXWQ m32 xmm +// VPMOVZXWQ xmm ymm +// VPMOVZXWQ m64 ymm +func VPMOVZXWQ(mx, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXWQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXWQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXWQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM64(mx) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPMOVZXWQ", + Operands: []operand.Op{mx, xy}, + Inputs: []operand.Op{mx}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMOVZXWQ: bad operands") +} + +// VPMULDQ: Multiply Packed Signed Doubleword Integers and Store Quadword Result. +// +// Forms: +// +// VPMULDQ xmm xmm xmm +// VPMULDQ m128 xmm xmm +// VPMULDQ ymm ymm ymm +// VPMULDQ m256 ymm ymm +func VPMULDQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMULDQ: bad operands") +} + +// VPMULHRSW: Packed Multiply Signed Word Integers and Store High Result with Round and Scale. +// +// Forms: +// +// VPMULHRSW xmm xmm xmm +// VPMULHRSW m128 xmm xmm +// VPMULHRSW ymm ymm ymm +// VPMULHRSW m256 ymm ymm +func VPMULHRSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULHRSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULHRSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULHRSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULHRSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMULHRSW: bad operands") +} + +// VPMULHUW: Multiply Packed Unsigned Word Integers and Store High Result. +// +// Forms: +// +// VPMULHUW xmm xmm xmm +// VPMULHUW m128 xmm xmm +// VPMULHUW ymm ymm ymm +// VPMULHUW m256 ymm ymm +func VPMULHUW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULHUW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULHUW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULHUW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULHUW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMULHUW: bad operands") +} + +// VPMULHW: Multiply Packed Signed Word Integers and Store High Result. +// +// Forms: +// +// VPMULHW xmm xmm xmm +// VPMULHW m128 xmm xmm +// VPMULHW ymm ymm ymm +// VPMULHW m256 ymm ymm +func VPMULHW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULHW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULHW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULHW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULHW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMULHW: bad operands") +} + +// VPMULLD: Multiply Packed Signed Doubleword Integers and Store Low Result. +// +// Forms: +// +// VPMULLD xmm xmm xmm +// VPMULLD m128 xmm xmm +// VPMULLD ymm ymm ymm +// VPMULLD m256 ymm ymm +func VPMULLD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULLD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULLD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULLD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULLD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMULLD: bad operands") +} + +// VPMULLW: Multiply Packed Signed Word Integers and Store Low Result. +// +// Forms: +// +// VPMULLW xmm xmm xmm +// VPMULLW m128 xmm xmm +// VPMULLW ymm ymm ymm +// VPMULLW m256 ymm ymm +func VPMULLW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULLW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULLW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULLW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULLW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMULLW: bad operands") +} + +// VPMULUDQ: Multiply Packed Unsigned Doubleword Integers. +// +// Forms: +// +// VPMULUDQ xmm xmm xmm +// VPMULUDQ m128 xmm xmm +// VPMULUDQ ymm ymm ymm +// VPMULUDQ m256 ymm ymm +func VPMULUDQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULUDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULUDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULUDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPMULUDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPMULUDQ: bad operands") +} + +// VPOR: Packed Bitwise Logical OR. +// +// Forms: +// +// VPOR xmm xmm xmm +// VPOR m128 xmm xmm +// VPOR ymm ymm ymm +// VPOR m256 ymm ymm +func VPOR(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPOR", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPOR", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPOR", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPOR", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPOR: bad operands") +} + +// VPSADBW: Compute Sum of Absolute Differences. +// +// Forms: +// +// VPSADBW xmm xmm xmm +// VPSADBW m128 xmm xmm +// VPSADBW ymm ymm ymm +// VPSADBW m256 ymm ymm +func VPSADBW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSADBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSADBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSADBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSADBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSADBW: bad operands") +} + +// VPSHUFB: Packed Shuffle Bytes. +// +// Forms: +// +// VPSHUFB xmm xmm xmm +// VPSHUFB m128 xmm xmm +// VPSHUFB ymm ymm ymm +// VPSHUFB m256 ymm ymm +func VPSHUFB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSHUFB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSHUFB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSHUFB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSHUFB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSHUFB: bad operands") +} + +// VPSHUFD: Shuffle Packed Doublewords. +// +// Forms: +// +// VPSHUFD imm8 xmm xmm +// VPSHUFD imm8 m128 xmm +// VPSHUFD imm8 ymm ymm +// VPSHUFD imm8 m256 ymm +func VPSHUFD(i, mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPSHUFD", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPSHUFD", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPSHUFD", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPSHUFD", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSHUFD: bad operands") +} + +// VPSHUFHW: Shuffle Packed High Words. +// +// Forms: +// +// VPSHUFHW imm8 xmm xmm +// VPSHUFHW imm8 m128 xmm +// VPSHUFHW imm8 ymm ymm +// VPSHUFHW imm8 m256 ymm +func VPSHUFHW(i, mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPSHUFHW", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPSHUFHW", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPSHUFHW", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPSHUFHW", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSHUFHW: bad operands") +} + +// VPSHUFLW: Shuffle Packed Low Words. +// +// Forms: +// +// VPSHUFLW imm8 xmm xmm +// VPSHUFLW imm8 m128 xmm +// VPSHUFLW imm8 ymm ymm +// VPSHUFLW imm8 m256 ymm +func VPSHUFLW(i, mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPSHUFLW", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPSHUFLW", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPSHUFLW", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPSHUFLW", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSHUFLW: bad operands") +} + +// VPSIGNB: Packed Sign of Byte Integers. +// +// Forms: +// +// VPSIGNB xmm xmm xmm +// VPSIGNB m128 xmm xmm +// VPSIGNB ymm ymm ymm +// VPSIGNB m256 ymm ymm +func VPSIGNB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSIGNB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSIGNB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSIGNB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSIGNB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSIGNB: bad operands") +} + +// VPSIGND: Packed Sign of Doubleword Integers. +// +// Forms: +// +// VPSIGND xmm xmm xmm +// VPSIGND m128 xmm xmm +// VPSIGND ymm ymm ymm +// VPSIGND m256 ymm ymm +func VPSIGND(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSIGND", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSIGND", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSIGND", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSIGND", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSIGND: bad operands") +} + +// VPSIGNW: Packed Sign of Word Integers. +// +// Forms: +// +// VPSIGNW xmm xmm xmm +// VPSIGNW m128 xmm xmm +// VPSIGNW ymm ymm ymm +// VPSIGNW m256 ymm ymm +func VPSIGNW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSIGNW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSIGNW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSIGNW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSIGNW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSIGNW: bad operands") +} + +// VPSLLD: Shift Packed Doubleword Data Left Logical. +// +// Forms: +// +// VPSLLD imm8 xmm xmm +// VPSLLD xmm xmm xmm +// VPSLLD m128 xmm xmm +// VPSLLD imm8 ymm ymm +// VPSLLD xmm ymm ymm +// VPSLLD m128 ymm ymm +func VPSLLD(imx, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsXMM(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSLLD: bad operands") +} + +// VPSLLDQ: Shift Packed Double Quadword Left Logical. +// +// Forms: +// +// VPSLLDQ imm8 xmm xmm +// VPSLLDQ imm8 ymm ymm +func VPSLLDQ(i, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLDQ", + Operands: []operand.Op{i, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLDQ", + Operands: []operand.Op{i, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSLLDQ: bad operands") +} + +// VPSLLQ: Shift Packed Quadword Data Left Logical. +// +// Forms: +// +// VPSLLQ imm8 xmm xmm +// VPSLLQ xmm xmm xmm +// VPSLLQ m128 xmm xmm +// VPSLLQ imm8 ymm ymm +// VPSLLQ xmm ymm ymm +// VPSLLQ m128 ymm ymm +func VPSLLQ(imx, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLQ", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLQ", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLQ", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLQ", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsXMM(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLQ", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLQ", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSLLQ: bad operands") +} + +// VPSLLVD: Variable Shift Packed Doubleword Data Left Logical. +// +// Forms: +// +// VPSLLVD xmm xmm xmm +// VPSLLVD m128 xmm xmm +// VPSLLVD ymm ymm ymm +// VPSLLVD m256 ymm ymm +func VPSLLVD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLVD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLVD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLVD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLVD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSLLVD: bad operands") +} + +// VPSLLVQ: Variable Shift Packed Quadword Data Left Logical. +// +// Forms: +// +// VPSLLVQ xmm xmm xmm +// VPSLLVQ m128 xmm xmm +// VPSLLVQ ymm ymm ymm +// VPSLLVQ m256 ymm ymm +func VPSLLVQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLVQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLVQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLVQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLVQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSLLVQ: bad operands") +} + +// VPSLLW: Shift Packed Word Data Left Logical. +// +// Forms: +// +// VPSLLW imm8 xmm xmm +// VPSLLW xmm xmm xmm +// VPSLLW m128 xmm xmm +// VPSLLW imm8 ymm ymm +// VPSLLW xmm ymm ymm +// VPSLLW m128 ymm ymm +func VPSLLW(imx, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsXMM(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSLLW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSLLW: bad operands") +} + +// VPSRAD: Shift Packed Doubleword Data Right Arithmetic. +// +// Forms: +// +// VPSRAD imm8 xmm xmm +// VPSRAD xmm xmm xmm +// VPSRAD m128 xmm xmm +// VPSRAD imm8 ymm ymm +// VPSRAD xmm ymm ymm +// VPSRAD m128 ymm ymm +func VPSRAD(imx, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRAD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRAD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRAD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRAD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsXMM(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRAD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRAD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSRAD: bad operands") +} + +// VPSRAVD: Variable Shift Packed Doubleword Data Right Arithmetic. +// +// Forms: +// +// VPSRAVD xmm xmm xmm +// VPSRAVD m128 xmm xmm +// VPSRAVD ymm ymm ymm +// VPSRAVD m256 ymm ymm +func VPSRAVD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRAVD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRAVD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRAVD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRAVD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSRAVD: bad operands") +} + +// VPSRAW: Shift Packed Word Data Right Arithmetic. +// +// Forms: +// +// VPSRAW imm8 xmm xmm +// VPSRAW xmm xmm xmm +// VPSRAW m128 xmm xmm +// VPSRAW imm8 ymm ymm +// VPSRAW xmm ymm ymm +// VPSRAW m128 ymm ymm +func VPSRAW(imx, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRAW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRAW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRAW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRAW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsXMM(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRAW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRAW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSRAW: bad operands") +} + +// VPSRLD: Shift Packed Doubleword Data Right Logical. +// +// Forms: +// +// VPSRLD imm8 xmm xmm +// VPSRLD xmm xmm xmm +// VPSRLD m128 xmm xmm +// VPSRLD imm8 ymm ymm +// VPSRLD xmm ymm ymm +// VPSRLD m128 ymm ymm +func VPSRLD(imx, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsXMM(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLD", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSRLD: bad operands") +} + +// VPSRLDQ: Shift Packed Double Quadword Right Logical. +// +// Forms: +// +// VPSRLDQ imm8 xmm xmm +// VPSRLDQ imm8 ymm ymm +func VPSRLDQ(i, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLDQ", + Operands: []operand.Op{i, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLDQ", + Operands: []operand.Op{i, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSRLDQ: bad operands") +} + +// VPSRLQ: Shift Packed Quadword Data Right Logical. +// +// Forms: +// +// VPSRLQ imm8 xmm xmm +// VPSRLQ xmm xmm xmm +// VPSRLQ m128 xmm xmm +// VPSRLQ imm8 ymm ymm +// VPSRLQ xmm ymm ymm +// VPSRLQ m128 ymm ymm +func VPSRLQ(imx, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLQ", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLQ", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLQ", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLQ", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsXMM(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLQ", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLQ", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSRLQ: bad operands") +} + +// VPSRLVD: Variable Shift Packed Doubleword Data Right Logical. +// +// Forms: +// +// VPSRLVD xmm xmm xmm +// VPSRLVD m128 xmm xmm +// VPSRLVD ymm ymm ymm +// VPSRLVD m256 ymm ymm +func VPSRLVD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLVD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLVD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLVD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLVD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSRLVD: bad operands") +} + +// VPSRLVQ: Variable Shift Packed Quadword Data Right Logical. +// +// Forms: +// +// VPSRLVQ xmm xmm xmm +// VPSRLVQ m128 xmm xmm +// VPSRLVQ ymm ymm ymm +// VPSRLVQ m256 ymm ymm +func VPSRLVQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLVQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLVQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLVQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLVQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSRLVQ: bad operands") +} + +// VPSRLW: Shift Packed Word Data Right Logical. +// +// Forms: +// +// VPSRLW imm8 xmm xmm +// VPSRLW xmm xmm xmm +// VPSRLW m128 xmm xmm +// VPSRLW imm8 ymm ymm +// VPSRLW xmm ymm ymm +// VPSRLW m128 ymm ymm +func VPSRLW(imx, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsXMM(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(imx) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsXMM(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM128(imx) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSRLW", + Operands: []operand.Op{imx, xy, xy1}, + Inputs: []operand.Op{imx, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSRLW: bad operands") +} + +// VPSUBB: Subtract Packed Byte Integers. +// +// Forms: +// +// VPSUBB xmm xmm xmm +// VPSUBB m128 xmm xmm +// VPSUBB ymm ymm ymm +// VPSUBB m256 ymm ymm +func VPSUBB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSUBB: bad operands") +} + +// VPSUBD: Subtract Packed Doubleword Integers. +// +// Forms: +// +// VPSUBD xmm xmm xmm +// VPSUBD m128 xmm xmm +// VPSUBD ymm ymm ymm +// VPSUBD m256 ymm ymm +func VPSUBD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSUBD: bad operands") +} + +// VPSUBQ: Subtract Packed Quadword Integers. +// +// Forms: +// +// VPSUBQ xmm xmm xmm +// VPSUBQ m128 xmm xmm +// VPSUBQ ymm ymm ymm +// VPSUBQ m256 ymm ymm +func VPSUBQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSUBQ: bad operands") +} + +// VPSUBSB: Subtract Packed Signed Byte Integers with Signed Saturation. +// +// Forms: +// +// VPSUBSB xmm xmm xmm +// VPSUBSB m128 xmm xmm +// VPSUBSB ymm ymm ymm +// VPSUBSB m256 ymm ymm +func VPSUBSB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSUBSB: bad operands") +} + +// VPSUBSW: Subtract Packed Signed Word Integers with Signed Saturation. +// +// Forms: +// +// VPSUBSW xmm xmm xmm +// VPSUBSW m128 xmm xmm +// VPSUBSW ymm ymm ymm +// VPSUBSW m256 ymm ymm +func VPSUBSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSUBSW: bad operands") +} + +// VPSUBUSB: Subtract Packed Unsigned Byte Integers with Unsigned Saturation. +// +// Forms: +// +// VPSUBUSB xmm xmm xmm +// VPSUBUSB m128 xmm xmm +// VPSUBUSB ymm ymm ymm +// VPSUBUSB m256 ymm ymm +func VPSUBUSB(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBUSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBUSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBUSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBUSB", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSUBUSB: bad operands") +} + +// VPSUBUSW: Subtract Packed Unsigned Word Integers with Unsigned Saturation. +// +// Forms: +// +// VPSUBUSW xmm xmm xmm +// VPSUBUSW m128 xmm xmm +// VPSUBUSW ymm ymm ymm +// VPSUBUSW m256 ymm ymm +func VPSUBUSW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBUSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBUSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBUSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBUSW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSUBUSW: bad operands") +} + +// VPSUBW: Subtract Packed Word Integers. +// +// Forms: +// +// VPSUBW xmm xmm xmm +// VPSUBW m128 xmm xmm +// VPSUBW ymm ymm ymm +// VPSUBW m256 ymm ymm +func VPSUBW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPSUBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPSUBW: bad operands") +} + +// VPTEST: Packed Logical Compare. +// +// Forms: +// +// VPTEST xmm xmm +// VPTEST m128 xmm +// VPTEST ymm ymm +// VPTEST m256 ymm +func VPTEST(mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPTEST", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VPTEST", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPTEST", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VPTEST", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VPTEST: bad operands") +} + +// VPUNPCKHBW: Unpack and Interleave High-Order Bytes into Words. +// +// Forms: +// +// VPUNPCKHBW xmm xmm xmm +// VPUNPCKHBW m128 xmm xmm +// VPUNPCKHBW ymm ymm ymm +// VPUNPCKHBW m256 ymm ymm +func VPUNPCKHBW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKHBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKHBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKHBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKHBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPUNPCKHBW: bad operands") +} + +// VPUNPCKHDQ: Unpack and Interleave High-Order Doublewords into Quadwords. +// +// Forms: +// +// VPUNPCKHDQ xmm xmm xmm +// VPUNPCKHDQ m128 xmm xmm +// VPUNPCKHDQ ymm ymm ymm +// VPUNPCKHDQ m256 ymm ymm +func VPUNPCKHDQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKHDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKHDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKHDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKHDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPUNPCKHDQ: bad operands") +} + +// VPUNPCKHQDQ: Unpack and Interleave High-Order Quadwords into Double Quadwords. +// +// Forms: +// +// VPUNPCKHQDQ xmm xmm xmm +// VPUNPCKHQDQ m128 xmm xmm +// VPUNPCKHQDQ ymm ymm ymm +// VPUNPCKHQDQ m256 ymm ymm +func VPUNPCKHQDQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKHQDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKHQDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKHQDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKHQDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPUNPCKHQDQ: bad operands") +} + +// VPUNPCKHWD: Unpack and Interleave High-Order Words into Doublewords. +// +// Forms: +// +// VPUNPCKHWD xmm xmm xmm +// VPUNPCKHWD m128 xmm xmm +// VPUNPCKHWD ymm ymm ymm +// VPUNPCKHWD m256 ymm ymm +func VPUNPCKHWD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKHWD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKHWD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKHWD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKHWD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPUNPCKHWD: bad operands") +} + +// VPUNPCKLBW: Unpack and Interleave Low-Order Bytes into Words. +// +// Forms: +// +// VPUNPCKLBW xmm xmm xmm +// VPUNPCKLBW m128 xmm xmm +// VPUNPCKLBW ymm ymm ymm +// VPUNPCKLBW m256 ymm ymm +func VPUNPCKLBW(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKLBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKLBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKLBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKLBW", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPUNPCKLBW: bad operands") +} + +// VPUNPCKLDQ: Unpack and Interleave Low-Order Doublewords into Quadwords. +// +// Forms: +// +// VPUNPCKLDQ xmm xmm xmm +// VPUNPCKLDQ m128 xmm xmm +// VPUNPCKLDQ ymm ymm ymm +// VPUNPCKLDQ m256 ymm ymm +func VPUNPCKLDQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKLDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKLDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKLDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKLDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPUNPCKLDQ: bad operands") +} + +// VPUNPCKLQDQ: Unpack and Interleave Low-Order Quadwords into Double Quadwords. +// +// Forms: +// +// VPUNPCKLQDQ xmm xmm xmm +// VPUNPCKLQDQ m128 xmm xmm +// VPUNPCKLQDQ ymm ymm ymm +// VPUNPCKLQDQ m256 ymm ymm +func VPUNPCKLQDQ(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKLQDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKLQDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKLQDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKLQDQ", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPUNPCKLQDQ: bad operands") +} + +// VPUNPCKLWD: Unpack and Interleave Low-Order Words into Doublewords. +// +// Forms: +// +// VPUNPCKLWD xmm xmm xmm +// VPUNPCKLWD m128 xmm xmm +// VPUNPCKLWD ymm ymm ymm +// VPUNPCKLWD m256 ymm ymm +func VPUNPCKLWD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKLWD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKLWD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKLWD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPUNPCKLWD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPUNPCKLWD: bad operands") +} + +// VPXOR: Packed Bitwise Logical Exclusive OR. +// +// Forms: +// +// VPXOR xmm xmm xmm +// VPXOR m128 xmm xmm +// VPXOR ymm ymm ymm +// VPXOR m256 ymm ymm +func VPXOR(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPXOR", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VPXOR", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPXOR", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VPXOR", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX2"}, + }, nil + } + return nil, errors.New("VPXOR: bad operands") +} + +// VRCPPS: Compute Approximate Reciprocals of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VRCPPS xmm xmm +// VRCPPS m128 xmm +// VRCPPS ymm ymm +// VRCPPS m256 ymm +func VRCPPS(mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VRCPPS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VRCPPS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VRCPPS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VRCPPS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VRCPPS: bad operands") +} + +// VRCPSS: Compute Approximate Reciprocal of Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VRCPSS xmm xmm xmm +// VRCPSS m32 xmm xmm +func VRCPSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VRCPSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VRCPSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VRCPSS: bad operands") +} + +// VROUNDPD: Round Packed Double Precision Floating-Point Values. +// +// Forms: +// +// VROUNDPD imm8 xmm xmm +// VROUNDPD imm8 m128 xmm +// VROUNDPD imm8 ymm ymm +// VROUNDPD imm8 m256 ymm +func VROUNDPD(i, mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VROUNDPD", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VROUNDPD", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VROUNDPD", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VROUNDPD", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VROUNDPD: bad operands") +} + +// VROUNDPS: Round Packed Single Precision Floating-Point Values. +// +// Forms: +// +// VROUNDPS imm8 xmm xmm +// VROUNDPS imm8 m128 xmm +// VROUNDPS imm8 ymm ymm +// VROUNDPS imm8 m256 ymm +func VROUNDPS(i, mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VROUNDPS", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VROUNDPS", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VROUNDPS", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VROUNDPS", + Operands: []operand.Op{i, mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VROUNDPS: bad operands") +} + +// VROUNDSD: Round Scalar Double Precision Floating-Point Values. +// +// Forms: +// +// VROUNDSD imm8 xmm xmm xmm +// VROUNDSD imm8 m64 xmm xmm +func VROUNDSD(i, mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VROUNDSD", + Operands: []operand.Op{i, mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VROUNDSD", + Operands: []operand.Op{i, mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VROUNDSD: bad operands") +} + +// VROUNDSS: Round Scalar Single Precision Floating-Point Values. +// +// Forms: +// +// VROUNDSS imm8 xmm xmm xmm +// VROUNDSS imm8 m32 xmm xmm +func VROUNDSS(i, mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VROUNDSS", + Operands: []operand.Op{i, mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VROUNDSS", + Operands: []operand.Op{i, mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VROUNDSS: bad operands") +} + +// VRSQRTPS: Compute Reciprocals of Square Roots of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VRSQRTPS xmm xmm +// VRSQRTPS m128 xmm +// VRSQRTPS ymm ymm +// VRSQRTPS m256 ymm +func VRSQRTPS(mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VRSQRTPS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VRSQRTPS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VRSQRTPS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VRSQRTPS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VRSQRTPS: bad operands") +} + +// VRSQRTSS: Compute Reciprocal of Square Root of Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// VRSQRTSS xmm xmm xmm +// VRSQRTSS m32 xmm xmm +func VRSQRTSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VRSQRTSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VRSQRTSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VRSQRTSS: bad operands") +} + +// VSHUFPD: Shuffle Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VSHUFPD imm8 xmm xmm xmm +// VSHUFPD imm8 m128 xmm xmm +// VSHUFPD imm8 ymm ymm ymm +// VSHUFPD imm8 m256 ymm ymm +func VSHUFPD(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VSHUFPD", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VSHUFPD", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VSHUFPD", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VSHUFPD", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VSHUFPD: bad operands") +} + +// VSHUFPS: Shuffle Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VSHUFPS imm8 xmm xmm xmm +// VSHUFPS imm8 m128 xmm xmm +// VSHUFPS imm8 ymm ymm ymm +// VSHUFPS imm8 m256 ymm ymm +func VSHUFPS(i, mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(i) && operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VSHUFPS", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VSHUFPS", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VSHUFPS", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsIMM8(i) && operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VSHUFPS", + Operands: []operand.Op{i, mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VSHUFPS: bad operands") +} + +// VSQRTPD: Compute Square Roots of Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VSQRTPD xmm xmm +// VSQRTPD m128 xmm +// VSQRTPD ymm ymm +// VSQRTPD m256 ymm +func VSQRTPD(mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VSQRTPD", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VSQRTPD", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VSQRTPD", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VSQRTPD", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VSQRTPD: bad operands") +} + +// VSQRTPS: Compute Square Roots of Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VSQRTPS xmm xmm +// VSQRTPS m128 xmm +// VSQRTPS ymm ymm +// VSQRTPS m256 ymm +func VSQRTPS(mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VSQRTPS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VSQRTPS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VSQRTPS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VSQRTPS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy}, + Outputs: []operand.Op{xy}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VSQRTPS: bad operands") +} + +// VSQRTSD: Compute Square Root of Scalar Double-Precision Floating-Point Value. +// +// Forms: +// +// VSQRTSD xmm xmm xmm +// VSQRTSD m64 xmm xmm +func VSQRTSD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VSQRTSD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VSQRTSD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VSQRTSD: bad operands") +} + +// VSQRTSS: Compute Square Root of Scalar Single-Precision Floating-Point Value. +// +// Forms: +// +// VSQRTSS xmm xmm xmm +// VSQRTSS m32 xmm xmm +func VSQRTSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VSQRTSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VSQRTSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VSQRTSS: bad operands") +} + +// VSTMXCSR: Store MXCSR Register State. +// +// Forms: +// +// VSTMXCSR m32 +func VSTMXCSR(m operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsM32(m): + return &intrep.Instruction{ + Opcode: "VSTMXCSR", + Operands: []operand.Op{m}, + Inputs: []operand.Op{}, + Outputs: []operand.Op{m}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VSTMXCSR: bad operands") +} + +// VSUBPD: Subtract Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VSUBPD xmm xmm xmm +// VSUBPD m128 xmm xmm +// VSUBPD ymm ymm ymm +// VSUBPD m256 ymm ymm +func VSUBPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VSUBPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VSUBPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VSUBPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VSUBPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VSUBPD: bad operands") +} + +// VSUBPS: Subtract Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VSUBPS xmm xmm xmm +// VSUBPS m128 xmm xmm +// VSUBPS ymm ymm ymm +// VSUBPS m256 ymm ymm +func VSUBPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VSUBPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VSUBPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VSUBPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VSUBPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VSUBPS: bad operands") +} + +// VSUBSD: Subtract Scalar Double-Precision Floating-Point Values. +// +// Forms: +// +// VSUBSD xmm xmm xmm +// VSUBSD m64 xmm xmm +func VSUBSD(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VSUBSD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VSUBSD", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VSUBSD: bad operands") +} + +// VSUBSS: Subtract Scalar Single-Precision Floating-Point Values. +// +// Forms: +// +// VSUBSS xmm xmm xmm +// VSUBSS m32 xmm xmm +func VSUBSS(mx, x, x1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VSUBSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x) && operand.IsXMM(x1): + return &intrep.Instruction{ + Opcode: "VSUBSS", + Operands: []operand.Op{mx, x, x1}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VSUBSS: bad operands") +} + +// VTESTPD: Packed Double-Precision Floating-Point Bit Test. +// +// Forms: +// +// VTESTPD xmm xmm +// VTESTPD m128 xmm +// VTESTPD ymm ymm +// VTESTPD m256 ymm +func VTESTPD(mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VTESTPD", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VTESTPD", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VTESTPD", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VTESTPD", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VTESTPD: bad operands") +} + +// VTESTPS: Packed Single-Precision Floating-Point Bit Test. +// +// Forms: +// +// VTESTPS xmm xmm +// VTESTPS m128 xmm +// VTESTPS ymm ymm +// VTESTPS m256 ymm +func VTESTPS(mxy, xy operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VTESTPS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy): + return &intrep.Instruction{ + Opcode: "VTESTPS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VTESTPS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy): + return &intrep.Instruction{ + Opcode: "VTESTPS", + Operands: []operand.Op{mxy, xy}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VTESTPS: bad operands") +} + +// VUCOMISD: Unordered Compare Scalar Double-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// VUCOMISD xmm xmm +// VUCOMISD m64 xmm +func VUCOMISD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VUCOMISD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM64(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VUCOMISD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VUCOMISD: bad operands") +} + +// VUCOMISS: Unordered Compare Scalar Single-Precision Floating-Point Values and Set EFLAGS. +// +// Forms: +// +// VUCOMISS xmm xmm +// VUCOMISS m32 xmm +func VUCOMISS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VUCOMISS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM32(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "VUCOMISS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VUCOMISS: bad operands") +} + +// VUNPCKHPD: Unpack and Interleave High Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VUNPCKHPD xmm xmm xmm +// VUNPCKHPD m128 xmm xmm +// VUNPCKHPD ymm ymm ymm +// VUNPCKHPD m256 ymm ymm +func VUNPCKHPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VUNPCKHPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VUNPCKHPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VUNPCKHPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VUNPCKHPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VUNPCKHPD: bad operands") +} + +// VUNPCKHPS: Unpack and Interleave High Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VUNPCKHPS xmm xmm xmm +// VUNPCKHPS m128 xmm xmm +// VUNPCKHPS ymm ymm ymm +// VUNPCKHPS m256 ymm ymm +func VUNPCKHPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VUNPCKHPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VUNPCKHPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VUNPCKHPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VUNPCKHPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VUNPCKHPS: bad operands") +} + +// VUNPCKLPD: Unpack and Interleave Low Packed Double-Precision Floating-Point Values. +// +// Forms: +// +// VUNPCKLPD xmm xmm xmm +// VUNPCKLPD m128 xmm xmm +// VUNPCKLPD ymm ymm ymm +// VUNPCKLPD m256 ymm ymm +func VUNPCKLPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VUNPCKLPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VUNPCKLPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VUNPCKLPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VUNPCKLPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VUNPCKLPD: bad operands") +} + +// VUNPCKLPS: Unpack and Interleave Low Packed Single-Precision Floating-Point Values. +// +// Forms: +// +// VUNPCKLPS xmm xmm xmm +// VUNPCKLPS m128 xmm xmm +// VUNPCKLPS ymm ymm ymm +// VUNPCKLPS m256 ymm ymm +func VUNPCKLPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VUNPCKLPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VUNPCKLPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VUNPCKLPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VUNPCKLPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VUNPCKLPS: bad operands") +} + +// VXORPD: Bitwise Logical XOR for Double-Precision Floating-Point Values. +// +// Forms: +// +// VXORPD xmm xmm xmm +// VXORPD m128 xmm xmm +// VXORPD ymm ymm ymm +// VXORPD m256 ymm ymm +func VXORPD(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VXORPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VXORPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VXORPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VXORPD", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VXORPD: bad operands") +} + +// VXORPS: Bitwise Logical XOR for Single-Precision Floating-Point Values. +// +// Forms: +// +// VXORPS xmm xmm xmm +// VXORPS m128 xmm xmm +// VXORPS ymm ymm ymm +// VXORPS m256 ymm ymm +func VXORPS(mxy, xy, xy1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VXORPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mxy) && operand.IsXMM(xy) && operand.IsXMM(xy1): + return &intrep.Instruction{ + Opcode: "VXORPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + case operand.IsYMM(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VXORPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + CancellingInputs: true, + }, nil + case operand.IsM256(mxy) && operand.IsYMM(xy) && operand.IsYMM(xy1): + return &intrep.Instruction{ + Opcode: "VXORPS", + Operands: []operand.Op{mxy, xy, xy1}, + Inputs: []operand.Op{mxy, xy}, + Outputs: []operand.Op{xy1}, + ISA: []string{"AVX"}, + }, nil + } + return nil, errors.New("VXORPS: bad operands") +} + +// VZEROALL: Zero All YMM Registers. +// +// Forms: +// +// VZEROALL +func VZEROALL() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "VZEROALL", + Operands: nil, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil +} + +// VZEROUPPER: Zero Upper Bits of YMM Registers. +// +// Forms: +// +// VZEROUPPER +func VZEROUPPER() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "VZEROUPPER", + Operands: nil, + Inputs: []operand.Op{}, + Outputs: []operand.Op{}, + ISA: []string{"AVX"}, + }, nil +} + +// XADDB: Exchange and Add. +// +// Forms: +// +// XADDB r8 r8 +// XADDB r8 m8 +func XADDB(r, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(r) && operand.IsR8(mr): + return &intrep.Instruction{ + Opcode: "XADDB", + Operands: []operand.Op{r, mr}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r, mr}, + }, nil + case operand.IsR8(r) && operand.IsM8(mr): + return &intrep.Instruction{ + Opcode: "XADDB", + Operands: []operand.Op{r, mr}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r, mr}, + }, nil + } + return nil, errors.New("XADDB: bad operands") +} + +// XADDL: Exchange and Add. +// +// Forms: +// +// XADDL r32 r32 +// XADDL r32 m32 +func XADDL(r, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(r) && operand.IsR32(mr): + return &intrep.Instruction{ + Opcode: "XADDL", + Operands: []operand.Op{r, mr}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r, mr}, + }, nil + case operand.IsR32(r) && operand.IsM32(mr): + return &intrep.Instruction{ + Opcode: "XADDL", + Operands: []operand.Op{r, mr}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r, mr}, + }, nil + } + return nil, errors.New("XADDL: bad operands") +} + +// XADDQ: Exchange and Add. +// +// Forms: +// +// XADDQ r64 r64 +// XADDQ r64 m64 +func XADDQ(r, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(r) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "XADDQ", + Operands: []operand.Op{r, mr}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r, mr}, + }, nil + case operand.IsR64(r) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "XADDQ", + Operands: []operand.Op{r, mr}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r, mr}, + }, nil + } + return nil, errors.New("XADDQ: bad operands") +} + +// XADDW: Exchange and Add. +// +// Forms: +// +// XADDW r16 r16 +// XADDW r16 m16 +func XADDW(r, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(r) && operand.IsR16(mr): + return &intrep.Instruction{ + Opcode: "XADDW", + Operands: []operand.Op{r, mr}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r, mr}, + }, nil + case operand.IsR16(r) && operand.IsM16(mr): + return &intrep.Instruction{ + Opcode: "XADDW", + Operands: []operand.Op{r, mr}, + Inputs: []operand.Op{r, mr}, + Outputs: []operand.Op{r, mr}, + }, nil + } + return nil, errors.New("XADDW: bad operands") +} + +// XCHGB: Exchange Register/Memory with Register. +// +// Forms: +// +// XCHGB r8 r8 +// XCHGB m8 r8 +// XCHGB r8 m8 +func XCHGB(mr, mr1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR8(mr) && operand.IsR8(mr1): + return &intrep.Instruction{ + Opcode: "XCHGB", + Operands: []operand.Op{mr, mr1}, + Inputs: []operand.Op{mr, mr1}, + Outputs: []operand.Op{mr, mr1}, + }, nil + case operand.IsM8(mr) && operand.IsR8(mr1): + return &intrep.Instruction{ + Opcode: "XCHGB", + Operands: []operand.Op{mr, mr1}, + Inputs: []operand.Op{mr, mr1}, + Outputs: []operand.Op{mr, mr1}, + }, nil + case operand.IsR8(mr) && operand.IsM8(mr1): + return &intrep.Instruction{ + Opcode: "XCHGB", + Operands: []operand.Op{mr, mr1}, + Inputs: []operand.Op{mr, mr1}, + Outputs: []operand.Op{mr, mr1}, + }, nil + } + return nil, errors.New("XCHGB: bad operands") +} + +// XCHGL: Exchange Register/Memory with Register. +// +// Forms: +// +// XCHGL r32 eax +// XCHGL eax r32 +// XCHGL r32 r32 +// XCHGL m32 r32 +// XCHGL r32 m32 +func XCHGL(emr, emr1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR32(emr) && operand.IsEAX(emr1): + return &intrep.Instruction{ + Opcode: "XCHGL", + Operands: []operand.Op{emr, emr1}, + Inputs: []operand.Op{emr, emr1}, + Outputs: []operand.Op{emr, emr1}, + }, nil + case operand.IsEAX(emr) && operand.IsR32(emr1): + return &intrep.Instruction{ + Opcode: "XCHGL", + Operands: []operand.Op{emr, emr1}, + Inputs: []operand.Op{emr, emr1}, + Outputs: []operand.Op{emr, emr1}, + }, nil + case operand.IsR32(emr) && operand.IsR32(emr1): + return &intrep.Instruction{ + Opcode: "XCHGL", + Operands: []operand.Op{emr, emr1}, + Inputs: []operand.Op{emr, emr1}, + Outputs: []operand.Op{emr, emr1}, + }, nil + case operand.IsM32(emr) && operand.IsR32(emr1): + return &intrep.Instruction{ + Opcode: "XCHGL", + Operands: []operand.Op{emr, emr1}, + Inputs: []operand.Op{emr, emr1}, + Outputs: []operand.Op{emr, emr1}, + }, nil + case operand.IsR32(emr) && operand.IsM32(emr1): + return &intrep.Instruction{ + Opcode: "XCHGL", + Operands: []operand.Op{emr, emr1}, + Inputs: []operand.Op{emr, emr1}, + Outputs: []operand.Op{emr, emr1}, + }, nil + } + return nil, errors.New("XCHGL: bad operands") +} + +// XCHGQ: Exchange Register/Memory with Register. +// +// Forms: +// +// XCHGQ r64 rax +// XCHGQ rax r64 +// XCHGQ r64 r64 +// XCHGQ m64 r64 +// XCHGQ r64 m64 +func XCHGQ(mr, mr1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR64(mr) && operand.IsRAX(mr1): + return &intrep.Instruction{ + Opcode: "XCHGQ", + Operands: []operand.Op{mr, mr1}, + Inputs: []operand.Op{mr, mr1}, + Outputs: []operand.Op{mr, mr1}, + }, nil + case operand.IsRAX(mr) && operand.IsR64(mr1): + return &intrep.Instruction{ + Opcode: "XCHGQ", + Operands: []operand.Op{mr, mr1}, + Inputs: []operand.Op{mr, mr1}, + Outputs: []operand.Op{mr, mr1}, + }, nil + case operand.IsR64(mr) && operand.IsR64(mr1): + return &intrep.Instruction{ + Opcode: "XCHGQ", + Operands: []operand.Op{mr, mr1}, + Inputs: []operand.Op{mr, mr1}, + Outputs: []operand.Op{mr, mr1}, + }, nil + case operand.IsM64(mr) && operand.IsR64(mr1): + return &intrep.Instruction{ + Opcode: "XCHGQ", + Operands: []operand.Op{mr, mr1}, + Inputs: []operand.Op{mr, mr1}, + Outputs: []operand.Op{mr, mr1}, + }, nil + case operand.IsR64(mr) && operand.IsM64(mr1): + return &intrep.Instruction{ + Opcode: "XCHGQ", + Operands: []operand.Op{mr, mr1}, + Inputs: []operand.Op{mr, mr1}, + Outputs: []operand.Op{mr, mr1}, + }, nil + } + return nil, errors.New("XCHGQ: bad operands") +} + +// XCHGW: Exchange Register/Memory with Register. +// +// Forms: +// +// XCHGW r16 ax +// XCHGW ax r16 +// XCHGW r16 r16 +// XCHGW m16 r16 +// XCHGW r16 m16 +func XCHGW(amr, amr1 operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsR16(amr) && operand.IsAX(amr1): + return &intrep.Instruction{ + Opcode: "XCHGW", + Operands: []operand.Op{amr, amr1}, + Inputs: []operand.Op{amr, amr1}, + Outputs: []operand.Op{amr, amr1}, + }, nil + case operand.IsAX(amr) && operand.IsR16(amr1): + return &intrep.Instruction{ + Opcode: "XCHGW", + Operands: []operand.Op{amr, amr1}, + Inputs: []operand.Op{amr, amr1}, + Outputs: []operand.Op{amr, amr1}, + }, nil + case operand.IsR16(amr) && operand.IsR16(amr1): + return &intrep.Instruction{ + Opcode: "XCHGW", + Operands: []operand.Op{amr, amr1}, + Inputs: []operand.Op{amr, amr1}, + Outputs: []operand.Op{amr, amr1}, + }, nil + case operand.IsM16(amr) && operand.IsR16(amr1): + return &intrep.Instruction{ + Opcode: "XCHGW", + Operands: []operand.Op{amr, amr1}, + Inputs: []operand.Op{amr, amr1}, + Outputs: []operand.Op{amr, amr1}, + }, nil + case operand.IsR16(amr) && operand.IsM16(amr1): + return &intrep.Instruction{ + Opcode: "XCHGW", + Operands: []operand.Op{amr, amr1}, + Inputs: []operand.Op{amr, amr1}, + Outputs: []operand.Op{amr, amr1}, + }, nil + } + return nil, errors.New("XCHGW: bad operands") +} + +// XGETBV: Get Value of Extended Control Register. +// +// Forms: +// +// XGETBV +func XGETBV() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "XGETBV", + Operands: nil, + Inputs: []operand.Op{reg.ECX}, + Outputs: []operand.Op{reg.EAX, reg.EDX}, + }, nil +} + +// XLAT: Table Look-up Translation. +// +// Forms: +// +// XLAT +func XLAT() (*intrep.Instruction, error) { + return &intrep.Instruction{ + Opcode: "XLAT", + Operands: nil, + Inputs: []operand.Op{reg.AL, reg.EBX}, + Outputs: []operand.Op{reg.AL}, + }, nil +} + +// XORB: Logical Exclusive OR. +// +// Forms: +// +// XORB imm8 al +// XORB imm8 r8 +// XORB r8 r8 +// XORB m8 r8 +// XORB imm8 m8 +// XORB r8 m8 +func XORB(imr, amr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM8(imr) && operand.IsAL(amr): + return &intrep.Instruction{ + Opcode: "XORB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "XORB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "XORB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + CancellingInputs: true, + }, nil + case operand.IsM8(imr) && operand.IsR8(amr): + return &intrep.Instruction{ + Opcode: "XORB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM8(amr): + return &intrep.Instruction{ + Opcode: "XORB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR8(imr) && operand.IsM8(amr): + return &intrep.Instruction{ + Opcode: "XORB", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + } + return nil, errors.New("XORB: bad operands") +} + +// XORL: Logical Exclusive OR. +// +// Forms: +// +// XORL imm32 eax +// XORL imm8 r32 +// XORL imm32 r32 +// XORL r32 r32 +// XORL m32 r32 +// XORL imm8 m32 +// XORL imm32 m32 +// XORL r32 m32 +func XORL(imr, emr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imr) && operand.IsEAX(emr): + return &intrep.Instruction{ + Opcode: "XORL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "XORL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "XORL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsR32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "XORL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + CancellingInputs: true, + }, nil + case operand.IsM32(imr) && operand.IsR32(emr): + return &intrep.Instruction{ + Opcode: "XORL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "XORL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsIMM32(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "XORL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{emr}, + Outputs: []operand.Op{emr}, + }, nil + case operand.IsR32(imr) && operand.IsM32(emr): + return &intrep.Instruction{ + Opcode: "XORL", + Operands: []operand.Op{imr, emr}, + Inputs: []operand.Op{imr, emr}, + Outputs: []operand.Op{emr}, + }, nil + } + return nil, errors.New("XORL: bad operands") +} + +// XORPD: Bitwise Logical XOR for Double-Precision Floating-Point Values. +// +// Forms: +// +// XORPD xmm xmm +// XORPD m128 xmm +func XORPD(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "XORPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "XORPD", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE2"}, + }, nil + } + return nil, errors.New("XORPD: bad operands") +} + +// XORPS: Bitwise Logical XOR for Single-Precision Floating-Point Values. +// +// Forms: +// +// XORPS xmm xmm +// XORPS m128 xmm +func XORPS(mx, x operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsXMM(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "XORPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + CancellingInputs: true, + }, nil + case operand.IsM128(mx) && operand.IsXMM(x): + return &intrep.Instruction{ + Opcode: "XORPS", + Operands: []operand.Op{mx, x}, + Inputs: []operand.Op{mx, x}, + Outputs: []operand.Op{x}, + ISA: []string{"SSE"}, + }, nil + } + return nil, errors.New("XORPS: bad operands") +} + +// XORQ: Logical Exclusive OR. +// +// Forms: +// +// XORQ imm32 rax +// XORQ imm8 r64 +// XORQ imm32 r64 +// XORQ r64 r64 +// XORQ m64 r64 +// XORQ imm8 m64 +// XORQ imm32 m64 +// XORQ r64 m64 +func XORQ(imr, mr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM32(imr) && operand.IsRAX(mr): + return &intrep.Instruction{ + Opcode: "XORQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "XORQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM32(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "XORQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "XORQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + CancellingInputs: true, + }, nil + case operand.IsM64(imr) && operand.IsR64(mr): + return &intrep.Instruction{ + Opcode: "XORQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "XORQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsIMM32(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "XORQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{mr}, + Outputs: []operand.Op{mr}, + }, nil + case operand.IsR64(imr) && operand.IsM64(mr): + return &intrep.Instruction{ + Opcode: "XORQ", + Operands: []operand.Op{imr, mr}, + Inputs: []operand.Op{imr, mr}, + Outputs: []operand.Op{mr}, + }, nil + } + return nil, errors.New("XORQ: bad operands") +} + +// XORW: Logical Exclusive OR. +// +// Forms: +// +// XORW imm16 ax +// XORW imm8 r16 +// XORW imm16 r16 +// XORW r16 r16 +// XORW m16 r16 +// XORW imm8 m16 +// XORW imm16 m16 +// XORW r16 m16 +func XORW(imr, amr operand.Op) (*intrep.Instruction, error) { + switch { + case operand.IsIMM16(imr) && operand.IsAX(amr): + return &intrep.Instruction{ + Opcode: "XORW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "XORW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "XORW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "XORW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + CancellingInputs: true, + }, nil + case operand.IsM16(imr) && operand.IsR16(amr): + return &intrep.Instruction{ + Opcode: "XORW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM8(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "XORW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsIMM16(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "XORW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{amr}, + Outputs: []operand.Op{amr}, + }, nil + case operand.IsR16(imr) && operand.IsM16(amr): + return &intrep.Instruction{ + Opcode: "XORW", + Operands: []operand.Op{imr, amr}, + Inputs: []operand.Op{imr, amr}, + Outputs: []operand.Op{amr}, + }, nil + } + return nil, errors.New("XORW: bad operands") +} diff --git a/vendor/github.com/nwaples/rardecode/archive.go b/vendor/github.com/nwaples/rardecode/archive.go index f878751149..8929f12649 100644 --- a/vendor/github.com/nwaples/rardecode/archive.go +++ b/vendor/github.com/nwaples/rardecode/archive.go @@ -137,13 +137,12 @@ func findSig(br *bufio.Reader) (int, error) { // files in a multi-volume archive type volume struct { fileBlockReader - f *os.File // current file handle - br *bufio.Reader // buffered reader for current volume file - dir string // volume directory - file string // current volume file (not including directory) - files []string // full path names for current volume files processed - num int // volume number - old bool // uses old naming scheme + f *os.File // current file handle + br *bufio.Reader // buffered reader for current volume file + dir string // volume directory + file string // current volume file + num int // volume number + old bool // uses old naming scheme } // nextVolName updates name to the next filename in the archive. @@ -259,7 +258,6 @@ func (v *volume) next() (*fileBlockHeader, error) { if v.version() != ver { return nil, errVerMismatch } - v.files = append(v.files, v.dir+v.file) v.reset() // reset encryption } } @@ -286,7 +284,6 @@ func openVolume(name, password string) (*volume, error) { v.f.Close() return nil, err } - v.files = append(v.files, name) return v, nil } diff --git a/vendor/github.com/nwaples/rardecode/huffman.go b/vendor/github.com/nwaples/rardecode/huffman.go index 4acb69d5a9..eb289b40b4 100644 --- a/vendor/github.com/nwaples/rardecode/huffman.go +++ b/vendor/github.com/nwaples/rardecode/huffman.go @@ -130,7 +130,7 @@ func (h *huffmanDecoder) readSym(r bitReader) (int, error) { dist >>= maxCodeLength - bits pos := h.pos[bits] + dist - if pos >= len(h.symbol) { + if pos > len(h.symbol) { return 0, errHuffDecodeFailed } diff --git a/vendor/github.com/nwaples/rardecode/reader.go b/vendor/github.com/nwaples/rardecode/reader.go index 11adc4fea7..03e88a87b5 100644 --- a/vendor/github.com/nwaples/rardecode/reader.go +++ b/vendor/github.com/nwaples/rardecode/reader.go @@ -356,13 +356,6 @@ func (rc *ReadCloser) Close() error { return rc.v.Close() } -// Volumes returns the volume filenames that have been used in decoding the archive -// up to this point. This will include the current open volume if the archive is still -// being processed. -func (rc *ReadCloser) Volumes() []string { - return rc.v.files -} - // OpenReader opens a RAR archive specified by the name and returns a ReadCloser. func OpenReader(name, password string) (*ReadCloser, error) { v, err := openVolume(name, password) diff --git a/vendor/github.com/pierrec/lz4/v4/.gitignore b/vendor/github.com/pierrec/lz4/.gitignore similarity index 96% rename from vendor/github.com/pierrec/lz4/v4/.gitignore rename to vendor/github.com/pierrec/lz4/.gitignore index 5e98735047..e48bab32a5 100644 --- a/vendor/github.com/pierrec/lz4/v4/.gitignore +++ b/vendor/github.com/pierrec/lz4/.gitignore @@ -30,5 +30,4 @@ Temporary Items # End of https://www.gitignore.io/api/macos -cmd/*/*exe -.idea \ No newline at end of file +lz4c/lz4c diff --git a/vendor/github.com/pierrec/lz4/.travis.yml b/vendor/github.com/pierrec/lz4/.travis.yml new file mode 100644 index 0000000000..b2c806d577 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/.travis.yml @@ -0,0 +1,18 @@ +language: go + +go: + - 1.8.x + - 1.9.x + - 1.10.x + - master + +matrix: + fast_finish: true + allow_failures: + - go: master + +sudo: false + +script: + - go test -v -cpu=2 + - go test -v -cpu=2 -race diff --git a/vendor/github.com/pierrec/lz4/v4/LICENSE b/vendor/github.com/pierrec/lz4/LICENSE similarity index 100% rename from vendor/github.com/pierrec/lz4/v4/LICENSE rename to vendor/github.com/pierrec/lz4/LICENSE diff --git a/vendor/github.com/pierrec/lz4/README.md b/vendor/github.com/pierrec/lz4/README.md new file mode 100644 index 0000000000..50a10ee160 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/README.md @@ -0,0 +1,24 @@ +[![godoc](https://godoc.org/github.com/pierrec/lz4?status.png)](https://godoc.org/github.com/pierrec/lz4) + +# lz4 +LZ4 compression and decompression in pure Go. + +## Usage + +```go +import "github.com/pierrec/lz4" +``` + +## Description +Package lz4 implements reading and writing lz4 compressed data (a frame), +as specified in http://fastcompression.blogspot.fr/2013/04/lz4-streaming-format-final.html. + +This package is **compatible with the LZ4 frame format** although the block level compression +and decompression functions are exposed and are fully compatible with the lz4 block format +definition, they are low level and should not be used directly. + +For a complete description of an lz4 compressed block, see: +http://fastcompression.blogspot.fr/2011/05/lz4-explained.html + +See https://github.com/Cyan4973/lz4 for the reference C implementation. + diff --git a/vendor/github.com/pierrec/lz4/block.go b/vendor/github.com/pierrec/lz4/block.go new file mode 100644 index 0000000000..ef24f17e57 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/block.go @@ -0,0 +1,397 @@ +package lz4 + +import ( + "encoding/binary" + "errors" +) + +var ( + // ErrInvalidSourceShortBuffer is returned by UncompressBlock or CompressBLock when a compressed + // block is corrupted or the destination buffer is not large enough for the uncompressed data. + ErrInvalidSourceShortBuffer = errors.New("lz4: invalid source or destination buffer too short") + // ErrInvalid is returned when reading an invalid LZ4 archive. + ErrInvalid = errors.New("lz4: bad magic number") +) + +// blockHash hashes 4 bytes into a value < winSize. +func blockHash(x uint32) uint32 { + const hasher uint32 = 2654435761 // Knuth multiplicative hash. + return x * hasher >> hashShift +} + +// CompressBlockBound returns the maximum size of a given buffer of size n, when not compressible. +func CompressBlockBound(n int) int { + return n + n/255 + 16 +} + +// UncompressBlock uncompresses the source buffer into the destination one, +// and returns the uncompressed size. +// +// The destination buffer must be sized appropriately. +// +// An error is returned if the source data is invalid or the destination buffer is too small. +func UncompressBlock(src, dst []byte) (si int, err error) { + defer func() { + // It is now faster to let the runtime panic and recover on out of bound slice access + // than checking indices as we go along. + if recover() != nil { + err = ErrInvalidSourceShortBuffer + } + }() + sn := len(src) + if sn == 0 { + return 0, nil + } + var di int + + for { + // Literals and match lengths (token). + b := int(src[si]) + si++ + + // Literals. + if lLen := b >> 4; lLen > 0 { + if lLen == 0xF { + for src[si] == 0xFF { + lLen += 0xFF + si++ + } + lLen += int(src[si]) + si++ + } + i := si + si += lLen + di += copy(dst[di:], src[i:si]) + + if si >= sn { + return di, nil + } + } + + si++ + _ = src[si] // Bound check elimination. + offset := int(src[si-1]) | int(src[si])<<8 + si++ + + // Match. + mLen := b & 0xF + if mLen == 0xF { + for src[si] == 0xFF { + mLen += 0xFF + si++ + } + mLen += int(src[si]) + si++ + } + mLen += minMatch + + // Copy the match. + i := di - offset + if offset > 0 && mLen >= offset { + // Efficiently copy the match dst[di-offset:di] into the dst slice. + bytesToCopy := offset * (mLen / offset) + expanded := dst[i:] + for n := offset; n <= bytesToCopy+offset; n *= 2 { + copy(expanded[n:], expanded[:n]) + } + di += bytesToCopy + mLen -= bytesToCopy + } + di += copy(dst[di:], dst[i:i+mLen]) + } +} + +// CompressBlock compresses the source buffer into the destination one. +// This is the fast version of LZ4 compression and also the default one. +// The size of hashTable must be at least 64Kb. +// +// The size of the compressed data is returned. If it is 0 and no error, then the data is incompressible. +// +// An error is returned if the destination buffer is too small. +func CompressBlock(src, dst []byte, hashTable []int) (di int, err error) { + defer func() { + if recover() != nil { + err = ErrInvalidSourceShortBuffer + } + }() + + sn, dn := len(src)-mfLimit, len(dst) + if sn <= 0 || dn == 0 { + return 0, nil + } + var si int + + // Fast scan strategy: the hash table only stores the last 4 bytes sequences. + // const accInit = 1 << skipStrength + + anchor := si // Position of the current literals. + // acc := accInit // Variable step: improves performance on non-compressible data. + + for si < sn { + // Hash the next 4 bytes (sequence)... + match := binary.LittleEndian.Uint32(src[si:]) + h := blockHash(match) + + ref := hashTable[h] + hashTable[h] = si + if ref >= sn { // Invalid reference (dirty hashtable). + si++ + continue + } + offset := si - ref + if offset <= 0 || offset >= winSize || // Out of window. + match != binary.LittleEndian.Uint32(src[ref:]) { // Hash collision on different matches. + // si += acc >> skipStrength + // acc++ + si++ + continue + } + + // Match found. + // acc = accInit + lLen := si - anchor // Literal length. + + // Encode match length part 1. + si += minMatch + mLen := si // Match length has minMatch already. + // Find the longest match, first looking by batches of 8 bytes. + for si < sn && binary.LittleEndian.Uint64(src[si:]) == binary.LittleEndian.Uint64(src[si-offset:]) { + si += 8 + } + // Then byte by byte. + for si < sn && src[si] == src[si-offset] { + si++ + } + + mLen = si - mLen + if mLen < 0xF { + dst[di] = byte(mLen) + } else { + dst[di] = 0xF + } + + // Encode literals length. + if lLen < 0xF { + dst[di] |= byte(lLen << 4) + } else { + dst[di] |= 0xF0 + di++ + l := lLen - 0xF + for ; l >= 0xFF; l -= 0xFF { + dst[di] = 0xFF + di++ + } + dst[di] = byte(l) + } + di++ + + // Literals. + copy(dst[di:], src[anchor:anchor+lLen]) + di += lLen + 2 + anchor = si + + // Encode offset. + _ = dst[di] // Bound check elimination. + dst[di-2], dst[di-1] = byte(offset), byte(offset>>8) + + // Encode match length part 2. + if mLen >= 0xF { + for mLen -= 0xF; mLen >= 0xFF; mLen -= 0xFF { + dst[di] = 0xFF + di++ + } + dst[di] = byte(mLen) + di++ + } + } + + if anchor == 0 { + // Incompressible. + return 0, nil + } + + // Last literals. + lLen := len(src) - anchor + if lLen < 0xF { + dst[di] = byte(lLen << 4) + } else { + dst[di] = 0xF0 + di++ + for lLen -= 0xF; lLen >= 0xFF; lLen -= 0xFF { + dst[di] = 0xFF + di++ + } + dst[di] = byte(lLen) + } + di++ + + // Write the last literals. + if di >= anchor { + // Incompressible. + return 0, nil + } + di += copy(dst[di:], src[anchor:]) + return di, nil +} + +// CompressBlockHC compresses the source buffer src into the destination dst +// with max search depth (use 0 or negative value for no max). +// +// CompressBlockHC compression ratio is better than CompressBlock but it is also slower. +// +// The size of the compressed data is returned. If it is 0 and no error, then the data is not compressible. +// +// An error is returned if the destination buffer is too small. +func CompressBlockHC(src, dst []byte, depth int) (di int, err error) { + defer func() { + if recover() != nil { + err = ErrInvalidSourceShortBuffer + } + }() + + sn, dn := len(src)-mfLimit, len(dst) + if sn <= 0 || dn == 0 { + return 0, nil + } + var si int + + // hashTable: stores the last position found for a given hash + // chaingTable: stores previous positions for a given hash + var hashTable, chainTable [winSize]int + + if depth <= 0 { + depth = winSize + } + + anchor := si + for si < sn { + // Hash the next 4 bytes (sequence). + match := binary.LittleEndian.Uint32(src[si:]) + h := blockHash(match) + + // Follow the chain until out of window and give the longest match. + mLen := 0 + offset := 0 + for next, try := hashTable[h], depth; try > 0 && next > 0 && si-next < winSize; next = chainTable[next&winMask] { + // The first (mLen==0) or next byte (mLen>=minMatch) at current match length + // must match to improve on the match length. + if src[next+mLen] != src[si+mLen] { + continue + } + ml := 0 + // Compare the current position with a previous with the same hash. + for ml < sn-si && binary.LittleEndian.Uint64(src[next+ml:]) == binary.LittleEndian.Uint64(src[si+ml:]) { + ml += 8 + } + for ml < sn-si && src[next+ml] == src[si+ml] { + ml++ + } + if ml+1 < minMatch || ml <= mLen { + // Match too small ( winStart { + winStart = ws + } + for si, ml := winStart, si+mLen; si < ml; { + match >>= 8 + match |= uint32(src[si+3]) << 24 + h := blockHash(match) + chainTable[si&winMask] = hashTable[h] + hashTable[h] = si + si++ + } + + lLen := si - anchor + si += mLen + mLen -= minMatch // Match length does not include minMatch. + + if mLen < 0xF { + dst[di] = byte(mLen) + } else { + dst[di] = 0xF + } + + // Encode literals length. + if lLen < 0xF { + dst[di] |= byte(lLen << 4) + } else { + dst[di] |= 0xF0 + di++ + l := lLen - 0xF + for ; l >= 0xFF; l -= 0xFF { + dst[di] = 0xFF + di++ + } + dst[di] = byte(l) + } + di++ + + // Literals. + copy(dst[di:], src[anchor:anchor+lLen]) + di += lLen + anchor = si + + // Encode offset. + di += 2 + dst[di-2], dst[di-1] = byte(offset), byte(offset>>8) + + // Encode match length part 2. + if mLen >= 0xF { + for mLen -= 0xF; mLen >= 0xFF; mLen -= 0xFF { + dst[di] = 0xFF + di++ + } + dst[di] = byte(mLen) + di++ + } + } + + if anchor == 0 { + // Incompressible. + return 0, nil + } + + // Last literals. + lLen := len(src) - anchor + if lLen < 0xF { + dst[di] = byte(lLen << 4) + } else { + dst[di] = 0xF0 + di++ + lLen -= 0xF + for ; lLen >= 0xFF; lLen -= 0xFF { + dst[di] = 0xFF + di++ + } + dst[di] = byte(lLen) + } + di++ + + // Write the last literals. + if di >= anchor { + // Incompressible. + return 0, nil + } + di += copy(dst[di:], src[anchor:]) + return di, nil +} diff --git a/vendor/github.com/pierrec/lz4/debug.go b/vendor/github.com/pierrec/lz4/debug.go new file mode 100644 index 0000000000..bc5e78d40f --- /dev/null +++ b/vendor/github.com/pierrec/lz4/debug.go @@ -0,0 +1,23 @@ +// +build lz4debug + +package lz4 + +import ( + "fmt" + "os" + "path/filepath" + "runtime" +) + +const debugFlag = true + +func debug(args ...interface{}) { + _, file, line, _ := runtime.Caller(1) + file = filepath.Base(file) + + f := fmt.Sprintf("LZ4: %s:%d %s", file, line, args[0]) + if f[len(f)-1] != '\n' { + f += "\n" + } + fmt.Fprintf(os.Stderr, f, args[1:]...) +} diff --git a/vendor/github.com/pierrec/lz4/debug_stub.go b/vendor/github.com/pierrec/lz4/debug_stub.go new file mode 100644 index 0000000000..44211ad964 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/debug_stub.go @@ -0,0 +1,7 @@ +// +build !lz4debug + +package lz4 + +const debugFlag = false + +func debug(args ...interface{}) {} diff --git a/vendor/github.com/pierrec/lz4/internal/xxh32/xxh32zero.go b/vendor/github.com/pierrec/lz4/internal/xxh32/xxh32zero.go new file mode 100644 index 0000000000..850a6fdf61 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/internal/xxh32/xxh32zero.go @@ -0,0 +1,222 @@ +// Package xxh32 implements the very fast XXH hashing algorithm (32 bits version). +// (https://github.com/Cyan4973/XXH/) +package xxh32 + +import ( + "encoding/binary" +) + +const ( + prime32_1 uint32 = 2654435761 + prime32_2 uint32 = 2246822519 + prime32_3 uint32 = 3266489917 + prime32_4 uint32 = 668265263 + prime32_5 uint32 = 374761393 + + prime32_1plus2 uint32 = 606290984 + prime32_minus1 uint32 = 1640531535 +) + +// XXHZero represents an xxhash32 object with seed 0. +type XXHZero struct { + v1 uint32 + v2 uint32 + v3 uint32 + v4 uint32 + totalLen uint64 + buf [16]byte + bufused int +} + +// Sum appends the current hash to b and returns the resulting slice. +// It does not change the underlying hash state. +func (xxh XXHZero) Sum(b []byte) []byte { + h32 := xxh.Sum32() + return append(b, byte(h32), byte(h32>>8), byte(h32>>16), byte(h32>>24)) +} + +// Reset resets the Hash to its initial state. +func (xxh *XXHZero) Reset() { + xxh.v1 = prime32_1plus2 + xxh.v2 = prime32_2 + xxh.v3 = 0 + xxh.v4 = prime32_minus1 + xxh.totalLen = 0 + xxh.bufused = 0 +} + +// Size returns the number of bytes returned by Sum(). +func (xxh *XXHZero) Size() int { + return 4 +} + +// BlockSize gives the minimum number of bytes accepted by Write(). +func (xxh *XXHZero) BlockSize() int { + return 1 +} + +// Write adds input bytes to the Hash. +// It never returns an error. +func (xxh *XXHZero) Write(input []byte) (int, error) { + if xxh.totalLen == 0 { + xxh.Reset() + } + n := len(input) + m := xxh.bufused + + xxh.totalLen += uint64(n) + + r := len(xxh.buf) - m + if n < r { + copy(xxh.buf[m:], input) + xxh.bufused += len(input) + return n, nil + } + + p := 0 + // Causes compiler to work directly from registers instead of stack: + v1, v2, v3, v4 := xxh.v1, xxh.v2, xxh.v3, xxh.v4 + if m > 0 { + // some data left from previous update + copy(xxh.buf[xxh.bufused:], input[:r]) + xxh.bufused += len(input) - r + + // fast rotl(13) + buf := xxh.buf[:16] // BCE hint. + v1 = rol13(v1+binary.LittleEndian.Uint32(buf[:])*prime32_2) * prime32_1 + v2 = rol13(v2+binary.LittleEndian.Uint32(buf[4:])*prime32_2) * prime32_1 + v3 = rol13(v3+binary.LittleEndian.Uint32(buf[8:])*prime32_2) * prime32_1 + v4 = rol13(v4+binary.LittleEndian.Uint32(buf[12:])*prime32_2) * prime32_1 + p = r + xxh.bufused = 0 + } + + for n := n - 16; p <= n; p += 16 { + sub := input[p:][:16] //BCE hint for compiler + v1 = rol13(v1+binary.LittleEndian.Uint32(sub[:])*prime32_2) * prime32_1 + v2 = rol13(v2+binary.LittleEndian.Uint32(sub[4:])*prime32_2) * prime32_1 + v3 = rol13(v3+binary.LittleEndian.Uint32(sub[8:])*prime32_2) * prime32_1 + v4 = rol13(v4+binary.LittleEndian.Uint32(sub[12:])*prime32_2) * prime32_1 + } + xxh.v1, xxh.v2, xxh.v3, xxh.v4 = v1, v2, v3, v4 + + copy(xxh.buf[xxh.bufused:], input[p:]) + xxh.bufused += len(input) - p + + return n, nil +} + +// Sum32 returns the 32 bits Hash value. +func (xxh *XXHZero) Sum32() uint32 { + h32 := uint32(xxh.totalLen) + if h32 >= 16 { + h32 += rol1(xxh.v1) + rol7(xxh.v2) + rol12(xxh.v3) + rol18(xxh.v4) + } else { + h32 += prime32_5 + } + + p := 0 + n := xxh.bufused + buf := xxh.buf + for n := n - 4; p <= n; p += 4 { + h32 += binary.LittleEndian.Uint32(buf[p:p+4]) * prime32_3 + h32 = rol17(h32) * prime32_4 + } + for ; p < n; p++ { + h32 += uint32(buf[p]) * prime32_5 + h32 = rol11(h32) * prime32_1 + } + + h32 ^= h32 >> 15 + h32 *= prime32_2 + h32 ^= h32 >> 13 + h32 *= prime32_3 + h32 ^= h32 >> 16 + + return h32 +} + +// ChecksumZero returns the 32bits Hash value. +func ChecksumZero(input []byte) uint32 { + n := len(input) + h32 := uint32(n) + + if n < 16 { + h32 += prime32_5 + } else { + v1 := prime32_1plus2 + v2 := prime32_2 + v3 := uint32(0) + v4 := prime32_minus1 + p := 0 + for n := n - 16; p <= n; p += 16 { + sub := input[p:][:16] //BCE hint for compiler + v1 = rol13(v1+binary.LittleEndian.Uint32(sub[:])*prime32_2) * prime32_1 + v2 = rol13(v2+binary.LittleEndian.Uint32(sub[4:])*prime32_2) * prime32_1 + v3 = rol13(v3+binary.LittleEndian.Uint32(sub[8:])*prime32_2) * prime32_1 + v4 = rol13(v4+binary.LittleEndian.Uint32(sub[12:])*prime32_2) * prime32_1 + } + input = input[p:] + n -= p + h32 += rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4) + } + + p := 0 + for n := n - 4; p <= n; p += 4 { + h32 += binary.LittleEndian.Uint32(input[p:p+4]) * prime32_3 + h32 = rol17(h32) * prime32_4 + } + for p < n { + h32 += uint32(input[p]) * prime32_5 + h32 = rol11(h32) * prime32_1 + p++ + } + + h32 ^= h32 >> 15 + h32 *= prime32_2 + h32 ^= h32 >> 13 + h32 *= prime32_3 + h32 ^= h32 >> 16 + + return h32 +} + +// Uint32Zero hashes x with seed 0. +func Uint32Zero(x uint32) uint32 { + h := prime32_5 + 4 + x*prime32_3 + h = rol17(h) * prime32_4 + h ^= h >> 15 + h *= prime32_2 + h ^= h >> 13 + h *= prime32_3 + h ^= h >> 16 + return h +} + +func rol1(u uint32) uint32 { + return u<<1 | u>>31 +} + +func rol7(u uint32) uint32 { + return u<<7 | u>>25 +} + +func rol11(u uint32) uint32 { + return u<<11 | u>>21 +} + +func rol12(u uint32) uint32 { + return u<<12 | u>>20 +} + +func rol13(u uint32) uint32 { + return u<<13 | u>>19 +} + +func rol17(u uint32) uint32 { + return u<<17 | u>>15 +} + +func rol18(u uint32) uint32 { + return u<<18 | u>>14 +} diff --git a/vendor/github.com/pierrec/lz4/lz4.go b/vendor/github.com/pierrec/lz4/lz4.go new file mode 100644 index 0000000000..35802756c4 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/lz4.go @@ -0,0 +1,68 @@ +// Package lz4 implements reading and writing lz4 compressed data (a frame), +// as specified in http://fastcompression.blogspot.fr/2013/04/lz4-streaming-format-final.html. +// +// Although the block level compression and decompression functions are exposed and are fully compatible +// with the lz4 block format definition, they are low level and should not be used directly. +// For a complete description of an lz4 compressed block, see: +// http://fastcompression.blogspot.fr/2011/05/lz4-explained.html +// +// See https://github.com/Cyan4973/lz4 for the reference C implementation. +// +package lz4 + +const ( + // Extension is the LZ4 frame file name extension + Extension = ".lz4" + // Version is the LZ4 frame format version + Version = 1 + + frameMagic uint32 = 0x184D2204 + frameSkipMagic uint32 = 0x184D2A50 + + // The following constants are used to setup the compression algorithm. + minMatch = 4 // the minimum size of the match sequence size (4 bytes) + winSizeLog = 16 // LZ4 64Kb window size limit + winSize = 1 << winSizeLog + winMask = winSize - 1 // 64Kb window of previous data for dependent blocks + compressedBlockFlag = 1 << 31 + compressedBlockMask = compressedBlockFlag - 1 + + // hashLog determines the size of the hash table used to quickly find a previous match position. + // Its value influences the compression speed and memory usage, the lower the faster, + // but at the expense of the compression ratio. + // 16 seems to be the best compromise. + hashLog = 16 + hashTableSize = 1 << hashLog + hashShift = uint((minMatch * 8) - hashLog) + + mfLimit = 8 + minMatch // The last match cannot start within the last 12 bytes. + skipStrength = 6 // variable step for fast scan +) + +// map the block max size id with its value in bytes: 64Kb, 256Kb, 1Mb and 4Mb. +var ( + bsMapID = map[byte]int{4: 64 << 10, 5: 256 << 10, 6: 1 << 20, 7: 4 << 20} + bsMapValue = make(map[int]byte, len(bsMapID)) +) + +// Reversed. +func init() { + for i, v := range bsMapID { + bsMapValue[v] = i + } +} + +// Header describes the various flags that can be set on a Writer or obtained from a Reader. +// The default values match those of the LZ4 frame format definition +// (http://fastcompression.blogspot.com/2013/04/lz4-streaming-format-final.html). +// +// NB. in a Reader, in case of concatenated frames, the Header values may change between Read() calls. +// It is the caller responsibility to check them if necessary. +type Header struct { + BlockChecksum bool // Compressed blocks checksum flag. + NoChecksum bool // Frame checksum flag. + BlockMaxSize int // Size of the uncompressed data block (one of [64KB, 256KB, 1MB, 4MB]). Default=4MB. + Size uint64 // Frame total size. It is _not_ computed by the Writer. + CompressionLevel int // Compression level (higher is better, use 0 for fastest compression). + done bool // Header processed flag (Read or Write and checked). +} diff --git a/vendor/github.com/pierrec/lz4/lz4_go1.10.go b/vendor/github.com/pierrec/lz4/lz4_go1.10.go new file mode 100644 index 0000000000..9a0fb00709 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/lz4_go1.10.go @@ -0,0 +1,29 @@ +//+build go1.10 + +package lz4 + +import ( + "fmt" + "strings" +) + +func (h Header) String() string { + var s strings.Builder + + s.WriteString(fmt.Sprintf("%T{", h)) + if h.BlockChecksum { + s.WriteString("BlockChecksum: true ") + } + if h.NoChecksum { + s.WriteString("NoChecksum: true ") + } + if bs := h.BlockMaxSize; bs != 0 && bs != 4<<20 { + s.WriteString(fmt.Sprintf("BlockMaxSize: %d ", bs)) + } + if l := h.CompressionLevel; l != 0 { + s.WriteString(fmt.Sprintf("CompressionLevel: %d ", l)) + } + s.WriteByte('}') + + return s.String() +} diff --git a/vendor/github.com/pierrec/lz4/lz4_notgo1.10.go b/vendor/github.com/pierrec/lz4/lz4_notgo1.10.go new file mode 100644 index 0000000000..12c761a2e7 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/lz4_notgo1.10.go @@ -0,0 +1,29 @@ +//+build !go1.10 + +package lz4 + +import ( + "bytes" + "fmt" +) + +func (h Header) String() string { + var s bytes.Buffer + + s.WriteString(fmt.Sprintf("%T{", h)) + if h.BlockChecksum { + s.WriteString("BlockChecksum: true ") + } + if h.NoChecksum { + s.WriteString("NoChecksum: true ") + } + if bs := h.BlockMaxSize; bs != 0 && bs != 4<<20 { + s.WriteString(fmt.Sprintf("BlockMaxSize: %d ", bs)) + } + if l := h.CompressionLevel; l != 0 { + s.WriteString(fmt.Sprintf("CompressionLevel: %d ", l)) + } + s.WriteByte('}') + + return s.String() +} diff --git a/vendor/github.com/pierrec/lz4/reader.go b/vendor/github.com/pierrec/lz4/reader.go new file mode 100644 index 0000000000..f08db47df7 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/reader.go @@ -0,0 +1,295 @@ +package lz4 + +import ( + "encoding/binary" + "fmt" + "io" + "io/ioutil" + + "github.com/pierrec/lz4/internal/xxh32" +) + +// Reader implements the LZ4 frame decoder. +// The Header is set after the first call to Read(). +// The Header may change between Read() calls in case of concatenated frames. +type Reader struct { + Header + + buf [8]byte // Scrap buffer. + pos int64 // Current position in src. + src io.Reader // Source. + zdata []byte // Compressed data. + data []byte // Uncompressed data. + idx int // Index of unread bytes into data. + checksum xxh32.XXHZero // Frame hash. +} + +// NewReader returns a new LZ4 frame decoder. +// No access to the underlying io.Reader is performed. +func NewReader(src io.Reader) *Reader { + r := &Reader{src: src} + return r +} + +// readHeader checks the frame magic number and parses the frame descriptoz. +// Skippable frames are supported even as a first frame although the LZ4 +// specifications recommends skippable frames not to be used as first frames. +func (z *Reader) readHeader(first bool) error { + defer z.checksum.Reset() + + buf := z.buf[:] + for { + magic, err := z.readUint32() + if err != nil { + z.pos += 4 + if !first && err == io.ErrUnexpectedEOF { + return io.EOF + } + return err + } + if magic == frameMagic { + break + } + if magic>>8 != frameSkipMagic>>8 { + return ErrInvalid + } + skipSize, err := z.readUint32() + if err != nil { + return err + } + z.pos += 4 + m, err := io.CopyN(ioutil.Discard, z.src, int64(skipSize)) + if err != nil { + return err + } + z.pos += m + } + + // Header. + if _, err := io.ReadFull(z.src, buf[:2]); err != nil { + return err + } + z.pos += 8 + + b := buf[0] + if v := b >> 6; v != Version { + return fmt.Errorf("lz4: invalid version: got %d; expected %d", v, Version) + } + if b>>5&1 == 0 { + return fmt.Errorf("lz4: block dependency not supported") + } + z.BlockChecksum = b>>4&1 > 0 + frameSize := b>>3&1 > 0 + z.NoChecksum = b>>2&1 == 0 + + bmsID := buf[1] >> 4 & 0x7 + bSize, ok := bsMapID[bmsID] + if !ok { + return fmt.Errorf("lz4: invalid block max size ID: %d", bmsID) + } + z.BlockMaxSize = bSize + + // Allocate the compressed/uncompressed buffers. + // The compressed buffer cannot exceed the uncompressed one. + if n := 2 * bSize; cap(z.zdata) < n { + z.zdata = make([]byte, n, n) + } + if debugFlag { + debug("header block max size id=%d size=%d", bmsID, bSize) + } + z.zdata = z.zdata[:bSize] + z.data = z.zdata[:cap(z.zdata)][bSize:] + z.idx = len(z.data) + + z.checksum.Write(buf[0:2]) + + if frameSize { + buf := buf[:8] + if _, err := io.ReadFull(z.src, buf); err != nil { + return err + } + z.Size = binary.LittleEndian.Uint64(buf) + z.pos += 8 + z.checksum.Write(buf) + } + + // Header checksum. + if _, err := io.ReadFull(z.src, buf[:1]); err != nil { + return err + } + z.pos++ + if h := byte(z.checksum.Sum32() >> 8 & 0xFF); h != buf[0] { + return fmt.Errorf("lz4: invalid header checksum: got %x; expected %x", buf[0], h) + } + + z.Header.done = true + if debugFlag { + debug("header read: %v", z.Header) + } + + return nil +} + +// Read decompresses data from the underlying source into the supplied buffer. +// +// Since there can be multiple streams concatenated, Header values may +// change between calls to Read(). If that is the case, no data is actually read from +// the underlying io.Reader, to allow for potential input buffer resizing. +func (z *Reader) Read(buf []byte) (int, error) { + if debugFlag { + debug("Read buf len=%d", len(buf)) + } + if !z.Header.done { + if err := z.readHeader(true); err != nil { + return 0, err + } + if debugFlag { + debug("header read OK compressed buffer %d / %d uncompressed buffer %d : %d index=%d", + len(z.zdata), cap(z.zdata), len(z.data), cap(z.data), z.idx) + } + } + + if len(buf) == 0 { + return 0, nil + } + + if z.idx == len(z.data) { + // No data ready for reading, process the next block. + if debugFlag { + debug("reading block from writer") + } + // Block length: 0 = end of frame, highest bit set: uncompressed. + bLen, err := z.readUint32() + if err != nil { + return 0, err + } + z.pos += 4 + + if bLen == 0 { + // End of frame reached. + if !z.NoChecksum { + // Validate the frame checksum. + checksum, err := z.readUint32() + if err != nil { + return 0, err + } + if debugFlag { + debug("frame checksum got=%x / want=%x", z.checksum.Sum32(), checksum) + } + z.pos += 4 + if h := z.checksum.Sum32(); checksum != h { + return 0, fmt.Errorf("lz4: invalid frame checksum: got %x; expected %x", h, checksum) + } + } + + // Get ready for the next concatenated frame and keep the position. + pos := z.pos + z.Reset(z.src) + z.pos = pos + + // Since multiple frames can be concatenated, check for more. + return 0, z.readHeader(false) + } + + if debugFlag { + debug("raw block size %d", bLen) + } + if bLen&compressedBlockFlag > 0 { + // Uncompressed block. + bLen &= compressedBlockMask + if debugFlag { + debug("uncompressed block size %d", bLen) + } + if int(bLen) > cap(z.data) { + return 0, fmt.Errorf("lz4: invalid block size: %d", bLen) + } + z.data = z.data[:bLen] + if _, err := io.ReadFull(z.src, z.data); err != nil { + return 0, err + } + z.pos += int64(bLen) + + if z.BlockChecksum { + checksum, err := z.readUint32() + if err != nil { + return 0, err + } + z.pos += 4 + + if h := xxh32.ChecksumZero(z.data); h != checksum { + return 0, fmt.Errorf("lz4: invalid block checksum: got %x; expected %x", h, checksum) + } + } + + } else { + // Compressed block. + if debugFlag { + debug("compressed block size %d", bLen) + } + if int(bLen) > cap(z.data) { + return 0, fmt.Errorf("lz4: invalid block size: %d", bLen) + } + zdata := z.zdata[:bLen] + if _, err := io.ReadFull(z.src, zdata); err != nil { + return 0, err + } + z.pos += int64(bLen) + + if z.BlockChecksum { + checksum, err := z.readUint32() + if err != nil { + return 0, err + } + z.pos += 4 + + if h := xxh32.ChecksumZero(zdata); h != checksum { + return 0, fmt.Errorf("lz4: invalid block checksum: got %x; expected %x", h, checksum) + } + } + + n, err := UncompressBlock(zdata, z.data) + if err != nil { + return 0, err + } + z.data = z.data[:n] + } + + if !z.NoChecksum { + z.checksum.Write(z.data) + if debugFlag { + debug("current frame checksum %x", z.checksum.Sum32()) + } + } + z.idx = 0 + } + + n := copy(buf, z.data[z.idx:]) + z.idx += n + if debugFlag { + debug("copied %d bytes to input", n) + } + + return n, nil +} + +// Reset discards the Reader's state and makes it equivalent to the +// result of its original state from NewReader, but reading from r instead. +// This permits reusing a Reader rather than allocating a new one. +func (z *Reader) Reset(r io.Reader) { + z.Header = Header{} + z.pos = 0 + z.src = r + z.zdata = z.zdata[:0] + z.data = z.data[:0] + z.idx = 0 + z.checksum.Reset() +} + +// readUint32 reads an uint32 into the supplied buffer. +// The idea is to make use of the already allocated buffers avoiding additional allocations. +func (z *Reader) readUint32() (uint32, error) { + buf := z.buf[:4] + _, err := io.ReadFull(z.src, buf) + x := binary.LittleEndian.Uint32(buf) + return x, err +} diff --git a/vendor/github.com/pierrec/lz4/v4/.travis.yml b/vendor/github.com/pierrec/lz4/v4/.travis.yml deleted file mode 100644 index 4a9819e03a..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: go - -env: - - GO111MODULE=off - -go: - - 1.13.x - - 1.14.x - -matrix: - fast_finish: true - -sudo: false - -script: - - go test -v -cpu=2 - - go test -v -cpu=2 -race - - go test -v -cpu=2 -tags noasm - - go test -v -cpu=2 -race -tags noasm diff --git a/vendor/github.com/pierrec/lz4/v4/README.md b/vendor/github.com/pierrec/lz4/v4/README.md deleted file mode 100644 index 4ee388e81b..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# lz4 : LZ4 compression in pure Go - -[![GoDoc](https://godoc.org/github.com/pierrec/lz4?status.svg)](https://godoc.org/github.com/pierrec/lz4) -[![Build Status](https://travis-ci.org/pierrec/lz4.svg?branch=master)](https://travis-ci.org/pierrec/lz4) -[![Go Report Card](https://goreportcard.com/badge/github.com/pierrec/lz4)](https://goreportcard.com/report/github.com/pierrec/lz4) -[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/pierrec/lz4.svg?style=social)](https://github.com/pierrec/lz4/tags) - -## Overview - -This package provides a streaming interface to [LZ4 data streams](http://fastcompression.blogspot.fr/2013/04/lz4-streaming-format-final.html) as well as low level compress and uncompress functions for LZ4 data blocks. -The implementation is based on the reference C [one](https://github.com/lz4/lz4). - -## Install - -Assuming you have the go toolchain installed: - -``` -go get github.com/pierrec/lz4 -``` - -There is a command line interface tool to compress and decompress LZ4 files. - -``` -go install github.com/pierrec/lz4/cmd/lz4c -``` - -Usage - -``` -Usage of lz4c: - -version - print the program version - -Subcommands: -Compress the given files or from stdin to stdout. -compress [arguments] [ ...] - -bc - enable block checksum - -l int - compression level (0=fastest) - -sc - disable stream checksum - -size string - block max size [64K,256K,1M,4M] (default "4M") - -Uncompress the given files or from stdin to stdout. -uncompress [arguments] [ ...] - -``` - - -## Example - -``` -// Compress and uncompress an input string. -s := "hello world" -r := strings.NewReader(s) - -// The pipe will uncompress the data from the writer. -pr, pw := io.Pipe() -zw := lz4.NewWriter(pw) -zr := lz4.NewReader(pr) - -go func() { - // Compress the input string. - _, _ = io.Copy(zw, r) - _ = zw.Close() // Make sure the writer is closed - _ = pw.Close() // Terminate the pipe -}() - -_, _ = io.Copy(os.Stdout, zr) - -// Output: -// hello world -``` - -## Contributing - -Contributions are very welcome for bug fixing, performance improvements...! - -- Open an issue with a proper description -- Send a pull request with appropriate test case(s) - -## Contributors - -Thanks to all [contributors](https://github.com/pierrec/lz4/graphs/contributors) so far! - -Special thanks to [@Zariel](https://github.com/Zariel) for his asm implementation of the decoder. - -Special thanks to [@klauspost](https://github.com/klauspost) for his work on optimizing the code. diff --git a/vendor/github.com/pierrec/lz4/v4/go.mod b/vendor/github.com/pierrec/lz4/v4/go.mod deleted file mode 100644 index 42229b2967..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/pierrec/lz4/v4 - -go 1.14 diff --git a/vendor/github.com/pierrec/lz4/v4/go.sum b/vendor/github.com/pierrec/lz4/v4/go.sum deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/block.go b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/block.go deleted file mode 100644 index e634c2cb8a..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/block.go +++ /dev/null @@ -1,469 +0,0 @@ -package lz4block - -import ( - "encoding/binary" - "math/bits" - "sync" - - "github.com/pierrec/lz4/v4/internal/lz4errors" -) - -const ( - // The following constants are used to setup the compression algorithm. - minMatch = 4 // the minimum size of the match sequence size (4 bytes) - winSizeLog = 16 // LZ4 64Kb window size limit - winSize = 1 << winSizeLog - winMask = winSize - 1 // 64Kb window of previous data for dependent blocks - - // hashLog determines the size of the hash table used to quickly find a previous match position. - // Its value influences the compression speed and memory usage, the lower the faster, - // but at the expense of the compression ratio. - // 16 seems to be the best compromise for fast compression. - hashLog = 16 - htSize = 1 << hashLog - - mfLimit = 10 + minMatch // The last match cannot start within the last 14 bytes. -) - -func recoverBlock(e *error) { - if r := recover(); r != nil && *e == nil { - *e = lz4errors.ErrInvalidSourceShortBuffer - } -} - -// blockHash hashes the lower 6 bytes into a value < htSize. -func blockHash(x uint64) uint32 { - const prime6bytes = 227718039650203 - return uint32(((x << (64 - 48)) * prime6bytes) >> (64 - hashLog)) -} - -func CompressBlockBound(n int) int { - return n + n/255 + 16 -} - -func UncompressBlock(src, dst []byte) (int, error) { - if len(src) == 0 { - return 0, nil - } - if di := decodeBlock(dst, src); di >= 0 { - return di, nil - } - return 0, lz4errors.ErrInvalidSourceShortBuffer -} - -type Compressor struct { - // Offsets are at most 64kiB, so we can store only the lower 16 bits of - // match positions: effectively, an offset from some 64kiB block boundary. - // - // When we retrieve such an offset, we interpret it as relative to the last - // block boundary si &^ 0xffff, or the one before, (si &^ 0xffff) - 0x10000, - // depending on which of these is inside the current window. If a table - // entry was generated more than 64kiB back in the input, we find out by - // inspecting the input stream. - table [htSize]uint16 - - needsReset bool -} - -// Get returns the position of a presumptive match for the hash h. -// The match may be a false positive due to a hash collision or an old entry. -// If si < winSize, the return value may be negative. -func (c *Compressor) get(h uint32, si int) int { - h &= htSize - 1 - i := int(c.table[h]) - i += si &^ winMask - if i >= si { - // Try previous 64kiB block (negative when in first block). - i -= winSize - } - return i -} - -func (c *Compressor) put(h uint32, si int) { - h &= htSize - 1 - c.table[h] = uint16(si) -} - -var compressorPool = sync.Pool{New: func() interface{} { return new(Compressor) }} - -func CompressBlock(src, dst []byte) (int, error) { - c := compressorPool.Get().(*Compressor) - n, err := c.CompressBlock(src, dst) - compressorPool.Put(c) - return n, err -} - -func (c *Compressor) CompressBlock(src, dst []byte) (int, error) { - if c.needsReset { - // Zero out reused table to avoid non-deterministic output (issue #65). - c.table = [htSize]uint16{} - } - c.needsReset = true // Only false on first call. - - // Return 0, nil only if the destination buffer size is < CompressBlockBound. - isNotCompressible := len(dst) < CompressBlockBound(len(src)) - - // adaptSkipLog sets how quickly the compressor begins skipping blocks when data is incompressible. - // This significantly speeds up incompressible data and usually has very small impact on compression. - // bytes to skip = 1 + (bytes since last match >> adaptSkipLog) - const adaptSkipLog = 7 - - // si: Current position of the search. - // anchor: Position of the current literals. - var si, di, anchor int - sn := len(src) - mfLimit - if sn <= 0 { - goto lastLiterals - } - - // Fast scan strategy: the hash table only stores the last 4 bytes sequences. - for si < sn { - // Hash the next 6 bytes (sequence)... - match := binary.LittleEndian.Uint64(src[si:]) - h := blockHash(match) - h2 := blockHash(match >> 8) - - // We check a match at s, s+1 and s+2 and pick the first one we get. - // Checking 3 only requires us to load the source one. - ref := c.get(h, si) - ref2 := c.get(h2, si) - c.put(h, si) - c.put(h2, si+1) - - offset := si - ref - - if ref < 0 || uint32(match) != binary.LittleEndian.Uint32(src[ref:]) { - // No match. Start calculating another hash. - // The processor can usually do this out-of-order. - h = blockHash(match >> 16) - ref3 := c.get(h, si+2) - - // Check the second match at si+1 - si += 1 - offset = si - ref2 - - if ref2 < 0 || uint32(match>>8) != binary.LittleEndian.Uint32(src[ref2:]) { - // No match. Check the third match at si+2 - si += 1 - offset = si - ref3 - c.put(h, si) - - if ref3 < 0 || uint32(match>>16) != binary.LittleEndian.Uint32(src[ref3:]) { - // Skip one extra byte (at si+3) before we check 3 matches again. - si += 2 + (si-anchor)>>adaptSkipLog - continue - } - } - } - - // Match found. - lLen := si - anchor // Literal length. - // We already matched 4 bytes. - mLen := 4 - - // Extend backwards if we can, reducing literals. - tOff := si - offset - 1 - for lLen > 0 && tOff >= 0 && src[si-1] == src[tOff] { - si-- - tOff-- - lLen-- - mLen++ - } - - // Add the match length, so we continue search at the end. - // Use mLen to store the offset base. - si, mLen = si+mLen, si+minMatch - - // Find the longest match by looking by batches of 8 bytes. - for si+8 < sn { - x := binary.LittleEndian.Uint64(src[si:]) ^ binary.LittleEndian.Uint64(src[si-offset:]) - if x == 0 { - si += 8 - } else { - // Stop is first non-zero byte. - si += bits.TrailingZeros64(x) >> 3 - break - } - } - - mLen = si - mLen - if mLen < 0xF { - dst[di] = byte(mLen) - } else { - dst[di] = 0xF - } - - // Encode literals length. - if lLen < 0xF { - dst[di] |= byte(lLen << 4) - } else { - dst[di] |= 0xF0 - di++ - l := lLen - 0xF - for ; l >= 0xFF; l -= 0xFF { - dst[di] = 0xFF - di++ - } - dst[di] = byte(l) - } - di++ - - // Literals. - if di+lLen > len(dst) { - return 0, lz4errors.ErrInvalidSourceShortBuffer - } - copy(dst[di:di+lLen], src[anchor:anchor+lLen]) - di += lLen + 2 - anchor = si - - // Encode offset. - if di > len(dst) { - return 0, lz4errors.ErrInvalidSourceShortBuffer - } - dst[di-2], dst[di-1] = byte(offset), byte(offset>>8) - - // Encode match length part 2. - if mLen >= 0xF { - for mLen -= 0xF; mLen >= 0xFF && di < len(dst); mLen -= 0xFF { - dst[di] = 0xFF - di++ - } - if di >= len(dst) { - return 0, lz4errors.ErrInvalidSourceShortBuffer - } - dst[di] = byte(mLen) - di++ - } - // Check if we can load next values. - if si >= sn { - break - } - // Hash match end-2 - h = blockHash(binary.LittleEndian.Uint64(src[si-2:])) - c.put(h, si-2) - } - -lastLiterals: - if isNotCompressible && anchor == 0 { - // Incompressible. - return 0, nil - } - - // Last literals. - if di >= len(dst) { - return 0, lz4errors.ErrInvalidSourceShortBuffer - } - lLen := len(src) - anchor - if lLen < 0xF { - dst[di] = byte(lLen << 4) - } else { - dst[di] = 0xF0 - di++ - for lLen -= 0xF; lLen >= 0xFF && di < len(dst); lLen -= 0xFF { - dst[di] = 0xFF - di++ - } - if di >= len(dst) { - return 0, lz4errors.ErrInvalidSourceShortBuffer - } - dst[di] = byte(lLen) - } - di++ - - // Write the last literals. - if isNotCompressible && di >= anchor { - // Incompressible. - return 0, nil - } - if di+len(src)-anchor > len(dst) { - return 0, lz4errors.ErrInvalidSourceShortBuffer - } - di += copy(dst[di:di+len(src)-anchor], src[anchor:]) - return di, nil -} - -// blockHash hashes 4 bytes into a value < winSize. -func blockHashHC(x uint32) uint32 { - const hasher uint32 = 2654435761 // Knuth multiplicative hash. - return x * hasher >> (32 - winSizeLog) -} - -type CompressorHC struct { - // hashTable: stores the last position found for a given hash - // chainTable: stores previous positions for a given hash - hashTable, chainTable [htSize]int - needsReset bool -} - -var compressorHCPool = sync.Pool{New: func() interface{} { return new(CompressorHC) }} - -func CompressBlockHC(src, dst []byte, depth CompressionLevel) (int, error) { - c := compressorHCPool.Get().(*CompressorHC) - n, err := c.CompressBlock(src, dst, depth) - compressorHCPool.Put(c) - return n, err -} - -func (c *CompressorHC) CompressBlock(src, dst []byte, depth CompressionLevel) (_ int, err error) { - if c.needsReset { - // Zero out reused table to avoid non-deterministic output (issue #65). - c.hashTable = [htSize]int{} - c.chainTable = [htSize]int{} - } - c.needsReset = true // Only false on first call. - - defer recoverBlock(&err) - - // Return 0, nil only if the destination buffer size is < CompressBlockBound. - isNotCompressible := len(dst) < CompressBlockBound(len(src)) - - // adaptSkipLog sets how quickly the compressor begins skipping blocks when data is incompressible. - // This significantly speeds up incompressible data and usually has very small impact on compression. - // bytes to skip = 1 + (bytes since last match >> adaptSkipLog) - const adaptSkipLog = 7 - - var si, di, anchor int - sn := len(src) - mfLimit - if sn <= 0 { - goto lastLiterals - } - - if depth == 0 { - depth = winSize - } - - for si < sn { - // Hash the next 4 bytes (sequence). - match := binary.LittleEndian.Uint32(src[si:]) - h := blockHashHC(match) - - // Follow the chain until out of window and give the longest match. - mLen := 0 - offset := 0 - for next, try := c.hashTable[h], depth; try > 0 && next > 0 && si-next < winSize; next, try = c.chainTable[next&winMask], try-1 { - // The first (mLen==0) or next byte (mLen>=minMatch) at current match length - // must match to improve on the match length. - if src[next+mLen] != src[si+mLen] { - continue - } - ml := 0 - // Compare the current position with a previous with the same hash. - for ml < sn-si { - x := binary.LittleEndian.Uint64(src[next+ml:]) ^ binary.LittleEndian.Uint64(src[si+ml:]) - if x == 0 { - ml += 8 - } else { - // Stop is first non-zero byte. - ml += bits.TrailingZeros64(x) >> 3 - break - } - } - if ml < minMatch || ml <= mLen { - // Match too small (>adaptSkipLog - continue - } - - // Match found. - // Update hash/chain tables with overlapping bytes: - // si already hashed, add everything from si+1 up to the match length. - winStart := si + 1 - if ws := si + mLen - winSize; ws > winStart { - winStart = ws - } - for si, ml := winStart, si+mLen; si < ml; { - match >>= 8 - match |= uint32(src[si+3]) << 24 - h := blockHashHC(match) - c.chainTable[si&winMask] = c.hashTable[h] - c.hashTable[h] = si - si++ - } - - lLen := si - anchor - si += mLen - mLen -= minMatch // Match length does not include minMatch. - - if mLen < 0xF { - dst[di] = byte(mLen) - } else { - dst[di] = 0xF - } - - // Encode literals length. - if lLen < 0xF { - dst[di] |= byte(lLen << 4) - } else { - dst[di] |= 0xF0 - di++ - l := lLen - 0xF - for ; l >= 0xFF; l -= 0xFF { - dst[di] = 0xFF - di++ - } - dst[di] = byte(l) - } - di++ - - // Literals. - copy(dst[di:di+lLen], src[anchor:anchor+lLen]) - di += lLen - anchor = si - - // Encode offset. - di += 2 - dst[di-2], dst[di-1] = byte(offset), byte(offset>>8) - - // Encode match length part 2. - if mLen >= 0xF { - for mLen -= 0xF; mLen >= 0xFF; mLen -= 0xFF { - dst[di] = 0xFF - di++ - } - dst[di] = byte(mLen) - di++ - } - } - - if isNotCompressible && anchor == 0 { - // Incompressible. - return 0, nil - } - - // Last literals. -lastLiterals: - lLen := len(src) - anchor - if lLen < 0xF { - dst[di] = byte(lLen << 4) - } else { - dst[di] = 0xF0 - di++ - lLen -= 0xF - for ; lLen >= 0xFF; lLen -= 0xFF { - dst[di] = 0xFF - di++ - } - dst[di] = byte(lLen) - } - di++ - - // Write the last literals. - if isNotCompressible && di >= anchor { - // Incompressible. - return 0, nil - } - di += copy(dst[di:di+len(src)-anchor], src[anchor:]) - return di, nil -} diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/blocks.go b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/blocks.go deleted file mode 100644 index 098a5cf9b9..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/blocks.go +++ /dev/null @@ -1,87 +0,0 @@ -// Package lz4block provides LZ4 BlockSize types and pools of buffers. -package lz4block - -import "sync" - -const ( - Block64Kb uint32 = 1 << (16 + iota*2) - Block256Kb - Block1Mb - Block4Mb -) - -var ( - BlockPool64K = sync.Pool{New: func() interface{} { return make([]byte, Block64Kb) }} - BlockPool256K = sync.Pool{New: func() interface{} { return make([]byte, Block256Kb) }} - BlockPool1M = sync.Pool{New: func() interface{} { return make([]byte, Block1Mb) }} - BlockPool4M = sync.Pool{New: func() interface{} { return make([]byte, Block4Mb) }} -) - -func Index(b uint32) BlockSizeIndex { - switch b { - case Block64Kb: - return 4 - case Block256Kb: - return 5 - case Block1Mb: - return 6 - case Block4Mb: - return 7 - } - return 0 -} - -func IsValid(b uint32) bool { - return Index(b) > 0 -} - -type BlockSizeIndex uint8 - -func (b BlockSizeIndex) IsValid() bool { - switch b { - case 4, 5, 6, 7: - return true - } - return false -} - -func (b BlockSizeIndex) Get() []byte { - var buf interface{} - switch b { - case 4: - buf = BlockPool64K.Get() - case 5: - buf = BlockPool256K.Get() - case 6: - buf = BlockPool1M.Get() - case 7: - buf = BlockPool4M.Get() - } - return buf.([]byte) -} - -func (b BlockSizeIndex) Put(buf []byte) { - // Safeguard: do not allow invalid buffers. - switch c := uint32(cap(buf)); b { - case 4: - if c == Block64Kb { - BlockPool64K.Put(buf[:c]) - } - case 5: - if c == Block256Kb { - BlockPool256K.Put(buf[:c]) - } - case 6: - if c == Block1Mb { - BlockPool1M.Put(buf[:c]) - } - case 7: - if c == Block4Mb { - BlockPool4M.Put(buf[:c]) - } - } -} - -type CompressionLevel uint32 - -const Fast CompressionLevel = 0 diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_amd64.s b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_amd64.s deleted file mode 100644 index be79faa3fe..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_amd64.s +++ /dev/null @@ -1,369 +0,0 @@ -// +build !appengine -// +build gc -// +build !noasm - -#include "textflag.h" - -// AX scratch -// BX scratch -// CX scratch -// DX token -// -// DI &dst -// SI &src -// R8 &dst + len(dst) -// R9 &src + len(src) -// R11 &dst -// R12 short output end -// R13 short input end -// func decodeBlock(dst, src []byte) int -// using 50 bytes of stack currently -TEXT ·decodeBlock(SB), NOSPLIT, $64-56 - MOVQ dst_base+0(FP), DI - MOVQ DI, R11 - MOVQ dst_len+8(FP), R8 - ADDQ DI, R8 - - MOVQ src_base+24(FP), SI - MOVQ src_len+32(FP), R9 - CMPQ R9, $0 - JE err_corrupt - ADDQ SI, R9 - - // shortcut ends - // short output end - MOVQ R8, R12 - SUBQ $32, R12 - // short input end - MOVQ R9, R13 - SUBQ $16, R13 - -loop: - // for si < len(src) - CMPQ SI, R9 - JGE end - - // token := uint32(src[si]) - MOVBQZX (SI), DX - INCQ SI - - // lit_len = token >> 4 - // if lit_len > 0 - // CX = lit_len - MOVQ DX, CX - SHRQ $4, CX - - // if lit_len != 0xF - CMPQ CX, $0xF - JEQ lit_len_loop_pre - CMPQ DI, R12 - JGE lit_len_loop_pre - CMPQ SI, R13 - JGE lit_len_loop_pre - - // copy shortcut - - // A two-stage shortcut for the most common case: - // 1) If the literal length is 0..14, and there is enough space, - // enter the shortcut and copy 16 bytes on behalf of the literals - // (in the fast mode, only 8 bytes can be safely copied this way). - // 2) Further if the match length is 4..18, copy 18 bytes in a similar - // manner; but we ensure that there's enough space in the output for - // those 18 bytes earlier, upon entering the shortcut (in other words, - // there is a combined check for both stages). - - // copy literal - MOVOU (SI), X0 - MOVOU X0, (DI) - ADDQ CX, DI - ADDQ CX, SI - - MOVQ DX, CX - ANDQ $0xF, CX - - // The second stage: prepare for match copying, decode full info. - // If it doesn't work out, the info won't be wasted. - // offset := uint16(data[:2]) - MOVWQZX (SI), DX - ADDQ $2, SI - - MOVQ DI, AX - SUBQ DX, AX - CMPQ AX, DI - JGT err_short_buf - - // if we can't do the second stage then jump straight to read the - // match length, we already have the offset. - CMPQ CX, $0xF - JEQ match_len_loop_pre - CMPQ DX, $8 - JLT match_len_loop_pre - CMPQ AX, R11 - JLT err_short_buf - - // memcpy(op + 0, match + 0, 8); - MOVQ (AX), BX - MOVQ BX, (DI) - // memcpy(op + 8, match + 8, 8); - MOVQ 8(AX), BX - MOVQ BX, 8(DI) - // memcpy(op +16, match +16, 2); - MOVW 16(AX), BX - MOVW BX, 16(DI) - - LEAQ 4(DI)(CX*1), DI // minmatch - - // shortcut complete, load next token - JMP loop - -lit_len_loop_pre: - // if lit_len > 0 - CMPQ CX, $0 - JEQ offset - CMPQ CX, $0xF - JNE copy_literal - -lit_len_loop: - // for src[si] == 0xFF - CMPB (SI), $0xFF - JNE lit_len_finalise - - // bounds check src[si+1] - LEAQ 1(SI), AX - CMPQ AX, R9 - JGT err_short_buf - - // lit_len += 0xFF - ADDQ $0xFF, CX - INCQ SI - JMP lit_len_loop - -lit_len_finalise: - // lit_len += int(src[si]) - // si++ - MOVBQZX (SI), AX - ADDQ AX, CX - INCQ SI - -copy_literal: - // bounds check src and dst - LEAQ (SI)(CX*1), AX - CMPQ AX, R9 - JGT err_short_buf - - LEAQ (DI)(CX*1), AX - CMPQ AX, R8 - JGT err_short_buf - - // whats a good cut off to call memmove? - CMPQ CX, $16 - JGT memmove_lit - - // if len(dst[di:]) < 16 - MOVQ R8, AX - SUBQ DI, AX - CMPQ AX, $16 - JLT memmove_lit - - // if len(src[si:]) < 16 - MOVQ R9, AX - SUBQ SI, AX - CMPQ AX, $16 - JLT memmove_lit - - MOVOU (SI), X0 - MOVOU X0, (DI) - - JMP finish_lit_copy - -memmove_lit: - // memmove(to, from, len) - MOVQ DI, 0(SP) - MOVQ SI, 8(SP) - MOVQ CX, 16(SP) - // spill - MOVQ DI, 24(SP) - MOVQ SI, 32(SP) - MOVQ CX, 40(SP) // need len to inc SI, DI after - MOVB DX, 48(SP) - CALL runtime·memmove(SB) - - // restore registers - MOVQ 24(SP), DI - MOVQ 32(SP), SI - MOVQ 40(SP), CX - MOVB 48(SP), DX - - // recalc initial values - MOVQ dst_base+0(FP), R8 - MOVQ R8, R11 - ADDQ dst_len+8(FP), R8 - MOVQ src_base+24(FP), R9 - ADDQ src_len+32(FP), R9 - MOVQ R8, R12 - SUBQ $32, R12 - MOVQ R9, R13 - SUBQ $16, R13 - -finish_lit_copy: - ADDQ CX, SI - ADDQ CX, DI - - CMPQ SI, R9 - JGE end - -offset: - // CX := mLen - // free up DX to use for offset - MOVQ DX, CX - - LEAQ 2(SI), AX - CMPQ AX, R9 - JGT err_short_buf - - // offset - // DX := int(src[si]) | int(src[si+1])<<8 - MOVWQZX (SI), DX - ADDQ $2, SI - - // 0 offset is invalid - CMPQ DX, $0 - JEQ err_corrupt - - ANDB $0xF, CX - -match_len_loop_pre: - // if mlen != 0xF - CMPB CX, $0xF - JNE copy_match - -match_len_loop: - // for src[si] == 0xFF - // lit_len += 0xFF - CMPB (SI), $0xFF - JNE match_len_finalise - - // bounds check src[si+1] - LEAQ 1(SI), AX - CMPQ AX, R9 - JGT err_short_buf - - ADDQ $0xFF, CX - INCQ SI - JMP match_len_loop - -match_len_finalise: - // lit_len += int(src[si]) - // si++ - MOVBQZX (SI), AX - ADDQ AX, CX - INCQ SI - -copy_match: - // mLen += minMatch - ADDQ $4, CX - - // check we have match_len bytes left in dst - // di+match_len < len(dst) - LEAQ (DI)(CX*1), AX - CMPQ AX, R8 - JGT err_short_buf - - // DX = offset - // CX = match_len - // BX = &dst + (di - offset) - MOVQ DI, BX - SUBQ DX, BX - - // check BX is within dst - // if BX < &dst - CMPQ BX, R11 - JLT err_short_buf - - // if offset + match_len < di - LEAQ (BX)(CX*1), AX - CMPQ DI, AX - JGT copy_interior_match - - // AX := len(dst[:di]) - // MOVQ DI, AX - // SUBQ R11, AX - - // copy 16 bytes at a time - // if di-offset < 16 copy 16-(di-offset) bytes to di - // then do the remaining - -copy_match_loop: - // for match_len >= 0 - // dst[di] = dst[i] - // di++ - // i++ - MOVB (BX), AX - MOVB AX, (DI) - INCQ DI - INCQ BX - DECQ CX - - CMPQ CX, $0 - JGT copy_match_loop - - JMP loop - -copy_interior_match: - CMPQ CX, $16 - JGT memmove_match - - // if len(dst[di:]) < 16 - MOVQ R8, AX - SUBQ DI, AX - CMPQ AX, $16 - JLT memmove_match - - MOVOU (BX), X0 - MOVOU X0, (DI) - - ADDQ CX, DI - JMP loop - -memmove_match: - // memmove(to, from, len) - MOVQ DI, 0(SP) - MOVQ BX, 8(SP) - MOVQ CX, 16(SP) - // spill - MOVQ DI, 24(SP) - MOVQ SI, 32(SP) - MOVQ CX, 40(SP) // need len to inc SI, DI after - CALL runtime·memmove(SB) - - // restore registers - MOVQ 24(SP), DI - MOVQ 32(SP), SI - MOVQ 40(SP), CX - - // recalc initial values - MOVQ dst_base+0(FP), R8 - MOVQ R8, R11 // TODO: make these sensible numbers - ADDQ dst_len+8(FP), R8 - MOVQ src_base+24(FP), R9 - ADDQ src_len+32(FP), R9 - MOVQ R8, R12 - SUBQ $32, R12 - MOVQ R9, R13 - SUBQ $16, R13 - - ADDQ CX, DI - JMP loop - -err_corrupt: - MOVQ $-1, ret+48(FP) - RET - -err_short_buf: - MOVQ $-2, ret+48(FP) - RET - -end: - SUBQ R11, DI - MOVQ DI, ret+48(FP) - RET diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_arm.s b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_arm.s deleted file mode 100644 index ec94b7b3c3..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_arm.s +++ /dev/null @@ -1,201 +0,0 @@ -// +build gc -// +build !noasm - -#include "textflag.h" - -// Register allocation. -#define dst R0 -#define dstorig R1 -#define src R2 -#define dstend R3 -#define srcend R4 -#define match R5 // Match address. -#define token R6 -#define len R7 // Literal and match lengths. -#define offset R6 // Match offset; overlaps with token. -#define tmp1 R8 -#define tmp2 R9 -#define tmp3 R12 - -#define minMatch $4 - -// func decodeBlock(dst, src []byte) int -TEXT ·decodeBlock(SB), NOFRAME|NOSPLIT, $-4-28 - MOVW dst_base +0(FP), dst - MOVW dst_len +4(FP), dstend - MOVW src_base+12(FP), src - MOVW src_len +16(FP), srcend - - CMP $0, srcend - BEQ shortSrc - - ADD dst, dstend - ADD src, srcend - - MOVW dst, dstorig - -loop: - // Read token. Extract literal length. - MOVBU.P 1(src), token - MOVW token >> 4, len - CMP $15, len - BNE readLitlenDone - -readLitlenLoop: - CMP src, srcend - BEQ shortSrc - MOVBU.P 1(src), tmp1 - ADD tmp1, len - CMP $255, tmp1 - BEQ readLitlenLoop - -readLitlenDone: - CMP $0, len - BEQ copyLiteralDone - - // Bounds check dst+len and src+len. - ADD dst, len, tmp1 - CMP dstend, tmp1 - //BHI shortDst // Uncomment for distinct error codes. - ADD src, len, tmp2 - CMP.LS srcend, tmp2 - BHI shortSrc - - // Copy literal. - CMP $4, len - BLO copyLiteralFinish - - // Copy 0-3 bytes until src is aligned. - TST $1, src - MOVBU.NE.P 1(src), tmp1 - MOVB.NE.P tmp1, 1(dst) - SUB.NE $1, len - - TST $2, src - MOVHU.NE.P 2(src), tmp2 - MOVB.NE.P tmp2, 1(dst) - MOVW.NE tmp2 >> 8, tmp1 - MOVB.NE.P tmp1, 1(dst) - SUB.NE $2, len - - B copyLiteralLoopCond - -copyLiteralLoop: - // Aligned load, unaligned write. - MOVW.P 4(src), tmp1 - MOVW tmp1 >> 8, tmp2 - MOVB tmp2, 1(dst) - MOVW tmp1 >> 16, tmp3 - MOVB tmp3, 2(dst) - MOVW tmp1 >> 24, tmp2 - MOVB tmp2, 3(dst) - MOVB.P tmp1, 4(dst) -copyLiteralLoopCond: - // Loop until len-4 < 0. - SUB.S $4, len - BPL copyLiteralLoop - - // Restore len, which is now negative. - ADD $4, len - -copyLiteralFinish: - // Copy remaining 0-3 bytes. - TST $2, len - MOVHU.NE.P 2(src), tmp2 - MOVB.NE.P tmp2, 1(dst) - MOVW.NE tmp2 >> 8, tmp1 - MOVB.NE.P tmp1, 1(dst) - TST $1, len - MOVBU.NE.P 1(src), tmp1 - MOVB.NE.P tmp1, 1(dst) - -copyLiteralDone: - CMP src, srcend - BEQ end - - // Initial part of match length. - // This frees up the token register for reuse as offset. - AND $15, token, len - - // Read offset. - ADD $2, src - CMP srcend, src - BHI shortSrc - MOVBU -2(src), offset - MOVBU -1(src), tmp1 - ORR tmp1 << 8, offset - CMP $0, offset - BEQ corrupt - - // Read rest of match length. - CMP $15, len - BNE readMatchlenDone - -readMatchlenLoop: - CMP src, srcend - BEQ shortSrc - MOVBU.P 1(src), tmp1 - ADD tmp1, len - CMP $255, tmp1 - BEQ readMatchlenLoop - -readMatchlenDone: - ADD minMatch, len - - // Bounds check dst+len and match = dst-offset. - ADD dst, len, tmp1 - CMP dstend, tmp1 - //BHI shortDst // Uncomment for distinct error codes. - SUB offset, dst, match - CMP.LS match, dstorig - BHI corrupt - - // If the offset is at least four (len is, because of minMatch), - // do a four-way unrolled byte copy loop. Using MOVD instead of four - // byte loads is much faster, but to remain portable we'd have to - // align match first, which in turn is too expensive. - CMP $4, offset - BLO copyMatch - - SUB $4, len -copyMatch4: - MOVBU.P 4(match), tmp1 - MOVB.P tmp1, 4(dst) - MOVBU -3(match), tmp2 - MOVB tmp2, -3(dst) - MOVBU -2(match), tmp3 - MOVB tmp3, -2(dst) - MOVBU -1(match), tmp1 - MOVB tmp1, -1(dst) - SUB.S $4, len - BPL copyMatch4 - - // Restore len, which is now negative. - ADD.S $4, len - BEQ copyMatchDone - -copyMatch: - // Simple byte-at-a-time copy. - SUB.S $1, len - MOVBU.P 1(match), tmp2 - MOVB.P tmp2, 1(dst) - BNE copyMatch - -copyMatchDone: - CMP src, srcend - BNE loop - -end: - SUB dstorig, dst, tmp1 - MOVW tmp1, ret+24(FP) - RET - - // The three error cases have distinct labels so we can put different - // return codes here when debugging, or if the error returns need to - // be changed. -shortDst: -shortSrc: -corrupt: - MOVW $-1, tmp1 - MOVW tmp1, ret+24(FP) - RET diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_asm.go b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_asm.go deleted file mode 100644 index e26f8cd613..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_asm.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build amd64 arm -// +build !appengine -// +build gc -// +build !noasm - -package lz4block - -//go:noescape -func decodeBlock(dst, src []byte) int diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_other.go b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_other.go deleted file mode 100644 index 9065653a9f..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_other.go +++ /dev/null @@ -1,100 +0,0 @@ -// +build !amd64,!arm appengine !gc noasm - -package lz4block - -func decodeBlock(dst, src []byte) (ret int) { - const hasError = -2 - defer func() { - if recover() != nil { - ret = hasError - } - }() - - var si, di uint - for { - // Literals and match lengths (token). - b := uint(src[si]) - si++ - - // Literals. - if lLen := b >> 4; lLen > 0 { - switch { - case lLen < 0xF && si+16 < uint(len(src)): - // Shortcut 1 - // if we have enough room in src and dst, and the literals length - // is small enough (0..14) then copy all 16 bytes, even if not all - // are part of the literals. - copy(dst[di:], src[si:si+16]) - si += lLen - di += lLen - if mLen := b & 0xF; mLen < 0xF { - // Shortcut 2 - // if the match length (4..18) fits within the literals, then copy - // all 18 bytes, even if not all are part of the literals. - mLen += 4 - if offset := uint(src[si]) | uint(src[si+1])<<8; mLen <= offset { - i := di - offset - end := i + 18 - if end > uint(len(dst)) { - // The remaining buffer may not hold 18 bytes. - // See https://github.com/pierrec/lz4/issues/51. - end = uint(len(dst)) - } - copy(dst[di:], dst[i:end]) - si += 2 - di += mLen - continue - } - } - case lLen == 0xF: - for src[si] == 0xFF { - lLen += 0xFF - si++ - } - lLen += uint(src[si]) - si++ - fallthrough - default: - copy(dst[di:di+lLen], src[si:si+lLen]) - si += lLen - di += lLen - } - } - if si == uint(len(src)) { - return int(di) - } else if si > uint(len(src)) { - return hasError - } - - offset := uint(src[si]) | uint(src[si+1])<<8 - if offset == 0 { - return hasError - } - si += 2 - - // Match. - mLen := b & 0xF - if mLen == 0xF { - for src[si] == 0xFF { - mLen += 0xFF - si++ - } - mLen += uint(src[si]) - si++ - } - mLen += minMatch - - // Copy the match. - expanded := dst[di-offset:] - if mLen > offset { - // Efficiently copy the match dst[di-offset:di] into the dst slice. - bytesToCopy := offset * (mLen / offset) - for n := offset; n <= bytesToCopy+offset; n *= 2 { - copy(expanded[n:], expanded[:n]) - } - di += bytesToCopy - mLen -= bytesToCopy - } - di += uint(copy(dst[di:di+mLen], expanded[:mLen])) - } -} diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4errors/errors.go b/vendor/github.com/pierrec/lz4/v4/internal/lz4errors/errors.go deleted file mode 100644 index 710ea42812..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/internal/lz4errors/errors.go +++ /dev/null @@ -1,19 +0,0 @@ -package lz4errors - -type Error string - -func (e Error) Error() string { return string(e) } - -const ( - ErrInvalidSourceShortBuffer Error = "lz4: invalid source or destination buffer too short" - ErrInvalidFrame Error = "lz4: bad magic number" - ErrInternalUnhandledState Error = "lz4: unhandled state" - ErrInvalidHeaderChecksum Error = "lz4: invalid header checksum" - ErrInvalidBlockChecksum Error = "lz4: invalid block checksum" - ErrInvalidFrameChecksum Error = "lz4: invalid frame checksum" - ErrOptionInvalidCompressionLevel Error = "lz4: invalid compression level" - ErrOptionClosedOrError Error = "lz4: cannot apply options on closed or in error object" - ErrOptionInvalidBlockSize Error = "lz4: invalid block size" - ErrOptionNotApplicable Error = "lz4: option not applicable" - ErrWriterNotClosed Error = "lz4: writer not closed" -) diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4stream/frame.go b/vendor/github.com/pierrec/lz4/v4/internal/lz4stream/frame.go deleted file mode 100644 index f6ab4decb7..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/internal/lz4stream/frame.go +++ /dev/null @@ -1,377 +0,0 @@ -// Package lz4stream provides the types that support reading and writing LZ4 data streams. -package lz4stream - -import ( - "encoding/binary" - "fmt" - "io" - "io/ioutil" - - "github.com/pierrec/lz4/v4/internal/lz4block" - "github.com/pierrec/lz4/v4/internal/lz4errors" - "github.com/pierrec/lz4/v4/internal/xxh32" -) - -//go:generate go run gen.go - -const ( - frameMagic uint32 = 0x184D2204 - frameSkipMagic uint32 = 0x184D2A50 -) - -func NewFrame() *Frame { - return &Frame{} -} - -type Frame struct { - buf [15]byte // frame descriptor needs at most 4(magic)+4+8+1=11 bytes - Magic uint32 - Descriptor FrameDescriptor - Blocks Blocks - Checksum uint32 - checksum xxh32.XXHZero -} - -// Reset allows reusing the Frame. -// The Descriptor configuration is not modified. -func (f *Frame) Reset(num int) { - f.Magic = 0 - f.Descriptor.Checksum = 0 - f.Descriptor.ContentSize = 0 - _ = f.Blocks.closeW(f, num) - f.Checksum = 0 -} - -func (f *Frame) InitW(dst io.Writer, num int) { - f.Magic = frameMagic - f.Descriptor.initW() - f.Blocks.initW(f, dst, num) - f.checksum.Reset() -} - -func (f *Frame) CloseW(dst io.Writer, num int) error { - if err := f.Blocks.closeW(f, num); err != nil { - return err - } - buf := f.buf[:0] - // End mark (data block size of uint32(0)). - buf = append(buf, 0, 0, 0, 0) - if f.Descriptor.Flags.ContentChecksum() { - buf = f.checksum.Sum(buf) - } - _, err := dst.Write(buf) - return err -} - -func (f *Frame) InitR(src io.Reader) error { - if f.Magic > 0 { - // Header already read. - return nil - } - -newFrame: - var err error - if f.Magic, err = f.readUint32(src); err != nil { - return err - } - switch m := f.Magic; { - case m == frameMagic: - // All 16 values of frameSkipMagic are valid. - case m>>8 == frameSkipMagic>>8: - var skip uint32 - if err := binary.Read(src, binary.LittleEndian, &skip); err != nil { - return err - } - if _, err := io.CopyN(ioutil.Discard, src, int64(skip)); err != nil { - return err - } - goto newFrame - default: - return lz4errors.ErrInvalidFrame - } - if err := f.Descriptor.initR(f, src); err != nil { - return err - } - f.Blocks.initR(f) - f.checksum.Reset() - return nil -} - -func (f *Frame) CloseR(src io.Reader) (err error) { - if !f.Descriptor.Flags.ContentChecksum() { - return nil - } - if f.Checksum, err = f.readUint32(src); err != nil { - return err - } - if c := f.checksum.Sum32(); c != f.Checksum { - return fmt.Errorf("%w: got %x; expected %x", lz4errors.ErrInvalidFrameChecksum, c, f.Checksum) - } - return nil -} - -type FrameDescriptor struct { - Flags DescriptorFlags - ContentSize uint64 - Checksum uint8 -} - -func (fd *FrameDescriptor) initW() { - fd.Flags.VersionSet(1) - fd.Flags.BlockIndependenceSet(true) -} - -func (fd *FrameDescriptor) Write(f *Frame, dst io.Writer) error { - if fd.Checksum > 0 { - // Header already written. - return nil - } - - buf := f.buf[:4+2] - // Write the magic number here even though it belongs to the Frame. - binary.LittleEndian.PutUint32(buf, f.Magic) - binary.LittleEndian.PutUint16(buf[4:], uint16(fd.Flags)) - - if fd.Flags.Size() { - buf = buf[:4+2+8] - binary.LittleEndian.PutUint64(buf[4+2:], fd.ContentSize) - } - fd.Checksum = descriptorChecksum(buf[4:]) - buf = append(buf, fd.Checksum) - - _, err := dst.Write(buf) - return err -} - -func (fd *FrameDescriptor) initR(f *Frame, src io.Reader) error { - // Read the flags and the checksum, hoping that there is not content size. - buf := f.buf[:3] - if _, err := io.ReadFull(src, buf); err != nil { - return err - } - descr := binary.LittleEndian.Uint16(buf) - fd.Flags = DescriptorFlags(descr) - if fd.Flags.Size() { - // Append the 8 missing bytes. - buf = buf[:3+8] - if _, err := io.ReadFull(src, buf[3:]); err != nil { - return err - } - fd.ContentSize = binary.LittleEndian.Uint64(buf[2:]) - } - fd.Checksum = buf[len(buf)-1] // the checksum is the last byte - buf = buf[:len(buf)-1] // all descriptor fields except checksum - if c := descriptorChecksum(buf); fd.Checksum != c { - return fmt.Errorf("%w: got %x; expected %x", lz4errors.ErrInvalidHeaderChecksum, c, fd.Checksum) - } - // Validate the elements that can be. - if idx := fd.Flags.BlockSizeIndex(); !idx.IsValid() { - return lz4errors.ErrOptionInvalidBlockSize - } - return nil -} - -func descriptorChecksum(buf []byte) byte { - return byte(xxh32.ChecksumZero(buf) >> 8) -} - -type Blocks struct { - Block *FrameDataBlock - Blocks chan chan *FrameDataBlock - err error -} - -func (b *Blocks) initW(f *Frame, dst io.Writer, num int) { - size := f.Descriptor.Flags.BlockSizeIndex() - if num == 1 { - b.Blocks = nil - b.Block = NewFrameDataBlock(size) - return - } - b.Block = nil - if cap(b.Blocks) != num { - b.Blocks = make(chan chan *FrameDataBlock, num) - } - // goroutine managing concurrent block compression goroutines. - go func() { - // Process next block compression item. - for c := range b.Blocks { - // Read the next compressed block result. - // Waiting here ensures that the blocks are output in the order they were sent. - // The incoming channel is always closed as it indicates to the caller that - // the block has been processed. - block := <-c - if block == nil { - // Notify the block compression routine that we are done with its result. - // This is used when a sentinel block is sent to terminate the compression. - close(c) - return - } - // Do not attempt to write the block upon any previous failure. - if b.err == nil { - // Write the block. - if err := block.Write(f, dst); err != nil && b.err == nil { - // Keep the first error. - b.err = err - // All pending compression goroutines need to shut down, so we need to keep going. - } - } - close(c) - } - }() -} - -func (b *Blocks) closeW(f *Frame, num int) error { - if num == 1 { - if b.Block == nil { - // Not initialized yet. - return nil - } - b.Block.CloseW(f) - return nil - } - if b.Blocks == nil { - // Not initialized yet. - return nil - } - c := make(chan *FrameDataBlock) - b.Blocks <- c - c <- nil - <-c - err := b.err - b.err = nil - return err -} - -func (b *Blocks) initR(f *Frame) { - size := f.Descriptor.Flags.BlockSizeIndex() - b.Block = NewFrameDataBlock(size) -} - -func NewFrameDataBlock(size lz4block.BlockSizeIndex) *FrameDataBlock { - buf := size.Get() - return &FrameDataBlock{Data: buf, data: buf} -} - -type FrameDataBlock struct { - Size DataBlockSize - Data []byte // compressed or uncompressed data (.data or .src) - Checksum uint32 - data []byte // buffer for compressed data - src []byte // uncompressed data -} - -func (b *FrameDataBlock) CloseW(f *Frame) { - if b.data != nil { - // Block was not already closed. - size := f.Descriptor.Flags.BlockSizeIndex() - size.Put(b.data) - b.Data = nil - b.data = nil - b.src = nil - } -} - -// Block compression errors are ignored since the buffer is sized appropriately. -func (b *FrameDataBlock) Compress(f *Frame, src []byte, level lz4block.CompressionLevel) *FrameDataBlock { - data := b.data[:len(src)] // trigger the incompressible flag in CompressBlock - var n int - switch level { - case lz4block.Fast: - n, _ = lz4block.CompressBlock(src, data) - default: - n, _ = lz4block.CompressBlockHC(src, data, level) - } - if n == 0 { - b.Size.UncompressedSet(true) - b.Data = src - } else { - b.Size.UncompressedSet(false) - b.Data = data[:n] - } - b.Size.sizeSet(len(b.Data)) - b.src = src // keep track of the source for content checksum - - if f.Descriptor.Flags.BlockChecksum() { - b.Checksum = xxh32.ChecksumZero(src) - } - return b -} - -func (b *FrameDataBlock) Write(f *Frame, dst io.Writer) error { - if f.Descriptor.Flags.ContentChecksum() { - _, _ = f.checksum.Write(b.src) - } - buf := f.buf[:] - binary.LittleEndian.PutUint32(buf, uint32(b.Size)) - if _, err := dst.Write(buf[:4]); err != nil { - return err - } - - if _, err := dst.Write(b.Data); err != nil { - return err - } - - if b.Checksum == 0 { - return nil - } - binary.LittleEndian.PutUint32(buf, b.Checksum) - _, err := dst.Write(buf[:4]) - return err -} - -func (b *FrameDataBlock) Uncompress(f *Frame, src io.Reader, dst []byte) (int, error) { - x, err := f.readUint32(src) - if err != nil { - return 0, err - } - b.Size = DataBlockSize(x) - if b.Size == 0 { - // End of frame reached. - return 0, io.EOF - } - - isCompressed := !b.Size.Uncompressed() - size := b.Size.size() - var data []byte - if isCompressed { - // Data is first copied into b.Data and then it will get uncompressed into dst. - data = b.Data - } else { - // Data is directly copied into dst as it is not compressed. - data = dst - } - data = data[:size] - if _, err := io.ReadFull(src, data); err != nil { - return 0, err - } - if isCompressed { - n, err := lz4block.UncompressBlock(data, dst) - if err != nil { - return 0, err - } - data = dst[:n] - } - - if f.Descriptor.Flags.BlockChecksum() { - var err error - if b.Checksum, err = f.readUint32(src); err != nil { - return 0, err - } - if c := xxh32.ChecksumZero(data); c != b.Checksum { - return 0, fmt.Errorf("%w: got %x; expected %x", lz4errors.ErrInvalidBlockChecksum, c, b.Checksum) - } - } - if f.Descriptor.Flags.ContentChecksum() { - _, _ = f.checksum.Write(data) - } - return len(data), nil -} - -func (f *Frame) readUint32(r io.Reader) (x uint32, err error) { - if _, err = io.ReadFull(r, f.buf[:4]); err != nil { - return - } - x = binary.LittleEndian.Uint32(f.buf[:4]) - return -} diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4stream/frame_gen.go b/vendor/github.com/pierrec/lz4/v4/internal/lz4stream/frame_gen.go deleted file mode 100644 index d33a6be95c..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/internal/lz4stream/frame_gen.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by `gen.exe`. DO NOT EDIT. - -package lz4stream - -import "github.com/pierrec/lz4/v4/internal/lz4block" - -// DescriptorFlags is defined as follow: -// field bits -// ----- ---- -// _ 2 -// ContentChecksum 1 -// Size 1 -// BlockChecksum 1 -// BlockIndependence 1 -// Version 2 -// _ 4 -// BlockSizeIndex 3 -// _ 1 -type DescriptorFlags uint16 - -// Getters. -func (x DescriptorFlags) ContentChecksum() bool { return x>>2&1 != 0 } -func (x DescriptorFlags) Size() bool { return x>>3&1 != 0 } -func (x DescriptorFlags) BlockChecksum() bool { return x>>4&1 != 0 } -func (x DescriptorFlags) BlockIndependence() bool { return x>>5&1 != 0 } -func (x DescriptorFlags) Version() uint16 { return uint16(x >> 6 & 0x3) } -func (x DescriptorFlags) BlockSizeIndex() lz4block.BlockSizeIndex { - return lz4block.BlockSizeIndex(x >> 12 & 0x7) -} - -// Setters. -func (x *DescriptorFlags) ContentChecksumSet(v bool) *DescriptorFlags { - const b = 1 << 2 - if v { - *x = *x&^b | b - } else { - *x &^= b - } - return x -} -func (x *DescriptorFlags) SizeSet(v bool) *DescriptorFlags { - const b = 1 << 3 - if v { - *x = *x&^b | b - } else { - *x &^= b - } - return x -} -func (x *DescriptorFlags) BlockChecksumSet(v bool) *DescriptorFlags { - const b = 1 << 4 - if v { - *x = *x&^b | b - } else { - *x &^= b - } - return x -} -func (x *DescriptorFlags) BlockIndependenceSet(v bool) *DescriptorFlags { - const b = 1 << 5 - if v { - *x = *x&^b | b - } else { - *x &^= b - } - return x -} -func (x *DescriptorFlags) VersionSet(v uint16) *DescriptorFlags { - *x = *x&^(0x3<<6) | (DescriptorFlags(v) & 0x3 << 6) - return x -} -func (x *DescriptorFlags) BlockSizeIndexSet(v lz4block.BlockSizeIndex) *DescriptorFlags { - *x = *x&^(0x7<<12) | (DescriptorFlags(v) & 0x7 << 12) - return x -} - -// Code generated by `gen.exe`. DO NOT EDIT. - -// DataBlockSize is defined as follow: -// field bits -// ----- ---- -// size 31 -// Uncompressed 1 -type DataBlockSize uint32 - -// Getters. -func (x DataBlockSize) size() int { return int(x & 0x7FFFFFFF) } -func (x DataBlockSize) Uncompressed() bool { return x>>31&1 != 0 } - -// Setters. -func (x *DataBlockSize) sizeSet(v int) *DataBlockSize { - *x = *x&^0x7FFFFFFF | DataBlockSize(v)&0x7FFFFFFF - return x -} -func (x *DataBlockSize) UncompressedSet(v bool) *DataBlockSize { - const b = 1 << 31 - if v { - *x = *x&^b | b - } else { - *x &^= b - } - return x -} diff --git a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero.go b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero.go deleted file mode 100644 index 8d3206a87c..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero.go +++ /dev/null @@ -1,212 +0,0 @@ -// Package xxh32 implements the very fast XXH hashing algorithm (32 bits version). -// (https://github.com/Cyan4973/XXH/) -package xxh32 - -import ( - "encoding/binary" -) - -const ( - prime1 uint32 = 2654435761 - prime2 uint32 = 2246822519 - prime3 uint32 = 3266489917 - prime4 uint32 = 668265263 - prime5 uint32 = 374761393 - - primeMask = 0xFFFFFFFF - prime1plus2 = uint32((uint64(prime1) + uint64(prime2)) & primeMask) // 606290984 - prime1minus = uint32((-int64(prime1)) & primeMask) // 1640531535 -) - -// XXHZero represents an xxhash32 object with seed 0. -type XXHZero struct { - v [4]uint32 - totalLen uint64 - buf [16]byte - bufused int -} - -// Sum appends the current hash to b and returns the resulting slice. -// It does not change the underlying hash state. -func (xxh XXHZero) Sum(b []byte) []byte { - h32 := xxh.Sum32() - return append(b, byte(h32), byte(h32>>8), byte(h32>>16), byte(h32>>24)) -} - -// Reset resets the Hash to its initial state. -func (xxh *XXHZero) Reset() { - xxh.v[0] = prime1plus2 - xxh.v[1] = prime2 - xxh.v[2] = 0 - xxh.v[3] = prime1minus - xxh.totalLen = 0 - xxh.bufused = 0 -} - -// Size returns the number of bytes returned by Sum(). -func (xxh *XXHZero) Size() int { - return 4 -} - -// BlockSizeIndex gives the minimum number of bytes accepted by Write(). -func (xxh *XXHZero) BlockSize() int { - return 1 -} - -// Write adds input bytes to the Hash. -// It never returns an error. -func (xxh *XXHZero) Write(input []byte) (int, error) { - if xxh.totalLen == 0 { - xxh.Reset() - } - n := len(input) - m := xxh.bufused - - xxh.totalLen += uint64(n) - - r := len(xxh.buf) - m - if n < r { - copy(xxh.buf[m:], input) - xxh.bufused += len(input) - return n, nil - } - - var buf *[16]byte - if m != 0 { - // some data left from previous update - buf = &xxh.buf - c := copy(buf[m:], input) - n -= c - input = input[c:] - } - update(&xxh.v, buf, input) - xxh.bufused = copy(xxh.buf[:], input[n-n%16:]) - - return n, nil -} - -// Portable version of update. This updates v by processing all of buf -// (if not nil) and all full 16-byte blocks of input. -func updateGo(v *[4]uint32, buf *[16]byte, input []byte) { - // Causes compiler to work directly from registers instead of stack: - v1, v2, v3, v4 := v[0], v[1], v[2], v[3] - - if buf != nil { - v1 = rol13(v1+binary.LittleEndian.Uint32(buf[:])*prime2) * prime1 - v2 = rol13(v2+binary.LittleEndian.Uint32(buf[4:])*prime2) * prime1 - v3 = rol13(v3+binary.LittleEndian.Uint32(buf[8:])*prime2) * prime1 - v4 = rol13(v4+binary.LittleEndian.Uint32(buf[12:])*prime2) * prime1 - } - - for ; len(input) >= 16; input = input[16:] { - sub := input[:16] //BCE hint for compiler - v1 = rol13(v1+binary.LittleEndian.Uint32(sub[:])*prime2) * prime1 - v2 = rol13(v2+binary.LittleEndian.Uint32(sub[4:])*prime2) * prime1 - v3 = rol13(v3+binary.LittleEndian.Uint32(sub[8:])*prime2) * prime1 - v4 = rol13(v4+binary.LittleEndian.Uint32(sub[12:])*prime2) * prime1 - } - v[0], v[1], v[2], v[3] = v1, v2, v3, v4 -} - -// Sum32 returns the 32 bits Hash value. -func (xxh *XXHZero) Sum32() uint32 { - h32 := uint32(xxh.totalLen) - if h32 >= 16 { - h32 += rol1(xxh.v[0]) + rol7(xxh.v[1]) + rol12(xxh.v[2]) + rol18(xxh.v[3]) - } else { - h32 += prime5 - } - - p := 0 - n := xxh.bufused - buf := xxh.buf - for n := n - 4; p <= n; p += 4 { - h32 += binary.LittleEndian.Uint32(buf[p:p+4]) * prime3 - h32 = rol17(h32) * prime4 - } - for ; p < n; p++ { - h32 += uint32(buf[p]) * prime5 - h32 = rol11(h32) * prime1 - } - - h32 ^= h32 >> 15 - h32 *= prime2 - h32 ^= h32 >> 13 - h32 *= prime3 - h32 ^= h32 >> 16 - - return h32 -} - -// Portable version of ChecksumZero. -func checksumZeroGo(input []byte) uint32 { - n := len(input) - h32 := uint32(n) - - if n < 16 { - h32 += prime5 - } else { - v1 := prime1plus2 - v2 := prime2 - v3 := uint32(0) - v4 := prime1minus - p := 0 - for n := n - 16; p <= n; p += 16 { - sub := input[p:][:16] //BCE hint for compiler - v1 = rol13(v1+binary.LittleEndian.Uint32(sub[:])*prime2) * prime1 - v2 = rol13(v2+binary.LittleEndian.Uint32(sub[4:])*prime2) * prime1 - v3 = rol13(v3+binary.LittleEndian.Uint32(sub[8:])*prime2) * prime1 - v4 = rol13(v4+binary.LittleEndian.Uint32(sub[12:])*prime2) * prime1 - } - input = input[p:] - n -= p - h32 += rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4) - } - - p := 0 - for n := n - 4; p <= n; p += 4 { - h32 += binary.LittleEndian.Uint32(input[p:p+4]) * prime3 - h32 = rol17(h32) * prime4 - } - for p < n { - h32 += uint32(input[p]) * prime5 - h32 = rol11(h32) * prime1 - p++ - } - - h32 ^= h32 >> 15 - h32 *= prime2 - h32 ^= h32 >> 13 - h32 *= prime3 - h32 ^= h32 >> 16 - - return h32 -} - -func rol1(u uint32) uint32 { - return u<<1 | u>>31 -} - -func rol7(u uint32) uint32 { - return u<<7 | u>>25 -} - -func rol11(u uint32) uint32 { - return u<<11 | u>>21 -} - -func rol12(u uint32) uint32 { - return u<<12 | u>>20 -} - -func rol13(u uint32) uint32 { - return u<<13 | u>>19 -} - -func rol17(u uint32) uint32 { - return u<<17 | u>>15 -} - -func rol18(u uint32) uint32 { - return u<<18 | u>>14 -} diff --git a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.go b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.go deleted file mode 100644 index 0978b2665b..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build !noasm - -package xxh32 - -// ChecksumZero returns the 32-bit hash of input. -// -//go:noescape -func ChecksumZero(input []byte) uint32 - -//go:noescape -func update(v *[4]uint32, buf *[16]byte, input []byte) diff --git a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.s b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.s deleted file mode 100644 index 0e9f146a36..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.s +++ /dev/null @@ -1,259 +0,0 @@ -// +build !noasm - -#include "textflag.h" - -#define prime1 $2654435761 -#define prime2 $2246822519 -#define prime3 $3266489917 -#define prime4 $668265263 -#define prime5 $374761393 - -#define prime1plus2 $606290984 -#define prime1minus $1640531535 - -// Register allocation. -#define p R0 -#define n R1 -#define h R2 -#define v1 R2 // Alias for h. -#define v2 R3 -#define v3 R4 -#define v4 R5 -#define x1 R6 -#define x2 R7 -#define x3 R8 -#define x4 R9 - -// We need the primes in registers. The 16-byte loop only uses prime{1,2}. -#define prime1r R11 -#define prime2r R12 -#define prime3r R3 // The rest can alias v{2-4}. -#define prime4r R4 -#define prime5r R5 - -// Update round macros. These read from and increment p. - -#define round16aligned \ - MOVM.IA.W (p), [x1, x2, x3, x4] \ - \ - MULA x1, prime2r, v1, v1 \ - MULA x2, prime2r, v2, v2 \ - MULA x3, prime2r, v3, v3 \ - MULA x4, prime2r, v4, v4 \ - \ - MOVW v1 @> 19, v1 \ - MOVW v2 @> 19, v2 \ - MOVW v3 @> 19, v3 \ - MOVW v4 @> 19, v4 \ - \ - MUL prime1r, v1 \ - MUL prime1r, v2 \ - MUL prime1r, v3 \ - MUL prime1r, v4 \ - -#define round16unaligned \ - MOVBU.P 16(p), x1 \ - MOVBU -15(p), x2 \ - ORR x2 << 8, x1 \ - MOVBU -14(p), x3 \ - MOVBU -13(p), x4 \ - ORR x4 << 8, x3 \ - ORR x3 << 16, x1 \ - \ - MULA x1, prime2r, v1, v1 \ - MOVW v1 @> 19, v1 \ - MUL prime1r, v1 \ - \ - MOVBU -12(p), x1 \ - MOVBU -11(p), x2 \ - ORR x2 << 8, x1 \ - MOVBU -10(p), x3 \ - MOVBU -9(p), x4 \ - ORR x4 << 8, x3 \ - ORR x3 << 16, x1 \ - \ - MULA x1, prime2r, v2, v2 \ - MOVW v2 @> 19, v2 \ - MUL prime1r, v2 \ - \ - MOVBU -8(p), x1 \ - MOVBU -7(p), x2 \ - ORR x2 << 8, x1 \ - MOVBU -6(p), x3 \ - MOVBU -5(p), x4 \ - ORR x4 << 8, x3 \ - ORR x3 << 16, x1 \ - \ - MULA x1, prime2r, v3, v3 \ - MOVW v3 @> 19, v3 \ - MUL prime1r, v3 \ - \ - MOVBU -4(p), x1 \ - MOVBU -3(p), x2 \ - ORR x2 << 8, x1 \ - MOVBU -2(p), x3 \ - MOVBU -1(p), x4 \ - ORR x4 << 8, x3 \ - ORR x3 << 16, x1 \ - \ - MULA x1, prime2r, v4, v4 \ - MOVW v4 @> 19, v4 \ - MUL prime1r, v4 \ - - -// func ChecksumZero([]byte) uint32 -TEXT ·ChecksumZero(SB), NOFRAME|NOSPLIT, $-4-16 - MOVW input_base+0(FP), p - MOVW input_len+4(FP), n - - MOVW prime1, prime1r - MOVW prime2, prime2r - - // Set up h for n < 16. It's tempting to say {ADD prime5, n, h} - // here, but that's a pseudo-op that generates a load through R11. - MOVW prime5, prime5r - ADD prime5r, n, h - CMP $0, n - BEQ end - - // We let n go negative so we can do comparisons with SUB.S - // instead of separate CMP. - SUB.S $16, n - BMI loop16done - - MOVW prime1plus2, v1 - MOVW prime2, v2 - MOVW $0, v3 - MOVW prime1minus, v4 - - TST $3, p - BNE loop16unaligned - -loop16aligned: - SUB.S $16, n - round16aligned - BPL loop16aligned - B loop16finish - -loop16unaligned: - SUB.S $16, n - round16unaligned - BPL loop16unaligned - -loop16finish: - MOVW v1 @> 31, h - ADD v2 @> 25, h - ADD v3 @> 20, h - ADD v4 @> 14, h - - // h += len(input) with v2 as temporary. - MOVW input_len+4(FP), v2 - ADD v2, h - -loop16done: - ADD $16, n // Restore number of bytes left. - - SUB.S $4, n - MOVW prime3, prime3r - BMI loop4done - MOVW prime4, prime4r - - TST $3, p - BNE loop4unaligned - -loop4aligned: - SUB.S $4, n - - MOVW.P 4(p), x1 - MULA prime3r, x1, h, h - MOVW h @> 15, h - MUL prime4r, h - - BPL loop4aligned - B loop4done - -loop4unaligned: - SUB.S $4, n - - MOVBU.P 4(p), x1 - MOVBU -3(p), x2 - ORR x2 << 8, x1 - MOVBU -2(p), x3 - ORR x3 << 16, x1 - MOVBU -1(p), x4 - ORR x4 << 24, x1 - - MULA prime3r, x1, h, h - MOVW h @> 15, h - MUL prime4r, h - - BPL loop4unaligned - -loop4done: - ADD.S $4, n // Restore number of bytes left. - BEQ end - - MOVW prime5, prime5r - -loop1: - SUB.S $1, n - - MOVBU.P 1(p), x1 - MULA prime5r, x1, h, h - MOVW h @> 21, h - MUL prime1r, h - - BNE loop1 - -end: - MOVW prime3, prime3r - EOR h >> 15, h - MUL prime2r, h - EOR h >> 13, h - MUL prime3r, h - EOR h >> 16, h - - MOVW h, ret+12(FP) - RET - - -// func update(v *[4]uint64, buf *[16]byte, p []byte) -TEXT ·update(SB), NOFRAME|NOSPLIT, $-4-20 - MOVW v+0(FP), p - MOVM.IA (p), [v1, v2, v3, v4] - - MOVW prime1, prime1r - MOVW prime2, prime2r - - // Process buf, if not nil. - MOVW buf+4(FP), p - CMP $0, p - BEQ noBuffered - - round16aligned - -noBuffered: - MOVW input_base +8(FP), p - MOVW input_len +12(FP), n - - SUB.S $16, n - BMI end - - TST $3, p - BNE loop16unaligned - -loop16aligned: - SUB.S $16, n - round16aligned - BPL loop16aligned - B end - -loop16unaligned: - SUB.S $16, n - round16unaligned - BPL loop16unaligned - -end: - MOVW v+0(FP), p - MOVM.IA [v1, v2, v3, v4], (p) - RET diff --git a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_other.go b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_other.go deleted file mode 100644 index c96b59b8c3..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_other.go +++ /dev/null @@ -1,10 +0,0 @@ -// +build !arm noasm - -package xxh32 - -// ChecksumZero returns the 32-bit hash of input. -func ChecksumZero(input []byte) uint32 { return checksumZeroGo(input) } - -func update(v *[4]uint32, buf *[16]byte, input []byte) { - updateGo(v, buf, input) -} diff --git a/vendor/github.com/pierrec/lz4/v4/lz4.go b/vendor/github.com/pierrec/lz4/v4/lz4.go deleted file mode 100644 index c585d4064f..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/lz4.go +++ /dev/null @@ -1,147 +0,0 @@ -// Package lz4 implements reading and writing lz4 compressed data. -// -// The package supports both the LZ4 stream format, -// as specified in http://fastcompression.blogspot.fr/2013/04/lz4-streaming-format-final.html, -// and the LZ4 block format, defined at -// http://fastcompression.blogspot.fr/2011/05/lz4-explained.html. -// -// See https://github.com/lz4/lz4 for the reference C implementation. -package lz4 - -import ( - "github.com/pierrec/lz4/v4/internal/lz4block" - "github.com/pierrec/lz4/v4/internal/lz4errors" -) - -func _() { - // Safety checks for duplicated elements. - var x [1]struct{} - _ = x[lz4block.CompressionLevel(Fast)-lz4block.Fast] - _ = x[Block64Kb-BlockSize(lz4block.Block64Kb)] - _ = x[Block256Kb-BlockSize(lz4block.Block256Kb)] - _ = x[Block1Mb-BlockSize(lz4block.Block1Mb)] - _ = x[Block4Mb-BlockSize(lz4block.Block4Mb)] -} - -// CompressBlockBound returns the maximum size of a given buffer of size n, when not compressible. -func CompressBlockBound(n int) int { - return lz4block.CompressBlockBound(n) -} - -// UncompressBlock uncompresses the source buffer into the destination one, -// and returns the uncompressed size. -// -// The destination buffer must be sized appropriately. -// -// An error is returned if the source data is invalid or the destination buffer is too small. -func UncompressBlock(src, dst []byte) (int, error) { - return lz4block.UncompressBlock(src, dst) -} - -// A Compressor compresses data into the LZ4 block format. -// It uses a fast compression algorithm. -// -// A Compressor is not safe for concurrent use by multiple goroutines. -// -// Use a Writer to compress into the LZ4 stream format. -type Compressor struct{ c lz4block.Compressor } - -// CompressBlock compresses the source buffer src into the destination dst. -// -// If compression is successful, the first return value is the size of the -// compressed data, which is always >0. -// -// If dst has length at least CompressBlockBound(len(src)), compression always -// succeeds. Otherwise, the first return value is zero. The error return is -// non-nil if the compressed data does not fit in dst, but it might fit in a -// larger buffer that is still smaller than CompressBlockBound(len(src)). The -// return value (0, nil) means the data is likely incompressible and a buffer -// of length CompressBlockBound(len(src)) should be passed in. -func (c *Compressor) CompressBlock(src, dst []byte) (int, error) { - return c.c.CompressBlock(src, dst) -} - -// CompressBlock compresses the source buffer into the destination one. -// This is the fast version of LZ4 compression and also the default one. -// -// The argument hashTable is scratch space for a hash table used by the -// compressor. If provided, it should have length at least 1<<16. If it is -// shorter (or nil), CompressBlock allocates its own hash table. -// -// The size of the compressed data is returned. -// -// If the destination buffer size is lower than CompressBlockBound and -// the compressed size is 0 and no error, then the data is incompressible. -// -// An error is returned if the destination buffer is too small. - -// CompressBlock is equivalent to Compressor.CompressBlock. -// The final argument is ignored and should be set to nil. -// -// This function is deprecated. Use a Compressor instead. -func CompressBlock(src, dst []byte, _ []int) (int, error) { - return lz4block.CompressBlock(src, dst) -} - -// A CompressorHC compresses data into the LZ4 block format. -// Its compression ratio is potentially better than that of a Compressor, -// but it is also slower and requires more memory. -// -// A Compressor is not safe for concurrent use by multiple goroutines. -// -// Use a Writer to compress into the LZ4 stream format. -type CompressorHC struct { - // Level is the maximum search depth for compression. - // Values <= 0 mean no maximum. - Level CompressionLevel - c lz4block.CompressorHC -} - -// CompressBlock compresses the source buffer src into the destination dst. -// -// If compression is successful, the first return value is the size of the -// compressed data, which is always >0. -// -// If dst has length at least CompressBlockBound(len(src)), compression always -// succeeds. Otherwise, the first return value is zero. The error return is -// non-nil if the compressed data does not fit in dst, but it might fit in a -// larger buffer that is still smaller than CompressBlockBound(len(src)). The -// return value (0, nil) means the data is likely incompressible and a buffer -// of length CompressBlockBound(len(src)) should be passed in. -func (c *CompressorHC) CompressBlock(src, dst []byte) (int, error) { - return c.c.CompressBlock(src, dst, lz4block.CompressionLevel(c.Level)) -} - -// CompressBlockHC is equivalent to CompressorHC.CompressBlock. -// The final two arguments are ignored and should be set to nil. -// -// This function is deprecated. Use a CompressorHC instead. -func CompressBlockHC(src, dst []byte, depth CompressionLevel, _, _ []int) (int, error) { - return lz4block.CompressBlockHC(src, dst, lz4block.CompressionLevel(depth)) -} - -const ( - // ErrInvalidSourceShortBuffer is returned by UncompressBlock or CompressBLock when a compressed - // block is corrupted or the destination buffer is not large enough for the uncompressed data. - ErrInvalidSourceShortBuffer = lz4errors.ErrInvalidSourceShortBuffer - // ErrInvalidFrame is returned when reading an invalid LZ4 archive. - ErrInvalidFrame = lz4errors.ErrInvalidFrame - // ErrInternalUnhandledState is an internal error. - ErrInternalUnhandledState = lz4errors.ErrInternalUnhandledState - // ErrInvalidHeaderChecksum is returned when reading a frame. - ErrInvalidHeaderChecksum = lz4errors.ErrInvalidHeaderChecksum - // ErrInvalidBlockChecksum is returned when reading a frame. - ErrInvalidBlockChecksum = lz4errors.ErrInvalidBlockChecksum - // ErrInvalidFrameChecksum is returned when reading a frame. - ErrInvalidFrameChecksum = lz4errors.ErrInvalidFrameChecksum - // ErrOptionInvalidCompressionLevel is returned when the supplied compression level is invalid. - ErrOptionInvalidCompressionLevel = lz4errors.ErrOptionInvalidCompressionLevel - // ErrOptionClosedOrError is returned when an option is applied to a closed or in error object. - ErrOptionClosedOrError = lz4errors.ErrOptionClosedOrError - // ErrOptionInvalidBlockSize is returned when - ErrOptionInvalidBlockSize = lz4errors.ErrOptionInvalidBlockSize - // ErrOptionNotApplicable is returned when trying to apply an option to an object not supporting it. - ErrOptionNotApplicable = lz4errors.ErrOptionNotApplicable - // ErrWriterNotClosed is returned when attempting to reset an unclosed writer. - ErrWriterNotClosed = lz4errors.ErrWriterNotClosed -) diff --git a/vendor/github.com/pierrec/lz4/v4/options.go b/vendor/github.com/pierrec/lz4/v4/options.go deleted file mode 100644 index d9a3b4d07a..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/options.go +++ /dev/null @@ -1,187 +0,0 @@ -package lz4 - -import ( - "fmt" - "reflect" - "runtime" - - "github.com/pierrec/lz4/v4/internal/lz4block" - "github.com/pierrec/lz4/v4/internal/lz4errors" -) - -//go:generate go run golang.org/x/tools/cmd/stringer -type=BlockSize,CompressionLevel -output options_gen.go - -type ( - applier interface { - Apply(...Option) error - private() - } - // Option defines the parameters to setup an LZ4 Writer or Reader. - Option func(applier) error -) - -// String returns a string representation of the option with its parameter(s). -func (o Option) String() string { - return o(nil).Error() -} - -// Default options. -var ( - DefaultBlockSizeOption = BlockSizeOption(Block4Mb) - DefaultChecksumOption = ChecksumOption(true) - DefaultConcurrency = ConcurrencyOption(1) - defaultOnBlockDone = OnBlockDoneOption(nil) -) - -const ( - Block64Kb BlockSize = 1 << (16 + iota*2) - Block256Kb - Block1Mb - Block4Mb -) - -// BlockSizeIndex defines the size of the blocks to be compressed. -type BlockSize uint32 - -// BlockSizeOption defines the maximum size of compressed blocks (default=Block4Mb). -func BlockSizeOption(size BlockSize) Option { - return func(a applier) error { - switch w := a.(type) { - case nil: - s := fmt.Sprintf("BlockSizeOption(%s)", size) - return lz4errors.Error(s) - case *Writer: - size := uint32(size) - if !lz4block.IsValid(size) { - return fmt.Errorf("%w: %d", lz4errors.ErrOptionInvalidBlockSize, size) - } - w.frame.Descriptor.Flags.BlockSizeIndexSet(lz4block.Index(size)) - return nil - } - return lz4errors.ErrOptionNotApplicable - } -} - -// BlockChecksumOption enables or disables block checksum (default=false). -func BlockChecksumOption(flag bool) Option { - return func(a applier) error { - switch w := a.(type) { - case nil: - s := fmt.Sprintf("BlockChecksumOption(%v)", flag) - return lz4errors.Error(s) - case *Writer: - w.frame.Descriptor.Flags.BlockChecksumSet(flag) - return nil - } - return lz4errors.ErrOptionNotApplicable - } -} - -// ChecksumOption enables/disables all blocks or content checksum (default=true). -func ChecksumOption(flag bool) Option { - return func(a applier) error { - switch w := a.(type) { - case nil: - s := fmt.Sprintf("BlockChecksumOption(%v)", flag) - return lz4errors.Error(s) - case *Writer: - w.frame.Descriptor.Flags.ContentChecksumSet(flag) - return nil - } - return lz4errors.ErrOptionNotApplicable - } -} - -// SizeOption sets the size of the original uncompressed data (default=0). It is useful to know the size of the -// whole uncompressed data stream. -func SizeOption(size uint64) Option { - return func(a applier) error { - switch w := a.(type) { - case nil: - s := fmt.Sprintf("SizeOption(%d)", size) - return lz4errors.Error(s) - case *Writer: - w.frame.Descriptor.Flags.SizeSet(size > 0) - w.frame.Descriptor.ContentSize = size - return nil - } - return lz4errors.ErrOptionNotApplicable - } -} - -// ConcurrencyOption sets the number of go routines used for compression. -// If n <= 0, then the output of runtime.GOMAXPROCS(0) is used. -func ConcurrencyOption(n int) Option { - return func(a applier) error { - switch w := a.(type) { - case nil: - s := fmt.Sprintf("ConcurrencyOption(%d)", n) - return lz4errors.Error(s) - case *Writer: - if n <= 0 { - n = runtime.GOMAXPROCS(0) - } - w.num = n - return nil - } - return lz4errors.ErrOptionNotApplicable - } -} - -// CompressionLevel defines the level of compression to use. The higher the better, but slower, compression. -type CompressionLevel uint32 - -const ( - Fast CompressionLevel = 0 - Level1 CompressionLevel = 1 << (8 + iota) - Level2 - Level3 - Level4 - Level5 - Level6 - Level7 - Level8 - Level9 -) - -// CompressionLevelOption defines the compression level (default=Fast). -func CompressionLevelOption(level CompressionLevel) Option { - return func(a applier) error { - switch w := a.(type) { - case nil: - s := fmt.Sprintf("CompressionLevelOption(%s)", level) - return lz4errors.Error(s) - case *Writer: - switch level { - case Fast, Level1, Level2, Level3, Level4, Level5, Level6, Level7, Level8, Level9: - default: - return fmt.Errorf("%w: %d", lz4errors.ErrOptionInvalidCompressionLevel, level) - } - w.level = lz4block.CompressionLevel(level) - return nil - } - return lz4errors.ErrOptionNotApplicable - } -} - -func onBlockDone(int) {} - -// OnBlockDoneOption is triggered when a block has been processed. For a Writer, it is when is has been compressed, -// for a Reader, it is when it has been uncompressed. -func OnBlockDoneOption(handler func(size int)) Option { - if handler == nil { - handler = onBlockDone - } - return func(a applier) error { - switch rw := a.(type) { - case nil: - s := fmt.Sprintf("OnBlockDoneOption(%s)", reflect.TypeOf(handler).String()) - return lz4errors.Error(s) - case *Writer: - rw.handler = handler - case *Reader: - rw.handler = handler - } - return nil - } -} diff --git a/vendor/github.com/pierrec/lz4/v4/options_gen.go b/vendor/github.com/pierrec/lz4/v4/options_gen.go deleted file mode 100644 index 2de814909e..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/options_gen.go +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by "stringer -type=BlockSize,CompressionLevel -output options_gen.go"; DO NOT EDIT. - -package lz4 - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[Block64Kb-65536] - _ = x[Block256Kb-262144] - _ = x[Block1Mb-1048576] - _ = x[Block4Mb-4194304] -} - -const ( - _BlockSize_name_0 = "Block64Kb" - _BlockSize_name_1 = "Block256Kb" - _BlockSize_name_2 = "Block1Mb" - _BlockSize_name_3 = "Block4Mb" -) - -func (i BlockSize) String() string { - switch { - case i == 65536: - return _BlockSize_name_0 - case i == 262144: - return _BlockSize_name_1 - case i == 1048576: - return _BlockSize_name_2 - case i == 4194304: - return _BlockSize_name_3 - default: - return "BlockSize(" + strconv.FormatInt(int64(i), 10) + ")" - } -} -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[Fast-0] - _ = x[Level1-512] - _ = x[Level2-1024] - _ = x[Level3-2048] - _ = x[Level4-4096] - _ = x[Level5-8192] - _ = x[Level6-16384] - _ = x[Level7-32768] - _ = x[Level8-65536] - _ = x[Level9-131072] -} - -const ( - _CompressionLevel_name_0 = "Fast" - _CompressionLevel_name_1 = "Level1" - _CompressionLevel_name_2 = "Level2" - _CompressionLevel_name_3 = "Level3" - _CompressionLevel_name_4 = "Level4" - _CompressionLevel_name_5 = "Level5" - _CompressionLevel_name_6 = "Level6" - _CompressionLevel_name_7 = "Level7" - _CompressionLevel_name_8 = "Level8" - _CompressionLevel_name_9 = "Level9" -) - -func (i CompressionLevel) String() string { - switch { - case i == 0: - return _CompressionLevel_name_0 - case i == 512: - return _CompressionLevel_name_1 - case i == 1024: - return _CompressionLevel_name_2 - case i == 2048: - return _CompressionLevel_name_3 - case i == 4096: - return _CompressionLevel_name_4 - case i == 8192: - return _CompressionLevel_name_5 - case i == 16384: - return _CompressionLevel_name_6 - case i == 32768: - return _CompressionLevel_name_7 - case i == 65536: - return _CompressionLevel_name_8 - case i == 131072: - return _CompressionLevel_name_9 - default: - return "CompressionLevel(" + strconv.FormatInt(int64(i), 10) + ")" - } -} diff --git a/vendor/github.com/pierrec/lz4/v4/reader.go b/vendor/github.com/pierrec/lz4/v4/reader.go deleted file mode 100644 index fb90a7fd8a..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/reader.go +++ /dev/null @@ -1,192 +0,0 @@ -package lz4 - -import ( - "io" - - "github.com/pierrec/lz4/v4/internal/lz4errors" - "github.com/pierrec/lz4/v4/internal/lz4stream" -) - -var readerStates = []aState{ - noState: newState, - errorState: newState, - newState: readState, - readState: closedState, - closedState: newState, -} - -// NewReader returns a new LZ4 frame decoder. -func NewReader(r io.Reader) *Reader { - zr := &Reader{frame: lz4stream.NewFrame()} - zr.state.init(readerStates) - _ = zr.Apply(defaultOnBlockDone) - zr.Reset(r) - return zr -} - -// Reader allows reading an LZ4 stream. -type Reader struct { - state _State - src io.Reader // source reader - frame *lz4stream.Frame // frame being read - data []byte // pending data - idx int // size of pending data - handler func(int) -} - -func (*Reader) private() {} - -func (r *Reader) Apply(options ...Option) (err error) { - defer r.state.check(&err) - switch r.state.state { - case newState: - case errorState: - return r.state.err - default: - return lz4errors.ErrOptionClosedOrError - } - for _, o := range options { - if err = o(r); err != nil { - return - } - } - return -} - -// Size returns the size of the underlying uncompressed data, if set in the stream. -func (r *Reader) Size() int { - switch r.state.state { - case readState, closedState: - if r.frame.Descriptor.Flags.Size() { - return int(r.frame.Descriptor.ContentSize) - } - } - return 0 -} - -func (r *Reader) init() error { - return r.frame.InitR(r.src) -} - -func (r *Reader) Read(buf []byte) (n int, err error) { - defer r.state.check(&err) - switch r.state.state { - case readState: - case closedState, errorState: - return 0, r.state.err - case newState: - // First initialization. - if err = r.init(); r.state.next(err) { - return - } - size := r.frame.Descriptor.Flags.BlockSizeIndex() - r.data = size.Get() - default: - return 0, r.state.fail() - } - if len(buf) == 0 { - return - } - - var bn int - if r.idx > 0 { - // Some left over data, use it. - goto fillbuf - } - // No uncompressed data yet. - r.data = r.data[:cap(r.data)] - for len(buf) >= len(r.data) { - // Input buffer large enough and no pending data: uncompress directly into it. - switch bn, err = r.frame.Blocks.Block.Uncompress(r.frame, r.src, buf); err { - case nil: - r.handler(bn) - n += bn - buf = buf[bn:] - case io.EOF: - goto close - default: - return - } - } - if n > 0 { - // Some data was read, done for now. - return - } - // Read the next block. - switch bn, err = r.frame.Blocks.Block.Uncompress(r.frame, r.src, r.data); err { - case nil: - r.handler(bn) - r.data = r.data[:bn] - goto fillbuf - case io.EOF: - default: - return - } -close: - if er := r.frame.CloseR(r.src); er != nil { - err = er - } - r.Reset(nil) - return -fillbuf: - bn = copy(buf, r.data[r.idx:]) - n += bn - r.idx += bn - if r.idx == len(r.data) { - // All data read, get ready for the next Read. - r.idx = 0 - } - return -} - -// Reset clears the state of the Reader r such that it is equivalent to its -// initial state from NewReader, but instead writing to writer. -// No access to reader is performed. -// -// w.Close must be called before Reset. -func (r *Reader) Reset(reader io.Reader) { - size := r.frame.Descriptor.Flags.BlockSizeIndex() - size.Put(r.data) - r.frame.Reset(1) - r.src = reader - r.data = nil - r.idx = 0 - r.state.reset() -} - -// WriteTo efficiently uncompresses the data from the Reader underlying source to w. -func (r *Reader) WriteTo(w io.Writer) (n int64, err error) { - switch r.state.state { - case closedState, errorState: - return 0, r.state.err - case newState: - if err = r.init(); r.state.next(err) { - return - } - default: - return 0, r.state.fail() - } - defer r.state.nextd(&err) - - var bn int - block := r.frame.Blocks.Block - size := r.frame.Descriptor.Flags.BlockSizeIndex() - data := size.Get() - defer size.Put(data) - for { - switch bn, err = block.Uncompress(r.frame, r.src, data); err { - case nil: - case io.EOF: - err = r.frame.CloseR(r.src) - return - default: - return - } - r.handler(bn) - bn, err = w.Write(data[:bn]) - n += int64(bn) - if err != nil { - return - } - } -} diff --git a/vendor/github.com/pierrec/lz4/v4/state.go b/vendor/github.com/pierrec/lz4/v4/state.go deleted file mode 100644 index d94f04d05e..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/state.go +++ /dev/null @@ -1,75 +0,0 @@ -package lz4 - -import ( - "errors" - "fmt" - "io" - - "github.com/pierrec/lz4/v4/internal/lz4errors" -) - -//go:generate go run golang.org/x/tools/cmd/stringer -type=aState -output state_gen.go - -const ( - noState aState = iota // uninitialized reader - errorState // unrecoverable error encountered - newState // instantiated object - readState // reading data - writeState // writing data - closedState // all done -) - -type ( - aState uint8 - _State struct { - states []aState - state aState - err error - } -) - -func (s *_State) init(states []aState) { - s.states = states - s.state = states[0] -} - -func (s *_State) reset() { - s.state = s.states[0] - s.err = nil -} - -// next sets the state to the next one unless it is passed a non nil error. -// It returns whether or not it is in error. -func (s *_State) next(err error) bool { - if err != nil { - s.err = fmt.Errorf("%s: %w", s.state, err) - s.state = errorState - return true - } - s.state = s.states[s.state] - return false -} - -// nextd is like next but for defers. -func (s *_State) nextd(errp *error) bool { - return errp != nil && s.next(*errp) -} - -// check sets s in error if not already in error and if the error is not nil or io.EOF, -func (s *_State) check(errp *error) { - if s.state == errorState || errp == nil { - return - } - if err := *errp; err != nil { - s.err = fmt.Errorf("%w[%s]", err, s.state) - if !errors.Is(err, io.EOF) { - s.state = errorState - } - } -} - -func (s *_State) fail() error { - s.state = errorState - s.err = fmt.Errorf("%w[%s]", lz4errors.ErrInternalUnhandledState, s.state) - return s.err -} diff --git a/vendor/github.com/pierrec/lz4/v4/state_gen.go b/vendor/github.com/pierrec/lz4/v4/state_gen.go deleted file mode 100644 index 75fb828924..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/state_gen.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by "stringer -type=aState -output state_gen.go"; DO NOT EDIT. - -package lz4 - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[noState-0] - _ = x[errorState-1] - _ = x[newState-2] - _ = x[readState-3] - _ = x[writeState-4] - _ = x[closedState-5] -} - -const _aState_name = "noStateerrorStatenewStatereadStatewriteStateclosedState" - -var _aState_index = [...]uint8{0, 7, 17, 25, 34, 44, 55} - -func (i aState) String() string { - if i >= aState(len(_aState_index)-1) { - return "aState(" + strconv.FormatInt(int64(i), 10) + ")" - } - return _aState_name[_aState_index[i]:_aState_index[i+1]] -} diff --git a/vendor/github.com/pierrec/lz4/v4/writer.go b/vendor/github.com/pierrec/lz4/v4/writer.go deleted file mode 100644 index e641be7c6a..0000000000 --- a/vendor/github.com/pierrec/lz4/v4/writer.go +++ /dev/null @@ -1,232 +0,0 @@ -package lz4 - -import ( - "io" - - "github.com/pierrec/lz4/v4/internal/lz4block" - "github.com/pierrec/lz4/v4/internal/lz4errors" - "github.com/pierrec/lz4/v4/internal/lz4stream" -) - -var writerStates = []aState{ - noState: newState, - newState: writeState, - writeState: closedState, - closedState: newState, - errorState: newState, -} - -// NewWriter returns a new LZ4 frame encoder. -func NewWriter(w io.Writer) *Writer { - zw := &Writer{frame: lz4stream.NewFrame()} - zw.state.init(writerStates) - _ = zw.Apply(DefaultBlockSizeOption, DefaultChecksumOption, DefaultConcurrency, defaultOnBlockDone) - zw.Reset(w) - return zw -} - -// Writer allows writing an LZ4 stream. -type Writer struct { - state _State - src io.Writer // destination writer - level lz4block.CompressionLevel // how hard to try - num int // concurrency level - frame *lz4stream.Frame // frame being built - data []byte // pending data - idx int // size of pending data - handler func(int) -} - -func (*Writer) private() {} - -func (w *Writer) Apply(options ...Option) (err error) { - defer w.state.check(&err) - switch w.state.state { - case newState: - case errorState: - return w.state.err - default: - return lz4errors.ErrOptionClosedOrError - } - for _, o := range options { - if err = o(w); err != nil { - return - } - } - w.Reset(w.src) - return -} - -func (w *Writer) isNotConcurrent() bool { - return w.num == 1 -} - -// init sets up the Writer when in newState. It does not change the Writer state. -func (w *Writer) init() error { - w.frame.InitW(w.src, w.num) - size := w.frame.Descriptor.Flags.BlockSizeIndex() - w.data = size.Get() - w.idx = 0 - return w.frame.Descriptor.Write(w.frame, w.src) -} - -func (w *Writer) Write(buf []byte) (n int, err error) { - defer w.state.check(&err) - switch w.state.state { - case writeState: - case closedState, errorState: - return 0, w.state.err - case newState: - if err = w.init(); w.state.next(err) { - return - } - default: - return 0, w.state.fail() - } - - zn := len(w.data) - for len(buf) > 0 { - if w.idx == 0 && len(buf) >= zn { - // Avoid a copy as there is enough data for a block. - if err = w.write(buf[:zn], false); err != nil { - return - } - n += zn - buf = buf[zn:] - continue - } - // Accumulate the data to be compressed. - m := copy(w.data[w.idx:], buf) - n += m - w.idx += m - buf = buf[m:] - - if w.idx < len(w.data) { - // Buffer not filled. - return - } - - // Buffer full. - if err = w.write(w.data, true); err != nil { - return - } - if !w.isNotConcurrent() { - size := w.frame.Descriptor.Flags.BlockSizeIndex() - w.data = size.Get() - } - w.idx = 0 - } - return -} - -func (w *Writer) write(data []byte, safe bool) error { - if w.isNotConcurrent() { - block := w.frame.Blocks.Block - err := block.Compress(w.frame, data, w.level).Write(w.frame, w.src) - w.handler(len(block.Data)) - return err - } - size := w.frame.Descriptor.Flags.BlockSizeIndex() - c := make(chan *lz4stream.FrameDataBlock) - w.frame.Blocks.Blocks <- c - go func(c chan *lz4stream.FrameDataBlock, data []byte, size lz4block.BlockSizeIndex, safe bool) { - b := lz4stream.NewFrameDataBlock(size) - c <- b.Compress(w.frame, data, w.level) - <-c - w.handler(len(b.Data)) - b.CloseW(w.frame) - if safe { - // safe to put it back as the last usage of it was FrameDataBlock.Write() called before c is closed - size.Put(data) - } - }(c, data, size, safe) - - return nil -} - -// Close closes the Writer, flushing any unwritten data to the underlying io.Writer, -// but does not close the underlying io.Writer. -func (w *Writer) Close() (err error) { - switch w.state.state { - case writeState: - case errorState: - return w.state.err - default: - return nil - } - defer w.state.nextd(&err) - if w.idx > 0 { - // Flush pending data, disable w.data freeing as it is done later on. - if err = w.write(w.data[:w.idx], false); err != nil { - return err - } - w.idx = 0 - } - err = w.frame.CloseW(w.src, w.num) - // It is now safe to free the buffer. - if w.data != nil { - size := w.frame.Descriptor.Flags.BlockSizeIndex() - size.Put(w.data) - w.data = nil - } - return -} - -// Reset clears the state of the Writer w such that it is equivalent to its -// initial state from NewWriter, but instead writing to writer. -// Reset keeps the previous options unless overwritten by the supplied ones. -// No access to writer is performed. -// -// w.Close must be called before Reset or pending data may be dropped. -func (w *Writer) Reset(writer io.Writer) { - w.frame.Reset(w.num) - w.state.reset() - w.src = writer -} - -// ReadFrom efficiently reads from r and compressed into the Writer destination. -func (w *Writer) ReadFrom(r io.Reader) (n int64, err error) { - switch w.state.state { - case closedState, errorState: - return 0, w.state.err - case newState: - if err = w.init(); w.state.next(err) { - return - } - default: - return 0, w.state.fail() - } - defer w.state.check(&err) - - size := w.frame.Descriptor.Flags.BlockSizeIndex() - var done bool - var rn int - data := size.Get() - if w.isNotConcurrent() { - // Keep the same buffer for the whole process. - defer size.Put(data) - } - for !done { - rn, err = io.ReadFull(r, data) - switch err { - case nil: - case io.EOF: - done = true - default: - return - } - n += int64(rn) - err = w.write(data[:rn], true) - if err != nil { - return - } - w.handler(rn) - if !done && !w.isNotConcurrent() { - // The buffer will be returned automatically by go routines (safe=true) - // so get a new one fo the next round. - data = size.Get() - } - } - err = w.Close() - return -} diff --git a/vendor/github.com/pierrec/lz4/writer.go b/vendor/github.com/pierrec/lz4/writer.go new file mode 100644 index 0000000000..0120438025 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/writer.go @@ -0,0 +1,267 @@ +package lz4 + +import ( + "encoding/binary" + "fmt" + "io" + + "github.com/pierrec/lz4/internal/xxh32" +) + +// Writer implements the LZ4 frame encoder. +type Writer struct { + Header + + buf [19]byte // magic number(4) + header(flags(2)+[Size(8)+DictID(4)]+checksum(1)) does not exceed 19 bytes + dst io.Writer // Destination. + checksum xxh32.XXHZero // Frame checksum. + zdata []byte // Compressed data. + data []byte // Data to be compressed. + idx int // Index into data. + hashtable [winSize]int // Hash table used in CompressBlock(). +} + +// NewWriter returns a new LZ4 frame encoder. +// No access to the underlying io.Writer is performed. +// The supplied Header is checked at the first Write. +// It is ok to change it before the first Write but then not until a Reset() is performed. +func NewWriter(dst io.Writer) *Writer { + return &Writer{dst: dst} +} + +// writeHeader builds and writes the header (magic+header) to the underlying io.Writer. +func (z *Writer) writeHeader() error { + // Default to 4Mb if BlockMaxSize is not set. + if z.Header.BlockMaxSize == 0 { + z.Header.BlockMaxSize = bsMapID[7] + } + // The only option that needs to be validated. + bSize := z.Header.BlockMaxSize + bSizeID, ok := bsMapValue[bSize] + if !ok { + return fmt.Errorf("lz4: invalid block max size: %d", bSize) + } + // Allocate the compressed/uncompressed buffers. + // The compressed buffer cannot exceed the uncompressed one. + if n := 2 * bSize; cap(z.zdata) < n { + z.zdata = make([]byte, n, n) + } + z.zdata = z.zdata[:bSize] + z.data = z.zdata[:cap(z.zdata)][bSize:] + z.idx = 0 + + // Size is optional. + buf := z.buf[:] + + // Set the fixed size data: magic number, block max size and flags. + binary.LittleEndian.PutUint32(buf[0:], frameMagic) + flg := byte(Version << 6) + flg |= 1 << 5 // No block dependency. + if z.Header.BlockChecksum { + flg |= 1 << 4 + } + if z.Header.Size > 0 { + flg |= 1 << 3 + } + if !z.Header.NoChecksum { + flg |= 1 << 2 + } + buf[4] = flg + buf[5] = bSizeID << 4 + + // Current buffer size: magic(4) + flags(1) + block max size (1). + n := 6 + // Optional items. + if z.Header.Size > 0 { + binary.LittleEndian.PutUint64(buf[n:], z.Header.Size) + n += 8 + } + + // The header checksum includes the flags, block max size and optional Size. + buf[n] = byte(xxh32.ChecksumZero(buf[4:n]) >> 8 & 0xFF) + z.checksum.Reset() + + // Header ready, write it out. + if _, err := z.dst.Write(buf[0 : n+1]); err != nil { + return err + } + z.Header.done = true + if debugFlag { + debug("wrote header %v", z.Header) + } + + return nil +} + +// Write compresses data from the supplied buffer into the underlying io.Writer. +// Write does not return until the data has been written. +func (z *Writer) Write(buf []byte) (int, error) { + if !z.Header.done { + if err := z.writeHeader(); err != nil { + return 0, err + } + } + if debugFlag { + debug("input buffer len=%d index=%d", len(buf), z.idx) + } + + zn := len(z.data) + var n int + for len(buf) > 0 { + if z.idx == 0 && len(buf) >= zn { + // Avoid a copy as there is enough data for a block. + if err := z.compressBlock(buf[:zn]); err != nil { + return n, err + } + n += zn + buf = buf[zn:] + continue + } + // Accumulate the data to be compressed. + m := copy(z.data[z.idx:], buf) + n += m + z.idx += m + buf = buf[m:] + if debugFlag { + debug("%d bytes copied to buf, current index %d", n, z.idx) + } + + if z.idx < len(z.data) { + // Buffer not filled. + if debugFlag { + debug("need more data for compression") + } + return n, nil + } + + // Buffer full. + if err := z.compressBlock(z.data); err != nil { + return n, err + } + z.idx = 0 + } + + return n, nil +} + +// compressBlock compresses a block. +func (z *Writer) compressBlock(data []byte) error { + if !z.NoChecksum { + z.checksum.Write(data) + } + + // The compressed block size cannot exceed the input's. + var zn int + var err error + + if level := z.Header.CompressionLevel; level != 0 { + zn, err = CompressBlockHC(data, z.zdata, level) + } else { + zn, err = CompressBlock(data, z.zdata, z.hashtable[:]) + } + + var zdata []byte + var bLen uint32 + if debugFlag { + debug("block compression %d => %d", len(data), zn) + } + if err == nil && zn > 0 && zn < len(data) { + // Compressible and compressed size smaller than uncompressed: ok! + bLen = uint32(zn) + zdata = z.zdata[:zn] + } else { + // Uncompressed block. + bLen = uint32(len(data)) | compressedBlockFlag + zdata = data + } + if debugFlag { + debug("block compression to be written len=%d data len=%d", bLen, len(zdata)) + } + + // Write the block. + if err := z.writeUint32(bLen); err != nil { + return err + } + if _, err := z.dst.Write(zdata); err != nil { + return err + } + + if z.BlockChecksum { + checksum := xxh32.ChecksumZero(zdata) + if debugFlag { + debug("block checksum %x", checksum) + } + if err := z.writeUint32(checksum); err != nil { + return err + } + } + if debugFlag { + debug("current frame checksum %x", z.checksum.Sum32()) + } + + return nil +} + +// Flush flushes any pending compressed data to the underlying writer. +// Flush does not return until the data has been written. +// If the underlying writer returns an error, Flush returns that error. +func (z *Writer) Flush() error { + if debugFlag { + debug("flush with index %d", z.idx) + } + if z.idx == 0 { + return nil + } + + return z.compressBlock(z.data[:z.idx]) +} + +// Close closes the Writer, flushing any unwritten data to the underlying io.Writer, but does not close the underlying io.Writer. +func (z *Writer) Close() error { + if !z.Header.done { + if err := z.writeHeader(); err != nil { + return err + } + } + + if err := z.Flush(); err != nil { + return err + } + + if debugFlag { + debug("writing last empty block") + } + if err := z.writeUint32(0); err != nil { + return err + } + if !z.NoChecksum { + checksum := z.checksum.Sum32() + if debugFlag { + debug("stream checksum %x", checksum) + } + if err := z.writeUint32(checksum); err != nil { + return err + } + } + return nil +} + +// Reset clears the state of the Writer z such that it is equivalent to its +// initial state from NewWriter, but instead writing to w. +// No access to the underlying io.Writer is performed. +func (z *Writer) Reset(w io.Writer) { + z.Header = Header{} + z.dst = w + z.checksum.Reset() + z.zdata = z.zdata[:0] + z.data = z.data[:0] + z.idx = 0 +} + +// writeUint32 writes a uint32 to the underlying writer. +func (z *Writer) writeUint32(x uint32) error { + buf := z.buf[:4] + binary.LittleEndian.PutUint32(buf, x) + _, err := z.dst.Write(buf) + return err +} diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu.go b/vendor/github.com/shirou/gopsutil/cpu/cpu.go index 24a81167db..d3ea1f245c 100644 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu.go +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu.go @@ -149,9 +149,7 @@ func PercentWithContext(ctx context.Context, interval time.Duration, percpu bool return nil, err } - if err := common.Sleep(ctx, interval); err != nil { - return nil, err - } + time.Sleep(interval) // And at the end of the interval. cpuTimes2, err := Times(percpu) diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin.go index 421f1e16b0..3d3455ee68 100644 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin.go +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin.go @@ -4,10 +4,10 @@ package cpu import ( "context" + "os/exec" "strconv" "strings" - "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" ) @@ -25,10 +25,17 @@ const ( var ClocksPerSec = float64(128) func init() { - clkTck, err := sysconf.Sysconf(sysconf.SC_CLK_TCK) + getconf, err := exec.LookPath("getconf") + if err != nil { + return + } + out, err := invoke.Command(getconf, "CLK_TCK") // ignore errors if err == nil { - ClocksPerSec = float64(clkTck) + i, err := strconv.ParseFloat(strings.TrimSpace(string(out)), 64) + if err == nil { + ClocksPerSec = float64(i) + } } } diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_cgo.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_cgo.go index 2a7d4a1154..180e0afa73 100644 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_cgo.go +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_cgo.go @@ -10,7 +10,6 @@ package cpu #include #include #include -#include #if TARGET_OS_MAC #include #endif diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_dragonfly.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_dragonfly.go deleted file mode 100644 index 45094df1d3..0000000000 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu_dragonfly.go +++ /dev/null @@ -1,154 +0,0 @@ -package cpu - -import ( - "context" - "fmt" - "reflect" - "regexp" - "runtime" - "strconv" - "strings" - "unsafe" - - "github.com/shirou/gopsutil/internal/common" - "github.com/tklauser/go-sysconf" - "golang.org/x/sys/unix" -) - -var ClocksPerSec = float64(128) -var cpuMatch = regexp.MustCompile(`^CPU:`) -var originMatch = regexp.MustCompile(`Origin\s*=\s*"(.+)"\s+Id\s*=\s*(.+)\s+Stepping\s*=\s*(.+)`) -var featuresMatch = regexp.MustCompile(`Features=.+<(.+)>`) -var featuresMatch2 = regexp.MustCompile(`Features2=[a-f\dx]+<(.+)>`) -var cpuEnd = regexp.MustCompile(`^Trying to mount root`) -var cpuTimesSize int -var emptyTimes cpuTimes - -func init() { - clkTck, err := sysconf.Sysconf(sysconf.SC_CLK_TCK) - // ignore errors - if err == nil { - ClocksPerSec = float64(clkTck) - } -} - -func timeStat(name string, t *cpuTimes) *TimesStat { - return &TimesStat{ - User: float64(t.User) / ClocksPerSec, - Nice: float64(t.Nice) / ClocksPerSec, - System: float64(t.Sys) / ClocksPerSec, - Idle: float64(t.Idle) / ClocksPerSec, - Irq: float64(t.Intr) / ClocksPerSec, - CPU: name, - } -} - -func Times(percpu bool) ([]TimesStat, error) { - return TimesWithContext(context.Background(), percpu) -} - -func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) { - if percpu { - buf, err := unix.SysctlRaw("kern.cp_times") - if err != nil { - return nil, err - } - - // We can't do this in init due to the conflict with cpu.init() - if cpuTimesSize == 0 { - cpuTimesSize = int(reflect.TypeOf(cpuTimes{}).Size()) - } - - ncpus := len(buf) / cpuTimesSize - ret := make([]TimesStat, 0, ncpus) - for i := 0; i < ncpus; i++ { - times := (*cpuTimes)(unsafe.Pointer(&buf[i*cpuTimesSize])) - if *times == emptyTimes { - // CPU not present - continue - } - ret = append(ret, *timeStat(fmt.Sprintf("cpu%d", len(ret)), times)) - } - return ret, nil - } - - buf, err := unix.SysctlRaw("kern.cp_time") - if err != nil { - return nil, err - } - - times := (*cpuTimes)(unsafe.Pointer(&buf[0])) - return []TimesStat{*timeStat("cpu-total", times)}, nil -} - -// Returns only one InfoStat on DragonflyBSD. The information regarding core -// count, however is accurate and it is assumed that all InfoStat attributes -// are the same across CPUs. -func Info() ([]InfoStat, error) { - return InfoWithContext(context.Background()) -} - -func InfoWithContext(ctx context.Context) ([]InfoStat, error) { - const dmesgBoot = "/var/run/dmesg.boot" - - c, err := parseDmesgBoot(dmesgBoot) - if err != nil { - return nil, err - } - - var u32 uint32 - if u32, err = unix.SysctlUint32("hw.clockrate"); err != nil { - return nil, err - } - c.Mhz = float64(u32) - - var num int - var buf string - if buf, err = unix.Sysctl("hw.cpu_topology.tree"); err != nil { - return nil, err - } - num = strings.Count(buf, "CHIP") - c.Cores = int32(strings.Count(string(buf), "CORE") / num) - - if c.ModelName, err = unix.Sysctl("hw.model"); err != nil { - return nil, err - } - - ret := make([]InfoStat, num) - for i := 0; i < num; i++ { - ret[i] = c - } - - return ret, nil -} - -func parseDmesgBoot(fileName string) (InfoStat, error) { - c := InfoStat{} - lines, _ := common.ReadLines(fileName) - for _, line := range lines { - if matches := cpuEnd.FindStringSubmatch(line); matches != nil { - break - } else if matches := originMatch.FindStringSubmatch(line); matches != nil { - c.VendorID = matches[1] - t, err := strconv.ParseInt(matches[2], 10, 32) - if err != nil { - return c, fmt.Errorf("unable to parse DragonflyBSD CPU stepping information from %q: %v", line, err) - } - c.Stepping = int32(t) - } else if matches := featuresMatch.FindStringSubmatch(line); matches != nil { - for _, v := range strings.Split(matches[1], ",") { - c.Flags = append(c.Flags, strings.ToLower(v)) - } - } else if matches := featuresMatch2.FindStringSubmatch(line); matches != nil { - for _, v := range strings.Split(matches[1], ",") { - c.Flags = append(c.Flags, strings.ToLower(v)) - } - } - } - - return c, nil -} - -func CountsWithContext(ctx context.Context, logical bool) (int, error) { - return runtime.NumCPU(), nil -} diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_dragonfly_amd64.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_dragonfly_amd64.go deleted file mode 100644 index 57e14528db..0000000000 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu_dragonfly_amd64.go +++ /dev/null @@ -1,9 +0,0 @@ -package cpu - -type cpuTimes struct { - User uint64 - Nice uint64 - Sys uint64 - Intr uint64 - Idle uint64 -} diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_fallback.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_fallback.go index 5551c49d1d..fbb06083db 100644 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu_fallback.go +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu_fallback.go @@ -1,4 +1,4 @@ -// +build !darwin,!linux,!freebsd,!openbsd,!solaris,!windows,!dragonfly +// +build !darwin,!linux,!freebsd,!openbsd,!solaris,!windows package cpu diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd.go index 24527af20f..57beffae11 100644 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd.go +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd.go @@ -3,6 +3,7 @@ package cpu import ( "context" "fmt" + "os/exec" "reflect" "regexp" "runtime" @@ -11,7 +12,6 @@ import ( "unsafe" "github.com/shirou/gopsutil/internal/common" - "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" ) @@ -26,10 +26,17 @@ var cpuTimesSize int var emptyTimes cpuTimes func init() { - clkTck, err := sysconf.Sysconf(sysconf.SC_CLK_TCK) + getconf, err := exec.LookPath("getconf") + if err != nil { + return + } + out, err := invoke.Command(getconf, "CLK_TCK") // ignore errors if err == nil { - ClocksPerSec = float64(clkTck) + i, err := strconv.ParseFloat(strings.TrimSpace(string(out)), 64) + if err == nil { + ClocksPerSec = float64(i) + } } } diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_linux.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_linux.go index b7040c7ea7..735bd29ed1 100644 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu_linux.go +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu_linux.go @@ -6,21 +6,27 @@ import ( "context" "errors" "fmt" - "path/filepath" + "os/exec" "strconv" "strings" "github.com/shirou/gopsutil/internal/common" - "github.com/tklauser/go-sysconf" ) var ClocksPerSec = float64(100) func init() { - clkTck, err := sysconf.Sysconf(sysconf.SC_CLK_TCK) + getconf, err := exec.LookPath("getconf") + if err != nil { + return + } + out, err := invoke.CommandWithContext(context.Background(), getconf, "CLK_TCK") // ignore errors if err == nil { - ClocksPerSec = float64(clkTck) + i, err := strconv.ParseFloat(strings.TrimSpace(string(out)), 64) + if err == nil { + ClocksPerSec = i + } } } @@ -305,29 +311,7 @@ func CountsWithContext(ctx context.Context, logical bool) (int, error) { } return ret, nil } - // physical cores - // https://github.com/giampaolo/psutil/blob/8415355c8badc9c94418b19bdf26e622f06f0cce/psutil/_pslinux.py#L615-L628 - var threadSiblingsLists = make(map[string]bool) - // These 2 files are the same but */core_cpus_list is newer while */thread_siblings_list is deprecated and may disappear in the future. - // https://www.kernel.org/doc/Documentation/admin-guide/cputopology.rst - // https://github.com/giampaolo/psutil/pull/1727#issuecomment-707624964 - // https://lkml.org/lkml/2019/2/26/41 - for _, glob := range []string{"devices/system/cpu/cpu[0-9]*/topology/core_cpus_list", "devices/system/cpu/cpu[0-9]*/topology/thread_siblings_list"} { - if files, err := filepath.Glob(common.HostSys(glob)); err == nil { - for _, file := range files { - lines, err := common.ReadLines(file) - if err != nil || len(lines) != 1 { - continue - } - threadSiblingsLists[lines[0]] = true - } - ret := len(threadSiblingsLists) - if ret != 0 { - return ret, nil - } - } - } - // https://github.com/giampaolo/psutil/blob/122174a10b75c9beebe15f6c07dcf3afbe3b120d/psutil/_pslinux.py#L631-L652 + // physical cores https://github.com/giampaolo/psutil/blob/d01a9eaa35a8aadf6c519839e987a49d8be2d891/psutil/_pslinux.py#L628 filename := common.HostProc("cpuinfo") lines, err := common.ReadLines(filename) if err != nil { diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_openbsd.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_openbsd.go index c761aa21d5..92a8bd75c9 100644 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu_openbsd.go +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu_openbsd.go @@ -7,13 +7,13 @@ import ( "context" "encoding/binary" "fmt" + "os/exec" "runtime" "strconv" "strings" "syscall" "github.com/shirou/gopsutil/internal/common" - "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" ) @@ -32,6 +32,7 @@ const ( CTLKern = 1 // "high kernel": proc, limits CTLHw = 6 // CTL_HW SMT = 24 // HW_SMT + NCpuOnline = 25 // HW_NCPUONLINE KernCptime = 40 // KERN_CPTIME KernCptime2 = 71 // KERN_CPTIME2 ) @@ -39,12 +40,20 @@ const ( var ClocksPerSec = float64(128) func init() { - clkTck, err := sysconf.Sysconf(sysconf.SC_CLK_TCK) - // ignore errors - if err == nil { - ClocksPerSec = float64(clkTck) - } - + func() { + getconf, err := exec.LookPath("getconf") + if err != nil { + return + } + out, err := invoke.Command(getconf, "CLK_TCK") + // ignore errors + if err == nil { + i, err := strconv.ParseFloat(strings.TrimSpace(string(out)), 64) + if err == nil { + ClocksPerSec = float64(i) + } + } + }() func() { v, err := unix.Sysctl("kern.osrelease") // can't reuse host.PlatformInformation because of circular import if err != nil { @@ -154,17 +163,25 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) { c := InfoStat{} - mhz, err := unix.SysctlUint32("hw.cpuspeed") + var u32 uint32 + if u32, err = unix.SysctlUint32("hw.cpuspeed"); err != nil { + return nil, err + } + c.Mhz = float64(u32) + + mib := []int32{CTLHw, NCpuOnline} + buf, _, err := common.CallSyscall(mib) if err != nil { return nil, err } - c.Mhz = float64(mhz) - ncpu, err := unix.SysctlUint32("hw.ncpuonline") + var ncpu int32 + br := bytes.NewReader(buf) + err = binary.Read(br, binary.LittleEndian, &ncpu) if err != nil { return nil, err } - c.Cores = int32(ncpu) + c.Cores = ncpu if c.ModelName, err = unix.Sysctl("hw.model"); err != nil { return nil, err diff --git a/vendor/github.com/shirou/gopsutil/cpu/cpu_solaris.go b/vendor/github.com/shirou/gopsutil/cpu/cpu_solaris.go index d97688d4a4..3de0984240 100644 --- a/vendor/github.com/shirou/gopsutil/cpu/cpu_solaris.go +++ b/vendor/github.com/shirou/gopsutil/cpu/cpu_solaris.go @@ -10,17 +10,22 @@ import ( "sort" "strconv" "strings" - - "github.com/tklauser/go-sysconf" ) var ClocksPerSec = float64(128) func init() { - clkTck, err := sysconf.Sysconf(sysconf.SC_CLK_TCK) + getconf, err := exec.LookPath("getconf") + if err != nil { + return + } + out, err := invoke.Command(getconf, "CLK_TCK") // ignore errors if err == nil { - ClocksPerSec = float64(clkTck) + i, err := strconv.ParseFloat(strings.TrimSpace(string(out)), 64) + if err == nil { + ClocksPerSec = float64(i) + } } } diff --git a/vendor/github.com/shirou/gopsutil/internal/common/common.go b/vendor/github.com/shirou/gopsutil/internal/common/common.go index ebf70ea0bf..d46aaeba39 100644 --- a/vendor/github.com/shirou/gopsutil/internal/common/common.go +++ b/vendor/github.com/shirou/gopsutil/internal/common/common.go @@ -94,17 +94,6 @@ func (i FakeInvoke) CommandWithContext(ctx context.Context, name string, arg ... var ErrNotImplementedError = errors.New("not implemented yet") -// ReadFile reads contents from a file -func ReadFile(filename string) (string, error) { - content, err := ioutil.ReadFile(filename) - - if err != nil { - return "", err - } - - return string(content), nil -} - // ReadLines reads contents from a file and splits them by new lines. // A convenience wrapper to ReadLinesOffsetN(filename, 0, -1). func ReadLines(filename string) ([]string, error) { @@ -326,6 +315,7 @@ func GetEnv(key string, dfault string, combineWith ...string) string { copy(all[1:], combineWith) return filepath.Join(all...) } + panic("invalid switch case") } func HostProc(combineWith ...string) string { diff --git a/vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go b/vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go index be46af3d9c..dde5c39037 100644 --- a/vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go +++ b/vendor/github.com/shirou/gopsutil/internal/common/common_darwin.go @@ -36,7 +36,7 @@ func CallSyscall(mib []int32) ([]byte, uint64, error) { // get required buffer size length := uint64(0) _, _, err := unix.Syscall6( - 202, // unix.SYS___SYSCTL https://github.com/golang/sys/blob/76b94024e4b621e672466e8db3d7f084e7ddcad2/unix/zsysnum_darwin_amd64.go#L146 + unix.SYS___SYSCTL, uintptr(unsafe.Pointer(&mib[0])), uintptr(miblen), 0, @@ -54,7 +54,7 @@ func CallSyscall(mib []int32) ([]byte, uint64, error) { // get proc info itself buf := make([]byte, length) _, _, err = unix.Syscall6( - 202, // unix.SYS___SYSCTL https://github.com/golang/sys/blob/76b94024e4b621e672466e8db3d7f084e7ddcad2/unix/zsysnum_darwin_amd64.go#L146 + unix.SYS___SYSCTL, uintptr(unsafe.Pointer(&mib[0])), uintptr(miblen), uintptr(unsafe.Pointer(&buf[0])), diff --git a/vendor/github.com/shirou/gopsutil/internal/common/common_linux.go b/vendor/github.com/shirou/gopsutil/internal/common/common_linux.go index 7349989936..6d0ef37137 100644 --- a/vendor/github.com/shirou/gopsutil/internal/common/common_linux.go +++ b/vendor/github.com/shirou/gopsutil/internal/common/common_linux.go @@ -10,7 +10,6 @@ import ( "path/filepath" "strconv" "strings" - "sync" "time" ) @@ -111,24 +110,9 @@ func Virtualization() (string, string, error) { return VirtualizationWithContext(context.Background()) } -// required variables for concurrency safe virtualization caching -var ( - cachedVirtMap map[string]string - cachedVirtMutex sync.RWMutex - cachedVirtOnce sync.Once -) - func VirtualizationWithContext(ctx context.Context) (string, string, error) { - var system, role string - - // if cached already, return from cache - cachedVirtMutex.RLock() // unlock won't be deferred so concurrent reads don't wait for long - if cachedVirtMap != nil { - cachedSystem, cachedRole := cachedVirtMap["system"], cachedVirtMap["role"] - cachedVirtMutex.RUnlock() - return cachedSystem, cachedRole, nil - } - cachedVirtMutex.RUnlock() + var system string + var role string filename := HostProc("xen") if PathExists(filename) { @@ -210,17 +194,6 @@ func VirtualizationWithContext(ctx context.Context) (string, string, error) { } } - if PathExists(filepath.Join(filename, "1", "environ")) { - contents, err := ReadFile(filepath.Join(filename, "1", "environ")) - - if err == nil { - if strings.Contains(contents, "container=lxc") { - system = "lxc" - role = "guest" - } - } - } - if PathExists(filepath.Join(filename, "self", "cgroup")) { contents, err := ReadLines(filepath.Join(filename, "self", "cgroup")) if err == nil { @@ -247,17 +220,6 @@ func VirtualizationWithContext(ctx context.Context) (string, string, error) { role = "host" } } - - // before returning for the first time, cache the system and role - cachedVirtOnce.Do(func() { - cachedVirtMutex.Lock() - defer cachedVirtMutex.Unlock() - cachedVirtMap = map[string]string{ - "system": system, - "role": role, - } - }) - return system, role, nil } diff --git a/vendor/github.com/shirou/gopsutil/internal/common/common_windows.go b/vendor/github.com/shirou/gopsutil/internal/common/common_windows.go index 2471bae1f5..9bc05ded88 100644 --- a/vendor/github.com/shirou/gopsutil/internal/common/common_windows.go +++ b/vendor/github.com/shirou/gopsutil/internal/common/common_windows.go @@ -4,7 +4,6 @@ package common import ( "context" - "fmt" "path/filepath" "strings" "syscall" @@ -70,13 +69,13 @@ var ( ProcNtWow64QueryInformationProcess64 = ModNt.NewProc("NtWow64QueryInformationProcess64") ProcNtWow64ReadVirtualMemory64 = ModNt.NewProc("NtWow64ReadVirtualMemory64") - PdhOpenQuery = ModPdh.NewProc("PdhOpenQuery") - PdhAddEnglishCounterW = ModPdh.NewProc("PdhAddEnglishCounterW") - PdhCollectQueryData = ModPdh.NewProc("PdhCollectQueryData") - PdhGetFormattedCounterValue = ModPdh.NewProc("PdhGetFormattedCounterValue") - PdhCloseQuery = ModPdh.NewProc("PdhCloseQuery") + PdhOpenQuery = ModPdh.NewProc("PdhOpenQuery") + PdhAddCounter = ModPdh.NewProc("PdhAddCounterW") + PdhCollectQueryData = ModPdh.NewProc("PdhCollectQueryData") + PdhGetFormattedCounterValue = ModPdh.NewProc("PdhGetFormattedCounterValue") + PdhCloseQuery = ModPdh.NewProc("PdhCloseQuery") - procQueryDosDeviceW = Modkernel32.NewProc("QueryDosDeviceW") + procQueryDosDeviceW = Modkernel32.NewProc("QueryDosDeviceW") ) type FILETIME struct { @@ -94,7 +93,7 @@ func BytePtrToString(p *uint8) string { return string(a[:i]) } -// CounterInfo struct is used to track a windows performance counter +// CounterInfo // copied from https://github.com/mackerelio/mackerel-agent/ type CounterInfo struct { PostName string @@ -102,7 +101,7 @@ type CounterInfo struct { Counter windows.Handle } -// CreateQuery with a PdhOpenQuery call +// CreateQuery XXX // copied from https://github.com/mackerelio/mackerel-agent/ func CreateQuery() (windows.Handle, error) { var query windows.Handle @@ -113,10 +112,10 @@ func CreateQuery() (windows.Handle, error) { return query, nil } -// CreateCounter with a PdhAddEnglishCounterW call +// CreateCounter XXX func CreateCounter(query windows.Handle, pname, cname string) (*CounterInfo, error) { var counter windows.Handle - r, _, err := PdhAddEnglishCounterW.Call( + r, _, err := PdhAddCounter.Call( uintptr(query), uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(cname))), 0, @@ -131,62 +130,6 @@ func CreateCounter(query windows.Handle, pname, cname string) (*CounterInfo, err }, nil } -// GetCounterValue get counter value from handle -// adapted from https://github.com/mackerelio/mackerel-agent/ -func GetCounterValue(counter windows.Handle) (float64, error) { - var value PDH_FMT_COUNTERVALUE_DOUBLE - r, _, err := PdhGetFormattedCounterValue.Call(uintptr(counter), PDH_FMT_DOUBLE, uintptr(0), uintptr(unsafe.Pointer(&value))) - if r != 0 && r != PDH_INVALID_DATA { - return 0.0, err - } - return value.DoubleValue, nil -} - -type Win32PerformanceCounter struct { - PostName string - CounterName string - Query windows.Handle - Counter windows.Handle -} - -func NewWin32PerformanceCounter(postName, counterName string) (*Win32PerformanceCounter, error) { - query, err := CreateQuery() - if err != nil { - return nil, err - } - var counter = Win32PerformanceCounter{ - Query: query, - PostName: postName, - CounterName: counterName, - } - r, _, err := PdhAddEnglishCounterW.Call( - uintptr(counter.Query), - uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(counter.CounterName))), - 0, - uintptr(unsafe.Pointer(&counter.Counter)), - ) - if r != 0 { - return nil, err - } - return &counter, nil -} - -func (w *Win32PerformanceCounter) GetValue() (float64, error) { - r, _, err := PdhCollectQueryData.Call(uintptr(w.Query)) - if r != 0 && err != nil { - if r == PDH_NO_DATA { - return 0.0, fmt.Errorf("%w: this counter has not data", err) - } - return 0.0, err - } - - return GetCounterValue(w.Counter) -} - -func ProcessorQueueLengthCounter() (*Win32PerformanceCounter, error) { - return NewWin32PerformanceCounter("processor_queue_length", `\System\Processor Queue Length`) -} - // WMIQueryWithContext - wraps wmi.Query with a timed-out context to avoid hanging func WMIQueryWithContext(ctx context.Context, query string, dst interface{}, connectServerArgs ...interface{}) error { if _, ok := ctx.Deadline(); !ok { diff --git a/vendor/github.com/shirou/gopsutil/internal/common/sleep.go b/vendor/github.com/shirou/gopsutil/internal/common/sleep.go deleted file mode 100644 index ee27e54d46..0000000000 --- a/vendor/github.com/shirou/gopsutil/internal/common/sleep.go +++ /dev/null @@ -1,18 +0,0 @@ -package common - -import ( - "context" - "time" -) - -// Sleep awaits for provided interval. -// Can be interrupted by context cancelation. -func Sleep(ctx context.Context, interval time.Duration) error { - var timer = time.NewTimer(interval) - select { - case <-ctx.Done(): - return ctx.Err() - case <-timer.C: - return nil - } -} diff --git a/vendor/github.com/shirou/gopsutil/mem/mem.go b/vendor/github.com/shirou/gopsutil/mem/mem.go index dc2aacb59c..8e444ba0ab 100644 --- a/vendor/github.com/shirou/gopsutil/mem/mem.go +++ b/vendor/github.com/shirou/gopsutil/mem/mem.go @@ -88,10 +88,6 @@ type SwapMemoryStat struct { PgIn uint64 `json:"pgin"` PgOut uint64 `json:"pgout"` PgFault uint64 `json:"pgfault"` - - // Linux specific numbers - // https://www.kernel.org/doc/Documentation/cgroup-v2.txt - PgMajFault uint64 `json:"pgmajfault"` } func (m VirtualMemoryStat) String() string { diff --git a/vendor/github.com/shirou/gopsutil/mem/mem_linux.go b/vendor/github.com/shirou/gopsutil/mem/mem_linux.go index f9cb8f260f..66ccca9c9e 100644 --- a/vendor/github.com/shirou/gopsutil/mem/mem_linux.go +++ b/vendor/github.com/shirou/gopsutil/mem/mem_linux.go @@ -73,226 +73,86 @@ func fillFromMeminfoWithContext(ctx context.Context) (*VirtualMemoryStat, *Virtu value := strings.TrimSpace(fields[1]) value = strings.Replace(value, " kB", "", -1) + t, err := strconv.ParseUint(value, 10, 64) + if err != nil { + return ret, retEx,err + } switch key { case "MemTotal": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.Total = t * 1024 case "MemFree": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.Free = t * 1024 case "MemAvailable": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } memavail = true ret.Available = t * 1024 case "Buffers": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.Buffers = t * 1024 case "Cached": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.Cached = t * 1024 case "Active": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.Active = t * 1024 case "Inactive": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.Inactive = t * 1024 case "Active(anon)": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } retEx.ActiveAnon = t * 1024 case "Inactive(anon)": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } retEx.InactiveAnon = t * 1024 case "Active(file)": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } activeFile = true retEx.ActiveFile = t * 1024 case "Inactive(file)": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } inactiveFile = true retEx.InactiveFile = t * 1024 case "Unevictable": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } retEx.Unevictable = t * 1024 case "Writeback": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.Writeback = t * 1024 case "WritebackTmp": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.WritebackTmp = t * 1024 case "Dirty": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.Dirty = t * 1024 case "Shmem": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.Shared = t * 1024 case "Slab": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.Slab = t * 1024 case "SReclaimable": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } sReclaimable = true ret.SReclaimable = t * 1024 case "SUnreclaim": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.SUnreclaim = t * 1024 case "PageTables": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.PageTables = t * 1024 case "SwapCached": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.SwapCached = t * 1024 case "CommitLimit": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.CommitLimit = t * 1024 case "Committed_AS": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.CommittedAS = t * 1024 case "HighTotal": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.HighTotal = t * 1024 case "HighFree": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.HighFree = t * 1024 case "LowTotal": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.LowTotal = t * 1024 case "LowFree": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.LowFree = t * 1024 case "SwapTotal": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.SwapTotal = t * 1024 case "SwapFree": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.SwapFree = t * 1024 case "Mapped": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.Mapped = t * 1024 case "VmallocTotal": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.VMallocTotal = t * 1024 case "VmallocUsed": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.VMallocUsed = t * 1024 case "VmallocChunk": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.VMallocChunk = t * 1024 case "HugePages_Total": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.HugePagesTotal = t case "HugePages_Free": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.HugePagesFree = t case "Hugepagesize": - t, err := strconv.ParseUint(value, 10, 64) - if err != nil { - return ret, retEx, err - } ret.HugePageSize = t * 1024 } } @@ -372,12 +232,6 @@ func SwapMemoryWithContext(ctx context.Context) (*SwapMemoryStat, error) { continue } ret.PgFault = value * 4 * 1024 - case "pgmajfault": - value, err := strconv.ParseUint(fields[1], 10, 64) - if err != nil { - continue - } - ret.PgMajFault = value * 4 * 1024 } } return ret, nil diff --git a/vendor/github.com/shirou/gopsutil/mem/mem_openbsd.go b/vendor/github.com/shirou/gopsutil/mem/mem_openbsd.go index 7ecdae9fd5..35472a3260 100644 --- a/vendor/github.com/shirou/gopsutil/mem/mem_openbsd.go +++ b/vendor/github.com/shirou/gopsutil/mem/mem_openbsd.go @@ -11,7 +11,6 @@ import ( "os/exec" "github.com/shirou/gopsutil/internal/common" - "golang.org/x/sys/unix" ) func GetPageSize() (uint64, error) { @@ -19,7 +18,17 @@ func GetPageSize() (uint64, error) { } func GetPageSizeWithContext(ctx context.Context) (uint64, error) { - uvmexp, err := unix.SysctlUvmexp("vm.uvmexp") + mib := []int32{CTLVm, VmUvmexp} + buf, length, err := common.CallSyscall(mib) + if err != nil { + return 0, err + } + if length < sizeOfUvmexp { + return 0, fmt.Errorf("short syscall ret %d bytes", length) + } + var uvmexp Uvmexp + br := bytes.NewReader(buf) + err = common.Read(br, binary.LittleEndian, &uvmexp) if err != nil { return 0, err } @@ -31,7 +40,17 @@ func VirtualMemory() (*VirtualMemoryStat, error) { } func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) { - uvmexp, err := unix.SysctlUvmexp("vm.uvmexp") + mib := []int32{CTLVm, VmUvmexp} + buf, length, err := common.CallSyscall(mib) + if err != nil { + return nil, err + } + if length < sizeOfUvmexp { + return nil, fmt.Errorf("short syscall ret %d bytes", length) + } + var uvmexp Uvmexp + br := bytes.NewReader(buf) + err = common.Read(br, binary.LittleEndian, &uvmexp) if err != nil { return nil, err } @@ -50,8 +69,8 @@ func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) { ret.Used = ret.Total - ret.Available ret.UsedPercent = float64(ret.Used) / float64(ret.Total) * 100.0 - mib := []int32{CTLVfs, VfsGeneric, VfsBcacheStat} - buf, length, err := common.CallSyscall(mib) + mib = []int32{CTLVfs, VfsGeneric, VfsBcacheStat} + buf, length, err = common.CallSyscall(mib) if err != nil { return nil, err } @@ -59,7 +78,7 @@ func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) { return nil, fmt.Errorf("short syscall ret %d bytes", length) } var bcs Bcachestats - br := bytes.NewReader(buf) + br = bytes.NewReader(buf) err = common.Read(br, binary.LittleEndian, &bcs) if err != nil { return nil, err diff --git a/vendor/github.com/shirou/gopsutil/mem/mem_openbsd_386.go b/vendor/github.com/shirou/gopsutil/mem/mem_openbsd_386.go deleted file mode 100644 index aacd4f61e5..0000000000 --- a/vendor/github.com/shirou/gopsutil/mem/mem_openbsd_386.go +++ /dev/null @@ -1,37 +0,0 @@ -// +build openbsd -// +build 386 -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs mem/types_openbsd.go - -package mem - -const ( - CTLVfs = 10 - VfsGeneric = 0 - VfsBcacheStat = 3 -) - -const ( - sizeOfBcachestats = 0x90 -) - -type Bcachestats struct { - Numbufs int64 - Numbufpages int64 - Numdirtypages int64 - Numcleanpages int64 - Pendingwrites int64 - Pendingreads int64 - Numwrites int64 - Numreads int64 - Cachehits int64 - Busymapped int64 - Dmapages int64 - Highpages int64 - Delwribufs int64 - Kvaslots int64 - Avail int64 - Highflips int64 - Highflops int64 - Dmaflips int64 -} diff --git a/vendor/github.com/shirou/gopsutil/mem/mem_openbsd_amd64.go b/vendor/github.com/shirou/gopsutil/mem/mem_openbsd_amd64.go index d187abf01f..e09b908e46 100644 --- a/vendor/github.com/shirou/gopsutil/mem/mem_openbsd_amd64.go +++ b/vendor/github.com/shirou/gopsutil/mem/mem_openbsd_amd64.go @@ -4,15 +4,105 @@ package mem const ( + CTLVm = 2 CTLVfs = 10 + VmUvmexp = 4 VfsGeneric = 0 VfsBcacheStat = 3 ) const ( + sizeOfUvmexp = 0x154 sizeOfBcachestats = 0x78 ) +type Uvmexp struct { + Pagesize int32 + Pagemask int32 + Pageshift int32 + Npages int32 + Free int32 + Active int32 + Inactive int32 + Paging int32 + Wired int32 + Zeropages int32 + Reserve_pagedaemon int32 + Reserve_kernel int32 + Anonpages int32 + Vnodepages int32 + Vtextpages int32 + Freemin int32 + Freetarg int32 + Inactarg int32 + Wiredmax int32 + Anonmin int32 + Vtextmin int32 + Vnodemin int32 + Anonminpct int32 + Vtextminpct int32 + Vnodeminpct int32 + Nswapdev int32 + Swpages int32 + Swpginuse int32 + Swpgonly int32 + Nswget int32 + Nanon int32 + Nanonneeded int32 + Nfreeanon int32 + Faults int32 + Traps int32 + Intrs int32 + Swtch int32 + Softs int32 + Syscalls int32 + Pageins int32 + Obsolete_swapins int32 + Obsolete_swapouts int32 + Pgswapin int32 + Pgswapout int32 + Forks int32 + Forks_ppwait int32 + Forks_sharevm int32 + Pga_zerohit int32 + Pga_zeromiss int32 + Zeroaborts int32 + Fltnoram int32 + Fltnoanon int32 + Fltpgwait int32 + Fltpgrele int32 + Fltrelck int32 + Fltrelckok int32 + Fltanget int32 + Fltanretry int32 + Fltamcopy int32 + Fltnamap int32 + Fltnomap int32 + Fltlget int32 + Fltget int32 + Flt_anon int32 + Flt_acow int32 + Flt_obj int32 + Flt_prcopy int32 + Flt_przero int32 + Pdwoke int32 + Pdrevs int32 + Pdswout int32 + Pdfreed int32 + Pdscans int32 + Pdanscan int32 + Pdobscan int32 + Pdreact int32 + Pdbusy int32 + Pdpageouts int32 + Pdpending int32 + Pddeact int32 + Pdreanon int32 + Pdrevnode int32 + Pdrevtext int32 + Fpswtch int32 + Kmapent int32 +} type Bcachestats struct { Numbufs int64 Numbufpages int64 diff --git a/vendor/github.com/shirou/gopsutil/mem/mem_windows.go b/vendor/github.com/shirou/gopsutil/mem/mem_windows.go index a925faa252..ced0b197d7 100644 --- a/vendor/github.com/shirou/gopsutil/mem/mem_windows.go +++ b/vendor/github.com/shirou/gopsutil/mem/mem_windows.go @@ -42,7 +42,6 @@ func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) { ret := &VirtualMemoryStat{ Total: memInfo.ullTotalPhys, Available: memInfo.ullAvailPhys, - Free: memInfo.ullAvailPhys, UsedPercent: float64(memInfo.dwMemoryLoad), } diff --git a/vendor/github.com/shirou/gopsutil/net/net_darwin.go b/vendor/github.com/shirou/gopsutil/net/net_darwin.go index 8e6e7f953d..1daed86982 100644 --- a/vendor/github.com/shirou/gopsutil/net/net_darwin.go +++ b/vendor/github.com/shirou/gopsutil/net/net_darwin.go @@ -269,7 +269,7 @@ func FilterCounters() ([]FilterStat, error) { } func FilterCountersWithContext(ctx context.Context) ([]FilterStat, error) { - return nil, common.ErrNotImplementedError + return nil, errors.New("NetFilterCounters not implemented for darwin") } func ConntrackStats(percpu bool) ([]ConntrackStat, error) { @@ -289,5 +289,5 @@ func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { } func ProtoCountersWithContext(ctx context.Context, protocols []string) ([]ProtoCountersStat, error) { - return nil, common.ErrNotImplementedError + return nil, errors.New("NetProtoCounters not implemented for darwin") } diff --git a/vendor/github.com/shirou/gopsutil/net/net_freebsd.go b/vendor/github.com/shirou/gopsutil/net/net_freebsd.go index 1204f59770..2284d982c8 100644 --- a/vendor/github.com/shirou/gopsutil/net/net_freebsd.go +++ b/vendor/github.com/shirou/gopsutil/net/net_freebsd.go @@ -4,6 +4,7 @@ package net import ( "context" + "errors" "os/exec" "strconv" "strings" @@ -108,7 +109,7 @@ func FilterCounters() ([]FilterStat, error) { } func FilterCountersWithContext(ctx context.Context) ([]FilterStat, error) { - return nil, common.ErrNotImplementedError + return nil, errors.New("NetFilterCounters not implemented for freebsd") } func ConntrackStats(percpu bool) ([]ConntrackStat, error) { @@ -116,7 +117,7 @@ func ConntrackStats(percpu bool) ([]ConntrackStat, error) { } func ConntrackStatsWithContext(ctx context.Context, percpu bool) ([]ConntrackStat, error) { - return nil, common.ErrNotImplementedError + return nil, errors.New("ConntrackStats not implemented for freebsd") } // NetProtoCounters returns network statistics for the entire system @@ -128,5 +129,5 @@ func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { } func ProtoCountersWithContext(ctx context.Context, protocols []string) ([]ProtoCountersStat, error) { - return nil, common.ErrNotImplementedError + return nil, errors.New("NetProtoCounters not implemented for freebsd") } diff --git a/vendor/github.com/shirou/gopsutil/net/net_linux.go b/vendor/github.com/shirou/gopsutil/net/net_linux.go index ed5d027b8a..f289a5dcc1 100644 --- a/vendor/github.com/shirou/gopsutil/net/net_linux.go +++ b/vendor/github.com/shirou/gopsutil/net/net_linux.go @@ -696,7 +696,7 @@ func decodeAddress(family uint32, src string) (Addr, error) { return Addr{}, fmt.Errorf("does not contain port, %s", src) } addr := t[0] - port, err := strconv.ParseUint(t[1], 16, 16) + port, err := strconv.ParseInt("0x"+t[1], 0, 64) if err != nil { return Addr{}, fmt.Errorf("invalid port, %s", src) } diff --git a/vendor/github.com/shirou/gopsutil/net/net_openbsd.go b/vendor/github.com/shirou/gopsutil/net/net_openbsd.go index cfed2bee46..3cf0a89d47 100644 --- a/vendor/github.com/shirou/gopsutil/net/net_openbsd.go +++ b/vendor/github.com/shirou/gopsutil/net/net_openbsd.go @@ -4,6 +4,7 @@ package net import ( "context" + "errors" "fmt" "os/exec" "regexp" @@ -152,7 +153,7 @@ func FilterCounters() ([]FilterStat, error) { } func FilterCountersWithContext(ctx context.Context) ([]FilterStat, error) { - return nil, common.ErrNotImplementedError + return nil, errors.New("NetFilterCounters not implemented for openbsd") } func ConntrackStats(percpu bool) ([]ConntrackStat, error) { @@ -172,7 +173,7 @@ func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { } func ProtoCountersWithContext(ctx context.Context, protocols []string) ([]ProtoCountersStat, error) { - return nil, common.ErrNotImplementedError + return nil, errors.New("NetProtoCounters not implemented for openbsd") } func parseNetstatLine(line string) (ConnectionStat, error) { diff --git a/vendor/github.com/shirou/gopsutil/net/net_unix.go b/vendor/github.com/shirou/gopsutil/net/net_unix.go index abe25c4ed7..d6e4303fdb 100644 --- a/vendor/github.com/shirou/gopsutil/net/net_unix.go +++ b/vendor/github.com/shirou/gopsutil/net/net_unix.go @@ -63,7 +63,7 @@ func ConnectionsPidWithContext(ctx context.Context, kind string, pid int32) ([]C case "udp": args = append(args, "udp") case "udp4": - args = append(args, "4udp") + args = append(args, "6udp") case "udp6": args = append(args, "6udp") case "unix": diff --git a/vendor/github.com/shirou/gopsutil/net/net_windows.go b/vendor/github.com/shirou/gopsutil/net/net_windows.go index bdc9287982..6ab45ab3a7 100644 --- a/vendor/github.com/shirou/gopsutil/net/net_windows.go +++ b/vendor/github.com/shirou/gopsutil/net/net_windows.go @@ -4,6 +4,7 @@ package net import ( "context" + "errors" "fmt" "net" "os" @@ -322,7 +323,7 @@ func FilterCounters() ([]FilterStat, error) { } func FilterCountersWithContext(ctx context.Context) ([]FilterStat, error) { - return nil, common.ErrNotImplementedError + return nil, errors.New("NetFilterCounters not implemented for windows") } func ConntrackStats(percpu bool) ([]ConntrackStat, error) { @@ -343,7 +344,7 @@ func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { } func ProtoCountersWithContext(ctx context.Context, protocols []string) ([]ProtoCountersStat, error) { - return nil, common.ErrNotImplementedError + return nil, errors.New("NetProtoCounters not implemented for windows") } func getTableUintptr(family uint32, buf []byte) uintptr { @@ -547,7 +548,7 @@ func getUDPConnections(family uint32) ([]ConnectionStat, error) { mibs := (*mibUDPRowOwnerPid)(unsafe.Pointer(&buf[index])) ns := mibs.convertToConnectionStat() stats = append(stats, ns) - case kindUDP6.family: + case kindUDP4.family: mibs := (*mibUDP6RowOwnerPid)(unsafe.Pointer(&buf[index])) ns := mibs.convertToConnectionStat() stats = append(stats, ns) diff --git a/vendor/github.com/shirou/gopsutil/process/process.go b/vendor/github.com/shirou/gopsutil/process/process.go index a667ddfe7c..59441a0522 100644 --- a/vendor/github.com/shirou/gopsutil/process/process.go +++ b/vendor/github.com/shirou/gopsutil/process/process.go @@ -6,14 +6,11 @@ import ( "errors" "runtime" "sort" - "sync" - "syscall" "time" "github.com/shirou/gopsutil/cpu" "github.com/shirou/gopsutil/internal/common" "github.com/shirou/gopsutil/mem" - "github.com/shirou/gopsutil/net" ) var ( @@ -27,11 +24,9 @@ type Process struct { name string status string parent int32 - parentMutex *sync.RWMutex // for windows ppid cache numCtxSwitches *NumCtxSwitchesStat uids []int32 gids []int32 - groups []int32 numThreads int32 memInfo *MemoryInfoStat sigInfo *SignalInfoStat @@ -154,34 +149,21 @@ func PidsWithContext(ctx context.Context) ([]int32, error) { return pids, err } -// Processes returns a slice of pointers to Process structs for all -// currently running processes. -func Processes() ([]*Process, error) { - return ProcessesWithContext(context.Background()) -} - // NewProcess creates a new Process instance, it only stores the pid and // checks that the process exists. Other method on Process can be used // to get more information about the process. An error will be returned // if the process does not exist. func NewProcess(pid int32) (*Process, error) { - return NewProcessWithContext(context.Background(), pid) -} + p := &Process{Pid: pid} -func NewProcessWithContext(ctx context.Context, pid int32) (*Process, error) { - p := &Process{ - Pid: pid, - parentMutex: new(sync.RWMutex), - } - - exists, err := PidExistsWithContext(ctx, pid) + exists, err := PidExists(pid) if err != nil { return p, err } if !exists { return p, ErrorProcessNotRunning } - p.CreateTimeWithContext(ctx) + p.CreateTime() return p, nil } @@ -209,7 +191,7 @@ func (p *Process) Percent(interval time.Duration) (float64, error) { } func (p *Process) PercentWithContext(ctx context.Context, interval time.Duration) (float64, error) { - cpuTimes, err := p.TimesWithContext(ctx) + cpuTimes, err := p.Times() if err != nil { return 0, err } @@ -218,10 +200,8 @@ func (p *Process) PercentWithContext(ctx context.Context, interval time.Duration if interval > 0 { p.lastCPUTimes = cpuTimes p.lastCPUTime = now - if err := common.Sleep(ctx, interval); err != nil { - return 0, err - } - cpuTimes, err = p.TimesWithContext(ctx) + time.Sleep(interval) + cpuTimes, err = p.Times() now = time.Now() if err != nil { return 0, err @@ -253,7 +233,7 @@ func (p *Process) IsRunningWithContext(ctx context.Context) (bool, error) { if err != nil { return false, err } - p2, err := NewProcessWithContext(ctx, p.Pid) + p2, err := NewProcess(p.Pid) if err == ErrorProcessNotRunning { return false, nil } @@ -293,13 +273,13 @@ func (p *Process) MemoryPercent() (float32, error) { } func (p *Process) MemoryPercentWithContext(ctx context.Context) (float32, error) { - machineMemory, err := mem.VirtualMemoryWithContext(ctx) + machineMemory, err := mem.VirtualMemory() if err != nil { return 0, err } total := machineMemory.Total - processMemory, err := p.MemoryInfoWithContext(ctx) + processMemory, err := p.MemoryInfo() if err != nil { return 0, err } @@ -314,12 +294,12 @@ func (p *Process) CPUPercent() (float64, error) { } func (p *Process) CPUPercentWithContext(ctx context.Context) (float64, error) { - crt_time, err := p.createTimeWithContext(ctx) + crt_time, err := p.CreateTime() if err != nil { return 0, err } - cput, err := p.TimesWithContext(ctx) + cput, err := p.Times() if err != nil { return 0, err } @@ -332,214 +312,3 @@ func (p *Process) CPUPercentWithContext(ctx context.Context) (float64, error) { return 100 * cput.Total() / totalTime, nil } - -// Groups returns all group IDs(include supplementary groups) of the process as a slice of the int -func (p *Process) Groups() ([]int32, error) { - return p.GroupsWithContext(context.Background()) -} - -// Ppid returns Parent Process ID of the process. -func (p *Process) Ppid() (int32, error) { - return p.PpidWithContext(context.Background()) -} - -// Name returns name of the process. -func (p *Process) Name() (string, error) { - return p.NameWithContext(context.Background()) -} - -// Exe returns executable path of the process. -func (p *Process) Exe() (string, error) { - return p.ExeWithContext(context.Background()) -} - -// Cmdline returns the command line arguments of the process as a string with -// each argument separated by 0x20 ascii character. -func (p *Process) Cmdline() (string, error) { - return p.CmdlineWithContext(context.Background()) -} - -// CmdlineSlice returns the command line arguments of the process as a slice with each -// element being an argument. -func (p *Process) CmdlineSlice() ([]string, error) { - return p.CmdlineSliceWithContext(context.Background()) -} - -// Cwd returns current working directory of the process. -func (p *Process) Cwd() (string, error) { - return p.CwdWithContext(context.Background()) -} - -// Parent returns parent Process of the process. -func (p *Process) Parent() (*Process, error) { - return p.ParentWithContext(context.Background()) -} - -// Status returns the process status. -// Return value could be one of these. -// R: Running S: Sleep T: Stop I: Idle -// Z: Zombie W: Wait L: Lock -// The character is same within all supported platforms. -func (p *Process) Status() (string, error) { - return p.StatusWithContext(context.Background()) -} - -// Foreground returns true if the process is in foreground, false otherwise. -func (p *Process) Foreground() (bool, error) { - return p.ForegroundWithContext(context.Background()) -} - -// Uids returns user ids of the process as a slice of the int -func (p *Process) Uids() ([]int32, error) { - return p.UidsWithContext(context.Background()) -} - -// Gids returns group ids of the process as a slice of the int -func (p *Process) Gids() ([]int32, error) { - return p.GidsWithContext(context.Background()) -} - -// Terminal returns a terminal which is associated with the process. -func (p *Process) Terminal() (string, error) { - return p.TerminalWithContext(context.Background()) -} - -// Nice returns a nice value (priority). -func (p *Process) Nice() (int32, error) { - return p.NiceWithContext(context.Background()) -} - -// IOnice returns process I/O nice value (priority). -func (p *Process) IOnice() (int32, error) { - return p.IOniceWithContext(context.Background()) -} - -// Rlimit returns Resource Limits. -func (p *Process) Rlimit() ([]RlimitStat, error) { - return p.RlimitWithContext(context.Background()) -} - -// RlimitUsage returns Resource Limits. -// If gatherUsed is true, the currently used value will be gathered and added -// to the resulting RlimitStat. -func (p *Process) RlimitUsage(gatherUsed bool) ([]RlimitStat, error) { - return p.RlimitUsageWithContext(context.Background(), gatherUsed) -} - -// IOCounters returns IO Counters. -func (p *Process) IOCounters() (*IOCountersStat, error) { - return p.IOCountersWithContext(context.Background()) -} - -// NumCtxSwitches returns the number of the context switches of the process. -func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { - return p.NumCtxSwitchesWithContext(context.Background()) -} - -// NumFDs returns the number of File Descriptors used by the process. -func (p *Process) NumFDs() (int32, error) { - return p.NumFDsWithContext(context.Background()) -} - -// NumThreads returns the number of threads used by the process. -func (p *Process) NumThreads() (int32, error) { - return p.NumThreadsWithContext(context.Background()) -} - -func (p *Process) Threads() (map[int32]*cpu.TimesStat, error) { - return p.ThreadsWithContext(context.Background()) -} - -// Times returns CPU times of the process. -func (p *Process) Times() (*cpu.TimesStat, error) { - return p.TimesWithContext(context.Background()) -} - -// CPUAffinity returns CPU affinity of the process. -func (p *Process) CPUAffinity() ([]int32, error) { - return p.CPUAffinityWithContext(context.Background()) -} - -// MemoryInfo returns generic process memory information, -// such as RSS and VMS. -func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { - return p.MemoryInfoWithContext(context.Background()) -} - -// MemoryInfoEx returns platform-specific process memory information. -func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { - return p.MemoryInfoExWithContext(context.Background()) -} - -// PageFaultsInfo returns the process's page fault counters. -func (p *Process) PageFaults() (*PageFaultsStat, error) { - return p.PageFaultsWithContext(context.Background()) -} - -// Children returns the children of the process represented as a slice -// of pointers to Process type. -func (p *Process) Children() ([]*Process, error) { - return p.ChildrenWithContext(context.Background()) -} - -// OpenFiles returns a slice of OpenFilesStat opend by the process. -// OpenFilesStat includes a file path and file descriptor. -func (p *Process) OpenFiles() ([]OpenFilesStat, error) { - return p.OpenFilesWithContext(context.Background()) -} - -// Connections returns a slice of net.ConnectionStat used by the process. -// This returns all kind of the connection. This means TCP, UDP or UNIX. -func (p *Process) Connections() ([]net.ConnectionStat, error) { - return p.ConnectionsWithContext(context.Background()) -} - -// Connections returns a slice of net.ConnectionStat used by the process at most `max`. -func (p *Process) ConnectionsMax(max int) ([]net.ConnectionStat, error) { - return p.ConnectionsMaxWithContext(context.Background(), max) -} - -// NetIOCounters returns NetIOCounters of the process. -func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { - return p.NetIOCountersWithContext(context.Background(), pernic) -} - -// MemoryMaps get memory maps from /proc/(pid)/smaps -func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { - return p.MemoryMapsWithContext(context.Background(), grouped) -} - -// Tgid returns thread group id of the process. -func (p *Process) Tgid() (int32, error) { - return p.TgidWithContext(context.Background()) -} - -// SendSignal sends a unix.Signal to the process. -func (p *Process) SendSignal(sig syscall.Signal) error { - return p.SendSignalWithContext(context.Background(), sig) -} - -// Suspend sends SIGSTOP to the process. -func (p *Process) Suspend() error { - return p.SuspendWithContext(context.Background()) -} - -// Resume sends SIGCONT to the process. -func (p *Process) Resume() error { - return p.ResumeWithContext(context.Background()) -} - -// Terminate sends SIGTERM to the process. -func (p *Process) Terminate() error { - return p.TerminateWithContext(context.Background()) -} - -// Kill sends SIGKILL to the process. -func (p *Process) Kill() error { - return p.KillWithContext(context.Background()) -} - -// Username returns a username of the process. -func (p *Process) Username() (string, error) { - return p.UsernameWithContext(context.Background()) -} diff --git a/vendor/github.com/shirou/gopsutil/process/process_bsd.go b/vendor/github.com/shirou/gopsutil/process/process_bsd.go deleted file mode 100644 index ffb748164d..0000000000 --- a/vendor/github.com/shirou/gopsutil/process/process_bsd.go +++ /dev/null @@ -1,80 +0,0 @@ -// +build darwin freebsd openbsd - -package process - -import ( - "bytes" - "context" - "encoding/binary" - - "github.com/shirou/gopsutil/cpu" - "github.com/shirou/gopsutil/internal/common" - "github.com/shirou/gopsutil/net" -) - -type MemoryInfoExStat struct{} - -type MemoryMapsStat struct{} - -func (p *Process) TgidWithContext(ctx context.Context) (int32, error) { - return 0, common.ErrNotImplementedError -} - -func (p *Process) CwdWithContext(ctx context.Context) (string, error) { - return "", common.ErrNotImplementedError -} - -func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) { - return 0, common.ErrNotImplementedError -} - -func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) { - return 0, common.ErrNotImplementedError -} - -func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) { - return nil, common.ErrNotImplementedError -} - -func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) { - return nil, common.ErrNotImplementedError -} - -func parseKinfoProc(buf []byte) (KinfoProc, error) { - var k KinfoProc - br := bytes.NewReader(buf) - err := common.Read(br, binary.LittleEndian, &k) - return k, err -} diff --git a/vendor/github.com/shirou/gopsutil/process/process_darwin.go b/vendor/github.com/shirou/gopsutil/process/process_darwin.go index dc75526ccc..3eb53e686b 100644 --- a/vendor/github.com/shirou/gopsutil/process/process_darwin.go +++ b/vendor/github.com/shirou/gopsutil/process/process_darwin.go @@ -3,13 +3,16 @@ package process import ( + "bytes" "context" + "encoding/binary" "fmt" "os/exec" "path/filepath" "strconv" "strings" "time" + "unsafe" "github.com/shirou/gopsutil/cpu" "github.com/shirou/gopsutil/internal/common" @@ -35,10 +38,17 @@ type _Ctype_struct___0 struct { Pad uint64 } +// MemoryInfoExStat is different between OSes +type MemoryInfoExStat struct { +} + +type MemoryMapsStat struct { +} + func pidsWithContext(ctx context.Context) ([]int32, error) { var ret []int32 - pids, err := callPsWithContext(ctx, "pid", 0, false, false) + pids, err := callPsWithContext(ctx, "pid", 0, false) if err != nil { return ret, err } @@ -54,8 +64,12 @@ func pidsWithContext(ctx context.Context) ([]int32, error) { return ret, nil } +func (p *Process) Ppid() (int32, error) { + return p.PpidWithContext(context.Background()) +} + func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { - r, err := callPsWithContext(ctx, "ppid", p.Pid, false, false) + r, err := callPsWithContext(ctx, "ppid", p.Pid, false) if err != nil { return 0, err } @@ -67,6 +81,9 @@ func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { return int32(v), err } +func (p *Process) Name() (string, error) { + return p.NameWithContext(context.Background()) +} func (p *Process) NameWithContext(ctx context.Context) (string, error) { k, err := p.getKProc() @@ -76,47 +93,54 @@ func (p *Process) NameWithContext(ctx context.Context) (string, error) { name := common.IntToString(k.Proc.P_comm[:]) if len(name) >= 15 { - cmdName, err := p.cmdNameWithContext(ctx) + cmdlineSlice, err := p.CmdlineSliceWithContext(ctx) if err != nil { return "", err } - if len(cmdName) > 0 { - extendedName := filepath.Base(cmdName[0]) + if len(cmdlineSlice) > 0 { + extendedName := filepath.Base(cmdlineSlice[0]) if strings.HasPrefix(extendedName, p.name) { name = extendedName } else { - name = cmdName[0] + name = cmdlineSlice[0] } } } return name, nil } +func (p *Process) Tgid() (int32, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) Exe() (string, error) { + return p.ExeWithContext(context.Background()) +} + +// Cmdline returns the command line arguments of the process as a string with +// each argument separated by 0x20 ascii character. +func (p *Process) Cmdline() (string, error) { + return p.CmdlineWithContext(context.Background()) +} func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) { - r, err := callPsWithContext(ctx, "command", p.Pid, false, false) + r, err := callPsWithContext(ctx, "command", p.Pid, false) if err != nil { return "", err } return strings.Join(r[0], " "), err } -// cmdNameWithContext returns the command name (including spaces) without any arguments -func (p *Process) cmdNameWithContext(ctx context.Context) ([]string, error) { - r, err := callPsWithContext(ctx, "command", p.Pid, false, true) - if err != nil { - return nil, err - } - return r[0], err -} - -// CmdlineSliceWithContext returns the command line arguments of the process as a slice with each +// CmdlineSlice returns the command line arguments of the process as a slice with each // element being an argument. Because of current deficiencies in the way that the command // line arguments are found, single arguments that have spaces in the will actually be // reported as two separate items. In order to do something better CGO would be needed // to use the native darwin functions. +func (p *Process) CmdlineSlice() ([]string, error) { + return p.CmdlineSliceWithContext(context.Background()) +} + func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) { - r, err := callPsWithContext(ctx, "command", p.Pid, false, false) + r, err := callPsWithContext(ctx, "command", p.Pid, false) if err != nil { return nil, err } @@ -124,7 +148,7 @@ func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) } func (p *Process) createTimeWithContext(ctx context.Context) (int64, error) { - r, err := callPsWithContext(ctx, "etime", p.Pid, false, false) + r, err := callPsWithContext(ctx, "etime", p.Pid, false) if err != nil { return 0, err } @@ -153,26 +177,41 @@ func (p *Process) createTimeWithContext(ctx context.Context) (int64, error) { start := time.Now().Add(-elapsed) return start.Unix() * 1000, nil } +func (p *Process) Cwd() (string, error) { + return p.CwdWithContext(context.Background()) +} + +func (p *Process) CwdWithContext(ctx context.Context) (string, error) { + return "", common.ErrNotImplementedError +} +func (p *Process) Parent() (*Process, error) { + return p.ParentWithContext(context.Background()) +} func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { - out, err := common.CallLsofWithContext(ctx, invoke, p.Pid, "-FR") + rr, err := common.CallLsofWithContext(ctx, invoke, p.Pid, "-FR") if err != nil { return nil, err } - for _, line := range out { - if len(line) >= 1 && line[0] == 'R' { - v, err := strconv.Atoi(line[1:]) - if err != nil { - return nil, err - } - return NewProcessWithContext(ctx, int32(v)) + for _, r := range rr { + if strings.HasPrefix(r, "p") { // skip if process + continue } + l := string(r) + v, err := strconv.Atoi(strings.Replace(l, "R", "", 1)) + if err != nil { + return nil, err + } + return NewProcess(int32(v)) } return nil, fmt.Errorf("could not find parent line") } +func (p *Process) Status() (string, error) { + return p.StatusWithContext(context.Background()) +} func (p *Process) StatusWithContext(ctx context.Context) (string, error) { - r, err := callPsWithContext(ctx, "state", p.Pid, false, false) + r, err := callPsWithContext(ctx, "state", p.Pid, false) if err != nil { return "", err } @@ -180,6 +219,10 @@ func (p *Process) StatusWithContext(ctx context.Context) (string, error) { return r[0][0][0:1], err } +func (p *Process) Foreground() (bool, error) { + return p.ForegroundWithContext(context.Background()) +} + func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { // see https://github.com/shirou/gopsutil/issues/596#issuecomment-432707831 for implementation details pid := p.Pid @@ -194,6 +237,10 @@ func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { return strings.IndexByte(string(out), '+') != -1, nil } +func (p *Process) Uids() ([]int32, error) { + return p.UidsWithContext(context.Background()) +} + func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { k, err := p.getKProc() if err != nil { @@ -205,6 +252,9 @@ func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { return []int32{userEffectiveUID}, nil } +func (p *Process) Gids() ([]int32, error) { + return p.GidsWithContext(context.Background()) +} func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { k, err := p.getKProc() @@ -217,20 +267,8 @@ func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { return gids, nil } - -func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { - return nil, common.ErrNotImplementedError - // k, err := p.getKProc() - // if err != nil { - // return nil, err - // } - - // groups := make([]int32, k.Eproc.Ucred.Ngroups) - // for i := int16(0); i < k.Eproc.Ucred.Ngroups; i++ { - // groups[i] = int32(k.Eproc.Ucred.Groups[i]) - // } - - // return groups, nil +func (p *Process) Terminal() (string, error) { + return p.TerminalWithContext(context.Background()) } func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { @@ -250,6 +288,9 @@ func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { return termmap[ttyNr], nil */ } +func (p *Process) Nice() (int32, error) { + return p.NiceWithContext(context.Background()) +} func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { k, err := p.getKProc() @@ -258,18 +299,69 @@ func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { } return int32(k.Proc.P_nice), nil } +func (p *Process) IOnice() (int32, error) { + return p.IOniceWithContext(context.Background()) +} + +func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) Rlimit() ([]RlimitStat, error) { + return p.RlimitWithContext(context.Background()) +} + +func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) { + var rlimit []RlimitStat + return rlimit, common.ErrNotImplementedError +} +func (p *Process) RlimitUsage(gatherUsed bool) ([]RlimitStat, error) { + return p.RlimitUsageWithContext(context.Background(), gatherUsed) +} + +func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) { + var rlimit []RlimitStat + return rlimit, common.ErrNotImplementedError +} +func (p *Process) IOCounters() (*IOCountersStat, error) { + return p.IOCountersWithContext(context.Background()) +} func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { + return p.NumCtxSwitchesWithContext(context.Background()) +} + +func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) NumFDs() (int32, error) { + return p.NumFDsWithContext(context.Background()) +} + +func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) NumThreads() (int32, error) { + return p.NumThreadsWithContext(context.Background()) +} func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { - r, err := callPsWithContext(ctx, "utime,stime", p.Pid, true, false) + r, err := callPsWithContext(ctx, "utime,stime", p.Pid, true) if err != nil { return 0, err } return int32(len(r)), nil } +func (p *Process) Threads() (map[int32]*cpu.TimesStat, error) { + return p.ThreadsWithContext(context.Background()) +} + +func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) { + ret := make(map[int32]*cpu.TimesStat) + return ret, common.ErrNotImplementedError +} func convertCPUTimes(s string) (ret float64, err error) { var t int @@ -316,9 +408,12 @@ func convertCPUTimes(s string) (ret float64, err error) { t += h return float64(t) / ClockTicks, nil } +func (p *Process) Times() (*cpu.TimesStat, error) { + return p.TimesWithContext(context.Background()) +} func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) { - r, err := callPsWithContext(ctx, "utime,stime", p.Pid, false, false) + r, err := callPsWithContext(ctx, "utime,stime", p.Pid, false) if err != nil { return nil, err @@ -340,9 +435,19 @@ func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) } return ret, nil } +func (p *Process) CPUAffinity() ([]int32, error) { + return p.CPUAffinityWithContext(context.Background()) +} + +func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { + return p.MemoryInfoWithContext(context.Background()) +} func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, error) { - r, err := callPsWithContext(ctx, "rss,vsize,pagein", p.Pid, false, false) + r, err := callPsWithContext(ctx, "rss,vsize,pagein", p.Pid, false) if err != nil { return nil, err } @@ -367,6 +472,25 @@ func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, e return ret, nil } +func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { + return p.MemoryInfoExWithContext(context.Background()) +} + +func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) PageFaults() (*PageFaultsStat, error) { + return p.PageFaultsWithContext(context.Background()) +} + +func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) Children() ([]*Process, error) { + return p.ChildrenWithContext(context.Background()) +} func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { pids, err := common.CallPgrepWithContext(ctx, invoke, p.Pid) @@ -375,7 +499,7 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { } ret := make([]*Process, 0, len(pids)) for _, pid := range pids { - np, err := NewProcessWithContext(ctx, pid) + np, err := NewProcess(pid) if err != nil { return nil, err } @@ -384,12 +508,50 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { return ret, nil } +func (p *Process) OpenFiles() ([]OpenFilesStat, error) { + return p.OpenFilesWithContext(context.Background()) +} + +func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) Connections() ([]net.ConnectionStat, error) { + return p.ConnectionsWithContext(context.Background()) +} + func (p *Process) ConnectionsWithContext(ctx context.Context) ([]net.ConnectionStat, error) { - return net.ConnectionsPidWithContext(ctx, "all", p.Pid) + return net.ConnectionsPid("all", p.Pid) +} + +// Connections returns a slice of net.ConnectionStat used by the process at most `max` +func (p *Process) ConnectionsMax(max int) ([]net.ConnectionStat, error) { + return p.ConnectionsMaxWithContext(context.Background(), max) } func (p *Process) ConnectionsMaxWithContext(ctx context.Context, max int) ([]net.ConnectionStat, error) { - return net.ConnectionsPidMaxWithContext(ctx, "all", p.Pid, max) + return net.ConnectionsPidMax("all", p.Pid, max) +} + +func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { + return p.NetIOCountersWithContext(context.Background(), pernic) +} + +func (p *Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { + return p.MemoryMapsWithContext(context.Background(), grouped) +} + +func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) { + var ret []MemoryMapsStat + return &ret, common.ErrNotImplementedError +} + +func Processes() ([]*Process, error) { + return ProcessesWithContext(context.Background()) } func ProcessesWithContext(ctx context.Context) ([]*Process, error) { @@ -401,7 +563,7 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { } for _, pid := range pids { - p, err := NewProcessWithContext(ctx, pid) + p, err := NewProcess(pid) if err != nil { continue } @@ -411,12 +573,39 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { return out, nil } +func parseKinfoProc(buf []byte) (KinfoProc, error) { + var k KinfoProc + br := bytes.NewReader(buf) + + err := common.Read(br, binary.LittleEndian, &k) + if err != nil { + return k, err + } + + return k, nil +} + // Returns a proc as defined here: // http://unix.superglobalmegacorp.com/Net2/newsrc/sys/kinfo_proc.h.html func (p *Process) getKProc() (*KinfoProc, error) { - buf, err := unix.SysctlRaw("kern.proc.pid", int(p.Pid)) - if err != nil { - return nil, err + return p.getKProcWithContext(context.Background()) +} + +func (p *Process) getKProcWithContext(ctx context.Context) (*KinfoProc, error) { + mib := []int32{CTLKern, KernProc, KernProcPID, p.Pid} + procK := KinfoProc{} + length := uint64(unsafe.Sizeof(procK)) + buf := make([]byte, length) + _, _, syserr := unix.Syscall6( + unix.SYS___SYSCTL, + uintptr(unsafe.Pointer(&mib[0])), + uintptr(len(mib)), + uintptr(unsafe.Pointer(&buf[0])), + uintptr(unsafe.Pointer(&length)), + 0, + 0) + if syserr != 0 { + return nil, syserr } k, err := parseKinfoProc(buf) if err != nil { @@ -428,9 +617,9 @@ func (p *Process) getKProc() (*KinfoProc, error) { // call ps command. // Return value deletes Header line(you must not input wrong arg). -// And split by space. Caller have responsibility to manage. +// And splited by Space. Caller have responsibility to manage. // If passed arg pid is 0, get information from all process. -func callPsWithContext(ctx context.Context, arg string, pid int32, threadOption bool, nameOption bool) ([][]string, error) { +func callPsWithContext(ctx context.Context, arg string, pid int32, threadOption bool) ([][]string, error) { bin, err := exec.LookPath("ps") if err != nil { return [][]string{}, err @@ -444,10 +633,6 @@ func callPsWithContext(ctx context.Context, arg string, pid int32, threadOption } else { cmd = []string{"-x", "-o", arg, "-p", strconv.Itoa(int(pid))} } - - if nameOption { - cmd = append(cmd, "-c") - } out, err := invoke.CommandWithContext(ctx, bin, cmd...) if err != nil { return [][]string{}, err @@ -456,19 +641,13 @@ func callPsWithContext(ctx context.Context, arg string, pid int32, threadOption var ret [][]string for _, l := range lines[1:] { - var lr []string - if nameOption { - lr = append(lr, l) - } else { - for _, r := range strings.Split(l, " ") { - if r == "" { - continue - } - lr = append(lr, strings.TrimSpace(r)) + for _, r := range strings.Split(l, " ") { + if r == "" { + continue } + lr = append(lr, strings.TrimSpace(r)) } - if len(lr) != 0 { ret = append(ret, lr) } diff --git a/vendor/github.com/shirou/gopsutil/process/process_darwin_arm64.go b/vendor/github.com/shirou/gopsutil/process/process_darwin_arm64.go deleted file mode 100644 index c0063e4e1e..0000000000 --- a/vendor/github.com/shirou/gopsutil/process/process_darwin_arm64.go +++ /dev/null @@ -1,205 +0,0 @@ -// +build darwin -// +build arm64 -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs process/types_darwin.go - -package process - -const ( - sizeofPtr = 0x8 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x8 - sizeofLongLong = 0x8 -) - -type ( - _C_short int16 - _C_int int32 - _C_long int64 - _C_long_long int64 -) - -type Timespec struct { - Sec int64 - Nsec int64 -} - -type Timeval struct { - Sec int64 - Usec int32 - Pad_cgo_0 [4]byte -} - -type Rusage struct { - Utime Timeval - Stime Timeval - Maxrss int64 - Ixrss int64 - Idrss int64 - Isrss int64 - Minflt int64 - Majflt int64 - Nswap int64 - Inblock int64 - Oublock int64 - Msgsnd int64 - Msgrcv int64 - Nsignals int64 - Nvcsw int64 - Nivcsw int64 -} - -type Rlimit struct { - Cur uint64 - Max uint64 -} - -type UGid_t uint32 - -type KinfoProc struct { - Proc ExternProc - Eproc Eproc -} - -type Eproc struct { - Paddr *Proc - Sess *Session - Pcred Upcred - Ucred Uucred - Vm Vmspace - Ppid int32 - Pgid int32 - Jobc int16 - Tdev int32 - Tpgid int32 - Tsess *Session - Wmesg [8]int8 - Xsize int32 - Xrssize int16 - Xccount int16 - Xswrss int16 - Flag int32 - Login [12]int8 - Spare [4]int32 - Pad_cgo_0 [4]byte -} - -type Proc struct{} - -type Session struct{} - -type ucred struct{} - -type Uucred struct { - Ref int32 - UID uint32 - Ngroups int16 - Groups [16]uint32 -} - -type Upcred struct { - Pc_lock [72]int8 - Pc_ucred *ucred - P_ruid uint32 - P_svuid uint32 - P_rgid uint32 - P_svgid uint32 - P_refcnt int32 - Pad_cgo_0 [4]byte -} - -type Vmspace struct { - Dummy int32 - Dummy2 *int8 - Dummy3 [5]int32 - Dummy4 [3]*int8 -} - -type Sigacts struct{} - -type ExternProc struct { - P_un [16]byte - P_vmspace *Vmspace - P_sigacts *Sigacts - P_flag int32 - P_stat int8 - P_pid int32 - P_oppid int32 - P_dupfd int32 - User_stack *int8 - Exit_thread *byte - P_debugger int32 - Sigwait int32 - P_estcpu uint32 - P_cpticks int32 - P_pctcpu uint32 - P_wchan *byte - P_wmesg *int8 - P_swtime uint32 - P_slptime uint32 - P_realtimer Itimerval - P_rtime Timeval - P_uticks uint64 - P_sticks uint64 - P_iticks uint64 - P_traceflag int32 - P_tracep *Vnode - P_siglist int32 - P_textvp *Vnode - P_holdcnt int32 - P_sigmask uint32 - P_sigignore uint32 - P_sigcatch uint32 - P_priority uint8 - P_usrpri uint8 - P_nice int8 - P_comm [17]int8 - P_pgrp *Pgrp - P_addr *UserStruct - P_xstat uint16 - P_acflag uint16 - P_ru *Rusage -} - -type Itimerval struct { - Interval Timeval - Value Timeval -} - -type Vnode struct{} - -type Pgrp struct{} - -type UserStruct struct{} - -type Au_session struct { - Aia_p *AuditinfoAddr - Mask AuMask -} - -type Posix_cred struct{} - -type Label struct{} - -type AuditinfoAddr struct { - Auid uint32 - Mask AuMask - Termid AuTidAddr - Asid int32 - Flags uint64 -} -type AuMask struct { - Success uint32 - Failure uint32 -} -type AuTidAddr struct { - Port int32 - Type uint32 - Addr [4]uint32 -} - -type UcredQueue struct { - Next *ucred - Prev **ucred -} diff --git a/vendor/github.com/shirou/gopsutil/process/process_fallback.go b/vendor/github.com/shirou/gopsutil/process/process_fallback.go index 14865efc25..1cb55c8b04 100644 --- a/vendor/github.com/shirou/gopsutil/process/process_fallback.go +++ b/vendor/github.com/shirou/gopsutil/process/process_fallback.go @@ -29,6 +29,10 @@ type MemoryInfoExStat struct { } func pidsWithContext(ctx context.Context) ([]int32, error) { + return []int32{}, common.ErrNotImplementedError +} + +func Processes() ([]*Process, error) { return nil, common.ErrNotImplementedError } @@ -37,168 +41,291 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { } func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) { - return false, common.ErrNotImplementedError + pids, err := PidsWithContext(ctx) + if err != nil { + return false, err + } + + for _, i := range pids { + if i == pid { + return true, err + } + } + + return false, err +} + +func (p *Process) Ppid() (int32, error) { + return p.PpidWithContext(context.Background()) } func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } +func (p *Process) Name() (string, error) { + return p.NameWithContext(context.Background()) +} func (p *Process) NameWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } - -func (p *Process) TgidWithContext(ctx context.Context) (int32, error) { +func (p *Process) Tgid() (int32, error) { return 0, common.ErrNotImplementedError } +func (p *Process) Exe() (string, error) { + return p.ExeWithContext(context.Background()) +} func (p *Process) ExeWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } +func (p *Process) Cmdline() (string, error) { + return p.CmdlineWithContext(context.Background()) +} func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } +func (p *Process) CmdlineSlice() ([]string, error) { + return p.CmdlineSliceWithContext(context.Background()) +} func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) { - return nil, common.ErrNotImplementedError + return []string{}, common.ErrNotImplementedError } func (p *Process) createTimeWithContext(ctx context.Context) (int64, error) { return 0, common.ErrNotImplementedError } +func (p *Process) Cwd() (string, error) { + return p.CwdWithContext(context.Background()) +} func (p *Process) CwdWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } +func (p *Process) Parent() (*Process, error) { + return p.ParentWithContext(context.Background()) +} func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { return nil, common.ErrNotImplementedError } +func (p *Process) Status() (string, error) { + return p.StatusWithContext(context.Background()) +} func (p *Process) StatusWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } +func (p *Process) Foreground() (bool, error) { + return p.ForegroundWithContext(context.Background()) +} func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { return false, common.ErrNotImplementedError } +func (p *Process) Uids() ([]int32, error) { + return p.UidsWithContext(context.Background()) +} func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { - return nil, common.ErrNotImplementedError + return []int32{}, common.ErrNotImplementedError +} +func (p *Process) Gids() ([]int32, error) { + return p.GidsWithContext(context.Background()) } func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { - return nil, common.ErrNotImplementedError + return []int32{}, common.ErrNotImplementedError } - -func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { - return nil, common.ErrNotImplementedError +func (p *Process) Terminal() (string, error) { + return p.TerminalWithContext(context.Background()) } func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } +func (p *Process) Nice() (int32, error) { + return p.NiceWithContext(context.Background()) +} func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } +func (p *Process) IOnice() (int32, error) { + return p.IOniceWithContext(context.Background()) +} func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } +func (p *Process) Rlimit() ([]RlimitStat, error) { + return p.RlimitWithContext(context.Background()) +} func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) RlimitUsage(gatherUsed bool) ([]RlimitStat, error) { + return p.RlimitUsageWithContext(context.Background(), gatherUsed) +} func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) IOCounters() (*IOCountersStat, error) { + return p.IOCountersWithContext(context.Background()) +} func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { + return p.NumCtxSwitchesWithContext(context.Background()) +} func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) NumFDs() (int32, error) { + return p.NumFDsWithContext(context.Background()) +} func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } +func (p *Process) NumThreads() (int32, error) { + return p.NumThreadsWithContext(context.Background()) +} func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } +func (p *Process) Threads() (map[int32]*cpu.TimesStat, error) { + return p.ThreadsWithContext(context.Background()) +} func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) Times() (*cpu.TimesStat, error) { + return p.TimesWithContext(context.Background()) +} func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) CPUAffinity() ([]int32, error) { + return p.CPUAffinityWithContext(context.Background()) +} func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) { return nil, common.ErrNotImplementedError } +func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { + return p.MemoryInfoWithContext(context.Background()) +} func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { + return p.MemoryInfoExWithContext(context.Background()) +} func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) { return nil, common.ErrNotImplementedError } - +func (p *Process) PageFaults() (*PageFaultsStat, error) { + return p.PageFaultsWithContext(context.Background()) +} func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) Children() ([]*Process, error) { + return p.ChildrenWithContext(context.Background()) +} func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { return nil, common.ErrNotImplementedError } +func (p *Process) OpenFiles() ([]OpenFilesStat, error) { + return p.OpenFilesWithContext(context.Background()) +} func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) { - return nil, common.ErrNotImplementedError + return []OpenFilesStat{}, common.ErrNotImplementedError +} +func (p *Process) Connections() ([]net.ConnectionStat, error) { + return p.ConnectionsWithContext(context.Background()) } func (p *Process) ConnectionsWithContext(ctx context.Context) ([]net.ConnectionStat, error) { - return nil, common.ErrNotImplementedError + return []net.ConnectionStat{}, common.ErrNotImplementedError +} + +func (p *Process) ConnectionsMax(max int) ([]net.ConnectionStat, error) { + return p.ConnectionsMaxWithContext(context.Background(), max) } func (p *Process) ConnectionsMaxWithContext(ctx context.Context, max int) ([]net.ConnectionStat, error) { - return nil, common.ErrNotImplementedError + return []net.ConnectionStat{}, common.ErrNotImplementedError +} + +func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { + return p.NetIOCountersWithContext(context.Background(), pernic) } func (p *Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) { - return nil, common.ErrNotImplementedError + return []net.IOCountersStat{}, common.ErrNotImplementedError +} + +func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { + return p.MemoryMapsWithContext(context.Background(), grouped) } func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) SendSignal(sig syscall.Signal) error { + return p.SendSignalWithContext(context.Background(), sig) +} func (p *Process) SendSignalWithContext(ctx context.Context, sig syscall.Signal) error { return common.ErrNotImplementedError } +func (p *Process) Suspend() error { + return p.SuspendWithContext(context.Background()) +} func (p *Process) SuspendWithContext(ctx context.Context) error { return common.ErrNotImplementedError } +func (p *Process) Resume() error { + return p.ResumeWithContext(context.Background()) +} func (p *Process) ResumeWithContext(ctx context.Context) error { return common.ErrNotImplementedError } +func (p *Process) Terminate() error { + return p.TerminateWithContext(context.Background()) +} func (p *Process) TerminateWithContext(ctx context.Context) error { return common.ErrNotImplementedError } +func (p *Process) Kill() error { + return p.KillWithContext(context.Background()) +} func (p *Process) KillWithContext(ctx context.Context) error { return common.ErrNotImplementedError } +func (p *Process) Username() (string, error) { + return p.UsernameWithContext(context.Background()) +} func (p *Process) UsernameWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError diff --git a/vendor/github.com/shirou/gopsutil/process/process_freebsd.go b/vendor/github.com/shirou/gopsutil/process/process_freebsd.go index 0666e7f429..0cf1699dd5 100644 --- a/vendor/github.com/shirou/gopsutil/process/process_freebsd.go +++ b/vendor/github.com/shirou/gopsutil/process/process_freebsd.go @@ -5,6 +5,7 @@ package process import ( "bytes" "context" + "encoding/binary" "os/exec" "path/filepath" "strconv" @@ -16,9 +17,16 @@ import ( "golang.org/x/sys/unix" ) +// MemoryInfoExStat is different between OSes +type MemoryInfoExStat struct { +} + +type MemoryMapsStat struct { +} + func pidsWithContext(ctx context.Context) ([]int32, error) { var ret []int32 - procs, err := ProcessesWithContext(ctx) + procs, err := Processes() if err != nil { return ret, nil } @@ -30,6 +38,10 @@ func pidsWithContext(ctx context.Context) ([]int32, error) { return ret, nil } +func (p *Process) Ppid() (int32, error) { + return p.PpidWithContext(context.Background()) +} + func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { k, err := p.getKProc() if err != nil { @@ -38,6 +50,9 @@ func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { return k.Ppid, nil } +func (p *Process) Name() (string, error) { + return p.NameWithContext(context.Background()) +} func (p *Process) NameWithContext(ctx context.Context) (string, error) { k, err := p.getKProc() @@ -63,11 +78,21 @@ func (p *Process) NameWithContext(ctx context.Context) (string, error) { return name, nil } +func (p *Process) Tgid() (int32, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) Exe() (string, error) { + return p.ExeWithContext(context.Background()) +} func (p *Process) ExeWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } +func (p *Process) Cmdline() (string, error) { + return p.CmdlineWithContext(context.Background()) +} + func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) { mib := []int32{CTLKern, KernProc, KernProcArgs, p.Pid} buf, _, err := common.CallSyscall(mib) @@ -84,6 +109,10 @@ func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) { return strings.Join(ret, " "), nil } +func (p *Process) CmdlineSlice() ([]string, error) { + return p.CmdlineSliceWithContext(context.Background()) +} + func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) { mib := []int32{CTLKern, KernProc, KernProcArgs, p.Pid} buf, _, err := common.CallSyscall(mib) @@ -108,9 +137,22 @@ func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) func (p *Process) createTimeWithContext(ctx context.Context) (int64, error) { return 0, common.ErrNotImplementedError } +func (p *Process) Cwd() (string, error) { + return p.CwdWithContext(context.Background()) +} + +func (p *Process) CwdWithContext(ctx context.Context) (string, error) { + return "", common.ErrNotImplementedError +} +func (p *Process) Parent() (*Process, error) { + return p.ParentWithContext(context.Background()) +} func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { - return nil, common.ErrNotImplementedError + return p, common.ErrNotImplementedError +} +func (p *Process) Status() (string, error) { + return p.StatusWithContext(context.Background()) } func (p *Process) StatusWithContext(ctx context.Context) (string, error) { @@ -139,6 +181,10 @@ func (p *Process) StatusWithContext(ctx context.Context) (string, error) { return s, nil } +func (p *Process) Foreground() (bool, error) { + return p.ForegroundWithContext(context.Background()) +} + func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { // see https://github.com/shirou/gopsutil/issues/596#issuecomment-432707831 for implementation details pid := p.Pid @@ -153,6 +199,10 @@ func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { return strings.IndexByte(string(out), '+') != -1, nil } +func (p *Process) Uids() ([]int32, error) { + return p.UidsWithContext(context.Background()) +} + func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { k, err := p.getKProc() if err != nil { @@ -165,6 +215,9 @@ func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { return uids, nil } +func (p *Process) Gids() ([]int32, error) { + return p.GidsWithContext(context.Background()) +} func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { k, err := p.getKProc() @@ -177,19 +230,8 @@ func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { return gids, nil } - -func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { - k, err := p.getKProc() - if err != nil { - return nil, err - } - - groups := make([]int32, k.Ngroups) - for i := int16(0); i < k.Ngroups; i++ { - groups[i] = int32(k.Groups[i]) - } - - return groups, nil +func (p *Process) Terminal() (string, error) { + return p.TerminalWithContext(context.Background()) } func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { @@ -207,6 +249,9 @@ func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { return termmap[ttyNr], nil } +func (p *Process) Nice() (int32, error) { + return p.NiceWithContext(context.Background()) +} func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { k, err := p.getKProc() @@ -215,6 +260,32 @@ func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { } return int32(k.Nice), nil } +func (p *Process) IOnice() (int32, error) { + return p.IOniceWithContext(context.Background()) +} + +func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) Rlimit() ([]RlimitStat, error) { + return p.RlimitWithContext(context.Background()) +} + +func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) { + var rlimit []RlimitStat + return rlimit, common.ErrNotImplementedError +} +func (p *Process) RlimitUsage(gatherUsed bool) ([]RlimitStat, error) { + return p.RlimitUsageWithContext(context.Background(), gatherUsed) +} + +func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) { + var rlimit []RlimitStat + return rlimit, common.ErrNotImplementedError +} +func (p *Process) IOCounters() (*IOCountersStat, error) { + return p.IOCountersWithContext(context.Background()) +} func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, error) { k, err := p.getKProc() @@ -226,6 +297,23 @@ func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, e WriteCount: uint64(k.Rusage.Oublock), }, nil } +func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { + return p.NumCtxSwitchesWithContext(context.Background()) +} + +func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) NumFDs() (int32, error) { + return p.NumFDsWithContext(context.Background()) +} + +func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) NumThreads() (int32, error) { + return p.NumThreadsWithContext(context.Background()) +} func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { k, err := p.getKProc() @@ -235,6 +323,17 @@ func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { return k.Numthreads, nil } +func (p *Process) Threads() (map[int32]*cpu.TimesStat, error) { + return p.ThreadsWithContext(context.Background()) +} + +func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) { + ret := make(map[int32]*cpu.TimesStat) + return ret, common.ErrNotImplementedError +} +func (p *Process) Times() (*cpu.TimesStat, error) { + return p.TimesWithContext(context.Background()) +} func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) { k, err := p.getKProc() @@ -247,6 +346,16 @@ func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) System: float64(k.Rusage.Stime.Sec) + float64(k.Rusage.Stime.Usec)/1000000, }, nil } +func (p *Process) CPUAffinity() ([]int32, error) { + return p.CPUAffinityWithContext(context.Background()) +} + +func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { + return p.MemoryInfoWithContext(context.Background()) +} func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, error) { k, err := p.getKProc() @@ -264,6 +373,25 @@ func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, e VMS: uint64(k.Size), }, nil } +func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { + return p.MemoryInfoExWithContext(context.Background()) +} + +func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) PageFaults() (*PageFaultsStat, error) { + return p.PageFaultsWithContext(context.Background()) +} + +func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) Children() ([]*Process, error) { + return p.ChildrenWithContext(context.Background()) +} func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { pids, err := common.CallPgrepWithContext(ctx, invoke, p.Pid) @@ -272,7 +400,7 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { } ret := make([]*Process, 0, len(pids)) for _, pid := range pids { - np, err := NewProcessWithContext(ctx, pid) + np, err := NewProcess(pid) if err != nil { return nil, err } @@ -281,14 +409,52 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { return ret, nil } +func (p *Process) OpenFiles() ([]OpenFilesStat, error) { + return p.OpenFilesWithContext(context.Background()) +} + +func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) Connections() ([]net.ConnectionStat, error) { + return p.ConnectionsWithContext(context.Background()) +} + func (p *Process) ConnectionsWithContext(ctx context.Context) ([]net.ConnectionStat, error) { return nil, common.ErrNotImplementedError } +// Connections returns a slice of net.ConnectionStat used by the process at most `max` +func (p *Process) ConnectionsMax(max int) ([]net.ConnectionStat, error) { + return p.ConnectionsMaxWithContext(context.Background(), max) +} + func (p *Process) ConnectionsMaxWithContext(ctx context.Context, max int) ([]net.ConnectionStat, error) { + return []net.ConnectionStat{}, common.ErrNotImplementedError +} + +func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { + return p.NetIOCountersWithContext(context.Background(), pernic) +} + +func (p *Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { + return p.MemoryMapsWithContext(context.Background(), grouped) +} + +func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) { + var ret []MemoryMapsStat + return &ret, common.ErrNotImplementedError +} + +func Processes() ([]*Process, error) { + return ProcessesWithContext(context.Background()) +} + func ProcessesWithContext(ctx context.Context) ([]*Process, error) { results := []*Process{} @@ -308,7 +474,7 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { if err != nil { continue } - p, err := NewProcessWithContext(ctx, int32(k.Pid)) + p, err := NewProcess(int32(k.Pid)) if err != nil { continue } @@ -319,7 +485,18 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { return results, nil } +func parseKinfoProc(buf []byte) (KinfoProc, error) { + var k KinfoProc + br := bytes.NewReader(buf) + err := common.Read(br, binary.LittleEndian, &k) + return k, err +} + func (p *Process) getKProc() (*KinfoProc, error) { + return p.getKProcWithContext(context.Background()) +} + +func (p *Process) getKProcWithContext(ctx context.Context) (*KinfoProc, error) { mib := []int32{CTLKern, KernProc, KernProcPID, p.Pid} buf, length, err := common.CallSyscall(mib) diff --git a/vendor/github.com/shirou/gopsutil/process/process_linux.go b/vendor/github.com/shirou/gopsutil/process/process_linux.go index df460dd13a..afd5e28e86 100644 --- a/vendor/github.com/shirou/gopsutil/process/process_linux.go +++ b/vendor/github.com/shirou/gopsutil/process/process_linux.go @@ -64,6 +64,11 @@ func (m MemoryMapsStat) String() string { return string(s) } +// Ppid returns Parent Process ID of the process. +func (p *Process) Ppid() (int32, error) { + return p.PpidWithContext(context.Background()) +} + func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { _, ppid, _, _, _, _, _, err := p.fillFromStatWithContext(ctx) if err != nil { @@ -72,6 +77,11 @@ func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { return ppid, nil } +// Name returns name of the process. +func (p *Process) Name() (string, error) { + return p.NameWithContext(context.Background()) +} + func (p *Process) NameWithContext(ctx context.Context) (string, error) { if p.name == "" { if err := p.fillFromStatusWithContext(ctx); err != nil { @@ -81,23 +91,41 @@ func (p *Process) NameWithContext(ctx context.Context) (string, error) { return p.name, nil } -func (p *Process) TgidWithContext(ctx context.Context) (int32, error) { +// Tgid returns tgid, a Linux-synonym for user-space Pid +func (p *Process) Tgid() (int32, error) { if p.tgid == 0 { - if err := p.fillFromStatusWithContext(ctx); err != nil { + if err := p.fillFromStatusWithContext(context.Background()); err != nil { return 0, err } } return p.tgid, nil } +// Exe returns executable path of the process. +func (p *Process) Exe() (string, error) { + return p.ExeWithContext(context.Background()) +} + func (p *Process) ExeWithContext(ctx context.Context) (string, error) { return p.fillFromExeWithContext(ctx) } +// Cmdline returns the command line arguments of the process as a string with +// each argument separated by 0x20 ascii character. +func (p *Process) Cmdline() (string, error) { + return p.CmdlineWithContext(context.Background()) +} + func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) { return p.fillFromCmdlineWithContext(ctx) } +// CmdlineSlice returns the command line arguments of the process as a slice with each +// element being an argument. +func (p *Process) CmdlineSlice() ([]string, error) { + return p.CmdlineSliceWithContext(context.Background()) +} + func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) { return p.fillSliceFromCmdlineWithContext(ctx) } @@ -110,10 +138,20 @@ func (p *Process) createTimeWithContext(ctx context.Context) (int64, error) { return createTime, nil } +// Cwd returns current working directory of the process. +func (p *Process) Cwd() (string, error) { + return p.CwdWithContext(context.Background()) +} + func (p *Process) CwdWithContext(ctx context.Context) (string, error) { return p.fillFromCwdWithContext(ctx) } +// Parent returns parent Process of the process. +func (p *Process) Parent() (*Process, error) { + return p.ParentWithContext(context.Background()) +} + func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { err := p.fillFromStatusWithContext(ctx) if err != nil { @@ -122,7 +160,16 @@ func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { if p.parent == 0 { return nil, fmt.Errorf("wrong number of parents") } - return NewProcessWithContext(ctx, p.parent) + return NewProcess(p.parent) +} + +// Status returns the process status. +// Return value could be one of these. +// R: Running S: Sleep T: Stop I: Idle +// Z: Zombie W: Wait L: Lock +// The character is same within all supported platforms. +func (p *Process) Status() (string, error) { + return p.StatusWithContext(context.Background()) } func (p *Process) StatusWithContext(ctx context.Context) (string, error) { @@ -133,6 +180,11 @@ func (p *Process) StatusWithContext(ctx context.Context) (string, error) { return p.status, nil } +// Foreground returns true if the process is in foreground, false otherwise. +func (p *Process) Foreground() (bool, error) { + return p.ForegroundWithContext(context.Background()) +} + func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { // see https://github.com/shirou/gopsutil/issues/596#issuecomment-432707831 for implementation details pid := p.Pid @@ -150,6 +202,11 @@ func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { return pgid == tpgid, nil } +// Uids returns user ids of the process as a slice of the int +func (p *Process) Uids() ([]int32, error) { + return p.UidsWithContext(context.Background()) +} + func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { err := p.fillFromStatusWithContext(ctx) if err != nil { @@ -158,6 +215,11 @@ func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { return p.uids, nil } +// Gids returns group ids of the process as a slice of the int +func (p *Process) Gids() ([]int32, error) { + return p.GidsWithContext(context.Background()) +} + func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { err := p.fillFromStatusWithContext(ctx) if err != nil { @@ -166,12 +228,9 @@ func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { return p.gids, nil } -func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { - err := p.fillFromStatusWithContext(ctx) - if err != nil { - return []int32{}, err - } - return p.groups, nil +// Terminal returns a terminal which is associated with the process. +func (p *Process) Terminal() (string, error) { + return p.TerminalWithContext(context.Background()) } func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { @@ -187,6 +246,12 @@ func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { return terminal, nil } +// Nice returns a nice value (priority). +// Notice: gopsutil can not set nice value. +func (p *Process) Nice() (int32, error) { + return p.NiceWithContext(context.Background()) +} + func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { _, _, _, _, _, nice, _, err := p.fillFromStatWithContext(ctx) if err != nil { @@ -195,12 +260,29 @@ func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { return nice, nil } +// IOnice returns process I/O nice value (priority). +func (p *Process) IOnice() (int32, error) { + return p.IOniceWithContext(context.Background()) +} + func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } +// Rlimit returns Resource Limits. +func (p *Process) Rlimit() ([]RlimitStat, error) { + return p.RlimitWithContext(context.Background()) +} + func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) { - return p.RlimitUsageWithContext(ctx, false) + return p.RlimitUsage(false) +} + +// RlimitUsage returns Resource Limits. +// If gatherUsed is true, the currently used value will be gathered and added +// to the resulting RlimitStat. +func (p *Process) RlimitUsage(gatherUsed bool) ([]RlimitStat, error) { + return p.RlimitUsageWithContext(context.Background(), gatherUsed) } func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) { @@ -221,7 +303,7 @@ func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ( rs := &rlimits[i] switch rs.Resource { case RLIMIT_CPU: - times, err := p.TimesWithContext(ctx) + times, err := p.Times() if err != nil { return nil, err } @@ -233,7 +315,7 @@ func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ( case RLIMIT_RSS: rs.Used = uint64(p.memInfo.RSS) case RLIMIT_NOFILE: - n, err := p.NumFDsWithContext(ctx) + n, err := p.NumFDs() if err != nil { return nil, err } @@ -258,10 +340,20 @@ func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ( return rlimits, err } +// IOCounters returns IO Counters. +func (p *Process) IOCounters() (*IOCountersStat, error) { + return p.IOCountersWithContext(context.Background()) +} + func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, error) { return p.fillFromIOWithContext(ctx) } +// NumCtxSwitches returns the number of the context switches of the process. +func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { + return p.NumCtxSwitchesWithContext(context.Background()) +} + func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) { err := p.fillFromStatusWithContext(ctx) if err != nil { @@ -270,11 +362,21 @@ func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitche return p.numCtxSwitches, nil } +// NumFDs returns the number of File Descriptors used by the process. +func (p *Process) NumFDs() (int32, error) { + return p.NumFDsWithContext(context.Background()) +} + func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) { _, fnames, err := p.fillFromfdListWithContext(ctx) return int32(len(fnames)), err } +// NumThreads returns the number of threads used by the process. +func (p *Process) NumThreads() (int32, error) { + return p.NumThreadsWithContext(context.Background()) +} + func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { err := p.fillFromStatusWithContext(ctx) if err != nil { @@ -283,6 +385,10 @@ func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { return p.numThreads, nil } +func (p *Process) Threads() (map[int32]*cpu.TimesStat, error) { + return p.ThreadsWithContext(context.Background()) +} + func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) { ret := make(map[int32]*cpu.TimesStat) taskPath := common.HostProc(strconv.Itoa(int(p.Pid)), "task") @@ -303,6 +409,11 @@ func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesS return ret, nil } +// Times returns CPU times of the process. +func (p *Process) Times() (*cpu.TimesStat, error) { + return p.TimesWithContext(context.Background()) +} + func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) { _, _, cpuTimes, _, _, _, _, err := p.fillFromStatWithContext(ctx) if err != nil { @@ -311,10 +422,22 @@ func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) return cpuTimes, nil } +// CPUAffinity returns CPU affinity of the process. +// +// Notice: Not implemented yet. +func (p *Process) CPUAffinity() ([]int32, error) { + return p.CPUAffinityWithContext(context.Background()) +} + func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) { return nil, common.ErrNotImplementedError } +// MemoryInfo returns platform in-dependend memory information, such as RSS, VMS and Swap +func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { + return p.MemoryInfoWithContext(context.Background()) +} + func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, error) { meminfo, _, err := p.fillFromStatmWithContext(ctx) if err != nil { @@ -323,6 +446,11 @@ func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, e return meminfo, nil } +// MemoryInfoEx returns platform dependend memory information. +func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { + return p.MemoryInfoExWithContext(context.Background()) +} + func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) { _, memInfoEx, err := p.fillFromStatmWithContext(ctx) if err != nil { @@ -331,6 +459,11 @@ func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExSta return memInfoEx, nil } +// PageFaultsInfo returns the process's page fault counters +func (p *Process) PageFaults() (*PageFaultsStat, error) { + return p.PageFaultsWithContext(context.Background()) +} + func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) { _, _, _, _, _, _, pageFaults, err := p.fillFromStatWithContext(ctx) if err != nil { @@ -340,6 +473,11 @@ func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, e } +// Children returns a slice of Process of the process. +func (p *Process) Children() ([]*Process, error) { + return p.ChildrenWithContext(context.Background()) +} + func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { pids, err := common.CallPgrepWithContext(ctx, invoke, p.Pid) if err != nil { @@ -350,7 +488,7 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { } ret := make([]*Process, 0, len(pids)) for _, pid := range pids { - np, err := NewProcessWithContext(ctx, pid) + np, err := NewProcess(pid) if err != nil { return nil, err } @@ -359,6 +497,12 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { return ret, nil } +// OpenFiles returns a slice of OpenFilesStat opend by the process. +// OpenFilesStat includes a file path and file descriptor. +func (p *Process) OpenFiles() ([]OpenFilesStat, error) { + return p.OpenFilesWithContext(context.Background()) +} + func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) { _, ofs, err := p.fillFromfdWithContext(ctx) if err != nil { @@ -372,17 +516,38 @@ func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, er return ret, nil } +// Connections returns a slice of net.ConnectionStat used by the process. +// This returns all kind of the connection. This measn TCP, UDP or UNIX. +func (p *Process) Connections() ([]net.ConnectionStat, error) { + return p.ConnectionsWithContext(context.Background()) +} + func (p *Process) ConnectionsWithContext(ctx context.Context) ([]net.ConnectionStat, error) { - return net.ConnectionsPidWithContext(ctx, "all", p.Pid) + return net.ConnectionsPid("all", p.Pid) +} + +// Connections returns a slice of net.ConnectionStat used by the process at most `max` +func (p *Process) ConnectionsMax(max int) ([]net.ConnectionStat, error) { + return p.ConnectionsMaxWithContext(context.Background(), max) } func (p *Process) ConnectionsMaxWithContext(ctx context.Context, max int) ([]net.ConnectionStat, error) { - return net.ConnectionsPidMaxWithContext(ctx, "all", p.Pid, max) + return net.ConnectionsPidMax("all", p.Pid, max) +} + +// NetIOCounters returns NetIOCounters of the process. +func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { + return p.NetIOCountersWithContext(context.Background(), pernic) } func (p *Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) { filename := common.HostProc(strconv.Itoa(int(p.Pid)), "net/dev") - return net.IOCountersByFileWithContext(ctx, pernic, filename) + return net.IOCountersByFile(pernic, filename) +} + +// MemoryMaps get memory maps from /proc/(pid)/smaps +func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { + return p.MemoryMapsWithContext(context.Background(), grouped) } func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) { @@ -399,9 +564,9 @@ func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]M lines := strings.Split(string(contents), "\n") // function of parsing a block - getBlock := func(firstLine []string, block []string) (MemoryMapsStat, error) { + getBlock := func(first_line []string, block []string) (MemoryMapsStat, error) { m := MemoryMapsStat{} - m.Path = firstLine[len(firstLine)-1] + m.Path = first_line[len(first_line)-1] for _, line := range block { if strings.Contains(line, "VmFlags") { @@ -411,8 +576,7 @@ func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]M if len(field) < 2 { continue } - v := strings.Trim(field[1], "kB") // remove last "kB" - v = strings.TrimSpace(v) + v := strings.Trim(field[1], " kB") // remove last "kB" t, err := strconv.ParseUint(v, 10, 64) if err != nil { return m, err @@ -444,15 +608,13 @@ func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]M return m, nil } - var firstLine []string - blocks := make([]string, 0, 16) - for i, line := range lines { - fields := strings.Fields(line) - - if (len(fields) > 0 && !strings.HasSuffix(fields[0], ":")) || i == len(lines)-1 { + blocks := make([]string, 16) + for _, line := range lines { + field := strings.Split(line, " ") + if strings.HasSuffix(field[0], ":") == false { // new block section - if len(firstLine) > 0 && len(blocks) > 0 { - g, err := getBlock(firstLine, blocks) + if len(blocks) > 0 { + g, err := getBlock(field, blocks) if err != nil { return &ret, err } @@ -472,8 +634,7 @@ func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]M } } // starts new block - blocks = make([]string, 0, 16) - firstLine = fields + blocks = make([]string, 16) } else { blocks = append(blocks, line) } @@ -821,12 +982,8 @@ func (p *Process) fillFromStatusWithContext(ctx context.Context) error { } } } - // Ensure we have a copy and not reference into slice - p.name = string([]byte(p.name)) case "State": p.status = value[0:1] - // Ensure we have a copy and not reference into slice - p.status = string([]byte(p.status)) case "PPid", "Ppid": pval, err := strconv.ParseInt(value, 10, 32) if err != nil { @@ -857,16 +1014,6 @@ func (p *Process) fillFromStatusWithContext(ctx context.Context) error { } p.gids = append(p.gids, int32(v)) } - case "Groups": - groups := strings.Fields(value) - p.groups = make([]int32, 0, len(groups)) - for _, i := range groups { - v, err := strconv.ParseInt(i, 10, 32) - if err != nil { - return err - } - p.groups = append(p.groups, int32(v)) - } case "Threads": v, err := strconv.ParseInt(value, 10, 32) if err != nil { @@ -1015,7 +1162,7 @@ func (p *Process) fillFromTIDStatWithContext(ctx context.Context, tid int32) (ui // docs). Note: I am assuming at least Linux 2.6.18 iotime, err := strconv.ParseFloat(fields[i+40], 64) if err != nil { - iotime = 0 // Ancient linux version, most likely + iotime = 0 // Ancient linux version, most likely } cpuTimes := &cpu.TimesStat{ @@ -1083,6 +1230,12 @@ func pidsWithContext(ctx context.Context) ([]int32, error) { return readPidsFromDir(common.HostProc()) } +// Process returns a slice of pointers to Process structs for all +// currently running processes. +func Processes() ([]*Process, error) { + return ProcessesWithContext(context.Background()) +} + func ProcessesWithContext(ctx context.Context) ([]*Process, error) { out := []*Process{} @@ -1092,7 +1245,7 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { } for _, pid := range pids { - p, err := NewProcessWithContext(ctx, pid) + p, err := NewProcess(pid) if err != nil { continue } diff --git a/vendor/github.com/shirou/gopsutil/process/process_openbsd.go b/vendor/github.com/shirou/gopsutil/process/process_openbsd.go index 0404b4baec..1f3c645be0 100644 --- a/vendor/github.com/shirou/gopsutil/process/process_openbsd.go +++ b/vendor/github.com/shirou/gopsutil/process/process_openbsd.go @@ -4,7 +4,9 @@ package process import ( "C" + "bytes" "context" + "encoding/binary" "os/exec" "path/filepath" "strconv" @@ -18,9 +20,16 @@ import ( "golang.org/x/sys/unix" ) +// MemoryInfoExStat is different between OSes +type MemoryInfoExStat struct { +} + +type MemoryMapsStat struct { +} + func pidsWithContext(ctx context.Context) ([]int32, error) { var ret []int32 - procs, err := ProcessesWithContext(ctx) + procs, err := Processes() if err != nil { return ret, nil } @@ -32,6 +41,10 @@ func pidsWithContext(ctx context.Context) ([]int32, error) { return ret, nil } +func (p *Process) Ppid() (int32, error) { + return p.PpidWithContext(context.Background()) +} + func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { k, err := p.getKProc() if err != nil { @@ -40,6 +53,9 @@ func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { return k.Ppid, nil } +func (p *Process) Name() (string, error) { + return p.NameWithContext(context.Background()) +} func (p *Process) NameWithContext(ctx context.Context) (string, error) { k, err := p.getKProc() @@ -65,11 +81,21 @@ func (p *Process) NameWithContext(ctx context.Context) (string, error) { return name, nil } +func (p *Process) Tgid() (int32, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) Exe() (string, error) { + return p.ExeWithContext(context.Background()) +} func (p *Process) ExeWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } +func (p *Process) CmdlineSlice() ([]string, error) { + return p.CmdlineSliceWithContext(context.Background()) +} + func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) { mib := []int32{CTLKern, KernProcArgs, p.Pid, KernProcArgv} buf, _, err := common.CallSyscall(mib) @@ -93,8 +119,12 @@ func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) return strParts, nil } +func (p *Process) Cmdline() (string, error) { + return p.CmdlineWithContext(context.Background()) +} + func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) { - argv, err := p.CmdlineSliceWithContext(ctx) + argv, err := p.CmdlineSlice() if err != nil { return "", err } @@ -104,9 +134,22 @@ func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) { func (p *Process) createTimeWithContext(ctx context.Context) (int64, error) { return 0, common.ErrNotImplementedError } +func (p *Process) Cwd() (string, error) { + return p.CwdWithContext(context.Background()) +} + +func (p *Process) CwdWithContext(ctx context.Context) (string, error) { + return "", common.ErrNotImplementedError +} +func (p *Process) Parent() (*Process, error) { + return p.ParentWithContext(context.Background()) +} func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { - return nil, common.ErrNotImplementedError + return p, common.ErrNotImplementedError +} +func (p *Process) Status() (string, error) { + return p.StatusWithContext(context.Background()) } func (p *Process) StatusWithContext(ctx context.Context) (string, error) { @@ -130,6 +173,9 @@ func (p *Process) StatusWithContext(ctx context.Context) (string, error) { return s, nil } +func (p *Process) Foreground() (bool, error) { + return p.ForegroundWithContext(context.Background()) +} func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { // see https://github.com/shirou/gopsutil/issues/596#issuecomment-432707831 for implementation details @@ -144,6 +190,9 @@ func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { } return strings.IndexByte(string(out), '+') != -1, nil } +func (p *Process) Uids() ([]int32, error) { + return p.UidsWithContext(context.Background()) +} func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { k, err := p.getKProc() @@ -157,6 +206,9 @@ func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { return uids, nil } +func (p *Process) Gids() ([]int32, error) { + return p.GidsWithContext(context.Background()) +} func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { k, err := p.getKProc() @@ -169,19 +221,8 @@ func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { return gids, nil } - -func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { - k, err := p.getKProc() - if err != nil { - return nil, err - } - - groups := make([]int32, k.Ngroups) - for i := int16(0); i < k.Ngroups; i++ { - groups[i] = int32(k.Groups[i]) - } - - return groups, nil +func (p *Process) Terminal() (string, error) { + return p.TerminalWithContext(context.Background()) } func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { @@ -199,6 +240,9 @@ func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { return termmap[ttyNr], nil } +func (p *Process) Nice() (int32, error) { + return p.NiceWithContext(context.Background()) +} func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { k, err := p.getKProc() @@ -207,6 +251,32 @@ func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { } return int32(k.Nice), nil } +func (p *Process) IOnice() (int32, error) { + return p.IOniceWithContext(context.Background()) +} + +func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) Rlimit() ([]RlimitStat, error) { + return p.RlimitWithContext(context.Background()) +} + +func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) { + var rlimit []RlimitStat + return rlimit, common.ErrNotImplementedError +} +func (p *Process) RlimitUsage(gatherUsed bool) ([]RlimitStat, error) { + return p.RlimitUsageWithContext(context.Background(), gatherUsed) +} + +func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) { + var rlimit []RlimitStat + return rlimit, common.ErrNotImplementedError +} +func (p *Process) IOCounters() (*IOCountersStat, error) { + return p.IOCountersWithContext(context.Background()) +} func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, error) { k, err := p.getKProc() @@ -218,11 +288,39 @@ func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, e WriteCount: uint64(k.Uru_oublock), }, nil } +func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { + return p.NumCtxSwitchesWithContext(context.Background()) +} + +func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) NumFDs() (int32, error) { + return p.NumFDsWithContext(context.Background()) +} + +func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) { + return 0, common.ErrNotImplementedError +} +func (p *Process) NumThreads() (int32, error) { + return p.NumThreadsWithContext(context.Background()) +} func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { /* not supported, just return 1 */ return 1, nil } +func (p *Process) Threads() (map[int32]*cpu.TimesStat, error) { + return p.ThreadsWithContext(context.Background()) +} + +func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) { + ret := make(map[int32]*cpu.TimesStat) + return ret, common.ErrNotImplementedError +} +func (p *Process) Times() (*cpu.TimesStat, error) { + return p.TimesWithContext(context.Background()) +} func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) { k, err := p.getKProc() @@ -235,13 +333,23 @@ func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) System: float64(k.Ustime_sec) + float64(k.Ustime_usec)/1000000, }, nil } +func (p *Process) CPUAffinity() ([]int32, error) { + return p.CPUAffinityWithContext(context.Background()) +} + +func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) { + return nil, common.ErrNotImplementedError +} +func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { + return p.MemoryInfoWithContext(context.Background()) +} func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, error) { k, err := p.getKProc() if err != nil { return nil, err } - pageSize, err := mem.GetPageSizeWithContext(ctx) + pageSize, err := mem.GetPageSize() if err != nil { return nil, err } @@ -252,6 +360,25 @@ func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, e uint64(k.Vm_ssize), }, nil } +func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { + return p.MemoryInfoExWithContext(context.Background()) +} + +func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) PageFaults() (*PageFaultsStat, error) { + return p.PageFaultsWithContext(context.Background()) +} + +func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) Children() ([]*Process, error) { + return p.ChildrenWithContext(context.Background()) +} func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { pids, err := common.CallPgrepWithContext(ctx, invoke, p.Pid) @@ -260,7 +387,7 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { } ret := make([]*Process, 0, len(pids)) for _, pid := range pids { - np, err := NewProcessWithContext(ctx, pid) + np, err := NewProcess(pid) if err != nil { return nil, err } @@ -269,18 +396,55 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { return ret, nil } +func (p *Process) OpenFiles() ([]OpenFilesStat, error) { + return p.OpenFilesWithContext(context.Background()) +} + +func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) { + return nil, common.ErrNotImplementedError +} + +func (p *Process) Connections() ([]net.ConnectionStat, error) { + return p.ConnectionsWithContext(context.Background()) +} + func (p *Process) ConnectionsWithContext(ctx context.Context) ([]net.ConnectionStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) ConnectionsMax(max int) ([]net.ConnectionStat, error) { + return p.ConnectionsMaxWithContext(context.Background(), max) +} + func (p *Process) ConnectionsMaxWithContext(ctx context.Context, max int) ([]net.ConnectionStat, error) { + return []net.ConnectionStat{}, common.ErrNotImplementedError +} + +func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { + return p.NetIOCountersWithContext(context.Background(), pernic) +} + +func (p *Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { + return p.MemoryMapsWithContext(context.Background(), grouped) +} + +func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) { + var ret []MemoryMapsStat + return &ret, common.ErrNotImplementedError +} + +func Processes() ([]*Process, error) { + return ProcessesWithContext(context.Background()) +} + func ProcessesWithContext(ctx context.Context) ([]*Process, error) { results := []*Process{} - buf, length, err := callKernProcSyscall(KernProcAll, 0) + buf, length, err := CallKernProcSyscall(KernProcAll, 0) if err != nil { return results, err @@ -296,7 +460,7 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { if err != nil { continue } - p, err := NewProcessWithContext(ctx, int32(k.Pid)) + p, err := NewProcess(int32(k.Pid)) if err != nil { continue } @@ -307,8 +471,19 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { return results, nil } +func parseKinfoProc(buf []byte) (KinfoProc, error) { + var k KinfoProc + br := bytes.NewReader(buf) + err := common.Read(br, binary.LittleEndian, &k) + return k, err +} + func (p *Process) getKProc() (*KinfoProc, error) { - buf, length, err := callKernProcSyscall(KernProcPID, p.Pid) + return p.getKProcWithContext(context.Background()) +} + +func (p *Process) getKProcWithContext(ctx context.Context) (*KinfoProc, error) { + buf, length, err := CallKernProcSyscall(KernProcPID, p.Pid) if err != nil { return nil, err } @@ -323,7 +498,11 @@ func (p *Process) getKProc() (*KinfoProc, error) { return &k, nil } -func callKernProcSyscall(op int32, arg int32) ([]byte, uint64, error) { +func CallKernProcSyscall(op int32, arg int32) ([]byte, uint64, error) { + return CallKernProcSyscallWithContext(context.Background(), op, arg) +} + +func CallKernProcSyscallWithContext(ctx context.Context, op int32, arg int32) ([]byte, uint64, error) { mib := []int32{CTLKern, KernProc, op, arg, sizeOfKinfoProc, 0} mibptr := unsafe.Pointer(&mib[0]) miblen := uint64(len(mib)) diff --git a/vendor/github.com/shirou/gopsutil/process/process_openbsd_386.go b/vendor/github.com/shirou/gopsutil/process/process_openbsd_386.go deleted file mode 100644 index b89fb8dc29..0000000000 --- a/vendor/github.com/shirou/gopsutil/process/process_openbsd_386.go +++ /dev/null @@ -1,201 +0,0 @@ -// +build openbsd -// +build 386 -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs process/types_openbsd.go - -package process - -const ( - CTLKern = 1 - KernProc = 66 - KernProcAll = 0 - KernProcPID = 1 - KernProcProc = 8 - KernProcPathname = 12 - KernProcArgs = 55 - KernProcArgv = 1 - KernProcEnv = 3 -) - -const ( - ArgMax = 256 * 1024 -) - -const ( - sizeofPtr = 0x4 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x4 - sizeofLongLong = 0x8 -) - -const ( - sizeOfKinfoVmentry = 0x38 - sizeOfKinfoProc = 0x264 -) - -const ( - SIDL = 1 - SRUN = 2 - SSLEEP = 3 - SSTOP = 4 - SZOMB = 5 - SDEAD = 6 - SONPROC = 7 -) - -type ( - _C_short int16 - _C_int int32 - _C_long int32 - _C_long_long int64 -) - -type Timespec struct { - Sec int64 - Nsec int32 -} - -type Timeval struct { - Sec int64 - Usec int32 -} - -type Rusage struct { - Utime Timeval - Stime Timeval - Maxrss int32 - Ixrss int32 - Idrss int32 - Isrss int32 - Minflt int32 - Majflt int32 - Nswap int32 - Inblock int32 - Oublock int32 - Msgsnd int32 - Msgrcv int32 - Nsignals int32 - Nvcsw int32 - Nivcsw int32 -} - -type Rlimit struct { - Cur uint64 - Max uint64 -} - -type KinfoProc struct { - Forw uint64 - Back uint64 - Paddr uint64 - Addr uint64 - Fd uint64 - Stats uint64 - Limit uint64 - Vmspace uint64 - Sigacts uint64 - Sess uint64 - Tsess uint64 - Ru uint64 - Eflag int32 - Exitsig int32 - Flag int32 - Pid int32 - Ppid int32 - Sid int32 - X_pgid int32 - Tpgid int32 - Uid uint32 - Ruid uint32 - Gid uint32 - Rgid uint32 - Groups [16]uint32 - Ngroups int16 - Jobc int16 - Tdev uint32 - Estcpu uint32 - Rtime_sec uint32 - Rtime_usec uint32 - Cpticks int32 - Pctcpu uint32 - Swtime uint32 - Slptime uint32 - Schedflags int32 - Uticks uint64 - Sticks uint64 - Iticks uint64 - Tracep uint64 - Traceflag int32 - Holdcnt int32 - Siglist int32 - Sigmask uint32 - Sigignore uint32 - Sigcatch uint32 - Stat int8 - Priority uint8 - Usrpri uint8 - Nice uint8 - Xstat uint16 - Acflag uint16 - Comm [24]int8 - Wmesg [8]int8 - Wchan uint64 - Login [32]int8 - Vm_rssize int32 - Vm_tsize int32 - Vm_dsize int32 - Vm_ssize int32 - Uvalid int64 - Ustart_sec uint64 - Ustart_usec uint32 - Uutime_sec uint32 - Uutime_usec uint32 - Ustime_sec uint32 - Ustime_usec uint32 - Uru_maxrss uint64 - Uru_ixrss uint64 - Uru_idrss uint64 - Uru_isrss uint64 - Uru_minflt uint64 - Uru_majflt uint64 - Uru_nswap uint64 - Uru_inblock uint64 - Uru_oublock uint64 - Uru_msgsnd uint64 - Uru_msgrcv uint64 - Uru_nsignals uint64 - Uru_nvcsw uint64 - Uru_nivcsw uint64 - Uctime_sec uint32 - Uctime_usec uint32 - Psflags int32 - Spare int32 - Svuid uint32 - Svgid uint32 - Emul [8]int8 - Rlim_rss_cur uint64 - Cpuid uint64 - Vm_map_size uint64 - Tid int32 - Rtableid uint32 -} - -type Priority struct{} - -type KinfoVmentry struct { - Start uint32 - End uint32 - Guard uint32 - Fspace uint32 - Fspace_augment uint32 - Offset uint64 - Wired_count int32 - Etype int32 - Protection int32 - Max_protection int32 - Advice int32 - Inheritance int32 - Flags uint8 - Pad_cgo_0 [3]byte -} diff --git a/vendor/github.com/shirou/gopsutil/process/process_posix.go b/vendor/github.com/shirou/gopsutil/process/process_posix.go index 6f04129b13..109239a577 100644 --- a/vendor/github.com/shirou/gopsutil/process/process_posix.go +++ b/vendor/github.com/shirou/gopsutil/process/process_posix.go @@ -71,25 +71,6 @@ func getTerminalMap() (map[uint64]string, error) { return ret, nil } -// isMount is a port of python's os.path.ismount() -// https://github.com/python/cpython/blob/08ff4369afca84587b1c82034af4e9f64caddbf2/Lib/posixpath.py#L186-L216 -// https://docs.python.org/3/library/os.path.html#os.path.ismount -func isMount(path string) bool { - var stat1 unix.Stat_t - if err := unix.Lstat(path, &stat1); err != nil { - return false - } - if stat1.Mode == unix.DT_LNK { - return false - } - parent := filepath.Join(path, "..") - var stat2 unix.Stat_t - if err := unix.Lstat(parent, &stat2); err != nil { - return false - } - return stat1.Dev != stat2.Dev || stat1.Ino == stat2.Ino -} - func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) { if pid <= 0 { return false, fmt.Errorf("invalid pid %v", pid) @@ -98,7 +79,11 @@ func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) { if err != nil { return false, err } - if isMount(common.HostProc()) { // if //proc exists and is mounted, check if //proc/ folder exists + + if _, err := os.Stat(common.HostProc()); err == nil { //Means that proc filesystem exist + // Checking PID existence based on existence of //proc/ folder + // This covers the case when running inside container with a different process namespace (by default) + _, err := os.Stat(common.HostProc(strconv.Itoa(int(pid)))) if os.IsNotExist(err) { return false, nil @@ -106,7 +91,8 @@ func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) { return err == nil, err } - // procfs does not exist or is not mounted, check PID existence by signalling the pid + //'/proc' filesystem is not exist, checking of PID existence is done via signalling the process + //Make sense only if we run in the same process namespace err = proc.Signal(syscall.Signal(0)) if err == nil { return true, nil @@ -128,6 +114,12 @@ func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) { return false, err } +// SendSignal sends a unix.Signal to the process. +// Currently, SIGSTOP, SIGCONT, SIGTERM and SIGKILL are supported. +func (p *Process) SendSignal(sig syscall.Signal) error { + return p.SendSignalWithContext(context.Background(), sig) +} + func (p *Process) SendSignalWithContext(ctx context.Context, sig syscall.Signal) error { process, err := os.FindProcess(int(p.Pid)) if err != nil { @@ -142,24 +134,49 @@ func (p *Process) SendSignalWithContext(ctx context.Context, sig syscall.Signal) return nil } +// Suspend sends SIGSTOP to the process. +func (p *Process) Suspend() error { + return p.SuspendWithContext(context.Background()) +} + func (p *Process) SuspendWithContext(ctx context.Context) error { - return p.SendSignalWithContext(ctx, unix.SIGSTOP) + return p.SendSignal(unix.SIGSTOP) +} + +// Resume sends SIGCONT to the process. +func (p *Process) Resume() error { + return p.ResumeWithContext(context.Background()) } func (p *Process) ResumeWithContext(ctx context.Context) error { - return p.SendSignalWithContext(ctx, unix.SIGCONT) + return p.SendSignal(unix.SIGCONT) +} + +// Terminate sends SIGTERM to the process. +func (p *Process) Terminate() error { + return p.TerminateWithContext(context.Background()) } func (p *Process) TerminateWithContext(ctx context.Context) error { - return p.SendSignalWithContext(ctx, unix.SIGTERM) + return p.SendSignal(unix.SIGTERM) +} + +// Kill sends SIGKILL to the process. +func (p *Process) Kill() error { + return p.KillWithContext(context.Background()) } func (p *Process) KillWithContext(ctx context.Context) error { - return p.SendSignalWithContext(ctx, unix.SIGKILL) + return p.SendSignal(unix.SIGKILL) +} + +// Username returns a username of the process. +func (p *Process) Username() (string, error) { + return p.UsernameWithContext(context.Background()) } func (p *Process) UsernameWithContext(ctx context.Context) (string, error) { - uids, err := p.UidsWithContext(ctx) + uids, err := p.Uids() if err != nil { return "", err } diff --git a/vendor/github.com/shirou/gopsutil/process/process_windows.go b/vendor/github.com/shirou/gopsutil/process/process_windows.go index 5475f6ae91..cdce609fba 100644 --- a/vendor/github.com/shirou/gopsutil/process/process_windows.go +++ b/vendor/github.com/shirou/gopsutil/process/process_windows.go @@ -18,10 +18,6 @@ import ( ) var ( - modntdll = windows.NewLazySystemDLL("ntdll.dll") - procNtResumeProcess = modntdll.NewProc("NtResumeProcess") - procNtSuspendProcess = modntdll.NewProc("NtSuspendProcess") - modpsapi = windows.NewLazySystemDLL("psapi.dll") procGetProcessMemoryInfo = modpsapi.NewProc("GetProcessMemoryInfo") procGetProcessImageFileNameW = modpsapi.NewProc("GetProcessImageFileNameW") @@ -38,8 +34,6 @@ var ( processorArchitecture uint ) -const processQueryInformation = windows.PROCESS_QUERY_LIMITED_INFORMATION | windows.PROCESS_QUERY_INFORMATION // WinXP doesn't know PROCESS_QUERY_LIMITED_INFORMATION - type SystemProcessInformation struct { NextEntryOffset uint64 NumberOfThreads uint64 @@ -57,10 +51,10 @@ type SystemProcessInformation struct { type systemProcessorInformation struct { ProcessorArchitecture uint16 - ProcessorLevel uint16 - ProcessorRevision uint16 - Reserved uint16 - ProcessorFeatureBits uint16 + ProcessorLevel uint16 + ProcessorRevision uint16 + Reserved uint16 + ProcessorFeatureBits uint16 } type systemInfo struct { @@ -221,7 +215,7 @@ func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) { return false, err } const STILL_ACTIVE = 259 // https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getexitcodeprocess - h, err := windows.OpenProcess(processQueryInformation, false, uint32(pid)) + h, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(pid)) if err == windows.ERROR_ACCESS_DENIED { return true, nil } @@ -237,45 +231,40 @@ func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) { return exitCode == STILL_ACTIVE, err } -func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { - // if cached already, return from cache - cachedPpid := p.getPpid() - if cachedPpid != 0 { - return cachedPpid, nil - } +func (p *Process) Ppid() (int32, error) { + return p.PpidWithContext(context.Background()) +} +func (p *Process) PpidWithContext(ctx context.Context) (int32, error) { ppid, _, _, err := getFromSnapProcess(p.Pid) if err != nil { return 0, err } - - // no errors and not cached already, so cache it - p.setPpid(ppid) - return ppid, nil } +func (p *Process) Name() (string, error) { + return p.NameWithContext(context.Background()) +} + func (p *Process) NameWithContext(ctx context.Context) (string, error) { - ppid, _, name, err := getFromSnapProcess(p.Pid) + _, _, name, err := getFromSnapProcess(p.Pid) if err != nil { return "", fmt.Errorf("could not get Name: %s", err) } - - // if no errors and not cached already, cache ppid - p.parent = ppid - if 0 == p.getPpid() { - p.setPpid(ppid) - } - return name, nil } -func (p *Process) TgidWithContext(ctx context.Context) (int32, error) { +func (p *Process) Tgid() (int32, error) { return 0, common.ErrNotImplementedError } +func (p *Process) Exe() (string, error) { + return p.ExeWithContext(context.Background()) +} + func (p *Process) ExeWithContext(ctx context.Context) (string, error) { - c, err := windows.OpenProcess(processQueryInformation, false, uint32(p.Pid)) + c, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(p.Pid)) if err != nil { return "", err } @@ -301,6 +290,10 @@ func (p *Process) ExeWithContext(ctx context.Context) (string, error) { return common.ConvertDOSPath(windows.UTF16ToString(buf[:])), nil } +func (p *Process) Cmdline() (string, error) { + return p.CmdlineWithContext(context.Background()) +} + func (p *Process) CmdlineWithContext(_ context.Context) (string, error) { cmdline, err := getProcessCommandLine(p.Pid) if err != nil { @@ -309,6 +302,13 @@ func (p *Process) CmdlineWithContext(_ context.Context) (string, error) { return cmdline, nil } +// CmdlineSlice returns the command line arguments of the process as a slice with each +// element being an argument. This merely returns the CommandLine informations passed +// to the process split on the 0x20 ASCII character. +func (p *Process) CmdlineSlice() ([]string, error) { + return p.CmdlineSliceWithContext(context.Background()) +} + func (p *Process) CmdlineSliceWithContext(ctx context.Context) ([]string, error) { cmdline, err := p.CmdlineWithContext(ctx) if err != nil { @@ -326,9 +326,16 @@ func (p *Process) createTimeWithContext(ctx context.Context) (int64, error) { return ru.CreationTime.Nanoseconds() / 1000000, nil } +func (p *Process) Cwd() (string, error) { + return p.CwdWithContext(context.Background()) +} + func (p *Process) CwdWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } +func (p *Process) Parent() (*Process, error) { + return p.ParentWithContext(context.Background()) +} func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { ppid, err := p.PpidWithContext(ctx) @@ -336,20 +343,31 @@ func (p *Process) ParentWithContext(ctx context.Context) (*Process, error) { return nil, fmt.Errorf("could not get ParentProcessID: %s", err) } - return NewProcessWithContext(ctx, ppid) + return NewProcess(ppid) +} +func (p *Process) Status() (string, error) { + return p.StatusWithContext(context.Background()) } func (p *Process) StatusWithContext(ctx context.Context) (string, error) { return "", common.ErrNotImplementedError } +func (p *Process) Foreground() (bool, error) { + return p.ForegroundWithContext(context.Background()) +} + func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { return false, common.ErrNotImplementedError } +func (p *Process) Username() (string, error) { + return p.UsernameWithContext(context.Background()) +} + func (p *Process) UsernameWithContext(ctx context.Context) (string, error) { pid := p.Pid - c, err := windows.OpenProcess(processQueryInformation, false, uint32(pid)) + c, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(pid)) if err != nil { return "", err } @@ -370,16 +388,25 @@ func (p *Process) UsernameWithContext(ctx context.Context) (string, error) { return domain + "\\" + user, err } +func (p *Process) Uids() ([]int32, error) { + return p.UidsWithContext(context.Background()) +} + func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { - return nil, common.ErrNotImplementedError + var uids []int32 + + return uids, common.ErrNotImplementedError +} +func (p *Process) Gids() ([]int32, error) { + return p.GidsWithContext(context.Background()) } func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { - return nil, common.ErrNotImplementedError + var gids []int32 + return gids, common.ErrNotImplementedError } - -func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { - return nil, common.ErrNotImplementedError +func (p *Process) Terminal() (string, error) { + return p.TerminalWithContext(context.Background()) } func (p *Process) TerminalWithContext(ctx context.Context) (string, error) { @@ -398,8 +425,13 @@ var priorityClasses = map[int]int32{ 0x00000100: 24, // REALTIME_PRIORITY_CLASS } +// Nice returns priority in Windows +func (p *Process) Nice() (int32, error) { + return p.NiceWithContext(context.Background()) +} + func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { - c, err := windows.OpenProcess(processQueryInformation, false, uint32(p.Pid)) + c, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(p.Pid)) if err != nil { return 0, err } @@ -414,21 +446,38 @@ func (p *Process) NiceWithContext(ctx context.Context) (int32, error) { } return priority, nil } +func (p *Process) IOnice() (int32, error) { + return p.IOniceWithContext(context.Background()) +} func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } +func (p *Process) Rlimit() ([]RlimitStat, error) { + return p.RlimitWithContext(context.Background()) +} func (p *Process) RlimitWithContext(ctx context.Context) ([]RlimitStat, error) { - return nil, common.ErrNotImplementedError + var rlimit []RlimitStat + + return rlimit, common.ErrNotImplementedError +} +func (p *Process) RlimitUsage(gatherUsed bool) ([]RlimitStat, error) { + return p.RlimitUsageWithContext(context.Background(), gatherUsed) } func (p *Process) RlimitUsageWithContext(ctx context.Context, gatherUsed bool) ([]RlimitStat, error) { - return nil, common.ErrNotImplementedError + var rlimit []RlimitStat + + return rlimit, common.ErrNotImplementedError +} + +func (p *Process) IOCounters() (*IOCountersStat, error) { + return p.IOCountersWithContext(context.Background()) } func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, error) { - c, err := windows.OpenProcess(processQueryInformation, false, uint32(p.Pid)) + c, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(p.Pid)) if err != nil { return nil, err } @@ -447,32 +496,41 @@ func (p *Process) IOCountersWithContext(ctx context.Context) (*IOCountersStat, e return stats, nil } +func (p *Process) NumCtxSwitches() (*NumCtxSwitchesStat, error) { + return p.NumCtxSwitchesWithContext(context.Background()) +} func (p *Process) NumCtxSwitchesWithContext(ctx context.Context) (*NumCtxSwitchesStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) NumFDs() (int32, error) { + return p.NumFDsWithContext(context.Background()) +} func (p *Process) NumFDsWithContext(ctx context.Context) (int32, error) { return 0, common.ErrNotImplementedError } +func (p *Process) NumThreads() (int32, error) { + return p.NumThreadsWithContext(context.Background()) +} func (p *Process) NumThreadsWithContext(ctx context.Context) (int32, error) { - ppid, ret, _, err := getFromSnapProcess(p.Pid) + _, ret, _, err := getFromSnapProcess(p.Pid) if err != nil { return 0, err } - - // if no errors and not cached already, cache ppid - p.parent = ppid - if 0 == p.getPpid() { - p.setPpid(ppid) - } - return ret, nil } +func (p *Process) Threads() (map[int32]*cpu.TimesStat, error) { + return p.ThreadsWithContext(context.Background()) +} func (p *Process) ThreadsWithContext(ctx context.Context) (map[int32]*cpu.TimesStat, error) { - return nil, common.ErrNotImplementedError + ret := make(map[int32]*cpu.TimesStat) + return ret, common.ErrNotImplementedError +} +func (p *Process) Times() (*cpu.TimesStat, error) { + return p.TimesWithContext(context.Background()) } func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) { @@ -498,10 +556,16 @@ func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error) System: kernel, }, nil } +func (p *Process) CPUAffinity() ([]int32, error) { + return p.CPUAffinityWithContext(context.Background()) +} func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) { return nil, common.ErrNotImplementedError } +func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { + return p.MemoryInfoWithContext(context.Background()) +} func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, error) { mem, err := getMemoryInfo(p.Pid) @@ -516,15 +580,26 @@ func (p *Process) MemoryInfoWithContext(ctx context.Context) (*MemoryInfoStat, e return ret, nil } +func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { + return p.MemoryInfoExWithContext(context.Background()) +} func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) PageFaults() (*PageFaultsStat, error) { + return p.PageFaultsWithContext(context.Background()) +} + func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) Children() ([]*Process, error) { + return p.ChildrenWithContext(context.Background()) +} + func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { out := []*Process{} snap, err := windows.CreateToolhelp32Snapshot(windows.TH32CS_SNAPPROCESS, uint32(0)) @@ -539,7 +614,7 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { } for { if pe32.ParentProcessID == uint32(p.Pid) { - p, err := NewProcessWithContext(ctx, int32(pe32.ProcessID)) + p, err := NewProcess(int32(pe32.ProcessID)) if err == nil { out = append(out, p) } @@ -551,60 +626,72 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { return out, nil } +func (p *Process) OpenFiles() ([]OpenFilesStat, error) { + return p.OpenFilesWithContext(context.Background()) +} + func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) Connections() ([]net.ConnectionStat, error) { + return p.ConnectionsWithContext(context.Background()) +} + func (p *Process) ConnectionsWithContext(ctx context.Context) ([]net.ConnectionStat, error) { return net.ConnectionsPidWithContext(ctx, "all", p.Pid) } +func (p *Process) ConnectionsMax(max int) ([]net.ConnectionStat, error) { + return p.ConnectionsMaxWithContext(context.Background(), max) +} + func (p *Process) ConnectionsMaxWithContext(ctx context.Context, max int) ([]net.ConnectionStat, error) { - return nil, common.ErrNotImplementedError + return []net.ConnectionStat{}, common.ErrNotImplementedError +} + +func (p *Process) NetIOCounters(pernic bool) ([]net.IOCountersStat, error) { + return p.NetIOCountersWithContext(context.Background(), pernic) } func (p *Process) NetIOCountersWithContext(ctx context.Context, pernic bool) ([]net.IOCountersStat, error) { return nil, common.ErrNotImplementedError } +func (p *Process) MemoryMaps(grouped bool) (*[]MemoryMapsStat, error) { + return p.MemoryMapsWithContext(context.Background(), grouped) +} + func (p *Process) MemoryMapsWithContext(ctx context.Context, grouped bool) (*[]MemoryMapsStat, error) { - return nil, common.ErrNotImplementedError + var ret []MemoryMapsStat + return &ret, common.ErrNotImplementedError } -func (p *Process) SendSignalWithContext(ctx context.Context, sig syscall.Signal) error { - return common.ErrNotImplementedError +func (p *Process) SendSignal(sig windows.Signal) error { + return p.SendSignalWithContext(context.Background(), sig) } -func (p *Process) SuspendWithContext(ctx context.Context) error { - c, err := windows.OpenProcess(windows.PROCESS_SUSPEND_RESUME, false, uint32(p.Pid)) - if err != nil { - return err - } - defer windows.CloseHandle(c) +func (p *Process) SendSignalWithContext(ctx context.Context, sig windows.Signal) error { + return common.ErrNotImplementedError +} - r1, _, _ := procNtSuspendProcess.Call(uintptr(c)) - if r1 != 0 { - // See https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55 - return fmt.Errorf("NtStatus='0x%.8X'", r1) - } +func (p *Process) Suspend() error { + return p.SuspendWithContext(context.Background()) +} - return nil +func (p *Process) SuspendWithContext(ctx context.Context) error { + return common.ErrNotImplementedError +} +func (p *Process) Resume() error { + return p.ResumeWithContext(context.Background()) } func (p *Process) ResumeWithContext(ctx context.Context) error { - c, err := windows.OpenProcess(windows.PROCESS_SUSPEND_RESUME, false, uint32(p.Pid)) - if err != nil { - return err - } - defer windows.CloseHandle(c) - - r1, _, _ := procNtResumeProcess.Call(uintptr(c)) - if r1 != 0 { - // See https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55 - return fmt.Errorf("NtStatus='0x%.8X'", r1) - } + return common.ErrNotImplementedError +} - return nil +func (p *Process) Terminate() error { + return p.TerminateWithContext(context.Background()) } func (p *Process) TerminateWithContext(ctx context.Context) error { @@ -617,26 +704,15 @@ func (p *Process) TerminateWithContext(ctx context.Context) error { return err } +func (p *Process) Kill() error { + return p.KillWithContext(context.Background()) +} + func (p *Process) KillWithContext(ctx context.Context) error { process := os.Process{Pid: int(p.Pid)} return process.Kill() } -// retrieve Ppid in a thread-safe manner -func (p *Process) getPpid() int32 { - p.parentMutex.RLock() - defer p.parentMutex.RUnlock() - return p.parent -} - -// cache Ppid in a thread-safe manner (WINDOWS ONLY) -// see https://psutil.readthedocs.io/en/latest/#psutil.Process.ppid -func (p *Process) setPpid(ppid int32) { - p.parentMutex.Lock() - defer p.parentMutex.Unlock() - p.parent = ppid -} - func getFromSnapProcess(pid int32) (int32, int32, string, error) { snap, err := windows.CreateToolhelp32Snapshot(windows.TH32CS_SNAPPROCESS, uint32(pid)) if err != nil { @@ -660,6 +736,11 @@ func getFromSnapProcess(pid int32) (int32, int32, string, error) { return 0, 0, "", fmt.Errorf("couldn't find pid: %d", pid) } +// Get processes +func Processes() ([]*Process, error) { + return ProcessesWithContext(context.Background()) +} + func ProcessesWithContext(ctx context.Context) ([]*Process, error) { out := []*Process{} @@ -669,7 +750,7 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { } for _, pid := range pids { - p, err := NewProcessWithContext(ctx, pid) + p, err := NewProcess(pid) if err != nil { continue } @@ -682,7 +763,7 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { func getRusage(pid int32) (*windows.Rusage, error) { var CPU windows.Rusage - c, err := windows.OpenProcess(processQueryInformation, false, uint32(pid)) + c, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(pid)) if err != nil { return nil, err } @@ -697,7 +778,7 @@ func getRusage(pid int32) (*windows.Rusage, error) { func getMemoryInfo(pid int32) (PROCESS_MEMORY_COUNTERS, error) { var mem PROCESS_MEMORY_COUNTERS - c, err := windows.OpenProcess(processQueryInformation, false, uint32(pid)) + c, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(pid)) if err != nil { return mem, err } @@ -731,7 +812,7 @@ type SYSTEM_TIMES struct { func getProcessCPUTimes(pid int32) (SYSTEM_TIMES, error) { var times SYSTEM_TIMES - h, err := windows.OpenProcess(processQueryInformation, false, uint32(pid)) + h, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION, false, uint32(pid)) if err != nil { return times, err } @@ -772,7 +853,7 @@ func is32BitProcess(procHandle syscall.Handle) bool { } func getProcessCommandLine(pid int32) (string, error) { - h, err := windows.OpenProcess(processQueryInformation|windows.PROCESS_VM_READ, false, uint32(pid)) + h, err := windows.OpenProcess(windows.PROCESS_QUERY_LIMITED_INFORMATION | windows.PROCESS_VM_READ, false, uint32(pid)) if err == windows.ERROR_ACCESS_DENIED || err == windows.ERROR_INVALID_PARAMETER { return "", nil } @@ -816,14 +897,14 @@ func getProcessCommandLine(pid int32) (string, error) { } if procIs32Bits { - buf := readProcessMemory(syscall.Handle(h), procIs32Bits, pebAddress+uint64(16), 4) + buf := readProcessMemory(syscall.Handle(h), procIs32Bits, pebAddress + uint64(16), 4) if len(buf) != 4 { return "", errors.New("cannot locate process user parameters") } userProcParams := uint64(buf[0]) | (uint64(buf[1]) << 8) | (uint64(buf[2]) << 16) | (uint64(buf[3]) << 24) //read CommandLine field from PRTL_USER_PROCESS_PARAMETERS - remoteCmdLine := readProcessMemory(syscall.Handle(h), procIs32Bits, userProcParams+uint64(64), 8) + remoteCmdLine := readProcessMemory(syscall.Handle(h), procIs32Bits, userProcParams + uint64(64), 8) if len(remoteCmdLine) != 8 { return "", errors.New("cannot read cmdline field") } @@ -844,15 +925,15 @@ func getProcessCommandLine(pid int32) (string, error) { return convertUTF16ToString(cmdLine), nil } } else { - buf := readProcessMemory(syscall.Handle(h), procIs32Bits, pebAddress+uint64(32), 8) + buf := readProcessMemory(syscall.Handle(h), procIs32Bits, pebAddress + uint64(32), 8) if len(buf) != 8 { return "", errors.New("cannot locate process user parameters") } - userProcParams := uint64(buf[0]) | (uint64(buf[1]) << 8) | (uint64(buf[2]) << 16) | (uint64(buf[3]) << 24) | + userProcParams := uint64(buf[0]) | (uint64(buf[1]) << 8) | (uint64(buf[2]) << 16) | (uint64(buf[3]) << 24) | (uint64(buf[4]) << 32) | (uint64(buf[5]) << 40) | (uint64(buf[6]) << 48) | (uint64(buf[7]) << 56) //read CommandLine field from PRTL_USER_PROCESS_PARAMETERS - remoteCmdLine := readProcessMemory(syscall.Handle(h), procIs32Bits, userProcParams+uint64(112), 16) + remoteCmdLine := readProcessMemory(syscall.Handle(h), procIs32Bits, userProcParams + uint64(112), 16) if len(remoteCmdLine) != 16 { return "", errors.New("cannot read cmdline field") } @@ -887,7 +968,7 @@ func convertUTF16ToString(src []byte) string { srcIdx := 0 for i := 0; i < srcLen; i++ { - codePoints[i] = uint16(src[srcIdx]) | uint16(src[srcIdx+1])<<8 + codePoints[i] = uint16(src[srcIdx]) | uint16(src[srcIdx + 1] << 8) srcIdx += 2 } return syscall.UTF16ToString(codePoints) diff --git a/vendor/github.com/sirupsen/logrus/.travis.yml b/vendor/github.com/sirupsen/logrus/.travis.yml index c1dbd5a3a3..5e20aa4140 100644 --- a/vendor/github.com/sirupsen/logrus/.travis.yml +++ b/vendor/github.com/sirupsen/logrus/.travis.yml @@ -4,12 +4,14 @@ git: depth: 1 env: - GO111MODULE=on -go: 1.15.x -os: linux +go: [1.13.x, 1.14.x] +os: [linux, osx] install: - ./travis/install.sh script: - - cd ci - - go run mage.go -v -w ../ crossBuild - - go run mage.go -v -w ../ lint - - go run mage.go -v -w ../ test + - ./travis/cross_build.sh + - ./travis/lint.sh + - export GOMAXPROCS=4 + - export GORACE=halt_on_error=1 + - go test -race -v ./... + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then go test -race -v -tags appengine ./... ; fi diff --git a/vendor/github.com/sirupsen/logrus/CHANGELOG.md b/vendor/github.com/sirupsen/logrus/CHANGELOG.md index 7567f61289..584026d67c 100644 --- a/vendor/github.com/sirupsen/logrus/CHANGELOG.md +++ b/vendor/github.com/sirupsen/logrus/CHANGELOG.md @@ -1,39 +1,3 @@ -# 1.8.1 -Code quality: - * move magefile in its own subdir/submodule to remove magefile dependency on logrus consumer - * improve timestamp format documentation - -Fixes: - * fix race condition on logger hooks - - -# 1.8.0 - -Correct versioning number replacing v1.7.1. - -# 1.7.1 - -Beware this release has introduced a new public API and its semver is therefore incorrect. - -Code quality: - * use go 1.15 in travis - * use magefile as task runner - -Fixes: - * small fixes about new go 1.13 error formatting system - * Fix for long time race condiction with mutating data hooks - -Features: - * build support for zos - -# 1.7.0 -Fixes: - * the dependency toward a windows terminal library has been removed - -Features: - * a new buffer pool management API has been added - * a set of `Fn()` functions have been added - # 1.6.0 Fixes: * end of line cleanup diff --git a/vendor/github.com/sirupsen/logrus/README.md b/vendor/github.com/sirupsen/logrus/README.md index 5152b6aa40..5796706dbf 100644 --- a/vendor/github.com/sirupsen/logrus/README.md +++ b/vendor/github.com/sirupsen/logrus/README.md @@ -402,7 +402,7 @@ func (f *MyJSONFormatter) Format(entry *Entry) ([]byte, error) { // source of the official loggers. serialized, err := json.Marshal(entry.Data) if err != nil { - return nil, fmt.Errorf("Failed to marshal fields to JSON, %w", err) + return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) } return append(serialized, '\n'), nil } diff --git a/vendor/github.com/sirupsen/logrus/entry.go b/vendor/github.com/sirupsen/logrus/entry.go index 07a1e5fa72..5a5cbfe7c8 100644 --- a/vendor/github.com/sirupsen/logrus/entry.go +++ b/vendor/github.com/sirupsen/logrus/entry.go @@ -78,14 +78,6 @@ func NewEntry(logger *Logger) *Entry { } } -func (entry *Entry) Dup() *Entry { - data := make(Fields, len(entry.Data)) - for k, v := range entry.Data { - data[k] = v - } - return &Entry{Logger: entry.Logger, Data: data, Time: entry.Time, Context: entry.Context, err: entry.err} -} - // Returns the bytes representation of this entry from the formatter. func (entry *Entry) Bytes() ([]byte, error) { return entry.Logger.Formatter.Format(entry) @@ -131,9 +123,11 @@ func (entry *Entry) WithFields(fields Fields) *Entry { for k, v := range fields { isErrField := false if t := reflect.TypeOf(v); t != nil { - switch { - case t.Kind() == reflect.Func, t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Func: + switch t.Kind() { + case reflect.Func: isErrField = true + case reflect.Ptr: + isErrField = t.Elem().Kind() == reflect.Func } } if isErrField { @@ -218,72 +212,68 @@ func (entry Entry) HasCaller() (has bool) { entry.Caller != nil } -func (entry *Entry) log(level Level, msg string) { +// This function is not declared with a pointer value because otherwise +// race conditions will occur when using multiple goroutines +func (entry Entry) log(level Level, msg string) { var buffer *bytes.Buffer - newEntry := entry.Dup() - - if newEntry.Time.IsZero() { - newEntry.Time = time.Now() + // Default to now, but allow users to override if they want. + // + // We don't have to worry about polluting future calls to Entry#log() + // with this assignment because this function is declared with a + // non-pointer receiver. + if entry.Time.IsZero() { + entry.Time = time.Now() } - newEntry.Level = level - newEntry.Message = msg - - newEntry.Logger.mu.Lock() - reportCaller := newEntry.Logger.ReportCaller - newEntry.Logger.mu.Unlock() - - if reportCaller { - newEntry.Caller = getCaller() + entry.Level = level + entry.Message = msg + entry.Logger.mu.Lock() + if entry.Logger.ReportCaller { + entry.Caller = getCaller() } + entry.Logger.mu.Unlock() - newEntry.fireHooks() + entry.fireHooks() buffer = getBuffer() defer func() { - newEntry.Buffer = nil + entry.Buffer = nil putBuffer(buffer) }() buffer.Reset() - newEntry.Buffer = buffer + entry.Buffer = buffer - newEntry.write() + entry.write() - newEntry.Buffer = nil + entry.Buffer = nil // To avoid Entry#log() returning a value that only would make sense for // panic() to use in Entry#Panic(), we avoid the allocation by checking // directly here. if level <= PanicLevel { - panic(newEntry) + panic(&entry) } } func (entry *Entry) fireHooks() { - var tmpHooks LevelHooks entry.Logger.mu.Lock() - tmpHooks = make(LevelHooks, len(entry.Logger.Hooks)) - for k, v := range entry.Logger.Hooks { - tmpHooks[k] = v - } - entry.Logger.mu.Unlock() - - err := tmpHooks.Fire(entry.Level, entry) + defer entry.Logger.mu.Unlock() + err := entry.Logger.Hooks.Fire(entry.Level, entry) if err != nil { fmt.Fprintf(os.Stderr, "Failed to fire hook: %v\n", err) } } func (entry *Entry) write() { + entry.Logger.mu.Lock() + defer entry.Logger.mu.Unlock() serialized, err := entry.Logger.Formatter.Format(entry) if err != nil { fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err) return } - entry.Logger.mu.Lock() - defer entry.Logger.mu.Unlock() - if _, err := entry.Logger.Out.Write(serialized); err != nil { + if _, err = entry.Logger.Out.Write(serialized); err != nil { fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err) } } @@ -329,6 +319,7 @@ func (entry *Entry) Fatal(args ...interface{}) { func (entry *Entry) Panic(args ...interface{}) { entry.Log(PanicLevel, args...) + panic(fmt.Sprint(args...)) } // Entry Printf family functions diff --git a/vendor/github.com/sirupsen/logrus/go.sum b/vendor/github.com/sirupsen/logrus/go.sum index 694c18b845..1edc143bed 100644 --- a/vendor/github.com/sirupsen/logrus/go.sum +++ b/vendor/github.com/sirupsen/logrus/go.sum @@ -4,5 +4,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/sirupsen/logrus/json_formatter.go b/vendor/github.com/sirupsen/logrus/json_formatter.go index c96dc5636b..ba7f237112 100644 --- a/vendor/github.com/sirupsen/logrus/json_formatter.go +++ b/vendor/github.com/sirupsen/logrus/json_formatter.go @@ -23,9 +23,6 @@ func (f FieldMap) resolve(key fieldKey) string { // JSONFormatter formats logs into parsable json type JSONFormatter struct { // TimestampFormat sets the format used for marshaling timestamps. - // The format to use is the same than for time.Format or time.Parse from the standard - // library. - // The standard Library already provides a set of predefined format. TimestampFormat string // DisableTimestamp allows disabling automatic timestamps in output @@ -121,7 +118,7 @@ func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { encoder.SetIndent("", " ") } if err := encoder.Encode(data); err != nil { - return nil, fmt.Errorf("failed to marshal fields to JSON, %w", err) + return nil, fmt.Errorf("failed to marshal fields to JSON, %v", err) } return b.Bytes(), nil diff --git a/vendor/github.com/sirupsen/logrus/logger.go b/vendor/github.com/sirupsen/logrus/logger.go index 337704457a..dbf627c975 100644 --- a/vendor/github.com/sirupsen/logrus/logger.go +++ b/vendor/github.com/sirupsen/logrus/logger.go @@ -12,7 +12,7 @@ import ( // LogFunction For big messages, it can be more efficient to pass a function // and only call it if the log level is actually enables rather than // generating the log message and then checking if the level is enabled -type LogFunction func() []interface{} +type LogFunction func()[]interface{} type Logger struct { // The logs are `io.Copy`'d to this in a mutex. It's common to set this to a diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_unix.go b/vendor/github.com/sirupsen/logrus/terminal_check_unix.go index 04748b8515..cc4fe6e317 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_unix.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_unix.go @@ -1,4 +1,4 @@ -// +build linux aix zos +// +build linux aix // +build !js package logrus diff --git a/vendor/github.com/sirupsen/logrus/text_formatter.go b/vendor/github.com/sirupsen/logrus/text_formatter.go index be2c6efe5e..3c28b54cab 100644 --- a/vendor/github.com/sirupsen/logrus/text_formatter.go +++ b/vendor/github.com/sirupsen/logrus/text_formatter.go @@ -53,10 +53,7 @@ type TextFormatter struct { // the time passed since beginning of execution. FullTimestamp bool - // TimestampFormat to use for display when a full timestamp is printed. - // The format to use is the same than for time.Format or time.Parse from the standard - // library. - // The standard Library already provides a set of predefined format. + // TimestampFormat to use for display when a full timestamp is printed TimestampFormat string // The fields are sorted by default for a consistent output. For applications @@ -238,8 +235,6 @@ func (f *TextFormatter) printColored(b *bytes.Buffer, entry *Entry, keys []strin levelColor = yellow case ErrorLevel, FatalLevel, PanicLevel: levelColor = red - case InfoLevel: - levelColor = blue default: levelColor = blue } diff --git a/vendor/github.com/skycoin/dmsg/go.mod b/vendor/github.com/skycoin/dmsg/go.mod index 6cd89cfded..a42bfca045 100644 --- a/vendor/github.com/skycoin/dmsg/go.mod +++ b/vendor/github.com/skycoin/dmsg/go.mod @@ -17,7 +17,6 @@ require ( github.com/modern-go/reflect2 v1.0.1 // indirect github.com/onsi/ginkgo v1.12.0 // indirect github.com/onsi/gomega v1.9.0 // indirect - github.com/pires/go-proxyproto v0.3.3 github.com/sirupsen/logrus v1.4.2 github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6 github.com/skycoin/skycoin v0.26.0 @@ -28,10 +27,8 @@ require ( github.com/spf13/viper v1.6.2 github.com/stretchr/testify v1.4.0 golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 - golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 + golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect - golang.org/x/text v0.3.2 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect - gopkg.in/ini.v1 v1.51.1 // indirect nhooyr.io/websocket v1.8.2 ) diff --git a/vendor/github.com/skycoin/dmsg/go.sum b/vendor/github.com/skycoin/dmsg/go.sum index 4e54f56765..9f8f44fc33 100644 --- a/vendor/github.com/skycoin/dmsg/go.sum +++ b/vendor/github.com/skycoin/dmsg/go.sum @@ -9,6 +9,7 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -99,6 +100,7 @@ github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+v github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= @@ -121,8 +123,6 @@ github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pires/go-proxyproto v0.3.3 h1:jOXGrsAfSQVFiD1hWg1aiHpLYsd6SJw/8cLN594sB7Q= -github.com/pires/go-proxyproto v0.3.3/go.mod h1:Odh9VFOZJCf9G8cLW5o435Xf1J95Jw9Gw5rnCjcwzAY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -200,9 +200,8 @@ golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a h1:+HHJiFUXVOIS9mr1ThqkQD1N8vpFCfCShqADBM12KTc= golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -221,14 +220,12 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -246,9 +243,8 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogR gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.51.1 h1:GyboHr4UqMiLUybYjd22ZjQIKEJEpgtLXtuGbR21Oho= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= diff --git a/vendor/github.com/skycoin/dmsg/httputil/httputil.go b/vendor/github.com/skycoin/dmsg/httputil/httputil.go index b4b095f38f..1ef7bc76a5 100644 --- a/vendor/github.com/skycoin/dmsg/httputil/httputil.go +++ b/vendor/github.com/skycoin/dmsg/httputil/httputil.go @@ -84,9 +84,6 @@ func GetLogger(r *http.Request) logrus.FieldLogger { return logging.NewMasterLogger() } -// todo: investigate if it's used throughout the services (didn't work properly for UT) -// remove and use structured logging - // SetLoggerMiddleware sets logger to context of HTTP requests. func SetLoggerMiddleware(log logrus.FieldLogger) func(next http.Handler) http.Handler { return func(next http.Handler) http.Handler { diff --git a/vendor/github.com/skycoin/dmsg/httputil/log.go b/vendor/github.com/skycoin/dmsg/httputil/log.go deleted file mode 100644 index ec6778414f..0000000000 --- a/vendor/github.com/skycoin/dmsg/httputil/log.go +++ /dev/null @@ -1,56 +0,0 @@ -package httputil - -import ( - "context" - "net/http" - "time" - - "github.com/go-chi/chi/middleware" - "github.com/sirupsen/logrus" -) - -type structuredLogger struct { - logger logrus.FieldLogger -} - -// NewLogMiddleware creates a new instance of logging middleware. This will allow -// adding log fields in the handler and any further middleware. At the end of request, this -// log entry will be printed at Info level via passed logger -func NewLogMiddleware(logger logrus.FieldLogger) func(http.Handler) http.Handler { - return func(next http.Handler) http.Handler { - fn := func(w http.ResponseWriter, r *http.Request) { - sl := &structuredLogger{logger} - start := time.Now() - var requestID string - if reqID := r.Context().Value(middleware.RequestIDKey); reqID != nil { - requestID = reqID.(string) - } - ww := middleware.NewWrapResponseWriter(w, r.ProtoMajor) - newContext := context.WithValue(r.Context(), middleware.LogEntryCtxKey, sl) - next.ServeHTTP(ww, r.WithContext(newContext)) - latency := time.Since(start) - fields := logrus.Fields{ - "status": ww.Status(), - "took": latency, - "remote": r.RemoteAddr, - "request": r.RequestURI, - "method": r.Method, - } - if requestID != "" { - fields["request_id"] = requestID - } - sl.logger.WithFields(fields).Info() - - } - return http.HandlerFunc(fn) - } -} - -// LogEntrySetField adds new key-value pair to current (request scoped) log entry. This pair will be -// printed along with all other pairs when the request is served. -// This requires log middleware from this package to be installed in the chain -func LogEntrySetField(r *http.Request, key string, value interface{}) { - if sl, ok := r.Context().Value(middleware.LogEntryCtxKey).(*structuredLogger); ok { - sl.logger = sl.logger.WithField(key, value) - } -} diff --git a/vendor/github.com/skycoin/dmsg/metricsutil/victoria_metrics_int_gauge_wrapper.go b/vendor/github.com/skycoin/dmsg/metricsutil/victoria_metrics_int_gauge_wrapper.go index 326d54f62f..14bff1b101 100644 --- a/vendor/github.com/skycoin/dmsg/metricsutil/victoria_metrics_int_gauge_wrapper.go +++ b/vendor/github.com/skycoin/dmsg/metricsutil/victoria_metrics_int_gauge_wrapper.go @@ -34,11 +34,6 @@ func (w *VictoriaMetricsIntGaugeWrapper) Dec() { atomic.AddInt64(&w.val, -1) } -// Set sets gauge value. -func (w *VictoriaMetricsIntGaugeWrapper) Set(val int64) { - atomic.StoreInt64(&w.val, val) -} - // Val gets gauge value. func (w *VictoriaMetricsIntGaugeWrapper) Val() int64 { return atomic.LoadInt64(&w.val) diff --git a/vendor/github.com/skycoin/dmsg/metricsutil/victoria_metrics_uint_gauge_wrapper.go b/vendor/github.com/skycoin/dmsg/metricsutil/victoria_metrics_uint_gauge_wrapper.go index bf5e20b459..1a386255c2 100644 --- a/vendor/github.com/skycoin/dmsg/metricsutil/victoria_metrics_uint_gauge_wrapper.go +++ b/vendor/github.com/skycoin/dmsg/metricsutil/victoria_metrics_uint_gauge_wrapper.go @@ -34,11 +34,6 @@ func (w *VictoriaMetricsUintGaugeWrapper) Dec() { atomic.AddUint64(&w.val, ^uint64(0)) } -// Set sets gauge value. -func (w *VictoriaMetricsUintGaugeWrapper) Set(val uint64) { - atomic.StoreUint64(&w.val, val) -} - // Val gets gauge value. func (w *VictoriaMetricsUintGaugeWrapper) Val() uint64 { return atomic.LoadUint64(&w.val) diff --git a/vendor/github.com/skycoin/dmsg/noise/read_writer.go b/vendor/github.com/skycoin/dmsg/noise/read_writer.go index c22bacc043..b5f97eec8b 100644 --- a/vendor/github.com/skycoin/dmsg/noise/read_writer.go +++ b/vendor/github.com/skycoin/dmsg/noise/read_writer.go @@ -42,7 +42,6 @@ type netError struct { func (e *netError) Error() string { return e.err.Error() } func (e *netError) Timeout() bool { return e.timeout } func (e *netError) Temporary() bool { return e.temp } -func (e *netError) Unwrap() error { return e.err } // ReadWriter implements noise encrypted read writer. type ReadWriter struct { diff --git a/vendor/github.com/skycoin/dmsg/server.go b/vendor/github.com/skycoin/dmsg/server.go index 7ecc88f84f..b6e1551282 100644 --- a/vendor/github.com/skycoin/dmsg/server.go +++ b/vendor/github.com/skycoin/dmsg/server.go @@ -80,13 +80,7 @@ func NewServer(pk cipher.PubKey, sk cipher.SecKey, dc disc.APIClient, conf *Serv func (s *Server) GetSessions() map[cipher.PubKey]*SessionCommon { s.sessionsMx.Lock() defer s.sessionsMx.Unlock() - - sessions := make(map[cipher.PubKey]*SessionCommon, len(s.sessions)) - for pk, session := range s.sessions { - sessions[pk] = session - } - - return sessions + return s.sessions } // Close implements io.Closer @@ -149,7 +143,7 @@ func (s *Server) Serve(lis net.Listener, addr string) error { s.wg.Add(1) go func(conn net.Conn) { - defer func() { + func() { err := recover() if err != nil { log.Warnf("panic in handleSession: %+v", err) diff --git a/vendor/github.com/skycoin/dmsg/servermetrics/empty.go b/vendor/github.com/skycoin/dmsg/servermetrics/empty.go index e08d3ab192..ff71516bbd 100644 --- a/vendor/github.com/skycoin/dmsg/servermetrics/empty.go +++ b/vendor/github.com/skycoin/dmsg/servermetrics/empty.go @@ -1,5 +1,9 @@ package servermetrics +import ( + "net/http" +) + // NewEmpty constructs new empty metrics. func NewEmpty() Empty { return Empty{} @@ -14,11 +18,5 @@ func (Empty) RecordSession(_ DeltaType) {} // RecordStream implements `Metrics`. func (Empty) RecordStream(_ DeltaType) {} -// SetPacketsPerMinute implements `Metrics`. -func (Empty) SetPacketsPerMinute(_ uint64) {} - -// SetPacketsPerSecond implements `Metrics`. -func (Empty) SetPacketsPerSecond(_ uint64) {} - -// SetClientsCount implements `Metrics`. -func (Empty) SetClientsCount(_ int64) {} +// HandleDisc implements `Metrics`. +func (Empty) HandleDisc(next http.Handler) http.HandlerFunc { return next.ServeHTTP } diff --git a/vendor/github.com/skycoin/dmsg/servermetrics/metrics.go b/vendor/github.com/skycoin/dmsg/servermetrics/metrics.go deleted file mode 100644 index 42f1984a2e..0000000000 --- a/vendor/github.com/skycoin/dmsg/servermetrics/metrics.go +++ /dev/null @@ -1,10 +0,0 @@ -package servermetrics - -// Metrics collects metrics for metrics tracking system. -type Metrics interface { - RecordSession(delta DeltaType) - RecordStream(delta DeltaType) - SetClientsCount(val int64) - SetPacketsPerSecond(val uint64) - SetPacketsPerMinute(val uint64) -} diff --git a/vendor/github.com/skycoin/dmsg/servermetrics/victoria_metrics.go b/vendor/github.com/skycoin/dmsg/servermetrics/victoria_metrics.go index cec89b4be8..ac3741fea4 100644 --- a/vendor/github.com/skycoin/dmsg/servermetrics/victoria_metrics.go +++ b/vendor/github.com/skycoin/dmsg/servermetrics/victoria_metrics.go @@ -8,11 +8,14 @@ import ( "github.com/skycoin/dmsg/metricsutil" ) +// Metrics collects metrics for metrics tracking system. +type Metrics interface { + RecordSession(delta DeltaType) + RecordStream(delta DeltaType) +} + // VictoriaMetrics implements `Metrics` using `VictoriaMetrics`. type VictoriaMetrics struct { - packetsPerMinute *metricsutil.VictoriaMetricsUintGaugeWrapper - packetsPerSecond *metricsutil.VictoriaMetricsUintGaugeWrapper - clientsCount *metricsutil.VictoriaMetricsIntGaugeWrapper activeSessions *metricsutil.VictoriaMetricsIntGaugeWrapper successfulSessions *metrics.Counter failedSessions *metrics.Counter @@ -24,9 +27,6 @@ type VictoriaMetrics struct { // NewVictoriaMetrics returns the Victoria Metrics implementation of Metrics. func NewVictoriaMetrics() *VictoriaMetrics { return &VictoriaMetrics{ - packetsPerMinute: metricsutil.NewVictoriaMetricsUintGauge("packets_per_minute"), - packetsPerSecond: metricsutil.NewVictoriaMetricsUintGauge("packets_per_second"), - clientsCount: metricsutil.NewVictoriaMetricsIntGauge("clients_count"), activeSessions: metricsutil.NewVictoriaMetricsIntGauge("vm_active_sessions_count"), successfulSessions: metrics.GetOrCreateCounter("vm_session_success_total"), failedSessions: metrics.GetOrCreateCounter("vm_session_fail_total"), @@ -36,21 +36,6 @@ func NewVictoriaMetrics() *VictoriaMetrics { } } -// SetPacketsPerMinute implements `Metrics`. -func (m *VictoriaMetrics) SetPacketsPerMinute(val uint64) { - m.packetsPerMinute.Set(val) -} - -// SetPacketsPerSecond implements `Metrics`. -func (m *VictoriaMetrics) SetPacketsPerSecond(val uint64) { - m.packetsPerSecond.Set(val) -} - -// SetClientsCount implements `Metrics`. -func (m *VictoriaMetrics) SetClientsCount(val int64) { - m.clientsCount.Set(val) -} - // RecordSession implements `Metrics`. func (m *VictoriaMetrics) RecordSession(delta DeltaType) { switch delta { diff --git a/vendor/github.com/spf13/cobra/.golangci.yml b/vendor/github.com/spf13/cobra/.golangci.yml deleted file mode 100644 index 0d6e61793a..0000000000 --- a/vendor/github.com/spf13/cobra/.golangci.yml +++ /dev/null @@ -1,48 +0,0 @@ -run: - deadline: 5m - -linters: - disable-all: true - enable: - #- bodyclose - - deadcode - #- depguard - #- dogsled - #- dupl - - errcheck - #- exhaustive - #- funlen - - gas - #- gochecknoinits - - goconst - #- gocritic - #- gocyclo - #- gofmt - - goimports - - golint - #- gomnd - #- goprintffuncname - #- gosec - #- gosimple - - govet - - ineffassign - - interfacer - #- lll - - maligned - - megacheck - #- misspell - #- nakedret - #- noctx - #- nolintlint - #- rowserrcheck - #- scopelint - #- staticcheck - - structcheck - #- stylecheck - #- typecheck - - unconvert - #- unparam - #- unused - - varcheck - #- whitespace - fast: false diff --git a/vendor/github.com/spf13/cobra/.travis.yml b/vendor/github.com/spf13/cobra/.travis.yml index e0a3b50043..a9bd4e5478 100644 --- a/vendor/github.com/spf13/cobra/.travis.yml +++ b/vendor/github.com/spf13/cobra/.travis.yml @@ -1,6 +1,7 @@ language: go stages: + - diff - test - build @@ -9,20 +10,20 @@ go: - 1.13.x - tip -env: GO111MODULE=on - before_install: - go get -u github.com/kyoh86/richgo - go get -u github.com/mitchellh/gox - - curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin latest matrix: allow_failures: - go: tip include: + - stage: diff + go: 1.13.x + script: make fmt - stage: build go: 1.13.x script: make cobra_generator -script: +script: - make test diff --git a/vendor/github.com/spf13/cobra/CHANGELOG.md b/vendor/github.com/spf13/cobra/CHANGELOG.md deleted file mode 100644 index 8a23b4f851..0000000000 --- a/vendor/github.com/spf13/cobra/CHANGELOG.md +++ /dev/null @@ -1,51 +0,0 @@ -# Cobra Changelog - -## v1.1.3 - -* **Fix:** release-branch.cobra1.1 only: Revert "Deprecate Go < 1.14" to maintain backward compatibility - -## v1.1.2 - -### Notable Changes - -* Bump license year to 2021 in golden files (#1309) @Bowbaq -* Enhance PowerShell completion with custom comp (#1208) @Luap99 -* Update gopkg.in/yaml.v2 to v2.4.0: The previous breaking change in yaml.v2 v2.3.0 has been reverted, see go-yaml/yaml#670 -* Documentation readability improvements (#1228 etc.) @zaataylor etc. -* Use golangci-lint: Repair warnings and errors resulting from linting (#1044) @umarcor - -## v1.1.1 - -* **Fix:** yaml.v2 2.3.0 contained a unintended breaking change. This release reverts to yaml.v2 v2.2.8 which has recent critical CVE fixes, but does not have the breaking changes. See https://github.com/spf13/cobra/pull/1259 for context. -* **Fix:** correct internal formatting for go-md2man v2 (which caused man page generation to be broken). See https://github.com/spf13/cobra/issues/1049 for context. - -## v1.1.0 - -### Notable Changes - -* Extend Go completions and revamp zsh comp (#1070) -* Fix man page doc generation - no auto generated tag when `cmd.DisableAutoGenTag = true` (#1104) @jpmcb -* Add completion for help command (#1136) -* Complete subcommands when TraverseChildren is set (#1171) -* Fix stderr printing functions (#894) -* fix: fish output redirection (#1247) - -## v1.0.0 - -Announcing v1.0.0 of Cobra. 🎉 - -### Notable Changes -* Fish completion (including support for Go custom completion) @marckhouzam -* API (urgent): Rename BashCompDirectives to ShellCompDirectives @marckhouzam -* Remove/replace SetOutput on Command - deprecated @jpmcb -* add support for autolabel stale PR @xchapter7x -* Add Labeler Actions @xchapter7x -* Custom completions coded in Go (instead of Bash) @marckhouzam -* Partial Revert of #922 @jharshman -* Add Makefile to project @jharshman -* Correct documentation for InOrStdin @desponda -* Apply formatting to templates @jharshman -* Revert change so help is printed on stdout again @marckhouzam -* Update md2man to v2.0.0 @pdf -* update viper to v1.4.0 @umarcor -* Update cmd/root.go example in README.md @jharshman diff --git a/vendor/github.com/spf13/cobra/CONDUCT.md b/vendor/github.com/spf13/cobra/CONDUCT.md deleted file mode 100644 index 9d16f88fd1..0000000000 --- a/vendor/github.com/spf13/cobra/CONDUCT.md +++ /dev/null @@ -1,37 +0,0 @@ -## Cobra User Contract - -### Versioning -Cobra will follow a steady release cadence. Non breaking changes will be released as minor versions quarterly. Patch bug releases are at the discretion of the maintainers. Users can expect security patch fixes to be released within relatively short order of a CVE becoming known. For more information on security patch fixes see the CVE section below. Releases will follow [Semantic Versioning](https://semver.org/). Users tracking the Master branch should expect unpredictable breaking changes as the project continues to move forward. For stability, it is highly recommended to use a release. - -### Backward Compatibility -We will maintain two major releases in a moving window. The N-1 release will only receive bug fixes and security updates and will be dropped once N+1 is released. - -### Deprecation -Deprecation of Go versions or dependent packages will only occur in major releases. To reduce the change of this taking users by surprise, any large deprecation will be preceded by an announcement in the [#cobra slack channel](https://gophers.slack.com/archives/CD3LP1199) and an Issue on Github. - -### CVE -Maintainers will make every effort to release security patches in the case of a medium to high severity CVE directly impacting the library. The speed in which these patches reach a release is up to the discretion of the maintainers. A low severity CVE may be a lower priority than a high severity one. - -### Communication -Cobra maintainers will use GitHub issues and the [#cobra slack channel](https://gophers.slack.com/archives/CD3LP1199) as the primary means of communication with the community. This is to foster open communication with all users and contributors. - -### Breaking Changes -Breaking changes are generally allowed in the master branch, as this is the branch used to develop the next release of Cobra. - -There may be times, however, when master is closed for breaking changes. This is likely to happen as we near the release of a new version. - -Breaking changes are not allowed in release branches, as these represent minor versions that have already been released. These version have consumers who expect the APIs, behaviors, etc, to remain stable during the lifetime of the patch stream for the minor release. - -Examples of breaking changes include: -- Removing or renaming exported constant, variable, type, or function. -- Updating the version of critical libraries such as `spf13/pflag`, `spf13/viper` etc... - - Some version updates may be acceptable for picking up bug fixes, but maintainers must exercise caution when reviewing. - -There may, at times, need to be exceptions where breaking changes are allowed in release branches. These are at the discretion of the project's maintainers, and must be carefully considered before merging. - -### CI Testing -Maintainers will ensure the Cobra test suite utilizes the current supported versions of Golang. - -### Disclaimer -Changes to this document and the contents therein are at the discretion of the maintainers. -None of the contents of this document are legally binding in any way to the maintainers or the users. diff --git a/vendor/github.com/spf13/cobra/CONTRIBUTING.md b/vendor/github.com/spf13/cobra/CONTRIBUTING.md deleted file mode 100644 index 6f356e6a82..0000000000 --- a/vendor/github.com/spf13/cobra/CONTRIBUTING.md +++ /dev/null @@ -1,50 +0,0 @@ -# Contributing to Cobra - -Thank you so much for contributing to Cobra. We appreciate your time and help. -Here are some guidelines to help you get started. - -## Code of Conduct - -Be kind and respectful to the members of the community. Take time to educate -others who are seeking help. Harassment of any kind will not be tolerated. - -## Questions - -If you have questions regarding Cobra, feel free to ask it in the community -[#cobra Slack channel][cobra-slack] - -## Filing a bug or feature - -1. Before filing an issue, please check the existing issues to see if a - similar one was already opened. If there is one already opened, feel free - to comment on it. -1. If you believe you've found a bug, please provide detailed steps of - reproduction, the version of Cobra and anything else you believe will be - useful to help troubleshoot it (e.g. OS environment, environment variables, - etc...). Also state the current behavior vs. the expected behavior. -1. If you'd like to see a feature or an enhancement please open an issue with - a clear title and description of what the feature is and why it would be - beneficial to the project and its users. - -## Submitting changes - -1. CLA: Upon submitting a Pull Request (PR), contributors will be prompted to - sign a CLA. Please sign the CLA :slightly_smiling_face: -1. Tests: If you are submitting code, please ensure you have adequate tests - for the feature. Tests can be run via `go test ./...` or `make test`. -1. Since this is golang project, ensure the new code is properly formatted to - ensure code consistency. Run `make all`. - -### Quick steps to contribute - -1. Fork the project. -1. Download your fork to your PC (`git clone https://github.com/your_username/cobra && cd cobra`) -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Make changes and run tests (`make test`) -1. Add them to staging (`git add .`) -1. Commit your changes (`git commit -m 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new pull request - - -[cobra-slack]: https://gophers.slack.com/archives/CD3LP1199 diff --git a/vendor/github.com/spf13/cobra/Makefile b/vendor/github.com/spf13/cobra/Makefile index 472c73bf16..e9740d1e17 100644 --- a/vendor/github.com/spf13/cobra/Makefile +++ b/vendor/github.com/spf13/cobra/Makefile @@ -1,29 +1,21 @@ BIN="./bin" SRC=$(shell find . -name "*.go") -ifeq (, $(shell which golangci-lint)) -$(warning "could not find golangci-lint in $(PATH), run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh") -endif - ifeq (, $(shell which richgo)) $(warning "could not find richgo in $(PATH), run: go get github.com/kyoh86/richgo") endif -.PHONY: fmt lint test cobra_generator install_deps clean +.PHONY: fmt vet test cobra_generator install_deps clean default: all -all: fmt test cobra_generator +all: fmt vet test cobra_generator fmt: $(info ******************** checking formatting ********************) @test -z $(shell gofmt -l $(SRC)) || (gofmt -d $(SRC); exit 1) -lint: - $(info ******************** running lint tools ********************) - golangci-lint run -v - -test: install_deps lint +test: install_deps vet $(info ******************** running tests ********************) richgo test -v ./... @@ -36,5 +28,9 @@ install_deps: $(info ******************** downloading dependencies ********************) go get -v ./... +vet: + $(info ******************** vetting ********************) + go vet ./... + clean: rm -rf $(BIN) diff --git a/vendor/github.com/spf13/cobra/README.md b/vendor/github.com/spf13/cobra/README.md index a1b13ddda6..9d79934260 100644 --- a/vendor/github.com/spf13/cobra/README.md +++ b/vendor/github.com/spf13/cobra/README.md @@ -2,15 +2,35 @@ Cobra is both a library for creating powerful modern CLI applications as well as a program to generate applications and command files. -Cobra is used in many Go projects such as [Kubernetes](http://kubernetes.io/), -[Hugo](https://gohugo.io), and [Github CLI](https://github.com/cli/cli) to -name a few. [This list](./projects_using_cobra.md) contains a more extensive list of projects using Cobra. +Many of the most widely used Go projects are built using Cobra, such as: +[Kubernetes](http://kubernetes.io/), +[Hugo](http://gohugo.io), +[rkt](https://github.com/coreos/rkt), +[etcd](https://github.com/coreos/etcd), +[Moby (former Docker)](https://github.com/moby/moby), +[Docker (distribution)](https://github.com/docker/distribution), +[OpenShift](https://www.openshift.com/), +[Delve](https://github.com/derekparker/delve), +[GopherJS](http://www.gopherjs.org/), +[CockroachDB](http://www.cockroachlabs.com/), +[Bleve](http://www.blevesearch.com/), +[ProjectAtomic (enterprise)](http://www.projectatomic.io/), +[Giant Swarm's gsctl](https://github.com/giantswarm/gsctl), +[Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack), +[rclone](http://rclone.org/), +[nehm](https://github.com/bogem/nehm), +[Pouch](https://github.com/alibaba/pouch), +[Istio](https://istio.io), +[Prototool](https://github.com/uber/prototool), +[mattermost-server](https://github.com/mattermost/mattermost-server), +[Gardener](https://github.com/gardener/gardenctl), +[Linkerd](https://linkerd.io/), +[Github CLI](https://github.com/cli/cli) +etc. -[![](https://img.shields.io/github/workflow/status/spf13/cobra/Test?longCache=tru&label=Test&logo=github%20actions&logoColor=fff)](https://github.com/spf13/cobra/actions?query=workflow%3ATest) [![Build Status](https://travis-ci.org/spf13/cobra.svg "Travis CI status")](https://travis-ci.org/spf13/cobra) [![GoDoc](https://godoc.org/github.com/spf13/cobra?status.svg)](https://godoc.org/github.com/spf13/cobra) [![Go Report Card](https://goreportcard.com/badge/github.com/spf13/cobra)](https://goreportcard.com/report/github.com/spf13/cobra) -[![Slack](https://img.shields.io/badge/Slack-cobra-brightgreen)](https://gophers.slack.com/archives/CD3LP1199) # Table of Contents @@ -30,8 +50,9 @@ name a few. [This list](./projects_using_cobra.md) contains a more extensive lis * [PreRun and PostRun Hooks](#prerun-and-postrun-hooks) * [Suggestions when "unknown command" happens](#suggestions-when-unknown-command-happens) * [Generating documentation for your command](#generating-documentation-for-your-command) - * [Generating shell completions](#generating-shell-completions) -- [Contributing](CONTRIBUTING.md) + * [Generating bash completions](#generating-bash-completions) + * [Generating zsh completions](#generating-zsh-completions) +- [Contributing](#contributing) - [License](#license) # Overview @@ -51,7 +72,7 @@ Cobra provides: * Intelligent suggestions (`app srver`... did you mean `app server`?) * Automatic help generation for commands and flags * Automatic help flag recognition of `-h`, `--help`, etc. -* Automatically generated shell autocomplete for your application (bash, zsh, fish, powershell) +* Automatically generated bash autocomplete for your application * Automatically generated man pages for your application * Command aliases so you can change things without breaking them * The flexibility to define your own help, usage, etc. @@ -63,8 +84,8 @@ Cobra is built on a structure of commands, arguments & flags. **Commands** represent actions, **Args** are things and **Flags** are modifiers for those actions. -The best applications read like sentences when used, and as a result, users -intuitively know how to interact with them. +The best applications will read like sentences when used. Users will know how +to use the application because they will natively understand how to use it. The pattern to follow is `APPNAME VERB NOUN --ADJECTIVE.` @@ -109,7 +130,7 @@ Using Cobra is easy. First, use `go get` to install the latest version of the library. This command will install the `cobra` generator executable along with the library and its dependencies: - go get -u github.com/spf13/cobra + go get -u github.com/spf13/cobra/cobra Next, include Cobra in your application: @@ -178,7 +199,7 @@ var rootCmd = &cobra.Command{ func Execute() { if err := rootCmd.Execute(); err != nil { - fmt.Fprintln(os.Stderr, err) + fmt.Println(err) os.Exit(1) } } @@ -235,6 +256,11 @@ func init() { rootCmd.AddCommand(initCmd) } +func er(msg interface{}) { + fmt.Println("Error:", msg) + os.Exit(1) +} + func initConfig() { if cfgFile != "" { // Use config file from the flag. @@ -242,7 +268,9 @@ func initConfig() { } else { // Find home directory. home, err := homedir.Dir() - cobra.CheckErr(err) + if err != nil { + er(err) + } // Search config in home directory with name ".cobra" (without extension). viper.AddConfigPath(home) @@ -262,7 +290,7 @@ func initConfig() { With the root command you need to have your main function execute it. Execute should be run on the root for clarity, though it can be called on any command. -In a Cobra app, typically the main.go file is very bare. It serves one purpose: to initialize Cobra. +In a Cobra app, typically the main.go file is very bare. It serves, one purpose, to initialize Cobra. ```go package main @@ -307,37 +335,6 @@ var versionCmd = &cobra.Command{ } ``` -### Returning and handling errors - -If you wish to return an error to the caller of a command, `RunE` can be used. - -```go -package cmd - -import ( - "fmt" - - "github.com/spf13/cobra" -) - -func init() { - rootCmd.AddCommand(tryCmd) -} - -var tryCmd = &cobra.Command{ - Use: "try", - Short: "Try and possibly fail at something", - RunE: func(cmd *cobra.Command, args []string) error { - if err := someFunc(); err != nil { - return err - } - return nil - }, -} -``` - -The error can then be caught at the execute function call. - ## Working with Flags Flags provide modifiers to control how the action command operates. @@ -357,7 +354,7 @@ There are two different approaches to assign a flag. ### Persistent Flags -A flag can be 'persistent', meaning that this flag will be available to the +A flag can be 'persistent' meaning that this flag will be available to the command it's assigned to as well as every command under that command. For global flags, assign a flag as a persistent flag on the root. @@ -367,7 +364,7 @@ rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose out ### Local Flags -A flag can also be assigned locally, which will only apply to that specific command. +A flag can also be assigned locally which will only apply to that specific command. ```go localCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from") @@ -375,8 +372,8 @@ localCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to rea ### Local Flag on Parent Commands -By default, Cobra only parses local flags on the target command, and any local flags on -parent commands are ignored. By enabling `Command.TraverseChildren`, Cobra will +By default Cobra only parses local flags on the target command, any local flags on +parent commands are ignored. By enabling `Command.TraverseChildren` Cobra will parse local flags on each command before executing the target command. ```go @@ -398,8 +395,8 @@ func init() { } ``` -In this example, the persistent flag `author` is bound with `viper`. -**Note**: the variable `author` will not be set to the value from config, +In this example the persistent flag `author` is bound with `viper`. +**Note**, that the variable `author` will not be set to the value from config, when the `--author` flag is not provided by user. More in [viper documentation](https://github.com/spf13/viper#working-with-flags). @@ -413,12 +410,6 @@ rootCmd.Flags().StringVarP(&Region, "region", "r", "", "AWS region (required)") rootCmd.MarkFlagRequired("region") ``` -Or, for persistent flags: -```go -rootCmd.PersistentFlags().StringVarP(&Region, "region", "r", "", "AWS region (required)") -rootCmd.MarkPersistentFlagRequired("region") -``` - ## Positional and Custom Arguments Validation of positional arguments can be specified using the `Args` field @@ -459,7 +450,7 @@ var cmd = &cobra.Command{ In the example below, we have defined three commands. Two are at the top level and one (cmdTimes) is a child of one of the top commands. In this case the root -is not executable, meaning that a subcommand is required. This is accomplished +is not executable meaning that a subcommand is required. This is accomplished by not providing a 'Run' for the 'rootCmd'. We have only defined one flag for a single command. @@ -749,11 +740,30 @@ Run 'kubectl help' for usage. ## Generating documentation for your command -Cobra can generate documentation based on subcommands, flags, etc. Read more about it in the [docs generation documentation](doc/README.md). +Cobra can generate documentation based on subcommands, flags, etc. in the following formats: + +- [Markdown](doc/md_docs.md) +- [ReStructured Text](doc/rest_docs.md) +- [Man Page](doc/man_docs.md) + +## Generating bash completions + +Cobra can generate a bash-completion file. If you add more information to your command, these completions can be amazingly powerful and flexible. Read more about it in [Bash Completions](bash_completions.md). + +## Generating zsh completions + +Cobra can generate zsh-completion file. Read more about it in +[Zsh Completions](zsh_completions.md). -## Generating shell completions +# Contributing -Cobra can generate a shell-completion file for the following shells: bash, zsh, fish, PowerShell. If you add more information to your commands, these completions can be amazingly powerful and flexible. Read more about it in [Shell Completions](shell_completions.md). +1. Fork it +2. Download your fork to your PC (`git clone https://github.com/your_username/cobra && cd cobra`) +3. Create your feature branch (`git checkout -b my-new-feature`) +4. Make changes and add them (`git add .`) +5. Commit your changes (`git commit -m 'Add some feature'`) +6. Push to the branch (`git push origin my-new-feature`) +7. Create new pull request # License diff --git a/vendor/github.com/spf13/cobra/bash_completions.go b/vendor/github.com/spf13/cobra/bash_completions.go index 7106147937..1e27188c3d 100644 --- a/vendor/github.com/spf13/cobra/bash_completions.go +++ b/vendor/github.com/spf13/cobra/bash_completions.go @@ -19,9 +19,9 @@ const ( BashCompSubdirsInDir = "cobra_annotation_bash_completion_subdirs_in_dir" ) -func writePreamble(buf io.StringWriter, name string) { - WriteStringAndCheck(buf, fmt.Sprintf("# bash completion for %-36s -*- shell-script -*-\n", name)) - WriteStringAndCheck(buf, fmt.Sprintf(` +func writePreamble(buf *bytes.Buffer, name string) { + buf.WriteString(fmt.Sprintf("# bash completion for %-36s -*- shell-script -*-\n", name)) + buf.WriteString(fmt.Sprintf(` __%[1]s_debug() { if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then @@ -62,12 +62,6 @@ __%[1]s_handle_go_custom_completion() { __%[1]s_debug "${FUNCNAME[0]}: cur is ${cur}, words[*] is ${words[*]}, #words[@] is ${#words[@]}" - local shellCompDirectiveError=%[3]d - local shellCompDirectiveNoSpace=%[4]d - local shellCompDirectiveNoFileComp=%[5]d - local shellCompDirectiveFilterFileExt=%[6]d - local shellCompDirectiveFilterDirs=%[7]d - local out requestComp lastParam lastChar comp directive args # Prepare the command to request completions for the program. @@ -101,50 +95,24 @@ __%[1]s_handle_go_custom_completion() __%[1]s_debug "${FUNCNAME[0]}: the completion directive is: ${directive}" __%[1]s_debug "${FUNCNAME[0]}: the completions are: ${out[*]}" - if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then + if [ $((directive & %[3]d)) -ne 0 ]; then # Error code. No completion. __%[1]s_debug "${FUNCNAME[0]}: received error from custom completion go code" return else - if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then + if [ $((directive & %[4]d)) -ne 0 ]; then if [[ $(type -t compopt) = "builtin" ]]; then __%[1]s_debug "${FUNCNAME[0]}: activating no space" compopt -o nospace fi fi - if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then + if [ $((directive & %[5]d)) -ne 0 ]; then if [[ $(type -t compopt) = "builtin" ]]; then __%[1]s_debug "${FUNCNAME[0]}: activating no file completion" compopt +o default fi fi - fi - if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then - # File extension filtering - local fullFilter filter filteringCmd - # Do not use quotes around the $out variable or else newline - # characters will be kept. - for filter in ${out[*]}; do - fullFilter+="$filter|" - done - - filteringCmd="_filedir $fullFilter" - __%[1]s_debug "File filtering command: $filteringCmd" - $filteringCmd - elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then - # File completion for directories only - local subDir - # Use printf to strip any trailing newline - subdir=$(printf "%%s" "${out[0]}") - if [ -n "$subdir" ]; then - __%[1]s_debug "Listing directories in $subdir" - __%[1]s_handle_subdirs_in_dir_flag "$subdir" - else - __%[1]s_debug "Listing directories in ." - _filedir -d - fi - else while IFS='' read -r comp; do COMPREPLY+=("$comp") done < <(compgen -W "${out[*]}" -- "$cur") @@ -213,9 +181,10 @@ __%[1]s_handle_reply() local completions completions=("${commands[@]}") if [[ ${#must_have_one_noun[@]} -ne 0 ]]; then - completions+=("${must_have_one_noun[@]}") + completions=("${must_have_one_noun[@]}") elif [[ -n "${has_completion_function}" ]]; then # if a go completion function is provided, defer to that function + completions=() __%[1]s_handle_go_custom_completion fi if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then @@ -375,15 +344,13 @@ __%[1]s_handle_word() __%[1]s_handle_word } -`, name, ShellCompNoDescRequestCmd, - ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp, - ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs)) +`, name, ShellCompNoDescRequestCmd, ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp)) } -func writePostscript(buf io.StringWriter, name string) { +func writePostscript(buf *bytes.Buffer, name string) { name = strings.Replace(name, ":", "__", -1) - WriteStringAndCheck(buf, fmt.Sprintf("__start_%s()\n", name)) - WriteStringAndCheck(buf, fmt.Sprintf(`{ + buf.WriteString(fmt.Sprintf("__start_%s()\n", name)) + buf.WriteString(fmt.Sprintf(`{ local cur prev words cword declare -A flaghash 2>/dev/null || : declare -A aliashash 2>/dev/null || : @@ -410,33 +377,33 @@ func writePostscript(buf io.StringWriter, name string) { } `, name)) - WriteStringAndCheck(buf, fmt.Sprintf(`if [[ $(type -t compopt) = "builtin" ]]; then + buf.WriteString(fmt.Sprintf(`if [[ $(type -t compopt) = "builtin" ]]; then complete -o default -F __start_%s %s else complete -o default -o nospace -F __start_%s %s fi `, name, name, name, name)) - WriteStringAndCheck(buf, "# ex: ts=4 sw=4 et filetype=sh\n") + buf.WriteString("# ex: ts=4 sw=4 et filetype=sh\n") } -func writeCommands(buf io.StringWriter, cmd *Command) { - WriteStringAndCheck(buf, " commands=()\n") +func writeCommands(buf *bytes.Buffer, cmd *Command) { + buf.WriteString(" commands=()\n") for _, c := range cmd.Commands() { - if !c.IsAvailableCommand() && c != cmd.helpCommand { + if !c.IsAvailableCommand() || c == cmd.helpCommand { continue } - WriteStringAndCheck(buf, fmt.Sprintf(" commands+=(%q)\n", c.Name())) + buf.WriteString(fmt.Sprintf(" commands+=(%q)\n", c.Name())) writeCmdAliases(buf, c) } - WriteStringAndCheck(buf, "\n") + buf.WriteString("\n") } -func writeFlagHandler(buf io.StringWriter, name string, annotations map[string][]string, cmd *Command) { +func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]string, cmd *Command) { for key, value := range annotations { switch key { case BashCompFilenameExt: - WriteStringAndCheck(buf, fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) + buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) var ext string if len(value) > 0 { @@ -444,18 +411,17 @@ func writeFlagHandler(buf io.StringWriter, name string, annotations map[string][ } else { ext = "_filedir" } - WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", ext)) + buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", ext)) case BashCompCustom: - WriteStringAndCheck(buf, fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) - + buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) if len(value) > 0 { handlers := strings.Join(value, "; ") - WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", handlers)) + buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", handlers)) } else { - WriteStringAndCheck(buf, " flags_completion+=(:)\n") + buf.WriteString(" flags_completion+=(:)\n") } case BashCompSubdirsInDir: - WriteStringAndCheck(buf, fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) + buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) var ext string if len(value) == 1 { @@ -463,49 +429,45 @@ func writeFlagHandler(buf io.StringWriter, name string, annotations map[string][ } else { ext = "_filedir -d" } - WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", ext)) + buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", ext)) } } } -const cbn = "\")\n" - -func writeShortFlag(buf io.StringWriter, flag *pflag.Flag, cmd *Command) { +func writeShortFlag(buf *bytes.Buffer, flag *pflag.Flag, cmd *Command) { name := flag.Shorthand format := " " if len(flag.NoOptDefVal) == 0 { format += "two_word_" } - format += "flags+=(\"-%s" + cbn - WriteStringAndCheck(buf, fmt.Sprintf(format, name)) + format += "flags+=(\"-%s\")\n" + buf.WriteString(fmt.Sprintf(format, name)) writeFlagHandler(buf, "-"+name, flag.Annotations, cmd) } -func writeFlag(buf io.StringWriter, flag *pflag.Flag, cmd *Command) { +func writeFlag(buf *bytes.Buffer, flag *pflag.Flag, cmd *Command) { name := flag.Name format := " flags+=(\"--%s" if len(flag.NoOptDefVal) == 0 { format += "=" } - format += cbn - WriteStringAndCheck(buf, fmt.Sprintf(format, name)) + format += "\")\n" + buf.WriteString(fmt.Sprintf(format, name)) if len(flag.NoOptDefVal) == 0 { - format = " two_word_flags+=(\"--%s" + cbn - WriteStringAndCheck(buf, fmt.Sprintf(format, name)) + format = " two_word_flags+=(\"--%s\")\n" + buf.WriteString(fmt.Sprintf(format, name)) } writeFlagHandler(buf, "--"+name, flag.Annotations, cmd) } -func writeLocalNonPersistentFlag(buf io.StringWriter, flag *pflag.Flag) { +func writeLocalNonPersistentFlag(buf *bytes.Buffer, flag *pflag.Flag) { name := flag.Name - format := " local_nonpersistent_flags+=(\"--%[1]s" + cbn + format := " local_nonpersistent_flags+=(\"--%s" if len(flag.NoOptDefVal) == 0 { - format += " local_nonpersistent_flags+=(\"--%[1]s=" + cbn - } - WriteStringAndCheck(buf, fmt.Sprintf(format, name)) - if len(flag.Shorthand) > 0 { - WriteStringAndCheck(buf, fmt.Sprintf(" local_nonpersistent_flags+=(\"-%s\")\n", flag.Shorthand)) + format += "=" } + format += "\")\n" + buf.WriteString(fmt.Sprintf(format, name)) } // Setup annotations for go completions for registered flags @@ -522,9 +484,9 @@ func prepareCustomAnnotationsForFlags(cmd *Command) { } } -func writeFlags(buf io.StringWriter, cmd *Command) { +func writeFlags(buf *bytes.Buffer, cmd *Command) { prepareCustomAnnotationsForFlags(cmd) - WriteStringAndCheck(buf, ` flags=() + buf.WriteString(` flags=() two_word_flags=() local_nonpersistent_flags=() flags_with_completion=() @@ -540,9 +502,7 @@ func writeFlags(buf io.StringWriter, cmd *Command) { if len(flag.Shorthand) > 0 { writeShortFlag(buf, flag, cmd) } - // localNonPersistentFlags are used to stop the completion of subcommands when one is set - // if TraverseChildren is true we should allow to complete subcommands - if localNonPersistentFlags.Lookup(flag.Name) != nil && !cmd.Root().TraverseChildren { + if localNonPersistentFlags.Lookup(flag.Name) != nil { writeLocalNonPersistentFlag(buf, flag) } }) @@ -556,11 +516,11 @@ func writeFlags(buf io.StringWriter, cmd *Command) { } }) - WriteStringAndCheck(buf, "\n") + buf.WriteString("\n") } -func writeRequiredFlag(buf io.StringWriter, cmd *Command) { - WriteStringAndCheck(buf, " must_have_one_flag=()\n") +func writeRequiredFlag(buf *bytes.Buffer, cmd *Command) { + buf.WriteString(" must_have_one_flag=()\n") flags := cmd.NonInheritedFlags() flags.VisitAll(func(flag *pflag.Flag) { if nonCompletableFlag(flag) { @@ -573,57 +533,57 @@ func writeRequiredFlag(buf io.StringWriter, cmd *Command) { if flag.Value.Type() != "bool" { format += "=" } - format += cbn - WriteStringAndCheck(buf, fmt.Sprintf(format, flag.Name)) + format += "\")\n" + buf.WriteString(fmt.Sprintf(format, flag.Name)) if len(flag.Shorthand) > 0 { - WriteStringAndCheck(buf, fmt.Sprintf(" must_have_one_flag+=(\"-%s"+cbn, flag.Shorthand)) + buf.WriteString(fmt.Sprintf(" must_have_one_flag+=(\"-%s\")\n", flag.Shorthand)) } } } }) } -func writeRequiredNouns(buf io.StringWriter, cmd *Command) { - WriteStringAndCheck(buf, " must_have_one_noun=()\n") - sort.Strings(cmd.ValidArgs) +func writeRequiredNouns(buf *bytes.Buffer, cmd *Command) { + buf.WriteString(" must_have_one_noun=()\n") + sort.Sort(sort.StringSlice(cmd.ValidArgs)) for _, value := range cmd.ValidArgs { // Remove any description that may be included following a tab character. // Descriptions are not supported by bash completion. value = strings.Split(value, "\t")[0] - WriteStringAndCheck(buf, fmt.Sprintf(" must_have_one_noun+=(%q)\n", value)) + buf.WriteString(fmt.Sprintf(" must_have_one_noun+=(%q)\n", value)) } if cmd.ValidArgsFunction != nil { - WriteStringAndCheck(buf, " has_completion_function=1\n") + buf.WriteString(" has_completion_function=1\n") } } -func writeCmdAliases(buf io.StringWriter, cmd *Command) { +func writeCmdAliases(buf *bytes.Buffer, cmd *Command) { if len(cmd.Aliases) == 0 { return } - sort.Strings(cmd.Aliases) + sort.Sort(sort.StringSlice(cmd.Aliases)) - WriteStringAndCheck(buf, fmt.Sprint(` if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then`, "\n")) + buf.WriteString(fmt.Sprint(` if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then`, "\n")) for _, value := range cmd.Aliases { - WriteStringAndCheck(buf, fmt.Sprintf(" command_aliases+=(%q)\n", value)) - WriteStringAndCheck(buf, fmt.Sprintf(" aliashash[%q]=%q\n", value, cmd.Name())) + buf.WriteString(fmt.Sprintf(" command_aliases+=(%q)\n", value)) + buf.WriteString(fmt.Sprintf(" aliashash[%q]=%q\n", value, cmd.Name())) } - WriteStringAndCheck(buf, ` fi`) - WriteStringAndCheck(buf, "\n") + buf.WriteString(` fi`) + buf.WriteString("\n") } -func writeArgAliases(buf io.StringWriter, cmd *Command) { - WriteStringAndCheck(buf, " noun_aliases=()\n") - sort.Strings(cmd.ArgAliases) +func writeArgAliases(buf *bytes.Buffer, cmd *Command) { + buf.WriteString(" noun_aliases=()\n") + sort.Sort(sort.StringSlice(cmd.ArgAliases)) for _, value := range cmd.ArgAliases { - WriteStringAndCheck(buf, fmt.Sprintf(" noun_aliases+=(%q)\n", value)) + buf.WriteString(fmt.Sprintf(" noun_aliases+=(%q)\n", value)) } } -func gen(buf io.StringWriter, cmd *Command) { +func gen(buf *bytes.Buffer, cmd *Command) { for _, c := range cmd.Commands() { - if !c.IsAvailableCommand() && c != cmd.helpCommand { + if !c.IsAvailableCommand() || c == cmd.helpCommand { continue } gen(buf, c) @@ -633,22 +593,22 @@ func gen(buf io.StringWriter, cmd *Command) { commandName = strings.Replace(commandName, ":", "__", -1) if cmd.Root() == cmd { - WriteStringAndCheck(buf, fmt.Sprintf("_%s_root_command()\n{\n", commandName)) + buf.WriteString(fmt.Sprintf("_%s_root_command()\n{\n", commandName)) } else { - WriteStringAndCheck(buf, fmt.Sprintf("_%s()\n{\n", commandName)) + buf.WriteString(fmt.Sprintf("_%s()\n{\n", commandName)) } - WriteStringAndCheck(buf, fmt.Sprintf(" last_command=%q\n", commandName)) - WriteStringAndCheck(buf, "\n") - WriteStringAndCheck(buf, " command_aliases=()\n") - WriteStringAndCheck(buf, "\n") + buf.WriteString(fmt.Sprintf(" last_command=%q\n", commandName)) + buf.WriteString("\n") + buf.WriteString(" command_aliases=()\n") + buf.WriteString("\n") writeCommands(buf, cmd) writeFlags(buf, cmd) writeRequiredFlag(buf, cmd) writeRequiredNouns(buf, cmd) writeArgAliases(buf, cmd) - WriteStringAndCheck(buf, "}\n\n") + buf.WriteString("}\n\n") } // GenBashCompletion generates bash completion file and writes to the passed writer. diff --git a/vendor/github.com/spf13/cobra/bash_completions.md b/vendor/github.com/spf13/cobra/bash_completions.md index 130f99b923..e61a3a6546 100644 --- a/vendor/github.com/spf13/cobra/bash_completions.md +++ b/vendor/github.com/spf13/cobra/bash_completions.md @@ -1,14 +1,206 @@ -# Generating Bash Completions For Your cobra.Command +# Generating Bash Completions For Your Own cobra.Command -Please refer to [Shell Completions](shell_completions.md) for details. +If you are using the generator you can create a completion command by running -## Bash legacy dynamic completions +```bash +cobra add completion +``` + +Update the help text show how to install the bash_completion Linux show here [Kubectl docs show mac options](https://kubernetes.io/docs/tasks/tools/install-kubectl/#enabling-shell-autocompletion) + +Writing the shell script to stdout allows the most flexible use. + +```go +// completionCmd represents the completion command +var completionCmd = &cobra.Command{ + Use: "completion", + Short: "Generates bash completion scripts", + Long: `To load completion run + +. <(bitbucket completion) + +To configure your bash shell to load completions for each session add to your bashrc + +# ~/.bashrc or ~/.profile +. <(bitbucket completion) +`, + Run: func(cmd *cobra.Command, args []string) { + rootCmd.GenBashCompletion(os.Stdout); + }, +} +``` + +**Note:** The cobra generator may include messages printed to stdout for example if the config file is loaded, this will break the auto complete script + + +## Example from kubectl + +Generating bash completions from a cobra command is incredibly easy. An actual program which does so for the kubernetes kubectl binary is as follows: + +```go +package main + +import ( + "io/ioutil" + "os" + + "k8s.io/kubernetes/pkg/kubectl/cmd" + "k8s.io/kubernetes/pkg/kubectl/cmd/util" +) + +func main() { + kubectl := cmd.NewKubectlCommand(util.NewFactory(nil), os.Stdin, ioutil.Discard, ioutil.Discard) + kubectl.GenBashCompletionFile("out.sh") +} +``` + +`out.sh` will get you completions of subcommands and flags. Copy it to `/etc/bash_completion.d/` as described [here](https://debian-administration.org/article/316/An_introduction_to_bash_completion_part_1) and reset your terminal to use autocompletion. If you make additional annotations to your code, you can get even more intelligent and flexible behavior. + +## Have the completions code complete your 'nouns' + +### Static completion of nouns + +This method allows you to provide a pre-defined list of completion choices for your nouns using the `validArgs` field. +For example, if you want `kubectl get [tab][tab]` to show a list of valid "nouns" you have to set them. Simplified code from `kubectl get` looks like: + +```go +validArgs []string = { "pod", "node", "service", "replicationcontroller" } + +cmd := &cobra.Command{ + Use: "get [(-o|--output=)json|yaml|template|...] (RESOURCE [NAME] | RESOURCE/NAME ...)", + Short: "Display one or many resources", + Long: get_long, + Example: get_example, + Run: func(cmd *cobra.Command, args []string) { + err := RunGet(f, out, cmd, args) + util.CheckErr(err) + }, + ValidArgs: validArgs, +} +``` + +Notice we put the "ValidArgs" on the "get" subcommand. Doing so will give results like + +```bash +# kubectl get [tab][tab] +node pod replicationcontroller service +``` + +### Plural form and shortcuts for nouns + +If your nouns have a number of aliases, you can define them alongside `ValidArgs` using `ArgAliases`: + +```go +argAliases []string = { "pods", "nodes", "services", "svc", "replicationcontrollers", "rc" } + +cmd := &cobra.Command{ + ... + ValidArgs: validArgs, + ArgAliases: argAliases +} +``` + +The aliases are not shown to the user on tab completion, but they are accepted as valid nouns by +the completion algorithm if entered manually, e.g. in: + +```bash +# kubectl get rc [tab][tab] +backend frontend database +``` + +Note that without declaring `rc` as an alias, the completion algorithm would show the list of nouns +in this example again instead of the replication controllers. + +### Dynamic completion of nouns + +In some cases it is not possible to provide a list of possible completions in advance. Instead, the list of completions must be determined at execution-time. Cobra provides two ways of defining such dynamic completion of nouns. Note that both these methods can be used along-side each other as long as they are not both used for the same command. -For backward compatibility, Cobra still supports its legacy dynamic completion solution (described below). Unlike the `ValidArgsFunction` solution, the legacy solution will only work for Bash shell-completion and not for other shells. This legacy solution can be used along-side `ValidArgsFunction` and `RegisterFlagCompletionFunc()`, as long as both solutions are not used for the same command. This provides a path to gradually migrate from the legacy solution to the new solution. +**Note**: *Custom Completions written in Go* will automatically work for other shell-completion scripts (e.g., Fish shell), while *Custom Completions written in Bash* will only work for Bash shell-completion. It is therefore recommended to use *Custom Completions written in Go*. + +#### 1. Custom completions of nouns written in Go + +In a similar fashion as for static completions, you can use the `ValidArgsFunction` field to provide a Go function that Cobra will execute when it needs the list of completion choices for the nouns of a command. Note that either `ValidArgs` or `ValidArgsFunction` can be used for a single cobra command, but not both. +Simplified code from `helm status` looks like: + +```go +cmd := &cobra.Command{ + Use: "status RELEASE_NAME", + Short: "Display the status of the named release", + Long: status_long, + RunE: func(cmd *cobra.Command, args []string) { + RunGet(args[0]) + }, + ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + if len(args) != 0 { + return nil, cobra.ShellCompDirectiveNoFileComp + } + return getReleasesFromCluster(toComplete), cobra.ShellCompDirectiveNoFileComp + }, +} +``` +Where `getReleasesFromCluster()` is a Go function that obtains the list of current Helm releases running on the Kubernetes cluster. +Notice we put the `ValidArgsFunction` on the `status` subcommand. Let's assume the Helm releases on the cluster are: `harbor`, `notary`, `rook` and `thanos` then this dynamic completion will give results like + +```bash +# helm status [tab][tab] +harbor notary rook thanos +``` +You may have noticed the use of `cobra.ShellCompDirective`. These directives are bit fields allowing to control some shell completion behaviors for your particular completion. You can combine them with the bit-or operator such as `cobra.ShellCompDirectiveNoSpace | cobra.ShellCompDirectiveNoFileComp` +```go +// Indicates an error occurred and completions should be ignored. +ShellCompDirectiveError +// Indicates that the shell should not add a space after the completion, +// even if there is a single completion provided. +ShellCompDirectiveNoSpace +// Indicates that the shell should not provide file completion even when +// no completion is provided. +// This currently does not work for zsh or bash < 4 +ShellCompDirectiveNoFileComp +// Indicates that the shell will perform its default behavior after completions +// have been provided (this implies !ShellCompDirectiveNoSpace && !ShellCompDirectiveNoFileComp). +ShellCompDirectiveDefault +``` -The legacy solution allows you to inject bash functions into the bash completion script. Those bash functions are responsible for providing the completion choices for your own completions. +When using the `ValidArgsFunction`, Cobra will call your registered function after having parsed all flags and arguments provided in the command-line. You therefore don't need to do this parsing yourself. For example, when a user calls `helm status --namespace my-rook-ns [tab][tab]`, Cobra will call your registered `ValidArgsFunction` after having parsed the `--namespace` flag, as it would have done when calling the `RunE` function. -Some code that works in kubernetes: +##### Debugging + +Cobra achieves dynamic completions written in Go through the use of a hidden command called by the completion script. To debug your Go completion code, you can call this hidden command directly: +```bash +# helm __complete status har +harbor +:4 +Completion ended with directive: ShellCompDirectiveNoFileComp # This is on stderr +``` +***Important:*** If the noun to complete is empty, you must pass an empty parameter to the `__complete` command: +```bash +# helm __complete status "" +harbor +notary +rook +thanos +:4 +Completion ended with directive: ShellCompDirectiveNoFileComp # This is on stderr +``` +Calling the `__complete` command directly allows you to run the Go debugger to troubleshoot your code. You can also add printouts to your code; Cobra provides the following functions to use for printouts in Go completion code: +```go +// Prints to the completion script debug file (if BASH_COMP_DEBUG_FILE +// is set to a file path) and optionally prints to stderr. +cobra.CompDebug(msg string, printToStdErr bool) { +cobra.CompDebugln(msg string, printToStdErr bool) + +// Prints to the completion script debug file (if BASH_COMP_DEBUG_FILE +// is set to a file path) and to stderr. +cobra.CompError(msg string) +cobra.CompErrorln(msg string) +``` +***Important:*** You should **not** leave traces that print to stdout in your completion code as they will be interpreted as completion choices by the completion script. Instead, use the cobra-provided debugging traces functions mentioned above. + +#### 2. Custom completions of nouns written in Bash + +This method allows you to inject bash functions into the completion script. Those bash functions are responsible for providing the completion choices for your own completions. + +Some more actual code that works in kubernetes: ```bash const ( @@ -61,7 +253,93 @@ Find more information at https://github.com/GoogleCloudPlatform/kubernetes.`, The `BashCompletionFunction` option is really only valid/useful on the root command. Doing the above will cause `__kubectl_custom_func()` (`___custom_func()`) to be called when the built in processor was unable to find a solution. In the case of kubernetes a valid command might look something like `kubectl get pod [mypod]`. If you type `kubectl get pod [tab][tab]` the `__kubectl_customc_func()` will run because the cobra.Command only understood "kubectl" and "get." `__kubectl_custom_func()` will see that the cobra.Command is "kubectl_get" and will thus call another helper `__kubectl_get_resource()`. `__kubectl_get_resource` will look at the 'nouns' collected. In our example the only noun will be `pod`. So it will call `__kubectl_parse_get pod`. `__kubectl_parse_get` will actually call out to kubernetes and get any pods. It will then set `COMPREPLY` to valid pods! -Similarly, for flags: +## Mark flags as required + +Most of the time completions will only show subcommands. But if a flag is required to make a subcommand work, you probably want it to show up when the user types [tab][tab]. Marking a flag as 'Required' is incredibly easy. + +```go +cmd.MarkFlagRequired("pod") +cmd.MarkFlagRequired("container") +``` + +and you'll get something like + +```bash +# kubectl exec [tab][tab][tab] +-c --container= -p --pod= +``` + +# Specify valid filename extensions for flags that take a filename + +In this example we use --filename= and expect to get a json or yaml file as the argument. To make this easier we annotate the --filename flag with valid filename extensions. + +```go + annotations := []string{"json", "yaml", "yml"} + annotation := make(map[string][]string) + annotation[cobra.BashCompFilenameExt] = annotations + + flag := &pflag.Flag{ + Name: "filename", + Shorthand: "f", + Usage: usage, + Value: value, + DefValue: value.String(), + Annotations: annotation, + } + cmd.Flags().AddFlag(flag) +``` + +Now when you run a command with this filename flag you'll get something like + +```bash +# kubectl create -f +test/ example/ rpmbuild/ +hello.yml test.json +``` + +So while there are many other files in the CWD it only shows me subdirs and those with valid extensions. + +# Specify custom flag completion + +As for nouns, Cobra provides two ways of defining dynamic completion of flags. Note that both these methods can be used along-side each other as long as they are not both used for the same flag. + +**Note**: *Custom Completions written in Go* will automatically work for other shell-completion scripts (e.g., Fish shell), while *Custom Completions written in Bash* will only work for Bash shell-completion. It is therefore recommended to use *Custom Completions written in Go*. + +## 1. Custom completions of flags written in Go + +To provide a Go function that Cobra will execute when it needs the list of completion choices for a flag, you must register the function in the following manner: + +```go +flagName := "output" +cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + return []string{"json", "table", "yaml"}, cobra.ShellCompDirectiveDefault +}) +``` +Notice that calling `RegisterFlagCompletionFunc()` is done through the `command` with which the flag is associated. In our example this dynamic completion will give results like so: + +```bash +# helm status --output [tab][tab] +json table yaml +``` + +### Debugging + +You can also easily debug your Go completion code for flags: +```bash +# helm __complete status --output "" +json +table +yaml +:4 +Completion ended with directive: ShellCompDirectiveNoFileComp # This is on stderr +``` +***Important:*** You should **not** leave traces that print to stdout in your completion code as they will be interpreted as completion choices by the completion script. Instead, use the cobra-provided debugging traces functions mentioned in the above section. + +## 2. Custom completions of flags written in Bash + +Alternatively, you can use bash code for flag custom completion. Similar to the filename +completion and filtering using `cobra.BashCompFilenameExt`, you can specify +a custom flag completion bash function with `cobra.BashCompCustom`: ```go annotation := make(map[string][]string) @@ -89,3 +367,17 @@ __kubectl_get_namespaces() fi } ``` +# Using bash aliases for commands + +You can also configure the `bash aliases` for the commands and they will also support completions. + +```bash +alias aliasname=origcommand +complete -o default -F __start_origcommand aliasname + +# and now when you run `aliasname` completion will make +# suggestions as it did for `origcommand`. + +$) aliasname +completion firstcommand secondcommand +``` diff --git a/vendor/github.com/spf13/cobra/cobra.go b/vendor/github.com/spf13/cobra/cobra.go index d6cbfd7198..d01becc8fa 100644 --- a/vendor/github.com/spf13/cobra/cobra.go +++ b/vendor/github.com/spf13/cobra/cobra.go @@ -19,7 +19,6 @@ package cobra import ( "fmt" "io" - "os" "reflect" "strconv" "strings" @@ -206,17 +205,3 @@ func stringInSlice(a string, list []string) bool { } return false } - -// CheckErr prints the msg with the prefix 'Error:' and exits with error code 1. If the msg is nil, it does nothing. -func CheckErr(msg interface{}) { - if msg != nil { - fmt.Fprintln(os.Stderr, "Error:", msg) - os.Exit(1) - } -} - -// WriteStringAndCheck writes a string into a buffer, and checks if the error is not nil. -func WriteStringAndCheck(b io.StringWriter, s string) { - _, err := b.WriteString(s) - CheckErr(err) -} diff --git a/vendor/github.com/spf13/cobra/command.go b/vendor/github.com/spf13/cobra/command.go index d6732ad115..88e6ed77d0 100644 --- a/vendor/github.com/spf13/cobra/command.go +++ b/vendor/github.com/spf13/cobra/command.go @@ -37,14 +37,6 @@ type FParseErrWhitelist flag.ParseErrorsWhitelist // definition to ensure usability. type Command struct { // Use is the one-line usage message. - // Recommended syntax is as follow: - // [ ] identifies an optional argument. Arguments that are not enclosed in brackets are required. - // ... indicates that you can specify multiple values for the previous argument. - // | indicates mutually exclusive information. You can use the argument to the left of the separator or the - // argument to the right of the separator. You cannot use both arguments in a single use of the command. - // { } delimits a set of mutually exclusive arguments when one of the arguments is required. If the arguments are - // optional, they are enclosed in brackets ([ ]). - // Example: add [-F file | -D dir]... [-f format] profile Use string // Aliases is an array of aliases that can be used instead of the first word in Use. @@ -84,6 +76,9 @@ type Command struct { // Deprecated defines, if this command is deprecated and should print this string when used. Deprecated string + // Hidden defines, if this command is hidden and should NOT show up in the list of available commands. + Hidden bool + // Annotations are key/value pairs that can be used by applications to identify or // group commands. Annotations map[string]string @@ -123,6 +118,55 @@ type Command struct { // PersistentPostRunE: PersistentPostRun but returns an error. PersistentPostRunE func(cmd *Command, args []string) error + // SilenceErrors is an option to quiet errors down stream. + SilenceErrors bool + + // SilenceUsage is an option to silence usage when an error occurs. + SilenceUsage bool + + // DisableFlagParsing disables the flag parsing. + // If this is true all flags will be passed to the command as arguments. + DisableFlagParsing bool + + // DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") + // will be printed by generating docs for this command. + DisableAutoGenTag bool + + // DisableFlagsInUseLine will disable the addition of [flags] to the usage + // line of a command when printing help or generating docs + DisableFlagsInUseLine bool + + // DisableSuggestions disables the suggestions based on Levenshtein distance + // that go along with 'unknown command' messages. + DisableSuggestions bool + // SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. + // Must be > 0. + SuggestionsMinimumDistance int + + // TraverseChildren parses flags on all parents before executing child command. + TraverseChildren bool + + // FParseErrWhitelist flag parse errors to be ignored + FParseErrWhitelist FParseErrWhitelist + + ctx context.Context + + // commands is the list of commands supported by this program. + commands []*Command + // parent is a parent command for this command. + parent *Command + // Max lengths of commands' string lengths for use in padding. + commandsMaxUseLen int + commandsMaxCommandPathLen int + commandsMaxNameLen int + // commandsAreSorted defines, if command slice are sorted or not. + commandsAreSorted bool + // commandCalledAs is the name or alias value used to call this command. + commandCalledAs struct { + name string + called bool + } + // args is actual args parsed from flags. args []string // flagErrorBuf contains all error messages from pflag. @@ -164,60 +208,6 @@ type Command struct { outWriter io.Writer // errWriter is a writer defined by the user that replaces stderr errWriter io.Writer - - //FParseErrWhitelist flag parse errors to be ignored - FParseErrWhitelist FParseErrWhitelist - - // commandsAreSorted defines, if command slice are sorted or not. - commandsAreSorted bool - // commandCalledAs is the name or alias value used to call this command. - commandCalledAs struct { - name string - called bool - } - - ctx context.Context - - // commands is the list of commands supported by this program. - commands []*Command - // parent is a parent command for this command. - parent *Command - // Max lengths of commands' string lengths for use in padding. - commandsMaxUseLen int - commandsMaxCommandPathLen int - commandsMaxNameLen int - - // TraverseChildren parses flags on all parents before executing child command. - TraverseChildren bool - - // Hidden defines, if this command is hidden and should NOT show up in the list of available commands. - Hidden bool - - // SilenceErrors is an option to quiet errors down stream. - SilenceErrors bool - - // SilenceUsage is an option to silence usage when an error occurs. - SilenceUsage bool - - // DisableFlagParsing disables the flag parsing. - // If this is true all flags will be passed to the command as arguments. - DisableFlagParsing bool - - // DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") - // will be printed by generating docs for this command. - DisableAutoGenTag bool - - // DisableFlagsInUseLine will disable the addition of [flags] to the usage - // line of a command when printing help or generating docs - DisableFlagsInUseLine bool - - // DisableSuggestions disables the suggestions based on Levenshtein distance - // that go along with 'unknown command' messages. - DisableSuggestions bool - - // SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. - // Must be > 0. - SuggestionsMinimumDistance int } // Context returns underlying command context. If command wasn't @@ -369,7 +359,7 @@ func (c *Command) UsageFunc() (f func(*Command) error) { c.mergePersistentFlags() err := tmpl(c.OutOrStderr(), c.UsageTemplate(), c) if err != nil { - c.PrintErrln(err) + c.Println(err) } return err } @@ -397,7 +387,7 @@ func (c *Command) HelpFunc() func(*Command, []string) { // See https://github.com/spf13/cobra/issues/1002 err := tmpl(c.OutOrStdout(), c.HelpTemplate(), c) if err != nil { - c.PrintErrln(err) + c.Println(err) } } } @@ -420,7 +410,7 @@ func (c *Command) UsageString() string { c.outWriter = bb c.errWriter = bb - CheckErr(c.Usage()) + c.Usage() // Setting things back to normal c.outWriter = tmpOutput @@ -940,8 +930,8 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { c = cmd } if !c.SilenceErrors { - c.PrintErrln("Error:", err.Error()) - c.PrintErrf("Run '%v --help' for usage.\n", c.CommandPath()) + c.Println("Error:", err.Error()) + c.Printf("Run '%v --help' for usage.\n", c.CommandPath()) } return c, err } @@ -966,13 +956,13 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { return cmd, nil } - // If root command has SilenceErrors flagged, + // If root command has SilentErrors flagged, // all subcommands should respect it if !cmd.SilenceErrors && !c.SilenceErrors { - c.PrintErrln("Error:", err.Error()) + c.Println("Error:", err.Error()) } - // If root command has SilenceUsage flagged, + // If root command has SilentUsage flagged, // all subcommands should respect it if !cmd.SilenceUsage && !c.SilenceUsage { c.Println(cmd.UsageString()) @@ -989,10 +979,6 @@ func (c *Command) ValidateArgs(args []string) error { } func (c *Command) validateRequiredFlags() error { - if c.DisableFlagParsing { - return nil - } - flags := c.Flags() missingFlagNames := []string{} flags.VisitAll(func(pflag *flag.Flag) { @@ -1066,33 +1052,15 @@ func (c *Command) InitDefaultHelpCmd() { Short: "Help about any command", Long: `Help provides help for any command in the application. Simply type ` + c.Name() + ` help [path to command] for full details.`, - ValidArgsFunction: func(c *Command, args []string, toComplete string) ([]string, ShellCompDirective) { - var completions []string - cmd, _, e := c.Root().Find(args) - if e != nil { - return nil, ShellCompDirectiveNoFileComp - } - if cmd == nil { - // Root help command. - cmd = c.Root() - } - for _, subCmd := range cmd.Commands() { - if subCmd.IsAvailableCommand() || subCmd == cmd.helpCommand { - if strings.HasPrefix(subCmd.Name(), toComplete) { - completions = append(completions, fmt.Sprintf("%s\t%s", subCmd.Name(), subCmd.Short)) - } - } - } - return completions, ShellCompDirectiveNoFileComp - }, + Run: func(c *Command, args []string) { cmd, _, e := c.Root().Find(args) if cmd == nil || e != nil { c.Printf("Unknown help topic %#q\n", args) - CheckErr(c.Root().Usage()) + c.Root().Usage() } else { cmd.InitDefaultHelpFlag() // make possible 'help' flag to be shown - CheckErr(cmd.Help()) + cmd.Help() } }, } @@ -1211,12 +1179,12 @@ func (c *Command) PrintErr(i ...interface{}) { // PrintErrln is a convenience method to Println to the defined Err output, fallback to Stderr if not set. func (c *Command) PrintErrln(i ...interface{}) { - c.PrintErr(fmt.Sprintln(i...)) + c.Print(fmt.Sprintln(i...)) } // PrintErrf is a convenience method to Printf to the defined Err output, fallback to Stderr if not set. func (c *Command) PrintErrf(format string, i ...interface{}) { - c.PrintErr(fmt.Sprintf(format, i...)) + c.Print(fmt.Sprintf(format, i...)) } // CommandPath returns the full path to this command. diff --git a/vendor/github.com/spf13/cobra/custom_completions.go b/vendor/github.com/spf13/cobra/custom_completions.go index fa060c147b..ba57327c15 100644 --- a/vendor/github.com/spf13/cobra/custom_completions.go +++ b/vendor/github.com/spf13/cobra/custom_completions.go @@ -1,6 +1,7 @@ package cobra import ( + "errors" "fmt" "os" "strings" @@ -37,29 +38,8 @@ const ( // This currently does not work for zsh or bash < 4 ShellCompDirectiveNoFileComp - // ShellCompDirectiveFilterFileExt indicates that the provided completions - // should be used as file extension filters. - // For flags, using Command.MarkFlagFilename() and Command.MarkPersistentFlagFilename() - // is a shortcut to using this directive explicitly. The BashCompFilenameExt - // annotation can also be used to obtain the same behavior for flags. - ShellCompDirectiveFilterFileExt - - // ShellCompDirectiveFilterDirs indicates that only directory names should - // be provided in file completion. To request directory names within another - // directory, the returned completions should specify the directory within - // which to search. The BashCompSubdirsInDir annotation can be used to - // obtain the same behavior but only for flags. - ShellCompDirectiveFilterDirs - - // =========================================================================== - - // All directives using iota should be above this one. - // For internal use. - shellCompDirectiveMaxValue - // ShellCompDirectiveDefault indicates to let the shell perform its default // behavior after completions have been provided. - // This one must be last to avoid messing up the iota count. ShellCompDirectiveDefault ShellCompDirective = 0 ) @@ -88,17 +68,11 @@ func (d ShellCompDirective) string() string { if d&ShellCompDirectiveNoFileComp != 0 { directives = append(directives, "ShellCompDirectiveNoFileComp") } - if d&ShellCompDirectiveFilterFileExt != 0 { - directives = append(directives, "ShellCompDirectiveFilterFileExt") - } - if d&ShellCompDirectiveFilterDirs != 0 { - directives = append(directives, "ShellCompDirectiveFilterDirs") - } if len(directives) == 0 { directives = append(directives, "ShellCompDirectiveDefault") } - if d >= shellCompDirectiveMaxValue { + if d > ShellCompDirectiveError+ShellCompDirectiveNoSpace+ShellCompDirectiveNoFileComp { return fmt.Sprintf("ERROR: unexpected ShellCompDirective value: %d", d) } return strings.Join(directives, ", ") @@ -131,25 +105,11 @@ func (c *Command) initCompleteCmd(args []string) { // Remove any description that may be included following a tab character. comp = strings.Split(comp, "\t")[0] } - - // Make sure we only write the first line to the output. - // This is needed if a description contains a linebreak. - // Otherwise the shell scripts will interpret the other lines as new flags - // and could therefore provide a wrong completion. - comp = strings.Split(comp, "\n")[0] - - // Finally trim the completion. This is especially important to get rid - // of a trailing tab when there are no description following it. - // For example, a sub-command without a description should not be completed - // with a tab at the end (or else zsh will show a -- following it - // although there is no description). - comp = strings.TrimSpace(comp) - // Print each possible completion to stdout for the completion script to consume. fmt.Fprintln(finalCmd.OutOrStdout(), comp) } - if directive >= shellCompDirectiveMaxValue { + if directive > ShellCompDirectiveError+ShellCompDirectiveNoSpace+ShellCompDirectiveNoFileComp { directive = ShellCompDirectiveDefault } @@ -176,179 +136,90 @@ func (c *Command) initCompleteCmd(args []string) { } func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDirective, error) { + var completions []string + // The last argument, which is not completely typed by the user, // should not be part of the list of arguments toComplete := args[len(args)-1] trimmedArgs := args[:len(args)-1] - var finalCmd *Command - var finalArgs []string - var err error // Find the real command for which completion must be performed - // check if we need to traverse here to parse local flags on parent commands - if c.Root().TraverseChildren { - finalCmd, finalArgs, err = c.Root().Traverse(trimmedArgs) - } else { - finalCmd, finalArgs, err = c.Root().Find(trimmedArgs) - } + finalCmd, finalArgs, err := c.Root().Find(trimmedArgs) if err != nil { // Unable to find the real command. E.g., someInvalidCmd - return c, []string{}, ShellCompDirectiveDefault, fmt.Errorf("Unable to find a command for arguments: %v", trimmedArgs) - } - - // Check if we are doing flag value completion before parsing the flags. - // This is important because if we are completing a flag value, we need to also - // remove the flag name argument from the list of finalArgs or else the parsing - // could fail due to an invalid value (incomplete) for the flag. - flag, finalArgs, toComplete, err := checkIfFlagCompletion(finalCmd, finalArgs, toComplete) - if err != nil { - // Error while attempting to parse flags - return finalCmd, []string{}, ShellCompDirectiveDefault, err - } - - // Parse the flags early so we can check if required flags are set - if err = finalCmd.ParseFlags(finalArgs); err != nil { - return finalCmd, []string{}, ShellCompDirectiveDefault, fmt.Errorf("Error while parsing flags from args %v: %s", finalArgs, err.Error()) - } - - if flag != nil { - // Check if we are completing a flag value subject to annotations - if validExts, present := flag.Annotations[BashCompFilenameExt]; present { - if len(validExts) != 0 { - // File completion filtered by extensions - return finalCmd, validExts, ShellCompDirectiveFilterFileExt, nil - } - - // The annotation requests simple file completion. There is no reason to do - // that since it is the default behavior anyway. Let's ignore this annotation - // in case the program also registered a completion function for this flag. - // Even though it is a mistake on the program's side, let's be nice when we can. - } - - if subDir, present := flag.Annotations[BashCompSubdirsInDir]; present { - if len(subDir) == 1 { - // Directory completion from within a directory - return finalCmd, subDir, ShellCompDirectiveFilterDirs, nil - } - // Directory completion - return finalCmd, []string{}, ShellCompDirectiveFilterDirs, nil - } + return c, completions, ShellCompDirectiveDefault, fmt.Errorf("Unable to find a command for arguments: %v", trimmedArgs) } // When doing completion of a flag name, as soon as an argument starts with // a '-' we know it is a flag. We cannot use isFlagArg() here as it requires - // the flag name to be complete - if flag == nil && len(toComplete) > 0 && toComplete[0] == '-' && !strings.Contains(toComplete, "=") { - var completions []string - - // First check for required flags - completions = completeRequireFlags(finalCmd, toComplete) - - // If we have not found any required flags, only then can we show regular flags - if len(completions) == 0 { - doCompleteFlags := func(flag *pflag.Flag) { - if !flag.Changed || - strings.Contains(flag.Value.Type(), "Slice") || - strings.Contains(flag.Value.Type(), "Array") { - // If the flag is not already present, or if it can be specified multiple times (Array or Slice) - // we suggest it as a completion - completions = append(completions, getFlagNameCompletions(flag, toComplete)...) - } + // the flag to be complete + if len(toComplete) > 0 && toComplete[0] == '-' && !strings.Contains(toComplete, "=") { + // We are completing a flag name + finalCmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) { + completions = append(completions, getFlagNameCompletions(flag, toComplete)...) + }) + finalCmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) { + completions = append(completions, getFlagNameCompletions(flag, toComplete)...) + }) + + directive := ShellCompDirectiveDefault + if len(completions) > 0 { + if strings.HasSuffix(completions[0], "=") { + directive = ShellCompDirectiveNoSpace } - - // We cannot use finalCmd.Flags() because we may not have called ParsedFlags() for commands - // that have set DisableFlagParsing; it is ParseFlags() that merges the inherited and - // non-inherited flags. - finalCmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) { - doCompleteFlags(flag) - }) - finalCmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) { - doCompleteFlags(flag) - }) - } - - directive := ShellCompDirectiveNoFileComp - if len(completions) == 1 && strings.HasSuffix(completions[0], "=") { - // If there is a single completion, the shell usually adds a space - // after the completion. We don't want that if the flag ends with an = - directive = ShellCompDirectiveNoSpace } return finalCmd, completions, directive, nil } - // We only remove the flags from the arguments if DisableFlagParsing is not set. - // This is important for commands which have requested to do their own flag completion. + var flag *pflag.Flag if !finalCmd.DisableFlagParsing { - finalArgs = finalCmd.Flags().Args() + // We only do flag completion if we are allowed to parse flags + // This is important for commands which have requested to do their own flag completion. + flag, finalArgs, toComplete, err = checkIfFlagCompletion(finalCmd, finalArgs, toComplete) + if err != nil { + // Error while attempting to parse flags + return finalCmd, completions, ShellCompDirectiveDefault, err + } } - var completions []string - directive := ShellCompDirectiveDefault if flag == nil { - foundLocalNonPersistentFlag := false - // If TraverseChildren is true on the root command we don't check for - // local flags because we can use a local flag on a parent command - if !finalCmd.Root().TraverseChildren { - // Check if there are any local, non-persistent flags on the command-line - localNonPersistentFlags := finalCmd.LocalNonPersistentFlags() - finalCmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) { - if localNonPersistentFlags.Lookup(flag.Name) != nil && flag.Changed { - foundLocalNonPersistentFlag = true - } - }) - } - - // Complete subcommand names, including the help command - if len(finalArgs) == 0 && !foundLocalNonPersistentFlag { - // We only complete sub-commands if: - // - there are no arguments on the command-line and - // - there are no local, non-peristent flag on the command-line or TraverseChildren is true - for _, subCmd := range finalCmd.Commands() { - if subCmd.IsAvailableCommand() || subCmd == finalCmd.helpCommand { - if strings.HasPrefix(subCmd.Name(), toComplete) { - completions = append(completions, fmt.Sprintf("%s\t%s", subCmd.Name(), subCmd.Short)) - } - directive = ShellCompDirectiveNoFileComp - } + // Complete subcommand names + for _, subCmd := range finalCmd.Commands() { + if subCmd.IsAvailableCommand() && strings.HasPrefix(subCmd.Name(), toComplete) { + completions = append(completions, fmt.Sprintf("%s\t%s", subCmd.Name(), subCmd.Short)) } } - // Complete required flags even without the '-' prefix - completions = append(completions, completeRequireFlags(finalCmd, toComplete)...) - - // Always complete ValidArgs, even if we are completing a subcommand name. - // This is for commands that have both subcommands and ValidArgs. if len(finalCmd.ValidArgs) > 0 { - if len(finalArgs) == 0 { - // ValidArgs are only for the first argument - for _, validArg := range finalCmd.ValidArgs { - if strings.HasPrefix(validArg, toComplete) { - completions = append(completions, validArg) - } - } - directive = ShellCompDirectiveNoFileComp - - // If no completions were found within commands or ValidArgs, - // see if there are any ArgAliases that should be completed. - if len(completions) == 0 { - for _, argAlias := range finalCmd.ArgAliases { - if strings.HasPrefix(argAlias, toComplete) { - completions = append(completions, argAlias) - } - } + // Always complete ValidArgs, even if we are completing a subcommand name. + // This is for commands that have both subcommands and ValidArgs. + for _, validArg := range finalCmd.ValidArgs { + if strings.HasPrefix(validArg, toComplete) { + completions = append(completions, validArg) } } // If there are ValidArgs specified (even if they don't match), we stop completion. // Only one of ValidArgs or ValidArgsFunction can be used for a single command. - return finalCmd, completions, directive, nil + return finalCmd, completions, ShellCompDirectiveNoFileComp, nil } - // Let the logic continue so as to add any ValidArgsFunction completions, + // Always let the logic continue so as to add any ValidArgsFunction completions, // even if we already found sub-commands. // This is for commands that have subcommands but also specify a ValidArgsFunction. } + // Parse the flags and extract the arguments to prepare for calling the completion function + if err = finalCmd.ParseFlags(finalArgs); err != nil { + return finalCmd, completions, ShellCompDirectiveDefault, fmt.Errorf("Error while parsing flags from args %v: %s", finalArgs, err.Error()) + } + + // We only remove the flags from the arguments if DisableFlagParsing is not set. + // This is important for commands which have requested to do their own flag completion. + if !finalCmd.DisableFlagParsing { + finalArgs = finalCmd.Flags().Args() + } + // Find the completion function for the flag or command var completionFn func(cmd *Command, args []string, toComplete string) ([]string, ShellCompDirective) if flag != nil { @@ -356,14 +227,14 @@ func (c *Command) getCompletions(args []string) (*Command, []string, ShellCompDi } else { completionFn = finalCmd.ValidArgsFunction } - if completionFn != nil { - // Go custom completion defined for this flag or command. - // Call the registered completion function to get the completions. - var comps []string - comps, directive = completionFn(finalCmd, finalArgs, toComplete) - completions = append(completions, comps...) + if completionFn == nil { + // Go custom completion not supported/needed for this flag or command + return finalCmd, completions, ShellCompDirectiveDefault, nil } + // Call the registered completion function to get the completions + comps, directive := completionFn(finalCmd, finalArgs, toComplete) + completions = append(completions, comps...) return finalCmd, completions, directive, nil } @@ -378,18 +249,11 @@ func getFlagNameCompletions(flag *pflag.Flag, toComplete string) []string { // Flag without the = completions = append(completions, fmt.Sprintf("%s\t%s", flagName, flag.Usage)) - // Why suggest both long forms: --flag and --flag= ? - // This forces the user to *always* have to type either an = or a space after the flag name. - // Let's be nice and avoid making users have to do that. - // Since boolean flags and shortname flags don't show the = form, let's go that route and never show it. - // The = form will still work, we just won't suggest it. - // This also makes the list of suggested flags shorter as we avoid all the = forms. - // - // if len(flag.NoOptDefVal) == 0 { - // // Flag requires a value, so it can be suffixed with = - // flagName += "=" - // completions = append(completions, fmt.Sprintf("%s\t%s", flagName, flag.Usage)) - // } + if len(flag.NoOptDefVal) == 0 { + // Flag requires a value, so it can be suffixed with = + flagName += "=" + completions = append(completions, fmt.Sprintf("%s\t%s", flagName, flag.Usage)) + } } flagName = "-" + flag.Shorthand @@ -400,54 +264,17 @@ func getFlagNameCompletions(flag *pflag.Flag, toComplete string) []string { return completions } -func completeRequireFlags(finalCmd *Command, toComplete string) []string { - var completions []string - - doCompleteRequiredFlags := func(flag *pflag.Flag) { - if _, present := flag.Annotations[BashCompOneRequiredFlag]; present { - if !flag.Changed { - // If the flag is not already present, we suggest it as a completion - completions = append(completions, getFlagNameCompletions(flag, toComplete)...) - } - } - } - - // We cannot use finalCmd.Flags() because we may not have called ParsedFlags() for commands - // that have set DisableFlagParsing; it is ParseFlags() that merges the inherited and - // non-inherited flags. - finalCmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) { - doCompleteRequiredFlags(flag) - }) - finalCmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) { - doCompleteRequiredFlags(flag) - }) - - return completions -} - func checkIfFlagCompletion(finalCmd *Command, args []string, lastArg string) (*pflag.Flag, []string, string, error) { - if finalCmd.DisableFlagParsing { - // We only do flag completion if we are allowed to parse flags - // This is important for commands which have requested to do their own flag completion. - return nil, args, lastArg, nil - } - var flagName string trimmedArgs := args flagWithEqual := false - - // When doing completion of a flag name, as soon as an argument starts with - // a '-' we know it is a flag. We cannot use isFlagArg() here as that function - // requires the flag name to be complete - if len(lastArg) > 0 && lastArg[0] == '-' { + if isFlagArg(lastArg) { if index := strings.Index(lastArg, "="); index >= 0 { - // Flag with an = flagName = strings.TrimLeft(lastArg[:index], "-") lastArg = lastArg[index+1:] flagWithEqual = true } else { - // Normal flag completion - return nil, args, lastArg, nil + return nil, nil, "", errors.New("Unexpected completion request for flag") } } @@ -527,13 +354,13 @@ func CompDebug(msg string, printToStdErr bool) { os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err == nil { defer f.Close() - WriteStringAndCheck(f, msg) + f.WriteString(msg) } } if printToStdErr { // Must print to stderr for this not to be read by the completion script. - fmt.Fprint(os.Stderr, msg) + fmt.Fprintf(os.Stderr, msg) } } diff --git a/vendor/github.com/spf13/cobra/fish_completions.go b/vendor/github.com/spf13/cobra/fish_completions.go index 3e112347d7..c83609c83b 100644 --- a/vendor/github.com/spf13/cobra/fish_completions.go +++ b/vendor/github.com/spf13/cobra/fish_completions.go @@ -5,21 +5,15 @@ import ( "fmt" "io" "os" - "strings" ) -func genFishComp(buf io.StringWriter, name string, includeDesc bool) { - // Variables should not contain a '-' or ':' character - nameForVar := name - nameForVar = strings.Replace(nameForVar, "-", "_", -1) - nameForVar = strings.Replace(nameForVar, ":", "_", -1) - +func genFishComp(buf *bytes.Buffer, name string, includeDesc bool) { compCmd := ShellCompRequestCmd if !includeDesc { compCmd = ShellCompNoDescRequestCmd } - WriteStringAndCheck(buf, fmt.Sprintf("# fish completion for %-36s -*- shell-script -*-\n", name)) - WriteStringAndCheck(buf, fmt.Sprintf(` + buf.WriteString(fmt.Sprintf("# fish completion for %-36s -*- shell-script -*-\n", name)) + buf.WriteString(fmt.Sprintf(` function __%[1]s_debug set file "$BASH_COMP_DEBUG_FILE" if test -n "$file" @@ -43,13 +37,7 @@ function __%[1]s_perform_completion end __%[1]s_debug "emptyArg: $emptyArg" - if not type -q "$args[1]" - # This can happen when "complete --do-complete %[2]s" is called when running this script. - __%[1]s_debug "Cannot find $args[1]. No completions." - return - end - - set requestComp "$args[1] %[3]s $args[2..-1] $emptyArg" + set requestComp "$args[1] %[2]s $args[2..-1] $emptyArg" __%[1]s_debug "Calling $requestComp" set results (eval $requestComp 2> /dev/null) @@ -83,8 +71,7 @@ function __%[1]s_prepare_completions # Check if the command-line is already provided. This is useful for testing. if not set --query __%[1]s_comp_commandLine - # Use the -c flag to allow for completion in the middle of the line - set __%[1]s_comp_commandLine (commandline -c) + set __%[1]s_comp_commandLine (commandline) end __%[1]s_debug "commandLine is: $__%[1]s_comp_commandLine" @@ -96,7 +83,7 @@ function __%[1]s_prepare_completions __%[1]s_debug "No completion, probably due to a failure" # Might as well do file completion, in case it helps set --global __%[1]s_comp_do_file_comp 1 - return 1 + return 0 end set directive (string sub --start 2 $results[-1]) @@ -105,35 +92,20 @@ function __%[1]s_prepare_completions __%[1]s_debug "Completions are: $__%[1]s_comp_results" __%[1]s_debug "Directive is: $directive" - set shellCompDirectiveError %[4]d - set shellCompDirectiveNoSpace %[5]d - set shellCompDirectiveNoFileComp %[6]d - set shellCompDirectiveFilterFileExt %[7]d - set shellCompDirectiveFilterDirs %[8]d - if test -z "$directive" set directive 0 end - set compErr (math (math --scale 0 $directive / $shellCompDirectiveError) %% 2) + set compErr (math (math --scale 0 $directive / %[3]d) %% 2) if test $compErr -eq 1 __%[1]s_debug "Received error directive: aborting." # Might as well do file completion, in case it helps set --global __%[1]s_comp_do_file_comp 1 - return 1 + return 0 end - set filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) %% 2) - set dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) %% 2) - if test $filefilter -eq 1; or test $dirfilter -eq 1 - __%[1]s_debug "File extension filtering or directory filtering not supported" - # Do full file completion instead - set --global __%[1]s_comp_do_file_comp 1 - return 1 - end - - set nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) %% 2) - set nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) %% 2) + set nospace (math (math --scale 0 $directive / %[4]d) %% 2) + set nofiles (math (math --scale 0 $directive / %[5]d) %% 2) __%[1]s_debug "nospace: $nospace, nofiles: $nofiles" @@ -160,31 +132,24 @@ function __%[1]s_prepare_completions return (not set --query __%[1]s_comp_do_file_comp) end -# Since Fish completions are only loaded once the user triggers them, we trigger them ourselves -# so we can properly delete any completions provided by another script. -# The space after the the program name is essential to trigger completion for the program -# and not completion of the program name itself. -complete --do-complete "%[2]s " > /dev/null 2>&1 -# Using '> /dev/null 2>&1' since '&>' is not supported in older versions of fish. - -# Remove any pre-existing completions for the program since we will be handling all of them. -complete -c %[2]s -e +# Remove any pre-existing completions for the program since we will be handling all of them +# TODO this cleanup is not sufficient. Fish completions are only loaded once the user triggers +# them, so the below deletion will not work as it is run too early. What else can we do? +complete -c %[1]s -e # The order in which the below two lines are defined is very important so that __%[1]s_prepare_completions # is called first. It is __%[1]s_prepare_completions that sets up the __%[1]s_comp_do_file_comp variable. # # This completion will be run second as complete commands are added FILO. # It triggers file completion choices when __%[1]s_comp_do_file_comp is set. -complete -c %[2]s -n 'set --query __%[1]s_comp_do_file_comp' +complete -c %[1]s -n 'set --query __%[1]s_comp_do_file_comp' # This completion will be run first as complete commands are added FILO. -# The call to __%[1]s_prepare_completions will setup both __%[1]s_comp_results and __%[1]s_comp_do_file_comp. +# The call to __%[1]s_prepare_completions will setup both __%[1]s_comp_results abd __%[1]s_comp_do_file_comp. # It provides the program's completion choices. -complete -c %[2]s -n '__%[1]s_prepare_completions' -f -a '$__%[1]s_comp_results' +complete -c %[1]s -n '__%[1]s_prepare_completions' -f -a '$__%[1]s_comp_results' -`, nameForVar, name, compCmd, - ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp, - ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs)) +`, name, compCmd, ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp)) } // GenFishCompletion generates fish completion file and writes to the passed writer. diff --git a/vendor/github.com/spf13/cobra/fish_completions.md b/vendor/github.com/spf13/cobra/fish_completions.md index 19b2ed1293..6bfe5f88ef 100644 --- a/vendor/github.com/spf13/cobra/fish_completions.md +++ b/vendor/github.com/spf13/cobra/fish_completions.md @@ -1,4 +1,7 @@ -## Generating Fish Completions For Your cobra.Command +## Generating Fish Completions for your own cobra.Command -Please refer to [Shell Completions](shell_completions.md) for details. +Cobra supports native Fish completions generated from the root `cobra.Command`. You can use the `command.GenFishCompletion()` or `command.GenFishCompletionFile()` functions. You must provide these functions with a parameter indicating if the completions should be annotated with a description; Cobra will provide the description automatically based on usage information. You can choose to make this option configurable by your users. +### Limitations + +* Custom completions implemented using the `ValidArgsFunction` and `RegisterFlagCompletionFunc()` are supported automatically but the ones implemented in Bash scripting are not. diff --git a/vendor/github.com/spf13/cobra/go.mod b/vendor/github.com/spf13/cobra/go.mod index ff56144056..dea1030ba4 100644 --- a/vendor/github.com/spf13/cobra/go.mod +++ b/vendor/github.com/spf13/cobra/go.mod @@ -6,7 +6,7 @@ require ( github.com/cpuguy83/go-md2man/v2 v2.0.0 github.com/inconshreveable/mousetrap v1.0.0 github.com/mitchellh/go-homedir v1.1.0 - github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.7.0 - gopkg.in/yaml.v2 v2.4.0 + github.com/spf13/pflag v1.0.3 + github.com/spf13/viper v1.4.0 + gopkg.in/yaml.v2 v2.2.2 ) diff --git a/vendor/github.com/spf13/cobra/go.sum b/vendor/github.com/spf13/cobra/go.sum index 9328ee3ee7..3aaa2ac0fd 100644 --- a/vendor/github.com/spf13/cobra/go.sum +++ b/vendor/github.com/spf13/cobra/go.sum @@ -1,48 +1,28 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= @@ -52,55 +32,19 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -111,34 +55,20 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -149,18 +79,11 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -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= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= @@ -169,145 +92,58 @@ github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.7.0 h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/spf13/viper v1.4.0 h1:yXHLWeravcrgGyFSyCgdYpXQ9dR9c/WED3pg1RhxqEU= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/vendor/github.com/spf13/cobra/powershell_completions.go b/vendor/github.com/spf13/cobra/powershell_completions.go index c55be71cd1..756c61b9dc 100644 --- a/vendor/github.com/spf13/cobra/powershell_completions.go +++ b/vendor/github.com/spf13/cobra/powershell_completions.go @@ -1,3 +1,6 @@ +// PowerShell completions are based on the amazing work from clap: +// https://github.com/clap-rs/clap/blob/3294d18efe5f264d12c9035f404c7d189d4824e1/src/completions/powershell.rs +// // The generated scripts require PowerShell v5.0+ (which comes Windows 10, but // can be downloaded separately for windows 7 or 8.1). @@ -8,278 +11,90 @@ import ( "fmt" "io" "os" -) - -func genPowerShellComp(buf io.StringWriter, name string, includeDesc bool) { - compCmd := ShellCompRequestCmd - if !includeDesc { - compCmd = ShellCompNoDescRequestCmd - } - WriteStringAndCheck(buf, fmt.Sprintf(`# powershell completion for %-36[1]s -*- shell-script -*- - -function __%[1]s_debug { - if ($env:BASH_COMP_DEBUG_FILE) { - "$args" | Out-File -Append -FilePath "$env:BASH_COMP_DEBUG_FILE" - } -} - -filter __%[1]s_escapeStringWithSpecialChars { -`+" $_ -replace '\\s|#|@|\\$|;|,|''|\\{|\\}|\\(|\\)|\"|`|\\||<|>|&','`$&'"+` -} - -Register-ArgumentCompleter -CommandName '%[1]s' -ScriptBlock { - param( - $WordToComplete, - $CommandAst, - $CursorPosition - ) - - # Get the current command line and convert into a string - $Command = $CommandAst.CommandElements - $Command = "$Command" - - __%[1]s_debug "" - __%[1]s_debug "========= starting completion logic ==========" - __%[1]s_debug "WordToComplete: $WordToComplete Command: $Command CursorPosition: $CursorPosition" - - # The user could have moved the cursor backwards on the command-line. - # We need to trigger completion from the $CursorPosition location, so we need - # to truncate the command-line ($Command) up to the $CursorPosition location. - # Make sure the $Command is longer then the $CursorPosition before we truncate. - # This happens because the $Command does not include the last space. - if ($Command.Length -gt $CursorPosition) { - $Command=$Command.Substring(0,$CursorPosition) - } - __%[1]s_debug "Truncated command: $Command" - - $ShellCompDirectiveError=%[3]d - $ShellCompDirectiveNoSpace=%[4]d - $ShellCompDirectiveNoFileComp=%[5]d - $ShellCompDirectiveFilterFileExt=%[6]d - $ShellCompDirectiveFilterDirs=%[7]d - - # Prepare the command to request completions for the program. - # Split the command at the first space to separate the program and arguments. - $Program,$Arguments = $Command.Split(" ",2) - $RequestComp="$Program %[2]s $Arguments" - __%[1]s_debug "RequestComp: $RequestComp" - - # we cannot use $WordToComplete because it - # has the wrong values if the cursor was moved - # so use the last argument - if ($WordToComplete -ne "" ) { - $WordToComplete = $Arguments.Split(" ")[-1] - } - __%[1]s_debug "New WordToComplete: $WordToComplete" - - - # Check for flag with equal sign - $IsEqualFlag = ($WordToComplete -Like "--*=*" ) - if ( $IsEqualFlag ) { - __%[1]s_debug "Completing equal sign flag" - # Remove the flag part - $Flag,$WordToComplete = $WordToComplete.Split("=",2) - } - - if ( $WordToComplete -eq "" -And ( -Not $IsEqualFlag )) { - # If the last parameter is complete (there is a space following it) - # We add an extra empty parameter so we can indicate this to the go method. - __%[1]s_debug "Adding extra empty parameter" -`+" # We need to use `\"`\" to pass an empty argument a \"\" or '' does not work!!!"+` -`+" $RequestComp=\"$RequestComp\" + ' `\"`\"' "+` - } - - __%[1]s_debug "Calling $RequestComp" - #call the command store the output in $out and redirect stderr and stdout to null - # $Out is an array contains each line per element - Invoke-Expression -OutVariable out "$RequestComp" 2>&1 | Out-Null + "strings" + "github.com/spf13/pflag" +) - # get directive from last line - [int]$Directive = $Out[-1].TrimStart(':') - if ($Directive -eq "") { - # There is no directive specified - $Directive = 0 - } - __%[1]s_debug "The completion directive is: $Directive" - - # remove directive (last element) from out - $Out = $Out | Where-Object { $_ -ne $Out[-1] } - __%[1]s_debug "The completions are: $Out" - - if (($Directive -band $ShellCompDirectiveError) -ne 0 ) { - # Error code. No completion. - __%[1]s_debug "Received error from custom completion go code" - return - } - - $Longest = 0 - $Values = $Out | ForEach-Object { - #Split the output in name and description -`+" $Name, $Description = $_.Split(\"`t\",2)"+` - __%[1]s_debug "Name: $Name Description: $Description" - - # Look for the longest completion so that we can format things nicely - if ($Longest -lt $Name.Length) { - $Longest = $Name.Length - } - - # Set the description to a one space string if there is none set. - # This is needed because the CompletionResult does not accept an empty string as argument - if (-Not $Description) { - $Description = " " - } - @{Name="$Name";Description="$Description"} - } - - - $Space = " " - if (($Directive -band $ShellCompDirectiveNoSpace) -ne 0 ) { - # remove the space here - __%[1]s_debug "ShellCompDirectiveNoSpace is called" - $Space = "" - } - - if (($Directive -band $ShellCompDirectiveNoFileComp) -ne 0 ) { - __%[1]s_debug "ShellCompDirectiveNoFileComp is called" - - if ($Values.Length -eq 0) { - # Just print an empty string here so the - # shell does not start to complete paths. - # We cannot use CompletionResult here because - # it does not accept an empty string as argument. - "" - return - } - } - - if ((($Directive -band $ShellCompDirectiveFilterFileExt) -ne 0 ) -or - (($Directive -band $ShellCompDirectiveFilterDirs) -ne 0 )) { - __%[1]s_debug "ShellCompDirectiveFilterFileExt ShellCompDirectiveFilterDirs are not supported" - - # return here to prevent the completion of the extensions - return - } - - $Values = $Values | Where-Object { - # filter the result - $_.Name -like "$WordToComplete*" - - # Join the flag back if we have a equal sign flag - if ( $IsEqualFlag ) { - __%[1]s_debug "Join the equal sign flag back to the completion value" - $_.Name = $Flag + "=" + $_.Name +var powerShellCompletionTemplate = `using namespace System.Management.Automation +using namespace System.Management.Automation.Language +Register-ArgumentCompleter -Native -CommandName '%s' -ScriptBlock { + param($wordToComplete, $commandAst, $cursorPosition) + $commandElements = $commandAst.CommandElements + $command = @( + '%s' + for ($i = 1; $i -lt $commandElements.Count; $i++) { + $element = $commandElements[$i] + if ($element -isnot [StringConstantExpressionAst] -or + $element.StringConstantType -ne [StringConstantType]::BareWord -or + $element.Value.StartsWith('-')) { + break + } + $element.Value } - } - - # Get the current mode - $Mode = (Get-PSReadLineKeyHandler | Where-Object {$_.Key -eq "Tab" }).Function - __%[1]s_debug "Mode: $Mode" - - $Values | ForEach-Object { - - # store temporay because switch will overwrite $_ - $comp = $_ - - # PowerShell supports three different completion modes - # - TabCompleteNext (default windows style - on each key press the next option is displayed) - # - Complete (works like bash) - # - MenuComplete (works like zsh) - # You set the mode with Set-PSReadLineKeyHandler -Key Tab -Function - - # CompletionResult Arguments: - # 1) CompletionText text to be used as the auto completion result - # 2) ListItemText text to be displayed in the suggestion list - # 3) ResultType type of completion result - # 4) ToolTip text for the tooltip with details about the object - - switch ($Mode) { - - # bash like - "Complete" { - - if ($Values.Length -eq 1) { - __%[1]s_debug "Only one completion left" - - # insert space after value - [System.Management.Automation.CompletionResult]::new($($comp.Name | __%[1]s_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") - - } else { - # Add the proper number of spaces to align the descriptions - while($comp.Name.Length -lt $Longest) { - $comp.Name = $comp.Name + " " - } - - # Check for empty description and only add parentheses if needed - if ($($comp.Description) -eq " " ) { - $Description = "" - } else { - $Description = " ($($comp.Description))" - } - - [System.Management.Automation.CompletionResult]::new("$($comp.Name)$Description", "$($comp.Name)$Description", 'ParameterValue', "$($comp.Description)") - } - } + ) -join ';' + $completions = @(switch ($command) {%s + }) + $completions.Where{ $_.CompletionText -like "$wordToComplete*" } | + Sort-Object -Property ListItemText +}` + +func generatePowerShellSubcommandCases(out io.Writer, cmd *Command, previousCommandName string) { + var cmdName string + if previousCommandName == "" { + cmdName = cmd.Name() + } else { + cmdName = fmt.Sprintf("%s;%s", previousCommandName, cmd.Name()) + } - # zsh like - "MenuComplete" { - # insert space after value - # MenuComplete will automatically show the ToolTip of - # the highlighted value at the bottom of the suggestions. - [System.Management.Automation.CompletionResult]::new($($comp.Name | __%[1]s_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") - } + fmt.Fprintf(out, "\n '%s' {", cmdName) + + cmd.Flags().VisitAll(func(flag *pflag.Flag) { + if nonCompletableFlag(flag) { + return + } + usage := escapeStringForPowerShell(flag.Usage) + if len(flag.Shorthand) > 0 { + fmt.Fprintf(out, "\n [CompletionResult]::new('-%s', '%s', [CompletionResultType]::ParameterName, '%s')", flag.Shorthand, flag.Shorthand, usage) + } + fmt.Fprintf(out, "\n [CompletionResult]::new('--%s', '%s', [CompletionResultType]::ParameterName, '%s')", flag.Name, flag.Name, usage) + }) + + for _, subCmd := range cmd.Commands() { + usage := escapeStringForPowerShell(subCmd.Short) + fmt.Fprintf(out, "\n [CompletionResult]::new('%s', '%s', [CompletionResultType]::ParameterValue, '%s')", subCmd.Name(), subCmd.Name(), usage) + } - # TabCompleteNext and in case we get something unknown - Default { - # Like MenuComplete but we don't want to add a space here because - # the user need to press space anyway to get the completion. - # Description will not be shown because thats not possible with TabCompleteNext - [System.Management.Automation.CompletionResult]::new($($comp.Name | __%[1]s_escapeStringWithSpecialChars), "$($comp.Name)", 'ParameterValue', "$($comp.Description)") - } - } + fmt.Fprint(out, "\n break\n }") - } + for _, subCmd := range cmd.Commands() { + generatePowerShellSubcommandCases(out, subCmd, cmdName) + } } -`, name, compCmd, - ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp, - ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs)) + +func escapeStringForPowerShell(s string) string { + return strings.Replace(s, "'", "''", -1) } -func (c *Command) genPowerShellCompletion(w io.Writer, includeDesc bool) error { +// GenPowerShellCompletion generates PowerShell completion file and writes to the passed writer. +func (c *Command) GenPowerShellCompletion(w io.Writer) error { buf := new(bytes.Buffer) - genPowerShellComp(buf, c.Name(), includeDesc) + + var subCommandCases bytes.Buffer + generatePowerShellSubcommandCases(&subCommandCases, c, "") + fmt.Fprintf(buf, powerShellCompletionTemplate, c.Name(), c.Name(), subCommandCases.String()) + _, err := buf.WriteTo(w) return err } -func (c *Command) genPowerShellCompletionFile(filename string, includeDesc bool) error { +// GenPowerShellCompletionFile generates PowerShell completion file. +func (c *Command) GenPowerShellCompletionFile(filename string) error { outFile, err := os.Create(filename) if err != nil { return err } defer outFile.Close() - return c.genPowerShellCompletion(outFile, includeDesc) -} - -// GenPowerShellCompletionFile generates powershell completion file without descriptions. -func (c *Command) GenPowerShellCompletionFile(filename string) error { - return c.genPowerShellCompletionFile(filename, false) -} - -// GenPowerShellCompletion generates powershell completion file without descriptions -// and writes it to the passed writer. -func (c *Command) GenPowerShellCompletion(w io.Writer) error { - return c.genPowerShellCompletion(w, false) -} - -// GenPowerShellCompletionFileWithDesc generates powershell completion file with descriptions. -func (c *Command) GenPowerShellCompletionFileWithDesc(filename string) error { - return c.genPowerShellCompletionFile(filename, true) -} - -// GenPowerShellCompletionWithDesc generates powershell completion file with descriptions -// and writes it to the passed writer. -func (c *Command) GenPowerShellCompletionWithDesc(w io.Writer) error { - return c.genPowerShellCompletion(w, true) + return c.GenPowerShellCompletion(outFile) } diff --git a/vendor/github.com/spf13/cobra/powershell_completions.md b/vendor/github.com/spf13/cobra/powershell_completions.md index c449f1e5c0..afed802408 100644 --- a/vendor/github.com/spf13/cobra/powershell_completions.md +++ b/vendor/github.com/spf13/cobra/powershell_completions.md @@ -1,3 +1,14 @@ # Generating PowerShell Completions For Your Own cobra.Command -Please refer to [Shell Completions](shell_completions.md#powershell-completions) for details. +Cobra can generate PowerShell completion scripts. Users need PowerShell version 5.0 or above, which comes with Windows 10 and can be downloaded separately for Windows 7 or 8.1. They can then write the completions to a file and source this file from their PowerShell profile, which is referenced by the `$Profile` environment variable. See `Get-Help about_Profiles` for more info about PowerShell profiles. + +# What's supported + +- Completion for subcommands using their `.Short` description +- Completion for non-hidden flags using their `.Name` and `.Shorthand` + +# What's not yet supported + +- Command aliases +- Required, filename or custom flags (they will work like normal flags) +- Custom completion scripts diff --git a/vendor/github.com/spf13/cobra/projects_using_cobra.md b/vendor/github.com/spf13/cobra/projects_using_cobra.md deleted file mode 100644 index d98a71e36f..0000000000 --- a/vendor/github.com/spf13/cobra/projects_using_cobra.md +++ /dev/null @@ -1,38 +0,0 @@ -## Projects using Cobra - -- [Arduino CLI](https://github.com/arduino/arduino-cli) -- [Bleve](http://www.blevesearch.com/) -- [CockroachDB](http://www.cockroachlabs.com/) -- [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) -- [Delve](https://github.com/derekparker/delve) -- [Docker (distribution)](https://github.com/docker/distribution) -- [Etcd](https://etcd.io/) -- [Gardener](https://github.com/gardener/gardenctl) -- [Giant Swarm's gsctl](https://github.com/giantswarm/gsctl) -- [Git Bump](https://github.com/erdaltsksn/git-bump) -- [Github CLI](https://github.com/cli/cli) -- [GitHub Labeler](https://github.com/erdaltsksn/gh-label) -- [Golangci-lint](https://golangci-lint.run) -- [GopherJS](http://www.gopherjs.org/) -- [Helm](https://helm.sh) -- [Hugo](https://gohugo.io) -- [Istio](https://istio.io) -- [Kool](https://github.com/kool-dev/kool) -- [Kubernetes](http://kubernetes.io/) -- [Linkerd](https://linkerd.io/) -- [Mattermost-server](https://github.com/mattermost/mattermost-server) -- [Metal Stack CLI](https://github.com/metal-stack/metalctl) -- [Moby (former Docker)](https://github.com/moby/moby) -- [Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack) -- [OpenShift](https://www.openshift.com/) -- [Ory Hydra](https://github.com/ory/hydra) -- [Ory Kratos](https://github.com/ory/kratos) -- [Pouch](https://github.com/alibaba/pouch) -- [ProjectAtomic (enterprise)](http://www.projectatomic.io/) -- [Prototool](https://github.com/uber/prototool) -- [Random](https://github.com/erdaltsksn/random) -- [Rclone](https://rclone.org/) -- [Skaffold](https://skaffold.dev/) -- [Tendermint](https://github.com/tendermint/tendermint) -- [Twitch CLI](https://github.com/twitchdev/twitch-cli) -- [Werf](https://werf.io/) diff --git a/vendor/github.com/spf13/cobra/shell_completions.go b/vendor/github.com/spf13/cobra/shell_completions.go index d99bf91e5f..ba0af9cb55 100644 --- a/vendor/github.com/spf13/cobra/shell_completions.go +++ b/vendor/github.com/spf13/cobra/shell_completions.go @@ -4,81 +4,82 @@ import ( "github.com/spf13/pflag" ) -// MarkFlagRequired instructs the various shell completion implementations to -// prioritize the named flag when performing completion, +// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag if it exists, // and causes your command to report an error if invoked without the flag. func (c *Command) MarkFlagRequired(name string) error { return MarkFlagRequired(c.Flags(), name) } -// MarkPersistentFlagRequired instructs the various shell completion implementations to -// prioritize the named persistent flag when performing completion, +// MarkPersistentFlagRequired adds the BashCompOneRequiredFlag annotation to the named persistent flag if it exists, // and causes your command to report an error if invoked without the flag. func (c *Command) MarkPersistentFlagRequired(name string) error { return MarkFlagRequired(c.PersistentFlags(), name) } -// MarkFlagRequired instructs the various shell completion implementations to -// prioritize the named flag when performing completion, +// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag if it exists, // and causes your command to report an error if invoked without the flag. func MarkFlagRequired(flags *pflag.FlagSet, name string) error { return flags.SetAnnotation(name, BashCompOneRequiredFlag, []string{"true"}) } -// MarkFlagFilename instructs the various shell completion implementations to -// limit completions for the named flag to the specified file extensions. +// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag, if it exists. +// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided. func (c *Command) MarkFlagFilename(name string, extensions ...string) error { return MarkFlagFilename(c.Flags(), name, extensions...) } // MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists. -// The bash completion script will call the bash function f for the flag. -// -// This will only work for bash completion. -// It is recommended to instead use c.RegisterFlagCompletionFunc(...) which allows -// to register a Go function which will work across all shells. +// Generated bash autocompletion will call the bash function f for the flag. func (c *Command) MarkFlagCustom(name string, f string) error { return MarkFlagCustom(c.Flags(), name, f) } // MarkPersistentFlagFilename instructs the various shell completion -// implementations to limit completions for the named persistent flag to the -// specified file extensions. +// implementations to limit completions for this persistent flag to the +// specified extensions (patterns). +// +// Shell Completion compatibility matrix: bash, zsh func (c *Command) MarkPersistentFlagFilename(name string, extensions ...string) error { return MarkFlagFilename(c.PersistentFlags(), name, extensions...) } // MarkFlagFilename instructs the various shell completion implementations to -// limit completions for the named flag to the specified file extensions. +// limit completions for this flag to the specified extensions (patterns). +// +// Shell Completion compatibility matrix: bash, zsh func MarkFlagFilename(flags *pflag.FlagSet, name string, extensions ...string) error { return flags.SetAnnotation(name, BashCompFilenameExt, extensions) } -// MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists. -// The bash completion script will call the bash function f for the flag. +// MarkFlagCustom instructs the various shell completion implementations to +// limit completions for this flag to the specified extensions (patterns). // -// This will only work for bash completion. -// It is recommended to instead use c.RegisterFlagCompletionFunc(...) which allows -// to register a Go function which will work across all shells. +// Shell Completion compatibility matrix: bash, zsh func MarkFlagCustom(flags *pflag.FlagSet, name string, f string) error { return flags.SetAnnotation(name, BashCompCustom, []string{f}) } // MarkFlagDirname instructs the various shell completion implementations to -// limit completions for the named flag to directory names. +// complete only directories with this named flag. +// +// Shell Completion compatibility matrix: zsh func (c *Command) MarkFlagDirname(name string) error { return MarkFlagDirname(c.Flags(), name) } // MarkPersistentFlagDirname instructs the various shell completion -// implementations to limit completions for the named persistent flag to -// directory names. +// implementations to complete only directories with this persistent named flag. +// +// Shell Completion compatibility matrix: zsh func (c *Command) MarkPersistentFlagDirname(name string) error { return MarkFlagDirname(c.PersistentFlags(), name) } // MarkFlagDirname instructs the various shell completion implementations to -// limit completions for the named flag to directory names. +// complete only directories with this specified flag. +// +// Shell Completion compatibility matrix: zsh func MarkFlagDirname(flags *pflag.FlagSet, name string) error { - return flags.SetAnnotation(name, BashCompSubdirsInDir, []string{}) + zshPattern := "-(/)" + return flags.SetAnnotation(name, zshCompDirname, []string{zshPattern}) } diff --git a/vendor/github.com/spf13/cobra/shell_completions.md b/vendor/github.com/spf13/cobra/shell_completions.md deleted file mode 100644 index cd533ac3d4..0000000000 --- a/vendor/github.com/spf13/cobra/shell_completions.md +++ /dev/null @@ -1,483 +0,0 @@ -# Generating shell completions - -Cobra can generate shell completions for multiple shells. -The currently supported shells are: -- Bash -- Zsh -- fish -- PowerShell - -If you are using the generator, you can create a completion command by running - -```bash -cobra add completion -``` -and then modifying the generated `cmd/completion.go` file to look something like this -(writing the shell script to stdout allows the most flexible use): - -```go -var completionCmd = &cobra.Command{ - Use: "completion [bash|zsh|fish|powershell]", - Short: "Generate completion script", - Long: `To load completions: - -Bash: - - $ source <(yourprogram completion bash) - - # To load completions for each session, execute once: - # Linux: - $ yourprogram completion bash > /etc/bash_completion.d/yourprogram - # macOS: - $ yourprogram completion bash > /usr/local/etc/bash_completion.d/yourprogram - -Zsh: - - # If shell completion is not already enabled in your environment, - # you will need to enable it. You can execute the following once: - - $ echo "autoload -U compinit; compinit" >> ~/.zshrc - - # To load completions for each session, execute once: - $ yourprogram completion zsh > "${fpath[1]}/_yourprogram" - - # You will need to start a new shell for this setup to take effect. - -fish: - - $ yourprogram completion fish | source - - # To load completions for each session, execute once: - $ yourprogram completion fish > ~/.config/fish/completions/yourprogram.fish - -PowerShell: - - PS> yourprogram completion powershell | Out-String | Invoke-Expression - - # To load completions for every new session, run: - PS> yourprogram completion powershell > yourprogram.ps1 - # and source this file from your PowerShell profile. -`, - DisableFlagsInUseLine: true, - ValidArgs: []string{"bash", "zsh", "fish", "powershell"}, - Args: cobra.ExactValidArgs(1), - Run: func(cmd *cobra.Command, args []string) { - switch args[0] { - case "bash": - cmd.Root().GenBashCompletion(os.Stdout) - case "zsh": - cmd.Root().GenZshCompletion(os.Stdout) - case "fish": - cmd.Root().GenFishCompletion(os.Stdout, true) - case "powershell": - cmd.Root().GenPowerShellCompletion(os.Stdout) - } - }, -} -``` - -**Note:** The cobra generator may include messages printed to stdout, for example, if the config file is loaded; this will break the auto-completion script so must be removed. - -# Customizing completions - -The generated completion scripts will automatically handle completing commands and flags. However, you can make your completions much more powerful by providing information to complete your program's nouns and flag values. - -## Completion of nouns - -### Static completion of nouns - -Cobra allows you to provide a pre-defined list of completion choices for your nouns using the `ValidArgs` field. -For example, if you want `kubectl get [tab][tab]` to show a list of valid "nouns" you have to set them. -Some simplified code from `kubectl get` looks like: - -```go -validArgs []string = { "pod", "node", "service", "replicationcontroller" } - -cmd := &cobra.Command{ - Use: "get [(-o|--output=)json|yaml|template|...] (RESOURCE [NAME] | RESOURCE/NAME ...)", - Short: "Display one or many resources", - Long: get_long, - Example: get_example, - Run: func(cmd *cobra.Command, args []string) { - cobra.CheckErr(RunGet(f, out, cmd, args)) - }, - ValidArgs: validArgs, -} -``` - -Notice we put the `ValidArgs` field on the `get` sub-command. Doing so will give results like: - -```bash -$ kubectl get [tab][tab] -node pod replicationcontroller service -``` - -#### Aliases for nouns - -If your nouns have aliases, you can define them alongside `ValidArgs` using `ArgAliases`: - -```go -argAliases []string = { "pods", "nodes", "services", "svc", "replicationcontrollers", "rc" } - -cmd := &cobra.Command{ - ... - ValidArgs: validArgs, - ArgAliases: argAliases -} -``` - -The aliases are not shown to the user on tab completion, but they are accepted as valid nouns by -the completion algorithm if entered manually, e.g. in: - -```bash -$ kubectl get rc [tab][tab] -backend frontend database -``` - -Note that without declaring `rc` as an alias, the completion algorithm would not know to show the list of -replication controllers following `rc`. - -### Dynamic completion of nouns - -In some cases it is not possible to provide a list of completions in advance. Instead, the list of completions must be determined at execution-time. In a similar fashion as for static completions, you can use the `ValidArgsFunction` field to provide a Go function that Cobra will execute when it needs the list of completion choices for the nouns of a command. Note that either `ValidArgs` or `ValidArgsFunction` can be used for a single cobra command, but not both. -Simplified code from `helm status` looks like: - -```go -cmd := &cobra.Command{ - Use: "status RELEASE_NAME", - Short: "Display the status of the named release", - Long: status_long, - RunE: func(cmd *cobra.Command, args []string) { - RunGet(args[0]) - }, - ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { - if len(args) != 0 { - return nil, cobra.ShellCompDirectiveNoFileComp - } - return getReleasesFromCluster(toComplete), cobra.ShellCompDirectiveNoFileComp - }, -} -``` -Where `getReleasesFromCluster()` is a Go function that obtains the list of current Helm releases running on the Kubernetes cluster. -Notice we put the `ValidArgsFunction` on the `status` sub-command. Let's assume the Helm releases on the cluster are: `harbor`, `notary`, `rook` and `thanos` then this dynamic completion will give results like: - -```bash -$ helm status [tab][tab] -harbor notary rook thanos -``` -You may have noticed the use of `cobra.ShellCompDirective`. These directives are bit fields allowing to control some shell completion behaviors for your particular completion. You can combine them with the bit-or operator such as `cobra.ShellCompDirectiveNoSpace | cobra.ShellCompDirectiveNoFileComp` -```go -// Indicates that the shell will perform its default behavior after completions -// have been provided (this implies none of the other directives). -ShellCompDirectiveDefault - -// Indicates an error occurred and completions should be ignored. -ShellCompDirectiveError - -// Indicates that the shell should not add a space after the completion, -// even if there is a single completion provided. -ShellCompDirectiveNoSpace - -// Indicates that the shell should not provide file completion even when -// no completion is provided. -ShellCompDirectiveNoFileComp - -// Indicates that the returned completions should be used as file extension filters. -// For example, to complete only files of the form *.json or *.yaml: -// return []string{"yaml", "json"}, ShellCompDirectiveFilterFileExt -// For flags, using MarkFlagFilename() and MarkPersistentFlagFilename() -// is a shortcut to using this directive explicitly. -// -ShellCompDirectiveFilterFileExt - -// Indicates that only directory names should be provided in file completion. -// For example: -// return nil, ShellCompDirectiveFilterDirs -// For flags, using MarkFlagDirname() is a shortcut to using this directive explicitly. -// -// To request directory names within another directory, the returned completions -// should specify a single directory name within which to search. For example, -// to complete directories within "themes/": -// return []string{"themes"}, ShellCompDirectiveFilterDirs -// -ShellCompDirectiveFilterDirs -``` - -***Note***: When using the `ValidArgsFunction`, Cobra will call your registered function after having parsed all flags and arguments provided in the command-line. You therefore don't need to do this parsing yourself. For example, when a user calls `helm status --namespace my-rook-ns [tab][tab]`, Cobra will call your registered `ValidArgsFunction` after having parsed the `--namespace` flag, as it would have done when calling the `RunE` function. - -#### Debugging - -Cobra achieves dynamic completion through the use of a hidden command called by the completion script. To debug your Go completion code, you can call this hidden command directly: -```bash -$ helm __complete status har -harbor -:4 -Completion ended with directive: ShellCompDirectiveNoFileComp # This is on stderr -``` -***Important:*** If the noun to complete is empty (when the user has not yet typed any letters of that noun), you must pass an empty parameter to the `__complete` command: -```bash -$ helm __complete status "" -harbor -notary -rook -thanos -:4 -Completion ended with directive: ShellCompDirectiveNoFileComp # This is on stderr -``` -Calling the `__complete` command directly allows you to run the Go debugger to troubleshoot your code. You can also add printouts to your code; Cobra provides the following functions to use for printouts in Go completion code: -```go -// Prints to the completion script debug file (if BASH_COMP_DEBUG_FILE -// is set to a file path) and optionally prints to stderr. -cobra.CompDebug(msg string, printToStdErr bool) { -cobra.CompDebugln(msg string, printToStdErr bool) - -// Prints to the completion script debug file (if BASH_COMP_DEBUG_FILE -// is set to a file path) and to stderr. -cobra.CompError(msg string) -cobra.CompErrorln(msg string) -``` -***Important:*** You should **not** leave traces that print directly to stdout in your completion code as they will be interpreted as completion choices by the completion script. Instead, use the cobra-provided debugging traces functions mentioned above. - -## Completions for flags - -### Mark flags as required - -Most of the time completions will only show sub-commands. But if a flag is required to make a sub-command work, you probably want it to show up when the user types [tab][tab]. You can mark a flag as 'Required' like so: - -```go -cmd.MarkFlagRequired("pod") -cmd.MarkFlagRequired("container") -``` - -and you'll get something like - -```bash -$ kubectl exec [tab][tab] --c --container= -p --pod= -``` - -### Specify dynamic flag completion - -As for nouns, Cobra provides a way of defining dynamic completion of flags. To provide a Go function that Cobra will execute when it needs the list of completion choices for a flag, you must register the function using the `command.RegisterFlagCompletionFunc()` function. - -```go -flagName := "output" -cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { - return []string{"json", "table", "yaml"}, cobra.ShellCompDirectiveDefault -}) -``` -Notice that calling `RegisterFlagCompletionFunc()` is done through the `command` with which the flag is associated. In our example this dynamic completion will give results like so: - -```bash -$ helm status --output [tab][tab] -json table yaml -``` - -#### Debugging - -You can also easily debug your Go completion code for flags: -```bash -$ helm __complete status --output "" -json -table -yaml -:4 -Completion ended with directive: ShellCompDirectiveNoFileComp # This is on stderr -``` -***Important:*** You should **not** leave traces that print to stdout in your completion code as they will be interpreted as completion choices by the completion script. Instead, use the cobra-provided debugging traces functions mentioned further above. - -### Specify valid filename extensions for flags that take a filename - -To limit completions of flag values to file names with certain extensions you can either use the different `MarkFlagFilename()` functions or a combination of `RegisterFlagCompletionFunc()` and `ShellCompDirectiveFilterFileExt`, like so: -```go -flagName := "output" -cmd.MarkFlagFilename(flagName, "yaml", "json") -``` -or -```go -flagName := "output" -cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { - return []string{"yaml", "json"}, ShellCompDirectiveFilterFileExt}) -``` - -### Limit flag completions to directory names - -To limit completions of flag values to directory names you can either use the `MarkFlagDirname()` functions or a combination of `RegisterFlagCompletionFunc()` and `ShellCompDirectiveFilterDirs`, like so: -```go -flagName := "output" -cmd.MarkFlagDirname(flagName) -``` -or -```go -flagName := "output" -cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { - return nil, cobra.ShellCompDirectiveFilterDirs -}) -``` -To limit completions of flag values to directory names *within another directory* you can use a combination of `RegisterFlagCompletionFunc()` and `ShellCompDirectiveFilterDirs` like so: -```go -flagName := "output" -cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { - return []string{"themes"}, cobra.ShellCompDirectiveFilterDirs -}) -``` -### Descriptions for completions - -`zsh`, `fish` and `powershell` allow for descriptions to annotate completion choices. For commands and flags, Cobra will provide the descriptions automatically, based on usage information. For example, using zsh: -``` -$ helm s[tab] -search -- search for a keyword in charts -show -- show information of a chart -status -- displays the status of the named release -``` -while using fish: -``` -$ helm s[tab] -search (search for a keyword in charts) show (show information of a chart) status (displays the status of the named release) -``` - -Cobra allows you to add annotations to your own completions. Simply add the annotation text after each completion, following a `\t` separator. This technique applies to completions returned by `ValidArgs`, `ValidArgsFunction` and `RegisterFlagCompletionFunc()`. For example: -```go -ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { - return []string{"harbor\tAn image registry", "thanos\tLong-term metrics"}, cobra.ShellCompDirectiveNoFileComp -}} -``` -or -```go -ValidArgs: []string{"bash\tCompletions for bash", "zsh\tCompletions for zsh"} -``` -## Bash completions - -### Dependencies - -The bash completion script generated by Cobra requires the `bash_completion` package. You should update the help text of your completion command to show how to install the `bash_completion` package ([Kubectl docs](https://kubernetes.io/docs/tasks/tools/install-kubectl/#enabling-shell-autocompletion)) - -### Aliases - -You can also configure `bash` aliases for your program and they will also support completions. - -```bash -alias aliasname=origcommand -complete -o default -F __start_origcommand aliasname - -# and now when you run `aliasname` completion will make -# suggestions as it did for `origcommand`. - -$ aliasname -completion firstcommand secondcommand -``` -### Bash legacy dynamic completions - -For backward compatibility, Cobra still supports its bash legacy dynamic completion solution. -Please refer to [Bash Completions](bash_completions.md) for details. - -## Zsh completions - -Cobra supports native zsh completion generated from the root `cobra.Command`. -The generated completion script should be put somewhere in your `$fpath` and be named -`_`. You will need to start a new shell for the completions to become available. - -Zsh supports descriptions for completions. Cobra will provide the description automatically, -based on usage information. Cobra provides a way to completely disable such descriptions by -using `GenZshCompletionNoDesc()` or `GenZshCompletionFileNoDesc()`. You can choose to make -this a configurable option to your users. -``` -# With descriptions -$ helm s[tab] -search -- search for a keyword in charts -show -- show information of a chart -status -- displays the status of the named release - -# Without descriptions -$ helm s[tab] -search show status -``` -*Note*: Because of backward-compatibility requirements, we were forced to have a different API to disable completion descriptions between `zsh` and `fish`. - -### Limitations - -* Custom completions implemented in Bash scripting (legacy) are not supported and will be ignored for `zsh` (including the use of the `BashCompCustom` flag annotation). - * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`, `powershell`). -* The function `MarkFlagCustom()` is not supported and will be ignored for `zsh`. - * You should instead use `RegisterFlagCompletionFunc()`. - -### Zsh completions standardization - -Cobra 1.1 standardized its zsh completion support to align it with its other shell completions. Although the API was kept backward-compatible, some small changes in behavior were introduced. -Please refer to [Zsh Completions](zsh_completions.md) for details. - -## fish completions - -Cobra supports native fish completions generated from the root `cobra.Command`. You can use the `command.GenFishCompletion()` or `command.GenFishCompletionFile()` functions. You must provide these functions with a parameter indicating if the completions should be annotated with a description; Cobra will provide the description automatically based on usage information. You can choose to make this option configurable by your users. -``` -# With descriptions -$ helm s[tab] -search (search for a keyword in charts) show (show information of a chart) status (displays the status of the named release) - -# Without descriptions -$ helm s[tab] -search show status -``` -*Note*: Because of backward-compatibility requirements, we were forced to have a different API to disable completion descriptions between `zsh` and `fish`. - -### Limitations - -* Custom completions implemented in bash scripting (legacy) are not supported and will be ignored for `fish` (including the use of the `BashCompCustom` flag annotation). - * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`, `powershell`). -* The function `MarkFlagCustom()` is not supported and will be ignored for `fish`. - * You should instead use `RegisterFlagCompletionFunc()`. -* The following flag completion annotations are not supported and will be ignored for `fish`: - * `BashCompFilenameExt` (filtering by file extension) - * `BashCompSubdirsInDir` (filtering by directory) -* The functions corresponding to the above annotations are consequently not supported and will be ignored for `fish`: - * `MarkFlagFilename()` and `MarkPersistentFlagFilename()` (filtering by file extension) - * `MarkFlagDirname()` and `MarkPersistentFlagDirname()` (filtering by directory) -* Similarly, the following completion directives are not supported and will be ignored for `fish`: - * `ShellCompDirectiveFilterFileExt` (filtering by file extension) - * `ShellCompDirectiveFilterDirs` (filtering by directory) - -## PowerShell completions - -Cobra supports native PowerShell completions generated from the root `cobra.Command`. You can use the `command.GenPowerShellCompletion()` or `command.GenPowerShellCompletionFile()` functions. To include descriptions use `command.GenPowerShellCompletionWithDesc()` and `command.GenPowerShellCompletionFileWithDesc()`. Cobra will provide the description automatically based on usage information. You can choose to make this option configurable by your users. - -The script is designed to support all three PowerShell completion modes: - -* TabCompleteNext (default windows style - on each key press the next option is displayed) -* Complete (works like bash) -* MenuComplete (works like zsh) - -You set the mode with `Set-PSReadLineKeyHandler -Key Tab -Function `. Descriptions are only displayed when using the `Complete` or `MenuComplete` mode. - -Users need PowerShell version 5.0 or above, which comes with Windows 10 and can be downloaded separately for Windows 7 or 8.1. They can then write the completions to a file and source this file from their PowerShell profile, which is referenced by the `$Profile` environment variable. See `Get-Help about_Profiles` for more info about PowerShell profiles. - -``` -# With descriptions and Mode 'Complete' -$ helm s[tab] -search (search for a keyword in charts) show (show information of a chart) status (displays the status of the named release) - -# With descriptions and Mode 'MenuComplete' The description of the current selected value will be displayed below the suggestions. -$ helm s[tab] -search show status - -search for a keyword in charts - -# Without descriptions -$ helm s[tab] -search show status -``` - -### Limitations - -* Custom completions implemented in bash scripting (legacy) are not supported and will be ignored for `powershell` (including the use of the `BashCompCustom` flag annotation). - * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`, `powershell`). -* The function `MarkFlagCustom()` is not supported and will be ignored for `powershell`. - * You should instead use `RegisterFlagCompletionFunc()`. -* The following flag completion annotations are not supported and will be ignored for `powershell`: - * `BashCompFilenameExt` (filtering by file extension) - * `BashCompSubdirsInDir` (filtering by directory) -* The functions corresponding to the above annotations are consequently not supported and will be ignored for `powershell`: - * `MarkFlagFilename()` and `MarkPersistentFlagFilename()` (filtering by file extension) - * `MarkFlagDirname()` and `MarkPersistentFlagDirname()` (filtering by directory) -* Similarly, the following completion directives are not supported and will be ignored for `powershell`: - * `ShellCompDirectiveFilterFileExt` (filtering by file extension) - * `ShellCompDirectiveFilterDirs` (filtering by directory) diff --git a/vendor/github.com/spf13/cobra/zsh_completions.go b/vendor/github.com/spf13/cobra/zsh_completions.go index 2e840285f3..12755482f0 100644 --- a/vendor/github.com/spf13/cobra/zsh_completions.go +++ b/vendor/github.com/spf13/cobra/zsh_completions.go @@ -1,240 +1,336 @@ package cobra import ( - "bytes" + "encoding/json" "fmt" "io" "os" + "sort" + "strings" + "text/template" + + "github.com/spf13/pflag" ) -// GenZshCompletionFile generates zsh completion file including descriptions. -func (c *Command) GenZshCompletionFile(filename string) error { - return c.genZshCompletionFile(filename, true) +const ( + zshCompArgumentAnnotation = "cobra_annotations_zsh_completion_argument_annotation" + zshCompArgumentFilenameComp = "cobra_annotations_zsh_completion_argument_file_completion" + zshCompArgumentWordComp = "cobra_annotations_zsh_completion_argument_word_completion" + zshCompDirname = "cobra_annotations_zsh_dirname" +) + +var ( + zshCompFuncMap = template.FuncMap{ + "genZshFuncName": zshCompGenFuncName, + "extractFlags": zshCompExtractFlag, + "genFlagEntryForZshArguments": zshCompGenFlagEntryForArguments, + "extractArgsCompletions": zshCompExtractArgumentCompletionHintsForRendering, + } + zshCompletionText = ` +{{/* should accept Command (that contains subcommands) as parameter */}} +{{define "argumentsC" -}} +{{ $cmdPath := genZshFuncName .}} +function {{$cmdPath}} { + local -a commands + + _arguments -C \{{- range extractFlags .}} + {{genFlagEntryForZshArguments .}} \{{- end}} + "1: :->cmnds" \ + "*::arg:->args" + + case $state in + cmnds) + commands=({{range .Commands}}{{if not .Hidden}} + "{{.Name}}:{{.Short}}"{{end}}{{end}} + ) + _describe "command" commands + ;; + esac + + case "$words[1]" in {{- range .Commands}}{{if not .Hidden}} + {{.Name}}) + {{$cmdPath}}_{{.Name}} + ;;{{end}}{{end}} + esac +} +{{range .Commands}}{{if not .Hidden}} +{{template "selectCmdTemplate" .}} +{{- end}}{{end}} +{{- end}} + +{{/* should accept Command without subcommands as parameter */}} +{{define "arguments" -}} +function {{genZshFuncName .}} { +{{" _arguments"}}{{range extractFlags .}} \ + {{genFlagEntryForZshArguments . -}} +{{end}}{{range extractArgsCompletions .}} \ + {{.}}{{end}} } +{{end}} + +{{/* dispatcher for commands with or without subcommands */}} +{{define "selectCmdTemplate" -}} +{{if .Hidden}}{{/* ignore hidden*/}}{{else -}} +{{if .Commands}}{{template "argumentsC" .}}{{else}}{{template "arguments" .}}{{end}} +{{- end}} +{{- end}} + +{{/* template entry point */}} +{{define "Main" -}} +#compdef _{{.Name}} {{.Name}} + +{{template "selectCmdTemplate" .}} +{{end}} +` +) -// GenZshCompletion generates zsh completion file including descriptions -// and writes it to the passed writer. -func (c *Command) GenZshCompletion(w io.Writer) error { - return c.genZshCompletion(w, true) +// zshCompArgsAnnotation is used to encode/decode zsh completion for +// arguments to/from Command.Annotations. +type zshCompArgsAnnotation map[int]zshCompArgHint + +type zshCompArgHint struct { + // Indicates the type of the completion to use. One of: + // zshCompArgumentFilenameComp or zshCompArgumentWordComp + Tipe string `json:"type"` + + // A value for the type above (globs for file completion or words) + Options []string `json:"options"` } -// GenZshCompletionFileNoDesc generates zsh completion file without descriptions. -func (c *Command) GenZshCompletionFileNoDesc(filename string) error { - return c.genZshCompletionFile(filename, false) +// GenZshCompletionFile generates zsh completion file. +func (c *Command) GenZshCompletionFile(filename string) error { + outFile, err := os.Create(filename) + if err != nil { + return err + } + defer outFile.Close() + + return c.GenZshCompletion(outFile) } -// GenZshCompletionNoDesc generates zsh completion file without descriptions -// and writes it to the passed writer. -func (c *Command) GenZshCompletionNoDesc(w io.Writer) error { - return c.genZshCompletion(w, false) +// GenZshCompletion generates a zsh completion file and writes to the passed +// writer. The completion always run on the root command regardless of the +// command it was called from. +func (c *Command) GenZshCompletion(w io.Writer) error { + tmpl, err := template.New("Main").Funcs(zshCompFuncMap).Parse(zshCompletionText) + if err != nil { + return fmt.Errorf("error creating zsh completion template: %v", err) + } + return tmpl.Execute(w, c.Root()) } -// MarkZshCompPositionalArgumentFile only worked for zsh and its behavior was -// not consistent with Bash completion. It has therefore been disabled. -// Instead, when no other completion is specified, file completion is done by -// default for every argument. One can disable file completion on a per-argument -// basis by using ValidArgsFunction and ShellCompDirectiveNoFileComp. -// To achieve file extension filtering, one can use ValidArgsFunction and -// ShellCompDirectiveFilterFileExt. -// -// Deprecated +// MarkZshCompPositionalArgumentFile marks the specified argument (first +// argument is 1) as completed by file selection. patterns (e.g. "*.txt") are +// optional - if not provided the completion will search for all files. func (c *Command) MarkZshCompPositionalArgumentFile(argPosition int, patterns ...string) error { - return nil + if argPosition < 1 { + return fmt.Errorf("Invalid argument position (%d)", argPosition) + } + annotation, err := c.zshCompGetArgsAnnotations() + if err != nil { + return err + } + if c.zshcompArgsAnnotationnIsDuplicatePosition(annotation, argPosition) { + return fmt.Errorf("Duplicate annotation for positional argument at index %d", argPosition) + } + annotation[argPosition] = zshCompArgHint{ + Tipe: zshCompArgumentFilenameComp, + Options: patterns, + } + return c.zshCompSetArgsAnnotations(annotation) } -// MarkZshCompPositionalArgumentWords only worked for zsh. It has therefore -// been disabled. -// To achieve the same behavior across all shells, one can use -// ValidArgs (for the first argument only) or ValidArgsFunction for -// any argument (can include the first one also). -// -// Deprecated +// MarkZshCompPositionalArgumentWords marks the specified positional argument +// (first argument is 1) as completed by the provided words. At east one word +// must be provided, spaces within words will be offered completion with +// "word\ word". func (c *Command) MarkZshCompPositionalArgumentWords(argPosition int, words ...string) error { - return nil + if argPosition < 1 { + return fmt.Errorf("Invalid argument position (%d)", argPosition) + } + if len(words) == 0 { + return fmt.Errorf("Trying to set empty word list for positional argument %d", argPosition) + } + annotation, err := c.zshCompGetArgsAnnotations() + if err != nil { + return err + } + if c.zshcompArgsAnnotationnIsDuplicatePosition(annotation, argPosition) { + return fmt.Errorf("Duplicate annotation for positional argument at index %d", argPosition) + } + annotation[argPosition] = zshCompArgHint{ + Tipe: zshCompArgumentWordComp, + Options: words, + } + return c.zshCompSetArgsAnnotations(annotation) } -func (c *Command) genZshCompletionFile(filename string, includeDesc bool) error { - outFile, err := os.Create(filename) +func zshCompExtractArgumentCompletionHintsForRendering(c *Command) ([]string, error) { + var result []string + annotation, err := c.zshCompGetArgsAnnotations() if err != nil { - return err + return nil, err } - defer outFile.Close() + for k, v := range annotation { + s, err := zshCompRenderZshCompArgHint(k, v) + if err != nil { + return nil, err + } + result = append(result, s) + } + if len(c.ValidArgs) > 0 { + if _, positionOneExists := annotation[1]; !positionOneExists { + s, err := zshCompRenderZshCompArgHint(1, zshCompArgHint{ + Tipe: zshCompArgumentWordComp, + Options: c.ValidArgs, + }) + if err != nil { + return nil, err + } + result = append(result, s) + } + } + sort.Strings(result) + return result, nil +} + +func zshCompRenderZshCompArgHint(i int, z zshCompArgHint) (string, error) { + switch t := z.Tipe; t { + case zshCompArgumentFilenameComp: + var globs []string + for _, g := range z.Options { + globs = append(globs, fmt.Sprintf(`-g "%s"`, g)) + } + return fmt.Sprintf(`'%d: :_files %s'`, i, strings.Join(globs, " ")), nil + case zshCompArgumentWordComp: + var words []string + for _, w := range z.Options { + words = append(words, fmt.Sprintf("%q", w)) + } + return fmt.Sprintf(`'%d: :(%s)'`, i, strings.Join(words, " ")), nil + default: + return "", fmt.Errorf("Invalid zsh argument completion annotation: %s", t) + } +} + +func (c *Command) zshcompArgsAnnotationnIsDuplicatePosition(annotation zshCompArgsAnnotation, position int) bool { + _, dup := annotation[position] + return dup +} + +func (c *Command) zshCompGetArgsAnnotations() (zshCompArgsAnnotation, error) { + annotation := make(zshCompArgsAnnotation) + annotationString, ok := c.Annotations[zshCompArgumentAnnotation] + if !ok { + return annotation, nil + } + err := json.Unmarshal([]byte(annotationString), &annotation) + if err != nil { + return annotation, fmt.Errorf("Error unmarshaling zsh argument annotation: %v", err) + } + return annotation, nil +} + +func (c *Command) zshCompSetArgsAnnotations(annotation zshCompArgsAnnotation) error { + jsn, err := json.Marshal(annotation) + if err != nil { + return fmt.Errorf("Error marshaling zsh argument annotation: %v", err) + } + if c.Annotations == nil { + c.Annotations = make(map[string]string) + } + c.Annotations[zshCompArgumentAnnotation] = string(jsn) + return nil +} + +func zshCompGenFuncName(c *Command) string { + if c.HasParent() { + return zshCompGenFuncName(c.Parent()) + "_" + c.Name() + } + return "_" + c.Name() +} + +func zshCompExtractFlag(c *Command) []*pflag.Flag { + var flags []*pflag.Flag + c.LocalFlags().VisitAll(func(f *pflag.Flag) { + if !f.Hidden { + flags = append(flags, f) + } + }) + c.InheritedFlags().VisitAll(func(f *pflag.Flag) { + if !f.Hidden { + flags = append(flags, f) + } + }) + return flags +} + +// zshCompGenFlagEntryForArguments returns an entry that matches _arguments +// zsh-completion parameters. It's too complicated to generate in a template. +func zshCompGenFlagEntryForArguments(f *pflag.Flag) string { + if f.Name == "" || f.Shorthand == "" { + return zshCompGenFlagEntryForSingleOptionFlag(f) + } + return zshCompGenFlagEntryForMultiOptionFlag(f) +} + +func zshCompGenFlagEntryForSingleOptionFlag(f *pflag.Flag) string { + var option, multiMark, extras string + + if zshCompFlagCouldBeSpecifiedMoreThenOnce(f) { + multiMark = "*" + } + + option = "--" + f.Name + if option == "--" { + option = "-" + f.Shorthand + } + extras = zshCompGenFlagEntryExtras(f) + + return fmt.Sprintf(`'%s%s[%s]%s'`, multiMark, option, zshCompQuoteFlagDescription(f.Usage), extras) +} + +func zshCompGenFlagEntryForMultiOptionFlag(f *pflag.Flag) string { + var options, parenMultiMark, curlyMultiMark, extras string + + if zshCompFlagCouldBeSpecifiedMoreThenOnce(f) { + parenMultiMark = "*" + curlyMultiMark = "\\*" + } + + options = fmt.Sprintf(`'(%s-%s %s--%s)'{%s-%s,%s--%s}`, + parenMultiMark, f.Shorthand, parenMultiMark, f.Name, curlyMultiMark, f.Shorthand, curlyMultiMark, f.Name) + extras = zshCompGenFlagEntryExtras(f) + + return fmt.Sprintf(`%s'[%s]%s'`, options, zshCompQuoteFlagDescription(f.Usage), extras) +} + +func zshCompGenFlagEntryExtras(f *pflag.Flag) string { + if f.NoOptDefVal != "" { + return "" + } + + extras := ":" // allow options for flag (even without assistance) + for key, values := range f.Annotations { + switch key { + case zshCompDirname: + extras = fmt.Sprintf(":filename:_files -g %q", values[0]) + case BashCompFilenameExt: + extras = ":filename:_files" + for _, pattern := range values { + extras = extras + fmt.Sprintf(` -g "%s"`, pattern) + } + } + } + + return extras +} + +func zshCompFlagCouldBeSpecifiedMoreThenOnce(f *pflag.Flag) bool { + return strings.Contains(f.Value.Type(), "Slice") || + strings.Contains(f.Value.Type(), "Array") +} - return c.genZshCompletion(outFile, includeDesc) -} - -func (c *Command) genZshCompletion(w io.Writer, includeDesc bool) error { - buf := new(bytes.Buffer) - genZshComp(buf, c.Name(), includeDesc) - _, err := buf.WriteTo(w) - return err -} - -func genZshComp(buf io.StringWriter, name string, includeDesc bool) { - compCmd := ShellCompRequestCmd - if !includeDesc { - compCmd = ShellCompNoDescRequestCmd - } - WriteStringAndCheck(buf, fmt.Sprintf(`#compdef _%[1]s %[1]s - -# zsh completion for %-36[1]s -*- shell-script -*- - -__%[1]s_debug() -{ - local file="$BASH_COMP_DEBUG_FILE" - if [[ -n ${file} ]]; then - echo "$*" >> "${file}" - fi -} - -_%[1]s() -{ - local shellCompDirectiveError=%[3]d - local shellCompDirectiveNoSpace=%[4]d - local shellCompDirectiveNoFileComp=%[5]d - local shellCompDirectiveFilterFileExt=%[6]d - local shellCompDirectiveFilterDirs=%[7]d - - local lastParam lastChar flagPrefix requestComp out directive compCount comp lastComp - local -a completions - - __%[1]s_debug "\n========= starting completion logic ==========" - __%[1]s_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}" - - # The user could have moved the cursor backwards on the command-line. - # We need to trigger completion from the $CURRENT location, so we need - # to truncate the command-line ($words) up to the $CURRENT location. - # (We cannot use $CURSOR as its value does not work when a command is an alias.) - words=("${=words[1,CURRENT]}") - __%[1]s_debug "Truncated words[*]: ${words[*]}," - - lastParam=${words[-1]} - lastChar=${lastParam[-1]} - __%[1]s_debug "lastParam: ${lastParam}, lastChar: ${lastChar}" - - # For zsh, when completing a flag with an = (e.g., %[1]s -n=) - # completions must be prefixed with the flag - setopt local_options BASH_REMATCH - if [[ "${lastParam}" =~ '-.*=' ]]; then - # We are dealing with a flag with an = - flagPrefix="-P ${BASH_REMATCH}" - fi - - # Prepare the command to obtain completions - requestComp="${words[1]} %[2]s ${words[2,-1]}" - if [ "${lastChar}" = "" ]; then - # If the last parameter is complete (there is a space following it) - # We add an extra empty parameter so we can indicate this to the go completion code. - __%[1]s_debug "Adding extra empty parameter" - requestComp="${requestComp} \"\"" - fi - - __%[1]s_debug "About to call: eval ${requestComp}" - - # Use eval to handle any environment variables and such - out=$(eval ${requestComp} 2>/dev/null) - __%[1]s_debug "completion output: ${out}" - - # Extract the directive integer following a : from the last line - local lastLine - while IFS='\n' read -r line; do - lastLine=${line} - done < <(printf "%%s\n" "${out[@]}") - __%[1]s_debug "last line: ${lastLine}" - - if [ "${lastLine[1]}" = : ]; then - directive=${lastLine[2,-1]} - # Remove the directive including the : and the newline - local suffix - (( suffix=${#lastLine}+2)) - out=${out[1,-$suffix]} - else - # There is no directive specified. Leave $out as is. - __%[1]s_debug "No directive found. Setting do default" - directive=0 - fi - - __%[1]s_debug "directive: ${directive}" - __%[1]s_debug "completions: ${out}" - __%[1]s_debug "flagPrefix: ${flagPrefix}" - - if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then - __%[1]s_debug "Completion received error. Ignoring completions." - return - fi - - compCount=0 - while IFS='\n' read -r comp; do - if [ -n "$comp" ]; then - # If requested, completions are returned with a description. - # The description is preceded by a TAB character. - # For zsh's _describe, we need to use a : instead of a TAB. - # We first need to escape any : as part of the completion itself. - comp=${comp//:/\\:} - - local tab=$(printf '\t') - comp=${comp//$tab/:} - - ((compCount++)) - __%[1]s_debug "Adding completion: ${comp}" - completions+=${comp} - lastComp=$comp - fi - done < <(printf "%%s\n" "${out[@]}") - - if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then - # File extension filtering - local filteringCmd - filteringCmd='_files' - for filter in ${completions[@]}; do - if [ ${filter[1]} != '*' ]; then - # zsh requires a glob pattern to do file filtering - filter="\*.$filter" - fi - filteringCmd+=" -g $filter" - done - filteringCmd+=" ${flagPrefix}" - - __%[1]s_debug "File filtering command: $filteringCmd" - _arguments '*:filename:'"$filteringCmd" - elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then - # File completion for directories only - local subDir - subdir="${completions[1]}" - if [ -n "$subdir" ]; then - __%[1]s_debug "Listing directories in $subdir" - pushd "${subdir}" >/dev/null 2>&1 - else - __%[1]s_debug "Listing directories in ." - fi - - _arguments '*:dirname:_files -/'" ${flagPrefix}" - if [ -n "$subdir" ]; then - popd >/dev/null 2>&1 - fi - elif [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ] && [ ${compCount} -eq 1 ]; then - __%[1]s_debug "Activating nospace." - # We can use compadd here as there is no description when - # there is only one completion. - compadd -S '' "${lastComp}" - elif [ ${compCount} -eq 0 ]; then - if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then - __%[1]s_debug "deactivating file completion" - else - # Perform file completion - __%[1]s_debug "activating file completion" - _arguments '*:filename:_files'" ${flagPrefix}" - fi - else - _describe "completions" completions $(echo $flagPrefix) - fi -} - -# don't run the completion function when being source-ed or eval-ed -if [ "$funcstack[1]" = "_%[1]s" ]; then - _%[1]s -fi -`, name, compCmd, - ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp, - ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs)) +func zshCompQuoteFlagDescription(s string) string { + return strings.Replace(s, "'", `'\''`, -1) } diff --git a/vendor/github.com/spf13/cobra/zsh_completions.md b/vendor/github.com/spf13/cobra/zsh_completions.md index 7cff61787f..df9c2eac93 100644 --- a/vendor/github.com/spf13/cobra/zsh_completions.md +++ b/vendor/github.com/spf13/cobra/zsh_completions.md @@ -1,48 +1,39 @@ -## Generating Zsh Completion For Your cobra.Command - -Please refer to [Shell Completions](shell_completions.md) for details. - -## Zsh completions standardization - -Cobra 1.1 standardized its zsh completion support to align it with its other shell completions. Although the API was kept backwards-compatible, some small changes in behavior were introduced. - -### Deprecation summary - -See further below for more details on these deprecations. - -* `cmd.MarkZshCompPositionalArgumentFile(pos, []string{})` is no longer needed. It is therefore **deprecated** and silently ignored. -* `cmd.MarkZshCompPositionalArgumentFile(pos, glob[])` is **deprecated** and silently ignored. - * Instead use `ValidArgsFunction` with `ShellCompDirectiveFilterFileExt`. -* `cmd.MarkZshCompPositionalArgumentWords()` is **deprecated** and silently ignored. - * Instead use `ValidArgsFunction`. - -### Behavioral changes - -**Noun completion** -|Old behavior|New behavior| -|---|---| -|No file completion by default (opposite of bash)|File completion by default; use `ValidArgsFunction` with `ShellCompDirectiveNoFileComp` to turn off file completion on a per-argument basis| -|Completion of flag names without the `-` prefix having been typed|Flag names are only completed if the user has typed the first `-`| -`cmd.MarkZshCompPositionalArgumentFile(pos, []string{})` used to turn on file completion on a per-argument position basis|File completion for all arguments by default; `cmd.MarkZshCompPositionalArgumentFile()` is **deprecated** and silently ignored| -|`cmd.MarkZshCompPositionalArgumentFile(pos, glob[])` used to turn on file completion **with glob filtering** on a per-argument position basis (zsh-specific)|`cmd.MarkZshCompPositionalArgumentFile()` is **deprecated** and silently ignored; use `ValidArgsFunction` with `ShellCompDirectiveFilterFileExt` for file **extension** filtering (not full glob filtering)| -|`cmd.MarkZshCompPositionalArgumentWords(pos, words[])` used to provide completion choices on a per-argument position basis (zsh-specific)|`cmd.MarkZshCompPositionalArgumentWords()` is **deprecated** and silently ignored; use `ValidArgsFunction` to achieve the same behavior| - -**Flag-value completion** - -|Old behavior|New behavior| -|---|---| -|No file completion by default (opposite of bash)|File completion by default; use `RegisterFlagCompletionFunc()` with `ShellCompDirectiveNoFileComp` to turn off file completion| -|`cmd.MarkFlagFilename(flag, []string{})` and similar used to turn on file completion|File completion by default; `cmd.MarkFlagFilename(flag, []string{})` no longer needed in this context and silently ignored| -|`cmd.MarkFlagFilename(flag, glob[])` used to turn on file completion **with glob filtering** (syntax of `[]string{"*.yaml", "*.yml"}` incompatible with bash)|Will continue to work, however, support for bash syntax is added and should be used instead so as to work for all shells (`[]string{"yaml", "yml"}`)| -|`cmd.MarkFlagDirname(flag)` only completes directories (zsh-specific)|Has been added for all shells| -|Completion of a flag name does not repeat, unless flag is of type `*Array` or `*Slice` (not supported by bash)|Retained for `zsh` and added to `fish`| -|Completion of a flag name does not provide the `=` form (unlike bash)|Retained for `zsh` and added to `fish`| - -**Improvements** - -* Custom completion support (`ValidArgsFunction` and `RegisterFlagCompletionFunc()`) -* File completion by default if no other completions found -* Handling of required flags -* File extension filtering no longer mutually exclusive with bash usage -* Completion of directory names *within* another directory -* Support for `=` form of flags +## Generating Zsh Completion for your cobra.Command + +Cobra supports native Zsh completion generated from the root `cobra.Command`. +The generated completion script should be put somewhere in your `$fpath` named +`_`. + +### What's Supported + +* Completion for all non-hidden subcommands using their `.Short` description. +* Completion for all non-hidden flags using the following rules: + * Filename completion works by marking the flag with `cmd.MarkFlagFilename...` + family of commands. + * The requirement for argument to the flag is decided by the `.NoOptDefVal` + flag value - if it's empty then completion will expect an argument. + * Flags of one of the various `*Array` and `*Slice` types supports multiple + specifications (with or without argument depending on the specific type). +* Completion of positional arguments using the following rules: + * Argument position for all options below starts at `1`. If argument position + `0` is requested it will raise an error. + * Use `command.MarkZshCompPositionalArgumentFile` to complete filenames. Glob + patterns (e.g. `"*.log"`) are optional - if not specified it will offer to + complete all file types. + * Use `command.MarkZshCompPositionalArgumentWords` to offer specific words for + completion. At least one word is required. + * It's possible to specify completion for some arguments and leave some + unspecified (e.g. offer words for second argument but nothing for first + argument). This will cause no completion for first argument but words + completion for second argument. + * If no argument completion was specified for 1st argument (but optionally was + specified for 2nd) and the command has `ValidArgs` it will be used as + completion options for 1st argument. + * Argument completions only offered for commands with no subcommands. + +### What's not yet Supported + +* Custom completion scripts are not supported yet (We should probably create zsh + specific one, doesn't make sense to re-use the bash one as the functions will + be different). +* Whatever other feature you're looking for and doesn't exist :) diff --git a/vendor/github.com/spf13/pflag/.travis.yml b/vendor/github.com/spf13/pflag/.travis.yml index 00d04cb9b0..f8a63b308b 100644 --- a/vendor/github.com/spf13/pflag/.travis.yml +++ b/vendor/github.com/spf13/pflag/.travis.yml @@ -3,9 +3,8 @@ sudo: false language: go go: - - 1.9.x - - 1.10.x - - 1.11.x + - 1.7.3 + - 1.8.1 - tip matrix: @@ -13,7 +12,7 @@ matrix: - go: tip install: - - go get golang.org/x/lint/golint + - go get github.com/golang/lint/golint - export PATH=$GOPATH/bin:$PATH - go install ./... diff --git a/vendor/github.com/spf13/pflag/README.md b/vendor/github.com/spf13/pflag/README.md index 7eacc5bdbe..b052414d12 100644 --- a/vendor/github.com/spf13/pflag/README.md +++ b/vendor/github.com/spf13/pflag/README.md @@ -86,8 +86,8 @@ fmt.Println("ip has value ", *ip) fmt.Println("flagvar has value ", flagvar) ``` -There are helper functions available to get the value stored in a Flag if you have a FlagSet but find -it difficult to keep up with all of the pointers in your code. +There are helpers function to get values later if you have the FlagSet but +it was difficult to keep up with all of the flag pointers in your code. If you have a pflag.FlagSet with a flag called 'flagname' of type int you can use GetInt() to get the int value. But notice that 'flagname' must exist and it must be an int. GetString("flagname") will fail. diff --git a/vendor/github.com/spf13/pflag/bool_slice.go b/vendor/github.com/spf13/pflag/bool_slice.go index 3731370d6a..5af02f1a75 100644 --- a/vendor/github.com/spf13/pflag/bool_slice.go +++ b/vendor/github.com/spf13/pflag/bool_slice.go @@ -71,44 +71,6 @@ func (s *boolSliceValue) String() string { return "[" + out + "]" } -func (s *boolSliceValue) fromString(val string) (bool, error) { - return strconv.ParseBool(val) -} - -func (s *boolSliceValue) toString(val bool) string { - return strconv.FormatBool(val) -} - -func (s *boolSliceValue) Append(val string) error { - i, err := s.fromString(val) - if err != nil { - return err - } - *s.value = append(*s.value, i) - return nil -} - -func (s *boolSliceValue) Replace(val []string) error { - out := make([]bool, len(val)) - for i, d := range val { - var err error - out[i], err = s.fromString(d) - if err != nil { - return err - } - } - *s.value = out - return nil -} - -func (s *boolSliceValue) GetSlice() []string { - out := make([]string, len(*s.value)) - for i, d := range *s.value { - out[i] = s.toString(d) - } - return out -} - func boolSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry diff --git a/vendor/github.com/spf13/pflag/count.go b/vendor/github.com/spf13/pflag/count.go index a0b2679f71..aa126e44d1 100644 --- a/vendor/github.com/spf13/pflag/count.go +++ b/vendor/github.com/spf13/pflag/count.go @@ -46,7 +46,7 @@ func (f *FlagSet) GetCount(name string) (int, error) { // CountVar defines a count flag with specified name, default value, and usage string. // The argument p points to an int variable in which to store the value of the flag. -// A count flag will add 1 to its value every time it is found on the command line +// A count flag will add 1 to its value evey time it is found on the command line func (f *FlagSet) CountVar(p *int, name string, usage string) { f.CountVarP(p, name, "", usage) } @@ -69,7 +69,7 @@ func CountVarP(p *int, name, shorthand string, usage string) { // Count defines a count flag with specified name, default value, and usage string. // The return value is the address of an int variable that stores the value of the flag. -// A count flag will add 1 to its value every time it is found on the command line +// A count flag will add 1 to its value evey time it is found on the command line func (f *FlagSet) Count(name string, usage string) *int { p := new(int) f.CountVarP(p, name, "", usage) diff --git a/vendor/github.com/spf13/pflag/duration_slice.go b/vendor/github.com/spf13/pflag/duration_slice.go index badadda53f..52c6b6dc10 100644 --- a/vendor/github.com/spf13/pflag/duration_slice.go +++ b/vendor/github.com/spf13/pflag/duration_slice.go @@ -51,44 +51,6 @@ func (s *durationSliceValue) String() string { return "[" + strings.Join(out, ",") + "]" } -func (s *durationSliceValue) fromString(val string) (time.Duration, error) { - return time.ParseDuration(val) -} - -func (s *durationSliceValue) toString(val time.Duration) string { - return fmt.Sprintf("%s", val) -} - -func (s *durationSliceValue) Append(val string) error { - i, err := s.fromString(val) - if err != nil { - return err - } - *s.value = append(*s.value, i) - return nil -} - -func (s *durationSliceValue) Replace(val []string) error { - out := make([]time.Duration, len(val)) - for i, d := range val { - var err error - out[i], err = s.fromString(d) - if err != nil { - return err - } - } - *s.value = out - return nil -} - -func (s *durationSliceValue) GetSlice() []string { - out := make([]string, len(*s.value)) - for i, d := range *s.value { - out[i] = s.toString(d) - } - return out -} - func durationSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry diff --git a/vendor/github.com/spf13/pflag/flag.go b/vendor/github.com/spf13/pflag/flag.go index 24a5036e95..9beeda8ecc 100644 --- a/vendor/github.com/spf13/pflag/flag.go +++ b/vendor/github.com/spf13/pflag/flag.go @@ -57,9 +57,9 @@ that give one-letter shorthands for flags. You can use these by appending var ip = flag.IntP("flagname", "f", 1234, "help message") var flagvar bool func init() { - flag.BoolVarP(&flagvar, "boolname", "b", true, "help message") + flag.BoolVarP("boolname", "b", true, "help message") } - flag.VarP(&flagval, "varname", "v", "help message") + flag.VarP(&flagVar, "varname", "v", 1234, "help message") Shorthand letters can be used with single dashes on the command line. Boolean shorthand flags can be combined with other shorthand flags. @@ -190,18 +190,6 @@ type Value interface { Type() string } -// SliceValue is a secondary interface to all flags which hold a list -// of values. This allows full control over the value of list flags, -// and avoids complicated marshalling and unmarshalling to csv. -type SliceValue interface { - // Append adds the specified value to the end of the flag value list. - Append(string) error - // Replace will fully overwrite any data currently in the flag value list. - Replace([]string) error - // GetSlice returns the flag value list as an array of strings. - GetSlice() []string -} - // sortFlags returns the flags as a slice in lexicographical sorted order. func sortFlags(flags map[NormalizedName]*Flag) []*Flag { list := make(sort.StringSlice, len(flags)) diff --git a/vendor/github.com/spf13/pflag/float32_slice.go b/vendor/github.com/spf13/pflag/float32_slice.go deleted file mode 100644 index caa352741a..0000000000 --- a/vendor/github.com/spf13/pflag/float32_slice.go +++ /dev/null @@ -1,174 +0,0 @@ -package pflag - -import ( - "fmt" - "strconv" - "strings" -) - -// -- float32Slice Value -type float32SliceValue struct { - value *[]float32 - changed bool -} - -func newFloat32SliceValue(val []float32, p *[]float32) *float32SliceValue { - isv := new(float32SliceValue) - isv.value = p - *isv.value = val - return isv -} - -func (s *float32SliceValue) Set(val string) error { - ss := strings.Split(val, ",") - out := make([]float32, len(ss)) - for i, d := range ss { - var err error - var temp64 float64 - temp64, err = strconv.ParseFloat(d, 32) - if err != nil { - return err - } - out[i] = float32(temp64) - - } - if !s.changed { - *s.value = out - } else { - *s.value = append(*s.value, out...) - } - s.changed = true - return nil -} - -func (s *float32SliceValue) Type() string { - return "float32Slice" -} - -func (s *float32SliceValue) String() string { - out := make([]string, len(*s.value)) - for i, d := range *s.value { - out[i] = fmt.Sprintf("%f", d) - } - return "[" + strings.Join(out, ",") + "]" -} - -func (s *float32SliceValue) fromString(val string) (float32, error) { - t64, err := strconv.ParseFloat(val, 32) - if err != nil { - return 0, err - } - return float32(t64), nil -} - -func (s *float32SliceValue) toString(val float32) string { - return fmt.Sprintf("%f", val) -} - -func (s *float32SliceValue) Append(val string) error { - i, err := s.fromString(val) - if err != nil { - return err - } - *s.value = append(*s.value, i) - return nil -} - -func (s *float32SliceValue) Replace(val []string) error { - out := make([]float32, len(val)) - for i, d := range val { - var err error - out[i], err = s.fromString(d) - if err != nil { - return err - } - } - *s.value = out - return nil -} - -func (s *float32SliceValue) GetSlice() []string { - out := make([]string, len(*s.value)) - for i, d := range *s.value { - out[i] = s.toString(d) - } - return out -} - -func float32SliceConv(val string) (interface{}, error) { - val = strings.Trim(val, "[]") - // Empty string would cause a slice with one (empty) entry - if len(val) == 0 { - return []float32{}, nil - } - ss := strings.Split(val, ",") - out := make([]float32, len(ss)) - for i, d := range ss { - var err error - var temp64 float64 - temp64, err = strconv.ParseFloat(d, 32) - if err != nil { - return nil, err - } - out[i] = float32(temp64) - - } - return out, nil -} - -// GetFloat32Slice return the []float32 value of a flag with the given name -func (f *FlagSet) GetFloat32Slice(name string) ([]float32, error) { - val, err := f.getFlagType(name, "float32Slice", float32SliceConv) - if err != nil { - return []float32{}, err - } - return val.([]float32), nil -} - -// Float32SliceVar defines a float32Slice flag with specified name, default value, and usage string. -// The argument p points to a []float32 variable in which to store the value of the flag. -func (f *FlagSet) Float32SliceVar(p *[]float32, name string, value []float32, usage string) { - f.VarP(newFloat32SliceValue(value, p), name, "", usage) -} - -// Float32SliceVarP is like Float32SliceVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Float32SliceVarP(p *[]float32, name, shorthand string, value []float32, usage string) { - f.VarP(newFloat32SliceValue(value, p), name, shorthand, usage) -} - -// Float32SliceVar defines a float32[] flag with specified name, default value, and usage string. -// The argument p points to a float32[] variable in which to store the value of the flag. -func Float32SliceVar(p *[]float32, name string, value []float32, usage string) { - CommandLine.VarP(newFloat32SliceValue(value, p), name, "", usage) -} - -// Float32SliceVarP is like Float32SliceVar, but accepts a shorthand letter that can be used after a single dash. -func Float32SliceVarP(p *[]float32, name, shorthand string, value []float32, usage string) { - CommandLine.VarP(newFloat32SliceValue(value, p), name, shorthand, usage) -} - -// Float32Slice defines a []float32 flag with specified name, default value, and usage string. -// The return value is the address of a []float32 variable that stores the value of the flag. -func (f *FlagSet) Float32Slice(name string, value []float32, usage string) *[]float32 { - p := []float32{} - f.Float32SliceVarP(&p, name, "", value, usage) - return &p -} - -// Float32SliceP is like Float32Slice, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Float32SliceP(name, shorthand string, value []float32, usage string) *[]float32 { - p := []float32{} - f.Float32SliceVarP(&p, name, shorthand, value, usage) - return &p -} - -// Float32Slice defines a []float32 flag with specified name, default value, and usage string. -// The return value is the address of a []float32 variable that stores the value of the flag. -func Float32Slice(name string, value []float32, usage string) *[]float32 { - return CommandLine.Float32SliceP(name, "", value, usage) -} - -// Float32SliceP is like Float32Slice, but accepts a shorthand letter that can be used after a single dash. -func Float32SliceP(name, shorthand string, value []float32, usage string) *[]float32 { - return CommandLine.Float32SliceP(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/float64_slice.go b/vendor/github.com/spf13/pflag/float64_slice.go deleted file mode 100644 index 85bf3073d5..0000000000 --- a/vendor/github.com/spf13/pflag/float64_slice.go +++ /dev/null @@ -1,166 +0,0 @@ -package pflag - -import ( - "fmt" - "strconv" - "strings" -) - -// -- float64Slice Value -type float64SliceValue struct { - value *[]float64 - changed bool -} - -func newFloat64SliceValue(val []float64, p *[]float64) *float64SliceValue { - isv := new(float64SliceValue) - isv.value = p - *isv.value = val - return isv -} - -func (s *float64SliceValue) Set(val string) error { - ss := strings.Split(val, ",") - out := make([]float64, len(ss)) - for i, d := range ss { - var err error - out[i], err = strconv.ParseFloat(d, 64) - if err != nil { - return err - } - - } - if !s.changed { - *s.value = out - } else { - *s.value = append(*s.value, out...) - } - s.changed = true - return nil -} - -func (s *float64SliceValue) Type() string { - return "float64Slice" -} - -func (s *float64SliceValue) String() string { - out := make([]string, len(*s.value)) - for i, d := range *s.value { - out[i] = fmt.Sprintf("%f", d) - } - return "[" + strings.Join(out, ",") + "]" -} - -func (s *float64SliceValue) fromString(val string) (float64, error) { - return strconv.ParseFloat(val, 64) -} - -func (s *float64SliceValue) toString(val float64) string { - return fmt.Sprintf("%f", val) -} - -func (s *float64SliceValue) Append(val string) error { - i, err := s.fromString(val) - if err != nil { - return err - } - *s.value = append(*s.value, i) - return nil -} - -func (s *float64SliceValue) Replace(val []string) error { - out := make([]float64, len(val)) - for i, d := range val { - var err error - out[i], err = s.fromString(d) - if err != nil { - return err - } - } - *s.value = out - return nil -} - -func (s *float64SliceValue) GetSlice() []string { - out := make([]string, len(*s.value)) - for i, d := range *s.value { - out[i] = s.toString(d) - } - return out -} - -func float64SliceConv(val string) (interface{}, error) { - val = strings.Trim(val, "[]") - // Empty string would cause a slice with one (empty) entry - if len(val) == 0 { - return []float64{}, nil - } - ss := strings.Split(val, ",") - out := make([]float64, len(ss)) - for i, d := range ss { - var err error - out[i], err = strconv.ParseFloat(d, 64) - if err != nil { - return nil, err - } - - } - return out, nil -} - -// GetFloat64Slice return the []float64 value of a flag with the given name -func (f *FlagSet) GetFloat64Slice(name string) ([]float64, error) { - val, err := f.getFlagType(name, "float64Slice", float64SliceConv) - if err != nil { - return []float64{}, err - } - return val.([]float64), nil -} - -// Float64SliceVar defines a float64Slice flag with specified name, default value, and usage string. -// The argument p points to a []float64 variable in which to store the value of the flag. -func (f *FlagSet) Float64SliceVar(p *[]float64, name string, value []float64, usage string) { - f.VarP(newFloat64SliceValue(value, p), name, "", usage) -} - -// Float64SliceVarP is like Float64SliceVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Float64SliceVarP(p *[]float64, name, shorthand string, value []float64, usage string) { - f.VarP(newFloat64SliceValue(value, p), name, shorthand, usage) -} - -// Float64SliceVar defines a float64[] flag with specified name, default value, and usage string. -// The argument p points to a float64[] variable in which to store the value of the flag. -func Float64SliceVar(p *[]float64, name string, value []float64, usage string) { - CommandLine.VarP(newFloat64SliceValue(value, p), name, "", usage) -} - -// Float64SliceVarP is like Float64SliceVar, but accepts a shorthand letter that can be used after a single dash. -func Float64SliceVarP(p *[]float64, name, shorthand string, value []float64, usage string) { - CommandLine.VarP(newFloat64SliceValue(value, p), name, shorthand, usage) -} - -// Float64Slice defines a []float64 flag with specified name, default value, and usage string. -// The return value is the address of a []float64 variable that stores the value of the flag. -func (f *FlagSet) Float64Slice(name string, value []float64, usage string) *[]float64 { - p := []float64{} - f.Float64SliceVarP(&p, name, "", value, usage) - return &p -} - -// Float64SliceP is like Float64Slice, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Float64SliceP(name, shorthand string, value []float64, usage string) *[]float64 { - p := []float64{} - f.Float64SliceVarP(&p, name, shorthand, value, usage) - return &p -} - -// Float64Slice defines a []float64 flag with specified name, default value, and usage string. -// The return value is the address of a []float64 variable that stores the value of the flag. -func Float64Slice(name string, value []float64, usage string) *[]float64 { - return CommandLine.Float64SliceP(name, "", value, usage) -} - -// Float64SliceP is like Float64Slice, but accepts a shorthand letter that can be used after a single dash. -func Float64SliceP(name, shorthand string, value []float64, usage string) *[]float64 { - return CommandLine.Float64SliceP(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/go.mod b/vendor/github.com/spf13/pflag/go.mod deleted file mode 100644 index b2287eec13..0000000000 --- a/vendor/github.com/spf13/pflag/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/spf13/pflag - -go 1.12 diff --git a/vendor/github.com/spf13/pflag/go.sum b/vendor/github.com/spf13/pflag/go.sum deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/vendor/github.com/spf13/pflag/int32_slice.go b/vendor/github.com/spf13/pflag/int32_slice.go deleted file mode 100644 index ff128ff06d..0000000000 --- a/vendor/github.com/spf13/pflag/int32_slice.go +++ /dev/null @@ -1,174 +0,0 @@ -package pflag - -import ( - "fmt" - "strconv" - "strings" -) - -// -- int32Slice Value -type int32SliceValue struct { - value *[]int32 - changed bool -} - -func newInt32SliceValue(val []int32, p *[]int32) *int32SliceValue { - isv := new(int32SliceValue) - isv.value = p - *isv.value = val - return isv -} - -func (s *int32SliceValue) Set(val string) error { - ss := strings.Split(val, ",") - out := make([]int32, len(ss)) - for i, d := range ss { - var err error - var temp64 int64 - temp64, err = strconv.ParseInt(d, 0, 32) - if err != nil { - return err - } - out[i] = int32(temp64) - - } - if !s.changed { - *s.value = out - } else { - *s.value = append(*s.value, out...) - } - s.changed = true - return nil -} - -func (s *int32SliceValue) Type() string { - return "int32Slice" -} - -func (s *int32SliceValue) String() string { - out := make([]string, len(*s.value)) - for i, d := range *s.value { - out[i] = fmt.Sprintf("%d", d) - } - return "[" + strings.Join(out, ",") + "]" -} - -func (s *int32SliceValue) fromString(val string) (int32, error) { - t64, err := strconv.ParseInt(val, 0, 32) - if err != nil { - return 0, err - } - return int32(t64), nil -} - -func (s *int32SliceValue) toString(val int32) string { - return fmt.Sprintf("%d", val) -} - -func (s *int32SliceValue) Append(val string) error { - i, err := s.fromString(val) - if err != nil { - return err - } - *s.value = append(*s.value, i) - return nil -} - -func (s *int32SliceValue) Replace(val []string) error { - out := make([]int32, len(val)) - for i, d := range val { - var err error - out[i], err = s.fromString(d) - if err != nil { - return err - } - } - *s.value = out - return nil -} - -func (s *int32SliceValue) GetSlice() []string { - out := make([]string, len(*s.value)) - for i, d := range *s.value { - out[i] = s.toString(d) - } - return out -} - -func int32SliceConv(val string) (interface{}, error) { - val = strings.Trim(val, "[]") - // Empty string would cause a slice with one (empty) entry - if len(val) == 0 { - return []int32{}, nil - } - ss := strings.Split(val, ",") - out := make([]int32, len(ss)) - for i, d := range ss { - var err error - var temp64 int64 - temp64, err = strconv.ParseInt(d, 0, 32) - if err != nil { - return nil, err - } - out[i] = int32(temp64) - - } - return out, nil -} - -// GetInt32Slice return the []int32 value of a flag with the given name -func (f *FlagSet) GetInt32Slice(name string) ([]int32, error) { - val, err := f.getFlagType(name, "int32Slice", int32SliceConv) - if err != nil { - return []int32{}, err - } - return val.([]int32), nil -} - -// Int32SliceVar defines a int32Slice flag with specified name, default value, and usage string. -// The argument p points to a []int32 variable in which to store the value of the flag. -func (f *FlagSet) Int32SliceVar(p *[]int32, name string, value []int32, usage string) { - f.VarP(newInt32SliceValue(value, p), name, "", usage) -} - -// Int32SliceVarP is like Int32SliceVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Int32SliceVarP(p *[]int32, name, shorthand string, value []int32, usage string) { - f.VarP(newInt32SliceValue(value, p), name, shorthand, usage) -} - -// Int32SliceVar defines a int32[] flag with specified name, default value, and usage string. -// The argument p points to a int32[] variable in which to store the value of the flag. -func Int32SliceVar(p *[]int32, name string, value []int32, usage string) { - CommandLine.VarP(newInt32SliceValue(value, p), name, "", usage) -} - -// Int32SliceVarP is like Int32SliceVar, but accepts a shorthand letter that can be used after a single dash. -func Int32SliceVarP(p *[]int32, name, shorthand string, value []int32, usage string) { - CommandLine.VarP(newInt32SliceValue(value, p), name, shorthand, usage) -} - -// Int32Slice defines a []int32 flag with specified name, default value, and usage string. -// The return value is the address of a []int32 variable that stores the value of the flag. -func (f *FlagSet) Int32Slice(name string, value []int32, usage string) *[]int32 { - p := []int32{} - f.Int32SliceVarP(&p, name, "", value, usage) - return &p -} - -// Int32SliceP is like Int32Slice, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Int32SliceP(name, shorthand string, value []int32, usage string) *[]int32 { - p := []int32{} - f.Int32SliceVarP(&p, name, shorthand, value, usage) - return &p -} - -// Int32Slice defines a []int32 flag with specified name, default value, and usage string. -// The return value is the address of a []int32 variable that stores the value of the flag. -func Int32Slice(name string, value []int32, usage string) *[]int32 { - return CommandLine.Int32SliceP(name, "", value, usage) -} - -// Int32SliceP is like Int32Slice, but accepts a shorthand letter that can be used after a single dash. -func Int32SliceP(name, shorthand string, value []int32, usage string) *[]int32 { - return CommandLine.Int32SliceP(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/int64_slice.go b/vendor/github.com/spf13/pflag/int64_slice.go deleted file mode 100644 index 25464638f3..0000000000 --- a/vendor/github.com/spf13/pflag/int64_slice.go +++ /dev/null @@ -1,166 +0,0 @@ -package pflag - -import ( - "fmt" - "strconv" - "strings" -) - -// -- int64Slice Value -type int64SliceValue struct { - value *[]int64 - changed bool -} - -func newInt64SliceValue(val []int64, p *[]int64) *int64SliceValue { - isv := new(int64SliceValue) - isv.value = p - *isv.value = val - return isv -} - -func (s *int64SliceValue) Set(val string) error { - ss := strings.Split(val, ",") - out := make([]int64, len(ss)) - for i, d := range ss { - var err error - out[i], err = strconv.ParseInt(d, 0, 64) - if err != nil { - return err - } - - } - if !s.changed { - *s.value = out - } else { - *s.value = append(*s.value, out...) - } - s.changed = true - return nil -} - -func (s *int64SliceValue) Type() string { - return "int64Slice" -} - -func (s *int64SliceValue) String() string { - out := make([]string, len(*s.value)) - for i, d := range *s.value { - out[i] = fmt.Sprintf("%d", d) - } - return "[" + strings.Join(out, ",") + "]" -} - -func (s *int64SliceValue) fromString(val string) (int64, error) { - return strconv.ParseInt(val, 0, 64) -} - -func (s *int64SliceValue) toString(val int64) string { - return fmt.Sprintf("%d", val) -} - -func (s *int64SliceValue) Append(val string) error { - i, err := s.fromString(val) - if err != nil { - return err - } - *s.value = append(*s.value, i) - return nil -} - -func (s *int64SliceValue) Replace(val []string) error { - out := make([]int64, len(val)) - for i, d := range val { - var err error - out[i], err = s.fromString(d) - if err != nil { - return err - } - } - *s.value = out - return nil -} - -func (s *int64SliceValue) GetSlice() []string { - out := make([]string, len(*s.value)) - for i, d := range *s.value { - out[i] = s.toString(d) - } - return out -} - -func int64SliceConv(val string) (interface{}, error) { - val = strings.Trim(val, "[]") - // Empty string would cause a slice with one (empty) entry - if len(val) == 0 { - return []int64{}, nil - } - ss := strings.Split(val, ",") - out := make([]int64, len(ss)) - for i, d := range ss { - var err error - out[i], err = strconv.ParseInt(d, 0, 64) - if err != nil { - return nil, err - } - - } - return out, nil -} - -// GetInt64Slice return the []int64 value of a flag with the given name -func (f *FlagSet) GetInt64Slice(name string) ([]int64, error) { - val, err := f.getFlagType(name, "int64Slice", int64SliceConv) - if err != nil { - return []int64{}, err - } - return val.([]int64), nil -} - -// Int64SliceVar defines a int64Slice flag with specified name, default value, and usage string. -// The argument p points to a []int64 variable in which to store the value of the flag. -func (f *FlagSet) Int64SliceVar(p *[]int64, name string, value []int64, usage string) { - f.VarP(newInt64SliceValue(value, p), name, "", usage) -} - -// Int64SliceVarP is like Int64SliceVar, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Int64SliceVarP(p *[]int64, name, shorthand string, value []int64, usage string) { - f.VarP(newInt64SliceValue(value, p), name, shorthand, usage) -} - -// Int64SliceVar defines a int64[] flag with specified name, default value, and usage string. -// The argument p points to a int64[] variable in which to store the value of the flag. -func Int64SliceVar(p *[]int64, name string, value []int64, usage string) { - CommandLine.VarP(newInt64SliceValue(value, p), name, "", usage) -} - -// Int64SliceVarP is like Int64SliceVar, but accepts a shorthand letter that can be used after a single dash. -func Int64SliceVarP(p *[]int64, name, shorthand string, value []int64, usage string) { - CommandLine.VarP(newInt64SliceValue(value, p), name, shorthand, usage) -} - -// Int64Slice defines a []int64 flag with specified name, default value, and usage string. -// The return value is the address of a []int64 variable that stores the value of the flag. -func (f *FlagSet) Int64Slice(name string, value []int64, usage string) *[]int64 { - p := []int64{} - f.Int64SliceVarP(&p, name, "", value, usage) - return &p -} - -// Int64SliceP is like Int64Slice, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) Int64SliceP(name, shorthand string, value []int64, usage string) *[]int64 { - p := []int64{} - f.Int64SliceVarP(&p, name, shorthand, value, usage) - return &p -} - -// Int64Slice defines a []int64 flag with specified name, default value, and usage string. -// The return value is the address of a []int64 variable that stores the value of the flag. -func Int64Slice(name string, value []int64, usage string) *[]int64 { - return CommandLine.Int64SliceP(name, "", value, usage) -} - -// Int64SliceP is like Int64Slice, but accepts a shorthand letter that can be used after a single dash. -func Int64SliceP(name, shorthand string, value []int64, usage string) *[]int64 { - return CommandLine.Int64SliceP(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/int_slice.go b/vendor/github.com/spf13/pflag/int_slice.go index e71c39d91a..1e7c9edde9 100644 --- a/vendor/github.com/spf13/pflag/int_slice.go +++ b/vendor/github.com/spf13/pflag/int_slice.go @@ -51,36 +51,6 @@ func (s *intSliceValue) String() string { return "[" + strings.Join(out, ",") + "]" } -func (s *intSliceValue) Append(val string) error { - i, err := strconv.Atoi(val) - if err != nil { - return err - } - *s.value = append(*s.value, i) - return nil -} - -func (s *intSliceValue) Replace(val []string) error { - out := make([]int, len(val)) - for i, d := range val { - var err error - out[i], err = strconv.Atoi(d) - if err != nil { - return err - } - } - *s.value = out - return nil -} - -func (s *intSliceValue) GetSlice() []string { - out := make([]string, len(*s.value)) - for i, d := range *s.value { - out[i] = strconv.Itoa(d) - } - return out -} - func intSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry diff --git a/vendor/github.com/spf13/pflag/ip_slice.go b/vendor/github.com/spf13/pflag/ip_slice.go index 775faae4fd..7dd196fe3f 100644 --- a/vendor/github.com/spf13/pflag/ip_slice.go +++ b/vendor/github.com/spf13/pflag/ip_slice.go @@ -72,47 +72,9 @@ func (s *ipSliceValue) String() string { return "[" + out + "]" } -func (s *ipSliceValue) fromString(val string) (net.IP, error) { - return net.ParseIP(strings.TrimSpace(val)), nil -} - -func (s *ipSliceValue) toString(val net.IP) string { - return val.String() -} - -func (s *ipSliceValue) Append(val string) error { - i, err := s.fromString(val) - if err != nil { - return err - } - *s.value = append(*s.value, i) - return nil -} - -func (s *ipSliceValue) Replace(val []string) error { - out := make([]net.IP, len(val)) - for i, d := range val { - var err error - out[i], err = s.fromString(d) - if err != nil { - return err - } - } - *s.value = out - return nil -} - -func (s *ipSliceValue) GetSlice() []string { - out := make([]string, len(*s.value)) - for i, d := range *s.value { - out[i] = s.toString(d) - } - return out -} - func ipSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") - // Empty string would cause a slice with one (empty) entry + // Emtpy string would cause a slice with one (empty) entry if len(val) == 0 { return []net.IP{}, nil } diff --git a/vendor/github.com/spf13/pflag/string_array.go b/vendor/github.com/spf13/pflag/string_array.go index 4894af8180..fa7bc60187 100644 --- a/vendor/github.com/spf13/pflag/string_array.go +++ b/vendor/github.com/spf13/pflag/string_array.go @@ -23,32 +23,6 @@ func (s *stringArrayValue) Set(val string) error { return nil } -func (s *stringArrayValue) Append(val string) error { - *s.value = append(*s.value, val) - return nil -} - -func (s *stringArrayValue) Replace(val []string) error { - out := make([]string, len(val)) - for i, d := range val { - var err error - out[i] = d - if err != nil { - return err - } - } - *s.value = out - return nil -} - -func (s *stringArrayValue) GetSlice() []string { - out := make([]string, len(*s.value)) - for i, d := range *s.value { - out[i] = d - } - return out -} - func (s *stringArrayValue) Type() string { return "stringArray" } diff --git a/vendor/github.com/spf13/pflag/string_slice.go b/vendor/github.com/spf13/pflag/string_slice.go index 3cb2e69dba..0cd3ccc083 100644 --- a/vendor/github.com/spf13/pflag/string_slice.go +++ b/vendor/github.com/spf13/pflag/string_slice.go @@ -62,20 +62,6 @@ func (s *stringSliceValue) String() string { return "[" + str + "]" } -func (s *stringSliceValue) Append(val string) error { - *s.value = append(*s.value, val) - return nil -} - -func (s *stringSliceValue) Replace(val []string) error { - *s.value = val - return nil -} - -func (s *stringSliceValue) GetSlice() []string { - return *s.value -} - func stringSliceConv(sval string) (interface{}, error) { sval = sval[1 : len(sval)-1] // An empty string would cause a slice with one (empty) string @@ -98,7 +84,7 @@ func (f *FlagSet) GetStringSlice(name string) ([]string, error) { // The argument p points to a []string variable in which to store the value of the flag. // Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. // For example: -// --ss="v1,v2" --ss="v3" +// --ss="v1,v2" -ss="v3" // will result in // []string{"v1", "v2", "v3"} func (f *FlagSet) StringSliceVar(p *[]string, name string, value []string, usage string) { @@ -114,7 +100,7 @@ func (f *FlagSet) StringSliceVarP(p *[]string, name, shorthand string, value []s // The argument p points to a []string variable in which to store the value of the flag. // Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. // For example: -// --ss="v1,v2" --ss="v3" +// --ss="v1,v2" -ss="v3" // will result in // []string{"v1", "v2", "v3"} func StringSliceVar(p *[]string, name string, value []string, usage string) { @@ -130,7 +116,7 @@ func StringSliceVarP(p *[]string, name, shorthand string, value []string, usage // The return value is the address of a []string variable that stores the value of the flag. // Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. // For example: -// --ss="v1,v2" --ss="v3" +// --ss="v1,v2" -ss="v3" // will result in // []string{"v1", "v2", "v3"} func (f *FlagSet) StringSlice(name string, value []string, usage string) *[]string { @@ -150,7 +136,7 @@ func (f *FlagSet) StringSliceP(name, shorthand string, value []string, usage str // The return value is the address of a []string variable that stores the value of the flag. // Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. // For example: -// --ss="v1,v2" --ss="v3" +// --ss="v1,v2" -ss="v3" // will result in // []string{"v1", "v2", "v3"} func StringSlice(name string, value []string, usage string) *[]string { diff --git a/vendor/github.com/spf13/pflag/string_to_int64.go b/vendor/github.com/spf13/pflag/string_to_int64.go deleted file mode 100644 index a807a04a0b..0000000000 --- a/vendor/github.com/spf13/pflag/string_to_int64.go +++ /dev/null @@ -1,149 +0,0 @@ -package pflag - -import ( - "bytes" - "fmt" - "strconv" - "strings" -) - -// -- stringToInt64 Value -type stringToInt64Value struct { - value *map[string]int64 - changed bool -} - -func newStringToInt64Value(val map[string]int64, p *map[string]int64) *stringToInt64Value { - ssv := new(stringToInt64Value) - ssv.value = p - *ssv.value = val - return ssv -} - -// Format: a=1,b=2 -func (s *stringToInt64Value) Set(val string) error { - ss := strings.Split(val, ",") - out := make(map[string]int64, len(ss)) - for _, pair := range ss { - kv := strings.SplitN(pair, "=", 2) - if len(kv) != 2 { - return fmt.Errorf("%s must be formatted as key=value", pair) - } - var err error - out[kv[0]], err = strconv.ParseInt(kv[1], 10, 64) - if err != nil { - return err - } - } - if !s.changed { - *s.value = out - } else { - for k, v := range out { - (*s.value)[k] = v - } - } - s.changed = true - return nil -} - -func (s *stringToInt64Value) Type() string { - return "stringToInt64" -} - -func (s *stringToInt64Value) String() string { - var buf bytes.Buffer - i := 0 - for k, v := range *s.value { - if i > 0 { - buf.WriteRune(',') - } - buf.WriteString(k) - buf.WriteRune('=') - buf.WriteString(strconv.FormatInt(v, 10)) - i++ - } - return "[" + buf.String() + "]" -} - -func stringToInt64Conv(val string) (interface{}, error) { - val = strings.Trim(val, "[]") - // An empty string would cause an empty map - if len(val) == 0 { - return map[string]int64{}, nil - } - ss := strings.Split(val, ",") - out := make(map[string]int64, len(ss)) - for _, pair := range ss { - kv := strings.SplitN(pair, "=", 2) - if len(kv) != 2 { - return nil, fmt.Errorf("%s must be formatted as key=value", pair) - } - var err error - out[kv[0]], err = strconv.ParseInt(kv[1], 10, 64) - if err != nil { - return nil, err - } - } - return out, nil -} - -// GetStringToInt64 return the map[string]int64 value of a flag with the given name -func (f *FlagSet) GetStringToInt64(name string) (map[string]int64, error) { - val, err := f.getFlagType(name, "stringToInt64", stringToInt64Conv) - if err != nil { - return map[string]int64{}, err - } - return val.(map[string]int64), nil -} - -// StringToInt64Var defines a string flag with specified name, default value, and usage string. -// The argument p point64s to a map[string]int64 variable in which to store the values of the multiple flags. -// The value of each argument will not try to be separated by comma -func (f *FlagSet) StringToInt64Var(p *map[string]int64, name string, value map[string]int64, usage string) { - f.VarP(newStringToInt64Value(value, p), name, "", usage) -} - -// StringToInt64VarP is like StringToInt64Var, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) StringToInt64VarP(p *map[string]int64, name, shorthand string, value map[string]int64, usage string) { - f.VarP(newStringToInt64Value(value, p), name, shorthand, usage) -} - -// StringToInt64Var defines a string flag with specified name, default value, and usage string. -// The argument p point64s to a map[string]int64 variable in which to store the value of the flag. -// The value of each argument will not try to be separated by comma -func StringToInt64Var(p *map[string]int64, name string, value map[string]int64, usage string) { - CommandLine.VarP(newStringToInt64Value(value, p), name, "", usage) -} - -// StringToInt64VarP is like StringToInt64Var, but accepts a shorthand letter that can be used after a single dash. -func StringToInt64VarP(p *map[string]int64, name, shorthand string, value map[string]int64, usage string) { - CommandLine.VarP(newStringToInt64Value(value, p), name, shorthand, usage) -} - -// StringToInt64 defines a string flag with specified name, default value, and usage string. -// The return value is the address of a map[string]int64 variable that stores the value of the flag. -// The value of each argument will not try to be separated by comma -func (f *FlagSet) StringToInt64(name string, value map[string]int64, usage string) *map[string]int64 { - p := map[string]int64{} - f.StringToInt64VarP(&p, name, "", value, usage) - return &p -} - -// StringToInt64P is like StringToInt64, but accepts a shorthand letter that can be used after a single dash. -func (f *FlagSet) StringToInt64P(name, shorthand string, value map[string]int64, usage string) *map[string]int64 { - p := map[string]int64{} - f.StringToInt64VarP(&p, name, shorthand, value, usage) - return &p -} - -// StringToInt64 defines a string flag with specified name, default value, and usage string. -// The return value is the address of a map[string]int64 variable that stores the value of the flag. -// The value of each argument will not try to be separated by comma -func StringToInt64(name string, value map[string]int64, usage string) *map[string]int64 { - return CommandLine.StringToInt64P(name, "", value, usage) -} - -// StringToInt64P is like StringToInt64, but accepts a shorthand letter that can be used after a single dash. -func StringToInt64P(name, shorthand string, value map[string]int64, usage string) *map[string]int64 { - return CommandLine.StringToInt64P(name, shorthand, value, usage) -} diff --git a/vendor/github.com/spf13/pflag/uint_slice.go b/vendor/github.com/spf13/pflag/uint_slice.go index 5fa924835e..edd94c600a 100644 --- a/vendor/github.com/spf13/pflag/uint_slice.go +++ b/vendor/github.com/spf13/pflag/uint_slice.go @@ -50,48 +50,6 @@ func (s *uintSliceValue) String() string { return "[" + strings.Join(out, ",") + "]" } -func (s *uintSliceValue) fromString(val string) (uint, error) { - t, err := strconv.ParseUint(val, 10, 0) - if err != nil { - return 0, err - } - return uint(t), nil -} - -func (s *uintSliceValue) toString(val uint) string { - return fmt.Sprintf("%d", val) -} - -func (s *uintSliceValue) Append(val string) error { - i, err := s.fromString(val) - if err != nil { - return err - } - *s.value = append(*s.value, i) - return nil -} - -func (s *uintSliceValue) Replace(val []string) error { - out := make([]uint, len(val)) - for i, d := range val { - var err error - out[i], err = s.fromString(d) - if err != nil { - return err - } - } - *s.value = out - return nil -} - -func (s *uintSliceValue) GetSlice() []string { - out := make([]string, len(*s.value)) - for i, d := range *s.value { - out[i] = s.toString(d) - } - return out -} - func uintSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry diff --git a/vendor/github.com/stretchr/testify/assert/assertion_compare.go b/vendor/github.com/stretchr/testify/assert/assertion_compare.go index 41649d2679..dc200395ce 100644 --- a/vendor/github.com/stretchr/testify/assert/assertion_compare.go +++ b/vendor/github.com/stretchr/testify/assert/assertion_compare.go @@ -13,42 +13,12 @@ const ( compareGreater ) -var ( - intType = reflect.TypeOf(int(1)) - int8Type = reflect.TypeOf(int8(1)) - int16Type = reflect.TypeOf(int16(1)) - int32Type = reflect.TypeOf(int32(1)) - int64Type = reflect.TypeOf(int64(1)) - - uintType = reflect.TypeOf(uint(1)) - uint8Type = reflect.TypeOf(uint8(1)) - uint16Type = reflect.TypeOf(uint16(1)) - uint32Type = reflect.TypeOf(uint32(1)) - uint64Type = reflect.TypeOf(uint64(1)) - - float32Type = reflect.TypeOf(float32(1)) - float64Type = reflect.TypeOf(float64(1)) - - stringType = reflect.TypeOf("") -) - func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { - obj1Value := reflect.ValueOf(obj1) - obj2Value := reflect.ValueOf(obj2) - - // throughout this switch we try and avoid calling .Convert() if possible, - // as this has a pretty big performance impact switch kind { case reflect.Int: { - intobj1, ok := obj1.(int) - if !ok { - intobj1 = obj1Value.Convert(intType).Interface().(int) - } - intobj2, ok := obj2.(int) - if !ok { - intobj2 = obj2Value.Convert(intType).Interface().(int) - } + intobj1 := obj1.(int) + intobj2 := obj2.(int) if intobj1 > intobj2 { return compareGreater, true } @@ -61,14 +31,8 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Int8: { - int8obj1, ok := obj1.(int8) - if !ok { - int8obj1 = obj1Value.Convert(int8Type).Interface().(int8) - } - int8obj2, ok := obj2.(int8) - if !ok { - int8obj2 = obj2Value.Convert(int8Type).Interface().(int8) - } + int8obj1 := obj1.(int8) + int8obj2 := obj2.(int8) if int8obj1 > int8obj2 { return compareGreater, true } @@ -81,14 +45,8 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Int16: { - int16obj1, ok := obj1.(int16) - if !ok { - int16obj1 = obj1Value.Convert(int16Type).Interface().(int16) - } - int16obj2, ok := obj2.(int16) - if !ok { - int16obj2 = obj2Value.Convert(int16Type).Interface().(int16) - } + int16obj1 := obj1.(int16) + int16obj2 := obj2.(int16) if int16obj1 > int16obj2 { return compareGreater, true } @@ -101,14 +59,8 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Int32: { - int32obj1, ok := obj1.(int32) - if !ok { - int32obj1 = obj1Value.Convert(int32Type).Interface().(int32) - } - int32obj2, ok := obj2.(int32) - if !ok { - int32obj2 = obj2Value.Convert(int32Type).Interface().(int32) - } + int32obj1 := obj1.(int32) + int32obj2 := obj2.(int32) if int32obj1 > int32obj2 { return compareGreater, true } @@ -121,14 +73,8 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Int64: { - int64obj1, ok := obj1.(int64) - if !ok { - int64obj1 = obj1Value.Convert(int64Type).Interface().(int64) - } - int64obj2, ok := obj2.(int64) - if !ok { - int64obj2 = obj2Value.Convert(int64Type).Interface().(int64) - } + int64obj1 := obj1.(int64) + int64obj2 := obj2.(int64) if int64obj1 > int64obj2 { return compareGreater, true } @@ -141,14 +87,8 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint: { - uintobj1, ok := obj1.(uint) - if !ok { - uintobj1 = obj1Value.Convert(uintType).Interface().(uint) - } - uintobj2, ok := obj2.(uint) - if !ok { - uintobj2 = obj2Value.Convert(uintType).Interface().(uint) - } + uintobj1 := obj1.(uint) + uintobj2 := obj2.(uint) if uintobj1 > uintobj2 { return compareGreater, true } @@ -161,14 +101,8 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint8: { - uint8obj1, ok := obj1.(uint8) - if !ok { - uint8obj1 = obj1Value.Convert(uint8Type).Interface().(uint8) - } - uint8obj2, ok := obj2.(uint8) - if !ok { - uint8obj2 = obj2Value.Convert(uint8Type).Interface().(uint8) - } + uint8obj1 := obj1.(uint8) + uint8obj2 := obj2.(uint8) if uint8obj1 > uint8obj2 { return compareGreater, true } @@ -181,14 +115,8 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint16: { - uint16obj1, ok := obj1.(uint16) - if !ok { - uint16obj1 = obj1Value.Convert(uint16Type).Interface().(uint16) - } - uint16obj2, ok := obj2.(uint16) - if !ok { - uint16obj2 = obj2Value.Convert(uint16Type).Interface().(uint16) - } + uint16obj1 := obj1.(uint16) + uint16obj2 := obj2.(uint16) if uint16obj1 > uint16obj2 { return compareGreater, true } @@ -201,14 +129,8 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint32: { - uint32obj1, ok := obj1.(uint32) - if !ok { - uint32obj1 = obj1Value.Convert(uint32Type).Interface().(uint32) - } - uint32obj2, ok := obj2.(uint32) - if !ok { - uint32obj2 = obj2Value.Convert(uint32Type).Interface().(uint32) - } + uint32obj1 := obj1.(uint32) + uint32obj2 := obj2.(uint32) if uint32obj1 > uint32obj2 { return compareGreater, true } @@ -221,14 +143,8 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint64: { - uint64obj1, ok := obj1.(uint64) - if !ok { - uint64obj1 = obj1Value.Convert(uint64Type).Interface().(uint64) - } - uint64obj2, ok := obj2.(uint64) - if !ok { - uint64obj2 = obj2Value.Convert(uint64Type).Interface().(uint64) - } + uint64obj1 := obj1.(uint64) + uint64obj2 := obj2.(uint64) if uint64obj1 > uint64obj2 { return compareGreater, true } @@ -241,14 +157,8 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Float32: { - float32obj1, ok := obj1.(float32) - if !ok { - float32obj1 = obj1Value.Convert(float32Type).Interface().(float32) - } - float32obj2, ok := obj2.(float32) - if !ok { - float32obj2 = obj2Value.Convert(float32Type).Interface().(float32) - } + float32obj1 := obj1.(float32) + float32obj2 := obj2.(float32) if float32obj1 > float32obj2 { return compareGreater, true } @@ -261,14 +171,8 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Float64: { - float64obj1, ok := obj1.(float64) - if !ok { - float64obj1 = obj1Value.Convert(float64Type).Interface().(float64) - } - float64obj2, ok := obj2.(float64) - if !ok { - float64obj2 = obj2Value.Convert(float64Type).Interface().(float64) - } + float64obj1 := obj1.(float64) + float64obj2 := obj2.(float64) if float64obj1 > float64obj2 { return compareGreater, true } @@ -281,14 +185,8 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.String: { - stringobj1, ok := obj1.(string) - if !ok { - stringobj1 = obj1Value.Convert(stringType).Interface().(string) - } - stringobj2, ok := obj2.(string) - if !ok { - stringobj2 = obj2Value.Convert(stringType).Interface().(string) - } + stringobj1 := obj1.(string) + stringobj2 := obj2.(string) if stringobj1 > stringobj2 { return compareGreater, true } @@ -342,24 +240,6 @@ func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...inter return compareTwoValues(t, e1, e2, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs) } -// Positive asserts that the specified element is positive -// -// assert.Positive(t, 1) -// assert.Positive(t, 1.23) -func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) bool { - zero := reflect.Zero(reflect.TypeOf(e)) - return compareTwoValues(t, e, zero.Interface(), []CompareType{compareGreater}, "\"%v\" is not positive", msgAndArgs) -} - -// Negative asserts that the specified element is negative -// -// assert.Negative(t, -1) -// assert.Negative(t, -1.23) -func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) bool { - zero := reflect.Zero(reflect.TypeOf(e)) - return compareTwoValues(t, e, zero.Interface(), []CompareType{compareLess}, "\"%v\" is not negative", msgAndArgs) -} - func compareTwoValues(t TestingT, e1 interface{}, e2 interface{}, allowedComparesResults []CompareType, failMessage string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() diff --git a/vendor/github.com/stretchr/testify/assert/assertion_format.go b/vendor/github.com/stretchr/testify/assert/assertion_format.go index 4dfd1229a8..49370eb167 100644 --- a/vendor/github.com/stretchr/testify/assert/assertion_format.go +++ b/vendor/github.com/stretchr/testify/assert/assertion_format.go @@ -114,24 +114,6 @@ func Errorf(t TestingT, err error, msg string, args ...interface{}) bool { return Error(t, err, append([]interface{}{msg}, args...)...) } -// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. -// This is a wrapper for errors.As. -func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...interface{}) bool { - if h, ok := t.(tHelper); ok { - h.Helper() - } - return ErrorAs(t, err, target, append([]interface{}{msg}, args...)...) -} - -// ErrorIsf asserts that at least one of the errors in err's chain matches target. -// This is a wrapper for errors.Is. -func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) bool { - if h, ok := t.(tHelper); ok { - h.Helper() - } - return ErrorIs(t, err, target, append([]interface{}{msg}, args...)...) -} - // Eventuallyf asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // @@ -339,54 +321,6 @@ func InEpsilonSlicef(t TestingT, expected interface{}, actual interface{}, epsil return InEpsilonSlice(t, expected, actual, epsilon, append([]interface{}{msg}, args...)...) } -// IsDecreasingf asserts that the collection is decreasing -// -// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted") -// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted") -// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted") -func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { - if h, ok := t.(tHelper); ok { - h.Helper() - } - return IsDecreasing(t, object, append([]interface{}{msg}, args...)...) -} - -// IsIncreasingf asserts that the collection is increasing -// -// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted") -// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted") -// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted") -func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { - if h, ok := t.(tHelper); ok { - h.Helper() - } - return IsIncreasing(t, object, append([]interface{}{msg}, args...)...) -} - -// IsNonDecreasingf asserts that the collection is not decreasing -// -// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted") -// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted") -// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted") -func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { - if h, ok := t.(tHelper); ok { - h.Helper() - } - return IsNonDecreasing(t, object, append([]interface{}{msg}, args...)...) -} - -// IsNonIncreasingf asserts that the collection is not increasing -// -// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted") -// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted") -// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted") -func IsNonIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { - if h, ok := t.(tHelper); ok { - h.Helper() - } - return IsNonIncreasing(t, object, append([]interface{}{msg}, args...)...) -} - // IsTypef asserts that the specified objects are of the same type. func IsTypef(t TestingT, expectedType interface{}, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { @@ -441,17 +375,6 @@ func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args . return LessOrEqual(t, e1, e2, append([]interface{}{msg}, args...)...) } -// Negativef asserts that the specified element is negative -// -// assert.Negativef(t, -1, "error message %s", "formatted") -// assert.Negativef(t, -1.23, "error message %s", "formatted") -func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) bool { - if h, ok := t.(tHelper); ok { - h.Helper() - } - return Negative(t, e, append([]interface{}{msg}, args...)...) -} - // Neverf asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // @@ -553,15 +476,6 @@ func NotEqualValuesf(t TestingT, expected interface{}, actual interface{}, msg s return NotEqualValues(t, expected, actual, append([]interface{}{msg}, args...)...) } -// NotErrorIsf asserts that at none of the errors in err's chain matches target. -// This is a wrapper for errors.Is. -func NotErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) bool { - if h, ok := t.(tHelper); ok { - h.Helper() - } - return NotErrorIs(t, err, target, append([]interface{}{msg}, args...)...) -} - // NotNilf asserts that the specified object is not nil. // // assert.NotNilf(t, err, "error message %s", "formatted") @@ -658,17 +572,6 @@ func PanicsWithValuef(t TestingT, expected interface{}, f PanicTestFunc, msg str return PanicsWithValue(t, expected, f, append([]interface{}{msg}, args...)...) } -// Positivef asserts that the specified element is positive -// -// assert.Positivef(t, 1, "error message %s", "formatted") -// assert.Positivef(t, 1.23, "error message %s", "formatted") -func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) bool { - if h, ok := t.(tHelper); ok { - h.Helper() - } - return Positive(t, e, append([]interface{}{msg}, args...)...) -} - // Regexpf asserts that a specified regexp matches a string. // // assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") diff --git a/vendor/github.com/stretchr/testify/assert/assertion_forward.go b/vendor/github.com/stretchr/testify/assert/assertion_forward.go index 25337a6f07..9db889427a 100644 --- a/vendor/github.com/stretchr/testify/assert/assertion_forward.go +++ b/vendor/github.com/stretchr/testify/assert/assertion_forward.go @@ -204,42 +204,6 @@ func (a *Assertions) Error(err error, msgAndArgs ...interface{}) bool { return Error(a.t, err, msgAndArgs...) } -// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. -// This is a wrapper for errors.As. -func (a *Assertions) ErrorAs(err error, target interface{}, msgAndArgs ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return ErrorAs(a.t, err, target, msgAndArgs...) -} - -// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. -// This is a wrapper for errors.As. -func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return ErrorAsf(a.t, err, target, msg, args...) -} - -// ErrorIs asserts that at least one of the errors in err's chain matches target. -// This is a wrapper for errors.Is. -func (a *Assertions) ErrorIs(err error, target error, msgAndArgs ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return ErrorIs(a.t, err, target, msgAndArgs...) -} - -// ErrorIsf asserts that at least one of the errors in err's chain matches target. -// This is a wrapper for errors.Is. -func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return ErrorIsf(a.t, err, target, msg, args...) -} - // Errorf asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() @@ -667,102 +631,6 @@ func (a *Assertions) InEpsilonf(expected interface{}, actual interface{}, epsilo return InEpsilonf(a.t, expected, actual, epsilon, msg, args...) } -// IsDecreasing asserts that the collection is decreasing -// -// a.IsDecreasing([]int{2, 1, 0}) -// a.IsDecreasing([]float{2, 1}) -// a.IsDecreasing([]string{"b", "a"}) -func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return IsDecreasing(a.t, object, msgAndArgs...) -} - -// IsDecreasingf asserts that the collection is decreasing -// -// a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted") -// a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted") -// a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted") -func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return IsDecreasingf(a.t, object, msg, args...) -} - -// IsIncreasing asserts that the collection is increasing -// -// a.IsIncreasing([]int{1, 2, 3}) -// a.IsIncreasing([]float{1, 2}) -// a.IsIncreasing([]string{"a", "b"}) -func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return IsIncreasing(a.t, object, msgAndArgs...) -} - -// IsIncreasingf asserts that the collection is increasing -// -// a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted") -// a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted") -// a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted") -func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return IsIncreasingf(a.t, object, msg, args...) -} - -// IsNonDecreasing asserts that the collection is not decreasing -// -// a.IsNonDecreasing([]int{1, 1, 2}) -// a.IsNonDecreasing([]float{1, 2}) -// a.IsNonDecreasing([]string{"a", "b"}) -func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return IsNonDecreasing(a.t, object, msgAndArgs...) -} - -// IsNonDecreasingf asserts that the collection is not decreasing -// -// a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted") -// a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted") -// a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted") -func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return IsNonDecreasingf(a.t, object, msg, args...) -} - -// IsNonIncreasing asserts that the collection is not increasing -// -// a.IsNonIncreasing([]int{2, 1, 1}) -// a.IsNonIncreasing([]float{2, 1}) -// a.IsNonIncreasing([]string{"b", "a"}) -func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return IsNonIncreasing(a.t, object, msgAndArgs...) -} - -// IsNonIncreasingf asserts that the collection is not increasing -// -// a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted") -// a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted") -// a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted") -func (a *Assertions) IsNonIncreasingf(object interface{}, msg string, args ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return IsNonIncreasingf(a.t, object, msg, args...) -} - // IsType asserts that the specified objects are of the same type. func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { @@ -871,28 +739,6 @@ func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...i return Lessf(a.t, e1, e2, msg, args...) } -// Negative asserts that the specified element is negative -// -// a.Negative(-1) -// a.Negative(-1.23) -func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return Negative(a.t, e, msgAndArgs...) -} - -// Negativef asserts that the specified element is negative -// -// a.Negativef(-1, "error message %s", "formatted") -// a.Negativef(-1.23, "error message %s", "formatted") -func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return Negativef(a.t, e, msg, args...) -} - // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // @@ -1095,24 +941,6 @@ func (a *Assertions) NotEqualf(expected interface{}, actual interface{}, msg str return NotEqualf(a.t, expected, actual, msg, args...) } -// NotErrorIs asserts that at none of the errors in err's chain matches target. -// This is a wrapper for errors.Is. -func (a *Assertions) NotErrorIs(err error, target error, msgAndArgs ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return NotErrorIs(a.t, err, target, msgAndArgs...) -} - -// NotErrorIsf asserts that at none of the errors in err's chain matches target. -// This is a wrapper for errors.Is. -func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return NotErrorIsf(a.t, err, target, msg, args...) -} - // NotNil asserts that the specified object is not nil. // // a.NotNil(err) @@ -1305,28 +1133,6 @@ func (a *Assertions) Panicsf(f PanicTestFunc, msg string, args ...interface{}) b return Panicsf(a.t, f, msg, args...) } -// Positive asserts that the specified element is positive -// -// a.Positive(1) -// a.Positive(1.23) -func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return Positive(a.t, e, msgAndArgs...) -} - -// Positivef asserts that the specified element is positive -// -// a.Positivef(1, "error message %s", "formatted") -// a.Positivef(1.23, "error message %s", "formatted") -func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) bool { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - return Positivef(a.t, e, msg, args...) -} - // Regexp asserts that a specified regexp matches a string. // // a.Regexp(regexp.MustCompile("start"), "it's starting") diff --git a/vendor/github.com/stretchr/testify/assert/assertion_order.go b/vendor/github.com/stretchr/testify/assert/assertion_order.go deleted file mode 100644 index 1c3b47182a..0000000000 --- a/vendor/github.com/stretchr/testify/assert/assertion_order.go +++ /dev/null @@ -1,81 +0,0 @@ -package assert - -import ( - "fmt" - "reflect" -) - -// isOrdered checks that collection contains orderable elements. -func isOrdered(t TestingT, object interface{}, allowedComparesResults []CompareType, failMessage string, msgAndArgs ...interface{}) bool { - objKind := reflect.TypeOf(object).Kind() - if objKind != reflect.Slice && objKind != reflect.Array { - return false - } - - objValue := reflect.ValueOf(object) - objLen := objValue.Len() - - if objLen <= 1 { - return true - } - - value := objValue.Index(0) - valueInterface := value.Interface() - firstValueKind := value.Kind() - - for i := 1; i < objLen; i++ { - prevValue := value - prevValueInterface := valueInterface - - value = objValue.Index(i) - valueInterface = value.Interface() - - compareResult, isComparable := compare(prevValueInterface, valueInterface, firstValueKind) - - if !isComparable { - return Fail(t, fmt.Sprintf("Can not compare type \"%s\" and \"%s\"", reflect.TypeOf(value), reflect.TypeOf(prevValue)), msgAndArgs...) - } - - if !containsValue(allowedComparesResults, compareResult) { - return Fail(t, fmt.Sprintf(failMessage, prevValue, value), msgAndArgs...) - } - } - - return true -} - -// IsIncreasing asserts that the collection is increasing -// -// assert.IsIncreasing(t, []int{1, 2, 3}) -// assert.IsIncreasing(t, []float{1, 2}) -// assert.IsIncreasing(t, []string{"a", "b"}) -func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { - return isOrdered(t, object, []CompareType{compareLess}, "\"%v\" is not less than \"%v\"", msgAndArgs) -} - -// IsNonIncreasing asserts that the collection is not increasing -// -// assert.IsNonIncreasing(t, []int{2, 1, 1}) -// assert.IsNonIncreasing(t, []float{2, 1}) -// assert.IsNonIncreasing(t, []string{"b", "a"}) -func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { - return isOrdered(t, object, []CompareType{compareEqual, compareGreater}, "\"%v\" is not greater than or equal to \"%v\"", msgAndArgs) -} - -// IsDecreasing asserts that the collection is decreasing -// -// assert.IsDecreasing(t, []int{2, 1, 0}) -// assert.IsDecreasing(t, []float{2, 1}) -// assert.IsDecreasing(t, []string{"b", "a"}) -func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { - return isOrdered(t, object, []CompareType{compareGreater}, "\"%v\" is not greater than \"%v\"", msgAndArgs) -} - -// IsNonDecreasing asserts that the collection is not decreasing -// -// assert.IsNonDecreasing(t, []int{1, 1, 2}) -// assert.IsNonDecreasing(t, []float{1, 2}) -// assert.IsNonDecreasing(t, []string{"a", "b"}) -func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { - return isOrdered(t, object, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs) -} diff --git a/vendor/github.com/stretchr/testify/assert/assertions.go b/vendor/github.com/stretchr/testify/assert/assertions.go index bcac4401f5..914a10d83a 100644 --- a/vendor/github.com/stretchr/testify/assert/assertions.go +++ b/vendor/github.com/stretchr/testify/assert/assertions.go @@ -172,8 +172,8 @@ func isTest(name, prefix string) bool { if len(name) == len(prefix) { // "Test" is ok return true } - r, _ := utf8.DecodeRuneInString(name[len(prefix):]) - return !unicode.IsLower(r) + rune, _ := utf8.DecodeRuneInString(name[len(prefix):]) + return !unicode.IsLower(rune) } func messageFromMsgAndArgs(msgAndArgs ...interface{}) string { @@ -1622,7 +1622,6 @@ var spewConfig = spew.ConfigState{ DisableCapacities: true, SortKeys: true, DisableMethods: true, - MaxDepth: 10, } type tHelper interface { @@ -1694,81 +1693,3 @@ func Never(t TestingT, condition func() bool, waitFor time.Duration, tick time.D } } } - -// ErrorIs asserts that at least one of the errors in err's chain matches target. -// This is a wrapper for errors.Is. -func ErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if errors.Is(err, target) { - return true - } - - var expectedText string - if target != nil { - expectedText = target.Error() - } - - chain := buildErrorChainString(err) - - return Fail(t, fmt.Sprintf("Target error should be in err chain:\n"+ - "expected: %q\n"+ - "in chain: %s", expectedText, chain, - ), msgAndArgs...) -} - -// NotErrorIs asserts that at none of the errors in err's chain matches target. -// This is a wrapper for errors.Is. -func NotErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if !errors.Is(err, target) { - return true - } - - var expectedText string - if target != nil { - expectedText = target.Error() - } - - chain := buildErrorChainString(err) - - return Fail(t, fmt.Sprintf("Target error should not be in err chain:\n"+ - "found: %q\n"+ - "in chain: %s", expectedText, chain, - ), msgAndArgs...) -} - -// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. -// This is a wrapper for errors.As. -func ErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{}) bool { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if errors.As(err, target) { - return true - } - - chain := buildErrorChainString(err) - - return Fail(t, fmt.Sprintf("Should be in error chain:\n"+ - "expected: %q\n"+ - "in chain: %s", target, chain, - ), msgAndArgs...) -} - -func buildErrorChainString(err error) string { - if err == nil { - return "" - } - - e := errors.Unwrap(err) - chain := fmt.Sprintf("%q", err.Error()) - for e != nil { - chain += fmt.Sprintf("\n\t%q", e.Error()) - e = errors.Unwrap(e) - } - return chain -} diff --git a/vendor/github.com/stretchr/testify/mock/mock.go b/vendor/github.com/stretchr/testify/mock/mock.go index e2e6a2d237..c6df4485ab 100644 --- a/vendor/github.com/stretchr/testify/mock/mock.go +++ b/vendor/github.com/stretchr/testify/mock/mock.go @@ -297,52 +297,25 @@ func (m *Mock) findExpectedCall(method string, arguments ...interface{}) (int, * return -1, expectedCall } -type matchCandidate struct { - call *Call - mismatch string - diffCount int -} - -func (c matchCandidate) isBetterMatchThan(other matchCandidate) bool { - if c.call == nil { - return false - } - if other.call == nil { - return true - } - - if c.diffCount > other.diffCount { - return false - } - if c.diffCount < other.diffCount { - return true - } - - if c.call.Repeatability > 0 && other.call.Repeatability <= 0 { - return true - } - return false -} - func (m *Mock) findClosestCall(method string, arguments ...interface{}) (*Call, string) { - var bestMatch matchCandidate + var diffCount int + var closestCall *Call + var err string for _, call := range m.expectedCalls() { if call.Method == method { errInfo, tempDiffCount := call.Arguments.Diff(arguments) - tempCandidate := matchCandidate{ - call: call, - mismatch: errInfo, - diffCount: tempDiffCount, - } - if tempCandidate.isBetterMatchThan(bestMatch) { - bestMatch = tempCandidate + if tempDiffCount < diffCount || diffCount == 0 { + diffCount = tempDiffCount + closestCall = call + err = errInfo } + } } - return bestMatch.call, bestMatch.mismatch + return closestCall, err } func callString(method string, arguments Arguments, includeArgumentValues bool) string { diff --git a/vendor/github.com/stretchr/testify/require/require.go b/vendor/github.com/stretchr/testify/require/require.go index 51820df2e6..ec4624b282 100644 --- a/vendor/github.com/stretchr/testify/require/require.go +++ b/vendor/github.com/stretchr/testify/require/require.go @@ -256,54 +256,6 @@ func Error(t TestingT, err error, msgAndArgs ...interface{}) { t.FailNow() } -// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. -// This is a wrapper for errors.As. -func ErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.ErrorAs(t, err, target, msgAndArgs...) { - return - } - t.FailNow() -} - -// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. -// This is a wrapper for errors.As. -func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.ErrorAsf(t, err, target, msg, args...) { - return - } - t.FailNow() -} - -// ErrorIs asserts that at least one of the errors in err's chain matches target. -// This is a wrapper for errors.Is. -func ErrorIs(t TestingT, err error, target error, msgAndArgs ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.ErrorIs(t, err, target, msgAndArgs...) { - return - } - t.FailNow() -} - -// ErrorIsf asserts that at least one of the errors in err's chain matches target. -// This is a wrapper for errors.Is. -func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.ErrorIsf(t, err, target, msg, args...) { - return - } - t.FailNow() -} - // Errorf asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() @@ -854,126 +806,6 @@ func InEpsilonf(t TestingT, expected interface{}, actual interface{}, epsilon fl t.FailNow() } -// IsDecreasing asserts that the collection is decreasing -// -// assert.IsDecreasing(t, []int{2, 1, 0}) -// assert.IsDecreasing(t, []float{2, 1}) -// assert.IsDecreasing(t, []string{"b", "a"}) -func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.IsDecreasing(t, object, msgAndArgs...) { - return - } - t.FailNow() -} - -// IsDecreasingf asserts that the collection is decreasing -// -// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted") -// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted") -// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted") -func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.IsDecreasingf(t, object, msg, args...) { - return - } - t.FailNow() -} - -// IsIncreasing asserts that the collection is increasing -// -// assert.IsIncreasing(t, []int{1, 2, 3}) -// assert.IsIncreasing(t, []float{1, 2}) -// assert.IsIncreasing(t, []string{"a", "b"}) -func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.IsIncreasing(t, object, msgAndArgs...) { - return - } - t.FailNow() -} - -// IsIncreasingf asserts that the collection is increasing -// -// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted") -// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted") -// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted") -func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.IsIncreasingf(t, object, msg, args...) { - return - } - t.FailNow() -} - -// IsNonDecreasing asserts that the collection is not decreasing -// -// assert.IsNonDecreasing(t, []int{1, 1, 2}) -// assert.IsNonDecreasing(t, []float{1, 2}) -// assert.IsNonDecreasing(t, []string{"a", "b"}) -func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.IsNonDecreasing(t, object, msgAndArgs...) { - return - } - t.FailNow() -} - -// IsNonDecreasingf asserts that the collection is not decreasing -// -// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted") -// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted") -// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted") -func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.IsNonDecreasingf(t, object, msg, args...) { - return - } - t.FailNow() -} - -// IsNonIncreasing asserts that the collection is not increasing -// -// assert.IsNonIncreasing(t, []int{2, 1, 1}) -// assert.IsNonIncreasing(t, []float{2, 1}) -// assert.IsNonIncreasing(t, []string{"b", "a"}) -func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.IsNonIncreasing(t, object, msgAndArgs...) { - return - } - t.FailNow() -} - -// IsNonIncreasingf asserts that the collection is not increasing -// -// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted") -// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted") -// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted") -func IsNonIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.IsNonIncreasingf(t, object, msg, args...) { - return - } - t.FailNow() -} - // IsType asserts that the specified objects are of the same type. func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { @@ -1112,34 +944,6 @@ func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...inter t.FailNow() } -// Negative asserts that the specified element is negative -// -// assert.Negative(t, -1) -// assert.Negative(t, -1.23) -func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.Negative(t, e, msgAndArgs...) { - return - } - t.FailNow() -} - -// Negativef asserts that the specified element is negative -// -// assert.Negativef(t, -1, "error message %s", "formatted") -// assert.Negativef(t, -1.23, "error message %s", "formatted") -func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.Negativef(t, e, msg, args...) { - return - } - t.FailNow() -} - // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // @@ -1396,30 +1200,6 @@ func NotEqualf(t TestingT, expected interface{}, actual interface{}, msg string, t.FailNow() } -// NotErrorIs asserts that at none of the errors in err's chain matches target. -// This is a wrapper for errors.Is. -func NotErrorIs(t TestingT, err error, target error, msgAndArgs ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.NotErrorIs(t, err, target, msgAndArgs...) { - return - } - t.FailNow() -} - -// NotErrorIsf asserts that at none of the errors in err's chain matches target. -// This is a wrapper for errors.Is. -func NotErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.NotErrorIsf(t, err, target, msg, args...) { - return - } - t.FailNow() -} - // NotNil asserts that the specified object is not nil. // // assert.NotNil(t, err) @@ -1666,34 +1446,6 @@ func Panicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{} t.FailNow() } -// Positive asserts that the specified element is positive -// -// assert.Positive(t, 1) -// assert.Positive(t, 1.23) -func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.Positive(t, e, msgAndArgs...) { - return - } - t.FailNow() -} - -// Positivef asserts that the specified element is positive -// -// assert.Positivef(t, 1, "error message %s", "formatted") -// assert.Positivef(t, 1.23, "error message %s", "formatted") -func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) { - if h, ok := t.(tHelper); ok { - h.Helper() - } - if assert.Positivef(t, e, msg, args...) { - return - } - t.FailNow() -} - // Regexp asserts that a specified regexp matches a string. // // assert.Regexp(t, regexp.MustCompile("start"), "it's starting") diff --git a/vendor/github.com/stretchr/testify/require/require_forward.go b/vendor/github.com/stretchr/testify/require/require_forward.go index ed54a9d83f..103d7dcb6a 100644 --- a/vendor/github.com/stretchr/testify/require/require_forward.go +++ b/vendor/github.com/stretchr/testify/require/require_forward.go @@ -205,42 +205,6 @@ func (a *Assertions) Error(err error, msgAndArgs ...interface{}) { Error(a.t, err, msgAndArgs...) } -// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. -// This is a wrapper for errors.As. -func (a *Assertions) ErrorAs(err error, target interface{}, msgAndArgs ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - ErrorAs(a.t, err, target, msgAndArgs...) -} - -// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. -// This is a wrapper for errors.As. -func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - ErrorAsf(a.t, err, target, msg, args...) -} - -// ErrorIs asserts that at least one of the errors in err's chain matches target. -// This is a wrapper for errors.Is. -func (a *Assertions) ErrorIs(err error, target error, msgAndArgs ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - ErrorIs(a.t, err, target, msgAndArgs...) -} - -// ErrorIsf asserts that at least one of the errors in err's chain matches target. -// This is a wrapper for errors.Is. -func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - ErrorIsf(a.t, err, target, msg, args...) -} - // Errorf asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() @@ -668,102 +632,6 @@ func (a *Assertions) InEpsilonf(expected interface{}, actual interface{}, epsilo InEpsilonf(a.t, expected, actual, epsilon, msg, args...) } -// IsDecreasing asserts that the collection is decreasing -// -// a.IsDecreasing([]int{2, 1, 0}) -// a.IsDecreasing([]float{2, 1}) -// a.IsDecreasing([]string{"b", "a"}) -func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - IsDecreasing(a.t, object, msgAndArgs...) -} - -// IsDecreasingf asserts that the collection is decreasing -// -// a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted") -// a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted") -// a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted") -func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - IsDecreasingf(a.t, object, msg, args...) -} - -// IsIncreasing asserts that the collection is increasing -// -// a.IsIncreasing([]int{1, 2, 3}) -// a.IsIncreasing([]float{1, 2}) -// a.IsIncreasing([]string{"a", "b"}) -func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - IsIncreasing(a.t, object, msgAndArgs...) -} - -// IsIncreasingf asserts that the collection is increasing -// -// a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted") -// a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted") -// a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted") -func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - IsIncreasingf(a.t, object, msg, args...) -} - -// IsNonDecreasing asserts that the collection is not decreasing -// -// a.IsNonDecreasing([]int{1, 1, 2}) -// a.IsNonDecreasing([]float{1, 2}) -// a.IsNonDecreasing([]string{"a", "b"}) -func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - IsNonDecreasing(a.t, object, msgAndArgs...) -} - -// IsNonDecreasingf asserts that the collection is not decreasing -// -// a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted") -// a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted") -// a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted") -func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - IsNonDecreasingf(a.t, object, msg, args...) -} - -// IsNonIncreasing asserts that the collection is not increasing -// -// a.IsNonIncreasing([]int{2, 1, 1}) -// a.IsNonIncreasing([]float{2, 1}) -// a.IsNonIncreasing([]string{"b", "a"}) -func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - IsNonIncreasing(a.t, object, msgAndArgs...) -} - -// IsNonIncreasingf asserts that the collection is not increasing -// -// a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted") -// a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted") -// a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted") -func (a *Assertions) IsNonIncreasingf(object interface{}, msg string, args ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - IsNonIncreasingf(a.t, object, msg, args...) -} - // IsType asserts that the specified objects are of the same type. func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { @@ -872,28 +740,6 @@ func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...i Lessf(a.t, e1, e2, msg, args...) } -// Negative asserts that the specified element is negative -// -// a.Negative(-1) -// a.Negative(-1.23) -func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - Negative(a.t, e, msgAndArgs...) -} - -// Negativef asserts that the specified element is negative -// -// a.Negativef(-1, "error message %s", "formatted") -// a.Negativef(-1.23, "error message %s", "formatted") -func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - Negativef(a.t, e, msg, args...) -} - // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // @@ -1096,24 +942,6 @@ func (a *Assertions) NotEqualf(expected interface{}, actual interface{}, msg str NotEqualf(a.t, expected, actual, msg, args...) } -// NotErrorIs asserts that at none of the errors in err's chain matches target. -// This is a wrapper for errors.Is. -func (a *Assertions) NotErrorIs(err error, target error, msgAndArgs ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - NotErrorIs(a.t, err, target, msgAndArgs...) -} - -// NotErrorIsf asserts that at none of the errors in err's chain matches target. -// This is a wrapper for errors.Is. -func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - NotErrorIsf(a.t, err, target, msg, args...) -} - // NotNil asserts that the specified object is not nil. // // a.NotNil(err) @@ -1306,28 +1134,6 @@ func (a *Assertions) Panicsf(f assert.PanicTestFunc, msg string, args ...interfa Panicsf(a.t, f, msg, args...) } -// Positive asserts that the specified element is positive -// -// a.Positive(1) -// a.Positive(1.23) -func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - Positive(a.t, e, msgAndArgs...) -} - -// Positivef asserts that the specified element is positive -// -// a.Positivef(1, "error message %s", "formatted") -// a.Positivef(1.23, "error message %s", "formatted") -func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) { - if h, ok := a.t.(tHelper); ok { - h.Helper() - } - Positivef(a.t, e, msg, args...) -} - // Regexp asserts that a specified regexp matches a string. // // a.Regexp(regexp.MustCompile("start"), "it's starting") diff --git a/vendor/github.com/tjfoc/gmsm/sm4/sm4.go b/vendor/github.com/tjfoc/gmsm/sm4/sm4.go index a87484085a..d97f35c2dc 100644 --- a/vendor/github.com/tjfoc/gmsm/sm4/sm4.go +++ b/vendor/github.com/tjfoc/gmsm/sm4/sm4.go @@ -12,16 +12,20 @@ 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. -sm4 acceleration +sm4 acceration modified by Jack, 2017 Oct */ package sm4 import ( - "bytes" "crypto/cipher" + "crypto/rand" + "crypto/x509" + "encoding/pem" "errors" + "io/ioutil" + "os" "strconv" ) @@ -29,6 +33,8 @@ const BlockSize = 16 type SM4Key []byte +type KeySizeError int + // Cipher is an instance of SM4 encryption. type Sm4Cipher struct { subkeys []uint32 @@ -228,260 +234,117 @@ func generateSubKeys(key []byte) []uint32 { return subkeys } -// NewCipher creates and returns a new cipher.Block. -func NewCipher(key []byte) (cipher.Block, error) { - if len(key) != BlockSize { - return nil, errors.New("SM4: invalid key size " + strconv.Itoa(len(key))) - } - c := new(Sm4Cipher) - c.subkeys = generateSubKeys(key) - c.block1 = make([]uint32, 4) - c.block2 = make([]byte, 16) - return c, nil -} - -func (c *Sm4Cipher) BlockSize() int { - return BlockSize -} - -func (c *Sm4Cipher) Encrypt(dst, src []byte) { - cryptBlock(c.subkeys, c.block1, c.block2, dst, src, false) +func EncryptBlock(key SM4Key, dst, src []byte) { + subkeys := generateSubKeys(key) + cryptBlock(subkeys, make([]uint32, 4), make([]byte, 16), dst, src, false) } - - -func (c *Sm4Cipher) Decrypt(dst, src []byte) { - cryptBlock(c.subkeys, c.block1, c.block2, dst, src, true) +func DecryptBlock(key SM4Key, dst, src []byte) { + subkeys := generateSubKeys(key) + cryptBlock(subkeys, make([]uint32, 4), make([]byte, 16), dst, src, true) } - - -func xor(in, iv []byte) (out []byte) { - if len(in) != len(iv) { - return nil +func ReadKeyFromMem(data []byte, pwd []byte) (SM4Key, error) { + block, _ := pem.Decode(data) + if block == nil { + return nil, errors.New("SM4: pem decode failed") } - - out = make([]byte, len(in)) - for i := 0; i < len(in); i++ { - out[i] = in[i] ^ iv[i] - } - return -} - -func pkcs7Padding(src []byte) []byte { - padding := BlockSize - len(src)%BlockSize - padtext := bytes.Repeat([]byte{byte(padding)}, padding) - return append(src, padtext...) -} - -func pkcs7UnPadding(src []byte) ([]byte, error) { - length := len(src) - unpadding := int(src[length-1]) - if unpadding > BlockSize || unpadding == 0 { - return nil, errors.New("Invalid pkcs7 padding (unpadding > BlockSize || unpadding == 0)") - } - - pad := src[len(src)-unpadding:] - for i := 0; i < unpadding; i++ { - if pad[i] != byte(unpadding) { - return nil, errors.New("Invalid pkcs7 padding (pad[i] != unpadding)") + if x509.IsEncryptedPEMBlock(block) { + if block.Type != "SM4 ENCRYPTED KEY" { + return nil, errors.New("SM4: unknown type") } - } - - return src[:(length - unpadding)], nil -} - -func Sm4Cbc(key []byte, in []byte, mode bool) (out []byte, err error) { - if len(key) != BlockSize { - return nil, errors.New("SM4: invalid key size " + strconv.Itoa(len(key))) - } - var inData []byte - if mode { - inData = pkcs7Padding(in) - } else { - inData = in - } - - iv := make([]byte, BlockSize) - - out = make([]byte, len(inData)) - c, err := NewCipher(key) - if err != nil { - panic(err) - } - if mode { - for i := 0; i < len(inData)/16; i++ { - in_tmp := xor(inData[i*16:i*16+16], iv) - out_tmp := make([]byte, 16) - c.Encrypt(out_tmp, in_tmp) - copy(out[i*16:i*16+16], out_tmp) - iv = out_tmp + if pwd == nil { + return nil, errors.New("SM4: need passwd") } - } else { - for i := 0; i < len(inData)/16; i++ { - in_tmp := inData[i*16 : i*16+16] - out_tmp := make([]byte, 16) - c.Decrypt(out_tmp, in_tmp) - out_tmp = xor(out_tmp, iv) - copy(out[i*16:i*16+16], out_tmp) - iv = in_tmp + data, err := x509.DecryptPEMBlock(block, pwd) + if err != nil { + return nil, err } - out, _ = pkcs7UnPadding(out) + return data, nil } - - return out, nil -} -func Sm4Ecb(key []byte, in []byte, mode bool) (out []byte, err error) { - if len(key) != BlockSize { - return nil, errors.New("SM4: invalid key size " + strconv.Itoa(len(key))) - } - var inData []byte - if mode { - inData = pkcs7Padding(in) - } else { - inData = in + if block.Type != "SM4 KEY" { + return nil, errors.New("SM4: unknown type") } - out = make([]byte, len(inData)) - c, err := NewCipher(key) + return block.Bytes, nil +} + +func ReadKeyFromPem(FileName string, pwd []byte) (SM4Key, error) { + data, err := ioutil.ReadFile(FileName) if err != nil { - panic(err) + return nil, err } - if mode { - for i := 0; i < len(inData)/16; i++ { - in_tmp := inData[i*16 : i*16+16] - out_tmp := make([]byte, 16) - c.Encrypt(out_tmp, in_tmp) - copy(out[i*16:i*16+16], out_tmp) + return ReadKeyFromMem(data, pwd) +} + +func WriteKeytoMem(key SM4Key, pwd []byte) ([]byte, error) { + if pwd != nil { + block, err := x509.EncryptPEMBlock(rand.Reader, + "SM4 ENCRYPTED KEY", key, pwd, x509.PEMCipherAES256) + if err != nil { + return nil, err } + return pem.EncodeToMemory(block), nil } else { - for i := 0; i < len(inData)/16; i++ { - in_tmp := inData[i*16 : i*16+16] - out_tmp := make([]byte, 16) - c.Decrypt(out_tmp, in_tmp) - copy(out[i*16:i*16+16], out_tmp) + block := &pem.Block{ + Type: "SM4 KEY", + Bytes: key, } - out, _ = pkcs7UnPadding(out) + return pem.EncodeToMemory(block), nil } - - return out, nil } -//密码反馈模式(Cipher FeedBack (CFB)) -//https://blog.csdn.net/zy_strive_2012/article/details/102520356 -//https://blog.csdn.net/sinat_23338865/article/details/72869841 -func Sm4CFB(key []byte, in []byte, mode bool) (out []byte, err error) { - if len(key) != BlockSize { - return nil, errors.New("SM4: invalid key size " + strconv.Itoa(len(key))) - } - var inData []byte - if mode { - inData = pkcs7Padding(in) +func WriteKeyToPem(FileName string, key SM4Key, pwd []byte) (bool, error) { + var block *pem.Block + + if pwd != nil { + var err error + block, err = x509.EncryptPEMBlock(rand.Reader, + "SM4 ENCRYPTED KEY", key, pwd, x509.PEMCipherAES256) + if err != nil { + return false, err + } } else { - inData = in + block = &pem.Block{ + Type: "SM4 KEY", + Bytes: key, + } } - - iv := make([]byte, BlockSize) - out = make([]byte, len(inData)) - c, err := NewCipher(key) + file, err := os.Create(FileName) if err != nil { - panic(err) + return false, err } - - K := make([]byte, BlockSize) - cipherBlock := make([]byte, BlockSize) - plainBlock := make([]byte, BlockSize) - if mode { //加密 - for i := 0; i < len(inData)/16; i++ { - if i == 0 { - c.Encrypt(K, iv) - cipherBlock = xor(K[:BlockSize], inData[i*16:i*16+16]) - copy(out[i*16:i*16+16], cipherBlock) - //copy(cipherBlock,out_tmp) - continue - } - c.Encrypt(K, cipherBlock) - cipherBlock = xor(K[:BlockSize], inData[i*16:i*16+16]) - copy(out[i*16:i*16+16], cipherBlock) - //copy(cipherBlock,out_tmp) - } - - } else { //解密 - var i int = 0 - for ; i < len(inData)/16; i++ { - if i == 0 { - c.Encrypt(K, iv) //这里是加密,而不是调用解密方法Decrypt - plainBlock = xor(K[:BlockSize], inData[i*16:i*16+16]) //获取明文分组 - copy(out[i*16:i*16+16], plainBlock) - continue - } - c.Encrypt(K, inData[(i-1)*16:(i-1)*16+16]) - plainBlock = xor(K[:BlockSize], inData[i*16:i*16+16]) //获取明文分组 - copy(out[i*16:i*16+16], plainBlock) - - } - - out, _ = pkcs7UnPadding(out) + defer file.Close() + err = pem.Encode(file, block) + if err != nil { + return false, nil } + return true, nil +} - return out, nil +func (k KeySizeError) Error() string { + return "SM4: invalid key size " + strconv.Itoa(int(k)) } -//输出反馈模式(Output feedback, OFB) -//https://blog.csdn.net/chengqiuming/article/details/82390910 -//https://blog.csdn.net/sinat_23338865/article/details/72869841 -func Sm4OFB(key []byte, in []byte, mode bool) (out []byte, err error) { +// NewCipher creates and returns a new cipher.Block. +func NewCipher(key []byte) (cipher.Block, error) { if len(key) != BlockSize { - return nil, errors.New("SM4: invalid key size " + strconv.Itoa(len(key))) - } - var inData []byte - if mode { - inData = pkcs7Padding(in) - } else { - inData = in - } - - iv := make([]byte, BlockSize) - out = make([]byte, len(inData)) - c, err := NewCipher(key) - if err != nil { - panic(err) + return nil, KeySizeError(len(key)) } + c := new(Sm4Cipher) + c.subkeys = generateSubKeys(key) + c.block1 = make([]uint32, 4) + c.block2 = make([]byte, 16) + return c, nil +} - K := make([]byte, BlockSize) - cipherBlock := make([]byte, BlockSize) - plainBlock := make([]byte, BlockSize) - shiftIV := make([]byte, BlockSize) - if mode { //加密 - for i := 0; i < len(inData)/16; i++ { - if i == 0 { - c.Encrypt(K, iv) - cipherBlock = xor(K[:BlockSize], inData[i*16:i*16+16]) - copy(out[i*16:i*16+16], cipherBlock) - copy(shiftIV, K[:BlockSize]) - continue - } - c.Encrypt(K, shiftIV) - cipherBlock = xor(K[:BlockSize], inData[i*16:i*16+16]) - copy(out[i*16:i*16+16], cipherBlock) - copy(shiftIV, K[:BlockSize]) - } +func (c *Sm4Cipher) BlockSize() int { + return BlockSize +} - } else { //解密 - for i := 0; i < len(inData)/16; i++ { - if i == 0 { - c.Encrypt(K, iv) //这里是加密,而不是调用解密方法Decrypt - plainBlock = xor(K[:BlockSize], inData[i*16:i*16+16]) //获取明文分组 - copy(out[i*16:i*16+16], plainBlock) - copy(shiftIV, K[:BlockSize]) - continue - } - c.Encrypt(K, shiftIV) - plainBlock = xor(K[:BlockSize], inData[i*16:i*16+16]) //获取明文分组 - copy(out[i*16:i*16+16], plainBlock) - copy(shiftIV, K[:BlockSize]) - } - out, _ = pkcs7UnPadding(out) - } +func (c *Sm4Cipher) Encrypt(dst, src []byte) { + cryptBlock(c.subkeys, c.block1, c.block2, dst, src, false) +} - return out, nil +func (c *Sm4Cipher) Decrypt(dst, src []byte) { + cryptBlock(c.subkeys, c.block1, c.block2, dst, src, true) } diff --git a/vendor/github.com/tjfoc/gmsm/sm4/sm4_gcm.go b/vendor/github.com/tjfoc/gmsm/sm4/sm4_gcm.go deleted file mode 100644 index 40b73f8d13..0000000000 --- a/vendor/github.com/tjfoc/gmsm/sm4/sm4_gcm.go +++ /dev/null @@ -1,332 +0,0 @@ -/* -Copyright Hyperledger-TWGC All Rights Reserved. -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. - -writed by Zhiwei Yan, 2020 Oct -*/ -package sm4 - -import ( - "errors" - "strconv" -) - -//Paper: The Galois/Counter Mode of Operation (GCM) David A. Mcgrew,John Viega .2004. -func Sm4GCM(key []byte, IV ,in, A []byte, mode bool) ([]byte, []byte, error) { - if len(key) != BlockSize { - return nil,nil, errors.New("SM4: invalid key size " + strconv.Itoa(len(key))) - } - if mode { - C,T:=GCMEncrypt(key,IV,in,A) - return C,T,nil - }else{ - P,_T:=GCMDecrypt(key,IV,in,A) - return P,_T,nil - } -} - -func GetH(key []byte) (H []byte){ - c,err := NewCipher(key) - if err != nil { - panic(err) - } - - zores:=make([]byte, BlockSize) - H =make([]byte, BlockSize) - c.Encrypt(H,zores) - return H -} - -//ut = a + b -func addition(a ,b []byte) (out []byte){ - Len:=len(a) - if Len != len(b) { - return nil - } - out = make([]byte, Len) - for i := 0; i < Len; i++ { - out[i] = a[i] ^ b[i] - } - return out -} - -func Rightshift(V []byte){ - n:=len(V) - for i:=n-1;i>=0;i-- { - V[i]=V[i]>>1 - if i!=0{ - V[i]=((V[i-1]&0x01)<<7)|V[i] - } - } -} - -func findYi( Y []byte,index int) int{ - var temp byte - temp=Y[index/8] - temp=temp>>(7-index%8) - if temp & 0x01 == 1{ - return 1 - }else{ - return 0 - } -} - - -func multiplication(X,Y []byte) (Z []byte){ - - R:=make([]byte,BlockSize) - R[0]=0xe1 - Z=make([]byte,BlockSize) - V:=make([]byte,BlockSize) - copy(V,X) - for i:=0;i<=127;i++{ - if findYi(Y,i)==1{ - Z=addition(Z,V) - } - if V[BlockSize-1]&0x01==0{ - Rightshift(V) - }else{ - Rightshift(V) - V=addition(V,R) - } - } - return Z -} - -func GHASH(H []byte,A []byte,C []byte) (X[]byte){ - - calculm_v:=func(m ,v int) (int,int) { - if(m==0 && v!=0){ - m=1 - v=v*8 - }else if(m!=0 && v==0) { - v=BlockSize*8 - }else if(m!=0 && v!=0){ - m=m+1 - v=v*8 - }else { //m==0 && v==0 - m=1 - v=0 - } - return m,v - } - m:=len(A)/BlockSize - v:=len(A)%BlockSize - m,v=calculm_v(m,v) - - n:=len(C)/BlockSize - u:=(len(C)%BlockSize) - n,u=calculm_v(n,u) - - //i=0 - X=make([]byte,BlockSize*(m+n+2)) //X0 = 0 - for i:=0;im-1 对于数组来说是 0-->m-2 - } - - //i=m - zeros:=make([]byte,(128-v)/8) - Am:=make([]byte,v/8) - copy(Am[:],A[(m-1)*BlockSize:]) - Am=append(Am,zeros...) - copy(X[m*BlockSize:m*BlockSize+BlockSize],multiplication( addition(X[(m-1)*BlockSize:(m-1)*BlockSize+BlockSize],Am),H)) - - //i=m+1...m+n-1 - for i:=m+1;i<=(m+n-1);i++{ - copy(X[i*BlockSize:i*BlockSize+BlockSize],multiplication( addition(X[(i-1)*BlockSize:(i-1)*BlockSize+BlockSize],C[(i-m-1)*BlockSize:(i-m-1)*BlockSize+BlockSize]),H)) - } - - //i=m+n - zeros =make([]byte,(128-u)/8) - Cn:=make([]byte,u/8) - copy(Cn[:],C[(n-1)*BlockSize:]) - Cn=append(Cn,zeros...) - copy(X[(m+n)*BlockSize:(m+n)*BlockSize+BlockSize],multiplication( addition(X[(m+n-1)*BlockSize:(m+n-1)*BlockSize+BlockSize],Cn),H)) - - //i=m+n+1 - var lenAB []byte - calculateLenToBytes :=func(len int) []byte{ - data:=make([]byte,8) - data[0]=byte((len>>56)&0xff) - data[1]=byte((len>>48)&0xff) - data[2]=byte((len>>40)&0xff) - data[3]=byte((len>>32)&0xff) - data[4]=byte((len>>24)&0xff) - data[5]=byte((len>>16)&0xff) - data[6]=byte((len>>8)&0xff) - data[7]=byte((len>>0)&0xff) - return data - } - lenAB=append(lenAB,calculateLenToBytes(len(A))...) - lenAB=append(lenAB,calculateLenToBytes(len(C))...) - copy(X[(m+n+1)*BlockSize:(m+n+1)*BlockSize+BlockSize],multiplication(addition(X[(m+n)*BlockSize:(m+n)*BlockSize+BlockSize],lenAB),H)) - return X[(m+n+1)*BlockSize:(m+n+1)*BlockSize+BlockSize] -} - - -func GetY0(H,IV []byte) []byte{ - if len(IV)*8 == 96 { - zero31one1:=[]byte{0x00,0x00,0x00,0x01} - IV=append(IV,zero31one1...) - return IV - }else{ - return GHASH(H,[]byte{},IV) - - } - -} - -func incr(n int ,Y_i []byte) (Y_ii []byte) { - - Y_ii=make([]byte,BlockSize*n) - copy(Y_ii,Y_i) - - addYone:=func(yi,yii []byte){ - copy(yii[:],yi[:]) - - Len:=len(yi) - var rc byte=0x00 - for i:=Len-1;i>=0;i--{ - if(i==Len-1){ - if(yii[i]<0xff){ - yii[i]=yii[i]+0x01 - rc=0x00 - }else{ - yii[i]=0x00 - rc=0x01 - } - }else{ - if yii[i]+rc<0xff { - yii[i]=yii[i]+rc - rc=0x00 - }else{ - yii[i]=0x00 - rc=0x01 - } - } - } - } - for i:=1;i= 0 { - unix.Close(fd) - return int64(200112), nil - } - return 0, nil - } - return _POSIX_IPV6, nil - case SC_MESSAGE_PASSING: - if _POSIX_MESSAGE_PASSING == 0 { - return yesno(sysctl32("p1003_1b.message_passing")), nil - } - return _POSIX_MESSAGE_PASSING, nil - case SC_PRIORITIZED_IO: - if _POSIX_PRIORITIZED_IO == 0 { - return yesno(sysctl32("p1003_1b.prioritized_io")), nil - } - return _POSIX_PRIORITIZED_IO, nil - case SC_PRIORITY_SCHEDULING: - if _POSIX_PRIORITY_SCHEDULING == 0 { - return yesno(sysctl32("p1003_1b.priority_scheduling")), nil - } - return _POSIX_PRIORITY_SCHEDULING, nil - case SC_REALTIME_SIGNALS: - if _POSIX_REALTIME_SIGNALS == 0 { - return yesno(sysctl32("p1003_1b.realtime_signals")), nil - } - return _POSIX_REALTIME_SIGNALS, nil - case SC_SAVED_IDS: - return yesno(sysctl32("kern.saved_ids")), nil - case SC_SEMAPHORES: - if _POSIX_SEMAPHORES == 0 { - return yesno(sysctl32("p1003_1b.semaphores")), nil - } - return _POSIX_SEMAPHORES, nil - case SC_SPAWN: - return _POSIX_SPAWN, nil - case SC_SPIN_LOCKS: - return _POSIX_SPIN_LOCKS, nil - case SC_SPORADIC_SERVER: - return _POSIX_SPORADIC_SERVER, nil - case SC_SS_REPL_MAX: - return _POSIX_SS_REPL_MAX, nil - case SC_SYNCHRONIZED_IO: - if _POSIX_SYNCHRONIZED_IO == 0 { - return yesno(sysctl32("p1003_1b.synchronized_io")), nil - } - return _POSIX_SYNCHRONIZED_IO, nil - case SC_THREAD_ATTR_STACKADDR: - return _POSIX_THREAD_ATTR_STACKADDR, nil - case SC_THREAD_ATTR_STACKSIZE: - return _POSIX_THREAD_ATTR_STACKSIZE, nil - case SC_THREAD_CPUTIME: - return _POSIX_THREAD_CPUTIME, nil - case SC_THREAD_PRIORITY_SCHEDULING: - return _POSIX_THREAD_PRIORITY_SCHEDULING, nil - case SC_THREAD_PROCESS_SHARED: - return _POSIX_THREAD_PROCESS_SHARED, nil - case SC_THREAD_SAFE_FUNCTIONS: - return _POSIX_THREAD_SAFE_FUNCTIONS, nil - case SC_THREAD_SPORADIC_SERVER: - return _POSIX_THREAD_SPORADIC_SERVER, nil - case SC_TIMERS: - if _POSIX_TIMERS == 0 { - return yesno(sysctl32("p1003_1b.timers")), nil - } - return _POSIX_TIMERS, nil - case SC_TRACE: - return _POSIX_TRACE, nil - case SC_TRACE_EVENT_FILTER: - return _POSIX_TRACE_EVENT_FILTER, nil - case SC_TRACE_EVENT_NAME_MAX: - return _POSIX_TRACE_EVENT_NAME_MAX, nil - case SC_TRACE_INHERIT: - return _POSIX_TRACE_INHERIT, nil - case SC_TRACE_LOG: - return _POSIX_TRACE_LOG, nil - case SC_TRACE_NAME_MAX: - return _POSIX_TRACE_NAME_MAX, nil - case SC_TRACE_SYS_MAX: - return _POSIX_TRACE_SYS_MAX, nil - case SC_TRACE_USER_EVENT_MAX: - return _POSIX_TRACE_USER_EVENT_MAX, nil - case SC_TYPED_MEMORY_OBJECTS: - return _POSIX_TYPED_MEMORY_OBJECTS, nil - case SC_VERSION: - // TODO(tk): darwin libc uses sysctl(CTL_KERN, KERN_POSIX1) - return _POSIX_VERSION, nil - - case SC_V6_ILP32_OFF32: - if _V6_ILP32_OFF32 == 0 { - if unix.SizeofInt*_CHAR_BIT == 32 && - unix.SizeofInt == unix.SizeofLong && - unix.SizeofLong == unix.SizeofPtr && - unix.SizeofPtr == sizeofOffT { - return 1, nil - } - return -1, nil - } - return _V6_ILP32_OFF32, nil - case SC_V6_ILP32_OFFBIG: - if _V6_ILP32_OFFBIG == 0 { - if unix.SizeofInt*_CHAR_BIT == 32 && - unix.SizeofInt == unix.SizeofLong && - unix.SizeofLong == unix.SizeofPtr && - sizeofOffT*_CHAR_BIT >= 64 { - return 1, nil - } - return -1, nil - } - return _V6_ILP32_OFFBIG, nil - case SC_V6_LP64_OFF64: - if _V6_LP64_OFF64 == 0 { - if unix.SizeofInt*_CHAR_BIT == 32 && - unix.SizeofLong*_CHAR_BIT == 64 && - unix.SizeofLong == unix.SizeofPtr && - unix.SizeofPtr == sizeofOffT { - return 1, nil - } - return -1, nil - } - return _V6_LP64_OFF64, nil - case SC_V6_LPBIG_OFFBIG: - if _V6_LPBIG_OFFBIG == 0 { - if unix.SizeofInt*_CHAR_BIT >= 32 && - unix.SizeofLong*_CHAR_BIT >= 64 && - unix.SizeofPtr*_CHAR_BIT >= 64 && - sizeofOffT*_CHAR_BIT >= 64 { - return 1, nil - } - return -1, nil - } - return _V6_LPBIG_OFFBIG, nil - - case SC_2_CHAR_TERM: - return _POSIX2_CHAR_TERM, nil - case SC_2_PBS, - SC_2_PBS_ACCOUNTING, - SC_2_PBS_CHECKPOINT, - SC_2_PBS_LOCATE, - SC_2_PBS_MESSAGE, - SC_2_PBS_TRACK: - return _POSIX2_PBS, nil - case SC_2_UPE: - return _POSIX2_UPE, nil - - case SC_XOPEN_CRYPT: - return _XOPEN_CRYPT, nil - case SC_XOPEN_ENH_I18N: - return _XOPEN_ENH_I18N, nil - case SC_XOPEN_REALTIME: - return _XOPEN_REALTIME, nil - case SC_XOPEN_REALTIME_THREADS: - return _XOPEN_REALTIME_THREADS, nil - case SC_XOPEN_SHM: - return _XOPEN_SHM, nil - case SC_XOPEN_STREAMS: - return -1, nil - case SC_XOPEN_UNIX: - return _XOPEN_UNIX, nil - case SC_XOPEN_VERSION: - return _XOPEN_VERSION, nil - case SC_XOPEN_XCU_VERSION: - return _XOPEN_XCU_VERSION, nil - - case SC_PHYS_PAGES: - return sysctl64("hw.memsize") / int64(unix.Getpagesize()), nil - case SC_NPROCESSORS_CONF: - fallthrough - case SC_NPROCESSORS_ONLN: - return sysctl32("hw.ncpu"), nil - } - - return sysconfGeneric(name) -} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_dragonfly.go b/vendor/github.com/tklauser/go-sysconf/sysconf_dragonfly.go deleted file mode 100644 index c2ed8d12b4..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/sysconf_dragonfly.go +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright 2018 Tobias Klauser. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package sysconf - -import "golang.org/x/sys/unix" - -const ( - _HOST_NAME_MAX = _MAXHOSTNAMELEN - 1 - _LOGIN_NAME_MAX = _MAXLOGNAME - _SYMLOOP_MAX = _MAXSYMLINKS -) - -// sysconf implements sysconf(3) as in the FreeBSD 12 libc. -func sysconf(name int) (int64, error) { - switch name { - case SC_AIO_LISTIO_MAX: - return sysctl32("p1003_1b.aio_listio_max"), nil - case SC_AIO_MAX: - return sysctl32("p1003_1b.aio_max"), nil - case SC_AIO_PRIO_DELTA_MAX: - return sysctl32("p1003_1b.aio_prio_delta_max"), nil - case SC_ARG_MAX: - return sysctl32("kern.argmax"), nil - case SC_ATEXIT_MAX: - return _ATEXIT_SIZE, nil - case SC_CHILD_MAX: - var rlim unix.Rlimit - if err := unix.Getrlimit(unix.RLIMIT_NPROC, &rlim); err == nil { - if rlim.Cur != unix.RLIM_INFINITY { - return rlim.Cur, nil - } - } - return -1, nil - case SC_CLK_TCK: - return _CLK_TCK, nil - case SC_DELAYTIMER_MAX: - return yesno(sysctl32("p1003_1b.delaytimer_max")), nil - case SC_GETGR_R_SIZE_MAX, SC_GETPW_R_SIZE_MAX: - return -1, nil - case SC_IOV_MAX: - return sysctl32("kern.iov_max"), nil - case SC_MQ_OPEN_MAX: - return sysctl32("kern.mqueue.mq_open_max"), nil - case SC_MQ_PRIO_MAX: - return sysctl32("kern.mqueue.mq_prio_max"), nil - case SC_NGROUPS_MAX: - return sysctl32("kern.ngroups"), nil - case SC_OPEN_MAX: - var rlim unix.Rlimit - if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err == nil { - if rlim.Cur != unix.RLIM_INFINITY { - return rlim.Cur, nil - } - } - return -1, nil - case SC_RTSIG_MAX: - return yesno(sysctl32("p1003_1b.rtsig_max")), nil - case SC_SEM_NSEMS_MAX: - return -1, nil - case SC_SEM_VALUE_MAX: - return -1, nil - case SC_SIGQUEUE_MAX: - return yesno(sysctl32("p1003_1b.sigqueue_max")), nil - case SC_STREAM_MAX: - var rlim unix.Rlimit - if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err == nil { - if rlim.Cur != unix.RLIM_INFINITY { - return rlim.Cur, nil - } - } - return -1, nil - case SC_THREAD_DESTRUCTOR_ITERATIONS: - return _PTHREAD_DESTRUCTOR_ITERATIONS, nil - case SC_THREAD_KEYS_MAX: - return _PTHREAD_KEYS_MAX, nil - case SC_THREAD_PRIO_INHERIT: - return _POSIX_THREAD_PRIO_INHERIT, nil - case SC_THREAD_PRIO_PROTECT: - return _POSIX_THREAD_PRIO_PROTECT, nil - case SC_THREAD_STACK_MIN: - return _PTHREAD_STACK_MIN, nil - case SC_THREAD_THREADS_MAX: - return -1, nil - case SC_TIMER_MAX: - return yesno(sysctl32("p1003_1b.timer_max")), nil - case SC_TTY_NAME_MAX: - return pathconf(_PATH_DEV, _PC_NAME_MAX), nil - case SC_TZNAME_MAX: - return pathconf(_PATH_ZONEINFO, _PC_NAME_MAX), nil - - case SC_ASYNCHRONOUS_IO: - if _POSIX_ASYNCHRONOUS_IO == 0 { - return sysctl64("p1003_1b.asynchronous_io"), nil - } - return _POSIX_ASYNCHRONOUS_IO, nil - case SC_IPV6: - if _POSIX_IPV6 == 0 { - fd, err := unix.Socket(unix.AF_INET6, unix.SOCK_DGRAM, 0) - if err == nil && fd >= 0 { - unix.Close(fd) - return int64(200112), nil - } - return 0, nil - } - return _POSIX_IPV6, nil - case SC_MESSAGE_PASSING: - if _POSIX_MESSAGE_PASSING == 0 { - return yesno(sysctl32("p1003_1b.message_passing")), nil - } - return _POSIX_MESSAGE_PASSING, nil - case SC_PRIORITIZED_IO: - if _POSIX_PRIORITIZED_IO == 0 { - return yesno(sysctl32("p1003_1b.prioritized_io")), nil - } - return _POSIX_PRIORITIZED_IO, nil - case SC_PRIORITY_SCHEDULING: - if _POSIX_PRIORITY_SCHEDULING == 0 { - return yesno(sysctl32("p1003_1b.priority_scheduling")), nil - } - return _POSIX_PRIORITY_SCHEDULING, nil - case SC_REALTIME_SIGNALS: - if _POSIX_REALTIME_SIGNALS == 0 { - return yesno(sysctl32("p1003_1b.realtime_signals")), nil - } - return _POSIX_REALTIME_SIGNALS, nil - case SC_SAVED_IDS: - return yesno(sysctl32("kern.saved_ids")), nil - case SC_SEMAPHORES: - if _POSIX_SEMAPHORES == 0 { - return yesno(sysctl32("p1003_1b.semaphores")), nil - } - return _POSIX_SEMAPHORES, nil - case SC_SPAWN: - return _POSIX_SPAWN, nil - case SC_SPIN_LOCKS: - return _POSIX_SPIN_LOCKS, nil - case SC_SPORADIC_SERVER: - return _POSIX_SPORADIC_SERVER, nil - case SC_SYNCHRONIZED_IO: - if _POSIX_SYNCHRONIZED_IO == 0 { - return yesno(sysctl32("p1003_1b.synchronized_io")), nil - } - return _POSIX_SYNCHRONIZED_IO, nil - case SC_THREAD_ATTR_STACKADDR: - return _POSIX_THREAD_ATTR_STACKADDR, nil - case SC_THREAD_ATTR_STACKSIZE: - return _POSIX_THREAD_ATTR_STACKSIZE, nil - case SC_THREAD_CPUTIME: - return _POSIX_THREAD_CPUTIME, nil - case SC_THREAD_PRIORITY_SCHEDULING: - return _POSIX_THREAD_PRIORITY_SCHEDULING, nil - case SC_THREAD_PROCESS_SHARED: - return _POSIX_THREAD_PROCESS_SHARED, nil - case SC_THREAD_SAFE_FUNCTIONS: - return _POSIX_THREAD_SAFE_FUNCTIONS, nil - case SC_THREAD_SPORADIC_SERVER: - return _POSIX_THREAD_SPORADIC_SERVER, nil - case SC_TIMERS: - if _POSIX_TIMERS == 0 { - return yesno(sysctl32("p1003_1b.timers")), nil - } - return _POSIX_TIMERS, nil - case SC_TRACE: - return _POSIX_TRACE, nil - case SC_TYPED_MEMORY_OBJECTS: - return _POSIX_TYPED_MEMORY_OBJECTS, nil - case SC_VERSION: - // TODO(tk): FreeBSD libc uses sysctl(CTL_KERN, KERN_POSIX1) - return _POSIX_VERSION, nil - - /* TODO(tk): these need GOARCH-dependent integer size checks - case SC_V6_ILP32_OFF32: - return _V6_ILP32_OFF32, nil - case SC_V6_ILP32_OFFBIG: - return _V6_ILP32_OFFBIG, nil - case SC_V6_LP64_OFF64: - return _V6_LP64_OFF64, nil - case SC_V6_LPBIG_OFFBIG: - return _V6_LPBIG_OFFBIG, nil - */ - - case SC_2_CHAR_TERM: - return _POSIX2_CHAR_TERM, nil - case SC_2_PBS, - SC_2_PBS_ACCOUNTING, - SC_2_PBS_CHECKPOINT, - SC_2_PBS_LOCATE, - SC_2_PBS_MESSAGE, - SC_2_PBS_TRACK: - return _POSIX2_PBS, nil - case SC_2_UPE: - return _POSIX2_UPE, nil - - case SC_XOPEN_CRYPT: - return _XOPEN_CRYPT, nil - case SC_XOPEN_ENH_I18N: - return _XOPEN_ENH_I18N, nil - case SC_XOPEN_REALTIME: - return _XOPEN_REALTIME, nil - case SC_XOPEN_REALTIME_THREADS: - return _XOPEN_REALTIME_THREADS, nil - case SC_XOPEN_SHM: - return _XOPEN_SHM, nil - case SC_XOPEN_STREAMS: - return -1, nil - case SC_XOPEN_UNIX: - return _XOPEN_UNIX, nil - - case SC_PHYS_PAGES: - return sysctl64("hw.availpages"), nil - case SC_NPROCESSORS_CONF: - fallthrough - case SC_NPROCESSORS_ONLN: - return sysctl32("hw.ncpu"), nil - } - - return sysconfGeneric(name) -} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_freebsd.go b/vendor/github.com/tklauser/go-sysconf/sysconf_freebsd.go deleted file mode 100644 index b7939888ae..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/sysconf_freebsd.go +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright 2018 Tobias Klauser. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package sysconf - -import "golang.org/x/sys/unix" - -const ( - _HOST_NAME_MAX = _MAXHOSTNAMELEN - 1 - _LOGIN_NAME_MAX = _MAXLOGNAME - _SYMLOOP_MAX = _MAXSYMLINKS -) - -// sysconf implements sysconf(3) as in the FreeBSD 12 libc. -func sysconf(name int) (int64, error) { - switch name { - case SC_AIO_LISTIO_MAX: - return sysctl32("p1003_1b.aio_listio_max"), nil - case SC_AIO_MAX: - return sysctl32("p1003_1b.aio_max"), nil - case SC_AIO_PRIO_DELTA_MAX: - return sysctl32("p1003_1b.aio_prio_delta_max"), nil - case SC_ARG_MAX: - return sysctl32("kern.argmax"), nil - case SC_ATEXIT_MAX: - return _ATEXIT_SIZE, nil - case SC_CHILD_MAX: - var rlim unix.Rlimit - if err := unix.Getrlimit(unix.RLIMIT_NPROC, &rlim); err == nil { - if rlim.Cur != unix.RLIM_INFINITY { - return rlim.Cur, nil - } - } - return -1, nil - case SC_CLK_TCK: - return _CLK_TCK, nil - case SC_DELAYTIMER_MAX: - return sysctl32("p1003_1b.delaytimer_max"), nil - case SC_GETGR_R_SIZE_MAX, SC_GETPW_R_SIZE_MAX: - return -1, nil - case SC_IOV_MAX: - return sysctl32("kern.iov_max"), nil - case SC_MQ_OPEN_MAX: - return yesno(sysctl32("p1003_1b.mq_open_max")), nil - case SC_MQ_PRIO_MAX: - return _MQ_PRIO_MAX, nil - case SC_NGROUPS_MAX: - return sysctl32("kern.ngroups"), nil - case SC_OPEN_MAX: - var rlim unix.Rlimit - if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err == nil { - if rlim.Cur != unix.RLIM_INFINITY { - return rlim.Cur, nil - } - } - return -1, nil - case SC_RTSIG_MAX: - return sysctl32("p1003_1b.rtsig_max"), nil - case SC_SEM_NSEMS_MAX: - return -1, nil - case SC_SEM_VALUE_MAX: - return _SEM_VALUE_MAX, nil - case SC_SIGQUEUE_MAX: - return sysctl32("p1003_1b.sigqueue_max"), nil - case SC_STREAM_MAX: - var rlim unix.Rlimit - if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err != nil { - return -1, nil - } - if rlim.Cur == unix.RLIM_INFINITY { - return -1, nil - } - if rlim.Cur > _LONG_MAX { - return -1, unix.EOVERFLOW - } - if rlim.Cur > _SHRT_MAX { - return _SHRT_MAX, nil - } - return rlim.Cur, nil - case SC_THREAD_DESTRUCTOR_ITERATIONS: - return _PTHREAD_DESTRUCTOR_ITERATIONS, nil - case SC_THREAD_KEYS_MAX: - return _PTHREAD_KEYS_MAX, nil - case SC_THREAD_PRIO_INHERIT: - return _POSIX_THREAD_PRIO_INHERIT, nil - case SC_THREAD_PRIO_PROTECT: - return _POSIX_THREAD_PRIO_PROTECT, nil - case SC_THREAD_STACK_MIN: - return _PTHREAD_STACK_MIN, nil - case SC_THREAD_THREADS_MAX: - return -1, nil - case SC_TIMER_MAX: - return yesno(sysctl32("p1003_1b.timer_max")), nil - case SC_TTY_NAME_MAX: - return pathconf(_PATH_DEV, _PC_NAME_MAX), nil - case SC_TZNAME_MAX: - return pathconf(_PATH_ZONEINFO, _PC_NAME_MAX), nil - - case SC_IPV6: - if _POSIX_IPV6 == 0 { - fd, err := unix.Socket(unix.AF_INET6, unix.SOCK_DGRAM, 0) - if err == nil && fd >= 0 { - unix.Close(fd) - return int64(200112), nil - } - return 0, nil - } - return _POSIX_IPV6, nil - case SC_MESSAGE_PASSING: - if _POSIX_MESSAGE_PASSING == 0 { - return yesno(sysctl32("p1003_1b.message_passing")), nil - } - return _POSIX_MESSAGE_PASSING, nil - case SC_PRIORITIZED_IO: - if _POSIX_PRIORITIZED_IO == 0 { - return yesno(sysctl32("p1003_1b.prioritized_io")), nil - } - return _POSIX_PRIORITIZED_IO, nil - case SC_PRIORITY_SCHEDULING: - if _POSIX_PRIORITY_SCHEDULING == 0 { - return yesno(sysctl32("p1003_1b.priority_scheduling")), nil - } - return _POSIX_PRIORITY_SCHEDULING, nil - case SC_REALTIME_SIGNALS: - if _POSIX_REALTIME_SIGNALS == 0 { - return yesno(sysctl32("p1003_1b.realtime_signals")), nil - } - return _POSIX_REALTIME_SIGNALS, nil - case SC_SAVED_IDS: - return yesno(sysctl32("kern.saved_ids")), nil - case SC_SEMAPHORES: - if _POSIX_SEMAPHORES == 0 { - return yesno(sysctl32("p1003_1b.semaphores")), nil - } - return _POSIX_SEMAPHORES, nil - case SC_SPAWN: - return _POSIX_SPAWN, nil - case SC_SPIN_LOCKS: - return _POSIX_SPIN_LOCKS, nil - case SC_SPORADIC_SERVER: - return _POSIX_SPORADIC_SERVER, nil - case SC_SYNCHRONIZED_IO: - if _POSIX_SYNCHRONIZED_IO == 0 { - return yesno(sysctl32("p1003_1b.synchronized_io")), nil - } - return _POSIX_SYNCHRONIZED_IO, nil - case SC_THREAD_ATTR_STACKADDR: - return _POSIX_THREAD_ATTR_STACKADDR, nil - case SC_THREAD_ATTR_STACKSIZE: - return _POSIX_THREAD_ATTR_STACKSIZE, nil - case SC_THREAD_CPUTIME: - return _POSIX_THREAD_CPUTIME, nil - case SC_THREAD_PRIORITY_SCHEDULING: - return _POSIX_THREAD_PRIORITY_SCHEDULING, nil - case SC_THREAD_PROCESS_SHARED: - return _POSIX_THREAD_PROCESS_SHARED, nil - case SC_THREAD_SAFE_FUNCTIONS: - return _POSIX_THREAD_SAFE_FUNCTIONS, nil - case SC_TIMERS: - if _POSIX_TIMERS == 0 { - return yesno(sysctl32("p1003_1b.timers")), nil - } - return _POSIX_TIMERS, nil - case SC_TRACE: - return _POSIX_TRACE, nil - case SC_TYPED_MEMORY_OBJECTS: - return _POSIX_TYPED_MEMORY_OBJECTS, nil - case SC_VERSION: - // TODO(tk): FreeBSD libc uses sysctl(CTL_KERN, KERN_POSIX1) - return _POSIX_VERSION, nil - - /* TODO(tk): these need GOARCH-dependent integer size checks - case SC_V6_ILP32_OFF32: - return _V6_ILP32_OFF32, nil - case SC_V6_ILP32_OFFBIG: - return _V6_ILP32_OFFBIG, nil - case SC_V6_LP64_OFF64: - return _V6_LP64_OFF64, nil - case SC_V6_LPBIG_OFFBIG: - return _V6_LPBIG_OFFBIG, nil - */ - - case SC_2_CHAR_TERM: - return _POSIX2_CHAR_TERM, nil - case SC_2_PBS, - SC_2_PBS_ACCOUNTING, - SC_2_PBS_CHECKPOINT, - SC_2_PBS_LOCATE, - SC_2_PBS_MESSAGE, - SC_2_PBS_TRACK: - return _POSIX2_PBS, nil - case SC_2_UPE: - return _POSIX2_UPE, nil - - case SC_XOPEN_CRYPT: - return _XOPEN_CRYPT, nil - case SC_XOPEN_ENH_I18N: - return _XOPEN_ENH_I18N, nil - case SC_XOPEN_REALTIME: - return _XOPEN_REALTIME, nil - case SC_XOPEN_REALTIME_THREADS: - return _XOPEN_REALTIME_THREADS, nil - case SC_XOPEN_SHM: - return _XOPEN_SHM, nil - case SC_XOPEN_STREAMS: - return -1, nil - case SC_XOPEN_UNIX: - return _XOPEN_UNIX, nil - - case SC_PHYS_PAGES: - if val, err := unix.SysctlUint64("hw.availpages"); err == nil { - return int64(val), nil - } - return -1, nil - case SC_NPROCESSORS_CONF: - fallthrough - case SC_NPROCESSORS_ONLN: - if val, err := unix.SysctlUint32("hw.ncpu"); err == nil { - return int64(val), nil - } - return -1, nil - } - - return sysconfGeneric(name) -} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go b/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go deleted file mode 100644 index 248bdc99cd..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2021 Tobias Klauser. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd -// +build darwin dragonfly freebsd linux netbsd openbsd - -package sysconf - -import "os" - -func sysconfGeneric(name int) (int64, error) { - // POSIX default values - if sc, err := sysconfPOSIX(name); err == nil { - return sc, nil - } - - switch name { - case SC_BC_BASE_MAX: - return _BC_BASE_MAX, nil - case SC_BC_DIM_MAX: - return _BC_DIM_MAX, nil - case SC_BC_SCALE_MAX: - return _BC_SCALE_MAX, nil - case SC_BC_STRING_MAX: - return _BC_STRING_MAX, nil - case SC_COLL_WEIGHTS_MAX: - return _COLL_WEIGHTS_MAX, nil - case SC_EXPR_NEST_MAX: - return _EXPR_NEST_MAX, nil - case SC_HOST_NAME_MAX: - return _HOST_NAME_MAX, nil - case SC_LINE_MAX: - return _LINE_MAX, nil - case SC_LOGIN_NAME_MAX: - return _LOGIN_NAME_MAX, nil - case SC_PAGESIZE: // same as SC_PAGE_SIZE - return int64(os.Getpagesize()), nil - case SC_RE_DUP_MAX: - return _RE_DUP_MAX, nil - case SC_SYMLOOP_MAX: - return _SYMLOOP_MAX, nil - } - - return -1, errInvalid -} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_linux.go b/vendor/github.com/tklauser/go-sysconf/sysconf_linux.go deleted file mode 100644 index 355d96e2e5..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/sysconf_linux.go +++ /dev/null @@ -1,357 +0,0 @@ -// Copyright 2018 Tobias Klauser. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package sysconf - -import ( - "bufio" - "io/ioutil" - "os" - "runtime" - "strconv" - "strings" - - "github.com/tklauser/numcpus" - "golang.org/x/sys/unix" -) - -const ( - // CLK_TCK is a constant on Linux, see e.g. - // https://git.musl-libc.org/cgit/musl/tree/src/conf/sysconf.c#n30 and - // https://github.com/containerd/cgroups/pull/12 - _SYSTEM_CLK_TCK = 100 -) - -func readProcFsInt64(path string, fallback int64) int64 { - data, err := ioutil.ReadFile(path) - if err != nil { - return fallback - } - i, err := strconv.ParseInt(string(data[:len(data)-1]), 0, 64) - if err != nil { - return fallback - } - return i -} - -// getMemPages computes mem*unit/os.Getpagesize(), but avoids overflowing int64. -func getMemPages(mem uint64, unit uint32) int64 { - pageSize := os.Getpagesize() - for unit > 1 && pageSize > 1 { - unit >>= 1 - pageSize >>= 1 - } - mem *= uint64(unit) - for pageSize > 1 { - pageSize >>= 1 - mem >>= 1 - } - return int64(mem) -} - -func getPhysPages() int64 { - var si unix.Sysinfo_t - err := unix.Sysinfo(&si) - if err != nil { - return int64(0) - } - return getMemPages(uint64(si.Totalram), si.Unit) -} - -func getAvPhysPages() int64 { - var si unix.Sysinfo_t - err := unix.Sysinfo(&si) - if err != nil { - return int64(0) - } - return getMemPages(uint64(si.Freeram), si.Unit) -} - -func getNprocsSysfs() (int64, error) { - n, err := numcpus.GetOnline() - return int64(n), err -} - -func getNprocsProcStat() (int64, error) { - f, err := os.Open("/proc/stat") - if err != nil { - return -1, err - } - defer f.Close() - - count := int64(0) - s := bufio.NewScanner(f) - for s.Scan() { - if line := strings.TrimSpace(s.Text()); strings.HasPrefix(line, "cpu") { - l := strings.SplitN(line, " ", 2) - _, err := strconv.ParseInt(l[0][3:], 10, 64) - if err == nil { - count++ - } - } else { - // The current format of /proc/stat has all the - // cpu* lines at the beginning. Assume this - // stays this way. - break - } - } - return count, nil -} - -func getNprocs() int64 { - count, err := getNprocsSysfs() - if err == nil { - return count - } - - count, err = getNprocsProcStat() - if err == nil { - return count - } - - // default to the value determined at runtime startup if all else fails - return int64(runtime.NumCPU()) -} - -func getNprocsConf() int64 { - // TODO(tk): read /sys/devices/system/cpu/present instead? - d, err := os.Open("/sys/devices/system/cpu") - if err == nil { - defer d.Close() - fis, err := d.Readdir(-1) - if err == nil { - count := int64(0) - for _, fi := range fis { - if name := fi.Name(); fi.IsDir() && strings.HasPrefix(name, "cpu") { - _, err := strconv.ParseInt(name[3:], 10, 64) - if err == nil { - count++ - } - } - } - return count - } - } - - // TODO(tk): fall back to reading /proc/cpuinfo on legacy systems - // without sysfs? - - return getNprocs() -} - -func hasClock(clockid int32) bool { - var res unix.Timespec - if err := unix.ClockGetres(clockid, &res); err != nil { - return false - } - return true -} - -func max(a, b int64) int64 { - if a > b { - return a - } - return b -} - -func sysconf(name int) (int64, error) { - switch name { - case SC_AIO_LISTIO_MAX: - return -1, nil - case SC_AIO_MAX: - return -1, nil - case SC_AIO_PRIO_DELTA_MAX: - return _AIO_PRIO_DELTA_MAX, nil - case SC_ARG_MAX: - argMax := int64(_POSIX_ARG_MAX) - var rlim unix.Rlimit - if err := unix.Getrlimit(unix.RLIMIT_STACK, &rlim); err == nil { - argMax = max(argMax, int64(rlim.Cur/4)) - } - return argMax, nil - case SC_ATEXIT_MAX: - return _INT_MAX, nil - case SC_CHILD_MAX: - childMax := int64(-1) - var rlim unix.Rlimit - if err := unix.Getrlimit(unix.RLIMIT_NPROC, &rlim); err == nil && rlim.Cur != unix.RLIM_INFINITY { - childMax = int64(rlim.Cur) - } - return childMax, nil - case SC_CLK_TCK: - return _SYSTEM_CLK_TCK, nil - case SC_DELAYTIMER_MAX: - return _DELAYTIMER_MAX, nil - case SC_GETGR_R_SIZE_MAX: - return _NSS_BUFLEN_GROUP, nil - case SC_GETPW_R_SIZE_MAX: - return _NSS_BUFLEN_PASSWD, nil - case SC_MQ_OPEN_MAX: - return -1, nil - case SC_MQ_PRIO_MAX: - return _MQ_PRIO_MAX, nil - case SC_NGROUPS_MAX: - return readProcFsInt64("/proc/sys/kernel/ngroups_max", _NGROUPS_MAX), nil - case SC_OPEN_MAX: - openMax := int64(_OPEN_MAX) - var rlim unix.Rlimit - if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err == nil { - openMax = int64(rlim.Cur) - } - return openMax, nil - case SC_RTSIG_MAX: - return _RTSIG_MAX, nil - case SC_SEM_NSEMS_MAX: - return -1, nil - case SC_SEM_VALUE_MAX: - return _SEM_VALUE_MAX, nil - case SC_SIGQUEUE_MAX: - var rlim unix.Rlimit - if err := unix.Getrlimit(unix.RLIMIT_SIGPENDING, &rlim); err == nil { - return int64(rlim.Cur), nil - } - return readProcFsInt64("/proc/sys/kernel/rtsig-max", _POSIX_SIGQUEUE_MAX), nil - case SC_STREAM_MAX: - return _STREAM_MAX, nil - case SC_THREAD_DESTRUCTOR_ITERATIONS: - return _POSIX_THREAD_DESTRUCTOR_ITERATIONS, nil - case SC_THREAD_KEYS_MAX: - return _PTHREAD_KEYS_MAX, nil - case SC_THREAD_PRIO_INHERIT: - return _POSIX_THREAD_PRIO_INHERIT, nil - case SC_THREAD_PRIO_PROTECT: - return _POSIX_THREAD_PRIO_PROTECT, nil - case SC_THREAD_STACK_MIN: - return _PTHREAD_STACK_MIN, nil - case SC_THREAD_THREADS_MAX: - return -1, nil - case SC_TIMER_MAX: - return -1, nil - case SC_TTY_NAME_MAX: - return _TTY_NAME_MAX, nil - case SC_TZNAME_MAX: - return -1, nil - - case SC_CPUTIME: - if hasClock(unix.CLOCK_PROCESS_CPUTIME_ID) { - return _POSIX_VERSION, nil - } - return -1, nil - case SC_MONOTONIC_CLOCK: - if hasClock(unix.CLOCK_MONOTONIC) { - return _POSIX_VERSION, nil - } - return -1, nil - case SC_SAVED_IDS: - return _POSIX_SAVED_IDS, nil - case SC_SPAWN: - return _POSIX_SPAWN, nil - case SC_SPIN_LOCKS: - return _POSIX_SPIN_LOCKS, nil - case SC_SPORADIC_SERVER: - return _POSIX_SPORADIC_SERVER, nil - case SC_SYNCHRONIZED_IO: - return _POSIX_SYNCHRONIZED_IO, nil - case SC_THREAD_ATTR_STACKADDR: - return _POSIX_THREAD_ATTR_STACKADDR, nil - case SC_THREAD_ATTR_STACKSIZE: - return _POSIX_THREAD_ATTR_STACKSIZE, nil - case SC_THREAD_CPUTIME: - if hasClock(unix.CLOCK_THREAD_CPUTIME_ID) { - return _POSIX_VERSION, nil - } - return -1, nil - case SC_THREAD_PRIORITY_SCHEDULING: - return _POSIX_THREAD_PRIORITY_SCHEDULING, nil - case SC_THREAD_PROCESS_SHARED: - return _POSIX_THREAD_PROCESS_SHARED, nil - case SC_THREAD_SAFE_FUNCTIONS: - return _POSIX_THREAD_SAFE_FUNCTIONS, nil - case SC_THREAD_SPORADIC_SERVER: - return _POSIX_THREAD_SPORADIC_SERVER, nil - case SC_TRACE: - return _POSIX_TRACE, nil - case SC_TRACE_EVENT_FILTER: - return _POSIX_TRACE_EVENT_FILTER, nil - case SC_TRACE_EVENT_NAME_MAX: - return -1, nil - case SC_TRACE_INHERIT: - return _POSIX_TRACE_INHERIT, nil - case SC_TRACE_LOG: - return _POSIX_TRACE_LOG, nil - case SC_TRACE_NAME_MAX: - return -1, nil - case SC_TRACE_SYS_MAX: - return -1, nil - case SC_TRACE_USER_EVENT_MAX: - return -1, nil - case SC_TYPED_MEMORY_OBJECTS: - return _POSIX_TYPED_MEMORY_OBJECTS, nil - - case SC_V7_ILP32_OFF32: - return _POSIX_V7_ILP32_OFF32, nil - case SC_V7_ILP32_OFFBIG: - return _POSIX_V7_ILP32_OFFBIG, nil - case SC_V7_LP64_OFF64: - return _POSIX_V7_LP64_OFF64, nil - case SC_V7_LPBIG_OFFBIG: - return _POSIX_V7_LPBIG_OFFBIG, nil - - case SC_V6_ILP32_OFF32: - return _POSIX_V6_ILP32_OFF32, nil - case SC_V6_ILP32_OFFBIG: - return _POSIX_V6_ILP32_OFFBIG, nil - case SC_V6_LP64_OFF64: - return _POSIX_V6_LP64_OFF64, nil - case SC_V6_LPBIG_OFFBIG: - return _POSIX_V6_LPBIG_OFFBIG, nil - - case SC_2_C_VERSION: - return _POSIX2_C_VERSION, nil - case SC_2_CHAR_TERM: - return _POSIX2_CHAR_TERM, nil - case SC_2_PBS, - SC_2_PBS_ACCOUNTING, - SC_2_PBS_CHECKPOINT, - SC_2_PBS_LOCATE, - SC_2_PBS_MESSAGE, - SC_2_PBS_TRACK: - return -1, nil - case SC_2_UPE: - return -1, nil - - case SC_XOPEN_CRYPT: - // removed in glibc 2.28 - return -1, nil - case SC_XOPEN_ENH_I18N: - return _XOPEN_ENH_I18N, nil - case SC_XOPEN_REALTIME: - return _XOPEN_REALTIME, nil - case SC_XOPEN_REALTIME_THREADS: - return _XOPEN_REALTIME_THREADS, nil - case SC_XOPEN_SHM: - return _XOPEN_SHM, nil - case SC_XOPEN_STREAMS: - return -1, nil - case SC_XOPEN_UNIX: - return _XOPEN_UNIX, nil - case SC_XOPEN_VERSION: - return _XOPEN_VERSION, nil - case SC_XOPEN_XCU_VERSION: - return _XOPEN_XCU_VERSION, nil - - case SC_PHYS_PAGES: - return getPhysPages(), nil - case SC_AVPHYS_PAGES: - return getAvPhysPages(), nil - case SC_NPROCESSORS_CONF: - return getNprocsConf(), nil - case SC_NPROCESSORS_ONLN: - return getNprocs(), nil - case SC_UIO_MAXIOV: // same as _SC_IOV_MAX - return _UIO_MAXIOV, nil - } - - return sysconfGeneric(name) -} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_netbsd.go b/vendor/github.com/tklauser/go-sysconf/sysconf_netbsd.go deleted file mode 100644 index 7b7d020567..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/sysconf_netbsd.go +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright 2018 Tobias Klauser. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package sysconf - -import ( - "sync" - - "golang.org/x/sys/unix" -) - -const ( - _HOST_NAME_MAX = _MAXHOSTNAMELEN - _LOGIN_NAME_MAX = _MAXLOGNAME + 1 - _SYMLOOP_MAX = _MAXSYMLINKS - - _POSIX2_C_DEV = -1 - _POSIX2_UPE = -1 -) - -var ( - clktck int64 - clktckOnce sync.Once -) - -func sysconfPOSIX(name int) (int64, error) { - // NetBSD does not define all _POSIX_* values used in sysconf_posix.go - // Handle the supported ones here. - switch name { - case SC_SHELL: - return _POSIX_SHELL, nil - case SC_VERSION: - return _POSIX_VERSION, nil - } - - return -1, errInvalid -} - -func sysconf(name int) (int64, error) { - // NetBSD uses sysctl to get some of these values. For the user.* namespace, - // calls get handled by user_sysctl in /usr/src/lib/libc/gen/sysctl.c - // Duplicate the relevant values here. - - switch name { - case SC_ARG_MAX: - return sysctl32("kern.argmax"), nil - case SC_CHILD_MAX: - var rlim unix.Rlimit - if err := unix.Getrlimit(unix.RLIMIT_NPROC, &rlim); err == nil { - if rlim.Cur != unix.RLIM_INFINITY { - return int64(rlim.Cur), nil - } - } - return -1, nil - case SC_STREAM_MAX: - // sysctl("user.stream_max") - return _FOPEN_MAX, nil - case SC_TTY_NAME_MAX: - return pathconf(_PATH_DEV, _PC_NAME_MAX), nil - case SC_CLK_TCK: - clktckOnce.Do(func() { - clktck = -1 - if ci, err := unix.SysctlClockinfo("kern.clockrate"); err == nil { - clktck = int64(ci.Hz) - } - }) - return clktck, nil - case SC_NGROUPS_MAX: - return sysctl32("kern.ngroups"), nil - case SC_JOB_CONTROL: - return sysctl32("kern.job_control"), nil - case SC_OPEN_MAX: - var rlim unix.Rlimit - if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err == nil { - return int64(rlim.Cur), nil - } - return -1, nil - case SC_TZNAME_MAX: - // sysctl("user.tzname_max") - return _NAME_MAX, nil - - // 1003.1b - case SC_FSYNC: - return sysctl32("kern.fsync"), nil - case SC_MAPPED_FILES: - return sysctl32("kern.mapped_files"), nil - case SC_MONOTONIC_CLOCK: - return sysctl32("kern.monotonic_clock"), nil - case SC_SEMAPHORES: - return sysctl32("kern.posix_semaphores"), nil - case SC_TIMERS: - return sysctl32("kern.posix_timers"), nil - - // 1003.1c - case SC_LOGIN_NAME_MAX: - return sysctl32("kern.login_name_max"), nil - case SC_THREADS: - return sysctl32("kern.posix_threads"), nil - - // 1003.1j - case SC_BARRIERS: - return sysctl32("kern.posix_barriers"), nil - - // 1003.2 - case SC_2_VERSION: - // sysctl("user.posix2_version") - return _POSIX2_VERSION, nil - case SC_2_UPE: - // sysctl("user.posix2_upe") - return _POSIX2_UPE, nil - - // XPG 4.2 - case SC_IOV_MAX: - return sysctl32("kern.iov_max"), nil - - // 1003.1-2001, XSI Option Group - case SC_AIO_LISTIO_MAX: - return sysctl32("kern.aio_listio_max"), nil - case SC_AIO_MAX: - return sysctl32("kern.aio_max"), nil - case SC_ASYNCHRONOUS_IO: - return sysctl32("kern.posix_aio"), nil - case SC_MQ_OPEN_MAX: - return sysctl32("kern.mqueue.mq_open_max"), nil - case SC_MQ_PRIO_MAX: - return sysctl32("kern.mqueue.mq_prio_max"), nil - case SC_ATEXIT_MAX: - // sysctl("user.atexit_max") - return -1, nil // TODO - - // Extensions - case SC_NPROCESSORS_CONF: - return sysctl32("hw.ncpu"), nil - case SC_NPROCESSORS_ONLN: - return sysctl32("hw.ncpuonline"), nil - - // Linux/Solaris - case SC_PHYS_PAGES: - return sysctl64("hw.physmem64") / int64(unix.Getpagesize()), nil - - // Native - case SC_THREAD_DESTRUCTOR_ITERATIONS: - return _POSIX_THREAD_DESTRUCTOR_ITERATIONS, nil - case SC_THREAD_KEYS_MAX: - return _POSIX_THREAD_KEYS_MAX, nil - case SC_THREAD_STACK_MIN: - return int64(unix.Getpagesize()), nil - case SC_THREAD_THREADS_MAX: - return sysctl32("kern.maxproc"), nil - } - - return sysconfGeneric(name) -} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_openbsd.go b/vendor/github.com/tklauser/go-sysconf/sysconf_openbsd.go deleted file mode 100644 index c0c394abe4..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/sysconf_openbsd.go +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright 2018 Tobias Klauser. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package sysconf - -import "golang.org/x/sys/unix" - -// sysconf implements sysconf(3) as in the OpenBSD 6.3 libc. -func sysconf(name int) (int64, error) { - switch name { - case SC_AIO_LISTIO_MAX, - SC_AIO_MAX, - SC_AIO_PRIO_DELTA_MAX: - return -1, nil - case SC_ARG_MAX: - return sysctl32("kern.argmax"), nil - case SC_ATEXIT_MAX: - return -1, nil - case SC_CHILD_MAX: - var rlim unix.Rlimit - if err := unix.Getrlimit(unix.RLIMIT_NPROC, &rlim); err == nil { - if rlim.Cur != unix.RLIM_INFINITY { - return int64(rlim.Cur), nil - } - } - return -1, nil - case SC_CLK_TCK: - return _CLK_TCK, nil - case SC_DELAYTIMER_MAX: - return -1, nil - case SC_GETGR_R_SIZE_MAX: - return _GR_BUF_LEN, nil - case SC_GETPW_R_SIZE_MAX: - return _PW_BUF_LEN, nil - case SC_IOV_MAX: - return _IOV_MAX, nil - case SC_LOGIN_NAME_MAX: - return _LOGIN_NAME_MAX, nil - case SC_NGROUPS_MAX: - return sysctl32("kern.ngroups"), nil - case SC_OPEN_MAX: - var rlim unix.Rlimit - if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err == nil { - if rlim.Cur != unix.RLIM_INFINITY { - return int64(rlim.Cur), nil - } - } - return -1, nil - case SC_SEM_NSEMS_MAX: - return -1, nil - case SC_SEM_VALUE_MAX: - return _SEM_VALUE_MAX, nil - case SC_SIGQUEUE_MAX: - return -1, nil - case SC_STREAM_MAX: - var rlim unix.Rlimit - if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err == nil { - if rlim.Cur != unix.RLIM_INFINITY { - if rlim.Cur > _SHRT_MAX { - return _SHRT_MAX, nil - } - return int64(rlim.Cur), nil - } - } - return -1, nil - case SC_THREAD_DESTRUCTOR_ITERATIONS: - return _PTHREAD_DESTRUCTOR_ITERATIONS, nil - case SC_THREAD_KEYS_MAX: - return _PTHREAD_KEYS_MAX, nil - case SC_THREAD_STACK_MIN: - return _PTHREAD_STACK_MIN, nil - case SC_THREAD_THREADS_MAX: - return -1, nil - case SC_TIMER_MAX: - return -1, nil - case SC_TTY_NAME_MAX: - return _TTY_NAME_MAX, nil - case SC_TZNAME_MAX: - return _NAME_MAX, nil - - case SC_BARRIERS: - return _POSIX_BARRIERS, nil - case SC_FSYNC: - return _POSIX_FSYNC, nil - case SC_IPV6: - if _POSIX_IPV6 == 0 { - fd, err := unix.Socket(unix.AF_INET6, unix.SOCK_DGRAM, 0) - if err == nil && fd >= 0 { - unix.Close(fd) - return int64(200112), nil - } - return 0, nil - } - return _POSIX_IPV6, nil - case SC_JOB_CONTROL: - return _POSIX_JOB_CONTROL, nil - case SC_MAPPED_FILES: - return _POSIX_MAPPED_FILES, nil - case SC_MONOTONIC_CLOCK: - return _POSIX_MONOTONIC_CLOCK, nil - case SC_SAVED_IDS: - return _POSIX_SAVED_IDS, nil - case SC_SEMAPHORES: - return _POSIX_SEMAPHORES, nil - case SC_SPAWN: - return _POSIX_SPAWN, nil - case SC_SPIN_LOCKS: - return _POSIX_SPIN_LOCKS, nil - case SC_SPORADIC_SERVER: - return _POSIX_SPORADIC_SERVER, nil - case SC_SYNCHRONIZED_IO: - return _POSIX_SYNCHRONIZED_IO, nil - case SC_THREAD_ATTR_STACKADDR: - return _POSIX_THREAD_ATTR_STACKADDR, nil - case SC_THREAD_ATTR_STACKSIZE: - return _POSIX_THREAD_ATTR_STACKSIZE, nil - case SC_THREAD_CPUTIME: - return _POSIX_THREAD_CPUTIME, nil - case SC_THREAD_PRIO_INHERIT: - return _POSIX_THREAD_PRIO_INHERIT, nil - case SC_THREAD_PRIO_PROTECT: - return _POSIX_THREAD_PRIO_PROTECT, nil - case SC_THREAD_PRIORITY_SCHEDULING: - return _POSIX_THREAD_PRIORITY_SCHEDULING, nil - case SC_THREAD_PROCESS_SHARED: - return _POSIX_THREAD_PROCESS_SHARED, nil - case SC_THREAD_ROBUST_PRIO_INHERIT: - return _POSIX_THREAD_ROBUST_PRIO_INHERIT, nil - case SC_THREAD_ROBUST_PRIO_PROTECT: - return _POSIX_THREAD_ROBUST_PRIO_PROTECT, nil - case SC_THREAD_SAFE_FUNCTIONS: - return _POSIX_THREAD_SAFE_FUNCTIONS, nil - case SC_THREAD_SPORADIC_SERVER: - return _POSIX_THREAD_SPORADIC_SERVER, nil - case SC_THREADS: - return _POSIX_THREADS, nil - case SC_TIMEOUTS: - return _POSIX_TIMEOUTS, nil - case SC_TIMERS: - return _POSIX_TIMERS, nil - case SC_TRACE, - SC_TRACE_EVENT_FILTER, - SC_TRACE_EVENT_NAME_MAX, - SC_TRACE_INHERIT, - SC_TRACE_LOG: - return _POSIX_TRACE, nil - case SC_TYPED_MEMORY_OBJECTS: - return _POSIX_TYPED_MEMORY_OBJECTS, nil - - case SC_V7_ILP32_OFF32: - return _POSIX_V7_ILP32_OFF32, nil - case SC_V7_ILP32_OFFBIG: - if _POSIX_V7_ILP32_OFFBIG == 0 { - if unix.SizeofInt*_CHAR_BIT == 32 && - unix.SizeofLong*_CHAR_BIT == 32 && - unix.SizeofPtr*_CHAR_BIT == 32 && - sizeofOffT*_CHAR_BIT >= 64 { - return 1, nil - } - return -1, nil - } - return _POSIX_V7_ILP32_OFFBIG, nil - case SC_V7_LP64_OFF64: - if _POSIX_V7_LP64_OFF64 == 0 { - if unix.SizeofInt*_CHAR_BIT == 32 && - unix.SizeofLong*_CHAR_BIT == 64 && - unix.SizeofPtr*_CHAR_BIT == 64 && - sizeofOffT*_CHAR_BIT == 64 { - return 1, nil - } - return -1, nil - } - return _POSIX_V7_LP64_OFF64, nil - case SC_V7_LPBIG_OFFBIG: - if _POSIX_V7_LPBIG_OFFBIG == 0 { - if unix.SizeofInt*_CHAR_BIT >= 32 && - unix.SizeofLong*_CHAR_BIT >= 64 && - unix.SizeofPtr*_CHAR_BIT >= 64 && - sizeofOffT*_CHAR_BIT >= 64 { - return 1, nil - } - return -1, nil - } - return _POSIX_V7_LPBIG_OFFBIG, nil - - case SC_V6_ILP32_OFF32: - return _POSIX_V6_ILP32_OFF32, nil - case SC_V6_ILP32_OFFBIG: - if _POSIX_V6_ILP32_OFFBIG == 0 { - if unix.SizeofInt*_CHAR_BIT == 32 && - unix.SizeofLong*_CHAR_BIT == 32 && - unix.SizeofPtr*_CHAR_BIT == 32 && - sizeofOffT*_CHAR_BIT >= 64 { - return 1, nil - } - return -1, nil - } - return _POSIX_V6_ILP32_OFFBIG, nil - case SC_V6_LP64_OFF64: - if _POSIX_V6_LP64_OFF64 == 0 { - if unix.SizeofInt*_CHAR_BIT == 32 && - unix.SizeofLong*_CHAR_BIT == 64 && - unix.SizeofPtr*_CHAR_BIT == 64 && - sizeofOffT*_CHAR_BIT == 64 { - return 1, nil - } - return -1, nil - } - return _POSIX_V6_LP64_OFF64, nil - case SC_V6_LPBIG_OFFBIG: - if _POSIX_V6_LPBIG_OFFBIG == 0 { - if unix.SizeofInt*_CHAR_BIT >= 32 && - unix.SizeofLong*_CHAR_BIT >= 64 && - unix.SizeofPtr*_CHAR_BIT >= 64 && - sizeofOffT*_CHAR_BIT >= 64 { - return 1, nil - } - return -1, nil - } - return _POSIX_V6_LPBIG_OFFBIG, nil - - case SC_2_CHAR_TERM: - return _POSIX2_CHAR_TERM, nil - case SC_2_PBS, - SC_2_PBS_ACCOUNTING, - SC_2_PBS_CHECKPOINT, - SC_2_PBS_LOCATE, - SC_2_PBS_MESSAGE, - SC_2_PBS_TRACK: - return _POSIX2_PBS, nil - case SC_2_UPE: - return _POSIX2_UPE, nil - case SC_2_VERSION: - return _POSIX2_VERSION, nil - - case SC_XOPEN_CRYPT: - return _XOPEN_CRYPT, nil - case SC_XOPEN_ENH_I18N: - return _XOPEN_ENH_I18N, nil - case SC_XOPEN_REALTIME: - return _XOPEN_REALTIME, nil - case SC_XOPEN_REALTIME_THREADS: - return _XOPEN_REALTIME_THREADS, nil - case SC_XOPEN_SHM: - return _XOPEN_SHM, nil - case SC_XOPEN_STREAMS: - return _XOPEN_STREAMS, nil - case SC_XOPEN_UNIX: - return _XOPEN_UNIX, nil - case SC_XOPEN_UUCP: - return _XOPEN_UUCP, nil - - case SC_AVPHYS_PAGES: - if uvm, err := unix.SysctlUvmexp("vm.uvmexp"); err == nil { - return int64(uvm.Free), nil - } - return -1, nil - case SC_PHYS_PAGES: - return sysctl64("hw.physmem") / int64(unix.Getpagesize()), nil - case SC_NPROCESSORS_CONF: - return sysctl32("hw.ncpu"), nil - case SC_NPROCESSORS_ONLN: - if val, err := unix.SysctlUint32("hw.ncpuonline"); err == nil { - return int64(val), nil - } - return sysctl32("hw.ncpu"), nil - } - - return sysconfGeneric(name) -} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_posix.go b/vendor/github.com/tklauser/go-sysconf/sysconf_posix.go deleted file mode 100644 index e61c0bc73e..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/sysconf_posix.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2018 Tobias Klauser. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build darwin || dragonfly || freebsd || linux || openbsd -// +build darwin dragonfly freebsd linux openbsd - -package sysconf - -func sysconfPOSIX(name int) (int64, error) { - switch name { - case SC_ADVISORY_INFO: - return _POSIX_ADVISORY_INFO, nil - case SC_ASYNCHRONOUS_IO: - return _POSIX_ASYNCHRONOUS_IO, nil - case SC_BARRIERS: - return _POSIX_BARRIERS, nil - case SC_CLOCK_SELECTION: - return _POSIX_CLOCK_SELECTION, nil - case SC_CPUTIME: - return _POSIX_CPUTIME, nil - case SC_FSYNC: - return _POSIX_FSYNC, nil - case SC_IPV6: - return _POSIX_IPV6, nil - case SC_JOB_CONTROL: - return _POSIX_JOB_CONTROL, nil - case SC_MAPPED_FILES: - return _POSIX_MAPPED_FILES, nil - case SC_MEMLOCK: - return _POSIX_MEMLOCK, nil - case SC_MEMLOCK_RANGE: - return _POSIX_MEMLOCK_RANGE, nil - case SC_MONOTONIC_CLOCK: - return _POSIX_MONOTONIC_CLOCK, nil - case SC_MEMORY_PROTECTION: - return _POSIX_MEMORY_PROTECTION, nil - case SC_MESSAGE_PASSING: - return _POSIX_MESSAGE_PASSING, nil - case SC_PRIORITIZED_IO: - return _POSIX_PRIORITIZED_IO, nil - case SC_PRIORITY_SCHEDULING: - return _POSIX_PRIORITY_SCHEDULING, nil - case SC_RAW_SOCKETS: - return _POSIX_RAW_SOCKETS, nil - case SC_READER_WRITER_LOCKS: - return _POSIX_READER_WRITER_LOCKS, nil - case SC_REALTIME_SIGNALS: - return _POSIX_REALTIME_SIGNALS, nil - case SC_REGEXP: - return _POSIX_REGEXP, nil - case SC_SEMAPHORES: - return _POSIX_SEMAPHORES, nil - case SC_SHARED_MEMORY_OBJECTS: - return _POSIX_SHARED_MEMORY_OBJECTS, nil - case SC_SHELL: - return _POSIX_SHELL, nil - case SC_THREADS: - return _POSIX_THREADS, nil - case SC_TIMEOUTS: - return _POSIX_TIMEOUTS, nil - case SC_TIMERS: - return _POSIX_TIMERS, nil - case SC_VERSION: - return _POSIX_VERSION, nil - - case SC_2_C_BIND: - return _POSIX2_C_BIND, nil - case SC_2_C_DEV: - return _POSIX2_C_DEV, nil - case SC_2_FORT_DEV: - return -1, nil - case SC_2_FORT_RUN: - return -1, nil - case SC_2_LOCALEDEF: - return _POSIX2_LOCALEDEF, nil - case SC_2_SW_DEV: - return _POSIX2_SW_DEV, nil - case SC_2_VERSION: - return _POSIX2_VERSION, nil - } - return -1, errInvalid -} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_solaris.go b/vendor/github.com/tklauser/go-sysconf/sysconf_solaris.go deleted file mode 100644 index 443b21439d..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/sysconf_solaris.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2021 Tobias Klauser. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package sysconf - -import "golang.org/x/sys/unix" - -func sysconf(name int) (int64, error) { - if name < 0 { - return -1, errInvalid - } - return unix.Sysconf(name) -} diff --git a/vendor/github.com/tklauser/go-sysconf/sysconf_unsupported.go b/vendor/github.com/tklauser/go-sysconf/sysconf_unsupported.go deleted file mode 100644 index 478d692005..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/sysconf_unsupported.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2021 Tobias Klauser. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris -// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris - -package sysconf - -import ( - "fmt" - "runtime" -) - -func sysconf(name int) (int64, error) { - return -1, fmt.Errorf("unsupported on %s", runtime.GOOS) -} diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_darwin.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_darwin.go deleted file mode 100644 index 03d088634e..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_darwin.go +++ /dev/null @@ -1,251 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_defs_darwin.go - -package sysconf - -const ( - SC_AIO_LISTIO_MAX = 0x2a - SC_AIO_MAX = 0x2b - SC_AIO_PRIO_DELTA_MAX = 0x2c - SC_ARG_MAX = 0x1 - SC_ATEXIT_MAX = 0x6b - SC_BC_BASE_MAX = 0x9 - SC_BC_DIM_MAX = 0xa - SC_BC_SCALE_MAX = 0xb - SC_BC_STRING_MAX = 0xc - SC_CHILD_MAX = 0x2 - SC_CLK_TCK = 0x3 - SC_COLL_WEIGHTS_MAX = 0xd - SC_DELAYTIMER_MAX = 0x2d - SC_EXPR_NEST_MAX = 0xe - SC_GETGR_R_SIZE_MAX = 0x46 - SC_GETPW_R_SIZE_MAX = 0x47 - SC_HOST_NAME_MAX = 0x48 - SC_IOV_MAX = 0x38 - SC_LINE_MAX = 0xf - SC_LOGIN_NAME_MAX = 0x49 - SC_MQ_OPEN_MAX = 0x2e - SC_MQ_PRIO_MAX = 0x4b - SC_NGROUPS_MAX = 0x4 - SC_OPEN_MAX = 0x5 - SC_PAGE_SIZE = 0x1d - SC_PAGESIZE = 0x1d - SC_THREAD_DESTRUCTOR_ITERATIONS = 0x55 - SC_THREAD_KEYS_MAX = 0x56 - SC_THREAD_STACK_MIN = 0x5d - SC_THREAD_THREADS_MAX = 0x5e - SC_RE_DUP_MAX = 0x10 - SC_RTSIG_MAX = 0x30 - SC_SEM_NSEMS_MAX = 0x31 - SC_SEM_VALUE_MAX = 0x32 - SC_SIGQUEUE_MAX = 0x33 - SC_STREAM_MAX = 0x1a - SC_SYMLOOP_MAX = 0x78 - SC_TIMER_MAX = 0x34 - SC_TTY_NAME_MAX = 0x65 - SC_TZNAME_MAX = 0x1b - - SC_ADVISORY_INFO = 0x41 - SC_ASYNCHRONOUS_IO = 0x1c - SC_BARRIERS = 0x42 - SC_CLOCK_SELECTION = 0x43 - SC_CPUTIME = 0x44 - SC_FSYNC = 0x26 - SC_IPV6 = 0x76 - SC_JOB_CONTROL = 0x6 - SC_MAPPED_FILES = 0x2f - SC_MEMLOCK = 0x1e - SC_MEMLOCK_RANGE = 0x1f - SC_MEMORY_PROTECTION = 0x20 - SC_MESSAGE_PASSING = 0x21 - SC_MONOTONIC_CLOCK = 0x4a - SC_PRIORITIZED_IO = 0x22 - SC_PRIORITY_SCHEDULING = 0x23 - SC_RAW_SOCKETS = 0x77 - SC_READER_WRITER_LOCKS = 0x4c - SC_REALTIME_SIGNALS = 0x24 - SC_REGEXP = 0x4d - SC_SAVED_IDS = 0x7 - SC_SEMAPHORES = 0x25 - SC_SHARED_MEMORY_OBJECTS = 0x27 - SC_SHELL = 0x4e - SC_SPAWN = 0x4f - SC_SPIN_LOCKS = 0x50 - SC_SPORADIC_SERVER = 0x51 - SC_SS_REPL_MAX = 0x7e - SC_SYNCHRONIZED_IO = 0x28 - SC_THREAD_ATTR_STACKADDR = 0x52 - SC_THREAD_ATTR_STACKSIZE = 0x53 - SC_THREAD_CPUTIME = 0x54 - SC_THREAD_PRIO_INHERIT = 0x57 - SC_THREAD_PRIO_PROTECT = 0x58 - SC_THREAD_PRIORITY_SCHEDULING = 0x59 - SC_THREAD_PROCESS_SHARED = 0x5a - SC_THREAD_SAFE_FUNCTIONS = 0x5b - SC_THREAD_SPORADIC_SERVER = 0x5c - SC_THREADS = 0x60 - SC_TIMEOUTS = 0x5f - SC_TIMERS = 0x29 - SC_TRACE = 0x61 - SC_TRACE_EVENT_FILTER = 0x62 - SC_TRACE_EVENT_NAME_MAX = 0x7f - SC_TRACE_INHERIT = 0x63 - SC_TRACE_LOG = 0x64 - SC_TRACE_NAME_MAX = 0x80 - SC_TRACE_SYS_MAX = 0x81 - SC_TRACE_USER_EVENT_MAX = 0x82 - SC_TYPED_MEMORY_OBJECTS = 0x66 - SC_VERSION = 0x8 - - SC_V6_ILP32_OFF32 = 0x67 - SC_V6_ILP32_OFFBIG = 0x68 - SC_V6_LP64_OFF64 = 0x69 - SC_V6_LPBIG_OFFBIG = 0x6a - - SC_2_C_BIND = 0x12 - SC_2_C_DEV = 0x13 - SC_2_CHAR_TERM = 0x14 - SC_2_FORT_DEV = 0x15 - SC_2_FORT_RUN = 0x16 - SC_2_LOCALEDEF = 0x17 - SC_2_PBS = 0x3b - SC_2_PBS_ACCOUNTING = 0x3c - SC_2_PBS_CHECKPOINT = 0x3d - SC_2_PBS_LOCATE = 0x3e - SC_2_PBS_MESSAGE = 0x3f - SC_2_PBS_TRACK = 0x40 - SC_2_SW_DEV = 0x18 - SC_2_UPE = 0x19 - SC_2_VERSION = 0x11 - - SC_XOPEN_CRYPT = 0x6c - SC_XOPEN_ENH_I18N = 0x6d - SC_XOPEN_REALTIME = 0x6f - SC_XOPEN_REALTIME_THREADS = 0x70 - SC_XOPEN_SHM = 0x71 - SC_XOPEN_STREAMS = 0x72 - SC_XOPEN_UNIX = 0x73 - SC_XOPEN_VERSION = 0x74 - SC_XOPEN_XCU_VERSION = 0x79 - - SC_PHYS_PAGES = 0xc8 - SC_NPROCESSORS_CONF = 0x39 - SC_NPROCESSORS_ONLN = 0x3a -) - -const ( - _BC_BASE_MAX = 0x63 - _BC_DIM_MAX = 0x800 - _BC_SCALE_MAX = 0x63 - _BC_STRING_MAX = 0x3e8 - _COLL_WEIGHTS_MAX = 0x2 - _EXPR_NEST_MAX = 0x20 - _IOV_MAX = 0x400 - _LINE_MAX = 0x800 - _NAME_MAX = 0xff - _RE_DUP_MAX = 0xff - - _CLK_TCK = 0x64 - - _MAXHOSTNAMELEN = 0x100 - _MAXLOGNAME = 0xff - _MAXSYMLINKS = 0x20 - - _POSIX_ADVISORY_INFO = -0x1 - _POSIX_ARG_MAX = 0x1000 - _POSIX_ASYNCHRONOUS_IO = -0x1 - _POSIX_BARRIERS = -0x1 - _POSIX_CHILD_MAX = 0x19 - _POSIX_CLOCK_SELECTION = -0x1 - _POSIX_CPUTIME = -0x1 - _POSIX_FSYNC = 0x30db0 - _POSIX_IPV6 = 0x30db0 - _POSIX_JOB_CONTROL = 0x30db0 - _POSIX_MAPPED_FILES = 0x30db0 - _POSIX_MEMLOCK = -0x1 - _POSIX_MEMLOCK_RANGE = -0x1 - _POSIX_MEMORY_PROTECTION = 0x30db0 - _POSIX_MESSAGE_PASSING = -0x1 - _POSIX_MONOTONIC_CLOCK = -0x1 - _POSIX_PRIORITIZED_IO = -0x1 - _POSIX_PRIORITY_SCHEDULING = -0x1 - _POSIX_RAW_SOCKETS = -0x1 - _POSIX_READER_WRITER_LOCKS = 0x30db0 - _POSIX_REALTIME_SIGNALS = -0x1 - _POSIX_REGEXP = 0x30db0 - _POSIX_SEM_VALUE_MAX = 0x7fff - _POSIX_SEMAPHORES = -0x1 - _POSIX_SHARED_MEMORY_OBJECTS = -0x1 - _POSIX_SHELL = 0x30db0 - _POSIX_SIGQUEUE_MAX = 0x20 - _POSIX_SPAWN = -0x1 - _POSIX_SPIN_LOCKS = -0x1 - _POSIX_SPORADIC_SERVER = -0x1 - _POSIX_SS_REPL_MAX = 0x4 - _POSIX_SYNCHRONIZED_IO = -0x1 - _POSIX_THREAD_ATTR_STACKADDR = 0x30db0 - _POSIX_THREAD_ATTR_STACKSIZE = 0x30db0 - _POSIX_THREAD_CPUTIME = -0x1 - _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 - _POSIX_THREAD_KEYS_MAX = 0x80 - _POSIX_THREAD_PRIO_INHERIT = -0x1 - _POSIX_THREAD_PRIO_PROTECT = -0x1 - _POSIX_THREAD_PRIORITY_SCHEDULING = -0x1 - _POSIX_THREAD_PROCESS_SHARED = 0x30db0 - _POSIX_THREAD_SAFE_FUNCTIONS = 0x30db0 - _POSIX_THREAD_SPORADIC_SERVER = -0x1 - _POSIX_THREADS = 0x30db0 - _POSIX_TIMEOUTS = -0x1 - _POSIX_TIMERS = -0x1 - _POSIX_TRACE = -0x1 - _POSIX_TRACE_EVENT_FILTER = -0x1 - _POSIX_TRACE_EVENT_NAME_MAX = 0x1e - _POSIX_TRACE_INHERIT = -0x1 - _POSIX_TRACE_LOG = -0x1 - _POSIX_TRACE_NAME_MAX = 0x8 - _POSIX_TRACE_SYS_MAX = 0x8 - _POSIX_TRACE_USER_EVENT_MAX = 0x20 - _POSIX_TYPED_MEMORY_OBJECTS = -0x1 - _POSIX_VERSION = 0x30db0 - - _V6_ILP32_OFF32 = -0x1 - _V6_ILP32_OFFBIG = -0x1 - _V6_LP64_OFF64 = 0x1 - _V6_LPBIG_OFFBIG = 0x1 - - _POSIX2_C_BIND = 0x30db0 - _POSIX2_C_DEV = 0x30db0 - _POSIX2_CHAR_TERM = 0x30db0 - _POSIX2_LOCALEDEF = 0x30db0 - _POSIX2_PBS = -0x1 - _POSIX2_SW_DEV = 0x30db0 - _POSIX2_UPE = 0x30db0 - _POSIX2_VERSION = 0x30db0 - - _XOPEN_CRYPT = 0x1 - _XOPEN_ENH_I18N = 0x1 - _XOPEN_REALTIME = -0x1 - _XOPEN_REALTIME_THREADS = -0x1 - _XOPEN_SHM = 0x1 - _XOPEN_UNIX = 0x1 - _XOPEN_VERSION = 0x258 - _XOPEN_XCU_VERSION = 0x4 - - _PTHREAD_DESTRUCTOR_ITERATIONS = 0x4 - _PTHREAD_KEYS_MAX = 0x200 - _PTHREAD_STACK_MIN = 0x2000 -) - -const ( - _PC_NAME_MAX = 0x4 - - _PATH_ZONEINFO = "/usr/share/zoneinfo" -) - -const ( - _CHAR_BIT = 0x8 - - _INT_MAX = 0x7fffffff - - sizeofOffT = 0x8 -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_dragonfly.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_dragonfly.go deleted file mode 100644 index 4e71d6b2dc..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_dragonfly.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_defs_dragonfly.go - -package sysconf - -const ( - SC_AIO_LISTIO_MAX = 0x2a - SC_AIO_MAX = 0x2b - SC_AIO_PRIO_DELTA_MAX = 0x2c - SC_ARG_MAX = 0x1 - SC_ATEXIT_MAX = 0x6b - SC_BC_BASE_MAX = 0x9 - SC_BC_DIM_MAX = 0xa - SC_BC_SCALE_MAX = 0xb - SC_BC_STRING_MAX = 0xc - SC_CHILD_MAX = 0x2 - SC_CLK_TCK = 0x3 - SC_COLL_WEIGHTS_MAX = 0xd - SC_DELAYTIMER_MAX = 0x2d - SC_EXPR_NEST_MAX = 0xe - SC_GETGR_R_SIZE_MAX = 0x46 - SC_GETPW_R_SIZE_MAX = 0x47 - SC_HOST_NAME_MAX = 0x48 - SC_IOV_MAX = 0x38 - SC_LINE_MAX = 0xf - SC_LOGIN_NAME_MAX = 0x49 - SC_MQ_OPEN_MAX = 0x2e - SC_MQ_PRIO_MAX = 0x4b - SC_NGROUPS_MAX = 0x4 - SC_OPEN_MAX = 0x5 - SC_PAGE_SIZE = 0x2f - SC_PAGESIZE = 0x2f - SC_RE_DUP_MAX = 0x10 - SC_RTSIG_MAX = 0x30 - SC_SEM_NSEMS_MAX = 0x31 - SC_SEM_VALUE_MAX = 0x32 - SC_SIGQUEUE_MAX = 0x33 - SC_STREAM_MAX = 0x1a - SC_SYMLOOP_MAX = 0x78 - SC_THREAD_DESTRUCTOR_ITERATIONS = 0x55 - SC_THREAD_KEYS_MAX = 0x56 - SC_THREAD_STACK_MIN = 0x5d - SC_THREAD_THREADS_MAX = 0x5e - SC_TIMER_MAX = 0x34 - SC_TTY_NAME_MAX = 0x65 - SC_TZNAME_MAX = 0x1b - - SC_ADVISORY_INFO = 0x41 - SC_ASYNCHRONOUS_IO = 0x1c - SC_BARRIERS = 0x42 - SC_CLOCK_SELECTION = 0x43 - SC_CPUTIME = 0x44 - SC_FSYNC = 0x26 - SC_IPV6 = 0x76 - SC_JOB_CONTROL = 0x6 - SC_MAPPED_FILES = 0x1d - SC_MEMLOCK = 0x1e - SC_MEMLOCK_RANGE = 0x1f - SC_MEMORY_PROTECTION = 0x20 - SC_MESSAGE_PASSING = 0x21 - SC_MONOTONIC_CLOCK = 0x4a - SC_PRIORITIZED_IO = 0x22 - SC_PRIORITY_SCHEDULING = 0x23 - SC_RAW_SOCKETS = 0x77 - SC_READER_WRITER_LOCKS = 0x4c - SC_REALTIME_SIGNALS = 0x24 - SC_REGEXP = 0x4d - SC_SAVED_IDS = 0x7 - SC_SEMAPHORES = 0x25 - SC_SHARED_MEMORY_OBJECTS = 0x27 - SC_SHELL = 0x4e - SC_SPAWN = 0x4f - SC_SPIN_LOCKS = 0x50 - SC_SPORADIC_SERVER = 0x51 - SC_SYNCHRONIZED_IO = 0x28 - SC_THREAD_ATTR_STACKADDR = 0x52 - SC_THREAD_ATTR_STACKSIZE = 0x53 - SC_THREAD_CPUTIME = 0x54 - SC_THREAD_PRIO_INHERIT = 0x57 - SC_THREAD_PRIO_PROTECT = 0x58 - SC_THREAD_PRIORITY_SCHEDULING = 0x59 - SC_THREAD_PROCESS_SHARED = 0x5a - SC_THREAD_SAFE_FUNCTIONS = 0x5b - SC_THREAD_SPORADIC_SERVER = 0x5c - SC_THREADS = 0x60 - SC_TIMEOUTS = 0x5f - SC_TIMERS = 0x29 - SC_TRACE = 0x61 - SC_TRACE_EVENT_FILTER = 0x62 - SC_TRACE_INHERIT = 0x63 - SC_TRACE_LOG = 0x64 - SC_TYPED_MEMORY_OBJECTS = 0x66 - SC_VERSION = 0x8 - - SC_V6_ILP32_OFF32 = 0x67 - SC_V6_ILP32_OFFBIG = 0x68 - SC_V6_LP64_OFF64 = 0x69 - SC_V6_LPBIG_OFFBIG = 0x6a - - SC_2_C_BIND = 0x12 - SC_2_C_DEV = 0x13 - SC_2_CHAR_TERM = 0x14 - SC_2_FORT_DEV = 0x15 - SC_2_FORT_RUN = 0x16 - SC_2_LOCALEDEF = 0x17 - SC_2_PBS = 0x3b - SC_2_PBS_ACCOUNTING = 0x3c - SC_2_PBS_CHECKPOINT = 0x3d - SC_2_PBS_LOCATE = 0x3e - SC_2_PBS_MESSAGE = 0x3f - SC_2_PBS_TRACK = 0x40 - SC_2_SW_DEV = 0x18 - SC_2_UPE = 0x19 - SC_2_VERSION = 0x11 - - SC_XOPEN_CRYPT = 0x6c - SC_XOPEN_ENH_I18N = 0x6d - SC_XOPEN_REALTIME = 0x6f - SC_XOPEN_REALTIME_THREADS = 0x70 - SC_XOPEN_SHM = 0x71 - SC_XOPEN_STREAMS = 0x72 - SC_XOPEN_UNIX = 0x73 - SC_XOPEN_VERSION = 0x74 - SC_XOPEN_XCU_VERSION = 0x75 - - SC_PHYS_PAGES = 0x79 - SC_NPROCESSORS_CONF = 0x39 - SC_NPROCESSORS_ONLN = 0x3a -) - -const ( - _BC_BASE_MAX = 0x63 - _BC_DIM_MAX = 0x800 - _BC_SCALE_MAX = 0x63 - _BC_STRING_MAX = 0x3e8 - _COLL_WEIGHTS_MAX = 0xa - _EXPR_NEST_MAX = 0x20 - _LINE_MAX = 0x800 - _RE_DUP_MAX = 0xff - - _CLK_TCK = 0x80 - - _MAXHOSTNAMELEN = 0x100 - _MAXLOGNAME = 0x11 - _MAXSYMLINKS = 0x20 - _ATEXIT_SIZE = 0x20 - - _POSIX_ADVISORY_INFO = -0x1 - _POSIX_ARG_MAX = 0x1000 - _POSIX_ASYNCHRONOUS_IO = 0x0 - _POSIX_BARRIERS = 0x30db0 - _POSIX_CHILD_MAX = 0x19 - _POSIX_CLOCK_SELECTION = -0x1 - _POSIX_CPUTIME = 0x30db0 - _POSIX_FSYNC = 0x30db0 - _POSIX_IPV6 = 0x0 - _POSIX_JOB_CONTROL = 0x1 - _POSIX_MAPPED_FILES = 0x30db0 - _POSIX_MEMLOCK = -0x1 - _POSIX_MEMLOCK_RANGE = 0x30db0 - _POSIX_MEMORY_PROTECTION = 0x30db0 - _POSIX_MESSAGE_PASSING = 0x30db0 - _POSIX_MONOTONIC_CLOCK = 0x30db0 - _POSIX_PRIORITIZED_IO = -0x1 - _POSIX_PRIORITY_SCHEDULING = 0x30db0 - _POSIX_RAW_SOCKETS = 0x30db0 - _POSIX_READER_WRITER_LOCKS = 0x30db0 - _POSIX_REALTIME_SIGNALS = 0x30db0 - _POSIX_REGEXP = 0x1 - _POSIX_SEM_VALUE_MAX = 0x7fff - _POSIX_SEMAPHORES = 0x30db0 - _POSIX_SHARED_MEMORY_OBJECTS = 0x30db0 - _POSIX_SHELL = 0x1 - _POSIX_SPAWN = 0x30db0 - _POSIX_SPIN_LOCKS = 0x30db0 - _POSIX_SPORADIC_SERVER = -0x1 - _POSIX_SYNCHRONIZED_IO = -0x1 - _POSIX_THREAD_ATTR_STACKADDR = 0x30db0 - _POSIX_THREAD_ATTR_STACKSIZE = 0x30db0 - _POSIX_THREAD_CPUTIME = 0x30db0 - _POSIX_THREAD_PRIO_INHERIT = 0x30db0 - _POSIX_THREAD_PRIO_PROTECT = 0x30db0 - _POSIX_THREAD_PRIORITY_SCHEDULING = 0x30db0 - _POSIX_THREAD_PROCESS_SHARED = -0x1 - _POSIX_THREAD_SAFE_FUNCTIONS = -0x1 - _POSIX_THREAD_SPORADIC_SERVER = -0x1 - _POSIX_THREADS = 0x30db0 - _POSIX_TIMEOUTS = 0x30db0 - _POSIX_TIMERS = 0x30db0 - _POSIX_TRACE = -0x1 - _POSIX_TYPED_MEMORY_OBJECTS = -0x1 - _POSIX_VERSION = 0x30db0 - - _V6_ILP32_OFF32 = -0x1 - _V6_ILP32_OFFBIG = 0x0 - _V6_LP64_OFF64 = 0x0 - _V6_LPBIG_OFFBIG = -0x1 - - _POSIX2_C_BIND = 0x31069 - _POSIX2_C_DEV = 0x31069 - _POSIX2_CHAR_TERM = 0x1 - _POSIX2_LOCALEDEF = 0x31069 - _POSIX2_PBS = -0x1 - _POSIX2_SW_DEV = 0x31069 - _POSIX2_UPE = 0x31069 - _POSIX2_VERSION = 0x30a2c - - _XOPEN_CRYPT = -0x1 - _XOPEN_ENH_I18N = -0x1 - _XOPEN_REALTIME = -0x1 - _XOPEN_REALTIME_THREADS = -0x1 - _XOPEN_SHM = 0x1 - _XOPEN_UNIX = -0x1 - - _PTHREAD_DESTRUCTOR_ITERATIONS = 0x4 - _PTHREAD_KEYS_MAX = 0x100 - _PTHREAD_STACK_MIN = 0x4000 -) - -const ( - _PC_NAME_MAX = 0x4 - - _PATH_DEV = "/dev/" - _PATH_ZONEINFO = "/usr/share/zoneinfo" -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_freebsd.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_freebsd.go deleted file mode 100644 index cb56d255b7..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_freebsd.go +++ /dev/null @@ -1,226 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_defs_freebsd.go - -package sysconf - -const ( - SC_AIO_LISTIO_MAX = 0x2a - SC_AIO_MAX = 0x2b - SC_AIO_PRIO_DELTA_MAX = 0x2c - SC_ARG_MAX = 0x1 - SC_ATEXIT_MAX = 0x6b - SC_BC_BASE_MAX = 0x9 - SC_BC_DIM_MAX = 0xa - SC_BC_SCALE_MAX = 0xb - SC_BC_STRING_MAX = 0xc - SC_CHILD_MAX = 0x2 - SC_CLK_TCK = 0x3 - SC_COLL_WEIGHTS_MAX = 0xd - SC_DELAYTIMER_MAX = 0x2d - SC_EXPR_NEST_MAX = 0xe - SC_GETGR_R_SIZE_MAX = 0x46 - SC_GETPW_R_SIZE_MAX = 0x47 - SC_HOST_NAME_MAX = 0x48 - SC_IOV_MAX = 0x38 - SC_LINE_MAX = 0xf - SC_LOGIN_NAME_MAX = 0x49 - SC_MQ_OPEN_MAX = 0x2e - SC_MQ_PRIO_MAX = 0x4b - SC_NGROUPS_MAX = 0x4 - SC_OPEN_MAX = 0x5 - SC_PAGE_SIZE = 0x2f - SC_PAGESIZE = 0x2f - SC_RE_DUP_MAX = 0x10 - SC_RTSIG_MAX = 0x30 - SC_SEM_NSEMS_MAX = 0x31 - SC_SEM_VALUE_MAX = 0x32 - SC_SIGQUEUE_MAX = 0x33 - SC_STREAM_MAX = 0x1a - SC_SYMLOOP_MAX = 0x78 - SC_THREAD_DESTRUCTOR_ITERATIONS = 0x55 - SC_THREAD_KEYS_MAX = 0x56 - SC_THREAD_STACK_MIN = 0x5d - SC_THREAD_THREADS_MAX = 0x5e - SC_TIMER_MAX = 0x34 - SC_TTY_NAME_MAX = 0x65 - SC_TZNAME_MAX = 0x1b - - SC_ADVISORY_INFO = 0x41 - SC_ASYNCHRONOUS_IO = 0x1c - SC_BARRIERS = 0x42 - SC_CLOCK_SELECTION = 0x43 - SC_CPUTIME = 0x44 - SC_FSYNC = 0x26 - SC_IPV6 = 0x76 - SC_JOB_CONTROL = 0x6 - SC_MAPPED_FILES = 0x1d - SC_MEMLOCK = 0x1e - SC_MEMLOCK_RANGE = 0x1f - SC_MEMORY_PROTECTION = 0x20 - SC_MESSAGE_PASSING = 0x21 - SC_MONOTONIC_CLOCK = 0x4a - SC_PRIORITIZED_IO = 0x22 - SC_PRIORITY_SCHEDULING = 0x23 - SC_RAW_SOCKETS = 0x77 - SC_READER_WRITER_LOCKS = 0x4c - SC_REALTIME_SIGNALS = 0x24 - SC_REGEXP = 0x4d - SC_SAVED_IDS = 0x7 - SC_SEMAPHORES = 0x25 - SC_SHARED_MEMORY_OBJECTS = 0x27 - SC_SHELL = 0x4e - SC_SPAWN = 0x4f - SC_SPIN_LOCKS = 0x50 - SC_SPORADIC_SERVER = 0x51 - SC_SYNCHRONIZED_IO = 0x28 - SC_THREAD_ATTR_STACKADDR = 0x52 - SC_THREAD_ATTR_STACKSIZE = 0x53 - SC_THREAD_CPUTIME = 0x54 - SC_THREAD_PRIO_INHERIT = 0x57 - SC_THREAD_PRIO_PROTECT = 0x58 - SC_THREAD_PRIORITY_SCHEDULING = 0x59 - SC_THREAD_PROCESS_SHARED = 0x5a - SC_THREAD_SAFE_FUNCTIONS = 0x5b - SC_THREAD_SPORADIC_SERVER = 0x5c - SC_THREADS = 0x60 - SC_TIMEOUTS = 0x5f - SC_TIMERS = 0x29 - SC_TRACE = 0x61 - SC_TRACE_EVENT_FILTER = 0x62 - SC_TRACE_INHERIT = 0x63 - SC_TRACE_LOG = 0x64 - SC_TYPED_MEMORY_OBJECTS = 0x66 - SC_VERSION = 0x8 - - SC_V6_ILP32_OFF32 = 0x67 - SC_V6_ILP32_OFFBIG = 0x68 - SC_V6_LP64_OFF64 = 0x69 - SC_V6_LPBIG_OFFBIG = 0x6a - - SC_2_C_BIND = 0x12 - SC_2_C_DEV = 0x13 - SC_2_CHAR_TERM = 0x14 - SC_2_FORT_DEV = 0x15 - SC_2_FORT_RUN = 0x16 - SC_2_LOCALEDEF = 0x17 - SC_2_PBS = 0x3b - SC_2_PBS_ACCOUNTING = 0x3c - SC_2_PBS_CHECKPOINT = 0x3d - SC_2_PBS_LOCATE = 0x3e - SC_2_PBS_MESSAGE = 0x3f - SC_2_PBS_TRACK = 0x40 - SC_2_SW_DEV = 0x18 - SC_2_UPE = 0x19 - SC_2_VERSION = 0x11 - - SC_XOPEN_CRYPT = 0x6c - SC_XOPEN_ENH_I18N = 0x6d - SC_XOPEN_REALTIME = 0x6f - SC_XOPEN_REALTIME_THREADS = 0x70 - SC_XOPEN_SHM = 0x71 - SC_XOPEN_STREAMS = 0x72 - SC_XOPEN_UNIX = 0x73 - SC_XOPEN_VERSION = 0x74 - SC_XOPEN_XCU_VERSION = 0x75 - - SC_PHYS_PAGES = 0x79 - SC_NPROCESSORS_CONF = 0x39 - SC_NPROCESSORS_ONLN = 0x3a -) - -const ( - _BC_BASE_MAX = 0x63 - _BC_DIM_MAX = 0x800 - _BC_SCALE_MAX = 0x63 - _BC_STRING_MAX = 0x3e8 - _COLL_WEIGHTS_MAX = 0xa - _EXPR_NEST_MAX = 0x20 - _LINE_MAX = 0x800 - _MQ_PRIO_MAX = 0x40 - _RE_DUP_MAX = 0xff - _SEM_VALUE_MAX = 0x7fffffff - - _CLK_TCK = 0x80 - - _MAXHOSTNAMELEN = 0x100 - _MAXLOGNAME = 0x21 - _MAXSYMLINKS = 0x20 - _ATEXIT_SIZE = 0x20 - - _POSIX_ADVISORY_INFO = 0x30db0 - _POSIX_ARG_MAX = 0x1000 - _POSIX_ASYNCHRONOUS_IO = 0x30db0 - _POSIX_BARRIERS = 0x30db0 - _POSIX_CHILD_MAX = 0x19 - _POSIX_CLOCK_SELECTION = -0x1 - _POSIX_CPUTIME = 0x30db0 - _POSIX_FSYNC = 0x30db0 - _POSIX_IPV6 = 0x0 - _POSIX_JOB_CONTROL = 0x1 - _POSIX_MAPPED_FILES = 0x30db0 - _POSIX_MEMLOCK = -0x1 - _POSIX_MEMLOCK_RANGE = 0x30db0 - _POSIX_MEMORY_PROTECTION = 0x30db0 - _POSIX_MESSAGE_PASSING = 0x30db0 - _POSIX_MONOTONIC_CLOCK = 0x30db0 - _POSIX_PRIORITIZED_IO = -0x1 - _POSIX_PRIORITY_SCHEDULING = 0x0 - _POSIX_RAW_SOCKETS = 0x30db0 - _POSIX_READER_WRITER_LOCKS = 0x30db0 - _POSIX_REALTIME_SIGNALS = 0x30db0 - _POSIX_REGEXP = 0x1 - _POSIX_SEM_VALUE_MAX = 0x7fff - _POSIX_SEMAPHORES = 0x30db0 - _POSIX_SHARED_MEMORY_OBJECTS = 0x30db0 - _POSIX_SHELL = 0x1 - _POSIX_SPAWN = 0x30db0 - _POSIX_SPIN_LOCKS = 0x30db0 - _POSIX_SPORADIC_SERVER = -0x1 - _POSIX_SYNCHRONIZED_IO = -0x1 - _POSIX_THREAD_ATTR_STACKADDR = 0x30db0 - _POSIX_THREAD_ATTR_STACKSIZE = 0x30db0 - _POSIX_THREAD_CPUTIME = 0x30db0 - _POSIX_THREAD_PRIO_INHERIT = 0x30db0 - _POSIX_THREAD_PRIO_PROTECT = 0x30db0 - _POSIX_THREAD_PRIORITY_SCHEDULING = 0x30db0 - _POSIX_THREAD_PROCESS_SHARED = 0x30db0 - _POSIX_THREAD_SAFE_FUNCTIONS = -0x1 - _POSIX_THREADS = 0x30db0 - _POSIX_TIMEOUTS = 0x30db0 - _POSIX_TIMERS = 0x30db0 - _POSIX_TRACE = -0x1 - _POSIX_TYPED_MEMORY_OBJECTS = -0x1 - _POSIX_VERSION = 0x30db0 - - _V6_ILP32_OFF32 = -0x1 - _V6_ILP32_OFFBIG = 0x0 - _V6_LP64_OFF64 = 0x0 - _V6_LPBIG_OFFBIG = -0x1 - - _POSIX2_C_BIND = 0x30db0 - _POSIX2_C_DEV = -0x1 - _POSIX2_CHAR_TERM = 0x1 - _POSIX2_LOCALEDEF = -0x1 - _POSIX2_PBS = -0x1 - _POSIX2_SW_DEV = -0x1 - _POSIX2_UPE = 0x30db0 - _POSIX2_VERSION = 0x30a2c - - _XOPEN_CRYPT = -0x1 - _XOPEN_ENH_I18N = -0x1 - _XOPEN_REALTIME = -0x1 - _XOPEN_REALTIME_THREADS = -0x1 - _XOPEN_SHM = 0x1 - _XOPEN_UNIX = -0x1 - - _PTHREAD_DESTRUCTOR_ITERATIONS = 0x4 - _PTHREAD_KEYS_MAX = 0x100 - _PTHREAD_STACK_MIN = 0x800 -) - -const ( - _PC_NAME_MAX = 0x4 - - _PATH_DEV = "/dev/" - _PATH_ZONEINFO = "/usr/share/zoneinfo" -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_linux.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_linux.go deleted file mode 100644 index 4a4c547fb1..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_linux.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_defs_linux.go - -package sysconf - -const ( - SC_AIO_LISTIO_MAX = 0x17 - SC_AIO_MAX = 0x18 - SC_AIO_PRIO_DELTA_MAX = 0x19 - SC_ARG_MAX = 0x0 - SC_ATEXIT_MAX = 0x57 - SC_BC_BASE_MAX = 0x24 - SC_BC_DIM_MAX = 0x25 - SC_BC_SCALE_MAX = 0x26 - SC_BC_STRING_MAX = 0x27 - SC_CHILD_MAX = 0x1 - SC_CLK_TCK = 0x2 - SC_COLL_WEIGHTS_MAX = 0x28 - SC_DELAYTIMER_MAX = 0x1a - SC_EXPR_NEST_MAX = 0x2a - SC_GETGR_R_SIZE_MAX = 0x45 - SC_GETPW_R_SIZE_MAX = 0x46 - SC_HOST_NAME_MAX = 0xb4 - SC_IOV_MAX = 0x3c - SC_LINE_MAX = 0x2b - SC_LOGIN_NAME_MAX = 0x47 - SC_MQ_OPEN_MAX = 0x1b - SC_MQ_PRIO_MAX = 0x1c - SC_NGROUPS_MAX = 0x3 - SC_OPEN_MAX = 0x4 - SC_PAGE_SIZE = 0x1e - SC_PAGESIZE = 0x1e - SC_THREAD_DESTRUCTOR_ITERATIONS = 0x49 - SC_THREAD_KEYS_MAX = 0x4a - SC_THREAD_STACK_MIN = 0x4b - SC_THREAD_THREADS_MAX = 0x4c - SC_RE_DUP_MAX = 0x2c - SC_RTSIG_MAX = 0x1f - SC_SEM_NSEMS_MAX = 0x20 - SC_SEM_VALUE_MAX = 0x21 - SC_SIGQUEUE_MAX = 0x22 - SC_STREAM_MAX = 0x5 - SC_SYMLOOP_MAX = 0xad - SC_TIMER_MAX = 0x23 - SC_TTY_NAME_MAX = 0x48 - SC_TZNAME_MAX = 0x6 - - SC_ADVISORY_INFO = 0x84 - SC_ASYNCHRONOUS_IO = 0xc - SC_BARRIERS = 0x85 - SC_CLOCK_SELECTION = 0x89 - SC_CPUTIME = 0x8a - SC_FSYNC = 0xf - SC_IPV6 = 0xeb - SC_JOB_CONTROL = 0x7 - SC_MAPPED_FILES = 0x10 - SC_MEMLOCK = 0x11 - SC_MEMLOCK_RANGE = 0x12 - SC_MEMORY_PROTECTION = 0x13 - SC_MESSAGE_PASSING = 0x14 - SC_MONOTONIC_CLOCK = 0x95 - SC_PRIORITIZED_IO = 0xd - SC_PRIORITY_SCHEDULING = 0xa - SC_RAW_SOCKETS = 0xec - SC_READER_WRITER_LOCKS = 0x99 - SC_REALTIME_SIGNALS = 0x9 - SC_REGEXP = 0x9b - SC_SAVED_IDS = 0x8 - SC_SEMAPHORES = 0x15 - SC_SHARED_MEMORY_OBJECTS = 0x16 - SC_SHELL = 0x9d - SC_SPAWN = 0x9f - SC_SPIN_LOCKS = 0x9a - SC_SPORADIC_SERVER = 0xa0 - SC_SS_REPL_MAX = 0xf1 - SC_SYNCHRONIZED_IO = 0xe - SC_THREAD_ATTR_STACKADDR = 0x4d - SC_THREAD_ATTR_STACKSIZE = 0x4e - SC_THREAD_CPUTIME = 0x8b - SC_THREAD_PRIO_INHERIT = 0x50 - SC_THREAD_PRIO_PROTECT = 0x51 - SC_THREAD_PRIORITY_SCHEDULING = 0x4f - SC_THREAD_PROCESS_SHARED = 0x52 - SC_THREAD_ROBUST_PRIO_INHERIT = 0xf7 - SC_THREAD_ROBUST_PRIO_PROTECT = 0xf8 - SC_THREAD_SAFE_FUNCTIONS = 0x44 - SC_THREAD_SPORADIC_SERVER = 0xa1 - SC_THREADS = 0x43 - SC_TIMEOUTS = 0xa4 - SC_TIMERS = 0xb - SC_TRACE = 0xb5 - SC_TRACE_EVENT_FILTER = 0xb6 - SC_TRACE_EVENT_NAME_MAX = 0xf2 - SC_TRACE_INHERIT = 0xb7 - SC_TRACE_LOG = 0xb8 - SC_TRACE_NAME_MAX = 0xf3 - SC_TRACE_SYS_MAX = 0xf4 - SC_TRACE_USER_EVENT_MAX = 0xf5 - SC_TYPED_MEMORY_OBJECTS = 0xa5 - SC_VERSION = 0x1d - - SC_V7_ILP32_OFF32 = 0xed - SC_V7_ILP32_OFFBIG = 0xee - SC_V7_LP64_OFF64 = 0xef - SC_V7_LPBIG_OFFBIG = 0xf0 - - SC_V6_ILP32_OFF32 = 0xb0 - SC_V6_ILP32_OFFBIG = 0xb1 - SC_V6_LP64_OFF64 = 0xb2 - SC_V6_LPBIG_OFFBIG = 0xb3 - - SC_2_C_BIND = 0x2f - SC_2_C_DEV = 0x30 - SC_2_C_VERSION = 0x60 - SC_2_CHAR_TERM = 0x5f - SC_2_FORT_DEV = 0x31 - SC_2_FORT_RUN = 0x32 - SC_2_LOCALEDEF = 0x34 - SC_2_PBS = 0xa8 - SC_2_PBS_ACCOUNTING = 0xa9 - SC_2_PBS_CHECKPOINT = 0xaf - SC_2_PBS_LOCATE = 0xaa - SC_2_PBS_MESSAGE = 0xab - SC_2_PBS_TRACK = 0xac - SC_2_SW_DEV = 0x33 - SC_2_UPE = 0x61 - SC_2_VERSION = 0x2e - - SC_XOPEN_CRYPT = 0x5c - SC_XOPEN_ENH_I18N = 0x5d - SC_XOPEN_REALTIME = 0x82 - SC_XOPEN_REALTIME_THREADS = 0x83 - SC_XOPEN_SHM = 0x5e - SC_XOPEN_STREAMS = 0xf6 - SC_XOPEN_UNIX = 0x5b - SC_XOPEN_VERSION = 0x59 - SC_XOPEN_XCU_VERSION = 0x5a - - SC_PHYS_PAGES = 0x55 - SC_AVPHYS_PAGES = 0x56 - SC_NPROCESSORS_CONF = 0x53 - SC_NPROCESSORS_ONLN = 0x54 - SC_UIO_MAXIOV = 0x3c -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_netbsd.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_netbsd.go deleted file mode 100644 index 4ef07a7565..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_netbsd.go +++ /dev/null @@ -1,94 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs sysconf_defs_netbsd.go - -package sysconf - -const ( - SC_AIO_LISTIO_MAX = 0x33 - SC_AIO_MAX = 0x34 - SC_ARG_MAX = 0x1 - SC_ATEXIT_MAX = 0x28 - SC_BC_BASE_MAX = 0x9 - SC_BC_DIM_MAX = 0xa - SC_BC_SCALE_MAX = 0xb - SC_BC_STRING_MAX = 0xc - SC_CHILD_MAX = 0x2 - SC_CLK_TCK = 0x27 - SC_COLL_WEIGHTS_MAX = 0xd - SC_EXPR_NEST_MAX = 0xe - SC_HOST_NAME_MAX = 0x45 - SC_IOV_MAX = 0x20 - SC_LINE_MAX = 0xf - SC_LOGIN_NAME_MAX = 0x25 - SC_MQ_OPEN_MAX = 0x36 - SC_MQ_PRIO_MAX = 0x37 - SC_NGROUPS_MAX = 0x4 - SC_OPEN_MAX = 0x5 - SC_PAGE_SIZE = 0x1c - SC_PAGESIZE = 0x1c - SC_THREAD_DESTRUCTOR_ITERATIONS = 0x39 - SC_THREAD_KEYS_MAX = 0x3a - SC_THREAD_STACK_MIN = 0x3b - SC_THREAD_THREADS_MAX = 0x3c - SC_RE_DUP_MAX = 0x10 - SC_STREAM_MAX = 0x1a - SC_SYMLOOP_MAX = 0x49 - SC_TTY_NAME_MAX = 0x44 - SC_TZNAME_MAX = 0x1b - - SC_ASYNCHRONOUS_IO = 0x32 - SC_BARRIERS = 0x2b - SC_FSYNC = 0x1d - SC_JOB_CONTROL = 0x6 - SC_MAPPED_FILES = 0x21 - SC_SEMAPHORES = 0x2a - SC_SHELL = 0x48 - SC_THREADS = 0x29 - SC_TIMERS = 0x2c - SC_VERSION = 0x8 - - SC_2_VERSION = 0x11 - SC_2_C_DEV = 0x13 - SC_2_FORT_DEV = 0x15 - SC_2_FORT_RUN = 0x16 - SC_2_LOCALEDEF = 0x17 - SC_2_SW_DEV = 0x18 - SC_2_UPE = 0x19 - - SC_PHYS_PAGES = 0x79 - SC_MONOTONIC_CLOCK = 0x26 - SC_NPROCESSORS_CONF = 0x3e9 - SC_NPROCESSORS_ONLN = 0x3ea -) - -const ( - _MAXHOSTNAMELEN = 0x100 - _MAXLOGNAME = 0x10 - _MAXSYMLINKS = 0x20 - - _POSIX_ARG_MAX = 0x1000 - _POSIX_CHILD_MAX = 0x19 - _POSIX_SHELL = 0x1 - _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 - _POSIX_THREAD_KEYS_MAX = 0x100 - _POSIX_VERSION = 0x30db0 - - _POSIX2_VERSION = 0x30db0 - - _FOPEN_MAX = 0x14 - _NAME_MAX = 0x1ff - _RE_DUP_MAX = 0xff - - _BC_BASE_MAX = 0x7fffffff - _BC_DIM_MAX = 0xffff - _BC_SCALE_MAX = 0x7fffffff - _BC_STRING_MAX = 0x7fffffff - _COLL_WEIGHTS_MAX = 0x2 - _EXPR_NEST_MAX = 0x20 - _LINE_MAX = 0x800 - - _PATH_DEV = "/dev/" - _PATH_ZONEINFO = "/usr/share/zoneinfo" -) - -const _PC_NAME_MAX = 0x4 diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_openbsd.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_openbsd.go deleted file mode 100644 index 87db8ec9d2..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_openbsd.go +++ /dev/null @@ -1,260 +0,0 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs sysconf_defs_openbsd.go - -package sysconf - -const ( - SC_AIO_LISTIO_MAX = 0x2a - SC_AIO_MAX = 0x2b - SC_AIO_PRIO_DELTA_MAX = 0x2c - SC_ARG_MAX = 0x1 - SC_ATEXIT_MAX = 0x2e - SC_BC_BASE_MAX = 0x9 - SC_BC_DIM_MAX = 0xa - SC_BC_SCALE_MAX = 0xb - SC_BC_STRING_MAX = 0xc - SC_CHILD_MAX = 0x2 - SC_CLK_TCK = 0x3 - SC_COLL_WEIGHTS_MAX = 0xd - SC_DELAYTIMER_MAX = 0x32 - SC_EXPR_NEST_MAX = 0xe - SC_GETGR_R_SIZE_MAX = 0x64 - SC_GETPW_R_SIZE_MAX = 0x65 - SC_HOST_NAME_MAX = 0x21 - SC_IOV_MAX = 0x33 - SC_LINE_MAX = 0xf - SC_LOGIN_NAME_MAX = 0x66 - SC_MQ_OPEN_MAX = 0x3a - SC_MQ_PRIO_MAX = 0x3b - SC_NGROUPS_MAX = 0x4 - SC_OPEN_MAX = 0x5 - SC_PAGE_SIZE = 0x1c - SC_PAGESIZE = 0x1c - SC_THREAD_DESTRUCTOR_ITERATIONS = 0x50 - SC_THREAD_KEYS_MAX = 0x51 - SC_THREAD_STACK_MIN = 0x59 - SC_THREAD_THREADS_MAX = 0x5a - SC_RE_DUP_MAX = 0x10 - SC_SEM_NSEMS_MAX = 0x1f - SC_SEM_VALUE_MAX = 0x20 - SC_SIGQUEUE_MAX = 0x46 - SC_STREAM_MAX = 0x1a - SC_SYMLOOP_MAX = 0x4c - SC_TIMER_MAX = 0x5d - SC_TTY_NAME_MAX = 0x6b - SC_TZNAME_MAX = 0x1b - - SC_ADVISORY_INFO = 0x29 - SC_ASYNCHRONOUS_IO = 0x2d - SC_BARRIERS = 0x2f - SC_CLOCK_SELECTION = 0x30 - SC_CPUTIME = 0x31 - SC_FSYNC = 0x1d - SC_IPV6 = 0x34 - SC_JOB_CONTROL = 0x6 - SC_MAPPED_FILES = 0x35 - SC_MEMLOCK = 0x36 - SC_MEMLOCK_RANGE = 0x37 - SC_MEMORY_PROTECTION = 0x38 - SC_MESSAGE_PASSING = 0x39 - SC_MONOTONIC_CLOCK = 0x22 - SC_PRIORITIZED_IO = 0x3c - SC_PRIORITY_SCHEDULING = 0x3d - SC_RAW_SOCKETS = 0x3e - SC_READER_WRITER_LOCKS = 0x3f - SC_REALTIME_SIGNALS = 0x40 - SC_REGEXP = 0x41 - SC_SAVED_IDS = 0x7 - SC_SEMAPHORES = 0x43 - SC_SHARED_MEMORY_OBJECTS = 0x44 - SC_SHELL = 0x45 - SC_SPAWN = 0x47 - SC_SPIN_LOCKS = 0x48 - SC_SPORADIC_SERVER = 0x49 - SC_SS_REPL_MAX = 0x4a - SC_SYNCHRONIZED_IO = 0x4b - SC_THREAD_ATTR_STACKADDR = 0x4d - SC_THREAD_ATTR_STACKSIZE = 0x4e - SC_THREAD_CPUTIME = 0x4f - SC_THREAD_PRIO_INHERIT = 0x52 - SC_THREAD_PRIO_PROTECT = 0x53 - SC_THREAD_PRIORITY_SCHEDULING = 0x54 - SC_THREAD_PROCESS_SHARED = 0x55 - SC_THREAD_ROBUST_PRIO_INHERIT = 0x56 - SC_THREAD_ROBUST_PRIO_PROTECT = 0x57 - SC_THREAD_SAFE_FUNCTIONS = 0x67 - SC_THREAD_SPORADIC_SERVER = 0x58 - SC_THREADS = 0x5b - SC_TIMEOUTS = 0x5c - SC_TIMERS = 0x5e - SC_TRACE = 0x5f - SC_TRACE_EVENT_FILTER = 0x60 - SC_TRACE_EVENT_NAME_MAX = 0x61 - SC_TRACE_INHERIT = 0x62 - SC_TRACE_LOG = 0x63 - SC_TRACE_NAME_MAX = 0x68 - SC_TRACE_SYS_MAX = 0x69 - SC_TRACE_USER_EVENT_MAX = 0x6a - SC_TYPED_MEMORY_OBJECTS = 0x6c - SC_VERSION = 0x8 - - SC_V7_ILP32_OFF32 = 0x71 - SC_V7_ILP32_OFFBIG = 0x72 - SC_V7_LP64_OFF64 = 0x73 - SC_V7_LPBIG_OFFBIG = 0x74 - - SC_V6_ILP32_OFF32 = 0x6d - SC_V6_ILP32_OFFBIG = 0x6e - SC_V6_LP64_OFF64 = 0x6f - SC_V6_LPBIG_OFFBIG = 0x70 - - SC_2_C_BIND = 0x12 - SC_2_C_DEV = 0x13 - SC_2_CHAR_TERM = 0x14 - SC_2_FORT_DEV = 0x15 - SC_2_FORT_RUN = 0x16 - SC_2_LOCALEDEF = 0x17 - SC_2_PBS = 0x23 - SC_2_PBS_ACCOUNTING = 0x24 - SC_2_PBS_CHECKPOINT = 0x25 - SC_2_PBS_LOCATE = 0x26 - SC_2_PBS_MESSAGE = 0x27 - SC_2_PBS_TRACK = 0x28 - SC_2_SW_DEV = 0x18 - SC_2_UPE = 0x19 - SC_2_VERSION = 0x11 - - SC_XOPEN_CRYPT = 0x75 - SC_XOPEN_ENH_I18N = 0x76 - SC_XOPEN_REALTIME = 0x78 - SC_XOPEN_REALTIME_THREADS = 0x79 - SC_XOPEN_SHM = 0x1e - SC_XOPEN_STREAMS = 0x7a - SC_XOPEN_UNIX = 0x7b - SC_XOPEN_UUCP = 0x7c - SC_XOPEN_VERSION = 0x7d - - SC_AVPHYS_PAGES = 0x1f5 - SC_PHYS_PAGES = 0x1f4 - SC_NPROCESSORS_CONF = 0x1f6 - SC_NPROCESSORS_ONLN = 0x1f7 -) - -const ( - _HOST_NAME_MAX = 0xff - _IOV_MAX = 0x400 - _LOGIN_NAME_MAX = 0x20 - _PTHREAD_DESTRUCTOR_ITERATIONS = 0x4 - _PTHREAD_KEYS_MAX = 0x100 - _PTHREAD_STACK_MIN = 0x1000 - _PTHREAD_THREADS_MAX = 0xffffffffffffffff - _SEM_VALUE_MAX = 0xffffffff - _SYMLOOP_MAX = 0x20 - _TTY_NAME_MAX = 0x104 - - _GR_BUF_LEN = 0xa40 - _PW_BUF_LEN = 0x400 - - _CLK_TCK = 0x64 - - _POSIX_ADVISORY_INFO = -0x1 - _POSIX_ARG_MAX = 0x1000 - _POSIX_ASYNCHRONOUS_IO = -0x1 - _POSIX_BARRIERS = 0x30db0 - _POSIX_CHILD_MAX = 0x19 - _POSIX_CLOCK_SELECTION = -0x1 - _POSIX_CPUTIME = 0x31069 - _POSIX_FSYNC = 0x30db0 - _POSIX_IPV6 = 0x0 - _POSIX_JOB_CONTROL = 0x1 - _POSIX_MAPPED_FILES = 0x30db0 - _POSIX_MEMLOCK = 0x30db0 - _POSIX_MEMLOCK_RANGE = 0x30db0 - _POSIX_MEMORY_PROTECTION = 0x30db0 - _POSIX_MESSAGE_PASSING = -0x1 - _POSIX_MONOTONIC_CLOCK = 0x30db0 - _POSIX_PRIORITIZED_IO = -0x1 - _POSIX_PRIORITY_SCHEDULING = -0x1 - _POSIX_RAW_SOCKETS = 0x30db0 - _POSIX_READER_WRITER_LOCKS = 0x30db0 - _POSIX_REALTIME_SIGNALS = -0x1 - _POSIX_REGEXP = 0x1 - _POSIX_SAVED_IDS = 0x1 - _POSIX_SEMAPHORES = 0x30db0 - _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 - _POSIX_SHELL = 0x1 - _POSIX_SPAWN = 0x30db0 - _POSIX_SPIN_LOCKS = 0x30db0 - _POSIX_SPORADIC_SERVER = -0x1 - _POSIX_SYNCHRONIZED_IO = -0x1 - _POSIX_THREAD_ATTR_STACKADDR = 0x30db0 - _POSIX_THREAD_ATTR_STACKSIZE = 0x30db0 - _POSIX_THREAD_CPUTIME = 0x31069 - _POSIX_THREAD_KEYS_MAX = 0x80 - _POSIX_THREAD_PRIO_INHERIT = -0x1 - _POSIX_THREAD_PRIO_PROTECT = -0x1 - _POSIX_THREAD_PRIORITY_SCHEDULING = -0x1 - _POSIX_THREAD_PROCESS_SHARED = -0x1 - _POSIX_THREAD_ROBUST_PRIO_INHERIT = -0x1 - _POSIX_THREAD_ROBUST_PRIO_PROTECT = -0x1 - _POSIX_THREAD_SAFE_FUNCTIONS = 0x30db0 - _POSIX_THREAD_SPORADIC_SERVER = -0x1 - _POSIX_THREADS = 0x30db0 - _POSIX_TIMERS = -0x1 - _POSIX_TIMEOUTS = 0x30db0 - _POSIX_TRACE = -0x1 - _POSIX_TYPED_MEMORY_OBJECTS = -0x1 - _POSIX_VERSION = 0x31069 - - _POSIX_V7_ILP32_OFF32 = -0x1 - _POSIX_V7_ILP32_OFFBIG = 0x0 - _POSIX_V7_LP64_OFF64 = 0x0 - _POSIX_V7_LPBIG_OFFBIG = 0x0 - - _POSIX_V6_ILP32_OFF32 = -0x1 - _POSIX_V6_ILP32_OFFBIG = 0x0 - _POSIX_V6_LP64_OFF64 = 0x0 - _POSIX_V6_LPBIG_OFFBIG = 0x0 - - _POSIX2_C_BIND = 0x30db0 - _POSIX2_C_DEV = -0x1 - _POSIX2_CHAR_TERM = 0x1 - _POSIX2_LOCALEDEF = -0x1 - _POSIX2_PBS = -0x1 - _POSIX2_SW_DEV = 0x30db0 - _POSIX2_UPE = 0x30db0 - _POSIX2_VERSION = 0x31069 - - _XOPEN_CRYPT = 0x1 - _XOPEN_ENH_I18N = -0x1 - _XOPEN_REALTIME = -0x1 - _XOPEN_REALTIME_THREADS = -0x1 - _XOPEN_SHM = 0x1 - _XOPEN_STREAMS = -0x1 - _XOPEN_UNIX = -0x1 - _XOPEN_UUCP = -0x1 - - _FOPEN_MAX = 0x14 - _NAME_MAX = 0xff - _RE_DUP_MAX = 0xff - - _BC_BASE_MAX = 0x7fffffff - _BC_DIM_MAX = 0xffff - _BC_SCALE_MAX = 0x7fffffff - _BC_STRING_MAX = 0x7fffffff - _COLL_WEIGHTS_MAX = 0x2 - _EXPR_NEST_MAX = 0x20 - _LINE_MAX = 0x800 - - _SHRT_MAX = 0x7fff - - _PATH_ZONEINFO = "/usr/share/zoneinfo" -) - -const ( - _CHAR_BIT = 0x8 - - _INT_MAX = 0x7fffffff - - sizeofOffT = 0x8 -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_solaris.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_solaris.go deleted file mode 100644 index e0a38d975f..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_defs_solaris.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_defs_solaris.go - -package sysconf - -const ( - SC_AIO_LISTIO_MAX = 0x12 - SC_AIO_MAX = 0x13 - SC_AIO_PRIO_DELTA_MAX = 0x14 - SC_ARG_MAX = 0x1 - SC_ATEXIT_MAX = 0x4c - SC_BC_BASE_MAX = 0x36 - SC_BC_DIM_MAX = 0x37 - SC_BC_SCALE_MAX = 0x38 - SC_BC_STRING_MAX = 0x39 - SC_CHILD_MAX = 0x2 - SC_CLK_TCK = 0x3 - SC_COLL_WEIGHTS_MAX = 0x3a - SC_DELAYTIMER_MAX = 0x16 - SC_EXPR_NEST_MAX = 0x3b - SC_GETGR_R_SIZE_MAX = 0x239 - SC_GETPW_R_SIZE_MAX = 0x23a - SC_HOST_NAME_MAX = 0x2df - SC_IOV_MAX = 0x4d - SC_LINE_MAX = 0x3c - SC_LOGIN_NAME_MAX = 0x23b - SC_MQ_OPEN_MAX = 0x1d - SC_MQ_PRIO_MAX = 0x1e - SC_NGROUPS_MAX = 0x4 - SC_OPEN_MAX = 0x5 - SC_PAGE_SIZE = 0xb - SC_PAGESIZE = 0xb - SC_THREAD_DESTRUCTOR_ITERATIONS = 0x238 - SC_THREAD_KEYS_MAX = 0x23c - SC_THREAD_STACK_MIN = 0x23d - SC_THREAD_THREADS_MAX = 0x23e - SC_RE_DUP_MAX = 0x3d - SC_RTSIG_MAX = 0x22 - SC_SEM_NSEMS_MAX = 0x24 - SC_SEM_VALUE_MAX = 0x25 - SC_SIGQUEUE_MAX = 0x27 - SC_STREAM_MAX = 0x10 - SC_SYMLOOP_MAX = 0x2e8 - SC_TIMER_MAX = 0x2c - SC_TTY_NAME_MAX = 0x23f - SC_TZNAME_MAX = 0x11 - - SC_ADVISORY_INFO = 0x2db - SC_ASYNCHRONOUS_IO = 0x15 - SC_BARRIERS = 0x2dc - SC_CLOCK_SELECTION = 0x2dd - SC_CPUTIME = 0x2de - SC_FSYNC = 0x17 - SC_IPV6 = 0x2fa - SC_JOB_CONTROL = 0x6 - SC_MAPPED_FILES = 0x18 - SC_MEMLOCK = 0x19 - SC_MEMLOCK_RANGE = 0x1a - SC_MEMORY_PROTECTION = 0x1b - SC_MESSAGE_PASSING = 0x1c - SC_MONOTONIC_CLOCK = 0x2e0 - SC_PRIORITIZED_IO = 0x1f - SC_PRIORITY_SCHEDULING = 0x20 - SC_RAW_SOCKETS = 0x2fb - SC_READER_WRITER_LOCKS = 0x2e1 - SC_REALTIME_SIGNALS = 0x21 - SC_REGEXP = 0x2e2 - SC_SAVED_IDS = 0x7 - SC_SEMAPHORES = 0x23 - SC_SHARED_MEMORY_OBJECTS = 0x26 - SC_SHELL = 0x2e3 - SC_SPAWN = 0x2e4 - SC_SPIN_LOCKS = 0x2e5 - SC_SPORADIC_SERVER = 0x2e6 - SC_SS_REPL_MAX = 0x2e7 - SC_SYNCHRONIZED_IO = 0x2a - SC_THREAD_ATTR_STACKADDR = 0x241 - SC_THREAD_ATTR_STACKSIZE = 0x242 - SC_THREAD_CPUTIME = 0x2e9 - SC_THREAD_PRIO_INHERIT = 0x244 - SC_THREAD_PRIO_PROTECT = 0x245 - SC_THREAD_PRIORITY_SCHEDULING = 0x243 - SC_THREAD_PROCESS_SHARED = 0x246 - SC_THREAD_SAFE_FUNCTIONS = 0x247 - SC_THREAD_SPORADIC_SERVER = 0x2ea - SC_THREADS = 0x240 - SC_TIMEOUTS = 0x2eb - SC_TIMERS = 0x2b - SC_TRACE = 0x2ec - SC_TRACE_EVENT_FILTER = 0x2ed - SC_TRACE_EVENT_NAME_MAX = 0x2ee - SC_TRACE_INHERIT = 0x2ef - SC_TRACE_LOG = 0x2f0 - SC_TRACE_NAME_MAX = 0x2f1 - SC_TRACE_SYS_MAX = 0x2f2 - SC_TRACE_USER_EVENT_MAX = 0x2f3 - SC_TYPED_MEMORY_OBJECTS = 0x2f4 - SC_VERSION = 0x8 - - SC_V6_ILP32_OFF32 = 0x2f5 - SC_V6_ILP32_OFFBIG = 0x2f6 - SC_V6_LP64_OFF64 = 0x2f7 - SC_V6_LPBIG_OFFBIG = 0x2f8 - - SC_2_C_BIND = 0x2d - SC_2_C_DEV = 0x2e - SC_2_C_VERSION = 0x2f - SC_2_CHAR_TERM = 0x42 - SC_2_FORT_DEV = 0x30 - SC_2_FORT_RUN = 0x31 - SC_2_LOCALEDEF = 0x32 - SC_2_PBS = 0x2d4 - SC_2_PBS_ACCOUNTING = 0x2d5 - SC_2_PBS_CHECKPOINT = 0x2d6 - SC_2_PBS_LOCATE = 0x2d8 - SC_2_PBS_MESSAGE = 0x2d9 - SC_2_PBS_TRACK = 0x2da - SC_2_SW_DEV = 0x33 - SC_2_UPE = 0x34 - SC_2_VERSION = 0x35 - - SC_XOPEN_CRYPT = 0x3e - SC_XOPEN_ENH_I18N = 0x3f - SC_XOPEN_REALTIME = 0x2ce - SC_XOPEN_REALTIME_THREADS = 0x2cf - SC_XOPEN_SHM = 0x40 - SC_XOPEN_STREAMS = 0x2f9 - SC_XOPEN_UNIX = 0x4e - SC_XOPEN_VERSION = 0xc - SC_XOPEN_XCU_VERSION = 0x43 - - SC_PHYS_PAGES = 0x1f4 - SC_AVPHYS_PAGES = 0x1f5 - SC_NPROCESSORS_CONF = 0xe - SC_NPROCESSORS_ONLN = 0xf -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_386.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_386.go deleted file mode 100644 index e0ad197059..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_386.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_values_freebsd.go - -package sysconf - -const ( - _LONG_MAX = 0x7fffffff - _SHRT_MAX = 0x7fff -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_amd64.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_amd64.go deleted file mode 100644 index 771e5a0a74..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_amd64.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_values_freebsd.go - -package sysconf - -const ( - _LONG_MAX = 0x7fffffffffffffff - _SHRT_MAX = 0x7fff -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm.go deleted file mode 100644 index e0ad197059..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_values_freebsd.go - -package sysconf - -const ( - _LONG_MAX = 0x7fffffff - _SHRT_MAX = 0x7fff -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm64.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm64.go deleted file mode 100644 index 771e5a0a74..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm64.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_values_freebsd.go - -package sysconf - -const ( - _LONG_MAX = 0x7fffffffffffffff - _SHRT_MAX = 0x7fff -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_386.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_386.go deleted file mode 100644 index 730ec5d335..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_386.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_values_linux.go - -package sysconf - -const ( - _AIO_PRIO_DELTA_MAX = 0x14 - _BC_BASE_MAX = 0x63 - _BC_DIM_MAX = 0x800 - _BC_SCALE_MAX = 0x63 - _BC_STRING_MAX = 0x3e8 - _COLL_WEIGHTS_MAX = 0xff - _DELAYTIMER_MAX = 0x7fffffff - _EXPR_NEST_MAX = 0x20 - _HOST_NAME_MAX = 0x40 - _LINE_MAX = 0x800 - _LOGIN_NAME_MAX = 0x100 - _MQ_PRIO_MAX = 0x8000 - _NGROUPS_MAX = 0x10000 - _NSS_BUFLEN_GROUP = 0x400 - _NSS_BUFLEN_PASSWD = 0x400 - _OPEN_MAX = 0x100 - _PTHREAD_KEYS_MAX = 0x400 - _PTHREAD_STACK_MIN = 0x4000 - _RE_DUP_MAX = 0x7fff - _RTSIG_MAX = 0x20 - _SEM_VALUE_MAX = 0x7fffffff - _STREAM_MAX = 0x10 - _SYMLOOP_MAX = -0x1 - _TTY_NAME_MAX = 0x20 - - _UIO_MAXIOV = 0x400 - - _INT_MAX = 0x7fffffff - - _POSIX_ADVISORY_INFO = 0x31069 - _POSIX_ARG_MAX = 0x1000 - _POSIX_ASYNCHRONOUS_IO = 0x31069 - _POSIX_BARRIERS = 0x31069 - _POSIX_CHILD_MAX = 0x19 - _POSIX_CLOCK_SELECTION = 0x31069 - _POSIX_CPUTIME = 0x0 - _POSIX_FSYNC = 0x31069 - _POSIX_IPV6 = 0x31069 - _POSIX_JOB_CONTROL = 0x1 - _POSIX_MAPPED_FILES = 0x31069 - _POSIX_MEMLOCK = 0x31069 - _POSIX_MEMLOCK_RANGE = 0x31069 - _POSIX_MEMORY_PROTECTION = 0x31069 - _POSIX_MESSAGE_PASSING = 0x31069 - _POSIX_MONOTONIC_CLOCK = 0x0 - _POSIX_PRIORITIZED_IO = 0x31069 - _POSIX_PRIORITY_SCHEDULING = 0x31069 - _POSIX_RAW_SOCKETS = 0x31069 - _POSIX_READER_WRITER_LOCKS = 0x31069 - _POSIX_REALTIME_SIGNALS = 0x31069 - _POSIX_REGEXP = 0x1 - _POSIX_SAVED_IDS = 0x1 - _POSIX_SEMAPHORES = 0x31069 - _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 - _POSIX_SHELL = 0x1 - _POSIX_SIGQUEUE_MAX = 0x20 - _POSIX_SPAWN = 0x31069 - _POSIX_SPIN_LOCKS = 0x31069 - _POSIX_SPORADIC_SERVER = -0x1 - _POSIX_SYNCHRONIZED_IO = 0x31069 - _POSIX_THREAD_ATTR_STACKADDR = 0x31069 - _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 - _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 - _POSIX_THREAD_PRIO_INHERIT = 0x31069 - _POSIX_THREAD_PRIO_PROTECT = 0x31069 - _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 - _POSIX_THREAD_PROCESS_SHARED = 0x31069 - _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 - _POSIX_THREAD_SPORADIC_SERVER = -0x1 - _POSIX_THREADS = 0x31069 - _POSIX_TIMEOUTS = 0x31069 - _POSIX_TIMERS = 0x31069 - _POSIX_TRACE = -0x1 - _POSIX_TRACE_EVENT_FILTER = -0x1 - _POSIX_TRACE_INHERIT = -0x1 - _POSIX_TRACE_LOG = -0x1 - _POSIX_TYPED_MEMORY_OBJECTS = -0x1 - _POSIX_VERSION = 0x31069 - - _POSIX_V7_ILP32_OFF32 = 0x1 - _POSIX_V7_ILP32_OFFBIG = 0x1 - _POSIX_V7_LP64_OFF64 = -0x1 - _POSIX_V7_LPBIG_OFFBIG = -0x1 - - _POSIX_V6_ILP32_OFF32 = 0x1 - _POSIX_V6_ILP32_OFFBIG = 0x1 - _POSIX_V6_LP64_OFF64 = -0x1 - _POSIX_V6_LPBIG_OFFBIG = -0x1 - - _POSIX2_C_BIND = 0x31069 - _POSIX2_C_DEV = 0x31069 - _POSIX2_C_VERSION = 0x31069 - _POSIX2_CHAR_TERM = 0x31069 - _POSIX2_LOCALEDEF = 0x31069 - _POSIX2_SW_DEV = 0x31069 - _POSIX2_VERSION = 0x31069 - - _XOPEN_ENH_I18N = 0x1 - _XOPEN_REALTIME = 0x1 - _XOPEN_REALTIME_THREADS = 0x1 - _XOPEN_SHM = 0x1 - _XOPEN_UNIX = 0x1 - _XOPEN_VERSION = 0x2bc - _XOPEN_XCU_VERSION = 0x4 -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_amd64.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_amd64.go deleted file mode 100644 index 8d9c273d0b..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_amd64.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_values_linux.go - -package sysconf - -const ( - _AIO_PRIO_DELTA_MAX = 0x14 - _BC_BASE_MAX = 0x63 - _BC_DIM_MAX = 0x800 - _BC_SCALE_MAX = 0x63 - _BC_STRING_MAX = 0x3e8 - _COLL_WEIGHTS_MAX = 0xff - _DELAYTIMER_MAX = 0x7fffffff - _EXPR_NEST_MAX = 0x20 - _HOST_NAME_MAX = 0x40 - _LINE_MAX = 0x800 - _LOGIN_NAME_MAX = 0x100 - _MQ_PRIO_MAX = 0x8000 - _NGROUPS_MAX = 0x10000 - _NSS_BUFLEN_GROUP = 0x400 - _NSS_BUFLEN_PASSWD = 0x400 - _OPEN_MAX = 0x100 - _PTHREAD_KEYS_MAX = 0x400 - _PTHREAD_STACK_MIN = 0x4000 - _RE_DUP_MAX = 0x7fff - _RTSIG_MAX = 0x20 - _SEM_VALUE_MAX = 0x7fffffff - _STREAM_MAX = 0x10 - _SYMLOOP_MAX = -0x1 - _TTY_NAME_MAX = 0x20 - - _UIO_MAXIOV = 0x400 - - _INT_MAX = 0x7fffffff - - _POSIX_ADVISORY_INFO = 0x31069 - _POSIX_ARG_MAX = 0x1000 - _POSIX_ASYNCHRONOUS_IO = 0x31069 - _POSIX_BARRIERS = 0x31069 - _POSIX_CHILD_MAX = 0x19 - _POSIX_CLOCK_SELECTION = 0x31069 - _POSIX_CPUTIME = 0x0 - _POSIX_FSYNC = 0x31069 - _POSIX_IPV6 = 0x31069 - _POSIX_JOB_CONTROL = 0x1 - _POSIX_MAPPED_FILES = 0x31069 - _POSIX_MEMLOCK = 0x31069 - _POSIX_MEMLOCK_RANGE = 0x31069 - _POSIX_MEMORY_PROTECTION = 0x31069 - _POSIX_MESSAGE_PASSING = 0x31069 - _POSIX_MONOTONIC_CLOCK = 0x0 - _POSIX_PRIORITIZED_IO = 0x31069 - _POSIX_PRIORITY_SCHEDULING = 0x31069 - _POSIX_RAW_SOCKETS = 0x31069 - _POSIX_READER_WRITER_LOCKS = 0x31069 - _POSIX_REALTIME_SIGNALS = 0x31069 - _POSIX_REGEXP = 0x1 - _POSIX_SAVED_IDS = 0x1 - _POSIX_SEMAPHORES = 0x31069 - _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 - _POSIX_SHELL = 0x1 - _POSIX_SIGQUEUE_MAX = 0x20 - _POSIX_SPAWN = 0x31069 - _POSIX_SPIN_LOCKS = 0x31069 - _POSIX_SPORADIC_SERVER = -0x1 - _POSIX_SYNCHRONIZED_IO = 0x31069 - _POSIX_THREAD_ATTR_STACKADDR = 0x31069 - _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 - _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 - _POSIX_THREAD_PRIO_INHERIT = 0x31069 - _POSIX_THREAD_PRIO_PROTECT = 0x31069 - _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 - _POSIX_THREAD_PROCESS_SHARED = 0x31069 - _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 - _POSIX_THREAD_SPORADIC_SERVER = -0x1 - _POSIX_THREADS = 0x31069 - _POSIX_TIMEOUTS = 0x31069 - _POSIX_TIMERS = 0x31069 - _POSIX_TRACE = -0x1 - _POSIX_TRACE_EVENT_FILTER = -0x1 - _POSIX_TRACE_INHERIT = -0x1 - _POSIX_TRACE_LOG = -0x1 - _POSIX_TYPED_MEMORY_OBJECTS = -0x1 - _POSIX_VERSION = 0x31069 - - _POSIX_V7_ILP32_OFF32 = -0x1 - _POSIX_V7_ILP32_OFFBIG = -0x1 - _POSIX_V7_LP64_OFF64 = 0x1 - _POSIX_V7_LPBIG_OFFBIG = -0x1 - - _POSIX_V6_ILP32_OFF32 = -0x1 - _POSIX_V6_ILP32_OFFBIG = -0x1 - _POSIX_V6_LP64_OFF64 = 0x1 - _POSIX_V6_LPBIG_OFFBIG = -0x1 - - _POSIX2_C_BIND = 0x31069 - _POSIX2_C_DEV = 0x31069 - _POSIX2_C_VERSION = 0x31069 - _POSIX2_CHAR_TERM = 0x31069 - _POSIX2_LOCALEDEF = 0x31069 - _POSIX2_SW_DEV = 0x31069 - _POSIX2_VERSION = 0x31069 - - _XOPEN_ENH_I18N = 0x1 - _XOPEN_REALTIME = 0x1 - _XOPEN_REALTIME_THREADS = 0x1 - _XOPEN_SHM = 0x1 - _XOPEN_UNIX = 0x1 - _XOPEN_VERSION = 0x2bc - _XOPEN_XCU_VERSION = 0x4 -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_arm.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_arm.go deleted file mode 100644 index 730ec5d335..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_arm.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_values_linux.go - -package sysconf - -const ( - _AIO_PRIO_DELTA_MAX = 0x14 - _BC_BASE_MAX = 0x63 - _BC_DIM_MAX = 0x800 - _BC_SCALE_MAX = 0x63 - _BC_STRING_MAX = 0x3e8 - _COLL_WEIGHTS_MAX = 0xff - _DELAYTIMER_MAX = 0x7fffffff - _EXPR_NEST_MAX = 0x20 - _HOST_NAME_MAX = 0x40 - _LINE_MAX = 0x800 - _LOGIN_NAME_MAX = 0x100 - _MQ_PRIO_MAX = 0x8000 - _NGROUPS_MAX = 0x10000 - _NSS_BUFLEN_GROUP = 0x400 - _NSS_BUFLEN_PASSWD = 0x400 - _OPEN_MAX = 0x100 - _PTHREAD_KEYS_MAX = 0x400 - _PTHREAD_STACK_MIN = 0x4000 - _RE_DUP_MAX = 0x7fff - _RTSIG_MAX = 0x20 - _SEM_VALUE_MAX = 0x7fffffff - _STREAM_MAX = 0x10 - _SYMLOOP_MAX = -0x1 - _TTY_NAME_MAX = 0x20 - - _UIO_MAXIOV = 0x400 - - _INT_MAX = 0x7fffffff - - _POSIX_ADVISORY_INFO = 0x31069 - _POSIX_ARG_MAX = 0x1000 - _POSIX_ASYNCHRONOUS_IO = 0x31069 - _POSIX_BARRIERS = 0x31069 - _POSIX_CHILD_MAX = 0x19 - _POSIX_CLOCK_SELECTION = 0x31069 - _POSIX_CPUTIME = 0x0 - _POSIX_FSYNC = 0x31069 - _POSIX_IPV6 = 0x31069 - _POSIX_JOB_CONTROL = 0x1 - _POSIX_MAPPED_FILES = 0x31069 - _POSIX_MEMLOCK = 0x31069 - _POSIX_MEMLOCK_RANGE = 0x31069 - _POSIX_MEMORY_PROTECTION = 0x31069 - _POSIX_MESSAGE_PASSING = 0x31069 - _POSIX_MONOTONIC_CLOCK = 0x0 - _POSIX_PRIORITIZED_IO = 0x31069 - _POSIX_PRIORITY_SCHEDULING = 0x31069 - _POSIX_RAW_SOCKETS = 0x31069 - _POSIX_READER_WRITER_LOCKS = 0x31069 - _POSIX_REALTIME_SIGNALS = 0x31069 - _POSIX_REGEXP = 0x1 - _POSIX_SAVED_IDS = 0x1 - _POSIX_SEMAPHORES = 0x31069 - _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 - _POSIX_SHELL = 0x1 - _POSIX_SIGQUEUE_MAX = 0x20 - _POSIX_SPAWN = 0x31069 - _POSIX_SPIN_LOCKS = 0x31069 - _POSIX_SPORADIC_SERVER = -0x1 - _POSIX_SYNCHRONIZED_IO = 0x31069 - _POSIX_THREAD_ATTR_STACKADDR = 0x31069 - _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 - _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 - _POSIX_THREAD_PRIO_INHERIT = 0x31069 - _POSIX_THREAD_PRIO_PROTECT = 0x31069 - _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 - _POSIX_THREAD_PROCESS_SHARED = 0x31069 - _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 - _POSIX_THREAD_SPORADIC_SERVER = -0x1 - _POSIX_THREADS = 0x31069 - _POSIX_TIMEOUTS = 0x31069 - _POSIX_TIMERS = 0x31069 - _POSIX_TRACE = -0x1 - _POSIX_TRACE_EVENT_FILTER = -0x1 - _POSIX_TRACE_INHERIT = -0x1 - _POSIX_TRACE_LOG = -0x1 - _POSIX_TYPED_MEMORY_OBJECTS = -0x1 - _POSIX_VERSION = 0x31069 - - _POSIX_V7_ILP32_OFF32 = 0x1 - _POSIX_V7_ILP32_OFFBIG = 0x1 - _POSIX_V7_LP64_OFF64 = -0x1 - _POSIX_V7_LPBIG_OFFBIG = -0x1 - - _POSIX_V6_ILP32_OFF32 = 0x1 - _POSIX_V6_ILP32_OFFBIG = 0x1 - _POSIX_V6_LP64_OFF64 = -0x1 - _POSIX_V6_LPBIG_OFFBIG = -0x1 - - _POSIX2_C_BIND = 0x31069 - _POSIX2_C_DEV = 0x31069 - _POSIX2_C_VERSION = 0x31069 - _POSIX2_CHAR_TERM = 0x31069 - _POSIX2_LOCALEDEF = 0x31069 - _POSIX2_SW_DEV = 0x31069 - _POSIX2_VERSION = 0x31069 - - _XOPEN_ENH_I18N = 0x1 - _XOPEN_REALTIME = 0x1 - _XOPEN_REALTIME_THREADS = 0x1 - _XOPEN_SHM = 0x1 - _XOPEN_UNIX = 0x1 - _XOPEN_VERSION = 0x2bc - _XOPEN_XCU_VERSION = 0x4 -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_arm64.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_arm64.go deleted file mode 100644 index 7a6d9912cd..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_arm64.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_values_linux.go - -package sysconf - -const ( - _AIO_PRIO_DELTA_MAX = 0x14 - _BC_BASE_MAX = 0x63 - _BC_DIM_MAX = 0x800 - _BC_SCALE_MAX = 0x63 - _BC_STRING_MAX = 0x3e8 - _COLL_WEIGHTS_MAX = 0xff - _DELAYTIMER_MAX = 0x7fffffff - _EXPR_NEST_MAX = 0x20 - _HOST_NAME_MAX = 0x40 - _LINE_MAX = 0x800 - _LOGIN_NAME_MAX = 0x100 - _MQ_PRIO_MAX = 0x8000 - _NGROUPS_MAX = 0x10000 - _NSS_BUFLEN_GROUP = 0x400 - _NSS_BUFLEN_PASSWD = 0x400 - _OPEN_MAX = 0x100 - _PTHREAD_KEYS_MAX = 0x400 - _PTHREAD_STACK_MIN = 0x20000 - _RE_DUP_MAX = 0x7fff - _RTSIG_MAX = 0x20 - _SEM_VALUE_MAX = 0x7fffffff - _STREAM_MAX = 0x10 - _SYMLOOP_MAX = -0x1 - _TTY_NAME_MAX = 0x20 - - _UIO_MAXIOV = 0x400 - - _INT_MAX = 0x7fffffff - - _POSIX_ADVISORY_INFO = 0x31069 - _POSIX_ARG_MAX = 0x1000 - _POSIX_ASYNCHRONOUS_IO = 0x31069 - _POSIX_BARRIERS = 0x31069 - _POSIX_CHILD_MAX = 0x19 - _POSIX_CLOCK_SELECTION = 0x31069 - _POSIX_CPUTIME = 0x0 - _POSIX_FSYNC = 0x31069 - _POSIX_IPV6 = 0x31069 - _POSIX_JOB_CONTROL = 0x1 - _POSIX_MAPPED_FILES = 0x31069 - _POSIX_MEMLOCK = 0x31069 - _POSIX_MEMLOCK_RANGE = 0x31069 - _POSIX_MEMORY_PROTECTION = 0x31069 - _POSIX_MESSAGE_PASSING = 0x31069 - _POSIX_MONOTONIC_CLOCK = 0x0 - _POSIX_PRIORITIZED_IO = 0x31069 - _POSIX_PRIORITY_SCHEDULING = 0x31069 - _POSIX_RAW_SOCKETS = 0x31069 - _POSIX_READER_WRITER_LOCKS = 0x31069 - _POSIX_REALTIME_SIGNALS = 0x31069 - _POSIX_REGEXP = 0x1 - _POSIX_SAVED_IDS = 0x1 - _POSIX_SEMAPHORES = 0x31069 - _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 - _POSIX_SHELL = 0x1 - _POSIX_SIGQUEUE_MAX = 0x20 - _POSIX_SPAWN = 0x31069 - _POSIX_SPIN_LOCKS = 0x31069 - _POSIX_SPORADIC_SERVER = -0x1 - _POSIX_SYNCHRONIZED_IO = 0x31069 - _POSIX_THREAD_ATTR_STACKADDR = 0x31069 - _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 - _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 - _POSIX_THREAD_PRIO_INHERIT = 0x31069 - _POSIX_THREAD_PRIO_PROTECT = 0x31069 - _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 - _POSIX_THREAD_PROCESS_SHARED = 0x31069 - _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 - _POSIX_THREAD_SPORADIC_SERVER = -0x1 - _POSIX_THREADS = 0x31069 - _POSIX_TIMEOUTS = 0x31069 - _POSIX_TIMERS = 0x31069 - _POSIX_TRACE = -0x1 - _POSIX_TRACE_EVENT_FILTER = -0x1 - _POSIX_TRACE_INHERIT = -0x1 - _POSIX_TRACE_LOG = -0x1 - _POSIX_TYPED_MEMORY_OBJECTS = -0x1 - _POSIX_VERSION = 0x31069 - - _POSIX_V7_ILP32_OFF32 = -0x1 - _POSIX_V7_ILP32_OFFBIG = -0x1 - _POSIX_V7_LP64_OFF64 = 0x1 - _POSIX_V7_LPBIG_OFFBIG = -0x1 - - _POSIX_V6_ILP32_OFF32 = -0x1 - _POSIX_V6_ILP32_OFFBIG = -0x1 - _POSIX_V6_LP64_OFF64 = 0x1 - _POSIX_V6_LPBIG_OFFBIG = -0x1 - - _POSIX2_C_BIND = 0x31069 - _POSIX2_C_DEV = 0x31069 - _POSIX2_C_VERSION = 0x31069 - _POSIX2_CHAR_TERM = 0x31069 - _POSIX2_LOCALEDEF = 0x31069 - _POSIX2_SW_DEV = 0x31069 - _POSIX2_VERSION = 0x31069 - - _XOPEN_ENH_I18N = 0x1 - _XOPEN_REALTIME = 0x1 - _XOPEN_REALTIME_THREADS = 0x1 - _XOPEN_SHM = 0x1 - _XOPEN_UNIX = 0x1 - _XOPEN_VERSION = 0x2bc - _XOPEN_XCU_VERSION = 0x4 -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips.go deleted file mode 100644 index a75d5f264f..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_values_linux.go - -package sysconf - -const ( - _AIO_PRIO_DELTA_MAX = 0x14 - _BC_BASE_MAX = 0x63 - _BC_DIM_MAX = 0x800 - _BC_SCALE_MAX = 0x63 - _BC_STRING_MAX = 0x3e8 - _COLL_WEIGHTS_MAX = 0xff - _DELAYTIMER_MAX = 0x7fffffff - _EXPR_NEST_MAX = 0x20 - _HOST_NAME_MAX = 0x40 - _LINE_MAX = 0x800 - _LOGIN_NAME_MAX = 0x100 - _MQ_PRIO_MAX = 0x8000 - _NGROUPS_MAX = 0x10000 - _NSS_BUFLEN_GROUP = 0x400 - _NSS_BUFLEN_PASSWD = 0x400 - _OPEN_MAX = 0x100 - _PTHREAD_KEYS_MAX = 0x400 - _PTHREAD_STACK_MIN = 0x20000 - _RE_DUP_MAX = 0x7fff - _RTSIG_MAX = 0x20 - _SEM_VALUE_MAX = 0x7fffffff - _STREAM_MAX = 0x10 - _SYMLOOP_MAX = -0x1 - _TTY_NAME_MAX = 0x20 - - _UIO_MAXIOV = 0x400 - - _INT_MAX = 0x7fffffff - - _POSIX_ADVISORY_INFO = 0x31069 - _POSIX_ARG_MAX = 0x1000 - _POSIX_ASYNCHRONOUS_IO = 0x31069 - _POSIX_BARRIERS = 0x31069 - _POSIX_CHILD_MAX = 0x19 - _POSIX_CLOCK_SELECTION = 0x31069 - _POSIX_CPUTIME = 0x0 - _POSIX_FSYNC = 0x31069 - _POSIX_IPV6 = 0x31069 - _POSIX_JOB_CONTROL = 0x1 - _POSIX_MAPPED_FILES = 0x31069 - _POSIX_MEMLOCK = 0x31069 - _POSIX_MEMLOCK_RANGE = 0x31069 - _POSIX_MEMORY_PROTECTION = 0x31069 - _POSIX_MESSAGE_PASSING = 0x31069 - _POSIX_MONOTONIC_CLOCK = 0x0 - _POSIX_PRIORITIZED_IO = 0x31069 - _POSIX_PRIORITY_SCHEDULING = 0x31069 - _POSIX_RAW_SOCKETS = 0x31069 - _POSIX_READER_WRITER_LOCKS = 0x31069 - _POSIX_REALTIME_SIGNALS = 0x31069 - _POSIX_REGEXP = 0x1 - _POSIX_SAVED_IDS = 0x1 - _POSIX_SEMAPHORES = 0x31069 - _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 - _POSIX_SHELL = 0x1 - _POSIX_SIGQUEUE_MAX = 0x20 - _POSIX_SPAWN = 0x31069 - _POSIX_SPIN_LOCKS = 0x31069 - _POSIX_SPORADIC_SERVER = -0x1 - _POSIX_SYNCHRONIZED_IO = 0x31069 - _POSIX_THREAD_ATTR_STACKADDR = 0x31069 - _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 - _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 - _POSIX_THREAD_PRIO_INHERIT = 0x31069 - _POSIX_THREAD_PRIO_PROTECT = 0x31069 - _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 - _POSIX_THREAD_PROCESS_SHARED = 0x31069 - _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 - _POSIX_THREAD_SPORADIC_SERVER = -0x1 - _POSIX_THREADS = 0x31069 - _POSIX_TIMEOUTS = 0x31069 - _POSIX_TIMERS = 0x31069 - _POSIX_TRACE = -0x1 - _POSIX_TRACE_EVENT_FILTER = -0x1 - _POSIX_TRACE_INHERIT = -0x1 - _POSIX_TRACE_LOG = -0x1 - _POSIX_TYPED_MEMORY_OBJECTS = -0x1 - _POSIX_VERSION = 0x31069 - - _POSIX_V7_ILP32_OFF32 = 0x1 - _POSIX_V7_ILP32_OFFBIG = 0x1 - _POSIX_V7_LP64_OFF64 = -0x1 - _POSIX_V7_LPBIG_OFFBIG = -0x1 - - _POSIX_V6_ILP32_OFF32 = 0x1 - _POSIX_V6_ILP32_OFFBIG = 0x1 - _POSIX_V6_LP64_OFF64 = -0x1 - _POSIX_V6_LPBIG_OFFBIG = -0x1 - - _POSIX2_C_BIND = 0x31069 - _POSIX2_C_DEV = 0x31069 - _POSIX2_C_VERSION = 0x31069 - _POSIX2_CHAR_TERM = 0x31069 - _POSIX2_LOCALEDEF = 0x31069 - _POSIX2_SW_DEV = 0x31069 - _POSIX2_VERSION = 0x31069 - - _XOPEN_ENH_I18N = 0x1 - _XOPEN_REALTIME = 0x1 - _XOPEN_REALTIME_THREADS = 0x1 - _XOPEN_SHM = 0x1 - _XOPEN_UNIX = 0x1 - _XOPEN_VERSION = 0x2bc - _XOPEN_XCU_VERSION = 0x4 -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips64.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips64.go deleted file mode 100644 index 7a6d9912cd..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips64.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_values_linux.go - -package sysconf - -const ( - _AIO_PRIO_DELTA_MAX = 0x14 - _BC_BASE_MAX = 0x63 - _BC_DIM_MAX = 0x800 - _BC_SCALE_MAX = 0x63 - _BC_STRING_MAX = 0x3e8 - _COLL_WEIGHTS_MAX = 0xff - _DELAYTIMER_MAX = 0x7fffffff - _EXPR_NEST_MAX = 0x20 - _HOST_NAME_MAX = 0x40 - _LINE_MAX = 0x800 - _LOGIN_NAME_MAX = 0x100 - _MQ_PRIO_MAX = 0x8000 - _NGROUPS_MAX = 0x10000 - _NSS_BUFLEN_GROUP = 0x400 - _NSS_BUFLEN_PASSWD = 0x400 - _OPEN_MAX = 0x100 - _PTHREAD_KEYS_MAX = 0x400 - _PTHREAD_STACK_MIN = 0x20000 - _RE_DUP_MAX = 0x7fff - _RTSIG_MAX = 0x20 - _SEM_VALUE_MAX = 0x7fffffff - _STREAM_MAX = 0x10 - _SYMLOOP_MAX = -0x1 - _TTY_NAME_MAX = 0x20 - - _UIO_MAXIOV = 0x400 - - _INT_MAX = 0x7fffffff - - _POSIX_ADVISORY_INFO = 0x31069 - _POSIX_ARG_MAX = 0x1000 - _POSIX_ASYNCHRONOUS_IO = 0x31069 - _POSIX_BARRIERS = 0x31069 - _POSIX_CHILD_MAX = 0x19 - _POSIX_CLOCK_SELECTION = 0x31069 - _POSIX_CPUTIME = 0x0 - _POSIX_FSYNC = 0x31069 - _POSIX_IPV6 = 0x31069 - _POSIX_JOB_CONTROL = 0x1 - _POSIX_MAPPED_FILES = 0x31069 - _POSIX_MEMLOCK = 0x31069 - _POSIX_MEMLOCK_RANGE = 0x31069 - _POSIX_MEMORY_PROTECTION = 0x31069 - _POSIX_MESSAGE_PASSING = 0x31069 - _POSIX_MONOTONIC_CLOCK = 0x0 - _POSIX_PRIORITIZED_IO = 0x31069 - _POSIX_PRIORITY_SCHEDULING = 0x31069 - _POSIX_RAW_SOCKETS = 0x31069 - _POSIX_READER_WRITER_LOCKS = 0x31069 - _POSIX_REALTIME_SIGNALS = 0x31069 - _POSIX_REGEXP = 0x1 - _POSIX_SAVED_IDS = 0x1 - _POSIX_SEMAPHORES = 0x31069 - _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 - _POSIX_SHELL = 0x1 - _POSIX_SIGQUEUE_MAX = 0x20 - _POSIX_SPAWN = 0x31069 - _POSIX_SPIN_LOCKS = 0x31069 - _POSIX_SPORADIC_SERVER = -0x1 - _POSIX_SYNCHRONIZED_IO = 0x31069 - _POSIX_THREAD_ATTR_STACKADDR = 0x31069 - _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 - _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 - _POSIX_THREAD_PRIO_INHERIT = 0x31069 - _POSIX_THREAD_PRIO_PROTECT = 0x31069 - _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 - _POSIX_THREAD_PROCESS_SHARED = 0x31069 - _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 - _POSIX_THREAD_SPORADIC_SERVER = -0x1 - _POSIX_THREADS = 0x31069 - _POSIX_TIMEOUTS = 0x31069 - _POSIX_TIMERS = 0x31069 - _POSIX_TRACE = -0x1 - _POSIX_TRACE_EVENT_FILTER = -0x1 - _POSIX_TRACE_INHERIT = -0x1 - _POSIX_TRACE_LOG = -0x1 - _POSIX_TYPED_MEMORY_OBJECTS = -0x1 - _POSIX_VERSION = 0x31069 - - _POSIX_V7_ILP32_OFF32 = -0x1 - _POSIX_V7_ILP32_OFFBIG = -0x1 - _POSIX_V7_LP64_OFF64 = 0x1 - _POSIX_V7_LPBIG_OFFBIG = -0x1 - - _POSIX_V6_ILP32_OFF32 = -0x1 - _POSIX_V6_ILP32_OFFBIG = -0x1 - _POSIX_V6_LP64_OFF64 = 0x1 - _POSIX_V6_LPBIG_OFFBIG = -0x1 - - _POSIX2_C_BIND = 0x31069 - _POSIX2_C_DEV = 0x31069 - _POSIX2_C_VERSION = 0x31069 - _POSIX2_CHAR_TERM = 0x31069 - _POSIX2_LOCALEDEF = 0x31069 - _POSIX2_SW_DEV = 0x31069 - _POSIX2_VERSION = 0x31069 - - _XOPEN_ENH_I18N = 0x1 - _XOPEN_REALTIME = 0x1 - _XOPEN_REALTIME_THREADS = 0x1 - _XOPEN_SHM = 0x1 - _XOPEN_UNIX = 0x1 - _XOPEN_VERSION = 0x2bc - _XOPEN_XCU_VERSION = 0x4 -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips64le.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips64le.go deleted file mode 100644 index 7a6d9912cd..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mips64le.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_values_linux.go - -package sysconf - -const ( - _AIO_PRIO_DELTA_MAX = 0x14 - _BC_BASE_MAX = 0x63 - _BC_DIM_MAX = 0x800 - _BC_SCALE_MAX = 0x63 - _BC_STRING_MAX = 0x3e8 - _COLL_WEIGHTS_MAX = 0xff - _DELAYTIMER_MAX = 0x7fffffff - _EXPR_NEST_MAX = 0x20 - _HOST_NAME_MAX = 0x40 - _LINE_MAX = 0x800 - _LOGIN_NAME_MAX = 0x100 - _MQ_PRIO_MAX = 0x8000 - _NGROUPS_MAX = 0x10000 - _NSS_BUFLEN_GROUP = 0x400 - _NSS_BUFLEN_PASSWD = 0x400 - _OPEN_MAX = 0x100 - _PTHREAD_KEYS_MAX = 0x400 - _PTHREAD_STACK_MIN = 0x20000 - _RE_DUP_MAX = 0x7fff - _RTSIG_MAX = 0x20 - _SEM_VALUE_MAX = 0x7fffffff - _STREAM_MAX = 0x10 - _SYMLOOP_MAX = -0x1 - _TTY_NAME_MAX = 0x20 - - _UIO_MAXIOV = 0x400 - - _INT_MAX = 0x7fffffff - - _POSIX_ADVISORY_INFO = 0x31069 - _POSIX_ARG_MAX = 0x1000 - _POSIX_ASYNCHRONOUS_IO = 0x31069 - _POSIX_BARRIERS = 0x31069 - _POSIX_CHILD_MAX = 0x19 - _POSIX_CLOCK_SELECTION = 0x31069 - _POSIX_CPUTIME = 0x0 - _POSIX_FSYNC = 0x31069 - _POSIX_IPV6 = 0x31069 - _POSIX_JOB_CONTROL = 0x1 - _POSIX_MAPPED_FILES = 0x31069 - _POSIX_MEMLOCK = 0x31069 - _POSIX_MEMLOCK_RANGE = 0x31069 - _POSIX_MEMORY_PROTECTION = 0x31069 - _POSIX_MESSAGE_PASSING = 0x31069 - _POSIX_MONOTONIC_CLOCK = 0x0 - _POSIX_PRIORITIZED_IO = 0x31069 - _POSIX_PRIORITY_SCHEDULING = 0x31069 - _POSIX_RAW_SOCKETS = 0x31069 - _POSIX_READER_WRITER_LOCKS = 0x31069 - _POSIX_REALTIME_SIGNALS = 0x31069 - _POSIX_REGEXP = 0x1 - _POSIX_SAVED_IDS = 0x1 - _POSIX_SEMAPHORES = 0x31069 - _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 - _POSIX_SHELL = 0x1 - _POSIX_SIGQUEUE_MAX = 0x20 - _POSIX_SPAWN = 0x31069 - _POSIX_SPIN_LOCKS = 0x31069 - _POSIX_SPORADIC_SERVER = -0x1 - _POSIX_SYNCHRONIZED_IO = 0x31069 - _POSIX_THREAD_ATTR_STACKADDR = 0x31069 - _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 - _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 - _POSIX_THREAD_PRIO_INHERIT = 0x31069 - _POSIX_THREAD_PRIO_PROTECT = 0x31069 - _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 - _POSIX_THREAD_PROCESS_SHARED = 0x31069 - _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 - _POSIX_THREAD_SPORADIC_SERVER = -0x1 - _POSIX_THREADS = 0x31069 - _POSIX_TIMEOUTS = 0x31069 - _POSIX_TIMERS = 0x31069 - _POSIX_TRACE = -0x1 - _POSIX_TRACE_EVENT_FILTER = -0x1 - _POSIX_TRACE_INHERIT = -0x1 - _POSIX_TRACE_LOG = -0x1 - _POSIX_TYPED_MEMORY_OBJECTS = -0x1 - _POSIX_VERSION = 0x31069 - - _POSIX_V7_ILP32_OFF32 = -0x1 - _POSIX_V7_ILP32_OFFBIG = -0x1 - _POSIX_V7_LP64_OFF64 = 0x1 - _POSIX_V7_LPBIG_OFFBIG = -0x1 - - _POSIX_V6_ILP32_OFF32 = -0x1 - _POSIX_V6_ILP32_OFFBIG = -0x1 - _POSIX_V6_LP64_OFF64 = 0x1 - _POSIX_V6_LPBIG_OFFBIG = -0x1 - - _POSIX2_C_BIND = 0x31069 - _POSIX2_C_DEV = 0x31069 - _POSIX2_C_VERSION = 0x31069 - _POSIX2_CHAR_TERM = 0x31069 - _POSIX2_LOCALEDEF = 0x31069 - _POSIX2_SW_DEV = 0x31069 - _POSIX2_VERSION = 0x31069 - - _XOPEN_ENH_I18N = 0x1 - _XOPEN_REALTIME = 0x1 - _XOPEN_REALTIME_THREADS = 0x1 - _XOPEN_SHM = 0x1 - _XOPEN_UNIX = 0x1 - _XOPEN_VERSION = 0x2bc - _XOPEN_XCU_VERSION = 0x4 -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mipsle.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mipsle.go deleted file mode 100644 index a75d5f264f..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_mipsle.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_values_linux.go - -package sysconf - -const ( - _AIO_PRIO_DELTA_MAX = 0x14 - _BC_BASE_MAX = 0x63 - _BC_DIM_MAX = 0x800 - _BC_SCALE_MAX = 0x63 - _BC_STRING_MAX = 0x3e8 - _COLL_WEIGHTS_MAX = 0xff - _DELAYTIMER_MAX = 0x7fffffff - _EXPR_NEST_MAX = 0x20 - _HOST_NAME_MAX = 0x40 - _LINE_MAX = 0x800 - _LOGIN_NAME_MAX = 0x100 - _MQ_PRIO_MAX = 0x8000 - _NGROUPS_MAX = 0x10000 - _NSS_BUFLEN_GROUP = 0x400 - _NSS_BUFLEN_PASSWD = 0x400 - _OPEN_MAX = 0x100 - _PTHREAD_KEYS_MAX = 0x400 - _PTHREAD_STACK_MIN = 0x20000 - _RE_DUP_MAX = 0x7fff - _RTSIG_MAX = 0x20 - _SEM_VALUE_MAX = 0x7fffffff - _STREAM_MAX = 0x10 - _SYMLOOP_MAX = -0x1 - _TTY_NAME_MAX = 0x20 - - _UIO_MAXIOV = 0x400 - - _INT_MAX = 0x7fffffff - - _POSIX_ADVISORY_INFO = 0x31069 - _POSIX_ARG_MAX = 0x1000 - _POSIX_ASYNCHRONOUS_IO = 0x31069 - _POSIX_BARRIERS = 0x31069 - _POSIX_CHILD_MAX = 0x19 - _POSIX_CLOCK_SELECTION = 0x31069 - _POSIX_CPUTIME = 0x0 - _POSIX_FSYNC = 0x31069 - _POSIX_IPV6 = 0x31069 - _POSIX_JOB_CONTROL = 0x1 - _POSIX_MAPPED_FILES = 0x31069 - _POSIX_MEMLOCK = 0x31069 - _POSIX_MEMLOCK_RANGE = 0x31069 - _POSIX_MEMORY_PROTECTION = 0x31069 - _POSIX_MESSAGE_PASSING = 0x31069 - _POSIX_MONOTONIC_CLOCK = 0x0 - _POSIX_PRIORITIZED_IO = 0x31069 - _POSIX_PRIORITY_SCHEDULING = 0x31069 - _POSIX_RAW_SOCKETS = 0x31069 - _POSIX_READER_WRITER_LOCKS = 0x31069 - _POSIX_REALTIME_SIGNALS = 0x31069 - _POSIX_REGEXP = 0x1 - _POSIX_SAVED_IDS = 0x1 - _POSIX_SEMAPHORES = 0x31069 - _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 - _POSIX_SHELL = 0x1 - _POSIX_SIGQUEUE_MAX = 0x20 - _POSIX_SPAWN = 0x31069 - _POSIX_SPIN_LOCKS = 0x31069 - _POSIX_SPORADIC_SERVER = -0x1 - _POSIX_SYNCHRONIZED_IO = 0x31069 - _POSIX_THREAD_ATTR_STACKADDR = 0x31069 - _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 - _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 - _POSIX_THREAD_PRIO_INHERIT = 0x31069 - _POSIX_THREAD_PRIO_PROTECT = 0x31069 - _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 - _POSIX_THREAD_PROCESS_SHARED = 0x31069 - _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 - _POSIX_THREAD_SPORADIC_SERVER = -0x1 - _POSIX_THREADS = 0x31069 - _POSIX_TIMEOUTS = 0x31069 - _POSIX_TIMERS = 0x31069 - _POSIX_TRACE = -0x1 - _POSIX_TRACE_EVENT_FILTER = -0x1 - _POSIX_TRACE_INHERIT = -0x1 - _POSIX_TRACE_LOG = -0x1 - _POSIX_TYPED_MEMORY_OBJECTS = -0x1 - _POSIX_VERSION = 0x31069 - - _POSIX_V7_ILP32_OFF32 = 0x1 - _POSIX_V7_ILP32_OFFBIG = 0x1 - _POSIX_V7_LP64_OFF64 = -0x1 - _POSIX_V7_LPBIG_OFFBIG = -0x1 - - _POSIX_V6_ILP32_OFF32 = 0x1 - _POSIX_V6_ILP32_OFFBIG = 0x1 - _POSIX_V6_LP64_OFF64 = -0x1 - _POSIX_V6_LPBIG_OFFBIG = -0x1 - - _POSIX2_C_BIND = 0x31069 - _POSIX2_C_DEV = 0x31069 - _POSIX2_C_VERSION = 0x31069 - _POSIX2_CHAR_TERM = 0x31069 - _POSIX2_LOCALEDEF = 0x31069 - _POSIX2_SW_DEV = 0x31069 - _POSIX2_VERSION = 0x31069 - - _XOPEN_ENH_I18N = 0x1 - _XOPEN_REALTIME = 0x1 - _XOPEN_REALTIME_THREADS = 0x1 - _XOPEN_SHM = 0x1 - _XOPEN_UNIX = 0x1 - _XOPEN_VERSION = 0x2bc - _XOPEN_XCU_VERSION = 0x4 -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_ppc64.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_ppc64.go deleted file mode 100644 index 7a6d9912cd..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_ppc64.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_values_linux.go - -package sysconf - -const ( - _AIO_PRIO_DELTA_MAX = 0x14 - _BC_BASE_MAX = 0x63 - _BC_DIM_MAX = 0x800 - _BC_SCALE_MAX = 0x63 - _BC_STRING_MAX = 0x3e8 - _COLL_WEIGHTS_MAX = 0xff - _DELAYTIMER_MAX = 0x7fffffff - _EXPR_NEST_MAX = 0x20 - _HOST_NAME_MAX = 0x40 - _LINE_MAX = 0x800 - _LOGIN_NAME_MAX = 0x100 - _MQ_PRIO_MAX = 0x8000 - _NGROUPS_MAX = 0x10000 - _NSS_BUFLEN_GROUP = 0x400 - _NSS_BUFLEN_PASSWD = 0x400 - _OPEN_MAX = 0x100 - _PTHREAD_KEYS_MAX = 0x400 - _PTHREAD_STACK_MIN = 0x20000 - _RE_DUP_MAX = 0x7fff - _RTSIG_MAX = 0x20 - _SEM_VALUE_MAX = 0x7fffffff - _STREAM_MAX = 0x10 - _SYMLOOP_MAX = -0x1 - _TTY_NAME_MAX = 0x20 - - _UIO_MAXIOV = 0x400 - - _INT_MAX = 0x7fffffff - - _POSIX_ADVISORY_INFO = 0x31069 - _POSIX_ARG_MAX = 0x1000 - _POSIX_ASYNCHRONOUS_IO = 0x31069 - _POSIX_BARRIERS = 0x31069 - _POSIX_CHILD_MAX = 0x19 - _POSIX_CLOCK_SELECTION = 0x31069 - _POSIX_CPUTIME = 0x0 - _POSIX_FSYNC = 0x31069 - _POSIX_IPV6 = 0x31069 - _POSIX_JOB_CONTROL = 0x1 - _POSIX_MAPPED_FILES = 0x31069 - _POSIX_MEMLOCK = 0x31069 - _POSIX_MEMLOCK_RANGE = 0x31069 - _POSIX_MEMORY_PROTECTION = 0x31069 - _POSIX_MESSAGE_PASSING = 0x31069 - _POSIX_MONOTONIC_CLOCK = 0x0 - _POSIX_PRIORITIZED_IO = 0x31069 - _POSIX_PRIORITY_SCHEDULING = 0x31069 - _POSIX_RAW_SOCKETS = 0x31069 - _POSIX_READER_WRITER_LOCKS = 0x31069 - _POSIX_REALTIME_SIGNALS = 0x31069 - _POSIX_REGEXP = 0x1 - _POSIX_SAVED_IDS = 0x1 - _POSIX_SEMAPHORES = 0x31069 - _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 - _POSIX_SHELL = 0x1 - _POSIX_SIGQUEUE_MAX = 0x20 - _POSIX_SPAWN = 0x31069 - _POSIX_SPIN_LOCKS = 0x31069 - _POSIX_SPORADIC_SERVER = -0x1 - _POSIX_SYNCHRONIZED_IO = 0x31069 - _POSIX_THREAD_ATTR_STACKADDR = 0x31069 - _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 - _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 - _POSIX_THREAD_PRIO_INHERIT = 0x31069 - _POSIX_THREAD_PRIO_PROTECT = 0x31069 - _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 - _POSIX_THREAD_PROCESS_SHARED = 0x31069 - _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 - _POSIX_THREAD_SPORADIC_SERVER = -0x1 - _POSIX_THREADS = 0x31069 - _POSIX_TIMEOUTS = 0x31069 - _POSIX_TIMERS = 0x31069 - _POSIX_TRACE = -0x1 - _POSIX_TRACE_EVENT_FILTER = -0x1 - _POSIX_TRACE_INHERIT = -0x1 - _POSIX_TRACE_LOG = -0x1 - _POSIX_TYPED_MEMORY_OBJECTS = -0x1 - _POSIX_VERSION = 0x31069 - - _POSIX_V7_ILP32_OFF32 = -0x1 - _POSIX_V7_ILP32_OFFBIG = -0x1 - _POSIX_V7_LP64_OFF64 = 0x1 - _POSIX_V7_LPBIG_OFFBIG = -0x1 - - _POSIX_V6_ILP32_OFF32 = -0x1 - _POSIX_V6_ILP32_OFFBIG = -0x1 - _POSIX_V6_LP64_OFF64 = 0x1 - _POSIX_V6_LPBIG_OFFBIG = -0x1 - - _POSIX2_C_BIND = 0x31069 - _POSIX2_C_DEV = 0x31069 - _POSIX2_C_VERSION = 0x31069 - _POSIX2_CHAR_TERM = 0x31069 - _POSIX2_LOCALEDEF = 0x31069 - _POSIX2_SW_DEV = 0x31069 - _POSIX2_VERSION = 0x31069 - - _XOPEN_ENH_I18N = 0x1 - _XOPEN_REALTIME = 0x1 - _XOPEN_REALTIME_THREADS = 0x1 - _XOPEN_SHM = 0x1 - _XOPEN_UNIX = 0x1 - _XOPEN_VERSION = 0x2bc - _XOPEN_XCU_VERSION = 0x4 -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_ppc64le.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_ppc64le.go deleted file mode 100644 index 7a6d9912cd..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_ppc64le.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_values_linux.go - -package sysconf - -const ( - _AIO_PRIO_DELTA_MAX = 0x14 - _BC_BASE_MAX = 0x63 - _BC_DIM_MAX = 0x800 - _BC_SCALE_MAX = 0x63 - _BC_STRING_MAX = 0x3e8 - _COLL_WEIGHTS_MAX = 0xff - _DELAYTIMER_MAX = 0x7fffffff - _EXPR_NEST_MAX = 0x20 - _HOST_NAME_MAX = 0x40 - _LINE_MAX = 0x800 - _LOGIN_NAME_MAX = 0x100 - _MQ_PRIO_MAX = 0x8000 - _NGROUPS_MAX = 0x10000 - _NSS_BUFLEN_GROUP = 0x400 - _NSS_BUFLEN_PASSWD = 0x400 - _OPEN_MAX = 0x100 - _PTHREAD_KEYS_MAX = 0x400 - _PTHREAD_STACK_MIN = 0x20000 - _RE_DUP_MAX = 0x7fff - _RTSIG_MAX = 0x20 - _SEM_VALUE_MAX = 0x7fffffff - _STREAM_MAX = 0x10 - _SYMLOOP_MAX = -0x1 - _TTY_NAME_MAX = 0x20 - - _UIO_MAXIOV = 0x400 - - _INT_MAX = 0x7fffffff - - _POSIX_ADVISORY_INFO = 0x31069 - _POSIX_ARG_MAX = 0x1000 - _POSIX_ASYNCHRONOUS_IO = 0x31069 - _POSIX_BARRIERS = 0x31069 - _POSIX_CHILD_MAX = 0x19 - _POSIX_CLOCK_SELECTION = 0x31069 - _POSIX_CPUTIME = 0x0 - _POSIX_FSYNC = 0x31069 - _POSIX_IPV6 = 0x31069 - _POSIX_JOB_CONTROL = 0x1 - _POSIX_MAPPED_FILES = 0x31069 - _POSIX_MEMLOCK = 0x31069 - _POSIX_MEMLOCK_RANGE = 0x31069 - _POSIX_MEMORY_PROTECTION = 0x31069 - _POSIX_MESSAGE_PASSING = 0x31069 - _POSIX_MONOTONIC_CLOCK = 0x0 - _POSIX_PRIORITIZED_IO = 0x31069 - _POSIX_PRIORITY_SCHEDULING = 0x31069 - _POSIX_RAW_SOCKETS = 0x31069 - _POSIX_READER_WRITER_LOCKS = 0x31069 - _POSIX_REALTIME_SIGNALS = 0x31069 - _POSIX_REGEXP = 0x1 - _POSIX_SAVED_IDS = 0x1 - _POSIX_SEMAPHORES = 0x31069 - _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 - _POSIX_SHELL = 0x1 - _POSIX_SIGQUEUE_MAX = 0x20 - _POSIX_SPAWN = 0x31069 - _POSIX_SPIN_LOCKS = 0x31069 - _POSIX_SPORADIC_SERVER = -0x1 - _POSIX_SYNCHRONIZED_IO = 0x31069 - _POSIX_THREAD_ATTR_STACKADDR = 0x31069 - _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 - _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 - _POSIX_THREAD_PRIO_INHERIT = 0x31069 - _POSIX_THREAD_PRIO_PROTECT = 0x31069 - _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 - _POSIX_THREAD_PROCESS_SHARED = 0x31069 - _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 - _POSIX_THREAD_SPORADIC_SERVER = -0x1 - _POSIX_THREADS = 0x31069 - _POSIX_TIMEOUTS = 0x31069 - _POSIX_TIMERS = 0x31069 - _POSIX_TRACE = -0x1 - _POSIX_TRACE_EVENT_FILTER = -0x1 - _POSIX_TRACE_INHERIT = -0x1 - _POSIX_TRACE_LOG = -0x1 - _POSIX_TYPED_MEMORY_OBJECTS = -0x1 - _POSIX_VERSION = 0x31069 - - _POSIX_V7_ILP32_OFF32 = -0x1 - _POSIX_V7_ILP32_OFFBIG = -0x1 - _POSIX_V7_LP64_OFF64 = 0x1 - _POSIX_V7_LPBIG_OFFBIG = -0x1 - - _POSIX_V6_ILP32_OFF32 = -0x1 - _POSIX_V6_ILP32_OFFBIG = -0x1 - _POSIX_V6_LP64_OFF64 = 0x1 - _POSIX_V6_LPBIG_OFFBIG = -0x1 - - _POSIX2_C_BIND = 0x31069 - _POSIX2_C_DEV = 0x31069 - _POSIX2_C_VERSION = 0x31069 - _POSIX2_CHAR_TERM = 0x31069 - _POSIX2_LOCALEDEF = 0x31069 - _POSIX2_SW_DEV = 0x31069 - _POSIX2_VERSION = 0x31069 - - _XOPEN_ENH_I18N = 0x1 - _XOPEN_REALTIME = 0x1 - _XOPEN_REALTIME_THREADS = 0x1 - _XOPEN_SHM = 0x1 - _XOPEN_UNIX = 0x1 - _XOPEN_VERSION = 0x2bc - _XOPEN_XCU_VERSION = 0x4 -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_riscv64.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_riscv64.go deleted file mode 100644 index 8d9c273d0b..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_riscv64.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_values_linux.go - -package sysconf - -const ( - _AIO_PRIO_DELTA_MAX = 0x14 - _BC_BASE_MAX = 0x63 - _BC_DIM_MAX = 0x800 - _BC_SCALE_MAX = 0x63 - _BC_STRING_MAX = 0x3e8 - _COLL_WEIGHTS_MAX = 0xff - _DELAYTIMER_MAX = 0x7fffffff - _EXPR_NEST_MAX = 0x20 - _HOST_NAME_MAX = 0x40 - _LINE_MAX = 0x800 - _LOGIN_NAME_MAX = 0x100 - _MQ_PRIO_MAX = 0x8000 - _NGROUPS_MAX = 0x10000 - _NSS_BUFLEN_GROUP = 0x400 - _NSS_BUFLEN_PASSWD = 0x400 - _OPEN_MAX = 0x100 - _PTHREAD_KEYS_MAX = 0x400 - _PTHREAD_STACK_MIN = 0x4000 - _RE_DUP_MAX = 0x7fff - _RTSIG_MAX = 0x20 - _SEM_VALUE_MAX = 0x7fffffff - _STREAM_MAX = 0x10 - _SYMLOOP_MAX = -0x1 - _TTY_NAME_MAX = 0x20 - - _UIO_MAXIOV = 0x400 - - _INT_MAX = 0x7fffffff - - _POSIX_ADVISORY_INFO = 0x31069 - _POSIX_ARG_MAX = 0x1000 - _POSIX_ASYNCHRONOUS_IO = 0x31069 - _POSIX_BARRIERS = 0x31069 - _POSIX_CHILD_MAX = 0x19 - _POSIX_CLOCK_SELECTION = 0x31069 - _POSIX_CPUTIME = 0x0 - _POSIX_FSYNC = 0x31069 - _POSIX_IPV6 = 0x31069 - _POSIX_JOB_CONTROL = 0x1 - _POSIX_MAPPED_FILES = 0x31069 - _POSIX_MEMLOCK = 0x31069 - _POSIX_MEMLOCK_RANGE = 0x31069 - _POSIX_MEMORY_PROTECTION = 0x31069 - _POSIX_MESSAGE_PASSING = 0x31069 - _POSIX_MONOTONIC_CLOCK = 0x0 - _POSIX_PRIORITIZED_IO = 0x31069 - _POSIX_PRIORITY_SCHEDULING = 0x31069 - _POSIX_RAW_SOCKETS = 0x31069 - _POSIX_READER_WRITER_LOCKS = 0x31069 - _POSIX_REALTIME_SIGNALS = 0x31069 - _POSIX_REGEXP = 0x1 - _POSIX_SAVED_IDS = 0x1 - _POSIX_SEMAPHORES = 0x31069 - _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 - _POSIX_SHELL = 0x1 - _POSIX_SIGQUEUE_MAX = 0x20 - _POSIX_SPAWN = 0x31069 - _POSIX_SPIN_LOCKS = 0x31069 - _POSIX_SPORADIC_SERVER = -0x1 - _POSIX_SYNCHRONIZED_IO = 0x31069 - _POSIX_THREAD_ATTR_STACKADDR = 0x31069 - _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 - _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 - _POSIX_THREAD_PRIO_INHERIT = 0x31069 - _POSIX_THREAD_PRIO_PROTECT = 0x31069 - _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 - _POSIX_THREAD_PROCESS_SHARED = 0x31069 - _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 - _POSIX_THREAD_SPORADIC_SERVER = -0x1 - _POSIX_THREADS = 0x31069 - _POSIX_TIMEOUTS = 0x31069 - _POSIX_TIMERS = 0x31069 - _POSIX_TRACE = -0x1 - _POSIX_TRACE_EVENT_FILTER = -0x1 - _POSIX_TRACE_INHERIT = -0x1 - _POSIX_TRACE_LOG = -0x1 - _POSIX_TYPED_MEMORY_OBJECTS = -0x1 - _POSIX_VERSION = 0x31069 - - _POSIX_V7_ILP32_OFF32 = -0x1 - _POSIX_V7_ILP32_OFFBIG = -0x1 - _POSIX_V7_LP64_OFF64 = 0x1 - _POSIX_V7_LPBIG_OFFBIG = -0x1 - - _POSIX_V6_ILP32_OFF32 = -0x1 - _POSIX_V6_ILP32_OFFBIG = -0x1 - _POSIX_V6_LP64_OFF64 = 0x1 - _POSIX_V6_LPBIG_OFFBIG = -0x1 - - _POSIX2_C_BIND = 0x31069 - _POSIX2_C_DEV = 0x31069 - _POSIX2_C_VERSION = 0x31069 - _POSIX2_CHAR_TERM = 0x31069 - _POSIX2_LOCALEDEF = 0x31069 - _POSIX2_SW_DEV = 0x31069 - _POSIX2_VERSION = 0x31069 - - _XOPEN_ENH_I18N = 0x1 - _XOPEN_REALTIME = 0x1 - _XOPEN_REALTIME_THREADS = 0x1 - _XOPEN_SHM = 0x1 - _XOPEN_UNIX = 0x1 - _XOPEN_VERSION = 0x2bc - _XOPEN_XCU_VERSION = 0x4 -) diff --git a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_s390x.go b/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_s390x.go deleted file mode 100644 index 8d9c273d0b..0000000000 --- a/vendor/github.com/tklauser/go-sysconf/zsysconf_values_linux_s390x.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs sysconf_values_linux.go - -package sysconf - -const ( - _AIO_PRIO_DELTA_MAX = 0x14 - _BC_BASE_MAX = 0x63 - _BC_DIM_MAX = 0x800 - _BC_SCALE_MAX = 0x63 - _BC_STRING_MAX = 0x3e8 - _COLL_WEIGHTS_MAX = 0xff - _DELAYTIMER_MAX = 0x7fffffff - _EXPR_NEST_MAX = 0x20 - _HOST_NAME_MAX = 0x40 - _LINE_MAX = 0x800 - _LOGIN_NAME_MAX = 0x100 - _MQ_PRIO_MAX = 0x8000 - _NGROUPS_MAX = 0x10000 - _NSS_BUFLEN_GROUP = 0x400 - _NSS_BUFLEN_PASSWD = 0x400 - _OPEN_MAX = 0x100 - _PTHREAD_KEYS_MAX = 0x400 - _PTHREAD_STACK_MIN = 0x4000 - _RE_DUP_MAX = 0x7fff - _RTSIG_MAX = 0x20 - _SEM_VALUE_MAX = 0x7fffffff - _STREAM_MAX = 0x10 - _SYMLOOP_MAX = -0x1 - _TTY_NAME_MAX = 0x20 - - _UIO_MAXIOV = 0x400 - - _INT_MAX = 0x7fffffff - - _POSIX_ADVISORY_INFO = 0x31069 - _POSIX_ARG_MAX = 0x1000 - _POSIX_ASYNCHRONOUS_IO = 0x31069 - _POSIX_BARRIERS = 0x31069 - _POSIX_CHILD_MAX = 0x19 - _POSIX_CLOCK_SELECTION = 0x31069 - _POSIX_CPUTIME = 0x0 - _POSIX_FSYNC = 0x31069 - _POSIX_IPV6 = 0x31069 - _POSIX_JOB_CONTROL = 0x1 - _POSIX_MAPPED_FILES = 0x31069 - _POSIX_MEMLOCK = 0x31069 - _POSIX_MEMLOCK_RANGE = 0x31069 - _POSIX_MEMORY_PROTECTION = 0x31069 - _POSIX_MESSAGE_PASSING = 0x31069 - _POSIX_MONOTONIC_CLOCK = 0x0 - _POSIX_PRIORITIZED_IO = 0x31069 - _POSIX_PRIORITY_SCHEDULING = 0x31069 - _POSIX_RAW_SOCKETS = 0x31069 - _POSIX_READER_WRITER_LOCKS = 0x31069 - _POSIX_REALTIME_SIGNALS = 0x31069 - _POSIX_REGEXP = 0x1 - _POSIX_SAVED_IDS = 0x1 - _POSIX_SEMAPHORES = 0x31069 - _POSIX_SHARED_MEMORY_OBJECTS = 0x31069 - _POSIX_SHELL = 0x1 - _POSIX_SIGQUEUE_MAX = 0x20 - _POSIX_SPAWN = 0x31069 - _POSIX_SPIN_LOCKS = 0x31069 - _POSIX_SPORADIC_SERVER = -0x1 - _POSIX_SYNCHRONIZED_IO = 0x31069 - _POSIX_THREAD_ATTR_STACKADDR = 0x31069 - _POSIX_THREAD_ATTR_STACKSIZE = 0x31069 - _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 0x4 - _POSIX_THREAD_PRIO_INHERIT = 0x31069 - _POSIX_THREAD_PRIO_PROTECT = 0x31069 - _POSIX_THREAD_PRIORITY_SCHEDULING = 0x31069 - _POSIX_THREAD_PROCESS_SHARED = 0x31069 - _POSIX_THREAD_SAFE_FUNCTIONS = 0x31069 - _POSIX_THREAD_SPORADIC_SERVER = -0x1 - _POSIX_THREADS = 0x31069 - _POSIX_TIMEOUTS = 0x31069 - _POSIX_TIMERS = 0x31069 - _POSIX_TRACE = -0x1 - _POSIX_TRACE_EVENT_FILTER = -0x1 - _POSIX_TRACE_INHERIT = -0x1 - _POSIX_TRACE_LOG = -0x1 - _POSIX_TYPED_MEMORY_OBJECTS = -0x1 - _POSIX_VERSION = 0x31069 - - _POSIX_V7_ILP32_OFF32 = -0x1 - _POSIX_V7_ILP32_OFFBIG = -0x1 - _POSIX_V7_LP64_OFF64 = 0x1 - _POSIX_V7_LPBIG_OFFBIG = -0x1 - - _POSIX_V6_ILP32_OFF32 = -0x1 - _POSIX_V6_ILP32_OFFBIG = -0x1 - _POSIX_V6_LP64_OFF64 = 0x1 - _POSIX_V6_LPBIG_OFFBIG = -0x1 - - _POSIX2_C_BIND = 0x31069 - _POSIX2_C_DEV = 0x31069 - _POSIX2_C_VERSION = 0x31069 - _POSIX2_CHAR_TERM = 0x31069 - _POSIX2_LOCALEDEF = 0x31069 - _POSIX2_SW_DEV = 0x31069 - _POSIX2_VERSION = 0x31069 - - _XOPEN_ENH_I18N = 0x1 - _XOPEN_REALTIME = 0x1 - _XOPEN_REALTIME_THREADS = 0x1 - _XOPEN_SHM = 0x1 - _XOPEN_UNIX = 0x1 - _XOPEN_VERSION = 0x2bc - _XOPEN_XCU_VERSION = 0x4 -) diff --git a/vendor/github.com/tklauser/numcpus/.cirrus.yml b/vendor/github.com/tklauser/numcpus/.cirrus.yml deleted file mode 100644 index 22ac7a6539..0000000000 --- a/vendor/github.com/tklauser/numcpus/.cirrus.yml +++ /dev/null @@ -1,12 +0,0 @@ -env: - CIRRUS_CLONE_DEPTH: 1 - -freebsd_12_task: - freebsd_instance: - image_family: freebsd-12-2 - install_script: | - pkg install -y git go - GOBIN=$PWD/bin go get golang.org/dl/go1.16.2 - bin/go1.16.2 download - build_script: bin/go1.16.2 build -v ./... - test_script: bin/go1.16.2 test -race ./... diff --git a/vendor/github.com/tklauser/numcpus/LICENSE b/vendor/github.com/tklauser/numcpus/LICENSE deleted file mode 100644 index a2e486a803..0000000000 --- a/vendor/github.com/tklauser/numcpus/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} Authors of Cilium - - 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. - diff --git a/vendor/github.com/tklauser/numcpus/README.md b/vendor/github.com/tklauser/numcpus/README.md deleted file mode 100644 index 25db2bc93d..0000000000 --- a/vendor/github.com/tklauser/numcpus/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# numcpus - -[![Go Reference](https://pkg.go.dev/badge/github.com/tklauser/numcpus.svg)](https://pkg.go.dev/github.com/tklauser/numcpus) -[![GitHub Action Status](https://github.com/tklauser/numcpus/workflows/Tests/badge.svg)](https://github.com/tklauser/numcpus/actions?query=workflow%3ATests) -[![Go Report Card](https://goreportcard.com/badge/github.com/tklauser/numcpus)](https://goreportcard.com/report/github.com/tklauser/numcpus) - -Package numcpus provides information about the number of CPU. - -It gets the number of CPUs (online, offline, present, possible or kernel -maximum) on a Linux, Darwin, FreeBSD, NetBSD, OpenBSD, DragonflyBSD or -Solaris/Illumos system. - -On Linux, the information is retrieved by reading the corresponding CPU -topology files in `/sys/devices/system/cpu`. - -Not all functions are supported on Darwin, FreeBSD, NetBSD, OpenBSD, -DragonflyBSD and Solaris/Illumos. - -## Usage - -```Go -package main - -import ( - "fmt" - "os" - - "github.com/tklauser/numcpus" -) - -func main() { - online, err := numcpus.GetOnline() - if err != nil { - fmt.Fprintf(os.Stderr, "GetOnline: %v\n", err) - } - fmt.Printf("online CPUs: %v\n", online) - - possible, err := numcpus.GetPossible() - if err != nil { - fmt.Fprintf(os.Stderr, "GetPossible: %v\n", err) - } - fmt.Printf("possible CPUs: %v\n", possible) -} -``` - -## References - -* [Linux kernel sysfs documenation for CPU attributes](https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-devices-system-cpu) -* [Linux kernel CPU topology documentation](https://www.kernel.org/doc/Documentation/cputopology.txt) diff --git a/vendor/github.com/tklauser/numcpus/go.mod b/vendor/github.com/tklauser/numcpus/go.mod deleted file mode 100644 index ad88289c2b..0000000000 --- a/vendor/github.com/tklauser/numcpus/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/tklauser/numcpus - -go 1.11 - -require golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa diff --git a/vendor/github.com/tklauser/numcpus/go.sum b/vendor/github.com/tklauser/numcpus/go.sum deleted file mode 100644 index 435cbb6b56..0000000000 --- a/vendor/github.com/tklauser/numcpus/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa h1:ZYxPR6aca/uhfRJyaOAtflSHjJYiktO7QnJC5ut7iY4= -golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/tklauser/numcpus/numcpus.go b/vendor/github.com/tklauser/numcpus/numcpus.go deleted file mode 100644 index 1023e40fdb..0000000000 --- a/vendor/github.com/tklauser/numcpus/numcpus.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2018 Tobias Klauser -// -// 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 numcpus provides information about the number of CPU. -// -// It gets the number of CPUs (online, offline, present, possible or kernel -// maximum) on a Linux, Darwin, FreeBSD, NetBSD, OpenBSD or DragonflyBSD -// system. -// -// On Linux, the information is retrieved by reading the corresponding CPU -// topology files in /sys/devices/system/cpu. -// -// Not all functions are supported on Darwin, FreeBSD, NetBSD, OpenBSD and -// DragonflyBSD. -package numcpus - -import "errors" - -// ErrNotSupported is the error returned when the function is not supported. -var ErrNotSupported = errors.New("function not supported") - -// GetKernelMax returns the maximum number of CPUs allowed by the kernel -// configuration. This function is only supported on Linux systems. -func GetKernelMax() (int, error) { - return getKernelMax() -} - -// GetOffline returns the number of offline CPUs, i.e. CPUs that are not online -// because they have been hotplugged off or exceed the limit of CPUs allowed by -// the kernel configuration (see GetKernelMax). This function is only supported -// on Linux systems. -func GetOffline() (int, error) { - return getOffline() -} - -// GetOnline returns the number of CPUs that are online and being scheduled. -func GetOnline() (int, error) { - return getOnline() -} - -// GetPossible returns the number of possible CPUs, i.e. CPUs that -// have been allocated resources and can be brought online if they are present. -func GetPossible() (int, error) { - return getPossible() -} - -// GetPresent returns the number of CPUs present in the system. -func GetPresent() (int, error) { - return getPresent() -} diff --git a/vendor/github.com/tklauser/numcpus/numcpus_bsd.go b/vendor/github.com/tklauser/numcpus/numcpus_bsd.go deleted file mode 100644 index d88c6cb987..0000000000 --- a/vendor/github.com/tklauser/numcpus/numcpus_bsd.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2018 Tobias Klauser -// -// 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. - -//go:build darwin || dragonfly || freebsd || netbsd || openbsd -// +build darwin dragonfly freebsd netbsd openbsd - -package numcpus - -import ( - "runtime" - - "golang.org/x/sys/unix" -) - -func getKernelMax() (int, error) { - return 0, ErrNotSupported -} - -func getOffline() (int, error) { - return 0, ErrNotSupported -} - -func getOnline() (int, error) { - var n uint32 - var err error - switch runtime.GOOS { - case "netbsd", "openbsd": - n, err = unix.SysctlUint32("hw.ncpuonline") - if err != nil || n < 0 { - n, err = unix.SysctlUint32("hw.ncpu") - } - default: - n, err = unix.SysctlUint32("hw.ncpu") - } - return int(n), err -} - -func getPossible() (int, error) { - n, err := unix.SysctlUint32("hw.ncpu") - return int(n), err -} - -func getPresent() (int, error) { - n, err := unix.SysctlUint32("hw.ncpu") - return int(n), err -} diff --git a/vendor/github.com/tklauser/numcpus/numcpus_linux.go b/vendor/github.com/tklauser/numcpus/numcpus_linux.go deleted file mode 100644 index 554d2bf9ea..0000000000 --- a/vendor/github.com/tklauser/numcpus/numcpus_linux.go +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2018 Tobias Klauser -// -// 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 numcpus - -import ( - "io/ioutil" - "path/filepath" - "strconv" - "strings" -) - -const sysfsCPUBasePath = "/sys/devices/system/cpu" - -func readCPURange(file string) (int, error) { - buf, err := ioutil.ReadFile(filepath.Join(sysfsCPUBasePath, file)) - if err != nil { - return 0, err - } - return parseCPURange(strings.Trim(string(buf), "\n ")) -} - -func parseCPURange(cpus string) (int, error) { - n := int(0) - for _, cpuRange := range strings.Split(cpus, ",") { - if len(cpuRange) == 0 { - continue - } - rangeOp := strings.SplitN(cpuRange, "-", 2) - first, err := strconv.ParseUint(rangeOp[0], 10, 32) - if err != nil { - return 0, err - } - if len(rangeOp) == 1 { - n++ - continue - } - last, err := strconv.ParseUint(rangeOp[1], 10, 32) - if err != nil { - return 0, err - } - n += int(last - first + 1) - } - return n, nil -} - -func getKernelMax() (int, error) { - buf, err := ioutil.ReadFile(filepath.Join(sysfsCPUBasePath, "kernel_max")) - if err != nil { - return 0, err - } - n, err := strconv.ParseInt(strings.Trim(string(buf), "\n "), 10, 32) - if err != nil { - return 0, err - } - return int(n), nil -} - -func getOffline() (int, error) { - return readCPURange("offline") -} - -func getOnline() (int, error) { - return readCPURange("online") -} - -func getPossible() (int, error) { - return readCPURange("possible") -} - -func getPresent() (int, error) { - return readCPURange("present") -} diff --git a/vendor/github.com/tklauser/numcpus/numcpus_solaris.go b/vendor/github.com/tklauser/numcpus/numcpus_solaris.go deleted file mode 100644 index 92c7d776b8..0000000000 --- a/vendor/github.com/tklauser/numcpus/numcpus_solaris.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2021 Tobias Klauser -// -// 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. - -//go:build solaris -// +build solaris - -package numcpus - -import "golang.org/x/sys/unix" - -// taken from /usr/include/sys/unistd.h -const ( - _SC_NPROCESSORS_CONF = 14 - _SC_NPROCESSORS_ONLN = 15 - _SC_NPROCESSORS_MAX = 516 -) - -func getKernelMax() (int, error) { - n, err := unix.Sysconf(_SC_NPROCESSORS_MAX) - return int(n), err -} - -func getOffline() (int, error) { - return 0, ErrNotSupported -} - -func getOnline() (int, error) { - n, err := unix.Sysconf(_SC_NPROCESSORS_ONLN) - return int(n), err -} - -func getPossible() (int, error) { - n, err := unix.Sysconf(_SC_NPROCESSORS_CONF) - return int(n), err -} - -func getPresent() (int, error) { - n, err := unix.Sysconf(_SC_NPROCESSORS_CONF) - return int(n), err -} diff --git a/vendor/github.com/tklauser/numcpus/numcpus_unsupported.go b/vendor/github.com/tklauser/numcpus/numcpus_unsupported.go deleted file mode 100644 index 1bec9d7ea4..0000000000 --- a/vendor/github.com/tklauser/numcpus/numcpus_unsupported.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2021 Tobias Klauser -// -// 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. - -//go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris -// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris - -package numcpus - -func getKernelMax() (int, error) { - return 0, ErrNotSupported -} - -func getOffline() (int, error) { - return 0, ErrNotSupported -} - -func getOnline() (int, error) { - return 0, ErrNotSupported -} - -func getPossible() (int, error) { - return 0, ErrNotSupported -} - -func getPresent() (int, error) { - return 0, ErrNotSupported -} diff --git a/vendor/github.com/ulikunitz/xz/LICENSE b/vendor/github.com/ulikunitz/xz/LICENSE index d32149979d..58ebdc162f 100644 --- a/vendor/github.com/ulikunitz/xz/LICENSE +++ b/vendor/github.com/ulikunitz/xz/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014-2020 Ulrich Kunitz +Copyright (c) 2014-2016 Ulrich Kunitz All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/vendor/github.com/ulikunitz/xz/TODO.md b/vendor/github.com/ulikunitz/xz/TODO.md index a4224ce142..1be3bb845b 100644 --- a/vendor/github.com/ulikunitz/xz/TODO.md +++ b/vendor/github.com/ulikunitz/xz/TODO.md @@ -1,9 +1,5 @@ # TODO list -## Release v0.5.x - -1. Support check flag in gxz command. - ## Release v0.6 1. Review encoder and check for lzma improvements under xz. @@ -90,11 +86,6 @@ ## Log -### 2020-02-24 - -Release v0.5.7 supports the check-ID None and fixes -[issue #27](https://github.com/ulikunitz/xz/issues/27). - ### 2019-02-20 Release v0.5.6 supports the go.mod file. diff --git a/vendor/github.com/ulikunitz/xz/bits.go b/vendor/github.com/ulikunitz/xz/bits.go index 364213dd94..fadc1a5944 100644 --- a/vendor/github.com/ulikunitz/xz/bits.go +++ b/vendor/github.com/ulikunitz/xz/bits.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/crc.go b/vendor/github.com/ulikunitz/xz/crc.go index 638774ada6..b44dca96e8 100644 --- a/vendor/github.com/ulikunitz/xz/crc.go +++ b/vendor/github.com/ulikunitz/xz/crc.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/format.go b/vendor/github.com/ulikunitz/xz/format.go index edfec9a94a..798159c6c6 100644 --- a/vendor/github.com/ulikunitz/xz/format.go +++ b/vendor/github.com/ulikunitz/xz/format.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -46,8 +46,7 @@ const HeaderLen = 12 // Constants for the checksum methods supported by xz. const ( - None byte = 0x0 - CRC32 = 0x1 + CRC32 byte = 0x1 CRC64 = 0x4 SHA256 = 0xa ) @@ -59,7 +58,7 @@ var errInvalidFlags = errors.New("xz: invalid flags") // invalid. func verifyFlags(flags byte) error { switch flags { - case None, CRC32, CRC64, SHA256: + case CRC32, CRC64, SHA256: return nil default: return errInvalidFlags @@ -68,7 +67,6 @@ func verifyFlags(flags byte) error { // flagstrings maps flag values to strings. var flagstrings = map[byte]string{ - None: "None", CRC32: "CRC-32", CRC64: "CRC-64", SHA256: "SHA-256", @@ -87,8 +85,6 @@ func flagString(flags byte) string { // hash method encoded in flags. func newHashFunc(flags byte) (newHash func() hash.Hash, err error) { switch flags { - case None: - newHash = newNoneHash case CRC32: newHash = newCRC32 case CRC64: diff --git a/vendor/github.com/ulikunitz/xz/fox-check-none.xz b/vendor/github.com/ulikunitz/xz/fox-check-none.xz deleted file mode 100644 index 46043f7dc89b610dc3badb9db3426620c4c97462..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 96 zcmexsUKJ6=z`*cd=%ynRgCe6CkX@qxbTK1?PDnLRM*R tL9s%9S!$6&2~avGv8qxbB|lw{3#g5Ofzej?!NQIFY(?{`7{LOOQ2>-O93KDx diff --git a/vendor/github.com/ulikunitz/xz/go.mod b/vendor/github.com/ulikunitz/xz/go.mod index 330b675bd7..9e5eea2c98 100644 --- a/vendor/github.com/ulikunitz/xz/go.mod +++ b/vendor/github.com/ulikunitz/xz/go.mod @@ -1,3 +1 @@ module github.com/ulikunitz/xz - -go 1.12 diff --git a/vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go b/vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go index f2861ba3f7..a32887872e 100644 --- a/vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go +++ b/vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/internal/hash/doc.go b/vendor/github.com/ulikunitz/xz/internal/hash/doc.go index e28d23be47..f99ec22068 100644 --- a/vendor/github.com/ulikunitz/xz/internal/hash/doc.go +++ b/vendor/github.com/ulikunitz/xz/internal/hash/doc.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go b/vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go index b8e66d9721..58635b113a 100644 --- a/vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go +++ b/vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/internal/hash/roller.go b/vendor/github.com/ulikunitz/xz/internal/hash/roller.go index 34c81b38a7..ab6a19ca4c 100644 --- a/vendor/github.com/ulikunitz/xz/internal/hash/roller.go +++ b/vendor/github.com/ulikunitz/xz/internal/hash/roller.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go b/vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go index 678b5a0589..0ba45e8ff3 100644 --- a/vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go +++ b/vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/bintree.go b/vendor/github.com/ulikunitz/xz/lzma/bintree.go index 58d6a92a72..a781bd1953 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/bintree.go +++ b/vendor/github.com/ulikunitz/xz/lzma/bintree.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/bitops.go b/vendor/github.com/ulikunitz/xz/lzma/bitops.go index 2784ec6ba0..e9bab01990 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/bitops.go +++ b/vendor/github.com/ulikunitz/xz/lzma/bitops.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/breader.go b/vendor/github.com/ulikunitz/xz/lzma/breader.go index 4ad09a14e7..5350d814fa 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/breader.go +++ b/vendor/github.com/ulikunitz/xz/lzma/breader.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/buffer.go b/vendor/github.com/ulikunitz/xz/lzma/buffer.go index 9cb7838acb..50e0b6d57b 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/buffer.go +++ b/vendor/github.com/ulikunitz/xz/lzma/buffer.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/bytewriter.go b/vendor/github.com/ulikunitz/xz/lzma/bytewriter.go index 290606ddcc..a3696ba08b 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/bytewriter.go +++ b/vendor/github.com/ulikunitz/xz/lzma/bytewriter.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/decoder.go b/vendor/github.com/ulikunitz/xz/lzma/decoder.go index e5a760a50b..16e14db394 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/decoder.go +++ b/vendor/github.com/ulikunitz/xz/lzma/decoder.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/decoderdict.go b/vendor/github.com/ulikunitz/xz/lzma/decoderdict.go index ba06712b03..564a12b834 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/decoderdict.go +++ b/vendor/github.com/ulikunitz/xz/lzma/decoderdict.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/directcodec.go b/vendor/github.com/ulikunitz/xz/lzma/directcodec.go index e6e0c6ddf3..e08eb989ff 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/directcodec.go +++ b/vendor/github.com/ulikunitz/xz/lzma/directcodec.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/distcodec.go b/vendor/github.com/ulikunitz/xz/lzma/distcodec.go index 69871c04ad..b053a2dce2 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/distcodec.go +++ b/vendor/github.com/ulikunitz/xz/lzma/distcodec.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/encoder.go b/vendor/github.com/ulikunitz/xz/lzma/encoder.go index 59055eb64c..fe1900a66e 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/encoder.go +++ b/vendor/github.com/ulikunitz/xz/lzma/encoder.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/encoderdict.go b/vendor/github.com/ulikunitz/xz/lzma/encoderdict.go index 40f3d3f64a..9d0fbc7033 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/encoderdict.go +++ b/vendor/github.com/ulikunitz/xz/lzma/encoderdict.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/hashtable.go b/vendor/github.com/ulikunitz/xz/lzma/hashtable.go index e82970eac2..d786a9745d 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/hashtable.go +++ b/vendor/github.com/ulikunitz/xz/lzma/hashtable.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/header.go b/vendor/github.com/ulikunitz/xz/lzma/header.go index cda39462ce..bc708969fd 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/header.go +++ b/vendor/github.com/ulikunitz/xz/lzma/header.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/header2.go b/vendor/github.com/ulikunitz/xz/lzma/header2.go index cd148812cd..ac6a71a5a9 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/header2.go +++ b/vendor/github.com/ulikunitz/xz/lzma/header2.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go b/vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go index 927395bd80..e517730924 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go +++ b/vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/literalcodec.go b/vendor/github.com/ulikunitz/xz/lzma/literalcodec.go index ca31530fd5..c949d6ebd1 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/literalcodec.go +++ b/vendor/github.com/ulikunitz/xz/lzma/literalcodec.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go b/vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go index 7d03ec0dc5..4a244eb1ac 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go +++ b/vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/operation.go b/vendor/github.com/ulikunitz/xz/lzma/operation.go index a75c9b46c5..733bb99da4 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/operation.go +++ b/vendor/github.com/ulikunitz/xz/lzma/operation.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/prob.go b/vendor/github.com/ulikunitz/xz/lzma/prob.go index 6987a166f0..24d50ec681 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/prob.go +++ b/vendor/github.com/ulikunitz/xz/lzma/prob.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/properties.go b/vendor/github.com/ulikunitz/xz/lzma/properties.go index 662feba872..23418e25d2 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/properties.go +++ b/vendor/github.com/ulikunitz/xz/lzma/properties.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/rangecodec.go b/vendor/github.com/ulikunitz/xz/lzma/rangecodec.go index 7189a03776..6361c5e7c8 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/rangecodec.go +++ b/vendor/github.com/ulikunitz/xz/lzma/rangecodec.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/reader.go b/vendor/github.com/ulikunitz/xz/lzma/reader.go index 7b7eef31f8..2ef3dcaaa9 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/reader.go +++ b/vendor/github.com/ulikunitz/xz/lzma/reader.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/reader2.go b/vendor/github.com/ulikunitz/xz/lzma/reader2.go index 33074e6242..a55cfaa4e3 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/reader2.go +++ b/vendor/github.com/ulikunitz/xz/lzma/reader2.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/state.go b/vendor/github.com/ulikunitz/xz/lzma/state.go index 03f061cf10..502351052f 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/state.go +++ b/vendor/github.com/ulikunitz/xz/lzma/state.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/treecodecs.go b/vendor/github.com/ulikunitz/xz/lzma/treecodecs.go index 1cb3596fe1..504b3d78e4 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/treecodecs.go +++ b/vendor/github.com/ulikunitz/xz/lzma/treecodecs.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/writer.go b/vendor/github.com/ulikunitz/xz/lzma/writer.go index 5803ecca96..efe34fb6bf 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/writer.go +++ b/vendor/github.com/ulikunitz/xz/lzma/writer.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzma/writer2.go b/vendor/github.com/ulikunitz/xz/lzma/writer2.go index c263b0666a..7c1afe1572 100644 --- a/vendor/github.com/ulikunitz/xz/lzma/writer2.go +++ b/vendor/github.com/ulikunitz/xz/lzma/writer2.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/lzmafilter.go b/vendor/github.com/ulikunitz/xz/lzmafilter.go index 6f4aa2c09c..69cf5f7c27 100644 --- a/vendor/github.com/ulikunitz/xz/lzmafilter.go +++ b/vendor/github.com/ulikunitz/xz/lzmafilter.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/vendor/github.com/ulikunitz/xz/none-check.go b/vendor/github.com/ulikunitz/xz/none-check.go deleted file mode 100644 index e12d8e476b..0000000000 --- a/vendor/github.com/ulikunitz/xz/none-check.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xz - -import "hash" - -type noneHash struct{} - -func (h noneHash) Write(p []byte) (n int, err error) { return len(p), nil } - -func (h noneHash) Sum(b []byte) []byte { return b } - -func (h noneHash) Reset() {} - -func (h noneHash) Size() int { return 0 } - -func (h noneHash) BlockSize() int { return 0 } - -func newNoneHash() hash.Hash { - return &noneHash{} -} diff --git a/vendor/github.com/ulikunitz/xz/reader.go b/vendor/github.com/ulikunitz/xz/reader.go index 22cd6d5007..0634c6bcc0 100644 --- a/vendor/github.com/ulikunitz/xz/reader.go +++ b/vendor/github.com/ulikunitz/xz/reader.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -283,11 +283,7 @@ func (c *ReaderConfig) newBlockReader(xz io.Reader, h *blockHeader, if err != nil { return nil, err } - if br.hash.Size() != 0 { - br.r = io.TeeReader(fr, br.hash) - } else { - br.r = fr - } + br.r = io.TeeReader(fr, br.hash) return br, nil } diff --git a/vendor/github.com/ulikunitz/xz/writer.go b/vendor/github.com/ulikunitz/xz/writer.go index aec10dfa62..c126f70995 100644 --- a/vendor/github.com/ulikunitz/xz/writer.go +++ b/vendor/github.com/ulikunitz/xz/writer.go @@ -1,4 +1,4 @@ -// Copyright 2014-2019 Ulrich Kunitz. All rights reserved. +// Copyright 2014-2017 Ulrich Kunitz. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -18,10 +18,8 @@ type WriterConfig struct { DictCap int BufSize int BlockSize int64 - // checksum method: CRC32, CRC64 or SHA256 (default: CRC64) + // checksum method: CRC32, CRC64 or SHA256 CheckSum byte - // Forces NoChecksum (default: false) - NoCheckSum bool // match algorithm Matcher lzma.MatchAlgorithm } @@ -43,9 +41,6 @@ func (c *WriterConfig) fill() { if c.CheckSum == 0 { c.CheckSum = CRC64 } - if c.NoCheckSum { - c.CheckSum = None - } } // Verify checks the configuration for errors. Zero values will be @@ -289,11 +284,7 @@ func (c *WriterConfig) newBlockWriter(xz io.Writer, hash hash.Hash) (bw *blockWr if err != nil { return nil, err } - if bw.hash.Size() != 0 { - bw.mw = io.MultiWriter(bw.w, bw.hash) - } else { - bw.mw = bw.w - } + bw.mw = io.MultiWriter(bw.w, bw.hash) return bw, nil } diff --git a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go index 56bfaaa17d..8a893fdfff 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go +++ b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.7 && amd64 && gc && !purego // +build go1.7,amd64,gc,!purego package blake2b diff --git a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s index a78ab3b3d9..8608a7f7d1 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s +++ b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s @@ -282,12 +282,14 @@ TEXT ·hashBlocksAVX2(SB), 4, $320-48 // frame size = 288 + 32 byte alignment MOVQ blocks_len+32(FP), DI MOVQ SP, DX - ADDQ $31, DX - ANDQ $~31, DX + MOVQ SP, R9 + ADDQ $31, R9 + ANDQ $~31, R9 + MOVQ R9, SP - MOVQ CX, 16(DX) + MOVQ CX, 16(SP) XORQ CX, CX - MOVQ CX, 24(DX) + MOVQ CX, 24(SP) VMOVDQU ·AVX2_c40<>(SB), Y4 VMOVDQU ·AVX2_c48<>(SB), Y5 @@ -299,33 +301,33 @@ TEXT ·hashBlocksAVX2(SB), 4, $320-48 // frame size = 288 + 32 byte alignment MOVQ 0(BX), R8 MOVQ 8(BX), R9 - MOVQ R9, 8(DX) + MOVQ R9, 8(SP) loop: ADDQ $128, R8 - MOVQ R8, 0(DX) + MOVQ R8, 0(SP) CMPQ R8, $128 JGE noinc INCQ R9 - MOVQ R9, 8(DX) + MOVQ R9, 8(SP) noinc: VMOVDQA Y8, Y0 VMOVDQA Y9, Y1 VMOVDQA Y6, Y2 - VPXOR 0(DX), Y7, Y3 + VPXOR 0(SP), Y7, Y3 LOAD_MSG_AVX2_0_2_4_6_1_3_5_7_8_10_12_14_9_11_13_15() - VMOVDQA Y12, 32(DX) - VMOVDQA Y13, 64(DX) - VMOVDQA Y14, 96(DX) - VMOVDQA Y15, 128(DX) + VMOVDQA Y12, 32(SP) + VMOVDQA Y13, 64(SP) + VMOVDQA Y14, 96(SP) + VMOVDQA Y15, 128(SP) ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) LOAD_MSG_AVX2_14_4_9_13_10_8_15_6_1_0_11_5_12_2_7_3() - VMOVDQA Y12, 160(DX) - VMOVDQA Y13, 192(DX) - VMOVDQA Y14, 224(DX) - VMOVDQA Y15, 256(DX) + VMOVDQA Y12, 160(SP) + VMOVDQA Y13, 192(SP) + VMOVDQA Y14, 224(SP) + VMOVDQA Y15, 256(SP) ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) LOAD_MSG_AVX2_11_12_5_15_8_0_2_13_10_3_7_9_14_6_1_4() @@ -345,8 +347,8 @@ noinc: LOAD_MSG_AVX2_10_8_7_1_2_4_6_5_15_9_3_13_11_14_12_0() ROUND_AVX2(Y12, Y13, Y14, Y15, Y10, Y4, Y5) - ROUND_AVX2(32(DX), 64(DX), 96(DX), 128(DX), Y10, Y4, Y5) - ROUND_AVX2(160(DX), 192(DX), 224(DX), 256(DX), Y10, Y4, Y5) + ROUND_AVX2(32(SP), 64(SP), 96(SP), 128(SP), Y10, Y4, Y5) + ROUND_AVX2(160(SP), 192(SP), 224(SP), 256(SP), Y10, Y4, Y5) VPXOR Y0, Y8, Y8 VPXOR Y1, Y9, Y9 @@ -364,6 +366,7 @@ noinc: VMOVDQU Y9, 32(AX) VZEROUPPER + MOVQ DX, SP RET #define VPUNPCKLQDQ_X2_X2_X15 BYTE $0xC5; BYTE $0x69; BYTE $0x6C; BYTE $0xFA @@ -581,9 +584,11 @@ TEXT ·hashBlocksAVX(SB), 4, $288-48 // frame size = 272 + 16 byte alignment MOVQ blocks_base+24(FP), SI MOVQ blocks_len+32(FP), DI - MOVQ SP, R10 - ADDQ $15, R10 - ANDQ $~15, R10 + MOVQ SP, BP + MOVQ SP, R9 + ADDQ $15, R9 + ANDQ $~15, R9 + MOVQ R9, SP VMOVDQU ·AVX_c40<>(SB), X0 VMOVDQU ·AVX_c48<>(SB), X1 @@ -591,8 +596,8 @@ TEXT ·hashBlocksAVX(SB), 4, $288-48 // frame size = 272 + 16 byte alignment VMOVDQA X1, X9 VMOVDQU ·AVX_iv3<>(SB), X0 - VMOVDQA X0, 0(R10) - XORQ CX, 0(R10) // 0(R10) = ·AVX_iv3 ^ (CX || 0) + VMOVDQA X0, 0(SP) + XORQ CX, 0(SP) // 0(SP) = ·AVX_iv3 ^ (CX || 0) VMOVDQU 0(AX), X10 VMOVDQU 16(AX), X11 @@ -619,35 +624,35 @@ noinc: VMOVDQU ·AVX_iv2<>(SB), X6 VPXOR X15, X6, X6 - VMOVDQA 0(R10), X7 + VMOVDQA 0(SP), X7 LOAD_MSG_AVX_0_2_4_6_1_3_5_7() - VMOVDQA X12, 16(R10) - VMOVDQA X13, 32(R10) - VMOVDQA X14, 48(R10) - VMOVDQA X15, 64(R10) + VMOVDQA X12, 16(SP) + VMOVDQA X13, 32(SP) + VMOVDQA X14, 48(SP) + VMOVDQA X15, 64(SP) HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) SHUFFLE_AVX() LOAD_MSG_AVX(8, 10, 12, 14, 9, 11, 13, 15) - VMOVDQA X12, 80(R10) - VMOVDQA X13, 96(R10) - VMOVDQA X14, 112(R10) - VMOVDQA X15, 128(R10) + VMOVDQA X12, 80(SP) + VMOVDQA X13, 96(SP) + VMOVDQA X14, 112(SP) + VMOVDQA X15, 128(SP) HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) SHUFFLE_AVX_INV() LOAD_MSG_AVX(14, 4, 9, 13, 10, 8, 15, 6) - VMOVDQA X12, 144(R10) - VMOVDQA X13, 160(R10) - VMOVDQA X14, 176(R10) - VMOVDQA X15, 192(R10) + VMOVDQA X12, 144(SP) + VMOVDQA X13, 160(SP) + VMOVDQA X14, 176(SP) + VMOVDQA X15, 192(SP) HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) SHUFFLE_AVX() LOAD_MSG_AVX_1_0_11_5_12_2_7_3() - VMOVDQA X12, 208(R10) - VMOVDQA X13, 224(R10) - VMOVDQA X14, 240(R10) - VMOVDQA X15, 256(R10) + VMOVDQA X12, 208(SP) + VMOVDQA X13, 224(SP) + VMOVDQA X14, 240(SP) + VMOVDQA X15, 256(SP) HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) SHUFFLE_AVX_INV() @@ -707,14 +712,14 @@ noinc: HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, X12, X13, X14, X15, X15, X8, X9) SHUFFLE_AVX_INV() - HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 16(R10), 32(R10), 48(R10), 64(R10), X15, X8, X9) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 16(SP), 32(SP), 48(SP), 64(SP), X15, X8, X9) SHUFFLE_AVX() - HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 80(R10), 96(R10), 112(R10), 128(R10), X15, X8, X9) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 80(SP), 96(SP), 112(SP), 128(SP), X15, X8, X9) SHUFFLE_AVX_INV() - HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 144(R10), 160(R10), 176(R10), 192(R10), X15, X8, X9) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 144(SP), 160(SP), 176(SP), 192(SP), X15, X8, X9) SHUFFLE_AVX() - HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 208(R10), 224(R10), 240(R10), 256(R10), X15, X8, X9) + HALF_ROUND_AVX(X0, X1, X2, X3, X4, X5, X6, X7, 208(SP), 224(SP), 240(SP), 256(SP), X15, X8, X9) SHUFFLE_AVX_INV() VMOVDQU 32(AX), X14 @@ -741,4 +746,5 @@ noinc: MOVQ R9, 8(BX) VZEROUPPER + MOVQ BP, SP RET diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go index 5fa1b32841..a52c887fcb 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go +++ b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !go1.7 && amd64 && gc && !purego // +build !go1.7,amd64,gc,!purego package blake2b diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s index bb72a03913..1f4c6a9279 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s +++ b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s @@ -118,13 +118,15 @@ TEXT ·hashBlocksSSE4(SB), 4, $288-48 // frame size = 272 + 16 byte alignment MOVQ blocks_base+24(FP), SI MOVQ blocks_len+32(FP), DI - MOVQ SP, R10 - ADDQ $15, R10 - ANDQ $~15, R10 + MOVQ SP, BP + MOVQ SP, R9 + ADDQ $15, R9 + ANDQ $~15, R9 + MOVQ R9, SP MOVOU ·iv3<>(SB), X0 - MOVO X0, 0(R10) - XORQ CX, 0(R10) // 0(R10) = ·iv3 ^ (CX || 0) + MOVO X0, 0(SP) + XORQ CX, 0(SP) // 0(SP) = ·iv3 ^ (CX || 0) MOVOU ·c40<>(SB), X13 MOVOU ·c48<>(SB), X14 @@ -154,35 +156,35 @@ noinc: MOVOU ·iv2<>(SB), X6 PXOR X8, X6 - MOVO 0(R10), X7 + MOVO 0(SP), X7 LOAD_MSG(X8, X9, X10, X11, SI, 0, 2, 4, 6, 1, 3, 5, 7) - MOVO X8, 16(R10) - MOVO X9, 32(R10) - MOVO X10, 48(R10) - MOVO X11, 64(R10) + MOVO X8, 16(SP) + MOVO X9, 32(SP) + MOVO X10, 48(SP) + MOVO X11, 64(SP) HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) LOAD_MSG(X8, X9, X10, X11, SI, 8, 10, 12, 14, 9, 11, 13, 15) - MOVO X8, 80(R10) - MOVO X9, 96(R10) - MOVO X10, 112(R10) - MOVO X11, 128(R10) + MOVO X8, 80(SP) + MOVO X9, 96(SP) + MOVO X10, 112(SP) + MOVO X11, 128(SP) HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) LOAD_MSG(X8, X9, X10, X11, SI, 14, 4, 9, 13, 10, 8, 15, 6) - MOVO X8, 144(R10) - MOVO X9, 160(R10) - MOVO X10, 176(R10) - MOVO X11, 192(R10) + MOVO X8, 144(SP) + MOVO X9, 160(SP) + MOVO X10, 176(SP) + MOVO X11, 192(SP) HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) LOAD_MSG(X8, X9, X10, X11, SI, 1, 0, 11, 5, 12, 2, 7, 3) - MOVO X8, 208(R10) - MOVO X9, 224(R10) - MOVO X10, 240(R10) - MOVO X11, 256(R10) + MOVO X8, 208(SP) + MOVO X9, 224(SP) + MOVO X10, 240(SP) + MOVO X11, 256(SP) HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) @@ -242,14 +244,14 @@ noinc: HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X11, X13, X14) SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) - HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 16(R10), 32(R10), 48(R10), 64(R10), X11, X13, X14) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 16(SP), 32(SP), 48(SP), 64(SP), X11, X13, X14) SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) - HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 80(R10), 96(R10), 112(R10), 128(R10), X11, X13, X14) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 80(SP), 96(SP), 112(SP), 128(SP), X11, X13, X14) SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) - HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 144(R10), 160(R10), 176(R10), 192(R10), X11, X13, X14) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 144(SP), 160(SP), 176(SP), 192(SP), X11, X13, X14) SHUFFLE(X2, X3, X4, X5, X6, X7, X8, X9) - HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 208(R10), 224(R10), 240(R10), 256(R10), X11, X13, X14) + HALF_ROUND(X0, X1, X2, X3, X4, X5, X6, X7, 208(SP), 224(SP), 240(SP), 256(SP), X11, X13, X14) SHUFFLE_INV(X2, X3, X4, X5, X6, X7, X8, X9) MOVOU 32(AX), X10 @@ -275,4 +277,5 @@ noinc: MOVQ R8, 0(BX) MOVQ R9, 8(BX) + MOVQ BP, SP RET diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_ref.go b/vendor/golang.org/x/crypto/blake2b/blake2b_ref.go index b0137cdf02..8597457781 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2b_ref.go +++ b/vendor/golang.org/x/crypto/blake2b/blake2b_ref.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !amd64 || purego || !gc // +build !amd64 purego !gc package blake2b diff --git a/vendor/golang.org/x/crypto/blake2b/register.go b/vendor/golang.org/x/crypto/blake2b/register.go index 9d8633963c..efd689af4b 100644 --- a/vendor/golang.org/x/crypto/blake2b/register.go +++ b/vendor/golang.org/x/crypto/blake2b/register.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.9 // +build go1.9 package blake2b diff --git a/vendor/golang.org/x/crypto/blake2s/blake2s_386.go b/vendor/golang.org/x/crypto/blake2s/blake2s_386.go index b4463fb4dc..2d8ee63c1a 100644 --- a/vendor/golang.org/x/crypto/blake2s/blake2s_386.go +++ b/vendor/golang.org/x/crypto/blake2s/blake2s_386.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build 386 && gc && !purego // +build 386,gc,!purego package blake2s diff --git a/vendor/golang.org/x/crypto/blake2s/blake2s_386.s b/vendor/golang.org/x/crypto/blake2s/blake2s_386.s index 82894e5a92..023532b46d 100644 --- a/vendor/golang.org/x/crypto/blake2s/blake2s_386.s +++ b/vendor/golang.org/x/crypto/blake2s/blake2s_386.s @@ -297,17 +297,19 @@ TEXT ·hashBlocksSSE2(SB), 0, $672-24 // frame = 656 + 16 byte alignment MOVL blocks_base+12(FP), SI MOVL blocks_len+16(FP), DX + MOVL SP, BP MOVL SP, DI ADDL $15, DI ANDL $~15, DI + MOVL DI, SP - MOVL CX, 8(DI) + MOVL CX, 8(SP) MOVL 0(BX), CX - MOVL CX, 0(DI) + MOVL CX, 0(SP) MOVL 4(BX), CX - MOVL CX, 4(DI) + MOVL CX, 4(SP) XORL CX, CX - MOVL CX, 12(DI) + MOVL CX, 12(SP) MOVOU 0(AX), X0 MOVOU 16(AX), X1 @@ -319,22 +321,22 @@ loop: MOVOU iv0<>(SB), X6 MOVOU iv1<>(SB), X7 - MOVO 0(DI), X3 + MOVO 0(SP), X3 PADDQ X2, X3 PXOR X3, X7 - MOVO X3, 0(DI) - - PRECOMPUTE(DI, 16, SI, CX) - ROUND_SSE2(X4, X5, X6, X7, 16(DI), 32(DI), 48(DI), 64(DI), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+64(DI), 32+64(DI), 48+64(DI), 64+64(DI), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+128(DI), 32+128(DI), 48+128(DI), 64+128(DI), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+192(DI), 32+192(DI), 48+192(DI), 64+192(DI), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+256(DI), 32+256(DI), 48+256(DI), 64+256(DI), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+320(DI), 32+320(DI), 48+320(DI), 64+320(DI), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+384(DI), 32+384(DI), 48+384(DI), 64+384(DI), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+448(DI), 32+448(DI), 48+448(DI), 64+448(DI), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+512(DI), 32+512(DI), 48+512(DI), 64+512(DI), X3) - ROUND_SSE2(X4, X5, X6, X7, 16+576(DI), 32+576(DI), 48+576(DI), 64+576(DI), X3) + MOVO X3, 0(SP) + + PRECOMPUTE(SP, 16, SI, CX) + ROUND_SSE2(X4, X5, X6, X7, 16(SP), 32(SP), 48(SP), 64(SP), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+64(SP), 32+64(SP), 48+64(SP), 64+64(SP), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+128(SP), 32+128(SP), 48+128(SP), 64+128(SP), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+192(SP), 32+192(SP), 48+192(SP), 64+192(SP), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+256(SP), 32+256(SP), 48+256(SP), 64+256(SP), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+320(SP), 32+320(SP), 48+320(SP), 64+320(SP), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+384(SP), 32+384(SP), 48+384(SP), 64+384(SP), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+448(SP), 32+448(SP), 48+448(SP), 64+448(SP), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+512(SP), 32+512(SP), 48+512(SP), 64+512(SP), X3) + ROUND_SSE2(X4, X5, X6, X7, 16+576(SP), 32+576(SP), 48+576(SP), 64+576(SP), X3) PXOR X4, X0 PXOR X5, X1 @@ -345,14 +347,15 @@ loop: SUBL $64, DX JNE loop - MOVL 0(DI), CX + MOVL 0(SP), CX MOVL CX, 0(BX) - MOVL 4(DI), CX + MOVL 4(SP), CX MOVL CX, 4(BX) MOVOU X0, 0(AX) MOVOU X1, 16(AX) + MOVL BP, SP RET // func hashBlocksSSSE3(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) @@ -363,52 +366,54 @@ TEXT ·hashBlocksSSSE3(SB), 0, $704-24 // frame = 688 + 16 byte alignment MOVL blocks_base+12(FP), SI MOVL blocks_len+16(FP), DX + MOVL SP, BP MOVL SP, DI ADDL $15, DI ANDL $~15, DI + MOVL DI, SP - MOVL CX, 8(DI) + MOVL CX, 8(SP) MOVL 0(BX), CX - MOVL CX, 0(DI) + MOVL CX, 0(SP) MOVL 4(BX), CX - MOVL CX, 4(DI) + MOVL CX, 4(SP) XORL CX, CX - MOVL CX, 12(DI) + MOVL CX, 12(SP) MOVOU 0(AX), X0 MOVOU 16(AX), X1 MOVOU counter<>(SB), X2 loop: - MOVO X0, 656(DI) - MOVO X1, 672(DI) + MOVO X0, 656(SP) + MOVO X1, 672(SP) MOVO X0, X4 MOVO X1, X5 MOVOU iv0<>(SB), X6 MOVOU iv1<>(SB), X7 - MOVO 0(DI), X3 + MOVO 0(SP), X3 PADDQ X2, X3 PXOR X3, X7 - MOVO X3, 0(DI) + MOVO X3, 0(SP) MOVOU rol16<>(SB), X0 MOVOU rol8<>(SB), X1 - PRECOMPUTE(DI, 16, SI, CX) - ROUND_SSSE3(X4, X5, X6, X7, 16(DI), 32(DI), 48(DI), 64(DI), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+64(DI), 32+64(DI), 48+64(DI), 64+64(DI), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+128(DI), 32+128(DI), 48+128(DI), 64+128(DI), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+192(DI), 32+192(DI), 48+192(DI), 64+192(DI), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+256(DI), 32+256(DI), 48+256(DI), 64+256(DI), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+320(DI), 32+320(DI), 48+320(DI), 64+320(DI), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+384(DI), 32+384(DI), 48+384(DI), 64+384(DI), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+448(DI), 32+448(DI), 48+448(DI), 64+448(DI), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+512(DI), 32+512(DI), 48+512(DI), 64+512(DI), X3, X0, X1) - ROUND_SSSE3(X4, X5, X6, X7, 16+576(DI), 32+576(DI), 48+576(DI), 64+576(DI), X3, X0, X1) - - MOVO 656(DI), X0 - MOVO 672(DI), X1 + PRECOMPUTE(SP, 16, SI, CX) + ROUND_SSSE3(X4, X5, X6, X7, 16(SP), 32(SP), 48(SP), 64(SP), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+64(SP), 32+64(SP), 48+64(SP), 64+64(SP), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+128(SP), 32+128(SP), 48+128(SP), 64+128(SP), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+192(SP), 32+192(SP), 48+192(SP), 64+192(SP), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+256(SP), 32+256(SP), 48+256(SP), 64+256(SP), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+320(SP), 32+320(SP), 48+320(SP), 64+320(SP), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+384(SP), 32+384(SP), 48+384(SP), 64+384(SP), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+448(SP), 32+448(SP), 48+448(SP), 64+448(SP), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+512(SP), 32+512(SP), 48+512(SP), 64+512(SP), X3, X0, X1) + ROUND_SSSE3(X4, X5, X6, X7, 16+576(SP), 32+576(SP), 48+576(SP), 64+576(SP), X3, X0, X1) + + MOVO 656(SP), X0 + MOVO 672(SP), X1 PXOR X4, X0 PXOR X5, X1 PXOR X6, X0 @@ -418,12 +423,13 @@ loop: SUBL $64, DX JNE loop - MOVL 0(DI), CX + MOVL 0(SP), CX MOVL CX, 0(BX) - MOVL 4(DI), CX + MOVL 4(SP), CX MOVL CX, 4(BX) MOVOU X0, 0(AX) MOVOU X1, 16(AX) + MOVL BP, SP RET diff --git a/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.go b/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.go index becdaa120f..267bdce1e3 100644 --- a/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.go +++ b/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build amd64 && gc && !purego // +build amd64,gc,!purego package blake2s diff --git a/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.s b/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.s index 9b8824f741..b905944fd0 100644 --- a/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.s +++ b/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.s @@ -317,30 +317,30 @@ GLOBL counter<>(SB), (NOPTR+RODATA), $16 MOVL R15, 8*4+off+576(dst) #define BLAKE2s_SSE2() \ - PRECOMPUTE_MSG(BP, 16, SI, R8, R9, R10, R11, R12, R13, R14, R15); \ - ROUND_SSE2(X4, X5, X6, X7, 16(BP), 32(BP), 48(BP), 64(BP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+64(BP), 32+64(BP), 48+64(BP), 64+64(BP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+128(BP), 32+128(BP), 48+128(BP), 64+128(BP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+192(BP), 32+192(BP), 48+192(BP), 64+192(BP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+256(BP), 32+256(BP), 48+256(BP), 64+256(BP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+320(BP), 32+320(BP), 48+320(BP), 64+320(BP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+384(BP), 32+384(BP), 48+384(BP), 64+384(BP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+448(BP), 32+448(BP), 48+448(BP), 64+448(BP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+512(BP), 32+512(BP), 48+512(BP), 64+512(BP), X8); \ - ROUND_SSE2(X4, X5, X6, X7, 16+576(BP), 32+576(BP), 48+576(BP), 64+576(BP), X8) + PRECOMPUTE_MSG(SP, 16, SI, R8, R9, R10, R11, R12, R13, R14, R15); \ + ROUND_SSE2(X4, X5, X6, X7, 16(SP), 32(SP), 48(SP), 64(SP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+64(SP), 32+64(SP), 48+64(SP), 64+64(SP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+128(SP), 32+128(SP), 48+128(SP), 64+128(SP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+192(SP), 32+192(SP), 48+192(SP), 64+192(SP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+256(SP), 32+256(SP), 48+256(SP), 64+256(SP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+320(SP), 32+320(SP), 48+320(SP), 64+320(SP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+384(SP), 32+384(SP), 48+384(SP), 64+384(SP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+448(SP), 32+448(SP), 48+448(SP), 64+448(SP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+512(SP), 32+512(SP), 48+512(SP), 64+512(SP), X8); \ + ROUND_SSE2(X4, X5, X6, X7, 16+576(SP), 32+576(SP), 48+576(SP), 64+576(SP), X8) #define BLAKE2s_SSSE3() \ - PRECOMPUTE_MSG(BP, 16, SI, R8, R9, R10, R11, R12, R13, R14, R15); \ - ROUND_SSSE3(X4, X5, X6, X7, 16(BP), 32(BP), 48(BP), 64(BP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+64(BP), 32+64(BP), 48+64(BP), 64+64(BP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+128(BP), 32+128(BP), 48+128(BP), 64+128(BP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+192(BP), 32+192(BP), 48+192(BP), 64+192(BP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+256(BP), 32+256(BP), 48+256(BP), 64+256(BP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+320(BP), 32+320(BP), 48+320(BP), 64+320(BP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+384(BP), 32+384(BP), 48+384(BP), 64+384(BP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+448(BP), 32+448(BP), 48+448(BP), 64+448(BP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+512(BP), 32+512(BP), 48+512(BP), 64+512(BP), X8, X13, X14); \ - ROUND_SSSE3(X4, X5, X6, X7, 16+576(BP), 32+576(BP), 48+576(BP), 64+576(BP), X8, X13, X14) + PRECOMPUTE_MSG(SP, 16, SI, R8, R9, R10, R11, R12, R13, R14, R15); \ + ROUND_SSSE3(X4, X5, X6, X7, 16(SP), 32(SP), 48(SP), 64(SP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+64(SP), 32+64(SP), 48+64(SP), 64+64(SP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+128(SP), 32+128(SP), 48+128(SP), 64+128(SP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+192(SP), 32+192(SP), 48+192(SP), 64+192(SP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+256(SP), 32+256(SP), 48+256(SP), 64+256(SP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+320(SP), 32+320(SP), 48+320(SP), 64+320(SP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+384(SP), 32+384(SP), 48+384(SP), 64+384(SP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+448(SP), 32+448(SP), 48+448(SP), 64+448(SP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+512(SP), 32+512(SP), 48+512(SP), 64+512(SP), X8, X13, X14); \ + ROUND_SSSE3(X4, X5, X6, X7, 16+576(SP), 32+576(SP), 48+576(SP), 64+576(SP), X8, X13, X14) #define BLAKE2s_SSE4() \ LOAD_MSG_SSE4(X8, X9, X10, X11, SI, 0, 2, 4, 6, 1, 3, 5, 7, 8, 10, 12, 14, 9, 11, 13, 15); \ @@ -372,12 +372,16 @@ GLOBL counter<>(SB), (NOPTR+RODATA), $16 MOVQ blocks_len, DX; \ \ MOVQ SP, BP; \ - ADDQ $15, BP; \ - ANDQ $~15, BP; \ + MOVQ SP, R9; \ + ADDQ $15, R9; \ + ANDQ $~15, R9; \ + MOVQ R9, SP; \ \ MOVQ 0(BX), R9; \ - MOVQ R9, 0(BP); \ - MOVQ CX, 8(BP); \ + MOVQ R9, 0(SP); \ + XORQ R9, R9; \ + MOVQ R9, 8(SP); \ + MOVL CX, 8(SP); \ \ MOVOU 0(AX), X0; \ MOVOU 16(AX), X1; \ @@ -387,7 +391,7 @@ GLOBL counter<>(SB), (NOPTR+RODATA), $16 MOVOU counter<>(SB), X12; \ MOVOU rol16<>(SB), X13; \ MOVOU rol8<>(SB), X14; \ - MOVO 0(BP), X15; \ + MOVO 0(SP), X15; \ \ loop: \ MOVO X0, X4; \ @@ -409,12 +413,14 @@ GLOBL counter<>(SB), (NOPTR+RODATA), $16 SUBQ $64, DX; \ JNE loop; \ \ - MOVO X15, 0(BP); \ - MOVQ 0(BP), R9; \ + MOVO X15, 0(SP); \ + MOVQ 0(SP), R9; \ MOVQ R9, 0(BX); \ \ MOVOU X0, 0(AX); \ - MOVOU X1, 16(AX) + MOVOU X1, 16(AX); \ + \ + MOVQ BP, SP // func hashBlocksSSE2(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) TEXT ·hashBlocksSSE2(SB), 0, $672-48 // frame = 656 + 16 byte alignment diff --git a/vendor/golang.org/x/crypto/blake2s/blake2s_ref.go b/vendor/golang.org/x/crypto/blake2s/blake2s_ref.go index 799dba0c41..94ef01d96e 100644 --- a/vendor/golang.org/x/crypto/blake2s/blake2s_ref.go +++ b/vendor/golang.org/x/crypto/blake2s/blake2s_ref.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (!amd64 && !386) || !gc || purego // +build !amd64,!386 !gc purego package blake2s diff --git a/vendor/golang.org/x/crypto/blake2s/register.go b/vendor/golang.org/x/crypto/blake2s/register.go index ef79ff3c67..d277459a1c 100644 --- a/vendor/golang.org/x/crypto/blake2s/register.go +++ b/vendor/golang.org/x/crypto/blake2s/register.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.9 // +build go1.9 package blake2s diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go b/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go index 94c71ac1ac..c474e5a804 100644 --- a/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go +++ b/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.11 && gc && !purego // +build go1.11,gc,!purego package chacha20 diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go b/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go index 025b49897e..3e8a609fbd 100644 --- a/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go +++ b/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (!arm64 && !s390x && !ppc64le) || (arm64 && !go1.11) || !gc || purego // +build !arm64,!s390x,!ppc64le arm64,!go1.11 !gc purego package chacha20 diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go index da420b2e97..2806c6325d 100644 --- a/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go +++ b/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build gc && !purego // +build gc,!purego package chacha20 diff --git a/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go b/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go index c5898db465..a0774dde1c 100644 --- a/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go +++ b/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build gc && !purego // +build gc,!purego package chacha20 diff --git a/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go b/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go index 25959b9a6e..c41d061485 100644 --- a/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go +++ b/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build gc && !purego // +build gc,!purego package chacha20poly1305 diff --git a/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go b/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go index f832b33d45..13941c476f 100644 --- a/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go +++ b/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !amd64 || !gc || purego // +build !amd64 !gc purego package chacha20poly1305 diff --git a/vendor/golang.org/x/crypto/curve25519/curve25519_amd64.go b/vendor/golang.org/x/crypto/curve25519/curve25519_amd64.go index 84858480df..877b6de292 100644 --- a/vendor/golang.org/x/crypto/curve25519/curve25519_amd64.go +++ b/vendor/golang.org/x/crypto/curve25519/curve25519_amd64.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build amd64 && gc && !purego // +build amd64,gc,!purego package curve25519 diff --git a/vendor/golang.org/x/crypto/curve25519/curve25519_noasm.go b/vendor/golang.org/x/crypto/curve25519/curve25519_noasm.go index 259728af7d..80d3300af5 100644 --- a/vendor/golang.org/x/crypto/curve25519/curve25519_noasm.go +++ b/vendor/golang.org/x/crypto/curve25519/curve25519_noasm.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !amd64 || !gc || purego // +build !amd64 !gc purego package curve25519 diff --git a/vendor/golang.org/x/crypto/internal/subtle/aliasing.go b/vendor/golang.org/x/crypto/internal/subtle/aliasing.go index 4fad24f8dc..281c27ef02 100644 --- a/vendor/golang.org/x/crypto/internal/subtle/aliasing.go +++ b/vendor/golang.org/x/crypto/internal/subtle/aliasing.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !purego // +build !purego // Package subtle implements functions that are often useful in cryptographic diff --git a/vendor/golang.org/x/crypto/internal/subtle/aliasing_purego.go b/vendor/golang.org/x/crypto/internal/subtle/aliasing_purego.go index 80ccbed2c0..e20a296592 100644 --- a/vendor/golang.org/x/crypto/internal/subtle/aliasing_purego.go +++ b/vendor/golang.org/x/crypto/internal/subtle/aliasing_purego.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build purego // +build purego // Package subtle implements functions that are often useful in cryptographic diff --git a/vendor/golang.org/x/crypto/poly1305/bits_compat.go b/vendor/golang.org/x/crypto/poly1305/bits_compat.go index 45b5c966b2..157a69f61b 100644 --- a/vendor/golang.org/x/crypto/poly1305/bits_compat.go +++ b/vendor/golang.org/x/crypto/poly1305/bits_compat.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !go1.13 // +build !go1.13 package poly1305 diff --git a/vendor/golang.org/x/crypto/poly1305/bits_go1.13.go b/vendor/golang.org/x/crypto/poly1305/bits_go1.13.go index ed52b3418a..a0a185f0fc 100644 --- a/vendor/golang.org/x/crypto/poly1305/bits_go1.13.go +++ b/vendor/golang.org/x/crypto/poly1305/bits_go1.13.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.13 // +build go1.13 package poly1305 diff --git a/vendor/golang.org/x/crypto/poly1305/mac_noasm.go b/vendor/golang.org/x/crypto/poly1305/mac_noasm.go index f184b67d98..af6c94f921 100644 --- a/vendor/golang.org/x/crypto/poly1305/mac_noasm.go +++ b/vendor/golang.org/x/crypto/poly1305/mac_noasm.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (!amd64 && !ppc64le && !s390x) || !gc || purego // +build !amd64,!ppc64le,!s390x !gc purego package poly1305 diff --git a/vendor/golang.org/x/crypto/poly1305/sum_amd64.go b/vendor/golang.org/x/crypto/poly1305/sum_amd64.go index 6d522333f2..cf3a69ed3b 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_amd64.go +++ b/vendor/golang.org/x/crypto/poly1305/sum_amd64.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build gc && !purego // +build gc,!purego package poly1305 diff --git a/vendor/golang.org/x/crypto/poly1305/sum_ppc64le.go b/vendor/golang.org/x/crypto/poly1305/sum_ppc64le.go index 4a069941a6..cb4b7185dc 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_ppc64le.go +++ b/vendor/golang.org/x/crypto/poly1305/sum_ppc64le.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build gc && !purego // +build gc,!purego package poly1305 diff --git a/vendor/golang.org/x/crypto/poly1305/sum_s390x.go b/vendor/golang.org/x/crypto/poly1305/sum_s390x.go index 62cc9f8470..188a665e12 100644 --- a/vendor/golang.org/x/crypto/poly1305/sum_s390x.go +++ b/vendor/golang.org/x/crypto/poly1305/sum_s390x.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build gc && !purego // +build gc,!purego package poly1305 diff --git a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go index c400dfcf7b..5cf1d6d839 100644 --- a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go +++ b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build amd64 && !purego && gc // +build amd64,!purego,gc package salsa diff --git a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s index f97efc6764..9c84012466 100644 --- a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s +++ b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.s @@ -8,7 +8,7 @@ // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html // func salsa2020XORKeyStream(out, in *byte, n uint64, nonce, key *byte) -// This needs up to 64 bytes at 360(R12); hence the non-obvious frame size. +// This needs up to 64 bytes at 360(SP); hence the non-obvious frame size. TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVQ out+0(FP),DI MOVQ in+8(FP),SI @@ -17,8 +17,10 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVQ key+32(FP),R8 MOVQ SP,R12 - ADDQ $31, R12 - ANDQ $~31, R12 + MOVQ SP,R9 + ADDQ $31, R9 + ANDQ $~31, R9 + MOVQ R9, SP MOVQ DX,R9 MOVQ CX,DX @@ -30,116 +32,116 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL 0(R10),R8 MOVL 0(DX),AX MOVL 16(R10),R11 - MOVL CX,0(R12) - MOVL R8, 4 (R12) - MOVL AX, 8 (R12) - MOVL R11, 12 (R12) + MOVL CX,0(SP) + MOVL R8, 4 (SP) + MOVL AX, 8 (SP) + MOVL R11, 12 (SP) MOVL 8(DX),CX MOVL 24(R10),R8 MOVL 4(R10),AX MOVL 4(DX),R11 - MOVL CX,16(R12) - MOVL R8, 20 (R12) - MOVL AX, 24 (R12) - MOVL R11, 28 (R12) + MOVL CX,16(SP) + MOVL R8, 20 (SP) + MOVL AX, 24 (SP) + MOVL R11, 28 (SP) MOVL 12(DX),CX MOVL 12(R10),DX MOVL 28(R10),R8 MOVL 8(R10),AX - MOVL DX,32(R12) - MOVL CX, 36 (R12) - MOVL R8, 40 (R12) - MOVL AX, 44 (R12) + MOVL DX,32(SP) + MOVL CX, 36 (SP) + MOVL R8, 40 (SP) + MOVL AX, 44 (SP) MOVQ $1634760805,DX MOVQ $857760878,CX MOVQ $2036477234,R8 MOVQ $1797285236,AX - MOVL DX,48(R12) - MOVL CX, 52 (R12) - MOVL R8, 56 (R12) - MOVL AX, 60 (R12) + MOVL DX,48(SP) + MOVL CX, 52 (SP) + MOVL R8, 56 (SP) + MOVL AX, 60 (SP) CMPQ R9,$256 JB BYTESBETWEEN1AND255 - MOVOA 48(R12),X0 + MOVOA 48(SP),X0 PSHUFL $0X55,X0,X1 PSHUFL $0XAA,X0,X2 PSHUFL $0XFF,X0,X3 PSHUFL $0X00,X0,X0 - MOVOA X1,64(R12) - MOVOA X2,80(R12) - MOVOA X3,96(R12) - MOVOA X0,112(R12) - MOVOA 0(R12),X0 + MOVOA X1,64(SP) + MOVOA X2,80(SP) + MOVOA X3,96(SP) + MOVOA X0,112(SP) + MOVOA 0(SP),X0 PSHUFL $0XAA,X0,X1 PSHUFL $0XFF,X0,X2 PSHUFL $0X00,X0,X3 PSHUFL $0X55,X0,X0 - MOVOA X1,128(R12) - MOVOA X2,144(R12) - MOVOA X3,160(R12) - MOVOA X0,176(R12) - MOVOA 16(R12),X0 + MOVOA X1,128(SP) + MOVOA X2,144(SP) + MOVOA X3,160(SP) + MOVOA X0,176(SP) + MOVOA 16(SP),X0 PSHUFL $0XFF,X0,X1 PSHUFL $0X55,X0,X2 PSHUFL $0XAA,X0,X0 - MOVOA X1,192(R12) - MOVOA X2,208(R12) - MOVOA X0,224(R12) - MOVOA 32(R12),X0 + MOVOA X1,192(SP) + MOVOA X2,208(SP) + MOVOA X0,224(SP) + MOVOA 32(SP),X0 PSHUFL $0X00,X0,X1 PSHUFL $0XAA,X0,X2 PSHUFL $0XFF,X0,X0 - MOVOA X1,240(R12) - MOVOA X2,256(R12) - MOVOA X0,272(R12) + MOVOA X1,240(SP) + MOVOA X2,256(SP) + MOVOA X0,272(SP) BYTESATLEAST256: - MOVL 16(R12),DX - MOVL 36 (R12),CX - MOVL DX,288(R12) - MOVL CX,304(R12) + MOVL 16(SP),DX + MOVL 36 (SP),CX + MOVL DX,288(SP) + MOVL CX,304(SP) SHLQ $32,CX ADDQ CX,DX ADDQ $1,DX MOVQ DX,CX SHRQ $32,CX - MOVL DX, 292 (R12) - MOVL CX, 308 (R12) + MOVL DX, 292 (SP) + MOVL CX, 308 (SP) ADDQ $1,DX MOVQ DX,CX SHRQ $32,CX - MOVL DX, 296 (R12) - MOVL CX, 312 (R12) + MOVL DX, 296 (SP) + MOVL CX, 312 (SP) ADDQ $1,DX MOVQ DX,CX SHRQ $32,CX - MOVL DX, 300 (R12) - MOVL CX, 316 (R12) + MOVL DX, 300 (SP) + MOVL CX, 316 (SP) ADDQ $1,DX MOVQ DX,CX SHRQ $32,CX - MOVL DX,16(R12) - MOVL CX, 36 (R12) - MOVQ R9,352(R12) + MOVL DX,16(SP) + MOVL CX, 36 (SP) + MOVQ R9,352(SP) MOVQ $20,DX - MOVOA 64(R12),X0 - MOVOA 80(R12),X1 - MOVOA 96(R12),X2 - MOVOA 256(R12),X3 - MOVOA 272(R12),X4 - MOVOA 128(R12),X5 - MOVOA 144(R12),X6 - MOVOA 176(R12),X7 - MOVOA 192(R12),X8 - MOVOA 208(R12),X9 - MOVOA 224(R12),X10 - MOVOA 304(R12),X11 - MOVOA 112(R12),X12 - MOVOA 160(R12),X13 - MOVOA 240(R12),X14 - MOVOA 288(R12),X15 + MOVOA 64(SP),X0 + MOVOA 80(SP),X1 + MOVOA 96(SP),X2 + MOVOA 256(SP),X3 + MOVOA 272(SP),X4 + MOVOA 128(SP),X5 + MOVOA 144(SP),X6 + MOVOA 176(SP),X7 + MOVOA 192(SP),X8 + MOVOA 208(SP),X9 + MOVOA 224(SP),X10 + MOVOA 304(SP),X11 + MOVOA 112(SP),X12 + MOVOA 160(SP),X13 + MOVOA 240(SP),X14 + MOVOA 288(SP),X15 MAINLOOP1: - MOVOA X1,320(R12) - MOVOA X2,336(R12) + MOVOA X1,320(SP) + MOVOA X2,336(SP) MOVOA X13,X1 PADDL X12,X1 MOVOA X1,X2 @@ -189,8 +191,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X1,X12 PSRLL $14,X2 PXOR X2,X12 - MOVOA 320(R12),X1 - MOVOA X12,320(R12) + MOVOA 320(SP),X1 + MOVOA X12,320(SP) MOVOA X9,X2 PADDL X7,X2 MOVOA X2,X12 @@ -205,8 +207,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X2,X3 PSRLL $25,X12 PXOR X12,X3 - MOVOA 336(R12),X2 - MOVOA X0,336(R12) + MOVOA 336(SP),X2 + MOVOA X0,336(SP) MOVOA X6,X0 PADDL X2,X0 MOVOA X0,X12 @@ -249,8 +251,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X0,X1 PSRLL $14,X12 PXOR X12,X1 - MOVOA 320(R12),X0 - MOVOA X1,320(R12) + MOVOA 320(SP),X0 + MOVOA X1,320(SP) MOVOA X4,X1 PADDL X0,X1 MOVOA X1,X12 @@ -265,8 +267,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X1,X2 PSRLL $14,X12 PXOR X12,X2 - MOVOA 336(R12),X12 - MOVOA X2,336(R12) + MOVOA 336(SP),X12 + MOVOA X2,336(SP) MOVOA X14,X1 PADDL X12,X1 MOVOA X1,X2 @@ -309,8 +311,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X1,X0 PSRLL $14,X2 PXOR X2,X0 - MOVOA 320(R12),X1 - MOVOA X0,320(R12) + MOVOA 320(SP),X1 + MOVOA X0,320(SP) MOVOA X8,X0 PADDL X14,X0 MOVOA X0,X2 @@ -325,8 +327,8 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X0,X6 PSRLL $25,X2 PXOR X2,X6 - MOVOA 336(R12),X2 - MOVOA X12,336(R12) + MOVOA 336(SP),X2 + MOVOA X12,336(SP) MOVOA X3,X0 PADDL X2,X0 MOVOA X0,X12 @@ -376,14 +378,14 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PXOR X0,X2 PSRLL $14,X12 PXOR X12,X2 - MOVOA 320(R12),X12 - MOVOA 336(R12),X0 + MOVOA 320(SP),X12 + MOVOA 336(SP),X0 SUBQ $2,DX JA MAINLOOP1 - PADDL 112(R12),X12 - PADDL 176(R12),X7 - PADDL 224(R12),X10 - PADDL 272(R12),X4 + PADDL 112(SP),X12 + PADDL 176(SP),X7 + PADDL 224(SP),X10 + PADDL 272(SP),X4 MOVD X12,DX MOVD X7,CX MOVD X10,R8 @@ -444,10 +446,10 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL CX,196(DI) MOVL R8,200(DI) MOVL R9,204(DI) - PADDL 240(R12),X14 - PADDL 64(R12),X0 - PADDL 128(R12),X5 - PADDL 192(R12),X8 + PADDL 240(SP),X14 + PADDL 64(SP),X0 + PADDL 128(SP),X5 + PADDL 192(SP),X8 MOVD X14,DX MOVD X0,CX MOVD X5,R8 @@ -508,10 +510,10 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL CX,212(DI) MOVL R8,216(DI) MOVL R9,220(DI) - PADDL 288(R12),X15 - PADDL 304(R12),X11 - PADDL 80(R12),X1 - PADDL 144(R12),X6 + PADDL 288(SP),X15 + PADDL 304(SP),X11 + PADDL 80(SP),X1 + PADDL 144(SP),X6 MOVD X15,DX MOVD X11,CX MOVD X1,R8 @@ -572,10 +574,10 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL CX,228(DI) MOVL R8,232(DI) MOVL R9,236(DI) - PADDL 160(R12),X13 - PADDL 208(R12),X9 - PADDL 256(R12),X3 - PADDL 96(R12),X2 + PADDL 160(SP),X13 + PADDL 208(SP),X9 + PADDL 256(SP),X3 + PADDL 96(SP),X2 MOVD X13,DX MOVD X9,CX MOVD X3,R8 @@ -636,7 +638,7 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL CX,244(DI) MOVL R8,248(DI) MOVL R9,252(DI) - MOVQ 352(R12),R9 + MOVQ 352(SP),R9 SUBQ $256,R9 ADDQ $256,SI ADDQ $256,DI @@ -648,17 +650,17 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment CMPQ R9,$64 JAE NOCOPY MOVQ DI,DX - LEAQ 360(R12),DI + LEAQ 360(SP),DI MOVQ R9,CX REP; MOVSB - LEAQ 360(R12),DI - LEAQ 360(R12),SI + LEAQ 360(SP),DI + LEAQ 360(SP),SI NOCOPY: - MOVQ R9,352(R12) - MOVOA 48(R12),X0 - MOVOA 0(R12),X1 - MOVOA 16(R12),X2 - MOVOA 32(R12),X3 + MOVQ R9,352(SP) + MOVOA 48(SP),X0 + MOVOA 0(SP),X1 + MOVOA 16(SP),X2 + MOVOA 32(SP),X3 MOVOA X1,X4 MOVQ $20,CX MAINLOOP2: @@ -789,10 +791,10 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment PSHUFL $0X39,X3,X3 PXOR X6,X0 JA MAINLOOP2 - PADDL 48(R12),X0 - PADDL 0(R12),X1 - PADDL 16(R12),X2 - PADDL 32(R12),X3 + PADDL 48(SP),X0 + PADDL 0(SP),X1 + PADDL 16(SP),X2 + PADDL 32(SP),X3 MOVD X0,CX MOVD X1,R8 MOVD X2,R9 @@ -853,16 +855,16 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment MOVL R8,44(DI) MOVL R9,28(DI) MOVL AX,12(DI) - MOVQ 352(R12),R9 - MOVL 16(R12),CX - MOVL 36 (R12),R8 + MOVQ 352(SP),R9 + MOVL 16(SP),CX + MOVL 36 (SP),R8 ADDQ $1,CX SHLQ $32,R8 ADDQ R8,CX MOVQ CX,R8 SHRQ $32,R8 - MOVL CX,16(R12) - MOVL R8, 36 (R12) + MOVL CX,16(SP) + MOVL R8, 36 (SP) CMPQ R9,$64 JA BYTESATLEAST65 JAE BYTESATLEAST64 @@ -872,6 +874,7 @@ TEXT ·salsa2020XORKeyStream(SB),0,$456-40 // frame = 424 + 32 byte alignment REP; MOVSB BYTESATLEAST64: DONE: + MOVQ R12,SP RET BYTESATLEAST65: SUBQ $64,R9 diff --git a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go index 4392cc1ac7..24f03c146b 100644 --- a/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go +++ b/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !amd64 || purego || !gc // +build !amd64 purego !gc package salsa diff --git a/vendor/golang.org/x/mod/LICENSE b/vendor/golang.org/x/mod/LICENSE new file mode 100644 index 0000000000..6a66aea5ea --- /dev/null +++ b/vendor/golang.org/x/mod/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/mod/PATENTS b/vendor/golang.org/x/mod/PATENTS new file mode 100644 index 0000000000..733099041f --- /dev/null +++ b/vendor/golang.org/x/mod/PATENTS @@ -0,0 +1,22 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the Go project. + +Google hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable (except as stated in this section) +patent license to make, have made, use, offer to sell, sell, import, +transfer and otherwise run, modify and propagate the contents of this +implementation of Go, where such license applies only to those patent +claims, both currently owned or controlled by Google and acquired in +the future, licensable by Google that are necessarily infringed by this +implementation of Go. This grant does not include claims that would be +infringed only as a consequence of further modification of this +implementation. If you or your agent or exclusive licensee institute or +order or agree to the institution of patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging +that this implementation of Go or any code incorporated within this +implementation of Go constitutes direct or contributory patent +infringement, or inducement of patent infringement, then any patent +rights granted to you under this License for this implementation of Go +shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/mod/semver/semver.go b/vendor/golang.org/x/mod/semver/semver.go new file mode 100644 index 0000000000..4338f35177 --- /dev/null +++ b/vendor/golang.org/x/mod/semver/semver.go @@ -0,0 +1,391 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package semver implements comparison of semantic version strings. +// In this package, semantic version strings must begin with a leading "v", +// as in "v1.0.0". +// +// The general form of a semantic version string accepted by this package is +// +// vMAJOR[.MINOR[.PATCH[-PRERELEASE][+BUILD]]] +// +// where square brackets indicate optional parts of the syntax; +// MAJOR, MINOR, and PATCH are decimal integers without extra leading zeros; +// PRERELEASE and BUILD are each a series of non-empty dot-separated identifiers +// using only alphanumeric characters and hyphens; and +// all-numeric PRERELEASE identifiers must not have leading zeros. +// +// This package follows Semantic Versioning 2.0.0 (see semver.org) +// with two exceptions. First, it requires the "v" prefix. Second, it recognizes +// vMAJOR and vMAJOR.MINOR (with no prerelease or build suffixes) +// as shorthands for vMAJOR.0.0 and vMAJOR.MINOR.0. +package semver + +// parsed returns the parsed form of a semantic version string. +type parsed struct { + major string + minor string + patch string + short string + prerelease string + build string + err string +} + +// IsValid reports whether v is a valid semantic version string. +func IsValid(v string) bool { + _, ok := parse(v) + return ok +} + +// Canonical returns the canonical formatting of the semantic version v. +// It fills in any missing .MINOR or .PATCH and discards build metadata. +// Two semantic versions compare equal only if their canonical formattings +// are identical strings. +// The canonical invalid semantic version is the empty string. +func Canonical(v string) string { + p, ok := parse(v) + if !ok { + return "" + } + if p.build != "" { + return v[:len(v)-len(p.build)] + } + if p.short != "" { + return v + p.short + } + return v +} + +// Major returns the major version prefix of the semantic version v. +// For example, Major("v2.1.0") == "v2". +// If v is an invalid semantic version string, Major returns the empty string. +func Major(v string) string { + pv, ok := parse(v) + if !ok { + return "" + } + return v[:1+len(pv.major)] +} + +// MajorMinor returns the major.minor version prefix of the semantic version v. +// For example, MajorMinor("v2.1.0") == "v2.1". +// If v is an invalid semantic version string, MajorMinor returns the empty string. +func MajorMinor(v string) string { + pv, ok := parse(v) + if !ok { + return "" + } + i := 1 + len(pv.major) + if j := i + 1 + len(pv.minor); j <= len(v) && v[i] == '.' && v[i+1:j] == pv.minor { + return v[:j] + } + return v[:i] + "." + pv.minor +} + +// Prerelease returns the prerelease suffix of the semantic version v. +// For example, Prerelease("v2.1.0-pre+meta") == "-pre". +// If v is an invalid semantic version string, Prerelease returns the empty string. +func Prerelease(v string) string { + pv, ok := parse(v) + if !ok { + return "" + } + return pv.prerelease +} + +// Build returns the build suffix of the semantic version v. +// For example, Build("v2.1.0+meta") == "+meta". +// If v is an invalid semantic version string, Build returns the empty string. +func Build(v string) string { + pv, ok := parse(v) + if !ok { + return "" + } + return pv.build +} + +// Compare returns an integer comparing two versions according to +// semantic version precedence. +// The result will be 0 if v == w, -1 if v < w, or +1 if v > w. +// +// An invalid semantic version string is considered less than a valid one. +// All invalid semantic version strings compare equal to each other. +func Compare(v, w string) int { + pv, ok1 := parse(v) + pw, ok2 := parse(w) + if !ok1 && !ok2 { + return 0 + } + if !ok1 { + return -1 + } + if !ok2 { + return +1 + } + if c := compareInt(pv.major, pw.major); c != 0 { + return c + } + if c := compareInt(pv.minor, pw.minor); c != 0 { + return c + } + if c := compareInt(pv.patch, pw.patch); c != 0 { + return c + } + return comparePrerelease(pv.prerelease, pw.prerelease) +} + +// Max canonicalizes its arguments and then returns the version string +// that compares greater. +// +// Deprecated: use Compare instead. In most cases, returning a canonicalized +// version is not expected or desired. +func Max(v, w string) string { + v = Canonical(v) + w = Canonical(w) + if Compare(v, w) > 0 { + return v + } + return w +} + +func parse(v string) (p parsed, ok bool) { + if v == "" || v[0] != 'v' { + p.err = "missing v prefix" + return + } + p.major, v, ok = parseInt(v[1:]) + if !ok { + p.err = "bad major version" + return + } + if v == "" { + p.minor = "0" + p.patch = "0" + p.short = ".0.0" + return + } + if v[0] != '.' { + p.err = "bad minor prefix" + ok = false + return + } + p.minor, v, ok = parseInt(v[1:]) + if !ok { + p.err = "bad minor version" + return + } + if v == "" { + p.patch = "0" + p.short = ".0" + return + } + if v[0] != '.' { + p.err = "bad patch prefix" + ok = false + return + } + p.patch, v, ok = parseInt(v[1:]) + if !ok { + p.err = "bad patch version" + return + } + if len(v) > 0 && v[0] == '-' { + p.prerelease, v, ok = parsePrerelease(v) + if !ok { + p.err = "bad prerelease" + return + } + } + if len(v) > 0 && v[0] == '+' { + p.build, v, ok = parseBuild(v) + if !ok { + p.err = "bad build" + return + } + } + if v != "" { + p.err = "junk on end" + ok = false + return + } + ok = true + return +} + +func parseInt(v string) (t, rest string, ok bool) { + if v == "" { + return + } + if v[0] < '0' || '9' < v[0] { + return + } + i := 1 + for i < len(v) && '0' <= v[i] && v[i] <= '9' { + i++ + } + if v[0] == '0' && i != 1 { + return + } + return v[:i], v[i:], true +} + +func parsePrerelease(v string) (t, rest string, ok bool) { + // "A pre-release version MAY be denoted by appending a hyphen and + // a series of dot separated identifiers immediately following the patch version. + // Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. + // Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes." + if v == "" || v[0] != '-' { + return + } + i := 1 + start := 1 + for i < len(v) && v[i] != '+' { + if !isIdentChar(v[i]) && v[i] != '.' { + return + } + if v[i] == '.' { + if start == i || isBadNum(v[start:i]) { + return + } + start = i + 1 + } + i++ + } + if start == i || isBadNum(v[start:i]) { + return + } + return v[:i], v[i:], true +} + +func parseBuild(v string) (t, rest string, ok bool) { + if v == "" || v[0] != '+' { + return + } + i := 1 + start := 1 + for i < len(v) { + if !isIdentChar(v[i]) && v[i] != '.' { + return + } + if v[i] == '.' { + if start == i { + return + } + start = i + 1 + } + i++ + } + if start == i { + return + } + return v[:i], v[i:], true +} + +func isIdentChar(c byte) bool { + return 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' || c == '-' +} + +func isBadNum(v string) bool { + i := 0 + for i < len(v) && '0' <= v[i] && v[i] <= '9' { + i++ + } + return i == len(v) && i > 1 && v[0] == '0' +} + +func isNum(v string) bool { + i := 0 + for i < len(v) && '0' <= v[i] && v[i] <= '9' { + i++ + } + return i == len(v) +} + +func compareInt(x, y string) int { + if x == y { + return 0 + } + if len(x) < len(y) { + return -1 + } + if len(x) > len(y) { + return +1 + } + if x < y { + return -1 + } else { + return +1 + } +} + +func comparePrerelease(x, y string) int { + // "When major, minor, and patch are equal, a pre-release version has + // lower precedence than a normal version. + // Example: 1.0.0-alpha < 1.0.0. + // Precedence for two pre-release versions with the same major, minor, + // and patch version MUST be determined by comparing each dot separated + // identifier from left to right until a difference is found as follows: + // identifiers consisting of only digits are compared numerically and + // identifiers with letters or hyphens are compared lexically in ASCII + // sort order. Numeric identifiers always have lower precedence than + // non-numeric identifiers. A larger set of pre-release fields has a + // higher precedence than a smaller set, if all of the preceding + // identifiers are equal. + // Example: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < + // 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0." + if x == y { + return 0 + } + if x == "" { + return +1 + } + if y == "" { + return -1 + } + for x != "" && y != "" { + x = x[1:] // skip - or . + y = y[1:] // skip - or . + var dx, dy string + dx, x = nextIdent(x) + dy, y = nextIdent(y) + if dx != dy { + ix := isNum(dx) + iy := isNum(dy) + if ix != iy { + if ix { + return -1 + } else { + return +1 + } + } + if ix { + if len(dx) < len(dy) { + return -1 + } + if len(dx) > len(dy) { + return +1 + } + } + if dx < dy { + return -1 + } else { + return +1 + } + } + } + if x == "" { + return -1 + } else { + return +1 + } +} + +func nextIdent(x string) (dx, rest string) { + i := 0 + for i < len(x) && x[i] != '.' { + i++ + } + return x[:i], x[i:] +} diff --git a/vendor/golang.org/x/net/context/go17.go b/vendor/golang.org/x/net/context/go17.go index 344bd14334..d20f52b7de 100644 --- a/vendor/golang.org/x/net/context/go17.go +++ b/vendor/golang.org/x/net/context/go17.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.7 // +build go1.7 package context diff --git a/vendor/golang.org/x/net/context/go19.go b/vendor/golang.org/x/net/context/go19.go index 64d31ecc3e..d88bd1db12 100644 --- a/vendor/golang.org/x/net/context/go19.go +++ b/vendor/golang.org/x/net/context/go19.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.9 // +build go1.9 package context diff --git a/vendor/golang.org/x/net/context/pre_go17.go b/vendor/golang.org/x/net/context/pre_go17.go index 5270db5db7..0f35592df5 100644 --- a/vendor/golang.org/x/net/context/pre_go17.go +++ b/vendor/golang.org/x/net/context/pre_go17.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !go1.7 // +build !go1.7 package context diff --git a/vendor/golang.org/x/net/context/pre_go19.go b/vendor/golang.org/x/net/context/pre_go19.go index 1f9715341f..b105f80be4 100644 --- a/vendor/golang.org/x/net/context/pre_go19.go +++ b/vendor/golang.org/x/net/context/pre_go19.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !go1.9 // +build !go1.9 package context diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr.go b/vendor/golang.org/x/net/internal/socket/cmsghdr.go index 4bdaaaf1ad..0a73e277e0 100644 --- a/vendor/golang.org/x/net/internal/socket/cmsghdr.go +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package socket diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_bsd.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_bsd.go index 0d30e0a0f2..14dbb3ad42 100644 --- a/vendor/golang.org/x/net/internal/socket/cmsghdr_bsd.go +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_bsd.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || netbsd || openbsd // +build aix darwin dragonfly freebsd netbsd openbsd package socket diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_32bit.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_32bit.go index 623cf30f4c..bac66811dd 100644 --- a/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_32bit.go +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_32bit.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (arm || mips || mipsle || 386) && linux // +build arm mips mipsle 386 // +build linux diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_64bit.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_64bit.go index 1ba43101fc..27be0efaca 100644 --- a/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_64bit.go +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_64bit.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (arm64 || amd64 || ppc64 || ppc64le || mips64 || mips64le || riscv64 || s390x) && linux // +build arm64 amd64 ppc64 ppc64le mips64 mips64le riscv64 s390x // +build linux diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_solaris_64bit.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_solaris_64bit.go index d3dbe1b8e0..7dedd430eb 100644 --- a/vendor/golang.org/x/net/internal/socket/cmsghdr_solaris_64bit.go +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_solaris_64bit.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build amd64 && solaris -// +build amd64,solaris +// +build amd64 +// +build solaris package socket diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go index 1d9f2ed625..8328b7d194 100644 --- a/vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris package socket diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_unix.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_unix.go index aa1b06203c..c2b2b6595f 100644 --- a/vendor/golang.org/x/net/internal/socket/cmsghdr_unix.go +++ b/vendor/golang.org/x/net/internal/socket/cmsghdr_unix.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package socket diff --git a/vendor/golang.org/x/net/internal/socket/cmsghdr_zos_s390x.go b/vendor/golang.org/x/net/internal/socket/cmsghdr_zos_s390x.go deleted file mode 100644 index 98be146bc5..0000000000 --- a/vendor/golang.org/x/net/internal/socket/cmsghdr_zos_s390x.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package socket - -import "syscall" - -func (h *cmsghdr) set(l, lvl, typ int) { - h.Len = int32(l) - h.Level = int32(lvl) - h.Type = int32(typ) -} - -func controlHeaderLen() int { - return syscall.CmsgLen(0) -} - -func controlMessageLen(dataLen int) int { - return syscall.CmsgLen(dataLen) -} - -func controlMessageSpace(dataLen int) int { - return syscall.CmsgSpace(dataLen) -} diff --git a/vendor/golang.org/x/net/internal/socket/error_unix.go b/vendor/golang.org/x/net/internal/socket/error_unix.go index 78f4129047..f14872d3d3 100644 --- a/vendor/golang.org/x/net/internal/socket/error_unix.go +++ b/vendor/golang.org/x/net/internal/socket/error_unix.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package socket diff --git a/vendor/golang.org/x/net/internal/socket/iovec_32bit.go b/vendor/golang.org/x/net/internal/socket/iovec_32bit.go index 1f42d034dc..05d6082d14 100644 --- a/vendor/golang.org/x/net/internal/socket/iovec_32bit.go +++ b/vendor/golang.org/x/net/internal/socket/iovec_32bit.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (arm || mips || mipsle || 386) && (darwin || dragonfly || freebsd || linux || netbsd || openbsd) // +build arm mips mipsle 386 // +build darwin dragonfly freebsd linux netbsd openbsd diff --git a/vendor/golang.org/x/net/internal/socket/iovec_64bit.go b/vendor/golang.org/x/net/internal/socket/iovec_64bit.go index 3dc5def2bc..dfeda752be 100644 --- a/vendor/golang.org/x/net/internal/socket/iovec_64bit.go +++ b/vendor/golang.org/x/net/internal/socket/iovec_64bit.go @@ -2,9 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (arm64 || amd64 || ppc64 || ppc64le || mips64 || mips64le || riscv64 || s390x) && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || zos) // +build arm64 amd64 ppc64 ppc64le mips64 mips64le riscv64 s390x -// +build aix darwin dragonfly freebsd linux netbsd openbsd zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd package socket diff --git a/vendor/golang.org/x/net/internal/socket/iovec_solaris_64bit.go b/vendor/golang.org/x/net/internal/socket/iovec_solaris_64bit.go index f7da2bc4d4..8d17a40c40 100644 --- a/vendor/golang.org/x/net/internal/socket/iovec_solaris_64bit.go +++ b/vendor/golang.org/x/net/internal/socket/iovec_solaris_64bit.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build amd64 && solaris -// +build amd64,solaris +// +build amd64 +// +build solaris package socket diff --git a/vendor/golang.org/x/net/internal/socket/iovec_stub.go b/vendor/golang.org/x/net/internal/socket/iovec_stub.go index 14caf52483..a746e90e30 100644 --- a/vendor/golang.org/x/net/internal/socket/iovec_stub.go +++ b/vendor/golang.org/x/net/internal/socket/iovec_stub.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris package socket diff --git a/vendor/golang.org/x/net/internal/socket/mmsghdr_stub.go b/vendor/golang.org/x/net/internal/socket/mmsghdr_stub.go index 113e773cd5..1a7f2792f2 100644 --- a/vendor/golang.org/x/net/internal/socket/mmsghdr_stub.go +++ b/vendor/golang.org/x/net/internal/socket/mmsghdr_stub.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !linux && !netbsd // +build !aix,!linux,!netbsd package socket diff --git a/vendor/golang.org/x/net/internal/socket/mmsghdr_unix.go b/vendor/golang.org/x/net/internal/socket/mmsghdr_unix.go index 5025a0f75a..f1100683a5 100644 --- a/vendor/golang.org/x/net/internal/socket/mmsghdr_unix.go +++ b/vendor/golang.org/x/net/internal/socket/mmsghdr_unix.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || linux || netbsd // +build aix linux netbsd package socket diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_bsd.go b/vendor/golang.org/x/net/internal/socket/msghdr_bsd.go index 25f6847f99..77f44c1f12 100644 --- a/vendor/golang.org/x/net/internal/socket/msghdr_bsd.go +++ b/vendor/golang.org/x/net/internal/socket/msghdr_bsd.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || netbsd || openbsd // +build aix darwin dragonfly freebsd netbsd openbsd package socket diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_bsdvar.go b/vendor/golang.org/x/net/internal/socket/msghdr_bsdvar.go index 5b8e00f1cd..c5562dd66a 100644 --- a/vendor/golang.org/x/net/internal/socket/msghdr_bsdvar.go +++ b/vendor/golang.org/x/net/internal/socket/msghdr_bsdvar.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || netbsd // +build aix darwin dragonfly freebsd netbsd package socket diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_linux_32bit.go b/vendor/golang.org/x/net/internal/socket/msghdr_linux_32bit.go index 2e09e26699..a7a5987c88 100644 --- a/vendor/golang.org/x/net/internal/socket/msghdr_linux_32bit.go +++ b/vendor/golang.org/x/net/internal/socket/msghdr_linux_32bit.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (arm || mips || mipsle || 386) && linux // +build arm mips mipsle 386 // +build linux diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_linux_64bit.go b/vendor/golang.org/x/net/internal/socket/msghdr_linux_64bit.go index c9c592ddb8..e731833a26 100644 --- a/vendor/golang.org/x/net/internal/socket/msghdr_linux_64bit.go +++ b/vendor/golang.org/x/net/internal/socket/msghdr_linux_64bit.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (arm64 || amd64 || ppc64 || ppc64le || mips64 || mips64le || riscv64 || s390x) && linux // +build arm64 amd64 ppc64 ppc64le mips64 mips64le riscv64 s390x // +build linux diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_solaris_64bit.go b/vendor/golang.org/x/net/internal/socket/msghdr_solaris_64bit.go index 3098f5d783..6465b20732 100644 --- a/vendor/golang.org/x/net/internal/socket/msghdr_solaris_64bit.go +++ b/vendor/golang.org/x/net/internal/socket/msghdr_solaris_64bit.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build amd64 && solaris -// +build amd64,solaris +// +build amd64 +// +build solaris package socket diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_stub.go b/vendor/golang.org/x/net/internal/socket/msghdr_stub.go index eb79151f6a..873490a7ae 100644 --- a/vendor/golang.org/x/net/internal/socket/msghdr_stub.go +++ b/vendor/golang.org/x/net/internal/socket/msghdr_stub.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris package socket diff --git a/vendor/golang.org/x/net/internal/socket/msghdr_zos_s390x.go b/vendor/golang.org/x/net/internal/socket/msghdr_zos_s390x.go deleted file mode 100644 index 324e9ee7d1..0000000000 --- a/vendor/golang.org/x/net/internal/socket/msghdr_zos_s390x.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build s390x && zos -// +build s390x,zos - -package socket - -import "unsafe" - -func (h *msghdr) pack(vs []iovec, bs [][]byte, oob []byte, sa []byte) { - for i := range vs { - vs[i].set(bs[i]) - } - if len(vs) > 0 { - h.Iov = &vs[0] - h.Iovlen = int32(len(vs)) - } - if len(oob) > 0 { - h.Control = (*byte)(unsafe.Pointer(&oob[0])) - h.Controllen = uint32(len(oob)) - } - if sa != nil { - h.Name = (*byte)(unsafe.Pointer(&sa[0])) - h.Namelen = uint32(len(sa)) - } -} - -func (h *msghdr) controllen() int { - return int(h.Controllen) -} - -func (h *msghdr) flags() int { - return int(h.Flags) -} diff --git a/vendor/golang.org/x/net/internal/socket/norace.go b/vendor/golang.org/x/net/internal/socket/norace.go index de0ad420fc..9519ffbba4 100644 --- a/vendor/golang.org/x/net/internal/socket/norace.go +++ b/vendor/golang.org/x/net/internal/socket/norace.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !race // +build !race package socket diff --git a/vendor/golang.org/x/net/internal/socket/race.go b/vendor/golang.org/x/net/internal/socket/race.go index f0a28a625d..df60c62fff 100644 --- a/vendor/golang.org/x/net/internal/socket/race.go +++ b/vendor/golang.org/x/net/internal/socket/race.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build race // +build race package socket diff --git a/vendor/golang.org/x/net/internal/socket/rawconn.go b/vendor/golang.org/x/net/internal/socket/rawconn.go index 87e81071c1..b07b890050 100644 --- a/vendor/golang.org/x/net/internal/socket/rawconn.go +++ b/vendor/golang.org/x/net/internal/socket/rawconn.go @@ -17,45 +17,18 @@ type Conn struct { c syscall.RawConn } -// tcpConn is an interface implemented by net.TCPConn. -// It can be used for interface assertions to check if a net.Conn is a TCP connection. -type tcpConn interface { - SyscallConn() (syscall.RawConn, error) - SetLinger(int) error -} - -var _ tcpConn = (*net.TCPConn)(nil) - -// udpConn is an interface implemented by net.UDPConn. -// It can be used for interface assertions to check if a net.Conn is a UDP connection. -type udpConn interface { - SyscallConn() (syscall.RawConn, error) - ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *net.UDPAddr, err error) -} - -var _ udpConn = (*net.UDPConn)(nil) - -// ipConn is an interface implemented by net.IPConn. -// It can be used for interface assertions to check if a net.Conn is an IP connection. -type ipConn interface { - SyscallConn() (syscall.RawConn, error) - ReadMsgIP(b, oob []byte) (n, oobn, flags int, addr *net.IPAddr, err error) -} - -var _ ipConn = (*net.IPConn)(nil) - // NewConn returns a new raw connection. func NewConn(c net.Conn) (*Conn, error) { var err error var cc Conn switch c := c.(type) { - case tcpConn: + case *net.TCPConn: cc.network = "tcp" cc.c, err = c.SyscallConn() - case udpConn: + case *net.UDPConn: cc.network = "udp" cc.c, err = c.SyscallConn() - case ipConn: + case *net.IPConn: cc.network = "ip" cc.c, err = c.SyscallConn() default: diff --git a/vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go b/vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go index 5d90de1183..d01fc4c7da 100644 --- a/vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go +++ b/vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build linux // +build linux package socket diff --git a/vendor/golang.org/x/net/internal/socket/rawconn_msg.go b/vendor/golang.org/x/net/internal/socket/rawconn_msg.go index dfed9a8da3..d5ae3f8e14 100644 --- a/vendor/golang.org/x/net/internal/socket/rawconn_msg.go +++ b/vendor/golang.org/x/net/internal/socket/rawconn_msg.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || windows || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows package socket @@ -25,7 +24,7 @@ func (c *Conn) recvMsg(m *Message, flags int) error { var n int fn := func(s uintptr) bool { n, operr = recvmsg(s, &h, flags) - if operr == syscall.EAGAIN || operr == syscall.EWOULDBLOCK { + if operr == syscall.EAGAIN { return false } return true @@ -62,7 +61,7 @@ func (c *Conn) sendMsg(m *Message, flags int) error { var n int fn := func(s uintptr) bool { n, operr = sendmsg(s, &h, flags) - if operr == syscall.EAGAIN || operr == syscall.EWOULDBLOCK { + if operr == syscall.EAGAIN { return false } return true diff --git a/vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go b/vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go index 02f3285566..fe5bb942ba 100644 --- a/vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go +++ b/vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !linux // +build !linux package socket diff --git a/vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go b/vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go index dd785877b6..b8cea6fe53 100644 --- a/vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go +++ b/vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows package socket diff --git a/vendor/golang.org/x/net/internal/socket/sys_bsd.go b/vendor/golang.org/x/net/internal/socket/sys_bsd.go index b6cd77088d..d432835b41 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_bsd.go +++ b/vendor/golang.org/x/net/internal/socket/sys_bsd.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || openbsd // +build aix darwin dragonfly freebsd openbsd package socket diff --git a/vendor/golang.org/x/net/internal/socket/sys_const_unix.go b/vendor/golang.org/x/net/internal/socket/sys_const_unix.go index f077b2f11f..43797d6e53 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_const_unix.go +++ b/vendor/golang.org/x/net/internal/socket/sys_const_unix.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package socket diff --git a/vendor/golang.org/x/net/internal/socket/sys_const_zos.go b/vendor/golang.org/x/net/internal/socket/sys_const_zos.go deleted file mode 100644 index 3048629541..0000000000 --- a/vendor/golang.org/x/net/internal/socket/sys_const_zos.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build zos -// +build zos - -package socket - -import "syscall" - -const ( - sysAF_UNSPEC = syscall.AF_UNSPEC - sysAF_INET = syscall.AF_INET - sysAF_INET6 = syscall.AF_INET6 - - sysSOCK_RAW = syscall.SOCK_RAW -) diff --git a/vendor/golang.org/x/net/internal/socket/sys_linkname.go b/vendor/golang.org/x/net/internal/socket/sys_linkname.go index 21734af4b8..61c3f38a51 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_linkname.go +++ b/vendor/golang.org/x/net/internal/socket/sys_linkname.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || (go1.12 && darwin) // +build aix go1.12,darwin package socket diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux.go b/vendor/golang.org/x/net/internal/socket/sys_linux.go index 76f5b8ae5d..8b03cd6dec 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_linux.go +++ b/vendor/golang.org/x/net/internal/socket/sys_linux.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build linux && !s390x && !386 // +build linux,!s390x,!386 package socket diff --git a/vendor/golang.org/x/net/internal/socket/sys_linux_riscv64.go b/vendor/golang.org/x/net/internal/socket/sys_linux_riscv64.go index 5b128fbb2a..64f69f1dc5 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_linux_riscv64.go +++ b/vendor/golang.org/x/net/internal/socket/sys_linux_riscv64.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build riscv64 // +build riscv64 package socket diff --git a/vendor/golang.org/x/net/internal/socket/sys_posix.go b/vendor/golang.org/x/net/internal/socket/sys_posix.go index 25ded21763..22eae809c9 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_posix.go +++ b/vendor/golang.org/x/net/internal/socket/sys_posix.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || windows || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows package socket diff --git a/vendor/golang.org/x/net/internal/socket/sys_stub.go b/vendor/golang.org/x/net/internal/socket/sys_stub.go index dc7bb389b3..8e1e07427b 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_stub.go +++ b/vendor/golang.org/x/net/internal/socket/sys_stub.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows package socket diff --git a/vendor/golang.org/x/net/internal/socket/sys_unix.go b/vendor/golang.org/x/net/internal/socket/sys_unix.go index c98ebae548..0eb71283f5 100644 --- a/vendor/golang.org/x/net/internal/socket/sys_unix.go +++ b/vendor/golang.org/x/net/internal/socket/sys_unix.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build dragonfly || freebsd || (linux && !s390x && !386) || netbsd || openbsd // +build dragonfly freebsd linux,!s390x,!386 netbsd openbsd package socket diff --git a/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.go b/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.go deleted file mode 100644 index 1e38b92232..0000000000 --- a/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package socket - -import ( - "syscall" - "unsafe" -) - -func syscall_syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) -func syscall_syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) - -func probeProtocolStack() int { - return 4 // sizeof(int) on GOOS=zos GOARCH=s390x -} - -func getsockopt(s uintptr, level, name int, b []byte) (int, error) { - l := uint32(len(b)) - _, _, errno := syscall_syscall6(syscall.SYS_GETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(unsafe.Pointer(&l)), 0) - return int(l), errnoErr(errno) -} - -func setsockopt(s uintptr, level, name int, b []byte) error { - _, _, errno := syscall_syscall6(syscall.SYS_SETSOCKOPT, s, uintptr(level), uintptr(name), uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), 0) - return errnoErr(errno) -} - -func recvmsg(s uintptr, h *msghdr, flags int) (int, error) { - n, _, errno := syscall_syscall(syscall.SYS___RECVMSG_A, s, uintptr(unsafe.Pointer(h)), uintptr(flags)) - return int(n), errnoErr(errno) -} - -func sendmsg(s uintptr, h *msghdr, flags int) (int, error) { - n, _, errno := syscall_syscall(syscall.SYS___SENDMSG_A, s, uintptr(unsafe.Pointer(h)), uintptr(flags)) - return int(n), errnoErr(errno) -} diff --git a/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.s b/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.s deleted file mode 100644 index 60d5839c25..0000000000 --- a/vendor/golang.org/x/net/internal/socket/sys_zos_s390x.s +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -#include "textflag.h" - -TEXT ·syscall_syscall(SB),NOSPLIT,$0 - JMP syscall·_syscall(SB) - -TEXT ·syscall_syscall6(SB),NOSPLIT,$0 - JMP syscall·_syscall6(SB) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go b/vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go index 79f3bdd5b9..93d923ad77 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go @@ -2,7 +2,6 @@ // cgo -godefs defs_aix.go // Added for go1.11 compatibility -//go:build aix // +build aix package socket diff --git a/vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go b/vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go index 12ec2e42b8..8640c03e4d 100644 --- a/vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go +++ b/vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go @@ -1,7 +1,6 @@ // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_linux.go -//go:build riscv64 // +build riscv64 package socket diff --git a/vendor/golang.org/x/net/internal/socket/zsys_openbsd_mips64.go b/vendor/golang.org/x/net/internal/socket/zsys_openbsd_mips64.go deleted file mode 100644 index 0112832400..0000000000 --- a/vendor/golang.org/x/net/internal/socket/zsys_openbsd_mips64.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs defs_openbsd.go - -package socket - -type iovec struct { - Base *byte - Len uint64 -} - -type msghdr struct { - Name *byte - Namelen uint32 - Iov *iovec - Iovlen uint32 - Control *byte - Controllen uint32 - Flags int32 -} - -type cmsghdr struct { - Len uint32 - Level int32 - Type int32 -} - -type sockaddrInet struct { - Len uint8 - Family uint8 - Port uint16 - Addr [4]byte /* in_addr */ - Zero [8]int8 -} - -type sockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte /* in6_addr */ - Scope_id uint32 -} - -const ( - sizeofIovec = 0x10 - sizeofMsghdr = 0x30 - - sizeofSockaddrInet = 0x10 - sizeofSockaddrInet6 = 0x1c -) diff --git a/vendor/golang.org/x/net/internal/socket/zsys_zos_s390x.go b/vendor/golang.org/x/net/internal/socket/zsys_zos_s390x.go deleted file mode 100644 index 514ca3754d..0000000000 --- a/vendor/golang.org/x/net/internal/socket/zsys_zos_s390x.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package socket - -type iovec struct { - Base *byte - Len uint64 -} - -type msghdr struct { - Name *byte - Iov *iovec - Control *byte - Flags int32 - Namelen uint32 - Iovlen int32 - Controllen uint32 -} - -type cmsghdr struct { - Len int32 - Level int32 - Type int32 -} - -const ( - sizeofCmsghdr = 12 - sizeofSockaddrInet = 16 - sizeofSockaddrInet6 = 28 -) diff --git a/vendor/golang.org/x/net/ipv4/control_bsd.go b/vendor/golang.org/x/net/ipv4/control_bsd.go index b7385dfd95..69c4f553cd 100644 --- a/vendor/golang.org/x/net/ipv4/control_bsd.go +++ b/vendor/golang.org/x/net/ipv4/control_bsd.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || netbsd || openbsd // +build aix darwin dragonfly freebsd netbsd openbsd package ipv4 @@ -14,13 +13,11 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" ) func marshalDst(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIP, unix.IP_RECVDSTADDR, net.IPv4len) + m.MarshalHeader(iana.ProtocolIP, sysIP_RECVDSTADDR, net.IPv4len) return m.Next(net.IPv4len) } @@ -33,7 +30,7 @@ func parseDst(cm *ControlMessage, b []byte) { func marshalInterface(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIP, sockoptReceiveInterface, syscall.SizeofSockaddrDatalink) + m.MarshalHeader(iana.ProtocolIP, sysIP_RECVIF, syscall.SizeofSockaddrDatalink) return m.Next(syscall.SizeofSockaddrDatalink) } diff --git a/vendor/golang.org/x/net/ipv4/control_pktinfo.go b/vendor/golang.org/x/net/ipv4/control_pktinfo.go index 0e748dbdc4..425338f35b 100644 --- a/vendor/golang.org/x/net/ipv4/control_pktinfo.go +++ b/vendor/golang.org/x/net/ipv4/control_pktinfo.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build darwin || linux || solaris // +build darwin linux solaris package ipv4 @@ -13,13 +12,11 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" ) func marshalPacketInfo(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIP, unix.IP_PKTINFO, sizeofInetPktinfo) + m.MarshalHeader(iana.ProtocolIP, sysIP_PKTINFO, sizeofInetPktinfo) if cm != nil { pi := (*inetPktinfo)(unsafe.Pointer(&m.Data(sizeofInetPktinfo)[0])) if ip := cm.Src.To4(); ip != nil { diff --git a/vendor/golang.org/x/net/ipv4/control_stub.go b/vendor/golang.org/x/net/ipv4/control_stub.go index f27322c3ed..a0c049d683 100644 --- a/vendor/golang.org/x/net/ipv4/control_stub.go +++ b/vendor/golang.org/x/net/ipv4/control_stub.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/control_unix.go b/vendor/golang.org/x/net/ipv4/control_unix.go index 2413e02f8f..b27fa4903a 100644 --- a/vendor/golang.org/x/net/ipv4/control_unix.go +++ b/vendor/golang.org/x/net/ipv4/control_unix.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package ipv4 @@ -12,8 +11,6 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" ) func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error { @@ -67,7 +64,7 @@ func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) er func marshalTTL(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIP, unix.IP_RECVTTL, 1) + m.MarshalHeader(iana.ProtocolIP, sysIP_RECVTTL, 1) return m.Next(1) } diff --git a/vendor/golang.org/x/net/ipv4/control_zos.go b/vendor/golang.org/x/net/ipv4/control_zos.go deleted file mode 100644 index de11c42e55..0000000000 --- a/vendor/golang.org/x/net/ipv4/control_zos.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -import ( - "net" - "unsafe" - - "golang.org/x/net/internal/iana" - "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" -) - -func marshalPacketInfo(b []byte, cm *ControlMessage) []byte { - m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIP, unix.IP_PKTINFO, sizeofInetPktinfo) - if cm != nil { - pi := (*inetPktinfo)(unsafe.Pointer(&m.Data(sizeofInetPktinfo)[0])) - if ip := cm.Src.To4(); ip != nil { - copy(pi.Addr[:], ip) - } - if cm.IfIndex > 0 { - pi.setIfindex(cm.IfIndex) - } - } - return m.Next(sizeofInetPktinfo) -} - -func parsePacketInfo(cm *ControlMessage, b []byte) { - pi := (*inetPktinfo)(unsafe.Pointer(&b[0])) - cm.IfIndex = int(pi.Ifindex) - if len(cm.Dst) < net.IPv4len { - cm.Dst = make(net.IP, net.IPv4len) - } - copy(cm.Dst, pi.Addr[:]) -} - -func setControlMessage(c *socket.Conn, opt *rawOpt, cf ControlFlags, on bool) error { - opt.Lock() - defer opt.Unlock() - if so, ok := sockOpts[ssoReceiveTTL]; ok && cf&FlagTTL != 0 { - if err := so.SetInt(c, boolint(on)); err != nil { - return err - } - if on { - opt.set(FlagTTL) - } else { - opt.clear(FlagTTL) - } - } - if so, ok := sockOpts[ssoPacketInfo]; ok { - if cf&(FlagSrc|FlagDst|FlagInterface) != 0 { - if err := so.SetInt(c, boolint(on)); err != nil { - return err - } - if on { - opt.set(cf & (FlagSrc | FlagDst | FlagInterface)) - } else { - opt.clear(cf & (FlagSrc | FlagDst | FlagInterface)) - } - } - } else { - if so, ok := sockOpts[ssoReceiveDst]; ok && cf&FlagDst != 0 { - if err := so.SetInt(c, boolint(on)); err != nil { - return err - } - if on { - opt.set(FlagDst) - } else { - opt.clear(FlagDst) - } - } - if so, ok := sockOpts[ssoReceiveInterface]; ok && cf&FlagInterface != 0 { - if err := so.SetInt(c, boolint(on)); err != nil { - return err - } - if on { - opt.set(FlagInterface) - } else { - opt.clear(FlagInterface) - } - } - } - return nil -} diff --git a/vendor/golang.org/x/net/ipv4/icmp_stub.go b/vendor/golang.org/x/net/ipv4/icmp_stub.go index cd4ee6e1c9..21bb29ab36 100644 --- a/vendor/golang.org/x/net/ipv4/icmp_stub.go +++ b/vendor/golang.org/x/net/ipv4/icmp_stub.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !linux // +build !linux package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/payload_cmsg.go b/vendor/golang.org/x/net/ipv4/payload_cmsg.go index 1bb370e25f..e7614661d7 100644 --- a/vendor/golang.org/x/net/ipv4/payload_cmsg.go +++ b/vendor/golang.org/x/net/ipv4/payload_cmsg.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/payload_nocmsg.go b/vendor/golang.org/x/net/ipv4/payload_nocmsg.go index 53f0794eb7..1116256f24 100644 --- a/vendor/golang.org/x/net/ipv4/payload_nocmsg.go +++ b/vendor/golang.org/x/net/ipv4/payload_nocmsg.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sockopt_posix.go b/vendor/golang.org/x/net/ipv4/sockopt_posix.go index eb07c1c02a..dea64519d8 100644 --- a/vendor/golang.org/x/net/ipv4/sockopt_posix.go +++ b/vendor/golang.org/x/net/ipv4/sockopt_posix.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || windows || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sockopt_stub.go b/vendor/golang.org/x/net/ipv4/sockopt_stub.go index cf036893b7..37d4806b34 100644 --- a/vendor/golang.org/x/net/ipv4/sockopt_stub.go +++ b/vendor/golang.org/x/net/ipv4/sockopt_stub.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_aix.go b/vendor/golang.org/x/net/ipv4/sys_aix.go index 02730cdfd2..3d1201e6d7 100644 --- a/vendor/golang.org/x/net/ipv4/sys_aix.go +++ b/vendor/golang.org/x/net/ipv4/sys_aix.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. // Added for go1.11 compatibility -//go:build aix // +build aix package ipv4 @@ -14,31 +13,26 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" ) -// IP_RECVIF is defined on AIX but doesn't work. IP_RECVINTERFACE must be used instead. -const sockoptReceiveInterface = unix.IP_RECVINTERFACE - var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {unix.IP_RECVTTL, 1, marshalTTL, parseTTL}, - ctlDst: {unix.IP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, - ctlInterface: {unix.IP_RECVINTERFACE, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, + ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL}, + ctlDst: {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, + ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, } sockOpts = map[int]*sockOpt{ - ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TOS, Len: 4}}, - ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TTL, Len: 4}}, - ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_TTL, Len: 1}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_LOOP, Len: 1}}, - ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVTTL, Len: 4}}, - ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVDSTADDR, Len: 4}}, - ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVINTERFACE, Len: 4}}, - ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_HDRINCL, Len: 4}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, + ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, + ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, + ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 1}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 1}}, + ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}}, + ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVDSTADDR, Len: 4}}, + ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVIF, Len: 4}}, + ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, } ) diff --git a/vendor/golang.org/x/net/ipv4/sys_asmreq.go b/vendor/golang.org/x/net/ipv4/sys_asmreq.go index 22322b387e..76d670acaa 100644 --- a/vendor/golang.org/x/net/ipv4/sys_asmreq.go +++ b/vendor/golang.org/x/net/ipv4/sys_asmreq.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || netbsd || openbsd || solaris || windows // +build aix darwin dragonfly freebsd netbsd openbsd solaris windows package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_asmreq_stub.go b/vendor/golang.org/x/net/ipv4/sys_asmreq_stub.go index fde640142d..6dc339ce67 100644 --- a/vendor/golang.org/x/net/ipv4/sys_asmreq_stub.go +++ b/vendor/golang.org/x/net/ipv4/sys_asmreq_stub.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !netbsd && !openbsd && !solaris && !windows // +build !aix,!darwin,!dragonfly,!freebsd,!netbsd,!openbsd,!solaris,!windows package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_asmreqn.go b/vendor/golang.org/x/net/ipv4/sys_asmreqn.go index fbfe4af69d..1f24f69f3b 100644 --- a/vendor/golang.org/x/net/ipv4/sys_asmreqn.go +++ b/vendor/golang.org/x/net/ipv4/sys_asmreqn.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build darwin || freebsd || linux // +build darwin freebsd linux package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_asmreqn_stub.go b/vendor/golang.org/x/net/ipv4/sys_asmreqn_stub.go index dcb15f25a5..48ef55624e 100644 --- a/vendor/golang.org/x/net/ipv4/sys_asmreqn_stub.go +++ b/vendor/golang.org/x/net/ipv4/sys_asmreqn_stub.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !darwin && !freebsd && !linux // +build !darwin,!freebsd,!linux package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_bpf.go b/vendor/golang.org/x/net/ipv4/sys_bpf.go index fb11e324e2..5c03dce3b7 100644 --- a/vendor/golang.org/x/net/ipv4/sys_bpf.go +++ b/vendor/golang.org/x/net/ipv4/sys_bpf.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build linux // +build linux package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_bpf_stub.go b/vendor/golang.org/x/net/ipv4/sys_bpf_stub.go index fc53a0d33a..5c98642716 100644 --- a/vendor/golang.org/x/net/ipv4/sys_bpf_stub.go +++ b/vendor/golang.org/x/net/ipv4/sys_bpf_stub.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !linux // +build !linux package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_bsd.go b/vendor/golang.org/x/net/ipv4/sys_bsd.go index e191b2f14f..58256dd9d6 100644 --- a/vendor/golang.org/x/net/ipv4/sys_bsd.go +++ b/vendor/golang.org/x/net/ipv4/sys_bsd.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build netbsd || openbsd // +build netbsd openbsd package ipv4 @@ -13,30 +12,26 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" ) -const sockoptReceiveInterface = unix.IP_RECVIF - var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {unix.IP_RECVTTL, 1, marshalTTL, parseTTL}, - ctlDst: {unix.IP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, - ctlInterface: {unix.IP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, + ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL}, + ctlDst: {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, + ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, } sockOpts = map[int]*sockOpt{ - ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TOS, Len: 4}}, - ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TTL, Len: 4}}, - ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_TTL, Len: 1}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_LOOP, Len: 1}}, - ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVTTL, Len: 4}}, - ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVDSTADDR, Len: 4}}, - ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVIF, Len: 4}}, - ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_HDRINCL, Len: 4}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, + ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, + ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, + ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 1}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 1}}, + ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}}, + ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVDSTADDR, Len: 4}}, + ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVIF, Len: 4}}, + ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, } ) diff --git a/vendor/golang.org/x/net/ipv4/sys_darwin.go b/vendor/golang.org/x/net/ipv4/sys_darwin.go index c5527acf62..ac213c7350 100644 --- a/vendor/golang.org/x/net/ipv4/sys_darwin.go +++ b/vendor/golang.org/x/net/ipv4/sys_darwin.go @@ -11,38 +11,34 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" ) -const sockoptReceiveInterface = unix.IP_RECVIF - var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {unix.IP_RECVTTL, 1, marshalTTL, parseTTL}, - ctlDst: {unix.IP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, - ctlInterface: {unix.IP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, - ctlPacketInfo: {unix.IP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo}, + ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL}, + ctlDst: {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, + ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, + ctlPacketInfo: {sysIP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo}, } sockOpts = map[int]*sockOpt{ - ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TOS, Len: 4}}, - ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TTL, Len: 4}}, - ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_TTL, Len: 1}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: sizeofIPMreqn}, typ: ssoTypeIPMreqn}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVTTL, Len: 4}}, - ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVDSTADDR, Len: 4}}, - ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVIF, Len: 4}}, - ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_HDRINCL, Len: 4}}, - ssoStripHeader: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_STRIPHDR, Len: 4}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoPacketInfo: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVPKTINFO, Len: 4}}, + ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, + ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, + ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 1}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: sizeofIPMreqn}, typ: ssoTypeIPMreqn}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}}, + ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVDSTADDR, Len: 4}}, + ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVIF, Len: 4}}, + ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, + ssoStripHeader: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_STRIPHDR, Len: 4}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoPacketInfo: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVPKTINFO, Len: 4}}, } ) diff --git a/vendor/golang.org/x/net/ipv4/sys_dragonfly.go b/vendor/golang.org/x/net/ipv4/sys_dragonfly.go index 0620d0e1ea..859764f33a 100644 --- a/vendor/golang.org/x/net/ipv4/sys_dragonfly.go +++ b/vendor/golang.org/x/net/ipv4/sys_dragonfly.go @@ -10,30 +10,26 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" ) -const sockoptReceiveInterface = unix.IP_RECVIF - var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {unix.IP_RECVTTL, 1, marshalTTL, parseTTL}, - ctlDst: {unix.IP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, - ctlInterface: {unix.IP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, + ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL}, + ctlDst: {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, + ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, } sockOpts = map[int]*sockOpt{ - ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TOS, Len: 4}}, - ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TTL, Len: 4}}, - ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_TTL, Len: 1}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVTTL, Len: 4}}, - ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVDSTADDR, Len: 4}}, - ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVIF, Len: 4}}, - ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_HDRINCL, Len: 4}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, + ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, + ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, + ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 1}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}}, + ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVDSTADDR, Len: 4}}, + ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVIF, Len: 4}}, + ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, } ) diff --git a/vendor/golang.org/x/net/ipv4/sys_freebsd.go b/vendor/golang.org/x/net/ipv4/sys_freebsd.go index 7457bfde92..482873d9a1 100644 --- a/vendor/golang.org/x/net/ipv4/sys_freebsd.go +++ b/vendor/golang.org/x/net/ipv4/sys_freebsd.go @@ -13,42 +13,38 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" ) -const sockoptReceiveInterface = unix.IP_RECVIF - var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {unix.IP_RECVTTL, 1, marshalTTL, parseTTL}, - ctlDst: {unix.IP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, - ctlInterface: {unix.IP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, + ctlTTL: {sysIP_RECVTTL, 1, marshalTTL, parseTTL}, + ctlDst: {sysIP_RECVDSTADDR, net.IPv4len, marshalDst, parseDst}, + ctlInterface: {sysIP_RECVIF, syscall.SizeofSockaddrDatalink, marshalInterface, parseInterface}, } sockOpts = map[int]*sockOpt{ - ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TOS, Len: 4}}, - ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TTL, Len: 4}}, - ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_TTL, Len: 1}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVTTL, Len: 4}}, - ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVDSTADDR, Len: 4}}, - ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVIF, Len: 4}}, - ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_HDRINCL, Len: 4}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, + ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, + ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 1}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}}, + ssoReceiveDst: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVDSTADDR, Len: 4}}, + ssoReceiveInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVIF, Len: 4}}, + ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, } ) func init() { freebsdVersion, _ = syscall.SysctlUint32("kern.osreldate") if freebsdVersion >= 1000000 { - sockOpts[ssoMulticastInterface] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: sizeofIPMreqn}, typ: ssoTypeIPMreqn} + sockOpts[ssoMulticastInterface] = &sockOpt{Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: sizeofIPMreqn}, typ: ssoTypeIPMreqn} } if runtime.GOOS == "freebsd" && runtime.GOARCH == "386" { archs, _ := syscall.Sysctl("kern.supported_archs") diff --git a/vendor/golang.org/x/net/ipv4/sys_linux.go b/vendor/golang.org/x/net/ipv4/sys_linux.go index a0631ac92e..cf755c7fba 100644 --- a/vendor/golang.org/x/net/ipv4/sys_linux.go +++ b/vendor/golang.org/x/net/ipv4/sys_linux.go @@ -11,32 +11,31 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - "golang.org/x/sys/unix" ) var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {unix.IP_TTL, 1, marshalTTL, parseTTL}, - ctlPacketInfo: {unix.IP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo}, + ctlTTL: {sysIP_TTL, 1, marshalTTL, parseTTL}, + ctlPacketInfo: {sysIP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo}, } sockOpts = map[int]*sockOpt{ - ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TOS, Len: 4}}, - ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TTL, Len: 4}}, - ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_TTL, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: sizeofIPMreqn}, typ: ssoTypeIPMreqn}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVTTL, Len: 4}}, - ssoPacketInfo: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_PKTINFO, Len: 4}}, - ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_HDRINCL, Len: 4}}, - ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolReserved, Name: unix.ICMP_FILTER, Len: sizeofICMPFilter}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, + ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, + ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: sizeofIPMreqn}, typ: ssoTypeIPMreqn}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}}, + ssoPacketInfo: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_PKTINFO, Len: 4}}, + ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, + ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolReserved, Name: sysICMP_FILTER, Len: sizeofICMPFilter}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, ssoAttachFilter: {Option: socket.Option{Level: unix.SOL_SOCKET, Name: unix.SO_ATTACH_FILTER, Len: unix.SizeofSockFprog}}, } ) diff --git a/vendor/golang.org/x/net/ipv4/sys_solaris.go b/vendor/golang.org/x/net/ipv4/sys_solaris.go index 0bb9f3e364..832fef1e2e 100644 --- a/vendor/golang.org/x/net/ipv4/sys_solaris.go +++ b/vendor/golang.org/x/net/ipv4/sys_solaris.go @@ -11,33 +11,29 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" ) -const sockoptReceiveInterface = unix.IP_RECVIF - var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTTL: {unix.IP_RECVTTL, 4, marshalTTL, parseTTL}, - ctlPacketInfo: {unix.IP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo}, + ctlTTL: {sysIP_RECVTTL, 4, marshalTTL, parseTTL}, + ctlPacketInfo: {sysIP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo}, } sockOpts = map[int]sockOpt{ - ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TOS, Len: 4}}, - ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_TTL, Len: 4}}, - ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_TTL, Len: 1}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_LOOP, Len: 1}}, - ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVTTL, Len: 4}}, - ssoPacketInfo: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVPKTINFO, Len: 4}}, - ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_HDRINCL, Len: 4}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, + ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, + ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 1}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 1}}, + ssoReceiveTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVTTL, Len: 4}}, + ssoPacketInfo: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_RECVPKTINFO, Len: 4}}, + ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, } ) diff --git a/vendor/golang.org/x/net/ipv4/sys_ssmreq.go b/vendor/golang.org/x/net/ipv4/sys_ssmreq.go index 6a4e7abf9b..eeced7f313 100644 --- a/vendor/golang.org/x/net/ipv4/sys_ssmreq.go +++ b/vendor/golang.org/x/net/ipv4/sys_ssmreq.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build darwin || freebsd || linux || solaris // +build darwin freebsd linux solaris package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_ssmreq_stub.go b/vendor/golang.org/x/net/ipv4/sys_ssmreq_stub.go index 157159fd50..c0921674b0 100644 --- a/vendor/golang.org/x/net/ipv4/sys_ssmreq_stub.go +++ b/vendor/golang.org/x/net/ipv4/sys_ssmreq_stub.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !darwin && !freebsd && !linux && !solaris // +build !darwin,!freebsd,!linux,!solaris package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_stub.go b/vendor/golang.org/x/net/ipv4/sys_stub.go index d550851658..b9c85b334f 100644 --- a/vendor/golang.org/x/net/ipv4/sys_stub.go +++ b/vendor/golang.org/x/net/ipv4/sys_stub.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows package ipv4 diff --git a/vendor/golang.org/x/net/ipv4/sys_windows.go b/vendor/golang.org/x/net/ipv4/sys_windows.go index c5e950633c..b0913d539c 100644 --- a/vendor/golang.org/x/net/ipv4/sys_windows.go +++ b/vendor/golang.org/x/net/ipv4/sys_windows.go @@ -7,15 +7,34 @@ package ipv4 import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/windows" ) const ( + // See ws2tcpip.h. + sysIP_OPTIONS = 0x1 + sysIP_HDRINCL = 0x2 + sysIP_TOS = 0x3 + sysIP_TTL = 0x4 + sysIP_MULTICAST_IF = 0x9 + sysIP_MULTICAST_TTL = 0xa + sysIP_MULTICAST_LOOP = 0xb + sysIP_ADD_MEMBERSHIP = 0xc + sysIP_DROP_MEMBERSHIP = 0xd + sysIP_DONTFRAGMENT = 0xe + sysIP_ADD_SOURCE_MEMBERSHIP = 0xf + sysIP_DROP_SOURCE_MEMBERSHIP = 0x10 + sysIP_PKTINFO = 0x13 + + sizeofInetPktinfo = 0x8 sizeofIPMreq = 0x8 sizeofIPMreqSource = 0xc ) +type inetPktinfo struct { + Addr [4]byte + Ifindex int32 +} + type ipMreq struct { Multiaddr [4]byte Interface [4]byte @@ -32,13 +51,17 @@ var ( ctlOpts = [ctlMax]ctlOpt{} sockOpts = map[int]*sockOpt{ - ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: windows.IP_TOS, Len: 4}}, - ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: windows.IP_TTL, Len: 4}}, - ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: windows.IP_MULTICAST_TTL, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: windows.IP_MULTICAST_IF, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: windows.IP_MULTICAST_LOOP, Len: 4}}, - ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: windows.IP_HDRINCL, Len: 4}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: windows.IP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: windows.IP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, + ssoTOS: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TOS, Len: 4}}, + ssoTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_TTL, Len: 4}}, + ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_TTL, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_IF, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_MULTICAST_LOOP, Len: 4}}, + ssoHeaderPrepend: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_HDRINCL, Len: 4}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_ADD_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: sysIP_DROP_MEMBERSHIP, Len: sizeofIPMreq}, typ: ssoTypeIPMreq}, } ) + +func (pi *inetPktinfo) setIfindex(i int) { + pi.Ifindex = int32(i) +} diff --git a/vendor/golang.org/x/net/ipv4/sys_zos.go b/vendor/golang.org/x/net/ipv4/sys_zos.go deleted file mode 100644 index be20640987..0000000000 --- a/vendor/golang.org/x/net/ipv4/sys_zos.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv4 - -import ( - "net" - "syscall" - "unsafe" - - "golang.org/x/net/internal/iana" - "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" -) - -var ( - ctlOpts = [ctlMax]ctlOpt{ - ctlPacketInfo: {unix.IP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo}, - } - - sockOpts = map[int]*sockOpt{ - ssoMulticastTTL: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_TTL, Len: 1}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_IF, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_MULTICAST_LOOP, Len: 1}}, - ssoPacketInfo: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.IP_RECVPKTINFO, Len: 4}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIP, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - } -) - -func (pi *inetPktinfo) setIfindex(i int) { - pi.Ifindex = uint32(i) -} - -func (gr *groupReq) setGroup(grp net.IP) { - sa := (*sockaddrInet4)(unsafe.Pointer(&gr.Group)) - sa.Family = syscall.AF_INET - sa.Len = sizeofSockaddrInet4 - copy(sa.Addr[:], grp) -} - -func (gsr *groupSourceReq) setSourceGroup(grp, src net.IP) { - sa := (*sockaddrInet4)(unsafe.Pointer(&gsr.Group)) - sa.Family = syscall.AF_INET - sa.Len = sizeofSockaddrInet4 - copy(sa.Addr[:], grp) - sa = (*sockaddrInet4)(unsafe.Pointer(&gsr.Source)) - sa.Family = syscall.AF_INET - sa.Len = sizeofSockaddrInet4 - copy(sa.Addr[:], src) -} diff --git a/vendor/golang.org/x/net/ipv4/zsys_aix_ppc64.go b/vendor/golang.org/x/net/ipv4/zsys_aix_ppc64.go index b7f2d6e5c1..c741d5c8ea 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_aix_ppc64.go +++ b/vendor/golang.org/x/net/ipv4/zsys_aix_ppc64.go @@ -2,12 +2,28 @@ // cgo -godefs defs_aix.go // Added for go1.11 compatibility -//go:build aix // +build aix package ipv4 const ( + sysIP_OPTIONS = 0x1 + sysIP_HDRINCL = 0x2 + sysIP_TOS = 0x3 + sysIP_TTL = 0x4 + sysIP_RECVOPTS = 0x5 + sysIP_RECVRETOPTS = 0x6 + sysIP_RECVDSTADDR = 0x7 + sysIP_RETOPTS = 0x8 + sysIP_RECVIF = 0x20 + sysIP_RECVTTL = 0x22 + + sysIP_MULTICAST_IF = 0x9 + sysIP_MULTICAST_TTL = 0xa + sysIP_MULTICAST_LOOP = 0xb + sysIP_ADD_MEMBERSHIP = 0xc + sysIP_DROP_MEMBERSHIP = 0xd + sizeofIPMreq = 0x8 ) diff --git a/vendor/golang.org/x/net/ipv4/zsys_darwin.go b/vendor/golang.org/x/net/ipv4/zsys_darwin.go index 9c35f97675..e05a251ba0 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_darwin.go +++ b/vendor/golang.org/x/net/ipv4/zsys_darwin.go @@ -4,6 +4,39 @@ package ipv4 const ( + sysIP_OPTIONS = 0x1 + sysIP_HDRINCL = 0x2 + sysIP_TOS = 0x3 + sysIP_TTL = 0x4 + sysIP_RECVOPTS = 0x5 + sysIP_RECVRETOPTS = 0x6 + sysIP_RECVDSTADDR = 0x7 + sysIP_RETOPTS = 0x8 + sysIP_RECVIF = 0x14 + sysIP_STRIPHDR = 0x17 + sysIP_RECVTTL = 0x18 + sysIP_BOUND_IF = 0x19 + sysIP_PKTINFO = 0x1a + sysIP_RECVPKTINFO = 0x1a + + sysIP_MULTICAST_IF = 0x9 + sysIP_MULTICAST_TTL = 0xa + sysIP_MULTICAST_LOOP = 0xb + sysIP_ADD_MEMBERSHIP = 0xc + sysIP_DROP_MEMBERSHIP = 0xd + sysIP_MULTICAST_VIF = 0xe + sysIP_MULTICAST_IFINDEX = 0x42 + sysIP_ADD_SOURCE_MEMBERSHIP = 0x46 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x47 + sysIP_BLOCK_SOURCE = 0x48 + sysIP_UNBLOCK_SOURCE = 0x49 + sysMCAST_JOIN_GROUP = 0x50 + sysMCAST_LEAVE_GROUP = 0x51 + sysMCAST_JOIN_SOURCE_GROUP = 0x52 + sysMCAST_LEAVE_SOURCE_GROUP = 0x53 + sysMCAST_BLOCK_SOURCE = 0x54 + sysMCAST_UNBLOCK_SOURCE = 0x55 + sizeofSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_dragonfly.go b/vendor/golang.org/x/net/ipv4/zsys_dragonfly.go index 2155df130a..6d65e9fcb8 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_dragonfly.go +++ b/vendor/golang.org/x/net/ipv4/zsys_dragonfly.go @@ -4,6 +4,24 @@ package ipv4 const ( + sysIP_OPTIONS = 0x1 + sysIP_HDRINCL = 0x2 + sysIP_TOS = 0x3 + sysIP_TTL = 0x4 + sysIP_RECVOPTS = 0x5 + sysIP_RECVRETOPTS = 0x6 + sysIP_RECVDSTADDR = 0x7 + sysIP_RETOPTS = 0x8 + sysIP_RECVIF = 0x14 + sysIP_RECVTTL = 0x41 + + sysIP_MULTICAST_IF = 0x9 + sysIP_MULTICAST_TTL = 0xa + sysIP_MULTICAST_LOOP = 0xb + sysIP_MULTICAST_VIF = 0xe + sysIP_ADD_MEMBERSHIP = 0xc + sysIP_DROP_MEMBERSHIP = 0xd + sizeofIPMreq = 0x8 ) diff --git a/vendor/golang.org/x/net/ipv4/zsys_freebsd_386.go b/vendor/golang.org/x/net/ipv4/zsys_freebsd_386.go index b2208a45db..136e2b8f1d 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_freebsd_386.go +++ b/vendor/golang.org/x/net/ipv4/zsys_freebsd_386.go @@ -4,6 +4,40 @@ package ipv4 const ( + sysIP_OPTIONS = 0x1 + sysIP_HDRINCL = 0x2 + sysIP_TOS = 0x3 + sysIP_TTL = 0x4 + sysIP_RECVOPTS = 0x5 + sysIP_RECVRETOPTS = 0x6 + sysIP_RECVDSTADDR = 0x7 + sysIP_SENDSRCADDR = 0x7 + sysIP_RETOPTS = 0x8 + sysIP_RECVIF = 0x14 + sysIP_ONESBCAST = 0x17 + sysIP_BINDANY = 0x18 + sysIP_RECVTTL = 0x41 + sysIP_MINTTL = 0x42 + sysIP_DONTFRAG = 0x43 + sysIP_RECVTOS = 0x44 + + sysIP_MULTICAST_IF = 0x9 + sysIP_MULTICAST_TTL = 0xa + sysIP_MULTICAST_LOOP = 0xb + sysIP_ADD_MEMBERSHIP = 0xc + sysIP_DROP_MEMBERSHIP = 0xd + sysIP_MULTICAST_VIF = 0xe + sysIP_ADD_SOURCE_MEMBERSHIP = 0x46 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x47 + sysIP_BLOCK_SOURCE = 0x48 + sysIP_UNBLOCK_SOURCE = 0x49 + sysMCAST_JOIN_GROUP = 0x50 + sysMCAST_LEAVE_GROUP = 0x51 + sysMCAST_JOIN_SOURCE_GROUP = 0x52 + sysMCAST_LEAVE_SOURCE_GROUP = 0x53 + sysMCAST_BLOCK_SOURCE = 0x54 + sysMCAST_UNBLOCK_SOURCE = 0x55 + sizeofSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 diff --git a/vendor/golang.org/x/net/ipv4/zsys_freebsd_amd64.go b/vendor/golang.org/x/net/ipv4/zsys_freebsd_amd64.go index 6719f19479..4f730f19ef 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_freebsd_amd64.go +++ b/vendor/golang.org/x/net/ipv4/zsys_freebsd_amd64.go @@ -4,6 +4,40 @@ package ipv4 const ( + sysIP_OPTIONS = 0x1 + sysIP_HDRINCL = 0x2 + sysIP_TOS = 0x3 + sysIP_TTL = 0x4 + sysIP_RECVOPTS = 0x5 + sysIP_RECVRETOPTS = 0x6 + sysIP_RECVDSTADDR = 0x7 + sysIP_SENDSRCADDR = 0x7 + sysIP_RETOPTS = 0x8 + sysIP_RECVIF = 0x14 + sysIP_ONESBCAST = 0x17 + sysIP_BINDANY = 0x18 + sysIP_RECVTTL = 0x41 + sysIP_MINTTL = 0x42 + sysIP_DONTFRAG = 0x43 + sysIP_RECVTOS = 0x44 + + sysIP_MULTICAST_IF = 0x9 + sysIP_MULTICAST_TTL = 0xa + sysIP_MULTICAST_LOOP = 0xb + sysIP_ADD_MEMBERSHIP = 0xc + sysIP_DROP_MEMBERSHIP = 0xd + sysIP_MULTICAST_VIF = 0xe + sysIP_ADD_SOURCE_MEMBERSHIP = 0x46 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x47 + sysIP_BLOCK_SOURCE = 0x48 + sysIP_UNBLOCK_SOURCE = 0x49 + sysMCAST_JOIN_GROUP = 0x50 + sysMCAST_LEAVE_GROUP = 0x51 + sysMCAST_JOIN_SOURCE_GROUP = 0x52 + sysMCAST_LEAVE_SOURCE_GROUP = 0x53 + sysMCAST_BLOCK_SOURCE = 0x54 + sysMCAST_UNBLOCK_SOURCE = 0x55 + sizeofSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 diff --git a/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm.go b/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm.go index 6719f19479..4f730f19ef 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm.go +++ b/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm.go @@ -4,6 +4,40 @@ package ipv4 const ( + sysIP_OPTIONS = 0x1 + sysIP_HDRINCL = 0x2 + sysIP_TOS = 0x3 + sysIP_TTL = 0x4 + sysIP_RECVOPTS = 0x5 + sysIP_RECVRETOPTS = 0x6 + sysIP_RECVDSTADDR = 0x7 + sysIP_SENDSRCADDR = 0x7 + sysIP_RETOPTS = 0x8 + sysIP_RECVIF = 0x14 + sysIP_ONESBCAST = 0x17 + sysIP_BINDANY = 0x18 + sysIP_RECVTTL = 0x41 + sysIP_MINTTL = 0x42 + sysIP_DONTFRAG = 0x43 + sysIP_RECVTOS = 0x44 + + sysIP_MULTICAST_IF = 0x9 + sysIP_MULTICAST_TTL = 0xa + sysIP_MULTICAST_LOOP = 0xb + sysIP_ADD_MEMBERSHIP = 0xc + sysIP_DROP_MEMBERSHIP = 0xd + sysIP_MULTICAST_VIF = 0xe + sysIP_ADD_SOURCE_MEMBERSHIP = 0x46 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x47 + sysIP_BLOCK_SOURCE = 0x48 + sysIP_UNBLOCK_SOURCE = 0x49 + sysMCAST_JOIN_GROUP = 0x50 + sysMCAST_LEAVE_GROUP = 0x51 + sysMCAST_JOIN_SOURCE_GROUP = 0x52 + sysMCAST_LEAVE_SOURCE_GROUP = 0x53 + sysMCAST_BLOCK_SOURCE = 0x54 + sysMCAST_UNBLOCK_SOURCE = 0x55 + sizeofSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 diff --git a/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm64.go b/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm64.go index 07a5f5d7e1..ecebf32723 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm64.go +++ b/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm64.go @@ -4,6 +4,40 @@ package ipv4 const ( + sysIP_OPTIONS = 0x1 + sysIP_HDRINCL = 0x2 + sysIP_TOS = 0x3 + sysIP_TTL = 0x4 + sysIP_RECVOPTS = 0x5 + sysIP_RECVRETOPTS = 0x6 + sysIP_RECVDSTADDR = 0x7 + sysIP_SENDSRCADDR = 0x7 + sysIP_RETOPTS = 0x8 + sysIP_RECVIF = 0x14 + sysIP_ONESBCAST = 0x17 + sysIP_BINDANY = 0x18 + sysIP_RECVTTL = 0x41 + sysIP_MINTTL = 0x42 + sysIP_DONTFRAG = 0x43 + sysIP_RECVTOS = 0x44 + + sysIP_MULTICAST_IF = 0x9 + sysIP_MULTICAST_TTL = 0xa + sysIP_MULTICAST_LOOP = 0xb + sysIP_ADD_MEMBERSHIP = 0xc + sysIP_DROP_MEMBERSHIP = 0xd + sysIP_MULTICAST_VIF = 0xe + sysIP_ADD_SOURCE_MEMBERSHIP = 0x46 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x47 + sysIP_BLOCK_SOURCE = 0x48 + sysIP_UNBLOCK_SOURCE = 0x49 + sysMCAST_JOIN_GROUP = 0x50 + sysMCAST_LEAVE_GROUP = 0x51 + sysMCAST_JOIN_SOURCE_GROUP = 0x52 + sysMCAST_LEAVE_SOURCE_GROUP = 0x53 + sysMCAST_BLOCK_SOURCE = 0x54 + sysMCAST_UNBLOCK_SOURCE = 0x55 + sizeofSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_386.go b/vendor/golang.org/x/net/ipv4/zsys_linux_386.go index a8e3c26267..1c7fdfa13a 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_386.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_386.go @@ -4,6 +4,57 @@ package ipv4 const ( + sysIP_TOS = 0x1 + sysIP_TTL = 0x2 + sysIP_HDRINCL = 0x3 + sysIP_OPTIONS = 0x4 + sysIP_ROUTER_ALERT = 0x5 + sysIP_RECVOPTS = 0x6 + sysIP_RETOPTS = 0x7 + sysIP_PKTINFO = 0x8 + sysIP_PKTOPTIONS = 0x9 + sysIP_MTU_DISCOVER = 0xa + sysIP_RECVERR = 0xb + sysIP_RECVTTL = 0xc + sysIP_RECVTOS = 0xd + sysIP_MTU = 0xe + sysIP_FREEBIND = 0xf + sysIP_TRANSPARENT = 0x13 + sysIP_RECVRETOPTS = 0x7 + sysIP_ORIGDSTADDR = 0x14 + sysIP_RECVORIGDSTADDR = 0x14 + sysIP_MINTTL = 0x15 + sysIP_NODEFRAG = 0x16 + sysIP_UNICAST_IF = 0x32 + + sysIP_MULTICAST_IF = 0x20 + sysIP_MULTICAST_TTL = 0x21 + sysIP_MULTICAST_LOOP = 0x22 + sysIP_ADD_MEMBERSHIP = 0x23 + sysIP_DROP_MEMBERSHIP = 0x24 + sysIP_UNBLOCK_SOURCE = 0x25 + sysIP_BLOCK_SOURCE = 0x26 + sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 + sysIP_MSFILTER = 0x29 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIP_MULTICAST_ALL = 0x31 + + sysICMP_FILTER = 0x1 + + sysSO_EE_ORIGIN_NONE = 0x0 + sysSO_EE_ORIGIN_LOCAL = 0x1 + sysSO_EE_ORIGIN_ICMP = 0x2 + sysSO_EE_ORIGIN_ICMP6 = 0x3 + sysSO_EE_ORIGIN_TXSTATUS = 0x4 + sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_amd64.go b/vendor/golang.org/x/net/ipv4/zsys_linux_amd64.go index 7291f96a02..a04e785187 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_amd64.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_amd64.go @@ -4,6 +4,57 @@ package ipv4 const ( + sysIP_TOS = 0x1 + sysIP_TTL = 0x2 + sysIP_HDRINCL = 0x3 + sysIP_OPTIONS = 0x4 + sysIP_ROUTER_ALERT = 0x5 + sysIP_RECVOPTS = 0x6 + sysIP_RETOPTS = 0x7 + sysIP_PKTINFO = 0x8 + sysIP_PKTOPTIONS = 0x9 + sysIP_MTU_DISCOVER = 0xa + sysIP_RECVERR = 0xb + sysIP_RECVTTL = 0xc + sysIP_RECVTOS = 0xd + sysIP_MTU = 0xe + sysIP_FREEBIND = 0xf + sysIP_TRANSPARENT = 0x13 + sysIP_RECVRETOPTS = 0x7 + sysIP_ORIGDSTADDR = 0x14 + sysIP_RECVORIGDSTADDR = 0x14 + sysIP_MINTTL = 0x15 + sysIP_NODEFRAG = 0x16 + sysIP_UNICAST_IF = 0x32 + + sysIP_MULTICAST_IF = 0x20 + sysIP_MULTICAST_TTL = 0x21 + sysIP_MULTICAST_LOOP = 0x22 + sysIP_ADD_MEMBERSHIP = 0x23 + sysIP_DROP_MEMBERSHIP = 0x24 + sysIP_UNBLOCK_SOURCE = 0x25 + sysIP_BLOCK_SOURCE = 0x26 + sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 + sysIP_MSFILTER = 0x29 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIP_MULTICAST_ALL = 0x31 + + sysICMP_FILTER = 0x1 + + sysSO_EE_ORIGIN_NONE = 0x0 + sysSO_EE_ORIGIN_LOCAL = 0x1 + sysSO_EE_ORIGIN_ICMP = 0x2 + sysSO_EE_ORIGIN_ICMP6 = 0x3 + sysSO_EE_ORIGIN_TXSTATUS = 0x4 + sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_arm.go b/vendor/golang.org/x/net/ipv4/zsys_linux_arm.go index a8e3c26267..1c7fdfa13a 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_arm.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_arm.go @@ -4,6 +4,57 @@ package ipv4 const ( + sysIP_TOS = 0x1 + sysIP_TTL = 0x2 + sysIP_HDRINCL = 0x3 + sysIP_OPTIONS = 0x4 + sysIP_ROUTER_ALERT = 0x5 + sysIP_RECVOPTS = 0x6 + sysIP_RETOPTS = 0x7 + sysIP_PKTINFO = 0x8 + sysIP_PKTOPTIONS = 0x9 + sysIP_MTU_DISCOVER = 0xa + sysIP_RECVERR = 0xb + sysIP_RECVTTL = 0xc + sysIP_RECVTOS = 0xd + sysIP_MTU = 0xe + sysIP_FREEBIND = 0xf + sysIP_TRANSPARENT = 0x13 + sysIP_RECVRETOPTS = 0x7 + sysIP_ORIGDSTADDR = 0x14 + sysIP_RECVORIGDSTADDR = 0x14 + sysIP_MINTTL = 0x15 + sysIP_NODEFRAG = 0x16 + sysIP_UNICAST_IF = 0x32 + + sysIP_MULTICAST_IF = 0x20 + sysIP_MULTICAST_TTL = 0x21 + sysIP_MULTICAST_LOOP = 0x22 + sysIP_ADD_MEMBERSHIP = 0x23 + sysIP_DROP_MEMBERSHIP = 0x24 + sysIP_UNBLOCK_SOURCE = 0x25 + sysIP_BLOCK_SOURCE = 0x26 + sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 + sysIP_MSFILTER = 0x29 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIP_MULTICAST_ALL = 0x31 + + sysICMP_FILTER = 0x1 + + sysSO_EE_ORIGIN_NONE = 0x0 + sysSO_EE_ORIGIN_LOCAL = 0x1 + sysSO_EE_ORIGIN_ICMP = 0x2 + sysSO_EE_ORIGIN_ICMP6 = 0x3 + sysSO_EE_ORIGIN_TXSTATUS = 0x4 + sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_arm64.go b/vendor/golang.org/x/net/ipv4/zsys_linux_arm64.go index 7291f96a02..a04e785187 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_arm64.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_arm64.go @@ -4,6 +4,57 @@ package ipv4 const ( + sysIP_TOS = 0x1 + sysIP_TTL = 0x2 + sysIP_HDRINCL = 0x3 + sysIP_OPTIONS = 0x4 + sysIP_ROUTER_ALERT = 0x5 + sysIP_RECVOPTS = 0x6 + sysIP_RETOPTS = 0x7 + sysIP_PKTINFO = 0x8 + sysIP_PKTOPTIONS = 0x9 + sysIP_MTU_DISCOVER = 0xa + sysIP_RECVERR = 0xb + sysIP_RECVTTL = 0xc + sysIP_RECVTOS = 0xd + sysIP_MTU = 0xe + sysIP_FREEBIND = 0xf + sysIP_TRANSPARENT = 0x13 + sysIP_RECVRETOPTS = 0x7 + sysIP_ORIGDSTADDR = 0x14 + sysIP_RECVORIGDSTADDR = 0x14 + sysIP_MINTTL = 0x15 + sysIP_NODEFRAG = 0x16 + sysIP_UNICAST_IF = 0x32 + + sysIP_MULTICAST_IF = 0x20 + sysIP_MULTICAST_TTL = 0x21 + sysIP_MULTICAST_LOOP = 0x22 + sysIP_ADD_MEMBERSHIP = 0x23 + sysIP_DROP_MEMBERSHIP = 0x24 + sysIP_UNBLOCK_SOURCE = 0x25 + sysIP_BLOCK_SOURCE = 0x26 + sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 + sysIP_MSFILTER = 0x29 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIP_MULTICAST_ALL = 0x31 + + sysICMP_FILTER = 0x1 + + sysSO_EE_ORIGIN_NONE = 0x0 + sysSO_EE_ORIGIN_LOCAL = 0x1 + sysSO_EE_ORIGIN_ICMP = 0x2 + sysSO_EE_ORIGIN_ICMP6 = 0x3 + sysSO_EE_ORIGIN_TXSTATUS = 0x4 + sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_mips.go b/vendor/golang.org/x/net/ipv4/zsys_linux_mips.go index a8e3c26267..1c7fdfa13a 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_mips.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_mips.go @@ -4,6 +4,57 @@ package ipv4 const ( + sysIP_TOS = 0x1 + sysIP_TTL = 0x2 + sysIP_HDRINCL = 0x3 + sysIP_OPTIONS = 0x4 + sysIP_ROUTER_ALERT = 0x5 + sysIP_RECVOPTS = 0x6 + sysIP_RETOPTS = 0x7 + sysIP_PKTINFO = 0x8 + sysIP_PKTOPTIONS = 0x9 + sysIP_MTU_DISCOVER = 0xa + sysIP_RECVERR = 0xb + sysIP_RECVTTL = 0xc + sysIP_RECVTOS = 0xd + sysIP_MTU = 0xe + sysIP_FREEBIND = 0xf + sysIP_TRANSPARENT = 0x13 + sysIP_RECVRETOPTS = 0x7 + sysIP_ORIGDSTADDR = 0x14 + sysIP_RECVORIGDSTADDR = 0x14 + sysIP_MINTTL = 0x15 + sysIP_NODEFRAG = 0x16 + sysIP_UNICAST_IF = 0x32 + + sysIP_MULTICAST_IF = 0x20 + sysIP_MULTICAST_TTL = 0x21 + sysIP_MULTICAST_LOOP = 0x22 + sysIP_ADD_MEMBERSHIP = 0x23 + sysIP_DROP_MEMBERSHIP = 0x24 + sysIP_UNBLOCK_SOURCE = 0x25 + sysIP_BLOCK_SOURCE = 0x26 + sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 + sysIP_MSFILTER = 0x29 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIP_MULTICAST_ALL = 0x31 + + sysICMP_FILTER = 0x1 + + sysSO_EE_ORIGIN_NONE = 0x0 + sysSO_EE_ORIGIN_LOCAL = 0x1 + sysSO_EE_ORIGIN_ICMP = 0x2 + sysSO_EE_ORIGIN_ICMP6 = 0x3 + sysSO_EE_ORIGIN_TXSTATUS = 0x4 + sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_mips64.go b/vendor/golang.org/x/net/ipv4/zsys_linux_mips64.go index 7291f96a02..a04e785187 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_mips64.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_mips64.go @@ -4,6 +4,57 @@ package ipv4 const ( + sysIP_TOS = 0x1 + sysIP_TTL = 0x2 + sysIP_HDRINCL = 0x3 + sysIP_OPTIONS = 0x4 + sysIP_ROUTER_ALERT = 0x5 + sysIP_RECVOPTS = 0x6 + sysIP_RETOPTS = 0x7 + sysIP_PKTINFO = 0x8 + sysIP_PKTOPTIONS = 0x9 + sysIP_MTU_DISCOVER = 0xa + sysIP_RECVERR = 0xb + sysIP_RECVTTL = 0xc + sysIP_RECVTOS = 0xd + sysIP_MTU = 0xe + sysIP_FREEBIND = 0xf + sysIP_TRANSPARENT = 0x13 + sysIP_RECVRETOPTS = 0x7 + sysIP_ORIGDSTADDR = 0x14 + sysIP_RECVORIGDSTADDR = 0x14 + sysIP_MINTTL = 0x15 + sysIP_NODEFRAG = 0x16 + sysIP_UNICAST_IF = 0x32 + + sysIP_MULTICAST_IF = 0x20 + sysIP_MULTICAST_TTL = 0x21 + sysIP_MULTICAST_LOOP = 0x22 + sysIP_ADD_MEMBERSHIP = 0x23 + sysIP_DROP_MEMBERSHIP = 0x24 + sysIP_UNBLOCK_SOURCE = 0x25 + sysIP_BLOCK_SOURCE = 0x26 + sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 + sysIP_MSFILTER = 0x29 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIP_MULTICAST_ALL = 0x31 + + sysICMP_FILTER = 0x1 + + sysSO_EE_ORIGIN_NONE = 0x0 + sysSO_EE_ORIGIN_LOCAL = 0x1 + sysSO_EE_ORIGIN_ICMP = 0x2 + sysSO_EE_ORIGIN_ICMP6 = 0x3 + sysSO_EE_ORIGIN_TXSTATUS = 0x4 + sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_mips64le.go b/vendor/golang.org/x/net/ipv4/zsys_linux_mips64le.go index 7291f96a02..a04e785187 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_mips64le.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_mips64le.go @@ -4,6 +4,57 @@ package ipv4 const ( + sysIP_TOS = 0x1 + sysIP_TTL = 0x2 + sysIP_HDRINCL = 0x3 + sysIP_OPTIONS = 0x4 + sysIP_ROUTER_ALERT = 0x5 + sysIP_RECVOPTS = 0x6 + sysIP_RETOPTS = 0x7 + sysIP_PKTINFO = 0x8 + sysIP_PKTOPTIONS = 0x9 + sysIP_MTU_DISCOVER = 0xa + sysIP_RECVERR = 0xb + sysIP_RECVTTL = 0xc + sysIP_RECVTOS = 0xd + sysIP_MTU = 0xe + sysIP_FREEBIND = 0xf + sysIP_TRANSPARENT = 0x13 + sysIP_RECVRETOPTS = 0x7 + sysIP_ORIGDSTADDR = 0x14 + sysIP_RECVORIGDSTADDR = 0x14 + sysIP_MINTTL = 0x15 + sysIP_NODEFRAG = 0x16 + sysIP_UNICAST_IF = 0x32 + + sysIP_MULTICAST_IF = 0x20 + sysIP_MULTICAST_TTL = 0x21 + sysIP_MULTICAST_LOOP = 0x22 + sysIP_ADD_MEMBERSHIP = 0x23 + sysIP_DROP_MEMBERSHIP = 0x24 + sysIP_UNBLOCK_SOURCE = 0x25 + sysIP_BLOCK_SOURCE = 0x26 + sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 + sysIP_MSFILTER = 0x29 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIP_MULTICAST_ALL = 0x31 + + sysICMP_FILTER = 0x1 + + sysSO_EE_ORIGIN_NONE = 0x0 + sysSO_EE_ORIGIN_LOCAL = 0x1 + sysSO_EE_ORIGIN_ICMP = 0x2 + sysSO_EE_ORIGIN_ICMP6 = 0x3 + sysSO_EE_ORIGIN_TXSTATUS = 0x4 + sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_mipsle.go b/vendor/golang.org/x/net/ipv4/zsys_linux_mipsle.go index a8e3c26267..1c7fdfa13a 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_mipsle.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_mipsle.go @@ -4,6 +4,57 @@ package ipv4 const ( + sysIP_TOS = 0x1 + sysIP_TTL = 0x2 + sysIP_HDRINCL = 0x3 + sysIP_OPTIONS = 0x4 + sysIP_ROUTER_ALERT = 0x5 + sysIP_RECVOPTS = 0x6 + sysIP_RETOPTS = 0x7 + sysIP_PKTINFO = 0x8 + sysIP_PKTOPTIONS = 0x9 + sysIP_MTU_DISCOVER = 0xa + sysIP_RECVERR = 0xb + sysIP_RECVTTL = 0xc + sysIP_RECVTOS = 0xd + sysIP_MTU = 0xe + sysIP_FREEBIND = 0xf + sysIP_TRANSPARENT = 0x13 + sysIP_RECVRETOPTS = 0x7 + sysIP_ORIGDSTADDR = 0x14 + sysIP_RECVORIGDSTADDR = 0x14 + sysIP_MINTTL = 0x15 + sysIP_NODEFRAG = 0x16 + sysIP_UNICAST_IF = 0x32 + + sysIP_MULTICAST_IF = 0x20 + sysIP_MULTICAST_TTL = 0x21 + sysIP_MULTICAST_LOOP = 0x22 + sysIP_ADD_MEMBERSHIP = 0x23 + sysIP_DROP_MEMBERSHIP = 0x24 + sysIP_UNBLOCK_SOURCE = 0x25 + sysIP_BLOCK_SOURCE = 0x26 + sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 + sysIP_MSFILTER = 0x29 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIP_MULTICAST_ALL = 0x31 + + sysICMP_FILTER = 0x1 + + sysSO_EE_ORIGIN_NONE = 0x0 + sysSO_EE_ORIGIN_LOCAL = 0x1 + sysSO_EE_ORIGIN_ICMP = 0x2 + sysSO_EE_ORIGIN_ICMP6 = 0x3 + sysSO_EE_ORIGIN_TXSTATUS = 0x4 + sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_ppc.go b/vendor/golang.org/x/net/ipv4/zsys_linux_ppc.go index b9adb2af2b..3c5ea54731 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_ppc.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_ppc.go @@ -4,6 +4,57 @@ package ipv4 const ( + sysIP_TOS = 0x1 + sysIP_TTL = 0x2 + sysIP_HDRINCL = 0x3 + sysIP_OPTIONS = 0x4 + sysIP_ROUTER_ALERT = 0x5 + sysIP_RECVOPTS = 0x6 + sysIP_RETOPTS = 0x7 + sysIP_PKTINFO = 0x8 + sysIP_PKTOPTIONS = 0x9 + sysIP_MTU_DISCOVER = 0xa + sysIP_RECVERR = 0xb + sysIP_RECVTTL = 0xc + sysIP_RECVTOS = 0xd + sysIP_MTU = 0xe + sysIP_FREEBIND = 0xf + sysIP_TRANSPARENT = 0x13 + sysIP_RECVRETOPTS = 0x7 + sysIP_ORIGDSTADDR = 0x14 + sysIP_RECVORIGDSTADDR = 0x14 + sysIP_MINTTL = 0x15 + sysIP_NODEFRAG = 0x16 + sysIP_UNICAST_IF = 0x32 + + sysIP_MULTICAST_IF = 0x20 + sysIP_MULTICAST_TTL = 0x21 + sysIP_MULTICAST_LOOP = 0x22 + sysIP_ADD_MEMBERSHIP = 0x23 + sysIP_DROP_MEMBERSHIP = 0x24 + sysIP_UNBLOCK_SOURCE = 0x25 + sysIP_BLOCK_SOURCE = 0x26 + sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 + sysIP_MSFILTER = 0x29 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIP_MULTICAST_ALL = 0x31 + + sysICMP_FILTER = 0x1 + + sysSO_EE_ORIGIN_NONE = 0x0 + sysSO_EE_ORIGIN_LOCAL = 0x1 + sysSO_EE_ORIGIN_ICMP = 0x2 + sysSO_EE_ORIGIN_ICMP6 = 0x3 + sysSO_EE_ORIGIN_TXSTATUS = 0x4 + sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64.go b/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64.go index 7291f96a02..a04e785187 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64.go @@ -4,6 +4,57 @@ package ipv4 const ( + sysIP_TOS = 0x1 + sysIP_TTL = 0x2 + sysIP_HDRINCL = 0x3 + sysIP_OPTIONS = 0x4 + sysIP_ROUTER_ALERT = 0x5 + sysIP_RECVOPTS = 0x6 + sysIP_RETOPTS = 0x7 + sysIP_PKTINFO = 0x8 + sysIP_PKTOPTIONS = 0x9 + sysIP_MTU_DISCOVER = 0xa + sysIP_RECVERR = 0xb + sysIP_RECVTTL = 0xc + sysIP_RECVTOS = 0xd + sysIP_MTU = 0xe + sysIP_FREEBIND = 0xf + sysIP_TRANSPARENT = 0x13 + sysIP_RECVRETOPTS = 0x7 + sysIP_ORIGDSTADDR = 0x14 + sysIP_RECVORIGDSTADDR = 0x14 + sysIP_MINTTL = 0x15 + sysIP_NODEFRAG = 0x16 + sysIP_UNICAST_IF = 0x32 + + sysIP_MULTICAST_IF = 0x20 + sysIP_MULTICAST_TTL = 0x21 + sysIP_MULTICAST_LOOP = 0x22 + sysIP_ADD_MEMBERSHIP = 0x23 + sysIP_DROP_MEMBERSHIP = 0x24 + sysIP_UNBLOCK_SOURCE = 0x25 + sysIP_BLOCK_SOURCE = 0x26 + sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 + sysIP_MSFILTER = 0x29 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIP_MULTICAST_ALL = 0x31 + + sysICMP_FILTER = 0x1 + + sysSO_EE_ORIGIN_NONE = 0x0 + sysSO_EE_ORIGIN_LOCAL = 0x1 + sysSO_EE_ORIGIN_ICMP = 0x2 + sysSO_EE_ORIGIN_ICMP6 = 0x3 + sysSO_EE_ORIGIN_TXSTATUS = 0x4 + sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64le.go b/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64le.go index 7291f96a02..a04e785187 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64le.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64le.go @@ -4,6 +4,57 @@ package ipv4 const ( + sysIP_TOS = 0x1 + sysIP_TTL = 0x2 + sysIP_HDRINCL = 0x3 + sysIP_OPTIONS = 0x4 + sysIP_ROUTER_ALERT = 0x5 + sysIP_RECVOPTS = 0x6 + sysIP_RETOPTS = 0x7 + sysIP_PKTINFO = 0x8 + sysIP_PKTOPTIONS = 0x9 + sysIP_MTU_DISCOVER = 0xa + sysIP_RECVERR = 0xb + sysIP_RECVTTL = 0xc + sysIP_RECVTOS = 0xd + sysIP_MTU = 0xe + sysIP_FREEBIND = 0xf + sysIP_TRANSPARENT = 0x13 + sysIP_RECVRETOPTS = 0x7 + sysIP_ORIGDSTADDR = 0x14 + sysIP_RECVORIGDSTADDR = 0x14 + sysIP_MINTTL = 0x15 + sysIP_NODEFRAG = 0x16 + sysIP_UNICAST_IF = 0x32 + + sysIP_MULTICAST_IF = 0x20 + sysIP_MULTICAST_TTL = 0x21 + sysIP_MULTICAST_LOOP = 0x22 + sysIP_ADD_MEMBERSHIP = 0x23 + sysIP_DROP_MEMBERSHIP = 0x24 + sysIP_UNBLOCK_SOURCE = 0x25 + sysIP_BLOCK_SOURCE = 0x26 + sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 + sysIP_MSFILTER = 0x29 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIP_MULTICAST_ALL = 0x31 + + sysICMP_FILTER = 0x1 + + sysSO_EE_ORIGIN_NONE = 0x0 + sysSO_EE_ORIGIN_LOCAL = 0x1 + sysSO_EE_ORIGIN_ICMP = 0x2 + sysSO_EE_ORIGIN_ICMP6 = 0x3 + sysSO_EE_ORIGIN_TXSTATUS = 0x4 + sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_riscv64.go b/vendor/golang.org/x/net/ipv4/zsys_linux_riscv64.go index b24d2649d1..e626134a8b 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_riscv64.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_riscv64.go @@ -1,12 +1,62 @@ // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_linux.go -//go:build riscv64 // +build riscv64 package ipv4 const ( + sysIP_TOS = 0x1 + sysIP_TTL = 0x2 + sysIP_HDRINCL = 0x3 + sysIP_OPTIONS = 0x4 + sysIP_ROUTER_ALERT = 0x5 + sysIP_RECVOPTS = 0x6 + sysIP_RETOPTS = 0x7 + sysIP_PKTINFO = 0x8 + sysIP_PKTOPTIONS = 0x9 + sysIP_MTU_DISCOVER = 0xa + sysIP_RECVERR = 0xb + sysIP_RECVTTL = 0xc + sysIP_RECVTOS = 0xd + sysIP_MTU = 0xe + sysIP_FREEBIND = 0xf + sysIP_TRANSPARENT = 0x13 + sysIP_RECVRETOPTS = 0x7 + sysIP_ORIGDSTADDR = 0x14 + sysIP_RECVORIGDSTADDR = 0x14 + sysIP_MINTTL = 0x15 + sysIP_NODEFRAG = 0x16 + sysIP_UNICAST_IF = 0x32 + + sysIP_MULTICAST_IF = 0x20 + sysIP_MULTICAST_TTL = 0x21 + sysIP_MULTICAST_LOOP = 0x22 + sysIP_ADD_MEMBERSHIP = 0x23 + sysIP_DROP_MEMBERSHIP = 0x24 + sysIP_UNBLOCK_SOURCE = 0x25 + sysIP_BLOCK_SOURCE = 0x26 + sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 + sysIP_MSFILTER = 0x29 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIP_MULTICAST_ALL = 0x31 + + sysICMP_FILTER = 0x1 + + sysSO_EE_ORIGIN_NONE = 0x0 + sysSO_EE_ORIGIN_LOCAL = 0x1 + sysSO_EE_ORIGIN_ICMP = 0x2 + sysSO_EE_ORIGIN_ICMP6 = 0x3 + sysSO_EE_ORIGIN_TXSTATUS = 0x4 + sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_linux_s390x.go b/vendor/golang.org/x/net/ipv4/zsys_linux_s390x.go index 7291f96a02..a04e785187 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_linux_s390x.go +++ b/vendor/golang.org/x/net/ipv4/zsys_linux_s390x.go @@ -4,6 +4,57 @@ package ipv4 const ( + sysIP_TOS = 0x1 + sysIP_TTL = 0x2 + sysIP_HDRINCL = 0x3 + sysIP_OPTIONS = 0x4 + sysIP_ROUTER_ALERT = 0x5 + sysIP_RECVOPTS = 0x6 + sysIP_RETOPTS = 0x7 + sysIP_PKTINFO = 0x8 + sysIP_PKTOPTIONS = 0x9 + sysIP_MTU_DISCOVER = 0xa + sysIP_RECVERR = 0xb + sysIP_RECVTTL = 0xc + sysIP_RECVTOS = 0xd + sysIP_MTU = 0xe + sysIP_FREEBIND = 0xf + sysIP_TRANSPARENT = 0x13 + sysIP_RECVRETOPTS = 0x7 + sysIP_ORIGDSTADDR = 0x14 + sysIP_RECVORIGDSTADDR = 0x14 + sysIP_MINTTL = 0x15 + sysIP_NODEFRAG = 0x16 + sysIP_UNICAST_IF = 0x32 + + sysIP_MULTICAST_IF = 0x20 + sysIP_MULTICAST_TTL = 0x21 + sysIP_MULTICAST_LOOP = 0x22 + sysIP_ADD_MEMBERSHIP = 0x23 + sysIP_DROP_MEMBERSHIP = 0x24 + sysIP_UNBLOCK_SOURCE = 0x25 + sysIP_BLOCK_SOURCE = 0x26 + sysIP_ADD_SOURCE_MEMBERSHIP = 0x27 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x28 + sysIP_MSFILTER = 0x29 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIP_MULTICAST_ALL = 0x31 + + sysICMP_FILTER = 0x1 + + sysSO_EE_ORIGIN_NONE = 0x0 + sysSO_EE_ORIGIN_LOCAL = 0x1 + sysSO_EE_ORIGIN_ICMP = 0x2 + sysSO_EE_ORIGIN_ICMP6 = 0x3 + sysSO_EE_ORIGIN_TXSTATUS = 0x4 + sysSO_EE_ORIGIN_TIMESTAMPING = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_netbsd.go b/vendor/golang.org/x/net/ipv4/zsys_netbsd.go index a2ef2f6d6d..8cfc648ad7 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_netbsd.go +++ b/vendor/golang.org/x/net/ipv4/zsys_netbsd.go @@ -4,6 +4,23 @@ package ipv4 const ( + sysIP_OPTIONS = 0x1 + sysIP_HDRINCL = 0x2 + sysIP_TOS = 0x3 + sysIP_TTL = 0x4 + sysIP_RECVOPTS = 0x5 + sysIP_RECVRETOPTS = 0x6 + sysIP_RECVDSTADDR = 0x7 + sysIP_RETOPTS = 0x8 + sysIP_RECVIF = 0x14 + sysIP_RECVTTL = 0x17 + + sysIP_MULTICAST_IF = 0x9 + sysIP_MULTICAST_TTL = 0xa + sysIP_MULTICAST_LOOP = 0xb + sysIP_ADD_MEMBERSHIP = 0xc + sysIP_DROP_MEMBERSHIP = 0xd + sizeofIPMreq = 0x8 ) diff --git a/vendor/golang.org/x/net/ipv4/zsys_openbsd.go b/vendor/golang.org/x/net/ipv4/zsys_openbsd.go index b293a338f8..37629cb0ab 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_openbsd.go +++ b/vendor/golang.org/x/net/ipv4/zsys_openbsd.go @@ -4,6 +4,23 @@ package ipv4 const ( + sysIP_OPTIONS = 0x1 + sysIP_HDRINCL = 0x2 + sysIP_TOS = 0x3 + sysIP_TTL = 0x4 + sysIP_RECVOPTS = 0x5 + sysIP_RECVRETOPTS = 0x6 + sysIP_RECVDSTADDR = 0x7 + sysIP_RETOPTS = 0x8 + sysIP_RECVIF = 0x1e + sysIP_RECVTTL = 0x1f + + sysIP_MULTICAST_IF = 0x9 + sysIP_MULTICAST_TTL = 0xa + sysIP_MULTICAST_LOOP = 0xb + sysIP_ADD_MEMBERSHIP = 0xc + sysIP_DROP_MEMBERSHIP = 0xd + sizeofIPMreq = 0x8 ) diff --git a/vendor/golang.org/x/net/ipv4/zsys_solaris.go b/vendor/golang.org/x/net/ipv4/zsys_solaris.go index e1a961bb61..cb80a308b0 100644 --- a/vendor/golang.org/x/net/ipv4/zsys_solaris.go +++ b/vendor/golang.org/x/net/ipv4/zsys_solaris.go @@ -4,6 +4,49 @@ package ipv4 const ( + sysIP_OPTIONS = 0x1 + sysIP_HDRINCL = 0x2 + sysIP_TOS = 0x3 + sysIP_TTL = 0x4 + sysIP_RECVOPTS = 0x5 + sysIP_RECVRETOPTS = 0x6 + sysIP_RECVDSTADDR = 0x7 + sysIP_RETOPTS = 0x8 + sysIP_RECVIF = 0x9 + sysIP_RECVSLLA = 0xa + sysIP_RECVTTL = 0xb + + sysIP_MULTICAST_IF = 0x10 + sysIP_MULTICAST_TTL = 0x11 + sysIP_MULTICAST_LOOP = 0x12 + sysIP_ADD_MEMBERSHIP = 0x13 + sysIP_DROP_MEMBERSHIP = 0x14 + sysIP_BLOCK_SOURCE = 0x15 + sysIP_UNBLOCK_SOURCE = 0x16 + sysIP_ADD_SOURCE_MEMBERSHIP = 0x17 + sysIP_DROP_SOURCE_MEMBERSHIP = 0x18 + sysIP_NEXTHOP = 0x19 + + sysIP_PKTINFO = 0x1a + sysIP_RECVPKTINFO = 0x1a + sysIP_DONTFRAG = 0x1b + + sysIP_BOUND_IF = 0x41 + sysIP_UNSPEC_SRC = 0x42 + sysIP_BROADCAST_TTL = 0x43 + sysIP_DHCPINIT_IF = 0x45 + + sysIP_REUSEADDR = 0x104 + sysIP_DONTROUTE = 0x105 + sysIP_BROADCAST = 0x106 + + sysMCAST_JOIN_GROUP = 0x29 + sysMCAST_LEAVE_GROUP = 0x2a + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_JOIN_SOURCE_GROUP = 0x2d + sysMCAST_LEAVE_SOURCE_GROUP = 0x2e + sizeofSockaddrStorage = 0x100 sizeofSockaddrInet = 0x10 sizeofInetPktinfo = 0xc diff --git a/vendor/golang.org/x/net/ipv4/zsys_zos_s390x.go b/vendor/golang.org/x/net/ipv4/zsys_zos_s390x.go deleted file mode 100644 index 692abf6882..0000000000 --- a/vendor/golang.org/x/net/ipv4/zsys_zos_s390x.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Hand edited based on zerrors_zos_s390x.go -// TODO(Bill O'Farrell): auto-generate. - -package ipv4 - -const ( - sizeofIPMreq = 8 - sizeofSockaddrInet4 = 16 - sizeofSockaddrStorage = 128 - sizeofGroupReq = 136 - sizeofGroupSourceReq = 264 - sizeofInetPktinfo = 8 -) - -type sockaddrInet4 struct { - Len uint8 - Family uint8 - Port uint16 - Addr [4]byte - Zero [8]uint8 -} - -type inetPktinfo struct { - Addr [4]byte - Ifindex uint32 -} - -type sockaddrStorage struct { - Len uint8 - Family byte - ss_pad1 [6]byte - ss_align int64 - ss_pad2 [112]byte -} - -type groupReq struct { - Interface uint32 - reserved uint32 - Group sockaddrStorage -} - -type groupSourceReq struct { - Interface uint32 - reserved uint32 - Group sockaddrStorage - Source sockaddrStorage -} - -type ipMreq struct { - Multiaddr [4]byte /* in_addr */ - Interface [4]byte /* in_addr */ -} diff --git a/vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go b/vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go index 2733ddbe27..9fd9eb15e3 100644 --- a/vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go +++ b/vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build darwin // +build darwin package ipv6 @@ -12,13 +11,11 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" ) func marshal2292HopLimit(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_2292HOPLIMIT, 4) + m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_2292HOPLIMIT, 4) if cm != nil { socket.NativeEndian.PutUint32(m.Data(4), uint32(cm.HopLimit)) } @@ -27,7 +24,7 @@ func marshal2292HopLimit(b []byte, cm *ControlMessage) []byte { func marshal2292PacketInfo(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_2292PKTINFO, sizeofInet6Pktinfo) + m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_2292PKTINFO, sizeofInet6Pktinfo) if cm != nil { pi := (*inet6Pktinfo)(unsafe.Pointer(&m.Data(sizeofInet6Pktinfo)[0])) if ip := cm.Src.To16(); ip != nil && ip.To4() == nil { @@ -42,7 +39,7 @@ func marshal2292PacketInfo(b []byte, cm *ControlMessage) []byte { func marshal2292NextHop(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_2292NEXTHOP, sizeofSockaddrInet6) + m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_2292NEXTHOP, sizeofSockaddrInet6) if cm != nil { sa := (*sockaddrInet6)(unsafe.Pointer(&m.Data(sizeofSockaddrInet6)[0])) sa.setSockaddr(cm.NextHop, cm.IfIndex) diff --git a/vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go b/vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go index 9c90844aac..8c221b5989 100644 --- a/vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go +++ b/vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package ipv6 @@ -13,13 +12,11 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" ) func marshalTrafficClass(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_TCLASS, 4) + m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_TCLASS, 4) if cm != nil { socket.NativeEndian.PutUint32(m.Data(4), uint32(cm.TrafficClass)) } @@ -32,7 +29,7 @@ func parseTrafficClass(cm *ControlMessage, b []byte) { func marshalHopLimit(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_HOPLIMIT, 4) + m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_HOPLIMIT, 4) if cm != nil { socket.NativeEndian.PutUint32(m.Data(4), uint32(cm.HopLimit)) } @@ -45,7 +42,7 @@ func parseHopLimit(cm *ControlMessage, b []byte) { func marshalPacketInfo(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_PKTINFO, sizeofInet6Pktinfo) + m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_PKTINFO, sizeofInet6Pktinfo) if cm != nil { pi := (*inet6Pktinfo)(unsafe.Pointer(&m.Data(sizeofInet6Pktinfo)[0])) if ip := cm.Src.To16(); ip != nil && ip.To4() == nil { @@ -69,7 +66,7 @@ func parsePacketInfo(cm *ControlMessage, b []byte) { func marshalNextHop(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_NEXTHOP, sizeofSockaddrInet6) + m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_NEXTHOP, sizeofSockaddrInet6) if cm != nil { sa := (*sockaddrInet6)(unsafe.Pointer(&m.Data(sizeofSockaddrInet6)[0])) sa.setSockaddr(cm.NextHop, cm.IfIndex) @@ -82,7 +79,7 @@ func parseNextHop(cm *ControlMessage, b []byte) { func marshalPathMTU(b []byte, cm *ControlMessage) []byte { m := socket.ControlMessage(b) - m.MarshalHeader(iana.ProtocolIPv6, unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo) + m.MarshalHeader(iana.ProtocolIPv6, sysIPV6_PATHMTU, sizeofIPv6Mtuinfo) return m.Next(sizeofIPv6Mtuinfo) } diff --git a/vendor/golang.org/x/net/ipv6/control_stub.go b/vendor/golang.org/x/net/ipv6/control_stub.go index b7e8643fc9..1d773cbcc8 100644 --- a/vendor/golang.org/x/net/ipv6/control_stub.go +++ b/vendor/golang.org/x/net/ipv6/control_stub.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/control_unix.go b/vendor/golang.org/x/net/ipv6/control_unix.go index 63e475db83..0971a008bf 100644 --- a/vendor/golang.org/x/net/ipv6/control_unix.go +++ b/vendor/golang.org/x/net/ipv6/control_unix.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/icmp_bsd.go b/vendor/golang.org/x/net/ipv6/icmp_bsd.go index 120bf87758..b03025cdcc 100644 --- a/vendor/golang.org/x/net/ipv6/icmp_bsd.go +++ b/vendor/golang.org/x/net/ipv6/icmp_bsd.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || netbsd || openbsd // +build aix darwin dragonfly freebsd netbsd openbsd package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/icmp_stub.go b/vendor/golang.org/x/net/ipv6/icmp_stub.go index d60136a901..370e51acd1 100644 --- a/vendor/golang.org/x/net/ipv6/icmp_stub.go +++ b/vendor/golang.org/x/net/ipv6/icmp_stub.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/icmp_zos.go b/vendor/golang.org/x/net/ipv6/icmp_zos.go deleted file mode 100644 index ddf8f093fc..0000000000 --- a/vendor/golang.org/x/net/ipv6/icmp_zos.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -func (f *icmpv6Filter) accept(typ ICMPType) { - f.Filt[typ>>5] |= 1 << (uint32(typ) & 31) - -} - -func (f *icmpv6Filter) block(typ ICMPType) { - f.Filt[typ>>5] &^= 1 << (uint32(typ) & 31) - -} - -func (f *icmpv6Filter) setAll(block bool) { - for i := range f.Filt { - if block { - f.Filt[i] = 0 - } else { - f.Filt[i] = 1<<32 - 1 - } - } -} - -func (f *icmpv6Filter) willBlock(typ ICMPType) bool { - return f.Filt[typ>>5]&(1<<(uint32(typ)&31)) == 0 -} diff --git a/vendor/golang.org/x/net/ipv6/payload_cmsg.go b/vendor/golang.org/x/net/ipv6/payload_cmsg.go index b0692e4304..284a04278e 100644 --- a/vendor/golang.org/x/net/ipv6/payload_cmsg.go +++ b/vendor/golang.org/x/net/ipv6/payload_cmsg.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/payload_nocmsg.go b/vendor/golang.org/x/net/ipv6/payload_nocmsg.go index cd0ff50838..c5a4c96752 100644 --- a/vendor/golang.org/x/net/ipv6/payload_nocmsg.go +++ b/vendor/golang.org/x/net/ipv6/payload_nocmsg.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !zos -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sockopt_posix.go b/vendor/golang.org/x/net/ipv6/sockopt_posix.go index 37c6287130..824c623cce 100644 --- a/vendor/golang.org/x/net/ipv6/sockopt_posix.go +++ b/vendor/golang.org/x/net/ipv6/sockopt_posix.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || windows || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sockopt_stub.go b/vendor/golang.org/x/net/ipv6/sockopt_stub.go index 32fd8664ce..0a87a93bbd 100644 --- a/vendor/golang.org/x/net/ipv6/sockopt_stub.go +++ b/vendor/golang.org/x/net/ipv6/sockopt_stub.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sys_aix.go b/vendor/golang.org/x/net/ipv6/sys_aix.go index a47182afb9..bce7091fb0 100644 --- a/vendor/golang.org/x/net/ipv6/sys_aix.go +++ b/vendor/golang.org/x/net/ipv6/sys_aix.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. // Added for go1.11 compatibility -//go:build aix // +build aix package ipv6 @@ -15,34 +14,32 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" ) var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, - ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, - ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, - ctlNextHop: {unix.IPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, - ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, + ctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, + ctlHopLimit: {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, + ctlPacketInfo: {sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, + ctlNextHop: {sysIPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, + ctlPathMTU: {sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, } sockOpts = map[int]*sockOpt{ - ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}}, - ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}}, - ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}}, - ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}}, - ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}}, - ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}}, - ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, - ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}}, - ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_JOIN_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_LEAVE_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, + ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_TCLASS, Len: 4}}, + ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_UNICAST_HOPS, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_IF, Len: 4}}, + ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_HOPS, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVTCLASS, Len: 4}}, + ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVHOPLIMIT, Len: 4}}, + ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPKTINFO, Len: 4}}, + ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPATHMTU, Len: 4}}, + ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, + ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_CHECKSUM, Len: 4}}, + ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: sysICMP6_FILTER, Len: sizeofICMPv6Filter}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_JOIN_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_LEAVE_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, } ) diff --git a/vendor/golang.org/x/net/ipv6/sys_asmreq.go b/vendor/golang.org/x/net/ipv6/sys_asmreq.go index 6ff9950d13..8c3934c3ee 100644 --- a/vendor/golang.org/x/net/ipv6/sys_asmreq.go +++ b/vendor/golang.org/x/net/ipv6/sys_asmreq.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || windows // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go b/vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go index 485290cb82..87ae481814 100644 --- a/vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go +++ b/vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows // +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sys_bpf.go b/vendor/golang.org/x/net/ipv6/sys_bpf.go index b5661fb8f0..90ef4dfaf4 100644 --- a/vendor/golang.org/x/net/ipv6/sys_bpf.go +++ b/vendor/golang.org/x/net/ipv6/sys_bpf.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build linux // +build linux package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sys_bpf_stub.go b/vendor/golang.org/x/net/ipv6/sys_bpf_stub.go index cb00661872..eb9f831623 100644 --- a/vendor/golang.org/x/net/ipv6/sys_bpf_stub.go +++ b/vendor/golang.org/x/net/ipv6/sys_bpf_stub.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !linux // +build !linux package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sys_bsd.go b/vendor/golang.org/x/net/ipv6/sys_bsd.go index bde41a6cef..e416eaa1fe 100644 --- a/vendor/golang.org/x/net/ipv6/sys_bsd.go +++ b/vendor/golang.org/x/net/ipv6/sys_bsd.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build dragonfly || netbsd || openbsd // +build dragonfly netbsd openbsd package ipv6 @@ -13,34 +12,32 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" ) var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, - ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, - ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, - ctlNextHop: {unix.IPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, - ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, + ctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, + ctlHopLimit: {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, + ctlPacketInfo: {sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, + ctlNextHop: {sysIPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, + ctlPathMTU: {sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, } sockOpts = map[int]*sockOpt{ - ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}}, - ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}}, - ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}}, - ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}}, - ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}}, - ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}}, - ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, - ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}}, - ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_JOIN_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_LEAVE_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, + ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_TCLASS, Len: 4}}, + ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_UNICAST_HOPS, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_IF, Len: 4}}, + ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_HOPS, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVTCLASS, Len: 4}}, + ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVHOPLIMIT, Len: 4}}, + ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPKTINFO, Len: 4}}, + ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPATHMTU, Len: 4}}, + ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, + ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_CHECKSUM, Len: 4}}, + ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: sysICMP6_FILTER, Len: sizeofICMPv6Filter}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_JOIN_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_LEAVE_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, } ) diff --git a/vendor/golang.org/x/net/ipv6/sys_darwin.go b/vendor/golang.org/x/net/ipv6/sys_darwin.go index b80ec8064a..12cc5cb2c1 100644 --- a/vendor/golang.org/x/net/ipv6/sys_darwin.go +++ b/vendor/golang.org/x/net/ipv6/sys_darwin.go @@ -11,38 +11,36 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" ) var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, - ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, - ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, - ctlNextHop: {unix.IPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, - ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, + ctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, + ctlHopLimit: {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, + ctlPacketInfo: {sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, + ctlNextHop: {sysIPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, + ctlPathMTU: {sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, } sockOpts = map[int]*sockOpt{ - ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}}, - ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}}, - ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}}, - ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}}, - ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}}, - ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}}, - ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}}, - ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, - ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}}, - ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_UNICAST_HOPS, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_IF, Len: 4}}, + ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_HOPS, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_LOOP, Len: 4}}, + ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_TCLASS, Len: 4}}, + ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVTCLASS, Len: 4}}, + ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVHOPLIMIT, Len: 4}}, + ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPKTINFO, Len: 4}}, + ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPATHMTU, Len: 4}}, + ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, + ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_CHECKSUM, Len: 4}}, + ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: sysICMP6_FILTER, Len: sizeofICMPv6Filter}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, } ) diff --git a/vendor/golang.org/x/net/ipv6/sys_freebsd.go b/vendor/golang.org/x/net/ipv6/sys_freebsd.go index 6282cf9770..85a9f5d07d 100644 --- a/vendor/golang.org/x/net/ipv6/sys_freebsd.go +++ b/vendor/golang.org/x/net/ipv6/sys_freebsd.go @@ -13,38 +13,36 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" ) var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, - ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, - ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, - ctlNextHop: {unix.IPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, - ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, + ctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, + ctlHopLimit: {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, + ctlPacketInfo: {sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, + ctlNextHop: {sysIPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, + ctlPathMTU: {sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, } sockOpts = map[int]sockOpt{ - ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}}, - ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}}, - ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}}, - ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}}, - ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}}, - ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}}, - ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, - ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}}, - ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_TCLASS, Len: 4}}, + ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_UNICAST_HOPS, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_IF, Len: 4}}, + ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_HOPS, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVTCLASS, Len: 4}}, + ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVHOPLIMIT, Len: 4}}, + ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPKTINFO, Len: 4}}, + ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPATHMTU, Len: 4}}, + ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, + ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_CHECKSUM, Len: 4}}, + ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: sysICMP6_FILTER, Len: sizeofICMPv6Filter}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, } ) diff --git a/vendor/golang.org/x/net/ipv6/sys_linux.go b/vendor/golang.org/x/net/ipv6/sys_linux.go index 82e2121000..96e8093a30 100644 --- a/vendor/golang.org/x/net/ipv6/sys_linux.go +++ b/vendor/golang.org/x/net/ipv6/sys_linux.go @@ -11,37 +11,36 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - "golang.org/x/sys/unix" ) var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, - ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, - ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, - ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, + ctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, + ctlHopLimit: {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, + ctlPacketInfo: {sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, + ctlPathMTU: {sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, } sockOpts = map[int]*sockOpt{ - ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}}, - ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}}, - ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}}, - ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}}, - ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}}, - ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}}, - ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, - ssoChecksum: {Option: socket.Option{Level: iana.ProtocolReserved, Name: unix.IPV6_CHECKSUM, Len: 4}}, - ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMPV6_FILTER, Len: sizeofICMPv6Filter}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_TCLASS, Len: 4}}, + ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_UNICAST_HOPS, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_IF, Len: 4}}, + ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_HOPS, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVTCLASS, Len: 4}}, + ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVHOPLIMIT, Len: 4}}, + ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPKTINFO, Len: 4}}, + ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPATHMTU, Len: 4}}, + ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, + ssoChecksum: {Option: socket.Option{Level: iana.ProtocolReserved, Name: sysIPV6_CHECKSUM, Len: 4}}, + ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: sysICMPV6_FILTER, Len: sizeofICMPv6Filter}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, ssoAttachFilter: {Option: socket.Option{Level: unix.SOL_SOCKET, Name: unix.SO_ATTACH_FILTER, Len: unix.SizeofSockFprog}}, } ) diff --git a/vendor/golang.org/x/net/ipv6/sys_solaris.go b/vendor/golang.org/x/net/ipv6/sys_solaris.go index 1fc30add4d..d348b5f6e4 100644 --- a/vendor/golang.org/x/net/ipv6/sys_solaris.go +++ b/vendor/golang.org/x/net/ipv6/sys_solaris.go @@ -11,38 +11,36 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" ) var ( ctlOpts = [ctlMax]ctlOpt{ - ctlTrafficClass: {unix.IPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, - ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, - ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, - ctlNextHop: {unix.IPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, - ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, + ctlTrafficClass: {sysIPV6_TCLASS, 4, marshalTrafficClass, parseTrafficClass}, + ctlHopLimit: {sysIPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, + ctlPacketInfo: {sysIPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, + ctlNextHop: {sysIPV6_NEXTHOP, sizeofSockaddrInet6, marshalNextHop, parseNextHop}, + ctlPathMTU: {sysIPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, } sockOpts = map[int]*sockOpt{ - ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}}, - ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}}, - ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}}, - ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}}, - ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}}, - ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}}, - ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, - ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}}, - ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_TCLASS, Len: 4}}, + ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_UNICAST_HOPS, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_IF, Len: 4}}, + ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_HOPS, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_LOOP, Len: 4}}, + ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVTCLASS, Len: 4}}, + ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVHOPLIMIT, Len: 4}}, + ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPKTINFO, Len: 4}}, + ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_RECVPATHMTU, Len: 4}}, + ssoPathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_PATHMTU, Len: sizeofIPv6Mtuinfo}}, + ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_CHECKSUM, Len: 4}}, + ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: sysICMP6_FILTER, Len: sizeofICMPv6Filter}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, + ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, + ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysMCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, } ) diff --git a/vendor/golang.org/x/net/ipv6/sys_ssmreq.go b/vendor/golang.org/x/net/ipv6/sys_ssmreq.go index 023488a49c..9b52e978cb 100644 --- a/vendor/golang.org/x/net/ipv6/sys_ssmreq.go +++ b/vendor/golang.org/x/net/ipv6/sys_ssmreq.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || freebsd || linux || solaris || zos -// +build aix darwin freebsd linux solaris zos +// +build aix darwin freebsd linux solaris package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go b/vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go index acdf2e5cf7..d5bc1108c5 100644 --- a/vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go +++ b/vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !freebsd && !linux && !solaris && !zos -// +build !aix,!darwin,!freebsd,!linux,!solaris,!zos +// +build !aix,!darwin,!freebsd,!linux,!solaris package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sys_stub.go b/vendor/golang.org/x/net/ipv6/sys_stub.go index 5807bba392..4f252d09f6 100644 --- a/vendor/golang.org/x/net/ipv6/sys_stub.go +++ b/vendor/golang.org/x/net/ipv6/sys_stub.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows package ipv6 diff --git a/vendor/golang.org/x/net/ipv6/sys_windows.go b/vendor/golang.org/x/net/ipv6/sys_windows.go index fda8a29949..fc36b018bd 100644 --- a/vendor/golang.org/x/net/ipv6/sys_windows.go +++ b/vendor/golang.org/x/net/ipv6/sys_windows.go @@ -10,11 +10,18 @@ import ( "golang.org/x/net/internal/iana" "golang.org/x/net/internal/socket" - - "golang.org/x/sys/windows" ) const ( + // See ws2tcpip.h. + sysIPV6_UNICAST_HOPS = 0x4 + sysIPV6_MULTICAST_IF = 0x9 + sysIPV6_MULTICAST_HOPS = 0xa + sysIPV6_MULTICAST_LOOP = 0xb + sysIPV6_JOIN_GROUP = 0xc + sysIPV6_LEAVE_GROUP = 0xd + sysIPV6_PKTINFO = 0x13 + sizeofSockaddrInet6 = 0x1c sizeofIPv6Mreq = 0x14 @@ -48,12 +55,12 @@ var ( ctlOpts = [ctlMax]ctlOpt{} sockOpts = map[int]*sockOpt{ - ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_UNICAST_HOPS, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_MULTICAST_IF, Len: 4}}, - ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_MULTICAST_HOPS, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_MULTICAST_LOOP, Len: 4}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_JOIN_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: windows.IPV6_LEAVE_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, + ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_UNICAST_HOPS, Len: 4}}, + ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_IF, Len: 4}}, + ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_HOPS, Len: 4}}, + ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_MULTICAST_LOOP, Len: 4}}, + ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_JOIN_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, + ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: sysIPV6_LEAVE_GROUP, Len: sizeofIPv6Mreq}, typ: ssoTypeIPMreq}, } ) diff --git a/vendor/golang.org/x/net/ipv6/sys_zos.go b/vendor/golang.org/x/net/ipv6/sys_zos.go deleted file mode 100644 index 31adc86655..0000000000 --- a/vendor/golang.org/x/net/ipv6/sys_zos.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import ( - "net" - "syscall" - "unsafe" - - "golang.org/x/net/internal/iana" - "golang.org/x/net/internal/socket" - - "golang.org/x/sys/unix" -) - -var ( - ctlOpts = [ctlMax]ctlOpt{ - ctlHopLimit: {unix.IPV6_HOPLIMIT, 4, marshalHopLimit, parseHopLimit}, - ctlPacketInfo: {unix.IPV6_PKTINFO, sizeofInet6Pktinfo, marshalPacketInfo, parsePacketInfo}, - ctlPathMTU: {unix.IPV6_PATHMTU, sizeofIPv6Mtuinfo, marshalPathMTU, parsePathMTU}, - } - - sockOpts = map[int]*sockOpt{ - ssoTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_TCLASS, Len: 4}}, - ssoHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_UNICAST_HOPS, Len: 4}}, - ssoMulticastInterface: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_IF, Len: 4}}, - ssoMulticastHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_HOPS, Len: 4}}, - ssoMulticastLoopback: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_MULTICAST_LOOP, Len: 4}}, - ssoReceiveTrafficClass: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVTCLASS, Len: 4}}, - ssoReceiveHopLimit: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVHOPLIMIT, Len: 4}}, - ssoReceivePacketInfo: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPKTINFO, Len: 4}}, - ssoReceivePathMTU: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_RECVPATHMTU, Len: 4}}, - ssoChecksum: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.IPV6_CHECKSUM, Len: 4}}, - ssoICMPFilter: {Option: socket.Option{Level: iana.ProtocolIPv6ICMP, Name: unix.ICMP6_FILTER, Len: sizeofICMPv6Filter}}, - ssoJoinGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoLeaveGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_GROUP, Len: sizeofGroupReq}, typ: ssoTypeGroupReq}, - ssoJoinSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_JOIN_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoLeaveSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_LEAVE_SOURCE_GROUP, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoBlockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_BLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - ssoUnblockSourceGroup: {Option: socket.Option{Level: iana.ProtocolIPv6, Name: unix.MCAST_UNBLOCK_SOURCE, Len: sizeofGroupSourceReq}, typ: ssoTypeGroupSourceReq}, - } -) - -func (sa *sockaddrInet6) setSockaddr(ip net.IP, i int) { - sa.Family = syscall.AF_INET6 - copy(sa.Addr[:], ip) - sa.Scope_id = uint32(i) -} - -func (pi *inet6Pktinfo) setIfindex(i int) { - pi.Ifindex = uint32(i) -} - -func (gr *groupReq) setGroup(grp net.IP) { - sa := (*sockaddrInet6)(unsafe.Pointer(&gr.Group)) - sa.Family = syscall.AF_INET6 - sa.Len = sizeofSockaddrInet6 - copy(sa.Addr[:], grp) -} - -func (gsr *groupSourceReq) setSourceGroup(grp, src net.IP) { - sa := (*sockaddrInet6)(unsafe.Pointer(&gsr.Group)) - sa.Family = syscall.AF_INET6 - sa.Len = sizeofSockaddrInet6 - copy(sa.Addr[:], grp) - sa = (*sockaddrInet6)(unsafe.Pointer(&gsr.Source)) - sa.Family = syscall.AF_INET6 - sa.Len = sizeofSockaddrInet6 - copy(sa.Addr[:], src) -} diff --git a/vendor/golang.org/x/net/ipv6/zsys_aix_ppc64.go b/vendor/golang.org/x/net/ipv6/zsys_aix_ppc64.go index f604b0f3b4..bf44e338bd 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_aix_ppc64.go +++ b/vendor/golang.org/x/net/ipv6/zsys_aix_ppc64.go @@ -2,12 +2,46 @@ // cgo -godefs defs_aix.go // Added for go1.11 compatibility -//go:build aix // +build aix package ipv6 const ( + sysIPV6_UNICAST_HOPS = 0x4 + sysIPV6_MULTICAST_IF = 0x9 + sysIPV6_MULTICAST_HOPS = 0xa + sysIPV6_MULTICAST_LOOP = 0xb + sysIPV6_JOIN_GROUP = 0xc + sysIPV6_LEAVE_GROUP = 0xd + sysICMP6_FILTER = 0x26 + + sysIPV6_CHECKSUM = 0x27 + sysIPV6_V6ONLY = 0x25 + + sysIPV6_RTHDRDSTOPTS = 0x37 + + sysIPV6_RECVPKTINFO = 0x23 + sysIPV6_RECVHOPLIMIT = 0x29 + sysIPV6_RECVRTHDR = 0x33 + sysIPV6_RECVHOPOPTS = 0x35 + sysIPV6_RECVDSTOPTS = 0x38 + + sysIPV6_USE_MIN_MTU = 0x2c + sysIPV6_RECVPATHMTU = 0x2f + sysIPV6_PATHMTU = 0x2e + + sysIPV6_PKTINFO = 0x21 + sysIPV6_HOPLIMIT = 0x28 + sysIPV6_NEXTHOP = 0x30 + sysIPV6_HOPOPTS = 0x34 + sysIPV6_DSTOPTS = 0x36 + sysIPV6_RTHDR = 0x32 + + sysIPV6_RECVTCLASS = 0x2a + + sysIPV6_TCLASS = 0x2b + sysIPV6_DONTFRAG = 0x2d + sizeofSockaddrStorage = 0x508 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_darwin.go b/vendor/golang.org/x/net/ipv6/zsys_darwin.go index dd6f7b28ec..555744afd7 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_darwin.go +++ b/vendor/golang.org/x/net/ipv6/zsys_darwin.go @@ -4,6 +4,73 @@ package ipv6 const ( + sysIPV6_UNICAST_HOPS = 0x4 + sysIPV6_MULTICAST_IF = 0x9 + sysIPV6_MULTICAST_HOPS = 0xa + sysIPV6_MULTICAST_LOOP = 0xb + sysIPV6_JOIN_GROUP = 0xc + sysIPV6_LEAVE_GROUP = 0xd + + sysIPV6_PORTRANGE = 0xe + sysICMP6_FILTER = 0x12 + sysIPV6_2292PKTINFO = 0x13 + sysIPV6_2292HOPLIMIT = 0x14 + sysIPV6_2292NEXTHOP = 0x15 + sysIPV6_2292HOPOPTS = 0x16 + sysIPV6_2292DSTOPTS = 0x17 + sysIPV6_2292RTHDR = 0x18 + + sysIPV6_2292PKTOPTIONS = 0x19 + + sysIPV6_CHECKSUM = 0x1a + sysIPV6_V6ONLY = 0x1b + + sysIPV6_IPSEC_POLICY = 0x1c + + sysIPV6_RECVTCLASS = 0x23 + sysIPV6_TCLASS = 0x24 + + sysIPV6_RTHDRDSTOPTS = 0x39 + + sysIPV6_RECVPKTINFO = 0x3d + + sysIPV6_RECVHOPLIMIT = 0x25 + sysIPV6_RECVRTHDR = 0x26 + sysIPV6_RECVHOPOPTS = 0x27 + sysIPV6_RECVDSTOPTS = 0x28 + + sysIPV6_USE_MIN_MTU = 0x2a + sysIPV6_RECVPATHMTU = 0x2b + + sysIPV6_PATHMTU = 0x2c + + sysIPV6_PKTINFO = 0x2e + sysIPV6_HOPLIMIT = 0x2f + sysIPV6_NEXTHOP = 0x30 + sysIPV6_HOPOPTS = 0x31 + sysIPV6_DSTOPTS = 0x32 + sysIPV6_RTHDR = 0x33 + + sysIPV6_AUTOFLOWLABEL = 0x3b + + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_PREFER_TEMPADDR = 0x3f + + sysIPV6_MSFILTER = 0x4a + sysMCAST_JOIN_GROUP = 0x50 + sysMCAST_LEAVE_GROUP = 0x51 + sysMCAST_JOIN_SOURCE_GROUP = 0x52 + sysMCAST_LEAVE_SOURCE_GROUP = 0x53 + sysMCAST_BLOCK_SOURCE = 0x54 + sysMCAST_UNBLOCK_SOURCE = 0x55 + + sysIPV6_BOUND_IF = 0x7d + + sysIPV6_PORTRANGE_DEFAULT = 0x0 + sysIPV6_PORTRANGE_HIGH = 0x1 + sysIPV6_PORTRANGE_LOW = 0x2 + sizeofSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_dragonfly.go b/vendor/golang.org/x/net/ipv6/zsys_dragonfly.go index 6b45a94fe1..cf3cc1024a 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_dragonfly.go +++ b/vendor/golang.org/x/net/ipv6/zsys_dragonfly.go @@ -4,6 +4,52 @@ package ipv6 const ( + sysIPV6_UNICAST_HOPS = 0x4 + sysIPV6_MULTICAST_IF = 0x9 + sysIPV6_MULTICAST_HOPS = 0xa + sysIPV6_MULTICAST_LOOP = 0xb + sysIPV6_JOIN_GROUP = 0xc + sysIPV6_LEAVE_GROUP = 0xd + sysIPV6_PORTRANGE = 0xe + sysICMP6_FILTER = 0x12 + + sysIPV6_CHECKSUM = 0x1a + sysIPV6_V6ONLY = 0x1b + + sysIPV6_IPSEC_POLICY = 0x1c + + sysIPV6_RTHDRDSTOPTS = 0x23 + sysIPV6_RECVPKTINFO = 0x24 + sysIPV6_RECVHOPLIMIT = 0x25 + sysIPV6_RECVRTHDR = 0x26 + sysIPV6_RECVHOPOPTS = 0x27 + sysIPV6_RECVDSTOPTS = 0x28 + + sysIPV6_USE_MIN_MTU = 0x2a + sysIPV6_RECVPATHMTU = 0x2b + + sysIPV6_PATHMTU = 0x2c + + sysIPV6_PKTINFO = 0x2e + sysIPV6_HOPLIMIT = 0x2f + sysIPV6_NEXTHOP = 0x30 + sysIPV6_HOPOPTS = 0x31 + sysIPV6_DSTOPTS = 0x32 + sysIPV6_RTHDR = 0x33 + + sysIPV6_RECVTCLASS = 0x39 + + sysIPV6_AUTOFLOWLABEL = 0x3b + + sysIPV6_TCLASS = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_PREFER_TEMPADDR = 0x3f + + sysIPV6_PORTRANGE_DEFAULT = 0x0 + sysIPV6_PORTRANGE_HIGH = 0x1 + sysIPV6_PORTRANGE_LOW = 0x2 + sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 sizeofIPv6Mtuinfo = 0x20 diff --git a/vendor/golang.org/x/net/ipv6/zsys_freebsd_386.go b/vendor/golang.org/x/net/ipv6/zsys_freebsd_386.go index 8da55925f7..73f31b260e 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_freebsd_386.go +++ b/vendor/golang.org/x/net/ipv6/zsys_freebsd_386.go @@ -4,6 +4,64 @@ package ipv6 const ( + sysIPV6_UNICAST_HOPS = 0x4 + sysIPV6_MULTICAST_IF = 0x9 + sysIPV6_MULTICAST_HOPS = 0xa + sysIPV6_MULTICAST_LOOP = 0xb + sysIPV6_JOIN_GROUP = 0xc + sysIPV6_LEAVE_GROUP = 0xd + sysIPV6_PORTRANGE = 0xe + sysICMP6_FILTER = 0x12 + + sysIPV6_CHECKSUM = 0x1a + sysIPV6_V6ONLY = 0x1b + + sysIPV6_IPSEC_POLICY = 0x1c + + sysIPV6_RTHDRDSTOPTS = 0x23 + + sysIPV6_RECVPKTINFO = 0x24 + sysIPV6_RECVHOPLIMIT = 0x25 + sysIPV6_RECVRTHDR = 0x26 + sysIPV6_RECVHOPOPTS = 0x27 + sysIPV6_RECVDSTOPTS = 0x28 + + sysIPV6_USE_MIN_MTU = 0x2a + sysIPV6_RECVPATHMTU = 0x2b + + sysIPV6_PATHMTU = 0x2c + + sysIPV6_PKTINFO = 0x2e + sysIPV6_HOPLIMIT = 0x2f + sysIPV6_NEXTHOP = 0x30 + sysIPV6_HOPOPTS = 0x31 + sysIPV6_DSTOPTS = 0x32 + sysIPV6_RTHDR = 0x33 + + sysIPV6_RECVTCLASS = 0x39 + + sysIPV6_AUTOFLOWLABEL = 0x3b + + sysIPV6_TCLASS = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_PREFER_TEMPADDR = 0x3f + + sysIPV6_BINDANY = 0x40 + + sysIPV6_MSFILTER = 0x4a + + sysMCAST_JOIN_GROUP = 0x50 + sysMCAST_LEAVE_GROUP = 0x51 + sysMCAST_JOIN_SOURCE_GROUP = 0x52 + sysMCAST_LEAVE_SOURCE_GROUP = 0x53 + sysMCAST_BLOCK_SOURCE = 0x54 + sysMCAST_UNBLOCK_SOURCE = 0x55 + + sysIPV6_PORTRANGE_DEFAULT = 0x0 + sysIPV6_PORTRANGE_HIGH = 0x1 + sysIPV6_PORTRANGE_LOW = 0x2 + sizeofSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_freebsd_amd64.go b/vendor/golang.org/x/net/ipv6/zsys_freebsd_amd64.go index 72a1a65a23..490ce7cf10 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_freebsd_amd64.go +++ b/vendor/golang.org/x/net/ipv6/zsys_freebsd_amd64.go @@ -4,6 +4,64 @@ package ipv6 const ( + sysIPV6_UNICAST_HOPS = 0x4 + sysIPV6_MULTICAST_IF = 0x9 + sysIPV6_MULTICAST_HOPS = 0xa + sysIPV6_MULTICAST_LOOP = 0xb + sysIPV6_JOIN_GROUP = 0xc + sysIPV6_LEAVE_GROUP = 0xd + sysIPV6_PORTRANGE = 0xe + sysICMP6_FILTER = 0x12 + + sysIPV6_CHECKSUM = 0x1a + sysIPV6_V6ONLY = 0x1b + + sysIPV6_IPSEC_POLICY = 0x1c + + sysIPV6_RTHDRDSTOPTS = 0x23 + + sysIPV6_RECVPKTINFO = 0x24 + sysIPV6_RECVHOPLIMIT = 0x25 + sysIPV6_RECVRTHDR = 0x26 + sysIPV6_RECVHOPOPTS = 0x27 + sysIPV6_RECVDSTOPTS = 0x28 + + sysIPV6_USE_MIN_MTU = 0x2a + sysIPV6_RECVPATHMTU = 0x2b + + sysIPV6_PATHMTU = 0x2c + + sysIPV6_PKTINFO = 0x2e + sysIPV6_HOPLIMIT = 0x2f + sysIPV6_NEXTHOP = 0x30 + sysIPV6_HOPOPTS = 0x31 + sysIPV6_DSTOPTS = 0x32 + sysIPV6_RTHDR = 0x33 + + sysIPV6_RECVTCLASS = 0x39 + + sysIPV6_AUTOFLOWLABEL = 0x3b + + sysIPV6_TCLASS = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_PREFER_TEMPADDR = 0x3f + + sysIPV6_BINDANY = 0x40 + + sysIPV6_MSFILTER = 0x4a + + sysMCAST_JOIN_GROUP = 0x50 + sysMCAST_LEAVE_GROUP = 0x51 + sysMCAST_JOIN_SOURCE_GROUP = 0x52 + sysMCAST_LEAVE_SOURCE_GROUP = 0x53 + sysMCAST_BLOCK_SOURCE = 0x54 + sysMCAST_UNBLOCK_SOURCE = 0x55 + + sysIPV6_PORTRANGE_DEFAULT = 0x0 + sysIPV6_PORTRANGE_HIGH = 0x1 + sysIPV6_PORTRANGE_LOW = 0x2 + sizeofSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm.go b/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm.go index 72a1a65a23..490ce7cf10 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm.go +++ b/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm.go @@ -4,6 +4,64 @@ package ipv6 const ( + sysIPV6_UNICAST_HOPS = 0x4 + sysIPV6_MULTICAST_IF = 0x9 + sysIPV6_MULTICAST_HOPS = 0xa + sysIPV6_MULTICAST_LOOP = 0xb + sysIPV6_JOIN_GROUP = 0xc + sysIPV6_LEAVE_GROUP = 0xd + sysIPV6_PORTRANGE = 0xe + sysICMP6_FILTER = 0x12 + + sysIPV6_CHECKSUM = 0x1a + sysIPV6_V6ONLY = 0x1b + + sysIPV6_IPSEC_POLICY = 0x1c + + sysIPV6_RTHDRDSTOPTS = 0x23 + + sysIPV6_RECVPKTINFO = 0x24 + sysIPV6_RECVHOPLIMIT = 0x25 + sysIPV6_RECVRTHDR = 0x26 + sysIPV6_RECVHOPOPTS = 0x27 + sysIPV6_RECVDSTOPTS = 0x28 + + sysIPV6_USE_MIN_MTU = 0x2a + sysIPV6_RECVPATHMTU = 0x2b + + sysIPV6_PATHMTU = 0x2c + + sysIPV6_PKTINFO = 0x2e + sysIPV6_HOPLIMIT = 0x2f + sysIPV6_NEXTHOP = 0x30 + sysIPV6_HOPOPTS = 0x31 + sysIPV6_DSTOPTS = 0x32 + sysIPV6_RTHDR = 0x33 + + sysIPV6_RECVTCLASS = 0x39 + + sysIPV6_AUTOFLOWLABEL = 0x3b + + sysIPV6_TCLASS = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_PREFER_TEMPADDR = 0x3f + + sysIPV6_BINDANY = 0x40 + + sysIPV6_MSFILTER = 0x4a + + sysMCAST_JOIN_GROUP = 0x50 + sysMCAST_LEAVE_GROUP = 0x51 + sysMCAST_JOIN_SOURCE_GROUP = 0x52 + sysMCAST_LEAVE_SOURCE_GROUP = 0x53 + sysMCAST_BLOCK_SOURCE = 0x54 + sysMCAST_UNBLOCK_SOURCE = 0x55 + + sysIPV6_PORTRANGE_DEFAULT = 0x0 + sysIPV6_PORTRANGE_HIGH = 0x1 + sysIPV6_PORTRANGE_LOW = 0x2 + sizeofSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm64.go b/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm64.go index 5b39eb8dfd..47e99ac9d3 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm64.go +++ b/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm64.go @@ -4,6 +4,64 @@ package ipv6 const ( + sysIPV6_UNICAST_HOPS = 0x4 + sysIPV6_MULTICAST_IF = 0x9 + sysIPV6_MULTICAST_HOPS = 0xa + sysIPV6_MULTICAST_LOOP = 0xb + sysIPV6_JOIN_GROUP = 0xc + sysIPV6_LEAVE_GROUP = 0xd + sysIPV6_PORTRANGE = 0xe + sysICMP6_FILTER = 0x12 + + sysIPV6_CHECKSUM = 0x1a + sysIPV6_V6ONLY = 0x1b + + sysIPV6_IPSEC_POLICY = 0x1c + + sysIPV6_RTHDRDSTOPTS = 0x23 + + sysIPV6_RECVPKTINFO = 0x24 + sysIPV6_RECVHOPLIMIT = 0x25 + sysIPV6_RECVRTHDR = 0x26 + sysIPV6_RECVHOPOPTS = 0x27 + sysIPV6_RECVDSTOPTS = 0x28 + + sysIPV6_USE_MIN_MTU = 0x2a + sysIPV6_RECVPATHMTU = 0x2b + + sysIPV6_PATHMTU = 0x2c + + sysIPV6_PKTINFO = 0x2e + sysIPV6_HOPLIMIT = 0x2f + sysIPV6_NEXTHOP = 0x30 + sysIPV6_HOPOPTS = 0x31 + sysIPV6_DSTOPTS = 0x32 + sysIPV6_RTHDR = 0x33 + + sysIPV6_RECVTCLASS = 0x39 + + sysIPV6_AUTOFLOWLABEL = 0x3b + + sysIPV6_TCLASS = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_PREFER_TEMPADDR = 0x3f + + sysIPV6_BINDANY = 0x40 + + sysIPV6_MSFILTER = 0x4a + + sysMCAST_JOIN_GROUP = 0x50 + sysMCAST_LEAVE_GROUP = 0x51 + sysMCAST_JOIN_SOURCE_GROUP = 0x52 + sysMCAST_LEAVE_SOURCE_GROUP = 0x53 + sysMCAST_BLOCK_SOURCE = 0x54 + sysMCAST_UNBLOCK_SOURCE = 0x55 + + sysIPV6_PORTRANGE_DEFAULT = 0x0 + sysIPV6_PORTRANGE_HIGH = 0x1 + sysIPV6_PORTRANGE_LOW = 0x2 + sizeofSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_386.go b/vendor/golang.org/x/net/ipv6/zsys_linux_386.go index ad71871b78..bde4a8f8f5 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_386.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_386.go @@ -4,6 +4,86 @@ package ipv6 const ( + sysIPV6_ADDRFORM = 0x1 + sysIPV6_2292PKTINFO = 0x2 + sysIPV6_2292HOPOPTS = 0x3 + sysIPV6_2292DSTOPTS = 0x4 + sysIPV6_2292RTHDR = 0x5 + sysIPV6_2292PKTOPTIONS = 0x6 + sysIPV6_CHECKSUM = 0x7 + sysIPV6_2292HOPLIMIT = 0x8 + sysIPV6_NEXTHOP = 0x9 + sysIPV6_FLOWINFO = 0xb + + sysIPV6_UNICAST_HOPS = 0x10 + sysIPV6_MULTICAST_IF = 0x11 + sysIPV6_MULTICAST_HOPS = 0x12 + sysIPV6_MULTICAST_LOOP = 0x13 + sysIPV6_ADD_MEMBERSHIP = 0x14 + sysIPV6_DROP_MEMBERSHIP = 0x15 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIPV6_ROUTER_ALERT = 0x16 + sysIPV6_MTU_DISCOVER = 0x17 + sysIPV6_MTU = 0x18 + sysIPV6_RECVERR = 0x19 + sysIPV6_V6ONLY = 0x1a + sysIPV6_JOIN_ANYCAST = 0x1b + sysIPV6_LEAVE_ANYCAST = 0x1c + + sysIPV6_FLOWLABEL_MGR = 0x20 + sysIPV6_FLOWINFO_SEND = 0x21 + + sysIPV6_IPSEC_POLICY = 0x22 + sysIPV6_XFRM_POLICY = 0x23 + + sysIPV6_RECVPKTINFO = 0x31 + sysIPV6_PKTINFO = 0x32 + sysIPV6_RECVHOPLIMIT = 0x33 + sysIPV6_HOPLIMIT = 0x34 + sysIPV6_RECVHOPOPTS = 0x35 + sysIPV6_HOPOPTS = 0x36 + sysIPV6_RTHDRDSTOPTS = 0x37 + sysIPV6_RECVRTHDR = 0x38 + sysIPV6_RTHDR = 0x39 + sysIPV6_RECVDSTOPTS = 0x3a + sysIPV6_DSTOPTS = 0x3b + sysIPV6_RECVPATHMTU = 0x3c + sysIPV6_PATHMTU = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_RECVTCLASS = 0x42 + sysIPV6_TCLASS = 0x43 + + sysIPV6_ADDR_PREFERENCES = 0x48 + + sysIPV6_PREFER_SRC_TMP = 0x1 + sysIPV6_PREFER_SRC_PUBLIC = 0x2 + sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 + sysIPV6_PREFER_SRC_COA = 0x4 + sysIPV6_PREFER_SRC_HOME = 0x400 + sysIPV6_PREFER_SRC_CGA = 0x8 + sysIPV6_PREFER_SRC_NONCGA = 0x800 + + sysIPV6_MINHOPCOUNT = 0x49 + + sysIPV6_ORIGDSTADDR = 0x4a + sysIPV6_RECVORIGDSTADDR = 0x4a + sysIPV6_TRANSPARENT = 0x4b + sysIPV6_UNICAST_IF = 0x4c + + sysICMPV6_FILTER = 0x1 + + sysICMPV6_FILTER_BLOCK = 0x1 + sysICMPV6_FILTER_PASS = 0x2 + sysICMPV6_FILTER_BLOCKOTHERS = 0x3 + sysICMPV6_FILTER_PASSONLY = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_amd64.go b/vendor/golang.org/x/net/ipv6/zsys_linux_amd64.go index 2514ab9a41..992ac9ec5f 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_amd64.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_amd64.go @@ -4,6 +4,86 @@ package ipv6 const ( + sysIPV6_ADDRFORM = 0x1 + sysIPV6_2292PKTINFO = 0x2 + sysIPV6_2292HOPOPTS = 0x3 + sysIPV6_2292DSTOPTS = 0x4 + sysIPV6_2292RTHDR = 0x5 + sysIPV6_2292PKTOPTIONS = 0x6 + sysIPV6_CHECKSUM = 0x7 + sysIPV6_2292HOPLIMIT = 0x8 + sysIPV6_NEXTHOP = 0x9 + sysIPV6_FLOWINFO = 0xb + + sysIPV6_UNICAST_HOPS = 0x10 + sysIPV6_MULTICAST_IF = 0x11 + sysIPV6_MULTICAST_HOPS = 0x12 + sysIPV6_MULTICAST_LOOP = 0x13 + sysIPV6_ADD_MEMBERSHIP = 0x14 + sysIPV6_DROP_MEMBERSHIP = 0x15 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIPV6_ROUTER_ALERT = 0x16 + sysIPV6_MTU_DISCOVER = 0x17 + sysIPV6_MTU = 0x18 + sysIPV6_RECVERR = 0x19 + sysIPV6_V6ONLY = 0x1a + sysIPV6_JOIN_ANYCAST = 0x1b + sysIPV6_LEAVE_ANYCAST = 0x1c + + sysIPV6_FLOWLABEL_MGR = 0x20 + sysIPV6_FLOWINFO_SEND = 0x21 + + sysIPV6_IPSEC_POLICY = 0x22 + sysIPV6_XFRM_POLICY = 0x23 + + sysIPV6_RECVPKTINFO = 0x31 + sysIPV6_PKTINFO = 0x32 + sysIPV6_RECVHOPLIMIT = 0x33 + sysIPV6_HOPLIMIT = 0x34 + sysIPV6_RECVHOPOPTS = 0x35 + sysIPV6_HOPOPTS = 0x36 + sysIPV6_RTHDRDSTOPTS = 0x37 + sysIPV6_RECVRTHDR = 0x38 + sysIPV6_RTHDR = 0x39 + sysIPV6_RECVDSTOPTS = 0x3a + sysIPV6_DSTOPTS = 0x3b + sysIPV6_RECVPATHMTU = 0x3c + sysIPV6_PATHMTU = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_RECVTCLASS = 0x42 + sysIPV6_TCLASS = 0x43 + + sysIPV6_ADDR_PREFERENCES = 0x48 + + sysIPV6_PREFER_SRC_TMP = 0x1 + sysIPV6_PREFER_SRC_PUBLIC = 0x2 + sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 + sysIPV6_PREFER_SRC_COA = 0x4 + sysIPV6_PREFER_SRC_HOME = 0x400 + sysIPV6_PREFER_SRC_CGA = 0x8 + sysIPV6_PREFER_SRC_NONCGA = 0x800 + + sysIPV6_MINHOPCOUNT = 0x49 + + sysIPV6_ORIGDSTADDR = 0x4a + sysIPV6_RECVORIGDSTADDR = 0x4a + sysIPV6_TRANSPARENT = 0x4b + sysIPV6_UNICAST_IF = 0x4c + + sysICMPV6_FILTER = 0x1 + + sysICMPV6_FILTER_BLOCK = 0x1 + sysICMPV6_FILTER_PASS = 0x2 + sysICMPV6_FILTER_BLOCKOTHERS = 0x3 + sysICMPV6_FILTER_PASSONLY = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_arm.go b/vendor/golang.org/x/net/ipv6/zsys_linux_arm.go index ad71871b78..bde4a8f8f5 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_arm.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_arm.go @@ -4,6 +4,86 @@ package ipv6 const ( + sysIPV6_ADDRFORM = 0x1 + sysIPV6_2292PKTINFO = 0x2 + sysIPV6_2292HOPOPTS = 0x3 + sysIPV6_2292DSTOPTS = 0x4 + sysIPV6_2292RTHDR = 0x5 + sysIPV6_2292PKTOPTIONS = 0x6 + sysIPV6_CHECKSUM = 0x7 + sysIPV6_2292HOPLIMIT = 0x8 + sysIPV6_NEXTHOP = 0x9 + sysIPV6_FLOWINFO = 0xb + + sysIPV6_UNICAST_HOPS = 0x10 + sysIPV6_MULTICAST_IF = 0x11 + sysIPV6_MULTICAST_HOPS = 0x12 + sysIPV6_MULTICAST_LOOP = 0x13 + sysIPV6_ADD_MEMBERSHIP = 0x14 + sysIPV6_DROP_MEMBERSHIP = 0x15 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIPV6_ROUTER_ALERT = 0x16 + sysIPV6_MTU_DISCOVER = 0x17 + sysIPV6_MTU = 0x18 + sysIPV6_RECVERR = 0x19 + sysIPV6_V6ONLY = 0x1a + sysIPV6_JOIN_ANYCAST = 0x1b + sysIPV6_LEAVE_ANYCAST = 0x1c + + sysIPV6_FLOWLABEL_MGR = 0x20 + sysIPV6_FLOWINFO_SEND = 0x21 + + sysIPV6_IPSEC_POLICY = 0x22 + sysIPV6_XFRM_POLICY = 0x23 + + sysIPV6_RECVPKTINFO = 0x31 + sysIPV6_PKTINFO = 0x32 + sysIPV6_RECVHOPLIMIT = 0x33 + sysIPV6_HOPLIMIT = 0x34 + sysIPV6_RECVHOPOPTS = 0x35 + sysIPV6_HOPOPTS = 0x36 + sysIPV6_RTHDRDSTOPTS = 0x37 + sysIPV6_RECVRTHDR = 0x38 + sysIPV6_RTHDR = 0x39 + sysIPV6_RECVDSTOPTS = 0x3a + sysIPV6_DSTOPTS = 0x3b + sysIPV6_RECVPATHMTU = 0x3c + sysIPV6_PATHMTU = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_RECVTCLASS = 0x42 + sysIPV6_TCLASS = 0x43 + + sysIPV6_ADDR_PREFERENCES = 0x48 + + sysIPV6_PREFER_SRC_TMP = 0x1 + sysIPV6_PREFER_SRC_PUBLIC = 0x2 + sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 + sysIPV6_PREFER_SRC_COA = 0x4 + sysIPV6_PREFER_SRC_HOME = 0x400 + sysIPV6_PREFER_SRC_CGA = 0x8 + sysIPV6_PREFER_SRC_NONCGA = 0x800 + + sysIPV6_MINHOPCOUNT = 0x49 + + sysIPV6_ORIGDSTADDR = 0x4a + sysIPV6_RECVORIGDSTADDR = 0x4a + sysIPV6_TRANSPARENT = 0x4b + sysIPV6_UNICAST_IF = 0x4c + + sysICMPV6_FILTER = 0x1 + + sysICMPV6_FILTER_BLOCK = 0x1 + sysICMPV6_FILTER_PASS = 0x2 + sysICMPV6_FILTER_BLOCKOTHERS = 0x3 + sysICMPV6_FILTER_PASSONLY = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_arm64.go b/vendor/golang.org/x/net/ipv6/zsys_linux_arm64.go index 2514ab9a41..992ac9ec5f 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_arm64.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_arm64.go @@ -4,6 +4,86 @@ package ipv6 const ( + sysIPV6_ADDRFORM = 0x1 + sysIPV6_2292PKTINFO = 0x2 + sysIPV6_2292HOPOPTS = 0x3 + sysIPV6_2292DSTOPTS = 0x4 + sysIPV6_2292RTHDR = 0x5 + sysIPV6_2292PKTOPTIONS = 0x6 + sysIPV6_CHECKSUM = 0x7 + sysIPV6_2292HOPLIMIT = 0x8 + sysIPV6_NEXTHOP = 0x9 + sysIPV6_FLOWINFO = 0xb + + sysIPV6_UNICAST_HOPS = 0x10 + sysIPV6_MULTICAST_IF = 0x11 + sysIPV6_MULTICAST_HOPS = 0x12 + sysIPV6_MULTICAST_LOOP = 0x13 + sysIPV6_ADD_MEMBERSHIP = 0x14 + sysIPV6_DROP_MEMBERSHIP = 0x15 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIPV6_ROUTER_ALERT = 0x16 + sysIPV6_MTU_DISCOVER = 0x17 + sysIPV6_MTU = 0x18 + sysIPV6_RECVERR = 0x19 + sysIPV6_V6ONLY = 0x1a + sysIPV6_JOIN_ANYCAST = 0x1b + sysIPV6_LEAVE_ANYCAST = 0x1c + + sysIPV6_FLOWLABEL_MGR = 0x20 + sysIPV6_FLOWINFO_SEND = 0x21 + + sysIPV6_IPSEC_POLICY = 0x22 + sysIPV6_XFRM_POLICY = 0x23 + + sysIPV6_RECVPKTINFO = 0x31 + sysIPV6_PKTINFO = 0x32 + sysIPV6_RECVHOPLIMIT = 0x33 + sysIPV6_HOPLIMIT = 0x34 + sysIPV6_RECVHOPOPTS = 0x35 + sysIPV6_HOPOPTS = 0x36 + sysIPV6_RTHDRDSTOPTS = 0x37 + sysIPV6_RECVRTHDR = 0x38 + sysIPV6_RTHDR = 0x39 + sysIPV6_RECVDSTOPTS = 0x3a + sysIPV6_DSTOPTS = 0x3b + sysIPV6_RECVPATHMTU = 0x3c + sysIPV6_PATHMTU = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_RECVTCLASS = 0x42 + sysIPV6_TCLASS = 0x43 + + sysIPV6_ADDR_PREFERENCES = 0x48 + + sysIPV6_PREFER_SRC_TMP = 0x1 + sysIPV6_PREFER_SRC_PUBLIC = 0x2 + sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 + sysIPV6_PREFER_SRC_COA = 0x4 + sysIPV6_PREFER_SRC_HOME = 0x400 + sysIPV6_PREFER_SRC_CGA = 0x8 + sysIPV6_PREFER_SRC_NONCGA = 0x800 + + sysIPV6_MINHOPCOUNT = 0x49 + + sysIPV6_ORIGDSTADDR = 0x4a + sysIPV6_RECVORIGDSTADDR = 0x4a + sysIPV6_TRANSPARENT = 0x4b + sysIPV6_UNICAST_IF = 0x4c + + sysICMPV6_FILTER = 0x1 + + sysICMPV6_FILTER_BLOCK = 0x1 + sysICMPV6_FILTER_PASS = 0x2 + sysICMPV6_FILTER_BLOCKOTHERS = 0x3 + sysICMPV6_FILTER_PASSONLY = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_mips.go b/vendor/golang.org/x/net/ipv6/zsys_linux_mips.go index ad71871b78..bde4a8f8f5 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_mips.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_mips.go @@ -4,6 +4,86 @@ package ipv6 const ( + sysIPV6_ADDRFORM = 0x1 + sysIPV6_2292PKTINFO = 0x2 + sysIPV6_2292HOPOPTS = 0x3 + sysIPV6_2292DSTOPTS = 0x4 + sysIPV6_2292RTHDR = 0x5 + sysIPV6_2292PKTOPTIONS = 0x6 + sysIPV6_CHECKSUM = 0x7 + sysIPV6_2292HOPLIMIT = 0x8 + sysIPV6_NEXTHOP = 0x9 + sysIPV6_FLOWINFO = 0xb + + sysIPV6_UNICAST_HOPS = 0x10 + sysIPV6_MULTICAST_IF = 0x11 + sysIPV6_MULTICAST_HOPS = 0x12 + sysIPV6_MULTICAST_LOOP = 0x13 + sysIPV6_ADD_MEMBERSHIP = 0x14 + sysIPV6_DROP_MEMBERSHIP = 0x15 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIPV6_ROUTER_ALERT = 0x16 + sysIPV6_MTU_DISCOVER = 0x17 + sysIPV6_MTU = 0x18 + sysIPV6_RECVERR = 0x19 + sysIPV6_V6ONLY = 0x1a + sysIPV6_JOIN_ANYCAST = 0x1b + sysIPV6_LEAVE_ANYCAST = 0x1c + + sysIPV6_FLOWLABEL_MGR = 0x20 + sysIPV6_FLOWINFO_SEND = 0x21 + + sysIPV6_IPSEC_POLICY = 0x22 + sysIPV6_XFRM_POLICY = 0x23 + + sysIPV6_RECVPKTINFO = 0x31 + sysIPV6_PKTINFO = 0x32 + sysIPV6_RECVHOPLIMIT = 0x33 + sysIPV6_HOPLIMIT = 0x34 + sysIPV6_RECVHOPOPTS = 0x35 + sysIPV6_HOPOPTS = 0x36 + sysIPV6_RTHDRDSTOPTS = 0x37 + sysIPV6_RECVRTHDR = 0x38 + sysIPV6_RTHDR = 0x39 + sysIPV6_RECVDSTOPTS = 0x3a + sysIPV6_DSTOPTS = 0x3b + sysIPV6_RECVPATHMTU = 0x3c + sysIPV6_PATHMTU = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_RECVTCLASS = 0x42 + sysIPV6_TCLASS = 0x43 + + sysIPV6_ADDR_PREFERENCES = 0x48 + + sysIPV6_PREFER_SRC_TMP = 0x1 + sysIPV6_PREFER_SRC_PUBLIC = 0x2 + sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 + sysIPV6_PREFER_SRC_COA = 0x4 + sysIPV6_PREFER_SRC_HOME = 0x400 + sysIPV6_PREFER_SRC_CGA = 0x8 + sysIPV6_PREFER_SRC_NONCGA = 0x800 + + sysIPV6_MINHOPCOUNT = 0x49 + + sysIPV6_ORIGDSTADDR = 0x4a + sysIPV6_RECVORIGDSTADDR = 0x4a + sysIPV6_TRANSPARENT = 0x4b + sysIPV6_UNICAST_IF = 0x4c + + sysICMPV6_FILTER = 0x1 + + sysICMPV6_FILTER_BLOCK = 0x1 + sysICMPV6_FILTER_PASS = 0x2 + sysICMPV6_FILTER_BLOCKOTHERS = 0x3 + sysICMPV6_FILTER_PASSONLY = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_mips64.go b/vendor/golang.org/x/net/ipv6/zsys_linux_mips64.go index 2514ab9a41..992ac9ec5f 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_mips64.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_mips64.go @@ -4,6 +4,86 @@ package ipv6 const ( + sysIPV6_ADDRFORM = 0x1 + sysIPV6_2292PKTINFO = 0x2 + sysIPV6_2292HOPOPTS = 0x3 + sysIPV6_2292DSTOPTS = 0x4 + sysIPV6_2292RTHDR = 0x5 + sysIPV6_2292PKTOPTIONS = 0x6 + sysIPV6_CHECKSUM = 0x7 + sysIPV6_2292HOPLIMIT = 0x8 + sysIPV6_NEXTHOP = 0x9 + sysIPV6_FLOWINFO = 0xb + + sysIPV6_UNICAST_HOPS = 0x10 + sysIPV6_MULTICAST_IF = 0x11 + sysIPV6_MULTICAST_HOPS = 0x12 + sysIPV6_MULTICAST_LOOP = 0x13 + sysIPV6_ADD_MEMBERSHIP = 0x14 + sysIPV6_DROP_MEMBERSHIP = 0x15 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIPV6_ROUTER_ALERT = 0x16 + sysIPV6_MTU_DISCOVER = 0x17 + sysIPV6_MTU = 0x18 + sysIPV6_RECVERR = 0x19 + sysIPV6_V6ONLY = 0x1a + sysIPV6_JOIN_ANYCAST = 0x1b + sysIPV6_LEAVE_ANYCAST = 0x1c + + sysIPV6_FLOWLABEL_MGR = 0x20 + sysIPV6_FLOWINFO_SEND = 0x21 + + sysIPV6_IPSEC_POLICY = 0x22 + sysIPV6_XFRM_POLICY = 0x23 + + sysIPV6_RECVPKTINFO = 0x31 + sysIPV6_PKTINFO = 0x32 + sysIPV6_RECVHOPLIMIT = 0x33 + sysIPV6_HOPLIMIT = 0x34 + sysIPV6_RECVHOPOPTS = 0x35 + sysIPV6_HOPOPTS = 0x36 + sysIPV6_RTHDRDSTOPTS = 0x37 + sysIPV6_RECVRTHDR = 0x38 + sysIPV6_RTHDR = 0x39 + sysIPV6_RECVDSTOPTS = 0x3a + sysIPV6_DSTOPTS = 0x3b + sysIPV6_RECVPATHMTU = 0x3c + sysIPV6_PATHMTU = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_RECVTCLASS = 0x42 + sysIPV6_TCLASS = 0x43 + + sysIPV6_ADDR_PREFERENCES = 0x48 + + sysIPV6_PREFER_SRC_TMP = 0x1 + sysIPV6_PREFER_SRC_PUBLIC = 0x2 + sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 + sysIPV6_PREFER_SRC_COA = 0x4 + sysIPV6_PREFER_SRC_HOME = 0x400 + sysIPV6_PREFER_SRC_CGA = 0x8 + sysIPV6_PREFER_SRC_NONCGA = 0x800 + + sysIPV6_MINHOPCOUNT = 0x49 + + sysIPV6_ORIGDSTADDR = 0x4a + sysIPV6_RECVORIGDSTADDR = 0x4a + sysIPV6_TRANSPARENT = 0x4b + sysIPV6_UNICAST_IF = 0x4c + + sysICMPV6_FILTER = 0x1 + + sysICMPV6_FILTER_BLOCK = 0x1 + sysICMPV6_FILTER_PASS = 0x2 + sysICMPV6_FILTER_BLOCKOTHERS = 0x3 + sysICMPV6_FILTER_PASSONLY = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_mips64le.go b/vendor/golang.org/x/net/ipv6/zsys_linux_mips64le.go index 2514ab9a41..992ac9ec5f 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_mips64le.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_mips64le.go @@ -4,6 +4,86 @@ package ipv6 const ( + sysIPV6_ADDRFORM = 0x1 + sysIPV6_2292PKTINFO = 0x2 + sysIPV6_2292HOPOPTS = 0x3 + sysIPV6_2292DSTOPTS = 0x4 + sysIPV6_2292RTHDR = 0x5 + sysIPV6_2292PKTOPTIONS = 0x6 + sysIPV6_CHECKSUM = 0x7 + sysIPV6_2292HOPLIMIT = 0x8 + sysIPV6_NEXTHOP = 0x9 + sysIPV6_FLOWINFO = 0xb + + sysIPV6_UNICAST_HOPS = 0x10 + sysIPV6_MULTICAST_IF = 0x11 + sysIPV6_MULTICAST_HOPS = 0x12 + sysIPV6_MULTICAST_LOOP = 0x13 + sysIPV6_ADD_MEMBERSHIP = 0x14 + sysIPV6_DROP_MEMBERSHIP = 0x15 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIPV6_ROUTER_ALERT = 0x16 + sysIPV6_MTU_DISCOVER = 0x17 + sysIPV6_MTU = 0x18 + sysIPV6_RECVERR = 0x19 + sysIPV6_V6ONLY = 0x1a + sysIPV6_JOIN_ANYCAST = 0x1b + sysIPV6_LEAVE_ANYCAST = 0x1c + + sysIPV6_FLOWLABEL_MGR = 0x20 + sysIPV6_FLOWINFO_SEND = 0x21 + + sysIPV6_IPSEC_POLICY = 0x22 + sysIPV6_XFRM_POLICY = 0x23 + + sysIPV6_RECVPKTINFO = 0x31 + sysIPV6_PKTINFO = 0x32 + sysIPV6_RECVHOPLIMIT = 0x33 + sysIPV6_HOPLIMIT = 0x34 + sysIPV6_RECVHOPOPTS = 0x35 + sysIPV6_HOPOPTS = 0x36 + sysIPV6_RTHDRDSTOPTS = 0x37 + sysIPV6_RECVRTHDR = 0x38 + sysIPV6_RTHDR = 0x39 + sysIPV6_RECVDSTOPTS = 0x3a + sysIPV6_DSTOPTS = 0x3b + sysIPV6_RECVPATHMTU = 0x3c + sysIPV6_PATHMTU = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_RECVTCLASS = 0x42 + sysIPV6_TCLASS = 0x43 + + sysIPV6_ADDR_PREFERENCES = 0x48 + + sysIPV6_PREFER_SRC_TMP = 0x1 + sysIPV6_PREFER_SRC_PUBLIC = 0x2 + sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 + sysIPV6_PREFER_SRC_COA = 0x4 + sysIPV6_PREFER_SRC_HOME = 0x400 + sysIPV6_PREFER_SRC_CGA = 0x8 + sysIPV6_PREFER_SRC_NONCGA = 0x800 + + sysIPV6_MINHOPCOUNT = 0x49 + + sysIPV6_ORIGDSTADDR = 0x4a + sysIPV6_RECVORIGDSTADDR = 0x4a + sysIPV6_TRANSPARENT = 0x4b + sysIPV6_UNICAST_IF = 0x4c + + sysICMPV6_FILTER = 0x1 + + sysICMPV6_FILTER_BLOCK = 0x1 + sysICMPV6_FILTER_PASS = 0x2 + sysICMPV6_FILTER_BLOCKOTHERS = 0x3 + sysICMPV6_FILTER_PASSONLY = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_mipsle.go b/vendor/golang.org/x/net/ipv6/zsys_linux_mipsle.go index ad71871b78..bde4a8f8f5 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_mipsle.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_mipsle.go @@ -4,6 +4,86 @@ package ipv6 const ( + sysIPV6_ADDRFORM = 0x1 + sysIPV6_2292PKTINFO = 0x2 + sysIPV6_2292HOPOPTS = 0x3 + sysIPV6_2292DSTOPTS = 0x4 + sysIPV6_2292RTHDR = 0x5 + sysIPV6_2292PKTOPTIONS = 0x6 + sysIPV6_CHECKSUM = 0x7 + sysIPV6_2292HOPLIMIT = 0x8 + sysIPV6_NEXTHOP = 0x9 + sysIPV6_FLOWINFO = 0xb + + sysIPV6_UNICAST_HOPS = 0x10 + sysIPV6_MULTICAST_IF = 0x11 + sysIPV6_MULTICAST_HOPS = 0x12 + sysIPV6_MULTICAST_LOOP = 0x13 + sysIPV6_ADD_MEMBERSHIP = 0x14 + sysIPV6_DROP_MEMBERSHIP = 0x15 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIPV6_ROUTER_ALERT = 0x16 + sysIPV6_MTU_DISCOVER = 0x17 + sysIPV6_MTU = 0x18 + sysIPV6_RECVERR = 0x19 + sysIPV6_V6ONLY = 0x1a + sysIPV6_JOIN_ANYCAST = 0x1b + sysIPV6_LEAVE_ANYCAST = 0x1c + + sysIPV6_FLOWLABEL_MGR = 0x20 + sysIPV6_FLOWINFO_SEND = 0x21 + + sysIPV6_IPSEC_POLICY = 0x22 + sysIPV6_XFRM_POLICY = 0x23 + + sysIPV6_RECVPKTINFO = 0x31 + sysIPV6_PKTINFO = 0x32 + sysIPV6_RECVHOPLIMIT = 0x33 + sysIPV6_HOPLIMIT = 0x34 + sysIPV6_RECVHOPOPTS = 0x35 + sysIPV6_HOPOPTS = 0x36 + sysIPV6_RTHDRDSTOPTS = 0x37 + sysIPV6_RECVRTHDR = 0x38 + sysIPV6_RTHDR = 0x39 + sysIPV6_RECVDSTOPTS = 0x3a + sysIPV6_DSTOPTS = 0x3b + sysIPV6_RECVPATHMTU = 0x3c + sysIPV6_PATHMTU = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_RECVTCLASS = 0x42 + sysIPV6_TCLASS = 0x43 + + sysIPV6_ADDR_PREFERENCES = 0x48 + + sysIPV6_PREFER_SRC_TMP = 0x1 + sysIPV6_PREFER_SRC_PUBLIC = 0x2 + sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 + sysIPV6_PREFER_SRC_COA = 0x4 + sysIPV6_PREFER_SRC_HOME = 0x400 + sysIPV6_PREFER_SRC_CGA = 0x8 + sysIPV6_PREFER_SRC_NONCGA = 0x800 + + sysIPV6_MINHOPCOUNT = 0x49 + + sysIPV6_ORIGDSTADDR = 0x4a + sysIPV6_RECVORIGDSTADDR = 0x4a + sysIPV6_TRANSPARENT = 0x4b + sysIPV6_UNICAST_IF = 0x4c + + sysICMPV6_FILTER = 0x1 + + sysICMPV6_FILTER_BLOCK = 0x1 + sysICMPV6_FILTER_PASS = 0x2 + sysICMPV6_FILTER_BLOCKOTHERS = 0x3 + sysICMPV6_FILTER_PASSONLY = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_ppc.go b/vendor/golang.org/x/net/ipv6/zsys_linux_ppc.go index d06c2adecb..66fd236121 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_ppc.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_ppc.go @@ -4,6 +4,86 @@ package ipv6 const ( + sysIPV6_ADDRFORM = 0x1 + sysIPV6_2292PKTINFO = 0x2 + sysIPV6_2292HOPOPTS = 0x3 + sysIPV6_2292DSTOPTS = 0x4 + sysIPV6_2292RTHDR = 0x5 + sysIPV6_2292PKTOPTIONS = 0x6 + sysIPV6_CHECKSUM = 0x7 + sysIPV6_2292HOPLIMIT = 0x8 + sysIPV6_NEXTHOP = 0x9 + sysIPV6_FLOWINFO = 0xb + + sysIPV6_UNICAST_HOPS = 0x10 + sysIPV6_MULTICAST_IF = 0x11 + sysIPV6_MULTICAST_HOPS = 0x12 + sysIPV6_MULTICAST_LOOP = 0x13 + sysIPV6_ADD_MEMBERSHIP = 0x14 + sysIPV6_DROP_MEMBERSHIP = 0x15 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIPV6_ROUTER_ALERT = 0x16 + sysIPV6_MTU_DISCOVER = 0x17 + sysIPV6_MTU = 0x18 + sysIPV6_RECVERR = 0x19 + sysIPV6_V6ONLY = 0x1a + sysIPV6_JOIN_ANYCAST = 0x1b + sysIPV6_LEAVE_ANYCAST = 0x1c + + sysIPV6_FLOWLABEL_MGR = 0x20 + sysIPV6_FLOWINFO_SEND = 0x21 + + sysIPV6_IPSEC_POLICY = 0x22 + sysIPV6_XFRM_POLICY = 0x23 + + sysIPV6_RECVPKTINFO = 0x31 + sysIPV6_PKTINFO = 0x32 + sysIPV6_RECVHOPLIMIT = 0x33 + sysIPV6_HOPLIMIT = 0x34 + sysIPV6_RECVHOPOPTS = 0x35 + sysIPV6_HOPOPTS = 0x36 + sysIPV6_RTHDRDSTOPTS = 0x37 + sysIPV6_RECVRTHDR = 0x38 + sysIPV6_RTHDR = 0x39 + sysIPV6_RECVDSTOPTS = 0x3a + sysIPV6_DSTOPTS = 0x3b + sysIPV6_RECVPATHMTU = 0x3c + sysIPV6_PATHMTU = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_RECVTCLASS = 0x42 + sysIPV6_TCLASS = 0x43 + + sysIPV6_ADDR_PREFERENCES = 0x48 + + sysIPV6_PREFER_SRC_TMP = 0x1 + sysIPV6_PREFER_SRC_PUBLIC = 0x2 + sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 + sysIPV6_PREFER_SRC_COA = 0x4 + sysIPV6_PREFER_SRC_HOME = 0x400 + sysIPV6_PREFER_SRC_CGA = 0x8 + sysIPV6_PREFER_SRC_NONCGA = 0x800 + + sysIPV6_MINHOPCOUNT = 0x49 + + sysIPV6_ORIGDSTADDR = 0x4a + sysIPV6_RECVORIGDSTADDR = 0x4a + sysIPV6_TRANSPARENT = 0x4b + sysIPV6_UNICAST_IF = 0x4c + + sysICMPV6_FILTER = 0x1 + + sysICMPV6_FILTER_BLOCK = 0x1 + sysICMPV6_FILTER_PASS = 0x2 + sysICMPV6_FILTER_BLOCKOTHERS = 0x3 + sysICMPV6_FILTER_PASSONLY = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64.go b/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64.go index 2514ab9a41..992ac9ec5f 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64.go @@ -4,6 +4,86 @@ package ipv6 const ( + sysIPV6_ADDRFORM = 0x1 + sysIPV6_2292PKTINFO = 0x2 + sysIPV6_2292HOPOPTS = 0x3 + sysIPV6_2292DSTOPTS = 0x4 + sysIPV6_2292RTHDR = 0x5 + sysIPV6_2292PKTOPTIONS = 0x6 + sysIPV6_CHECKSUM = 0x7 + sysIPV6_2292HOPLIMIT = 0x8 + sysIPV6_NEXTHOP = 0x9 + sysIPV6_FLOWINFO = 0xb + + sysIPV6_UNICAST_HOPS = 0x10 + sysIPV6_MULTICAST_IF = 0x11 + sysIPV6_MULTICAST_HOPS = 0x12 + sysIPV6_MULTICAST_LOOP = 0x13 + sysIPV6_ADD_MEMBERSHIP = 0x14 + sysIPV6_DROP_MEMBERSHIP = 0x15 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIPV6_ROUTER_ALERT = 0x16 + sysIPV6_MTU_DISCOVER = 0x17 + sysIPV6_MTU = 0x18 + sysIPV6_RECVERR = 0x19 + sysIPV6_V6ONLY = 0x1a + sysIPV6_JOIN_ANYCAST = 0x1b + sysIPV6_LEAVE_ANYCAST = 0x1c + + sysIPV6_FLOWLABEL_MGR = 0x20 + sysIPV6_FLOWINFO_SEND = 0x21 + + sysIPV6_IPSEC_POLICY = 0x22 + sysIPV6_XFRM_POLICY = 0x23 + + sysIPV6_RECVPKTINFO = 0x31 + sysIPV6_PKTINFO = 0x32 + sysIPV6_RECVHOPLIMIT = 0x33 + sysIPV6_HOPLIMIT = 0x34 + sysIPV6_RECVHOPOPTS = 0x35 + sysIPV6_HOPOPTS = 0x36 + sysIPV6_RTHDRDSTOPTS = 0x37 + sysIPV6_RECVRTHDR = 0x38 + sysIPV6_RTHDR = 0x39 + sysIPV6_RECVDSTOPTS = 0x3a + sysIPV6_DSTOPTS = 0x3b + sysIPV6_RECVPATHMTU = 0x3c + sysIPV6_PATHMTU = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_RECVTCLASS = 0x42 + sysIPV6_TCLASS = 0x43 + + sysIPV6_ADDR_PREFERENCES = 0x48 + + sysIPV6_PREFER_SRC_TMP = 0x1 + sysIPV6_PREFER_SRC_PUBLIC = 0x2 + sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 + sysIPV6_PREFER_SRC_COA = 0x4 + sysIPV6_PREFER_SRC_HOME = 0x400 + sysIPV6_PREFER_SRC_CGA = 0x8 + sysIPV6_PREFER_SRC_NONCGA = 0x800 + + sysIPV6_MINHOPCOUNT = 0x49 + + sysIPV6_ORIGDSTADDR = 0x4a + sysIPV6_RECVORIGDSTADDR = 0x4a + sysIPV6_TRANSPARENT = 0x4b + sysIPV6_UNICAST_IF = 0x4c + + sysICMPV6_FILTER = 0x1 + + sysICMPV6_FILTER_BLOCK = 0x1 + sysICMPV6_FILTER_PASS = 0x2 + sysICMPV6_FILTER_BLOCKOTHERS = 0x3 + sysICMPV6_FILTER_PASSONLY = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64le.go b/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64le.go index 2514ab9a41..992ac9ec5f 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64le.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64le.go @@ -4,6 +4,86 @@ package ipv6 const ( + sysIPV6_ADDRFORM = 0x1 + sysIPV6_2292PKTINFO = 0x2 + sysIPV6_2292HOPOPTS = 0x3 + sysIPV6_2292DSTOPTS = 0x4 + sysIPV6_2292RTHDR = 0x5 + sysIPV6_2292PKTOPTIONS = 0x6 + sysIPV6_CHECKSUM = 0x7 + sysIPV6_2292HOPLIMIT = 0x8 + sysIPV6_NEXTHOP = 0x9 + sysIPV6_FLOWINFO = 0xb + + sysIPV6_UNICAST_HOPS = 0x10 + sysIPV6_MULTICAST_IF = 0x11 + sysIPV6_MULTICAST_HOPS = 0x12 + sysIPV6_MULTICAST_LOOP = 0x13 + sysIPV6_ADD_MEMBERSHIP = 0x14 + sysIPV6_DROP_MEMBERSHIP = 0x15 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIPV6_ROUTER_ALERT = 0x16 + sysIPV6_MTU_DISCOVER = 0x17 + sysIPV6_MTU = 0x18 + sysIPV6_RECVERR = 0x19 + sysIPV6_V6ONLY = 0x1a + sysIPV6_JOIN_ANYCAST = 0x1b + sysIPV6_LEAVE_ANYCAST = 0x1c + + sysIPV6_FLOWLABEL_MGR = 0x20 + sysIPV6_FLOWINFO_SEND = 0x21 + + sysIPV6_IPSEC_POLICY = 0x22 + sysIPV6_XFRM_POLICY = 0x23 + + sysIPV6_RECVPKTINFO = 0x31 + sysIPV6_PKTINFO = 0x32 + sysIPV6_RECVHOPLIMIT = 0x33 + sysIPV6_HOPLIMIT = 0x34 + sysIPV6_RECVHOPOPTS = 0x35 + sysIPV6_HOPOPTS = 0x36 + sysIPV6_RTHDRDSTOPTS = 0x37 + sysIPV6_RECVRTHDR = 0x38 + sysIPV6_RTHDR = 0x39 + sysIPV6_RECVDSTOPTS = 0x3a + sysIPV6_DSTOPTS = 0x3b + sysIPV6_RECVPATHMTU = 0x3c + sysIPV6_PATHMTU = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_RECVTCLASS = 0x42 + sysIPV6_TCLASS = 0x43 + + sysIPV6_ADDR_PREFERENCES = 0x48 + + sysIPV6_PREFER_SRC_TMP = 0x1 + sysIPV6_PREFER_SRC_PUBLIC = 0x2 + sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 + sysIPV6_PREFER_SRC_COA = 0x4 + sysIPV6_PREFER_SRC_HOME = 0x400 + sysIPV6_PREFER_SRC_CGA = 0x8 + sysIPV6_PREFER_SRC_NONCGA = 0x800 + + sysIPV6_MINHOPCOUNT = 0x49 + + sysIPV6_ORIGDSTADDR = 0x4a + sysIPV6_RECVORIGDSTADDR = 0x4a + sysIPV6_TRANSPARENT = 0x4b + sysIPV6_UNICAST_IF = 0x4c + + sysICMPV6_FILTER = 0x1 + + sysICMPV6_FILTER_BLOCK = 0x1 + sysICMPV6_FILTER_PASS = 0x2 + sysICMPV6_FILTER_BLOCKOTHERS = 0x3 + sysICMPV6_FILTER_PASSONLY = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_riscv64.go b/vendor/golang.org/x/net/ipv6/zsys_linux_riscv64.go index d4f78e405a..6083ddcedc 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_riscv64.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_riscv64.go @@ -1,12 +1,91 @@ // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs defs_linux.go -//go:build riscv64 // +build riscv64 package ipv6 const ( + sysIPV6_ADDRFORM = 0x1 + sysIPV6_2292PKTINFO = 0x2 + sysIPV6_2292HOPOPTS = 0x3 + sysIPV6_2292DSTOPTS = 0x4 + sysIPV6_2292RTHDR = 0x5 + sysIPV6_2292PKTOPTIONS = 0x6 + sysIPV6_CHECKSUM = 0x7 + sysIPV6_2292HOPLIMIT = 0x8 + sysIPV6_NEXTHOP = 0x9 + sysIPV6_FLOWINFO = 0xb + + sysIPV6_UNICAST_HOPS = 0x10 + sysIPV6_MULTICAST_IF = 0x11 + sysIPV6_MULTICAST_HOPS = 0x12 + sysIPV6_MULTICAST_LOOP = 0x13 + sysIPV6_ADD_MEMBERSHIP = 0x14 + sysIPV6_DROP_MEMBERSHIP = 0x15 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIPV6_ROUTER_ALERT = 0x16 + sysIPV6_MTU_DISCOVER = 0x17 + sysIPV6_MTU = 0x18 + sysIPV6_RECVERR = 0x19 + sysIPV6_V6ONLY = 0x1a + sysIPV6_JOIN_ANYCAST = 0x1b + sysIPV6_LEAVE_ANYCAST = 0x1c + + sysIPV6_FLOWLABEL_MGR = 0x20 + sysIPV6_FLOWINFO_SEND = 0x21 + + sysIPV6_IPSEC_POLICY = 0x22 + sysIPV6_XFRM_POLICY = 0x23 + + sysIPV6_RECVPKTINFO = 0x31 + sysIPV6_PKTINFO = 0x32 + sysIPV6_RECVHOPLIMIT = 0x33 + sysIPV6_HOPLIMIT = 0x34 + sysIPV6_RECVHOPOPTS = 0x35 + sysIPV6_HOPOPTS = 0x36 + sysIPV6_RTHDRDSTOPTS = 0x37 + sysIPV6_RECVRTHDR = 0x38 + sysIPV6_RTHDR = 0x39 + sysIPV6_RECVDSTOPTS = 0x3a + sysIPV6_DSTOPTS = 0x3b + sysIPV6_RECVPATHMTU = 0x3c + sysIPV6_PATHMTU = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_RECVTCLASS = 0x42 + sysIPV6_TCLASS = 0x43 + + sysIPV6_ADDR_PREFERENCES = 0x48 + + sysIPV6_PREFER_SRC_TMP = 0x1 + sysIPV6_PREFER_SRC_PUBLIC = 0x2 + sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 + sysIPV6_PREFER_SRC_COA = 0x4 + sysIPV6_PREFER_SRC_HOME = 0x400 + sysIPV6_PREFER_SRC_CGA = 0x8 + sysIPV6_PREFER_SRC_NONCGA = 0x800 + + sysIPV6_MINHOPCOUNT = 0x49 + + sysIPV6_ORIGDSTADDR = 0x4a + sysIPV6_RECVORIGDSTADDR = 0x4a + sysIPV6_TRANSPARENT = 0x4b + sysIPV6_UNICAST_IF = 0x4c + + sysICMPV6_FILTER = 0x1 + + sysICMPV6_FILTER_BLOCK = 0x1 + sysICMPV6_FILTER_PASS = 0x2 + sysICMPV6_FILTER_BLOCKOTHERS = 0x3 + sysICMPV6_FILTER_PASSONLY = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_linux_s390x.go b/vendor/golang.org/x/net/ipv6/zsys_linux_s390x.go index 2514ab9a41..992ac9ec5f 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_linux_s390x.go +++ b/vendor/golang.org/x/net/ipv6/zsys_linux_s390x.go @@ -4,6 +4,86 @@ package ipv6 const ( + sysIPV6_ADDRFORM = 0x1 + sysIPV6_2292PKTINFO = 0x2 + sysIPV6_2292HOPOPTS = 0x3 + sysIPV6_2292DSTOPTS = 0x4 + sysIPV6_2292RTHDR = 0x5 + sysIPV6_2292PKTOPTIONS = 0x6 + sysIPV6_CHECKSUM = 0x7 + sysIPV6_2292HOPLIMIT = 0x8 + sysIPV6_NEXTHOP = 0x9 + sysIPV6_FLOWINFO = 0xb + + sysIPV6_UNICAST_HOPS = 0x10 + sysIPV6_MULTICAST_IF = 0x11 + sysIPV6_MULTICAST_HOPS = 0x12 + sysIPV6_MULTICAST_LOOP = 0x13 + sysIPV6_ADD_MEMBERSHIP = 0x14 + sysIPV6_DROP_MEMBERSHIP = 0x15 + sysMCAST_JOIN_GROUP = 0x2a + sysMCAST_LEAVE_GROUP = 0x2d + sysMCAST_JOIN_SOURCE_GROUP = 0x2e + sysMCAST_LEAVE_SOURCE_GROUP = 0x2f + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_MSFILTER = 0x30 + sysIPV6_ROUTER_ALERT = 0x16 + sysIPV6_MTU_DISCOVER = 0x17 + sysIPV6_MTU = 0x18 + sysIPV6_RECVERR = 0x19 + sysIPV6_V6ONLY = 0x1a + sysIPV6_JOIN_ANYCAST = 0x1b + sysIPV6_LEAVE_ANYCAST = 0x1c + + sysIPV6_FLOWLABEL_MGR = 0x20 + sysIPV6_FLOWINFO_SEND = 0x21 + + sysIPV6_IPSEC_POLICY = 0x22 + sysIPV6_XFRM_POLICY = 0x23 + + sysIPV6_RECVPKTINFO = 0x31 + sysIPV6_PKTINFO = 0x32 + sysIPV6_RECVHOPLIMIT = 0x33 + sysIPV6_HOPLIMIT = 0x34 + sysIPV6_RECVHOPOPTS = 0x35 + sysIPV6_HOPOPTS = 0x36 + sysIPV6_RTHDRDSTOPTS = 0x37 + sysIPV6_RECVRTHDR = 0x38 + sysIPV6_RTHDR = 0x39 + sysIPV6_RECVDSTOPTS = 0x3a + sysIPV6_DSTOPTS = 0x3b + sysIPV6_RECVPATHMTU = 0x3c + sysIPV6_PATHMTU = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_RECVTCLASS = 0x42 + sysIPV6_TCLASS = 0x43 + + sysIPV6_ADDR_PREFERENCES = 0x48 + + sysIPV6_PREFER_SRC_TMP = 0x1 + sysIPV6_PREFER_SRC_PUBLIC = 0x2 + sysIPV6_PREFER_SRC_PUBTMP_DEFAULT = 0x100 + sysIPV6_PREFER_SRC_COA = 0x4 + sysIPV6_PREFER_SRC_HOME = 0x400 + sysIPV6_PREFER_SRC_CGA = 0x8 + sysIPV6_PREFER_SRC_NONCGA = 0x800 + + sysIPV6_MINHOPCOUNT = 0x49 + + sysIPV6_ORIGDSTADDR = 0x4a + sysIPV6_RECVORIGDSTADDR = 0x4a + sysIPV6_TRANSPARENT = 0x4b + sysIPV6_UNICAST_IF = 0x4c + + sysICMPV6_FILTER = 0x1 + + sysICMPV6_FILTER_BLOCK = 0x1 + sysICMPV6_FILTER_PASS = 0x2 + sysICMPV6_FILTER_BLOCKOTHERS = 0x3 + sysICMPV6_FILTER_PASSONLY = 0x4 + sizeofKernelSockaddrStorage = 0x80 sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_netbsd.go b/vendor/golang.org/x/net/ipv6/zsys_netbsd.go index f7335d5ae4..e39571e072 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_netbsd.go +++ b/vendor/golang.org/x/net/ipv6/zsys_netbsd.go @@ -4,6 +4,48 @@ package ipv6 const ( + sysIPV6_UNICAST_HOPS = 0x4 + sysIPV6_MULTICAST_IF = 0x9 + sysIPV6_MULTICAST_HOPS = 0xa + sysIPV6_MULTICAST_LOOP = 0xb + sysIPV6_JOIN_GROUP = 0xc + sysIPV6_LEAVE_GROUP = 0xd + sysIPV6_PORTRANGE = 0xe + sysICMP6_FILTER = 0x12 + + sysIPV6_CHECKSUM = 0x1a + sysIPV6_V6ONLY = 0x1b + + sysIPV6_IPSEC_POLICY = 0x1c + + sysIPV6_RTHDRDSTOPTS = 0x23 + + sysIPV6_RECVPKTINFO = 0x24 + sysIPV6_RECVHOPLIMIT = 0x25 + sysIPV6_RECVRTHDR = 0x26 + sysIPV6_RECVHOPOPTS = 0x27 + sysIPV6_RECVDSTOPTS = 0x28 + + sysIPV6_USE_MIN_MTU = 0x2a + sysIPV6_RECVPATHMTU = 0x2b + sysIPV6_PATHMTU = 0x2c + + sysIPV6_PKTINFO = 0x2e + sysIPV6_HOPLIMIT = 0x2f + sysIPV6_NEXTHOP = 0x30 + sysIPV6_HOPOPTS = 0x31 + sysIPV6_DSTOPTS = 0x32 + sysIPV6_RTHDR = 0x33 + + sysIPV6_RECVTCLASS = 0x39 + + sysIPV6_TCLASS = 0x3d + sysIPV6_DONTFRAG = 0x3e + + sysIPV6_PORTRANGE_DEFAULT = 0x0 + sysIPV6_PORTRANGE_HIGH = 0x1 + sysIPV6_PORTRANGE_LOW = 0x2 + sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 sizeofIPv6Mtuinfo = 0x20 diff --git a/vendor/golang.org/x/net/ipv6/zsys_openbsd.go b/vendor/golang.org/x/net/ipv6/zsys_openbsd.go index 6d15928122..cc1899a630 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_openbsd.go +++ b/vendor/golang.org/x/net/ipv6/zsys_openbsd.go @@ -4,6 +4,57 @@ package ipv6 const ( + sysIPV6_UNICAST_HOPS = 0x4 + sysIPV6_MULTICAST_IF = 0x9 + sysIPV6_MULTICAST_HOPS = 0xa + sysIPV6_MULTICAST_LOOP = 0xb + sysIPV6_JOIN_GROUP = 0xc + sysIPV6_LEAVE_GROUP = 0xd + sysIPV6_PORTRANGE = 0xe + sysICMP6_FILTER = 0x12 + + sysIPV6_CHECKSUM = 0x1a + sysIPV6_V6ONLY = 0x1b + + sysIPV6_RTHDRDSTOPTS = 0x23 + + sysIPV6_RECVPKTINFO = 0x24 + sysIPV6_RECVHOPLIMIT = 0x25 + sysIPV6_RECVRTHDR = 0x26 + sysIPV6_RECVHOPOPTS = 0x27 + sysIPV6_RECVDSTOPTS = 0x28 + + sysIPV6_USE_MIN_MTU = 0x2a + sysIPV6_RECVPATHMTU = 0x2b + + sysIPV6_PATHMTU = 0x2c + + sysIPV6_PKTINFO = 0x2e + sysIPV6_HOPLIMIT = 0x2f + sysIPV6_NEXTHOP = 0x30 + sysIPV6_HOPOPTS = 0x31 + sysIPV6_DSTOPTS = 0x32 + sysIPV6_RTHDR = 0x33 + + sysIPV6_AUTH_LEVEL = 0x35 + sysIPV6_ESP_TRANS_LEVEL = 0x36 + sysIPV6_ESP_NETWORK_LEVEL = 0x37 + sysIPSEC6_OUTSA = 0x38 + sysIPV6_RECVTCLASS = 0x39 + + sysIPV6_AUTOFLOWLABEL = 0x3b + sysIPV6_IPCOMP_LEVEL = 0x3c + + sysIPV6_TCLASS = 0x3d + sysIPV6_DONTFRAG = 0x3e + sysIPV6_PIPEX = 0x3f + + sysIPV6_RTABLE = 0x1021 + + sysIPV6_PORTRANGE_DEFAULT = 0x0 + sysIPV6_PORTRANGE_HIGH = 0x1 + sysIPV6_PORTRANGE_LOW = 0x2 + sizeofSockaddrInet6 = 0x1c sizeofInet6Pktinfo = 0x14 sizeofIPv6Mtuinfo = 0x20 diff --git a/vendor/golang.org/x/net/ipv6/zsys_solaris.go b/vendor/golang.org/x/net/ipv6/zsys_solaris.go index 1716197477..690eef9341 100644 --- a/vendor/golang.org/x/net/ipv6/zsys_solaris.go +++ b/vendor/golang.org/x/net/ipv6/zsys_solaris.go @@ -4,6 +4,74 @@ package ipv6 const ( + sysIPV6_UNICAST_HOPS = 0x5 + sysIPV6_MULTICAST_IF = 0x6 + sysIPV6_MULTICAST_HOPS = 0x7 + sysIPV6_MULTICAST_LOOP = 0x8 + sysIPV6_JOIN_GROUP = 0x9 + sysIPV6_LEAVE_GROUP = 0xa + + sysIPV6_PKTINFO = 0xb + + sysIPV6_HOPLIMIT = 0xc + sysIPV6_NEXTHOP = 0xd + sysIPV6_HOPOPTS = 0xe + sysIPV6_DSTOPTS = 0xf + + sysIPV6_RTHDR = 0x10 + sysIPV6_RTHDRDSTOPTS = 0x11 + + sysIPV6_RECVPKTINFO = 0x12 + sysIPV6_RECVHOPLIMIT = 0x13 + sysIPV6_RECVHOPOPTS = 0x14 + + sysIPV6_RECVRTHDR = 0x16 + + sysIPV6_RECVRTHDRDSTOPTS = 0x17 + + sysIPV6_CHECKSUM = 0x18 + sysIPV6_RECVTCLASS = 0x19 + sysIPV6_USE_MIN_MTU = 0x20 + sysIPV6_DONTFRAG = 0x21 + sysIPV6_SEC_OPT = 0x22 + sysIPV6_SRC_PREFERENCES = 0x23 + sysIPV6_RECVPATHMTU = 0x24 + sysIPV6_PATHMTU = 0x25 + sysIPV6_TCLASS = 0x26 + sysIPV6_V6ONLY = 0x27 + + sysIPV6_RECVDSTOPTS = 0x28 + + sysMCAST_JOIN_GROUP = 0x29 + sysMCAST_LEAVE_GROUP = 0x2a + sysMCAST_BLOCK_SOURCE = 0x2b + sysMCAST_UNBLOCK_SOURCE = 0x2c + sysMCAST_JOIN_SOURCE_GROUP = 0x2d + sysMCAST_LEAVE_SOURCE_GROUP = 0x2e + + sysIPV6_PREFER_SRC_HOME = 0x1 + sysIPV6_PREFER_SRC_COA = 0x2 + sysIPV6_PREFER_SRC_PUBLIC = 0x4 + sysIPV6_PREFER_SRC_TMP = 0x8 + sysIPV6_PREFER_SRC_NONCGA = 0x10 + sysIPV6_PREFER_SRC_CGA = 0x20 + + sysIPV6_PREFER_SRC_MIPMASK = 0x3 + sysIPV6_PREFER_SRC_MIPDEFAULT = 0x1 + sysIPV6_PREFER_SRC_TMPMASK = 0xc + sysIPV6_PREFER_SRC_TMPDEFAULT = 0x4 + sysIPV6_PREFER_SRC_CGAMASK = 0x30 + sysIPV6_PREFER_SRC_CGADEFAULT = 0x10 + + sysIPV6_PREFER_SRC_MASK = 0x3f + + sysIPV6_PREFER_SRC_DEFAULT = 0x15 + + sysIPV6_BOUND_IF = 0x41 + sysIPV6_UNSPEC_SRC = 0x42 + + sysICMP6_FILTER = 0x1 + sizeofSockaddrStorage = 0x100 sizeofSockaddrInet6 = 0x20 sizeofInet6Pktinfo = 0x14 diff --git a/vendor/golang.org/x/net/ipv6/zsys_zos_s390x.go b/vendor/golang.org/x/net/ipv6/zsys_zos_s390x.go deleted file mode 100644 index 7c75645967..0000000000 --- a/vendor/golang.org/x/net/ipv6/zsys_zos_s390x.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Hand edited based on zerrors_zos_s390x.go -// TODO(Bill O'Farrell): auto-generate. - -package ipv6 - -const ( - sizeofSockaddrStorage = 128 - sizeofICMPv6Filter = 32 - sizeofInet6Pktinfo = 20 - sizeofIPv6Mtuinfo = 32 - sizeofSockaddrInet6 = 28 - sizeofGroupReq = 136 - sizeofGroupSourceReq = 264 -) - -type sockaddrStorage struct { - Len uint8 - Family byte - ss_pad1 [6]byte - ss_align int64 - ss_pad2 [112]byte -} - -type sockaddrInet6 struct { - Len uint8 - Family uint8 - Port uint16 - Flowinfo uint32 - Addr [16]byte - Scope_id uint32 -} - -type inet6Pktinfo struct { - Addr [16]byte - Ifindex uint32 -} - -type ipv6Mtuinfo struct { - Addr sockaddrInet6 - Mtu uint32 -} - -type groupReq struct { - Interface uint32 - reserved uint32 - Group sockaddrStorage -} - -type groupSourceReq struct { - Interface uint32 - reserved uint32 - Group sockaddrStorage - Source sockaddrStorage -} - -type icmpv6Filter struct { - Filt [8]uint32 -} diff --git a/vendor/golang.org/x/net/nettest/nettest.go b/vendor/golang.org/x/net/nettest/nettest.go index 83ba858e24..953562f769 100644 --- a/vendor/golang.org/x/net/nettest/nettest.go +++ b/vendor/golang.org/x/net/nettest/nettest.go @@ -126,7 +126,7 @@ func TestableNetwork(network string) bool { } case "unixpacket": switch runtime.GOOS { - case "aix", "android", "fuchsia", "hurd", "darwin", "ios", "js", "nacl", "plan9", "windows", "zos": + case "aix", "android", "fuchsia", "hurd", "darwin", "ios", "js", "nacl", "plan9", "windows": return false case "netbsd": // It passes on amd64 at least. 386 fails diff --git a/vendor/golang.org/x/net/nettest/nettest_stub.go b/vendor/golang.org/x/net/nettest/nettest_stub.go index 6e3a9312b9..2bb8c05762 100644 --- a/vendor/golang.org/x/net/nettest/nettest_stub.go +++ b/vendor/golang.org/x/net/nettest/nettest_stub.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos -// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows package nettest diff --git a/vendor/golang.org/x/net/nettest/nettest_unix.go b/vendor/golang.org/x/net/nettest/nettest_unix.go index b1cb8b2f3b..afff744e8f 100644 --- a/vendor/golang.org/x/net/nettest/nettest_unix.go +++ b/vendor/golang.org/x/net/nettest/nettest_unix.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package nettest diff --git a/vendor/golang.org/x/sys/execabs/execabs.go b/vendor/golang.org/x/sys/execabs/execabs.go new file mode 100644 index 0000000000..78192498db --- /dev/null +++ b/vendor/golang.org/x/sys/execabs/execabs.go @@ -0,0 +1,102 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package execabs is a drop-in replacement for os/exec +// that requires PATH lookups to find absolute paths. +// That is, execabs.Command("cmd") runs the same PATH lookup +// as exec.Command("cmd"), but if the result is a path +// which is relative, the Run and Start methods will report +// an error instead of running the executable. +// +// See https://blog.golang.org/path-security for more information +// about when it may be necessary or appropriate to use this package. +package execabs + +import ( + "context" + "fmt" + "os/exec" + "path/filepath" + "reflect" + "unsafe" +) + +// ErrNotFound is the error resulting if a path search failed to find an executable file. +// It is an alias for exec.ErrNotFound. +var ErrNotFound = exec.ErrNotFound + +// Cmd represents an external command being prepared or run. +// It is an alias for exec.Cmd. +type Cmd = exec.Cmd + +// Error is returned by LookPath when it fails to classify a file as an executable. +// It is an alias for exec.Error. +type Error = exec.Error + +// An ExitError reports an unsuccessful exit by a command. +// It is an alias for exec.ExitError. +type ExitError = exec.ExitError + +func relError(file, path string) error { + return fmt.Errorf("%s resolves to executable in current directory (.%c%s)", file, filepath.Separator, path) +} + +// LookPath searches for an executable named file in the directories +// named by the PATH environment variable. If file contains a slash, +// it is tried directly and the PATH is not consulted. The result will be +// an absolute path. +// +// LookPath differs from exec.LookPath in its handling of PATH lookups, +// which are used for file names without slashes. If exec.LookPath's +// PATH lookup would have returned an executable from the current directory, +// LookPath instead returns an error. +func LookPath(file string) (string, error) { + path, err := exec.LookPath(file) + if err != nil { + return "", err + } + if filepath.Base(file) == file && !filepath.IsAbs(path) { + return "", relError(file, path) + } + return path, nil +} + +func fixCmd(name string, cmd *exec.Cmd) { + if filepath.Base(name) == name && !filepath.IsAbs(cmd.Path) { + // exec.Command was called with a bare binary name and + // exec.LookPath returned a path which is not absolute. + // Set cmd.lookPathErr and clear cmd.Path so that it + // cannot be run. + lookPathErr := (*error)(unsafe.Pointer(reflect.ValueOf(cmd).Elem().FieldByName("lookPathErr").Addr().Pointer())) + if *lookPathErr == nil { + *lookPathErr = relError(name, cmd.Path) + } + cmd.Path = "" + } +} + +// CommandContext is like Command but includes a context. +// +// The provided context is used to kill the process (by calling os.Process.Kill) +// if the context becomes done before the command completes on its own. +func CommandContext(ctx context.Context, name string, arg ...string) *exec.Cmd { + cmd := exec.CommandContext(ctx, name, arg...) + fixCmd(name, cmd) + return cmd + +} + +// Command returns the Cmd struct to execute the named program with the given arguments. +// See exec.Command for most details. +// +// Command differs from exec.Command in its handling of PATH lookups, +// which are used when the program name contains no slashes. +// If exec.Command would have returned an exec.Cmd configured to run an +// executable from the current directory, Command instead +// returns an exec.Cmd that will return an error from Start or Run. +func Command(name string, arg ...string) *exec.Cmd { + cmd := exec.Command(name, arg...) + fixCmd(name, cmd) + return cmd +} diff --git a/vendor/golang.org/x/term/term.go b/vendor/golang.org/x/term/term.go index 1f6a38fad2..2a4ccf8012 100644 --- a/vendor/golang.org/x/term/term.go +++ b/vendor/golang.org/x/term/term.go @@ -7,11 +7,11 @@ // // Putting a terminal into raw mode is the most common requirement: // -// oldState, err := term.MakeRaw(int(os.Stdin.Fd())) +// oldState, err := term.MakeRaw(0) // if err != nil { // panic(err) // } -// defer term.Restore(int(os.Stdin.Fd()), oldState) +// defer term.Restore(0, oldState) package term // State contains the state of a terminal. diff --git a/vendor/golang.org/x/term/term_solaris.go b/vendor/golang.org/x/term/term_solaris.go new file mode 100644 index 0000000000..b9da29744b --- /dev/null +++ b/vendor/golang.org/x/term/term_solaris.go @@ -0,0 +1,111 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package term + +import ( + "io" + "syscall" + + "golang.org/x/sys/unix" +) + +// State contains the state of a terminal. +type state struct { + termios unix.Termios +} + +func isTerminal(fd int) bool { + _, err := unix.IoctlGetTermio(fd, unix.TCGETA) + return err == nil +} + +func readPassword(fd int) ([]byte, error) { + // see also: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libast/common/uwin/getpass.c + val, err := unix.IoctlGetTermios(fd, unix.TCGETS) + if err != nil { + return nil, err + } + oldState := *val + + newState := oldState + newState.Lflag &^= syscall.ECHO + newState.Lflag |= syscall.ICANON | syscall.ISIG + newState.Iflag |= syscall.ICRNL + err = unix.IoctlSetTermios(fd, unix.TCSETS, &newState) + if err != nil { + return nil, err + } + + defer unix.IoctlSetTermios(fd, unix.TCSETS, &oldState) + + var buf [16]byte + var ret []byte + for { + n, err := syscall.Read(fd, buf[:]) + if err != nil { + return nil, err + } + if n == 0 { + if len(ret) == 0 { + return nil, io.EOF + } + break + } + if buf[n-1] == '\n' { + n-- + } + ret = append(ret, buf[:n]...) + if n < len(buf) { + break + } + } + + return ret, nil +} + +func makeRaw(fd int) (*State, error) { + // see http://cr.illumos.org/~webrev/andy_js/1060/ + termios, err := unix.IoctlGetTermios(fd, unix.TCGETS) + if err != nil { + return nil, err + } + + oldState := State{state{termios: *termios}} + + termios.Iflag &^= unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON + termios.Oflag &^= unix.OPOST + termios.Lflag &^= unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN + termios.Cflag &^= unix.CSIZE | unix.PARENB + termios.Cflag |= unix.CS8 + termios.Cc[unix.VMIN] = 1 + termios.Cc[unix.VTIME] = 0 + + if err := unix.IoctlSetTermios(fd, unix.TCSETS, termios); err != nil { + return nil, err + } + + return &oldState, nil +} + +func restore(fd int, oldState *State) error { + return unix.IoctlSetTermios(fd, unix.TCSETS, &oldState.termios) +} + +func getState(fd int) (*State, error) { + termios, err := unix.IoctlGetTermios(fd, unix.TCGETS) + if err != nil { + return nil, err + } + + return &State{state{termios: *termios}}, nil +} + +func getSize(fd int) (width, height int, err error) { + ws, err := unix.IoctlGetWinsize(fd, unix.TIOCGWINSZ) + if err != nil { + return 0, 0, err + } + return int(ws.Col), int(ws.Row), nil +} diff --git a/vendor/golang.org/x/term/term_unix.go b/vendor/golang.org/x/term/term_unix.go index a4e31ab1b2..4c60e457d0 100644 --- a/vendor/golang.org/x/term/term_unix.go +++ b/vendor/golang.org/x/term/term_unix.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos +// +build aix darwin dragonfly freebsd linux netbsd openbsd zos package term diff --git a/vendor/golang.org/x/term/term_unix_bsd.go b/vendor/golang.org/x/term/term_unix_bsd.go index 853b3d6986..3342be00b4 100644 --- a/vendor/golang.org/x/term/term_unix_bsd.go +++ b/vendor/golang.org/x/term/term_unix_bsd.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build darwin || dragonfly || freebsd || netbsd || openbsd // +build darwin dragonfly freebsd netbsd openbsd package term diff --git a/vendor/golang.org/x/term/term_unsupported.go b/vendor/golang.org/x/term/term_unsupported.go index f1df850651..8b5d1bad00 100644 --- a/vendor/golang.org/x/term/term_unsupported.go +++ b/vendor/golang.org/x/term/term_unsupported.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !zos && !windows && !solaris && !plan9 // +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!zos,!windows,!solaris,!plan9 package term diff --git a/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go index f5a0788277..26fbd55a12 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go @@ -1,6 +1,5 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build go1.10 && !go1.13 // +build go1.10,!go1.13 package norm diff --git a/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go index cb7239c437..2c58f09baa 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go @@ -1,6 +1,5 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build go1.13 && !go1.14 // +build go1.13,!go1.14 package norm diff --git a/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go index 11b2733001..10f5202c69 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go @@ -1,7 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build go1.14 && !go1.16 -// +build go1.14,!go1.16 +// +build go1.14 package norm diff --git a/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go deleted file mode 100644 index 96a130d30e..0000000000 --- a/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go +++ /dev/null @@ -1,7761 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -//go:build go1.16 -// +build go1.16 - -package norm - -import "sync" - -const ( - // Version is the Unicode edition from which the tables are derived. - Version = "13.0.0" - - // MaxTransformChunkSize indicates the maximum number of bytes that Transform - // may need to write atomically for any Form. Making a destination buffer at - // least this size ensures that Transform can always make progress and that - // the user does not need to grow the buffer on an ErrShortDst. - MaxTransformChunkSize = 35 + maxNonStarters*4 -) - -var ccc = [56]uint8{ - 0, 1, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, - 36, 84, 91, 103, 107, 118, 122, 129, - 130, 132, 202, 214, 216, 218, 220, 222, - 224, 226, 228, 230, 232, 233, 234, 240, -} - -const ( - firstMulti = 0x1870 - firstCCC = 0x2CAB - endMulti = 0x2F77 - firstLeadingCCC = 0x49C5 - firstCCCZeroExcept = 0x4A8F - firstStarterWithNLead = 0x4AB6 - lastDecomp = 0x4AB8 - maxDecomp = 0x8000 -) - -// decomps: 19128 bytes -var decomps = [...]byte{ - // Bytes 0 - 3f - 0x00, 0x41, 0x20, 0x41, 0x21, 0x41, 0x22, 0x41, - 0x23, 0x41, 0x24, 0x41, 0x25, 0x41, 0x26, 0x41, - 0x27, 0x41, 0x28, 0x41, 0x29, 0x41, 0x2A, 0x41, - 0x2B, 0x41, 0x2C, 0x41, 0x2D, 0x41, 0x2E, 0x41, - 0x2F, 0x41, 0x30, 0x41, 0x31, 0x41, 0x32, 0x41, - 0x33, 0x41, 0x34, 0x41, 0x35, 0x41, 0x36, 0x41, - 0x37, 0x41, 0x38, 0x41, 0x39, 0x41, 0x3A, 0x41, - 0x3B, 0x41, 0x3C, 0x41, 0x3D, 0x41, 0x3E, 0x41, - // Bytes 40 - 7f - 0x3F, 0x41, 0x40, 0x41, 0x41, 0x41, 0x42, 0x41, - 0x43, 0x41, 0x44, 0x41, 0x45, 0x41, 0x46, 0x41, - 0x47, 0x41, 0x48, 0x41, 0x49, 0x41, 0x4A, 0x41, - 0x4B, 0x41, 0x4C, 0x41, 0x4D, 0x41, 0x4E, 0x41, - 0x4F, 0x41, 0x50, 0x41, 0x51, 0x41, 0x52, 0x41, - 0x53, 0x41, 0x54, 0x41, 0x55, 0x41, 0x56, 0x41, - 0x57, 0x41, 0x58, 0x41, 0x59, 0x41, 0x5A, 0x41, - 0x5B, 0x41, 0x5C, 0x41, 0x5D, 0x41, 0x5E, 0x41, - // Bytes 80 - bf - 0x5F, 0x41, 0x60, 0x41, 0x61, 0x41, 0x62, 0x41, - 0x63, 0x41, 0x64, 0x41, 0x65, 0x41, 0x66, 0x41, - 0x67, 0x41, 0x68, 0x41, 0x69, 0x41, 0x6A, 0x41, - 0x6B, 0x41, 0x6C, 0x41, 0x6D, 0x41, 0x6E, 0x41, - 0x6F, 0x41, 0x70, 0x41, 0x71, 0x41, 0x72, 0x41, - 0x73, 0x41, 0x74, 0x41, 0x75, 0x41, 0x76, 0x41, - 0x77, 0x41, 0x78, 0x41, 0x79, 0x41, 0x7A, 0x41, - 0x7B, 0x41, 0x7C, 0x41, 0x7D, 0x41, 0x7E, 0x42, - // Bytes c0 - ff - 0xC2, 0xA2, 0x42, 0xC2, 0xA3, 0x42, 0xC2, 0xA5, - 0x42, 0xC2, 0xA6, 0x42, 0xC2, 0xAC, 0x42, 0xC2, - 0xB7, 0x42, 0xC3, 0x86, 0x42, 0xC3, 0xB0, 0x42, - 0xC4, 0xA6, 0x42, 0xC4, 0xA7, 0x42, 0xC4, 0xB1, - 0x42, 0xC5, 0x8B, 0x42, 0xC5, 0x93, 0x42, 0xC6, - 0x8E, 0x42, 0xC6, 0x90, 0x42, 0xC6, 0xAB, 0x42, - 0xC8, 0xA2, 0x42, 0xC8, 0xB7, 0x42, 0xC9, 0x90, - 0x42, 0xC9, 0x91, 0x42, 0xC9, 0x92, 0x42, 0xC9, - // Bytes 100 - 13f - 0x94, 0x42, 0xC9, 0x95, 0x42, 0xC9, 0x99, 0x42, - 0xC9, 0x9B, 0x42, 0xC9, 0x9C, 0x42, 0xC9, 0x9F, - 0x42, 0xC9, 0xA1, 0x42, 0xC9, 0xA3, 0x42, 0xC9, - 0xA5, 0x42, 0xC9, 0xA6, 0x42, 0xC9, 0xA8, 0x42, - 0xC9, 0xA9, 0x42, 0xC9, 0xAA, 0x42, 0xC9, 0xAB, - 0x42, 0xC9, 0xAD, 0x42, 0xC9, 0xAF, 0x42, 0xC9, - 0xB0, 0x42, 0xC9, 0xB1, 0x42, 0xC9, 0xB2, 0x42, - 0xC9, 0xB3, 0x42, 0xC9, 0xB4, 0x42, 0xC9, 0xB5, - // Bytes 140 - 17f - 0x42, 0xC9, 0xB8, 0x42, 0xC9, 0xB9, 0x42, 0xC9, - 0xBB, 0x42, 0xCA, 0x81, 0x42, 0xCA, 0x82, 0x42, - 0xCA, 0x83, 0x42, 0xCA, 0x89, 0x42, 0xCA, 0x8A, - 0x42, 0xCA, 0x8B, 0x42, 0xCA, 0x8C, 0x42, 0xCA, - 0x8D, 0x42, 0xCA, 0x90, 0x42, 0xCA, 0x91, 0x42, - 0xCA, 0x92, 0x42, 0xCA, 0x95, 0x42, 0xCA, 0x9D, - 0x42, 0xCA, 0x9F, 0x42, 0xCA, 0xB9, 0x42, 0xCE, - 0x91, 0x42, 0xCE, 0x92, 0x42, 0xCE, 0x93, 0x42, - // Bytes 180 - 1bf - 0xCE, 0x94, 0x42, 0xCE, 0x95, 0x42, 0xCE, 0x96, - 0x42, 0xCE, 0x97, 0x42, 0xCE, 0x98, 0x42, 0xCE, - 0x99, 0x42, 0xCE, 0x9A, 0x42, 0xCE, 0x9B, 0x42, - 0xCE, 0x9C, 0x42, 0xCE, 0x9D, 0x42, 0xCE, 0x9E, - 0x42, 0xCE, 0x9F, 0x42, 0xCE, 0xA0, 0x42, 0xCE, - 0xA1, 0x42, 0xCE, 0xA3, 0x42, 0xCE, 0xA4, 0x42, - 0xCE, 0xA5, 0x42, 0xCE, 0xA6, 0x42, 0xCE, 0xA7, - 0x42, 0xCE, 0xA8, 0x42, 0xCE, 0xA9, 0x42, 0xCE, - // Bytes 1c0 - 1ff - 0xB1, 0x42, 0xCE, 0xB2, 0x42, 0xCE, 0xB3, 0x42, - 0xCE, 0xB4, 0x42, 0xCE, 0xB5, 0x42, 0xCE, 0xB6, - 0x42, 0xCE, 0xB7, 0x42, 0xCE, 0xB8, 0x42, 0xCE, - 0xB9, 0x42, 0xCE, 0xBA, 0x42, 0xCE, 0xBB, 0x42, - 0xCE, 0xBC, 0x42, 0xCE, 0xBD, 0x42, 0xCE, 0xBE, - 0x42, 0xCE, 0xBF, 0x42, 0xCF, 0x80, 0x42, 0xCF, - 0x81, 0x42, 0xCF, 0x82, 0x42, 0xCF, 0x83, 0x42, - 0xCF, 0x84, 0x42, 0xCF, 0x85, 0x42, 0xCF, 0x86, - // Bytes 200 - 23f - 0x42, 0xCF, 0x87, 0x42, 0xCF, 0x88, 0x42, 0xCF, - 0x89, 0x42, 0xCF, 0x9C, 0x42, 0xCF, 0x9D, 0x42, - 0xD0, 0xBD, 0x42, 0xD1, 0x8A, 0x42, 0xD1, 0x8C, - 0x42, 0xD7, 0x90, 0x42, 0xD7, 0x91, 0x42, 0xD7, - 0x92, 0x42, 0xD7, 0x93, 0x42, 0xD7, 0x94, 0x42, - 0xD7, 0x9B, 0x42, 0xD7, 0x9C, 0x42, 0xD7, 0x9D, - 0x42, 0xD7, 0xA2, 0x42, 0xD7, 0xA8, 0x42, 0xD7, - 0xAA, 0x42, 0xD8, 0xA1, 0x42, 0xD8, 0xA7, 0x42, - // Bytes 240 - 27f - 0xD8, 0xA8, 0x42, 0xD8, 0xA9, 0x42, 0xD8, 0xAA, - 0x42, 0xD8, 0xAB, 0x42, 0xD8, 0xAC, 0x42, 0xD8, - 0xAD, 0x42, 0xD8, 0xAE, 0x42, 0xD8, 0xAF, 0x42, - 0xD8, 0xB0, 0x42, 0xD8, 0xB1, 0x42, 0xD8, 0xB2, - 0x42, 0xD8, 0xB3, 0x42, 0xD8, 0xB4, 0x42, 0xD8, - 0xB5, 0x42, 0xD8, 0xB6, 0x42, 0xD8, 0xB7, 0x42, - 0xD8, 0xB8, 0x42, 0xD8, 0xB9, 0x42, 0xD8, 0xBA, - 0x42, 0xD9, 0x81, 0x42, 0xD9, 0x82, 0x42, 0xD9, - // Bytes 280 - 2bf - 0x83, 0x42, 0xD9, 0x84, 0x42, 0xD9, 0x85, 0x42, - 0xD9, 0x86, 0x42, 0xD9, 0x87, 0x42, 0xD9, 0x88, - 0x42, 0xD9, 0x89, 0x42, 0xD9, 0x8A, 0x42, 0xD9, - 0xAE, 0x42, 0xD9, 0xAF, 0x42, 0xD9, 0xB1, 0x42, - 0xD9, 0xB9, 0x42, 0xD9, 0xBA, 0x42, 0xD9, 0xBB, - 0x42, 0xD9, 0xBE, 0x42, 0xD9, 0xBF, 0x42, 0xDA, - 0x80, 0x42, 0xDA, 0x83, 0x42, 0xDA, 0x84, 0x42, - 0xDA, 0x86, 0x42, 0xDA, 0x87, 0x42, 0xDA, 0x88, - // Bytes 2c0 - 2ff - 0x42, 0xDA, 0x8C, 0x42, 0xDA, 0x8D, 0x42, 0xDA, - 0x8E, 0x42, 0xDA, 0x91, 0x42, 0xDA, 0x98, 0x42, - 0xDA, 0xA1, 0x42, 0xDA, 0xA4, 0x42, 0xDA, 0xA6, - 0x42, 0xDA, 0xA9, 0x42, 0xDA, 0xAD, 0x42, 0xDA, - 0xAF, 0x42, 0xDA, 0xB1, 0x42, 0xDA, 0xB3, 0x42, - 0xDA, 0xBA, 0x42, 0xDA, 0xBB, 0x42, 0xDA, 0xBE, - 0x42, 0xDB, 0x81, 0x42, 0xDB, 0x85, 0x42, 0xDB, - 0x86, 0x42, 0xDB, 0x87, 0x42, 0xDB, 0x88, 0x42, - // Bytes 300 - 33f - 0xDB, 0x89, 0x42, 0xDB, 0x8B, 0x42, 0xDB, 0x8C, - 0x42, 0xDB, 0x90, 0x42, 0xDB, 0x92, 0x43, 0xE0, - 0xBC, 0x8B, 0x43, 0xE1, 0x83, 0x9C, 0x43, 0xE1, - 0x84, 0x80, 0x43, 0xE1, 0x84, 0x81, 0x43, 0xE1, - 0x84, 0x82, 0x43, 0xE1, 0x84, 0x83, 0x43, 0xE1, - 0x84, 0x84, 0x43, 0xE1, 0x84, 0x85, 0x43, 0xE1, - 0x84, 0x86, 0x43, 0xE1, 0x84, 0x87, 0x43, 0xE1, - 0x84, 0x88, 0x43, 0xE1, 0x84, 0x89, 0x43, 0xE1, - // Bytes 340 - 37f - 0x84, 0x8A, 0x43, 0xE1, 0x84, 0x8B, 0x43, 0xE1, - 0x84, 0x8C, 0x43, 0xE1, 0x84, 0x8D, 0x43, 0xE1, - 0x84, 0x8E, 0x43, 0xE1, 0x84, 0x8F, 0x43, 0xE1, - 0x84, 0x90, 0x43, 0xE1, 0x84, 0x91, 0x43, 0xE1, - 0x84, 0x92, 0x43, 0xE1, 0x84, 0x94, 0x43, 0xE1, - 0x84, 0x95, 0x43, 0xE1, 0x84, 0x9A, 0x43, 0xE1, - 0x84, 0x9C, 0x43, 0xE1, 0x84, 0x9D, 0x43, 0xE1, - 0x84, 0x9E, 0x43, 0xE1, 0x84, 0xA0, 0x43, 0xE1, - // Bytes 380 - 3bf - 0x84, 0xA1, 0x43, 0xE1, 0x84, 0xA2, 0x43, 0xE1, - 0x84, 0xA3, 0x43, 0xE1, 0x84, 0xA7, 0x43, 0xE1, - 0x84, 0xA9, 0x43, 0xE1, 0x84, 0xAB, 0x43, 0xE1, - 0x84, 0xAC, 0x43, 0xE1, 0x84, 0xAD, 0x43, 0xE1, - 0x84, 0xAE, 0x43, 0xE1, 0x84, 0xAF, 0x43, 0xE1, - 0x84, 0xB2, 0x43, 0xE1, 0x84, 0xB6, 0x43, 0xE1, - 0x85, 0x80, 0x43, 0xE1, 0x85, 0x87, 0x43, 0xE1, - 0x85, 0x8C, 0x43, 0xE1, 0x85, 0x97, 0x43, 0xE1, - // Bytes 3c0 - 3ff - 0x85, 0x98, 0x43, 0xE1, 0x85, 0x99, 0x43, 0xE1, - 0x85, 0xA0, 0x43, 0xE1, 0x86, 0x84, 0x43, 0xE1, - 0x86, 0x85, 0x43, 0xE1, 0x86, 0x88, 0x43, 0xE1, - 0x86, 0x91, 0x43, 0xE1, 0x86, 0x92, 0x43, 0xE1, - 0x86, 0x94, 0x43, 0xE1, 0x86, 0x9E, 0x43, 0xE1, - 0x86, 0xA1, 0x43, 0xE1, 0x87, 0x87, 0x43, 0xE1, - 0x87, 0x88, 0x43, 0xE1, 0x87, 0x8C, 0x43, 0xE1, - 0x87, 0x8E, 0x43, 0xE1, 0x87, 0x93, 0x43, 0xE1, - // Bytes 400 - 43f - 0x87, 0x97, 0x43, 0xE1, 0x87, 0x99, 0x43, 0xE1, - 0x87, 0x9D, 0x43, 0xE1, 0x87, 0x9F, 0x43, 0xE1, - 0x87, 0xB1, 0x43, 0xE1, 0x87, 0xB2, 0x43, 0xE1, - 0xB4, 0x82, 0x43, 0xE1, 0xB4, 0x96, 0x43, 0xE1, - 0xB4, 0x97, 0x43, 0xE1, 0xB4, 0x9C, 0x43, 0xE1, - 0xB4, 0x9D, 0x43, 0xE1, 0xB4, 0xA5, 0x43, 0xE1, - 0xB5, 0xBB, 0x43, 0xE1, 0xB6, 0x85, 0x43, 0xE2, - 0x80, 0x82, 0x43, 0xE2, 0x80, 0x83, 0x43, 0xE2, - // Bytes 440 - 47f - 0x80, 0x90, 0x43, 0xE2, 0x80, 0x93, 0x43, 0xE2, - 0x80, 0x94, 0x43, 0xE2, 0x82, 0xA9, 0x43, 0xE2, - 0x86, 0x90, 0x43, 0xE2, 0x86, 0x91, 0x43, 0xE2, - 0x86, 0x92, 0x43, 0xE2, 0x86, 0x93, 0x43, 0xE2, - 0x88, 0x82, 0x43, 0xE2, 0x88, 0x87, 0x43, 0xE2, - 0x88, 0x91, 0x43, 0xE2, 0x88, 0x92, 0x43, 0xE2, - 0x94, 0x82, 0x43, 0xE2, 0x96, 0xA0, 0x43, 0xE2, - 0x97, 0x8B, 0x43, 0xE2, 0xA6, 0x85, 0x43, 0xE2, - // Bytes 480 - 4bf - 0xA6, 0x86, 0x43, 0xE2, 0xB5, 0xA1, 0x43, 0xE3, - 0x80, 0x81, 0x43, 0xE3, 0x80, 0x82, 0x43, 0xE3, - 0x80, 0x88, 0x43, 0xE3, 0x80, 0x89, 0x43, 0xE3, - 0x80, 0x8A, 0x43, 0xE3, 0x80, 0x8B, 0x43, 0xE3, - 0x80, 0x8C, 0x43, 0xE3, 0x80, 0x8D, 0x43, 0xE3, - 0x80, 0x8E, 0x43, 0xE3, 0x80, 0x8F, 0x43, 0xE3, - 0x80, 0x90, 0x43, 0xE3, 0x80, 0x91, 0x43, 0xE3, - 0x80, 0x92, 0x43, 0xE3, 0x80, 0x94, 0x43, 0xE3, - // Bytes 4c0 - 4ff - 0x80, 0x95, 0x43, 0xE3, 0x80, 0x96, 0x43, 0xE3, - 0x80, 0x97, 0x43, 0xE3, 0x82, 0xA1, 0x43, 0xE3, - 0x82, 0xA2, 0x43, 0xE3, 0x82, 0xA3, 0x43, 0xE3, - 0x82, 0xA4, 0x43, 0xE3, 0x82, 0xA5, 0x43, 0xE3, - 0x82, 0xA6, 0x43, 0xE3, 0x82, 0xA7, 0x43, 0xE3, - 0x82, 0xA8, 0x43, 0xE3, 0x82, 0xA9, 0x43, 0xE3, - 0x82, 0xAA, 0x43, 0xE3, 0x82, 0xAB, 0x43, 0xE3, - 0x82, 0xAD, 0x43, 0xE3, 0x82, 0xAF, 0x43, 0xE3, - // Bytes 500 - 53f - 0x82, 0xB1, 0x43, 0xE3, 0x82, 0xB3, 0x43, 0xE3, - 0x82, 0xB5, 0x43, 0xE3, 0x82, 0xB7, 0x43, 0xE3, - 0x82, 0xB9, 0x43, 0xE3, 0x82, 0xBB, 0x43, 0xE3, - 0x82, 0xBD, 0x43, 0xE3, 0x82, 0xBF, 0x43, 0xE3, - 0x83, 0x81, 0x43, 0xE3, 0x83, 0x83, 0x43, 0xE3, - 0x83, 0x84, 0x43, 0xE3, 0x83, 0x86, 0x43, 0xE3, - 0x83, 0x88, 0x43, 0xE3, 0x83, 0x8A, 0x43, 0xE3, - 0x83, 0x8B, 0x43, 0xE3, 0x83, 0x8C, 0x43, 0xE3, - // Bytes 540 - 57f - 0x83, 0x8D, 0x43, 0xE3, 0x83, 0x8E, 0x43, 0xE3, - 0x83, 0x8F, 0x43, 0xE3, 0x83, 0x92, 0x43, 0xE3, - 0x83, 0x95, 0x43, 0xE3, 0x83, 0x98, 0x43, 0xE3, - 0x83, 0x9B, 0x43, 0xE3, 0x83, 0x9E, 0x43, 0xE3, - 0x83, 0x9F, 0x43, 0xE3, 0x83, 0xA0, 0x43, 0xE3, - 0x83, 0xA1, 0x43, 0xE3, 0x83, 0xA2, 0x43, 0xE3, - 0x83, 0xA3, 0x43, 0xE3, 0x83, 0xA4, 0x43, 0xE3, - 0x83, 0xA5, 0x43, 0xE3, 0x83, 0xA6, 0x43, 0xE3, - // Bytes 580 - 5bf - 0x83, 0xA7, 0x43, 0xE3, 0x83, 0xA8, 0x43, 0xE3, - 0x83, 0xA9, 0x43, 0xE3, 0x83, 0xAA, 0x43, 0xE3, - 0x83, 0xAB, 0x43, 0xE3, 0x83, 0xAC, 0x43, 0xE3, - 0x83, 0xAD, 0x43, 0xE3, 0x83, 0xAF, 0x43, 0xE3, - 0x83, 0xB0, 0x43, 0xE3, 0x83, 0xB1, 0x43, 0xE3, - 0x83, 0xB2, 0x43, 0xE3, 0x83, 0xB3, 0x43, 0xE3, - 0x83, 0xBB, 0x43, 0xE3, 0x83, 0xBC, 0x43, 0xE3, - 0x92, 0x9E, 0x43, 0xE3, 0x92, 0xB9, 0x43, 0xE3, - // Bytes 5c0 - 5ff - 0x92, 0xBB, 0x43, 0xE3, 0x93, 0x9F, 0x43, 0xE3, - 0x94, 0x95, 0x43, 0xE3, 0x9B, 0xAE, 0x43, 0xE3, - 0x9B, 0xBC, 0x43, 0xE3, 0x9E, 0x81, 0x43, 0xE3, - 0xA0, 0xAF, 0x43, 0xE3, 0xA1, 0xA2, 0x43, 0xE3, - 0xA1, 0xBC, 0x43, 0xE3, 0xA3, 0x87, 0x43, 0xE3, - 0xA3, 0xA3, 0x43, 0xE3, 0xA4, 0x9C, 0x43, 0xE3, - 0xA4, 0xBA, 0x43, 0xE3, 0xA8, 0xAE, 0x43, 0xE3, - 0xA9, 0xAC, 0x43, 0xE3, 0xAB, 0xA4, 0x43, 0xE3, - // Bytes 600 - 63f - 0xAC, 0x88, 0x43, 0xE3, 0xAC, 0x99, 0x43, 0xE3, - 0xAD, 0x89, 0x43, 0xE3, 0xAE, 0x9D, 0x43, 0xE3, - 0xB0, 0x98, 0x43, 0xE3, 0xB1, 0x8E, 0x43, 0xE3, - 0xB4, 0xB3, 0x43, 0xE3, 0xB6, 0x96, 0x43, 0xE3, - 0xBA, 0xAC, 0x43, 0xE3, 0xBA, 0xB8, 0x43, 0xE3, - 0xBC, 0x9B, 0x43, 0xE3, 0xBF, 0xBC, 0x43, 0xE4, - 0x80, 0x88, 0x43, 0xE4, 0x80, 0x98, 0x43, 0xE4, - 0x80, 0xB9, 0x43, 0xE4, 0x81, 0x86, 0x43, 0xE4, - // Bytes 640 - 67f - 0x82, 0x96, 0x43, 0xE4, 0x83, 0xA3, 0x43, 0xE4, - 0x84, 0xAF, 0x43, 0xE4, 0x88, 0x82, 0x43, 0xE4, - 0x88, 0xA7, 0x43, 0xE4, 0x8A, 0xA0, 0x43, 0xE4, - 0x8C, 0x81, 0x43, 0xE4, 0x8C, 0xB4, 0x43, 0xE4, - 0x8D, 0x99, 0x43, 0xE4, 0x8F, 0x95, 0x43, 0xE4, - 0x8F, 0x99, 0x43, 0xE4, 0x90, 0x8B, 0x43, 0xE4, - 0x91, 0xAB, 0x43, 0xE4, 0x94, 0xAB, 0x43, 0xE4, - 0x95, 0x9D, 0x43, 0xE4, 0x95, 0xA1, 0x43, 0xE4, - // Bytes 680 - 6bf - 0x95, 0xAB, 0x43, 0xE4, 0x97, 0x97, 0x43, 0xE4, - 0x97, 0xB9, 0x43, 0xE4, 0x98, 0xB5, 0x43, 0xE4, - 0x9A, 0xBE, 0x43, 0xE4, 0x9B, 0x87, 0x43, 0xE4, - 0xA6, 0x95, 0x43, 0xE4, 0xA7, 0xA6, 0x43, 0xE4, - 0xA9, 0xAE, 0x43, 0xE4, 0xA9, 0xB6, 0x43, 0xE4, - 0xAA, 0xB2, 0x43, 0xE4, 0xAC, 0xB3, 0x43, 0xE4, - 0xAF, 0x8E, 0x43, 0xE4, 0xB3, 0x8E, 0x43, 0xE4, - 0xB3, 0xAD, 0x43, 0xE4, 0xB3, 0xB8, 0x43, 0xE4, - // Bytes 6c0 - 6ff - 0xB5, 0x96, 0x43, 0xE4, 0xB8, 0x80, 0x43, 0xE4, - 0xB8, 0x81, 0x43, 0xE4, 0xB8, 0x83, 0x43, 0xE4, - 0xB8, 0x89, 0x43, 0xE4, 0xB8, 0x8A, 0x43, 0xE4, - 0xB8, 0x8B, 0x43, 0xE4, 0xB8, 0x8D, 0x43, 0xE4, - 0xB8, 0x99, 0x43, 0xE4, 0xB8, 0xA6, 0x43, 0xE4, - 0xB8, 0xA8, 0x43, 0xE4, 0xB8, 0xAD, 0x43, 0xE4, - 0xB8, 0xB2, 0x43, 0xE4, 0xB8, 0xB6, 0x43, 0xE4, - 0xB8, 0xB8, 0x43, 0xE4, 0xB8, 0xB9, 0x43, 0xE4, - // Bytes 700 - 73f - 0xB8, 0xBD, 0x43, 0xE4, 0xB8, 0xBF, 0x43, 0xE4, - 0xB9, 0x81, 0x43, 0xE4, 0xB9, 0x99, 0x43, 0xE4, - 0xB9, 0x9D, 0x43, 0xE4, 0xBA, 0x82, 0x43, 0xE4, - 0xBA, 0x85, 0x43, 0xE4, 0xBA, 0x86, 0x43, 0xE4, - 0xBA, 0x8C, 0x43, 0xE4, 0xBA, 0x94, 0x43, 0xE4, - 0xBA, 0xA0, 0x43, 0xE4, 0xBA, 0xA4, 0x43, 0xE4, - 0xBA, 0xAE, 0x43, 0xE4, 0xBA, 0xBA, 0x43, 0xE4, - 0xBB, 0x80, 0x43, 0xE4, 0xBB, 0x8C, 0x43, 0xE4, - // Bytes 740 - 77f - 0xBB, 0xA4, 0x43, 0xE4, 0xBC, 0x81, 0x43, 0xE4, - 0xBC, 0x91, 0x43, 0xE4, 0xBD, 0xA0, 0x43, 0xE4, - 0xBE, 0x80, 0x43, 0xE4, 0xBE, 0x86, 0x43, 0xE4, - 0xBE, 0x8B, 0x43, 0xE4, 0xBE, 0xAE, 0x43, 0xE4, - 0xBE, 0xBB, 0x43, 0xE4, 0xBE, 0xBF, 0x43, 0xE5, - 0x80, 0x82, 0x43, 0xE5, 0x80, 0xAB, 0x43, 0xE5, - 0x81, 0xBA, 0x43, 0xE5, 0x82, 0x99, 0x43, 0xE5, - 0x83, 0x8F, 0x43, 0xE5, 0x83, 0x9A, 0x43, 0xE5, - // Bytes 780 - 7bf - 0x83, 0xA7, 0x43, 0xE5, 0x84, 0xAA, 0x43, 0xE5, - 0x84, 0xBF, 0x43, 0xE5, 0x85, 0x80, 0x43, 0xE5, - 0x85, 0x85, 0x43, 0xE5, 0x85, 0x8D, 0x43, 0xE5, - 0x85, 0x94, 0x43, 0xE5, 0x85, 0xA4, 0x43, 0xE5, - 0x85, 0xA5, 0x43, 0xE5, 0x85, 0xA7, 0x43, 0xE5, - 0x85, 0xA8, 0x43, 0xE5, 0x85, 0xA9, 0x43, 0xE5, - 0x85, 0xAB, 0x43, 0xE5, 0x85, 0xAD, 0x43, 0xE5, - 0x85, 0xB7, 0x43, 0xE5, 0x86, 0x80, 0x43, 0xE5, - // Bytes 7c0 - 7ff - 0x86, 0x82, 0x43, 0xE5, 0x86, 0x8D, 0x43, 0xE5, - 0x86, 0x92, 0x43, 0xE5, 0x86, 0x95, 0x43, 0xE5, - 0x86, 0x96, 0x43, 0xE5, 0x86, 0x97, 0x43, 0xE5, - 0x86, 0x99, 0x43, 0xE5, 0x86, 0xA4, 0x43, 0xE5, - 0x86, 0xAB, 0x43, 0xE5, 0x86, 0xAC, 0x43, 0xE5, - 0x86, 0xB5, 0x43, 0xE5, 0x86, 0xB7, 0x43, 0xE5, - 0x87, 0x89, 0x43, 0xE5, 0x87, 0x8C, 0x43, 0xE5, - 0x87, 0x9C, 0x43, 0xE5, 0x87, 0x9E, 0x43, 0xE5, - // Bytes 800 - 83f - 0x87, 0xA0, 0x43, 0xE5, 0x87, 0xB5, 0x43, 0xE5, - 0x88, 0x80, 0x43, 0xE5, 0x88, 0x83, 0x43, 0xE5, - 0x88, 0x87, 0x43, 0xE5, 0x88, 0x97, 0x43, 0xE5, - 0x88, 0x9D, 0x43, 0xE5, 0x88, 0xA9, 0x43, 0xE5, - 0x88, 0xBA, 0x43, 0xE5, 0x88, 0xBB, 0x43, 0xE5, - 0x89, 0x86, 0x43, 0xE5, 0x89, 0x8D, 0x43, 0xE5, - 0x89, 0xB2, 0x43, 0xE5, 0x89, 0xB7, 0x43, 0xE5, - 0x8A, 0x89, 0x43, 0xE5, 0x8A, 0x9B, 0x43, 0xE5, - // Bytes 840 - 87f - 0x8A, 0xA3, 0x43, 0xE5, 0x8A, 0xB3, 0x43, 0xE5, - 0x8A, 0xB4, 0x43, 0xE5, 0x8B, 0x87, 0x43, 0xE5, - 0x8B, 0x89, 0x43, 0xE5, 0x8B, 0x92, 0x43, 0xE5, - 0x8B, 0x9E, 0x43, 0xE5, 0x8B, 0xA4, 0x43, 0xE5, - 0x8B, 0xB5, 0x43, 0xE5, 0x8B, 0xB9, 0x43, 0xE5, - 0x8B, 0xBA, 0x43, 0xE5, 0x8C, 0x85, 0x43, 0xE5, - 0x8C, 0x86, 0x43, 0xE5, 0x8C, 0x95, 0x43, 0xE5, - 0x8C, 0x97, 0x43, 0xE5, 0x8C, 0x9A, 0x43, 0xE5, - // Bytes 880 - 8bf - 0x8C, 0xB8, 0x43, 0xE5, 0x8C, 0xBB, 0x43, 0xE5, - 0x8C, 0xBF, 0x43, 0xE5, 0x8D, 0x81, 0x43, 0xE5, - 0x8D, 0x84, 0x43, 0xE5, 0x8D, 0x85, 0x43, 0xE5, - 0x8D, 0x89, 0x43, 0xE5, 0x8D, 0x91, 0x43, 0xE5, - 0x8D, 0x94, 0x43, 0xE5, 0x8D, 0x9A, 0x43, 0xE5, - 0x8D, 0x9C, 0x43, 0xE5, 0x8D, 0xA9, 0x43, 0xE5, - 0x8D, 0xB0, 0x43, 0xE5, 0x8D, 0xB3, 0x43, 0xE5, - 0x8D, 0xB5, 0x43, 0xE5, 0x8D, 0xBD, 0x43, 0xE5, - // Bytes 8c0 - 8ff - 0x8D, 0xBF, 0x43, 0xE5, 0x8E, 0x82, 0x43, 0xE5, - 0x8E, 0xB6, 0x43, 0xE5, 0x8F, 0x83, 0x43, 0xE5, - 0x8F, 0x88, 0x43, 0xE5, 0x8F, 0x8A, 0x43, 0xE5, - 0x8F, 0x8C, 0x43, 0xE5, 0x8F, 0x9F, 0x43, 0xE5, - 0x8F, 0xA3, 0x43, 0xE5, 0x8F, 0xA5, 0x43, 0xE5, - 0x8F, 0xAB, 0x43, 0xE5, 0x8F, 0xAF, 0x43, 0xE5, - 0x8F, 0xB1, 0x43, 0xE5, 0x8F, 0xB3, 0x43, 0xE5, - 0x90, 0x86, 0x43, 0xE5, 0x90, 0x88, 0x43, 0xE5, - // Bytes 900 - 93f - 0x90, 0x8D, 0x43, 0xE5, 0x90, 0x8F, 0x43, 0xE5, - 0x90, 0x9D, 0x43, 0xE5, 0x90, 0xB8, 0x43, 0xE5, - 0x90, 0xB9, 0x43, 0xE5, 0x91, 0x82, 0x43, 0xE5, - 0x91, 0x88, 0x43, 0xE5, 0x91, 0xA8, 0x43, 0xE5, - 0x92, 0x9E, 0x43, 0xE5, 0x92, 0xA2, 0x43, 0xE5, - 0x92, 0xBD, 0x43, 0xE5, 0x93, 0xB6, 0x43, 0xE5, - 0x94, 0x90, 0x43, 0xE5, 0x95, 0x8F, 0x43, 0xE5, - 0x95, 0x93, 0x43, 0xE5, 0x95, 0x95, 0x43, 0xE5, - // Bytes 940 - 97f - 0x95, 0xA3, 0x43, 0xE5, 0x96, 0x84, 0x43, 0xE5, - 0x96, 0x87, 0x43, 0xE5, 0x96, 0x99, 0x43, 0xE5, - 0x96, 0x9D, 0x43, 0xE5, 0x96, 0xAB, 0x43, 0xE5, - 0x96, 0xB3, 0x43, 0xE5, 0x96, 0xB6, 0x43, 0xE5, - 0x97, 0x80, 0x43, 0xE5, 0x97, 0x82, 0x43, 0xE5, - 0x97, 0xA2, 0x43, 0xE5, 0x98, 0x86, 0x43, 0xE5, - 0x99, 0x91, 0x43, 0xE5, 0x99, 0xA8, 0x43, 0xE5, - 0x99, 0xB4, 0x43, 0xE5, 0x9B, 0x97, 0x43, 0xE5, - // Bytes 980 - 9bf - 0x9B, 0x9B, 0x43, 0xE5, 0x9B, 0xB9, 0x43, 0xE5, - 0x9C, 0x96, 0x43, 0xE5, 0x9C, 0x97, 0x43, 0xE5, - 0x9C, 0x9F, 0x43, 0xE5, 0x9C, 0xB0, 0x43, 0xE5, - 0x9E, 0x8B, 0x43, 0xE5, 0x9F, 0x8E, 0x43, 0xE5, - 0x9F, 0xB4, 0x43, 0xE5, 0xA0, 0x8D, 0x43, 0xE5, - 0xA0, 0xB1, 0x43, 0xE5, 0xA0, 0xB2, 0x43, 0xE5, - 0xA1, 0x80, 0x43, 0xE5, 0xA1, 0x9A, 0x43, 0xE5, - 0xA1, 0x9E, 0x43, 0xE5, 0xA2, 0xA8, 0x43, 0xE5, - // Bytes 9c0 - 9ff - 0xA2, 0xAC, 0x43, 0xE5, 0xA2, 0xB3, 0x43, 0xE5, - 0xA3, 0x98, 0x43, 0xE5, 0xA3, 0x9F, 0x43, 0xE5, - 0xA3, 0xAB, 0x43, 0xE5, 0xA3, 0xAE, 0x43, 0xE5, - 0xA3, 0xB0, 0x43, 0xE5, 0xA3, 0xB2, 0x43, 0xE5, - 0xA3, 0xB7, 0x43, 0xE5, 0xA4, 0x82, 0x43, 0xE5, - 0xA4, 0x86, 0x43, 0xE5, 0xA4, 0x8A, 0x43, 0xE5, - 0xA4, 0x95, 0x43, 0xE5, 0xA4, 0x9A, 0x43, 0xE5, - 0xA4, 0x9C, 0x43, 0xE5, 0xA4, 0xA2, 0x43, 0xE5, - // Bytes a00 - a3f - 0xA4, 0xA7, 0x43, 0xE5, 0xA4, 0xA9, 0x43, 0xE5, - 0xA5, 0x84, 0x43, 0xE5, 0xA5, 0x88, 0x43, 0xE5, - 0xA5, 0x91, 0x43, 0xE5, 0xA5, 0x94, 0x43, 0xE5, - 0xA5, 0xA2, 0x43, 0xE5, 0xA5, 0xB3, 0x43, 0xE5, - 0xA7, 0x98, 0x43, 0xE5, 0xA7, 0xAC, 0x43, 0xE5, - 0xA8, 0x9B, 0x43, 0xE5, 0xA8, 0xA7, 0x43, 0xE5, - 0xA9, 0xA2, 0x43, 0xE5, 0xA9, 0xA6, 0x43, 0xE5, - 0xAA, 0xB5, 0x43, 0xE5, 0xAC, 0x88, 0x43, 0xE5, - // Bytes a40 - a7f - 0xAC, 0xA8, 0x43, 0xE5, 0xAC, 0xBE, 0x43, 0xE5, - 0xAD, 0x90, 0x43, 0xE5, 0xAD, 0x97, 0x43, 0xE5, - 0xAD, 0xA6, 0x43, 0xE5, 0xAE, 0x80, 0x43, 0xE5, - 0xAE, 0x85, 0x43, 0xE5, 0xAE, 0x97, 0x43, 0xE5, - 0xAF, 0x83, 0x43, 0xE5, 0xAF, 0x98, 0x43, 0xE5, - 0xAF, 0xA7, 0x43, 0xE5, 0xAF, 0xAE, 0x43, 0xE5, - 0xAF, 0xB3, 0x43, 0xE5, 0xAF, 0xB8, 0x43, 0xE5, - 0xAF, 0xBF, 0x43, 0xE5, 0xB0, 0x86, 0x43, 0xE5, - // Bytes a80 - abf - 0xB0, 0x8F, 0x43, 0xE5, 0xB0, 0xA2, 0x43, 0xE5, - 0xB0, 0xB8, 0x43, 0xE5, 0xB0, 0xBF, 0x43, 0xE5, - 0xB1, 0xA0, 0x43, 0xE5, 0xB1, 0xA2, 0x43, 0xE5, - 0xB1, 0xA4, 0x43, 0xE5, 0xB1, 0xA5, 0x43, 0xE5, - 0xB1, 0xAE, 0x43, 0xE5, 0xB1, 0xB1, 0x43, 0xE5, - 0xB2, 0x8D, 0x43, 0xE5, 0xB3, 0x80, 0x43, 0xE5, - 0xB4, 0x99, 0x43, 0xE5, 0xB5, 0x83, 0x43, 0xE5, - 0xB5, 0x90, 0x43, 0xE5, 0xB5, 0xAB, 0x43, 0xE5, - // Bytes ac0 - aff - 0xB5, 0xAE, 0x43, 0xE5, 0xB5, 0xBC, 0x43, 0xE5, - 0xB6, 0xB2, 0x43, 0xE5, 0xB6, 0xBA, 0x43, 0xE5, - 0xB7, 0x9B, 0x43, 0xE5, 0xB7, 0xA1, 0x43, 0xE5, - 0xB7, 0xA2, 0x43, 0xE5, 0xB7, 0xA5, 0x43, 0xE5, - 0xB7, 0xA6, 0x43, 0xE5, 0xB7, 0xB1, 0x43, 0xE5, - 0xB7, 0xBD, 0x43, 0xE5, 0xB7, 0xBE, 0x43, 0xE5, - 0xB8, 0xA8, 0x43, 0xE5, 0xB8, 0xBD, 0x43, 0xE5, - 0xB9, 0xA9, 0x43, 0xE5, 0xB9, 0xB2, 0x43, 0xE5, - // Bytes b00 - b3f - 0xB9, 0xB4, 0x43, 0xE5, 0xB9, 0xBA, 0x43, 0xE5, - 0xB9, 0xBC, 0x43, 0xE5, 0xB9, 0xBF, 0x43, 0xE5, - 0xBA, 0xA6, 0x43, 0xE5, 0xBA, 0xB0, 0x43, 0xE5, - 0xBA, 0xB3, 0x43, 0xE5, 0xBA, 0xB6, 0x43, 0xE5, - 0xBB, 0x89, 0x43, 0xE5, 0xBB, 0x8A, 0x43, 0xE5, - 0xBB, 0x92, 0x43, 0xE5, 0xBB, 0x93, 0x43, 0xE5, - 0xBB, 0x99, 0x43, 0xE5, 0xBB, 0xAC, 0x43, 0xE5, - 0xBB, 0xB4, 0x43, 0xE5, 0xBB, 0xBE, 0x43, 0xE5, - // Bytes b40 - b7f - 0xBC, 0x84, 0x43, 0xE5, 0xBC, 0x8B, 0x43, 0xE5, - 0xBC, 0x93, 0x43, 0xE5, 0xBC, 0xA2, 0x43, 0xE5, - 0xBD, 0x90, 0x43, 0xE5, 0xBD, 0x93, 0x43, 0xE5, - 0xBD, 0xA1, 0x43, 0xE5, 0xBD, 0xA2, 0x43, 0xE5, - 0xBD, 0xA9, 0x43, 0xE5, 0xBD, 0xAB, 0x43, 0xE5, - 0xBD, 0xB3, 0x43, 0xE5, 0xBE, 0x8B, 0x43, 0xE5, - 0xBE, 0x8C, 0x43, 0xE5, 0xBE, 0x97, 0x43, 0xE5, - 0xBE, 0x9A, 0x43, 0xE5, 0xBE, 0xA9, 0x43, 0xE5, - // Bytes b80 - bbf - 0xBE, 0xAD, 0x43, 0xE5, 0xBF, 0x83, 0x43, 0xE5, - 0xBF, 0x8D, 0x43, 0xE5, 0xBF, 0x97, 0x43, 0xE5, - 0xBF, 0xB5, 0x43, 0xE5, 0xBF, 0xB9, 0x43, 0xE6, - 0x80, 0x92, 0x43, 0xE6, 0x80, 0x9C, 0x43, 0xE6, - 0x81, 0xB5, 0x43, 0xE6, 0x82, 0x81, 0x43, 0xE6, - 0x82, 0x94, 0x43, 0xE6, 0x83, 0x87, 0x43, 0xE6, - 0x83, 0x98, 0x43, 0xE6, 0x83, 0xA1, 0x43, 0xE6, - 0x84, 0x88, 0x43, 0xE6, 0x85, 0x84, 0x43, 0xE6, - // Bytes bc0 - bff - 0x85, 0x88, 0x43, 0xE6, 0x85, 0x8C, 0x43, 0xE6, - 0x85, 0x8E, 0x43, 0xE6, 0x85, 0xA0, 0x43, 0xE6, - 0x85, 0xA8, 0x43, 0xE6, 0x85, 0xBA, 0x43, 0xE6, - 0x86, 0x8E, 0x43, 0xE6, 0x86, 0x90, 0x43, 0xE6, - 0x86, 0xA4, 0x43, 0xE6, 0x86, 0xAF, 0x43, 0xE6, - 0x86, 0xB2, 0x43, 0xE6, 0x87, 0x9E, 0x43, 0xE6, - 0x87, 0xB2, 0x43, 0xE6, 0x87, 0xB6, 0x43, 0xE6, - 0x88, 0x80, 0x43, 0xE6, 0x88, 0x88, 0x43, 0xE6, - // Bytes c00 - c3f - 0x88, 0x90, 0x43, 0xE6, 0x88, 0x9B, 0x43, 0xE6, - 0x88, 0xAE, 0x43, 0xE6, 0x88, 0xB4, 0x43, 0xE6, - 0x88, 0xB6, 0x43, 0xE6, 0x89, 0x8B, 0x43, 0xE6, - 0x89, 0x93, 0x43, 0xE6, 0x89, 0x9D, 0x43, 0xE6, - 0x8A, 0x95, 0x43, 0xE6, 0x8A, 0xB1, 0x43, 0xE6, - 0x8B, 0x89, 0x43, 0xE6, 0x8B, 0x8F, 0x43, 0xE6, - 0x8B, 0x93, 0x43, 0xE6, 0x8B, 0x94, 0x43, 0xE6, - 0x8B, 0xBC, 0x43, 0xE6, 0x8B, 0xBE, 0x43, 0xE6, - // Bytes c40 - c7f - 0x8C, 0x87, 0x43, 0xE6, 0x8C, 0xBD, 0x43, 0xE6, - 0x8D, 0x90, 0x43, 0xE6, 0x8D, 0x95, 0x43, 0xE6, - 0x8D, 0xA8, 0x43, 0xE6, 0x8D, 0xBB, 0x43, 0xE6, - 0x8E, 0x83, 0x43, 0xE6, 0x8E, 0xA0, 0x43, 0xE6, - 0x8E, 0xA9, 0x43, 0xE6, 0x8F, 0x84, 0x43, 0xE6, - 0x8F, 0x85, 0x43, 0xE6, 0x8F, 0xA4, 0x43, 0xE6, - 0x90, 0x9C, 0x43, 0xE6, 0x90, 0xA2, 0x43, 0xE6, - 0x91, 0x92, 0x43, 0xE6, 0x91, 0xA9, 0x43, 0xE6, - // Bytes c80 - cbf - 0x91, 0xB7, 0x43, 0xE6, 0x91, 0xBE, 0x43, 0xE6, - 0x92, 0x9A, 0x43, 0xE6, 0x92, 0x9D, 0x43, 0xE6, - 0x93, 0x84, 0x43, 0xE6, 0x94, 0xAF, 0x43, 0xE6, - 0x94, 0xB4, 0x43, 0xE6, 0x95, 0x8F, 0x43, 0xE6, - 0x95, 0x96, 0x43, 0xE6, 0x95, 0xAC, 0x43, 0xE6, - 0x95, 0xB8, 0x43, 0xE6, 0x96, 0x87, 0x43, 0xE6, - 0x96, 0x97, 0x43, 0xE6, 0x96, 0x99, 0x43, 0xE6, - 0x96, 0xA4, 0x43, 0xE6, 0x96, 0xB0, 0x43, 0xE6, - // Bytes cc0 - cff - 0x96, 0xB9, 0x43, 0xE6, 0x97, 0x85, 0x43, 0xE6, - 0x97, 0xA0, 0x43, 0xE6, 0x97, 0xA2, 0x43, 0xE6, - 0x97, 0xA3, 0x43, 0xE6, 0x97, 0xA5, 0x43, 0xE6, - 0x98, 0x93, 0x43, 0xE6, 0x98, 0xA0, 0x43, 0xE6, - 0x99, 0x89, 0x43, 0xE6, 0x99, 0xB4, 0x43, 0xE6, - 0x9A, 0x88, 0x43, 0xE6, 0x9A, 0x91, 0x43, 0xE6, - 0x9A, 0x9C, 0x43, 0xE6, 0x9A, 0xB4, 0x43, 0xE6, - 0x9B, 0x86, 0x43, 0xE6, 0x9B, 0xB0, 0x43, 0xE6, - // Bytes d00 - d3f - 0x9B, 0xB4, 0x43, 0xE6, 0x9B, 0xB8, 0x43, 0xE6, - 0x9C, 0x80, 0x43, 0xE6, 0x9C, 0x88, 0x43, 0xE6, - 0x9C, 0x89, 0x43, 0xE6, 0x9C, 0x97, 0x43, 0xE6, - 0x9C, 0x9B, 0x43, 0xE6, 0x9C, 0xA1, 0x43, 0xE6, - 0x9C, 0xA8, 0x43, 0xE6, 0x9D, 0x8E, 0x43, 0xE6, - 0x9D, 0x93, 0x43, 0xE6, 0x9D, 0x96, 0x43, 0xE6, - 0x9D, 0x9E, 0x43, 0xE6, 0x9D, 0xBB, 0x43, 0xE6, - 0x9E, 0x85, 0x43, 0xE6, 0x9E, 0x97, 0x43, 0xE6, - // Bytes d40 - d7f - 0x9F, 0xB3, 0x43, 0xE6, 0x9F, 0xBA, 0x43, 0xE6, - 0xA0, 0x97, 0x43, 0xE6, 0xA0, 0x9F, 0x43, 0xE6, - 0xA0, 0xAA, 0x43, 0xE6, 0xA1, 0x92, 0x43, 0xE6, - 0xA2, 0x81, 0x43, 0xE6, 0xA2, 0x85, 0x43, 0xE6, - 0xA2, 0x8E, 0x43, 0xE6, 0xA2, 0xA8, 0x43, 0xE6, - 0xA4, 0x94, 0x43, 0xE6, 0xA5, 0x82, 0x43, 0xE6, - 0xA6, 0xA3, 0x43, 0xE6, 0xA7, 0xAA, 0x43, 0xE6, - 0xA8, 0x82, 0x43, 0xE6, 0xA8, 0x93, 0x43, 0xE6, - // Bytes d80 - dbf - 0xAA, 0xA8, 0x43, 0xE6, 0xAB, 0x93, 0x43, 0xE6, - 0xAB, 0x9B, 0x43, 0xE6, 0xAC, 0x84, 0x43, 0xE6, - 0xAC, 0xA0, 0x43, 0xE6, 0xAC, 0xA1, 0x43, 0xE6, - 0xAD, 0x94, 0x43, 0xE6, 0xAD, 0xA2, 0x43, 0xE6, - 0xAD, 0xA3, 0x43, 0xE6, 0xAD, 0xB2, 0x43, 0xE6, - 0xAD, 0xB7, 0x43, 0xE6, 0xAD, 0xB9, 0x43, 0xE6, - 0xAE, 0x9F, 0x43, 0xE6, 0xAE, 0xAE, 0x43, 0xE6, - 0xAE, 0xB3, 0x43, 0xE6, 0xAE, 0xBA, 0x43, 0xE6, - // Bytes dc0 - dff - 0xAE, 0xBB, 0x43, 0xE6, 0xAF, 0x8B, 0x43, 0xE6, - 0xAF, 0x8D, 0x43, 0xE6, 0xAF, 0x94, 0x43, 0xE6, - 0xAF, 0x9B, 0x43, 0xE6, 0xB0, 0x8F, 0x43, 0xE6, - 0xB0, 0x94, 0x43, 0xE6, 0xB0, 0xB4, 0x43, 0xE6, - 0xB1, 0x8E, 0x43, 0xE6, 0xB1, 0xA7, 0x43, 0xE6, - 0xB2, 0x88, 0x43, 0xE6, 0xB2, 0xBF, 0x43, 0xE6, - 0xB3, 0x8C, 0x43, 0xE6, 0xB3, 0x8D, 0x43, 0xE6, - 0xB3, 0xA5, 0x43, 0xE6, 0xB3, 0xA8, 0x43, 0xE6, - // Bytes e00 - e3f - 0xB4, 0x96, 0x43, 0xE6, 0xB4, 0x9B, 0x43, 0xE6, - 0xB4, 0x9E, 0x43, 0xE6, 0xB4, 0xB4, 0x43, 0xE6, - 0xB4, 0xBE, 0x43, 0xE6, 0xB5, 0x81, 0x43, 0xE6, - 0xB5, 0xA9, 0x43, 0xE6, 0xB5, 0xAA, 0x43, 0xE6, - 0xB5, 0xB7, 0x43, 0xE6, 0xB5, 0xB8, 0x43, 0xE6, - 0xB6, 0x85, 0x43, 0xE6, 0xB7, 0x8B, 0x43, 0xE6, - 0xB7, 0x9A, 0x43, 0xE6, 0xB7, 0xAA, 0x43, 0xE6, - 0xB7, 0xB9, 0x43, 0xE6, 0xB8, 0x9A, 0x43, 0xE6, - // Bytes e40 - e7f - 0xB8, 0xAF, 0x43, 0xE6, 0xB9, 0xAE, 0x43, 0xE6, - 0xBA, 0x80, 0x43, 0xE6, 0xBA, 0x9C, 0x43, 0xE6, - 0xBA, 0xBA, 0x43, 0xE6, 0xBB, 0x87, 0x43, 0xE6, - 0xBB, 0x8B, 0x43, 0xE6, 0xBB, 0x91, 0x43, 0xE6, - 0xBB, 0x9B, 0x43, 0xE6, 0xBC, 0x8F, 0x43, 0xE6, - 0xBC, 0x94, 0x43, 0xE6, 0xBC, 0xA2, 0x43, 0xE6, - 0xBC, 0xA3, 0x43, 0xE6, 0xBD, 0xAE, 0x43, 0xE6, - 0xBF, 0x86, 0x43, 0xE6, 0xBF, 0xAB, 0x43, 0xE6, - // Bytes e80 - ebf - 0xBF, 0xBE, 0x43, 0xE7, 0x80, 0x9B, 0x43, 0xE7, - 0x80, 0x9E, 0x43, 0xE7, 0x80, 0xB9, 0x43, 0xE7, - 0x81, 0x8A, 0x43, 0xE7, 0x81, 0xAB, 0x43, 0xE7, - 0x81, 0xB0, 0x43, 0xE7, 0x81, 0xB7, 0x43, 0xE7, - 0x81, 0xBD, 0x43, 0xE7, 0x82, 0x99, 0x43, 0xE7, - 0x82, 0xAD, 0x43, 0xE7, 0x83, 0x88, 0x43, 0xE7, - 0x83, 0x99, 0x43, 0xE7, 0x84, 0xA1, 0x43, 0xE7, - 0x85, 0x85, 0x43, 0xE7, 0x85, 0x89, 0x43, 0xE7, - // Bytes ec0 - eff - 0x85, 0xAE, 0x43, 0xE7, 0x86, 0x9C, 0x43, 0xE7, - 0x87, 0x8E, 0x43, 0xE7, 0x87, 0x90, 0x43, 0xE7, - 0x88, 0x90, 0x43, 0xE7, 0x88, 0x9B, 0x43, 0xE7, - 0x88, 0xA8, 0x43, 0xE7, 0x88, 0xAA, 0x43, 0xE7, - 0x88, 0xAB, 0x43, 0xE7, 0x88, 0xB5, 0x43, 0xE7, - 0x88, 0xB6, 0x43, 0xE7, 0x88, 0xBB, 0x43, 0xE7, - 0x88, 0xBF, 0x43, 0xE7, 0x89, 0x87, 0x43, 0xE7, - 0x89, 0x90, 0x43, 0xE7, 0x89, 0x99, 0x43, 0xE7, - // Bytes f00 - f3f - 0x89, 0x9B, 0x43, 0xE7, 0x89, 0xA2, 0x43, 0xE7, - 0x89, 0xB9, 0x43, 0xE7, 0x8A, 0x80, 0x43, 0xE7, - 0x8A, 0x95, 0x43, 0xE7, 0x8A, 0xAC, 0x43, 0xE7, - 0x8A, 0xAF, 0x43, 0xE7, 0x8B, 0x80, 0x43, 0xE7, - 0x8B, 0xBC, 0x43, 0xE7, 0x8C, 0xAA, 0x43, 0xE7, - 0x8D, 0xB5, 0x43, 0xE7, 0x8D, 0xBA, 0x43, 0xE7, - 0x8E, 0x84, 0x43, 0xE7, 0x8E, 0x87, 0x43, 0xE7, - 0x8E, 0x89, 0x43, 0xE7, 0x8E, 0x8B, 0x43, 0xE7, - // Bytes f40 - f7f - 0x8E, 0xA5, 0x43, 0xE7, 0x8E, 0xB2, 0x43, 0xE7, - 0x8F, 0x9E, 0x43, 0xE7, 0x90, 0x86, 0x43, 0xE7, - 0x90, 0x89, 0x43, 0xE7, 0x90, 0xA2, 0x43, 0xE7, - 0x91, 0x87, 0x43, 0xE7, 0x91, 0x9C, 0x43, 0xE7, - 0x91, 0xA9, 0x43, 0xE7, 0x91, 0xB1, 0x43, 0xE7, - 0x92, 0x85, 0x43, 0xE7, 0x92, 0x89, 0x43, 0xE7, - 0x92, 0x98, 0x43, 0xE7, 0x93, 0x8A, 0x43, 0xE7, - 0x93, 0x9C, 0x43, 0xE7, 0x93, 0xA6, 0x43, 0xE7, - // Bytes f80 - fbf - 0x94, 0x86, 0x43, 0xE7, 0x94, 0x98, 0x43, 0xE7, - 0x94, 0x9F, 0x43, 0xE7, 0x94, 0xA4, 0x43, 0xE7, - 0x94, 0xA8, 0x43, 0xE7, 0x94, 0xB0, 0x43, 0xE7, - 0x94, 0xB2, 0x43, 0xE7, 0x94, 0xB3, 0x43, 0xE7, - 0x94, 0xB7, 0x43, 0xE7, 0x94, 0xBB, 0x43, 0xE7, - 0x94, 0xBE, 0x43, 0xE7, 0x95, 0x99, 0x43, 0xE7, - 0x95, 0xA5, 0x43, 0xE7, 0x95, 0xB0, 0x43, 0xE7, - 0x96, 0x8B, 0x43, 0xE7, 0x96, 0x92, 0x43, 0xE7, - // Bytes fc0 - fff - 0x97, 0xA2, 0x43, 0xE7, 0x98, 0x90, 0x43, 0xE7, - 0x98, 0x9D, 0x43, 0xE7, 0x98, 0x9F, 0x43, 0xE7, - 0x99, 0x82, 0x43, 0xE7, 0x99, 0xA9, 0x43, 0xE7, - 0x99, 0xB6, 0x43, 0xE7, 0x99, 0xBD, 0x43, 0xE7, - 0x9A, 0xAE, 0x43, 0xE7, 0x9A, 0xBF, 0x43, 0xE7, - 0x9B, 0x8A, 0x43, 0xE7, 0x9B, 0x9B, 0x43, 0xE7, - 0x9B, 0xA3, 0x43, 0xE7, 0x9B, 0xA7, 0x43, 0xE7, - 0x9B, 0xAE, 0x43, 0xE7, 0x9B, 0xB4, 0x43, 0xE7, - // Bytes 1000 - 103f - 0x9C, 0x81, 0x43, 0xE7, 0x9C, 0x9E, 0x43, 0xE7, - 0x9C, 0x9F, 0x43, 0xE7, 0x9D, 0x80, 0x43, 0xE7, - 0x9D, 0x8A, 0x43, 0xE7, 0x9E, 0x8B, 0x43, 0xE7, - 0x9E, 0xA7, 0x43, 0xE7, 0x9F, 0x9B, 0x43, 0xE7, - 0x9F, 0xA2, 0x43, 0xE7, 0x9F, 0xB3, 0x43, 0xE7, - 0xA1, 0x8E, 0x43, 0xE7, 0xA1, 0xAB, 0x43, 0xE7, - 0xA2, 0x8C, 0x43, 0xE7, 0xA2, 0x91, 0x43, 0xE7, - 0xA3, 0x8A, 0x43, 0xE7, 0xA3, 0x8C, 0x43, 0xE7, - // Bytes 1040 - 107f - 0xA3, 0xBB, 0x43, 0xE7, 0xA4, 0xAA, 0x43, 0xE7, - 0xA4, 0xBA, 0x43, 0xE7, 0xA4, 0xBC, 0x43, 0xE7, - 0xA4, 0xBE, 0x43, 0xE7, 0xA5, 0x88, 0x43, 0xE7, - 0xA5, 0x89, 0x43, 0xE7, 0xA5, 0x90, 0x43, 0xE7, - 0xA5, 0x96, 0x43, 0xE7, 0xA5, 0x9D, 0x43, 0xE7, - 0xA5, 0x9E, 0x43, 0xE7, 0xA5, 0xA5, 0x43, 0xE7, - 0xA5, 0xBF, 0x43, 0xE7, 0xA6, 0x81, 0x43, 0xE7, - 0xA6, 0x8D, 0x43, 0xE7, 0xA6, 0x8E, 0x43, 0xE7, - // Bytes 1080 - 10bf - 0xA6, 0x8F, 0x43, 0xE7, 0xA6, 0xAE, 0x43, 0xE7, - 0xA6, 0xB8, 0x43, 0xE7, 0xA6, 0xBE, 0x43, 0xE7, - 0xA7, 0x8A, 0x43, 0xE7, 0xA7, 0x98, 0x43, 0xE7, - 0xA7, 0xAB, 0x43, 0xE7, 0xA8, 0x9C, 0x43, 0xE7, - 0xA9, 0x80, 0x43, 0xE7, 0xA9, 0x8A, 0x43, 0xE7, - 0xA9, 0x8F, 0x43, 0xE7, 0xA9, 0xB4, 0x43, 0xE7, - 0xA9, 0xBA, 0x43, 0xE7, 0xAA, 0x81, 0x43, 0xE7, - 0xAA, 0xB1, 0x43, 0xE7, 0xAB, 0x8B, 0x43, 0xE7, - // Bytes 10c0 - 10ff - 0xAB, 0xAE, 0x43, 0xE7, 0xAB, 0xB9, 0x43, 0xE7, - 0xAC, 0xA0, 0x43, 0xE7, 0xAE, 0x8F, 0x43, 0xE7, - 0xAF, 0x80, 0x43, 0xE7, 0xAF, 0x86, 0x43, 0xE7, - 0xAF, 0x89, 0x43, 0xE7, 0xB0, 0xBE, 0x43, 0xE7, - 0xB1, 0xA0, 0x43, 0xE7, 0xB1, 0xB3, 0x43, 0xE7, - 0xB1, 0xBB, 0x43, 0xE7, 0xB2, 0x92, 0x43, 0xE7, - 0xB2, 0xBE, 0x43, 0xE7, 0xB3, 0x92, 0x43, 0xE7, - 0xB3, 0x96, 0x43, 0xE7, 0xB3, 0xA3, 0x43, 0xE7, - // Bytes 1100 - 113f - 0xB3, 0xA7, 0x43, 0xE7, 0xB3, 0xA8, 0x43, 0xE7, - 0xB3, 0xB8, 0x43, 0xE7, 0xB4, 0x80, 0x43, 0xE7, - 0xB4, 0x90, 0x43, 0xE7, 0xB4, 0xA2, 0x43, 0xE7, - 0xB4, 0xAF, 0x43, 0xE7, 0xB5, 0x82, 0x43, 0xE7, - 0xB5, 0x9B, 0x43, 0xE7, 0xB5, 0xA3, 0x43, 0xE7, - 0xB6, 0xA0, 0x43, 0xE7, 0xB6, 0xBE, 0x43, 0xE7, - 0xB7, 0x87, 0x43, 0xE7, 0xB7, 0xB4, 0x43, 0xE7, - 0xB8, 0x82, 0x43, 0xE7, 0xB8, 0x89, 0x43, 0xE7, - // Bytes 1140 - 117f - 0xB8, 0xB7, 0x43, 0xE7, 0xB9, 0x81, 0x43, 0xE7, - 0xB9, 0x85, 0x43, 0xE7, 0xBC, 0xB6, 0x43, 0xE7, - 0xBC, 0xBE, 0x43, 0xE7, 0xBD, 0x91, 0x43, 0xE7, - 0xBD, 0xB2, 0x43, 0xE7, 0xBD, 0xB9, 0x43, 0xE7, - 0xBD, 0xBA, 0x43, 0xE7, 0xBE, 0x85, 0x43, 0xE7, - 0xBE, 0x8A, 0x43, 0xE7, 0xBE, 0x95, 0x43, 0xE7, - 0xBE, 0x9A, 0x43, 0xE7, 0xBE, 0xBD, 0x43, 0xE7, - 0xBF, 0xBA, 0x43, 0xE8, 0x80, 0x81, 0x43, 0xE8, - // Bytes 1180 - 11bf - 0x80, 0x85, 0x43, 0xE8, 0x80, 0x8C, 0x43, 0xE8, - 0x80, 0x92, 0x43, 0xE8, 0x80, 0xB3, 0x43, 0xE8, - 0x81, 0x86, 0x43, 0xE8, 0x81, 0xA0, 0x43, 0xE8, - 0x81, 0xAF, 0x43, 0xE8, 0x81, 0xB0, 0x43, 0xE8, - 0x81, 0xBE, 0x43, 0xE8, 0x81, 0xBF, 0x43, 0xE8, - 0x82, 0x89, 0x43, 0xE8, 0x82, 0x8B, 0x43, 0xE8, - 0x82, 0xAD, 0x43, 0xE8, 0x82, 0xB2, 0x43, 0xE8, - 0x84, 0x83, 0x43, 0xE8, 0x84, 0xBE, 0x43, 0xE8, - // Bytes 11c0 - 11ff - 0x87, 0x98, 0x43, 0xE8, 0x87, 0xA3, 0x43, 0xE8, - 0x87, 0xA8, 0x43, 0xE8, 0x87, 0xAA, 0x43, 0xE8, - 0x87, 0xAD, 0x43, 0xE8, 0x87, 0xB3, 0x43, 0xE8, - 0x87, 0xBC, 0x43, 0xE8, 0x88, 0x81, 0x43, 0xE8, - 0x88, 0x84, 0x43, 0xE8, 0x88, 0x8C, 0x43, 0xE8, - 0x88, 0x98, 0x43, 0xE8, 0x88, 0x9B, 0x43, 0xE8, - 0x88, 0x9F, 0x43, 0xE8, 0x89, 0xAE, 0x43, 0xE8, - 0x89, 0xAF, 0x43, 0xE8, 0x89, 0xB2, 0x43, 0xE8, - // Bytes 1200 - 123f - 0x89, 0xB8, 0x43, 0xE8, 0x89, 0xB9, 0x43, 0xE8, - 0x8A, 0x8B, 0x43, 0xE8, 0x8A, 0x91, 0x43, 0xE8, - 0x8A, 0x9D, 0x43, 0xE8, 0x8A, 0xB1, 0x43, 0xE8, - 0x8A, 0xB3, 0x43, 0xE8, 0x8A, 0xBD, 0x43, 0xE8, - 0x8B, 0xA5, 0x43, 0xE8, 0x8B, 0xA6, 0x43, 0xE8, - 0x8C, 0x9D, 0x43, 0xE8, 0x8C, 0xA3, 0x43, 0xE8, - 0x8C, 0xB6, 0x43, 0xE8, 0x8D, 0x92, 0x43, 0xE8, - 0x8D, 0x93, 0x43, 0xE8, 0x8D, 0xA3, 0x43, 0xE8, - // Bytes 1240 - 127f - 0x8E, 0xAD, 0x43, 0xE8, 0x8E, 0xBD, 0x43, 0xE8, - 0x8F, 0x89, 0x43, 0xE8, 0x8F, 0x8A, 0x43, 0xE8, - 0x8F, 0x8C, 0x43, 0xE8, 0x8F, 0x9C, 0x43, 0xE8, - 0x8F, 0xA7, 0x43, 0xE8, 0x8F, 0xAF, 0x43, 0xE8, - 0x8F, 0xB1, 0x43, 0xE8, 0x90, 0xBD, 0x43, 0xE8, - 0x91, 0x89, 0x43, 0xE8, 0x91, 0x97, 0x43, 0xE8, - 0x93, 0xAE, 0x43, 0xE8, 0x93, 0xB1, 0x43, 0xE8, - 0x93, 0xB3, 0x43, 0xE8, 0x93, 0xBC, 0x43, 0xE8, - // Bytes 1280 - 12bf - 0x94, 0x96, 0x43, 0xE8, 0x95, 0xA4, 0x43, 0xE8, - 0x97, 0x8D, 0x43, 0xE8, 0x97, 0xBA, 0x43, 0xE8, - 0x98, 0x86, 0x43, 0xE8, 0x98, 0x92, 0x43, 0xE8, - 0x98, 0xAD, 0x43, 0xE8, 0x98, 0xBF, 0x43, 0xE8, - 0x99, 0x8D, 0x43, 0xE8, 0x99, 0x90, 0x43, 0xE8, - 0x99, 0x9C, 0x43, 0xE8, 0x99, 0xA7, 0x43, 0xE8, - 0x99, 0xA9, 0x43, 0xE8, 0x99, 0xAB, 0x43, 0xE8, - 0x9A, 0x88, 0x43, 0xE8, 0x9A, 0xA9, 0x43, 0xE8, - // Bytes 12c0 - 12ff - 0x9B, 0xA2, 0x43, 0xE8, 0x9C, 0x8E, 0x43, 0xE8, - 0x9C, 0xA8, 0x43, 0xE8, 0x9D, 0xAB, 0x43, 0xE8, - 0x9D, 0xB9, 0x43, 0xE8, 0x9E, 0x86, 0x43, 0xE8, - 0x9E, 0xBA, 0x43, 0xE8, 0x9F, 0xA1, 0x43, 0xE8, - 0xA0, 0x81, 0x43, 0xE8, 0xA0, 0x9F, 0x43, 0xE8, - 0xA1, 0x80, 0x43, 0xE8, 0xA1, 0x8C, 0x43, 0xE8, - 0xA1, 0xA0, 0x43, 0xE8, 0xA1, 0xA3, 0x43, 0xE8, - 0xA3, 0x82, 0x43, 0xE8, 0xA3, 0x8F, 0x43, 0xE8, - // Bytes 1300 - 133f - 0xA3, 0x97, 0x43, 0xE8, 0xA3, 0x9E, 0x43, 0xE8, - 0xA3, 0xA1, 0x43, 0xE8, 0xA3, 0xB8, 0x43, 0xE8, - 0xA3, 0xBA, 0x43, 0xE8, 0xA4, 0x90, 0x43, 0xE8, - 0xA5, 0x81, 0x43, 0xE8, 0xA5, 0xA4, 0x43, 0xE8, - 0xA5, 0xBE, 0x43, 0xE8, 0xA6, 0x86, 0x43, 0xE8, - 0xA6, 0x8B, 0x43, 0xE8, 0xA6, 0x96, 0x43, 0xE8, - 0xA7, 0x92, 0x43, 0xE8, 0xA7, 0xA3, 0x43, 0xE8, - 0xA8, 0x80, 0x43, 0xE8, 0xAA, 0xA0, 0x43, 0xE8, - // Bytes 1340 - 137f - 0xAA, 0xAA, 0x43, 0xE8, 0xAA, 0xBF, 0x43, 0xE8, - 0xAB, 0x8B, 0x43, 0xE8, 0xAB, 0x92, 0x43, 0xE8, - 0xAB, 0x96, 0x43, 0xE8, 0xAB, 0xAD, 0x43, 0xE8, - 0xAB, 0xB8, 0x43, 0xE8, 0xAB, 0xBE, 0x43, 0xE8, - 0xAC, 0x81, 0x43, 0xE8, 0xAC, 0xB9, 0x43, 0xE8, - 0xAD, 0x98, 0x43, 0xE8, 0xAE, 0x80, 0x43, 0xE8, - 0xAE, 0x8A, 0x43, 0xE8, 0xB0, 0xB7, 0x43, 0xE8, - 0xB1, 0x86, 0x43, 0xE8, 0xB1, 0x88, 0x43, 0xE8, - // Bytes 1380 - 13bf - 0xB1, 0x95, 0x43, 0xE8, 0xB1, 0xB8, 0x43, 0xE8, - 0xB2, 0x9D, 0x43, 0xE8, 0xB2, 0xA1, 0x43, 0xE8, - 0xB2, 0xA9, 0x43, 0xE8, 0xB2, 0xAB, 0x43, 0xE8, - 0xB3, 0x81, 0x43, 0xE8, 0xB3, 0x82, 0x43, 0xE8, - 0xB3, 0x87, 0x43, 0xE8, 0xB3, 0x88, 0x43, 0xE8, - 0xB3, 0x93, 0x43, 0xE8, 0xB4, 0x88, 0x43, 0xE8, - 0xB4, 0x9B, 0x43, 0xE8, 0xB5, 0xA4, 0x43, 0xE8, - 0xB5, 0xB0, 0x43, 0xE8, 0xB5, 0xB7, 0x43, 0xE8, - // Bytes 13c0 - 13ff - 0xB6, 0xB3, 0x43, 0xE8, 0xB6, 0xBC, 0x43, 0xE8, - 0xB7, 0x8B, 0x43, 0xE8, 0xB7, 0xAF, 0x43, 0xE8, - 0xB7, 0xB0, 0x43, 0xE8, 0xBA, 0xAB, 0x43, 0xE8, - 0xBB, 0x8A, 0x43, 0xE8, 0xBB, 0x94, 0x43, 0xE8, - 0xBC, 0xA6, 0x43, 0xE8, 0xBC, 0xAA, 0x43, 0xE8, - 0xBC, 0xB8, 0x43, 0xE8, 0xBC, 0xBB, 0x43, 0xE8, - 0xBD, 0xA2, 0x43, 0xE8, 0xBE, 0x9B, 0x43, 0xE8, - 0xBE, 0x9E, 0x43, 0xE8, 0xBE, 0xB0, 0x43, 0xE8, - // Bytes 1400 - 143f - 0xBE, 0xB5, 0x43, 0xE8, 0xBE, 0xB6, 0x43, 0xE9, - 0x80, 0xA3, 0x43, 0xE9, 0x80, 0xB8, 0x43, 0xE9, - 0x81, 0x8A, 0x43, 0xE9, 0x81, 0xA9, 0x43, 0xE9, - 0x81, 0xB2, 0x43, 0xE9, 0x81, 0xBC, 0x43, 0xE9, - 0x82, 0x8F, 0x43, 0xE9, 0x82, 0x91, 0x43, 0xE9, - 0x82, 0x94, 0x43, 0xE9, 0x83, 0x8E, 0x43, 0xE9, - 0x83, 0x9E, 0x43, 0xE9, 0x83, 0xB1, 0x43, 0xE9, - 0x83, 0xBD, 0x43, 0xE9, 0x84, 0x91, 0x43, 0xE9, - // Bytes 1440 - 147f - 0x84, 0x9B, 0x43, 0xE9, 0x85, 0x89, 0x43, 0xE9, - 0x85, 0x8D, 0x43, 0xE9, 0x85, 0xAA, 0x43, 0xE9, - 0x86, 0x99, 0x43, 0xE9, 0x86, 0xB4, 0x43, 0xE9, - 0x87, 0x86, 0x43, 0xE9, 0x87, 0x8C, 0x43, 0xE9, - 0x87, 0x8F, 0x43, 0xE9, 0x87, 0x91, 0x43, 0xE9, - 0x88, 0xB4, 0x43, 0xE9, 0x88, 0xB8, 0x43, 0xE9, - 0x89, 0xB6, 0x43, 0xE9, 0x89, 0xBC, 0x43, 0xE9, - 0x8B, 0x97, 0x43, 0xE9, 0x8B, 0x98, 0x43, 0xE9, - // Bytes 1480 - 14bf - 0x8C, 0x84, 0x43, 0xE9, 0x8D, 0x8A, 0x43, 0xE9, - 0x8F, 0xB9, 0x43, 0xE9, 0x90, 0x95, 0x43, 0xE9, - 0x95, 0xB7, 0x43, 0xE9, 0x96, 0x80, 0x43, 0xE9, - 0x96, 0x8B, 0x43, 0xE9, 0x96, 0xAD, 0x43, 0xE9, - 0x96, 0xB7, 0x43, 0xE9, 0x98, 0x9C, 0x43, 0xE9, - 0x98, 0xAE, 0x43, 0xE9, 0x99, 0x8B, 0x43, 0xE9, - 0x99, 0x8D, 0x43, 0xE9, 0x99, 0xB5, 0x43, 0xE9, - 0x99, 0xB8, 0x43, 0xE9, 0x99, 0xBC, 0x43, 0xE9, - // Bytes 14c0 - 14ff - 0x9A, 0x86, 0x43, 0xE9, 0x9A, 0xA3, 0x43, 0xE9, - 0x9A, 0xB6, 0x43, 0xE9, 0x9A, 0xB7, 0x43, 0xE9, - 0x9A, 0xB8, 0x43, 0xE9, 0x9A, 0xB9, 0x43, 0xE9, - 0x9B, 0x83, 0x43, 0xE9, 0x9B, 0xA2, 0x43, 0xE9, - 0x9B, 0xA3, 0x43, 0xE9, 0x9B, 0xA8, 0x43, 0xE9, - 0x9B, 0xB6, 0x43, 0xE9, 0x9B, 0xB7, 0x43, 0xE9, - 0x9C, 0xA3, 0x43, 0xE9, 0x9C, 0xB2, 0x43, 0xE9, - 0x9D, 0x88, 0x43, 0xE9, 0x9D, 0x91, 0x43, 0xE9, - // Bytes 1500 - 153f - 0x9D, 0x96, 0x43, 0xE9, 0x9D, 0x9E, 0x43, 0xE9, - 0x9D, 0xA2, 0x43, 0xE9, 0x9D, 0xA9, 0x43, 0xE9, - 0x9F, 0x8B, 0x43, 0xE9, 0x9F, 0x9B, 0x43, 0xE9, - 0x9F, 0xA0, 0x43, 0xE9, 0x9F, 0xAD, 0x43, 0xE9, - 0x9F, 0xB3, 0x43, 0xE9, 0x9F, 0xBF, 0x43, 0xE9, - 0xA0, 0x81, 0x43, 0xE9, 0xA0, 0x85, 0x43, 0xE9, - 0xA0, 0x8B, 0x43, 0xE9, 0xA0, 0x98, 0x43, 0xE9, - 0xA0, 0xA9, 0x43, 0xE9, 0xA0, 0xBB, 0x43, 0xE9, - // Bytes 1540 - 157f - 0xA1, 0x9E, 0x43, 0xE9, 0xA2, 0xA8, 0x43, 0xE9, - 0xA3, 0x9B, 0x43, 0xE9, 0xA3, 0x9F, 0x43, 0xE9, - 0xA3, 0xA2, 0x43, 0xE9, 0xA3, 0xAF, 0x43, 0xE9, - 0xA3, 0xBC, 0x43, 0xE9, 0xA4, 0xA8, 0x43, 0xE9, - 0xA4, 0xA9, 0x43, 0xE9, 0xA6, 0x96, 0x43, 0xE9, - 0xA6, 0x99, 0x43, 0xE9, 0xA6, 0xA7, 0x43, 0xE9, - 0xA6, 0xAC, 0x43, 0xE9, 0xA7, 0x82, 0x43, 0xE9, - 0xA7, 0xB1, 0x43, 0xE9, 0xA7, 0xBE, 0x43, 0xE9, - // Bytes 1580 - 15bf - 0xA9, 0xAA, 0x43, 0xE9, 0xAA, 0xA8, 0x43, 0xE9, - 0xAB, 0x98, 0x43, 0xE9, 0xAB, 0x9F, 0x43, 0xE9, - 0xAC, 0x92, 0x43, 0xE9, 0xAC, 0xA5, 0x43, 0xE9, - 0xAC, 0xAF, 0x43, 0xE9, 0xAC, 0xB2, 0x43, 0xE9, - 0xAC, 0xBC, 0x43, 0xE9, 0xAD, 0x9A, 0x43, 0xE9, - 0xAD, 0xAF, 0x43, 0xE9, 0xB1, 0x80, 0x43, 0xE9, - 0xB1, 0x97, 0x43, 0xE9, 0xB3, 0xA5, 0x43, 0xE9, - 0xB3, 0xBD, 0x43, 0xE9, 0xB5, 0xA7, 0x43, 0xE9, - // Bytes 15c0 - 15ff - 0xB6, 0xB4, 0x43, 0xE9, 0xB7, 0xBA, 0x43, 0xE9, - 0xB8, 0x9E, 0x43, 0xE9, 0xB9, 0xB5, 0x43, 0xE9, - 0xB9, 0xBF, 0x43, 0xE9, 0xBA, 0x97, 0x43, 0xE9, - 0xBA, 0x9F, 0x43, 0xE9, 0xBA, 0xA5, 0x43, 0xE9, - 0xBA, 0xBB, 0x43, 0xE9, 0xBB, 0x83, 0x43, 0xE9, - 0xBB, 0x8D, 0x43, 0xE9, 0xBB, 0x8E, 0x43, 0xE9, - 0xBB, 0x91, 0x43, 0xE9, 0xBB, 0xB9, 0x43, 0xE9, - 0xBB, 0xBD, 0x43, 0xE9, 0xBB, 0xBE, 0x43, 0xE9, - // Bytes 1600 - 163f - 0xBC, 0x85, 0x43, 0xE9, 0xBC, 0x8E, 0x43, 0xE9, - 0xBC, 0x8F, 0x43, 0xE9, 0xBC, 0x93, 0x43, 0xE9, - 0xBC, 0x96, 0x43, 0xE9, 0xBC, 0xA0, 0x43, 0xE9, - 0xBC, 0xBB, 0x43, 0xE9, 0xBD, 0x83, 0x43, 0xE9, - 0xBD, 0x8A, 0x43, 0xE9, 0xBD, 0x92, 0x43, 0xE9, - 0xBE, 0x8D, 0x43, 0xE9, 0xBE, 0x8E, 0x43, 0xE9, - 0xBE, 0x9C, 0x43, 0xE9, 0xBE, 0x9F, 0x43, 0xE9, - 0xBE, 0xA0, 0x43, 0xEA, 0x9C, 0xA7, 0x43, 0xEA, - // Bytes 1640 - 167f - 0x9D, 0xAF, 0x43, 0xEA, 0xAC, 0xB7, 0x43, 0xEA, - 0xAD, 0x92, 0x44, 0xF0, 0xA0, 0x84, 0xA2, 0x44, - 0xF0, 0xA0, 0x94, 0x9C, 0x44, 0xF0, 0xA0, 0x94, - 0xA5, 0x44, 0xF0, 0xA0, 0x95, 0x8B, 0x44, 0xF0, - 0xA0, 0x98, 0xBA, 0x44, 0xF0, 0xA0, 0xA0, 0x84, - 0x44, 0xF0, 0xA0, 0xA3, 0x9E, 0x44, 0xF0, 0xA0, - 0xA8, 0xAC, 0x44, 0xF0, 0xA0, 0xAD, 0xA3, 0x44, - 0xF0, 0xA1, 0x93, 0xA4, 0x44, 0xF0, 0xA1, 0x9A, - // Bytes 1680 - 16bf - 0xA8, 0x44, 0xF0, 0xA1, 0x9B, 0xAA, 0x44, 0xF0, - 0xA1, 0xA7, 0x88, 0x44, 0xF0, 0xA1, 0xAC, 0x98, - 0x44, 0xF0, 0xA1, 0xB4, 0x8B, 0x44, 0xF0, 0xA1, - 0xB7, 0xA4, 0x44, 0xF0, 0xA1, 0xB7, 0xA6, 0x44, - 0xF0, 0xA2, 0x86, 0x83, 0x44, 0xF0, 0xA2, 0x86, - 0x9F, 0x44, 0xF0, 0xA2, 0x8C, 0xB1, 0x44, 0xF0, - 0xA2, 0x9B, 0x94, 0x44, 0xF0, 0xA2, 0xA1, 0x84, - 0x44, 0xF0, 0xA2, 0xA1, 0x8A, 0x44, 0xF0, 0xA2, - // Bytes 16c0 - 16ff - 0xAC, 0x8C, 0x44, 0xF0, 0xA2, 0xAF, 0xB1, 0x44, - 0xF0, 0xA3, 0x80, 0x8A, 0x44, 0xF0, 0xA3, 0x8A, - 0xB8, 0x44, 0xF0, 0xA3, 0x8D, 0x9F, 0x44, 0xF0, - 0xA3, 0x8E, 0x93, 0x44, 0xF0, 0xA3, 0x8E, 0x9C, - 0x44, 0xF0, 0xA3, 0x8F, 0x83, 0x44, 0xF0, 0xA3, - 0x8F, 0x95, 0x44, 0xF0, 0xA3, 0x91, 0xAD, 0x44, - 0xF0, 0xA3, 0x9A, 0xA3, 0x44, 0xF0, 0xA3, 0xA2, - 0xA7, 0x44, 0xF0, 0xA3, 0xAA, 0x8D, 0x44, 0xF0, - // Bytes 1700 - 173f - 0xA3, 0xAB, 0xBA, 0x44, 0xF0, 0xA3, 0xB2, 0xBC, - 0x44, 0xF0, 0xA3, 0xB4, 0x9E, 0x44, 0xF0, 0xA3, - 0xBB, 0x91, 0x44, 0xF0, 0xA3, 0xBD, 0x9E, 0x44, - 0xF0, 0xA3, 0xBE, 0x8E, 0x44, 0xF0, 0xA4, 0x89, - 0xA3, 0x44, 0xF0, 0xA4, 0x8B, 0xAE, 0x44, 0xF0, - 0xA4, 0x8E, 0xAB, 0x44, 0xF0, 0xA4, 0x98, 0x88, - 0x44, 0xF0, 0xA4, 0x9C, 0xB5, 0x44, 0xF0, 0xA4, - 0xA0, 0x94, 0x44, 0xF0, 0xA4, 0xB0, 0xB6, 0x44, - // Bytes 1740 - 177f - 0xF0, 0xA4, 0xB2, 0x92, 0x44, 0xF0, 0xA4, 0xBE, - 0xA1, 0x44, 0xF0, 0xA4, 0xBE, 0xB8, 0x44, 0xF0, - 0xA5, 0x81, 0x84, 0x44, 0xF0, 0xA5, 0x83, 0xB2, - 0x44, 0xF0, 0xA5, 0x83, 0xB3, 0x44, 0xF0, 0xA5, - 0x84, 0x99, 0x44, 0xF0, 0xA5, 0x84, 0xB3, 0x44, - 0xF0, 0xA5, 0x89, 0x89, 0x44, 0xF0, 0xA5, 0x90, - 0x9D, 0x44, 0xF0, 0xA5, 0x98, 0xA6, 0x44, 0xF0, - 0xA5, 0x9A, 0x9A, 0x44, 0xF0, 0xA5, 0x9B, 0x85, - // Bytes 1780 - 17bf - 0x44, 0xF0, 0xA5, 0xA5, 0xBC, 0x44, 0xF0, 0xA5, - 0xAA, 0xA7, 0x44, 0xF0, 0xA5, 0xAE, 0xAB, 0x44, - 0xF0, 0xA5, 0xB2, 0x80, 0x44, 0xF0, 0xA5, 0xB3, - 0x90, 0x44, 0xF0, 0xA5, 0xBE, 0x86, 0x44, 0xF0, - 0xA6, 0x87, 0x9A, 0x44, 0xF0, 0xA6, 0x88, 0xA8, - 0x44, 0xF0, 0xA6, 0x89, 0x87, 0x44, 0xF0, 0xA6, - 0x8B, 0x99, 0x44, 0xF0, 0xA6, 0x8C, 0xBE, 0x44, - 0xF0, 0xA6, 0x93, 0x9A, 0x44, 0xF0, 0xA6, 0x94, - // Bytes 17c0 - 17ff - 0xA3, 0x44, 0xF0, 0xA6, 0x96, 0xA8, 0x44, 0xF0, - 0xA6, 0x9E, 0xA7, 0x44, 0xF0, 0xA6, 0x9E, 0xB5, - 0x44, 0xF0, 0xA6, 0xAC, 0xBC, 0x44, 0xF0, 0xA6, - 0xB0, 0xB6, 0x44, 0xF0, 0xA6, 0xB3, 0x95, 0x44, - 0xF0, 0xA6, 0xB5, 0xAB, 0x44, 0xF0, 0xA6, 0xBC, - 0xAC, 0x44, 0xF0, 0xA6, 0xBE, 0xB1, 0x44, 0xF0, - 0xA7, 0x83, 0x92, 0x44, 0xF0, 0xA7, 0x8F, 0x8A, - 0x44, 0xF0, 0xA7, 0x99, 0xA7, 0x44, 0xF0, 0xA7, - // Bytes 1800 - 183f - 0xA2, 0xAE, 0x44, 0xF0, 0xA7, 0xA5, 0xA6, 0x44, - 0xF0, 0xA7, 0xB2, 0xA8, 0x44, 0xF0, 0xA7, 0xBB, - 0x93, 0x44, 0xF0, 0xA7, 0xBC, 0xAF, 0x44, 0xF0, - 0xA8, 0x97, 0x92, 0x44, 0xF0, 0xA8, 0x97, 0xAD, - 0x44, 0xF0, 0xA8, 0x9C, 0xAE, 0x44, 0xF0, 0xA8, - 0xAF, 0xBA, 0x44, 0xF0, 0xA8, 0xB5, 0xB7, 0x44, - 0xF0, 0xA9, 0x85, 0x85, 0x44, 0xF0, 0xA9, 0x87, - 0x9F, 0x44, 0xF0, 0xA9, 0x88, 0x9A, 0x44, 0xF0, - // Bytes 1840 - 187f - 0xA9, 0x90, 0x8A, 0x44, 0xF0, 0xA9, 0x92, 0x96, - 0x44, 0xF0, 0xA9, 0x96, 0xB6, 0x44, 0xF0, 0xA9, - 0xAC, 0xB0, 0x44, 0xF0, 0xAA, 0x83, 0x8E, 0x44, - 0xF0, 0xAA, 0x84, 0x85, 0x44, 0xF0, 0xAA, 0x88, - 0x8E, 0x44, 0xF0, 0xAA, 0x8A, 0x91, 0x44, 0xF0, - 0xAA, 0x8E, 0x92, 0x44, 0xF0, 0xAA, 0x98, 0x80, - 0x42, 0x21, 0x21, 0x42, 0x21, 0x3F, 0x42, 0x2E, - 0x2E, 0x42, 0x30, 0x2C, 0x42, 0x30, 0x2E, 0x42, - // Bytes 1880 - 18bf - 0x31, 0x2C, 0x42, 0x31, 0x2E, 0x42, 0x31, 0x30, - 0x42, 0x31, 0x31, 0x42, 0x31, 0x32, 0x42, 0x31, - 0x33, 0x42, 0x31, 0x34, 0x42, 0x31, 0x35, 0x42, - 0x31, 0x36, 0x42, 0x31, 0x37, 0x42, 0x31, 0x38, - 0x42, 0x31, 0x39, 0x42, 0x32, 0x2C, 0x42, 0x32, - 0x2E, 0x42, 0x32, 0x30, 0x42, 0x32, 0x31, 0x42, - 0x32, 0x32, 0x42, 0x32, 0x33, 0x42, 0x32, 0x34, - 0x42, 0x32, 0x35, 0x42, 0x32, 0x36, 0x42, 0x32, - // Bytes 18c0 - 18ff - 0x37, 0x42, 0x32, 0x38, 0x42, 0x32, 0x39, 0x42, - 0x33, 0x2C, 0x42, 0x33, 0x2E, 0x42, 0x33, 0x30, - 0x42, 0x33, 0x31, 0x42, 0x33, 0x32, 0x42, 0x33, - 0x33, 0x42, 0x33, 0x34, 0x42, 0x33, 0x35, 0x42, - 0x33, 0x36, 0x42, 0x33, 0x37, 0x42, 0x33, 0x38, - 0x42, 0x33, 0x39, 0x42, 0x34, 0x2C, 0x42, 0x34, - 0x2E, 0x42, 0x34, 0x30, 0x42, 0x34, 0x31, 0x42, - 0x34, 0x32, 0x42, 0x34, 0x33, 0x42, 0x34, 0x34, - // Bytes 1900 - 193f - 0x42, 0x34, 0x35, 0x42, 0x34, 0x36, 0x42, 0x34, - 0x37, 0x42, 0x34, 0x38, 0x42, 0x34, 0x39, 0x42, - 0x35, 0x2C, 0x42, 0x35, 0x2E, 0x42, 0x35, 0x30, - 0x42, 0x36, 0x2C, 0x42, 0x36, 0x2E, 0x42, 0x37, - 0x2C, 0x42, 0x37, 0x2E, 0x42, 0x38, 0x2C, 0x42, - 0x38, 0x2E, 0x42, 0x39, 0x2C, 0x42, 0x39, 0x2E, - 0x42, 0x3D, 0x3D, 0x42, 0x3F, 0x21, 0x42, 0x3F, - 0x3F, 0x42, 0x41, 0x55, 0x42, 0x42, 0x71, 0x42, - // Bytes 1940 - 197f - 0x43, 0x44, 0x42, 0x44, 0x4A, 0x42, 0x44, 0x5A, - 0x42, 0x44, 0x7A, 0x42, 0x47, 0x42, 0x42, 0x47, - 0x79, 0x42, 0x48, 0x50, 0x42, 0x48, 0x56, 0x42, - 0x48, 0x67, 0x42, 0x48, 0x7A, 0x42, 0x49, 0x49, - 0x42, 0x49, 0x4A, 0x42, 0x49, 0x55, 0x42, 0x49, - 0x56, 0x42, 0x49, 0x58, 0x42, 0x4B, 0x42, 0x42, - 0x4B, 0x4B, 0x42, 0x4B, 0x4D, 0x42, 0x4C, 0x4A, - 0x42, 0x4C, 0x6A, 0x42, 0x4D, 0x42, 0x42, 0x4D, - // Bytes 1980 - 19bf - 0x43, 0x42, 0x4D, 0x44, 0x42, 0x4D, 0x52, 0x42, - 0x4D, 0x56, 0x42, 0x4D, 0x57, 0x42, 0x4E, 0x4A, - 0x42, 0x4E, 0x6A, 0x42, 0x4E, 0x6F, 0x42, 0x50, - 0x48, 0x42, 0x50, 0x52, 0x42, 0x50, 0x61, 0x42, - 0x52, 0x73, 0x42, 0x53, 0x44, 0x42, 0x53, 0x4D, - 0x42, 0x53, 0x53, 0x42, 0x53, 0x76, 0x42, 0x54, - 0x4D, 0x42, 0x56, 0x49, 0x42, 0x57, 0x43, 0x42, - 0x57, 0x5A, 0x42, 0x57, 0x62, 0x42, 0x58, 0x49, - // Bytes 19c0 - 19ff - 0x42, 0x63, 0x63, 0x42, 0x63, 0x64, 0x42, 0x63, - 0x6D, 0x42, 0x64, 0x42, 0x42, 0x64, 0x61, 0x42, - 0x64, 0x6C, 0x42, 0x64, 0x6D, 0x42, 0x64, 0x7A, - 0x42, 0x65, 0x56, 0x42, 0x66, 0x66, 0x42, 0x66, - 0x69, 0x42, 0x66, 0x6C, 0x42, 0x66, 0x6D, 0x42, - 0x68, 0x61, 0x42, 0x69, 0x69, 0x42, 0x69, 0x6A, - 0x42, 0x69, 0x6E, 0x42, 0x69, 0x76, 0x42, 0x69, - 0x78, 0x42, 0x6B, 0x41, 0x42, 0x6B, 0x56, 0x42, - // Bytes 1a00 - 1a3f - 0x6B, 0x57, 0x42, 0x6B, 0x67, 0x42, 0x6B, 0x6C, - 0x42, 0x6B, 0x6D, 0x42, 0x6B, 0x74, 0x42, 0x6C, - 0x6A, 0x42, 0x6C, 0x6D, 0x42, 0x6C, 0x6E, 0x42, - 0x6C, 0x78, 0x42, 0x6D, 0x32, 0x42, 0x6D, 0x33, - 0x42, 0x6D, 0x41, 0x42, 0x6D, 0x56, 0x42, 0x6D, - 0x57, 0x42, 0x6D, 0x62, 0x42, 0x6D, 0x67, 0x42, - 0x6D, 0x6C, 0x42, 0x6D, 0x6D, 0x42, 0x6D, 0x73, - 0x42, 0x6E, 0x41, 0x42, 0x6E, 0x46, 0x42, 0x6E, - // Bytes 1a40 - 1a7f - 0x56, 0x42, 0x6E, 0x57, 0x42, 0x6E, 0x6A, 0x42, - 0x6E, 0x6D, 0x42, 0x6E, 0x73, 0x42, 0x6F, 0x56, - 0x42, 0x70, 0x41, 0x42, 0x70, 0x46, 0x42, 0x70, - 0x56, 0x42, 0x70, 0x57, 0x42, 0x70, 0x63, 0x42, - 0x70, 0x73, 0x42, 0x73, 0x72, 0x42, 0x73, 0x74, - 0x42, 0x76, 0x69, 0x42, 0x78, 0x69, 0x43, 0x28, - 0x31, 0x29, 0x43, 0x28, 0x32, 0x29, 0x43, 0x28, - 0x33, 0x29, 0x43, 0x28, 0x34, 0x29, 0x43, 0x28, - // Bytes 1a80 - 1abf - 0x35, 0x29, 0x43, 0x28, 0x36, 0x29, 0x43, 0x28, - 0x37, 0x29, 0x43, 0x28, 0x38, 0x29, 0x43, 0x28, - 0x39, 0x29, 0x43, 0x28, 0x41, 0x29, 0x43, 0x28, - 0x42, 0x29, 0x43, 0x28, 0x43, 0x29, 0x43, 0x28, - 0x44, 0x29, 0x43, 0x28, 0x45, 0x29, 0x43, 0x28, - 0x46, 0x29, 0x43, 0x28, 0x47, 0x29, 0x43, 0x28, - 0x48, 0x29, 0x43, 0x28, 0x49, 0x29, 0x43, 0x28, - 0x4A, 0x29, 0x43, 0x28, 0x4B, 0x29, 0x43, 0x28, - // Bytes 1ac0 - 1aff - 0x4C, 0x29, 0x43, 0x28, 0x4D, 0x29, 0x43, 0x28, - 0x4E, 0x29, 0x43, 0x28, 0x4F, 0x29, 0x43, 0x28, - 0x50, 0x29, 0x43, 0x28, 0x51, 0x29, 0x43, 0x28, - 0x52, 0x29, 0x43, 0x28, 0x53, 0x29, 0x43, 0x28, - 0x54, 0x29, 0x43, 0x28, 0x55, 0x29, 0x43, 0x28, - 0x56, 0x29, 0x43, 0x28, 0x57, 0x29, 0x43, 0x28, - 0x58, 0x29, 0x43, 0x28, 0x59, 0x29, 0x43, 0x28, - 0x5A, 0x29, 0x43, 0x28, 0x61, 0x29, 0x43, 0x28, - // Bytes 1b00 - 1b3f - 0x62, 0x29, 0x43, 0x28, 0x63, 0x29, 0x43, 0x28, - 0x64, 0x29, 0x43, 0x28, 0x65, 0x29, 0x43, 0x28, - 0x66, 0x29, 0x43, 0x28, 0x67, 0x29, 0x43, 0x28, - 0x68, 0x29, 0x43, 0x28, 0x69, 0x29, 0x43, 0x28, - 0x6A, 0x29, 0x43, 0x28, 0x6B, 0x29, 0x43, 0x28, - 0x6C, 0x29, 0x43, 0x28, 0x6D, 0x29, 0x43, 0x28, - 0x6E, 0x29, 0x43, 0x28, 0x6F, 0x29, 0x43, 0x28, - 0x70, 0x29, 0x43, 0x28, 0x71, 0x29, 0x43, 0x28, - // Bytes 1b40 - 1b7f - 0x72, 0x29, 0x43, 0x28, 0x73, 0x29, 0x43, 0x28, - 0x74, 0x29, 0x43, 0x28, 0x75, 0x29, 0x43, 0x28, - 0x76, 0x29, 0x43, 0x28, 0x77, 0x29, 0x43, 0x28, - 0x78, 0x29, 0x43, 0x28, 0x79, 0x29, 0x43, 0x28, - 0x7A, 0x29, 0x43, 0x2E, 0x2E, 0x2E, 0x43, 0x31, - 0x30, 0x2E, 0x43, 0x31, 0x31, 0x2E, 0x43, 0x31, - 0x32, 0x2E, 0x43, 0x31, 0x33, 0x2E, 0x43, 0x31, - 0x34, 0x2E, 0x43, 0x31, 0x35, 0x2E, 0x43, 0x31, - // Bytes 1b80 - 1bbf - 0x36, 0x2E, 0x43, 0x31, 0x37, 0x2E, 0x43, 0x31, - 0x38, 0x2E, 0x43, 0x31, 0x39, 0x2E, 0x43, 0x32, - 0x30, 0x2E, 0x43, 0x3A, 0x3A, 0x3D, 0x43, 0x3D, - 0x3D, 0x3D, 0x43, 0x43, 0x6F, 0x2E, 0x43, 0x46, - 0x41, 0x58, 0x43, 0x47, 0x48, 0x7A, 0x43, 0x47, - 0x50, 0x61, 0x43, 0x49, 0x49, 0x49, 0x43, 0x4C, - 0x54, 0x44, 0x43, 0x4C, 0xC2, 0xB7, 0x43, 0x4D, - 0x48, 0x7A, 0x43, 0x4D, 0x50, 0x61, 0x43, 0x4D, - // Bytes 1bc0 - 1bff - 0xCE, 0xA9, 0x43, 0x50, 0x50, 0x4D, 0x43, 0x50, - 0x50, 0x56, 0x43, 0x50, 0x54, 0x45, 0x43, 0x54, - 0x45, 0x4C, 0x43, 0x54, 0x48, 0x7A, 0x43, 0x56, - 0x49, 0x49, 0x43, 0x58, 0x49, 0x49, 0x43, 0x61, - 0x2F, 0x63, 0x43, 0x61, 0x2F, 0x73, 0x43, 0x61, - 0xCA, 0xBE, 0x43, 0x62, 0x61, 0x72, 0x43, 0x63, - 0x2F, 0x6F, 0x43, 0x63, 0x2F, 0x75, 0x43, 0x63, - 0x61, 0x6C, 0x43, 0x63, 0x6D, 0x32, 0x43, 0x63, - // Bytes 1c00 - 1c3f - 0x6D, 0x33, 0x43, 0x64, 0x6D, 0x32, 0x43, 0x64, - 0x6D, 0x33, 0x43, 0x65, 0x72, 0x67, 0x43, 0x66, - 0x66, 0x69, 0x43, 0x66, 0x66, 0x6C, 0x43, 0x67, - 0x61, 0x6C, 0x43, 0x68, 0x50, 0x61, 0x43, 0x69, - 0x69, 0x69, 0x43, 0x6B, 0x48, 0x7A, 0x43, 0x6B, - 0x50, 0x61, 0x43, 0x6B, 0x6D, 0x32, 0x43, 0x6B, - 0x6D, 0x33, 0x43, 0x6B, 0xCE, 0xA9, 0x43, 0x6C, - 0x6F, 0x67, 0x43, 0x6C, 0xC2, 0xB7, 0x43, 0x6D, - // Bytes 1c40 - 1c7f - 0x69, 0x6C, 0x43, 0x6D, 0x6D, 0x32, 0x43, 0x6D, - 0x6D, 0x33, 0x43, 0x6D, 0x6F, 0x6C, 0x43, 0x72, - 0x61, 0x64, 0x43, 0x76, 0x69, 0x69, 0x43, 0x78, - 0x69, 0x69, 0x43, 0xC2, 0xB0, 0x43, 0x43, 0xC2, - 0xB0, 0x46, 0x43, 0xCA, 0xBC, 0x6E, 0x43, 0xCE, - 0xBC, 0x41, 0x43, 0xCE, 0xBC, 0x46, 0x43, 0xCE, - 0xBC, 0x56, 0x43, 0xCE, 0xBC, 0x57, 0x43, 0xCE, - 0xBC, 0x67, 0x43, 0xCE, 0xBC, 0x6C, 0x43, 0xCE, - // Bytes 1c80 - 1cbf - 0xBC, 0x6D, 0x43, 0xCE, 0xBC, 0x73, 0x44, 0x28, - 0x31, 0x30, 0x29, 0x44, 0x28, 0x31, 0x31, 0x29, - 0x44, 0x28, 0x31, 0x32, 0x29, 0x44, 0x28, 0x31, - 0x33, 0x29, 0x44, 0x28, 0x31, 0x34, 0x29, 0x44, - 0x28, 0x31, 0x35, 0x29, 0x44, 0x28, 0x31, 0x36, - 0x29, 0x44, 0x28, 0x31, 0x37, 0x29, 0x44, 0x28, - 0x31, 0x38, 0x29, 0x44, 0x28, 0x31, 0x39, 0x29, - 0x44, 0x28, 0x32, 0x30, 0x29, 0x44, 0x30, 0xE7, - // Bytes 1cc0 - 1cff - 0x82, 0xB9, 0x44, 0x31, 0xE2, 0x81, 0x84, 0x44, - 0x31, 0xE6, 0x97, 0xA5, 0x44, 0x31, 0xE6, 0x9C, - 0x88, 0x44, 0x31, 0xE7, 0x82, 0xB9, 0x44, 0x32, - 0xE6, 0x97, 0xA5, 0x44, 0x32, 0xE6, 0x9C, 0x88, - 0x44, 0x32, 0xE7, 0x82, 0xB9, 0x44, 0x33, 0xE6, - 0x97, 0xA5, 0x44, 0x33, 0xE6, 0x9C, 0x88, 0x44, - 0x33, 0xE7, 0x82, 0xB9, 0x44, 0x34, 0xE6, 0x97, - 0xA5, 0x44, 0x34, 0xE6, 0x9C, 0x88, 0x44, 0x34, - // Bytes 1d00 - 1d3f - 0xE7, 0x82, 0xB9, 0x44, 0x35, 0xE6, 0x97, 0xA5, - 0x44, 0x35, 0xE6, 0x9C, 0x88, 0x44, 0x35, 0xE7, - 0x82, 0xB9, 0x44, 0x36, 0xE6, 0x97, 0xA5, 0x44, - 0x36, 0xE6, 0x9C, 0x88, 0x44, 0x36, 0xE7, 0x82, - 0xB9, 0x44, 0x37, 0xE6, 0x97, 0xA5, 0x44, 0x37, - 0xE6, 0x9C, 0x88, 0x44, 0x37, 0xE7, 0x82, 0xB9, - 0x44, 0x38, 0xE6, 0x97, 0xA5, 0x44, 0x38, 0xE6, - 0x9C, 0x88, 0x44, 0x38, 0xE7, 0x82, 0xB9, 0x44, - // Bytes 1d40 - 1d7f - 0x39, 0xE6, 0x97, 0xA5, 0x44, 0x39, 0xE6, 0x9C, - 0x88, 0x44, 0x39, 0xE7, 0x82, 0xB9, 0x44, 0x56, - 0x49, 0x49, 0x49, 0x44, 0x61, 0x2E, 0x6D, 0x2E, - 0x44, 0x6B, 0x63, 0x61, 0x6C, 0x44, 0x70, 0x2E, - 0x6D, 0x2E, 0x44, 0x76, 0x69, 0x69, 0x69, 0x44, - 0xD5, 0xA5, 0xD6, 0x82, 0x44, 0xD5, 0xB4, 0xD5, - 0xA5, 0x44, 0xD5, 0xB4, 0xD5, 0xAB, 0x44, 0xD5, - 0xB4, 0xD5, 0xAD, 0x44, 0xD5, 0xB4, 0xD5, 0xB6, - // Bytes 1d80 - 1dbf - 0x44, 0xD5, 0xBE, 0xD5, 0xB6, 0x44, 0xD7, 0x90, - 0xD7, 0x9C, 0x44, 0xD8, 0xA7, 0xD9, 0xB4, 0x44, - 0xD8, 0xA8, 0xD8, 0xAC, 0x44, 0xD8, 0xA8, 0xD8, - 0xAD, 0x44, 0xD8, 0xA8, 0xD8, 0xAE, 0x44, 0xD8, - 0xA8, 0xD8, 0xB1, 0x44, 0xD8, 0xA8, 0xD8, 0xB2, - 0x44, 0xD8, 0xA8, 0xD9, 0x85, 0x44, 0xD8, 0xA8, - 0xD9, 0x86, 0x44, 0xD8, 0xA8, 0xD9, 0x87, 0x44, - 0xD8, 0xA8, 0xD9, 0x89, 0x44, 0xD8, 0xA8, 0xD9, - // Bytes 1dc0 - 1dff - 0x8A, 0x44, 0xD8, 0xAA, 0xD8, 0xAC, 0x44, 0xD8, - 0xAA, 0xD8, 0xAD, 0x44, 0xD8, 0xAA, 0xD8, 0xAE, - 0x44, 0xD8, 0xAA, 0xD8, 0xB1, 0x44, 0xD8, 0xAA, - 0xD8, 0xB2, 0x44, 0xD8, 0xAA, 0xD9, 0x85, 0x44, - 0xD8, 0xAA, 0xD9, 0x86, 0x44, 0xD8, 0xAA, 0xD9, - 0x87, 0x44, 0xD8, 0xAA, 0xD9, 0x89, 0x44, 0xD8, - 0xAA, 0xD9, 0x8A, 0x44, 0xD8, 0xAB, 0xD8, 0xAC, - 0x44, 0xD8, 0xAB, 0xD8, 0xB1, 0x44, 0xD8, 0xAB, - // Bytes 1e00 - 1e3f - 0xD8, 0xB2, 0x44, 0xD8, 0xAB, 0xD9, 0x85, 0x44, - 0xD8, 0xAB, 0xD9, 0x86, 0x44, 0xD8, 0xAB, 0xD9, - 0x87, 0x44, 0xD8, 0xAB, 0xD9, 0x89, 0x44, 0xD8, - 0xAB, 0xD9, 0x8A, 0x44, 0xD8, 0xAC, 0xD8, 0xAD, - 0x44, 0xD8, 0xAC, 0xD9, 0x85, 0x44, 0xD8, 0xAC, - 0xD9, 0x89, 0x44, 0xD8, 0xAC, 0xD9, 0x8A, 0x44, - 0xD8, 0xAD, 0xD8, 0xAC, 0x44, 0xD8, 0xAD, 0xD9, - 0x85, 0x44, 0xD8, 0xAD, 0xD9, 0x89, 0x44, 0xD8, - // Bytes 1e40 - 1e7f - 0xAD, 0xD9, 0x8A, 0x44, 0xD8, 0xAE, 0xD8, 0xAC, - 0x44, 0xD8, 0xAE, 0xD8, 0xAD, 0x44, 0xD8, 0xAE, - 0xD9, 0x85, 0x44, 0xD8, 0xAE, 0xD9, 0x89, 0x44, - 0xD8, 0xAE, 0xD9, 0x8A, 0x44, 0xD8, 0xB3, 0xD8, - 0xAC, 0x44, 0xD8, 0xB3, 0xD8, 0xAD, 0x44, 0xD8, - 0xB3, 0xD8, 0xAE, 0x44, 0xD8, 0xB3, 0xD8, 0xB1, - 0x44, 0xD8, 0xB3, 0xD9, 0x85, 0x44, 0xD8, 0xB3, - 0xD9, 0x87, 0x44, 0xD8, 0xB3, 0xD9, 0x89, 0x44, - // Bytes 1e80 - 1ebf - 0xD8, 0xB3, 0xD9, 0x8A, 0x44, 0xD8, 0xB4, 0xD8, - 0xAC, 0x44, 0xD8, 0xB4, 0xD8, 0xAD, 0x44, 0xD8, - 0xB4, 0xD8, 0xAE, 0x44, 0xD8, 0xB4, 0xD8, 0xB1, - 0x44, 0xD8, 0xB4, 0xD9, 0x85, 0x44, 0xD8, 0xB4, - 0xD9, 0x87, 0x44, 0xD8, 0xB4, 0xD9, 0x89, 0x44, - 0xD8, 0xB4, 0xD9, 0x8A, 0x44, 0xD8, 0xB5, 0xD8, - 0xAD, 0x44, 0xD8, 0xB5, 0xD8, 0xAE, 0x44, 0xD8, - 0xB5, 0xD8, 0xB1, 0x44, 0xD8, 0xB5, 0xD9, 0x85, - // Bytes 1ec0 - 1eff - 0x44, 0xD8, 0xB5, 0xD9, 0x89, 0x44, 0xD8, 0xB5, - 0xD9, 0x8A, 0x44, 0xD8, 0xB6, 0xD8, 0xAC, 0x44, - 0xD8, 0xB6, 0xD8, 0xAD, 0x44, 0xD8, 0xB6, 0xD8, - 0xAE, 0x44, 0xD8, 0xB6, 0xD8, 0xB1, 0x44, 0xD8, - 0xB6, 0xD9, 0x85, 0x44, 0xD8, 0xB6, 0xD9, 0x89, - 0x44, 0xD8, 0xB6, 0xD9, 0x8A, 0x44, 0xD8, 0xB7, - 0xD8, 0xAD, 0x44, 0xD8, 0xB7, 0xD9, 0x85, 0x44, - 0xD8, 0xB7, 0xD9, 0x89, 0x44, 0xD8, 0xB7, 0xD9, - // Bytes 1f00 - 1f3f - 0x8A, 0x44, 0xD8, 0xB8, 0xD9, 0x85, 0x44, 0xD8, - 0xB9, 0xD8, 0xAC, 0x44, 0xD8, 0xB9, 0xD9, 0x85, - 0x44, 0xD8, 0xB9, 0xD9, 0x89, 0x44, 0xD8, 0xB9, - 0xD9, 0x8A, 0x44, 0xD8, 0xBA, 0xD8, 0xAC, 0x44, - 0xD8, 0xBA, 0xD9, 0x85, 0x44, 0xD8, 0xBA, 0xD9, - 0x89, 0x44, 0xD8, 0xBA, 0xD9, 0x8A, 0x44, 0xD9, - 0x81, 0xD8, 0xAC, 0x44, 0xD9, 0x81, 0xD8, 0xAD, - 0x44, 0xD9, 0x81, 0xD8, 0xAE, 0x44, 0xD9, 0x81, - // Bytes 1f40 - 1f7f - 0xD9, 0x85, 0x44, 0xD9, 0x81, 0xD9, 0x89, 0x44, - 0xD9, 0x81, 0xD9, 0x8A, 0x44, 0xD9, 0x82, 0xD8, - 0xAD, 0x44, 0xD9, 0x82, 0xD9, 0x85, 0x44, 0xD9, - 0x82, 0xD9, 0x89, 0x44, 0xD9, 0x82, 0xD9, 0x8A, - 0x44, 0xD9, 0x83, 0xD8, 0xA7, 0x44, 0xD9, 0x83, - 0xD8, 0xAC, 0x44, 0xD9, 0x83, 0xD8, 0xAD, 0x44, - 0xD9, 0x83, 0xD8, 0xAE, 0x44, 0xD9, 0x83, 0xD9, - 0x84, 0x44, 0xD9, 0x83, 0xD9, 0x85, 0x44, 0xD9, - // Bytes 1f80 - 1fbf - 0x83, 0xD9, 0x89, 0x44, 0xD9, 0x83, 0xD9, 0x8A, - 0x44, 0xD9, 0x84, 0xD8, 0xA7, 0x44, 0xD9, 0x84, - 0xD8, 0xAC, 0x44, 0xD9, 0x84, 0xD8, 0xAD, 0x44, - 0xD9, 0x84, 0xD8, 0xAE, 0x44, 0xD9, 0x84, 0xD9, - 0x85, 0x44, 0xD9, 0x84, 0xD9, 0x87, 0x44, 0xD9, - 0x84, 0xD9, 0x89, 0x44, 0xD9, 0x84, 0xD9, 0x8A, - 0x44, 0xD9, 0x85, 0xD8, 0xA7, 0x44, 0xD9, 0x85, - 0xD8, 0xAC, 0x44, 0xD9, 0x85, 0xD8, 0xAD, 0x44, - // Bytes 1fc0 - 1fff - 0xD9, 0x85, 0xD8, 0xAE, 0x44, 0xD9, 0x85, 0xD9, - 0x85, 0x44, 0xD9, 0x85, 0xD9, 0x89, 0x44, 0xD9, - 0x85, 0xD9, 0x8A, 0x44, 0xD9, 0x86, 0xD8, 0xAC, - 0x44, 0xD9, 0x86, 0xD8, 0xAD, 0x44, 0xD9, 0x86, - 0xD8, 0xAE, 0x44, 0xD9, 0x86, 0xD8, 0xB1, 0x44, - 0xD9, 0x86, 0xD8, 0xB2, 0x44, 0xD9, 0x86, 0xD9, - 0x85, 0x44, 0xD9, 0x86, 0xD9, 0x86, 0x44, 0xD9, - 0x86, 0xD9, 0x87, 0x44, 0xD9, 0x86, 0xD9, 0x89, - // Bytes 2000 - 203f - 0x44, 0xD9, 0x86, 0xD9, 0x8A, 0x44, 0xD9, 0x87, - 0xD8, 0xAC, 0x44, 0xD9, 0x87, 0xD9, 0x85, 0x44, - 0xD9, 0x87, 0xD9, 0x89, 0x44, 0xD9, 0x87, 0xD9, - 0x8A, 0x44, 0xD9, 0x88, 0xD9, 0xB4, 0x44, 0xD9, - 0x8A, 0xD8, 0xAC, 0x44, 0xD9, 0x8A, 0xD8, 0xAD, - 0x44, 0xD9, 0x8A, 0xD8, 0xAE, 0x44, 0xD9, 0x8A, - 0xD8, 0xB1, 0x44, 0xD9, 0x8A, 0xD8, 0xB2, 0x44, - 0xD9, 0x8A, 0xD9, 0x85, 0x44, 0xD9, 0x8A, 0xD9, - // Bytes 2040 - 207f - 0x86, 0x44, 0xD9, 0x8A, 0xD9, 0x87, 0x44, 0xD9, - 0x8A, 0xD9, 0x89, 0x44, 0xD9, 0x8A, 0xD9, 0x8A, - 0x44, 0xD9, 0x8A, 0xD9, 0xB4, 0x44, 0xDB, 0x87, - 0xD9, 0xB4, 0x45, 0x28, 0xE1, 0x84, 0x80, 0x29, - 0x45, 0x28, 0xE1, 0x84, 0x82, 0x29, 0x45, 0x28, - 0xE1, 0x84, 0x83, 0x29, 0x45, 0x28, 0xE1, 0x84, - 0x85, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x86, 0x29, - 0x45, 0x28, 0xE1, 0x84, 0x87, 0x29, 0x45, 0x28, - // Bytes 2080 - 20bf - 0xE1, 0x84, 0x89, 0x29, 0x45, 0x28, 0xE1, 0x84, - 0x8B, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x8C, 0x29, - 0x45, 0x28, 0xE1, 0x84, 0x8E, 0x29, 0x45, 0x28, - 0xE1, 0x84, 0x8F, 0x29, 0x45, 0x28, 0xE1, 0x84, - 0x90, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x91, 0x29, - 0x45, 0x28, 0xE1, 0x84, 0x92, 0x29, 0x45, 0x28, - 0xE4, 0xB8, 0x80, 0x29, 0x45, 0x28, 0xE4, 0xB8, - 0x83, 0x29, 0x45, 0x28, 0xE4, 0xB8, 0x89, 0x29, - // Bytes 20c0 - 20ff - 0x45, 0x28, 0xE4, 0xB9, 0x9D, 0x29, 0x45, 0x28, - 0xE4, 0xBA, 0x8C, 0x29, 0x45, 0x28, 0xE4, 0xBA, - 0x94, 0x29, 0x45, 0x28, 0xE4, 0xBB, 0xA3, 0x29, - 0x45, 0x28, 0xE4, 0xBC, 0x81, 0x29, 0x45, 0x28, - 0xE4, 0xBC, 0x91, 0x29, 0x45, 0x28, 0xE5, 0x85, - 0xAB, 0x29, 0x45, 0x28, 0xE5, 0x85, 0xAD, 0x29, - 0x45, 0x28, 0xE5, 0x8A, 0xB4, 0x29, 0x45, 0x28, - 0xE5, 0x8D, 0x81, 0x29, 0x45, 0x28, 0xE5, 0x8D, - // Bytes 2100 - 213f - 0x94, 0x29, 0x45, 0x28, 0xE5, 0x90, 0x8D, 0x29, - 0x45, 0x28, 0xE5, 0x91, 0xBC, 0x29, 0x45, 0x28, - 0xE5, 0x9B, 0x9B, 0x29, 0x45, 0x28, 0xE5, 0x9C, - 0x9F, 0x29, 0x45, 0x28, 0xE5, 0xAD, 0xA6, 0x29, - 0x45, 0x28, 0xE6, 0x97, 0xA5, 0x29, 0x45, 0x28, - 0xE6, 0x9C, 0x88, 0x29, 0x45, 0x28, 0xE6, 0x9C, - 0x89, 0x29, 0x45, 0x28, 0xE6, 0x9C, 0xA8, 0x29, - 0x45, 0x28, 0xE6, 0xA0, 0xAA, 0x29, 0x45, 0x28, - // Bytes 2140 - 217f - 0xE6, 0xB0, 0xB4, 0x29, 0x45, 0x28, 0xE7, 0x81, - 0xAB, 0x29, 0x45, 0x28, 0xE7, 0x89, 0xB9, 0x29, - 0x45, 0x28, 0xE7, 0x9B, 0xA3, 0x29, 0x45, 0x28, - 0xE7, 0xA4, 0xBE, 0x29, 0x45, 0x28, 0xE7, 0xA5, - 0x9D, 0x29, 0x45, 0x28, 0xE7, 0xA5, 0xAD, 0x29, - 0x45, 0x28, 0xE8, 0x87, 0xAA, 0x29, 0x45, 0x28, - 0xE8, 0x87, 0xB3, 0x29, 0x45, 0x28, 0xE8, 0xB2, - 0xA1, 0x29, 0x45, 0x28, 0xE8, 0xB3, 0x87, 0x29, - // Bytes 2180 - 21bf - 0x45, 0x28, 0xE9, 0x87, 0x91, 0x29, 0x45, 0x30, - 0xE2, 0x81, 0x84, 0x33, 0x45, 0x31, 0x30, 0xE6, - 0x97, 0xA5, 0x45, 0x31, 0x30, 0xE6, 0x9C, 0x88, - 0x45, 0x31, 0x30, 0xE7, 0x82, 0xB9, 0x45, 0x31, - 0x31, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x31, 0xE6, - 0x9C, 0x88, 0x45, 0x31, 0x31, 0xE7, 0x82, 0xB9, - 0x45, 0x31, 0x32, 0xE6, 0x97, 0xA5, 0x45, 0x31, - 0x32, 0xE6, 0x9C, 0x88, 0x45, 0x31, 0x32, 0xE7, - // Bytes 21c0 - 21ff - 0x82, 0xB9, 0x45, 0x31, 0x33, 0xE6, 0x97, 0xA5, - 0x45, 0x31, 0x33, 0xE7, 0x82, 0xB9, 0x45, 0x31, - 0x34, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x34, 0xE7, - 0x82, 0xB9, 0x45, 0x31, 0x35, 0xE6, 0x97, 0xA5, - 0x45, 0x31, 0x35, 0xE7, 0x82, 0xB9, 0x45, 0x31, - 0x36, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x36, 0xE7, - 0x82, 0xB9, 0x45, 0x31, 0x37, 0xE6, 0x97, 0xA5, - 0x45, 0x31, 0x37, 0xE7, 0x82, 0xB9, 0x45, 0x31, - // Bytes 2200 - 223f - 0x38, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x38, 0xE7, - 0x82, 0xB9, 0x45, 0x31, 0x39, 0xE6, 0x97, 0xA5, - 0x45, 0x31, 0x39, 0xE7, 0x82, 0xB9, 0x45, 0x31, - 0xE2, 0x81, 0x84, 0x32, 0x45, 0x31, 0xE2, 0x81, - 0x84, 0x33, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x34, - 0x45, 0x31, 0xE2, 0x81, 0x84, 0x35, 0x45, 0x31, - 0xE2, 0x81, 0x84, 0x36, 0x45, 0x31, 0xE2, 0x81, - 0x84, 0x37, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x38, - // Bytes 2240 - 227f - 0x45, 0x31, 0xE2, 0x81, 0x84, 0x39, 0x45, 0x32, - 0x30, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x30, 0xE7, - 0x82, 0xB9, 0x45, 0x32, 0x31, 0xE6, 0x97, 0xA5, - 0x45, 0x32, 0x31, 0xE7, 0x82, 0xB9, 0x45, 0x32, - 0x32, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x32, 0xE7, - 0x82, 0xB9, 0x45, 0x32, 0x33, 0xE6, 0x97, 0xA5, - 0x45, 0x32, 0x33, 0xE7, 0x82, 0xB9, 0x45, 0x32, - 0x34, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x34, 0xE7, - // Bytes 2280 - 22bf - 0x82, 0xB9, 0x45, 0x32, 0x35, 0xE6, 0x97, 0xA5, - 0x45, 0x32, 0x36, 0xE6, 0x97, 0xA5, 0x45, 0x32, - 0x37, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x38, 0xE6, - 0x97, 0xA5, 0x45, 0x32, 0x39, 0xE6, 0x97, 0xA5, - 0x45, 0x32, 0xE2, 0x81, 0x84, 0x33, 0x45, 0x32, - 0xE2, 0x81, 0x84, 0x35, 0x45, 0x33, 0x30, 0xE6, - 0x97, 0xA5, 0x45, 0x33, 0x31, 0xE6, 0x97, 0xA5, - 0x45, 0x33, 0xE2, 0x81, 0x84, 0x34, 0x45, 0x33, - // Bytes 22c0 - 22ff - 0xE2, 0x81, 0x84, 0x35, 0x45, 0x33, 0xE2, 0x81, - 0x84, 0x38, 0x45, 0x34, 0xE2, 0x81, 0x84, 0x35, - 0x45, 0x35, 0xE2, 0x81, 0x84, 0x36, 0x45, 0x35, - 0xE2, 0x81, 0x84, 0x38, 0x45, 0x37, 0xE2, 0x81, - 0x84, 0x38, 0x45, 0x41, 0xE2, 0x88, 0x95, 0x6D, - 0x45, 0x56, 0xE2, 0x88, 0x95, 0x6D, 0x45, 0x6D, - 0xE2, 0x88, 0x95, 0x73, 0x46, 0x31, 0xE2, 0x81, - 0x84, 0x31, 0x30, 0x46, 0x43, 0xE2, 0x88, 0x95, - // Bytes 2300 - 233f - 0x6B, 0x67, 0x46, 0x6D, 0xE2, 0x88, 0x95, 0x73, - 0x32, 0x46, 0xD8, 0xA8, 0xD8, 0xAD, 0xD9, 0x8A, - 0x46, 0xD8, 0xA8, 0xD8, 0xAE, 0xD9, 0x8A, 0x46, - 0xD8, 0xAA, 0xD8, 0xAC, 0xD9, 0x85, 0x46, 0xD8, - 0xAA, 0xD8, 0xAC, 0xD9, 0x89, 0x46, 0xD8, 0xAA, - 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD8, 0xAA, 0xD8, - 0xAD, 0xD8, 0xAC, 0x46, 0xD8, 0xAA, 0xD8, 0xAD, - 0xD9, 0x85, 0x46, 0xD8, 0xAA, 0xD8, 0xAE, 0xD9, - // Bytes 2340 - 237f - 0x85, 0x46, 0xD8, 0xAA, 0xD8, 0xAE, 0xD9, 0x89, - 0x46, 0xD8, 0xAA, 0xD8, 0xAE, 0xD9, 0x8A, 0x46, - 0xD8, 0xAA, 0xD9, 0x85, 0xD8, 0xAC, 0x46, 0xD8, - 0xAA, 0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD8, 0xAA, - 0xD9, 0x85, 0xD8, 0xAE, 0x46, 0xD8, 0xAA, 0xD9, - 0x85, 0xD9, 0x89, 0x46, 0xD8, 0xAA, 0xD9, 0x85, - 0xD9, 0x8A, 0x46, 0xD8, 0xAC, 0xD8, 0xAD, 0xD9, - 0x89, 0x46, 0xD8, 0xAC, 0xD8, 0xAD, 0xD9, 0x8A, - // Bytes 2380 - 23bf - 0x46, 0xD8, 0xAC, 0xD9, 0x85, 0xD8, 0xAD, 0x46, - 0xD8, 0xAC, 0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD8, - 0xAC, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD8, 0xAD, - 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD8, 0xAD, 0xD9, - 0x85, 0xD9, 0x89, 0x46, 0xD8, 0xAD, 0xD9, 0x85, - 0xD9, 0x8A, 0x46, 0xD8, 0xB3, 0xD8, 0xAC, 0xD8, - 0xAD, 0x46, 0xD8, 0xB3, 0xD8, 0xAC, 0xD9, 0x89, - 0x46, 0xD8, 0xB3, 0xD8, 0xAD, 0xD8, 0xAC, 0x46, - // Bytes 23c0 - 23ff - 0xD8, 0xB3, 0xD8, 0xAE, 0xD9, 0x89, 0x46, 0xD8, - 0xB3, 0xD8, 0xAE, 0xD9, 0x8A, 0x46, 0xD8, 0xB3, - 0xD9, 0x85, 0xD8, 0xAC, 0x46, 0xD8, 0xB3, 0xD9, - 0x85, 0xD8, 0xAD, 0x46, 0xD8, 0xB3, 0xD9, 0x85, - 0xD9, 0x85, 0x46, 0xD8, 0xB4, 0xD8, 0xAC, 0xD9, - 0x8A, 0x46, 0xD8, 0xB4, 0xD8, 0xAD, 0xD9, 0x85, - 0x46, 0xD8, 0xB4, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, - 0xD8, 0xB4, 0xD9, 0x85, 0xD8, 0xAE, 0x46, 0xD8, - // Bytes 2400 - 243f - 0xB4, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xB5, - 0xD8, 0xAD, 0xD8, 0xAD, 0x46, 0xD8, 0xB5, 0xD8, - 0xAD, 0xD9, 0x8A, 0x46, 0xD8, 0xB5, 0xD9, 0x84, - 0xD9, 0x89, 0x46, 0xD8, 0xB5, 0xD9, 0x84, 0xDB, - 0x92, 0x46, 0xD8, 0xB5, 0xD9, 0x85, 0xD9, 0x85, - 0x46, 0xD8, 0xB6, 0xD8, 0xAD, 0xD9, 0x89, 0x46, - 0xD8, 0xB6, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD8, - 0xB6, 0xD8, 0xAE, 0xD9, 0x85, 0x46, 0xD8, 0xB7, - // Bytes 2440 - 247f - 0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD8, 0xB7, 0xD9, - 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xB7, 0xD9, 0x85, - 0xD9, 0x8A, 0x46, 0xD8, 0xB9, 0xD8, 0xAC, 0xD9, - 0x85, 0x46, 0xD8, 0xB9, 0xD9, 0x85, 0xD9, 0x85, - 0x46, 0xD8, 0xB9, 0xD9, 0x85, 0xD9, 0x89, 0x46, - 0xD8, 0xB9, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD8, - 0xBA, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xBA, - 0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD8, 0xBA, 0xD9, - // Bytes 2480 - 24bf - 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x81, 0xD8, 0xAE, - 0xD9, 0x85, 0x46, 0xD9, 0x81, 0xD9, 0x85, 0xD9, - 0x8A, 0x46, 0xD9, 0x82, 0xD9, 0x84, 0xDB, 0x92, - 0x46, 0xD9, 0x82, 0xD9, 0x85, 0xD8, 0xAD, 0x46, - 0xD9, 0x82, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD9, - 0x82, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x83, - 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD9, 0x83, 0xD9, - 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x84, 0xD8, 0xAC, - // Bytes 24c0 - 24ff - 0xD8, 0xAC, 0x46, 0xD9, 0x84, 0xD8, 0xAC, 0xD9, - 0x85, 0x46, 0xD9, 0x84, 0xD8, 0xAC, 0xD9, 0x8A, - 0x46, 0xD9, 0x84, 0xD8, 0xAD, 0xD9, 0x85, 0x46, - 0xD9, 0x84, 0xD8, 0xAD, 0xD9, 0x89, 0x46, 0xD9, - 0x84, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD9, 0x84, - 0xD8, 0xAE, 0xD9, 0x85, 0x46, 0xD9, 0x84, 0xD9, - 0x85, 0xD8, 0xAD, 0x46, 0xD9, 0x84, 0xD9, 0x85, - 0xD9, 0x8A, 0x46, 0xD9, 0x85, 0xD8, 0xAC, 0xD8, - // Bytes 2500 - 253f - 0xAD, 0x46, 0xD9, 0x85, 0xD8, 0xAC, 0xD8, 0xAE, - 0x46, 0xD9, 0x85, 0xD8, 0xAC, 0xD9, 0x85, 0x46, - 0xD9, 0x85, 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD9, - 0x85, 0xD8, 0xAD, 0xD8, 0xAC, 0x46, 0xD9, 0x85, - 0xD8, 0xAD, 0xD9, 0x85, 0x46, 0xD9, 0x85, 0xD8, - 0xAD, 0xD9, 0x8A, 0x46, 0xD9, 0x85, 0xD8, 0xAE, - 0xD8, 0xAC, 0x46, 0xD9, 0x85, 0xD8, 0xAE, 0xD9, - 0x85, 0x46, 0xD9, 0x85, 0xD8, 0xAE, 0xD9, 0x8A, - // Bytes 2540 - 257f - 0x46, 0xD9, 0x85, 0xD9, 0x85, 0xD9, 0x8A, 0x46, - 0xD9, 0x86, 0xD8, 0xAC, 0xD8, 0xAD, 0x46, 0xD9, - 0x86, 0xD8, 0xAC, 0xD9, 0x85, 0x46, 0xD9, 0x86, - 0xD8, 0xAC, 0xD9, 0x89, 0x46, 0xD9, 0x86, 0xD8, - 0xAC, 0xD9, 0x8A, 0x46, 0xD9, 0x86, 0xD8, 0xAD, - 0xD9, 0x85, 0x46, 0xD9, 0x86, 0xD8, 0xAD, 0xD9, - 0x89, 0x46, 0xD9, 0x86, 0xD8, 0xAD, 0xD9, 0x8A, - 0x46, 0xD9, 0x86, 0xD9, 0x85, 0xD9, 0x89, 0x46, - // Bytes 2580 - 25bf - 0xD9, 0x86, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, - 0x87, 0xD9, 0x85, 0xD8, 0xAC, 0x46, 0xD9, 0x87, - 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD9, 0x8A, 0xD8, - 0xAC, 0xD9, 0x8A, 0x46, 0xD9, 0x8A, 0xD8, 0xAD, - 0xD9, 0x8A, 0x46, 0xD9, 0x8A, 0xD9, 0x85, 0xD9, - 0x85, 0x46, 0xD9, 0x8A, 0xD9, 0x85, 0xD9, 0x8A, - 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xA7, 0x46, - 0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xAC, 0x46, 0xD9, - // Bytes 25c0 - 25ff - 0x8A, 0xD9, 0x94, 0xD8, 0xAD, 0x46, 0xD9, 0x8A, - 0xD9, 0x94, 0xD8, 0xAE, 0x46, 0xD9, 0x8A, 0xD9, - 0x94, 0xD8, 0xB1, 0x46, 0xD9, 0x8A, 0xD9, 0x94, - 0xD8, 0xB2, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, - 0x85, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x86, - 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x87, 0x46, - 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x88, 0x46, 0xD9, - 0x8A, 0xD9, 0x94, 0xD9, 0x89, 0x46, 0xD9, 0x8A, - // Bytes 2600 - 263f - 0xD9, 0x94, 0xD9, 0x8A, 0x46, 0xD9, 0x8A, 0xD9, - 0x94, 0xDB, 0x86, 0x46, 0xD9, 0x8A, 0xD9, 0x94, - 0xDB, 0x87, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, - 0x88, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x90, - 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x95, 0x46, - 0xE0, 0xB9, 0x8D, 0xE0, 0xB8, 0xB2, 0x46, 0xE0, - 0xBA, 0xAB, 0xE0, 0xBA, 0x99, 0x46, 0xE0, 0xBA, - 0xAB, 0xE0, 0xBA, 0xA1, 0x46, 0xE0, 0xBB, 0x8D, - // Bytes 2640 - 267f - 0xE0, 0xBA, 0xB2, 0x46, 0xE0, 0xBD, 0x80, 0xE0, - 0xBE, 0xB5, 0x46, 0xE0, 0xBD, 0x82, 0xE0, 0xBE, - 0xB7, 0x46, 0xE0, 0xBD, 0x8C, 0xE0, 0xBE, 0xB7, - 0x46, 0xE0, 0xBD, 0x91, 0xE0, 0xBE, 0xB7, 0x46, - 0xE0, 0xBD, 0x96, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, - 0xBD, 0x9B, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBE, - 0x90, 0xE0, 0xBE, 0xB5, 0x46, 0xE0, 0xBE, 0x92, - 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBE, 0x9C, 0xE0, - // Bytes 2680 - 26bf - 0xBE, 0xB7, 0x46, 0xE0, 0xBE, 0xA1, 0xE0, 0xBE, - 0xB7, 0x46, 0xE0, 0xBE, 0xA6, 0xE0, 0xBE, 0xB7, - 0x46, 0xE0, 0xBE, 0xAB, 0xE0, 0xBE, 0xB7, 0x46, - 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0x46, 0xE2, - 0x80, 0xB5, 0xE2, 0x80, 0xB5, 0x46, 0xE2, 0x88, - 0xAB, 0xE2, 0x88, 0xAB, 0x46, 0xE2, 0x88, 0xAE, - 0xE2, 0x88, 0xAE, 0x46, 0xE3, 0x81, 0xBB, 0xE3, - 0x81, 0x8B, 0x46, 0xE3, 0x82, 0x88, 0xE3, 0x82, - // Bytes 26c0 - 26ff - 0x8A, 0x46, 0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xAD, - 0x46, 0xE3, 0x82, 0xB3, 0xE3, 0x82, 0xB3, 0x46, - 0xE3, 0x82, 0xB3, 0xE3, 0x83, 0x88, 0x46, 0xE3, - 0x83, 0x88, 0xE3, 0x83, 0xB3, 0x46, 0xE3, 0x83, - 0x8A, 0xE3, 0x83, 0x8E, 0x46, 0xE3, 0x83, 0x9B, - 0xE3, 0x83, 0xB3, 0x46, 0xE3, 0x83, 0x9F, 0xE3, - 0x83, 0xAA, 0x46, 0xE3, 0x83, 0xAA, 0xE3, 0x83, - 0xA9, 0x46, 0xE3, 0x83, 0xAC, 0xE3, 0x83, 0xA0, - // Bytes 2700 - 273f - 0x46, 0xE4, 0xBB, 0xA4, 0xE5, 0x92, 0x8C, 0x46, - 0xE5, 0xA4, 0xA7, 0xE6, 0xAD, 0xA3, 0x46, 0xE5, - 0xB9, 0xB3, 0xE6, 0x88, 0x90, 0x46, 0xE6, 0x98, - 0x8E, 0xE6, 0xB2, 0xBB, 0x46, 0xE6, 0x98, 0xAD, - 0xE5, 0x92, 0x8C, 0x47, 0x72, 0x61, 0x64, 0xE2, - 0x88, 0x95, 0x73, 0x47, 0xE3, 0x80, 0x94, 0x53, - 0xE3, 0x80, 0x95, 0x48, 0x28, 0xE1, 0x84, 0x80, - 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, - // Bytes 2740 - 277f - 0x82, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, - 0x84, 0x83, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, - 0xE1, 0x84, 0x85, 0xE1, 0x85, 0xA1, 0x29, 0x48, - 0x28, 0xE1, 0x84, 0x86, 0xE1, 0x85, 0xA1, 0x29, - 0x48, 0x28, 0xE1, 0x84, 0x87, 0xE1, 0x85, 0xA1, - 0x29, 0x48, 0x28, 0xE1, 0x84, 0x89, 0xE1, 0x85, - 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x8B, 0xE1, - 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x8C, - // Bytes 2780 - 27bf - 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, - 0x8C, 0xE1, 0x85, 0xAE, 0x29, 0x48, 0x28, 0xE1, - 0x84, 0x8E, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, - 0xE1, 0x84, 0x8F, 0xE1, 0x85, 0xA1, 0x29, 0x48, - 0x28, 0xE1, 0x84, 0x90, 0xE1, 0x85, 0xA1, 0x29, - 0x48, 0x28, 0xE1, 0x84, 0x91, 0xE1, 0x85, 0xA1, - 0x29, 0x48, 0x28, 0xE1, 0x84, 0x92, 0xE1, 0x85, - 0xA1, 0x29, 0x48, 0x72, 0x61, 0x64, 0xE2, 0x88, - // Bytes 27c0 - 27ff - 0x95, 0x73, 0x32, 0x48, 0xD8, 0xA7, 0xD9, 0x83, - 0xD8, 0xA8, 0xD8, 0xB1, 0x48, 0xD8, 0xA7, 0xD9, - 0x84, 0xD9, 0x84, 0xD9, 0x87, 0x48, 0xD8, 0xB1, - 0xD8, 0xB3, 0xD9, 0x88, 0xD9, 0x84, 0x48, 0xD8, - 0xB1, 0xDB, 0x8C, 0xD8, 0xA7, 0xD9, 0x84, 0x48, - 0xD8, 0xB5, 0xD9, 0x84, 0xD8, 0xB9, 0xD9, 0x85, - 0x48, 0xD8, 0xB9, 0xD9, 0x84, 0xD9, 0x8A, 0xD9, - 0x87, 0x48, 0xD9, 0x85, 0xD8, 0xAD, 0xD9, 0x85, - // Bytes 2800 - 283f - 0xD8, 0xAF, 0x48, 0xD9, 0x88, 0xD8, 0xB3, 0xD9, - 0x84, 0xD9, 0x85, 0x49, 0xE2, 0x80, 0xB2, 0xE2, - 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0x49, 0xE2, 0x80, - 0xB5, 0xE2, 0x80, 0xB5, 0xE2, 0x80, 0xB5, 0x49, - 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0xE2, 0x88, - 0xAB, 0x49, 0xE2, 0x88, 0xAE, 0xE2, 0x88, 0xAE, - 0xE2, 0x88, 0xAE, 0x49, 0xE3, 0x80, 0x94, 0xE4, - 0xB8, 0x89, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, - // Bytes 2840 - 287f - 0x94, 0xE4, 0xBA, 0x8C, 0xE3, 0x80, 0x95, 0x49, - 0xE3, 0x80, 0x94, 0xE5, 0x8B, 0x9D, 0xE3, 0x80, - 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE5, 0xAE, 0x89, - 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE6, - 0x89, 0x93, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, - 0x94, 0xE6, 0x95, 0x97, 0xE3, 0x80, 0x95, 0x49, - 0xE3, 0x80, 0x94, 0xE6, 0x9C, 0xAC, 0xE3, 0x80, - 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE7, 0x82, 0xB9, - // Bytes 2880 - 28bf - 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE7, - 0x9B, 0x97, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x82, - 0xA2, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x49, - 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xB3, 0xE3, 0x83, - 0x81, 0x49, 0xE3, 0x82, 0xA6, 0xE3, 0x82, 0xA9, - 0xE3, 0x83, 0xB3, 0x49, 0xE3, 0x82, 0xAA, 0xE3, - 0x83, 0xB3, 0xE3, 0x82, 0xB9, 0x49, 0xE3, 0x82, - 0xAA, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xA0, 0x49, - // Bytes 28c0 - 28ff - 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0xA4, 0xE3, 0x83, - 0xAA, 0x49, 0xE3, 0x82, 0xB1, 0xE3, 0x83, 0xBC, - 0xE3, 0x82, 0xB9, 0x49, 0xE3, 0x82, 0xB3, 0xE3, - 0x83, 0xAB, 0xE3, 0x83, 0x8A, 0x49, 0xE3, 0x82, - 0xBB, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x81, 0x49, - 0xE3, 0x82, 0xBB, 0xE3, 0x83, 0xB3, 0xE3, 0x83, - 0x88, 0x49, 0xE3, 0x83, 0x86, 0xE3, 0x82, 0x99, - 0xE3, 0x82, 0xB7, 0x49, 0xE3, 0x83, 0x88, 0xE3, - // Bytes 2900 - 293f - 0x82, 0x99, 0xE3, 0x83, 0xAB, 0x49, 0xE3, 0x83, - 0x8E, 0xE3, 0x83, 0x83, 0xE3, 0x83, 0x88, 0x49, - 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0xA4, 0xE3, 0x83, - 0x84, 0x49, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x99, - 0xE3, 0x83, 0xAB, 0x49, 0xE3, 0x83, 0x92, 0xE3, - 0x82, 0x9A, 0xE3, 0x82, 0xB3, 0x49, 0xE3, 0x83, - 0x95, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0xB3, 0x49, - 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x82, - // Bytes 2940 - 297f - 0xBD, 0x49, 0xE3, 0x83, 0x98, 0xE3, 0x83, 0xAB, - 0xE3, 0x83, 0x84, 0x49, 0xE3, 0x83, 0x9B, 0xE3, - 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x49, 0xE3, 0x83, - 0x9B, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xB3, 0x49, - 0xE3, 0x83, 0x9E, 0xE3, 0x82, 0xA4, 0xE3, 0x83, - 0xAB, 0x49, 0xE3, 0x83, 0x9E, 0xE3, 0x83, 0x83, - 0xE3, 0x83, 0x8F, 0x49, 0xE3, 0x83, 0x9E, 0xE3, - 0x83, 0xAB, 0xE3, 0x82, 0xAF, 0x49, 0xE3, 0x83, - // Bytes 2980 - 29bf - 0xA4, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x49, - 0xE3, 0x83, 0xA6, 0xE3, 0x82, 0xA2, 0xE3, 0x83, - 0xB3, 0x49, 0xE3, 0x83, 0xAF, 0xE3, 0x83, 0x83, - 0xE3, 0x83, 0x88, 0x4C, 0xE2, 0x80, 0xB2, 0xE2, - 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, - 0x4C, 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0xE2, - 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0x4C, 0xE3, 0x82, - 0xA2, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x95, 0xE3, - // Bytes 29c0 - 29ff - 0x82, 0xA1, 0x4C, 0xE3, 0x82, 0xA8, 0xE3, 0x83, - 0xBC, 0xE3, 0x82, 0xAB, 0xE3, 0x83, 0xBC, 0x4C, - 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0xE3, 0x83, - 0xAD, 0xE3, 0x83, 0xB3, 0x4C, 0xE3, 0x82, 0xAB, - 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xB3, 0xE3, 0x83, - 0x9E, 0x4C, 0xE3, 0x82, 0xAB, 0xE3, 0x83, 0xA9, - 0xE3, 0x83, 0x83, 0xE3, 0x83, 0x88, 0x4C, 0xE3, - 0x82, 0xAB, 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xAA, - // Bytes 2a00 - 2a3f - 0xE3, 0x83, 0xBC, 0x4C, 0xE3, 0x82, 0xAD, 0xE3, - 0x82, 0x99, 0xE3, 0x83, 0x8B, 0xE3, 0x83, 0xBC, - 0x4C, 0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xA5, 0xE3, - 0x83, 0xAA, 0xE3, 0x83, 0xBC, 0x4C, 0xE3, 0x82, - 0xAF, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xA9, 0xE3, - 0x83, 0xA0, 0x4C, 0xE3, 0x82, 0xAF, 0xE3, 0x83, - 0xAD, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x8D, 0x4C, - 0xE3, 0x82, 0xB5, 0xE3, 0x82, 0xA4, 0xE3, 0x82, - // Bytes 2a40 - 2a7f - 0xAF, 0xE3, 0x83, 0xAB, 0x4C, 0xE3, 0x82, 0xBF, - 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0xE3, 0x82, - 0xB9, 0x4C, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x9A, - 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x84, 0x4C, 0xE3, - 0x83, 0x92, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xAF, - 0xE3, 0x83, 0xAB, 0x4C, 0xE3, 0x83, 0x95, 0xE3, - 0x82, 0xA3, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, - 0x4C, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x99, 0xE3, - // Bytes 2a80 - 2abf - 0x83, 0xBC, 0xE3, 0x82, 0xBF, 0x4C, 0xE3, 0x83, - 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0x8B, 0xE3, - 0x83, 0x92, 0x4C, 0xE3, 0x83, 0x98, 0xE3, 0x82, - 0x9A, 0xE3, 0x83, 0xB3, 0xE3, 0x82, 0xB9, 0x4C, - 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x99, 0xE3, 0x83, - 0xAB, 0xE3, 0x83, 0x88, 0x4C, 0xE3, 0x83, 0x9E, - 0xE3, 0x82, 0xA4, 0xE3, 0x82, 0xAF, 0xE3, 0x83, - 0xAD, 0x4C, 0xE3, 0x83, 0x9F, 0xE3, 0x82, 0xAF, - // Bytes 2ac0 - 2aff - 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xB3, 0x4C, 0xE3, - 0x83, 0xA1, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, - 0xE3, 0x83, 0xAB, 0x4C, 0xE3, 0x83, 0xAA, 0xE3, - 0x83, 0x83, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xAB, - 0x4C, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x92, 0xE3, - 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0x4C, 0xE6, 0xA0, - 0xAA, 0xE5, 0xBC, 0x8F, 0xE4, 0xBC, 0x9A, 0xE7, - 0xA4, 0xBE, 0x4E, 0x28, 0xE1, 0x84, 0x8B, 0xE1, - // Bytes 2b00 - 2b3f - 0x85, 0xA9, 0xE1, 0x84, 0x92, 0xE1, 0x85, 0xAE, - 0x29, 0x4F, 0xD8, 0xAC, 0xD9, 0x84, 0x20, 0xD8, - 0xAC, 0xD9, 0x84, 0xD8, 0xA7, 0xD9, 0x84, 0xD9, - 0x87, 0x4F, 0xE3, 0x82, 0xA2, 0xE3, 0x83, 0x8F, - 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0xE3, 0x83, - 0x88, 0x4F, 0xE3, 0x82, 0xA2, 0xE3, 0x83, 0xB3, - 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x82, - 0xA2, 0x4F, 0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xAD, - // Bytes 2b40 - 2b7f - 0xE3, 0x83, 0xAF, 0xE3, 0x83, 0x83, 0xE3, 0x83, - 0x88, 0x4F, 0xE3, 0x82, 0xB5, 0xE3, 0x83, 0xB3, - 0xE3, 0x83, 0x81, 0xE3, 0x83, 0xBC, 0xE3, 0x83, - 0xA0, 0x4F, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x99, - 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAC, 0xE3, 0x83, - 0xAB, 0x4F, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0xAF, - 0xE3, 0x82, 0xBF, 0xE3, 0x83, 0xBC, 0xE3, 0x83, - 0xAB, 0x4F, 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x9A, - // Bytes 2b80 - 2bbf - 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xB3, 0xE3, 0x83, - 0x88, 0x4F, 0xE3, 0x83, 0x9E, 0xE3, 0x83, 0xB3, - 0xE3, 0x82, 0xB7, 0xE3, 0x83, 0xA7, 0xE3, 0x83, - 0xB3, 0x4F, 0xE3, 0x83, 0xA1, 0xE3, 0x82, 0xAB, - 0xE3, 0x82, 0x99, 0xE3, 0x83, 0x88, 0xE3, 0x83, - 0xB3, 0x4F, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0xBC, - 0xE3, 0x83, 0x95, 0xE3, 0x82, 0x99, 0xE3, 0x83, - 0xAB, 0x51, 0x28, 0xE1, 0x84, 0x8B, 0xE1, 0x85, - // Bytes 2bc0 - 2bff - 0xA9, 0xE1, 0x84, 0x8C, 0xE1, 0x85, 0xA5, 0xE1, - 0x86, 0xAB, 0x29, 0x52, 0xE3, 0x82, 0xAD, 0xE3, - 0x82, 0x99, 0xE3, 0x83, 0xAB, 0xE3, 0x82, 0xBF, - 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0x52, 0xE3, - 0x82, 0xAD, 0xE3, 0x83, 0xAD, 0xE3, 0x82, 0xAF, - 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xA9, 0xE3, 0x83, - 0xA0, 0x52, 0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xAD, - 0xE3, 0x83, 0xA1, 0xE3, 0x83, 0xBC, 0xE3, 0x83, - // Bytes 2c00 - 2c3f - 0x88, 0xE3, 0x83, 0xAB, 0x52, 0xE3, 0x82, 0xAF, - 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xA9, 0xE3, 0x83, - 0xA0, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xB3, 0x52, - 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAB, 0xE3, 0x82, - 0xBB, 0xE3, 0x82, 0x99, 0xE3, 0x82, 0xA4, 0xE3, - 0x83, 0xAD, 0x52, 0xE3, 0x83, 0x8F, 0xE3, 0x82, - 0x9A, 0xE3, 0x83, 0xBC, 0xE3, 0x82, 0xBB, 0xE3, - 0x83, 0xB3, 0xE3, 0x83, 0x88, 0x52, 0xE3, 0x83, - // Bytes 2c40 - 2c7f - 0x92, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xA2, 0xE3, - 0x82, 0xB9, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xAB, - 0x52, 0xE3, 0x83, 0x95, 0xE3, 0x82, 0x99, 0xE3, - 0x83, 0x83, 0xE3, 0x82, 0xB7, 0xE3, 0x82, 0xA7, - 0xE3, 0x83, 0xAB, 0x52, 0xE3, 0x83, 0x9F, 0xE3, - 0x83, 0xAA, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x99, - 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x52, 0xE3, - 0x83, 0xAC, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x88, - // Bytes 2c80 - 2cbf - 0xE3, 0x82, 0xB1, 0xE3, 0x82, 0x99, 0xE3, 0x83, - 0xB3, 0x61, 0xD8, 0xB5, 0xD9, 0x84, 0xD9, 0x89, - 0x20, 0xD8, 0xA7, 0xD9, 0x84, 0xD9, 0x84, 0xD9, - 0x87, 0x20, 0xD8, 0xB9, 0xD9, 0x84, 0xD9, 0x8A, - 0xD9, 0x87, 0x20, 0xD9, 0x88, 0xD8, 0xB3, 0xD9, - 0x84, 0xD9, 0x85, 0x06, 0xE0, 0xA7, 0x87, 0xE0, - 0xA6, 0xBE, 0x01, 0x06, 0xE0, 0xA7, 0x87, 0xE0, - 0xA7, 0x97, 0x01, 0x06, 0xE0, 0xAD, 0x87, 0xE0, - // Bytes 2cc0 - 2cff - 0xAC, 0xBE, 0x01, 0x06, 0xE0, 0xAD, 0x87, 0xE0, - 0xAD, 0x96, 0x01, 0x06, 0xE0, 0xAD, 0x87, 0xE0, - 0xAD, 0x97, 0x01, 0x06, 0xE0, 0xAE, 0x92, 0xE0, - 0xAF, 0x97, 0x01, 0x06, 0xE0, 0xAF, 0x86, 0xE0, - 0xAE, 0xBE, 0x01, 0x06, 0xE0, 0xAF, 0x86, 0xE0, - 0xAF, 0x97, 0x01, 0x06, 0xE0, 0xAF, 0x87, 0xE0, - 0xAE, 0xBE, 0x01, 0x06, 0xE0, 0xB2, 0xBF, 0xE0, - 0xB3, 0x95, 0x01, 0x06, 0xE0, 0xB3, 0x86, 0xE0, - // Bytes 2d00 - 2d3f - 0xB3, 0x95, 0x01, 0x06, 0xE0, 0xB3, 0x86, 0xE0, - 0xB3, 0x96, 0x01, 0x06, 0xE0, 0xB5, 0x86, 0xE0, - 0xB4, 0xBE, 0x01, 0x06, 0xE0, 0xB5, 0x86, 0xE0, - 0xB5, 0x97, 0x01, 0x06, 0xE0, 0xB5, 0x87, 0xE0, - 0xB4, 0xBE, 0x01, 0x06, 0xE0, 0xB7, 0x99, 0xE0, - 0xB7, 0x9F, 0x01, 0x06, 0xE1, 0x80, 0xA5, 0xE1, - 0x80, 0xAE, 0x01, 0x06, 0xE1, 0xAC, 0x85, 0xE1, - 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x87, 0xE1, - // Bytes 2d40 - 2d7f - 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x89, 0xE1, - 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x8B, 0xE1, - 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x8D, 0xE1, - 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0x91, 0xE1, - 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0xBA, 0xE1, - 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0xBC, 0xE1, - 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0xBE, 0xE1, - 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAC, 0xBF, 0xE1, - // Bytes 2d80 - 2dbf - 0xAC, 0xB5, 0x01, 0x06, 0xE1, 0xAD, 0x82, 0xE1, - 0xAC, 0xB5, 0x01, 0x08, 0xF0, 0x91, 0x84, 0xB1, - 0xF0, 0x91, 0x84, 0xA7, 0x01, 0x08, 0xF0, 0x91, - 0x84, 0xB2, 0xF0, 0x91, 0x84, 0xA7, 0x01, 0x08, - 0xF0, 0x91, 0x8D, 0x87, 0xF0, 0x91, 0x8C, 0xBE, - 0x01, 0x08, 0xF0, 0x91, 0x8D, 0x87, 0xF0, 0x91, - 0x8D, 0x97, 0x01, 0x08, 0xF0, 0x91, 0x92, 0xB9, - 0xF0, 0x91, 0x92, 0xB0, 0x01, 0x08, 0xF0, 0x91, - // Bytes 2dc0 - 2dff - 0x92, 0xB9, 0xF0, 0x91, 0x92, 0xBA, 0x01, 0x08, - 0xF0, 0x91, 0x92, 0xB9, 0xF0, 0x91, 0x92, 0xBD, - 0x01, 0x08, 0xF0, 0x91, 0x96, 0xB8, 0xF0, 0x91, - 0x96, 0xAF, 0x01, 0x08, 0xF0, 0x91, 0x96, 0xB9, - 0xF0, 0x91, 0x96, 0xAF, 0x01, 0x08, 0xF0, 0x91, - 0xA4, 0xB5, 0xF0, 0x91, 0xA4, 0xB0, 0x01, 0x09, - 0xE0, 0xB3, 0x86, 0xE0, 0xB3, 0x82, 0xE0, 0xB3, - 0x95, 0x02, 0x09, 0xE0, 0xB7, 0x99, 0xE0, 0xB7, - // Bytes 2e00 - 2e3f - 0x8F, 0xE0, 0xB7, 0x8A, 0x16, 0x44, 0x44, 0x5A, - 0xCC, 0x8C, 0xCD, 0x44, 0x44, 0x7A, 0xCC, 0x8C, - 0xCD, 0x44, 0x64, 0x7A, 0xCC, 0x8C, 0xCD, 0x46, - 0xD9, 0x84, 0xD8, 0xA7, 0xD9, 0x93, 0xCD, 0x46, - 0xD9, 0x84, 0xD8, 0xA7, 0xD9, 0x94, 0xCD, 0x46, - 0xD9, 0x84, 0xD8, 0xA7, 0xD9, 0x95, 0xB9, 0x46, - 0xE1, 0x84, 0x80, 0xE1, 0x85, 0xA1, 0x01, 0x46, - 0xE1, 0x84, 0x82, 0xE1, 0x85, 0xA1, 0x01, 0x46, - // Bytes 2e40 - 2e7f - 0xE1, 0x84, 0x83, 0xE1, 0x85, 0xA1, 0x01, 0x46, - 0xE1, 0x84, 0x85, 0xE1, 0x85, 0xA1, 0x01, 0x46, - 0xE1, 0x84, 0x86, 0xE1, 0x85, 0xA1, 0x01, 0x46, - 0xE1, 0x84, 0x87, 0xE1, 0x85, 0xA1, 0x01, 0x46, - 0xE1, 0x84, 0x89, 0xE1, 0x85, 0xA1, 0x01, 0x46, - 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xA1, 0x01, 0x46, - 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xAE, 0x01, 0x46, - 0xE1, 0x84, 0x8C, 0xE1, 0x85, 0xA1, 0x01, 0x46, - // Bytes 2e80 - 2ebf - 0xE1, 0x84, 0x8E, 0xE1, 0x85, 0xA1, 0x01, 0x46, - 0xE1, 0x84, 0x8F, 0xE1, 0x85, 0xA1, 0x01, 0x46, - 0xE1, 0x84, 0x90, 0xE1, 0x85, 0xA1, 0x01, 0x46, - 0xE1, 0x84, 0x91, 0xE1, 0x85, 0xA1, 0x01, 0x46, - 0xE1, 0x84, 0x92, 0xE1, 0x85, 0xA1, 0x01, 0x49, - 0xE3, 0x83, 0xA1, 0xE3, 0x82, 0xAB, 0xE3, 0x82, - 0x99, 0x11, 0x4C, 0xE1, 0x84, 0x8C, 0xE1, 0x85, - 0xAE, 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xB4, 0x01, - // Bytes 2ec0 - 2eff - 0x4C, 0xE3, 0x82, 0xAD, 0xE3, 0x82, 0x99, 0xE3, - 0x82, 0xAB, 0xE3, 0x82, 0x99, 0x11, 0x4C, 0xE3, - 0x82, 0xB3, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x9B, - 0xE3, 0x82, 0x9A, 0x11, 0x4C, 0xE3, 0x83, 0xA4, - 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0xE3, 0x82, - 0x99, 0x11, 0x4F, 0xE1, 0x84, 0x8E, 0xE1, 0x85, - 0xA1, 0xE1, 0x86, 0xB7, 0xE1, 0x84, 0x80, 0xE1, - 0x85, 0xA9, 0x01, 0x4F, 0xE3, 0x82, 0xA4, 0xE3, - // Bytes 2f00 - 2f3f - 0x83, 0x8B, 0xE3, 0x83, 0xB3, 0xE3, 0x82, 0xAF, - 0xE3, 0x82, 0x99, 0x11, 0x4F, 0xE3, 0x82, 0xB7, - 0xE3, 0x83, 0xAA, 0xE3, 0x83, 0xB3, 0xE3, 0x82, - 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x4F, 0xE3, 0x83, - 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0xE3, - 0x82, 0xB7, 0xE3, 0x82, 0x99, 0x11, 0x4F, 0xE3, - 0x83, 0x9B, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xB3, - 0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0x11, 0x52, - // Bytes 2f40 - 2f7f - 0xE3, 0x82, 0xA8, 0xE3, 0x82, 0xB9, 0xE3, 0x82, - 0xAF, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0xE3, - 0x82, 0x99, 0x11, 0x52, 0xE3, 0x83, 0x95, 0xE3, - 0x82, 0xA1, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0x83, - 0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0x11, 0x86, - 0xE0, 0xB3, 0x86, 0xE0, 0xB3, 0x82, 0x01, 0x86, - 0xE0, 0xB7, 0x99, 0xE0, 0xB7, 0x8F, 0x01, 0x03, - 0x3C, 0xCC, 0xB8, 0x05, 0x03, 0x3D, 0xCC, 0xB8, - // Bytes 2f80 - 2fbf - 0x05, 0x03, 0x3E, 0xCC, 0xB8, 0x05, 0x03, 0x41, - 0xCC, 0x80, 0xCD, 0x03, 0x41, 0xCC, 0x81, 0xCD, - 0x03, 0x41, 0xCC, 0x83, 0xCD, 0x03, 0x41, 0xCC, - 0x84, 0xCD, 0x03, 0x41, 0xCC, 0x89, 0xCD, 0x03, - 0x41, 0xCC, 0x8C, 0xCD, 0x03, 0x41, 0xCC, 0x8F, - 0xCD, 0x03, 0x41, 0xCC, 0x91, 0xCD, 0x03, 0x41, - 0xCC, 0xA5, 0xB9, 0x03, 0x41, 0xCC, 0xA8, 0xA9, - 0x03, 0x42, 0xCC, 0x87, 0xCD, 0x03, 0x42, 0xCC, - // Bytes 2fc0 - 2fff - 0xA3, 0xB9, 0x03, 0x42, 0xCC, 0xB1, 0xB9, 0x03, - 0x43, 0xCC, 0x81, 0xCD, 0x03, 0x43, 0xCC, 0x82, - 0xCD, 0x03, 0x43, 0xCC, 0x87, 0xCD, 0x03, 0x43, - 0xCC, 0x8C, 0xCD, 0x03, 0x44, 0xCC, 0x87, 0xCD, - 0x03, 0x44, 0xCC, 0x8C, 0xCD, 0x03, 0x44, 0xCC, - 0xA3, 0xB9, 0x03, 0x44, 0xCC, 0xA7, 0xA9, 0x03, - 0x44, 0xCC, 0xAD, 0xB9, 0x03, 0x44, 0xCC, 0xB1, - 0xB9, 0x03, 0x45, 0xCC, 0x80, 0xCD, 0x03, 0x45, - // Bytes 3000 - 303f - 0xCC, 0x81, 0xCD, 0x03, 0x45, 0xCC, 0x83, 0xCD, - 0x03, 0x45, 0xCC, 0x86, 0xCD, 0x03, 0x45, 0xCC, - 0x87, 0xCD, 0x03, 0x45, 0xCC, 0x88, 0xCD, 0x03, - 0x45, 0xCC, 0x89, 0xCD, 0x03, 0x45, 0xCC, 0x8C, - 0xCD, 0x03, 0x45, 0xCC, 0x8F, 0xCD, 0x03, 0x45, - 0xCC, 0x91, 0xCD, 0x03, 0x45, 0xCC, 0xA8, 0xA9, - 0x03, 0x45, 0xCC, 0xAD, 0xB9, 0x03, 0x45, 0xCC, - 0xB0, 0xB9, 0x03, 0x46, 0xCC, 0x87, 0xCD, 0x03, - // Bytes 3040 - 307f - 0x47, 0xCC, 0x81, 0xCD, 0x03, 0x47, 0xCC, 0x82, - 0xCD, 0x03, 0x47, 0xCC, 0x84, 0xCD, 0x03, 0x47, - 0xCC, 0x86, 0xCD, 0x03, 0x47, 0xCC, 0x87, 0xCD, - 0x03, 0x47, 0xCC, 0x8C, 0xCD, 0x03, 0x47, 0xCC, - 0xA7, 0xA9, 0x03, 0x48, 0xCC, 0x82, 0xCD, 0x03, - 0x48, 0xCC, 0x87, 0xCD, 0x03, 0x48, 0xCC, 0x88, - 0xCD, 0x03, 0x48, 0xCC, 0x8C, 0xCD, 0x03, 0x48, - 0xCC, 0xA3, 0xB9, 0x03, 0x48, 0xCC, 0xA7, 0xA9, - // Bytes 3080 - 30bf - 0x03, 0x48, 0xCC, 0xAE, 0xB9, 0x03, 0x49, 0xCC, - 0x80, 0xCD, 0x03, 0x49, 0xCC, 0x81, 0xCD, 0x03, - 0x49, 0xCC, 0x82, 0xCD, 0x03, 0x49, 0xCC, 0x83, - 0xCD, 0x03, 0x49, 0xCC, 0x84, 0xCD, 0x03, 0x49, - 0xCC, 0x86, 0xCD, 0x03, 0x49, 0xCC, 0x87, 0xCD, - 0x03, 0x49, 0xCC, 0x89, 0xCD, 0x03, 0x49, 0xCC, - 0x8C, 0xCD, 0x03, 0x49, 0xCC, 0x8F, 0xCD, 0x03, - 0x49, 0xCC, 0x91, 0xCD, 0x03, 0x49, 0xCC, 0xA3, - // Bytes 30c0 - 30ff - 0xB9, 0x03, 0x49, 0xCC, 0xA8, 0xA9, 0x03, 0x49, - 0xCC, 0xB0, 0xB9, 0x03, 0x4A, 0xCC, 0x82, 0xCD, - 0x03, 0x4B, 0xCC, 0x81, 0xCD, 0x03, 0x4B, 0xCC, - 0x8C, 0xCD, 0x03, 0x4B, 0xCC, 0xA3, 0xB9, 0x03, - 0x4B, 0xCC, 0xA7, 0xA9, 0x03, 0x4B, 0xCC, 0xB1, - 0xB9, 0x03, 0x4C, 0xCC, 0x81, 0xCD, 0x03, 0x4C, - 0xCC, 0x8C, 0xCD, 0x03, 0x4C, 0xCC, 0xA7, 0xA9, - 0x03, 0x4C, 0xCC, 0xAD, 0xB9, 0x03, 0x4C, 0xCC, - // Bytes 3100 - 313f - 0xB1, 0xB9, 0x03, 0x4D, 0xCC, 0x81, 0xCD, 0x03, - 0x4D, 0xCC, 0x87, 0xCD, 0x03, 0x4D, 0xCC, 0xA3, - 0xB9, 0x03, 0x4E, 0xCC, 0x80, 0xCD, 0x03, 0x4E, - 0xCC, 0x81, 0xCD, 0x03, 0x4E, 0xCC, 0x83, 0xCD, - 0x03, 0x4E, 0xCC, 0x87, 0xCD, 0x03, 0x4E, 0xCC, - 0x8C, 0xCD, 0x03, 0x4E, 0xCC, 0xA3, 0xB9, 0x03, - 0x4E, 0xCC, 0xA7, 0xA9, 0x03, 0x4E, 0xCC, 0xAD, - 0xB9, 0x03, 0x4E, 0xCC, 0xB1, 0xB9, 0x03, 0x4F, - // Bytes 3140 - 317f - 0xCC, 0x80, 0xCD, 0x03, 0x4F, 0xCC, 0x81, 0xCD, - 0x03, 0x4F, 0xCC, 0x86, 0xCD, 0x03, 0x4F, 0xCC, - 0x89, 0xCD, 0x03, 0x4F, 0xCC, 0x8B, 0xCD, 0x03, - 0x4F, 0xCC, 0x8C, 0xCD, 0x03, 0x4F, 0xCC, 0x8F, - 0xCD, 0x03, 0x4F, 0xCC, 0x91, 0xCD, 0x03, 0x50, - 0xCC, 0x81, 0xCD, 0x03, 0x50, 0xCC, 0x87, 0xCD, - 0x03, 0x52, 0xCC, 0x81, 0xCD, 0x03, 0x52, 0xCC, - 0x87, 0xCD, 0x03, 0x52, 0xCC, 0x8C, 0xCD, 0x03, - // Bytes 3180 - 31bf - 0x52, 0xCC, 0x8F, 0xCD, 0x03, 0x52, 0xCC, 0x91, - 0xCD, 0x03, 0x52, 0xCC, 0xA7, 0xA9, 0x03, 0x52, - 0xCC, 0xB1, 0xB9, 0x03, 0x53, 0xCC, 0x82, 0xCD, - 0x03, 0x53, 0xCC, 0x87, 0xCD, 0x03, 0x53, 0xCC, - 0xA6, 0xB9, 0x03, 0x53, 0xCC, 0xA7, 0xA9, 0x03, - 0x54, 0xCC, 0x87, 0xCD, 0x03, 0x54, 0xCC, 0x8C, - 0xCD, 0x03, 0x54, 0xCC, 0xA3, 0xB9, 0x03, 0x54, - 0xCC, 0xA6, 0xB9, 0x03, 0x54, 0xCC, 0xA7, 0xA9, - // Bytes 31c0 - 31ff - 0x03, 0x54, 0xCC, 0xAD, 0xB9, 0x03, 0x54, 0xCC, - 0xB1, 0xB9, 0x03, 0x55, 0xCC, 0x80, 0xCD, 0x03, - 0x55, 0xCC, 0x81, 0xCD, 0x03, 0x55, 0xCC, 0x82, - 0xCD, 0x03, 0x55, 0xCC, 0x86, 0xCD, 0x03, 0x55, - 0xCC, 0x89, 0xCD, 0x03, 0x55, 0xCC, 0x8A, 0xCD, - 0x03, 0x55, 0xCC, 0x8B, 0xCD, 0x03, 0x55, 0xCC, - 0x8C, 0xCD, 0x03, 0x55, 0xCC, 0x8F, 0xCD, 0x03, - 0x55, 0xCC, 0x91, 0xCD, 0x03, 0x55, 0xCC, 0xA3, - // Bytes 3200 - 323f - 0xB9, 0x03, 0x55, 0xCC, 0xA4, 0xB9, 0x03, 0x55, - 0xCC, 0xA8, 0xA9, 0x03, 0x55, 0xCC, 0xAD, 0xB9, - 0x03, 0x55, 0xCC, 0xB0, 0xB9, 0x03, 0x56, 0xCC, - 0x83, 0xCD, 0x03, 0x56, 0xCC, 0xA3, 0xB9, 0x03, - 0x57, 0xCC, 0x80, 0xCD, 0x03, 0x57, 0xCC, 0x81, - 0xCD, 0x03, 0x57, 0xCC, 0x82, 0xCD, 0x03, 0x57, - 0xCC, 0x87, 0xCD, 0x03, 0x57, 0xCC, 0x88, 0xCD, - 0x03, 0x57, 0xCC, 0xA3, 0xB9, 0x03, 0x58, 0xCC, - // Bytes 3240 - 327f - 0x87, 0xCD, 0x03, 0x58, 0xCC, 0x88, 0xCD, 0x03, - 0x59, 0xCC, 0x80, 0xCD, 0x03, 0x59, 0xCC, 0x81, - 0xCD, 0x03, 0x59, 0xCC, 0x82, 0xCD, 0x03, 0x59, - 0xCC, 0x83, 0xCD, 0x03, 0x59, 0xCC, 0x84, 0xCD, - 0x03, 0x59, 0xCC, 0x87, 0xCD, 0x03, 0x59, 0xCC, - 0x88, 0xCD, 0x03, 0x59, 0xCC, 0x89, 0xCD, 0x03, - 0x59, 0xCC, 0xA3, 0xB9, 0x03, 0x5A, 0xCC, 0x81, - 0xCD, 0x03, 0x5A, 0xCC, 0x82, 0xCD, 0x03, 0x5A, - // Bytes 3280 - 32bf - 0xCC, 0x87, 0xCD, 0x03, 0x5A, 0xCC, 0x8C, 0xCD, - 0x03, 0x5A, 0xCC, 0xA3, 0xB9, 0x03, 0x5A, 0xCC, - 0xB1, 0xB9, 0x03, 0x61, 0xCC, 0x80, 0xCD, 0x03, - 0x61, 0xCC, 0x81, 0xCD, 0x03, 0x61, 0xCC, 0x83, - 0xCD, 0x03, 0x61, 0xCC, 0x84, 0xCD, 0x03, 0x61, - 0xCC, 0x89, 0xCD, 0x03, 0x61, 0xCC, 0x8C, 0xCD, - 0x03, 0x61, 0xCC, 0x8F, 0xCD, 0x03, 0x61, 0xCC, - 0x91, 0xCD, 0x03, 0x61, 0xCC, 0xA5, 0xB9, 0x03, - // Bytes 32c0 - 32ff - 0x61, 0xCC, 0xA8, 0xA9, 0x03, 0x62, 0xCC, 0x87, - 0xCD, 0x03, 0x62, 0xCC, 0xA3, 0xB9, 0x03, 0x62, - 0xCC, 0xB1, 0xB9, 0x03, 0x63, 0xCC, 0x81, 0xCD, - 0x03, 0x63, 0xCC, 0x82, 0xCD, 0x03, 0x63, 0xCC, - 0x87, 0xCD, 0x03, 0x63, 0xCC, 0x8C, 0xCD, 0x03, - 0x64, 0xCC, 0x87, 0xCD, 0x03, 0x64, 0xCC, 0x8C, - 0xCD, 0x03, 0x64, 0xCC, 0xA3, 0xB9, 0x03, 0x64, - 0xCC, 0xA7, 0xA9, 0x03, 0x64, 0xCC, 0xAD, 0xB9, - // Bytes 3300 - 333f - 0x03, 0x64, 0xCC, 0xB1, 0xB9, 0x03, 0x65, 0xCC, - 0x80, 0xCD, 0x03, 0x65, 0xCC, 0x81, 0xCD, 0x03, - 0x65, 0xCC, 0x83, 0xCD, 0x03, 0x65, 0xCC, 0x86, - 0xCD, 0x03, 0x65, 0xCC, 0x87, 0xCD, 0x03, 0x65, - 0xCC, 0x88, 0xCD, 0x03, 0x65, 0xCC, 0x89, 0xCD, - 0x03, 0x65, 0xCC, 0x8C, 0xCD, 0x03, 0x65, 0xCC, - 0x8F, 0xCD, 0x03, 0x65, 0xCC, 0x91, 0xCD, 0x03, - 0x65, 0xCC, 0xA8, 0xA9, 0x03, 0x65, 0xCC, 0xAD, - // Bytes 3340 - 337f - 0xB9, 0x03, 0x65, 0xCC, 0xB0, 0xB9, 0x03, 0x66, - 0xCC, 0x87, 0xCD, 0x03, 0x67, 0xCC, 0x81, 0xCD, - 0x03, 0x67, 0xCC, 0x82, 0xCD, 0x03, 0x67, 0xCC, - 0x84, 0xCD, 0x03, 0x67, 0xCC, 0x86, 0xCD, 0x03, - 0x67, 0xCC, 0x87, 0xCD, 0x03, 0x67, 0xCC, 0x8C, - 0xCD, 0x03, 0x67, 0xCC, 0xA7, 0xA9, 0x03, 0x68, - 0xCC, 0x82, 0xCD, 0x03, 0x68, 0xCC, 0x87, 0xCD, - 0x03, 0x68, 0xCC, 0x88, 0xCD, 0x03, 0x68, 0xCC, - // Bytes 3380 - 33bf - 0x8C, 0xCD, 0x03, 0x68, 0xCC, 0xA3, 0xB9, 0x03, - 0x68, 0xCC, 0xA7, 0xA9, 0x03, 0x68, 0xCC, 0xAE, - 0xB9, 0x03, 0x68, 0xCC, 0xB1, 0xB9, 0x03, 0x69, - 0xCC, 0x80, 0xCD, 0x03, 0x69, 0xCC, 0x81, 0xCD, - 0x03, 0x69, 0xCC, 0x82, 0xCD, 0x03, 0x69, 0xCC, - 0x83, 0xCD, 0x03, 0x69, 0xCC, 0x84, 0xCD, 0x03, - 0x69, 0xCC, 0x86, 0xCD, 0x03, 0x69, 0xCC, 0x89, - 0xCD, 0x03, 0x69, 0xCC, 0x8C, 0xCD, 0x03, 0x69, - // Bytes 33c0 - 33ff - 0xCC, 0x8F, 0xCD, 0x03, 0x69, 0xCC, 0x91, 0xCD, - 0x03, 0x69, 0xCC, 0xA3, 0xB9, 0x03, 0x69, 0xCC, - 0xA8, 0xA9, 0x03, 0x69, 0xCC, 0xB0, 0xB9, 0x03, - 0x6A, 0xCC, 0x82, 0xCD, 0x03, 0x6A, 0xCC, 0x8C, - 0xCD, 0x03, 0x6B, 0xCC, 0x81, 0xCD, 0x03, 0x6B, - 0xCC, 0x8C, 0xCD, 0x03, 0x6B, 0xCC, 0xA3, 0xB9, - 0x03, 0x6B, 0xCC, 0xA7, 0xA9, 0x03, 0x6B, 0xCC, - 0xB1, 0xB9, 0x03, 0x6C, 0xCC, 0x81, 0xCD, 0x03, - // Bytes 3400 - 343f - 0x6C, 0xCC, 0x8C, 0xCD, 0x03, 0x6C, 0xCC, 0xA7, - 0xA9, 0x03, 0x6C, 0xCC, 0xAD, 0xB9, 0x03, 0x6C, - 0xCC, 0xB1, 0xB9, 0x03, 0x6D, 0xCC, 0x81, 0xCD, - 0x03, 0x6D, 0xCC, 0x87, 0xCD, 0x03, 0x6D, 0xCC, - 0xA3, 0xB9, 0x03, 0x6E, 0xCC, 0x80, 0xCD, 0x03, - 0x6E, 0xCC, 0x81, 0xCD, 0x03, 0x6E, 0xCC, 0x83, - 0xCD, 0x03, 0x6E, 0xCC, 0x87, 0xCD, 0x03, 0x6E, - 0xCC, 0x8C, 0xCD, 0x03, 0x6E, 0xCC, 0xA3, 0xB9, - // Bytes 3440 - 347f - 0x03, 0x6E, 0xCC, 0xA7, 0xA9, 0x03, 0x6E, 0xCC, - 0xAD, 0xB9, 0x03, 0x6E, 0xCC, 0xB1, 0xB9, 0x03, - 0x6F, 0xCC, 0x80, 0xCD, 0x03, 0x6F, 0xCC, 0x81, - 0xCD, 0x03, 0x6F, 0xCC, 0x86, 0xCD, 0x03, 0x6F, - 0xCC, 0x89, 0xCD, 0x03, 0x6F, 0xCC, 0x8B, 0xCD, - 0x03, 0x6F, 0xCC, 0x8C, 0xCD, 0x03, 0x6F, 0xCC, - 0x8F, 0xCD, 0x03, 0x6F, 0xCC, 0x91, 0xCD, 0x03, - 0x70, 0xCC, 0x81, 0xCD, 0x03, 0x70, 0xCC, 0x87, - // Bytes 3480 - 34bf - 0xCD, 0x03, 0x72, 0xCC, 0x81, 0xCD, 0x03, 0x72, - 0xCC, 0x87, 0xCD, 0x03, 0x72, 0xCC, 0x8C, 0xCD, - 0x03, 0x72, 0xCC, 0x8F, 0xCD, 0x03, 0x72, 0xCC, - 0x91, 0xCD, 0x03, 0x72, 0xCC, 0xA7, 0xA9, 0x03, - 0x72, 0xCC, 0xB1, 0xB9, 0x03, 0x73, 0xCC, 0x82, - 0xCD, 0x03, 0x73, 0xCC, 0x87, 0xCD, 0x03, 0x73, - 0xCC, 0xA6, 0xB9, 0x03, 0x73, 0xCC, 0xA7, 0xA9, - 0x03, 0x74, 0xCC, 0x87, 0xCD, 0x03, 0x74, 0xCC, - // Bytes 34c0 - 34ff - 0x88, 0xCD, 0x03, 0x74, 0xCC, 0x8C, 0xCD, 0x03, - 0x74, 0xCC, 0xA3, 0xB9, 0x03, 0x74, 0xCC, 0xA6, - 0xB9, 0x03, 0x74, 0xCC, 0xA7, 0xA9, 0x03, 0x74, - 0xCC, 0xAD, 0xB9, 0x03, 0x74, 0xCC, 0xB1, 0xB9, - 0x03, 0x75, 0xCC, 0x80, 0xCD, 0x03, 0x75, 0xCC, - 0x81, 0xCD, 0x03, 0x75, 0xCC, 0x82, 0xCD, 0x03, - 0x75, 0xCC, 0x86, 0xCD, 0x03, 0x75, 0xCC, 0x89, - 0xCD, 0x03, 0x75, 0xCC, 0x8A, 0xCD, 0x03, 0x75, - // Bytes 3500 - 353f - 0xCC, 0x8B, 0xCD, 0x03, 0x75, 0xCC, 0x8C, 0xCD, - 0x03, 0x75, 0xCC, 0x8F, 0xCD, 0x03, 0x75, 0xCC, - 0x91, 0xCD, 0x03, 0x75, 0xCC, 0xA3, 0xB9, 0x03, - 0x75, 0xCC, 0xA4, 0xB9, 0x03, 0x75, 0xCC, 0xA8, - 0xA9, 0x03, 0x75, 0xCC, 0xAD, 0xB9, 0x03, 0x75, - 0xCC, 0xB0, 0xB9, 0x03, 0x76, 0xCC, 0x83, 0xCD, - 0x03, 0x76, 0xCC, 0xA3, 0xB9, 0x03, 0x77, 0xCC, - 0x80, 0xCD, 0x03, 0x77, 0xCC, 0x81, 0xCD, 0x03, - // Bytes 3540 - 357f - 0x77, 0xCC, 0x82, 0xCD, 0x03, 0x77, 0xCC, 0x87, - 0xCD, 0x03, 0x77, 0xCC, 0x88, 0xCD, 0x03, 0x77, - 0xCC, 0x8A, 0xCD, 0x03, 0x77, 0xCC, 0xA3, 0xB9, - 0x03, 0x78, 0xCC, 0x87, 0xCD, 0x03, 0x78, 0xCC, - 0x88, 0xCD, 0x03, 0x79, 0xCC, 0x80, 0xCD, 0x03, - 0x79, 0xCC, 0x81, 0xCD, 0x03, 0x79, 0xCC, 0x82, - 0xCD, 0x03, 0x79, 0xCC, 0x83, 0xCD, 0x03, 0x79, - 0xCC, 0x84, 0xCD, 0x03, 0x79, 0xCC, 0x87, 0xCD, - // Bytes 3580 - 35bf - 0x03, 0x79, 0xCC, 0x88, 0xCD, 0x03, 0x79, 0xCC, - 0x89, 0xCD, 0x03, 0x79, 0xCC, 0x8A, 0xCD, 0x03, - 0x79, 0xCC, 0xA3, 0xB9, 0x03, 0x7A, 0xCC, 0x81, - 0xCD, 0x03, 0x7A, 0xCC, 0x82, 0xCD, 0x03, 0x7A, - 0xCC, 0x87, 0xCD, 0x03, 0x7A, 0xCC, 0x8C, 0xCD, - 0x03, 0x7A, 0xCC, 0xA3, 0xB9, 0x03, 0x7A, 0xCC, - 0xB1, 0xB9, 0x04, 0xC2, 0xA8, 0xCC, 0x80, 0xCE, - 0x04, 0xC2, 0xA8, 0xCC, 0x81, 0xCE, 0x04, 0xC2, - // Bytes 35c0 - 35ff - 0xA8, 0xCD, 0x82, 0xCE, 0x04, 0xC3, 0x86, 0xCC, - 0x81, 0xCD, 0x04, 0xC3, 0x86, 0xCC, 0x84, 0xCD, - 0x04, 0xC3, 0x98, 0xCC, 0x81, 0xCD, 0x04, 0xC3, - 0xA6, 0xCC, 0x81, 0xCD, 0x04, 0xC3, 0xA6, 0xCC, - 0x84, 0xCD, 0x04, 0xC3, 0xB8, 0xCC, 0x81, 0xCD, - 0x04, 0xC5, 0xBF, 0xCC, 0x87, 0xCD, 0x04, 0xC6, - 0xB7, 0xCC, 0x8C, 0xCD, 0x04, 0xCA, 0x92, 0xCC, - 0x8C, 0xCD, 0x04, 0xCE, 0x91, 0xCC, 0x80, 0xCD, - // Bytes 3600 - 363f - 0x04, 0xCE, 0x91, 0xCC, 0x81, 0xCD, 0x04, 0xCE, - 0x91, 0xCC, 0x84, 0xCD, 0x04, 0xCE, 0x91, 0xCC, - 0x86, 0xCD, 0x04, 0xCE, 0x91, 0xCD, 0x85, 0xDD, - 0x04, 0xCE, 0x95, 0xCC, 0x80, 0xCD, 0x04, 0xCE, - 0x95, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0x97, 0xCC, - 0x80, 0xCD, 0x04, 0xCE, 0x97, 0xCC, 0x81, 0xCD, - 0x04, 0xCE, 0x97, 0xCD, 0x85, 0xDD, 0x04, 0xCE, - 0x99, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0x99, 0xCC, - // Bytes 3640 - 367f - 0x81, 0xCD, 0x04, 0xCE, 0x99, 0xCC, 0x84, 0xCD, - 0x04, 0xCE, 0x99, 0xCC, 0x86, 0xCD, 0x04, 0xCE, - 0x99, 0xCC, 0x88, 0xCD, 0x04, 0xCE, 0x9F, 0xCC, - 0x80, 0xCD, 0x04, 0xCE, 0x9F, 0xCC, 0x81, 0xCD, - 0x04, 0xCE, 0xA1, 0xCC, 0x94, 0xCD, 0x04, 0xCE, - 0xA5, 0xCC, 0x80, 0xCD, 0x04, 0xCE, 0xA5, 0xCC, - 0x81, 0xCD, 0x04, 0xCE, 0xA5, 0xCC, 0x84, 0xCD, - 0x04, 0xCE, 0xA5, 0xCC, 0x86, 0xCD, 0x04, 0xCE, - // Bytes 3680 - 36bf - 0xA5, 0xCC, 0x88, 0xCD, 0x04, 0xCE, 0xA9, 0xCC, - 0x80, 0xCD, 0x04, 0xCE, 0xA9, 0xCC, 0x81, 0xCD, - 0x04, 0xCE, 0xA9, 0xCD, 0x85, 0xDD, 0x04, 0xCE, - 0xB1, 0xCC, 0x84, 0xCD, 0x04, 0xCE, 0xB1, 0xCC, - 0x86, 0xCD, 0x04, 0xCE, 0xB1, 0xCD, 0x85, 0xDD, - 0x04, 0xCE, 0xB5, 0xCC, 0x80, 0xCD, 0x04, 0xCE, - 0xB5, 0xCC, 0x81, 0xCD, 0x04, 0xCE, 0xB7, 0xCD, - 0x85, 0xDD, 0x04, 0xCE, 0xB9, 0xCC, 0x80, 0xCD, - // Bytes 36c0 - 36ff - 0x04, 0xCE, 0xB9, 0xCC, 0x81, 0xCD, 0x04, 0xCE, - 0xB9, 0xCC, 0x84, 0xCD, 0x04, 0xCE, 0xB9, 0xCC, - 0x86, 0xCD, 0x04, 0xCE, 0xB9, 0xCD, 0x82, 0xCD, - 0x04, 0xCE, 0xBF, 0xCC, 0x80, 0xCD, 0x04, 0xCE, - 0xBF, 0xCC, 0x81, 0xCD, 0x04, 0xCF, 0x81, 0xCC, - 0x93, 0xCD, 0x04, 0xCF, 0x81, 0xCC, 0x94, 0xCD, - 0x04, 0xCF, 0x85, 0xCC, 0x80, 0xCD, 0x04, 0xCF, - 0x85, 0xCC, 0x81, 0xCD, 0x04, 0xCF, 0x85, 0xCC, - // Bytes 3700 - 373f - 0x84, 0xCD, 0x04, 0xCF, 0x85, 0xCC, 0x86, 0xCD, - 0x04, 0xCF, 0x85, 0xCD, 0x82, 0xCD, 0x04, 0xCF, - 0x89, 0xCD, 0x85, 0xDD, 0x04, 0xCF, 0x92, 0xCC, - 0x81, 0xCD, 0x04, 0xCF, 0x92, 0xCC, 0x88, 0xCD, - 0x04, 0xD0, 0x86, 0xCC, 0x88, 0xCD, 0x04, 0xD0, - 0x90, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0x90, 0xCC, - 0x88, 0xCD, 0x04, 0xD0, 0x93, 0xCC, 0x81, 0xCD, - 0x04, 0xD0, 0x95, 0xCC, 0x80, 0xCD, 0x04, 0xD0, - // Bytes 3740 - 377f - 0x95, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0x95, 0xCC, - 0x88, 0xCD, 0x04, 0xD0, 0x96, 0xCC, 0x86, 0xCD, - 0x04, 0xD0, 0x96, 0xCC, 0x88, 0xCD, 0x04, 0xD0, - 0x97, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x98, 0xCC, - 0x80, 0xCD, 0x04, 0xD0, 0x98, 0xCC, 0x84, 0xCD, - 0x04, 0xD0, 0x98, 0xCC, 0x86, 0xCD, 0x04, 0xD0, - 0x98, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0x9A, 0xCC, - 0x81, 0xCD, 0x04, 0xD0, 0x9E, 0xCC, 0x88, 0xCD, - // Bytes 3780 - 37bf - 0x04, 0xD0, 0xA3, 0xCC, 0x84, 0xCD, 0x04, 0xD0, - 0xA3, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0xA3, 0xCC, - 0x88, 0xCD, 0x04, 0xD0, 0xA3, 0xCC, 0x8B, 0xCD, - 0x04, 0xD0, 0xA7, 0xCC, 0x88, 0xCD, 0x04, 0xD0, - 0xAB, 0xCC, 0x88, 0xCD, 0x04, 0xD0, 0xAD, 0xCC, - 0x88, 0xCD, 0x04, 0xD0, 0xB0, 0xCC, 0x86, 0xCD, - 0x04, 0xD0, 0xB0, 0xCC, 0x88, 0xCD, 0x04, 0xD0, - 0xB3, 0xCC, 0x81, 0xCD, 0x04, 0xD0, 0xB5, 0xCC, - // Bytes 37c0 - 37ff - 0x80, 0xCD, 0x04, 0xD0, 0xB5, 0xCC, 0x86, 0xCD, - 0x04, 0xD0, 0xB5, 0xCC, 0x88, 0xCD, 0x04, 0xD0, - 0xB6, 0xCC, 0x86, 0xCD, 0x04, 0xD0, 0xB6, 0xCC, - 0x88, 0xCD, 0x04, 0xD0, 0xB7, 0xCC, 0x88, 0xCD, - 0x04, 0xD0, 0xB8, 0xCC, 0x80, 0xCD, 0x04, 0xD0, - 0xB8, 0xCC, 0x84, 0xCD, 0x04, 0xD0, 0xB8, 0xCC, - 0x86, 0xCD, 0x04, 0xD0, 0xB8, 0xCC, 0x88, 0xCD, - 0x04, 0xD0, 0xBA, 0xCC, 0x81, 0xCD, 0x04, 0xD0, - // Bytes 3800 - 383f - 0xBE, 0xCC, 0x88, 0xCD, 0x04, 0xD1, 0x83, 0xCC, - 0x84, 0xCD, 0x04, 0xD1, 0x83, 0xCC, 0x86, 0xCD, - 0x04, 0xD1, 0x83, 0xCC, 0x88, 0xCD, 0x04, 0xD1, - 0x83, 0xCC, 0x8B, 0xCD, 0x04, 0xD1, 0x87, 0xCC, - 0x88, 0xCD, 0x04, 0xD1, 0x8B, 0xCC, 0x88, 0xCD, - 0x04, 0xD1, 0x8D, 0xCC, 0x88, 0xCD, 0x04, 0xD1, - 0x96, 0xCC, 0x88, 0xCD, 0x04, 0xD1, 0xB4, 0xCC, - 0x8F, 0xCD, 0x04, 0xD1, 0xB5, 0xCC, 0x8F, 0xCD, - // Bytes 3840 - 387f - 0x04, 0xD3, 0x98, 0xCC, 0x88, 0xCD, 0x04, 0xD3, - 0x99, 0xCC, 0x88, 0xCD, 0x04, 0xD3, 0xA8, 0xCC, - 0x88, 0xCD, 0x04, 0xD3, 0xA9, 0xCC, 0x88, 0xCD, - 0x04, 0xD8, 0xA7, 0xD9, 0x93, 0xCD, 0x04, 0xD8, - 0xA7, 0xD9, 0x94, 0xCD, 0x04, 0xD8, 0xA7, 0xD9, - 0x95, 0xB9, 0x04, 0xD9, 0x88, 0xD9, 0x94, 0xCD, - 0x04, 0xD9, 0x8A, 0xD9, 0x94, 0xCD, 0x04, 0xDB, - 0x81, 0xD9, 0x94, 0xCD, 0x04, 0xDB, 0x92, 0xD9, - // Bytes 3880 - 38bf - 0x94, 0xCD, 0x04, 0xDB, 0x95, 0xD9, 0x94, 0xCD, - 0x05, 0x41, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, - 0x41, 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x41, - 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x41, 0xCC, - 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x41, 0xCC, 0x86, - 0xCC, 0x80, 0xCE, 0x05, 0x41, 0xCC, 0x86, 0xCC, - 0x81, 0xCE, 0x05, 0x41, 0xCC, 0x86, 0xCC, 0x83, - 0xCE, 0x05, 0x41, 0xCC, 0x86, 0xCC, 0x89, 0xCE, - // Bytes 38c0 - 38ff - 0x05, 0x41, 0xCC, 0x87, 0xCC, 0x84, 0xCE, 0x05, - 0x41, 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x41, - 0xCC, 0x8A, 0xCC, 0x81, 0xCE, 0x05, 0x41, 0xCC, - 0xA3, 0xCC, 0x82, 0xCE, 0x05, 0x41, 0xCC, 0xA3, - 0xCC, 0x86, 0xCE, 0x05, 0x43, 0xCC, 0xA7, 0xCC, - 0x81, 0xCE, 0x05, 0x45, 0xCC, 0x82, 0xCC, 0x80, - 0xCE, 0x05, 0x45, 0xCC, 0x82, 0xCC, 0x81, 0xCE, - 0x05, 0x45, 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, - // Bytes 3900 - 393f - 0x45, 0xCC, 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x45, - 0xCC, 0x84, 0xCC, 0x80, 0xCE, 0x05, 0x45, 0xCC, - 0x84, 0xCC, 0x81, 0xCE, 0x05, 0x45, 0xCC, 0xA3, - 0xCC, 0x82, 0xCE, 0x05, 0x45, 0xCC, 0xA7, 0xCC, - 0x86, 0xCE, 0x05, 0x49, 0xCC, 0x88, 0xCC, 0x81, - 0xCE, 0x05, 0x4C, 0xCC, 0xA3, 0xCC, 0x84, 0xCE, - 0x05, 0x4F, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, - 0x4F, 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x4F, - // Bytes 3940 - 397f - 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x4F, 0xCC, - 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x4F, 0xCC, 0x83, - 0xCC, 0x81, 0xCE, 0x05, 0x4F, 0xCC, 0x83, 0xCC, - 0x84, 0xCE, 0x05, 0x4F, 0xCC, 0x83, 0xCC, 0x88, - 0xCE, 0x05, 0x4F, 0xCC, 0x84, 0xCC, 0x80, 0xCE, - 0x05, 0x4F, 0xCC, 0x84, 0xCC, 0x81, 0xCE, 0x05, - 0x4F, 0xCC, 0x87, 0xCC, 0x84, 0xCE, 0x05, 0x4F, - 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x4F, 0xCC, - // Bytes 3980 - 39bf - 0x9B, 0xCC, 0x80, 0xCE, 0x05, 0x4F, 0xCC, 0x9B, - 0xCC, 0x81, 0xCE, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, - 0x83, 0xCE, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, 0x89, - 0xCE, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, 0xA3, 0xBA, - 0x05, 0x4F, 0xCC, 0xA3, 0xCC, 0x82, 0xCE, 0x05, - 0x4F, 0xCC, 0xA8, 0xCC, 0x84, 0xCE, 0x05, 0x52, - 0xCC, 0xA3, 0xCC, 0x84, 0xCE, 0x05, 0x53, 0xCC, - 0x81, 0xCC, 0x87, 0xCE, 0x05, 0x53, 0xCC, 0x8C, - // Bytes 39c0 - 39ff - 0xCC, 0x87, 0xCE, 0x05, 0x53, 0xCC, 0xA3, 0xCC, - 0x87, 0xCE, 0x05, 0x55, 0xCC, 0x83, 0xCC, 0x81, - 0xCE, 0x05, 0x55, 0xCC, 0x84, 0xCC, 0x88, 0xCE, - 0x05, 0x55, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x05, - 0x55, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x05, 0x55, - 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x55, 0xCC, - 0x88, 0xCC, 0x8C, 0xCE, 0x05, 0x55, 0xCC, 0x9B, - 0xCC, 0x80, 0xCE, 0x05, 0x55, 0xCC, 0x9B, 0xCC, - // Bytes 3a00 - 3a3f - 0x81, 0xCE, 0x05, 0x55, 0xCC, 0x9B, 0xCC, 0x83, - 0xCE, 0x05, 0x55, 0xCC, 0x9B, 0xCC, 0x89, 0xCE, - 0x05, 0x55, 0xCC, 0x9B, 0xCC, 0xA3, 0xBA, 0x05, - 0x61, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, 0x61, - 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x61, 0xCC, - 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x61, 0xCC, 0x82, - 0xCC, 0x89, 0xCE, 0x05, 0x61, 0xCC, 0x86, 0xCC, - 0x80, 0xCE, 0x05, 0x61, 0xCC, 0x86, 0xCC, 0x81, - // Bytes 3a40 - 3a7f - 0xCE, 0x05, 0x61, 0xCC, 0x86, 0xCC, 0x83, 0xCE, - 0x05, 0x61, 0xCC, 0x86, 0xCC, 0x89, 0xCE, 0x05, - 0x61, 0xCC, 0x87, 0xCC, 0x84, 0xCE, 0x05, 0x61, - 0xCC, 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x61, 0xCC, - 0x8A, 0xCC, 0x81, 0xCE, 0x05, 0x61, 0xCC, 0xA3, - 0xCC, 0x82, 0xCE, 0x05, 0x61, 0xCC, 0xA3, 0xCC, - 0x86, 0xCE, 0x05, 0x63, 0xCC, 0xA7, 0xCC, 0x81, - 0xCE, 0x05, 0x65, 0xCC, 0x82, 0xCC, 0x80, 0xCE, - // Bytes 3a80 - 3abf - 0x05, 0x65, 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, - 0x65, 0xCC, 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x65, - 0xCC, 0x82, 0xCC, 0x89, 0xCE, 0x05, 0x65, 0xCC, - 0x84, 0xCC, 0x80, 0xCE, 0x05, 0x65, 0xCC, 0x84, - 0xCC, 0x81, 0xCE, 0x05, 0x65, 0xCC, 0xA3, 0xCC, - 0x82, 0xCE, 0x05, 0x65, 0xCC, 0xA7, 0xCC, 0x86, - 0xCE, 0x05, 0x69, 0xCC, 0x88, 0xCC, 0x81, 0xCE, - 0x05, 0x6C, 0xCC, 0xA3, 0xCC, 0x84, 0xCE, 0x05, - // Bytes 3ac0 - 3aff - 0x6F, 0xCC, 0x82, 0xCC, 0x80, 0xCE, 0x05, 0x6F, - 0xCC, 0x82, 0xCC, 0x81, 0xCE, 0x05, 0x6F, 0xCC, - 0x82, 0xCC, 0x83, 0xCE, 0x05, 0x6F, 0xCC, 0x82, - 0xCC, 0x89, 0xCE, 0x05, 0x6F, 0xCC, 0x83, 0xCC, - 0x81, 0xCE, 0x05, 0x6F, 0xCC, 0x83, 0xCC, 0x84, - 0xCE, 0x05, 0x6F, 0xCC, 0x83, 0xCC, 0x88, 0xCE, - 0x05, 0x6F, 0xCC, 0x84, 0xCC, 0x80, 0xCE, 0x05, - 0x6F, 0xCC, 0x84, 0xCC, 0x81, 0xCE, 0x05, 0x6F, - // Bytes 3b00 - 3b3f - 0xCC, 0x87, 0xCC, 0x84, 0xCE, 0x05, 0x6F, 0xCC, - 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x6F, 0xCC, 0x9B, - 0xCC, 0x80, 0xCE, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, - 0x81, 0xCE, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0x83, - 0xCE, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0x89, 0xCE, - 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0xA3, 0xBA, 0x05, - 0x6F, 0xCC, 0xA3, 0xCC, 0x82, 0xCE, 0x05, 0x6F, - 0xCC, 0xA8, 0xCC, 0x84, 0xCE, 0x05, 0x72, 0xCC, - // Bytes 3b40 - 3b7f - 0xA3, 0xCC, 0x84, 0xCE, 0x05, 0x73, 0xCC, 0x81, - 0xCC, 0x87, 0xCE, 0x05, 0x73, 0xCC, 0x8C, 0xCC, - 0x87, 0xCE, 0x05, 0x73, 0xCC, 0xA3, 0xCC, 0x87, - 0xCE, 0x05, 0x75, 0xCC, 0x83, 0xCC, 0x81, 0xCE, - 0x05, 0x75, 0xCC, 0x84, 0xCC, 0x88, 0xCE, 0x05, - 0x75, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x05, 0x75, - 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x05, 0x75, 0xCC, - 0x88, 0xCC, 0x84, 0xCE, 0x05, 0x75, 0xCC, 0x88, - // Bytes 3b80 - 3bbf - 0xCC, 0x8C, 0xCE, 0x05, 0x75, 0xCC, 0x9B, 0xCC, - 0x80, 0xCE, 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x81, - 0xCE, 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x83, 0xCE, - 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x89, 0xCE, 0x05, - 0x75, 0xCC, 0x9B, 0xCC, 0xA3, 0xBA, 0x05, 0xE1, - 0xBE, 0xBF, 0xCC, 0x80, 0xCE, 0x05, 0xE1, 0xBE, - 0xBF, 0xCC, 0x81, 0xCE, 0x05, 0xE1, 0xBE, 0xBF, - 0xCD, 0x82, 0xCE, 0x05, 0xE1, 0xBF, 0xBE, 0xCC, - // Bytes 3bc0 - 3bff - 0x80, 0xCE, 0x05, 0xE1, 0xBF, 0xBE, 0xCC, 0x81, - 0xCE, 0x05, 0xE1, 0xBF, 0xBE, 0xCD, 0x82, 0xCE, - 0x05, 0xE2, 0x86, 0x90, 0xCC, 0xB8, 0x05, 0x05, - 0xE2, 0x86, 0x92, 0xCC, 0xB8, 0x05, 0x05, 0xE2, - 0x86, 0x94, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x87, - 0x90, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x87, 0x92, - 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x87, 0x94, 0xCC, - 0xB8, 0x05, 0x05, 0xE2, 0x88, 0x83, 0xCC, 0xB8, - // Bytes 3c00 - 3c3f - 0x05, 0x05, 0xE2, 0x88, 0x88, 0xCC, 0xB8, 0x05, - 0x05, 0xE2, 0x88, 0x8B, 0xCC, 0xB8, 0x05, 0x05, - 0xE2, 0x88, 0xA3, 0xCC, 0xB8, 0x05, 0x05, 0xE2, - 0x88, 0xA5, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x88, - 0xBC, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0x83, - 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0x85, 0xCC, - 0xB8, 0x05, 0x05, 0xE2, 0x89, 0x88, 0xCC, 0xB8, - 0x05, 0x05, 0xE2, 0x89, 0x8D, 0xCC, 0xB8, 0x05, - // Bytes 3c40 - 3c7f - 0x05, 0xE2, 0x89, 0xA1, 0xCC, 0xB8, 0x05, 0x05, - 0xE2, 0x89, 0xA4, 0xCC, 0xB8, 0x05, 0x05, 0xE2, - 0x89, 0xA5, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, - 0xB2, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xB3, - 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xB6, 0xCC, - 0xB8, 0x05, 0x05, 0xE2, 0x89, 0xB7, 0xCC, 0xB8, - 0x05, 0x05, 0xE2, 0x89, 0xBA, 0xCC, 0xB8, 0x05, - 0x05, 0xE2, 0x89, 0xBB, 0xCC, 0xB8, 0x05, 0x05, - // Bytes 3c80 - 3cbf - 0xE2, 0x89, 0xBC, 0xCC, 0xB8, 0x05, 0x05, 0xE2, - 0x89, 0xBD, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, - 0x82, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x83, - 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x86, 0xCC, - 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0x87, 0xCC, 0xB8, - 0x05, 0x05, 0xE2, 0x8A, 0x91, 0xCC, 0xB8, 0x05, - 0x05, 0xE2, 0x8A, 0x92, 0xCC, 0xB8, 0x05, 0x05, - 0xE2, 0x8A, 0xA2, 0xCC, 0xB8, 0x05, 0x05, 0xE2, - // Bytes 3cc0 - 3cff - 0x8A, 0xA8, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, - 0xA9, 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xAB, - 0xCC, 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xB2, 0xCC, - 0xB8, 0x05, 0x05, 0xE2, 0x8A, 0xB3, 0xCC, 0xB8, - 0x05, 0x05, 0xE2, 0x8A, 0xB4, 0xCC, 0xB8, 0x05, - 0x05, 0xE2, 0x8A, 0xB5, 0xCC, 0xB8, 0x05, 0x06, - 0xCE, 0x91, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, - 0xCE, 0x91, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, - // Bytes 3d00 - 3d3f - 0xCE, 0x95, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, - 0xCE, 0x95, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, - 0xCE, 0x95, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, - 0xCE, 0x95, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, - 0xCE, 0x97, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, - 0xCE, 0x97, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, - 0xCE, 0x99, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, - 0xCE, 0x99, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, - // Bytes 3d40 - 3d7f - 0xCE, 0x99, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x06, - 0xCE, 0x99, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, - 0xCE, 0x99, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, - 0xCE, 0x99, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x06, - 0xCE, 0x9F, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, - 0xCE, 0x9F, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, - 0xCE, 0x9F, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, - 0xCE, 0x9F, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, - // Bytes 3d80 - 3dbf - 0xCE, 0xA5, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, - 0xCE, 0xA5, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, - 0xCE, 0xA5, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x06, - 0xCE, 0xA9, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, - 0xCE, 0xA9, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, - 0xCE, 0xB1, 0xCC, 0x80, 0xCD, 0x85, 0xDE, 0x06, - 0xCE, 0xB1, 0xCC, 0x81, 0xCD, 0x85, 0xDE, 0x06, - 0xCE, 0xB1, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, - // Bytes 3dc0 - 3dff - 0xCE, 0xB1, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, - 0xCE, 0xB1, 0xCD, 0x82, 0xCD, 0x85, 0xDE, 0x06, - 0xCE, 0xB5, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, - 0xCE, 0xB5, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, - 0xCE, 0xB5, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, - 0xCE, 0xB5, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, - 0xCE, 0xB7, 0xCC, 0x80, 0xCD, 0x85, 0xDE, 0x06, - 0xCE, 0xB7, 0xCC, 0x81, 0xCD, 0x85, 0xDE, 0x06, - // Bytes 3e00 - 3e3f - 0xCE, 0xB7, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, - 0xCE, 0xB7, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, - 0xCE, 0xB7, 0xCD, 0x82, 0xCD, 0x85, 0xDE, 0x06, - 0xCE, 0xB9, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x06, - 0xCE, 0xB9, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x06, - 0xCE, 0xB9, 0xCC, 0x88, 0xCD, 0x82, 0xCE, 0x06, - 0xCE, 0xB9, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, - 0xCE, 0xB9, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, - // Bytes 3e40 - 3e7f - 0xCE, 0xB9, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x06, - 0xCE, 0xB9, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, - 0xCE, 0xB9, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, - 0xCE, 0xB9, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x06, - 0xCE, 0xBF, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, - 0xCE, 0xBF, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, - 0xCE, 0xBF, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, - 0xCE, 0xBF, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, - // Bytes 3e80 - 3ebf - 0xCF, 0x85, 0xCC, 0x88, 0xCC, 0x80, 0xCE, 0x06, - 0xCF, 0x85, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x06, - 0xCF, 0x85, 0xCC, 0x88, 0xCD, 0x82, 0xCE, 0x06, - 0xCF, 0x85, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x06, - 0xCF, 0x85, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x06, - 0xCF, 0x85, 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x06, - 0xCF, 0x85, 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x06, - 0xCF, 0x85, 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x06, - // Bytes 3ec0 - 3eff - 0xCF, 0x85, 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x06, - 0xCF, 0x89, 0xCC, 0x80, 0xCD, 0x85, 0xDE, 0x06, - 0xCF, 0x89, 0xCC, 0x81, 0xCD, 0x85, 0xDE, 0x06, - 0xCF, 0x89, 0xCC, 0x93, 0xCD, 0x85, 0xDE, 0x06, - 0xCF, 0x89, 0xCC, 0x94, 0xCD, 0x85, 0xDE, 0x06, - 0xCF, 0x89, 0xCD, 0x82, 0xCD, 0x85, 0xDE, 0x06, - 0xE0, 0xA4, 0xA8, 0xE0, 0xA4, 0xBC, 0x0D, 0x06, - 0xE0, 0xA4, 0xB0, 0xE0, 0xA4, 0xBC, 0x0D, 0x06, - // Bytes 3f00 - 3f3f - 0xE0, 0xA4, 0xB3, 0xE0, 0xA4, 0xBC, 0x0D, 0x06, - 0xE0, 0xB1, 0x86, 0xE0, 0xB1, 0x96, 0x89, 0x06, - 0xE0, 0xB7, 0x99, 0xE0, 0xB7, 0x8A, 0x15, 0x06, - 0xE3, 0x81, 0x86, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0x8B, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0x8D, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0x8F, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0x91, 0xE3, 0x82, 0x99, 0x11, 0x06, - // Bytes 3f40 - 3f7f - 0xE3, 0x81, 0x93, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0x95, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0x97, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0x99, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0x9B, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0x9D, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0x9F, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0xA1, 0xE3, 0x82, 0x99, 0x11, 0x06, - // Bytes 3f80 - 3fbf - 0xE3, 0x81, 0xA4, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0xA6, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0xA8, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0xAF, 0xE3, 0x82, 0x9A, 0x11, 0x06, - 0xE3, 0x81, 0xB2, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0xB2, 0xE3, 0x82, 0x9A, 0x11, 0x06, - 0xE3, 0x81, 0xB5, 0xE3, 0x82, 0x99, 0x11, 0x06, - // Bytes 3fc0 - 3fff - 0xE3, 0x81, 0xB5, 0xE3, 0x82, 0x9A, 0x11, 0x06, - 0xE3, 0x81, 0xB8, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0xB8, 0xE3, 0x82, 0x9A, 0x11, 0x06, - 0xE3, 0x81, 0xBB, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x81, 0xBB, 0xE3, 0x82, 0x9A, 0x11, 0x06, - 0xE3, 0x82, 0x9D, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x82, 0xA6, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0x11, 0x06, - // Bytes 4000 - 403f - 0xE3, 0x82, 0xAD, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x82, 0xB1, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x82, 0xB3, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x82, 0xB5, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x82, 0xB7, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x82, 0xB9, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x82, 0xBB, 0xE3, 0x82, 0x99, 0x11, 0x06, - // Bytes 4040 - 407f - 0xE3, 0x82, 0xBD, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x82, 0xBF, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x83, 0x81, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x83, 0x84, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x83, 0x86, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x9A, 0x11, 0x06, - // Bytes 4080 - 40bf - 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x9A, 0x11, 0x06, - 0xE3, 0x83, 0x95, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x83, 0x95, 0xE3, 0x82, 0x9A, 0x11, 0x06, - 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0x11, 0x06, - 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x9A, 0x11, 0x06, - // Bytes 40c0 - 40ff - 0xE3, 0x83, 0xAF, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x83, 0xB0, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x83, 0xB1, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x83, 0xB2, 0xE3, 0x82, 0x99, 0x11, 0x06, - 0xE3, 0x83, 0xBD, 0xE3, 0x82, 0x99, 0x11, 0x08, - 0xCE, 0x91, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, - 0xDF, 0x08, 0xCE, 0x91, 0xCC, 0x93, 0xCC, 0x81, - 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x91, 0xCC, 0x93, - // Bytes 4100 - 413f - 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x91, - 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, - 0xCE, 0x91, 0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, - 0xDF, 0x08, 0xCE, 0x91, 0xCC, 0x94, 0xCD, 0x82, - 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, 0xCC, 0x93, - 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, - 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, - 0xCE, 0x97, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, - // Bytes 4140 - 417f - 0xDF, 0x08, 0xCE, 0x97, 0xCC, 0x94, 0xCC, 0x80, - 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, 0xCC, 0x94, - 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0x97, - 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, - 0xCE, 0xA9, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, - 0xDF, 0x08, 0xCE, 0xA9, 0xCC, 0x93, 0xCC, 0x81, - 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xA9, 0xCC, 0x93, - 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xA9, - // Bytes 4180 - 41bf - 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, - 0xCE, 0xA9, 0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, - 0xDF, 0x08, 0xCE, 0xA9, 0xCC, 0x94, 0xCD, 0x82, - 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x93, - 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, - 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, - 0xCE, 0xB1, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, - 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x94, 0xCC, 0x80, - // Bytes 41c0 - 41ff - 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, 0xCC, 0x94, - 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB1, - 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, - 0xCE, 0xB7, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, - 0xDF, 0x08, 0xCE, 0xB7, 0xCC, 0x93, 0xCC, 0x81, - 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB7, 0xCC, 0x93, - 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, 0xCE, 0xB7, - 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, - // Bytes 4200 - 423f - 0xCE, 0xB7, 0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, - 0xDF, 0x08, 0xCE, 0xB7, 0xCC, 0x94, 0xCD, 0x82, - 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, 0xCC, 0x93, - 0xCC, 0x80, 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, - 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, - 0xCF, 0x89, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, - 0xDF, 0x08, 0xCF, 0x89, 0xCC, 0x94, 0xCC, 0x80, - 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, 0xCC, 0x94, - // Bytes 4240 - 427f - 0xCC, 0x81, 0xCD, 0x85, 0xDF, 0x08, 0xCF, 0x89, - 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85, 0xDF, 0x08, - 0xF0, 0x91, 0x82, 0x99, 0xF0, 0x91, 0x82, 0xBA, - 0x0D, 0x08, 0xF0, 0x91, 0x82, 0x9B, 0xF0, 0x91, - 0x82, 0xBA, 0x0D, 0x08, 0xF0, 0x91, 0x82, 0xA5, - 0xF0, 0x91, 0x82, 0xBA, 0x0D, 0x42, 0xC2, 0xB4, - 0x01, 0x43, 0x20, 0xCC, 0x81, 0xCD, 0x43, 0x20, - 0xCC, 0x83, 0xCD, 0x43, 0x20, 0xCC, 0x84, 0xCD, - // Bytes 4280 - 42bf - 0x43, 0x20, 0xCC, 0x85, 0xCD, 0x43, 0x20, 0xCC, - 0x86, 0xCD, 0x43, 0x20, 0xCC, 0x87, 0xCD, 0x43, - 0x20, 0xCC, 0x88, 0xCD, 0x43, 0x20, 0xCC, 0x8A, - 0xCD, 0x43, 0x20, 0xCC, 0x8B, 0xCD, 0x43, 0x20, - 0xCC, 0x93, 0xCD, 0x43, 0x20, 0xCC, 0x94, 0xCD, - 0x43, 0x20, 0xCC, 0xA7, 0xA9, 0x43, 0x20, 0xCC, - 0xA8, 0xA9, 0x43, 0x20, 0xCC, 0xB3, 0xB9, 0x43, - 0x20, 0xCD, 0x82, 0xCD, 0x43, 0x20, 0xCD, 0x85, - // Bytes 42c0 - 42ff - 0xDD, 0x43, 0x20, 0xD9, 0x8B, 0x5D, 0x43, 0x20, - 0xD9, 0x8C, 0x61, 0x43, 0x20, 0xD9, 0x8D, 0x65, - 0x43, 0x20, 0xD9, 0x8E, 0x69, 0x43, 0x20, 0xD9, - 0x8F, 0x6D, 0x43, 0x20, 0xD9, 0x90, 0x71, 0x43, - 0x20, 0xD9, 0x91, 0x75, 0x43, 0x20, 0xD9, 0x92, - 0x79, 0x43, 0x41, 0xCC, 0x8A, 0xCD, 0x43, 0x73, - 0xCC, 0x87, 0xCD, 0x44, 0x20, 0xE3, 0x82, 0x99, - 0x11, 0x44, 0x20, 0xE3, 0x82, 0x9A, 0x11, 0x44, - // Bytes 4300 - 433f - 0xC2, 0xA8, 0xCC, 0x81, 0xCE, 0x44, 0xCE, 0x91, - 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0x95, 0xCC, 0x81, - 0xCD, 0x44, 0xCE, 0x97, 0xCC, 0x81, 0xCD, 0x44, - 0xCE, 0x99, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0x9F, - 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xA5, 0xCC, 0x81, - 0xCD, 0x44, 0xCE, 0xA5, 0xCC, 0x88, 0xCD, 0x44, - 0xCE, 0xA9, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xB1, - 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xB5, 0xCC, 0x81, - // Bytes 4340 - 437f - 0xCD, 0x44, 0xCE, 0xB7, 0xCC, 0x81, 0xCD, 0x44, - 0xCE, 0xB9, 0xCC, 0x81, 0xCD, 0x44, 0xCE, 0xBF, - 0xCC, 0x81, 0xCD, 0x44, 0xCF, 0x85, 0xCC, 0x81, - 0xCD, 0x44, 0xCF, 0x89, 0xCC, 0x81, 0xCD, 0x44, - 0xD7, 0x90, 0xD6, 0xB7, 0x35, 0x44, 0xD7, 0x90, - 0xD6, 0xB8, 0x39, 0x44, 0xD7, 0x90, 0xD6, 0xBC, - 0x45, 0x44, 0xD7, 0x91, 0xD6, 0xBC, 0x45, 0x44, - 0xD7, 0x91, 0xD6, 0xBF, 0x4D, 0x44, 0xD7, 0x92, - // Bytes 4380 - 43bf - 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x93, 0xD6, 0xBC, - 0x45, 0x44, 0xD7, 0x94, 0xD6, 0xBC, 0x45, 0x44, - 0xD7, 0x95, 0xD6, 0xB9, 0x3D, 0x44, 0xD7, 0x95, - 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x96, 0xD6, 0xBC, - 0x45, 0x44, 0xD7, 0x98, 0xD6, 0xBC, 0x45, 0x44, - 0xD7, 0x99, 0xD6, 0xB4, 0x29, 0x44, 0xD7, 0x99, - 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x9A, 0xD6, 0xBC, - 0x45, 0x44, 0xD7, 0x9B, 0xD6, 0xBC, 0x45, 0x44, - // Bytes 43c0 - 43ff - 0xD7, 0x9B, 0xD6, 0xBF, 0x4D, 0x44, 0xD7, 0x9C, - 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0x9E, 0xD6, 0xBC, - 0x45, 0x44, 0xD7, 0xA0, 0xD6, 0xBC, 0x45, 0x44, - 0xD7, 0xA1, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA3, - 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA4, 0xD6, 0xBC, - 0x45, 0x44, 0xD7, 0xA4, 0xD6, 0xBF, 0x4D, 0x44, - 0xD7, 0xA6, 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA7, - 0xD6, 0xBC, 0x45, 0x44, 0xD7, 0xA8, 0xD6, 0xBC, - // Bytes 4400 - 443f - 0x45, 0x44, 0xD7, 0xA9, 0xD6, 0xBC, 0x45, 0x44, - 0xD7, 0xA9, 0xD7, 0x81, 0x51, 0x44, 0xD7, 0xA9, - 0xD7, 0x82, 0x55, 0x44, 0xD7, 0xAA, 0xD6, 0xBC, - 0x45, 0x44, 0xD7, 0xB2, 0xD6, 0xB7, 0x35, 0x44, - 0xD8, 0xA7, 0xD9, 0x8B, 0x5D, 0x44, 0xD8, 0xA7, - 0xD9, 0x93, 0xCD, 0x44, 0xD8, 0xA7, 0xD9, 0x94, - 0xCD, 0x44, 0xD8, 0xA7, 0xD9, 0x95, 0xB9, 0x44, - 0xD8, 0xB0, 0xD9, 0xB0, 0x7D, 0x44, 0xD8, 0xB1, - // Bytes 4440 - 447f - 0xD9, 0xB0, 0x7D, 0x44, 0xD9, 0x80, 0xD9, 0x8B, - 0x5D, 0x44, 0xD9, 0x80, 0xD9, 0x8E, 0x69, 0x44, - 0xD9, 0x80, 0xD9, 0x8F, 0x6D, 0x44, 0xD9, 0x80, - 0xD9, 0x90, 0x71, 0x44, 0xD9, 0x80, 0xD9, 0x91, - 0x75, 0x44, 0xD9, 0x80, 0xD9, 0x92, 0x79, 0x44, - 0xD9, 0x87, 0xD9, 0xB0, 0x7D, 0x44, 0xD9, 0x88, - 0xD9, 0x94, 0xCD, 0x44, 0xD9, 0x89, 0xD9, 0xB0, - 0x7D, 0x44, 0xD9, 0x8A, 0xD9, 0x94, 0xCD, 0x44, - // Bytes 4480 - 44bf - 0xDB, 0x92, 0xD9, 0x94, 0xCD, 0x44, 0xDB, 0x95, - 0xD9, 0x94, 0xCD, 0x45, 0x20, 0xCC, 0x88, 0xCC, - 0x80, 0xCE, 0x45, 0x20, 0xCC, 0x88, 0xCC, 0x81, - 0xCE, 0x45, 0x20, 0xCC, 0x88, 0xCD, 0x82, 0xCE, - 0x45, 0x20, 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x45, - 0x20, 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x45, 0x20, - 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x45, 0x20, 0xCC, - 0x94, 0xCC, 0x80, 0xCE, 0x45, 0x20, 0xCC, 0x94, - // Bytes 44c0 - 44ff - 0xCC, 0x81, 0xCE, 0x45, 0x20, 0xCC, 0x94, 0xCD, - 0x82, 0xCE, 0x45, 0x20, 0xD9, 0x8C, 0xD9, 0x91, - 0x76, 0x45, 0x20, 0xD9, 0x8D, 0xD9, 0x91, 0x76, - 0x45, 0x20, 0xD9, 0x8E, 0xD9, 0x91, 0x76, 0x45, - 0x20, 0xD9, 0x8F, 0xD9, 0x91, 0x76, 0x45, 0x20, - 0xD9, 0x90, 0xD9, 0x91, 0x76, 0x45, 0x20, 0xD9, - 0x91, 0xD9, 0xB0, 0x7E, 0x45, 0xE2, 0xAB, 0x9D, - 0xCC, 0xB8, 0x05, 0x46, 0xCE, 0xB9, 0xCC, 0x88, - // Bytes 4500 - 453f - 0xCC, 0x81, 0xCE, 0x46, 0xCF, 0x85, 0xCC, 0x88, - 0xCC, 0x81, 0xCE, 0x46, 0xD7, 0xA9, 0xD6, 0xBC, - 0xD7, 0x81, 0x52, 0x46, 0xD7, 0xA9, 0xD6, 0xBC, - 0xD7, 0x82, 0x56, 0x46, 0xD9, 0x80, 0xD9, 0x8E, - 0xD9, 0x91, 0x76, 0x46, 0xD9, 0x80, 0xD9, 0x8F, - 0xD9, 0x91, 0x76, 0x46, 0xD9, 0x80, 0xD9, 0x90, - 0xD9, 0x91, 0x76, 0x46, 0xE0, 0xA4, 0x95, 0xE0, - 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0x96, 0xE0, - // Bytes 4540 - 457f - 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0x97, 0xE0, - 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0x9C, 0xE0, - 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0xA1, 0xE0, - 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0xA2, 0xE0, - 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0xAB, 0xE0, - 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA4, 0xAF, 0xE0, - 0xA4, 0xBC, 0x0D, 0x46, 0xE0, 0xA6, 0xA1, 0xE0, - 0xA6, 0xBC, 0x0D, 0x46, 0xE0, 0xA6, 0xA2, 0xE0, - // Bytes 4580 - 45bf - 0xA6, 0xBC, 0x0D, 0x46, 0xE0, 0xA6, 0xAF, 0xE0, - 0xA6, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0x96, 0xE0, - 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0x97, 0xE0, - 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0x9C, 0xE0, - 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0xAB, 0xE0, - 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0xB2, 0xE0, - 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xA8, 0xB8, 0xE0, - 0xA8, 0xBC, 0x0D, 0x46, 0xE0, 0xAC, 0xA1, 0xE0, - // Bytes 45c0 - 45ff - 0xAC, 0xBC, 0x0D, 0x46, 0xE0, 0xAC, 0xA2, 0xE0, - 0xAC, 0xBC, 0x0D, 0x46, 0xE0, 0xBE, 0xB2, 0xE0, - 0xBE, 0x80, 0xA1, 0x46, 0xE0, 0xBE, 0xB3, 0xE0, - 0xBE, 0x80, 0xA1, 0x46, 0xE3, 0x83, 0x86, 0xE3, - 0x82, 0x99, 0x11, 0x48, 0xF0, 0x9D, 0x85, 0x97, - 0xF0, 0x9D, 0x85, 0xA5, 0xB1, 0x48, 0xF0, 0x9D, - 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xB1, 0x48, - 0xF0, 0x9D, 0x86, 0xB9, 0xF0, 0x9D, 0x85, 0xA5, - // Bytes 4600 - 463f - 0xB1, 0x48, 0xF0, 0x9D, 0x86, 0xBA, 0xF0, 0x9D, - 0x85, 0xA5, 0xB1, 0x49, 0xE0, 0xBE, 0xB2, 0xE0, - 0xBD, 0xB1, 0xE0, 0xBE, 0x80, 0xA2, 0x49, 0xE0, - 0xBE, 0xB3, 0xE0, 0xBD, 0xB1, 0xE0, 0xBE, 0x80, - 0xA2, 0x4C, 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, - 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAE, 0xB2, 0x4C, - 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, - 0xF0, 0x9D, 0x85, 0xAF, 0xB2, 0x4C, 0xF0, 0x9D, - // Bytes 4640 - 467f - 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, - 0x85, 0xB0, 0xB2, 0x4C, 0xF0, 0x9D, 0x85, 0x98, - 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xB1, - 0xB2, 0x4C, 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, - 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xB2, 0xB2, 0x4C, - 0xF0, 0x9D, 0x86, 0xB9, 0xF0, 0x9D, 0x85, 0xA5, - 0xF0, 0x9D, 0x85, 0xAE, 0xB2, 0x4C, 0xF0, 0x9D, - 0x86, 0xB9, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, - // Bytes 4680 - 46bf - 0x85, 0xAF, 0xB2, 0x4C, 0xF0, 0x9D, 0x86, 0xBA, - 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAE, - 0xB2, 0x4C, 0xF0, 0x9D, 0x86, 0xBA, 0xF0, 0x9D, - 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAF, 0xB2, 0x83, - 0x41, 0xCC, 0x82, 0xCD, 0x83, 0x41, 0xCC, 0x86, - 0xCD, 0x83, 0x41, 0xCC, 0x87, 0xCD, 0x83, 0x41, - 0xCC, 0x88, 0xCD, 0x83, 0x41, 0xCC, 0x8A, 0xCD, - 0x83, 0x41, 0xCC, 0xA3, 0xB9, 0x83, 0x43, 0xCC, - // Bytes 46c0 - 46ff - 0xA7, 0xA9, 0x83, 0x45, 0xCC, 0x82, 0xCD, 0x83, - 0x45, 0xCC, 0x84, 0xCD, 0x83, 0x45, 0xCC, 0xA3, - 0xB9, 0x83, 0x45, 0xCC, 0xA7, 0xA9, 0x83, 0x49, - 0xCC, 0x88, 0xCD, 0x83, 0x4C, 0xCC, 0xA3, 0xB9, - 0x83, 0x4F, 0xCC, 0x82, 0xCD, 0x83, 0x4F, 0xCC, - 0x83, 0xCD, 0x83, 0x4F, 0xCC, 0x84, 0xCD, 0x83, - 0x4F, 0xCC, 0x87, 0xCD, 0x83, 0x4F, 0xCC, 0x88, - 0xCD, 0x83, 0x4F, 0xCC, 0x9B, 0xB1, 0x83, 0x4F, - // Bytes 4700 - 473f - 0xCC, 0xA3, 0xB9, 0x83, 0x4F, 0xCC, 0xA8, 0xA9, - 0x83, 0x52, 0xCC, 0xA3, 0xB9, 0x83, 0x53, 0xCC, - 0x81, 0xCD, 0x83, 0x53, 0xCC, 0x8C, 0xCD, 0x83, - 0x53, 0xCC, 0xA3, 0xB9, 0x83, 0x55, 0xCC, 0x83, - 0xCD, 0x83, 0x55, 0xCC, 0x84, 0xCD, 0x83, 0x55, - 0xCC, 0x88, 0xCD, 0x83, 0x55, 0xCC, 0x9B, 0xB1, - 0x83, 0x61, 0xCC, 0x82, 0xCD, 0x83, 0x61, 0xCC, - 0x86, 0xCD, 0x83, 0x61, 0xCC, 0x87, 0xCD, 0x83, - // Bytes 4740 - 477f - 0x61, 0xCC, 0x88, 0xCD, 0x83, 0x61, 0xCC, 0x8A, - 0xCD, 0x83, 0x61, 0xCC, 0xA3, 0xB9, 0x83, 0x63, - 0xCC, 0xA7, 0xA9, 0x83, 0x65, 0xCC, 0x82, 0xCD, - 0x83, 0x65, 0xCC, 0x84, 0xCD, 0x83, 0x65, 0xCC, - 0xA3, 0xB9, 0x83, 0x65, 0xCC, 0xA7, 0xA9, 0x83, - 0x69, 0xCC, 0x88, 0xCD, 0x83, 0x6C, 0xCC, 0xA3, - 0xB9, 0x83, 0x6F, 0xCC, 0x82, 0xCD, 0x83, 0x6F, - 0xCC, 0x83, 0xCD, 0x83, 0x6F, 0xCC, 0x84, 0xCD, - // Bytes 4780 - 47bf - 0x83, 0x6F, 0xCC, 0x87, 0xCD, 0x83, 0x6F, 0xCC, - 0x88, 0xCD, 0x83, 0x6F, 0xCC, 0x9B, 0xB1, 0x83, - 0x6F, 0xCC, 0xA3, 0xB9, 0x83, 0x6F, 0xCC, 0xA8, - 0xA9, 0x83, 0x72, 0xCC, 0xA3, 0xB9, 0x83, 0x73, - 0xCC, 0x81, 0xCD, 0x83, 0x73, 0xCC, 0x8C, 0xCD, - 0x83, 0x73, 0xCC, 0xA3, 0xB9, 0x83, 0x75, 0xCC, - 0x83, 0xCD, 0x83, 0x75, 0xCC, 0x84, 0xCD, 0x83, - 0x75, 0xCC, 0x88, 0xCD, 0x83, 0x75, 0xCC, 0x9B, - // Bytes 47c0 - 47ff - 0xB1, 0x84, 0xCE, 0x91, 0xCC, 0x93, 0xCD, 0x84, - 0xCE, 0x91, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0x95, - 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0x95, 0xCC, 0x94, - 0xCD, 0x84, 0xCE, 0x97, 0xCC, 0x93, 0xCD, 0x84, - 0xCE, 0x97, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0x99, - 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0x99, 0xCC, 0x94, - 0xCD, 0x84, 0xCE, 0x9F, 0xCC, 0x93, 0xCD, 0x84, - 0xCE, 0x9F, 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0xA5, - // Bytes 4800 - 483f - 0xCC, 0x94, 0xCD, 0x84, 0xCE, 0xA9, 0xCC, 0x93, - 0xCD, 0x84, 0xCE, 0xA9, 0xCC, 0x94, 0xCD, 0x84, - 0xCE, 0xB1, 0xCC, 0x80, 0xCD, 0x84, 0xCE, 0xB1, - 0xCC, 0x81, 0xCD, 0x84, 0xCE, 0xB1, 0xCC, 0x93, - 0xCD, 0x84, 0xCE, 0xB1, 0xCC, 0x94, 0xCD, 0x84, - 0xCE, 0xB1, 0xCD, 0x82, 0xCD, 0x84, 0xCE, 0xB5, - 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0xB5, 0xCC, 0x94, - 0xCD, 0x84, 0xCE, 0xB7, 0xCC, 0x80, 0xCD, 0x84, - // Bytes 4840 - 487f - 0xCE, 0xB7, 0xCC, 0x81, 0xCD, 0x84, 0xCE, 0xB7, - 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0xB7, 0xCC, 0x94, - 0xCD, 0x84, 0xCE, 0xB7, 0xCD, 0x82, 0xCD, 0x84, - 0xCE, 0xB9, 0xCC, 0x88, 0xCD, 0x84, 0xCE, 0xB9, - 0xCC, 0x93, 0xCD, 0x84, 0xCE, 0xB9, 0xCC, 0x94, - 0xCD, 0x84, 0xCE, 0xBF, 0xCC, 0x93, 0xCD, 0x84, - 0xCE, 0xBF, 0xCC, 0x94, 0xCD, 0x84, 0xCF, 0x85, - 0xCC, 0x88, 0xCD, 0x84, 0xCF, 0x85, 0xCC, 0x93, - // Bytes 4880 - 48bf - 0xCD, 0x84, 0xCF, 0x85, 0xCC, 0x94, 0xCD, 0x84, - 0xCF, 0x89, 0xCC, 0x80, 0xCD, 0x84, 0xCF, 0x89, - 0xCC, 0x81, 0xCD, 0x84, 0xCF, 0x89, 0xCC, 0x93, - 0xCD, 0x84, 0xCF, 0x89, 0xCC, 0x94, 0xCD, 0x84, - 0xCF, 0x89, 0xCD, 0x82, 0xCD, 0x86, 0xCE, 0x91, - 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0x91, - 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0x91, - 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0x91, - // Bytes 48c0 - 48ff - 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0x91, - 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0x91, - 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0x97, - 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0x97, - 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0x97, - 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0x97, - 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0x97, - 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0x97, - // Bytes 4900 - 493f - 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xA9, - 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xA9, - 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xA9, - 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xA9, - 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xA9, - 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xA9, - 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xB1, - 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xB1, - // Bytes 4940 - 497f - 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xB1, - 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xB1, - 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xB1, - 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xB1, - 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xB7, - 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xB7, - 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xB7, - 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCE, 0xB7, - // Bytes 4980 - 49bf - 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCE, 0xB7, - 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCE, 0xB7, - 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x86, 0xCF, 0x89, - 0xCC, 0x93, 0xCC, 0x80, 0xCE, 0x86, 0xCF, 0x89, - 0xCC, 0x93, 0xCC, 0x81, 0xCE, 0x86, 0xCF, 0x89, - 0xCC, 0x93, 0xCD, 0x82, 0xCE, 0x86, 0xCF, 0x89, - 0xCC, 0x94, 0xCC, 0x80, 0xCE, 0x86, 0xCF, 0x89, - 0xCC, 0x94, 0xCC, 0x81, 0xCE, 0x86, 0xCF, 0x89, - // Bytes 49c0 - 49ff - 0xCC, 0x94, 0xCD, 0x82, 0xCE, 0x42, 0xCC, 0x80, - 0xCD, 0x33, 0x42, 0xCC, 0x81, 0xCD, 0x33, 0x42, - 0xCC, 0x93, 0xCD, 0x33, 0x43, 0xE1, 0x85, 0xA1, - 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA2, 0x01, 0x00, - 0x43, 0xE1, 0x85, 0xA3, 0x01, 0x00, 0x43, 0xE1, - 0x85, 0xA4, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA5, - 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA6, 0x01, 0x00, - 0x43, 0xE1, 0x85, 0xA7, 0x01, 0x00, 0x43, 0xE1, - // Bytes 4a00 - 4a3f - 0x85, 0xA8, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xA9, - 0x01, 0x00, 0x43, 0xE1, 0x85, 0xAA, 0x01, 0x00, - 0x43, 0xE1, 0x85, 0xAB, 0x01, 0x00, 0x43, 0xE1, - 0x85, 0xAC, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xAD, - 0x01, 0x00, 0x43, 0xE1, 0x85, 0xAE, 0x01, 0x00, - 0x43, 0xE1, 0x85, 0xAF, 0x01, 0x00, 0x43, 0xE1, - 0x85, 0xB0, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xB1, - 0x01, 0x00, 0x43, 0xE1, 0x85, 0xB2, 0x01, 0x00, - // Bytes 4a40 - 4a7f - 0x43, 0xE1, 0x85, 0xB3, 0x01, 0x00, 0x43, 0xE1, - 0x85, 0xB4, 0x01, 0x00, 0x43, 0xE1, 0x85, 0xB5, - 0x01, 0x00, 0x43, 0xE1, 0x86, 0xAA, 0x01, 0x00, - 0x43, 0xE1, 0x86, 0xAC, 0x01, 0x00, 0x43, 0xE1, - 0x86, 0xAD, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB0, - 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB1, 0x01, 0x00, - 0x43, 0xE1, 0x86, 0xB2, 0x01, 0x00, 0x43, 0xE1, - 0x86, 0xB3, 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB4, - // Bytes 4a80 - 4abf - 0x01, 0x00, 0x43, 0xE1, 0x86, 0xB5, 0x01, 0x00, - 0x44, 0xCC, 0x88, 0xCC, 0x81, 0xCE, 0x33, 0x43, - 0xE3, 0x82, 0x99, 0x11, 0x04, 0x43, 0xE3, 0x82, - 0x9A, 0x11, 0x04, 0x46, 0xE0, 0xBD, 0xB1, 0xE0, - 0xBD, 0xB2, 0xA2, 0x27, 0x46, 0xE0, 0xBD, 0xB1, - 0xE0, 0xBD, 0xB4, 0xA6, 0x27, 0x46, 0xE0, 0xBD, - 0xB1, 0xE0, 0xBE, 0x80, 0xA2, 0x27, 0x00, 0x01, -} - -// lookup returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *nfcTrie) lookup(s []byte) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return nfcValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := nfcIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := nfcIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = nfcIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := nfcIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = nfcIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = nfcIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *nfcTrie) lookupUnsafe(s []byte) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return nfcValues[c0] - } - i := nfcIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = nfcIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = nfcIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// lookupString returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *nfcTrie) lookupString(s string) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return nfcValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := nfcIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := nfcIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = nfcIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := nfcIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = nfcIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = nfcIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *nfcTrie) lookupStringUnsafe(s string) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return nfcValues[c0] - } - i := nfcIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = nfcIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = nfcIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// nfcTrie. Total size: 10680 bytes (10.43 KiB). Checksum: a555db76d4becdd2. -type nfcTrie struct{} - -func newNfcTrie(i int) *nfcTrie { - return &nfcTrie{} -} - -// lookupValue determines the type of block n and looks up the value for b. -func (t *nfcTrie) lookupValue(n uint32, b byte) uint16 { - switch { - case n < 46: - return uint16(nfcValues[n<<6+uint32(b)]) - default: - n -= 46 - return uint16(nfcSparse.lookup(n, b)) - } -} - -// nfcValues: 48 blocks, 3072 entries, 6144 bytes -// The third block is the zero block. -var nfcValues = [3072]uint16{ - // Block 0x0, offset 0x0 - 0x3c: 0xa000, 0x3d: 0xa000, 0x3e: 0xa000, - // Block 0x1, offset 0x40 - 0x41: 0xa000, 0x42: 0xa000, 0x43: 0xa000, 0x44: 0xa000, 0x45: 0xa000, - 0x46: 0xa000, 0x47: 0xa000, 0x48: 0xa000, 0x49: 0xa000, 0x4a: 0xa000, 0x4b: 0xa000, - 0x4c: 0xa000, 0x4d: 0xa000, 0x4e: 0xa000, 0x4f: 0xa000, 0x50: 0xa000, - 0x52: 0xa000, 0x53: 0xa000, 0x54: 0xa000, 0x55: 0xa000, 0x56: 0xa000, 0x57: 0xa000, - 0x58: 0xa000, 0x59: 0xa000, 0x5a: 0xa000, - 0x61: 0xa000, 0x62: 0xa000, 0x63: 0xa000, - 0x64: 0xa000, 0x65: 0xa000, 0x66: 0xa000, 0x67: 0xa000, 0x68: 0xa000, 0x69: 0xa000, - 0x6a: 0xa000, 0x6b: 0xa000, 0x6c: 0xa000, 0x6d: 0xa000, 0x6e: 0xa000, 0x6f: 0xa000, - 0x70: 0xa000, 0x72: 0xa000, 0x73: 0xa000, 0x74: 0xa000, 0x75: 0xa000, - 0x76: 0xa000, 0x77: 0xa000, 0x78: 0xa000, 0x79: 0xa000, 0x7a: 0xa000, - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xc0: 0x2f86, 0xc1: 0x2f8b, 0xc2: 0x469f, 0xc3: 0x2f90, 0xc4: 0x46ae, 0xc5: 0x46b3, - 0xc6: 0xa000, 0xc7: 0x46bd, 0xc8: 0x2ff9, 0xc9: 0x2ffe, 0xca: 0x46c2, 0xcb: 0x3012, - 0xcc: 0x3085, 0xcd: 0x308a, 0xce: 0x308f, 0xcf: 0x46d6, 0xd1: 0x311b, - 0xd2: 0x313e, 0xd3: 0x3143, 0xd4: 0x46e0, 0xd5: 0x46e5, 0xd6: 0x46f4, - 0xd8: 0xa000, 0xd9: 0x31ca, 0xda: 0x31cf, 0xdb: 0x31d4, 0xdc: 0x4726, 0xdd: 0x324c, - 0xe0: 0x3292, 0xe1: 0x3297, 0xe2: 0x4730, 0xe3: 0x329c, - 0xe4: 0x473f, 0xe5: 0x4744, 0xe6: 0xa000, 0xe7: 0x474e, 0xe8: 0x3305, 0xe9: 0x330a, - 0xea: 0x4753, 0xeb: 0x331e, 0xec: 0x3396, 0xed: 0x339b, 0xee: 0x33a0, 0xef: 0x4767, - 0xf1: 0x342c, 0xf2: 0x344f, 0xf3: 0x3454, 0xf4: 0x4771, 0xf5: 0x4776, - 0xf6: 0x4785, 0xf8: 0xa000, 0xf9: 0x34e0, 0xfa: 0x34e5, 0xfb: 0x34ea, - 0xfc: 0x47b7, 0xfd: 0x3567, 0xff: 0x3580, - // Block 0x4, offset 0x100 - 0x100: 0x2f95, 0x101: 0x32a1, 0x102: 0x46a4, 0x103: 0x4735, 0x104: 0x2fb3, 0x105: 0x32bf, - 0x106: 0x2fc7, 0x107: 0x32d3, 0x108: 0x2fcc, 0x109: 0x32d8, 0x10a: 0x2fd1, 0x10b: 0x32dd, - 0x10c: 0x2fd6, 0x10d: 0x32e2, 0x10e: 0x2fe0, 0x10f: 0x32ec, - 0x112: 0x46c7, 0x113: 0x4758, 0x114: 0x3008, 0x115: 0x3314, 0x116: 0x300d, 0x117: 0x3319, - 0x118: 0x302b, 0x119: 0x3337, 0x11a: 0x301c, 0x11b: 0x3328, 0x11c: 0x3044, 0x11d: 0x3350, - 0x11e: 0x304e, 0x11f: 0x335a, 0x120: 0x3053, 0x121: 0x335f, 0x122: 0x305d, 0x123: 0x3369, - 0x124: 0x3062, 0x125: 0x336e, 0x128: 0x3094, 0x129: 0x33a5, - 0x12a: 0x3099, 0x12b: 0x33aa, 0x12c: 0x309e, 0x12d: 0x33af, 0x12e: 0x30c1, 0x12f: 0x33cd, - 0x130: 0x30a3, 0x134: 0x30cb, 0x135: 0x33d7, - 0x136: 0x30df, 0x137: 0x33f0, 0x139: 0x30e9, 0x13a: 0x33fa, 0x13b: 0x30f3, - 0x13c: 0x3404, 0x13d: 0x30ee, 0x13e: 0x33ff, - // Block 0x5, offset 0x140 - 0x143: 0x3116, 0x144: 0x3427, 0x145: 0x312f, - 0x146: 0x3440, 0x147: 0x3125, 0x148: 0x3436, - 0x14c: 0x46ea, 0x14d: 0x477b, 0x14e: 0x3148, 0x14f: 0x3459, 0x150: 0x3152, 0x151: 0x3463, - 0x154: 0x3170, 0x155: 0x3481, 0x156: 0x3189, 0x157: 0x349a, - 0x158: 0x317a, 0x159: 0x348b, 0x15a: 0x470d, 0x15b: 0x479e, 0x15c: 0x3193, 0x15d: 0x34a4, - 0x15e: 0x31a2, 0x15f: 0x34b3, 0x160: 0x4712, 0x161: 0x47a3, 0x162: 0x31bb, 0x163: 0x34d1, - 0x164: 0x31ac, 0x165: 0x34c2, 0x168: 0x471c, 0x169: 0x47ad, - 0x16a: 0x4721, 0x16b: 0x47b2, 0x16c: 0x31d9, 0x16d: 0x34ef, 0x16e: 0x31e3, 0x16f: 0x34f9, - 0x170: 0x31e8, 0x171: 0x34fe, 0x172: 0x3206, 0x173: 0x351c, 0x174: 0x3229, 0x175: 0x353f, - 0x176: 0x3251, 0x177: 0x356c, 0x178: 0x3265, 0x179: 0x3274, 0x17a: 0x3594, 0x17b: 0x327e, - 0x17c: 0x359e, 0x17d: 0x3283, 0x17e: 0x35a3, 0x17f: 0xa000, - // Block 0x6, offset 0x180 - 0x184: 0x8100, 0x185: 0x8100, - 0x186: 0x8100, - 0x18d: 0x2f9f, 0x18e: 0x32ab, 0x18f: 0x30ad, 0x190: 0x33b9, 0x191: 0x3157, - 0x192: 0x3468, 0x193: 0x31ed, 0x194: 0x3503, 0x195: 0x39e6, 0x196: 0x3b75, 0x197: 0x39df, - 0x198: 0x3b6e, 0x199: 0x39ed, 0x19a: 0x3b7c, 0x19b: 0x39d8, 0x19c: 0x3b67, - 0x19e: 0x38c7, 0x19f: 0x3a56, 0x1a0: 0x38c0, 0x1a1: 0x3a4f, 0x1a2: 0x35ca, 0x1a3: 0x35dc, - 0x1a6: 0x3058, 0x1a7: 0x3364, 0x1a8: 0x30d5, 0x1a9: 0x33e6, - 0x1aa: 0x4703, 0x1ab: 0x4794, 0x1ac: 0x39a7, 0x1ad: 0x3b36, 0x1ae: 0x35ee, 0x1af: 0x35f4, - 0x1b0: 0x33dc, 0x1b4: 0x303f, 0x1b5: 0x334b, - 0x1b8: 0x3111, 0x1b9: 0x3422, 0x1ba: 0x38ce, 0x1bb: 0x3a5d, - 0x1bc: 0x35c4, 0x1bd: 0x35d6, 0x1be: 0x35d0, 0x1bf: 0x35e2, - // Block 0x7, offset 0x1c0 - 0x1c0: 0x2fa4, 0x1c1: 0x32b0, 0x1c2: 0x2fa9, 0x1c3: 0x32b5, 0x1c4: 0x3021, 0x1c5: 0x332d, - 0x1c6: 0x3026, 0x1c7: 0x3332, 0x1c8: 0x30b2, 0x1c9: 0x33be, 0x1ca: 0x30b7, 0x1cb: 0x33c3, - 0x1cc: 0x315c, 0x1cd: 0x346d, 0x1ce: 0x3161, 0x1cf: 0x3472, 0x1d0: 0x317f, 0x1d1: 0x3490, - 0x1d2: 0x3184, 0x1d3: 0x3495, 0x1d4: 0x31f2, 0x1d5: 0x3508, 0x1d6: 0x31f7, 0x1d7: 0x350d, - 0x1d8: 0x319d, 0x1d9: 0x34ae, 0x1da: 0x31b6, 0x1db: 0x34cc, - 0x1de: 0x3071, 0x1df: 0x337d, - 0x1e6: 0x46a9, 0x1e7: 0x473a, 0x1e8: 0x46d1, 0x1e9: 0x4762, - 0x1ea: 0x3976, 0x1eb: 0x3b05, 0x1ec: 0x3953, 0x1ed: 0x3ae2, 0x1ee: 0x46ef, 0x1ef: 0x4780, - 0x1f0: 0x396f, 0x1f1: 0x3afe, 0x1f2: 0x325b, 0x1f3: 0x3576, - // Block 0x8, offset 0x200 - 0x200: 0x9933, 0x201: 0x9933, 0x202: 0x9933, 0x203: 0x9933, 0x204: 0x9933, 0x205: 0x8133, - 0x206: 0x9933, 0x207: 0x9933, 0x208: 0x9933, 0x209: 0x9933, 0x20a: 0x9933, 0x20b: 0x9933, - 0x20c: 0x9933, 0x20d: 0x8133, 0x20e: 0x8133, 0x20f: 0x9933, 0x210: 0x8133, 0x211: 0x9933, - 0x212: 0x8133, 0x213: 0x9933, 0x214: 0x9933, 0x215: 0x8134, 0x216: 0x812e, 0x217: 0x812e, - 0x218: 0x812e, 0x219: 0x812e, 0x21a: 0x8134, 0x21b: 0x992c, 0x21c: 0x812e, 0x21d: 0x812e, - 0x21e: 0x812e, 0x21f: 0x812e, 0x220: 0x812e, 0x221: 0x812a, 0x222: 0x812a, 0x223: 0x992e, - 0x224: 0x992e, 0x225: 0x992e, 0x226: 0x992e, 0x227: 0x992a, 0x228: 0x992a, 0x229: 0x812e, - 0x22a: 0x812e, 0x22b: 0x812e, 0x22c: 0x812e, 0x22d: 0x992e, 0x22e: 0x992e, 0x22f: 0x812e, - 0x230: 0x992e, 0x231: 0x992e, 0x232: 0x812e, 0x233: 0x812e, 0x234: 0x8101, 0x235: 0x8101, - 0x236: 0x8101, 0x237: 0x8101, 0x238: 0x9901, 0x239: 0x812e, 0x23a: 0x812e, 0x23b: 0x812e, - 0x23c: 0x812e, 0x23d: 0x8133, 0x23e: 0x8133, 0x23f: 0x8133, - // Block 0x9, offset 0x240 - 0x240: 0x49c5, 0x241: 0x49ca, 0x242: 0x9933, 0x243: 0x49cf, 0x244: 0x4a88, 0x245: 0x9937, - 0x246: 0x8133, 0x247: 0x812e, 0x248: 0x812e, 0x249: 0x812e, 0x24a: 0x8133, 0x24b: 0x8133, - 0x24c: 0x8133, 0x24d: 0x812e, 0x24e: 0x812e, 0x250: 0x8133, 0x251: 0x8133, - 0x252: 0x8133, 0x253: 0x812e, 0x254: 0x812e, 0x255: 0x812e, 0x256: 0x812e, 0x257: 0x8133, - 0x258: 0x8134, 0x259: 0x812e, 0x25a: 0x812e, 0x25b: 0x8133, 0x25c: 0x8135, 0x25d: 0x8136, - 0x25e: 0x8136, 0x25f: 0x8135, 0x260: 0x8136, 0x261: 0x8136, 0x262: 0x8135, 0x263: 0x8133, - 0x264: 0x8133, 0x265: 0x8133, 0x266: 0x8133, 0x267: 0x8133, 0x268: 0x8133, 0x269: 0x8133, - 0x26a: 0x8133, 0x26b: 0x8133, 0x26c: 0x8133, 0x26d: 0x8133, 0x26e: 0x8133, 0x26f: 0x8133, - 0x274: 0x0173, - 0x27a: 0x8100, - 0x27e: 0x0037, - // Block 0xa, offset 0x280 - 0x284: 0x8100, 0x285: 0x35b8, - 0x286: 0x3600, 0x287: 0x00ce, 0x288: 0x361e, 0x289: 0x362a, 0x28a: 0x363c, - 0x28c: 0x365a, 0x28e: 0x366c, 0x28f: 0x368a, 0x290: 0x3e1f, 0x291: 0xa000, - 0x295: 0xa000, 0x297: 0xa000, - 0x299: 0xa000, - 0x29f: 0xa000, 0x2a1: 0xa000, - 0x2a5: 0xa000, 0x2a9: 0xa000, - 0x2aa: 0x364e, 0x2ab: 0x367e, 0x2ac: 0x4815, 0x2ad: 0x36ae, 0x2ae: 0x483f, 0x2af: 0x36c0, - 0x2b0: 0x3e87, 0x2b1: 0xa000, 0x2b5: 0xa000, - 0x2b7: 0xa000, 0x2b9: 0xa000, - 0x2bf: 0xa000, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x3738, 0x2c1: 0x3744, 0x2c3: 0x3732, - 0x2c6: 0xa000, 0x2c7: 0x3720, - 0x2cc: 0x3774, 0x2cd: 0x375c, 0x2ce: 0x3786, 0x2d0: 0xa000, - 0x2d3: 0xa000, 0x2d5: 0xa000, 0x2d6: 0xa000, 0x2d7: 0xa000, - 0x2d8: 0xa000, 0x2d9: 0x3768, 0x2da: 0xa000, - 0x2de: 0xa000, 0x2e3: 0xa000, - 0x2e7: 0xa000, - 0x2eb: 0xa000, 0x2ed: 0xa000, - 0x2f0: 0xa000, 0x2f3: 0xa000, 0x2f5: 0xa000, - 0x2f6: 0xa000, 0x2f7: 0xa000, 0x2f8: 0xa000, 0x2f9: 0x37ec, 0x2fa: 0xa000, - 0x2fe: 0xa000, - // Block 0xc, offset 0x300 - 0x301: 0x374a, 0x302: 0x37ce, - 0x310: 0x3726, 0x311: 0x37aa, - 0x312: 0x372c, 0x313: 0x37b0, 0x316: 0x373e, 0x317: 0x37c2, - 0x318: 0xa000, 0x319: 0xa000, 0x31a: 0x3840, 0x31b: 0x3846, 0x31c: 0x3750, 0x31d: 0x37d4, - 0x31e: 0x3756, 0x31f: 0x37da, 0x322: 0x3762, 0x323: 0x37e6, - 0x324: 0x376e, 0x325: 0x37f2, 0x326: 0x377a, 0x327: 0x37fe, 0x328: 0xa000, 0x329: 0xa000, - 0x32a: 0x384c, 0x32b: 0x3852, 0x32c: 0x37a4, 0x32d: 0x3828, 0x32e: 0x3780, 0x32f: 0x3804, - 0x330: 0x378c, 0x331: 0x3810, 0x332: 0x3792, 0x333: 0x3816, 0x334: 0x3798, 0x335: 0x381c, - 0x338: 0x379e, 0x339: 0x3822, - // Block 0xd, offset 0x340 - 0x351: 0x812e, - 0x352: 0x8133, 0x353: 0x8133, 0x354: 0x8133, 0x355: 0x8133, 0x356: 0x812e, 0x357: 0x8133, - 0x358: 0x8133, 0x359: 0x8133, 0x35a: 0x812f, 0x35b: 0x812e, 0x35c: 0x8133, 0x35d: 0x8133, - 0x35e: 0x8133, 0x35f: 0x8133, 0x360: 0x8133, 0x361: 0x8133, 0x362: 0x812e, 0x363: 0x812e, - 0x364: 0x812e, 0x365: 0x812e, 0x366: 0x812e, 0x367: 0x812e, 0x368: 0x8133, 0x369: 0x8133, - 0x36a: 0x812e, 0x36b: 0x8133, 0x36c: 0x8133, 0x36d: 0x812f, 0x36e: 0x8132, 0x36f: 0x8133, - 0x370: 0x8106, 0x371: 0x8107, 0x372: 0x8108, 0x373: 0x8109, 0x374: 0x810a, 0x375: 0x810b, - 0x376: 0x810c, 0x377: 0x810d, 0x378: 0x810e, 0x379: 0x810f, 0x37a: 0x810f, 0x37b: 0x8110, - 0x37c: 0x8111, 0x37d: 0x8112, 0x37f: 0x8113, - // Block 0xe, offset 0x380 - 0x388: 0xa000, 0x38a: 0xa000, 0x38b: 0x8117, - 0x38c: 0x8118, 0x38d: 0x8119, 0x38e: 0x811a, 0x38f: 0x811b, 0x390: 0x811c, 0x391: 0x811d, - 0x392: 0x811e, 0x393: 0x9933, 0x394: 0x9933, 0x395: 0x992e, 0x396: 0x812e, 0x397: 0x8133, - 0x398: 0x8133, 0x399: 0x8133, 0x39a: 0x8133, 0x39b: 0x8133, 0x39c: 0x812e, 0x39d: 0x8133, - 0x39e: 0x8133, 0x39f: 0x812e, - 0x3b0: 0x811f, - // Block 0xf, offset 0x3c0 - 0x3d3: 0x812e, 0x3d4: 0x8133, 0x3d5: 0x8133, 0x3d6: 0x8133, 0x3d7: 0x8133, - 0x3d8: 0x8133, 0x3d9: 0x8133, 0x3da: 0x8133, 0x3db: 0x8133, 0x3dc: 0x8133, 0x3dd: 0x8133, - 0x3de: 0x8133, 0x3df: 0x8133, 0x3e0: 0x8133, 0x3e1: 0x8133, 0x3e3: 0x812e, - 0x3e4: 0x8133, 0x3e5: 0x8133, 0x3e6: 0x812e, 0x3e7: 0x8133, 0x3e8: 0x8133, 0x3e9: 0x812e, - 0x3ea: 0x8133, 0x3eb: 0x8133, 0x3ec: 0x8133, 0x3ed: 0x812e, 0x3ee: 0x812e, 0x3ef: 0x812e, - 0x3f0: 0x8117, 0x3f1: 0x8118, 0x3f2: 0x8119, 0x3f3: 0x8133, 0x3f4: 0x8133, 0x3f5: 0x8133, - 0x3f6: 0x812e, 0x3f7: 0x8133, 0x3f8: 0x8133, 0x3f9: 0x812e, 0x3fa: 0x812e, 0x3fb: 0x8133, - 0x3fc: 0x8133, 0x3fd: 0x8133, 0x3fe: 0x8133, 0x3ff: 0x8133, - // Block 0x10, offset 0x400 - 0x405: 0xa000, - 0x406: 0x2d33, 0x407: 0xa000, 0x408: 0x2d3b, 0x409: 0xa000, 0x40a: 0x2d43, 0x40b: 0xa000, - 0x40c: 0x2d4b, 0x40d: 0xa000, 0x40e: 0x2d53, 0x411: 0xa000, - 0x412: 0x2d5b, - 0x434: 0x8103, 0x435: 0x9900, - 0x43a: 0xa000, 0x43b: 0x2d63, - 0x43c: 0xa000, 0x43d: 0x2d6b, 0x43e: 0xa000, 0x43f: 0xa000, - // Block 0x11, offset 0x440 - 0x440: 0x8133, 0x441: 0x8133, 0x442: 0x812e, 0x443: 0x8133, 0x444: 0x8133, 0x445: 0x8133, - 0x446: 0x8133, 0x447: 0x8133, 0x448: 0x8133, 0x449: 0x8133, 0x44a: 0x812e, 0x44b: 0x8133, - 0x44c: 0x8133, 0x44d: 0x8136, 0x44e: 0x812b, 0x44f: 0x812e, 0x450: 0x812a, 0x451: 0x8133, - 0x452: 0x8133, 0x453: 0x8133, 0x454: 0x8133, 0x455: 0x8133, 0x456: 0x8133, 0x457: 0x8133, - 0x458: 0x8133, 0x459: 0x8133, 0x45a: 0x8133, 0x45b: 0x8133, 0x45c: 0x8133, 0x45d: 0x8133, - 0x45e: 0x8133, 0x45f: 0x8133, 0x460: 0x8133, 0x461: 0x8133, 0x462: 0x8133, 0x463: 0x8133, - 0x464: 0x8133, 0x465: 0x8133, 0x466: 0x8133, 0x467: 0x8133, 0x468: 0x8133, 0x469: 0x8133, - 0x46a: 0x8133, 0x46b: 0x8133, 0x46c: 0x8133, 0x46d: 0x8133, 0x46e: 0x8133, 0x46f: 0x8133, - 0x470: 0x8133, 0x471: 0x8133, 0x472: 0x8133, 0x473: 0x8133, 0x474: 0x8133, 0x475: 0x8133, - 0x476: 0x8134, 0x477: 0x8132, 0x478: 0x8132, 0x479: 0x812e, 0x47b: 0x8133, - 0x47c: 0x8135, 0x47d: 0x812e, 0x47e: 0x8133, 0x47f: 0x812e, - // Block 0x12, offset 0x480 - 0x480: 0x2fae, 0x481: 0x32ba, 0x482: 0x2fb8, 0x483: 0x32c4, 0x484: 0x2fbd, 0x485: 0x32c9, - 0x486: 0x2fc2, 0x487: 0x32ce, 0x488: 0x38e3, 0x489: 0x3a72, 0x48a: 0x2fdb, 0x48b: 0x32e7, - 0x48c: 0x2fe5, 0x48d: 0x32f1, 0x48e: 0x2ff4, 0x48f: 0x3300, 0x490: 0x2fea, 0x491: 0x32f6, - 0x492: 0x2fef, 0x493: 0x32fb, 0x494: 0x3906, 0x495: 0x3a95, 0x496: 0x390d, 0x497: 0x3a9c, - 0x498: 0x3030, 0x499: 0x333c, 0x49a: 0x3035, 0x49b: 0x3341, 0x49c: 0x391b, 0x49d: 0x3aaa, - 0x49e: 0x303a, 0x49f: 0x3346, 0x4a0: 0x3049, 0x4a1: 0x3355, 0x4a2: 0x3067, 0x4a3: 0x3373, - 0x4a4: 0x3076, 0x4a5: 0x3382, 0x4a6: 0x306c, 0x4a7: 0x3378, 0x4a8: 0x307b, 0x4a9: 0x3387, - 0x4aa: 0x3080, 0x4ab: 0x338c, 0x4ac: 0x30c6, 0x4ad: 0x33d2, 0x4ae: 0x3922, 0x4af: 0x3ab1, - 0x4b0: 0x30d0, 0x4b1: 0x33e1, 0x4b2: 0x30da, 0x4b3: 0x33eb, 0x4b4: 0x30e4, 0x4b5: 0x33f5, - 0x4b6: 0x46db, 0x4b7: 0x476c, 0x4b8: 0x3929, 0x4b9: 0x3ab8, 0x4ba: 0x30fd, 0x4bb: 0x340e, - 0x4bc: 0x30f8, 0x4bd: 0x3409, 0x4be: 0x3102, 0x4bf: 0x3413, - // Block 0x13, offset 0x4c0 - 0x4c0: 0x3107, 0x4c1: 0x3418, 0x4c2: 0x310c, 0x4c3: 0x341d, 0x4c4: 0x3120, 0x4c5: 0x3431, - 0x4c6: 0x312a, 0x4c7: 0x343b, 0x4c8: 0x3139, 0x4c9: 0x344a, 0x4ca: 0x3134, 0x4cb: 0x3445, - 0x4cc: 0x394c, 0x4cd: 0x3adb, 0x4ce: 0x395a, 0x4cf: 0x3ae9, 0x4d0: 0x3961, 0x4d1: 0x3af0, - 0x4d2: 0x3968, 0x4d3: 0x3af7, 0x4d4: 0x3166, 0x4d5: 0x3477, 0x4d6: 0x316b, 0x4d7: 0x347c, - 0x4d8: 0x3175, 0x4d9: 0x3486, 0x4da: 0x4708, 0x4db: 0x4799, 0x4dc: 0x39ae, 0x4dd: 0x3b3d, - 0x4de: 0x318e, 0x4df: 0x349f, 0x4e0: 0x3198, 0x4e1: 0x34a9, 0x4e2: 0x4717, 0x4e3: 0x47a8, - 0x4e4: 0x39b5, 0x4e5: 0x3b44, 0x4e6: 0x39bc, 0x4e7: 0x3b4b, 0x4e8: 0x39c3, 0x4e9: 0x3b52, - 0x4ea: 0x31a7, 0x4eb: 0x34b8, 0x4ec: 0x31b1, 0x4ed: 0x34c7, 0x4ee: 0x31c5, 0x4ef: 0x34db, - 0x4f0: 0x31c0, 0x4f1: 0x34d6, 0x4f2: 0x3201, 0x4f3: 0x3517, 0x4f4: 0x3210, 0x4f5: 0x3526, - 0x4f6: 0x320b, 0x4f7: 0x3521, 0x4f8: 0x39ca, 0x4f9: 0x3b59, 0x4fa: 0x39d1, 0x4fb: 0x3b60, - 0x4fc: 0x3215, 0x4fd: 0x352b, 0x4fe: 0x321a, 0x4ff: 0x3530, - // Block 0x14, offset 0x500 - 0x500: 0x321f, 0x501: 0x3535, 0x502: 0x3224, 0x503: 0x353a, 0x504: 0x3233, 0x505: 0x3549, - 0x506: 0x322e, 0x507: 0x3544, 0x508: 0x3238, 0x509: 0x3553, 0x50a: 0x323d, 0x50b: 0x3558, - 0x50c: 0x3242, 0x50d: 0x355d, 0x50e: 0x3260, 0x50f: 0x357b, 0x510: 0x3279, 0x511: 0x3599, - 0x512: 0x3288, 0x513: 0x35a8, 0x514: 0x328d, 0x515: 0x35ad, 0x516: 0x3391, 0x517: 0x34bd, - 0x518: 0x354e, 0x519: 0x358a, 0x51b: 0x35e8, - 0x520: 0x46b8, 0x521: 0x4749, 0x522: 0x2f9a, 0x523: 0x32a6, - 0x524: 0x388f, 0x525: 0x3a1e, 0x526: 0x3888, 0x527: 0x3a17, 0x528: 0x389d, 0x529: 0x3a2c, - 0x52a: 0x3896, 0x52b: 0x3a25, 0x52c: 0x38d5, 0x52d: 0x3a64, 0x52e: 0x38ab, 0x52f: 0x3a3a, - 0x530: 0x38a4, 0x531: 0x3a33, 0x532: 0x38b9, 0x533: 0x3a48, 0x534: 0x38b2, 0x535: 0x3a41, - 0x536: 0x38dc, 0x537: 0x3a6b, 0x538: 0x46cc, 0x539: 0x475d, 0x53a: 0x3017, 0x53b: 0x3323, - 0x53c: 0x3003, 0x53d: 0x330f, 0x53e: 0x38f1, 0x53f: 0x3a80, - // Block 0x15, offset 0x540 - 0x540: 0x38ea, 0x541: 0x3a79, 0x542: 0x38ff, 0x543: 0x3a8e, 0x544: 0x38f8, 0x545: 0x3a87, - 0x546: 0x3914, 0x547: 0x3aa3, 0x548: 0x30a8, 0x549: 0x33b4, 0x54a: 0x30bc, 0x54b: 0x33c8, - 0x54c: 0x46fe, 0x54d: 0x478f, 0x54e: 0x314d, 0x54f: 0x345e, 0x550: 0x3937, 0x551: 0x3ac6, - 0x552: 0x3930, 0x553: 0x3abf, 0x554: 0x3945, 0x555: 0x3ad4, 0x556: 0x393e, 0x557: 0x3acd, - 0x558: 0x39a0, 0x559: 0x3b2f, 0x55a: 0x3984, 0x55b: 0x3b13, 0x55c: 0x397d, 0x55d: 0x3b0c, - 0x55e: 0x3992, 0x55f: 0x3b21, 0x560: 0x398b, 0x561: 0x3b1a, 0x562: 0x3999, 0x563: 0x3b28, - 0x564: 0x31fc, 0x565: 0x3512, 0x566: 0x31de, 0x567: 0x34f4, 0x568: 0x39fb, 0x569: 0x3b8a, - 0x56a: 0x39f4, 0x56b: 0x3b83, 0x56c: 0x3a09, 0x56d: 0x3b98, 0x56e: 0x3a02, 0x56f: 0x3b91, - 0x570: 0x3a10, 0x571: 0x3b9f, 0x572: 0x3247, 0x573: 0x3562, 0x574: 0x326f, 0x575: 0x358f, - 0x576: 0x326a, 0x577: 0x3585, 0x578: 0x3256, 0x579: 0x3571, - // Block 0x16, offset 0x580 - 0x580: 0x481b, 0x581: 0x4821, 0x582: 0x4935, 0x583: 0x494d, 0x584: 0x493d, 0x585: 0x4955, - 0x586: 0x4945, 0x587: 0x495d, 0x588: 0x47c1, 0x589: 0x47c7, 0x58a: 0x48a5, 0x58b: 0x48bd, - 0x58c: 0x48ad, 0x58d: 0x48c5, 0x58e: 0x48b5, 0x58f: 0x48cd, 0x590: 0x482d, 0x591: 0x4833, - 0x592: 0x3dcf, 0x593: 0x3ddf, 0x594: 0x3dd7, 0x595: 0x3de7, - 0x598: 0x47cd, 0x599: 0x47d3, 0x59a: 0x3cff, 0x59b: 0x3d0f, 0x59c: 0x3d07, 0x59d: 0x3d17, - 0x5a0: 0x4845, 0x5a1: 0x484b, 0x5a2: 0x4965, 0x5a3: 0x497d, - 0x5a4: 0x496d, 0x5a5: 0x4985, 0x5a6: 0x4975, 0x5a7: 0x498d, 0x5a8: 0x47d9, 0x5a9: 0x47df, - 0x5aa: 0x48d5, 0x5ab: 0x48ed, 0x5ac: 0x48dd, 0x5ad: 0x48f5, 0x5ae: 0x48e5, 0x5af: 0x48fd, - 0x5b0: 0x485d, 0x5b1: 0x4863, 0x5b2: 0x3e2f, 0x5b3: 0x3e47, 0x5b4: 0x3e37, 0x5b5: 0x3e4f, - 0x5b6: 0x3e3f, 0x5b7: 0x3e57, 0x5b8: 0x47e5, 0x5b9: 0x47eb, 0x5ba: 0x3d2f, 0x5bb: 0x3d47, - 0x5bc: 0x3d37, 0x5bd: 0x3d4f, 0x5be: 0x3d3f, 0x5bf: 0x3d57, - // Block 0x17, offset 0x5c0 - 0x5c0: 0x4869, 0x5c1: 0x486f, 0x5c2: 0x3e5f, 0x5c3: 0x3e6f, 0x5c4: 0x3e67, 0x5c5: 0x3e77, - 0x5c8: 0x47f1, 0x5c9: 0x47f7, 0x5ca: 0x3d5f, 0x5cb: 0x3d6f, - 0x5cc: 0x3d67, 0x5cd: 0x3d77, 0x5d0: 0x487b, 0x5d1: 0x4881, - 0x5d2: 0x3e97, 0x5d3: 0x3eaf, 0x5d4: 0x3e9f, 0x5d5: 0x3eb7, 0x5d6: 0x3ea7, 0x5d7: 0x3ebf, - 0x5d9: 0x47fd, 0x5db: 0x3d7f, 0x5dd: 0x3d87, - 0x5df: 0x3d8f, 0x5e0: 0x4893, 0x5e1: 0x4899, 0x5e2: 0x4995, 0x5e3: 0x49ad, - 0x5e4: 0x499d, 0x5e5: 0x49b5, 0x5e6: 0x49a5, 0x5e7: 0x49bd, 0x5e8: 0x4803, 0x5e9: 0x4809, - 0x5ea: 0x4905, 0x5eb: 0x491d, 0x5ec: 0x490d, 0x5ed: 0x4925, 0x5ee: 0x4915, 0x5ef: 0x492d, - 0x5f0: 0x480f, 0x5f1: 0x4335, 0x5f2: 0x36a8, 0x5f3: 0x433b, 0x5f4: 0x4839, 0x5f5: 0x4341, - 0x5f6: 0x36ba, 0x5f7: 0x4347, 0x5f8: 0x36d8, 0x5f9: 0x434d, 0x5fa: 0x36f0, 0x5fb: 0x4353, - 0x5fc: 0x4887, 0x5fd: 0x4359, - // Block 0x18, offset 0x600 - 0x600: 0x3db7, 0x601: 0x3dbf, 0x602: 0x419b, 0x603: 0x41b9, 0x604: 0x41a5, 0x605: 0x41c3, - 0x606: 0x41af, 0x607: 0x41cd, 0x608: 0x3cef, 0x609: 0x3cf7, 0x60a: 0x40e7, 0x60b: 0x4105, - 0x60c: 0x40f1, 0x60d: 0x410f, 0x60e: 0x40fb, 0x60f: 0x4119, 0x610: 0x3dff, 0x611: 0x3e07, - 0x612: 0x41d7, 0x613: 0x41f5, 0x614: 0x41e1, 0x615: 0x41ff, 0x616: 0x41eb, 0x617: 0x4209, - 0x618: 0x3d1f, 0x619: 0x3d27, 0x61a: 0x4123, 0x61b: 0x4141, 0x61c: 0x412d, 0x61d: 0x414b, - 0x61e: 0x4137, 0x61f: 0x4155, 0x620: 0x3ed7, 0x621: 0x3edf, 0x622: 0x4213, 0x623: 0x4231, - 0x624: 0x421d, 0x625: 0x423b, 0x626: 0x4227, 0x627: 0x4245, 0x628: 0x3d97, 0x629: 0x3d9f, - 0x62a: 0x415f, 0x62b: 0x417d, 0x62c: 0x4169, 0x62d: 0x4187, 0x62e: 0x4173, 0x62f: 0x4191, - 0x630: 0x369c, 0x631: 0x3696, 0x632: 0x3da7, 0x633: 0x36a2, 0x634: 0x3daf, - 0x636: 0x4827, 0x637: 0x3dc7, 0x638: 0x360c, 0x639: 0x3606, 0x63a: 0x35fa, 0x63b: 0x4305, - 0x63c: 0x3612, 0x63d: 0x8100, 0x63e: 0x01d6, 0x63f: 0xa100, - // Block 0x19, offset 0x640 - 0x640: 0x8100, 0x641: 0x35be, 0x642: 0x3def, 0x643: 0x36b4, 0x644: 0x3df7, - 0x646: 0x4851, 0x647: 0x3e0f, 0x648: 0x3618, 0x649: 0x430b, 0x64a: 0x3624, 0x64b: 0x4311, - 0x64c: 0x3630, 0x64d: 0x3ba6, 0x64e: 0x3bad, 0x64f: 0x3bb4, 0x650: 0x36cc, 0x651: 0x36c6, - 0x652: 0x3e17, 0x653: 0x44fb, 0x656: 0x36d2, 0x657: 0x3e27, - 0x658: 0x3648, 0x659: 0x3642, 0x65a: 0x3636, 0x65b: 0x4317, 0x65d: 0x3bbb, - 0x65e: 0x3bc2, 0x65f: 0x3bc9, 0x660: 0x3702, 0x661: 0x36fc, 0x662: 0x3e7f, 0x663: 0x4503, - 0x664: 0x36e4, 0x665: 0x36ea, 0x666: 0x3708, 0x667: 0x3e8f, 0x668: 0x3678, 0x669: 0x3672, - 0x66a: 0x3666, 0x66b: 0x4323, 0x66c: 0x3660, 0x66d: 0x35b2, 0x66e: 0x42ff, 0x66f: 0x0081, - 0x672: 0x3ec7, 0x673: 0x370e, 0x674: 0x3ecf, - 0x676: 0x489f, 0x677: 0x3ee7, 0x678: 0x3654, 0x679: 0x431d, 0x67a: 0x3684, 0x67b: 0x432f, - 0x67c: 0x3690, 0x67d: 0x426d, 0x67e: 0xa100, - // Block 0x1a, offset 0x680 - 0x681: 0x3c1d, 0x683: 0xa000, 0x684: 0x3c24, 0x685: 0xa000, - 0x687: 0x3c2b, 0x688: 0xa000, 0x689: 0x3c32, - 0x68d: 0xa000, - 0x6a0: 0x2f7c, 0x6a1: 0xa000, 0x6a2: 0x3c40, - 0x6a4: 0xa000, 0x6a5: 0xa000, - 0x6ad: 0x3c39, 0x6ae: 0x2f77, 0x6af: 0x2f81, - 0x6b0: 0x3c47, 0x6b1: 0x3c4e, 0x6b2: 0xa000, 0x6b3: 0xa000, 0x6b4: 0x3c55, 0x6b5: 0x3c5c, - 0x6b6: 0xa000, 0x6b7: 0xa000, 0x6b8: 0x3c63, 0x6b9: 0x3c6a, 0x6ba: 0xa000, 0x6bb: 0xa000, - 0x6bc: 0xa000, 0x6bd: 0xa000, - // Block 0x1b, offset 0x6c0 - 0x6c0: 0x3c71, 0x6c1: 0x3c78, 0x6c2: 0xa000, 0x6c3: 0xa000, 0x6c4: 0x3c8d, 0x6c5: 0x3c94, - 0x6c6: 0xa000, 0x6c7: 0xa000, 0x6c8: 0x3c9b, 0x6c9: 0x3ca2, - 0x6d1: 0xa000, - 0x6d2: 0xa000, - 0x6e2: 0xa000, - 0x6e8: 0xa000, 0x6e9: 0xa000, - 0x6eb: 0xa000, 0x6ec: 0x3cb7, 0x6ed: 0x3cbe, 0x6ee: 0x3cc5, 0x6ef: 0x3ccc, - 0x6f2: 0xa000, 0x6f3: 0xa000, 0x6f4: 0xa000, 0x6f5: 0xa000, - // Block 0x1c, offset 0x700 - 0x706: 0xa000, 0x70b: 0xa000, - 0x70c: 0x3f1f, 0x70d: 0xa000, 0x70e: 0x3f27, 0x70f: 0xa000, 0x710: 0x3f2f, 0x711: 0xa000, - 0x712: 0x3f37, 0x713: 0xa000, 0x714: 0x3f3f, 0x715: 0xa000, 0x716: 0x3f47, 0x717: 0xa000, - 0x718: 0x3f4f, 0x719: 0xa000, 0x71a: 0x3f57, 0x71b: 0xa000, 0x71c: 0x3f5f, 0x71d: 0xa000, - 0x71e: 0x3f67, 0x71f: 0xa000, 0x720: 0x3f6f, 0x721: 0xa000, 0x722: 0x3f77, - 0x724: 0xa000, 0x725: 0x3f7f, 0x726: 0xa000, 0x727: 0x3f87, 0x728: 0xa000, 0x729: 0x3f8f, - 0x72f: 0xa000, - 0x730: 0x3f97, 0x731: 0x3f9f, 0x732: 0xa000, 0x733: 0x3fa7, 0x734: 0x3faf, 0x735: 0xa000, - 0x736: 0x3fb7, 0x737: 0x3fbf, 0x738: 0xa000, 0x739: 0x3fc7, 0x73a: 0x3fcf, 0x73b: 0xa000, - 0x73c: 0x3fd7, 0x73d: 0x3fdf, - // Block 0x1d, offset 0x740 - 0x754: 0x3f17, - 0x759: 0x9904, 0x75a: 0x9904, 0x75b: 0x8100, 0x75c: 0x8100, 0x75d: 0xa000, - 0x75e: 0x3fe7, - 0x766: 0xa000, - 0x76b: 0xa000, 0x76c: 0x3ff7, 0x76d: 0xa000, 0x76e: 0x3fff, 0x76f: 0xa000, - 0x770: 0x4007, 0x771: 0xa000, 0x772: 0x400f, 0x773: 0xa000, 0x774: 0x4017, 0x775: 0xa000, - 0x776: 0x401f, 0x777: 0xa000, 0x778: 0x4027, 0x779: 0xa000, 0x77a: 0x402f, 0x77b: 0xa000, - 0x77c: 0x4037, 0x77d: 0xa000, 0x77e: 0x403f, 0x77f: 0xa000, - // Block 0x1e, offset 0x780 - 0x780: 0x4047, 0x781: 0xa000, 0x782: 0x404f, 0x784: 0xa000, 0x785: 0x4057, - 0x786: 0xa000, 0x787: 0x405f, 0x788: 0xa000, 0x789: 0x4067, - 0x78f: 0xa000, 0x790: 0x406f, 0x791: 0x4077, - 0x792: 0xa000, 0x793: 0x407f, 0x794: 0x4087, 0x795: 0xa000, 0x796: 0x408f, 0x797: 0x4097, - 0x798: 0xa000, 0x799: 0x409f, 0x79a: 0x40a7, 0x79b: 0xa000, 0x79c: 0x40af, 0x79d: 0x40b7, - 0x7af: 0xa000, - 0x7b0: 0xa000, 0x7b1: 0xa000, 0x7b2: 0xa000, 0x7b4: 0x3fef, - 0x7b7: 0x40bf, 0x7b8: 0x40c7, 0x7b9: 0x40cf, 0x7ba: 0x40d7, - 0x7bd: 0xa000, 0x7be: 0x40df, - // Block 0x1f, offset 0x7c0 - 0x7c0: 0x137a, 0x7c1: 0x0cfe, 0x7c2: 0x13d6, 0x7c3: 0x13a2, 0x7c4: 0x0e5a, 0x7c5: 0x06ee, - 0x7c6: 0x08e2, 0x7c7: 0x162e, 0x7c8: 0x162e, 0x7c9: 0x0a0e, 0x7ca: 0x1462, 0x7cb: 0x0946, - 0x7cc: 0x0a0a, 0x7cd: 0x0bf2, 0x7ce: 0x0fd2, 0x7cf: 0x1162, 0x7d0: 0x129a, 0x7d1: 0x12d6, - 0x7d2: 0x130a, 0x7d3: 0x141e, 0x7d4: 0x0d76, 0x7d5: 0x0e02, 0x7d6: 0x0eae, 0x7d7: 0x0f46, - 0x7d8: 0x1262, 0x7d9: 0x144a, 0x7da: 0x1576, 0x7db: 0x0712, 0x7dc: 0x08b6, 0x7dd: 0x0d8a, - 0x7de: 0x0ed2, 0x7df: 0x1296, 0x7e0: 0x15c6, 0x7e1: 0x0ab6, 0x7e2: 0x0e7a, 0x7e3: 0x1286, - 0x7e4: 0x131a, 0x7e5: 0x0c26, 0x7e6: 0x11be, 0x7e7: 0x12e2, 0x7e8: 0x0b22, 0x7e9: 0x0d12, - 0x7ea: 0x0e1a, 0x7eb: 0x0f1e, 0x7ec: 0x142a, 0x7ed: 0x0752, 0x7ee: 0x07ea, 0x7ef: 0x0856, - 0x7f0: 0x0c8e, 0x7f1: 0x0d82, 0x7f2: 0x0ece, 0x7f3: 0x0ff2, 0x7f4: 0x117a, 0x7f5: 0x128e, - 0x7f6: 0x12a6, 0x7f7: 0x13ca, 0x7f8: 0x14f2, 0x7f9: 0x15a6, 0x7fa: 0x15c2, 0x7fb: 0x102e, - 0x7fc: 0x106e, 0x7fd: 0x1126, 0x7fe: 0x1246, 0x7ff: 0x147e, - // Block 0x20, offset 0x800 - 0x800: 0x15ce, 0x801: 0x134e, 0x802: 0x09ca, 0x803: 0x0b3e, 0x804: 0x10de, 0x805: 0x119e, - 0x806: 0x0f02, 0x807: 0x1036, 0x808: 0x139a, 0x809: 0x14ea, 0x80a: 0x09c6, 0x80b: 0x0a92, - 0x80c: 0x0d7a, 0x80d: 0x0e2e, 0x80e: 0x0e62, 0x80f: 0x1116, 0x810: 0x113e, 0x811: 0x14aa, - 0x812: 0x0852, 0x813: 0x11aa, 0x814: 0x07f6, 0x815: 0x07f2, 0x816: 0x109a, 0x817: 0x112a, - 0x818: 0x125e, 0x819: 0x14b2, 0x81a: 0x136a, 0x81b: 0x0c2a, 0x81c: 0x0d76, 0x81d: 0x135a, - 0x81e: 0x06fa, 0x81f: 0x0a66, 0x820: 0x0b96, 0x821: 0x0f32, 0x822: 0x0fb2, 0x823: 0x0876, - 0x824: 0x103e, 0x825: 0x0762, 0x826: 0x0b7a, 0x827: 0x06da, 0x828: 0x0dee, 0x829: 0x0ca6, - 0x82a: 0x1112, 0x82b: 0x08ca, 0x82c: 0x09b6, 0x82d: 0x0ffe, 0x82e: 0x1266, 0x82f: 0x133e, - 0x830: 0x0dba, 0x831: 0x13fa, 0x832: 0x0de6, 0x833: 0x0c3a, 0x834: 0x121e, 0x835: 0x0c5a, - 0x836: 0x0fae, 0x837: 0x072e, 0x838: 0x07aa, 0x839: 0x07ee, 0x83a: 0x0d56, 0x83b: 0x10fe, - 0x83c: 0x11f6, 0x83d: 0x134a, 0x83e: 0x145e, 0x83f: 0x085e, - // Block 0x21, offset 0x840 - 0x840: 0x0912, 0x841: 0x0a1a, 0x842: 0x0b32, 0x843: 0x0cc2, 0x844: 0x0e7e, 0x845: 0x1042, - 0x846: 0x149a, 0x847: 0x157e, 0x848: 0x15d2, 0x849: 0x15ea, 0x84a: 0x083a, 0x84b: 0x0cf6, - 0x84c: 0x0da6, 0x84d: 0x13ee, 0x84e: 0x0afe, 0x84f: 0x0bda, 0x850: 0x0bf6, 0x851: 0x0c86, - 0x852: 0x0e6e, 0x853: 0x0eba, 0x854: 0x0f6a, 0x855: 0x108e, 0x856: 0x1132, 0x857: 0x1196, - 0x858: 0x13de, 0x859: 0x126e, 0x85a: 0x1406, 0x85b: 0x1482, 0x85c: 0x0812, 0x85d: 0x083e, - 0x85e: 0x0926, 0x85f: 0x0eaa, 0x860: 0x12f6, 0x861: 0x133e, 0x862: 0x0b1e, 0x863: 0x0b8e, - 0x864: 0x0c52, 0x865: 0x0db2, 0x866: 0x10da, 0x867: 0x0f26, 0x868: 0x073e, 0x869: 0x0982, - 0x86a: 0x0a66, 0x86b: 0x0aca, 0x86c: 0x0b9a, 0x86d: 0x0f42, 0x86e: 0x0f5e, 0x86f: 0x116e, - 0x870: 0x118e, 0x871: 0x1466, 0x872: 0x14e6, 0x873: 0x14f6, 0x874: 0x1532, 0x875: 0x0756, - 0x876: 0x1082, 0x877: 0x1452, 0x878: 0x14ce, 0x879: 0x0bb2, 0x87a: 0x071a, 0x87b: 0x077a, - 0x87c: 0x0a6a, 0x87d: 0x0a8a, 0x87e: 0x0cb2, 0x87f: 0x0d76, - // Block 0x22, offset 0x880 - 0x880: 0x0ec6, 0x881: 0x0fce, 0x882: 0x127a, 0x883: 0x141a, 0x884: 0x1626, 0x885: 0x0ce6, - 0x886: 0x14a6, 0x887: 0x0836, 0x888: 0x0d32, 0x889: 0x0d3e, 0x88a: 0x0e12, 0x88b: 0x0e4a, - 0x88c: 0x0f4e, 0x88d: 0x0faa, 0x88e: 0x102a, 0x88f: 0x110e, 0x890: 0x153e, 0x891: 0x07b2, - 0x892: 0x0c06, 0x893: 0x14b6, 0x894: 0x076a, 0x895: 0x0aae, 0x896: 0x0e32, 0x897: 0x13e2, - 0x898: 0x0b6a, 0x899: 0x0bba, 0x89a: 0x0d46, 0x89b: 0x0f32, 0x89c: 0x14be, 0x89d: 0x081a, - 0x89e: 0x0902, 0x89f: 0x0a9a, 0x8a0: 0x0cd6, 0x8a1: 0x0d22, 0x8a2: 0x0d62, 0x8a3: 0x0df6, - 0x8a4: 0x0f4a, 0x8a5: 0x0fbe, 0x8a6: 0x115a, 0x8a7: 0x12fa, 0x8a8: 0x1306, 0x8a9: 0x145a, - 0x8aa: 0x14da, 0x8ab: 0x0886, 0x8ac: 0x0e4e, 0x8ad: 0x0906, 0x8ae: 0x0eca, 0x8af: 0x0f6e, - 0x8b0: 0x128a, 0x8b1: 0x14c2, 0x8b2: 0x15ae, 0x8b3: 0x15d6, 0x8b4: 0x0d3a, 0x8b5: 0x0e2a, - 0x8b6: 0x11c6, 0x8b7: 0x10ba, 0x8b8: 0x10c6, 0x8b9: 0x10ea, 0x8ba: 0x0f1a, 0x8bb: 0x0ea2, - 0x8bc: 0x1366, 0x8bd: 0x0736, 0x8be: 0x122e, 0x8bf: 0x081e, - // Block 0x23, offset 0x8c0 - 0x8c0: 0x080e, 0x8c1: 0x0b0e, 0x8c2: 0x0c2e, 0x8c3: 0x10f6, 0x8c4: 0x0a56, 0x8c5: 0x0e06, - 0x8c6: 0x0cf2, 0x8c7: 0x13ea, 0x8c8: 0x12ea, 0x8c9: 0x14ae, 0x8ca: 0x1326, 0x8cb: 0x0b2a, - 0x8cc: 0x078a, 0x8cd: 0x095e, 0x8d0: 0x09b2, - 0x8d2: 0x0ce2, 0x8d5: 0x07fa, 0x8d6: 0x0f22, 0x8d7: 0x0fe6, - 0x8d8: 0x104a, 0x8d9: 0x1066, 0x8da: 0x106a, 0x8db: 0x107e, 0x8dc: 0x14fe, 0x8dd: 0x10ee, - 0x8de: 0x1172, 0x8e0: 0x1292, 0x8e2: 0x1356, - 0x8e5: 0x140a, 0x8e6: 0x1436, - 0x8ea: 0x1552, 0x8eb: 0x1556, 0x8ec: 0x155a, 0x8ed: 0x15be, 0x8ee: 0x142e, 0x8ef: 0x14ca, - 0x8f0: 0x075a, 0x8f1: 0x077e, 0x8f2: 0x0792, 0x8f3: 0x084e, 0x8f4: 0x085a, 0x8f5: 0x089a, - 0x8f6: 0x094e, 0x8f7: 0x096a, 0x8f8: 0x0972, 0x8f9: 0x09ae, 0x8fa: 0x09ba, 0x8fb: 0x0a96, - 0x8fc: 0x0a9e, 0x8fd: 0x0ba6, 0x8fe: 0x0bce, 0x8ff: 0x0bd6, - // Block 0x24, offset 0x900 - 0x900: 0x0bee, 0x901: 0x0c9a, 0x902: 0x0cca, 0x903: 0x0cea, 0x904: 0x0d5a, 0x905: 0x0e1e, - 0x906: 0x0e3a, 0x907: 0x0e6a, 0x908: 0x0ebe, 0x909: 0x0ede, 0x90a: 0x0f52, 0x90b: 0x1032, - 0x90c: 0x104e, 0x90d: 0x1056, 0x90e: 0x1052, 0x90f: 0x105a, 0x910: 0x105e, 0x911: 0x1062, - 0x912: 0x1076, 0x913: 0x107a, 0x914: 0x109e, 0x915: 0x10b2, 0x916: 0x10ce, 0x917: 0x1132, - 0x918: 0x113a, 0x919: 0x1142, 0x91a: 0x1156, 0x91b: 0x117e, 0x91c: 0x11ce, 0x91d: 0x1202, - 0x91e: 0x1202, 0x91f: 0x126a, 0x920: 0x1312, 0x921: 0x132a, 0x922: 0x135e, 0x923: 0x1362, - 0x924: 0x13a6, 0x925: 0x13aa, 0x926: 0x1402, 0x927: 0x140a, 0x928: 0x14de, 0x929: 0x1522, - 0x92a: 0x153a, 0x92b: 0x0b9e, 0x92c: 0x1721, 0x92d: 0x11e6, - 0x930: 0x06e2, 0x931: 0x07e6, 0x932: 0x07a6, 0x933: 0x074e, 0x934: 0x078e, 0x935: 0x07ba, - 0x936: 0x084a, 0x937: 0x0866, 0x938: 0x094e, 0x939: 0x093a, 0x93a: 0x094a, 0x93b: 0x0966, - 0x93c: 0x09b2, 0x93d: 0x09c2, 0x93e: 0x0a06, 0x93f: 0x0a12, - // Block 0x25, offset 0x940 - 0x940: 0x0a2e, 0x941: 0x0a3e, 0x942: 0x0b26, 0x943: 0x0b2e, 0x944: 0x0b5e, 0x945: 0x0b7e, - 0x946: 0x0bae, 0x947: 0x0bc6, 0x948: 0x0bb6, 0x949: 0x0bd6, 0x94a: 0x0bca, 0x94b: 0x0bee, - 0x94c: 0x0c0a, 0x94d: 0x0c62, 0x94e: 0x0c6e, 0x94f: 0x0c76, 0x950: 0x0c9e, 0x951: 0x0ce2, - 0x952: 0x0d12, 0x953: 0x0d16, 0x954: 0x0d2a, 0x955: 0x0daa, 0x956: 0x0dba, 0x957: 0x0e12, - 0x958: 0x0e5e, 0x959: 0x0e56, 0x95a: 0x0e6a, 0x95b: 0x0e86, 0x95c: 0x0ebe, 0x95d: 0x1016, - 0x95e: 0x0ee2, 0x95f: 0x0f16, 0x960: 0x0f22, 0x961: 0x0f62, 0x962: 0x0f7e, 0x963: 0x0fa2, - 0x964: 0x0fc6, 0x965: 0x0fca, 0x966: 0x0fe6, 0x967: 0x0fea, 0x968: 0x0ffa, 0x969: 0x100e, - 0x96a: 0x100a, 0x96b: 0x103a, 0x96c: 0x10b6, 0x96d: 0x10ce, 0x96e: 0x10e6, 0x96f: 0x111e, - 0x970: 0x1132, 0x971: 0x114e, 0x972: 0x117e, 0x973: 0x1232, 0x974: 0x125a, 0x975: 0x12ce, - 0x976: 0x1316, 0x977: 0x1322, 0x978: 0x132a, 0x979: 0x1342, 0x97a: 0x1356, 0x97b: 0x1346, - 0x97c: 0x135e, 0x97d: 0x135a, 0x97e: 0x1352, 0x97f: 0x1362, - // Block 0x26, offset 0x980 - 0x980: 0x136e, 0x981: 0x13aa, 0x982: 0x13e6, 0x983: 0x1416, 0x984: 0x144e, 0x985: 0x146e, - 0x986: 0x14ba, 0x987: 0x14de, 0x988: 0x14fe, 0x989: 0x1512, 0x98a: 0x1522, 0x98b: 0x152e, - 0x98c: 0x153a, 0x98d: 0x158e, 0x98e: 0x162e, 0x98f: 0x16b8, 0x990: 0x16b3, 0x991: 0x16e5, - 0x992: 0x060a, 0x993: 0x0632, 0x994: 0x0636, 0x995: 0x1767, 0x996: 0x1794, 0x997: 0x180c, - 0x998: 0x161a, 0x999: 0x162a, - // Block 0x27, offset 0x9c0 - 0x9c0: 0x06fe, 0x9c1: 0x06f6, 0x9c2: 0x0706, 0x9c3: 0x164a, 0x9c4: 0x074a, 0x9c5: 0x075a, - 0x9c6: 0x075e, 0x9c7: 0x0766, 0x9c8: 0x076e, 0x9c9: 0x0772, 0x9ca: 0x077e, 0x9cb: 0x0776, - 0x9cc: 0x05b6, 0x9cd: 0x165e, 0x9ce: 0x0792, 0x9cf: 0x0796, 0x9d0: 0x079a, 0x9d1: 0x07b6, - 0x9d2: 0x164f, 0x9d3: 0x05ba, 0x9d4: 0x07a2, 0x9d5: 0x07c2, 0x9d6: 0x1659, 0x9d7: 0x07d2, - 0x9d8: 0x07da, 0x9d9: 0x073a, 0x9da: 0x07e2, 0x9db: 0x07e6, 0x9dc: 0x1834, 0x9dd: 0x0802, - 0x9de: 0x080a, 0x9df: 0x05c2, 0x9e0: 0x0822, 0x9e1: 0x0826, 0x9e2: 0x082e, 0x9e3: 0x0832, - 0x9e4: 0x05c6, 0x9e5: 0x084a, 0x9e6: 0x084e, 0x9e7: 0x085a, 0x9e8: 0x0866, 0x9e9: 0x086a, - 0x9ea: 0x086e, 0x9eb: 0x0876, 0x9ec: 0x0896, 0x9ed: 0x089a, 0x9ee: 0x08a2, 0x9ef: 0x08b2, - 0x9f0: 0x08ba, 0x9f1: 0x08be, 0x9f2: 0x08be, 0x9f3: 0x08be, 0x9f4: 0x166d, 0x9f5: 0x0e96, - 0x9f6: 0x08d2, 0x9f7: 0x08da, 0x9f8: 0x1672, 0x9f9: 0x08e6, 0x9fa: 0x08ee, 0x9fb: 0x08f6, - 0x9fc: 0x091e, 0x9fd: 0x090a, 0x9fe: 0x0916, 0x9ff: 0x091a, - // Block 0x28, offset 0xa00 - 0xa00: 0x0922, 0xa01: 0x092a, 0xa02: 0x092e, 0xa03: 0x0936, 0xa04: 0x093e, 0xa05: 0x0942, - 0xa06: 0x0942, 0xa07: 0x094a, 0xa08: 0x0952, 0xa09: 0x0956, 0xa0a: 0x0962, 0xa0b: 0x0986, - 0xa0c: 0x096a, 0xa0d: 0x098a, 0xa0e: 0x096e, 0xa0f: 0x0976, 0xa10: 0x080e, 0xa11: 0x09d2, - 0xa12: 0x099a, 0xa13: 0x099e, 0xa14: 0x09a2, 0xa15: 0x0996, 0xa16: 0x09aa, 0xa17: 0x09a6, - 0xa18: 0x09be, 0xa19: 0x1677, 0xa1a: 0x09da, 0xa1b: 0x09de, 0xa1c: 0x09e6, 0xa1d: 0x09f2, - 0xa1e: 0x09fa, 0xa1f: 0x0a16, 0xa20: 0x167c, 0xa21: 0x1681, 0xa22: 0x0a22, 0xa23: 0x0a26, - 0xa24: 0x0a2a, 0xa25: 0x0a1e, 0xa26: 0x0a32, 0xa27: 0x05ca, 0xa28: 0x05ce, 0xa29: 0x0a3a, - 0xa2a: 0x0a42, 0xa2b: 0x0a42, 0xa2c: 0x1686, 0xa2d: 0x0a5e, 0xa2e: 0x0a62, 0xa2f: 0x0a66, - 0xa30: 0x0a6e, 0xa31: 0x168b, 0xa32: 0x0a76, 0xa33: 0x0a7a, 0xa34: 0x0b52, 0xa35: 0x0a82, - 0xa36: 0x05d2, 0xa37: 0x0a8e, 0xa38: 0x0a9e, 0xa39: 0x0aaa, 0xa3a: 0x0aa6, 0xa3b: 0x1695, - 0xa3c: 0x0ab2, 0xa3d: 0x169a, 0xa3e: 0x0abe, 0xa3f: 0x0aba, - // Block 0x29, offset 0xa40 - 0xa40: 0x0ac2, 0xa41: 0x0ad2, 0xa42: 0x0ad6, 0xa43: 0x05d6, 0xa44: 0x0ae6, 0xa45: 0x0aee, - 0xa46: 0x0af2, 0xa47: 0x0af6, 0xa48: 0x05da, 0xa49: 0x169f, 0xa4a: 0x05de, 0xa4b: 0x0b12, - 0xa4c: 0x0b16, 0xa4d: 0x0b1a, 0xa4e: 0x0b22, 0xa4f: 0x1866, 0xa50: 0x0b3a, 0xa51: 0x16a9, - 0xa52: 0x16a9, 0xa53: 0x11da, 0xa54: 0x0b4a, 0xa55: 0x0b4a, 0xa56: 0x05e2, 0xa57: 0x16cc, - 0xa58: 0x179e, 0xa59: 0x0b5a, 0xa5a: 0x0b62, 0xa5b: 0x05e6, 0xa5c: 0x0b76, 0xa5d: 0x0b86, - 0xa5e: 0x0b8a, 0xa5f: 0x0b92, 0xa60: 0x0ba2, 0xa61: 0x05ee, 0xa62: 0x05ea, 0xa63: 0x0ba6, - 0xa64: 0x16ae, 0xa65: 0x0baa, 0xa66: 0x0bbe, 0xa67: 0x0bc2, 0xa68: 0x0bc6, 0xa69: 0x0bc2, - 0xa6a: 0x0bd2, 0xa6b: 0x0bd6, 0xa6c: 0x0be6, 0xa6d: 0x0bde, 0xa6e: 0x0be2, 0xa6f: 0x0bea, - 0xa70: 0x0bee, 0xa71: 0x0bf2, 0xa72: 0x0bfe, 0xa73: 0x0c02, 0xa74: 0x0c1a, 0xa75: 0x0c22, - 0xa76: 0x0c32, 0xa77: 0x0c46, 0xa78: 0x16bd, 0xa79: 0x0c42, 0xa7a: 0x0c36, 0xa7b: 0x0c4e, - 0xa7c: 0x0c56, 0xa7d: 0x0c6a, 0xa7e: 0x16c2, 0xa7f: 0x0c72, - // Block 0x2a, offset 0xa80 - 0xa80: 0x0c66, 0xa81: 0x0c5e, 0xa82: 0x05f2, 0xa83: 0x0c7a, 0xa84: 0x0c82, 0xa85: 0x0c8a, - 0xa86: 0x0c7e, 0xa87: 0x05f6, 0xa88: 0x0c9a, 0xa89: 0x0ca2, 0xa8a: 0x16c7, 0xa8b: 0x0cce, - 0xa8c: 0x0d02, 0xa8d: 0x0cde, 0xa8e: 0x0602, 0xa8f: 0x0cea, 0xa90: 0x05fe, 0xa91: 0x05fa, - 0xa92: 0x07c6, 0xa93: 0x07ca, 0xa94: 0x0d06, 0xa95: 0x0cee, 0xa96: 0x11ae, 0xa97: 0x0666, - 0xa98: 0x0d12, 0xa99: 0x0d16, 0xa9a: 0x0d1a, 0xa9b: 0x0d2e, 0xa9c: 0x0d26, 0xa9d: 0x16e0, - 0xa9e: 0x0606, 0xa9f: 0x0d42, 0xaa0: 0x0d36, 0xaa1: 0x0d52, 0xaa2: 0x0d5a, 0xaa3: 0x16ea, - 0xaa4: 0x0d5e, 0xaa5: 0x0d4a, 0xaa6: 0x0d66, 0xaa7: 0x060a, 0xaa8: 0x0d6a, 0xaa9: 0x0d6e, - 0xaaa: 0x0d72, 0xaab: 0x0d7e, 0xaac: 0x16ef, 0xaad: 0x0d86, 0xaae: 0x060e, 0xaaf: 0x0d92, - 0xab0: 0x16f4, 0xab1: 0x0d96, 0xab2: 0x0612, 0xab3: 0x0da2, 0xab4: 0x0dae, 0xab5: 0x0dba, - 0xab6: 0x0dbe, 0xab7: 0x16f9, 0xab8: 0x1690, 0xab9: 0x16fe, 0xaba: 0x0dde, 0xabb: 0x1703, - 0xabc: 0x0dea, 0xabd: 0x0df2, 0xabe: 0x0de2, 0xabf: 0x0dfe, - // Block 0x2b, offset 0xac0 - 0xac0: 0x0e0e, 0xac1: 0x0e1e, 0xac2: 0x0e12, 0xac3: 0x0e16, 0xac4: 0x0e22, 0xac5: 0x0e26, - 0xac6: 0x1708, 0xac7: 0x0e0a, 0xac8: 0x0e3e, 0xac9: 0x0e42, 0xaca: 0x0616, 0xacb: 0x0e56, - 0xacc: 0x0e52, 0xacd: 0x170d, 0xace: 0x0e36, 0xacf: 0x0e72, 0xad0: 0x1712, 0xad1: 0x1717, - 0xad2: 0x0e76, 0xad3: 0x0e8a, 0xad4: 0x0e86, 0xad5: 0x0e82, 0xad6: 0x061a, 0xad7: 0x0e8e, - 0xad8: 0x0e9e, 0xad9: 0x0e9a, 0xada: 0x0ea6, 0xadb: 0x1654, 0xadc: 0x0eb6, 0xadd: 0x171c, - 0xade: 0x0ec2, 0xadf: 0x1726, 0xae0: 0x0ed6, 0xae1: 0x0ee2, 0xae2: 0x0ef6, 0xae3: 0x172b, - 0xae4: 0x0f0a, 0xae5: 0x0f0e, 0xae6: 0x1730, 0xae7: 0x1735, 0xae8: 0x0f2a, 0xae9: 0x0f3a, - 0xaea: 0x061e, 0xaeb: 0x0f3e, 0xaec: 0x0622, 0xaed: 0x0622, 0xaee: 0x0f56, 0xaef: 0x0f5a, - 0xaf0: 0x0f62, 0xaf1: 0x0f66, 0xaf2: 0x0f72, 0xaf3: 0x0626, 0xaf4: 0x0f8a, 0xaf5: 0x173a, - 0xaf6: 0x0fa6, 0xaf7: 0x173f, 0xaf8: 0x0fb2, 0xaf9: 0x16a4, 0xafa: 0x0fc2, 0xafb: 0x1744, - 0xafc: 0x1749, 0xafd: 0x174e, 0xafe: 0x062a, 0xaff: 0x062e, - // Block 0x2c, offset 0xb00 - 0xb00: 0x0ffa, 0xb01: 0x1758, 0xb02: 0x1753, 0xb03: 0x175d, 0xb04: 0x1762, 0xb05: 0x1002, - 0xb06: 0x1006, 0xb07: 0x1006, 0xb08: 0x100e, 0xb09: 0x0636, 0xb0a: 0x1012, 0xb0b: 0x063a, - 0xb0c: 0x063e, 0xb0d: 0x176c, 0xb0e: 0x1026, 0xb0f: 0x102e, 0xb10: 0x103a, 0xb11: 0x0642, - 0xb12: 0x1771, 0xb13: 0x105e, 0xb14: 0x1776, 0xb15: 0x177b, 0xb16: 0x107e, 0xb17: 0x1096, - 0xb18: 0x0646, 0xb19: 0x109e, 0xb1a: 0x10a2, 0xb1b: 0x10a6, 0xb1c: 0x1780, 0xb1d: 0x1785, - 0xb1e: 0x1785, 0xb1f: 0x10be, 0xb20: 0x064a, 0xb21: 0x178a, 0xb22: 0x10d2, 0xb23: 0x10d6, - 0xb24: 0x064e, 0xb25: 0x178f, 0xb26: 0x10f2, 0xb27: 0x0652, 0xb28: 0x1102, 0xb29: 0x10fa, - 0xb2a: 0x110a, 0xb2b: 0x1799, 0xb2c: 0x1122, 0xb2d: 0x0656, 0xb2e: 0x112e, 0xb2f: 0x1136, - 0xb30: 0x1146, 0xb31: 0x065a, 0xb32: 0x17a3, 0xb33: 0x17a8, 0xb34: 0x065e, 0xb35: 0x17ad, - 0xb36: 0x115e, 0xb37: 0x17b2, 0xb38: 0x116a, 0xb39: 0x1176, 0xb3a: 0x117e, 0xb3b: 0x17b7, - 0xb3c: 0x17bc, 0xb3d: 0x1192, 0xb3e: 0x17c1, 0xb3f: 0x119a, - // Block 0x2d, offset 0xb40 - 0xb40: 0x16d1, 0xb41: 0x0662, 0xb42: 0x11b2, 0xb43: 0x11b6, 0xb44: 0x066a, 0xb45: 0x11ba, - 0xb46: 0x0a36, 0xb47: 0x17c6, 0xb48: 0x17cb, 0xb49: 0x16d6, 0xb4a: 0x16db, 0xb4b: 0x11da, - 0xb4c: 0x11de, 0xb4d: 0x13f6, 0xb4e: 0x066e, 0xb4f: 0x120a, 0xb50: 0x1206, 0xb51: 0x120e, - 0xb52: 0x0842, 0xb53: 0x1212, 0xb54: 0x1216, 0xb55: 0x121a, 0xb56: 0x1222, 0xb57: 0x17d0, - 0xb58: 0x121e, 0xb59: 0x1226, 0xb5a: 0x123a, 0xb5b: 0x123e, 0xb5c: 0x122a, 0xb5d: 0x1242, - 0xb5e: 0x1256, 0xb5f: 0x126a, 0xb60: 0x1236, 0xb61: 0x124a, 0xb62: 0x124e, 0xb63: 0x1252, - 0xb64: 0x17d5, 0xb65: 0x17df, 0xb66: 0x17da, 0xb67: 0x0672, 0xb68: 0x1272, 0xb69: 0x1276, - 0xb6a: 0x127e, 0xb6b: 0x17f3, 0xb6c: 0x1282, 0xb6d: 0x17e4, 0xb6e: 0x0676, 0xb6f: 0x067a, - 0xb70: 0x17e9, 0xb71: 0x17ee, 0xb72: 0x067e, 0xb73: 0x12a2, 0xb74: 0x12a6, 0xb75: 0x12aa, - 0xb76: 0x12ae, 0xb77: 0x12ba, 0xb78: 0x12b6, 0xb79: 0x12c2, 0xb7a: 0x12be, 0xb7b: 0x12ce, - 0xb7c: 0x12c6, 0xb7d: 0x12ca, 0xb7e: 0x12d2, 0xb7f: 0x0682, - // Block 0x2e, offset 0xb80 - 0xb80: 0x12da, 0xb81: 0x12de, 0xb82: 0x0686, 0xb83: 0x12ee, 0xb84: 0x12f2, 0xb85: 0x17f8, - 0xb86: 0x12fe, 0xb87: 0x1302, 0xb88: 0x068a, 0xb89: 0x130e, 0xb8a: 0x05be, 0xb8b: 0x17fd, - 0xb8c: 0x1802, 0xb8d: 0x068e, 0xb8e: 0x0692, 0xb8f: 0x133a, 0xb90: 0x1352, 0xb91: 0x136e, - 0xb92: 0x137e, 0xb93: 0x1807, 0xb94: 0x1392, 0xb95: 0x1396, 0xb96: 0x13ae, 0xb97: 0x13ba, - 0xb98: 0x1811, 0xb99: 0x1663, 0xb9a: 0x13c6, 0xb9b: 0x13c2, 0xb9c: 0x13ce, 0xb9d: 0x1668, - 0xb9e: 0x13da, 0xb9f: 0x13e6, 0xba0: 0x1816, 0xba1: 0x181b, 0xba2: 0x1426, 0xba3: 0x1432, - 0xba4: 0x143a, 0xba5: 0x1820, 0xba6: 0x143e, 0xba7: 0x146a, 0xba8: 0x1476, 0xba9: 0x147a, - 0xbaa: 0x1472, 0xbab: 0x1486, 0xbac: 0x148a, 0xbad: 0x1825, 0xbae: 0x1496, 0xbaf: 0x0696, - 0xbb0: 0x149e, 0xbb1: 0x182a, 0xbb2: 0x069a, 0xbb3: 0x14d6, 0xbb4: 0x0ac6, 0xbb5: 0x14ee, - 0xbb6: 0x182f, 0xbb7: 0x1839, 0xbb8: 0x069e, 0xbb9: 0x06a2, 0xbba: 0x1516, 0xbbb: 0x183e, - 0xbbc: 0x06a6, 0xbbd: 0x1843, 0xbbe: 0x152e, 0xbbf: 0x152e, - // Block 0x2f, offset 0xbc0 - 0xbc0: 0x1536, 0xbc1: 0x1848, 0xbc2: 0x154e, 0xbc3: 0x06aa, 0xbc4: 0x155e, 0xbc5: 0x156a, - 0xbc6: 0x1572, 0xbc7: 0x157a, 0xbc8: 0x06ae, 0xbc9: 0x184d, 0xbca: 0x158e, 0xbcb: 0x15aa, - 0xbcc: 0x15b6, 0xbcd: 0x06b2, 0xbce: 0x06b6, 0xbcf: 0x15ba, 0xbd0: 0x1852, 0xbd1: 0x06ba, - 0xbd2: 0x1857, 0xbd3: 0x185c, 0xbd4: 0x1861, 0xbd5: 0x15de, 0xbd6: 0x06be, 0xbd7: 0x15f2, - 0xbd8: 0x15fa, 0xbd9: 0x15fe, 0xbda: 0x1606, 0xbdb: 0x160e, 0xbdc: 0x1616, 0xbdd: 0x186b, -} - -// nfcIndex: 22 blocks, 1408 entries, 1408 bytes -// Block 0 is the zero block. -var nfcIndex = [1408]uint8{ - // Block 0x0, offset 0x0 - // Block 0x1, offset 0x40 - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xc2: 0x2e, 0xc3: 0x01, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x2f, 0xc7: 0x04, - 0xc8: 0x05, 0xca: 0x30, 0xcb: 0x31, 0xcc: 0x06, 0xcd: 0x07, 0xce: 0x08, 0xcf: 0x32, - 0xd0: 0x09, 0xd1: 0x33, 0xd2: 0x34, 0xd3: 0x0a, 0xd6: 0x0b, 0xd7: 0x35, - 0xd8: 0x36, 0xd9: 0x0c, 0xdb: 0x37, 0xdc: 0x38, 0xdd: 0x39, 0xdf: 0x3a, - 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, - 0xea: 0x06, 0xeb: 0x07, 0xec: 0x08, 0xed: 0x09, 0xef: 0x0a, - 0xf0: 0x13, - // Block 0x4, offset 0x100 - 0x120: 0x3b, 0x121: 0x3c, 0x123: 0x0d, 0x124: 0x3d, 0x125: 0x3e, 0x126: 0x3f, 0x127: 0x40, - 0x128: 0x41, 0x129: 0x42, 0x12a: 0x43, 0x12b: 0x44, 0x12c: 0x3f, 0x12d: 0x45, 0x12e: 0x46, 0x12f: 0x47, - 0x131: 0x48, 0x132: 0x49, 0x133: 0x4a, 0x134: 0x4b, 0x135: 0x4c, 0x137: 0x4d, - 0x138: 0x4e, 0x139: 0x4f, 0x13a: 0x50, 0x13b: 0x51, 0x13c: 0x52, 0x13d: 0x53, 0x13e: 0x54, 0x13f: 0x55, - // Block 0x5, offset 0x140 - 0x140: 0x56, 0x142: 0x57, 0x144: 0x58, 0x145: 0x59, 0x146: 0x5a, 0x147: 0x5b, - 0x14d: 0x5c, - 0x15c: 0x5d, 0x15f: 0x5e, - 0x162: 0x5f, 0x164: 0x60, - 0x168: 0x61, 0x169: 0x62, 0x16a: 0x63, 0x16b: 0x64, 0x16c: 0x0e, 0x16d: 0x65, 0x16e: 0x66, 0x16f: 0x67, - 0x170: 0x68, 0x173: 0x69, 0x177: 0x0f, - 0x178: 0x10, 0x179: 0x11, 0x17a: 0x12, 0x17b: 0x13, 0x17c: 0x14, 0x17d: 0x15, 0x17e: 0x16, 0x17f: 0x17, - // Block 0x6, offset 0x180 - 0x180: 0x6a, 0x183: 0x6b, 0x184: 0x6c, 0x186: 0x6d, 0x187: 0x6e, - 0x188: 0x6f, 0x189: 0x18, 0x18a: 0x19, 0x18b: 0x70, 0x18c: 0x71, - 0x1ab: 0x72, - 0x1b3: 0x73, 0x1b5: 0x74, 0x1b7: 0x75, - // Block 0x7, offset 0x1c0 - 0x1c0: 0x76, 0x1c1: 0x1a, 0x1c2: 0x1b, 0x1c3: 0x1c, 0x1c4: 0x77, 0x1c5: 0x78, - 0x1c9: 0x79, 0x1cc: 0x7a, 0x1cd: 0x7b, - // Block 0x8, offset 0x200 - 0x219: 0x7c, 0x21a: 0x7d, 0x21b: 0x7e, - 0x220: 0x7f, 0x223: 0x80, 0x224: 0x81, 0x225: 0x82, 0x226: 0x83, 0x227: 0x84, - 0x22a: 0x85, 0x22b: 0x86, 0x22f: 0x87, - 0x230: 0x88, 0x231: 0x89, 0x232: 0x8a, 0x233: 0x8b, 0x234: 0x8c, 0x235: 0x8d, 0x236: 0x8e, 0x237: 0x88, - 0x238: 0x89, 0x239: 0x8a, 0x23a: 0x8b, 0x23b: 0x8c, 0x23c: 0x8d, 0x23d: 0x8e, 0x23e: 0x88, 0x23f: 0x89, - // Block 0x9, offset 0x240 - 0x240: 0x8a, 0x241: 0x8b, 0x242: 0x8c, 0x243: 0x8d, 0x244: 0x8e, 0x245: 0x88, 0x246: 0x89, 0x247: 0x8a, - 0x248: 0x8b, 0x249: 0x8c, 0x24a: 0x8d, 0x24b: 0x8e, 0x24c: 0x88, 0x24d: 0x89, 0x24e: 0x8a, 0x24f: 0x8b, - 0x250: 0x8c, 0x251: 0x8d, 0x252: 0x8e, 0x253: 0x88, 0x254: 0x89, 0x255: 0x8a, 0x256: 0x8b, 0x257: 0x8c, - 0x258: 0x8d, 0x259: 0x8e, 0x25a: 0x88, 0x25b: 0x89, 0x25c: 0x8a, 0x25d: 0x8b, 0x25e: 0x8c, 0x25f: 0x8d, - 0x260: 0x8e, 0x261: 0x88, 0x262: 0x89, 0x263: 0x8a, 0x264: 0x8b, 0x265: 0x8c, 0x266: 0x8d, 0x267: 0x8e, - 0x268: 0x88, 0x269: 0x89, 0x26a: 0x8a, 0x26b: 0x8b, 0x26c: 0x8c, 0x26d: 0x8d, 0x26e: 0x8e, 0x26f: 0x88, - 0x270: 0x89, 0x271: 0x8a, 0x272: 0x8b, 0x273: 0x8c, 0x274: 0x8d, 0x275: 0x8e, 0x276: 0x88, 0x277: 0x89, - 0x278: 0x8a, 0x279: 0x8b, 0x27a: 0x8c, 0x27b: 0x8d, 0x27c: 0x8e, 0x27d: 0x88, 0x27e: 0x89, 0x27f: 0x8a, - // Block 0xa, offset 0x280 - 0x280: 0x8b, 0x281: 0x8c, 0x282: 0x8d, 0x283: 0x8e, 0x284: 0x88, 0x285: 0x89, 0x286: 0x8a, 0x287: 0x8b, - 0x288: 0x8c, 0x289: 0x8d, 0x28a: 0x8e, 0x28b: 0x88, 0x28c: 0x89, 0x28d: 0x8a, 0x28e: 0x8b, 0x28f: 0x8c, - 0x290: 0x8d, 0x291: 0x8e, 0x292: 0x88, 0x293: 0x89, 0x294: 0x8a, 0x295: 0x8b, 0x296: 0x8c, 0x297: 0x8d, - 0x298: 0x8e, 0x299: 0x88, 0x29a: 0x89, 0x29b: 0x8a, 0x29c: 0x8b, 0x29d: 0x8c, 0x29e: 0x8d, 0x29f: 0x8e, - 0x2a0: 0x88, 0x2a1: 0x89, 0x2a2: 0x8a, 0x2a3: 0x8b, 0x2a4: 0x8c, 0x2a5: 0x8d, 0x2a6: 0x8e, 0x2a7: 0x88, - 0x2a8: 0x89, 0x2a9: 0x8a, 0x2aa: 0x8b, 0x2ab: 0x8c, 0x2ac: 0x8d, 0x2ad: 0x8e, 0x2ae: 0x88, 0x2af: 0x89, - 0x2b0: 0x8a, 0x2b1: 0x8b, 0x2b2: 0x8c, 0x2b3: 0x8d, 0x2b4: 0x8e, 0x2b5: 0x88, 0x2b6: 0x89, 0x2b7: 0x8a, - 0x2b8: 0x8b, 0x2b9: 0x8c, 0x2ba: 0x8d, 0x2bb: 0x8e, 0x2bc: 0x88, 0x2bd: 0x89, 0x2be: 0x8a, 0x2bf: 0x8b, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x8c, 0x2c1: 0x8d, 0x2c2: 0x8e, 0x2c3: 0x88, 0x2c4: 0x89, 0x2c5: 0x8a, 0x2c6: 0x8b, 0x2c7: 0x8c, - 0x2c8: 0x8d, 0x2c9: 0x8e, 0x2ca: 0x88, 0x2cb: 0x89, 0x2cc: 0x8a, 0x2cd: 0x8b, 0x2ce: 0x8c, 0x2cf: 0x8d, - 0x2d0: 0x8e, 0x2d1: 0x88, 0x2d2: 0x89, 0x2d3: 0x8a, 0x2d4: 0x8b, 0x2d5: 0x8c, 0x2d6: 0x8d, 0x2d7: 0x8e, - 0x2d8: 0x88, 0x2d9: 0x89, 0x2da: 0x8a, 0x2db: 0x8b, 0x2dc: 0x8c, 0x2dd: 0x8d, 0x2de: 0x8f, - // Block 0xc, offset 0x300 - 0x324: 0x1d, 0x325: 0x1e, 0x326: 0x1f, 0x327: 0x20, - 0x328: 0x21, 0x329: 0x22, 0x32a: 0x23, 0x32b: 0x24, 0x32c: 0x90, 0x32d: 0x91, 0x32e: 0x92, - 0x331: 0x93, 0x332: 0x94, 0x333: 0x95, 0x334: 0x96, - 0x338: 0x97, 0x339: 0x98, 0x33a: 0x99, 0x33b: 0x9a, 0x33e: 0x9b, 0x33f: 0x9c, - // Block 0xd, offset 0x340 - 0x347: 0x9d, - 0x34b: 0x9e, 0x34d: 0x9f, - 0x368: 0xa0, 0x36b: 0xa1, - 0x374: 0xa2, - 0x37a: 0xa3, 0x37d: 0xa4, - // Block 0xe, offset 0x380 - 0x381: 0xa5, 0x382: 0xa6, 0x384: 0xa7, 0x385: 0x83, 0x387: 0xa8, - 0x388: 0xa9, 0x38b: 0xaa, 0x38c: 0xab, 0x38d: 0xac, - 0x391: 0xad, 0x392: 0xae, 0x393: 0xaf, 0x396: 0xb0, 0x397: 0xb1, - 0x398: 0x74, 0x39a: 0xb2, 0x39c: 0xb3, - 0x3a0: 0xb4, 0x3a4: 0xb5, 0x3a5: 0xb6, 0x3a7: 0xb7, - 0x3a8: 0xb8, 0x3a9: 0xb9, 0x3aa: 0xba, - 0x3b0: 0x74, 0x3b5: 0xbb, 0x3b6: 0xbc, - // Block 0xf, offset 0x3c0 - 0x3eb: 0xbd, 0x3ec: 0xbe, - 0x3ff: 0xbf, - // Block 0x10, offset 0x400 - 0x432: 0xc0, - // Block 0x11, offset 0x440 - 0x445: 0xc1, 0x446: 0xc2, 0x447: 0xc3, - 0x449: 0xc4, - // Block 0x12, offset 0x480 - 0x480: 0xc5, 0x484: 0xbe, - 0x48b: 0xc6, - 0x4a3: 0xc7, 0x4a5: 0xc8, - // Block 0x13, offset 0x4c0 - 0x4c8: 0xc9, - // Block 0x14, offset 0x500 - 0x520: 0x25, 0x521: 0x26, 0x522: 0x27, 0x523: 0x28, 0x524: 0x29, 0x525: 0x2a, 0x526: 0x2b, 0x527: 0x2c, - 0x528: 0x2d, - // Block 0x15, offset 0x540 - 0x550: 0x0b, 0x551: 0x0c, 0x556: 0x0d, - 0x55b: 0x0e, 0x55d: 0x0f, 0x55e: 0x10, 0x55f: 0x11, - 0x56f: 0x12, -} - -// nfcSparseOffset: 156 entries, 312 bytes -var nfcSparseOffset = []uint16{0x0, 0x5, 0x9, 0xb, 0xd, 0x18, 0x28, 0x2a, 0x2f, 0x3a, 0x49, 0x56, 0x5e, 0x63, 0x68, 0x6a, 0x72, 0x79, 0x7c, 0x84, 0x88, 0x8c, 0x8e, 0x90, 0x99, 0x9d, 0xa4, 0xa9, 0xac, 0xb6, 0xb9, 0xc0, 0xc8, 0xcb, 0xcd, 0xd0, 0xd2, 0xd7, 0xe8, 0xf4, 0xf6, 0xfc, 0xfe, 0x100, 0x102, 0x104, 0x106, 0x108, 0x10b, 0x10e, 0x110, 0x113, 0x116, 0x11a, 0x120, 0x122, 0x12b, 0x12d, 0x130, 0x132, 0x13d, 0x141, 0x14f, 0x152, 0x158, 0x15e, 0x169, 0x16d, 0x16f, 0x171, 0x173, 0x175, 0x177, 0x17d, 0x181, 0x183, 0x185, 0x18d, 0x191, 0x194, 0x196, 0x198, 0x19b, 0x19e, 0x1a0, 0x1a2, 0x1a4, 0x1a6, 0x1ac, 0x1af, 0x1b1, 0x1b8, 0x1be, 0x1c4, 0x1cc, 0x1d2, 0x1d8, 0x1de, 0x1e2, 0x1f0, 0x1f9, 0x1fc, 0x1ff, 0x201, 0x204, 0x206, 0x20a, 0x20f, 0x211, 0x213, 0x218, 0x21e, 0x220, 0x222, 0x224, 0x22a, 0x22d, 0x22f, 0x231, 0x237, 0x23a, 0x242, 0x249, 0x24c, 0x24f, 0x251, 0x254, 0x25c, 0x260, 0x267, 0x26a, 0x270, 0x272, 0x275, 0x277, 0x27a, 0x27f, 0x281, 0x283, 0x285, 0x287, 0x289, 0x28c, 0x28e, 0x290, 0x292, 0x294, 0x296, 0x2a3, 0x2ad, 0x2af, 0x2b1, 0x2b7, 0x2b9, 0x2bb, 0x2be} - -// nfcSparseValues: 704 entries, 2816 bytes -var nfcSparseValues = [704]valueRange{ - // Block 0x0, offset 0x0 - {value: 0x0000, lo: 0x04}, - {value: 0xa100, lo: 0xa8, hi: 0xa8}, - {value: 0x8100, lo: 0xaf, hi: 0xaf}, - {value: 0x8100, lo: 0xb4, hi: 0xb4}, - {value: 0x8100, lo: 0xb8, hi: 0xb8}, - // Block 0x1, offset 0x5 - {value: 0x0091, lo: 0x03}, - {value: 0x46f9, lo: 0xa0, hi: 0xa1}, - {value: 0x472b, lo: 0xaf, hi: 0xb0}, - {value: 0xa000, lo: 0xb7, hi: 0xb7}, - // Block 0x2, offset 0x9 - {value: 0x0000, lo: 0x01}, - {value: 0xa000, lo: 0x92, hi: 0x92}, - // Block 0x3, offset 0xb - {value: 0x0000, lo: 0x01}, - {value: 0x8100, lo: 0x98, hi: 0x9d}, - // Block 0x4, offset 0xd - {value: 0x0006, lo: 0x0a}, - {value: 0xa000, lo: 0x81, hi: 0x81}, - {value: 0xa000, lo: 0x85, hi: 0x85}, - {value: 0xa000, lo: 0x89, hi: 0x89}, - {value: 0x4857, lo: 0x8a, hi: 0x8a}, - {value: 0x4875, lo: 0x8b, hi: 0x8b}, - {value: 0x36de, lo: 0x8c, hi: 0x8c}, - {value: 0x36f6, lo: 0x8d, hi: 0x8d}, - {value: 0x488d, lo: 0x8e, hi: 0x8e}, - {value: 0xa000, lo: 0x92, hi: 0x92}, - {value: 0x3714, lo: 0x93, hi: 0x94}, - // Block 0x5, offset 0x18 - {value: 0x0000, lo: 0x0f}, - {value: 0xa000, lo: 0x83, hi: 0x83}, - {value: 0xa000, lo: 0x87, hi: 0x87}, - {value: 0xa000, lo: 0x8b, hi: 0x8b}, - {value: 0xa000, lo: 0x8d, hi: 0x8d}, - {value: 0x37bc, lo: 0x90, hi: 0x90}, - {value: 0x37c8, lo: 0x91, hi: 0x91}, - {value: 0x37b6, lo: 0x93, hi: 0x93}, - {value: 0xa000, lo: 0x96, hi: 0x96}, - {value: 0x382e, lo: 0x97, hi: 0x97}, - {value: 0x37f8, lo: 0x9c, hi: 0x9c}, - {value: 0x37e0, lo: 0x9d, hi: 0x9d}, - {value: 0x380a, lo: 0x9e, hi: 0x9e}, - {value: 0xa000, lo: 0xb4, hi: 0xb5}, - {value: 0x3834, lo: 0xb6, hi: 0xb6}, - {value: 0x383a, lo: 0xb7, hi: 0xb7}, - // Block 0x6, offset 0x28 - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0x83, hi: 0x87}, - // Block 0x7, offset 0x2a - {value: 0x0001, lo: 0x04}, - {value: 0x8114, lo: 0x81, hi: 0x82}, - {value: 0x8133, lo: 0x84, hi: 0x84}, - {value: 0x812e, lo: 0x85, hi: 0x85}, - {value: 0x810e, lo: 0x87, hi: 0x87}, - // Block 0x8, offset 0x2f - {value: 0x0000, lo: 0x0a}, - {value: 0x8133, lo: 0x90, hi: 0x97}, - {value: 0x811a, lo: 0x98, hi: 0x98}, - {value: 0x811b, lo: 0x99, hi: 0x99}, - {value: 0x811c, lo: 0x9a, hi: 0x9a}, - {value: 0x3858, lo: 0xa2, hi: 0xa2}, - {value: 0x385e, lo: 0xa3, hi: 0xa3}, - {value: 0x386a, lo: 0xa4, hi: 0xa4}, - {value: 0x3864, lo: 0xa5, hi: 0xa5}, - {value: 0x3870, lo: 0xa6, hi: 0xa6}, - {value: 0xa000, lo: 0xa7, hi: 0xa7}, - // Block 0x9, offset 0x3a - {value: 0x0000, lo: 0x0e}, - {value: 0x3882, lo: 0x80, hi: 0x80}, - {value: 0xa000, lo: 0x81, hi: 0x81}, - {value: 0x3876, lo: 0x82, hi: 0x82}, - {value: 0xa000, lo: 0x92, hi: 0x92}, - {value: 0x387c, lo: 0x93, hi: 0x93}, - {value: 0xa000, lo: 0x95, hi: 0x95}, - {value: 0x8133, lo: 0x96, hi: 0x9c}, - {value: 0x8133, lo: 0x9f, hi: 0xa2}, - {value: 0x812e, lo: 0xa3, hi: 0xa3}, - {value: 0x8133, lo: 0xa4, hi: 0xa4}, - {value: 0x8133, lo: 0xa7, hi: 0xa8}, - {value: 0x812e, lo: 0xaa, hi: 0xaa}, - {value: 0x8133, lo: 0xab, hi: 0xac}, - {value: 0x812e, lo: 0xad, hi: 0xad}, - // Block 0xa, offset 0x49 - {value: 0x0000, lo: 0x0c}, - {value: 0x8120, lo: 0x91, hi: 0x91}, - {value: 0x8133, lo: 0xb0, hi: 0xb0}, - {value: 0x812e, lo: 0xb1, hi: 0xb1}, - {value: 0x8133, lo: 0xb2, hi: 0xb3}, - {value: 0x812e, lo: 0xb4, hi: 0xb4}, - {value: 0x8133, lo: 0xb5, hi: 0xb6}, - {value: 0x812e, lo: 0xb7, hi: 0xb9}, - {value: 0x8133, lo: 0xba, hi: 0xba}, - {value: 0x812e, lo: 0xbb, hi: 0xbc}, - {value: 0x8133, lo: 0xbd, hi: 0xbd}, - {value: 0x812e, lo: 0xbe, hi: 0xbe}, - {value: 0x8133, lo: 0xbf, hi: 0xbf}, - // Block 0xb, offset 0x56 - {value: 0x0005, lo: 0x07}, - {value: 0x8133, lo: 0x80, hi: 0x80}, - {value: 0x8133, lo: 0x81, hi: 0x81}, - {value: 0x812e, lo: 0x82, hi: 0x83}, - {value: 0x812e, lo: 0x84, hi: 0x85}, - {value: 0x812e, lo: 0x86, hi: 0x87}, - {value: 0x812e, lo: 0x88, hi: 0x89}, - {value: 0x8133, lo: 0x8a, hi: 0x8a}, - // Block 0xc, offset 0x5e - {value: 0x0000, lo: 0x04}, - {value: 0x8133, lo: 0xab, hi: 0xb1}, - {value: 0x812e, lo: 0xb2, hi: 0xb2}, - {value: 0x8133, lo: 0xb3, hi: 0xb3}, - {value: 0x812e, lo: 0xbd, hi: 0xbd}, - // Block 0xd, offset 0x63 - {value: 0x0000, lo: 0x04}, - {value: 0x8133, lo: 0x96, hi: 0x99}, - {value: 0x8133, lo: 0x9b, hi: 0xa3}, - {value: 0x8133, lo: 0xa5, hi: 0xa7}, - {value: 0x8133, lo: 0xa9, hi: 0xad}, - // Block 0xe, offset 0x68 - {value: 0x0000, lo: 0x01}, - {value: 0x812e, lo: 0x99, hi: 0x9b}, - // Block 0xf, offset 0x6a - {value: 0x0000, lo: 0x07}, - {value: 0xa000, lo: 0xa8, hi: 0xa8}, - {value: 0x3eef, lo: 0xa9, hi: 0xa9}, - {value: 0xa000, lo: 0xb0, hi: 0xb0}, - {value: 0x3ef7, lo: 0xb1, hi: 0xb1}, - {value: 0xa000, lo: 0xb3, hi: 0xb3}, - {value: 0x3eff, lo: 0xb4, hi: 0xb4}, - {value: 0x9903, lo: 0xbc, hi: 0xbc}, - // Block 0x10, offset 0x72 - {value: 0x0008, lo: 0x06}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x8133, lo: 0x91, hi: 0x91}, - {value: 0x812e, lo: 0x92, hi: 0x92}, - {value: 0x8133, lo: 0x93, hi: 0x93}, - {value: 0x8133, lo: 0x94, hi: 0x94}, - {value: 0x4533, lo: 0x98, hi: 0x9f}, - // Block 0x11, offset 0x79 - {value: 0x0000, lo: 0x02}, - {value: 0x8103, lo: 0xbc, hi: 0xbc}, - {value: 0x9900, lo: 0xbe, hi: 0xbe}, - // Block 0x12, offset 0x7c - {value: 0x0008, lo: 0x07}, - {value: 0xa000, lo: 0x87, hi: 0x87}, - {value: 0x2cab, lo: 0x8b, hi: 0x8c}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x9900, lo: 0x97, hi: 0x97}, - {value: 0x4573, lo: 0x9c, hi: 0x9d}, - {value: 0x4583, lo: 0x9f, hi: 0x9f}, - {value: 0x8133, lo: 0xbe, hi: 0xbe}, - // Block 0x13, offset 0x84 - {value: 0x0000, lo: 0x03}, - {value: 0x45ab, lo: 0xb3, hi: 0xb3}, - {value: 0x45b3, lo: 0xb6, hi: 0xb6}, - {value: 0x8103, lo: 0xbc, hi: 0xbc}, - // Block 0x14, offset 0x88 - {value: 0x0008, lo: 0x03}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x458b, lo: 0x99, hi: 0x9b}, - {value: 0x45a3, lo: 0x9e, hi: 0x9e}, - // Block 0x15, offset 0x8c - {value: 0x0000, lo: 0x01}, - {value: 0x8103, lo: 0xbc, hi: 0xbc}, - // Block 0x16, offset 0x8e - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - // Block 0x17, offset 0x90 - {value: 0x0000, lo: 0x08}, - {value: 0xa000, lo: 0x87, hi: 0x87}, - {value: 0x2cc3, lo: 0x88, hi: 0x88}, - {value: 0x2cbb, lo: 0x8b, hi: 0x8b}, - {value: 0x2ccb, lo: 0x8c, hi: 0x8c}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x9900, lo: 0x96, hi: 0x97}, - {value: 0x45bb, lo: 0x9c, hi: 0x9c}, - {value: 0x45c3, lo: 0x9d, hi: 0x9d}, - // Block 0x18, offset 0x99 - {value: 0x0000, lo: 0x03}, - {value: 0xa000, lo: 0x92, hi: 0x92}, - {value: 0x2cd3, lo: 0x94, hi: 0x94}, - {value: 0x9900, lo: 0xbe, hi: 0xbe}, - // Block 0x19, offset 0x9d - {value: 0x0000, lo: 0x06}, - {value: 0xa000, lo: 0x86, hi: 0x87}, - {value: 0x2cdb, lo: 0x8a, hi: 0x8a}, - {value: 0x2ceb, lo: 0x8b, hi: 0x8b}, - {value: 0x2ce3, lo: 0x8c, hi: 0x8c}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x9900, lo: 0x97, hi: 0x97}, - // Block 0x1a, offset 0xa4 - {value: 0x1801, lo: 0x04}, - {value: 0xa000, lo: 0x86, hi: 0x86}, - {value: 0x3f07, lo: 0x88, hi: 0x88}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x8121, lo: 0x95, hi: 0x96}, - // Block 0x1b, offset 0xa9 - {value: 0x0000, lo: 0x02}, - {value: 0x8103, lo: 0xbc, hi: 0xbc}, - {value: 0xa000, lo: 0xbf, hi: 0xbf}, - // Block 0x1c, offset 0xac - {value: 0x0000, lo: 0x09}, - {value: 0x2cf3, lo: 0x80, hi: 0x80}, - {value: 0x9900, lo: 0x82, hi: 0x82}, - {value: 0xa000, lo: 0x86, hi: 0x86}, - {value: 0x2cfb, lo: 0x87, hi: 0x87}, - {value: 0x2d03, lo: 0x88, hi: 0x88}, - {value: 0x2f67, lo: 0x8a, hi: 0x8a}, - {value: 0x2def, lo: 0x8b, hi: 0x8b}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x9900, lo: 0x95, hi: 0x96}, - // Block 0x1d, offset 0xb6 - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0xbb, hi: 0xbc}, - {value: 0x9900, lo: 0xbe, hi: 0xbe}, - // Block 0x1e, offset 0xb9 - {value: 0x0000, lo: 0x06}, - {value: 0xa000, lo: 0x86, hi: 0x87}, - {value: 0x2d0b, lo: 0x8a, hi: 0x8a}, - {value: 0x2d1b, lo: 0x8b, hi: 0x8b}, - {value: 0x2d13, lo: 0x8c, hi: 0x8c}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x9900, lo: 0x97, hi: 0x97}, - // Block 0x1f, offset 0xc0 - {value: 0x6bdd, lo: 0x07}, - {value: 0x9905, lo: 0x8a, hi: 0x8a}, - {value: 0x9900, lo: 0x8f, hi: 0x8f}, - {value: 0xa000, lo: 0x99, hi: 0x99}, - {value: 0x3f0f, lo: 0x9a, hi: 0x9a}, - {value: 0x2f6f, lo: 0x9c, hi: 0x9c}, - {value: 0x2dfa, lo: 0x9d, hi: 0x9d}, - {value: 0x2d23, lo: 0x9e, hi: 0x9f}, - // Block 0x20, offset 0xc8 - {value: 0x0000, lo: 0x02}, - {value: 0x8123, lo: 0xb8, hi: 0xb9}, - {value: 0x8105, lo: 0xba, hi: 0xba}, - // Block 0x21, offset 0xcb - {value: 0x0000, lo: 0x01}, - {value: 0x8124, lo: 0x88, hi: 0x8b}, - // Block 0x22, offset 0xcd - {value: 0x0000, lo: 0x02}, - {value: 0x8125, lo: 0xb8, hi: 0xb9}, - {value: 0x8105, lo: 0xba, hi: 0xba}, - // Block 0x23, offset 0xd0 - {value: 0x0000, lo: 0x01}, - {value: 0x8126, lo: 0x88, hi: 0x8b}, - // Block 0x24, offset 0xd2 - {value: 0x0000, lo: 0x04}, - {value: 0x812e, lo: 0x98, hi: 0x99}, - {value: 0x812e, lo: 0xb5, hi: 0xb5}, - {value: 0x812e, lo: 0xb7, hi: 0xb7}, - {value: 0x812c, lo: 0xb9, hi: 0xb9}, - // Block 0x25, offset 0xd7 - {value: 0x0000, lo: 0x10}, - {value: 0x264a, lo: 0x83, hi: 0x83}, - {value: 0x2651, lo: 0x8d, hi: 0x8d}, - {value: 0x2658, lo: 0x92, hi: 0x92}, - {value: 0x265f, lo: 0x97, hi: 0x97}, - {value: 0x2666, lo: 0x9c, hi: 0x9c}, - {value: 0x2643, lo: 0xa9, hi: 0xa9}, - {value: 0x8127, lo: 0xb1, hi: 0xb1}, - {value: 0x8128, lo: 0xb2, hi: 0xb2}, - {value: 0x4a9b, lo: 0xb3, hi: 0xb3}, - {value: 0x8129, lo: 0xb4, hi: 0xb4}, - {value: 0x4aa4, lo: 0xb5, hi: 0xb5}, - {value: 0x45cb, lo: 0xb6, hi: 0xb6}, - {value: 0x8200, lo: 0xb7, hi: 0xb7}, - {value: 0x45d3, lo: 0xb8, hi: 0xb8}, - {value: 0x8200, lo: 0xb9, hi: 0xb9}, - {value: 0x8128, lo: 0xba, hi: 0xbd}, - // Block 0x26, offset 0xe8 - {value: 0x0000, lo: 0x0b}, - {value: 0x8128, lo: 0x80, hi: 0x80}, - {value: 0x4aad, lo: 0x81, hi: 0x81}, - {value: 0x8133, lo: 0x82, hi: 0x83}, - {value: 0x8105, lo: 0x84, hi: 0x84}, - {value: 0x8133, lo: 0x86, hi: 0x87}, - {value: 0x2674, lo: 0x93, hi: 0x93}, - {value: 0x267b, lo: 0x9d, hi: 0x9d}, - {value: 0x2682, lo: 0xa2, hi: 0xa2}, - {value: 0x2689, lo: 0xa7, hi: 0xa7}, - {value: 0x2690, lo: 0xac, hi: 0xac}, - {value: 0x266d, lo: 0xb9, hi: 0xb9}, - // Block 0x27, offset 0xf4 - {value: 0x0000, lo: 0x01}, - {value: 0x812e, lo: 0x86, hi: 0x86}, - // Block 0x28, offset 0xf6 - {value: 0x0000, lo: 0x05}, - {value: 0xa000, lo: 0xa5, hi: 0xa5}, - {value: 0x2d2b, lo: 0xa6, hi: 0xa6}, - {value: 0x9900, lo: 0xae, hi: 0xae}, - {value: 0x8103, lo: 0xb7, hi: 0xb7}, - {value: 0x8105, lo: 0xb9, hi: 0xba}, - // Block 0x29, offset 0xfc - {value: 0x0000, lo: 0x01}, - {value: 0x812e, lo: 0x8d, hi: 0x8d}, - // Block 0x2a, offset 0xfe - {value: 0x0000, lo: 0x01}, - {value: 0xa000, lo: 0x80, hi: 0x92}, - // Block 0x2b, offset 0x100 - {value: 0x0000, lo: 0x01}, - {value: 0xb900, lo: 0xa1, hi: 0xb5}, - // Block 0x2c, offset 0x102 - {value: 0x0000, lo: 0x01}, - {value: 0x9900, lo: 0xa8, hi: 0xbf}, - // Block 0x2d, offset 0x104 - {value: 0x0000, lo: 0x01}, - {value: 0x9900, lo: 0x80, hi: 0x82}, - // Block 0x2e, offset 0x106 - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0x9d, hi: 0x9f}, - // Block 0x2f, offset 0x108 - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0x94, hi: 0x94}, - {value: 0x8105, lo: 0xb4, hi: 0xb4}, - // Block 0x30, offset 0x10b - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0x92, hi: 0x92}, - {value: 0x8133, lo: 0x9d, hi: 0x9d}, - // Block 0x31, offset 0x10e - {value: 0x0000, lo: 0x01}, - {value: 0x8132, lo: 0xa9, hi: 0xa9}, - // Block 0x32, offset 0x110 - {value: 0x0004, lo: 0x02}, - {value: 0x812f, lo: 0xb9, hi: 0xba}, - {value: 0x812e, lo: 0xbb, hi: 0xbb}, - // Block 0x33, offset 0x113 - {value: 0x0000, lo: 0x02}, - {value: 0x8133, lo: 0x97, hi: 0x97}, - {value: 0x812e, lo: 0x98, hi: 0x98}, - // Block 0x34, offset 0x116 - {value: 0x0000, lo: 0x03}, - {value: 0x8105, lo: 0xa0, hi: 0xa0}, - {value: 0x8133, lo: 0xb5, hi: 0xbc}, - {value: 0x812e, lo: 0xbf, hi: 0xbf}, - // Block 0x35, offset 0x11a - {value: 0x0000, lo: 0x05}, - {value: 0x8133, lo: 0xb0, hi: 0xb4}, - {value: 0x812e, lo: 0xb5, hi: 0xba}, - {value: 0x8133, lo: 0xbb, hi: 0xbc}, - {value: 0x812e, lo: 0xbd, hi: 0xbd}, - {value: 0x812e, lo: 0xbf, hi: 0xbf}, - // Block 0x36, offset 0x120 - {value: 0x0000, lo: 0x01}, - {value: 0x812e, lo: 0x80, hi: 0x80}, - // Block 0x37, offset 0x122 - {value: 0x0000, lo: 0x08}, - {value: 0x2d73, lo: 0x80, hi: 0x80}, - {value: 0x2d7b, lo: 0x81, hi: 0x81}, - {value: 0xa000, lo: 0x82, hi: 0x82}, - {value: 0x2d83, lo: 0x83, hi: 0x83}, - {value: 0x8105, lo: 0x84, hi: 0x84}, - {value: 0x8133, lo: 0xab, hi: 0xab}, - {value: 0x812e, lo: 0xac, hi: 0xac}, - {value: 0x8133, lo: 0xad, hi: 0xb3}, - // Block 0x38, offset 0x12b - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0xaa, hi: 0xab}, - // Block 0x39, offset 0x12d - {value: 0x0000, lo: 0x02}, - {value: 0x8103, lo: 0xa6, hi: 0xa6}, - {value: 0x8105, lo: 0xb2, hi: 0xb3}, - // Block 0x3a, offset 0x130 - {value: 0x0000, lo: 0x01}, - {value: 0x8103, lo: 0xb7, hi: 0xb7}, - // Block 0x3b, offset 0x132 - {value: 0x0000, lo: 0x0a}, - {value: 0x8133, lo: 0x90, hi: 0x92}, - {value: 0x8101, lo: 0x94, hi: 0x94}, - {value: 0x812e, lo: 0x95, hi: 0x99}, - {value: 0x8133, lo: 0x9a, hi: 0x9b}, - {value: 0x812e, lo: 0x9c, hi: 0x9f}, - {value: 0x8133, lo: 0xa0, hi: 0xa0}, - {value: 0x8101, lo: 0xa2, hi: 0xa8}, - {value: 0x812e, lo: 0xad, hi: 0xad}, - {value: 0x8133, lo: 0xb4, hi: 0xb4}, - {value: 0x8133, lo: 0xb8, hi: 0xb9}, - // Block 0x3c, offset 0x13d - {value: 0x0004, lo: 0x03}, - {value: 0x0436, lo: 0x80, hi: 0x81}, - {value: 0x8100, lo: 0x97, hi: 0x97}, - {value: 0x8100, lo: 0xbe, hi: 0xbe}, - // Block 0x3d, offset 0x141 - {value: 0x0000, lo: 0x0d}, - {value: 0x8133, lo: 0x90, hi: 0x91}, - {value: 0x8101, lo: 0x92, hi: 0x93}, - {value: 0x8133, lo: 0x94, hi: 0x97}, - {value: 0x8101, lo: 0x98, hi: 0x9a}, - {value: 0x8133, lo: 0x9b, hi: 0x9c}, - {value: 0x8133, lo: 0xa1, hi: 0xa1}, - {value: 0x8101, lo: 0xa5, hi: 0xa6}, - {value: 0x8133, lo: 0xa7, hi: 0xa7}, - {value: 0x812e, lo: 0xa8, hi: 0xa8}, - {value: 0x8133, lo: 0xa9, hi: 0xa9}, - {value: 0x8101, lo: 0xaa, hi: 0xab}, - {value: 0x812e, lo: 0xac, hi: 0xaf}, - {value: 0x8133, lo: 0xb0, hi: 0xb0}, - // Block 0x3e, offset 0x14f - {value: 0x4292, lo: 0x02}, - {value: 0x01bb, lo: 0xa6, hi: 0xa6}, - {value: 0x0057, lo: 0xaa, hi: 0xab}, - // Block 0x3f, offset 0x152 - {value: 0x0007, lo: 0x05}, - {value: 0xa000, lo: 0x90, hi: 0x90}, - {value: 0xa000, lo: 0x92, hi: 0x92}, - {value: 0xa000, lo: 0x94, hi: 0x94}, - {value: 0x3bd0, lo: 0x9a, hi: 0x9b}, - {value: 0x3bde, lo: 0xae, hi: 0xae}, - // Block 0x40, offset 0x158 - {value: 0x000e, lo: 0x05}, - {value: 0x3be5, lo: 0x8d, hi: 0x8e}, - {value: 0x3bec, lo: 0x8f, hi: 0x8f}, - {value: 0xa000, lo: 0x90, hi: 0x90}, - {value: 0xa000, lo: 0x92, hi: 0x92}, - {value: 0xa000, lo: 0x94, hi: 0x94}, - // Block 0x41, offset 0x15e - {value: 0x63f1, lo: 0x0a}, - {value: 0xa000, lo: 0x83, hi: 0x83}, - {value: 0x3bfa, lo: 0x84, hi: 0x84}, - {value: 0xa000, lo: 0x88, hi: 0x88}, - {value: 0x3c01, lo: 0x89, hi: 0x89}, - {value: 0xa000, lo: 0x8b, hi: 0x8b}, - {value: 0x3c08, lo: 0x8c, hi: 0x8c}, - {value: 0xa000, lo: 0xa3, hi: 0xa3}, - {value: 0x3c0f, lo: 0xa4, hi: 0xa5}, - {value: 0x3c16, lo: 0xa6, hi: 0xa6}, - {value: 0xa000, lo: 0xbc, hi: 0xbc}, - // Block 0x42, offset 0x169 - {value: 0x0007, lo: 0x03}, - {value: 0x3c7f, lo: 0xa0, hi: 0xa1}, - {value: 0x3ca9, lo: 0xa2, hi: 0xa3}, - {value: 0x3cd3, lo: 0xaa, hi: 0xad}, - // Block 0x43, offset 0x16d - {value: 0x0004, lo: 0x01}, - {value: 0x048e, lo: 0xa9, hi: 0xaa}, - // Block 0x44, offset 0x16f - {value: 0x0000, lo: 0x01}, - {value: 0x44f4, lo: 0x9c, hi: 0x9c}, - // Block 0x45, offset 0x171 - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0xaf, hi: 0xb1}, - // Block 0x46, offset 0x173 - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0xbf, hi: 0xbf}, - // Block 0x47, offset 0x175 - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0xa0, hi: 0xbf}, - // Block 0x48, offset 0x177 - {value: 0x0000, lo: 0x05}, - {value: 0x812d, lo: 0xaa, hi: 0xaa}, - {value: 0x8132, lo: 0xab, hi: 0xab}, - {value: 0x8134, lo: 0xac, hi: 0xac}, - {value: 0x812f, lo: 0xad, hi: 0xad}, - {value: 0x8130, lo: 0xae, hi: 0xaf}, - // Block 0x49, offset 0x17d - {value: 0x0000, lo: 0x03}, - {value: 0x4ab6, lo: 0xb3, hi: 0xb3}, - {value: 0x4ab6, lo: 0xb5, hi: 0xb6}, - {value: 0x4ab6, lo: 0xba, hi: 0xbf}, - // Block 0x4a, offset 0x181 - {value: 0x0000, lo: 0x01}, - {value: 0x4ab6, lo: 0x8f, hi: 0xa3}, - // Block 0x4b, offset 0x183 - {value: 0x0000, lo: 0x01}, - {value: 0x8100, lo: 0xae, hi: 0xbe}, - // Block 0x4c, offset 0x185 - {value: 0x0000, lo: 0x07}, - {value: 0x8100, lo: 0x84, hi: 0x84}, - {value: 0x8100, lo: 0x87, hi: 0x87}, - {value: 0x8100, lo: 0x90, hi: 0x90}, - {value: 0x8100, lo: 0x9e, hi: 0x9e}, - {value: 0x8100, lo: 0xa1, hi: 0xa1}, - {value: 0x8100, lo: 0xb2, hi: 0xb2}, - {value: 0x8100, lo: 0xbb, hi: 0xbb}, - // Block 0x4d, offset 0x18d - {value: 0x0000, lo: 0x03}, - {value: 0x8100, lo: 0x80, hi: 0x80}, - {value: 0x8100, lo: 0x8b, hi: 0x8b}, - {value: 0x8100, lo: 0x8e, hi: 0x8e}, - // Block 0x4e, offset 0x191 - {value: 0x0000, lo: 0x02}, - {value: 0x8133, lo: 0xaf, hi: 0xaf}, - {value: 0x8133, lo: 0xb4, hi: 0xbd}, - // Block 0x4f, offset 0x194 - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0x9e, hi: 0x9f}, - // Block 0x50, offset 0x196 - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0xb0, hi: 0xb1}, - // Block 0x51, offset 0x198 - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0x86, hi: 0x86}, - {value: 0x8105, lo: 0xac, hi: 0xac}, - // Block 0x52, offset 0x19b - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0x84, hi: 0x84}, - {value: 0x8133, lo: 0xa0, hi: 0xb1}, - // Block 0x53, offset 0x19e - {value: 0x0000, lo: 0x01}, - {value: 0x812e, lo: 0xab, hi: 0xad}, - // Block 0x54, offset 0x1a0 - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0x93, hi: 0x93}, - // Block 0x55, offset 0x1a2 - {value: 0x0000, lo: 0x01}, - {value: 0x8103, lo: 0xb3, hi: 0xb3}, - // Block 0x56, offset 0x1a4 - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0x80, hi: 0x80}, - // Block 0x57, offset 0x1a6 - {value: 0x0000, lo: 0x05}, - {value: 0x8133, lo: 0xb0, hi: 0xb0}, - {value: 0x8133, lo: 0xb2, hi: 0xb3}, - {value: 0x812e, lo: 0xb4, hi: 0xb4}, - {value: 0x8133, lo: 0xb7, hi: 0xb8}, - {value: 0x8133, lo: 0xbe, hi: 0xbf}, - // Block 0x58, offset 0x1ac - {value: 0x0000, lo: 0x02}, - {value: 0x8133, lo: 0x81, hi: 0x81}, - {value: 0x8105, lo: 0xb6, hi: 0xb6}, - // Block 0x59, offset 0x1af - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0xad, hi: 0xad}, - // Block 0x5a, offset 0x1b1 - {value: 0x0000, lo: 0x06}, - {value: 0xe500, lo: 0x80, hi: 0x80}, - {value: 0xc600, lo: 0x81, hi: 0x9b}, - {value: 0xe500, lo: 0x9c, hi: 0x9c}, - {value: 0xc600, lo: 0x9d, hi: 0xb7}, - {value: 0xe500, lo: 0xb8, hi: 0xb8}, - {value: 0xc600, lo: 0xb9, hi: 0xbf}, - // Block 0x5b, offset 0x1b8 - {value: 0x0000, lo: 0x05}, - {value: 0xc600, lo: 0x80, hi: 0x93}, - {value: 0xe500, lo: 0x94, hi: 0x94}, - {value: 0xc600, lo: 0x95, hi: 0xaf}, - {value: 0xe500, lo: 0xb0, hi: 0xb0}, - {value: 0xc600, lo: 0xb1, hi: 0xbf}, - // Block 0x5c, offset 0x1be - {value: 0x0000, lo: 0x05}, - {value: 0xc600, lo: 0x80, hi: 0x8b}, - {value: 0xe500, lo: 0x8c, hi: 0x8c}, - {value: 0xc600, lo: 0x8d, hi: 0xa7}, - {value: 0xe500, lo: 0xa8, hi: 0xa8}, - {value: 0xc600, lo: 0xa9, hi: 0xbf}, - // Block 0x5d, offset 0x1c4 - {value: 0x0000, lo: 0x07}, - {value: 0xc600, lo: 0x80, hi: 0x83}, - {value: 0xe500, lo: 0x84, hi: 0x84}, - {value: 0xc600, lo: 0x85, hi: 0x9f}, - {value: 0xe500, lo: 0xa0, hi: 0xa0}, - {value: 0xc600, lo: 0xa1, hi: 0xbb}, - {value: 0xe500, lo: 0xbc, hi: 0xbc}, - {value: 0xc600, lo: 0xbd, hi: 0xbf}, - // Block 0x5e, offset 0x1cc - {value: 0x0000, lo: 0x05}, - {value: 0xc600, lo: 0x80, hi: 0x97}, - {value: 0xe500, lo: 0x98, hi: 0x98}, - {value: 0xc600, lo: 0x99, hi: 0xb3}, - {value: 0xe500, lo: 0xb4, hi: 0xb4}, - {value: 0xc600, lo: 0xb5, hi: 0xbf}, - // Block 0x5f, offset 0x1d2 - {value: 0x0000, lo: 0x05}, - {value: 0xc600, lo: 0x80, hi: 0x8f}, - {value: 0xe500, lo: 0x90, hi: 0x90}, - {value: 0xc600, lo: 0x91, hi: 0xab}, - {value: 0xe500, lo: 0xac, hi: 0xac}, - {value: 0xc600, lo: 0xad, hi: 0xbf}, - // Block 0x60, offset 0x1d8 - {value: 0x0000, lo: 0x05}, - {value: 0xc600, lo: 0x80, hi: 0x87}, - {value: 0xe500, lo: 0x88, hi: 0x88}, - {value: 0xc600, lo: 0x89, hi: 0xa3}, - {value: 0xe500, lo: 0xa4, hi: 0xa4}, - {value: 0xc600, lo: 0xa5, hi: 0xbf}, - // Block 0x61, offset 0x1de - {value: 0x0000, lo: 0x03}, - {value: 0xc600, lo: 0x80, hi: 0x87}, - {value: 0xe500, lo: 0x88, hi: 0x88}, - {value: 0xc600, lo: 0x89, hi: 0xa3}, - // Block 0x62, offset 0x1e2 - {value: 0x0006, lo: 0x0d}, - {value: 0x43a7, lo: 0x9d, hi: 0x9d}, - {value: 0x8116, lo: 0x9e, hi: 0x9e}, - {value: 0x4419, lo: 0x9f, hi: 0x9f}, - {value: 0x4407, lo: 0xaa, hi: 0xab}, - {value: 0x450b, lo: 0xac, hi: 0xac}, - {value: 0x4513, lo: 0xad, hi: 0xad}, - {value: 0x435f, lo: 0xae, hi: 0xb1}, - {value: 0x437d, lo: 0xb2, hi: 0xb4}, - {value: 0x4395, lo: 0xb5, hi: 0xb6}, - {value: 0x43a1, lo: 0xb8, hi: 0xb8}, - {value: 0x43ad, lo: 0xb9, hi: 0xbb}, - {value: 0x43c5, lo: 0xbc, hi: 0xbc}, - {value: 0x43cb, lo: 0xbe, hi: 0xbe}, - // Block 0x63, offset 0x1f0 - {value: 0x0006, lo: 0x08}, - {value: 0x43d1, lo: 0x80, hi: 0x81}, - {value: 0x43dd, lo: 0x83, hi: 0x84}, - {value: 0x43ef, lo: 0x86, hi: 0x89}, - {value: 0x4413, lo: 0x8a, hi: 0x8a}, - {value: 0x438f, lo: 0x8b, hi: 0x8b}, - {value: 0x4377, lo: 0x8c, hi: 0x8c}, - {value: 0x43bf, lo: 0x8d, hi: 0x8d}, - {value: 0x43e9, lo: 0x8e, hi: 0x8e}, - // Block 0x64, offset 0x1f9 - {value: 0x0000, lo: 0x02}, - {value: 0x8100, lo: 0xa4, hi: 0xa5}, - {value: 0x8100, lo: 0xb0, hi: 0xb1}, - // Block 0x65, offset 0x1fc - {value: 0x0000, lo: 0x02}, - {value: 0x8100, lo: 0x9b, hi: 0x9d}, - {value: 0x8200, lo: 0x9e, hi: 0xa3}, - // Block 0x66, offset 0x1ff - {value: 0x0000, lo: 0x01}, - {value: 0x8100, lo: 0x90, hi: 0x90}, - // Block 0x67, offset 0x201 - {value: 0x0000, lo: 0x02}, - {value: 0x8100, lo: 0x99, hi: 0x99}, - {value: 0x8200, lo: 0xb2, hi: 0xb4}, - // Block 0x68, offset 0x204 - {value: 0x0000, lo: 0x01}, - {value: 0x8100, lo: 0xbc, hi: 0xbd}, - // Block 0x69, offset 0x206 - {value: 0x0000, lo: 0x03}, - {value: 0x8133, lo: 0xa0, hi: 0xa6}, - {value: 0x812e, lo: 0xa7, hi: 0xad}, - {value: 0x8133, lo: 0xae, hi: 0xaf}, - // Block 0x6a, offset 0x20a - {value: 0x0000, lo: 0x04}, - {value: 0x8100, lo: 0x89, hi: 0x8c}, - {value: 0x8100, lo: 0xb0, hi: 0xb2}, - {value: 0x8100, lo: 0xb4, hi: 0xb4}, - {value: 0x8100, lo: 0xb6, hi: 0xbf}, - // Block 0x6b, offset 0x20f - {value: 0x0000, lo: 0x01}, - {value: 0x8100, lo: 0x81, hi: 0x8c}, - // Block 0x6c, offset 0x211 - {value: 0x0000, lo: 0x01}, - {value: 0x8100, lo: 0xb5, hi: 0xba}, - // Block 0x6d, offset 0x213 - {value: 0x0000, lo: 0x04}, - {value: 0x4ab6, lo: 0x9e, hi: 0x9f}, - {value: 0x4ab6, lo: 0xa3, hi: 0xa3}, - {value: 0x4ab6, lo: 0xa5, hi: 0xa6}, - {value: 0x4ab6, lo: 0xaa, hi: 0xaf}, - // Block 0x6e, offset 0x218 - {value: 0x0000, lo: 0x05}, - {value: 0x4ab6, lo: 0x82, hi: 0x87}, - {value: 0x4ab6, lo: 0x8a, hi: 0x8f}, - {value: 0x4ab6, lo: 0x92, hi: 0x97}, - {value: 0x4ab6, lo: 0x9a, hi: 0x9c}, - {value: 0x8100, lo: 0xa3, hi: 0xa3}, - // Block 0x6f, offset 0x21e - {value: 0x0000, lo: 0x01}, - {value: 0x812e, lo: 0xbd, hi: 0xbd}, - // Block 0x70, offset 0x220 - {value: 0x0000, lo: 0x01}, - {value: 0x812e, lo: 0xa0, hi: 0xa0}, - // Block 0x71, offset 0x222 - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0xb6, hi: 0xba}, - // Block 0x72, offset 0x224 - {value: 0x002d, lo: 0x05}, - {value: 0x812e, lo: 0x8d, hi: 0x8d}, - {value: 0x8133, lo: 0x8f, hi: 0x8f}, - {value: 0x8133, lo: 0xb8, hi: 0xb8}, - {value: 0x8101, lo: 0xb9, hi: 0xba}, - {value: 0x8105, lo: 0xbf, hi: 0xbf}, - // Block 0x73, offset 0x22a - {value: 0x0000, lo: 0x02}, - {value: 0x8133, lo: 0xa5, hi: 0xa5}, - {value: 0x812e, lo: 0xa6, hi: 0xa6}, - // Block 0x74, offset 0x22d - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0xa4, hi: 0xa7}, - // Block 0x75, offset 0x22f - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0xab, hi: 0xac}, - // Block 0x76, offset 0x231 - {value: 0x0000, lo: 0x05}, - {value: 0x812e, lo: 0x86, hi: 0x87}, - {value: 0x8133, lo: 0x88, hi: 0x8a}, - {value: 0x812e, lo: 0x8b, hi: 0x8b}, - {value: 0x8133, lo: 0x8c, hi: 0x8c}, - {value: 0x812e, lo: 0x8d, hi: 0x90}, - // Block 0x77, offset 0x237 - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0x86, hi: 0x86}, - {value: 0x8105, lo: 0xbf, hi: 0xbf}, - // Block 0x78, offset 0x23a - {value: 0x17fe, lo: 0x07}, - {value: 0xa000, lo: 0x99, hi: 0x99}, - {value: 0x424f, lo: 0x9a, hi: 0x9a}, - {value: 0xa000, lo: 0x9b, hi: 0x9b}, - {value: 0x4259, lo: 0x9c, hi: 0x9c}, - {value: 0xa000, lo: 0xa5, hi: 0xa5}, - {value: 0x4263, lo: 0xab, hi: 0xab}, - {value: 0x8105, lo: 0xb9, hi: 0xba}, - // Block 0x79, offset 0x242 - {value: 0x0000, lo: 0x06}, - {value: 0x8133, lo: 0x80, hi: 0x82}, - {value: 0x9900, lo: 0xa7, hi: 0xa7}, - {value: 0x2d8b, lo: 0xae, hi: 0xae}, - {value: 0x2d95, lo: 0xaf, hi: 0xaf}, - {value: 0xa000, lo: 0xb1, hi: 0xb2}, - {value: 0x8105, lo: 0xb3, hi: 0xb4}, - // Block 0x7a, offset 0x249 - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0x80, hi: 0x80}, - {value: 0x8103, lo: 0x8a, hi: 0x8a}, - // Block 0x7b, offset 0x24c - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0xb5, hi: 0xb5}, - {value: 0x8103, lo: 0xb6, hi: 0xb6}, - // Block 0x7c, offset 0x24f - {value: 0x0002, lo: 0x01}, - {value: 0x8103, lo: 0xa9, hi: 0xaa}, - // Block 0x7d, offset 0x251 - {value: 0x0000, lo: 0x02}, - {value: 0x8103, lo: 0xbb, hi: 0xbc}, - {value: 0x9900, lo: 0xbe, hi: 0xbe}, - // Block 0x7e, offset 0x254 - {value: 0x0000, lo: 0x07}, - {value: 0xa000, lo: 0x87, hi: 0x87}, - {value: 0x2d9f, lo: 0x8b, hi: 0x8b}, - {value: 0x2da9, lo: 0x8c, hi: 0x8c}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x9900, lo: 0x97, hi: 0x97}, - {value: 0x8133, lo: 0xa6, hi: 0xac}, - {value: 0x8133, lo: 0xb0, hi: 0xb4}, - // Block 0x7f, offset 0x25c - {value: 0x0000, lo: 0x03}, - {value: 0x8105, lo: 0x82, hi: 0x82}, - {value: 0x8103, lo: 0x86, hi: 0x86}, - {value: 0x8133, lo: 0x9e, hi: 0x9e}, - // Block 0x80, offset 0x260 - {value: 0x6b4d, lo: 0x06}, - {value: 0x9900, lo: 0xb0, hi: 0xb0}, - {value: 0xa000, lo: 0xb9, hi: 0xb9}, - {value: 0x9900, lo: 0xba, hi: 0xba}, - {value: 0x2dbd, lo: 0xbb, hi: 0xbb}, - {value: 0x2db3, lo: 0xbc, hi: 0xbd}, - {value: 0x2dc7, lo: 0xbe, hi: 0xbe}, - // Block 0x81, offset 0x267 - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0x82, hi: 0x82}, - {value: 0x8103, lo: 0x83, hi: 0x83}, - // Block 0x82, offset 0x26a - {value: 0x0000, lo: 0x05}, - {value: 0x9900, lo: 0xaf, hi: 0xaf}, - {value: 0xa000, lo: 0xb8, hi: 0xb9}, - {value: 0x2dd1, lo: 0xba, hi: 0xba}, - {value: 0x2ddb, lo: 0xbb, hi: 0xbb}, - {value: 0x8105, lo: 0xbf, hi: 0xbf}, - // Block 0x83, offset 0x270 - {value: 0x0000, lo: 0x01}, - {value: 0x8103, lo: 0x80, hi: 0x80}, - // Block 0x84, offset 0x272 - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0xb6, hi: 0xb6}, - {value: 0x8103, lo: 0xb7, hi: 0xb7}, - // Block 0x85, offset 0x275 - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0xab, hi: 0xab}, - // Block 0x86, offset 0x277 - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0xb9, hi: 0xb9}, - {value: 0x8103, lo: 0xba, hi: 0xba}, - // Block 0x87, offset 0x27a - {value: 0x0000, lo: 0x04}, - {value: 0x9900, lo: 0xb0, hi: 0xb0}, - {value: 0xa000, lo: 0xb5, hi: 0xb5}, - {value: 0x2de5, lo: 0xb8, hi: 0xb8}, - {value: 0x8105, lo: 0xbd, hi: 0xbe}, - // Block 0x88, offset 0x27f - {value: 0x0000, lo: 0x01}, - {value: 0x8103, lo: 0x83, hi: 0x83}, - // Block 0x89, offset 0x281 - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0xa0, hi: 0xa0}, - // Block 0x8a, offset 0x283 - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0xb4, hi: 0xb4}, - // Block 0x8b, offset 0x285 - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0x87, hi: 0x87}, - // Block 0x8c, offset 0x287 - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0x99, hi: 0x99}, - // Block 0x8d, offset 0x289 - {value: 0x0000, lo: 0x02}, - {value: 0x8103, lo: 0x82, hi: 0x82}, - {value: 0x8105, lo: 0x84, hi: 0x85}, - // Block 0x8e, offset 0x28c - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0x97, hi: 0x97}, - // Block 0x8f, offset 0x28e - {value: 0x0000, lo: 0x01}, - {value: 0x8101, lo: 0xb0, hi: 0xb4}, - // Block 0x90, offset 0x290 - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0xb0, hi: 0xb6}, - // Block 0x91, offset 0x292 - {value: 0x0000, lo: 0x01}, - {value: 0x8102, lo: 0xb0, hi: 0xb1}, - // Block 0x92, offset 0x294 - {value: 0x0000, lo: 0x01}, - {value: 0x8101, lo: 0x9e, hi: 0x9e}, - // Block 0x93, offset 0x296 - {value: 0x0000, lo: 0x0c}, - {value: 0x45e3, lo: 0x9e, hi: 0x9e}, - {value: 0x45ed, lo: 0x9f, hi: 0x9f}, - {value: 0x4621, lo: 0xa0, hi: 0xa0}, - {value: 0x462f, lo: 0xa1, hi: 0xa1}, - {value: 0x463d, lo: 0xa2, hi: 0xa2}, - {value: 0x464b, lo: 0xa3, hi: 0xa3}, - {value: 0x4659, lo: 0xa4, hi: 0xa4}, - {value: 0x812c, lo: 0xa5, hi: 0xa6}, - {value: 0x8101, lo: 0xa7, hi: 0xa9}, - {value: 0x8131, lo: 0xad, hi: 0xad}, - {value: 0x812c, lo: 0xae, hi: 0xb2}, - {value: 0x812e, lo: 0xbb, hi: 0xbf}, - // Block 0x94, offset 0x2a3 - {value: 0x0000, lo: 0x09}, - {value: 0x812e, lo: 0x80, hi: 0x82}, - {value: 0x8133, lo: 0x85, hi: 0x89}, - {value: 0x812e, lo: 0x8a, hi: 0x8b}, - {value: 0x8133, lo: 0xaa, hi: 0xad}, - {value: 0x45f7, lo: 0xbb, hi: 0xbb}, - {value: 0x4601, lo: 0xbc, hi: 0xbc}, - {value: 0x4667, lo: 0xbd, hi: 0xbd}, - {value: 0x4683, lo: 0xbe, hi: 0xbe}, - {value: 0x4675, lo: 0xbf, hi: 0xbf}, - // Block 0x95, offset 0x2ad - {value: 0x0000, lo: 0x01}, - {value: 0x4691, lo: 0x80, hi: 0x80}, - // Block 0x96, offset 0x2af - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0x82, hi: 0x84}, - // Block 0x97, offset 0x2b1 - {value: 0x0000, lo: 0x05}, - {value: 0x8133, lo: 0x80, hi: 0x86}, - {value: 0x8133, lo: 0x88, hi: 0x98}, - {value: 0x8133, lo: 0x9b, hi: 0xa1}, - {value: 0x8133, lo: 0xa3, hi: 0xa4}, - {value: 0x8133, lo: 0xa6, hi: 0xaa}, - // Block 0x98, offset 0x2b7 - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0xac, hi: 0xaf}, - // Block 0x99, offset 0x2b9 - {value: 0x0000, lo: 0x01}, - {value: 0x812e, lo: 0x90, hi: 0x96}, - // Block 0x9a, offset 0x2bb - {value: 0x0000, lo: 0x02}, - {value: 0x8133, lo: 0x84, hi: 0x89}, - {value: 0x8103, lo: 0x8a, hi: 0x8a}, - // Block 0x9b, offset 0x2be - {value: 0x0000, lo: 0x01}, - {value: 0x8100, lo: 0x93, hi: 0x93}, -} - -// lookup returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *nfkcTrie) lookup(s []byte) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return nfkcValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := nfkcIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := nfkcIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = nfkcIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := nfkcIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = nfkcIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = nfkcIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *nfkcTrie) lookupUnsafe(s []byte) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return nfkcValues[c0] - } - i := nfkcIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = nfkcIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = nfkcIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// lookupString returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *nfkcTrie) lookupString(s string) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return nfkcValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := nfkcIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := nfkcIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = nfkcIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := nfkcIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = nfkcIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = nfkcIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *nfkcTrie) lookupStringUnsafe(s string) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return nfkcValues[c0] - } - i := nfkcIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = nfkcIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = nfkcIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// nfkcTrie. Total size: 18768 bytes (18.33 KiB). Checksum: c51186dd2412943d. -type nfkcTrie struct{} - -func newNfkcTrie(i int) *nfkcTrie { - return &nfkcTrie{} -} - -// lookupValue determines the type of block n and looks up the value for b. -func (t *nfkcTrie) lookupValue(n uint32, b byte) uint16 { - switch { - case n < 92: - return uint16(nfkcValues[n<<6+uint32(b)]) - default: - n -= 92 - return uint16(nfkcSparse.lookup(n, b)) - } -} - -// nfkcValues: 94 blocks, 6016 entries, 12032 bytes -// The third block is the zero block. -var nfkcValues = [6016]uint16{ - // Block 0x0, offset 0x0 - 0x3c: 0xa000, 0x3d: 0xa000, 0x3e: 0xa000, - // Block 0x1, offset 0x40 - 0x41: 0xa000, 0x42: 0xa000, 0x43: 0xa000, 0x44: 0xa000, 0x45: 0xa000, - 0x46: 0xa000, 0x47: 0xa000, 0x48: 0xa000, 0x49: 0xa000, 0x4a: 0xa000, 0x4b: 0xa000, - 0x4c: 0xa000, 0x4d: 0xa000, 0x4e: 0xa000, 0x4f: 0xa000, 0x50: 0xa000, - 0x52: 0xa000, 0x53: 0xa000, 0x54: 0xa000, 0x55: 0xa000, 0x56: 0xa000, 0x57: 0xa000, - 0x58: 0xa000, 0x59: 0xa000, 0x5a: 0xa000, - 0x61: 0xa000, 0x62: 0xa000, 0x63: 0xa000, - 0x64: 0xa000, 0x65: 0xa000, 0x66: 0xa000, 0x67: 0xa000, 0x68: 0xa000, 0x69: 0xa000, - 0x6a: 0xa000, 0x6b: 0xa000, 0x6c: 0xa000, 0x6d: 0xa000, 0x6e: 0xa000, 0x6f: 0xa000, - 0x70: 0xa000, 0x72: 0xa000, 0x73: 0xa000, 0x74: 0xa000, 0x75: 0xa000, - 0x76: 0xa000, 0x77: 0xa000, 0x78: 0xa000, 0x79: 0xa000, 0x7a: 0xa000, - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xc0: 0x2f86, 0xc1: 0x2f8b, 0xc2: 0x469f, 0xc3: 0x2f90, 0xc4: 0x46ae, 0xc5: 0x46b3, - 0xc6: 0xa000, 0xc7: 0x46bd, 0xc8: 0x2ff9, 0xc9: 0x2ffe, 0xca: 0x46c2, 0xcb: 0x3012, - 0xcc: 0x3085, 0xcd: 0x308a, 0xce: 0x308f, 0xcf: 0x46d6, 0xd1: 0x311b, - 0xd2: 0x313e, 0xd3: 0x3143, 0xd4: 0x46e0, 0xd5: 0x46e5, 0xd6: 0x46f4, - 0xd8: 0xa000, 0xd9: 0x31ca, 0xda: 0x31cf, 0xdb: 0x31d4, 0xdc: 0x4726, 0xdd: 0x324c, - 0xe0: 0x3292, 0xe1: 0x3297, 0xe2: 0x4730, 0xe3: 0x329c, - 0xe4: 0x473f, 0xe5: 0x4744, 0xe6: 0xa000, 0xe7: 0x474e, 0xe8: 0x3305, 0xe9: 0x330a, - 0xea: 0x4753, 0xeb: 0x331e, 0xec: 0x3396, 0xed: 0x339b, 0xee: 0x33a0, 0xef: 0x4767, - 0xf1: 0x342c, 0xf2: 0x344f, 0xf3: 0x3454, 0xf4: 0x4771, 0xf5: 0x4776, - 0xf6: 0x4785, 0xf8: 0xa000, 0xf9: 0x34e0, 0xfa: 0x34e5, 0xfb: 0x34ea, - 0xfc: 0x47b7, 0xfd: 0x3567, 0xff: 0x3580, - // Block 0x4, offset 0x100 - 0x100: 0x2f95, 0x101: 0x32a1, 0x102: 0x46a4, 0x103: 0x4735, 0x104: 0x2fb3, 0x105: 0x32bf, - 0x106: 0x2fc7, 0x107: 0x32d3, 0x108: 0x2fcc, 0x109: 0x32d8, 0x10a: 0x2fd1, 0x10b: 0x32dd, - 0x10c: 0x2fd6, 0x10d: 0x32e2, 0x10e: 0x2fe0, 0x10f: 0x32ec, - 0x112: 0x46c7, 0x113: 0x4758, 0x114: 0x3008, 0x115: 0x3314, 0x116: 0x300d, 0x117: 0x3319, - 0x118: 0x302b, 0x119: 0x3337, 0x11a: 0x301c, 0x11b: 0x3328, 0x11c: 0x3044, 0x11d: 0x3350, - 0x11e: 0x304e, 0x11f: 0x335a, 0x120: 0x3053, 0x121: 0x335f, 0x122: 0x305d, 0x123: 0x3369, - 0x124: 0x3062, 0x125: 0x336e, 0x128: 0x3094, 0x129: 0x33a5, - 0x12a: 0x3099, 0x12b: 0x33aa, 0x12c: 0x309e, 0x12d: 0x33af, 0x12e: 0x30c1, 0x12f: 0x33cd, - 0x130: 0x30a3, 0x132: 0x1960, 0x133: 0x19ed, 0x134: 0x30cb, 0x135: 0x33d7, - 0x136: 0x30df, 0x137: 0x33f0, 0x139: 0x30e9, 0x13a: 0x33fa, 0x13b: 0x30f3, - 0x13c: 0x3404, 0x13d: 0x30ee, 0x13e: 0x33ff, 0x13f: 0x1bb2, - // Block 0x5, offset 0x140 - 0x140: 0x1c3a, 0x143: 0x3116, 0x144: 0x3427, 0x145: 0x312f, - 0x146: 0x3440, 0x147: 0x3125, 0x148: 0x3436, 0x149: 0x1c62, - 0x14c: 0x46ea, 0x14d: 0x477b, 0x14e: 0x3148, 0x14f: 0x3459, 0x150: 0x3152, 0x151: 0x3463, - 0x154: 0x3170, 0x155: 0x3481, 0x156: 0x3189, 0x157: 0x349a, - 0x158: 0x317a, 0x159: 0x348b, 0x15a: 0x470d, 0x15b: 0x479e, 0x15c: 0x3193, 0x15d: 0x34a4, - 0x15e: 0x31a2, 0x15f: 0x34b3, 0x160: 0x4712, 0x161: 0x47a3, 0x162: 0x31bb, 0x163: 0x34d1, - 0x164: 0x31ac, 0x165: 0x34c2, 0x168: 0x471c, 0x169: 0x47ad, - 0x16a: 0x4721, 0x16b: 0x47b2, 0x16c: 0x31d9, 0x16d: 0x34ef, 0x16e: 0x31e3, 0x16f: 0x34f9, - 0x170: 0x31e8, 0x171: 0x34fe, 0x172: 0x3206, 0x173: 0x351c, 0x174: 0x3229, 0x175: 0x353f, - 0x176: 0x3251, 0x177: 0x356c, 0x178: 0x3265, 0x179: 0x3274, 0x17a: 0x3594, 0x17b: 0x327e, - 0x17c: 0x359e, 0x17d: 0x3283, 0x17e: 0x35a3, 0x17f: 0x00a7, - // Block 0x6, offset 0x180 - 0x184: 0x2e05, 0x185: 0x2e0b, - 0x186: 0x2e11, 0x187: 0x1975, 0x188: 0x1978, 0x189: 0x1a0e, 0x18a: 0x198d, 0x18b: 0x1990, - 0x18c: 0x1a44, 0x18d: 0x2f9f, 0x18e: 0x32ab, 0x18f: 0x30ad, 0x190: 0x33b9, 0x191: 0x3157, - 0x192: 0x3468, 0x193: 0x31ed, 0x194: 0x3503, 0x195: 0x39e6, 0x196: 0x3b75, 0x197: 0x39df, - 0x198: 0x3b6e, 0x199: 0x39ed, 0x19a: 0x3b7c, 0x19b: 0x39d8, 0x19c: 0x3b67, - 0x19e: 0x38c7, 0x19f: 0x3a56, 0x1a0: 0x38c0, 0x1a1: 0x3a4f, 0x1a2: 0x35ca, 0x1a3: 0x35dc, - 0x1a6: 0x3058, 0x1a7: 0x3364, 0x1a8: 0x30d5, 0x1a9: 0x33e6, - 0x1aa: 0x4703, 0x1ab: 0x4794, 0x1ac: 0x39a7, 0x1ad: 0x3b36, 0x1ae: 0x35ee, 0x1af: 0x35f4, - 0x1b0: 0x33dc, 0x1b1: 0x1945, 0x1b2: 0x1948, 0x1b3: 0x19d5, 0x1b4: 0x303f, 0x1b5: 0x334b, - 0x1b8: 0x3111, 0x1b9: 0x3422, 0x1ba: 0x38ce, 0x1bb: 0x3a5d, - 0x1bc: 0x35c4, 0x1bd: 0x35d6, 0x1be: 0x35d0, 0x1bf: 0x35e2, - // Block 0x7, offset 0x1c0 - 0x1c0: 0x2fa4, 0x1c1: 0x32b0, 0x1c2: 0x2fa9, 0x1c3: 0x32b5, 0x1c4: 0x3021, 0x1c5: 0x332d, - 0x1c6: 0x3026, 0x1c7: 0x3332, 0x1c8: 0x30b2, 0x1c9: 0x33be, 0x1ca: 0x30b7, 0x1cb: 0x33c3, - 0x1cc: 0x315c, 0x1cd: 0x346d, 0x1ce: 0x3161, 0x1cf: 0x3472, 0x1d0: 0x317f, 0x1d1: 0x3490, - 0x1d2: 0x3184, 0x1d3: 0x3495, 0x1d4: 0x31f2, 0x1d5: 0x3508, 0x1d6: 0x31f7, 0x1d7: 0x350d, - 0x1d8: 0x319d, 0x1d9: 0x34ae, 0x1da: 0x31b6, 0x1db: 0x34cc, - 0x1de: 0x3071, 0x1df: 0x337d, - 0x1e6: 0x46a9, 0x1e7: 0x473a, 0x1e8: 0x46d1, 0x1e9: 0x4762, - 0x1ea: 0x3976, 0x1eb: 0x3b05, 0x1ec: 0x3953, 0x1ed: 0x3ae2, 0x1ee: 0x46ef, 0x1ef: 0x4780, - 0x1f0: 0x396f, 0x1f1: 0x3afe, 0x1f2: 0x325b, 0x1f3: 0x3576, - // Block 0x8, offset 0x200 - 0x200: 0x9933, 0x201: 0x9933, 0x202: 0x9933, 0x203: 0x9933, 0x204: 0x9933, 0x205: 0x8133, - 0x206: 0x9933, 0x207: 0x9933, 0x208: 0x9933, 0x209: 0x9933, 0x20a: 0x9933, 0x20b: 0x9933, - 0x20c: 0x9933, 0x20d: 0x8133, 0x20e: 0x8133, 0x20f: 0x9933, 0x210: 0x8133, 0x211: 0x9933, - 0x212: 0x8133, 0x213: 0x9933, 0x214: 0x9933, 0x215: 0x8134, 0x216: 0x812e, 0x217: 0x812e, - 0x218: 0x812e, 0x219: 0x812e, 0x21a: 0x8134, 0x21b: 0x992c, 0x21c: 0x812e, 0x21d: 0x812e, - 0x21e: 0x812e, 0x21f: 0x812e, 0x220: 0x812e, 0x221: 0x812a, 0x222: 0x812a, 0x223: 0x992e, - 0x224: 0x992e, 0x225: 0x992e, 0x226: 0x992e, 0x227: 0x992a, 0x228: 0x992a, 0x229: 0x812e, - 0x22a: 0x812e, 0x22b: 0x812e, 0x22c: 0x812e, 0x22d: 0x992e, 0x22e: 0x992e, 0x22f: 0x812e, - 0x230: 0x992e, 0x231: 0x992e, 0x232: 0x812e, 0x233: 0x812e, 0x234: 0x8101, 0x235: 0x8101, - 0x236: 0x8101, 0x237: 0x8101, 0x238: 0x9901, 0x239: 0x812e, 0x23a: 0x812e, 0x23b: 0x812e, - 0x23c: 0x812e, 0x23d: 0x8133, 0x23e: 0x8133, 0x23f: 0x8133, - // Block 0x9, offset 0x240 - 0x240: 0x49c5, 0x241: 0x49ca, 0x242: 0x9933, 0x243: 0x49cf, 0x244: 0x4a88, 0x245: 0x9937, - 0x246: 0x8133, 0x247: 0x812e, 0x248: 0x812e, 0x249: 0x812e, 0x24a: 0x8133, 0x24b: 0x8133, - 0x24c: 0x8133, 0x24d: 0x812e, 0x24e: 0x812e, 0x250: 0x8133, 0x251: 0x8133, - 0x252: 0x8133, 0x253: 0x812e, 0x254: 0x812e, 0x255: 0x812e, 0x256: 0x812e, 0x257: 0x8133, - 0x258: 0x8134, 0x259: 0x812e, 0x25a: 0x812e, 0x25b: 0x8133, 0x25c: 0x8135, 0x25d: 0x8136, - 0x25e: 0x8136, 0x25f: 0x8135, 0x260: 0x8136, 0x261: 0x8136, 0x262: 0x8135, 0x263: 0x8133, - 0x264: 0x8133, 0x265: 0x8133, 0x266: 0x8133, 0x267: 0x8133, 0x268: 0x8133, 0x269: 0x8133, - 0x26a: 0x8133, 0x26b: 0x8133, 0x26c: 0x8133, 0x26d: 0x8133, 0x26e: 0x8133, 0x26f: 0x8133, - 0x274: 0x0173, - 0x27a: 0x42bc, - 0x27e: 0x0037, - // Block 0xa, offset 0x280 - 0x284: 0x4271, 0x285: 0x4492, - 0x286: 0x3600, 0x287: 0x00ce, 0x288: 0x361e, 0x289: 0x362a, 0x28a: 0x363c, - 0x28c: 0x365a, 0x28e: 0x366c, 0x28f: 0x368a, 0x290: 0x3e1f, 0x291: 0xa000, - 0x295: 0xa000, 0x297: 0xa000, - 0x299: 0xa000, - 0x29f: 0xa000, 0x2a1: 0xa000, - 0x2a5: 0xa000, 0x2a9: 0xa000, - 0x2aa: 0x364e, 0x2ab: 0x367e, 0x2ac: 0x4815, 0x2ad: 0x36ae, 0x2ae: 0x483f, 0x2af: 0x36c0, - 0x2b0: 0x3e87, 0x2b1: 0xa000, 0x2b5: 0xa000, - 0x2b7: 0xa000, 0x2b9: 0xa000, - 0x2bf: 0xa000, - // Block 0xb, offset 0x2c0 - 0x2c1: 0xa000, 0x2c5: 0xa000, - 0x2c9: 0xa000, 0x2ca: 0x4857, 0x2cb: 0x4875, - 0x2cc: 0x36de, 0x2cd: 0x36f6, 0x2ce: 0x488d, 0x2d0: 0x01c1, 0x2d1: 0x01d3, - 0x2d2: 0x01af, 0x2d3: 0x4323, 0x2d4: 0x4329, 0x2d5: 0x01fd, 0x2d6: 0x01eb, - 0x2f0: 0x01d9, 0x2f1: 0x01ee, 0x2f2: 0x01f1, 0x2f4: 0x018b, 0x2f5: 0x01ca, - 0x2f9: 0x01a9, - // Block 0xc, offset 0x300 - 0x300: 0x3738, 0x301: 0x3744, 0x303: 0x3732, - 0x306: 0xa000, 0x307: 0x3720, - 0x30c: 0x3774, 0x30d: 0x375c, 0x30e: 0x3786, 0x310: 0xa000, - 0x313: 0xa000, 0x315: 0xa000, 0x316: 0xa000, 0x317: 0xa000, - 0x318: 0xa000, 0x319: 0x3768, 0x31a: 0xa000, - 0x31e: 0xa000, 0x323: 0xa000, - 0x327: 0xa000, - 0x32b: 0xa000, 0x32d: 0xa000, - 0x330: 0xa000, 0x333: 0xa000, 0x335: 0xa000, - 0x336: 0xa000, 0x337: 0xa000, 0x338: 0xa000, 0x339: 0x37ec, 0x33a: 0xa000, - 0x33e: 0xa000, - // Block 0xd, offset 0x340 - 0x341: 0x374a, 0x342: 0x37ce, - 0x350: 0x3726, 0x351: 0x37aa, - 0x352: 0x372c, 0x353: 0x37b0, 0x356: 0x373e, 0x357: 0x37c2, - 0x358: 0xa000, 0x359: 0xa000, 0x35a: 0x3840, 0x35b: 0x3846, 0x35c: 0x3750, 0x35d: 0x37d4, - 0x35e: 0x3756, 0x35f: 0x37da, 0x362: 0x3762, 0x363: 0x37e6, - 0x364: 0x376e, 0x365: 0x37f2, 0x366: 0x377a, 0x367: 0x37fe, 0x368: 0xa000, 0x369: 0xa000, - 0x36a: 0x384c, 0x36b: 0x3852, 0x36c: 0x37a4, 0x36d: 0x3828, 0x36e: 0x3780, 0x36f: 0x3804, - 0x370: 0x378c, 0x371: 0x3810, 0x372: 0x3792, 0x373: 0x3816, 0x374: 0x3798, 0x375: 0x381c, - 0x378: 0x379e, 0x379: 0x3822, - // Block 0xe, offset 0x380 - 0x387: 0x1d67, - 0x391: 0x812e, - 0x392: 0x8133, 0x393: 0x8133, 0x394: 0x8133, 0x395: 0x8133, 0x396: 0x812e, 0x397: 0x8133, - 0x398: 0x8133, 0x399: 0x8133, 0x39a: 0x812f, 0x39b: 0x812e, 0x39c: 0x8133, 0x39d: 0x8133, - 0x39e: 0x8133, 0x39f: 0x8133, 0x3a0: 0x8133, 0x3a1: 0x8133, 0x3a2: 0x812e, 0x3a3: 0x812e, - 0x3a4: 0x812e, 0x3a5: 0x812e, 0x3a6: 0x812e, 0x3a7: 0x812e, 0x3a8: 0x8133, 0x3a9: 0x8133, - 0x3aa: 0x812e, 0x3ab: 0x8133, 0x3ac: 0x8133, 0x3ad: 0x812f, 0x3ae: 0x8132, 0x3af: 0x8133, - 0x3b0: 0x8106, 0x3b1: 0x8107, 0x3b2: 0x8108, 0x3b3: 0x8109, 0x3b4: 0x810a, 0x3b5: 0x810b, - 0x3b6: 0x810c, 0x3b7: 0x810d, 0x3b8: 0x810e, 0x3b9: 0x810f, 0x3ba: 0x810f, 0x3bb: 0x8110, - 0x3bc: 0x8111, 0x3bd: 0x8112, 0x3bf: 0x8113, - // Block 0xf, offset 0x3c0 - 0x3c8: 0xa000, 0x3ca: 0xa000, 0x3cb: 0x8117, - 0x3cc: 0x8118, 0x3cd: 0x8119, 0x3ce: 0x811a, 0x3cf: 0x811b, 0x3d0: 0x811c, 0x3d1: 0x811d, - 0x3d2: 0x811e, 0x3d3: 0x9933, 0x3d4: 0x9933, 0x3d5: 0x992e, 0x3d6: 0x812e, 0x3d7: 0x8133, - 0x3d8: 0x8133, 0x3d9: 0x8133, 0x3da: 0x8133, 0x3db: 0x8133, 0x3dc: 0x812e, 0x3dd: 0x8133, - 0x3de: 0x8133, 0x3df: 0x812e, - 0x3f0: 0x811f, 0x3f5: 0x1d8a, - 0x3f6: 0x2019, 0x3f7: 0x2055, 0x3f8: 0x2050, - // Block 0x10, offset 0x400 - 0x413: 0x812e, 0x414: 0x8133, 0x415: 0x8133, 0x416: 0x8133, 0x417: 0x8133, - 0x418: 0x8133, 0x419: 0x8133, 0x41a: 0x8133, 0x41b: 0x8133, 0x41c: 0x8133, 0x41d: 0x8133, - 0x41e: 0x8133, 0x41f: 0x8133, 0x420: 0x8133, 0x421: 0x8133, 0x423: 0x812e, - 0x424: 0x8133, 0x425: 0x8133, 0x426: 0x812e, 0x427: 0x8133, 0x428: 0x8133, 0x429: 0x812e, - 0x42a: 0x8133, 0x42b: 0x8133, 0x42c: 0x8133, 0x42d: 0x812e, 0x42e: 0x812e, 0x42f: 0x812e, - 0x430: 0x8117, 0x431: 0x8118, 0x432: 0x8119, 0x433: 0x8133, 0x434: 0x8133, 0x435: 0x8133, - 0x436: 0x812e, 0x437: 0x8133, 0x438: 0x8133, 0x439: 0x812e, 0x43a: 0x812e, 0x43b: 0x8133, - 0x43c: 0x8133, 0x43d: 0x8133, 0x43e: 0x8133, 0x43f: 0x8133, - // Block 0x11, offset 0x440 - 0x445: 0xa000, - 0x446: 0x2d33, 0x447: 0xa000, 0x448: 0x2d3b, 0x449: 0xa000, 0x44a: 0x2d43, 0x44b: 0xa000, - 0x44c: 0x2d4b, 0x44d: 0xa000, 0x44e: 0x2d53, 0x451: 0xa000, - 0x452: 0x2d5b, - 0x474: 0x8103, 0x475: 0x9900, - 0x47a: 0xa000, 0x47b: 0x2d63, - 0x47c: 0xa000, 0x47d: 0x2d6b, 0x47e: 0xa000, 0x47f: 0xa000, - // Block 0x12, offset 0x480 - 0x480: 0x0069, 0x481: 0x006b, 0x482: 0x006f, 0x483: 0x0083, 0x484: 0x00f5, 0x485: 0x00f8, - 0x486: 0x0416, 0x487: 0x0085, 0x488: 0x0089, 0x489: 0x008b, 0x48a: 0x0104, 0x48b: 0x0107, - 0x48c: 0x010a, 0x48d: 0x008f, 0x48f: 0x0097, 0x490: 0x009b, 0x491: 0x00e0, - 0x492: 0x009f, 0x493: 0x00fe, 0x494: 0x041a, 0x495: 0x041e, 0x496: 0x00a1, 0x497: 0x00a9, - 0x498: 0x00ab, 0x499: 0x0426, 0x49a: 0x012b, 0x49b: 0x00ad, 0x49c: 0x042a, 0x49d: 0x01c1, - 0x49e: 0x01c4, 0x49f: 0x01c7, 0x4a0: 0x01fd, 0x4a1: 0x0200, 0x4a2: 0x0093, 0x4a3: 0x00a5, - 0x4a4: 0x00ab, 0x4a5: 0x00ad, 0x4a6: 0x01c1, 0x4a7: 0x01c4, 0x4a8: 0x01ee, 0x4a9: 0x01fd, - 0x4aa: 0x0200, - 0x4b8: 0x020f, - // Block 0x13, offset 0x4c0 - 0x4db: 0x00fb, 0x4dc: 0x0087, 0x4dd: 0x0101, - 0x4de: 0x00d4, 0x4df: 0x010a, 0x4e0: 0x008d, 0x4e1: 0x010d, 0x4e2: 0x0110, 0x4e3: 0x0116, - 0x4e4: 0x011c, 0x4e5: 0x011f, 0x4e6: 0x0122, 0x4e7: 0x042e, 0x4e8: 0x016d, 0x4e9: 0x0128, - 0x4ea: 0x0432, 0x4eb: 0x0170, 0x4ec: 0x0131, 0x4ed: 0x012e, 0x4ee: 0x0134, 0x4ef: 0x0137, - 0x4f0: 0x013a, 0x4f1: 0x013d, 0x4f2: 0x0140, 0x4f3: 0x014c, 0x4f4: 0x014f, 0x4f5: 0x00ec, - 0x4f6: 0x0152, 0x4f7: 0x0155, 0x4f8: 0x0422, 0x4f9: 0x0158, 0x4fa: 0x015b, 0x4fb: 0x00b5, - 0x4fc: 0x0161, 0x4fd: 0x0164, 0x4fe: 0x0167, 0x4ff: 0x01d3, - // Block 0x14, offset 0x500 - 0x500: 0x8133, 0x501: 0x8133, 0x502: 0x812e, 0x503: 0x8133, 0x504: 0x8133, 0x505: 0x8133, - 0x506: 0x8133, 0x507: 0x8133, 0x508: 0x8133, 0x509: 0x8133, 0x50a: 0x812e, 0x50b: 0x8133, - 0x50c: 0x8133, 0x50d: 0x8136, 0x50e: 0x812b, 0x50f: 0x812e, 0x510: 0x812a, 0x511: 0x8133, - 0x512: 0x8133, 0x513: 0x8133, 0x514: 0x8133, 0x515: 0x8133, 0x516: 0x8133, 0x517: 0x8133, - 0x518: 0x8133, 0x519: 0x8133, 0x51a: 0x8133, 0x51b: 0x8133, 0x51c: 0x8133, 0x51d: 0x8133, - 0x51e: 0x8133, 0x51f: 0x8133, 0x520: 0x8133, 0x521: 0x8133, 0x522: 0x8133, 0x523: 0x8133, - 0x524: 0x8133, 0x525: 0x8133, 0x526: 0x8133, 0x527: 0x8133, 0x528: 0x8133, 0x529: 0x8133, - 0x52a: 0x8133, 0x52b: 0x8133, 0x52c: 0x8133, 0x52d: 0x8133, 0x52e: 0x8133, 0x52f: 0x8133, - 0x530: 0x8133, 0x531: 0x8133, 0x532: 0x8133, 0x533: 0x8133, 0x534: 0x8133, 0x535: 0x8133, - 0x536: 0x8134, 0x537: 0x8132, 0x538: 0x8132, 0x539: 0x812e, 0x53b: 0x8133, - 0x53c: 0x8135, 0x53d: 0x812e, 0x53e: 0x8133, 0x53f: 0x812e, - // Block 0x15, offset 0x540 - 0x540: 0x2fae, 0x541: 0x32ba, 0x542: 0x2fb8, 0x543: 0x32c4, 0x544: 0x2fbd, 0x545: 0x32c9, - 0x546: 0x2fc2, 0x547: 0x32ce, 0x548: 0x38e3, 0x549: 0x3a72, 0x54a: 0x2fdb, 0x54b: 0x32e7, - 0x54c: 0x2fe5, 0x54d: 0x32f1, 0x54e: 0x2ff4, 0x54f: 0x3300, 0x550: 0x2fea, 0x551: 0x32f6, - 0x552: 0x2fef, 0x553: 0x32fb, 0x554: 0x3906, 0x555: 0x3a95, 0x556: 0x390d, 0x557: 0x3a9c, - 0x558: 0x3030, 0x559: 0x333c, 0x55a: 0x3035, 0x55b: 0x3341, 0x55c: 0x391b, 0x55d: 0x3aaa, - 0x55e: 0x303a, 0x55f: 0x3346, 0x560: 0x3049, 0x561: 0x3355, 0x562: 0x3067, 0x563: 0x3373, - 0x564: 0x3076, 0x565: 0x3382, 0x566: 0x306c, 0x567: 0x3378, 0x568: 0x307b, 0x569: 0x3387, - 0x56a: 0x3080, 0x56b: 0x338c, 0x56c: 0x30c6, 0x56d: 0x33d2, 0x56e: 0x3922, 0x56f: 0x3ab1, - 0x570: 0x30d0, 0x571: 0x33e1, 0x572: 0x30da, 0x573: 0x33eb, 0x574: 0x30e4, 0x575: 0x33f5, - 0x576: 0x46db, 0x577: 0x476c, 0x578: 0x3929, 0x579: 0x3ab8, 0x57a: 0x30fd, 0x57b: 0x340e, - 0x57c: 0x30f8, 0x57d: 0x3409, 0x57e: 0x3102, 0x57f: 0x3413, - // Block 0x16, offset 0x580 - 0x580: 0x3107, 0x581: 0x3418, 0x582: 0x310c, 0x583: 0x341d, 0x584: 0x3120, 0x585: 0x3431, - 0x586: 0x312a, 0x587: 0x343b, 0x588: 0x3139, 0x589: 0x344a, 0x58a: 0x3134, 0x58b: 0x3445, - 0x58c: 0x394c, 0x58d: 0x3adb, 0x58e: 0x395a, 0x58f: 0x3ae9, 0x590: 0x3961, 0x591: 0x3af0, - 0x592: 0x3968, 0x593: 0x3af7, 0x594: 0x3166, 0x595: 0x3477, 0x596: 0x316b, 0x597: 0x347c, - 0x598: 0x3175, 0x599: 0x3486, 0x59a: 0x4708, 0x59b: 0x4799, 0x59c: 0x39ae, 0x59d: 0x3b3d, - 0x59e: 0x318e, 0x59f: 0x349f, 0x5a0: 0x3198, 0x5a1: 0x34a9, 0x5a2: 0x4717, 0x5a3: 0x47a8, - 0x5a4: 0x39b5, 0x5a5: 0x3b44, 0x5a6: 0x39bc, 0x5a7: 0x3b4b, 0x5a8: 0x39c3, 0x5a9: 0x3b52, - 0x5aa: 0x31a7, 0x5ab: 0x34b8, 0x5ac: 0x31b1, 0x5ad: 0x34c7, 0x5ae: 0x31c5, 0x5af: 0x34db, - 0x5b0: 0x31c0, 0x5b1: 0x34d6, 0x5b2: 0x3201, 0x5b3: 0x3517, 0x5b4: 0x3210, 0x5b5: 0x3526, - 0x5b6: 0x320b, 0x5b7: 0x3521, 0x5b8: 0x39ca, 0x5b9: 0x3b59, 0x5ba: 0x39d1, 0x5bb: 0x3b60, - 0x5bc: 0x3215, 0x5bd: 0x352b, 0x5be: 0x321a, 0x5bf: 0x3530, - // Block 0x17, offset 0x5c0 - 0x5c0: 0x321f, 0x5c1: 0x3535, 0x5c2: 0x3224, 0x5c3: 0x353a, 0x5c4: 0x3233, 0x5c5: 0x3549, - 0x5c6: 0x322e, 0x5c7: 0x3544, 0x5c8: 0x3238, 0x5c9: 0x3553, 0x5ca: 0x323d, 0x5cb: 0x3558, - 0x5cc: 0x3242, 0x5cd: 0x355d, 0x5ce: 0x3260, 0x5cf: 0x357b, 0x5d0: 0x3279, 0x5d1: 0x3599, - 0x5d2: 0x3288, 0x5d3: 0x35a8, 0x5d4: 0x328d, 0x5d5: 0x35ad, 0x5d6: 0x3391, 0x5d7: 0x34bd, - 0x5d8: 0x354e, 0x5d9: 0x358a, 0x5da: 0x1be6, 0x5db: 0x42ee, - 0x5e0: 0x46b8, 0x5e1: 0x4749, 0x5e2: 0x2f9a, 0x5e3: 0x32a6, - 0x5e4: 0x388f, 0x5e5: 0x3a1e, 0x5e6: 0x3888, 0x5e7: 0x3a17, 0x5e8: 0x389d, 0x5e9: 0x3a2c, - 0x5ea: 0x3896, 0x5eb: 0x3a25, 0x5ec: 0x38d5, 0x5ed: 0x3a64, 0x5ee: 0x38ab, 0x5ef: 0x3a3a, - 0x5f0: 0x38a4, 0x5f1: 0x3a33, 0x5f2: 0x38b9, 0x5f3: 0x3a48, 0x5f4: 0x38b2, 0x5f5: 0x3a41, - 0x5f6: 0x38dc, 0x5f7: 0x3a6b, 0x5f8: 0x46cc, 0x5f9: 0x475d, 0x5fa: 0x3017, 0x5fb: 0x3323, - 0x5fc: 0x3003, 0x5fd: 0x330f, 0x5fe: 0x38f1, 0x5ff: 0x3a80, - // Block 0x18, offset 0x600 - 0x600: 0x38ea, 0x601: 0x3a79, 0x602: 0x38ff, 0x603: 0x3a8e, 0x604: 0x38f8, 0x605: 0x3a87, - 0x606: 0x3914, 0x607: 0x3aa3, 0x608: 0x30a8, 0x609: 0x33b4, 0x60a: 0x30bc, 0x60b: 0x33c8, - 0x60c: 0x46fe, 0x60d: 0x478f, 0x60e: 0x314d, 0x60f: 0x345e, 0x610: 0x3937, 0x611: 0x3ac6, - 0x612: 0x3930, 0x613: 0x3abf, 0x614: 0x3945, 0x615: 0x3ad4, 0x616: 0x393e, 0x617: 0x3acd, - 0x618: 0x39a0, 0x619: 0x3b2f, 0x61a: 0x3984, 0x61b: 0x3b13, 0x61c: 0x397d, 0x61d: 0x3b0c, - 0x61e: 0x3992, 0x61f: 0x3b21, 0x620: 0x398b, 0x621: 0x3b1a, 0x622: 0x3999, 0x623: 0x3b28, - 0x624: 0x31fc, 0x625: 0x3512, 0x626: 0x31de, 0x627: 0x34f4, 0x628: 0x39fb, 0x629: 0x3b8a, - 0x62a: 0x39f4, 0x62b: 0x3b83, 0x62c: 0x3a09, 0x62d: 0x3b98, 0x62e: 0x3a02, 0x62f: 0x3b91, - 0x630: 0x3a10, 0x631: 0x3b9f, 0x632: 0x3247, 0x633: 0x3562, 0x634: 0x326f, 0x635: 0x358f, - 0x636: 0x326a, 0x637: 0x3585, 0x638: 0x3256, 0x639: 0x3571, - // Block 0x19, offset 0x640 - 0x640: 0x481b, 0x641: 0x4821, 0x642: 0x4935, 0x643: 0x494d, 0x644: 0x493d, 0x645: 0x4955, - 0x646: 0x4945, 0x647: 0x495d, 0x648: 0x47c1, 0x649: 0x47c7, 0x64a: 0x48a5, 0x64b: 0x48bd, - 0x64c: 0x48ad, 0x64d: 0x48c5, 0x64e: 0x48b5, 0x64f: 0x48cd, 0x650: 0x482d, 0x651: 0x4833, - 0x652: 0x3dcf, 0x653: 0x3ddf, 0x654: 0x3dd7, 0x655: 0x3de7, - 0x658: 0x47cd, 0x659: 0x47d3, 0x65a: 0x3cff, 0x65b: 0x3d0f, 0x65c: 0x3d07, 0x65d: 0x3d17, - 0x660: 0x4845, 0x661: 0x484b, 0x662: 0x4965, 0x663: 0x497d, - 0x664: 0x496d, 0x665: 0x4985, 0x666: 0x4975, 0x667: 0x498d, 0x668: 0x47d9, 0x669: 0x47df, - 0x66a: 0x48d5, 0x66b: 0x48ed, 0x66c: 0x48dd, 0x66d: 0x48f5, 0x66e: 0x48e5, 0x66f: 0x48fd, - 0x670: 0x485d, 0x671: 0x4863, 0x672: 0x3e2f, 0x673: 0x3e47, 0x674: 0x3e37, 0x675: 0x3e4f, - 0x676: 0x3e3f, 0x677: 0x3e57, 0x678: 0x47e5, 0x679: 0x47eb, 0x67a: 0x3d2f, 0x67b: 0x3d47, - 0x67c: 0x3d37, 0x67d: 0x3d4f, 0x67e: 0x3d3f, 0x67f: 0x3d57, - // Block 0x1a, offset 0x680 - 0x680: 0x4869, 0x681: 0x486f, 0x682: 0x3e5f, 0x683: 0x3e6f, 0x684: 0x3e67, 0x685: 0x3e77, - 0x688: 0x47f1, 0x689: 0x47f7, 0x68a: 0x3d5f, 0x68b: 0x3d6f, - 0x68c: 0x3d67, 0x68d: 0x3d77, 0x690: 0x487b, 0x691: 0x4881, - 0x692: 0x3e97, 0x693: 0x3eaf, 0x694: 0x3e9f, 0x695: 0x3eb7, 0x696: 0x3ea7, 0x697: 0x3ebf, - 0x699: 0x47fd, 0x69b: 0x3d7f, 0x69d: 0x3d87, - 0x69f: 0x3d8f, 0x6a0: 0x4893, 0x6a1: 0x4899, 0x6a2: 0x4995, 0x6a3: 0x49ad, - 0x6a4: 0x499d, 0x6a5: 0x49b5, 0x6a6: 0x49a5, 0x6a7: 0x49bd, 0x6a8: 0x4803, 0x6a9: 0x4809, - 0x6aa: 0x4905, 0x6ab: 0x491d, 0x6ac: 0x490d, 0x6ad: 0x4925, 0x6ae: 0x4915, 0x6af: 0x492d, - 0x6b0: 0x480f, 0x6b1: 0x4335, 0x6b2: 0x36a8, 0x6b3: 0x433b, 0x6b4: 0x4839, 0x6b5: 0x4341, - 0x6b6: 0x36ba, 0x6b7: 0x4347, 0x6b8: 0x36d8, 0x6b9: 0x434d, 0x6ba: 0x36f0, 0x6bb: 0x4353, - 0x6bc: 0x4887, 0x6bd: 0x4359, - // Block 0x1b, offset 0x6c0 - 0x6c0: 0x3db7, 0x6c1: 0x3dbf, 0x6c2: 0x419b, 0x6c3: 0x41b9, 0x6c4: 0x41a5, 0x6c5: 0x41c3, - 0x6c6: 0x41af, 0x6c7: 0x41cd, 0x6c8: 0x3cef, 0x6c9: 0x3cf7, 0x6ca: 0x40e7, 0x6cb: 0x4105, - 0x6cc: 0x40f1, 0x6cd: 0x410f, 0x6ce: 0x40fb, 0x6cf: 0x4119, 0x6d0: 0x3dff, 0x6d1: 0x3e07, - 0x6d2: 0x41d7, 0x6d3: 0x41f5, 0x6d4: 0x41e1, 0x6d5: 0x41ff, 0x6d6: 0x41eb, 0x6d7: 0x4209, - 0x6d8: 0x3d1f, 0x6d9: 0x3d27, 0x6da: 0x4123, 0x6db: 0x4141, 0x6dc: 0x412d, 0x6dd: 0x414b, - 0x6de: 0x4137, 0x6df: 0x4155, 0x6e0: 0x3ed7, 0x6e1: 0x3edf, 0x6e2: 0x4213, 0x6e3: 0x4231, - 0x6e4: 0x421d, 0x6e5: 0x423b, 0x6e6: 0x4227, 0x6e7: 0x4245, 0x6e8: 0x3d97, 0x6e9: 0x3d9f, - 0x6ea: 0x415f, 0x6eb: 0x417d, 0x6ec: 0x4169, 0x6ed: 0x4187, 0x6ee: 0x4173, 0x6ef: 0x4191, - 0x6f0: 0x369c, 0x6f1: 0x3696, 0x6f2: 0x3da7, 0x6f3: 0x36a2, 0x6f4: 0x3daf, - 0x6f6: 0x4827, 0x6f7: 0x3dc7, 0x6f8: 0x360c, 0x6f9: 0x3606, 0x6fa: 0x35fa, 0x6fb: 0x4305, - 0x6fc: 0x3612, 0x6fd: 0x429e, 0x6fe: 0x01d6, 0x6ff: 0x429e, - // Block 0x1c, offset 0x700 - 0x700: 0x42b7, 0x701: 0x4499, 0x702: 0x3def, 0x703: 0x36b4, 0x704: 0x3df7, - 0x706: 0x4851, 0x707: 0x3e0f, 0x708: 0x3618, 0x709: 0x430b, 0x70a: 0x3624, 0x70b: 0x4311, - 0x70c: 0x3630, 0x70d: 0x44a0, 0x70e: 0x44a7, 0x70f: 0x44ae, 0x710: 0x36cc, 0x711: 0x36c6, - 0x712: 0x3e17, 0x713: 0x44fb, 0x716: 0x36d2, 0x717: 0x3e27, - 0x718: 0x3648, 0x719: 0x3642, 0x71a: 0x3636, 0x71b: 0x4317, 0x71d: 0x44b5, - 0x71e: 0x44bc, 0x71f: 0x44c3, 0x720: 0x3702, 0x721: 0x36fc, 0x722: 0x3e7f, 0x723: 0x4503, - 0x724: 0x36e4, 0x725: 0x36ea, 0x726: 0x3708, 0x727: 0x3e8f, 0x728: 0x3678, 0x729: 0x3672, - 0x72a: 0x3666, 0x72b: 0x4323, 0x72c: 0x3660, 0x72d: 0x448b, 0x72e: 0x4492, 0x72f: 0x0081, - 0x732: 0x3ec7, 0x733: 0x370e, 0x734: 0x3ecf, - 0x736: 0x489f, 0x737: 0x3ee7, 0x738: 0x3654, 0x739: 0x431d, 0x73a: 0x3684, 0x73b: 0x432f, - 0x73c: 0x3690, 0x73d: 0x4271, 0x73e: 0x42a3, - // Block 0x1d, offset 0x740 - 0x740: 0x1bde, 0x741: 0x1be2, 0x742: 0x0047, 0x743: 0x1c5a, 0x745: 0x1bee, - 0x746: 0x1bf2, 0x747: 0x00e9, 0x749: 0x1c5e, 0x74a: 0x008f, 0x74b: 0x0051, - 0x74c: 0x0051, 0x74d: 0x0051, 0x74e: 0x0091, 0x74f: 0x00da, 0x750: 0x0053, 0x751: 0x0053, - 0x752: 0x0059, 0x753: 0x0099, 0x755: 0x005d, 0x756: 0x1993, - 0x759: 0x0061, 0x75a: 0x0063, 0x75b: 0x0065, 0x75c: 0x0065, 0x75d: 0x0065, - 0x760: 0x19a5, 0x761: 0x1bce, 0x762: 0x19ae, - 0x764: 0x0075, 0x766: 0x01bb, 0x768: 0x0075, - 0x76a: 0x0057, 0x76b: 0x42e9, 0x76c: 0x0045, 0x76d: 0x0047, 0x76f: 0x008b, - 0x770: 0x004b, 0x771: 0x004d, 0x773: 0x005b, 0x774: 0x009f, 0x775: 0x0218, - 0x776: 0x021b, 0x777: 0x021e, 0x778: 0x0221, 0x779: 0x0093, 0x77b: 0x1b9e, - 0x77c: 0x01eb, 0x77d: 0x01c4, 0x77e: 0x017c, 0x77f: 0x01a3, - // Block 0x1e, offset 0x780 - 0x780: 0x0466, 0x785: 0x0049, - 0x786: 0x0089, 0x787: 0x008b, 0x788: 0x0093, 0x789: 0x0095, - 0x790: 0x2234, 0x791: 0x2240, - 0x792: 0x22f4, 0x793: 0x221c, 0x794: 0x22a0, 0x795: 0x2228, 0x796: 0x22a6, 0x797: 0x22be, - 0x798: 0x22ca, 0x799: 0x222e, 0x79a: 0x22d0, 0x79b: 0x223a, 0x79c: 0x22c4, 0x79d: 0x22d6, - 0x79e: 0x22dc, 0x79f: 0x1cc2, 0x7a0: 0x0053, 0x7a1: 0x195d, 0x7a2: 0x1baa, 0x7a3: 0x1966, - 0x7a4: 0x006d, 0x7a5: 0x19b1, 0x7a6: 0x1bd6, 0x7a7: 0x1d4e, 0x7a8: 0x1969, 0x7a9: 0x0071, - 0x7aa: 0x19bd, 0x7ab: 0x1bda, 0x7ac: 0x0059, 0x7ad: 0x0047, 0x7ae: 0x0049, 0x7af: 0x005b, - 0x7b0: 0x0093, 0x7b1: 0x19ea, 0x7b2: 0x1c1e, 0x7b3: 0x19f3, 0x7b4: 0x00ad, 0x7b5: 0x1a68, - 0x7b6: 0x1c52, 0x7b7: 0x1d62, 0x7b8: 0x19f6, 0x7b9: 0x00b1, 0x7ba: 0x1a6b, 0x7bb: 0x1c56, - 0x7bc: 0x0099, 0x7bd: 0x0087, 0x7be: 0x0089, 0x7bf: 0x009b, - // Block 0x1f, offset 0x7c0 - 0x7c1: 0x3c1d, 0x7c3: 0xa000, 0x7c4: 0x3c24, 0x7c5: 0xa000, - 0x7c7: 0x3c2b, 0x7c8: 0xa000, 0x7c9: 0x3c32, - 0x7cd: 0xa000, - 0x7e0: 0x2f7c, 0x7e1: 0xa000, 0x7e2: 0x3c40, - 0x7e4: 0xa000, 0x7e5: 0xa000, - 0x7ed: 0x3c39, 0x7ee: 0x2f77, 0x7ef: 0x2f81, - 0x7f0: 0x3c47, 0x7f1: 0x3c4e, 0x7f2: 0xa000, 0x7f3: 0xa000, 0x7f4: 0x3c55, 0x7f5: 0x3c5c, - 0x7f6: 0xa000, 0x7f7: 0xa000, 0x7f8: 0x3c63, 0x7f9: 0x3c6a, 0x7fa: 0xa000, 0x7fb: 0xa000, - 0x7fc: 0xa000, 0x7fd: 0xa000, - // Block 0x20, offset 0x800 - 0x800: 0x3c71, 0x801: 0x3c78, 0x802: 0xa000, 0x803: 0xa000, 0x804: 0x3c8d, 0x805: 0x3c94, - 0x806: 0xa000, 0x807: 0xa000, 0x808: 0x3c9b, 0x809: 0x3ca2, - 0x811: 0xa000, - 0x812: 0xa000, - 0x822: 0xa000, - 0x828: 0xa000, 0x829: 0xa000, - 0x82b: 0xa000, 0x82c: 0x3cb7, 0x82d: 0x3cbe, 0x82e: 0x3cc5, 0x82f: 0x3ccc, - 0x832: 0xa000, 0x833: 0xa000, 0x834: 0xa000, 0x835: 0xa000, - // Block 0x21, offset 0x840 - 0x860: 0x0023, 0x861: 0x0025, 0x862: 0x0027, 0x863: 0x0029, - 0x864: 0x002b, 0x865: 0x002d, 0x866: 0x002f, 0x867: 0x0031, 0x868: 0x0033, 0x869: 0x1885, - 0x86a: 0x1888, 0x86b: 0x188b, 0x86c: 0x188e, 0x86d: 0x1891, 0x86e: 0x1894, 0x86f: 0x1897, - 0x870: 0x189a, 0x871: 0x189d, 0x872: 0x18a0, 0x873: 0x18a9, 0x874: 0x1a6e, 0x875: 0x1a72, - 0x876: 0x1a76, 0x877: 0x1a7a, 0x878: 0x1a7e, 0x879: 0x1a82, 0x87a: 0x1a86, 0x87b: 0x1a8a, - 0x87c: 0x1a8e, 0x87d: 0x1c86, 0x87e: 0x1c8b, 0x87f: 0x1c90, - // Block 0x22, offset 0x880 - 0x880: 0x1c95, 0x881: 0x1c9a, 0x882: 0x1c9f, 0x883: 0x1ca4, 0x884: 0x1ca9, 0x885: 0x1cae, - 0x886: 0x1cb3, 0x887: 0x1cb8, 0x888: 0x1882, 0x889: 0x18a6, 0x88a: 0x18ca, 0x88b: 0x18ee, - 0x88c: 0x1912, 0x88d: 0x191b, 0x88e: 0x1921, 0x88f: 0x1927, 0x890: 0x192d, 0x891: 0x1b66, - 0x892: 0x1b6a, 0x893: 0x1b6e, 0x894: 0x1b72, 0x895: 0x1b76, 0x896: 0x1b7a, 0x897: 0x1b7e, - 0x898: 0x1b82, 0x899: 0x1b86, 0x89a: 0x1b8a, 0x89b: 0x1b8e, 0x89c: 0x1afa, 0x89d: 0x1afe, - 0x89e: 0x1b02, 0x89f: 0x1b06, 0x8a0: 0x1b0a, 0x8a1: 0x1b0e, 0x8a2: 0x1b12, 0x8a3: 0x1b16, - 0x8a4: 0x1b1a, 0x8a5: 0x1b1e, 0x8a6: 0x1b22, 0x8a7: 0x1b26, 0x8a8: 0x1b2a, 0x8a9: 0x1b2e, - 0x8aa: 0x1b32, 0x8ab: 0x1b36, 0x8ac: 0x1b3a, 0x8ad: 0x1b3e, 0x8ae: 0x1b42, 0x8af: 0x1b46, - 0x8b0: 0x1b4a, 0x8b1: 0x1b4e, 0x8b2: 0x1b52, 0x8b3: 0x1b56, 0x8b4: 0x1b5a, 0x8b5: 0x1b5e, - 0x8b6: 0x0043, 0x8b7: 0x0045, 0x8b8: 0x0047, 0x8b9: 0x0049, 0x8ba: 0x004b, 0x8bb: 0x004d, - 0x8bc: 0x004f, 0x8bd: 0x0051, 0x8be: 0x0053, 0x8bf: 0x0055, - // Block 0x23, offset 0x8c0 - 0x8c0: 0x06c2, 0x8c1: 0x06e6, 0x8c2: 0x06f2, 0x8c3: 0x0702, 0x8c4: 0x070a, 0x8c5: 0x0716, - 0x8c6: 0x071e, 0x8c7: 0x0726, 0x8c8: 0x0732, 0x8c9: 0x0786, 0x8ca: 0x079e, 0x8cb: 0x07ae, - 0x8cc: 0x07be, 0x8cd: 0x07ce, 0x8ce: 0x07de, 0x8cf: 0x07fe, 0x8d0: 0x0802, 0x8d1: 0x0806, - 0x8d2: 0x083a, 0x8d3: 0x0862, 0x8d4: 0x0872, 0x8d5: 0x087a, 0x8d6: 0x087e, 0x8d7: 0x088a, - 0x8d8: 0x08a6, 0x8d9: 0x08aa, 0x8da: 0x08c2, 0x8db: 0x08c6, 0x8dc: 0x08ce, 0x8dd: 0x08de, - 0x8de: 0x097a, 0x8df: 0x098e, 0x8e0: 0x09ce, 0x8e1: 0x09e2, 0x8e2: 0x09ea, 0x8e3: 0x09ee, - 0x8e4: 0x09fe, 0x8e5: 0x0a1a, 0x8e6: 0x0a46, 0x8e7: 0x0a52, 0x8e8: 0x0a72, 0x8e9: 0x0a7e, - 0x8ea: 0x0a82, 0x8eb: 0x0a86, 0x8ec: 0x0a9e, 0x8ed: 0x0aa2, 0x8ee: 0x0ace, 0x8ef: 0x0ada, - 0x8f0: 0x0ae2, 0x8f1: 0x0aea, 0x8f2: 0x0afa, 0x8f3: 0x0b02, 0x8f4: 0x0b0a, 0x8f5: 0x0b36, - 0x8f6: 0x0b3a, 0x8f7: 0x0b42, 0x8f8: 0x0b46, 0x8f9: 0x0b4e, 0x8fa: 0x0b56, 0x8fb: 0x0b66, - 0x8fc: 0x0b82, 0x8fd: 0x0bfa, 0x8fe: 0x0c0e, 0x8ff: 0x0c12, - // Block 0x24, offset 0x900 - 0x900: 0x0c92, 0x901: 0x0c96, 0x902: 0x0caa, 0x903: 0x0cae, 0x904: 0x0cb6, 0x905: 0x0cbe, - 0x906: 0x0cc6, 0x907: 0x0cd2, 0x908: 0x0cfa, 0x909: 0x0d0a, 0x90a: 0x0d1e, 0x90b: 0x0d8e, - 0x90c: 0x0d9a, 0x90d: 0x0daa, 0x90e: 0x0db6, 0x90f: 0x0dc2, 0x910: 0x0dca, 0x911: 0x0dce, - 0x912: 0x0dd2, 0x913: 0x0dd6, 0x914: 0x0dda, 0x915: 0x0e92, 0x916: 0x0eda, 0x917: 0x0ee6, - 0x918: 0x0eea, 0x919: 0x0eee, 0x91a: 0x0ef2, 0x91b: 0x0efa, 0x91c: 0x0efe, 0x91d: 0x0f12, - 0x91e: 0x0f2e, 0x91f: 0x0f36, 0x920: 0x0f76, 0x921: 0x0f7a, 0x922: 0x0f82, 0x923: 0x0f86, - 0x924: 0x0f8e, 0x925: 0x0f92, 0x926: 0x0fb6, 0x927: 0x0fba, 0x928: 0x0fd6, 0x929: 0x0fda, - 0x92a: 0x0fde, 0x92b: 0x0fe2, 0x92c: 0x0ff6, 0x92d: 0x101a, 0x92e: 0x101e, 0x92f: 0x1022, - 0x930: 0x1046, 0x931: 0x1086, 0x932: 0x108a, 0x933: 0x10aa, 0x934: 0x10ba, 0x935: 0x10c2, - 0x936: 0x10e2, 0x937: 0x1106, 0x938: 0x114a, 0x939: 0x1152, 0x93a: 0x1166, 0x93b: 0x1172, - 0x93c: 0x117a, 0x93d: 0x1182, 0x93e: 0x1186, 0x93f: 0x118a, - // Block 0x25, offset 0x940 - 0x940: 0x11a2, 0x941: 0x11a6, 0x942: 0x11c2, 0x943: 0x11ca, 0x944: 0x11d2, 0x945: 0x11d6, - 0x946: 0x11e2, 0x947: 0x11ea, 0x948: 0x11ee, 0x949: 0x11f2, 0x94a: 0x11fa, 0x94b: 0x11fe, - 0x94c: 0x129e, 0x94d: 0x12b2, 0x94e: 0x12e6, 0x94f: 0x12ea, 0x950: 0x12f2, 0x951: 0x131e, - 0x952: 0x1326, 0x953: 0x132e, 0x954: 0x1336, 0x955: 0x1372, 0x956: 0x1376, 0x957: 0x137e, - 0x958: 0x1382, 0x959: 0x1386, 0x95a: 0x13b2, 0x95b: 0x13b6, 0x95c: 0x13be, 0x95d: 0x13d2, - 0x95e: 0x13d6, 0x95f: 0x13f2, 0x960: 0x13fa, 0x961: 0x13fe, 0x962: 0x1422, 0x963: 0x1442, - 0x964: 0x1456, 0x965: 0x145a, 0x966: 0x1462, 0x967: 0x148e, 0x968: 0x1492, 0x969: 0x14a2, - 0x96a: 0x14c6, 0x96b: 0x14d2, 0x96c: 0x14e2, 0x96d: 0x14fa, 0x96e: 0x1502, 0x96f: 0x1506, - 0x970: 0x150a, 0x971: 0x150e, 0x972: 0x151a, 0x973: 0x151e, 0x974: 0x1526, 0x975: 0x1542, - 0x976: 0x1546, 0x977: 0x154a, 0x978: 0x1562, 0x979: 0x1566, 0x97a: 0x156e, 0x97b: 0x1582, - 0x97c: 0x1586, 0x97d: 0x158a, 0x97e: 0x1592, 0x97f: 0x1596, - // Block 0x26, offset 0x980 - 0x986: 0xa000, 0x98b: 0xa000, - 0x98c: 0x3f1f, 0x98d: 0xa000, 0x98e: 0x3f27, 0x98f: 0xa000, 0x990: 0x3f2f, 0x991: 0xa000, - 0x992: 0x3f37, 0x993: 0xa000, 0x994: 0x3f3f, 0x995: 0xa000, 0x996: 0x3f47, 0x997: 0xa000, - 0x998: 0x3f4f, 0x999: 0xa000, 0x99a: 0x3f57, 0x99b: 0xa000, 0x99c: 0x3f5f, 0x99d: 0xa000, - 0x99e: 0x3f67, 0x99f: 0xa000, 0x9a0: 0x3f6f, 0x9a1: 0xa000, 0x9a2: 0x3f77, - 0x9a4: 0xa000, 0x9a5: 0x3f7f, 0x9a6: 0xa000, 0x9a7: 0x3f87, 0x9a8: 0xa000, 0x9a9: 0x3f8f, - 0x9af: 0xa000, - 0x9b0: 0x3f97, 0x9b1: 0x3f9f, 0x9b2: 0xa000, 0x9b3: 0x3fa7, 0x9b4: 0x3faf, 0x9b5: 0xa000, - 0x9b6: 0x3fb7, 0x9b7: 0x3fbf, 0x9b8: 0xa000, 0x9b9: 0x3fc7, 0x9ba: 0x3fcf, 0x9bb: 0xa000, - 0x9bc: 0x3fd7, 0x9bd: 0x3fdf, - // Block 0x27, offset 0x9c0 - 0x9d4: 0x3f17, - 0x9d9: 0x9904, 0x9da: 0x9904, 0x9db: 0x42f3, 0x9dc: 0x42f9, 0x9dd: 0xa000, - 0x9de: 0x3fe7, 0x9df: 0x26ba, - 0x9e6: 0xa000, - 0x9eb: 0xa000, 0x9ec: 0x3ff7, 0x9ed: 0xa000, 0x9ee: 0x3fff, 0x9ef: 0xa000, - 0x9f0: 0x4007, 0x9f1: 0xa000, 0x9f2: 0x400f, 0x9f3: 0xa000, 0x9f4: 0x4017, 0x9f5: 0xa000, - 0x9f6: 0x401f, 0x9f7: 0xa000, 0x9f8: 0x4027, 0x9f9: 0xa000, 0x9fa: 0x402f, 0x9fb: 0xa000, - 0x9fc: 0x4037, 0x9fd: 0xa000, 0x9fe: 0x403f, 0x9ff: 0xa000, - // Block 0x28, offset 0xa00 - 0xa00: 0x4047, 0xa01: 0xa000, 0xa02: 0x404f, 0xa04: 0xa000, 0xa05: 0x4057, - 0xa06: 0xa000, 0xa07: 0x405f, 0xa08: 0xa000, 0xa09: 0x4067, - 0xa0f: 0xa000, 0xa10: 0x406f, 0xa11: 0x4077, - 0xa12: 0xa000, 0xa13: 0x407f, 0xa14: 0x4087, 0xa15: 0xa000, 0xa16: 0x408f, 0xa17: 0x4097, - 0xa18: 0xa000, 0xa19: 0x409f, 0xa1a: 0x40a7, 0xa1b: 0xa000, 0xa1c: 0x40af, 0xa1d: 0x40b7, - 0xa2f: 0xa000, - 0xa30: 0xa000, 0xa31: 0xa000, 0xa32: 0xa000, 0xa34: 0x3fef, - 0xa37: 0x40bf, 0xa38: 0x40c7, 0xa39: 0x40cf, 0xa3a: 0x40d7, - 0xa3d: 0xa000, 0xa3e: 0x40df, 0xa3f: 0x26cf, - // Block 0x29, offset 0xa40 - 0xa40: 0x036a, 0xa41: 0x032e, 0xa42: 0x0332, 0xa43: 0x0336, 0xa44: 0x037e, 0xa45: 0x033a, - 0xa46: 0x033e, 0xa47: 0x0342, 0xa48: 0x0346, 0xa49: 0x034a, 0xa4a: 0x034e, 0xa4b: 0x0352, - 0xa4c: 0x0356, 0xa4d: 0x035a, 0xa4e: 0x035e, 0xa4f: 0x49d4, 0xa50: 0x49da, 0xa51: 0x49e0, - 0xa52: 0x49e6, 0xa53: 0x49ec, 0xa54: 0x49f2, 0xa55: 0x49f8, 0xa56: 0x49fe, 0xa57: 0x4a04, - 0xa58: 0x4a0a, 0xa59: 0x4a10, 0xa5a: 0x4a16, 0xa5b: 0x4a1c, 0xa5c: 0x4a22, 0xa5d: 0x4a28, - 0xa5e: 0x4a2e, 0xa5f: 0x4a34, 0xa60: 0x4a3a, 0xa61: 0x4a40, 0xa62: 0x4a46, 0xa63: 0x4a4c, - 0xa64: 0x03c6, 0xa65: 0x0362, 0xa66: 0x0366, 0xa67: 0x03ea, 0xa68: 0x03ee, 0xa69: 0x03f2, - 0xa6a: 0x03f6, 0xa6b: 0x03fa, 0xa6c: 0x03fe, 0xa6d: 0x0402, 0xa6e: 0x036e, 0xa6f: 0x0406, - 0xa70: 0x040a, 0xa71: 0x0372, 0xa72: 0x0376, 0xa73: 0x037a, 0xa74: 0x0382, 0xa75: 0x0386, - 0xa76: 0x038a, 0xa77: 0x038e, 0xa78: 0x0392, 0xa79: 0x0396, 0xa7a: 0x039a, 0xa7b: 0x039e, - 0xa7c: 0x03a2, 0xa7d: 0x03a6, 0xa7e: 0x03aa, 0xa7f: 0x03ae, - // Block 0x2a, offset 0xa80 - 0xa80: 0x03b2, 0xa81: 0x03b6, 0xa82: 0x040e, 0xa83: 0x0412, 0xa84: 0x03ba, 0xa85: 0x03be, - 0xa86: 0x03c2, 0xa87: 0x03ca, 0xa88: 0x03ce, 0xa89: 0x03d2, 0xa8a: 0x03d6, 0xa8b: 0x03da, - 0xa8c: 0x03de, 0xa8d: 0x03e2, 0xa8e: 0x03e6, - 0xa92: 0x06c2, 0xa93: 0x071e, 0xa94: 0x06ce, 0xa95: 0x097e, 0xa96: 0x06d2, 0xa97: 0x06ea, - 0xa98: 0x06d6, 0xa99: 0x0f96, 0xa9a: 0x070a, 0xa9b: 0x06de, 0xa9c: 0x06c6, 0xa9d: 0x0a02, - 0xa9e: 0x0992, 0xa9f: 0x0732, - // Block 0x2b, offset 0xac0 - 0xac0: 0x205a, 0xac1: 0x2060, 0xac2: 0x2066, 0xac3: 0x206c, 0xac4: 0x2072, 0xac5: 0x2078, - 0xac6: 0x207e, 0xac7: 0x2084, 0xac8: 0x208a, 0xac9: 0x2090, 0xaca: 0x2096, 0xacb: 0x209c, - 0xacc: 0x20a2, 0xacd: 0x20a8, 0xace: 0x2733, 0xacf: 0x273c, 0xad0: 0x2745, 0xad1: 0x274e, - 0xad2: 0x2757, 0xad3: 0x2760, 0xad4: 0x2769, 0xad5: 0x2772, 0xad6: 0x277b, 0xad7: 0x278d, - 0xad8: 0x2796, 0xad9: 0x279f, 0xada: 0x27a8, 0xadb: 0x27b1, 0xadc: 0x2784, 0xadd: 0x2bb9, - 0xade: 0x2afa, 0xae0: 0x20ae, 0xae1: 0x20c6, 0xae2: 0x20ba, 0xae3: 0x210e, - 0xae4: 0x20cc, 0xae5: 0x20ea, 0xae6: 0x20b4, 0xae7: 0x20e4, 0xae8: 0x20c0, 0xae9: 0x20f6, - 0xaea: 0x2126, 0xaeb: 0x2144, 0xaec: 0x213e, 0xaed: 0x2132, 0xaee: 0x2180, 0xaef: 0x2114, - 0xaf0: 0x2120, 0xaf1: 0x2138, 0xaf2: 0x212c, 0xaf3: 0x2156, 0xaf4: 0x2102, 0xaf5: 0x214a, - 0xaf6: 0x2174, 0xaf7: 0x215c, 0xaf8: 0x20f0, 0xaf9: 0x20d2, 0xafa: 0x2108, 0xafb: 0x211a, - 0xafc: 0x2150, 0xafd: 0x20d8, 0xafe: 0x217a, 0xaff: 0x20fc, - // Block 0x2c, offset 0xb00 - 0xb00: 0x2162, 0xb01: 0x20de, 0xb02: 0x2168, 0xb03: 0x216e, 0xb04: 0x0932, 0xb05: 0x0b06, - 0xb06: 0x0caa, 0xb07: 0x10ca, - 0xb10: 0x1bca, 0xb11: 0x18ac, - 0xb12: 0x18af, 0xb13: 0x18b2, 0xb14: 0x18b5, 0xb15: 0x18b8, 0xb16: 0x18bb, 0xb17: 0x18be, - 0xb18: 0x18c1, 0xb19: 0x18c4, 0xb1a: 0x18cd, 0xb1b: 0x18d0, 0xb1c: 0x18d3, 0xb1d: 0x18d6, - 0xb1e: 0x18d9, 0xb1f: 0x18dc, 0xb20: 0x0316, 0xb21: 0x031e, 0xb22: 0x0322, 0xb23: 0x032a, - 0xb24: 0x032e, 0xb25: 0x0332, 0xb26: 0x033a, 0xb27: 0x0342, 0xb28: 0x0346, 0xb29: 0x034e, - 0xb2a: 0x0352, 0xb2b: 0x0356, 0xb2c: 0x035a, 0xb2d: 0x035e, 0xb2e: 0x2e2f, 0xb2f: 0x2e37, - 0xb30: 0x2e3f, 0xb31: 0x2e47, 0xb32: 0x2e4f, 0xb33: 0x2e57, 0xb34: 0x2e5f, 0xb35: 0x2e67, - 0xb36: 0x2e77, 0xb37: 0x2e7f, 0xb38: 0x2e87, 0xb39: 0x2e8f, 0xb3a: 0x2e97, 0xb3b: 0x2e9f, - 0xb3c: 0x2eea, 0xb3d: 0x2eb2, 0xb3e: 0x2e6f, - // Block 0x2d, offset 0xb40 - 0xb40: 0x06c2, 0xb41: 0x071e, 0xb42: 0x06ce, 0xb43: 0x097e, 0xb44: 0x0722, 0xb45: 0x07b2, - 0xb46: 0x06ca, 0xb47: 0x07ae, 0xb48: 0x070e, 0xb49: 0x088a, 0xb4a: 0x0d0a, 0xb4b: 0x0e92, - 0xb4c: 0x0dda, 0xb4d: 0x0d1e, 0xb4e: 0x1462, 0xb4f: 0x098e, 0xb50: 0x0cd2, 0xb51: 0x0d4e, - 0xb52: 0x0d0e, 0xb53: 0x104e, 0xb54: 0x08fe, 0xb55: 0x0f06, 0xb56: 0x138a, 0xb57: 0x1062, - 0xb58: 0x0846, 0xb59: 0x1092, 0xb5a: 0x0f9e, 0xb5b: 0x0a1a, 0xb5c: 0x1412, 0xb5d: 0x0782, - 0xb5e: 0x08ae, 0xb5f: 0x0dfa, 0xb60: 0x152a, 0xb61: 0x0746, 0xb62: 0x07d6, 0xb63: 0x0d9e, - 0xb64: 0x06d2, 0xb65: 0x06ea, 0xb66: 0x06d6, 0xb67: 0x0ade, 0xb68: 0x08f2, 0xb69: 0x0882, - 0xb6a: 0x0a5a, 0xb6b: 0x0a4e, 0xb6c: 0x0fee, 0xb6d: 0x0742, 0xb6e: 0x139e, 0xb6f: 0x089e, - 0xb70: 0x09f6, 0xb71: 0x18df, 0xb72: 0x18e2, 0xb73: 0x18e5, 0xb74: 0x18e8, 0xb75: 0x18f1, - 0xb76: 0x18f4, 0xb77: 0x18f7, 0xb78: 0x18fa, 0xb79: 0x18fd, 0xb7a: 0x1900, 0xb7b: 0x1903, - 0xb7c: 0x1906, 0xb7d: 0x1909, 0xb7e: 0x190c, 0xb7f: 0x1915, - // Block 0x2e, offset 0xb80 - 0xb80: 0x1ccc, 0xb81: 0x1cdb, 0xb82: 0x1cea, 0xb83: 0x1cf9, 0xb84: 0x1d08, 0xb85: 0x1d17, - 0xb86: 0x1d26, 0xb87: 0x1d35, 0xb88: 0x1d44, 0xb89: 0x2192, 0xb8a: 0x21a4, 0xb8b: 0x21b6, - 0xb8c: 0x1957, 0xb8d: 0x1c0a, 0xb8e: 0x19d8, 0xb8f: 0x1bae, 0xb90: 0x04ce, 0xb91: 0x04d6, - 0xb92: 0x04de, 0xb93: 0x04e6, 0xb94: 0x04ee, 0xb95: 0x04f2, 0xb96: 0x04f6, 0xb97: 0x04fa, - 0xb98: 0x04fe, 0xb99: 0x0502, 0xb9a: 0x0506, 0xb9b: 0x050a, 0xb9c: 0x050e, 0xb9d: 0x0512, - 0xb9e: 0x0516, 0xb9f: 0x051a, 0xba0: 0x051e, 0xba1: 0x0526, 0xba2: 0x052a, 0xba3: 0x052e, - 0xba4: 0x0532, 0xba5: 0x0536, 0xba6: 0x053a, 0xba7: 0x053e, 0xba8: 0x0542, 0xba9: 0x0546, - 0xbaa: 0x054a, 0xbab: 0x054e, 0xbac: 0x0552, 0xbad: 0x0556, 0xbae: 0x055a, 0xbaf: 0x055e, - 0xbb0: 0x0562, 0xbb1: 0x0566, 0xbb2: 0x056a, 0xbb3: 0x0572, 0xbb4: 0x057a, 0xbb5: 0x0582, - 0xbb6: 0x0586, 0xbb7: 0x058a, 0xbb8: 0x058e, 0xbb9: 0x0592, 0xbba: 0x0596, 0xbbb: 0x059a, - 0xbbc: 0x059e, 0xbbd: 0x05a2, 0xbbe: 0x05a6, 0xbbf: 0x2700, - // Block 0x2f, offset 0xbc0 - 0xbc0: 0x2b19, 0xbc1: 0x29b5, 0xbc2: 0x2b29, 0xbc3: 0x288d, 0xbc4: 0x2efb, 0xbc5: 0x2897, - 0xbc6: 0x28a1, 0xbc7: 0x2f3f, 0xbc8: 0x29c2, 0xbc9: 0x28ab, 0xbca: 0x28b5, 0xbcb: 0x28bf, - 0xbcc: 0x29e9, 0xbcd: 0x29f6, 0xbce: 0x29cf, 0xbcf: 0x29dc, 0xbd0: 0x2ec0, 0xbd1: 0x2a03, - 0xbd2: 0x2a10, 0xbd3: 0x2bcb, 0xbd4: 0x26c1, 0xbd5: 0x2bde, 0xbd6: 0x2bf1, 0xbd7: 0x2b39, - 0xbd8: 0x2a1d, 0xbd9: 0x2c04, 0xbda: 0x2c17, 0xbdb: 0x2a2a, 0xbdc: 0x28c9, 0xbdd: 0x28d3, - 0xbde: 0x2ece, 0xbdf: 0x2a37, 0xbe0: 0x2b49, 0xbe1: 0x2f0c, 0xbe2: 0x28dd, 0xbe3: 0x28e7, - 0xbe4: 0x2a44, 0xbe5: 0x28f1, 0xbe6: 0x28fb, 0xbe7: 0x26d6, 0xbe8: 0x26dd, 0xbe9: 0x2905, - 0xbea: 0x290f, 0xbeb: 0x2c2a, 0xbec: 0x2a51, 0xbed: 0x2b59, 0xbee: 0x2c3d, 0xbef: 0x2a5e, - 0xbf0: 0x2923, 0xbf1: 0x2919, 0xbf2: 0x2f53, 0xbf3: 0x2a6b, 0xbf4: 0x2c50, 0xbf5: 0x292d, - 0xbf6: 0x2b69, 0xbf7: 0x2937, 0xbf8: 0x2a85, 0xbf9: 0x2941, 0xbfa: 0x2a92, 0xbfb: 0x2f1d, - 0xbfc: 0x2a78, 0xbfd: 0x2b79, 0xbfe: 0x2a9f, 0xbff: 0x26e4, - // Block 0x30, offset 0xc00 - 0xc00: 0x2f2e, 0xc01: 0x294b, 0xc02: 0x2955, 0xc03: 0x2aac, 0xc04: 0x295f, 0xc05: 0x2969, - 0xc06: 0x2973, 0xc07: 0x2b89, 0xc08: 0x2ab9, 0xc09: 0x26eb, 0xc0a: 0x2c63, 0xc0b: 0x2ea7, - 0xc0c: 0x2b99, 0xc0d: 0x2ac6, 0xc0e: 0x2edc, 0xc0f: 0x297d, 0xc10: 0x2987, 0xc11: 0x2ad3, - 0xc12: 0x26f2, 0xc13: 0x2ae0, 0xc14: 0x2ba9, 0xc15: 0x26f9, 0xc16: 0x2c76, 0xc17: 0x2991, - 0xc18: 0x1cbd, 0xc19: 0x1cd1, 0xc1a: 0x1ce0, 0xc1b: 0x1cef, 0xc1c: 0x1cfe, 0xc1d: 0x1d0d, - 0xc1e: 0x1d1c, 0xc1f: 0x1d2b, 0xc20: 0x1d3a, 0xc21: 0x1d49, 0xc22: 0x2198, 0xc23: 0x21aa, - 0xc24: 0x21bc, 0xc25: 0x21c8, 0xc26: 0x21d4, 0xc27: 0x21e0, 0xc28: 0x21ec, 0xc29: 0x21f8, - 0xc2a: 0x2204, 0xc2b: 0x2210, 0xc2c: 0x224c, 0xc2d: 0x2258, 0xc2e: 0x2264, 0xc2f: 0x2270, - 0xc30: 0x227c, 0xc31: 0x1c1a, 0xc32: 0x19cc, 0xc33: 0x1939, 0xc34: 0x1bea, 0xc35: 0x1a4d, - 0xc36: 0x1a5c, 0xc37: 0x19d2, 0xc38: 0x1c02, 0xc39: 0x1c06, 0xc3a: 0x1963, 0xc3b: 0x270e, - 0xc3c: 0x271c, 0xc3d: 0x2707, 0xc3e: 0x2715, 0xc3f: 0x2aed, - // Block 0x31, offset 0xc40 - 0xc40: 0x1a50, 0xc41: 0x1a38, 0xc42: 0x1c66, 0xc43: 0x1a20, 0xc44: 0x19f9, 0xc45: 0x196c, - 0xc46: 0x197b, 0xc47: 0x194b, 0xc48: 0x1bf6, 0xc49: 0x1d58, 0xc4a: 0x1a53, 0xc4b: 0x1a3b, - 0xc4c: 0x1c6a, 0xc4d: 0x1c76, 0xc4e: 0x1a2c, 0xc4f: 0x1a02, 0xc50: 0x195a, 0xc51: 0x1c22, - 0xc52: 0x1bb6, 0xc53: 0x1ba2, 0xc54: 0x1bd2, 0xc55: 0x1c7a, 0xc56: 0x1a2f, 0xc57: 0x19cf, - 0xc58: 0x1a05, 0xc59: 0x19e4, 0xc5a: 0x1a47, 0xc5b: 0x1c7e, 0xc5c: 0x1a32, 0xc5d: 0x19c6, - 0xc5e: 0x1a08, 0xc5f: 0x1c42, 0xc60: 0x1bfa, 0xc61: 0x1a1a, 0xc62: 0x1c2a, 0xc63: 0x1c46, - 0xc64: 0x1bfe, 0xc65: 0x1a1d, 0xc66: 0x1c2e, 0xc67: 0x22ee, 0xc68: 0x2302, 0xc69: 0x199c, - 0xc6a: 0x1c26, 0xc6b: 0x1bba, 0xc6c: 0x1ba6, 0xc6d: 0x1c4e, 0xc6e: 0x2723, 0xc6f: 0x27ba, - 0xc70: 0x1a5f, 0xc71: 0x1a4a, 0xc72: 0x1c82, 0xc73: 0x1a35, 0xc74: 0x1a56, 0xc75: 0x1a3e, - 0xc76: 0x1c6e, 0xc77: 0x1a23, 0xc78: 0x19fc, 0xc79: 0x1987, 0xc7a: 0x1a59, 0xc7b: 0x1a41, - 0xc7c: 0x1c72, 0xc7d: 0x1a26, 0xc7e: 0x19ff, 0xc7f: 0x198a, - // Block 0x32, offset 0xc80 - 0xc80: 0x1c32, 0xc81: 0x1bbe, 0xc82: 0x1d53, 0xc83: 0x193c, 0xc84: 0x19c0, 0xc85: 0x19c3, - 0xc86: 0x22fb, 0xc87: 0x1b9a, 0xc88: 0x19c9, 0xc89: 0x194e, 0xc8a: 0x19e7, 0xc8b: 0x1951, - 0xc8c: 0x19f0, 0xc8d: 0x196f, 0xc8e: 0x1972, 0xc8f: 0x1a0b, 0xc90: 0x1a11, 0xc91: 0x1a14, - 0xc92: 0x1c36, 0xc93: 0x1a17, 0xc94: 0x1a29, 0xc95: 0x1c3e, 0xc96: 0x1c4a, 0xc97: 0x1996, - 0xc98: 0x1d5d, 0xc99: 0x1bc2, 0xc9a: 0x1999, 0xc9b: 0x1a62, 0xc9c: 0x19ab, 0xc9d: 0x19ba, - 0xc9e: 0x22e8, 0xc9f: 0x22e2, 0xca0: 0x1cc7, 0xca1: 0x1cd6, 0xca2: 0x1ce5, 0xca3: 0x1cf4, - 0xca4: 0x1d03, 0xca5: 0x1d12, 0xca6: 0x1d21, 0xca7: 0x1d30, 0xca8: 0x1d3f, 0xca9: 0x218c, - 0xcaa: 0x219e, 0xcab: 0x21b0, 0xcac: 0x21c2, 0xcad: 0x21ce, 0xcae: 0x21da, 0xcaf: 0x21e6, - 0xcb0: 0x21f2, 0xcb1: 0x21fe, 0xcb2: 0x220a, 0xcb3: 0x2246, 0xcb4: 0x2252, 0xcb5: 0x225e, - 0xcb6: 0x226a, 0xcb7: 0x2276, 0xcb8: 0x2282, 0xcb9: 0x2288, 0xcba: 0x228e, 0xcbb: 0x2294, - 0xcbc: 0x229a, 0xcbd: 0x22ac, 0xcbe: 0x22b2, 0xcbf: 0x1c16, - // Block 0x33, offset 0xcc0 - 0xcc0: 0x137a, 0xcc1: 0x0cfe, 0xcc2: 0x13d6, 0xcc3: 0x13a2, 0xcc4: 0x0e5a, 0xcc5: 0x06ee, - 0xcc6: 0x08e2, 0xcc7: 0x162e, 0xcc8: 0x162e, 0xcc9: 0x0a0e, 0xcca: 0x1462, 0xccb: 0x0946, - 0xccc: 0x0a0a, 0xccd: 0x0bf2, 0xcce: 0x0fd2, 0xccf: 0x1162, 0xcd0: 0x129a, 0xcd1: 0x12d6, - 0xcd2: 0x130a, 0xcd3: 0x141e, 0xcd4: 0x0d76, 0xcd5: 0x0e02, 0xcd6: 0x0eae, 0xcd7: 0x0f46, - 0xcd8: 0x1262, 0xcd9: 0x144a, 0xcda: 0x1576, 0xcdb: 0x0712, 0xcdc: 0x08b6, 0xcdd: 0x0d8a, - 0xcde: 0x0ed2, 0xcdf: 0x1296, 0xce0: 0x15c6, 0xce1: 0x0ab6, 0xce2: 0x0e7a, 0xce3: 0x1286, - 0xce4: 0x131a, 0xce5: 0x0c26, 0xce6: 0x11be, 0xce7: 0x12e2, 0xce8: 0x0b22, 0xce9: 0x0d12, - 0xcea: 0x0e1a, 0xceb: 0x0f1e, 0xcec: 0x142a, 0xced: 0x0752, 0xcee: 0x07ea, 0xcef: 0x0856, - 0xcf0: 0x0c8e, 0xcf1: 0x0d82, 0xcf2: 0x0ece, 0xcf3: 0x0ff2, 0xcf4: 0x117a, 0xcf5: 0x128e, - 0xcf6: 0x12a6, 0xcf7: 0x13ca, 0xcf8: 0x14f2, 0xcf9: 0x15a6, 0xcfa: 0x15c2, 0xcfb: 0x102e, - 0xcfc: 0x106e, 0xcfd: 0x1126, 0xcfe: 0x1246, 0xcff: 0x147e, - // Block 0x34, offset 0xd00 - 0xd00: 0x15ce, 0xd01: 0x134e, 0xd02: 0x09ca, 0xd03: 0x0b3e, 0xd04: 0x10de, 0xd05: 0x119e, - 0xd06: 0x0f02, 0xd07: 0x1036, 0xd08: 0x139a, 0xd09: 0x14ea, 0xd0a: 0x09c6, 0xd0b: 0x0a92, - 0xd0c: 0x0d7a, 0xd0d: 0x0e2e, 0xd0e: 0x0e62, 0xd0f: 0x1116, 0xd10: 0x113e, 0xd11: 0x14aa, - 0xd12: 0x0852, 0xd13: 0x11aa, 0xd14: 0x07f6, 0xd15: 0x07f2, 0xd16: 0x109a, 0xd17: 0x112a, - 0xd18: 0x125e, 0xd19: 0x14b2, 0xd1a: 0x136a, 0xd1b: 0x0c2a, 0xd1c: 0x0d76, 0xd1d: 0x135a, - 0xd1e: 0x06fa, 0xd1f: 0x0a66, 0xd20: 0x0b96, 0xd21: 0x0f32, 0xd22: 0x0fb2, 0xd23: 0x0876, - 0xd24: 0x103e, 0xd25: 0x0762, 0xd26: 0x0b7a, 0xd27: 0x06da, 0xd28: 0x0dee, 0xd29: 0x0ca6, - 0xd2a: 0x1112, 0xd2b: 0x08ca, 0xd2c: 0x09b6, 0xd2d: 0x0ffe, 0xd2e: 0x1266, 0xd2f: 0x133e, - 0xd30: 0x0dba, 0xd31: 0x13fa, 0xd32: 0x0de6, 0xd33: 0x0c3a, 0xd34: 0x121e, 0xd35: 0x0c5a, - 0xd36: 0x0fae, 0xd37: 0x072e, 0xd38: 0x07aa, 0xd39: 0x07ee, 0xd3a: 0x0d56, 0xd3b: 0x10fe, - 0xd3c: 0x11f6, 0xd3d: 0x134a, 0xd3e: 0x145e, 0xd3f: 0x085e, - // Block 0x35, offset 0xd40 - 0xd40: 0x0912, 0xd41: 0x0a1a, 0xd42: 0x0b32, 0xd43: 0x0cc2, 0xd44: 0x0e7e, 0xd45: 0x1042, - 0xd46: 0x149a, 0xd47: 0x157e, 0xd48: 0x15d2, 0xd49: 0x15ea, 0xd4a: 0x083a, 0xd4b: 0x0cf6, - 0xd4c: 0x0da6, 0xd4d: 0x13ee, 0xd4e: 0x0afe, 0xd4f: 0x0bda, 0xd50: 0x0bf6, 0xd51: 0x0c86, - 0xd52: 0x0e6e, 0xd53: 0x0eba, 0xd54: 0x0f6a, 0xd55: 0x108e, 0xd56: 0x1132, 0xd57: 0x1196, - 0xd58: 0x13de, 0xd59: 0x126e, 0xd5a: 0x1406, 0xd5b: 0x1482, 0xd5c: 0x0812, 0xd5d: 0x083e, - 0xd5e: 0x0926, 0xd5f: 0x0eaa, 0xd60: 0x12f6, 0xd61: 0x133e, 0xd62: 0x0b1e, 0xd63: 0x0b8e, - 0xd64: 0x0c52, 0xd65: 0x0db2, 0xd66: 0x10da, 0xd67: 0x0f26, 0xd68: 0x073e, 0xd69: 0x0982, - 0xd6a: 0x0a66, 0xd6b: 0x0aca, 0xd6c: 0x0b9a, 0xd6d: 0x0f42, 0xd6e: 0x0f5e, 0xd6f: 0x116e, - 0xd70: 0x118e, 0xd71: 0x1466, 0xd72: 0x14e6, 0xd73: 0x14f6, 0xd74: 0x1532, 0xd75: 0x0756, - 0xd76: 0x1082, 0xd77: 0x1452, 0xd78: 0x14ce, 0xd79: 0x0bb2, 0xd7a: 0x071a, 0xd7b: 0x077a, - 0xd7c: 0x0a6a, 0xd7d: 0x0a8a, 0xd7e: 0x0cb2, 0xd7f: 0x0d76, - // Block 0x36, offset 0xd80 - 0xd80: 0x0ec6, 0xd81: 0x0fce, 0xd82: 0x127a, 0xd83: 0x141a, 0xd84: 0x1626, 0xd85: 0x0ce6, - 0xd86: 0x14a6, 0xd87: 0x0836, 0xd88: 0x0d32, 0xd89: 0x0d3e, 0xd8a: 0x0e12, 0xd8b: 0x0e4a, - 0xd8c: 0x0f4e, 0xd8d: 0x0faa, 0xd8e: 0x102a, 0xd8f: 0x110e, 0xd90: 0x153e, 0xd91: 0x07b2, - 0xd92: 0x0c06, 0xd93: 0x14b6, 0xd94: 0x076a, 0xd95: 0x0aae, 0xd96: 0x0e32, 0xd97: 0x13e2, - 0xd98: 0x0b6a, 0xd99: 0x0bba, 0xd9a: 0x0d46, 0xd9b: 0x0f32, 0xd9c: 0x14be, 0xd9d: 0x081a, - 0xd9e: 0x0902, 0xd9f: 0x0a9a, 0xda0: 0x0cd6, 0xda1: 0x0d22, 0xda2: 0x0d62, 0xda3: 0x0df6, - 0xda4: 0x0f4a, 0xda5: 0x0fbe, 0xda6: 0x115a, 0xda7: 0x12fa, 0xda8: 0x1306, 0xda9: 0x145a, - 0xdaa: 0x14da, 0xdab: 0x0886, 0xdac: 0x0e4e, 0xdad: 0x0906, 0xdae: 0x0eca, 0xdaf: 0x0f6e, - 0xdb0: 0x128a, 0xdb1: 0x14c2, 0xdb2: 0x15ae, 0xdb3: 0x15d6, 0xdb4: 0x0d3a, 0xdb5: 0x0e2a, - 0xdb6: 0x11c6, 0xdb7: 0x10ba, 0xdb8: 0x10c6, 0xdb9: 0x10ea, 0xdba: 0x0f1a, 0xdbb: 0x0ea2, - 0xdbc: 0x1366, 0xdbd: 0x0736, 0xdbe: 0x122e, 0xdbf: 0x081e, - // Block 0x37, offset 0xdc0 - 0xdc0: 0x080e, 0xdc1: 0x0b0e, 0xdc2: 0x0c2e, 0xdc3: 0x10f6, 0xdc4: 0x0a56, 0xdc5: 0x0e06, - 0xdc6: 0x0cf2, 0xdc7: 0x13ea, 0xdc8: 0x12ea, 0xdc9: 0x14ae, 0xdca: 0x1326, 0xdcb: 0x0b2a, - 0xdcc: 0x078a, 0xdcd: 0x095e, 0xdd0: 0x09b2, - 0xdd2: 0x0ce2, 0xdd5: 0x07fa, 0xdd6: 0x0f22, 0xdd7: 0x0fe6, - 0xdd8: 0x104a, 0xdd9: 0x1066, 0xdda: 0x106a, 0xddb: 0x107e, 0xddc: 0x14fe, 0xddd: 0x10ee, - 0xdde: 0x1172, 0xde0: 0x1292, 0xde2: 0x1356, - 0xde5: 0x140a, 0xde6: 0x1436, - 0xdea: 0x1552, 0xdeb: 0x1556, 0xdec: 0x155a, 0xded: 0x15be, 0xdee: 0x142e, 0xdef: 0x14ca, - 0xdf0: 0x075a, 0xdf1: 0x077e, 0xdf2: 0x0792, 0xdf3: 0x084e, 0xdf4: 0x085a, 0xdf5: 0x089a, - 0xdf6: 0x094e, 0xdf7: 0x096a, 0xdf8: 0x0972, 0xdf9: 0x09ae, 0xdfa: 0x09ba, 0xdfb: 0x0a96, - 0xdfc: 0x0a9e, 0xdfd: 0x0ba6, 0xdfe: 0x0bce, 0xdff: 0x0bd6, - // Block 0x38, offset 0xe00 - 0xe00: 0x0bee, 0xe01: 0x0c9a, 0xe02: 0x0cca, 0xe03: 0x0cea, 0xe04: 0x0d5a, 0xe05: 0x0e1e, - 0xe06: 0x0e3a, 0xe07: 0x0e6a, 0xe08: 0x0ebe, 0xe09: 0x0ede, 0xe0a: 0x0f52, 0xe0b: 0x1032, - 0xe0c: 0x104e, 0xe0d: 0x1056, 0xe0e: 0x1052, 0xe0f: 0x105a, 0xe10: 0x105e, 0xe11: 0x1062, - 0xe12: 0x1076, 0xe13: 0x107a, 0xe14: 0x109e, 0xe15: 0x10b2, 0xe16: 0x10ce, 0xe17: 0x1132, - 0xe18: 0x113a, 0xe19: 0x1142, 0xe1a: 0x1156, 0xe1b: 0x117e, 0xe1c: 0x11ce, 0xe1d: 0x1202, - 0xe1e: 0x1202, 0xe1f: 0x126a, 0xe20: 0x1312, 0xe21: 0x132a, 0xe22: 0x135e, 0xe23: 0x1362, - 0xe24: 0x13a6, 0xe25: 0x13aa, 0xe26: 0x1402, 0xe27: 0x140a, 0xe28: 0x14de, 0xe29: 0x1522, - 0xe2a: 0x153a, 0xe2b: 0x0b9e, 0xe2c: 0x1721, 0xe2d: 0x11e6, - 0xe30: 0x06e2, 0xe31: 0x07e6, 0xe32: 0x07a6, 0xe33: 0x074e, 0xe34: 0x078e, 0xe35: 0x07ba, - 0xe36: 0x084a, 0xe37: 0x0866, 0xe38: 0x094e, 0xe39: 0x093a, 0xe3a: 0x094a, 0xe3b: 0x0966, - 0xe3c: 0x09b2, 0xe3d: 0x09c2, 0xe3e: 0x0a06, 0xe3f: 0x0a12, - // Block 0x39, offset 0xe40 - 0xe40: 0x0a2e, 0xe41: 0x0a3e, 0xe42: 0x0b26, 0xe43: 0x0b2e, 0xe44: 0x0b5e, 0xe45: 0x0b7e, - 0xe46: 0x0bae, 0xe47: 0x0bc6, 0xe48: 0x0bb6, 0xe49: 0x0bd6, 0xe4a: 0x0bca, 0xe4b: 0x0bee, - 0xe4c: 0x0c0a, 0xe4d: 0x0c62, 0xe4e: 0x0c6e, 0xe4f: 0x0c76, 0xe50: 0x0c9e, 0xe51: 0x0ce2, - 0xe52: 0x0d12, 0xe53: 0x0d16, 0xe54: 0x0d2a, 0xe55: 0x0daa, 0xe56: 0x0dba, 0xe57: 0x0e12, - 0xe58: 0x0e5e, 0xe59: 0x0e56, 0xe5a: 0x0e6a, 0xe5b: 0x0e86, 0xe5c: 0x0ebe, 0xe5d: 0x1016, - 0xe5e: 0x0ee2, 0xe5f: 0x0f16, 0xe60: 0x0f22, 0xe61: 0x0f62, 0xe62: 0x0f7e, 0xe63: 0x0fa2, - 0xe64: 0x0fc6, 0xe65: 0x0fca, 0xe66: 0x0fe6, 0xe67: 0x0fea, 0xe68: 0x0ffa, 0xe69: 0x100e, - 0xe6a: 0x100a, 0xe6b: 0x103a, 0xe6c: 0x10b6, 0xe6d: 0x10ce, 0xe6e: 0x10e6, 0xe6f: 0x111e, - 0xe70: 0x1132, 0xe71: 0x114e, 0xe72: 0x117e, 0xe73: 0x1232, 0xe74: 0x125a, 0xe75: 0x12ce, - 0xe76: 0x1316, 0xe77: 0x1322, 0xe78: 0x132a, 0xe79: 0x1342, 0xe7a: 0x1356, 0xe7b: 0x1346, - 0xe7c: 0x135e, 0xe7d: 0x135a, 0xe7e: 0x1352, 0xe7f: 0x1362, - // Block 0x3a, offset 0xe80 - 0xe80: 0x136e, 0xe81: 0x13aa, 0xe82: 0x13e6, 0xe83: 0x1416, 0xe84: 0x144e, 0xe85: 0x146e, - 0xe86: 0x14ba, 0xe87: 0x14de, 0xe88: 0x14fe, 0xe89: 0x1512, 0xe8a: 0x1522, 0xe8b: 0x152e, - 0xe8c: 0x153a, 0xe8d: 0x158e, 0xe8e: 0x162e, 0xe8f: 0x16b8, 0xe90: 0x16b3, 0xe91: 0x16e5, - 0xe92: 0x060a, 0xe93: 0x0632, 0xe94: 0x0636, 0xe95: 0x1767, 0xe96: 0x1794, 0xe97: 0x180c, - 0xe98: 0x161a, 0xe99: 0x162a, - // Block 0x3b, offset 0xec0 - 0xec0: 0x19db, 0xec1: 0x19de, 0xec2: 0x19e1, 0xec3: 0x1c0e, 0xec4: 0x1c12, 0xec5: 0x1a65, - 0xec6: 0x1a65, - 0xed3: 0x1d7b, 0xed4: 0x1d6c, 0xed5: 0x1d71, 0xed6: 0x1d80, 0xed7: 0x1d76, - 0xedd: 0x43a7, - 0xede: 0x8116, 0xedf: 0x4419, 0xee0: 0x0230, 0xee1: 0x0218, 0xee2: 0x0221, 0xee3: 0x0224, - 0xee4: 0x0227, 0xee5: 0x022a, 0xee6: 0x022d, 0xee7: 0x0233, 0xee8: 0x0236, 0xee9: 0x0017, - 0xeea: 0x4407, 0xeeb: 0x440d, 0xeec: 0x450b, 0xeed: 0x4513, 0xeee: 0x435f, 0xeef: 0x4365, - 0xef0: 0x436b, 0xef1: 0x4371, 0xef2: 0x437d, 0xef3: 0x4383, 0xef4: 0x4389, 0xef5: 0x4395, - 0xef6: 0x439b, 0xef8: 0x43a1, 0xef9: 0x43ad, 0xefa: 0x43b3, 0xefb: 0x43b9, - 0xefc: 0x43c5, 0xefe: 0x43cb, - // Block 0x3c, offset 0xf00 - 0xf00: 0x43d1, 0xf01: 0x43d7, 0xf03: 0x43dd, 0xf04: 0x43e3, - 0xf06: 0x43ef, 0xf07: 0x43f5, 0xf08: 0x43fb, 0xf09: 0x4401, 0xf0a: 0x4413, 0xf0b: 0x438f, - 0xf0c: 0x4377, 0xf0d: 0x43bf, 0xf0e: 0x43e9, 0xf0f: 0x1d85, 0xf10: 0x029c, 0xf11: 0x029c, - 0xf12: 0x02a5, 0xf13: 0x02a5, 0xf14: 0x02a5, 0xf15: 0x02a5, 0xf16: 0x02a8, 0xf17: 0x02a8, - 0xf18: 0x02a8, 0xf19: 0x02a8, 0xf1a: 0x02ae, 0xf1b: 0x02ae, 0xf1c: 0x02ae, 0xf1d: 0x02ae, - 0xf1e: 0x02a2, 0xf1f: 0x02a2, 0xf20: 0x02a2, 0xf21: 0x02a2, 0xf22: 0x02ab, 0xf23: 0x02ab, - 0xf24: 0x02ab, 0xf25: 0x02ab, 0xf26: 0x029f, 0xf27: 0x029f, 0xf28: 0x029f, 0xf29: 0x029f, - 0xf2a: 0x02d2, 0xf2b: 0x02d2, 0xf2c: 0x02d2, 0xf2d: 0x02d2, 0xf2e: 0x02d5, 0xf2f: 0x02d5, - 0xf30: 0x02d5, 0xf31: 0x02d5, 0xf32: 0x02b4, 0xf33: 0x02b4, 0xf34: 0x02b4, 0xf35: 0x02b4, - 0xf36: 0x02b1, 0xf37: 0x02b1, 0xf38: 0x02b1, 0xf39: 0x02b1, 0xf3a: 0x02b7, 0xf3b: 0x02b7, - 0xf3c: 0x02b7, 0xf3d: 0x02b7, 0xf3e: 0x02ba, 0xf3f: 0x02ba, - // Block 0x3d, offset 0xf40 - 0xf40: 0x02ba, 0xf41: 0x02ba, 0xf42: 0x02c3, 0xf43: 0x02c3, 0xf44: 0x02c0, 0xf45: 0x02c0, - 0xf46: 0x02c6, 0xf47: 0x02c6, 0xf48: 0x02bd, 0xf49: 0x02bd, 0xf4a: 0x02cc, 0xf4b: 0x02cc, - 0xf4c: 0x02c9, 0xf4d: 0x02c9, 0xf4e: 0x02d8, 0xf4f: 0x02d8, 0xf50: 0x02d8, 0xf51: 0x02d8, - 0xf52: 0x02de, 0xf53: 0x02de, 0xf54: 0x02de, 0xf55: 0x02de, 0xf56: 0x02e4, 0xf57: 0x02e4, - 0xf58: 0x02e4, 0xf59: 0x02e4, 0xf5a: 0x02e1, 0xf5b: 0x02e1, 0xf5c: 0x02e1, 0xf5d: 0x02e1, - 0xf5e: 0x02e7, 0xf5f: 0x02e7, 0xf60: 0x02ea, 0xf61: 0x02ea, 0xf62: 0x02ea, 0xf63: 0x02ea, - 0xf64: 0x4485, 0xf65: 0x4485, 0xf66: 0x02f0, 0xf67: 0x02f0, 0xf68: 0x02f0, 0xf69: 0x02f0, - 0xf6a: 0x02ed, 0xf6b: 0x02ed, 0xf6c: 0x02ed, 0xf6d: 0x02ed, 0xf6e: 0x030b, 0xf6f: 0x030b, - 0xf70: 0x447f, 0xf71: 0x447f, - // Block 0x3e, offset 0xf80 - 0xf93: 0x02db, 0xf94: 0x02db, 0xf95: 0x02db, 0xf96: 0x02db, 0xf97: 0x02f9, - 0xf98: 0x02f9, 0xf99: 0x02f6, 0xf9a: 0x02f6, 0xf9b: 0x02fc, 0xf9c: 0x02fc, 0xf9d: 0x2055, - 0xf9e: 0x0302, 0xf9f: 0x0302, 0xfa0: 0x02f3, 0xfa1: 0x02f3, 0xfa2: 0x02ff, 0xfa3: 0x02ff, - 0xfa4: 0x0308, 0xfa5: 0x0308, 0xfa6: 0x0308, 0xfa7: 0x0308, 0xfa8: 0x0290, 0xfa9: 0x0290, - 0xfaa: 0x25b0, 0xfab: 0x25b0, 0xfac: 0x2620, 0xfad: 0x2620, 0xfae: 0x25ef, 0xfaf: 0x25ef, - 0xfb0: 0x260b, 0xfb1: 0x260b, 0xfb2: 0x2604, 0xfb3: 0x2604, 0xfb4: 0x2612, 0xfb5: 0x2612, - 0xfb6: 0x2619, 0xfb7: 0x2619, 0xfb8: 0x2619, 0xfb9: 0x25f6, 0xfba: 0x25f6, 0xfbb: 0x25f6, - 0xfbc: 0x0305, 0xfbd: 0x0305, 0xfbe: 0x0305, 0xfbf: 0x0305, - // Block 0x3f, offset 0xfc0 - 0xfc0: 0x25b7, 0xfc1: 0x25be, 0xfc2: 0x25da, 0xfc3: 0x25f6, 0xfc4: 0x25fd, 0xfc5: 0x1d8f, - 0xfc6: 0x1d94, 0xfc7: 0x1d99, 0xfc8: 0x1da8, 0xfc9: 0x1db7, 0xfca: 0x1dbc, 0xfcb: 0x1dc1, - 0xfcc: 0x1dc6, 0xfcd: 0x1dcb, 0xfce: 0x1dda, 0xfcf: 0x1de9, 0xfd0: 0x1dee, 0xfd1: 0x1df3, - 0xfd2: 0x1e02, 0xfd3: 0x1e11, 0xfd4: 0x1e16, 0xfd5: 0x1e1b, 0xfd6: 0x1e20, 0xfd7: 0x1e2f, - 0xfd8: 0x1e34, 0xfd9: 0x1e43, 0xfda: 0x1e48, 0xfdb: 0x1e4d, 0xfdc: 0x1e5c, 0xfdd: 0x1e61, - 0xfde: 0x1e66, 0xfdf: 0x1e70, 0xfe0: 0x1eac, 0xfe1: 0x1ebb, 0xfe2: 0x1eca, 0xfe3: 0x1ecf, - 0xfe4: 0x1ed4, 0xfe5: 0x1ede, 0xfe6: 0x1eed, 0xfe7: 0x1ef2, 0xfe8: 0x1f01, 0xfe9: 0x1f06, - 0xfea: 0x1f0b, 0xfeb: 0x1f1a, 0xfec: 0x1f1f, 0xfed: 0x1f2e, 0xfee: 0x1f33, 0xfef: 0x1f38, - 0xff0: 0x1f3d, 0xff1: 0x1f42, 0xff2: 0x1f47, 0xff3: 0x1f4c, 0xff4: 0x1f51, 0xff5: 0x1f56, - 0xff6: 0x1f5b, 0xff7: 0x1f60, 0xff8: 0x1f65, 0xff9: 0x1f6a, 0xffa: 0x1f6f, 0xffb: 0x1f74, - 0xffc: 0x1f79, 0xffd: 0x1f7e, 0xffe: 0x1f83, 0xfff: 0x1f8d, - // Block 0x40, offset 0x1000 - 0x1000: 0x1f92, 0x1001: 0x1f97, 0x1002: 0x1f9c, 0x1003: 0x1fa6, 0x1004: 0x1fab, 0x1005: 0x1fb5, - 0x1006: 0x1fba, 0x1007: 0x1fbf, 0x1008: 0x1fc4, 0x1009: 0x1fc9, 0x100a: 0x1fce, 0x100b: 0x1fd3, - 0x100c: 0x1fd8, 0x100d: 0x1fdd, 0x100e: 0x1fec, 0x100f: 0x1ffb, 0x1010: 0x2000, 0x1011: 0x2005, - 0x1012: 0x200a, 0x1013: 0x200f, 0x1014: 0x2014, 0x1015: 0x201e, 0x1016: 0x2023, 0x1017: 0x2028, - 0x1018: 0x2037, 0x1019: 0x2046, 0x101a: 0x204b, 0x101b: 0x4437, 0x101c: 0x443d, 0x101d: 0x4473, - 0x101e: 0x44ca, 0x101f: 0x44d1, 0x1020: 0x44d8, 0x1021: 0x44df, 0x1022: 0x44e6, 0x1023: 0x44ed, - 0x1024: 0x25cc, 0x1025: 0x25d3, 0x1026: 0x25da, 0x1027: 0x25e1, 0x1028: 0x25f6, 0x1029: 0x25fd, - 0x102a: 0x1d9e, 0x102b: 0x1da3, 0x102c: 0x1da8, 0x102d: 0x1dad, 0x102e: 0x1db7, 0x102f: 0x1dbc, - 0x1030: 0x1dd0, 0x1031: 0x1dd5, 0x1032: 0x1dda, 0x1033: 0x1ddf, 0x1034: 0x1de9, 0x1035: 0x1dee, - 0x1036: 0x1df8, 0x1037: 0x1dfd, 0x1038: 0x1e02, 0x1039: 0x1e07, 0x103a: 0x1e11, 0x103b: 0x1e16, - 0x103c: 0x1f42, 0x103d: 0x1f47, 0x103e: 0x1f56, 0x103f: 0x1f5b, - // Block 0x41, offset 0x1040 - 0x1040: 0x1f60, 0x1041: 0x1f74, 0x1042: 0x1f79, 0x1043: 0x1f7e, 0x1044: 0x1f83, 0x1045: 0x1f9c, - 0x1046: 0x1fa6, 0x1047: 0x1fab, 0x1048: 0x1fb0, 0x1049: 0x1fc4, 0x104a: 0x1fe2, 0x104b: 0x1fe7, - 0x104c: 0x1fec, 0x104d: 0x1ff1, 0x104e: 0x1ffb, 0x104f: 0x2000, 0x1050: 0x4473, 0x1051: 0x202d, - 0x1052: 0x2032, 0x1053: 0x2037, 0x1054: 0x203c, 0x1055: 0x2046, 0x1056: 0x204b, 0x1057: 0x25b7, - 0x1058: 0x25be, 0x1059: 0x25c5, 0x105a: 0x25da, 0x105b: 0x25e8, 0x105c: 0x1d8f, 0x105d: 0x1d94, - 0x105e: 0x1d99, 0x105f: 0x1da8, 0x1060: 0x1db2, 0x1061: 0x1dc1, 0x1062: 0x1dc6, 0x1063: 0x1dcb, - 0x1064: 0x1dda, 0x1065: 0x1de4, 0x1066: 0x1e02, 0x1067: 0x1e1b, 0x1068: 0x1e20, 0x1069: 0x1e2f, - 0x106a: 0x1e34, 0x106b: 0x1e43, 0x106c: 0x1e4d, 0x106d: 0x1e5c, 0x106e: 0x1e61, 0x106f: 0x1e66, - 0x1070: 0x1e70, 0x1071: 0x1eac, 0x1072: 0x1eb1, 0x1073: 0x1ebb, 0x1074: 0x1eca, 0x1075: 0x1ecf, - 0x1076: 0x1ed4, 0x1077: 0x1ede, 0x1078: 0x1eed, 0x1079: 0x1f01, 0x107a: 0x1f06, 0x107b: 0x1f0b, - 0x107c: 0x1f1a, 0x107d: 0x1f1f, 0x107e: 0x1f2e, 0x107f: 0x1f33, - // Block 0x42, offset 0x1080 - 0x1080: 0x1f38, 0x1081: 0x1f3d, 0x1082: 0x1f4c, 0x1083: 0x1f51, 0x1084: 0x1f65, 0x1085: 0x1f6a, - 0x1086: 0x1f6f, 0x1087: 0x1f74, 0x1088: 0x1f79, 0x1089: 0x1f8d, 0x108a: 0x1f92, 0x108b: 0x1f97, - 0x108c: 0x1f9c, 0x108d: 0x1fa1, 0x108e: 0x1fb5, 0x108f: 0x1fba, 0x1090: 0x1fbf, 0x1091: 0x1fc4, - 0x1092: 0x1fd3, 0x1093: 0x1fd8, 0x1094: 0x1fdd, 0x1095: 0x1fec, 0x1096: 0x1ff6, 0x1097: 0x2005, - 0x1098: 0x200a, 0x1099: 0x4467, 0x109a: 0x201e, 0x109b: 0x2023, 0x109c: 0x2028, 0x109d: 0x2037, - 0x109e: 0x2041, 0x109f: 0x25da, 0x10a0: 0x25e8, 0x10a1: 0x1da8, 0x10a2: 0x1db2, 0x10a3: 0x1dda, - 0x10a4: 0x1de4, 0x10a5: 0x1e02, 0x10a6: 0x1e0c, 0x10a7: 0x1e70, 0x10a8: 0x1e75, 0x10a9: 0x1e98, - 0x10aa: 0x1e9d, 0x10ab: 0x1f74, 0x10ac: 0x1f79, 0x10ad: 0x1f9c, 0x10ae: 0x1fec, 0x10af: 0x1ff6, - 0x10b0: 0x2037, 0x10b1: 0x2041, 0x10b2: 0x451b, 0x10b3: 0x4523, 0x10b4: 0x452b, 0x10b5: 0x1ef7, - 0x10b6: 0x1efc, 0x10b7: 0x1f10, 0x10b8: 0x1f15, 0x10b9: 0x1f24, 0x10ba: 0x1f29, 0x10bb: 0x1e7a, - 0x10bc: 0x1e7f, 0x10bd: 0x1ea2, 0x10be: 0x1ea7, 0x10bf: 0x1e39, - // Block 0x43, offset 0x10c0 - 0x10c0: 0x1e3e, 0x10c1: 0x1e25, 0x10c2: 0x1e2a, 0x10c3: 0x1e52, 0x10c4: 0x1e57, 0x10c5: 0x1ec0, - 0x10c6: 0x1ec5, 0x10c7: 0x1ee3, 0x10c8: 0x1ee8, 0x10c9: 0x1e84, 0x10ca: 0x1e89, 0x10cb: 0x1e8e, - 0x10cc: 0x1e98, 0x10cd: 0x1e93, 0x10ce: 0x1e6b, 0x10cf: 0x1eb6, 0x10d0: 0x1ed9, 0x10d1: 0x1ef7, - 0x10d2: 0x1efc, 0x10d3: 0x1f10, 0x10d4: 0x1f15, 0x10d5: 0x1f24, 0x10d6: 0x1f29, 0x10d7: 0x1e7a, - 0x10d8: 0x1e7f, 0x10d9: 0x1ea2, 0x10da: 0x1ea7, 0x10db: 0x1e39, 0x10dc: 0x1e3e, 0x10dd: 0x1e25, - 0x10de: 0x1e2a, 0x10df: 0x1e52, 0x10e0: 0x1e57, 0x10e1: 0x1ec0, 0x10e2: 0x1ec5, 0x10e3: 0x1ee3, - 0x10e4: 0x1ee8, 0x10e5: 0x1e84, 0x10e6: 0x1e89, 0x10e7: 0x1e8e, 0x10e8: 0x1e98, 0x10e9: 0x1e93, - 0x10ea: 0x1e6b, 0x10eb: 0x1eb6, 0x10ec: 0x1ed9, 0x10ed: 0x1e84, 0x10ee: 0x1e89, 0x10ef: 0x1e8e, - 0x10f0: 0x1e98, 0x10f1: 0x1e75, 0x10f2: 0x1e9d, 0x10f3: 0x1ef2, 0x10f4: 0x1e5c, 0x10f5: 0x1e61, - 0x10f6: 0x1e66, 0x10f7: 0x1e84, 0x10f8: 0x1e89, 0x10f9: 0x1e8e, 0x10fa: 0x1ef2, 0x10fb: 0x1f01, - 0x10fc: 0x441f, 0x10fd: 0x441f, - // Block 0x44, offset 0x1100 - 0x1110: 0x2317, 0x1111: 0x232c, - 0x1112: 0x232c, 0x1113: 0x2333, 0x1114: 0x233a, 0x1115: 0x234f, 0x1116: 0x2356, 0x1117: 0x235d, - 0x1118: 0x2380, 0x1119: 0x2380, 0x111a: 0x23a3, 0x111b: 0x239c, 0x111c: 0x23b8, 0x111d: 0x23aa, - 0x111e: 0x23b1, 0x111f: 0x23d4, 0x1120: 0x23d4, 0x1121: 0x23cd, 0x1122: 0x23db, 0x1123: 0x23db, - 0x1124: 0x2405, 0x1125: 0x2405, 0x1126: 0x2421, 0x1127: 0x23e9, 0x1128: 0x23e9, 0x1129: 0x23e2, - 0x112a: 0x23f7, 0x112b: 0x23f7, 0x112c: 0x23fe, 0x112d: 0x23fe, 0x112e: 0x2428, 0x112f: 0x2436, - 0x1130: 0x2436, 0x1131: 0x243d, 0x1132: 0x243d, 0x1133: 0x2444, 0x1134: 0x244b, 0x1135: 0x2452, - 0x1136: 0x2459, 0x1137: 0x2459, 0x1138: 0x2460, 0x1139: 0x246e, 0x113a: 0x247c, 0x113b: 0x2475, - 0x113c: 0x2483, 0x113d: 0x2483, 0x113e: 0x2498, 0x113f: 0x249f, - // Block 0x45, offset 0x1140 - 0x1140: 0x24d0, 0x1141: 0x24de, 0x1142: 0x24d7, 0x1143: 0x24bb, 0x1144: 0x24bb, 0x1145: 0x24e5, - 0x1146: 0x24e5, 0x1147: 0x24ec, 0x1148: 0x24ec, 0x1149: 0x2516, 0x114a: 0x251d, 0x114b: 0x2524, - 0x114c: 0x24fa, 0x114d: 0x2508, 0x114e: 0x252b, 0x114f: 0x2532, - 0x1152: 0x2501, 0x1153: 0x2586, 0x1154: 0x258d, 0x1155: 0x2563, 0x1156: 0x256a, 0x1157: 0x254e, - 0x1158: 0x254e, 0x1159: 0x2555, 0x115a: 0x257f, 0x115b: 0x2578, 0x115c: 0x25a2, 0x115d: 0x25a2, - 0x115e: 0x2310, 0x115f: 0x2325, 0x1160: 0x231e, 0x1161: 0x2348, 0x1162: 0x2341, 0x1163: 0x236b, - 0x1164: 0x2364, 0x1165: 0x238e, 0x1166: 0x2372, 0x1167: 0x2387, 0x1168: 0x23bf, 0x1169: 0x240c, - 0x116a: 0x23f0, 0x116b: 0x242f, 0x116c: 0x24c9, 0x116d: 0x24f3, 0x116e: 0x259b, 0x116f: 0x2594, - 0x1170: 0x25a9, 0x1171: 0x2540, 0x1172: 0x24a6, 0x1173: 0x2571, 0x1174: 0x2498, 0x1175: 0x24d0, - 0x1176: 0x2467, 0x1177: 0x24b4, 0x1178: 0x2547, 0x1179: 0x2539, 0x117a: 0x24c2, 0x117b: 0x24ad, - 0x117c: 0x24c2, 0x117d: 0x2547, 0x117e: 0x2379, 0x117f: 0x2395, - // Block 0x46, offset 0x1180 - 0x1180: 0x250f, 0x1181: 0x248a, 0x1182: 0x2309, 0x1183: 0x24ad, 0x1184: 0x2452, 0x1185: 0x2421, - 0x1186: 0x23c6, 0x1187: 0x255c, - 0x11b0: 0x241a, 0x11b1: 0x2491, 0x11b2: 0x27cc, 0x11b3: 0x27c3, 0x11b4: 0x27f9, 0x11b5: 0x27e7, - 0x11b6: 0x27d5, 0x11b7: 0x27f0, 0x11b8: 0x2802, 0x11b9: 0x2413, 0x11ba: 0x2c89, 0x11bb: 0x2b09, - 0x11bc: 0x27de, - // Block 0x47, offset 0x11c0 - 0x11d0: 0x0019, 0x11d1: 0x0486, - 0x11d2: 0x048a, 0x11d3: 0x0035, 0x11d4: 0x0037, 0x11d5: 0x0003, 0x11d6: 0x003f, 0x11d7: 0x04c2, - 0x11d8: 0x04c6, 0x11d9: 0x1b62, - 0x11e0: 0x8133, 0x11e1: 0x8133, 0x11e2: 0x8133, 0x11e3: 0x8133, - 0x11e4: 0x8133, 0x11e5: 0x8133, 0x11e6: 0x8133, 0x11e7: 0x812e, 0x11e8: 0x812e, 0x11e9: 0x812e, - 0x11ea: 0x812e, 0x11eb: 0x812e, 0x11ec: 0x812e, 0x11ed: 0x812e, 0x11ee: 0x8133, 0x11ef: 0x8133, - 0x11f0: 0x1876, 0x11f1: 0x0446, 0x11f2: 0x0442, 0x11f3: 0x007f, 0x11f4: 0x007f, 0x11f5: 0x0011, - 0x11f6: 0x0013, 0x11f7: 0x00b7, 0x11f8: 0x00bb, 0x11f9: 0x04ba, 0x11fa: 0x04be, 0x11fb: 0x04ae, - 0x11fc: 0x04b2, 0x11fd: 0x0496, 0x11fe: 0x049a, 0x11ff: 0x048e, - // Block 0x48, offset 0x1200 - 0x1200: 0x0492, 0x1201: 0x049e, 0x1202: 0x04a2, 0x1203: 0x04a6, 0x1204: 0x04aa, - 0x1207: 0x0077, 0x1208: 0x007b, 0x1209: 0x4280, 0x120a: 0x4280, 0x120b: 0x4280, - 0x120c: 0x4280, 0x120d: 0x007f, 0x120e: 0x007f, 0x120f: 0x007f, 0x1210: 0x0019, 0x1211: 0x0486, - 0x1212: 0x001d, 0x1214: 0x0037, 0x1215: 0x0035, 0x1216: 0x003f, 0x1217: 0x0003, - 0x1218: 0x0446, 0x1219: 0x0011, 0x121a: 0x0013, 0x121b: 0x00b7, 0x121c: 0x00bb, 0x121d: 0x04ba, - 0x121e: 0x04be, 0x121f: 0x0007, 0x1220: 0x000d, 0x1221: 0x0015, 0x1222: 0x0017, 0x1223: 0x001b, - 0x1224: 0x0039, 0x1225: 0x003d, 0x1226: 0x003b, 0x1228: 0x0079, 0x1229: 0x0009, - 0x122a: 0x000b, 0x122b: 0x0041, - 0x1230: 0x42c1, 0x1231: 0x4443, 0x1232: 0x42c6, 0x1234: 0x42cb, - 0x1236: 0x42d0, 0x1237: 0x4449, 0x1238: 0x42d5, 0x1239: 0x444f, 0x123a: 0x42da, 0x123b: 0x4455, - 0x123c: 0x42df, 0x123d: 0x445b, 0x123e: 0x42e4, 0x123f: 0x4461, - // Block 0x49, offset 0x1240 - 0x1240: 0x0239, 0x1241: 0x4425, 0x1242: 0x4425, 0x1243: 0x442b, 0x1244: 0x442b, 0x1245: 0x446d, - 0x1246: 0x446d, 0x1247: 0x4431, 0x1248: 0x4431, 0x1249: 0x4479, 0x124a: 0x4479, 0x124b: 0x4479, - 0x124c: 0x4479, 0x124d: 0x023c, 0x124e: 0x023c, 0x124f: 0x023f, 0x1250: 0x023f, 0x1251: 0x023f, - 0x1252: 0x023f, 0x1253: 0x0242, 0x1254: 0x0242, 0x1255: 0x0245, 0x1256: 0x0245, 0x1257: 0x0245, - 0x1258: 0x0245, 0x1259: 0x0248, 0x125a: 0x0248, 0x125b: 0x0248, 0x125c: 0x0248, 0x125d: 0x024b, - 0x125e: 0x024b, 0x125f: 0x024b, 0x1260: 0x024b, 0x1261: 0x024e, 0x1262: 0x024e, 0x1263: 0x024e, - 0x1264: 0x024e, 0x1265: 0x0251, 0x1266: 0x0251, 0x1267: 0x0251, 0x1268: 0x0251, 0x1269: 0x0254, - 0x126a: 0x0254, 0x126b: 0x0257, 0x126c: 0x0257, 0x126d: 0x025a, 0x126e: 0x025a, 0x126f: 0x025d, - 0x1270: 0x025d, 0x1271: 0x0260, 0x1272: 0x0260, 0x1273: 0x0260, 0x1274: 0x0260, 0x1275: 0x0263, - 0x1276: 0x0263, 0x1277: 0x0263, 0x1278: 0x0263, 0x1279: 0x0266, 0x127a: 0x0266, 0x127b: 0x0266, - 0x127c: 0x0266, 0x127d: 0x0269, 0x127e: 0x0269, 0x127f: 0x0269, - // Block 0x4a, offset 0x1280 - 0x1280: 0x0269, 0x1281: 0x026c, 0x1282: 0x026c, 0x1283: 0x026c, 0x1284: 0x026c, 0x1285: 0x026f, - 0x1286: 0x026f, 0x1287: 0x026f, 0x1288: 0x026f, 0x1289: 0x0272, 0x128a: 0x0272, 0x128b: 0x0272, - 0x128c: 0x0272, 0x128d: 0x0275, 0x128e: 0x0275, 0x128f: 0x0275, 0x1290: 0x0275, 0x1291: 0x0278, - 0x1292: 0x0278, 0x1293: 0x0278, 0x1294: 0x0278, 0x1295: 0x027b, 0x1296: 0x027b, 0x1297: 0x027b, - 0x1298: 0x027b, 0x1299: 0x027e, 0x129a: 0x027e, 0x129b: 0x027e, 0x129c: 0x027e, 0x129d: 0x0281, - 0x129e: 0x0281, 0x129f: 0x0281, 0x12a0: 0x0281, 0x12a1: 0x0284, 0x12a2: 0x0284, 0x12a3: 0x0284, - 0x12a4: 0x0284, 0x12a5: 0x0287, 0x12a6: 0x0287, 0x12a7: 0x0287, 0x12a8: 0x0287, 0x12a9: 0x028a, - 0x12aa: 0x028a, 0x12ab: 0x028a, 0x12ac: 0x028a, 0x12ad: 0x028d, 0x12ae: 0x028d, 0x12af: 0x0290, - 0x12b0: 0x0290, 0x12b1: 0x0293, 0x12b2: 0x0293, 0x12b3: 0x0293, 0x12b4: 0x0293, 0x12b5: 0x2e17, - 0x12b6: 0x2e17, 0x12b7: 0x2e1f, 0x12b8: 0x2e1f, 0x12b9: 0x2e27, 0x12ba: 0x2e27, 0x12bb: 0x1f88, - 0x12bc: 0x1f88, - // Block 0x4b, offset 0x12c0 - 0x12c0: 0x0081, 0x12c1: 0x0083, 0x12c2: 0x0085, 0x12c3: 0x0087, 0x12c4: 0x0089, 0x12c5: 0x008b, - 0x12c6: 0x008d, 0x12c7: 0x008f, 0x12c8: 0x0091, 0x12c9: 0x0093, 0x12ca: 0x0095, 0x12cb: 0x0097, - 0x12cc: 0x0099, 0x12cd: 0x009b, 0x12ce: 0x009d, 0x12cf: 0x009f, 0x12d0: 0x00a1, 0x12d1: 0x00a3, - 0x12d2: 0x00a5, 0x12d3: 0x00a7, 0x12d4: 0x00a9, 0x12d5: 0x00ab, 0x12d6: 0x00ad, 0x12d7: 0x00af, - 0x12d8: 0x00b1, 0x12d9: 0x00b3, 0x12da: 0x00b5, 0x12db: 0x00b7, 0x12dc: 0x00b9, 0x12dd: 0x00bb, - 0x12de: 0x00bd, 0x12df: 0x047a, 0x12e0: 0x047e, 0x12e1: 0x048a, 0x12e2: 0x049e, 0x12e3: 0x04a2, - 0x12e4: 0x0486, 0x12e5: 0x05ae, 0x12e6: 0x05a6, 0x12e7: 0x04ca, 0x12e8: 0x04d2, 0x12e9: 0x04da, - 0x12ea: 0x04e2, 0x12eb: 0x04ea, 0x12ec: 0x056e, 0x12ed: 0x0576, 0x12ee: 0x057e, 0x12ef: 0x0522, - 0x12f0: 0x05b2, 0x12f1: 0x04ce, 0x12f2: 0x04d6, 0x12f3: 0x04de, 0x12f4: 0x04e6, 0x12f5: 0x04ee, - 0x12f6: 0x04f2, 0x12f7: 0x04f6, 0x12f8: 0x04fa, 0x12f9: 0x04fe, 0x12fa: 0x0502, 0x12fb: 0x0506, - 0x12fc: 0x050a, 0x12fd: 0x050e, 0x12fe: 0x0512, 0x12ff: 0x0516, - // Block 0x4c, offset 0x1300 - 0x1300: 0x051a, 0x1301: 0x051e, 0x1302: 0x0526, 0x1303: 0x052a, 0x1304: 0x052e, 0x1305: 0x0532, - 0x1306: 0x0536, 0x1307: 0x053a, 0x1308: 0x053e, 0x1309: 0x0542, 0x130a: 0x0546, 0x130b: 0x054a, - 0x130c: 0x054e, 0x130d: 0x0552, 0x130e: 0x0556, 0x130f: 0x055a, 0x1310: 0x055e, 0x1311: 0x0562, - 0x1312: 0x0566, 0x1313: 0x056a, 0x1314: 0x0572, 0x1315: 0x057a, 0x1316: 0x0582, 0x1317: 0x0586, - 0x1318: 0x058a, 0x1319: 0x058e, 0x131a: 0x0592, 0x131b: 0x0596, 0x131c: 0x059a, 0x131d: 0x05aa, - 0x131e: 0x4a8f, 0x131f: 0x4a95, 0x1320: 0x03c6, 0x1321: 0x0316, 0x1322: 0x031a, 0x1323: 0x4a52, - 0x1324: 0x031e, 0x1325: 0x4a58, 0x1326: 0x4a5e, 0x1327: 0x0322, 0x1328: 0x0326, 0x1329: 0x032a, - 0x132a: 0x4a64, 0x132b: 0x4a6a, 0x132c: 0x4a70, 0x132d: 0x4a76, 0x132e: 0x4a7c, 0x132f: 0x4a82, - 0x1330: 0x036a, 0x1331: 0x032e, 0x1332: 0x0332, 0x1333: 0x0336, 0x1334: 0x037e, 0x1335: 0x033a, - 0x1336: 0x033e, 0x1337: 0x0342, 0x1338: 0x0346, 0x1339: 0x034a, 0x133a: 0x034e, 0x133b: 0x0352, - 0x133c: 0x0356, 0x133d: 0x035a, 0x133e: 0x035e, - // Block 0x4d, offset 0x1340 - 0x1342: 0x49d4, 0x1343: 0x49da, 0x1344: 0x49e0, 0x1345: 0x49e6, - 0x1346: 0x49ec, 0x1347: 0x49f2, 0x134a: 0x49f8, 0x134b: 0x49fe, - 0x134c: 0x4a04, 0x134d: 0x4a0a, 0x134e: 0x4a10, 0x134f: 0x4a16, - 0x1352: 0x4a1c, 0x1353: 0x4a22, 0x1354: 0x4a28, 0x1355: 0x4a2e, 0x1356: 0x4a34, 0x1357: 0x4a3a, - 0x135a: 0x4a40, 0x135b: 0x4a46, 0x135c: 0x4a4c, - 0x1360: 0x00bf, 0x1361: 0x00c2, 0x1362: 0x00cb, 0x1363: 0x427b, - 0x1364: 0x00c8, 0x1365: 0x00c5, 0x1366: 0x044a, 0x1368: 0x046e, 0x1369: 0x044e, - 0x136a: 0x0452, 0x136b: 0x0456, 0x136c: 0x045a, 0x136d: 0x0472, 0x136e: 0x0476, - // Block 0x4e, offset 0x1380 - 0x1380: 0x0063, 0x1381: 0x0065, 0x1382: 0x0067, 0x1383: 0x0069, 0x1384: 0x006b, 0x1385: 0x006d, - 0x1386: 0x006f, 0x1387: 0x0071, 0x1388: 0x0073, 0x1389: 0x0075, 0x138a: 0x0083, 0x138b: 0x0085, - 0x138c: 0x0087, 0x138d: 0x0089, 0x138e: 0x008b, 0x138f: 0x008d, 0x1390: 0x008f, 0x1391: 0x0091, - 0x1392: 0x0093, 0x1393: 0x0095, 0x1394: 0x0097, 0x1395: 0x0099, 0x1396: 0x009b, 0x1397: 0x009d, - 0x1398: 0x009f, 0x1399: 0x00a1, 0x139a: 0x00a3, 0x139b: 0x00a5, 0x139c: 0x00a7, 0x139d: 0x00a9, - 0x139e: 0x00ab, 0x139f: 0x00ad, 0x13a0: 0x00af, 0x13a1: 0x00b1, 0x13a2: 0x00b3, 0x13a3: 0x00b5, - 0x13a4: 0x00dd, 0x13a5: 0x00f2, 0x13a8: 0x0176, 0x13a9: 0x0179, - 0x13aa: 0x017c, 0x13ab: 0x017f, 0x13ac: 0x0182, 0x13ad: 0x0185, 0x13ae: 0x0188, 0x13af: 0x018b, - 0x13b0: 0x018e, 0x13b1: 0x0191, 0x13b2: 0x0194, 0x13b3: 0x0197, 0x13b4: 0x019a, 0x13b5: 0x019d, - 0x13b6: 0x01a0, 0x13b7: 0x01a3, 0x13b8: 0x01a6, 0x13b9: 0x018b, 0x13ba: 0x01a9, 0x13bb: 0x01ac, - 0x13bc: 0x01af, 0x13bd: 0x01b2, 0x13be: 0x01b5, 0x13bf: 0x01b8, - // Block 0x4f, offset 0x13c0 - 0x13c0: 0x0200, 0x13c1: 0x0203, 0x13c2: 0x0206, 0x13c3: 0x045e, 0x13c4: 0x01ca, 0x13c5: 0x01d3, - 0x13c6: 0x01d9, 0x13c7: 0x01fd, 0x13c8: 0x01ee, 0x13c9: 0x01eb, 0x13ca: 0x0209, 0x13cb: 0x020c, - 0x13ce: 0x0021, 0x13cf: 0x0023, 0x13d0: 0x0025, 0x13d1: 0x0027, - 0x13d2: 0x0029, 0x13d3: 0x002b, 0x13d4: 0x002d, 0x13d5: 0x002f, 0x13d6: 0x0031, 0x13d7: 0x0033, - 0x13d8: 0x0021, 0x13d9: 0x0023, 0x13da: 0x0025, 0x13db: 0x0027, 0x13dc: 0x0029, 0x13dd: 0x002b, - 0x13de: 0x002d, 0x13df: 0x002f, 0x13e0: 0x0031, 0x13e1: 0x0033, 0x13e2: 0x0021, 0x13e3: 0x0023, - 0x13e4: 0x0025, 0x13e5: 0x0027, 0x13e6: 0x0029, 0x13e7: 0x002b, 0x13e8: 0x002d, 0x13e9: 0x002f, - 0x13ea: 0x0031, 0x13eb: 0x0033, 0x13ec: 0x0021, 0x13ed: 0x0023, 0x13ee: 0x0025, 0x13ef: 0x0027, - 0x13f0: 0x0029, 0x13f1: 0x002b, 0x13f2: 0x002d, 0x13f3: 0x002f, 0x13f4: 0x0031, 0x13f5: 0x0033, - 0x13f6: 0x0021, 0x13f7: 0x0023, 0x13f8: 0x0025, 0x13f9: 0x0027, 0x13fa: 0x0029, 0x13fb: 0x002b, - 0x13fc: 0x002d, 0x13fd: 0x002f, 0x13fe: 0x0031, 0x13ff: 0x0033, - // Block 0x50, offset 0x1400 - 0x1400: 0x023c, 0x1401: 0x023f, 0x1402: 0x024b, 0x1403: 0x0254, 0x1405: 0x028d, - 0x1406: 0x025d, 0x1407: 0x024e, 0x1408: 0x026c, 0x1409: 0x0293, 0x140a: 0x027e, 0x140b: 0x0281, - 0x140c: 0x0284, 0x140d: 0x0287, 0x140e: 0x0260, 0x140f: 0x0272, 0x1410: 0x0278, 0x1411: 0x0266, - 0x1412: 0x027b, 0x1413: 0x025a, 0x1414: 0x0263, 0x1415: 0x0245, 0x1416: 0x0248, 0x1417: 0x0251, - 0x1418: 0x0257, 0x1419: 0x0269, 0x141a: 0x026f, 0x141b: 0x0275, 0x141c: 0x0296, 0x141d: 0x02e7, - 0x141e: 0x02cf, 0x141f: 0x0299, 0x1421: 0x023f, 0x1422: 0x024b, - 0x1424: 0x028a, 0x1427: 0x024e, 0x1429: 0x0293, - 0x142a: 0x027e, 0x142b: 0x0281, 0x142c: 0x0284, 0x142d: 0x0287, 0x142e: 0x0260, 0x142f: 0x0272, - 0x1430: 0x0278, 0x1431: 0x0266, 0x1432: 0x027b, 0x1434: 0x0263, 0x1435: 0x0245, - 0x1436: 0x0248, 0x1437: 0x0251, 0x1439: 0x0269, 0x143b: 0x0275, - // Block 0x51, offset 0x1440 - 0x1442: 0x024b, - 0x1447: 0x024e, 0x1449: 0x0293, 0x144b: 0x0281, - 0x144d: 0x0287, 0x144e: 0x0260, 0x144f: 0x0272, 0x1451: 0x0266, - 0x1452: 0x027b, 0x1454: 0x0263, 0x1457: 0x0251, - 0x1459: 0x0269, 0x145b: 0x0275, 0x145d: 0x02e7, - 0x145f: 0x0299, 0x1461: 0x023f, 0x1462: 0x024b, - 0x1464: 0x028a, 0x1467: 0x024e, 0x1468: 0x026c, 0x1469: 0x0293, - 0x146a: 0x027e, 0x146c: 0x0284, 0x146d: 0x0287, 0x146e: 0x0260, 0x146f: 0x0272, - 0x1470: 0x0278, 0x1471: 0x0266, 0x1472: 0x027b, 0x1474: 0x0263, 0x1475: 0x0245, - 0x1476: 0x0248, 0x1477: 0x0251, 0x1479: 0x0269, 0x147a: 0x026f, 0x147b: 0x0275, - 0x147c: 0x0296, 0x147e: 0x02cf, - // Block 0x52, offset 0x1480 - 0x1480: 0x023c, 0x1481: 0x023f, 0x1482: 0x024b, 0x1483: 0x0254, 0x1484: 0x028a, 0x1485: 0x028d, - 0x1486: 0x025d, 0x1487: 0x024e, 0x1488: 0x026c, 0x1489: 0x0293, 0x148b: 0x0281, - 0x148c: 0x0284, 0x148d: 0x0287, 0x148e: 0x0260, 0x148f: 0x0272, 0x1490: 0x0278, 0x1491: 0x0266, - 0x1492: 0x027b, 0x1493: 0x025a, 0x1494: 0x0263, 0x1495: 0x0245, 0x1496: 0x0248, 0x1497: 0x0251, - 0x1498: 0x0257, 0x1499: 0x0269, 0x149a: 0x026f, 0x149b: 0x0275, - 0x14a1: 0x023f, 0x14a2: 0x024b, 0x14a3: 0x0254, - 0x14a5: 0x028d, 0x14a6: 0x025d, 0x14a7: 0x024e, 0x14a8: 0x026c, 0x14a9: 0x0293, - 0x14ab: 0x0281, 0x14ac: 0x0284, 0x14ad: 0x0287, 0x14ae: 0x0260, 0x14af: 0x0272, - 0x14b0: 0x0278, 0x14b1: 0x0266, 0x14b2: 0x027b, 0x14b3: 0x025a, 0x14b4: 0x0263, 0x14b5: 0x0245, - 0x14b6: 0x0248, 0x14b7: 0x0251, 0x14b8: 0x0257, 0x14b9: 0x0269, 0x14ba: 0x026f, 0x14bb: 0x0275, - // Block 0x53, offset 0x14c0 - 0x14c0: 0x187c, 0x14c1: 0x1879, 0x14c2: 0x187f, 0x14c3: 0x18a3, 0x14c4: 0x18c7, 0x14c5: 0x18eb, - 0x14c6: 0x190f, 0x14c7: 0x1918, 0x14c8: 0x191e, 0x14c9: 0x1924, 0x14ca: 0x192a, - 0x14d0: 0x1a92, 0x14d1: 0x1a96, - 0x14d2: 0x1a9a, 0x14d3: 0x1a9e, 0x14d4: 0x1aa2, 0x14d5: 0x1aa6, 0x14d6: 0x1aaa, 0x14d7: 0x1aae, - 0x14d8: 0x1ab2, 0x14d9: 0x1ab6, 0x14da: 0x1aba, 0x14db: 0x1abe, 0x14dc: 0x1ac2, 0x14dd: 0x1ac6, - 0x14de: 0x1aca, 0x14df: 0x1ace, 0x14e0: 0x1ad2, 0x14e1: 0x1ad6, 0x14e2: 0x1ada, 0x14e3: 0x1ade, - 0x14e4: 0x1ae2, 0x14e5: 0x1ae6, 0x14e6: 0x1aea, 0x14e7: 0x1aee, 0x14e8: 0x1af2, 0x14e9: 0x1af6, - 0x14ea: 0x272b, 0x14eb: 0x0047, 0x14ec: 0x0065, 0x14ed: 0x193f, 0x14ee: 0x19b7, - 0x14f0: 0x0043, 0x14f1: 0x0045, 0x14f2: 0x0047, 0x14f3: 0x0049, 0x14f4: 0x004b, 0x14f5: 0x004d, - 0x14f6: 0x004f, 0x14f7: 0x0051, 0x14f8: 0x0053, 0x14f9: 0x0055, 0x14fa: 0x0057, 0x14fb: 0x0059, - 0x14fc: 0x005b, 0x14fd: 0x005d, 0x14fe: 0x005f, 0x14ff: 0x0061, - // Block 0x54, offset 0x1500 - 0x1500: 0x26b3, 0x1501: 0x26c8, 0x1502: 0x0506, - 0x1510: 0x0c12, 0x1511: 0x0a4a, - 0x1512: 0x08d6, 0x1513: 0x45db, 0x1514: 0x071e, 0x1515: 0x09f2, 0x1516: 0x1332, 0x1517: 0x0a02, - 0x1518: 0x072a, 0x1519: 0x0cda, 0x151a: 0x0eb2, 0x151b: 0x0cb2, 0x151c: 0x082a, 0x151d: 0x0b6e, - 0x151e: 0x07c2, 0x151f: 0x0cba, 0x1520: 0x0816, 0x1521: 0x111a, 0x1522: 0x0f86, 0x1523: 0x138e, - 0x1524: 0x09d6, 0x1525: 0x090e, 0x1526: 0x0e66, 0x1527: 0x0c1e, 0x1528: 0x0c4a, 0x1529: 0x06c2, - 0x152a: 0x06ce, 0x152b: 0x140e, 0x152c: 0x0ade, 0x152d: 0x06ea, 0x152e: 0x08f2, 0x152f: 0x0c3e, - 0x1530: 0x13b6, 0x1531: 0x0c16, 0x1532: 0x1072, 0x1533: 0x10ae, 0x1534: 0x08fa, 0x1535: 0x0e46, - 0x1536: 0x0d0e, 0x1537: 0x0d0a, 0x1538: 0x0f9a, 0x1539: 0x082e, 0x153a: 0x095a, 0x153b: 0x1446, - // Block 0x55, offset 0x1540 - 0x1540: 0x06fe, 0x1541: 0x06f6, 0x1542: 0x0706, 0x1543: 0x164a, 0x1544: 0x074a, 0x1545: 0x075a, - 0x1546: 0x075e, 0x1547: 0x0766, 0x1548: 0x076e, 0x1549: 0x0772, 0x154a: 0x077e, 0x154b: 0x0776, - 0x154c: 0x05b6, 0x154d: 0x165e, 0x154e: 0x0792, 0x154f: 0x0796, 0x1550: 0x079a, 0x1551: 0x07b6, - 0x1552: 0x164f, 0x1553: 0x05ba, 0x1554: 0x07a2, 0x1555: 0x07c2, 0x1556: 0x1659, 0x1557: 0x07d2, - 0x1558: 0x07da, 0x1559: 0x073a, 0x155a: 0x07e2, 0x155b: 0x07e6, 0x155c: 0x1834, 0x155d: 0x0802, - 0x155e: 0x080a, 0x155f: 0x05c2, 0x1560: 0x0822, 0x1561: 0x0826, 0x1562: 0x082e, 0x1563: 0x0832, - 0x1564: 0x05c6, 0x1565: 0x084a, 0x1566: 0x084e, 0x1567: 0x085a, 0x1568: 0x0866, 0x1569: 0x086a, - 0x156a: 0x086e, 0x156b: 0x0876, 0x156c: 0x0896, 0x156d: 0x089a, 0x156e: 0x08a2, 0x156f: 0x08b2, - 0x1570: 0x08ba, 0x1571: 0x08be, 0x1572: 0x08be, 0x1573: 0x08be, 0x1574: 0x166d, 0x1575: 0x0e96, - 0x1576: 0x08d2, 0x1577: 0x08da, 0x1578: 0x1672, 0x1579: 0x08e6, 0x157a: 0x08ee, 0x157b: 0x08f6, - 0x157c: 0x091e, 0x157d: 0x090a, 0x157e: 0x0916, 0x157f: 0x091a, - // Block 0x56, offset 0x1580 - 0x1580: 0x0922, 0x1581: 0x092a, 0x1582: 0x092e, 0x1583: 0x0936, 0x1584: 0x093e, 0x1585: 0x0942, - 0x1586: 0x0942, 0x1587: 0x094a, 0x1588: 0x0952, 0x1589: 0x0956, 0x158a: 0x0962, 0x158b: 0x0986, - 0x158c: 0x096a, 0x158d: 0x098a, 0x158e: 0x096e, 0x158f: 0x0976, 0x1590: 0x080e, 0x1591: 0x09d2, - 0x1592: 0x099a, 0x1593: 0x099e, 0x1594: 0x09a2, 0x1595: 0x0996, 0x1596: 0x09aa, 0x1597: 0x09a6, - 0x1598: 0x09be, 0x1599: 0x1677, 0x159a: 0x09da, 0x159b: 0x09de, 0x159c: 0x09e6, 0x159d: 0x09f2, - 0x159e: 0x09fa, 0x159f: 0x0a16, 0x15a0: 0x167c, 0x15a1: 0x1681, 0x15a2: 0x0a22, 0x15a3: 0x0a26, - 0x15a4: 0x0a2a, 0x15a5: 0x0a1e, 0x15a6: 0x0a32, 0x15a7: 0x05ca, 0x15a8: 0x05ce, 0x15a9: 0x0a3a, - 0x15aa: 0x0a42, 0x15ab: 0x0a42, 0x15ac: 0x1686, 0x15ad: 0x0a5e, 0x15ae: 0x0a62, 0x15af: 0x0a66, - 0x15b0: 0x0a6e, 0x15b1: 0x168b, 0x15b2: 0x0a76, 0x15b3: 0x0a7a, 0x15b4: 0x0b52, 0x15b5: 0x0a82, - 0x15b6: 0x05d2, 0x15b7: 0x0a8e, 0x15b8: 0x0a9e, 0x15b9: 0x0aaa, 0x15ba: 0x0aa6, 0x15bb: 0x1695, - 0x15bc: 0x0ab2, 0x15bd: 0x169a, 0x15be: 0x0abe, 0x15bf: 0x0aba, - // Block 0x57, offset 0x15c0 - 0x15c0: 0x0ac2, 0x15c1: 0x0ad2, 0x15c2: 0x0ad6, 0x15c3: 0x05d6, 0x15c4: 0x0ae6, 0x15c5: 0x0aee, - 0x15c6: 0x0af2, 0x15c7: 0x0af6, 0x15c8: 0x05da, 0x15c9: 0x169f, 0x15ca: 0x05de, 0x15cb: 0x0b12, - 0x15cc: 0x0b16, 0x15cd: 0x0b1a, 0x15ce: 0x0b22, 0x15cf: 0x1866, 0x15d0: 0x0b3a, 0x15d1: 0x16a9, - 0x15d2: 0x16a9, 0x15d3: 0x11da, 0x15d4: 0x0b4a, 0x15d5: 0x0b4a, 0x15d6: 0x05e2, 0x15d7: 0x16cc, - 0x15d8: 0x179e, 0x15d9: 0x0b5a, 0x15da: 0x0b62, 0x15db: 0x05e6, 0x15dc: 0x0b76, 0x15dd: 0x0b86, - 0x15de: 0x0b8a, 0x15df: 0x0b92, 0x15e0: 0x0ba2, 0x15e1: 0x05ee, 0x15e2: 0x05ea, 0x15e3: 0x0ba6, - 0x15e4: 0x16ae, 0x15e5: 0x0baa, 0x15e6: 0x0bbe, 0x15e7: 0x0bc2, 0x15e8: 0x0bc6, 0x15e9: 0x0bc2, - 0x15ea: 0x0bd2, 0x15eb: 0x0bd6, 0x15ec: 0x0be6, 0x15ed: 0x0bde, 0x15ee: 0x0be2, 0x15ef: 0x0bea, - 0x15f0: 0x0bee, 0x15f1: 0x0bf2, 0x15f2: 0x0bfe, 0x15f3: 0x0c02, 0x15f4: 0x0c1a, 0x15f5: 0x0c22, - 0x15f6: 0x0c32, 0x15f7: 0x0c46, 0x15f8: 0x16bd, 0x15f9: 0x0c42, 0x15fa: 0x0c36, 0x15fb: 0x0c4e, - 0x15fc: 0x0c56, 0x15fd: 0x0c6a, 0x15fe: 0x16c2, 0x15ff: 0x0c72, - // Block 0x58, offset 0x1600 - 0x1600: 0x0c66, 0x1601: 0x0c5e, 0x1602: 0x05f2, 0x1603: 0x0c7a, 0x1604: 0x0c82, 0x1605: 0x0c8a, - 0x1606: 0x0c7e, 0x1607: 0x05f6, 0x1608: 0x0c9a, 0x1609: 0x0ca2, 0x160a: 0x16c7, 0x160b: 0x0cce, - 0x160c: 0x0d02, 0x160d: 0x0cde, 0x160e: 0x0602, 0x160f: 0x0cea, 0x1610: 0x05fe, 0x1611: 0x05fa, - 0x1612: 0x07c6, 0x1613: 0x07ca, 0x1614: 0x0d06, 0x1615: 0x0cee, 0x1616: 0x11ae, 0x1617: 0x0666, - 0x1618: 0x0d12, 0x1619: 0x0d16, 0x161a: 0x0d1a, 0x161b: 0x0d2e, 0x161c: 0x0d26, 0x161d: 0x16e0, - 0x161e: 0x0606, 0x161f: 0x0d42, 0x1620: 0x0d36, 0x1621: 0x0d52, 0x1622: 0x0d5a, 0x1623: 0x16ea, - 0x1624: 0x0d5e, 0x1625: 0x0d4a, 0x1626: 0x0d66, 0x1627: 0x060a, 0x1628: 0x0d6a, 0x1629: 0x0d6e, - 0x162a: 0x0d72, 0x162b: 0x0d7e, 0x162c: 0x16ef, 0x162d: 0x0d86, 0x162e: 0x060e, 0x162f: 0x0d92, - 0x1630: 0x16f4, 0x1631: 0x0d96, 0x1632: 0x0612, 0x1633: 0x0da2, 0x1634: 0x0dae, 0x1635: 0x0dba, - 0x1636: 0x0dbe, 0x1637: 0x16f9, 0x1638: 0x1690, 0x1639: 0x16fe, 0x163a: 0x0dde, 0x163b: 0x1703, - 0x163c: 0x0dea, 0x163d: 0x0df2, 0x163e: 0x0de2, 0x163f: 0x0dfe, - // Block 0x59, offset 0x1640 - 0x1640: 0x0e0e, 0x1641: 0x0e1e, 0x1642: 0x0e12, 0x1643: 0x0e16, 0x1644: 0x0e22, 0x1645: 0x0e26, - 0x1646: 0x1708, 0x1647: 0x0e0a, 0x1648: 0x0e3e, 0x1649: 0x0e42, 0x164a: 0x0616, 0x164b: 0x0e56, - 0x164c: 0x0e52, 0x164d: 0x170d, 0x164e: 0x0e36, 0x164f: 0x0e72, 0x1650: 0x1712, 0x1651: 0x1717, - 0x1652: 0x0e76, 0x1653: 0x0e8a, 0x1654: 0x0e86, 0x1655: 0x0e82, 0x1656: 0x061a, 0x1657: 0x0e8e, - 0x1658: 0x0e9e, 0x1659: 0x0e9a, 0x165a: 0x0ea6, 0x165b: 0x1654, 0x165c: 0x0eb6, 0x165d: 0x171c, - 0x165e: 0x0ec2, 0x165f: 0x1726, 0x1660: 0x0ed6, 0x1661: 0x0ee2, 0x1662: 0x0ef6, 0x1663: 0x172b, - 0x1664: 0x0f0a, 0x1665: 0x0f0e, 0x1666: 0x1730, 0x1667: 0x1735, 0x1668: 0x0f2a, 0x1669: 0x0f3a, - 0x166a: 0x061e, 0x166b: 0x0f3e, 0x166c: 0x0622, 0x166d: 0x0622, 0x166e: 0x0f56, 0x166f: 0x0f5a, - 0x1670: 0x0f62, 0x1671: 0x0f66, 0x1672: 0x0f72, 0x1673: 0x0626, 0x1674: 0x0f8a, 0x1675: 0x173a, - 0x1676: 0x0fa6, 0x1677: 0x173f, 0x1678: 0x0fb2, 0x1679: 0x16a4, 0x167a: 0x0fc2, 0x167b: 0x1744, - 0x167c: 0x1749, 0x167d: 0x174e, 0x167e: 0x062a, 0x167f: 0x062e, - // Block 0x5a, offset 0x1680 - 0x1680: 0x0ffa, 0x1681: 0x1758, 0x1682: 0x1753, 0x1683: 0x175d, 0x1684: 0x1762, 0x1685: 0x1002, - 0x1686: 0x1006, 0x1687: 0x1006, 0x1688: 0x100e, 0x1689: 0x0636, 0x168a: 0x1012, 0x168b: 0x063a, - 0x168c: 0x063e, 0x168d: 0x176c, 0x168e: 0x1026, 0x168f: 0x102e, 0x1690: 0x103a, 0x1691: 0x0642, - 0x1692: 0x1771, 0x1693: 0x105e, 0x1694: 0x1776, 0x1695: 0x177b, 0x1696: 0x107e, 0x1697: 0x1096, - 0x1698: 0x0646, 0x1699: 0x109e, 0x169a: 0x10a2, 0x169b: 0x10a6, 0x169c: 0x1780, 0x169d: 0x1785, - 0x169e: 0x1785, 0x169f: 0x10be, 0x16a0: 0x064a, 0x16a1: 0x178a, 0x16a2: 0x10d2, 0x16a3: 0x10d6, - 0x16a4: 0x064e, 0x16a5: 0x178f, 0x16a6: 0x10f2, 0x16a7: 0x0652, 0x16a8: 0x1102, 0x16a9: 0x10fa, - 0x16aa: 0x110a, 0x16ab: 0x1799, 0x16ac: 0x1122, 0x16ad: 0x0656, 0x16ae: 0x112e, 0x16af: 0x1136, - 0x16b0: 0x1146, 0x16b1: 0x065a, 0x16b2: 0x17a3, 0x16b3: 0x17a8, 0x16b4: 0x065e, 0x16b5: 0x17ad, - 0x16b6: 0x115e, 0x16b7: 0x17b2, 0x16b8: 0x116a, 0x16b9: 0x1176, 0x16ba: 0x117e, 0x16bb: 0x17b7, - 0x16bc: 0x17bc, 0x16bd: 0x1192, 0x16be: 0x17c1, 0x16bf: 0x119a, - // Block 0x5b, offset 0x16c0 - 0x16c0: 0x16d1, 0x16c1: 0x0662, 0x16c2: 0x11b2, 0x16c3: 0x11b6, 0x16c4: 0x066a, 0x16c5: 0x11ba, - 0x16c6: 0x0a36, 0x16c7: 0x17c6, 0x16c8: 0x17cb, 0x16c9: 0x16d6, 0x16ca: 0x16db, 0x16cb: 0x11da, - 0x16cc: 0x11de, 0x16cd: 0x13f6, 0x16ce: 0x066e, 0x16cf: 0x120a, 0x16d0: 0x1206, 0x16d1: 0x120e, - 0x16d2: 0x0842, 0x16d3: 0x1212, 0x16d4: 0x1216, 0x16d5: 0x121a, 0x16d6: 0x1222, 0x16d7: 0x17d0, - 0x16d8: 0x121e, 0x16d9: 0x1226, 0x16da: 0x123a, 0x16db: 0x123e, 0x16dc: 0x122a, 0x16dd: 0x1242, - 0x16de: 0x1256, 0x16df: 0x126a, 0x16e0: 0x1236, 0x16e1: 0x124a, 0x16e2: 0x124e, 0x16e3: 0x1252, - 0x16e4: 0x17d5, 0x16e5: 0x17df, 0x16e6: 0x17da, 0x16e7: 0x0672, 0x16e8: 0x1272, 0x16e9: 0x1276, - 0x16ea: 0x127e, 0x16eb: 0x17f3, 0x16ec: 0x1282, 0x16ed: 0x17e4, 0x16ee: 0x0676, 0x16ef: 0x067a, - 0x16f0: 0x17e9, 0x16f1: 0x17ee, 0x16f2: 0x067e, 0x16f3: 0x12a2, 0x16f4: 0x12a6, 0x16f5: 0x12aa, - 0x16f6: 0x12ae, 0x16f7: 0x12ba, 0x16f8: 0x12b6, 0x16f9: 0x12c2, 0x16fa: 0x12be, 0x16fb: 0x12ce, - 0x16fc: 0x12c6, 0x16fd: 0x12ca, 0x16fe: 0x12d2, 0x16ff: 0x0682, - // Block 0x5c, offset 0x1700 - 0x1700: 0x12da, 0x1701: 0x12de, 0x1702: 0x0686, 0x1703: 0x12ee, 0x1704: 0x12f2, 0x1705: 0x17f8, - 0x1706: 0x12fe, 0x1707: 0x1302, 0x1708: 0x068a, 0x1709: 0x130e, 0x170a: 0x05be, 0x170b: 0x17fd, - 0x170c: 0x1802, 0x170d: 0x068e, 0x170e: 0x0692, 0x170f: 0x133a, 0x1710: 0x1352, 0x1711: 0x136e, - 0x1712: 0x137e, 0x1713: 0x1807, 0x1714: 0x1392, 0x1715: 0x1396, 0x1716: 0x13ae, 0x1717: 0x13ba, - 0x1718: 0x1811, 0x1719: 0x1663, 0x171a: 0x13c6, 0x171b: 0x13c2, 0x171c: 0x13ce, 0x171d: 0x1668, - 0x171e: 0x13da, 0x171f: 0x13e6, 0x1720: 0x1816, 0x1721: 0x181b, 0x1722: 0x1426, 0x1723: 0x1432, - 0x1724: 0x143a, 0x1725: 0x1820, 0x1726: 0x143e, 0x1727: 0x146a, 0x1728: 0x1476, 0x1729: 0x147a, - 0x172a: 0x1472, 0x172b: 0x1486, 0x172c: 0x148a, 0x172d: 0x1825, 0x172e: 0x1496, 0x172f: 0x0696, - 0x1730: 0x149e, 0x1731: 0x182a, 0x1732: 0x069a, 0x1733: 0x14d6, 0x1734: 0x0ac6, 0x1735: 0x14ee, - 0x1736: 0x182f, 0x1737: 0x1839, 0x1738: 0x069e, 0x1739: 0x06a2, 0x173a: 0x1516, 0x173b: 0x183e, - 0x173c: 0x06a6, 0x173d: 0x1843, 0x173e: 0x152e, 0x173f: 0x152e, - // Block 0x5d, offset 0x1740 - 0x1740: 0x1536, 0x1741: 0x1848, 0x1742: 0x154e, 0x1743: 0x06aa, 0x1744: 0x155e, 0x1745: 0x156a, - 0x1746: 0x1572, 0x1747: 0x157a, 0x1748: 0x06ae, 0x1749: 0x184d, 0x174a: 0x158e, 0x174b: 0x15aa, - 0x174c: 0x15b6, 0x174d: 0x06b2, 0x174e: 0x06b6, 0x174f: 0x15ba, 0x1750: 0x1852, 0x1751: 0x06ba, - 0x1752: 0x1857, 0x1753: 0x185c, 0x1754: 0x1861, 0x1755: 0x15de, 0x1756: 0x06be, 0x1757: 0x15f2, - 0x1758: 0x15fa, 0x1759: 0x15fe, 0x175a: 0x1606, 0x175b: 0x160e, 0x175c: 0x1616, 0x175d: 0x186b, -} - -// nfkcIndex: 22 blocks, 1408 entries, 2816 bytes -// Block 0 is the zero block. -var nfkcIndex = [1408]uint16{ - // Block 0x0, offset 0x0 - // Block 0x1, offset 0x40 - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xc2: 0x5c, 0xc3: 0x01, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x5d, 0xc7: 0x04, - 0xc8: 0x05, 0xca: 0x5e, 0xcb: 0x5f, 0xcc: 0x06, 0xcd: 0x07, 0xce: 0x08, 0xcf: 0x09, - 0xd0: 0x0a, 0xd1: 0x60, 0xd2: 0x61, 0xd3: 0x0b, 0xd6: 0x0c, 0xd7: 0x62, - 0xd8: 0x63, 0xd9: 0x0d, 0xdb: 0x64, 0xdc: 0x65, 0xdd: 0x66, 0xdf: 0x67, - 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, - 0xea: 0x06, 0xeb: 0x07, 0xec: 0x08, 0xed: 0x09, 0xef: 0x0a, - 0xf0: 0x13, - // Block 0x4, offset 0x100 - 0x120: 0x68, 0x121: 0x69, 0x123: 0x0e, 0x124: 0x6a, 0x125: 0x6b, 0x126: 0x6c, 0x127: 0x6d, - 0x128: 0x6e, 0x129: 0x6f, 0x12a: 0x70, 0x12b: 0x71, 0x12c: 0x6c, 0x12d: 0x72, 0x12e: 0x73, 0x12f: 0x74, - 0x131: 0x75, 0x132: 0x76, 0x133: 0x77, 0x134: 0x78, 0x135: 0x79, 0x137: 0x7a, - 0x138: 0x7b, 0x139: 0x7c, 0x13a: 0x7d, 0x13b: 0x7e, 0x13c: 0x7f, 0x13d: 0x80, 0x13e: 0x81, 0x13f: 0x82, - // Block 0x5, offset 0x140 - 0x140: 0x83, 0x142: 0x84, 0x143: 0x85, 0x144: 0x86, 0x145: 0x87, 0x146: 0x88, 0x147: 0x89, - 0x14d: 0x8a, - 0x15c: 0x8b, 0x15f: 0x8c, - 0x162: 0x8d, 0x164: 0x8e, - 0x168: 0x8f, 0x169: 0x90, 0x16a: 0x91, 0x16b: 0x92, 0x16c: 0x0f, 0x16d: 0x93, 0x16e: 0x94, 0x16f: 0x95, - 0x170: 0x96, 0x173: 0x97, 0x174: 0x98, 0x175: 0x10, 0x176: 0x11, 0x177: 0x12, - 0x178: 0x13, 0x179: 0x14, 0x17a: 0x15, 0x17b: 0x16, 0x17c: 0x17, 0x17d: 0x18, 0x17e: 0x19, 0x17f: 0x1a, - // Block 0x6, offset 0x180 - 0x180: 0x99, 0x181: 0x9a, 0x182: 0x9b, 0x183: 0x9c, 0x184: 0x1b, 0x185: 0x1c, 0x186: 0x9d, 0x187: 0x9e, - 0x188: 0x9f, 0x189: 0x1d, 0x18a: 0x1e, 0x18b: 0xa0, 0x18c: 0xa1, - 0x191: 0x1f, 0x192: 0x20, 0x193: 0xa2, - 0x1a8: 0xa3, 0x1a9: 0xa4, 0x1ab: 0xa5, - 0x1b1: 0xa6, 0x1b3: 0xa7, 0x1b5: 0xa8, 0x1b7: 0xa9, - 0x1ba: 0xaa, 0x1bb: 0xab, 0x1bc: 0x21, 0x1bd: 0x22, 0x1be: 0x23, 0x1bf: 0xac, - // Block 0x7, offset 0x1c0 - 0x1c0: 0xad, 0x1c1: 0x24, 0x1c2: 0x25, 0x1c3: 0x26, 0x1c4: 0xae, 0x1c5: 0x27, 0x1c6: 0x28, - 0x1c8: 0x29, 0x1c9: 0x2a, 0x1ca: 0x2b, 0x1cb: 0x2c, 0x1cc: 0x2d, 0x1cd: 0x2e, 0x1ce: 0x2f, 0x1cf: 0x30, - // Block 0x8, offset 0x200 - 0x219: 0xaf, 0x21a: 0xb0, 0x21b: 0xb1, 0x21d: 0xb2, 0x21f: 0xb3, - 0x220: 0xb4, 0x223: 0xb5, 0x224: 0xb6, 0x225: 0xb7, 0x226: 0xb8, 0x227: 0xb9, - 0x22a: 0xba, 0x22b: 0xbb, 0x22d: 0xbc, 0x22f: 0xbd, - 0x230: 0xbe, 0x231: 0xbf, 0x232: 0xc0, 0x233: 0xc1, 0x234: 0xc2, 0x235: 0xc3, 0x236: 0xc4, 0x237: 0xbe, - 0x238: 0xbf, 0x239: 0xc0, 0x23a: 0xc1, 0x23b: 0xc2, 0x23c: 0xc3, 0x23d: 0xc4, 0x23e: 0xbe, 0x23f: 0xbf, - // Block 0x9, offset 0x240 - 0x240: 0xc0, 0x241: 0xc1, 0x242: 0xc2, 0x243: 0xc3, 0x244: 0xc4, 0x245: 0xbe, 0x246: 0xbf, 0x247: 0xc0, - 0x248: 0xc1, 0x249: 0xc2, 0x24a: 0xc3, 0x24b: 0xc4, 0x24c: 0xbe, 0x24d: 0xbf, 0x24e: 0xc0, 0x24f: 0xc1, - 0x250: 0xc2, 0x251: 0xc3, 0x252: 0xc4, 0x253: 0xbe, 0x254: 0xbf, 0x255: 0xc0, 0x256: 0xc1, 0x257: 0xc2, - 0x258: 0xc3, 0x259: 0xc4, 0x25a: 0xbe, 0x25b: 0xbf, 0x25c: 0xc0, 0x25d: 0xc1, 0x25e: 0xc2, 0x25f: 0xc3, - 0x260: 0xc4, 0x261: 0xbe, 0x262: 0xbf, 0x263: 0xc0, 0x264: 0xc1, 0x265: 0xc2, 0x266: 0xc3, 0x267: 0xc4, - 0x268: 0xbe, 0x269: 0xbf, 0x26a: 0xc0, 0x26b: 0xc1, 0x26c: 0xc2, 0x26d: 0xc3, 0x26e: 0xc4, 0x26f: 0xbe, - 0x270: 0xbf, 0x271: 0xc0, 0x272: 0xc1, 0x273: 0xc2, 0x274: 0xc3, 0x275: 0xc4, 0x276: 0xbe, 0x277: 0xbf, - 0x278: 0xc0, 0x279: 0xc1, 0x27a: 0xc2, 0x27b: 0xc3, 0x27c: 0xc4, 0x27d: 0xbe, 0x27e: 0xbf, 0x27f: 0xc0, - // Block 0xa, offset 0x280 - 0x280: 0xc1, 0x281: 0xc2, 0x282: 0xc3, 0x283: 0xc4, 0x284: 0xbe, 0x285: 0xbf, 0x286: 0xc0, 0x287: 0xc1, - 0x288: 0xc2, 0x289: 0xc3, 0x28a: 0xc4, 0x28b: 0xbe, 0x28c: 0xbf, 0x28d: 0xc0, 0x28e: 0xc1, 0x28f: 0xc2, - 0x290: 0xc3, 0x291: 0xc4, 0x292: 0xbe, 0x293: 0xbf, 0x294: 0xc0, 0x295: 0xc1, 0x296: 0xc2, 0x297: 0xc3, - 0x298: 0xc4, 0x299: 0xbe, 0x29a: 0xbf, 0x29b: 0xc0, 0x29c: 0xc1, 0x29d: 0xc2, 0x29e: 0xc3, 0x29f: 0xc4, - 0x2a0: 0xbe, 0x2a1: 0xbf, 0x2a2: 0xc0, 0x2a3: 0xc1, 0x2a4: 0xc2, 0x2a5: 0xc3, 0x2a6: 0xc4, 0x2a7: 0xbe, - 0x2a8: 0xbf, 0x2a9: 0xc0, 0x2aa: 0xc1, 0x2ab: 0xc2, 0x2ac: 0xc3, 0x2ad: 0xc4, 0x2ae: 0xbe, 0x2af: 0xbf, - 0x2b0: 0xc0, 0x2b1: 0xc1, 0x2b2: 0xc2, 0x2b3: 0xc3, 0x2b4: 0xc4, 0x2b5: 0xbe, 0x2b6: 0xbf, 0x2b7: 0xc0, - 0x2b8: 0xc1, 0x2b9: 0xc2, 0x2ba: 0xc3, 0x2bb: 0xc4, 0x2bc: 0xbe, 0x2bd: 0xbf, 0x2be: 0xc0, 0x2bf: 0xc1, - // Block 0xb, offset 0x2c0 - 0x2c0: 0xc2, 0x2c1: 0xc3, 0x2c2: 0xc4, 0x2c3: 0xbe, 0x2c4: 0xbf, 0x2c5: 0xc0, 0x2c6: 0xc1, 0x2c7: 0xc2, - 0x2c8: 0xc3, 0x2c9: 0xc4, 0x2ca: 0xbe, 0x2cb: 0xbf, 0x2cc: 0xc0, 0x2cd: 0xc1, 0x2ce: 0xc2, 0x2cf: 0xc3, - 0x2d0: 0xc4, 0x2d1: 0xbe, 0x2d2: 0xbf, 0x2d3: 0xc0, 0x2d4: 0xc1, 0x2d5: 0xc2, 0x2d6: 0xc3, 0x2d7: 0xc4, - 0x2d8: 0xbe, 0x2d9: 0xbf, 0x2da: 0xc0, 0x2db: 0xc1, 0x2dc: 0xc2, 0x2dd: 0xc3, 0x2de: 0xc5, - // Block 0xc, offset 0x300 - 0x324: 0x31, 0x325: 0x32, 0x326: 0x33, 0x327: 0x34, - 0x328: 0x35, 0x329: 0x36, 0x32a: 0x37, 0x32b: 0x38, 0x32c: 0x39, 0x32d: 0x3a, 0x32e: 0x3b, 0x32f: 0x3c, - 0x330: 0x3d, 0x331: 0x3e, 0x332: 0x3f, 0x333: 0x40, 0x334: 0x41, 0x335: 0x42, 0x336: 0x43, 0x337: 0x44, - 0x338: 0x45, 0x339: 0x46, 0x33a: 0x47, 0x33b: 0x48, 0x33c: 0xc6, 0x33d: 0x49, 0x33e: 0x4a, 0x33f: 0x4b, - // Block 0xd, offset 0x340 - 0x347: 0xc7, - 0x34b: 0xc8, 0x34d: 0xc9, - 0x368: 0xca, 0x36b: 0xcb, - 0x374: 0xcc, - 0x37a: 0xcd, 0x37d: 0xce, - // Block 0xe, offset 0x380 - 0x381: 0xcf, 0x382: 0xd0, 0x384: 0xd1, 0x385: 0xb8, 0x387: 0xd2, - 0x388: 0xd3, 0x38b: 0xd4, 0x38c: 0xd5, 0x38d: 0xd6, - 0x391: 0xd7, 0x392: 0xd8, 0x393: 0xd9, 0x396: 0xda, 0x397: 0xdb, - 0x398: 0xdc, 0x39a: 0xdd, 0x39c: 0xde, - 0x3a0: 0xdf, 0x3a4: 0xe0, 0x3a5: 0xe1, 0x3a7: 0xe2, - 0x3a8: 0xe3, 0x3a9: 0xe4, 0x3aa: 0xe5, - 0x3b0: 0xdc, 0x3b5: 0xe6, 0x3b6: 0xe7, - // Block 0xf, offset 0x3c0 - 0x3eb: 0xe8, 0x3ec: 0xe9, - 0x3ff: 0xea, - // Block 0x10, offset 0x400 - 0x432: 0xeb, - // Block 0x11, offset 0x440 - 0x445: 0xec, 0x446: 0xed, 0x447: 0xee, - 0x449: 0xef, - 0x450: 0xf0, 0x451: 0xf1, 0x452: 0xf2, 0x453: 0xf3, 0x454: 0xf4, 0x455: 0xf5, 0x456: 0xf6, 0x457: 0xf7, - 0x458: 0xf8, 0x459: 0xf9, 0x45a: 0x4c, 0x45b: 0xfa, 0x45c: 0xfb, 0x45d: 0xfc, 0x45e: 0xfd, 0x45f: 0x4d, - // Block 0x12, offset 0x480 - 0x480: 0xfe, 0x484: 0xe9, - 0x48b: 0xff, - 0x4a3: 0x100, 0x4a5: 0x101, - 0x4b8: 0x4e, 0x4b9: 0x4f, 0x4ba: 0x50, - // Block 0x13, offset 0x4c0 - 0x4c4: 0x51, 0x4c5: 0x102, 0x4c6: 0x103, - 0x4c8: 0x52, 0x4c9: 0x104, - 0x4ef: 0x105, - // Block 0x14, offset 0x500 - 0x520: 0x53, 0x521: 0x54, 0x522: 0x55, 0x523: 0x56, 0x524: 0x57, 0x525: 0x58, 0x526: 0x59, 0x527: 0x5a, - 0x528: 0x5b, - // Block 0x15, offset 0x540 - 0x550: 0x0b, 0x551: 0x0c, 0x556: 0x0d, - 0x55b: 0x0e, 0x55d: 0x0f, 0x55e: 0x10, 0x55f: 0x11, - 0x56f: 0x12, -} - -// nfkcSparseOffset: 170 entries, 340 bytes -var nfkcSparseOffset = []uint16{0x0, 0xe, 0x12, 0x1b, 0x25, 0x35, 0x37, 0x3c, 0x47, 0x56, 0x63, 0x6b, 0x70, 0x75, 0x77, 0x7f, 0x86, 0x89, 0x91, 0x95, 0x99, 0x9b, 0x9d, 0xa6, 0xaa, 0xb1, 0xb6, 0xb9, 0xc3, 0xc6, 0xcd, 0xd5, 0xd9, 0xdb, 0xdf, 0xe3, 0xe9, 0xfa, 0x106, 0x108, 0x10e, 0x110, 0x112, 0x114, 0x116, 0x118, 0x11a, 0x11c, 0x11f, 0x122, 0x124, 0x127, 0x12a, 0x12e, 0x134, 0x136, 0x13f, 0x141, 0x144, 0x146, 0x151, 0x15c, 0x16a, 0x178, 0x188, 0x196, 0x19d, 0x1a3, 0x1b2, 0x1b6, 0x1b8, 0x1bc, 0x1be, 0x1c1, 0x1c3, 0x1c6, 0x1c8, 0x1cb, 0x1cd, 0x1cf, 0x1d1, 0x1dd, 0x1e7, 0x1f1, 0x1f4, 0x1f8, 0x1fa, 0x1fc, 0x1fe, 0x201, 0x204, 0x206, 0x208, 0x20a, 0x20c, 0x212, 0x215, 0x21a, 0x21c, 0x223, 0x229, 0x22f, 0x237, 0x23d, 0x243, 0x249, 0x24d, 0x24f, 0x251, 0x253, 0x255, 0x25b, 0x25e, 0x260, 0x262, 0x268, 0x26b, 0x273, 0x27a, 0x27d, 0x280, 0x282, 0x285, 0x28d, 0x291, 0x298, 0x29b, 0x2a1, 0x2a3, 0x2a5, 0x2a8, 0x2aa, 0x2ad, 0x2b2, 0x2b4, 0x2b6, 0x2b8, 0x2ba, 0x2bc, 0x2bf, 0x2c1, 0x2c3, 0x2c5, 0x2c7, 0x2c9, 0x2d6, 0x2e0, 0x2e2, 0x2e4, 0x2e8, 0x2ed, 0x2f9, 0x2fe, 0x307, 0x30d, 0x312, 0x316, 0x31b, 0x31f, 0x32f, 0x33d, 0x34b, 0x359, 0x35f, 0x361, 0x363, 0x366, 0x371, 0x373, 0x37d} - -// nfkcSparseValues: 895 entries, 3580 bytes -var nfkcSparseValues = [895]valueRange{ - // Block 0x0, offset 0x0 - {value: 0x0002, lo: 0x0d}, - {value: 0x0001, lo: 0xa0, hi: 0xa0}, - {value: 0x428f, lo: 0xa8, hi: 0xa8}, - {value: 0x0083, lo: 0xaa, hi: 0xaa}, - {value: 0x427b, lo: 0xaf, hi: 0xaf}, - {value: 0x0025, lo: 0xb2, hi: 0xb3}, - {value: 0x4271, lo: 0xb4, hi: 0xb4}, - {value: 0x01df, lo: 0xb5, hi: 0xb5}, - {value: 0x42a8, lo: 0xb8, hi: 0xb8}, - {value: 0x0023, lo: 0xb9, hi: 0xb9}, - {value: 0x009f, lo: 0xba, hi: 0xba}, - {value: 0x2222, lo: 0xbc, hi: 0xbc}, - {value: 0x2216, lo: 0xbd, hi: 0xbd}, - {value: 0x22b8, lo: 0xbe, hi: 0xbe}, - // Block 0x1, offset 0xe - {value: 0x0091, lo: 0x03}, - {value: 0x46f9, lo: 0xa0, hi: 0xa1}, - {value: 0x472b, lo: 0xaf, hi: 0xb0}, - {value: 0xa000, lo: 0xb7, hi: 0xb7}, - // Block 0x2, offset 0x12 - {value: 0x0003, lo: 0x08}, - {value: 0xa000, lo: 0x92, hi: 0x92}, - {value: 0x0091, lo: 0xb0, hi: 0xb0}, - {value: 0x0119, lo: 0xb1, hi: 0xb1}, - {value: 0x0095, lo: 0xb2, hi: 0xb2}, - {value: 0x00a5, lo: 0xb3, hi: 0xb3}, - {value: 0x0143, lo: 0xb4, hi: 0xb6}, - {value: 0x00af, lo: 0xb7, hi: 0xb7}, - {value: 0x00b3, lo: 0xb8, hi: 0xb8}, - // Block 0x3, offset 0x1b - {value: 0x000a, lo: 0x09}, - {value: 0x4285, lo: 0x98, hi: 0x98}, - {value: 0x428a, lo: 0x99, hi: 0x9a}, - {value: 0x42ad, lo: 0x9b, hi: 0x9b}, - {value: 0x4276, lo: 0x9c, hi: 0x9c}, - {value: 0x4299, lo: 0x9d, hi: 0x9d}, - {value: 0x0113, lo: 0xa0, hi: 0xa0}, - {value: 0x0099, lo: 0xa1, hi: 0xa1}, - {value: 0x00a7, lo: 0xa2, hi: 0xa3}, - {value: 0x016a, lo: 0xa4, hi: 0xa4}, - // Block 0x4, offset 0x25 - {value: 0x0000, lo: 0x0f}, - {value: 0xa000, lo: 0x83, hi: 0x83}, - {value: 0xa000, lo: 0x87, hi: 0x87}, - {value: 0xa000, lo: 0x8b, hi: 0x8b}, - {value: 0xa000, lo: 0x8d, hi: 0x8d}, - {value: 0x37bc, lo: 0x90, hi: 0x90}, - {value: 0x37c8, lo: 0x91, hi: 0x91}, - {value: 0x37b6, lo: 0x93, hi: 0x93}, - {value: 0xa000, lo: 0x96, hi: 0x96}, - {value: 0x382e, lo: 0x97, hi: 0x97}, - {value: 0x37f8, lo: 0x9c, hi: 0x9c}, - {value: 0x37e0, lo: 0x9d, hi: 0x9d}, - {value: 0x380a, lo: 0x9e, hi: 0x9e}, - {value: 0xa000, lo: 0xb4, hi: 0xb5}, - {value: 0x3834, lo: 0xb6, hi: 0xb6}, - {value: 0x383a, lo: 0xb7, hi: 0xb7}, - // Block 0x5, offset 0x35 - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0x83, hi: 0x87}, - // Block 0x6, offset 0x37 - {value: 0x0001, lo: 0x04}, - {value: 0x8114, lo: 0x81, hi: 0x82}, - {value: 0x8133, lo: 0x84, hi: 0x84}, - {value: 0x812e, lo: 0x85, hi: 0x85}, - {value: 0x810e, lo: 0x87, hi: 0x87}, - // Block 0x7, offset 0x3c - {value: 0x0000, lo: 0x0a}, - {value: 0x8133, lo: 0x90, hi: 0x97}, - {value: 0x811a, lo: 0x98, hi: 0x98}, - {value: 0x811b, lo: 0x99, hi: 0x99}, - {value: 0x811c, lo: 0x9a, hi: 0x9a}, - {value: 0x3858, lo: 0xa2, hi: 0xa2}, - {value: 0x385e, lo: 0xa3, hi: 0xa3}, - {value: 0x386a, lo: 0xa4, hi: 0xa4}, - {value: 0x3864, lo: 0xa5, hi: 0xa5}, - {value: 0x3870, lo: 0xa6, hi: 0xa6}, - {value: 0xa000, lo: 0xa7, hi: 0xa7}, - // Block 0x8, offset 0x47 - {value: 0x0000, lo: 0x0e}, - {value: 0x3882, lo: 0x80, hi: 0x80}, - {value: 0xa000, lo: 0x81, hi: 0x81}, - {value: 0x3876, lo: 0x82, hi: 0x82}, - {value: 0xa000, lo: 0x92, hi: 0x92}, - {value: 0x387c, lo: 0x93, hi: 0x93}, - {value: 0xa000, lo: 0x95, hi: 0x95}, - {value: 0x8133, lo: 0x96, hi: 0x9c}, - {value: 0x8133, lo: 0x9f, hi: 0xa2}, - {value: 0x812e, lo: 0xa3, hi: 0xa3}, - {value: 0x8133, lo: 0xa4, hi: 0xa4}, - {value: 0x8133, lo: 0xa7, hi: 0xa8}, - {value: 0x812e, lo: 0xaa, hi: 0xaa}, - {value: 0x8133, lo: 0xab, hi: 0xac}, - {value: 0x812e, lo: 0xad, hi: 0xad}, - // Block 0x9, offset 0x56 - {value: 0x0000, lo: 0x0c}, - {value: 0x8120, lo: 0x91, hi: 0x91}, - {value: 0x8133, lo: 0xb0, hi: 0xb0}, - {value: 0x812e, lo: 0xb1, hi: 0xb1}, - {value: 0x8133, lo: 0xb2, hi: 0xb3}, - {value: 0x812e, lo: 0xb4, hi: 0xb4}, - {value: 0x8133, lo: 0xb5, hi: 0xb6}, - {value: 0x812e, lo: 0xb7, hi: 0xb9}, - {value: 0x8133, lo: 0xba, hi: 0xba}, - {value: 0x812e, lo: 0xbb, hi: 0xbc}, - {value: 0x8133, lo: 0xbd, hi: 0xbd}, - {value: 0x812e, lo: 0xbe, hi: 0xbe}, - {value: 0x8133, lo: 0xbf, hi: 0xbf}, - // Block 0xa, offset 0x63 - {value: 0x0005, lo: 0x07}, - {value: 0x8133, lo: 0x80, hi: 0x80}, - {value: 0x8133, lo: 0x81, hi: 0x81}, - {value: 0x812e, lo: 0x82, hi: 0x83}, - {value: 0x812e, lo: 0x84, hi: 0x85}, - {value: 0x812e, lo: 0x86, hi: 0x87}, - {value: 0x812e, lo: 0x88, hi: 0x89}, - {value: 0x8133, lo: 0x8a, hi: 0x8a}, - // Block 0xb, offset 0x6b - {value: 0x0000, lo: 0x04}, - {value: 0x8133, lo: 0xab, hi: 0xb1}, - {value: 0x812e, lo: 0xb2, hi: 0xb2}, - {value: 0x8133, lo: 0xb3, hi: 0xb3}, - {value: 0x812e, lo: 0xbd, hi: 0xbd}, - // Block 0xc, offset 0x70 - {value: 0x0000, lo: 0x04}, - {value: 0x8133, lo: 0x96, hi: 0x99}, - {value: 0x8133, lo: 0x9b, hi: 0xa3}, - {value: 0x8133, lo: 0xa5, hi: 0xa7}, - {value: 0x8133, lo: 0xa9, hi: 0xad}, - // Block 0xd, offset 0x75 - {value: 0x0000, lo: 0x01}, - {value: 0x812e, lo: 0x99, hi: 0x9b}, - // Block 0xe, offset 0x77 - {value: 0x0000, lo: 0x07}, - {value: 0xa000, lo: 0xa8, hi: 0xa8}, - {value: 0x3eef, lo: 0xa9, hi: 0xa9}, - {value: 0xa000, lo: 0xb0, hi: 0xb0}, - {value: 0x3ef7, lo: 0xb1, hi: 0xb1}, - {value: 0xa000, lo: 0xb3, hi: 0xb3}, - {value: 0x3eff, lo: 0xb4, hi: 0xb4}, - {value: 0x9903, lo: 0xbc, hi: 0xbc}, - // Block 0xf, offset 0x7f - {value: 0x0008, lo: 0x06}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x8133, lo: 0x91, hi: 0x91}, - {value: 0x812e, lo: 0x92, hi: 0x92}, - {value: 0x8133, lo: 0x93, hi: 0x93}, - {value: 0x8133, lo: 0x94, hi: 0x94}, - {value: 0x4533, lo: 0x98, hi: 0x9f}, - // Block 0x10, offset 0x86 - {value: 0x0000, lo: 0x02}, - {value: 0x8103, lo: 0xbc, hi: 0xbc}, - {value: 0x9900, lo: 0xbe, hi: 0xbe}, - // Block 0x11, offset 0x89 - {value: 0x0008, lo: 0x07}, - {value: 0xa000, lo: 0x87, hi: 0x87}, - {value: 0x2cab, lo: 0x8b, hi: 0x8c}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x9900, lo: 0x97, hi: 0x97}, - {value: 0x4573, lo: 0x9c, hi: 0x9d}, - {value: 0x4583, lo: 0x9f, hi: 0x9f}, - {value: 0x8133, lo: 0xbe, hi: 0xbe}, - // Block 0x12, offset 0x91 - {value: 0x0000, lo: 0x03}, - {value: 0x45ab, lo: 0xb3, hi: 0xb3}, - {value: 0x45b3, lo: 0xb6, hi: 0xb6}, - {value: 0x8103, lo: 0xbc, hi: 0xbc}, - // Block 0x13, offset 0x95 - {value: 0x0008, lo: 0x03}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x458b, lo: 0x99, hi: 0x9b}, - {value: 0x45a3, lo: 0x9e, hi: 0x9e}, - // Block 0x14, offset 0x99 - {value: 0x0000, lo: 0x01}, - {value: 0x8103, lo: 0xbc, hi: 0xbc}, - // Block 0x15, offset 0x9b - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - // Block 0x16, offset 0x9d - {value: 0x0000, lo: 0x08}, - {value: 0xa000, lo: 0x87, hi: 0x87}, - {value: 0x2cc3, lo: 0x88, hi: 0x88}, - {value: 0x2cbb, lo: 0x8b, hi: 0x8b}, - {value: 0x2ccb, lo: 0x8c, hi: 0x8c}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x9900, lo: 0x96, hi: 0x97}, - {value: 0x45bb, lo: 0x9c, hi: 0x9c}, - {value: 0x45c3, lo: 0x9d, hi: 0x9d}, - // Block 0x17, offset 0xa6 - {value: 0x0000, lo: 0x03}, - {value: 0xa000, lo: 0x92, hi: 0x92}, - {value: 0x2cd3, lo: 0x94, hi: 0x94}, - {value: 0x9900, lo: 0xbe, hi: 0xbe}, - // Block 0x18, offset 0xaa - {value: 0x0000, lo: 0x06}, - {value: 0xa000, lo: 0x86, hi: 0x87}, - {value: 0x2cdb, lo: 0x8a, hi: 0x8a}, - {value: 0x2ceb, lo: 0x8b, hi: 0x8b}, - {value: 0x2ce3, lo: 0x8c, hi: 0x8c}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x9900, lo: 0x97, hi: 0x97}, - // Block 0x19, offset 0xb1 - {value: 0x1801, lo: 0x04}, - {value: 0xa000, lo: 0x86, hi: 0x86}, - {value: 0x3f07, lo: 0x88, hi: 0x88}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x8121, lo: 0x95, hi: 0x96}, - // Block 0x1a, offset 0xb6 - {value: 0x0000, lo: 0x02}, - {value: 0x8103, lo: 0xbc, hi: 0xbc}, - {value: 0xa000, lo: 0xbf, hi: 0xbf}, - // Block 0x1b, offset 0xb9 - {value: 0x0000, lo: 0x09}, - {value: 0x2cf3, lo: 0x80, hi: 0x80}, - {value: 0x9900, lo: 0x82, hi: 0x82}, - {value: 0xa000, lo: 0x86, hi: 0x86}, - {value: 0x2cfb, lo: 0x87, hi: 0x87}, - {value: 0x2d03, lo: 0x88, hi: 0x88}, - {value: 0x2f67, lo: 0x8a, hi: 0x8a}, - {value: 0x2def, lo: 0x8b, hi: 0x8b}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x9900, lo: 0x95, hi: 0x96}, - // Block 0x1c, offset 0xc3 - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0xbb, hi: 0xbc}, - {value: 0x9900, lo: 0xbe, hi: 0xbe}, - // Block 0x1d, offset 0xc6 - {value: 0x0000, lo: 0x06}, - {value: 0xa000, lo: 0x86, hi: 0x87}, - {value: 0x2d0b, lo: 0x8a, hi: 0x8a}, - {value: 0x2d1b, lo: 0x8b, hi: 0x8b}, - {value: 0x2d13, lo: 0x8c, hi: 0x8c}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x9900, lo: 0x97, hi: 0x97}, - // Block 0x1e, offset 0xcd - {value: 0x6bdd, lo: 0x07}, - {value: 0x9905, lo: 0x8a, hi: 0x8a}, - {value: 0x9900, lo: 0x8f, hi: 0x8f}, - {value: 0xa000, lo: 0x99, hi: 0x99}, - {value: 0x3f0f, lo: 0x9a, hi: 0x9a}, - {value: 0x2f6f, lo: 0x9c, hi: 0x9c}, - {value: 0x2dfa, lo: 0x9d, hi: 0x9d}, - {value: 0x2d23, lo: 0x9e, hi: 0x9f}, - // Block 0x1f, offset 0xd5 - {value: 0x0000, lo: 0x03}, - {value: 0x2627, lo: 0xb3, hi: 0xb3}, - {value: 0x8123, lo: 0xb8, hi: 0xb9}, - {value: 0x8105, lo: 0xba, hi: 0xba}, - // Block 0x20, offset 0xd9 - {value: 0x0000, lo: 0x01}, - {value: 0x8124, lo: 0x88, hi: 0x8b}, - // Block 0x21, offset 0xdb - {value: 0x0000, lo: 0x03}, - {value: 0x263c, lo: 0xb3, hi: 0xb3}, - {value: 0x8125, lo: 0xb8, hi: 0xb9}, - {value: 0x8105, lo: 0xba, hi: 0xba}, - // Block 0x22, offset 0xdf - {value: 0x0000, lo: 0x03}, - {value: 0x8126, lo: 0x88, hi: 0x8b}, - {value: 0x262e, lo: 0x9c, hi: 0x9c}, - {value: 0x2635, lo: 0x9d, hi: 0x9d}, - // Block 0x23, offset 0xe3 - {value: 0x0000, lo: 0x05}, - {value: 0x030e, lo: 0x8c, hi: 0x8c}, - {value: 0x812e, lo: 0x98, hi: 0x99}, - {value: 0x812e, lo: 0xb5, hi: 0xb5}, - {value: 0x812e, lo: 0xb7, hi: 0xb7}, - {value: 0x812c, lo: 0xb9, hi: 0xb9}, - // Block 0x24, offset 0xe9 - {value: 0x0000, lo: 0x10}, - {value: 0x264a, lo: 0x83, hi: 0x83}, - {value: 0x2651, lo: 0x8d, hi: 0x8d}, - {value: 0x2658, lo: 0x92, hi: 0x92}, - {value: 0x265f, lo: 0x97, hi: 0x97}, - {value: 0x2666, lo: 0x9c, hi: 0x9c}, - {value: 0x2643, lo: 0xa9, hi: 0xa9}, - {value: 0x8127, lo: 0xb1, hi: 0xb1}, - {value: 0x8128, lo: 0xb2, hi: 0xb2}, - {value: 0x4a9b, lo: 0xb3, hi: 0xb3}, - {value: 0x8129, lo: 0xb4, hi: 0xb4}, - {value: 0x4aa4, lo: 0xb5, hi: 0xb5}, - {value: 0x45cb, lo: 0xb6, hi: 0xb6}, - {value: 0x460b, lo: 0xb7, hi: 0xb7}, - {value: 0x45d3, lo: 0xb8, hi: 0xb8}, - {value: 0x4616, lo: 0xb9, hi: 0xb9}, - {value: 0x8128, lo: 0xba, hi: 0xbd}, - // Block 0x25, offset 0xfa - {value: 0x0000, lo: 0x0b}, - {value: 0x8128, lo: 0x80, hi: 0x80}, - {value: 0x4aad, lo: 0x81, hi: 0x81}, - {value: 0x8133, lo: 0x82, hi: 0x83}, - {value: 0x8105, lo: 0x84, hi: 0x84}, - {value: 0x8133, lo: 0x86, hi: 0x87}, - {value: 0x2674, lo: 0x93, hi: 0x93}, - {value: 0x267b, lo: 0x9d, hi: 0x9d}, - {value: 0x2682, lo: 0xa2, hi: 0xa2}, - {value: 0x2689, lo: 0xa7, hi: 0xa7}, - {value: 0x2690, lo: 0xac, hi: 0xac}, - {value: 0x266d, lo: 0xb9, hi: 0xb9}, - // Block 0x26, offset 0x106 - {value: 0x0000, lo: 0x01}, - {value: 0x812e, lo: 0x86, hi: 0x86}, - // Block 0x27, offset 0x108 - {value: 0x0000, lo: 0x05}, - {value: 0xa000, lo: 0xa5, hi: 0xa5}, - {value: 0x2d2b, lo: 0xa6, hi: 0xa6}, - {value: 0x9900, lo: 0xae, hi: 0xae}, - {value: 0x8103, lo: 0xb7, hi: 0xb7}, - {value: 0x8105, lo: 0xb9, hi: 0xba}, - // Block 0x28, offset 0x10e - {value: 0x0000, lo: 0x01}, - {value: 0x812e, lo: 0x8d, hi: 0x8d}, - // Block 0x29, offset 0x110 - {value: 0x0000, lo: 0x01}, - {value: 0x0312, lo: 0xbc, hi: 0xbc}, - // Block 0x2a, offset 0x112 - {value: 0x0000, lo: 0x01}, - {value: 0xa000, lo: 0x80, hi: 0x92}, - // Block 0x2b, offset 0x114 - {value: 0x0000, lo: 0x01}, - {value: 0xb900, lo: 0xa1, hi: 0xb5}, - // Block 0x2c, offset 0x116 - {value: 0x0000, lo: 0x01}, - {value: 0x9900, lo: 0xa8, hi: 0xbf}, - // Block 0x2d, offset 0x118 - {value: 0x0000, lo: 0x01}, - {value: 0x9900, lo: 0x80, hi: 0x82}, - // Block 0x2e, offset 0x11a - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0x9d, hi: 0x9f}, - // Block 0x2f, offset 0x11c - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0x94, hi: 0x94}, - {value: 0x8105, lo: 0xb4, hi: 0xb4}, - // Block 0x30, offset 0x11f - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0x92, hi: 0x92}, - {value: 0x8133, lo: 0x9d, hi: 0x9d}, - // Block 0x31, offset 0x122 - {value: 0x0000, lo: 0x01}, - {value: 0x8132, lo: 0xa9, hi: 0xa9}, - // Block 0x32, offset 0x124 - {value: 0x0004, lo: 0x02}, - {value: 0x812f, lo: 0xb9, hi: 0xba}, - {value: 0x812e, lo: 0xbb, hi: 0xbb}, - // Block 0x33, offset 0x127 - {value: 0x0000, lo: 0x02}, - {value: 0x8133, lo: 0x97, hi: 0x97}, - {value: 0x812e, lo: 0x98, hi: 0x98}, - // Block 0x34, offset 0x12a - {value: 0x0000, lo: 0x03}, - {value: 0x8105, lo: 0xa0, hi: 0xa0}, - {value: 0x8133, lo: 0xb5, hi: 0xbc}, - {value: 0x812e, lo: 0xbf, hi: 0xbf}, - // Block 0x35, offset 0x12e - {value: 0x0000, lo: 0x05}, - {value: 0x8133, lo: 0xb0, hi: 0xb4}, - {value: 0x812e, lo: 0xb5, hi: 0xba}, - {value: 0x8133, lo: 0xbb, hi: 0xbc}, - {value: 0x812e, lo: 0xbd, hi: 0xbd}, - {value: 0x812e, lo: 0xbf, hi: 0xbf}, - // Block 0x36, offset 0x134 - {value: 0x0000, lo: 0x01}, - {value: 0x812e, lo: 0x80, hi: 0x80}, - // Block 0x37, offset 0x136 - {value: 0x0000, lo: 0x08}, - {value: 0x2d73, lo: 0x80, hi: 0x80}, - {value: 0x2d7b, lo: 0x81, hi: 0x81}, - {value: 0xa000, lo: 0x82, hi: 0x82}, - {value: 0x2d83, lo: 0x83, hi: 0x83}, - {value: 0x8105, lo: 0x84, hi: 0x84}, - {value: 0x8133, lo: 0xab, hi: 0xab}, - {value: 0x812e, lo: 0xac, hi: 0xac}, - {value: 0x8133, lo: 0xad, hi: 0xb3}, - // Block 0x38, offset 0x13f - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0xaa, hi: 0xab}, - // Block 0x39, offset 0x141 - {value: 0x0000, lo: 0x02}, - {value: 0x8103, lo: 0xa6, hi: 0xa6}, - {value: 0x8105, lo: 0xb2, hi: 0xb3}, - // Block 0x3a, offset 0x144 - {value: 0x0000, lo: 0x01}, - {value: 0x8103, lo: 0xb7, hi: 0xb7}, - // Block 0x3b, offset 0x146 - {value: 0x0000, lo: 0x0a}, - {value: 0x8133, lo: 0x90, hi: 0x92}, - {value: 0x8101, lo: 0x94, hi: 0x94}, - {value: 0x812e, lo: 0x95, hi: 0x99}, - {value: 0x8133, lo: 0x9a, hi: 0x9b}, - {value: 0x812e, lo: 0x9c, hi: 0x9f}, - {value: 0x8133, lo: 0xa0, hi: 0xa0}, - {value: 0x8101, lo: 0xa2, hi: 0xa8}, - {value: 0x812e, lo: 0xad, hi: 0xad}, - {value: 0x8133, lo: 0xb4, hi: 0xb4}, - {value: 0x8133, lo: 0xb8, hi: 0xb9}, - // Block 0x3c, offset 0x151 - {value: 0x0002, lo: 0x0a}, - {value: 0x0043, lo: 0xac, hi: 0xac}, - {value: 0x00d1, lo: 0xad, hi: 0xad}, - {value: 0x0045, lo: 0xae, hi: 0xae}, - {value: 0x0049, lo: 0xb0, hi: 0xb1}, - {value: 0x00e6, lo: 0xb2, hi: 0xb2}, - {value: 0x004f, lo: 0xb3, hi: 0xba}, - {value: 0x005f, lo: 0xbc, hi: 0xbc}, - {value: 0x00ef, lo: 0xbd, hi: 0xbd}, - {value: 0x0061, lo: 0xbe, hi: 0xbe}, - {value: 0x0065, lo: 0xbf, hi: 0xbf}, - // Block 0x3d, offset 0x15c - {value: 0x0000, lo: 0x0d}, - {value: 0x0001, lo: 0x80, hi: 0x8a}, - {value: 0x043e, lo: 0x91, hi: 0x91}, - {value: 0x42b2, lo: 0x97, hi: 0x97}, - {value: 0x001d, lo: 0xa4, hi: 0xa4}, - {value: 0x1876, lo: 0xa5, hi: 0xa5}, - {value: 0x1b62, lo: 0xa6, hi: 0xa6}, - {value: 0x0001, lo: 0xaf, hi: 0xaf}, - {value: 0x2697, lo: 0xb3, hi: 0xb3}, - {value: 0x280b, lo: 0xb4, hi: 0xb4}, - {value: 0x269e, lo: 0xb6, hi: 0xb6}, - {value: 0x2815, lo: 0xb7, hi: 0xb7}, - {value: 0x1870, lo: 0xbc, hi: 0xbc}, - {value: 0x4280, lo: 0xbe, hi: 0xbe}, - // Block 0x3e, offset 0x16a - {value: 0x0002, lo: 0x0d}, - {value: 0x1936, lo: 0x87, hi: 0x87}, - {value: 0x1933, lo: 0x88, hi: 0x88}, - {value: 0x1873, lo: 0x89, hi: 0x89}, - {value: 0x299b, lo: 0x97, hi: 0x97}, - {value: 0x0001, lo: 0x9f, hi: 0x9f}, - {value: 0x0021, lo: 0xb0, hi: 0xb0}, - {value: 0x0093, lo: 0xb1, hi: 0xb1}, - {value: 0x0029, lo: 0xb4, hi: 0xb9}, - {value: 0x0017, lo: 0xba, hi: 0xba}, - {value: 0x046a, lo: 0xbb, hi: 0xbb}, - {value: 0x003b, lo: 0xbc, hi: 0xbc}, - {value: 0x0011, lo: 0xbd, hi: 0xbe}, - {value: 0x009d, lo: 0xbf, hi: 0xbf}, - // Block 0x3f, offset 0x178 - {value: 0x0002, lo: 0x0f}, - {value: 0x0021, lo: 0x80, hi: 0x89}, - {value: 0x0017, lo: 0x8a, hi: 0x8a}, - {value: 0x046a, lo: 0x8b, hi: 0x8b}, - {value: 0x003b, lo: 0x8c, hi: 0x8c}, - {value: 0x0011, lo: 0x8d, hi: 0x8e}, - {value: 0x0083, lo: 0x90, hi: 0x90}, - {value: 0x008b, lo: 0x91, hi: 0x91}, - {value: 0x009f, lo: 0x92, hi: 0x92}, - {value: 0x00b1, lo: 0x93, hi: 0x93}, - {value: 0x0104, lo: 0x94, hi: 0x94}, - {value: 0x0091, lo: 0x95, hi: 0x95}, - {value: 0x0097, lo: 0x96, hi: 0x99}, - {value: 0x00a1, lo: 0x9a, hi: 0x9a}, - {value: 0x00a7, lo: 0x9b, hi: 0x9c}, - {value: 0x199f, lo: 0xa8, hi: 0xa8}, - // Block 0x40, offset 0x188 - {value: 0x0000, lo: 0x0d}, - {value: 0x8133, lo: 0x90, hi: 0x91}, - {value: 0x8101, lo: 0x92, hi: 0x93}, - {value: 0x8133, lo: 0x94, hi: 0x97}, - {value: 0x8101, lo: 0x98, hi: 0x9a}, - {value: 0x8133, lo: 0x9b, hi: 0x9c}, - {value: 0x8133, lo: 0xa1, hi: 0xa1}, - {value: 0x8101, lo: 0xa5, hi: 0xa6}, - {value: 0x8133, lo: 0xa7, hi: 0xa7}, - {value: 0x812e, lo: 0xa8, hi: 0xa8}, - {value: 0x8133, lo: 0xa9, hi: 0xa9}, - {value: 0x8101, lo: 0xaa, hi: 0xab}, - {value: 0x812e, lo: 0xac, hi: 0xaf}, - {value: 0x8133, lo: 0xb0, hi: 0xb0}, - // Block 0x41, offset 0x196 - {value: 0x0007, lo: 0x06}, - {value: 0x2186, lo: 0x89, hi: 0x89}, - {value: 0xa000, lo: 0x90, hi: 0x90}, - {value: 0xa000, lo: 0x92, hi: 0x92}, - {value: 0xa000, lo: 0x94, hi: 0x94}, - {value: 0x3bd0, lo: 0x9a, hi: 0x9b}, - {value: 0x3bde, lo: 0xae, hi: 0xae}, - // Block 0x42, offset 0x19d - {value: 0x000e, lo: 0x05}, - {value: 0x3be5, lo: 0x8d, hi: 0x8e}, - {value: 0x3bec, lo: 0x8f, hi: 0x8f}, - {value: 0xa000, lo: 0x90, hi: 0x90}, - {value: 0xa000, lo: 0x92, hi: 0x92}, - {value: 0xa000, lo: 0x94, hi: 0x94}, - // Block 0x43, offset 0x1a3 - {value: 0x017a, lo: 0x0e}, - {value: 0xa000, lo: 0x83, hi: 0x83}, - {value: 0x3bfa, lo: 0x84, hi: 0x84}, - {value: 0xa000, lo: 0x88, hi: 0x88}, - {value: 0x3c01, lo: 0x89, hi: 0x89}, - {value: 0xa000, lo: 0x8b, hi: 0x8b}, - {value: 0x3c08, lo: 0x8c, hi: 0x8c}, - {value: 0xa000, lo: 0xa3, hi: 0xa3}, - {value: 0x3c0f, lo: 0xa4, hi: 0xa4}, - {value: 0xa000, lo: 0xa5, hi: 0xa5}, - {value: 0x3c16, lo: 0xa6, hi: 0xa6}, - {value: 0x26a5, lo: 0xac, hi: 0xad}, - {value: 0x26ac, lo: 0xaf, hi: 0xaf}, - {value: 0x2829, lo: 0xb0, hi: 0xb0}, - {value: 0xa000, lo: 0xbc, hi: 0xbc}, - // Block 0x44, offset 0x1b2 - {value: 0x0007, lo: 0x03}, - {value: 0x3c7f, lo: 0xa0, hi: 0xa1}, - {value: 0x3ca9, lo: 0xa2, hi: 0xa3}, - {value: 0x3cd3, lo: 0xaa, hi: 0xad}, - // Block 0x45, offset 0x1b6 - {value: 0x0004, lo: 0x01}, - {value: 0x048e, lo: 0xa9, hi: 0xaa}, - // Block 0x46, offset 0x1b8 - {value: 0x0002, lo: 0x03}, - {value: 0x0057, lo: 0x80, hi: 0x8f}, - {value: 0x0083, lo: 0x90, hi: 0xa9}, - {value: 0x0021, lo: 0xaa, hi: 0xaa}, - // Block 0x47, offset 0x1bc - {value: 0x0000, lo: 0x01}, - {value: 0x29a8, lo: 0x8c, hi: 0x8c}, - // Block 0x48, offset 0x1be - {value: 0x0266, lo: 0x02}, - {value: 0x1b92, lo: 0xb4, hi: 0xb4}, - {value: 0x1930, lo: 0xb5, hi: 0xb6}, - // Block 0x49, offset 0x1c1 - {value: 0x0000, lo: 0x01}, - {value: 0x44f4, lo: 0x9c, hi: 0x9c}, - // Block 0x4a, offset 0x1c3 - {value: 0x0000, lo: 0x02}, - {value: 0x0095, lo: 0xbc, hi: 0xbc}, - {value: 0x006d, lo: 0xbd, hi: 0xbd}, - // Block 0x4b, offset 0x1c6 - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0xaf, hi: 0xb1}, - // Block 0x4c, offset 0x1c8 - {value: 0x0000, lo: 0x02}, - {value: 0x0482, lo: 0xaf, hi: 0xaf}, - {value: 0x8105, lo: 0xbf, hi: 0xbf}, - // Block 0x4d, offset 0x1cb - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0xa0, hi: 0xbf}, - // Block 0x4e, offset 0x1cd - {value: 0x0000, lo: 0x01}, - {value: 0x0dc6, lo: 0x9f, hi: 0x9f}, - // Block 0x4f, offset 0x1cf - {value: 0x0000, lo: 0x01}, - {value: 0x1632, lo: 0xb3, hi: 0xb3}, - // Block 0x50, offset 0x1d1 - {value: 0x0004, lo: 0x0b}, - {value: 0x159a, lo: 0x80, hi: 0x82}, - {value: 0x15b2, lo: 0x83, hi: 0x83}, - {value: 0x15ca, lo: 0x84, hi: 0x85}, - {value: 0x15da, lo: 0x86, hi: 0x89}, - {value: 0x15ee, lo: 0x8a, hi: 0x8c}, - {value: 0x1602, lo: 0x8d, hi: 0x8d}, - {value: 0x160a, lo: 0x8e, hi: 0x8e}, - {value: 0x1612, lo: 0x8f, hi: 0x90}, - {value: 0x161e, lo: 0x91, hi: 0x93}, - {value: 0x162e, lo: 0x94, hi: 0x94}, - {value: 0x1636, lo: 0x95, hi: 0x95}, - // Block 0x51, offset 0x1dd - {value: 0x0004, lo: 0x09}, - {value: 0x0001, lo: 0x80, hi: 0x80}, - {value: 0x812d, lo: 0xaa, hi: 0xaa}, - {value: 0x8132, lo: 0xab, hi: 0xab}, - {value: 0x8134, lo: 0xac, hi: 0xac}, - {value: 0x812f, lo: 0xad, hi: 0xad}, - {value: 0x8130, lo: 0xae, hi: 0xae}, - {value: 0x8130, lo: 0xaf, hi: 0xaf}, - {value: 0x04b6, lo: 0xb6, hi: 0xb6}, - {value: 0x088a, lo: 0xb8, hi: 0xba}, - // Block 0x52, offset 0x1e7 - {value: 0x0006, lo: 0x09}, - {value: 0x0316, lo: 0xb1, hi: 0xb1}, - {value: 0x031a, lo: 0xb2, hi: 0xb2}, - {value: 0x4a52, lo: 0xb3, hi: 0xb3}, - {value: 0x031e, lo: 0xb4, hi: 0xb4}, - {value: 0x4a58, lo: 0xb5, hi: 0xb6}, - {value: 0x0322, lo: 0xb7, hi: 0xb7}, - {value: 0x0326, lo: 0xb8, hi: 0xb8}, - {value: 0x032a, lo: 0xb9, hi: 0xb9}, - {value: 0x4a64, lo: 0xba, hi: 0xbf}, - // Block 0x53, offset 0x1f1 - {value: 0x0000, lo: 0x02}, - {value: 0x8133, lo: 0xaf, hi: 0xaf}, - {value: 0x8133, lo: 0xb4, hi: 0xbd}, - // Block 0x54, offset 0x1f4 - {value: 0x0000, lo: 0x03}, - {value: 0x0212, lo: 0x9c, hi: 0x9c}, - {value: 0x0215, lo: 0x9d, hi: 0x9d}, - {value: 0x8133, lo: 0x9e, hi: 0x9f}, - // Block 0x55, offset 0x1f8 - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0xb0, hi: 0xb1}, - // Block 0x56, offset 0x1fa - {value: 0x0000, lo: 0x01}, - {value: 0x163e, lo: 0xb0, hi: 0xb0}, - // Block 0x57, offset 0x1fc - {value: 0x000c, lo: 0x01}, - {value: 0x00d7, lo: 0xb8, hi: 0xb9}, - // Block 0x58, offset 0x1fe - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0x86, hi: 0x86}, - {value: 0x8105, lo: 0xac, hi: 0xac}, - // Block 0x59, offset 0x201 - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0x84, hi: 0x84}, - {value: 0x8133, lo: 0xa0, hi: 0xb1}, - // Block 0x5a, offset 0x204 - {value: 0x0000, lo: 0x01}, - {value: 0x812e, lo: 0xab, hi: 0xad}, - // Block 0x5b, offset 0x206 - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0x93, hi: 0x93}, - // Block 0x5c, offset 0x208 - {value: 0x0000, lo: 0x01}, - {value: 0x8103, lo: 0xb3, hi: 0xb3}, - // Block 0x5d, offset 0x20a - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0x80, hi: 0x80}, - // Block 0x5e, offset 0x20c - {value: 0x0000, lo: 0x05}, - {value: 0x8133, lo: 0xb0, hi: 0xb0}, - {value: 0x8133, lo: 0xb2, hi: 0xb3}, - {value: 0x812e, lo: 0xb4, hi: 0xb4}, - {value: 0x8133, lo: 0xb7, hi: 0xb8}, - {value: 0x8133, lo: 0xbe, hi: 0xbf}, - // Block 0x5f, offset 0x212 - {value: 0x0000, lo: 0x02}, - {value: 0x8133, lo: 0x81, hi: 0x81}, - {value: 0x8105, lo: 0xb6, hi: 0xb6}, - // Block 0x60, offset 0x215 - {value: 0x0008, lo: 0x04}, - {value: 0x163a, lo: 0x9c, hi: 0x9d}, - {value: 0x0125, lo: 0x9e, hi: 0x9e}, - {value: 0x1646, lo: 0x9f, hi: 0x9f}, - {value: 0x015e, lo: 0xa9, hi: 0xa9}, - // Block 0x61, offset 0x21a - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0xad, hi: 0xad}, - // Block 0x62, offset 0x21c - {value: 0x0000, lo: 0x06}, - {value: 0xe500, lo: 0x80, hi: 0x80}, - {value: 0xc600, lo: 0x81, hi: 0x9b}, - {value: 0xe500, lo: 0x9c, hi: 0x9c}, - {value: 0xc600, lo: 0x9d, hi: 0xb7}, - {value: 0xe500, lo: 0xb8, hi: 0xb8}, - {value: 0xc600, lo: 0xb9, hi: 0xbf}, - // Block 0x63, offset 0x223 - {value: 0x0000, lo: 0x05}, - {value: 0xc600, lo: 0x80, hi: 0x93}, - {value: 0xe500, lo: 0x94, hi: 0x94}, - {value: 0xc600, lo: 0x95, hi: 0xaf}, - {value: 0xe500, lo: 0xb0, hi: 0xb0}, - {value: 0xc600, lo: 0xb1, hi: 0xbf}, - // Block 0x64, offset 0x229 - {value: 0x0000, lo: 0x05}, - {value: 0xc600, lo: 0x80, hi: 0x8b}, - {value: 0xe500, lo: 0x8c, hi: 0x8c}, - {value: 0xc600, lo: 0x8d, hi: 0xa7}, - {value: 0xe500, lo: 0xa8, hi: 0xa8}, - {value: 0xc600, lo: 0xa9, hi: 0xbf}, - // Block 0x65, offset 0x22f - {value: 0x0000, lo: 0x07}, - {value: 0xc600, lo: 0x80, hi: 0x83}, - {value: 0xe500, lo: 0x84, hi: 0x84}, - {value: 0xc600, lo: 0x85, hi: 0x9f}, - {value: 0xe500, lo: 0xa0, hi: 0xa0}, - {value: 0xc600, lo: 0xa1, hi: 0xbb}, - {value: 0xe500, lo: 0xbc, hi: 0xbc}, - {value: 0xc600, lo: 0xbd, hi: 0xbf}, - // Block 0x66, offset 0x237 - {value: 0x0000, lo: 0x05}, - {value: 0xc600, lo: 0x80, hi: 0x97}, - {value: 0xe500, lo: 0x98, hi: 0x98}, - {value: 0xc600, lo: 0x99, hi: 0xb3}, - {value: 0xe500, lo: 0xb4, hi: 0xb4}, - {value: 0xc600, lo: 0xb5, hi: 0xbf}, - // Block 0x67, offset 0x23d - {value: 0x0000, lo: 0x05}, - {value: 0xc600, lo: 0x80, hi: 0x8f}, - {value: 0xe500, lo: 0x90, hi: 0x90}, - {value: 0xc600, lo: 0x91, hi: 0xab}, - {value: 0xe500, lo: 0xac, hi: 0xac}, - {value: 0xc600, lo: 0xad, hi: 0xbf}, - // Block 0x68, offset 0x243 - {value: 0x0000, lo: 0x05}, - {value: 0xc600, lo: 0x80, hi: 0x87}, - {value: 0xe500, lo: 0x88, hi: 0x88}, - {value: 0xc600, lo: 0x89, hi: 0xa3}, - {value: 0xe500, lo: 0xa4, hi: 0xa4}, - {value: 0xc600, lo: 0xa5, hi: 0xbf}, - // Block 0x69, offset 0x249 - {value: 0x0000, lo: 0x03}, - {value: 0xc600, lo: 0x80, hi: 0x87}, - {value: 0xe500, lo: 0x88, hi: 0x88}, - {value: 0xc600, lo: 0x89, hi: 0xa3}, - // Block 0x6a, offset 0x24d - {value: 0x0002, lo: 0x01}, - {value: 0x0003, lo: 0x81, hi: 0xbf}, - // Block 0x6b, offset 0x24f - {value: 0x0000, lo: 0x01}, - {value: 0x812e, lo: 0xbd, hi: 0xbd}, - // Block 0x6c, offset 0x251 - {value: 0x0000, lo: 0x01}, - {value: 0x812e, lo: 0xa0, hi: 0xa0}, - // Block 0x6d, offset 0x253 - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0xb6, hi: 0xba}, - // Block 0x6e, offset 0x255 - {value: 0x002d, lo: 0x05}, - {value: 0x812e, lo: 0x8d, hi: 0x8d}, - {value: 0x8133, lo: 0x8f, hi: 0x8f}, - {value: 0x8133, lo: 0xb8, hi: 0xb8}, - {value: 0x8101, lo: 0xb9, hi: 0xba}, - {value: 0x8105, lo: 0xbf, hi: 0xbf}, - // Block 0x6f, offset 0x25b - {value: 0x0000, lo: 0x02}, - {value: 0x8133, lo: 0xa5, hi: 0xa5}, - {value: 0x812e, lo: 0xa6, hi: 0xa6}, - // Block 0x70, offset 0x25e - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0xa4, hi: 0xa7}, - // Block 0x71, offset 0x260 - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0xab, hi: 0xac}, - // Block 0x72, offset 0x262 - {value: 0x0000, lo: 0x05}, - {value: 0x812e, lo: 0x86, hi: 0x87}, - {value: 0x8133, lo: 0x88, hi: 0x8a}, - {value: 0x812e, lo: 0x8b, hi: 0x8b}, - {value: 0x8133, lo: 0x8c, hi: 0x8c}, - {value: 0x812e, lo: 0x8d, hi: 0x90}, - // Block 0x73, offset 0x268 - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0x86, hi: 0x86}, - {value: 0x8105, lo: 0xbf, hi: 0xbf}, - // Block 0x74, offset 0x26b - {value: 0x17fe, lo: 0x07}, - {value: 0xa000, lo: 0x99, hi: 0x99}, - {value: 0x424f, lo: 0x9a, hi: 0x9a}, - {value: 0xa000, lo: 0x9b, hi: 0x9b}, - {value: 0x4259, lo: 0x9c, hi: 0x9c}, - {value: 0xa000, lo: 0xa5, hi: 0xa5}, - {value: 0x4263, lo: 0xab, hi: 0xab}, - {value: 0x8105, lo: 0xb9, hi: 0xba}, - // Block 0x75, offset 0x273 - {value: 0x0000, lo: 0x06}, - {value: 0x8133, lo: 0x80, hi: 0x82}, - {value: 0x9900, lo: 0xa7, hi: 0xa7}, - {value: 0x2d8b, lo: 0xae, hi: 0xae}, - {value: 0x2d95, lo: 0xaf, hi: 0xaf}, - {value: 0xa000, lo: 0xb1, hi: 0xb2}, - {value: 0x8105, lo: 0xb3, hi: 0xb4}, - // Block 0x76, offset 0x27a - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0x80, hi: 0x80}, - {value: 0x8103, lo: 0x8a, hi: 0x8a}, - // Block 0x77, offset 0x27d - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0xb5, hi: 0xb5}, - {value: 0x8103, lo: 0xb6, hi: 0xb6}, - // Block 0x78, offset 0x280 - {value: 0x0002, lo: 0x01}, - {value: 0x8103, lo: 0xa9, hi: 0xaa}, - // Block 0x79, offset 0x282 - {value: 0x0000, lo: 0x02}, - {value: 0x8103, lo: 0xbb, hi: 0xbc}, - {value: 0x9900, lo: 0xbe, hi: 0xbe}, - // Block 0x7a, offset 0x285 - {value: 0x0000, lo: 0x07}, - {value: 0xa000, lo: 0x87, hi: 0x87}, - {value: 0x2d9f, lo: 0x8b, hi: 0x8b}, - {value: 0x2da9, lo: 0x8c, hi: 0x8c}, - {value: 0x8105, lo: 0x8d, hi: 0x8d}, - {value: 0x9900, lo: 0x97, hi: 0x97}, - {value: 0x8133, lo: 0xa6, hi: 0xac}, - {value: 0x8133, lo: 0xb0, hi: 0xb4}, - // Block 0x7b, offset 0x28d - {value: 0x0000, lo: 0x03}, - {value: 0x8105, lo: 0x82, hi: 0x82}, - {value: 0x8103, lo: 0x86, hi: 0x86}, - {value: 0x8133, lo: 0x9e, hi: 0x9e}, - // Block 0x7c, offset 0x291 - {value: 0x6b4d, lo: 0x06}, - {value: 0x9900, lo: 0xb0, hi: 0xb0}, - {value: 0xa000, lo: 0xb9, hi: 0xb9}, - {value: 0x9900, lo: 0xba, hi: 0xba}, - {value: 0x2dbd, lo: 0xbb, hi: 0xbb}, - {value: 0x2db3, lo: 0xbc, hi: 0xbd}, - {value: 0x2dc7, lo: 0xbe, hi: 0xbe}, - // Block 0x7d, offset 0x298 - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0x82, hi: 0x82}, - {value: 0x8103, lo: 0x83, hi: 0x83}, - // Block 0x7e, offset 0x29b - {value: 0x0000, lo: 0x05}, - {value: 0x9900, lo: 0xaf, hi: 0xaf}, - {value: 0xa000, lo: 0xb8, hi: 0xb9}, - {value: 0x2dd1, lo: 0xba, hi: 0xba}, - {value: 0x2ddb, lo: 0xbb, hi: 0xbb}, - {value: 0x8105, lo: 0xbf, hi: 0xbf}, - // Block 0x7f, offset 0x2a1 - {value: 0x0000, lo: 0x01}, - {value: 0x8103, lo: 0x80, hi: 0x80}, - // Block 0x80, offset 0x2a3 - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0xbf, hi: 0xbf}, - // Block 0x81, offset 0x2a5 - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0xb6, hi: 0xb6}, - {value: 0x8103, lo: 0xb7, hi: 0xb7}, - // Block 0x82, offset 0x2a8 - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0xab, hi: 0xab}, - // Block 0x83, offset 0x2aa - {value: 0x0000, lo: 0x02}, - {value: 0x8105, lo: 0xb9, hi: 0xb9}, - {value: 0x8103, lo: 0xba, hi: 0xba}, - // Block 0x84, offset 0x2ad - {value: 0x0000, lo: 0x04}, - {value: 0x9900, lo: 0xb0, hi: 0xb0}, - {value: 0xa000, lo: 0xb5, hi: 0xb5}, - {value: 0x2de5, lo: 0xb8, hi: 0xb8}, - {value: 0x8105, lo: 0xbd, hi: 0xbe}, - // Block 0x85, offset 0x2b2 - {value: 0x0000, lo: 0x01}, - {value: 0x8103, lo: 0x83, hi: 0x83}, - // Block 0x86, offset 0x2b4 - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0xa0, hi: 0xa0}, - // Block 0x87, offset 0x2b6 - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0xb4, hi: 0xb4}, - // Block 0x88, offset 0x2b8 - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0x87, hi: 0x87}, - // Block 0x89, offset 0x2ba - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0x99, hi: 0x99}, - // Block 0x8a, offset 0x2bc - {value: 0x0000, lo: 0x02}, - {value: 0x8103, lo: 0x82, hi: 0x82}, - {value: 0x8105, lo: 0x84, hi: 0x85}, - // Block 0x8b, offset 0x2bf - {value: 0x0000, lo: 0x01}, - {value: 0x8105, lo: 0x97, hi: 0x97}, - // Block 0x8c, offset 0x2c1 - {value: 0x0000, lo: 0x01}, - {value: 0x8101, lo: 0xb0, hi: 0xb4}, - // Block 0x8d, offset 0x2c3 - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0xb0, hi: 0xb6}, - // Block 0x8e, offset 0x2c5 - {value: 0x0000, lo: 0x01}, - {value: 0x8102, lo: 0xb0, hi: 0xb1}, - // Block 0x8f, offset 0x2c7 - {value: 0x0000, lo: 0x01}, - {value: 0x8101, lo: 0x9e, hi: 0x9e}, - // Block 0x90, offset 0x2c9 - {value: 0x0000, lo: 0x0c}, - {value: 0x45e3, lo: 0x9e, hi: 0x9e}, - {value: 0x45ed, lo: 0x9f, hi: 0x9f}, - {value: 0x4621, lo: 0xa0, hi: 0xa0}, - {value: 0x462f, lo: 0xa1, hi: 0xa1}, - {value: 0x463d, lo: 0xa2, hi: 0xa2}, - {value: 0x464b, lo: 0xa3, hi: 0xa3}, - {value: 0x4659, lo: 0xa4, hi: 0xa4}, - {value: 0x812c, lo: 0xa5, hi: 0xa6}, - {value: 0x8101, lo: 0xa7, hi: 0xa9}, - {value: 0x8131, lo: 0xad, hi: 0xad}, - {value: 0x812c, lo: 0xae, hi: 0xb2}, - {value: 0x812e, lo: 0xbb, hi: 0xbf}, - // Block 0x91, offset 0x2d6 - {value: 0x0000, lo: 0x09}, - {value: 0x812e, lo: 0x80, hi: 0x82}, - {value: 0x8133, lo: 0x85, hi: 0x89}, - {value: 0x812e, lo: 0x8a, hi: 0x8b}, - {value: 0x8133, lo: 0xaa, hi: 0xad}, - {value: 0x45f7, lo: 0xbb, hi: 0xbb}, - {value: 0x4601, lo: 0xbc, hi: 0xbc}, - {value: 0x4667, lo: 0xbd, hi: 0xbd}, - {value: 0x4683, lo: 0xbe, hi: 0xbe}, - {value: 0x4675, lo: 0xbf, hi: 0xbf}, - // Block 0x92, offset 0x2e0 - {value: 0x0000, lo: 0x01}, - {value: 0x4691, lo: 0x80, hi: 0x80}, - // Block 0x93, offset 0x2e2 - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0x82, hi: 0x84}, - // Block 0x94, offset 0x2e4 - {value: 0x0002, lo: 0x03}, - {value: 0x0043, lo: 0x80, hi: 0x99}, - {value: 0x0083, lo: 0x9a, hi: 0xb3}, - {value: 0x0043, lo: 0xb4, hi: 0xbf}, - // Block 0x95, offset 0x2e8 - {value: 0x0002, lo: 0x04}, - {value: 0x005b, lo: 0x80, hi: 0x8d}, - {value: 0x0083, lo: 0x8e, hi: 0x94}, - {value: 0x0093, lo: 0x96, hi: 0xa7}, - {value: 0x0043, lo: 0xa8, hi: 0xbf}, - // Block 0x96, offset 0x2ed - {value: 0x0002, lo: 0x0b}, - {value: 0x0073, lo: 0x80, hi: 0x81}, - {value: 0x0083, lo: 0x82, hi: 0x9b}, - {value: 0x0043, lo: 0x9c, hi: 0x9c}, - {value: 0x0047, lo: 0x9e, hi: 0x9f}, - {value: 0x004f, lo: 0xa2, hi: 0xa2}, - {value: 0x0055, lo: 0xa5, hi: 0xa6}, - {value: 0x005d, lo: 0xa9, hi: 0xac}, - {value: 0x0067, lo: 0xae, hi: 0xb5}, - {value: 0x0083, lo: 0xb6, hi: 0xb9}, - {value: 0x008d, lo: 0xbb, hi: 0xbb}, - {value: 0x0091, lo: 0xbd, hi: 0xbf}, - // Block 0x97, offset 0x2f9 - {value: 0x0002, lo: 0x04}, - {value: 0x0097, lo: 0x80, hi: 0x83}, - {value: 0x00a1, lo: 0x85, hi: 0x8f}, - {value: 0x0043, lo: 0x90, hi: 0xa9}, - {value: 0x0083, lo: 0xaa, hi: 0xbf}, - // Block 0x98, offset 0x2fe - {value: 0x0002, lo: 0x08}, - {value: 0x00af, lo: 0x80, hi: 0x83}, - {value: 0x0043, lo: 0x84, hi: 0x85}, - {value: 0x0049, lo: 0x87, hi: 0x8a}, - {value: 0x0055, lo: 0x8d, hi: 0x94}, - {value: 0x0067, lo: 0x96, hi: 0x9c}, - {value: 0x0083, lo: 0x9e, hi: 0xb7}, - {value: 0x0043, lo: 0xb8, hi: 0xb9}, - {value: 0x0049, lo: 0xbb, hi: 0xbe}, - // Block 0x99, offset 0x307 - {value: 0x0002, lo: 0x05}, - {value: 0x0053, lo: 0x80, hi: 0x84}, - {value: 0x005f, lo: 0x86, hi: 0x86}, - {value: 0x0067, lo: 0x8a, hi: 0x90}, - {value: 0x0083, lo: 0x92, hi: 0xab}, - {value: 0x0043, lo: 0xac, hi: 0xbf}, - // Block 0x9a, offset 0x30d - {value: 0x0002, lo: 0x04}, - {value: 0x006b, lo: 0x80, hi: 0x85}, - {value: 0x0083, lo: 0x86, hi: 0x9f}, - {value: 0x0043, lo: 0xa0, hi: 0xb9}, - {value: 0x0083, lo: 0xba, hi: 0xbf}, - // Block 0x9b, offset 0x312 - {value: 0x0002, lo: 0x03}, - {value: 0x008f, lo: 0x80, hi: 0x93}, - {value: 0x0043, lo: 0x94, hi: 0xad}, - {value: 0x0083, lo: 0xae, hi: 0xbf}, - // Block 0x9c, offset 0x316 - {value: 0x0002, lo: 0x04}, - {value: 0x00a7, lo: 0x80, hi: 0x87}, - {value: 0x0043, lo: 0x88, hi: 0xa1}, - {value: 0x0083, lo: 0xa2, hi: 0xbb}, - {value: 0x0043, lo: 0xbc, hi: 0xbf}, - // Block 0x9d, offset 0x31b - {value: 0x0002, lo: 0x03}, - {value: 0x004b, lo: 0x80, hi: 0x95}, - {value: 0x0083, lo: 0x96, hi: 0xaf}, - {value: 0x0043, lo: 0xb0, hi: 0xbf}, - // Block 0x9e, offset 0x31f - {value: 0x0003, lo: 0x0f}, - {value: 0x01bb, lo: 0x80, hi: 0x80}, - {value: 0x0462, lo: 0x81, hi: 0x81}, - {value: 0x01be, lo: 0x82, hi: 0x9a}, - {value: 0x045e, lo: 0x9b, hi: 0x9b}, - {value: 0x01ca, lo: 0x9c, hi: 0x9c}, - {value: 0x01d3, lo: 0x9d, hi: 0x9d}, - {value: 0x01d9, lo: 0x9e, hi: 0x9e}, - {value: 0x01fd, lo: 0x9f, hi: 0x9f}, - {value: 0x01ee, lo: 0xa0, hi: 0xa0}, - {value: 0x01eb, lo: 0xa1, hi: 0xa1}, - {value: 0x0176, lo: 0xa2, hi: 0xb2}, - {value: 0x018b, lo: 0xb3, hi: 0xb3}, - {value: 0x01a9, lo: 0xb4, hi: 0xba}, - {value: 0x0462, lo: 0xbb, hi: 0xbb}, - {value: 0x01be, lo: 0xbc, hi: 0xbf}, - // Block 0x9f, offset 0x32f - {value: 0x0003, lo: 0x0d}, - {value: 0x01ca, lo: 0x80, hi: 0x94}, - {value: 0x045e, lo: 0x95, hi: 0x95}, - {value: 0x01ca, lo: 0x96, hi: 0x96}, - {value: 0x01d3, lo: 0x97, hi: 0x97}, - {value: 0x01d9, lo: 0x98, hi: 0x98}, - {value: 0x01fd, lo: 0x99, hi: 0x99}, - {value: 0x01ee, lo: 0x9a, hi: 0x9a}, - {value: 0x01eb, lo: 0x9b, hi: 0x9b}, - {value: 0x0176, lo: 0x9c, hi: 0xac}, - {value: 0x018b, lo: 0xad, hi: 0xad}, - {value: 0x01a9, lo: 0xae, hi: 0xb4}, - {value: 0x0462, lo: 0xb5, hi: 0xb5}, - {value: 0x01be, lo: 0xb6, hi: 0xbf}, - // Block 0xa0, offset 0x33d - {value: 0x0003, lo: 0x0d}, - {value: 0x01dc, lo: 0x80, hi: 0x8e}, - {value: 0x045e, lo: 0x8f, hi: 0x8f}, - {value: 0x01ca, lo: 0x90, hi: 0x90}, - {value: 0x01d3, lo: 0x91, hi: 0x91}, - {value: 0x01d9, lo: 0x92, hi: 0x92}, - {value: 0x01fd, lo: 0x93, hi: 0x93}, - {value: 0x01ee, lo: 0x94, hi: 0x94}, - {value: 0x01eb, lo: 0x95, hi: 0x95}, - {value: 0x0176, lo: 0x96, hi: 0xa6}, - {value: 0x018b, lo: 0xa7, hi: 0xa7}, - {value: 0x01a9, lo: 0xa8, hi: 0xae}, - {value: 0x0462, lo: 0xaf, hi: 0xaf}, - {value: 0x01be, lo: 0xb0, hi: 0xbf}, - // Block 0xa1, offset 0x34b - {value: 0x0003, lo: 0x0d}, - {value: 0x01ee, lo: 0x80, hi: 0x88}, - {value: 0x045e, lo: 0x89, hi: 0x89}, - {value: 0x01ca, lo: 0x8a, hi: 0x8a}, - {value: 0x01d3, lo: 0x8b, hi: 0x8b}, - {value: 0x01d9, lo: 0x8c, hi: 0x8c}, - {value: 0x01fd, lo: 0x8d, hi: 0x8d}, - {value: 0x01ee, lo: 0x8e, hi: 0x8e}, - {value: 0x01eb, lo: 0x8f, hi: 0x8f}, - {value: 0x0176, lo: 0x90, hi: 0xa0}, - {value: 0x018b, lo: 0xa1, hi: 0xa1}, - {value: 0x01a9, lo: 0xa2, hi: 0xa8}, - {value: 0x0462, lo: 0xa9, hi: 0xa9}, - {value: 0x01be, lo: 0xaa, hi: 0xbf}, - // Block 0xa2, offset 0x359 - {value: 0x0000, lo: 0x05}, - {value: 0x8133, lo: 0x80, hi: 0x86}, - {value: 0x8133, lo: 0x88, hi: 0x98}, - {value: 0x8133, lo: 0x9b, hi: 0xa1}, - {value: 0x8133, lo: 0xa3, hi: 0xa4}, - {value: 0x8133, lo: 0xa6, hi: 0xaa}, - // Block 0xa3, offset 0x35f - {value: 0x0000, lo: 0x01}, - {value: 0x8133, lo: 0xac, hi: 0xaf}, - // Block 0xa4, offset 0x361 - {value: 0x0000, lo: 0x01}, - {value: 0x812e, lo: 0x90, hi: 0x96}, - // Block 0xa5, offset 0x363 - {value: 0x0000, lo: 0x02}, - {value: 0x8133, lo: 0x84, hi: 0x89}, - {value: 0x8103, lo: 0x8a, hi: 0x8a}, - // Block 0xa6, offset 0x366 - {value: 0x0002, lo: 0x0a}, - {value: 0x0063, lo: 0x80, hi: 0x89}, - {value: 0x1954, lo: 0x8a, hi: 0x8a}, - {value: 0x1987, lo: 0x8b, hi: 0x8b}, - {value: 0x19a2, lo: 0x8c, hi: 0x8c}, - {value: 0x19a8, lo: 0x8d, hi: 0x8d}, - {value: 0x1bc6, lo: 0x8e, hi: 0x8e}, - {value: 0x19b4, lo: 0x8f, hi: 0x8f}, - {value: 0x197e, lo: 0xaa, hi: 0xaa}, - {value: 0x1981, lo: 0xab, hi: 0xab}, - {value: 0x1984, lo: 0xac, hi: 0xac}, - // Block 0xa7, offset 0x371 - {value: 0x0000, lo: 0x01}, - {value: 0x1942, lo: 0x90, hi: 0x90}, - // Block 0xa8, offset 0x373 - {value: 0x0028, lo: 0x09}, - {value: 0x286f, lo: 0x80, hi: 0x80}, - {value: 0x2833, lo: 0x81, hi: 0x81}, - {value: 0x283d, lo: 0x82, hi: 0x82}, - {value: 0x2851, lo: 0x83, hi: 0x84}, - {value: 0x285b, lo: 0x85, hi: 0x86}, - {value: 0x2847, lo: 0x87, hi: 0x87}, - {value: 0x2865, lo: 0x88, hi: 0x88}, - {value: 0x0b72, lo: 0x90, hi: 0x90}, - {value: 0x08ea, lo: 0x91, hi: 0x91}, - // Block 0xa9, offset 0x37d - {value: 0x0002, lo: 0x01}, - {value: 0x0021, lo: 0xb0, hi: 0xb9}, -} - -// recompMap: 7528 bytes (entries only) -var recompMap map[uint32]rune -var recompMapOnce sync.Once - -const recompMapPacked = "" + - "\x00A\x03\x00\x00\x00\x00\xc0" + // 0x00410300: 0x000000C0 - "\x00A\x03\x01\x00\x00\x00\xc1" + // 0x00410301: 0x000000C1 - "\x00A\x03\x02\x00\x00\x00\xc2" + // 0x00410302: 0x000000C2 - "\x00A\x03\x03\x00\x00\x00\xc3" + // 0x00410303: 0x000000C3 - "\x00A\x03\b\x00\x00\x00\xc4" + // 0x00410308: 0x000000C4 - "\x00A\x03\n\x00\x00\x00\xc5" + // 0x0041030A: 0x000000C5 - "\x00C\x03'\x00\x00\x00\xc7" + // 0x00430327: 0x000000C7 - "\x00E\x03\x00\x00\x00\x00\xc8" + // 0x00450300: 0x000000C8 - "\x00E\x03\x01\x00\x00\x00\xc9" + // 0x00450301: 0x000000C9 - "\x00E\x03\x02\x00\x00\x00\xca" + // 0x00450302: 0x000000CA - "\x00E\x03\b\x00\x00\x00\xcb" + // 0x00450308: 0x000000CB - "\x00I\x03\x00\x00\x00\x00\xcc" + // 0x00490300: 0x000000CC - "\x00I\x03\x01\x00\x00\x00\xcd" + // 0x00490301: 0x000000CD - "\x00I\x03\x02\x00\x00\x00\xce" + // 0x00490302: 0x000000CE - "\x00I\x03\b\x00\x00\x00\xcf" + // 0x00490308: 0x000000CF - "\x00N\x03\x03\x00\x00\x00\xd1" + // 0x004E0303: 0x000000D1 - "\x00O\x03\x00\x00\x00\x00\xd2" + // 0x004F0300: 0x000000D2 - "\x00O\x03\x01\x00\x00\x00\xd3" + // 0x004F0301: 0x000000D3 - "\x00O\x03\x02\x00\x00\x00\xd4" + // 0x004F0302: 0x000000D4 - "\x00O\x03\x03\x00\x00\x00\xd5" + // 0x004F0303: 0x000000D5 - "\x00O\x03\b\x00\x00\x00\xd6" + // 0x004F0308: 0x000000D6 - "\x00U\x03\x00\x00\x00\x00\xd9" + // 0x00550300: 0x000000D9 - "\x00U\x03\x01\x00\x00\x00\xda" + // 0x00550301: 0x000000DA - "\x00U\x03\x02\x00\x00\x00\xdb" + // 0x00550302: 0x000000DB - "\x00U\x03\b\x00\x00\x00\xdc" + // 0x00550308: 0x000000DC - "\x00Y\x03\x01\x00\x00\x00\xdd" + // 0x00590301: 0x000000DD - "\x00a\x03\x00\x00\x00\x00\xe0" + // 0x00610300: 0x000000E0 - "\x00a\x03\x01\x00\x00\x00\xe1" + // 0x00610301: 0x000000E1 - "\x00a\x03\x02\x00\x00\x00\xe2" + // 0x00610302: 0x000000E2 - "\x00a\x03\x03\x00\x00\x00\xe3" + // 0x00610303: 0x000000E3 - "\x00a\x03\b\x00\x00\x00\xe4" + // 0x00610308: 0x000000E4 - "\x00a\x03\n\x00\x00\x00\xe5" + // 0x0061030A: 0x000000E5 - "\x00c\x03'\x00\x00\x00\xe7" + // 0x00630327: 0x000000E7 - "\x00e\x03\x00\x00\x00\x00\xe8" + // 0x00650300: 0x000000E8 - "\x00e\x03\x01\x00\x00\x00\xe9" + // 0x00650301: 0x000000E9 - "\x00e\x03\x02\x00\x00\x00\xea" + // 0x00650302: 0x000000EA - "\x00e\x03\b\x00\x00\x00\xeb" + // 0x00650308: 0x000000EB - "\x00i\x03\x00\x00\x00\x00\xec" + // 0x00690300: 0x000000EC - "\x00i\x03\x01\x00\x00\x00\xed" + // 0x00690301: 0x000000ED - "\x00i\x03\x02\x00\x00\x00\xee" + // 0x00690302: 0x000000EE - "\x00i\x03\b\x00\x00\x00\xef" + // 0x00690308: 0x000000EF - "\x00n\x03\x03\x00\x00\x00\xf1" + // 0x006E0303: 0x000000F1 - "\x00o\x03\x00\x00\x00\x00\xf2" + // 0x006F0300: 0x000000F2 - "\x00o\x03\x01\x00\x00\x00\xf3" + // 0x006F0301: 0x000000F3 - "\x00o\x03\x02\x00\x00\x00\xf4" + // 0x006F0302: 0x000000F4 - "\x00o\x03\x03\x00\x00\x00\xf5" + // 0x006F0303: 0x000000F5 - "\x00o\x03\b\x00\x00\x00\xf6" + // 0x006F0308: 0x000000F6 - "\x00u\x03\x00\x00\x00\x00\xf9" + // 0x00750300: 0x000000F9 - "\x00u\x03\x01\x00\x00\x00\xfa" + // 0x00750301: 0x000000FA - "\x00u\x03\x02\x00\x00\x00\xfb" + // 0x00750302: 0x000000FB - "\x00u\x03\b\x00\x00\x00\xfc" + // 0x00750308: 0x000000FC - "\x00y\x03\x01\x00\x00\x00\xfd" + // 0x00790301: 0x000000FD - "\x00y\x03\b\x00\x00\x00\xff" + // 0x00790308: 0x000000FF - "\x00A\x03\x04\x00\x00\x01\x00" + // 0x00410304: 0x00000100 - "\x00a\x03\x04\x00\x00\x01\x01" + // 0x00610304: 0x00000101 - "\x00A\x03\x06\x00\x00\x01\x02" + // 0x00410306: 0x00000102 - "\x00a\x03\x06\x00\x00\x01\x03" + // 0x00610306: 0x00000103 - "\x00A\x03(\x00\x00\x01\x04" + // 0x00410328: 0x00000104 - "\x00a\x03(\x00\x00\x01\x05" + // 0x00610328: 0x00000105 - "\x00C\x03\x01\x00\x00\x01\x06" + // 0x00430301: 0x00000106 - "\x00c\x03\x01\x00\x00\x01\a" + // 0x00630301: 0x00000107 - "\x00C\x03\x02\x00\x00\x01\b" + // 0x00430302: 0x00000108 - "\x00c\x03\x02\x00\x00\x01\t" + // 0x00630302: 0x00000109 - "\x00C\x03\a\x00\x00\x01\n" + // 0x00430307: 0x0000010A - "\x00c\x03\a\x00\x00\x01\v" + // 0x00630307: 0x0000010B - "\x00C\x03\f\x00\x00\x01\f" + // 0x0043030C: 0x0000010C - "\x00c\x03\f\x00\x00\x01\r" + // 0x0063030C: 0x0000010D - "\x00D\x03\f\x00\x00\x01\x0e" + // 0x0044030C: 0x0000010E - "\x00d\x03\f\x00\x00\x01\x0f" + // 0x0064030C: 0x0000010F - "\x00E\x03\x04\x00\x00\x01\x12" + // 0x00450304: 0x00000112 - "\x00e\x03\x04\x00\x00\x01\x13" + // 0x00650304: 0x00000113 - "\x00E\x03\x06\x00\x00\x01\x14" + // 0x00450306: 0x00000114 - "\x00e\x03\x06\x00\x00\x01\x15" + // 0x00650306: 0x00000115 - "\x00E\x03\a\x00\x00\x01\x16" + // 0x00450307: 0x00000116 - "\x00e\x03\a\x00\x00\x01\x17" + // 0x00650307: 0x00000117 - "\x00E\x03(\x00\x00\x01\x18" + // 0x00450328: 0x00000118 - "\x00e\x03(\x00\x00\x01\x19" + // 0x00650328: 0x00000119 - "\x00E\x03\f\x00\x00\x01\x1a" + // 0x0045030C: 0x0000011A - "\x00e\x03\f\x00\x00\x01\x1b" + // 0x0065030C: 0x0000011B - "\x00G\x03\x02\x00\x00\x01\x1c" + // 0x00470302: 0x0000011C - "\x00g\x03\x02\x00\x00\x01\x1d" + // 0x00670302: 0x0000011D - "\x00G\x03\x06\x00\x00\x01\x1e" + // 0x00470306: 0x0000011E - "\x00g\x03\x06\x00\x00\x01\x1f" + // 0x00670306: 0x0000011F - "\x00G\x03\a\x00\x00\x01 " + // 0x00470307: 0x00000120 - "\x00g\x03\a\x00\x00\x01!" + // 0x00670307: 0x00000121 - "\x00G\x03'\x00\x00\x01\"" + // 0x00470327: 0x00000122 - "\x00g\x03'\x00\x00\x01#" + // 0x00670327: 0x00000123 - "\x00H\x03\x02\x00\x00\x01$" + // 0x00480302: 0x00000124 - "\x00h\x03\x02\x00\x00\x01%" + // 0x00680302: 0x00000125 - "\x00I\x03\x03\x00\x00\x01(" + // 0x00490303: 0x00000128 - "\x00i\x03\x03\x00\x00\x01)" + // 0x00690303: 0x00000129 - "\x00I\x03\x04\x00\x00\x01*" + // 0x00490304: 0x0000012A - "\x00i\x03\x04\x00\x00\x01+" + // 0x00690304: 0x0000012B - "\x00I\x03\x06\x00\x00\x01," + // 0x00490306: 0x0000012C - "\x00i\x03\x06\x00\x00\x01-" + // 0x00690306: 0x0000012D - "\x00I\x03(\x00\x00\x01." + // 0x00490328: 0x0000012E - "\x00i\x03(\x00\x00\x01/" + // 0x00690328: 0x0000012F - "\x00I\x03\a\x00\x00\x010" + // 0x00490307: 0x00000130 - "\x00J\x03\x02\x00\x00\x014" + // 0x004A0302: 0x00000134 - "\x00j\x03\x02\x00\x00\x015" + // 0x006A0302: 0x00000135 - "\x00K\x03'\x00\x00\x016" + // 0x004B0327: 0x00000136 - "\x00k\x03'\x00\x00\x017" + // 0x006B0327: 0x00000137 - "\x00L\x03\x01\x00\x00\x019" + // 0x004C0301: 0x00000139 - "\x00l\x03\x01\x00\x00\x01:" + // 0x006C0301: 0x0000013A - "\x00L\x03'\x00\x00\x01;" + // 0x004C0327: 0x0000013B - "\x00l\x03'\x00\x00\x01<" + // 0x006C0327: 0x0000013C - "\x00L\x03\f\x00\x00\x01=" + // 0x004C030C: 0x0000013D - "\x00l\x03\f\x00\x00\x01>" + // 0x006C030C: 0x0000013E - "\x00N\x03\x01\x00\x00\x01C" + // 0x004E0301: 0x00000143 - "\x00n\x03\x01\x00\x00\x01D" + // 0x006E0301: 0x00000144 - "\x00N\x03'\x00\x00\x01E" + // 0x004E0327: 0x00000145 - "\x00n\x03'\x00\x00\x01F" + // 0x006E0327: 0x00000146 - "\x00N\x03\f\x00\x00\x01G" + // 0x004E030C: 0x00000147 - "\x00n\x03\f\x00\x00\x01H" + // 0x006E030C: 0x00000148 - "\x00O\x03\x04\x00\x00\x01L" + // 0x004F0304: 0x0000014C - "\x00o\x03\x04\x00\x00\x01M" + // 0x006F0304: 0x0000014D - "\x00O\x03\x06\x00\x00\x01N" + // 0x004F0306: 0x0000014E - "\x00o\x03\x06\x00\x00\x01O" + // 0x006F0306: 0x0000014F - "\x00O\x03\v\x00\x00\x01P" + // 0x004F030B: 0x00000150 - "\x00o\x03\v\x00\x00\x01Q" + // 0x006F030B: 0x00000151 - "\x00R\x03\x01\x00\x00\x01T" + // 0x00520301: 0x00000154 - "\x00r\x03\x01\x00\x00\x01U" + // 0x00720301: 0x00000155 - "\x00R\x03'\x00\x00\x01V" + // 0x00520327: 0x00000156 - "\x00r\x03'\x00\x00\x01W" + // 0x00720327: 0x00000157 - "\x00R\x03\f\x00\x00\x01X" + // 0x0052030C: 0x00000158 - "\x00r\x03\f\x00\x00\x01Y" + // 0x0072030C: 0x00000159 - "\x00S\x03\x01\x00\x00\x01Z" + // 0x00530301: 0x0000015A - "\x00s\x03\x01\x00\x00\x01[" + // 0x00730301: 0x0000015B - "\x00S\x03\x02\x00\x00\x01\\" + // 0x00530302: 0x0000015C - "\x00s\x03\x02\x00\x00\x01]" + // 0x00730302: 0x0000015D - "\x00S\x03'\x00\x00\x01^" + // 0x00530327: 0x0000015E - "\x00s\x03'\x00\x00\x01_" + // 0x00730327: 0x0000015F - "\x00S\x03\f\x00\x00\x01`" + // 0x0053030C: 0x00000160 - "\x00s\x03\f\x00\x00\x01a" + // 0x0073030C: 0x00000161 - "\x00T\x03'\x00\x00\x01b" + // 0x00540327: 0x00000162 - "\x00t\x03'\x00\x00\x01c" + // 0x00740327: 0x00000163 - "\x00T\x03\f\x00\x00\x01d" + // 0x0054030C: 0x00000164 - "\x00t\x03\f\x00\x00\x01e" + // 0x0074030C: 0x00000165 - "\x00U\x03\x03\x00\x00\x01h" + // 0x00550303: 0x00000168 - "\x00u\x03\x03\x00\x00\x01i" + // 0x00750303: 0x00000169 - "\x00U\x03\x04\x00\x00\x01j" + // 0x00550304: 0x0000016A - "\x00u\x03\x04\x00\x00\x01k" + // 0x00750304: 0x0000016B - "\x00U\x03\x06\x00\x00\x01l" + // 0x00550306: 0x0000016C - "\x00u\x03\x06\x00\x00\x01m" + // 0x00750306: 0x0000016D - "\x00U\x03\n\x00\x00\x01n" + // 0x0055030A: 0x0000016E - "\x00u\x03\n\x00\x00\x01o" + // 0x0075030A: 0x0000016F - "\x00U\x03\v\x00\x00\x01p" + // 0x0055030B: 0x00000170 - "\x00u\x03\v\x00\x00\x01q" + // 0x0075030B: 0x00000171 - "\x00U\x03(\x00\x00\x01r" + // 0x00550328: 0x00000172 - "\x00u\x03(\x00\x00\x01s" + // 0x00750328: 0x00000173 - "\x00W\x03\x02\x00\x00\x01t" + // 0x00570302: 0x00000174 - "\x00w\x03\x02\x00\x00\x01u" + // 0x00770302: 0x00000175 - "\x00Y\x03\x02\x00\x00\x01v" + // 0x00590302: 0x00000176 - "\x00y\x03\x02\x00\x00\x01w" + // 0x00790302: 0x00000177 - "\x00Y\x03\b\x00\x00\x01x" + // 0x00590308: 0x00000178 - "\x00Z\x03\x01\x00\x00\x01y" + // 0x005A0301: 0x00000179 - "\x00z\x03\x01\x00\x00\x01z" + // 0x007A0301: 0x0000017A - "\x00Z\x03\a\x00\x00\x01{" + // 0x005A0307: 0x0000017B - "\x00z\x03\a\x00\x00\x01|" + // 0x007A0307: 0x0000017C - "\x00Z\x03\f\x00\x00\x01}" + // 0x005A030C: 0x0000017D - "\x00z\x03\f\x00\x00\x01~" + // 0x007A030C: 0x0000017E - "\x00O\x03\x1b\x00\x00\x01\xa0" + // 0x004F031B: 0x000001A0 - "\x00o\x03\x1b\x00\x00\x01\xa1" + // 0x006F031B: 0x000001A1 - "\x00U\x03\x1b\x00\x00\x01\xaf" + // 0x0055031B: 0x000001AF - "\x00u\x03\x1b\x00\x00\x01\xb0" + // 0x0075031B: 0x000001B0 - "\x00A\x03\f\x00\x00\x01\xcd" + // 0x0041030C: 0x000001CD - "\x00a\x03\f\x00\x00\x01\xce" + // 0x0061030C: 0x000001CE - "\x00I\x03\f\x00\x00\x01\xcf" + // 0x0049030C: 0x000001CF - "\x00i\x03\f\x00\x00\x01\xd0" + // 0x0069030C: 0x000001D0 - "\x00O\x03\f\x00\x00\x01\xd1" + // 0x004F030C: 0x000001D1 - "\x00o\x03\f\x00\x00\x01\xd2" + // 0x006F030C: 0x000001D2 - "\x00U\x03\f\x00\x00\x01\xd3" + // 0x0055030C: 0x000001D3 - "\x00u\x03\f\x00\x00\x01\xd4" + // 0x0075030C: 0x000001D4 - "\x00\xdc\x03\x04\x00\x00\x01\xd5" + // 0x00DC0304: 0x000001D5 - "\x00\xfc\x03\x04\x00\x00\x01\xd6" + // 0x00FC0304: 0x000001D6 - "\x00\xdc\x03\x01\x00\x00\x01\xd7" + // 0x00DC0301: 0x000001D7 - "\x00\xfc\x03\x01\x00\x00\x01\xd8" + // 0x00FC0301: 0x000001D8 - "\x00\xdc\x03\f\x00\x00\x01\xd9" + // 0x00DC030C: 0x000001D9 - "\x00\xfc\x03\f\x00\x00\x01\xda" + // 0x00FC030C: 0x000001DA - "\x00\xdc\x03\x00\x00\x00\x01\xdb" + // 0x00DC0300: 0x000001DB - "\x00\xfc\x03\x00\x00\x00\x01\xdc" + // 0x00FC0300: 0x000001DC - "\x00\xc4\x03\x04\x00\x00\x01\xde" + // 0x00C40304: 0x000001DE - "\x00\xe4\x03\x04\x00\x00\x01\xdf" + // 0x00E40304: 0x000001DF - "\x02&\x03\x04\x00\x00\x01\xe0" + // 0x02260304: 0x000001E0 - "\x02'\x03\x04\x00\x00\x01\xe1" + // 0x02270304: 0x000001E1 - "\x00\xc6\x03\x04\x00\x00\x01\xe2" + // 0x00C60304: 0x000001E2 - "\x00\xe6\x03\x04\x00\x00\x01\xe3" + // 0x00E60304: 0x000001E3 - "\x00G\x03\f\x00\x00\x01\xe6" + // 0x0047030C: 0x000001E6 - "\x00g\x03\f\x00\x00\x01\xe7" + // 0x0067030C: 0x000001E7 - "\x00K\x03\f\x00\x00\x01\xe8" + // 0x004B030C: 0x000001E8 - "\x00k\x03\f\x00\x00\x01\xe9" + // 0x006B030C: 0x000001E9 - "\x00O\x03(\x00\x00\x01\xea" + // 0x004F0328: 0x000001EA - "\x00o\x03(\x00\x00\x01\xeb" + // 0x006F0328: 0x000001EB - "\x01\xea\x03\x04\x00\x00\x01\xec" + // 0x01EA0304: 0x000001EC - "\x01\xeb\x03\x04\x00\x00\x01\xed" + // 0x01EB0304: 0x000001ED - "\x01\xb7\x03\f\x00\x00\x01\xee" + // 0x01B7030C: 0x000001EE - "\x02\x92\x03\f\x00\x00\x01\xef" + // 0x0292030C: 0x000001EF - "\x00j\x03\f\x00\x00\x01\xf0" + // 0x006A030C: 0x000001F0 - "\x00G\x03\x01\x00\x00\x01\xf4" + // 0x00470301: 0x000001F4 - "\x00g\x03\x01\x00\x00\x01\xf5" + // 0x00670301: 0x000001F5 - "\x00N\x03\x00\x00\x00\x01\xf8" + // 0x004E0300: 0x000001F8 - "\x00n\x03\x00\x00\x00\x01\xf9" + // 0x006E0300: 0x000001F9 - "\x00\xc5\x03\x01\x00\x00\x01\xfa" + // 0x00C50301: 0x000001FA - "\x00\xe5\x03\x01\x00\x00\x01\xfb" + // 0x00E50301: 0x000001FB - "\x00\xc6\x03\x01\x00\x00\x01\xfc" + // 0x00C60301: 0x000001FC - "\x00\xe6\x03\x01\x00\x00\x01\xfd" + // 0x00E60301: 0x000001FD - "\x00\xd8\x03\x01\x00\x00\x01\xfe" + // 0x00D80301: 0x000001FE - "\x00\xf8\x03\x01\x00\x00\x01\xff" + // 0x00F80301: 0x000001FF - "\x00A\x03\x0f\x00\x00\x02\x00" + // 0x0041030F: 0x00000200 - "\x00a\x03\x0f\x00\x00\x02\x01" + // 0x0061030F: 0x00000201 - "\x00A\x03\x11\x00\x00\x02\x02" + // 0x00410311: 0x00000202 - "\x00a\x03\x11\x00\x00\x02\x03" + // 0x00610311: 0x00000203 - "\x00E\x03\x0f\x00\x00\x02\x04" + // 0x0045030F: 0x00000204 - "\x00e\x03\x0f\x00\x00\x02\x05" + // 0x0065030F: 0x00000205 - "\x00E\x03\x11\x00\x00\x02\x06" + // 0x00450311: 0x00000206 - "\x00e\x03\x11\x00\x00\x02\a" + // 0x00650311: 0x00000207 - "\x00I\x03\x0f\x00\x00\x02\b" + // 0x0049030F: 0x00000208 - "\x00i\x03\x0f\x00\x00\x02\t" + // 0x0069030F: 0x00000209 - "\x00I\x03\x11\x00\x00\x02\n" + // 0x00490311: 0x0000020A - "\x00i\x03\x11\x00\x00\x02\v" + // 0x00690311: 0x0000020B - "\x00O\x03\x0f\x00\x00\x02\f" + // 0x004F030F: 0x0000020C - "\x00o\x03\x0f\x00\x00\x02\r" + // 0x006F030F: 0x0000020D - "\x00O\x03\x11\x00\x00\x02\x0e" + // 0x004F0311: 0x0000020E - "\x00o\x03\x11\x00\x00\x02\x0f" + // 0x006F0311: 0x0000020F - "\x00R\x03\x0f\x00\x00\x02\x10" + // 0x0052030F: 0x00000210 - "\x00r\x03\x0f\x00\x00\x02\x11" + // 0x0072030F: 0x00000211 - "\x00R\x03\x11\x00\x00\x02\x12" + // 0x00520311: 0x00000212 - "\x00r\x03\x11\x00\x00\x02\x13" + // 0x00720311: 0x00000213 - "\x00U\x03\x0f\x00\x00\x02\x14" + // 0x0055030F: 0x00000214 - "\x00u\x03\x0f\x00\x00\x02\x15" + // 0x0075030F: 0x00000215 - "\x00U\x03\x11\x00\x00\x02\x16" + // 0x00550311: 0x00000216 - "\x00u\x03\x11\x00\x00\x02\x17" + // 0x00750311: 0x00000217 - "\x00S\x03&\x00\x00\x02\x18" + // 0x00530326: 0x00000218 - "\x00s\x03&\x00\x00\x02\x19" + // 0x00730326: 0x00000219 - "\x00T\x03&\x00\x00\x02\x1a" + // 0x00540326: 0x0000021A - "\x00t\x03&\x00\x00\x02\x1b" + // 0x00740326: 0x0000021B - "\x00H\x03\f\x00\x00\x02\x1e" + // 0x0048030C: 0x0000021E - "\x00h\x03\f\x00\x00\x02\x1f" + // 0x0068030C: 0x0000021F - "\x00A\x03\a\x00\x00\x02&" + // 0x00410307: 0x00000226 - "\x00a\x03\a\x00\x00\x02'" + // 0x00610307: 0x00000227 - "\x00E\x03'\x00\x00\x02(" + // 0x00450327: 0x00000228 - "\x00e\x03'\x00\x00\x02)" + // 0x00650327: 0x00000229 - "\x00\xd6\x03\x04\x00\x00\x02*" + // 0x00D60304: 0x0000022A - "\x00\xf6\x03\x04\x00\x00\x02+" + // 0x00F60304: 0x0000022B - "\x00\xd5\x03\x04\x00\x00\x02," + // 0x00D50304: 0x0000022C - "\x00\xf5\x03\x04\x00\x00\x02-" + // 0x00F50304: 0x0000022D - "\x00O\x03\a\x00\x00\x02." + // 0x004F0307: 0x0000022E - "\x00o\x03\a\x00\x00\x02/" + // 0x006F0307: 0x0000022F - "\x02.\x03\x04\x00\x00\x020" + // 0x022E0304: 0x00000230 - "\x02/\x03\x04\x00\x00\x021" + // 0x022F0304: 0x00000231 - "\x00Y\x03\x04\x00\x00\x022" + // 0x00590304: 0x00000232 - "\x00y\x03\x04\x00\x00\x023" + // 0x00790304: 0x00000233 - "\x00\xa8\x03\x01\x00\x00\x03\x85" + // 0x00A80301: 0x00000385 - "\x03\x91\x03\x01\x00\x00\x03\x86" + // 0x03910301: 0x00000386 - "\x03\x95\x03\x01\x00\x00\x03\x88" + // 0x03950301: 0x00000388 - "\x03\x97\x03\x01\x00\x00\x03\x89" + // 0x03970301: 0x00000389 - "\x03\x99\x03\x01\x00\x00\x03\x8a" + // 0x03990301: 0x0000038A - "\x03\x9f\x03\x01\x00\x00\x03\x8c" + // 0x039F0301: 0x0000038C - "\x03\xa5\x03\x01\x00\x00\x03\x8e" + // 0x03A50301: 0x0000038E - "\x03\xa9\x03\x01\x00\x00\x03\x8f" + // 0x03A90301: 0x0000038F - "\x03\xca\x03\x01\x00\x00\x03\x90" + // 0x03CA0301: 0x00000390 - "\x03\x99\x03\b\x00\x00\x03\xaa" + // 0x03990308: 0x000003AA - "\x03\xa5\x03\b\x00\x00\x03\xab" + // 0x03A50308: 0x000003AB - "\x03\xb1\x03\x01\x00\x00\x03\xac" + // 0x03B10301: 0x000003AC - "\x03\xb5\x03\x01\x00\x00\x03\xad" + // 0x03B50301: 0x000003AD - "\x03\xb7\x03\x01\x00\x00\x03\xae" + // 0x03B70301: 0x000003AE - "\x03\xb9\x03\x01\x00\x00\x03\xaf" + // 0x03B90301: 0x000003AF - "\x03\xcb\x03\x01\x00\x00\x03\xb0" + // 0x03CB0301: 0x000003B0 - "\x03\xb9\x03\b\x00\x00\x03\xca" + // 0x03B90308: 0x000003CA - "\x03\xc5\x03\b\x00\x00\x03\xcb" + // 0x03C50308: 0x000003CB - "\x03\xbf\x03\x01\x00\x00\x03\xcc" + // 0x03BF0301: 0x000003CC - "\x03\xc5\x03\x01\x00\x00\x03\xcd" + // 0x03C50301: 0x000003CD - "\x03\xc9\x03\x01\x00\x00\x03\xce" + // 0x03C90301: 0x000003CE - "\x03\xd2\x03\x01\x00\x00\x03\xd3" + // 0x03D20301: 0x000003D3 - "\x03\xd2\x03\b\x00\x00\x03\xd4" + // 0x03D20308: 0x000003D4 - "\x04\x15\x03\x00\x00\x00\x04\x00" + // 0x04150300: 0x00000400 - "\x04\x15\x03\b\x00\x00\x04\x01" + // 0x04150308: 0x00000401 - "\x04\x13\x03\x01\x00\x00\x04\x03" + // 0x04130301: 0x00000403 - "\x04\x06\x03\b\x00\x00\x04\a" + // 0x04060308: 0x00000407 - "\x04\x1a\x03\x01\x00\x00\x04\f" + // 0x041A0301: 0x0000040C - "\x04\x18\x03\x00\x00\x00\x04\r" + // 0x04180300: 0x0000040D - "\x04#\x03\x06\x00\x00\x04\x0e" + // 0x04230306: 0x0000040E - "\x04\x18\x03\x06\x00\x00\x04\x19" + // 0x04180306: 0x00000419 - "\x048\x03\x06\x00\x00\x049" + // 0x04380306: 0x00000439 - "\x045\x03\x00\x00\x00\x04P" + // 0x04350300: 0x00000450 - "\x045\x03\b\x00\x00\x04Q" + // 0x04350308: 0x00000451 - "\x043\x03\x01\x00\x00\x04S" + // 0x04330301: 0x00000453 - "\x04V\x03\b\x00\x00\x04W" + // 0x04560308: 0x00000457 - "\x04:\x03\x01\x00\x00\x04\\" + // 0x043A0301: 0x0000045C - "\x048\x03\x00\x00\x00\x04]" + // 0x04380300: 0x0000045D - "\x04C\x03\x06\x00\x00\x04^" + // 0x04430306: 0x0000045E - "\x04t\x03\x0f\x00\x00\x04v" + // 0x0474030F: 0x00000476 - "\x04u\x03\x0f\x00\x00\x04w" + // 0x0475030F: 0x00000477 - "\x04\x16\x03\x06\x00\x00\x04\xc1" + // 0x04160306: 0x000004C1 - "\x046\x03\x06\x00\x00\x04\xc2" + // 0x04360306: 0x000004C2 - "\x04\x10\x03\x06\x00\x00\x04\xd0" + // 0x04100306: 0x000004D0 - "\x040\x03\x06\x00\x00\x04\xd1" + // 0x04300306: 0x000004D1 - "\x04\x10\x03\b\x00\x00\x04\xd2" + // 0x04100308: 0x000004D2 - "\x040\x03\b\x00\x00\x04\xd3" + // 0x04300308: 0x000004D3 - "\x04\x15\x03\x06\x00\x00\x04\xd6" + // 0x04150306: 0x000004D6 - "\x045\x03\x06\x00\x00\x04\xd7" + // 0x04350306: 0x000004D7 - "\x04\xd8\x03\b\x00\x00\x04\xda" + // 0x04D80308: 0x000004DA - "\x04\xd9\x03\b\x00\x00\x04\xdb" + // 0x04D90308: 0x000004DB - "\x04\x16\x03\b\x00\x00\x04\xdc" + // 0x04160308: 0x000004DC - "\x046\x03\b\x00\x00\x04\xdd" + // 0x04360308: 0x000004DD - "\x04\x17\x03\b\x00\x00\x04\xde" + // 0x04170308: 0x000004DE - "\x047\x03\b\x00\x00\x04\xdf" + // 0x04370308: 0x000004DF - "\x04\x18\x03\x04\x00\x00\x04\xe2" + // 0x04180304: 0x000004E2 - "\x048\x03\x04\x00\x00\x04\xe3" + // 0x04380304: 0x000004E3 - "\x04\x18\x03\b\x00\x00\x04\xe4" + // 0x04180308: 0x000004E4 - "\x048\x03\b\x00\x00\x04\xe5" + // 0x04380308: 0x000004E5 - "\x04\x1e\x03\b\x00\x00\x04\xe6" + // 0x041E0308: 0x000004E6 - "\x04>\x03\b\x00\x00\x04\xe7" + // 0x043E0308: 0x000004E7 - "\x04\xe8\x03\b\x00\x00\x04\xea" + // 0x04E80308: 0x000004EA - "\x04\xe9\x03\b\x00\x00\x04\xeb" + // 0x04E90308: 0x000004EB - "\x04-\x03\b\x00\x00\x04\xec" + // 0x042D0308: 0x000004EC - "\x04M\x03\b\x00\x00\x04\xed" + // 0x044D0308: 0x000004ED - "\x04#\x03\x04\x00\x00\x04\xee" + // 0x04230304: 0x000004EE - "\x04C\x03\x04\x00\x00\x04\xef" + // 0x04430304: 0x000004EF - "\x04#\x03\b\x00\x00\x04\xf0" + // 0x04230308: 0x000004F0 - "\x04C\x03\b\x00\x00\x04\xf1" + // 0x04430308: 0x000004F1 - "\x04#\x03\v\x00\x00\x04\xf2" + // 0x0423030B: 0x000004F2 - "\x04C\x03\v\x00\x00\x04\xf3" + // 0x0443030B: 0x000004F3 - "\x04'\x03\b\x00\x00\x04\xf4" + // 0x04270308: 0x000004F4 - "\x04G\x03\b\x00\x00\x04\xf5" + // 0x04470308: 0x000004F5 - "\x04+\x03\b\x00\x00\x04\xf8" + // 0x042B0308: 0x000004F8 - "\x04K\x03\b\x00\x00\x04\xf9" + // 0x044B0308: 0x000004F9 - "\x06'\x06S\x00\x00\x06\"" + // 0x06270653: 0x00000622 - "\x06'\x06T\x00\x00\x06#" + // 0x06270654: 0x00000623 - "\x06H\x06T\x00\x00\x06$" + // 0x06480654: 0x00000624 - "\x06'\x06U\x00\x00\x06%" + // 0x06270655: 0x00000625 - "\x06J\x06T\x00\x00\x06&" + // 0x064A0654: 0x00000626 - "\x06\xd5\x06T\x00\x00\x06\xc0" + // 0x06D50654: 0x000006C0 - "\x06\xc1\x06T\x00\x00\x06\xc2" + // 0x06C10654: 0x000006C2 - "\x06\xd2\x06T\x00\x00\x06\xd3" + // 0x06D20654: 0x000006D3 - "\t(\t<\x00\x00\t)" + // 0x0928093C: 0x00000929 - "\t0\t<\x00\x00\t1" + // 0x0930093C: 0x00000931 - "\t3\t<\x00\x00\t4" + // 0x0933093C: 0x00000934 - "\t\xc7\t\xbe\x00\x00\t\xcb" + // 0x09C709BE: 0x000009CB - "\t\xc7\t\xd7\x00\x00\t\xcc" + // 0x09C709D7: 0x000009CC - "\vG\vV\x00\x00\vH" + // 0x0B470B56: 0x00000B48 - "\vG\v>\x00\x00\vK" + // 0x0B470B3E: 0x00000B4B - "\vG\vW\x00\x00\vL" + // 0x0B470B57: 0x00000B4C - "\v\x92\v\xd7\x00\x00\v\x94" + // 0x0B920BD7: 0x00000B94 - "\v\xc6\v\xbe\x00\x00\v\xca" + // 0x0BC60BBE: 0x00000BCA - "\v\xc7\v\xbe\x00\x00\v\xcb" + // 0x0BC70BBE: 0x00000BCB - "\v\xc6\v\xd7\x00\x00\v\xcc" + // 0x0BC60BD7: 0x00000BCC - "\fF\fV\x00\x00\fH" + // 0x0C460C56: 0x00000C48 - "\f\xbf\f\xd5\x00\x00\f\xc0" + // 0x0CBF0CD5: 0x00000CC0 - "\f\xc6\f\xd5\x00\x00\f\xc7" + // 0x0CC60CD5: 0x00000CC7 - "\f\xc6\f\xd6\x00\x00\f\xc8" + // 0x0CC60CD6: 0x00000CC8 - "\f\xc6\f\xc2\x00\x00\f\xca" + // 0x0CC60CC2: 0x00000CCA - "\f\xca\f\xd5\x00\x00\f\xcb" + // 0x0CCA0CD5: 0x00000CCB - "\rF\r>\x00\x00\rJ" + // 0x0D460D3E: 0x00000D4A - "\rG\r>\x00\x00\rK" + // 0x0D470D3E: 0x00000D4B - "\rF\rW\x00\x00\rL" + // 0x0D460D57: 0x00000D4C - "\r\xd9\r\xca\x00\x00\r\xda" + // 0x0DD90DCA: 0x00000DDA - "\r\xd9\r\xcf\x00\x00\r\xdc" + // 0x0DD90DCF: 0x00000DDC - "\r\xdc\r\xca\x00\x00\r\xdd" + // 0x0DDC0DCA: 0x00000DDD - "\r\xd9\r\xdf\x00\x00\r\xde" + // 0x0DD90DDF: 0x00000DDE - "\x10%\x10.\x00\x00\x10&" + // 0x1025102E: 0x00001026 - "\x1b\x05\x1b5\x00\x00\x1b\x06" + // 0x1B051B35: 0x00001B06 - "\x1b\a\x1b5\x00\x00\x1b\b" + // 0x1B071B35: 0x00001B08 - "\x1b\t\x1b5\x00\x00\x1b\n" + // 0x1B091B35: 0x00001B0A - "\x1b\v\x1b5\x00\x00\x1b\f" + // 0x1B0B1B35: 0x00001B0C - "\x1b\r\x1b5\x00\x00\x1b\x0e" + // 0x1B0D1B35: 0x00001B0E - "\x1b\x11\x1b5\x00\x00\x1b\x12" + // 0x1B111B35: 0x00001B12 - "\x1b:\x1b5\x00\x00\x1b;" + // 0x1B3A1B35: 0x00001B3B - "\x1b<\x1b5\x00\x00\x1b=" + // 0x1B3C1B35: 0x00001B3D - "\x1b>\x1b5\x00\x00\x1b@" + // 0x1B3E1B35: 0x00001B40 - "\x1b?\x1b5\x00\x00\x1bA" + // 0x1B3F1B35: 0x00001B41 - "\x1bB\x1b5\x00\x00\x1bC" + // 0x1B421B35: 0x00001B43 - "\x00A\x03%\x00\x00\x1e\x00" + // 0x00410325: 0x00001E00 - "\x00a\x03%\x00\x00\x1e\x01" + // 0x00610325: 0x00001E01 - "\x00B\x03\a\x00\x00\x1e\x02" + // 0x00420307: 0x00001E02 - "\x00b\x03\a\x00\x00\x1e\x03" + // 0x00620307: 0x00001E03 - "\x00B\x03#\x00\x00\x1e\x04" + // 0x00420323: 0x00001E04 - "\x00b\x03#\x00\x00\x1e\x05" + // 0x00620323: 0x00001E05 - "\x00B\x031\x00\x00\x1e\x06" + // 0x00420331: 0x00001E06 - "\x00b\x031\x00\x00\x1e\a" + // 0x00620331: 0x00001E07 - "\x00\xc7\x03\x01\x00\x00\x1e\b" + // 0x00C70301: 0x00001E08 - "\x00\xe7\x03\x01\x00\x00\x1e\t" + // 0x00E70301: 0x00001E09 - "\x00D\x03\a\x00\x00\x1e\n" + // 0x00440307: 0x00001E0A - "\x00d\x03\a\x00\x00\x1e\v" + // 0x00640307: 0x00001E0B - "\x00D\x03#\x00\x00\x1e\f" + // 0x00440323: 0x00001E0C - "\x00d\x03#\x00\x00\x1e\r" + // 0x00640323: 0x00001E0D - "\x00D\x031\x00\x00\x1e\x0e" + // 0x00440331: 0x00001E0E - "\x00d\x031\x00\x00\x1e\x0f" + // 0x00640331: 0x00001E0F - "\x00D\x03'\x00\x00\x1e\x10" + // 0x00440327: 0x00001E10 - "\x00d\x03'\x00\x00\x1e\x11" + // 0x00640327: 0x00001E11 - "\x00D\x03-\x00\x00\x1e\x12" + // 0x0044032D: 0x00001E12 - "\x00d\x03-\x00\x00\x1e\x13" + // 0x0064032D: 0x00001E13 - "\x01\x12\x03\x00\x00\x00\x1e\x14" + // 0x01120300: 0x00001E14 - "\x01\x13\x03\x00\x00\x00\x1e\x15" + // 0x01130300: 0x00001E15 - "\x01\x12\x03\x01\x00\x00\x1e\x16" + // 0x01120301: 0x00001E16 - "\x01\x13\x03\x01\x00\x00\x1e\x17" + // 0x01130301: 0x00001E17 - "\x00E\x03-\x00\x00\x1e\x18" + // 0x0045032D: 0x00001E18 - "\x00e\x03-\x00\x00\x1e\x19" + // 0x0065032D: 0x00001E19 - "\x00E\x030\x00\x00\x1e\x1a" + // 0x00450330: 0x00001E1A - "\x00e\x030\x00\x00\x1e\x1b" + // 0x00650330: 0x00001E1B - "\x02(\x03\x06\x00\x00\x1e\x1c" + // 0x02280306: 0x00001E1C - "\x02)\x03\x06\x00\x00\x1e\x1d" + // 0x02290306: 0x00001E1D - "\x00F\x03\a\x00\x00\x1e\x1e" + // 0x00460307: 0x00001E1E - "\x00f\x03\a\x00\x00\x1e\x1f" + // 0x00660307: 0x00001E1F - "\x00G\x03\x04\x00\x00\x1e " + // 0x00470304: 0x00001E20 - "\x00g\x03\x04\x00\x00\x1e!" + // 0x00670304: 0x00001E21 - "\x00H\x03\a\x00\x00\x1e\"" + // 0x00480307: 0x00001E22 - "\x00h\x03\a\x00\x00\x1e#" + // 0x00680307: 0x00001E23 - "\x00H\x03#\x00\x00\x1e$" + // 0x00480323: 0x00001E24 - "\x00h\x03#\x00\x00\x1e%" + // 0x00680323: 0x00001E25 - "\x00H\x03\b\x00\x00\x1e&" + // 0x00480308: 0x00001E26 - "\x00h\x03\b\x00\x00\x1e'" + // 0x00680308: 0x00001E27 - "\x00H\x03'\x00\x00\x1e(" + // 0x00480327: 0x00001E28 - "\x00h\x03'\x00\x00\x1e)" + // 0x00680327: 0x00001E29 - "\x00H\x03.\x00\x00\x1e*" + // 0x0048032E: 0x00001E2A - "\x00h\x03.\x00\x00\x1e+" + // 0x0068032E: 0x00001E2B - "\x00I\x030\x00\x00\x1e," + // 0x00490330: 0x00001E2C - "\x00i\x030\x00\x00\x1e-" + // 0x00690330: 0x00001E2D - "\x00\xcf\x03\x01\x00\x00\x1e." + // 0x00CF0301: 0x00001E2E - "\x00\xef\x03\x01\x00\x00\x1e/" + // 0x00EF0301: 0x00001E2F - "\x00K\x03\x01\x00\x00\x1e0" + // 0x004B0301: 0x00001E30 - "\x00k\x03\x01\x00\x00\x1e1" + // 0x006B0301: 0x00001E31 - "\x00K\x03#\x00\x00\x1e2" + // 0x004B0323: 0x00001E32 - "\x00k\x03#\x00\x00\x1e3" + // 0x006B0323: 0x00001E33 - "\x00K\x031\x00\x00\x1e4" + // 0x004B0331: 0x00001E34 - "\x00k\x031\x00\x00\x1e5" + // 0x006B0331: 0x00001E35 - "\x00L\x03#\x00\x00\x1e6" + // 0x004C0323: 0x00001E36 - "\x00l\x03#\x00\x00\x1e7" + // 0x006C0323: 0x00001E37 - "\x1e6\x03\x04\x00\x00\x1e8" + // 0x1E360304: 0x00001E38 - "\x1e7\x03\x04\x00\x00\x1e9" + // 0x1E370304: 0x00001E39 - "\x00L\x031\x00\x00\x1e:" + // 0x004C0331: 0x00001E3A - "\x00l\x031\x00\x00\x1e;" + // 0x006C0331: 0x00001E3B - "\x00L\x03-\x00\x00\x1e<" + // 0x004C032D: 0x00001E3C - "\x00l\x03-\x00\x00\x1e=" + // 0x006C032D: 0x00001E3D - "\x00M\x03\x01\x00\x00\x1e>" + // 0x004D0301: 0x00001E3E - "\x00m\x03\x01\x00\x00\x1e?" + // 0x006D0301: 0x00001E3F - "\x00M\x03\a\x00\x00\x1e@" + // 0x004D0307: 0x00001E40 - "\x00m\x03\a\x00\x00\x1eA" + // 0x006D0307: 0x00001E41 - "\x00M\x03#\x00\x00\x1eB" + // 0x004D0323: 0x00001E42 - "\x00m\x03#\x00\x00\x1eC" + // 0x006D0323: 0x00001E43 - "\x00N\x03\a\x00\x00\x1eD" + // 0x004E0307: 0x00001E44 - "\x00n\x03\a\x00\x00\x1eE" + // 0x006E0307: 0x00001E45 - "\x00N\x03#\x00\x00\x1eF" + // 0x004E0323: 0x00001E46 - "\x00n\x03#\x00\x00\x1eG" + // 0x006E0323: 0x00001E47 - "\x00N\x031\x00\x00\x1eH" + // 0x004E0331: 0x00001E48 - "\x00n\x031\x00\x00\x1eI" + // 0x006E0331: 0x00001E49 - "\x00N\x03-\x00\x00\x1eJ" + // 0x004E032D: 0x00001E4A - "\x00n\x03-\x00\x00\x1eK" + // 0x006E032D: 0x00001E4B - "\x00\xd5\x03\x01\x00\x00\x1eL" + // 0x00D50301: 0x00001E4C - "\x00\xf5\x03\x01\x00\x00\x1eM" + // 0x00F50301: 0x00001E4D - "\x00\xd5\x03\b\x00\x00\x1eN" + // 0x00D50308: 0x00001E4E - "\x00\xf5\x03\b\x00\x00\x1eO" + // 0x00F50308: 0x00001E4F - "\x01L\x03\x00\x00\x00\x1eP" + // 0x014C0300: 0x00001E50 - "\x01M\x03\x00\x00\x00\x1eQ" + // 0x014D0300: 0x00001E51 - "\x01L\x03\x01\x00\x00\x1eR" + // 0x014C0301: 0x00001E52 - "\x01M\x03\x01\x00\x00\x1eS" + // 0x014D0301: 0x00001E53 - "\x00P\x03\x01\x00\x00\x1eT" + // 0x00500301: 0x00001E54 - "\x00p\x03\x01\x00\x00\x1eU" + // 0x00700301: 0x00001E55 - "\x00P\x03\a\x00\x00\x1eV" + // 0x00500307: 0x00001E56 - "\x00p\x03\a\x00\x00\x1eW" + // 0x00700307: 0x00001E57 - "\x00R\x03\a\x00\x00\x1eX" + // 0x00520307: 0x00001E58 - "\x00r\x03\a\x00\x00\x1eY" + // 0x00720307: 0x00001E59 - "\x00R\x03#\x00\x00\x1eZ" + // 0x00520323: 0x00001E5A - "\x00r\x03#\x00\x00\x1e[" + // 0x00720323: 0x00001E5B - "\x1eZ\x03\x04\x00\x00\x1e\\" + // 0x1E5A0304: 0x00001E5C - "\x1e[\x03\x04\x00\x00\x1e]" + // 0x1E5B0304: 0x00001E5D - "\x00R\x031\x00\x00\x1e^" + // 0x00520331: 0x00001E5E - "\x00r\x031\x00\x00\x1e_" + // 0x00720331: 0x00001E5F - "\x00S\x03\a\x00\x00\x1e`" + // 0x00530307: 0x00001E60 - "\x00s\x03\a\x00\x00\x1ea" + // 0x00730307: 0x00001E61 - "\x00S\x03#\x00\x00\x1eb" + // 0x00530323: 0x00001E62 - "\x00s\x03#\x00\x00\x1ec" + // 0x00730323: 0x00001E63 - "\x01Z\x03\a\x00\x00\x1ed" + // 0x015A0307: 0x00001E64 - "\x01[\x03\a\x00\x00\x1ee" + // 0x015B0307: 0x00001E65 - "\x01`\x03\a\x00\x00\x1ef" + // 0x01600307: 0x00001E66 - "\x01a\x03\a\x00\x00\x1eg" + // 0x01610307: 0x00001E67 - "\x1eb\x03\a\x00\x00\x1eh" + // 0x1E620307: 0x00001E68 - "\x1ec\x03\a\x00\x00\x1ei" + // 0x1E630307: 0x00001E69 - "\x00T\x03\a\x00\x00\x1ej" + // 0x00540307: 0x00001E6A - "\x00t\x03\a\x00\x00\x1ek" + // 0x00740307: 0x00001E6B - "\x00T\x03#\x00\x00\x1el" + // 0x00540323: 0x00001E6C - "\x00t\x03#\x00\x00\x1em" + // 0x00740323: 0x00001E6D - "\x00T\x031\x00\x00\x1en" + // 0x00540331: 0x00001E6E - "\x00t\x031\x00\x00\x1eo" + // 0x00740331: 0x00001E6F - "\x00T\x03-\x00\x00\x1ep" + // 0x0054032D: 0x00001E70 - "\x00t\x03-\x00\x00\x1eq" + // 0x0074032D: 0x00001E71 - "\x00U\x03$\x00\x00\x1er" + // 0x00550324: 0x00001E72 - "\x00u\x03$\x00\x00\x1es" + // 0x00750324: 0x00001E73 - "\x00U\x030\x00\x00\x1et" + // 0x00550330: 0x00001E74 - "\x00u\x030\x00\x00\x1eu" + // 0x00750330: 0x00001E75 - "\x00U\x03-\x00\x00\x1ev" + // 0x0055032D: 0x00001E76 - "\x00u\x03-\x00\x00\x1ew" + // 0x0075032D: 0x00001E77 - "\x01h\x03\x01\x00\x00\x1ex" + // 0x01680301: 0x00001E78 - "\x01i\x03\x01\x00\x00\x1ey" + // 0x01690301: 0x00001E79 - "\x01j\x03\b\x00\x00\x1ez" + // 0x016A0308: 0x00001E7A - "\x01k\x03\b\x00\x00\x1e{" + // 0x016B0308: 0x00001E7B - "\x00V\x03\x03\x00\x00\x1e|" + // 0x00560303: 0x00001E7C - "\x00v\x03\x03\x00\x00\x1e}" + // 0x00760303: 0x00001E7D - "\x00V\x03#\x00\x00\x1e~" + // 0x00560323: 0x00001E7E - "\x00v\x03#\x00\x00\x1e\u007f" + // 0x00760323: 0x00001E7F - "\x00W\x03\x00\x00\x00\x1e\x80" + // 0x00570300: 0x00001E80 - "\x00w\x03\x00\x00\x00\x1e\x81" + // 0x00770300: 0x00001E81 - "\x00W\x03\x01\x00\x00\x1e\x82" + // 0x00570301: 0x00001E82 - "\x00w\x03\x01\x00\x00\x1e\x83" + // 0x00770301: 0x00001E83 - "\x00W\x03\b\x00\x00\x1e\x84" + // 0x00570308: 0x00001E84 - "\x00w\x03\b\x00\x00\x1e\x85" + // 0x00770308: 0x00001E85 - "\x00W\x03\a\x00\x00\x1e\x86" + // 0x00570307: 0x00001E86 - "\x00w\x03\a\x00\x00\x1e\x87" + // 0x00770307: 0x00001E87 - "\x00W\x03#\x00\x00\x1e\x88" + // 0x00570323: 0x00001E88 - "\x00w\x03#\x00\x00\x1e\x89" + // 0x00770323: 0x00001E89 - "\x00X\x03\a\x00\x00\x1e\x8a" + // 0x00580307: 0x00001E8A - "\x00x\x03\a\x00\x00\x1e\x8b" + // 0x00780307: 0x00001E8B - "\x00X\x03\b\x00\x00\x1e\x8c" + // 0x00580308: 0x00001E8C - "\x00x\x03\b\x00\x00\x1e\x8d" + // 0x00780308: 0x00001E8D - "\x00Y\x03\a\x00\x00\x1e\x8e" + // 0x00590307: 0x00001E8E - "\x00y\x03\a\x00\x00\x1e\x8f" + // 0x00790307: 0x00001E8F - "\x00Z\x03\x02\x00\x00\x1e\x90" + // 0x005A0302: 0x00001E90 - "\x00z\x03\x02\x00\x00\x1e\x91" + // 0x007A0302: 0x00001E91 - "\x00Z\x03#\x00\x00\x1e\x92" + // 0x005A0323: 0x00001E92 - "\x00z\x03#\x00\x00\x1e\x93" + // 0x007A0323: 0x00001E93 - "\x00Z\x031\x00\x00\x1e\x94" + // 0x005A0331: 0x00001E94 - "\x00z\x031\x00\x00\x1e\x95" + // 0x007A0331: 0x00001E95 - "\x00h\x031\x00\x00\x1e\x96" + // 0x00680331: 0x00001E96 - "\x00t\x03\b\x00\x00\x1e\x97" + // 0x00740308: 0x00001E97 - "\x00w\x03\n\x00\x00\x1e\x98" + // 0x0077030A: 0x00001E98 - "\x00y\x03\n\x00\x00\x1e\x99" + // 0x0079030A: 0x00001E99 - "\x01\u007f\x03\a\x00\x00\x1e\x9b" + // 0x017F0307: 0x00001E9B - "\x00A\x03#\x00\x00\x1e\xa0" + // 0x00410323: 0x00001EA0 - "\x00a\x03#\x00\x00\x1e\xa1" + // 0x00610323: 0x00001EA1 - "\x00A\x03\t\x00\x00\x1e\xa2" + // 0x00410309: 0x00001EA2 - "\x00a\x03\t\x00\x00\x1e\xa3" + // 0x00610309: 0x00001EA3 - "\x00\xc2\x03\x01\x00\x00\x1e\xa4" + // 0x00C20301: 0x00001EA4 - "\x00\xe2\x03\x01\x00\x00\x1e\xa5" + // 0x00E20301: 0x00001EA5 - "\x00\xc2\x03\x00\x00\x00\x1e\xa6" + // 0x00C20300: 0x00001EA6 - "\x00\xe2\x03\x00\x00\x00\x1e\xa7" + // 0x00E20300: 0x00001EA7 - "\x00\xc2\x03\t\x00\x00\x1e\xa8" + // 0x00C20309: 0x00001EA8 - "\x00\xe2\x03\t\x00\x00\x1e\xa9" + // 0x00E20309: 0x00001EA9 - "\x00\xc2\x03\x03\x00\x00\x1e\xaa" + // 0x00C20303: 0x00001EAA - "\x00\xe2\x03\x03\x00\x00\x1e\xab" + // 0x00E20303: 0x00001EAB - "\x1e\xa0\x03\x02\x00\x00\x1e\xac" + // 0x1EA00302: 0x00001EAC - "\x1e\xa1\x03\x02\x00\x00\x1e\xad" + // 0x1EA10302: 0x00001EAD - "\x01\x02\x03\x01\x00\x00\x1e\xae" + // 0x01020301: 0x00001EAE - "\x01\x03\x03\x01\x00\x00\x1e\xaf" + // 0x01030301: 0x00001EAF - "\x01\x02\x03\x00\x00\x00\x1e\xb0" + // 0x01020300: 0x00001EB0 - "\x01\x03\x03\x00\x00\x00\x1e\xb1" + // 0x01030300: 0x00001EB1 - "\x01\x02\x03\t\x00\x00\x1e\xb2" + // 0x01020309: 0x00001EB2 - "\x01\x03\x03\t\x00\x00\x1e\xb3" + // 0x01030309: 0x00001EB3 - "\x01\x02\x03\x03\x00\x00\x1e\xb4" + // 0x01020303: 0x00001EB4 - "\x01\x03\x03\x03\x00\x00\x1e\xb5" + // 0x01030303: 0x00001EB5 - "\x1e\xa0\x03\x06\x00\x00\x1e\xb6" + // 0x1EA00306: 0x00001EB6 - "\x1e\xa1\x03\x06\x00\x00\x1e\xb7" + // 0x1EA10306: 0x00001EB7 - "\x00E\x03#\x00\x00\x1e\xb8" + // 0x00450323: 0x00001EB8 - "\x00e\x03#\x00\x00\x1e\xb9" + // 0x00650323: 0x00001EB9 - "\x00E\x03\t\x00\x00\x1e\xba" + // 0x00450309: 0x00001EBA - "\x00e\x03\t\x00\x00\x1e\xbb" + // 0x00650309: 0x00001EBB - "\x00E\x03\x03\x00\x00\x1e\xbc" + // 0x00450303: 0x00001EBC - "\x00e\x03\x03\x00\x00\x1e\xbd" + // 0x00650303: 0x00001EBD - "\x00\xca\x03\x01\x00\x00\x1e\xbe" + // 0x00CA0301: 0x00001EBE - "\x00\xea\x03\x01\x00\x00\x1e\xbf" + // 0x00EA0301: 0x00001EBF - "\x00\xca\x03\x00\x00\x00\x1e\xc0" + // 0x00CA0300: 0x00001EC0 - "\x00\xea\x03\x00\x00\x00\x1e\xc1" + // 0x00EA0300: 0x00001EC1 - "\x00\xca\x03\t\x00\x00\x1e\xc2" + // 0x00CA0309: 0x00001EC2 - "\x00\xea\x03\t\x00\x00\x1e\xc3" + // 0x00EA0309: 0x00001EC3 - "\x00\xca\x03\x03\x00\x00\x1e\xc4" + // 0x00CA0303: 0x00001EC4 - "\x00\xea\x03\x03\x00\x00\x1e\xc5" + // 0x00EA0303: 0x00001EC5 - "\x1e\xb8\x03\x02\x00\x00\x1e\xc6" + // 0x1EB80302: 0x00001EC6 - "\x1e\xb9\x03\x02\x00\x00\x1e\xc7" + // 0x1EB90302: 0x00001EC7 - "\x00I\x03\t\x00\x00\x1e\xc8" + // 0x00490309: 0x00001EC8 - "\x00i\x03\t\x00\x00\x1e\xc9" + // 0x00690309: 0x00001EC9 - "\x00I\x03#\x00\x00\x1e\xca" + // 0x00490323: 0x00001ECA - "\x00i\x03#\x00\x00\x1e\xcb" + // 0x00690323: 0x00001ECB - "\x00O\x03#\x00\x00\x1e\xcc" + // 0x004F0323: 0x00001ECC - "\x00o\x03#\x00\x00\x1e\xcd" + // 0x006F0323: 0x00001ECD - "\x00O\x03\t\x00\x00\x1e\xce" + // 0x004F0309: 0x00001ECE - "\x00o\x03\t\x00\x00\x1e\xcf" + // 0x006F0309: 0x00001ECF - "\x00\xd4\x03\x01\x00\x00\x1e\xd0" + // 0x00D40301: 0x00001ED0 - "\x00\xf4\x03\x01\x00\x00\x1e\xd1" + // 0x00F40301: 0x00001ED1 - "\x00\xd4\x03\x00\x00\x00\x1e\xd2" + // 0x00D40300: 0x00001ED2 - "\x00\xf4\x03\x00\x00\x00\x1e\xd3" + // 0x00F40300: 0x00001ED3 - "\x00\xd4\x03\t\x00\x00\x1e\xd4" + // 0x00D40309: 0x00001ED4 - "\x00\xf4\x03\t\x00\x00\x1e\xd5" + // 0x00F40309: 0x00001ED5 - "\x00\xd4\x03\x03\x00\x00\x1e\xd6" + // 0x00D40303: 0x00001ED6 - "\x00\xf4\x03\x03\x00\x00\x1e\xd7" + // 0x00F40303: 0x00001ED7 - "\x1e\xcc\x03\x02\x00\x00\x1e\xd8" + // 0x1ECC0302: 0x00001ED8 - "\x1e\xcd\x03\x02\x00\x00\x1e\xd9" + // 0x1ECD0302: 0x00001ED9 - "\x01\xa0\x03\x01\x00\x00\x1e\xda" + // 0x01A00301: 0x00001EDA - "\x01\xa1\x03\x01\x00\x00\x1e\xdb" + // 0x01A10301: 0x00001EDB - "\x01\xa0\x03\x00\x00\x00\x1e\xdc" + // 0x01A00300: 0x00001EDC - "\x01\xa1\x03\x00\x00\x00\x1e\xdd" + // 0x01A10300: 0x00001EDD - "\x01\xa0\x03\t\x00\x00\x1e\xde" + // 0x01A00309: 0x00001EDE - "\x01\xa1\x03\t\x00\x00\x1e\xdf" + // 0x01A10309: 0x00001EDF - "\x01\xa0\x03\x03\x00\x00\x1e\xe0" + // 0x01A00303: 0x00001EE0 - "\x01\xa1\x03\x03\x00\x00\x1e\xe1" + // 0x01A10303: 0x00001EE1 - "\x01\xa0\x03#\x00\x00\x1e\xe2" + // 0x01A00323: 0x00001EE2 - "\x01\xa1\x03#\x00\x00\x1e\xe3" + // 0x01A10323: 0x00001EE3 - "\x00U\x03#\x00\x00\x1e\xe4" + // 0x00550323: 0x00001EE4 - "\x00u\x03#\x00\x00\x1e\xe5" + // 0x00750323: 0x00001EE5 - "\x00U\x03\t\x00\x00\x1e\xe6" + // 0x00550309: 0x00001EE6 - "\x00u\x03\t\x00\x00\x1e\xe7" + // 0x00750309: 0x00001EE7 - "\x01\xaf\x03\x01\x00\x00\x1e\xe8" + // 0x01AF0301: 0x00001EE8 - "\x01\xb0\x03\x01\x00\x00\x1e\xe9" + // 0x01B00301: 0x00001EE9 - "\x01\xaf\x03\x00\x00\x00\x1e\xea" + // 0x01AF0300: 0x00001EEA - "\x01\xb0\x03\x00\x00\x00\x1e\xeb" + // 0x01B00300: 0x00001EEB - "\x01\xaf\x03\t\x00\x00\x1e\xec" + // 0x01AF0309: 0x00001EEC - "\x01\xb0\x03\t\x00\x00\x1e\xed" + // 0x01B00309: 0x00001EED - "\x01\xaf\x03\x03\x00\x00\x1e\xee" + // 0x01AF0303: 0x00001EEE - "\x01\xb0\x03\x03\x00\x00\x1e\xef" + // 0x01B00303: 0x00001EEF - "\x01\xaf\x03#\x00\x00\x1e\xf0" + // 0x01AF0323: 0x00001EF0 - "\x01\xb0\x03#\x00\x00\x1e\xf1" + // 0x01B00323: 0x00001EF1 - "\x00Y\x03\x00\x00\x00\x1e\xf2" + // 0x00590300: 0x00001EF2 - "\x00y\x03\x00\x00\x00\x1e\xf3" + // 0x00790300: 0x00001EF3 - "\x00Y\x03#\x00\x00\x1e\xf4" + // 0x00590323: 0x00001EF4 - "\x00y\x03#\x00\x00\x1e\xf5" + // 0x00790323: 0x00001EF5 - "\x00Y\x03\t\x00\x00\x1e\xf6" + // 0x00590309: 0x00001EF6 - "\x00y\x03\t\x00\x00\x1e\xf7" + // 0x00790309: 0x00001EF7 - "\x00Y\x03\x03\x00\x00\x1e\xf8" + // 0x00590303: 0x00001EF8 - "\x00y\x03\x03\x00\x00\x1e\xf9" + // 0x00790303: 0x00001EF9 - "\x03\xb1\x03\x13\x00\x00\x1f\x00" + // 0x03B10313: 0x00001F00 - "\x03\xb1\x03\x14\x00\x00\x1f\x01" + // 0x03B10314: 0x00001F01 - "\x1f\x00\x03\x00\x00\x00\x1f\x02" + // 0x1F000300: 0x00001F02 - "\x1f\x01\x03\x00\x00\x00\x1f\x03" + // 0x1F010300: 0x00001F03 - "\x1f\x00\x03\x01\x00\x00\x1f\x04" + // 0x1F000301: 0x00001F04 - "\x1f\x01\x03\x01\x00\x00\x1f\x05" + // 0x1F010301: 0x00001F05 - "\x1f\x00\x03B\x00\x00\x1f\x06" + // 0x1F000342: 0x00001F06 - "\x1f\x01\x03B\x00\x00\x1f\a" + // 0x1F010342: 0x00001F07 - "\x03\x91\x03\x13\x00\x00\x1f\b" + // 0x03910313: 0x00001F08 - "\x03\x91\x03\x14\x00\x00\x1f\t" + // 0x03910314: 0x00001F09 - "\x1f\b\x03\x00\x00\x00\x1f\n" + // 0x1F080300: 0x00001F0A - "\x1f\t\x03\x00\x00\x00\x1f\v" + // 0x1F090300: 0x00001F0B - "\x1f\b\x03\x01\x00\x00\x1f\f" + // 0x1F080301: 0x00001F0C - "\x1f\t\x03\x01\x00\x00\x1f\r" + // 0x1F090301: 0x00001F0D - "\x1f\b\x03B\x00\x00\x1f\x0e" + // 0x1F080342: 0x00001F0E - "\x1f\t\x03B\x00\x00\x1f\x0f" + // 0x1F090342: 0x00001F0F - "\x03\xb5\x03\x13\x00\x00\x1f\x10" + // 0x03B50313: 0x00001F10 - "\x03\xb5\x03\x14\x00\x00\x1f\x11" + // 0x03B50314: 0x00001F11 - "\x1f\x10\x03\x00\x00\x00\x1f\x12" + // 0x1F100300: 0x00001F12 - "\x1f\x11\x03\x00\x00\x00\x1f\x13" + // 0x1F110300: 0x00001F13 - "\x1f\x10\x03\x01\x00\x00\x1f\x14" + // 0x1F100301: 0x00001F14 - "\x1f\x11\x03\x01\x00\x00\x1f\x15" + // 0x1F110301: 0x00001F15 - "\x03\x95\x03\x13\x00\x00\x1f\x18" + // 0x03950313: 0x00001F18 - "\x03\x95\x03\x14\x00\x00\x1f\x19" + // 0x03950314: 0x00001F19 - "\x1f\x18\x03\x00\x00\x00\x1f\x1a" + // 0x1F180300: 0x00001F1A - "\x1f\x19\x03\x00\x00\x00\x1f\x1b" + // 0x1F190300: 0x00001F1B - "\x1f\x18\x03\x01\x00\x00\x1f\x1c" + // 0x1F180301: 0x00001F1C - "\x1f\x19\x03\x01\x00\x00\x1f\x1d" + // 0x1F190301: 0x00001F1D - "\x03\xb7\x03\x13\x00\x00\x1f " + // 0x03B70313: 0x00001F20 - "\x03\xb7\x03\x14\x00\x00\x1f!" + // 0x03B70314: 0x00001F21 - "\x1f \x03\x00\x00\x00\x1f\"" + // 0x1F200300: 0x00001F22 - "\x1f!\x03\x00\x00\x00\x1f#" + // 0x1F210300: 0x00001F23 - "\x1f \x03\x01\x00\x00\x1f$" + // 0x1F200301: 0x00001F24 - "\x1f!\x03\x01\x00\x00\x1f%" + // 0x1F210301: 0x00001F25 - "\x1f \x03B\x00\x00\x1f&" + // 0x1F200342: 0x00001F26 - "\x1f!\x03B\x00\x00\x1f'" + // 0x1F210342: 0x00001F27 - "\x03\x97\x03\x13\x00\x00\x1f(" + // 0x03970313: 0x00001F28 - "\x03\x97\x03\x14\x00\x00\x1f)" + // 0x03970314: 0x00001F29 - "\x1f(\x03\x00\x00\x00\x1f*" + // 0x1F280300: 0x00001F2A - "\x1f)\x03\x00\x00\x00\x1f+" + // 0x1F290300: 0x00001F2B - "\x1f(\x03\x01\x00\x00\x1f," + // 0x1F280301: 0x00001F2C - "\x1f)\x03\x01\x00\x00\x1f-" + // 0x1F290301: 0x00001F2D - "\x1f(\x03B\x00\x00\x1f." + // 0x1F280342: 0x00001F2E - "\x1f)\x03B\x00\x00\x1f/" + // 0x1F290342: 0x00001F2F - "\x03\xb9\x03\x13\x00\x00\x1f0" + // 0x03B90313: 0x00001F30 - "\x03\xb9\x03\x14\x00\x00\x1f1" + // 0x03B90314: 0x00001F31 - "\x1f0\x03\x00\x00\x00\x1f2" + // 0x1F300300: 0x00001F32 - "\x1f1\x03\x00\x00\x00\x1f3" + // 0x1F310300: 0x00001F33 - "\x1f0\x03\x01\x00\x00\x1f4" + // 0x1F300301: 0x00001F34 - "\x1f1\x03\x01\x00\x00\x1f5" + // 0x1F310301: 0x00001F35 - "\x1f0\x03B\x00\x00\x1f6" + // 0x1F300342: 0x00001F36 - "\x1f1\x03B\x00\x00\x1f7" + // 0x1F310342: 0x00001F37 - "\x03\x99\x03\x13\x00\x00\x1f8" + // 0x03990313: 0x00001F38 - "\x03\x99\x03\x14\x00\x00\x1f9" + // 0x03990314: 0x00001F39 - "\x1f8\x03\x00\x00\x00\x1f:" + // 0x1F380300: 0x00001F3A - "\x1f9\x03\x00\x00\x00\x1f;" + // 0x1F390300: 0x00001F3B - "\x1f8\x03\x01\x00\x00\x1f<" + // 0x1F380301: 0x00001F3C - "\x1f9\x03\x01\x00\x00\x1f=" + // 0x1F390301: 0x00001F3D - "\x1f8\x03B\x00\x00\x1f>" + // 0x1F380342: 0x00001F3E - "\x1f9\x03B\x00\x00\x1f?" + // 0x1F390342: 0x00001F3F - "\x03\xbf\x03\x13\x00\x00\x1f@" + // 0x03BF0313: 0x00001F40 - "\x03\xbf\x03\x14\x00\x00\x1fA" + // 0x03BF0314: 0x00001F41 - "\x1f@\x03\x00\x00\x00\x1fB" + // 0x1F400300: 0x00001F42 - "\x1fA\x03\x00\x00\x00\x1fC" + // 0x1F410300: 0x00001F43 - "\x1f@\x03\x01\x00\x00\x1fD" + // 0x1F400301: 0x00001F44 - "\x1fA\x03\x01\x00\x00\x1fE" + // 0x1F410301: 0x00001F45 - "\x03\x9f\x03\x13\x00\x00\x1fH" + // 0x039F0313: 0x00001F48 - "\x03\x9f\x03\x14\x00\x00\x1fI" + // 0x039F0314: 0x00001F49 - "\x1fH\x03\x00\x00\x00\x1fJ" + // 0x1F480300: 0x00001F4A - "\x1fI\x03\x00\x00\x00\x1fK" + // 0x1F490300: 0x00001F4B - "\x1fH\x03\x01\x00\x00\x1fL" + // 0x1F480301: 0x00001F4C - "\x1fI\x03\x01\x00\x00\x1fM" + // 0x1F490301: 0x00001F4D - "\x03\xc5\x03\x13\x00\x00\x1fP" + // 0x03C50313: 0x00001F50 - "\x03\xc5\x03\x14\x00\x00\x1fQ" + // 0x03C50314: 0x00001F51 - "\x1fP\x03\x00\x00\x00\x1fR" + // 0x1F500300: 0x00001F52 - "\x1fQ\x03\x00\x00\x00\x1fS" + // 0x1F510300: 0x00001F53 - "\x1fP\x03\x01\x00\x00\x1fT" + // 0x1F500301: 0x00001F54 - "\x1fQ\x03\x01\x00\x00\x1fU" + // 0x1F510301: 0x00001F55 - "\x1fP\x03B\x00\x00\x1fV" + // 0x1F500342: 0x00001F56 - "\x1fQ\x03B\x00\x00\x1fW" + // 0x1F510342: 0x00001F57 - "\x03\xa5\x03\x14\x00\x00\x1fY" + // 0x03A50314: 0x00001F59 - "\x1fY\x03\x00\x00\x00\x1f[" + // 0x1F590300: 0x00001F5B - "\x1fY\x03\x01\x00\x00\x1f]" + // 0x1F590301: 0x00001F5D - "\x1fY\x03B\x00\x00\x1f_" + // 0x1F590342: 0x00001F5F - "\x03\xc9\x03\x13\x00\x00\x1f`" + // 0x03C90313: 0x00001F60 - "\x03\xc9\x03\x14\x00\x00\x1fa" + // 0x03C90314: 0x00001F61 - "\x1f`\x03\x00\x00\x00\x1fb" + // 0x1F600300: 0x00001F62 - "\x1fa\x03\x00\x00\x00\x1fc" + // 0x1F610300: 0x00001F63 - "\x1f`\x03\x01\x00\x00\x1fd" + // 0x1F600301: 0x00001F64 - "\x1fa\x03\x01\x00\x00\x1fe" + // 0x1F610301: 0x00001F65 - "\x1f`\x03B\x00\x00\x1ff" + // 0x1F600342: 0x00001F66 - "\x1fa\x03B\x00\x00\x1fg" + // 0x1F610342: 0x00001F67 - "\x03\xa9\x03\x13\x00\x00\x1fh" + // 0x03A90313: 0x00001F68 - "\x03\xa9\x03\x14\x00\x00\x1fi" + // 0x03A90314: 0x00001F69 - "\x1fh\x03\x00\x00\x00\x1fj" + // 0x1F680300: 0x00001F6A - "\x1fi\x03\x00\x00\x00\x1fk" + // 0x1F690300: 0x00001F6B - "\x1fh\x03\x01\x00\x00\x1fl" + // 0x1F680301: 0x00001F6C - "\x1fi\x03\x01\x00\x00\x1fm" + // 0x1F690301: 0x00001F6D - "\x1fh\x03B\x00\x00\x1fn" + // 0x1F680342: 0x00001F6E - "\x1fi\x03B\x00\x00\x1fo" + // 0x1F690342: 0x00001F6F - "\x03\xb1\x03\x00\x00\x00\x1fp" + // 0x03B10300: 0x00001F70 - "\x03\xb5\x03\x00\x00\x00\x1fr" + // 0x03B50300: 0x00001F72 - "\x03\xb7\x03\x00\x00\x00\x1ft" + // 0x03B70300: 0x00001F74 - "\x03\xb9\x03\x00\x00\x00\x1fv" + // 0x03B90300: 0x00001F76 - "\x03\xbf\x03\x00\x00\x00\x1fx" + // 0x03BF0300: 0x00001F78 - "\x03\xc5\x03\x00\x00\x00\x1fz" + // 0x03C50300: 0x00001F7A - "\x03\xc9\x03\x00\x00\x00\x1f|" + // 0x03C90300: 0x00001F7C - "\x1f\x00\x03E\x00\x00\x1f\x80" + // 0x1F000345: 0x00001F80 - "\x1f\x01\x03E\x00\x00\x1f\x81" + // 0x1F010345: 0x00001F81 - "\x1f\x02\x03E\x00\x00\x1f\x82" + // 0x1F020345: 0x00001F82 - "\x1f\x03\x03E\x00\x00\x1f\x83" + // 0x1F030345: 0x00001F83 - "\x1f\x04\x03E\x00\x00\x1f\x84" + // 0x1F040345: 0x00001F84 - "\x1f\x05\x03E\x00\x00\x1f\x85" + // 0x1F050345: 0x00001F85 - "\x1f\x06\x03E\x00\x00\x1f\x86" + // 0x1F060345: 0x00001F86 - "\x1f\a\x03E\x00\x00\x1f\x87" + // 0x1F070345: 0x00001F87 - "\x1f\b\x03E\x00\x00\x1f\x88" + // 0x1F080345: 0x00001F88 - "\x1f\t\x03E\x00\x00\x1f\x89" + // 0x1F090345: 0x00001F89 - "\x1f\n\x03E\x00\x00\x1f\x8a" + // 0x1F0A0345: 0x00001F8A - "\x1f\v\x03E\x00\x00\x1f\x8b" + // 0x1F0B0345: 0x00001F8B - "\x1f\f\x03E\x00\x00\x1f\x8c" + // 0x1F0C0345: 0x00001F8C - "\x1f\r\x03E\x00\x00\x1f\x8d" + // 0x1F0D0345: 0x00001F8D - "\x1f\x0e\x03E\x00\x00\x1f\x8e" + // 0x1F0E0345: 0x00001F8E - "\x1f\x0f\x03E\x00\x00\x1f\x8f" + // 0x1F0F0345: 0x00001F8F - "\x1f \x03E\x00\x00\x1f\x90" + // 0x1F200345: 0x00001F90 - "\x1f!\x03E\x00\x00\x1f\x91" + // 0x1F210345: 0x00001F91 - "\x1f\"\x03E\x00\x00\x1f\x92" + // 0x1F220345: 0x00001F92 - "\x1f#\x03E\x00\x00\x1f\x93" + // 0x1F230345: 0x00001F93 - "\x1f$\x03E\x00\x00\x1f\x94" + // 0x1F240345: 0x00001F94 - "\x1f%\x03E\x00\x00\x1f\x95" + // 0x1F250345: 0x00001F95 - "\x1f&\x03E\x00\x00\x1f\x96" + // 0x1F260345: 0x00001F96 - "\x1f'\x03E\x00\x00\x1f\x97" + // 0x1F270345: 0x00001F97 - "\x1f(\x03E\x00\x00\x1f\x98" + // 0x1F280345: 0x00001F98 - "\x1f)\x03E\x00\x00\x1f\x99" + // 0x1F290345: 0x00001F99 - "\x1f*\x03E\x00\x00\x1f\x9a" + // 0x1F2A0345: 0x00001F9A - "\x1f+\x03E\x00\x00\x1f\x9b" + // 0x1F2B0345: 0x00001F9B - "\x1f,\x03E\x00\x00\x1f\x9c" + // 0x1F2C0345: 0x00001F9C - "\x1f-\x03E\x00\x00\x1f\x9d" + // 0x1F2D0345: 0x00001F9D - "\x1f.\x03E\x00\x00\x1f\x9e" + // 0x1F2E0345: 0x00001F9E - "\x1f/\x03E\x00\x00\x1f\x9f" + // 0x1F2F0345: 0x00001F9F - "\x1f`\x03E\x00\x00\x1f\xa0" + // 0x1F600345: 0x00001FA0 - "\x1fa\x03E\x00\x00\x1f\xa1" + // 0x1F610345: 0x00001FA1 - "\x1fb\x03E\x00\x00\x1f\xa2" + // 0x1F620345: 0x00001FA2 - "\x1fc\x03E\x00\x00\x1f\xa3" + // 0x1F630345: 0x00001FA3 - "\x1fd\x03E\x00\x00\x1f\xa4" + // 0x1F640345: 0x00001FA4 - "\x1fe\x03E\x00\x00\x1f\xa5" + // 0x1F650345: 0x00001FA5 - "\x1ff\x03E\x00\x00\x1f\xa6" + // 0x1F660345: 0x00001FA6 - "\x1fg\x03E\x00\x00\x1f\xa7" + // 0x1F670345: 0x00001FA7 - "\x1fh\x03E\x00\x00\x1f\xa8" + // 0x1F680345: 0x00001FA8 - "\x1fi\x03E\x00\x00\x1f\xa9" + // 0x1F690345: 0x00001FA9 - "\x1fj\x03E\x00\x00\x1f\xaa" + // 0x1F6A0345: 0x00001FAA - "\x1fk\x03E\x00\x00\x1f\xab" + // 0x1F6B0345: 0x00001FAB - "\x1fl\x03E\x00\x00\x1f\xac" + // 0x1F6C0345: 0x00001FAC - "\x1fm\x03E\x00\x00\x1f\xad" + // 0x1F6D0345: 0x00001FAD - "\x1fn\x03E\x00\x00\x1f\xae" + // 0x1F6E0345: 0x00001FAE - "\x1fo\x03E\x00\x00\x1f\xaf" + // 0x1F6F0345: 0x00001FAF - "\x03\xb1\x03\x06\x00\x00\x1f\xb0" + // 0x03B10306: 0x00001FB0 - "\x03\xb1\x03\x04\x00\x00\x1f\xb1" + // 0x03B10304: 0x00001FB1 - "\x1fp\x03E\x00\x00\x1f\xb2" + // 0x1F700345: 0x00001FB2 - "\x03\xb1\x03E\x00\x00\x1f\xb3" + // 0x03B10345: 0x00001FB3 - "\x03\xac\x03E\x00\x00\x1f\xb4" + // 0x03AC0345: 0x00001FB4 - "\x03\xb1\x03B\x00\x00\x1f\xb6" + // 0x03B10342: 0x00001FB6 - "\x1f\xb6\x03E\x00\x00\x1f\xb7" + // 0x1FB60345: 0x00001FB7 - "\x03\x91\x03\x06\x00\x00\x1f\xb8" + // 0x03910306: 0x00001FB8 - "\x03\x91\x03\x04\x00\x00\x1f\xb9" + // 0x03910304: 0x00001FB9 - "\x03\x91\x03\x00\x00\x00\x1f\xba" + // 0x03910300: 0x00001FBA - "\x03\x91\x03E\x00\x00\x1f\xbc" + // 0x03910345: 0x00001FBC - "\x00\xa8\x03B\x00\x00\x1f\xc1" + // 0x00A80342: 0x00001FC1 - "\x1ft\x03E\x00\x00\x1f\xc2" + // 0x1F740345: 0x00001FC2 - "\x03\xb7\x03E\x00\x00\x1f\xc3" + // 0x03B70345: 0x00001FC3 - "\x03\xae\x03E\x00\x00\x1f\xc4" + // 0x03AE0345: 0x00001FC4 - "\x03\xb7\x03B\x00\x00\x1f\xc6" + // 0x03B70342: 0x00001FC6 - "\x1f\xc6\x03E\x00\x00\x1f\xc7" + // 0x1FC60345: 0x00001FC7 - "\x03\x95\x03\x00\x00\x00\x1f\xc8" + // 0x03950300: 0x00001FC8 - "\x03\x97\x03\x00\x00\x00\x1f\xca" + // 0x03970300: 0x00001FCA - "\x03\x97\x03E\x00\x00\x1f\xcc" + // 0x03970345: 0x00001FCC - "\x1f\xbf\x03\x00\x00\x00\x1f\xcd" + // 0x1FBF0300: 0x00001FCD - "\x1f\xbf\x03\x01\x00\x00\x1f\xce" + // 0x1FBF0301: 0x00001FCE - "\x1f\xbf\x03B\x00\x00\x1f\xcf" + // 0x1FBF0342: 0x00001FCF - "\x03\xb9\x03\x06\x00\x00\x1f\xd0" + // 0x03B90306: 0x00001FD0 - "\x03\xb9\x03\x04\x00\x00\x1f\xd1" + // 0x03B90304: 0x00001FD1 - "\x03\xca\x03\x00\x00\x00\x1f\xd2" + // 0x03CA0300: 0x00001FD2 - "\x03\xb9\x03B\x00\x00\x1f\xd6" + // 0x03B90342: 0x00001FD6 - "\x03\xca\x03B\x00\x00\x1f\xd7" + // 0x03CA0342: 0x00001FD7 - "\x03\x99\x03\x06\x00\x00\x1f\xd8" + // 0x03990306: 0x00001FD8 - "\x03\x99\x03\x04\x00\x00\x1f\xd9" + // 0x03990304: 0x00001FD9 - "\x03\x99\x03\x00\x00\x00\x1f\xda" + // 0x03990300: 0x00001FDA - "\x1f\xfe\x03\x00\x00\x00\x1f\xdd" + // 0x1FFE0300: 0x00001FDD - "\x1f\xfe\x03\x01\x00\x00\x1f\xde" + // 0x1FFE0301: 0x00001FDE - "\x1f\xfe\x03B\x00\x00\x1f\xdf" + // 0x1FFE0342: 0x00001FDF - "\x03\xc5\x03\x06\x00\x00\x1f\xe0" + // 0x03C50306: 0x00001FE0 - "\x03\xc5\x03\x04\x00\x00\x1f\xe1" + // 0x03C50304: 0x00001FE1 - "\x03\xcb\x03\x00\x00\x00\x1f\xe2" + // 0x03CB0300: 0x00001FE2 - "\x03\xc1\x03\x13\x00\x00\x1f\xe4" + // 0x03C10313: 0x00001FE4 - "\x03\xc1\x03\x14\x00\x00\x1f\xe5" + // 0x03C10314: 0x00001FE5 - "\x03\xc5\x03B\x00\x00\x1f\xe6" + // 0x03C50342: 0x00001FE6 - "\x03\xcb\x03B\x00\x00\x1f\xe7" + // 0x03CB0342: 0x00001FE7 - "\x03\xa5\x03\x06\x00\x00\x1f\xe8" + // 0x03A50306: 0x00001FE8 - "\x03\xa5\x03\x04\x00\x00\x1f\xe9" + // 0x03A50304: 0x00001FE9 - "\x03\xa5\x03\x00\x00\x00\x1f\xea" + // 0x03A50300: 0x00001FEA - "\x03\xa1\x03\x14\x00\x00\x1f\xec" + // 0x03A10314: 0x00001FEC - "\x00\xa8\x03\x00\x00\x00\x1f\xed" + // 0x00A80300: 0x00001FED - "\x1f|\x03E\x00\x00\x1f\xf2" + // 0x1F7C0345: 0x00001FF2 - "\x03\xc9\x03E\x00\x00\x1f\xf3" + // 0x03C90345: 0x00001FF3 - "\x03\xce\x03E\x00\x00\x1f\xf4" + // 0x03CE0345: 0x00001FF4 - "\x03\xc9\x03B\x00\x00\x1f\xf6" + // 0x03C90342: 0x00001FF6 - "\x1f\xf6\x03E\x00\x00\x1f\xf7" + // 0x1FF60345: 0x00001FF7 - "\x03\x9f\x03\x00\x00\x00\x1f\xf8" + // 0x039F0300: 0x00001FF8 - "\x03\xa9\x03\x00\x00\x00\x1f\xfa" + // 0x03A90300: 0x00001FFA - "\x03\xa9\x03E\x00\x00\x1f\xfc" + // 0x03A90345: 0x00001FFC - "!\x90\x038\x00\x00!\x9a" + // 0x21900338: 0x0000219A - "!\x92\x038\x00\x00!\x9b" + // 0x21920338: 0x0000219B - "!\x94\x038\x00\x00!\xae" + // 0x21940338: 0x000021AE - "!\xd0\x038\x00\x00!\xcd" + // 0x21D00338: 0x000021CD - "!\xd4\x038\x00\x00!\xce" + // 0x21D40338: 0x000021CE - "!\xd2\x038\x00\x00!\xcf" + // 0x21D20338: 0x000021CF - "\"\x03\x038\x00\x00\"\x04" + // 0x22030338: 0x00002204 - "\"\b\x038\x00\x00\"\t" + // 0x22080338: 0x00002209 - "\"\v\x038\x00\x00\"\f" + // 0x220B0338: 0x0000220C - "\"#\x038\x00\x00\"$" + // 0x22230338: 0x00002224 - "\"%\x038\x00\x00\"&" + // 0x22250338: 0x00002226 - "\"<\x038\x00\x00\"A" + // 0x223C0338: 0x00002241 - "\"C\x038\x00\x00\"D" + // 0x22430338: 0x00002244 - "\"E\x038\x00\x00\"G" + // 0x22450338: 0x00002247 - "\"H\x038\x00\x00\"I" + // 0x22480338: 0x00002249 - "\x00=\x038\x00\x00\"`" + // 0x003D0338: 0x00002260 - "\"a\x038\x00\x00\"b" + // 0x22610338: 0x00002262 - "\"M\x038\x00\x00\"m" + // 0x224D0338: 0x0000226D - "\x00<\x038\x00\x00\"n" + // 0x003C0338: 0x0000226E - "\x00>\x038\x00\x00\"o" + // 0x003E0338: 0x0000226F - "\"d\x038\x00\x00\"p" + // 0x22640338: 0x00002270 - "\"e\x038\x00\x00\"q" + // 0x22650338: 0x00002271 - "\"r\x038\x00\x00\"t" + // 0x22720338: 0x00002274 - "\"s\x038\x00\x00\"u" + // 0x22730338: 0x00002275 - "\"v\x038\x00\x00\"x" + // 0x22760338: 0x00002278 - "\"w\x038\x00\x00\"y" + // 0x22770338: 0x00002279 - "\"z\x038\x00\x00\"\x80" + // 0x227A0338: 0x00002280 - "\"{\x038\x00\x00\"\x81" + // 0x227B0338: 0x00002281 - "\"\x82\x038\x00\x00\"\x84" + // 0x22820338: 0x00002284 - "\"\x83\x038\x00\x00\"\x85" + // 0x22830338: 0x00002285 - "\"\x86\x038\x00\x00\"\x88" + // 0x22860338: 0x00002288 - "\"\x87\x038\x00\x00\"\x89" + // 0x22870338: 0x00002289 - "\"\xa2\x038\x00\x00\"\xac" + // 0x22A20338: 0x000022AC - "\"\xa8\x038\x00\x00\"\xad" + // 0x22A80338: 0x000022AD - "\"\xa9\x038\x00\x00\"\xae" + // 0x22A90338: 0x000022AE - "\"\xab\x038\x00\x00\"\xaf" + // 0x22AB0338: 0x000022AF - "\"|\x038\x00\x00\"\xe0" + // 0x227C0338: 0x000022E0 - "\"}\x038\x00\x00\"\xe1" + // 0x227D0338: 0x000022E1 - "\"\x91\x038\x00\x00\"\xe2" + // 0x22910338: 0x000022E2 - "\"\x92\x038\x00\x00\"\xe3" + // 0x22920338: 0x000022E3 - "\"\xb2\x038\x00\x00\"\xea" + // 0x22B20338: 0x000022EA - "\"\xb3\x038\x00\x00\"\xeb" + // 0x22B30338: 0x000022EB - "\"\xb4\x038\x00\x00\"\xec" + // 0x22B40338: 0x000022EC - "\"\xb5\x038\x00\x00\"\xed" + // 0x22B50338: 0x000022ED - "0K0\x99\x00\x000L" + // 0x304B3099: 0x0000304C - "0M0\x99\x00\x000N" + // 0x304D3099: 0x0000304E - "0O0\x99\x00\x000P" + // 0x304F3099: 0x00003050 - "0Q0\x99\x00\x000R" + // 0x30513099: 0x00003052 - "0S0\x99\x00\x000T" + // 0x30533099: 0x00003054 - "0U0\x99\x00\x000V" + // 0x30553099: 0x00003056 - "0W0\x99\x00\x000X" + // 0x30573099: 0x00003058 - "0Y0\x99\x00\x000Z" + // 0x30593099: 0x0000305A - "0[0\x99\x00\x000\\" + // 0x305B3099: 0x0000305C - "0]0\x99\x00\x000^" + // 0x305D3099: 0x0000305E - "0_0\x99\x00\x000`" + // 0x305F3099: 0x00003060 - "0a0\x99\x00\x000b" + // 0x30613099: 0x00003062 - "0d0\x99\x00\x000e" + // 0x30643099: 0x00003065 - "0f0\x99\x00\x000g" + // 0x30663099: 0x00003067 - "0h0\x99\x00\x000i" + // 0x30683099: 0x00003069 - "0o0\x99\x00\x000p" + // 0x306F3099: 0x00003070 - "0o0\x9a\x00\x000q" + // 0x306F309A: 0x00003071 - "0r0\x99\x00\x000s" + // 0x30723099: 0x00003073 - "0r0\x9a\x00\x000t" + // 0x3072309A: 0x00003074 - "0u0\x99\x00\x000v" + // 0x30753099: 0x00003076 - "0u0\x9a\x00\x000w" + // 0x3075309A: 0x00003077 - "0x0\x99\x00\x000y" + // 0x30783099: 0x00003079 - "0x0\x9a\x00\x000z" + // 0x3078309A: 0x0000307A - "0{0\x99\x00\x000|" + // 0x307B3099: 0x0000307C - "0{0\x9a\x00\x000}" + // 0x307B309A: 0x0000307D - "0F0\x99\x00\x000\x94" + // 0x30463099: 0x00003094 - "0\x9d0\x99\x00\x000\x9e" + // 0x309D3099: 0x0000309E - "0\xab0\x99\x00\x000\xac" + // 0x30AB3099: 0x000030AC - "0\xad0\x99\x00\x000\xae" + // 0x30AD3099: 0x000030AE - "0\xaf0\x99\x00\x000\xb0" + // 0x30AF3099: 0x000030B0 - "0\xb10\x99\x00\x000\xb2" + // 0x30B13099: 0x000030B2 - "0\xb30\x99\x00\x000\xb4" + // 0x30B33099: 0x000030B4 - "0\xb50\x99\x00\x000\xb6" + // 0x30B53099: 0x000030B6 - "0\xb70\x99\x00\x000\xb8" + // 0x30B73099: 0x000030B8 - "0\xb90\x99\x00\x000\xba" + // 0x30B93099: 0x000030BA - "0\xbb0\x99\x00\x000\xbc" + // 0x30BB3099: 0x000030BC - "0\xbd0\x99\x00\x000\xbe" + // 0x30BD3099: 0x000030BE - "0\xbf0\x99\x00\x000\xc0" + // 0x30BF3099: 0x000030C0 - "0\xc10\x99\x00\x000\xc2" + // 0x30C13099: 0x000030C2 - "0\xc40\x99\x00\x000\xc5" + // 0x30C43099: 0x000030C5 - "0\xc60\x99\x00\x000\xc7" + // 0x30C63099: 0x000030C7 - "0\xc80\x99\x00\x000\xc9" + // 0x30C83099: 0x000030C9 - "0\xcf0\x99\x00\x000\xd0" + // 0x30CF3099: 0x000030D0 - "0\xcf0\x9a\x00\x000\xd1" + // 0x30CF309A: 0x000030D1 - "0\xd20\x99\x00\x000\xd3" + // 0x30D23099: 0x000030D3 - "0\xd20\x9a\x00\x000\xd4" + // 0x30D2309A: 0x000030D4 - "0\xd50\x99\x00\x000\xd6" + // 0x30D53099: 0x000030D6 - "0\xd50\x9a\x00\x000\xd7" + // 0x30D5309A: 0x000030D7 - "0\xd80\x99\x00\x000\xd9" + // 0x30D83099: 0x000030D9 - "0\xd80\x9a\x00\x000\xda" + // 0x30D8309A: 0x000030DA - "0\xdb0\x99\x00\x000\xdc" + // 0x30DB3099: 0x000030DC - "0\xdb0\x9a\x00\x000\xdd" + // 0x30DB309A: 0x000030DD - "0\xa60\x99\x00\x000\xf4" + // 0x30A63099: 0x000030F4 - "0\xef0\x99\x00\x000\xf7" + // 0x30EF3099: 0x000030F7 - "0\xf00\x99\x00\x000\xf8" + // 0x30F03099: 0x000030F8 - "0\xf10\x99\x00\x000\xf9" + // 0x30F13099: 0x000030F9 - "0\xf20\x99\x00\x000\xfa" + // 0x30F23099: 0x000030FA - "0\xfd0\x99\x00\x000\xfe" + // 0x30FD3099: 0x000030FE - "\x10\x99\x10\xba\x00\x01\x10\x9a" + // 0x109910BA: 0x0001109A - "\x10\x9b\x10\xba\x00\x01\x10\x9c" + // 0x109B10BA: 0x0001109C - "\x10\xa5\x10\xba\x00\x01\x10\xab" + // 0x10A510BA: 0x000110AB - "\x111\x11'\x00\x01\x11." + // 0x11311127: 0x0001112E - "\x112\x11'\x00\x01\x11/" + // 0x11321127: 0x0001112F - "\x13G\x13>\x00\x01\x13K" + // 0x1347133E: 0x0001134B - "\x13G\x13W\x00\x01\x13L" + // 0x13471357: 0x0001134C - "\x14\xb9\x14\xba\x00\x01\x14\xbb" + // 0x14B914BA: 0x000114BB - "\x14\xb9\x14\xb0\x00\x01\x14\xbc" + // 0x14B914B0: 0x000114BC - "\x14\xb9\x14\xbd\x00\x01\x14\xbe" + // 0x14B914BD: 0x000114BE - "\x15\xb8\x15\xaf\x00\x01\x15\xba" + // 0x15B815AF: 0x000115BA - "\x15\xb9\x15\xaf\x00\x01\x15\xbb" + // 0x15B915AF: 0x000115BB - "\x195\x190\x00\x01\x198" + // 0x19351930: 0x00011938 - "" - // Total size of tables: 55KB (56160 bytes) diff --git a/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go index 0175eae50a..9429069291 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go @@ -1,6 +1,5 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -//go:build !go1.10 // +build !go1.10 package norm diff --git a/vendor/golang.org/x/tools/AUTHORS b/vendor/golang.org/x/tools/AUTHORS new file mode 100644 index 0000000000..15167cd746 --- /dev/null +++ b/vendor/golang.org/x/tools/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/tools/CONTRIBUTORS b/vendor/golang.org/x/tools/CONTRIBUTORS new file mode 100644 index 0000000000..1c4577e968 --- /dev/null +++ b/vendor/golang.org/x/tools/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/tools/LICENSE b/vendor/golang.org/x/tools/LICENSE new file mode 100644 index 0000000000..6a66aea5ea --- /dev/null +++ b/vendor/golang.org/x/tools/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/tools/PATENTS b/vendor/golang.org/x/tools/PATENTS new file mode 100644 index 0000000000..733099041f --- /dev/null +++ b/vendor/golang.org/x/tools/PATENTS @@ -0,0 +1,22 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the Go project. + +Google hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable (except as stated in this section) +patent license to make, have made, use, offer to sell, sell, import, +transfer and otherwise run, modify and propagate the contents of this +implementation of Go, where such license applies only to those patent +claims, both currently owned or controlled by Google and acquired in +the future, licensable by Google that are necessarily infringed by this +implementation of Go. This grant does not include claims that would be +infringed only as a consequence of further modification of this +implementation. If you or your agent or exclusive licensee institute or +order or agree to the institution of patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging +that this implementation of Go or any code incorporated within this +implementation of Go constitutes direct or contributory patent +infringement, or inducement of patent infringement, then any patent +rights granted to you under this License for this implementation of Go +shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go b/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go new file mode 100644 index 0000000000..f8363d8faa --- /dev/null +++ b/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go @@ -0,0 +1,109 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package gcexportdata provides functions for locating, reading, and +// writing export data files containing type information produced by the +// gc compiler. This package supports go1.7 export data format and all +// later versions. +// +// Although it might seem convenient for this package to live alongside +// go/types in the standard library, this would cause version skew +// problems for developer tools that use it, since they must be able to +// consume the outputs of the gc compiler both before and after a Go +// update such as from Go 1.7 to Go 1.8. Because this package lives in +// golang.org/x/tools, sites can update their version of this repo some +// time before the Go 1.8 release and rebuild and redeploy their +// developer tools, which will then be able to consume both Go 1.7 and +// Go 1.8 export data files, so they will work before and after the +// Go update. (See discussion at https://golang.org/issue/15651.) +// +package gcexportdata // import "golang.org/x/tools/go/gcexportdata" + +import ( + "bufio" + "bytes" + "fmt" + "go/token" + "go/types" + "io" + "io/ioutil" + + "golang.org/x/tools/go/internal/gcimporter" +) + +// Find returns the name of an object (.o) or archive (.a) file +// containing type information for the specified import path, +// using the workspace layout conventions of go/build. +// If no file was found, an empty filename is returned. +// +// A relative srcDir is interpreted relative to the current working directory. +// +// Find also returns the package's resolved (canonical) import path, +// reflecting the effects of srcDir and vendoring on importPath. +func Find(importPath, srcDir string) (filename, path string) { + return gcimporter.FindPkg(importPath, srcDir) +} + +// NewReader returns a reader for the export data section of an object +// (.o) or archive (.a) file read from r. The new reader may provide +// additional trailing data beyond the end of the export data. +func NewReader(r io.Reader) (io.Reader, error) { + buf := bufio.NewReader(r) + _, err := gcimporter.FindExportData(buf) + // If we ever switch to a zip-like archive format with the ToC + // at the end, we can return the correct portion of export data, + // but for now we must return the entire rest of the file. + return buf, err +} + +// Read reads export data from in, decodes it, and returns type +// information for the package. +// The package name is specified by path. +// File position information is added to fset. +// +// Read may inspect and add to the imports map to ensure that references +// within the export data to other packages are consistent. The caller +// must ensure that imports[path] does not exist, or exists but is +// incomplete (see types.Package.Complete), and Read inserts the +// resulting package into this map entry. +// +// On return, the state of the reader is undefined. +func Read(in io.Reader, fset *token.FileSet, imports map[string]*types.Package, path string) (*types.Package, error) { + data, err := ioutil.ReadAll(in) + if err != nil { + return nil, fmt.Errorf("reading export data for %q: %v", path, err) + } + + if bytes.HasPrefix(data, []byte("!")) { + return nil, fmt.Errorf("can't read export data for %q directly from an archive file (call gcexportdata.NewReader first to extract export data)", path) + } + + // The App Engine Go runtime v1.6 uses the old export data format. + // TODO(adonovan): delete once v1.7 has been around for a while. + if bytes.HasPrefix(data, []byte("package ")) { + return gcimporter.ImportData(imports, path, path, bytes.NewReader(data)) + } + + // The indexed export format starts with an 'i'; the older + // binary export format starts with a 'c', 'd', or 'v' + // (from "version"). Select appropriate importer. + if len(data) > 0 && data[0] == 'i' { + _, pkg, err := gcimporter.IImportData(fset, imports, data[1:], path) + return pkg, err + } + + _, pkg, err := gcimporter.BImportData(fset, imports, data, path) + return pkg, err +} + +// Write writes encoded type information for the specified package to out. +// The FileSet provides file position information for named objects. +func Write(out io.Writer, fset *token.FileSet, pkg *types.Package) error { + b, err := gcimporter.IExportData(fset, pkg) + if err != nil { + return err + } + _, err = out.Write(b) + return err +} diff --git a/vendor/golang.org/x/tools/go/gcexportdata/importer.go b/vendor/golang.org/x/tools/go/gcexportdata/importer.go new file mode 100644 index 0000000000..efe221e7e1 --- /dev/null +++ b/vendor/golang.org/x/tools/go/gcexportdata/importer.go @@ -0,0 +1,73 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gcexportdata + +import ( + "fmt" + "go/token" + "go/types" + "os" +) + +// NewImporter returns a new instance of the types.Importer interface +// that reads type information from export data files written by gc. +// The Importer also satisfies types.ImporterFrom. +// +// Export data files are located using "go build" workspace conventions +// and the build.Default context. +// +// Use this importer instead of go/importer.For("gc", ...) to avoid the +// version-skew problems described in the documentation of this package, +// or to control the FileSet or access the imports map populated during +// package loading. +// +func NewImporter(fset *token.FileSet, imports map[string]*types.Package) types.ImporterFrom { + return importer{fset, imports} +} + +type importer struct { + fset *token.FileSet + imports map[string]*types.Package +} + +func (imp importer) Import(importPath string) (*types.Package, error) { + return imp.ImportFrom(importPath, "", 0) +} + +func (imp importer) ImportFrom(importPath, srcDir string, mode types.ImportMode) (_ *types.Package, err error) { + filename, path := Find(importPath, srcDir) + if filename == "" { + if importPath == "unsafe" { + // Even for unsafe, call Find first in case + // the package was vendored. + return types.Unsafe, nil + } + return nil, fmt.Errorf("can't find import: %s", importPath) + } + + if pkg, ok := imp.imports[path]; ok && pkg.Complete() { + return pkg, nil // cache hit + } + + // open file + f, err := os.Open(filename) + if err != nil { + return nil, err + } + defer func() { + f.Close() + if err != nil { + // add file name to error + err = fmt.Errorf("reading export data: %s: %v", filename, err) + } + }() + + r, err := NewReader(f) + if err != nil { + return nil, err + } + + return Read(r, imp.fset, imp.imports, path) +} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go b/vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go new file mode 100644 index 0000000000..a807d0aaa2 --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go @@ -0,0 +1,852 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Binary package export. +// This file was derived from $GOROOT/src/cmd/compile/internal/gc/bexport.go; +// see that file for specification of the format. + +package gcimporter + +import ( + "bytes" + "encoding/binary" + "fmt" + "go/ast" + "go/constant" + "go/token" + "go/types" + "math" + "math/big" + "sort" + "strings" +) + +// If debugFormat is set, each integer and string value is preceded by a marker +// and position information in the encoding. This mechanism permits an importer +// to recognize immediately when it is out of sync. The importer recognizes this +// mode automatically (i.e., it can import export data produced with debugging +// support even if debugFormat is not set at the time of import). This mode will +// lead to massively larger export data (by a factor of 2 to 3) and should only +// be enabled during development and debugging. +// +// NOTE: This flag is the first flag to enable if importing dies because of +// (suspected) format errors, and whenever a change is made to the format. +const debugFormat = false // default: false + +// If trace is set, debugging output is printed to std out. +const trace = false // default: false + +// Current export format version. Increase with each format change. +// Note: The latest binary (non-indexed) export format is at version 6. +// This exporter is still at level 4, but it doesn't matter since +// the binary importer can handle older versions just fine. +// 6: package height (CL 105038) -- NOT IMPLEMENTED HERE +// 5: improved position encoding efficiency (issue 20080, CL 41619) -- NOT IMPLEMEMTED HERE +// 4: type name objects support type aliases, uses aliasTag +// 3: Go1.8 encoding (same as version 2, aliasTag defined but never used) +// 2: removed unused bool in ODCL export (compiler only) +// 1: header format change (more regular), export package for _ struct fields +// 0: Go1.7 encoding +const exportVersion = 4 + +// trackAllTypes enables cycle tracking for all types, not just named +// types. The existing compiler invariants assume that unnamed types +// that are not completely set up are not used, or else there are spurious +// errors. +// If disabled, only named types are tracked, possibly leading to slightly +// less efficient encoding in rare cases. It also prevents the export of +// some corner-case type declarations (but those are not handled correctly +// with with the textual export format either). +// TODO(gri) enable and remove once issues caused by it are fixed +const trackAllTypes = false + +type exporter struct { + fset *token.FileSet + out bytes.Buffer + + // object -> index maps, indexed in order of serialization + strIndex map[string]int + pkgIndex map[*types.Package]int + typIndex map[types.Type]int + + // position encoding + posInfoFormat bool + prevFile string + prevLine int + + // debugging support + written int // bytes written + indent int // for trace +} + +// internalError represents an error generated inside this package. +type internalError string + +func (e internalError) Error() string { return "gcimporter: " + string(e) } + +func internalErrorf(format string, args ...interface{}) error { + return internalError(fmt.Sprintf(format, args...)) +} + +// BExportData returns binary export data for pkg. +// If no file set is provided, position info will be missing. +func BExportData(fset *token.FileSet, pkg *types.Package) (b []byte, err error) { + defer func() { + if e := recover(); e != nil { + if ierr, ok := e.(internalError); ok { + err = ierr + return + } + // Not an internal error; panic again. + panic(e) + } + }() + + p := exporter{ + fset: fset, + strIndex: map[string]int{"": 0}, // empty string is mapped to 0 + pkgIndex: make(map[*types.Package]int), + typIndex: make(map[types.Type]int), + posInfoFormat: true, // TODO(gri) might become a flag, eventually + } + + // write version info + // The version string must start with "version %d" where %d is the version + // number. Additional debugging information may follow after a blank; that + // text is ignored by the importer. + p.rawStringln(fmt.Sprintf("version %d", exportVersion)) + var debug string + if debugFormat { + debug = "debug" + } + p.rawStringln(debug) // cannot use p.bool since it's affected by debugFormat; also want to see this clearly + p.bool(trackAllTypes) + p.bool(p.posInfoFormat) + + // --- generic export data --- + + // populate type map with predeclared "known" types + for index, typ := range predeclared() { + p.typIndex[typ] = index + } + if len(p.typIndex) != len(predeclared()) { + return nil, internalError("duplicate entries in type map?") + } + + // write package data + p.pkg(pkg, true) + if trace { + p.tracef("\n") + } + + // write objects + objcount := 0 + scope := pkg.Scope() + for _, name := range scope.Names() { + if !ast.IsExported(name) { + continue + } + if trace { + p.tracef("\n") + } + p.obj(scope.Lookup(name)) + objcount++ + } + + // indicate end of list + if trace { + p.tracef("\n") + } + p.tag(endTag) + + // for self-verification only (redundant) + p.int(objcount) + + if trace { + p.tracef("\n") + } + + // --- end of export data --- + + return p.out.Bytes(), nil +} + +func (p *exporter) pkg(pkg *types.Package, emptypath bool) { + if pkg == nil { + panic(internalError("unexpected nil pkg")) + } + + // if we saw the package before, write its index (>= 0) + if i, ok := p.pkgIndex[pkg]; ok { + p.index('P', i) + return + } + + // otherwise, remember the package, write the package tag (< 0) and package data + if trace { + p.tracef("P%d = { ", len(p.pkgIndex)) + defer p.tracef("} ") + } + p.pkgIndex[pkg] = len(p.pkgIndex) + + p.tag(packageTag) + p.string(pkg.Name()) + if emptypath { + p.string("") + } else { + p.string(pkg.Path()) + } +} + +func (p *exporter) obj(obj types.Object) { + switch obj := obj.(type) { + case *types.Const: + p.tag(constTag) + p.pos(obj) + p.qualifiedName(obj) + p.typ(obj.Type()) + p.value(obj.Val()) + + case *types.TypeName: + if obj.IsAlias() { + p.tag(aliasTag) + p.pos(obj) + p.qualifiedName(obj) + } else { + p.tag(typeTag) + } + p.typ(obj.Type()) + + case *types.Var: + p.tag(varTag) + p.pos(obj) + p.qualifiedName(obj) + p.typ(obj.Type()) + + case *types.Func: + p.tag(funcTag) + p.pos(obj) + p.qualifiedName(obj) + sig := obj.Type().(*types.Signature) + p.paramList(sig.Params(), sig.Variadic()) + p.paramList(sig.Results(), false) + + default: + panic(internalErrorf("unexpected object %v (%T)", obj, obj)) + } +} + +func (p *exporter) pos(obj types.Object) { + if !p.posInfoFormat { + return + } + + file, line := p.fileLine(obj) + if file == p.prevFile { + // common case: write line delta + // delta == 0 means different file or no line change + delta := line - p.prevLine + p.int(delta) + if delta == 0 { + p.int(-1) // -1 means no file change + } + } else { + // different file + p.int(0) + // Encode filename as length of common prefix with previous + // filename, followed by (possibly empty) suffix. Filenames + // frequently share path prefixes, so this can save a lot + // of space and make export data size less dependent on file + // path length. The suffix is unlikely to be empty because + // file names tend to end in ".go". + n := commonPrefixLen(p.prevFile, file) + p.int(n) // n >= 0 + p.string(file[n:]) // write suffix only + p.prevFile = file + p.int(line) + } + p.prevLine = line +} + +func (p *exporter) fileLine(obj types.Object) (file string, line int) { + if p.fset != nil { + pos := p.fset.Position(obj.Pos()) + file = pos.Filename + line = pos.Line + } + return +} + +func commonPrefixLen(a, b string) int { + if len(a) > len(b) { + a, b = b, a + } + // len(a) <= len(b) + i := 0 + for i < len(a) && a[i] == b[i] { + i++ + } + return i +} + +func (p *exporter) qualifiedName(obj types.Object) { + p.string(obj.Name()) + p.pkg(obj.Pkg(), false) +} + +func (p *exporter) typ(t types.Type) { + if t == nil { + panic(internalError("nil type")) + } + + // Possible optimization: Anonymous pointer types *T where + // T is a named type are common. We could canonicalize all + // such types *T to a single type PT = *T. This would lead + // to at most one *T entry in typIndex, and all future *T's + // would be encoded as the respective index directly. Would + // save 1 byte (pointerTag) per *T and reduce the typIndex + // size (at the cost of a canonicalization map). We can do + // this later, without encoding format change. + + // if we saw the type before, write its index (>= 0) + if i, ok := p.typIndex[t]; ok { + p.index('T', i) + return + } + + // otherwise, remember the type, write the type tag (< 0) and type data + if trackAllTypes { + if trace { + p.tracef("T%d = {>\n", len(p.typIndex)) + defer p.tracef("<\n} ") + } + p.typIndex[t] = len(p.typIndex) + } + + switch t := t.(type) { + case *types.Named: + if !trackAllTypes { + // if we don't track all types, track named types now + p.typIndex[t] = len(p.typIndex) + } + + p.tag(namedTag) + p.pos(t.Obj()) + p.qualifiedName(t.Obj()) + p.typ(t.Underlying()) + if !types.IsInterface(t) { + p.assocMethods(t) + } + + case *types.Array: + p.tag(arrayTag) + p.int64(t.Len()) + p.typ(t.Elem()) + + case *types.Slice: + p.tag(sliceTag) + p.typ(t.Elem()) + + case *dddSlice: + p.tag(dddTag) + p.typ(t.elem) + + case *types.Struct: + p.tag(structTag) + p.fieldList(t) + + case *types.Pointer: + p.tag(pointerTag) + p.typ(t.Elem()) + + case *types.Signature: + p.tag(signatureTag) + p.paramList(t.Params(), t.Variadic()) + p.paramList(t.Results(), false) + + case *types.Interface: + p.tag(interfaceTag) + p.iface(t) + + case *types.Map: + p.tag(mapTag) + p.typ(t.Key()) + p.typ(t.Elem()) + + case *types.Chan: + p.tag(chanTag) + p.int(int(3 - t.Dir())) // hack + p.typ(t.Elem()) + + default: + panic(internalErrorf("unexpected type %T: %s", t, t)) + } +} + +func (p *exporter) assocMethods(named *types.Named) { + // Sort methods (for determinism). + var methods []*types.Func + for i := 0; i < named.NumMethods(); i++ { + methods = append(methods, named.Method(i)) + } + sort.Sort(methodsByName(methods)) + + p.int(len(methods)) + + if trace && methods != nil { + p.tracef("associated methods {>\n") + } + + for i, m := range methods { + if trace && i > 0 { + p.tracef("\n") + } + + p.pos(m) + name := m.Name() + p.string(name) + if !exported(name) { + p.pkg(m.Pkg(), false) + } + + sig := m.Type().(*types.Signature) + p.paramList(types.NewTuple(sig.Recv()), false) + p.paramList(sig.Params(), sig.Variadic()) + p.paramList(sig.Results(), false) + p.int(0) // dummy value for go:nointerface pragma - ignored by importer + } + + if trace && methods != nil { + p.tracef("<\n} ") + } +} + +type methodsByName []*types.Func + +func (x methodsByName) Len() int { return len(x) } +func (x methodsByName) Swap(i, j int) { x[i], x[j] = x[j], x[i] } +func (x methodsByName) Less(i, j int) bool { return x[i].Name() < x[j].Name() } + +func (p *exporter) fieldList(t *types.Struct) { + if trace && t.NumFields() > 0 { + p.tracef("fields {>\n") + defer p.tracef("<\n} ") + } + + p.int(t.NumFields()) + for i := 0; i < t.NumFields(); i++ { + if trace && i > 0 { + p.tracef("\n") + } + p.field(t.Field(i)) + p.string(t.Tag(i)) + } +} + +func (p *exporter) field(f *types.Var) { + if !f.IsField() { + panic(internalError("field expected")) + } + + p.pos(f) + p.fieldName(f) + p.typ(f.Type()) +} + +func (p *exporter) iface(t *types.Interface) { + // TODO(gri): enable importer to load embedded interfaces, + // then emit Embeddeds and ExplicitMethods separately here. + p.int(0) + + n := t.NumMethods() + if trace && n > 0 { + p.tracef("methods {>\n") + defer p.tracef("<\n} ") + } + p.int(n) + for i := 0; i < n; i++ { + if trace && i > 0 { + p.tracef("\n") + } + p.method(t.Method(i)) + } +} + +func (p *exporter) method(m *types.Func) { + sig := m.Type().(*types.Signature) + if sig.Recv() == nil { + panic(internalError("method expected")) + } + + p.pos(m) + p.string(m.Name()) + if m.Name() != "_" && !ast.IsExported(m.Name()) { + p.pkg(m.Pkg(), false) + } + + // interface method; no need to encode receiver. + p.paramList(sig.Params(), sig.Variadic()) + p.paramList(sig.Results(), false) +} + +func (p *exporter) fieldName(f *types.Var) { + name := f.Name() + + if f.Anonymous() { + // anonymous field - we distinguish between 3 cases: + // 1) field name matches base type name and is exported + // 2) field name matches base type name and is not exported + // 3) field name doesn't match base type name (alias name) + bname := basetypeName(f.Type()) + if name == bname { + if ast.IsExported(name) { + name = "" // 1) we don't need to know the field name or package + } else { + name = "?" // 2) use unexported name "?" to force package export + } + } else { + // 3) indicate alias and export name as is + // (this requires an extra "@" but this is a rare case) + p.string("@") + } + } + + p.string(name) + if name != "" && !ast.IsExported(name) { + p.pkg(f.Pkg(), false) + } +} + +func basetypeName(typ types.Type) string { + switch typ := deref(typ).(type) { + case *types.Basic: + return typ.Name() + case *types.Named: + return typ.Obj().Name() + default: + return "" // unnamed type + } +} + +func (p *exporter) paramList(params *types.Tuple, variadic bool) { + // use negative length to indicate unnamed parameters + // (look at the first parameter only since either all + // names are present or all are absent) + n := params.Len() + if n > 0 && params.At(0).Name() == "" { + n = -n + } + p.int(n) + for i := 0; i < params.Len(); i++ { + q := params.At(i) + t := q.Type() + if variadic && i == params.Len()-1 { + t = &dddSlice{t.(*types.Slice).Elem()} + } + p.typ(t) + if n > 0 { + name := q.Name() + p.string(name) + if name != "_" { + p.pkg(q.Pkg(), false) + } + } + p.string("") // no compiler-specific info + } +} + +func (p *exporter) value(x constant.Value) { + if trace { + p.tracef("= ") + } + + switch x.Kind() { + case constant.Bool: + tag := falseTag + if constant.BoolVal(x) { + tag = trueTag + } + p.tag(tag) + + case constant.Int: + if v, exact := constant.Int64Val(x); exact { + // common case: x fits into an int64 - use compact encoding + p.tag(int64Tag) + p.int64(v) + return + } + // uncommon case: large x - use float encoding + // (powers of 2 will be encoded efficiently with exponent) + p.tag(floatTag) + p.float(constant.ToFloat(x)) + + case constant.Float: + p.tag(floatTag) + p.float(x) + + case constant.Complex: + p.tag(complexTag) + p.float(constant.Real(x)) + p.float(constant.Imag(x)) + + case constant.String: + p.tag(stringTag) + p.string(constant.StringVal(x)) + + case constant.Unknown: + // package contains type errors + p.tag(unknownTag) + + default: + panic(internalErrorf("unexpected value %v (%T)", x, x)) + } +} + +func (p *exporter) float(x constant.Value) { + if x.Kind() != constant.Float { + panic(internalErrorf("unexpected constant %v, want float", x)) + } + // extract sign (there is no -0) + sign := constant.Sign(x) + if sign == 0 { + // x == 0 + p.int(0) + return + } + // x != 0 + + var f big.Float + if v, exact := constant.Float64Val(x); exact { + // float64 + f.SetFloat64(v) + } else if num, denom := constant.Num(x), constant.Denom(x); num.Kind() == constant.Int { + // TODO(gri): add big.Rat accessor to constant.Value. + r := valueToRat(num) + f.SetRat(r.Quo(r, valueToRat(denom))) + } else { + // Value too large to represent as a fraction => inaccessible. + // TODO(gri): add big.Float accessor to constant.Value. + f.SetFloat64(math.MaxFloat64) // FIXME + } + + // extract exponent such that 0.5 <= m < 1.0 + var m big.Float + exp := f.MantExp(&m) + + // extract mantissa as *big.Int + // - set exponent large enough so mant satisfies mant.IsInt() + // - get *big.Int from mant + m.SetMantExp(&m, int(m.MinPrec())) + mant, acc := m.Int(nil) + if acc != big.Exact { + panic(internalError("internal error")) + } + + p.int(sign) + p.int(exp) + p.string(string(mant.Bytes())) +} + +func valueToRat(x constant.Value) *big.Rat { + // Convert little-endian to big-endian. + // I can't believe this is necessary. + bytes := constant.Bytes(x) + for i := 0; i < len(bytes)/2; i++ { + bytes[i], bytes[len(bytes)-1-i] = bytes[len(bytes)-1-i], bytes[i] + } + return new(big.Rat).SetInt(new(big.Int).SetBytes(bytes)) +} + +func (p *exporter) bool(b bool) bool { + if trace { + p.tracef("[") + defer p.tracef("= %v] ", b) + } + + x := 0 + if b { + x = 1 + } + p.int(x) + return b +} + +// ---------------------------------------------------------------------------- +// Low-level encoders + +func (p *exporter) index(marker byte, index int) { + if index < 0 { + panic(internalError("invalid index < 0")) + } + if debugFormat { + p.marker('t') + } + if trace { + p.tracef("%c%d ", marker, index) + } + p.rawInt64(int64(index)) +} + +func (p *exporter) tag(tag int) { + if tag >= 0 { + panic(internalError("invalid tag >= 0")) + } + if debugFormat { + p.marker('t') + } + if trace { + p.tracef("%s ", tagString[-tag]) + } + p.rawInt64(int64(tag)) +} + +func (p *exporter) int(x int) { + p.int64(int64(x)) +} + +func (p *exporter) int64(x int64) { + if debugFormat { + p.marker('i') + } + if trace { + p.tracef("%d ", x) + } + p.rawInt64(x) +} + +func (p *exporter) string(s string) { + if debugFormat { + p.marker('s') + } + if trace { + p.tracef("%q ", s) + } + // if we saw the string before, write its index (>= 0) + // (the empty string is mapped to 0) + if i, ok := p.strIndex[s]; ok { + p.rawInt64(int64(i)) + return + } + // otherwise, remember string and write its negative length and bytes + p.strIndex[s] = len(p.strIndex) + p.rawInt64(-int64(len(s))) + for i := 0; i < len(s); i++ { + p.rawByte(s[i]) + } +} + +// marker emits a marker byte and position information which makes +// it easy for a reader to detect if it is "out of sync". Used for +// debugFormat format only. +func (p *exporter) marker(m byte) { + p.rawByte(m) + // Enable this for help tracking down the location + // of an incorrect marker when running in debugFormat. + if false && trace { + p.tracef("#%d ", p.written) + } + p.rawInt64(int64(p.written)) +} + +// rawInt64 should only be used by low-level encoders. +func (p *exporter) rawInt64(x int64) { + var tmp [binary.MaxVarintLen64]byte + n := binary.PutVarint(tmp[:], x) + for i := 0; i < n; i++ { + p.rawByte(tmp[i]) + } +} + +// rawStringln should only be used to emit the initial version string. +func (p *exporter) rawStringln(s string) { + for i := 0; i < len(s); i++ { + p.rawByte(s[i]) + } + p.rawByte('\n') +} + +// rawByte is the bottleneck interface to write to p.out. +// rawByte escapes b as follows (any encoding does that +// hides '$'): +// +// '$' => '|' 'S' +// '|' => '|' '|' +// +// Necessary so other tools can find the end of the +// export data by searching for "$$". +// rawByte should only be used by low-level encoders. +func (p *exporter) rawByte(b byte) { + switch b { + case '$': + // write '$' as '|' 'S' + b = 'S' + fallthrough + case '|': + // write '|' as '|' '|' + p.out.WriteByte('|') + p.written++ + } + p.out.WriteByte(b) + p.written++ +} + +// tracef is like fmt.Printf but it rewrites the format string +// to take care of indentation. +func (p *exporter) tracef(format string, args ...interface{}) { + if strings.ContainsAny(format, "<>\n") { + var buf bytes.Buffer + for i := 0; i < len(format); i++ { + // no need to deal with runes + ch := format[i] + switch ch { + case '>': + p.indent++ + continue + case '<': + p.indent-- + continue + } + buf.WriteByte(ch) + if ch == '\n' { + for j := p.indent; j > 0; j-- { + buf.WriteString(". ") + } + } + } + format = buf.String() + } + fmt.Printf(format, args...) +} + +// Debugging support. +// (tagString is only used when tracing is enabled) +var tagString = [...]string{ + // Packages + -packageTag: "package", + + // Types + -namedTag: "named type", + -arrayTag: "array", + -sliceTag: "slice", + -dddTag: "ddd", + -structTag: "struct", + -pointerTag: "pointer", + -signatureTag: "signature", + -interfaceTag: "interface", + -mapTag: "map", + -chanTag: "chan", + + // Values + -falseTag: "false", + -trueTag: "true", + -int64Tag: "int64", + -floatTag: "float", + -fractionTag: "fraction", + -complexTag: "complex", + -stringTag: "string", + -unknownTag: "unknown", + + // Type aliases + -aliasTag: "alias", +} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go b/vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go new file mode 100644 index 0000000000..e9f73d14a1 --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go @@ -0,0 +1,1039 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file is a copy of $GOROOT/src/go/internal/gcimporter/bimport.go. + +package gcimporter + +import ( + "encoding/binary" + "fmt" + "go/constant" + "go/token" + "go/types" + "sort" + "strconv" + "strings" + "sync" + "unicode" + "unicode/utf8" +) + +type importer struct { + imports map[string]*types.Package + data []byte + importpath string + buf []byte // for reading strings + version int // export format version + + // object lists + strList []string // in order of appearance + pathList []string // in order of appearance + pkgList []*types.Package // in order of appearance + typList []types.Type // in order of appearance + interfaceList []*types.Interface // for delayed completion only + trackAllTypes bool + + // position encoding + posInfoFormat bool + prevFile string + prevLine int + fake fakeFileSet + + // debugging support + debugFormat bool + read int // bytes read +} + +// BImportData imports a package from the serialized package data +// and returns the number of bytes consumed and a reference to the package. +// If the export data version is not recognized or the format is otherwise +// compromised, an error is returned. +func BImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) { + // catch panics and return them as errors + const currentVersion = 6 + version := -1 // unknown version + defer func() { + if e := recover(); e != nil { + // Return a (possibly nil or incomplete) package unchanged (see #16088). + if version > currentVersion { + err = fmt.Errorf("cannot import %q (%v), export data is newer version - update tool", path, e) + } else { + err = fmt.Errorf("cannot import %q (%v), possibly version skew - reinstall package", path, e) + } + } + }() + + p := importer{ + imports: imports, + data: data, + importpath: path, + version: version, + strList: []string{""}, // empty string is mapped to 0 + pathList: []string{""}, // empty string is mapped to 0 + fake: fakeFileSet{ + fset: fset, + files: make(map[string]*token.File), + }, + } + + // read version info + var versionstr string + if b := p.rawByte(); b == 'c' || b == 'd' { + // Go1.7 encoding; first byte encodes low-level + // encoding format (compact vs debug). + // For backward-compatibility only (avoid problems with + // old installed packages). Newly compiled packages use + // the extensible format string. + // TODO(gri) Remove this support eventually; after Go1.8. + if b == 'd' { + p.debugFormat = true + } + p.trackAllTypes = p.rawByte() == 'a' + p.posInfoFormat = p.int() != 0 + versionstr = p.string() + if versionstr == "v1" { + version = 0 + } + } else { + // Go1.8 extensible encoding + // read version string and extract version number (ignore anything after the version number) + versionstr = p.rawStringln(b) + if s := strings.SplitN(versionstr, " ", 3); len(s) >= 2 && s[0] == "version" { + if v, err := strconv.Atoi(s[1]); err == nil && v > 0 { + version = v + } + } + } + p.version = version + + // read version specific flags - extend as necessary + switch p.version { + // case currentVersion: + // ... + // fallthrough + case currentVersion, 5, 4, 3, 2, 1: + p.debugFormat = p.rawStringln(p.rawByte()) == "debug" + p.trackAllTypes = p.int() != 0 + p.posInfoFormat = p.int() != 0 + case 0: + // Go1.7 encoding format - nothing to do here + default: + errorf("unknown bexport format version %d (%q)", p.version, versionstr) + } + + // --- generic export data --- + + // populate typList with predeclared "known" types + p.typList = append(p.typList, predeclared()...) + + // read package data + pkg = p.pkg() + + // read objects of phase 1 only (see cmd/compile/internal/gc/bexport.go) + objcount := 0 + for { + tag := p.tagOrIndex() + if tag == endTag { + break + } + p.obj(tag) + objcount++ + } + + // self-verification + if count := p.int(); count != objcount { + errorf("got %d objects; want %d", objcount, count) + } + + // ignore compiler-specific import data + + // complete interfaces + // TODO(gri) re-investigate if we still need to do this in a delayed fashion + for _, typ := range p.interfaceList { + typ.Complete() + } + + // record all referenced packages as imports + list := append(([]*types.Package)(nil), p.pkgList[1:]...) + sort.Sort(byPath(list)) + pkg.SetImports(list) + + // package was imported completely and without errors + pkg.MarkComplete() + + return p.read, pkg, nil +} + +func errorf(format string, args ...interface{}) { + panic(fmt.Sprintf(format, args...)) +} + +func (p *importer) pkg() *types.Package { + // if the package was seen before, i is its index (>= 0) + i := p.tagOrIndex() + if i >= 0 { + return p.pkgList[i] + } + + // otherwise, i is the package tag (< 0) + if i != packageTag { + errorf("unexpected package tag %d version %d", i, p.version) + } + + // read package data + name := p.string() + var path string + if p.version >= 5 { + path = p.path() + } else { + path = p.string() + } + if p.version >= 6 { + p.int() // package height; unused by go/types + } + + // we should never see an empty package name + if name == "" { + errorf("empty package name in import") + } + + // an empty path denotes the package we are currently importing; + // it must be the first package we see + if (path == "") != (len(p.pkgList) == 0) { + errorf("package path %q for pkg index %d", path, len(p.pkgList)) + } + + // if the package was imported before, use that one; otherwise create a new one + if path == "" { + path = p.importpath + } + pkg := p.imports[path] + if pkg == nil { + pkg = types.NewPackage(path, name) + p.imports[path] = pkg + } else if pkg.Name() != name { + errorf("conflicting names %s and %s for package %q", pkg.Name(), name, path) + } + p.pkgList = append(p.pkgList, pkg) + + return pkg +} + +// objTag returns the tag value for each object kind. +func objTag(obj types.Object) int { + switch obj.(type) { + case *types.Const: + return constTag + case *types.TypeName: + return typeTag + case *types.Var: + return varTag + case *types.Func: + return funcTag + default: + errorf("unexpected object: %v (%T)", obj, obj) // panics + panic("unreachable") + } +} + +func sameObj(a, b types.Object) bool { + // Because unnamed types are not canonicalized, we cannot simply compare types for + // (pointer) identity. + // Ideally we'd check equality of constant values as well, but this is good enough. + return objTag(a) == objTag(b) && types.Identical(a.Type(), b.Type()) +} + +func (p *importer) declare(obj types.Object) { + pkg := obj.Pkg() + if alt := pkg.Scope().Insert(obj); alt != nil { + // This can only trigger if we import a (non-type) object a second time. + // Excluding type aliases, this cannot happen because 1) we only import a package + // once; and b) we ignore compiler-specific export data which may contain + // functions whose inlined function bodies refer to other functions that + // were already imported. + // However, type aliases require reexporting the original type, so we need + // to allow it (see also the comment in cmd/compile/internal/gc/bimport.go, + // method importer.obj, switch case importing functions). + // TODO(gri) review/update this comment once the gc compiler handles type aliases. + if !sameObj(obj, alt) { + errorf("inconsistent import:\n\t%v\npreviously imported as:\n\t%v\n", obj, alt) + } + } +} + +func (p *importer) obj(tag int) { + switch tag { + case constTag: + pos := p.pos() + pkg, name := p.qualifiedName() + typ := p.typ(nil, nil) + val := p.value() + p.declare(types.NewConst(pos, pkg, name, typ, val)) + + case aliasTag: + // TODO(gri) verify type alias hookup is correct + pos := p.pos() + pkg, name := p.qualifiedName() + typ := p.typ(nil, nil) + p.declare(types.NewTypeName(pos, pkg, name, typ)) + + case typeTag: + p.typ(nil, nil) + + case varTag: + pos := p.pos() + pkg, name := p.qualifiedName() + typ := p.typ(nil, nil) + p.declare(types.NewVar(pos, pkg, name, typ)) + + case funcTag: + pos := p.pos() + pkg, name := p.qualifiedName() + params, isddd := p.paramList() + result, _ := p.paramList() + sig := types.NewSignature(nil, params, result, isddd) + p.declare(types.NewFunc(pos, pkg, name, sig)) + + default: + errorf("unexpected object tag %d", tag) + } +} + +const deltaNewFile = -64 // see cmd/compile/internal/gc/bexport.go + +func (p *importer) pos() token.Pos { + if !p.posInfoFormat { + return token.NoPos + } + + file := p.prevFile + line := p.prevLine + delta := p.int() + line += delta + if p.version >= 5 { + if delta == deltaNewFile { + if n := p.int(); n >= 0 { + // file changed + file = p.path() + line = n + } + } + } else { + if delta == 0 { + if n := p.int(); n >= 0 { + // file changed + file = p.prevFile[:n] + p.string() + line = p.int() + } + } + } + p.prevFile = file + p.prevLine = line + + return p.fake.pos(file, line, 0) +} + +// Synthesize a token.Pos +type fakeFileSet struct { + fset *token.FileSet + files map[string]*token.File +} + +func (s *fakeFileSet) pos(file string, line, column int) token.Pos { + // TODO(mdempsky): Make use of column. + + // Since we don't know the set of needed file positions, we + // reserve maxlines positions per file. + const maxlines = 64 * 1024 + f := s.files[file] + if f == nil { + f = s.fset.AddFile(file, -1, maxlines) + s.files[file] = f + // Allocate the fake linebreak indices on first use. + // TODO(adonovan): opt: save ~512KB using a more complex scheme? + fakeLinesOnce.Do(func() { + fakeLines = make([]int, maxlines) + for i := range fakeLines { + fakeLines[i] = i + } + }) + f.SetLines(fakeLines) + } + + if line > maxlines { + line = 1 + } + + // Treat the file as if it contained only newlines + // and column=1: use the line number as the offset. + return f.Pos(line - 1) +} + +var ( + fakeLines []int + fakeLinesOnce sync.Once +) + +func (p *importer) qualifiedName() (pkg *types.Package, name string) { + name = p.string() + pkg = p.pkg() + return +} + +func (p *importer) record(t types.Type) { + p.typList = append(p.typList, t) +} + +// A dddSlice is a types.Type representing ...T parameters. +// It only appears for parameter types and does not escape +// the importer. +type dddSlice struct { + elem types.Type +} + +func (t *dddSlice) Underlying() types.Type { return t } +func (t *dddSlice) String() string { return "..." + t.elem.String() } + +// parent is the package which declared the type; parent == nil means +// the package currently imported. The parent package is needed for +// exported struct fields and interface methods which don't contain +// explicit package information in the export data. +// +// A non-nil tname is used as the "owner" of the result type; i.e., +// the result type is the underlying type of tname. tname is used +// to give interface methods a named receiver type where possible. +func (p *importer) typ(parent *types.Package, tname *types.Named) types.Type { + // if the type was seen before, i is its index (>= 0) + i := p.tagOrIndex() + if i >= 0 { + return p.typList[i] + } + + // otherwise, i is the type tag (< 0) + switch i { + case namedTag: + // read type object + pos := p.pos() + parent, name := p.qualifiedName() + scope := parent.Scope() + obj := scope.Lookup(name) + + // if the object doesn't exist yet, create and insert it + if obj == nil { + obj = types.NewTypeName(pos, parent, name, nil) + scope.Insert(obj) + } + + if _, ok := obj.(*types.TypeName); !ok { + errorf("pkg = %s, name = %s => %s", parent, name, obj) + } + + // associate new named type with obj if it doesn't exist yet + t0 := types.NewNamed(obj.(*types.TypeName), nil, nil) + + // but record the existing type, if any + tname := obj.Type().(*types.Named) // tname is either t0 or the existing type + p.record(tname) + + // read underlying type + t0.SetUnderlying(p.typ(parent, t0)) + + // interfaces don't have associated methods + if types.IsInterface(t0) { + return tname + } + + // read associated methods + for i := p.int(); i > 0; i-- { + // TODO(gri) replace this with something closer to fieldName + pos := p.pos() + name := p.string() + if !exported(name) { + p.pkg() + } + + recv, _ := p.paramList() // TODO(gri) do we need a full param list for the receiver? + params, isddd := p.paramList() + result, _ := p.paramList() + p.int() // go:nointerface pragma - discarded + + sig := types.NewSignature(recv.At(0), params, result, isddd) + t0.AddMethod(types.NewFunc(pos, parent, name, sig)) + } + + return tname + + case arrayTag: + t := new(types.Array) + if p.trackAllTypes { + p.record(t) + } + + n := p.int64() + *t = *types.NewArray(p.typ(parent, nil), n) + return t + + case sliceTag: + t := new(types.Slice) + if p.trackAllTypes { + p.record(t) + } + + *t = *types.NewSlice(p.typ(parent, nil)) + return t + + case dddTag: + t := new(dddSlice) + if p.trackAllTypes { + p.record(t) + } + + t.elem = p.typ(parent, nil) + return t + + case structTag: + t := new(types.Struct) + if p.trackAllTypes { + p.record(t) + } + + *t = *types.NewStruct(p.fieldList(parent)) + return t + + case pointerTag: + t := new(types.Pointer) + if p.trackAllTypes { + p.record(t) + } + + *t = *types.NewPointer(p.typ(parent, nil)) + return t + + case signatureTag: + t := new(types.Signature) + if p.trackAllTypes { + p.record(t) + } + + params, isddd := p.paramList() + result, _ := p.paramList() + *t = *types.NewSignature(nil, params, result, isddd) + return t + + case interfaceTag: + // Create a dummy entry in the type list. This is safe because we + // cannot expect the interface type to appear in a cycle, as any + // such cycle must contain a named type which would have been + // first defined earlier. + // TODO(gri) Is this still true now that we have type aliases? + // See issue #23225. + n := len(p.typList) + if p.trackAllTypes { + p.record(nil) + } + + var embeddeds []types.Type + for n := p.int(); n > 0; n-- { + p.pos() + embeddeds = append(embeddeds, p.typ(parent, nil)) + } + + t := newInterface(p.methodList(parent, tname), embeddeds) + p.interfaceList = append(p.interfaceList, t) + if p.trackAllTypes { + p.typList[n] = t + } + return t + + case mapTag: + t := new(types.Map) + if p.trackAllTypes { + p.record(t) + } + + key := p.typ(parent, nil) + val := p.typ(parent, nil) + *t = *types.NewMap(key, val) + return t + + case chanTag: + t := new(types.Chan) + if p.trackAllTypes { + p.record(t) + } + + dir := chanDir(p.int()) + val := p.typ(parent, nil) + *t = *types.NewChan(dir, val) + return t + + default: + errorf("unexpected type tag %d", i) // panics + panic("unreachable") + } +} + +func chanDir(d int) types.ChanDir { + // tag values must match the constants in cmd/compile/internal/gc/go.go + switch d { + case 1 /* Crecv */ : + return types.RecvOnly + case 2 /* Csend */ : + return types.SendOnly + case 3 /* Cboth */ : + return types.SendRecv + default: + errorf("unexpected channel dir %d", d) + return 0 + } +} + +func (p *importer) fieldList(parent *types.Package) (fields []*types.Var, tags []string) { + if n := p.int(); n > 0 { + fields = make([]*types.Var, n) + tags = make([]string, n) + for i := range fields { + fields[i], tags[i] = p.field(parent) + } + } + return +} + +func (p *importer) field(parent *types.Package) (*types.Var, string) { + pos := p.pos() + pkg, name, alias := p.fieldName(parent) + typ := p.typ(parent, nil) + tag := p.string() + + anonymous := false + if name == "" { + // anonymous field - typ must be T or *T and T must be a type name + switch typ := deref(typ).(type) { + case *types.Basic: // basic types are named types + pkg = nil // // objects defined in Universe scope have no package + name = typ.Name() + case *types.Named: + name = typ.Obj().Name() + default: + errorf("named base type expected") + } + anonymous = true + } else if alias { + // anonymous field: we have an explicit name because it's an alias + anonymous = true + } + + return types.NewField(pos, pkg, name, typ, anonymous), tag +} + +func (p *importer) methodList(parent *types.Package, baseType *types.Named) (methods []*types.Func) { + if n := p.int(); n > 0 { + methods = make([]*types.Func, n) + for i := range methods { + methods[i] = p.method(parent, baseType) + } + } + return +} + +func (p *importer) method(parent *types.Package, baseType *types.Named) *types.Func { + pos := p.pos() + pkg, name, _ := p.fieldName(parent) + // If we don't have a baseType, use a nil receiver. + // A receiver using the actual interface type (which + // we don't know yet) will be filled in when we call + // types.Interface.Complete. + var recv *types.Var + if baseType != nil { + recv = types.NewVar(token.NoPos, parent, "", baseType) + } + params, isddd := p.paramList() + result, _ := p.paramList() + sig := types.NewSignature(recv, params, result, isddd) + return types.NewFunc(pos, pkg, name, sig) +} + +func (p *importer) fieldName(parent *types.Package) (pkg *types.Package, name string, alias bool) { + name = p.string() + pkg = parent + if pkg == nil { + // use the imported package instead + pkg = p.pkgList[0] + } + if p.version == 0 && name == "_" { + // version 0 didn't export a package for _ fields + return + } + switch name { + case "": + // 1) field name matches base type name and is exported: nothing to do + case "?": + // 2) field name matches base type name and is not exported: need package + name = "" + pkg = p.pkg() + case "@": + // 3) field name doesn't match type name (alias) + name = p.string() + alias = true + fallthrough + default: + if !exported(name) { + pkg = p.pkg() + } + } + return +} + +func (p *importer) paramList() (*types.Tuple, bool) { + n := p.int() + if n == 0 { + return nil, false + } + // negative length indicates unnamed parameters + named := true + if n < 0 { + n = -n + named = false + } + // n > 0 + params := make([]*types.Var, n) + isddd := false + for i := range params { + params[i], isddd = p.param(named) + } + return types.NewTuple(params...), isddd +} + +func (p *importer) param(named bool) (*types.Var, bool) { + t := p.typ(nil, nil) + td, isddd := t.(*dddSlice) + if isddd { + t = types.NewSlice(td.elem) + } + + var pkg *types.Package + var name string + if named { + name = p.string() + if name == "" { + errorf("expected named parameter") + } + if name != "_" { + pkg = p.pkg() + } + if i := strings.Index(name, "·"); i > 0 { + name = name[:i] // cut off gc-specific parameter numbering + } + } + + // read and discard compiler-specific info + p.string() + + return types.NewVar(token.NoPos, pkg, name, t), isddd +} + +func exported(name string) bool { + ch, _ := utf8.DecodeRuneInString(name) + return unicode.IsUpper(ch) +} + +func (p *importer) value() constant.Value { + switch tag := p.tagOrIndex(); tag { + case falseTag: + return constant.MakeBool(false) + case trueTag: + return constant.MakeBool(true) + case int64Tag: + return constant.MakeInt64(p.int64()) + case floatTag: + return p.float() + case complexTag: + re := p.float() + im := p.float() + return constant.BinaryOp(re, token.ADD, constant.MakeImag(im)) + case stringTag: + return constant.MakeString(p.string()) + case unknownTag: + return constant.MakeUnknown() + default: + errorf("unexpected value tag %d", tag) // panics + panic("unreachable") + } +} + +func (p *importer) float() constant.Value { + sign := p.int() + if sign == 0 { + return constant.MakeInt64(0) + } + + exp := p.int() + mant := []byte(p.string()) // big endian + + // remove leading 0's if any + for len(mant) > 0 && mant[0] == 0 { + mant = mant[1:] + } + + // convert to little endian + // TODO(gri) go/constant should have a more direct conversion function + // (e.g., once it supports a big.Float based implementation) + for i, j := 0, len(mant)-1; i < j; i, j = i+1, j-1 { + mant[i], mant[j] = mant[j], mant[i] + } + + // adjust exponent (constant.MakeFromBytes creates an integer value, + // but mant represents the mantissa bits such that 0.5 <= mant < 1.0) + exp -= len(mant) << 3 + if len(mant) > 0 { + for msd := mant[len(mant)-1]; msd&0x80 == 0; msd <<= 1 { + exp++ + } + } + + x := constant.MakeFromBytes(mant) + switch { + case exp < 0: + d := constant.Shift(constant.MakeInt64(1), token.SHL, uint(-exp)) + x = constant.BinaryOp(x, token.QUO, d) + case exp > 0: + x = constant.Shift(x, token.SHL, uint(exp)) + } + + if sign < 0 { + x = constant.UnaryOp(token.SUB, x, 0) + } + return x +} + +// ---------------------------------------------------------------------------- +// Low-level decoders + +func (p *importer) tagOrIndex() int { + if p.debugFormat { + p.marker('t') + } + + return int(p.rawInt64()) +} + +func (p *importer) int() int { + x := p.int64() + if int64(int(x)) != x { + errorf("exported integer too large") + } + return int(x) +} + +func (p *importer) int64() int64 { + if p.debugFormat { + p.marker('i') + } + + return p.rawInt64() +} + +func (p *importer) path() string { + if p.debugFormat { + p.marker('p') + } + // if the path was seen before, i is its index (>= 0) + // (the empty string is at index 0) + i := p.rawInt64() + if i >= 0 { + return p.pathList[i] + } + // otherwise, i is the negative path length (< 0) + a := make([]string, -i) + for n := range a { + a[n] = p.string() + } + s := strings.Join(a, "/") + p.pathList = append(p.pathList, s) + return s +} + +func (p *importer) string() string { + if p.debugFormat { + p.marker('s') + } + // if the string was seen before, i is its index (>= 0) + // (the empty string is at index 0) + i := p.rawInt64() + if i >= 0 { + return p.strList[i] + } + // otherwise, i is the negative string length (< 0) + if n := int(-i); n <= cap(p.buf) { + p.buf = p.buf[:n] + } else { + p.buf = make([]byte, n) + } + for i := range p.buf { + p.buf[i] = p.rawByte() + } + s := string(p.buf) + p.strList = append(p.strList, s) + return s +} + +func (p *importer) marker(want byte) { + if got := p.rawByte(); got != want { + errorf("incorrect marker: got %c; want %c (pos = %d)", got, want, p.read) + } + + pos := p.read + if n := int(p.rawInt64()); n != pos { + errorf("incorrect position: got %d; want %d", n, pos) + } +} + +// rawInt64 should only be used by low-level decoders. +func (p *importer) rawInt64() int64 { + i, err := binary.ReadVarint(p) + if err != nil { + errorf("read error: %v", err) + } + return i +} + +// rawStringln should only be used to read the initial version string. +func (p *importer) rawStringln(b byte) string { + p.buf = p.buf[:0] + for b != '\n' { + p.buf = append(p.buf, b) + b = p.rawByte() + } + return string(p.buf) +} + +// needed for binary.ReadVarint in rawInt64 +func (p *importer) ReadByte() (byte, error) { + return p.rawByte(), nil +} + +// byte is the bottleneck interface for reading p.data. +// It unescapes '|' 'S' to '$' and '|' '|' to '|'. +// rawByte should only be used by low-level decoders. +func (p *importer) rawByte() byte { + b := p.data[0] + r := 1 + if b == '|' { + b = p.data[1] + r = 2 + switch b { + case 'S': + b = '$' + case '|': + // nothing to do + default: + errorf("unexpected escape sequence in export data") + } + } + p.data = p.data[r:] + p.read += r + return b + +} + +// ---------------------------------------------------------------------------- +// Export format + +// Tags. Must be < 0. +const ( + // Objects + packageTag = -(iota + 1) + constTag + typeTag + varTag + funcTag + endTag + + // Types + namedTag + arrayTag + sliceTag + dddTag + structTag + pointerTag + signatureTag + interfaceTag + mapTag + chanTag + + // Values + falseTag + trueTag + int64Tag + floatTag + fractionTag // not used by gc + complexTag + stringTag + nilTag // only used by gc (appears in exported inlined function bodies) + unknownTag // not used by gc (only appears in packages with errors) + + // Type aliases + aliasTag +) + +var predeclOnce sync.Once +var predecl []types.Type // initialized lazily + +func predeclared() []types.Type { + predeclOnce.Do(func() { + // initialize lazily to be sure that all + // elements have been initialized before + predecl = []types.Type{ // basic types + types.Typ[types.Bool], + types.Typ[types.Int], + types.Typ[types.Int8], + types.Typ[types.Int16], + types.Typ[types.Int32], + types.Typ[types.Int64], + types.Typ[types.Uint], + types.Typ[types.Uint8], + types.Typ[types.Uint16], + types.Typ[types.Uint32], + types.Typ[types.Uint64], + types.Typ[types.Uintptr], + types.Typ[types.Float32], + types.Typ[types.Float64], + types.Typ[types.Complex64], + types.Typ[types.Complex128], + types.Typ[types.String], + + // basic type aliases + types.Universe.Lookup("byte").Type(), + types.Universe.Lookup("rune").Type(), + + // error + types.Universe.Lookup("error").Type(), + + // untyped types + types.Typ[types.UntypedBool], + types.Typ[types.UntypedInt], + types.Typ[types.UntypedRune], + types.Typ[types.UntypedFloat], + types.Typ[types.UntypedComplex], + types.Typ[types.UntypedString], + types.Typ[types.UntypedNil], + + // package unsafe + types.Typ[types.UnsafePointer], + + // invalid type + types.Typ[types.Invalid], // only appears in packages with errors + + // used internally by gc; never used by this package or in .a files + anyType{}, + } + }) + return predecl +} + +type anyType struct{} + +func (t anyType) Underlying() types.Type { return t } +func (t anyType) String() string { return "any" } diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go b/vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go new file mode 100644 index 0000000000..f33dc5613e --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go @@ -0,0 +1,93 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file is a copy of $GOROOT/src/go/internal/gcimporter/exportdata.go. + +// This file implements FindExportData. + +package gcimporter + +import ( + "bufio" + "fmt" + "io" + "strconv" + "strings" +) + +func readGopackHeader(r *bufio.Reader) (name string, size int, err error) { + // See $GOROOT/include/ar.h. + hdr := make([]byte, 16+12+6+6+8+10+2) + _, err = io.ReadFull(r, hdr) + if err != nil { + return + } + // leave for debugging + if false { + fmt.Printf("header: %s", hdr) + } + s := strings.TrimSpace(string(hdr[16+12+6+6+8:][:10])) + size, err = strconv.Atoi(s) + if err != nil || hdr[len(hdr)-2] != '`' || hdr[len(hdr)-1] != '\n' { + err = fmt.Errorf("invalid archive header") + return + } + name = strings.TrimSpace(string(hdr[:16])) + return +} + +// FindExportData positions the reader r at the beginning of the +// export data section of an underlying GC-created object/archive +// file by reading from it. The reader must be positioned at the +// start of the file before calling this function. The hdr result +// is the string before the export data, either "$$" or "$$B". +// +func FindExportData(r *bufio.Reader) (hdr string, err error) { + // Read first line to make sure this is an object file. + line, err := r.ReadSlice('\n') + if err != nil { + err = fmt.Errorf("can't find export data (%v)", err) + return + } + + if string(line) == "!\n" { + // Archive file. Scan to __.PKGDEF. + var name string + if name, _, err = readGopackHeader(r); err != nil { + return + } + + // First entry should be __.PKGDEF. + if name != "__.PKGDEF" { + err = fmt.Errorf("go archive is missing __.PKGDEF") + return + } + + // Read first line of __.PKGDEF data, so that line + // is once again the first line of the input. + if line, err = r.ReadSlice('\n'); err != nil { + err = fmt.Errorf("can't find export data (%v)", err) + return + } + } + + // Now at __.PKGDEF in archive or still at beginning of file. + // Either way, line should begin with "go object ". + if !strings.HasPrefix(string(line), "go object ") { + err = fmt.Errorf("not a Go object file") + return + } + + // Skip over object header to export data. + // Begins after first line starting with $$. + for line[0] != '$' { + if line, err = r.ReadSlice('\n'); err != nil { + err = fmt.Errorf("can't find export data (%v)", err) + return + } + } + hdr = string(line) + + return +} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go b/vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go new file mode 100644 index 0000000000..e8cba6b237 --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go @@ -0,0 +1,1078 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file is a modified copy of $GOROOT/src/go/internal/gcimporter/gcimporter.go, +// but it also contains the original source-based importer code for Go1.6. +// Once we stop supporting 1.6, we can remove that code. + +// Package gcimporter provides various functions for reading +// gc-generated object files that can be used to implement the +// Importer interface defined by the Go 1.5 standard library package. +package gcimporter // import "golang.org/x/tools/go/internal/gcimporter" + +import ( + "bufio" + "errors" + "fmt" + "go/build" + "go/constant" + "go/token" + "go/types" + "io" + "io/ioutil" + "os" + "path/filepath" + "sort" + "strconv" + "strings" + "text/scanner" +) + +// debugging/development support +const debug = false + +var pkgExts = [...]string{".a", ".o"} + +// FindPkg returns the filename and unique package id for an import +// path based on package information provided by build.Import (using +// the build.Default build.Context). A relative srcDir is interpreted +// relative to the current working directory. +// If no file was found, an empty filename is returned. +// +func FindPkg(path, srcDir string) (filename, id string) { + if path == "" { + return + } + + var noext string + switch { + default: + // "x" -> "$GOPATH/pkg/$GOOS_$GOARCH/x.ext", "x" + // Don't require the source files to be present. + if abs, err := filepath.Abs(srcDir); err == nil { // see issue 14282 + srcDir = abs + } + bp, _ := build.Import(path, srcDir, build.FindOnly|build.AllowBinary) + if bp.PkgObj == "" { + id = path // make sure we have an id to print in error message + return + } + noext = strings.TrimSuffix(bp.PkgObj, ".a") + id = bp.ImportPath + + case build.IsLocalImport(path): + // "./x" -> "/this/directory/x.ext", "/this/directory/x" + noext = filepath.Join(srcDir, path) + id = noext + + case filepath.IsAbs(path): + // for completeness only - go/build.Import + // does not support absolute imports + // "/x" -> "/x.ext", "/x" + noext = path + id = path + } + + if false { // for debugging + if path != id { + fmt.Printf("%s -> %s\n", path, id) + } + } + + // try extensions + for _, ext := range pkgExts { + filename = noext + ext + if f, err := os.Stat(filename); err == nil && !f.IsDir() { + return + } + } + + filename = "" // not found + return +} + +// ImportData imports a package by reading the gc-generated export data, +// adds the corresponding package object to the packages map indexed by id, +// and returns the object. +// +// The packages map must contains all packages already imported. The data +// reader position must be the beginning of the export data section. The +// filename is only used in error messages. +// +// If packages[id] contains the completely imported package, that package +// can be used directly, and there is no need to call this function (but +// there is also no harm but for extra time used). +// +func ImportData(packages map[string]*types.Package, filename, id string, data io.Reader) (pkg *types.Package, err error) { + // support for parser error handling + defer func() { + switch r := recover().(type) { + case nil: + // nothing to do + case importError: + err = r + default: + panic(r) // internal error + } + }() + + var p parser + p.init(filename, id, data, packages) + pkg = p.parseExport() + + return +} + +// Import imports a gc-generated package given its import path and srcDir, adds +// the corresponding package object to the packages map, and returns the object. +// The packages map must contain all packages already imported. +// +func Import(packages map[string]*types.Package, path, srcDir string, lookup func(path string) (io.ReadCloser, error)) (pkg *types.Package, err error) { + var rc io.ReadCloser + var filename, id string + if lookup != nil { + // With custom lookup specified, assume that caller has + // converted path to a canonical import path for use in the map. + if path == "unsafe" { + return types.Unsafe, nil + } + id = path + + // No need to re-import if the package was imported completely before. + if pkg = packages[id]; pkg != nil && pkg.Complete() { + return + } + f, err := lookup(path) + if err != nil { + return nil, err + } + rc = f + } else { + filename, id = FindPkg(path, srcDir) + if filename == "" { + if path == "unsafe" { + return types.Unsafe, nil + } + return nil, fmt.Errorf("can't find import: %q", id) + } + + // no need to re-import if the package was imported completely before + if pkg = packages[id]; pkg != nil && pkg.Complete() { + return + } + + // open file + f, err := os.Open(filename) + if err != nil { + return nil, err + } + defer func() { + if err != nil { + // add file name to error + err = fmt.Errorf("%s: %v", filename, err) + } + }() + rc = f + } + defer rc.Close() + + var hdr string + buf := bufio.NewReader(rc) + if hdr, err = FindExportData(buf); err != nil { + return + } + + switch hdr { + case "$$\n": + // Work-around if we don't have a filename; happens only if lookup != nil. + // Either way, the filename is only needed for importer error messages, so + // this is fine. + if filename == "" { + filename = path + } + return ImportData(packages, filename, id, buf) + + case "$$B\n": + var data []byte + data, err = ioutil.ReadAll(buf) + if err != nil { + break + } + + // TODO(gri): allow clients of go/importer to provide a FileSet. + // Or, define a new standard go/types/gcexportdata package. + fset := token.NewFileSet() + + // The indexed export format starts with an 'i'; the older + // binary export format starts with a 'c', 'd', or 'v' + // (from "version"). Select appropriate importer. + if len(data) > 0 && data[0] == 'i' { + _, pkg, err = IImportData(fset, packages, data[1:], id) + } else { + _, pkg, err = BImportData(fset, packages, data, id) + } + + default: + err = fmt.Errorf("unknown export data header: %q", hdr) + } + + return +} + +// ---------------------------------------------------------------------------- +// Parser + +// TODO(gri) Imported objects don't have position information. +// Ideally use the debug table line info; alternatively +// create some fake position (or the position of the +// import). That way error messages referring to imported +// objects can print meaningful information. + +// parser parses the exports inside a gc compiler-produced +// object/archive file and populates its scope with the results. +type parser struct { + scanner scanner.Scanner + tok rune // current token + lit string // literal string; only valid for Ident, Int, String tokens + id string // package id of imported package + sharedPkgs map[string]*types.Package // package id -> package object (across importer) + localPkgs map[string]*types.Package // package id -> package object (just this package) +} + +func (p *parser) init(filename, id string, src io.Reader, packages map[string]*types.Package) { + p.scanner.Init(src) + p.scanner.Error = func(_ *scanner.Scanner, msg string) { p.error(msg) } + p.scanner.Mode = scanner.ScanIdents | scanner.ScanInts | scanner.ScanChars | scanner.ScanStrings | scanner.ScanComments | scanner.SkipComments + p.scanner.Whitespace = 1<<'\t' | 1<<' ' + p.scanner.Filename = filename // for good error messages + p.next() + p.id = id + p.sharedPkgs = packages + if debug { + // check consistency of packages map + for _, pkg := range packages { + if pkg.Name() == "" { + fmt.Printf("no package name for %s\n", pkg.Path()) + } + } + } +} + +func (p *parser) next() { + p.tok = p.scanner.Scan() + switch p.tok { + case scanner.Ident, scanner.Int, scanner.Char, scanner.String, '·': + p.lit = p.scanner.TokenText() + default: + p.lit = "" + } + if debug { + fmt.Printf("%s: %q -> %q\n", scanner.TokenString(p.tok), p.scanner.TokenText(), p.lit) + } +} + +func declTypeName(pkg *types.Package, name string) *types.TypeName { + scope := pkg.Scope() + if obj := scope.Lookup(name); obj != nil { + return obj.(*types.TypeName) + } + obj := types.NewTypeName(token.NoPos, pkg, name, nil) + // a named type may be referred to before the underlying type + // is known - set it up + types.NewNamed(obj, nil, nil) + scope.Insert(obj) + return obj +} + +// ---------------------------------------------------------------------------- +// Error handling + +// Internal errors are boxed as importErrors. +type importError struct { + pos scanner.Position + err error +} + +func (e importError) Error() string { + return fmt.Sprintf("import error %s (byte offset = %d): %s", e.pos, e.pos.Offset, e.err) +} + +func (p *parser) error(err interface{}) { + if s, ok := err.(string); ok { + err = errors.New(s) + } + // panic with a runtime.Error if err is not an error + panic(importError{p.scanner.Pos(), err.(error)}) +} + +func (p *parser) errorf(format string, args ...interface{}) { + p.error(fmt.Sprintf(format, args...)) +} + +func (p *parser) expect(tok rune) string { + lit := p.lit + if p.tok != tok { + p.errorf("expected %s, got %s (%s)", scanner.TokenString(tok), scanner.TokenString(p.tok), lit) + } + p.next() + return lit +} + +func (p *parser) expectSpecial(tok string) { + sep := 'x' // not white space + i := 0 + for i < len(tok) && p.tok == rune(tok[i]) && sep > ' ' { + sep = p.scanner.Peek() // if sep <= ' ', there is white space before the next token + p.next() + i++ + } + if i < len(tok) { + p.errorf("expected %q, got %q", tok, tok[0:i]) + } +} + +func (p *parser) expectKeyword(keyword string) { + lit := p.expect(scanner.Ident) + if lit != keyword { + p.errorf("expected keyword %s, got %q", keyword, lit) + } +} + +// ---------------------------------------------------------------------------- +// Qualified and unqualified names + +// PackageId = string_lit . +// +func (p *parser) parsePackageID() string { + id, err := strconv.Unquote(p.expect(scanner.String)) + if err != nil { + p.error(err) + } + // id == "" stands for the imported package id + // (only known at time of package installation) + if id == "" { + id = p.id + } + return id +} + +// PackageName = ident . +// +func (p *parser) parsePackageName() string { + return p.expect(scanner.Ident) +} + +// dotIdentifier = ( ident | '·' ) { ident | int | '·' } . +func (p *parser) parseDotIdent() string { + ident := "" + if p.tok != scanner.Int { + sep := 'x' // not white space + for (p.tok == scanner.Ident || p.tok == scanner.Int || p.tok == '·') && sep > ' ' { + ident += p.lit + sep = p.scanner.Peek() // if sep <= ' ', there is white space before the next token + p.next() + } + } + if ident == "" { + p.expect(scanner.Ident) // use expect() for error handling + } + return ident +} + +// QualifiedName = "@" PackageId "." ( "?" | dotIdentifier ) . +// +func (p *parser) parseQualifiedName() (id, name string) { + p.expect('@') + id = p.parsePackageID() + p.expect('.') + // Per rev f280b8a485fd (10/2/2013), qualified names may be used for anonymous fields. + if p.tok == '?' { + p.next() + } else { + name = p.parseDotIdent() + } + return +} + +// getPkg returns the package for a given id. If the package is +// not found, create the package and add it to the p.localPkgs +// and p.sharedPkgs maps. name is the (expected) name of the +// package. If name == "", the package name is expected to be +// set later via an import clause in the export data. +// +// id identifies a package, usually by a canonical package path like +// "encoding/json" but possibly by a non-canonical import path like +// "./json". +// +func (p *parser) getPkg(id, name string) *types.Package { + // package unsafe is not in the packages maps - handle explicitly + if id == "unsafe" { + return types.Unsafe + } + + pkg := p.localPkgs[id] + if pkg == nil { + // first import of id from this package + pkg = p.sharedPkgs[id] + if pkg == nil { + // first import of id by this importer; + // add (possibly unnamed) pkg to shared packages + pkg = types.NewPackage(id, name) + p.sharedPkgs[id] = pkg + } + // add (possibly unnamed) pkg to local packages + if p.localPkgs == nil { + p.localPkgs = make(map[string]*types.Package) + } + p.localPkgs[id] = pkg + } else if name != "" { + // package exists already and we have an expected package name; + // make sure names match or set package name if necessary + if pname := pkg.Name(); pname == "" { + pkg.SetName(name) + } else if pname != name { + p.errorf("%s package name mismatch: %s (given) vs %s (expected)", id, pname, name) + } + } + return pkg +} + +// parseExportedName is like parseQualifiedName, but +// the package id is resolved to an imported *types.Package. +// +func (p *parser) parseExportedName() (pkg *types.Package, name string) { + id, name := p.parseQualifiedName() + pkg = p.getPkg(id, "") + return +} + +// ---------------------------------------------------------------------------- +// Types + +// BasicType = identifier . +// +func (p *parser) parseBasicType() types.Type { + id := p.expect(scanner.Ident) + obj := types.Universe.Lookup(id) + if obj, ok := obj.(*types.TypeName); ok { + return obj.Type() + } + p.errorf("not a basic type: %s", id) + return nil +} + +// ArrayType = "[" int_lit "]" Type . +// +func (p *parser) parseArrayType(parent *types.Package) types.Type { + // "[" already consumed and lookahead known not to be "]" + lit := p.expect(scanner.Int) + p.expect(']') + elem := p.parseType(parent) + n, err := strconv.ParseInt(lit, 10, 64) + if err != nil { + p.error(err) + } + return types.NewArray(elem, n) +} + +// MapType = "map" "[" Type "]" Type . +// +func (p *parser) parseMapType(parent *types.Package) types.Type { + p.expectKeyword("map") + p.expect('[') + key := p.parseType(parent) + p.expect(']') + elem := p.parseType(parent) + return types.NewMap(key, elem) +} + +// Name = identifier | "?" | QualifiedName . +// +// For unqualified and anonymous names, the returned package is the parent +// package unless parent == nil, in which case the returned package is the +// package being imported. (The parent package is not nil if the name +// is an unqualified struct field or interface method name belonging to a +// type declared in another package.) +// +// For qualified names, the returned package is nil (and not created if +// it doesn't exist yet) unless materializePkg is set (which creates an +// unnamed package with valid package path). In the latter case, a +// subsequent import clause is expected to provide a name for the package. +// +func (p *parser) parseName(parent *types.Package, materializePkg bool) (pkg *types.Package, name string) { + pkg = parent + if pkg == nil { + pkg = p.sharedPkgs[p.id] + } + switch p.tok { + case scanner.Ident: + name = p.lit + p.next() + case '?': + // anonymous + p.next() + case '@': + // exported name prefixed with package path + pkg = nil + var id string + id, name = p.parseQualifiedName() + if materializePkg { + pkg = p.getPkg(id, "") + } + default: + p.error("name expected") + } + return +} + +func deref(typ types.Type) types.Type { + if p, _ := typ.(*types.Pointer); p != nil { + return p.Elem() + } + return typ +} + +// Field = Name Type [ string_lit ] . +// +func (p *parser) parseField(parent *types.Package) (*types.Var, string) { + pkg, name := p.parseName(parent, true) + + if name == "_" { + // Blank fields should be package-qualified because they + // are unexported identifiers, but gc does not qualify them. + // Assuming that the ident belongs to the current package + // causes types to change during re-exporting, leading + // to spurious "can't assign A to B" errors from go/types. + // As a workaround, pretend all blank fields belong + // to the same unique dummy package. + const blankpkg = "<_>" + pkg = p.getPkg(blankpkg, blankpkg) + } + + typ := p.parseType(parent) + anonymous := false + if name == "" { + // anonymous field - typ must be T or *T and T must be a type name + switch typ := deref(typ).(type) { + case *types.Basic: // basic types are named types + pkg = nil // objects defined in Universe scope have no package + name = typ.Name() + case *types.Named: + name = typ.Obj().Name() + default: + p.errorf("anonymous field expected") + } + anonymous = true + } + tag := "" + if p.tok == scanner.String { + s := p.expect(scanner.String) + var err error + tag, err = strconv.Unquote(s) + if err != nil { + p.errorf("invalid struct tag %s: %s", s, err) + } + } + return types.NewField(token.NoPos, pkg, name, typ, anonymous), tag +} + +// StructType = "struct" "{" [ FieldList ] "}" . +// FieldList = Field { ";" Field } . +// +func (p *parser) parseStructType(parent *types.Package) types.Type { + var fields []*types.Var + var tags []string + + p.expectKeyword("struct") + p.expect('{') + for i := 0; p.tok != '}' && p.tok != scanner.EOF; i++ { + if i > 0 { + p.expect(';') + } + fld, tag := p.parseField(parent) + if tag != "" && tags == nil { + tags = make([]string, i) + } + if tags != nil { + tags = append(tags, tag) + } + fields = append(fields, fld) + } + p.expect('}') + + return types.NewStruct(fields, tags) +} + +// Parameter = ( identifier | "?" ) [ "..." ] Type [ string_lit ] . +// +func (p *parser) parseParameter() (par *types.Var, isVariadic bool) { + _, name := p.parseName(nil, false) + // remove gc-specific parameter numbering + if i := strings.Index(name, "·"); i >= 0 { + name = name[:i] + } + if p.tok == '.' { + p.expectSpecial("...") + isVariadic = true + } + typ := p.parseType(nil) + if isVariadic { + typ = types.NewSlice(typ) + } + // ignore argument tag (e.g. "noescape") + if p.tok == scanner.String { + p.next() + } + // TODO(gri) should we provide a package? + par = types.NewVar(token.NoPos, nil, name, typ) + return +} + +// Parameters = "(" [ ParameterList ] ")" . +// ParameterList = { Parameter "," } Parameter . +// +func (p *parser) parseParameters() (list []*types.Var, isVariadic bool) { + p.expect('(') + for p.tok != ')' && p.tok != scanner.EOF { + if len(list) > 0 { + p.expect(',') + } + par, variadic := p.parseParameter() + list = append(list, par) + if variadic { + if isVariadic { + p.error("... not on final argument") + } + isVariadic = true + } + } + p.expect(')') + + return +} + +// Signature = Parameters [ Result ] . +// Result = Type | Parameters . +// +func (p *parser) parseSignature(recv *types.Var) *types.Signature { + params, isVariadic := p.parseParameters() + + // optional result type + var results []*types.Var + if p.tok == '(' { + var variadic bool + results, variadic = p.parseParameters() + if variadic { + p.error("... not permitted on result type") + } + } + + return types.NewSignature(recv, types.NewTuple(params...), types.NewTuple(results...), isVariadic) +} + +// InterfaceType = "interface" "{" [ MethodList ] "}" . +// MethodList = Method { ";" Method } . +// Method = Name Signature . +// +// The methods of embedded interfaces are always "inlined" +// by the compiler and thus embedded interfaces are never +// visible in the export data. +// +func (p *parser) parseInterfaceType(parent *types.Package) types.Type { + var methods []*types.Func + + p.expectKeyword("interface") + p.expect('{') + for i := 0; p.tok != '}' && p.tok != scanner.EOF; i++ { + if i > 0 { + p.expect(';') + } + pkg, name := p.parseName(parent, true) + sig := p.parseSignature(nil) + methods = append(methods, types.NewFunc(token.NoPos, pkg, name, sig)) + } + p.expect('}') + + // Complete requires the type's embedded interfaces to be fully defined, + // but we do not define any + return newInterface(methods, nil).Complete() +} + +// ChanType = ( "chan" [ "<-" ] | "<-" "chan" ) Type . +// +func (p *parser) parseChanType(parent *types.Package) types.Type { + dir := types.SendRecv + if p.tok == scanner.Ident { + p.expectKeyword("chan") + if p.tok == '<' { + p.expectSpecial("<-") + dir = types.SendOnly + } + } else { + p.expectSpecial("<-") + p.expectKeyword("chan") + dir = types.RecvOnly + } + elem := p.parseType(parent) + return types.NewChan(dir, elem) +} + +// Type = +// BasicType | TypeName | ArrayType | SliceType | StructType | +// PointerType | FuncType | InterfaceType | MapType | ChanType | +// "(" Type ")" . +// +// BasicType = ident . +// TypeName = ExportedName . +// SliceType = "[" "]" Type . +// PointerType = "*" Type . +// FuncType = "func" Signature . +// +func (p *parser) parseType(parent *types.Package) types.Type { + switch p.tok { + case scanner.Ident: + switch p.lit { + default: + return p.parseBasicType() + case "struct": + return p.parseStructType(parent) + case "func": + // FuncType + p.next() + return p.parseSignature(nil) + case "interface": + return p.parseInterfaceType(parent) + case "map": + return p.parseMapType(parent) + case "chan": + return p.parseChanType(parent) + } + case '@': + // TypeName + pkg, name := p.parseExportedName() + return declTypeName(pkg, name).Type() + case '[': + p.next() // look ahead + if p.tok == ']' { + // SliceType + p.next() + return types.NewSlice(p.parseType(parent)) + } + return p.parseArrayType(parent) + case '*': + // PointerType + p.next() + return types.NewPointer(p.parseType(parent)) + case '<': + return p.parseChanType(parent) + case '(': + // "(" Type ")" + p.next() + typ := p.parseType(parent) + p.expect(')') + return typ + } + p.errorf("expected type, got %s (%q)", scanner.TokenString(p.tok), p.lit) + return nil +} + +// ---------------------------------------------------------------------------- +// Declarations + +// ImportDecl = "import" PackageName PackageId . +// +func (p *parser) parseImportDecl() { + p.expectKeyword("import") + name := p.parsePackageName() + p.getPkg(p.parsePackageID(), name) +} + +// int_lit = [ "+" | "-" ] { "0" ... "9" } . +// +func (p *parser) parseInt() string { + s := "" + switch p.tok { + case '-': + s = "-" + p.next() + case '+': + p.next() + } + return s + p.expect(scanner.Int) +} + +// number = int_lit [ "p" int_lit ] . +// +func (p *parser) parseNumber() (typ *types.Basic, val constant.Value) { + // mantissa + mant := constant.MakeFromLiteral(p.parseInt(), token.INT, 0) + if mant == nil { + panic("invalid mantissa") + } + + if p.lit == "p" { + // exponent (base 2) + p.next() + exp, err := strconv.ParseInt(p.parseInt(), 10, 0) + if err != nil { + p.error(err) + } + if exp < 0 { + denom := constant.MakeInt64(1) + denom = constant.Shift(denom, token.SHL, uint(-exp)) + typ = types.Typ[types.UntypedFloat] + val = constant.BinaryOp(mant, token.QUO, denom) + return + } + if exp > 0 { + mant = constant.Shift(mant, token.SHL, uint(exp)) + } + typ = types.Typ[types.UntypedFloat] + val = mant + return + } + + typ = types.Typ[types.UntypedInt] + val = mant + return +} + +// ConstDecl = "const" ExportedName [ Type ] "=" Literal . +// Literal = bool_lit | int_lit | float_lit | complex_lit | rune_lit | string_lit . +// bool_lit = "true" | "false" . +// complex_lit = "(" float_lit "+" float_lit "i" ")" . +// rune_lit = "(" int_lit "+" int_lit ")" . +// string_lit = `"` { unicode_char } `"` . +// +func (p *parser) parseConstDecl() { + p.expectKeyword("const") + pkg, name := p.parseExportedName() + + var typ0 types.Type + if p.tok != '=' { + // constant types are never structured - no need for parent type + typ0 = p.parseType(nil) + } + + p.expect('=') + var typ types.Type + var val constant.Value + switch p.tok { + case scanner.Ident: + // bool_lit + if p.lit != "true" && p.lit != "false" { + p.error("expected true or false") + } + typ = types.Typ[types.UntypedBool] + val = constant.MakeBool(p.lit == "true") + p.next() + + case '-', scanner.Int: + // int_lit + typ, val = p.parseNumber() + + case '(': + // complex_lit or rune_lit + p.next() + if p.tok == scanner.Char { + p.next() + p.expect('+') + typ = types.Typ[types.UntypedRune] + _, val = p.parseNumber() + p.expect(')') + break + } + _, re := p.parseNumber() + p.expect('+') + _, im := p.parseNumber() + p.expectKeyword("i") + p.expect(')') + typ = types.Typ[types.UntypedComplex] + val = constant.BinaryOp(re, token.ADD, constant.MakeImag(im)) + + case scanner.Char: + // rune_lit + typ = types.Typ[types.UntypedRune] + val = constant.MakeFromLiteral(p.lit, token.CHAR, 0) + p.next() + + case scanner.String: + // string_lit + typ = types.Typ[types.UntypedString] + val = constant.MakeFromLiteral(p.lit, token.STRING, 0) + p.next() + + default: + p.errorf("expected literal got %s", scanner.TokenString(p.tok)) + } + + if typ0 == nil { + typ0 = typ + } + + pkg.Scope().Insert(types.NewConst(token.NoPos, pkg, name, typ0, val)) +} + +// TypeDecl = "type" ExportedName Type . +// +func (p *parser) parseTypeDecl() { + p.expectKeyword("type") + pkg, name := p.parseExportedName() + obj := declTypeName(pkg, name) + + // The type object may have been imported before and thus already + // have a type associated with it. We still need to parse the type + // structure, but throw it away if the object already has a type. + // This ensures that all imports refer to the same type object for + // a given type declaration. + typ := p.parseType(pkg) + + if name := obj.Type().(*types.Named); name.Underlying() == nil { + name.SetUnderlying(typ) + } +} + +// VarDecl = "var" ExportedName Type . +// +func (p *parser) parseVarDecl() { + p.expectKeyword("var") + pkg, name := p.parseExportedName() + typ := p.parseType(pkg) + pkg.Scope().Insert(types.NewVar(token.NoPos, pkg, name, typ)) +} + +// Func = Signature [ Body ] . +// Body = "{" ... "}" . +// +func (p *parser) parseFunc(recv *types.Var) *types.Signature { + sig := p.parseSignature(recv) + if p.tok == '{' { + p.next() + for i := 1; i > 0; p.next() { + switch p.tok { + case '{': + i++ + case '}': + i-- + } + } + } + return sig +} + +// MethodDecl = "func" Receiver Name Func . +// Receiver = "(" ( identifier | "?" ) [ "*" ] ExportedName ")" . +// +func (p *parser) parseMethodDecl() { + // "func" already consumed + p.expect('(') + recv, _ := p.parseParameter() // receiver + p.expect(')') + + // determine receiver base type object + base := deref(recv.Type()).(*types.Named) + + // parse method name, signature, and possibly inlined body + _, name := p.parseName(nil, false) + sig := p.parseFunc(recv) + + // methods always belong to the same package as the base type object + pkg := base.Obj().Pkg() + + // add method to type unless type was imported before + // and method exists already + // TODO(gri) This leads to a quadratic algorithm - ok for now because method counts are small. + base.AddMethod(types.NewFunc(token.NoPos, pkg, name, sig)) +} + +// FuncDecl = "func" ExportedName Func . +// +func (p *parser) parseFuncDecl() { + // "func" already consumed + pkg, name := p.parseExportedName() + typ := p.parseFunc(nil) + pkg.Scope().Insert(types.NewFunc(token.NoPos, pkg, name, typ)) +} + +// Decl = [ ImportDecl | ConstDecl | TypeDecl | VarDecl | FuncDecl | MethodDecl ] "\n" . +// +func (p *parser) parseDecl() { + if p.tok == scanner.Ident { + switch p.lit { + case "import": + p.parseImportDecl() + case "const": + p.parseConstDecl() + case "type": + p.parseTypeDecl() + case "var": + p.parseVarDecl() + case "func": + p.next() // look ahead + if p.tok == '(' { + p.parseMethodDecl() + } else { + p.parseFuncDecl() + } + } + } + p.expect('\n') +} + +// ---------------------------------------------------------------------------- +// Export + +// Export = "PackageClause { Decl } "$$" . +// PackageClause = "package" PackageName [ "safe" ] "\n" . +// +func (p *parser) parseExport() *types.Package { + p.expectKeyword("package") + name := p.parsePackageName() + if p.tok == scanner.Ident && p.lit == "safe" { + // package was compiled with -u option - ignore + p.next() + } + p.expect('\n') + + pkg := p.getPkg(p.id, name) + + for p.tok != '$' && p.tok != scanner.EOF { + p.parseDecl() + } + + if ch := p.scanner.Peek(); p.tok != '$' || ch != '$' { + // don't call next()/expect() since reading past the + // export data may cause scanner errors (e.g. NUL chars) + p.errorf("expected '$$', got %s %c", scanner.TokenString(p.tok), ch) + } + + if n := p.scanner.ErrorCount; n != 0 { + p.errorf("expected no scanner errors, got %d", n) + } + + // Record all locally referenced packages as imports. + var imports []*types.Package + for id, pkg2 := range p.localPkgs { + if pkg2.Name() == "" { + p.errorf("%s package has no name", id) + } + if id == p.id { + continue // avoid self-edge + } + imports = append(imports, pkg2) + } + sort.Sort(byPath(imports)) + pkg.SetImports(imports) + + // package was imported completely and without errors + pkg.MarkComplete() + + return pkg +} + +type byPath []*types.Package + +func (a byPath) Len() int { return len(a) } +func (a byPath) Swap(i, j int) { a[i], a[j] = a[j], a[i] } +func (a byPath) Less(i, j int) bool { return a[i].Path() < a[j].Path() } diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/iexport.go b/vendor/golang.org/x/tools/go/internal/gcimporter/iexport.go new file mode 100644 index 0000000000..4be32a2e55 --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/gcimporter/iexport.go @@ -0,0 +1,739 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Indexed binary package export. +// This file was derived from $GOROOT/src/cmd/compile/internal/gc/iexport.go; +// see that file for specification of the format. + +package gcimporter + +import ( + "bytes" + "encoding/binary" + "go/ast" + "go/constant" + "go/token" + "go/types" + "io" + "math/big" + "reflect" + "sort" +) + +// Current indexed export format version. Increase with each format change. +// 0: Go1.11 encoding +const iexportVersion = 0 + +// IExportData returns the binary export data for pkg. +// +// If no file set is provided, position info will be missing. +// The package path of the top-level package will not be recorded, +// so that calls to IImportData can override with a provided package path. +func IExportData(fset *token.FileSet, pkg *types.Package) (b []byte, err error) { + defer func() { + if e := recover(); e != nil { + if ierr, ok := e.(internalError); ok { + err = ierr + return + } + // Not an internal error; panic again. + panic(e) + } + }() + + p := iexporter{ + out: bytes.NewBuffer(nil), + fset: fset, + allPkgs: map[*types.Package]bool{}, + stringIndex: map[string]uint64{}, + declIndex: map[types.Object]uint64{}, + typIndex: map[types.Type]uint64{}, + localpkg: pkg, + } + + for i, pt := range predeclared() { + p.typIndex[pt] = uint64(i) + } + if len(p.typIndex) > predeclReserved { + panic(internalErrorf("too many predeclared types: %d > %d", len(p.typIndex), predeclReserved)) + } + + // Initialize work queue with exported declarations. + scope := pkg.Scope() + for _, name := range scope.Names() { + if ast.IsExported(name) { + p.pushDecl(scope.Lookup(name)) + } + } + + // Loop until no more work. + for !p.declTodo.empty() { + p.doDecl(p.declTodo.popHead()) + } + + // Append indices to data0 section. + dataLen := uint64(p.data0.Len()) + w := p.newWriter() + w.writeIndex(p.declIndex) + w.flush() + + // Assemble header. + var hdr intWriter + hdr.WriteByte('i') + hdr.uint64(iexportVersion) + hdr.uint64(uint64(p.strings.Len())) + hdr.uint64(dataLen) + + // Flush output. + io.Copy(p.out, &hdr) + io.Copy(p.out, &p.strings) + io.Copy(p.out, &p.data0) + + return p.out.Bytes(), nil +} + +// writeIndex writes out an object index. mainIndex indicates whether +// we're writing out the main index, which is also read by +// non-compiler tools and includes a complete package description +// (i.e., name and height). +func (w *exportWriter) writeIndex(index map[types.Object]uint64) { + // Build a map from packages to objects from that package. + pkgObjs := map[*types.Package][]types.Object{} + + // For the main index, make sure to include every package that + // we reference, even if we're not exporting (or reexporting) + // any symbols from it. + pkgObjs[w.p.localpkg] = nil + for pkg := range w.p.allPkgs { + pkgObjs[pkg] = nil + } + + for obj := range index { + pkgObjs[obj.Pkg()] = append(pkgObjs[obj.Pkg()], obj) + } + + var pkgs []*types.Package + for pkg, objs := range pkgObjs { + pkgs = append(pkgs, pkg) + + sort.Slice(objs, func(i, j int) bool { + return objs[i].Name() < objs[j].Name() + }) + } + + sort.Slice(pkgs, func(i, j int) bool { + return w.exportPath(pkgs[i]) < w.exportPath(pkgs[j]) + }) + + w.uint64(uint64(len(pkgs))) + for _, pkg := range pkgs { + w.string(w.exportPath(pkg)) + w.string(pkg.Name()) + w.uint64(uint64(0)) // package height is not needed for go/types + + objs := pkgObjs[pkg] + w.uint64(uint64(len(objs))) + for _, obj := range objs { + w.string(obj.Name()) + w.uint64(index[obj]) + } + } +} + +type iexporter struct { + fset *token.FileSet + out *bytes.Buffer + + localpkg *types.Package + + // allPkgs tracks all packages that have been referenced by + // the export data, so we can ensure to include them in the + // main index. + allPkgs map[*types.Package]bool + + declTodo objQueue + + strings intWriter + stringIndex map[string]uint64 + + data0 intWriter + declIndex map[types.Object]uint64 + typIndex map[types.Type]uint64 +} + +// stringOff returns the offset of s within the string section. +// If not already present, it's added to the end. +func (p *iexporter) stringOff(s string) uint64 { + off, ok := p.stringIndex[s] + if !ok { + off = uint64(p.strings.Len()) + p.stringIndex[s] = off + + p.strings.uint64(uint64(len(s))) + p.strings.WriteString(s) + } + return off +} + +// pushDecl adds n to the declaration work queue, if not already present. +func (p *iexporter) pushDecl(obj types.Object) { + // Package unsafe is known to the compiler and predeclared. + assert(obj.Pkg() != types.Unsafe) + + if _, ok := p.declIndex[obj]; ok { + return + } + + p.declIndex[obj] = ^uint64(0) // mark n present in work queue + p.declTodo.pushTail(obj) +} + +// exportWriter handles writing out individual data section chunks. +type exportWriter struct { + p *iexporter + + data intWriter + currPkg *types.Package + prevFile string + prevLine int64 +} + +func (w *exportWriter) exportPath(pkg *types.Package) string { + if pkg == w.p.localpkg { + return "" + } + return pkg.Path() +} + +func (p *iexporter) doDecl(obj types.Object) { + w := p.newWriter() + w.setPkg(obj.Pkg(), false) + + switch obj := obj.(type) { + case *types.Var: + w.tag('V') + w.pos(obj.Pos()) + w.typ(obj.Type(), obj.Pkg()) + + case *types.Func: + sig, _ := obj.Type().(*types.Signature) + if sig.Recv() != nil { + panic(internalErrorf("unexpected method: %v", sig)) + } + w.tag('F') + w.pos(obj.Pos()) + w.signature(sig) + + case *types.Const: + w.tag('C') + w.pos(obj.Pos()) + w.value(obj.Type(), obj.Val()) + + case *types.TypeName: + if obj.IsAlias() { + w.tag('A') + w.pos(obj.Pos()) + w.typ(obj.Type(), obj.Pkg()) + break + } + + // Defined type. + w.tag('T') + w.pos(obj.Pos()) + + underlying := obj.Type().Underlying() + w.typ(underlying, obj.Pkg()) + + t := obj.Type() + if types.IsInterface(t) { + break + } + + named, ok := t.(*types.Named) + if !ok { + panic(internalErrorf("%s is not a defined type", t)) + } + + n := named.NumMethods() + w.uint64(uint64(n)) + for i := 0; i < n; i++ { + m := named.Method(i) + w.pos(m.Pos()) + w.string(m.Name()) + sig, _ := m.Type().(*types.Signature) + w.param(sig.Recv()) + w.signature(sig) + } + + default: + panic(internalErrorf("unexpected object: %v", obj)) + } + + p.declIndex[obj] = w.flush() +} + +func (w *exportWriter) tag(tag byte) { + w.data.WriteByte(tag) +} + +func (w *exportWriter) pos(pos token.Pos) { + if w.p.fset == nil { + w.int64(0) + return + } + + p := w.p.fset.Position(pos) + file := p.Filename + line := int64(p.Line) + + // When file is the same as the last position (common case), + // we can save a few bytes by delta encoding just the line + // number. + // + // Note: Because data objects may be read out of order (or not + // at all), we can only apply delta encoding within a single + // object. This is handled implicitly by tracking prevFile and + // prevLine as fields of exportWriter. + + if file == w.prevFile { + delta := line - w.prevLine + w.int64(delta) + if delta == deltaNewFile { + w.int64(-1) + } + } else { + w.int64(deltaNewFile) + w.int64(line) // line >= 0 + w.string(file) + w.prevFile = file + } + w.prevLine = line +} + +func (w *exportWriter) pkg(pkg *types.Package) { + // Ensure any referenced packages are declared in the main index. + w.p.allPkgs[pkg] = true + + w.string(w.exportPath(pkg)) +} + +func (w *exportWriter) qualifiedIdent(obj types.Object) { + // Ensure any referenced declarations are written out too. + w.p.pushDecl(obj) + + w.string(obj.Name()) + w.pkg(obj.Pkg()) +} + +func (w *exportWriter) typ(t types.Type, pkg *types.Package) { + w.data.uint64(w.p.typOff(t, pkg)) +} + +func (p *iexporter) newWriter() *exportWriter { + return &exportWriter{p: p} +} + +func (w *exportWriter) flush() uint64 { + off := uint64(w.p.data0.Len()) + io.Copy(&w.p.data0, &w.data) + return off +} + +func (p *iexporter) typOff(t types.Type, pkg *types.Package) uint64 { + off, ok := p.typIndex[t] + if !ok { + w := p.newWriter() + w.doTyp(t, pkg) + off = predeclReserved + w.flush() + p.typIndex[t] = off + } + return off +} + +func (w *exportWriter) startType(k itag) { + w.data.uint64(uint64(k)) +} + +func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) { + switch t := t.(type) { + case *types.Named: + w.startType(definedType) + w.qualifiedIdent(t.Obj()) + + case *types.Pointer: + w.startType(pointerType) + w.typ(t.Elem(), pkg) + + case *types.Slice: + w.startType(sliceType) + w.typ(t.Elem(), pkg) + + case *types.Array: + w.startType(arrayType) + w.uint64(uint64(t.Len())) + w.typ(t.Elem(), pkg) + + case *types.Chan: + w.startType(chanType) + // 1 RecvOnly; 2 SendOnly; 3 SendRecv + var dir uint64 + switch t.Dir() { + case types.RecvOnly: + dir = 1 + case types.SendOnly: + dir = 2 + case types.SendRecv: + dir = 3 + } + w.uint64(dir) + w.typ(t.Elem(), pkg) + + case *types.Map: + w.startType(mapType) + w.typ(t.Key(), pkg) + w.typ(t.Elem(), pkg) + + case *types.Signature: + w.startType(signatureType) + w.setPkg(pkg, true) + w.signature(t) + + case *types.Struct: + w.startType(structType) + w.setPkg(pkg, true) + + n := t.NumFields() + w.uint64(uint64(n)) + for i := 0; i < n; i++ { + f := t.Field(i) + w.pos(f.Pos()) + w.string(f.Name()) + w.typ(f.Type(), pkg) + w.bool(f.Anonymous()) + w.string(t.Tag(i)) // note (or tag) + } + + case *types.Interface: + w.startType(interfaceType) + w.setPkg(pkg, true) + + n := t.NumEmbeddeds() + w.uint64(uint64(n)) + for i := 0; i < n; i++ { + f := t.Embedded(i) + w.pos(f.Obj().Pos()) + w.typ(f.Obj().Type(), f.Obj().Pkg()) + } + + n = t.NumExplicitMethods() + w.uint64(uint64(n)) + for i := 0; i < n; i++ { + m := t.ExplicitMethod(i) + w.pos(m.Pos()) + w.string(m.Name()) + sig, _ := m.Type().(*types.Signature) + w.signature(sig) + } + + default: + panic(internalErrorf("unexpected type: %v, %v", t, reflect.TypeOf(t))) + } +} + +func (w *exportWriter) setPkg(pkg *types.Package, write bool) { + if write { + w.pkg(pkg) + } + + w.currPkg = pkg +} + +func (w *exportWriter) signature(sig *types.Signature) { + w.paramList(sig.Params()) + w.paramList(sig.Results()) + if sig.Params().Len() > 0 { + w.bool(sig.Variadic()) + } +} + +func (w *exportWriter) paramList(tup *types.Tuple) { + n := tup.Len() + w.uint64(uint64(n)) + for i := 0; i < n; i++ { + w.param(tup.At(i)) + } +} + +func (w *exportWriter) param(obj types.Object) { + w.pos(obj.Pos()) + w.localIdent(obj) + w.typ(obj.Type(), obj.Pkg()) +} + +func (w *exportWriter) value(typ types.Type, v constant.Value) { + w.typ(typ, nil) + + switch v.Kind() { + case constant.Bool: + w.bool(constant.BoolVal(v)) + case constant.Int: + var i big.Int + if i64, exact := constant.Int64Val(v); exact { + i.SetInt64(i64) + } else if ui64, exact := constant.Uint64Val(v); exact { + i.SetUint64(ui64) + } else { + i.SetString(v.ExactString(), 10) + } + w.mpint(&i, typ) + case constant.Float: + f := constantToFloat(v) + w.mpfloat(f, typ) + case constant.Complex: + w.mpfloat(constantToFloat(constant.Real(v)), typ) + w.mpfloat(constantToFloat(constant.Imag(v)), typ) + case constant.String: + w.string(constant.StringVal(v)) + case constant.Unknown: + // package contains type errors + default: + panic(internalErrorf("unexpected value %v (%T)", v, v)) + } +} + +// constantToFloat converts a constant.Value with kind constant.Float to a +// big.Float. +func constantToFloat(x constant.Value) *big.Float { + assert(x.Kind() == constant.Float) + // Use the same floating-point precision (512) as cmd/compile + // (see Mpprec in cmd/compile/internal/gc/mpfloat.go). + const mpprec = 512 + var f big.Float + f.SetPrec(mpprec) + if v, exact := constant.Float64Val(x); exact { + // float64 + f.SetFloat64(v) + } else if num, denom := constant.Num(x), constant.Denom(x); num.Kind() == constant.Int { + // TODO(gri): add big.Rat accessor to constant.Value. + n := valueToRat(num) + d := valueToRat(denom) + f.SetRat(n.Quo(n, d)) + } else { + // Value too large to represent as a fraction => inaccessible. + // TODO(gri): add big.Float accessor to constant.Value. + _, ok := f.SetString(x.ExactString()) + assert(ok) + } + return &f +} + +// mpint exports a multi-precision integer. +// +// For unsigned types, small values are written out as a single +// byte. Larger values are written out as a length-prefixed big-endian +// byte string, where the length prefix is encoded as its complement. +// For example, bytes 0, 1, and 2 directly represent the integer +// values 0, 1, and 2; while bytes 255, 254, and 253 indicate a 1-, +// 2-, and 3-byte big-endian string follow. +// +// Encoding for signed types use the same general approach as for +// unsigned types, except small values use zig-zag encoding and the +// bottom bit of length prefix byte for large values is reserved as a +// sign bit. +// +// The exact boundary between small and large encodings varies +// according to the maximum number of bytes needed to encode a value +// of type typ. As a special case, 8-bit types are always encoded as a +// single byte. +// +// TODO(mdempsky): Is this level of complexity really worthwhile? +func (w *exportWriter) mpint(x *big.Int, typ types.Type) { + basic, ok := typ.Underlying().(*types.Basic) + if !ok { + panic(internalErrorf("unexpected type %v (%T)", typ.Underlying(), typ.Underlying())) + } + + signed, maxBytes := intSize(basic) + + negative := x.Sign() < 0 + if !signed && negative { + panic(internalErrorf("negative unsigned integer; type %v, value %v", typ, x)) + } + + b := x.Bytes() + if len(b) > 0 && b[0] == 0 { + panic(internalErrorf("leading zeros")) + } + if uint(len(b)) > maxBytes { + panic(internalErrorf("bad mpint length: %d > %d (type %v, value %v)", len(b), maxBytes, typ, x)) + } + + maxSmall := 256 - maxBytes + if signed { + maxSmall = 256 - 2*maxBytes + } + if maxBytes == 1 { + maxSmall = 256 + } + + // Check if x can use small value encoding. + if len(b) <= 1 { + var ux uint + if len(b) == 1 { + ux = uint(b[0]) + } + if signed { + ux <<= 1 + if negative { + ux-- + } + } + if ux < maxSmall { + w.data.WriteByte(byte(ux)) + return + } + } + + n := 256 - uint(len(b)) + if signed { + n = 256 - 2*uint(len(b)) + if negative { + n |= 1 + } + } + if n < maxSmall || n >= 256 { + panic(internalErrorf("encoding mistake: %d, %v, %v => %d", len(b), signed, negative, n)) + } + + w.data.WriteByte(byte(n)) + w.data.Write(b) +} + +// mpfloat exports a multi-precision floating point number. +// +// The number's value is decomposed into mantissa × 2**exponent, where +// mantissa is an integer. The value is written out as mantissa (as a +// multi-precision integer) and then the exponent, except exponent is +// omitted if mantissa is zero. +func (w *exportWriter) mpfloat(f *big.Float, typ types.Type) { + if f.IsInf() { + panic("infinite constant") + } + + // Break into f = mant × 2**exp, with 0.5 <= mant < 1. + var mant big.Float + exp := int64(f.MantExp(&mant)) + + // Scale so that mant is an integer. + prec := mant.MinPrec() + mant.SetMantExp(&mant, int(prec)) + exp -= int64(prec) + + manti, acc := mant.Int(nil) + if acc != big.Exact { + panic(internalErrorf("mantissa scaling failed for %f (%s)", f, acc)) + } + w.mpint(manti, typ) + if manti.Sign() != 0 { + w.int64(exp) + } +} + +func (w *exportWriter) bool(b bool) bool { + var x uint64 + if b { + x = 1 + } + w.uint64(x) + return b +} + +func (w *exportWriter) int64(x int64) { w.data.int64(x) } +func (w *exportWriter) uint64(x uint64) { w.data.uint64(x) } +func (w *exportWriter) string(s string) { w.uint64(w.p.stringOff(s)) } + +func (w *exportWriter) localIdent(obj types.Object) { + // Anonymous parameters. + if obj == nil { + w.string("") + return + } + + name := obj.Name() + if name == "_" { + w.string("_") + return + } + + w.string(name) +} + +type intWriter struct { + bytes.Buffer +} + +func (w *intWriter) int64(x int64) { + var buf [binary.MaxVarintLen64]byte + n := binary.PutVarint(buf[:], x) + w.Write(buf[:n]) +} + +func (w *intWriter) uint64(x uint64) { + var buf [binary.MaxVarintLen64]byte + n := binary.PutUvarint(buf[:], x) + w.Write(buf[:n]) +} + +func assert(cond bool) { + if !cond { + panic("internal error: assertion failed") + } +} + +// The below is copied from go/src/cmd/compile/internal/gc/syntax.go. + +// objQueue is a FIFO queue of types.Object. The zero value of objQueue is +// a ready-to-use empty queue. +type objQueue struct { + ring []types.Object + head, tail int +} + +// empty returns true if q contains no Nodes. +func (q *objQueue) empty() bool { + return q.head == q.tail +} + +// pushTail appends n to the tail of the queue. +func (q *objQueue) pushTail(obj types.Object) { + if len(q.ring) == 0 { + q.ring = make([]types.Object, 16) + } else if q.head+len(q.ring) == q.tail { + // Grow the ring. + nring := make([]types.Object, len(q.ring)*2) + // Copy the old elements. + part := q.ring[q.head%len(q.ring):] + if q.tail-q.head <= len(part) { + part = part[:q.tail-q.head] + copy(nring, part) + } else { + pos := copy(nring, part) + copy(nring[pos:], q.ring[:q.tail%len(q.ring)]) + } + q.ring, q.head, q.tail = nring, 0, q.tail-q.head + } + + q.ring[q.tail%len(q.ring)] = obj + q.tail++ +} + +// popHead pops a node from the head of the queue. It panics if q is empty. +func (q *objQueue) popHead() types.Object { + if q.empty() { + panic("dequeue empty") + } + obj := q.ring[q.head%len(q.ring)] + q.head++ + return obj +} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go b/vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go new file mode 100644 index 0000000000..a31a880263 --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go @@ -0,0 +1,630 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Indexed package import. +// See cmd/compile/internal/gc/iexport.go for the export data format. + +// This file is a copy of $GOROOT/src/go/internal/gcimporter/iimport.go. + +package gcimporter + +import ( + "bytes" + "encoding/binary" + "fmt" + "go/constant" + "go/token" + "go/types" + "io" + "sort" +) + +type intReader struct { + *bytes.Reader + path string +} + +func (r *intReader) int64() int64 { + i, err := binary.ReadVarint(r.Reader) + if err != nil { + errorf("import %q: read varint error: %v", r.path, err) + } + return i +} + +func (r *intReader) uint64() uint64 { + i, err := binary.ReadUvarint(r.Reader) + if err != nil { + errorf("import %q: read varint error: %v", r.path, err) + } + return i +} + +const predeclReserved = 32 + +type itag uint64 + +const ( + // Types + definedType itag = iota + pointerType + sliceType + arrayType + chanType + mapType + signatureType + structType + interfaceType +) + +// IImportData imports a package from the serialized package data +// and returns the number of bytes consumed and a reference to the package. +// If the export data version is not recognized or the format is otherwise +// compromised, an error is returned. +func IImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) { + const currentVersion = 1 + version := int64(-1) + defer func() { + if e := recover(); e != nil { + if version > currentVersion { + err = fmt.Errorf("cannot import %q (%v), export data is newer version - update tool", path, e) + } else { + err = fmt.Errorf("cannot import %q (%v), possibly version skew - reinstall package", path, e) + } + } + }() + + r := &intReader{bytes.NewReader(data), path} + + version = int64(r.uint64()) + switch version { + case currentVersion, 0: + default: + errorf("unknown iexport format version %d", version) + } + + sLen := int64(r.uint64()) + dLen := int64(r.uint64()) + + whence, _ := r.Seek(0, io.SeekCurrent) + stringData := data[whence : whence+sLen] + declData := data[whence+sLen : whence+sLen+dLen] + r.Seek(sLen+dLen, io.SeekCurrent) + + p := iimporter{ + ipath: path, + version: int(version), + + stringData: stringData, + stringCache: make(map[uint64]string), + pkgCache: make(map[uint64]*types.Package), + + declData: declData, + pkgIndex: make(map[*types.Package]map[string]uint64), + typCache: make(map[uint64]types.Type), + + fake: fakeFileSet{ + fset: fset, + files: make(map[string]*token.File), + }, + } + + for i, pt := range predeclared() { + p.typCache[uint64(i)] = pt + } + + pkgList := make([]*types.Package, r.uint64()) + for i := range pkgList { + pkgPathOff := r.uint64() + pkgPath := p.stringAt(pkgPathOff) + pkgName := p.stringAt(r.uint64()) + _ = r.uint64() // package height; unused by go/types + + if pkgPath == "" { + pkgPath = path + } + pkg := imports[pkgPath] + if pkg == nil { + pkg = types.NewPackage(pkgPath, pkgName) + imports[pkgPath] = pkg + } else if pkg.Name() != pkgName { + errorf("conflicting names %s and %s for package %q", pkg.Name(), pkgName, path) + } + + p.pkgCache[pkgPathOff] = pkg + + nameIndex := make(map[string]uint64) + for nSyms := r.uint64(); nSyms > 0; nSyms-- { + name := p.stringAt(r.uint64()) + nameIndex[name] = r.uint64() + } + + p.pkgIndex[pkg] = nameIndex + pkgList[i] = pkg + } + if len(pkgList) == 0 { + errorf("no packages found for %s", path) + panic("unreachable") + } + p.ipkg = pkgList[0] + names := make([]string, 0, len(p.pkgIndex[p.ipkg])) + for name := range p.pkgIndex[p.ipkg] { + names = append(names, name) + } + sort.Strings(names) + for _, name := range names { + p.doDecl(p.ipkg, name) + } + + for _, typ := range p.interfaceList { + typ.Complete() + } + + // record all referenced packages as imports + list := append(([]*types.Package)(nil), pkgList[1:]...) + sort.Sort(byPath(list)) + p.ipkg.SetImports(list) + + // package was imported completely and without errors + p.ipkg.MarkComplete() + + consumed, _ := r.Seek(0, io.SeekCurrent) + return int(consumed), p.ipkg, nil +} + +type iimporter struct { + ipath string + ipkg *types.Package + version int + + stringData []byte + stringCache map[uint64]string + pkgCache map[uint64]*types.Package + + declData []byte + pkgIndex map[*types.Package]map[string]uint64 + typCache map[uint64]types.Type + + fake fakeFileSet + interfaceList []*types.Interface +} + +func (p *iimporter) doDecl(pkg *types.Package, name string) { + // See if we've already imported this declaration. + if obj := pkg.Scope().Lookup(name); obj != nil { + return + } + + off, ok := p.pkgIndex[pkg][name] + if !ok { + errorf("%v.%v not in index", pkg, name) + } + + r := &importReader{p: p, currPkg: pkg} + r.declReader.Reset(p.declData[off:]) + + r.obj(name) +} + +func (p *iimporter) stringAt(off uint64) string { + if s, ok := p.stringCache[off]; ok { + return s + } + + slen, n := binary.Uvarint(p.stringData[off:]) + if n <= 0 { + errorf("varint failed") + } + spos := off + uint64(n) + s := string(p.stringData[spos : spos+slen]) + p.stringCache[off] = s + return s +} + +func (p *iimporter) pkgAt(off uint64) *types.Package { + if pkg, ok := p.pkgCache[off]; ok { + return pkg + } + path := p.stringAt(off) + if path == p.ipath { + return p.ipkg + } + errorf("missing package %q in %q", path, p.ipath) + return nil +} + +func (p *iimporter) typAt(off uint64, base *types.Named) types.Type { + if t, ok := p.typCache[off]; ok && (base == nil || !isInterface(t)) { + return t + } + + if off < predeclReserved { + errorf("predeclared type missing from cache: %v", off) + } + + r := &importReader{p: p} + r.declReader.Reset(p.declData[off-predeclReserved:]) + t := r.doType(base) + + if base == nil || !isInterface(t) { + p.typCache[off] = t + } + return t +} + +type importReader struct { + p *iimporter + declReader bytes.Reader + currPkg *types.Package + prevFile string + prevLine int64 + prevColumn int64 +} + +func (r *importReader) obj(name string) { + tag := r.byte() + pos := r.pos() + + switch tag { + case 'A': + typ := r.typ() + + r.declare(types.NewTypeName(pos, r.currPkg, name, typ)) + + case 'C': + typ, val := r.value() + + r.declare(types.NewConst(pos, r.currPkg, name, typ, val)) + + case 'F': + sig := r.signature(nil) + + r.declare(types.NewFunc(pos, r.currPkg, name, sig)) + + case 'T': + // Types can be recursive. We need to setup a stub + // declaration before recursing. + obj := types.NewTypeName(pos, r.currPkg, name, nil) + named := types.NewNamed(obj, nil, nil) + r.declare(obj) + + underlying := r.p.typAt(r.uint64(), named).Underlying() + named.SetUnderlying(underlying) + + if !isInterface(underlying) { + for n := r.uint64(); n > 0; n-- { + mpos := r.pos() + mname := r.ident() + recv := r.param() + msig := r.signature(recv) + + named.AddMethod(types.NewFunc(mpos, r.currPkg, mname, msig)) + } + } + + case 'V': + typ := r.typ() + + r.declare(types.NewVar(pos, r.currPkg, name, typ)) + + default: + errorf("unexpected tag: %v", tag) + } +} + +func (r *importReader) declare(obj types.Object) { + obj.Pkg().Scope().Insert(obj) +} + +func (r *importReader) value() (typ types.Type, val constant.Value) { + typ = r.typ() + + switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType { + case types.IsBoolean: + val = constant.MakeBool(r.bool()) + + case types.IsString: + val = constant.MakeString(r.string()) + + case types.IsInteger: + val = r.mpint(b) + + case types.IsFloat: + val = r.mpfloat(b) + + case types.IsComplex: + re := r.mpfloat(b) + im := r.mpfloat(b) + val = constant.BinaryOp(re, token.ADD, constant.MakeImag(im)) + + default: + if b.Kind() == types.Invalid { + val = constant.MakeUnknown() + return + } + errorf("unexpected type %v", typ) // panics + panic("unreachable") + } + + return +} + +func intSize(b *types.Basic) (signed bool, maxBytes uint) { + if (b.Info() & types.IsUntyped) != 0 { + return true, 64 + } + + switch b.Kind() { + case types.Float32, types.Complex64: + return true, 3 + case types.Float64, types.Complex128: + return true, 7 + } + + signed = (b.Info() & types.IsUnsigned) == 0 + switch b.Kind() { + case types.Int8, types.Uint8: + maxBytes = 1 + case types.Int16, types.Uint16: + maxBytes = 2 + case types.Int32, types.Uint32: + maxBytes = 4 + default: + maxBytes = 8 + } + + return +} + +func (r *importReader) mpint(b *types.Basic) constant.Value { + signed, maxBytes := intSize(b) + + maxSmall := 256 - maxBytes + if signed { + maxSmall = 256 - 2*maxBytes + } + if maxBytes == 1 { + maxSmall = 256 + } + + n, _ := r.declReader.ReadByte() + if uint(n) < maxSmall { + v := int64(n) + if signed { + v >>= 1 + if n&1 != 0 { + v = ^v + } + } + return constant.MakeInt64(v) + } + + v := -n + if signed { + v = -(n &^ 1) >> 1 + } + if v < 1 || uint(v) > maxBytes { + errorf("weird decoding: %v, %v => %v", n, signed, v) + } + + buf := make([]byte, v) + io.ReadFull(&r.declReader, buf) + + // convert to little endian + // TODO(gri) go/constant should have a more direct conversion function + // (e.g., once it supports a big.Float based implementation) + for i, j := 0, len(buf)-1; i < j; i, j = i+1, j-1 { + buf[i], buf[j] = buf[j], buf[i] + } + + x := constant.MakeFromBytes(buf) + if signed && n&1 != 0 { + x = constant.UnaryOp(token.SUB, x, 0) + } + return x +} + +func (r *importReader) mpfloat(b *types.Basic) constant.Value { + x := r.mpint(b) + if constant.Sign(x) == 0 { + return x + } + + exp := r.int64() + switch { + case exp > 0: + x = constant.Shift(x, token.SHL, uint(exp)) + case exp < 0: + d := constant.Shift(constant.MakeInt64(1), token.SHL, uint(-exp)) + x = constant.BinaryOp(x, token.QUO, d) + } + return x +} + +func (r *importReader) ident() string { + return r.string() +} + +func (r *importReader) qualifiedIdent() (*types.Package, string) { + name := r.string() + pkg := r.pkg() + return pkg, name +} + +func (r *importReader) pos() token.Pos { + if r.p.version >= 1 { + r.posv1() + } else { + r.posv0() + } + + if r.prevFile == "" && r.prevLine == 0 && r.prevColumn == 0 { + return token.NoPos + } + return r.p.fake.pos(r.prevFile, int(r.prevLine), int(r.prevColumn)) +} + +func (r *importReader) posv0() { + delta := r.int64() + if delta != deltaNewFile { + r.prevLine += delta + } else if l := r.int64(); l == -1 { + r.prevLine += deltaNewFile + } else { + r.prevFile = r.string() + r.prevLine = l + } +} + +func (r *importReader) posv1() { + delta := r.int64() + r.prevColumn += delta >> 1 + if delta&1 != 0 { + delta = r.int64() + r.prevLine += delta >> 1 + if delta&1 != 0 { + r.prevFile = r.string() + } + } +} + +func (r *importReader) typ() types.Type { + return r.p.typAt(r.uint64(), nil) +} + +func isInterface(t types.Type) bool { + _, ok := t.(*types.Interface) + return ok +} + +func (r *importReader) pkg() *types.Package { return r.p.pkgAt(r.uint64()) } +func (r *importReader) string() string { return r.p.stringAt(r.uint64()) } + +func (r *importReader) doType(base *types.Named) types.Type { + switch k := r.kind(); k { + default: + errorf("unexpected kind tag in %q: %v", r.p.ipath, k) + return nil + + case definedType: + pkg, name := r.qualifiedIdent() + r.p.doDecl(pkg, name) + return pkg.Scope().Lookup(name).(*types.TypeName).Type() + case pointerType: + return types.NewPointer(r.typ()) + case sliceType: + return types.NewSlice(r.typ()) + case arrayType: + n := r.uint64() + return types.NewArray(r.typ(), int64(n)) + case chanType: + dir := chanDir(int(r.uint64())) + return types.NewChan(dir, r.typ()) + case mapType: + return types.NewMap(r.typ(), r.typ()) + case signatureType: + r.currPkg = r.pkg() + return r.signature(nil) + + case structType: + r.currPkg = r.pkg() + + fields := make([]*types.Var, r.uint64()) + tags := make([]string, len(fields)) + for i := range fields { + fpos := r.pos() + fname := r.ident() + ftyp := r.typ() + emb := r.bool() + tag := r.string() + + fields[i] = types.NewField(fpos, r.currPkg, fname, ftyp, emb) + tags[i] = tag + } + return types.NewStruct(fields, tags) + + case interfaceType: + r.currPkg = r.pkg() + + embeddeds := make([]types.Type, r.uint64()) + for i := range embeddeds { + _ = r.pos() + embeddeds[i] = r.typ() + } + + methods := make([]*types.Func, r.uint64()) + for i := range methods { + mpos := r.pos() + mname := r.ident() + + // TODO(mdempsky): Matches bimport.go, but I + // don't agree with this. + var recv *types.Var + if base != nil { + recv = types.NewVar(token.NoPos, r.currPkg, "", base) + } + + msig := r.signature(recv) + methods[i] = types.NewFunc(mpos, r.currPkg, mname, msig) + } + + typ := newInterface(methods, embeddeds) + r.p.interfaceList = append(r.p.interfaceList, typ) + return typ + } +} + +func (r *importReader) kind() itag { + return itag(r.uint64()) +} + +func (r *importReader) signature(recv *types.Var) *types.Signature { + params := r.paramList() + results := r.paramList() + variadic := params.Len() > 0 && r.bool() + return types.NewSignature(recv, params, results, variadic) +} + +func (r *importReader) paramList() *types.Tuple { + xs := make([]*types.Var, r.uint64()) + for i := range xs { + xs[i] = r.param() + } + return types.NewTuple(xs...) +} + +func (r *importReader) param() *types.Var { + pos := r.pos() + name := r.ident() + typ := r.typ() + return types.NewParam(pos, r.currPkg, name, typ) +} + +func (r *importReader) bool() bool { + return r.uint64() != 0 +} + +func (r *importReader) int64() int64 { + n, err := binary.ReadVarint(&r.declReader) + if err != nil { + errorf("readVarint: %v", err) + } + return n +} + +func (r *importReader) uint64() uint64 { + n, err := binary.ReadUvarint(&r.declReader) + if err != nil { + errorf("readUvarint: %v", err) + } + return n +} + +func (r *importReader) byte() byte { + x, err := r.declReader.ReadByte() + if err != nil { + errorf("declReader.ReadByte: %v", err) + } + return x +} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface10.go b/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface10.go new file mode 100644 index 0000000000..463f252271 --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface10.go @@ -0,0 +1,21 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.11 + +package gcimporter + +import "go/types" + +func newInterface(methods []*types.Func, embeddeds []types.Type) *types.Interface { + named := make([]*types.Named, len(embeddeds)) + for i, e := range embeddeds { + var ok bool + named[i], ok = e.(*types.Named) + if !ok { + panic("embedding of non-defined interfaces in interfaces is not supported before Go 1.11") + } + } + return types.NewInterface(methods, named) +} diff --git a/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface11.go b/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface11.go new file mode 100644 index 0000000000..ab28b95cbb --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/gcimporter/newInterface11.go @@ -0,0 +1,13 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.11 + +package gcimporter + +import "go/types" + +func newInterface(methods []*types.Func, embeddeds []types.Type) *types.Interface { + return types.NewInterfaceType(methods, embeddeds) +} diff --git a/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go b/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go new file mode 100644 index 0000000000..f4d73b2339 --- /dev/null +++ b/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go @@ -0,0 +1,49 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package packagesdriver fetches type sizes for go/packages and go/analysis. +package packagesdriver + +import ( + "context" + "fmt" + "go/types" + "strings" + + "golang.org/x/tools/internal/gocommand" +) + +var debug = false + +func GetSizesGolist(ctx context.Context, inv gocommand.Invocation, gocmdRunner *gocommand.Runner) (types.Sizes, error) { + inv.Verb = "list" + inv.Args = []string{"-f", "{{context.GOARCH}} {{context.Compiler}}", "--", "unsafe"} + stdout, stderr, friendlyErr, rawErr := gocmdRunner.RunRaw(ctx, inv) + var goarch, compiler string + if rawErr != nil { + if strings.Contains(rawErr.Error(), "cannot find main module") { + // User's running outside of a module. All bets are off. Get GOARCH and guess compiler is gc. + // TODO(matloob): Is this a problem in practice? + inv.Verb = "env" + inv.Args = []string{"GOARCH"} + envout, enverr := gocmdRunner.Run(ctx, inv) + if enverr != nil { + return nil, enverr + } + goarch = strings.TrimSpace(envout.String()) + compiler = "gc" + } else { + return nil, friendlyErr + } + } else { + fields := strings.Fields(stdout.String()) + if len(fields) < 2 { + return nil, fmt.Errorf("could not parse GOARCH and Go compiler in format \" \":\nstdout: <<%s>>\nstderr: <<%s>>", + stdout.String(), stderr.String()) + } + goarch = fields[0] + compiler = fields[1] + } + return types.SizesFor(compiler, goarch), nil +} diff --git a/vendor/golang.org/x/tools/go/packages/doc.go b/vendor/golang.org/x/tools/go/packages/doc.go new file mode 100644 index 0000000000..4bfe28a51f --- /dev/null +++ b/vendor/golang.org/x/tools/go/packages/doc.go @@ -0,0 +1,221 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Package packages loads Go packages for inspection and analysis. + +The Load function takes as input a list of patterns and return a list of Package +structs describing individual packages matched by those patterns. +The LoadMode controls the amount of detail in the loaded packages. + +Load passes most patterns directly to the underlying build tool, +but all patterns with the prefix "query=", where query is a +non-empty string of letters from [a-z], are reserved and may be +interpreted as query operators. + +Two query operators are currently supported: "file" and "pattern". + +The query "file=path/to/file.go" matches the package or packages enclosing +the Go source file path/to/file.go. For example "file=~/go/src/fmt/print.go" +might return the packages "fmt" and "fmt [fmt.test]". + +The query "pattern=string" causes "string" to be passed directly to +the underlying build tool. In most cases this is unnecessary, +but an application can use Load("pattern=" + x) as an escaping mechanism +to ensure that x is not interpreted as a query operator if it contains '='. + +All other query operators are reserved for future use and currently +cause Load to report an error. + +The Package struct provides basic information about the package, including + + - ID, a unique identifier for the package in the returned set; + - GoFiles, the names of the package's Go source files; + - Imports, a map from source import strings to the Packages they name; + - Types, the type information for the package's exported symbols; + - Syntax, the parsed syntax trees for the package's source code; and + - TypeInfo, the result of a complete type-check of the package syntax trees. + +(See the documentation for type Package for the complete list of fields +and more detailed descriptions.) + +For example, + + Load(nil, "bytes", "unicode...") + +returns four Package structs describing the standard library packages +bytes, unicode, unicode/utf16, and unicode/utf8. Note that one pattern +can match multiple packages and that a package might be matched by +multiple patterns: in general it is not possible to determine which +packages correspond to which patterns. + +Note that the list returned by Load contains only the packages matched +by the patterns. Their dependencies can be found by walking the import +graph using the Imports fields. + +The Load function can be configured by passing a pointer to a Config as +the first argument. A nil Config is equivalent to the zero Config, which +causes Load to run in LoadFiles mode, collecting minimal information. +See the documentation for type Config for details. + +As noted earlier, the Config.Mode controls the amount of detail +reported about the loaded packages. See the documentation for type LoadMode +for details. + +Most tools should pass their command-line arguments (after any flags) +uninterpreted to the loader, so that the loader can interpret them +according to the conventions of the underlying build system. +See the Example function for typical usage. + +*/ +package packages // import "golang.org/x/tools/go/packages" + +/* + +Motivation and design considerations + +The new package's design solves problems addressed by two existing +packages: go/build, which locates and describes packages, and +golang.org/x/tools/go/loader, which loads, parses and type-checks them. +The go/build.Package structure encodes too much of the 'go build' way +of organizing projects, leaving us in need of a data type that describes a +package of Go source code independent of the underlying build system. +We wanted something that works equally well with go build and vgo, and +also other build systems such as Bazel and Blaze, making it possible to +construct analysis tools that work in all these environments. +Tools such as errcheck and staticcheck were essentially unavailable to +the Go community at Google, and some of Google's internal tools for Go +are unavailable externally. +This new package provides a uniform way to obtain package metadata by +querying each of these build systems, optionally supporting their +preferred command-line notations for packages, so that tools integrate +neatly with users' build environments. The Metadata query function +executes an external query tool appropriate to the current workspace. + +Loading packages always returns the complete import graph "all the way down", +even if all you want is information about a single package, because the query +mechanisms of all the build systems we currently support ({go,vgo} list, and +blaze/bazel aspect-based query) cannot provide detailed information +about one package without visiting all its dependencies too, so there is +no additional asymptotic cost to providing transitive information. +(This property might not be true of a hypothetical 5th build system.) + +In calls to TypeCheck, all initial packages, and any package that +transitively depends on one of them, must be loaded from source. +Consider A->B->C->D->E: if A,C are initial, A,B,C must be loaded from +source; D may be loaded from export data, and E may not be loaded at all +(though it's possible that D's export data mentions it, so a +types.Package may be created for it and exposed.) + +The old loader had a feature to suppress type-checking of function +bodies on a per-package basis, primarily intended to reduce the work of +obtaining type information for imported packages. Now that imports are +satisfied by export data, the optimization no longer seems necessary. + +Despite some early attempts, the old loader did not exploit export data, +instead always using the equivalent of WholeProgram mode. This was due +to the complexity of mixing source and export data packages (now +resolved by the upward traversal mentioned above), and because export data +files were nearly always missing or stale. Now that 'go build' supports +caching, all the underlying build systems can guarantee to produce +export data in a reasonable (amortized) time. + +Test "main" packages synthesized by the build system are now reported as +first-class packages, avoiding the need for clients (such as go/ssa) to +reinvent this generation logic. + +One way in which go/packages is simpler than the old loader is in its +treatment of in-package tests. In-package tests are packages that +consist of all the files of the library under test, plus the test files. +The old loader constructed in-package tests by a two-phase process of +mutation called "augmentation": first it would construct and type check +all the ordinary library packages and type-check the packages that +depend on them; then it would add more (test) files to the package and +type-check again. This two-phase approach had four major problems: +1) in processing the tests, the loader modified the library package, + leaving no way for a client application to see both the test + package and the library package; one would mutate into the other. +2) because test files can declare additional methods on types defined in + the library portion of the package, the dispatch of method calls in + the library portion was affected by the presence of the test files. + This should have been a clue that the packages were logically + different. +3) this model of "augmentation" assumed at most one in-package test + per library package, which is true of projects using 'go build', + but not other build systems. +4) because of the two-phase nature of test processing, all packages that + import the library package had to be processed before augmentation, + forcing a "one-shot" API and preventing the client from calling Load + in several times in sequence as is now possible in WholeProgram mode. + (TypeCheck mode has a similar one-shot restriction for a different reason.) + +Early drafts of this package supported "multi-shot" operation. +Although it allowed clients to make a sequence of calls (or concurrent +calls) to Load, building up the graph of Packages incrementally, +it was of marginal value: it complicated the API +(since it allowed some options to vary across calls but not others), +it complicated the implementation, +it cannot be made to work in Types mode, as explained above, +and it was less efficient than making one combined call (when this is possible). +Among the clients we have inspected, none made multiple calls to load +but could not be easily and satisfactorily modified to make only a single call. +However, applications changes may be required. +For example, the ssadump command loads the user-specified packages +and in addition the runtime package. It is tempting to simply append +"runtime" to the user-provided list, but that does not work if the user +specified an ad-hoc package such as [a.go b.go]. +Instead, ssadump no longer requests the runtime package, +but seeks it among the dependencies of the user-specified packages, +and emits an error if it is not found. + +Overlays: The Overlay field in the Config allows providing alternate contents +for Go source files, by providing a mapping from file path to contents. +go/packages will pull in new imports added in overlay files when go/packages +is run in LoadImports mode or greater. +Overlay support for the go list driver isn't complete yet: if the file doesn't +exist on disk, it will only be recognized in an overlay if it is a non-test file +and the package would be reported even without the overlay. + +Questions & Tasks + +- Add GOARCH/GOOS? + They are not portable concepts, but could be made portable. + Our goal has been to allow users to express themselves using the conventions + of the underlying build system: if the build system honors GOARCH + during a build and during a metadata query, then so should + applications built atop that query mechanism. + Conversely, if the target architecture of the build is determined by + command-line flags, the application can pass the relevant + flags through to the build system using a command such as: + myapp -query_flag="--cpu=amd64" -query_flag="--os=darwin" + However, this approach is low-level, unwieldy, and non-portable. + GOOS and GOARCH seem important enough to warrant a dedicated option. + +- How should we handle partial failures such as a mixture of good and + malformed patterns, existing and non-existent packages, successful and + failed builds, import failures, import cycles, and so on, in a call to + Load? + +- Support bazel, blaze, and go1.10 list, not just go1.11 list. + +- Handle (and test) various partial success cases, e.g. + a mixture of good packages and: + invalid patterns + nonexistent packages + empty packages + packages with malformed package or import declarations + unreadable files + import cycles + other parse errors + type errors + Make sure we record errors at the correct place in the graph. + +- Missing packages among initial arguments are not reported. + Return bogus packages for them, like golist does. + +- "undeclared name" errors (for example) are reported out of source file + order. I suspect this is due to the breadth-first resolution now used + by go/types. Is that a bug? Discuss with gri. + +*/ diff --git a/vendor/golang.org/x/tools/go/packages/external.go b/vendor/golang.org/x/tools/go/packages/external.go new file mode 100644 index 0000000000..7242a0a7d2 --- /dev/null +++ b/vendor/golang.org/x/tools/go/packages/external.go @@ -0,0 +1,101 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file enables an external tool to intercept package requests. +// If the tool is present then its results are used in preference to +// the go list command. + +package packages + +import ( + "bytes" + "encoding/json" + "fmt" + exec "golang.org/x/sys/execabs" + "os" + "strings" +) + +// The Driver Protocol +// +// The driver, given the inputs to a call to Load, returns metadata about the packages specified. +// This allows for different build systems to support go/packages by telling go/packages how the +// packages' source is organized. +// The driver is a binary, either specified by the GOPACKAGESDRIVER environment variable or in +// the path as gopackagesdriver. It's given the inputs to load in its argv. See the package +// documentation in doc.go for the full description of the patterns that need to be supported. +// A driver receives as a JSON-serialized driverRequest struct in standard input and will +// produce a JSON-serialized driverResponse (see definition in packages.go) in its standard output. + +// driverRequest is used to provide the portion of Load's Config that is needed by a driver. +type driverRequest struct { + Mode LoadMode `json:"mode"` + // Env specifies the environment the underlying build system should be run in. + Env []string `json:"env"` + // BuildFlags are flags that should be passed to the underlying build system. + BuildFlags []string `json:"build_flags"` + // Tests specifies whether the patterns should also return test packages. + Tests bool `json:"tests"` + // Overlay maps file paths (relative to the driver's working directory) to the byte contents + // of overlay files. + Overlay map[string][]byte `json:"overlay"` +} + +// findExternalDriver returns the file path of a tool that supplies +// the build system package structure, or "" if not found." +// If GOPACKAGESDRIVER is set in the environment findExternalTool returns its +// value, otherwise it searches for a binary named gopackagesdriver on the PATH. +func findExternalDriver(cfg *Config) driver { + const toolPrefix = "GOPACKAGESDRIVER=" + tool := "" + for _, env := range cfg.Env { + if val := strings.TrimPrefix(env, toolPrefix); val != env { + tool = val + } + } + if tool != "" && tool == "off" { + return nil + } + if tool == "" { + var err error + tool, err = exec.LookPath("gopackagesdriver") + if err != nil { + return nil + } + } + return func(cfg *Config, words ...string) (*driverResponse, error) { + req, err := json.Marshal(driverRequest{ + Mode: cfg.Mode, + Env: cfg.Env, + BuildFlags: cfg.BuildFlags, + Tests: cfg.Tests, + Overlay: cfg.Overlay, + }) + if err != nil { + return nil, fmt.Errorf("failed to encode message to driver tool: %v", err) + } + + buf := new(bytes.Buffer) + stderr := new(bytes.Buffer) + cmd := exec.CommandContext(cfg.Context, tool, words...) + cmd.Dir = cfg.Dir + cmd.Env = cfg.Env + cmd.Stdin = bytes.NewReader(req) + cmd.Stdout = buf + cmd.Stderr = stderr + + if err := cmd.Run(); err != nil { + return nil, fmt.Errorf("%v: %v: %s", tool, err, cmd.Stderr) + } + if len(stderr.Bytes()) != 0 && os.Getenv("GOPACKAGESPRINTDRIVERERRORS") != "" { + fmt.Fprintf(os.Stderr, "%s stderr: <<%s>>\n", cmdDebugStr(cmd), stderr) + } + + var response driverResponse + if err := json.Unmarshal(buf.Bytes(), &response); err != nil { + return nil, err + } + return &response, nil + } +} diff --git a/vendor/golang.org/x/tools/go/packages/golist.go b/vendor/golang.org/x/tools/go/packages/golist.go new file mode 100644 index 0000000000..ec417ba830 --- /dev/null +++ b/vendor/golang.org/x/tools/go/packages/golist.go @@ -0,0 +1,1096 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package packages + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "go/types" + exec "golang.org/x/sys/execabs" + "io/ioutil" + "log" + "os" + "path" + "path/filepath" + "reflect" + "sort" + "strconv" + "strings" + "sync" + "unicode" + + "golang.org/x/tools/go/internal/packagesdriver" + "golang.org/x/tools/internal/gocommand" + "golang.org/x/xerrors" +) + +// debug controls verbose logging. +var debug, _ = strconv.ParseBool(os.Getenv("GOPACKAGESDEBUG")) + +// A goTooOldError reports that the go command +// found by exec.LookPath is too old to use the new go list behavior. +type goTooOldError struct { + error +} + +// responseDeduper wraps a driverResponse, deduplicating its contents. +type responseDeduper struct { + seenRoots map[string]bool + seenPackages map[string]*Package + dr *driverResponse +} + +func newDeduper() *responseDeduper { + return &responseDeduper{ + dr: &driverResponse{}, + seenRoots: map[string]bool{}, + seenPackages: map[string]*Package{}, + } +} + +// addAll fills in r with a driverResponse. +func (r *responseDeduper) addAll(dr *driverResponse) { + for _, pkg := range dr.Packages { + r.addPackage(pkg) + } + for _, root := range dr.Roots { + r.addRoot(root) + } +} + +func (r *responseDeduper) addPackage(p *Package) { + if r.seenPackages[p.ID] != nil { + return + } + r.seenPackages[p.ID] = p + r.dr.Packages = append(r.dr.Packages, p) +} + +func (r *responseDeduper) addRoot(id string) { + if r.seenRoots[id] { + return + } + r.seenRoots[id] = true + r.dr.Roots = append(r.dr.Roots, id) +} + +type golistState struct { + cfg *Config + ctx context.Context + + envOnce sync.Once + goEnvError error + goEnv map[string]string + + rootsOnce sync.Once + rootDirsError error + rootDirs map[string]string + + goVersionOnce sync.Once + goVersionError error + goVersion int // The X in Go 1.X. + + // vendorDirs caches the (non)existence of vendor directories. + vendorDirs map[string]bool +} + +// getEnv returns Go environment variables. Only specific variables are +// populated -- computing all of them is slow. +func (state *golistState) getEnv() (map[string]string, error) { + state.envOnce.Do(func() { + var b *bytes.Buffer + b, state.goEnvError = state.invokeGo("env", "-json", "GOMOD", "GOPATH") + if state.goEnvError != nil { + return + } + + state.goEnv = make(map[string]string) + decoder := json.NewDecoder(b) + if state.goEnvError = decoder.Decode(&state.goEnv); state.goEnvError != nil { + return + } + }) + return state.goEnv, state.goEnvError +} + +// mustGetEnv is a convenience function that can be used if getEnv has already succeeded. +func (state *golistState) mustGetEnv() map[string]string { + env, err := state.getEnv() + if err != nil { + panic(fmt.Sprintf("mustGetEnv: %v", err)) + } + return env +} + +// goListDriver uses the go list command to interpret the patterns and produce +// the build system package structure. +// See driver for more details. +func goListDriver(cfg *Config, patterns ...string) (*driverResponse, error) { + // Make sure that any asynchronous go commands are killed when we return. + parentCtx := cfg.Context + if parentCtx == nil { + parentCtx = context.Background() + } + ctx, cancel := context.WithCancel(parentCtx) + defer cancel() + + response := newDeduper() + + state := &golistState{ + cfg: cfg, + ctx: ctx, + vendorDirs: map[string]bool{}, + } + + // Fill in response.Sizes asynchronously if necessary. + var sizeserr error + var sizeswg sync.WaitGroup + if cfg.Mode&NeedTypesSizes != 0 || cfg.Mode&NeedTypes != 0 { + sizeswg.Add(1) + go func() { + var sizes types.Sizes + sizes, sizeserr = packagesdriver.GetSizesGolist(ctx, state.cfgInvocation(), cfg.gocmdRunner) + // types.SizesFor always returns nil or a *types.StdSizes. + response.dr.Sizes, _ = sizes.(*types.StdSizes) + sizeswg.Done() + }() + } + + // Determine files requested in contains patterns + var containFiles []string + restPatterns := make([]string, 0, len(patterns)) + // Extract file= and other [querytype]= patterns. Report an error if querytype + // doesn't exist. +extractQueries: + for _, pattern := range patterns { + eqidx := strings.Index(pattern, "=") + if eqidx < 0 { + restPatterns = append(restPatterns, pattern) + } else { + query, value := pattern[:eqidx], pattern[eqidx+len("="):] + switch query { + case "file": + containFiles = append(containFiles, value) + case "pattern": + restPatterns = append(restPatterns, value) + case "": // not a reserved query + restPatterns = append(restPatterns, pattern) + default: + for _, rune := range query { + if rune < 'a' || rune > 'z' { // not a reserved query + restPatterns = append(restPatterns, pattern) + continue extractQueries + } + } + // Reject all other patterns containing "=" + return nil, fmt.Errorf("invalid query type %q in query pattern %q", query, pattern) + } + } + } + + // See if we have any patterns to pass through to go list. Zero initial + // patterns also requires a go list call, since it's the equivalent of + // ".". + if len(restPatterns) > 0 || len(patterns) == 0 { + dr, err := state.createDriverResponse(restPatterns...) + if err != nil { + return nil, err + } + response.addAll(dr) + } + + if len(containFiles) != 0 { + if err := state.runContainsQueries(response, containFiles); err != nil { + return nil, err + } + } + + // Only use go/packages' overlay processing if we're using a Go version + // below 1.16. Otherwise, go list handles it. + if goVersion, err := state.getGoVersion(); err == nil && goVersion < 16 { + modifiedPkgs, needPkgs, err := state.processGolistOverlay(response) + if err != nil { + return nil, err + } + + var containsCandidates []string + if len(containFiles) > 0 { + containsCandidates = append(containsCandidates, modifiedPkgs...) + containsCandidates = append(containsCandidates, needPkgs...) + } + if err := state.addNeededOverlayPackages(response, needPkgs); err != nil { + return nil, err + } + // Check candidate packages for containFiles. + if len(containFiles) > 0 { + for _, id := range containsCandidates { + pkg, ok := response.seenPackages[id] + if !ok { + response.addPackage(&Package{ + ID: id, + Errors: []Error{{ + Kind: ListError, + Msg: fmt.Sprintf("package %s expected but not seen", id), + }}, + }) + continue + } + for _, f := range containFiles { + for _, g := range pkg.GoFiles { + if sameFile(f, g) { + response.addRoot(id) + } + } + } + } + } + // Add root for any package that matches a pattern. This applies only to + // packages that are modified by overlays, since they are not added as + // roots automatically. + for _, pattern := range restPatterns { + match := matchPattern(pattern) + for _, pkgID := range modifiedPkgs { + pkg, ok := response.seenPackages[pkgID] + if !ok { + continue + } + if match(pkg.PkgPath) { + response.addRoot(pkg.ID) + } + } + } + } + + sizeswg.Wait() + if sizeserr != nil { + return nil, sizeserr + } + return response.dr, nil +} + +func (state *golistState) addNeededOverlayPackages(response *responseDeduper, pkgs []string) error { + if len(pkgs) == 0 { + return nil + } + dr, err := state.createDriverResponse(pkgs...) + if err != nil { + return err + } + for _, pkg := range dr.Packages { + response.addPackage(pkg) + } + _, needPkgs, err := state.processGolistOverlay(response) + if err != nil { + return err + } + return state.addNeededOverlayPackages(response, needPkgs) +} + +func (state *golistState) runContainsQueries(response *responseDeduper, queries []string) error { + for _, query := range queries { + // TODO(matloob): Do only one query per directory. + fdir := filepath.Dir(query) + // Pass absolute path of directory to go list so that it knows to treat it as a directory, + // not a package path. + pattern, err := filepath.Abs(fdir) + if err != nil { + return fmt.Errorf("could not determine absolute path of file= query path %q: %v", query, err) + } + dirResponse, err := state.createDriverResponse(pattern) + + // If there was an error loading the package, or the package is returned + // with errors, try to load the file as an ad-hoc package. + // Usually the error will appear in a returned package, but may not if we're + // in module mode and the ad-hoc is located outside a module. + if err != nil || len(dirResponse.Packages) == 1 && len(dirResponse.Packages[0].GoFiles) == 0 && + len(dirResponse.Packages[0].Errors) == 1 { + var queryErr error + if dirResponse, queryErr = state.adhocPackage(pattern, query); queryErr != nil { + return err // return the original error + } + } + isRoot := make(map[string]bool, len(dirResponse.Roots)) + for _, root := range dirResponse.Roots { + isRoot[root] = true + } + for _, pkg := range dirResponse.Packages { + // Add any new packages to the main set + // We don't bother to filter packages that will be dropped by the changes of roots, + // that will happen anyway during graph construction outside this function. + // Over-reporting packages is not a problem. + response.addPackage(pkg) + // if the package was not a root one, it cannot have the file + if !isRoot[pkg.ID] { + continue + } + for _, pkgFile := range pkg.GoFiles { + if filepath.Base(query) == filepath.Base(pkgFile) { + response.addRoot(pkg.ID) + break + } + } + } + } + return nil +} + +// adhocPackage attempts to load or construct an ad-hoc package for a given +// query, if the original call to the driver produced inadequate results. +func (state *golistState) adhocPackage(pattern, query string) (*driverResponse, error) { + response, err := state.createDriverResponse(query) + if err != nil { + return nil, err + } + // If we get nothing back from `go list`, + // try to make this file into its own ad-hoc package. + // TODO(rstambler): Should this check against the original response? + if len(response.Packages) == 0 { + response.Packages = append(response.Packages, &Package{ + ID: "command-line-arguments", + PkgPath: query, + GoFiles: []string{query}, + CompiledGoFiles: []string{query}, + Imports: make(map[string]*Package), + }) + response.Roots = append(response.Roots, "command-line-arguments") + } + // Handle special cases. + if len(response.Packages) == 1 { + // golang/go#33482: If this is a file= query for ad-hoc packages where + // the file only exists on an overlay, and exists outside of a module, + // add the file to the package and remove the errors. + if response.Packages[0].ID == "command-line-arguments" || + filepath.ToSlash(response.Packages[0].PkgPath) == filepath.ToSlash(query) { + if len(response.Packages[0].GoFiles) == 0 { + filename := filepath.Join(pattern, filepath.Base(query)) // avoid recomputing abspath + // TODO(matloob): check if the file is outside of a root dir? + for path := range state.cfg.Overlay { + if path == filename { + response.Packages[0].Errors = nil + response.Packages[0].GoFiles = []string{path} + response.Packages[0].CompiledGoFiles = []string{path} + } + } + } + } + } + return response, nil +} + +// Fields must match go list; +// see $GOROOT/src/cmd/go/internal/load/pkg.go. +type jsonPackage struct { + ImportPath string + Dir string + Name string + Export string + GoFiles []string + CompiledGoFiles []string + IgnoredGoFiles []string + IgnoredOtherFiles []string + CFiles []string + CgoFiles []string + CXXFiles []string + MFiles []string + HFiles []string + FFiles []string + SFiles []string + SwigFiles []string + SwigCXXFiles []string + SysoFiles []string + Imports []string + ImportMap map[string]string + Deps []string + Module *Module + TestGoFiles []string + TestImports []string + XTestGoFiles []string + XTestImports []string + ForTest string // q in a "p [q.test]" package, else "" + DepOnly bool + + Error *jsonPackageError +} + +type jsonPackageError struct { + ImportStack []string + Pos string + Err string +} + +func otherFiles(p *jsonPackage) [][]string { + return [][]string{p.CFiles, p.CXXFiles, p.MFiles, p.HFiles, p.FFiles, p.SFiles, p.SwigFiles, p.SwigCXXFiles, p.SysoFiles} +} + +// createDriverResponse uses the "go list" command to expand the pattern +// words and return a response for the specified packages. +func (state *golistState) createDriverResponse(words ...string) (*driverResponse, error) { + // go list uses the following identifiers in ImportPath and Imports: + // + // "p" -- importable package or main (command) + // "q.test" -- q's test executable + // "p [q.test]" -- variant of p as built for q's test executable + // "q_test [q.test]" -- q's external test package + // + // The packages p that are built differently for a test q.test + // are q itself, plus any helpers used by the external test q_test, + // typically including "testing" and all its dependencies. + + // Run "go list" for complete + // information on the specified packages. + buf, err := state.invokeGo("list", golistargs(state.cfg, words)...) + if err != nil { + return nil, err + } + seen := make(map[string]*jsonPackage) + pkgs := make(map[string]*Package) + additionalErrors := make(map[string][]Error) + // Decode the JSON and convert it to Package form. + var response driverResponse + for dec := json.NewDecoder(buf); dec.More(); { + p := new(jsonPackage) + if err := dec.Decode(p); err != nil { + return nil, fmt.Errorf("JSON decoding failed: %v", err) + } + + if p.ImportPath == "" { + // The documentation for go list says that “[e]rroneous packages will have + // a non-empty ImportPath”. If for some reason it comes back empty, we + // prefer to error out rather than silently discarding data or handing + // back a package without any way to refer to it. + if p.Error != nil { + return nil, Error{ + Pos: p.Error.Pos, + Msg: p.Error.Err, + } + } + return nil, fmt.Errorf("package missing import path: %+v", p) + } + + // Work around https://golang.org/issue/33157: + // go list -e, when given an absolute path, will find the package contained at + // that directory. But when no package exists there, it will return a fake package + // with an error and the ImportPath set to the absolute path provided to go list. + // Try to convert that absolute path to what its package path would be if it's + // contained in a known module or GOPATH entry. This will allow the package to be + // properly "reclaimed" when overlays are processed. + if filepath.IsAbs(p.ImportPath) && p.Error != nil { + pkgPath, ok, err := state.getPkgPath(p.ImportPath) + if err != nil { + return nil, err + } + if ok { + p.ImportPath = pkgPath + } + } + + if old, found := seen[p.ImportPath]; found { + // If one version of the package has an error, and the other doesn't, assume + // that this is a case where go list is reporting a fake dependency variant + // of the imported package: When a package tries to invalidly import another + // package, go list emits a variant of the imported package (with the same + // import path, but with an error on it, and the package will have a + // DepError set on it). An example of when this can happen is for imports of + // main packages: main packages can not be imported, but they may be + // separately matched and listed by another pattern. + // See golang.org/issue/36188 for more details. + + // The plan is that eventually, hopefully in Go 1.15, the error will be + // reported on the importing package rather than the duplicate "fake" + // version of the imported package. Once all supported versions of Go + // have the new behavior this logic can be deleted. + // TODO(matloob): delete the workaround logic once all supported versions of + // Go return the errors on the proper package. + + // There should be exactly one version of a package that doesn't have an + // error. + if old.Error == nil && p.Error == nil { + if !reflect.DeepEqual(p, old) { + return nil, fmt.Errorf("internal error: go list gives conflicting information for package %v", p.ImportPath) + } + continue + } + + // Determine if this package's error needs to be bubbled up. + // This is a hack, and we expect for go list to eventually set the error + // on the package. + if old.Error != nil { + var errkind string + if strings.Contains(old.Error.Err, "not an importable package") { + errkind = "not an importable package" + } else if strings.Contains(old.Error.Err, "use of internal package") && strings.Contains(old.Error.Err, "not allowed") { + errkind = "use of internal package not allowed" + } + if errkind != "" { + if len(old.Error.ImportStack) < 1 { + return nil, fmt.Errorf(`internal error: go list gave a %q error with empty import stack`, errkind) + } + importingPkg := old.Error.ImportStack[len(old.Error.ImportStack)-1] + if importingPkg == old.ImportPath { + // Using an older version of Go which put this package itself on top of import + // stack, instead of the importer. Look for importer in second from top + // position. + if len(old.Error.ImportStack) < 2 { + return nil, fmt.Errorf(`internal error: go list gave a %q error with an import stack without importing package`, errkind) + } + importingPkg = old.Error.ImportStack[len(old.Error.ImportStack)-2] + } + additionalErrors[importingPkg] = append(additionalErrors[importingPkg], Error{ + Pos: old.Error.Pos, + Msg: old.Error.Err, + Kind: ListError, + }) + } + } + + // Make sure that if there's a version of the package without an error, + // that's the one reported to the user. + if old.Error == nil { + continue + } + + // This package will replace the old one at the end of the loop. + } + seen[p.ImportPath] = p + + pkg := &Package{ + Name: p.Name, + ID: p.ImportPath, + GoFiles: absJoin(p.Dir, p.GoFiles, p.CgoFiles), + CompiledGoFiles: absJoin(p.Dir, p.CompiledGoFiles), + OtherFiles: absJoin(p.Dir, otherFiles(p)...), + IgnoredFiles: absJoin(p.Dir, p.IgnoredGoFiles, p.IgnoredOtherFiles), + forTest: p.ForTest, + Module: p.Module, + } + + if (state.cfg.Mode&typecheckCgo) != 0 && len(p.CgoFiles) != 0 { + if len(p.CompiledGoFiles) > len(p.GoFiles) { + // We need the cgo definitions, which are in the first + // CompiledGoFile after the non-cgo ones. This is a hack but there + // isn't currently a better way to find it. We also need the pure + // Go files and unprocessed cgo files, all of which are already + // in pkg.GoFiles. + cgoTypes := p.CompiledGoFiles[len(p.GoFiles)] + pkg.CompiledGoFiles = append([]string{cgoTypes}, pkg.GoFiles...) + } else { + // golang/go#38990: go list silently fails to do cgo processing + pkg.CompiledGoFiles = nil + pkg.Errors = append(pkg.Errors, Error{ + Msg: "go list failed to return CompiledGoFiles; https://golang.org/issue/38990?", + Kind: ListError, + }) + } + } + + // Work around https://golang.org/issue/28749: + // cmd/go puts assembly, C, and C++ files in CompiledGoFiles. + // Filter out any elements of CompiledGoFiles that are also in OtherFiles. + // We have to keep this workaround in place until go1.12 is a distant memory. + if len(pkg.OtherFiles) > 0 { + other := make(map[string]bool, len(pkg.OtherFiles)) + for _, f := range pkg.OtherFiles { + other[f] = true + } + + out := pkg.CompiledGoFiles[:0] + for _, f := range pkg.CompiledGoFiles { + if other[f] { + continue + } + out = append(out, f) + } + pkg.CompiledGoFiles = out + } + + // Extract the PkgPath from the package's ID. + if i := strings.IndexByte(pkg.ID, ' '); i >= 0 { + pkg.PkgPath = pkg.ID[:i] + } else { + pkg.PkgPath = pkg.ID + } + + if pkg.PkgPath == "unsafe" { + pkg.GoFiles = nil // ignore fake unsafe.go file + } + + // Assume go list emits only absolute paths for Dir. + if p.Dir != "" && !filepath.IsAbs(p.Dir) { + log.Fatalf("internal error: go list returned non-absolute Package.Dir: %s", p.Dir) + } + + if p.Export != "" && !filepath.IsAbs(p.Export) { + pkg.ExportFile = filepath.Join(p.Dir, p.Export) + } else { + pkg.ExportFile = p.Export + } + + // imports + // + // Imports contains the IDs of all imported packages. + // ImportsMap records (path, ID) only where they differ. + ids := make(map[string]bool) + for _, id := range p.Imports { + ids[id] = true + } + pkg.Imports = make(map[string]*Package) + for path, id := range p.ImportMap { + pkg.Imports[path] = &Package{ID: id} // non-identity import + delete(ids, id) + } + for id := range ids { + if id == "C" { + continue + } + + pkg.Imports[id] = &Package{ID: id} // identity import + } + if !p.DepOnly { + response.Roots = append(response.Roots, pkg.ID) + } + + // Work around for pre-go.1.11 versions of go list. + // TODO(matloob): they should be handled by the fallback. + // Can we delete this? + if len(pkg.CompiledGoFiles) == 0 { + pkg.CompiledGoFiles = pkg.GoFiles + } + + // Temporary work-around for golang/go#39986. Parse filenames out of + // error messages. This happens if there are unrecoverable syntax + // errors in the source, so we can't match on a specific error message. + if err := p.Error; err != nil && state.shouldAddFilenameFromError(p) { + addFilenameFromPos := func(pos string) bool { + split := strings.Split(pos, ":") + if len(split) < 1 { + return false + } + filename := strings.TrimSpace(split[0]) + if filename == "" { + return false + } + if !filepath.IsAbs(filename) { + filename = filepath.Join(state.cfg.Dir, filename) + } + info, _ := os.Stat(filename) + if info == nil { + return false + } + pkg.CompiledGoFiles = append(pkg.CompiledGoFiles, filename) + pkg.GoFiles = append(pkg.GoFiles, filename) + return true + } + found := addFilenameFromPos(err.Pos) + // In some cases, go list only reports the error position in the + // error text, not the error position. One such case is when the + // file's package name is a keyword (see golang.org/issue/39763). + if !found { + addFilenameFromPos(err.Err) + } + } + + if p.Error != nil { + msg := strings.TrimSpace(p.Error.Err) // Trim to work around golang.org/issue/32363. + // Address golang.org/issue/35964 by appending import stack to error message. + if msg == "import cycle not allowed" && len(p.Error.ImportStack) != 0 { + msg += fmt.Sprintf(": import stack: %v", p.Error.ImportStack) + } + pkg.Errors = append(pkg.Errors, Error{ + Pos: p.Error.Pos, + Msg: msg, + Kind: ListError, + }) + } + + pkgs[pkg.ID] = pkg + } + + for id, errs := range additionalErrors { + if p, ok := pkgs[id]; ok { + p.Errors = append(p.Errors, errs...) + } + } + for _, pkg := range pkgs { + response.Packages = append(response.Packages, pkg) + } + sort.Slice(response.Packages, func(i, j int) bool { return response.Packages[i].ID < response.Packages[j].ID }) + + return &response, nil +} + +func (state *golistState) shouldAddFilenameFromError(p *jsonPackage) bool { + if len(p.GoFiles) > 0 || len(p.CompiledGoFiles) > 0 { + return false + } + + goV, err := state.getGoVersion() + if err != nil { + return false + } + + // On Go 1.14 and earlier, only add filenames from errors if the import stack is empty. + // The import stack behaves differently for these versions than newer Go versions. + if goV < 15 { + return len(p.Error.ImportStack) == 0 + } + + // On Go 1.15 and later, only parse filenames out of error if there's no import stack, + // or the current package is at the top of the import stack. This is not guaranteed + // to work perfectly, but should avoid some cases where files in errors don't belong to this + // package. + return len(p.Error.ImportStack) == 0 || p.Error.ImportStack[len(p.Error.ImportStack)-1] == p.ImportPath +} + +func (state *golistState) getGoVersion() (int, error) { + state.goVersionOnce.Do(func() { + state.goVersion, state.goVersionError = gocommand.GoVersion(state.ctx, state.cfgInvocation(), state.cfg.gocmdRunner) + }) + return state.goVersion, state.goVersionError +} + +// getPkgPath finds the package path of a directory if it's relative to a root +// directory. +func (state *golistState) getPkgPath(dir string) (string, bool, error) { + absDir, err := filepath.Abs(dir) + if err != nil { + return "", false, err + } + roots, err := state.determineRootDirs() + if err != nil { + return "", false, err + } + + for rdir, rpath := range roots { + // Make sure that the directory is in the module, + // to avoid creating a path relative to another module. + if !strings.HasPrefix(absDir, rdir) { + continue + } + // TODO(matloob): This doesn't properly handle symlinks. + r, err := filepath.Rel(rdir, dir) + if err != nil { + continue + } + if rpath != "" { + // We choose only one root even though the directory even it can belong in multiple modules + // or GOPATH entries. This is okay because we only need to work with absolute dirs when a + // file is missing from disk, for instance when gopls calls go/packages in an overlay. + // Once the file is saved, gopls, or the next invocation of the tool will get the correct + // result straight from golist. + // TODO(matloob): Implement module tiebreaking? + return path.Join(rpath, filepath.ToSlash(r)), true, nil + } + return filepath.ToSlash(r), true, nil + } + return "", false, nil +} + +// absJoin absolutizes and flattens the lists of files. +func absJoin(dir string, fileses ...[]string) (res []string) { + for _, files := range fileses { + for _, file := range files { + if !filepath.IsAbs(file) { + file = filepath.Join(dir, file) + } + res = append(res, file) + } + } + return res +} + +func golistargs(cfg *Config, words []string) []string { + const findFlags = NeedImports | NeedTypes | NeedSyntax | NeedTypesInfo + fullargs := []string{ + "-e", "-json", + fmt.Sprintf("-compiled=%t", cfg.Mode&(NeedCompiledGoFiles|NeedSyntax|NeedTypes|NeedTypesInfo|NeedTypesSizes) != 0), + fmt.Sprintf("-test=%t", cfg.Tests), + fmt.Sprintf("-export=%t", usesExportData(cfg)), + fmt.Sprintf("-deps=%t", cfg.Mode&NeedImports != 0), + // go list doesn't let you pass -test and -find together, + // probably because you'd just get the TestMain. + fmt.Sprintf("-find=%t", !cfg.Tests && cfg.Mode&findFlags == 0), + } + fullargs = append(fullargs, cfg.BuildFlags...) + fullargs = append(fullargs, "--") + fullargs = append(fullargs, words...) + return fullargs +} + +// cfgInvocation returns an Invocation that reflects cfg's settings. +func (state *golistState) cfgInvocation() gocommand.Invocation { + cfg := state.cfg + return gocommand.Invocation{ + BuildFlags: cfg.BuildFlags, + ModFile: cfg.modFile, + ModFlag: cfg.modFlag, + CleanEnv: cfg.Env != nil, + Env: cfg.Env, + Logf: cfg.Logf, + WorkingDir: cfg.Dir, + } +} + +// invokeGo returns the stdout of a go command invocation. +func (state *golistState) invokeGo(verb string, args ...string) (*bytes.Buffer, error) { + cfg := state.cfg + + inv := state.cfgInvocation() + + // For Go versions 1.16 and above, `go list` accepts overlays directly via + // the -overlay flag. Set it, if it's available. + // + // The check for "list" is not necessarily required, but we should avoid + // getting the go version if possible. + if verb == "list" { + goVersion, err := state.getGoVersion() + if err != nil { + return nil, err + } + if goVersion >= 16 { + filename, cleanup, err := state.writeOverlays() + if err != nil { + return nil, err + } + defer cleanup() + inv.Overlay = filename + } + } + inv.Verb = verb + inv.Args = args + gocmdRunner := cfg.gocmdRunner + if gocmdRunner == nil { + gocmdRunner = &gocommand.Runner{} + } + stdout, stderr, _, err := gocmdRunner.RunRaw(cfg.Context, inv) + if err != nil { + // Check for 'go' executable not being found. + if ee, ok := err.(*exec.Error); ok && ee.Err == exec.ErrNotFound { + return nil, fmt.Errorf("'go list' driver requires 'go', but %s", exec.ErrNotFound) + } + + exitErr, ok := err.(*exec.ExitError) + if !ok { + // Catastrophic error: + // - context cancellation + return nil, xerrors.Errorf("couldn't run 'go': %w", err) + } + + // Old go version? + if strings.Contains(stderr.String(), "flag provided but not defined") { + return nil, goTooOldError{fmt.Errorf("unsupported version of go: %s: %s", exitErr, stderr)} + } + + // Related to #24854 + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "unexpected directory layout") { + return nil, fmt.Errorf("%s", stderr.String()) + } + + // Is there an error running the C compiler in cgo? This will be reported in the "Error" field + // and should be suppressed by go list -e. + // + // This condition is not perfect yet because the error message can include other error messages than runtime/cgo. + isPkgPathRune := func(r rune) bool { + // From https://golang.org/ref/spec#Import_declarations: + // Implementation restriction: A compiler may restrict ImportPaths to non-empty strings + // using only characters belonging to Unicode's L, M, N, P, and S general categories + // (the Graphic characters without spaces) and may also exclude the + // characters !"#$%&'()*,:;<=>?[\]^`{|} and the Unicode replacement character U+FFFD. + return unicode.IsOneOf([]*unicode.RangeTable{unicode.L, unicode.M, unicode.N, unicode.P, unicode.S}, r) && + !strings.ContainsRune("!\"#$%&'()*,:;<=>?[\\]^`{|}\uFFFD", r) + } + // golang/go#36770: Handle case where cmd/go prints module download messages before the error. + msg := stderr.String() + for strings.HasPrefix(msg, "go: downloading") { + msg = msg[strings.IndexRune(msg, '\n')+1:] + } + if len(stderr.String()) > 0 && strings.HasPrefix(stderr.String(), "# ") { + msg := msg[len("# "):] + if strings.HasPrefix(strings.TrimLeftFunc(msg, isPkgPathRune), "\n") { + return stdout, nil + } + // Treat pkg-config errors as a special case (golang.org/issue/36770). + if strings.HasPrefix(msg, "pkg-config") { + return stdout, nil + } + } + + // This error only appears in stderr. See golang.org/cl/166398 for a fix in go list to show + // the error in the Err section of stdout in case -e option is provided. + // This fix is provided for backwards compatibility. + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must be .go files") { + output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Similar to the previous error, but currently lacks a fix in Go. + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must all be in one directory") { + output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Backwards compatibility for Go 1.11 because 1.12 and 1.13 put the directory in the ImportPath. + // If the package doesn't exist, put the absolute path of the directory into the error message, + // as Go 1.13 list does. + const noSuchDirectory = "no such directory" + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), noSuchDirectory) { + errstr := stderr.String() + abspath := strings.TrimSpace(errstr[strings.Index(errstr, noSuchDirectory)+len(noSuchDirectory):]) + output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + abspath, strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Workaround for #29280: go list -e has incorrect behavior when an ad-hoc package doesn't exist. + // Note that the error message we look for in this case is different that the one looked for above. + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "no such file or directory") { + output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Workaround for #34273. go list -e with GO111MODULE=on has incorrect behavior when listing a + // directory outside any module. + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "outside available modules") { + output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + // TODO(matloob): command-line-arguments isn't correct here. + "command-line-arguments", strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Another variation of the previous error + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "outside module root") { + output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + // TODO(matloob): command-line-arguments isn't correct here. + "command-line-arguments", strings.Trim(stderr.String(), "\n")) + return bytes.NewBufferString(output), nil + } + + // Workaround for an instance of golang.org/issue/26755: go list -e will return a non-zero exit + // status if there's a dependency on a package that doesn't exist. But it should return + // a zero exit status and set an error on that package. + if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "no Go files in") { + // Don't clobber stdout if `go list` actually returned something. + if len(stdout.String()) > 0 { + return stdout, nil + } + // try to extract package name from string + stderrStr := stderr.String() + var importPath string + colon := strings.Index(stderrStr, ":") + if colon > 0 && strings.HasPrefix(stderrStr, "go build ") { + importPath = stderrStr[len("go build "):colon] + } + output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, + importPath, strings.Trim(stderrStr, "\n")) + return bytes.NewBufferString(output), nil + } + + // Export mode entails a build. + // If that build fails, errors appear on stderr + // (despite the -e flag) and the Export field is blank. + // Do not fail in that case. + // The same is true if an ad-hoc package given to go list doesn't exist. + // TODO(matloob): Remove these once we can depend on go list to exit with a zero status with -e even when + // packages don't exist or a build fails. + if !usesExportData(cfg) && !containsGoFile(args) { + return nil, fmt.Errorf("go %v: %s: %s", args, exitErr, stderr) + } + } + return stdout, nil +} + +// OverlayJSON is the format overlay files are expected to be in. +// The Replace map maps from overlaid paths to replacement paths: +// the Go command will forward all reads trying to open +// each overlaid path to its replacement path, or consider the overlaid +// path not to exist if the replacement path is empty. +// +// From golang/go#39958. +type OverlayJSON struct { + Replace map[string]string `json:"replace,omitempty"` +} + +// writeOverlays writes out files for go list's -overlay flag, as described +// above. +func (state *golistState) writeOverlays() (filename string, cleanup func(), err error) { + // Do nothing if there are no overlays in the config. + if len(state.cfg.Overlay) == 0 { + return "", func() {}, nil + } + dir, err := ioutil.TempDir("", "gopackages-*") + if err != nil { + return "", nil, err + } + // The caller must clean up this directory, unless this function returns an + // error. + cleanup = func() { + os.RemoveAll(dir) + } + defer func() { + if err != nil { + cleanup() + } + }() + overlays := map[string]string{} + for k, v := range state.cfg.Overlay { + // Create a unique filename for the overlaid files, to avoid + // creating nested directories. + noSeparator := strings.Join(strings.Split(filepath.ToSlash(k), "/"), "") + f, err := ioutil.TempFile(dir, fmt.Sprintf("*-%s", noSeparator)) + if err != nil { + return "", func() {}, err + } + if _, err := f.Write(v); err != nil { + return "", func() {}, err + } + if err := f.Close(); err != nil { + return "", func() {}, err + } + overlays[k] = f.Name() + } + b, err := json.Marshal(OverlayJSON{Replace: overlays}) + if err != nil { + return "", func() {}, err + } + // Write out the overlay file that contains the filepath mappings. + filename = filepath.Join(dir, "overlay.json") + if err := ioutil.WriteFile(filename, b, 0665); err != nil { + return "", func() {}, err + } + return filename, cleanup, nil +} + +func containsGoFile(s []string) bool { + for _, f := range s { + if strings.HasSuffix(f, ".go") { + return true + } + } + return false +} + +func cmdDebugStr(cmd *exec.Cmd) string { + env := make(map[string]string) + for _, kv := range cmd.Env { + split := strings.SplitN(kv, "=", 2) + k, v := split[0], split[1] + env[k] = v + } + + var args []string + for _, arg := range cmd.Args { + quoted := strconv.Quote(arg) + if quoted[1:len(quoted)-1] != arg || strings.Contains(arg, " ") { + args = append(args, quoted) + } else { + args = append(args, arg) + } + } + return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], strings.Join(args, " ")) +} diff --git a/vendor/golang.org/x/tools/go/packages/golist_overlay.go b/vendor/golang.org/x/tools/go/packages/golist_overlay.go new file mode 100644 index 0000000000..9576b472f9 --- /dev/null +++ b/vendor/golang.org/x/tools/go/packages/golist_overlay.go @@ -0,0 +1,575 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package packages + +import ( + "encoding/json" + "fmt" + "go/parser" + "go/token" + "os" + "path/filepath" + "regexp" + "sort" + "strconv" + "strings" + + "golang.org/x/tools/internal/gocommand" +) + +// processGolistOverlay provides rudimentary support for adding +// files that don't exist on disk to an overlay. The results can be +// sometimes incorrect. +// TODO(matloob): Handle unsupported cases, including the following: +// - determining the correct package to add given a new import path +func (state *golistState) processGolistOverlay(response *responseDeduper) (modifiedPkgs, needPkgs []string, err error) { + havePkgs := make(map[string]string) // importPath -> non-test package ID + needPkgsSet := make(map[string]bool) + modifiedPkgsSet := make(map[string]bool) + + pkgOfDir := make(map[string][]*Package) + for _, pkg := range response.dr.Packages { + // This is an approximation of import path to id. This can be + // wrong for tests, vendored packages, and a number of other cases. + havePkgs[pkg.PkgPath] = pkg.ID + dir, err := commonDir(pkg.GoFiles) + if err != nil { + return nil, nil, err + } + if dir != "" { + pkgOfDir[dir] = append(pkgOfDir[dir], pkg) + } + } + + // If no new imports are added, it is safe to avoid loading any needPkgs. + // Otherwise, it's hard to tell which package is actually being loaded + // (due to vendoring) and whether any modified package will show up + // in the transitive set of dependencies (because new imports are added, + // potentially modifying the transitive set of dependencies). + var overlayAddsImports bool + + // If both a package and its test package are created by the overlay, we + // need the real package first. Process all non-test files before test + // files, and make the whole process deterministic while we're at it. + var overlayFiles []string + for opath := range state.cfg.Overlay { + overlayFiles = append(overlayFiles, opath) + } + sort.Slice(overlayFiles, func(i, j int) bool { + iTest := strings.HasSuffix(overlayFiles[i], "_test.go") + jTest := strings.HasSuffix(overlayFiles[j], "_test.go") + if iTest != jTest { + return !iTest // non-tests are before tests. + } + return overlayFiles[i] < overlayFiles[j] + }) + for _, opath := range overlayFiles { + contents := state.cfg.Overlay[opath] + base := filepath.Base(opath) + dir := filepath.Dir(opath) + var pkg *Package // if opath belongs to both a package and its test variant, this will be the test variant + var testVariantOf *Package // if opath is a test file, this is the package it is testing + var fileExists bool + isTestFile := strings.HasSuffix(opath, "_test.go") + pkgName, ok := extractPackageName(opath, contents) + if !ok { + // Don't bother adding a file that doesn't even have a parsable package statement + // to the overlay. + continue + } + // If all the overlay files belong to a different package, change the + // package name to that package. + maybeFixPackageName(pkgName, isTestFile, pkgOfDir[dir]) + nextPackage: + for _, p := range response.dr.Packages { + if pkgName != p.Name && p.ID != "command-line-arguments" { + continue + } + for _, f := range p.GoFiles { + if !sameFile(filepath.Dir(f), dir) { + continue + } + // Make sure to capture information on the package's test variant, if needed. + if isTestFile && !hasTestFiles(p) { + // TODO(matloob): Are there packages other than the 'production' variant + // of a package that this can match? This shouldn't match the test main package + // because the file is generated in another directory. + testVariantOf = p + continue nextPackage + } else if !isTestFile && hasTestFiles(p) { + // We're examining a test variant, but the overlaid file is + // a non-test file. Because the overlay implementation + // (currently) only adds a file to one package, skip this + // package, so that we can add the file to the production + // variant of the package. (https://golang.org/issue/36857 + // tracks handling overlays on both the production and test + // variant of a package). + continue nextPackage + } + if pkg != nil && p != pkg && pkg.PkgPath == p.PkgPath { + // We have already seen the production version of the + // for which p is a test variant. + if hasTestFiles(p) { + testVariantOf = pkg + } + } + pkg = p + if filepath.Base(f) == base { + fileExists = true + } + } + } + // The overlay could have included an entirely new package or an + // ad-hoc package. An ad-hoc package is one that we have manually + // constructed from inadequate `go list` results for a file= query. + // It will have the ID command-line-arguments. + if pkg == nil || pkg.ID == "command-line-arguments" { + // Try to find the module or gopath dir the file is contained in. + // Then for modules, add the module opath to the beginning. + pkgPath, ok, err := state.getPkgPath(dir) + if err != nil { + return nil, nil, err + } + if !ok { + break + } + var forTest string // only set for x tests + isXTest := strings.HasSuffix(pkgName, "_test") + if isXTest { + forTest = pkgPath + pkgPath += "_test" + } + id := pkgPath + if isTestFile { + if isXTest { + id = fmt.Sprintf("%s [%s.test]", pkgPath, forTest) + } else { + id = fmt.Sprintf("%s [%s.test]", pkgPath, pkgPath) + } + } + if pkg != nil { + // TODO(rstambler): We should change the package's path and ID + // here. The only issue is that this messes with the roots. + } else { + // Try to reclaim a package with the same ID, if it exists in the response. + for _, p := range response.dr.Packages { + if reclaimPackage(p, id, opath, contents) { + pkg = p + break + } + } + // Otherwise, create a new package. + if pkg == nil { + pkg = &Package{ + PkgPath: pkgPath, + ID: id, + Name: pkgName, + Imports: make(map[string]*Package), + } + response.addPackage(pkg) + havePkgs[pkg.PkgPath] = id + // Add the production package's sources for a test variant. + if isTestFile && !isXTest && testVariantOf != nil { + pkg.GoFiles = append(pkg.GoFiles, testVariantOf.GoFiles...) + pkg.CompiledGoFiles = append(pkg.CompiledGoFiles, testVariantOf.CompiledGoFiles...) + // Add the package under test and its imports to the test variant. + pkg.forTest = testVariantOf.PkgPath + for k, v := range testVariantOf.Imports { + pkg.Imports[k] = &Package{ID: v.ID} + } + } + if isXTest { + pkg.forTest = forTest + } + } + } + } + if !fileExists { + pkg.GoFiles = append(pkg.GoFiles, opath) + // TODO(matloob): Adding the file to CompiledGoFiles can exhibit the wrong behavior + // if the file will be ignored due to its build tags. + pkg.CompiledGoFiles = append(pkg.CompiledGoFiles, opath) + modifiedPkgsSet[pkg.ID] = true + } + imports, err := extractImports(opath, contents) + if err != nil { + // Let the parser or type checker report errors later. + continue + } + for _, imp := range imports { + // TODO(rstambler): If the package is an x test and the import has + // a test variant, make sure to replace it. + if _, found := pkg.Imports[imp]; found { + continue + } + overlayAddsImports = true + id, ok := havePkgs[imp] + if !ok { + var err error + id, err = state.resolveImport(dir, imp) + if err != nil { + return nil, nil, err + } + } + pkg.Imports[imp] = &Package{ID: id} + // Add dependencies to the non-test variant version of this package as well. + if testVariantOf != nil { + testVariantOf.Imports[imp] = &Package{ID: id} + } + } + } + + // toPkgPath guesses the package path given the id. + toPkgPath := func(sourceDir, id string) (string, error) { + if i := strings.IndexByte(id, ' '); i >= 0 { + return state.resolveImport(sourceDir, id[:i]) + } + return state.resolveImport(sourceDir, id) + } + + // Now that new packages have been created, do another pass to determine + // the new set of missing packages. + for _, pkg := range response.dr.Packages { + for _, imp := range pkg.Imports { + if len(pkg.GoFiles) == 0 { + return nil, nil, fmt.Errorf("cannot resolve imports for package %q with no Go files", pkg.PkgPath) + } + pkgPath, err := toPkgPath(filepath.Dir(pkg.GoFiles[0]), imp.ID) + if err != nil { + return nil, nil, err + } + if _, ok := havePkgs[pkgPath]; !ok { + needPkgsSet[pkgPath] = true + } + } + } + + if overlayAddsImports { + needPkgs = make([]string, 0, len(needPkgsSet)) + for pkg := range needPkgsSet { + needPkgs = append(needPkgs, pkg) + } + } + modifiedPkgs = make([]string, 0, len(modifiedPkgsSet)) + for pkg := range modifiedPkgsSet { + modifiedPkgs = append(modifiedPkgs, pkg) + } + return modifiedPkgs, needPkgs, err +} + +// resolveImport finds the ID of a package given its import path. +// In particular, it will find the right vendored copy when in GOPATH mode. +func (state *golistState) resolveImport(sourceDir, importPath string) (string, error) { + env, err := state.getEnv() + if err != nil { + return "", err + } + if env["GOMOD"] != "" { + return importPath, nil + } + + searchDir := sourceDir + for { + vendorDir := filepath.Join(searchDir, "vendor") + exists, ok := state.vendorDirs[vendorDir] + if !ok { + info, err := os.Stat(vendorDir) + exists = err == nil && info.IsDir() + state.vendorDirs[vendorDir] = exists + } + + if exists { + vendoredPath := filepath.Join(vendorDir, importPath) + if info, err := os.Stat(vendoredPath); err == nil && info.IsDir() { + // We should probably check for .go files here, but shame on anyone who fools us. + path, ok, err := state.getPkgPath(vendoredPath) + if err != nil { + return "", err + } + if ok { + return path, nil + } + } + } + + // We know we've hit the top of the filesystem when we Dir / and get /, + // or C:\ and get C:\, etc. + next := filepath.Dir(searchDir) + if next == searchDir { + break + } + searchDir = next + } + return importPath, nil +} + +func hasTestFiles(p *Package) bool { + for _, f := range p.GoFiles { + if strings.HasSuffix(f, "_test.go") { + return true + } + } + return false +} + +// determineRootDirs returns a mapping from absolute directories that could +// contain code to their corresponding import path prefixes. +func (state *golistState) determineRootDirs() (map[string]string, error) { + env, err := state.getEnv() + if err != nil { + return nil, err + } + if env["GOMOD"] != "" { + state.rootsOnce.Do(func() { + state.rootDirs, state.rootDirsError = state.determineRootDirsModules() + }) + } else { + state.rootsOnce.Do(func() { + state.rootDirs, state.rootDirsError = state.determineRootDirsGOPATH() + }) + } + return state.rootDirs, state.rootDirsError +} + +func (state *golistState) determineRootDirsModules() (map[string]string, error) { + // List all of the modules--the first will be the directory for the main + // module. Any replaced modules will also need to be treated as roots. + // Editing files in the module cache isn't a great idea, so we don't + // plan to ever support that. + out, err := state.invokeGo("list", "-m", "-json", "all") + if err != nil { + // 'go list all' will fail if we're outside of a module and + // GO111MODULE=on. Try falling back without 'all'. + var innerErr error + out, innerErr = state.invokeGo("list", "-m", "-json") + if innerErr != nil { + return nil, err + } + } + roots := map[string]string{} + modules := map[string]string{} + var i int + for dec := json.NewDecoder(out); dec.More(); { + mod := new(gocommand.ModuleJSON) + if err := dec.Decode(mod); err != nil { + return nil, err + } + if mod.Dir != "" && mod.Path != "" { + // This is a valid module; add it to the map. + absDir, err := filepath.Abs(mod.Dir) + if err != nil { + return nil, err + } + modules[absDir] = mod.Path + // The first result is the main module. + if i == 0 || mod.Replace != nil && mod.Replace.Path != "" { + roots[absDir] = mod.Path + } + } + i++ + } + return roots, nil +} + +func (state *golistState) determineRootDirsGOPATH() (map[string]string, error) { + m := map[string]string{} + for _, dir := range filepath.SplitList(state.mustGetEnv()["GOPATH"]) { + absDir, err := filepath.Abs(dir) + if err != nil { + return nil, err + } + m[filepath.Join(absDir, "src")] = "" + } + return m, nil +} + +func extractImports(filename string, contents []byte) ([]string, error) { + f, err := parser.ParseFile(token.NewFileSet(), filename, contents, parser.ImportsOnly) // TODO(matloob): reuse fileset? + if err != nil { + return nil, err + } + var res []string + for _, imp := range f.Imports { + quotedPath := imp.Path.Value + path, err := strconv.Unquote(quotedPath) + if err != nil { + return nil, err + } + res = append(res, path) + } + return res, nil +} + +// reclaimPackage attempts to reuse a package that failed to load in an overlay. +// +// If the package has errors and has no Name, GoFiles, or Imports, +// then it's possible that it doesn't yet exist on disk. +func reclaimPackage(pkg *Package, id string, filename string, contents []byte) bool { + // TODO(rstambler): Check the message of the actual error? + // It differs between $GOPATH and module mode. + if pkg.ID != id { + return false + } + if len(pkg.Errors) != 1 { + return false + } + if pkg.Name != "" || pkg.ExportFile != "" { + return false + } + if len(pkg.GoFiles) > 0 || len(pkg.CompiledGoFiles) > 0 || len(pkg.OtherFiles) > 0 { + return false + } + if len(pkg.Imports) > 0 { + return false + } + pkgName, ok := extractPackageName(filename, contents) + if !ok { + return false + } + pkg.Name = pkgName + pkg.Errors = nil + return true +} + +func extractPackageName(filename string, contents []byte) (string, bool) { + // TODO(rstambler): Check the message of the actual error? + // It differs between $GOPATH and module mode. + f, err := parser.ParseFile(token.NewFileSet(), filename, contents, parser.PackageClauseOnly) // TODO(matloob): reuse fileset? + if err != nil { + return "", false + } + return f.Name.Name, true +} + +// commonDir returns the directory that all files are in, "" if files is empty, +// or an error if they aren't in the same directory. +func commonDir(files []string) (string, error) { + seen := make(map[string]bool) + for _, f := range files { + seen[filepath.Dir(f)] = true + } + if len(seen) > 1 { + return "", fmt.Errorf("files (%v) are in more than one directory: %v", files, seen) + } + for k := range seen { + // seen has only one element; return it. + return k, nil + } + return "", nil // no files +} + +// It is possible that the files in the disk directory dir have a different package +// name from newName, which is deduced from the overlays. If they all have a different +// package name, and they all have the same package name, then that name becomes +// the package name. +// It returns true if it changes the package name, false otherwise. +func maybeFixPackageName(newName string, isTestFile bool, pkgsOfDir []*Package) { + names := make(map[string]int) + for _, p := range pkgsOfDir { + names[p.Name]++ + } + if len(names) != 1 { + // some files are in different packages + return + } + var oldName string + for k := range names { + oldName = k + } + if newName == oldName { + return + } + // We might have a case where all of the package names in the directory are + // the same, but the overlay file is for an x test, which belongs to its + // own package. If the x test does not yet exist on disk, we may not yet + // have its package name on disk, but we should not rename the packages. + // + // We use a heuristic to determine if this file belongs to an x test: + // The test file should have a package name whose package name has a _test + // suffix or looks like "newName_test". + maybeXTest := strings.HasPrefix(oldName+"_test", newName) || strings.HasSuffix(newName, "_test") + if isTestFile && maybeXTest { + return + } + for _, p := range pkgsOfDir { + p.Name = newName + } +} + +// This function is copy-pasted from +// https://github.com/golang/go/blob/9706f510a5e2754595d716bd64be8375997311fb/src/cmd/go/internal/search/search.go#L360. +// It should be deleted when we remove support for overlays from go/packages. +// +// NOTE: This does not handle any ./... or ./ style queries, as this function +// doesn't know the working directory. +// +// matchPattern(pattern)(name) reports whether +// name matches pattern. Pattern is a limited glob +// pattern in which '...' means 'any string' and there +// is no other special syntax. +// Unfortunately, there are two special cases. Quoting "go help packages": +// +// First, /... at the end of the pattern can match an empty string, +// so that net/... matches both net and packages in its subdirectories, like net/http. +// Second, any slash-separated pattern element containing a wildcard never +// participates in a match of the "vendor" element in the path of a vendored +// package, so that ./... does not match packages in subdirectories of +// ./vendor or ./mycode/vendor, but ./vendor/... and ./mycode/vendor/... do. +// Note, however, that a directory named vendor that itself contains code +// is not a vendored package: cmd/vendor would be a command named vendor, +// and the pattern cmd/... matches it. +func matchPattern(pattern string) func(name string) bool { + // Convert pattern to regular expression. + // The strategy for the trailing /... is to nest it in an explicit ? expression. + // The strategy for the vendor exclusion is to change the unmatchable + // vendor strings to a disallowed code point (vendorChar) and to use + // "(anything but that codepoint)*" as the implementation of the ... wildcard. + // This is a bit complicated but the obvious alternative, + // namely a hand-written search like in most shell glob matchers, + // is too easy to make accidentally exponential. + // Using package regexp guarantees linear-time matching. + + const vendorChar = "\x00" + + if strings.Contains(pattern, vendorChar) { + return func(name string) bool { return false } + } + + re := regexp.QuoteMeta(pattern) + re = replaceVendor(re, vendorChar) + switch { + case strings.HasSuffix(re, `/`+vendorChar+`/\.\.\.`): + re = strings.TrimSuffix(re, `/`+vendorChar+`/\.\.\.`) + `(/vendor|/` + vendorChar + `/\.\.\.)` + case re == vendorChar+`/\.\.\.`: + re = `(/vendor|/` + vendorChar + `/\.\.\.)` + case strings.HasSuffix(re, `/\.\.\.`): + re = strings.TrimSuffix(re, `/\.\.\.`) + `(/\.\.\.)?` + } + re = strings.ReplaceAll(re, `\.\.\.`, `[^`+vendorChar+`]*`) + + reg := regexp.MustCompile(`^` + re + `$`) + + return func(name string) bool { + if strings.Contains(name, vendorChar) { + return false + } + return reg.MatchString(replaceVendor(name, vendorChar)) + } +} + +// replaceVendor returns the result of replacing +// non-trailing vendor path elements in x with repl. +func replaceVendor(x, repl string) string { + if !strings.Contains(x, "vendor") { + return x + } + elem := strings.Split(x, "/") + for i := 0; i < len(elem)-1; i++ { + if elem[i] == "vendor" { + elem[i] = repl + } + } + return strings.Join(elem, "/") +} diff --git a/vendor/golang.org/x/tools/go/packages/loadmode_string.go b/vendor/golang.org/x/tools/go/packages/loadmode_string.go new file mode 100644 index 0000000000..7ea37e7eea --- /dev/null +++ b/vendor/golang.org/x/tools/go/packages/loadmode_string.go @@ -0,0 +1,57 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package packages + +import ( + "fmt" + "strings" +) + +var allModes = []LoadMode{ + NeedName, + NeedFiles, + NeedCompiledGoFiles, + NeedImports, + NeedDeps, + NeedExportsFile, + NeedTypes, + NeedSyntax, + NeedTypesInfo, + NeedTypesSizes, +} + +var modeStrings = []string{ + "NeedName", + "NeedFiles", + "NeedCompiledGoFiles", + "NeedImports", + "NeedDeps", + "NeedExportsFile", + "NeedTypes", + "NeedSyntax", + "NeedTypesInfo", + "NeedTypesSizes", +} + +func (mod LoadMode) String() string { + m := mod + if m == 0 { + return "LoadMode(0)" + } + var out []string + for i, x := range allModes { + if x > m { + break + } + if (m & x) != 0 { + out = append(out, modeStrings[i]) + m = m ^ x + } + } + if m != 0 { + out = append(out, "Unknown") + } + return fmt.Sprintf("LoadMode(%s)", strings.Join(out, "|")) +} diff --git a/vendor/golang.org/x/tools/go/packages/packages.go b/vendor/golang.org/x/tools/go/packages/packages.go new file mode 100644 index 0000000000..38475e8712 --- /dev/null +++ b/vendor/golang.org/x/tools/go/packages/packages.go @@ -0,0 +1,1233 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package packages + +// See doc.go for package documentation and implementation notes. + +import ( + "context" + "encoding/json" + "fmt" + "go/ast" + "go/parser" + "go/scanner" + "go/token" + "go/types" + "io/ioutil" + "log" + "os" + "path/filepath" + "strings" + "sync" + "time" + + "golang.org/x/tools/go/gcexportdata" + "golang.org/x/tools/internal/gocommand" + "golang.org/x/tools/internal/packagesinternal" + "golang.org/x/tools/internal/typesinternal" +) + +// A LoadMode controls the amount of detail to return when loading. +// The bits below can be combined to specify which fields should be +// filled in the result packages. +// The zero value is a special case, equivalent to combining +// the NeedName, NeedFiles, and NeedCompiledGoFiles bits. +// ID and Errors (if present) will always be filled. +// Load may return more information than requested. +type LoadMode int + +// TODO(matloob): When a V2 of go/packages is released, rename NeedExportsFile to +// NeedExportFile to make it consistent with the Package field it's adding. + +const ( + // NeedName adds Name and PkgPath. + NeedName LoadMode = 1 << iota + + // NeedFiles adds GoFiles and OtherFiles. + NeedFiles + + // NeedCompiledGoFiles adds CompiledGoFiles. + NeedCompiledGoFiles + + // NeedImports adds Imports. If NeedDeps is not set, the Imports field will contain + // "placeholder" Packages with only the ID set. + NeedImports + + // NeedDeps adds the fields requested by the LoadMode in the packages in Imports. + NeedDeps + + // NeedExportsFile adds ExportFile. + NeedExportsFile + + // NeedTypes adds Types, Fset, and IllTyped. + NeedTypes + + // NeedSyntax adds Syntax. + NeedSyntax + + // NeedTypesInfo adds TypesInfo. + NeedTypesInfo + + // NeedTypesSizes adds TypesSizes. + NeedTypesSizes + + // typecheckCgo enables full support for type checking cgo. Requires Go 1.15+. + // Modifies CompiledGoFiles and Types, and has no effect on its own. + typecheckCgo + + // NeedModule adds Module. + NeedModule +) + +const ( + // Deprecated: LoadFiles exists for historical compatibility + // and should not be used. Please directly specify the needed fields using the Need values. + LoadFiles = NeedName | NeedFiles | NeedCompiledGoFiles + + // Deprecated: LoadImports exists for historical compatibility + // and should not be used. Please directly specify the needed fields using the Need values. + LoadImports = LoadFiles | NeedImports + + // Deprecated: LoadTypes exists for historical compatibility + // and should not be used. Please directly specify the needed fields using the Need values. + LoadTypes = LoadImports | NeedTypes | NeedTypesSizes + + // Deprecated: LoadSyntax exists for historical compatibility + // and should not be used. Please directly specify the needed fields using the Need values. + LoadSyntax = LoadTypes | NeedSyntax | NeedTypesInfo + + // Deprecated: LoadAllSyntax exists for historical compatibility + // and should not be used. Please directly specify the needed fields using the Need values. + LoadAllSyntax = LoadSyntax | NeedDeps +) + +// A Config specifies details about how packages should be loaded. +// The zero value is a valid configuration. +// Calls to Load do not modify this struct. +type Config struct { + // Mode controls the level of information returned for each package. + Mode LoadMode + + // Context specifies the context for the load operation. + // If the context is cancelled, the loader may stop early + // and return an ErrCancelled error. + // If Context is nil, the load cannot be cancelled. + Context context.Context + + // Logf is the logger for the config. + // If the user provides a logger, debug logging is enabled. + // If the GOPACKAGESDEBUG environment variable is set to true, + // but the logger is nil, default to log.Printf. + Logf func(format string, args ...interface{}) + + // Dir is the directory in which to run the build system's query tool + // that provides information about the packages. + // If Dir is empty, the tool is run in the current directory. + Dir string + + // Env is the environment to use when invoking the build system's query tool. + // If Env is nil, the current environment is used. + // As in os/exec's Cmd, only the last value in the slice for + // each environment key is used. To specify the setting of only + // a few variables, append to the current environment, as in: + // + // opt.Env = append(os.Environ(), "GOOS=plan9", "GOARCH=386") + // + Env []string + + // gocmdRunner guards go command calls from concurrency errors. + gocmdRunner *gocommand.Runner + + // BuildFlags is a list of command-line flags to be passed through to + // the build system's query tool. + BuildFlags []string + + // modFile will be used for -modfile in go command invocations. + modFile string + + // modFlag will be used for -modfile in go command invocations. + modFlag string + + // Fset provides source position information for syntax trees and types. + // If Fset is nil, Load will use a new fileset, but preserve Fset's value. + Fset *token.FileSet + + // ParseFile is called to read and parse each file + // when preparing a package's type-checked syntax tree. + // It must be safe to call ParseFile simultaneously from multiple goroutines. + // If ParseFile is nil, the loader will uses parser.ParseFile. + // + // ParseFile should parse the source from src and use filename only for + // recording position information. + // + // An application may supply a custom implementation of ParseFile + // to change the effective file contents or the behavior of the parser, + // or to modify the syntax tree. For example, selectively eliminating + // unwanted function bodies can significantly accelerate type checking. + ParseFile func(fset *token.FileSet, filename string, src []byte) (*ast.File, error) + + // If Tests is set, the loader includes not just the packages + // matching a particular pattern but also any related test packages, + // including test-only variants of the package and the test executable. + // + // For example, when using the go command, loading "fmt" with Tests=true + // returns four packages, with IDs "fmt" (the standard package), + // "fmt [fmt.test]" (the package as compiled for the test), + // "fmt_test" (the test functions from source files in package fmt_test), + // and "fmt.test" (the test binary). + // + // In build systems with explicit names for tests, + // setting Tests may have no effect. + Tests bool + + // Overlay provides a mapping of absolute file paths to file contents. + // If the file with the given path already exists, the parser will use the + // alternative file contents provided by the map. + // + // Overlays provide incomplete support for when a given file doesn't + // already exist on disk. See the package doc above for more details. + Overlay map[string][]byte +} + +// driver is the type for functions that query the build system for the +// packages named by the patterns. +type driver func(cfg *Config, patterns ...string) (*driverResponse, error) + +// driverResponse contains the results for a driver query. +type driverResponse struct { + // NotHandled is returned if the request can't be handled by the current + // driver. If an external driver returns a response with NotHandled, the + // rest of the driverResponse is ignored, and go/packages will fallback + // to the next driver. If go/packages is extended in the future to support + // lists of multiple drivers, go/packages will fall back to the next driver. + NotHandled bool + + // Sizes, if not nil, is the types.Sizes to use when type checking. + Sizes *types.StdSizes + + // Roots is the set of package IDs that make up the root packages. + // We have to encode this separately because when we encode a single package + // we cannot know if it is one of the roots as that requires knowledge of the + // graph it is part of. + Roots []string `json:",omitempty"` + + // Packages is the full set of packages in the graph. + // The packages are not connected into a graph. + // The Imports if populated will be stubs that only have their ID set. + // Imports will be connected and then type and syntax information added in a + // later pass (see refine). + Packages []*Package +} + +// Load loads and returns the Go packages named by the given patterns. +// +// Config specifies loading options; +// nil behaves the same as an empty Config. +// +// Load returns an error if any of the patterns was invalid +// as defined by the underlying build system. +// It may return an empty list of packages without an error, +// for instance for an empty expansion of a valid wildcard. +// Errors associated with a particular package are recorded in the +// corresponding Package's Errors list, and do not cause Load to +// return an error. Clients may need to handle such errors before +// proceeding with further analysis. The PrintErrors function is +// provided for convenient display of all errors. +func Load(cfg *Config, patterns ...string) ([]*Package, error) { + l := newLoader(cfg) + response, err := defaultDriver(&l.Config, patterns...) + if err != nil { + return nil, err + } + l.sizes = response.Sizes + return l.refine(response.Roots, response.Packages...) +} + +// defaultDriver is a driver that implements go/packages' fallback behavior. +// It will try to request to an external driver, if one exists. If there's +// no external driver, or the driver returns a response with NotHandled set, +// defaultDriver will fall back to the go list driver. +func defaultDriver(cfg *Config, patterns ...string) (*driverResponse, error) { + driver := findExternalDriver(cfg) + if driver == nil { + driver = goListDriver + } + response, err := driver(cfg, patterns...) + if err != nil { + return response, err + } else if response.NotHandled { + return goListDriver(cfg, patterns...) + } + return response, nil +} + +// A Package describes a loaded Go package. +type Package struct { + // ID is a unique identifier for a package, + // in a syntax provided by the underlying build system. + // + // Because the syntax varies based on the build system, + // clients should treat IDs as opaque and not attempt to + // interpret them. + ID string + + // Name is the package name as it appears in the package source code. + Name string + + // PkgPath is the package path as used by the go/types package. + PkgPath string + + // Errors contains any errors encountered querying the metadata + // of the package, or while parsing or type-checking its files. + Errors []Error + + // GoFiles lists the absolute file paths of the package's Go source files. + GoFiles []string + + // CompiledGoFiles lists the absolute file paths of the package's source + // files that are suitable for type checking. + // This may differ from GoFiles if files are processed before compilation. + CompiledGoFiles []string + + // OtherFiles lists the absolute file paths of the package's non-Go source files, + // including assembly, C, C++, Fortran, Objective-C, SWIG, and so on. + OtherFiles []string + + // IgnoredFiles lists source files that are not part of the package + // using the current build configuration but that might be part of + // the package using other build configurations. + IgnoredFiles []string + + // ExportFile is the absolute path to a file containing type + // information for the package as provided by the build system. + ExportFile string + + // Imports maps import paths appearing in the package's Go source files + // to corresponding loaded Packages. + Imports map[string]*Package + + // Types provides type information for the package. + // The NeedTypes LoadMode bit sets this field for packages matching the + // patterns; type information for dependencies may be missing or incomplete, + // unless NeedDeps and NeedImports are also set. + Types *types.Package + + // Fset provides position information for Types, TypesInfo, and Syntax. + // It is set only when Types is set. + Fset *token.FileSet + + // IllTyped indicates whether the package or any dependency contains errors. + // It is set only when Types is set. + IllTyped bool + + // Syntax is the package's syntax trees, for the files listed in CompiledGoFiles. + // + // The NeedSyntax LoadMode bit populates this field for packages matching the patterns. + // If NeedDeps and NeedImports are also set, this field will also be populated + // for dependencies. + Syntax []*ast.File + + // TypesInfo provides type information about the package's syntax trees. + // It is set only when Syntax is set. + TypesInfo *types.Info + + // TypesSizes provides the effective size function for types in TypesInfo. + TypesSizes types.Sizes + + // forTest is the package under test, if any. + forTest string + + // module is the module information for the package if it exists. + Module *Module +} + +// Module provides module information for a package. +type Module struct { + Path string // module path + Version string // module version + Replace *Module // replaced by this module + Time *time.Time // time version was created + Main bool // is this the main module? + Indirect bool // is this module only an indirect dependency of main module? + Dir string // directory holding files for this module, if any + GoMod string // path to go.mod file used when loading this module, if any + GoVersion string // go version used in module + Error *ModuleError // error loading module +} + +// ModuleError holds errors loading a module. +type ModuleError struct { + Err string // the error itself +} + +func init() { + packagesinternal.GetForTest = func(p interface{}) string { + return p.(*Package).forTest + } + packagesinternal.GetGoCmdRunner = func(config interface{}) *gocommand.Runner { + return config.(*Config).gocmdRunner + } + packagesinternal.SetGoCmdRunner = func(config interface{}, runner *gocommand.Runner) { + config.(*Config).gocmdRunner = runner + } + packagesinternal.SetModFile = func(config interface{}, value string) { + config.(*Config).modFile = value + } + packagesinternal.SetModFlag = func(config interface{}, value string) { + config.(*Config).modFlag = value + } + packagesinternal.TypecheckCgo = int(typecheckCgo) +} + +// An Error describes a problem with a package's metadata, syntax, or types. +type Error struct { + Pos string // "file:line:col" or "file:line" or "" or "-" + Msg string + Kind ErrorKind +} + +// ErrorKind describes the source of the error, allowing the user to +// differentiate between errors generated by the driver, the parser, or the +// type-checker. +type ErrorKind int + +const ( + UnknownError ErrorKind = iota + ListError + ParseError + TypeError +) + +func (err Error) Error() string { + pos := err.Pos + if pos == "" { + pos = "-" // like token.Position{}.String() + } + return pos + ": " + err.Msg +} + +// flatPackage is the JSON form of Package +// It drops all the type and syntax fields, and transforms the Imports +// +// TODO(adonovan): identify this struct with Package, effectively +// publishing the JSON protocol. +type flatPackage struct { + ID string + Name string `json:",omitempty"` + PkgPath string `json:",omitempty"` + Errors []Error `json:",omitempty"` + GoFiles []string `json:",omitempty"` + CompiledGoFiles []string `json:",omitempty"` + OtherFiles []string `json:",omitempty"` + IgnoredFiles []string `json:",omitempty"` + ExportFile string `json:",omitempty"` + Imports map[string]string `json:",omitempty"` +} + +// MarshalJSON returns the Package in its JSON form. +// For the most part, the structure fields are written out unmodified, and +// the type and syntax fields are skipped. +// The imports are written out as just a map of path to package id. +// The errors are written using a custom type that tries to preserve the +// structure of error types we know about. +// +// This method exists to enable support for additional build systems. It is +// not intended for use by clients of the API and we may change the format. +func (p *Package) MarshalJSON() ([]byte, error) { + flat := &flatPackage{ + ID: p.ID, + Name: p.Name, + PkgPath: p.PkgPath, + Errors: p.Errors, + GoFiles: p.GoFiles, + CompiledGoFiles: p.CompiledGoFiles, + OtherFiles: p.OtherFiles, + IgnoredFiles: p.IgnoredFiles, + ExportFile: p.ExportFile, + } + if len(p.Imports) > 0 { + flat.Imports = make(map[string]string, len(p.Imports)) + for path, ipkg := range p.Imports { + flat.Imports[path] = ipkg.ID + } + } + return json.Marshal(flat) +} + +// UnmarshalJSON reads in a Package from its JSON format. +// See MarshalJSON for details about the format accepted. +func (p *Package) UnmarshalJSON(b []byte) error { + flat := &flatPackage{} + if err := json.Unmarshal(b, &flat); err != nil { + return err + } + *p = Package{ + ID: flat.ID, + Name: flat.Name, + PkgPath: flat.PkgPath, + Errors: flat.Errors, + GoFiles: flat.GoFiles, + CompiledGoFiles: flat.CompiledGoFiles, + OtherFiles: flat.OtherFiles, + ExportFile: flat.ExportFile, + } + if len(flat.Imports) > 0 { + p.Imports = make(map[string]*Package, len(flat.Imports)) + for path, id := range flat.Imports { + p.Imports[path] = &Package{ID: id} + } + } + return nil +} + +func (p *Package) String() string { return p.ID } + +// loaderPackage augments Package with state used during the loading phase +type loaderPackage struct { + *Package + importErrors map[string]error // maps each bad import to its error + loadOnce sync.Once + color uint8 // for cycle detection + needsrc bool // load from source (Mode >= LoadTypes) + needtypes bool // type information is either requested or depended on + initial bool // package was matched by a pattern +} + +// loader holds the working state of a single call to load. +type loader struct { + pkgs map[string]*loaderPackage + Config + sizes types.Sizes + parseCache map[string]*parseValue + parseCacheMu sync.Mutex + exportMu sync.Mutex // enforces mutual exclusion of exportdata operations + + // Config.Mode contains the implied mode (see impliedLoadMode). + // Implied mode contains all the fields we need the data for. + // In requestedMode there are the actually requested fields. + // We'll zero them out before returning packages to the user. + // This makes it easier for us to get the conditions where + // we need certain modes right. + requestedMode LoadMode +} + +type parseValue struct { + f *ast.File + err error + ready chan struct{} +} + +func newLoader(cfg *Config) *loader { + ld := &loader{ + parseCache: map[string]*parseValue{}, + } + if cfg != nil { + ld.Config = *cfg + // If the user has provided a logger, use it. + ld.Config.Logf = cfg.Logf + } + if ld.Config.Logf == nil { + // If the GOPACKAGESDEBUG environment variable is set to true, + // but the user has not provided a logger, default to log.Printf. + if debug { + ld.Config.Logf = log.Printf + } else { + ld.Config.Logf = func(format string, args ...interface{}) {} + } + } + if ld.Config.Mode == 0 { + ld.Config.Mode = NeedName | NeedFiles | NeedCompiledGoFiles // Preserve zero behavior of Mode for backwards compatibility. + } + if ld.Config.Env == nil { + ld.Config.Env = os.Environ() + } + if ld.Config.gocmdRunner == nil { + ld.Config.gocmdRunner = &gocommand.Runner{} + } + if ld.Context == nil { + ld.Context = context.Background() + } + if ld.Dir == "" { + if dir, err := os.Getwd(); err == nil { + ld.Dir = dir + } + } + + // Save the actually requested fields. We'll zero them out before returning packages to the user. + ld.requestedMode = ld.Mode + ld.Mode = impliedLoadMode(ld.Mode) + + if ld.Mode&NeedTypes != 0 || ld.Mode&NeedSyntax != 0 { + if ld.Fset == nil { + ld.Fset = token.NewFileSet() + } + + // ParseFile is required even in LoadTypes mode + // because we load source if export data is missing. + if ld.ParseFile == nil { + ld.ParseFile = func(fset *token.FileSet, filename string, src []byte) (*ast.File, error) { + const mode = parser.AllErrors | parser.ParseComments + return parser.ParseFile(fset, filename, src, mode) + } + } + } + + return ld +} + +// refine connects the supplied packages into a graph and then adds type and +// and syntax information as requested by the LoadMode. +func (ld *loader) refine(roots []string, list ...*Package) ([]*Package, error) { + rootMap := make(map[string]int, len(roots)) + for i, root := range roots { + rootMap[root] = i + } + ld.pkgs = make(map[string]*loaderPackage) + // first pass, fixup and build the map and roots + var initial = make([]*loaderPackage, len(roots)) + for _, pkg := range list { + rootIndex := -1 + if i, found := rootMap[pkg.ID]; found { + rootIndex = i + } + + // Overlays can invalidate export data. + // TODO(matloob): make this check fine-grained based on dependencies on overlaid files + exportDataInvalid := len(ld.Overlay) > 0 || pkg.ExportFile == "" && pkg.PkgPath != "unsafe" + // This package needs type information if the caller requested types and the package is + // either a root, or it's a non-root and the user requested dependencies ... + needtypes := (ld.Mode&NeedTypes|NeedTypesInfo != 0 && (rootIndex >= 0 || ld.Mode&NeedDeps != 0)) + // This package needs source if the call requested source (or types info, which implies source) + // and the package is either a root, or itas a non- root and the user requested dependencies... + needsrc := ((ld.Mode&(NeedSyntax|NeedTypesInfo) != 0 && (rootIndex >= 0 || ld.Mode&NeedDeps != 0)) || + // ... or if we need types and the exportData is invalid. We fall back to (incompletely) + // typechecking packages from source if they fail to compile. + (ld.Mode&NeedTypes|NeedTypesInfo != 0 && exportDataInvalid)) && pkg.PkgPath != "unsafe" + lpkg := &loaderPackage{ + Package: pkg, + needtypes: needtypes, + needsrc: needsrc, + } + ld.pkgs[lpkg.ID] = lpkg + if rootIndex >= 0 { + initial[rootIndex] = lpkg + lpkg.initial = true + } + } + for i, root := range roots { + if initial[i] == nil { + return nil, fmt.Errorf("root package %v is missing", root) + } + } + + // Materialize the import graph. + + const ( + white = 0 // new + grey = 1 // in progress + black = 2 // complete + ) + + // visit traverses the import graph, depth-first, + // and materializes the graph as Packages.Imports. + // + // Valid imports are saved in the Packages.Import map. + // Invalid imports (cycles and missing nodes) are saved in the importErrors map. + // Thus, even in the presence of both kinds of errors, the Import graph remains a DAG. + // + // visit returns whether the package needs src or has a transitive + // dependency on a package that does. These are the only packages + // for which we load source code. + var stack []*loaderPackage + var visit func(lpkg *loaderPackage) bool + var srcPkgs []*loaderPackage + visit = func(lpkg *loaderPackage) bool { + switch lpkg.color { + case black: + return lpkg.needsrc + case grey: + panic("internal error: grey node") + } + lpkg.color = grey + stack = append(stack, lpkg) // push + stubs := lpkg.Imports // the structure form has only stubs with the ID in the Imports + // If NeedImports isn't set, the imports fields will all be zeroed out. + if ld.Mode&NeedImports != 0 { + lpkg.Imports = make(map[string]*Package, len(stubs)) + for importPath, ipkg := range stubs { + var importErr error + imp := ld.pkgs[ipkg.ID] + if imp == nil { + // (includes package "C" when DisableCgo) + importErr = fmt.Errorf("missing package: %q", ipkg.ID) + } else if imp.color == grey { + importErr = fmt.Errorf("import cycle: %s", stack) + } + if importErr != nil { + if lpkg.importErrors == nil { + lpkg.importErrors = make(map[string]error) + } + lpkg.importErrors[importPath] = importErr + continue + } + + if visit(imp) { + lpkg.needsrc = true + } + lpkg.Imports[importPath] = imp.Package + } + } + if lpkg.needsrc { + srcPkgs = append(srcPkgs, lpkg) + } + if ld.Mode&NeedTypesSizes != 0 { + lpkg.TypesSizes = ld.sizes + } + stack = stack[:len(stack)-1] // pop + lpkg.color = black + + return lpkg.needsrc + } + + if ld.Mode&NeedImports == 0 { + // We do this to drop the stub import packages that we are not even going to try to resolve. + for _, lpkg := range initial { + lpkg.Imports = nil + } + } else { + // For each initial package, create its import DAG. + for _, lpkg := range initial { + visit(lpkg) + } + } + if ld.Mode&NeedImports != 0 && ld.Mode&NeedTypes != 0 { + for _, lpkg := range srcPkgs { + // Complete type information is required for the + // immediate dependencies of each source package. + for _, ipkg := range lpkg.Imports { + imp := ld.pkgs[ipkg.ID] + imp.needtypes = true + } + } + } + // Load type data and syntax if needed, starting at + // the initial packages (roots of the import DAG). + if ld.Mode&NeedTypes != 0 || ld.Mode&NeedSyntax != 0 { + var wg sync.WaitGroup + for _, lpkg := range initial { + wg.Add(1) + go func(lpkg *loaderPackage) { + ld.loadRecursive(lpkg) + wg.Done() + }(lpkg) + } + wg.Wait() + } + + result := make([]*Package, len(initial)) + for i, lpkg := range initial { + result[i] = lpkg.Package + } + for i := range ld.pkgs { + // Clear all unrequested fields, + // to catch programs that use more than they request. + if ld.requestedMode&NeedName == 0 { + ld.pkgs[i].Name = "" + ld.pkgs[i].PkgPath = "" + } + if ld.requestedMode&NeedFiles == 0 { + ld.pkgs[i].GoFiles = nil + ld.pkgs[i].OtherFiles = nil + ld.pkgs[i].IgnoredFiles = nil + } + if ld.requestedMode&NeedCompiledGoFiles == 0 { + ld.pkgs[i].CompiledGoFiles = nil + } + if ld.requestedMode&NeedImports == 0 { + ld.pkgs[i].Imports = nil + } + if ld.requestedMode&NeedExportsFile == 0 { + ld.pkgs[i].ExportFile = "" + } + if ld.requestedMode&NeedTypes == 0 { + ld.pkgs[i].Types = nil + ld.pkgs[i].Fset = nil + ld.pkgs[i].IllTyped = false + } + if ld.requestedMode&NeedSyntax == 0 { + ld.pkgs[i].Syntax = nil + } + if ld.requestedMode&NeedTypesInfo == 0 { + ld.pkgs[i].TypesInfo = nil + } + if ld.requestedMode&NeedTypesSizes == 0 { + ld.pkgs[i].TypesSizes = nil + } + if ld.requestedMode&NeedModule == 0 { + ld.pkgs[i].Module = nil + } + } + + return result, nil +} + +// loadRecursive loads the specified package and its dependencies, +// recursively, in parallel, in topological order. +// It is atomic and idempotent. +// Precondition: ld.Mode&NeedTypes. +func (ld *loader) loadRecursive(lpkg *loaderPackage) { + lpkg.loadOnce.Do(func() { + // Load the direct dependencies, in parallel. + var wg sync.WaitGroup + for _, ipkg := range lpkg.Imports { + imp := ld.pkgs[ipkg.ID] + wg.Add(1) + go func(imp *loaderPackage) { + ld.loadRecursive(imp) + wg.Done() + }(imp) + } + wg.Wait() + ld.loadPackage(lpkg) + }) +} + +// loadPackage loads the specified package. +// It must be called only once per Package, +// after immediate dependencies are loaded. +// Precondition: ld.Mode & NeedTypes. +func (ld *loader) loadPackage(lpkg *loaderPackage) { + if lpkg.PkgPath == "unsafe" { + // Fill in the blanks to avoid surprises. + lpkg.Types = types.Unsafe + lpkg.Fset = ld.Fset + lpkg.Syntax = []*ast.File{} + lpkg.TypesInfo = new(types.Info) + lpkg.TypesSizes = ld.sizes + return + } + + // Call NewPackage directly with explicit name. + // This avoids skew between golist and go/types when the files' + // package declarations are inconsistent. + lpkg.Types = types.NewPackage(lpkg.PkgPath, lpkg.Name) + lpkg.Fset = ld.Fset + + // Subtle: we populate all Types fields with an empty Package + // before loading export data so that export data processing + // never has to create a types.Package for an indirect dependency, + // which would then require that such created packages be explicitly + // inserted back into the Import graph as a final step after export data loading. + // The Diamond test exercises this case. + if !lpkg.needtypes && !lpkg.needsrc { + return + } + if !lpkg.needsrc { + ld.loadFromExportData(lpkg) + return // not a source package, don't get syntax trees + } + + appendError := func(err error) { + // Convert various error types into the one true Error. + var errs []Error + switch err := err.(type) { + case Error: + // from driver + errs = append(errs, err) + + case *os.PathError: + // from parser + errs = append(errs, Error{ + Pos: err.Path + ":1", + Msg: err.Err.Error(), + Kind: ParseError, + }) + + case scanner.ErrorList: + // from parser + for _, err := range err { + errs = append(errs, Error{ + Pos: err.Pos.String(), + Msg: err.Msg, + Kind: ParseError, + }) + } + + case types.Error: + // from type checker + errs = append(errs, Error{ + Pos: err.Fset.Position(err.Pos).String(), + Msg: err.Msg, + Kind: TypeError, + }) + + default: + // unexpected impoverished error from parser? + errs = append(errs, Error{ + Pos: "-", + Msg: err.Error(), + Kind: UnknownError, + }) + + // If you see this error message, please file a bug. + log.Printf("internal error: error %q (%T) without position", err, err) + } + + lpkg.Errors = append(lpkg.Errors, errs...) + } + + if ld.Config.Mode&NeedTypes != 0 && len(lpkg.CompiledGoFiles) == 0 && lpkg.ExportFile != "" { + // The config requested loading sources and types, but sources are missing. + // Add an error to the package and fall back to loading from export data. + appendError(Error{"-", fmt.Sprintf("sources missing for package %s", lpkg.ID), ParseError}) + ld.loadFromExportData(lpkg) + return // can't get syntax trees for this package + } + + files, errs := ld.parseFiles(lpkg.CompiledGoFiles) + for _, err := range errs { + appendError(err) + } + + lpkg.Syntax = files + if ld.Config.Mode&NeedTypes == 0 { + return + } + + lpkg.TypesInfo = &types.Info{ + Types: make(map[ast.Expr]types.TypeAndValue), + Defs: make(map[*ast.Ident]types.Object), + Uses: make(map[*ast.Ident]types.Object), + Implicits: make(map[ast.Node]types.Object), + Scopes: make(map[ast.Node]*types.Scope), + Selections: make(map[*ast.SelectorExpr]*types.Selection), + } + lpkg.TypesSizes = ld.sizes + + importer := importerFunc(func(path string) (*types.Package, error) { + if path == "unsafe" { + return types.Unsafe, nil + } + + // The imports map is keyed by import path. + ipkg := lpkg.Imports[path] + if ipkg == nil { + if err := lpkg.importErrors[path]; err != nil { + return nil, err + } + // There was skew between the metadata and the + // import declarations, likely due to an edit + // race, or because the ParseFile feature was + // used to supply alternative file contents. + return nil, fmt.Errorf("no metadata for %s", path) + } + + if ipkg.Types != nil && ipkg.Types.Complete() { + return ipkg.Types, nil + } + log.Fatalf("internal error: package %q without types was imported from %q", path, lpkg) + panic("unreachable") + }) + + // type-check + tc := &types.Config{ + Importer: importer, + + // Type-check bodies of functions only in non-initial packages. + // Example: for import graph A->B->C and initial packages {A,C}, + // we can ignore function bodies in B. + IgnoreFuncBodies: ld.Mode&NeedDeps == 0 && !lpkg.initial, + + Error: appendError, + Sizes: ld.sizes, + } + if (ld.Mode & typecheckCgo) != 0 { + if !typesinternal.SetUsesCgo(tc) { + appendError(Error{ + Msg: "typecheckCgo requires Go 1.15+", + Kind: ListError, + }) + return + } + } + types.NewChecker(tc, ld.Fset, lpkg.Types, lpkg.TypesInfo).Files(lpkg.Syntax) + + lpkg.importErrors = nil // no longer needed + + // If !Cgo, the type-checker uses FakeImportC mode, so + // it doesn't invoke the importer for import "C", + // nor report an error for the import, + // or for any undefined C.f reference. + // We must detect this explicitly and correctly + // mark the package as IllTyped (by reporting an error). + // TODO(adonovan): if these errors are annoying, + // we could just set IllTyped quietly. + if tc.FakeImportC { + outer: + for _, f := range lpkg.Syntax { + for _, imp := range f.Imports { + if imp.Path.Value == `"C"` { + err := types.Error{Fset: ld.Fset, Pos: imp.Pos(), Msg: `import "C" ignored`} + appendError(err) + break outer + } + } + } + } + + // Record accumulated errors. + illTyped := len(lpkg.Errors) > 0 + if !illTyped { + for _, imp := range lpkg.Imports { + if imp.IllTyped { + illTyped = true + break + } + } + } + lpkg.IllTyped = illTyped +} + +// An importFunc is an implementation of the single-method +// types.Importer interface based on a function value. +type importerFunc func(path string) (*types.Package, error) + +func (f importerFunc) Import(path string) (*types.Package, error) { return f(path) } + +// We use a counting semaphore to limit +// the number of parallel I/O calls per process. +var ioLimit = make(chan bool, 20) + +func (ld *loader) parseFile(filename string) (*ast.File, error) { + ld.parseCacheMu.Lock() + v, ok := ld.parseCache[filename] + if ok { + // cache hit + ld.parseCacheMu.Unlock() + <-v.ready + } else { + // cache miss + v = &parseValue{ready: make(chan struct{})} + ld.parseCache[filename] = v + ld.parseCacheMu.Unlock() + + var src []byte + for f, contents := range ld.Config.Overlay { + if sameFile(f, filename) { + src = contents + } + } + var err error + if src == nil { + ioLimit <- true // wait + src, err = ioutil.ReadFile(filename) + <-ioLimit // signal + } + if err != nil { + v.err = err + } else { + v.f, v.err = ld.ParseFile(ld.Fset, filename, src) + } + + close(v.ready) + } + return v.f, v.err +} + +// parseFiles reads and parses the Go source files and returns the ASTs +// of the ones that could be at least partially parsed, along with a +// list of I/O and parse errors encountered. +// +// Because files are scanned in parallel, the token.Pos +// positions of the resulting ast.Files are not ordered. +// +func (ld *loader) parseFiles(filenames []string) ([]*ast.File, []error) { + var wg sync.WaitGroup + n := len(filenames) + parsed := make([]*ast.File, n) + errors := make([]error, n) + for i, file := range filenames { + if ld.Config.Context.Err() != nil { + parsed[i] = nil + errors[i] = ld.Config.Context.Err() + continue + } + wg.Add(1) + go func(i int, filename string) { + parsed[i], errors[i] = ld.parseFile(filename) + wg.Done() + }(i, file) + } + wg.Wait() + + // Eliminate nils, preserving order. + var o int + for _, f := range parsed { + if f != nil { + parsed[o] = f + o++ + } + } + parsed = parsed[:o] + + o = 0 + for _, err := range errors { + if err != nil { + errors[o] = err + o++ + } + } + errors = errors[:o] + + return parsed, errors +} + +// sameFile returns true if x and y have the same basename and denote +// the same file. +// +func sameFile(x, y string) bool { + if x == y { + // It could be the case that y doesn't exist. + // For instance, it may be an overlay file that + // hasn't been written to disk. To handle that case + // let x == y through. (We added the exact absolute path + // string to the CompiledGoFiles list, so the unwritten + // overlay case implies x==y.) + return true + } + if strings.EqualFold(filepath.Base(x), filepath.Base(y)) { // (optimisation) + if xi, err := os.Stat(x); err == nil { + if yi, err := os.Stat(y); err == nil { + return os.SameFile(xi, yi) + } + } + } + return false +} + +// loadFromExportData returns type information for the specified +// package, loading it from an export data file on the first request. +func (ld *loader) loadFromExportData(lpkg *loaderPackage) (*types.Package, error) { + if lpkg.PkgPath == "" { + log.Fatalf("internal error: Package %s has no PkgPath", lpkg) + } + + // Because gcexportdata.Read has the potential to create or + // modify the types.Package for each node in the transitive + // closure of dependencies of lpkg, all exportdata operations + // must be sequential. (Finer-grained locking would require + // changes to the gcexportdata API.) + // + // The exportMu lock guards the Package.Pkg field and the + // types.Package it points to, for each Package in the graph. + // + // Not all accesses to Package.Pkg need to be protected by exportMu: + // graph ordering ensures that direct dependencies of source + // packages are fully loaded before the importer reads their Pkg field. + ld.exportMu.Lock() + defer ld.exportMu.Unlock() + + if tpkg := lpkg.Types; tpkg != nil && tpkg.Complete() { + return tpkg, nil // cache hit + } + + lpkg.IllTyped = true // fail safe + + if lpkg.ExportFile == "" { + // Errors while building export data will have been printed to stderr. + return nil, fmt.Errorf("no export data file") + } + f, err := os.Open(lpkg.ExportFile) + if err != nil { + return nil, err + } + defer f.Close() + + // Read gc export data. + // + // We don't currently support gccgo export data because all + // underlying workspaces use the gc toolchain. (Even build + // systems that support gccgo don't use it for workspace + // queries.) + r, err := gcexportdata.NewReader(f) + if err != nil { + return nil, fmt.Errorf("reading %s: %v", lpkg.ExportFile, err) + } + + // Build the view. + // + // The gcexportdata machinery has no concept of package ID. + // It identifies packages by their PkgPath, which although not + // globally unique is unique within the scope of one invocation + // of the linker, type-checker, or gcexportdata. + // + // So, we must build a PkgPath-keyed view of the global + // (conceptually ID-keyed) cache of packages and pass it to + // gcexportdata. The view must contain every existing + // package that might possibly be mentioned by the + // current package---its transitive closure. + // + // In loadPackage, we unconditionally create a types.Package for + // each dependency so that export data loading does not + // create new ones. + // + // TODO(adonovan): it would be simpler and more efficient + // if the export data machinery invoked a callback to + // get-or-create a package instead of a map. + // + view := make(map[string]*types.Package) // view seen by gcexportdata + seen := make(map[*loaderPackage]bool) // all visited packages + var visit func(pkgs map[string]*Package) + visit = func(pkgs map[string]*Package) { + for _, p := range pkgs { + lpkg := ld.pkgs[p.ID] + if !seen[lpkg] { + seen[lpkg] = true + view[lpkg.PkgPath] = lpkg.Types + visit(lpkg.Imports) + } + } + } + visit(lpkg.Imports) + + viewLen := len(view) + 1 // adding the self package + // Parse the export data. + // (May modify incomplete packages in view but not create new ones.) + tpkg, err := gcexportdata.Read(r, ld.Fset, view, lpkg.PkgPath) + if err != nil { + return nil, fmt.Errorf("reading %s: %v", lpkg.ExportFile, err) + } + if viewLen != len(view) { + log.Fatalf("Unexpected package creation during export data loading") + } + + lpkg.Types = tpkg + lpkg.IllTyped = false + + return tpkg, nil +} + +// impliedLoadMode returns loadMode with its dependencies. +func impliedLoadMode(loadMode LoadMode) LoadMode { + if loadMode&NeedTypesInfo != 0 && loadMode&NeedImports == 0 { + // If NeedTypesInfo, go/packages needs to do typechecking itself so it can + // associate type info with the AST. To do so, we need the export data + // for dependencies, which means we need to ask for the direct dependencies. + // NeedImports is used to ask for the direct dependencies. + loadMode |= NeedImports + } + + if loadMode&NeedDeps != 0 && loadMode&NeedImports == 0 { + // With NeedDeps we need to load at least direct dependencies. + // NeedImports is used to ask for the direct dependencies. + loadMode |= NeedImports + } + + return loadMode +} + +func usesExportData(cfg *Config) bool { + return cfg.Mode&NeedExportsFile != 0 || cfg.Mode&NeedTypes != 0 && cfg.Mode&NeedDeps == 0 +} diff --git a/vendor/golang.org/x/tools/go/packages/visit.go b/vendor/golang.org/x/tools/go/packages/visit.go new file mode 100644 index 0000000000..a1dcc40b72 --- /dev/null +++ b/vendor/golang.org/x/tools/go/packages/visit.go @@ -0,0 +1,59 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package packages + +import ( + "fmt" + "os" + "sort" +) + +// Visit visits all the packages in the import graph whose roots are +// pkgs, calling the optional pre function the first time each package +// is encountered (preorder), and the optional post function after a +// package's dependencies have been visited (postorder). +// The boolean result of pre(pkg) determines whether +// the imports of package pkg are visited. +func Visit(pkgs []*Package, pre func(*Package) bool, post func(*Package)) { + seen := make(map[*Package]bool) + var visit func(*Package) + visit = func(pkg *Package) { + if !seen[pkg] { + seen[pkg] = true + + if pre == nil || pre(pkg) { + paths := make([]string, 0, len(pkg.Imports)) + for path := range pkg.Imports { + paths = append(paths, path) + } + sort.Strings(paths) // Imports is a map, this makes visit stable + for _, path := range paths { + visit(pkg.Imports[path]) + } + } + + if post != nil { + post(pkg) + } + } + } + for _, pkg := range pkgs { + visit(pkg) + } +} + +// PrintErrors prints to os.Stderr the accumulated errors of all +// packages in the import graph rooted at pkgs, dependencies first. +// PrintErrors returns the number of errors printed. +func PrintErrors(pkgs []*Package) int { + var n int + Visit(pkgs, nil, func(pkg *Package) { + for _, err := range pkg.Errors { + fmt.Fprintln(os.Stderr, err) + n++ + } + }) + return n +} diff --git a/vendor/golang.org/x/tools/internal/event/core/event.go b/vendor/golang.org/x/tools/internal/event/core/event.go new file mode 100644 index 0000000000..a6cf0e64a4 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/event/core/event.go @@ -0,0 +1,85 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package core provides support for event based telemetry. +package core + +import ( + "fmt" + "time" + + "golang.org/x/tools/internal/event/label" +) + +// Event holds the information about an event of note that occurred. +type Event struct { + at time.Time + + // As events are often on the stack, storing the first few labels directly + // in the event can avoid an allocation at all for the very common cases of + // simple events. + // The length needs to be large enough to cope with the majority of events + // but no so large as to cause undue stack pressure. + // A log message with two values will use 3 labels (one for each value and + // one for the message itself). + + static [3]label.Label // inline storage for the first few labels + dynamic []label.Label // dynamically sized storage for remaining labels +} + +// eventLabelMap implements label.Map for a the labels of an Event. +type eventLabelMap struct { + event Event +} + +func (ev Event) At() time.Time { return ev.at } + +func (ev Event) Format(f fmt.State, r rune) { + if !ev.at.IsZero() { + fmt.Fprint(f, ev.at.Format("2006/01/02 15:04:05 ")) + } + for index := 0; ev.Valid(index); index++ { + if l := ev.Label(index); l.Valid() { + fmt.Fprintf(f, "\n\t%v", l) + } + } +} + +func (ev Event) Valid(index int) bool { + return index >= 0 && index < len(ev.static)+len(ev.dynamic) +} + +func (ev Event) Label(index int) label.Label { + if index < len(ev.static) { + return ev.static[index] + } + return ev.dynamic[index-len(ev.static)] +} + +func (ev Event) Find(key label.Key) label.Label { + for _, l := range ev.static { + if l.Key() == key { + return l + } + } + for _, l := range ev.dynamic { + if l.Key() == key { + return l + } + } + return label.Label{} +} + +func MakeEvent(static [3]label.Label, labels []label.Label) Event { + return Event{ + static: static, + dynamic: labels, + } +} + +// CloneEvent event returns a copy of the event with the time adjusted to at. +func CloneEvent(ev Event, at time.Time) Event { + ev.at = at + return ev +} diff --git a/vendor/golang.org/x/tools/internal/event/core/export.go b/vendor/golang.org/x/tools/internal/event/core/export.go new file mode 100644 index 0000000000..05f3a9a579 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/event/core/export.go @@ -0,0 +1,70 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package core + +import ( + "context" + "sync/atomic" + "time" + "unsafe" + + "golang.org/x/tools/internal/event/label" +) + +// Exporter is a function that handles events. +// It may return a modified context and event. +type Exporter func(context.Context, Event, label.Map) context.Context + +var ( + exporter unsafe.Pointer +) + +// SetExporter sets the global exporter function that handles all events. +// The exporter is called synchronously from the event call site, so it should +// return quickly so as not to hold up user code. +func SetExporter(e Exporter) { + p := unsafe.Pointer(&e) + if e == nil { + // &e is always valid, and so p is always valid, but for the early abort + // of ProcessEvent to be efficient it needs to make the nil check on the + // pointer without having to dereference it, so we make the nil function + // also a nil pointer + p = nil + } + atomic.StorePointer(&exporter, p) +} + +// deliver is called to deliver an event to the supplied exporter. +// it will fill in the time. +func deliver(ctx context.Context, exporter Exporter, ev Event) context.Context { + // add the current time to the event + ev.at = time.Now() + // hand the event off to the current exporter + return exporter(ctx, ev, ev) +} + +// Export is called to deliver an event to the global exporter if set. +func Export(ctx context.Context, ev Event) context.Context { + // get the global exporter and abort early if there is not one + exporterPtr := (*Exporter)(atomic.LoadPointer(&exporter)) + if exporterPtr == nil { + return ctx + } + return deliver(ctx, *exporterPtr, ev) +} + +// ExportPair is called to deliver a start event to the supplied exporter. +// It also returns a function that will deliver the end event to the same +// exporter. +// It will fill in the time. +func ExportPair(ctx context.Context, begin, end Event) (context.Context, func()) { + // get the global exporter and abort early if there is not one + exporterPtr := (*Exporter)(atomic.LoadPointer(&exporter)) + if exporterPtr == nil { + return ctx, func() {} + } + ctx = deliver(ctx, *exporterPtr, begin) + return ctx, func() { deliver(ctx, *exporterPtr, end) } +} diff --git a/vendor/golang.org/x/tools/internal/event/core/fast.go b/vendor/golang.org/x/tools/internal/event/core/fast.go new file mode 100644 index 0000000000..06c1d4615e --- /dev/null +++ b/vendor/golang.org/x/tools/internal/event/core/fast.go @@ -0,0 +1,77 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package core + +import ( + "context" + + "golang.org/x/tools/internal/event/keys" + "golang.org/x/tools/internal/event/label" +) + +// Log1 takes a message and one label delivers a log event to the exporter. +// It is a customized version of Print that is faster and does no allocation. +func Log1(ctx context.Context, message string, t1 label.Label) { + Export(ctx, MakeEvent([3]label.Label{ + keys.Msg.Of(message), + t1, + }, nil)) +} + +// Log2 takes a message and two labels and delivers a log event to the exporter. +// It is a customized version of Print that is faster and does no allocation. +func Log2(ctx context.Context, message string, t1 label.Label, t2 label.Label) { + Export(ctx, MakeEvent([3]label.Label{ + keys.Msg.Of(message), + t1, + t2, + }, nil)) +} + +// Metric1 sends a label event to the exporter with the supplied labels. +func Metric1(ctx context.Context, t1 label.Label) context.Context { + return Export(ctx, MakeEvent([3]label.Label{ + keys.Metric.New(), + t1, + }, nil)) +} + +// Metric2 sends a label event to the exporter with the supplied labels. +func Metric2(ctx context.Context, t1, t2 label.Label) context.Context { + return Export(ctx, MakeEvent([3]label.Label{ + keys.Metric.New(), + t1, + t2, + }, nil)) +} + +// Start1 sends a span start event with the supplied label list to the exporter. +// It also returns a function that will end the span, which should normally be +// deferred. +func Start1(ctx context.Context, name string, t1 label.Label) (context.Context, func()) { + return ExportPair(ctx, + MakeEvent([3]label.Label{ + keys.Start.Of(name), + t1, + }, nil), + MakeEvent([3]label.Label{ + keys.End.New(), + }, nil)) +} + +// Start2 sends a span start event with the supplied label list to the exporter. +// It also returns a function that will end the span, which should normally be +// deferred. +func Start2(ctx context.Context, name string, t1, t2 label.Label) (context.Context, func()) { + return ExportPair(ctx, + MakeEvent([3]label.Label{ + keys.Start.Of(name), + t1, + t2, + }, nil), + MakeEvent([3]label.Label{ + keys.End.New(), + }, nil)) +} diff --git a/vendor/golang.org/x/term/term_unix_solaris.go b/vendor/golang.org/x/tools/internal/event/doc.go similarity index 53% rename from vendor/golang.org/x/term/term_unix_solaris.go rename to vendor/golang.org/x/tools/internal/event/doc.go index 2d5efd26ad..5dc6e6babe 100644 --- a/vendor/golang.org/x/term/term_unix_solaris.go +++ b/vendor/golang.org/x/tools/internal/event/doc.go @@ -2,9 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package term - -import "golang.org/x/sys/unix" - -const ioctlReadTermios = unix.TCGETS -const ioctlWriteTermios = unix.TCSETS +// Package event provides a set of packages that cover the main +// concepts of telemetry in an implementation agnostic way. +package event diff --git a/vendor/golang.org/x/tools/internal/event/event.go b/vendor/golang.org/x/tools/internal/event/event.go new file mode 100644 index 0000000000..4d55e577d1 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/event/event.go @@ -0,0 +1,127 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package event + +import ( + "context" + + "golang.org/x/tools/internal/event/core" + "golang.org/x/tools/internal/event/keys" + "golang.org/x/tools/internal/event/label" +) + +// Exporter is a function that handles events. +// It may return a modified context and event. +type Exporter func(context.Context, core.Event, label.Map) context.Context + +// SetExporter sets the global exporter function that handles all events. +// The exporter is called synchronously from the event call site, so it should +// return quickly so as not to hold up user code. +func SetExporter(e Exporter) { + core.SetExporter(core.Exporter(e)) +} + +// Log takes a message and a label list and combines them into a single event +// before delivering them to the exporter. +func Log(ctx context.Context, message string, labels ...label.Label) { + core.Export(ctx, core.MakeEvent([3]label.Label{ + keys.Msg.Of(message), + }, labels)) +} + +// IsLog returns true if the event was built by the Log function. +// It is intended to be used in exporters to identify the semantics of the +// event when deciding what to do with it. +func IsLog(ev core.Event) bool { + return ev.Label(0).Key() == keys.Msg +} + +// Error takes a message and a label list and combines them into a single event +// before delivering them to the exporter. It captures the error in the +// delivered event. +func Error(ctx context.Context, message string, err error, labels ...label.Label) { + core.Export(ctx, core.MakeEvent([3]label.Label{ + keys.Msg.Of(message), + keys.Err.Of(err), + }, labels)) +} + +// IsError returns true if the event was built by the Error function. +// It is intended to be used in exporters to identify the semantics of the +// event when deciding what to do with it. +func IsError(ev core.Event) bool { + return ev.Label(0).Key() == keys.Msg && + ev.Label(1).Key() == keys.Err +} + +// Metric sends a label event to the exporter with the supplied labels. +func Metric(ctx context.Context, labels ...label.Label) { + core.Export(ctx, core.MakeEvent([3]label.Label{ + keys.Metric.New(), + }, labels)) +} + +// IsMetric returns true if the event was built by the Metric function. +// It is intended to be used in exporters to identify the semantics of the +// event when deciding what to do with it. +func IsMetric(ev core.Event) bool { + return ev.Label(0).Key() == keys.Metric +} + +// Label sends a label event to the exporter with the supplied labels. +func Label(ctx context.Context, labels ...label.Label) context.Context { + return core.Export(ctx, core.MakeEvent([3]label.Label{ + keys.Label.New(), + }, labels)) +} + +// IsLabel returns true if the event was built by the Label function. +// It is intended to be used in exporters to identify the semantics of the +// event when deciding what to do with it. +func IsLabel(ev core.Event) bool { + return ev.Label(0).Key() == keys.Label +} + +// Start sends a span start event with the supplied label list to the exporter. +// It also returns a function that will end the span, which should normally be +// deferred. +func Start(ctx context.Context, name string, labels ...label.Label) (context.Context, func()) { + return core.ExportPair(ctx, + core.MakeEvent([3]label.Label{ + keys.Start.Of(name), + }, labels), + core.MakeEvent([3]label.Label{ + keys.End.New(), + }, nil)) +} + +// IsStart returns true if the event was built by the Start function. +// It is intended to be used in exporters to identify the semantics of the +// event when deciding what to do with it. +func IsStart(ev core.Event) bool { + return ev.Label(0).Key() == keys.Start +} + +// IsEnd returns true if the event was built by the End function. +// It is intended to be used in exporters to identify the semantics of the +// event when deciding what to do with it. +func IsEnd(ev core.Event) bool { + return ev.Label(0).Key() == keys.End +} + +// Detach returns a context without an associated span. +// This allows the creation of spans that are not children of the current span. +func Detach(ctx context.Context) context.Context { + return core.Export(ctx, core.MakeEvent([3]label.Label{ + keys.Detach.New(), + }, nil)) +} + +// IsDetach returns true if the event was built by the Detach function. +// It is intended to be used in exporters to identify the semantics of the +// event when deciding what to do with it. +func IsDetach(ev core.Event) bool { + return ev.Label(0).Key() == keys.Detach +} diff --git a/vendor/golang.org/x/tools/internal/event/keys/keys.go b/vendor/golang.org/x/tools/internal/event/keys/keys.go new file mode 100644 index 0000000000..a02206e301 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/event/keys/keys.go @@ -0,0 +1,564 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package keys + +import ( + "fmt" + "io" + "math" + "strconv" + + "golang.org/x/tools/internal/event/label" +) + +// Value represents a key for untyped values. +type Value struct { + name string + description string +} + +// New creates a new Key for untyped values. +func New(name, description string) *Value { + return &Value{name: name, description: description} +} + +func (k *Value) Name() string { return k.name } +func (k *Value) Description() string { return k.description } + +func (k *Value) Format(w io.Writer, buf []byte, l label.Label) { + fmt.Fprint(w, k.From(l)) +} + +// Get can be used to get a label for the key from a label.Map. +func (k *Value) Get(lm label.Map) interface{} { + if t := lm.Find(k); t.Valid() { + return k.From(t) + } + return nil +} + +// From can be used to get a value from a Label. +func (k *Value) From(t label.Label) interface{} { return t.UnpackValue() } + +// Of creates a new Label with this key and the supplied value. +func (k *Value) Of(value interface{}) label.Label { return label.OfValue(k, value) } + +// Tag represents a key for tagging labels that have no value. +// These are used when the existence of the label is the entire information it +// carries, such as marking events to be of a specific kind, or from a specific +// package. +type Tag struct { + name string + description string +} + +// NewTag creates a new Key for tagging labels. +func NewTag(name, description string) *Tag { + return &Tag{name: name, description: description} +} + +func (k *Tag) Name() string { return k.name } +func (k *Tag) Description() string { return k.description } + +func (k *Tag) Format(w io.Writer, buf []byte, l label.Label) {} + +// New creates a new Label with this key. +func (k *Tag) New() label.Label { return label.OfValue(k, nil) } + +// Int represents a key +type Int struct { + name string + description string +} + +// NewInt creates a new Key for int values. +func NewInt(name, description string) *Int { + return &Int{name: name, description: description} +} + +func (k *Int) Name() string { return k.name } +func (k *Int) Description() string { return k.description } + +func (k *Int) Format(w io.Writer, buf []byte, l label.Label) { + w.Write(strconv.AppendInt(buf, int64(k.From(l)), 10)) +} + +// Of creates a new Label with this key and the supplied value. +func (k *Int) Of(v int) label.Label { return label.Of64(k, uint64(v)) } + +// Get can be used to get a label for the key from a label.Map. +func (k *Int) Get(lm label.Map) int { + if t := lm.Find(k); t.Valid() { + return k.From(t) + } + return 0 +} + +// From can be used to get a value from a Label. +func (k *Int) From(t label.Label) int { return int(t.Unpack64()) } + +// Int8 represents a key +type Int8 struct { + name string + description string +} + +// NewInt8 creates a new Key for int8 values. +func NewInt8(name, description string) *Int8 { + return &Int8{name: name, description: description} +} + +func (k *Int8) Name() string { return k.name } +func (k *Int8) Description() string { return k.description } + +func (k *Int8) Format(w io.Writer, buf []byte, l label.Label) { + w.Write(strconv.AppendInt(buf, int64(k.From(l)), 10)) +} + +// Of creates a new Label with this key and the supplied value. +func (k *Int8) Of(v int8) label.Label { return label.Of64(k, uint64(v)) } + +// Get can be used to get a label for the key from a label.Map. +func (k *Int8) Get(lm label.Map) int8 { + if t := lm.Find(k); t.Valid() { + return k.From(t) + } + return 0 +} + +// From can be used to get a value from a Label. +func (k *Int8) From(t label.Label) int8 { return int8(t.Unpack64()) } + +// Int16 represents a key +type Int16 struct { + name string + description string +} + +// NewInt16 creates a new Key for int16 values. +func NewInt16(name, description string) *Int16 { + return &Int16{name: name, description: description} +} + +func (k *Int16) Name() string { return k.name } +func (k *Int16) Description() string { return k.description } + +func (k *Int16) Format(w io.Writer, buf []byte, l label.Label) { + w.Write(strconv.AppendInt(buf, int64(k.From(l)), 10)) +} + +// Of creates a new Label with this key and the supplied value. +func (k *Int16) Of(v int16) label.Label { return label.Of64(k, uint64(v)) } + +// Get can be used to get a label for the key from a label.Map. +func (k *Int16) Get(lm label.Map) int16 { + if t := lm.Find(k); t.Valid() { + return k.From(t) + } + return 0 +} + +// From can be used to get a value from a Label. +func (k *Int16) From(t label.Label) int16 { return int16(t.Unpack64()) } + +// Int32 represents a key +type Int32 struct { + name string + description string +} + +// NewInt32 creates a new Key for int32 values. +func NewInt32(name, description string) *Int32 { + return &Int32{name: name, description: description} +} + +func (k *Int32) Name() string { return k.name } +func (k *Int32) Description() string { return k.description } + +func (k *Int32) Format(w io.Writer, buf []byte, l label.Label) { + w.Write(strconv.AppendInt(buf, int64(k.From(l)), 10)) +} + +// Of creates a new Label with this key and the supplied value. +func (k *Int32) Of(v int32) label.Label { return label.Of64(k, uint64(v)) } + +// Get can be used to get a label for the key from a label.Map. +func (k *Int32) Get(lm label.Map) int32 { + if t := lm.Find(k); t.Valid() { + return k.From(t) + } + return 0 +} + +// From can be used to get a value from a Label. +func (k *Int32) From(t label.Label) int32 { return int32(t.Unpack64()) } + +// Int64 represents a key +type Int64 struct { + name string + description string +} + +// NewInt64 creates a new Key for int64 values. +func NewInt64(name, description string) *Int64 { + return &Int64{name: name, description: description} +} + +func (k *Int64) Name() string { return k.name } +func (k *Int64) Description() string { return k.description } + +func (k *Int64) Format(w io.Writer, buf []byte, l label.Label) { + w.Write(strconv.AppendInt(buf, k.From(l), 10)) +} + +// Of creates a new Label with this key and the supplied value. +func (k *Int64) Of(v int64) label.Label { return label.Of64(k, uint64(v)) } + +// Get can be used to get a label for the key from a label.Map. +func (k *Int64) Get(lm label.Map) int64 { + if t := lm.Find(k); t.Valid() { + return k.From(t) + } + return 0 +} + +// From can be used to get a value from a Label. +func (k *Int64) From(t label.Label) int64 { return int64(t.Unpack64()) } + +// UInt represents a key +type UInt struct { + name string + description string +} + +// NewUInt creates a new Key for uint values. +func NewUInt(name, description string) *UInt { + return &UInt{name: name, description: description} +} + +func (k *UInt) Name() string { return k.name } +func (k *UInt) Description() string { return k.description } + +func (k *UInt) Format(w io.Writer, buf []byte, l label.Label) { + w.Write(strconv.AppendUint(buf, uint64(k.From(l)), 10)) +} + +// Of creates a new Label with this key and the supplied value. +func (k *UInt) Of(v uint) label.Label { return label.Of64(k, uint64(v)) } + +// Get can be used to get a label for the key from a label.Map. +func (k *UInt) Get(lm label.Map) uint { + if t := lm.Find(k); t.Valid() { + return k.From(t) + } + return 0 +} + +// From can be used to get a value from a Label. +func (k *UInt) From(t label.Label) uint { return uint(t.Unpack64()) } + +// UInt8 represents a key +type UInt8 struct { + name string + description string +} + +// NewUInt8 creates a new Key for uint8 values. +func NewUInt8(name, description string) *UInt8 { + return &UInt8{name: name, description: description} +} + +func (k *UInt8) Name() string { return k.name } +func (k *UInt8) Description() string { return k.description } + +func (k *UInt8) Format(w io.Writer, buf []byte, l label.Label) { + w.Write(strconv.AppendUint(buf, uint64(k.From(l)), 10)) +} + +// Of creates a new Label with this key and the supplied value. +func (k *UInt8) Of(v uint8) label.Label { return label.Of64(k, uint64(v)) } + +// Get can be used to get a label for the key from a label.Map. +func (k *UInt8) Get(lm label.Map) uint8 { + if t := lm.Find(k); t.Valid() { + return k.From(t) + } + return 0 +} + +// From can be used to get a value from a Label. +func (k *UInt8) From(t label.Label) uint8 { return uint8(t.Unpack64()) } + +// UInt16 represents a key +type UInt16 struct { + name string + description string +} + +// NewUInt16 creates a new Key for uint16 values. +func NewUInt16(name, description string) *UInt16 { + return &UInt16{name: name, description: description} +} + +func (k *UInt16) Name() string { return k.name } +func (k *UInt16) Description() string { return k.description } + +func (k *UInt16) Format(w io.Writer, buf []byte, l label.Label) { + w.Write(strconv.AppendUint(buf, uint64(k.From(l)), 10)) +} + +// Of creates a new Label with this key and the supplied value. +func (k *UInt16) Of(v uint16) label.Label { return label.Of64(k, uint64(v)) } + +// Get can be used to get a label for the key from a label.Map. +func (k *UInt16) Get(lm label.Map) uint16 { + if t := lm.Find(k); t.Valid() { + return k.From(t) + } + return 0 +} + +// From can be used to get a value from a Label. +func (k *UInt16) From(t label.Label) uint16 { return uint16(t.Unpack64()) } + +// UInt32 represents a key +type UInt32 struct { + name string + description string +} + +// NewUInt32 creates a new Key for uint32 values. +func NewUInt32(name, description string) *UInt32 { + return &UInt32{name: name, description: description} +} + +func (k *UInt32) Name() string { return k.name } +func (k *UInt32) Description() string { return k.description } + +func (k *UInt32) Format(w io.Writer, buf []byte, l label.Label) { + w.Write(strconv.AppendUint(buf, uint64(k.From(l)), 10)) +} + +// Of creates a new Label with this key and the supplied value. +func (k *UInt32) Of(v uint32) label.Label { return label.Of64(k, uint64(v)) } + +// Get can be used to get a label for the key from a label.Map. +func (k *UInt32) Get(lm label.Map) uint32 { + if t := lm.Find(k); t.Valid() { + return k.From(t) + } + return 0 +} + +// From can be used to get a value from a Label. +func (k *UInt32) From(t label.Label) uint32 { return uint32(t.Unpack64()) } + +// UInt64 represents a key +type UInt64 struct { + name string + description string +} + +// NewUInt64 creates a new Key for uint64 values. +func NewUInt64(name, description string) *UInt64 { + return &UInt64{name: name, description: description} +} + +func (k *UInt64) Name() string { return k.name } +func (k *UInt64) Description() string { return k.description } + +func (k *UInt64) Format(w io.Writer, buf []byte, l label.Label) { + w.Write(strconv.AppendUint(buf, k.From(l), 10)) +} + +// Of creates a new Label with this key and the supplied value. +func (k *UInt64) Of(v uint64) label.Label { return label.Of64(k, v) } + +// Get can be used to get a label for the key from a label.Map. +func (k *UInt64) Get(lm label.Map) uint64 { + if t := lm.Find(k); t.Valid() { + return k.From(t) + } + return 0 +} + +// From can be used to get a value from a Label. +func (k *UInt64) From(t label.Label) uint64 { return t.Unpack64() } + +// Float32 represents a key +type Float32 struct { + name string + description string +} + +// NewFloat32 creates a new Key for float32 values. +func NewFloat32(name, description string) *Float32 { + return &Float32{name: name, description: description} +} + +func (k *Float32) Name() string { return k.name } +func (k *Float32) Description() string { return k.description } + +func (k *Float32) Format(w io.Writer, buf []byte, l label.Label) { + w.Write(strconv.AppendFloat(buf, float64(k.From(l)), 'E', -1, 32)) +} + +// Of creates a new Label with this key and the supplied value. +func (k *Float32) Of(v float32) label.Label { + return label.Of64(k, uint64(math.Float32bits(v))) +} + +// Get can be used to get a label for the key from a label.Map. +func (k *Float32) Get(lm label.Map) float32 { + if t := lm.Find(k); t.Valid() { + return k.From(t) + } + return 0 +} + +// From can be used to get a value from a Label. +func (k *Float32) From(t label.Label) float32 { + return math.Float32frombits(uint32(t.Unpack64())) +} + +// Float64 represents a key +type Float64 struct { + name string + description string +} + +// NewFloat64 creates a new Key for int64 values. +func NewFloat64(name, description string) *Float64 { + return &Float64{name: name, description: description} +} + +func (k *Float64) Name() string { return k.name } +func (k *Float64) Description() string { return k.description } + +func (k *Float64) Format(w io.Writer, buf []byte, l label.Label) { + w.Write(strconv.AppendFloat(buf, k.From(l), 'E', -1, 64)) +} + +// Of creates a new Label with this key and the supplied value. +func (k *Float64) Of(v float64) label.Label { + return label.Of64(k, math.Float64bits(v)) +} + +// Get can be used to get a label for the key from a label.Map. +func (k *Float64) Get(lm label.Map) float64 { + if t := lm.Find(k); t.Valid() { + return k.From(t) + } + return 0 +} + +// From can be used to get a value from a Label. +func (k *Float64) From(t label.Label) float64 { + return math.Float64frombits(t.Unpack64()) +} + +// String represents a key +type String struct { + name string + description string +} + +// NewString creates a new Key for int64 values. +func NewString(name, description string) *String { + return &String{name: name, description: description} +} + +func (k *String) Name() string { return k.name } +func (k *String) Description() string { return k.description } + +func (k *String) Format(w io.Writer, buf []byte, l label.Label) { + w.Write(strconv.AppendQuote(buf, k.From(l))) +} + +// Of creates a new Label with this key and the supplied value. +func (k *String) Of(v string) label.Label { return label.OfString(k, v) } + +// Get can be used to get a label for the key from a label.Map. +func (k *String) Get(lm label.Map) string { + if t := lm.Find(k); t.Valid() { + return k.From(t) + } + return "" +} + +// From can be used to get a value from a Label. +func (k *String) From(t label.Label) string { return t.UnpackString() } + +// Boolean represents a key +type Boolean struct { + name string + description string +} + +// NewBoolean creates a new Key for bool values. +func NewBoolean(name, description string) *Boolean { + return &Boolean{name: name, description: description} +} + +func (k *Boolean) Name() string { return k.name } +func (k *Boolean) Description() string { return k.description } + +func (k *Boolean) Format(w io.Writer, buf []byte, l label.Label) { + w.Write(strconv.AppendBool(buf, k.From(l))) +} + +// Of creates a new Label with this key and the supplied value. +func (k *Boolean) Of(v bool) label.Label { + if v { + return label.Of64(k, 1) + } + return label.Of64(k, 0) +} + +// Get can be used to get a label for the key from a label.Map. +func (k *Boolean) Get(lm label.Map) bool { + if t := lm.Find(k); t.Valid() { + return k.From(t) + } + return false +} + +// From can be used to get a value from a Label. +func (k *Boolean) From(t label.Label) bool { return t.Unpack64() > 0 } + +// Error represents a key +type Error struct { + name string + description string +} + +// NewError creates a new Key for int64 values. +func NewError(name, description string) *Error { + return &Error{name: name, description: description} +} + +func (k *Error) Name() string { return k.name } +func (k *Error) Description() string { return k.description } + +func (k *Error) Format(w io.Writer, buf []byte, l label.Label) { + io.WriteString(w, k.From(l).Error()) +} + +// Of creates a new Label with this key and the supplied value. +func (k *Error) Of(v error) label.Label { return label.OfValue(k, v) } + +// Get can be used to get a label for the key from a label.Map. +func (k *Error) Get(lm label.Map) error { + if t := lm.Find(k); t.Valid() { + return k.From(t) + } + return nil +} + +// From can be used to get a value from a Label. +func (k *Error) From(t label.Label) error { + err, _ := t.UnpackValue().(error) + return err +} diff --git a/vendor/golang.org/x/tools/internal/event/keys/standard.go b/vendor/golang.org/x/tools/internal/event/keys/standard.go new file mode 100644 index 0000000000..7e95866592 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/event/keys/standard.go @@ -0,0 +1,22 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package keys + +var ( + // Msg is a key used to add message strings to label lists. + Msg = NewString("message", "a readable message") + // Label is a key used to indicate an event adds labels to the context. + Label = NewTag("label", "a label context marker") + // Start is used for things like traces that have a name. + Start = NewString("start", "span start") + // Metric is a key used to indicate an event records metrics. + End = NewTag("end", "a span end marker") + // Metric is a key used to indicate an event records metrics. + Detach = NewTag("detach", "a span detach marker") + // Err is a key used to add error values to label lists. + Err = NewError("error", "an error that occurred") + // Metric is a key used to indicate an event records metrics. + Metric = NewTag("metric", "a metric event marker") +) diff --git a/vendor/golang.org/x/tools/internal/event/label/label.go b/vendor/golang.org/x/tools/internal/event/label/label.go new file mode 100644 index 0000000000..b55c12eb25 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/event/label/label.go @@ -0,0 +1,213 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package label + +import ( + "fmt" + "io" + "reflect" + "unsafe" +) + +// Key is used as the identity of a Label. +// Keys are intended to be compared by pointer only, the name should be unique +// for communicating with external systems, but it is not required or enforced. +type Key interface { + // Name returns the key name. + Name() string + // Description returns a string that can be used to describe the value. + Description() string + + // Format is used in formatting to append the value of the label to the + // supplied buffer. + // The formatter may use the supplied buf as a scratch area to avoid + // allocations. + Format(w io.Writer, buf []byte, l Label) +} + +// Label holds a key and value pair. +// It is normally used when passing around lists of labels. +type Label struct { + key Key + packed uint64 + untyped interface{} +} + +// Map is the interface to a collection of Labels indexed by key. +type Map interface { + // Find returns the label that matches the supplied key. + Find(key Key) Label +} + +// List is the interface to something that provides an iterable +// list of labels. +// Iteration should start from 0 and continue until Valid returns false. +type List interface { + // Valid returns true if the index is within range for the list. + // It does not imply the label at that index will itself be valid. + Valid(index int) bool + // Label returns the label at the given index. + Label(index int) Label +} + +// list implements LabelList for a list of Labels. +type list struct { + labels []Label +} + +// filter wraps a LabelList filtering out specific labels. +type filter struct { + keys []Key + underlying List +} + +// listMap implements LabelMap for a simple list of labels. +type listMap struct { + labels []Label +} + +// mapChain implements LabelMap for a list of underlying LabelMap. +type mapChain struct { + maps []Map +} + +// OfValue creates a new label from the key and value. +// This method is for implementing new key types, label creation should +// normally be done with the Of method of the key. +func OfValue(k Key, value interface{}) Label { return Label{key: k, untyped: value} } + +// UnpackValue assumes the label was built using LabelOfValue and returns the value +// that was passed to that constructor. +// This method is for implementing new key types, for type safety normal +// access should be done with the From method of the key. +func (t Label) UnpackValue() interface{} { return t.untyped } + +// Of64 creates a new label from a key and a uint64. This is often +// used for non uint64 values that can be packed into a uint64. +// This method is for implementing new key types, label creation should +// normally be done with the Of method of the key. +func Of64(k Key, v uint64) Label { return Label{key: k, packed: v} } + +// Unpack64 assumes the label was built using LabelOf64 and returns the value that +// was passed to that constructor. +// This method is for implementing new key types, for type safety normal +// access should be done with the From method of the key. +func (t Label) Unpack64() uint64 { return t.packed } + +// OfString creates a new label from a key and a string. +// This method is for implementing new key types, label creation should +// normally be done with the Of method of the key. +func OfString(k Key, v string) Label { + hdr := (*reflect.StringHeader)(unsafe.Pointer(&v)) + return Label{ + key: k, + packed: uint64(hdr.Len), + untyped: unsafe.Pointer(hdr.Data), + } +} + +// UnpackString assumes the label was built using LabelOfString and returns the +// value that was passed to that constructor. +// This method is for implementing new key types, for type safety normal +// access should be done with the From method of the key. +func (t Label) UnpackString() string { + var v string + hdr := (*reflect.StringHeader)(unsafe.Pointer(&v)) + hdr.Data = uintptr(t.untyped.(unsafe.Pointer)) + hdr.Len = int(t.packed) + return *(*string)(unsafe.Pointer(hdr)) +} + +// Valid returns true if the Label is a valid one (it has a key). +func (t Label) Valid() bool { return t.key != nil } + +// Key returns the key of this Label. +func (t Label) Key() Key { return t.key } + +// Format is used for debug printing of labels. +func (t Label) Format(f fmt.State, r rune) { + if !t.Valid() { + io.WriteString(f, `nil`) + return + } + io.WriteString(f, t.Key().Name()) + io.WriteString(f, "=") + var buf [128]byte + t.Key().Format(f, buf[:0], t) +} + +func (l *list) Valid(index int) bool { + return index >= 0 && index < len(l.labels) +} + +func (l *list) Label(index int) Label { + return l.labels[index] +} + +func (f *filter) Valid(index int) bool { + return f.underlying.Valid(index) +} + +func (f *filter) Label(index int) Label { + l := f.underlying.Label(index) + for _, f := range f.keys { + if l.Key() == f { + return Label{} + } + } + return l +} + +func (lm listMap) Find(key Key) Label { + for _, l := range lm.labels { + if l.Key() == key { + return l + } + } + return Label{} +} + +func (c mapChain) Find(key Key) Label { + for _, src := range c.maps { + l := src.Find(key) + if l.Valid() { + return l + } + } + return Label{} +} + +var emptyList = &list{} + +func NewList(labels ...Label) List { + if len(labels) == 0 { + return emptyList + } + return &list{labels: labels} +} + +func Filter(l List, keys ...Key) List { + if len(keys) == 0 { + return l + } + return &filter{keys: keys, underlying: l} +} + +func NewMap(labels ...Label) Map { + return listMap{labels: labels} +} + +func MergeMaps(srcs ...Map) Map { + var nonNil []Map + for _, src := range srcs { + if src != nil { + nonNil = append(nonNil, src) + } + } + if len(nonNil) == 1 { + return nonNil[0] + } + return mapChain{maps: nonNil} +} diff --git a/vendor/golang.org/x/tools/internal/gocommand/invoke.go b/vendor/golang.org/x/tools/internal/gocommand/invoke.go new file mode 100644 index 0000000000..8659a0c5da --- /dev/null +++ b/vendor/golang.org/x/tools/internal/gocommand/invoke.go @@ -0,0 +1,273 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package gocommand is a helper for calling the go command. +package gocommand + +import ( + "bytes" + "context" + "fmt" + exec "golang.org/x/sys/execabs" + "io" + "os" + "regexp" + "strconv" + "strings" + "sync" + "time" + + "golang.org/x/tools/internal/event" +) + +// An Runner will run go command invocations and serialize +// them if it sees a concurrency error. +type Runner struct { + // once guards the runner initialization. + once sync.Once + + // inFlight tracks available workers. + inFlight chan struct{} + + // serialized guards the ability to run a go command serially, + // to avoid deadlocks when claiming workers. + serialized chan struct{} +} + +const maxInFlight = 10 + +func (runner *Runner) initialize() { + runner.once.Do(func() { + runner.inFlight = make(chan struct{}, maxInFlight) + runner.serialized = make(chan struct{}, 1) + }) +} + +// 1.13: go: updates to go.mod needed, but contents have changed +// 1.14: go: updating go.mod: existing contents have changed since last read +var modConcurrencyError = regexp.MustCompile(`go:.*go.mod.*contents have changed`) + +// Run is a convenience wrapper around RunRaw. +// It returns only stdout and a "friendly" error. +func (runner *Runner) Run(ctx context.Context, inv Invocation) (*bytes.Buffer, error) { + stdout, _, friendly, _ := runner.RunRaw(ctx, inv) + return stdout, friendly +} + +// RunPiped runs the invocation serially, always waiting for any concurrent +// invocations to complete first. +func (runner *Runner) RunPiped(ctx context.Context, inv Invocation, stdout, stderr io.Writer) error { + _, err := runner.runPiped(ctx, inv, stdout, stderr) + return err +} + +// RunRaw runs the invocation, serializing requests only if they fight over +// go.mod changes. +func (runner *Runner) RunRaw(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error) { + // Make sure the runner is always initialized. + runner.initialize() + + // First, try to run the go command concurrently. + stdout, stderr, friendlyErr, err := runner.runConcurrent(ctx, inv) + + // If we encounter a load concurrency error, we need to retry serially. + if friendlyErr == nil || !modConcurrencyError.MatchString(friendlyErr.Error()) { + return stdout, stderr, friendlyErr, err + } + event.Error(ctx, "Load concurrency error, will retry serially", err) + + // Run serially by calling runPiped. + stdout.Reset() + stderr.Reset() + friendlyErr, err = runner.runPiped(ctx, inv, stdout, stderr) + return stdout, stderr, friendlyErr, err +} + +func (runner *Runner) runConcurrent(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error) { + // Wait for 1 worker to become available. + select { + case <-ctx.Done(): + return nil, nil, nil, ctx.Err() + case runner.inFlight <- struct{}{}: + defer func() { <-runner.inFlight }() + } + + stdout, stderr := &bytes.Buffer{}, &bytes.Buffer{} + friendlyErr, err := inv.runWithFriendlyError(ctx, stdout, stderr) + return stdout, stderr, friendlyErr, err +} + +func (runner *Runner) runPiped(ctx context.Context, inv Invocation, stdout, stderr io.Writer) (error, error) { + // Make sure the runner is always initialized. + runner.initialize() + + // Acquire the serialization lock. This avoids deadlocks between two + // runPiped commands. + select { + case <-ctx.Done(): + return nil, ctx.Err() + case runner.serialized <- struct{}{}: + defer func() { <-runner.serialized }() + } + + // Wait for all in-progress go commands to return before proceeding, + // to avoid load concurrency errors. + for i := 0; i < maxInFlight; i++ { + select { + case <-ctx.Done(): + return nil, ctx.Err() + case runner.inFlight <- struct{}{}: + // Make sure we always "return" any workers we took. + defer func() { <-runner.inFlight }() + } + } + + return inv.runWithFriendlyError(ctx, stdout, stderr) +} + +// An Invocation represents a call to the go command. +type Invocation struct { + Verb string + Args []string + BuildFlags []string + ModFlag string + ModFile string + Overlay string + // If CleanEnv is set, the invocation will run only with the environment + // in Env, not starting with os.Environ. + CleanEnv bool + Env []string + WorkingDir string + Logf func(format string, args ...interface{}) +} + +func (i *Invocation) runWithFriendlyError(ctx context.Context, stdout, stderr io.Writer) (friendlyError error, rawError error) { + rawError = i.run(ctx, stdout, stderr) + if rawError != nil { + friendlyError = rawError + // Check for 'go' executable not being found. + if ee, ok := rawError.(*exec.Error); ok && ee.Err == exec.ErrNotFound { + friendlyError = fmt.Errorf("go command required, not found: %v", ee) + } + if ctx.Err() != nil { + friendlyError = ctx.Err() + } + friendlyError = fmt.Errorf("err: %v: stderr: %s", friendlyError, stderr) + } + return +} + +func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error { + log := i.Logf + if log == nil { + log = func(string, ...interface{}) {} + } + + goArgs := []string{i.Verb} + + appendModFile := func() { + if i.ModFile != "" { + goArgs = append(goArgs, "-modfile="+i.ModFile) + } + } + appendModFlag := func() { + if i.ModFlag != "" { + goArgs = append(goArgs, "-mod="+i.ModFlag) + } + } + appendOverlayFlag := func() { + if i.Overlay != "" { + goArgs = append(goArgs, "-overlay="+i.Overlay) + } + } + + switch i.Verb { + case "env", "version": + goArgs = append(goArgs, i.Args...) + case "mod": + // mod needs the sub-verb before flags. + goArgs = append(goArgs, i.Args[0]) + appendModFile() + goArgs = append(goArgs, i.Args[1:]...) + case "get": + goArgs = append(goArgs, i.BuildFlags...) + appendModFile() + goArgs = append(goArgs, i.Args...) + + default: // notably list and build. + goArgs = append(goArgs, i.BuildFlags...) + appendModFile() + appendModFlag() + appendOverlayFlag() + goArgs = append(goArgs, i.Args...) + } + cmd := exec.Command("go", goArgs...) + cmd.Stdout = stdout + cmd.Stderr = stderr + // On darwin the cwd gets resolved to the real path, which breaks anything that + // expects the working directory to keep the original path, including the + // go command when dealing with modules. + // The Go stdlib has a special feature where if the cwd and the PWD are the + // same node then it trusts the PWD, so by setting it in the env for the child + // process we fix up all the paths returned by the go command. + if !i.CleanEnv { + cmd.Env = os.Environ() + } + cmd.Env = append(cmd.Env, i.Env...) + if i.WorkingDir != "" { + cmd.Env = append(cmd.Env, "PWD="+i.WorkingDir) + cmd.Dir = i.WorkingDir + } + defer func(start time.Time) { log("%s for %v", time.Since(start), cmdDebugStr(cmd)) }(time.Now()) + + return runCmdContext(ctx, cmd) +} + +// runCmdContext is like exec.CommandContext except it sends os.Interrupt +// before os.Kill. +func runCmdContext(ctx context.Context, cmd *exec.Cmd) error { + if err := cmd.Start(); err != nil { + return err + } + resChan := make(chan error, 1) + go func() { + resChan <- cmd.Wait() + }() + + select { + case err := <-resChan: + return err + case <-ctx.Done(): + } + // Cancelled. Interrupt and see if it ends voluntarily. + cmd.Process.Signal(os.Interrupt) + select { + case err := <-resChan: + return err + case <-time.After(time.Second): + } + // Didn't shut down in response to interrupt. Kill it hard. + cmd.Process.Kill() + return <-resChan +} + +func cmdDebugStr(cmd *exec.Cmd) string { + env := make(map[string]string) + for _, kv := range cmd.Env { + split := strings.SplitN(kv, "=", 2) + k, v := split[0], split[1] + env[k] = v + } + + var args []string + for _, arg := range cmd.Args { + quoted := strconv.Quote(arg) + if quoted[1:len(quoted)-1] != arg || strings.Contains(arg, " ") { + args = append(args, quoted) + } else { + args = append(args, arg) + } + } + return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], strings.Join(args, " ")) +} diff --git a/vendor/golang.org/x/tools/internal/gocommand/vendor.go b/vendor/golang.org/x/tools/internal/gocommand/vendor.go new file mode 100644 index 0000000000..1cd8d8473e --- /dev/null +++ b/vendor/golang.org/x/tools/internal/gocommand/vendor.go @@ -0,0 +1,102 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gocommand + +import ( + "bytes" + "context" + "fmt" + "os" + "path/filepath" + "regexp" + "strings" + + "golang.org/x/mod/semver" +) + +// ModuleJSON holds information about a module. +type ModuleJSON struct { + Path string // module path + Replace *ModuleJSON // replaced by this module + Main bool // is this the main module? + Indirect bool // is this module only an indirect dependency of main module? + Dir string // directory holding files for this module, if any + GoMod string // path to go.mod file for this module, if any + GoVersion string // go version used in module +} + +var modFlagRegexp = regexp.MustCompile(`-mod[ =](\w+)`) + +// VendorEnabled reports whether vendoring is enabled. It takes a *Runner to execute Go commands +// with the supplied context.Context and Invocation. The Invocation can contain pre-defined fields, +// of which only Verb and Args are modified to run the appropriate Go command. +// Inspired by setDefaultBuildMod in modload/init.go +func VendorEnabled(ctx context.Context, inv Invocation, r *Runner) (*ModuleJSON, bool, error) { + mainMod, go114, err := getMainModuleAnd114(ctx, inv, r) + if err != nil { + return nil, false, err + } + + // We check the GOFLAGS to see if there is anything overridden or not. + inv.Verb = "env" + inv.Args = []string{"GOFLAGS"} + stdout, err := r.Run(ctx, inv) + if err != nil { + return nil, false, err + } + goflags := string(bytes.TrimSpace(stdout.Bytes())) + matches := modFlagRegexp.FindStringSubmatch(goflags) + var modFlag string + if len(matches) != 0 { + modFlag = matches[1] + } + if modFlag != "" { + // Don't override an explicit '-mod=' argument. + return mainMod, modFlag == "vendor", nil + } + if mainMod == nil || !go114 { + return mainMod, false, nil + } + // Check 1.14's automatic vendor mode. + if fi, err := os.Stat(filepath.Join(mainMod.Dir, "vendor")); err == nil && fi.IsDir() { + if mainMod.GoVersion != "" && semver.Compare("v"+mainMod.GoVersion, "v1.14") >= 0 { + // The Go version is at least 1.14, and a vendor directory exists. + // Set -mod=vendor by default. + return mainMod, true, nil + } + } + return mainMod, false, nil +} + +// getMainModuleAnd114 gets the main module's information and whether the +// go command in use is 1.14+. This is the information needed to figure out +// if vendoring should be enabled. +func getMainModuleAnd114(ctx context.Context, inv Invocation, r *Runner) (*ModuleJSON, bool, error) { + const format = `{{.Path}} +{{.Dir}} +{{.GoMod}} +{{.GoVersion}} +{{range context.ReleaseTags}}{{if eq . "go1.14"}}{{.}}{{end}}{{end}} +` + inv.Verb = "list" + inv.Args = []string{"-m", "-f", format} + stdout, err := r.Run(ctx, inv) + if err != nil { + return nil, false, err + } + + lines := strings.Split(stdout.String(), "\n") + if len(lines) < 5 { + return nil, false, fmt.Errorf("unexpected stdout: %q", stdout.String()) + } + mod := &ModuleJSON{ + Path: lines[0], + Dir: lines[1], + GoMod: lines[2], + GoVersion: lines[3], + Main: true, + } + return mod, lines[4] == "go1.14", nil +} diff --git a/vendor/golang.org/x/tools/internal/gocommand/version.go b/vendor/golang.org/x/tools/internal/gocommand/version.go new file mode 100644 index 0000000000..0cebac6e66 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/gocommand/version.go @@ -0,0 +1,51 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gocommand + +import ( + "context" + "fmt" + "strings" +) + +// GoVersion checks the go version by running "go list" with modules off. +// It returns the X in Go 1.X. +func GoVersion(ctx context.Context, inv Invocation, r *Runner) (int, error) { + inv.Verb = "list" + inv.Args = []string{"-e", "-f", `{{context.ReleaseTags}}`} + inv.Env = append(append([]string{}, inv.Env...), "GO111MODULE=off") + // Unset any unneeded flags, and remove them from BuildFlags, if they're + // present. + inv.ModFile = "" + inv.ModFlag = "" + var buildFlags []string + for _, flag := range inv.BuildFlags { + // Flags can be prefixed by one or two dashes. + f := strings.TrimPrefix(strings.TrimPrefix(flag, "-"), "-") + if strings.HasPrefix(f, "mod=") || strings.HasPrefix(f, "modfile=") { + continue + } + buildFlags = append(buildFlags, flag) + } + inv.BuildFlags = buildFlags + stdoutBytes, err := r.Run(ctx, inv) + if err != nil { + return 0, err + } + stdout := stdoutBytes.String() + if len(stdout) < 3 { + return 0, fmt.Errorf("bad ReleaseTags output: %q", stdout) + } + // Split up "[go1.1 go1.15]" + tags := strings.Fields(stdout[1 : len(stdout)-2]) + for i := len(tags) - 1; i >= 0; i-- { + var version int + if _, err := fmt.Sscanf(tags[i], "go1.%d", &version); err != nil { + continue + } + return version, nil + } + return 0, fmt.Errorf("no parseable ReleaseTags in %v", tags) +} diff --git a/vendor/golang.org/x/tools/internal/packagesinternal/packages.go b/vendor/golang.org/x/tools/internal/packagesinternal/packages.go new file mode 100644 index 0000000000..d4ec6f9715 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/packagesinternal/packages.go @@ -0,0 +1,21 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package packagesinternal exposes internal-only fields from go/packages. +package packagesinternal + +import ( + "golang.org/x/tools/internal/gocommand" +) + +var GetForTest = func(p interface{}) string { return "" } + +var GetGoCmdRunner = func(config interface{}) *gocommand.Runner { return nil } + +var SetGoCmdRunner = func(config interface{}, runner *gocommand.Runner) {} + +var TypecheckCgo int + +var SetModFlag = func(config interface{}, value string) {} +var SetModFile = func(config interface{}, value string) {} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go b/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go new file mode 100644 index 0000000000..65473eb226 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go @@ -0,0 +1,1358 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package typesinternal + +//go:generate stringer -type=ErrorCode + +type ErrorCode int + +// This file defines the error codes that can be produced during type-checking. +// Collectively, these codes provide an identifier that may be used to +// implement special handling for certain types of errors. +// +// Error codes should be fine-grained enough that the exact nature of the error +// can be easily determined, but coarse enough that they are not an +// implementation detail of the type checking algorithm. As a rule-of-thumb, +// errors should be considered equivalent if there is a theoretical refactoring +// of the type checker in which they are emitted in exactly one place. For +// example, the type checker emits different error messages for "too many +// arguments" and "too few arguments", but one can imagine an alternative type +// checker where this check instead just emits a single "wrong number of +// arguments", so these errors should have the same code. +// +// Error code names should be as brief as possible while retaining accuracy and +// distinctiveness. In most cases names should start with an adjective +// describing the nature of the error (e.g. "invalid", "unused", "misplaced"), +// and end with a noun identifying the relevant language object. For example, +// "DuplicateDecl" or "InvalidSliceExpr". For brevity, naming follows the +// convention that "bad" implies a problem with syntax, and "invalid" implies a +// problem with types. + +const ( + _ ErrorCode = iota + + // Test is reserved for errors that only apply while in self-test mode. + Test + + /* package names */ + + // BlankPkgName occurs when a package name is the blank identifier "_". + // + // Per the spec: + // "The PackageName must not be the blank identifier." + BlankPkgName + + // MismatchedPkgName occurs when a file's package name doesn't match the + // package name already established by other files. + MismatchedPkgName + + // InvalidPkgUse occurs when a package identifier is used outside of a + // selector expression. + // + // Example: + // import "fmt" + // + // var _ = fmt + InvalidPkgUse + + /* imports */ + + // BadImportPath occurs when an import path is not valid. + BadImportPath + + // BrokenImport occurs when importing a package fails. + // + // Example: + // import "amissingpackage" + BrokenImport + + // ImportCRenamed occurs when the special import "C" is renamed. "C" is a + // pseudo-package, and must not be renamed. + // + // Example: + // import _ "C" + ImportCRenamed + + // UnusedImport occurs when an import is unused. + // + // Example: + // import "fmt" + // + // func main() {} + UnusedImport + + /* initialization */ + + // InvalidInitCycle occurs when an invalid cycle is detected within the + // initialization graph. + // + // Example: + // var x int = f() + // + // func f() int { return x } + InvalidInitCycle + + /* decls */ + + // DuplicateDecl occurs when an identifier is declared multiple times. + // + // Example: + // var x = 1 + // var x = 2 + DuplicateDecl + + // InvalidDeclCycle occurs when a declaration cycle is not valid. + // + // Example: + // import "unsafe" + // + // type T struct { + // a [n]int + // } + // + // var n = unsafe.Sizeof(T{}) + InvalidDeclCycle + + // InvalidTypeCycle occurs when a cycle in type definitions results in a + // type that is not well-defined. + // + // Example: + // import "unsafe" + // + // type T [unsafe.Sizeof(T{})]int + InvalidTypeCycle + + /* decls > const */ + + // InvalidConstInit occurs when a const declaration has a non-constant + // initializer. + // + // Example: + // var x int + // const _ = x + InvalidConstInit + + // InvalidConstVal occurs when a const value cannot be converted to its + // target type. + // + // TODO(findleyr): this error code and example are not very clear. Consider + // removing it. + // + // Example: + // const _ = 1 << "hello" + InvalidConstVal + + // InvalidConstType occurs when the underlying type in a const declaration + // is not a valid constant type. + // + // Example: + // const c *int = 4 + InvalidConstType + + /* decls > var (+ other variable assignment codes) */ + + // UntypedNil occurs when the predeclared (untyped) value nil is used to + // initialize a variable declared without an explicit type. + // + // Example: + // var x = nil + UntypedNil + + // WrongAssignCount occurs when the number of values on the right-hand side + // of an assignment or or initialization expression does not match the number + // of variables on the left-hand side. + // + // Example: + // var x = 1, 2 + WrongAssignCount + + // UnassignableOperand occurs when the left-hand side of an assignment is + // not assignable. + // + // Example: + // func f() { + // const c = 1 + // c = 2 + // } + UnassignableOperand + + // NoNewVar occurs when a short variable declaration (':=') does not declare + // new variables. + // + // Example: + // func f() { + // x := 1 + // x := 2 + // } + NoNewVar + + // MultiValAssignOp occurs when an assignment operation (+=, *=, etc) does + // not have single-valued left-hand or right-hand side. + // + // Per the spec: + // "In assignment operations, both the left- and right-hand expression lists + // must contain exactly one single-valued expression" + // + // Example: + // func f() int { + // x, y := 1, 2 + // x, y += 1 + // return x + y + // } + MultiValAssignOp + + // InvalidIfaceAssign occurs when a value of type T is used as an + // interface, but T does not implement a method of the expected interface. + // + // Example: + // type I interface { + // f() + // } + // + // type T int + // + // var x I = T(1) + InvalidIfaceAssign + + // InvalidChanAssign occurs when a chan assignment is invalid. + // + // Per the spec, a value x is assignable to a channel type T if: + // "x is a bidirectional channel value, T is a channel type, x's type V and + // T have identical element types, and at least one of V or T is not a + // defined type." + // + // Example: + // type T1 chan int + // type T2 chan int + // + // var x T1 + // // Invalid assignment because both types are named + // var _ T2 = x + InvalidChanAssign + + // IncompatibleAssign occurs when the type of the right-hand side expression + // in an assignment cannot be assigned to the type of the variable being + // assigned. + // + // Example: + // var x []int + // var _ int = x + IncompatibleAssign + + // UnaddressableFieldAssign occurs when trying to assign to a struct field + // in a map value. + // + // Example: + // func f() { + // m := make(map[string]struct{i int}) + // m["foo"].i = 42 + // } + UnaddressableFieldAssign + + /* decls > type (+ other type expression codes) */ + + // NotAType occurs when the identifier used as the underlying type in a type + // declaration or the right-hand side of a type alias does not denote a type. + // + // Example: + // var S = 2 + // + // type T S + NotAType + + // InvalidArrayLen occurs when an array length is not a constant value. + // + // Example: + // var n = 3 + // var _ = [n]int{} + InvalidArrayLen + + // BlankIfaceMethod occurs when a method name is '_'. + // + // Per the spec: + // "The name of each explicitly specified method must be unique and not + // blank." + // + // Example: + // type T interface { + // _(int) + // } + BlankIfaceMethod + + // IncomparableMapKey occurs when a map key type does not support the == and + // != operators. + // + // Per the spec: + // "The comparison operators == and != must be fully defined for operands of + // the key type; thus the key type must not be a function, map, or slice." + // + // Example: + // var x map[T]int + // + // type T []int + IncomparableMapKey + + // InvalidIfaceEmbed occurs when a non-interface type is embedded in an + // interface. + // + // Example: + // type T struct {} + // + // func (T) m() + // + // type I interface { + // T + // } + InvalidIfaceEmbed + + // InvalidPtrEmbed occurs when an embedded field is of the pointer form *T, + // and T itself is itself a pointer, an unsafe.Pointer, or an interface. + // + // Per the spec: + // "An embedded field must be specified as a type name T or as a pointer to + // a non-interface type name *T, and T itself may not be a pointer type." + // + // Example: + // type T *int + // + // type S struct { + // *T + // } + InvalidPtrEmbed + + /* decls > func and method */ + + // BadRecv occurs when a method declaration does not have exactly one + // receiver parameter. + // + // Example: + // func () _() {} + BadRecv + + // InvalidRecv occurs when a receiver type expression is not of the form T + // or *T, or T is a pointer type. + // + // Example: + // type T struct {} + // + // func (**T) m() {} + InvalidRecv + + // DuplicateFieldAndMethod occurs when an identifier appears as both a field + // and method name. + // + // Example: + // type T struct { + // m int + // } + // + // func (T) m() {} + DuplicateFieldAndMethod + + // DuplicateMethod occurs when two methods on the same receiver type have + // the same name. + // + // Example: + // type T struct {} + // func (T) m() {} + // func (T) m(i int) int { return i } + DuplicateMethod + + /* decls > special */ + + // InvalidBlank occurs when a blank identifier is used as a value or type. + // + // Per the spec: + // "The blank identifier may appear as an operand only on the left-hand side + // of an assignment." + // + // Example: + // var x = _ + InvalidBlank + + // InvalidIota occurs when the predeclared identifier iota is used outside + // of a constant declaration. + // + // Example: + // var x = iota + InvalidIota + + // MissingInitBody occurs when an init function is missing its body. + // + // Example: + // func init() + MissingInitBody + + // InvalidInitSig occurs when an init function declares parameters or + // results. + // + // Example: + // func init() int { return 1 } + InvalidInitSig + + // InvalidInitDecl occurs when init is declared as anything other than a + // function. + // + // Example: + // var init = 1 + InvalidInitDecl + + // InvalidMainDecl occurs when main is declared as anything other than a + // function, in a main package. + InvalidMainDecl + + /* exprs */ + + // TooManyValues occurs when a function returns too many values for the + // expression context in which it is used. + // + // Example: + // func ReturnTwo() (int, int) { + // return 1, 2 + // } + // + // var x = ReturnTwo() + TooManyValues + + // NotAnExpr occurs when a type expression is used where a value expression + // is expected. + // + // Example: + // type T struct {} + // + // func f() { + // T + // } + NotAnExpr + + /* exprs > const */ + + // TruncatedFloat occurs when a float constant is truncated to an integer + // value. + // + // Example: + // var _ int = 98.6 + TruncatedFloat + + // NumericOverflow occurs when a numeric constant overflows its target type. + // + // Example: + // var x int8 = 1000 + NumericOverflow + + /* exprs > operation */ + + // UndefinedOp occurs when an operator is not defined for the type(s) used + // in an operation. + // + // Example: + // var c = "a" - "b" + UndefinedOp + + // MismatchedTypes occurs when operand types are incompatible in a binary + // operation. + // + // Example: + // var a = "hello" + // var b = 1 + // var c = a - b + MismatchedTypes + + // DivByZero occurs when a division operation is provable at compile + // time to be a division by zero. + // + // Example: + // const divisor = 0 + // var x int = 1/divisor + DivByZero + + // NonNumericIncDec occurs when an increment or decrement operator is + // applied to a non-numeric value. + // + // Example: + // func f() { + // var c = "c" + // c++ + // } + NonNumericIncDec + + /* exprs > ptr */ + + // UnaddressableOperand occurs when the & operator is applied to an + // unaddressable expression. + // + // Example: + // var x = &1 + UnaddressableOperand + + // InvalidIndirection occurs when a non-pointer value is indirected via the + // '*' operator. + // + // Example: + // var x int + // var y = *x + InvalidIndirection + + /* exprs > [] */ + + // NonIndexableOperand occurs when an index operation is applied to a value + // that cannot be indexed. + // + // Example: + // var x = 1 + // var y = x[1] + NonIndexableOperand + + // InvalidIndex occurs when an index argument is not of integer type, + // negative, or out-of-bounds. + // + // Example: + // var s = [...]int{1,2,3} + // var x = s[5] + // + // Example: + // var s = []int{1,2,3} + // var _ = s[-1] + // + // Example: + // var s = []int{1,2,3} + // var i string + // var _ = s[i] + InvalidIndex + + // SwappedSliceIndices occurs when constant indices in a slice expression + // are decreasing in value. + // + // Example: + // var _ = []int{1,2,3}[2:1] + SwappedSliceIndices + + /* operators > slice */ + + // NonSliceableOperand occurs when a slice operation is applied to a value + // whose type is not sliceable, or is unaddressable. + // + // Example: + // var x = [...]int{1, 2, 3}[:1] + // + // Example: + // var x = 1 + // var y = 1[:1] + NonSliceableOperand + + // InvalidSliceExpr occurs when a three-index slice expression (a[x:y:z]) is + // applied to a string. + // + // Example: + // var s = "hello" + // var x = s[1:2:3] + InvalidSliceExpr + + /* exprs > shift */ + + // InvalidShiftCount occurs when the right-hand side of a shift operation is + // either non-integer, negative, or too large. + // + // Example: + // var ( + // x string + // y int = 1 << x + // ) + InvalidShiftCount + + // InvalidShiftOperand occurs when the shifted operand is not an integer. + // + // Example: + // var s = "hello" + // var x = s << 2 + InvalidShiftOperand + + /* exprs > chan */ + + // InvalidReceive occurs when there is a channel receive from a value that + // is either not a channel, or is a send-only channel. + // + // Example: + // func f() { + // var x = 1 + // <-x + // } + InvalidReceive + + // InvalidSend occurs when there is a channel send to a value that is not a + // channel, or is a receive-only channel. + // + // Example: + // func f() { + // var x = 1 + // x <- "hello!" + // } + InvalidSend + + /* exprs > literal */ + + // DuplicateLitKey occurs when an index is duplicated in a slice, array, or + // map literal. + // + // Example: + // var _ = []int{0:1, 0:2} + // + // Example: + // var _ = map[string]int{"a": 1, "a": 2} + DuplicateLitKey + + // MissingLitKey occurs when a map literal is missing a key expression. + // + // Example: + // var _ = map[string]int{1} + MissingLitKey + + // InvalidLitIndex occurs when the key in a key-value element of a slice or + // array literal is not an integer constant. + // + // Example: + // var i = 0 + // var x = []string{i: "world"} + InvalidLitIndex + + // OversizeArrayLit occurs when an array literal exceeds its length. + // + // Example: + // var _ = [2]int{1,2,3} + OversizeArrayLit + + // MixedStructLit occurs when a struct literal contains a mix of positional + // and named elements. + // + // Example: + // var _ = struct{i, j int}{i: 1, 2} + MixedStructLit + + // InvalidStructLit occurs when a positional struct literal has an incorrect + // number of values. + // + // Example: + // var _ = struct{i, j int}{1,2,3} + InvalidStructLit + + // MissingLitField occurs when a struct literal refers to a field that does + // not exist on the struct type. + // + // Example: + // var _ = struct{i int}{j: 2} + MissingLitField + + // DuplicateLitField occurs when a struct literal contains duplicated + // fields. + // + // Example: + // var _ = struct{i int}{i: 1, i: 2} + DuplicateLitField + + // UnexportedLitField occurs when a positional struct literal implicitly + // assigns an unexported field of an imported type. + UnexportedLitField + + // InvalidLitField occurs when a field name is not a valid identifier. + // + // Example: + // var _ = struct{i int}{1: 1} + InvalidLitField + + // UntypedLit occurs when a composite literal omits a required type + // identifier. + // + // Example: + // type outer struct{ + // inner struct { i int } + // } + // + // var _ = outer{inner: {1}} + UntypedLit + + // InvalidLit occurs when a composite literal expression does not match its + // type. + // + // Example: + // type P *struct{ + // x int + // } + // var _ = P {} + InvalidLit + + /* exprs > selector */ + + // AmbiguousSelector occurs when a selector is ambiguous. + // + // Example: + // type E1 struct { i int } + // type E2 struct { i int } + // type T struct { E1; E2 } + // + // var x T + // var _ = x.i + AmbiguousSelector + + // UndeclaredImportedName occurs when a package-qualified identifier is + // undeclared by the imported package. + // + // Example: + // import "go/types" + // + // var _ = types.NotAnActualIdentifier + UndeclaredImportedName + + // UnexportedName occurs when a selector refers to an unexported identifier + // of an imported package. + // + // Example: + // import "reflect" + // + // type _ reflect.flag + UnexportedName + + // UndeclaredName occurs when an identifier is not declared in the current + // scope. + // + // Example: + // var x T + UndeclaredName + + // MissingFieldOrMethod occurs when a selector references a field or method + // that does not exist. + // + // Example: + // type T struct {} + // + // var x = T{}.f + MissingFieldOrMethod + + /* exprs > ... */ + + // BadDotDotDotSyntax occurs when a "..." occurs in a context where it is + // not valid. + // + // Example: + // var _ = map[int][...]int{0: {}} + BadDotDotDotSyntax + + // NonVariadicDotDotDot occurs when a "..." is used on the final argument to + // a non-variadic function. + // + // Example: + // func printArgs(s []string) { + // for _, a := range s { + // println(a) + // } + // } + // + // func f() { + // s := []string{"a", "b", "c"} + // printArgs(s...) + // } + NonVariadicDotDotDot + + // MisplacedDotDotDot occurs when a "..." is used somewhere other than the + // final argument to a function call. + // + // Example: + // func printArgs(args ...int) { + // for _, a := range args { + // println(a) + // } + // } + // + // func f() { + // a := []int{1,2,3} + // printArgs(0, a...) + // } + MisplacedDotDotDot + + // InvalidDotDotDotOperand occurs when a "..." operator is applied to a + // single-valued operand. + // + // Example: + // func printArgs(args ...int) { + // for _, a := range args { + // println(a) + // } + // } + // + // func f() { + // a := 1 + // printArgs(a...) + // } + // + // Example: + // func args() (int, int) { + // return 1, 2 + // } + // + // func printArgs(args ...int) { + // for _, a := range args { + // println(a) + // } + // } + // + // func g() { + // printArgs(args()...) + // } + InvalidDotDotDotOperand + + // InvalidDotDotDot occurs when a "..." is used in a non-variadic built-in + // function. + // + // Example: + // var s = []int{1, 2, 3} + // var l = len(s...) + InvalidDotDotDot + + /* exprs > built-in */ + + // UncalledBuiltin occurs when a built-in function is used as a + // function-valued expression, instead of being called. + // + // Per the spec: + // "The built-in functions do not have standard Go types, so they can only + // appear in call expressions; they cannot be used as function values." + // + // Example: + // var _ = copy + UncalledBuiltin + + // InvalidAppend occurs when append is called with a first argument that is + // not a slice. + // + // Example: + // var _ = append(1, 2) + InvalidAppend + + // InvalidCap occurs when an argument to the cap built-in function is not of + // supported type. + // + // See https://golang.org/ref/spec#Lengthand_capacity for information on + // which underlying types are supported as arguments to cap and len. + // + // Example: + // var s = 2 + // var x = cap(s) + InvalidCap + + // InvalidClose occurs when close(...) is called with an argument that is + // not of channel type, or that is a receive-only channel. + // + // Example: + // func f() { + // var x int + // close(x) + // } + InvalidClose + + // InvalidCopy occurs when the arguments are not of slice type or do not + // have compatible type. + // + // See https://golang.org/ref/spec#Appendingand_copying_slices for more + // information on the type requirements for the copy built-in. + // + // Example: + // func f() { + // var x []int + // y := []int64{1,2,3} + // copy(x, y) + // } + InvalidCopy + + // InvalidComplex occurs when the complex built-in function is called with + // arguments with incompatible types. + // + // Example: + // var _ = complex(float32(1), float64(2)) + InvalidComplex + + // InvalidDelete occurs when the delete built-in function is called with a + // first argument that is not a map. + // + // Example: + // func f() { + // m := "hello" + // delete(m, "e") + // } + InvalidDelete + + // InvalidImag occurs when the imag built-in function is called with an + // argument that does not have complex type. + // + // Example: + // var _ = imag(int(1)) + InvalidImag + + // InvalidLen occurs when an argument to the len built-in function is not of + // supported type. + // + // See https://golang.org/ref/spec#Lengthand_capacity for information on + // which underlying types are supported as arguments to cap and len. + // + // Example: + // var s = 2 + // var x = len(s) + InvalidLen + + // SwappedMakeArgs occurs when make is called with three arguments, and its + // length argument is larger than its capacity argument. + // + // Example: + // var x = make([]int, 3, 2) + SwappedMakeArgs + + // InvalidMake occurs when make is called with an unsupported type argument. + // + // See https://golang.org/ref/spec#Makingslices_maps_and_channels for + // information on the types that may be created using make. + // + // Example: + // var x = make(int) + InvalidMake + + // InvalidReal occurs when the real built-in function is called with an + // argument that does not have complex type. + // + // Example: + // var _ = real(int(1)) + InvalidReal + + /* exprs > assertion */ + + // InvalidAssert occurs when a type assertion is applied to a + // value that is not of interface type. + // + // Example: + // var x = 1 + // var _ = x.(float64) + InvalidAssert + + // ImpossibleAssert occurs for a type assertion x.(T) when the value x of + // interface cannot have dynamic type T, due to a missing or mismatching + // method on T. + // + // Example: + // type T int + // + // func (t *T) m() int { return int(*t) } + // + // type I interface { m() int } + // + // var x I + // var _ = x.(T) + ImpossibleAssert + + /* exprs > conversion */ + + // InvalidConversion occurs when the argument type cannot be converted to the + // target. + // + // See https://golang.org/ref/spec#Conversions for the rules of + // convertibility. + // + // Example: + // var x float64 + // var _ = string(x) + InvalidConversion + + // InvalidUntypedConversion occurs when an there is no valid implicit + // conversion from an untyped value satisfying the type constraints of the + // context in which it is used. + // + // Example: + // var _ = 1 + "" + InvalidUntypedConversion + + /* offsetof */ + + // BadOffsetofSyntax occurs when unsafe.Offsetof is called with an argument + // that is not a selector expression. + // + // Example: + // import "unsafe" + // + // var x int + // var _ = unsafe.Offsetof(x) + BadOffsetofSyntax + + // InvalidOffsetof occurs when unsafe.Offsetof is called with a method + // selector, rather than a field selector, or when the field is embedded via + // a pointer. + // + // Per the spec: + // + // "If f is an embedded field, it must be reachable without pointer + // indirections through fields of the struct. " + // + // Example: + // import "unsafe" + // + // type T struct { f int } + // type S struct { *T } + // var s S + // var _ = unsafe.Offsetof(s.f) + // + // Example: + // import "unsafe" + // + // type S struct{} + // + // func (S) m() {} + // + // var s S + // var _ = unsafe.Offsetof(s.m) + InvalidOffsetof + + /* control flow > scope */ + + // UnusedExpr occurs when a side-effect free expression is used as a + // statement. Such a statement has no effect. + // + // Example: + // func f(i int) { + // i*i + // } + UnusedExpr + + // UnusedVar occurs when a variable is declared but unused. + // + // Example: + // func f() { + // x := 1 + // } + UnusedVar + + // MissingReturn occurs when a function with results is missing a return + // statement. + // + // Example: + // func f() int {} + MissingReturn + + // WrongResultCount occurs when a return statement returns an incorrect + // number of values. + // + // Example: + // func ReturnOne() int { + // return 1, 2 + // } + WrongResultCount + + // OutOfScopeResult occurs when the name of a value implicitly returned by + // an empty return statement is shadowed in a nested scope. + // + // Example: + // func factor(n int) (i int) { + // for i := 2; i < n; i++ { + // if n%i == 0 { + // return + // } + // } + // return 0 + // } + OutOfScopeResult + + /* control flow > if */ + + // InvalidCond occurs when an if condition is not a boolean expression. + // + // Example: + // func checkReturn(i int) { + // if i { + // panic("non-zero return") + // } + // } + InvalidCond + + /* control flow > for */ + + // InvalidPostDecl occurs when there is a declaration in a for-loop post + // statement. + // + // Example: + // func f() { + // for i := 0; i < 10; j := 0 {} + // } + InvalidPostDecl + + // InvalidChanRange occurs when a send-only channel used in a range + // expression. + // + // Example: + // func sum(c chan<- int) { + // s := 0 + // for i := range c { + // s += i + // } + // } + InvalidChanRange + + // InvalidIterVar occurs when two iteration variables are used while ranging + // over a channel. + // + // Example: + // func f(c chan int) { + // for k, v := range c { + // println(k, v) + // } + // } + InvalidIterVar + + // InvalidRangeExpr occurs when the type of a range expression is not array, + // slice, string, map, or channel. + // + // Example: + // func f(i int) { + // for j := range i { + // println(j) + // } + // } + InvalidRangeExpr + + /* control flow > switch */ + + // MisplacedBreak occurs when a break statement is not within a for, switch, + // or select statement of the innermost function definition. + // + // Example: + // func f() { + // break + // } + MisplacedBreak + + // MisplacedContinue occurs when a continue statement is not within a for + // loop of the innermost function definition. + // + // Example: + // func sumeven(n int) int { + // proceed := func() { + // continue + // } + // sum := 0 + // for i := 1; i <= n; i++ { + // if i % 2 != 0 { + // proceed() + // } + // sum += i + // } + // return sum + // } + MisplacedContinue + + // MisplacedFallthrough occurs when a fallthrough statement is not within an + // expression switch. + // + // Example: + // func typename(i interface{}) string { + // switch i.(type) { + // case int64: + // fallthrough + // case int: + // return "int" + // } + // return "unsupported" + // } + MisplacedFallthrough + + // DuplicateCase occurs when a type or expression switch has duplicate + // cases. + // + // Example: + // func printInt(i int) { + // switch i { + // case 1: + // println("one") + // case 1: + // println("One") + // } + // } + DuplicateCase + + // DuplicateDefault occurs when a type or expression switch has multiple + // default clauses. + // + // Example: + // func printInt(i int) { + // switch i { + // case 1: + // println("one") + // default: + // println("One") + // default: + // println("1") + // } + // } + DuplicateDefault + + // BadTypeKeyword occurs when a .(type) expression is used anywhere other + // than a type switch. + // + // Example: + // type I interface { + // m() + // } + // var t I + // var _ = t.(type) + BadTypeKeyword + + // InvalidTypeSwitch occurs when .(type) is used on an expression that is + // not of interface type. + // + // Example: + // func f(i int) { + // switch x := i.(type) {} + // } + InvalidTypeSwitch + + /* control flow > select */ + + // InvalidSelectCase occurs when a select case is not a channel send or + // receive. + // + // Example: + // func checkChan(c <-chan int) bool { + // select { + // case c: + // return true + // default: + // return false + // } + // } + InvalidSelectCase + + /* control flow > labels and jumps */ + + // UndeclaredLabel occurs when an undeclared label is jumped to. + // + // Example: + // func f() { + // goto L + // } + UndeclaredLabel + + // DuplicateLabel occurs when a label is declared more than once. + // + // Example: + // func f() int { + // L: + // L: + // return 1 + // } + DuplicateLabel + + // MisplacedLabel occurs when a break or continue label is not on a for, + // switch, or select statement. + // + // Example: + // func f() { + // L: + // a := []int{1,2,3} + // for _, e := range a { + // if e > 10 { + // break L + // } + // println(a) + // } + // } + MisplacedLabel + + // UnusedLabel occurs when a label is declared but not used. + // + // Example: + // func f() { + // L: + // } + UnusedLabel + + // JumpOverDecl occurs when a label jumps over a variable declaration. + // + // Example: + // func f() int { + // goto L + // x := 2 + // L: + // x++ + // return x + // } + JumpOverDecl + + // JumpIntoBlock occurs when a forward jump goes to a label inside a nested + // block. + // + // Example: + // func f(x int) { + // goto L + // if x > 0 { + // L: + // print("inside block") + // } + // } + JumpIntoBlock + + /* control flow > calls */ + + // InvalidMethodExpr occurs when a pointer method is called but the argument + // is not addressable. + // + // Example: + // type T struct {} + // + // func (*T) m() int { return 1 } + // + // var _ = T.m(T{}) + InvalidMethodExpr + + // WrongArgCount occurs when too few or too many arguments are passed by a + // function call. + // + // Example: + // func f(i int) {} + // var x = f() + WrongArgCount + + // InvalidCall occurs when an expression is called that is not of function + // type. + // + // Example: + // var x = "x" + // var y = x() + InvalidCall + + /* control flow > suspended */ + + // UnusedResults occurs when a restricted expression-only built-in function + // is suspended via go or defer. Such a suspension discards the results of + // these side-effect free built-in functions, and therefore is ineffectual. + // + // Example: + // func f(a []int) int { + // defer len(a) + // return i + // } + UnusedResults + + // InvalidDefer occurs when a deferred expression is not a function call, + // for example if the expression is a type conversion. + // + // Example: + // func f(i int) int { + // defer int32(i) + // return i + // } + InvalidDefer + + // InvalidGo occurs when a go expression is not a function call, for example + // if the expression is a type conversion. + // + // Example: + // func f(i int) int { + // go int32(i) + // return i + // } + InvalidGo +) diff --git a/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go b/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go new file mode 100644 index 0000000000..97f3ec891f --- /dev/null +++ b/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go @@ -0,0 +1,152 @@ +// Code generated by "stringer -type=ErrorCode"; DO NOT EDIT. + +package typesinternal + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[Test-1] + _ = x[BlankPkgName-2] + _ = x[MismatchedPkgName-3] + _ = x[InvalidPkgUse-4] + _ = x[BadImportPath-5] + _ = x[BrokenImport-6] + _ = x[ImportCRenamed-7] + _ = x[UnusedImport-8] + _ = x[InvalidInitCycle-9] + _ = x[DuplicateDecl-10] + _ = x[InvalidDeclCycle-11] + _ = x[InvalidTypeCycle-12] + _ = x[InvalidConstInit-13] + _ = x[InvalidConstVal-14] + _ = x[InvalidConstType-15] + _ = x[UntypedNil-16] + _ = x[WrongAssignCount-17] + _ = x[UnassignableOperand-18] + _ = x[NoNewVar-19] + _ = x[MultiValAssignOp-20] + _ = x[InvalidIfaceAssign-21] + _ = x[InvalidChanAssign-22] + _ = x[IncompatibleAssign-23] + _ = x[UnaddressableFieldAssign-24] + _ = x[NotAType-25] + _ = x[InvalidArrayLen-26] + _ = x[BlankIfaceMethod-27] + _ = x[IncomparableMapKey-28] + _ = x[InvalidIfaceEmbed-29] + _ = x[InvalidPtrEmbed-30] + _ = x[BadRecv-31] + _ = x[InvalidRecv-32] + _ = x[DuplicateFieldAndMethod-33] + _ = x[DuplicateMethod-34] + _ = x[InvalidBlank-35] + _ = x[InvalidIota-36] + _ = x[MissingInitBody-37] + _ = x[InvalidInitSig-38] + _ = x[InvalidInitDecl-39] + _ = x[InvalidMainDecl-40] + _ = x[TooManyValues-41] + _ = x[NotAnExpr-42] + _ = x[TruncatedFloat-43] + _ = x[NumericOverflow-44] + _ = x[UndefinedOp-45] + _ = x[MismatchedTypes-46] + _ = x[DivByZero-47] + _ = x[NonNumericIncDec-48] + _ = x[UnaddressableOperand-49] + _ = x[InvalidIndirection-50] + _ = x[NonIndexableOperand-51] + _ = x[InvalidIndex-52] + _ = x[SwappedSliceIndices-53] + _ = x[NonSliceableOperand-54] + _ = x[InvalidSliceExpr-55] + _ = x[InvalidShiftCount-56] + _ = x[InvalidShiftOperand-57] + _ = x[InvalidReceive-58] + _ = x[InvalidSend-59] + _ = x[DuplicateLitKey-60] + _ = x[MissingLitKey-61] + _ = x[InvalidLitIndex-62] + _ = x[OversizeArrayLit-63] + _ = x[MixedStructLit-64] + _ = x[InvalidStructLit-65] + _ = x[MissingLitField-66] + _ = x[DuplicateLitField-67] + _ = x[UnexportedLitField-68] + _ = x[InvalidLitField-69] + _ = x[UntypedLit-70] + _ = x[InvalidLit-71] + _ = x[AmbiguousSelector-72] + _ = x[UndeclaredImportedName-73] + _ = x[UnexportedName-74] + _ = x[UndeclaredName-75] + _ = x[MissingFieldOrMethod-76] + _ = x[BadDotDotDotSyntax-77] + _ = x[NonVariadicDotDotDot-78] + _ = x[MisplacedDotDotDot-79] + _ = x[InvalidDotDotDotOperand-80] + _ = x[InvalidDotDotDot-81] + _ = x[UncalledBuiltin-82] + _ = x[InvalidAppend-83] + _ = x[InvalidCap-84] + _ = x[InvalidClose-85] + _ = x[InvalidCopy-86] + _ = x[InvalidComplex-87] + _ = x[InvalidDelete-88] + _ = x[InvalidImag-89] + _ = x[InvalidLen-90] + _ = x[SwappedMakeArgs-91] + _ = x[InvalidMake-92] + _ = x[InvalidReal-93] + _ = x[InvalidAssert-94] + _ = x[ImpossibleAssert-95] + _ = x[InvalidConversion-96] + _ = x[InvalidUntypedConversion-97] + _ = x[BadOffsetofSyntax-98] + _ = x[InvalidOffsetof-99] + _ = x[UnusedExpr-100] + _ = x[UnusedVar-101] + _ = x[MissingReturn-102] + _ = x[WrongResultCount-103] + _ = x[OutOfScopeResult-104] + _ = x[InvalidCond-105] + _ = x[InvalidPostDecl-106] + _ = x[InvalidChanRange-107] + _ = x[InvalidIterVar-108] + _ = x[InvalidRangeExpr-109] + _ = x[MisplacedBreak-110] + _ = x[MisplacedContinue-111] + _ = x[MisplacedFallthrough-112] + _ = x[DuplicateCase-113] + _ = x[DuplicateDefault-114] + _ = x[BadTypeKeyword-115] + _ = x[InvalidTypeSwitch-116] + _ = x[InvalidSelectCase-117] + _ = x[UndeclaredLabel-118] + _ = x[DuplicateLabel-119] + _ = x[MisplacedLabel-120] + _ = x[UnusedLabel-121] + _ = x[JumpOverDecl-122] + _ = x[JumpIntoBlock-123] + _ = x[InvalidMethodExpr-124] + _ = x[WrongArgCount-125] + _ = x[InvalidCall-126] + _ = x[UnusedResults-127] + _ = x[InvalidDefer-128] + _ = x[InvalidGo-129] +} + +const _ErrorCode_name = "TestBlankPkgNameMismatchedPkgNameInvalidPkgUseBadImportPathBrokenImportImportCRenamedUnusedImportInvalidInitCycleDuplicateDeclInvalidDeclCycleInvalidTypeCycleInvalidConstInitInvalidConstValInvalidConstTypeUntypedNilWrongAssignCountUnassignableOperandNoNewVarMultiValAssignOpInvalidIfaceAssignInvalidChanAssignIncompatibleAssignUnaddressableFieldAssignNotATypeInvalidArrayLenBlankIfaceMethodIncomparableMapKeyInvalidIfaceEmbedInvalidPtrEmbedBadRecvInvalidRecvDuplicateFieldAndMethodDuplicateMethodInvalidBlankInvalidIotaMissingInitBodyInvalidInitSigInvalidInitDeclInvalidMainDeclTooManyValuesNotAnExprTruncatedFloatNumericOverflowUndefinedOpMismatchedTypesDivByZeroNonNumericIncDecUnaddressableOperandInvalidIndirectionNonIndexableOperandInvalidIndexSwappedSliceIndicesNonSliceableOperandInvalidSliceExprInvalidShiftCountInvalidShiftOperandInvalidReceiveInvalidSendDuplicateLitKeyMissingLitKeyInvalidLitIndexOversizeArrayLitMixedStructLitInvalidStructLitMissingLitFieldDuplicateLitFieldUnexportedLitFieldInvalidLitFieldUntypedLitInvalidLitAmbiguousSelectorUndeclaredImportedNameUnexportedNameUndeclaredNameMissingFieldOrMethodBadDotDotDotSyntaxNonVariadicDotDotDotMisplacedDotDotDotInvalidDotDotDotOperandInvalidDotDotDotUncalledBuiltinInvalidAppendInvalidCapInvalidCloseInvalidCopyInvalidComplexInvalidDeleteInvalidImagInvalidLenSwappedMakeArgsInvalidMakeInvalidRealInvalidAssertImpossibleAssertInvalidConversionInvalidUntypedConversionBadOffsetofSyntaxInvalidOffsetofUnusedExprUnusedVarMissingReturnWrongResultCountOutOfScopeResultInvalidCondInvalidPostDeclInvalidChanRangeInvalidIterVarInvalidRangeExprMisplacedBreakMisplacedContinueMisplacedFallthroughDuplicateCaseDuplicateDefaultBadTypeKeywordInvalidTypeSwitchInvalidSelectCaseUndeclaredLabelDuplicateLabelMisplacedLabelUnusedLabelJumpOverDeclJumpIntoBlockInvalidMethodExprWrongArgCountInvalidCallUnusedResultsInvalidDeferInvalidGo" + +var _ErrorCode_index = [...]uint16{0, 4, 16, 33, 46, 59, 71, 85, 97, 113, 126, 142, 158, 174, 189, 205, 215, 231, 250, 258, 274, 292, 309, 327, 351, 359, 374, 390, 408, 425, 440, 447, 458, 481, 496, 508, 519, 534, 548, 563, 578, 591, 600, 614, 629, 640, 655, 664, 680, 700, 718, 737, 749, 768, 787, 803, 820, 839, 853, 864, 879, 892, 907, 923, 937, 953, 968, 985, 1003, 1018, 1028, 1038, 1055, 1077, 1091, 1105, 1125, 1143, 1163, 1181, 1204, 1220, 1235, 1248, 1258, 1270, 1281, 1295, 1308, 1319, 1329, 1344, 1355, 1366, 1379, 1395, 1412, 1436, 1453, 1468, 1478, 1487, 1500, 1516, 1532, 1543, 1558, 1574, 1588, 1604, 1618, 1635, 1655, 1668, 1684, 1698, 1715, 1732, 1747, 1761, 1775, 1786, 1798, 1811, 1828, 1841, 1852, 1865, 1877, 1886} + +func (i ErrorCode) String() string { + i -= 1 + if i < 0 || i >= ErrorCode(len(_ErrorCode_index)-1) { + return "ErrorCode(" + strconv.FormatInt(int64(i+1), 10) + ")" + } + return _ErrorCode_name[_ErrorCode_index[i]:_ErrorCode_index[i+1]] +} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/types.go b/vendor/golang.org/x/tools/internal/typesinternal/types.go new file mode 100644 index 0000000000..c3e1a397db --- /dev/null +++ b/vendor/golang.org/x/tools/internal/typesinternal/types.go @@ -0,0 +1,45 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package typesinternal provides access to internal go/types APIs that are not +// yet exported. +package typesinternal + +import ( + "go/token" + "go/types" + "reflect" + "unsafe" +) + +func SetUsesCgo(conf *types.Config) bool { + v := reflect.ValueOf(conf).Elem() + + f := v.FieldByName("go115UsesCgo") + if !f.IsValid() { + f = v.FieldByName("UsesCgo") + if !f.IsValid() { + return false + } + } + + addr := unsafe.Pointer(f.UnsafeAddr()) + *(*bool)(addr) = true + + return true +} + +func ReadGo116ErrorData(terr types.Error) (ErrorCode, token.Pos, token.Pos, bool) { + var data [3]int + // By coincidence all of these fields are ints, which simplifies things. + v := reflect.ValueOf(terr) + for i, name := range []string{"go116code", "go116start", "go116end"} { + f := v.FieldByName(name) + if !f.IsValid() { + return 0, 0, 0, false + } + data[i] = int(f.Int()) + } + return ErrorCode(data[0]), token.Pos(data[1]), token.Pos(data[2]), true +} diff --git a/vendor/golang.org/x/xerrors/LICENSE b/vendor/golang.org/x/xerrors/LICENSE new file mode 100644 index 0000000000..e4a47e17f1 --- /dev/null +++ b/vendor/golang.org/x/xerrors/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2019 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/xerrors/PATENTS b/vendor/golang.org/x/xerrors/PATENTS new file mode 100644 index 0000000000..733099041f --- /dev/null +++ b/vendor/golang.org/x/xerrors/PATENTS @@ -0,0 +1,22 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the Go project. + +Google hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable (except as stated in this section) +patent license to make, have made, use, offer to sell, sell, import, +transfer and otherwise run, modify and propagate the contents of this +implementation of Go, where such license applies only to those patent +claims, both currently owned or controlled by Google and acquired in +the future, licensable by Google that are necessarily infringed by this +implementation of Go. This grant does not include claims that would be +infringed only as a consequence of further modification of this +implementation. If you or your agent or exclusive licensee institute or +order or agree to the institution of patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging +that this implementation of Go or any code incorporated within this +implementation of Go constitutes direct or contributory patent +infringement, or inducement of patent infringement, then any patent +rights granted to you under this License for this implementation of Go +shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/xerrors/README b/vendor/golang.org/x/xerrors/README new file mode 100644 index 0000000000..aac7867a56 --- /dev/null +++ b/vendor/golang.org/x/xerrors/README @@ -0,0 +1,2 @@ +This repository holds the transition packages for the new Go 1.13 error values. +See golang.org/design/29934-error-values. diff --git a/vendor/golang.org/x/xerrors/adaptor.go b/vendor/golang.org/x/xerrors/adaptor.go new file mode 100644 index 0000000000..4317f24833 --- /dev/null +++ b/vendor/golang.org/x/xerrors/adaptor.go @@ -0,0 +1,193 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xerrors + +import ( + "bytes" + "fmt" + "io" + "reflect" + "strconv" +) + +// FormatError calls the FormatError method of f with an errors.Printer +// configured according to s and verb, and writes the result to s. +func FormatError(f Formatter, s fmt.State, verb rune) { + // Assuming this function is only called from the Format method, and given + // that FormatError takes precedence over Format, it cannot be called from + // any package that supports errors.Formatter. It is therefore safe to + // disregard that State may be a specific printer implementation and use one + // of our choice instead. + + // limitations: does not support printing error as Go struct. + + var ( + sep = " " // separator before next error + p = &state{State: s} + direct = true + ) + + var err error = f + + switch verb { + // Note that this switch must match the preference order + // for ordinary string printing (%#v before %+v, and so on). + + case 'v': + if s.Flag('#') { + if stringer, ok := err.(fmt.GoStringer); ok { + io.WriteString(&p.buf, stringer.GoString()) + goto exit + } + // proceed as if it were %v + } else if s.Flag('+') { + p.printDetail = true + sep = "\n - " + } + case 's': + case 'q', 'x', 'X': + // Use an intermediate buffer in the rare cases that precision, + // truncation, or one of the alternative verbs (q, x, and X) are + // specified. + direct = false + + default: + p.buf.WriteString("%!") + p.buf.WriteRune(verb) + p.buf.WriteByte('(') + switch { + case err != nil: + p.buf.WriteString(reflect.TypeOf(f).String()) + default: + p.buf.WriteString("") + } + p.buf.WriteByte(')') + io.Copy(s, &p.buf) + return + } + +loop: + for { + switch v := err.(type) { + case Formatter: + err = v.FormatError((*printer)(p)) + case fmt.Formatter: + v.Format(p, 'v') + break loop + default: + io.WriteString(&p.buf, v.Error()) + break loop + } + if err == nil { + break + } + if p.needColon || !p.printDetail { + p.buf.WriteByte(':') + p.needColon = false + } + p.buf.WriteString(sep) + p.inDetail = false + p.needNewline = false + } + +exit: + width, okW := s.Width() + prec, okP := s.Precision() + + if !direct || (okW && width > 0) || okP { + // Construct format string from State s. + format := []byte{'%'} + if s.Flag('-') { + format = append(format, '-') + } + if s.Flag('+') { + format = append(format, '+') + } + if s.Flag(' ') { + format = append(format, ' ') + } + if okW { + format = strconv.AppendInt(format, int64(width), 10) + } + if okP { + format = append(format, '.') + format = strconv.AppendInt(format, int64(prec), 10) + } + format = append(format, string(verb)...) + fmt.Fprintf(s, string(format), p.buf.String()) + } else { + io.Copy(s, &p.buf) + } +} + +var detailSep = []byte("\n ") + +// state tracks error printing state. It implements fmt.State. +type state struct { + fmt.State + buf bytes.Buffer + + printDetail bool + inDetail bool + needColon bool + needNewline bool +} + +func (s *state) Write(b []byte) (n int, err error) { + if s.printDetail { + if len(b) == 0 { + return 0, nil + } + if s.inDetail && s.needColon { + s.needNewline = true + if b[0] == '\n' { + b = b[1:] + } + } + k := 0 + for i, c := range b { + if s.needNewline { + if s.inDetail && s.needColon { + s.buf.WriteByte(':') + s.needColon = false + } + s.buf.Write(detailSep) + s.needNewline = false + } + if c == '\n' { + s.buf.Write(b[k:i]) + k = i + 1 + s.needNewline = true + } + } + s.buf.Write(b[k:]) + if !s.inDetail { + s.needColon = true + } + } else if !s.inDetail { + s.buf.Write(b) + } + return len(b), nil +} + +// printer wraps a state to implement an xerrors.Printer. +type printer state + +func (s *printer) Print(args ...interface{}) { + if !s.inDetail || s.printDetail { + fmt.Fprint((*state)(s), args...) + } +} + +func (s *printer) Printf(format string, args ...interface{}) { + if !s.inDetail || s.printDetail { + fmt.Fprintf((*state)(s), format, args...) + } +} + +func (s *printer) Detail() bool { + s.inDetail = true + return s.printDetail +} diff --git a/vendor/golang.org/x/xerrors/codereview.cfg b/vendor/golang.org/x/xerrors/codereview.cfg new file mode 100644 index 0000000000..3f8b14b64e --- /dev/null +++ b/vendor/golang.org/x/xerrors/codereview.cfg @@ -0,0 +1 @@ +issuerepo: golang/go diff --git a/vendor/golang.org/x/xerrors/doc.go b/vendor/golang.org/x/xerrors/doc.go new file mode 100644 index 0000000000..eef99d9d54 --- /dev/null +++ b/vendor/golang.org/x/xerrors/doc.go @@ -0,0 +1,22 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package xerrors implements functions to manipulate errors. +// +// This package is based on the Go 2 proposal for error values: +// https://golang.org/design/29934-error-values +// +// These functions were incorporated into the standard library's errors package +// in Go 1.13: +// - Is +// - As +// - Unwrap +// +// Also, Errorf's %w verb was incorporated into fmt.Errorf. +// +// Use this package to get equivalent behavior in all supported Go versions. +// +// No other features of this package were included in Go 1.13, and at present +// there are no plans to include any of them. +package xerrors // import "golang.org/x/xerrors" diff --git a/vendor/golang.org/x/xerrors/errors.go b/vendor/golang.org/x/xerrors/errors.go new file mode 100644 index 0000000000..e88d3772d8 --- /dev/null +++ b/vendor/golang.org/x/xerrors/errors.go @@ -0,0 +1,33 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xerrors + +import "fmt" + +// errorString is a trivial implementation of error. +type errorString struct { + s string + frame Frame +} + +// New returns an error that formats as the given text. +// +// The returned error contains a Frame set to the caller's location and +// implements Formatter to show this information when printed with details. +func New(text string) error { + return &errorString{text, Caller(1)} +} + +func (e *errorString) Error() string { + return e.s +} + +func (e *errorString) Format(s fmt.State, v rune) { FormatError(e, s, v) } + +func (e *errorString) FormatError(p Printer) (next error) { + p.Print(e.s) + e.frame.Format(p) + return nil +} diff --git a/vendor/golang.org/x/xerrors/fmt.go b/vendor/golang.org/x/xerrors/fmt.go new file mode 100644 index 0000000000..829862ddf6 --- /dev/null +++ b/vendor/golang.org/x/xerrors/fmt.go @@ -0,0 +1,187 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xerrors + +import ( + "fmt" + "strings" + "unicode" + "unicode/utf8" + + "golang.org/x/xerrors/internal" +) + +const percentBangString = "%!" + +// Errorf formats according to a format specifier and returns the string as a +// value that satisfies error. +// +// The returned error includes the file and line number of the caller when +// formatted with additional detail enabled. If the last argument is an error +// the returned error's Format method will return it if the format string ends +// with ": %s", ": %v", or ": %w". If the last argument is an error and the +// format string ends with ": %w", the returned error implements an Unwrap +// method returning it. +// +// If the format specifier includes a %w verb with an error operand in a +// position other than at the end, the returned error will still implement an +// Unwrap method returning the operand, but the error's Format method will not +// return the wrapped error. +// +// It is invalid to include more than one %w verb or to supply it with an +// operand that does not implement the error interface. The %w verb is otherwise +// a synonym for %v. +func Errorf(format string, a ...interface{}) error { + format = formatPlusW(format) + // Support a ": %[wsv]" suffix, which works well with xerrors.Formatter. + wrap := strings.HasSuffix(format, ": %w") + idx, format2, ok := parsePercentW(format) + percentWElsewhere := !wrap && idx >= 0 + if !percentWElsewhere && (wrap || strings.HasSuffix(format, ": %s") || strings.HasSuffix(format, ": %v")) { + err := errorAt(a, len(a)-1) + if err == nil { + return &noWrapError{fmt.Sprintf(format, a...), nil, Caller(1)} + } + // TODO: this is not entirely correct. The error value could be + // printed elsewhere in format if it mixes numbered with unnumbered + // substitutions. With relatively small changes to doPrintf we can + // have it optionally ignore extra arguments and pass the argument + // list in its entirety. + msg := fmt.Sprintf(format[:len(format)-len(": %s")], a[:len(a)-1]...) + frame := Frame{} + if internal.EnableTrace { + frame = Caller(1) + } + if wrap { + return &wrapError{msg, err, frame} + } + return &noWrapError{msg, err, frame} + } + // Support %w anywhere. + // TODO: don't repeat the wrapped error's message when %w occurs in the middle. + msg := fmt.Sprintf(format2, a...) + if idx < 0 { + return &noWrapError{msg, nil, Caller(1)} + } + err := errorAt(a, idx) + if !ok || err == nil { + // Too many %ws or argument of %w is not an error. Approximate the Go + // 1.13 fmt.Errorf message. + return &noWrapError{fmt.Sprintf("%sw(%s)", percentBangString, msg), nil, Caller(1)} + } + frame := Frame{} + if internal.EnableTrace { + frame = Caller(1) + } + return &wrapError{msg, err, frame} +} + +func errorAt(args []interface{}, i int) error { + if i < 0 || i >= len(args) { + return nil + } + err, ok := args[i].(error) + if !ok { + return nil + } + return err +} + +// formatPlusW is used to avoid the vet check that will barf at %w. +func formatPlusW(s string) string { + return s +} + +// Return the index of the only %w in format, or -1 if none. +// Also return a rewritten format string with %w replaced by %v, and +// false if there is more than one %w. +// TODO: handle "%[N]w". +func parsePercentW(format string) (idx int, newFormat string, ok bool) { + // Loosely copied from golang.org/x/tools/go/analysis/passes/printf/printf.go. + idx = -1 + ok = true + n := 0 + sz := 0 + var isW bool + for i := 0; i < len(format); i += sz { + if format[i] != '%' { + sz = 1 + continue + } + // "%%" is not a format directive. + if i+1 < len(format) && format[i+1] == '%' { + sz = 2 + continue + } + sz, isW = parsePrintfVerb(format[i:]) + if isW { + if idx >= 0 { + ok = false + } else { + idx = n + } + // "Replace" the last character, the 'w', with a 'v'. + p := i + sz - 1 + format = format[:p] + "v" + format[p+1:] + } + n++ + } + return idx, format, ok +} + +// Parse the printf verb starting with a % at s[0]. +// Return how many bytes it occupies and whether the verb is 'w'. +func parsePrintfVerb(s string) (int, bool) { + // Assume only that the directive is a sequence of non-letters followed by a single letter. + sz := 0 + var r rune + for i := 1; i < len(s); i += sz { + r, sz = utf8.DecodeRuneInString(s[i:]) + if unicode.IsLetter(r) { + return i + sz, r == 'w' + } + } + return len(s), false +} + +type noWrapError struct { + msg string + err error + frame Frame +} + +func (e *noWrapError) Error() string { + return fmt.Sprint(e) +} + +func (e *noWrapError) Format(s fmt.State, v rune) { FormatError(e, s, v) } + +func (e *noWrapError) FormatError(p Printer) (next error) { + p.Print(e.msg) + e.frame.Format(p) + return e.err +} + +type wrapError struct { + msg string + err error + frame Frame +} + +func (e *wrapError) Error() string { + return fmt.Sprint(e) +} + +func (e *wrapError) Format(s fmt.State, v rune) { FormatError(e, s, v) } + +func (e *wrapError) FormatError(p Printer) (next error) { + p.Print(e.msg) + e.frame.Format(p) + return e.err +} + +func (e *wrapError) Unwrap() error { + return e.err +} diff --git a/vendor/golang.org/x/xerrors/format.go b/vendor/golang.org/x/xerrors/format.go new file mode 100644 index 0000000000..1bc9c26b97 --- /dev/null +++ b/vendor/golang.org/x/xerrors/format.go @@ -0,0 +1,34 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xerrors + +// A Formatter formats error messages. +type Formatter interface { + error + + // FormatError prints the receiver's first error and returns the next error in + // the error chain, if any. + FormatError(p Printer) (next error) +} + +// A Printer formats error messages. +// +// The most common implementation of Printer is the one provided by package fmt +// during Printf (as of Go 1.13). Localization packages such as golang.org/x/text/message +// typically provide their own implementations. +type Printer interface { + // Print appends args to the message output. + Print(args ...interface{}) + + // Printf writes a formatted string. + Printf(format string, args ...interface{}) + + // Detail reports whether error detail is requested. + // After the first call to Detail, all text written to the Printer + // is formatted as additional detail, or ignored when + // detail has not been requested. + // If Detail returns false, the caller can avoid printing the detail at all. + Detail() bool +} diff --git a/vendor/golang.org/x/xerrors/frame.go b/vendor/golang.org/x/xerrors/frame.go new file mode 100644 index 0000000000..0de628ec50 --- /dev/null +++ b/vendor/golang.org/x/xerrors/frame.go @@ -0,0 +1,56 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xerrors + +import ( + "runtime" +) + +// A Frame contains part of a call stack. +type Frame struct { + // Make room for three PCs: the one we were asked for, what it called, + // and possibly a PC for skipPleaseUseCallersFrames. See: + // https://go.googlesource.com/go/+/032678e0fb/src/runtime/extern.go#169 + frames [3]uintptr +} + +// Caller returns a Frame that describes a frame on the caller's stack. +// The argument skip is the number of frames to skip over. +// Caller(0) returns the frame for the caller of Caller. +func Caller(skip int) Frame { + var s Frame + runtime.Callers(skip+1, s.frames[:]) + return s +} + +// location reports the file, line, and function of a frame. +// +// The returned function may be "" even if file and line are not. +func (f Frame) location() (function, file string, line int) { + frames := runtime.CallersFrames(f.frames[:]) + if _, ok := frames.Next(); !ok { + return "", "", 0 + } + fr, ok := frames.Next() + if !ok { + return "", "", 0 + } + return fr.Function, fr.File, fr.Line +} + +// Format prints the stack as error detail. +// It should be called from an error's Format implementation +// after printing any other error detail. +func (f Frame) Format(p Printer) { + if p.Detail() { + function, file, line := f.location() + if function != "" { + p.Printf("%s\n ", function) + } + if file != "" { + p.Printf("%s:%d\n", file, line) + } + } +} diff --git a/vendor/golang.org/x/xerrors/go.mod b/vendor/golang.org/x/xerrors/go.mod new file mode 100644 index 0000000000..870d4f612d --- /dev/null +++ b/vendor/golang.org/x/xerrors/go.mod @@ -0,0 +1,3 @@ +module golang.org/x/xerrors + +go 1.11 diff --git a/vendor/golang.org/x/xerrors/internal/internal.go b/vendor/golang.org/x/xerrors/internal/internal.go new file mode 100644 index 0000000000..89f4eca5df --- /dev/null +++ b/vendor/golang.org/x/xerrors/internal/internal.go @@ -0,0 +1,8 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package internal + +// EnableTrace indicates whether stack information should be recorded in errors. +var EnableTrace = true diff --git a/vendor/golang.org/x/xerrors/wrap.go b/vendor/golang.org/x/xerrors/wrap.go new file mode 100644 index 0000000000..9a3b510374 --- /dev/null +++ b/vendor/golang.org/x/xerrors/wrap.go @@ -0,0 +1,106 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xerrors + +import ( + "reflect" +) + +// A Wrapper provides context around another error. +type Wrapper interface { + // Unwrap returns the next error in the error chain. + // If there is no next error, Unwrap returns nil. + Unwrap() error +} + +// Opaque returns an error with the same error formatting as err +// but that does not match err and cannot be unwrapped. +func Opaque(err error) error { + return noWrapper{err} +} + +type noWrapper struct { + error +} + +func (e noWrapper) FormatError(p Printer) (next error) { + if f, ok := e.error.(Formatter); ok { + return f.FormatError(p) + } + p.Print(e.error) + return nil +} + +// Unwrap returns the result of calling the Unwrap method on err, if err implements +// Unwrap. Otherwise, Unwrap returns nil. +func Unwrap(err error) error { + u, ok := err.(Wrapper) + if !ok { + return nil + } + return u.Unwrap() +} + +// Is reports whether any error in err's chain matches target. +// +// An error is considered to match a target if it is equal to that target or if +// it implements a method Is(error) bool such that Is(target) returns true. +func Is(err, target error) bool { + if target == nil { + return err == target + } + + isComparable := reflect.TypeOf(target).Comparable() + for { + if isComparable && err == target { + return true + } + if x, ok := err.(interface{ Is(error) bool }); ok && x.Is(target) { + return true + } + // TODO: consider supporing target.Is(err). This would allow + // user-definable predicates, but also may allow for coping with sloppy + // APIs, thereby making it easier to get away with them. + if err = Unwrap(err); err == nil { + return false + } + } +} + +// As finds the first error in err's chain that matches the type to which target +// points, and if so, sets the target to its value and returns true. An error +// matches a type if it is assignable to the target type, or if it has a method +// As(interface{}) bool such that As(target) returns true. As will panic if target +// is not a non-nil pointer to a type which implements error or is of interface type. +// +// The As method should set the target to its value and return true if err +// matches the type to which target points. +func As(err error, target interface{}) bool { + if target == nil { + panic("errors: target cannot be nil") + } + val := reflect.ValueOf(target) + typ := val.Type() + if typ.Kind() != reflect.Ptr || val.IsNil() { + panic("errors: target must be a non-nil pointer") + } + if e := typ.Elem(); e.Kind() != reflect.Interface && !e.Implements(errorType) { + panic("errors: *target must be interface or implement error") + } + targetType := typ.Elem() + for err != nil { + if reflect.TypeOf(err).AssignableTo(targetType) { + val.Elem().Set(reflect.ValueOf(err)) + return true + } + if x, ok := err.(interface{ As(interface{}) bool }); ok && x.As(target) { + return true + } + err = Unwrap(err) + } + return false +} + +var errorType = reflect.TypeOf((*error)(nil)).Elem() diff --git a/vendor/modules.txt b/vendor/modules.txt index b7a40a464b..afba258fbd 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,13 +1,13 @@ -# github.com/AudriusButkevicius/pfilter v0.0.0-20210218141631-7468b85d810a +# github.com/AudriusButkevicius/pfilter v0.0.0-20190627213056-c55ef6137fc6 ## explicit github.com/AudriusButkevicius/pfilter -# github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 +# github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d ## explicit github.com/StackExchange/wmi -# github.com/VictoriaMetrics/metrics v1.17.2 +# github.com/VictoriaMetrics/metrics v1.12.3 ## explicit github.com/VictoriaMetrics/metrics -# github.com/andybalholm/brotli v1.0.0 +# github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6 github.com/andybalholm/brotli # github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 ## explicit @@ -28,21 +28,24 @@ github.com/dsnet/compress/internal/prefix ## explicit github.com/go-chi/chi github.com/go-chi/chi/middleware -# github.com/go-ole/go-ole v1.2.5 +# github.com/go-ole/go-ole v1.2.4 ## explicit github.com/go-ole/go-ole github.com/go-ole/go-ole/oleutil -# github.com/golang/protobuf v1.5.2 +# github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721 +github.com/golang/gddo/httputil +github.com/golang/gddo/httputil/header +# github.com/golang/protobuf v1.4.2 ## explicit # github.com/golang/snappy v0.0.1 github.com/golang/snappy # github.com/google/go-github v17.0.0+incompatible ## explicit github.com/google/go-github/github -# github.com/google/go-querystring v1.1.0 +# github.com/google/go-querystring v1.0.0 ## explicit github.com/google/go-querystring/query -# github.com/google/uuid v1.2.0 +# github.com/google/uuid v1.1.1 ## explicit github.com/google/uuid # github.com/gorilla/securecookie v1.1.1 @@ -52,19 +55,18 @@ github.com/gorilla/securecookie github.com/inconshreveable/mousetrap # github.com/json-iterator/go v1.1.10 github.com/json-iterator/go -# github.com/klauspost/compress v1.10.10 +# github.com/klauspost/compress v1.10.0 github.com/klauspost/compress/flate github.com/klauspost/compress/fse -github.com/klauspost/compress/gzip github.com/klauspost/compress/huff0 github.com/klauspost/compress/snappy github.com/klauspost/compress/zstd github.com/klauspost/compress/zstd/internal/xxhash -# github.com/klauspost/cpuid/v2 v2.0.2 -github.com/klauspost/cpuid/v2 -# github.com/klauspost/pgzip v1.2.4 +# github.com/klauspost/cpuid v1.2.4 +github.com/klauspost/cpuid +# github.com/klauspost/pgzip v1.2.1 github.com/klauspost/pgzip -# github.com/klauspost/reedsolomon v1.9.12 +# github.com/klauspost/reedsolomon v1.9.9 ## explicit github.com/klauspost/reedsolomon # github.com/kz/discordrus v1.2.0 @@ -77,23 +79,35 @@ github.com/mattn/go-isatty # github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d ## explicit github.com/mgutz/ansi -# github.com/mholt/archiver/v3 v3.5.0 +# github.com/mholt/archiver/v3 v3.3.0 ## explicit github.com/mholt/archiver/v3 # github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db github.com/mitchellh/colorstring +# github.com/mmcloughlin/avo v0.0.0-20200523190732-4439b6b2c061 +## explicit +github.com/mmcloughlin/avo/attr +github.com/mmcloughlin/avo/build +github.com/mmcloughlin/avo/buildtags +github.com/mmcloughlin/avo/gotypes +github.com/mmcloughlin/avo/internal/prnt +github.com/mmcloughlin/avo/internal/stack +github.com/mmcloughlin/avo/ir +github.com/mmcloughlin/avo/operand +github.com/mmcloughlin/avo/pass +github.com/mmcloughlin/avo/printer +github.com/mmcloughlin/avo/reg +github.com/mmcloughlin/avo/src +github.com/mmcloughlin/avo/x86 # github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd github.com/modern-go/concurrent # github.com/modern-go/reflect2 v1.0.1 github.com/modern-go/reflect2 -# github.com/nwaples/rardecode v1.1.0 +# github.com/nwaples/rardecode v1.0.0 github.com/nwaples/rardecode -# github.com/pierrec/lz4/v4 v4.0.3 -github.com/pierrec/lz4/v4 -github.com/pierrec/lz4/v4/internal/lz4block -github.com/pierrec/lz4/v4/internal/lz4errors -github.com/pierrec/lz4/v4/internal/lz4stream -github.com/pierrec/lz4/v4/internal/xxh32 +# github.com/pierrec/lz4 v2.0.5+incompatible +github.com/pierrec/lz4 +github.com/pierrec/lz4/internal/xxh32 # github.com/pkg/errors v0.9.1 ## explicit github.com/pkg/errors @@ -105,18 +119,18 @@ github.com/pmezard/go-difflib/difflib # github.com/schollz/progressbar/v2 v2.15.0 ## explicit github.com/schollz/progressbar/v2 -# github.com/shirou/gopsutil v3.21.3+incompatible +# github.com/shirou/gopsutil v2.20.5+incompatible ## explicit github.com/shirou/gopsutil/cpu github.com/shirou/gopsutil/internal/common github.com/shirou/gopsutil/mem github.com/shirou/gopsutil/net github.com/shirou/gopsutil/process -# github.com/sirupsen/logrus v1.8.1 +# github.com/sirupsen/logrus v1.7.0 ## explicit github.com/sirupsen/logrus github.com/sirupsen/logrus/hooks/syslog -# github.com/skycoin/dmsg v0.0.0-20210329160412-4e25fc9ad26c +# github.com/skycoin/dmsg v0.0.0-20201216183836-dae8a7acfc14 ## explicit github.com/skycoin/dmsg github.com/skycoin/dmsg/buildinfo @@ -149,14 +163,14 @@ github.com/skycoin/yamux # github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 ## explicit github.com/songgao/water -# github.com/spf13/cobra v1.1.3 +# github.com/spf13/cobra v1.0.0 ## explicit github.com/spf13/cobra -# github.com/spf13/pflag v1.0.5 +# github.com/spf13/pflag v1.0.3 github.com/spf13/pflag # github.com/stretchr/objx v0.1.1 github.com/stretchr/objx -# github.com/stretchr/testify v1.7.0 +# github.com/stretchr/testify v1.6.1 ## explicit github.com/stretchr/testify/assert github.com/stretchr/testify/mock @@ -170,18 +184,13 @@ github.com/templexxx/cpufeat # github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b ## explicit github.com/templexxx/xor -# github.com/tjfoc/gmsm v1.4.0 +# github.com/tjfoc/gmsm v1.3.2 ## explicit github.com/tjfoc/gmsm/sm4 -# github.com/tklauser/go-sysconf v0.3.5 -## explicit -github.com/tklauser/go-sysconf -# github.com/tklauser/numcpus v0.2.2 -github.com/tklauser/numcpus # github.com/toqueteos/webbrowser v1.2.0 ## explicit github.com/toqueteos/webbrowser -# github.com/ulikunitz/xz v0.5.7 +# github.com/ulikunitz/xz v0.5.6 github.com/ulikunitz/xz github.com/ulikunitz/xz/internal/hash github.com/ulikunitz/xz/internal/xlog @@ -200,7 +209,7 @@ github.com/xtaci/kcp-go # go.etcd.io/bbolt v1.3.5 ## explicit go.etcd.io/bbolt -# golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc +# golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9 ## explicit golang.org/x/crypto/blake2b golang.org/x/crypto/blake2s @@ -218,7 +227,10 @@ golang.org/x/crypto/ssh/terminal golang.org/x/crypto/tea golang.org/x/crypto/twofish golang.org/x/crypto/xtea -# golang.org/x/net v0.0.0-20210420210106-798c2154c571 +# golang.org/x/mod v0.4.2 +## explicit +golang.org/x/mod/semver +# golang.org/x/net v0.0.0-20201021035429-f5854403a974 ## explicit golang.org/x/net/bpf golang.org/x/net/context @@ -232,19 +244,34 @@ golang.org/x/net/proxy # golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988 ## explicit golang.org/x/sys/cpu +golang.org/x/sys/execabs golang.org/x/sys/internal/unsafeheader golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows golang.org/x/sys/windows/registry -# golang.org/x/term v0.0.0-20210406210042-72f3dc4e9b72 +# golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf ## explicit golang.org/x/term -# golang.org/x/text v0.3.6 +# golang.org/x/text v0.3.3 golang.org/x/text/transform golang.org/x/text/unicode/norm +# golang.org/x/tools v0.1.0 +## explicit +golang.org/x/tools/go/gcexportdata +golang.org/x/tools/go/internal/gcimporter +golang.org/x/tools/go/internal/packagesdriver +golang.org/x/tools/go/packages +golang.org/x/tools/internal/event +golang.org/x/tools/internal/event/core +golang.org/x/tools/internal/event/keys +golang.org/x/tools/internal/event/label +golang.org/x/tools/internal/gocommand +golang.org/x/tools/internal/packagesinternal +golang.org/x/tools/internal/typesinternal # golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 -## explicit +golang.org/x/xerrors +golang.org/x/xerrors/internal # golang.zx2c4.com/wireguard v0.0.20200320 ## explicit golang.zx2c4.com/wireguard/rwcancel @@ -257,7 +284,7 @@ golang.zx2c4.com/wireguard/tun/wintun/registry golang.zx2c4.com/wireguard/tun/wintun/setupapi # gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c gopkg.in/yaml.v3 -# nhooyr.io/websocket v1.8.7 +# nhooyr.io/websocket v1.8.2 ## explicit nhooyr.io/websocket nhooyr.io/websocket/internal/bpool diff --git a/vendor/nhooyr.io/websocket/Makefile b/vendor/nhooyr.io/websocket/Makefile new file mode 100644 index 0000000000..f9f31c49f1 --- /dev/null +++ b/vendor/nhooyr.io/websocket/Makefile @@ -0,0 +1,7 @@ +all: fmt lint test + +.SILENT: + +include ci/fmt.mk +include ci/lint.mk +include ci/test.mk diff --git a/vendor/nhooyr.io/websocket/README.md b/vendor/nhooyr.io/websocket/README.md index df20c581a5..5dddf84ad8 100644 --- a/vendor/nhooyr.io/websocket/README.md +++ b/vendor/nhooyr.io/websocket/README.md @@ -1,7 +1,6 @@ # websocket -[![godoc](https://godoc.org/nhooyr.io/websocket?status.svg)](https://pkg.go.dev/nhooyr.io/websocket) -[![coverage](https://img.shields.io/badge/coverage-88%25-success)](https://nhooyrio-websocket-coverage.netlify.app) +[![godoc](https://godoc.org/nhooyr.io/websocket?status.svg)](https://godoc.org/nhooyr.io/websocket) websocket is a minimal and idiomatic WebSocket library for Go. @@ -11,20 +10,21 @@ websocket is a minimal and idiomatic WebSocket library for Go. go get nhooyr.io/websocket ``` -## Highlights +## Features - Minimal and idiomatic API - First class [context.Context](https://blog.golang.org/context) support - Fully passes the WebSocket [autobahn-testsuite](https://github.com/crossbario/autobahn-testsuite) -- [Single dependency](https://pkg.go.dev/nhooyr.io/websocket?tab=imports) -- JSON and protobuf helpers in the [wsjson](https://pkg.go.dev/nhooyr.io/websocket/wsjson) and [wspb](https://pkg.go.dev/nhooyr.io/websocket/wspb) subpackages +- Thorough unit tests with [90% coverage](https://coveralls.io/github/nhooyr/websocket) +- [Minimal dependencies](https://godoc.org/nhooyr.io/websocket?imports) +- JSON and protobuf helpers in the [wsjson](https://godoc.org/nhooyr.io/websocket/wsjson) and [wspb](https://godoc.org/nhooyr.io/websocket/wspb) subpackages - Zero alloc reads and writes - Concurrent writes -- [Close handshake](https://pkg.go.dev/nhooyr.io/websocket#Conn.Close) -- [net.Conn](https://pkg.go.dev/nhooyr.io/websocket#NetConn) wrapper -- [Ping pong](https://pkg.go.dev/nhooyr.io/websocket#Conn.Ping) API +- [Close handshake](https://godoc.org/nhooyr.io/websocket#Conn.Close) +- [net.Conn](https://godoc.org/nhooyr.io/websocket#NetConn) wrapper +- [Ping pong](https://godoc.org/nhooyr.io/websocket#Conn.Ping) API - [RFC 7692](https://tools.ietf.org/html/rfc7692) permessage-deflate compression -- Compile to [Wasm](https://pkg.go.dev/nhooyr.io/websocket#hdr-Wasm) +- Compile to [Wasm](https://godoc.org/nhooyr.io/websocket#hdr-Wasm) ## Roadmap @@ -32,10 +32,7 @@ go get nhooyr.io/websocket ## Examples -For a production quality example that demonstrates the complete API, see the -[echo example](./examples/echo). - -For a full stack example, see the [chat example](./examples/chat). +For a production quality example that demonstrates the complete API, see the [echo example](https://godoc.org/nhooyr.io/websocket#example-package--Echo). ### Server @@ -89,14 +86,14 @@ c.Close(websocket.StatusNormalClosure, "") Advantages of [gorilla/websocket](https://github.com/gorilla/websocket): - Mature and widely used -- [Prepared writes](https://pkg.go.dev/github.com/gorilla/websocket#PreparedMessage) -- Configurable [buffer sizes](https://pkg.go.dev/github.com/gorilla/websocket#hdr-Buffers) +- [Prepared writes](https://godoc.org/github.com/gorilla/websocket#PreparedMessage) +- Configurable [buffer sizes](https://godoc.org/github.com/gorilla/websocket#hdr-Buffers) Advantages of nhooyr.io/websocket: - Minimal and idiomatic API - - Compare godoc of [nhooyr.io/websocket](https://pkg.go.dev/nhooyr.io/websocket) with [gorilla/websocket](https://pkg.go.dev/github.com/gorilla/websocket) side by side. -- [net.Conn](https://pkg.go.dev/nhooyr.io/websocket#NetConn) wrapper + - Compare godoc of [nhooyr.io/websocket](https://godoc.org/nhooyr.io/websocket) with [gorilla/websocket](https://godoc.org/github.com/gorilla/websocket) side by side. +- [net.Conn](https://godoc.org/nhooyr.io/websocket#NetConn) wrapper - Zero alloc reads and writes ([gorilla/websocket#535](https://github.com/gorilla/websocket/issues/535)) - Full [context.Context](https://blog.golang.org/context) support - Dial uses [net/http.Client](https://golang.org/pkg/net/http/#Client) @@ -104,24 +101,24 @@ Advantages of nhooyr.io/websocket: - Gorilla writes directly to a net.Conn and so duplicates features of net/http.Client. - Concurrent writes - Close handshake ([gorilla/websocket#448](https://github.com/gorilla/websocket/issues/448)) -- Idiomatic [ping pong](https://pkg.go.dev/nhooyr.io/websocket#Conn.Ping) API +- Idiomatic [ping pong](https://godoc.org/nhooyr.io/websocket#Conn.Ping) API - Gorilla requires registering a pong callback before sending a Ping - Can target Wasm ([gorilla/websocket#432](https://github.com/gorilla/websocket/issues/432)) -- Transparent message buffer reuse with [wsjson](https://pkg.go.dev/nhooyr.io/websocket/wsjson) and [wspb](https://pkg.go.dev/nhooyr.io/websocket/wspb) subpackages +- Transparent message buffer reuse with [wsjson](https://godoc.org/nhooyr.io/websocket/wsjson) and [wspb](https://godoc.org/nhooyr.io/websocket/wspb) subpackages - [1.75x](https://github.com/nhooyr/websocket/releases/tag/v1.7.4) faster WebSocket masking implementation in pure Go - Gorilla's implementation is slower and uses [unsafe](https://golang.org/pkg/unsafe/). - Full [permessage-deflate](https://tools.ietf.org/html/rfc7692) compression extension support - Gorilla only supports no context takeover mode - We use [klauspost/compress](https://github.com/klauspost/compress) for much lower memory usage ([gorilla/websocket#203](https://github.com/gorilla/websocket/issues/203)) -- [CloseRead](https://pkg.go.dev/nhooyr.io/websocket#Conn.CloseRead) helper ([gorilla/websocket#492](https://github.com/gorilla/websocket/issues/492)) +- [CloseRead](https://godoc.org/nhooyr.io/websocket#Conn.CloseRead) helper ([gorilla/websocket#492](https://github.com/gorilla/websocket/issues/492)) - Actively maintained ([gorilla/websocket#370](https://github.com/gorilla/websocket/issues/370)) #### golang.org/x/net/websocket -[golang.org/x/net/websocket](https://pkg.go.dev/golang.org/x/net/websocket) is deprecated. +[golang.org/x/net/websocket](https://godoc.org/golang.org/x/net/websocket) is deprecated. See [golang/go/issues/18152](https://github.com/golang/go/issues/18152). -The [net.Conn](https://pkg.go.dev/nhooyr.io/websocket#NetConn) can help in transitioning +The [net.Conn](https://godoc.org/nhooyr.io/websocket#NetConn) wrapper will ease in transitioning to nhooyr.io/websocket. #### gobwas/ws diff --git a/vendor/nhooyr.io/websocket/accept.go b/vendor/nhooyr.io/websocket/accept.go index 18536bdb2c..479138fc4c 100644 --- a/vendor/nhooyr.io/websocket/accept.go +++ b/vendor/nhooyr.io/websocket/accept.go @@ -9,11 +9,10 @@ import ( "errors" "fmt" "io" - "log" "net/http" "net/textproto" "net/url" - "path/filepath" + "strconv" "strings" "nhooyr.io/websocket/internal/errd" @@ -26,29 +25,18 @@ type AcceptOptions struct { // reject it, close the connection when c.Subprotocol() == "". Subprotocols []string - // InsecureSkipVerify is used to disable Accept's origin verification behaviour. + // InsecureSkipVerify disables Accept's origin verification behaviour. By default, + // the connection will only be accepted if the request origin is equal to the request + // host. // - // You probably want to use OriginPatterns instead. - InsecureSkipVerify bool - - // OriginPatterns lists the host patterns for authorized origins. - // The request host is always authorized. - // Use this to enable cross origin WebSockets. - // - // i.e javascript running on example.com wants to access a WebSocket server at chat.example.com. - // In such a case, example.com is the origin and chat.example.com is the request host. - // One would set this field to []string{"example.com"} to authorize example.com to connect. + // This is only required if you want javascript served from a different domain + // to access your WebSocket server. // - // Each pattern is matched case insensitively against the request origin host - // with filepath.Match. - // See https://golang.org/pkg/path/filepath/#Match + // See https://stackoverflow.com/a/37837709/4283659 // // Please ensure you understand the ramifications of enabling this. // If used incorrectly your WebSocket server will be open to CSRF attacks. - // - // Do not use * as a pattern to allow any origin, prefer to use InsecureSkipVerify instead - // to bring attention to the danger of such a setting. - OriginPatterns []string + InsecureSkipVerify bool // CompressionMode controls the compression mode. // Defaults to CompressionNoContextTakeover. @@ -67,7 +55,7 @@ type AcceptOptions struct { // the connection to a WebSocket. // // Accept will not allow cross origin requests by default. -// See the InsecureSkipVerify and OriginPatterns options to allow cross origin requests. +// See the InsecureSkipVerify option to allow cross origin requests. // // Accept will write a response to w on all errors. func Accept(w http.ResponseWriter, r *http.Request, opts *AcceptOptions) (*Conn, error) { @@ -89,12 +77,8 @@ func accept(w http.ResponseWriter, r *http.Request, opts *AcceptOptions) (_ *Con } if !opts.InsecureSkipVerify { - err = authenticateOrigin(r, opts.OriginPatterns) + err = authenticateOrigin(r) if err != nil { - if errors.Is(err, filepath.ErrBadPattern) { - log.Printf("websocket: %v", err) - err = errors.New(http.StatusText(http.StatusForbidden)) - } http.Error(w, err.Error(), http.StatusForbidden) return nil, err } @@ -124,12 +108,6 @@ func accept(w http.ResponseWriter, r *http.Request, opts *AcceptOptions) (_ *Con } w.WriteHeader(http.StatusSwitchingProtocols) - // See https://github.com/nhooyr/websocket/issues/166 - if ginWriter, ok := w.(interface { - WriteHeaderNow() - }); ok { - ginWriter.WriteHeaderNow() - } netConn, brw, err := hj.Hijack() if err != nil { @@ -159,13 +137,13 @@ func verifyClientRequest(w http.ResponseWriter, r *http.Request) (errCode int, _ return http.StatusUpgradeRequired, fmt.Errorf("WebSocket protocol violation: handshake request must be at least HTTP/1.1: %q", r.Proto) } - if !headerContainsTokenIgnoreCase(r.Header, "Connection", "Upgrade") { + if !headerContainsToken(r.Header, "Connection", "Upgrade") { w.Header().Set("Connection", "Upgrade") w.Header().Set("Upgrade", "websocket") return http.StatusUpgradeRequired, fmt.Errorf("WebSocket protocol violation: Connection header %q does not contain Upgrade", r.Header.Get("Connection")) } - if !headerContainsTokenIgnoreCase(r.Header, "Upgrade", "websocket") { + if !headerContainsToken(r.Header, "Upgrade", "websocket") { w.Header().Set("Connection", "Upgrade") w.Header().Set("Upgrade", "websocket") return http.StatusUpgradeRequired, fmt.Errorf("WebSocket protocol violation: Upgrade header %q does not contain websocket", r.Header.Get("Upgrade")) @@ -187,35 +165,18 @@ func verifyClientRequest(w http.ResponseWriter, r *http.Request) (errCode int, _ return 0, nil } -func authenticateOrigin(r *http.Request, originHosts []string) error { +func authenticateOrigin(r *http.Request) error { origin := r.Header.Get("Origin") - if origin == "" { - return nil - } - - u, err := url.Parse(origin) - if err != nil { - return fmt.Errorf("failed to parse Origin header %q: %w", origin, err) - } - - if strings.EqualFold(r.Host, u.Host) { - return nil - } - - for _, hostPattern := range originHosts { - matched, err := match(hostPattern, u.Host) + if origin != "" { + u, err := url.Parse(origin) if err != nil { - return fmt.Errorf("failed to parse filepath pattern %q: %w", hostPattern, err) + return fmt.Errorf("failed to parse Origin header %q: %w", origin, err) } - if matched { - return nil + if !strings.EqualFold(u.Host, r.Host) { + return fmt.Errorf("request Origin %q is not authorized for Host %q", origin, r.Host) } } - return fmt.Errorf("request Origin %q is not authorized for Host %q", origin, r.Host) -} - -func match(pattern, s string) (bool, error) { - return filepath.Match(strings.ToLower(pattern), strings.ToLower(s)) + return nil } func selectSubprotocol(r *http.Request, subprotocols []string) string { @@ -239,9 +200,8 @@ func acceptCompression(r *http.Request, w http.ResponseWriter, mode CompressionM switch ext.name { case "permessage-deflate": return acceptDeflate(w, ext, mode) - // Disabled for now, see https://github.com/nhooyr/websocket/issues/218 - // case "x-webkit-deflate-frame": - // return acceptWebkitDeflate(w, ext, mode) + case "x-webkit-deflate-frame": + return acceptWebkitDeflate(w, ext, mode) } } return nil, nil @@ -275,6 +235,16 @@ func acceptDeflate(w http.ResponseWriter, ext websocketExtension, mode Compressi return copts, nil } +// parseExtensionParameter parses the value in the extension parameter p. +func parseExtensionParameter(p string) (int, bool) { + ps := strings.Split(p, "=") + if len(ps) == 1 { + return 0, false + } + i, e := strconv.Atoi(strings.Trim(ps[1], `"`)) + return i, e == nil +} + func acceptWebkitDeflate(w http.ResponseWriter, ext websocketExtension, mode CompressionMode) (*compressionOptions, error) { copts := mode.opts() // The peer must explicitly request it. @@ -309,9 +279,11 @@ func acceptWebkitDeflate(w http.ResponseWriter, ext websocketExtension, mode Com return copts, nil } -func headerContainsTokenIgnoreCase(h http.Header, key, token string) bool { +func headerContainsToken(h http.Header, key, token string) bool { + token = strings.ToLower(token) + for _, t := range headerTokens(h, key) { - if strings.EqualFold(t, token) { + if t == token { return true } } @@ -352,6 +324,7 @@ func headerTokens(h http.Header, key string) []string { for _, v := range h[key] { v = strings.TrimSpace(v) for _, t := range strings.Split(v, ",") { + t = strings.ToLower(t) t = strings.TrimSpace(t) tokens = append(tokens, t) } diff --git a/vendor/nhooyr.io/websocket/accept_js.go b/vendor/nhooyr.io/websocket/accept_js.go index daad4b79fe..724b35b5bc 100644 --- a/vendor/nhooyr.io/websocket/accept_js.go +++ b/vendor/nhooyr.io/websocket/accept_js.go @@ -9,7 +9,6 @@ import ( type AcceptOptions struct { Subprotocols []string InsecureSkipVerify bool - OriginPatterns []string CompressionMode CompressionMode CompressionThreshold int } diff --git a/vendor/nhooyr.io/websocket/close_notjs.go b/vendor/nhooyr.io/websocket/close_notjs.go index 4251311d2e..c25b088f19 100644 --- a/vendor/nhooyr.io/websocket/close_notjs.go +++ b/vendor/nhooyr.io/websocket/close_notjs.go @@ -34,17 +34,15 @@ func (c *Conn) Close(code StatusCode, reason string) error { func (c *Conn) closeHandshake(code StatusCode, reason string) (err error) { defer errd.Wrap(&err, "failed to close WebSocket") - writeErr := c.writeClose(code, reason) - closeHandshakeErr := c.waitCloseHandshake() - - if writeErr != nil { - return writeErr + err = c.writeClose(code, reason) + if err != nil && CloseStatus(err) == -1 && err != errAlreadyWroteClose { + return err } - if CloseStatus(closeHandshakeErr) == -1 { - return closeHandshakeErr + err = c.waitCloseHandshake() + if CloseStatus(err) == -1 { + return err } - return nil } @@ -52,10 +50,10 @@ var errAlreadyWroteClose = errors.New("already wrote close") func (c *Conn) writeClose(code StatusCode, reason string) error { c.closeMu.Lock() - wroteClose := c.wroteClose + closing := c.wroteClose c.wroteClose = true c.closeMu.Unlock() - if wroteClose { + if closing { return errAlreadyWroteClose } @@ -64,41 +62,35 @@ func (c *Conn) writeClose(code StatusCode, reason string) error { Reason: reason, } + c.setCloseErr(fmt.Errorf("sent close frame: %w", ce)) + var p []byte - var marshalErr error + var err error if ce.Code != StatusNoStatusRcvd { - p, marshalErr = ce.bytes() - if marshalErr != nil { - log.Printf("websocket: %v", marshalErr) + p, err = ce.bytes() + if err != nil { + log.Printf("websocket: %v", err) } } - writeErr := c.writeControl(context.Background(), opClose, p) - if CloseStatus(writeErr) != -1 { - // Not a real error if it's due to a close frame being received. - writeErr = nil - } - - // We do this after in case there was an error writing the close frame. - c.setCloseErr(fmt.Errorf("sent close frame: %w", ce)) - - if marshalErr != nil { - return marshalErr + werr := c.writeControl(context.Background(), opClose, p) + if err != nil { + return err } - return writeErr + return werr } func (c *Conn) waitCloseHandshake() error { defer c.close(nil) - ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) + ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) defer cancel() - err := c.readMu.lock(ctx) + err := c.readMu.Lock(ctx) if err != nil { return err } - defer c.readMu.unlock() + defer c.readMu.Unlock() if c.readCloseFrameErr != nil { return c.readCloseFrameErr diff --git a/vendor/nhooyr.io/websocket/compress.go b/vendor/nhooyr.io/websocket/compress.go index 80b46d1c1d..57446d01f4 100644 --- a/vendor/nhooyr.io/websocket/compress.go +++ b/vendor/nhooyr.io/websocket/compress.go @@ -7,7 +7,6 @@ package websocket // by safari. See https://tools.ietf.org/html/draft-tyoshino-hybi-websocket-perframe-deflate-06 // It will work the same in every way except that we cannot signal to the peer we // want to use no context takeover on our side, we can only signal that they should. -// It is however currently disabled due to Safari bugs. See https://github.com/nhooyr/websocket/issues/218 type CompressionMode int const ( diff --git a/vendor/nhooyr.io/websocket/conn_notjs.go b/vendor/nhooyr.io/websocket/conn_notjs.go index 0c85ab7711..7ee60fbc30 100644 --- a/vendor/nhooyr.io/websocket/conn_notjs.go +++ b/vendor/nhooyr.io/websocket/conn_notjs.go @@ -139,9 +139,16 @@ func (c *Conn) close(err error) { c.rwc.Close() go func() { + if c.client { + c.writeFrameMu.Lock(context.Background()) + putBufioWriter(c.bw) + } c.msgWriterState.close() c.msgReader.close() + if c.client { + putBufioReader(c.br) + } }() } @@ -189,7 +196,7 @@ func (c *Conn) Ping(ctx context.Context) error { } func (c *Conn) ping(ctx context.Context, p string) error { - pong := make(chan struct{}, 1) + pong := make(chan struct{}) c.activePingsMu.Lock() c.activePings[p] = pong @@ -230,11 +237,7 @@ func newMu(c *Conn) *mu { } } -func (m *mu) forceLock() { - m.ch <- struct{}{} -} - -func (m *mu) lock(ctx context.Context) error { +func (m *mu) Lock(ctx context.Context) error { select { case <-m.c.closed: return m.c.closeErr @@ -243,21 +246,11 @@ func (m *mu) lock(ctx context.Context) error { m.c.close(err) return err case m.ch <- struct{}{}: - // To make sure the connection is certainly alive. - // As it's possible the send on m.ch was selected - // over the receive on closed. - select { - case <-m.c.closed: - // Make sure to release. - m.unlock() - return m.c.closeErr - default: - } return nil } } -func (m *mu) unlock() { +func (m *mu) Unlock() { select { case <-m.ch: default: diff --git a/vendor/nhooyr.io/websocket/dial.go b/vendor/nhooyr.io/websocket/dial.go index 7a7787ff71..f882f122f5 100644 --- a/vendor/nhooyr.io/websocket/dial.go +++ b/vendor/nhooyr.io/websocket/dial.go @@ -8,6 +8,7 @@ import ( "context" "crypto/rand" "encoding/base64" + "errors" "fmt" "io" "io/ioutil" @@ -57,8 +58,6 @@ type DialOptions struct { // This function requires at least Go 1.12 as it uses a new feature // in net/http to perform WebSocket handshakes. // See docs on the HTTPClient option and https://github.com/golang/go/issues/26937#issuecomment-415855861 -// -// URLs with http/https schemes will work and are interpreted as ws/wss. func Dial(ctx context.Context, u string, opts *DialOptions) (*Conn, *http.Response, error) { return dial(ctx, u, opts, nil) } @@ -73,17 +72,7 @@ func dial(ctx context.Context, urls string, opts *DialOptions, rand io.Reader) ( opts = &*opts if opts.HTTPClient == nil { opts.HTTPClient = http.DefaultClient - } else if opts.HTTPClient.Timeout > 0 { - var cancel context.CancelFunc - - ctx, cancel = context.WithTimeout(ctx, opts.HTTPClient.Timeout) - defer cancel() - - newClient := *opts.HTTPClient - newClient.Timeout = 0 - opts.HTTPClient = &newClient } - if opts.HTTPHeader == nil { opts.HTTPHeader = http.Header{} } @@ -142,6 +131,10 @@ func dial(ctx context.Context, urls string, opts *DialOptions, rand io.Reader) ( } func handshakeRequest(ctx context.Context, urls string, opts *DialOptions, copts *compressionOptions, secWebSocketKey string) (*http.Response, error) { + if opts.HTTPClient.Timeout > 0 { + return nil, errors.New("use context for cancellation instead of http.Client.Timeout; see https://github.com/nhooyr/websocket/issues/67") + } + u, err := url.Parse(urls) if err != nil { return nil, fmt.Errorf("failed to parse url: %w", err) @@ -152,7 +145,6 @@ func handshakeRequest(ctx context.Context, urls string, opts *DialOptions, copts u.Scheme = "http" case "wss": u.Scheme = "https" - case "http", "https": default: return nil, fmt.Errorf("unexpected url scheme: %q", u.Scheme) } @@ -194,11 +186,11 @@ func verifyServerResponse(opts *DialOptions, copts *compressionOptions, secWebSo return nil, fmt.Errorf("expected handshake response status code %v but got %v", http.StatusSwitchingProtocols, resp.StatusCode) } - if !headerContainsTokenIgnoreCase(resp.Header, "Connection", "Upgrade") { + if !headerContainsToken(resp.Header, "Connection", "Upgrade") { return nil, fmt.Errorf("WebSocket protocol violation: Connection header %q does not contain Upgrade", resp.Header.Get("Connection")) } - if !headerContainsTokenIgnoreCase(resp.Header, "Upgrade", "WebSocket") { + if !headerContainsToken(resp.Header, "Upgrade", "WebSocket") { return nil, fmt.Errorf("WebSocket protocol violation: Upgrade header %q does not contain websocket", resp.Header.Get("Upgrade")) } @@ -261,10 +253,10 @@ func verifyServerExtensions(copts *compressionOptions, h http.Header) (*compress return copts, nil } -var bufioReaderPool sync.Pool +var readerPool sync.Pool func getBufioReader(r io.Reader) *bufio.Reader { - br, ok := bufioReaderPool.Get().(*bufio.Reader) + br, ok := readerPool.Get().(*bufio.Reader) if !ok { return bufio.NewReader(r) } @@ -273,13 +265,13 @@ func getBufioReader(r io.Reader) *bufio.Reader { } func putBufioReader(br *bufio.Reader) { - bufioReaderPool.Put(br) + readerPool.Put(br) } -var bufioWriterPool sync.Pool +var writerPool sync.Pool func getBufioWriter(w io.Writer) *bufio.Writer { - bw, ok := bufioWriterPool.Get().(*bufio.Writer) + bw, ok := writerPool.Get().(*bufio.Writer) if !ok { return bufio.NewWriter(w) } @@ -288,5 +280,5 @@ func getBufioWriter(w io.Writer) *bufio.Writer { } func putBufioWriter(bw *bufio.Writer) { - bufioWriterPool.Put(bw) + writerPool.Put(bw) } diff --git a/vendor/nhooyr.io/websocket/go.mod b/vendor/nhooyr.io/websocket/go.mod index c5f1a20f59..801d6be6d4 100644 --- a/vendor/nhooyr.io/websocket/go.mod +++ b/vendor/nhooyr.io/websocket/go.mod @@ -3,13 +3,12 @@ module nhooyr.io/websocket go 1.13 require ( - github.com/gin-gonic/gin v1.6.3 github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee // indirect github.com/gobwas/pool v0.2.0 // indirect github.com/gobwas/ws v1.0.2 - github.com/golang/protobuf v1.3.5 + github.com/golang/protobuf v1.3.3 github.com/google/go-cmp v0.4.0 github.com/gorilla/websocket v1.4.1 - github.com/klauspost/compress v1.10.3 + github.com/klauspost/compress v1.10.0 golang.org/x/time v0.0.0-20191024005414-555d28b269f0 ) diff --git a/vendor/nhooyr.io/websocket/go.sum b/vendor/nhooyr.io/websocket/go.sum index 155c301326..e4bbd62d33 100644 --- a/vendor/nhooyr.io/websocket/go.sum +++ b/vendor/nhooyr.io/websocket/go.sum @@ -1,64 +1,18 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= -github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= -github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5 h1:F768QJ1E9tib+q5Sc8MkdJi1RxLTbRcTf8LJV56aRls= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/klauspost/compress v1.10.3 h1:OP96hzwJVBIHYU52pVTI6CczrxPvrGfgqF9N5eTO0Q8= -github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +github.com/klauspost/compress v1.10.0 h1:92XGj1AcYzA6UrVdd4qIIBrT8OroryvRvdmg/IfmC7Y= +github.com/klauspost/compress v1.10.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/nhooyr.io/websocket/read.go b/vendor/nhooyr.io/websocket/read.go index ae05cf93ed..a1efecabb2 100644 --- a/vendor/nhooyr.io/websocket/read.go +++ b/vendor/nhooyr.io/websocket/read.go @@ -52,7 +52,7 @@ func (c *Conn) Read(ctx context.Context) (MessageType, []byte, error) { // // Call CloseRead when you do not expect to read any more messages. // Since it actively reads from the connection, it will ensure that ping, pong and close -// frames are responded to. This means c.Ping and c.Close will still work as expected. +// frames are responded to. func (c *Conn) CloseRead(ctx context.Context) context.Context { ctx, cancel := context.WithCancel(ctx) go func() { @@ -109,17 +109,12 @@ func (mr *msgReader) putFlateReader() { } func (mr *msgReader) close() { - mr.c.readMu.forceLock() + mr.c.readMu.Lock(context.Background()) mr.putFlateReader() mr.dict.close() if mr.flateBufio != nil { putBufioReader(mr.flateBufio) } - - if mr.c.client { - putBufioReader(mr.c.br) - mr.c.br = nil - } } func (mr *msgReader) flateContextTakeover() bool { @@ -271,10 +266,7 @@ func (c *Conn) handleControl(ctx context.Context, h header) (err error) { pong, ok := c.activePings[string(b)] c.activePingsMu.Unlock() if ok { - select { - case pong <- struct{}{}: - default: - } + close(pong) } return nil } @@ -300,16 +292,14 @@ func (c *Conn) handleControl(ctx context.Context, h header) (err error) { func (c *Conn) reader(ctx context.Context) (_ MessageType, _ io.Reader, err error) { defer errd.Wrap(&err, "failed to get reader") - err = c.readMu.lock(ctx) + err = c.readMu.Lock(ctx) if err != nil { return 0, nil, err } - defer c.readMu.unlock() + defer c.readMu.Unlock() if !c.msgReader.fin { - err = errors.New("previous message not read to completion") - c.close(fmt.Errorf("failed to get reader: %w", err)) - return 0, nil, err + return 0, nil, errors.New("previous message not read to completion") } h, err := c.readLoop(ctx) @@ -366,25 +356,29 @@ func (mr *msgReader) setFrame(h header) { } func (mr *msgReader) Read(p []byte) (n int, err error) { - err = mr.c.readMu.lock(mr.ctx) + defer func() { + if errors.Is(err, io.ErrUnexpectedEOF) && mr.fin && mr.flate { + err = io.EOF + } + if errors.Is(err, io.EOF) { + err = io.EOF + mr.putFlateReader() + return + } + errd.Wrap(&err, "failed to read") + }() + + err = mr.c.readMu.Lock(mr.ctx) if err != nil { - return 0, fmt.Errorf("failed to read: %w", err) + return 0, err } - defer mr.c.readMu.unlock() + defer mr.c.readMu.Unlock() n, err = mr.limitReader.Read(p) if mr.flate && mr.flateContextTakeover() { p = p[:n] mr.dict.write(p) } - if errors.Is(err, io.EOF) || errors.Is(err, io.ErrUnexpectedEOF) && mr.fin && mr.flate { - mr.putFlateReader() - return n, io.EOF - } - if err != nil { - err = fmt.Errorf("failed to read: %w", err) - mr.c.close(err) - } return n, err } diff --git a/vendor/nhooyr.io/websocket/write.go b/vendor/nhooyr.io/websocket/write.go index 2210cf817a..81b9141ae7 100644 --- a/vendor/nhooyr.io/websocket/write.go +++ b/vendor/nhooyr.io/websocket/write.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "io" + "sync" "time" "github.com/klauspost/compress/flate" @@ -70,7 +71,7 @@ type msgWriterState struct { c *Conn mu *mu - writeMu *mu + writeMu sync.Mutex ctx context.Context opcode opcode @@ -82,9 +83,8 @@ type msgWriterState struct { func newMsgWriterState(c *Conn) *msgWriterState { mw := &msgWriterState{ - c: c, - mu: newMu(c), - writeMu: newMu(c), + c: c, + mu: newMu(c), } return mw } @@ -125,7 +125,7 @@ func (c *Conn) write(ctx context.Context, typ MessageType, p []byte) (int, error } if !c.flate() { - defer c.msgWriterState.mu.unlock() + defer c.msgWriterState.mu.Unlock() return c.writeFrame(ctx, true, false, c.msgWriterState.opcode, p) } @@ -139,7 +139,7 @@ func (c *Conn) write(ctx context.Context, typ MessageType, p []byte) (int, error } func (mw *msgWriterState) reset(ctx context.Context, typ MessageType) error { - err := mw.mu.lock(ctx) + err := mw.mu.Lock(ctx) if err != nil { return err } @@ -155,18 +155,10 @@ func (mw *msgWriterState) reset(ctx context.Context, typ MessageType) error { // Write writes the given bytes to the WebSocket connection. func (mw *msgWriterState) Write(p []byte) (_ int, err error) { - err = mw.writeMu.lock(mw.ctx) - if err != nil { - return 0, fmt.Errorf("failed to write: %w", err) - } - defer mw.writeMu.unlock() + defer errd.Wrap(&err, "failed to write") - defer func() { - if err != nil { - err = fmt.Errorf("failed to write: %w", err) - mw.c.close(err) - } - }() + mw.writeMu.Lock() + defer mw.writeMu.Unlock() if mw.c.flate() { // Only enables flate if the length crosses the @@ -201,11 +193,8 @@ func (mw *msgWriterState) write(p []byte) (int, error) { func (mw *msgWriterState) Close() (err error) { defer errd.Wrap(&err, "failed to close writer") - err = mw.writeMu.lock(mw.ctx) - if err != nil { - return err - } - defer mw.writeMu.unlock() + mw.writeMu.Lock() + defer mw.writeMu.Unlock() _, err = mw.c.writeFrame(mw.ctx, true, mw.flate, mw.opcode, nil) if err != nil { @@ -215,17 +204,12 @@ func (mw *msgWriterState) Close() (err error) { if mw.flate && !mw.flateContextTakeover() { mw.dict.close() } - mw.mu.unlock() + mw.mu.Unlock() return nil } func (mw *msgWriterState) close() { - if mw.c.client { - mw.c.writeFrameMu.forceLock() - putBufioWriter(mw.c.bw) - } - - mw.writeMu.forceLock() + mw.writeMu.Lock() mw.dict.close() } @@ -241,29 +225,12 @@ func (c *Conn) writeControl(ctx context.Context, opcode opcode, p []byte) error } // frame handles all writes to the connection. -func (c *Conn) writeFrame(ctx context.Context, fin bool, flate bool, opcode opcode, p []byte) (_ int, err error) { - err = c.writeFrameMu.lock(ctx) +func (c *Conn) writeFrame(ctx context.Context, fin bool, flate bool, opcode opcode, p []byte) (int, error) { + err := c.writeFrameMu.Lock(ctx) if err != nil { return 0, err } - defer c.writeFrameMu.unlock() - - // If the state says a close has already been written, we wait until - // the connection is closed and return that error. - // - // However, if the frame being written is a close, that means its the close from - // the state being set so we let it go through. - c.closeMu.Lock() - wroteClose := c.wroteClose - c.closeMu.Unlock() - if wroteClose && opcode != opClose { - select { - case <-ctx.Done(): - return 0, ctx.Err() - case <-c.closed: - return 0, c.closeErr - } - } + defer c.writeFrameMu.Unlock() select { case <-c.closed: @@ -271,19 +238,6 @@ func (c *Conn) writeFrame(ctx context.Context, fin bool, flate bool, opcode opco case c.writeTimeout <- ctx: } - defer func() { - if err != nil { - select { - case <-c.closed: - err = c.closeErr - case <-ctx.Done(): - err = ctx.Err() - } - c.close(err) - err = fmt.Errorf("failed to write frame: %w", err) - } - }() - c.writeHeader.fin = fin c.writeHeader.opcode = opcode c.writeHeader.payloadLength = int64(len(p)) diff --git a/vendor/nhooyr.io/websocket/ws_js.go b/vendor/nhooyr.io/websocket/ws_js.go index b87e32cdaf..2b560ce87d 100644 --- a/vendor/nhooyr.io/websocket/ws_js.go +++ b/vendor/nhooyr.io/websocket/ws_js.go @@ -9,7 +9,6 @@ import ( "net/http" "reflect" "runtime" - "strings" "sync" "syscall/js" @@ -256,9 +255,6 @@ func dial(ctx context.Context, url string, opts *DialOptions) (*Conn, *http.Resp opts = &DialOptions{} } - url = strings.Replace(url, "http://", "ws://", 1) - url = strings.Replace(url, "https://", "wss://", 1) - ws, err := wsjs.New(url, opts.Subprotocols) if err != nil { return nil, nil, err